@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-GXIITUGM.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-NNAHWZGK.js";
|
|
61
|
+
import {
|
|
62
|
+
isDevelopment
|
|
63
|
+
} from "./chunk-FNLKMX3W.js";
|
|
63
64
|
import {
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
emptyIcon,
|
|
66
|
+
require_react
|
|
67
|
+
} from "./chunk-IDYSRNE5.js";
|
|
66
68
|
import {
|
|
67
69
|
AsyncFzf,
|
|
68
70
|
Config,
|
|
@@ -136,7 +138,6 @@ import {
|
|
|
136
138
|
import_lru_cache,
|
|
137
139
|
import_lru_map_with_delete,
|
|
138
140
|
import_multi_map,
|
|
139
|
-
isGitRepository,
|
|
140
141
|
isGuiEditor,
|
|
141
142
|
isNightly,
|
|
142
143
|
isPrivateIp,
|
|
@@ -196,7 +197,7 @@ import {
|
|
|
196
197
|
stripAnsi,
|
|
197
198
|
tokenLimit,
|
|
198
199
|
uiTelemetryService
|
|
199
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-VUMF52YD.js";
|
|
200
201
|
import {
|
|
201
202
|
ApprovalMode,
|
|
202
203
|
CoreEvent,
|
|
@@ -222,7 +223,7 @@ import {
|
|
|
222
223
|
shortenPath,
|
|
223
224
|
tildeifyPath,
|
|
224
225
|
unescapePath
|
|
225
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-533APETE.js";
|
|
226
227
|
import {
|
|
227
228
|
require_src
|
|
228
229
|
} from "./chunk-RJTRUG2J.js";
|
|
@@ -273,11 +274,11 @@ var require_signals = __commonJS({
|
|
|
273
274
|
// node_modules/ink/node_modules/signal-exit/index.js
|
|
274
275
|
var require_signal_exit = __commonJS({
|
|
275
276
|
"node_modules/ink/node_modules/signal-exit/index.js"(exports, module) {
|
|
276
|
-
var
|
|
277
|
-
var processOk = function(
|
|
278
|
-
return
|
|
277
|
+
var process34 = global.process;
|
|
278
|
+
var processOk = function(process35) {
|
|
279
|
+
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";
|
|
279
280
|
};
|
|
280
|
-
if (!processOk(
|
|
281
|
+
if (!processOk(process34)) {
|
|
281
282
|
module.exports = function() {
|
|
282
283
|
return function() {
|
|
283
284
|
};
|
|
@@ -285,15 +286,15 @@ var require_signal_exit = __commonJS({
|
|
|
285
286
|
} else {
|
|
286
287
|
assert = __require("assert");
|
|
287
288
|
signals = require_signals();
|
|
288
|
-
isWin = /^win/i.test(
|
|
289
|
+
isWin = /^win/i.test(process34.platform);
|
|
289
290
|
EE = __require("events");
|
|
290
291
|
if (typeof EE !== "function") {
|
|
291
292
|
EE = EE.EventEmitter;
|
|
292
293
|
}
|
|
293
|
-
if (
|
|
294
|
-
emitter =
|
|
294
|
+
if (process34.__signal_exit_emitter__) {
|
|
295
|
+
emitter = process34.__signal_exit_emitter__;
|
|
295
296
|
} else {
|
|
296
|
-
emitter =
|
|
297
|
+
emitter = process34.__signal_exit_emitter__ = new EE();
|
|
297
298
|
emitter.count = 0;
|
|
298
299
|
emitter.emitted = {};
|
|
299
300
|
}
|
|
@@ -330,12 +331,12 @@ var require_signal_exit = __commonJS({
|
|
|
330
331
|
loaded = false;
|
|
331
332
|
signals.forEach(function(sig) {
|
|
332
333
|
try {
|
|
333
|
-
|
|
334
|
+
process34.removeListener(sig, sigListeners[sig]);
|
|
334
335
|
} catch (er2) {
|
|
335
336
|
}
|
|
336
337
|
});
|
|
337
|
-
|
|
338
|
-
|
|
338
|
+
process34.emit = originalProcessEmit;
|
|
339
|
+
process34.reallyExit = originalProcessReallyExit;
|
|
339
340
|
emitter.count -= 1;
|
|
340
341
|
};
|
|
341
342
|
module.exports.unload = unload;
|
|
@@ -352,7 +353,7 @@ var require_signal_exit = __commonJS({
|
|
|
352
353
|
if (!processOk(global.process)) {
|
|
353
354
|
return;
|
|
354
355
|
}
|
|
355
|
-
var listeners =
|
|
356
|
+
var listeners = process34.listeners(sig);
|
|
356
357
|
if (listeners.length === emitter.count) {
|
|
357
358
|
unload();
|
|
358
359
|
emit("exit", null, sig);
|
|
@@ -360,7 +361,7 @@ var require_signal_exit = __commonJS({
|
|
|
360
361
|
if (isWin && sig === "SIGHUP") {
|
|
361
362
|
sig = "SIGINT";
|
|
362
363
|
}
|
|
363
|
-
|
|
364
|
+
process34.kill(process34.pid, sig);
|
|
364
365
|
}
|
|
365
366
|
};
|
|
366
367
|
});
|
|
@@ -376,36 +377,36 @@ var require_signal_exit = __commonJS({
|
|
|
376
377
|
emitter.count += 1;
|
|
377
378
|
signals = signals.filter(function(sig) {
|
|
378
379
|
try {
|
|
379
|
-
|
|
380
|
+
process34.on(sig, sigListeners[sig]);
|
|
380
381
|
return true;
|
|
381
382
|
} catch (er2) {
|
|
382
383
|
return false;
|
|
383
384
|
}
|
|
384
385
|
});
|
|
385
|
-
|
|
386
|
-
|
|
386
|
+
process34.emit = processEmit;
|
|
387
|
+
process34.reallyExit = processReallyExit;
|
|
387
388
|
};
|
|
388
389
|
module.exports.load = load;
|
|
389
|
-
originalProcessReallyExit =
|
|
390
|
+
originalProcessReallyExit = process34.reallyExit;
|
|
390
391
|
processReallyExit = function processReallyExit2(code) {
|
|
391
392
|
if (!processOk(global.process)) {
|
|
392
393
|
return;
|
|
393
394
|
}
|
|
394
|
-
|
|
395
|
+
process34.exitCode = code || /* istanbul ignore next */
|
|
395
396
|
0;
|
|
396
|
-
emit("exit",
|
|
397
|
-
emit("afterexit",
|
|
398
|
-
originalProcessReallyExit.call(
|
|
397
|
+
emit("exit", process34.exitCode, null);
|
|
398
|
+
emit("afterexit", process34.exitCode, null);
|
|
399
|
+
originalProcessReallyExit.call(process34, process34.exitCode);
|
|
399
400
|
};
|
|
400
|
-
originalProcessEmit =
|
|
401
|
+
originalProcessEmit = process34.emit;
|
|
401
402
|
processEmit = function processEmit2(ev, arg) {
|
|
402
403
|
if (ev === "exit" && processOk(global.process)) {
|
|
403
404
|
if (arg !== void 0) {
|
|
404
|
-
|
|
405
|
+
process34.exitCode = arg;
|
|
405
406
|
}
|
|
406
407
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
407
|
-
emit("exit",
|
|
408
|
-
emit("afterexit",
|
|
408
|
+
emit("exit", process34.exitCode, null);
|
|
409
|
+
emit("afterexit", process34.exitCode, null);
|
|
409
410
|
return ret;
|
|
410
411
|
} else {
|
|
411
412
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -8786,11 +8787,11 @@ var require_signals2 = __commonJS({
|
|
|
8786
8787
|
// node_modules/restore-cursor/node_modules/signal-exit/index.js
|
|
8787
8788
|
var require_signal_exit2 = __commonJS({
|
|
8788
8789
|
"node_modules/restore-cursor/node_modules/signal-exit/index.js"(exports, module) {
|
|
8789
|
-
var
|
|
8790
|
-
var processOk = function(
|
|
8791
|
-
return
|
|
8790
|
+
var process34 = global.process;
|
|
8791
|
+
var processOk = function(process35) {
|
|
8792
|
+
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";
|
|
8792
8793
|
};
|
|
8793
|
-
if (!processOk(
|
|
8794
|
+
if (!processOk(process34)) {
|
|
8794
8795
|
module.exports = function() {
|
|
8795
8796
|
return function() {
|
|
8796
8797
|
};
|
|
@@ -8798,15 +8799,15 @@ var require_signal_exit2 = __commonJS({
|
|
|
8798
8799
|
} else {
|
|
8799
8800
|
assert = __require("assert");
|
|
8800
8801
|
signals = require_signals2();
|
|
8801
|
-
isWin = /^win/i.test(
|
|
8802
|
+
isWin = /^win/i.test(process34.platform);
|
|
8802
8803
|
EE = __require("events");
|
|
8803
8804
|
if (typeof EE !== "function") {
|
|
8804
8805
|
EE = EE.EventEmitter;
|
|
8805
8806
|
}
|
|
8806
|
-
if (
|
|
8807
|
-
emitter =
|
|
8807
|
+
if (process34.__signal_exit_emitter__) {
|
|
8808
|
+
emitter = process34.__signal_exit_emitter__;
|
|
8808
8809
|
} else {
|
|
8809
|
-
emitter =
|
|
8810
|
+
emitter = process34.__signal_exit_emitter__ = new EE();
|
|
8810
8811
|
emitter.count = 0;
|
|
8811
8812
|
emitter.emitted = {};
|
|
8812
8813
|
}
|
|
@@ -8843,12 +8844,12 @@ var require_signal_exit2 = __commonJS({
|
|
|
8843
8844
|
loaded = false;
|
|
8844
8845
|
signals.forEach(function(sig) {
|
|
8845
8846
|
try {
|
|
8846
|
-
|
|
8847
|
+
process34.removeListener(sig, sigListeners[sig]);
|
|
8847
8848
|
} catch (er2) {
|
|
8848
8849
|
}
|
|
8849
8850
|
});
|
|
8850
|
-
|
|
8851
|
-
|
|
8851
|
+
process34.emit = originalProcessEmit;
|
|
8852
|
+
process34.reallyExit = originalProcessReallyExit;
|
|
8852
8853
|
emitter.count -= 1;
|
|
8853
8854
|
};
|
|
8854
8855
|
module.exports.unload = unload;
|
|
@@ -8865,7 +8866,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
8865
8866
|
if (!processOk(global.process)) {
|
|
8866
8867
|
return;
|
|
8867
8868
|
}
|
|
8868
|
-
var listeners =
|
|
8869
|
+
var listeners = process34.listeners(sig);
|
|
8869
8870
|
if (listeners.length === emitter.count) {
|
|
8870
8871
|
unload();
|
|
8871
8872
|
emit("exit", null, sig);
|
|
@@ -8873,7 +8874,7 @@ var require_signal_exit2 = __commonJS({
|
|
|
8873
8874
|
if (isWin && sig === "SIGHUP") {
|
|
8874
8875
|
sig = "SIGINT";
|
|
8875
8876
|
}
|
|
8876
|
-
|
|
8877
|
+
process34.kill(process34.pid, sig);
|
|
8877
8878
|
}
|
|
8878
8879
|
};
|
|
8879
8880
|
});
|
|
@@ -8889,36 +8890,36 @@ var require_signal_exit2 = __commonJS({
|
|
|
8889
8890
|
emitter.count += 1;
|
|
8890
8891
|
signals = signals.filter(function(sig) {
|
|
8891
8892
|
try {
|
|
8892
|
-
|
|
8893
|
+
process34.on(sig, sigListeners[sig]);
|
|
8893
8894
|
return true;
|
|
8894
8895
|
} catch (er2) {
|
|
8895
8896
|
return false;
|
|
8896
8897
|
}
|
|
8897
8898
|
});
|
|
8898
|
-
|
|
8899
|
-
|
|
8899
|
+
process34.emit = processEmit;
|
|
8900
|
+
process34.reallyExit = processReallyExit;
|
|
8900
8901
|
};
|
|
8901
8902
|
module.exports.load = load;
|
|
8902
|
-
originalProcessReallyExit =
|
|
8903
|
+
originalProcessReallyExit = process34.reallyExit;
|
|
8903
8904
|
processReallyExit = function processReallyExit2(code) {
|
|
8904
8905
|
if (!processOk(global.process)) {
|
|
8905
8906
|
return;
|
|
8906
8907
|
}
|
|
8907
|
-
|
|
8908
|
+
process34.exitCode = code || /* istanbul ignore next */
|
|
8908
8909
|
0;
|
|
8909
|
-
emit("exit",
|
|
8910
|
-
emit("afterexit",
|
|
8911
|
-
originalProcessReallyExit.call(
|
|
8910
|
+
emit("exit", process34.exitCode, null);
|
|
8911
|
+
emit("afterexit", process34.exitCode, null);
|
|
8912
|
+
originalProcessReallyExit.call(process34, process34.exitCode);
|
|
8912
8913
|
};
|
|
8913
|
-
originalProcessEmit =
|
|
8914
|
+
originalProcessEmit = process34.emit;
|
|
8914
8915
|
processEmit = function processEmit2(ev, arg) {
|
|
8915
8916
|
if (ev === "exit" && processOk(global.process)) {
|
|
8916
8917
|
if (arg !== void 0) {
|
|
8917
|
-
|
|
8918
|
+
process34.exitCode = arg;
|
|
8918
8919
|
}
|
|
8919
8920
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
8920
|
-
emit("exit",
|
|
8921
|
-
emit("afterexit",
|
|
8921
|
+
emit("exit", process34.exitCode, null);
|
|
8922
|
+
emit("afterexit", process34.exitCode, null);
|
|
8922
8923
|
return ret;
|
|
8923
8924
|
} else {
|
|
8924
8925
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -9682,12 +9683,12 @@ var require_prompt = __commonJS({
|
|
|
9682
9683
|
var readline = __require("readline");
|
|
9683
9684
|
var _require = require_util();
|
|
9684
9685
|
var action = _require.action;
|
|
9685
|
-
var
|
|
9686
|
+
var EventEmitter3 = __require("events");
|
|
9686
9687
|
var _require2 = require_src3();
|
|
9687
9688
|
var beep2 = _require2.beep;
|
|
9688
9689
|
var cursor = _require2.cursor;
|
|
9689
9690
|
var color = require_kleur();
|
|
9690
|
-
var Prompt = class extends
|
|
9691
|
+
var Prompt = class extends EventEmitter3 {
|
|
9691
9692
|
constructor(opts = {}) {
|
|
9692
9693
|
super();
|
|
9693
9694
|
this.firstRender = true;
|
|
@@ -12147,10 +12148,10 @@ var require_prompt2 = __commonJS({
|
|
|
12147
12148
|
"use strict";
|
|
12148
12149
|
var readline = __require("readline");
|
|
12149
12150
|
var { action } = require_util2();
|
|
12150
|
-
var
|
|
12151
|
+
var EventEmitter3 = __require("events");
|
|
12151
12152
|
var { beep: beep2, cursor } = require_src3();
|
|
12152
12153
|
var color = require_kleur();
|
|
12153
|
-
var Prompt = class extends
|
|
12154
|
+
var Prompt = class extends EventEmitter3 {
|
|
12154
12155
|
constructor(opts = {}) {
|
|
12155
12156
|
super();
|
|
12156
12157
|
this.firstRender = true;
|
|
@@ -14257,22 +14258,22 @@ var require_pend = __commonJS({
|
|
|
14257
14258
|
// node_modules/fd-slicer/index.js
|
|
14258
14259
|
var require_fd_slicer = __commonJS({
|
|
14259
14260
|
"node_modules/fd-slicer/index.js"(exports) {
|
|
14260
|
-
var
|
|
14261
|
+
var fs38 = __require("fs");
|
|
14261
14262
|
var util2 = __require("util");
|
|
14262
14263
|
var stream = __require("stream");
|
|
14263
14264
|
var Readable = stream.Readable;
|
|
14264
14265
|
var Writable2 = stream.Writable;
|
|
14265
14266
|
var PassThrough2 = stream.PassThrough;
|
|
14266
14267
|
var Pend = require_pend();
|
|
14267
|
-
var
|
|
14268
|
+
var EventEmitter3 = __require("events").EventEmitter;
|
|
14268
14269
|
exports.createFromBuffer = createFromBuffer;
|
|
14269
14270
|
exports.createFromFd = createFromFd;
|
|
14270
14271
|
exports.BufferSlicer = BufferSlicer;
|
|
14271
14272
|
exports.FdSlicer = FdSlicer;
|
|
14272
|
-
util2.inherits(FdSlicer,
|
|
14273
|
+
util2.inherits(FdSlicer, EventEmitter3);
|
|
14273
14274
|
function FdSlicer(fd, options) {
|
|
14274
14275
|
options = options || {};
|
|
14275
|
-
|
|
14276
|
+
EventEmitter3.call(this);
|
|
14276
14277
|
this.fd = fd;
|
|
14277
14278
|
this.pend = new Pend();
|
|
14278
14279
|
this.pend.max = 1;
|
|
@@ -14282,7 +14283,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14282
14283
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
14283
14284
|
var self = this;
|
|
14284
14285
|
self.pend.go(function(cb) {
|
|
14285
|
-
|
|
14286
|
+
fs38.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
|
|
14286
14287
|
cb();
|
|
14287
14288
|
callback(err, bytesRead, buffer2);
|
|
14288
14289
|
});
|
|
@@ -14291,7 +14292,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14291
14292
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
14292
14293
|
var self = this;
|
|
14293
14294
|
self.pend.go(function(cb) {
|
|
14294
|
-
|
|
14295
|
+
fs38.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
|
|
14295
14296
|
cb();
|
|
14296
14297
|
callback(err, written, buffer2);
|
|
14297
14298
|
});
|
|
@@ -14312,7 +14313,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14312
14313
|
if (self.refCount > 0) return;
|
|
14313
14314
|
if (self.refCount < 0) throw new Error("invalid unref");
|
|
14314
14315
|
if (self.autoClose) {
|
|
14315
|
-
|
|
14316
|
+
fs38.close(self.fd, onCloseDone);
|
|
14316
14317
|
}
|
|
14317
14318
|
function onCloseDone(err) {
|
|
14318
14319
|
if (err) {
|
|
@@ -14349,7 +14350,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14349
14350
|
self.context.pend.go(function(cb) {
|
|
14350
14351
|
if (self.destroyed) return cb();
|
|
14351
14352
|
var buffer = new Buffer(toRead);
|
|
14352
|
-
|
|
14353
|
+
fs38.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
14353
14354
|
if (err) {
|
|
14354
14355
|
self.destroy(err);
|
|
14355
14356
|
} else if (bytesRead === 0) {
|
|
@@ -14396,7 +14397,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14396
14397
|
}
|
|
14397
14398
|
self.context.pend.go(function(cb) {
|
|
14398
14399
|
if (self.destroyed) return cb();
|
|
14399
|
-
|
|
14400
|
+
fs38.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
|
|
14400
14401
|
if (err2) {
|
|
14401
14402
|
self.destroy();
|
|
14402
14403
|
cb();
|
|
@@ -14416,9 +14417,9 @@ var require_fd_slicer = __commonJS({
|
|
|
14416
14417
|
this.destroyed = true;
|
|
14417
14418
|
this.context.unref();
|
|
14418
14419
|
};
|
|
14419
|
-
util2.inherits(BufferSlicer,
|
|
14420
|
+
util2.inherits(BufferSlicer, EventEmitter3);
|
|
14420
14421
|
function BufferSlicer(buffer, options) {
|
|
14421
|
-
|
|
14422
|
+
EventEmitter3.call(this);
|
|
14422
14423
|
options = options || {};
|
|
14423
14424
|
this.refCount = 0;
|
|
14424
14425
|
this.buffer = buffer;
|
|
@@ -14823,12 +14824,12 @@ var require_buffer_crc32 = __commonJS({
|
|
|
14823
14824
|
// node_modules/yauzl/index.js
|
|
14824
14825
|
var require_yauzl = __commonJS({
|
|
14825
14826
|
"node_modules/yauzl/index.js"(exports) {
|
|
14826
|
-
var
|
|
14827
|
+
var fs38 = __require("fs");
|
|
14827
14828
|
var zlib = __require("zlib");
|
|
14828
14829
|
var fd_slicer = require_fd_slicer();
|
|
14829
14830
|
var crc32 = require_buffer_crc32();
|
|
14830
14831
|
var util2 = __require("util");
|
|
14831
|
-
var
|
|
14832
|
+
var EventEmitter3 = __require("events").EventEmitter;
|
|
14832
14833
|
var Transform2 = __require("stream").Transform;
|
|
14833
14834
|
var PassThrough2 = __require("stream").PassThrough;
|
|
14834
14835
|
var Writable2 = __require("stream").Writable;
|
|
@@ -14841,7 +14842,7 @@ var require_yauzl = __commonJS({
|
|
|
14841
14842
|
exports.ZipFile = ZipFile;
|
|
14842
14843
|
exports.Entry = Entry;
|
|
14843
14844
|
exports.RandomAccessReader = RandomAccessReader;
|
|
14844
|
-
function open(
|
|
14845
|
+
function open(path36, options, callback) {
|
|
14845
14846
|
if (typeof options === "function") {
|
|
14846
14847
|
callback = options;
|
|
14847
14848
|
options = null;
|
|
@@ -14853,10 +14854,10 @@ var require_yauzl = __commonJS({
|
|
|
14853
14854
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14854
14855
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14855
14856
|
if (callback == null) callback = defaultCallback;
|
|
14856
|
-
|
|
14857
|
+
fs38.open(path36, "r", function(err, fd) {
|
|
14857
14858
|
if (err) return callback(err);
|
|
14858
14859
|
fromFd(fd, options, function(err2, zipfile) {
|
|
14859
|
-
if (err2)
|
|
14860
|
+
if (err2) fs38.close(fd, defaultCallback);
|
|
14860
14861
|
callback(err2, zipfile);
|
|
14861
14862
|
});
|
|
14862
14863
|
});
|
|
@@ -14873,7 +14874,7 @@ var require_yauzl = __commonJS({
|
|
|
14873
14874
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14874
14875
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14875
14876
|
if (callback == null) callback = defaultCallback;
|
|
14876
|
-
|
|
14877
|
+
fs38.fstat(fd, function(err, stats) {
|
|
14877
14878
|
if (err) return callback(err);
|
|
14878
14879
|
var reader = fd_slicer.createFromFd(fd, { autoClose: true });
|
|
14879
14880
|
fromRandomAccessReader(reader, stats.size, options, callback);
|
|
@@ -14960,10 +14961,10 @@ var require_yauzl = __commonJS({
|
|
|
14960
14961
|
callback(new Error("end of central directory record signature not found"));
|
|
14961
14962
|
});
|
|
14962
14963
|
}
|
|
14963
|
-
util2.inherits(ZipFile,
|
|
14964
|
+
util2.inherits(ZipFile, EventEmitter3);
|
|
14964
14965
|
function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
|
14965
14966
|
var self = this;
|
|
14966
|
-
|
|
14967
|
+
EventEmitter3.call(self);
|
|
14967
14968
|
self.reader = reader;
|
|
14968
14969
|
self.reader.on("error", function(err) {
|
|
14969
14970
|
emitError(self, err);
|
|
@@ -15324,9 +15325,9 @@ var require_yauzl = __commonJS({
|
|
|
15324
15325
|
}
|
|
15325
15326
|
cb();
|
|
15326
15327
|
};
|
|
15327
|
-
util2.inherits(RandomAccessReader,
|
|
15328
|
+
util2.inherits(RandomAccessReader, EventEmitter3);
|
|
15328
15329
|
function RandomAccessReader() {
|
|
15329
|
-
|
|
15330
|
+
EventEmitter3.call(this);
|
|
15330
15331
|
this.refCount = 0;
|
|
15331
15332
|
}
|
|
15332
15333
|
RandomAccessReader.prototype.ref = function() {
|
|
@@ -15453,9 +15454,9 @@ var require_yauzl = __commonJS({
|
|
|
15453
15454
|
var require_extract_zip = __commonJS({
|
|
15454
15455
|
"node_modules/extract-zip/index.js"(exports, module) {
|
|
15455
15456
|
var debug = require_src()("extract-zip");
|
|
15456
|
-
var { createWriteStream: createWriteStream4, promises:
|
|
15457
|
+
var { createWriteStream: createWriteStream4, promises: fs38 } = __require("fs");
|
|
15457
15458
|
var getStream = require_get_stream();
|
|
15458
|
-
var
|
|
15459
|
+
var path36 = __require("path");
|
|
15459
15460
|
var { promisify: promisify5 } = __require("util");
|
|
15460
15461
|
var stream = __require("stream");
|
|
15461
15462
|
var yauzl = require_yauzl();
|
|
@@ -15492,12 +15493,12 @@ var require_extract_zip = __commonJS({
|
|
|
15492
15493
|
this.zipfile.readEntry();
|
|
15493
15494
|
return;
|
|
15494
15495
|
}
|
|
15495
|
-
const destDir =
|
|
15496
|
+
const destDir = path36.dirname(path36.join(this.opts.dir, entry.fileName));
|
|
15496
15497
|
try {
|
|
15497
|
-
await
|
|
15498
|
-
const canonicalDestDir = await
|
|
15499
|
-
const relativeDestDir =
|
|
15500
|
-
if (relativeDestDir.split(
|
|
15498
|
+
await fs38.mkdir(destDir, { recursive: true });
|
|
15499
|
+
const canonicalDestDir = await fs38.realpath(destDir);
|
|
15500
|
+
const relativeDestDir = path36.relative(this.opts.dir, canonicalDestDir);
|
|
15501
|
+
if (relativeDestDir.split(path36.sep).includes("..")) {
|
|
15501
15502
|
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
15502
15503
|
}
|
|
15503
15504
|
await this.extractEntry(entry);
|
|
@@ -15519,7 +15520,7 @@ var require_extract_zip = __commonJS({
|
|
|
15519
15520
|
if (this.opts.onEntry) {
|
|
15520
15521
|
this.opts.onEntry(entry, this.zipfile);
|
|
15521
15522
|
}
|
|
15522
|
-
const dest =
|
|
15523
|
+
const dest = path36.join(this.opts.dir, entry.fileName);
|
|
15523
15524
|
const mode = entry.externalFileAttributes >> 16 & 65535;
|
|
15524
15525
|
const IFMT = 61440;
|
|
15525
15526
|
const IFDIR = 16384;
|
|
@@ -15533,20 +15534,20 @@ var require_extract_zip = __commonJS({
|
|
|
15533
15534
|
if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
|
|
15534
15535
|
debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink2 });
|
|
15535
15536
|
const procMode = this.getExtractedMode(mode, isDir) & 511;
|
|
15536
|
-
const destDir = isDir ? dest :
|
|
15537
|
+
const destDir = isDir ? dest : path36.dirname(dest);
|
|
15537
15538
|
const mkdirOptions = { recursive: true };
|
|
15538
15539
|
if (isDir) {
|
|
15539
15540
|
mkdirOptions.mode = procMode;
|
|
15540
15541
|
}
|
|
15541
15542
|
debug("mkdir", { dir: destDir, ...mkdirOptions });
|
|
15542
|
-
await
|
|
15543
|
+
await fs38.mkdir(destDir, mkdirOptions);
|
|
15543
15544
|
if (isDir) return;
|
|
15544
15545
|
debug("opening read stream", dest);
|
|
15545
15546
|
const readStream = await promisify5(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
15546
15547
|
if (symlink2) {
|
|
15547
15548
|
const link2 = await getStream(readStream);
|
|
15548
15549
|
debug("creating symlink", link2, dest);
|
|
15549
|
-
await
|
|
15550
|
+
await fs38.symlink(link2, dest);
|
|
15550
15551
|
} else {
|
|
15551
15552
|
await pipeline(readStream, createWriteStream4(dest, { mode: procMode }));
|
|
15552
15553
|
}
|
|
@@ -15575,11 +15576,11 @@ var require_extract_zip = __commonJS({
|
|
|
15575
15576
|
};
|
|
15576
15577
|
module.exports = async function(zipPath, opts) {
|
|
15577
15578
|
debug("creating target directory", opts.dir);
|
|
15578
|
-
if (!
|
|
15579
|
+
if (!path36.isAbsolute(opts.dir)) {
|
|
15579
15580
|
throw new Error("Target directory is expected to be absolute");
|
|
15580
15581
|
}
|
|
15581
|
-
await
|
|
15582
|
-
opts.dir = await
|
|
15582
|
+
await fs38.mkdir(opts.dir, { recursive: true });
|
|
15583
|
+
opts.dir = await fs38.realpath(opts.dir);
|
|
15583
15584
|
return new Extractor(zipPath, opts).extract();
|
|
15584
15585
|
};
|
|
15585
15586
|
}
|
|
@@ -17036,7 +17037,7 @@ var require_strip_final_newline = __commonJS({
|
|
|
17036
17037
|
var require_npm_run_path = __commonJS({
|
|
17037
17038
|
"node_modules/run-jxa/node_modules/npm-run-path/index.js"(exports, module) {
|
|
17038
17039
|
"use strict";
|
|
17039
|
-
var
|
|
17040
|
+
var path36 = __require("path");
|
|
17040
17041
|
var pathKey = require_path_key();
|
|
17041
17042
|
var npmRunPath = (options) => {
|
|
17042
17043
|
options = {
|
|
@@ -17046,16 +17047,16 @@ var require_npm_run_path = __commonJS({
|
|
|
17046
17047
|
...options
|
|
17047
17048
|
};
|
|
17048
17049
|
let previous;
|
|
17049
|
-
let cwdPath =
|
|
17050
|
+
let cwdPath = path36.resolve(options.cwd);
|
|
17050
17051
|
const result = [];
|
|
17051
17052
|
while (previous !== cwdPath) {
|
|
17052
|
-
result.push(
|
|
17053
|
+
result.push(path36.join(cwdPath, "node_modules/.bin"));
|
|
17053
17054
|
previous = cwdPath;
|
|
17054
|
-
cwdPath =
|
|
17055
|
+
cwdPath = path36.resolve(cwdPath, "..");
|
|
17055
17056
|
}
|
|
17056
|
-
const execPathDir =
|
|
17057
|
+
const execPathDir = path36.resolve(options.cwd, options.execPath, "..");
|
|
17057
17058
|
result.push(execPathDir);
|
|
17058
|
-
return result.concat(options.path).join(
|
|
17059
|
+
return result.concat(options.path).join(path36.delimiter);
|
|
17059
17060
|
};
|
|
17060
17061
|
module.exports = npmRunPath;
|
|
17061
17062
|
module.exports.default = npmRunPath;
|
|
@@ -17065,9 +17066,9 @@ var require_npm_run_path = __commonJS({
|
|
|
17065
17066
|
...options
|
|
17066
17067
|
};
|
|
17067
17068
|
const env3 = { ...options.env };
|
|
17068
|
-
const
|
|
17069
|
-
options.path = env3[
|
|
17070
|
-
env3[
|
|
17069
|
+
const path37 = pathKey({ env: env3 });
|
|
17070
|
+
options.path = env3[path37];
|
|
17071
|
+
env3[path37] = module.exports(options);
|
|
17071
17072
|
return env3;
|
|
17072
17073
|
};
|
|
17073
17074
|
}
|
|
@@ -17630,11 +17631,11 @@ var require_signals4 = __commonJS({
|
|
|
17630
17631
|
// node_modules/run-jxa/node_modules/signal-exit/index.js
|
|
17631
17632
|
var require_signal_exit3 = __commonJS({
|
|
17632
17633
|
"node_modules/run-jxa/node_modules/signal-exit/index.js"(exports, module) {
|
|
17633
|
-
var
|
|
17634
|
-
var processOk = function(
|
|
17635
|
-
return
|
|
17634
|
+
var process34 = global.process;
|
|
17635
|
+
var processOk = function(process35) {
|
|
17636
|
+
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";
|
|
17636
17637
|
};
|
|
17637
|
-
if (!processOk(
|
|
17638
|
+
if (!processOk(process34)) {
|
|
17638
17639
|
module.exports = function() {
|
|
17639
17640
|
return function() {
|
|
17640
17641
|
};
|
|
@@ -17642,15 +17643,15 @@ var require_signal_exit3 = __commonJS({
|
|
|
17642
17643
|
} else {
|
|
17643
17644
|
assert = __require("assert");
|
|
17644
17645
|
signals = require_signals4();
|
|
17645
|
-
isWin = /^win/i.test(
|
|
17646
|
+
isWin = /^win/i.test(process34.platform);
|
|
17646
17647
|
EE = __require("events");
|
|
17647
17648
|
if (typeof EE !== "function") {
|
|
17648
17649
|
EE = EE.EventEmitter;
|
|
17649
17650
|
}
|
|
17650
|
-
if (
|
|
17651
|
-
emitter =
|
|
17651
|
+
if (process34.__signal_exit_emitter__) {
|
|
17652
|
+
emitter = process34.__signal_exit_emitter__;
|
|
17652
17653
|
} else {
|
|
17653
|
-
emitter =
|
|
17654
|
+
emitter = process34.__signal_exit_emitter__ = new EE();
|
|
17654
17655
|
emitter.count = 0;
|
|
17655
17656
|
emitter.emitted = {};
|
|
17656
17657
|
}
|
|
@@ -17687,12 +17688,12 @@ var require_signal_exit3 = __commonJS({
|
|
|
17687
17688
|
loaded = false;
|
|
17688
17689
|
signals.forEach(function(sig) {
|
|
17689
17690
|
try {
|
|
17690
|
-
|
|
17691
|
+
process34.removeListener(sig, sigListeners[sig]);
|
|
17691
17692
|
} catch (er2) {
|
|
17692
17693
|
}
|
|
17693
17694
|
});
|
|
17694
|
-
|
|
17695
|
-
|
|
17695
|
+
process34.emit = originalProcessEmit;
|
|
17696
|
+
process34.reallyExit = originalProcessReallyExit;
|
|
17696
17697
|
emitter.count -= 1;
|
|
17697
17698
|
};
|
|
17698
17699
|
module.exports.unload = unload;
|
|
@@ -17709,7 +17710,7 @@ var require_signal_exit3 = __commonJS({
|
|
|
17709
17710
|
if (!processOk(global.process)) {
|
|
17710
17711
|
return;
|
|
17711
17712
|
}
|
|
17712
|
-
var listeners =
|
|
17713
|
+
var listeners = process34.listeners(sig);
|
|
17713
17714
|
if (listeners.length === emitter.count) {
|
|
17714
17715
|
unload();
|
|
17715
17716
|
emit("exit", null, sig);
|
|
@@ -17717,7 +17718,7 @@ var require_signal_exit3 = __commonJS({
|
|
|
17717
17718
|
if (isWin && sig === "SIGHUP") {
|
|
17718
17719
|
sig = "SIGINT";
|
|
17719
17720
|
}
|
|
17720
|
-
|
|
17721
|
+
process34.kill(process34.pid, sig);
|
|
17721
17722
|
}
|
|
17722
17723
|
};
|
|
17723
17724
|
});
|
|
@@ -17733,36 +17734,36 @@ var require_signal_exit3 = __commonJS({
|
|
|
17733
17734
|
emitter.count += 1;
|
|
17734
17735
|
signals = signals.filter(function(sig) {
|
|
17735
17736
|
try {
|
|
17736
|
-
|
|
17737
|
+
process34.on(sig, sigListeners[sig]);
|
|
17737
17738
|
return true;
|
|
17738
17739
|
} catch (er2) {
|
|
17739
17740
|
return false;
|
|
17740
17741
|
}
|
|
17741
17742
|
});
|
|
17742
|
-
|
|
17743
|
-
|
|
17743
|
+
process34.emit = processEmit;
|
|
17744
|
+
process34.reallyExit = processReallyExit;
|
|
17744
17745
|
};
|
|
17745
17746
|
module.exports.load = load;
|
|
17746
|
-
originalProcessReallyExit =
|
|
17747
|
+
originalProcessReallyExit = process34.reallyExit;
|
|
17747
17748
|
processReallyExit = function processReallyExit2(code) {
|
|
17748
17749
|
if (!processOk(global.process)) {
|
|
17749
17750
|
return;
|
|
17750
17751
|
}
|
|
17751
|
-
|
|
17752
|
+
process34.exitCode = code || /* istanbul ignore next */
|
|
17752
17753
|
0;
|
|
17753
|
-
emit("exit",
|
|
17754
|
-
emit("afterexit",
|
|
17755
|
-
originalProcessReallyExit.call(
|
|
17754
|
+
emit("exit", process34.exitCode, null);
|
|
17755
|
+
emit("afterexit", process34.exitCode, null);
|
|
17756
|
+
originalProcessReallyExit.call(process34, process34.exitCode);
|
|
17756
17757
|
};
|
|
17757
|
-
originalProcessEmit =
|
|
17758
|
+
originalProcessEmit = process34.emit;
|
|
17758
17759
|
processEmit = function processEmit2(ev, arg) {
|
|
17759
17760
|
if (ev === "exit" && processOk(global.process)) {
|
|
17760
17761
|
if (arg !== void 0) {
|
|
17761
|
-
|
|
17762
|
+
process34.exitCode = arg;
|
|
17762
17763
|
}
|
|
17763
17764
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
17764
|
-
emit("exit",
|
|
17765
|
-
emit("afterexit",
|
|
17765
|
+
emit("exit", process34.exitCode, null);
|
|
17766
|
+
emit("afterexit", process34.exitCode, null);
|
|
17766
17767
|
return ret;
|
|
17767
17768
|
} else {
|
|
17768
17769
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -18183,8 +18184,8 @@ var require_command = __commonJS({
|
|
|
18183
18184
|
var require_execa = __commonJS({
|
|
18184
18185
|
"node_modules/run-jxa/node_modules/execa/index.js"(exports, module) {
|
|
18185
18186
|
"use strict";
|
|
18186
|
-
var
|
|
18187
|
-
var
|
|
18187
|
+
var path36 = __require("path");
|
|
18188
|
+
var childProcess3 = __require("child_process");
|
|
18188
18189
|
var crossSpawn = require_cross_spawn();
|
|
18189
18190
|
var stripFinalNewline = require_strip_final_newline();
|
|
18190
18191
|
var npmRunPath = require_npm_run_path();
|
|
@@ -18225,7 +18226,7 @@ var require_execa = __commonJS({
|
|
|
18225
18226
|
};
|
|
18226
18227
|
options.env = getEnv(options);
|
|
18227
18228
|
options.stdio = normalizeStdio(options);
|
|
18228
|
-
if (process.platform === "win32" &&
|
|
18229
|
+
if (process.platform === "win32" && path36.basename(file, ".exe") === "cmd") {
|
|
18229
18230
|
args.unshift("/q");
|
|
18230
18231
|
}
|
|
18231
18232
|
return { file, args, options, parsed };
|
|
@@ -18246,9 +18247,9 @@ var require_execa = __commonJS({
|
|
|
18246
18247
|
validateTimeout(parsed.options);
|
|
18247
18248
|
let spawned;
|
|
18248
18249
|
try {
|
|
18249
|
-
spawned =
|
|
18250
|
+
spawned = childProcess3.spawn(parsed.file, parsed.args, parsed.options);
|
|
18250
18251
|
} catch (error) {
|
|
18251
|
-
const dummySpawned = new
|
|
18252
|
+
const dummySpawned = new childProcess3.ChildProcess();
|
|
18252
18253
|
const errorPromise = Promise.reject(makeError3({
|
|
18253
18254
|
error,
|
|
18254
18255
|
stdout: "",
|
|
@@ -18320,7 +18321,7 @@ var require_execa = __commonJS({
|
|
|
18320
18321
|
validateInputSync(parsed.options);
|
|
18321
18322
|
let result;
|
|
18322
18323
|
try {
|
|
18323
|
-
result =
|
|
18324
|
+
result = childProcess3.spawnSync(parsed.file, parsed.args, parsed.options);
|
|
18324
18325
|
} catch (error) {
|
|
18325
18326
|
throw makeError3({
|
|
18326
18327
|
error,
|
|
@@ -25582,13 +25583,13 @@ var setTextNodeValue = (node, text) => {
|
|
|
25582
25583
|
markNodeAsDirty(node);
|
|
25583
25584
|
};
|
|
25584
25585
|
var getPathToRoot = (node) => {
|
|
25585
|
-
const
|
|
25586
|
+
const path36 = [];
|
|
25586
25587
|
let current = node;
|
|
25587
25588
|
while (current) {
|
|
25588
|
-
|
|
25589
|
+
path36.unshift(current);
|
|
25589
25590
|
current = current.parentNode;
|
|
25590
25591
|
}
|
|
25591
|
-
return
|
|
25592
|
+
return path36;
|
|
25592
25593
|
};
|
|
25593
25594
|
var isNodeSelectable = (node) => {
|
|
25594
25595
|
let current = node;
|
|
@@ -30066,8 +30067,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
30066
30067
|
}
|
|
30067
30068
|
|
|
30068
30069
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
30069
|
-
var cleanupPath = (
|
|
30070
|
-
return
|
|
30070
|
+
var cleanupPath = (path36) => {
|
|
30071
|
+
return path36?.replace(`file://${cwd()}/`, "");
|
|
30071
30072
|
};
|
|
30072
30073
|
var stackUtils = new import_stack_utils.default({
|
|
30073
30074
|
cwd: cwd(),
|
|
@@ -34697,6 +34698,7 @@ var ESC_TIMEOUT = 50;
|
|
|
34697
34698
|
var PASTE_TIMEOUT = 3e4;
|
|
34698
34699
|
var FAST_RETURN_TIMEOUT = 30;
|
|
34699
34700
|
var KEY_INFO_MAP = {
|
|
34701
|
+
OM: { name: "enter" },
|
|
34700
34702
|
"[200~": { name: "paste-start" },
|
|
34701
34703
|
"[201~": { name: "paste-end" },
|
|
34702
34704
|
"[[A": { name: "f1" },
|
|
@@ -35582,15 +35584,8 @@ var defaultKeyBindingConfig = /* @__PURE__ */ new Map([
|
|
|
35582
35584
|
"edit.deleteRight" /* DELETE_CHAR_RIGHT */,
|
|
35583
35585
|
[new KeyBinding("delete"), new KeyBinding("ctrl+d")]
|
|
35584
35586
|
],
|
|
35585
|
-
["edit.undo" /* UNDO */,
|
|
35586
|
-
[
|
|
35587
|
-
"edit.redo" /* REDO */,
|
|
35588
|
-
[
|
|
35589
|
-
new KeyBinding("ctrl+shift+z"),
|
|
35590
|
-
new KeyBinding("cmd+shift+z"),
|
|
35591
|
-
new KeyBinding("alt+shift+z")
|
|
35592
|
-
]
|
|
35593
|
-
],
|
|
35587
|
+
["edit.undo" /* UNDO */, getPlatformUndoBindings(process.platform)],
|
|
35588
|
+
["edit.redo" /* REDO */, getPlatformRedoBindings(process.platform)],
|
|
35594
35589
|
// Scrolling
|
|
35595
35590
|
["scroll.up" /* SCROLL_UP */, [new KeyBinding("shift+up")]],
|
|
35596
35591
|
["scroll.down" /* SCROLL_DOWN */, [new KeyBinding("shift+down")]],
|
|
@@ -35762,6 +35757,26 @@ async function loadCustomKeybindings() {
|
|
|
35762
35757
|
}
|
|
35763
35758
|
return { config, errors };
|
|
35764
35759
|
}
|
|
35760
|
+
function getPlatformUndoBindings(platform5) {
|
|
35761
|
+
if (platform5 === "win32") {
|
|
35762
|
+
return [new KeyBinding("ctrl+z"), new KeyBinding("alt+z")];
|
|
35763
|
+
}
|
|
35764
|
+
if (platform5 === "darwin") {
|
|
35765
|
+
return [new KeyBinding("cmd+z"), new KeyBinding("alt+z")];
|
|
35766
|
+
}
|
|
35767
|
+
return [
|
|
35768
|
+
new KeyBinding("alt+z"),
|
|
35769
|
+
new KeyBinding("cmd+z"),
|
|
35770
|
+
new KeyBinding("ctrl+z")
|
|
35771
|
+
];
|
|
35772
|
+
}
|
|
35773
|
+
function getPlatformRedoBindings(_platform) {
|
|
35774
|
+
return [
|
|
35775
|
+
new KeyBinding("ctrl+shift+z"),
|
|
35776
|
+
new KeyBinding("cmd+shift+z"),
|
|
35777
|
+
new KeyBinding("alt+shift+z")
|
|
35778
|
+
];
|
|
35779
|
+
}
|
|
35765
35780
|
|
|
35766
35781
|
// packages/cli/src/ui/key/keyMatchers.ts
|
|
35767
35782
|
function matchCommand(command, key, config = defaultKeyBindingConfig) {
|
|
@@ -39881,308 +39896,9 @@ function validateAuthMethod(authMethod) {
|
|
|
39881
39896
|
return "Invalid auth method selected.";
|
|
39882
39897
|
}
|
|
39883
39898
|
|
|
39884
|
-
// packages/cli/src/utils/installationInfo.ts
|
|
39885
|
-
import * as fs9 from "node:fs";
|
|
39886
|
-
import * as path3 from "node:path";
|
|
39887
|
-
import * as childProcess from "node:child_process";
|
|
39888
|
-
import process20 from "node:process";
|
|
39889
|
-
var isDevelopment = process20.env["NODE_ENV"] === "development";
|
|
39890
|
-
function getInstallationInfo(projectRoot, isAutoUpdateEnabled) {
|
|
39891
|
-
const cliPath = process20.argv[1];
|
|
39892
|
-
if (!cliPath) {
|
|
39893
|
-
return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
|
|
39894
|
-
}
|
|
39895
|
-
try {
|
|
39896
|
-
if (process20.env["IS_BINARY"] === "true") {
|
|
39897
|
-
return {
|
|
39898
|
-
packageManager: "binary" /* BINARY */,
|
|
39899
|
-
isGlobal: true,
|
|
39900
|
-
updateMessage: "Running as a standalone binary. Please update by downloading the latest version from GitHub."
|
|
39901
|
-
};
|
|
39902
|
-
}
|
|
39903
|
-
const realPath = fs9.realpathSync(cliPath).replace(/\\/g, "/");
|
|
39904
|
-
const normalizedProjectRoot = projectRoot?.replace(/\\/g, "/");
|
|
39905
|
-
const isGit = isGitRepository(process20.cwd());
|
|
39906
|
-
if (isGit && normalizedProjectRoot && realPath.startsWith(normalizedProjectRoot) && !realPath.includes("/node_modules/")) {
|
|
39907
|
-
return {
|
|
39908
|
-
packageManager: "unknown" /* UNKNOWN */,
|
|
39909
|
-
// Not managed by a package manager in this sense
|
|
39910
|
-
isGlobal: false,
|
|
39911
|
-
updateMessage: 'Running from a local git clone. Please update with "git pull".'
|
|
39912
|
-
};
|
|
39913
|
-
}
|
|
39914
|
-
if (realPath.includes("/.npm/_npx") || realPath.includes("/npm/_npx")) {
|
|
39915
|
-
return {
|
|
39916
|
-
packageManager: "npx" /* NPX */,
|
|
39917
|
-
isGlobal: false,
|
|
39918
|
-
updateMessage: "Running via npx, update not applicable."
|
|
39919
|
-
};
|
|
39920
|
-
}
|
|
39921
|
-
if (realPath.includes("/.pnpm/_pnpx") || realPath.includes("/.cache/pnpm/dlx")) {
|
|
39922
|
-
return {
|
|
39923
|
-
packageManager: "pnpx" /* PNPX */,
|
|
39924
|
-
isGlobal: false,
|
|
39925
|
-
updateMessage: "Running via pnpx, update not applicable."
|
|
39926
|
-
};
|
|
39927
|
-
}
|
|
39928
|
-
if (process20.platform === "darwin") {
|
|
39929
|
-
try {
|
|
39930
|
-
const brewPrefix = childProcess.execSync("brew --prefix gemini-cli", {
|
|
39931
|
-
encoding: "utf8",
|
|
39932
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
39933
|
-
}).trim();
|
|
39934
|
-
const brewRealPath = fs9.realpathSync(brewPrefix);
|
|
39935
|
-
if (realPath.startsWith(brewRealPath)) {
|
|
39936
|
-
return {
|
|
39937
|
-
packageManager: "homebrew" /* HOMEBREW */,
|
|
39938
|
-
isGlobal: true,
|
|
39939
|
-
updateMessage: 'Installed via Homebrew. Please update with "brew upgrade gemini-cli".'
|
|
39940
|
-
};
|
|
39941
|
-
}
|
|
39942
|
-
} catch {
|
|
39943
|
-
}
|
|
39944
|
-
}
|
|
39945
|
-
if (realPath.includes("/.pnpm/global") || realPath.includes("/.local/share/pnpm")) {
|
|
39946
|
-
const updateCommand2 = "pnpm add -g @google/gemini-cli@latest";
|
|
39947
|
-
return {
|
|
39948
|
-
packageManager: "pnpm" /* PNPM */,
|
|
39949
|
-
isGlobal: true,
|
|
39950
|
-
updateCommand: updateCommand2,
|
|
39951
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with pnpm. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
39952
|
-
};
|
|
39953
|
-
}
|
|
39954
|
-
if (realPath.includes("/.yarn/global")) {
|
|
39955
|
-
const updateCommand2 = "yarn global add @google/gemini-cli@latest";
|
|
39956
|
-
return {
|
|
39957
|
-
packageManager: "yarn" /* YARN */,
|
|
39958
|
-
isGlobal: true,
|
|
39959
|
-
updateCommand: updateCommand2,
|
|
39960
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with yarn. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
39961
|
-
};
|
|
39962
|
-
}
|
|
39963
|
-
if (realPath.includes("/.bun/install/cache")) {
|
|
39964
|
-
return {
|
|
39965
|
-
packageManager: "bunx" /* BUNX */,
|
|
39966
|
-
isGlobal: false,
|
|
39967
|
-
updateMessage: "Running via bunx, update not applicable."
|
|
39968
|
-
};
|
|
39969
|
-
}
|
|
39970
|
-
if (realPath.includes("/.bun/install/global")) {
|
|
39971
|
-
const updateCommand2 = "bun add -g @google/gemini-cli@latest";
|
|
39972
|
-
return {
|
|
39973
|
-
packageManager: "bun" /* BUN */,
|
|
39974
|
-
isGlobal: true,
|
|
39975
|
-
updateCommand: updateCommand2,
|
|
39976
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with bun. Attempting to automatically update now..." : `Please run ${updateCommand2} to update`
|
|
39977
|
-
};
|
|
39978
|
-
}
|
|
39979
|
-
if (normalizedProjectRoot && realPath.startsWith(`${normalizedProjectRoot}/node_modules`)) {
|
|
39980
|
-
let pm = "npm" /* NPM */;
|
|
39981
|
-
if (fs9.existsSync(path3.join(projectRoot, "yarn.lock"))) {
|
|
39982
|
-
pm = "yarn" /* YARN */;
|
|
39983
|
-
} else if (fs9.existsSync(path3.join(projectRoot, "pnpm-lock.yaml"))) {
|
|
39984
|
-
pm = "pnpm" /* PNPM */;
|
|
39985
|
-
} else if (fs9.existsSync(path3.join(projectRoot, "bun.lockb"))) {
|
|
39986
|
-
pm = "bun" /* BUN */;
|
|
39987
|
-
}
|
|
39988
|
-
return {
|
|
39989
|
-
packageManager: pm,
|
|
39990
|
-
isGlobal: false,
|
|
39991
|
-
updateMessage: "Locally installed. Please update via your project's package.json."
|
|
39992
|
-
};
|
|
39993
|
-
}
|
|
39994
|
-
const updateCommand = "npm install -g @google/gemini-cli@latest";
|
|
39995
|
-
return {
|
|
39996
|
-
packageManager: "npm" /* NPM */,
|
|
39997
|
-
isGlobal: true,
|
|
39998
|
-
updateCommand,
|
|
39999
|
-
updateMessage: isAutoUpdateEnabled ? "Installed with npm. Attempting to automatically update now..." : `Please run ${updateCommand} to update`
|
|
40000
|
-
};
|
|
40001
|
-
} catch (error) {
|
|
40002
|
-
debugLogger.log(error);
|
|
40003
|
-
return { packageManager: "unknown" /* UNKNOWN */, isGlobal: false };
|
|
40004
|
-
}
|
|
40005
|
-
}
|
|
40006
|
-
|
|
40007
|
-
// packages/cli/src/utils/updateEventEmitter.ts
|
|
40008
|
-
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
40009
|
-
var updateEventEmitter = new EventEmitter3();
|
|
40010
|
-
|
|
40011
|
-
// packages/cli/src/utils/spawnWrapper.ts
|
|
40012
|
-
import { spawn } from "node:child_process";
|
|
40013
|
-
var spawnWrapper = spawn;
|
|
40014
|
-
|
|
40015
|
-
// packages/cli/src/utils/handleAutoUpdate.ts
|
|
40016
|
-
var _updateInProgress = false;
|
|
40017
|
-
async function waitForUpdateCompletion(timeoutMs = 3e4) {
|
|
40018
|
-
if (!_updateInProgress) {
|
|
40019
|
-
return;
|
|
40020
|
-
}
|
|
40021
|
-
debugLogger.log(
|
|
40022
|
-
"\nGemini CLI is waiting for a background update to complete before restarting..."
|
|
40023
|
-
);
|
|
40024
|
-
return new Promise((resolve8) => {
|
|
40025
|
-
if (!_updateInProgress) {
|
|
40026
|
-
resolve8();
|
|
40027
|
-
return;
|
|
40028
|
-
}
|
|
40029
|
-
const timer = setTimeout(cleanup, timeoutMs);
|
|
40030
|
-
function cleanup() {
|
|
40031
|
-
clearTimeout(timer);
|
|
40032
|
-
updateEventEmitter.off("update-success", cleanup);
|
|
40033
|
-
updateEventEmitter.off("update-failed", cleanup);
|
|
40034
|
-
resolve8();
|
|
40035
|
-
}
|
|
40036
|
-
updateEventEmitter.once("update-success", cleanup);
|
|
40037
|
-
updateEventEmitter.once("update-failed", cleanup);
|
|
40038
|
-
});
|
|
40039
|
-
}
|
|
40040
|
-
function handleAutoUpdate(info, settings, projectRoot, spawnFn = spawnWrapper) {
|
|
40041
|
-
if (!info) {
|
|
40042
|
-
return;
|
|
40043
|
-
}
|
|
40044
|
-
if (settings.merged.tools.sandbox || process.env["GEMINI_SANDBOX"]) {
|
|
40045
|
-
updateEventEmitter.emit("update-info", {
|
|
40046
|
-
message: `${info.message}
|
|
40047
|
-
Automatic update is not available in sandbox mode.`
|
|
40048
|
-
});
|
|
40049
|
-
return;
|
|
40050
|
-
}
|
|
40051
|
-
if (!settings.merged.general.enableAutoUpdateNotification) {
|
|
40052
|
-
return;
|
|
40053
|
-
}
|
|
40054
|
-
const installationInfo = getInstallationInfo(
|
|
40055
|
-
projectRoot,
|
|
40056
|
-
settings.merged.general.enableAutoUpdate
|
|
40057
|
-
);
|
|
40058
|
-
if ([
|
|
40059
|
-
"npx" /* NPX */,
|
|
40060
|
-
"pnpx" /* PNPX */,
|
|
40061
|
-
"bunx" /* BUNX */,
|
|
40062
|
-
"binary" /* BINARY */
|
|
40063
|
-
].includes(installationInfo.packageManager)) {
|
|
40064
|
-
return;
|
|
40065
|
-
}
|
|
40066
|
-
let combinedMessage = info.message;
|
|
40067
|
-
if (installationInfo.updateMessage) {
|
|
40068
|
-
combinedMessage += `
|
|
40069
|
-
${installationInfo.updateMessage}`;
|
|
40070
|
-
}
|
|
40071
|
-
if (!installationInfo.updateCommand || !settings.merged.general.enableAutoUpdate) {
|
|
40072
|
-
updateEventEmitter.emit("update-received", {
|
|
40073
|
-
...info,
|
|
40074
|
-
message: combinedMessage,
|
|
40075
|
-
isUpdating: false
|
|
40076
|
-
});
|
|
40077
|
-
return;
|
|
40078
|
-
}
|
|
40079
|
-
updateEventEmitter.emit("update-received", {
|
|
40080
|
-
...info,
|
|
40081
|
-
message: combinedMessage,
|
|
40082
|
-
isUpdating: true
|
|
40083
|
-
});
|
|
40084
|
-
if (_updateInProgress) {
|
|
40085
|
-
return;
|
|
40086
|
-
}
|
|
40087
|
-
const isNightly2 = info.update.latest.includes("nightly");
|
|
40088
|
-
const updateCommand = installationInfo.updateCommand.replace(
|
|
40089
|
-
"@latest",
|
|
40090
|
-
isNightly2 ? "@nightly" : `@${info.update.latest}`
|
|
40091
|
-
);
|
|
40092
|
-
const updateProcess = spawnFn(updateCommand, {
|
|
40093
|
-
stdio: "ignore",
|
|
40094
|
-
shell: true,
|
|
40095
|
-
detached: true
|
|
40096
|
-
});
|
|
40097
|
-
_updateInProgress = true;
|
|
40098
|
-
updateProcess.unref();
|
|
40099
|
-
updateProcess.on("close", (code) => {
|
|
40100
|
-
_updateInProgress = false;
|
|
40101
|
-
if (code === 0) {
|
|
40102
|
-
updateEventEmitter.emit("update-success", {
|
|
40103
|
-
message: "Update successful! The new version will be used on your next run."
|
|
40104
|
-
});
|
|
40105
|
-
} else {
|
|
40106
|
-
updateEventEmitter.emit("update-failed", {
|
|
40107
|
-
message: `Automatic update failed. Please try updating manually:
|
|
40108
|
-
|
|
40109
|
-
${updateCommand}`
|
|
40110
|
-
});
|
|
40111
|
-
}
|
|
40112
|
-
});
|
|
40113
|
-
updateProcess.on("error", (err) => {
|
|
40114
|
-
_updateInProgress = false;
|
|
40115
|
-
updateEventEmitter.emit("update-failed", {
|
|
40116
|
-
message: `Automatic update failed. Please try updating manually. (error: ${err.message})
|
|
40117
|
-
|
|
40118
|
-
${updateCommand}`
|
|
40119
|
-
});
|
|
40120
|
-
});
|
|
40121
|
-
return updateProcess;
|
|
40122
|
-
}
|
|
40123
|
-
function setUpdateHandler(addItem, setUpdateInfo) {
|
|
40124
|
-
let successfullyInstalled = false;
|
|
40125
|
-
const handleUpdateReceived = (info) => {
|
|
40126
|
-
setUpdateInfo(info);
|
|
40127
|
-
const savedMessage = info.message;
|
|
40128
|
-
setTimeout(() => {
|
|
40129
|
-
if (!successfullyInstalled) {
|
|
40130
|
-
addItem(
|
|
40131
|
-
{
|
|
40132
|
-
type: "info" /* INFO */,
|
|
40133
|
-
text: savedMessage
|
|
40134
|
-
},
|
|
40135
|
-
Date.now()
|
|
40136
|
-
);
|
|
40137
|
-
}
|
|
40138
|
-
setUpdateInfo(null);
|
|
40139
|
-
}, 6e4);
|
|
40140
|
-
};
|
|
40141
|
-
const handleUpdateFailed = (data) => {
|
|
40142
|
-
setUpdateInfo(null);
|
|
40143
|
-
addItem(
|
|
40144
|
-
{
|
|
40145
|
-
type: "error" /* ERROR */,
|
|
40146
|
-
text: data?.message || `Automatic update failed. Please try updating manually`
|
|
40147
|
-
},
|
|
40148
|
-
Date.now()
|
|
40149
|
-
);
|
|
40150
|
-
};
|
|
40151
|
-
const handleUpdateSuccess = () => {
|
|
40152
|
-
successfullyInstalled = true;
|
|
40153
|
-
setUpdateInfo(null);
|
|
40154
|
-
addItem(
|
|
40155
|
-
{
|
|
40156
|
-
type: "info" /* INFO */,
|
|
40157
|
-
text: `Update successful! The new version will be used on your next run.`
|
|
40158
|
-
},
|
|
40159
|
-
Date.now()
|
|
40160
|
-
);
|
|
40161
|
-
};
|
|
40162
|
-
const handleUpdateInfo = (data) => {
|
|
40163
|
-
addItem(
|
|
40164
|
-
{
|
|
40165
|
-
type: "info" /* INFO */,
|
|
40166
|
-
text: data.message
|
|
40167
|
-
},
|
|
40168
|
-
Date.now()
|
|
40169
|
-
);
|
|
40170
|
-
};
|
|
40171
|
-
updateEventEmitter.on("update-received", handleUpdateReceived);
|
|
40172
|
-
updateEventEmitter.on("update-failed", handleUpdateFailed);
|
|
40173
|
-
updateEventEmitter.on("update-success", handleUpdateSuccess);
|
|
40174
|
-
updateEventEmitter.on("update-info", handleUpdateInfo);
|
|
40175
|
-
return () => {
|
|
40176
|
-
updateEventEmitter.off("update-received", handleUpdateReceived);
|
|
40177
|
-
updateEventEmitter.off("update-failed", handleUpdateFailed);
|
|
40178
|
-
updateEventEmitter.off("update-success", handleUpdateSuccess);
|
|
40179
|
-
updateEventEmitter.off("update-info", handleUpdateInfo);
|
|
40180
|
-
};
|
|
40181
|
-
}
|
|
40182
|
-
|
|
40183
39899
|
// packages/cli/src/config/extensions/consent.ts
|
|
40184
|
-
import * as
|
|
40185
|
-
import * as
|
|
39900
|
+
import * as fs9 from "node:fs/promises";
|
|
39901
|
+
import * as path3 from "node:path";
|
|
40186
39902
|
var import_chalk4 = __toESM(require_source(), 1);
|
|
40187
39903
|
var INSTALL_WARNING_MESSAGE = import_chalk4.default.yellow(
|
|
40188
39904
|
"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."
|
|
@@ -40308,10 +40024,10 @@ async function renderSkillsList(skills) {
|
|
|
40308
40024
|
const output = [];
|
|
40309
40025
|
for (const skill of skills) {
|
|
40310
40026
|
output.push(` * ${import_chalk4.default.bold(skill.name)}: ${skill.description}`);
|
|
40311
|
-
const skillDir =
|
|
40027
|
+
const skillDir = path3.dirname(skill.location);
|
|
40312
40028
|
let fileCountStr = "";
|
|
40313
40029
|
try {
|
|
40314
|
-
const skillDirItems = await
|
|
40030
|
+
const skillDirItems = await fs9.readdir(skillDir);
|
|
40315
40031
|
fileCountStr = ` (${skillDirItems.length} items in directory)`;
|
|
40316
40032
|
} catch {
|
|
40317
40033
|
fileCountStr = ` ${import_chalk4.default.red("\u26A0\uFE0F (Could not count items in directory)")}`;
|
|
@@ -40346,17 +40062,17 @@ async function maybeRequestConsentOrFail(extensionConfig, requestConsent, hasHoo
|
|
|
40346
40062
|
|
|
40347
40063
|
// packages/cli/src/config/extensions/extensionSettings.ts
|
|
40348
40064
|
var dotenv = __toESM(require_main(), 1);
|
|
40349
|
-
import * as
|
|
40065
|
+
import * as fs11 from "node:fs/promises";
|
|
40350
40066
|
import * as fsSync from "node:fs";
|
|
40351
|
-
import * as
|
|
40067
|
+
import * as path6 from "node:path";
|
|
40352
40068
|
|
|
40353
40069
|
// packages/cli/src/config/extensions/storage.ts
|
|
40354
|
-
import * as
|
|
40355
|
-
import * as
|
|
40070
|
+
import * as path5 from "node:path";
|
|
40071
|
+
import * as fs10 from "node:fs";
|
|
40356
40072
|
import * as os2 from "node:os";
|
|
40357
40073
|
|
|
40358
40074
|
// packages/cli/src/config/extensions/variables.ts
|
|
40359
|
-
import * as
|
|
40075
|
+
import * as path4 from "node:path";
|
|
40360
40076
|
|
|
40361
40077
|
// packages/cli/src/config/extensions/variableSchema.ts
|
|
40362
40078
|
var PATH_SEPARATOR_DEFINITION = {
|
|
@@ -40382,7 +40098,7 @@ var UNMARSHALL_KEY_IGNORE_LIST = /* @__PURE__ */ new Set([
|
|
|
40382
40098
|
"constructor",
|
|
40383
40099
|
"prototype"
|
|
40384
40100
|
]);
|
|
40385
|
-
var EXTENSIONS_DIRECTORY_NAME =
|
|
40101
|
+
var EXTENSIONS_DIRECTORY_NAME = path4.join(GEMINI_DIR, "extensions");
|
|
40386
40102
|
var EXTENSIONS_CONFIG_FILENAME = "gemini-extension.json";
|
|
40387
40103
|
var INSTALL_METADATA_FILENAME = ".gemini-extension-install.json";
|
|
40388
40104
|
var EXTENSION_SETTINGS_FILENAME = ".env";
|
|
@@ -40437,22 +40153,22 @@ var ExtensionStorage = class _ExtensionStorage {
|
|
|
40437
40153
|
this.extensionName = extensionName;
|
|
40438
40154
|
}
|
|
40439
40155
|
getExtensionDir() {
|
|
40440
|
-
return
|
|
40156
|
+
return path5.join(
|
|
40441
40157
|
_ExtensionStorage.getUserExtensionsDir(),
|
|
40442
40158
|
this.extensionName
|
|
40443
40159
|
);
|
|
40444
40160
|
}
|
|
40445
40161
|
getConfigPath() {
|
|
40446
|
-
return
|
|
40162
|
+
return path5.join(this.getExtensionDir(), EXTENSIONS_CONFIG_FILENAME);
|
|
40447
40163
|
}
|
|
40448
40164
|
getEnvFilePath() {
|
|
40449
|
-
return
|
|
40165
|
+
return path5.join(this.getExtensionDir(), EXTENSION_SETTINGS_FILENAME);
|
|
40450
40166
|
}
|
|
40451
40167
|
static getUserExtensionsDir() {
|
|
40452
40168
|
return new Storage(homedir()).getExtensionsDir();
|
|
40453
40169
|
}
|
|
40454
40170
|
static async createTmpDir() {
|
|
40455
|
-
return
|
|
40171
|
+
return fs10.promises.mkdtemp(path5.join(os2.tmpdir(), "gemini-extension"));
|
|
40456
40172
|
}
|
|
40457
40173
|
};
|
|
40458
40174
|
|
|
@@ -40473,7 +40189,7 @@ var getEnvFilePath = (extensionName, scope, workspaceDir) => {
|
|
|
40473
40189
|
if (!workspaceDir) {
|
|
40474
40190
|
throw new Error("Workspace directory is required for workspace scope");
|
|
40475
40191
|
}
|
|
40476
|
-
return
|
|
40192
|
+
return path6.join(workspaceDir, EXTENSION_SETTINGS_FILENAME);
|
|
40477
40193
|
}
|
|
40478
40194
|
return new ExtensionStorage(extensionName).getEnvFilePath();
|
|
40479
40195
|
};
|
|
@@ -40529,7 +40245,7 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
|
|
|
40529
40245
|
);
|
|
40530
40246
|
}
|
|
40531
40247
|
}
|
|
40532
|
-
await
|
|
40248
|
+
await fs11.writeFile(envFilePath, envContent);
|
|
40533
40249
|
}
|
|
40534
40250
|
function formatEnvContent(settings) {
|
|
40535
40251
|
let envContent = "";
|
|
@@ -40639,7 +40355,7 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40639
40355
|
`Cannot write extension settings to ${envFilePath} because it is a directory.`
|
|
40640
40356
|
);
|
|
40641
40357
|
}
|
|
40642
|
-
envContent = await
|
|
40358
|
+
envContent = await fs11.readFile(envFilePath, "utf-8");
|
|
40643
40359
|
}
|
|
40644
40360
|
const parsedEnv = dotenv.parse(envContent);
|
|
40645
40361
|
if (!newValue) {
|
|
@@ -40657,7 +40373,7 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40657
40373
|
}
|
|
40658
40374
|
}
|
|
40659
40375
|
const newEnvContent = formatEnvContent(nonSensitiveSettings);
|
|
40660
|
-
await
|
|
40376
|
+
await fs11.writeFile(envFilePath, newEnvContent);
|
|
40661
40377
|
}
|
|
40662
40378
|
function getSettingsChanges(settings, oldSettings) {
|
|
40663
40379
|
const isSameSetting = (a, b2) => a.envVar === b2.envVar && (a.sensitive ?? false) === (b2.sensitive ?? false);
|
|
@@ -40684,7 +40400,7 @@ async function clearSettings(envFilePath, keychain) {
|
|
|
40684
40400
|
if (fsSync.existsSync(envFilePath)) {
|
|
40685
40401
|
const stat7 = fsSync.statSync(envFilePath);
|
|
40686
40402
|
if (!stat7.isDirectory()) {
|
|
40687
|
-
await
|
|
40403
|
+
await fs11.writeFile(envFilePath, "");
|
|
40688
40404
|
}
|
|
40689
40405
|
}
|
|
40690
40406
|
if (!await keychain.isAvailable()) {
|
|
@@ -40717,13 +40433,13 @@ async function getMissingSettings(extensionConfig, extensionId, workspaceDir) {
|
|
|
40717
40433
|
|
|
40718
40434
|
// packages/cli/src/config/extension-manager.ts
|
|
40719
40435
|
var import_chalk5 = __toESM(require_source(), 1);
|
|
40720
|
-
import * as
|
|
40721
|
-
import * as
|
|
40436
|
+
import * as fs16 from "node:fs";
|
|
40437
|
+
import * as path10 from "node:path";
|
|
40722
40438
|
import { stat } from "node:fs/promises";
|
|
40723
40439
|
|
|
40724
40440
|
// packages/cli/src/config/extensions/extensionEnablement.ts
|
|
40725
|
-
import
|
|
40726
|
-
import
|
|
40441
|
+
import fs12 from "node:fs";
|
|
40442
|
+
import path7 from "node:path";
|
|
40727
40443
|
var Override = class _Override {
|
|
40728
40444
|
constructor(baseRule, isDisable, includeSubdirs) {
|
|
40729
40445
|
this.baseRule = baseRule;
|
|
@@ -40764,8 +40480,8 @@ var Override = class _Override {
|
|
|
40764
40480
|
output() {
|
|
40765
40481
|
return `${this.isDisable ? "!" : ""}${this.baseRule}${this.includeSubdirs ? "*" : ""}`;
|
|
40766
40482
|
}
|
|
40767
|
-
matchesPath(
|
|
40768
|
-
return this.asRegex().test(
|
|
40483
|
+
matchesPath(path36) {
|
|
40484
|
+
return this.asRegex().test(path36);
|
|
40769
40485
|
}
|
|
40770
40486
|
};
|
|
40771
40487
|
var ensureLeadingAndTrailingSlash = function(dirPath) {
|
|
@@ -40790,7 +40506,7 @@ var ExtensionEnablementManager = class {
|
|
|
40790
40506
|
enabledExtensionNamesOverride;
|
|
40791
40507
|
constructor(enabledExtensionNames) {
|
|
40792
40508
|
this.configDir = ExtensionStorage.getUserExtensionsDir();
|
|
40793
|
-
this.configFilePath =
|
|
40509
|
+
this.configFilePath = path7.join(
|
|
40794
40510
|
this.configDir,
|
|
40795
40511
|
"extension-enablement.json"
|
|
40796
40512
|
);
|
|
@@ -40835,7 +40551,7 @@ var ExtensionEnablementManager = class {
|
|
|
40835
40551
|
}
|
|
40836
40552
|
readConfig() {
|
|
40837
40553
|
try {
|
|
40838
|
-
const content =
|
|
40554
|
+
const content = fs12.readFileSync(this.configFilePath, "utf-8");
|
|
40839
40555
|
return JSON.parse(content);
|
|
40840
40556
|
} catch (error) {
|
|
40841
40557
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
@@ -40850,8 +40566,8 @@ var ExtensionEnablementManager = class {
|
|
|
40850
40566
|
}
|
|
40851
40567
|
}
|
|
40852
40568
|
writeConfig(config) {
|
|
40853
|
-
|
|
40854
|
-
|
|
40569
|
+
fs12.mkdirSync(this.configDir, { recursive: true });
|
|
40570
|
+
fs12.writeFileSync(this.configFilePath, JSON.stringify(config, null, 2));
|
|
40855
40571
|
}
|
|
40856
40572
|
enable(extensionName, includeSubdirs, scopePath) {
|
|
40857
40573
|
const config = this.readConfig();
|
|
@@ -40886,12 +40602,12 @@ var ExtensionEnablementManager = class {
|
|
|
40886
40602
|
import { createHash, randomUUID } from "node:crypto";
|
|
40887
40603
|
|
|
40888
40604
|
// packages/cli/src/config/extension.ts
|
|
40889
|
-
import * as
|
|
40890
|
-
import * as
|
|
40605
|
+
import * as fs13 from "node:fs";
|
|
40606
|
+
import * as path8 from "node:path";
|
|
40891
40607
|
function loadInstallMetadata(extensionDir) {
|
|
40892
|
-
const metadataFilePath =
|
|
40608
|
+
const metadataFilePath = path8.join(extensionDir, INSTALL_METADATA_FILENAME);
|
|
40893
40609
|
try {
|
|
40894
|
-
const configContent =
|
|
40610
|
+
const configContent = fs13.readFileSync(metadataFilePath, "utf-8");
|
|
40895
40611
|
const metadata = JSON.parse(configContent);
|
|
40896
40612
|
return metadata;
|
|
40897
40613
|
} catch {
|
|
@@ -40982,8 +40698,8 @@ function extensionUpdatesReducer(state, action) {
|
|
|
40982
40698
|
// packages/cli/src/config/extensions/github.ts
|
|
40983
40699
|
import * as os4 from "node:os";
|
|
40984
40700
|
import * as https2 from "node:https";
|
|
40985
|
-
import * as
|
|
40986
|
-
import * as
|
|
40701
|
+
import * as fs15 from "node:fs";
|
|
40702
|
+
import * as path9 from "node:path";
|
|
40987
40703
|
|
|
40988
40704
|
// packages/cli/node_modules/tar/dist/esm/index.min.js
|
|
40989
40705
|
import Hr from "events";
|
|
@@ -43109,7 +42825,7 @@ var di = (s3, t, e, i) => {
|
|
|
43109
42825
|
});
|
|
43110
42826
|
};
|
|
43111
42827
|
var $n = (s3, t, e, i, r2) => {
|
|
43112
|
-
if (t.isDirectory())
|
|
42828
|
+
if (t.isDirectory()) fs14(Ee.resolve(s3, t.name), e, i, (n) => {
|
|
43113
42829
|
if (n) return r2(n);
|
|
43114
42830
|
let o = Ee.resolve(s3, t.name);
|
|
43115
42831
|
di(o, e, i, r2);
|
|
@@ -43119,7 +42835,7 @@ var $n = (s3, t, e, i, r2) => {
|
|
|
43119
42835
|
di(n, e, i, r2);
|
|
43120
42836
|
}
|
|
43121
42837
|
};
|
|
43122
|
-
var
|
|
42838
|
+
var fs14 = (s3, t, e, i) => {
|
|
43123
42839
|
ui.readdir(s3, { withFileTypes: true }, (r2, n) => {
|
|
43124
42840
|
if (r2) {
|
|
43125
42841
|
if (r2.code === "ENOENT") return i();
|
|
@@ -43182,7 +42898,7 @@ var jn = (s3, t) => {
|
|
|
43182
42898
|
var fr = (s3, t, e) => {
|
|
43183
42899
|
s3 = f(s3);
|
|
43184
42900
|
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) => {
|
|
43185
|
-
E ? e(E) : x && a ?
|
|
42901
|
+
E ? e(E) : x && a ? fs14(x, o, h, (_s) => S(_s)) : n ? k.chmod(s3, r2, e) : e();
|
|
43186
42902
|
};
|
|
43187
42903
|
if (s3 === d) return jn(s3, S);
|
|
43188
42904
|
if (l) return qn.mkdir(s3, { mode: r2, recursive: true }).then((E) => S(null, E ?? void 0), S);
|
|
@@ -44188,9 +43904,9 @@ async function downloadFromGitHubRelease(installMetadata, destination, githubRep
|
|
|
44188
43904
|
};
|
|
44189
43905
|
}
|
|
44190
43906
|
if (!fileName) {
|
|
44191
|
-
fileName =
|
|
43907
|
+
fileName = path9.basename(new URL(archiveUrl).pathname);
|
|
44192
43908
|
}
|
|
44193
|
-
let downloadedAssetPath =
|
|
43909
|
+
let downloadedAssetPath = path9.join(destination, fileName);
|
|
44194
43910
|
if (isTar && !downloadedAssetPath.endsWith(".tar.gz")) {
|
|
44195
43911
|
downloadedAssetPath += ".tar.gz";
|
|
44196
43912
|
} else if (isZip && !downloadedAssetPath.endsWith(".zip")) {
|
|
@@ -44221,26 +43937,26 @@ async function downloadFromGitHubRelease(installMetadata, destination, githubRep
|
|
|
44221
43937
|
errorMessage: `Failed to extract asset from ${downloadedAssetPath}: ${getErrorMessage(error)}`
|
|
44222
43938
|
};
|
|
44223
43939
|
}
|
|
44224
|
-
const entries = await
|
|
43940
|
+
const entries = await fs15.promises.readdir(destination, {
|
|
44225
43941
|
withFileTypes: true
|
|
44226
43942
|
});
|
|
44227
43943
|
if (entries.length === 2) {
|
|
44228
43944
|
const lonelyDir = entries.find((entry) => entry.isDirectory());
|
|
44229
|
-
if (lonelyDir &&
|
|
44230
|
-
|
|
43945
|
+
if (lonelyDir && fs15.existsSync(
|
|
43946
|
+
path9.join(destination, lonelyDir.name, EXTENSIONS_CONFIG_FILENAME)
|
|
44231
43947
|
)) {
|
|
44232
|
-
const dirPathToExtract =
|
|
44233
|
-
const extractedDirFiles = await
|
|
43948
|
+
const dirPathToExtract = path9.join(destination, lonelyDir.name);
|
|
43949
|
+
const extractedDirFiles = await fs15.promises.readdir(dirPathToExtract);
|
|
44234
43950
|
for (const file of extractedDirFiles) {
|
|
44235
|
-
await
|
|
44236
|
-
|
|
44237
|
-
|
|
43951
|
+
await fs15.promises.rename(
|
|
43952
|
+
path9.join(dirPathToExtract, file),
|
|
43953
|
+
path9.join(destination, file)
|
|
44238
43954
|
);
|
|
44239
43955
|
}
|
|
44240
|
-
await
|
|
43956
|
+
await fs15.promises.rmdir(dirPathToExtract);
|
|
44241
43957
|
}
|
|
44242
43958
|
}
|
|
44243
|
-
await
|
|
43959
|
+
await fs15.promises.unlink(downloadedAssetPath);
|
|
44244
43960
|
return {
|
|
44245
43961
|
tagName: releaseData.tag_name,
|
|
44246
43962
|
type: "github-release",
|
|
@@ -44310,7 +44026,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44310
44026
|
new Error(`Request failed with status code ${res.statusCode}`)
|
|
44311
44027
|
);
|
|
44312
44028
|
}
|
|
44313
|
-
const file =
|
|
44029
|
+
const file = fs15.createWriteStream(dest);
|
|
44314
44030
|
res.pipe(file);
|
|
44315
44031
|
file.on("finish", () => file.close(resolve8));
|
|
44316
44032
|
}).on("error", reject);
|
|
@@ -44596,9 +44312,9 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
44596
44312
|
}
|
|
44597
44313
|
}
|
|
44598
44314
|
const extensionsDir = ExtensionStorage.getUserExtensionsDir();
|
|
44599
|
-
await
|
|
44315
|
+
await fs16.promises.mkdir(extensionsDir, { recursive: true });
|
|
44600
44316
|
if (installMetadata.type === "local" || installMetadata.type === "link") {
|
|
44601
|
-
installMetadata.source =
|
|
44317
|
+
installMetadata.source = path10.isAbsolute(installMetadata.source) ? installMetadata.source : path10.resolve(this.workspaceDir, installMetadata.source);
|
|
44602
44318
|
}
|
|
44603
44319
|
let tempDir;
|
|
44604
44320
|
if (installMetadata.type === "git" || installMetadata.type === "github-release") {
|
|
@@ -44663,12 +44379,12 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44663
44379
|
`Cannot update to "${newExtensionName}" because an extension with that name is already installed.`
|
|
44664
44380
|
);
|
|
44665
44381
|
}
|
|
44666
|
-
const newHasHooks =
|
|
44667
|
-
|
|
44382
|
+
const newHasHooks = fs16.existsSync(
|
|
44383
|
+
path10.join(localSourcePath, "hooks", "hooks.json")
|
|
44668
44384
|
);
|
|
44669
44385
|
const previousHasHooks = !!(isUpdate && previous && previous.hooks && Object.keys(previous.hooks).length > 0);
|
|
44670
44386
|
const newSkills = await loadSkillsFromDir(
|
|
44671
|
-
|
|
44387
|
+
path10.join(localSourcePath, "skills")
|
|
44672
44388
|
);
|
|
44673
44389
|
const previousSkills = previous?.skills ?? [];
|
|
44674
44390
|
const isMigrating = Boolean(
|
|
@@ -44688,7 +44404,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44688
44404
|
const destinationPath = new ExtensionStorage(
|
|
44689
44405
|
newExtensionName
|
|
44690
44406
|
).getExtensionDir();
|
|
44691
|
-
if ((!isUpdate || newExtensionName !== previousName) &&
|
|
44407
|
+
if ((!isUpdate || newExtensionName !== previousName) && fs16.existsSync(destinationPath)) {
|
|
44692
44408
|
throw new Error(
|
|
44693
44409
|
`Cannot install extension "${newExtensionName}" because a directory with that name already exists. Please remove it manually.`
|
|
44694
44410
|
);
|
|
@@ -44716,7 +44432,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44716
44432
|
}
|
|
44717
44433
|
await this.uninstallExtension(previousName, isUpdate);
|
|
44718
44434
|
}
|
|
44719
|
-
await
|
|
44435
|
+
await fs16.promises.mkdir(destinationPath, { recursive: true });
|
|
44720
44436
|
if (this.requestSetting && this.settings.experimental.extensionConfig) {
|
|
44721
44437
|
if (isUpdate) {
|
|
44722
44438
|
await maybePromptForSettings(
|
|
@@ -44750,11 +44466,11 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44750
44466
|
await copyExtension(localSourcePath, destinationPath);
|
|
44751
44467
|
}
|
|
44752
44468
|
const metadataString = JSON.stringify(installMetadata, null, 2);
|
|
44753
|
-
const metadataPath =
|
|
44469
|
+
const metadataPath = path10.join(
|
|
44754
44470
|
destinationPath,
|
|
44755
44471
|
INSTALL_METADATA_FILENAME
|
|
44756
44472
|
);
|
|
44757
|
-
await
|
|
44473
|
+
await fs16.promises.writeFile(metadataPath, metadataString);
|
|
44758
44474
|
await this.storeExtensionIntegrity(
|
|
44759
44475
|
newExtensionConfig.name,
|
|
44760
44476
|
installMetadata
|
|
@@ -44806,7 +44522,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44806
44522
|
}
|
|
44807
44523
|
} finally {
|
|
44808
44524
|
if (tempDir) {
|
|
44809
|
-
await
|
|
44525
|
+
await fs16.promises.rm(tempDir, { recursive: true, force: true });
|
|
44810
44526
|
}
|
|
44811
44527
|
}
|
|
44812
44528
|
return extension;
|
|
@@ -44858,9 +44574,9 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44858
44574
|
}
|
|
44859
44575
|
await this.unloadExtension(extension);
|
|
44860
44576
|
const storage = new ExtensionStorage(
|
|
44861
|
-
extension.installMetadata?.type === "link" ? extension.name :
|
|
44577
|
+
extension.installMetadata?.type === "link" ? extension.name : path10.basename(extension.path)
|
|
44862
44578
|
);
|
|
44863
|
-
await
|
|
44579
|
+
await fs16.promises.rm(storage.getExtensionDir(), {
|
|
44864
44580
|
recursive: true,
|
|
44865
44581
|
force: true
|
|
44866
44582
|
});
|
|
@@ -44905,13 +44621,13 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44905
44621
|
return this.loadedExtensions;
|
|
44906
44622
|
}
|
|
44907
44623
|
const extensionsDir = ExtensionStorage.getUserExtensionsDir();
|
|
44908
|
-
if (!
|
|
44624
|
+
if (!fs16.existsSync(extensionsDir)) {
|
|
44909
44625
|
this.loadedExtensions = [];
|
|
44910
44626
|
return this.loadedExtensions;
|
|
44911
44627
|
}
|
|
44912
|
-
const subdirs = await
|
|
44628
|
+
const subdirs = await fs16.promises.readdir(extensionsDir);
|
|
44913
44629
|
const extensionPromises = subdirs.map((subdir) => {
|
|
44914
|
-
const extensionDir =
|
|
44630
|
+
const extensionDir = path10.join(extensionsDir, subdir);
|
|
44915
44631
|
return this._buildExtension(extensionDir);
|
|
44916
44632
|
});
|
|
44917
44633
|
const builtExtensionsOrNull = await Promise.all(extensionPromises);
|
|
@@ -44973,7 +44689,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44973
44689
|
*/
|
|
44974
44690
|
async _buildExtension(extensionDir) {
|
|
44975
44691
|
try {
|
|
44976
|
-
const stats = await
|
|
44692
|
+
const stats = await fs16.promises.stat(extensionDir);
|
|
44977
44693
|
if (!stats.isDirectory()) {
|
|
44978
44694
|
return null;
|
|
44979
44695
|
}
|
|
@@ -45103,7 +44819,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45103
44819
|
}
|
|
45104
44820
|
}
|
|
45105
44821
|
const contextFiles = getContextFileNames(config).map((contextFileName) => {
|
|
45106
|
-
const contextFilePath =
|
|
44822
|
+
const contextFilePath = path10.join(
|
|
45107
44823
|
effectiveExtensionPath,
|
|
45108
44824
|
contextFileName
|
|
45109
44825
|
);
|
|
@@ -45113,12 +44829,12 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45113
44829
|
);
|
|
45114
44830
|
}
|
|
45115
44831
|
return contextFilePath;
|
|
45116
|
-
}).filter((contextFilePath) =>
|
|
44832
|
+
}).filter((contextFilePath) => fs16.existsSync(contextFilePath));
|
|
45117
44833
|
const hydrationContext = {
|
|
45118
44834
|
extensionPath: effectiveExtensionPath,
|
|
45119
44835
|
workspacePath: this.workspaceDir,
|
|
45120
|
-
"/":
|
|
45121
|
-
pathSeparator:
|
|
44836
|
+
"/": path10.sep,
|
|
44837
|
+
pathSeparator: path10.sep,
|
|
45122
44838
|
...customEnv
|
|
45123
44839
|
};
|
|
45124
44840
|
let hooks;
|
|
@@ -45152,7 +44868,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45152
44868
|
}
|
|
45153
44869
|
}
|
|
45154
44870
|
let skills = await loadSkillsFromDir(
|
|
45155
|
-
|
|
44871
|
+
path10.join(effectiveExtensionPath, "skills")
|
|
45156
44872
|
);
|
|
45157
44873
|
skills = skills.map((skill) => ({
|
|
45158
44874
|
...recursivelyHydrateStrings(skill, hydrationContext),
|
|
@@ -45160,8 +44876,8 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45160
44876
|
}));
|
|
45161
44877
|
let rules;
|
|
45162
44878
|
let checkers;
|
|
45163
|
-
const policyDir =
|
|
45164
|
-
if (
|
|
44879
|
+
const policyDir = path10.join(effectiveExtensionPath, "policies");
|
|
44880
|
+
if (fs16.existsSync(policyDir)) {
|
|
45165
44881
|
const result = await loadExtensionPolicies(config.name, policyDir);
|
|
45166
44882
|
rules = result.rules;
|
|
45167
44883
|
checkers = result.checkers;
|
|
@@ -45175,7 +44891,7 @@ Details: ${error.details}` : ""}`
|
|
|
45175
44891
|
}
|
|
45176
44892
|
}
|
|
45177
44893
|
const agentLoadResult = await loadAgentsFromDirectory(
|
|
45178
|
-
|
|
44894
|
+
path10.join(effectiveExtensionPath, "agents")
|
|
45179
44895
|
);
|
|
45180
44896
|
agentLoadResult.agents = agentLoadResult.agents.map((agent) => ({
|
|
45181
44897
|
...recursivelyHydrateStrings(agent, hydrationContext),
|
|
@@ -45235,12 +44951,12 @@ Details: ${error.details}` : ""}`
|
|
|
45235
44951
|
return this.maybeStopExtension(extension);
|
|
45236
44952
|
}
|
|
45237
44953
|
async loadExtensionConfig(extensionDir) {
|
|
45238
|
-
const configFilePath =
|
|
45239
|
-
if (!
|
|
44954
|
+
const configFilePath = path10.join(extensionDir, EXTENSIONS_CONFIG_FILENAME);
|
|
44955
|
+
if (!fs16.existsSync(configFilePath)) {
|
|
45240
44956
|
throw new Error(`Configuration file not found at ${configFilePath}`);
|
|
45241
44957
|
}
|
|
45242
44958
|
try {
|
|
45243
|
-
const configContent = await
|
|
44959
|
+
const configContent = await fs16.promises.readFile(configFilePath, "utf-8");
|
|
45244
44960
|
const rawConfig = JSON.parse(configContent);
|
|
45245
44961
|
if (!rawConfig.name || !rawConfig.version) {
|
|
45246
44962
|
throw new Error(
|
|
@@ -45253,8 +44969,8 @@ Details: ${error.details}` : ""}`
|
|
|
45253
44969
|
{
|
|
45254
44970
|
extensionPath: extensionDir,
|
|
45255
44971
|
workspacePath: this.workspaceDir,
|
|
45256
|
-
"/":
|
|
45257
|
-
pathSeparator:
|
|
44972
|
+
"/": path10.sep,
|
|
44973
|
+
pathSeparator: path10.sep
|
|
45258
44974
|
}
|
|
45259
44975
|
);
|
|
45260
44976
|
validateName(config.name);
|
|
@@ -45268,9 +44984,9 @@ Details: ${error.details}` : ""}`
|
|
|
45268
44984
|
}
|
|
45269
44985
|
}
|
|
45270
44986
|
async loadExtensionHooks(extensionDir, context) {
|
|
45271
|
-
const hooksFilePath =
|
|
44987
|
+
const hooksFilePath = path10.join(extensionDir, "hooks", "hooks.json");
|
|
45272
44988
|
try {
|
|
45273
|
-
const hooksContent = await
|
|
44989
|
+
const hooksContent = await fs16.promises.readFile(hooksFilePath, "utf-8");
|
|
45274
44990
|
const rawHooks = JSON.parse(hooksContent);
|
|
45275
44991
|
if (!rawHooks || typeof rawHooks !== "object" || typeof rawHooks.hooks !== "object" || rawHooks.hooks === null || Array.isArray(rawHooks.hooks)) {
|
|
45276
44992
|
debugLogger.warn(
|
|
@@ -45283,8 +44999,8 @@ Details: ${error.details}` : ""}`
|
|
|
45283
44999
|
rawHooks.hooks,
|
|
45284
45000
|
{
|
|
45285
45001
|
...context,
|
|
45286
|
-
"/":
|
|
45287
|
-
pathSeparator:
|
|
45002
|
+
"/": path10.sep,
|
|
45003
|
+
pathSeparator: path10.sep
|
|
45288
45004
|
}
|
|
45289
45005
|
);
|
|
45290
45006
|
return hydratedHooks;
|
|
@@ -45440,19 +45156,19 @@ function filterMcpConfig(original) {
|
|
|
45440
45156
|
return Object.freeze(rest);
|
|
45441
45157
|
}
|
|
45442
45158
|
async function makeWritableRecursive(targetPath) {
|
|
45443
|
-
const stats = await
|
|
45159
|
+
const stats = await fs16.promises.lstat(targetPath);
|
|
45444
45160
|
if (stats.isDirectory()) {
|
|
45445
|
-
await
|
|
45446
|
-
const children = await
|
|
45161
|
+
await fs16.promises.chmod(targetPath, stats.mode | 448);
|
|
45162
|
+
const children = await fs16.promises.readdir(targetPath);
|
|
45447
45163
|
for (const child of children) {
|
|
45448
|
-
await makeWritableRecursive(
|
|
45164
|
+
await makeWritableRecursive(path10.join(targetPath, child));
|
|
45449
45165
|
}
|
|
45450
45166
|
} else if (stats.isFile()) {
|
|
45451
|
-
await
|
|
45167
|
+
await fs16.promises.chmod(targetPath, stats.mode | 384);
|
|
45452
45168
|
}
|
|
45453
45169
|
}
|
|
45454
45170
|
async function copyExtension(source2, destination) {
|
|
45455
|
-
await
|
|
45171
|
+
await fs16.promises.cp(source2, destination, { recursive: true });
|
|
45456
45172
|
await makeWritableRecursive(destination);
|
|
45457
45173
|
}
|
|
45458
45174
|
function getContextFileNames(config) {
|
|
@@ -45511,8 +45227,8 @@ function hashValue(value) {
|
|
|
45511
45227
|
}
|
|
45512
45228
|
|
|
45513
45229
|
// packages/cli/src/config/mcp/mcpServerEnablement.ts
|
|
45514
|
-
import
|
|
45515
|
-
import
|
|
45230
|
+
import fs17 from "node:fs/promises";
|
|
45231
|
+
import path11 from "node:path";
|
|
45516
45232
|
function normalizeServerId(serverId) {
|
|
45517
45233
|
return serverId.toLowerCase().trim();
|
|
45518
45234
|
}
|
|
@@ -45613,7 +45329,7 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45613
45329
|
}
|
|
45614
45330
|
constructor() {
|
|
45615
45331
|
this.configDir = Storage.getGlobalGeminiDir();
|
|
45616
|
-
this.configFilePath =
|
|
45332
|
+
this.configFilePath = path11.join(this.configDir, MCP_ENABLEMENT_FILENAME);
|
|
45617
45333
|
}
|
|
45618
45334
|
/**
|
|
45619
45335
|
* Check if server is enabled in FILE (persistent config only).
|
|
@@ -45733,7 +45449,7 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45733
45449
|
*/
|
|
45734
45450
|
async readConfig() {
|
|
45735
45451
|
try {
|
|
45736
|
-
const content = await
|
|
45452
|
+
const content = await fs17.readFile(this.configFilePath, "utf-8");
|
|
45737
45453
|
return JSON.parse(content);
|
|
45738
45454
|
} catch (error) {
|
|
45739
45455
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
@@ -45751,8 +45467,8 @@ var McpServerEnablementManager = class _McpServerEnablementManager {
|
|
|
45751
45467
|
* Write config to file asynchronously.
|
|
45752
45468
|
*/
|
|
45753
45469
|
async writeConfig(config) {
|
|
45754
|
-
await
|
|
45755
|
-
await
|
|
45470
|
+
await fs17.mkdir(this.configDir, { recursive: true });
|
|
45471
|
+
await fs17.writeFile(this.configFilePath, JSON.stringify(config, null, 2));
|
|
45756
45472
|
}
|
|
45757
45473
|
};
|
|
45758
45474
|
|
|
@@ -45793,9 +45509,9 @@ function isSettingsValue(value) {
|
|
|
45793
45509
|
const type = typeof value;
|
|
45794
45510
|
return type === "string" || type === "number" || type === "boolean" || type === "object";
|
|
45795
45511
|
}
|
|
45796
|
-
function getNestedValue(obj,
|
|
45512
|
+
function getNestedValue(obj, path36) {
|
|
45797
45513
|
let current = obj;
|
|
45798
|
-
for (const key of
|
|
45514
|
+
for (const key of path36) {
|
|
45799
45515
|
if (!isRecord(current) || !(key in current)) {
|
|
45800
45516
|
return void 0;
|
|
45801
45517
|
}
|
|
@@ -45808,8 +45524,8 @@ function getEffectiveValue(key, settings) {
|
|
|
45808
45524
|
if (!definition) {
|
|
45809
45525
|
return void 0;
|
|
45810
45526
|
}
|
|
45811
|
-
const
|
|
45812
|
-
const value = getNestedValue(settings,
|
|
45527
|
+
const path36 = key.split(".");
|
|
45528
|
+
const value = getNestedValue(settings, path36);
|
|
45813
45529
|
if (value !== void 0 && isSettingsValue(value)) {
|
|
45814
45530
|
return value;
|
|
45815
45531
|
}
|
|
@@ -45819,8 +45535,8 @@ function getDialogSettingKeys() {
|
|
|
45819
45535
|
return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
|
|
45820
45536
|
}
|
|
45821
45537
|
function isInSettingsScope(key, scopeSettings) {
|
|
45822
|
-
const
|
|
45823
|
-
const value = getNestedValue(scopeSettings,
|
|
45538
|
+
const path36 = key.split(".");
|
|
45539
|
+
const value = getNestedValue(scopeSettings, path36);
|
|
45824
45540
|
return value !== void 0;
|
|
45825
45541
|
}
|
|
45826
45542
|
function getDisplayValue(key, scopeSettings, _mergedSettings) {
|
|
@@ -45916,8 +45632,8 @@ function getEditValue(type, rawValue) {
|
|
|
45916
45632
|
}
|
|
45917
45633
|
|
|
45918
45634
|
// packages/cli/src/ui/hooks/atCommandProcessor.ts
|
|
45919
|
-
import * as
|
|
45920
|
-
import * as
|
|
45635
|
+
import * as fs18 from "node:fs/promises";
|
|
45636
|
+
import * as path12 from "node:path";
|
|
45921
45637
|
import { Buffer as Buffer5 } from "node:buffer";
|
|
45922
45638
|
var REF_CONTENT_HEADER = `
|
|
45923
45639
|
${REFERENCE_CONTENT_START}`;
|
|
@@ -45996,7 +45712,7 @@ async function checkPermissions(query, config) {
|
|
|
45996
45712
|
const pathName = part.content.substring(1);
|
|
45997
45713
|
if (!pathName) continue;
|
|
45998
45714
|
const resolvedPathName = resolveToRealPath(
|
|
45999
|
-
|
|
45715
|
+
path12.resolve(config.getTargetDir(), pathName)
|
|
46000
45716
|
);
|
|
46001
45717
|
if (config.validatePathAccess(resolvedPathName, "read")) {
|
|
46002
45718
|
if (await fileExists(resolvedPathName)) {
|
|
@@ -46036,15 +45752,15 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
46036
45752
|
}
|
|
46037
45753
|
for (const dir of config.getWorkspaceContext().getDirectories()) {
|
|
46038
45754
|
try {
|
|
46039
|
-
const absolutePath =
|
|
46040
|
-
const stats = await
|
|
46041
|
-
const relativePath =
|
|
45755
|
+
const absolutePath = path12.resolve(dir, pathName);
|
|
45756
|
+
const stats = await fs18.stat(absolutePath);
|
|
45757
|
+
const relativePath = path12.isAbsolute(pathName) ? path12.relative(dir, absolutePath) : pathName;
|
|
46042
45758
|
if (stats.isDirectory()) {
|
|
46043
|
-
const pathSpec =
|
|
45759
|
+
const pathSpec = path12.join(relativePath, "**");
|
|
46044
45760
|
resolvedFiles.push({
|
|
46045
45761
|
part,
|
|
46046
45762
|
pathSpec,
|
|
46047
|
-
displayLabel:
|
|
45763
|
+
displayLabel: path12.isAbsolute(pathName) ? relativePath : pathName,
|
|
46048
45764
|
absolutePath
|
|
46049
45765
|
});
|
|
46050
45766
|
onDebugMessage(
|
|
@@ -46054,7 +45770,7 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
46054
45770
|
resolvedFiles.push({
|
|
46055
45771
|
part,
|
|
46056
45772
|
pathSpec: relativePath,
|
|
46057
|
-
displayLabel:
|
|
45773
|
+
displayLabel: path12.isAbsolute(pathName) ? relativePath : pathName,
|
|
46058
45774
|
absolutePath
|
|
46059
45775
|
});
|
|
46060
45776
|
onDebugMessage(
|
|
@@ -46080,11 +45796,11 @@ async function resolveFilePaths(fileParts, config, onDebugMessage, signal) {
|
|
|
46080
45796
|
const lines = globResult.llmContent.split("\n");
|
|
46081
45797
|
if (lines.length > 1 && lines[1]) {
|
|
46082
45798
|
const firstMatchAbsolute = lines[1].trim();
|
|
46083
|
-
const pathSpec =
|
|
45799
|
+
const pathSpec = path12.relative(dir, firstMatchAbsolute);
|
|
46084
45800
|
resolvedFiles.push({
|
|
46085
45801
|
part,
|
|
46086
45802
|
pathSpec,
|
|
46087
|
-
displayLabel:
|
|
45803
|
+
displayLabel: path12.isAbsolute(pathName) ? pathSpec : pathName
|
|
46088
45804
|
});
|
|
46089
45805
|
onDebugMessage(
|
|
46090
45806
|
`Glob search for ${pathName} found ${firstMatchAbsolute}, using relative path: ${pathSpec}`
|
|
@@ -46271,7 +45987,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
46271
45987
|
if (!displayPath) {
|
|
46272
45988
|
for (const dir of config.getWorkspaceContext().getDirectories()) {
|
|
46273
45989
|
if (filePathSpecInContent.startsWith(dir)) {
|
|
46274
|
-
displayPath =
|
|
45990
|
+
displayPath = path12.relative(dir, filePathSpecInContent);
|
|
46275
45991
|
break;
|
|
46276
45992
|
}
|
|
46277
45993
|
}
|
|
@@ -46434,25 +46150,25 @@ function convertResourceContentsToParts(response) {
|
|
|
46434
46150
|
}
|
|
46435
46151
|
|
|
46436
46152
|
// packages/cli/node_modules/clipboardy/index.js
|
|
46437
|
-
import
|
|
46153
|
+
import process25 from "node:process";
|
|
46438
46154
|
|
|
46439
46155
|
// node_modules/is-wayland/index.js
|
|
46440
|
-
import
|
|
46156
|
+
import process20 from "node:process";
|
|
46441
46157
|
function isWayland() {
|
|
46442
|
-
if (
|
|
46158
|
+
if (process20.platform !== "linux") {
|
|
46443
46159
|
return false;
|
|
46444
46160
|
}
|
|
46445
|
-
if (
|
|
46161
|
+
if (process20.env.WAYLAND_DISPLAY) {
|
|
46446
46162
|
return true;
|
|
46447
46163
|
}
|
|
46448
|
-
if (
|
|
46164
|
+
if (process20.env.XDG_SESSION_TYPE === "wayland") {
|
|
46449
46165
|
return true;
|
|
46450
46166
|
}
|
|
46451
46167
|
return false;
|
|
46452
46168
|
}
|
|
46453
46169
|
|
|
46454
46170
|
// node_modules/clipboard-image/index.js
|
|
46455
|
-
import
|
|
46171
|
+
import process22 from "node:process";
|
|
46456
46172
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
46457
46173
|
|
|
46458
46174
|
// node_modules/run-jxa/index.js
|
|
@@ -46692,9 +46408,9 @@ var Subsume = class _Subsume {
|
|
|
46692
46408
|
|
|
46693
46409
|
// node_modules/macos-version/index.js
|
|
46694
46410
|
var import_semver = __toESM(require_semver2(), 1);
|
|
46695
|
-
import
|
|
46696
|
-
import
|
|
46697
|
-
var isMacOS =
|
|
46411
|
+
import process21 from "node:process";
|
|
46412
|
+
import fs19 from "node:fs";
|
|
46413
|
+
var isMacOS = process21.platform === "darwin";
|
|
46698
46414
|
var version;
|
|
46699
46415
|
var clean = (version2) => {
|
|
46700
46416
|
const { length } = version2.split(".");
|
|
@@ -46718,7 +46434,7 @@ function macOSVersion() {
|
|
|
46718
46434
|
return;
|
|
46719
46435
|
}
|
|
46720
46436
|
if (!version) {
|
|
46721
|
-
const file =
|
|
46437
|
+
const file = fs19.readFileSync("/System/Library/CoreServices/SystemVersion.plist", "utf8");
|
|
46722
46438
|
const matches = parseVersion(file);
|
|
46723
46439
|
if (!matches) {
|
|
46724
46440
|
return;
|
|
@@ -46727,7 +46443,7 @@ function macOSVersion() {
|
|
|
46727
46443
|
}
|
|
46728
46444
|
return version;
|
|
46729
46445
|
}
|
|
46730
|
-
if (
|
|
46446
|
+
if (process21.env.NODE_ENV === "test") {
|
|
46731
46447
|
macOSVersion._parseVersion = parseVersion;
|
|
46732
46448
|
}
|
|
46733
46449
|
function isMacOSVersionGreaterThanOrEqualTo(version2) {
|
|
@@ -46774,7 +46490,7 @@ async function runJxa(input, arguments_) {
|
|
|
46774
46490
|
|
|
46775
46491
|
// node_modules/clipboard-image/index.js
|
|
46776
46492
|
async function hasClipboardImages() {
|
|
46777
|
-
if (
|
|
46493
|
+
if (process22.platform !== "darwin") {
|
|
46778
46494
|
return false;
|
|
46779
46495
|
}
|
|
46780
46496
|
const result = await runJxa(() => {
|
|
@@ -46800,7 +46516,7 @@ async function hasClipboardImages() {
|
|
|
46800
46516
|
return result;
|
|
46801
46517
|
}
|
|
46802
46518
|
async function readClipboardImages() {
|
|
46803
|
-
if (
|
|
46519
|
+
if (process22.platform !== "darwin") {
|
|
46804
46520
|
return [];
|
|
46805
46521
|
}
|
|
46806
46522
|
const result = await runJxa(() => {
|
|
@@ -46882,10 +46598,10 @@ async function readClipboardImages() {
|
|
|
46882
46598
|
return result;
|
|
46883
46599
|
}
|
|
46884
46600
|
async function writeClipboardImages(filePaths) {
|
|
46885
|
-
if (
|
|
46601
|
+
if (process22.platform !== "darwin") {
|
|
46886
46602
|
return;
|
|
46887
46603
|
}
|
|
46888
|
-
const paths = filePaths.map((
|
|
46604
|
+
const paths = filePaths.map((path36) => path36 instanceof URL ? fileURLToPath2(path36) : path36);
|
|
46889
46605
|
await runJxa((...paths2) => {
|
|
46890
46606
|
ObjC.import("AppKit");
|
|
46891
46607
|
ObjC.import("Foundation");
|
|
@@ -46965,13 +46681,13 @@ var clipboard = {
|
|
|
46965
46681
|
var termux_default = clipboard;
|
|
46966
46682
|
|
|
46967
46683
|
// packages/cli/node_modules/clipboardy/lib/linux.js
|
|
46968
|
-
import
|
|
46969
|
-
import
|
|
46684
|
+
import fs20 from "node:fs";
|
|
46685
|
+
import path13 from "node:path";
|
|
46970
46686
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
46971
|
-
var __dirname =
|
|
46687
|
+
var __dirname = path13.dirname(fileURLToPath3(import.meta.url));
|
|
46972
46688
|
var xsel = "xsel";
|
|
46973
|
-
var xselFallbackPath =
|
|
46974
|
-
var hasXselFallback =
|
|
46689
|
+
var xselFallbackPath = path13.join(__dirname, "../fallbacks/linux/xsel");
|
|
46690
|
+
var hasXselFallback = fs20.existsSync(xselFallbackPath);
|
|
46975
46691
|
var copyArguments = ["--clipboard", "--input"];
|
|
46976
46692
|
var pasteArguments = ["--clipboard", "--output"];
|
|
46977
46693
|
var isDisplayError = (error) => /Can't open display|Inappropriate ioctl/i.test(error.stderr ?? "");
|
|
@@ -47107,19 +46823,19 @@ var clipboard4 = {
|
|
|
47107
46823
|
var macos_default = clipboard4;
|
|
47108
46824
|
|
|
47109
46825
|
// packages/cli/node_modules/clipboardy/lib/windows.js
|
|
47110
|
-
import
|
|
47111
|
-
import
|
|
46826
|
+
import fs21 from "node:fs";
|
|
46827
|
+
import path14 from "node:path";
|
|
47112
46828
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
47113
46829
|
|
|
47114
46830
|
// node_modules/system-architecture/index.js
|
|
47115
46831
|
import { promisify as promisify2 } from "node:util";
|
|
47116
|
-
import
|
|
47117
|
-
import
|
|
47118
|
-
var execFilePromises = promisify2(
|
|
46832
|
+
import process23 from "node:process";
|
|
46833
|
+
import childProcess from "node:child_process";
|
|
46834
|
+
var execFilePromises = promisify2(childProcess.execFile);
|
|
47119
46835
|
function systemArchitectureSync() {
|
|
47120
|
-
const { arch: arch2, platform: platform5, env: env3 } =
|
|
46836
|
+
const { arch: arch2, platform: platform5, env: env3 } = process23;
|
|
47121
46837
|
if (platform5 === "darwin" && arch2 === "x64") {
|
|
47122
|
-
const stdout =
|
|
46838
|
+
const stdout = childProcess.execFileSync("sysctl", ["-inq", "sysctl.proc_translated"], { encoding: "utf8" });
|
|
47123
46839
|
return stdout.trim() === "1" ? "arm64" : "x64";
|
|
47124
46840
|
}
|
|
47125
46841
|
if (arch2 === "arm64" || arch2 === "x64") {
|
|
@@ -47129,7 +46845,7 @@ function systemArchitectureSync() {
|
|
|
47129
46845
|
return "x64";
|
|
47130
46846
|
}
|
|
47131
46847
|
if (platform5 === "linux") {
|
|
47132
|
-
const stdout =
|
|
46848
|
+
const stdout = childProcess.execFileSync("getconf", ["LONG_BIT"], { encoding: "utf8" });
|
|
47133
46849
|
if (stdout.trim() === "64") {
|
|
47134
46850
|
return "x64";
|
|
47135
46851
|
}
|
|
@@ -47149,12 +46865,12 @@ function is64bitSync() {
|
|
|
47149
46865
|
}
|
|
47150
46866
|
|
|
47151
46867
|
// node_modules/powershell-utils/index.js
|
|
47152
|
-
import
|
|
46868
|
+
import process24 from "node:process";
|
|
47153
46869
|
import { Buffer as Buffer6 } from "node:buffer";
|
|
47154
46870
|
import { promisify as promisify3 } from "node:util";
|
|
47155
|
-
import
|
|
47156
|
-
var execFile = promisify3(
|
|
47157
|
-
var powerShellPath = () => `${
|
|
46871
|
+
import childProcess2 from "node:child_process";
|
|
46872
|
+
var execFile = promisify3(childProcess2.execFile);
|
|
46873
|
+
var powerShellPath = () => `${process24.env.SYSTEMROOT || process24.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
47158
46874
|
var argumentsPrefix = [
|
|
47159
46875
|
"-NoProfile",
|
|
47160
46876
|
"-NonInteractive",
|
|
@@ -47185,10 +46901,10 @@ executePowerShell.escapeArgument = escapeArgument;
|
|
|
47185
46901
|
executePowerShell.createArguments = createArguments;
|
|
47186
46902
|
|
|
47187
46903
|
// packages/cli/node_modules/clipboardy/lib/windows.js
|
|
47188
|
-
var __dirname2 =
|
|
46904
|
+
var __dirname2 = path14.dirname(fileURLToPath4(import.meta.url));
|
|
47189
46905
|
var binarySuffix = is64bitSync() ? "x86_64" : "i686";
|
|
47190
|
-
var windowBinaryPath =
|
|
47191
|
-
var hasWindowsBinaryFallback =
|
|
46906
|
+
var windowBinaryPath = path14.join(__dirname2, `../fallbacks/windows/clipboard_${binarySuffix}.exe`);
|
|
46907
|
+
var hasWindowsBinaryFallback = fs21.existsSync(windowBinaryPath);
|
|
47192
46908
|
var psCopyScript = `
|
|
47193
46909
|
try {
|
|
47194
46910
|
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -47303,7 +47019,7 @@ var wsl_default = clipboard6;
|
|
|
47303
47019
|
|
|
47304
47020
|
// packages/cli/node_modules/clipboardy/index.js
|
|
47305
47021
|
var platformLib = (() => {
|
|
47306
|
-
switch (
|
|
47022
|
+
switch (process25.platform) {
|
|
47307
47023
|
case "darwin": {
|
|
47308
47024
|
return macos_default;
|
|
47309
47025
|
}
|
|
@@ -47311,7 +47027,7 @@ var platformLib = (() => {
|
|
|
47311
47027
|
return windows_default;
|
|
47312
47028
|
}
|
|
47313
47029
|
case "android": {
|
|
47314
|
-
if (
|
|
47030
|
+
if (process25.env.TERMUX_VERSION === void 0) {
|
|
47315
47031
|
throw new Error("You need to install Termux for this module to work on Android: https://termux.com");
|
|
47316
47032
|
}
|
|
47317
47033
|
return termux_default;
|
|
@@ -47362,7 +47078,7 @@ var clipboard7 = {
|
|
|
47362
47078
|
var clipboardy_default = clipboard7;
|
|
47363
47079
|
|
|
47364
47080
|
// packages/cli/src/ui/utils/commandUtils.ts
|
|
47365
|
-
import
|
|
47081
|
+
import fs22 from "node:fs";
|
|
47366
47082
|
var AT_COMMAND_DETECT_REGEX = new RegExp(
|
|
47367
47083
|
`(?<!\\\\)@${AT_COMMAND_PATH_REGEX_SOURCE}`
|
|
47368
47084
|
);
|
|
@@ -47391,7 +47107,7 @@ var SCREEN_DCS_CHUNK_SIZE = 240;
|
|
|
47391
47107
|
var pickTty = () => new Promise((resolve8) => {
|
|
47392
47108
|
if (process.platform !== "win32") {
|
|
47393
47109
|
try {
|
|
47394
|
-
const devTty =
|
|
47110
|
+
const devTty = fs22.createWriteStream("/dev/tty");
|
|
47395
47111
|
const timeout = setTimeout(() => {
|
|
47396
47112
|
devTty.removeAllListeners("open");
|
|
47397
47113
|
devTty.removeAllListeners("error");
|
|
@@ -47472,7 +47188,7 @@ var writeAll = (stream, data) => new Promise((resolve8, reject) => {
|
|
|
47472
47188
|
const fd = stream.fd;
|
|
47473
47189
|
if (process.platform === "win32" && typeof fd === "number" && (stream === process.stdout || stream === process.stderr)) {
|
|
47474
47190
|
try {
|
|
47475
|
-
|
|
47191
|
+
fs22.writeSync(fd, data);
|
|
47476
47192
|
resolve8();
|
|
47477
47193
|
return;
|
|
47478
47194
|
} catch (e) {
|
|
@@ -47588,16 +47304,16 @@ var parseSlashCommand = (query, commands) => {
|
|
|
47588
47304
|
|
|
47589
47305
|
// packages/cli/src/ui/components/shared/text-buffer.ts
|
|
47590
47306
|
var import_react39 = __toESM(require_react(), 1);
|
|
47591
|
-
import
|
|
47307
|
+
import fs24 from "node:fs";
|
|
47592
47308
|
import os5 from "node:os";
|
|
47593
47309
|
import pathMod from "node:path";
|
|
47594
|
-
import * as
|
|
47310
|
+
import * as path16 from "node:path";
|
|
47595
47311
|
|
|
47596
47312
|
// packages/cli/src/ui/utils/clipboardUtils.ts
|
|
47597
|
-
import * as
|
|
47598
|
-
import { createWriteStream as createWriteStream2, existsSync as
|
|
47599
|
-
import { execSync
|
|
47600
|
-
import * as
|
|
47313
|
+
import * as fs23 from "node:fs/promises";
|
|
47314
|
+
import { createWriteStream as createWriteStream2, existsSync as existsSync5, statSync as statSync2 } from "node:fs";
|
|
47315
|
+
import { execSync, spawn } from "node:child_process";
|
|
47316
|
+
import * as path15 from "node:path";
|
|
47601
47317
|
var IMAGE_EXTENSIONS = [
|
|
47602
47318
|
".png",
|
|
47603
47319
|
".jpg",
|
|
@@ -47618,7 +47334,7 @@ function getUserLinuxClipboardTool() {
|
|
|
47618
47334
|
else if (displayServer === "x11") toolName = "xclip";
|
|
47619
47335
|
else return null;
|
|
47620
47336
|
try {
|
|
47621
|
-
|
|
47337
|
+
execSync(`command -v ${toolName}`, { stdio: "ignore" });
|
|
47622
47338
|
linuxClipboardTool = toolName;
|
|
47623
47339
|
return toolName;
|
|
47624
47340
|
} catch (e) {
|
|
@@ -47628,7 +47344,7 @@ function getUserLinuxClipboardTool() {
|
|
|
47628
47344
|
}
|
|
47629
47345
|
async function saveFromCommand(command, args, destination) {
|
|
47630
47346
|
return new Promise((resolve8) => {
|
|
47631
|
-
const child =
|
|
47347
|
+
const child = spawn(command, args);
|
|
47632
47348
|
const fileStream = createWriteStream2(destination);
|
|
47633
47349
|
let resolved = false;
|
|
47634
47350
|
const safeResolve = (value) => {
|
|
@@ -47657,7 +47373,7 @@ async function saveFromCommand(command, args, destination) {
|
|
|
47657
47373
|
}
|
|
47658
47374
|
const checkFile = async () => {
|
|
47659
47375
|
try {
|
|
47660
|
-
const stats = await
|
|
47376
|
+
const stats = await fs23.stat(destination);
|
|
47661
47377
|
safeResolve(stats.size > 0);
|
|
47662
47378
|
} catch (e) {
|
|
47663
47379
|
debugLogger.debug(`Failed to stat output file ${destination}:`, e);
|
|
@@ -47744,7 +47460,7 @@ async function saveFileWithWlPaste(tempFilePath) {
|
|
|
47744
47460
|
return true;
|
|
47745
47461
|
}
|
|
47746
47462
|
try {
|
|
47747
|
-
await
|
|
47463
|
+
await fs23.unlink(tempFilePath);
|
|
47748
47464
|
} catch {
|
|
47749
47465
|
}
|
|
47750
47466
|
return false;
|
|
@@ -47759,7 +47475,7 @@ var saveFileWithXclip = async (tempFilePath) => {
|
|
|
47759
47475
|
return true;
|
|
47760
47476
|
}
|
|
47761
47477
|
try {
|
|
47762
|
-
await
|
|
47478
|
+
await fs23.unlink(tempFilePath);
|
|
47763
47479
|
} catch {
|
|
47764
47480
|
}
|
|
47765
47481
|
return false;
|
|
@@ -47768,15 +47484,15 @@ async function getProjectClipboardImagesDir(targetDir) {
|
|
|
47768
47484
|
const storage = new Storage(targetDir);
|
|
47769
47485
|
await storage.initialize();
|
|
47770
47486
|
const baseDir = storage.getProjectTempDir();
|
|
47771
|
-
return
|
|
47487
|
+
return path15.join(baseDir, "images");
|
|
47772
47488
|
}
|
|
47773
47489
|
async function saveClipboardImage(targetDir) {
|
|
47774
47490
|
try {
|
|
47775
47491
|
const tempDir = await getProjectClipboardImagesDir(targetDir);
|
|
47776
|
-
await
|
|
47492
|
+
await fs23.mkdir(tempDir, { recursive: true });
|
|
47777
47493
|
const timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
47778
47494
|
if (process.platform === "linux") {
|
|
47779
|
-
const tempFilePath =
|
|
47495
|
+
const tempFilePath = path15.join(tempDir, `clipboard-${timestamp}.png`);
|
|
47780
47496
|
const tool = getUserLinuxClipboardTool();
|
|
47781
47497
|
if (tool === "wl-paste") {
|
|
47782
47498
|
if (await saveFileWithWlPaste(tempFilePath)) return tempFilePath;
|
|
@@ -47789,7 +47505,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47789
47505
|
return null;
|
|
47790
47506
|
}
|
|
47791
47507
|
if (process.platform === "win32") {
|
|
47792
|
-
const tempFilePath =
|
|
47508
|
+
const tempFilePath = path15.join(tempDir, `clipboard-${timestamp}.png`);
|
|
47793
47509
|
const psPath = tempFilePath.replace(/'/g, "''");
|
|
47794
47510
|
const script = `
|
|
47795
47511
|
Add-Type -AssemblyName System.Windows.Forms
|
|
@@ -47807,7 +47523,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47807
47523
|
]);
|
|
47808
47524
|
if (stdout.trim() === "success") {
|
|
47809
47525
|
try {
|
|
47810
|
-
const stats = await
|
|
47526
|
+
const stats = await fs23.stat(tempFilePath);
|
|
47811
47527
|
if (stats.size > 0) {
|
|
47812
47528
|
return tempFilePath;
|
|
47813
47529
|
}
|
|
@@ -47821,7 +47537,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47821
47537
|
{ class: "JPEG", extension: "jpg" }
|
|
47822
47538
|
];
|
|
47823
47539
|
for (const format of formats) {
|
|
47824
|
-
const tempFilePath =
|
|
47540
|
+
const tempFilePath = path15.join(
|
|
47825
47541
|
tempDir,
|
|
47826
47542
|
`clipboard-${timestamp}.${format.extension}`
|
|
47827
47543
|
);
|
|
@@ -47842,7 +47558,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47842
47558
|
const { stdout } = await spawnAsync("osascript", ["-e", script]);
|
|
47843
47559
|
if (stdout.trim() === "success") {
|
|
47844
47560
|
try {
|
|
47845
|
-
const stats = await
|
|
47561
|
+
const stats = await fs23.stat(tempFilePath);
|
|
47846
47562
|
if (stats.size > 0) {
|
|
47847
47563
|
return tempFilePath;
|
|
47848
47564
|
}
|
|
@@ -47851,7 +47567,7 @@ async function saveClipboardImage(targetDir) {
|
|
|
47851
47567
|
}
|
|
47852
47568
|
}
|
|
47853
47569
|
try {
|
|
47854
|
-
await
|
|
47570
|
+
await fs23.unlink(tempFilePath);
|
|
47855
47571
|
} catch (e) {
|
|
47856
47572
|
debugLogger.debug("Failed to clean up temp file:", tempFilePath, e);
|
|
47857
47573
|
}
|
|
@@ -47865,15 +47581,15 @@ async function saveClipboardImage(targetDir) {
|
|
|
47865
47581
|
async function cleanupOldClipboardImages(targetDir) {
|
|
47866
47582
|
try {
|
|
47867
47583
|
const tempDir = await getProjectClipboardImagesDir(targetDir);
|
|
47868
|
-
const files = await
|
|
47584
|
+
const files = await fs23.readdir(tempDir);
|
|
47869
47585
|
const oneHourAgo = Date.now() - 60 * 60 * 1e3;
|
|
47870
47586
|
for (const file of files) {
|
|
47871
|
-
const ext =
|
|
47587
|
+
const ext = path15.extname(file).toLowerCase();
|
|
47872
47588
|
if (file.startsWith("clipboard-") && IMAGE_EXTENSIONS.includes(ext)) {
|
|
47873
|
-
const filePath =
|
|
47874
|
-
const stats = await
|
|
47589
|
+
const filePath = path15.join(tempDir, file);
|
|
47590
|
+
const stats = await fs23.stat(filePath);
|
|
47875
47591
|
if (stats.mtimeMs < oneHourAgo) {
|
|
47876
|
-
await
|
|
47592
|
+
await fs23.unlink(filePath);
|
|
47877
47593
|
}
|
|
47878
47594
|
}
|
|
47879
47595
|
}
|
|
@@ -47928,7 +47644,7 @@ function* splitDragAndDropPaths(text) {
|
|
|
47928
47644
|
}
|
|
47929
47645
|
function isValidFilePath(p2) {
|
|
47930
47646
|
try {
|
|
47931
|
-
return PATH_PREFIX_PATTERN.test(p2) &&
|
|
47647
|
+
return PATH_PREFIX_PATTERN.test(p2) && existsSync5(p2) && statSync2(p2).isFile();
|
|
47932
47648
|
} catch {
|
|
47933
47649
|
return false;
|
|
47934
47650
|
}
|
|
@@ -49433,7 +49149,7 @@ function handleVimAction(state, action) {
|
|
|
49433
49149
|
}
|
|
49434
49150
|
|
|
49435
49151
|
// packages/cli/src/ui/utils/editorUtils.ts
|
|
49436
|
-
import { spawn as
|
|
49152
|
+
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
49437
49153
|
async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType) {
|
|
49438
49154
|
let command = void 0;
|
|
49439
49155
|
const args = [filePath];
|
|
@@ -49493,7 +49209,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49493
49209
|
}
|
|
49494
49210
|
} else {
|
|
49495
49211
|
await new Promise((resolve8, reject) => {
|
|
49496
|
-
const child =
|
|
49212
|
+
const child = spawn2(executable, [...initialArgs, ...args], {
|
|
49497
49213
|
stdio: "inherit",
|
|
49498
49214
|
shell: process.platform === "win32"
|
|
49499
49215
|
});
|
|
@@ -50010,8 +49726,8 @@ function getTransformedImagePath(filePath) {
|
|
|
50010
49726
|
unescaped.lastIndexOf("\\")
|
|
50011
49727
|
);
|
|
50012
49728
|
const fileName = lastSepIndex >= 0 ? unescaped.slice(lastSepIndex + 1) : unescaped;
|
|
50013
|
-
const extension =
|
|
50014
|
-
const baseName =
|
|
49729
|
+
const extension = path16.extname(fileName);
|
|
49730
|
+
const baseName = path16.basename(fileName, extension);
|
|
50015
49731
|
const maxBaseLength = 10;
|
|
50016
49732
|
const truncatedBase = baseName.length > maxBaseLength ? `...${baseName.slice(-maxBaseLength)}` : baseName;
|
|
50017
49733
|
return `[Image ${truncatedBase}${extension}]`;
|
|
@@ -51338,7 +51054,9 @@ function useTextBuffer({
|
|
|
51338
51054
|
visualLayout,
|
|
51339
51055
|
transformationsByLine,
|
|
51340
51056
|
pastedContent,
|
|
51341
|
-
expandedPaste
|
|
51057
|
+
expandedPaste,
|
|
51058
|
+
undoStack,
|
|
51059
|
+
redoStack
|
|
51342
51060
|
} = state;
|
|
51343
51061
|
const text = (0, import_react39.useMemo)(() => lines.join("\n"), [lines]);
|
|
51344
51062
|
const visualCursor = (0, import_react39.useMemo)(
|
|
@@ -51664,10 +51382,10 @@ function useTextBuffer({
|
|
|
51664
51382
|
dispatch({ type: "vim_paste_before", payload: { count } });
|
|
51665
51383
|
}, []);
|
|
51666
51384
|
const openInExternalEditor = (0, import_react39.useCallback)(async () => {
|
|
51667
|
-
const tmpDir =
|
|
51385
|
+
const tmpDir = fs24.mkdtempSync(pathMod.join(os5.tmpdir(), "gemini-edit-"));
|
|
51668
51386
|
const filePath = pathMod.join(tmpDir, "buffer.txt");
|
|
51669
51387
|
const expandedText = expandPastePlaceholders(text, pastedContent);
|
|
51670
|
-
|
|
51388
|
+
fs24.writeFileSync(filePath, expandedText, "utf8");
|
|
51671
51389
|
dispatch({ type: "create_undo_snapshot" });
|
|
51672
51390
|
try {
|
|
51673
51391
|
await openFileInEditor(
|
|
@@ -51676,7 +51394,7 @@ function useTextBuffer({
|
|
|
51676
51394
|
setRawMode,
|
|
51677
51395
|
getPreferredEditor?.()
|
|
51678
51396
|
);
|
|
51679
|
-
let newText =
|
|
51397
|
+
let newText = fs24.readFileSync(filePath, "utf8");
|
|
51680
51398
|
newText = newText.replace(/\r\n?/g, "\n");
|
|
51681
51399
|
const sortedPlaceholders = Object.entries(pastedContent).sort(
|
|
51682
51400
|
(a, b2) => b2[1].length - a[1].length
|
|
@@ -51695,11 +51413,11 @@ function useTextBuffer({
|
|
|
51695
51413
|
);
|
|
51696
51414
|
} finally {
|
|
51697
51415
|
try {
|
|
51698
|
-
|
|
51416
|
+
fs24.unlinkSync(filePath);
|
|
51699
51417
|
} catch {
|
|
51700
51418
|
}
|
|
51701
51419
|
try {
|
|
51702
|
-
|
|
51420
|
+
fs24.rmdirSync(tmpDir);
|
|
51703
51421
|
} catch {
|
|
51704
51422
|
}
|
|
51705
51423
|
}
|
|
@@ -51792,10 +51510,16 @@ function useTextBuffer({
|
|
|
51792
51510
|
return true;
|
|
51793
51511
|
}
|
|
51794
51512
|
if (keyMatchers["edit.undo" /* UNDO */](key)) {
|
|
51513
|
+
if (undoStack.length === 0) {
|
|
51514
|
+
return false;
|
|
51515
|
+
}
|
|
51795
51516
|
undo();
|
|
51796
51517
|
return true;
|
|
51797
51518
|
}
|
|
51798
51519
|
if (keyMatchers["edit.redo" /* REDO */](key)) {
|
|
51520
|
+
if (redoStack.length === 0) {
|
|
51521
|
+
return false;
|
|
51522
|
+
}
|
|
51799
51523
|
redo();
|
|
51800
51524
|
return true;
|
|
51801
51525
|
}
|
|
@@ -51823,7 +51547,9 @@ function useTextBuffer({
|
|
|
51823
51547
|
text,
|
|
51824
51548
|
visualCursor,
|
|
51825
51549
|
visualLines,
|
|
51826
|
-
keyMatchers
|
|
51550
|
+
keyMatchers,
|
|
51551
|
+
undoStack.length,
|
|
51552
|
+
redoStack.length
|
|
51827
51553
|
]
|
|
51828
51554
|
);
|
|
51829
51555
|
const visualScrollRow = (0, import_react39.useMemo)(() => {
|
|
@@ -52182,7 +51908,7 @@ function useTextBuffer({
|
|
|
52182
51908
|
var import_react40 = __toESM(require_react(), 1);
|
|
52183
51909
|
|
|
52184
51910
|
// packages/cli/src/config/extensions/update.ts
|
|
52185
|
-
import * as
|
|
51911
|
+
import * as fs25 from "node:fs";
|
|
52186
51912
|
async function updateExtension(extension, extensionManager, currentState, dispatchExtensionStateUpdate, enableExtensionReloading) {
|
|
52187
51913
|
if (currentState === "updating" /* UPDATING */) {
|
|
52188
51914
|
return void 0;
|
|
@@ -52284,7 +52010,7 @@ ${e}`
|
|
|
52284
52010
|
await copyExtension(tempDir, extension.path);
|
|
52285
52011
|
throw e;
|
|
52286
52012
|
} finally {
|
|
52287
|
-
await
|
|
52013
|
+
await fs25.promises.rm(tempDir, { recursive: true, force: true });
|
|
52288
52014
|
}
|
|
52289
52015
|
}
|
|
52290
52016
|
async function updateAllUpdatableExtensions(extensions, extensionsState, extensionManager, dispatch, enableExtensionReloading) {
|
|
@@ -52559,7 +52285,7 @@ var useInputState = () => {
|
|
|
52559
52285
|
|
|
52560
52286
|
// packages/cli/src/ui/hooks/useSessionBrowser.ts
|
|
52561
52287
|
var import_react44 = __toESM(require_react(), 1);
|
|
52562
|
-
import
|
|
52288
|
+
import path17 from "node:path";
|
|
52563
52289
|
var useSessionBrowser = (config, onLoadHistory) => {
|
|
52564
52290
|
const [isSessionBrowserOpen, setIsSessionBrowserOpen] = (0, import_react44.useState)(false);
|
|
52565
52291
|
return {
|
|
@@ -52576,12 +52302,12 @@ var useSessionBrowser = (config, onLoadHistory) => {
|
|
|
52576
52302
|
handleResumeSession: (0, import_react44.useCallback)(
|
|
52577
52303
|
async (session) => {
|
|
52578
52304
|
try {
|
|
52579
|
-
const chatsDir =
|
|
52305
|
+
const chatsDir = path17.join(
|
|
52580
52306
|
config.storage.getProjectTempDir(),
|
|
52581
52307
|
"chats"
|
|
52582
52308
|
);
|
|
52583
52309
|
const fileName = session.fileName;
|
|
52584
|
-
const originalFilePath =
|
|
52310
|
+
const originalFilePath = path17.join(chatsDir, fileName);
|
|
52585
52311
|
const conversation = await loadConversationRecord(originalFilePath);
|
|
52586
52312
|
if (!conversation) {
|
|
52587
52313
|
throw new Error(
|
|
@@ -52632,23 +52358,23 @@ var useSessionBrowser = (config, onLoadHistory) => {
|
|
|
52632
52358
|
};
|
|
52633
52359
|
|
|
52634
52360
|
// packages/cli/src/ui/utils/terminalSetup.ts
|
|
52635
|
-
import { promises as
|
|
52361
|
+
import { promises as fs27 } from "node:fs";
|
|
52636
52362
|
import * as os6 from "node:os";
|
|
52637
|
-
import * as
|
|
52363
|
+
import * as path19 from "node:path";
|
|
52638
52364
|
import { exec as exec2 } from "node:child_process";
|
|
52639
52365
|
import { promisify as promisify4 } from "node:util";
|
|
52640
52366
|
var import_react45 = __toESM(require_react(), 1);
|
|
52641
52367
|
|
|
52642
52368
|
// packages/cli/src/utils/persistentState.ts
|
|
52643
|
-
import * as
|
|
52644
|
-
import * as
|
|
52369
|
+
import * as fs26 from "node:fs";
|
|
52370
|
+
import * as path18 from "node:path";
|
|
52645
52371
|
var STATE_FILENAME = "state.json";
|
|
52646
52372
|
var PersistentState = class {
|
|
52647
52373
|
cache = null;
|
|
52648
52374
|
filePath = null;
|
|
52649
52375
|
getPath() {
|
|
52650
52376
|
if (!this.filePath) {
|
|
52651
|
-
this.filePath =
|
|
52377
|
+
this.filePath = path18.join(Storage.getGlobalGeminiDir(), STATE_FILENAME);
|
|
52652
52378
|
}
|
|
52653
52379
|
return this.filePath;
|
|
52654
52380
|
}
|
|
@@ -52658,8 +52384,8 @@ var PersistentState = class {
|
|
|
52658
52384
|
}
|
|
52659
52385
|
try {
|
|
52660
52386
|
const filePath = this.getPath();
|
|
52661
|
-
if (
|
|
52662
|
-
const content =
|
|
52387
|
+
if (fs26.existsSync(filePath)) {
|
|
52388
|
+
const content = fs26.readFileSync(filePath, "utf-8");
|
|
52663
52389
|
this.cache = JSON.parse(content);
|
|
52664
52390
|
} else {
|
|
52665
52391
|
this.cache = {};
|
|
@@ -52674,11 +52400,11 @@ var PersistentState = class {
|
|
|
52674
52400
|
if (!this.cache) return;
|
|
52675
52401
|
try {
|
|
52676
52402
|
const filePath = this.getPath();
|
|
52677
|
-
const dir =
|
|
52678
|
-
if (!
|
|
52679
|
-
|
|
52403
|
+
const dir = path18.dirname(filePath);
|
|
52404
|
+
if (!fs26.existsSync(dir)) {
|
|
52405
|
+
fs26.mkdirSync(dir, { recursive: true });
|
|
52680
52406
|
}
|
|
52681
|
-
|
|
52407
|
+
fs26.writeFileSync(filePath, JSON.stringify(this.cache, null, 2));
|
|
52682
52408
|
} catch (error) {
|
|
52683
52409
|
debugLogger.warn("Failed to save persistent state:", error);
|
|
52684
52410
|
}
|
|
@@ -52761,7 +52487,7 @@ async function backupFile(filePath) {
|
|
|
52761
52487
|
try {
|
|
52762
52488
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
52763
52489
|
const backupPath = `${filePath}.backup.${timestamp}`;
|
|
52764
|
-
await
|
|
52490
|
+
await fs27.copyFile(filePath, backupPath);
|
|
52765
52491
|
} catch (error) {
|
|
52766
52492
|
debugLogger.warn(`Failed to create backup of ${filePath}:`, error);
|
|
52767
52493
|
}
|
|
@@ -52769,7 +52495,7 @@ async function backupFile(filePath) {
|
|
|
52769
52495
|
function getVSCodeStyleConfigDir(appName) {
|
|
52770
52496
|
const platform5 = os6.platform();
|
|
52771
52497
|
if (platform5 === "darwin") {
|
|
52772
|
-
return
|
|
52498
|
+
return path19.join(
|
|
52773
52499
|
homedir(),
|
|
52774
52500
|
"Library",
|
|
52775
52501
|
"Application Support",
|
|
@@ -52780,9 +52506,9 @@ function getVSCodeStyleConfigDir(appName) {
|
|
|
52780
52506
|
if (!process.env["APPDATA"]) {
|
|
52781
52507
|
return null;
|
|
52782
52508
|
}
|
|
52783
|
-
return
|
|
52509
|
+
return path19.join(process.env["APPDATA"], appName, "User");
|
|
52784
52510
|
} else {
|
|
52785
|
-
return
|
|
52511
|
+
return path19.join(homedir(), ".config", appName, "User");
|
|
52786
52512
|
}
|
|
52787
52513
|
}
|
|
52788
52514
|
async function configureVSCodeStyle(terminalName, appName) {
|
|
@@ -52793,12 +52519,12 @@ async function configureVSCodeStyle(terminalName, appName) {
|
|
|
52793
52519
|
message: `Could not determine ${terminalName} config path on Windows: APPDATA environment variable is not set.`
|
|
52794
52520
|
};
|
|
52795
52521
|
}
|
|
52796
|
-
const keybindingsFile =
|
|
52522
|
+
const keybindingsFile = path19.join(configDir, "keybindings.json");
|
|
52797
52523
|
try {
|
|
52798
|
-
await
|
|
52524
|
+
await fs27.mkdir(configDir, { recursive: true });
|
|
52799
52525
|
let keybindings = [];
|
|
52800
52526
|
try {
|
|
52801
|
-
const content = await
|
|
52527
|
+
const content = await fs27.readFile(keybindingsFile, "utf8");
|
|
52802
52528
|
await backupFile(keybindingsFile);
|
|
52803
52529
|
try {
|
|
52804
52530
|
const cleanContent = stripJsonComments(content);
|
|
@@ -52896,7 +52622,7 @@ Please check and modify manually if needed: ${keybindingsFile}`
|
|
|
52896
52622
|
keybindings.unshift(target);
|
|
52897
52623
|
}
|
|
52898
52624
|
}
|
|
52899
|
-
await
|
|
52625
|
+
await fs27.writeFile(keybindingsFile, JSON.stringify(keybindings, null, 4));
|
|
52900
52626
|
return {
|
|
52901
52627
|
success: true,
|
|
52902
52628
|
message: `Added ${targetBindings.map((b2) => b2.key.charAt(0).toUpperCase() + b2.key.slice(1)).join(
|
|
@@ -52930,9 +52656,9 @@ async function shouldPromptForTerminalSetup() {
|
|
|
52930
52656
|
if (!configDir) {
|
|
52931
52657
|
return false;
|
|
52932
52658
|
}
|
|
52933
|
-
const keybindingsFile =
|
|
52659
|
+
const keybindingsFile = path19.join(configDir, "keybindings.json");
|
|
52934
52660
|
try {
|
|
52935
|
-
const content = await
|
|
52661
|
+
const content = await fs27.readFile(keybindingsFile, "utf8");
|
|
52936
52662
|
const cleanContent = stripJsonComments(content);
|
|
52937
52663
|
const parsedContent = JSON.parse(cleanContent);
|
|
52938
52664
|
if (!Array.isArray(parsedContent)) {
|
|
@@ -53024,17 +52750,6 @@ function startAutoMemoryIfEnabled(config) {
|
|
|
53024
52750
|
});
|
|
53025
52751
|
}
|
|
53026
52752
|
|
|
53027
|
-
// packages/cli/src/utils/processUtils.ts
|
|
53028
|
-
var RELAUNCH_EXIT_CODE = 199;
|
|
53029
|
-
var isRelaunching = false;
|
|
53030
|
-
async function relaunchApp() {
|
|
53031
|
-
if (isRelaunching) return;
|
|
53032
|
-
isRelaunching = true;
|
|
53033
|
-
await waitForUpdateCompletion();
|
|
53034
|
-
await runExitCleanup();
|
|
53035
|
-
process.exit(RELAUNCH_EXIT_CODE);
|
|
53036
|
-
}
|
|
53037
|
-
|
|
53038
52753
|
// packages/cli/src/commands/gemma/status.ts
|
|
53039
52754
|
var import_chalk6 = __toESM(require_source(), 1);
|
|
53040
52755
|
async function checkGemmaStatus(port) {
|
|
@@ -53499,6 +53214,549 @@ var formatResetTime = (resetTime, format = "full") => {
|
|
|
53499
53214
|
return `${duration} at ${timeStr}`;
|
|
53500
53215
|
};
|
|
53501
53216
|
|
|
53217
|
+
// packages/cli/src/services/FileCommandLoader.ts
|
|
53218
|
+
var import_toml = __toESM(require_toml(), 1);
|
|
53219
|
+
import { promises as fs28 } from "node:fs";
|
|
53220
|
+
import path20 from "node:path";
|
|
53221
|
+
|
|
53222
|
+
// packages/cli/src/services/prompt-processors/argumentProcessor.ts
|
|
53223
|
+
var DefaultArgumentProcessor = class {
|
|
53224
|
+
async process(prompt, context) {
|
|
53225
|
+
if (context.invocation?.args) {
|
|
53226
|
+
return appendToLastTextPart(prompt, context.invocation.raw);
|
|
53227
|
+
}
|
|
53228
|
+
return prompt;
|
|
53229
|
+
}
|
|
53230
|
+
};
|
|
53231
|
+
|
|
53232
|
+
// packages/cli/src/services/prompt-processors/types.ts
|
|
53233
|
+
var SHORTHAND_ARGS_PLACEHOLDER = "{{args}}";
|
|
53234
|
+
var SHELL_INJECTION_TRIGGER = "!{";
|
|
53235
|
+
var AT_FILE_INJECTION_TRIGGER = "@{";
|
|
53236
|
+
|
|
53237
|
+
// packages/cli/src/services/prompt-processors/injectionParser.ts
|
|
53238
|
+
function extractInjections(prompt, trigger, contextName) {
|
|
53239
|
+
const injections = [];
|
|
53240
|
+
let index = 0;
|
|
53241
|
+
while (index < prompt.length) {
|
|
53242
|
+
const startIndex = prompt.indexOf(trigger, index);
|
|
53243
|
+
if (startIndex === -1) {
|
|
53244
|
+
break;
|
|
53245
|
+
}
|
|
53246
|
+
let currentIndex = startIndex + trigger.length;
|
|
53247
|
+
let braceCount = 1;
|
|
53248
|
+
let foundEnd = false;
|
|
53249
|
+
while (currentIndex < prompt.length) {
|
|
53250
|
+
const char = prompt[currentIndex];
|
|
53251
|
+
if (char === "{") {
|
|
53252
|
+
braceCount++;
|
|
53253
|
+
} else if (char === "}") {
|
|
53254
|
+
braceCount--;
|
|
53255
|
+
if (braceCount === 0) {
|
|
53256
|
+
const injectionContent = prompt.substring(
|
|
53257
|
+
startIndex + trigger.length,
|
|
53258
|
+
currentIndex
|
|
53259
|
+
);
|
|
53260
|
+
const endIndex = currentIndex + 1;
|
|
53261
|
+
injections.push({
|
|
53262
|
+
content: injectionContent.trim(),
|
|
53263
|
+
startIndex,
|
|
53264
|
+
endIndex
|
|
53265
|
+
});
|
|
53266
|
+
index = endIndex;
|
|
53267
|
+
foundEnd = true;
|
|
53268
|
+
break;
|
|
53269
|
+
}
|
|
53270
|
+
}
|
|
53271
|
+
currentIndex++;
|
|
53272
|
+
}
|
|
53273
|
+
if (!foundEnd) {
|
|
53274
|
+
const contextInfo = contextName ? ` in command '${contextName}'` : "";
|
|
53275
|
+
throw new Error(
|
|
53276
|
+
`Invalid syntax${contextInfo}: Unclosed injection starting at index ${startIndex} ('${trigger}'). Ensure braces are balanced. Paths or commands with unbalanced braces are not supported directly.`
|
|
53277
|
+
);
|
|
53278
|
+
}
|
|
53279
|
+
}
|
|
53280
|
+
return injections;
|
|
53281
|
+
}
|
|
53282
|
+
|
|
53283
|
+
// packages/cli/src/services/prompt-processors/shellProcessor.ts
|
|
53284
|
+
var ConfirmationRequiredError = class extends Error {
|
|
53285
|
+
constructor(message, commandsToConfirm) {
|
|
53286
|
+
super(message);
|
|
53287
|
+
this.commandsToConfirm = commandsToConfirm;
|
|
53288
|
+
this.name = "ConfirmationRequiredError";
|
|
53289
|
+
}
|
|
53290
|
+
};
|
|
53291
|
+
var ShellProcessor = class {
|
|
53292
|
+
constructor(commandName) {
|
|
53293
|
+
this.commandName = commandName;
|
|
53294
|
+
}
|
|
53295
|
+
async process(prompt, context) {
|
|
53296
|
+
return flatMapTextParts(
|
|
53297
|
+
prompt,
|
|
53298
|
+
(text) => this.processString(text, context)
|
|
53299
|
+
);
|
|
53300
|
+
}
|
|
53301
|
+
async processString(prompt, context) {
|
|
53302
|
+
const userArgsRaw = context.invocation?.args || "";
|
|
53303
|
+
if (!prompt.includes(SHELL_INJECTION_TRIGGER)) {
|
|
53304
|
+
return [
|
|
53305
|
+
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
53306
|
+
];
|
|
53307
|
+
}
|
|
53308
|
+
const config = context.services.agentContext?.config;
|
|
53309
|
+
if (!config) {
|
|
53310
|
+
throw new Error(
|
|
53311
|
+
`Security configuration not loaded. Cannot verify shell command permissions for '${this.commandName}'. Aborting.`
|
|
53312
|
+
);
|
|
53313
|
+
}
|
|
53314
|
+
const injections = extractInjections(
|
|
53315
|
+
prompt,
|
|
53316
|
+
SHELL_INJECTION_TRIGGER,
|
|
53317
|
+
this.commandName
|
|
53318
|
+
);
|
|
53319
|
+
if (injections.length === 0) {
|
|
53320
|
+
return [
|
|
53321
|
+
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
53322
|
+
];
|
|
53323
|
+
}
|
|
53324
|
+
const { shell: shell2 } = getShellConfiguration();
|
|
53325
|
+
const userArgsEscaped = escapeShellArg(userArgsRaw, shell2);
|
|
53326
|
+
const resolvedInjections = injections.map(
|
|
53327
|
+
(injection) => {
|
|
53328
|
+
const command = injection.content;
|
|
53329
|
+
if (command === "") {
|
|
53330
|
+
return { ...injection, resolvedCommand: void 0 };
|
|
53331
|
+
}
|
|
53332
|
+
const resolvedCommand = command.replaceAll(
|
|
53333
|
+
SHORTHAND_ARGS_PLACEHOLDER,
|
|
53334
|
+
userArgsEscaped
|
|
53335
|
+
);
|
|
53336
|
+
return { ...injection, resolvedCommand };
|
|
53337
|
+
}
|
|
53338
|
+
);
|
|
53339
|
+
const commandsToConfirm = /* @__PURE__ */ new Set();
|
|
53340
|
+
for (const injection of resolvedInjections) {
|
|
53341
|
+
const command = injection.resolvedCommand;
|
|
53342
|
+
if (!command) continue;
|
|
53343
|
+
if (context.session.sessionShellAllowlist?.has(command)) {
|
|
53344
|
+
continue;
|
|
53345
|
+
}
|
|
53346
|
+
const { decision } = await config.getPolicyEngine().check(
|
|
53347
|
+
{
|
|
53348
|
+
name: "run_shell_command",
|
|
53349
|
+
args: { command }
|
|
53350
|
+
},
|
|
53351
|
+
void 0
|
|
53352
|
+
);
|
|
53353
|
+
if (decision === "deny" /* DENY */) {
|
|
53354
|
+
throw new Error(
|
|
53355
|
+
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
53356
|
+
);
|
|
53357
|
+
} else if (decision === "ask_user" /* ASK_USER */) {
|
|
53358
|
+
commandsToConfirm.add(command);
|
|
53359
|
+
}
|
|
53360
|
+
}
|
|
53361
|
+
if (commandsToConfirm.size > 0) {
|
|
53362
|
+
throw new ConfirmationRequiredError(
|
|
53363
|
+
"Shell command confirmation required",
|
|
53364
|
+
Array.from(commandsToConfirm)
|
|
53365
|
+
);
|
|
53366
|
+
}
|
|
53367
|
+
let processedPrompt = "";
|
|
53368
|
+
let lastIndex = 0;
|
|
53369
|
+
for (const injection of resolvedInjections) {
|
|
53370
|
+
const segment = prompt.substring(lastIndex, injection.startIndex);
|
|
53371
|
+
processedPrompt += segment.replaceAll(
|
|
53372
|
+
SHORTHAND_ARGS_PLACEHOLDER,
|
|
53373
|
+
userArgsRaw
|
|
53374
|
+
);
|
|
53375
|
+
if (injection.resolvedCommand) {
|
|
53376
|
+
const activeTheme = themeManager.getActiveTheme();
|
|
53377
|
+
const shellExecutionConfig = {
|
|
53378
|
+
...config.getShellExecutionConfig(),
|
|
53379
|
+
defaultFg: activeTheme.colors.Foreground,
|
|
53380
|
+
defaultBg: activeTheme.colors.Background
|
|
53381
|
+
};
|
|
53382
|
+
const { result } = await ShellExecutionService.execute(
|
|
53383
|
+
injection.resolvedCommand,
|
|
53384
|
+
config.getTargetDir(),
|
|
53385
|
+
() => {
|
|
53386
|
+
},
|
|
53387
|
+
new AbortController().signal,
|
|
53388
|
+
config.getEnableInteractiveShell(),
|
|
53389
|
+
shellExecutionConfig
|
|
53390
|
+
);
|
|
53391
|
+
const executionResult = await result;
|
|
53392
|
+
if (executionResult.error && !executionResult.aborted) {
|
|
53393
|
+
throw new Error(
|
|
53394
|
+
`Failed to start shell command in '${this.commandName}': ${executionResult.error.message}. Command: ${injection.resolvedCommand}`
|
|
53395
|
+
);
|
|
53396
|
+
}
|
|
53397
|
+
processedPrompt += executionResult.output;
|
|
53398
|
+
if (executionResult.aborted) {
|
|
53399
|
+
processedPrompt += `
|
|
53400
|
+
[Shell command '${injection.resolvedCommand}' aborted]`;
|
|
53401
|
+
} else if (executionResult.exitCode !== 0 && executionResult.exitCode !== null) {
|
|
53402
|
+
processedPrompt += `
|
|
53403
|
+
[Shell command '${injection.resolvedCommand}' exited with code ${executionResult.exitCode}]`;
|
|
53404
|
+
} else if (executionResult.signal !== null) {
|
|
53405
|
+
processedPrompt += `
|
|
53406
|
+
[Shell command '${injection.resolvedCommand}' terminated by signal ${executionResult.signal}]`;
|
|
53407
|
+
}
|
|
53408
|
+
}
|
|
53409
|
+
lastIndex = injection.endIndex;
|
|
53410
|
+
}
|
|
53411
|
+
const finalSegment = prompt.substring(lastIndex);
|
|
53412
|
+
processedPrompt += finalSegment.replaceAll(
|
|
53413
|
+
SHORTHAND_ARGS_PLACEHOLDER,
|
|
53414
|
+
userArgsRaw
|
|
53415
|
+
);
|
|
53416
|
+
return [{ text: processedPrompt }];
|
|
53417
|
+
}
|
|
53418
|
+
};
|
|
53419
|
+
|
|
53420
|
+
// packages/cli/src/services/prompt-processors/atFileProcessor.ts
|
|
53421
|
+
var AtFileProcessor = class {
|
|
53422
|
+
constructor(commandName) {
|
|
53423
|
+
this.commandName = commandName;
|
|
53424
|
+
}
|
|
53425
|
+
async process(input, context) {
|
|
53426
|
+
const config = context.services.agentContext?.config;
|
|
53427
|
+
if (!config) {
|
|
53428
|
+
return input;
|
|
53429
|
+
}
|
|
53430
|
+
return flatMapTextParts(input, async (text) => {
|
|
53431
|
+
if (!text.includes(AT_FILE_INJECTION_TRIGGER)) {
|
|
53432
|
+
return [{ text }];
|
|
53433
|
+
}
|
|
53434
|
+
const injections = extractInjections(
|
|
53435
|
+
text,
|
|
53436
|
+
AT_FILE_INJECTION_TRIGGER,
|
|
53437
|
+
this.commandName
|
|
53438
|
+
);
|
|
53439
|
+
if (injections.length === 0) {
|
|
53440
|
+
return [{ text }];
|
|
53441
|
+
}
|
|
53442
|
+
const output = [];
|
|
53443
|
+
let lastIndex = 0;
|
|
53444
|
+
for (const injection of injections) {
|
|
53445
|
+
const prefix = text.substring(lastIndex, injection.startIndex);
|
|
53446
|
+
if (prefix) {
|
|
53447
|
+
output.push({ text: prefix });
|
|
53448
|
+
}
|
|
53449
|
+
const pathStr = injection.content;
|
|
53450
|
+
try {
|
|
53451
|
+
const fileContentParts = await readPathFromWorkspace(pathStr, config);
|
|
53452
|
+
if (fileContentParts.length === 0) {
|
|
53453
|
+
const uiMessage = `File '@{${pathStr}}' was ignored by .gitignore or .geminiignore and was not included in the prompt.`;
|
|
53454
|
+
context.ui.addItem(
|
|
53455
|
+
{ type: "info" /* INFO */, text: uiMessage },
|
|
53456
|
+
Date.now()
|
|
53457
|
+
);
|
|
53458
|
+
}
|
|
53459
|
+
output.push(...fileContentParts);
|
|
53460
|
+
} catch (error) {
|
|
53461
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
53462
|
+
const uiMessage = `Failed to inject content for '@{${pathStr}}': ${message}`;
|
|
53463
|
+
debugLogger.error(
|
|
53464
|
+
`Error while loading custom command (${context.invocation.name}) ${uiMessage}. Leaving placeholder in prompt.`
|
|
53465
|
+
);
|
|
53466
|
+
context.ui.addItem(
|
|
53467
|
+
{ type: "error" /* ERROR */, text: uiMessage },
|
|
53468
|
+
Date.now()
|
|
53469
|
+
);
|
|
53470
|
+
const placeholder = text.substring(
|
|
53471
|
+
injection.startIndex,
|
|
53472
|
+
injection.endIndex
|
|
53473
|
+
);
|
|
53474
|
+
output.push({ text: placeholder });
|
|
53475
|
+
}
|
|
53476
|
+
lastIndex = injection.endIndex;
|
|
53477
|
+
}
|
|
53478
|
+
const suffix = text.substring(lastIndex);
|
|
53479
|
+
if (suffix) {
|
|
53480
|
+
output.push({ text: suffix });
|
|
53481
|
+
}
|
|
53482
|
+
return output;
|
|
53483
|
+
});
|
|
53484
|
+
}
|
|
53485
|
+
};
|
|
53486
|
+
|
|
53487
|
+
// packages/cli/src/services/FileCommandLoader.ts
|
|
53488
|
+
var TomlCommandDefSchema = external_exports.object({
|
|
53489
|
+
prompt: external_exports.string({
|
|
53490
|
+
required_error: "The 'prompt' field is required.",
|
|
53491
|
+
invalid_type_error: "The 'prompt' field must be a string."
|
|
53492
|
+
}),
|
|
53493
|
+
description: external_exports.string().optional()
|
|
53494
|
+
});
|
|
53495
|
+
var FileCommandLoader = class {
|
|
53496
|
+
constructor(config) {
|
|
53497
|
+
this.config = config;
|
|
53498
|
+
this.folderTrustEnabled = !!config?.getFolderTrust();
|
|
53499
|
+
this.isTrustedFolder = !!config?.isTrustedFolder();
|
|
53500
|
+
this.projectRoot = config?.getProjectRoot() || process.cwd();
|
|
53501
|
+
}
|
|
53502
|
+
projectRoot;
|
|
53503
|
+
folderTrustEnabled;
|
|
53504
|
+
isTrustedFolder;
|
|
53505
|
+
/**
|
|
53506
|
+
* Loads all commands from user, project, and extension directories.
|
|
53507
|
+
* Returns commands in order: user → project → extensions (alphabetically).
|
|
53508
|
+
*
|
|
53509
|
+
* Order is important for conflict resolution in CommandService:
|
|
53510
|
+
* - User/project commands (without extensionName) use "last wins" strategy
|
|
53511
|
+
* - Extension commands (with extensionName) get renamed if conflicts exist
|
|
53512
|
+
*
|
|
53513
|
+
* @param signal An AbortSignal to cancel the loading process.
|
|
53514
|
+
* @returns A promise that resolves to an array of all loaded SlashCommands.
|
|
53515
|
+
*/
|
|
53516
|
+
async loadCommands(signal) {
|
|
53517
|
+
if (this.folderTrustEnabled && !this.isTrustedFolder) {
|
|
53518
|
+
return [];
|
|
53519
|
+
}
|
|
53520
|
+
const allCommands = [];
|
|
53521
|
+
const globOptions = {
|
|
53522
|
+
nodir: true,
|
|
53523
|
+
dot: true,
|
|
53524
|
+
signal,
|
|
53525
|
+
follow: true
|
|
53526
|
+
};
|
|
53527
|
+
const commandDirs = this.getCommandDirectories();
|
|
53528
|
+
for (const dirInfo of commandDirs) {
|
|
53529
|
+
try {
|
|
53530
|
+
const files = await glob("**/*.toml", {
|
|
53531
|
+
...globOptions,
|
|
53532
|
+
cwd: dirInfo.path
|
|
53533
|
+
});
|
|
53534
|
+
const commandPromises = files.map(
|
|
53535
|
+
(file) => this.parseAndAdaptFile(
|
|
53536
|
+
path20.join(dirInfo.path, file),
|
|
53537
|
+
dirInfo.path,
|
|
53538
|
+
dirInfo.kind,
|
|
53539
|
+
dirInfo.extensionName,
|
|
53540
|
+
dirInfo.extensionId
|
|
53541
|
+
)
|
|
53542
|
+
);
|
|
53543
|
+
const commands = (await Promise.all(commandPromises)).filter(
|
|
53544
|
+
(cmd) => cmd !== null
|
|
53545
|
+
);
|
|
53546
|
+
allCommands.push(...commands);
|
|
53547
|
+
} catch (error) {
|
|
53548
|
+
if (!signal.aborted && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
53549
|
+
error?.code !== "ENOENT") {
|
|
53550
|
+
coreEvents.emitFeedback(
|
|
53551
|
+
"error",
|
|
53552
|
+
`[FileCommandLoader] Error loading commands from ${dirInfo.path}:`,
|
|
53553
|
+
error
|
|
53554
|
+
);
|
|
53555
|
+
}
|
|
53556
|
+
}
|
|
53557
|
+
}
|
|
53558
|
+
return allCommands;
|
|
53559
|
+
}
|
|
53560
|
+
/**
|
|
53561
|
+
* Lists available .toml command files from user, project, and extension directories.
|
|
53562
|
+
*/
|
|
53563
|
+
async listAvailableFiles() {
|
|
53564
|
+
const directories = this.getCommandDirectories();
|
|
53565
|
+
const groups = [];
|
|
53566
|
+
for (const dir of directories) {
|
|
53567
|
+
const displayName = this.getDisplayName(dir);
|
|
53568
|
+
try {
|
|
53569
|
+
const files = await glob("**/*.toml", { cwd: dir.path });
|
|
53570
|
+
if (files.length > 0) {
|
|
53571
|
+
groups.push({
|
|
53572
|
+
displayName,
|
|
53573
|
+
path: dir.path,
|
|
53574
|
+
files: [...files].sort()
|
|
53575
|
+
});
|
|
53576
|
+
}
|
|
53577
|
+
} catch (e) {
|
|
53578
|
+
if (e.code === "ENOENT") {
|
|
53579
|
+
continue;
|
|
53580
|
+
}
|
|
53581
|
+
groups.push({
|
|
53582
|
+
displayName,
|
|
53583
|
+
path: dir.path,
|
|
53584
|
+
files: [],
|
|
53585
|
+
error: e instanceof Error ? e.message : String(e)
|
|
53586
|
+
});
|
|
53587
|
+
}
|
|
53588
|
+
}
|
|
53589
|
+
return groups;
|
|
53590
|
+
}
|
|
53591
|
+
/**
|
|
53592
|
+
* Returns a human-readable display name for the command directory source.
|
|
53593
|
+
*/
|
|
53594
|
+
getDisplayName(dir) {
|
|
53595
|
+
switch (dir.kind) {
|
|
53596
|
+
case "user-file" /* USER_FILE */:
|
|
53597
|
+
return "User";
|
|
53598
|
+
case "workspace-file" /* WORKSPACE_FILE */:
|
|
53599
|
+
return "Project";
|
|
53600
|
+
case "extension-file" /* EXTENSION_FILE */:
|
|
53601
|
+
return `Extension: ${dir.extensionName || "Unknown"}`;
|
|
53602
|
+
default:
|
|
53603
|
+
return "Custom";
|
|
53604
|
+
}
|
|
53605
|
+
}
|
|
53606
|
+
/**
|
|
53607
|
+
* Get all command directories in order for loading.
|
|
53608
|
+
* User commands → Project commands → Extension commands
|
|
53609
|
+
* This order ensures extension commands can detect all conflicts.
|
|
53610
|
+
*/
|
|
53611
|
+
getCommandDirectories() {
|
|
53612
|
+
const dirs = [];
|
|
53613
|
+
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
53614
|
+
dirs.push({
|
|
53615
|
+
path: Storage.getUserCommandsDir(),
|
|
53616
|
+
kind: "user-file" /* USER_FILE */
|
|
53617
|
+
});
|
|
53618
|
+
dirs.push({
|
|
53619
|
+
path: storage.getProjectCommandsDir(),
|
|
53620
|
+
kind: "workspace-file" /* WORKSPACE_FILE */
|
|
53621
|
+
});
|
|
53622
|
+
if (this.config) {
|
|
53623
|
+
const activeExtensions = this.config.getExtensions().filter((ext) => ext.isActive).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
53624
|
+
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
53625
|
+
path: path20.join(ext.path, "commands"),
|
|
53626
|
+
kind: "extension-file" /* EXTENSION_FILE */,
|
|
53627
|
+
extensionName: ext.name,
|
|
53628
|
+
extensionId: ext.id
|
|
53629
|
+
}));
|
|
53630
|
+
dirs.push(...extensionCommandDirs);
|
|
53631
|
+
}
|
|
53632
|
+
return dirs;
|
|
53633
|
+
}
|
|
53634
|
+
/**
|
|
53635
|
+
* Parses a single .toml file and transforms it into a SlashCommand object.
|
|
53636
|
+
* @param filePath The absolute path to the .toml file.
|
|
53637
|
+
* @param baseDir The root command directory for name calculation.
|
|
53638
|
+
* @param kind The CommandKind.
|
|
53639
|
+
* @param extensionName Optional extension name to prefix commands with.
|
|
53640
|
+
* @returns A promise resolving to a SlashCommand, or null if the file is invalid.
|
|
53641
|
+
*/
|
|
53642
|
+
async parseAndAdaptFile(filePath, baseDir, kind, extensionName, extensionId) {
|
|
53643
|
+
let fileContent;
|
|
53644
|
+
try {
|
|
53645
|
+
fileContent = await fs28.readFile(filePath, "utf-8");
|
|
53646
|
+
} catch (error) {
|
|
53647
|
+
coreEvents.emitFeedback(
|
|
53648
|
+
"error",
|
|
53649
|
+
`[FileCommandLoader] Failed to read file ${filePath}:`,
|
|
53650
|
+
error instanceof Error ? error.message : String(error)
|
|
53651
|
+
);
|
|
53652
|
+
return null;
|
|
53653
|
+
}
|
|
53654
|
+
let parsed;
|
|
53655
|
+
try {
|
|
53656
|
+
parsed = import_toml.default.parse(fileContent);
|
|
53657
|
+
} catch (error) {
|
|
53658
|
+
coreEvents.emitFeedback(
|
|
53659
|
+
"error",
|
|
53660
|
+
`[FileCommandLoader] Failed to parse TOML file ${filePath}:`,
|
|
53661
|
+
error instanceof Error ? error.message : String(error)
|
|
53662
|
+
);
|
|
53663
|
+
return null;
|
|
53664
|
+
}
|
|
53665
|
+
const validationResult = TomlCommandDefSchema.safeParse(parsed);
|
|
53666
|
+
if (!validationResult.success) {
|
|
53667
|
+
coreEvents.emitFeedback(
|
|
53668
|
+
"error",
|
|
53669
|
+
`[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`,
|
|
53670
|
+
validationResult.error.flatten()
|
|
53671
|
+
);
|
|
53672
|
+
return null;
|
|
53673
|
+
}
|
|
53674
|
+
const validDef = validationResult.data;
|
|
53675
|
+
const relativePathWithExt = path20.relative(baseDir, filePath);
|
|
53676
|
+
const relativePath = relativePathWithExt.substring(
|
|
53677
|
+
0,
|
|
53678
|
+
relativePathWithExt.length - 5
|
|
53679
|
+
// length of '.toml'
|
|
53680
|
+
);
|
|
53681
|
+
const baseCommandName = relativePath.split(path20.sep).map((segment) => {
|
|
53682
|
+
let sanitized = segment.replace(/[^a-zA-Z0-9_\-.]/g, "_");
|
|
53683
|
+
if (sanitized.length > 50) {
|
|
53684
|
+
sanitized = sanitized.substring(0, 47) + "...";
|
|
53685
|
+
}
|
|
53686
|
+
return sanitized;
|
|
53687
|
+
}).join(":");
|
|
53688
|
+
const defaultDescription = `Custom command from ${path20.basename(filePath)}`;
|
|
53689
|
+
let description = validDef.description || defaultDescription;
|
|
53690
|
+
description = sanitizeForDisplay(description, 100);
|
|
53691
|
+
if (extensionName) {
|
|
53692
|
+
description = `[${extensionName}] ${description}`;
|
|
53693
|
+
}
|
|
53694
|
+
const processors = [];
|
|
53695
|
+
const usesArgs = validDef.prompt.includes(SHORTHAND_ARGS_PLACEHOLDER);
|
|
53696
|
+
const usesShellInjection = validDef.prompt.includes(
|
|
53697
|
+
SHELL_INJECTION_TRIGGER
|
|
53698
|
+
);
|
|
53699
|
+
const usesAtFileInjection = validDef.prompt.includes(
|
|
53700
|
+
AT_FILE_INJECTION_TRIGGER
|
|
53701
|
+
);
|
|
53702
|
+
if (usesAtFileInjection) {
|
|
53703
|
+
processors.push(new AtFileProcessor(baseCommandName));
|
|
53704
|
+
}
|
|
53705
|
+
if (usesShellInjection || usesArgs) {
|
|
53706
|
+
processors.push(new ShellProcessor(baseCommandName));
|
|
53707
|
+
}
|
|
53708
|
+
if (!usesArgs) {
|
|
53709
|
+
processors.push(new DefaultArgumentProcessor());
|
|
53710
|
+
}
|
|
53711
|
+
return {
|
|
53712
|
+
name: baseCommandName,
|
|
53713
|
+
description,
|
|
53714
|
+
kind,
|
|
53715
|
+
extensionName,
|
|
53716
|
+
extensionId,
|
|
53717
|
+
action: async (context, _args) => {
|
|
53718
|
+
if (!context.invocation) {
|
|
53719
|
+
coreEvents.emitFeedback(
|
|
53720
|
+
"error",
|
|
53721
|
+
`[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`
|
|
53722
|
+
);
|
|
53723
|
+
return {
|
|
53724
|
+
type: "submit_prompt",
|
|
53725
|
+
content: [{ text: validDef.prompt }]
|
|
53726
|
+
// Fallback to unprocessed prompt
|
|
53727
|
+
};
|
|
53728
|
+
}
|
|
53729
|
+
try {
|
|
53730
|
+
let processedContent = [
|
|
53731
|
+
{ text: validDef.prompt }
|
|
53732
|
+
];
|
|
53733
|
+
for (const processor of processors) {
|
|
53734
|
+
processedContent = await processor.process(
|
|
53735
|
+
processedContent,
|
|
53736
|
+
context
|
|
53737
|
+
);
|
|
53738
|
+
}
|
|
53739
|
+
return {
|
|
53740
|
+
type: "submit_prompt",
|
|
53741
|
+
content: processedContent
|
|
53742
|
+
};
|
|
53743
|
+
} catch (e) {
|
|
53744
|
+
if (e instanceof ConfirmationRequiredError) {
|
|
53745
|
+
return {
|
|
53746
|
+
type: "confirm_shell_commands",
|
|
53747
|
+
commandsToConfirm: e.commandsToConfirm,
|
|
53748
|
+
originalInvocation: {
|
|
53749
|
+
raw: context.invocation.raw
|
|
53750
|
+
}
|
|
53751
|
+
};
|
|
53752
|
+
}
|
|
53753
|
+
throw e;
|
|
53754
|
+
}
|
|
53755
|
+
}
|
|
53756
|
+
};
|
|
53757
|
+
}
|
|
53758
|
+
};
|
|
53759
|
+
|
|
53502
53760
|
// packages/cli/src/ui/hooks/useMouseClick.ts
|
|
53503
53761
|
var import_react46 = __toESM(require_react(), 1);
|
|
53504
53762
|
var useMouseClick = (containerRef, handler2, options = {}) => {
|
|
@@ -54377,7 +54635,7 @@ var _ExpandableText = ({
|
|
|
54377
54635
|
var ExpandableText = import_react52.default.memo(_ExpandableText);
|
|
54378
54636
|
|
|
54379
54637
|
// packages/cli/src/ui/key/keybindingUtils.ts
|
|
54380
|
-
import
|
|
54638
|
+
import process26 from "node:process";
|
|
54381
54639
|
var KEY_NAME_MAP = {
|
|
54382
54640
|
enter: "Enter",
|
|
54383
54641
|
escape: "Esc",
|
|
@@ -54421,7 +54679,7 @@ var MODIFIER_MAPS = {
|
|
|
54421
54679
|
}
|
|
54422
54680
|
};
|
|
54423
54681
|
function formatKeyBinding(binding, platform5) {
|
|
54424
|
-
const activePlatform = platform5 ?? (
|
|
54682
|
+
const activePlatform = platform5 ?? (process26.env["FORCE_GENERIC_KEYBINDING_HINTS"] ? "default" : process26.platform);
|
|
54425
54683
|
const modMap = MODIFIER_MAPS[activePlatform] || MODIFIER_MAPS["default"];
|
|
54426
54684
|
const parts = [];
|
|
54427
54685
|
if (binding.ctrl) parts.push(modMap.ctrl);
|
|
@@ -54441,7 +54699,7 @@ function formatCommand(command, config = defaultKeyBindingConfig, platform5) {
|
|
|
54441
54699
|
}
|
|
54442
54700
|
|
|
54443
54701
|
// packages/cli/src/ui/commands/aboutCommand.ts
|
|
54444
|
-
import
|
|
54702
|
+
import process27 from "node:process";
|
|
54445
54703
|
var aboutCommand = {
|
|
54446
54704
|
name: "about",
|
|
54447
54705
|
description: "Show version info",
|
|
@@ -54449,17 +54707,17 @@ var aboutCommand = {
|
|
|
54449
54707
|
autoExecute: true,
|
|
54450
54708
|
isSafeConcurrent: true,
|
|
54451
54709
|
action: async (context) => {
|
|
54452
|
-
const osVersion =
|
|
54710
|
+
const osVersion = process27.platform;
|
|
54453
54711
|
let sandboxEnv = "no sandbox";
|
|
54454
|
-
if (
|
|
54455
|
-
sandboxEnv =
|
|
54456
|
-
} else if (
|
|
54457
|
-
sandboxEnv = `sandbox-exec (${
|
|
54712
|
+
if (process27.env["SANDBOX"] && process27.env["SANDBOX"] !== "sandbox-exec") {
|
|
54713
|
+
sandboxEnv = process27.env["SANDBOX"];
|
|
54714
|
+
} else if (process27.env["SANDBOX"] === "sandbox-exec") {
|
|
54715
|
+
sandboxEnv = `sandbox-exec (${process27.env["SEATBELT_PROFILE"] || "unknown"})`;
|
|
54458
54716
|
}
|
|
54459
54717
|
const modelVersion = context.services.agentContext?.config.getModel() || "Unknown";
|
|
54460
54718
|
const cliVersion = await getVersion();
|
|
54461
54719
|
const selectedAuthType = context.services.settings.merged.security.auth.selectedType || "";
|
|
54462
|
-
const gcpProject =
|
|
54720
|
+
const gcpProject = process27.env["GOOGLE_CLOUD_PROJECT"] || "";
|
|
54463
54721
|
const ideClient = await getIdeClientName(context);
|
|
54464
54722
|
const userAccountManager = new UserAccountManager();
|
|
54465
54723
|
const cachedAccount = userAccountManager.getCachedGoogleAccount();
|
|
@@ -54516,10 +54774,10 @@ function enableFeature(settings, featureName, strategy) {
|
|
|
54516
54774
|
};
|
|
54517
54775
|
}
|
|
54518
54776
|
const modifiedScopes = [];
|
|
54519
|
-
for (const { scope, path:
|
|
54777
|
+
for (const { scope, path: path36 } of foundInDisabledScopes) {
|
|
54520
54778
|
if (isLoadableSettingScope(scope)) {
|
|
54521
54779
|
strategy.enable(settings, scope, featureName);
|
|
54522
|
-
modifiedScopes.push({ scope, path:
|
|
54780
|
+
modifiedScopes.push({ scope, path: path36 });
|
|
54523
54781
|
}
|
|
54524
54782
|
}
|
|
54525
54783
|
return {
|
|
@@ -54987,10 +55245,10 @@ var authCommand = {
|
|
|
54987
55245
|
};
|
|
54988
55246
|
|
|
54989
55247
|
// packages/cli/src/ui/commands/bugCommand.ts
|
|
54990
|
-
import
|
|
55248
|
+
import process28 from "node:process";
|
|
54991
55249
|
|
|
54992
55250
|
// packages/cli/src/generated/git-commit.ts
|
|
54993
|
-
var GIT_COMMIT_INFO = "
|
|
55251
|
+
var GIT_COMMIT_INFO = "caa046641";
|
|
54994
55252
|
|
|
54995
55253
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
54996
55254
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -55048,16 +55306,16 @@ var bugCommand = {
|
|
|
55048
55306
|
const bugDescription = (args || "").trim();
|
|
55049
55307
|
const agentContext = context.services.agentContext;
|
|
55050
55308
|
const config = agentContext?.config;
|
|
55051
|
-
const osVersion = `${
|
|
55309
|
+
const osVersion = `${process28.platform} ${process28.version}`;
|
|
55052
55310
|
let sandboxEnv = "no sandbox";
|
|
55053
|
-
if (
|
|
55054
|
-
sandboxEnv =
|
|
55055
|
-
} else if (
|
|
55056
|
-
sandboxEnv = `sandbox-exec (${
|
|
55311
|
+
if (process28.env["SANDBOX"] && process28.env["SANDBOX"] !== "sandbox-exec") {
|
|
55312
|
+
sandboxEnv = process28.env["SANDBOX"].replace(/^gemini-(?:code-)?/, "");
|
|
55313
|
+
} else if (process28.env["SANDBOX"] === "sandbox-exec") {
|
|
55314
|
+
sandboxEnv = `sandbox-exec (${process28.env["SEATBELT_PROFILE"] || "unknown"})`;
|
|
55057
55315
|
}
|
|
55058
55316
|
const modelVersion = config?.getModel() || "Unknown";
|
|
55059
55317
|
const cliVersion = await getVersion();
|
|
55060
|
-
const memoryUsage = formatBytes(
|
|
55318
|
+
const memoryUsage = formatBytes(process28.memoryUsage().rss);
|
|
55061
55319
|
const ideClient = await getIdeClientName2(context);
|
|
55062
55320
|
const terminalName = terminalCapabilityManager.getTerminalName() || "Unknown";
|
|
55063
55321
|
const terminalBgColor = terminalCapabilityManager.getTerminalBackgroundColor() || "Unknown";
|
|
@@ -55542,13 +55800,54 @@ var clearCommand = {
|
|
|
55542
55800
|
};
|
|
55543
55801
|
|
|
55544
55802
|
// packages/cli/src/ui/commands/commandsCommand.ts
|
|
55545
|
-
async function
|
|
55803
|
+
async function defaultAction(_context, _args) {
|
|
55546
55804
|
return {
|
|
55547
55805
|
type: "message",
|
|
55548
55806
|
messageType: "info",
|
|
55549
|
-
content: 'Use "/commands reload" to reload custom command definitions
|
|
55807
|
+
content: 'Use "/commands list" to view available .toml files, or "/commands reload" to reload custom command definitions.'
|
|
55550
55808
|
};
|
|
55551
55809
|
}
|
|
55810
|
+
async function listSubcommandAction(context) {
|
|
55811
|
+
try {
|
|
55812
|
+
const config = context.services.agentContext?.config ?? null;
|
|
55813
|
+
const loader = new FileCommandLoader(config);
|
|
55814
|
+
const groups = await loader.listAvailableFiles();
|
|
55815
|
+
const results = [];
|
|
55816
|
+
for (const group of groups) {
|
|
55817
|
+
results.push(`### ${group.displayName} Commands (${group.path})`);
|
|
55818
|
+
if (group.error) {
|
|
55819
|
+
results.push(`- (Error reading directory: ${group.error})`);
|
|
55820
|
+
} else {
|
|
55821
|
+
group.files.forEach((file) => results.push(`- ${file}`));
|
|
55822
|
+
}
|
|
55823
|
+
}
|
|
55824
|
+
results.push(
|
|
55825
|
+
"\n_Note: MCP prompts are dynamically loaded from configured MCP servers._"
|
|
55826
|
+
);
|
|
55827
|
+
if (results.length === 1) {
|
|
55828
|
+
return {
|
|
55829
|
+
type: "message",
|
|
55830
|
+
messageType: "info",
|
|
55831
|
+
content: "No custom command files (.toml) found.\n\n_Note: MCP prompts are dynamically loaded from configured MCP servers._"
|
|
55832
|
+
};
|
|
55833
|
+
}
|
|
55834
|
+
context.ui.addItem(
|
|
55835
|
+
{
|
|
55836
|
+
type: "info" /* INFO */,
|
|
55837
|
+
text: results.join("\n")
|
|
55838
|
+
},
|
|
55839
|
+
Date.now()
|
|
55840
|
+
);
|
|
55841
|
+
} catch (error) {
|
|
55842
|
+
context.ui.addItem(
|
|
55843
|
+
{
|
|
55844
|
+
type: "error" /* ERROR */,
|
|
55845
|
+
text: `Failed to list commands: ${error instanceof Error ? error.message : String(error)}`
|
|
55846
|
+
},
|
|
55847
|
+
Date.now()
|
|
55848
|
+
);
|
|
55849
|
+
}
|
|
55850
|
+
}
|
|
55552
55851
|
async function reloadAction(context) {
|
|
55553
55852
|
try {
|
|
55554
55853
|
context.ui.reloadCommands();
|
|
@@ -55571,10 +55870,17 @@ async function reloadAction(context) {
|
|
|
55571
55870
|
}
|
|
55572
55871
|
var commandsCommand = {
|
|
55573
55872
|
name: "commands",
|
|
55574
|
-
description: "Manage custom slash commands. Usage: /commands [reload]",
|
|
55873
|
+
description: "Manage custom slash commands. Usage: /commands [list|reload]",
|
|
55575
55874
|
kind: "built-in" /* BUILT_IN */,
|
|
55576
55875
|
autoExecute: false,
|
|
55577
55876
|
subCommands: [
|
|
55877
|
+
{
|
|
55878
|
+
name: "list",
|
|
55879
|
+
description: "List available custom command .toml files. Usage: /commands list",
|
|
55880
|
+
kind: "built-in" /* BUILT_IN */,
|
|
55881
|
+
autoExecute: true,
|
|
55882
|
+
action: listSubcommandAction
|
|
55883
|
+
},
|
|
55578
55884
|
{
|
|
55579
55885
|
name: "reload",
|
|
55580
55886
|
altNames: ["refresh"],
|
|
@@ -55584,7 +55890,7 @@ var commandsCommand = {
|
|
|
55584
55890
|
action: reloadAction
|
|
55585
55891
|
}
|
|
55586
55892
|
],
|
|
55587
|
-
action:
|
|
55893
|
+
action: defaultAction
|
|
55588
55894
|
};
|
|
55589
55895
|
|
|
55590
55896
|
// packages/cli/src/ui/commands/compressCommand.ts
|
|
@@ -55717,7 +56023,7 @@ var corgiCommand = {
|
|
|
55717
56023
|
};
|
|
55718
56024
|
|
|
55719
56025
|
// packages/cli/src/ui/commands/docsCommand.ts
|
|
55720
|
-
import
|
|
56026
|
+
import process29 from "node:process";
|
|
55721
56027
|
var docsCommand = {
|
|
55722
56028
|
name: "docs",
|
|
55723
56029
|
description: "Open full Gemini CLI documentation in your browser",
|
|
@@ -55725,7 +56031,7 @@ var docsCommand = {
|
|
|
55725
56031
|
autoExecute: true,
|
|
55726
56032
|
action: async (context) => {
|
|
55727
56033
|
const docsUrl = "https://goo.gle/gemini-cli-docs";
|
|
55728
|
-
if (
|
|
56034
|
+
if (process29.env["SANDBOX"] && process29.env["SANDBOX"] !== "sandbox-exec") {
|
|
55729
56035
|
context.ui.addItem(
|
|
55730
56036
|
{
|
|
55731
56037
|
type: "info" /* INFO */,
|
|
@@ -55992,7 +56298,7 @@ var editorCommand = {
|
|
|
55992
56298
|
};
|
|
55993
56299
|
|
|
55994
56300
|
// packages/cli/src/ui/commands/extensionsCommand.ts
|
|
55995
|
-
import
|
|
56301
|
+
import process30 from "node:process";
|
|
55996
56302
|
import { stat as stat5 } from "node:fs/promises";
|
|
55997
56303
|
|
|
55998
56304
|
// packages/cli/src/ui/components/ConfigExtensionDialog.tsx
|
|
@@ -57124,7 +57430,7 @@ function showMessageIfNoExtensions(context, extensions) {
|
|
|
57124
57430
|
}
|
|
57125
57431
|
return false;
|
|
57126
57432
|
}
|
|
57127
|
-
async function
|
|
57433
|
+
async function listAction(context) {
|
|
57128
57434
|
const extensions = context.services.agentContext?.config ? listExtensions(context.services.agentContext.config) : [];
|
|
57129
57435
|
if (showMessageIfNoExtensions(context, extensions)) {
|
|
57130
57436
|
return;
|
|
@@ -57328,12 +57634,12 @@ async function exploreAction(context) {
|
|
|
57328
57634
|
}
|
|
57329
57635
|
}
|
|
57330
57636
|
const extensionsUrl = "https://geminicli.com/extensions/";
|
|
57331
|
-
if (
|
|
57637
|
+
if (process30.env["NODE_ENV"] === "test") {
|
|
57332
57638
|
context.ui.addItem({
|
|
57333
57639
|
type: "info" /* INFO */,
|
|
57334
57640
|
text: `Would open extensions page in your browser: ${extensionsUrl} (skipped in test environment)`
|
|
57335
57641
|
});
|
|
57336
|
-
} else if (
|
|
57642
|
+
} else if (process30.env["SANDBOX"] && process30.env["SANDBOX"] !== "sandbox-exec") {
|
|
57337
57643
|
context.ui.addItem({
|
|
57338
57644
|
type: "info" /* INFO */,
|
|
57339
57645
|
text: `View available extensions at ${extensionsUrl}`
|
|
@@ -57722,7 +58028,7 @@ var listExtensionsCommand = {
|
|
|
57722
58028
|
kind: "built-in" /* BUILT_IN */,
|
|
57723
58029
|
autoExecute: true,
|
|
57724
58030
|
takesArgs: false,
|
|
57725
|
-
action:
|
|
58031
|
+
action: listAction
|
|
57726
58032
|
};
|
|
57727
58033
|
var updateExtensionsCommand = {
|
|
57728
58034
|
name: "update",
|
|
@@ -57764,6 +58070,7 @@ var linkCommand = {
|
|
|
57764
58070
|
};
|
|
57765
58071
|
var uninstallCommand = {
|
|
57766
58072
|
name: "uninstall",
|
|
58073
|
+
altNames: ["delete"],
|
|
57767
58074
|
description: "Uninstall an extension",
|
|
57768
58075
|
kind: "built-in" /* BUILT_IN */,
|
|
57769
58076
|
autoExecute: false,
|
|
@@ -57855,11 +58162,11 @@ var ConsoleSummaryDisplay = ({
|
|
|
57855
58162
|
};
|
|
57856
58163
|
|
|
57857
58164
|
// packages/cli/src/ui/components/Footer.tsx
|
|
57858
|
-
import
|
|
58165
|
+
import process32 from "node:process";
|
|
57859
58166
|
|
|
57860
58167
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
57861
58168
|
var import_react62 = __toESM(require_react(), 1);
|
|
57862
|
-
import
|
|
58169
|
+
import process31 from "node:process";
|
|
57863
58170
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
57864
58171
|
var MemoryUsageDisplay = ({ color = theme.text.primary, isActive = true }) => {
|
|
57865
58172
|
const [memoryUsage, setMemoryUsage] = (0, import_react62.useState)("");
|
|
@@ -57869,7 +58176,7 @@ var MemoryUsageDisplay = ({ color = theme.text.primary, isActive = true }) => {
|
|
|
57869
58176
|
return;
|
|
57870
58177
|
}
|
|
57871
58178
|
const updateMemory = () => {
|
|
57872
|
-
const usage =
|
|
58179
|
+
const usage = process31.memoryUsage().rss;
|
|
57873
58180
|
setMemoryUsage(formatBytes(usage));
|
|
57874
58181
|
setMemoryUsageColor(
|
|
57875
58182
|
usage >= 2 * 1024 * 1024 * 1024 ? theme.status.error : color
|
|
@@ -58122,7 +58429,7 @@ var SandboxIndicator = ({
|
|
|
58122
58429
|
if (isTrustedFolder === false) {
|
|
58123
58430
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: theme.status.warning, children: "untrusted" });
|
|
58124
58431
|
}
|
|
58125
|
-
const sandbox =
|
|
58432
|
+
const sandbox = process32.env["SANDBOX"];
|
|
58126
58433
|
if (sandbox) {
|
|
58127
58434
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { color: theme.status.warning, children: "current process" });
|
|
58128
58435
|
}
|
|
@@ -58297,7 +58604,7 @@ var Footer = () => {
|
|
|
58297
58604
|
}
|
|
58298
58605
|
case "sandbox": {
|
|
58299
58606
|
let str = "no sandbox";
|
|
58300
|
-
const sandbox =
|
|
58607
|
+
const sandbox = process32.env["SANDBOX"];
|
|
58301
58608
|
if (isTrustedFolder === false) str = "untrusted";
|
|
58302
58609
|
else if (sandbox) str = "current process";
|
|
58303
58610
|
else if (config.getSandboxEnabled()) str = "all tools";
|
|
@@ -59577,14 +59884,14 @@ function enableHook(settings, hookName) {
|
|
|
59577
59884
|
}
|
|
59578
59885
|
const modifiedScopes = [];
|
|
59579
59886
|
try {
|
|
59580
|
-
for (const { scope, path:
|
|
59887
|
+
for (const { scope, path: path36 } of foundInDisabledScopes) {
|
|
59581
59888
|
if (isLoadableSettingScope(scope)) {
|
|
59582
59889
|
const currentScopeDisabled = settings.forScope(scope).settings.hooksConfig?.disabled ?? [];
|
|
59583
59890
|
const newDisabled = currentScopeDisabled.filter(
|
|
59584
59891
|
(name) => name !== hookName
|
|
59585
59892
|
);
|
|
59586
59893
|
settings.setValue(scope, "hooksConfig.disabled", newDisabled);
|
|
59587
|
-
modifiedScopes.push({ scope, path:
|
|
59894
|
+
modifiedScopes.push({ scope, path: path36 });
|
|
59588
59895
|
}
|
|
59589
59896
|
}
|
|
59590
59897
|
} catch (error) {
|
|
@@ -59879,7 +60186,7 @@ async function enableAction3(context, args) {
|
|
|
59879
60186
|
}
|
|
59880
60187
|
const feedback = renderHookActionFeedback(
|
|
59881
60188
|
result,
|
|
59882
|
-
(label,
|
|
60189
|
+
(label, path36) => `${label} (${path36})`
|
|
59883
60190
|
);
|
|
59884
60191
|
return {
|
|
59885
60192
|
type: "message",
|
|
@@ -59921,7 +60228,7 @@ async function disableAction3(context, args) {
|
|
|
59921
60228
|
}
|
|
59922
60229
|
const feedback = renderHookActionFeedback(
|
|
59923
60230
|
result,
|
|
59924
|
-
(label,
|
|
60231
|
+
(label, path36) => `${label} (${path36})`
|
|
59925
60232
|
);
|
|
59926
60233
|
return {
|
|
59927
60234
|
type: "message",
|
|
@@ -60475,7 +60782,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
60475
60782
|
type: "info",
|
|
60476
60783
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
60477
60784
|
});
|
|
60478
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
60785
|
+
const { MCPOAuthProvider } = await import("./core-JH4LXS4F.js");
|
|
60479
60786
|
let oauthConfig = server.oauth;
|
|
60480
60787
|
if (!oauthConfig) {
|
|
60481
60788
|
oauthConfig = { enabled: false };
|
|
@@ -60525,7 +60832,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
60525
60832
|
);
|
|
60526
60833
|
}
|
|
60527
60834
|
};
|
|
60528
|
-
var
|
|
60835
|
+
var listAction2 = async (context, showDescriptions = false, showSchema = false, serverNameFilter) => {
|
|
60529
60836
|
const agentContext = context.services.agentContext;
|
|
60530
60837
|
const config = agentContext?.config;
|
|
60531
60838
|
if (!config) {
|
|
@@ -60642,7 +60949,7 @@ var listCommand2 = {
|
|
|
60642
60949
|
description: "List configured MCP servers and tools",
|
|
60643
60950
|
kind: "built-in" /* BUILT_IN */,
|
|
60644
60951
|
autoExecute: true,
|
|
60645
|
-
action: (context, args) =>
|
|
60952
|
+
action: (context, args) => listAction2(context, false, false, args)
|
|
60646
60953
|
};
|
|
60647
60954
|
var descCommand = {
|
|
60648
60955
|
name: "desc",
|
|
@@ -60650,14 +60957,14 @@ var descCommand = {
|
|
|
60650
60957
|
description: "List configured MCP servers and tools with descriptions",
|
|
60651
60958
|
kind: "built-in" /* BUILT_IN */,
|
|
60652
60959
|
autoExecute: true,
|
|
60653
|
-
action: (context, args) =>
|
|
60960
|
+
action: (context, args) => listAction2(context, true, false, args)
|
|
60654
60961
|
};
|
|
60655
60962
|
var schemaCommand = {
|
|
60656
60963
|
name: "schema",
|
|
60657
60964
|
description: "List configured MCP servers and tools with descriptions and schemas",
|
|
60658
60965
|
kind: "built-in" /* BUILT_IN */,
|
|
60659
60966
|
autoExecute: true,
|
|
60660
|
-
action: (context, args) =>
|
|
60967
|
+
action: (context, args) => listAction2(context, true, true, args)
|
|
60661
60968
|
};
|
|
60662
60969
|
var reloadCommand2 = {
|
|
60663
60970
|
name: "reload",
|
|
@@ -60832,9 +61139,9 @@ var mcpCommand = {
|
|
|
60832
61139
|
if (parsed.commandToExecute?.action) {
|
|
60833
61140
|
return parsed.commandToExecute.action(context, parsed.args);
|
|
60834
61141
|
}
|
|
60835
|
-
return
|
|
61142
|
+
return listAction2(context, false, false, args);
|
|
60836
61143
|
}
|
|
60837
|
-
return
|
|
61144
|
+
return listAction2(context);
|
|
60838
61145
|
}
|
|
60839
61146
|
};
|
|
60840
61147
|
|
|
@@ -77271,7 +77578,7 @@ var oncallCommand = {
|
|
|
77271
77578
|
};
|
|
77272
77579
|
|
|
77273
77580
|
// packages/cli/src/ui/commands/permissionsCommand.ts
|
|
77274
|
-
import * as
|
|
77581
|
+
import * as process33 from "node:process";
|
|
77275
77582
|
import * as path31 from "node:path";
|
|
77276
77583
|
import * as fs34 from "node:fs";
|
|
77277
77584
|
var permissionsCommand = {
|
|
@@ -77289,7 +77596,7 @@ var permissionsCommand = {
|
|
|
77289
77596
|
const dirPath = input.trim();
|
|
77290
77597
|
let targetDirectory;
|
|
77291
77598
|
if (!dirPath) {
|
|
77292
|
-
targetDirectory =
|
|
77599
|
+
targetDirectory = process33.cwd();
|
|
77293
77600
|
} else {
|
|
77294
77601
|
targetDirectory = path31.resolve(expandHomeDir(dirPath));
|
|
77295
77602
|
}
|
|
@@ -77552,12 +77859,14 @@ var quitCommand = {
|
|
|
77552
77859
|
description: "Exit the cli",
|
|
77553
77860
|
kind: "built-in" /* BUILT_IN */,
|
|
77554
77861
|
autoExecute: true,
|
|
77555
|
-
action: (context) => {
|
|
77862
|
+
action: (context, args) => {
|
|
77556
77863
|
const now = Date.now();
|
|
77557
77864
|
const { sessionStartTime } = context.session.stats;
|
|
77558
77865
|
const wallDuration = now - sessionStartTime.getTime();
|
|
77866
|
+
const deleteSession = args.trim() === "--delete";
|
|
77559
77867
|
return {
|
|
77560
77868
|
type: "quit",
|
|
77869
|
+
deleteSession,
|
|
77561
77870
|
messages: [
|
|
77562
77871
|
{
|
|
77563
77872
|
type: "user",
|
|
@@ -78100,7 +78409,7 @@ async function uninstallSkill(name, scope) {
|
|
|
78100
78409
|
}
|
|
78101
78410
|
|
|
78102
78411
|
// packages/cli/src/ui/commands/skillsCommand.ts
|
|
78103
|
-
async function
|
|
78412
|
+
async function listAction3(context, args) {
|
|
78104
78413
|
const subArgs = args.trim().split(/\s+/);
|
|
78105
78414
|
let useShowDescriptions = true;
|
|
78106
78415
|
let showAll = false;
|
|
@@ -78224,7 +78533,7 @@ async function disableAction4(context, args) {
|
|
|
78224
78533
|
const result = disableSkill(context.services.settings, skillName, scope);
|
|
78225
78534
|
let feedback = renderSkillActionFeedback(
|
|
78226
78535
|
result,
|
|
78227
|
-
(label,
|
|
78536
|
+
(label, path36) => `${label} (${path36})`
|
|
78228
78537
|
);
|
|
78229
78538
|
if (result.status === "success" || result.status === "no-op") {
|
|
78230
78539
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -78260,7 +78569,7 @@ async function enableAction4(context, args) {
|
|
|
78260
78569
|
const result = enableSkill(context.services.settings, skillName);
|
|
78261
78570
|
let feedback = renderSkillActionFeedback(
|
|
78262
78571
|
result,
|
|
78263
|
-
(label,
|
|
78572
|
+
(label, path36) => `${label} (${path36})`
|
|
78264
78573
|
);
|
|
78265
78574
|
if (result.status === "success" || result.status === "no-op") {
|
|
78266
78575
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -78366,7 +78675,7 @@ var skillsCommand = {
|
|
|
78366
78675
|
name: "list",
|
|
78367
78676
|
description: "List available agent skills. Usage: /skills list [nodesc] [all]",
|
|
78368
78677
|
kind: "built-in" /* BUILT_IN */,
|
|
78369
|
-
action:
|
|
78678
|
+
action: listAction3
|
|
78370
78679
|
},
|
|
78371
78680
|
{
|
|
78372
78681
|
name: "link",
|
|
@@ -78403,7 +78712,7 @@ var skillsCommand = {
|
|
|
78403
78712
|
return parsed.commandToExecute.action(context, parsed.args);
|
|
78404
78713
|
}
|
|
78405
78714
|
}
|
|
78406
|
-
return
|
|
78715
|
+
return listAction3(context, args);
|
|
78407
78716
|
}
|
|
78408
78717
|
};
|
|
78409
78718
|
|
|
@@ -78457,10 +78766,10 @@ import { Writable } from "node:stream";
|
|
|
78457
78766
|
|
|
78458
78767
|
// packages/cli/src/utils/gitUtils.ts
|
|
78459
78768
|
var import_undici = __toESM(require_undici(), 1);
|
|
78460
|
-
import { execSync as
|
|
78769
|
+
import { execSync as execSync2 } from "node:child_process";
|
|
78461
78770
|
var isGitHubRepository = () => {
|
|
78462
78771
|
try {
|
|
78463
|
-
const remotes = (
|
|
78772
|
+
const remotes = (execSync2("git remote -v", {
|
|
78464
78773
|
encoding: "utf-8"
|
|
78465
78774
|
}) || "").trim();
|
|
78466
78775
|
const pattern = /github\.com/;
|
|
@@ -78471,7 +78780,7 @@ var isGitHubRepository = () => {
|
|
|
78471
78780
|
}
|
|
78472
78781
|
};
|
|
78473
78782
|
var getGitRepoRoot = () => {
|
|
78474
|
-
const gitRepoRoot = (
|
|
78783
|
+
const gitRepoRoot = (execSync2("git rev-parse --show-toplevel", {
|
|
78475
78784
|
encoding: "utf-8"
|
|
78476
78785
|
}) || "").trim();
|
|
78477
78786
|
if (!gitRepoRoot) {
|
|
@@ -78514,7 +78823,7 @@ var getLatestGitHubRelease = async (proxy) => {
|
|
|
78514
78823
|
}
|
|
78515
78824
|
};
|
|
78516
78825
|
function getGitHubRepoInfo() {
|
|
78517
|
-
const remoteUrl =
|
|
78826
|
+
const remoteUrl = execSync2("git remote get-url origin", {
|
|
78518
78827
|
encoding: "utf-8"
|
|
78519
78828
|
}).trim();
|
|
78520
78829
|
let urlToParse = remoteUrl;
|
|
@@ -79019,503 +79328,6 @@ var BuiltinCommandLoader = class {
|
|
|
79019
79328
|
}
|
|
79020
79329
|
};
|
|
79021
79330
|
|
|
79022
|
-
// packages/cli/src/services/FileCommandLoader.ts
|
|
79023
|
-
var import_toml = __toESM(require_toml(), 1);
|
|
79024
|
-
import { promises as fs38 } from "node:fs";
|
|
79025
|
-
import path36 from "node:path";
|
|
79026
|
-
|
|
79027
|
-
// packages/cli/src/services/prompt-processors/argumentProcessor.ts
|
|
79028
|
-
var DefaultArgumentProcessor = class {
|
|
79029
|
-
async process(prompt, context) {
|
|
79030
|
-
if (context.invocation?.args) {
|
|
79031
|
-
return appendToLastTextPart(prompt, context.invocation.raw);
|
|
79032
|
-
}
|
|
79033
|
-
return prompt;
|
|
79034
|
-
}
|
|
79035
|
-
};
|
|
79036
|
-
|
|
79037
|
-
// packages/cli/src/services/prompt-processors/types.ts
|
|
79038
|
-
var SHORTHAND_ARGS_PLACEHOLDER = "{{args}}";
|
|
79039
|
-
var SHELL_INJECTION_TRIGGER = "!{";
|
|
79040
|
-
var AT_FILE_INJECTION_TRIGGER = "@{";
|
|
79041
|
-
|
|
79042
|
-
// packages/cli/src/services/prompt-processors/injectionParser.ts
|
|
79043
|
-
function extractInjections(prompt, trigger, contextName) {
|
|
79044
|
-
const injections = [];
|
|
79045
|
-
let index = 0;
|
|
79046
|
-
while (index < prompt.length) {
|
|
79047
|
-
const startIndex = prompt.indexOf(trigger, index);
|
|
79048
|
-
if (startIndex === -1) {
|
|
79049
|
-
break;
|
|
79050
|
-
}
|
|
79051
|
-
let currentIndex = startIndex + trigger.length;
|
|
79052
|
-
let braceCount = 1;
|
|
79053
|
-
let foundEnd = false;
|
|
79054
|
-
while (currentIndex < prompt.length) {
|
|
79055
|
-
const char = prompt[currentIndex];
|
|
79056
|
-
if (char === "{") {
|
|
79057
|
-
braceCount++;
|
|
79058
|
-
} else if (char === "}") {
|
|
79059
|
-
braceCount--;
|
|
79060
|
-
if (braceCount === 0) {
|
|
79061
|
-
const injectionContent = prompt.substring(
|
|
79062
|
-
startIndex + trigger.length,
|
|
79063
|
-
currentIndex
|
|
79064
|
-
);
|
|
79065
|
-
const endIndex = currentIndex + 1;
|
|
79066
|
-
injections.push({
|
|
79067
|
-
content: injectionContent.trim(),
|
|
79068
|
-
startIndex,
|
|
79069
|
-
endIndex
|
|
79070
|
-
});
|
|
79071
|
-
index = endIndex;
|
|
79072
|
-
foundEnd = true;
|
|
79073
|
-
break;
|
|
79074
|
-
}
|
|
79075
|
-
}
|
|
79076
|
-
currentIndex++;
|
|
79077
|
-
}
|
|
79078
|
-
if (!foundEnd) {
|
|
79079
|
-
const contextInfo = contextName ? ` in command '${contextName}'` : "";
|
|
79080
|
-
throw new Error(
|
|
79081
|
-
`Invalid syntax${contextInfo}: Unclosed injection starting at index ${startIndex} ('${trigger}'). Ensure braces are balanced. Paths or commands with unbalanced braces are not supported directly.`
|
|
79082
|
-
);
|
|
79083
|
-
}
|
|
79084
|
-
}
|
|
79085
|
-
return injections;
|
|
79086
|
-
}
|
|
79087
|
-
|
|
79088
|
-
// packages/cli/src/services/prompt-processors/shellProcessor.ts
|
|
79089
|
-
var ConfirmationRequiredError = class extends Error {
|
|
79090
|
-
constructor(message, commandsToConfirm) {
|
|
79091
|
-
super(message);
|
|
79092
|
-
this.commandsToConfirm = commandsToConfirm;
|
|
79093
|
-
this.name = "ConfirmationRequiredError";
|
|
79094
|
-
}
|
|
79095
|
-
};
|
|
79096
|
-
var ShellProcessor = class {
|
|
79097
|
-
constructor(commandName) {
|
|
79098
|
-
this.commandName = commandName;
|
|
79099
|
-
}
|
|
79100
|
-
async process(prompt, context) {
|
|
79101
|
-
return flatMapTextParts(
|
|
79102
|
-
prompt,
|
|
79103
|
-
(text) => this.processString(text, context)
|
|
79104
|
-
);
|
|
79105
|
-
}
|
|
79106
|
-
async processString(prompt, context) {
|
|
79107
|
-
const userArgsRaw = context.invocation?.args || "";
|
|
79108
|
-
if (!prompt.includes(SHELL_INJECTION_TRIGGER)) {
|
|
79109
|
-
return [
|
|
79110
|
-
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
79111
|
-
];
|
|
79112
|
-
}
|
|
79113
|
-
const config = context.services.agentContext?.config;
|
|
79114
|
-
if (!config) {
|
|
79115
|
-
throw new Error(
|
|
79116
|
-
`Security configuration not loaded. Cannot verify shell command permissions for '${this.commandName}'. Aborting.`
|
|
79117
|
-
);
|
|
79118
|
-
}
|
|
79119
|
-
const injections = extractInjections(
|
|
79120
|
-
prompt,
|
|
79121
|
-
SHELL_INJECTION_TRIGGER,
|
|
79122
|
-
this.commandName
|
|
79123
|
-
);
|
|
79124
|
-
if (injections.length === 0) {
|
|
79125
|
-
return [
|
|
79126
|
-
{ text: prompt.replaceAll(SHORTHAND_ARGS_PLACEHOLDER, userArgsRaw) }
|
|
79127
|
-
];
|
|
79128
|
-
}
|
|
79129
|
-
const { shell: shell2 } = getShellConfiguration();
|
|
79130
|
-
const userArgsEscaped = escapeShellArg(userArgsRaw, shell2);
|
|
79131
|
-
const resolvedInjections = injections.map(
|
|
79132
|
-
(injection) => {
|
|
79133
|
-
const command = injection.content;
|
|
79134
|
-
if (command === "") {
|
|
79135
|
-
return { ...injection, resolvedCommand: void 0 };
|
|
79136
|
-
}
|
|
79137
|
-
const resolvedCommand = command.replaceAll(
|
|
79138
|
-
SHORTHAND_ARGS_PLACEHOLDER,
|
|
79139
|
-
userArgsEscaped
|
|
79140
|
-
);
|
|
79141
|
-
return { ...injection, resolvedCommand };
|
|
79142
|
-
}
|
|
79143
|
-
);
|
|
79144
|
-
const commandsToConfirm = /* @__PURE__ */ new Set();
|
|
79145
|
-
for (const injection of resolvedInjections) {
|
|
79146
|
-
const command = injection.resolvedCommand;
|
|
79147
|
-
if (!command) continue;
|
|
79148
|
-
if (context.session.sessionShellAllowlist?.has(command)) {
|
|
79149
|
-
continue;
|
|
79150
|
-
}
|
|
79151
|
-
const { decision } = await config.getPolicyEngine().check(
|
|
79152
|
-
{
|
|
79153
|
-
name: "run_shell_command",
|
|
79154
|
-
args: { command }
|
|
79155
|
-
},
|
|
79156
|
-
void 0
|
|
79157
|
-
);
|
|
79158
|
-
if (decision === "deny" /* DENY */) {
|
|
79159
|
-
throw new Error(
|
|
79160
|
-
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
79161
|
-
);
|
|
79162
|
-
} else if (decision === "ask_user" /* ASK_USER */) {
|
|
79163
|
-
commandsToConfirm.add(command);
|
|
79164
|
-
}
|
|
79165
|
-
}
|
|
79166
|
-
if (commandsToConfirm.size > 0) {
|
|
79167
|
-
throw new ConfirmationRequiredError(
|
|
79168
|
-
"Shell command confirmation required",
|
|
79169
|
-
Array.from(commandsToConfirm)
|
|
79170
|
-
);
|
|
79171
|
-
}
|
|
79172
|
-
let processedPrompt = "";
|
|
79173
|
-
let lastIndex = 0;
|
|
79174
|
-
for (const injection of resolvedInjections) {
|
|
79175
|
-
const segment = prompt.substring(lastIndex, injection.startIndex);
|
|
79176
|
-
processedPrompt += segment.replaceAll(
|
|
79177
|
-
SHORTHAND_ARGS_PLACEHOLDER,
|
|
79178
|
-
userArgsRaw
|
|
79179
|
-
);
|
|
79180
|
-
if (injection.resolvedCommand) {
|
|
79181
|
-
const activeTheme = themeManager.getActiveTheme();
|
|
79182
|
-
const shellExecutionConfig = {
|
|
79183
|
-
...config.getShellExecutionConfig(),
|
|
79184
|
-
defaultFg: activeTheme.colors.Foreground,
|
|
79185
|
-
defaultBg: activeTheme.colors.Background
|
|
79186
|
-
};
|
|
79187
|
-
const { result } = await ShellExecutionService.execute(
|
|
79188
|
-
injection.resolvedCommand,
|
|
79189
|
-
config.getTargetDir(),
|
|
79190
|
-
() => {
|
|
79191
|
-
},
|
|
79192
|
-
new AbortController().signal,
|
|
79193
|
-
config.getEnableInteractiveShell(),
|
|
79194
|
-
shellExecutionConfig
|
|
79195
|
-
);
|
|
79196
|
-
const executionResult = await result;
|
|
79197
|
-
if (executionResult.error && !executionResult.aborted) {
|
|
79198
|
-
throw new Error(
|
|
79199
|
-
`Failed to start shell command in '${this.commandName}': ${executionResult.error.message}. Command: ${injection.resolvedCommand}`
|
|
79200
|
-
);
|
|
79201
|
-
}
|
|
79202
|
-
processedPrompt += executionResult.output;
|
|
79203
|
-
if (executionResult.aborted) {
|
|
79204
|
-
processedPrompt += `
|
|
79205
|
-
[Shell command '${injection.resolvedCommand}' aborted]`;
|
|
79206
|
-
} else if (executionResult.exitCode !== 0 && executionResult.exitCode !== null) {
|
|
79207
|
-
processedPrompt += `
|
|
79208
|
-
[Shell command '${injection.resolvedCommand}' exited with code ${executionResult.exitCode}]`;
|
|
79209
|
-
} else if (executionResult.signal !== null) {
|
|
79210
|
-
processedPrompt += `
|
|
79211
|
-
[Shell command '${injection.resolvedCommand}' terminated by signal ${executionResult.signal}]`;
|
|
79212
|
-
}
|
|
79213
|
-
}
|
|
79214
|
-
lastIndex = injection.endIndex;
|
|
79215
|
-
}
|
|
79216
|
-
const finalSegment = prompt.substring(lastIndex);
|
|
79217
|
-
processedPrompt += finalSegment.replaceAll(
|
|
79218
|
-
SHORTHAND_ARGS_PLACEHOLDER,
|
|
79219
|
-
userArgsRaw
|
|
79220
|
-
);
|
|
79221
|
-
return [{ text: processedPrompt }];
|
|
79222
|
-
}
|
|
79223
|
-
};
|
|
79224
|
-
|
|
79225
|
-
// packages/cli/src/services/prompt-processors/atFileProcessor.ts
|
|
79226
|
-
var AtFileProcessor = class {
|
|
79227
|
-
constructor(commandName) {
|
|
79228
|
-
this.commandName = commandName;
|
|
79229
|
-
}
|
|
79230
|
-
async process(input, context) {
|
|
79231
|
-
const config = context.services.agentContext?.config;
|
|
79232
|
-
if (!config) {
|
|
79233
|
-
return input;
|
|
79234
|
-
}
|
|
79235
|
-
return flatMapTextParts(input, async (text) => {
|
|
79236
|
-
if (!text.includes(AT_FILE_INJECTION_TRIGGER)) {
|
|
79237
|
-
return [{ text }];
|
|
79238
|
-
}
|
|
79239
|
-
const injections = extractInjections(
|
|
79240
|
-
text,
|
|
79241
|
-
AT_FILE_INJECTION_TRIGGER,
|
|
79242
|
-
this.commandName
|
|
79243
|
-
);
|
|
79244
|
-
if (injections.length === 0) {
|
|
79245
|
-
return [{ text }];
|
|
79246
|
-
}
|
|
79247
|
-
const output = [];
|
|
79248
|
-
let lastIndex = 0;
|
|
79249
|
-
for (const injection of injections) {
|
|
79250
|
-
const prefix = text.substring(lastIndex, injection.startIndex);
|
|
79251
|
-
if (prefix) {
|
|
79252
|
-
output.push({ text: prefix });
|
|
79253
|
-
}
|
|
79254
|
-
const pathStr = injection.content;
|
|
79255
|
-
try {
|
|
79256
|
-
const fileContentParts = await readPathFromWorkspace(pathStr, config);
|
|
79257
|
-
if (fileContentParts.length === 0) {
|
|
79258
|
-
const uiMessage = `File '@{${pathStr}}' was ignored by .gitignore or .geminiignore and was not included in the prompt.`;
|
|
79259
|
-
context.ui.addItem(
|
|
79260
|
-
{ type: "info" /* INFO */, text: uiMessage },
|
|
79261
|
-
Date.now()
|
|
79262
|
-
);
|
|
79263
|
-
}
|
|
79264
|
-
output.push(...fileContentParts);
|
|
79265
|
-
} catch (error) {
|
|
79266
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
79267
|
-
const uiMessage = `Failed to inject content for '@{${pathStr}}': ${message}`;
|
|
79268
|
-
debugLogger.error(
|
|
79269
|
-
`Error while loading custom command (${context.invocation.name}) ${uiMessage}. Leaving placeholder in prompt.`
|
|
79270
|
-
);
|
|
79271
|
-
context.ui.addItem(
|
|
79272
|
-
{ type: "error" /* ERROR */, text: uiMessage },
|
|
79273
|
-
Date.now()
|
|
79274
|
-
);
|
|
79275
|
-
const placeholder = text.substring(
|
|
79276
|
-
injection.startIndex,
|
|
79277
|
-
injection.endIndex
|
|
79278
|
-
);
|
|
79279
|
-
output.push({ text: placeholder });
|
|
79280
|
-
}
|
|
79281
|
-
lastIndex = injection.endIndex;
|
|
79282
|
-
}
|
|
79283
|
-
const suffix = text.substring(lastIndex);
|
|
79284
|
-
if (suffix) {
|
|
79285
|
-
output.push({ text: suffix });
|
|
79286
|
-
}
|
|
79287
|
-
return output;
|
|
79288
|
-
});
|
|
79289
|
-
}
|
|
79290
|
-
};
|
|
79291
|
-
|
|
79292
|
-
// packages/cli/src/services/FileCommandLoader.ts
|
|
79293
|
-
var TomlCommandDefSchema = external_exports.object({
|
|
79294
|
-
prompt: external_exports.string({
|
|
79295
|
-
required_error: "The 'prompt' field is required.",
|
|
79296
|
-
invalid_type_error: "The 'prompt' field must be a string."
|
|
79297
|
-
}),
|
|
79298
|
-
description: external_exports.string().optional()
|
|
79299
|
-
});
|
|
79300
|
-
var FileCommandLoader = class {
|
|
79301
|
-
constructor(config) {
|
|
79302
|
-
this.config = config;
|
|
79303
|
-
this.folderTrustEnabled = !!config?.getFolderTrust();
|
|
79304
|
-
this.isTrustedFolder = !!config?.isTrustedFolder();
|
|
79305
|
-
this.projectRoot = config?.getProjectRoot() || process.cwd();
|
|
79306
|
-
}
|
|
79307
|
-
projectRoot;
|
|
79308
|
-
folderTrustEnabled;
|
|
79309
|
-
isTrustedFolder;
|
|
79310
|
-
/**
|
|
79311
|
-
* Loads all commands from user, project, and extension directories.
|
|
79312
|
-
* Returns commands in order: user → project → extensions (alphabetically).
|
|
79313
|
-
*
|
|
79314
|
-
* Order is important for conflict resolution in CommandService:
|
|
79315
|
-
* - User/project commands (without extensionName) use "last wins" strategy
|
|
79316
|
-
* - Extension commands (with extensionName) get renamed if conflicts exist
|
|
79317
|
-
*
|
|
79318
|
-
* @param signal An AbortSignal to cancel the loading process.
|
|
79319
|
-
* @returns A promise that resolves to an array of all loaded SlashCommands.
|
|
79320
|
-
*/
|
|
79321
|
-
async loadCommands(signal) {
|
|
79322
|
-
if (this.folderTrustEnabled && !this.isTrustedFolder) {
|
|
79323
|
-
return [];
|
|
79324
|
-
}
|
|
79325
|
-
const allCommands = [];
|
|
79326
|
-
const globOptions = {
|
|
79327
|
-
nodir: true,
|
|
79328
|
-
dot: true,
|
|
79329
|
-
signal,
|
|
79330
|
-
follow: true
|
|
79331
|
-
};
|
|
79332
|
-
const commandDirs = this.getCommandDirectories();
|
|
79333
|
-
for (const dirInfo of commandDirs) {
|
|
79334
|
-
try {
|
|
79335
|
-
const files = await glob("**/*.toml", {
|
|
79336
|
-
...globOptions,
|
|
79337
|
-
cwd: dirInfo.path
|
|
79338
|
-
});
|
|
79339
|
-
const commandPromises = files.map(
|
|
79340
|
-
(file) => this.parseAndAdaptFile(
|
|
79341
|
-
path36.join(dirInfo.path, file),
|
|
79342
|
-
dirInfo.path,
|
|
79343
|
-
dirInfo.kind,
|
|
79344
|
-
dirInfo.extensionName,
|
|
79345
|
-
dirInfo.extensionId
|
|
79346
|
-
)
|
|
79347
|
-
);
|
|
79348
|
-
const commands = (await Promise.all(commandPromises)).filter(
|
|
79349
|
-
(cmd) => cmd !== null
|
|
79350
|
-
);
|
|
79351
|
-
allCommands.push(...commands);
|
|
79352
|
-
} catch (error) {
|
|
79353
|
-
if (!signal.aborted && // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
79354
|
-
error?.code !== "ENOENT") {
|
|
79355
|
-
coreEvents.emitFeedback(
|
|
79356
|
-
"error",
|
|
79357
|
-
`[FileCommandLoader] Error loading commands from ${dirInfo.path}:`,
|
|
79358
|
-
error
|
|
79359
|
-
);
|
|
79360
|
-
}
|
|
79361
|
-
}
|
|
79362
|
-
}
|
|
79363
|
-
return allCommands;
|
|
79364
|
-
}
|
|
79365
|
-
/**
|
|
79366
|
-
* Get all command directories in order for loading.
|
|
79367
|
-
* User commands → Project commands → Extension commands
|
|
79368
|
-
* This order ensures extension commands can detect all conflicts.
|
|
79369
|
-
*/
|
|
79370
|
-
getCommandDirectories() {
|
|
79371
|
-
const dirs = [];
|
|
79372
|
-
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
79373
|
-
dirs.push({
|
|
79374
|
-
path: Storage.getUserCommandsDir(),
|
|
79375
|
-
kind: "user-file" /* USER_FILE */
|
|
79376
|
-
});
|
|
79377
|
-
dirs.push({
|
|
79378
|
-
path: storage.getProjectCommandsDir(),
|
|
79379
|
-
kind: "workspace-file" /* WORKSPACE_FILE */
|
|
79380
|
-
});
|
|
79381
|
-
if (this.config) {
|
|
79382
|
-
const activeExtensions = this.config.getExtensions().filter((ext) => ext.isActive).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
79383
|
-
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
79384
|
-
path: path36.join(ext.path, "commands"),
|
|
79385
|
-
kind: "extension-file" /* EXTENSION_FILE */,
|
|
79386
|
-
extensionName: ext.name,
|
|
79387
|
-
extensionId: ext.id
|
|
79388
|
-
}));
|
|
79389
|
-
dirs.push(...extensionCommandDirs);
|
|
79390
|
-
}
|
|
79391
|
-
return dirs;
|
|
79392
|
-
}
|
|
79393
|
-
/**
|
|
79394
|
-
* Parses a single .toml file and transforms it into a SlashCommand object.
|
|
79395
|
-
* @param filePath The absolute path to the .toml file.
|
|
79396
|
-
* @param baseDir The root command directory for name calculation.
|
|
79397
|
-
* @param kind The CommandKind.
|
|
79398
|
-
* @param extensionName Optional extension name to prefix commands with.
|
|
79399
|
-
* @returns A promise resolving to a SlashCommand, or null if the file is invalid.
|
|
79400
|
-
*/
|
|
79401
|
-
async parseAndAdaptFile(filePath, baseDir, kind, extensionName, extensionId) {
|
|
79402
|
-
let fileContent;
|
|
79403
|
-
try {
|
|
79404
|
-
fileContent = await fs38.readFile(filePath, "utf-8");
|
|
79405
|
-
} catch (error) {
|
|
79406
|
-
coreEvents.emitFeedback(
|
|
79407
|
-
"error",
|
|
79408
|
-
`[FileCommandLoader] Failed to read file ${filePath}:`,
|
|
79409
|
-
error instanceof Error ? error.message : String(error)
|
|
79410
|
-
);
|
|
79411
|
-
return null;
|
|
79412
|
-
}
|
|
79413
|
-
let parsed;
|
|
79414
|
-
try {
|
|
79415
|
-
parsed = import_toml.default.parse(fileContent);
|
|
79416
|
-
} catch (error) {
|
|
79417
|
-
coreEvents.emitFeedback(
|
|
79418
|
-
"error",
|
|
79419
|
-
`[FileCommandLoader] Failed to parse TOML file ${filePath}:`,
|
|
79420
|
-
error instanceof Error ? error.message : String(error)
|
|
79421
|
-
);
|
|
79422
|
-
return null;
|
|
79423
|
-
}
|
|
79424
|
-
const validationResult = TomlCommandDefSchema.safeParse(parsed);
|
|
79425
|
-
if (!validationResult.success) {
|
|
79426
|
-
coreEvents.emitFeedback(
|
|
79427
|
-
"error",
|
|
79428
|
-
`[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`,
|
|
79429
|
-
validationResult.error.flatten()
|
|
79430
|
-
);
|
|
79431
|
-
return null;
|
|
79432
|
-
}
|
|
79433
|
-
const validDef = validationResult.data;
|
|
79434
|
-
const relativePathWithExt = path36.relative(baseDir, filePath);
|
|
79435
|
-
const relativePath = relativePathWithExt.substring(
|
|
79436
|
-
0,
|
|
79437
|
-
relativePathWithExt.length - 5
|
|
79438
|
-
// length of '.toml'
|
|
79439
|
-
);
|
|
79440
|
-
const baseCommandName = relativePath.split(path36.sep).map((segment) => {
|
|
79441
|
-
let sanitized = segment.replace(/[^a-zA-Z0-9_\-.]/g, "_");
|
|
79442
|
-
if (sanitized.length > 50) {
|
|
79443
|
-
sanitized = sanitized.substring(0, 47) + "...";
|
|
79444
|
-
}
|
|
79445
|
-
return sanitized;
|
|
79446
|
-
}).join(":");
|
|
79447
|
-
const defaultDescription = `Custom command from ${path36.basename(filePath)}`;
|
|
79448
|
-
let description = validDef.description || defaultDescription;
|
|
79449
|
-
description = sanitizeForDisplay(description, 100);
|
|
79450
|
-
if (extensionName) {
|
|
79451
|
-
description = `[${extensionName}] ${description}`;
|
|
79452
|
-
}
|
|
79453
|
-
const processors = [];
|
|
79454
|
-
const usesArgs = validDef.prompt.includes(SHORTHAND_ARGS_PLACEHOLDER);
|
|
79455
|
-
const usesShellInjection = validDef.prompt.includes(
|
|
79456
|
-
SHELL_INJECTION_TRIGGER
|
|
79457
|
-
);
|
|
79458
|
-
const usesAtFileInjection = validDef.prompt.includes(
|
|
79459
|
-
AT_FILE_INJECTION_TRIGGER
|
|
79460
|
-
);
|
|
79461
|
-
if (usesAtFileInjection) {
|
|
79462
|
-
processors.push(new AtFileProcessor(baseCommandName));
|
|
79463
|
-
}
|
|
79464
|
-
if (usesShellInjection || usesArgs) {
|
|
79465
|
-
processors.push(new ShellProcessor(baseCommandName));
|
|
79466
|
-
}
|
|
79467
|
-
if (!usesArgs) {
|
|
79468
|
-
processors.push(new DefaultArgumentProcessor());
|
|
79469
|
-
}
|
|
79470
|
-
return {
|
|
79471
|
-
name: baseCommandName,
|
|
79472
|
-
description,
|
|
79473
|
-
kind,
|
|
79474
|
-
extensionName,
|
|
79475
|
-
extensionId,
|
|
79476
|
-
action: async (context, _args) => {
|
|
79477
|
-
if (!context.invocation) {
|
|
79478
|
-
coreEvents.emitFeedback(
|
|
79479
|
-
"error",
|
|
79480
|
-
`[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`
|
|
79481
|
-
);
|
|
79482
|
-
return {
|
|
79483
|
-
type: "submit_prompt",
|
|
79484
|
-
content: [{ text: validDef.prompt }]
|
|
79485
|
-
// Fallback to unprocessed prompt
|
|
79486
|
-
};
|
|
79487
|
-
}
|
|
79488
|
-
try {
|
|
79489
|
-
let processedContent = [
|
|
79490
|
-
{ text: validDef.prompt }
|
|
79491
|
-
];
|
|
79492
|
-
for (const processor of processors) {
|
|
79493
|
-
processedContent = await processor.process(
|
|
79494
|
-
processedContent,
|
|
79495
|
-
context
|
|
79496
|
-
);
|
|
79497
|
-
}
|
|
79498
|
-
return {
|
|
79499
|
-
type: "submit_prompt",
|
|
79500
|
-
content: processedContent
|
|
79501
|
-
};
|
|
79502
|
-
} catch (e) {
|
|
79503
|
-
if (e instanceof ConfirmationRequiredError) {
|
|
79504
|
-
return {
|
|
79505
|
-
type: "confirm_shell_commands",
|
|
79506
|
-
commandsToConfirm: e.commandsToConfirm,
|
|
79507
|
-
originalInvocation: {
|
|
79508
|
-
raw: context.invocation.raw
|
|
79509
|
-
}
|
|
79510
|
-
};
|
|
79511
|
-
}
|
|
79512
|
-
throw e;
|
|
79513
|
-
}
|
|
79514
|
-
}
|
|
79515
|
-
};
|
|
79516
|
-
}
|
|
79517
|
-
};
|
|
79518
|
-
|
|
79519
79331
|
// packages/cli/src/services/McpPromptLoader.ts
|
|
79520
79332
|
var McpPromptLoader = class {
|
|
79521
79333
|
constructor(config) {
|
|
@@ -79805,7 +79617,6 @@ export {
|
|
|
79805
79617
|
isAutoExecutableCommand,
|
|
79806
79618
|
parseSlashCommand,
|
|
79807
79619
|
CommandService,
|
|
79808
|
-
isDevelopment,
|
|
79809
79620
|
GIT_COMMIT_INFO,
|
|
79810
79621
|
formatBytes,
|
|
79811
79622
|
formatDuration,
|
|
@@ -79837,6 +79648,7 @@ export {
|
|
|
79837
79648
|
use_stdout_default,
|
|
79838
79649
|
use_is_screen_reader_enabled_default,
|
|
79839
79650
|
theme,
|
|
79651
|
+
FileCommandLoader,
|
|
79840
79652
|
useFocus,
|
|
79841
79653
|
SettingsContext,
|
|
79842
79654
|
useSettings,
|
|
@@ -79922,15 +79734,10 @@ export {
|
|
|
79922
79734
|
useTerminalSetupPrompt,
|
|
79923
79735
|
isUltraTier,
|
|
79924
79736
|
BuiltinCommandLoader,
|
|
79925
|
-
FileCommandLoader,
|
|
79926
79737
|
McpPromptLoader,
|
|
79927
79738
|
initializeApp,
|
|
79928
79739
|
validateAuthMethod,
|
|
79929
|
-
startAutoMemoryIfEnabled
|
|
79930
|
-
handleAutoUpdate,
|
|
79931
|
-
setUpdateHandler,
|
|
79932
|
-
RELAUNCH_EXIT_CODE,
|
|
79933
|
-
relaunchApp
|
|
79740
|
+
startAutoMemoryIfEnabled
|
|
79934
79741
|
};
|
|
79935
79742
|
/**
|
|
79936
79743
|
* @license
|