citadel_cli 1.4.0 → 1.4.1

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.
@@ -1,13 +1,13 @@
1
- var Ae = Object.defineProperty;
2
- var Pe = (n, e, t) => e in n ? Ae(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var f = (n, e, t) => Pe(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { jsx as m, jsxs as I, Fragment as He } from "react/jsx-runtime";
5
- import U, { createContext as Re, useState as _, useMemo as A, useEffect as P, useContext as Q, useCallback as w, useReducer as _e, useRef as z, useLayoutEffect as Me } from "react";
1
+ var Ie = Object.defineProperty;
2
+ var Pe = (t, e, n) => e in t ? Ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var y = (t, e, n) => Pe(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { jsx as m, jsxs as A, Fragment as He } from "react/jsx-runtime";
5
+ import $, { createContext as Re, useState as _, useMemo as P, useEffect as I, useContext as Z, useCallback as f, useReducer as _e, useRef as T, useLayoutEffect as Me } from "react";
6
6
  import { createRoot as Te } from "react-dom/client";
7
- var q = /* @__PURE__ */ ((n) => (n.Pending = "pending", n.Success = "success", n.Failure = "failure", n.Timeout = "timeout", n))(q || {});
8
- class W {
7
+ var V = /* @__PURE__ */ ((t) => (t.Pending = "pending", t.Success = "success", t.Failure = "failure", t.Timeout = "timeout", t))(V || {});
8
+ class K {
9
9
  constructor(e = Date.now()) {
10
- f(this, "_status", "pending");
10
+ y(this, "_status", "pending");
11
11
  this.timestamp = e;
12
12
  }
13
13
  get status() {
@@ -23,38 +23,46 @@ class W {
23
23
  this._status = "timeout";
24
24
  }
25
25
  }
26
- class ze extends W {
27
- constructor(e, t) {
28
- super(t), this.data = e;
26
+ class ze extends K {
27
+ constructor(e, n) {
28
+ super(n), this.data = e;
29
29
  }
30
30
  render() {
31
31
  return /* @__PURE__ */ m("pre", { className: "citadel-result-json", children: JSON.stringify(this.data, null, 2) });
32
32
  }
33
33
  }
34
- class Y extends W {
35
- constructor(e, t) {
36
- super(t), this.text = e;
34
+ class G extends K {
35
+ constructor(e, n) {
36
+ super(n), this.text = e;
37
37
  }
38
38
  render() {
39
39
  return /* @__PURE__ */ m("div", { className: "citadel-result-text", children: this.text });
40
40
  }
41
41
  }
42
- class we extends W {
43
- constructor(e, t) {
44
- super(t), this.error = e, this.markFailure();
42
+ class De extends K {
43
+ constructor(e, n = "true", s = "false", r) {
44
+ super(r), this.value = e, this.trueText = n, this.falseText = s;
45
+ }
46
+ render() {
47
+ return /* @__PURE__ */ m("div", { className: "citadel-result-text citadel-result-boolean", children: this.value ? this.trueText : this.falseText });
48
+ }
49
+ }
50
+ class we extends K {
51
+ constructor(e, n) {
52
+ super(n), this.error = e, this.markFailure();
45
53
  }
46
54
  render() {
47
55
  return /* @__PURE__ */ m("div", { className: "citadel-result-error", children: this.error });
48
56
  }
49
57
  }
50
- class De extends W {
58
+ class Oe extends K {
51
59
  render() {
52
60
  return /* @__PURE__ */ m("div", { className: "citadel-result-pending", children: "..." });
53
61
  }
54
62
  }
55
- class Fe extends W {
56
- constructor(e, t = "", s) {
57
- super(s), this.imageUrl = e, this.altText = t;
63
+ class Fe extends K {
64
+ constructor(e, n = "", s) {
65
+ super(s), this.imageUrl = e, this.altText = n;
58
66
  }
59
67
  render() {
60
68
  return /* @__PURE__ */ m("div", { className: "citadel-result-image-wrap", children: /* @__PURE__ */ m(
@@ -67,28 +75,28 @@ class Fe extends W {
67
75
  ) });
68
76
  }
69
77
  }
70
- const Le = (n) => async function() {
71
- const t = n.commands.filter((s) => s.fullPath[0] !== "help").map((s) => {
72
- const a = `${s.segments.map((c) => c.type === "argument" ? `<${c.name}>` : c.name).join(" ")} - ${s.description}`, o = s.segments.filter((c) => c.type === "argument" && c.description).map((c) => ` <${c.name}>: ${c.description}`);
78
+ const Le = (t) => async function() {
79
+ const n = t.commands.filter((s) => s.fullPath[0] !== "help").map((s) => {
80
+ const o = `${s.segments.map((c) => c.type === "argument" ? `<${c.name}>` : c.name).join(" ")} - ${s.description}`, a = s.segments.filter((c) => c.type === "argument" && c.description).map((c) => ` <${c.name}>: ${c.description}`);
73
81
  return {
74
- commandLine: a,
75
- argumentLines: o
82
+ commandLine: o,
83
+ argumentLines: a
76
84
  };
77
85
  }).sort((s, r) => s.commandLine.localeCompare(r.commandLine)).flatMap((s) => [
78
86
  s.commandLine,
79
87
  ...s.argumentLines
80
88
  ]);
81
- return t.length === 0 ? new Y(
89
+ return n.length === 0 ? new G(
82
90
  "No commands available yet. Add some commands to get started!"
83
- ) : (t.push("help - Show available commands"), new Y(
91
+ ) : (n.push("help - Show available commands"), new G(
84
92
  `Available Commands:
85
- ` + t.join(`
93
+ ` + n.join(`
86
94
  `)
87
95
  ));
88
96
  };
89
- var ie = /* @__PURE__ */ ((n) => (n[n.NONE = 0] = "NONE", n[n.ERROR = 1] = "ERROR", n[n.WARN = 2] = "WARN", n[n.INFO = 3] = "INFO", n[n.DEBUG = 4] = "DEBUG", n[n.TRACE = 5] = "TRACE", n))(ie || {});
97
+ var ie = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.ERROR = 1] = "ERROR", t[t.WARN = 2] = "WARN", t[t.INFO = 3] = "INFO", t[t.DEBUG = 4] = "DEBUG", t[t.TRACE = 5] = "TRACE", t))(ie || {});
90
98
  const ue = !0;
91
- class k {
99
+ class b {
92
100
  static configure(e) {
93
101
  this.level = e.level, this.prefix = e.prefix || "[Citadel]";
94
102
  }
@@ -108,8 +116,8 @@ class k {
108
116
  this.level >= 1 && console.error(this.prefix, ...e);
109
117
  }
110
118
  }
111
- f(k, "level", 0), f(k, "prefix", "");
112
- const N = {
119
+ y(b, "level", 0), y(b, "prefix", "");
120
+ const x = {
113
121
  commandTimeoutMs: 1e4,
114
122
  cursorColor: "var(--cursor-color, #fff)",
115
123
  cursorSpeed: 530,
@@ -123,16 +131,18 @@ const N = {
123
131
  minHeight: "200",
124
132
  outputFontSize: "0.875rem",
125
133
  resetStateOnHide: !1,
134
+ closeOnEscape: !0,
126
135
  showCitadelKey: ".",
136
+ showOnLoad: !1,
127
137
  displayMode: "panel",
128
138
  storage: {
129
139
  type: "localStorage",
130
140
  maxCommands: 100
131
141
  }
132
- }, Ce = async () => new Y("");
142
+ }, Ce = async () => new G("");
133
143
  class ce {
134
- constructor(e, t, s) {
135
- this.type = e, this.name = t, this.description = s;
144
+ constructor(e, n, s) {
145
+ this.type = e, this.name = n, this.description = s;
136
146
  }
137
147
  toString() {
138
148
  return this.name;
@@ -144,21 +154,21 @@ class le extends ce {
144
154
  }
145
155
  }
146
156
  class ve extends ce {
147
- constructor(e, t) {
148
- super("word", e, t);
157
+ constructor(e, n) {
158
+ super("word", e, n);
149
159
  }
150
160
  }
151
- class O extends ce {
152
- constructor(e, t, s, r) {
153
- super("argument", e, t), this.value = s, this.valid = r;
161
+ class q extends ce {
162
+ constructor(e, n, s, r) {
163
+ super("argument", e, n), this.value = s, this.valid = r;
154
164
  }
155
165
  }
156
- const $e = (n) => {
157
- if (n.type === "word")
158
- return new ve(n.name, n.description);
159
- if (n.type === "argument") {
160
- const e = n;
161
- return new O(
166
+ const je = (t) => {
167
+ if (t.type === "word")
168
+ return new ve(t.name, t.description);
169
+ if (t.type === "argument") {
170
+ const e = t;
171
+ return new q(
162
172
  e.name,
163
173
  e.description,
164
174
  e.value,
@@ -166,14 +176,14 @@ const $e = (n) => {
166
176
  );
167
177
  }
168
178
  return new le();
169
- }, D = (n) => n.map((e) => $e(e));
170
- class je {
171
- constructor(e, t, s = Ce) {
172
- f(this, "_segments");
173
- f(this, "_description");
179
+ }, z = (t) => t.map((e) => je(e));
180
+ class Ue {
181
+ constructor(e, n, s = Ce) {
182
+ y(this, "_segments");
183
+ y(this, "_description");
174
184
  // Used by `Help` command, etc.
175
- f(this, "_handler");
176
- this._segments = e, this._description = t, this._handler = s;
185
+ y(this, "_handler");
186
+ this._segments = e, this._description = n, this._handler = s;
177
187
  }
178
188
  get segments() {
179
189
  return this._segments;
@@ -197,9 +207,9 @@ class je {
197
207
  return this.fullPath.join(" ") === e.fullPath.join(" ");
198
208
  }
199
209
  }
200
- class X {
210
+ class ee {
201
211
  constructor() {
202
- f(this, "_commands", []);
212
+ y(this, "_commands", []);
203
213
  }
204
214
  get commands() {
205
215
  return this._commands;
@@ -215,19 +225,19 @@ class X {
215
225
  * @param handler Async handler executed when the command is submitted; defaults to `NoopHandler`.
216
226
  * @throws {Error} If the segment list is empty or the path collides with an existing command.
217
227
  */
218
- addCommand(e, t, s = Ce) {
228
+ addCommand(e, n, s = Ce) {
219
229
  if (e === void 0 || e.length === 0)
220
230
  throw new Error("Command path cannot be empty");
221
- const r = new je(e, t, s), a = this._commands.find((o) => {
222
- const c = o.segments.map(
231
+ const r = new Ue(e, n, s), o = this._commands.find((a) => {
232
+ const c = a.segments.map(
223
233
  (d) => d.type === "argument" ? "*" : d.name
224
234
  ).join(" "), i = e.map(
225
235
  (d) => d.type === "argument" ? "*" : d.name
226
236
  ).join(" ");
227
237
  return c === i;
228
238
  });
229
- if (a)
230
- throw new Error(`Duplicate commands: '${a.fullPath_s}' and '${r.fullPath_s}'`);
239
+ if (o)
240
+ throw new Error(`Duplicate commands: '${o.fullPath_s}' and '${r.fullPath_s}'`);
231
241
  this._commands.push(r);
232
242
  }
233
243
  /**
@@ -237,7 +247,7 @@ class X {
237
247
  * @returns True if a command was removed; otherwise false.
238
248
  */
239
249
  removeCommand(e) {
240
- const t = e.join(" "), s = this._commands.findIndex((r) => r.fullPath.join(" ") === t);
250
+ const n = e.join(" "), s = this._commands.findIndex((r) => r.fullPath.join(" ") === n);
241
251
  return s === -1 ? !1 : (this._commands.splice(s, 1), !0);
242
252
  }
243
253
  /**
@@ -247,26 +257,26 @@ class X {
247
257
  * @returns The command node or undefined if not found.
248
258
  */
249
259
  getCommand(e) {
250
- return this._commands.find((t) => {
251
- const s = t.fullPath.join(" "), r = e.join(" ");
260
+ return this._commands.find((n) => {
261
+ const s = n.fullPath.join(" "), r = e.join(" ");
252
262
  if (s === r)
253
263
  return !0;
254
- const o = t.segments.filter((c) => c.type === "word").map((c) => c.name);
255
- return o.length === e.length && o.join(" ") === r;
264
+ const a = n.segments.filter((c) => c.type === "word").map((c) => c.name);
265
+ return a.length === e.length && a.join(" ") === r;
256
266
  });
257
267
  }
258
268
  commandExistsForPath(e) {
259
- const t = this._commands.map(
269
+ const n = this._commands.map(
260
270
  (r) => r.segments.map(
261
- (a) => a.type === "argument" ? "*" : a.name
271
+ (o) => o.type === "argument" ? "*" : o.name
262
272
  ).join(" ")
263
- ), s = e.map((r, a) => this._commands.some(
273
+ ), s = e.map((r, o) => this._commands.some(
264
274
  (c) => {
265
275
  var i;
266
- return ((i = c.segments[a]) == null ? void 0 : i.type) === "argument";
276
+ return ((i = c.segments[o]) == null ? void 0 : i.type) === "argument";
267
277
  }
268
278
  ) ? "*" : r).join(" ");
269
- return t.includes(s);
279
+ return n.includes(s);
270
280
  }
271
281
  /**
272
282
  * Gets possible matches for a given path.
@@ -275,24 +285,24 @@ class X {
275
285
  * @returns An array of completion strings.
276
286
  */
277
287
  getCompletionNames(e) {
278
- return this.getCompletions(e).map((t) => t.name);
288
+ return this.getCompletions(e).map((n) => n.name);
279
289
  }
280
290
  /**
281
291
  * Returns completion segments whose names start with the given prefix.
282
292
  * Matching is case-insensitive.
283
293
  */
284
- getMatchingCompletions(e, t) {
285
- const s = t.trim().toLowerCase(), r = this.getCompletions(e);
294
+ getMatchingCompletions(e, n) {
295
+ const s = n.trim().toLowerCase(), r = this.getCompletions(e);
286
296
  return s ? r.filter(
287
- (a) => a.name.toLowerCase().startsWith(s)
297
+ (o) => o.name.toLowerCase().startsWith(s)
288
298
  ) : r;
289
299
  }
290
300
  /**
291
301
  * Returns a single completion when prefix matching is unambiguous.
292
302
  * Returns undefined for ambiguous or no-match prefixes.
293
303
  */
294
- getUniqueCompletion(e, t) {
295
- const s = this.getMatchingCompletions(e, t);
304
+ getUniqueCompletion(e, n) {
305
+ const s = this.getMatchingCompletions(e, n);
296
306
  if (s.length === 1)
297
307
  return s[0];
298
308
  }
@@ -303,29 +313,29 @@ class X {
303
313
  * @returns An array of completion strings.
304
314
  */
305
315
  getCompletions(e) {
306
- if (k.debug("[getCompletions] path: ", e), !e.length) {
307
- const a = this._commands.map((i) => i.segments[0]), o = (i, d) => i.type === d.type && i.name === d.name;
308
- return a.filter(
309
- (i, d, g) => d === g.findIndex((u) => o(u, i))
316
+ if (b.debug("[getCompletions] path: ", e), !e.length) {
317
+ const o = this._commands.map((i) => i.segments[0]), a = (i, d) => i.type === d.type && i.name === d.name;
318
+ return o.filter(
319
+ (i, d, g) => d === g.findIndex((u) => a(u, i))
310
320
  );
311
321
  }
312
- const t = e.length;
313
- return this._commands.filter((a) => {
314
- const o = a.segments;
315
- if (o.length <= t - 1)
322
+ const n = e.length;
323
+ return this._commands.filter((o) => {
324
+ const a = o.segments;
325
+ if (a.length <= n - 1)
316
326
  return !1;
317
- for (let c = 0; c < t; c++) {
318
- const i = e[c], d = o[c];
327
+ for (let c = 0; c < n; c++) {
328
+ const i = e[c], d = a[c];
319
329
  if (!(i === "*" && d.type === "argument") && i !== d.name)
320
330
  return !1;
321
331
  }
322
332
  return !0;
323
- }).filter((a) => a.segments.length > t).map((a) => {
324
- const o = a.segments[t], c = o.type === "argument" ? O : ve;
325
- return new c(o.name, o.description);
333
+ }).filter((o) => o.segments.length > n).map((o) => {
334
+ const a = o.segments[n], c = a.type === "argument" ? q : ve;
335
+ return new c(a.name, a.description);
326
336
  }).filter(
327
- (a, o, c) => o === c.findIndex(
328
- (i) => i.type === a.type && i.name === a.name
337
+ (o, a, c) => a === c.findIndex(
338
+ (i) => i.type === o.type && i.name === o.name
329
339
  )
330
340
  );
331
341
  }
@@ -335,7 +345,7 @@ class X {
335
345
  }
336
346
  class Se {
337
347
  constructor(e) {
338
- f(this, "config");
348
+ y(this, "config");
339
349
  this.config = {
340
350
  type: "localStorage",
341
351
  maxCommands: 100,
@@ -346,43 +356,43 @@ class Se {
346
356
  * Add a command to history, enforcing storage limits
347
357
  */
348
358
  async addStoredCommand(e) {
349
- const t = await this.getStoredCommands();
350
- for (t.push(e); t.length > this.config.maxCommands; )
351
- t.shift();
352
- await this.saveCommands(t);
359
+ const n = await this.getStoredCommands();
360
+ for (n.push(e); n.length > this.config.maxCommands; )
361
+ n.shift();
362
+ await this.saveCommands(n);
353
363
  }
354
364
  }
355
- class Ue extends Se {
356
- constructor(t) {
357
- super(t);
358
- f(this, "storageKey", "citadel_command_history");
365
+ class $e extends Se {
366
+ constructor(n) {
367
+ super(n);
368
+ y(this, "storageKey", "citadel_command_history");
359
369
  }
360
370
  async getStoredCommands() {
361
371
  try {
362
- const t = window.localStorage.getItem(this.storageKey);
363
- return t ? JSON.parse(t).map((r) => ({
364
- commandSegments: Array.isArray(r.commandSegments) ? D(r.commandSegments) : [],
372
+ const n = window.localStorage.getItem(this.storageKey);
373
+ return n ? JSON.parse(n).map((r) => ({
374
+ commandSegments: Array.isArray(r.commandSegments) ? z(r.commandSegments) : [],
365
375
  timestamp: r.timestamp
366
376
  })) : [];
367
- } catch (t) {
368
- return console.warn("Failed to load commands from localStorage:", t), [];
377
+ } catch (n) {
378
+ return console.warn("Failed to load commands from localStorage:", n), [];
369
379
  }
370
380
  }
371
381
  async clear() {
372
382
  try {
373
383
  window.localStorage.removeItem(this.storageKey);
374
- } catch (t) {
375
- console.warn("Failed to clear localStorage:", t);
384
+ } catch (n) {
385
+ console.warn("Failed to clear localStorage:", n);
376
386
  }
377
387
  }
378
- async saveCommands(t) {
388
+ async saveCommands(n) {
379
389
  try {
380
- const s = t.map((r) => ({
381
- commandSegments: Array.isArray(r.commandSegments) ? D(r.commandSegments).map((a) => ({
382
- type: a.type,
383
- name: a.name,
384
- description: a.description,
385
- ...a instanceof O ? { value: a.value } : {}
390
+ const s = n.map((r) => ({
391
+ commandSegments: Array.isArray(r.commandSegments) ? z(r.commandSegments).map((o) => ({
392
+ type: o.type,
393
+ name: o.name,
394
+ description: o.description,
395
+ ...o instanceof q ? { value: o.value } : {}
386
396
  })) : [],
387
397
  timestamp: r.timestamp
388
398
  }));
@@ -393,41 +403,41 @@ class Ue extends Se {
393
403
  }
394
404
  }
395
405
  class pe extends Se {
396
- constructor(t) {
397
- super(t);
398
- f(this, "storedCommands", []);
406
+ constructor(n) {
407
+ super(n);
408
+ y(this, "storedCommands", []);
399
409
  }
400
410
  async getStoredCommands() {
401
- return this.storedCommands.map((t) => ({
402
- commandSegments: Array.isArray(t.commandSegments) ? D(t.commandSegments) : [],
403
- timestamp: t.timestamp
411
+ return this.storedCommands.map((n) => ({
412
+ commandSegments: Array.isArray(n.commandSegments) ? z(n.commandSegments) : [],
413
+ timestamp: n.timestamp
404
414
  }));
405
415
  }
406
416
  async clear() {
407
417
  this.storedCommands = [];
408
418
  }
409
- async saveCommands(t) {
410
- this.storedCommands = t.map((s) => ({
411
- commandSegments: Array.isArray(s.commandSegments) ? D(s.commandSegments) : [],
419
+ async saveCommands(n) {
420
+ this.storedCommands = n.map((s) => ({
421
+ commandSegments: Array.isArray(s.commandSegments) ? z(s.commandSegments) : [],
412
422
  timestamp: s.timestamp
413
423
  }));
414
424
  }
415
425
  }
416
- const $ = class $ {
426
+ const j = class j {
417
427
  constructor() {
418
- f(this, "currentStorage");
428
+ y(this, "currentStorage");
419
429
  }
420
430
  static reset() {
421
- $.instance = void 0;
431
+ j.instance = void 0;
422
432
  }
423
433
  static getInstance() {
424
- return $.instance || ($.instance = new $()), $.instance;
434
+ return j.instance || (j.instance = new j()), j.instance;
425
435
  }
426
436
  initializeStorage(e) {
427
437
  try {
428
- e.type === "memory" ? this.currentStorage = new pe(e) : this.currentStorage = new Ue(e);
429
- } catch (t) {
430
- console.warn("Failed to create storage, falling back to memory storage:", t), this.currentStorage = new pe(e);
438
+ e.type === "memory" ? this.currentStorage = new pe(e) : this.currentStorage = new $e(e);
439
+ } catch (n) {
440
+ console.warn("Failed to create storage, falling back to memory storage:", n), this.currentStorage = new pe(e);
431
441
  }
432
442
  }
433
443
  getStorage() {
@@ -436,19 +446,19 @@ const $ = class $ {
436
446
  return this.currentStorage;
437
447
  }
438
448
  };
439
- f($, "instance");
440
- let J = $;
449
+ y(j, "instance");
450
+ let Q = j;
441
451
  class xe {
442
452
  constructor() {
443
- f(this, "segments", []);
444
- f(this, "nullSegment", new le());
445
- f(this, "observers", []);
453
+ y(this, "segments", []);
454
+ y(this, "nullSegment", new le());
455
+ y(this, "observers", []);
446
456
  }
447
457
  subscribe(e) {
448
458
  this.observers.push(e);
449
459
  }
450
460
  unsubscribe(e) {
451
- this.observers = this.observers.filter((t) => t !== e);
461
+ this.observers = this.observers.filter((n) => n !== e);
452
462
  }
453
463
  notifyObservers() {
454
464
  this.observers.forEach((e) => e.update());
@@ -469,7 +479,7 @@ class xe {
469
479
  * Pushes an array of segments onto the stack
470
480
  */
471
481
  pushAll(e) {
472
- e.forEach((t) => this.push(t));
482
+ e.forEach((n) => this.push(n));
473
483
  }
474
484
  /**
475
485
  * Removes and returns the top segment from the stack
@@ -525,32 +535,34 @@ class xe {
525
535
  return [...this.segments];
526
536
  }
527
537
  }
528
- const Oe = {
529
- config: N,
530
- commands: new X(),
538
+ const Ke = {
539
+ config: x,
540
+ commands: new ee(),
531
541
  segmentStack: new xe()
532
- }, B = Re(Oe), We = ({ config: n = N, commandRegistry: e, children: t }) => {
533
- const [s, r] = U.useState(), [a] = _(() => new xe()), o = A(() => ({
534
- ...N,
535
- ...n,
542
+ }, Y = Re(Ke), We = ({ config: t = x, commandRegistry: e, children: n }) => {
543
+ const [s, r] = $.useState(), [o] = _(() => new xe()), a = P(() => ({
544
+ ...x,
545
+ ...t,
536
546
  // Ensure nested objects are properly merged
537
547
  storage: {
538
- ...N.storage,
539
- ...n.storage
548
+ ...x.storage,
549
+ ...t.storage
540
550
  },
541
551
  // Ensure explicit values from config take precedence
542
- cursorType: n.cursorType ?? N.cursorType,
543
- cursorColor: n.cursorColor ?? N.cursorColor,
544
- cursorSpeed: n.cursorSpeed ?? N.cursorSpeed,
545
- showCitadelKey: n.showCitadelKey || "."
546
- }), [n]);
547
- P(() => {
548
- J.getInstance().initializeStorage(
549
- o.storage ?? N.storage
550
- ), r(J.getInstance().getStorage());
551
- }, [o.storage]), P(() => {
552
+ cursorType: t.cursorType ?? x.cursorType,
553
+ cursorColor: t.cursorColor ?? x.cursorColor,
554
+ cursorSpeed: t.cursorSpeed ?? x.cursorSpeed,
555
+ closeOnEscape: t.closeOnEscape ?? x.closeOnEscape,
556
+ showCitadelKey: t.showCitadelKey ?? x.showCitadelKey,
557
+ showOnLoad: t.showOnLoad ?? x.showOnLoad
558
+ }), [t]);
559
+ I(() => {
560
+ Q.getInstance().initializeStorage(
561
+ a.storage ?? x.storage
562
+ ), r(Q.getInstance().getStorage());
563
+ }, [a.storage]), I(() => {
552
564
  if (e) {
553
- if (o.includeHelpCommand) {
565
+ if (a.includeHelpCommand) {
554
566
  if (!e.commandExistsForPath(["help"])) {
555
567
  const i = Le(e);
556
568
  e.addCommand(
@@ -563,83 +575,83 @@ const Oe = {
563
575
  }
564
576
  e.removeCommand(["help"]);
565
577
  }
566
- }, [e, o.includeHelpCommand]);
567
- const c = A(() => ({
568
- config: o,
569
- commands: e || new X(),
578
+ }, [e, a.includeHelpCommand]);
579
+ const c = P(() => ({
580
+ config: a,
581
+ commands: e || new ee(),
570
582
  storage: s,
571
- segmentStack: a
572
- }), [o, e, s, a]);
573
- return /* @__PURE__ */ m(B.Provider, { value: c, children: t });
574
- }, j = () => {
575
- const n = Q(B);
576
- if (n === void 0)
583
+ segmentStack: o
584
+ }), [a, e, s, o]);
585
+ return /* @__PURE__ */ m(Y.Provider, { value: c, children: n });
586
+ }, U = () => {
587
+ const t = Z(Y);
588
+ if (t === void 0)
577
589
  throw new Error("useCitadelConfig must be used within a CitadelConfigProvider");
578
- return n.config;
579
- }, Z = () => {
580
- const n = Q(B);
581
- if (n === void 0)
590
+ return t.config;
591
+ }, te = () => {
592
+ const t = Z(Y);
593
+ if (t === void 0)
582
594
  throw new Error("useCitadelCommands must be used within a CitadelConfigProvider");
583
- return n.commands;
595
+ return t.commands;
584
596
  }, be = () => {
585
- const n = Q(B);
586
- if (n === void 0)
597
+ const t = Z(Y);
598
+ if (t === void 0)
587
599
  throw new Error("useCitadelStorage must be used within a CitadelConfigProvider");
588
- return n.storage;
589
- }, V = () => {
590
- const n = Q(B);
591
- if (n === void 0)
600
+ return t.storage;
601
+ }, J = () => {
602
+ const t = Z(Y);
603
+ if (t === void 0)
592
604
  throw new Error("useSegmentStack must be used within a CitadelConfigProvider");
593
- return n.segmentStack;
594
- }, G = class G {
595
- constructor(e, t) {
596
- f(this, "id");
597
- f(this, "timestamp");
598
- f(this, "command");
599
- f(this, "result");
600
- this.id = `output-${Date.now()}-${G.idCounter++}`, this.command = e.toArray().map((s) => s.type === "argument" ? s.value || "" : s.name), this.timestamp = Date.now(), this.result = t ?? new De();
605
+ return t.segmentStack;
606
+ }, X = class X {
607
+ constructor(e, n) {
608
+ y(this, "id");
609
+ y(this, "timestamp");
610
+ y(this, "command");
611
+ y(this, "result");
612
+ this.id = `output-${Date.now()}-${X.idCounter++}`, this.command = e.toArray().map((s) => s.type === "argument" ? s.value || "" : s.name), this.timestamp = Date.now(), this.result = n ?? new Oe();
601
613
  }
602
614
  };
603
- f(G, "idCounter", 0);
604
- let oe = G;
605
- function Ke(n) {
615
+ y(X, "idCounter", 0);
616
+ let oe = X;
617
+ function qe(t) {
606
618
  return {
607
- commandSegments: D(n),
619
+ commandSegments: z(t),
608
620
  timestamp: Date.now()
609
621
  };
610
622
  }
611
623
  function ke() {
612
- const n = be(), [e, t] = _({
624
+ const t = be(), [e, n] = _({
613
625
  storedCommands: [],
614
626
  position: null
615
- }), s = w(async (c) => {
616
- if (n)
627
+ }), s = f(async (c) => {
628
+ if (t)
617
629
  try {
618
- const i = Ke(c);
619
- await n.addStoredCommand(i), t((d) => ({
630
+ const i = qe(c);
631
+ await t.addStoredCommand(i), n((d) => ({
620
632
  ...d,
621
633
  storedCommands: [...d.storedCommands, {
622
634
  ...i,
623
- commandSegments: D(i.commandSegments)
635
+ commandSegments: z(i.commandSegments)
624
636
  }],
625
637
  position: null
626
638
  }));
627
639
  } catch (i) {
628
640
  console.warn("Failed to save command to history:", i);
629
641
  }
630
- }, [n]), r = w(async () => n ? (await n.getStoredCommands()).map((i) => ({
642
+ }, [t]), r = f(async () => t ? (await t.getStoredCommands()).map((i) => ({
631
643
  ...i,
632
- commandSegments: D(i.commandSegments)
633
- })) : [], [n]);
634
- P(() => {
635
- if (!n) return;
644
+ commandSegments: z(i.commandSegments)
645
+ })) : [], [t]);
646
+ I(() => {
647
+ if (!t) return;
636
648
  (async () => {
637
649
  try {
638
- const d = (await n.getStoredCommands()).map((g) => ({
650
+ const d = (await t.getStoredCommands()).map((g) => ({
639
651
  ...g,
640
- commandSegments: D(g.commandSegments)
652
+ commandSegments: z(g.commandSegments)
641
653
  }));
642
- return t((g) => ({
654
+ return n((g) => ({
643
655
  ...g,
644
656
  storedCommands: d
645
657
  })), d;
@@ -647,21 +659,21 @@ function ke() {
647
659
  console.warn("Failed to load command history:", i);
648
660
  }
649
661
  })();
650
- }, [n]);
651
- const a = w(async (c) => {
662
+ }, [t]);
663
+ const o = f(async (c) => {
652
664
  const i = await r();
653
665
  if (i.length === 0)
654
- return t((u) => ({
666
+ return n((u) => ({
655
667
  ...u,
656
668
  storedCommands: [],
657
669
  position: null
658
670
  })), { segments: null, position: null };
659
671
  let d = null;
660
- if (c === "up" ? e.position === null ? d = i.length - 1 : e.position > 0 ? d = e.position - 1 : d = 0 : e.position === null || e.position >= i.length - 1 ? d = null : d = e.position + 1, t((u) => ({
672
+ if (c === "up" ? e.position === null ? d = i.length - 1 : e.position > 0 ? d = e.position - 1 : d = 0 : e.position === null || e.position >= i.length - 1 ? d = null : d = e.position + 1, n((u) => ({
661
673
  ...u,
662
674
  storedCommands: i.map((h) => ({
663
675
  ...h,
664
- commandSegments: D(h.commandSegments)
676
+ commandSegments: z(h.commandSegments)
665
677
  })),
666
678
  position: d
667
679
  })), d === null)
@@ -671,33 +683,33 @@ function ke() {
671
683
  };
672
684
  const g = i[d];
673
685
  return g ? {
674
- segments: D(g.commandSegments),
686
+ segments: z(g.commandSegments),
675
687
  position: d
676
688
  } : {
677
689
  segments: [],
678
690
  position: null
679
691
  };
680
- }, [e.position, r]), o = w(async () => {
692
+ }, [e.position, r]), a = f(async () => {
681
693
  try {
682
- if (!n) return;
683
- await n.clear(), t({
694
+ if (!t) return;
695
+ await t.clear(), n({
684
696
  storedCommands: [],
685
697
  position: null
686
698
  });
687
699
  } catch (c) {
688
700
  console.warn("Failed to clear command history:", c);
689
701
  }
690
- }, [n]);
702
+ }, [t]);
691
703
  return {
692
704
  history: e,
693
705
  addStoredCommand: s,
694
706
  getStoredCommands: r,
695
- navigateHistory: a,
696
- clear: o
707
+ navigateHistory: o,
708
+ clear: a
697
709
  };
698
710
  }
699
711
  const de = () => {
700
- const n = j(), e = Z(), t = ke(), s = V(), r = be(), [a, o] = _({
712
+ const t = U(), e = te(), n = ke(), s = J(), r = be(), [o, a] = _({
701
713
  currentInput: "",
702
714
  isEnteringArg: !1,
703
715
  output: [],
@@ -707,156 +719,160 @@ const de = () => {
707
719
  storage: r
708
720
  }
709
721
  });
710
- P(() => {
711
- }, [r]), P(() => {
712
- o((i) => ({
722
+ I(() => {
723
+ }, [r]), I(() => {
724
+ a((i) => ({
713
725
  ...i,
714
726
  history: {
715
- commands: t.history.storedCommands,
716
- position: t.history.position,
727
+ commands: n.history.storedCommands,
728
+ position: n.history.position,
717
729
  storage: r
718
730
  }
719
731
  }));
720
- }, [t.history, r]);
732
+ }, [n.history, r]);
721
733
  const c = {
722
- setCurrentInput: w((i) => {
723
- k.debug("[CitadelActions] setCurrentInput: ", i), o((d) => ({ ...d, currentInput: i }));
734
+ setCurrentInput: f((i) => {
735
+ b.debug("[CitadelActions] setCurrentInput: ", i), a((d) => ({ ...d, currentInput: i }));
724
736
  }, []),
725
- setIsEnteringArg: w((i) => {
726
- k.debug("[CitadelActions] setIsEnteringArg: ", i), o((d) => ({ ...d, isEnteringArg: i }));
737
+ setIsEnteringArg: f((i) => {
738
+ b.debug("[CitadelActions] setIsEnteringArg: ", i), a((d) => ({ ...d, isEnteringArg: i }));
727
739
  }, []),
728
- addOutput: w((i) => {
729
- k.debug("[CitadelActions]addOutput: ", i), o((d) => ({
740
+ addOutput: f((i) => {
741
+ b.debug("[CitadelActions]addOutput: ", i), a((d) => ({
730
742
  ...d,
731
743
  output: [...d.output, i]
732
744
  }));
733
745
  }, []),
734
- executeCommand: w(async () => {
746
+ executeCommand: f(async () => {
735
747
  const i = s.path(), d = e.getCommand(i);
736
748
  if (!d) {
737
749
  console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ", i);
738
750
  return;
739
751
  }
740
752
  const g = new oe(s);
741
- o((u) => ({
753
+ a((u) => ({
742
754
  ...u,
743
755
  output: [...u.output, g]
744
756
  }));
745
757
  try {
746
- const u = new Promise((y, v) => {
758
+ const u = new Promise((C, k) => {
747
759
  setTimeout(() => {
748
- v(new Error("Request timed out"));
749
- }, n.commandTimeoutMs);
750
- }), h = s.arguments.map((y) => y.value || ""), x = await Promise.race([
760
+ k(new Error("Request timed out"));
761
+ }, t.commandTimeoutMs);
762
+ }), h = s.arguments.map((C) => C.value || ""), S = await Promise.race([
751
763
  d.handler(h),
752
764
  u
753
765
  ]);
754
- if (!(x instanceof W))
766
+ if (!(S instanceof K))
755
767
  throw new Error(
756
768
  `The ${i.join(".")} command returned an invalid result type. Commands must return an instance of a CommandResult.
757
769
  For example:
758
770
  return new JsonCommandResult({ text: "Hello World" });
759
771
  Check the definition of the ${i.join(".")} command and update the return type for its handler.`
760
772
  );
761
- x.markSuccess(), o((y) => ({
762
- ...y,
763
- output: y.output.map(
764
- (v) => v.id === g.id ? { ...v, result: x } : v
773
+ S.markSuccess(), a((C) => ({
774
+ ...C,
775
+ output: C.output.map(
776
+ (k) => k.id === g.id ? { ...k, result: S } : k
765
777
  )
766
778
  }));
767
779
  } catch (u) {
768
780
  const h = new we(
769
781
  u instanceof Error ? u.message : "Unknown error"
770
782
  );
771
- h.markFailure(), o((x) => ({
772
- ...x,
773
- output: x.output.map(
774
- (y) => y.id === g.id ? { ...y, result: h } : y
783
+ h.markFailure(), a((S) => ({
784
+ ...S,
785
+ output: S.output.map(
786
+ (C) => C.id === g.id ? { ...C, result: h } : C
775
787
  )
776
788
  }));
777
789
  }
778
- }, [e, n.commandTimeoutMs, s]),
779
- clearHistory: w(async () => {
790
+ }, [e, t.commandTimeoutMs, s]),
791
+ clearHistory: f(async () => {
780
792
  try {
781
- await t.clear();
793
+ await n.clear();
782
794
  } catch (i) {
783
795
  console.warn("Failed to clear history:", i);
784
796
  }
785
- }, [t])
797
+ }, [n])
786
798
  };
787
- return { state: a, actions: c };
788
- }, qe = ({ onOpen: n, onClose: e, isVisible: t, showCitadelKey: s }) => {
789
- P(() => {
790
- const r = (a) => {
791
- var o, c;
792
- !t && a.key === s && !["input", "textarea"].includes(((c = (o = a.target) == null ? void 0 : o.tagName) == null ? void 0 : c.toLowerCase()) || "") && (a.preventDefault(), n()), t && a.key === "Escape" && (a.preventDefault(), e());
799
+ return { state: o, actions: c };
800
+ }, Be = ({
801
+ onOpen: t,
802
+ onClose: e,
803
+ isVisible: n,
804
+ showCitadelKey: s,
805
+ closeOnEscape: r
806
+ }) => {
807
+ I(() => {
808
+ const o = (a) => {
809
+ var c, i;
810
+ !n && a.key === s && !["input", "textarea"].includes(((i = (c = a.target) == null ? void 0 : c.tagName) == null ? void 0 : i.toLowerCase()) || "") && (a.preventDefault(), t()), r && n && a.key === "Escape" && (a.preventDefault(), e());
793
811
  };
794
- return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
795
- }, [n, e, t, s]);
796
- }, Be = (n) => {
797
- const { isVisible: e, isClosing: t, onAnimationComplete: s } = n, r = A(() => e ? t ? "citadel_slideDown" : "citadel_slideUp" : "", [e, t]);
798
- return P(() => {
799
- if (s) {
800
- const o = setTimeout(() => {
801
- s();
802
- }, 200);
803
- return () => clearTimeout(o);
812
+ return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
813
+ }, [t, e, n, s, r]);
814
+ }, Ve = 200, Ye = (t) => {
815
+ const { isVisible: e, isClosing: n, onAnimationComplete: s } = t, r = P(() => e ? n ? "citadel_slideDown" : "citadel_slideUp" : "", [e, n]);
816
+ return I(() => {
817
+ if (!n || !s) return;
818
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
819
+ s();
820
+ return;
804
821
  }
805
- }, [t, s]), {
806
- style: A(() => ({
807
- opacity: e ? 1 : 0,
808
- transform: e ? "translateY(0)" : t ? "translateY(100%)" : "translateY(-100%)",
809
- transition: "opacity 200ms ease-in-out, transform 200ms ease-in-out"
810
- }), [e, t]),
822
+ const a = setTimeout(() => {
823
+ s();
824
+ }, Ve);
825
+ return () => clearTimeout(a);
826
+ }, [n, s]), {
811
827
  animationClass: r
812
828
  };
813
- }, Ve = () => /* @__PURE__ */ m(
829
+ }, Je = () => /* @__PURE__ */ m(
814
830
  "div",
815
831
  {
816
832
  "data-testid": "spinner",
817
833
  className: "citadel-spinner"
818
834
  }
819
- ), Ee = (n) => {
820
- const e = n == null ? void 0 : n.trim();
835
+ ), Ee = (t) => {
836
+ const e = t == null ? void 0 : t.trim();
821
837
  return e || void 0;
822
- }, Ye = (n) => {
823
- const e = Ee(n);
838
+ }, Ge = (t) => {
839
+ const e = Ee(t);
824
840
  return e ? { style: { fontSize: e } } : {};
825
- }, ee = (n, e) => {
826
- const t = Ee(n), r = {
827
- ...Ye(e).style
841
+ }, ne = (t, e) => {
842
+ const n = Ee(t), r = {
843
+ ...Ge(e).style
828
844
  };
829
- return t && (r.fontFamily = t), {
845
+ return n && (r.fontFamily = n), {
830
846
  style: Object.keys(r).length > 0 ? r : void 0
831
847
  };
832
- }, Je = ({
833
- command: n,
848
+ }, Qe = ({
849
+ command: t,
834
850
  timestamp: e,
835
- status: t,
851
+ status: n,
836
852
  fontFamily: s,
837
853
  fontSize: r
838
854
  }) => {
839
- const a = A(
840
- () => ee(s, r ?? "0.875rem"),
855
+ const o = P(
856
+ () => ne(s, r ?? "0.875rem"),
841
857
  [s, r]
842
858
  );
843
- return /* @__PURE__ */ I(
859
+ return /* @__PURE__ */ A(
844
860
  "div",
845
861
  {
846
862
  className: "citadel-output-line",
847
- style: a.style,
863
+ style: o.style,
848
864
  children: [
849
- /* @__PURE__ */ I("span", { className: "citadel-output-command", children: [
865
+ /* @__PURE__ */ A("span", { className: "citadel-output-command", children: [
850
866
  "> ",
851
- n.split(" ").map((o, c) => {
852
- const i = o.startsWith("<") && o.endsWith(">");
853
- return /* @__PURE__ */ I(
867
+ t.split(" ").map((a, c) => {
868
+ const i = a.startsWith("<") && a.endsWith(">");
869
+ return /* @__PURE__ */ A(
854
870
  "span",
855
871
  {
856
872
  className: i ? "citadel-output-command-arg" : "citadel-output-command-word",
857
873
  children: [
858
874
  c > 0 ? " " : "",
859
- o
875
+ a
860
876
  ]
861
877
  },
862
878
  c
@@ -865,15 +881,15 @@ Check the definition of the ${i.join(".")} command and update the return type fo
865
881
  ] }),
866
882
  /* @__PURE__ */ m("span", { className: "citadel-output-separator", children: "·" }),
867
883
  /* @__PURE__ */ m("span", { className: "citadel-output-timestamp", children: e }),
868
- t === q.Pending && /* @__PURE__ */ m(Ve, {}),
869
- t === q.Success && /* @__PURE__ */ m(
884
+ n === V.Pending && /* @__PURE__ */ m(Je, {}),
885
+ n === V.Success && /* @__PURE__ */ m(
870
886
  "div",
871
887
  {
872
888
  "data-testid": "success-indicator",
873
889
  className: "citadel-status-dot citadel-status-dot-success"
874
890
  }
875
891
  ),
876
- (t === q.Timeout || t === q.Failure) && /* @__PURE__ */ m(
892
+ (n === V.Timeout || n === V.Failure) && /* @__PURE__ */ m(
877
893
  "div",
878
894
  {
879
895
  "data-testid": "success-indicator",
@@ -883,39 +899,39 @@ Check the definition of the ${i.join(".")} command and update the return type fo
883
899
  ]
884
900
  }
885
901
  );
886
- }, Ge = ({ output: n, outputRef: e }) => {
887
- const t = j(), s = A(
888
- () => ee(t.fontFamily, t.outputFontSize ?? t.fontSize),
889
- [t.fontFamily, t.fontSize, t.outputFontSize]
890
- ), r = w(() => {
902
+ }, Xe = ({ output: t, outputRef: e }) => {
903
+ const n = U(), s = P(
904
+ () => ne(n.fontFamily, n.outputFontSize ?? n.fontSize),
905
+ [n.fontFamily, n.fontSize, n.outputFontSize]
906
+ ), r = f(() => {
891
907
  if (e.current) {
892
- const a = e.current;
908
+ const o = e.current;
893
909
  requestAnimationFrame(() => {
894
- a.scrollTop = a.scrollHeight;
910
+ o.scrollTop = o.scrollHeight;
895
911
  });
896
912
  }
897
913
  }, [e]);
898
- return P(() => {
914
+ return I(() => {
899
915
  if (r(), e.current) {
900
- const a = e.current.getElementsByTagName("img"), o = a[a.length - 1];
901
- if (o && !o.complete)
902
- return o.addEventListener("load", r), () => o.removeEventListener("load", r);
916
+ const o = e.current.getElementsByTagName("img"), a = o[o.length - 1];
917
+ if (a && !a.complete)
918
+ return a.addEventListener("load", r), () => a.removeEventListener("load", r);
903
919
  }
904
- }, [n, r, e]), /* @__PURE__ */ m(
920
+ }, [t, r, e]), /* @__PURE__ */ m(
905
921
  "div",
906
922
  {
907
923
  ref: e,
908
924
  className: "citadel-output",
909
925
  "data-testid": "citadel-command-output",
910
- children: n.map((a) => /* @__PURE__ */ I("div", { className: "citadel-output-item", children: [
926
+ children: t.map((o) => /* @__PURE__ */ A("div", { className: "citadel-output-item", children: [
911
927
  /* @__PURE__ */ m(
912
- Je,
928
+ Qe,
913
929
  {
914
- command: a.command.join(" "),
915
- timestamp: new Date(a.timestamp).toLocaleTimeString(),
916
- status: a.result.status,
917
- fontFamily: t.fontFamily,
918
- fontSize: t.fontSize
930
+ command: o.command.join(" "),
931
+ timestamp: new Date(o.timestamp).toLocaleTimeString(),
932
+ status: o.result.status,
933
+ fontFamily: n.fontFamily,
934
+ fontSize: n.fontSize
919
935
  }
920
936
  ),
921
937
  /* @__PURE__ */ m(
@@ -923,13 +939,13 @@ Check the definition of the ${i.join(".")} command and update the return type fo
923
939
  {
924
940
  className: "citadel-output-content",
925
941
  style: s.style,
926
- children: a.result.render()
942
+ children: o.result.render()
927
943
  }
928
944
  )
929
- ] }, a.id))
945
+ ] }, o.id))
930
946
  }
931
947
  );
932
- }, Qe = {
948
+ }, Ze = {
933
949
  blink: {
934
950
  character: "▋",
935
951
  speed: 530,
@@ -950,23 +966,23 @@ Check the definition of the ${i.join(".")} command and update the return type fo
950
966
  speed: 120,
951
967
  color: "#fff"
952
968
  }
953
- }, he = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], ge = ["|", "/", "-", "\\"], Xe = ({
954
- style: n = { type: "blink" },
969
+ }, he = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], ge = ["|", "/", "-", "\\"], et = ({
970
+ style: t = { type: "blink" },
955
971
  isValid: e = !0,
956
- errorMessage: t
972
+ errorMessage: n
957
973
  }) => {
958
- const s = A(() => ({
959
- ...Qe[n.type],
960
- ...n
961
- }), [n]), [r, a] = _(!0), [o, c] = _(0);
962
- P(() => {
974
+ const s = P(() => ({
975
+ ...Ze[t.type],
976
+ ...t
977
+ }), [t]), [r, o] = _(!0), [a, c] = _(0);
978
+ I(() => {
963
979
  if (s.speed === 0) return;
964
980
  const g = setInterval(() => {
965
- s.type === "blink" ? a((u) => !u) : ["spin", "bbs"].includes(s.type) && c((u) => (u + 1) % (s.type === "bbs" ? ge.length : he.length));
981
+ s.type === "blink" ? o((u) => !u) : ["spin", "bbs"].includes(s.type) && c((u) => (u + 1) % (s.type === "bbs" ? ge.length : he.length));
966
982
  }, s.speed);
967
983
  return () => clearInterval(g);
968
984
  }, [s.type, s.speed]);
969
- const i = A(() => ({
985
+ const i = P(() => ({
970
986
  color: e ? s.color : "#ff4444",
971
987
  transition: "color 0.15s ease-in-out"
972
988
  }), [e, s.color]);
@@ -975,113 +991,113 @@ Check the definition of the ${i.join(".")} command and update the return type fo
975
991
  {
976
992
  className: `command-cursor ${e ? "" : "animate-shake"}`,
977
993
  style: i,
978
- title: t,
979
- children: !e && t ? "✗" : ["spin", "bbs"].includes(s.type) ? (s.type === "bbs" ? ge : he)[o] : s.type === "solid" || r ? s.character : " "
994
+ title: n,
995
+ children: !e && n ? "✗" : ["spin", "bbs"].includes(s.type) ? (s.type === "bbs" ? ge : he)[a] : s.type === "solid" || r ? s.character : " "
980
996
  }
981
997
  ) });
982
998
  };
983
- function Ze(n, e) {
999
+ function tt(t, e) {
984
1000
  switch (e.type) {
985
1001
  case "set":
986
- return k.debug(`[inputStateReducer] InputState changing from ${n} to ${e.state}`), e.state;
1002
+ return b.debug(`[inputStateReducer] InputState changing from ${t} to ${e.state}`), e.state;
987
1003
  default:
988
- return n;
1004
+ return t;
989
1005
  }
990
1006
  }
991
- const et = () => {
992
- const { state: n } = de(), e = Z(), t = ke(), s = V(), [r, a] = _e(Ze, "idle"), o = (l) => {
993
- a({ type: "set", state: l });
994
- }, c = w(() => {
1007
+ const nt = () => {
1008
+ const { state: t } = de(), e = te(), n = ke(), s = J(), [r, o] = _e(tt, "idle"), a = (l) => {
1009
+ o({ type: "set", state: l });
1010
+ }, c = f(() => {
995
1011
  const p = e.getCompletions(s.path())[0] || s.nullSegment;
996
- return k.debug("[getNextExpectedSegment] ", p), p;
997
- }, [e, s]), i = w(() => e.getCompletionNames(s.path()).map((p) => e.getCommand([...s.path(), p])).filter((p) => p !== void 0), [e, s]), d = w((l, p) => {
1012
+ return b.debug("[getNextExpectedSegment] ", p), p;
1013
+ }, [e, s]), i = f(() => e.getCompletionNames(s.path()).map((p) => e.getCommand([...s.path(), p])).filter((p) => p !== void 0), [e, s]), d = f((l, p) => {
998
1014
  if (!l) return p;
999
- const C = s.path().length;
1000
- return p.filter((M) => {
1001
- const S = M.segments[C];
1002
- return !S || S.type !== "word" ? !1 : S.name.toLowerCase().startsWith(l.toLowerCase());
1015
+ const w = s.path().length;
1016
+ return p.filter((D) => {
1017
+ const v = D.segments[w];
1018
+ return !v || v.type !== "word" ? !1 : v.name.toLowerCase().startsWith(l.toLowerCase());
1003
1019
  });
1004
- }, [s]), g = w((l) => {
1020
+ }, [s]), g = f((l) => {
1005
1021
  const p = e.getUniqueCompletion(s.path(), l);
1006
1022
  return p && p.type === "word" ? p : s.nullSegment;
1007
- }, [e, s]), u = w((l) => {
1008
- const p = s.path(), C = e.getCompletions(p);
1009
- return C.length === 0 && l ? !1 : C.some((S) => S.type === "argument") ? !0 : e.getMatchingCompletions(p, l).some((S) => S.type === "word");
1010
- }, [e, s]), h = w((l) => {
1011
- k.debug("[tryAutoComplete] input: ", l);
1023
+ }, [e, s]), u = f((l) => {
1024
+ const p = s.path(), w = e.getCompletions(p);
1025
+ return w.length === 0 && l ? !1 : w.some((v) => v.type === "argument") ? !0 : e.getMatchingCompletions(p, l).some((v) => v.type === "word");
1026
+ }, [e, s]), h = f((l) => {
1027
+ b.debug("[tryAutoComplete] input: ", l);
1012
1028
  const p = g(l);
1013
- return !p || p.type === "null" ? new le() : (k.debug("[tryAutoComplete] result: ", p), p);
1014
- }, [g]), x = w((l, p) => {
1015
- if (n.history.position !== null)
1029
+ return !p || p.type === "null" ? new le() : (b.debug("[tryAutoComplete] result: ", p), p);
1030
+ }, [g]), S = f((l, p) => {
1031
+ if (t.history.position !== null)
1016
1032
  return;
1017
- p.setCurrentInput(l), k.debug("[useCommandParser][handleInputChange] newValue: ", l);
1018
- const C = c();
1019
- if (C.type === "argument" || r === "entering_argument") {
1033
+ p.setCurrentInput(l), b.debug("[useCommandParser][handleInputChange] newValue: ", l);
1034
+ const w = c();
1035
+ if (w.type === "argument" || r === "entering_argument") {
1020
1036
  const H = fe(l);
1021
1037
  if (H.isQuoted)
1022
1038
  if (H.isComplete) {
1023
- if (!(C instanceof O)) return;
1024
- C.value = l.trim() || "", k.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", C), s.push(C), p.setCurrentInput(""), o("idle");
1039
+ if (!(w instanceof q)) return;
1040
+ w.value = l.trim() || "", b.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", w), s.push(w), p.setCurrentInput(""), a("idle");
1025
1041
  return;
1026
1042
  } else
1027
1043
  return;
1028
1044
  else if (H.isComplete) {
1029
- if (!(C instanceof O)) return;
1030
- C.value = l.trim() || "", k.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", C), s.push(C), p.setCurrentInput(""), o("idle");
1045
+ if (!(w instanceof q)) return;
1046
+ w.value = l.trim() || "", b.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", w), s.push(w), p.setCurrentInput(""), a("idle");
1031
1047
  return;
1032
1048
  } else
1033
1049
  return;
1034
1050
  }
1035
1051
  if (l.endsWith(" ")) {
1036
- const H = l.trim().toLowerCase(), T = e.getCompletions(s.path()).filter(
1037
- (b) => b.type === "word" && b.name.toLowerCase() === H
1052
+ const H = l.trim().toLowerCase(), M = e.getCompletions(s.path()).filter(
1053
+ (E) => E.type === "word" && E.name.toLowerCase() === H
1038
1054
  );
1039
- if (T.length === 1) {
1040
- s.push(T[0]), p.setCurrentInput(""), o("idle");
1055
+ if (M.length === 1) {
1056
+ s.push(M[0]), p.setCurrentInput(""), a("idle");
1041
1057
  return;
1042
1058
  }
1043
1059
  }
1044
- const S = h(l);
1045
- if (S.type === "word") {
1046
- k.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", S), s.push(S), p.setCurrentInput(""), o("idle");
1060
+ const v = h(l);
1061
+ if (v.type === "word") {
1062
+ b.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", v), s.push(v), p.setCurrentInput(""), a("idle");
1047
1063
  return;
1048
1064
  }
1049
- }, [h, n, c, r, s, e]), y = w((l) => {
1050
- l.setCurrentInput(""), l.setIsEnteringArg(!1), s.clear(), o("idle");
1051
- }, [s]), v = w((l, p, C) => {
1065
+ }, [h, t, c, r, s, e]), C = f((l) => {
1066
+ l.setCurrentInput(""), l.setIsEnteringArg(!1), s.clear(), a("idle");
1067
+ }, [s]), k = f((l, p, w) => {
1052
1068
  if (!(l.key === "Backspace" || l.key === "Enter" || l.key === "ArrowUp" || l.key === "ArrowDown" || l.key === "ArrowLeft" || l.key === "ArrowRight" || l.key === "Escape" || l.key === "Delete" || l.key === "Home" || l.key === "End" || l.key.length === 1))
1053
1069
  return !0;
1054
- const { currentInput: S, isEnteringArg: H } = p, T = fe(S);
1070
+ const { currentInput: v, isEnteringArg: H } = p, M = fe(v);
1055
1071
  switch (l.key) {
1056
1072
  case "Backspace":
1057
- return S === "" && (l.preventDefault(), s.size() > 0 && s.pop(), o("idle")), !0;
1073
+ return v === "" && (l.preventDefault(), s.size() > 0 && s.pop(), a("idle")), !0;
1058
1074
  case "Enter": {
1059
- if (l.preventDefault(), T.isQuoted && !T.isComplete)
1075
+ if (l.preventDefault(), M.isQuoted && !M.isComplete)
1060
1076
  return !0;
1061
- if (r === "entering_argument" || H && S.trim()) {
1077
+ if (r === "entering_argument" || H && v.trim()) {
1062
1078
  const F = c();
1063
- F instanceof O && (F.value = S, k.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", F), s.push(F));
1079
+ F instanceof q && (F.value = v, b.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", F), s.push(F));
1064
1080
  }
1065
- const b = s.path(), te = e.getCommand(b);
1066
- if (!te)
1081
+ const E = s.path(), B = e.getCommand(E);
1082
+ if (!B)
1067
1083
  return !1;
1068
- const K = te.segments.filter((F) => F.type === "argument"), ne = s.arguments;
1069
- return K.length > ne.length ? !1 : (k.debug("[handleKeyDown][Enter] calling actions.executeCommand. segmentStack: ", s), C.executeCommand(), t.addStoredCommand(s.toArray()), y(C), !0);
1084
+ const O = B.segments.filter((F) => F.type === "argument"), W = s.arguments;
1085
+ return O.length > W.length ? !1 : (b.debug("[handleKeyDown][Enter] calling actions.executeCommand. segmentStack: ", s), w.executeCommand(), n.addStoredCommand(s.toArray()), C(w), !0);
1070
1086
  }
1071
1087
  case "ArrowUp":
1072
1088
  return l.preventDefault(), (async () => {
1073
- const b = await t.navigateHistory("up");
1074
- return b.segments && (s.clear(), s.pushAll(b.segments), C.setCurrentInput("")), !0;
1089
+ const E = await n.navigateHistory("up");
1090
+ return E.segments && (s.clear(), s.pushAll(E.segments), w.setCurrentInput("")), !0;
1075
1091
  })();
1076
1092
  case "ArrowDown":
1077
1093
  return l.preventDefault(), (async () => {
1078
- const b = await t.navigateHistory("down");
1079
- return b.segments && (s.clear(), s.pushAll(b.segments), C.setCurrentInput("")), !0;
1094
+ const E = await n.navigateHistory("down");
1095
+ return E.segments && (s.clear(), s.pushAll(E.segments), w.setCurrentInput("")), !0;
1080
1096
  })();
1081
1097
  default: {
1082
1098
  if (!H && l.key.length === 1) {
1083
- const b = S + l.key;
1084
- if (!u(b))
1099
+ const E = v + l.key;
1100
+ if (!u(E))
1085
1101
  return l.preventDefault(), !1;
1086
1102
  }
1087
1103
  return !0;
@@ -1091,16 +1107,16 @@ const et = () => {
1091
1107
  r,
1092
1108
  u,
1093
1109
  c,
1094
- t,
1095
- y,
1110
+ n,
1111
+ C,
1096
1112
  e,
1097
1113
  s
1098
1114
  ]);
1099
1115
  return {
1100
- handleInputChange: x,
1101
- handleKeyDown: v,
1116
+ handleInputChange: S,
1117
+ handleKeyDown: k,
1102
1118
  inputState: r,
1103
- setInputStateWithLogging: o,
1119
+ setInputStateWithLogging: a,
1104
1120
  // Expose internal functions for testing
1105
1121
  findMatchingCommands: d,
1106
1122
  getAutocompleteSuggestion: g,
@@ -1109,63 +1125,63 @@ const et = () => {
1109
1125
  isValidCommandInput: u
1110
1126
  };
1111
1127
  };
1112
- function fe(n) {
1128
+ function fe(t) {
1113
1129
  const e = [];
1114
- let t = "", s = !1, r;
1115
- for (let a = 0; a < n.length; a++) {
1116
- const o = n[a];
1117
- (o === '"' || o === "'") && (!s || o === r) ? s ? (e.push(t), t = "", s = !1, r = void 0) : (t && (e.push(t), t = ""), s = !0, r = o) : !s && o === " " ? t && (e.push(t), t = "") : t += o;
1130
+ let n = "", s = !1, r;
1131
+ for (let o = 0; o < t.length; o++) {
1132
+ const a = t[o];
1133
+ (a === '"' || a === "'") && (!s || a === r) ? s ? (e.push(n), n = "", s = !1, r = void 0) : (n && (e.push(n), n = ""), s = !0, r = a) : !s && a === " " ? n && (e.push(n), n = "") : n += a;
1118
1134
  }
1119
1135
  return {
1120
1136
  words: e,
1121
- currentWord: t,
1137
+ currentWord: n,
1122
1138
  isQuoted: s,
1123
1139
  quoteChar: r,
1124
- isComplete: !s && !t
1140
+ isComplete: !s && !n
1125
1141
  };
1126
1142
  }
1127
- const tt = () => {
1128
- const n = V(), [e, t] = _(0);
1129
- return P(() => {
1143
+ const st = () => {
1144
+ const t = J(), [e, n] = _(0);
1145
+ return I(() => {
1130
1146
  const s = {
1131
1147
  update: () => {
1132
- t((r) => r + 1);
1148
+ n((r) => r + 1);
1133
1149
  }
1134
1150
  };
1135
- return n.subscribe(s), () => {
1136
- n.unsubscribe(s);
1151
+ return t.subscribe(s), () => {
1152
+ t.unsubscribe(s);
1137
1153
  };
1138
- }, [n]), e;
1139
- }, nt = ({
1140
- state: n,
1154
+ }, [t]), e;
1155
+ }, rt = ({
1156
+ state: t,
1141
1157
  actions: e
1142
1158
  }) => {
1143
- const t = z(null), s = Z(), r = V(), {
1144
- handleKeyDown: a,
1145
- handleInputChange: o,
1159
+ const n = T(null), s = te(), r = J(), {
1160
+ handleKeyDown: o,
1161
+ handleInputChange: a,
1146
1162
  inputState: c,
1147
1163
  setInputStateWithLogging: i,
1148
1164
  getNextExpectedSegment: d
1149
- } = et(), [g, u] = _(!1), h = j(), x = tt(), y = z(null), [v, l] = _(0), p = A(
1150
- () => ee(h.fontFamily, h.fontSize),
1165
+ } = nt(), [g, u] = _(!1), h = U(), S = st(), C = T(null), [k, l] = _(0), p = P(
1166
+ () => ne(h.fontFamily, h.fontSize),
1151
1167
  [h.fontFamily, h.fontSize]
1152
- ), C = w(async (E) => {
1153
- const R = a(E, n, e);
1168
+ ), w = f(async (N) => {
1169
+ const R = o(N, t, e);
1154
1170
  await Promise.resolve(R) === !1 && (u(!0), setTimeout(() => u(!1), 500));
1155
- }, [e, a, n]), M = w((E) => {
1156
- o(E.target.value, e);
1157
- }, [e, o]), S = w((E) => {
1158
- E.preventDefault();
1159
- const R = E.clipboardData.getData("text");
1160
- o(R, e);
1161
- }, [e, o]);
1162
- P(() => {
1163
- t.current && t.current.focus(), c !== "entering_command" && i("entering_command");
1164
- }, [c, i]), P(() => {
1171
+ }, [e, o, t]), D = f((N) => {
1172
+ a(N.target.value, e);
1173
+ }, [e, a]), v = f((N) => {
1174
+ N.preventDefault();
1175
+ const R = N.clipboardData.getData("text");
1176
+ a(R, e);
1177
+ }, [e, a]);
1178
+ I(() => {
1179
+ n.current && n.current.focus(), c !== "entering_command" && i("entering_command");
1180
+ }, [c, i]), I(() => {
1165
1181
  if (c !== "idle") return;
1166
- const E = d();
1182
+ const N = d();
1167
1183
  let R = "idle";
1168
- switch (E.type) {
1184
+ switch (N.type) {
1169
1185
  case "word":
1170
1186
  R = "entering_command", e.setIsEnteringArg(!1);
1171
1187
  break;
@@ -1174,93 +1190,93 @@ const tt = () => {
1174
1190
  break;
1175
1191
  }
1176
1192
  i(R);
1177
- }, [x, c, d, i, e]);
1178
- const H = A(() => {
1179
- const E = [], R = r.toArray().map((L, se) => {
1180
- E.push(L.name);
1181
- const me = s.hasNextSegment(E);
1193
+ }, [S, c, d, i, e]);
1194
+ const H = P(() => {
1195
+ const N = [], R = r.toArray().map((L, se) => {
1196
+ N.push(L.name);
1197
+ const me = s.hasNextSegment(N);
1182
1198
  if (L.type === "argument") {
1183
1199
  const re = L;
1184
- return /* @__PURE__ */ I(U.Fragment, { children: [
1200
+ return /* @__PURE__ */ A($.Fragment, { children: [
1185
1201
  /* @__PURE__ */ m("span", { className: "citadel-input-segment-arg", children: re.value }),
1186
1202
  se < r.size() && me && /* @__PURE__ */ m("span", { className: "citadel-input-segment-space", children: " " })
1187
1203
  ] }, "arg-" + re.name + re.value);
1188
1204
  }
1189
- return /* @__PURE__ */ I(U.Fragment, { children: [
1205
+ return /* @__PURE__ */ A($.Fragment, { children: [
1190
1206
  /* @__PURE__ */ m("span", { className: "citadel-input-segment-word", children: L.name }),
1191
1207
  se < r.size() && me && /* @__PURE__ */ m("span", { className: "citadel-input-segment-space citadel-input-segment-space-command", children: " " })
1192
1208
  ] }, "word-" + L.name);
1193
1209
  });
1194
- return [/* @__PURE__ */ m("div", { className: "citadel-input-segments", "data-testid": "user-input-area", children: R }, x)];
1195
- }, [x, s, r]), [T, b] = _("");
1196
- P(() => {
1197
- const E = d();
1198
- E.type === "argument" ? b(E.name) : b("");
1199
- }, [x, d]);
1200
- const K = !n.isEnteringArg ? "is-command-mode" : "is-argument-mode", ne = A(
1210
+ return [/* @__PURE__ */ m("div", { className: "citadel-input-segments", "data-testid": "user-input-area", children: R }, S)];
1211
+ }, [S, s, r]), [M, E] = _("");
1212
+ I(() => {
1213
+ const N = d();
1214
+ N.type === "argument" ? E(N.name) : E("");
1215
+ }, [S, d]);
1216
+ const O = !t.isEnteringArg ? "is-command-mode" : "is-argument-mode", W = P(
1201
1217
  () => ({
1202
- left: `${v}px`,
1218
+ left: `${k}px`,
1203
1219
  transition: "left 0.05s ease-out"
1204
1220
  }),
1205
- [v]
1206
- ), F = A(
1221
+ [k]
1222
+ ), F = P(
1207
1223
  () => ({
1208
- type: h.cursorType ?? N.cursorType,
1209
- color: h.cursorColor || N.cursorColor,
1210
- speed: h.cursorSpeed || N.cursorSpeed
1224
+ type: h.cursorType ?? x.cursorType,
1225
+ color: h.cursorColor || x.cursorColor,
1226
+ speed: h.cursorSpeed || x.cursorSpeed
1211
1227
  }),
1212
1228
  [h.cursorColor, h.cursorSpeed, h.cursorType]
1213
1229
  );
1214
1230
  return Me(() => {
1215
- const E = y.current, R = t.current;
1216
- if (!E || !R) {
1231
+ const N = C.current, R = n.current;
1232
+ if (!N || !R) {
1217
1233
  l(0);
1218
1234
  return;
1219
1235
  }
1220
- const L = E.getBoundingClientRect().width;
1236
+ const L = N.getBoundingClientRect().width;
1221
1237
  l(Math.max(0, L - R.scrollLeft));
1222
- }, [n.currentInput, K, p.style]), /* @__PURE__ */ m("div", { className: "citadel-input-shell", children: /* @__PURE__ */ I(
1238
+ }, [t.currentInput, O, p.style]), /* @__PURE__ */ m("div", { className: "citadel-input-shell", children: /* @__PURE__ */ A(
1223
1239
  "div",
1224
1240
  {
1225
1241
  className: "citadel-input-line",
1226
1242
  style: p.style,
1227
1243
  children: [
1228
1244
  /* @__PURE__ */ m("div", { className: "citadel-input-prompt", children: ">" }),
1229
- /* @__PURE__ */ I("div", { className: "citadel-input-row", children: [
1245
+ /* @__PURE__ */ A("div", { className: "citadel-input-row", children: [
1230
1246
  H,
1231
- /* @__PURE__ */ I("div", { className: "citadel-input-control", children: [
1247
+ /* @__PURE__ */ A("div", { className: "citadel-input-control", children: [
1232
1248
  /* @__PURE__ */ m(
1233
1249
  "span",
1234
1250
  {
1235
- ref: y,
1236
- className: `citadel-input-measure ${K}`.trim(),
1251
+ ref: C,
1252
+ className: `citadel-input-measure ${O}`.trim(),
1237
1253
  "aria-hidden": "true",
1238
- children: n.currentInput
1254
+ children: t.currentInput
1239
1255
  }
1240
1256
  ),
1241
1257
  /* @__PURE__ */ m(
1242
1258
  "input",
1243
1259
  {
1244
- ref: t,
1260
+ ref: n,
1245
1261
  type: "text",
1246
1262
  role: "textbox",
1247
- value: n.currentInput,
1248
- onChange: M,
1249
- onKeyDown: C,
1250
- onPaste: S,
1263
+ value: t.currentInput,
1264
+ onChange: D,
1265
+ onKeyDown: w,
1266
+ onPaste: v,
1251
1267
  "data-testid": "citadel-command-input",
1252
- className: `citadel-input-field ${K} ${g ? "invalid-input-animation" : ""}`.trim(),
1268
+ className: `citadel-input-field ${O} ${g ? "invalid-input-animation" : ""}`.trim(),
1253
1269
  spellCheck: !1,
1254
1270
  autoComplete: "off",
1255
- placeholder: T
1271
+ placeholder: M
1256
1272
  }
1257
1273
  ),
1258
1274
  /* @__PURE__ */ m(
1259
1275
  "div",
1260
1276
  {
1261
1277
  className: "citadel-input-cursor",
1262
- style: ne,
1263
- children: /* @__PURE__ */ m(Xe, { style: F })
1278
+ style: W,
1279
+ children: /* @__PURE__ */ m(et, { style: F })
1264
1280
  }
1265
1281
  )
1266
1282
  ] })
@@ -1268,37 +1284,37 @@ const tt = () => {
1268
1284
  ]
1269
1285
  }
1270
1286
  ) });
1271
- }, st = ({ currentInput: n = "" }) => {
1272
- const e = Z(), t = j(), s = V(), r = U.useMemo(
1273
- () => ee(t.fontFamily, t.fontSize),
1274
- [t.fontFamily, t.fontSize]
1275
- ), a = n.trim().toLowerCase(), o = e.getMatchingCompletions(
1287
+ }, at = ({ currentInput: t = "" }) => {
1288
+ const e = te(), n = U(), s = J(), r = $.useMemo(
1289
+ () => ne(n.fontFamily, n.fontSize),
1290
+ [n.fontFamily, n.fontSize]
1291
+ ), o = t.trim().toLowerCase(), a = e.getMatchingCompletions(
1276
1292
  s.path(),
1277
- a
1293
+ o
1278
1294
  );
1279
- k.debug("[AvailableCommands] nextCommandSegments: ", o);
1280
- const c = U.useMemo(() => {
1281
- const u = [...o], h = (l) => l.name.toLowerCase() === "help", x = u.filter(h);
1295
+ b.debug("[AvailableCommands] nextCommandSegments: ", a);
1296
+ const c = $.useMemo(() => {
1297
+ const u = [...a], h = (l) => l.name.toLowerCase() === "help", S = u.filter(h);
1282
1298
  return [...u.filter((l) => !h(l)).sort(
1283
1299
  (l, p) => l.name.localeCompare(p.name, void 0, { sensitivity: "base" })
1284
- ), ...x];
1285
- }, [o]), i = U.useMemo(() => {
1300
+ ), ...S];
1301
+ }, [a]), i = $.useMemo(() => {
1286
1302
  const u = /* @__PURE__ */ new Map();
1287
1303
  for (const h of c) {
1288
- const x = c.reduce((y, v) => {
1289
- if (v === h) return y;
1304
+ const S = c.reduce((C, k) => {
1305
+ if (k === h) return C;
1290
1306
  let l = 0;
1291
- for (; l < h.name.length && l < v.name.length && h.name[l].toLowerCase() === v.name[l].toLowerCase(); )
1307
+ for (; l < h.name.length && l < k.name.length && h.name[l].toLowerCase() === k.name[l].toLowerCase(); )
1292
1308
  l++;
1293
- return Math.max(y, l + 1);
1309
+ return Math.max(C, l + 1);
1294
1310
  }, 1);
1295
- u.set(h.name, x);
1311
+ u.set(h.name, S);
1296
1312
  }
1297
1313
  return u;
1298
- }, [c]), d = o.some((u) => u.type === "argument"), g = o[0];
1299
- return /* @__PURE__ */ m("div", { className: "citadel-available-commands", "data-testid": "available-commands", children: /* @__PURE__ */ m("div", { className: "citadel-available-commands-content", style: r.style, children: d ? o.length > 0 ? /* @__PURE__ */ I(He, { children: [
1314
+ }, [c]), d = a.some((u) => u.type === "argument"), g = a[0];
1315
+ return /* @__PURE__ */ m("div", { className: "citadel-available-commands", "data-testid": "available-commands", children: /* @__PURE__ */ m("div", { className: "citadel-available-commands-content", style: r.style, children: d ? a.length > 0 ? /* @__PURE__ */ A(He, { children: [
1300
1316
  /* @__PURE__ */ m("span", { className: "citadel-available-next-arg", children: g.name }),
1301
- g.description && /* @__PURE__ */ I("span", { className: "citadel-available-next-desc", children: [
1317
+ g.description && /* @__PURE__ */ A("span", { className: "citadel-available-next-desc", children: [
1302
1318
  "- ",
1303
1319
  g.description
1304
1320
  ] })
@@ -1309,7 +1325,7 @@ const tt = () => {
1309
1325
  {
1310
1326
  "data-testid": "available-command-chip",
1311
1327
  className: "citadel-available-chip",
1312
- children: /* @__PURE__ */ I("span", { className: "citadel-available-chip-text", children: [
1328
+ children: /* @__PURE__ */ A("span", { className: "citadel-available-chip-text", children: [
1313
1329
  /* @__PURE__ */ m("strong", { className: "citadel-available-chip-prefix", children: u.name.slice(0, h) }),
1314
1330
  u.name.slice(h)
1315
1331
  ] })
@@ -1318,100 +1334,103 @@ const tt = () => {
1318
1334
  );
1319
1335
  }) }) }) });
1320
1336
  }, Ne = ({
1321
- state: n,
1337
+ state: t,
1322
1338
  actions: e,
1323
- outputRef: t
1339
+ outputRef: n
1324
1340
  }) => {
1325
- const r = j().displayMode === "inline", a = U.useMemo(
1341
+ const r = U().displayMode === "inline", o = $.useMemo(
1326
1342
  () => r ? { overflow: "hidden" } : void 0,
1327
1343
  [r]
1328
1344
  );
1329
- return /* @__PURE__ */ I("div", { className: "innerContainer citadel-tty", children: [
1345
+ return /* @__PURE__ */ A("div", { className: "innerContainer citadel-tty", children: [
1330
1346
  /* @__PURE__ */ m(
1331
1347
  "div",
1332
1348
  {
1333
1349
  className: "citadel-tty-output-pane",
1334
1350
  "data-testid": "citadel-output-pane",
1335
- style: a,
1336
- children: /* @__PURE__ */ m(Ge, { output: n.output, outputRef: t })
1351
+ style: o,
1352
+ children: /* @__PURE__ */ m(Xe, { output: t.output, outputRef: n })
1337
1353
  }
1338
1354
  ),
1339
- /* @__PURE__ */ I("div", { className: "citadel-tty-input-region", children: [
1340
- /* @__PURE__ */ m(nt, { state: n, actions: e }),
1341
- /* @__PURE__ */ m(st, { currentInput: n.isEnteringArg ? "" : n.currentInput })
1355
+ /* @__PURE__ */ A("div", { className: "citadel-tty-input-region", children: [
1356
+ /* @__PURE__ */ m(rt, { state: t, actions: e }),
1357
+ /* @__PURE__ */ m(at, { currentInput: t.isEnteringArg ? "" : t.currentInput })
1342
1358
  ] })
1343
1359
  ] });
1344
- }, rt = () => {
1345
- const [n, e] = _(!1), [t, s] = _(!1), r = j(), [a, o] = _(() => r.initialHeight || null), c = z(null), i = z(null), d = z(!1), g = z(0), u = z(0), { state: h, actions: x } = de();
1346
- qe({
1347
- onOpen: () => e(!0),
1348
- onClose: () => s(!0),
1349
- isVisible: n,
1350
- showCitadelKey: r.showCitadelKey || "."
1360
+ }, ot = () => {
1361
+ const t = U(), [e, n] = _(() => t.showOnLoad ?? !1), [s, r] = _(!1), [o, a] = _(() => t.initialHeight || null), c = T(null), i = T(null), d = T(!1), g = T(0), u = T(0), { state: h, actions: S } = de(), C = f(() => {
1362
+ r(!1), n(!0);
1363
+ }, []), k = f(() => {
1364
+ r(!0);
1365
+ }, []);
1366
+ Be({
1367
+ onOpen: C,
1368
+ onClose: k,
1369
+ isVisible: e && !s,
1370
+ showCitadelKey: t.showCitadelKey || ".",
1371
+ closeOnEscape: t.closeOnEscape ?? !0
1351
1372
  });
1352
- const y = w((M) => {
1353
- var b;
1373
+ const l = f((M) => {
1374
+ var W;
1354
1375
  if (!d.current) return;
1355
- const S = M.clientY - g.current, H = (b = r.maxHeight) != null && b.endsWith("vh") ? window.innerHeight * parseInt(r.maxHeight, 10) / 100 : parseInt(r.maxHeight || "80vh", 10), T = Math.min(
1356
- Math.max(u.current - S, parseInt(r.minHeight || "200", 10)),
1357
- H
1376
+ const E = M.clientY - g.current, B = (W = t.maxHeight) != null && W.endsWith("vh") ? window.innerHeight * parseInt(t.maxHeight, 10) / 100 : parseInt(t.maxHeight || "80vh", 10), O = Math.min(
1377
+ Math.max(u.current - E, parseInt(t.minHeight || "200", 10)),
1378
+ B
1358
1379
  );
1359
- i.current && (i.current.style.height = `${T}px`, i.current.style.bottom = "0", o(`${T}px`));
1360
- }, [r.maxHeight, r.minHeight]), v = w(() => {
1361
- d.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", v);
1362
- }, [y]), l = w((M) => {
1363
- i.current && (d.current = !0, g.current = M.clientY, u.current = i.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", y), document.addEventListener("mouseup", v));
1364
- }, [y, v]);
1365
- P(() => () => {
1366
- document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", v);
1367
- }, [y, v]);
1368
- const p = w(() => {
1369
- t && (e(!1), s(!1));
1370
- }, [t]);
1371
- Be({
1372
- isVisible: n,
1373
- isClosing: t,
1374
- onAnimationComplete: p
1375
- });
1376
- const C = A(
1380
+ i.current && (i.current.style.height = `${O}px`, i.current.style.bottom = "0", a(`${O}px`));
1381
+ }, [t.maxHeight, t.minHeight]), p = f(() => {
1382
+ d.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", p);
1383
+ }, [l]), w = f((M) => {
1384
+ i.current && (d.current = !0, g.current = M.clientY, u.current = i.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", l), document.addEventListener("mouseup", p));
1385
+ }, [l, p]);
1386
+ I(() => () => {
1387
+ document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", p);
1388
+ }, [l, p]);
1389
+ const D = f(() => {
1390
+ s && (n(!1), r(!1));
1391
+ }, [s]), { animationClass: v } = Ye({
1392
+ isVisible: e,
1393
+ isClosing: s,
1394
+ onAnimationComplete: D
1395
+ }), H = P(
1377
1396
  () => ({
1378
- ...a ? { height: a } : {},
1379
- maxHeight: r.maxHeight
1397
+ ...o ? { height: o } : {},
1398
+ maxHeight: t.maxHeight
1380
1399
  }),
1381
- [r.maxHeight, a]
1400
+ [t.maxHeight, o]
1382
1401
  );
1383
- return n ? /* @__PURE__ */ I(
1402
+ return e ? /* @__PURE__ */ A(
1384
1403
  "div",
1385
1404
  {
1386
1405
  ref: i,
1387
- className: `panelContainer ${n ? "citadel_slideUp" : ""} ${t ? "citadel_slideDown" : ""}`,
1388
- style: C,
1406
+ className: `panelContainer ${v}`.trim(),
1407
+ style: H,
1389
1408
  children: [
1390
- /* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: l }),
1409
+ /* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: w }),
1391
1410
  /* @__PURE__ */ m(
1392
1411
  Ne,
1393
1412
  {
1394
1413
  state: h,
1395
- actions: x,
1414
+ actions: S,
1396
1415
  outputRef: c
1397
1416
  }
1398
1417
  )
1399
1418
  ]
1400
1419
  }
1401
1420
  ) : null;
1402
- }, ae = (n) => {
1403
- if (!n) return;
1404
- const e = n.trim();
1421
+ }, ae = (t) => {
1422
+ if (!t) return;
1423
+ const e = t.trim();
1405
1424
  if (e)
1406
1425
  return /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e;
1407
- }, at = () => {
1408
- const { state: n, actions: e } = de(), t = j(), s = z(null), r = A(
1426
+ }, it = () => {
1427
+ const { state: t, actions: e } = de(), n = U(), s = T(null), r = P(
1409
1428
  () => ({
1410
- height: ae(t.initialHeight),
1411
- maxHeight: ae(t.maxHeight),
1412
- minHeight: ae(t.minHeight)
1429
+ height: ae(n.initialHeight),
1430
+ maxHeight: ae(n.maxHeight),
1431
+ minHeight: ae(n.minHeight)
1413
1432
  }),
1414
- [t.initialHeight, t.maxHeight, t.minHeight]
1433
+ [n.initialHeight, n.maxHeight, n.minHeight]
1415
1434
  );
1416
1435
  return /* @__PURE__ */ m(
1417
1436
  "div",
@@ -1422,7 +1441,7 @@ const tt = () => {
1422
1441
  children: /* @__PURE__ */ m(
1423
1442
  Ne,
1424
1443
  {
1425
- state: n,
1444
+ state: t,
1426
1445
  actions: e,
1427
1446
  outputRef: s
1428
1447
  }
@@ -1443,6 +1462,10 @@ const tt = () => {
1443
1462
  --citadel-min-height: 200px;
1444
1463
  --citadel-max-height: 80vh;
1445
1464
  --citadel-default-height: 35vh;
1465
+ --citadel-panel-enter-duration: 200ms;
1466
+ --citadel-panel-exit-duration: 200ms;
1467
+ --citadel-panel-enter-easing: cubic-bezier(0.16, 1, 0.3, 1);
1468
+ --citadel-panel-exit-easing: cubic-bezier(0.4, 0, 1, 1);
1446
1469
 
1447
1470
  display: block;
1448
1471
  pointer-events: auto;
@@ -1502,6 +1525,8 @@ const tt = () => {
1502
1525
  padding: 0;
1503
1526
  background-color: var(--citadel-bg);
1504
1527
  overflow: hidden;
1528
+ transform: translateY(0);
1529
+ will-change: transform;
1505
1530
  }
1506
1531
 
1507
1532
  .innerContainer {
@@ -1569,11 +1594,18 @@ const tt = () => {
1569
1594
  }
1570
1595
 
1571
1596
  .citadel_slideUp {
1572
- animation: citadel_slideUp 0.2s ease-out forwards;
1597
+ animation: citadel_slideUp var(--citadel-panel-enter-duration) var(--citadel-panel-enter-easing) forwards;
1573
1598
  }
1574
1599
 
1575
1600
  .citadel_slideDown {
1576
- animation: citadel_slideDown 0.2s ease-out forwards;
1601
+ animation: citadel_slideDown var(--citadel-panel-exit-duration) var(--citadel-panel-exit-easing) forwards;
1602
+ }
1603
+
1604
+ @media (prefers-reduced-motion: reduce) {
1605
+ :host {
1606
+ --citadel-panel-enter-duration: 1ms;
1607
+ --citadel-panel-exit-duration: 1ms;
1608
+ }
1577
1609
  }
1578
1610
 
1579
1611
  .inlineContainer {
@@ -1888,18 +1920,18 @@ const tt = () => {
1888
1920
  object-fit: contain;
1889
1921
  border-radius: 0.5rem;
1890
1922
  }
1891
- `, wt = ({
1892
- config: n = N,
1923
+ `, vt = ({
1924
+ config: t = x,
1893
1925
  commandRegistry: e,
1894
- containerId: t = null
1926
+ containerId: n = null
1895
1927
  }) => {
1896
- const s = z(new X()), r = e ?? s.current, a = z(null), o = A(() => ({ width: "100%", height: "100%" }), []), c = n.displayMode ?? N.displayMode ?? "panel";
1897
- return P(() => {
1898
- k.configure({
1899
- level: n.logLevel || N.logLevel || ie.ERROR,
1928
+ const s = T(new ee()), r = e ?? s.current, o = T(null), a = P(() => ({ width: "100%", height: "100%" }), []), c = t.displayMode ?? x.displayMode ?? "panel";
1929
+ return I(() => {
1930
+ b.configure({
1931
+ level: t.logLevel || x.logLevel || ie.ERROR,
1900
1932
  prefix: "[Citadel]"
1901
1933
  });
1902
- const i = new Ie(r, n), d = c === "inline" && !t, g = d ? a.current : t ? document.getElementById(t) : document.body;
1934
+ const i = new Ae(r, t), d = c === "inline" && !n, g = d ? o.current : n ? document.getElementById(n) : document.body;
1903
1935
  if (g)
1904
1936
  g.appendChild(i);
1905
1937
  else {
@@ -1907,31 +1939,31 @@ const tt = () => {
1907
1939
  console.warn("[Citadel] No host available for inline mode; skipping mount.");
1908
1940
  return;
1909
1941
  }
1910
- console.warn(`Container with id "${t}" not found, falling back to body`), document.body.appendChild(i);
1942
+ console.warn(`Container with id "${n}" not found, falling back to body`), document.body.appendChild(i);
1911
1943
  }
1912
1944
  return () => {
1913
1945
  var u;
1914
1946
  (u = i.parentElement) == null || u.removeChild(i);
1915
1947
  };
1916
- }, [r, t, n, c]), c === "inline" && !t ? /* @__PURE__ */ m("div", { ref: a, style: o }) : null;
1948
+ }, [r, n, t, c]), c === "inline" && !n ? /* @__PURE__ */ m("div", { ref: o, style: a }) : null;
1917
1949
  };
1918
- class Ie extends HTMLElement {
1919
- constructor(t, s) {
1920
- var a;
1950
+ class Ae extends HTMLElement {
1951
+ constructor(n, s) {
1952
+ var o;
1921
1953
  super();
1922
- f(this, "shadow");
1923
- f(this, "root", null);
1924
- f(this, "commandRegistry");
1925
- f(this, "config");
1926
- this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry = t, this.config = s;
1927
- const r = ((a = this.config) == null ? void 0 : a.displayMode) ?? "panel";
1954
+ y(this, "shadow");
1955
+ y(this, "root", null);
1956
+ y(this, "commandRegistry");
1957
+ y(this, "config");
1958
+ this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry = n, this.config = s;
1959
+ const r = ((o = this.config) == null ? void 0 : o.displayMode) ?? "panel";
1928
1960
  this.setAttribute("data-display-mode", r);
1929
1961
  }
1930
1962
  connectedCallback() {
1931
1963
  try {
1932
1964
  const s = [ye].map((r) => {
1933
- const a = new CSSStyleSheet();
1934
- return a.replaceSync(r), a;
1965
+ const o = new CSSStyleSheet();
1966
+ return o.replaceSync(r), o;
1935
1967
  });
1936
1968
  this.shadow.adoptedStyleSheets = [...s];
1937
1969
  } catch {
@@ -1939,27 +1971,27 @@ class Ie extends HTMLElement {
1939
1971
  `), r = document.createElement("style");
1940
1972
  r.textContent = s, this.shadow.appendChild(r);
1941
1973
  }
1942
- const t = document.createElement("div");
1943
- t.id = "citadel-root", t.style.width = "100%", t.style.height = "100%", this.shadow.appendChild(t), this.root = Te(t), this.root.render(
1944
- /* @__PURE__ */ m(We, { config: this.config || N, commandRegistry: this.commandRegistry, children: /* @__PURE__ */ m(ot, {}) })
1974
+ const n = document.createElement("div");
1975
+ n.id = "citadel-root", n.style.width = "100%", n.style.height = "100%", this.shadow.appendChild(n), this.root = Te(n), this.root.render(
1976
+ /* @__PURE__ */ m(We, { config: this.config || x, commandRegistry: this.commandRegistry, children: /* @__PURE__ */ m(ct, {}) })
1945
1977
  );
1946
1978
  }
1947
1979
  disconnectedCallback() {
1948
- const t = this.root;
1949
- if (this.root = null, !t) {
1980
+ const n = this.root;
1981
+ if (this.root = null, !n) {
1950
1982
  this.shadow.replaceChildren();
1951
1983
  return;
1952
1984
  }
1953
1985
  queueMicrotask(() => {
1954
- t.unmount(), this.shadow.replaceChildren();
1986
+ n.unmount(), this.shadow.replaceChildren();
1955
1987
  });
1956
1988
  }
1957
1989
  }
1958
- typeof window < "u" && window.customElements && !window.customElements.get("citadel-element") && window.customElements.define("citadel-element", Ie);
1959
- const ot = () => (j().displayMode ?? "panel") === "inline" ? /* @__PURE__ */ m(at, {}) : /* @__PURE__ */ m(rt, {});
1960
- class it {
1990
+ typeof window < "u" && window.customElements && !window.customElements.get("citadel-element") && window.customElements.define("citadel-element", Ae);
1991
+ const ct = () => (U().displayMode ?? "panel") === "inline" ? /* @__PURE__ */ m(it, {}) : /* @__PURE__ */ m(ot, {});
1992
+ class lt {
1961
1993
  constructor() {
1962
- f(this, "_description");
1994
+ y(this, "_description");
1963
1995
  }
1964
1996
  describe(e) {
1965
1997
  return this._description = e, this;
@@ -1968,13 +2000,13 @@ class it {
1968
2000
  return this._description;
1969
2001
  }
1970
2002
  }
1971
- class ct {
2003
+ class dt {
1972
2004
  constructor(e) {
1973
- f(this, "state");
2005
+ y(this, "state");
1974
2006
  this.state = {
1975
2007
  path: e,
1976
2008
  description: "",
1977
- segments: lt(e)
2009
+ segments: mt(e)
1978
2010
  };
1979
2011
  }
1980
2012
  describe(e) {
@@ -1983,9 +2015,9 @@ class ct {
1983
2015
  details(e) {
1984
2016
  return this.state.details = e, this;
1985
2017
  }
1986
- arg(e, t) {
1987
- const s = new it();
1988
- return t == null || t(s), this.state.segments.push({
2018
+ arg(e, n) {
2019
+ const s = new lt();
2020
+ return n == null || n(s), this.state.segments.push({
1989
2021
  type: "argument",
1990
2022
  name: e,
1991
2023
  description: s.description
@@ -2001,85 +2033,90 @@ class ct {
2001
2033
  };
2002
2034
  }
2003
2035
  }
2004
- function lt(n) {
2005
- const e = n.trim();
2036
+ function mt(t) {
2037
+ const e = t.trim();
2006
2038
  if (!e)
2007
2039
  throw new Error("Command path cannot be empty");
2008
- const t = e.split(".");
2009
- if (t.some((s) => s.trim() === ""))
2010
- throw new Error(`Invalid command path "${n}". Empty segments are not allowed.`);
2011
- if (t.some((s) => s.includes(" ")))
2040
+ const n = e.split(".");
2041
+ if (n.some((s) => s.trim() === ""))
2042
+ throw new Error(`Invalid command path "${t}". Empty segments are not allowed.`);
2043
+ if (n.some((s) => s.includes(" ")))
2012
2044
  throw new Error(
2013
- `Invalid command path "${n}". Use dot-delimited words (e.g. "user.show").`
2045
+ `Invalid command path "${t}". Use dot-delimited words (e.g. "user.show").`
2014
2046
  );
2015
- return t.map((s) => ({
2047
+ return n.map((s) => ({
2016
2048
  type: "word",
2017
2049
  name: s
2018
2050
  }));
2019
2051
  }
2020
- function dt(n) {
2021
- return n.flatMap((e) => e.type === "argument" ? [e.name] : []);
2052
+ function ut(t) {
2053
+ return t.flatMap((e) => e.type === "argument" ? [e.name] : []);
2022
2054
  }
2023
- function mt(n) {
2024
- const e = dt(n.segments);
2025
- return async (t) => {
2026
- const s = e.reduce((r, a, o) => (r[a] = t[o], r), {});
2055
+ function pt(t) {
2056
+ const e = ut(t.segments);
2057
+ return async (n) => {
2058
+ const s = e.reduce((r, o, a) => (r[o] = n[a], r), {});
2027
2059
  return Promise.resolve(
2028
- n.handler({
2029
- rawArgs: t,
2060
+ t.handler({
2061
+ rawArgs: n,
2030
2062
  namedArgs: s,
2031
- commandPath: n.path
2063
+ commandPath: t.path
2032
2064
  })
2033
2065
  );
2034
2066
  };
2035
2067
  }
2036
- function Ct(n) {
2037
- return new ct(n);
2068
+ function St(t) {
2069
+ return new dt(t);
2038
2070
  }
2039
- function ut(n, e) {
2040
- n.addCommand(
2071
+ function ht(t, e) {
2072
+ t.addCommand(
2041
2073
  e.segments,
2042
2074
  e.description,
2043
- mt(e)
2075
+ pt(e)
2044
2076
  );
2045
2077
  }
2046
- function pt(n, e) {
2047
- return e.forEach((t) => ut(n, t)), n;
2078
+ function gt(t, e) {
2079
+ return e.forEach((n) => ht(t, n)), t;
2080
+ }
2081
+ function xt(t) {
2082
+ const e = new ee();
2083
+ return gt(e, t);
2048
2084
  }
2049
- function vt(n) {
2050
- const e = new X();
2051
- return pt(e, n);
2085
+ function bt(t) {
2086
+ return new G(t);
2052
2087
  }
2053
- function St(n) {
2054
- return new Y(n);
2088
+ function kt(t, e = "true", n = "false") {
2089
+ return new De(t, e, n);
2055
2090
  }
2056
- function xt(n) {
2057
- return new ze(n);
2091
+ function Et(t) {
2092
+ return new ze(t);
2058
2093
  }
2059
- function bt(n, e = "") {
2060
- return new Fe(n, e);
2094
+ function Nt(t, e = "") {
2095
+ return new Fe(t, e);
2061
2096
  }
2062
- function kt(n) {
2063
- return new we(n);
2097
+ function At(t) {
2098
+ return new we(t);
2064
2099
  }
2065
2100
  export {
2066
- wt as Citadel,
2067
- X as CommandRegistry,
2068
- W as CommandResult,
2069
- q as CommandStatus,
2070
- Qe as DEFAULT_CURSOR_CONFIGS,
2101
+ De as BooleanCommandResult,
2102
+ vt as Citadel,
2103
+ ee as CommandRegistry,
2104
+ K as CommandResult,
2105
+ V as CommandStatus,
2106
+ Ze as DEFAULT_CURSOR_CONFIGS,
2071
2107
  we as ErrorCommandResult,
2072
2108
  Fe as ImageCommandResult,
2073
2109
  ze as JsonCommandResult,
2074
2110
  oe as OutputItem,
2075
- De as PendingCommandResult,
2076
- Y as TextCommandResult,
2077
- Ct as command,
2078
- vt as createCommandRegistry,
2079
- kt as error,
2080
- bt as image,
2081
- xt as json,
2082
- ut as registerCommand,
2083
- pt as registerCommands,
2084
- St as text
2111
+ Oe as PendingCommandResult,
2112
+ G as TextCommandResult,
2113
+ kt as bool,
2114
+ St as command,
2115
+ xt as createCommandRegistry,
2116
+ At as error,
2117
+ Nt as image,
2118
+ Et as json,
2119
+ ht as registerCommand,
2120
+ gt as registerCommands,
2121
+ bt as text
2085
2122
  };