@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-FGYOOMPI.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,17 +58,19 @@ import {
|
|
|
57
58
|
stripUnsafeCharacters,
|
|
58
59
|
toCodePoints,
|
|
59
60
|
validateCustomTheme
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-UHSQLPNG.js";
|
|
61
62
|
import {
|
|
62
63
|
isDevelopment
|
|
63
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-BA752AEU.js";
|
|
64
65
|
import {
|
|
65
66
|
emptyIcon,
|
|
66
67
|
require_react
|
|
67
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-I2JHD4D3.js";
|
|
68
69
|
import {
|
|
69
70
|
AsyncFzf,
|
|
71
|
+
AuthType,
|
|
70
72
|
Config,
|
|
73
|
+
CoreToolCallStatus,
|
|
71
74
|
ExtensionDisableEvent,
|
|
72
75
|
ExtensionEnableEvent,
|
|
73
76
|
ExtensionInstallEvent,
|
|
@@ -76,17 +79,27 @@ import {
|
|
|
76
79
|
ExtensionUninstallEvent,
|
|
77
80
|
ExtensionUpdateEvent,
|
|
78
81
|
GEMINI_CLI_COMPANION_EXTENSION_NAME,
|
|
82
|
+
HookType,
|
|
83
|
+
IDEConnectionStatus,
|
|
79
84
|
INITIAL_HISTORY_LENGTH,
|
|
80
85
|
IdeClient,
|
|
81
86
|
IdeConnectionEvent,
|
|
87
|
+
IdeConnectionType,
|
|
88
|
+
IntegrityDataStatus,
|
|
82
89
|
KeychainTokenStorage,
|
|
90
|
+
LlmRole,
|
|
91
|
+
MCPDiscoveryState,
|
|
83
92
|
MCPOAuthTokenStorage,
|
|
93
|
+
MCPServerStatus,
|
|
84
94
|
ModelSlashCommandEvent,
|
|
85
95
|
ProjectIdRequiredError,
|
|
86
96
|
ReadManyFilesTool,
|
|
87
97
|
RewindEvent,
|
|
98
|
+
SessionEndReason,
|
|
99
|
+
SessionStartSource,
|
|
88
100
|
ShellExecutionService,
|
|
89
101
|
StartSessionEvent,
|
|
102
|
+
TrustLevel,
|
|
90
103
|
UPGRADE_URL_PAGE,
|
|
91
104
|
UserAccountManager,
|
|
92
105
|
ValidationRequiredError,
|
|
@@ -200,12 +213,13 @@ import {
|
|
|
200
213
|
stripAnsi,
|
|
201
214
|
tokenLimit,
|
|
202
215
|
uiTelemetryService
|
|
203
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-AC2EWTF7.js";
|
|
204
217
|
import {
|
|
205
218
|
ApprovalMode,
|
|
206
219
|
CoreEvent,
|
|
207
220
|
DiscoveredMCPTool,
|
|
208
221
|
GEMINI_DIR,
|
|
222
|
+
PolicyDecision,
|
|
209
223
|
REFERENCE_CONTENT_END,
|
|
210
224
|
REFERENCE_CONTENT_START,
|
|
211
225
|
Storage,
|
|
@@ -226,7 +240,7 @@ import {
|
|
|
226
240
|
shortenPath,
|
|
227
241
|
tildeifyPath,
|
|
228
242
|
unescapePath
|
|
229
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-M7OUJJZ2.js";
|
|
230
244
|
import {
|
|
231
245
|
require_src
|
|
232
246
|
} from "./chunk-RJTRUG2J.js";
|
|
@@ -1729,8 +1743,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
1729
1743
|
currentEntangledActionThenable = {
|
|
1730
1744
|
status: "pending",
|
|
1731
1745
|
value: void 0,
|
|
1732
|
-
then: function(
|
|
1733
|
-
entangledListeners.push(
|
|
1746
|
+
then: function(resolve9) {
|
|
1747
|
+
entangledListeners.push(resolve9);
|
|
1734
1748
|
}
|
|
1735
1749
|
};
|
|
1736
1750
|
}
|
|
@@ -1753,8 +1767,8 @@ var require_react_reconciler_production = __commonJS({
|
|
|
1753
1767
|
status: "pending",
|
|
1754
1768
|
value: null,
|
|
1755
1769
|
reason: null,
|
|
1756
|
-
then: function(
|
|
1757
|
-
listeners.push(
|
|
1770
|
+
then: function(resolve9) {
|
|
1771
|
+
listeners.push(resolve9);
|
|
1758
1772
|
}
|
|
1759
1773
|
};
|
|
1760
1774
|
thenable.then(
|
|
@@ -9748,7 +9762,7 @@ var require_prompt = __commonJS({
|
|
|
9748
9762
|
var require_text = __commonJS({
|
|
9749
9763
|
"node_modules/prompts/dist/elements/text.js"(exports, module) {
|
|
9750
9764
|
"use strict";
|
|
9751
|
-
function asyncGeneratorStep(gen,
|
|
9765
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
9752
9766
|
try {
|
|
9753
9767
|
var info = gen[key](arg);
|
|
9754
9768
|
var value = info.value;
|
|
@@ -9757,7 +9771,7 @@ var require_text = __commonJS({
|
|
|
9757
9771
|
return;
|
|
9758
9772
|
}
|
|
9759
9773
|
if (info.done) {
|
|
9760
|
-
|
|
9774
|
+
resolve9(value);
|
|
9761
9775
|
} else {
|
|
9762
9776
|
Promise.resolve(value).then(_next, _throw);
|
|
9763
9777
|
}
|
|
@@ -9765,13 +9779,13 @@ var require_text = __commonJS({
|
|
|
9765
9779
|
function _asyncToGenerator(fn2) {
|
|
9766
9780
|
return function() {
|
|
9767
9781
|
var self = this, args = arguments;
|
|
9768
|
-
return new Promise(function(
|
|
9782
|
+
return new Promise(function(resolve9, reject) {
|
|
9769
9783
|
var gen = fn2.apply(self, args);
|
|
9770
9784
|
function _next(value) {
|
|
9771
|
-
asyncGeneratorStep(gen,
|
|
9785
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
9772
9786
|
}
|
|
9773
9787
|
function _throw(err) {
|
|
9774
|
-
asyncGeneratorStep(gen,
|
|
9788
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
9775
9789
|
}
|
|
9776
9790
|
_next(void 0);
|
|
9777
9791
|
});
|
|
@@ -10487,7 +10501,7 @@ var require_dateparts = __commonJS({
|
|
|
10487
10501
|
var require_date = __commonJS({
|
|
10488
10502
|
"node_modules/prompts/dist/elements/date.js"(exports, module) {
|
|
10489
10503
|
"use strict";
|
|
10490
|
-
function asyncGeneratorStep(gen,
|
|
10504
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
10491
10505
|
try {
|
|
10492
10506
|
var info = gen[key](arg);
|
|
10493
10507
|
var value = info.value;
|
|
@@ -10496,7 +10510,7 @@ var require_date = __commonJS({
|
|
|
10496
10510
|
return;
|
|
10497
10511
|
}
|
|
10498
10512
|
if (info.done) {
|
|
10499
|
-
|
|
10513
|
+
resolve9(value);
|
|
10500
10514
|
} else {
|
|
10501
10515
|
Promise.resolve(value).then(_next, _throw);
|
|
10502
10516
|
}
|
|
@@ -10504,13 +10518,13 @@ var require_date = __commonJS({
|
|
|
10504
10518
|
function _asyncToGenerator(fn2) {
|
|
10505
10519
|
return function() {
|
|
10506
10520
|
var self = this, args = arguments;
|
|
10507
|
-
return new Promise(function(
|
|
10521
|
+
return new Promise(function(resolve9, reject) {
|
|
10508
10522
|
var gen = fn2.apply(self, args);
|
|
10509
10523
|
function _next(value) {
|
|
10510
|
-
asyncGeneratorStep(gen,
|
|
10524
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
10511
10525
|
}
|
|
10512
10526
|
function _throw(err) {
|
|
10513
|
-
asyncGeneratorStep(gen,
|
|
10527
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
10514
10528
|
}
|
|
10515
10529
|
_next(void 0);
|
|
10516
10530
|
});
|
|
@@ -10713,7 +10727,7 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
|
|
|
10713
10727
|
var require_number = __commonJS({
|
|
10714
10728
|
"node_modules/prompts/dist/elements/number.js"(exports, module) {
|
|
10715
10729
|
"use strict";
|
|
10716
|
-
function asyncGeneratorStep(gen,
|
|
10730
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
10717
10731
|
try {
|
|
10718
10732
|
var info = gen[key](arg);
|
|
10719
10733
|
var value = info.value;
|
|
@@ -10722,7 +10736,7 @@ var require_number = __commonJS({
|
|
|
10722
10736
|
return;
|
|
10723
10737
|
}
|
|
10724
10738
|
if (info.done) {
|
|
10725
|
-
|
|
10739
|
+
resolve9(value);
|
|
10726
10740
|
} else {
|
|
10727
10741
|
Promise.resolve(value).then(_next, _throw);
|
|
10728
10742
|
}
|
|
@@ -10730,13 +10744,13 @@ var require_number = __commonJS({
|
|
|
10730
10744
|
function _asyncToGenerator(fn2) {
|
|
10731
10745
|
return function() {
|
|
10732
10746
|
var self = this, args = arguments;
|
|
10733
|
-
return new Promise(function(
|
|
10747
|
+
return new Promise(function(resolve9, reject) {
|
|
10734
10748
|
var gen = fn2.apply(self, args);
|
|
10735
10749
|
function _next(value) {
|
|
10736
|
-
asyncGeneratorStep(gen,
|
|
10750
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
10737
10751
|
}
|
|
10738
10752
|
function _throw(err) {
|
|
10739
|
-
asyncGeneratorStep(gen,
|
|
10753
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
10740
10754
|
}
|
|
10741
10755
|
_next(void 0);
|
|
10742
10756
|
});
|
|
@@ -11159,7 +11173,7 @@ Instructions:
|
|
|
11159
11173
|
var require_autocomplete = __commonJS({
|
|
11160
11174
|
"node_modules/prompts/dist/elements/autocomplete.js"(exports, module) {
|
|
11161
11175
|
"use strict";
|
|
11162
|
-
function asyncGeneratorStep(gen,
|
|
11176
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
11163
11177
|
try {
|
|
11164
11178
|
var info = gen[key](arg);
|
|
11165
11179
|
var value = info.value;
|
|
@@ -11168,7 +11182,7 @@ var require_autocomplete = __commonJS({
|
|
|
11168
11182
|
return;
|
|
11169
11183
|
}
|
|
11170
11184
|
if (info.done) {
|
|
11171
|
-
|
|
11185
|
+
resolve9(value);
|
|
11172
11186
|
} else {
|
|
11173
11187
|
Promise.resolve(value).then(_next, _throw);
|
|
11174
11188
|
}
|
|
@@ -11176,13 +11190,13 @@ var require_autocomplete = __commonJS({
|
|
|
11176
11190
|
function _asyncToGenerator(fn2) {
|
|
11177
11191
|
return function() {
|
|
11178
11192
|
var self = this, args = arguments;
|
|
11179
|
-
return new Promise(function(
|
|
11193
|
+
return new Promise(function(resolve9, reject) {
|
|
11180
11194
|
var gen = fn2.apply(self, args);
|
|
11181
11195
|
function _next(value) {
|
|
11182
|
-
asyncGeneratorStep(gen,
|
|
11196
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
11183
11197
|
}
|
|
11184
11198
|
function _throw(err) {
|
|
11185
|
-
asyncGeneratorStep(gen,
|
|
11199
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
11186
11200
|
}
|
|
11187
11201
|
_next(void 0);
|
|
11188
11202
|
});
|
|
@@ -11813,7 +11827,7 @@ var require_dist = __commonJS({
|
|
|
11813
11827
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
11814
11828
|
return arr2;
|
|
11815
11829
|
}
|
|
11816
|
-
function asyncGeneratorStep(gen,
|
|
11830
|
+
function asyncGeneratorStep(gen, resolve9, reject, _next, _throw, key, arg) {
|
|
11817
11831
|
try {
|
|
11818
11832
|
var info = gen[key](arg);
|
|
11819
11833
|
var value = info.value;
|
|
@@ -11822,7 +11836,7 @@ var require_dist = __commonJS({
|
|
|
11822
11836
|
return;
|
|
11823
11837
|
}
|
|
11824
11838
|
if (info.done) {
|
|
11825
|
-
|
|
11839
|
+
resolve9(value);
|
|
11826
11840
|
} else {
|
|
11827
11841
|
Promise.resolve(value).then(_next, _throw);
|
|
11828
11842
|
}
|
|
@@ -11830,13 +11844,13 @@ var require_dist = __commonJS({
|
|
|
11830
11844
|
function _asyncToGenerator(fn2) {
|
|
11831
11845
|
return function() {
|
|
11832
11846
|
var self = this, args = arguments;
|
|
11833
|
-
return new Promise(function(
|
|
11847
|
+
return new Promise(function(resolve9, reject) {
|
|
11834
11848
|
var gen = fn2.apply(self, args);
|
|
11835
11849
|
function _next(value) {
|
|
11836
|
-
asyncGeneratorStep(gen,
|
|
11850
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
11837
11851
|
}
|
|
11838
11852
|
function _throw(err) {
|
|
11839
|
-
asyncGeneratorStep(gen,
|
|
11853
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
11840
11854
|
}
|
|
11841
11855
|
_next(void 0);
|
|
11842
11856
|
});
|
|
@@ -14173,7 +14187,7 @@ var require_get_stream = __commonJS({
|
|
|
14173
14187
|
};
|
|
14174
14188
|
const { maxBuffer } = options;
|
|
14175
14189
|
let stream;
|
|
14176
|
-
await new Promise((
|
|
14190
|
+
await new Promise((resolve9, reject) => {
|
|
14177
14191
|
const rejectPromise = (error) => {
|
|
14178
14192
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
14179
14193
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -14185,7 +14199,7 @@ var require_get_stream = __commonJS({
|
|
|
14185
14199
|
rejectPromise(error);
|
|
14186
14200
|
return;
|
|
14187
14201
|
}
|
|
14188
|
-
|
|
14202
|
+
resolve9();
|
|
14189
14203
|
});
|
|
14190
14204
|
stream.on("data", () => {
|
|
14191
14205
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -14261,7 +14275,7 @@ var require_pend = __commonJS({
|
|
|
14261
14275
|
// node_modules/fd-slicer/index.js
|
|
14262
14276
|
var require_fd_slicer = __commonJS({
|
|
14263
14277
|
"node_modules/fd-slicer/index.js"(exports) {
|
|
14264
|
-
var
|
|
14278
|
+
var fs39 = __require("fs");
|
|
14265
14279
|
var util2 = __require("util");
|
|
14266
14280
|
var stream = __require("stream");
|
|
14267
14281
|
var Readable = stream.Readable;
|
|
@@ -14286,7 +14300,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14286
14300
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
14287
14301
|
var self = this;
|
|
14288
14302
|
self.pend.go(function(cb) {
|
|
14289
|
-
|
|
14303
|
+
fs39.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
|
|
14290
14304
|
cb();
|
|
14291
14305
|
callback(err, bytesRead, buffer2);
|
|
14292
14306
|
});
|
|
@@ -14295,7 +14309,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14295
14309
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
14296
14310
|
var self = this;
|
|
14297
14311
|
self.pend.go(function(cb) {
|
|
14298
|
-
|
|
14312
|
+
fs39.write(self.fd, buffer, offset, length, position, function(err, written, buffer2) {
|
|
14299
14313
|
cb();
|
|
14300
14314
|
callback(err, written, buffer2);
|
|
14301
14315
|
});
|
|
@@ -14316,7 +14330,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14316
14330
|
if (self.refCount > 0) return;
|
|
14317
14331
|
if (self.refCount < 0) throw new Error("invalid unref");
|
|
14318
14332
|
if (self.autoClose) {
|
|
14319
|
-
|
|
14333
|
+
fs39.close(self.fd, onCloseDone);
|
|
14320
14334
|
}
|
|
14321
14335
|
function onCloseDone(err) {
|
|
14322
14336
|
if (err) {
|
|
@@ -14353,7 +14367,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14353
14367
|
self.context.pend.go(function(cb) {
|
|
14354
14368
|
if (self.destroyed) return cb();
|
|
14355
14369
|
var buffer = new Buffer(toRead);
|
|
14356
|
-
|
|
14370
|
+
fs39.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
14357
14371
|
if (err) {
|
|
14358
14372
|
self.destroy(err);
|
|
14359
14373
|
} else if (bytesRead === 0) {
|
|
@@ -14400,7 +14414,7 @@ var require_fd_slicer = __commonJS({
|
|
|
14400
14414
|
}
|
|
14401
14415
|
self.context.pend.go(function(cb) {
|
|
14402
14416
|
if (self.destroyed) return cb();
|
|
14403
|
-
|
|
14417
|
+
fs39.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err2, bytes) {
|
|
14404
14418
|
if (err2) {
|
|
14405
14419
|
self.destroy();
|
|
14406
14420
|
cb();
|
|
@@ -14827,7 +14841,7 @@ var require_buffer_crc32 = __commonJS({
|
|
|
14827
14841
|
// node_modules/yauzl/index.js
|
|
14828
14842
|
var require_yauzl = __commonJS({
|
|
14829
14843
|
"node_modules/yauzl/index.js"(exports) {
|
|
14830
|
-
var
|
|
14844
|
+
var fs39 = __require("fs");
|
|
14831
14845
|
var zlib = __require("zlib");
|
|
14832
14846
|
var fd_slicer = require_fd_slicer();
|
|
14833
14847
|
var crc32 = require_buffer_crc32();
|
|
@@ -14845,7 +14859,7 @@ var require_yauzl = __commonJS({
|
|
|
14845
14859
|
exports.ZipFile = ZipFile;
|
|
14846
14860
|
exports.Entry = Entry;
|
|
14847
14861
|
exports.RandomAccessReader = RandomAccessReader;
|
|
14848
|
-
function open(
|
|
14862
|
+
function open(path38, options, callback) {
|
|
14849
14863
|
if (typeof options === "function") {
|
|
14850
14864
|
callback = options;
|
|
14851
14865
|
options = null;
|
|
@@ -14857,10 +14871,10 @@ var require_yauzl = __commonJS({
|
|
|
14857
14871
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14858
14872
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14859
14873
|
if (callback == null) callback = defaultCallback;
|
|
14860
|
-
|
|
14874
|
+
fs39.open(path38, "r", function(err, fd) {
|
|
14861
14875
|
if (err) return callback(err);
|
|
14862
14876
|
fromFd(fd, options, function(err2, zipfile) {
|
|
14863
|
-
if (err2)
|
|
14877
|
+
if (err2) fs39.close(fd, defaultCallback);
|
|
14864
14878
|
callback(err2, zipfile);
|
|
14865
14879
|
});
|
|
14866
14880
|
});
|
|
@@ -14877,7 +14891,7 @@ var require_yauzl = __commonJS({
|
|
|
14877
14891
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
14878
14892
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
14879
14893
|
if (callback == null) callback = defaultCallback;
|
|
14880
|
-
|
|
14894
|
+
fs39.fstat(fd, function(err, stats) {
|
|
14881
14895
|
if (err) return callback(err);
|
|
14882
14896
|
var reader = fd_slicer.createFromFd(fd, { autoClose: true });
|
|
14883
14897
|
fromRandomAccessReader(reader, stats.size, options, callback);
|
|
@@ -15457,9 +15471,9 @@ var require_yauzl = __commonJS({
|
|
|
15457
15471
|
var require_extract_zip = __commonJS({
|
|
15458
15472
|
"node_modules/extract-zip/index.js"(exports, module) {
|
|
15459
15473
|
var debug = require_src()("extract-zip");
|
|
15460
|
-
var { createWriteStream: createWriteStream5, promises:
|
|
15474
|
+
var { createWriteStream: createWriteStream5, promises: fs39 } = __require("fs");
|
|
15461
15475
|
var getStream = require_get_stream();
|
|
15462
|
-
var
|
|
15476
|
+
var path38 = __require("path");
|
|
15463
15477
|
var { promisify: promisify5 } = __require("util");
|
|
15464
15478
|
var stream = __require("stream");
|
|
15465
15479
|
var yauzl = require_yauzl();
|
|
@@ -15474,7 +15488,7 @@ var require_extract_zip = __commonJS({
|
|
|
15474
15488
|
debug("opening", this.zipPath, "with opts", this.opts);
|
|
15475
15489
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
15476
15490
|
this.canceled = false;
|
|
15477
|
-
return new Promise((
|
|
15491
|
+
return new Promise((resolve9, reject) => {
|
|
15478
15492
|
this.zipfile.on("error", (err) => {
|
|
15479
15493
|
this.canceled = true;
|
|
15480
15494
|
reject(err);
|
|
@@ -15483,7 +15497,7 @@ var require_extract_zip = __commonJS({
|
|
|
15483
15497
|
this.zipfile.on("close", () => {
|
|
15484
15498
|
if (!this.canceled) {
|
|
15485
15499
|
debug("zip extraction complete");
|
|
15486
|
-
|
|
15500
|
+
resolve9();
|
|
15487
15501
|
}
|
|
15488
15502
|
});
|
|
15489
15503
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -15496,12 +15510,12 @@ var require_extract_zip = __commonJS({
|
|
|
15496
15510
|
this.zipfile.readEntry();
|
|
15497
15511
|
return;
|
|
15498
15512
|
}
|
|
15499
|
-
const destDir =
|
|
15513
|
+
const destDir = path38.dirname(path38.join(this.opts.dir, entry.fileName));
|
|
15500
15514
|
try {
|
|
15501
|
-
await
|
|
15502
|
-
const canonicalDestDir = await
|
|
15503
|
-
const relativeDestDir =
|
|
15504
|
-
if (relativeDestDir.split(
|
|
15515
|
+
await fs39.mkdir(destDir, { recursive: true });
|
|
15516
|
+
const canonicalDestDir = await fs39.realpath(destDir);
|
|
15517
|
+
const relativeDestDir = path38.relative(this.opts.dir, canonicalDestDir);
|
|
15518
|
+
if (relativeDestDir.split(path38.sep).includes("..")) {
|
|
15505
15519
|
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
15506
15520
|
}
|
|
15507
15521
|
await this.extractEntry(entry);
|
|
@@ -15523,7 +15537,7 @@ var require_extract_zip = __commonJS({
|
|
|
15523
15537
|
if (this.opts.onEntry) {
|
|
15524
15538
|
this.opts.onEntry(entry, this.zipfile);
|
|
15525
15539
|
}
|
|
15526
|
-
const dest =
|
|
15540
|
+
const dest = path38.join(this.opts.dir, entry.fileName);
|
|
15527
15541
|
const mode = entry.externalFileAttributes >> 16 & 65535;
|
|
15528
15542
|
const IFMT = 61440;
|
|
15529
15543
|
const IFDIR = 16384;
|
|
@@ -15537,20 +15551,20 @@ var require_extract_zip = __commonJS({
|
|
|
15537
15551
|
if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
|
|
15538
15552
|
debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink2 });
|
|
15539
15553
|
const procMode = this.getExtractedMode(mode, isDir) & 511;
|
|
15540
|
-
const destDir = isDir ? dest :
|
|
15554
|
+
const destDir = isDir ? dest : path38.dirname(dest);
|
|
15541
15555
|
const mkdirOptions = { recursive: true };
|
|
15542
15556
|
if (isDir) {
|
|
15543
15557
|
mkdirOptions.mode = procMode;
|
|
15544
15558
|
}
|
|
15545
15559
|
debug("mkdir", { dir: destDir, ...mkdirOptions });
|
|
15546
|
-
await
|
|
15560
|
+
await fs39.mkdir(destDir, mkdirOptions);
|
|
15547
15561
|
if (isDir) return;
|
|
15548
15562
|
debug("opening read stream", dest);
|
|
15549
15563
|
const readStream = await promisify5(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
15550
15564
|
if (symlink2) {
|
|
15551
15565
|
const link2 = await getStream(readStream);
|
|
15552
15566
|
debug("creating symlink", link2, dest);
|
|
15553
|
-
await
|
|
15567
|
+
await fs39.symlink(link2, dest);
|
|
15554
15568
|
} else {
|
|
15555
15569
|
await pipeline2(readStream, createWriteStream5(dest, { mode: procMode }));
|
|
15556
15570
|
}
|
|
@@ -15579,11 +15593,11 @@ var require_extract_zip = __commonJS({
|
|
|
15579
15593
|
};
|
|
15580
15594
|
module.exports = async function(zipPath, opts) {
|
|
15581
15595
|
debug("creating target directory", opts.dir);
|
|
15582
|
-
if (!
|
|
15596
|
+
if (!path38.isAbsolute(opts.dir)) {
|
|
15583
15597
|
throw new Error("Target directory is expected to be absolute");
|
|
15584
15598
|
}
|
|
15585
|
-
await
|
|
15586
|
-
opts.dir = await
|
|
15599
|
+
await fs39.mkdir(opts.dir, { recursive: true });
|
|
15600
|
+
opts.dir = await fs39.realpath(opts.dir);
|
|
15587
15601
|
return new Extractor(zipPath, opts).extract();
|
|
15588
15602
|
};
|
|
15589
15603
|
}
|
|
@@ -17040,7 +17054,7 @@ var require_strip_final_newline = __commonJS({
|
|
|
17040
17054
|
var require_npm_run_path = __commonJS({
|
|
17041
17055
|
"node_modules/run-jxa/node_modules/npm-run-path/index.js"(exports, module) {
|
|
17042
17056
|
"use strict";
|
|
17043
|
-
var
|
|
17057
|
+
var path38 = __require("path");
|
|
17044
17058
|
var pathKey = require_path_key();
|
|
17045
17059
|
var npmRunPath = (options) => {
|
|
17046
17060
|
options = {
|
|
@@ -17050,16 +17064,16 @@ var require_npm_run_path = __commonJS({
|
|
|
17050
17064
|
...options
|
|
17051
17065
|
};
|
|
17052
17066
|
let previous;
|
|
17053
|
-
let cwdPath =
|
|
17067
|
+
let cwdPath = path38.resolve(options.cwd);
|
|
17054
17068
|
const result = [];
|
|
17055
17069
|
while (previous !== cwdPath) {
|
|
17056
|
-
result.push(
|
|
17070
|
+
result.push(path38.join(cwdPath, "node_modules/.bin"));
|
|
17057
17071
|
previous = cwdPath;
|
|
17058
|
-
cwdPath =
|
|
17072
|
+
cwdPath = path38.resolve(cwdPath, "..");
|
|
17059
17073
|
}
|
|
17060
|
-
const execPathDir =
|
|
17074
|
+
const execPathDir = path38.resolve(options.cwd, options.execPath, "..");
|
|
17061
17075
|
result.push(execPathDir);
|
|
17062
|
-
return result.concat(options.path).join(
|
|
17076
|
+
return result.concat(options.path).join(path38.delimiter);
|
|
17063
17077
|
};
|
|
17064
17078
|
module.exports = npmRunPath;
|
|
17065
17079
|
module.exports.default = npmRunPath;
|
|
@@ -17069,9 +17083,9 @@ var require_npm_run_path = __commonJS({
|
|
|
17069
17083
|
...options
|
|
17070
17084
|
};
|
|
17071
17085
|
const env3 = { ...options.env };
|
|
17072
|
-
const
|
|
17073
|
-
options.path = env3[
|
|
17074
|
-
env3[
|
|
17086
|
+
const path39 = pathKey({ env: env3 });
|
|
17087
|
+
options.path = env3[path39];
|
|
17088
|
+
env3[path39] = module.exports(options);
|
|
17075
17089
|
return env3;
|
|
17076
17090
|
};
|
|
17077
17091
|
}
|
|
@@ -17794,7 +17808,7 @@ var require_signal_exit3 = __commonJS({
|
|
|
17794
17808
|
var require_kill = __commonJS({
|
|
17795
17809
|
"node_modules/run-jxa/node_modules/execa/lib/kill.js"(exports, module) {
|
|
17796
17810
|
"use strict";
|
|
17797
|
-
var
|
|
17811
|
+
var os9 = __require("os");
|
|
17798
17812
|
var onExit = require_signal_exit3();
|
|
17799
17813
|
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
17800
17814
|
var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
@@ -17818,7 +17832,7 @@ var require_kill = __commonJS({
|
|
|
17818
17832
|
return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
17819
17833
|
};
|
|
17820
17834
|
var isSigterm = (signal) => {
|
|
17821
|
-
return signal ===
|
|
17835
|
+
return signal === os9.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
17822
17836
|
};
|
|
17823
17837
|
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
17824
17838
|
if (forceKillAfterTimeout === true) {
|
|
@@ -17844,7 +17858,7 @@ var require_kill = __commonJS({
|
|
|
17844
17858
|
return spawnedPromise;
|
|
17845
17859
|
}
|
|
17846
17860
|
let timeoutId;
|
|
17847
|
-
const timeoutPromise = new Promise((
|
|
17861
|
+
const timeoutPromise = new Promise((resolve9, reject) => {
|
|
17848
17862
|
timeoutId = setTimeout(() => {
|
|
17849
17863
|
timeoutKill(spawned, killSignal, reject);
|
|
17850
17864
|
}, timeout);
|
|
@@ -17950,7 +17964,7 @@ var require_get_stream2 = __commonJS({
|
|
|
17950
17964
|
};
|
|
17951
17965
|
const { maxBuffer } = options;
|
|
17952
17966
|
const stream2 = bufferStream(options);
|
|
17953
|
-
await new Promise((
|
|
17967
|
+
await new Promise((resolve9, reject) => {
|
|
17954
17968
|
const rejectPromise = (error) => {
|
|
17955
17969
|
if (error && stream2.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
17956
17970
|
error.bufferedData = stream2.getBufferedValue();
|
|
@@ -17960,7 +17974,7 @@ var require_get_stream2 = __commonJS({
|
|
|
17960
17974
|
(async () => {
|
|
17961
17975
|
try {
|
|
17962
17976
|
await streamPipelinePromisified(inputStream, stream2);
|
|
17963
|
-
|
|
17977
|
+
resolve9();
|
|
17964
17978
|
} catch (error) {
|
|
17965
17979
|
rejectPromise(error);
|
|
17966
17980
|
}
|
|
@@ -18117,9 +18131,9 @@ var require_promise = __commonJS({
|
|
|
18117
18131
|
return spawned;
|
|
18118
18132
|
};
|
|
18119
18133
|
var getSpawnedPromise = (spawned) => {
|
|
18120
|
-
return new Promise((
|
|
18134
|
+
return new Promise((resolve9, reject) => {
|
|
18121
18135
|
spawned.on("exit", (exitCode, signal) => {
|
|
18122
|
-
|
|
18136
|
+
resolve9({ exitCode, signal });
|
|
18123
18137
|
});
|
|
18124
18138
|
spawned.on("error", (error) => {
|
|
18125
18139
|
reject(error);
|
|
@@ -18187,7 +18201,7 @@ var require_command = __commonJS({
|
|
|
18187
18201
|
var require_execa = __commonJS({
|
|
18188
18202
|
"node_modules/run-jxa/node_modules/execa/index.js"(exports, module) {
|
|
18189
18203
|
"use strict";
|
|
18190
|
-
var
|
|
18204
|
+
var path38 = __require("path");
|
|
18191
18205
|
var childProcess3 = __require("child_process");
|
|
18192
18206
|
var crossSpawn = require_cross_spawn();
|
|
18193
18207
|
var stripFinalNewline = require_strip_final_newline();
|
|
@@ -18229,7 +18243,7 @@ var require_execa = __commonJS({
|
|
|
18229
18243
|
};
|
|
18230
18244
|
options.env = getEnv(options);
|
|
18231
18245
|
options.stdio = normalizeStdio(options);
|
|
18232
|
-
if (process.platform === "win32" &&
|
|
18246
|
+
if (process.platform === "win32" && path38.basename(file, ".exe") === "cmd") {
|
|
18233
18247
|
args.unshift("/q");
|
|
18234
18248
|
}
|
|
18235
18249
|
return { file, args, options, parsed };
|
|
@@ -25586,13 +25600,13 @@ var setTextNodeValue = (node, text) => {
|
|
|
25586
25600
|
markNodeAsDirty(node);
|
|
25587
25601
|
};
|
|
25588
25602
|
var getPathToRoot = (node) => {
|
|
25589
|
-
const
|
|
25603
|
+
const path38 = [];
|
|
25590
25604
|
let current = node;
|
|
25591
25605
|
while (current) {
|
|
25592
|
-
|
|
25606
|
+
path38.unshift(current);
|
|
25593
25607
|
current = current.parentNode;
|
|
25594
25608
|
}
|
|
25595
|
-
return
|
|
25609
|
+
return path38;
|
|
25596
25610
|
};
|
|
25597
25611
|
var isNodeSelectable = (node) => {
|
|
25598
25612
|
let current = node;
|
|
@@ -30070,8 +30084,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
30070
30084
|
}
|
|
30071
30085
|
|
|
30072
30086
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
30073
|
-
var cleanupPath = (
|
|
30074
|
-
return
|
|
30087
|
+
var cleanupPath = (path38) => {
|
|
30088
|
+
return path38?.replace(`file://${cwd()}/`, "");
|
|
30075
30089
|
};
|
|
30076
30090
|
var stackUtils = new import_stack_utils.default({
|
|
30077
30091
|
cwd: cwd(),
|
|
@@ -31267,12 +31281,12 @@ var TerminalWriter = class {
|
|
|
31267
31281
|
if (chunk) {
|
|
31268
31282
|
this.synchronizedWrite(chunk);
|
|
31269
31283
|
}
|
|
31270
|
-
await new Promise((
|
|
31284
|
+
await new Promise((resolve9) => {
|
|
31271
31285
|
let finished = false;
|
|
31272
31286
|
const timer = setTimeout(() => {
|
|
31273
31287
|
finished = true;
|
|
31274
31288
|
this.cancelSlowFlush = void 0;
|
|
31275
|
-
|
|
31289
|
+
resolve9();
|
|
31276
31290
|
}, 50);
|
|
31277
31291
|
this.cancelSlowFlush = () => {
|
|
31278
31292
|
if (!finished) {
|
|
@@ -31283,7 +31297,7 @@ var TerminalWriter = class {
|
|
|
31283
31297
|
this.outputBuffer = [];
|
|
31284
31298
|
}
|
|
31285
31299
|
this.cancelSlowFlush = void 0;
|
|
31286
|
-
|
|
31300
|
+
resolve9();
|
|
31287
31301
|
}
|
|
31288
31302
|
};
|
|
31289
31303
|
});
|
|
@@ -31674,8 +31688,8 @@ var AnimationController = class {
|
|
|
31674
31688
|
if (!this.isRunning) {
|
|
31675
31689
|
return;
|
|
31676
31690
|
}
|
|
31677
|
-
return new Promise((
|
|
31678
|
-
this.idleResolvers.push(
|
|
31691
|
+
return new Promise((resolve9) => {
|
|
31692
|
+
this.idleResolvers.push(resolve9);
|
|
31679
31693
|
});
|
|
31680
31694
|
}
|
|
31681
31695
|
/**
|
|
@@ -31715,8 +31729,8 @@ var AnimationController = class {
|
|
|
31715
31729
|
clearInterval(this.intervalId);
|
|
31716
31730
|
this.intervalId = void 0;
|
|
31717
31731
|
}
|
|
31718
|
-
for (const
|
|
31719
|
-
|
|
31732
|
+
for (const resolve9 of this.idleResolvers) {
|
|
31733
|
+
resolve9();
|
|
31720
31734
|
}
|
|
31721
31735
|
this.idleResolvers = [];
|
|
31722
31736
|
}
|
|
@@ -33221,11 +33235,11 @@ var TerminalBuffer = class {
|
|
|
33221
33235
|
if (!this.worker?.connected) {
|
|
33222
33236
|
return 0;
|
|
33223
33237
|
}
|
|
33224
|
-
return new Promise((
|
|
33238
|
+
return new Promise((resolve9) => {
|
|
33225
33239
|
const handler2 = (message) => {
|
|
33226
33240
|
if (message.type === "linesUpdated") {
|
|
33227
33241
|
this.worker?.off("message", handler2);
|
|
33228
|
-
|
|
33242
|
+
resolve9(message.count);
|
|
33229
33243
|
}
|
|
33230
33244
|
};
|
|
33231
33245
|
this.worker?.on("message", handler2);
|
|
@@ -33234,7 +33248,7 @@ var TerminalBuffer = class {
|
|
|
33234
33248
|
} catch (error) {
|
|
33235
33249
|
this.worker?.off("message", handler2);
|
|
33236
33250
|
console.error("Failed to send getLinesUpdated message to worker:", error);
|
|
33237
|
-
|
|
33251
|
+
resolve9(0);
|
|
33238
33252
|
}
|
|
33239
33253
|
});
|
|
33240
33254
|
}
|
|
@@ -33746,8 +33760,8 @@ var Ink = class {
|
|
|
33746
33760
|
}
|
|
33747
33761
|
}
|
|
33748
33762
|
async waitUntilExit() {
|
|
33749
|
-
this.exitPromise ||= new Promise((
|
|
33750
|
-
this.resolveExitPromise =
|
|
33763
|
+
this.exitPromise ||= new Promise((resolve9, reject) => {
|
|
33764
|
+
this.resolveExitPromise = resolve9;
|
|
33751
33765
|
this.rejectExitPromise = reject;
|
|
33752
33766
|
});
|
|
33753
33767
|
return this.exitPromise;
|
|
@@ -34546,7 +34560,7 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
|
|
|
34546
34560
|
process.on("exit", cleanupTerminalOnExit);
|
|
34547
34561
|
process.on("SIGTERM", cleanupTerminalOnExit);
|
|
34548
34562
|
process.on("SIGINT", cleanupTerminalOnExit);
|
|
34549
|
-
return new Promise((
|
|
34563
|
+
return new Promise((resolve9) => {
|
|
34550
34564
|
const originalRawMode = process.stdin.isRaw;
|
|
34551
34565
|
if (!originalRawMode) {
|
|
34552
34566
|
process.stdin.setRawMode(true);
|
|
@@ -34567,7 +34581,7 @@ var TerminalCapabilityManager = class _TerminalCapabilityManager {
|
|
|
34567
34581
|
process.stdin.setRawMode(false);
|
|
34568
34582
|
}
|
|
34569
34583
|
this.detectionComplete = true;
|
|
34570
|
-
|
|
34584
|
+
resolve9();
|
|
34571
34585
|
};
|
|
34572
34586
|
timeoutId = setTimeout(cleanup, 1e3);
|
|
34573
34587
|
const onData = (data) => {
|
|
@@ -38960,7 +38974,6 @@ var ThemeManager = class {
|
|
|
38960
38974
|
try {
|
|
38961
38975
|
const theme2 = createCustomTheme(themeWithDefaults);
|
|
38962
38976
|
this.extensionThemes.set(namespacedName, theme2);
|
|
38963
|
-
debugLogger.log(`Registered theme: ${namespacedName}`);
|
|
38964
38977
|
} catch (error) {
|
|
38965
38978
|
debugLogger.warn(
|
|
38966
38979
|
`Failed to load custom theme "${namespacedName}":`,
|
|
@@ -38986,7 +38999,6 @@ var ThemeManager = class {
|
|
|
38986
38999
|
for (const theme2 of customThemes) {
|
|
38987
39000
|
const namespacedName = `${theme2.name} (${extensionName})`;
|
|
38988
39001
|
this.extensionThemes.delete(namespacedName);
|
|
38989
|
-
debugLogger.log(`Unregistered theme: ${namespacedName}`);
|
|
38990
39002
|
}
|
|
38991
39003
|
}
|
|
38992
39004
|
/**
|
|
@@ -39445,7 +39457,7 @@ var import_react34 = __toESM(require_react(), 1);
|
|
|
39445
39457
|
function useIdeTrustListener() {
|
|
39446
39458
|
const settings = useSettings();
|
|
39447
39459
|
const [connectionStatus, setConnectionStatus] = (0, import_react34.useState)(
|
|
39448
|
-
|
|
39460
|
+
IDEConnectionStatus.Disconnected
|
|
39449
39461
|
);
|
|
39450
39462
|
const previousTrust = (0, import_react34.useRef)(void 0);
|
|
39451
39463
|
const [restartReason, setRestartReason] = (0, import_react34.useState)("NONE");
|
|
@@ -39475,7 +39487,7 @@ function useIdeTrustListener() {
|
|
|
39475
39487
|
};
|
|
39476
39488
|
}, []);
|
|
39477
39489
|
const getSnapshot = () => {
|
|
39478
|
-
if (connectionStatus !==
|
|
39490
|
+
if (connectionStatus !== IDEConnectionStatus.Connected) {
|
|
39479
39491
|
return void 0;
|
|
39480
39492
|
}
|
|
39481
39493
|
return ideContextStore.get()?.workspaceState?.isTrusted;
|
|
@@ -40180,7 +40192,7 @@ async function initializeApp(config, settings) {
|
|
|
40180
40192
|
await ideClient.connect();
|
|
40181
40193
|
logIdeConnection(
|
|
40182
40194
|
config,
|
|
40183
|
-
new IdeConnectionEvent(
|
|
40195
|
+
new IdeConnectionEvent(IdeConnectionType.START)
|
|
40184
40196
|
);
|
|
40185
40197
|
}).catch((e) => {
|
|
40186
40198
|
debugLogger.error("Failed to initialize IDE client:", e);
|
|
@@ -40198,16 +40210,16 @@ async function initializeApp(config, settings) {
|
|
|
40198
40210
|
// packages/cli/src/config/auth.ts
|
|
40199
40211
|
function validateAuthMethod(authMethod) {
|
|
40200
40212
|
loadEnvironment(loadSettings().merged, process.cwd());
|
|
40201
|
-
if (authMethod ===
|
|
40213
|
+
if (authMethod === AuthType.LOGIN_WITH_GOOGLE || authMethod === AuthType.COMPUTE_ADC) {
|
|
40202
40214
|
return null;
|
|
40203
40215
|
}
|
|
40204
|
-
if (authMethod ===
|
|
40216
|
+
if (authMethod === AuthType.USE_GEMINI) {
|
|
40205
40217
|
if (!process.env["GEMINI_API_KEY"]) {
|
|
40206
40218
|
return "When using Gemini API, you must specify the GEMINI_API_KEY environment variable.\nUpdate your environment and try again (no reload needed if using .env)!";
|
|
40207
40219
|
}
|
|
40208
40220
|
return null;
|
|
40209
40221
|
}
|
|
40210
|
-
if (authMethod ===
|
|
40222
|
+
if (authMethod === AuthType.USE_VERTEX_AI) {
|
|
40211
40223
|
const hasVertexProjectLocationConfig = !!process.env["GOOGLE_CLOUD_PROJECT"] && !!process.env["GOOGLE_CLOUD_LOCATION"];
|
|
40212
40224
|
const hasGoogleApiKey = !!process.env["GOOGLE_API_KEY"];
|
|
40213
40225
|
if (!hasVertexProjectLocationConfig && !hasGoogleApiKey) {
|
|
@@ -40265,25 +40277,25 @@ async function promptForConsentNonInteractive(prompt, defaultValue = true) {
|
|
|
40265
40277
|
input: process.stdin,
|
|
40266
40278
|
output: process.stdout
|
|
40267
40279
|
});
|
|
40268
|
-
return new Promise((
|
|
40280
|
+
return new Promise((resolve9) => {
|
|
40269
40281
|
rl.question(prompt, (answer) => {
|
|
40270
40282
|
rl.close();
|
|
40271
40283
|
const trimmedAnswer = answer.trim().toLowerCase();
|
|
40272
40284
|
if (trimmedAnswer === "") {
|
|
40273
|
-
|
|
40285
|
+
resolve9(defaultValue);
|
|
40274
40286
|
} else {
|
|
40275
|
-
|
|
40287
|
+
resolve9(["y", "yes"].includes(trimmedAnswer));
|
|
40276
40288
|
}
|
|
40277
40289
|
});
|
|
40278
40290
|
});
|
|
40279
40291
|
}
|
|
40280
40292
|
async function promptForConsentInteractive(prompt, addExtensionUpdateConfirmationRequest, clearConfirmationRequest) {
|
|
40281
|
-
return new Promise((
|
|
40293
|
+
return new Promise((resolve9) => {
|
|
40282
40294
|
addExtensionUpdateConfirmationRequest({
|
|
40283
40295
|
prompt,
|
|
40284
40296
|
onConfirm: (resolvedConfirmed) => {
|
|
40285
40297
|
clearConfirmationRequest?.();
|
|
40286
|
-
setImmediate(() =>
|
|
40298
|
+
setImmediate(() => resolve9(resolvedConfirmed));
|
|
40287
40299
|
}
|
|
40288
40300
|
});
|
|
40289
40301
|
});
|
|
@@ -40448,10 +40460,7 @@ function recursivelyHydrateStrings(obj, values) {
|
|
|
40448
40460
|
}
|
|
40449
40461
|
if (Array.isArray(obj)) {
|
|
40450
40462
|
return obj.map(
|
|
40451
|
-
(item) => (
|
|
40452
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
40453
|
-
recursivelyHydrateStrings(item, values)
|
|
40454
|
-
)
|
|
40463
|
+
(item) => recursivelyHydrateStrings(item, values)
|
|
40455
40464
|
);
|
|
40456
40465
|
}
|
|
40457
40466
|
if (typeof obj === "object" && obj !== null) {
|
|
@@ -40546,7 +40555,9 @@ async function maybePromptForSettings(extensionConfig, extensionId, requestSetti
|
|
|
40546
40555
|
settingsChanges.promptForEnv
|
|
40547
40556
|
)) {
|
|
40548
40557
|
const answer = await requestSetting(setting);
|
|
40549
|
-
|
|
40558
|
+
if (answer !== void 0) {
|
|
40559
|
+
allSettings[setting.envVar] = answer;
|
|
40560
|
+
}
|
|
40550
40561
|
}
|
|
40551
40562
|
const nonSensitiveSettings = {};
|
|
40552
40563
|
for (const setting of settings) {
|
|
@@ -40597,7 +40608,7 @@ async function promptForSetting(setting) {
|
|
|
40597
40608
|
message: `${setting.name}
|
|
40598
40609
|
${setting.description}`
|
|
40599
40610
|
});
|
|
40600
|
-
return response.value;
|
|
40611
|
+
return typeof response.value === "string" ? response.value : void 0;
|
|
40601
40612
|
}
|
|
40602
40613
|
async function getScopedEnvContents(extensionConfig, extensionId, scope, workspaceDir) {
|
|
40603
40614
|
const { name: extensionName } = extensionConfig;
|
|
@@ -40656,6 +40667,9 @@ async function updateSetting(extensionConfig, extensionId, settingKey, requestSe
|
|
|
40656
40667
|
return;
|
|
40657
40668
|
}
|
|
40658
40669
|
const newValue = await requestSetting(settingToUpdate);
|
|
40670
|
+
if (newValue === void 0) {
|
|
40671
|
+
return;
|
|
40672
|
+
}
|
|
40659
40673
|
const keychain = new KeychainTokenStorage(
|
|
40660
40674
|
getKeychainStorageName(extensionName, extensionId, scope, workspaceDir)
|
|
40661
40675
|
);
|
|
@@ -40804,8 +40818,8 @@ var Override = class _Override {
|
|
|
40804
40818
|
output() {
|
|
40805
40819
|
return `${this.isDisable ? "!" : ""}${this.baseRule}${this.includeSubdirs ? "*" : ""}`;
|
|
40806
40820
|
}
|
|
40807
|
-
matchesPath(
|
|
40808
|
-
return this.asRegex().test(
|
|
40821
|
+
matchesPath(path38) {
|
|
40822
|
+
return this.asRegex().test(path38);
|
|
40809
40823
|
}
|
|
40810
40824
|
};
|
|
40811
40825
|
var ensureLeadingAndTrailingSlash = function(dirPath) {
|
|
@@ -40876,7 +40890,12 @@ var ExtensionEnablementManager = class {
|
|
|
40876
40890
|
readConfig() {
|
|
40877
40891
|
try {
|
|
40878
40892
|
const content = fs12.readFileSync(this.configFilePath, "utf-8");
|
|
40879
|
-
|
|
40893
|
+
const parsed = JSON.parse(content);
|
|
40894
|
+
const schema = external_exports.record(
|
|
40895
|
+
external_exports.string(),
|
|
40896
|
+
external_exports.object({ overrides: external_exports.array(external_exports.string()) })
|
|
40897
|
+
);
|
|
40898
|
+
return schema.parse(parsed);
|
|
40880
40899
|
} catch (error) {
|
|
40881
40900
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
40882
40901
|
return {};
|
|
@@ -43946,7 +43965,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
43946
43965
|
if (token) {
|
|
43947
43966
|
headers.Authorization = `token ${token}`;
|
|
43948
43967
|
}
|
|
43949
|
-
return new Promise((
|
|
43968
|
+
return new Promise((resolve9, reject) => {
|
|
43950
43969
|
https.get(url, { headers }, (res) => {
|
|
43951
43970
|
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
43952
43971
|
if (redirectCount >= 10) {
|
|
@@ -43959,7 +43978,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
43959
43978
|
fetchJson(
|
|
43960
43979
|
new URL(res.headers.location, url).toString(),
|
|
43961
43980
|
redirectCount + 1
|
|
43962
|
-
).then(
|
|
43981
|
+
).then(resolve9).catch(reject);
|
|
43963
43982
|
return;
|
|
43964
43983
|
}
|
|
43965
43984
|
if (res.statusCode !== 200) {
|
|
@@ -43971,7 +43990,7 @@ async function fetchJson(url, redirectCount = 0) {
|
|
|
43971
43990
|
res.on("data", (chunk) => chunks.push(chunk));
|
|
43972
43991
|
res.on("end", () => {
|
|
43973
43992
|
const data = Buffer.concat(chunks).toString();
|
|
43974
|
-
|
|
43993
|
+
resolve9(JSON.parse(data));
|
|
43975
43994
|
});
|
|
43976
43995
|
}).on("error", reject);
|
|
43977
43996
|
});
|
|
@@ -44331,7 +44350,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44331
44350
|
if (token) {
|
|
44332
44351
|
headers["Authorization"] = `token ${token}`;
|
|
44333
44352
|
}
|
|
44334
|
-
return new Promise((
|
|
44353
|
+
return new Promise((resolve9, reject) => {
|
|
44335
44354
|
https2.get(url, { headers }, (res) => {
|
|
44336
44355
|
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
44337
44356
|
if (redirectCount >= 10) {
|
|
@@ -44342,7 +44361,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44342
44361
|
new Error("Redirect response missing Location header")
|
|
44343
44362
|
);
|
|
44344
44363
|
}
|
|
44345
|
-
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(
|
|
44364
|
+
downloadFile(res.headers.location, dest, options, redirectCount + 1).then(resolve9).catch(reject);
|
|
44346
44365
|
return;
|
|
44347
44366
|
}
|
|
44348
44367
|
if (res.statusCode !== 200) {
|
|
@@ -44352,7 +44371,7 @@ async function downloadFile(url, dest, options, redirectCount = 0) {
|
|
|
44352
44371
|
}
|
|
44353
44372
|
const file = fs15.createWriteStream(dest);
|
|
44354
44373
|
res.pipe(file);
|
|
44355
|
-
file.on("finish", () => file.close(
|
|
44374
|
+
file.on("finish", () => file.close(resolve9));
|
|
44356
44375
|
}).on("error", reject);
|
|
44357
44376
|
});
|
|
44358
44377
|
}
|
|
@@ -44383,7 +44402,7 @@ var defaultRequestConfirmation = async (message) => {
|
|
|
44383
44402
|
message,
|
|
44384
44403
|
initial: false
|
|
44385
44404
|
});
|
|
44386
|
-
return response.confirm;
|
|
44405
|
+
return typeof response.confirm === "boolean" ? response.confirm : false;
|
|
44387
44406
|
};
|
|
44388
44407
|
async function getExtensionManager() {
|
|
44389
44408
|
const workspaceDir = process.cwd();
|
|
@@ -44627,7 +44646,7 @@ var ExtensionManager = class extends ExtensionLoader {
|
|
|
44627
44646
|
const trustedFolders = loadTrustedFolders();
|
|
44628
44647
|
await trustedFolders.setValue(
|
|
44629
44648
|
this.workspaceDir,
|
|
44630
|
-
|
|
44649
|
+
TrustLevel.TRUST_FOLDER
|
|
44631
44650
|
);
|
|
44632
44651
|
} else {
|
|
44633
44652
|
throw new Error(
|
|
@@ -44813,7 +44832,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44813
44832
|
newExtensionConfig.version,
|
|
44814
44833
|
previousExtensionConfig.version,
|
|
44815
44834
|
installMetadata.type,
|
|
44816
|
-
|
|
44835
|
+
CoreToolCallStatus.Success
|
|
44817
44836
|
)
|
|
44818
44837
|
);
|
|
44819
44838
|
if (newExtensionName !== previousName) {
|
|
@@ -44836,7 +44855,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44836
44855
|
getExtensionId(newExtensionConfig, installMetadata),
|
|
44837
44856
|
newExtensionConfig.version,
|
|
44838
44857
|
installMetadata.type,
|
|
44839
|
-
|
|
44858
|
+
CoreToolCallStatus.Success
|
|
44840
44859
|
)
|
|
44841
44860
|
);
|
|
44842
44861
|
await this.enableExtension(
|
|
@@ -44869,7 +44888,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44869
44888
|
newExtensionConfig?.version ?? "",
|
|
44870
44889
|
previousExtensionConfig.version,
|
|
44871
44890
|
installMetadata.type,
|
|
44872
|
-
|
|
44891
|
+
CoreToolCallStatus.Error
|
|
44873
44892
|
)
|
|
44874
44893
|
);
|
|
44875
44894
|
} else {
|
|
@@ -44881,7 +44900,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44881
44900
|
extensionId ?? "",
|
|
44882
44901
|
newExtensionConfig?.version ?? "",
|
|
44883
44902
|
installMetadata.type,
|
|
44884
|
-
|
|
44903
|
+
CoreToolCallStatus.Error
|
|
44885
44904
|
)
|
|
44886
44905
|
);
|
|
44887
44906
|
}
|
|
@@ -44912,7 +44931,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
44912
44931
|
extension.name,
|
|
44913
44932
|
hashValue(extension.name),
|
|
44914
44933
|
extension.id,
|
|
44915
|
-
|
|
44934
|
+
CoreToolCallStatus.Success
|
|
44916
44935
|
)
|
|
44917
44936
|
);
|
|
44918
44937
|
}
|
|
@@ -45182,7 +45201,7 @@ Would you like to attempt to install via "git clone" instead?`
|
|
|
45182
45201
|
if (eventHooks) {
|
|
45183
45202
|
for (const definition of eventHooks) {
|
|
45184
45203
|
for (const hook of definition.hooks) {
|
|
45185
|
-
if (hook.type ===
|
|
45204
|
+
if (hook.type === HookType.Command) {
|
|
45186
45205
|
hook.env = { ...hook.env, ...hookEnv };
|
|
45187
45206
|
}
|
|
45188
45207
|
}
|
|
@@ -45511,7 +45530,7 @@ function validateName(name) {
|
|
|
45511
45530
|
}
|
|
45512
45531
|
}
|
|
45513
45532
|
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:")) {
|
|
45533
|
+
if (source2.startsWith("http://") || source2.startsWith("https://") || source2.startsWith("git@") || source2.startsWith("sso://") || source2.startsWith("github:") || source2.startsWith("gitlab:") || source2.startsWith("ssh://")) {
|
|
45515
45534
|
return {
|
|
45516
45535
|
source: source2,
|
|
45517
45536
|
type: "git",
|
|
@@ -45833,9 +45852,9 @@ function isSettingsValue(value) {
|
|
|
45833
45852
|
const type = typeof value;
|
|
45834
45853
|
return type === "string" || type === "number" || type === "boolean" || type === "object";
|
|
45835
45854
|
}
|
|
45836
|
-
function getNestedValue(obj,
|
|
45855
|
+
function getNestedValue(obj, path38) {
|
|
45837
45856
|
let current = obj;
|
|
45838
|
-
for (const key of
|
|
45857
|
+
for (const key of path38) {
|
|
45839
45858
|
if (!isRecord(current) || !(key in current)) {
|
|
45840
45859
|
return void 0;
|
|
45841
45860
|
}
|
|
@@ -45848,8 +45867,8 @@ function getEffectiveValue(key, settings) {
|
|
|
45848
45867
|
if (!definition) {
|
|
45849
45868
|
return void 0;
|
|
45850
45869
|
}
|
|
45851
|
-
const
|
|
45852
|
-
const value = getNestedValue(settings,
|
|
45870
|
+
const path38 = key.split(".");
|
|
45871
|
+
const value = getNestedValue(settings, path38);
|
|
45853
45872
|
if (value !== void 0 && isSettingsValue(value)) {
|
|
45854
45873
|
return value;
|
|
45855
45874
|
}
|
|
@@ -45859,8 +45878,8 @@ function getDialogSettingKeys() {
|
|
|
45859
45878
|
return Object.values(getFlattenedSchema()).filter((definition) => definition.showInDialog !== false).map((definition) => definition.key);
|
|
45860
45879
|
}
|
|
45861
45880
|
function isInSettingsScope(key, scopeSettings) {
|
|
45862
|
-
const
|
|
45863
|
-
const value = getNestedValue(scopeSettings,
|
|
45881
|
+
const path38 = key.split(".");
|
|
45882
|
+
const value = getNestedValue(scopeSettings, path38);
|
|
45864
45883
|
return value !== void 0;
|
|
45865
45884
|
}
|
|
45866
45885
|
function getDisplayValue(key, scopeSettings, _mergedSettings) {
|
|
@@ -46214,7 +46233,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
46214
46233
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
46215
46234
|
name: `resources/read (${resource.serverName})`,
|
|
46216
46235
|
description: resource.uri,
|
|
46217
|
-
status:
|
|
46236
|
+
status: CoreToolCallStatus.Success,
|
|
46218
46237
|
isClientInitiated: true,
|
|
46219
46238
|
resultDisplay: `Successfully read resource ${resource.uri}`,
|
|
46220
46239
|
confirmationDetails: void 0
|
|
@@ -46229,7 +46248,7 @@ async function readMcpResources(resourceParts, config, signal) {
|
|
|
46229
46248
|
callId: `mcp-resource-${resource.serverName}-${resource.uri}`,
|
|
46230
46249
|
name: `resources/read (${resource.serverName})`,
|
|
46231
46250
|
description: resource.uri,
|
|
46232
|
-
status:
|
|
46251
|
+
status: CoreToolCallStatus.Error,
|
|
46233
46252
|
isClientInitiated: true,
|
|
46234
46253
|
resultDisplay: `Error reading resource ${resource.uri}: ${getErrorMessage(error)}`,
|
|
46235
46254
|
confirmationDetails: void 0
|
|
@@ -46254,7 +46273,7 @@ Content from @${result.uri}:
|
|
|
46254
46273
|
}
|
|
46255
46274
|
if (hasError) {
|
|
46256
46275
|
const firstError = displays.find(
|
|
46257
|
-
(d) => d.status ===
|
|
46276
|
+
(d) => d.status === CoreToolCallStatus.Error
|
|
46258
46277
|
);
|
|
46259
46278
|
return {
|
|
46260
46279
|
parts: [],
|
|
@@ -46290,7 +46309,7 @@ async function readLocalFiles(resolvedFiles, config, signal, userMessageTimestam
|
|
|
46290
46309
|
callId: `client-read-${userMessageTimestamp}`,
|
|
46291
46310
|
name: readManyFilesTool.displayName,
|
|
46292
46311
|
description: invocation.getDescription(),
|
|
46293
|
-
status:
|
|
46312
|
+
status: CoreToolCallStatus.Success,
|
|
46294
46313
|
isClientInitiated: true,
|
|
46295
46314
|
resultDisplay: result.returnDisplay || `Successfully read: ${fileLabelsForDisplay.join(", ")}`,
|
|
46296
46315
|
confirmationDetails: void 0
|
|
@@ -46337,7 +46356,7 @@ Content from @${displayPath}:
|
|
|
46337
46356
|
callId: `client-read-${userMessageTimestamp}`,
|
|
46338
46357
|
name: readManyFilesTool.displayName,
|
|
46339
46358
|
description: invocation?.getDescription() ?? "Error attempting to execute tool to read files",
|
|
46340
|
-
status:
|
|
46359
|
+
status: CoreToolCallStatus.Error,
|
|
46341
46360
|
isClientInitiated: true,
|
|
46342
46361
|
resultDisplay: `Error reading files (${fileLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,
|
|
46343
46362
|
confirmationDetails: void 0
|
|
@@ -46925,7 +46944,7 @@ async function writeClipboardImages(filePaths) {
|
|
|
46925
46944
|
if (process22.platform !== "darwin") {
|
|
46926
46945
|
return;
|
|
46927
46946
|
}
|
|
46928
|
-
const paths = filePaths.map((
|
|
46947
|
+
const paths = filePaths.map((path38) => path38 instanceof URL ? fileURLToPath2(path38) : path38);
|
|
46929
46948
|
await runJxa((...paths2) => {
|
|
46930
46949
|
ObjC.import("AppKit");
|
|
46931
46950
|
ObjC.import("Foundation");
|
|
@@ -47428,7 +47447,7 @@ var OSC52_FOOTER = BEL3;
|
|
|
47428
47447
|
var MAX_OSC52_BODY_B64_BYTES = MAX_OSC52_SEQUENCE_BYTES - Buffer.byteLength(OSC52_HEADER) - Buffer.byteLength(OSC52_FOOTER);
|
|
47429
47448
|
var MAX_OSC52_DATA_BYTES = Math.floor(MAX_OSC52_BODY_B64_BYTES / 4) * 3;
|
|
47430
47449
|
var SCREEN_DCS_CHUNK_SIZE = 240;
|
|
47431
|
-
var pickTty = () => new Promise((
|
|
47450
|
+
var pickTty = () => new Promise((resolve9) => {
|
|
47432
47451
|
if (process.platform !== "win32") {
|
|
47433
47452
|
try {
|
|
47434
47453
|
const devTty = fs22.createWriteStream("/dev/tty");
|
|
@@ -47436,25 +47455,25 @@ var pickTty = () => new Promise((resolve8) => {
|
|
|
47436
47455
|
devTty.removeAllListeners("open");
|
|
47437
47456
|
devTty.removeAllListeners("error");
|
|
47438
47457
|
devTty.destroy();
|
|
47439
|
-
|
|
47458
|
+
resolve9(getStdioTty());
|
|
47440
47459
|
}, 100);
|
|
47441
47460
|
devTty.once("open", () => {
|
|
47442
47461
|
clearTimeout(timeout);
|
|
47443
47462
|
devTty.removeAllListeners("error");
|
|
47444
47463
|
devTty.on("error", () => {
|
|
47445
47464
|
});
|
|
47446
|
-
|
|
47465
|
+
resolve9({ stream: devTty, closeAfter: true });
|
|
47447
47466
|
});
|
|
47448
47467
|
devTty.once("error", () => {
|
|
47449
47468
|
clearTimeout(timeout);
|
|
47450
47469
|
devTty.removeAllListeners("open");
|
|
47451
|
-
|
|
47470
|
+
resolve9(getStdioTty());
|
|
47452
47471
|
});
|
|
47453
47472
|
return;
|
|
47454
47473
|
} catch {
|
|
47455
47474
|
}
|
|
47456
47475
|
}
|
|
47457
|
-
|
|
47476
|
+
resolve9(getStdioTty());
|
|
47458
47477
|
});
|
|
47459
47478
|
var getStdioTty = () => {
|
|
47460
47479
|
if (process.platform === "win32") {
|
|
@@ -47508,12 +47527,12 @@ var wrapForScreen = (seq) => {
|
|
|
47508
47527
|
}
|
|
47509
47528
|
return out;
|
|
47510
47529
|
};
|
|
47511
|
-
var writeAll = (stream, data) => new Promise((
|
|
47530
|
+
var writeAll = (stream, data) => new Promise((resolve9, reject) => {
|
|
47512
47531
|
const fd = stream.fd;
|
|
47513
47532
|
if (process.platform === "win32" && typeof fd === "number" && (stream === process.stdout || stream === process.stderr)) {
|
|
47514
47533
|
try {
|
|
47515
47534
|
fs22.writeSync(fd, data);
|
|
47516
|
-
|
|
47535
|
+
resolve9();
|
|
47517
47536
|
return;
|
|
47518
47537
|
} catch (e) {
|
|
47519
47538
|
debugLogger.warn(
|
|
@@ -47528,7 +47547,7 @@ var writeAll = (stream, data) => new Promise((resolve8, reject) => {
|
|
|
47528
47547
|
};
|
|
47529
47548
|
const onDrain = () => {
|
|
47530
47549
|
cleanup();
|
|
47531
|
-
|
|
47550
|
+
resolve9();
|
|
47532
47551
|
};
|
|
47533
47552
|
const cleanup = () => {
|
|
47534
47553
|
stream.off("error", onError);
|
|
@@ -47537,7 +47556,7 @@ var writeAll = (stream, data) => new Promise((resolve8, reject) => {
|
|
|
47537
47556
|
stream.once("error", onError);
|
|
47538
47557
|
if (stream.write(data)) {
|
|
47539
47558
|
cleanup();
|
|
47540
|
-
|
|
47559
|
+
resolve9();
|
|
47541
47560
|
} else {
|
|
47542
47561
|
stream.once("drain", onDrain);
|
|
47543
47562
|
}
|
|
@@ -47667,14 +47686,14 @@ function getUserLinuxClipboardTool() {
|
|
|
47667
47686
|
}
|
|
47668
47687
|
}
|
|
47669
47688
|
async function saveFromCommand(command, args, destination) {
|
|
47670
|
-
return new Promise((
|
|
47689
|
+
return new Promise((resolve9) => {
|
|
47671
47690
|
const child = spawn(command, args);
|
|
47672
47691
|
const fileStream = createWriteStream2(destination);
|
|
47673
47692
|
let resolved = false;
|
|
47674
47693
|
const safeResolve = (value) => {
|
|
47675
47694
|
if (!resolved) {
|
|
47676
47695
|
resolved = true;
|
|
47677
|
-
|
|
47696
|
+
resolve9(value);
|
|
47678
47697
|
}
|
|
47679
47698
|
};
|
|
47680
47699
|
child.stdout.pipe(fileStream);
|
|
@@ -49532,7 +49551,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49532
49551
|
throw err;
|
|
49533
49552
|
}
|
|
49534
49553
|
} else {
|
|
49535
|
-
await new Promise((
|
|
49554
|
+
await new Promise((resolve9, reject) => {
|
|
49536
49555
|
const child = spawn2(executable, [...initialArgs, ...args], {
|
|
49537
49556
|
stdio: "inherit",
|
|
49538
49557
|
shell: process.platform === "win32"
|
|
@@ -49557,7 +49576,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49557
49576
|
);
|
|
49558
49577
|
reject(err);
|
|
49559
49578
|
} else {
|
|
49560
|
-
|
|
49579
|
+
resolve9();
|
|
49561
49580
|
}
|
|
49562
49581
|
});
|
|
49563
49582
|
});
|
|
@@ -49566,7 +49585,7 @@ async function openFileInEditor(filePath, stdin, setRawMode, preferredEditorType
|
|
|
49566
49585
|
if (wasRaw) {
|
|
49567
49586
|
setRawMode?.(true);
|
|
49568
49587
|
}
|
|
49569
|
-
coreEvents.emit(
|
|
49588
|
+
coreEvents.emit(CoreEvent.ExternalEditorClosed);
|
|
49570
49589
|
}
|
|
49571
49590
|
}
|
|
49572
49591
|
|
|
@@ -52256,7 +52275,7 @@ async function updateExtension(extension, extensionManager, currentState, dispat
|
|
|
52256
52275
|
extension.name,
|
|
52257
52276
|
installMetadata
|
|
52258
52277
|
);
|
|
52259
|
-
if (status ===
|
|
52278
|
+
if (status === IntegrityDataStatus.INVALID) {
|
|
52260
52279
|
throw new Error("Extension integrity cannot be verified");
|
|
52261
52280
|
}
|
|
52262
52281
|
} catch (e) {
|
|
@@ -53674,11 +53693,11 @@ var ShellProcessor = class {
|
|
|
53674
53693
|
},
|
|
53675
53694
|
void 0
|
|
53676
53695
|
);
|
|
53677
|
-
if (decision ===
|
|
53696
|
+
if (decision === PolicyDecision.DENY) {
|
|
53678
53697
|
throw new Error(
|
|
53679
53698
|
`${this.commandName} cannot be run. Blocked command: "${command}". Reason: Blocked by policy.`
|
|
53680
53699
|
);
|
|
53681
|
-
} else if (decision ===
|
|
53700
|
+
} else if (decision === PolicyDecision.ASK_USER) {
|
|
53682
53701
|
commandsToConfirm.add(command);
|
|
53683
53702
|
}
|
|
53684
53703
|
}
|
|
@@ -53935,14 +53954,17 @@ var FileCommandLoader = class {
|
|
|
53935
53954
|
getCommandDirectories() {
|
|
53936
53955
|
const dirs = [];
|
|
53937
53956
|
const storage = this.config?.storage ?? new Storage(this.projectRoot);
|
|
53957
|
+
const userCommandsDir = Storage.getUserCommandsDir();
|
|
53938
53958
|
dirs.push({
|
|
53939
|
-
path:
|
|
53959
|
+
path: userCommandsDir,
|
|
53940
53960
|
kind: "user-file" /* USER_FILE */
|
|
53941
53961
|
});
|
|
53942
|
-
|
|
53943
|
-
|
|
53944
|
-
|
|
53945
|
-
|
|
53962
|
+
if (!storage.isWorkspaceHomeDir()) {
|
|
53963
|
+
dirs.push({
|
|
53964
|
+
path: storage.getProjectCommandsDir(),
|
|
53965
|
+
kind: "workspace-file" /* WORKSPACE_FILE */
|
|
53966
|
+
});
|
|
53967
|
+
}
|
|
53946
53968
|
if (this.config) {
|
|
53947
53969
|
const activeExtensions = this.config.getExtensions().filter((ext) => ext.isActive).sort((a, b2) => a.name.localeCompare(b2.name));
|
|
53948
53970
|
const extensionCommandDirs = activeExtensions.map((ext) => ({
|
|
@@ -54793,7 +54815,7 @@ var MultiFolderTrustDialog = ({
|
|
|
54793
54815
|
if (choice === 1 /* YES_AND_REMEMBER */) {
|
|
54794
54816
|
await trustedFolders.setValue(
|
|
54795
54817
|
expandedPath,
|
|
54796
|
-
|
|
54818
|
+
TrustLevel.TRUST_FOLDER
|
|
54797
54819
|
);
|
|
54798
54820
|
}
|
|
54799
54821
|
workspaceContext.addDirectory(expandedPath);
|
|
@@ -55947,10 +55969,10 @@ function enableFeature(settings, featureName, strategy) {
|
|
|
55947
55969
|
};
|
|
55948
55970
|
}
|
|
55949
55971
|
const modifiedScopes = [];
|
|
55950
|
-
for (const { scope, path:
|
|
55972
|
+
for (const { scope, path: path38 } of foundInDisabledScopes) {
|
|
55951
55973
|
if (isLoadableSettingScope(scope)) {
|
|
55952
55974
|
strategy.enable(settings, scope, featureName);
|
|
55953
|
-
modifiedScopes.push({ scope, path:
|
|
55975
|
+
modifiedScopes.push({ scope, path: path38 });
|
|
55954
55976
|
}
|
|
55955
55977
|
}
|
|
55956
55978
|
return {
|
|
@@ -56441,7 +56463,7 @@ var authCommand = {
|
|
|
56441
56463
|
import process28 from "node:process";
|
|
56442
56464
|
|
|
56443
56465
|
// packages/cli/src/generated/git-commit.ts
|
|
56444
|
-
var GIT_COMMIT_INFO = "
|
|
56466
|
+
var GIT_COMMIT_INFO = "5ee05c775";
|
|
56445
56467
|
|
|
56446
56468
|
// packages/cli/src/ui/utils/historyExportUtils.ts
|
|
56447
56469
|
import * as fsPromises from "node:fs/promises";
|
|
@@ -57087,7 +57109,7 @@ var clearCommand = {
|
|
|
57087
57109
|
const config = context.services.agentContext?.config;
|
|
57088
57110
|
const hookSystem = config?.getHookSystem();
|
|
57089
57111
|
if (hookSystem) {
|
|
57090
|
-
await hookSystem.fireSessionEndEvent(
|
|
57112
|
+
await hookSystem.fireSessionEndEvent(SessionEndReason.Clear);
|
|
57091
57113
|
}
|
|
57092
57114
|
config?.injectionService.clear();
|
|
57093
57115
|
let newSessionId;
|
|
@@ -57104,9 +57126,9 @@ var clearCommand = {
|
|
|
57104
57126
|
}
|
|
57105
57127
|
let result;
|
|
57106
57128
|
if (hookSystem) {
|
|
57107
|
-
result = await hookSystem.fireSessionStartEvent(
|
|
57129
|
+
result = await hookSystem.fireSessionStartEvent(SessionStartSource.Clear);
|
|
57108
57130
|
}
|
|
57109
|
-
await new Promise((
|
|
57131
|
+
await new Promise((resolve9) => setImmediate(resolve9));
|
|
57110
57132
|
if (config) {
|
|
57111
57133
|
await flushTelemetry(config);
|
|
57112
57134
|
}
|
|
@@ -57380,10 +57402,85 @@ ${docsUrl}`
|
|
|
57380
57402
|
}
|
|
57381
57403
|
};
|
|
57382
57404
|
|
|
57405
|
+
// packages/cli/src/ui/commands/exportSessionCommand.ts
|
|
57406
|
+
import * as fs30 from "node:fs/promises";
|
|
57407
|
+
import * as path27 from "node:path";
|
|
57408
|
+
var exportSessionCommand = {
|
|
57409
|
+
name: "export-session",
|
|
57410
|
+
description: "Export the current session to a JSON file",
|
|
57411
|
+
kind: "built-in" /* BUILT_IN */,
|
|
57412
|
+
autoExecute: true,
|
|
57413
|
+
action: async (context) => {
|
|
57414
|
+
const { ui: ui2 } = context;
|
|
57415
|
+
const args = context.invocation?.args.trim();
|
|
57416
|
+
if (!args) {
|
|
57417
|
+
return {
|
|
57418
|
+
type: "message",
|
|
57419
|
+
messageType: "error",
|
|
57420
|
+
content: "Please provide a file path to export the session to. Example: /export-session ./my-session.json"
|
|
57421
|
+
};
|
|
57422
|
+
}
|
|
57423
|
+
const sessionId = context.services.agentContext?.config.getSessionId();
|
|
57424
|
+
if (!sessionId) {
|
|
57425
|
+
return {
|
|
57426
|
+
type: "message",
|
|
57427
|
+
messageType: "error",
|
|
57428
|
+
content: "No active session found to export."
|
|
57429
|
+
};
|
|
57430
|
+
}
|
|
57431
|
+
if (ui2.pendingItem) {
|
|
57432
|
+
ui2.addItem(
|
|
57433
|
+
{
|
|
57434
|
+
type: "error" /* ERROR */,
|
|
57435
|
+
text: "Operation already in progress, please wait."
|
|
57436
|
+
},
|
|
57437
|
+
Date.now()
|
|
57438
|
+
);
|
|
57439
|
+
return;
|
|
57440
|
+
}
|
|
57441
|
+
const pendingMessage = {
|
|
57442
|
+
type: "export_session" /* EXPORT_SESSION */,
|
|
57443
|
+
exportSession: {
|
|
57444
|
+
isPending: true
|
|
57445
|
+
}
|
|
57446
|
+
};
|
|
57447
|
+
try {
|
|
57448
|
+
ui2.setPendingItem(pendingMessage);
|
|
57449
|
+
const storage = context.services.agentContext.config.storage;
|
|
57450
|
+
const sessionSelector = new SessionSelector(storage);
|
|
57451
|
+
const { sessionData } = await sessionSelector.resolveSession(sessionId);
|
|
57452
|
+
const targetPath = path27.resolve(process.cwd(), args);
|
|
57453
|
+
await fs30.writeFile(
|
|
57454
|
+
targetPath,
|
|
57455
|
+
JSON.stringify(sessionData, null, 2),
|
|
57456
|
+
"utf-8"
|
|
57457
|
+
);
|
|
57458
|
+
ui2.addItem(
|
|
57459
|
+
{
|
|
57460
|
+
type: "export_session" /* EXPORT_SESSION */,
|
|
57461
|
+
exportSession: {
|
|
57462
|
+
isPending: false,
|
|
57463
|
+
targetPath
|
|
57464
|
+
}
|
|
57465
|
+
},
|
|
57466
|
+
Date.now()
|
|
57467
|
+
);
|
|
57468
|
+
} catch (error) {
|
|
57469
|
+
return {
|
|
57470
|
+
type: "message",
|
|
57471
|
+
messageType: "error",
|
|
57472
|
+
content: `Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
57473
|
+
};
|
|
57474
|
+
} finally {
|
|
57475
|
+
ui2.setPendingItem(null);
|
|
57476
|
+
}
|
|
57477
|
+
}
|
|
57478
|
+
};
|
|
57479
|
+
|
|
57383
57480
|
// packages/cli/src/ui/commands/directoryCommand.tsx
|
|
57384
57481
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
57385
|
-
import * as
|
|
57386
|
-
import * as
|
|
57482
|
+
import * as path28 from "node:path";
|
|
57483
|
+
import * as fs31 from "node:fs";
|
|
57387
57484
|
async function finishAddingDirectories(config, addItem, added, errors) {
|
|
57388
57485
|
if (!config) {
|
|
57389
57486
|
addItem({
|
|
@@ -57451,15 +57548,15 @@ var directoryCommand = {
|
|
|
57451
57548
|
if (context.services.agentContext?.config) {
|
|
57452
57549
|
const workspaceContext = context.services.agentContext.config.getWorkspaceContext();
|
|
57453
57550
|
const existingDirs = new Set(
|
|
57454
|
-
workspaceContext.getDirectories().map((dir) =>
|
|
57551
|
+
workspaceContext.getDirectories().map((dir) => path28.resolve(dir))
|
|
57455
57552
|
);
|
|
57456
57553
|
filteredSuggestions = suggestions.filter((s3) => {
|
|
57457
57554
|
const expanded = expandHomeDir(s3);
|
|
57458
|
-
const absolute =
|
|
57555
|
+
const absolute = path28.resolve(expanded);
|
|
57459
57556
|
if (existingDirs.has(absolute)) {
|
|
57460
57557
|
return false;
|
|
57461
57558
|
}
|
|
57462
|
-
if (absolute.endsWith(
|
|
57559
|
+
if (absolute.endsWith(path28.sep) && existingDirs.has(absolute.slice(0, -1))) {
|
|
57463
57560
|
return false;
|
|
57464
57561
|
}
|
|
57465
57562
|
return true;
|
|
@@ -57509,11 +57606,11 @@ var directoryCommand = {
|
|
|
57509
57606
|
const trimmedPath = pathToAdd.trim();
|
|
57510
57607
|
const expandedPath = expandHomeDir(trimmedPath);
|
|
57511
57608
|
try {
|
|
57512
|
-
const absolutePath =
|
|
57609
|
+
const absolutePath = path28.resolve(
|
|
57513
57610
|
workspaceContext.targetDir,
|
|
57514
57611
|
expandedPath
|
|
57515
57612
|
);
|
|
57516
|
-
const resolvedPath =
|
|
57613
|
+
const resolvedPath = fs31.realpathSync(absolutePath);
|
|
57517
57614
|
if (currentWorkspaceDirs.includes(resolvedPath)) {
|
|
57518
57615
|
alreadyAdded.push(trimmedPath);
|
|
57519
57616
|
continue;
|
|
@@ -57539,7 +57636,7 @@ var directoryCommand = {
|
|
|
57539
57636
|
const dirsToConfirm = [];
|
|
57540
57637
|
const trustedDirs = [];
|
|
57541
57638
|
for (const pathToAdd of pathsToProcess) {
|
|
57542
|
-
const expandedPath =
|
|
57639
|
+
const expandedPath = path28.resolve(expandHomeDir(pathToAdd.trim()));
|
|
57543
57640
|
const isTrusted = trustedFolders.isPathTrusted(expandedPath);
|
|
57544
57641
|
if (isTrusted === true) {
|
|
57545
57642
|
trustedDirs.push(pathToAdd.trim());
|
|
@@ -57760,14 +57857,14 @@ var ConfigExtensionDialog = ({
|
|
|
57760
57857
|
[loggerAdapter]
|
|
57761
57858
|
);
|
|
57762
57859
|
const requestSetting = (0, import_react62.useCallback)(
|
|
57763
|
-
async (setting) => new Promise((
|
|
57860
|
+
async (setting) => new Promise((resolve9) => {
|
|
57764
57861
|
if (!mounted.current) return;
|
|
57765
57862
|
settingBuffer.setText("");
|
|
57766
57863
|
setState({
|
|
57767
57864
|
type: "ASK_SETTING",
|
|
57768
57865
|
setting,
|
|
57769
57866
|
resolve: (val) => {
|
|
57770
|
-
|
|
57867
|
+
resolve9(val);
|
|
57771
57868
|
setState({ type: "BUSY", message: "Updating..." });
|
|
57772
57869
|
}
|
|
57773
57870
|
});
|
|
@@ -57775,13 +57872,13 @@ var ConfigExtensionDialog = ({
|
|
|
57775
57872
|
[settingBuffer]
|
|
57776
57873
|
);
|
|
57777
57874
|
const requestConfirmation = (0, import_react62.useCallback)(
|
|
57778
|
-
async (message) => new Promise((
|
|
57875
|
+
async (message) => new Promise((resolve9) => {
|
|
57779
57876
|
if (!mounted.current) return;
|
|
57780
57877
|
setState({
|
|
57781
57878
|
type: "ASK_CONFIRMATION",
|
|
57782
57879
|
message,
|
|
57783
57880
|
resolve: (val) => {
|
|
57784
|
-
|
|
57881
|
+
resolve9(val);
|
|
57785
57882
|
setState({ type: "BUSY", message: "Processing..." });
|
|
57786
57883
|
}
|
|
57787
57884
|
});
|
|
@@ -58118,7 +58215,7 @@ function SearchableList({
|
|
|
58118
58215
|
var import_react64 = __toESM(require_react(), 1);
|
|
58119
58216
|
|
|
58120
58217
|
// packages/cli/src/config/extensionRegistryClient.ts
|
|
58121
|
-
import * as
|
|
58218
|
+
import * as fs32 from "node:fs/promises";
|
|
58122
58219
|
var ExtensionRegistryClient = class _ExtensionRegistryClient {
|
|
58123
58220
|
static DEFAULT_REGISTRY_URL = "https://geminicli.com/extensions.json";
|
|
58124
58221
|
static FETCH_TIMEOUT_MS = 1e4;
|
|
@@ -58196,7 +58293,7 @@ var ExtensionRegistryClient = class _ExtensionRegistryClient {
|
|
|
58196
58293
|
return await response.json();
|
|
58197
58294
|
} else {
|
|
58198
58295
|
const filePath = resolveToRealPath(uri);
|
|
58199
|
-
const content = await
|
|
58296
|
+
const content = await fs32.readFile(filePath, "utf-8");
|
|
58200
58297
|
return JSON.parse(content);
|
|
58201
58298
|
}
|
|
58202
58299
|
} catch (error) {
|
|
@@ -58367,8 +58464,8 @@ function ExtensionDetails({
|
|
|
58367
58464
|
if (keyMatchers["basic.confirm" /* RETURN */](key) && !isInstalled && !isInstalling) {
|
|
58368
58465
|
setIsInstalling(true);
|
|
58369
58466
|
void onInstall(
|
|
58370
|
-
(prompt) => new Promise((
|
|
58371
|
-
setConsentRequest({ prompt, resolve:
|
|
58467
|
+
(prompt) => new Promise((resolve9) => {
|
|
58468
|
+
setConsentRequest({ prompt, resolve: resolve9 });
|
|
58372
58469
|
})
|
|
58373
58470
|
);
|
|
58374
58471
|
return true;
|
|
@@ -58376,8 +58473,8 @@ function ExtensionDetails({
|
|
|
58376
58473
|
if (keyMatchers["extension.link" /* LINK_EXTENSION */](key) && isLinkable && !isInstalled && !isInstalling) {
|
|
58377
58474
|
setIsInstalling(true);
|
|
58378
58475
|
void onLink(
|
|
58379
|
-
(prompt) => new Promise((
|
|
58380
|
-
setConsentRequest({ prompt, resolve:
|
|
58476
|
+
(prompt) => new Promise((resolve9) => {
|
|
58477
|
+
setConsentRequest({ prompt, resolve: resolve9 });
|
|
58381
58478
|
})
|
|
58382
58479
|
);
|
|
58383
58480
|
return true;
|
|
@@ -58781,7 +58878,7 @@ function updateAction(context, args) {
|
|
|
58781
58878
|
}
|
|
58782
58879
|
let resolveUpdateComplete;
|
|
58783
58880
|
const updateComplete = new Promise(
|
|
58784
|
-
(
|
|
58881
|
+
(resolve9) => resolveUpdateComplete = resolve9
|
|
58785
58882
|
);
|
|
58786
58883
|
const extensions = context.services.agentContext?.config ? listExtensions(context.services.agentContext.config) : [];
|
|
58787
58884
|
if (showMessageIfNoExtensions(context, extensions)) {
|
|
@@ -59490,6 +59587,7 @@ var ConsoleSummaryDisplay = ({
|
|
|
59490
59587
|
|
|
59491
59588
|
// packages/cli/src/ui/components/Footer.tsx
|
|
59492
59589
|
import process33 from "node:process";
|
|
59590
|
+
import os7 from "node:os";
|
|
59493
59591
|
|
|
59494
59592
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
59495
59593
|
var import_react69 = __toESM(require_react(), 1);
|
|
@@ -59660,6 +59758,11 @@ var ALL_ITEMS = [
|
|
|
59660
59758
|
header: "session",
|
|
59661
59759
|
description: "Unique identifier for the current session"
|
|
59662
59760
|
},
|
|
59761
|
+
{
|
|
59762
|
+
id: "hostname",
|
|
59763
|
+
header: "machine",
|
|
59764
|
+
description: "Current machine hostname"
|
|
59765
|
+
},
|
|
59663
59766
|
{
|
|
59664
59767
|
id: "auth",
|
|
59665
59768
|
header: "/auth",
|
|
@@ -59685,6 +59788,7 @@ var DEFAULT_ORDER = [
|
|
|
59685
59788
|
"quota",
|
|
59686
59789
|
"memory-usage",
|
|
59687
59790
|
"session-id",
|
|
59791
|
+
"hostname",
|
|
59688
59792
|
"auth",
|
|
59689
59793
|
"code-changes",
|
|
59690
59794
|
"token-count"
|
|
@@ -59733,6 +59837,7 @@ function resolveFooterState(settings) {
|
|
|
59733
59837
|
|
|
59734
59838
|
// packages/cli/src/ui/components/Footer.tsx
|
|
59735
59839
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
59840
|
+
var HOSTNAME = os7.hostname();
|
|
59736
59841
|
var CwdIndicator = ({
|
|
59737
59842
|
targetDir,
|
|
59738
59843
|
maxWidth,
|
|
@@ -60008,10 +60113,19 @@ var Footer = () => {
|
|
|
60008
60113
|
);
|
|
60009
60114
|
break;
|
|
60010
60115
|
}
|
|
60116
|
+
case "hostname": {
|
|
60117
|
+
addCol(
|
|
60118
|
+
id,
|
|
60119
|
+
header,
|
|
60120
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text, { color: itemColor, children: HOSTNAME }),
|
|
60121
|
+
HOSTNAME.length
|
|
60122
|
+
);
|
|
60123
|
+
break;
|
|
60124
|
+
}
|
|
60011
60125
|
case "auth": {
|
|
60012
60126
|
if (!settings.merged.ui.showUserIdentity) break;
|
|
60013
60127
|
if (!authType) break;
|
|
60014
|
-
const displayStr = authType ===
|
|
60128
|
+
const displayStr = authType === AuthType.LOGIN_WITH_GOOGLE ? email ?? "google" : authType;
|
|
60015
60129
|
addCol(
|
|
60016
60130
|
id,
|
|
60017
60131
|
header,
|
|
@@ -60285,6 +60399,7 @@ var FooterConfigDialog = ({
|
|
|
60285
60399
|
quota: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("quota", itemColor), children: "42% used" }),
|
|
60286
60400
|
"memory-usage": /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("memory-usage", itemColor), children: "260 MB" }),
|
|
60287
60401
|
"session-id": /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("session-id", itemColor), children: "769992f9" }),
|
|
60402
|
+
hostname: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("hostname", itemColor), children: "dev-machine" }),
|
|
60288
60403
|
"code-changes": /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
60289
60404
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("code-changes", theme.status.success), children: "+12" }),
|
|
60290
60405
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { color: getColor("code-changes"), children: " " }),
|
|
@@ -60454,7 +60569,7 @@ var import_react74 = __toESM(require_react(), 1);
|
|
|
60454
60569
|
var import_react72 = __toESM(require_react(), 1);
|
|
60455
60570
|
|
|
60456
60571
|
// packages/cli/src/ui/utils/rewindFileOps.ts
|
|
60457
|
-
import
|
|
60572
|
+
import fs33 from "node:fs/promises";
|
|
60458
60573
|
function calculateTurnStats(conversation, userMessage) {
|
|
60459
60574
|
const msgIndex = conversation.messages.indexOf(userMessage);
|
|
60460
60575
|
if (msgIndex === -1) return null;
|
|
@@ -60541,7 +60656,7 @@ async function revertFileChanges(conversation, targetMessageId) {
|
|
|
60541
60656
|
try {
|
|
60542
60657
|
let currentContent = null;
|
|
60543
60658
|
try {
|
|
60544
|
-
currentContent = await
|
|
60659
|
+
currentContent = await fs33.readFile(filePath, "utf8");
|
|
60545
60660
|
} catch (e) {
|
|
60546
60661
|
const error = e;
|
|
60547
60662
|
if ("code" in error && error.code === "ENOENT") {
|
|
@@ -60559,9 +60674,9 @@ async function revertFileChanges(conversation, targetMessageId) {
|
|
|
60559
60674
|
}
|
|
60560
60675
|
if (currentContent === newContent) {
|
|
60561
60676
|
if (!isNewFile2) {
|
|
60562
|
-
await
|
|
60677
|
+
await fs33.writeFile(filePath, originalContent ?? "");
|
|
60563
60678
|
} else {
|
|
60564
|
-
await
|
|
60679
|
+
await fs33.unlink(filePath);
|
|
60565
60680
|
}
|
|
60566
60681
|
} else if (currentContent !== null) {
|
|
60567
60682
|
const originalText = originalContent ?? "";
|
|
@@ -60573,9 +60688,9 @@ async function revertFileChanges(conversation, targetMessageId) {
|
|
|
60573
60688
|
const patchedContent = applyPatch(currentContent, undoPatch);
|
|
60574
60689
|
if (typeof patchedContent === "string") {
|
|
60575
60690
|
if (patchedContent === "" && isNewFile2) {
|
|
60576
|
-
await
|
|
60691
|
+
await fs33.unlink(filePath);
|
|
60577
60692
|
} else {
|
|
60578
|
-
await
|
|
60693
|
+
await fs33.writeFile(filePath, patchedContent);
|
|
60579
60694
|
}
|
|
60580
60695
|
} else {
|
|
60581
60696
|
coreEvents.emitFeedback(
|
|
@@ -61211,14 +61326,14 @@ function enableHook(settings, hookName) {
|
|
|
61211
61326
|
}
|
|
61212
61327
|
const modifiedScopes = [];
|
|
61213
61328
|
try {
|
|
61214
|
-
for (const { scope, path:
|
|
61329
|
+
for (const { scope, path: path38 } of foundInDisabledScopes) {
|
|
61215
61330
|
if (isLoadableSettingScope(scope)) {
|
|
61216
61331
|
const currentScopeDisabled = settings.forScope(scope).settings.hooksConfig?.disabled ?? [];
|
|
61217
61332
|
const newDisabled = currentScopeDisabled.filter(
|
|
61218
61333
|
(name) => name !== hookName
|
|
61219
61334
|
);
|
|
61220
61335
|
settings.setValue(scope, "hooksConfig.disabled", newDisabled);
|
|
61221
|
-
modifiedScopes.push({ scope, path:
|
|
61336
|
+
modifiedScopes.push({ scope, path: path38 });
|
|
61222
61337
|
}
|
|
61223
61338
|
}
|
|
61224
61339
|
} catch (error) {
|
|
@@ -61513,7 +61628,7 @@ async function enableAction3(context, args) {
|
|
|
61513
61628
|
}
|
|
61514
61629
|
const feedback = renderHookActionFeedback(
|
|
61515
61630
|
result,
|
|
61516
|
-
(label,
|
|
61631
|
+
(label, path38) => `${label} (${path38})`
|
|
61517
61632
|
);
|
|
61518
61633
|
return {
|
|
61519
61634
|
type: "message",
|
|
@@ -61555,7 +61670,7 @@ async function disableAction3(context, args) {
|
|
|
61555
61670
|
}
|
|
61556
61671
|
const feedback = renderHookActionFeedback(
|
|
61557
61672
|
result,
|
|
61558
|
-
(label,
|
|
61673
|
+
(label, path38) => `${label} (${path38})`
|
|
61559
61674
|
);
|
|
61560
61675
|
return {
|
|
61561
61676
|
type: "message",
|
|
@@ -61754,16 +61869,16 @@ var hooksCommand = {
|
|
|
61754
61869
|
};
|
|
61755
61870
|
|
|
61756
61871
|
// packages/cli/src/ui/commands/ideCommand.ts
|
|
61757
|
-
import
|
|
61872
|
+
import path29 from "node:path";
|
|
61758
61873
|
function getIdeStatusMessage(ideClient) {
|
|
61759
61874
|
const connection = ideClient.getConnectionStatus();
|
|
61760
61875
|
switch (connection.status) {
|
|
61761
|
-
case
|
|
61876
|
+
case IDEConnectionStatus.Connected:
|
|
61762
61877
|
return {
|
|
61763
61878
|
messageType: "info",
|
|
61764
61879
|
content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
|
|
61765
61880
|
};
|
|
61766
|
-
case
|
|
61881
|
+
case IDEConnectionStatus.Connecting:
|
|
61767
61882
|
return {
|
|
61768
61883
|
messageType: "info",
|
|
61769
61884
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -61783,13 +61898,13 @@ function getIdeStatusMessage(ideClient) {
|
|
|
61783
61898
|
function formatFileList(openFiles) {
|
|
61784
61899
|
const basenameCounts = /* @__PURE__ */ new Map();
|
|
61785
61900
|
for (const file of openFiles) {
|
|
61786
|
-
const basename6 =
|
|
61901
|
+
const basename6 = path29.basename(file.path);
|
|
61787
61902
|
basenameCounts.set(basename6, (basenameCounts.get(basename6) || 0) + 1);
|
|
61788
61903
|
}
|
|
61789
61904
|
const fileList = openFiles.map((file) => {
|
|
61790
|
-
const basename6 =
|
|
61905
|
+
const basename6 = path29.basename(file.path);
|
|
61791
61906
|
const isDuplicate = (basenameCounts.get(basename6) || 0) > 1;
|
|
61792
|
-
const parentDir =
|
|
61907
|
+
const parentDir = path29.basename(path29.dirname(file.path));
|
|
61793
61908
|
const displayName = isDuplicate ? `${basename6} (/${parentDir})` : basename6;
|
|
61794
61909
|
return ` - ${displayName}${file.isActive ? " (active)" : ""}`;
|
|
61795
61910
|
}).join("\n");
|
|
@@ -61804,7 +61919,7 @@ ${infoMessage}`;
|
|
|
61804
61919
|
async function getIdeStatusMessageWithFiles(ideClient) {
|
|
61805
61920
|
const connection = ideClient.getConnectionStatus();
|
|
61806
61921
|
switch (connection.status) {
|
|
61807
|
-
case
|
|
61922
|
+
case IDEConnectionStatus.Connected: {
|
|
61808
61923
|
let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
|
|
61809
61924
|
const context = ideContextStore.get();
|
|
61810
61925
|
const openFiles = context?.workspaceState?.openFiles;
|
|
@@ -61816,7 +61931,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
|
|
|
61816
61931
|
content
|
|
61817
61932
|
};
|
|
61818
61933
|
}
|
|
61819
|
-
case
|
|
61934
|
+
case IDEConnectionStatus.Connecting:
|
|
61820
61935
|
return {
|
|
61821
61936
|
messageType: "info",
|
|
61822
61937
|
content: `\u{1F7E1} Connecting...`
|
|
@@ -61838,7 +61953,7 @@ async function setIdeModeAndSyncConnection(config, value, options = {}) {
|
|
|
61838
61953
|
const ideClient = await IdeClient.getInstance();
|
|
61839
61954
|
if (value) {
|
|
61840
61955
|
await ideClient.connect(options);
|
|
61841
|
-
logIdeConnection(config, new IdeConnectionEvent(
|
|
61956
|
+
logIdeConnection(config, new IdeConnectionEvent(IdeConnectionType.SESSION));
|
|
61842
61957
|
} else {
|
|
61843
61958
|
await ideClient.disconnect();
|
|
61844
61959
|
}
|
|
@@ -61926,10 +62041,10 @@ var ideCommand = async () => {
|
|
|
61926
62041
|
logToConsole: false
|
|
61927
62042
|
}
|
|
61928
62043
|
);
|
|
61929
|
-
if (ideClient.getConnectionStatus().status ===
|
|
62044
|
+
if (ideClient.getConnectionStatus().status === IDEConnectionStatus.Connected) {
|
|
61930
62045
|
break;
|
|
61931
62046
|
}
|
|
61932
|
-
await new Promise((
|
|
62047
|
+
await new Promise((resolve9) => setTimeout(resolve9, 500));
|
|
61933
62048
|
}
|
|
61934
62049
|
const { messageType, content } = getIdeStatusMessage(ideClient);
|
|
61935
62050
|
if (messageType === "error") {
|
|
@@ -62003,7 +62118,7 @@ var ideCommand = async () => {
|
|
|
62003
62118
|
}
|
|
62004
62119
|
};
|
|
62005
62120
|
const { status } = ideClient.getConnectionStatus();
|
|
62006
|
-
const isConnected = status ===
|
|
62121
|
+
const isConnected = status === IDEConnectionStatus.Connected;
|
|
62007
62122
|
if (isConnected) {
|
|
62008
62123
|
ideSlashCommand.subCommands = [statusCommand2, disableCommand5];
|
|
62009
62124
|
} else {
|
|
@@ -62017,8 +62132,8 @@ var ideCommand = async () => {
|
|
|
62017
62132
|
};
|
|
62018
62133
|
|
|
62019
62134
|
// packages/cli/src/ui/commands/initCommand.ts
|
|
62020
|
-
import * as
|
|
62021
|
-
import * as
|
|
62135
|
+
import * as fs34 from "node:fs";
|
|
62136
|
+
import * as path30 from "node:path";
|
|
62022
62137
|
var initCommand = {
|
|
62023
62138
|
name: "init",
|
|
62024
62139
|
description: "Analyzes the project and creates a tailored GEMINI.md file",
|
|
@@ -62033,10 +62148,10 @@ var initCommand = {
|
|
|
62033
62148
|
};
|
|
62034
62149
|
}
|
|
62035
62150
|
const targetDir = context.services.agentContext.config.getTargetDir();
|
|
62036
|
-
const geminiMdPath =
|
|
62037
|
-
const result = performInit(
|
|
62151
|
+
const geminiMdPath = path30.join(targetDir, "GEMINI.md");
|
|
62152
|
+
const result = performInit(fs34.existsSync(geminiMdPath));
|
|
62038
62153
|
if (result.type === "submit_prompt") {
|
|
62039
|
-
|
|
62154
|
+
fs34.writeFileSync(geminiMdPath, "", "utf8");
|
|
62040
62155
|
context.ui.addItem(
|
|
62041
62156
|
{
|
|
62042
62157
|
type: "info",
|
|
@@ -62103,13 +62218,13 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
62103
62218
|
const displayListener = (message) => {
|
|
62104
62219
|
context.ui.addItem({ type: "info", text: message });
|
|
62105
62220
|
};
|
|
62106
|
-
coreEvents.on(
|
|
62221
|
+
coreEvents.on(CoreEvent.OauthDisplayMessage, displayListener);
|
|
62107
62222
|
try {
|
|
62108
62223
|
context.ui.addItem({
|
|
62109
62224
|
type: "info",
|
|
62110
62225
|
text: `Starting OAuth authentication for MCP server '${serverName}'...`
|
|
62111
62226
|
});
|
|
62112
|
-
const { MCPOAuthProvider } = await import("./
|
|
62227
|
+
const { MCPOAuthProvider } = await import("./dist-ZEW43MLQ.js");
|
|
62113
62228
|
let oauthConfig = server.oauth;
|
|
62114
62229
|
if (!oauthConfig) {
|
|
62115
62230
|
oauthConfig = { enabled: false };
|
|
@@ -62146,7 +62261,7 @@ Use /mcp auth <server-name> to authenticate.`
|
|
|
62146
62261
|
content: `Failed to authenticate with MCP server '${serverName}': ${getErrorMessage(error)}`
|
|
62147
62262
|
};
|
|
62148
62263
|
} finally {
|
|
62149
|
-
coreEvents.removeListener(
|
|
62264
|
+
coreEvents.removeListener(CoreEvent.OauthDisplayMessage, displayListener);
|
|
62150
62265
|
}
|
|
62151
62266
|
},
|
|
62152
62267
|
completion: async (context, partialArg) => {
|
|
@@ -62192,10 +62307,10 @@ var listAction2 = async (context, showDescriptions = false, showSchema = false,
|
|
|
62192
62307
|
}
|
|
62193
62308
|
const serverNames = Object.keys(mcpServers);
|
|
62194
62309
|
const connectingServers = serverNames.filter(
|
|
62195
|
-
(name) => getMCPServerStatus(name) ===
|
|
62310
|
+
(name) => getMCPServerStatus(name) === MCPServerStatus.CONNECTING
|
|
62196
62311
|
);
|
|
62197
62312
|
const discoveryState = getMCPDiscoveryState();
|
|
62198
|
-
const discoveryInProgress = discoveryState ===
|
|
62313
|
+
const discoveryInProgress = discoveryState === MCPDiscoveryState.IN_PROGRESS || connectingServers.length > 0;
|
|
62199
62314
|
const allTools = toolRegistry.getAllTools();
|
|
62200
62315
|
const mcpTools = allTools.filter((tool) => tool instanceof DiscoveredMCPTool);
|
|
62201
62316
|
const promptRegistry = config.getPromptRegistry();
|
|
@@ -62477,7 +62592,7 @@ var import_react81 = __toESM(require_react(), 1);
|
|
|
62477
62592
|
|
|
62478
62593
|
// packages/cli/src/ui/components/InboxDialog.tsx
|
|
62479
62594
|
var import_react80 = __toESM(require_react(), 1);
|
|
62480
|
-
import * as
|
|
62595
|
+
import * as path32 from "node:path";
|
|
62481
62596
|
|
|
62482
62597
|
// packages/cli/src/ui/components/messages/DiffRenderer.tsx
|
|
62483
62598
|
var import_react79 = __toESM(require_react(), 1);
|
|
@@ -76275,10 +76390,10 @@ function colorizeCode({
|
|
|
76275
76390
|
}
|
|
76276
76391
|
|
|
76277
76392
|
// packages/cli/src/ui/utils/fileUtils.ts
|
|
76278
|
-
import * as
|
|
76393
|
+
import * as path31 from "node:path";
|
|
76279
76394
|
function getFileExtension(filename) {
|
|
76280
76395
|
if (!filename) return null;
|
|
76281
|
-
const ext =
|
|
76396
|
+
const ext = path31.extname(filename);
|
|
76282
76397
|
return ext ? ext.slice(1) : null;
|
|
76283
76398
|
}
|
|
76284
76399
|
|
|
@@ -76641,11 +76756,11 @@ var MEMORY_PATCH_ACTION_CHOICES = [
|
|
|
76641
76756
|
}
|
|
76642
76757
|
];
|
|
76643
76758
|
function normalizePathForUi(filePath) {
|
|
76644
|
-
return
|
|
76759
|
+
return path32.posix.normalize(filePath.replaceAll("\\", "/"));
|
|
76645
76760
|
}
|
|
76646
76761
|
function getPathBasename(filePath) {
|
|
76647
76762
|
const normalizedPath = normalizePathForUi(filePath);
|
|
76648
|
-
const basename6 =
|
|
76763
|
+
const basename6 = path32.posix.basename(normalizedPath);
|
|
76649
76764
|
return basename6 === "." ? filePath : basename6;
|
|
76650
76765
|
}
|
|
76651
76766
|
function formatMemoryPatchSummary(patch) {
|
|
@@ -77602,97 +77717,62 @@ var InboxDialog = ({
|
|
|
77602
77717
|
};
|
|
77603
77718
|
|
|
77604
77719
|
// packages/cli/src/ui/commands/memoryCommand.ts
|
|
77605
|
-
var
|
|
77606
|
-
name: "
|
|
77607
|
-
description: "
|
|
77720
|
+
var showSubCommand = {
|
|
77721
|
+
name: "show",
|
|
77722
|
+
description: "Show the current memory contents",
|
|
77723
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77724
|
+
autoExecute: true,
|
|
77725
|
+
action: async (context) => {
|
|
77726
|
+
const config = context.services.agentContext?.config;
|
|
77727
|
+
if (!config) return;
|
|
77728
|
+
const result = showMemory(config);
|
|
77729
|
+
context.ui.addItem(
|
|
77730
|
+
{
|
|
77731
|
+
type: "info" /* INFO */,
|
|
77732
|
+
text: result.content
|
|
77733
|
+
},
|
|
77734
|
+
Date.now()
|
|
77735
|
+
);
|
|
77736
|
+
}
|
|
77737
|
+
};
|
|
77738
|
+
var addSubCommand = {
|
|
77739
|
+
name: "add",
|
|
77740
|
+
description: "Add content to the memory",
|
|
77608
77741
|
kind: "built-in" /* BUILT_IN */,
|
|
77609
77742
|
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);
|
|
77743
|
+
action: (context, args) => {
|
|
77744
|
+
const result = addMemory(args);
|
|
77745
|
+
if (result.type === "message") {
|
|
77746
|
+
return result;
|
|
77747
|
+
}
|
|
77748
|
+
context.ui.addItem(
|
|
77749
|
+
{
|
|
77750
|
+
type: "info" /* INFO */,
|
|
77751
|
+
text: `Attempting to save to memory: "${args.trim()}"`
|
|
77752
|
+
},
|
|
77753
|
+
Date.now()
|
|
77754
|
+
);
|
|
77755
|
+
return result;
|
|
77756
|
+
}
|
|
77757
|
+
};
|
|
77758
|
+
var reloadSubCommand = {
|
|
77759
|
+
name: "reload",
|
|
77760
|
+
altNames: ["refresh"],
|
|
77761
|
+
description: "Reload the memory from the source",
|
|
77762
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77763
|
+
autoExecute: true,
|
|
77764
|
+
action: async (context) => {
|
|
77765
|
+
context.ui.addItem(
|
|
77766
|
+
{
|
|
77767
|
+
type: "info" /* INFO */,
|
|
77768
|
+
text: "Reloading memory from source files..."
|
|
77769
|
+
},
|
|
77770
|
+
Date.now()
|
|
77771
|
+
);
|
|
77772
|
+
try {
|
|
77773
|
+
const config = context.services.agentContext?.config;
|
|
77774
|
+
if (config) {
|
|
77775
|
+
const result = await refreshMemory(config);
|
|
77696
77776
|
context.ui.addItem(
|
|
77697
77777
|
{
|
|
77698
77778
|
type: "info" /* INFO */,
|
|
@@ -77701,45 +77781,89 @@ var memoryCommand = {
|
|
|
77701
77781
|
Date.now()
|
|
77702
77782
|
);
|
|
77703
77783
|
}
|
|
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
|
-
}
|
|
77784
|
+
} catch (error) {
|
|
77785
|
+
context.ui.addItem(
|
|
77786
|
+
{
|
|
77787
|
+
type: "error" /* ERROR */,
|
|
77788
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
77789
|
+
text: `Error reloading memory: ${error.message}`
|
|
77790
|
+
},
|
|
77791
|
+
Date.now()
|
|
77792
|
+
);
|
|
77741
77793
|
}
|
|
77742
|
-
|
|
77794
|
+
}
|
|
77795
|
+
};
|
|
77796
|
+
var listSubCommand = {
|
|
77797
|
+
name: "list",
|
|
77798
|
+
description: "Lists the paths of the GEMINI.md files in use",
|
|
77799
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77800
|
+
autoExecute: true,
|
|
77801
|
+
action: async (context) => {
|
|
77802
|
+
const config = context.services.agentContext?.config;
|
|
77803
|
+
if (!config) return;
|
|
77804
|
+
const result = listMemoryFiles(config);
|
|
77805
|
+
context.ui.addItem(
|
|
77806
|
+
{
|
|
77807
|
+
type: "info" /* INFO */,
|
|
77808
|
+
text: result.content
|
|
77809
|
+
},
|
|
77810
|
+
Date.now()
|
|
77811
|
+
);
|
|
77812
|
+
}
|
|
77813
|
+
};
|
|
77814
|
+
var inboxSubCommand = {
|
|
77815
|
+
name: "inbox",
|
|
77816
|
+
description: "Review skills extracted from past sessions and move them to global or project skills",
|
|
77817
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77818
|
+
autoExecute: true,
|
|
77819
|
+
action: (context) => {
|
|
77820
|
+
const config = context.services.agentContext?.config;
|
|
77821
|
+
if (!config) {
|
|
77822
|
+
return {
|
|
77823
|
+
type: "message",
|
|
77824
|
+
messageType: "error",
|
|
77825
|
+
content: "Config not loaded."
|
|
77826
|
+
};
|
|
77827
|
+
}
|
|
77828
|
+
if (!config.isAutoMemoryEnabled()) {
|
|
77829
|
+
return {
|
|
77830
|
+
type: "message",
|
|
77831
|
+
messageType: "info",
|
|
77832
|
+
content: "The memory inbox requires Auto Memory. Enable it with: experimental.autoMemory = true in settings."
|
|
77833
|
+
};
|
|
77834
|
+
}
|
|
77835
|
+
return {
|
|
77836
|
+
type: "custom_dialog",
|
|
77837
|
+
component: import_react81.default.createElement(InboxDialog, {
|
|
77838
|
+
config,
|
|
77839
|
+
onClose: () => context.ui.removeComponent(),
|
|
77840
|
+
onReloadSkills: async () => {
|
|
77841
|
+
await config.reloadSkills();
|
|
77842
|
+
context.ui.reloadCommands();
|
|
77843
|
+
},
|
|
77844
|
+
onReloadMemory: async () => {
|
|
77845
|
+
await refreshMemory(config);
|
|
77846
|
+
}
|
|
77847
|
+
})
|
|
77848
|
+
};
|
|
77849
|
+
}
|
|
77850
|
+
};
|
|
77851
|
+
var memoryCommand = (config) => {
|
|
77852
|
+
const isMemoryV2 = config?.isMemoryV2Enabled() ?? false;
|
|
77853
|
+
const subCommands = [
|
|
77854
|
+
showSubCommand,
|
|
77855
|
+
...isMemoryV2 ? [] : [addSubCommand],
|
|
77856
|
+
reloadSubCommand,
|
|
77857
|
+
listSubCommand,
|
|
77858
|
+
inboxSubCommand
|
|
77859
|
+
];
|
|
77860
|
+
return {
|
|
77861
|
+
name: "memory",
|
|
77862
|
+
description: "Commands for interacting with memory",
|
|
77863
|
+
kind: "built-in" /* BUILT_IN */,
|
|
77864
|
+
autoExecute: false,
|
|
77865
|
+
subCommands
|
|
77866
|
+
};
|
|
77743
77867
|
};
|
|
77744
77868
|
|
|
77745
77869
|
// packages/cli/src/ui/commands/modelCommand.ts
|
|
@@ -77966,7 +78090,7 @@ Return a JSON object with:
|
|
|
77966
78090
|
},
|
|
77967
78091
|
abortSignal: new AbortController().signal,
|
|
77968
78092
|
promptId: "triage-duplicates",
|
|
77969
|
-
role:
|
|
78093
|
+
role: LlmRole.UTILITY_TOOL
|
|
77970
78094
|
});
|
|
77971
78095
|
const rec = response;
|
|
77972
78096
|
let canonical;
|
|
@@ -78800,7 +78924,7 @@ Return a JSON object with:
|
|
|
78800
78924
|
},
|
|
78801
78925
|
abortSignal: abortControllerRef.current.signal,
|
|
78802
78926
|
promptId: "triage-issues",
|
|
78803
|
-
role:
|
|
78927
|
+
role: LlmRole.UTILITY_TOOL
|
|
78804
78928
|
});
|
|
78805
78929
|
return response;
|
|
78806
78930
|
},
|
|
@@ -79273,8 +79397,8 @@ var oncallCommand = {
|
|
|
79273
79397
|
|
|
79274
79398
|
// packages/cli/src/ui/commands/permissionsCommand.ts
|
|
79275
79399
|
import * as process34 from "node:process";
|
|
79276
|
-
import * as
|
|
79277
|
-
import * as
|
|
79400
|
+
import * as path33 from "node:path";
|
|
79401
|
+
import * as fs35 from "node:fs";
|
|
79278
79402
|
var permissionsCommand = {
|
|
79279
79403
|
name: "permissions",
|
|
79280
79404
|
description: "Manage folder trust settings and other permissions",
|
|
@@ -79292,10 +79416,10 @@ var permissionsCommand = {
|
|
|
79292
79416
|
if (!dirPath) {
|
|
79293
79417
|
targetDirectory = process34.cwd();
|
|
79294
79418
|
} else {
|
|
79295
|
-
targetDirectory =
|
|
79419
|
+
targetDirectory = path33.resolve(expandHomeDir(dirPath));
|
|
79296
79420
|
}
|
|
79297
79421
|
try {
|
|
79298
|
-
if (!
|
|
79422
|
+
if (!fs35.statSync(targetDirectory).isDirectory()) {
|
|
79299
79423
|
return {
|
|
79300
79424
|
type: "message",
|
|
79301
79425
|
messageType: "error",
|
|
@@ -79339,7 +79463,7 @@ var permissionsCommand = {
|
|
|
79339
79463
|
};
|
|
79340
79464
|
|
|
79341
79465
|
// packages/cli/src/ui/commands/planCommand.ts
|
|
79342
|
-
import * as
|
|
79466
|
+
import * as path34 from "node:path";
|
|
79343
79467
|
async function copyAction(context) {
|
|
79344
79468
|
const config = context.services.agentContext?.config;
|
|
79345
79469
|
if (!config) {
|
|
@@ -79356,7 +79480,7 @@ async function copyAction(context) {
|
|
|
79356
79480
|
await copyToClipboard(content);
|
|
79357
79481
|
coreEvents.emitFeedback(
|
|
79358
79482
|
"info",
|
|
79359
|
-
`Plan copied to clipboard (${
|
|
79483
|
+
`Plan copied to clipboard (${path34.basename(planPath)}).`
|
|
79360
79484
|
);
|
|
79361
79485
|
} catch (error) {
|
|
79362
79486
|
coreEvents.emitFeedback("error", `Failed to copy plan: ${error}`, error);
|
|
@@ -79374,8 +79498,8 @@ var planCommand = {
|
|
|
79374
79498
|
return;
|
|
79375
79499
|
}
|
|
79376
79500
|
const previousApprovalMode = config.getApprovalMode();
|
|
79377
|
-
config.setApprovalMode(
|
|
79378
|
-
if (previousApprovalMode !==
|
|
79501
|
+
config.setApprovalMode(ApprovalMode.PLAN);
|
|
79502
|
+
if (previousApprovalMode !== ApprovalMode.PLAN) {
|
|
79379
79503
|
coreEvents.emitFeedback("info", "Switched to Plan Mode.");
|
|
79380
79504
|
}
|
|
79381
79505
|
if (context.invocation?.args) {
|
|
@@ -79394,7 +79518,7 @@ var planCommand = {
|
|
|
79394
79518
|
config.storage.getPlansDir(),
|
|
79395
79519
|
config.getFileSystemService()
|
|
79396
79520
|
);
|
|
79397
|
-
const fileName =
|
|
79521
|
+
const fileName = path34.basename(approvedPlanPath);
|
|
79398
79522
|
coreEvents.emitFeedback("info", `Approved Plan: ${fileName}`);
|
|
79399
79523
|
context.ui.addItem({
|
|
79400
79524
|
type: "gemini" /* GEMINI */,
|
|
@@ -79434,10 +79558,10 @@ var categorizeRulesByMode = (rules) => {
|
|
|
79434
79558
|
rules.forEach((rule) => {
|
|
79435
79559
|
const modes = rule.modes?.length ? rule.modes : ALL_MODES;
|
|
79436
79560
|
const modeSet = new Set(modes);
|
|
79437
|
-
if (modeSet.has(
|
|
79438
|
-
if (modeSet.has(
|
|
79439
|
-
if (modeSet.has(
|
|
79440
|
-
if (modeSet.has(
|
|
79561
|
+
if (modeSet.has(ApprovalMode.DEFAULT)) result.normal.push(rule);
|
|
79562
|
+
if (modeSet.has(ApprovalMode.AUTO_EDIT)) result.autoEdit.push(rule);
|
|
79563
|
+
if (modeSet.has(ApprovalMode.YOLO)) result.yolo.push(rule);
|
|
79564
|
+
if (modeSet.has(ApprovalMode.PLAN)) result.plan.push(rule);
|
|
79441
79565
|
});
|
|
79442
79566
|
return result;
|
|
79443
79567
|
};
|
|
@@ -79579,8 +79703,8 @@ var quitCommand = {
|
|
|
79579
79703
|
};
|
|
79580
79704
|
|
|
79581
79705
|
// packages/cli/src/ui/commands/restoreCommand.ts
|
|
79582
|
-
import * as
|
|
79583
|
-
import
|
|
79706
|
+
import * as fs36 from "node:fs/promises";
|
|
79707
|
+
import path35 from "node:path";
|
|
79584
79708
|
var HistoryItemSchema = external_exports.object({
|
|
79585
79709
|
type: external_exports.string(),
|
|
79586
79710
|
id: external_exports.number()
|
|
@@ -79599,8 +79723,8 @@ async function restoreAction(context, args) {
|
|
|
79599
79723
|
};
|
|
79600
79724
|
}
|
|
79601
79725
|
try {
|
|
79602
|
-
await
|
|
79603
|
-
const files = await
|
|
79726
|
+
await fs36.mkdir(checkpointDir, { recursive: true });
|
|
79727
|
+
const files = await fs36.readdir(checkpointDir);
|
|
79604
79728
|
const jsonFiles = files.filter((file) => file.endsWith(".json"));
|
|
79605
79729
|
if (!args) {
|
|
79606
79730
|
if (jsonFiles.length === 0) {
|
|
@@ -79627,8 +79751,8 @@ ${fileList}`
|
|
|
79627
79751
|
content: `File not found: ${selectedFile}`
|
|
79628
79752
|
};
|
|
79629
79753
|
}
|
|
79630
|
-
const filePath =
|
|
79631
|
-
const data = await
|
|
79754
|
+
const filePath = path35.join(checkpointDir, selectedFile);
|
|
79755
|
+
const data = await fs36.readFile(filePath, "utf-8");
|
|
79632
79756
|
const parseResult = ToolCallDataSchema.safeParse(JSON.parse(data));
|
|
79633
79757
|
if (!parseResult.success) {
|
|
79634
79758
|
return {
|
|
@@ -79676,7 +79800,7 @@ async function completion(context, _partialArg) {
|
|
|
79676
79800
|
return [];
|
|
79677
79801
|
}
|
|
79678
79802
|
try {
|
|
79679
|
-
const files = await
|
|
79803
|
+
const files = await fs36.readdir(checkpointDir);
|
|
79680
79804
|
const jsonFiles = files.filter((file) => file.endsWith(".json"));
|
|
79681
79805
|
return getTruncatedCheckpointNames(jsonFiles);
|
|
79682
79806
|
} catch {
|
|
@@ -79852,7 +79976,7 @@ async function listTools(context, showDescriptions) {
|
|
|
79852
79976
|
};
|
|
79853
79977
|
context.ui.addItem(toolsListItem);
|
|
79854
79978
|
}
|
|
79855
|
-
var
|
|
79979
|
+
var listSubCommand2 = {
|
|
79856
79980
|
name: "list",
|
|
79857
79981
|
description: "List available Gemini CLI tools.",
|
|
79858
79982
|
kind: "built-in" /* BUILT_IN */,
|
|
@@ -79872,7 +79996,7 @@ var toolsCommand = {
|
|
|
79872
79996
|
description: "List available Gemini CLI tools. Use /tools desc to include descriptions.",
|
|
79873
79997
|
kind: "built-in" /* BUILT_IN */,
|
|
79874
79998
|
autoExecute: false,
|
|
79875
|
-
subCommands: [
|
|
79999
|
+
subCommands: [listSubCommand2, descSubCommand],
|
|
79876
80000
|
action: async (context, args) => {
|
|
79877
80001
|
const subCommand = args?.trim();
|
|
79878
80002
|
const useShowDescriptions = subCommand === "desc" || subCommand === "descriptions";
|
|
@@ -79929,9 +80053,9 @@ function disableSkill(settings, skillName, scope) {
|
|
|
79929
80053
|
|
|
79930
80054
|
// packages/cli/src/utils/skillUtils.ts
|
|
79931
80055
|
var import_extract_zip2 = __toESM(require_extract_zip(), 1);
|
|
79932
|
-
import * as
|
|
79933
|
-
import * as
|
|
79934
|
-
import * as
|
|
80056
|
+
import * as fs37 from "node:fs/promises";
|
|
80057
|
+
import * as path36 from "node:path";
|
|
80058
|
+
import * as os8 from "node:os";
|
|
79935
80059
|
function renderSkillActionFeedback(result, formatScope) {
|
|
79936
80060
|
const { skillName, action, status, error } = result;
|
|
79937
80061
|
if (status === "error") {
|
|
@@ -79970,8 +80094,8 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
79970
80094
|
const isSkillFile = source2.toLowerCase().endsWith(".skill");
|
|
79971
80095
|
try {
|
|
79972
80096
|
if (isGitUrl) {
|
|
79973
|
-
tempDirToClean = await
|
|
79974
|
-
|
|
80097
|
+
tempDirToClean = await fs37.mkdtemp(
|
|
80098
|
+
path36.join(os8.tmpdir(), "gemini-skill-")
|
|
79975
80099
|
);
|
|
79976
80100
|
sourcePath = tempDirToClean;
|
|
79977
80101
|
onLog(`Cloning skill from ${source2}...`);
|
|
@@ -79983,18 +80107,18 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
79983
80107
|
tempDirToClean
|
|
79984
80108
|
);
|
|
79985
80109
|
} else if (isSkillFile) {
|
|
79986
|
-
tempDirToClean = await
|
|
79987
|
-
|
|
80110
|
+
tempDirToClean = await fs37.mkdtemp(
|
|
80111
|
+
path36.join(os8.tmpdir(), "gemini-skill-")
|
|
79988
80112
|
);
|
|
79989
80113
|
sourcePath = tempDirToClean;
|
|
79990
80114
|
onLog(`Extracting skill from ${source2}...`);
|
|
79991
|
-
await (0, import_extract_zip2.default)(
|
|
80115
|
+
await (0, import_extract_zip2.default)(path36.resolve(source2), { dir: tempDirToClean });
|
|
79992
80116
|
}
|
|
79993
80117
|
if (subpath) {
|
|
79994
|
-
sourcePath =
|
|
80118
|
+
sourcePath = path36.join(sourcePath, subpath);
|
|
79995
80119
|
}
|
|
79996
|
-
sourcePath =
|
|
79997
|
-
if (tempDirToClean && !sourcePath.startsWith(
|
|
80120
|
+
sourcePath = path36.resolve(sourcePath);
|
|
80121
|
+
if (tempDirToClean && !sourcePath.startsWith(path36.resolve(tempDirToClean))) {
|
|
79998
80122
|
throw new Error("Invalid path: Directory traversal not allowed.");
|
|
79999
80123
|
}
|
|
80000
80124
|
onLog(`Searching for skills in ${sourcePath}...`);
|
|
@@ -80010,29 +80134,29 @@ async function installSkill(source2, scope, subpath, onLog, requestConsent = ()
|
|
|
80010
80134
|
if (!await requestConsent(skills, targetDir)) {
|
|
80011
80135
|
throw new Error("Skill installation cancelled by user.");
|
|
80012
80136
|
}
|
|
80013
|
-
await
|
|
80137
|
+
await fs37.mkdir(targetDir, { recursive: true });
|
|
80014
80138
|
const installedSkills = [];
|
|
80015
80139
|
for (const skill of skills) {
|
|
80016
80140
|
const skillName = skill.name;
|
|
80017
|
-
const skillDir =
|
|
80018
|
-
const destPath =
|
|
80019
|
-
const exists = await
|
|
80141
|
+
const skillDir = path36.dirname(skill.location);
|
|
80142
|
+
const destPath = path36.join(targetDir, skillName);
|
|
80143
|
+
const exists = await fs37.stat(destPath).catch(() => null);
|
|
80020
80144
|
if (exists) {
|
|
80021
80145
|
onLog(`Skill "${skillName}" already exists. Overwriting...`);
|
|
80022
|
-
await
|
|
80146
|
+
await fs37.rm(destPath, { recursive: true, force: true });
|
|
80023
80147
|
}
|
|
80024
|
-
await
|
|
80148
|
+
await fs37.cp(skillDir, destPath, { recursive: true });
|
|
80025
80149
|
installedSkills.push({ name: skillName, location: destPath });
|
|
80026
80150
|
}
|
|
80027
80151
|
return installedSkills;
|
|
80028
80152
|
} finally {
|
|
80029
80153
|
if (tempDirToClean) {
|
|
80030
|
-
await
|
|
80154
|
+
await fs37.rm(tempDirToClean, { recursive: true, force: true });
|
|
80031
80155
|
}
|
|
80032
80156
|
}
|
|
80033
80157
|
}
|
|
80034
80158
|
async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.resolve(true)) {
|
|
80035
|
-
const sourcePath =
|
|
80159
|
+
const sourcePath = path36.resolve(source2);
|
|
80036
80160
|
onLog(`Searching for skills in ${sourcePath}...`);
|
|
80037
80161
|
const skills = await loadSkillsFromDir(sourcePath);
|
|
80038
80162
|
if (skills.length === 0) {
|
|
@@ -80057,20 +80181,20 @@ async function linkSkill(source2, scope, onLog, requestConsent = () => Promise.r
|
|
|
80057
80181
|
if (!await requestConsent(skills, targetDir)) {
|
|
80058
80182
|
throw new Error("Skill linking cancelled by user.");
|
|
80059
80183
|
}
|
|
80060
|
-
await
|
|
80184
|
+
await fs37.mkdir(targetDir, { recursive: true });
|
|
80061
80185
|
const linkedSkills = [];
|
|
80062
80186
|
for (const skill of skills) {
|
|
80063
80187
|
const skillName = skill.name;
|
|
80064
|
-
const skillSourceDir =
|
|
80065
|
-
const destPath =
|
|
80066
|
-
const exists = await
|
|
80188
|
+
const skillSourceDir = path36.dirname(skill.location);
|
|
80189
|
+
const destPath = path36.join(targetDir, skillName);
|
|
80190
|
+
const exists = await fs37.lstat(destPath).catch(() => null);
|
|
80067
80191
|
if (exists) {
|
|
80068
80192
|
onLog(
|
|
80069
80193
|
`Skill "${skillName}" already exists at destination. Overwriting...`
|
|
80070
80194
|
);
|
|
80071
|
-
await
|
|
80195
|
+
await fs37.rm(destPath, { recursive: true, force: true });
|
|
80072
80196
|
}
|
|
80073
|
-
await
|
|
80197
|
+
await fs37.symlink(
|
|
80074
80198
|
skillSourceDir,
|
|
80075
80199
|
destPath,
|
|
80076
80200
|
process.platform === "win32" ? "junction" : "dir"
|
|
@@ -80086,19 +80210,19 @@ async function uninstallSkill(name, scope) {
|
|
|
80086
80210
|
const discoveredSkills = await loadSkillsFromDir(targetDir);
|
|
80087
80211
|
const skillToUninstall = discoveredSkills.find((s3) => s3.name === name);
|
|
80088
80212
|
if (!skillToUninstall) {
|
|
80089
|
-
const skillPath =
|
|
80090
|
-
if (!skillPath.startsWith(
|
|
80213
|
+
const skillPath = path36.resolve(targetDir, name);
|
|
80214
|
+
if (!skillPath.startsWith(path36.resolve(targetDir))) {
|
|
80091
80215
|
return null;
|
|
80092
80216
|
}
|
|
80093
|
-
const exists = await
|
|
80217
|
+
const exists = await fs37.lstat(skillPath).catch(() => null);
|
|
80094
80218
|
if (!exists) {
|
|
80095
80219
|
return null;
|
|
80096
80220
|
}
|
|
80097
|
-
await
|
|
80221
|
+
await fs37.rm(skillPath, { recursive: true, force: true });
|
|
80098
80222
|
return { location: skillPath };
|
|
80099
80223
|
}
|
|
80100
|
-
const skillDir =
|
|
80101
|
-
await
|
|
80224
|
+
const skillDir = path36.dirname(skillToUninstall.location);
|
|
80225
|
+
await fs37.rm(skillDir, { recursive: true, force: true });
|
|
80102
80226
|
return { location: skillDir };
|
|
80103
80227
|
}
|
|
80104
80228
|
|
|
@@ -80228,7 +80352,7 @@ async function disableAction4(context, args) {
|
|
|
80228
80352
|
const result = disableSkill(context.services.settings, skillName, scope);
|
|
80229
80353
|
let feedback = renderSkillActionFeedback(
|
|
80230
80354
|
result,
|
|
80231
|
-
(label,
|
|
80355
|
+
(label, path38) => `${label} (${path38})`
|
|
80232
80356
|
);
|
|
80233
80357
|
if (result.status === "success" || result.status === "no-op") {
|
|
80234
80358
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -80264,7 +80388,7 @@ async function enableAction4(context, args) {
|
|
|
80264
80388
|
const result = enableSkill(context.services.settings, skillName);
|
|
80265
80389
|
let feedback = renderSkillActionFeedback(
|
|
80266
80390
|
result,
|
|
80267
|
-
(label,
|
|
80391
|
+
(label, path38) => `${label} (${path38})`
|
|
80268
80392
|
);
|
|
80269
80393
|
if (result.status === "success" || result.status === "no-op") {
|
|
80270
80394
|
feedback += ' You can run "/skills reload" to refresh your current instance.';
|
|
@@ -80302,7 +80426,7 @@ async function reloadAction2(context) {
|
|
|
80302
80426
|
const minVisibleDuration = 500;
|
|
80303
80427
|
if (elapsed < minVisibleDuration) {
|
|
80304
80428
|
await new Promise(
|
|
80305
|
-
(
|
|
80429
|
+
(resolve9) => setTimeout(resolve9, minVisibleDuration - elapsed)
|
|
80306
80430
|
);
|
|
80307
80431
|
}
|
|
80308
80432
|
context.ui.setPendingItem(null);
|
|
@@ -80455,8 +80579,8 @@ var vimCommand = {
|
|
|
80455
80579
|
|
|
80456
80580
|
// packages/cli/src/ui/commands/setupGithubCommand.ts
|
|
80457
80581
|
var import_undici2 = __toESM(require_undici(), 1);
|
|
80458
|
-
import
|
|
80459
|
-
import * as
|
|
80582
|
+
import path37 from "node:path";
|
|
80583
|
+
import * as fs38 from "node:fs";
|
|
80460
80584
|
import { Writable } from "node:stream";
|
|
80461
80585
|
|
|
80462
80586
|
// packages/cli/src/utils/gitUtils.ts
|
|
@@ -80506,7 +80630,7 @@ var getLatestGitHubRelease = async (proxy) => {
|
|
|
80506
80630
|
if (!releaseTag) {
|
|
80507
80631
|
throw new Error(`Response did not include tag_name field`);
|
|
80508
80632
|
}
|
|
80509
|
-
return releaseTag;
|
|
80633
|
+
return typeof releaseTag === "string" ? releaseTag : "";
|
|
80510
80634
|
} catch (error) {
|
|
80511
80635
|
debugLogger.debug(
|
|
80512
80636
|
`Failed to determine latest run-gemini-cli release:`,
|
|
@@ -80583,25 +80707,25 @@ function getOpenUrlsCommands(readmeUrl) {
|
|
|
80583
80707
|
}
|
|
80584
80708
|
async function updateGitignore(gitRepoRoot) {
|
|
80585
80709
|
const gitignoreEntries = [".gemini/", "gha-creds-*.json"];
|
|
80586
|
-
const gitignorePath =
|
|
80710
|
+
const gitignorePath = path37.join(gitRepoRoot, ".gitignore");
|
|
80587
80711
|
try {
|
|
80588
80712
|
let existingContent = "";
|
|
80589
80713
|
let fileExists2 = true;
|
|
80590
80714
|
try {
|
|
80591
|
-
existingContent = await
|
|
80715
|
+
existingContent = await fs38.promises.readFile(gitignorePath, "utf8");
|
|
80592
80716
|
} catch {
|
|
80593
80717
|
fileExists2 = false;
|
|
80594
80718
|
}
|
|
80595
80719
|
if (!fileExists2) {
|
|
80596
80720
|
const contentToWrite = gitignoreEntries.join("\n") + "\n";
|
|
80597
|
-
await
|
|
80721
|
+
await fs38.promises.writeFile(gitignorePath, contentToWrite);
|
|
80598
80722
|
} else {
|
|
80599
80723
|
const missingEntries = gitignoreEntries.filter(
|
|
80600
80724
|
(entry) => !existingContent.split(/\r?\n/).some((line) => line.split("#")[0].trim() === entry)
|
|
80601
80725
|
);
|
|
80602
80726
|
if (missingEntries.length > 0) {
|
|
80603
80727
|
const contentToAdd = "\n" + missingEntries.join("\n") + "\n";
|
|
80604
|
-
await
|
|
80728
|
+
await fs38.promises.appendFile(gitignorePath, contentToAdd);
|
|
80605
80729
|
}
|
|
80606
80730
|
}
|
|
80607
80731
|
} catch (error) {
|
|
@@ -80639,11 +80763,11 @@ async function downloadFiles({
|
|
|
80639
80763
|
`Empty body while downloading ${endpoint}: ${response.status} - ${response.statusText}`
|
|
80640
80764
|
);
|
|
80641
80765
|
}
|
|
80642
|
-
const destination =
|
|
80766
|
+
const destination = path37.resolve(
|
|
80643
80767
|
targetDir,
|
|
80644
|
-
|
|
80768
|
+
path37.basename(fileBasename)
|
|
80645
80769
|
);
|
|
80646
|
-
const fileStream =
|
|
80770
|
+
const fileStream = fs38.createWriteStream(destination, {
|
|
80647
80771
|
mode: 420,
|
|
80648
80772
|
// -rw-r--r--, user(rw), group(r), other(r)
|
|
80649
80773
|
flags: "w",
|
|
@@ -80660,7 +80784,7 @@ async function downloadFiles({
|
|
|
80660
80784
|
}
|
|
80661
80785
|
async function createDirectory(dirPath) {
|
|
80662
80786
|
try {
|
|
80663
|
-
await
|
|
80787
|
+
await fs38.promises.mkdir(dirPath, { recursive: true });
|
|
80664
80788
|
} catch (error) {
|
|
80665
80789
|
debugLogger.debug(`Failed to create ${dirPath} directory:`, error);
|
|
80666
80790
|
throw new Error(
|
|
@@ -80714,9 +80838,9 @@ var setupGithubCommand = {
|
|
|
80714
80838
|
const proxy = context?.services?.agentContext?.config.getProxy();
|
|
80715
80839
|
const releaseTag = await getLatestGitHubRelease(proxy);
|
|
80716
80840
|
const readmeUrl = `https://github.com/google-github-actions/run-gemini-cli/blob/${releaseTag}/README.md#quick-start`;
|
|
80717
|
-
const workflowsDir =
|
|
80841
|
+
const workflowsDir = path37.join(gitRepoRoot, ".github", "workflows");
|
|
80718
80842
|
await createDirectory(workflowsDir);
|
|
80719
|
-
const commandsDir =
|
|
80843
|
+
const commandsDir = path37.join(gitRepoRoot, ".github", "commands");
|
|
80720
80844
|
await createDirectory(commandsDir);
|
|
80721
80845
|
await downloadSetupFiles({
|
|
80722
80846
|
configs: [
|
|
@@ -80789,7 +80913,7 @@ var upgradeCommand = {
|
|
|
80789
80913
|
action: async (context) => {
|
|
80790
80914
|
const config = context.services.agentContext?.config;
|
|
80791
80915
|
const authType = config?.getContentGeneratorConfig()?.authType;
|
|
80792
|
-
if (authType !==
|
|
80916
|
+
if (authType !== AuthType.LOGIN_WITH_GOOGLE) {
|
|
80793
80917
|
return {
|
|
80794
80918
|
type: "message",
|
|
80795
80919
|
messageType: "error",
|
|
@@ -80936,6 +81060,7 @@ var BuiltinCommandLoader = class {
|
|
|
80936
81060
|
copyCommand,
|
|
80937
81061
|
corgiCommand,
|
|
80938
81062
|
docsCommand,
|
|
81063
|
+
exportSessionCommand,
|
|
80939
81064
|
directoryCommand,
|
|
80940
81065
|
editorCommand,
|
|
80941
81066
|
...this.config?.getExtensionsEnabled() === false ? [
|
|
@@ -80977,7 +81102,7 @@ var BuiltinCommandLoader = class {
|
|
|
80977
81102
|
})
|
|
80978
81103
|
}
|
|
80979
81104
|
] : [mcpCommand],
|
|
80980
|
-
memoryCommand,
|
|
81105
|
+
memoryCommand(this.config),
|
|
80981
81106
|
modelCommand,
|
|
80982
81107
|
...this.config?.getFolderTrust() ? [permissionsCommand] : [],
|
|
80983
81108
|
...this.config?.isPlanEnabled() ? [planCommand] : [],
|
|
@@ -81017,7 +81142,7 @@ var BuiltinCommandLoader = class {
|
|
|
81017
81142
|
setupGithubCommand,
|
|
81018
81143
|
terminalSetupCommand,
|
|
81019
81144
|
...this.config?.isVoiceModeEnabled() ? [voiceCommand] : [],
|
|
81020
|
-
...this.config?.getContentGeneratorConfig()?.authType ===
|
|
81145
|
+
...this.config?.getContentGeneratorConfig()?.authType === AuthType.LOGIN_WITH_GOOGLE ? [upgradeCommand] : []
|
|
81021
81146
|
];
|
|
81022
81147
|
handle?.end();
|
|
81023
81148
|
return allDefinitions.filter((cmd) => cmd !== null);
|