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.
- package/README.md +126 -30
- package/dist/.vite/manifest.json +0 -4
- package/dist/citadel.es.js +1350 -1631
- package/dist/citadel.umd.js +281 -836
- package/dist/components/Citadel/components/AvailableCommands.d.ts +5 -1
- package/dist/components/Citadel/components/CommandOutputLine.d.ts +2 -0
- package/dist/components/Citadel/config/defaults.d.ts +6 -2
- package/dist/components/Citadel/config/types.d.ts +14 -2
- package/dist/components/Citadel/types/__tests__/command-dsl.test.d.ts +1 -0
- package/dist/components/Citadel/types/command-dsl.d.ts +32 -0
- package/dist/components/Citadel/types/command-registry.d.ts +12 -0
- package/dist/components/Citadel/types/index.d.ts +1 -0
- package/dist/components/Citadel/utils/typography.d.ts +7 -0
- package/dist/examples/__tests__/runtimeConfigCommands.test.d.ts +1 -0
- package/dist/examples/devopsCommands.d.ts +2 -0
- package/dist/examples/localDevCommands.d.ts +2 -0
- package/dist/examples/runtimeConfigCommands.d.ts +3 -0
- package/package.json +8 -5
- package/dist/citadel.css +0 -1
package/dist/citadel.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as m, jsxs as
|
|
5
|
-
import
|
|
6
|
-
import { createRoot as
|
|
7
|
-
var
|
|
8
|
-
class
|
|
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
|
-
|
|
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
|
|
27
|
-
constructor(e,
|
|
28
|
-
super(
|
|
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: "
|
|
31
|
+
return /* @__PURE__ */ m("pre", { className: "citadel-result-json", children: JSON.stringify(this.data, null, 2) });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
class
|
|
35
|
-
constructor(e,
|
|
36
|
-
super(
|
|
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: "
|
|
39
|
+
return /* @__PURE__ */ m("div", { className: "citadel-result-text", children: this.text });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
class
|
|
43
|
-
constructor(e,
|
|
44
|
-
super(
|
|
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: "
|
|
47
|
+
return /* @__PURE__ */ m("div", { className: "citadel-result-error", children: this.error });
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
class
|
|
50
|
+
class De extends W {
|
|
51
51
|
render() {
|
|
52
|
-
return /* @__PURE__ */ m("div", { className: "
|
|
52
|
+
return /* @__PURE__ */ m("div", { className: "citadel-result-pending", children: "..." });
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class
|
|
56
|
-
constructor(e,
|
|
57
|
-
super(
|
|
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: "
|
|
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: "
|
|
65
|
+
className: "citadel-result-image"
|
|
66
66
|
}
|
|
67
67
|
) });
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
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
|
-
) : (
|
|
83
|
+
) : (t.push("help - Show available commands"), new Y(
|
|
75
84
|
`Available Commands:
|
|
76
|
-
` +
|
|
85
|
+
` + t.join(`
|
|
77
86
|
`)
|
|
78
87
|
));
|
|
79
88
|
};
|
|
80
|
-
var
|
|
81
|
-
const
|
|
82
|
-
class
|
|
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 && !
|
|
96
|
+
this.level >= 5 && !ue && console.trace(this.prefix, ...e);
|
|
88
97
|
}
|
|
89
98
|
static debug(...e) {
|
|
90
|
-
this.level >= 4 && !
|
|
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
|
-
|
|
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
|
-
|
|
110
|
-
|
|
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
|
|
123
|
-
constructor(e) {
|
|
124
|
-
|
|
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
|
|
141
|
+
class le extends ce {
|
|
232
142
|
constructor() {
|
|
233
143
|
super("null", ">null<", "Empty segment");
|
|
234
144
|
}
|
|
235
145
|
}
|
|
236
|
-
class
|
|
237
|
-
constructor(e,
|
|
238
|
-
super("word", e,
|
|
146
|
+
class ve extends ce {
|
|
147
|
+
constructor(e, t) {
|
|
148
|
+
super("word", e, t);
|
|
239
149
|
}
|
|
240
150
|
}
|
|
241
|
-
class
|
|
242
|
-
constructor(e,
|
|
243
|
-
super("argument", e,
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
252
|
-
this._segments = e, this._description =
|
|
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
|
|
200
|
+
class X {
|
|
277
201
|
constructor() {
|
|
278
|
-
|
|
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,
|
|
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
|
|
298
|
-
const c =
|
|
299
|
-
(
|
|
300
|
-
).join(" "),
|
|
301
|
-
(
|
|
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 ===
|
|
227
|
+
return c === i;
|
|
304
228
|
});
|
|
305
229
|
if (a)
|
|
306
|
-
throw new Error(`Duplicate commands: '${a.fullPath_s}' and '${
|
|
307
|
-
this._commands.push(
|
|
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
|
|
317
|
-
return
|
|
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((
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
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
|
|
331
|
-
return
|
|
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
|
|
336
|
-
(
|
|
259
|
+
const t = this._commands.map(
|
|
260
|
+
(r) => r.segments.map(
|
|
337
261
|
(a) => a.type === "argument" ? "*" : a.name
|
|
338
262
|
).join(" ")
|
|
339
|
-
),
|
|
263
|
+
), s = e.map((r, a) => this._commands.some(
|
|
340
264
|
(c) => {
|
|
341
|
-
var
|
|
342
|
-
return ((
|
|
265
|
+
var i;
|
|
266
|
+
return ((i = c.segments[a]) == null ? void 0 : i.type) === "argument";
|
|
343
267
|
}
|
|
344
|
-
) ? "*" :
|
|
345
|
-
return
|
|
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((
|
|
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 (
|
|
364
|
-
const a = this._commands.map((
|
|
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
|
-
(
|
|
309
|
+
(i, d, g) => d === g.findIndex((u) => o(u, i))
|
|
367
310
|
);
|
|
368
311
|
}
|
|
369
|
-
const
|
|
312
|
+
const t = e.length;
|
|
370
313
|
return this._commands.filter((a) => {
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
314
|
+
const o = a.segments;
|
|
315
|
+
if (o.length <= t - 1)
|
|
373
316
|
return !1;
|
|
374
|
-
for (let c = 0; c <
|
|
375
|
-
const
|
|
376
|
-
if (!(
|
|
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 >
|
|
381
|
-
const
|
|
382
|
-
return new c(
|
|
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,
|
|
385
|
-
(
|
|
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
|
|
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
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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((
|
|
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((
|
|
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
|
|
481
|
-
config:
|
|
482
|
-
commands: new
|
|
483
|
-
segmentStack: new
|
|
484
|
-
},
|
|
485
|
-
const [
|
|
486
|
-
...
|
|
487
|
-
...
|
|
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
|
-
...
|
|
491
|
-
...
|
|
538
|
+
...N.storage,
|
|
539
|
+
...n.storage
|
|
492
540
|
},
|
|
493
541
|
// Ensure explicit values from config take precedence
|
|
494
|
-
cursorType:
|
|
495
|
-
cursorColor:
|
|
496
|
-
cursorSpeed:
|
|
497
|
-
showCitadelKey:
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
),
|
|
503
|
-
}, []),
|
|
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 (
|
|
553
|
+
if (o.includeHelpCommand) {
|
|
506
554
|
if (!e.commandExistsForPath(["help"])) {
|
|
507
|
-
const
|
|
555
|
+
const i = Le(e);
|
|
508
556
|
e.addCommand(
|
|
509
557
|
[{ type: "word", name: "help" }],
|
|
510
558
|
"Show available commands",
|
|
511
|
-
|
|
559
|
+
i
|
|
512
560
|
);
|
|
513
561
|
}
|
|
514
562
|
return;
|
|
515
563
|
}
|
|
516
564
|
e.removeCommand(["help"]);
|
|
517
565
|
}
|
|
518
|
-
}, [e,
|
|
519
|
-
const c =
|
|
520
|
-
config:
|
|
521
|
-
commands: e || new
|
|
522
|
-
storage:
|
|
566
|
+
}, [e, o.includeHelpCommand]);
|
|
567
|
+
const c = A(() => ({
|
|
568
|
+
config: o,
|
|
569
|
+
commands: e || new X(),
|
|
570
|
+
storage: s,
|
|
523
571
|
segmentStack: a
|
|
524
|
-
}), [
|
|
525
|
-
return /* @__PURE__ */ m(
|
|
526
|
-
},
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
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
|
|
531
|
-
},
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
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
|
|
536
|
-
},
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
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
|
|
541
|
-
},
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
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
|
|
546
|
-
},
|
|
547
|
-
constructor(e,
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
this.id = `output-${Date.now()}-${
|
|
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
|
-
|
|
556
|
-
let
|
|
557
|
-
function
|
|
603
|
+
f(G, "idCounter", 0);
|
|
604
|
+
let oe = G;
|
|
605
|
+
function Ke(n) {
|
|
558
606
|
return {
|
|
559
|
-
commandSegments:
|
|
607
|
+
commandSegments: D(n),
|
|
560
608
|
timestamp: Date.now()
|
|
561
609
|
};
|
|
562
610
|
}
|
|
563
|
-
function
|
|
564
|
-
const
|
|
611
|
+
function ke() {
|
|
612
|
+
const n = be(), [e, t] = _({
|
|
565
613
|
storedCommands: [],
|
|
566
614
|
position: null
|
|
567
|
-
}),
|
|
568
|
-
if (
|
|
615
|
+
}), s = w(async (c) => {
|
|
616
|
+
if (n)
|
|
569
617
|
try {
|
|
570
|
-
const
|
|
571
|
-
await
|
|
572
|
-
...
|
|
573
|
-
storedCommands: [...
|
|
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 (
|
|
577
|
-
console.warn("Failed to save command to history:",
|
|
627
|
+
} catch (i) {
|
|
628
|
+
console.warn("Failed to save command to history:", i);
|
|
578
629
|
}
|
|
579
|
-
}, [
|
|
580
|
-
|
|
581
|
-
|
|
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
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
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
|
-
}, [
|
|
594
|
-
const a =
|
|
595
|
-
const
|
|
596
|
-
if (
|
|
597
|
-
return
|
|
598
|
-
...
|
|
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
|
|
603
|
-
if (c === "up" ? e.position === null ?
|
|
604
|
-
...
|
|
605
|
-
storedCommands:
|
|
606
|
-
|
|
607
|
-
|
|
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
|
|
613
|
-
return
|
|
614
|
-
segments:
|
|
615
|
-
position:
|
|
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,
|
|
680
|
+
}, [e.position, r]), o = w(async () => {
|
|
621
681
|
try {
|
|
622
|
-
if (!
|
|
623
|
-
await
|
|
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
|
-
}, [
|
|
690
|
+
}, [n]);
|
|
631
691
|
return {
|
|
632
692
|
history: e,
|
|
633
|
-
addStoredCommand:
|
|
634
|
-
getStoredCommands:
|
|
693
|
+
addStoredCommand: s,
|
|
694
|
+
getStoredCommands: r,
|
|
635
695
|
navigateHistory: a,
|
|
636
|
-
clear:
|
|
696
|
+
clear: o
|
|
637
697
|
};
|
|
638
698
|
}
|
|
639
|
-
const
|
|
640
|
-
const
|
|
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:
|
|
707
|
+
storage: r
|
|
648
708
|
}
|
|
649
709
|
});
|
|
650
|
-
|
|
651
|
-
}, [
|
|
652
|
-
|
|
653
|
-
...
|
|
710
|
+
P(() => {
|
|
711
|
+
}, [r]), P(() => {
|
|
712
|
+
o((i) => ({
|
|
713
|
+
...i,
|
|
654
714
|
history: {
|
|
655
|
-
commands:
|
|
656
|
-
position:
|
|
657
|
-
storage:
|
|
715
|
+
commands: t.history.storedCommands,
|
|
716
|
+
position: t.history.position,
|
|
717
|
+
storage: r
|
|
658
718
|
}
|
|
659
719
|
}));
|
|
660
|
-
}, [
|
|
720
|
+
}, [t.history, r]);
|
|
661
721
|
const c = {
|
|
662
|
-
setCurrentInput:
|
|
663
|
-
|
|
722
|
+
setCurrentInput: w((i) => {
|
|
723
|
+
k.debug("[CitadelActions] setCurrentInput: ", i), o((d) => ({ ...d, currentInput: i }));
|
|
664
724
|
}, []),
|
|
665
|
-
setIsEnteringArg:
|
|
666
|
-
|
|
725
|
+
setIsEnteringArg: w((i) => {
|
|
726
|
+
k.debug("[CitadelActions] setIsEnteringArg: ", i), o((d) => ({ ...d, isEnteringArg: i }));
|
|
667
727
|
}, []),
|
|
668
|
-
addOutput:
|
|
669
|
-
|
|
670
|
-
...
|
|
671
|
-
output: [...
|
|
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:
|
|
675
|
-
const
|
|
676
|
-
if (!
|
|
677
|
-
console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ",
|
|
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
|
|
681
|
-
|
|
682
|
-
...
|
|
683
|
-
output: [...
|
|
740
|
+
const g = new oe(s);
|
|
741
|
+
o((u) => ({
|
|
742
|
+
...u,
|
|
743
|
+
output: [...u.output, g]
|
|
684
744
|
}));
|
|
685
745
|
try {
|
|
686
|
-
const
|
|
746
|
+
const u = new Promise((y, v) => {
|
|
687
747
|
setTimeout(() => {
|
|
688
|
-
|
|
689
|
-
},
|
|
690
|
-
}),
|
|
691
|
-
|
|
692
|
-
|
|
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 (!(
|
|
754
|
+
if (!(x instanceof W))
|
|
695
755
|
throw new Error(
|
|
696
|
-
`The ${
|
|
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 ${
|
|
759
|
+
Check the definition of the ${i.join(".")} command and update the return type for its handler.`
|
|
700
760
|
);
|
|
701
|
-
|
|
702
|
-
...
|
|
703
|
-
output:
|
|
704
|
-
(
|
|
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 (
|
|
708
|
-
const
|
|
709
|
-
|
|
767
|
+
} catch (u) {
|
|
768
|
+
const h = new we(
|
|
769
|
+
u instanceof Error ? u.message : "Unknown error"
|
|
710
770
|
);
|
|
711
|
-
|
|
712
|
-
...
|
|
713
|
-
output:
|
|
714
|
-
(
|
|
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,
|
|
719
|
-
clearHistory:
|
|
778
|
+
}, [e, n.commandTimeoutMs, s]),
|
|
779
|
+
clearHistory: w(async () => {
|
|
720
780
|
try {
|
|
721
|
-
await
|
|
722
|
-
} catch (
|
|
723
|
-
console.warn("Failed to clear history:",
|
|
781
|
+
await t.clear();
|
|
782
|
+
} catch (i) {
|
|
783
|
+
console.warn("Failed to clear history:", i);
|
|
724
784
|
}
|
|
725
|
-
}, [
|
|
785
|
+
}, [t])
|
|
726
786
|
};
|
|
727
787
|
return { state: a, actions: c };
|
|
728
|
-
},
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
var
|
|
732
|
-
!
|
|
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",
|
|
735
|
-
}, [
|
|
736
|
-
},
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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(
|
|
803
|
+
return () => clearTimeout(o);
|
|
752
804
|
}
|
|
753
|
-
}, [
|
|
754
|
-
style:
|
|
805
|
+
}, [t, s]), {
|
|
806
|
+
style: A(() => ({
|
|
755
807
|
opacity: e ? 1 : 0,
|
|
756
|
-
transform: e ? "translateY(0)" :
|
|
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,
|
|
759
|
-
animationClass:
|
|
810
|
+
}), [e, t]),
|
|
811
|
+
animationClass: r
|
|
760
812
|
};
|
|
761
|
-
},
|
|
813
|
+
}, Ve = () => /* @__PURE__ */ m(
|
|
762
814
|
"div",
|
|
763
815
|
{
|
|
764
816
|
"data-testid": "spinner",
|
|
765
|
-
className: "
|
|
766
|
-
}
|
|
767
|
-
),
|
|
768
|
-
|
|
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:
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
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
|
-
|
|
803
|
-
|
|
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
|
-
|
|
807
|
-
const
|
|
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
|
|
892
|
+
const a = e.current;
|
|
810
893
|
requestAnimationFrame(() => {
|
|
811
|
-
|
|
894
|
+
a.scrollTop = a.scrollHeight;
|
|
812
895
|
});
|
|
813
896
|
}
|
|
814
897
|
}, [e]);
|
|
815
|
-
return
|
|
816
|
-
if (
|
|
817
|
-
const
|
|
818
|
-
if (
|
|
819
|
-
return
|
|
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
|
-
}, [
|
|
904
|
+
}, [n, r, e]), /* @__PURE__ */ m(
|
|
822
905
|
"div",
|
|
823
906
|
{
|
|
824
907
|
ref: e,
|
|
825
|
-
className: "
|
|
908
|
+
className: "citadel-output",
|
|
826
909
|
"data-testid": "citadel-command-output",
|
|
827
|
-
children:
|
|
910
|
+
children: n.map((a) => /* @__PURE__ */ I("div", { className: "citadel-output-item", children: [
|
|
828
911
|
/* @__PURE__ */ m(
|
|
829
|
-
|
|
912
|
+
Je,
|
|
830
913
|
{
|
|
831
|
-
command:
|
|
832
|
-
timestamp: new Date(
|
|
833
|
-
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(
|
|
837
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
862
|
-
style:
|
|
953
|
+
}, he = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], ge = ["|", "/", "-", "\\"], Xe = ({
|
|
954
|
+
style: n = { type: "blink" },
|
|
863
955
|
isValid: e = !0,
|
|
864
|
-
errorMessage:
|
|
956
|
+
errorMessage: t
|
|
865
957
|
}) => {
|
|
866
|
-
const
|
|
867
|
-
...
|
|
868
|
-
...
|
|
869
|
-
}), [
|
|
870
|
-
|
|
871
|
-
if (
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
},
|
|
875
|
-
return () => clearInterval(
|
|
876
|
-
}, [
|
|
877
|
-
const
|
|
878
|
-
color: e ?
|
|
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,
|
|
881
|
-
return /* @__PURE__ */ m("div", { className: "
|
|
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:
|
|
886
|
-
title:
|
|
887
|
-
children: !e &&
|
|
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
|
|
983
|
+
function Ze(n, e) {
|
|
892
984
|
switch (e.type) {
|
|
893
985
|
case "set":
|
|
894
|
-
return
|
|
986
|
+
return k.debug(`[inputStateReducer] InputState changing from ${n} to ${e.state}`), e.state;
|
|
895
987
|
default:
|
|
896
|
-
return
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
const
|
|
900
|
-
const { state:
|
|
901
|
-
a({ type: "set", state:
|
|
902
|
-
}, c =
|
|
903
|
-
const
|
|
904
|
-
return
|
|
905
|
-
}, [e,
|
|
906
|
-
if (!
|
|
907
|
-
const
|
|
908
|
-
return
|
|
909
|
-
const
|
|
910
|
-
return !
|
|
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
|
-
}, [
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
);
|
|
922
|
-
}, [
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
if (
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
if (
|
|
931
|
-
if (
|
|
932
|
-
|
|
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
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
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:
|
|
960
|
-
switch (
|
|
1054
|
+
const { currentInput: S, isEnteringArg: H } = p, T = fe(S);
|
|
1055
|
+
switch (l.key) {
|
|
961
1056
|
case "Backspace":
|
|
962
|
-
return
|
|
1057
|
+
return S === "" && (l.preventDefault(), s.size() > 0 && s.pop(), o("idle")), !0;
|
|
963
1058
|
case "Enter": {
|
|
964
|
-
if (
|
|
1059
|
+
if (l.preventDefault(), T.isQuoted && !T.isComplete)
|
|
965
1060
|
return !0;
|
|
966
|
-
if (
|
|
967
|
-
const
|
|
968
|
-
|
|
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
|
|
971
|
-
if (!
|
|
1065
|
+
const b = s.path(), te = e.getCommand(b);
|
|
1066
|
+
if (!te)
|
|
972
1067
|
return !1;
|
|
973
|
-
const
|
|
974
|
-
return
|
|
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
|
|
978
|
-
const
|
|
979
|
-
return
|
|
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
|
|
983
|
-
const
|
|
984
|
-
return
|
|
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 (!
|
|
988
|
-
const
|
|
989
|
-
if (!
|
|
990
|
-
return
|
|
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
|
-
|
|
997
|
-
p,
|
|
998
|
-
c,
|
|
999
|
-
n,
|
|
1091
|
+
r,
|
|
1000
1092
|
u,
|
|
1093
|
+
c,
|
|
1094
|
+
t,
|
|
1095
|
+
y,
|
|
1001
1096
|
e,
|
|
1002
|
-
|
|
1097
|
+
s
|
|
1003
1098
|
]);
|
|
1004
1099
|
return {
|
|
1005
|
-
handleInputChange:
|
|
1006
|
-
handleKeyDown:
|
|
1007
|
-
inputState:
|
|
1008
|
-
setInputStateWithLogging:
|
|
1100
|
+
handleInputChange: x,
|
|
1101
|
+
handleKeyDown: v,
|
|
1102
|
+
inputState: r,
|
|
1103
|
+
setInputStateWithLogging: o,
|
|
1009
1104
|
// Expose internal functions for testing
|
|
1010
|
-
findMatchingCommands:
|
|
1011
|
-
getAutocompleteSuggestion:
|
|
1012
|
-
getAvailableNodes:
|
|
1105
|
+
findMatchingCommands: d,
|
|
1106
|
+
getAutocompleteSuggestion: g,
|
|
1107
|
+
getAvailableNodes: i,
|
|
1013
1108
|
getNextExpectedSegment: c,
|
|
1014
|
-
isValidCommandInput:
|
|
1109
|
+
isValidCommandInput: u
|
|
1015
1110
|
};
|
|
1016
1111
|
};
|
|
1017
|
-
function
|
|
1112
|
+
function fe(n) {
|
|
1018
1113
|
const e = [];
|
|
1019
|
-
let
|
|
1020
|
-
for (let a = 0; a <
|
|
1021
|
-
const
|
|
1022
|
-
(
|
|
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:
|
|
1027
|
-
isQuoted:
|
|
1028
|
-
quoteChar:
|
|
1029
|
-
isComplete: !
|
|
1121
|
+
currentWord: t,
|
|
1122
|
+
isQuoted: s,
|
|
1123
|
+
quoteChar: r,
|
|
1124
|
+
isComplete: !s && !t
|
|
1030
1125
|
};
|
|
1031
1126
|
}
|
|
1032
|
-
const
|
|
1033
|
-
const
|
|
1034
|
-
return
|
|
1035
|
-
const
|
|
1127
|
+
const tt = () => {
|
|
1128
|
+
const n = V(), [e, t] = _(0);
|
|
1129
|
+
return P(() => {
|
|
1130
|
+
const s = {
|
|
1036
1131
|
update: () => {
|
|
1037
|
-
|
|
1132
|
+
t((r) => r + 1);
|
|
1038
1133
|
}
|
|
1039
1134
|
};
|
|
1040
|
-
return
|
|
1041
|
-
|
|
1135
|
+
return n.subscribe(s), () => {
|
|
1136
|
+
n.unsubscribe(s);
|
|
1042
1137
|
};
|
|
1043
|
-
}, [
|
|
1044
|
-
},
|
|
1045
|
-
state:
|
|
1138
|
+
}, [n]), e;
|
|
1139
|
+
}, nt = ({
|
|
1140
|
+
state: n,
|
|
1046
1141
|
actions: e
|
|
1047
1142
|
}) => {
|
|
1048
|
-
const
|
|
1143
|
+
const t = z(null), s = Z(), r = V(), {
|
|
1049
1144
|
handleKeyDown: a,
|
|
1050
|
-
handleInputChange:
|
|
1145
|
+
handleInputChange: o,
|
|
1051
1146
|
inputState: c,
|
|
1052
|
-
setInputStateWithLogging:
|
|
1053
|
-
getNextExpectedSegment:
|
|
1054
|
-
} =
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}, [
|
|
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
|
|
1069
|
-
let
|
|
1070
|
-
switch (
|
|
1166
|
+
const E = d();
|
|
1167
|
+
let R = "idle";
|
|
1168
|
+
switch (E.type) {
|
|
1071
1169
|
case "word":
|
|
1072
|
-
|
|
1170
|
+
R = "entering_command", e.setIsEnteringArg(!1);
|
|
1073
1171
|
break;
|
|
1074
1172
|
case "argument":
|
|
1075
|
-
|
|
1173
|
+
R = "entering_argument", e.setIsEnteringArg(!0);
|
|
1076
1174
|
break;
|
|
1077
1175
|
}
|
|
1078
|
-
|
|
1079
|
-
}, [
|
|
1080
|
-
const
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1083
|
-
const
|
|
1084
|
-
if (
|
|
1085
|
-
const
|
|
1086
|
-
return /* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */ m("span", { className: "
|
|
1088
|
-
|
|
1089
|
-
] }, "arg-" +
|
|
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__ */
|
|
1092
|
-
/* @__PURE__ */ m("span", { className: "
|
|
1093
|
-
|
|
1094
|
-
] }, "word-" +
|
|
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: "
|
|
1097
|
-
}, [
|
|
1098
|
-
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
}, [
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
/* @__PURE__ */
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
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
|
-
},
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
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
|
-
|
|
1295
|
+
u.set(h.name, x);
|
|
1176
1296
|
}
|
|
1177
|
-
return
|
|
1178
|
-
}, [
|
|
1179
|
-
return /* @__PURE__ */ m("div", { className:
|
|
1180
|
-
/* @__PURE__ */ m("span", { className: "
|
|
1181
|
-
|
|
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
|
-
|
|
1303
|
+
g.description
|
|
1184
1304
|
] })
|
|
1185
|
-
] }) : null : /* @__PURE__ */ m("div", { className: "
|
|
1186
|
-
const h = i.get(
|
|
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
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
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
|
-
|
|
1317
|
+
u.name
|
|
1197
1318
|
);
|
|
1198
1319
|
}) }) }) });
|
|
1199
|
-
},
|
|
1200
|
-
state:
|
|
1320
|
+
}, Ne = ({
|
|
1321
|
+
state: n,
|
|
1201
1322
|
actions: e,
|
|
1202
|
-
outputRef:
|
|
1203
|
-
}) =>
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
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: () =>
|
|
1214
|
-
isVisible:
|
|
1215
|
-
showCitadelKey:
|
|
1348
|
+
onClose: () => s(!0),
|
|
1349
|
+
isVisible: n,
|
|
1350
|
+
showCitadelKey: r.showCitadelKey || "."
|
|
1216
1351
|
});
|
|
1217
|
-
const
|
|
1218
|
-
var
|
|
1219
|
-
if (!
|
|
1220
|
-
const
|
|
1221
|
-
Math.max(
|
|
1222
|
-
|
|
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
|
-
|
|
1225
|
-
}, [
|
|
1226
|
-
|
|
1227
|
-
}, [
|
|
1228
|
-
|
|
1229
|
-
}, [
|
|
1230
|
-
|
|
1231
|
-
document.removeEventListener("mousemove",
|
|
1232
|
-
}, [
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
}, [
|
|
1236
|
-
|
|
1237
|
-
isVisible:
|
|
1238
|
-
isClosing:
|
|
1239
|
-
onAnimationComplete:
|
|
1240
|
-
})
|
|
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:
|
|
1244
|
-
className: `panelContainer ${
|
|
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:
|
|
1390
|
+
/* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: l }),
|
|
1251
1391
|
/* @__PURE__ */ m(
|
|
1252
|
-
|
|
1392
|
+
Ne,
|
|
1253
1393
|
{
|
|
1254
|
-
state:
|
|
1255
|
-
actions:
|
|
1394
|
+
state: h,
|
|
1395
|
+
actions: x,
|
|
1256
1396
|
outputRef: c
|
|
1257
1397
|
}
|
|
1258
1398
|
)
|
|
1259
1399
|
]
|
|
1260
1400
|
}
|
|
1261
1401
|
) : null;
|
|
1262
|
-
},
|
|
1263
|
-
|
|
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
|
-
|
|
1423
|
+
Ne,
|
|
1271
1424
|
{
|
|
1272
|
-
state:
|
|
1425
|
+
state: n,
|
|
1273
1426
|
actions: e,
|
|
1274
|
-
outputRef:
|
|
1427
|
+
outputRef: s
|
|
1275
1428
|
}
|
|
1276
1429
|
)
|
|
1277
1430
|
}
|
|
1278
1431
|
);
|
|
1279
|
-
},
|
|
1280
|
-
--citadel-bg:
|
|
1281
|
-
--citadel-
|
|
1282
|
-
--citadel-border:
|
|
1283
|
-
--citadel-
|
|
1284
|
-
--citadel-
|
|
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=
|
|
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;
|
|
1465
|
+
z-index: 2147483647;
|
|
1308
1466
|
overflow: hidden;
|
|
1309
1467
|
}
|
|
1310
1468
|
|
|
1311
|
-
:host([data-display-mode=
|
|
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
|
-
|
|
1325
|
-
|
|
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
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
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
|
-
|
|
1397
|
-
|
|
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
|
-
|
|
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
|
-
.
|
|
1412
|
-
|
|
1413
|
-
padding: 1rem;
|
|
1414
|
-
margin: 0;
|
|
1415
|
-
box-sizing: border-box;
|
|
1517
|
+
.citadel-tty {
|
|
1518
|
+
background: var(--citadel-bg);
|
|
1416
1519
|
}
|
|
1417
1520
|
|
|
1418
|
-
.
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
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:
|
|
1548
|
+
background: color-mix(in oklch, var(--citadel-text) 10%, transparent);
|
|
1435
1549
|
}
|
|
1436
1550
|
|
|
1437
1551
|
@keyframes citadel_slideUp {
|
|
1438
|
-
from {
|
|
1439
|
-
|
|
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 {
|
|
1444
|
-
|
|
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
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1719
|
-
bottom:
|
|
1604
|
+
.citadel-output-item:last-child {
|
|
1605
|
+
margin-bottom: 0;
|
|
1720
1606
|
}
|
|
1721
1607
|
|
|
1722
|
-
|
|
1723
|
-
top:
|
|
1608
|
+
.citadel-output-content {
|
|
1609
|
+
margin-top: 0.35rem;
|
|
1610
|
+
color: var(--citadel-text);
|
|
1724
1611
|
}
|
|
1725
1612
|
|
|
1726
|
-
|
|
1727
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
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
|
-
|
|
1772
|
-
|
|
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
|
-
|
|
1786
|
-
*/
|
|
1787
|
-
|
|
1788
|
-
:-moz-focusring {
|
|
1789
|
-
outline: auto;
|
|
1633
|
+
.citadel-output-command-arg {
|
|
1634
|
+
color: var(--citadel-arg);
|
|
1790
1635
|
}
|
|
1791
1636
|
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1637
|
+
.citadel-output-separator {
|
|
1638
|
+
color: var(--citadel-muted);
|
|
1639
|
+
}
|
|
1795
1640
|
|
|
1796
|
-
|
|
1797
|
-
|
|
1641
|
+
.citadel-output-timestamp {
|
|
1642
|
+
color: var(--citadel-subtle);
|
|
1798
1643
|
}
|
|
1799
1644
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1645
|
+
.citadel-status-dot {
|
|
1646
|
+
width: 1rem;
|
|
1647
|
+
height: 1rem;
|
|
1648
|
+
border-radius: 999px;
|
|
1649
|
+
}
|
|
1803
1650
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1651
|
+
.citadel-status-dot-success {
|
|
1652
|
+
background: var(--citadel-success);
|
|
1806
1653
|
}
|
|
1807
1654
|
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1655
|
+
.citadel-status-dot-failure {
|
|
1656
|
+
background: var(--citadel-error);
|
|
1657
|
+
}
|
|
1811
1658
|
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
height:
|
|
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
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1668
|
+
@keyframes citadel-spin {
|
|
1669
|
+
to {
|
|
1670
|
+
transform: rotate(360deg);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1821
1673
|
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
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
|
-
|
|
1829
|
-
|
|
1681
|
+
.citadel-input-line {
|
|
1682
|
+
display: flex;
|
|
1683
|
+
align-items: center;
|
|
1684
|
+
gap: 0.5rem;
|
|
1685
|
+
}
|
|
1830
1686
|
|
|
1831
|
-
|
|
1832
|
-
|
|
1687
|
+
.citadel-input-prompt {
|
|
1688
|
+
color: var(--citadel-muted);
|
|
1833
1689
|
}
|
|
1834
1690
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
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
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1698
|
+
.citadel-input-segments {
|
|
1699
|
+
display: flex;
|
|
1700
|
+
align-items: center;
|
|
1701
|
+
gap: 0.25rem;
|
|
1843
1702
|
}
|
|
1844
1703
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1704
|
+
.citadel-input-segment-arg {
|
|
1705
|
+
color: var(--citadel-text);
|
|
1706
|
+
white-space: pre;
|
|
1707
|
+
}
|
|
1848
1708
|
|
|
1849
|
-
|
|
1850
|
-
|
|
1709
|
+
.citadel-input-segment-word {
|
|
1710
|
+
color: var(--citadel-word);
|
|
1711
|
+
white-space: pre;
|
|
1851
1712
|
}
|
|
1852
1713
|
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1714
|
+
.citadel-input-segment-space {
|
|
1715
|
+
color: var(--citadel-text);
|
|
1716
|
+
white-space: pre;
|
|
1717
|
+
}
|
|
1856
1718
|
|
|
1857
|
-
|
|
1858
|
-
|
|
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
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1723
|
+
.citadel-input-control {
|
|
1724
|
+
position: relative;
|
|
1725
|
+
flex: 1 1 auto;
|
|
1726
|
+
min-width: 0;
|
|
1876
1727
|
}
|
|
1877
1728
|
|
|
1878
|
-
|
|
1879
|
-
|
|
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
|
-
|
|
1883
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1769
|
+
.citadel-input-cursor {
|
|
1770
|
+
position: absolute;
|
|
1771
|
+
top: 0;
|
|
1772
|
+
pointer-events: none;
|
|
1919
1773
|
}
|
|
1920
1774
|
|
|
1921
|
-
|
|
1922
|
-
|
|
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
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1781
|
+
50% {
|
|
1782
|
+
box-shadow: 0 0 8px color-mix(in oklch, var(--citadel-error) 70%, transparent);
|
|
1783
|
+
}
|
|
1928
1784
|
}
|
|
1929
1785
|
|
|
1930
|
-
|
|
1931
|
-
|
|
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
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
*/
|
|
1790
|
+
.citadel-cursor-wrapper {
|
|
1791
|
+
position: relative;
|
|
1792
|
+
display: inline-block;
|
|
1793
|
+
}
|
|
1942
1794
|
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
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
|
-
|
|
1957
|
-
|
|
1800
|
+
@keyframes citadel-shake {
|
|
1801
|
+
0%,
|
|
1802
|
+
100% {
|
|
1803
|
+
transform: translateX(0);
|
|
1804
|
+
}
|
|
1958
1805
|
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
height: auto;
|
|
1963
|
-
}
|
|
1806
|
+
25% {
|
|
1807
|
+
transform: translateX(-4px);
|
|
1808
|
+
}
|
|
1964
1809
|
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
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
|
-
|
|
2007
|
-
|
|
1814
|
+
|
|
1815
|
+
.animate-shake {
|
|
1816
|
+
animation: citadel-shake 0.2s ease-in-out;
|
|
2008
1817
|
}
|
|
2009
|
-
|
|
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
|
-
|
|
2066
|
-
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
.animate-spin {
|
|
2070
|
-
animation: spin 1s linear infinite;
|
|
1825
|
+
.citadel-available-commands-content {
|
|
1826
|
+
color: var(--citadel-muted);
|
|
2071
1827
|
}
|
|
2072
|
-
|
|
2073
|
-
|
|
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
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
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
|
-
|
|
2244
|
-
|
|
1840
|
+
|
|
1841
|
+
.citadel-available-chip-text {
|
|
1842
|
+
color: white;
|
|
2245
1843
|
}
|
|
2246
|
-
|
|
2247
|
-
|
|
1844
|
+
|
|
1845
|
+
.citadel-available-chip-prefix {
|
|
1846
|
+
text-decoration: underline;
|
|
2248
1847
|
}
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
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
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
1852
|
+
|
|
1853
|
+
.citadel-available-next-desc {
|
|
1854
|
+
margin-left: 0.5rem;
|
|
1855
|
+
color: var(--citadel-muted);
|
|
2258
1856
|
}
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
1857
|
+
|
|
1858
|
+
.citadel-result-json,
|
|
1859
|
+
.citadel-result-text {
|
|
1860
|
+
color: var(--citadel-text);
|
|
2262
1861
|
}
|
|
2263
|
-
|
|
2264
|
-
|
|
1862
|
+
|
|
1863
|
+
.citadel-result-json {
|
|
1864
|
+
margin: 0;
|
|
2265
1865
|
}
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
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
|
-
|
|
2274
|
-
|
|
1870
|
+
|
|
1871
|
+
.citadel-result-error {
|
|
1872
|
+
margin-top: 0.25rem;
|
|
1873
|
+
color: var(--citadel-error);
|
|
2275
1874
|
}
|
|
2276
|
-
|
|
2277
|
-
|
|
1875
|
+
|
|
1876
|
+
.citadel-result-pending {
|
|
1877
|
+
color: var(--citadel-muted);
|
|
2278
1878
|
}
|
|
2279
|
-
|
|
2280
|
-
|
|
1879
|
+
|
|
1880
|
+
.citadel-result-image-wrap {
|
|
1881
|
+
margin-block: 0.5rem;
|
|
2281
1882
|
}
|
|
2282
|
-
|
|
2283
|
-
|
|
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
|
-
`,
|
|
2286
|
-
config:
|
|
2287
|
-
commandRegistry: e
|
|
2288
|
-
containerId:
|
|
1891
|
+
`, wt = ({
|
|
1892
|
+
config: n = N,
|
|
1893
|
+
commandRegistry: e,
|
|
1894
|
+
containerId: t = null
|
|
2289
1895
|
}) => {
|
|
2290
|
-
const
|
|
2291
|
-
return
|
|
2292
|
-
|
|
2293
|
-
level:
|
|
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
|
|
2297
|
-
if (
|
|
2298
|
-
|
|
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 (
|
|
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 "${
|
|
1910
|
+
console.warn(`Container with id "${t}" not found, falling back to body`), document.body.appendChild(i);
|
|
2305
1911
|
}
|
|
2306
1912
|
return () => {
|
|
2307
|
-
var
|
|
2308
|
-
(
|
|
1913
|
+
var u;
|
|
1914
|
+
(u = i.parentElement) == null || u.removeChild(i);
|
|
2309
1915
|
};
|
|
2310
|
-
}, [
|
|
1916
|
+
}, [r, t, n, c]), c === "inline" && !t ? /* @__PURE__ */ m("div", { ref: a, style: o }) : null;
|
|
2311
1917
|
};
|
|
2312
|
-
class
|
|
2313
|
-
constructor(
|
|
1918
|
+
class Ie extends HTMLElement {
|
|
1919
|
+
constructor(t, s) {
|
|
2314
1920
|
var a;
|
|
2315
1921
|
super();
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry =
|
|
2321
|
-
const
|
|
2322
|
-
this.setAttribute("data-display-mode",
|
|
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
|
|
1932
|
+
const s = [ye].map((r) => {
|
|
2327
1933
|
const a = new CSSStyleSheet();
|
|
2328
|
-
return a.replaceSync(
|
|
1934
|
+
return a.replaceSync(r), a;
|
|
2329
1935
|
});
|
|
2330
|
-
this.shadow.adoptedStyleSheets = [...
|
|
1936
|
+
this.shadow.adoptedStyleSheets = [...s];
|
|
2331
1937
|
} catch {
|
|
2332
|
-
const
|
|
2333
|
-
`),
|
|
2334
|
-
|
|
1938
|
+
const s = [ye].join(`
|
|
1939
|
+
`), r = document.createElement("style");
|
|
1940
|
+
r.textContent = s, this.shadow.appendChild(r);
|
|
2335
1941
|
}
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2338
|
-
/* @__PURE__ */ m(
|
|
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
|
|
2343
|
-
if (this.root = null, !
|
|
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
|
-
|
|
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",
|
|
2353
|
-
const
|
|
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
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
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
|
};
|