citadel_cli 1.3.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 Ne = Object.defineProperty;
2
- var ze = (t, e, n) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var b = (t, e, n) => ze(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { jsx as m, jsxs as E, Fragment as Ae } from "react/jsx-runtime";
5
- import L, { createContext as _e, useState as I, useMemo as M, useEffect as z, useContext as J, useCallback as v, useReducer as Ie, useRef as F } from "react";
6
- import { createRoot as Re } from "react-dom/client";
7
- var W = /* @__PURE__ */ ((t) => (t.Pending = "pending", t.Success = "success", t.Failure = "failure", t.Timeout = "timeout", t))(W || {});
8
- class O {
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
+ import { createRoot as Te } from "react-dom/client";
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
- b(this, "_status", "pending");
10
+ y(this, "_status", "pending");
11
11
  this.timestamp = e;
12
12
  }
13
13
  get status() {
@@ -23,80 +23,88 @@ class O {
23
23
  this._status = "timeout";
24
24
  }
25
25
  }
26
- class Pe extends O {
26
+ class ze extends K {
27
27
  constructor(e, n) {
28
28
  super(n), this.data = e;
29
29
  }
30
30
  render() {
31
- return /* @__PURE__ */ m("pre", { className: "text-gray-200", children: JSON.stringify(this.data, null, 2) });
31
+ return /* @__PURE__ */ m("pre", { className: "citadel-result-json", children: JSON.stringify(this.data, null, 2) });
32
32
  }
33
33
  }
34
- class Y extends O {
34
+ class G extends K {
35
35
  constructor(e, n) {
36
36
  super(n), this.text = e;
37
37
  }
38
38
  render() {
39
- return /* @__PURE__ */ m("div", { className: "text-gray-200 whitespace-pre", children: this.text });
39
+ return /* @__PURE__ */ m("div", { className: "citadel-result-text", children: this.text });
40
40
  }
41
41
  }
42
- class fe extends O {
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 {
43
51
  constructor(e, n) {
44
52
  super(n), this.error = e, this.markFailure();
45
53
  }
46
54
  render() {
47
- return /* @__PURE__ */ m("div", { className: "mt-1 text-red-400", children: this.error });
55
+ return /* @__PURE__ */ m("div", { className: "citadel-result-error", children: this.error });
48
56
  }
49
57
  }
50
- class He extends O {
58
+ class Oe extends K {
51
59
  render() {
52
- return /* @__PURE__ */ m("div", { className: "text-gray-400", children: "..." });
60
+ return /* @__PURE__ */ m("div", { className: "citadel-result-pending", children: "..." });
53
61
  }
54
62
  }
55
- class Me extends O {
56
- constructor(e, n = "", r) {
57
- super(r), this.imageUrl = e, this.altText = n;
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
- return /* @__PURE__ */ m("div", { className: "my-2", children: /* @__PURE__ */ m(
68
+ return /* @__PURE__ */ m("div", { className: "citadel-result-image-wrap", children: /* @__PURE__ */ m(
61
69
  "img",
62
70
  {
63
71
  src: this.imageUrl,
64
72
  alt: this.altText,
65
- className: "max-w-[400px] max-h-[300px] h-auto rounded-lg object-contain"
73
+ className: "citadel-result-image"
66
74
  }
67
75
  ) });
68
76
  }
69
77
  }
70
- const Te = (t) => async function() {
71
- const n = t.commands.filter((r) => r.fullPath[0] !== "help").map((r) => {
72
- const s = `${r.segments.map((l) => l.type === "argument" ? `<${l.name}>` : l.name).join(" ")} - ${r.description}`, i = r.segments.filter((l) => l.type === "argument" && l.description).map((l) => ` <${l.name}>: ${l.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: s,
75
- argumentLines: i
82
+ commandLine: o,
83
+ argumentLines: a
76
84
  };
77
- }).sort((r, o) => r.commandLine.localeCompare(o.commandLine)).flatMap((r) => [
78
- r.commandLine,
79
- ...r.argumentLines
85
+ }).sort((s, r) => s.commandLine.localeCompare(r.commandLine)).flatMap((s) => [
86
+ s.commandLine,
87
+ ...s.argumentLines
80
88
  ]);
81
- return n.length === 0 ? new Y(
89
+ return n.length === 0 ? new G(
82
90
  "No commands available yet. Add some commands to get started!"
83
- ) : (n.push("help - Show available commands"), new Y(
91
+ ) : (n.push("help - Show available commands"), new G(
84
92
  `Available Commands:
85
93
  ` + n.join(`
86
94
  `)
87
95
  ));
88
96
  };
89
- var re = /* @__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))(re || {});
90
- const ie = !0;
91
- class k {
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 || {});
98
+ const ue = !0;
99
+ class b {
92
100
  static configure(e) {
93
101
  this.level = e.level, this.prefix = e.prefix || "[Citadel]";
94
102
  }
95
103
  static trace(...e) {
96
- this.level >= 5 && !ie && console.trace(this.prefix, ...e);
104
+ this.level >= 5 && !ue && console.trace(this.prefix, ...e);
97
105
  }
98
106
  static debug(...e) {
99
- this.level >= 4 && !ie && console.debug(this.prefix, ...e);
107
+ this.level >= 4 && !ue && console.debug(this.prefix, ...e);
100
108
  }
101
109
  static info(...e) {
102
110
  this.level >= 3 && console.info(this.prefix, ...e);
@@ -108,8 +116,8 @@ class k {
108
116
  this.level >= 1 && console.error(this.prefix, ...e);
109
117
  }
110
118
  }
111
- b(k, "level", 0), b(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,
@@ -117,63 +125,65 @@ const N = {
117
125
  includeHelpCommand: !0,
118
126
  fontFamily: "monospace",
119
127
  fontSize: "0.875rem",
120
- initialHeight: "40vh",
121
- logLevel: re.ERROR,
128
+ initialHeight: "50vh",
129
+ logLevel: ie.ERROR,
122
130
  maxHeight: "80vh",
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
- }, we = async () => new Y("");
133
- class oe {
134
- constructor(e, n, r) {
135
- this.type = e, this.name = n, this.description = r;
142
+ }, Ce = async () => new G("");
143
+ class ce {
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;
139
149
  }
140
150
  }
141
- class se extends oe {
151
+ class le extends ce {
142
152
  constructor() {
143
153
  super("null", ">null<", "Empty segment");
144
154
  }
145
155
  }
146
- class ye extends oe {
156
+ class ve extends ce {
147
157
  constructor(e, n) {
148
158
  super("word", e, n);
149
159
  }
150
160
  }
151
- class $ extends oe {
152
- constructor(e, n, r, o) {
153
- super("argument", e, n), this.value = r, this.valid = o;
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 Fe = (t) => {
166
+ const je = (t) => {
157
167
  if (t.type === "word")
158
- return new ye(t.name, t.description);
168
+ return new ve(t.name, t.description);
159
169
  if (t.type === "argument") {
160
170
  const e = t;
161
- return new $(
171
+ return new q(
162
172
  e.name,
163
173
  e.description,
164
174
  e.value,
165
175
  e.valid
166
176
  );
167
177
  }
168
- return new se();
169
- }, H = (t) => t.map((e) => Fe(e));
170
- class De {
171
- constructor(e, n, r = we) {
172
- b(this, "_segments");
173
- b(this, "_description");
178
+ return new le();
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
- b(this, "_handler");
176
- this._segments = e, this._description = n, this._handler = r;
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 De {
197
207
  return this.fullPath.join(" ") === e.fullPath.join(" ");
198
208
  }
199
209
  }
200
- class X {
210
+ class ee {
201
211
  constructor() {
202
- b(this, "_commands", []);
212
+ y(this, "_commands", []);
203
213
  }
204
214
  get commands() {
205
215
  return this._commands;
@@ -215,20 +225,20 @@ 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, n, r = we) {
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 o = new De(e, n, r), s = this._commands.find((i) => {
222
- const l = i.segments.map(
223
- (c) => c.type === "argument" ? "*" : c.name
224
- ).join(" "), a = e.map(
225
- (c) => c.type === "argument" ? "*" : c.name
231
+ const r = new Ue(e, n, s), o = this._commands.find((a) => {
232
+ const c = a.segments.map(
233
+ (d) => d.type === "argument" ? "*" : d.name
234
+ ).join(" "), i = e.map(
235
+ (d) => d.type === "argument" ? "*" : d.name
226
236
  ).join(" ");
227
- return l === a;
237
+ return c === i;
228
238
  });
229
- if (s)
230
- throw new Error(`Duplicate commands: '${s.fullPath_s}' and '${o.fullPath_s}'`);
231
- this._commands.push(o);
239
+ if (o)
240
+ throw new Error(`Duplicate commands: '${o.fullPath_s}' and '${r.fullPath_s}'`);
241
+ this._commands.push(r);
232
242
  }
233
243
  /**
234
244
  * Removes a command that exactly matches the provided path.
@@ -237,8 +247,8 @@ class X {
237
247
  * @returns True if a command was removed; otherwise false.
238
248
  */
239
249
  removeCommand(e) {
240
- const n = e.join(" "), r = this._commands.findIndex((o) => o.fullPath.join(" ") === n);
241
- return r === -1 ? !1 : (this._commands.splice(r, 1), !0);
250
+ const n = e.join(" "), s = this._commands.findIndex((r) => r.fullPath.join(" ") === n);
251
+ return s === -1 ? !1 : (this._commands.splice(s, 1), !0);
242
252
  }
243
253
  /**
244
254
  * Retrieves a command from the registry for the given path.
@@ -248,25 +258,25 @@ class X {
248
258
  */
249
259
  getCommand(e) {
250
260
  return this._commands.find((n) => {
251
- const r = n.fullPath.join(" "), o = e.join(" ");
252
- if (r === o)
261
+ const s = n.fullPath.join(" "), r = e.join(" ");
262
+ if (s === r)
253
263
  return !0;
254
- const i = n.segments.filter((l) => l.type === "word").map((l) => l.name);
255
- return i.length === e.length && i.join(" ") === o;
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
269
  const n = this._commands.map(
260
- (o) => o.segments.map(
261
- (s) => s.type === "argument" ? "*" : s.name
270
+ (r) => r.segments.map(
271
+ (o) => o.type === "argument" ? "*" : o.name
262
272
  ).join(" ")
263
- ), r = e.map((o, s) => this._commands.some(
264
- (l) => {
265
- var a;
266
- return ((a = l.segments[s]) == null ? void 0 : a.type) === "argument";
273
+ ), s = e.map((r, o) => this._commands.some(
274
+ (c) => {
275
+ var i;
276
+ return ((i = c.segments[o]) == null ? void 0 : i.type) === "argument";
267
277
  }
268
- ) ? "*" : o).join(" ");
269
- return n.includes(r);
278
+ ) ? "*" : r).join(" ");
279
+ return n.includes(s);
270
280
  }
271
281
  /**
272
282
  * Gets possible matches for a given path.
@@ -282,19 +292,19 @@ class X {
282
292
  * Matching is case-insensitive.
283
293
  */
284
294
  getMatchingCompletions(e, n) {
285
- const r = n.trim().toLowerCase(), o = this.getCompletions(e);
286
- return r ? o.filter(
287
- (s) => s.name.toLowerCase().startsWith(r)
288
- ) : o;
295
+ const s = n.trim().toLowerCase(), r = this.getCompletions(e);
296
+ return s ? r.filter(
297
+ (o) => o.name.toLowerCase().startsWith(s)
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
304
  getUniqueCompletion(e, n) {
295
- const r = this.getMatchingCompletions(e, n);
296
- if (r.length === 1)
297
- return r[0];
305
+ const s = this.getMatchingCompletions(e, n);
306
+ if (s.length === 1)
307
+ return s[0];
298
308
  }
299
309
  /**
300
310
  * Gets an array of segments reachable from a given path
@@ -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 s = this._commands.map((a) => a.segments[0]), i = (a, c) => a.type === c.type && a.name === c.name;
308
- return s.filter(
309
- (a, c, g) => c === g.findIndex((f) => i(f, a))
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
322
  const n = e.length;
313
- return this._commands.filter((s) => {
314
- const i = s.segments;
315
- if (i.length <= n - 1)
323
+ return this._commands.filter((o) => {
324
+ const a = o.segments;
325
+ if (a.length <= n - 1)
316
326
  return !1;
317
- for (let l = 0; l < n; l++) {
318
- const a = e[l], c = i[l];
319
- if (!(a === "*" && c.type === "argument") && a !== c.name)
327
+ for (let c = 0; c < n; c++) {
328
+ const i = e[c], d = a[c];
329
+ if (!(i === "*" && d.type === "argument") && i !== d.name)
320
330
  return !1;
321
331
  }
322
332
  return !0;
323
- }).filter((s) => s.segments.length > n).map((s) => {
324
- const i = s.segments[n], l = i.type === "argument" ? $ : ye;
325
- return new l(i.name, i.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
- (s, i, l) => i === l.findIndex(
328
- (a) => a.type === s.type && a.name === s.name
337
+ (o, a, c) => a === c.findIndex(
338
+ (i) => i.type === o.type && i.name === o.name
329
339
  )
330
340
  );
331
341
  }
@@ -333,9 +343,9 @@ class X {
333
343
  return this.getCompletions(e).length > 0;
334
344
  }
335
345
  }
336
- class be {
346
+ class Se {
337
347
  constructor(e) {
338
- b(this, "config");
348
+ y(this, "config");
339
349
  this.config = {
340
350
  type: "localStorage",
341
351
  maxCommands: 100,
@@ -352,17 +362,17 @@ class be {
352
362
  await this.saveCommands(n);
353
363
  }
354
364
  }
355
- class Ue extends be {
365
+ class $e extends Se {
356
366
  constructor(n) {
357
367
  super(n);
358
- b(this, "storageKey", "citadel_command_history");
368
+ y(this, "storageKey", "citadel_command_history");
359
369
  }
360
370
  async getStoredCommands() {
361
371
  try {
362
372
  const n = window.localStorage.getItem(this.storageKey);
363
- return n ? JSON.parse(n).map((o) => ({
364
- commandSegments: Array.isArray(o.commandSegments) ? H(o.commandSegments) : [],
365
- timestamp: o.timestamp
373
+ return n ? JSON.parse(n).map((r) => ({
374
+ commandSegments: Array.isArray(r.commandSegments) ? z(r.commandSegments) : [],
375
+ timestamp: r.timestamp
366
376
  })) : [];
367
377
  } catch (n) {
368
378
  return console.warn("Failed to load commands from localStorage:", n), [];
@@ -377,29 +387,29 @@ class Ue extends be {
377
387
  }
378
388
  async saveCommands(n) {
379
389
  try {
380
- const r = n.map((o) => ({
381
- commandSegments: Array.isArray(o.commandSegments) ? H(o.commandSegments).map((s) => ({
382
- type: s.type,
383
- name: s.name,
384
- description: s.description,
385
- ...s instanceof $ ? { value: s.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
- timestamp: o.timestamp
397
+ timestamp: r.timestamp
388
398
  }));
389
- window.localStorage.setItem(this.storageKey, JSON.stringify(r));
390
- } catch (r) {
391
- throw console.warn("Failed to save commands to localStorage:", r), r;
399
+ window.localStorage.setItem(this.storageKey, JSON.stringify(s));
400
+ } catch (s) {
401
+ throw console.warn("Failed to save commands to localStorage:", s), s;
392
402
  }
393
403
  }
394
404
  }
395
- class le extends be {
405
+ class pe extends Se {
396
406
  constructor(n) {
397
407
  super(n);
398
- b(this, "storedCommands", []);
408
+ y(this, "storedCommands", []);
399
409
  }
400
410
  async getStoredCommands() {
401
411
  return this.storedCommands.map((n) => ({
402
- commandSegments: Array.isArray(n.commandSegments) ? H(n.commandSegments) : [],
412
+ commandSegments: Array.isArray(n.commandSegments) ? z(n.commandSegments) : [],
403
413
  timestamp: n.timestamp
404
414
  }));
405
415
  }
@@ -407,27 +417,27 @@ class le extends be {
407
417
  this.storedCommands = [];
408
418
  }
409
419
  async saveCommands(n) {
410
- this.storedCommands = n.map((r) => ({
411
- commandSegments: Array.isArray(r.commandSegments) ? H(r.commandSegments) : [],
412
- timestamp: r.timestamp
420
+ this.storedCommands = n.map((s) => ({
421
+ commandSegments: Array.isArray(s.commandSegments) ? z(s.commandSegments) : [],
422
+ timestamp: s.timestamp
413
423
  }));
414
424
  }
415
425
  }
416
- const U = class U {
426
+ const j = class j {
417
427
  constructor() {
418
- b(this, "currentStorage");
428
+ y(this, "currentStorage");
419
429
  }
420
430
  static reset() {
421
- U.instance = void 0;
431
+ j.instance = void 0;
422
432
  }
423
433
  static getInstance() {
424
- return U.instance || (U.instance = new U()), U.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 le(e) : this.currentStorage = new Ue(e);
438
+ e.type === "memory" ? this.currentStorage = new pe(e) : this.currentStorage = new $e(e);
429
439
  } catch (n) {
430
- console.warn("Failed to create storage, falling back to memory storage:", n), this.currentStorage = new le(e);
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,13 +446,13 @@ const U = class U {
436
446
  return this.currentStorage;
437
447
  }
438
448
  };
439
- b(U, "instance");
440
- let V = U;
449
+ y(j, "instance");
450
+ let Q = j;
441
451
  class xe {
442
452
  constructor() {
443
- b(this, "segments", []);
444
- b(this, "nullSegment", new se());
445
- b(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);
@@ -525,420 +535,417 @@ class xe {
525
535
  return [...this.segments];
526
536
  }
527
537
  }
528
- const je = {
529
- config: N,
530
- commands: new X(),
538
+ const Ke = {
539
+ config: x,
540
+ commands: new ee(),
531
541
  segmentStack: new xe()
532
- }, q = _e(je), Le = ({ config: t = N, commandRegistry: e, children: n }) => {
533
- const [r, o] = L.useState(), [s] = I(() => new xe()), i = M(() => ({
534
- ...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,
535
545
  ...t,
536
546
  // Ensure nested objects are properly merged
537
547
  storage: {
538
- ...N.storage,
548
+ ...x.storage,
539
549
  ...t.storage
540
550
  },
541
551
  // Ensure explicit values from config take precedence
542
- cursorType: t.cursorType ?? N.cursorType,
543
- cursorColor: t.cursorColor ?? N.cursorColor,
544
- cursorSpeed: t.cursorSpeed ?? N.cursorSpeed,
545
- showCitadelKey: t.showCitadelKey || "."
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
546
558
  }), [t]);
547
- z(() => {
548
- V.getInstance().initializeStorage(
549
- i.storage ?? N.storage
550
- ), o(V.getInstance().getStorage());
551
- }, [i.storage]), z(() => {
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 (i.includeHelpCommand) {
565
+ if (a.includeHelpCommand) {
554
566
  if (!e.commandExistsForPath(["help"])) {
555
- const a = Te(e);
567
+ const i = Le(e);
556
568
  e.addCommand(
557
569
  [{ type: "word", name: "help" }],
558
570
  "Show available commands",
559
- a
571
+ i
560
572
  );
561
573
  }
562
574
  return;
563
575
  }
564
576
  e.removeCommand(["help"]);
565
577
  }
566
- }, [e, i.includeHelpCommand]);
567
- const l = M(() => ({
568
- config: i,
569
- commands: e || new X(),
570
- storage: r,
571
- segmentStack: s
572
- }), [i, e, r, s]);
573
- return /* @__PURE__ */ m(q.Provider, { value: l, children: n });
574
- }, j = () => {
575
- const t = J(q);
578
+ }, [e, a.includeHelpCommand]);
579
+ const c = P(() => ({
580
+ config: a,
581
+ commands: e || new ee(),
582
+ storage: s,
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);
576
588
  if (t === void 0)
577
589
  throw new Error("useCitadelConfig must be used within a CitadelConfigProvider");
578
590
  return t.config;
579
- }, Q = () => {
580
- const t = J(q);
591
+ }, te = () => {
592
+ const t = Z(Y);
581
593
  if (t === void 0)
582
594
  throw new Error("useCitadelCommands must be used within a CitadelConfigProvider");
583
595
  return t.commands;
584
- }, ve = () => {
585
- const t = J(q);
596
+ }, be = () => {
597
+ const t = Z(Y);
586
598
  if (t === void 0)
587
599
  throw new Error("useCitadelStorage must be used within a CitadelConfigProvider");
588
600
  return t.storage;
589
- }, B = () => {
590
- const t = J(q);
601
+ }, J = () => {
602
+ const t = Z(Y);
591
603
  if (t === void 0)
592
604
  throw new Error("useSegmentStack must be used within a CitadelConfigProvider");
593
605
  return t.segmentStack;
594
- }, G = class G {
606
+ }, X = class X {
595
607
  constructor(e, n) {
596
- b(this, "id");
597
- b(this, "timestamp");
598
- b(this, "command");
599
- b(this, "result");
600
- this.id = `output-${Date.now()}-${G.idCounter++}`, this.command = e.toArray().map((r) => r.type === "argument" ? r.value || "" : r.name), this.timestamp = Date.now(), this.result = n ?? new He();
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
- b(G, "idCounter", 0);
604
- let te = G;
605
- function $e(t) {
615
+ y(X, "idCounter", 0);
616
+ let oe = X;
617
+ function qe(t) {
606
618
  return {
607
- commandSegments: H(t),
619
+ commandSegments: z(t),
608
620
  timestamp: Date.now()
609
621
  };
610
622
  }
611
- function Ce() {
612
- const t = ve(), [e, n] = I({
623
+ function ke() {
624
+ const t = be(), [e, n] = _({
613
625
  storedCommands: [],
614
626
  position: null
615
- }), r = v(async (l) => {
627
+ }), s = f(async (c) => {
616
628
  if (t)
617
629
  try {
618
- const a = $e(l);
619
- await t.addStoredCommand(a), n((c) => ({
620
- ...c,
621
- storedCommands: [...c.storedCommands, {
622
- ...a,
623
- commandSegments: H(a.commandSegments)
630
+ const i = qe(c);
631
+ await t.addStoredCommand(i), n((d) => ({
632
+ ...d,
633
+ storedCommands: [...d.storedCommands, {
634
+ ...i,
635
+ commandSegments: z(i.commandSegments)
624
636
  }],
625
637
  position: null
626
638
  }));
627
- } catch (a) {
628
- console.warn("Failed to save command to history:", a);
639
+ } catch (i) {
640
+ console.warn("Failed to save command to history:", i);
629
641
  }
630
- }, [t]), o = v(async () => t ? (await t.getStoredCommands()).map((a) => ({
631
- ...a,
632
- commandSegments: H(a.commandSegments)
642
+ }, [t]), r = f(async () => t ? (await t.getStoredCommands()).map((i) => ({
643
+ ...i,
644
+ commandSegments: z(i.commandSegments)
633
645
  })) : [], [t]);
634
- z(() => {
646
+ I(() => {
635
647
  if (!t) return;
636
648
  (async () => {
637
649
  try {
638
- const c = (await t.getStoredCommands()).map((g) => ({
650
+ const d = (await t.getStoredCommands()).map((g) => ({
639
651
  ...g,
640
- commandSegments: H(g.commandSegments)
652
+ commandSegments: z(g.commandSegments)
641
653
  }));
642
654
  return n((g) => ({
643
655
  ...g,
644
- storedCommands: c
645
- })), c;
646
- } catch (a) {
647
- console.warn("Failed to load command history:", a);
656
+ storedCommands: d
657
+ })), d;
658
+ } catch (i) {
659
+ console.warn("Failed to load command history:", i);
648
660
  }
649
661
  })();
650
662
  }, [t]);
651
- const s = v(async (l) => {
652
- const a = await o();
653
- if (a.length === 0)
654
- return n((f) => ({
655
- ...f,
663
+ const o = f(async (c) => {
664
+ const i = await r();
665
+ if (i.length === 0)
666
+ return n((u) => ({
667
+ ...u,
656
668
  storedCommands: [],
657
669
  position: null
658
670
  })), { segments: null, position: null };
659
- let c = null;
660
- if (l === "up" ? e.position === null ? c = a.length - 1 : e.position > 0 ? c = e.position - 1 : c = 0 : e.position === null || e.position >= a.length - 1 ? c = null : c = e.position + 1, n((f) => ({
661
- ...f,
662
- storedCommands: a.map((x) => ({
663
- ...x,
664
- commandSegments: H(x.commandSegments)
671
+ let d = null;
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) => ({
673
+ ...u,
674
+ storedCommands: i.map((h) => ({
675
+ ...h,
676
+ commandSegments: z(h.commandSegments)
665
677
  })),
666
- position: c
667
- })), c === null)
678
+ position: d
679
+ })), d === null)
668
680
  return {
669
681
  segments: [],
670
682
  position: null
671
683
  };
672
- const g = a[c];
684
+ const g = i[d];
673
685
  return g ? {
674
- segments: H(g.commandSegments),
675
- position: c
686
+ segments: z(g.commandSegments),
687
+ position: d
676
688
  } : {
677
689
  segments: [],
678
690
  position: null
679
691
  };
680
- }, [e.position, o]), i = v(async () => {
692
+ }, [e.position, r]), a = f(async () => {
681
693
  try {
682
694
  if (!t) return;
683
695
  await t.clear(), n({
684
696
  storedCommands: [],
685
697
  position: null
686
698
  });
687
- } catch (l) {
688
- console.warn("Failed to clear command history:", l);
699
+ } catch (c) {
700
+ console.warn("Failed to clear command history:", c);
689
701
  }
690
702
  }, [t]);
691
703
  return {
692
704
  history: e,
693
- addStoredCommand: r,
694
- getStoredCommands: o,
695
- navigateHistory: s,
696
- clear: i
705
+ addStoredCommand: s,
706
+ getStoredCommands: r,
707
+ navigateHistory: o,
708
+ clear: a
697
709
  };
698
710
  }
699
- const ae = () => {
700
- const t = j(), e = Q(), n = Ce(), r = B(), o = ve(), [s, i] = I({
711
+ const de = () => {
712
+ const t = U(), e = te(), n = ke(), s = J(), r = be(), [o, a] = _({
701
713
  currentInput: "",
702
714
  isEnteringArg: !1,
703
715
  output: [],
704
716
  history: {
705
717
  commands: [],
706
718
  position: null,
707
- storage: o
719
+ storage: r
708
720
  }
709
721
  });
710
- z(() => {
711
- }, [o]), z(() => {
712
- i((a) => ({
713
- ...a,
722
+ I(() => {
723
+ }, [r]), I(() => {
724
+ a((i) => ({
725
+ ...i,
714
726
  history: {
715
727
  commands: n.history.storedCommands,
716
728
  position: n.history.position,
717
- storage: o
729
+ storage: r
718
730
  }
719
731
  }));
720
- }, [n.history, o]);
721
- const l = {
722
- setCurrentInput: v((a) => {
723
- k.debug("[CitadelActions] setCurrentInput: ", a), i((c) => ({ ...c, currentInput: a }));
732
+ }, [n.history, r]);
733
+ const c = {
734
+ setCurrentInput: f((i) => {
735
+ b.debug("[CitadelActions] setCurrentInput: ", i), a((d) => ({ ...d, currentInput: i }));
724
736
  }, []),
725
- setIsEnteringArg: v((a) => {
726
- k.debug("[CitadelActions] setIsEnteringArg: ", a), i((c) => ({ ...c, isEnteringArg: a }));
737
+ setIsEnteringArg: f((i) => {
738
+ b.debug("[CitadelActions] setIsEnteringArg: ", i), a((d) => ({ ...d, isEnteringArg: i }));
727
739
  }, []),
728
- addOutput: v((a) => {
729
- k.debug("[CitadelActions]addOutput: ", a), i((c) => ({
730
- ...c,
731
- output: [...c.output, a]
740
+ addOutput: f((i) => {
741
+ b.debug("[CitadelActions]addOutput: ", i), a((d) => ({
742
+ ...d,
743
+ output: [...d.output, i]
732
744
  }));
733
745
  }, []),
734
- executeCommand: v(async () => {
735
- const a = r.path(), c = e.getCommand(a);
736
- if (!c) {
737
- console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ", a);
746
+ executeCommand: f(async () => {
747
+ const i = s.path(), d = e.getCommand(i);
748
+ if (!d) {
749
+ console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ", i);
738
750
  return;
739
751
  }
740
- const g = new te(r);
741
- i((f) => ({
742
- ...f,
743
- output: [...f.output, g]
752
+ const g = new oe(s);
753
+ a((u) => ({
754
+ ...u,
755
+ output: [...u.output, g]
744
756
  }));
745
757
  try {
746
- const f = new Promise((h, S) => {
758
+ const u = new Promise((C, k) => {
747
759
  setTimeout(() => {
748
- S(new Error("Request timed out"));
760
+ k(new Error("Request timed out"));
749
761
  }, t.commandTimeoutMs);
750
- }), x = r.arguments.map((h) => h.value || ""), w = await Promise.race([
751
- c.handler(x),
752
- f
762
+ }), h = s.arguments.map((C) => C.value || ""), S = await Promise.race([
763
+ d.handler(h),
764
+ u
753
765
  ]);
754
- if (!(w instanceof O))
766
+ if (!(S instanceof K))
755
767
  throw new Error(
756
- `The ${a.join(".")} command returned an invalid result type. Commands must return an instance of a CommandResult.
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
- Check the definition of the ${a.join(".")} command and update the return type for its handler.`
771
+ Check the definition of the ${i.join(".")} command and update the return type for its handler.`
760
772
  );
761
- w.markSuccess(), i((h) => ({
762
- ...h,
763
- output: h.output.map(
764
- (S) => S.id === g.id ? { ...S, result: w } : S
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
- } catch (f) {
768
- const x = new fe(
769
- f instanceof Error ? f.message : "Unknown error"
779
+ } catch (u) {
780
+ const h = new we(
781
+ u instanceof Error ? u.message : "Unknown error"
770
782
  );
771
- x.markFailure(), i((w) => ({
772
- ...w,
773
- output: w.output.map(
774
- (h) => h.id === g.id ? { ...h, result: x } : h
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, t.commandTimeoutMs, r]),
779
- clearHistory: v(async () => {
790
+ }, [e, t.commandTimeoutMs, s]),
791
+ clearHistory: f(async () => {
780
792
  try {
781
793
  await n.clear();
782
- } catch (a) {
783
- console.warn("Failed to clear history:", a);
794
+ } catch (i) {
795
+ console.warn("Failed to clear history:", i);
784
796
  }
785
797
  }, [n])
786
798
  };
787
- return { state: s, actions: l };
788
- }, Oe = ({ onOpen: t, onClose: e, isVisible: n, showCitadelKey: r }) => {
789
- z(() => {
790
- const o = (s) => {
791
- var i, l;
792
- !n && s.key === r && !["input", "textarea"].includes(((l = (i = s.target) == null ? void 0 : i.tagName) == null ? void 0 : l.toLowerCase()) || "") && (s.preventDefault(), t()), n && s.key === "Escape" && (s.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
812
  return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
795
- }, [t, e, n, r]);
796
- }, Ke = "_panelContainer_1pav9_3", We = "_innerContainer_1pav9_19", qe = "_inputSection_1pav9_29", Be = "_resizeHandle_1pav9_36", Ye = "_citadel_slideUp_1pav9_65", Ve = "_citadel_slideDown_1pav9_69", Ge = "_inlineContainer_1pav9_73", ce = {
797
- panelContainer: Ke,
798
- innerContainer: We,
799
- inputSection: qe,
800
- resizeHandle: Be,
801
- citadel_slideUp: Ye,
802
- citadel_slideDown: Ve,
803
- inlineContainer: Ge
804
- }, Je = (t) => {
805
- const { isVisible: e, isClosing: n, onAnimationComplete: r } = t, o = M(() => e ? n ? ce.slideDown : ce.slideUp : "", [e, n]);
806
- return z(() => {
807
- if (r) {
808
- const i = setTimeout(() => {
809
- r();
810
- }, 200);
811
- return () => clearTimeout(i);
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;
812
821
  }
813
- }, [n, r]), {
814
- style: M(() => ({
815
- opacity: e ? 1 : 0,
816
- transform: e ? "translateY(0)" : n ? "translateY(100%)" : "translateY(-100%)",
817
- transition: "opacity 200ms ease-in-out, transform 200ms ease-in-out"
818
- }), [e, n]),
819
- animationClass: o
822
+ const a = setTimeout(() => {
823
+ s();
824
+ }, Ve);
825
+ return () => clearTimeout(a);
826
+ }, [n, s]), {
827
+ animationClass: r
820
828
  };
821
- }, Xe = () => /* @__PURE__ */ m(
829
+ }, Je = () => /* @__PURE__ */ m(
822
830
  "div",
823
831
  {
824
832
  "data-testid": "spinner",
825
- className: "animate-spin rounded-full h-4 w-4 border-2 border-gray-300 border-t-gray-600"
833
+ className: "citadel-spinner"
826
834
  }
827
- ), Qe = /^text-(xs|sm|base|lg|xl|[2-9]xl|\[[^\]]+\])$/, Se = (t) => {
835
+ ), Ee = (t) => {
828
836
  const e = t == null ? void 0 : t.trim();
829
837
  return e || void 0;
830
- }, Ze = (t) => {
831
- const e = Se(t);
832
- return e ? Qe.test(e) ? { className: e } : { style: { fontSize: e } } : {};
833
- }, Z = (t, e) => {
834
- const n = Se(t), r = Ze(e), o = {
835
- ...r.style
838
+ }, Ge = (t) => {
839
+ const e = Ee(t);
840
+ return e ? { style: { fontSize: e } } : {};
841
+ }, ne = (t, e) => {
842
+ const n = Ee(t), r = {
843
+ ...Ge(e).style
836
844
  };
837
- return n && (o.fontFamily = n), {
838
- className: r.className,
839
- style: Object.keys(o).length > 0 ? o : void 0
845
+ return n && (r.fontFamily = n), {
846
+ style: Object.keys(r).length > 0 ? r : void 0
840
847
  };
841
- }, en = ({
848
+ }, Qe = ({
842
849
  command: t,
843
850
  timestamp: e,
844
851
  status: n,
845
- fontFamily: r,
846
- fontSize: o
852
+ fontFamily: s,
853
+ fontSize: r
847
854
  }) => {
848
- const s = M(
849
- () => Z(r, o ?? "text-sm"),
850
- [r, o]
855
+ const o = P(
856
+ () => ne(s, r ?? "0.875rem"),
857
+ [s, r]
851
858
  );
852
- return /* @__PURE__ */ E(
859
+ return /* @__PURE__ */ A(
853
860
  "div",
854
861
  {
855
- className: `flex items-center gap-2 ${s.className ?? ""}`.trim(),
856
- style: s.style,
862
+ className: "citadel-output-line",
863
+ style: o.style,
857
864
  children: [
858
- /* @__PURE__ */ E("span", { className: "text-gray-200", children: [
865
+ /* @__PURE__ */ A("span", { className: "citadel-output-command", children: [
859
866
  "> ",
860
- t.split(" ").map((i, l) => {
861
- const a = i.startsWith("<") && i.endsWith(">");
862
- return /* @__PURE__ */ E(
867
+ t.split(" ").map((a, c) => {
868
+ const i = a.startsWith("<") && a.endsWith(">");
869
+ return /* @__PURE__ */ A(
863
870
  "span",
864
871
  {
865
- className: a ? "text-green-400" : "text-gray-200",
872
+ className: i ? "citadel-output-command-arg" : "citadel-output-command-word",
866
873
  children: [
867
- l > 0 ? " " : "",
868
- i
874
+ c > 0 ? " " : "",
875
+ a
869
876
  ]
870
877
  },
871
- l
878
+ c
872
879
  );
873
880
  })
874
881
  ] }),
875
- /* @__PURE__ */ m("span", { className: "text-gray-400", children: "·" }),
876
- /* @__PURE__ */ m("span", { className: "text-gray-500", children: e }),
877
- n === W.Pending && /* @__PURE__ */ m(Xe, {}),
878
- n === W.Success && /* @__PURE__ */ m(
882
+ /* @__PURE__ */ m("span", { className: "citadel-output-separator", children: "·" }),
883
+ /* @__PURE__ */ m("span", { className: "citadel-output-timestamp", children: e }),
884
+ n === V.Pending && /* @__PURE__ */ m(Je, {}),
885
+ n === V.Success && /* @__PURE__ */ m(
879
886
  "div",
880
887
  {
881
888
  "data-testid": "success-indicator",
882
- className: "w-4 h-4 rounded-full bg-green-500"
889
+ className: "citadel-status-dot citadel-status-dot-success"
883
890
  }
884
891
  ),
885
- (n === W.Timeout || n === W.Failure) && /* @__PURE__ */ m(
892
+ (n === V.Timeout || n === V.Failure) && /* @__PURE__ */ m(
886
893
  "div",
887
894
  {
888
895
  "data-testid": "success-indicator",
889
- className: "w-4 h-4 rounded-full bg-red-500"
896
+ className: "citadel-status-dot citadel-status-dot-failure"
890
897
  }
891
898
  )
892
899
  ]
893
900
  }
894
901
  );
895
- }, nn = ({ output: t, outputRef: e }) => {
896
- const n = j(), r = M(
897
- () => Z(n.fontFamily, n.outputFontSize ?? n.fontSize),
902
+ }, Xe = ({ output: t, outputRef: e }) => {
903
+ const n = U(), s = P(
904
+ () => ne(n.fontFamily, n.outputFontSize ?? n.fontSize),
898
905
  [n.fontFamily, n.fontSize, n.outputFontSize]
899
- ), o = v(() => {
906
+ ), r = f(() => {
900
907
  if (e.current) {
901
- const s = e.current;
908
+ const o = e.current;
902
909
  requestAnimationFrame(() => {
903
- s.scrollTop = s.scrollHeight;
910
+ o.scrollTop = o.scrollHeight;
904
911
  });
905
912
  }
906
913
  }, [e]);
907
- return z(() => {
908
- if (o(), e.current) {
909
- const s = e.current.getElementsByTagName("img"), i = s[s.length - 1];
910
- if (i && !i.complete)
911
- return i.addEventListener("load", o), () => i.removeEventListener("load", o);
914
+ return I(() => {
915
+ if (r(), e.current) {
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);
912
919
  }
913
- }, [t, o, e]), /* @__PURE__ */ m(
920
+ }, [t, r, e]), /* @__PURE__ */ m(
914
921
  "div",
915
922
  {
916
923
  ref: e,
917
- className: "h-full overflow-y-auto border border-gray-700 rounded-lg p-3 text-left",
924
+ className: "citadel-output",
918
925
  "data-testid": "citadel-command-output",
919
- children: t.map((s) => /* @__PURE__ */ E("div", { className: "mb-4 last:mb-0", children: [
926
+ children: t.map((o) => /* @__PURE__ */ A("div", { className: "citadel-output-item", children: [
920
927
  /* @__PURE__ */ m(
921
- en,
928
+ Qe,
922
929
  {
923
- command: s.command.join(" "),
924
- timestamp: new Date(s.timestamp).toLocaleTimeString(),
925
- status: s.result.status,
930
+ command: o.command.join(" "),
931
+ timestamp: new Date(o.timestamp).toLocaleTimeString(),
932
+ status: o.result.status,
926
933
  fontFamily: n.fontFamily,
927
934
  fontSize: n.fontSize
928
935
  }
929
936
  ),
930
937
  /* @__PURE__ */ m(
931
- "pre",
938
+ "div",
932
939
  {
933
- className: `text-gray-200 whitespace-pre ${r.className ?? ""}`.trim(),
934
- style: r.style,
935
- children: s.result.render()
940
+ className: "citadel-output-content",
941
+ style: s.style,
942
+ children: o.result.render()
936
943
  }
937
944
  )
938
- ] }, s.id))
945
+ ] }, o.id))
939
946
  }
940
947
  );
941
- }, tn = {
948
+ }, Ze = {
942
949
  blink: {
943
950
  character: "▋",
944
951
  speed: 530,
@@ -959,487 +966,517 @@ Check the definition of the ${a.join(".")} command and update the return type fo
959
966
  speed: 120,
960
967
  color: "#fff"
961
968
  }
962
- }, de = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], me = ["|", "/", "-", "\\"], rn = ({
969
+ }, he = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], ge = ["|", "/", "-", "\\"], et = ({
963
970
  style: t = { type: "blink" },
964
971
  isValid: e = !0,
965
972
  errorMessage: n
966
973
  }) => {
967
- const r = M(() => ({
968
- ...tn[t.type],
974
+ const s = P(() => ({
975
+ ...Ze[t.type],
969
976
  ...t
970
- }), [t]), [o, s] = I(!0), [i, l] = I(0);
971
- z(() => {
972
- if (r.speed === 0) return;
977
+ }), [t]), [r, o] = _(!0), [a, c] = _(0);
978
+ I(() => {
979
+ if (s.speed === 0) return;
973
980
  const g = setInterval(() => {
974
- r.type === "blink" ? s((f) => !f) : ["spin", "bbs"].includes(r.type) && l((f) => (f + 1) % (r.type === "bbs" ? me.length : de.length));
975
- }, r.speed);
981
+ s.type === "blink" ? o((u) => !u) : ["spin", "bbs"].includes(s.type) && c((u) => (u + 1) % (s.type === "bbs" ? ge.length : he.length));
982
+ }, s.speed);
976
983
  return () => clearInterval(g);
977
- }, [r.type, r.speed]);
978
- const a = M(() => ({
979
- color: e ? r.color : "#ff4444",
984
+ }, [s.type, s.speed]);
985
+ const i = P(() => ({
986
+ color: e ? s.color : "#ff4444",
980
987
  transition: "color 0.15s ease-in-out"
981
- }), [e, r.color]);
982
- return /* @__PURE__ */ m("div", { className: "relative inline-block", children: /* @__PURE__ */ m(
988
+ }), [e, s.color]);
989
+ return /* @__PURE__ */ m("div", { className: "citadel-cursor-wrapper", children: /* @__PURE__ */ m(
983
990
  "span",
984
991
  {
985
992
  className: `command-cursor ${e ? "" : "animate-shake"}`,
986
- style: a,
993
+ style: i,
987
994
  title: n,
988
- children: !e && n ? "✗" : ["spin", "bbs"].includes(r.type) ? (r.type === "bbs" ? me : de)[i] : r.type === "solid" || o ? r.character : " "
995
+ children: !e && n ? "✗" : ["spin", "bbs"].includes(s.type) ? (s.type === "bbs" ? ge : he)[a] : s.type === "solid" || r ? s.character : " "
989
996
  }
990
997
  ) });
991
998
  };
992
- function on(t, e) {
999
+ function tt(t, e) {
993
1000
  switch (e.type) {
994
1001
  case "set":
995
- return k.debug(`[inputStateReducer] InputState changing from ${t} to ${e.state}`), e.state;
1002
+ return b.debug(`[inputStateReducer] InputState changing from ${t} to ${e.state}`), e.state;
996
1003
  default:
997
1004
  return t;
998
1005
  }
999
1006
  }
1000
- const sn = () => {
1001
- const { state: t } = ae(), e = Q(), n = Ce(), r = B(), [o, s] = Ie(on, "idle"), i = (d) => {
1002
- s({ type: "set", state: d });
1003
- }, l = v(() => {
1004
- const u = e.getCompletions(r.path())[0] || r.nullSegment;
1005
- return k.debug("[getNextExpectedSegment] ", u), u;
1006
- }, [e, r]), a = v(() => e.getCompletionNames(r.path()).map((u) => e.getCommand([...r.path(), u])).filter((u) => u !== void 0), [e, r]), c = v((d, u) => {
1007
- if (!d) return u;
1008
- const p = r.path().length;
1009
- return u.filter((R) => {
1010
- const C = R.segments[p];
1011
- return !C || C.type !== "word" ? !1 : C.name.toLowerCase().startsWith(d.toLowerCase());
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(() => {
1011
+ const p = e.getCompletions(s.path())[0] || s.nullSegment;
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) => {
1014
+ if (!l) return p;
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());
1012
1019
  });
1013
- }, [r]), g = v((d) => {
1014
- const u = e.getUniqueCompletion(r.path(), d);
1015
- return u && u.type === "word" ? u : r.nullSegment;
1016
- }, [e, r]), f = v((d) => {
1017
- const u = r.path(), p = e.getCompletions(u);
1018
- return p.length === 0 && d ? !1 : p.some((C) => C.type === "argument") ? !0 : e.getMatchingCompletions(u, d).some((C) => C.type === "word");
1019
- }, [e, r]), x = v((d) => {
1020
- k.debug("[tryAutoComplete] input: ", d);
1021
- const u = g(d);
1022
- return !u || u.type === "null" ? new se() : (k.debug("[tryAutoComplete] result: ", u), u);
1023
- }, [g]), w = v((d, u) => {
1020
+ }, [s]), g = f((l) => {
1021
+ const p = e.getUniqueCompletion(s.path(), l);
1022
+ return p && p.type === "word" ? p : s.nullSegment;
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);
1028
+ const p = g(l);
1029
+ return !p || p.type === "null" ? new le() : (b.debug("[tryAutoComplete] result: ", p), p);
1030
+ }, [g]), S = f((l, p) => {
1024
1031
  if (t.history.position !== null)
1025
1032
  return;
1026
- u.setCurrentInput(d), k.debug("[useCommandParser][handleInputChange] newValue: ", d);
1027
- const p = l();
1028
- if (p.type === "argument" || o === "entering_argument") {
1029
- const A = ue(d);
1030
- if (A.isQuoted)
1031
- if (A.isComplete) {
1032
- if (!(p instanceof $)) return;
1033
- p.value = d.trim() || "", k.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", p), r.push(p), u.setCurrentInput(""), i("idle");
1033
+ p.setCurrentInput(l), b.debug("[useCommandParser][handleInputChange] newValue: ", l);
1034
+ const w = c();
1035
+ if (w.type === "argument" || r === "entering_argument") {
1036
+ const H = fe(l);
1037
+ if (H.isQuoted)
1038
+ if (H.isComplete) {
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");
1034
1041
  return;
1035
1042
  } else
1036
1043
  return;
1037
- else if (A.isComplete) {
1038
- if (!(p instanceof $)) return;
1039
- p.value = d.trim() || "", k.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", p), r.push(p), u.setCurrentInput(""), i("idle");
1044
+ else if (H.isComplete) {
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");
1040
1047
  return;
1041
1048
  } else
1042
1049
  return;
1043
1050
  }
1044
- if (d.endsWith(" ")) {
1045
- const A = d.trim().toLowerCase(), P = e.getCompletions(r.path()).filter(
1046
- (y) => y.type === "word" && y.name.toLowerCase() === A
1051
+ if (l.endsWith(" ")) {
1052
+ const H = l.trim().toLowerCase(), M = e.getCompletions(s.path()).filter(
1053
+ (E) => E.type === "word" && E.name.toLowerCase() === H
1047
1054
  );
1048
- if (P.length === 1) {
1049
- r.push(P[0]), u.setCurrentInput(""), i("idle");
1055
+ if (M.length === 1) {
1056
+ s.push(M[0]), p.setCurrentInput(""), a("idle");
1050
1057
  return;
1051
1058
  }
1052
1059
  }
1053
- const C = x(d);
1054
- if (C.type === "word") {
1055
- k.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", C), r.push(C), u.setCurrentInput(""), i("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");
1056
1063
  return;
1057
1064
  }
1058
- }, [x, t, l, o, r, e]), h = v((d) => {
1059
- d.setCurrentInput(""), d.setIsEnteringArg(!1), r.clear(), i("idle");
1060
- }, [r]), S = v((d, u, p) => {
1061
- if (!(d.key === "Backspace" || d.key === "Enter" || d.key === "ArrowUp" || d.key === "ArrowDown" || d.key === "ArrowLeft" || d.key === "ArrowRight" || d.key === "Escape" || d.key === "Delete" || d.key === "Home" || d.key === "End" || d.key.length === 1))
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) => {
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))
1062
1069
  return !0;
1063
- const { currentInput: C, isEnteringArg: A } = u, P = ue(C);
1064
- switch (d.key) {
1070
+ const { currentInput: v, isEnteringArg: H } = p, M = fe(v);
1071
+ switch (l.key) {
1065
1072
  case "Backspace":
1066
- return C === "" && (d.preventDefault(), r.size() > 0 && r.pop(), i("idle")), !0;
1073
+ return v === "" && (l.preventDefault(), s.size() > 0 && s.pop(), a("idle")), !0;
1067
1074
  case "Enter": {
1068
- if (d.preventDefault(), P.isQuoted && !P.isComplete)
1075
+ if (l.preventDefault(), M.isQuoted && !M.isComplete)
1069
1076
  return !0;
1070
- if (o === "entering_argument" || A && C.trim()) {
1071
- const T = l();
1072
- T instanceof $ && (T.value = C, k.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", T), r.push(T));
1077
+ if (r === "entering_argument" || H && v.trim()) {
1078
+ const F = c();
1079
+ F instanceof q && (F.value = v, b.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", F), s.push(F));
1073
1080
  }
1074
- const y = r.path(), _ = e.getCommand(y);
1075
- if (!_)
1081
+ const E = s.path(), B = e.getCommand(E);
1082
+ if (!B)
1076
1083
  return !1;
1077
- const D = _.segments.filter((T) => T.type === "argument"), K = r.arguments;
1078
- return D.length > K.length ? !1 : (k.debug("[handleKeyDown][Enter] calling actions.executeCommand. segmentStack: ", r), p.executeCommand(), n.addStoredCommand(r.toArray()), h(p), !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);
1079
1086
  }
1080
1087
  case "ArrowUp":
1081
- return d.preventDefault(), (async () => {
1082
- const y = await n.navigateHistory("up");
1083
- return y.segments && (r.clear(), r.pushAll(y.segments), p.setCurrentInput("")), !0;
1088
+ return l.preventDefault(), (async () => {
1089
+ const E = await n.navigateHistory("up");
1090
+ return E.segments && (s.clear(), s.pushAll(E.segments), w.setCurrentInput("")), !0;
1084
1091
  })();
1085
1092
  case "ArrowDown":
1086
- return d.preventDefault(), (async () => {
1087
- const y = await n.navigateHistory("down");
1088
- return y.segments && (r.clear(), r.pushAll(y.segments), p.setCurrentInput("")), !0;
1093
+ return l.preventDefault(), (async () => {
1094
+ const E = await n.navigateHistory("down");
1095
+ return E.segments && (s.clear(), s.pushAll(E.segments), w.setCurrentInput("")), !0;
1089
1096
  })();
1090
1097
  default: {
1091
- if (!A && d.key.length === 1) {
1092
- const y = C + d.key;
1093
- if (!f(y))
1094
- return d.preventDefault(), !1;
1098
+ if (!H && l.key.length === 1) {
1099
+ const E = v + l.key;
1100
+ if (!u(E))
1101
+ return l.preventDefault(), !1;
1095
1102
  }
1096
1103
  return !0;
1097
1104
  }
1098
1105
  }
1099
1106
  }, [
1100
- o,
1101
- f,
1102
- l,
1107
+ r,
1108
+ u,
1109
+ c,
1103
1110
  n,
1104
- h,
1111
+ C,
1105
1112
  e,
1106
- r
1113
+ s
1107
1114
  ]);
1108
1115
  return {
1109
- handleInputChange: w,
1110
- handleKeyDown: S,
1111
- inputState: o,
1112
- setInputStateWithLogging: i,
1116
+ handleInputChange: S,
1117
+ handleKeyDown: k,
1118
+ inputState: r,
1119
+ setInputStateWithLogging: a,
1113
1120
  // Expose internal functions for testing
1114
- findMatchingCommands: c,
1121
+ findMatchingCommands: d,
1115
1122
  getAutocompleteSuggestion: g,
1116
- getAvailableNodes: a,
1117
- getNextExpectedSegment: l,
1118
- isValidCommandInput: f
1123
+ getAvailableNodes: i,
1124
+ getNextExpectedSegment: c,
1125
+ isValidCommandInput: u
1119
1126
  };
1120
1127
  };
1121
- function ue(t) {
1128
+ function fe(t) {
1122
1129
  const e = [];
1123
- let n = "", r = !1, o;
1124
- for (let s = 0; s < t.length; s++) {
1125
- const i = t[s];
1126
- (i === '"' || i === "'") && (!r || i === o) ? r ? (e.push(n), n = "", r = !1, o = void 0) : (n && (e.push(n), n = ""), r = !0, o = i) : !r && i === " " ? n && (e.push(n), n = "") : n += i;
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;
1127
1134
  }
1128
1135
  return {
1129
1136
  words: e,
1130
1137
  currentWord: n,
1131
- isQuoted: r,
1132
- quoteChar: o,
1133
- isComplete: !r && !n
1138
+ isQuoted: s,
1139
+ quoteChar: r,
1140
+ isComplete: !s && !n
1134
1141
  };
1135
1142
  }
1136
- const an = () => {
1137
- const t = B(), [e, n] = I(0);
1138
- return z(() => {
1139
- const r = {
1143
+ const st = () => {
1144
+ const t = J(), [e, n] = _(0);
1145
+ return I(() => {
1146
+ const s = {
1140
1147
  update: () => {
1141
- n((o) => o + 1);
1148
+ n((r) => r + 1);
1142
1149
  }
1143
1150
  };
1144
- return t.subscribe(r), () => {
1145
- t.unsubscribe(r);
1151
+ return t.subscribe(s), () => {
1152
+ t.unsubscribe(s);
1146
1153
  };
1147
1154
  }, [t]), e;
1148
- }, ln = ({
1155
+ }, rt = ({
1149
1156
  state: t,
1150
1157
  actions: e
1151
1158
  }) => {
1152
- const n = F(null), r = Q(), o = B(), {
1153
- handleKeyDown: s,
1154
- handleInputChange: i,
1155
- inputState: l,
1156
- setInputStateWithLogging: a,
1157
- getNextExpectedSegment: c
1158
- } = sn(), [g, f] = I(!1), x = j(), w = an(), h = M(
1159
- () => Z(x.fontFamily, x.fontSize),
1160
- [x.fontFamily, x.fontSize]
1161
- ), S = async (y) => {
1162
- const _ = s(y, t, e);
1163
- await Promise.resolve(_) === !1 && (f(!0), setTimeout(() => f(!1), 500));
1164
- }, d = (y) => {
1165
- i(y.target.value, e);
1166
- }, u = (y) => {
1167
- y.preventDefault();
1168
- const _ = y.clipboardData.getData("text");
1169
- i(_, e);
1170
- };
1171
- z(() => {
1172
- n.current && n.current.focus(), l !== "entering_command" && a("entering_command");
1173
- }, [l, a]), z(() => {
1174
- if (l !== "idle") return;
1175
- const y = c();
1176
- let _ = "idle";
1177
- switch (y.type) {
1159
+ const n = T(null), s = te(), r = J(), {
1160
+ handleKeyDown: o,
1161
+ handleInputChange: a,
1162
+ inputState: c,
1163
+ setInputStateWithLogging: i,
1164
+ getNextExpectedSegment: d
1165
+ } = nt(), [g, u] = _(!1), h = U(), S = st(), C = T(null), [k, l] = _(0), p = P(
1166
+ () => ne(h.fontFamily, h.fontSize),
1167
+ [h.fontFamily, h.fontSize]
1168
+ ), w = f(async (N) => {
1169
+ const R = o(N, t, e);
1170
+ await Promise.resolve(R) === !1 && (u(!0), setTimeout(() => u(!1), 500));
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(() => {
1181
+ if (c !== "idle") return;
1182
+ const N = d();
1183
+ let R = "idle";
1184
+ switch (N.type) {
1178
1185
  case "word":
1179
- _ = "entering_command", e.setIsEnteringArg(!1);
1186
+ R = "entering_command", e.setIsEnteringArg(!1);
1180
1187
  break;
1181
1188
  case "argument":
1182
- _ = "entering_argument", e.setIsEnteringArg(!0);
1189
+ R = "entering_argument", e.setIsEnteringArg(!0);
1183
1190
  break;
1184
1191
  }
1185
- a(_);
1186
- }, [w, l, c, a, e]);
1187
- const p = M(() => {
1188
- const y = [], _ = o.toArray().map((D, K) => {
1189
- y.push(D.name);
1190
- const T = r.hasNextSegment(y);
1191
- if (D.type === "argument") {
1192
- const ee = D;
1193
- return /* @__PURE__ */ E(L.Fragment, { children: [
1194
- /* @__PURE__ */ m("span", { className: "text-gray-200 whitespace-pre", children: ee.value }),
1195
- K < o.size() && T && /* @__PURE__ */ m("span", { className: "text-gray-200 whitespace-pre", children: " " })
1196
- ] }, "arg-" + ee.name + ee.value);
1192
+ i(R);
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);
1198
+ if (L.type === "argument") {
1199
+ const re = L;
1200
+ return /* @__PURE__ */ A($.Fragment, { children: [
1201
+ /* @__PURE__ */ m("span", { className: "citadel-input-segment-arg", children: re.value }),
1202
+ se < r.size() && me && /* @__PURE__ */ m("span", { className: "citadel-input-segment-space", children: " " })
1203
+ ] }, "arg-" + re.name + re.value);
1197
1204
  }
1198
- return /* @__PURE__ */ E(L.Fragment, { children: [
1199
- /* @__PURE__ */ m("span", { className: "text-blue-400 whitespace-pre", children: D.name }),
1200
- K < o.size() && T && /* @__PURE__ */ m("span", { className: "text-blue-400 whitespace-pre", children: " " })
1201
- ] }, "word-" + D.name);
1205
+ return /* @__PURE__ */ A($.Fragment, { children: [
1206
+ /* @__PURE__ */ m("span", { className: "citadel-input-segment-word", children: L.name }),
1207
+ se < r.size() && me && /* @__PURE__ */ m("span", { className: "citadel-input-segment-space citadel-input-segment-space-command", children: " " })
1208
+ ] }, "word-" + L.name);
1202
1209
  });
1203
- return [/* @__PURE__ */ m("div", { className: "flex items-center gap-1", "data-testid": "user-input-area", children: _ }, w)];
1204
- }, [w, r, o]), [R, C] = I("");
1205
- z(() => {
1206
- const y = c();
1207
- y.type === "argument" ? C(y.name) : C("");
1208
- }, [w, c]);
1209
- const A = !t.isEnteringArg, P = t.currentInput.length;
1210
- return /* @__PURE__ */ E("div", { className: "flex flex-col w-full bg-gray-900 rounded-lg p-4", children: [
1211
- /* @__PURE__ */ m("style", { children: `
1212
- @keyframes subtleGlow {
1213
- 0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
1214
- 50% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
1215
- }
1216
- .invalid-input-animation {
1217
- animation: subtleGlow 0.4s ease-in-out;
1218
- }
1219
- ` }),
1220
- /* @__PURE__ */ E(
1221
- "div",
1222
- {
1223
- className: `flex items-center gap-2 ${h.className ?? ""}`.trim(),
1224
- style: h.style,
1225
- children: [
1226
- /* @__PURE__ */ m("div", { className: "text-gray-400", children: ">" }),
1227
- /* @__PURE__ */ E("div", { className: "flex-1 flex items-center", children: [
1228
- p,
1229
- /* @__PURE__ */ E("div", { className: "relative flex-1", children: [
1230
- /* @__PURE__ */ m(
1231
- "input",
1232
- {
1233
- ref: n,
1234
- type: "text",
1235
- role: "textbox",
1236
- value: t.currentInput,
1237
- onChange: d,
1238
- onKeyDown: S,
1239
- onPaste: u,
1240
- "data-testid": "citadel-command-input",
1241
- className: `w-full bg-transparent outline-none caret-transparent ${A ? "text-blue-400" : "text-gray-200"} ${g ? "invalid-input-animation" : ""}`,
1242
- spellCheck: !1,
1243
- autoComplete: "off",
1244
- placeholder: R
1245
- }
1246
- ),
1247
- /* @__PURE__ */ m(
1248
- "div",
1249
- {
1250
- className: "absolute top-0 pointer-events-none",
1251
- style: {
1252
- left: `${P}ch`,
1253
- transition: "left 0.05s ease-out"
1254
- },
1255
- children: /* @__PURE__ */ m(
1256
- rn,
1257
- {
1258
- style: {
1259
- type: x.cursorType ?? N.cursorType,
1260
- color: x.cursorColor || N.cursorColor,
1261
- speed: x.cursorSpeed || N.cursorSpeed
1262
- }
1263
- }
1264
- )
1265
- }
1266
- )
1267
- ] })
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(
1217
+ () => ({
1218
+ left: `${k}px`,
1219
+ transition: "left 0.05s ease-out"
1220
+ }),
1221
+ [k]
1222
+ ), F = P(
1223
+ () => ({
1224
+ type: h.cursorType ?? x.cursorType,
1225
+ color: h.cursorColor || x.cursorColor,
1226
+ speed: h.cursorSpeed || x.cursorSpeed
1227
+ }),
1228
+ [h.cursorColor, h.cursorSpeed, h.cursorType]
1229
+ );
1230
+ return Me(() => {
1231
+ const N = C.current, R = n.current;
1232
+ if (!N || !R) {
1233
+ l(0);
1234
+ return;
1235
+ }
1236
+ const L = N.getBoundingClientRect().width;
1237
+ l(Math.max(0, L - R.scrollLeft));
1238
+ }, [t.currentInput, O, p.style]), /* @__PURE__ */ m("div", { className: "citadel-input-shell", children: /* @__PURE__ */ A(
1239
+ "div",
1240
+ {
1241
+ className: "citadel-input-line",
1242
+ style: p.style,
1243
+ children: [
1244
+ /* @__PURE__ */ m("div", { className: "citadel-input-prompt", children: ">" }),
1245
+ /* @__PURE__ */ A("div", { className: "citadel-input-row", children: [
1246
+ H,
1247
+ /* @__PURE__ */ A("div", { className: "citadel-input-control", children: [
1248
+ /* @__PURE__ */ m(
1249
+ "span",
1250
+ {
1251
+ ref: C,
1252
+ className: `citadel-input-measure ${O}`.trim(),
1253
+ "aria-hidden": "true",
1254
+ children: t.currentInput
1255
+ }
1256
+ ),
1257
+ /* @__PURE__ */ m(
1258
+ "input",
1259
+ {
1260
+ ref: n,
1261
+ type: "text",
1262
+ role: "textbox",
1263
+ value: t.currentInput,
1264
+ onChange: D,
1265
+ onKeyDown: w,
1266
+ onPaste: v,
1267
+ "data-testid": "citadel-command-input",
1268
+ className: `citadel-input-field ${O} ${g ? "invalid-input-animation" : ""}`.trim(),
1269
+ spellCheck: !1,
1270
+ autoComplete: "off",
1271
+ placeholder: M
1272
+ }
1273
+ ),
1274
+ /* @__PURE__ */ m(
1275
+ "div",
1276
+ {
1277
+ className: "citadel-input-cursor",
1278
+ style: W,
1279
+ children: /* @__PURE__ */ m(et, { style: F })
1280
+ }
1281
+ )
1268
1282
  ] })
1269
- ]
1270
- }
1271
- )
1272
- ] });
1273
- }, cn = ({ currentInput: t = "" }) => {
1274
- const e = Q(), n = j(), r = B(), o = L.useMemo(
1275
- () => Z(n.fontFamily, n.fontSize),
1283
+ ] })
1284
+ ]
1285
+ }
1286
+ ) });
1287
+ }, at = ({ currentInput: t = "" }) => {
1288
+ const e = te(), n = U(), s = J(), r = $.useMemo(
1289
+ () => ne(n.fontFamily, n.fontSize),
1276
1290
  [n.fontFamily, n.fontSize]
1277
- ), s = "mt-2 border-t border-gray-700 px-4 py-2", i = `text-gray-300 ${o.className ?? ""}`.trim(), l = t.trim().toLowerCase(), a = e.getMatchingCompletions(
1278
- r.path(),
1279
- l
1291
+ ), o = t.trim().toLowerCase(), a = e.getMatchingCompletions(
1292
+ s.path(),
1293
+ o
1280
1294
  );
1281
- k.debug("[AvailableCommands] nextCommandSegments: ", a);
1282
- const c = L.useMemo(() => {
1283
- const w = [...a], h = (p) => p.name.toLowerCase() === "help", S = w.filter(h);
1284
- return [...w.filter((p) => !h(p)).sort(
1285
- (p, R) => p.name.localeCompare(R.name, void 0, { sensitivity: "base" })
1295
+ b.debug("[AvailableCommands] nextCommandSegments: ", a);
1296
+ const c = $.useMemo(() => {
1297
+ const u = [...a], h = (l) => l.name.toLowerCase() === "help", S = u.filter(h);
1298
+ return [...u.filter((l) => !h(l)).sort(
1299
+ (l, p) => l.name.localeCompare(p.name, void 0, { sensitivity: "base" })
1286
1300
  ), ...S];
1287
- }, [a]), g = L.useMemo(() => {
1288
- const w = /* @__PURE__ */ new Map();
1301
+ }, [a]), i = $.useMemo(() => {
1302
+ const u = /* @__PURE__ */ new Map();
1289
1303
  for (const h of c) {
1290
- const S = c.reduce((d, u) => {
1291
- if (u === h) return d;
1292
- let p = 0;
1293
- for (; p < h.name.length && p < u.name.length && h.name[p].toLowerCase() === u.name[p].toLowerCase(); )
1294
- p++;
1295
- return Math.max(d, p + 1);
1304
+ const S = c.reduce((C, k) => {
1305
+ if (k === h) return C;
1306
+ let l = 0;
1307
+ for (; l < h.name.length && l < k.name.length && h.name[l].toLowerCase() === k.name[l].toLowerCase(); )
1308
+ l++;
1309
+ return Math.max(C, l + 1);
1296
1310
  }, 1);
1297
- w.set(h.name, S);
1311
+ u.set(h.name, S);
1298
1312
  }
1299
- return w;
1300
- }, [c]), f = a.some((w) => w.type === "argument"), x = a[0];
1301
- return /* @__PURE__ */ m("div", { className: s, "data-testid": "available-commands", children: /* @__PURE__ */ m("div", { className: i, style: o.style, children: f ? a.length > 0 ? /* @__PURE__ */ E(Ae, { children: [
1302
- /* @__PURE__ */ m("span", { className: "text-blue-400", children: x.name }),
1303
- x.description && /* @__PURE__ */ E("span", { className: "text-gray-400 ml-2", children: [
1313
+ return u;
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: [
1316
+ /* @__PURE__ */ m("span", { className: "citadel-available-next-arg", children: g.name }),
1317
+ g.description && /* @__PURE__ */ A("span", { className: "citadel-available-next-desc", children: [
1304
1318
  "- ",
1305
- x.description
1319
+ g.description
1306
1320
  ] })
1307
- ] }) : null : /* @__PURE__ */ m("div", { className: "flex flex-wrap gap-2", children: c == null ? void 0 : c.map((w) => {
1308
- const h = g.get(w.name) ?? 1;
1321
+ ] }) : null : /* @__PURE__ */ m("div", { className: "citadel-available-chip-list", children: c == null ? void 0 : c.map((u) => {
1322
+ const h = i.get(u.name) ?? 1;
1309
1323
  return /* @__PURE__ */ m(
1310
1324
  "div",
1311
1325
  {
1312
1326
  "data-testid": "available-command-chip",
1313
- className: "px-2 py-1 rounded bg-gray-800 mr-2 last:mr-0",
1314
- children: /* @__PURE__ */ E("span", { className: "text-white", children: [
1315
- /* @__PURE__ */ m("strong", { className: "underline", children: w.name.slice(0, h) }),
1316
- w.name.slice(h)
1327
+ className: "citadel-available-chip",
1328
+ children: /* @__PURE__ */ A("span", { className: "citadel-available-chip-text", children: [
1329
+ /* @__PURE__ */ m("strong", { className: "citadel-available-chip-prefix", children: u.name.slice(0, h) }),
1330
+ u.name.slice(h)
1317
1331
  ] })
1318
1332
  },
1319
- w.name
1333
+ u.name
1320
1334
  );
1321
1335
  }) }) }) });
1322
- }, ke = ({
1336
+ }, Ne = ({
1323
1337
  state: t,
1324
1338
  actions: e,
1325
1339
  outputRef: n
1326
1340
  }) => {
1327
- const o = j().displayMode === "inline";
1328
- return /* @__PURE__ */ E("div", { className: "innerContainer", children: [
1341
+ const r = U().displayMode === "inline", o = $.useMemo(
1342
+ () => r ? { overflow: "hidden" } : void 0,
1343
+ [r]
1344
+ );
1345
+ return /* @__PURE__ */ A("div", { className: "innerContainer citadel-tty", children: [
1329
1346
  /* @__PURE__ */ m(
1330
1347
  "div",
1331
1348
  {
1332
- className: "flex-1 min-h-0 pt-3 px-4",
1349
+ className: "citadel-tty-output-pane",
1333
1350
  "data-testid": "citadel-output-pane",
1334
- style: o ? { overflow: "hidden" } : void 0,
1335
- children: /* @__PURE__ */ m(nn, { output: t.output, outputRef: n })
1351
+ style: o,
1352
+ children: /* @__PURE__ */ m(Xe, { output: t.output, outputRef: n })
1336
1353
  }
1337
1354
  ),
1338
- /* @__PURE__ */ E("div", { className: "shrink-0", children: [
1339
- /* @__PURE__ */ m(ln, { state: t, actions: e }),
1340
- /* @__PURE__ */ m(cn, { currentInput: t.isEnteringArg ? "" : t.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 })
1341
1358
  ] })
1342
1359
  ] });
1343
- }, dn = () => {
1344
- const [t, e] = I(!1), [n, r] = I(!1), o = j(), [s, i] = I(() => o.initialHeight || null), l = F(null), a = F(null), c = F(!1), g = F(0), f = F(0), { state: x, actions: w } = ae();
1345
- Oe({
1346
- onOpen: () => e(!0),
1347
- onClose: () => r(!0),
1348
- isVisible: t,
1349
- showCitadelKey: o.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
1350
1372
  });
1351
- const h = v((p) => {
1352
- var P;
1353
- if (!c.current) return;
1354
- const R = p.clientY - g.current, C = (P = o.maxHeight) != null && P.endsWith("vh") ? window.innerHeight * parseInt(o.maxHeight, 10) / 100 : parseInt(o.maxHeight || "80vh", 10), A = Math.min(
1355
- Math.max(f.current - R, parseInt(o.minHeight || "200", 10)),
1356
- C
1373
+ const l = f((M) => {
1374
+ var W;
1375
+ if (!d.current) return;
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
1357
1379
  );
1358
- a.current && (a.current.style.height = `${A}px`, a.current.style.bottom = "0", i(`${A}px`));
1359
- }, [o.maxHeight, o.minHeight]), S = v(() => {
1360
- c.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", S);
1361
- }, [h]), d = v((p) => {
1362
- a.current && (c.current = !0, g.current = p.clientY, f.current = a.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", h), document.addEventListener("mouseup", S));
1363
- }, [h, S]);
1364
- z(() => () => {
1365
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", S);
1366
- }, [h, S]);
1367
- const u = v(() => {
1368
- n && (e(!1), r(!1));
1369
- }, [n]);
1370
- return Je({
1371
- isVisible: t,
1372
- isClosing: n,
1373
- onAnimationComplete: u
1374
- }), t ? /* @__PURE__ */ E(
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(
1396
+ () => ({
1397
+ ...o ? { height: o } : {},
1398
+ maxHeight: t.maxHeight
1399
+ }),
1400
+ [t.maxHeight, o]
1401
+ );
1402
+ return e ? /* @__PURE__ */ A(
1375
1403
  "div",
1376
1404
  {
1377
- ref: a,
1378
- className: `panelContainer ${t ? "citadel_slideUp" : ""} ${n ? "citadel_slideDown" : ""}`,
1379
- style: {
1380
- ...s ? { height: s } : void 0,
1381
- maxHeight: o.maxHeight
1382
- },
1405
+ ref: i,
1406
+ className: `panelContainer ${v}`.trim(),
1407
+ style: H,
1383
1408
  children: [
1384
- /* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: d }),
1409
+ /* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: w }),
1385
1410
  /* @__PURE__ */ m(
1386
- ke,
1411
+ Ne,
1387
1412
  {
1388
- state: x,
1389
- actions: w,
1390
- outputRef: l
1413
+ state: h,
1414
+ actions: S,
1415
+ outputRef: c
1391
1416
  }
1392
1417
  )
1393
1418
  ]
1394
1419
  }
1395
1420
  ) : null;
1396
- }, ne = (t) => {
1421
+ }, ae = (t) => {
1397
1422
  if (!t) return;
1398
1423
  const e = t.trim();
1399
1424
  if (e)
1400
1425
  return /^\d+(\.\d+)?$/.test(e) ? `${e}px` : e;
1401
- }, mn = () => {
1402
- const { state: t, actions: e } = ae(), n = j(), r = F(null);
1426
+ }, it = () => {
1427
+ const { state: t, actions: e } = de(), n = U(), s = T(null), r = P(
1428
+ () => ({
1429
+ height: ae(n.initialHeight),
1430
+ maxHeight: ae(n.maxHeight),
1431
+ minHeight: ae(n.minHeight)
1432
+ }),
1433
+ [n.initialHeight, n.maxHeight, n.minHeight]
1434
+ );
1403
1435
  return /* @__PURE__ */ m(
1404
1436
  "div",
1405
1437
  {
1406
1438
  className: "inlineContainer",
1407
1439
  "data-testid": "citadel-inline-container",
1408
- style: {
1409
- height: ne(n.initialHeight),
1410
- maxHeight: ne(n.maxHeight),
1411
- minHeight: ne(n.minHeight)
1412
- },
1440
+ style: r,
1413
1441
  children: /* @__PURE__ */ m(
1414
- ke,
1442
+ Ne,
1415
1443
  {
1416
1444
  state: t,
1417
1445
  actions: e,
1418
- outputRef: r
1446
+ outputRef: s
1419
1447
  }
1420
1448
  )
1421
1449
  }
1422
1450
  );
1423
- }, pe = `:host {
1424
- --citadel-bg: rgb(17, 24, 39);
1425
- --citadel-text: rgba(255, 255, 255, 0.87);
1426
- --citadel-border: rgb(55, 65, 81);
1427
- --citadel-accent: #646cff;
1428
- --citadel-accent-hover: #535bf2;
1451
+ }, ye = `:host {
1452
+ --citadel-bg: oklch(20.8% 0.042 265.8);
1453
+ --citadel-surface: oklch(27.9% 0.041 260);
1454
+ --citadel-border: oklch(37.2% 0.044 257.3);
1455
+ --citadel-text: oklch(92.8% 0.006 264.5);
1456
+ --citadel-muted: oklch(70.7% 0.022 261.3);
1457
+ --citadel-subtle: oklch(55.1% 0.023 264.4);
1458
+ --citadel-word: oklch(70.7% 0.165 254.6);
1459
+ --citadel-arg: oklch(72.3% 0.219 149.6);
1460
+ --citadel-error: oklch(70.4% 0.191 22.2);
1461
+ --citadel-success: oklch(72.3% 0.219 149.6);
1429
1462
  --citadel-min-height: 200px;
1430
1463
  --citadel-max-height: 80vh;
1431
1464
  --citadel-default-height: 35vh;
1432
- --citadel-error: rgb(239, 68, 68);
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);
1433
1469
 
1434
1470
  display: block;
1435
1471
  pointer-events: auto;
1472
+ color: var(--citadel-text);
1436
1473
  font-synthesis: none;
1437
1474
  text-rendering: optimizeLegibility;
1438
1475
  -webkit-font-smoothing: antialiased;
1439
1476
  -moz-osx-font-smoothing: grayscale;
1440
1477
  }
1441
1478
 
1442
- :host([data-display-mode="panel"]) {
1479
+ :host([data-display-mode='panel']) {
1443
1480
  position: fixed;
1444
1481
  bottom: 0;
1445
1482
  left: 0;
@@ -1448,11 +1485,11 @@ const an = () => {
1448
1485
  height: var(--citadel-default-height);
1449
1486
  max-height: var(--citadel-max-height);
1450
1487
  min-height: var(--citadel-min-height);
1451
- z-index: 2147483647; /* Maximum z-index value */
1488
+ z-index: 2147483647;
1452
1489
  overflow: hidden;
1453
1490
  }
1454
1491
 
1455
- :host([data-display-mode="inline"]) {
1492
+ :host([data-display-mode='inline']) {
1456
1493
  position: relative;
1457
1494
  bottom: auto;
1458
1495
  left: auto;
@@ -1465,135 +1502,110 @@ const an = () => {
1465
1502
  overflow: hidden;
1466
1503
  }
1467
1504
 
1468
- button {
1469
- border-radius: 8px;
1470
- border: 1px solid transparent;
1471
- padding: 0.6em 1.2em;
1472
- font-size: 1em;
1473
- font-weight: 500;
1474
- font-family: inherit;
1475
- background-color: #1a1a1a;
1476
- cursor: pointer;
1477
- transition: border-color 0.25s;
1478
- }
1479
-
1480
- button:hover {
1481
- border-color: var(--citadel-accent);
1482
- }
1483
-
1484
- button:focus,
1485
- button:focus-visible {
1486
- outline: 4px auto -webkit-focus-ring-color;
1487
- }
1488
-
1489
- a {
1490
- font-weight: 500;
1491
- color: var(--citadel-accent);
1492
- text-decoration: inherit;
1493
- }
1494
-
1495
- a:hover {
1496
- color: var(--citadel-accent-hover);
1497
- }
1498
-
1499
- .flex-1 { flex: 1 1 0%; }
1500
- .flex-shrink-0 { flex-shrink: 0; }
1501
- .min-h-0 { min-height: 0px; }
1502
- .pt-3 { padding-top: 0.75rem; }
1503
- .px-4 { padding-left: 1rem; padding-right: 1rem; }
1504
-
1505
- .h-full {
1505
+ #citadel-root {
1506
+ width: 100%;
1506
1507
  height: 100%;
1507
1508
  }
1508
- .overflow-y-auto {
1509
- overflow-y: auto;
1510
- }
1511
- .border {
1512
- border-width: 1px;
1513
- }
1514
- .border-gray-700 {
1515
- --tw-border-opacity: 1;
1516
- border-color: rgb(55 65 81 / var(--tw-border-opacity, 1));
1517
- }
1518
- .rounded-lg {
1519
- border-radius: 0.5rem;
1520
- }
1521
- .p-3 {
1522
- padding: 0.75rem;
1523
- }
1524
- .text-left {
1525
- text-align: left;
1509
+
1510
+ #citadel-root,
1511
+ #citadel-root * {
1512
+ box-sizing: border-box;
1526
1513
  }
1527
- `, he = `/* Keep only component-specific styles here */
1528
1514
 
1529
1515
  .panelContainer {
1530
1516
  position: fixed;
1517
+ bottom: 0;
1518
+ left: 0;
1519
+ right: 0;
1520
+ width: 100%;
1531
1521
  height: var(--citadel-default-height);
1532
1522
  min-height: var(--citadel-min-height);
1533
1523
  max-height: var(--citadel-max-height);
1534
- background-color: var(--citadel-bg);
1535
- overflow: hidden;
1536
- width: 100%;
1537
- box-sizing: border-box;
1538
1524
  margin: 0;
1539
1525
  padding: 0;
1540
- bottom: 0;
1541
- left: 0;
1542
- right: 0;
1526
+ background-color: var(--citadel-bg);
1527
+ overflow: hidden;
1528
+ transform: translateY(0);
1529
+ will-change: transform;
1543
1530
  }
1544
1531
 
1545
1532
  .innerContainer {
1546
- height: 100%;
1547
- flex: 1;
1548
1533
  width: 100%;
1549
- display: flex;
1550
- flex-direction: column;
1534
+ height: 100%;
1551
1535
  margin: 0;
1552
1536
  padding: 0;
1537
+ display: flex;
1538
+ flex: 1;
1539
+ flex-direction: column;
1553
1540
  }
1554
1541
 
1555
- .inputSection {
1556
- border-top: 1px solid var(--citadel-border);
1557
- padding: 1rem;
1558
- margin: 0;
1559
- box-sizing: border-box;
1542
+ .citadel-tty {
1543
+ background: var(--citadel-bg);
1544
+ }
1545
+
1546
+ .citadel-tty-output-pane {
1547
+ display: flex;
1548
+ flex: 1 1 auto;
1549
+ min-height: 0;
1550
+ padding: 0.75rem 1rem 0;
1551
+ }
1552
+
1553
+ .citadel-tty-input-region {
1554
+ flex-shrink: 0;
1560
1555
  }
1561
1556
 
1562
1557
  .resizeHandle {
1563
- width: 100%;
1564
- height: 6px;
1565
- background: transparent;
1566
- cursor: ns-resize;
1567
1558
  position: absolute;
1568
1559
  top: -3px;
1569
1560
  left: 0;
1570
1561
  right: 0;
1571
1562
  z-index: 10;
1563
+ width: 100%;
1564
+ height: 6px;
1565
+ background: transparent;
1566
+ cursor: ns-resize;
1572
1567
  user-select: none;
1573
1568
  -webkit-user-select: none;
1574
1569
  pointer-events: all;
1575
1570
  }
1576
1571
 
1577
1572
  .resizeHandle:hover {
1578
- background: rgba(255, 255, 255, 0.1);
1573
+ background: color-mix(in oklch, var(--citadel-text) 10%, transparent);
1579
1574
  }
1580
1575
 
1581
1576
  @keyframes citadel_slideUp {
1582
- from { transform: translateY(100%); }
1583
- to { transform: translateY(0); }
1577
+ from {
1578
+ transform: translateY(100%);
1579
+ }
1580
+
1581
+ to {
1582
+ transform: translateY(0);
1583
+ }
1584
1584
  }
1585
1585
 
1586
1586
  @keyframes citadel_slideDown {
1587
- from { transform: translateY(0); }
1588
- to { transform: translateY(100%); }
1587
+ from {
1588
+ transform: translateY(0);
1589
+ }
1590
+
1591
+ to {
1592
+ transform: translateY(100%);
1593
+ }
1589
1594
  }
1590
1595
 
1591
1596
  .citadel_slideUp {
1592
- animation: citadel_slideUp 0.2s ease-out forwards;
1597
+ animation: citadel_slideUp var(--citadel-panel-enter-duration) var(--citadel-panel-enter-easing) forwards;
1593
1598
  }
1594
1599
 
1595
1600
  .citadel_slideDown {
1596
- 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
+ }
1597
1609
  }
1598
1610
 
1599
1611
  .inlineContainer {
@@ -1604,882 +1616,364 @@ a:hover {
1604
1616
  flex-direction: column;
1605
1617
  background-color: var(--citadel-bg);
1606
1618
  overflow: hidden;
1607
- box-sizing: border-box;
1608
- }
1609
- `, ge = `@tailwind base;
1610
- @tailwind components;
1611
- @tailwind utilities;
1612
- `, un = `*, ::before, ::after {
1613
- --tw-border-spacing-x: 0;
1614
- --tw-border-spacing-y: 0;
1615
- --tw-translate-x: 0;
1616
- --tw-translate-y: 0;
1617
- --tw-rotate: 0;
1618
- --tw-skew-x: 0;
1619
- --tw-skew-y: 0;
1620
- --tw-scale-x: 1;
1621
- --tw-scale-y: 1;
1622
- --tw-pan-x: ;
1623
- --tw-pan-y: ;
1624
- --tw-pinch-zoom: ;
1625
- --tw-scroll-snap-strictness: proximity;
1626
- --tw-gradient-from-position: ;
1627
- --tw-gradient-via-position: ;
1628
- --tw-gradient-to-position: ;
1629
- --tw-ordinal: ;
1630
- --tw-slashed-zero: ;
1631
- --tw-numeric-figure: ;
1632
- --tw-numeric-spacing: ;
1633
- --tw-numeric-fraction: ;
1634
- --tw-ring-inset: ;
1635
- --tw-ring-offset-width: 0px;
1636
- --tw-ring-offset-color: #fff;
1637
- --tw-ring-color: rgb(59 130 246 / 0.5);
1638
- --tw-ring-offset-shadow: 0 0 #0000;
1639
- --tw-ring-shadow: 0 0 #0000;
1640
- --tw-shadow: 0 0 #0000;
1641
- --tw-shadow-colored: 0 0 #0000;
1642
- --tw-blur: ;
1643
- --tw-brightness: ;
1644
- --tw-contrast: ;
1645
- --tw-grayscale: ;
1646
- --tw-hue-rotate: ;
1647
- --tw-invert: ;
1648
- --tw-saturate: ;
1649
- --tw-sepia: ;
1650
- --tw-drop-shadow: ;
1651
- --tw-backdrop-blur: ;
1652
- --tw-backdrop-brightness: ;
1653
- --tw-backdrop-contrast: ;
1654
- --tw-backdrop-grayscale: ;
1655
- --tw-backdrop-hue-rotate: ;
1656
- --tw-backdrop-invert: ;
1657
- --tw-backdrop-opacity: ;
1658
- --tw-backdrop-saturate: ;
1659
- --tw-backdrop-sepia: ;
1660
- --tw-contain-size: ;
1661
- --tw-contain-layout: ;
1662
- --tw-contain-paint: ;
1663
- --tw-contain-style: ;
1664
- }
1665
-
1666
- ::backdrop {
1667
- --tw-border-spacing-x: 0;
1668
- --tw-border-spacing-y: 0;
1669
- --tw-translate-x: 0;
1670
- --tw-translate-y: 0;
1671
- --tw-rotate: 0;
1672
- --tw-skew-x: 0;
1673
- --tw-skew-y: 0;
1674
- --tw-scale-x: 1;
1675
- --tw-scale-y: 1;
1676
- --tw-pan-x: ;
1677
- --tw-pan-y: ;
1678
- --tw-pinch-zoom: ;
1679
- --tw-scroll-snap-strictness: proximity;
1680
- --tw-gradient-from-position: ;
1681
- --tw-gradient-via-position: ;
1682
- --tw-gradient-to-position: ;
1683
- --tw-ordinal: ;
1684
- --tw-slashed-zero: ;
1685
- --tw-numeric-figure: ;
1686
- --tw-numeric-spacing: ;
1687
- --tw-numeric-fraction: ;
1688
- --tw-ring-inset: ;
1689
- --tw-ring-offset-width: 0px;
1690
- --tw-ring-offset-color: #fff;
1691
- --tw-ring-color: rgb(59 130 246 / 0.5);
1692
- --tw-ring-offset-shadow: 0 0 #0000;
1693
- --tw-ring-shadow: 0 0 #0000;
1694
- --tw-shadow: 0 0 #0000;
1695
- --tw-shadow-colored: 0 0 #0000;
1696
- --tw-blur: ;
1697
- --tw-brightness: ;
1698
- --tw-contrast: ;
1699
- --tw-grayscale: ;
1700
- --tw-hue-rotate: ;
1701
- --tw-invert: ;
1702
- --tw-saturate: ;
1703
- --tw-sepia: ;
1704
- --tw-drop-shadow: ;
1705
- --tw-backdrop-blur: ;
1706
- --tw-backdrop-brightness: ;
1707
- --tw-backdrop-contrast: ;
1708
- --tw-backdrop-grayscale: ;
1709
- --tw-backdrop-hue-rotate: ;
1710
- --tw-backdrop-invert: ;
1711
- --tw-backdrop-opacity: ;
1712
- --tw-backdrop-saturate: ;
1713
- --tw-backdrop-sepia: ;
1714
- --tw-contain-size: ;
1715
- --tw-contain-layout: ;
1716
- --tw-contain-paint: ;
1717
- --tw-contain-style: ;
1718
- }/*
1719
- ! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com
1720
- *//*
1721
- 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
1722
- 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
1723
- */
1724
-
1725
- *,
1726
- ::before,
1727
- ::after {
1728
- box-sizing: border-box; /* 1 */
1729
- border-width: 0; /* 2 */
1730
- border-style: solid; /* 2 */
1731
- border-color: #e5e7eb; /* 2 */
1732
- }
1733
-
1734
- ::before,
1735
- ::after {
1736
- --tw-content: '';
1737
- }
1738
-
1739
- /*
1740
- 1. Use a consistent sensible line-height in all browsers.
1741
- 2. Prevent adjustments of font size after orientation changes in iOS.
1742
- 3. Use a more readable tab size.
1743
- 4. Use the user's configured \`sans\` font-family by default.
1744
- 5. Use the user's configured \`sans\` font-feature-settings by default.
1745
- 6. Use the user's configured \`sans\` font-variation-settings by default.
1746
- 7. Disable tap highlights on iOS
1747
- */
1748
-
1749
- html,
1750
- :host {
1751
- line-height: 1.5; /* 1 */
1752
- -webkit-text-size-adjust: 100%; /* 2 */
1753
- -moz-tab-size: 4; /* 3 */
1754
- -o-tab-size: 4;
1755
- tab-size: 4; /* 3 */
1756
- font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
1757
- font-feature-settings: normal; /* 5 */
1758
- font-variation-settings: normal; /* 6 */
1759
- -webkit-tap-highlight-color: transparent; /* 7 */
1760
- }
1761
-
1762
- /*
1763
- 1. Remove the margin in all browsers.
1764
- 2. Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element.
1765
- */
1766
-
1767
- body {
1768
- margin: 0; /* 1 */
1769
- line-height: inherit; /* 2 */
1770
- }
1771
-
1772
- /*
1773
- 1. Add the correct height in Firefox.
1774
- 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
1775
- 3. Ensure horizontal rules are visible by default.
1776
- */
1777
-
1778
- hr {
1779
- height: 0; /* 1 */
1780
- color: inherit; /* 2 */
1781
- border-top-width: 1px; /* 3 */
1782
- }
1783
-
1784
- /*
1785
- Add the correct text decoration in Chrome, Edge, and Safari.
1786
- */
1787
-
1788
- abbr:where([title]) {
1789
- -webkit-text-decoration: underline dotted;
1790
- text-decoration: underline dotted;
1791
- }
1792
-
1793
- /*
1794
- Remove the default font size and weight for headings.
1795
- */
1796
-
1797
- h1,
1798
- h2,
1799
- h3,
1800
- h4,
1801
- h5,
1802
- h6 {
1803
- font-size: inherit;
1804
- font-weight: inherit;
1805
- }
1806
-
1807
- /*
1808
- Reset links to optimize for opt-in styling instead of opt-out.
1809
- */
1810
-
1811
- a {
1812
- color: inherit;
1813
- text-decoration: inherit;
1814
- }
1815
-
1816
- /*
1817
- Add the correct font weight in Edge and Safari.
1818
- */
1819
-
1820
- b,
1821
- strong {
1822
- font-weight: bolder;
1823
1619
  }
1824
1620
 
1825
- /*
1826
- 1. Use the user's configured \`mono\` font-family by default.
1827
- 2. Use the user's configured \`mono\` font-feature-settings by default.
1828
- 3. Use the user's configured \`mono\` font-variation-settings by default.
1829
- 4. Correct the odd \`em\` font sizing in all browsers.
1830
- */
1831
-
1832
- code,
1833
- kbd,
1834
- samp,
1835
- pre {
1836
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
1837
- font-feature-settings: normal; /* 2 */
1838
- font-variation-settings: normal; /* 3 */
1839
- font-size: 1em; /* 4 */
1840
- }
1841
-
1842
- /*
1843
- Add the correct font size in all browsers.
1844
- */
1845
-
1846
- small {
1847
- font-size: 80%;
1621
+ .citadel-output {
1622
+ width: 100%;
1623
+ height: 100%;
1624
+ overflow-y: auto;
1625
+ padding: 0.75rem;
1626
+ border: 1px solid var(--citadel-border);
1627
+ border-radius: 0.5rem;
1628
+ background: color-mix(in oklch, var(--citadel-bg) 75%, black);
1629
+ text-align: left;
1848
1630
  }
1849
1631
 
1850
- /*
1851
- Prevent \`sub\` and \`sup\` elements from affecting the line height in all browsers.
1852
- */
1853
-
1854
- sub,
1855
- sup {
1856
- font-size: 75%;
1857
- line-height: 0;
1858
- position: relative;
1859
- vertical-align: baseline;
1632
+ .citadel-output-item {
1633
+ margin-bottom: 1rem;
1860
1634
  }
1861
1635
 
1862
- sub {
1863
- bottom: -0.25em;
1636
+ .citadel-output-item:last-child {
1637
+ margin-bottom: 0;
1864
1638
  }
1865
1639
 
1866
- sup {
1867
- top: -0.5em;
1640
+ .citadel-output-content {
1641
+ margin-top: 0.35rem;
1642
+ color: var(--citadel-text);
1868
1643
  }
1869
1644
 
1870
- /*
1871
- 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
1872
- 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
1873
- 3. Remove gaps between table borders by default.
1874
- */
1875
-
1876
- table {
1877
- text-indent: 0; /* 1 */
1878
- border-color: inherit; /* 2 */
1879
- border-collapse: collapse; /* 3 */
1645
+ .citadel-output-content > :first-child {
1646
+ margin-top: 0;
1880
1647
  }
1881
1648
 
1882
- /*
1883
- 1. Change the font styles in all browsers.
1884
- 2. Remove the margin in Firefox and Safari.
1885
- 3. Remove default padding in all browsers.
1886
- */
1887
-
1888
- button,
1889
- input,
1890
- optgroup,
1891
- select,
1892
- textarea {
1893
- font-family: inherit; /* 1 */
1894
- font-feature-settings: inherit; /* 1 */
1895
- font-variation-settings: inherit; /* 1 */
1896
- font-size: 100%; /* 1 */
1897
- font-weight: inherit; /* 1 */
1898
- line-height: inherit; /* 1 */
1899
- letter-spacing: inherit; /* 1 */
1900
- color: inherit; /* 1 */
1901
- margin: 0; /* 2 */
1902
- padding: 0; /* 3 */
1649
+ .citadel-output-content > :last-child {
1650
+ margin-bottom: 0;
1903
1651
  }
1904
1652
 
1905
- /*
1906
- Remove the inheritance of text transform in Edge and Firefox.
1907
- */
1908
-
1909
- button,
1910
- select {
1911
- text-transform: none;
1653
+ .citadel-output-line {
1654
+ display: flex;
1655
+ flex-wrap: wrap;
1656
+ align-items: center;
1657
+ gap: 0.5rem;
1912
1658
  }
1913
1659
 
1914
- /*
1915
- 1. Correct the inability to style clickable types in iOS and Safari.
1916
- 2. Remove default button styles.
1917
- */
1918
-
1919
- button,
1920
- input:where([type='button']),
1921
- input:where([type='reset']),
1922
- input:where([type='submit']) {
1923
- -webkit-appearance: button; /* 1 */
1924
- background-color: transparent; /* 2 */
1925
- background-image: none; /* 2 */
1660
+ .citadel-output-command,
1661
+ .citadel-output-command-word {
1662
+ color: var(--citadel-text);
1926
1663
  }
1927
1664
 
1928
- /*
1929
- Use the modern Firefox focus style for all focusable elements.
1930
- */
1931
-
1932
- :-moz-focusring {
1933
- outline: auto;
1665
+ .citadel-output-command-arg {
1666
+ color: var(--citadel-arg);
1934
1667
  }
1935
1668
 
1936
- /*
1937
- Remove the additional \`:invalid\` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
1938
- */
1669
+ .citadel-output-separator {
1670
+ color: var(--citadel-muted);
1671
+ }
1939
1672
 
1940
- :-moz-ui-invalid {
1941
- box-shadow: none;
1673
+ .citadel-output-timestamp {
1674
+ color: var(--citadel-subtle);
1942
1675
  }
1943
1676
 
1944
- /*
1945
- Add the correct vertical alignment in Chrome and Firefox.
1946
- */
1677
+ .citadel-status-dot {
1678
+ width: 1rem;
1679
+ height: 1rem;
1680
+ border-radius: 999px;
1681
+ }
1947
1682
 
1948
- progress {
1949
- vertical-align: baseline;
1683
+ .citadel-status-dot-success {
1684
+ background: var(--citadel-success);
1950
1685
  }
1951
1686
 
1952
- /*
1953
- Correct the cursor style of increment and decrement buttons in Safari.
1954
- */
1687
+ .citadel-status-dot-failure {
1688
+ background: var(--citadel-error);
1689
+ }
1955
1690
 
1956
- ::-webkit-inner-spin-button,
1957
- ::-webkit-outer-spin-button {
1958
- height: auto;
1691
+ .citadel-spinner {
1692
+ width: 1rem;
1693
+ height: 1rem;
1694
+ border: 2px solid color-mix(in oklch, var(--citadel-text) 60%, transparent);
1695
+ border-top-color: color-mix(in oklch, var(--citadel-muted) 80%, black);
1696
+ border-radius: 999px;
1697
+ animation: citadel-spin 0.9s linear infinite;
1959
1698
  }
1960
1699
 
1961
- /*
1962
- 1. Correct the odd appearance in Chrome and Safari.
1963
- 2. Correct the outline style in Safari.
1964
- */
1700
+ @keyframes citadel-spin {
1701
+ to {
1702
+ transform: rotate(360deg);
1703
+ }
1704
+ }
1965
1705
 
1966
- [type='search'] {
1967
- -webkit-appearance: textfield; /* 1 */
1968
- outline-offset: -2px; /* 2 */
1706
+ .citadel-input-shell {
1707
+ width: 100%;
1708
+ padding: 1rem;
1709
+ border-radius: 0.5rem;
1710
+ background-color: var(--citadel-bg);
1969
1711
  }
1970
1712
 
1971
- /*
1972
- Remove the inner padding in Chrome and Safari on macOS.
1973
- */
1713
+ .citadel-input-line {
1714
+ display: flex;
1715
+ align-items: center;
1716
+ gap: 0.5rem;
1717
+ }
1974
1718
 
1975
- ::-webkit-search-decoration {
1976
- -webkit-appearance: none;
1719
+ .citadel-input-prompt {
1720
+ color: var(--citadel-muted);
1977
1721
  }
1978
1722
 
1979
- /*
1980
- 1. Correct the inability to style clickable types in iOS and Safari.
1981
- 2. Change font properties to \`inherit\` in Safari.
1982
- */
1723
+ .citadel-input-row {
1724
+ display: flex;
1725
+ align-items: center;
1726
+ flex: 1 1 auto;
1727
+ min-width: 0;
1728
+ }
1983
1729
 
1984
- ::-webkit-file-upload-button {
1985
- -webkit-appearance: button; /* 1 */
1986
- font: inherit; /* 2 */
1730
+ .citadel-input-segments {
1731
+ display: flex;
1732
+ align-items: center;
1733
+ gap: 0.25rem;
1987
1734
  }
1988
1735
 
1989
- /*
1990
- Add the correct display in Chrome and Safari.
1991
- */
1736
+ .citadel-input-segment-arg {
1737
+ color: var(--citadel-text);
1738
+ white-space: pre;
1739
+ }
1992
1740
 
1993
- summary {
1994
- display: list-item;
1741
+ .citadel-input-segment-word {
1742
+ color: var(--citadel-word);
1743
+ white-space: pre;
1995
1744
  }
1996
1745
 
1997
- /*
1998
- Removes the default spacing and border for appropriate elements.
1999
- */
1746
+ .citadel-input-segment-space {
1747
+ color: var(--citadel-text);
1748
+ white-space: pre;
1749
+ }
2000
1750
 
2001
- blockquote,
2002
- dl,
2003
- dd,
2004
- h1,
2005
- h2,
2006
- h3,
2007
- h4,
2008
- h5,
2009
- h6,
2010
- hr,
2011
- figure,
2012
- p,
2013
- pre {
2014
- margin: 0;
1751
+ .citadel-input-segment-space-command {
1752
+ color: var(--citadel-word);
2015
1753
  }
2016
1754
 
2017
- fieldset {
2018
- margin: 0;
2019
- padding: 0;
1755
+ .citadel-input-control {
1756
+ position: relative;
1757
+ flex: 1 1 auto;
1758
+ min-width: 0;
2020
1759
  }
2021
1760
 
2022
- legend {
2023
- padding: 0;
1761
+ .citadel-input-measure {
1762
+ position: absolute;
1763
+ top: 0;
1764
+ left: 0;
1765
+ visibility: hidden;
1766
+ pointer-events: none;
1767
+ white-space: pre;
1768
+ font: inherit;
1769
+ letter-spacing: inherit;
2024
1770
  }
2025
1771
 
2026
- ol,
2027
- ul,
2028
- menu {
2029
- list-style: none;
1772
+ .citadel-input-field {
1773
+ width: 100%;
2030
1774
  margin: 0;
2031
1775
  padding: 0;
1776
+ border: 0;
1777
+ border-radius: 0;
1778
+ outline: none;
1779
+ background: transparent;
1780
+ font: inherit;
1781
+ line-height: inherit;
1782
+ letter-spacing: inherit;
1783
+ appearance: none;
1784
+ -webkit-appearance: none;
1785
+ caret-color: transparent;
2032
1786
  }
2033
1787
 
2034
- /*
2035
- Reset default styling for dialogs.
2036
- */
2037
- dialog {
2038
- padding: 0;
1788
+ .citadel-input-field::placeholder {
1789
+ color: var(--citadel-subtle);
1790
+ opacity: 1;
2039
1791
  }
2040
1792
 
2041
- /*
2042
- Prevent resizing textareas horizontally by default.
2043
- */
2044
-
2045
- textarea {
2046
- resize: vertical;
1793
+ .citadel-input-field.is-command-mode {
1794
+ color: var(--citadel-word);
2047
1795
  }
2048
1796
 
2049
- /*
2050
- 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2051
- 2. Set the default placeholder color to the user's configured gray 400 color.
2052
- */
2053
-
2054
- input::-moz-placeholder, textarea::-moz-placeholder {
2055
- opacity: 1; /* 1 */
2056
- color: #9ca3af; /* 2 */
1797
+ .citadel-input-field.is-argument-mode {
1798
+ color: var(--citadel-text);
2057
1799
  }
2058
1800
 
2059
- input::placeholder,
2060
- textarea::placeholder {
2061
- opacity: 1; /* 1 */
2062
- color: #9ca3af; /* 2 */
1801
+ .citadel-input-cursor {
1802
+ position: absolute;
1803
+ top: 0;
1804
+ pointer-events: none;
2063
1805
  }
2064
1806
 
2065
- /*
2066
- Set the default cursor for buttons.
2067
- */
1807
+ @keyframes citadel-invalid-glow {
1808
+ 0%,
1809
+ 100% {
1810
+ box-shadow: 0 0 0 color-mix(in oklch, var(--citadel-error) 0%, transparent);
1811
+ }
2068
1812
 
2069
- button,
2070
- [role="button"] {
2071
- cursor: pointer;
1813
+ 50% {
1814
+ box-shadow: 0 0 8px color-mix(in oklch, var(--citadel-error) 70%, transparent);
1815
+ }
2072
1816
  }
2073
1817
 
2074
- /*
2075
- Make sure disabled buttons don't get the pointer cursor.
2076
- */
2077
- :disabled {
2078
- cursor: default;
1818
+ .invalid-input-animation {
1819
+ animation: citadel-invalid-glow 0.4s ease-in-out;
2079
1820
  }
2080
1821
 
2081
- /*
2082
- 1. Make replaced elements \`display: block\` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2083
- 2. Add \`vertical-align: middle\` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
2084
- This can trigger a poorly considered lint error in some tools but is included by design.
2085
- */
1822
+ .citadel-cursor-wrapper {
1823
+ position: relative;
1824
+ display: inline-block;
1825
+ }
2086
1826
 
2087
- img,
2088
- svg,
2089
- video,
2090
- canvas,
2091
- audio,
2092
- iframe,
2093
- embed,
2094
- object {
2095
- display: block; /* 1 */
2096
- vertical-align: middle; /* 2 */
1827
+ .command-cursor {
1828
+ display: inline-block;
1829
+ white-space: pre;
2097
1830
  }
2098
1831
 
2099
- /*
2100
- Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
2101
- */
1832
+ @keyframes citadel-shake {
1833
+ 0%,
1834
+ 100% {
1835
+ transform: translateX(0);
1836
+ }
2102
1837
 
2103
- img,
2104
- video {
2105
- max-width: 100%;
2106
- height: auto;
2107
- }
1838
+ 25% {
1839
+ transform: translateX(-4px);
1840
+ }
2108
1841
 
2109
- /* Make elements with the HTML hidden attribute stay hidden by default */
2110
- [hidden]:where(:not([hidden="until-found"])) {
2111
- display: none;
2112
- }
2113
- .container {
2114
- width: 100%;
2115
- }
2116
- .pointer-events-none {
2117
- pointer-events: none;
2118
- }
2119
- .visible {
2120
- visibility: visible;
2121
- }
2122
- .static {
2123
- position: static;
2124
- }
2125
- .fixed {
2126
- position: fixed;
2127
- }
2128
- .absolute {
2129
- position: absolute;
2130
- }
2131
- .relative {
2132
- position: relative;
2133
- }
2134
- .top-0 {
2135
- top: 0px;
2136
- }
2137
- .my-2 {
2138
- margin-top: 0.5rem;
2139
- margin-bottom: 0.5rem;
2140
- }
2141
- .mb-4 {
2142
- margin-bottom: 1rem;
2143
- }
2144
- .ml-2 {
2145
- margin-left: 0.5rem;
2146
- }
2147
- .mr-2 {
2148
- margin-right: 0.5rem;
1842
+ 75% {
1843
+ transform: translateX(4px);
1844
+ }
2149
1845
  }
2150
- .mt-1 {
2151
- margin-top: 0.25rem;
1846
+
1847
+ .animate-shake {
1848
+ animation: citadel-shake 0.2s ease-in-out;
2152
1849
  }
2153
- .mt-2 {
1850
+
1851
+ .citadel-available-commands {
2154
1852
  margin-top: 0.5rem;
1853
+ padding: 0.5rem 1rem;
1854
+ border-top: 1px solid var(--citadel-border);
2155
1855
  }
2156
- .block {
2157
- display: block;
2158
- }
2159
- .inline-block {
2160
- display: inline-block;
2161
- }
2162
- .flex {
2163
- display: flex;
2164
- }
2165
- .hidden {
2166
- display: none;
2167
- }
2168
- .h-12 {
2169
- height: 3rem;
2170
- }
2171
- .h-4 {
2172
- height: 1rem;
2173
- }
2174
- .h-auto {
2175
- height: auto;
2176
- }
2177
- .h-full {
2178
- height: 100%;
2179
- }
2180
- .max-h-\\[300px\\] {
2181
- max-height: 300px;
2182
- }
2183
- .min-h-0 {
2184
- min-height: 0px;
2185
- }
2186
- .min-h-screen {
2187
- min-height: 100vh;
2188
- }
2189
- .w-4 {
2190
- width: 1rem;
2191
- }
2192
- .w-full {
2193
- width: 100%;
2194
- }
2195
- .max-w-\\[400px\\] {
2196
- max-width: 400px;
2197
- }
2198
- .flex-1 {
2199
- flex: 1 1 0%;
2200
- }
2201
- .flex-shrink-0 {
2202
- flex-shrink: 0;
2203
- }
2204
- .transform {
2205
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2206
- }
2207
- @keyframes spin {
2208
1856
 
2209
- to {
2210
- transform: rotate(360deg);
2211
- }
2212
- }
2213
- .animate-spin {
2214
- animation: spin 1s linear infinite;
2215
- }
2216
- .flex-col {
2217
- flex-direction: column;
1857
+ .citadel-available-commands-content {
1858
+ color: var(--citadel-muted);
2218
1859
  }
2219
- .flex-wrap {
1860
+
1861
+ .citadel-available-chip-list {
1862
+ display: flex;
2220
1863
  flex-wrap: wrap;
2221
- }
2222
- .items-center {
2223
- align-items: center;
2224
- }
2225
- .justify-center {
2226
- justify-content: center;
2227
- }
2228
- .gap-2 {
2229
1864
  gap: 0.5rem;
2230
1865
  }
2231
- .overflow-y-auto {
2232
- overflow-y: auto;
2233
- }
2234
- .whitespace-pre {
2235
- white-space: pre;
2236
- }
2237
- .rounded {
2238
- border-radius: 0.25rem;
2239
- }
2240
- .rounded-full {
2241
- border-radius: 9999px;
2242
- }
2243
- .rounded-lg {
2244
- border-radius: 0.5rem;
2245
- }
2246
- .border {
2247
- border-width: 1px;
2248
- }
2249
- .border-2 {
2250
- border-width: 2px;
2251
- }
2252
- .border-t {
2253
- border-top-width: 1px;
2254
- }
2255
- .border-gray-300 {
2256
- --tw-border-opacity: 1;
2257
- border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
2258
- }
2259
- .border-gray-700 {
2260
- --tw-border-opacity: 1;
2261
- border-color: rgb(55 65 81 / var(--tw-border-opacity, 1));
2262
- }
2263
- .border-t-gray-600 {
2264
- --tw-border-opacity: 1;
2265
- border-top-color: rgb(75 85 99 / var(--tw-border-opacity, 1));
2266
- }
2267
- .bg-gray-100 {
2268
- --tw-bg-opacity: 1;
2269
- background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
2270
- }
2271
- .bg-gray-800 {
2272
- --tw-bg-opacity: 1;
2273
- background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
2274
- }
2275
- .bg-gray-900 {
2276
- --tw-bg-opacity: 1;
2277
- background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));
2278
- }
2279
- .bg-green-500 {
2280
- --tw-bg-opacity: 1;
2281
- background-color: rgb(34 197 94 / var(--tw-bg-opacity, 1));
2282
- }
2283
- .bg-red-500 {
2284
- --tw-bg-opacity: 1;
2285
- background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));
2286
- }
2287
- .bg-transparent {
2288
- background-color: transparent;
2289
- }
2290
- .bg-white {
2291
- --tw-bg-opacity: 1;
2292
- background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
2293
- }
2294
- .object-contain {
2295
- -o-object-fit: contain;
2296
- object-fit: contain;
2297
- }
2298
- .p-3 {
2299
- padding: 0.75rem;
2300
- }
2301
- .p-4 {
2302
- padding: 1rem;
2303
- }
2304
- .p-6 {
2305
- padding: 1.5rem;
2306
- }
2307
- .px-2 {
2308
- padding-left: 0.5rem;
2309
- padding-right: 0.5rem;
2310
- }
2311
- .px-4 {
2312
- padding-left: 1rem;
2313
- padding-right: 1rem;
2314
- }
2315
- .py-1 {
2316
- padding-top: 0.25rem;
2317
- padding-bottom: 0.25rem;
2318
- }
2319
- .pt-2 {
2320
- padding-top: 0.5rem;
2321
- }
2322
- .pt-3 {
2323
- padding-top: 0.75rem;
2324
- }
2325
- .text-left {
2326
- text-align: left;
2327
- }
2328
- .font-mono {
2329
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
2330
- }
2331
- .text-base {
2332
- font-size: 1rem;
2333
- line-height: 1.5rem;
2334
- }
2335
- .text-lg {
2336
- font-size: 1.125rem;
2337
- line-height: 1.75rem;
2338
- }
2339
- .text-sm {
2340
- font-size: 0.875rem;
2341
- line-height: 1.25rem;
2342
- }
2343
- .text-xs {
2344
- font-size: 0.75rem;
2345
- line-height: 1rem;
2346
- }
2347
- .text-blue-400 {
2348
- --tw-text-opacity: 1;
2349
- color: rgb(96 165 250 / var(--tw-text-opacity, 1));
2350
- }
2351
- .text-gray-200 {
2352
- --tw-text-opacity: 1;
2353
- color: rgb(229 231 235 / var(--tw-text-opacity, 1));
2354
- }
2355
- .text-gray-300 {
2356
- --tw-text-opacity: 1;
2357
- color: rgb(209 213 219 / var(--tw-text-opacity, 1));
2358
- }
2359
- .text-gray-400 {
2360
- --tw-text-opacity: 1;
2361
- color: rgb(156 163 175 / var(--tw-text-opacity, 1));
2362
- }
2363
- .text-gray-500 {
2364
- --tw-text-opacity: 1;
2365
- color: rgb(107 114 128 / var(--tw-text-opacity, 1));
2366
- }
2367
- .text-gray-700 {
2368
- --tw-text-opacity: 1;
2369
- color: rgb(55 65 81 / var(--tw-text-opacity, 1));
2370
- }
2371
- .text-green-500 {
2372
- --tw-text-opacity: 1;
2373
- color: rgb(34 197 94 / var(--tw-text-opacity, 1));
2374
- }
2375
- .text-red-400 {
2376
- --tw-text-opacity: 1;
2377
- color: rgb(248 113 113 / var(--tw-text-opacity, 1));
2378
- }
2379
- .text-red-500 {
2380
- --tw-text-opacity: 1;
2381
- color: rgb(239 68 68 / var(--tw-text-opacity, 1));
2382
- }
2383
- .text-white {
2384
- --tw-text-opacity: 1;
2385
- color: rgb(255 255 255 / var(--tw-text-opacity, 1));
1866
+
1867
+ .citadel-available-chip {
1868
+ padding: 0.25rem 0.5rem;
1869
+ border-radius: 0.375rem;
1870
+ background: var(--citadel-surface);
2386
1871
  }
2387
- .underline {
2388
- text-decoration-line: underline;
1872
+
1873
+ .citadel-available-chip-text {
1874
+ color: white;
2389
1875
  }
2390
- .caret-transparent {
2391
- caret-color: transparent;
1876
+
1877
+ .citadel-available-chip-prefix {
1878
+ text-decoration: underline;
2392
1879
  }
2393
- .shadow {
2394
- --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
2395
- --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
2396
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1880
+
1881
+ .citadel-available-next-arg {
1882
+ color: var(--citadel-word);
2397
1883
  }
2398
- .shadow-lg {
2399
- --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2400
- --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
2401
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1884
+
1885
+ .citadel-available-next-desc {
1886
+ margin-left: 0.5rem;
1887
+ color: var(--citadel-muted);
2402
1888
  }
2403
- .outline-none {
2404
- outline: 2px solid transparent;
2405
- outline-offset: 2px;
1889
+
1890
+ .citadel-result-json,
1891
+ .citadel-result-text {
1892
+ color: var(--citadel-text);
2406
1893
  }
2407
- .filter {
2408
- filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
1894
+
1895
+ .citadel-result-json {
1896
+ margin: 0;
2409
1897
  }
2410
- .transition {
2411
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
2412
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
2413
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
2414
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2415
- transition-duration: 150ms;
1898
+
1899
+ .citadel-result-text {
1900
+ white-space: pre;
2416
1901
  }
2417
- .ease-in-out {
2418
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1902
+
1903
+ .citadel-result-error {
1904
+ margin-top: 0.25rem;
1905
+ color: var(--citadel-error);
2419
1906
  }
2420
- .ease-out {
2421
- transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
1907
+
1908
+ .citadel-result-pending {
1909
+ color: var(--citadel-muted);
2422
1910
  }
2423
- .last\\:mb-0:last-child {
2424
- margin-bottom: 0px;
1911
+
1912
+ .citadel-result-image-wrap {
1913
+ margin-block: 0.5rem;
2425
1914
  }
2426
- .last\\:mr-0:last-child {
2427
- margin-right: 0px;
1915
+
1916
+ .citadel-result-image {
1917
+ max-width: 400px;
1918
+ max-height: 300px;
1919
+ height: auto;
1920
+ object-fit: contain;
1921
+ border-radius: 0.5rem;
2428
1922
  }
2429
- `, En = ({
2430
- config: t = N,
1923
+ `, vt = ({
1924
+ config: t = x,
2431
1925
  commandRegistry: e,
2432
1926
  containerId: n = null
2433
1927
  }) => {
2434
- const r = F(new X()), o = e ?? r.current, s = F(null), i = t.displayMode ?? N.displayMode ?? "panel";
2435
- return z(() => {
2436
- k.configure({
2437
- level: t.logLevel || N.logLevel || re.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,
2438
1932
  prefix: "[Citadel]"
2439
1933
  });
2440
- const l = new Ee(o, t), a = i === "inline" && !n, c = a ? s.current : n ? document.getElementById(n) : document.body;
2441
- if (c)
2442
- c.appendChild(l);
1934
+ const i = new Ae(r, t), d = c === "inline" && !n, g = d ? o.current : n ? document.getElementById(n) : document.body;
1935
+ if (g)
1936
+ g.appendChild(i);
2443
1937
  else {
2444
- if (a) {
1938
+ if (d) {
2445
1939
  console.warn("[Citadel] No host available for inline mode; skipping mount.");
2446
1940
  return;
2447
1941
  }
2448
- console.warn(`Container with id "${n}" not found, falling back to body`), document.body.appendChild(l);
1942
+ console.warn(`Container with id "${n}" not found, falling back to body`), document.body.appendChild(i);
2449
1943
  }
2450
1944
  return () => {
2451
- var g;
2452
- (g = l.parentElement) == null || g.removeChild(l);
1945
+ var u;
1946
+ (u = i.parentElement) == null || u.removeChild(i);
2453
1947
  };
2454
- }, [o, n, t, i]), i === "inline" && !n ? /* @__PURE__ */ m("div", { ref: s, style: { width: "100%", height: "100%" } }) : null;
1948
+ }, [r, n, t, c]), c === "inline" && !n ? /* @__PURE__ */ m("div", { ref: o, style: a }) : null;
2455
1949
  };
2456
- class Ee extends HTMLElement {
2457
- constructor(n, r) {
2458
- var s;
1950
+ class Ae extends HTMLElement {
1951
+ constructor(n, s) {
1952
+ var o;
2459
1953
  super();
2460
- b(this, "shadow");
2461
- b(this, "root", null);
2462
- b(this, "commandRegistry");
2463
- b(this, "config");
2464
- this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry = n, this.config = r;
2465
- const o = ((s = this.config) == null ? void 0 : s.displayMode) ?? "panel";
2466
- this.setAttribute("data-display-mode", o);
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";
1960
+ this.setAttribute("data-display-mode", r);
2467
1961
  }
2468
1962
  connectedCallback() {
2469
1963
  try {
2470
- const r = [pe, he, ge, un].map((o) => {
2471
- const s = new CSSStyleSheet();
2472
- return s.replaceSync(o), s;
1964
+ const s = [ye].map((r) => {
1965
+ const o = new CSSStyleSheet();
1966
+ return o.replaceSync(r), o;
2473
1967
  });
2474
- this.shadow.adoptedStyleSheets = [...r];
1968
+ this.shadow.adoptedStyleSheets = [...s];
2475
1969
  } catch {
2476
- const r = [pe, he, ge].join(`
2477
- `), o = document.createElement("style");
2478
- o.textContent = r, this.shadow.appendChild(o);
1970
+ const s = [ye].join(`
1971
+ `), r = document.createElement("style");
1972
+ r.textContent = s, this.shadow.appendChild(r);
2479
1973
  }
2480
1974
  const n = document.createElement("div");
2481
- n.id = "citadel-root", n.style.width = "100%", n.style.height = "100%", this.shadow.appendChild(n), this.root = Re(n), this.root.render(
2482
- /* @__PURE__ */ m(Le, { config: this.config || N, commandRegistry: this.commandRegistry, children: /* @__PURE__ */ m(pn, {}) })
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, {}) })
2483
1977
  );
2484
1978
  }
2485
1979
  disconnectedCallback() {
@@ -2493,11 +1987,11 @@ class Ee extends HTMLElement {
2493
1987
  });
2494
1988
  }
2495
1989
  }
2496
- typeof window < "u" && window.customElements && !window.customElements.get("citadel-element") && window.customElements.define("citadel-element", Ee);
2497
- const pn = () => (j().displayMode ?? "panel") === "inline" ? /* @__PURE__ */ m(mn, {}) : /* @__PURE__ */ m(dn, {});
2498
- class hn {
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 {
2499
1993
  constructor() {
2500
- b(this, "_description");
1994
+ y(this, "_description");
2501
1995
  }
2502
1996
  describe(e) {
2503
1997
  return this._description = e, this;
@@ -2506,13 +2000,13 @@ class hn {
2506
2000
  return this._description;
2507
2001
  }
2508
2002
  }
2509
- class gn {
2003
+ class dt {
2510
2004
  constructor(e) {
2511
- b(this, "state");
2005
+ y(this, "state");
2512
2006
  this.state = {
2513
2007
  path: e,
2514
2008
  description: "",
2515
- segments: fn(e)
2009
+ segments: mt(e)
2516
2010
  };
2517
2011
  }
2518
2012
  describe(e) {
@@ -2522,11 +2016,11 @@ class gn {
2522
2016
  return this.state.details = e, this;
2523
2017
  }
2524
2018
  arg(e, n) {
2525
- const r = new hn();
2526
- return n == null || n(r), this.state.segments.push({
2019
+ const s = new lt();
2020
+ return n == null || n(s), this.state.segments.push({
2527
2021
  type: "argument",
2528
2022
  name: e,
2529
- description: r.description
2023
+ description: s.description
2530
2024
  }), this;
2531
2025
  }
2532
2026
  handle(e) {
@@ -2539,85 +2033,90 @@ class gn {
2539
2033
  };
2540
2034
  }
2541
2035
  }
2542
- function fn(t) {
2036
+ function mt(t) {
2543
2037
  const e = t.trim();
2544
2038
  if (!e)
2545
2039
  throw new Error("Command path cannot be empty");
2546
2040
  const n = e.split(".");
2547
- if (n.some((r) => r.trim() === ""))
2041
+ if (n.some((s) => s.trim() === ""))
2548
2042
  throw new Error(`Invalid command path "${t}". Empty segments are not allowed.`);
2549
- if (n.some((r) => r.includes(" ")))
2043
+ if (n.some((s) => s.includes(" ")))
2550
2044
  throw new Error(
2551
2045
  `Invalid command path "${t}". Use dot-delimited words (e.g. "user.show").`
2552
2046
  );
2553
- return n.map((r) => ({
2047
+ return n.map((s) => ({
2554
2048
  type: "word",
2555
- name: r
2049
+ name: s
2556
2050
  }));
2557
2051
  }
2558
- function wn(t) {
2052
+ function ut(t) {
2559
2053
  return t.flatMap((e) => e.type === "argument" ? [e.name] : []);
2560
2054
  }
2561
- function yn(t) {
2562
- const e = wn(t.segments);
2055
+ function pt(t) {
2056
+ const e = ut(t.segments);
2563
2057
  return async (n) => {
2564
- const r = e.reduce((o, s, i) => (o[s] = n[i], o), {});
2058
+ const s = e.reduce((r, o, a) => (r[o] = n[a], r), {});
2565
2059
  return Promise.resolve(
2566
2060
  t.handler({
2567
2061
  rawArgs: n,
2568
- namedArgs: r,
2062
+ namedArgs: s,
2569
2063
  commandPath: t.path
2570
2064
  })
2571
2065
  );
2572
2066
  };
2573
2067
  }
2574
- function Nn(t) {
2575
- return new gn(t);
2068
+ function St(t) {
2069
+ return new dt(t);
2576
2070
  }
2577
- function bn(t, e) {
2071
+ function ht(t, e) {
2578
2072
  t.addCommand(
2579
2073
  e.segments,
2580
2074
  e.description,
2581
- yn(e)
2075
+ pt(e)
2582
2076
  );
2583
2077
  }
2584
- function xn(t, e) {
2585
- return e.forEach((n) => bn(t, n)), t;
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);
2586
2084
  }
2587
- function zn(t) {
2588
- const e = new X();
2589
- return xn(e, t);
2085
+ function bt(t) {
2086
+ return new G(t);
2590
2087
  }
2591
- function An(t) {
2592
- return new Y(t);
2088
+ function kt(t, e = "true", n = "false") {
2089
+ return new De(t, e, n);
2593
2090
  }
2594
- function _n(t) {
2595
- return new Pe(t);
2091
+ function Et(t) {
2092
+ return new ze(t);
2596
2093
  }
2597
- function In(t, e = "") {
2598
- return new Me(t, e);
2094
+ function Nt(t, e = "") {
2095
+ return new Fe(t, e);
2599
2096
  }
2600
- function Rn(t) {
2601
- return new fe(t);
2097
+ function At(t) {
2098
+ return new we(t);
2602
2099
  }
2603
2100
  export {
2604
- En as Citadel,
2605
- X as CommandRegistry,
2606
- O as CommandResult,
2607
- W as CommandStatus,
2608
- tn as DEFAULT_CURSOR_CONFIGS,
2609
- fe as ErrorCommandResult,
2610
- Me as ImageCommandResult,
2611
- Pe as JsonCommandResult,
2612
- te as OutputItem,
2613
- He as PendingCommandResult,
2614
- Y as TextCommandResult,
2615
- Nn as command,
2616
- zn as createCommandRegistry,
2617
- Rn as error,
2618
- In as image,
2619
- _n as json,
2620
- bn as registerCommand,
2621
- xn as registerCommands,
2622
- An as text
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,
2107
+ we as ErrorCommandResult,
2108
+ Fe as ImageCommandResult,
2109
+ ze as JsonCommandResult,
2110
+ oe as OutputItem,
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
2623
2122
  };