citadel_cli 1.1.7 → 1.4.0

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