citadel_cli 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -106
- package/dist/citadel.css +1 -1
- package/dist/citadel.es.js +882 -1447
- package/dist/citadel.umd.js +52 -61
- package/dist/components/Citadel/Citadel.d.ts +18 -5
- package/dist/components/Citadel/__tests__/CitadelTty.test.d.ts +1 -0
- package/dist/components/Citadel/__tests__/InlineController.test.d.ts +1 -0
- package/dist/components/Citadel/__tests__/PanelController.test.d.ts +1 -0
- package/dist/components/Citadel/__tests__/integration.test.d.ts +1 -0
- package/dist/components/Citadel/__tests__/user-journey.test.d.ts +1 -0
- package/dist/components/Citadel/components/CitadelTty.d.ts +9 -0
- package/dist/components/Citadel/config/types.d.ts +6 -0
- package/dist/components/Citadel/controllers/InlineController.d.ts +2 -0
- package/dist/components/Citadel/controllers/PanelController.d.ts +2 -0
- package/dist/components/Citadel/types/command-registry.d.ts +7 -3
- package/dist/examples/basicCommands.d.ts +6 -0
- package/package.json +6 -2
package/dist/citadel.es.js
CHANGED
|
@@ -1,689 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
var on;
|
|
17
|
-
function tt() {
|
|
18
|
-
if (on) return ae;
|
|
19
|
-
on = 1;
|
|
20
|
-
var o = Q, n = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, a = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
|
-
function u(f, c, m) {
|
|
22
|
-
var h, b = {}, _ = null, S = null;
|
|
23
|
-
m !== void 0 && (_ = "" + m), c.key !== void 0 && (_ = "" + c.key), c.ref !== void 0 && (S = c.ref);
|
|
24
|
-
for (h in c) r.call(c, h) && !i.hasOwnProperty(h) && (b[h] = c[h]);
|
|
25
|
-
if (f && f.defaultProps) for (h in c = f.defaultProps, c) b[h] === void 0 && (b[h] = c[h]);
|
|
26
|
-
return { $$typeof: n, type: f, key: _, ref: S, props: b, _owner: a.current };
|
|
27
|
-
}
|
|
28
|
-
return ae.Fragment = t, ae.jsx = u, ae.jsxs = u, ae;
|
|
29
|
-
}
|
|
30
|
-
var se = {};
|
|
31
|
-
/**
|
|
32
|
-
* @license React
|
|
33
|
-
* react-jsx-runtime.development.js
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
var an;
|
|
41
|
-
function rt() {
|
|
42
|
-
return an || (an = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var o = Q, n = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), f = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), U = Symbol.iterator, I = "@@iterator";
|
|
44
|
-
function d(e) {
|
|
45
|
-
if (e === null || typeof e != "object")
|
|
46
|
-
return null;
|
|
47
|
-
var s = U && e[U] || e[I];
|
|
48
|
-
return typeof s == "function" ? s : null;
|
|
49
|
-
}
|
|
50
|
-
var y = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function w(e) {
|
|
52
|
-
{
|
|
53
|
-
for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), g = 1; g < s; g++)
|
|
54
|
-
l[g - 1] = arguments[g];
|
|
55
|
-
N("error", e, l);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function N(e, s, l) {
|
|
59
|
-
{
|
|
60
|
-
var g = y.ReactDebugCurrentFrame, C = g.getStackAddendum();
|
|
61
|
-
C !== "" && (s += "%s", l = l.concat([C]));
|
|
62
|
-
var E = l.map(function(x) {
|
|
63
|
-
return String(x);
|
|
64
|
-
});
|
|
65
|
-
E.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, E);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var k = !1, j = !1, P = !1, $ = !1, L = !1, ee;
|
|
69
|
-
ee = Symbol.for("react.module.reference");
|
|
70
|
-
function de(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === r || e === i || L || e === a || e === m || e === h || $ || e === S || k || j || P || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === b || e.$$typeof === u || e.$$typeof === f || e.$$typeof === c || // This needs to include all possible module reference object
|
|
72
|
-
// types supported by any Flight configuration anywhere since
|
|
73
|
-
// we don't know which Flight build this will end up being used
|
|
74
|
-
// with.
|
|
75
|
-
e.$$typeof === ee || e.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function ne(e, s, l) {
|
|
78
|
-
var g = e.displayName;
|
|
79
|
-
if (g)
|
|
80
|
-
return g;
|
|
81
|
-
var C = s.displayName || s.name || "";
|
|
82
|
-
return C !== "" ? l + "(" + C + ")" : l;
|
|
83
|
-
}
|
|
84
|
-
function De(e) {
|
|
85
|
-
return e.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function V(e) {
|
|
88
|
-
if (e == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
|
-
return e.displayName || e.name || null;
|
|
92
|
-
if (typeof e == "string")
|
|
93
|
-
return e;
|
|
94
|
-
switch (e) {
|
|
95
|
-
case r:
|
|
96
|
-
return "Fragment";
|
|
97
|
-
case t:
|
|
98
|
-
return "Portal";
|
|
99
|
-
case i:
|
|
100
|
-
return "Profiler";
|
|
101
|
-
case a:
|
|
102
|
-
return "StrictMode";
|
|
103
|
-
case m:
|
|
104
|
-
return "Suspense";
|
|
105
|
-
case h:
|
|
106
|
-
return "SuspenseList";
|
|
107
|
-
}
|
|
108
|
-
if (typeof e == "object")
|
|
109
|
-
switch (e.$$typeof) {
|
|
110
|
-
case f:
|
|
111
|
-
var s = e;
|
|
112
|
-
return De(s) + ".Consumer";
|
|
113
|
-
case u:
|
|
114
|
-
var l = e;
|
|
115
|
-
return De(l._context) + ".Provider";
|
|
116
|
-
case c:
|
|
117
|
-
return ne(e, e.render, "ForwardRef");
|
|
118
|
-
case b:
|
|
119
|
-
var g = e.displayName || null;
|
|
120
|
-
return g !== null ? g : V(e.type) || "Memo";
|
|
121
|
-
case _: {
|
|
122
|
-
var C = e, E = C._payload, x = C._init;
|
|
123
|
-
try {
|
|
124
|
-
return V(x(E));
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var K = Object.assign, te = 0, ze, Fe, Ue, He, Me, $e, We;
|
|
133
|
-
function Le() {
|
|
134
|
-
}
|
|
135
|
-
Le.__reactDisabledLog = !0;
|
|
136
|
-
function En() {
|
|
137
|
-
{
|
|
138
|
-
if (te === 0) {
|
|
139
|
-
ze = console.log, Fe = console.info, Ue = console.warn, He = console.error, Me = console.group, $e = console.groupCollapsed, We = console.groupEnd;
|
|
140
|
-
var e = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: Le,
|
|
144
|
-
writable: !0
|
|
145
|
-
};
|
|
146
|
-
Object.defineProperties(console, {
|
|
147
|
-
info: e,
|
|
148
|
-
log: e,
|
|
149
|
-
warn: e,
|
|
150
|
-
error: e,
|
|
151
|
-
group: e,
|
|
152
|
-
groupCollapsed: e,
|
|
153
|
-
groupEnd: e
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
te++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function kn() {
|
|
160
|
-
{
|
|
161
|
-
if (te--, te === 0) {
|
|
162
|
-
var e = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: K({}, e, {
|
|
169
|
-
value: ze
|
|
170
|
-
}),
|
|
171
|
-
info: K({}, e, {
|
|
172
|
-
value: Fe
|
|
173
|
-
}),
|
|
174
|
-
warn: K({}, e, {
|
|
175
|
-
value: Ue
|
|
176
|
-
}),
|
|
177
|
-
error: K({}, e, {
|
|
178
|
-
value: He
|
|
179
|
-
}),
|
|
180
|
-
group: K({}, e, {
|
|
181
|
-
value: Me
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: K({}, e, {
|
|
184
|
-
value: $e
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: K({}, e, {
|
|
187
|
-
value: We
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
te < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var Ce = y.ReactCurrentDispatcher, Se;
|
|
195
|
-
function me(e, s, l) {
|
|
196
|
-
{
|
|
197
|
-
if (Se === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (C) {
|
|
201
|
-
var g = C.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
Se = g && g[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + Se + e;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var Ee = !1, pe;
|
|
209
|
-
{
|
|
210
|
-
var _n = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
pe = new _n();
|
|
212
|
-
}
|
|
213
|
-
function Ye(e, s) {
|
|
214
|
-
if (!e || Ee)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var l = pe.get(e);
|
|
218
|
-
if (l !== void 0)
|
|
219
|
-
return l;
|
|
220
|
-
}
|
|
221
|
-
var g;
|
|
222
|
-
Ee = !0;
|
|
223
|
-
var C = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var E;
|
|
226
|
-
E = Ce.current, Ce.current = null, En();
|
|
227
|
-
try {
|
|
228
|
-
if (s) {
|
|
229
|
-
var x = function() {
|
|
230
|
-
throw Error();
|
|
231
|
-
};
|
|
232
|
-
if (Object.defineProperty(x.prototype, "props", {
|
|
233
|
-
set: function() {
|
|
234
|
-
throw Error();
|
|
235
|
-
}
|
|
236
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
-
try {
|
|
238
|
-
Reflect.construct(x, []);
|
|
239
|
-
} catch (H) {
|
|
240
|
-
g = H;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(e, [], x);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
x.call();
|
|
246
|
-
} catch (H) {
|
|
247
|
-
g = H;
|
|
248
|
-
}
|
|
249
|
-
e.call(x.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (H) {
|
|
255
|
-
g = H;
|
|
256
|
-
}
|
|
257
|
-
e();
|
|
258
|
-
}
|
|
259
|
-
} catch (H) {
|
|
260
|
-
if (H && g && typeof H.stack == "string") {
|
|
261
|
-
for (var v = H.stack.split(`
|
|
262
|
-
`), F = g.stack.split(`
|
|
263
|
-
`), T = v.length - 1, O = F.length - 1; T >= 1 && O >= 0 && v[T] !== F[O]; )
|
|
264
|
-
O--;
|
|
265
|
-
for (; T >= 1 && O >= 0; T--, O--)
|
|
266
|
-
if (v[T] !== F[O]) {
|
|
267
|
-
if (T !== 1 || O !== 1)
|
|
268
|
-
do
|
|
269
|
-
if (T--, O--, O < 0 || v[T] !== F[O]) {
|
|
270
|
-
var W = `
|
|
271
|
-
` + v[T].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", e.displayName)), typeof e == "function" && pe.set(e, W), W;
|
|
273
|
-
}
|
|
274
|
-
while (T >= 1 && O >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
Ee = !1, Ce.current = E, kn(), Error.prepareStackTrace = C;
|
|
280
|
-
}
|
|
281
|
-
var G = e ? e.displayName || e.name : "", B = G ? me(G) : "";
|
|
282
|
-
return typeof e == "function" && pe.set(e, B), B;
|
|
283
|
-
}
|
|
284
|
-
function Rn(e, s, l) {
|
|
285
|
-
return Ye(e, !1);
|
|
286
|
-
}
|
|
287
|
-
function jn(e) {
|
|
288
|
-
var s = e.prototype;
|
|
289
|
-
return !!(s && s.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function fe(e, s, l) {
|
|
292
|
-
if (e == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof e == "function")
|
|
295
|
-
return Ye(e, jn(e));
|
|
296
|
-
if (typeof e == "string")
|
|
297
|
-
return me(e);
|
|
298
|
-
switch (e) {
|
|
299
|
-
case m:
|
|
300
|
-
return me("Suspense");
|
|
301
|
-
case h:
|
|
302
|
-
return me("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof e == "object")
|
|
305
|
-
switch (e.$$typeof) {
|
|
306
|
-
case c:
|
|
307
|
-
return Rn(e.render);
|
|
308
|
-
case b:
|
|
309
|
-
return fe(e.type, s, l);
|
|
310
|
-
case _: {
|
|
311
|
-
var g = e, C = g._payload, E = g._init;
|
|
312
|
-
try {
|
|
313
|
-
return fe(E(C), s, l);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var re = Object.prototype.hasOwnProperty, Ve = {}, Ke = y.ReactDebugCurrentFrame;
|
|
321
|
-
function he(e) {
|
|
322
|
-
if (e) {
|
|
323
|
-
var s = e._owner, l = fe(e.type, e._source, s ? s.type : null);
|
|
324
|
-
Ke.setExtraStackFrame(l);
|
|
325
|
-
} else
|
|
326
|
-
Ke.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function An(e, s, l, g, C) {
|
|
329
|
-
{
|
|
330
|
-
var E = Function.call.bind(re);
|
|
331
|
-
for (var x in e)
|
|
332
|
-
if (E(e, x)) {
|
|
333
|
-
var v = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof e[x] != "function") {
|
|
336
|
-
var F = Error((g || "React class") + ": " + l + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw F.name = "Invariant Violation", F;
|
|
338
|
-
}
|
|
339
|
-
v = e[x](s, x, g, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (T) {
|
|
341
|
-
v = T;
|
|
342
|
-
}
|
|
343
|
-
v && !(v instanceof Error) && (he(C), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", l, x, typeof v), he(null)), v instanceof Error && !(v.message in Ve) && (Ve[v.message] = !0, he(C), w("Failed %s type: %s", l, v.message), he(null));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
var Pn = Array.isArray;
|
|
348
|
-
function ke(e) {
|
|
349
|
-
return Pn(e);
|
|
350
|
-
}
|
|
351
|
-
function Tn(e) {
|
|
352
|
-
{
|
|
353
|
-
var s = typeof Symbol == "function" && Symbol.toStringTag, l = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
-
return l;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function On(e) {
|
|
358
|
-
try {
|
|
359
|
-
return Be(e), !1;
|
|
360
|
-
} catch {
|
|
361
|
-
return !0;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function Be(e) {
|
|
365
|
-
return "" + e;
|
|
366
|
-
}
|
|
367
|
-
function qe(e) {
|
|
368
|
-
if (On(e))
|
|
369
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Tn(e)), Be(e);
|
|
370
|
-
}
|
|
371
|
-
var oe = y.ReactCurrentOwner, Nn = {
|
|
372
|
-
key: !0,
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, Je, Ge, _e;
|
|
377
|
-
_e = {};
|
|
378
|
-
function In(e) {
|
|
379
|
-
if (re.call(e, "ref")) {
|
|
380
|
-
var s = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
|
-
if (s && s.isReactWarning)
|
|
382
|
-
return !1;
|
|
383
|
-
}
|
|
384
|
-
return e.ref !== void 0;
|
|
385
|
-
}
|
|
386
|
-
function Dn(e) {
|
|
387
|
-
if (re.call(e, "key")) {
|
|
388
|
-
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
|
-
if (s && s.isReactWarning)
|
|
390
|
-
return !1;
|
|
391
|
-
}
|
|
392
|
-
return e.key !== void 0;
|
|
393
|
-
}
|
|
394
|
-
function zn(e, s) {
|
|
395
|
-
if (typeof e.ref == "string" && oe.current && s && oe.current.stateNode !== s) {
|
|
396
|
-
var l = V(oe.current.type);
|
|
397
|
-
_e[l] || (w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', V(oe.current.type), e.ref), _e[l] = !0);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function Fn(e, s) {
|
|
401
|
-
{
|
|
402
|
-
var l = function() {
|
|
403
|
-
Je || (Je = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
404
|
-
};
|
|
405
|
-
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
-
get: l,
|
|
407
|
-
configurable: !0
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function Un(e, s) {
|
|
412
|
-
{
|
|
413
|
-
var l = function() {
|
|
414
|
-
Ge || (Ge = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
415
|
-
};
|
|
416
|
-
l.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
-
get: l,
|
|
418
|
-
configurable: !0
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
var Hn = function(e, s, l, g, C, E, x) {
|
|
423
|
-
var v = {
|
|
424
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
-
$$typeof: n,
|
|
426
|
-
// Built-in properties that belong on the element
|
|
427
|
-
type: e,
|
|
428
|
-
key: s,
|
|
429
|
-
ref: l,
|
|
430
|
-
props: x,
|
|
431
|
-
// Record the component responsible for creating this element.
|
|
432
|
-
_owner: E
|
|
433
|
-
};
|
|
434
|
-
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
435
|
-
configurable: !1,
|
|
436
|
-
enumerable: !1,
|
|
437
|
-
writable: !0,
|
|
438
|
-
value: !1
|
|
439
|
-
}), Object.defineProperty(v, "_self", {
|
|
440
|
-
configurable: !1,
|
|
441
|
-
enumerable: !1,
|
|
442
|
-
writable: !1,
|
|
443
|
-
value: g
|
|
444
|
-
}), Object.defineProperty(v, "_source", {
|
|
445
|
-
configurable: !1,
|
|
446
|
-
enumerable: !1,
|
|
447
|
-
writable: !1,
|
|
448
|
-
value: C
|
|
449
|
-
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
450
|
-
};
|
|
451
|
-
function Mn(e, s, l, g, C) {
|
|
452
|
-
{
|
|
453
|
-
var E, x = {}, v = null, F = null;
|
|
454
|
-
l !== void 0 && (qe(l), v = "" + l), Dn(s) && (qe(s.key), v = "" + s.key), In(s) && (F = s.ref, zn(s, C));
|
|
455
|
-
for (E in s)
|
|
456
|
-
re.call(s, E) && !Nn.hasOwnProperty(E) && (x[E] = s[E]);
|
|
457
|
-
if (e && e.defaultProps) {
|
|
458
|
-
var T = e.defaultProps;
|
|
459
|
-
for (E in T)
|
|
460
|
-
x[E] === void 0 && (x[E] = T[E]);
|
|
461
|
-
}
|
|
462
|
-
if (v || F) {
|
|
463
|
-
var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
v && Fn(x, O), F && Un(x, O);
|
|
465
|
-
}
|
|
466
|
-
return Hn(e, v, F, C, g, oe.current, x);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
var Re = y.ReactCurrentOwner, Xe = y.ReactDebugCurrentFrame;
|
|
470
|
-
function J(e) {
|
|
471
|
-
if (e) {
|
|
472
|
-
var s = e._owner, l = fe(e.type, e._source, s ? s.type : null);
|
|
473
|
-
Xe.setExtraStackFrame(l);
|
|
474
|
-
} else
|
|
475
|
-
Xe.setExtraStackFrame(null);
|
|
476
|
-
}
|
|
477
|
-
var je;
|
|
478
|
-
je = !1;
|
|
479
|
-
function Ae(e) {
|
|
480
|
-
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
481
|
-
}
|
|
482
|
-
function Qe() {
|
|
483
|
-
{
|
|
484
|
-
if (Re.current) {
|
|
485
|
-
var e = V(Re.current.type);
|
|
486
|
-
if (e)
|
|
487
|
-
return `
|
|
488
|
-
|
|
489
|
-
Check the render method of \`` + e + "`.";
|
|
490
|
-
}
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function $n(e) {
|
|
495
|
-
return "";
|
|
496
|
-
}
|
|
497
|
-
var Ze = {};
|
|
498
|
-
function Wn(e) {
|
|
499
|
-
{
|
|
500
|
-
var s = Qe();
|
|
501
|
-
if (!s) {
|
|
502
|
-
var l = typeof e == "string" ? e : e.displayName || e.name;
|
|
503
|
-
l && (s = `
|
|
504
|
-
|
|
505
|
-
Check the top-level render call using <` + l + ">.");
|
|
506
|
-
}
|
|
507
|
-
return s;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
function en(e, s) {
|
|
511
|
-
{
|
|
512
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
513
|
-
return;
|
|
514
|
-
e._store.validated = !0;
|
|
515
|
-
var l = Wn(s);
|
|
516
|
-
if (Ze[l])
|
|
517
|
-
return;
|
|
518
|
-
Ze[l] = !0;
|
|
519
|
-
var g = "";
|
|
520
|
-
e && e._owner && e._owner !== Re.current && (g = " It was passed a child from " + V(e._owner.type) + "."), J(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, g), J(null);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
function nn(e, s) {
|
|
524
|
-
{
|
|
525
|
-
if (typeof e != "object")
|
|
526
|
-
return;
|
|
527
|
-
if (ke(e))
|
|
528
|
-
for (var l = 0; l < e.length; l++) {
|
|
529
|
-
var g = e[l];
|
|
530
|
-
Ae(g) && en(g, s);
|
|
531
|
-
}
|
|
532
|
-
else if (Ae(e))
|
|
533
|
-
e._store && (e._store.validated = !0);
|
|
534
|
-
else if (e) {
|
|
535
|
-
var C = d(e);
|
|
536
|
-
if (typeof C == "function" && C !== e.entries)
|
|
537
|
-
for (var E = C.call(e), x; !(x = E.next()).done; )
|
|
538
|
-
Ae(x.value) && en(x.value, s);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
function Ln(e) {
|
|
543
|
-
{
|
|
544
|
-
var s = e.type;
|
|
545
|
-
if (s == null || typeof s == "string")
|
|
546
|
-
return;
|
|
547
|
-
var l;
|
|
548
|
-
if (typeof s == "function")
|
|
549
|
-
l = s.propTypes;
|
|
550
|
-
else if (typeof s == "object" && (s.$$typeof === c || // Note: Memo only checks outer props here.
|
|
551
|
-
// Inner props are checked in the reconciler.
|
|
552
|
-
s.$$typeof === b))
|
|
553
|
-
l = s.propTypes;
|
|
554
|
-
else
|
|
555
|
-
return;
|
|
556
|
-
if (l) {
|
|
557
|
-
var g = V(s);
|
|
558
|
-
An(l, e.props, "prop", g, e);
|
|
559
|
-
} else if (s.PropTypes !== void 0 && !je) {
|
|
560
|
-
je = !0;
|
|
561
|
-
var C = V(s);
|
|
562
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
|
|
563
|
-
}
|
|
564
|
-
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
function Yn(e) {
|
|
568
|
-
{
|
|
569
|
-
for (var s = Object.keys(e.props), l = 0; l < s.length; l++) {
|
|
570
|
-
var g = s[l];
|
|
571
|
-
if (g !== "children" && g !== "key") {
|
|
572
|
-
J(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), J(null);
|
|
573
|
-
break;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
e.ref !== null && (J(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), J(null));
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
var tn = {};
|
|
580
|
-
function rn(e, s, l, g, C, E) {
|
|
581
|
-
{
|
|
582
|
-
var x = de(e);
|
|
583
|
-
if (!x) {
|
|
584
|
-
var v = "";
|
|
585
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
586
|
-
var F = $n();
|
|
587
|
-
F ? v += F : v += Qe();
|
|
588
|
-
var T;
|
|
589
|
-
e === null ? T = "null" : ke(e) ? T = "array" : e !== void 0 && e.$$typeof === n ? (T = "<" + (V(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, v);
|
|
590
|
-
}
|
|
591
|
-
var O = Mn(e, s, l, C, E);
|
|
592
|
-
if (O == null)
|
|
593
|
-
return O;
|
|
594
|
-
if (x) {
|
|
595
|
-
var W = s.children;
|
|
596
|
-
if (W !== void 0)
|
|
597
|
-
if (g)
|
|
598
|
-
if (ke(W)) {
|
|
599
|
-
for (var G = 0; G < W.length; G++)
|
|
600
|
-
nn(W[G], e);
|
|
601
|
-
Object.freeze && Object.freeze(W);
|
|
602
|
-
} else
|
|
603
|
-
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
604
|
-
else
|
|
605
|
-
nn(W, e);
|
|
606
|
-
}
|
|
607
|
-
if (re.call(s, "key")) {
|
|
608
|
-
var B = V(e), H = Object.keys(s).filter(function(Gn) {
|
|
609
|
-
return Gn !== "key";
|
|
610
|
-
}), Pe = H.length > 0 ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
611
|
-
if (!tn[B + Pe]) {
|
|
612
|
-
var Jn = H.length > 0 ? "{" + H.join(": ..., ") + ": ...}" : "{}";
|
|
613
|
-
w(`A props object containing a "key" prop is being spread into JSX:
|
|
614
|
-
let props = %s;
|
|
615
|
-
<%s {...props} />
|
|
616
|
-
React keys must be passed directly to JSX without using spread:
|
|
617
|
-
let props = %s;
|
|
618
|
-
<%s key={someKey} {...props} />`, Pe, B, Jn, B), tn[B + Pe] = !0;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
return e === r ? Yn(O) : Ln(O), O;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
function Vn(e, s, l) {
|
|
625
|
-
return rn(e, s, l, !0);
|
|
626
|
-
}
|
|
627
|
-
function Kn(e, s, l) {
|
|
628
|
-
return rn(e, s, l, !1);
|
|
629
|
-
}
|
|
630
|
-
var Bn = Kn, qn = Vn;
|
|
631
|
-
se.Fragment = r, se.jsx = Bn, se.jsxs = qn;
|
|
632
|
-
}()), se;
|
|
633
|
-
}
|
|
634
|
-
process.env.NODE_ENV === "production" ? Te.exports = tt() : Te.exports = rt();
|
|
635
|
-
var p = Te.exports, Oe, ge = nt;
|
|
636
|
-
if (process.env.NODE_ENV === "production")
|
|
637
|
-
Oe = ge.createRoot, ge.hydrateRoot;
|
|
638
|
-
else {
|
|
639
|
-
var sn = ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
640
|
-
Oe = function(o, n) {
|
|
641
|
-
sn.usingClientEntryPoint = !0;
|
|
642
|
-
try {
|
|
643
|
-
return ge.createRoot(o, n);
|
|
644
|
-
} finally {
|
|
645
|
-
sn.usingClientEntryPoint = !1;
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
const ot = ({ onOpen: o, onClose: n, isVisible: t, showCitadelKey: r }) => {
|
|
650
|
-
z(() => {
|
|
651
|
-
const a = (i) => {
|
|
652
|
-
var u, f;
|
|
653
|
-
!t && i.key === r && !["input", "textarea"].includes(((f = (u = i.target) == null ? void 0 : u.tagName) == null ? void 0 : f.toLowerCase()) || "") && (i.preventDefault(), o()), t && i.key === "Escape" && (i.preventDefault(), n());
|
|
654
|
-
};
|
|
655
|
-
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
656
|
-
}, [o, n, t, r]);
|
|
657
|
-
}, at = "_container_141sr_3", st = "_innerContainer_141sr_19", it = "_inputSection_141sr_28", lt = "_resizeHandle_141sr_35", ct = "_citadel_slideUp_141sr_64", ut = "_citadel_slideDown_141sr_68", ln = {
|
|
658
|
-
container: at,
|
|
659
|
-
innerContainer: st,
|
|
660
|
-
inputSection: it,
|
|
661
|
-
resizeHandle: lt,
|
|
662
|
-
citadel_slideUp: ct,
|
|
663
|
-
citadel_slideDown: ut
|
|
664
|
-
}, dt = (o) => {
|
|
665
|
-
const { isVisible: n, isClosing: t, onAnimationComplete: r } = o, a = be(() => n ? t ? ln.slideDown : ln.slideUp : "", [n, t]);
|
|
666
|
-
return z(() => {
|
|
667
|
-
if (r) {
|
|
668
|
-
const u = setTimeout(() => {
|
|
669
|
-
r();
|
|
670
|
-
}, 200);
|
|
671
|
-
return () => clearTimeout(u);
|
|
672
|
-
}
|
|
673
|
-
}, [t, r]), {
|
|
674
|
-
style: be(() => ({
|
|
675
|
-
opacity: n ? 1 : 0,
|
|
676
|
-
transform: n ? "translateY(0)" : t ? "translateY(100%)" : "translateY(-100%)",
|
|
677
|
-
transition: "opacity 200ms ease-in-out, transform 200ms ease-in-out"
|
|
678
|
-
}), [n, t]),
|
|
679
|
-
animationClass: a
|
|
680
|
-
};
|
|
681
|
-
};
|
|
682
|
-
var ie = /* @__PURE__ */ ((o) => (o.Pending = "pending", o.Success = "success", o.Failure = "failure", o.Timeout = "timeout", o))(ie || {});
|
|
683
|
-
class Z {
|
|
684
|
-
constructor(n = Date.now()) {
|
|
685
|
-
A(this, "_status", "pending");
|
|
686
|
-
this.timestamp = n;
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var fe = (r, e, n) => e in r ? ge(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
+
var b = (r, e, n) => fe(r, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { jsx as m, jsxs as _, Fragment as we } from "react/jsx-runtime";
|
|
5
|
+
import L, { createContext as be, useEffect as A, useContext as Y, useState as R, useCallback as w, useMemo as V, useReducer as ye, useRef as H } from "react";
|
|
6
|
+
import { createRoot as xe } from "react-dom/client";
|
|
7
|
+
var T = /* @__PURE__ */ ((r) => (r.Pending = "pending", r.Success = "success", r.Failure = "failure", r.Timeout = "timeout", r))(T || {});
|
|
8
|
+
class U {
|
|
9
|
+
constructor(e = Date.now()) {
|
|
10
|
+
b(this, "_status", "pending");
|
|
11
|
+
this.timestamp = e;
|
|
687
12
|
}
|
|
688
13
|
get status() {
|
|
689
14
|
return this._status;
|
|
@@ -698,41 +23,41 @@ class Z {
|
|
|
698
23
|
this._status = "timeout";
|
|
699
24
|
}
|
|
700
25
|
}
|
|
701
|
-
class
|
|
702
|
-
constructor(
|
|
703
|
-
super(
|
|
26
|
+
class an extends U {
|
|
27
|
+
constructor(e, n) {
|
|
28
|
+
super(n), this.data = e;
|
|
704
29
|
}
|
|
705
30
|
render() {
|
|
706
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ m("pre", { className: "text-gray-200", children: JSON.stringify(this.data, null, 2) });
|
|
707
32
|
}
|
|
708
33
|
}
|
|
709
|
-
class
|
|
710
|
-
constructor(
|
|
711
|
-
super(
|
|
34
|
+
class ae extends U {
|
|
35
|
+
constructor(e, n) {
|
|
36
|
+
super(n), this.text = e;
|
|
712
37
|
}
|
|
713
38
|
render() {
|
|
714
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ m("div", { className: "text-gray-200 whitespace-pre font-mono", children: this.text });
|
|
715
40
|
}
|
|
716
41
|
}
|
|
717
|
-
class
|
|
718
|
-
constructor(
|
|
719
|
-
super(
|
|
42
|
+
class ve extends U {
|
|
43
|
+
constructor(e, n) {
|
|
44
|
+
super(n), this.error = e, this.markFailure();
|
|
720
45
|
}
|
|
721
46
|
render() {
|
|
722
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ m("div", { className: "mt-1 text-red-400", children: this.error });
|
|
723
48
|
}
|
|
724
49
|
}
|
|
725
|
-
class
|
|
50
|
+
class Ce extends U {
|
|
726
51
|
render() {
|
|
727
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ m("div", { className: "text-gray-400", children: "..." });
|
|
728
53
|
}
|
|
729
54
|
}
|
|
730
|
-
class
|
|
731
|
-
constructor(
|
|
732
|
-
super(
|
|
55
|
+
class ln extends U {
|
|
56
|
+
constructor(e, n = "", t) {
|
|
57
|
+
super(t), this.imageUrl = e, this.altText = n;
|
|
733
58
|
}
|
|
734
59
|
render() {
|
|
735
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ m("div", { className: "my-2", children: /* @__PURE__ */ m(
|
|
736
61
|
"img",
|
|
737
62
|
{
|
|
738
63
|
src: this.imageUrl,
|
|
@@ -742,142 +67,143 @@ class Mt extends Z {
|
|
|
742
67
|
) });
|
|
743
68
|
}
|
|
744
69
|
}
|
|
745
|
-
const
|
|
746
|
-
const
|
|
747
|
-
return
|
|
748
|
-
|
|
749
|
-
` +
|
|
70
|
+
const Se = (r) => async function() {
|
|
71
|
+
const e = r.commands.filter((n) => n.fullPath[0] !== "help").map((n) => `${n.segments.map((o) => o.type === "argument" ? `<${o.name}>` : o.name).join(" ")} - ${n.description}`).sort();
|
|
72
|
+
return e.push("help - Show available commands"), new ae(
|
|
73
|
+
e.length > 0 ? `Available Commands:
|
|
74
|
+
` + e.join(`
|
|
750
75
|
`) : "No commands available yet. Add some commands to get started!"
|
|
751
76
|
);
|
|
752
77
|
};
|
|
753
|
-
var
|
|
754
|
-
class
|
|
755
|
-
static configure(
|
|
756
|
-
this.level =
|
|
78
|
+
var W = /* @__PURE__ */ ((r) => (r[r.NONE = 0] = "NONE", r[r.ERROR = 1] = "ERROR", r[r.WARN = 2] = "WARN", r[r.INFO = 3] = "INFO", r[r.DEBUG = 4] = "DEBUG", r[r.TRACE = 5] = "TRACE", r))(W || {});
|
|
79
|
+
class C {
|
|
80
|
+
static configure(e) {
|
|
81
|
+
this.level = e.level, this.prefix = e.prefix || "[Citadel]";
|
|
757
82
|
}
|
|
758
|
-
static trace(...
|
|
759
|
-
this.level >= 5 && process.env.NODE_ENV !== "production" && console.trace(this.prefix, ...
|
|
83
|
+
static trace(...e) {
|
|
84
|
+
this.level >= 5 && process.env.NODE_ENV !== "production" && console.trace(this.prefix, ...e);
|
|
760
85
|
}
|
|
761
|
-
static debug(...
|
|
762
|
-
this.level >= 4 && process.env.NODE_ENV !== "production" && console.debug(this.prefix, ...
|
|
86
|
+
static debug(...e) {
|
|
87
|
+
this.level >= 4 && process.env.NODE_ENV !== "production" && console.debug(this.prefix, ...e);
|
|
763
88
|
}
|
|
764
|
-
static info(...
|
|
765
|
-
this.level >= 3 && console.info(this.prefix, ...
|
|
89
|
+
static info(...e) {
|
|
90
|
+
this.level >= 3 && console.info(this.prefix, ...e);
|
|
766
91
|
}
|
|
767
|
-
static warn(...
|
|
768
|
-
this.level >= 2 && console.warn(this.prefix, ...
|
|
92
|
+
static warn(...e) {
|
|
93
|
+
this.level >= 2 && console.warn(this.prefix, ...e);
|
|
769
94
|
}
|
|
770
|
-
static error(...
|
|
771
|
-
this.level >= 1 && console.error(this.prefix, ...
|
|
95
|
+
static error(...e) {
|
|
96
|
+
this.level >= 1 && console.error(this.prefix, ...e);
|
|
772
97
|
}
|
|
773
98
|
}
|
|
774
|
-
|
|
775
|
-
const
|
|
99
|
+
b(C, "level", 0), b(C, "prefix", "");
|
|
100
|
+
const z = {
|
|
776
101
|
commandTimeoutMs: 1e4,
|
|
777
102
|
cursorColor: "var(--cursor-color, #fff)",
|
|
778
103
|
cursorSpeed: 530,
|
|
779
104
|
cursorType: "blink",
|
|
780
105
|
includeHelpCommand: !0,
|
|
781
106
|
initialHeight: "40vh",
|
|
782
|
-
logLevel: process.env.NODE_ENV === "production" ?
|
|
107
|
+
logLevel: process.env.NODE_ENV === "production" ? W.ERROR : W.DEBUG,
|
|
783
108
|
maxHeight: "80vh",
|
|
784
109
|
minHeight: "200",
|
|
785
110
|
outputFontSize: "0.875rem",
|
|
786
111
|
resetStateOnHide: !1,
|
|
787
112
|
showCitadelKey: ".",
|
|
113
|
+
displayMode: "panel",
|
|
788
114
|
storage: {
|
|
789
115
|
type: "localStorage",
|
|
790
116
|
maxCommands: 100
|
|
791
117
|
}
|
|
792
118
|
};
|
|
793
|
-
class
|
|
794
|
-
constructor(
|
|
795
|
-
|
|
119
|
+
class ie {
|
|
120
|
+
constructor(e) {
|
|
121
|
+
b(this, "config");
|
|
796
122
|
this.config = {
|
|
797
123
|
type: "localStorage",
|
|
798
124
|
maxCommands: 100,
|
|
799
|
-
...
|
|
125
|
+
...e
|
|
800
126
|
};
|
|
801
127
|
}
|
|
802
128
|
/**
|
|
803
129
|
* Add a command to history, enforcing storage limits
|
|
804
130
|
*/
|
|
805
|
-
async addStoredCommand(
|
|
806
|
-
const
|
|
807
|
-
for (
|
|
808
|
-
|
|
809
|
-
await this.saveCommands(
|
|
131
|
+
async addStoredCommand(e) {
|
|
132
|
+
const n = await this.getStoredCommands();
|
|
133
|
+
for (n.push(e); n.length > this.config.maxCommands; )
|
|
134
|
+
n.shift();
|
|
135
|
+
await this.saveCommands(n);
|
|
810
136
|
}
|
|
811
137
|
}
|
|
812
|
-
class
|
|
813
|
-
constructor(
|
|
814
|
-
super(
|
|
815
|
-
|
|
138
|
+
class ke extends ie {
|
|
139
|
+
constructor(n) {
|
|
140
|
+
super(n);
|
|
141
|
+
b(this, "storageKey", "citadel_command_history");
|
|
816
142
|
}
|
|
817
143
|
async getStoredCommands() {
|
|
818
144
|
try {
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
commandSegments:
|
|
822
|
-
timestamp:
|
|
145
|
+
const n = window.localStorage.getItem(this.storageKey);
|
|
146
|
+
return n ? JSON.parse(n).map((o) => ({
|
|
147
|
+
commandSegments: o.commandSegments || [],
|
|
148
|
+
timestamp: o.timestamp
|
|
823
149
|
})) : [];
|
|
824
|
-
} catch (
|
|
825
|
-
return console.warn("Failed to load commands from localStorage:",
|
|
150
|
+
} catch (n) {
|
|
151
|
+
return console.warn("Failed to load commands from localStorage:", n), [];
|
|
826
152
|
}
|
|
827
153
|
}
|
|
828
154
|
async clear() {
|
|
829
155
|
try {
|
|
830
156
|
window.localStorage.removeItem(this.storageKey);
|
|
831
|
-
} catch (
|
|
832
|
-
console.warn("Failed to clear localStorage:",
|
|
157
|
+
} catch (n) {
|
|
158
|
+
console.warn("Failed to clear localStorage:", n);
|
|
833
159
|
}
|
|
834
160
|
}
|
|
835
|
-
async saveCommands(
|
|
161
|
+
async saveCommands(n) {
|
|
836
162
|
try {
|
|
837
|
-
const
|
|
838
|
-
commandSegments: Array.isArray(
|
|
839
|
-
timestamp:
|
|
163
|
+
const t = n.map((o) => ({
|
|
164
|
+
commandSegments: Array.isArray(o.commandSegments) ? [...o.commandSegments] : [],
|
|
165
|
+
timestamp: o.timestamp
|
|
840
166
|
}));
|
|
841
|
-
window.localStorage.setItem(this.storageKey, JSON.stringify(
|
|
842
|
-
} catch (
|
|
843
|
-
throw console.warn("Failed to save commands to localStorage:",
|
|
167
|
+
window.localStorage.setItem(this.storageKey, JSON.stringify(t));
|
|
168
|
+
} catch (t) {
|
|
169
|
+
throw console.warn("Failed to save commands to localStorage:", t), t;
|
|
844
170
|
}
|
|
845
171
|
}
|
|
846
172
|
}
|
|
847
|
-
class
|
|
848
|
-
constructor(
|
|
849
|
-
super(
|
|
850
|
-
|
|
173
|
+
class Ee extends ie {
|
|
174
|
+
constructor(n) {
|
|
175
|
+
super(n);
|
|
176
|
+
b(this, "storedCommands", []);
|
|
851
177
|
}
|
|
852
178
|
async getStoredCommands() {
|
|
853
|
-
return this.storedCommands.map((
|
|
854
|
-
commandSegments: Array.isArray(
|
|
855
|
-
timestamp:
|
|
179
|
+
return this.storedCommands.map((n) => ({
|
|
180
|
+
commandSegments: Array.isArray(n.commandSegments) ? [...n.commandSegments] : [],
|
|
181
|
+
timestamp: n.timestamp
|
|
856
182
|
}));
|
|
857
183
|
}
|
|
858
184
|
async clear() {
|
|
859
185
|
this.storedCommands = [];
|
|
860
186
|
}
|
|
861
|
-
async saveCommands(
|
|
862
|
-
this.storedCommands =
|
|
863
|
-
commandSegments: Array.isArray(
|
|
864
|
-
timestamp:
|
|
187
|
+
async saveCommands(n) {
|
|
188
|
+
this.storedCommands = n.map((t) => ({
|
|
189
|
+
commandSegments: Array.isArray(t.commandSegments) ? [...t.commandSegments] : [],
|
|
190
|
+
timestamp: t.timestamp
|
|
865
191
|
}));
|
|
866
192
|
}
|
|
867
193
|
}
|
|
868
|
-
const
|
|
194
|
+
const D = class D {
|
|
869
195
|
constructor() {
|
|
870
|
-
|
|
196
|
+
b(this, "currentStorage");
|
|
871
197
|
}
|
|
872
198
|
static getInstance() {
|
|
873
|
-
return
|
|
199
|
+
return D.instance || (D.instance = new D()), D.instance;
|
|
874
200
|
}
|
|
875
|
-
initializeStorage(
|
|
201
|
+
initializeStorage(e) {
|
|
876
202
|
if (!this.currentStorage)
|
|
877
203
|
try {
|
|
878
|
-
this.currentStorage = new
|
|
879
|
-
} catch (
|
|
880
|
-
console.warn("Failed to create storage, falling back to memory storage:",
|
|
204
|
+
this.currentStorage = new ke(e);
|
|
205
|
+
} catch (n) {
|
|
206
|
+
console.warn("Failed to create storage, falling back to memory storage:", n), this.currentStorage = new Ee(e);
|
|
881
207
|
}
|
|
882
208
|
}
|
|
883
209
|
getStorage() {
|
|
@@ -886,39 +212,39 @@ const q = class q {
|
|
|
886
212
|
return this.currentStorage;
|
|
887
213
|
}
|
|
888
214
|
};
|
|
889
|
-
|
|
890
|
-
let
|
|
891
|
-
const
|
|
892
|
-
class
|
|
893
|
-
constructor(n, t
|
|
894
|
-
this.type =
|
|
215
|
+
b(D, "instance");
|
|
216
|
+
let q = D;
|
|
217
|
+
const le = async () => new ae("");
|
|
218
|
+
class J {
|
|
219
|
+
constructor(e, n, t) {
|
|
220
|
+
this.type = e, this.name = n, this.description = t;
|
|
895
221
|
}
|
|
896
222
|
toString() {
|
|
897
223
|
return this.name;
|
|
898
224
|
}
|
|
899
225
|
}
|
|
900
|
-
class
|
|
226
|
+
class ce extends J {
|
|
901
227
|
constructor() {
|
|
902
228
|
super("null", ">null<", "Empty segment");
|
|
903
229
|
}
|
|
904
230
|
}
|
|
905
|
-
class
|
|
906
|
-
constructor(
|
|
907
|
-
super("word",
|
|
231
|
+
class Ne extends J {
|
|
232
|
+
constructor(e, n) {
|
|
233
|
+
super("word", e, n);
|
|
908
234
|
}
|
|
909
235
|
}
|
|
910
|
-
class
|
|
911
|
-
constructor(n, t,
|
|
912
|
-
super("argument",
|
|
236
|
+
class _e extends J {
|
|
237
|
+
constructor(e, n, t, o) {
|
|
238
|
+
super("argument", e, n), this.value = t, this.valid = o;
|
|
913
239
|
}
|
|
914
240
|
}
|
|
915
|
-
class
|
|
916
|
-
constructor(n, t
|
|
917
|
-
|
|
918
|
-
|
|
241
|
+
class Ae {
|
|
242
|
+
constructor(e, n, t = le) {
|
|
243
|
+
b(this, "_segments");
|
|
244
|
+
b(this, "_description");
|
|
919
245
|
// Used by `Help` command, etc.
|
|
920
|
-
|
|
921
|
-
this._segments =
|
|
246
|
+
b(this, "_handler");
|
|
247
|
+
this._segments = e, this._description = n, this._handler = t;
|
|
922
248
|
}
|
|
923
249
|
get segments() {
|
|
924
250
|
return this._segments;
|
|
@@ -930,46 +256,50 @@ class yt {
|
|
|
930
256
|
return this._handler;
|
|
931
257
|
}
|
|
932
258
|
get hasArguments() {
|
|
933
|
-
return this.segments.some((
|
|
259
|
+
return this.segments.some((e) => e.type === "argument");
|
|
934
260
|
}
|
|
935
261
|
get fullPath() {
|
|
936
|
-
return this.segments.map((
|
|
262
|
+
return this.segments.map((e) => e.name);
|
|
937
263
|
}
|
|
938
264
|
get fullPath_s() {
|
|
939
265
|
return this.fullPath.join(" ");
|
|
940
266
|
}
|
|
941
|
-
equals(
|
|
942
|
-
return this.fullPath.join(" ") ===
|
|
267
|
+
equals(e) {
|
|
268
|
+
return this.fullPath.join(" ") === e.fullPath.join(" ");
|
|
943
269
|
}
|
|
944
270
|
}
|
|
945
|
-
class
|
|
271
|
+
class Q {
|
|
946
272
|
constructor() {
|
|
947
|
-
|
|
273
|
+
b(this, "_commands", []);
|
|
948
274
|
}
|
|
949
275
|
get commands() {
|
|
950
276
|
return this._commands;
|
|
951
277
|
}
|
|
952
278
|
/**
|
|
953
|
-
* Registers a new command
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
*
|
|
957
|
-
*
|
|
279
|
+
* Registers a new command composed of ordered segments.
|
|
280
|
+
*
|
|
281
|
+
* Each segment describes either a literal word or an argument placeholder. The resulting
|
|
282
|
+
* path must be unique across the registry once argument placeholders are normalized.
|
|
283
|
+
*
|
|
284
|
+
* @param segments Ordered command path definition.
|
|
285
|
+
* @param description Human-readable summary surfaced by help and search results.
|
|
286
|
+
* @param handler Async handler executed when the command is submitted; defaults to `NoopHandler`.
|
|
287
|
+
* @throws {Error} If the segment list is empty or the path collides with an existing command.
|
|
958
288
|
*/
|
|
959
|
-
addCommand(n, t
|
|
960
|
-
if (
|
|
289
|
+
addCommand(e, n, t = le) {
|
|
290
|
+
if (e === void 0 || e.length === 0)
|
|
961
291
|
throw new Error("Command path cannot be empty");
|
|
962
|
-
const
|
|
963
|
-
const
|
|
964
|
-
(
|
|
965
|
-
).join(" "),
|
|
966
|
-
(
|
|
292
|
+
const o = new Ae(e, n, t), s = this._commands.find((a) => {
|
|
293
|
+
const l = a.segments.map(
|
|
294
|
+
(c) => c.type === "argument" ? "*" : c.name
|
|
295
|
+
).join(" "), d = e.map(
|
|
296
|
+
(c) => c.type === "argument" ? "*" : c.name
|
|
967
297
|
).join(" ");
|
|
968
|
-
return
|
|
298
|
+
return l === d;
|
|
969
299
|
});
|
|
970
|
-
if (
|
|
971
|
-
throw new Error(`Duplicate commands: '${
|
|
972
|
-
this._commands.push(
|
|
300
|
+
if (s)
|
|
301
|
+
throw new Error(`Duplicate commands: '${s.fullPath_s}' and '${o.fullPath_s}'`);
|
|
302
|
+
this._commands.push(o);
|
|
973
303
|
}
|
|
974
304
|
/**
|
|
975
305
|
* Retrieves a command from the registry for the given path.
|
|
@@ -977,24 +307,27 @@ class Ie {
|
|
|
977
307
|
* @param path The path of the command.
|
|
978
308
|
* @returns The command node or undefined if not found.
|
|
979
309
|
*/
|
|
980
|
-
getCommand(
|
|
981
|
-
return this._commands.find((
|
|
982
|
-
const
|
|
983
|
-
|
|
310
|
+
getCommand(e) {
|
|
311
|
+
return this._commands.find((n) => {
|
|
312
|
+
const t = n.fullPath.join(" "), o = e.join(" ");
|
|
313
|
+
if (t === o)
|
|
314
|
+
return !0;
|
|
315
|
+
const a = n.segments.filter((l) => l.type === "word").map((l) => l.name);
|
|
316
|
+
return a.length === e.length && a.join(" ") === o;
|
|
984
317
|
});
|
|
985
318
|
}
|
|
986
|
-
commandExistsForPath(
|
|
987
|
-
const
|
|
988
|
-
(
|
|
989
|
-
(
|
|
319
|
+
commandExistsForPath(e) {
|
|
320
|
+
const n = this._commands.map(
|
|
321
|
+
(o) => o.segments.map(
|
|
322
|
+
(s) => s.type === "argument" ? "*" : s.name
|
|
990
323
|
).join(" ")
|
|
991
|
-
),
|
|
992
|
-
(
|
|
993
|
-
var
|
|
994
|
-
return ((
|
|
324
|
+
), t = e.map((o, s) => this._commands.some(
|
|
325
|
+
(l) => {
|
|
326
|
+
var d;
|
|
327
|
+
return ((d = l.segments[s]) == null ? void 0 : d.type) === "argument";
|
|
995
328
|
}
|
|
996
|
-
) ? "*" :
|
|
997
|
-
return
|
|
329
|
+
) ? "*" : o).join(" ");
|
|
330
|
+
return n.includes(t);
|
|
998
331
|
}
|
|
999
332
|
/**
|
|
1000
333
|
* Gets possible matches for a given path.
|
|
@@ -1003,8 +336,8 @@ class Ie {
|
|
|
1003
336
|
* @returns An array of completion strings.
|
|
1004
337
|
*/
|
|
1005
338
|
// used by AvailableCommands
|
|
1006
|
-
getCompletions_s(
|
|
1007
|
-
return this.getCompletions(
|
|
339
|
+
getCompletions_s(e) {
|
|
340
|
+
return this.getCompletions(e).map((n) => n.name);
|
|
1008
341
|
}
|
|
1009
342
|
/**
|
|
1010
343
|
* Gets an array of segments reachable from a given path
|
|
@@ -1012,51 +345,51 @@ class Ie {
|
|
|
1012
345
|
* @param path The path to get completions for.
|
|
1013
346
|
* @returns An array of completion strings.
|
|
1014
347
|
*/
|
|
1015
|
-
getCompletions(
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1018
|
-
return
|
|
1019
|
-
(
|
|
348
|
+
getCompletions(e) {
|
|
349
|
+
if (C.debug("[getCompletions] path: ", e), !e.length) {
|
|
350
|
+
const s = this._commands.map((d) => d.segments[0]), a = (d, c) => d.type === c.type && d.name === c.name;
|
|
351
|
+
return s.filter(
|
|
352
|
+
(d, c, u) => c === u.findIndex((p) => a(p, d))
|
|
1020
353
|
);
|
|
1021
354
|
}
|
|
1022
|
-
const
|
|
1023
|
-
return this._commands.filter((
|
|
1024
|
-
const
|
|
1025
|
-
if (
|
|
355
|
+
const n = e.length;
|
|
356
|
+
return this._commands.filter((s) => {
|
|
357
|
+
const a = s.segments;
|
|
358
|
+
if (a.length <= n - 1)
|
|
1026
359
|
return !1;
|
|
1027
|
-
for (let
|
|
1028
|
-
const
|
|
1029
|
-
if (!(
|
|
360
|
+
for (let l = 0; l < n; l++) {
|
|
361
|
+
const d = e[l], c = a[l];
|
|
362
|
+
if (!(d === "*" && c.type === "argument") && d !== c.name)
|
|
1030
363
|
return !1;
|
|
1031
364
|
}
|
|
1032
365
|
return !0;
|
|
1033
|
-
}).filter((
|
|
1034
|
-
const
|
|
1035
|
-
return new
|
|
366
|
+
}).filter((s) => s.segments.length > n).map((s) => {
|
|
367
|
+
const a = s.segments[n], l = a.type === "argument" ? _e : Ne;
|
|
368
|
+
return new l(a.name, a.description);
|
|
1036
369
|
}).filter(
|
|
1037
|
-
(
|
|
1038
|
-
(
|
|
370
|
+
(s, a, l) => a === l.findIndex(
|
|
371
|
+
(d) => d.type === s.type && d.name === s.name
|
|
1039
372
|
)
|
|
1040
373
|
);
|
|
1041
374
|
}
|
|
1042
|
-
hasNextSegment(
|
|
1043
|
-
return this.getCompletions(
|
|
375
|
+
hasNextSegment(e) {
|
|
376
|
+
return this.getCompletions(e).length > 0;
|
|
1044
377
|
}
|
|
1045
378
|
}
|
|
1046
|
-
class
|
|
379
|
+
class de {
|
|
1047
380
|
constructor() {
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
381
|
+
b(this, "segments", []);
|
|
382
|
+
b(this, "nullSegment", new ce());
|
|
383
|
+
b(this, "observers", []);
|
|
1051
384
|
}
|
|
1052
|
-
subscribe(
|
|
1053
|
-
this.observers.push(
|
|
385
|
+
subscribe(e) {
|
|
386
|
+
this.observers.push(e);
|
|
1054
387
|
}
|
|
1055
|
-
unsubscribe(
|
|
1056
|
-
this.observers = this.observers.filter((
|
|
388
|
+
unsubscribe(e) {
|
|
389
|
+
this.observers = this.observers.filter((n) => n !== e);
|
|
1057
390
|
}
|
|
1058
391
|
notifyObservers() {
|
|
1059
|
-
this.observers.forEach((
|
|
392
|
+
this.observers.forEach((e) => e.update());
|
|
1060
393
|
}
|
|
1061
394
|
/**
|
|
1062
395
|
* Clears all segments from the stack
|
|
@@ -1067,22 +400,22 @@ class yn {
|
|
|
1067
400
|
/**
|
|
1068
401
|
* Pushes a new segment onto the stack
|
|
1069
402
|
*/
|
|
1070
|
-
push(
|
|
1071
|
-
this.segments.push(
|
|
403
|
+
push(e) {
|
|
404
|
+
this.segments.push(e), this.notifyObservers();
|
|
1072
405
|
}
|
|
1073
406
|
/**
|
|
1074
407
|
* Pushes an array of segments onto the stack
|
|
1075
408
|
*/
|
|
1076
|
-
pushAll(
|
|
1077
|
-
|
|
409
|
+
pushAll(e) {
|
|
410
|
+
e.forEach((n) => this.push(n));
|
|
1078
411
|
}
|
|
1079
412
|
/**
|
|
1080
413
|
* Removes and returns the top segment from the stack
|
|
1081
414
|
* Returns NullSegment if stack is empty
|
|
1082
415
|
*/
|
|
1083
416
|
pop() {
|
|
1084
|
-
const
|
|
1085
|
-
return this.notifyObservers(),
|
|
417
|
+
const e = this.segments.pop() || this.nullSegment;
|
|
418
|
+
return this.notifyObservers(), e;
|
|
1086
419
|
}
|
|
1087
420
|
/**
|
|
1088
421
|
* Returns the top segment without removing it
|
|
@@ -1107,21 +440,21 @@ class yn {
|
|
|
1107
440
|
* Returns true if any segment in the stack is an argument
|
|
1108
441
|
*/
|
|
1109
442
|
get hasArguments() {
|
|
1110
|
-
return this.segments.some((
|
|
443
|
+
return this.segments.some((e) => e.type === "argument");
|
|
1111
444
|
}
|
|
1112
445
|
/**
|
|
1113
446
|
* Returns all argument segments in the stack
|
|
1114
447
|
*/
|
|
1115
448
|
get arguments() {
|
|
1116
449
|
return this.segments.filter(
|
|
1117
|
-
(
|
|
450
|
+
(e) => e.type === "argument"
|
|
1118
451
|
);
|
|
1119
452
|
}
|
|
1120
453
|
/**
|
|
1121
454
|
* Returns the command path as an array of segment names
|
|
1122
455
|
*/
|
|
1123
456
|
path() {
|
|
1124
|
-
return this.segments.map((
|
|
457
|
+
return this.segments.map((e) => e.name);
|
|
1125
458
|
}
|
|
1126
459
|
/**
|
|
1127
460
|
* Returns a copy of the internal segments array
|
|
@@ -1130,240 +463,352 @@ class yn {
|
|
|
1130
463
|
return [...this.segments];
|
|
1131
464
|
}
|
|
1132
465
|
}
|
|
1133
|
-
const
|
|
1134
|
-
config:
|
|
1135
|
-
commands: new
|
|
1136
|
-
segmentStack: new
|
|
1137
|
-
},
|
|
1138
|
-
const [
|
|
1139
|
-
...
|
|
1140
|
-
...
|
|
466
|
+
const ze = {
|
|
467
|
+
config: z,
|
|
468
|
+
commands: new Q(),
|
|
469
|
+
segmentStack: new de()
|
|
470
|
+
}, j = be(ze), Ie = ({ config: r = z, commandRegistry: e, children: n }) => {
|
|
471
|
+
const [t, o] = L.useState(), s = {
|
|
472
|
+
...z,
|
|
473
|
+
...r,
|
|
1141
474
|
// Ensure nested objects are properly merged
|
|
1142
475
|
storage: {
|
|
1143
|
-
...
|
|
1144
|
-
...
|
|
476
|
+
...z.storage,
|
|
477
|
+
...r.storage
|
|
1145
478
|
},
|
|
1146
479
|
// Ensure explicit values from config take precedence
|
|
1147
|
-
cursorType:
|
|
1148
|
-
cursorColor:
|
|
1149
|
-
cursorSpeed:
|
|
1150
|
-
showCitadelKey:
|
|
480
|
+
cursorType: r.cursorType ?? z.cursorType,
|
|
481
|
+
cursorColor: r.cursorColor ?? z.cursorColor,
|
|
482
|
+
cursorSpeed: r.cursorSpeed ?? z.cursorSpeed,
|
|
483
|
+
showCitadelKey: r.showCitadelKey || "."
|
|
1151
484
|
};
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
),
|
|
1156
|
-
}, []),
|
|
1157
|
-
if (
|
|
1158
|
-
const
|
|
1159
|
-
|
|
485
|
+
A(() => {
|
|
486
|
+
q.getInstance().initializeStorage(
|
|
487
|
+
s.storage ?? z.storage
|
|
488
|
+
), o(q.getInstance().getStorage());
|
|
489
|
+
}, []), A(() => {
|
|
490
|
+
if (e && s.includeHelpCommand && !e.commandExistsForPath(["help"])) {
|
|
491
|
+
const l = Se(e);
|
|
492
|
+
e.addCommand(
|
|
1160
493
|
[{ type: "word", name: "help" }],
|
|
1161
494
|
"Show available commands",
|
|
1162
|
-
|
|
495
|
+
l
|
|
1163
496
|
);
|
|
1164
497
|
}
|
|
1165
|
-
}, [
|
|
1166
|
-
const
|
|
1167
|
-
config:
|
|
1168
|
-
commands:
|
|
1169
|
-
storage:
|
|
1170
|
-
segmentStack: new
|
|
498
|
+
}, [e, s.includeHelpCommand]);
|
|
499
|
+
const a = {
|
|
500
|
+
config: s,
|
|
501
|
+
commands: e || new Q(),
|
|
502
|
+
storage: t,
|
|
503
|
+
segmentStack: new de()
|
|
1171
504
|
};
|
|
1172
|
-
return /* @__PURE__ */
|
|
1173
|
-
},
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
505
|
+
return /* @__PURE__ */ m(j.Provider, { value: a, children: n });
|
|
506
|
+
}, F = () => {
|
|
507
|
+
const r = Y(j);
|
|
508
|
+
if (r === void 0)
|
|
1176
509
|
throw new Error("useCitadelConfig must be used within a CitadelConfigProvider");
|
|
1177
|
-
return
|
|
1178
|
-
},
|
|
1179
|
-
const
|
|
1180
|
-
if (
|
|
510
|
+
return r.config;
|
|
511
|
+
}, B = () => {
|
|
512
|
+
const r = Y(j);
|
|
513
|
+
if (r === void 0)
|
|
1181
514
|
throw new Error("useCitadelCommands must be used within a CitadelConfigProvider");
|
|
1182
|
-
return
|
|
1183
|
-
},
|
|
1184
|
-
const
|
|
1185
|
-
if (
|
|
515
|
+
return r.commands;
|
|
516
|
+
}, me = () => {
|
|
517
|
+
const r = Y(j);
|
|
518
|
+
if (r === void 0)
|
|
1186
519
|
throw new Error("useCitadelStorage must be used within a CitadelConfigProvider");
|
|
1187
|
-
return
|
|
1188
|
-
},
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
520
|
+
return r.storage;
|
|
521
|
+
}, O = () => {
|
|
522
|
+
const r = Y(j);
|
|
523
|
+
if (r === void 0)
|
|
1191
524
|
throw new Error("useSegmentStack must be used within a CitadelConfigProvider");
|
|
1192
|
-
return
|
|
525
|
+
return r.segmentStack;
|
|
1193
526
|
};
|
|
1194
|
-
class
|
|
1195
|
-
constructor(
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
this.command =
|
|
527
|
+
class Re {
|
|
528
|
+
constructor(e, n) {
|
|
529
|
+
b(this, "timestamp");
|
|
530
|
+
b(this, "command");
|
|
531
|
+
b(this, "result");
|
|
532
|
+
this.command = e.toArray().map((t) => t.type === "argument" ? t.value || "" : t.name), this.timestamp = Date.now(), this.result = n ?? new Ce();
|
|
1200
533
|
}
|
|
1201
534
|
}
|
|
1202
|
-
function
|
|
535
|
+
function Pe(r) {
|
|
1203
536
|
return {
|
|
1204
|
-
commandSegments:
|
|
537
|
+
commandSegments: r,
|
|
1205
538
|
timestamp: Date.now()
|
|
1206
539
|
};
|
|
1207
540
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const
|
|
541
|
+
function ue() {
|
|
542
|
+
const r = me(), [e, n] = R({
|
|
1210
543
|
storedCommands: [],
|
|
1211
544
|
position: null
|
|
1212
|
-
}),
|
|
1213
|
-
if (
|
|
545
|
+
}), t = w(async (l) => {
|
|
546
|
+
if (r)
|
|
1214
547
|
try {
|
|
1215
|
-
const
|
|
1216
|
-
await
|
|
1217
|
-
...
|
|
1218
|
-
storedCommands: [...
|
|
548
|
+
const d = Pe(l);
|
|
549
|
+
await r.addStoredCommand(d), n((c) => ({
|
|
550
|
+
...c,
|
|
551
|
+
storedCommands: [...c.storedCommands, d],
|
|
1219
552
|
position: null
|
|
1220
553
|
}));
|
|
1221
|
-
} catch (
|
|
1222
|
-
console.warn("Failed to save command to history:",
|
|
554
|
+
} catch (d) {
|
|
555
|
+
console.warn("Failed to save command to history:", d);
|
|
1223
556
|
}
|
|
1224
|
-
}, [
|
|
1225
|
-
|
|
1226
|
-
if (!
|
|
557
|
+
}, [r]), o = w(async () => r ? await r.getStoredCommands() : [], [r]);
|
|
558
|
+
A(() => {
|
|
559
|
+
if (!r) return;
|
|
1227
560
|
(async () => {
|
|
1228
561
|
try {
|
|
1229
|
-
const
|
|
1230
|
-
return
|
|
1231
|
-
...
|
|
1232
|
-
storedCommands:
|
|
1233
|
-
})),
|
|
1234
|
-
} catch (
|
|
1235
|
-
console.warn("Failed to load command history:",
|
|
562
|
+
const d = await r.getStoredCommands();
|
|
563
|
+
return n((c) => ({
|
|
564
|
+
...c,
|
|
565
|
+
storedCommands: d
|
|
566
|
+
})), d;
|
|
567
|
+
} catch (d) {
|
|
568
|
+
console.warn("Failed to load command history:", d);
|
|
1236
569
|
}
|
|
1237
570
|
})();
|
|
1238
|
-
}, [
|
|
1239
|
-
const
|
|
1240
|
-
if ((await
|
|
571
|
+
}, [r]);
|
|
572
|
+
const s = w(async (l) => {
|
|
573
|
+
if ((await o()).length === 0)
|
|
1241
574
|
return { segments: null, position: null };
|
|
1242
|
-
let
|
|
1243
|
-
return
|
|
1244
|
-
...
|
|
1245
|
-
position:
|
|
1246
|
-
})),
|
|
575
|
+
let c = null;
|
|
576
|
+
return l === "up" ? e.position === null ? c = e.storedCommands.length - 1 : e.position > 0 ? c = e.position - 1 : c = 0 : e.position === null || e.position >= e.storedCommands.length - 1 ? c = null : c = e.position + 1, n((p) => ({
|
|
577
|
+
...p,
|
|
578
|
+
position: c
|
|
579
|
+
})), c === null ? {
|
|
1247
580
|
segments: [],
|
|
1248
581
|
position: null
|
|
1249
582
|
} : {
|
|
1250
|
-
segments:
|
|
1251
|
-
position:
|
|
583
|
+
segments: c !== null ? e.storedCommands[c].commandSegments : null,
|
|
584
|
+
position: c
|
|
1252
585
|
};
|
|
1253
|
-
}, [
|
|
586
|
+
}, [e, o]), a = w(async () => {
|
|
1254
587
|
try {
|
|
1255
|
-
if (!
|
|
1256
|
-
await
|
|
588
|
+
if (!r) return;
|
|
589
|
+
await r.clear(), n({
|
|
1257
590
|
storedCommands: [],
|
|
1258
591
|
position: null
|
|
1259
592
|
});
|
|
1260
|
-
} catch (
|
|
1261
|
-
console.warn("Failed to clear command history:",
|
|
593
|
+
} catch (l) {
|
|
594
|
+
console.warn("Failed to clear command history:", l);
|
|
1262
595
|
}
|
|
1263
|
-
}, [
|
|
596
|
+
}, [r]);
|
|
1264
597
|
return {
|
|
1265
|
-
history:
|
|
1266
|
-
addStoredCommand:
|
|
1267
|
-
getStoredCommands:
|
|
1268
|
-
navigateHistory:
|
|
1269
|
-
clear:
|
|
598
|
+
history: e,
|
|
599
|
+
addStoredCommand: t,
|
|
600
|
+
getStoredCommands: o,
|
|
601
|
+
navigateHistory: s,
|
|
602
|
+
clear: a
|
|
1270
603
|
};
|
|
1271
604
|
}
|
|
1272
|
-
const
|
|
1273
|
-
const
|
|
605
|
+
const X = () => {
|
|
606
|
+
const r = F(), e = B(), n = ue(), t = O(), o = me(), [s, a] = R({
|
|
1274
607
|
currentInput: "",
|
|
1275
608
|
isEnteringArg: !1,
|
|
1276
609
|
output: [],
|
|
1277
610
|
history: {
|
|
1278
611
|
commands: [],
|
|
1279
612
|
position: null,
|
|
1280
|
-
storage:
|
|
613
|
+
storage: o
|
|
1281
614
|
}
|
|
1282
615
|
});
|
|
1283
|
-
|
|
1284
|
-
}, [
|
|
1285
|
-
|
|
1286
|
-
...
|
|
616
|
+
A(() => {
|
|
617
|
+
}, [o]), A(() => {
|
|
618
|
+
a((u) => ({
|
|
619
|
+
...u,
|
|
1287
620
|
history: {
|
|
1288
|
-
commands:
|
|
1289
|
-
position:
|
|
1290
|
-
storage:
|
|
621
|
+
commands: n.history.storedCommands,
|
|
622
|
+
position: n.history.position,
|
|
623
|
+
storage: o
|
|
1291
624
|
}
|
|
1292
625
|
}));
|
|
1293
|
-
}, [
|
|
1294
|
-
const
|
|
1295
|
-
setCurrentInput:
|
|
1296
|
-
|
|
626
|
+
}, [n.history, o]);
|
|
627
|
+
const l = {
|
|
628
|
+
setCurrentInput: w((u) => {
|
|
629
|
+
C.debug("[CitadelActions] setCurrentInput: ", u), a((p) => ({ ...p, currentInput: u }));
|
|
1297
630
|
}, []),
|
|
1298
|
-
setIsEnteringArg:
|
|
1299
|
-
|
|
631
|
+
setIsEnteringArg: w((u) => {
|
|
632
|
+
C.debug("[CitadelActions] setIsEnteringArg: ", u), a((p) => ({ ...p, isEnteringArg: u }));
|
|
1300
633
|
}, []),
|
|
1301
|
-
addOutput:
|
|
1302
|
-
|
|
1303
|
-
...
|
|
1304
|
-
output: [...
|
|
634
|
+
addOutput: w((u) => {
|
|
635
|
+
C.debug("[CitadelActions]addOutput: ", u), a((p) => ({
|
|
636
|
+
...p,
|
|
637
|
+
output: [...p.output, u]
|
|
1305
638
|
}));
|
|
1306
639
|
}, []),
|
|
1307
|
-
executeCommand:
|
|
1308
|
-
const
|
|
1309
|
-
if (!
|
|
1310
|
-
console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ",
|
|
640
|
+
executeCommand: w(async () => {
|
|
641
|
+
const u = t.path(), p = e.getCommand(u);
|
|
642
|
+
if (!p) {
|
|
643
|
+
console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ", u);
|
|
1311
644
|
return;
|
|
1312
645
|
}
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1315
|
-
...
|
|
1316
|
-
output: [...
|
|
646
|
+
const k = new Re(t);
|
|
647
|
+
a((y) => ({
|
|
648
|
+
...y,
|
|
649
|
+
output: [...y.output, k]
|
|
1317
650
|
}));
|
|
1318
651
|
try {
|
|
1319
|
-
const
|
|
652
|
+
const y = new Promise((i, h) => {
|
|
1320
653
|
setTimeout(() => {
|
|
1321
|
-
|
|
1322
|
-
},
|
|
1323
|
-
}),
|
|
1324
|
-
|
|
1325
|
-
|
|
654
|
+
h(new Error("Request timed out"));
|
|
655
|
+
}, r.commandTimeoutMs);
|
|
656
|
+
}), E = t.arguments.map((i) => i.value || ""), N = await Promise.race([
|
|
657
|
+
p.handler(E),
|
|
658
|
+
y
|
|
1326
659
|
]);
|
|
1327
|
-
if (!(
|
|
660
|
+
if (!(N instanceof U))
|
|
1328
661
|
throw new Error(
|
|
1329
|
-
`The ${
|
|
662
|
+
`The ${u.join(".")} command returned an invalid result type. Commands must return an instance of a CommandResult.
|
|
1330
663
|
For example:
|
|
1331
664
|
return new JsonCommandResult({ text: "Hello World" });
|
|
1332
|
-
Check the definition of the ${
|
|
665
|
+
Check the definition of the ${u.join(".")} command and update the return type for its handler.`
|
|
1333
666
|
);
|
|
1334
|
-
|
|
1335
|
-
...
|
|
1336
|
-
output:
|
|
1337
|
-
(
|
|
667
|
+
N.markSuccess(), a((i) => ({
|
|
668
|
+
...i,
|
|
669
|
+
output: i.output.map(
|
|
670
|
+
(h) => h.timestamp === k.timestamp ? { ...h, result: N } : h
|
|
1338
671
|
)
|
|
1339
672
|
}));
|
|
1340
|
-
} catch (
|
|
1341
|
-
const
|
|
1342
|
-
|
|
673
|
+
} catch (y) {
|
|
674
|
+
const E = new ve(
|
|
675
|
+
y instanceof Error ? y.message : "Unknown error"
|
|
1343
676
|
);
|
|
1344
|
-
|
|
1345
|
-
...
|
|
1346
|
-
output:
|
|
1347
|
-
(
|
|
677
|
+
E.markFailure(), a((N) => ({
|
|
678
|
+
...N,
|
|
679
|
+
output: N.output.map(
|
|
680
|
+
(i) => i.timestamp === k.timestamp ? { ...i, result: E } : i
|
|
1348
681
|
)
|
|
1349
682
|
}));
|
|
1350
683
|
}
|
|
1351
|
-
}, [
|
|
1352
|
-
clearHistory:
|
|
684
|
+
}, [e, r.commandTimeoutMs, t]),
|
|
685
|
+
clearHistory: w(async () => {
|
|
1353
686
|
try {
|
|
1354
|
-
await
|
|
1355
|
-
} catch (
|
|
1356
|
-
console.warn("Failed to clear history:",
|
|
687
|
+
await n.clear();
|
|
688
|
+
} catch (u) {
|
|
689
|
+
console.warn("Failed to clear history:", u);
|
|
1357
690
|
}
|
|
1358
|
-
}, [
|
|
1359
|
-
},
|
|
691
|
+
}, [n])
|
|
692
|
+
}, d = w(() => e.getCompletions_s(t.path()), [t, e]), c = w(() => e.getCompletions(t.path()), [t, e]);
|
|
1360
693
|
return {
|
|
1361
|
-
state:
|
|
1362
|
-
actions:
|
|
1363
|
-
getAvailableCommands_s:
|
|
1364
|
-
getAvailableCommandSegments:
|
|
694
|
+
state: s,
|
|
695
|
+
actions: l,
|
|
696
|
+
getAvailableCommands_s: d,
|
|
697
|
+
getAvailableCommandSegments: c
|
|
698
|
+
};
|
|
699
|
+
}, He = ({ onOpen: r, onClose: e, isVisible: n, showCitadelKey: t }) => {
|
|
700
|
+
A(() => {
|
|
701
|
+
const o = (s) => {
|
|
702
|
+
var a, l;
|
|
703
|
+
!n && s.key === t && !["input", "textarea"].includes(((l = (a = s.target) == null ? void 0 : a.tagName) == null ? void 0 : l.toLowerCase()) || "") && (s.preventDefault(), r()), n && s.key === "Escape" && (s.preventDefault(), e());
|
|
704
|
+
};
|
|
705
|
+
return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
|
|
706
|
+
}, [r, e, n, t]);
|
|
707
|
+
}, De = "_panelContainer_1pav9_3", Me = "_innerContainer_1pav9_19", Ue = "_inputSection_1pav9_29", Fe = "_resizeHandle_1pav9_36", Te = "_citadel_slideUp_1pav9_65", je = "_citadel_slideDown_1pav9_69", Oe = "_inlineContainer_1pav9_73", Z = {
|
|
708
|
+
panelContainer: De,
|
|
709
|
+
innerContainer: Me,
|
|
710
|
+
inputSection: Ue,
|
|
711
|
+
resizeHandle: Fe,
|
|
712
|
+
citadel_slideUp: Te,
|
|
713
|
+
citadel_slideDown: je,
|
|
714
|
+
inlineContainer: Oe
|
|
715
|
+
}, $e = (r) => {
|
|
716
|
+
const { isVisible: e, isClosing: n, onAnimationComplete: t } = r, o = V(() => e ? n ? Z.slideDown : Z.slideUp : "", [e, n]);
|
|
717
|
+
return A(() => {
|
|
718
|
+
if (t) {
|
|
719
|
+
const a = setTimeout(() => {
|
|
720
|
+
t();
|
|
721
|
+
}, 200);
|
|
722
|
+
return () => clearTimeout(a);
|
|
723
|
+
}
|
|
724
|
+
}, [n, t]), {
|
|
725
|
+
style: V(() => ({
|
|
726
|
+
opacity: e ? 1 : 0,
|
|
727
|
+
transform: e ? "translateY(0)" : n ? "translateY(100%)" : "translateY(-100%)",
|
|
728
|
+
transition: "opacity 200ms ease-in-out, transform 200ms ease-in-out"
|
|
729
|
+
}), [e, n]),
|
|
730
|
+
animationClass: o
|
|
1365
731
|
};
|
|
1366
|
-
},
|
|
732
|
+
}, Ke = () => /* @__PURE__ */ m(
|
|
733
|
+
"div",
|
|
734
|
+
{
|
|
735
|
+
"data-testid": "spinner",
|
|
736
|
+
className: "animate-spin rounded-full h-4 w-4 border-2 border-gray-300 border-t-gray-600"
|
|
737
|
+
}
|
|
738
|
+
), Le = ({
|
|
739
|
+
command: r,
|
|
740
|
+
timestamp: e,
|
|
741
|
+
status: n
|
|
742
|
+
}) => /* @__PURE__ */ _("div", { className: "flex items-center gap-2 font-mono text-sm", children: [
|
|
743
|
+
/* @__PURE__ */ _("span", { className: "text-gray-200", children: [
|
|
744
|
+
"> ",
|
|
745
|
+
r.split(" ").map((t, o) => {
|
|
746
|
+
const s = t.startsWith("<") && t.endsWith(">");
|
|
747
|
+
return /* @__PURE__ */ _(
|
|
748
|
+
"span",
|
|
749
|
+
{
|
|
750
|
+
className: s ? "text-green-400" : "text-gray-200",
|
|
751
|
+
children: [
|
|
752
|
+
o > 0 ? " " : "",
|
|
753
|
+
t
|
|
754
|
+
]
|
|
755
|
+
},
|
|
756
|
+
o
|
|
757
|
+
);
|
|
758
|
+
})
|
|
759
|
+
] }),
|
|
760
|
+
/* @__PURE__ */ m("span", { className: "text-gray-400", children: "·" }),
|
|
761
|
+
/* @__PURE__ */ m("span", { className: "text-gray-500", children: e }),
|
|
762
|
+
n === T.Pending && /* @__PURE__ */ m(Ke, {}),
|
|
763
|
+
n === T.Success && /* @__PURE__ */ m(
|
|
764
|
+
"div",
|
|
765
|
+
{
|
|
766
|
+
"data-testid": "success-indicator",
|
|
767
|
+
className: "w-4 h-4 rounded-full bg-green-500"
|
|
768
|
+
}
|
|
769
|
+
),
|
|
770
|
+
(n === T.Timeout || n === T.Failure) && /* @__PURE__ */ m(
|
|
771
|
+
"div",
|
|
772
|
+
{
|
|
773
|
+
"data-testid": "success-indicator",
|
|
774
|
+
className: "w-4 h-4 rounded-full bg-red-500"
|
|
775
|
+
}
|
|
776
|
+
)
|
|
777
|
+
] }), Ve = ({ output: r, outputRef: e }) => {
|
|
778
|
+
const n = F(), t = w(() => {
|
|
779
|
+
if (e.current) {
|
|
780
|
+
const o = e.current;
|
|
781
|
+
requestAnimationFrame(() => {
|
|
782
|
+
o.scrollTop = o.scrollHeight;
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}, [e]);
|
|
786
|
+
return A(() => {
|
|
787
|
+
if (t(), e.current) {
|
|
788
|
+
const o = e.current.getElementsByTagName("img"), s = o[o.length - 1];
|
|
789
|
+
if (s && !s.complete)
|
|
790
|
+
return s.addEventListener("load", t), () => s.removeEventListener("load", t);
|
|
791
|
+
}
|
|
792
|
+
}, [r, t, e]), /* @__PURE__ */ m(
|
|
793
|
+
"div",
|
|
794
|
+
{
|
|
795
|
+
ref: e,
|
|
796
|
+
className: "h-full overflow-y-auto border border-gray-700 rounded-lg p-3 text-left",
|
|
797
|
+
"data-testid": "citadel-command-output",
|
|
798
|
+
children: r.map((o, s) => /* @__PURE__ */ _("div", { className: "mb-4 last:mb-0", children: [
|
|
799
|
+
/* @__PURE__ */ m(
|
|
800
|
+
Le,
|
|
801
|
+
{
|
|
802
|
+
command: o.command.join(" "),
|
|
803
|
+
timestamp: new Date(o.timestamp).toLocaleTimeString(),
|
|
804
|
+
status: o.result.status
|
|
805
|
+
}
|
|
806
|
+
),
|
|
807
|
+
/* @__PURE__ */ m("pre", { className: `text-gray-200 whitespace-pre font-mono ${n.outputFontSize}`, children: o.result.render() })
|
|
808
|
+
] }, s))
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
}, We = {
|
|
1367
812
|
blink: {
|
|
1368
813
|
character: "▋",
|
|
1369
814
|
speed: 530,
|
|
@@ -1384,301 +829,299 @@ Check the definition of the ${h.join(".")} command and update the return type fo
|
|
|
1384
829
|
speed: 120,
|
|
1385
830
|
color: "#fff"
|
|
1386
831
|
}
|
|
1387
|
-
},
|
|
1388
|
-
style:
|
|
1389
|
-
isValid:
|
|
1390
|
-
errorMessage:
|
|
832
|
+
}, ee = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], ne = ["|", "/", "-", "\\"], qe = ({
|
|
833
|
+
style: r = { type: "blink" },
|
|
834
|
+
isValid: e = !0,
|
|
835
|
+
errorMessage: n
|
|
1391
836
|
}) => {
|
|
1392
|
-
const
|
|
1393
|
-
...
|
|
1394
|
-
...
|
|
1395
|
-
}), [
|
|
1396
|
-
|
|
1397
|
-
if (
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
},
|
|
1401
|
-
return () => clearInterval(
|
|
1402
|
-
}, [
|
|
1403
|
-
const
|
|
1404
|
-
color:
|
|
837
|
+
const t = V(() => ({
|
|
838
|
+
...We[r.type],
|
|
839
|
+
...r
|
|
840
|
+
}), [r]), [o, s] = R(!0), [a, l] = R(0);
|
|
841
|
+
A(() => {
|
|
842
|
+
if (t.speed === 0) return;
|
|
843
|
+
const u = setInterval(() => {
|
|
844
|
+
t.type === "blink" ? s((p) => !p) : ["spin", "bbs"].includes(t.type) && l((p) => (p + 1) % (t.type === "bbs" ? ne.length : ee.length));
|
|
845
|
+
}, t.speed);
|
|
846
|
+
return () => clearInterval(u);
|
|
847
|
+
}, [t.type, t.speed]);
|
|
848
|
+
const d = V(() => ({
|
|
849
|
+
color: e ? t.color : "#ff4444",
|
|
1405
850
|
transition: "color 0.15s ease-in-out"
|
|
1406
|
-
}), [
|
|
1407
|
-
return /* @__PURE__ */
|
|
851
|
+
}), [e, t.color]);
|
|
852
|
+
return /* @__PURE__ */ m("div", { className: "relative inline-block", children: /* @__PURE__ */ m(
|
|
1408
853
|
"span",
|
|
1409
854
|
{
|
|
1410
|
-
className: `command-cursor ${
|
|
1411
|
-
style:
|
|
1412
|
-
title:
|
|
1413
|
-
children:
|
|
855
|
+
className: `command-cursor ${e ? "" : "animate-shake"}`,
|
|
856
|
+
style: d,
|
|
857
|
+
title: n,
|
|
858
|
+
children: !e && n ? "✗" : ["spin", "bbs"].includes(t.type) ? (t.type === "bbs" ? ne : ee)[a] : t.type === "solid" || o ? t.character : " "
|
|
1414
859
|
}
|
|
1415
860
|
) });
|
|
1416
861
|
};
|
|
1417
|
-
function
|
|
1418
|
-
switch (
|
|
862
|
+
function Ye(r, e) {
|
|
863
|
+
switch (e.type) {
|
|
1419
864
|
case "set":
|
|
1420
|
-
return
|
|
865
|
+
return C.debug(`[inputStateReducer] InputState changing from ${r} to ${e.state}`), e.state;
|
|
1421
866
|
default:
|
|
1422
|
-
return
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
const
|
|
1426
|
-
const { state:
|
|
1427
|
-
|
|
1428
|
-
},
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
}, [
|
|
1432
|
-
if (!
|
|
1433
|
-
const
|
|
1434
|
-
const
|
|
1435
|
-
return (
|
|
867
|
+
return r;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
const Be = () => {
|
|
871
|
+
const { state: r } = X(), e = B(), n = ue(), t = O(), [o, s] = ye(Ye, "idle"), a = (i) => {
|
|
872
|
+
s({ type: "set", state: i });
|
|
873
|
+
}, l = w(() => {
|
|
874
|
+
const h = e.getCompletions(t.path())[0] || t.nullSegment;
|
|
875
|
+
return C.debug("[getNextExpectedSegment] ", h), h;
|
|
876
|
+
}, [e, t]), d = w(() => e.getCompletions_s(t.path()).map((h) => e.getCommand([...t.path(), h])).filter((h) => h !== void 0), [e, t]), c = w((i, h) => {
|
|
877
|
+
if (!i) return h;
|
|
878
|
+
const g = h.reduce((f, x) => {
|
|
879
|
+
const v = l();
|
|
880
|
+
return (v == null ? void 0 : v.type) === "word" && f.set(v.name, x), f;
|
|
1436
881
|
}, /* @__PURE__ */ new Map());
|
|
1437
|
-
return Array.from(
|
|
1438
|
-
const
|
|
1439
|
-
return
|
|
882
|
+
return Array.from(g.values()).filter(() => {
|
|
883
|
+
const f = l();
|
|
884
|
+
return f.type !== "word" ? !1 : f.name.toLowerCase().startsWith(i.toLowerCase());
|
|
1440
885
|
});
|
|
1441
|
-
}, [
|
|
1442
|
-
const
|
|
1443
|
-
(
|
|
886
|
+
}, [l]), u = w((i) => {
|
|
887
|
+
const g = e.getCompletions(t.path()).filter((S) => S.type === "word").filter(
|
|
888
|
+
(S) => S.name.toLowerCase().startsWith(i.toLowerCase())
|
|
1444
889
|
);
|
|
1445
|
-
return
|
|
1446
|
-
}, [
|
|
1447
|
-
const
|
|
1448
|
-
return
|
|
1449
|
-
(
|
|
890
|
+
return g.length === 1 ? g[0] : t.nullSegment;
|
|
891
|
+
}, [e, t]), p = w((i) => {
|
|
892
|
+
const h = t.path(), g = e.getCompletions(h);
|
|
893
|
+
return g.length === 0 && i ? !1 : g.some((f) => f.type === "argument") ? !0 : g.some(
|
|
894
|
+
(f) => f.type === "word" && f.name.toLowerCase().startsWith(i.toLowerCase())
|
|
1450
895
|
);
|
|
1451
|
-
}, [
|
|
1452
|
-
|
|
1453
|
-
const
|
|
1454
|
-
return !
|
|
1455
|
-
}, [
|
|
1456
|
-
if (
|
|
1457
|
-
if (
|
|
1458
|
-
const
|
|
1459
|
-
if (
|
|
1460
|
-
if (
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1463
|
-
const
|
|
1464
|
-
|
|
896
|
+
}, [e, t]), k = w((i) => {
|
|
897
|
+
C.debug("[tryAutoComplete] input: ", i);
|
|
898
|
+
const h = u(i);
|
|
899
|
+
return !h || h.name === i ? new ce() : (C.debug("[tryAutoComplete] result: ", h), h);
|
|
900
|
+
}, [u]), y = w((i, h) => {
|
|
901
|
+
if (r.history.position === null) {
|
|
902
|
+
if (h.setCurrentInput(i), C.debug("[useCommandParser][handleInputChange] newValue: ", i), o === "entering_argument") {
|
|
903
|
+
const g = te(i);
|
|
904
|
+
if (g.isQuoted)
|
|
905
|
+
if (g.isComplete) {
|
|
906
|
+
const S = l();
|
|
907
|
+
if (S.type === "argument") {
|
|
908
|
+
const f = S;
|
|
909
|
+
f.value = i.trim() || "", C.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", f), t.push(f), h.setCurrentInput(""), a("idle");
|
|
1465
910
|
return;
|
|
1466
911
|
}
|
|
1467
912
|
} else
|
|
1468
913
|
return;
|
|
1469
|
-
else if (
|
|
1470
|
-
const
|
|
1471
|
-
|
|
914
|
+
else if (g.isComplete) {
|
|
915
|
+
const S = l();
|
|
916
|
+
S.value = i.trim() || "", C.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", S), t.push(S), h.setCurrentInput(""), a("idle");
|
|
1472
917
|
return;
|
|
1473
918
|
} else
|
|
1474
919
|
return;
|
|
1475
920
|
}
|
|
1476
|
-
if (
|
|
1477
|
-
const
|
|
1478
|
-
if (
|
|
1479
|
-
|
|
921
|
+
if (o == "entering_command") {
|
|
922
|
+
const g = k(i);
|
|
923
|
+
if (g.type === "word") {
|
|
924
|
+
C.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", g), t.push(g), h.setCurrentInput(""), a("idle");
|
|
1480
925
|
return;
|
|
1481
926
|
}
|
|
1482
927
|
}
|
|
1483
928
|
}
|
|
1484
|
-
}, [
|
|
1485
|
-
|
|
1486
|
-
}, [
|
|
1487
|
-
if (!(
|
|
929
|
+
}, [k, r, l, o, t]), E = w((i) => {
|
|
930
|
+
i.setCurrentInput(""), i.setIsEnteringArg(!1), t.clear(), a("idle");
|
|
931
|
+
}, [t]), N = w((i, h, g) => {
|
|
932
|
+
if (!(i.key === "Backspace" || i.key === "Enter" || i.key === "ArrowUp" || i.key === "ArrowDown" || i.key === "ArrowLeft" || i.key === "ArrowRight" || i.key === "Escape" || i.key === "Delete" || i.key === "Home" || i.key === "End" || i.key.length === 1))
|
|
1488
933
|
return !0;
|
|
1489
|
-
const { currentInput:
|
|
1490
|
-
switch (
|
|
934
|
+
const { currentInput: f, isEnteringArg: x } = h, v = te(f);
|
|
935
|
+
switch (i.key) {
|
|
1491
936
|
case "Backspace":
|
|
1492
|
-
return
|
|
937
|
+
return f === "" && (i.preventDefault(), t.size() > 0 && t.pop(), a("idle")), !0;
|
|
1493
938
|
case "Enter": {
|
|
1494
|
-
if (
|
|
939
|
+
if (i.preventDefault(), v.isQuoted && !v.isComplete)
|
|
1495
940
|
return !0;
|
|
1496
|
-
if (
|
|
1497
|
-
const
|
|
1498
|
-
|
|
941
|
+
if (o === "entering_argument" || x && f.trim()) {
|
|
942
|
+
const G = l();
|
|
943
|
+
G.value = f, C.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", G), t.push(G);
|
|
1499
944
|
}
|
|
1500
|
-
|
|
945
|
+
const I = t.path(), P = e.getCommand(I);
|
|
946
|
+
if (!P)
|
|
947
|
+
return !1;
|
|
948
|
+
const $ = P.segments.filter((M) => M.type === "argument"), K = t.arguments;
|
|
949
|
+
return $.length > K.length ? !1 : (C.debug("[handleKeyDown][Enter] calling actions.executeCommand. segmentStack: ", t), g.executeCommand(), n.addStoredCommand(t.toArray()), E(g), !0);
|
|
1501
950
|
}
|
|
1502
951
|
case "ArrowUp":
|
|
1503
|
-
return
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
952
|
+
return i.preventDefault(), (async () => {
|
|
953
|
+
const I = await n.navigateHistory("up", t.toArray());
|
|
954
|
+
return I.segments && (t.clear(), t.pushAll(I.segments), g.setCurrentInput("")), !0;
|
|
1506
955
|
})();
|
|
1507
956
|
case "ArrowDown":
|
|
1508
|
-
return
|
|
1509
|
-
const
|
|
1510
|
-
return
|
|
957
|
+
return i.preventDefault(), (async () => {
|
|
958
|
+
const I = await n.navigateHistory("down", t.toArray());
|
|
959
|
+
return I.segments && (t.clear(), t.pushAll(I.segments), g.setCurrentInput("")), !0;
|
|
1511
960
|
})();
|
|
1512
961
|
default: {
|
|
1513
|
-
if (!
|
|
1514
|
-
const
|
|
1515
|
-
if (!
|
|
1516
|
-
return
|
|
962
|
+
if (!x && i.key.length === 1) {
|
|
963
|
+
const I = f + i.key;
|
|
964
|
+
if (!p(I))
|
|
965
|
+
return i.preventDefault(), !1;
|
|
1517
966
|
}
|
|
1518
967
|
return !0;
|
|
1519
968
|
}
|
|
1520
969
|
}
|
|
1521
970
|
}, [
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
971
|
+
o,
|
|
972
|
+
p,
|
|
973
|
+
l,
|
|
974
|
+
n,
|
|
975
|
+
E,
|
|
976
|
+
e,
|
|
977
|
+
t
|
|
1528
978
|
]);
|
|
1529
979
|
return {
|
|
1530
|
-
handleInputChange:
|
|
1531
|
-
handleKeyDown:
|
|
1532
|
-
inputState:
|
|
1533
|
-
setInputStateWithLogging:
|
|
980
|
+
handleInputChange: y,
|
|
981
|
+
handleKeyDown: N,
|
|
982
|
+
inputState: o,
|
|
983
|
+
setInputStateWithLogging: a,
|
|
1534
984
|
// Expose internal functions for testing
|
|
1535
|
-
findMatchingCommands:
|
|
1536
|
-
getAutocompleteSuggestion:
|
|
1537
|
-
getAvailableNodes:
|
|
1538
|
-
getNextExpectedSegment:
|
|
1539
|
-
isValidCommandInput:
|
|
985
|
+
findMatchingCommands: c,
|
|
986
|
+
getAutocompleteSuggestion: u,
|
|
987
|
+
getAvailableNodes: d,
|
|
988
|
+
getNextExpectedSegment: l,
|
|
989
|
+
isValidCommandInput: p
|
|
1540
990
|
};
|
|
1541
991
|
};
|
|
1542
|
-
function
|
|
1543
|
-
const
|
|
1544
|
-
let
|
|
1545
|
-
for (let
|
|
1546
|
-
const
|
|
1547
|
-
(
|
|
992
|
+
function te(r) {
|
|
993
|
+
const e = [];
|
|
994
|
+
let n = "", t = !1, o;
|
|
995
|
+
for (let s = 0; s < r.length; s++) {
|
|
996
|
+
const a = r[s];
|
|
997
|
+
(a === '"' || a === "'") && (!t || a === o) ? t ? (e.push(n), n = "", t = !1, o = void 0) : (n && (e.push(n), n = ""), t = !0, o = a) : !t && a === " " ? n && (e.push(n), n = "") : n += a;
|
|
1548
998
|
}
|
|
1549
999
|
return {
|
|
1550
|
-
words:
|
|
1551
|
-
currentWord:
|
|
1552
|
-
isQuoted:
|
|
1553
|
-
quoteChar:
|
|
1554
|
-
isComplete: !
|
|
1000
|
+
words: e,
|
|
1001
|
+
currentWord: n,
|
|
1002
|
+
isQuoted: t,
|
|
1003
|
+
quoteChar: o,
|
|
1004
|
+
isComplete: !t && !n
|
|
1555
1005
|
};
|
|
1556
1006
|
}
|
|
1557
|
-
const
|
|
1558
|
-
const
|
|
1559
|
-
return
|
|
1560
|
-
const
|
|
1007
|
+
const Ge = () => {
|
|
1008
|
+
const r = O(), [e, n] = R(0);
|
|
1009
|
+
return A(() => {
|
|
1010
|
+
const t = {
|
|
1561
1011
|
update: () => {
|
|
1562
|
-
|
|
1012
|
+
n((o) => o + 1);
|
|
1563
1013
|
}
|
|
1564
1014
|
};
|
|
1565
|
-
return
|
|
1566
|
-
|
|
1015
|
+
return r.subscribe(t), () => {
|
|
1016
|
+
r.unsubscribe(t);
|
|
1567
1017
|
};
|
|
1568
|
-
}, [
|
|
1569
|
-
},
|
|
1570
|
-
state:
|
|
1571
|
-
actions:
|
|
1018
|
+
}, [r]), e;
|
|
1019
|
+
}, Je = ({
|
|
1020
|
+
state: r,
|
|
1021
|
+
actions: e
|
|
1572
1022
|
}) => {
|
|
1573
|
-
const
|
|
1574
|
-
handleKeyDown:
|
|
1575
|
-
handleInputChange:
|
|
1576
|
-
inputState:
|
|
1577
|
-
setInputStateWithLogging:
|
|
1578
|
-
getNextExpectedSegment:
|
|
1579
|
-
} =
|
|
1580
|
-
const
|
|
1581
|
-
await Promise.resolve(
|
|
1582
|
-
},
|
|
1583
|
-
|
|
1584
|
-
},
|
|
1585
|
-
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1023
|
+
const n = H(null), t = B(), o = O(), {
|
|
1024
|
+
handleKeyDown: s,
|
|
1025
|
+
handleInputChange: a,
|
|
1026
|
+
inputState: l,
|
|
1027
|
+
setInputStateWithLogging: d,
|
|
1028
|
+
getNextExpectedSegment: c
|
|
1029
|
+
} = Be(), [u, p] = R(!1), k = F(), y = Ge(), E = async (x) => {
|
|
1030
|
+
const v = s(x, r, e);
|
|
1031
|
+
await Promise.resolve(v) === !1 && (p(!0), setTimeout(() => p(!1), 500));
|
|
1032
|
+
}, N = (x) => {
|
|
1033
|
+
a(x.target.value, e);
|
|
1034
|
+
}, i = (x) => {
|
|
1035
|
+
x.preventDefault();
|
|
1036
|
+
const v = x.clipboardData.getData("text");
|
|
1037
|
+
a(v, e);
|
|
1588
1038
|
};
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
}, [
|
|
1592
|
-
if (
|
|
1593
|
-
const
|
|
1594
|
-
let
|
|
1595
|
-
switch (
|
|
1039
|
+
A(() => {
|
|
1040
|
+
n.current && n.current.focus(), l !== "entering_command" && d("entering_command");
|
|
1041
|
+
}, [l, d]), A(() => {
|
|
1042
|
+
if (l !== "idle") return;
|
|
1043
|
+
const x = c();
|
|
1044
|
+
let v = "idle";
|
|
1045
|
+
switch (x.type) {
|
|
1596
1046
|
case "word":
|
|
1597
|
-
|
|
1047
|
+
v = "entering_command", e.setIsEnteringArg(!1);
|
|
1598
1048
|
break;
|
|
1599
1049
|
case "argument":
|
|
1600
|
-
|
|
1050
|
+
v = "entering_argument", e.setIsEnteringArg(!0);
|
|
1601
1051
|
break;
|
|
1602
1052
|
}
|
|
1603
|
-
|
|
1604
|
-
}, [
|
|
1605
|
-
const [
|
|
1606
|
-
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
const
|
|
1610
|
-
if (
|
|
1611
|
-
const
|
|
1612
|
-
return /* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
|
|
1615
|
-
] }, "arg-" +
|
|
1053
|
+
d(v);
|
|
1054
|
+
}, [y, l, c, d, e]);
|
|
1055
|
+
const [h, g] = R([]);
|
|
1056
|
+
A(() => {
|
|
1057
|
+
const x = [], v = o.toArray().map((P, $) => {
|
|
1058
|
+
x.push(P.name);
|
|
1059
|
+
const K = t.hasNextSegment(x);
|
|
1060
|
+
if (P.type === "argument") {
|
|
1061
|
+
const M = P;
|
|
1062
|
+
return /* @__PURE__ */ _(L.Fragment, { children: [
|
|
1063
|
+
/* @__PURE__ */ m("span", { className: "text-gray-200 whitespace-pre", children: M.value }),
|
|
1064
|
+
$ < o.size() && K && /* @__PURE__ */ m("span", { className: "text-gray-200 whitespace-pre", children: " " })
|
|
1065
|
+
] }, "arg-" + M.name + M.value);
|
|
1616
1066
|
}
|
|
1617
|
-
return /* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
|
|
1620
|
-
] }, "word-" +
|
|
1067
|
+
return /* @__PURE__ */ _(L.Fragment, { children: [
|
|
1068
|
+
/* @__PURE__ */ m("span", { className: "text-blue-400 whitespace-pre", children: P.name }),
|
|
1069
|
+
$ < o.size() && K && /* @__PURE__ */ m("span", { className: "text-blue-400 whitespace-pre", children: " " })
|
|
1070
|
+
] }, "word-" + P.name);
|
|
1621
1071
|
});
|
|
1622
|
-
|
|
1623
|
-
}, [
|
|
1624
|
-
const [
|
|
1625
|
-
return
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1628
|
-
}, [
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
@keyframes
|
|
1631
|
-
0%, 100% {
|
|
1632
|
-
|
|
1633
|
-
75% { transform: translateX(4px); }
|
|
1634
|
-
}
|
|
1635
|
-
@keyframes flashBorder {
|
|
1636
|
-
0%, 100% { border-color: transparent; }
|
|
1637
|
-
50% { border-color: rgb(239, 68, 68); }
|
|
1072
|
+
g([/* @__PURE__ */ m("div", { className: "flex items-center gap-1", "data-testid": "user-input-area", children: v }, "{segmentStackVersion}")]);
|
|
1073
|
+
}, [y, t, o]);
|
|
1074
|
+
const [S, f] = R("");
|
|
1075
|
+
return A(() => {
|
|
1076
|
+
const x = c();
|
|
1077
|
+
x.type === "argument" ? f(x.name) : f("");
|
|
1078
|
+
}, [y, c]), /* @__PURE__ */ _("div", { className: "flex flex-col w-full bg-gray-900 rounded-lg p-4", children: [
|
|
1079
|
+
/* @__PURE__ */ m("style", { children: `
|
|
1080
|
+
@keyframes subtleGlow {
|
|
1081
|
+
0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
|
|
1082
|
+
50% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
|
|
1638
1083
|
}
|
|
1639
1084
|
.invalid-input-animation {
|
|
1640
|
-
animation:
|
|
1641
|
-
border-width: 1px;
|
|
1642
|
-
border-style: solid;
|
|
1085
|
+
animation: subtleGlow 0.4s ease-in-out;
|
|
1643
1086
|
}
|
|
1644
1087
|
` }),
|
|
1645
|
-
/* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ _("div", { className: "flex items-center gap-2", children: [
|
|
1089
|
+
/* @__PURE__ */ m("div", { className: "text-gray-400 font-mono", children: ">" }),
|
|
1090
|
+
/* @__PURE__ */ _("div", { className: "flex-1 font-mono flex items-center", children: [
|
|
1091
|
+
h,
|
|
1092
|
+
/* @__PURE__ */ _("div", { className: "relative flex-1", children: [
|
|
1093
|
+
/* @__PURE__ */ m(
|
|
1651
1094
|
"input",
|
|
1652
1095
|
{
|
|
1653
|
-
ref:
|
|
1096
|
+
ref: n,
|
|
1654
1097
|
type: "text",
|
|
1655
1098
|
role: "textbox",
|
|
1656
|
-
value:
|
|
1657
|
-
onChange:
|
|
1658
|
-
onKeyDown:
|
|
1659
|
-
onPaste:
|
|
1099
|
+
value: r.currentInput,
|
|
1100
|
+
onChange: N,
|
|
1101
|
+
onKeyDown: E,
|
|
1102
|
+
onPaste: i,
|
|
1660
1103
|
"data-testid": "citadel-command-input",
|
|
1661
|
-
className: `w-full bg-transparent outline-none text-gray-200 caret-transparent ${
|
|
1104
|
+
className: `w-full bg-transparent outline-none text-gray-200 caret-transparent ${u ? "invalid-input-animation" : ""}`,
|
|
1662
1105
|
spellCheck: !1,
|
|
1663
1106
|
autoComplete: "off",
|
|
1664
|
-
placeholder:
|
|
1107
|
+
placeholder: S
|
|
1665
1108
|
}
|
|
1666
1109
|
),
|
|
1667
|
-
/* @__PURE__ */
|
|
1110
|
+
/* @__PURE__ */ m(
|
|
1668
1111
|
"div",
|
|
1669
1112
|
{
|
|
1670
1113
|
className: "absolute top-0 pointer-events-none",
|
|
1671
1114
|
style: {
|
|
1672
|
-
left: `${
|
|
1115
|
+
left: `${r.currentInput.length}ch`,
|
|
1673
1116
|
transition: "left 0.05s ease-out"
|
|
1674
1117
|
},
|
|
1675
|
-
children: /* @__PURE__ */
|
|
1676
|
-
|
|
1118
|
+
children: /* @__PURE__ */ m(
|
|
1119
|
+
qe,
|
|
1677
1120
|
{
|
|
1678
1121
|
style: {
|
|
1679
|
-
type:
|
|
1680
|
-
color:
|
|
1681
|
-
speed:
|
|
1122
|
+
type: k.cursorType ?? z.cursorType,
|
|
1123
|
+
color: k.cursorColor || z.cursorColor,
|
|
1124
|
+
speed: k.cursorSpeed || z.cursorSpeed
|
|
1682
1125
|
}
|
|
1683
1126
|
}
|
|
1684
1127
|
)
|
|
@@ -1688,121 +1131,123 @@ const jt = () => {
|
|
|
1688
1131
|
] })
|
|
1689
1132
|
] })
|
|
1690
1133
|
] });
|
|
1691
|
-
},
|
|
1692
|
-
"
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
command: o,
|
|
1699
|
-
timestamp: n,
|
|
1700
|
-
status: t
|
|
1701
|
-
}) => /* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-2 font-mono text-sm", children: [
|
|
1702
|
-
/* @__PURE__ */ p.jsxs("span", { className: "text-gray-200", children: [
|
|
1703
|
-
"> ",
|
|
1704
|
-
o.split(" ").map((r, a) => {
|
|
1705
|
-
const i = r.startsWith("<") && r.endsWith(">");
|
|
1706
|
-
return /* @__PURE__ */ p.jsxs(
|
|
1707
|
-
"span",
|
|
1708
|
-
{
|
|
1709
|
-
className: i ? "text-green-400" : "text-gray-200",
|
|
1710
|
-
children: [
|
|
1711
|
-
a > 0 ? " " : "",
|
|
1712
|
-
r
|
|
1713
|
-
]
|
|
1714
|
-
},
|
|
1715
|
-
a
|
|
1716
|
-
);
|
|
1717
|
-
})
|
|
1718
|
-
] }),
|
|
1719
|
-
/* @__PURE__ */ p.jsx("span", { className: "text-gray-400", children: "·" }),
|
|
1720
|
-
/* @__PURE__ */ p.jsx("span", { className: "text-gray-500", children: n }),
|
|
1721
|
-
t === ie.Pending && /* @__PURE__ */ p.jsx(Pt, {}),
|
|
1722
|
-
t === ie.Success && /* @__PURE__ */ p.jsx(
|
|
1723
|
-
"div",
|
|
1724
|
-
{
|
|
1725
|
-
"data-testid": "success-indicator",
|
|
1726
|
-
className: "w-4 h-4 rounded-full bg-green-500"
|
|
1727
|
-
}
|
|
1728
|
-
),
|
|
1729
|
-
(t === ie.Timeout || t === ie.Failure) && /* @__PURE__ */ p.jsx(
|
|
1730
|
-
"div",
|
|
1731
|
-
{
|
|
1732
|
-
"data-testid": "success-indicator",
|
|
1733
|
-
className: "w-4 h-4 rounded-full bg-red-500"
|
|
1734
|
-
}
|
|
1735
|
-
)
|
|
1736
|
-
] }), Ot = ({ output: o, outputRef: n }) => {
|
|
1737
|
-
const t = ce(), r = R(() => {
|
|
1738
|
-
if (n.current) {
|
|
1739
|
-
const a = n.current;
|
|
1740
|
-
requestAnimationFrame(() => {
|
|
1741
|
-
a.scrollTop = a.scrollHeight;
|
|
1742
|
-
});
|
|
1743
|
-
}
|
|
1744
|
-
}, [n]);
|
|
1745
|
-
return z(() => {
|
|
1746
|
-
if (r(), n.current) {
|
|
1747
|
-
const a = n.current.getElementsByTagName("img"), i = a[a.length - 1];
|
|
1748
|
-
if (i && !i.complete)
|
|
1749
|
-
return i.addEventListener("load", r), () => i.removeEventListener("load", r);
|
|
1750
|
-
}
|
|
1751
|
-
}, [o, r, n]), /* @__PURE__ */ p.jsx(
|
|
1752
|
-
"div",
|
|
1753
|
-
{
|
|
1754
|
-
ref: n,
|
|
1755
|
-
className: "h-full overflow-y-auto border border-gray-700 rounded-lg p-3 text-left",
|
|
1756
|
-
children: o.map((a, i) => /* @__PURE__ */ p.jsxs("div", { className: "mb-4 last:mb-0", children: [
|
|
1757
|
-
/* @__PURE__ */ p.jsx(
|
|
1758
|
-
Tt,
|
|
1759
|
-
{
|
|
1760
|
-
command: a.command.join(" "),
|
|
1761
|
-
timestamp: new Date(a.timestamp).toLocaleTimeString(),
|
|
1762
|
-
status: a.result.status
|
|
1763
|
-
}
|
|
1764
|
-
),
|
|
1765
|
-
/* @__PURE__ */ p.jsx("pre", { className: `text-gray-200 whitespace-pre font-mono ${t.outputFontSize}`, children: a.result.render() })
|
|
1766
|
-
] }, i))
|
|
1767
|
-
}
|
|
1768
|
-
);
|
|
1769
|
-
}, Nt = () => {
|
|
1770
|
-
const o = xe(), n = ce(), t = ue(), r = "h-12 mt-2 border-t border-gray-700 px-4", a = "text-gray-300 pt-2", i = o.getCompletions(t.path());
|
|
1771
|
-
D.debug("[AvailableCommands] nextCommandSegments: ", i);
|
|
1772
|
-
const u = Q.useMemo(() => {
|
|
1773
|
-
if (n.includeHelpCommand) {
|
|
1774
|
-
const m = i.filter((b) => b.name !== "help"), h = i.find((b) => b.name === "help");
|
|
1775
|
-
return [...m, ...h ? [h] : []];
|
|
1134
|
+
}, Qe = () => {
|
|
1135
|
+
const r = B(), e = F(), n = O(), t = "h-12 mt-2 border-t border-gray-700 px-4", o = "text-gray-300 pt-2", s = r.getCompletions(n.path());
|
|
1136
|
+
C.debug("[AvailableCommands] nextCommandSegments: ", s);
|
|
1137
|
+
const a = L.useMemo(() => {
|
|
1138
|
+
if (e.includeHelpCommand) {
|
|
1139
|
+
const c = s.filter((p) => p.name !== "help"), u = s.find((p) => p.name === "help");
|
|
1140
|
+
return [...c, ...u ? [u] : []];
|
|
1776
1141
|
}
|
|
1777
|
-
return
|
|
1778
|
-
}, [
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
|
|
1142
|
+
return s;
|
|
1143
|
+
}, [s, e.includeHelpCommand]), l = s.some((c) => c.type === "argument"), d = s[0];
|
|
1144
|
+
return /* @__PURE__ */ m("div", { className: t, "data-testid": "available-commands", children: /* @__PURE__ */ m("div", { className: o, children: l ? s.length > 0 ? /* @__PURE__ */ _(we, { children: [
|
|
1145
|
+
/* @__PURE__ */ m("span", { className: "text-blue-400", children: d.name }),
|
|
1146
|
+
d.description && /* @__PURE__ */ _("span", { className: "text-gray-400 ml-2", children: [
|
|
1782
1147
|
"- ",
|
|
1783
|
-
|
|
1148
|
+
d.description
|
|
1784
1149
|
] })
|
|
1785
|
-
] }) : null : /* @__PURE__ */
|
|
1786
|
-
const
|
|
1787
|
-
if (
|
|
1788
|
-
let
|
|
1789
|
-
for (;
|
|
1790
|
-
|
|
1791
|
-
return Math.max(
|
|
1150
|
+
] }) : null : /* @__PURE__ */ m("div", { className: "flex flex-wrap gap-2", children: a == null ? void 0 : a.map((c) => {
|
|
1151
|
+
const u = a == null ? void 0 : a.reduce((p, k) => {
|
|
1152
|
+
if (k === c) return p;
|
|
1153
|
+
let y = 0;
|
|
1154
|
+
for (; y < c.name.length && y < k.name.length && c.name[y].toLowerCase() === k.name[y].toLowerCase(); )
|
|
1155
|
+
y++;
|
|
1156
|
+
return Math.max(p, y + 1);
|
|
1792
1157
|
}, 1);
|
|
1793
|
-
return /* @__PURE__ */
|
|
1158
|
+
return /* @__PURE__ */ m(
|
|
1794
1159
|
"div",
|
|
1795
1160
|
{
|
|
1796
1161
|
className: "px-2 py-1 rounded bg-gray-800 mr-2 last:mr-0",
|
|
1797
|
-
children: /* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
|
|
1162
|
+
children: /* @__PURE__ */ _("span", { className: "font-mono text-white", children: [
|
|
1163
|
+
/* @__PURE__ */ m("strong", { className: "underline", children: c.name.slice(0, u) }),
|
|
1164
|
+
c.name.slice(u)
|
|
1800
1165
|
] })
|
|
1801
1166
|
},
|
|
1802
|
-
|
|
1167
|
+
c.name
|
|
1803
1168
|
);
|
|
1804
1169
|
}) }) }) });
|
|
1805
|
-
},
|
|
1170
|
+
}, pe = ({
|
|
1171
|
+
state: r,
|
|
1172
|
+
actions: e,
|
|
1173
|
+
outputRef: n
|
|
1174
|
+
}) => /* @__PURE__ */ _("div", { className: "innerContainer", children: [
|
|
1175
|
+
/* @__PURE__ */ m("div", { className: "flex-1 min-h-0 pt-3 px-4", children: /* @__PURE__ */ m(Ve, { output: r.output, outputRef: n }) }),
|
|
1176
|
+
/* @__PURE__ */ _("div", { children: [
|
|
1177
|
+
/* @__PURE__ */ m(Je, { state: r, actions: e }),
|
|
1178
|
+
/* @__PURE__ */ m(Qe, {})
|
|
1179
|
+
] })
|
|
1180
|
+
] }), Xe = () => {
|
|
1181
|
+
const [r, e] = R(!1), [n, t] = R(!1), o = F(), [s, a] = R(() => o.initialHeight || null), l = H(null), d = H(null), c = H(!1), u = H(0), p = H(0), { state: k, actions: y } = X();
|
|
1182
|
+
He({
|
|
1183
|
+
onOpen: () => e(!0),
|
|
1184
|
+
onClose: () => t(!0),
|
|
1185
|
+
isVisible: r,
|
|
1186
|
+
showCitadelKey: o.showCitadelKey || "."
|
|
1187
|
+
});
|
|
1188
|
+
const E = w((g) => {
|
|
1189
|
+
var v;
|
|
1190
|
+
if (!c.current) return;
|
|
1191
|
+
const S = g.clientY - u.current, f = (v = o.maxHeight) != null && v.endsWith("vh") ? window.innerHeight * parseInt(o.maxHeight, 10) / 100 : parseInt(o.maxHeight || "80vh", 10), x = Math.min(
|
|
1192
|
+
Math.max(p.current - S, parseInt(o.minHeight || "200", 10)),
|
|
1193
|
+
f
|
|
1194
|
+
);
|
|
1195
|
+
d.current && (d.current.style.height = `${x}px`, d.current.style.bottom = "0", a(`${x}px`));
|
|
1196
|
+
}, [o.maxHeight, o.minHeight]), N = w(() => {
|
|
1197
|
+
c.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", N);
|
|
1198
|
+
}, [E]), i = w((g) => {
|
|
1199
|
+
d.current && (c.current = !0, u.current = g.clientY, p.current = d.current.offsetHeight, document.documentElement.style.userSelect = "none", document.documentElement.style.webkitUserSelect = "none", document.documentElement.style.mozUserSelect = "none", document.documentElement.style.msUserSelect = "none", document.addEventListener("mousemove", E), document.addEventListener("mouseup", N));
|
|
1200
|
+
}, [E, N]);
|
|
1201
|
+
A(() => () => {
|
|
1202
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", N);
|
|
1203
|
+
}, [E, N]);
|
|
1204
|
+
const h = w(() => {
|
|
1205
|
+
n && (e(!1), t(!1));
|
|
1206
|
+
}, [n]);
|
|
1207
|
+
return $e({
|
|
1208
|
+
isVisible: r,
|
|
1209
|
+
isClosing: n,
|
|
1210
|
+
onAnimationComplete: h
|
|
1211
|
+
}), r ? /* @__PURE__ */ _(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
ref: d,
|
|
1215
|
+
className: `panelContainer ${r ? "citadel_slideUp" : ""} ${n ? "citadel_slideDown" : ""}`,
|
|
1216
|
+
style: {
|
|
1217
|
+
...s ? { height: s } : void 0,
|
|
1218
|
+
maxHeight: o.maxHeight
|
|
1219
|
+
},
|
|
1220
|
+
children: [
|
|
1221
|
+
/* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: i }),
|
|
1222
|
+
/* @__PURE__ */ m(
|
|
1223
|
+
pe,
|
|
1224
|
+
{
|
|
1225
|
+
state: k,
|
|
1226
|
+
actions: y,
|
|
1227
|
+
outputRef: l
|
|
1228
|
+
}
|
|
1229
|
+
)
|
|
1230
|
+
]
|
|
1231
|
+
}
|
|
1232
|
+
) : null;
|
|
1233
|
+
}, Ze = () => {
|
|
1234
|
+
const { state: r, actions: e } = X(), n = H(null);
|
|
1235
|
+
return /* @__PURE__ */ m(
|
|
1236
|
+
"div",
|
|
1237
|
+
{
|
|
1238
|
+
className: "inlineContainer",
|
|
1239
|
+
"data-testid": "citadel-inline-container",
|
|
1240
|
+
children: /* @__PURE__ */ m(
|
|
1241
|
+
pe,
|
|
1242
|
+
{
|
|
1243
|
+
state: r,
|
|
1244
|
+
actions: e,
|
|
1245
|
+
outputRef: n
|
|
1246
|
+
}
|
|
1247
|
+
)
|
|
1248
|
+
}
|
|
1249
|
+
);
|
|
1250
|
+
}, re = `:host {
|
|
1806
1251
|
--citadel-bg: rgb(17, 24, 39);
|
|
1807
1252
|
--citadel-text: rgba(255, 255, 255, 0.87);
|
|
1808
1253
|
--citadel-border: rgb(55, 65, 81);
|
|
@@ -1813,22 +1258,38 @@ const jt = () => {
|
|
|
1813
1258
|
--citadel-default-height: 35vh;
|
|
1814
1259
|
--citadel-error: rgb(239, 68, 68);
|
|
1815
1260
|
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1261
|
+
display: block;
|
|
1262
|
+
pointer-events: auto;
|
|
1263
|
+
font-synthesis: none;
|
|
1264
|
+
text-rendering: optimizeLegibility;
|
|
1265
|
+
-webkit-font-smoothing: antialiased;
|
|
1266
|
+
-moz-osx-font-smoothing: grayscale;
|
|
1267
|
+
}
|
|
1820
1268
|
|
|
1269
|
+
:host([data-display-mode="panel"]) {
|
|
1821
1270
|
position: fixed;
|
|
1822
1271
|
bottom: 0;
|
|
1823
1272
|
left: 0;
|
|
1824
1273
|
right: 0;
|
|
1274
|
+
width: 100%;
|
|
1275
|
+
height: var(--citadel-default-height);
|
|
1276
|
+
max-height: var(--citadel-max-height);
|
|
1277
|
+
min-height: var(--citadel-min-height);
|
|
1278
|
+
z-index: 2147483647; /* Maximum z-index value */
|
|
1825
1279
|
overflow: hidden;
|
|
1280
|
+
}
|
|
1826
1281
|
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1282
|
+
:host([data-display-mode="inline"]) {
|
|
1283
|
+
position: relative;
|
|
1284
|
+
bottom: auto;
|
|
1285
|
+
left: auto;
|
|
1286
|
+
right: auto;
|
|
1287
|
+
z-index: auto;
|
|
1288
|
+
width: 100%;
|
|
1289
|
+
height: 100%;
|
|
1290
|
+
max-height: none;
|
|
1291
|
+
min-height: 0;
|
|
1292
|
+
overflow: hidden;
|
|
1832
1293
|
}
|
|
1833
1294
|
|
|
1834
1295
|
button {
|
|
@@ -1890,10 +1351,9 @@ a:hover {
|
|
|
1890
1351
|
.text-left {
|
|
1891
1352
|
text-align: left;
|
|
1892
1353
|
}
|
|
1354
|
+
`, oe = `/* Keep only component-specific styles here */
|
|
1893
1355
|
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
.container {
|
|
1356
|
+
.panelContainer {
|
|
1897
1357
|
position: fixed;
|
|
1898
1358
|
height: var(--citadel-default-height);
|
|
1899
1359
|
min-height: var(--citadel-min-height);
|
|
@@ -1911,6 +1371,7 @@ a:hover {
|
|
|
1911
1371
|
|
|
1912
1372
|
.innerContainer {
|
|
1913
1373
|
height: 100%;
|
|
1374
|
+
flex: 1;
|
|
1914
1375
|
width: 100%;
|
|
1915
1376
|
display: flex;
|
|
1916
1377
|
flex-direction: column;
|
|
@@ -1961,10 +1422,21 @@ a:hover {
|
|
|
1961
1422
|
.citadel_slideDown {
|
|
1962
1423
|
animation: citadel_slideDown 0.2s ease-out forwards;
|
|
1963
1424
|
}
|
|
1964
|
-
|
|
1425
|
+
|
|
1426
|
+
.inlineContainer {
|
|
1427
|
+
position: relative;
|
|
1428
|
+
width: 100%;
|
|
1429
|
+
height: 100%;
|
|
1430
|
+
display: flex;
|
|
1431
|
+
flex-direction: column;
|
|
1432
|
+
background-color: var(--citadel-bg);
|
|
1433
|
+
overflow: hidden;
|
|
1434
|
+
box-sizing: border-box;
|
|
1435
|
+
}
|
|
1436
|
+
`, se = `@tailwind base;
|
|
1965
1437
|
@tailwind components;
|
|
1966
1438
|
@tailwind utilities;
|
|
1967
|
-
`,
|
|
1439
|
+
`, en = `*, ::before, ::after {
|
|
1968
1440
|
--tw-border-spacing-x: 0;
|
|
1969
1441
|
--tw-border-spacing-y: 0;
|
|
1970
1442
|
--tw-translate-x: 0;
|
|
@@ -2781,112 +2253,75 @@ video {
|
|
|
2781
2253
|
.last\\:mr-0:last-child {
|
|
2782
2254
|
margin-right: 0px;
|
|
2783
2255
|
}
|
|
2784
|
-
`,
|
|
2785
|
-
config:
|
|
2786
|
-
commandRegistry:
|
|
2787
|
-
containerId:
|
|
2788
|
-
}) =>
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2256
|
+
`, cn = ({
|
|
2257
|
+
config: r = z,
|
|
2258
|
+
commandRegistry: e = new Q(),
|
|
2259
|
+
containerId: n = null
|
|
2260
|
+
}) => {
|
|
2261
|
+
const t = H(null), o = r.displayMode ?? z.displayMode ?? "panel";
|
|
2262
|
+
return A(() => {
|
|
2263
|
+
C.configure({
|
|
2264
|
+
level: r.logLevel || z.logLevel || W.ERROR,
|
|
2265
|
+
prefix: "[Citadel]"
|
|
2266
|
+
});
|
|
2267
|
+
const s = new he(e, r), a = o === "inline" && !n, l = a ? t.current : n ? document.getElementById(n) : document.body;
|
|
2268
|
+
if (l)
|
|
2269
|
+
l.appendChild(s);
|
|
2270
|
+
else {
|
|
2271
|
+
if (a) {
|
|
2272
|
+
console.warn("[Citadel] No host available for inline mode; skipping mount.");
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
console.warn(`Container with id "${n}" not found, falling back to body`), document.body.appendChild(s);
|
|
2276
|
+
}
|
|
2277
|
+
return () => {
|
|
2278
|
+
var d;
|
|
2279
|
+
(d = s.parentElement) == null || d.removeChild(s);
|
|
2280
|
+
};
|
|
2281
|
+
}, [e, n, r, o]), o === "inline" && !n ? /* @__PURE__ */ m("div", { ref: t, style: { width: "100%", height: "100%" } }) : null;
|
|
2282
|
+
};
|
|
2283
|
+
class he extends HTMLElement {
|
|
2284
|
+
constructor(n, t) {
|
|
2285
|
+
var s;
|
|
2801
2286
|
super();
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry =
|
|
2287
|
+
b(this, "shadow");
|
|
2288
|
+
b(this, "root", null);
|
|
2289
|
+
b(this, "commandRegistry");
|
|
2290
|
+
b(this, "config");
|
|
2291
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry = n, this.config = t;
|
|
2292
|
+
const o = ((s = this.config) == null ? void 0 : s.displayMode) ?? "panel";
|
|
2293
|
+
this.setAttribute("data-display-mode", o);
|
|
2807
2294
|
}
|
|
2808
2295
|
connectedCallback() {
|
|
2809
2296
|
try {
|
|
2810
|
-
const
|
|
2811
|
-
const
|
|
2812
|
-
return
|
|
2297
|
+
const t = [re, oe, se, en].map((o) => {
|
|
2298
|
+
const s = new CSSStyleSheet();
|
|
2299
|
+
return s.replaceSync(o), s;
|
|
2813
2300
|
});
|
|
2814
|
-
this.shadow.adoptedStyleSheets = [...
|
|
2301
|
+
this.shadow.adoptedStyleSheets = [...t];
|
|
2815
2302
|
} catch {
|
|
2816
|
-
const
|
|
2817
|
-
`),
|
|
2818
|
-
|
|
2303
|
+
const t = [re, oe, se].join(`
|
|
2304
|
+
`), o = document.createElement("style");
|
|
2305
|
+
o.textContent = t, this.shadow.appendChild(o);
|
|
2819
2306
|
}
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2822
|
-
/* @__PURE__ */
|
|
2307
|
+
const n = document.createElement("div");
|
|
2308
|
+
n.id = "citadel-root", n.style.width = "100%", n.style.height = "100%", this.shadow.appendChild(n), this.root = xe(n), this.root.render(
|
|
2309
|
+
/* @__PURE__ */ m(Ie, { config: this.config || z, commandRegistry: this.commandRegistry, children: /* @__PURE__ */ m(nn, {}) })
|
|
2823
2310
|
);
|
|
2824
2311
|
}
|
|
2825
2312
|
}
|
|
2826
|
-
customElements.define("citadel-element",
|
|
2827
|
-
const
|
|
2828
|
-
const [o, n] = Y(!1), [t, r] = Y(!1), a = ce(), [i, u] = Y(() => a.initialHeight || null), f = X(null), c = X(null), m = X(!1), h = X(0), b = X(0), { state: _, actions: S } = Cn();
|
|
2829
|
-
ot({
|
|
2830
|
-
onOpen: () => n(!0),
|
|
2831
|
-
onClose: () => r(!0),
|
|
2832
|
-
isVisible: o,
|
|
2833
|
-
showCitadelKey: a.showCitadelKey || "."
|
|
2834
|
-
});
|
|
2835
|
-
const U = R((w) => {
|
|
2836
|
-
c.current && (m.current = !0, h.current = w.clientY, b.current = c.current.offsetHeight, document.documentElement.style.userSelect = "none", document.documentElement.style.webkitUserSelect = "none", document.documentElement.style.mozUserSelect = "none", document.documentElement.style.msUserSelect = "none", document.addEventListener("mousemove", I), document.addEventListener("mouseup", d));
|
|
2837
|
-
}, []), I = R((w) => {
|
|
2838
|
-
var P;
|
|
2839
|
-
if (!m.current) return;
|
|
2840
|
-
const N = w.clientY - h.current, k = (P = a.maxHeight) != null && P.endsWith("vh") ? window.innerHeight * parseInt(a.maxHeight, 10) / 100 : parseInt(a.maxHeight || "80vh", 10), j = Math.min(
|
|
2841
|
-
Math.max(b.current - N, parseInt(a.minHeight || "200", 10)),
|
|
2842
|
-
k
|
|
2843
|
-
);
|
|
2844
|
-
c.current && (c.current.style.height = `${j}px`, c.current.style.bottom = "0", u(`${j}px`));
|
|
2845
|
-
}, [a.maxHeight, a.minHeight]), d = R(() => {
|
|
2846
|
-
m.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", d);
|
|
2847
|
-
}, [I]);
|
|
2848
|
-
z(() => () => {
|
|
2849
|
-
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", d);
|
|
2850
|
-
}, [I, d]);
|
|
2851
|
-
const y = R(() => {
|
|
2852
|
-
t && (n(!1), r(!1));
|
|
2853
|
-
}, [t]);
|
|
2854
|
-
return dt({
|
|
2855
|
-
isVisible: o,
|
|
2856
|
-
isClosing: t,
|
|
2857
|
-
onAnimationComplete: y
|
|
2858
|
-
}), o ? /* @__PURE__ */ p.jsxs(
|
|
2859
|
-
"div",
|
|
2860
|
-
{
|
|
2861
|
-
ref: c,
|
|
2862
|
-
className: `container ${o ? "citadel_slideUp" : ""} ${t ? "citadel_slideDown" : ""}`,
|
|
2863
|
-
style: {
|
|
2864
|
-
...i ? { height: i } : void 0,
|
|
2865
|
-
maxHeight: a.maxHeight
|
|
2866
|
-
},
|
|
2867
|
-
children: [
|
|
2868
|
-
/* @__PURE__ */ p.jsx("div", { className: "resizeHandle", onMouseDown: U }),
|
|
2869
|
-
/* @__PURE__ */ p.jsxs("div", { className: "innerContainer", children: [
|
|
2870
|
-
/* @__PURE__ */ p.jsx("div", { className: "flex-1 min-h-0 pt-3 px-4", children: /* @__PURE__ */ p.jsx(Ot, { output: _.output, outputRef: f }) }),
|
|
2871
|
-
/* @__PURE__ */ p.jsxs("div", { children: [
|
|
2872
|
-
/* @__PURE__ */ p.jsx(At, { state: _, actions: S }),
|
|
2873
|
-
/* @__PURE__ */ p.jsx(Nt, {})
|
|
2874
|
-
] })
|
|
2875
|
-
] })
|
|
2876
|
-
]
|
|
2877
|
-
}
|
|
2878
|
-
) : null;
|
|
2879
|
-
};
|
|
2313
|
+
customElements.define("citadel-element", he);
|
|
2314
|
+
const nn = () => (F().displayMode ?? "panel") === "inline" ? /* @__PURE__ */ m(Ze, {}) : /* @__PURE__ */ m(Xe, {});
|
|
2880
2315
|
export {
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2316
|
+
cn as Citadel,
|
|
2317
|
+
Q as CommandRegistry,
|
|
2318
|
+
U as CommandResult,
|
|
2319
|
+
T as CommandStatus,
|
|
2320
|
+
We as DEFAULT_CURSOR_CONFIGS,
|
|
2321
|
+
ve as ErrorCommandResult,
|
|
2322
|
+
ln as ImageCommandResult,
|
|
2323
|
+
an as JsonCommandResult,
|
|
2324
|
+
Re as OutputItem,
|
|
2325
|
+
Ce as PendingCommandResult,
|
|
2326
|
+
ae as TextCommandResult
|
|
2892
2327
|
};
|