@google/gemini-cli 0.42.0 → 0.44.0-nightly.20260513.g5ee05c775
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-COQP2M4D.js → chunk-27SPXGT2.js} +562 -437
- package/bundle/{chunk-EDKX67D6.js → chunk-2VH3SA6M.js} +43 -23
- package/bundle/{chunk-PUDLNWHE.js → chunk-3KOQHVJU.js} +3 -3
- package/bundle/{chunk-COKAF5GM.js → chunk-4QQ5AHZP.js} +2 -2
- package/bundle/{chunk-KVEAHIIV.js → chunk-5EEEHNEE.js} +3 -3
- package/bundle/{chunk-G2VTSEZ6.js → chunk-5SMSFUPB.js} +1 -1
- package/bundle/{chunk-7VVHSNDQ.js → chunk-AC2EWTF7.js} +1970 -731
- package/bundle/{chunk-GA527JB7.js → chunk-ATSNFRDF.js} +1 -1
- package/bundle/{chunk-3IS7GD6D.js → chunk-BA752AEU.js} +3 -3
- package/bundle/{chunk-CYEIWMZJ.js → chunk-FGYOOMPI.js} +1 -1
- package/bundle/{chunk-QOZSZYL7.js → chunk-FK45PHSI.js} +3 -3
- package/bundle/{chunk-I7AME6VC.js → chunk-FTY6BJEY.js} +9 -8
- package/bundle/{chunk-NTOPH4WG.js → chunk-GCWBZXBS.js} +2 -2
- package/bundle/chunk-I2JHD4D3.js +512 -0
- package/bundle/{chunk-7C6GGDK6.js → chunk-IZJOLGNO.js} +3 -3
- package/bundle/{chunk-4SLGT6YD.js → chunk-J4YAW3P3.js} +1 -1
- package/bundle/chunk-KADNKBXT.js +118 -0
- package/bundle/{chunk-DN4XSYRG.js → chunk-LF33N5QM.js} +8696 -13355
- package/bundle/{chunk-CHERUG6W.js → chunk-LO22NRY4.js} +502 -390
- package/bundle/{chunk-JEW7ZIWE.js → chunk-M7OUJJZ2.js} +5270 -5234
- package/bundle/{chunk-WIXUKOZA.js → chunk-MFNKZZOB.js} +1 -1
- package/bundle/chunk-MLPM54XD.js +357247 -0
- package/bundle/{chunk-ECNYAST2.js → chunk-N22WUHJE.js} +5419 -5378
- package/bundle/chunk-OC7XGTLV.js +81656 -0
- package/bundle/{chunk-ZNMQA242.js → chunk-QDEK3TQ6.js} +3 -3
- package/bundle/{chunk-BCYBA52D.js → chunk-QMXQUBC4.js} +43 -23
- package/bundle/chunk-TBHMNRI3.js +1571 -0
- package/bundle/{chunk-LATVEETM.js → chunk-TOOOS4HD.js} +2 -2
- package/bundle/{chunk-XUMRUXOT.js → chunk-UHSQLPNG.js} +50 -27
- package/bundle/chunk-USS2A6NQ.js +156 -0
- package/bundle/chunk-WMTLLWRC.js +391 -0
- package/bundle/chunk-XDWZDV7C.js +17250 -0
- package/bundle/{chunk-DMWX7UP6.js → chunk-YBYQH75I.js} +2252 -829
- package/bundle/{chunk-FCAODPNO.js → chunk-ZZN56QZ3.js} +502 -390
- package/bundle/{cleanup-3RILFNVM.js → cleanup-2H3SANYB.js} +3 -3
- package/bundle/{cleanup-SVRKYBR6.js → cleanup-7GY7BVC6.js} +3 -3
- package/bundle/{cleanup-XFVHHDVO.js → cleanup-FERREFU6.js} +3 -3
- package/bundle/cleanup-VIITMMDH.js +33 -0
- package/bundle/{core-FRVSDP2C.js → core-GS6NXK7Y.js} +30 -2
- package/bundle/{devtoolsService-VM2WTHBX.js → devtoolsService-FKC6Y4OE.js} +3 -3
- package/bundle/{devtoolsService-TRDGMQLJ.js → devtoolsService-K2DRCZEY.js} +5 -4
- package/bundle/{devtoolsService-RUEO5PGP.js → devtoolsService-PS6RYICL.js} +3 -3
- package/bundle/devtoolsService-ZDXC2NPD.js +857 -0
- package/bundle/{dist-6BN2CJPN.js → dist-S3YUNQKP.js} +30 -2
- package/bundle/{core-B5S6HZJT.js → dist-TBGNMYU2.js} +30 -2
- package/bundle/dist-ZEW43MLQ.js +2124 -0
- package/bundle/docs/changelogs/index.md +30 -0
- package/bundle/docs/changelogs/latest.md +261 -166
- package/bundle/docs/changelogs/preview.md +178 -103
- package/bundle/docs/cli/auto-memory.md +60 -38
- package/bundle/docs/cli/settings.md +1 -1
- package/bundle/docs/cli/tutorials/memory-management.md +1 -1
- package/bundle/docs/extensions/releasing.md +58 -24
- package/bundle/docs/reference/configuration.md +14 -1
- package/bundle/docs/reference/keyboard-shortcuts.md +23 -0
- package/bundle/{gemini-QSTQ2DBG.js → gemini-6YGVETF3.js} +165 -61
- package/bundle/{gemini-GHUELHBF.js → gemini-7FCGNXOV.js} +350 -232
- package/bundle/gemini-IXZUGRVP.js +16360 -0
- package/bundle/{gemini-NQPVX5JC.js → gemini-WYTY4CD5.js} +165 -61
- package/bundle/gemini.js +8 -8
- package/bundle/{interactiveCli-AG2YWL2O.js → interactiveCli-A2FV6NYD.js} +1721 -1472
- package/bundle/{interactiveCli-MZFG35NB.js → interactiveCli-DWNRHVIB.js} +2003 -1736
- package/bundle/{interactiveCli-453M2IVE.js → interactiveCli-H7N4UXVQ.js} +1720 -1472
- package/bundle/interactiveCli-XRZEELCX.js +34754 -0
- package/bundle/{liteRtServerManager-G4Q7OVBX.js → liteRtServerManager-5C5EONBK.js} +5 -5
- package/bundle/{liteRtServerManager-S7WL25VD.js → liteRtServerManager-NQKPNCLR.js} +5 -5
- package/bundle/{liteRtServerManager-BXQ6VVWP.js → liteRtServerManager-UJBPII3P.js} +5 -5
- package/bundle/liteRtServerManager-UZCAJJCS.js +66 -0
- package/bundle/{memoryDiscovery-KSYZVCWF.js → memoryDiscovery-ALKMYAPP.js} +1 -1
- package/bundle/{memoryDiscovery-FB7MMKTA.js → memoryDiscovery-XFCKEF3F.js} +1 -1
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
- package/bundle/{oauth2-provider-VR4DL6AL.js → oauth2-provider-JNOY6NUI.js} +2 -2
- package/bundle/{oauth2-provider-H7G6RSFW.js → oauth2-provider-O6OA5EMU.js} +2 -2
- package/bundle/{oauth2-provider-5UF5WEE2.js → oauth2-provider-QYCLASEA.js} +39 -73
- package/bundle/oauth2-provider-VWLTUFO7.js +237 -0
- package/bundle/{start-CQBSKFYB.js → start-6FV3VPPH.js} +7 -7
- package/bundle/{start-NIMXQJYB.js → start-IWAUTCYF.js} +7 -7
- package/bundle/{start-2SKRN43X.js → start-L4DAQUQM.js} +7 -7
- package/bundle/start-XTXUKP77.js +19 -0
- 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-J4YAW3P3.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_BACKGROUND_OPACITY,
|
|
12
12
|
DEFAULT_BORDER_OPACITY,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
GEMMA_MODEL_NAME,
|
|
20
20
|
LRU_BUFFER_PERF_CACHE_LIMIT,
|
|
21
21
|
MIN_TERMINAL_WIDTH_FOR_FULL_LABEL,
|
|
22
|
+
SessionSelector,
|
|
22
23
|
Theme,
|
|
23
24
|
convertSessionToHistoryFormats,
|
|
24
25
|
cpIndexToOffset,
|
|
@@ -57,14 +58,14 @@ import {
|
|
|
57
58
|
stripUnsafeCharacters,
|
|
58
59
|
toCodePoints,
|
|
59
60
|
validateCustomTheme
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-QMXQUBC4.js";
|
|
61
62
|
import {
|
|
62
63
|
isDevelopment
|
|
63
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-QDEK3TQ6.js";
|
|
64
65
|
import {
|
|
65
66
|
emptyIcon,
|
|
66
67
|
require_react
|
|
67
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-ATSNFRDF.js";
|
|
68
69
|
import {
|
|
69
70
|
AsyncFzf,
|
|
70
71
|
Config,
|
|
@@ -200,7 +201,7 @@ import {
|
|
|
200
201
|
stripAnsi,
|
|
201
202
|
tokenLimit,
|
|
202
203
|
uiTelemetryService
|
|
203
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-YBYQH75I.js";
|
|
204
205
|
import {
|
|
205
206
|
ApprovalMode,
|
|
206
207
|
CoreEvent,
|
|
@@ -226,7 +227,7 @@ import {
|
|
|
226
227
|
shortenPath,
|
|
227
228
|
tildeifyPath,
|
|
228
229
|
unescapePath
|
|
229
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-N22WUHJE.js";
|
|
230
231
|
import {
|
|
231
232
|
require_src
|
|
232
233
|
} from "./chunk-RJTRUG2J.js";
|
|
@@ -1729,8 +1730,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
1729
1730
|
currentEntangledActionThenable = {
|
|
1730
1731
|
status: "pending",
|
|
1731
1732
|
value: void 0,
|
|
1732
|
-
then: function(
|
|
1733
|
-
entangledListeners.push(
|
|
1733
|
+
then: function(resolve9) {
|
|
1734
|
+
entangledListeners.push(resolve9);
|
|
1734
1735
|
}
|
|
1735
1736
|
};
|
|
1736
1737
|
}
|
|
@@ -1753,8 +1754,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
1753
1754
|
status: "pending",
|
|
1754
1755
|
value: null,
|
|
1755
1756
|
reason: null,
|
|
1756
|
-
then: function(
|
|
1757
|
-
listeners.push(
|
|
1757
|
+
then: function(resolve9) {
|
|
1758
|
+
listeners.push(resolve9);
|
|
1758
1759
|
}
|
|
1759
1760
|
};
|
|
1760
1761
|
thenable.then(
|
|
@@ -9748,7 +9749,7 @@ var require_prompt = __commonJS({
|
|
|
9748
9749
|
var require_text = __commonJS({
|
|
9749
9750
|
"node_modules/prompts/dist/elements/text.js"(exports, module) {
|
|
9750
9751
|
"use strict";
|
|
9751
|
-
function asyncGeneratorStep(gen,
|
|
9752
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
9752
9753
|
try {
|
|
9753
9754
|
var info = gen[key](arg);
|
|
9754
9755
|
var value = info.value;
|
|
@@ -9757,7 +9758,7 @@ var require_text = __commonJS({
|
|
|
9757
9758
|
return;
|
|
9758
9759
|
}
|
|
9759
9760
|
if (info.done) {
|
|
9760
|
-
|
|
9761
|
+
resolve9(value);
|
|
9761
9762
|
} else {
|
|
9762
9763
|
Promise.resolve(value).then(_next, _throw);
|
|
9763
9764
|
}
|
|
@@ -9765,13 +9766,13 @@ var require_text = __commonJS({
|
|
|
9765
9766
|
function _asyncToGenerator(fn2) {
|
|
9766
9767
|
return function() {
|
|
9767
9768
|
var self = this, args = arguments;
|
|
9768
|
-
return new Promise(function(
|
|
9769
|
+
return new Promise(function(resolve9, reject) {
|
|
9769
9770
|
var gen = fn2.apply(self, args);
|
|
9770
9771
|
function _next(value) {
|
|
9771
|
-
asyncGeneratorStep(gen,
|
|
9772
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
9772
9773
|
}
|
|
9773
9774
|
function _throw(err) {
|
|
9774
|
-
asyncGeneratorStep(gen,
|
|
9775
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
9775
9776
|
}
|
|
9776
9777
|
_next(void 0);
|
|
9777
9778
|
});
|
|
@@ -10487,7 +10488,7 @@ var require_dateparts = __commonJS({
|
|
|
10487
10488
|
var require_date = __commonJS({
|
|
10488
10489
|
"node_modules/prompts/dist/elements/date.js"(exports, module) {
|
|
10489
10490
|
"use strict";
|
|
10490
|
-
function asyncGeneratorStep(gen,
|
|
10491
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
10491
10492
|
try {
|
|
10492
10493
|
var info = gen[key](arg);
|
|
10493
10494
|
var value = info.value;
|
|
@@ -10496,7 +10497,7 @@ var require_date = __commonJS({
|
|
|
10496
10497
|
return;
|
|
10497
10498
|
}
|
|
10498
10499
|
if (info.done) {
|
|
10499
|
-
|
|
10500
|
+
resolve9(value);
|
|
10500
10501
|
} else {
|
|
10501
10502
|
Promise.resolve(value).then(_next, _throw);
|
|
10502
10503
|
}
|
|
@@ -10504,13 +10505,13 @@ var require_date = __commonJS({
|
|
|
10504
10505
|
function _asyncToGenerator(fn2) {
|
|
10505
10506
|
return function() {
|
|
10506
10507
|
var self = this, args = arguments;
|
|
10507
|
-
return new Promise(function(
|
|
10508
|
+
return new Promise(function(resolve9, reject) {
|
|
10508
10509
|
var gen = fn2.apply(self, args);
|
|
10509
10510
|
function _next(value) {
|
|
10510
|
-
asyncGeneratorStep(gen,
|
|
10511
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
10511
10512
|
}
|
|
10512
10513
|
function _throw(err) {
|
|
10513
|
-
asyncGeneratorStep(gen,
|
|
10514
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
10514
10515
|
}
|
|
10515
10516
|
_next(void 0);
|
|
10516
10517
|
});
|
|
@@ -10713,7 +10714,7 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
|
10713
10714
|
var require_number = __commonJS({
|
|
10714
10715
|
"node_modules/prompts/dist/elements/number.js"(exports, module) {
|
|
10715
10716
|
"use strict";
|
|
10716
|
-
function asyncGeneratorStep(gen,
|
|
10717
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
10717
10718
|
try {
|
|
10718
10719
|
var info = gen[key](arg);
|
|
10719
10720
|
var value = info.value;
|
|
@@ -10722,7 +10723,7 @@ var require_number = __commonJS({
|
|
|
10722
10723
|
return;
|
|
10723
10724
|
}
|
|
10724
10725
|
if (info.done) {
|
|
10725
|
-
|
|
10726
|
+
resolve9(value);
|
|
10726
10727
|
} else {
|
|
10727
10728
|
Promise.resolve(value).then(_next, _throw);
|
|
10728
10729
|
}
|
|
@@ -10730,13 +10731,13 @@ var require_number = __commonJS({
|
|
|
10730
10731
|
function _asyncToGenerator(fn2) {
|
|
10731
10732
|
return function() {
|
|
10732
10733
|
var self = this, args = arguments;
|
|
10733
|
-
return new Promise(function(
|
|
10734
|
+
return new Promise(function(resolve9, reject) {
|
|
10734
10735
|
var gen = fn2.apply(self, args);
|
|
10735
10736
|
function _next(value) {
|
|
10736
|
-
asyncGeneratorStep(gen,
|
|
10737
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
10737
10738
|
}
|
|
10738
10739
|
function _throw(err) {
|
|
10739
|
-
asyncGeneratorStep(gen,
|
|
10740
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
10740
10741
|
}
|
|
10741
10742
|
_next(void 0);
|
|
10742
10743
|
});
|
|
@@ -11159,7 +11160,7 @@ Instructions:
|
|
|
11159
11160
|
var require_autocomplete = __commonJS({
|
|
11160
11161
|
"node_modules/prompts/dist/elements/autocomplete.js"(exports, module) {
|
|
11161
11162
|
"use strict";
|
|
11162
|
-
function asyncGeneratorStep(gen,
|
|
11163
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
11163
11164
|
try {
|
|
11164
11165
|
var info = gen[key](arg);
|
|
11165
11166
|
var value = info.value;
|
|
@@ -11168,7 +11169,7 @@ var require_autocomplete = __commonJS({
|
|
|
11168
11169
|
return;
|
|
11169
11170
|
}
|
|
11170
11171
|
if (info.done) {
|
|
11171
|
-
|
|
11172
|
+
resolve9(value);
|
|
11172
11173
|
} else {
|
|
11173
11174
|
Promise.resolve(value).then(_next, _throw);
|
|
11174
11175
|
}
|
|
@@ -11176,13 +11177,13 @@ var require_autocomplete = __commonJS({
|
|
|
11176
11177
|
function _asyncToGenerator(fn2) {
|
|
11177
11178
|
return function() {
|
|
11178
11179
|
var self = this, args = arguments;
|
|
11179
|
-
return new Promise(function(
|
|
11180
|
+
return new Promise(function(resolve9, reject) {
|
|
11180
11181
|
var gen = fn2.apply(self, args);
|
|
11181
11182
|
function _next(value) {
|
|
11182
|
-
asyncGeneratorStep(gen,
|
|
11183
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
11183
11184
|
}
|
|
11184
11185
|
function _throw(err) {
|
|
11185
|
-
asyncGeneratorStep(gen,
|
|
11186
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
11186
11187
|
}
|
|
11187
11188
|
_next(void 0);
|
|
11188
11189
|
});
|
|
@@ -11813,7 +11814,7 @@ var require_dist = __commonJS({
|
|
|
11813
11814
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
11814
11815
|
return arr2;
|
|
11815
11816
|
}
|
|
11816
|
-
function asyncGeneratorStep(gen,
|
|
11817
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
11817
11818
|
try {
|
|
11818
11819
|
var info = gen[key](arg);
|
|
11819
11820
|
var value = info.value;
|
|
@@ -11822,7 +11823,7 @@ var require_dist = __commonJS({
|
|
|
11822
11823
|
return;
|
|
11823
11824
|
}
|
|
11824
11825
|
if (info.done) {
|
|
11825
|
-
|
|
11826
|
+
resolve9(value);
|
|
11826
11827
|
} else {
|
|
11827
11828
|
Promise.resolve(value).then(_next, _throw);
|
|
11828
11829
|
}
|
|
@@ -11830,13 +11831,13 @@ var require_dist = __commonJS({
|
|
|
11830
11831
|
function _asyncToGenerator(fn2) {
|
|
11831
11832
|
return function() {
|
|
11832
11833
|
var self = this, args = arguments;
|
|
11833
|
-
return new Promise(function(
|
|
11834
|
+
return new Promise(function(resolve9, reject) {
|
|
11834
11835
|
var gen = fn2.apply(self, args);
|
|
11835
11836
|
function _next(value) {
|
|
11836
|
-
asyncGeneratorStep(gen,
|
|
11837
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
11837
11838
|
}
|
|
11838
11839
|
function _throw(err) {
|
|
11839
|
-
asyncGeneratorStep(gen,
|
|
11840
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
11840
11841
|
}
|
|
11841
11842
|
_next(void 0);
|
|
11842
11843
|
});
|
|
@@ -14173,7 +14174,7 @@ var require_get_stream = __commonJS({
|
|
|
14173
14174
|
};
|
|
14174
14175
|
const { maxBuffer } = options;
|
|
14175
14176
|
let stream;
|
|
14176
|
-
await new Promise((
|
|
14177
|
+
await new Promise((resolve9, reject) => {
|
|
14177
14178
|
const rejectPromise = (error) => {
|
|
14178
14179
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
14179
14180
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -14185,7 +14186,7 @@ var require_get_stream = __commonJS({
|
|
|
14185
14186
|
rejectPromise(error);
|
|
14186
14187
|
return;
|
|
14187
14188
|
}
|
|
14188
|
-
|
|
14189
|
+
resolve9();
|
|
14189
14190
|
});
|
|
14190
14191
|
stream.on("data", () => {
|
|
14191
14192
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -14261,7 +14262,7 @@ var require_pend = __commonJS({
|
|
|
14261
14262
|
// node_modules/fd-slicer/index.js
|
|
14262
14263
|
var require_fd_slicer = __commonJS({
|
|
14263
14264
|
"node_modules/fd-slicer/index.js"(exports) {
|
|
14264
|
-
var
|
|
14265
|
+
var fs39 = __require("fs");
|
|
14265
14266
|
var util2 = __require("util");
|
|
14266
14267
|
var stream = __require("stream");
|
|
14267
14268
|
var Readable = stream.Readable;
|
|
@@ -14286,7 +14287,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14286
14287
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
14287
14288
|
var self = this;
|
|
14288
14289
|
self.pend.go(function(cb) {
|
|
14289
|
-
|
|
14290
|
+
fs39.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
|
|
14290
14291
|
cb();
|
|
14291
14292
|
callback(err, bytesRead, buffer2);
|
|
14292
14293
|
});
|
|
@@ -14295,7 +14296,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14295
14296
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
14296
14297
|
var self = this;
|
|
14297
14298
|
self.pend.go(function(cb) {
|
|
14298
|
-
|
|
14299
|
+
fs39.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
|
|
14299
14300
|
cb();
|
|
14300
14301
|
callback(err, written, buffer2);
|
|
14301
14302
|
});
|
|
@@ -14316,7 +14317,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14316
14317
|
if (self.refCount > 0) return;
|
|
14317
14318
|
if (self.refCount < 0) throw new Error("invalid unref");
|
|
14318
14319
|
if (self.autoClose) {
|
|
14319
|
-
|
|
14320
|
+
fs39.close(self.fd, onCloseDone);
|
|
14320
14321
|
}
|
|
14321
14322
|
function onCloseDone(err) {
|
|
14322
14323
|
if (err) {
|
|
@@ -14353,7 +14354,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14353
14354
|
self.context.pend.go(function(cb) {
|
|
14354
14355
|
if (self.destroyed) return cb();
|
|
14355
14356
|
var buffer = new Buffer(toRead);
|
|
14356
|
-
|
|
14357
|
+
fs39.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
14357
14358
|
if (err) {
|
|
14358
14359
|
self.destroy(err);
|
|
14359
14360
|
} else if (bytesRead === 0) {
|
|
@@ -14400,7 +14401,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14400
14401
|
}
|
|
14401
14402
|
self.context.pend.go(function(cb) {
|
|
14402
14403
|
if (self.destroyed) return cb();
|
|
14403
|
-
|
|
14404
|
+
fs39.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
|
|
14404
14405
|
if (err2) {
|
|
14405
14406
|
self.destroy();
|
|
14406
14407
|
cb();
|
|
@@ -14827,7 +14828,7 @@ var require_buffer_crc32 = __commonJS({
|
|
|
14827
14828
|
// node_modules/yauzl/index.js
|
|
14828
14829
|
var require_yauzl = __commonJS({
|
|
14829
14830
|
"node_modules/yauzl/index.js"(exports) {
|
|
14830
|
-
var
|
|
14831
|
+
var fs39 = __require("fs");
|
|
14831
14832
|
var zlib = __require("zlib");
|
|
14832
14833
|
var fd_slicer = require_fd_slicer();
|
|
14833
14834
|
var crc32 = require_buffer_crc32();
|
|
@@ -14845,7 +14846,7 @@ var require_yauzl = __commonJS({
|
|
|
14845
14846
|
exports.ZipFile = ZipFile;
|
|
14846
14847
|
exports.Entry = Entry;
|
|
14847
14848
|
exports.RandomAccessReader = RandomAccessReader;
|
|
14848
|
-
function open(
|
|
14849
|
+
function open(path38, options, callback) {
|
|
14849
14850
|
if (typeof options === "function") {
|
|
14850
14851
|
callback = options;
|
|
14851
14852
|
options = null;
|
|
@@ -14857,10 +14858,10 @@ var require_yauzl = __commonJS({
|
|
|
14857
14858
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14858
14859
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14859
14860
|
if (callback == null) callback = defaultCallback;
|
|
14860
|
-
|
|
14861
|
+
fs39.open(path38, "r", function(err, fd) {
|
|
14861
14862
|
if (err) return callback(err);
|
|
14862
14863
|
fromFd(fd, options, function(err2, zipfile) {
|
|
14863
|
-
if (err2)
|
|
14864
|
+
if (err2) fs39.close(fd, defaultCallback);
|
|
14864
14865
|
callback(err2, zipfile);
|
|
14865
14866
|
});
|
|
14866
14867
|
});
|
|
@@ -14877,7 +14878,7 @@ var require_yauzl = __commonJS({
|
|
|
14877
14878
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14878
14879
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14879
14880
|
if (callback == null) callback = defaultCallback;
|
|
14880
|
-
|
|
14881
|
+
fs39.fstat(fd, function(err, stats) {
|
|
14881
14882
|
if (err) return callback(err);
|
|
14882
14883
|
var reader = fd_slicer.createFromFd(fd, { autoClose: true });
|
|
14883
14884
|
fromRandomAccessReader(reader, stats.size, options, callback);
|
|
@@ -15457,9 +15458,9 @@ var require_yauzl = __commonJS({
|
|
|
15457
15458
|
var require_extract_zip = __commonJS({
|
|
15458
15459
|
"node_modules/extract-zip/index.js"(exports, module) {
|
|
15459
15460
|
var debug = require_src()("extract-zip");
|
|
15460
|
-
var { createWriteStream: createWriteStream5, promises:
|
|
15461
|
+
var { createWriteStream: createWriteStream5, promises: fs39 } = __require("fs");
|
|
15461
15462
|
var getStream = require_get_stream();
|
|
15462
|
-
var
|
|
15463
|
+
var path38 = __require("path");
|
|
15463
15464
|
var { promisify: promisify5 } = __require("util");
|
|
15464
15465
|
var stream = __require("stream");
|
|
15465
15466
|
var yauzl = require_yauzl();
|
|
@@ -15474,7 +15475,7 @@ var require_extract_zip = __commonJS({
|
|
|
15474
15475
|
debug("opening", this.zipPath, "with opts", this.opts);
|
|
15475
15476
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
15476
15477
|
this.canceled = false;
|
|
15477
|
-
return new Promise((
|
|
15478
|
+
return new Promise((resolve9, reject) => {
|
|
15478
15479
|
this.zipfile.on("error", (err) => {
|
|
15479
15480
|
this.canceled = true;
|
|
15480
15481
|
reject(err);
|
|
@@ -15483,7 +15484,7 @@ var require_extract_zip = __commonJS({
|
|
|
15483
15484
|
this.zipfile.on("close", () => {
|
|
15484
15485
|
if (!this.canceled) {
|
|
15485
15486
|
debug("zip extraction complete");
|
|
15486
|
-
|
|
15487
|
+
resolve9();
|
|
15487
15488
|
}
|
|
15488
15489
|
});
|
|
15489
15490
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -15496,12 +15497,12 @@ var require_extract_zip = __commonJS({
|
|
|
15496
15497
|
this.zipfile.readEntry();
|
|
15497
15498
|
return;
|
|
15498
15499
|
}
|
|
15499
|
-
const destDir =
|
|
15500
|
+
const destDir = path38.dirname(path38.join(this.opts.dir, entry.fileName));
|
|
15500
15501
|
try {
|
|
15501
|
-
await
|
|
15502
|
-
const canonicalDestDir = await
|
|
15503
|
-
const relativeDestDir =
|
|
15504
|
-
if (relativeDestDir.split(
|
|
15502
|
+
await fs39.mkdir(destDir, { recursive: true });
|
|
15503
|
+
const canonicalDestDir = await fs39.realpath(destDir);
|
|
15504
|
+
const relativeDestDir = path38.relative(this.opts.dir, canonicalDestDir);
|
|
15505
|
+
if (relativeDestDir.split(path38.sep).includes("..")) {
|
|
15505
15506
|
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
15506
15507
|
}
|
|
15507
15508
|
await this.extractEntry(entry);
|
|
@@ -15523,7 +15524,7 @@ var require_extract_zip = __commonJS({
|
|
|
15523
15524
|
if (this.opts.onEntry) {
|
|
15524
15525
|
this.opts.onEntry(entry, this.zipfile);
|
|
15525
15526
|
}
|
|
15526
|
-
const dest =
|
|
15527
|
+
const dest = path38.join(this.opts.dir, entry.fileName);
|
|
15527
15528
|
const mode = entry.externalFileAttributes >> 16 & 65535;
|
|
15528
15529
|
const IFMT = 61440;
|
|
15529
15530
|
const IFDIR = 16384;
|
|
@@ -15537,20 +15538,20 @@ var require_extract_zip = __commonJS({
|
|
|
15537
15538
|
if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
|
|
15538
15539
|
debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink2 });
|
|
15539
15540
|
const procMode = this.getExtractedMode(mode, isDir) & 511;
|
|
15540
|
-
const destDir = isDir ? dest :
|
|
15541
|
+
const destDir = isDir ? dest : path38.dirname(dest);
|
|
15541
15542
|
const mkdirOptions = { recursive: true };
|
|
15542
15543
|
if (isDir) {
|
|
15543
15544
|
mkdirOptions.mode = procMode;
|
|
15544
15545
|
}
|
|
15545
15546
|
debug("mkdir", { dir: destDir, ...mkdirOptions });
|
|
15546
|
-
await
|
|
15547
|
+
await fs39.mkdir(destDir, mkdirOptions);
|
|
15547
15548
|
if (isDir) return;
|
|
15548
15549
|
debug("opening read stream", dest);
|
|
15549
15550
|
const readStream = await promisify5(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
15550
15551
|
if (symlink2) {
|
|
15551
15552
|
const link2 = await getStream(readStream);
|
|
15552
15553
|
debug("creating symlink", link2, dest);
|
|
15553
|
-
await
|
|
15554
|
+
await fs39.symlink(link2, dest);
|
|
15554
15555
|
} else {
|
|
15555
15556
|
await pipeline2(readStream, createWriteStream5(dest, { mode: procMode }));
|
|
15556
15557
|
}
|
|
@@ -15579,11 +15580,11 @@ var require_extract_zip = __commonJS({
|
|
|
15579
15580
|
};
|
|
15580
15581
|
module.exports = async function(zipPath, opts) {
|
|
15581
15582
|
debug("creating target directory", opts.dir);
|
|
15582
|
-
if (!
|
|
15583
|
+
if (!path38.isAbsolute(opts.dir)) {
|
|
15583
15584
|
throw new Error("Target directory is expected to be absolute");
|
|
15584
15585
|
}
|
|
15585
|
-
await
|
|
15586
|
-
opts.dir = await
|
|
15586
|
+
await fs39.mkdir(opts.dir, { recursive: true });
|
|
15587
|
+
opts.dir = await fs39.realpath(opts.dir);
|
|
15587
15588
|
return new Extractor(zipPath, opts).extract();
|
|
15588
15589
|
};
|
|
15589
15590
|
}
|
|
@@ -17040,7 +17041,7 @@ var require_strip_final_newline = __commonJS({
|
|
|
17040
17041
|
var require_npm_run_path = __commonJS({
|
|
17041
17042
|
"node_modules/run-jxa/node_modules/npm-run-path/index.js"(exports, module) {
|
|
17042
17043
|
"use strict";
|
|
17043
|
-
var
|
|
17044
|
+
var path38 = __require("path");
|
|
17044
17045
|
var pathKey = require_path_key();
|
|
17045
17046
|
var npmRunPath = (options) => {
|
|
17046
17047
|
options = {
|
|
@@ -17050,16 +17051,16 @@ var require_npm_run_path = __commonJS({
|
|
|
17050
17051
|
...options
|
|
17051
17052
|
};
|
|
17052
17053
|
let previous;
|
|
17053
|
-
let cwdPath =
|
|
17054
|
+
let cwdPath = path38.resolve(options.cwd);
|
|
17054
17055
|
const result = [];
|
|
17055
17056
|
while (previous !== cwdPath) {
|
|
17056
|
-
result.push(
|
|
17057
|
+
result.push(path38.join(cwdPath, "node_modules/.bin"));
|
|
17057
17058
|
previous = cwdPath;
|
|
17058
|
-
cwdPath =
|
|
17059
|
+
cwdPath = path38.resolve(cwdPath, "..");
|
|
17059
17060
|
}
|
|
17060
|
-
const execPathDir =
|
|
17061
|
+
const execPathDir = path38.resolve(options.cwd, options.execPath, "..");
|
|
17061
17062
|
result.push(execPathDir);
|
|
17062
|
-
return result.concat(options.path).join(
|
|
17063
|
+
return result.concat(options.path).join(path38.delimiter);
|
|
17063
17064
|
};
|
|
17064
17065
|
module.exports = npmRunPath;
|
|
17065
17066
|
module.exports.default = npmRunPath;
|
|
@@ -17069,9 +17070,9 @@ var require_npm_run_path = __commonJS({
|
|
|
17069
17070
|
...options
|
|
17070
17071
|
};
|
|
17071
17072
|
const env3 = { ...options.env };
|
|
17072
|
-
const
|
|
17073
|
-
options.path = env3[
|
|
17074
|
-
env3[
|
|
17073
|
+
const path39 = pathKey({ env: env3 });
|
|
17074
|
+
options.path = env3[path39];
|
|
17075
|
+
env3[path39] = module.exports(options);
|
|
17075
17076
|
return env3;
|
|
17076
17077
|
};
|
|
17077
17078
|
}
|
|
@@ -17794,7 +17795,7 @@ var require_signal_exit3 = __commonJS({
|
|
|
17794
17795
|
var require_kill = __commonJS({
|
|
17795
17796
|
"node_modules/run-jxa/node_modules/execa/lib/kill.js"(exports, module) {
|
|
17796
17797
|
"use strict";
|
|
17797
|
-
var
|
|
17798
|
+
var os9 = __require("os");
|
|
17798
17799
|
var onExit = require_signal_exit3();
|
|
17799
17800
|
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
17800
17801
|
var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
@@ -17818,7 +17819,7 @@ var require_kill = __commonJS({
|
|
|
17818
17819
|
return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
17819
17820
|
};
|
|
17820
17821
|
var isSigterm = (signal) => {
|
|
17821
|
-
return signal ===
|
|
17822
|
+
return signal === os9.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
17822
17823
|
};
|
|
17823
17824
|
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
17824
17825
|
if (forceKillAfterTimeout === true) {
|
|
@@ -17844,7 +17845,7 @@ var require_kill = __commonJS({
|
|
|
17844
17845
|
return spawnedPromise;
|
|
17845
17846
|
}
|
|
17846
17847
|
let timeoutId;
|
|
17847
|
-
const timeoutPromise = new Promise((
|
|
17848
|
+
const timeoutPromise = new Promise((resolve9, reject) => {
|
|
17848
17849
|
timeoutId = setTimeout(() => {
|
|
17849
17850
|
timeoutKill(spawned, killSignal, reject);
|
|
17850
17851
|
}, timeout);
|
|
@@ -17950,7 +17951,7 @@ var require_get_stream2 = __commonJS({
|
|
|
17950
17951
|
};
|
|
17951
17952
|
const { maxBuffer } = options;
|
|
17952
17953
|
const stream2 = bufferStream(options);
|
|
17953
|
-
await new Promise((
|
|
17954
|
+
await new Promise((resolve9, reject) => {
|
|
17954
17955
|
const rejectPromise = (error) => {
|
|
17955
17956
|
if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
17956
17957
|
error.bufferedData = stream2.getBufferedValue();
|
|
@@ -17960,7 +17961,7 @@ var require_get_stream2 = __commonJS({
|
|
|
17960
17961
|
(async () => {
|
|
17961
17962
|
try {
|
|
17962
17963
|
await streamPipelinePromisified(inputStream, stream2);
|
|
17963
|
-
|
|
17964
|
+
resolve9();
|
|
17964
17965
|
} catch (error) {
|
|
17965
17966
|
rejectPromise(error);
|
|
17966
17967
|
}
|
|
@@ -18117,9 +18118,9 @@ var require_promise = __commonJS({
|
|
|
18117
18118
|
return spawned;
|
|
18118
18119
|
};
|
|
18119
18120
|
var getSpawnedPromise = (spawned) => {
|
|
18120
|
-
return new Promise((
|
|
18121
|
+
return new Promise((resolve9, reject) => {
|
|
18121
18122
|
spawned.on("exit", (exitCode, signal) => {
|
|
18122
|
-
|
|
18123
|
+
resolve9({ exitCode, signal });
|
|
18123
18124
|
});
|
|
18124
18125
|
spawned.on("error", (error) => {
|
|
18125
18126
|
reject(error);
|
|
@@ -18187,7 +18188,7 @@ var require_command = __commonJS({
|
|
|
18187
18188
|
var require_execa = __commonJS({
|
|
18188
18189
|
"node_modules/run-jxa/node_modules/execa/index.js"(exports, module) {
|
|
18189
18190
|
"use strict";
|
|
18190
|
-
var
|
|
18191
|
+
var path38 = __require("path");
|
|
18191
18192
|
var childProcess3 = __require("child_process");
|
|
18192
18193
|
var crossSpawn = require_cross_spawn();
|
|
18193
18194
|
var stripFinalNewline = require_strip_final_newline();
|
|
@@ -18229,7 +18230,7 @@ var require_execa = __commonJS({
|
|
|
18229
18230
|
};
|
|
18230
18231
|
options.env = getEnv(options);
|
|
18231
18232
|
options.stdio = normalizeStdio(options);
|
|
18232
|
-
if (process.platform === "win32" &&
|
|
18233
|
+
if (process.platform === "win32" && path38.basename(file, ".exe") === "cmd") {
|
|
18233
18234
|
args.unshift("/q");
|
|
18234
18235
|
}
|
|
18235
18236
|
return { file, args, options, parsed };
|
|
@@ -25586,13 +25587,13 @@ var setTextNodeValue = (node, text) => {
|
|
|
25586
25587
|
markNodeAsDirty(node);
|
|
25587
25588
|
};
|
|
25588
25589
|
var getPathToRoot = (node) => {
|
|
25589
|
-
const
|
|
25590
|
+
const path38 = [];
|
|
25590
25591
|
let current = node;
|
|
25591
25592
|
while (current) {
|
|
25592
|
-
|
|
25593
|
+
path38.unshift(current);
|
|
25593
25594
|
current = current.parentNode;
|
|
25594
25595
|
}
|
|
25595
|
-
return
|
|
25596
|
+
return path38;
|
|
25596
25597
|
};
|
|
25597
25598
|
var isNodeSelectable = (node) => {
|
|
25598
25599
|
let current = node;
|
|
@@ -30070,8 +30071,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
30070
30071
|
}
|
|
30071
30072
|
|
|
30072
30073
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
30073
|
-
var cleanupPath = (
|
|
30074
|
-
return
|
|
30074
|
+
var cleanupPath = (path38) => {
|
|
30075
|
+
return path38?.replace(`file://${cwd()}/`, "");
|
|
30075
30076
|
};
|
|
30076
30077
|
var stackUtils = new import_stack_utils.default({
|
|
30077
30078
|
cwd: cwd(),
|
|
@@ -31267,12 +31268,12 @@ var TerminalWriter = class {
|
|
|
31267
31268
|
if (chunk) {
|
|
31268
31269
|
this.synchronizedWrite(chunk);
|
|
31269
31270
|
}
|
|
31270
|
-
await new Promise((
|
|
31271
|
+
await new Promise((resolve9) => {
|
|
31271
31272
|
let finished = false;
|
|
31272
31273
|
const timer = setTimeout(() => {
|
|
31273
31274
|
finished = true;
|
|
31274
31275
|
this.cancelSlowFlush = void 0;
|
|
31275
|
-
|
|
31276
|
+
resolve9();
|
|
31276
31277
|
}, 50);
|
|
31277
31278
|
this.cancelSlowFlush = () => {
|
|
31278
31279
|
if (!finished) {
|
|
@@ -31283,7 +31284,7 @@ var TerminalWriter = class {
|
|
|
31283
31284
|
this.outputBuffer = [];
|
|
31284
31285
|
}
|
|
31285
31286
|
this.cancelSlowFlush = void 0;
|
|
31286
|
-
|
|
31287
|
+
resolve9();
|
|
31287
31288
|
}
|
|
31288
31289
|
};
|
|
31289
31290
|
});
|
|
@@ -31674,8 +31675,8 @@ var AnimationController = class {
|
|
|
31674
31675
|
if (!this.isRunning) {
|
|
31675
31676
|
return;
|
|
31676
31677
|
}
|
|
31677
|
-
return new Promise((
|
|
31678
|
-
this.idleResolvers.push(
|
|
31678
|
+
return new Promise((resolve9) => {
|
|
31679
|
+
this.idleResolvers.push(resolve9);
|
|
31679
31680
|
});
|
|
31680
31681
|
}
|
|
31681
31682
|
/**
|
|
@@ -31715,8 +31716,8 @@ var AnimationController = class {
|
|
|
31715
31716
|
clearInterval(this.intervalId);
|
|
31716
31717
|
this.intervalId = void 0;
|
|
31717
31718
|
}
|
|
31718
|
-
for (const
|
|
31719
|
-
|
|
31719
|
+
for (const resolve9 of this.idleResolvers) {
|
|
31720
|
+
resolve9();
|
|
31720
31721
|
}
|
|
31721
31722
|
this.idleResolvers = [];
|
|
31722
31723
|
}
|
|
@@ -33221,11 +33222,11 @@ var TerminalBuffer = class {
|
|
|
33221
33222
|
if (!this.worker?.connected) {
|
|
33222
33223
|
return 0;
|
|
33223
33224
|
}
|
|
33224
|
-
return new Promise((
|
|
33225
|
+
return new Promise((resolve9) => {
|
|
33225
33226
|
const handler2 = (message) => {
|
|
33226
33227
|
if (message.type === "linesUpdated") {
|
|
33227
33228
|
this.worker?.off("message", handler2);
|
|
33228
|
-
|
|
33229
|
+
resolve9(message.count);
|
|
33229
33230
|
}
|
|
33230
33231
|
};
|
|
33231
33232
|
this.worker?.on("message", handler2);
|
|
@@ -33234,7 +33235,7 @@ var TerminalBuffer = class {
|
|
|
33234
33235
|
} catch (error) {
|
|
33235
33236
|
this.worker?.off("message", handler2);
|
|
33236
33237
|
console.error("Failed to send getLinesUpdated message to worker:", error);
|
|
33237
|
-
|
|
33238
|
+
resolve9(0);
|
|
33238
33239
|
}
|
|
33239
33240
|
});
|
|
33240
33241
|
}
|
|
@@ -33746,8 +33747,8 @@ var Ink = class {
|
|
|
33746
33747
|
}
|
|
33747
33748
|
}
|
|
33748
33749
|
async waitUntilExit() {
|
|
33749
|
-
this.exitPromise ||= new Promise((
|
|
33750
|
-
this.resolveExitPromise =
|
|
33750
|
+
this.exitPromise ||= new Promise((resolve9, reject) => {
|
|
33751
|
+
this.resolveExitPromise = resolve9;
|
|
33751
33752
|
this.rejectExitPromise = reject;
|
|
33752
33753
|
});
|
|
33753
33754
|
return this.exitPromise;
|
|
@@ -34546,7 +34547,7 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
|
|
|
34546
34547
|
process.on("exit", cleanupTerminalOnExit);
|
|
34547
34548
|
process.on("SIGTERM", cleanupTerminalOnExit);
|
|
34548
34549
|
process.on("SIGINT", cleanupTerminalOnExit);
|
|
34549
|
-
return new Promise((
|
|
34550
|
+
return new Promise((resolve9) => {
|
|
34550
34551
|
const originalRawMode = process.stdin.isRaw;
|
|
34551
34552
|
if (!originalRawMode) {
|
|
34552
34553
|
process.stdin.setRawMode(true);
|
|
@@ -34567,7 +34568,7 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
|
|
|
34567
34568
|
process.stdin.setRawMode(false);
|
|
34568
34569
|
}
|
|
34569
34570
|
this.detectionComplete = true;
|
|
34570
|
-
|
|
34571
|
+
resolve9();
|
|
34571
34572
|
};
|
|
34572
34573
|
timeoutId = setTimeout(cleanup, 1e3);
|
|
34573
34574
|
const onData = (data) => {
|
|
@@ -38960,7 +38961,6 @@ var ThemeManager = class {
|
|
|
38960
38961
|
try {
|
|
38961
38962
|
const theme2 = createCustomTheme(themeWithDefaults);
|
|
38962
38963
|
this.extensionThemes.set(namespacedName, theme2);
|
|
38963
|
-
debugLogger.log(`Registered theme: ${namespacedName}`);
|
|
38964
38964
|
} catch (error) {
|
|
38965
38965
|
debugLogger.warn(
|
|
38966
38966
|
`Failed to load custom theme "${namespacedName}":`,
|
|
@@ -38986,7 +38986,6 @@ var ThemeManager = class {
|
|
|
38986
38986
|
for (const theme2 of customThemes) {
|
|
38987
38987
|
const namespacedName = `${theme2.name} (${extensionName})`;
|
|
38988
38988
|
this.extensionThemes.delete(namespacedName);
|
|
38989
|
-
debugLogger.log(`Unregistered theme: ${namespacedName}`);
|
|
38990
38989
|
}
|
|
38991
38990
|
}
|
|
38992
38991
|
/**
|
|
@@ -40265,25 +40264,25 @@ async function promptForConsentNonInteractive(prompt, defaultValue = true) {
|
|
|
40265
40264
|
input: process.stdin,
|
|
40266
40265
|
output: process.stdout
|
|
40267
40266
|
});
|
|
40268
|
-
return new Promise((
|
|
40267
|
+
return new Promise((resolve9) => {
|
|
40269
40268
|
rl.question(prompt, (answer) => {
|
|
40270
40269
|
rl.close();
|
|
40271
40270
|
const trimmedAnswer = answer.trim().toLowerCase();
|
|
40272
40271
|
if (trimmedAnswer === "") {
|
|
40273
|
-
|
|
40272
|
+
resolve9(defaultValue);
|
|
40274
40273
|
} else {
|
|
40275
|
-
|
|
40274
|
+
resolve9(["y", "yes"].includes(trimmedAnswer));
|
|
40276
40275
|
}
|
|
40277
40276
|
});
|
|
40278
40277
|
});
|
|
40279
40278
|
}
|
|
40280
40279
|
async function promptForConsentInteractive(prompt, addExtensionUpdateConfirmationRequest, clearConfirmationRequest) {
|
|
40281
|
-
return new Promise((
|
|
40280
|
+
return new Promise((resolve9) => {
|
|
40282
40281
|
addExtensionUpdateConfirmationRequest({
|
|
40283
40282
|
prompt,
|
|
40284
40283
|
onConfirm: (resolvedConfirmed) => {
|
|
40285
40284
|
clearConfirmationRequest?.();
|
|
40286
|
-
setImmediate(() =>
|
|
40285
|
+
setImmediate(() => resolve9(resolvedConfirmed));
|
|
40287
40286
|
}
|
|
40288
40287
|
});
|
|
40289
40288
|
});
|
|
@@ -40448,10 +40447,7 @@ function recursivelyHydrateStrings(obj, values) {
|
|
|
40448
40447
|
}
|
|
40449
40448
|
if (Array.isArray(obj)) {
|
|
40450
40449
|
return obj.map(
|
|
40451
|
-
(item) => (
|
|
40452
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
40453
|
-
recursivelyHydrateStrings(item, values)
|
|
40454
|
-
)
|
|
40450
|
+
(item) => recursivelyHydrateStrings(item, values)
|
|
40455
40451
|
);
|
|
40456
40452
|
}
|
|
40457
40453
|
if (typeof obj === "object" && obj !== null) {
|
|
@@ -40546,7 +40542,9 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
|
|
|
40546
40542
|
settingsChanges.promptForEnv
|
|
40547
40543
|
)) {
|
|
40548
40544
|
const answer = await requestSetting(setting);
|
|
40549
|
-
|
|
40545
|
+
if (answer !== void 0) {
|
|
40546
|
+
allSettings[setting.envVar] = answer;
|
|
40547
|
+
}
|
|
40550
40548
|
}
|
|
40551
40549
|
const nonSensitiveSettings = {};
|
|
40552
40550
|
for (const setting of settings) {
|
|
@@ -40597,7 +40595,7 @@ async function promptForSetting(setting) {
|
|
|
40597
40595
|
message: `${setting.name}
|
|
40598
40596
|
${setting.description}`
|
|
40599
40597
|
});
|
|
40600
|
-
return response.value;
|
|
40598
|
+
return typeof response.value === "string" ? response.value : void 0;
|
|
40601
40599
|
}
|
|
40602
40600
|
async function getScopedEnvContents(extensionConfig, extensionId, scope, workspaceDir) {
|
|
40603
40601
|
const { name: extensionName } = extensionConfig;
|
|
@@ -40656,6 +40654,9 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40656
40654
|
return;
|
|
40657
40655
|
}
|
|
40658
40656
|
const newValue = await requestSetting(settingToUpdate);
|
|
40657
|
+
if (newValue === void 0) {
|
|
40658
|
+
return;
|
|
40659
|
+
}
|
|
40659
40660
|
const keychain = new KeychainTokenStorage(
|
|
40660
40661
|
getKeychainStorageName(extensionName, extensionId, scope, workspaceDir)
|
|
40661
40662
|
);
|
|
@@ -40804,8 +40805,8 @@ var Override = class _Override {
|
|
|
40804
40805
|
output() {
|
|
40805
40806
|
return `${this.isDisable ? "!" : ""}${this.baseRule}${this.includeSubdirs ? "*" : ""}`;
|
|
40806
40807
|
}
|
|
40807
|
-
matchesPath(
|
|
40808
|
-
return this.asRegex().test(
|
|
40808
|
+
matchesPath(path38) {
|
|
40809
|
+
return this.asRegex().test(path38);
|
|
40809
40810
|
}
|
|
40810
40811
|
};
|
|
40811
40812
|
var ensureLeadingAndTrailingSlash = function(dirPath) {
|
|
@@ -40876,7 +40877,12 @@ var ExtensionEnablementManager = class {
|
|
|
40876
40877
|
readConfig() {
|
|
40877
40878
|
try {
|
|
40878
40879
|
const content = fs12.readFileSync(this.configFilePath, "utf-8");
|
|
40879
|
-
|
|
40880
|
+
const parsed = JSON.parse(content);
|
|
40881
|
+
const schema = external_exports.record(
|
|
40882
|
+
external_exports.string(),
|
|
40883
|
+
external_exports.object({ overrides: external_exports.array(external_exports.string()) })
|
|
40884
|
+
);
|
|
40885
|
+
return schema.parse(parsed);
|
|
40880
40886
|
} catch (error) {
|
|
40881
40887
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
40882
40888
|
return {};
|
|
@@ -43946,7 +43952,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
43946
43952
|
if (token) {
|
|
43947
43953
|
headers.Authorization = `token ${token}`;
|
|
43948
43954
|
}
|
|
43949
|
-
return new Promise((
|
|
43955
|
+
return new Promise((resolve9, reject) => {
|
|
43950
43956
|
https.get(url, { headers }, (res) => {
|
|
43951
43957
|
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
43952
43958
|
if (redirectCount >= 10) {
|
|
@@ -43959,7 +43965,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
43959
43965
|
fetchJson(
|
|
43960
43966
|
new URL(res.headers.location, url).toString(),
|
|
43961
43967
|
redirectCount + 1
|
|
43962
|
-
).then(
|
|
43968
|
+
).then(resolve9).catch(reject);
|
|
43963
43969
|
return;
|
|
43964
43970
|
}
|
|
43965
43971
|
if (res.statusCode !== 200) {
|
|
@@ -43971,7 +43977,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
43971
43977
|
res.on("data", (chunk) => chunks.push(chunk));
|
|
43972
43978
|
res.on("end", () => {
|
|
43973
43979
|
const data = Buffer.concat(chunks).toString();
|
|
43974
|
-
|
|
43980
|
+
resolve9(JSON.parse(data));
|
|
43975
43981
|
});
|
|
43976
43982
|
}).on("error", reject);
|
|
43977
43983
|
});
|
|
@@ -44331,7 +44337,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44331
44337
|
if (token) {
|
|
44332
44338
|
headers["Authorization"] = `token ${token}`;
|
|
44333
44339
|
}
|
|
44334
|
-
return new Promise((
|
|
44340
|
+
return new Promise((resolve9, reject) => {
|
|
44335
44341
|
https2.get(url, { headers }, (res) => {
|
|
44336
44342
|
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
44337
44343
|
if (redirectCount >= 10) {
|
|
@@ -44342,7 +44348,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44342
44348
|
new Error("Redirect response missing Location header")
|
|
44343
44349
|
);
|
|
44344
44350
|
}
|
|
44345
|
-
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(
|
|
44351
|
+
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(resolve9).catch(reject);
|
|
44346
44352
|
return;
|
|
44347
44353
|
}
|
|
44348
44354
|
if (res.statusCode !== 200) {
|
|
@@ -44352,7 +44358,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44352
44358
|
}
|
|
44353
44359
|
const file = fs15.createWriteStream(dest);
|
|
44354
44360
|
res.pipe(file);
|
|
44355
|
-
file.on("finish", () => file.close(
|
|
44361
|
+
file.on("finish", () => file.close(resolve9));
|
|
44356
44362
|
}).on("error", reject);
|
|
44357
44363
|
});
|
|
44358
44364
|
}
|
|
@@ -44383,7 +44389,7 @@ var defaultRequestConfirmation = async (message) => {
|
|
|
44383
44389
|
message,
|
|
44384
44390
|
initial: false
|
|
44385
44391
|
});
|
|
44386
|
-
return response.confirm;
|
|
44392
|
+
return typeof response.confirm === "boolean" ? response.confirm : false;
|
|
44387
44393
|
};
|
|
44388
44394
|
async function getExtensionManager() {
|
|
44389
44395
|
const workspaceDir = process.cwd();
|
|
@@ -45511,7 +45517,7 @@ function validateName(name) {
|
|
|
45511
45517
|
}
|
|
45512
45518
|
}
|
|
45513
45519
|
async function inferInstallMetadata(source2, args = {}) {
|
|
45514
|
-
if (source2.startsWith("http://") || source2.startsWith("https://") || source2.startsWith("git@") || source2.startsWith("sso://") || source2.startsWith("github:") || source2.startsWith("gitlab:")) {
|
|
45520
|
+
if (source2.startsWith("http://") || source2.startsWith("https://") || source2.startsWith("git@") || source2.startsWith("sso://") || source2.startsWith("github:") || source2.startsWith("gitlab:") || source2.startsWith("ssh://")) {
|
|
45515
45521
|
return {
|
|
45516
45522
|
source: source2,
|
|
45517
45523
|
type: "git",
|
|
@@ -45833,9 +45839,9 @@ function isSettingsValue(value) {
|
|
|
45833
45839
|
const type = typeof value;
|
|
45834
45840
|
return type === "string" || type === "number" || type === "boolean" || type === "object";
|
|
45835
45841
|
}
|
|
45836
|
-
function getNestedValue(obj,
|
|
45842
|
+
function getNestedValue(obj, path38) {
|
|
45837
45843
|
let current = obj;
|
|
45838
|
-
for (const key of
|
|
45844
|
+
for (const key of path38) {
|
|
45839
45845
|
if (!isRecord(current) || !(key in current)) {
|
|
45840
45846
|
return void 0;
|
|
45841
45847
|
}
|
|
@@ -45848,8 +45854,8 @@ function getEffectiveValue(key, settings) {
|
|
|
45848
45854
|
if (!definition) {
|
|
45849
45855
|
return void 0;
|
|
45850
45856
|
}
|
|
45851
|
-
const
|
|
45852
|
-
const value = getNestedValue(settings,
|
|
45857
|
+
const path38 = key.split(".");
|
|
45858
|
+
const value = getNestedValue(settings, path38);
|
|
45853
45859
|
if (value !== void 0 && isSettingsValue(value)) {
|
|
45854
45860
|
return value;
|
|
45855
45861
|
}
|
|
@@ -45859,8 +45865,8 @@ function getDialogSettingKeys() {
|
|
|
45859
45865
|
return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
|
|
45860
45866
|
}
|
|
45861
45867
|
function isInSettingsScope(key, scopeSettings) {
|
|
45862
|
-
const
|
|
45863
|
-
const value = getNestedValue(scopeSettings,
|
|
45868
|
+
const path38 = key.split(".");
|
|
45869
|
+
const value = getNestedValue(scopeSettings, path38);
|
|
45864
45870
|
return value !== void 0;
|
|
45865
45871
|
}
|
|
45866
45872
|
function getDisplayValue(key, scopeSettings, _mergedSettings) {
|
|
@@ -46925,7 +46931,7 @@ async function writeClipboardImages(filePaths) {
|
|
|
46925
46931
|
if (process22.platform !== "darwin") {
|
|
46926
46932
|
return;
|
|
46927
46933
|
}
|
|
46928
|
-
const paths = filePaths.map((
|
|
46934
|
+
const paths = filePaths.map((path38) => path38 instanceof URL ? fileURLToPath2(path38) : path38);
|
|
46929
46935
|
await runJxa((...paths2) => {
|
|
46930
46936
|
ObjC.import("AppKit");
|
|
46931
46937
|
ObjC.import("Foundation");
|
|
@@ -47428,7 +47434,7 @@ var OSC52_FOOTER = BEL3;
|
|
|
47428
47434
|
var MAX_OSC52_BODY_B64_BYTES = MAX_OSC52_SEQUENCE_BYTES - Buffer.byteLength(OSC52_HEADER) - Buffer.byteLength(OSC52_FOOTER);
|
|
47429
47435
|
var MAX_OSC52_DATA_BYTES = Math.floor(MAX_OSC52_BODY_B64_BYTES / 4) * 3;
|
|
47430
47436
|
var SCREEN_DCS_CHUNK_SIZE = 240;
|
|
47431
|
-
var pickTty = () => new Promise((
|
|
47437
|
+
var pickTty = () => new Promise((resolve9) => {
|
|
47432
47438
|
if (process.platform !== "win32") {
|
|
47433
47439
|
try {
|
|
47434
47440
|
const devTty = fs22.createWriteStream("/dev/tty");
|
|
@@ -47436,25 +47442,25 @@ var pickTty = () => new Promise((resolve8) => {
|
|
|
47436
47442
|
devTty.removeAllListeners("open");
|
|
47437
47443
|
devTty.removeAllListeners("error");
|
|
47438
47444
|
devTty.destroy();
|
|
47439
|
-
|
|
47445
|
+
resolve9(getStdioTty());
|
|
47440
47446
|
}, 100);
|
|
47441
47447
|
devTty.once("open", () => {
|
|
47442
47448
|
clearTimeout(timeout);
|
|
47443
47449
|
devTty.removeAllListeners("error");
|
|
47444
47450
|
devTty.on("error", () => {
|
|
47445
47451
|
});
|
|
47446
|
-
|
|
47452
|
+
resolve9({ stream: devTty, closeAfter: true });
|
|
47447
47453
|
});
|
|
47448
47454
|
devTty.once("error", () => {
|
|
47449
47455
|
clearTimeout(timeout);
|
|
47450
47456
|
devTty.removeAllListeners("open");
|
|
47451
|
-
|
|
47457
|
+
resolve9(getStdioTty());
|
|
47452
47458
|
});
|
|
47453
47459
|
return;
|
|
47454
47460
|
} catch {
|
|
47455
47461
|
}
|
|
47456
47462
|
}
|
|
47457
|
-
|
|
47463
|
+
resolve9(getStdioTty());
|
|
47458
47464
|
});
|
|
47459
47465
|
var getStdioTty = () => {
|
|
47460
47466
|
if (process.platform === "win32") {
|
|
@@ -47508,12 +47514,12 @@ var wrapForScreen = (seq) => {
|
|
|
47508
47514
|
}
|
|
47509
47515
|
return out;
|
|
47510
47516
|
};
|
|
47511
|
-
var writeAll = (stream, data) => new Promise((
|
|
47517
|
+
var writeAll = (stream, data) => new Promise((resolve9, reject) => {
|
|
47512
47518
|
const fd = stream.fd;
|
|
47513
47519
|
if (process.platform === "win32" && typeof fd === "number" && (stream === process.stdout || stream === process.stderr)) {
|
|
47514
47520
|
try {
|
|
47515
47521
|
fs22.writeSync(fd, data);
|
|
47516
|
-
|
|
47522
|
+
resolve9();
|
|
47517
47523
|
return;
|
|
47518
47524
|
} catch (e) {
|
|
47519
47525
|
debugLogger.warn(
|
|
@@ -47528,7 +47534,7 @@ var writeAll = (stream, data) => new Promise((resolve8, reject) => {
|
|
|
47528
47534
|
};
|
|
47529
47535
|
const onDrain = () => {
|
|
47530
47536
|
cleanup();
|
|
47531
|
-
|
|
47537
|
+
resolve9();
|
|
47532
47538
|
};
|
|
47533
47539
|
const cleanup = () => {
|
|
47534
47540
|
stream.off("error", onError);
|
|
@@ -47537,7 +47543,7 @@ var writeAll = (stream, data) => new Promise((resolve8, reject) => {
|
|
|
47537
47543
|
stream.once("error", onError);
|
|
47538
47544
|
if (stream.write(data)) {
|
|
47539
47545
|
cleanup();
|
|
47540
|
-
|
|
47546
|
+
resolve9();
|
|
47541
47547
|
} else {
|
|
47542
47548
|
stream.once("drain", onDrain);
|
|
47543
47549
|
}
|
|
@@ -47667,14 +47673,14 @@ function getUserLinuxClipboardTool() {
|
|
|
47667
47673
|
}
|
|
47668
47674
|
}
|
|
47669
47675
|
async function saveFromCommand(command, args, destination) {
|
|
47670
|
-
return new Promise((
|
|
47676
|
+
return new Promise((resolve9) => {
|
|
47671
47677
|
const child = spawn(command, args);
|
|
47672
47678
|
const fileStream = createWriteStream2(destination);
|
|
47673
47679
|
let resolved = false;
|
|
47674
47680
|
const safeResolve = (value) => {
|
|
47675
47681
|
if (!resolved) {
|
|
47676
47682
|
resolved = true;
|
|
47677
|
-
|
|
47683
|
+
resolve9(value);
|
|
47678
47684
|
}
|
|
47679
47685
|
};
|
|
47680
47686
|
child.stdout.pipe(fileStream);
|
|
@@ -49532,7 +49538,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49532
49538
|
throw err;
|
|
49533
49539
|
}
|
|
49534
49540
|
} else {
|
|
49535
|
-
await new Promise((
|
|
49541
|
+
await new Promise((resolve9, reject) => {
|
|
49536
49542
|
const child = spawn2(executable, [...initialArgs, ...args], {
|
|
49537
49543
|
stdio: "inherit",
|
|
49538
49544
|
shell: process.platform === "win32"
|
|
@@ -49557,7 +49563,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49557
49563
|
);
|
|
49558
49564
|
reject(err);
|
|
49559
49565
|
} else {
|
|
49560
|
-
|
|
49566
|
+
resolve9();
|
|
49561
49567
|
}
|
|
49562
49568
|
});
|
|
49563
49569
|
});
|
|
@@ -53935,14 +53941,17 @@ var FileCommandLoader = class {
|
|
|
53935
53941
|
getCommandDirectories() {
|
|
53936
53942
|
const dirs = [];
|
|
53937
53943
|
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
53944
|
+
const userCommandsDir = Storage.getUserCommandsDir();
|
|
53938
53945
|
dirs.push({
|
|
53939
|
-
path:
|
|
53946
|
+
path: userCommandsDir,
|
|
53940
53947
|
kind: "user-file" /* USER_FILE */
|
|
53941
53948
|
});
|
|
53942
|
-
|
|
53943
|
-
|
|
53944
|
-
|
|
53945
|
-
|
|
53949
|
+
if (!storage.isWorkspaceHomeDir()) {
|
|
53950
|
+
dirs.push({
|
|
53951
|
+
path: storage.getProjectCommandsDir(),
|
|
53952
|
+
kind: "workspace-file" /* WORKSPACE_FILE */
|
|
53953
|
+
});
|
|
53954
|
+
}
|
|
53946
53955
|
if (this.config) {
|
|
53947
53956
|
const activeExtensions = this.config.getExtensions().filter((ext) => ext.isActive).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
53948
53957
|
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
@@ -55947,10 +55956,10 @@ function enableFeature(settings, featureName, strategy) {
|
|
|
55947
55956
|
};
|
|
55948
55957
|
}
|
|
55949
55958
|
const modifiedScopes = [];
|
|
55950
|
-
for (const { scope, path:
|
|
55959
|
+
for (const { scope, path: path38 } of foundInDisabledScopes) {
|
|
55951
55960
|
if (isLoadableSettingScope(scope)) {
|
|
55952
55961
|
strategy.enable(settings, scope, featureName);
|
|
55953
|
-
modifiedScopes.push({ scope, path:
|
|
55962
|
+
modifiedScopes.push({ scope, path: path38 });
|
|
55954
55963
|
}
|
|
55955
55964
|
}
|
|
55956
55965
|
return {
|
|
@@ -56441,7 +56450,7 @@ var authCommand = {
|
|
|
56441
56450
|
import process28 from "node:process";
|
|
56442
56451
|
|
|
56443
56452
|
// packages/cli/src/generated/git-commit.ts
|
|
56444
|
-
var GIT_COMMIT_INFO = "
|
|
56453
|
+
var GIT_COMMIT_INFO = "5ee05c775";
|
|
56445
56454
|
|
|
56446
56455
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
56447
56456
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -57106,7 +57115,7 @@ var clearCommand = {
|
|
|
57106
57115
|
if (hookSystem) {
|
|
57107
57116
|
result = await hookSystem.fireSessionStartEvent("clear" /* Clear */);
|
|
57108
57117
|
}
|
|
57109
|
-
await new Promise((
|
|
57118
|
+
await new Promise((resolve9) => setImmediate(resolve9));
|
|
57110
57119
|
if (config) {
|
|
57111
57120
|
await flushTelemetry(config);
|
|
57112
57121
|
}
|
|
@@ -57380,10 +57389,85 @@ ${docsUrl}`
|
|
|
57380
57389
|
}
|
|
57381
57390
|
};
|
|
57382
57391
|
|
|
57392
|
+
// packages/cli/src/ui/commands/exportSessionCommand.ts
|
|
57393
|
+
import * as fs30 from "node:fs/promises";
|
|
57394
|
+
import * as path27 from "node:path";
|
|
57395
|
+
var exportSessionCommand = {
|
|
57396
|
+
name: "export-session",
|
|
57397
|
+
description: "Export the current session to a JSON file",
|
|
57398
|
+
kind: "built-in" /* BUILT_IN */,
|
|
57399
|
+
autoExecute: true,
|
|
57400
|
+
action: async (context) => {
|
|
57401
|
+
const { ui: ui2 } = context;
|
|
57402
|
+
const args = context.invocation?.args.trim();
|
|
57403
|
+
if (!args) {
|
|
57404
|
+
return {
|
|
57405
|
+
type: "message",
|
|
57406
|
+
messageType: "error",
|
|
57407
|
+
content: "Please provide a file path to export the session to. Example: /export-session ./my-session.json"
|
|
57408
|
+
};
|
|
57409
|
+
}
|
|
57410
|
+
const sessionId = context.services.agentContext?.config.getSessionId();
|
|
57411
|
+
if (!sessionId) {
|
|
57412
|
+
return {
|
|
57413
|
+
type: "message",
|
|
57414
|
+
messageType: "error",
|
|
57415
|
+
content: "No active session found to export."
|
|
57416
|
+
};
|
|
57417
|
+
}
|
|
57418
|
+
if (ui2.pendingItem) {
|
|
57419
|
+
ui2.addItem(
|
|
57420
|
+
{
|
|
57421
|
+
type: "error" /* ERROR */,
|
|
57422
|
+
text: "Operation already in progress, please wait."
|
|
57423
|
+
},
|
|
57424
|
+
Date.now()
|
|
57425
|
+
);
|
|
57426
|
+
return;
|
|
57427
|
+
}
|
|
57428
|
+
const pendingMessage = {
|
|
57429
|
+
type: "export_session" /* EXPORT_SESSION */,
|
|
57430
|
+
exportSession: {
|
|
57431
|
+
isPending: true
|
|
57432
|
+
}
|
|
57433
|
+
};
|
|
57434
|
+
try {
|
|
57435
|
+
ui2.setPendingItem(pendingMessage);
|
|
57436
|
+
const storage = context.services.agentContext.config.storage;
|
|
57437
|
+
const sessionSelector = new SessionSelector(storage);
|
|
57438
|
+
const { sessionData } = await sessionSelector.resolveSession(sessionId);
|
|
57439
|
+
const targetPath = path27.resolve(process.cwd(), args);
|
|
57440
|
+
await fs30.writeFile(
|
|
57441
|
+
targetPath,
|
|
57442
|
+
JSON.stringify(sessionData, null, 2),
|
|
57443
|
+
"utf-8"
|
|
57444
|
+
);
|
|
57445
|
+
ui2.addItem(
|
|
57446
|
+
{
|
|
57447
|
+
type: "export_session" /* EXPORT_SESSION */,
|
|
57448
|
+
exportSession: {
|
|
57449
|
+
isPending: false,
|
|
57450
|
+
targetPath
|
|
57451
|
+
}
|
|
57452
|
+
},
|
|
57453
|
+
Date.now()
|
|
57454
|
+
);
|
|
57455
|
+
} catch (error) {
|
|
57456
|
+
return {
|
|
57457
|
+
type: "message",
|
|
57458
|
+
messageType: "error",
|
|
57459
|
+
content: `Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
57460
|
+
};
|
|
57461
|
+
} finally {
|
|
57462
|
+
ui2.setPendingItem(null);
|
|
57463
|
+
}
|
|
57464
|
+
}
|
|
57465
|
+
};
|
|
57466
|
+
|
|
57383
57467
|
// packages/cli/src/ui/commands/directoryCommand.tsx
|
|
57384
57468
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
57385
|
-
import * as
|
|
57386
|
-
import * as
|
|
57469
|
+
import * as path28 from "node:path";
|
|
57470
|
+
import * as fs31 from "node:fs";
|
|
57387
57471
|
async function finishAddingDirectories(config, addItem, added, errors) {
|
|
57388
57472
|
if (!config) {
|
|
57389
57473
|
addItem({
|
|
@@ -57451,15 +57535,15 @@ var directoryCommand = {
|
|
|
57451
57535
|
if (context.services.agentContext?.config) {
|
|
57452
57536
|
const workspaceContext = context.services.agentContext.config.getWorkspaceContext();
|
|
57453
57537
|
const existingDirs = new Set(
|
|
57454
|
-
workspaceContext.getDirectories().map((dir) =>
|
|
57538
|
+
workspaceContext.getDirectories().map((dir) => path28.resolve(dir))
|
|
57455
57539
|
);
|
|
57456
57540
|
filteredSuggestions = suggestions.filter((s3) => {
|
|
57457
57541
|
const expanded = expandHomeDir(s3);
|
|
57458
|
-
const absolute =
|
|
57542
|
+
const absolute = path28.resolve(expanded);
|
|
57459
57543
|
if (existingDirs.has(absolute)) {
|
|
57460
57544
|
return false;
|
|
57461
57545
|
}
|
|
57462
|
-
if (absolute.endsWith(
|
|
57546
|
+
if (absolute.endsWith(path28.sep) && existingDirs.has(absolute.slice(0, -1))) {
|
|
57463
57547
|
return false;
|
|
57464
57548
|
}
|
|
57465
57549
|
return true;
|
|
@@ -57509,11 +57593,11 @@ var directoryCommand = {
|
|
|
57509
57593
|
const trimmedPath = pathToAdd.trim();
|
|
57510
57594
|
const expandedPath = expandHomeDir(trimmedPath);
|
|
57511
57595
|
try {
|
|
57512
|
-
const absolutePath =
|
|
57596
|
+
const absolutePath = path28.resolve(
|
|
57513
57597
|
workspaceContext.targetDir,
|
|
57514
57598
|
expandedPath
|
|
57515
57599
|
);
|
|
57516
|
-
const resolvedPath =
|
|
57600
|
+
const resolvedPath = fs31.realpathSync(absolutePath);
|
|
57517
57601
|
if (currentWorkspaceDirs.includes(resolvedPath)) {
|
|
57518
57602
|
alreadyAdded.push(trimmedPath);
|
|
57519
57603
|
continue;
|
|
@@ -57539,7 +57623,7 @@ var directoryCommand = {
|
|
|
57539
57623
|
const dirsToConfirm = [];
|
|
57540
57624
|
const trustedDirs = [];
|
|
57541
57625
|
for (const pathToAdd of pathsToProcess) {
|
|
57542
|
-
const expandedPath =
|
|
57626
|
+
const expandedPath = path28.resolve(expandHomeDir(pathToAdd.trim()));
|
|
57543
57627
|
const isTrusted = trustedFolders.isPathTrusted(expandedPath);
|
|
57544
57628
|
if (isTrusted === true) {
|
|
57545
57629
|
trustedDirs.push(pathToAdd.trim());
|
|
@@ -57760,14 +57844,14 @@ var ConfigExtensionDialog = ({
|
|
|
57760
57844
|
[loggerAdapter]
|
|
57761
57845
|
);
|
|
57762
57846
|
const requestSetting = (0, import_react62.useCallback)(
|
|
57763
|
-
async (setting) => new Promise((
|
|
57847
|
+
async (setting) => new Promise((resolve9) => {
|
|
57764
57848
|
if (!mounted.current) return;
|
|
57765
57849
|
settingBuffer.setText("");
|
|
57766
57850
|
setState({
|
|
57767
57851
|
type: "ASK_SETTING",
|
|
57768
57852
|
setting,
|
|
57769
57853
|
resolve: (val) => {
|
|
57770
|
-
|
|
57854
|
+
resolve9(val);
|
|
57771
57855
|
setState({ type: "BUSY", message: "Updating..." });
|
|
57772
57856
|
}
|
|
57773
57857
|
});
|
|
@@ -57775,13 +57859,13 @@ var ConfigExtensionDialog = ({
|
|
|
57775
57859
|
[settingBuffer]
|
|
57776
57860
|
);
|
|
57777
57861
|
const requestConfirmation = (0, import_react62.useCallback)(
|
|
57778
|
-
async (message) => new Promise((
|
|
57862
|
+
async (message) => new Promise((resolve9) => {
|
|
57779
57863
|
if (!mounted.current) return;
|
|
57780
57864
|
setState({
|
|
57781
57865
|
type: "ASK_CONFIRMATION",
|
|
57782
57866
|
message,
|
|
57783
57867
|
resolve: (val) => {
|
|
57784
|
-
|
|
57868
|
+
resolve9(val);
|
|
57785
57869
|
setState({ type: "BUSY", message: "Processing..." });
|
|
57786
57870
|
}
|
|
57787
57871
|
});
|
|
@@ -58118,7 +58202,7 @@ function SearchableList({
|
|
|
58118
58202
|
var import_react64 = __toESM(require_react(), 1);
|
|
58119
58203
|
|
|
58120
58204
|
// packages/cli/src/config/extensionRegistryClient.ts
|
|
58121
|
-
import * as
|
|
58205
|
+
import * as fs32 from "node:fs/promises";
|
|
58122
58206
|
var ExtensionRegistryClient = class _ExtensionRegistryClient {
|
|
58123
58207
|
static DEFAULT_REGISTRY_URL = "https://geminicli.com/extensions.json";
|
|
58124
58208
|
static FETCH_TIMEOUT_MS = 1e4;
|
|
@@ -58196,7 +58280,7 @@ var ExtensionRegistryClient = class _ExtensionRegistryClient {
|
|
|
58196
58280
|
return await response.json();
|
|
58197
58281
|
} else {
|
|
58198
58282
|
const filePath = resolveToRealPath(uri);
|
|
58199
|
-
const content = await
|
|
58283
|
+
const content = await fs32.readFile(filePath, "utf-8");
|
|
58200
58284
|
return JSON.parse(content);
|
|
58201
58285
|
}
|
|
58202
58286
|
} catch (error) {
|
|
@@ -58367,8 +58451,8 @@ function ExtensionDetails({
|
|
|
58367
58451
|
if (keyMatchers["basic.confirm" /* RETURN */](key) && !isInstalled && !isInstalling) {
|
|
58368
58452
|
setIsInstalling(true);
|
|
58369
58453
|
void onInstall(
|
|
58370
|
-
(prompt) => new Promise((
|
|
58371
|
-
setConsentRequest({ prompt, resolve:
|
|
58454
|
+
(prompt) => new Promise((resolve9) => {
|
|
58455
|
+
setConsentRequest({ prompt, resolve: resolve9 });
|
|
58372
58456
|
})
|
|
58373
58457
|
);
|
|
58374
58458
|
return true;
|
|
@@ -58376,8 +58460,8 @@ function ExtensionDetails({
|
|
|
58376
58460
|
if (keyMatchers["extension.link" /* LINK_EXTENSION */](key) && isLinkable && !isInstalled && !isInstalling) {
|
|
58377
58461
|
setIsInstalling(true);
|
|
58378
58462
|
void onLink(
|
|
58379
|
-
(prompt) => new Promise((
|
|
58380
|
-
setConsentRequest({ prompt, resolve:
|
|
58463
|
+
(prompt) => new Promise((resolve9) => {
|
|
58464
|
+
setConsentRequest({ prompt, resolve: resolve9 });
|
|
58381
58465
|
})
|
|
58382
58466
|
);
|
|
58383
58467
|
return true;
|
|
@@ -58781,7 +58865,7 @@ function updateAction(context, args) {
|
|
|
58781
58865
|
}
|
|
58782
58866
|
let resolveUpdateComplete;
|
|
58783
58867
|
const updateComplete = new Promise(
|
|
58784
|
-
(
|
|
58868
|
+
(resolve9) => resolveUpdateComplete = resolve9
|
|
58785
58869
|
);
|
|
58786
58870
|
const extensions = context.services.agentContext?.config ? listExtensions(context.services.agentContext.config) : [];
|
|
58787
58871
|
if (showMessageIfNoExtensions(context, extensions)) {
|
|
@@ -59490,6 +59574,7 @@ var ConsoleSummaryDisplay = ({
|
|
|
59490
59574
|
|
|
59491
59575
|
// packages/cli/src/ui/components/Footer.tsx
|
|
59492
59576
|
import process33 from "node:process";
|
|
59577
|
+
import os7 from "node:os";
|
|
59493
59578
|
|
|
59494
59579
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
59495
59580
|
var import_react69 = __toESM(require_react(), 1);
|
|
@@ -59660,6 +59745,11 @@ var ALL_ITEMS = [
|
|
|
59660
59745
|
header: "session",
|
|
59661
59746
|
description: "Unique identifier for the current session"
|
|
59662
59747
|
},
|
|
59748
|
+
{
|
|
59749
|
+
id: "hostname",
|
|
59750
|
+
header: "machine",
|
|
59751
|
+
description: "Current machine hostname"
|
|
59752
|
+
},
|
|
59663
59753
|
{
|
|
59664
59754
|
id: "auth",
|
|
59665
59755
|
header: "/auth",
|
|
@@ -59685,6 +59775,7 @@ var DEFAULT_ORDER = [
|
|
|
59685
59775
|
"quota",
|
|
59686
59776
|
"memory-usage",
|
|
59687
59777
|
"session-id",
|
|
59778
|
+
"hostname",
|
|
59688
59779
|
"auth",
|
|
59689
59780
|
"code-changes",
|
|
59690
59781
|
"token-count"
|
|
@@ -59733,6 +59824,7 @@ function resolveFooterState(settings) {
|
|
|
59733
59824
|
|
|
59734
59825
|
// packages/cli/src/ui/components/Footer.tsx
|
|
59735
59826
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
59827
|
+
var HOSTNAME = os7.hostname();
|
|
59736
59828
|
var CwdIndicator = ({
|
|
59737
59829
|
targetDir,
|
|
59738
59830
|
maxWidth,
|
|
@@ -60008,6 +60100,15 @@ var Footer = () => {
|
|
|
60008
60100
|
);
|
|
60009
60101
|
break;
|
|
60010
60102
|
}
|
|
60103
|
+
case "hostname": {
|
|
60104
|
+
addCol(
|
|
60105
|
+
id,
|
|
60106
|
+
header,
|
|
60107
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: itemColor, children: HOSTNAME }),
|
|
60108
|
+
HOSTNAME.length
|
|
60109
|
+
);
|
|
60110
|
+
break;
|
|
60111
|
+
}
|
|
60011
60112
|
case "auth": {
|
|
60012
60113
|
if (!settings.merged.ui.showUserIdentity) break;
|
|
60013
60114
|
if (!authType) break;
|
|
@@ -60285,6 +60386,7 @@ var FooterConfigDialog = ({
|
|
|
60285
60386
|
quota: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("quota", itemColor), children: "42% used" }),
|
|
60286
60387
|
"memory-usage": /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("memory-usage", itemColor), children: "260 MB" }),
|
|
60287
60388
|
"session-id": /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("session-id", itemColor), children: "769992f9" }),
|
|
60389
|
+
hostname: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("hostname", itemColor), children: "dev-machine" }),
|
|
60288
60390
|
"code-changes": /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
60289
60391
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("code-changes", theme.status.success), children: "+12" }),
|
|
60290
60392
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("code-changes"), children: " " }),
|
|
@@ -60454,7 +60556,7 @@ var import_react74 = __toESM(require_react(), 1);
|
|
|
60454
60556
|
var import_react72 = __toESM(require_react(), 1);
|
|
60455
60557
|
|
|
60456
60558
|
// packages/cli/src/ui/utils/rewindFileOps.ts
|
|
60457
|
-
import
|
|
60559
|
+
import fs33 from "node:fs/promises";
|
|
60458
60560
|
function calculateTurnStats(conversation, userMessage) {
|
|
60459
60561
|
const msgIndex = conversation.messages.indexOf(userMessage);
|
|
60460
60562
|
if (msgIndex === -1) return null;
|
|
@@ -60541,7 +60643,7 @@ async function revertFileChanges(conversation, targetMessageId) {
|
|
|
60541
60643
|
try {
|
|
60542
60644
|
let currentContent = null;
|
|
60543
60645
|
try {
|
|
60544
|
-
currentContent = await
|
|
60646
|
+
currentContent = await fs33.readFile(filePath, "utf8");
|
|
60545
60647
|
} catch (e) {
|
|
60546
60648
|
const error = e;
|
|
60547
60649
|
if ("code" in error && error.code === "ENOENT") {
|
|
@@ -60559,9 +60661,9 @@ async function revertFileChanges(conversation, targetMessageId) {
|
|
|
60559
60661
|
}
|
|
60560
60662
|
if (currentContent === newContent) {
|
|
60561
60663
|
if (!isNewFile2) {
|
|
60562
|
-
await
|
|
60664
|
+
await fs33.writeFile(filePath, originalContent ?? "");
|
|
60563
60665
|
} else {
|
|
60564
|
-
await
|
|
60666
|
+
await fs33.unlink(filePath);
|
|
60565
60667
|
}
|
|
60566
60668
|
} else if (currentContent !== null) {
|
|
60567
60669
|
const originalText = originalContent ?? "";
|
|
@@ -60573,9 +60675,9 @@ async function revertFileChanges(conversation, targetMessageId) {
|
|
|
60573
60675
|
const patchedContent = applyPatch(currentContent, undoPatch);
|
|
60574
60676
|
if (typeof patchedContent === "string") {
|
|
60575
60677
|
if (patchedContent === "" && isNewFile2) {
|
|
60576
|
-
await
|
|
60678
|
+
await fs33.unlink(filePath);
|
|
60577
60679
|
} else {
|
|
60578
|
-
await
|
|
60680
|
+
await fs33.writeFile(filePath, patchedContent);
|
|
60579
60681
|
}
|
|
60580
60682
|
} else {
|
|
60581
60683
|
coreEvents.emitFeedback(
|
|
@@ -61211,14 +61313,14 @@ function enableHook(settings, hookName) {
|
|
|
61211
61313
|
}
|
|
61212
61314
|
const modifiedScopes = [];
|
|
61213
61315
|
try {
|
|
61214
|
-
for (const { scope, path:
|
|
61316
|
+
for (const { scope, path: path38 } of foundInDisabledScopes) {
|
|
61215
61317
|
if (isLoadableSettingScope(scope)) {
|
|
61216
61318
|
const currentScopeDisabled = settings.forScope(scope).settings.hooksConfig?.disabled ?? [];
|
|
61217
61319
|
const newDisabled = currentScopeDisabled.filter(
|
|
61218
61320
|
(name) => name !== hookName
|
|
61219
61321
|
);
|
|
61220
61322
|
settings.setValue(scope, "hooksConfig.disabled", newDisabled);
|
|
61221
|
-
modifiedScopes.push({ scope, path:
|
|
61323
|
+
modifiedScopes.push({ scope, path: path38 });
|
|
61222
61324
|
}
|
|
61223
61325
|
}
|
|
61224
61326
|
} catch (error) {
|
|
@@ -61513,7 +61615,7 @@ async function enableAction3(context, args) {
|
|
|
61513
61615
|
}
|
|
61514
61616
|
const feedback = renderHookActionFeedback(
|
|
61515
61617
|
result,
|
|
61516
|
-
(label,
|
|
61618
|
+
(label, path38) => `${label} (${path38})`
|
|
61517
61619
|
);
|
|
61518
61620
|
return {
|
|
61519
61621
|
type: "message",
|
|
@@ -61555,7 +61657,7 @@ async function disableAction3(context, args) {
|
|
|
61555
61657
|
}
|
|
61556
61658
|
const feedback = renderHookActionFeedback(
|
|
61557
61659
|
result,
|
|
61558
|
-
(label,
|
|
61660
|
+
(label, path38) => `${label} (${path38})`
|
|
61559
61661
|
);
|
|
61560
61662
|
return {
|
|
61561
61663
|
type: "message",
|
|
@@ -61754,7 +61856,7 @@ var hooksCommand = {
|
|
|
61754
61856
|
};
|
|
61755
61857
|
|
|
61756
61858
|
// packages/cli/src/ui/commands/ideCommand.ts
|
|
61757
|
-
import
|
|
61859
|
+
import path29 from "node:path";
|
|
61758
61860
|
function getIdeStatusMessage(ideClient) {
|
|
61759
61861
|
const connection = ideClient.getConnectionStatus();
|
|
61760
61862
|
switch (connection.status) {
|
|
@@ -61783,13 +61885,13 @@ function getIdeStatusMessage(ideClient) {
|
|
|
61783
61885
|
function formatFileList(openFiles) {
|
|
61784
61886
|
const basenameCounts = /* @__PURE__ */ new Map();
|
|
61785
61887
|
for (const file of openFiles) {
|
|
61786
|
-
const basename6 =
|
|
61888
|
+
const basename6 = path29.basename(file.path);
|
|
61787
61889
|
basenameCounts.set(basename6, (basenameCounts.get(basename6) || 0) + 1);
|
|
61788
61890
|
}
|
|
61789
61891
|
const fileList = openFiles.map((file) => {
|
|
61790
|
-
const basename6 =
|
|
61892
|
+
const basename6 = path29.basename(file.path);
|
|
61791
61893
|
const isDuplicate = (basenameCounts.get(basename6) || 0) > 1;
|
|
61792
|
-
const parentDir =
|
|
61894
|
+
const parentDir = path29.basename(path29.dirname(file.path));
|
|
61793
61895
|
const displayName = isDuplicate ? `${basename6} (/${parentDir})` : basename6;
|
|
61794
61896
|
return ` - ${displayName}${file.isActive ? " (active)" : ""}`;
|
|
61795
61897
|
}).join("\n");
|
|
@@ -61929,7 +62031,7 @@ var ideCommand = async () => {
|
|
|
61929
62031
|
if (ideClient.getConnectionStatus().status === "connected" /* Connected */) {
|
|
61930
62032
|
break;
|
|
61931
62033
|
}
|
|
61932
|
-
await new Promise((
|
|
62034
|
+
await new Promise((resolve9) => setTimeout(resolve9, 500));
|
|
61933
62035
|
}
|
|
61934
62036
|
const { messageType, content } = getIdeStatusMessage(ideClient);
|
|
61935
62037
|
if (messageType === "error") {
|
|
@@ -62017,8 +62119,8 @@ var ideCommand = async () => {
|
|
|
62017
62119
|
};
|
|
62018
62120
|
|
|
62019
62121
|
// packages/cli/src/ui/commands/initCommand.ts
|
|
62020
|
-
import * as
|
|
62021
|
-
import * as
|
|
62122
|
+
import * as fs34 from "node:fs";
|
|
62123
|
+
import * as path30 from "node:path";
|
|
62022
62124
|
var initCommand = {
|
|
62023
62125
|
name: "init",
|
|
62024
62126
|
description: "Analyzes the project and creates a tailored GEMINI.md file",
|
|
@@ -62033,10 +62135,10 @@ var initCommand = {
|
|
|
62033
62135
|
};
|
|
62034
62136
|
}
|
|
62035
62137
|
const targetDir = context.services.agentContext.config.getTargetDir();
|
|
62036
|
-
const geminiMdPath =
|
|
62037
|
-
const result = performInit(
|
|
62138
|
+
const geminiMdPath = path30.join(targetDir, "GEMINI.md");
|
|
62139
|
+
const result = performInit(fs34.existsSync(geminiMdPath));
|
|
62038
62140
|
if (result.type === "submit_prompt") {
|
|
62039
|
-
|
|
62141
|
+
fs34.writeFileSync(geminiMdPath, "", "utf8");
|
|
62040
62142
|
context.ui.addItem(
|
|
62041
62143
|
{
|
|
62042
62144
|
type: "info",
|
|
@@ -62109,7 +62211,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
62109
62211
|
type: "info",
|
|
62110
62212
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
62111
62213
|
});
|
|
62112
|
-
const { MCPOAuthProvider } = await import("./core-
|
|
62214
|
+
const { MCPOAuthProvider } = await import("./core-GS6NXK7Y.js");
|
|
62113
62215
|
let oauthConfig = server.oauth;
|
|
62114
62216
|
if (!oauthConfig) {
|
|
62115
62217
|
oauthConfig = { enabled: false };
|
|
@@ -62477,7 +62579,7 @@ var import_react81 = __toESM(require_react(), 1);
|
|
|
62477
62579
|
|
|
62478
62580
|
// packages/cli/src/ui/components/InboxDialog.tsx
|
|
62479
62581
|
var import_react80 = __toESM(require_react(), 1);
|
|
62480
|
-
import * as
|
|
62582
|
+
import * as path32 from "node:path";
|
|
62481
62583
|
|
|
62482
62584
|
// packages/cli/src/ui/components/messages/DiffRenderer.tsx
|
|
62483
62585
|
var import_react79 = __toESM(require_react(), 1);
|
|
@@ -76275,10 +76377,10 @@ function colorizeCode({
|
|
|
76275
76377
|
}
|
|
76276
76378
|
|
|
76277
76379
|
// packages/cli/src/ui/utils/fileUtils.ts
|
|
76278
|
-
import * as
|
|
76380
|
+
import * as path31 from "node:path";
|
|
76279
76381
|
function getFileExtension(filename) {
|
|
76280
76382
|
if (!filename) return null;
|
|
76281
|
-
const ext =
|
|
76383
|
+
const ext = path31.extname(filename);
|
|
76282
76384
|
return ext ? ext.slice(1) : null;
|
|
76283
76385
|
}
|
|
76284
76386
|
|
|
@@ -76641,11 +76743,11 @@ var MEMORY_PATCH_ACTION_CHOICES = [
|
|
|
76641
76743
|
}
|
|
76642
76744
|
];
|
|
76643
76745
|
function normalizePathForUi(filePath) {
|
|
76644
|
-
return
|
|
76746
|
+
return path32.posix.normalize(filePath.replaceAll("\\", "/"));
|
|
76645
76747
|
}
|
|
76646
76748
|
function getPathBasename(filePath) {
|
|
76647
76749
|
const normalizedPath = normalizePathForUi(filePath);
|
|
76648
|
-
const basename6 =
|
|
76750
|
+
const basename6 = path32.posix.basename(normalizedPath);
|
|
76649
76751
|
return basename6 === "." ? filePath : basename6;
|
|
76650
76752
|
}
|
|
76651
76753
|
function formatMemoryPatchSummary(patch) {
|
|
@@ -77602,97 +77704,62 @@ var InboxDialog = ({
|
|
|
77602
77704
|
};
|
|
77603
77705
|
|
|
77604
77706
|
// packages/cli/src/ui/commands/memoryCommand.ts
|
|
77605
|
-
var
|
|
77606
|
-
name: "
|
|
77607
|
-
description: "
|
|
77707
|
+
var showSubCommand = {
|
|
77708
|
+
name: "show",
|
|
77709
|
+
description: "Show the current memory contents",
|
|
77710
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77711
|
+
autoExecute: true,
|
|
77712
|
+
action: async (context) => {
|
|
77713
|
+
const config = context.services.agentContext?.config;
|
|
77714
|
+
if (!config) return;
|
|
77715
|
+
const result = showMemory(config);
|
|
77716
|
+
context.ui.addItem(
|
|
77717
|
+
{
|
|
77718
|
+
type: "info" /* INFO */,
|
|
77719
|
+
text: result.content
|
|
77720
|
+
},
|
|
77721
|
+
Date.now()
|
|
77722
|
+
);
|
|
77723
|
+
}
|
|
77724
|
+
};
|
|
77725
|
+
var addSubCommand = {
|
|
77726
|
+
name: "add",
|
|
77727
|
+
description: "Add content to the memory",
|
|
77608
77728
|
kind: "built-in" /* BUILT_IN */,
|
|
77609
77729
|
autoExecute: false,
|
|
77610
|
-
|
|
77611
|
-
|
|
77612
|
-
|
|
77613
|
-
|
|
77614
|
-
|
|
77615
|
-
|
|
77616
|
-
|
|
77617
|
-
|
|
77618
|
-
|
|
77619
|
-
|
|
77620
|
-
|
|
77621
|
-
|
|
77622
|
-
|
|
77623
|
-
|
|
77624
|
-
|
|
77625
|
-
|
|
77626
|
-
|
|
77627
|
-
|
|
77628
|
-
|
|
77629
|
-
|
|
77630
|
-
|
|
77631
|
-
|
|
77632
|
-
|
|
77633
|
-
|
|
77634
|
-
|
|
77635
|
-
|
|
77636
|
-
|
|
77637
|
-
|
|
77638
|
-
|
|
77639
|
-
|
|
77640
|
-
|
|
77641
|
-
|
|
77642
|
-
|
|
77643
|
-
},
|
|
77644
|
-
Date.now()
|
|
77645
|
-
);
|
|
77646
|
-
return result;
|
|
77647
|
-
}
|
|
77648
|
-
},
|
|
77649
|
-
{
|
|
77650
|
-
name: "reload",
|
|
77651
|
-
altNames: ["refresh"],
|
|
77652
|
-
description: "Reload the memory from the source",
|
|
77653
|
-
kind: "built-in" /* BUILT_IN */,
|
|
77654
|
-
autoExecute: true,
|
|
77655
|
-
action: async (context) => {
|
|
77656
|
-
context.ui.addItem(
|
|
77657
|
-
{
|
|
77658
|
-
type: "info" /* INFO */,
|
|
77659
|
-
text: "Reloading memory from source files..."
|
|
77660
|
-
},
|
|
77661
|
-
Date.now()
|
|
77662
|
-
);
|
|
77663
|
-
try {
|
|
77664
|
-
const config = context.services.agentContext?.config;
|
|
77665
|
-
if (config) {
|
|
77666
|
-
const result = await refreshMemory(config);
|
|
77667
|
-
context.ui.addItem(
|
|
77668
|
-
{
|
|
77669
|
-
type: "info" /* INFO */,
|
|
77670
|
-
text: result.content
|
|
77671
|
-
},
|
|
77672
|
-
Date.now()
|
|
77673
|
-
);
|
|
77674
|
-
}
|
|
77675
|
-
} catch (error) {
|
|
77676
|
-
context.ui.addItem(
|
|
77677
|
-
{
|
|
77678
|
-
type: "error" /* ERROR */,
|
|
77679
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
77680
|
-
text: `Error reloading memory: ${error.message}`
|
|
77681
|
-
},
|
|
77682
|
-
Date.now()
|
|
77683
|
-
);
|
|
77684
|
-
}
|
|
77685
|
-
}
|
|
77686
|
-
},
|
|
77687
|
-
{
|
|
77688
|
-
name: "list",
|
|
77689
|
-
description: "Lists the paths of the GEMINI.md files in use",
|
|
77690
|
-
kind: "built-in" /* BUILT_IN */,
|
|
77691
|
-
autoExecute: true,
|
|
77692
|
-
action: async (context) => {
|
|
77693
|
-
const config = context.services.agentContext?.config;
|
|
77694
|
-
if (!config) return;
|
|
77695
|
-
const result = listMemoryFiles(config);
|
|
77730
|
+
action: (context, args) => {
|
|
77731
|
+
const result = addMemory(args);
|
|
77732
|
+
if (result.type === "message") {
|
|
77733
|
+
return result;
|
|
77734
|
+
}
|
|
77735
|
+
context.ui.addItem(
|
|
77736
|
+
{
|
|
77737
|
+
type: "info" /* INFO */,
|
|
77738
|
+
text: `Attempting to save to memory: "${args.trim()}"`
|
|
77739
|
+
},
|
|
77740
|
+
Date.now()
|
|
77741
|
+
);
|
|
77742
|
+
return result;
|
|
77743
|
+
}
|
|
77744
|
+
};
|
|
77745
|
+
var reloadSubCommand = {
|
|
77746
|
+
name: "reload",
|
|
77747
|
+
altNames: ["refresh"],
|
|
77748
|
+
description: "Reload the memory from the source",
|
|
77749
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77750
|
+
autoExecute: true,
|
|
77751
|
+
action: async (context) => {
|
|
77752
|
+
context.ui.addItem(
|
|
77753
|
+
{
|
|
77754
|
+
type: "info" /* INFO */,
|
|
77755
|
+
text: "Reloading memory from source files..."
|
|
77756
|
+
},
|
|
77757
|
+
Date.now()
|
|
77758
|
+
);
|
|
77759
|
+
try {
|
|
77760
|
+
const config = context.services.agentContext?.config;
|
|
77761
|
+
if (config) {
|
|
77762
|
+
const result = await refreshMemory(config);
|
|
77696
77763
|
context.ui.addItem(
|
|
77697
77764
|
{
|
|
77698
77765
|
type: "info" /* INFO */,
|
|
@@ -77701,45 +77768,89 @@ var memoryCommand = {
|
|
|
77701
77768
|
Date.now()
|
|
77702
77769
|
);
|
|
77703
77770
|
}
|
|
77704
|
-
}
|
|
77705
|
-
|
|
77706
|
-
|
|
77707
|
-
|
|
77708
|
-
|
|
77709
|
-
|
|
77710
|
-
|
|
77711
|
-
|
|
77712
|
-
|
|
77713
|
-
return {
|
|
77714
|
-
type: "message",
|
|
77715
|
-
messageType: "error",
|
|
77716
|
-
content: "Config not loaded."
|
|
77717
|
-
};
|
|
77718
|
-
}
|
|
77719
|
-
if (!config.isAutoMemoryEnabled()) {
|
|
77720
|
-
return {
|
|
77721
|
-
type: "message",
|
|
77722
|
-
messageType: "info",
|
|
77723
|
-
content: "The memory inbox requires Auto Memory. Enable it with: experimental.autoMemory = true in settings."
|
|
77724
|
-
};
|
|
77725
|
-
}
|
|
77726
|
-
return {
|
|
77727
|
-
type: "custom_dialog",
|
|
77728
|
-
component: import_react81.default.createElement(InboxDialog, {
|
|
77729
|
-
config,
|
|
77730
|
-
onClose: () => context.ui.removeComponent(),
|
|
77731
|
-
onReloadSkills: async () => {
|
|
77732
|
-
await config.reloadSkills();
|
|
77733
|
-
context.ui.reloadCommands();
|
|
77734
|
-
},
|
|
77735
|
-
onReloadMemory: async () => {
|
|
77736
|
-
await refreshMemory(config);
|
|
77737
|
-
}
|
|
77738
|
-
})
|
|
77739
|
-
};
|
|
77740
|
-
}
|
|
77771
|
+
} catch (error) {
|
|
77772
|
+
context.ui.addItem(
|
|
77773
|
+
{
|
|
77774
|
+
type: "error" /* ERROR */,
|
|
77775
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
77776
|
+
text: `Error reloading memory: ${error.message}`
|
|
77777
|
+
},
|
|
77778
|
+
Date.now()
|
|
77779
|
+
);
|
|
77741
77780
|
}
|
|
77742
|
-
|
|
77781
|
+
}
|
|
77782
|
+
};
|
|
77783
|
+
var listSubCommand = {
|
|
77784
|
+
name: "list",
|
|
77785
|
+
description: "Lists the paths of the GEMINI.md files in use",
|
|
77786
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77787
|
+
autoExecute: true,
|
|
77788
|
+
action: async (context) => {
|
|
77789
|
+
const config = context.services.agentContext?.config;
|
|
77790
|
+
if (!config) return;
|
|
77791
|
+
const result = listMemoryFiles(config);
|
|
77792
|
+
context.ui.addItem(
|
|
77793
|
+
{
|
|
77794
|
+
type: "info" /* INFO */,
|
|
77795
|
+
text: result.content
|
|
77796
|
+
},
|
|
77797
|
+
Date.now()
|
|
77798
|
+
);
|
|
77799
|
+
}
|
|
77800
|
+
};
|
|
77801
|
+
var inboxSubCommand = {
|
|
77802
|
+
name: "inbox",
|
|
77803
|
+
description: "Review skills extracted from past sessions and move them to global or project skills",
|
|
77804
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77805
|
+
autoExecute: true,
|
|
77806
|
+
action: (context) => {
|
|
77807
|
+
const config = context.services.agentContext?.config;
|
|
77808
|
+
if (!config) {
|
|
77809
|
+
return {
|
|
77810
|
+
type: "message",
|
|
77811
|
+
messageType: "error",
|
|
77812
|
+
content: "Config not loaded."
|
|
77813
|
+
};
|
|
77814
|
+
}
|
|
77815
|
+
if (!config.isAutoMemoryEnabled()) {
|
|
77816
|
+
return {
|
|
77817
|
+
type: "message",
|
|
77818
|
+
messageType: "info",
|
|
77819
|
+
content: "The memory inbox requires Auto Memory. Enable it with: experimental.autoMemory = true in settings."
|
|
77820
|
+
};
|
|
77821
|
+
}
|
|
77822
|
+
return {
|
|
77823
|
+
type: "custom_dialog",
|
|
77824
|
+
component: import_react81.default.createElement(InboxDialog, {
|
|
77825
|
+
config,
|
|
77826
|
+
onClose: () => context.ui.removeComponent(),
|
|
77827
|
+
onReloadSkills: async () => {
|
|
77828
|
+
await config.reloadSkills();
|
|
77829
|
+
context.ui.reloadCommands();
|
|
77830
|
+
},
|
|
77831
|
+
onReloadMemory: async () => {
|
|
77832
|
+
await refreshMemory(config);
|
|
77833
|
+
}
|
|
77834
|
+
})
|
|
77835
|
+
};
|
|
77836
|
+
}
|
|
77837
|
+
};
|
|
77838
|
+
var memoryCommand = (config) => {
|
|
77839
|
+
const isMemoryV2 = config?.isMemoryV2Enabled() ?? false;
|
|
77840
|
+
const subCommands = [
|
|
77841
|
+
showSubCommand,
|
|
77842
|
+
...isMemoryV2 ? [] : [addSubCommand],
|
|
77843
|
+
reloadSubCommand,
|
|
77844
|
+
listSubCommand,
|
|
77845
|
+
inboxSubCommand
|
|
77846
|
+
];
|
|
77847
|
+
return {
|
|
77848
|
+
name: "memory",
|
|
77849
|
+
description: "Commands for interacting with memory",
|
|
77850
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77851
|
+
autoExecute: false,
|
|
77852
|
+
subCommands
|
|
77853
|
+
};
|
|
77743
77854
|
};
|
|
77744
77855
|
|
|
77745
77856
|
// packages/cli/src/ui/commands/modelCommand.ts
|
|
@@ -79273,8 +79384,8 @@ var oncallCommand = {
|
|
|
79273
79384
|
|
|
79274
79385
|
// packages/cli/src/ui/commands/permissionsCommand.ts
|
|
79275
79386
|
import * as process34 from "node:process";
|
|
79276
|
-
import * as
|
|
79277
|
-
import * as
|
|
79387
|
+
import * as path33 from "node:path";
|
|
79388
|
+
import * as fs35 from "node:fs";
|
|
79278
79389
|
var permissionsCommand = {
|
|
79279
79390
|
name: "permissions",
|
|
79280
79391
|
description: "Manage folder trust settings and other permissions",
|
|
@@ -79292,10 +79403,10 @@ var permissionsCommand = {
|
|
|
79292
79403
|
if (!dirPath) {
|
|
79293
79404
|
targetDirectory = process34.cwd();
|
|
79294
79405
|
} else {
|
|
79295
|
-
targetDirectory =
|
|
79406
|
+
targetDirectory = path33.resolve(expandHomeDir(dirPath));
|
|
79296
79407
|
}
|
|
79297
79408
|
try {
|
|
79298
|
-
if (!
|
|
79409
|
+
if (!fs35.statSync(targetDirectory).isDirectory()) {
|
|
79299
79410
|
return {
|
|
79300
79411
|
type: "message",
|
|
79301
79412
|
messageType: "error",
|
|
@@ -79339,7 +79450,7 @@ var permissionsCommand = {
|
|
|
79339
79450
|
};
|
|
79340
79451
|
|
|
79341
79452
|
// packages/cli/src/ui/commands/planCommand.ts
|
|
79342
|
-
import * as
|
|
79453
|
+
import * as path34 from "node:path";
|
|
79343
79454
|
async function copyAction(context) {
|
|
79344
79455
|
const config = context.services.agentContext?.config;
|
|
79345
79456
|
if (!config) {
|
|
@@ -79356,7 +79467,7 @@ async function copyAction(context) {
|
|
|
79356
79467
|
await copyToClipboard(content);
|
|
79357
79468
|
coreEvents.emitFeedback(
|
|
79358
79469
|
"info",
|
|
79359
|
-
`Plan copied to clipboard (${
|
|
79470
|
+
`Plan copied to clipboard (${path34.basename(planPath)}).`
|
|
79360
79471
|
);
|
|
79361
79472
|
} catch (error) {
|
|
79362
79473
|
coreEvents.emitFeedback("error", `Failed to copy plan: ${error}`, error);
|
|
@@ -79394,7 +79505,7 @@ var planCommand = {
|
|
|
79394
79505
|
config.storage.getPlansDir(),
|
|
79395
79506
|
config.getFileSystemService()
|
|
79396
79507
|
);
|
|
79397
|
-
const fileName =
|
|
79508
|
+
const fileName = path34.basename(approvedPlanPath);
|
|
79398
79509
|
coreEvents.emitFeedback("info", `Approved Plan: ${fileName}`);
|
|
79399
79510
|
context.ui.addItem({
|
|
79400
79511
|
type: "gemini" /* GEMINI */,
|
|
@@ -79579,8 +79690,8 @@ var quitCommand = {
|
|
|
79579
79690
|
};
|
|
79580
79691
|
|
|
79581
79692
|
// packages/cli/src/ui/commands/restoreCommand.ts
|
|
79582
|
-
import * as
|
|
79583
|
-
import
|
|
79693
|
+
import * as fs36 from "node:fs/promises";
|
|
79694
|
+
import path35 from "node:path";
|
|
79584
79695
|
var HistoryItemSchema = external_exports.object({
|
|
79585
79696
|
type: external_exports.string(),
|
|
79586
79697
|
id: external_exports.number()
|
|
@@ -79599,8 +79710,8 @@ async function restoreAction(context, args) {
|
|
|
79599
79710
|
};
|
|
79600
79711
|
}
|
|
79601
79712
|
try {
|
|
79602
|
-
await
|
|
79603
|
-
const files = await
|
|
79713
|
+
await fs36.mkdir(checkpointDir, { recursive: true });
|
|
79714
|
+
const files = await fs36.readdir(checkpointDir);
|
|
79604
79715
|
const jsonFiles = files.filter((file) => file.endsWith(".json"));
|
|
79605
79716
|
if (!args) {
|
|
79606
79717
|
if (jsonFiles.length === 0) {
|
|
@@ -79627,8 +79738,8 @@ ${fileList}`
|
|
|
79627
79738
|
content: `File not found: ${selectedFile}`
|
|
79628
79739
|
};
|
|
79629
79740
|
}
|
|
79630
|
-
const filePath =
|
|
79631
|
-
const data = await
|
|
79741
|
+
const filePath = path35.join(checkpointDir, selectedFile);
|
|
79742
|
+
const data = await fs36.readFile(filePath, "utf-8");
|
|
79632
79743
|
const parseResult = ToolCallDataSchema.safeParse(JSON.parse(data));
|
|
79633
79744
|
if (!parseResult.success) {
|
|
79634
79745
|
return {
|
|
@@ -79676,7 +79787,7 @@ async function completion(context, _partialArg) {
|
|
|
79676
79787
|
return [];
|
|
79677
79788
|
}
|
|
79678
79789
|
try {
|
|
79679
|
-
const files = await
|
|
79790
|
+
const files = await fs36.readdir(checkpointDir);
|
|
79680
79791
|
const jsonFiles = files.filter((file) => file.endsWith(".json"));
|
|
79681
79792
|
return getTruncatedCheckpointNames(jsonFiles);
|
|
79682
79793
|
} catch {
|
|
@@ -79852,7 +79963,7 @@ async function listTools(context, showDescriptions) {
|
|
|
79852
79963
|
};
|
|
79853
79964
|
context.ui.addItem(toolsListItem);
|
|
79854
79965
|
}
|
|
79855
|
-
var
|
|
79966
|
+
var listSubCommand2 = {
|
|
79856
79967
|
name: "list",
|
|
79857
79968
|
description: "List available Gemini CLI tools.",
|
|
79858
79969
|
kind: "built-in" /* BUILT_IN */,
|
|
@@ -79872,7 +79983,7 @@ var toolsCommand = {
|
|
|
79872
79983
|
description: "List available Gemini CLI tools. Use /tools desc to include descriptions.",
|
|
79873
79984
|
kind: "built-in" /* BUILT_IN */,
|
|
79874
79985
|
autoExecute: false,
|
|
79875
|
-
subCommands: [
|
|
79986
|
+
subCommands: [listSubCommand2, descSubCommand],
|
|
79876
79987
|
action: async (context, args) => {
|
|
79877
79988
|
const subCommand = args?.trim();
|
|
79878
79989
|
const useShowDescriptions = subCommand === "desc" || subCommand === "descriptions";
|
|
@@ -79929,9 +80040,9 @@ function disableSkill(settings, skillName, scope) {
|
|
|
79929
80040
|
|
|
79930
80041
|
// packages/cli/src/utils/skillUtils.ts
|
|
79931
80042
|
var import_extract_zip2 = __toESM(require_extract_zip(), 1);
|
|
79932
|
-
import * as
|
|
79933
|
-
import * as
|
|
79934
|
-
import * as
|
|
80043
|
+
import * as fs37 from "node:fs/promises";
|
|
80044
|
+
import * as path36 from "node:path";
|
|
80045
|
+
import * as os8 from "node:os";
|
|
79935
80046
|
function renderSkillActionFeedback(result, formatScope) {
|
|
79936
80047
|
const { skillName, action, status, error } = result;
|
|
79937
80048
|
if (status === "error") {
|
|
@@ -79970,8 +80081,8 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
79970
80081
|
const isSkillFile = source2.toLowerCase().endsWith(".skill");
|
|
79971
80082
|
try {
|
|
79972
80083
|
if (isGitUrl) {
|
|
79973
|
-
tempDirToClean = await
|
|
79974
|
-
|
|
80084
|
+
tempDirToClean = await fs37.mkdtemp(
|
|
80085
|
+
path36.join(os8.tmpdir(), "gemini-skill-")
|
|
79975
80086
|
);
|
|
79976
80087
|
sourcePath = tempDirToClean;
|
|
79977
80088
|
onLog(`Cloning skill from ${source2}...`);
|
|
@@ -79983,18 +80094,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
79983
80094
|
tempDirToClean
|
|
79984
80095
|
);
|
|
79985
80096
|
} else if (isSkillFile) {
|
|
79986
|
-
tempDirToClean = await
|
|
79987
|
-
|
|
80097
|
+
tempDirToClean = await fs37.mkdtemp(
|
|
80098
|
+
path36.join(os8.tmpdir(), "gemini-skill-")
|
|
79988
80099
|
);
|
|
79989
80100
|
sourcePath = tempDirToClean;
|
|
79990
80101
|
onLog(`Extracting skill from ${source2}...`);
|
|
79991
|
-
await (0, import_extract_zip2.default)(
|
|
80102
|
+
await (0, import_extract_zip2.default)(path36.resolve(source2), { dir: tempDirToClean });
|
|
79992
80103
|
}
|
|
79993
80104
|
if (subpath) {
|
|
79994
|
-
sourcePath =
|
|
80105
|
+
sourcePath = path36.join(sourcePath, subpath);
|
|
79995
80106
|
}
|
|
79996
|
-
sourcePath =
|
|
79997
|
-
if (tempDirToClean && !sourcePath.startsWith(
|
|
80107
|
+
sourcePath = path36.resolve(sourcePath);
|
|
80108
|
+
if (tempDirToClean && !sourcePath.startsWith(path36.resolve(tempDirToClean))) {
|
|
79998
80109
|
throw new Error("Invalid path: Directory traversal not allowed.");
|
|
79999
80110
|
}
|
|
80000
80111
|
onLog(`Searching for skills in ${sourcePath}...`);
|
|
@@ -80010,29 +80121,29 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
80010
80121
|
if (!await requestConsent(skills, targetDir)) {
|
|
80011
80122
|
throw new Error("Skill installation cancelled by user.");
|
|
80012
80123
|
}
|
|
80013
|
-
await
|
|
80124
|
+
await fs37.mkdir(targetDir, { recursive: true });
|
|
80014
80125
|
const installedSkills = [];
|
|
80015
80126
|
for (const skill of skills) {
|
|
80016
80127
|
const skillName = skill.name;
|
|
80017
|
-
const skillDir =
|
|
80018
|
-
const destPath =
|
|
80019
|
-
const exists = await
|
|
80128
|
+
const skillDir = path36.dirname(skill.location);
|
|
80129
|
+
const destPath = path36.join(targetDir, skillName);
|
|
80130
|
+
const exists = await fs37.stat(destPath).catch(() => null);
|
|
80020
80131
|
if (exists) {
|
|
80021
80132
|
onLog(`Skill "${skillName}" already exists. Overwriting...`);
|
|
80022
|
-
await
|
|
80133
|
+
await fs37.rm(destPath, { recursive: true, force: true });
|
|
80023
80134
|
}
|
|
80024
|
-
await
|
|
80135
|
+
await fs37.cp(skillDir, destPath, { recursive: true });
|
|
80025
80136
|
installedSkills.push({ name: skillName, location: destPath });
|
|
80026
80137
|
}
|
|
80027
80138
|
return installedSkills;
|
|
80028
80139
|
} finally {
|
|
80029
80140
|
if (tempDirToClean) {
|
|
80030
|
-
await
|
|
80141
|
+
await fs37.rm(tempDirToClean, { recursive: true, force: true });
|
|
80031
80142
|
}
|
|
80032
80143
|
}
|
|
80033
80144
|
}
|
|
80034
80145
|
async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.resolve(true)) {
|
|
80035
|
-
const sourcePath =
|
|
80146
|
+
const sourcePath = path36.resolve(source2);
|
|
80036
80147
|
onLog(`Searching for skills in ${sourcePath}...`);
|
|
80037
80148
|
const skills = await loadSkillsFromDir(sourcePath);
|
|
80038
80149
|
if (skills.length === 0) {
|
|
@@ -80057,20 +80168,20 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
|
|
|
80057
80168
|
if (!await requestConsent(skills, targetDir)) {
|
|
80058
80169
|
throw new Error("Skill linking cancelled by user.");
|
|
80059
80170
|
}
|
|
80060
|
-
await
|
|
80171
|
+
await fs37.mkdir(targetDir, { recursive: true });
|
|
80061
80172
|
const linkedSkills = [];
|
|
80062
80173
|
for (const skill of skills) {
|
|
80063
80174
|
const skillName = skill.name;
|
|
80064
|
-
const skillSourceDir =
|
|
80065
|
-
const destPath =
|
|
80066
|
-
const exists = await
|
|
80175
|
+
const skillSourceDir = path36.dirname(skill.location);
|
|
80176
|
+
const destPath = path36.join(targetDir, skillName);
|
|
80177
|
+
const exists = await fs37.lstat(destPath).catch(() => null);
|
|
80067
80178
|
if (exists) {
|
|
80068
80179
|
onLog(
|
|
80069
80180
|
`Skill "${skillName}" already exists at destination. Overwriting...`
|
|
80070
80181
|
);
|
|
80071
|
-
await
|
|
80182
|
+
await fs37.rm(destPath, { recursive: true, force: true });
|
|
80072
80183
|
}
|
|
80073
|
-
await
|
|
80184
|
+
await fs37.symlink(
|
|
80074
80185
|
skillSourceDir,
|
|
80075
80186
|
destPath,
|
|
80076
80187
|
process.platform === "win32" ? "junction" : "dir"
|
|
@@ -80086,19 +80197,19 @@ async function uninstallSkill(name, scope) {
|
|
|
80086
80197
|
const discoveredSkills = await loadSkillsFromDir(targetDir);
|
|
80087
80198
|
const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
|
|
80088
80199
|
if (!skillToUninstall) {
|
|
80089
|
-
const skillPath =
|
|
80090
|
-
if (!skillPath.startsWith(
|
|
80200
|
+
const skillPath = path36.resolve(targetDir, name);
|
|
80201
|
+
if (!skillPath.startsWith(path36.resolve(targetDir))) {
|
|
80091
80202
|
return null;
|
|
80092
80203
|
}
|
|
80093
|
-
const exists = await
|
|
80204
|
+
const exists = await fs37.lstat(skillPath).catch(() => null);
|
|
80094
80205
|
if (!exists) {
|
|
80095
80206
|
return null;
|
|
80096
80207
|
}
|
|
80097
|
-
await
|
|
80208
|
+
await fs37.rm(skillPath, { recursive: true, force: true });
|
|
80098
80209
|
return { location: skillPath };
|
|
80099
80210
|
}
|
|
80100
|
-
const skillDir =
|
|
80101
|
-
await
|
|
80211
|
+
const skillDir = path36.dirname(skillToUninstall.location);
|
|
80212
|
+
await fs37.rm(skillDir, { recursive: true, force: true });
|
|
80102
80213
|
return { location: skillDir };
|
|
80103
80214
|
}
|
|
80104
80215
|
|
|
@@ -80228,7 +80339,7 @@ async function disableAction4(context, args) {
|
|
|
80228
80339
|
const result = disableSkill(context.services.settings, skillName, scope);
|
|
80229
80340
|
let feedback = renderSkillActionFeedback(
|
|
80230
80341
|
result,
|
|
80231
|
-
(label,
|
|
80342
|
+
(label, path38) => `${label} (${path38})`
|
|
80232
80343
|
);
|
|
80233
80344
|
if (result.status === "success" || result.status === "no-op") {
|
|
80234
80345
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -80264,7 +80375,7 @@ async function enableAction4(context, args) {
|
|
|
80264
80375
|
const result = enableSkill(context.services.settings, skillName);
|
|
80265
80376
|
let feedback = renderSkillActionFeedback(
|
|
80266
80377
|
result,
|
|
80267
|
-
(label,
|
|
80378
|
+
(label, path38) => `${label} (${path38})`
|
|
80268
80379
|
);
|
|
80269
80380
|
if (result.status === "success" || result.status === "no-op") {
|
|
80270
80381
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -80302,7 +80413,7 @@ async function reloadAction2(context) {
|
|
|
80302
80413
|
const minVisibleDuration = 500;
|
|
80303
80414
|
if (elapsed < minVisibleDuration) {
|
|
80304
80415
|
await new Promise(
|
|
80305
|
-
(
|
|
80416
|
+
(resolve9) => setTimeout(resolve9, minVisibleDuration - elapsed)
|
|
80306
80417
|
);
|
|
80307
80418
|
}
|
|
80308
80419
|
context.ui.setPendingItem(null);
|
|
@@ -80455,8 +80566,8 @@ var vimCommand = {
|
|
|
80455
80566
|
|
|
80456
80567
|
// packages/cli/src/ui/commands/setupGithubCommand.ts
|
|
80457
80568
|
var import_undici2 = __toESM(require_undici(), 1);
|
|
80458
|
-
import
|
|
80459
|
-
import * as
|
|
80569
|
+
import path37 from "node:path";
|
|
80570
|
+
import * as fs38 from "node:fs";
|
|
80460
80571
|
import { Writable } from "node:stream";
|
|
80461
80572
|
|
|
80462
80573
|
// packages/cli/src/utils/gitUtils.ts
|
|
@@ -80506,7 +80617,7 @@ var getLatestGitHubRelease = async (proxy) => {
|
|
|
80506
80617
|
if (!releaseTag) {
|
|
80507
80618
|
throw new Error(`Response did not include tag_name field`);
|
|
80508
80619
|
}
|
|
80509
|
-
return releaseTag;
|
|
80620
|
+
return typeof releaseTag === "string" ? releaseTag : "";
|
|
80510
80621
|
} catch (error) {
|
|
80511
80622
|
debugLogger.debug(
|
|
80512
80623
|
`Failed to determine latest run-gemini-cli release:`,
|
|
@@ -80583,25 +80694,25 @@ function getOpenUrlsCommands(readmeUrl) {
|
|
|
80583
80694
|
}
|
|
80584
80695
|
async function updateGitignore(gitRepoRoot) {
|
|
80585
80696
|
const gitignoreEntries = [".gemini/", "gha-creds-*.json"];
|
|
80586
|
-
const gitignorePath =
|
|
80697
|
+
const gitignorePath = path37.join(gitRepoRoot, ".gitignore");
|
|
80587
80698
|
try {
|
|
80588
80699
|
let existingContent = "";
|
|
80589
80700
|
let fileExists2 = true;
|
|
80590
80701
|
try {
|
|
80591
|
-
existingContent = await
|
|
80702
|
+
existingContent = await fs38.promises.readFile(gitignorePath, "utf8");
|
|
80592
80703
|
} catch {
|
|
80593
80704
|
fileExists2 = false;
|
|
80594
80705
|
}
|
|
80595
80706
|
if (!fileExists2) {
|
|
80596
80707
|
const contentToWrite = gitignoreEntries.join("\n") + "\n";
|
|
80597
|
-
await
|
|
80708
|
+
await fs38.promises.writeFile(gitignorePath, contentToWrite);
|
|
80598
80709
|
} else {
|
|
80599
80710
|
const missingEntries = gitignoreEntries.filter(
|
|
80600
80711
|
(entry) => !existingContent.split(/\r?\n/).some((line) => line.split("#")[0].trim() === entry)
|
|
80601
80712
|
);
|
|
80602
80713
|
if (missingEntries.length > 0) {
|
|
80603
80714
|
const contentToAdd = "\n" + missingEntries.join("\n") + "\n";
|
|
80604
|
-
await
|
|
80715
|
+
await fs38.promises.appendFile(gitignorePath, contentToAdd);
|
|
80605
80716
|
}
|
|
80606
80717
|
}
|
|
80607
80718
|
} catch (error) {
|
|
@@ -80639,11 +80750,11 @@ async function downloadFiles({
|
|
|
80639
80750
|
`Empty body while downloading ${endpoint}: ${response.status} - ${response.statusText}`
|
|
80640
80751
|
);
|
|
80641
80752
|
}
|
|
80642
|
-
const destination =
|
|
80753
|
+
const destination = path37.resolve(
|
|
80643
80754
|
targetDir,
|
|
80644
|
-
|
|
80755
|
+
path37.basename(fileBasename)
|
|
80645
80756
|
);
|
|
80646
|
-
const fileStream =
|
|
80757
|
+
const fileStream = fs38.createWriteStream(destination, {
|
|
80647
80758
|
mode: 420,
|
|
80648
80759
|
// -rw-r--r--, user(rw), group(r), other(r)
|
|
80649
80760
|
flags: "w",
|
|
@@ -80660,7 +80771,7 @@ async function downloadFiles({
|
|
|
80660
80771
|
}
|
|
80661
80772
|
async function createDirectory(dirPath) {
|
|
80662
80773
|
try {
|
|
80663
|
-
await
|
|
80774
|
+
await fs38.promises.mkdir(dirPath, { recursive: true });
|
|
80664
80775
|
} catch (error) {
|
|
80665
80776
|
debugLogger.debug(`Failed to create ${dirPath} directory:`, error);
|
|
80666
80777
|
throw new Error(
|
|
@@ -80714,9 +80825,9 @@ var setupGithubCommand = {
|
|
|
80714
80825
|
const proxy = context?.services?.agentContext?.config.getProxy();
|
|
80715
80826
|
const releaseTag = await getLatestGitHubRelease(proxy);
|
|
80716
80827
|
const readmeUrl = `https://github.com/google-github-actions/run-gemini-cli/blob/${releaseTag}/README.md#quick-start`;
|
|
80717
|
-
const workflowsDir =
|
|
80828
|
+
const workflowsDir = path37.join(gitRepoRoot, ".github", "workflows");
|
|
80718
80829
|
await createDirectory(workflowsDir);
|
|
80719
|
-
const commandsDir =
|
|
80830
|
+
const commandsDir = path37.join(gitRepoRoot, ".github", "commands");
|
|
80720
80831
|
await createDirectory(commandsDir);
|
|
80721
80832
|
await downloadSetupFiles({
|
|
80722
80833
|
configs: [
|
|
@@ -80936,6 +81047,7 @@ var BuiltinCommandLoader = class {
|
|
|
80936
81047
|
copyCommand,
|
|
80937
81048
|
corgiCommand,
|
|
80938
81049
|
docsCommand,
|
|
81050
|
+
exportSessionCommand,
|
|
80939
81051
|
directoryCommand,
|
|
80940
81052
|
editorCommand,
|
|
80941
81053
|
...this.config?.getExtensionsEnabled() === false ? [
|
|
@@ -80977,7 +81089,7 @@ var BuiltinCommandLoader = class {
|
|
|
80977
81089
|
})
|
|
80978
81090
|
}
|
|
80979
81091
|
] : [mcpCommand],
|
|
80980
|
-
memoryCommand,
|
|
81092
|
+
memoryCommand(this.config),
|
|
80981
81093
|
modelCommand,
|
|
80982
81094
|
...this.config?.getFolderTrust() ? [permissionsCommand] : [],
|
|
80983
81095
|
...this.config?.isPlanEnabled() ? [planCommand] : [],
|