@principal-ade/panel-layouts 0.2.4 → 0.2.6
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/dist/index.d.ts +286 -0
- package/dist/index.esm.js +1811 -903
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
import './index.css';var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { EditableConfigurablePanelLayout as
|
|
5
|
-
import
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
class
|
|
1
|
+
import './index.css';var we = Object.defineProperty;
|
|
2
|
+
var ke = (o, e, t) => e in o ? we(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var H = (o, e, t) => ke(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { EditableConfigurablePanelLayout as It, ResponsiveConfigurablePanelLayout as Rt, mapThemeToPanelVars as Lt, mapThemeToTabVars as At } from "@principal-ade/panels";
|
|
5
|
+
import Ce, { useState as L, useRef as z, useEffect as W, useCallback as x, forwardRef as ve, useMemo as X } from "react";
|
|
6
|
+
import { jsx as l, jsxs as b, Fragment as se } from "react/jsx-runtime";
|
|
7
|
+
import { useTheme as q } from "@principal-ade/industry-theme";
|
|
8
|
+
class Se {
|
|
9
9
|
constructor() {
|
|
10
|
-
|
|
10
|
+
H(this, "storageKey", "panel-layouts");
|
|
11
11
|
}
|
|
12
12
|
async load(e) {
|
|
13
13
|
try {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
} catch (
|
|
17
|
-
return console.error(`Failed to load panel layout for ${e}:`,
|
|
14
|
+
const t = localStorage.getItem(`${this.storageKey}:${e}`);
|
|
15
|
+
return t ? JSON.parse(t) : null;
|
|
16
|
+
} catch (t) {
|
|
17
|
+
return console.error(`Failed to load panel layout for ${e}:`, t), null;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
async save(e,
|
|
20
|
+
async save(e, t) {
|
|
21
21
|
try {
|
|
22
22
|
localStorage.setItem(
|
|
23
23
|
`${this.storageKey}:${e}`,
|
|
24
|
-
JSON.stringify(
|
|
24
|
+
JSON.stringify(t)
|
|
25
25
|
);
|
|
26
26
|
} catch (r) {
|
|
27
27
|
console.error(`Failed to save panel layout for ${e}:`, r);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function tt(o) {
|
|
32
32
|
const {
|
|
33
33
|
viewKey: e,
|
|
34
|
-
defaultSizes:
|
|
34
|
+
defaultSizes: t,
|
|
35
35
|
panelType: r,
|
|
36
|
-
adapter:
|
|
37
|
-
} =
|
|
38
|
-
|
|
36
|
+
adapter: s = new Se()
|
|
37
|
+
} = o, [a, n] = L(t), [i, p] = L(o.collapsed), u = z(o.collapsed), h = z({}), d = z(null), f = z(null);
|
|
38
|
+
W(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const P = await s.load(e);
|
|
41
|
+
P != null && P.sizes && (n(P.sizes), g(P.sizes));
|
|
42
42
|
})();
|
|
43
43
|
}, [e]);
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
"left" in
|
|
44
|
+
const g = x(
|
|
45
|
+
(w) => {
|
|
46
|
+
"left" in w && w.left > 0 && (h.current.left = w.left), "middle" in w && w.middle > 0 && (h.current.middle = w.middle), "right" in w && w.right > 0 && (h.current.right = w.right);
|
|
47
47
|
},
|
|
48
48
|
[]
|
|
49
|
-
),
|
|
50
|
-
(
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
49
|
+
), m = x(
|
|
50
|
+
(w) => {
|
|
51
|
+
const P = h.current[w];
|
|
52
|
+
if (P && P > 0)
|
|
53
|
+
return P;
|
|
54
|
+
if (w === "left" && "left" in t && t.left > 0)
|
|
55
|
+
return t.left;
|
|
56
|
+
if (w === "right" && "right" in t && t.right > 0)
|
|
57
|
+
return t.right;
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
|
|
62
|
-
("left" in
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
(
|
|
66
|
-
}, [
|
|
67
|
-
const k =
|
|
68
|
-
async (
|
|
59
|
+
[t]
|
|
60
|
+
), c = z(t);
|
|
61
|
+
W(() => {
|
|
62
|
+
("left" in t && t.left !== c.current.left || "middle" in t && "middle" in c.current && t.middle !== c.current.middle || "right" in t && t.right !== c.current.right) && (n(t), g(t), c.current = t);
|
|
63
|
+
}, [t, g]), W(() => {
|
|
64
|
+
const w = o.collapsed.left !== u.current.left, P = "right" in o.collapsed && "right" in u.current && o.collapsed.right !== u.current.right;
|
|
65
|
+
(w || P) && (p(o.collapsed), u.current = { ...o.collapsed });
|
|
66
|
+
}, [o.collapsed.left, o.collapsed.right]);
|
|
67
|
+
const k = x(
|
|
68
|
+
async (w) => {
|
|
69
69
|
try {
|
|
70
|
-
await
|
|
71
|
-
} catch (
|
|
70
|
+
await s.save(e, { sizes: w });
|
|
71
|
+
} catch (P) {
|
|
72
72
|
console.error(
|
|
73
73
|
`Failed to save panel preferences for ${e}:`,
|
|
74
|
-
|
|
74
|
+
P
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
[e,
|
|
79
|
-
),
|
|
80
|
-
(
|
|
81
|
-
const
|
|
78
|
+
[e, s]
|
|
79
|
+
), R = x(
|
|
80
|
+
(w) => {
|
|
81
|
+
const P = { ...w };
|
|
82
82
|
let v = !0;
|
|
83
|
-
if ("left" in
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const S =
|
|
87
|
-
S !== void 0 && S > 0 ?
|
|
88
|
-
} else
|
|
83
|
+
if ("left" in w) {
|
|
84
|
+
const C = !!(i != null && i.left), y = w.left;
|
|
85
|
+
if (C) {
|
|
86
|
+
const S = m("left");
|
|
87
|
+
S !== void 0 && S > 0 ? P.left = S : v = !1;
|
|
88
|
+
} else y === 0 && (v = !1);
|
|
89
89
|
}
|
|
90
|
-
if (r === "three-panel" && "right" in
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const S =
|
|
94
|
-
S !== void 0 && S > 0 ?
|
|
95
|
-
} else
|
|
90
|
+
if (r === "three-panel" && "right" in w) {
|
|
91
|
+
const C = !!(i != null && i.right), y = w.right;
|
|
92
|
+
if (C) {
|
|
93
|
+
const S = m("right");
|
|
94
|
+
S !== void 0 && S > 0 ? P.right = S : v = !1;
|
|
95
|
+
} else y === 0 && (v = !1);
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
|
|
97
|
+
if (n(P), g(P), d.current && (clearTimeout(d.current), d.current = null), !v) {
|
|
98
|
+
f.current = null;
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
101
|
+
f.current = P, d.current = setTimeout(() => {
|
|
102
|
+
const C = f.current;
|
|
103
|
+
C && (k(C), f.current = null), d.current = null;
|
|
104
104
|
}, 500);
|
|
105
105
|
},
|
|
106
106
|
[
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
i,
|
|
108
|
+
m,
|
|
109
109
|
r,
|
|
110
110
|
k,
|
|
111
|
-
|
|
111
|
+
g
|
|
112
112
|
]
|
|
113
113
|
);
|
|
114
|
-
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
114
|
+
W(() => () => {
|
|
115
|
+
if (d.current) {
|
|
116
|
+
const w = f.current;
|
|
117
|
+
w && (k(w), f.current = null), clearTimeout(d.current), d.current = null;
|
|
118
118
|
}
|
|
119
119
|
}, [k]);
|
|
120
|
-
const
|
|
121
|
-
}, []),
|
|
122
|
-
}, []),
|
|
123
|
-
}, []),
|
|
120
|
+
const A = x(async () => {
|
|
121
|
+
}, []), I = x(async () => {
|
|
122
|
+
}, []), $ = x(async () => {
|
|
123
|
+
}, []), D = x(async () => {
|
|
124
124
|
}, []);
|
|
125
125
|
return r === "three-panel" ? {
|
|
126
126
|
type: "three-panel",
|
|
127
|
-
sizes:
|
|
128
|
-
collapsed:
|
|
129
|
-
handlePanelResize:
|
|
130
|
-
handleLeftCollapseComplete:
|
|
131
|
-
handleLeftExpandComplete:
|
|
132
|
-
handleRightCollapseComplete:
|
|
133
|
-
handleRightExpandComplete:
|
|
127
|
+
sizes: a,
|
|
128
|
+
collapsed: i,
|
|
129
|
+
handlePanelResize: R,
|
|
130
|
+
handleLeftCollapseComplete: A,
|
|
131
|
+
handleLeftExpandComplete: I,
|
|
132
|
+
handleRightCollapseComplete: $,
|
|
133
|
+
handleRightExpandComplete: D
|
|
134
134
|
} : {
|
|
135
135
|
type: "two-panel",
|
|
136
|
-
sizes:
|
|
137
|
-
collapsed:
|
|
138
|
-
handlePanelResize:
|
|
139
|
-
handleLeftCollapseComplete:
|
|
140
|
-
handleLeftExpandComplete:
|
|
136
|
+
sizes: a,
|
|
137
|
+
collapsed: i,
|
|
138
|
+
handlePanelResize: R,
|
|
139
|
+
handleLeftCollapseComplete: A,
|
|
140
|
+
handleLeftExpandComplete: I
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
class
|
|
143
|
+
class Te {
|
|
144
144
|
constructor() {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
H(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
|
|
146
|
+
H(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Load all user-created workspace presets
|
|
@@ -162,8 +162,8 @@ class oe {
|
|
|
162
162
|
async saveWorkspacePresets(e) {
|
|
163
163
|
try {
|
|
164
164
|
localStorage.setItem(this.PRESETS_KEY, JSON.stringify(e));
|
|
165
|
-
} catch (
|
|
166
|
-
throw console.error("Failed to save workspace presets:",
|
|
165
|
+
} catch (t) {
|
|
166
|
+
throw console.error("Failed to save workspace presets:", t), t;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
@@ -171,22 +171,22 @@ class oe {
|
|
|
171
171
|
*/
|
|
172
172
|
async loadRepositoryState(e) {
|
|
173
173
|
try {
|
|
174
|
-
const
|
|
174
|
+
const t = `${this.REPO_STATE_PREFIX}${e}`, r = localStorage.getItem(t);
|
|
175
175
|
return r ? JSON.parse(r) : null;
|
|
176
|
-
} catch (
|
|
176
|
+
} catch (t) {
|
|
177
177
|
return console.error(
|
|
178
178
|
`Failed to load repository state for ${e}:`,
|
|
179
|
-
|
|
179
|
+
t
|
|
180
180
|
), null;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* Save repository-specific workspace state
|
|
185
185
|
*/
|
|
186
|
-
async saveRepositoryState(e,
|
|
186
|
+
async saveRepositoryState(e, t) {
|
|
187
187
|
try {
|
|
188
188
|
const r = `${this.REPO_STATE_PREFIX}${e}`;
|
|
189
|
-
localStorage.setItem(r, JSON.stringify(
|
|
189
|
+
localStorage.setItem(r, JSON.stringify(t));
|
|
190
190
|
} catch (r) {
|
|
191
191
|
throw console.error(
|
|
192
192
|
`Failed to save repository state for ${e}:`,
|
|
@@ -200,17 +200,17 @@ class oe {
|
|
|
200
200
|
async loadAllRepositoryStates() {
|
|
201
201
|
try {
|
|
202
202
|
const e = {};
|
|
203
|
-
for (let
|
|
204
|
-
const r = localStorage.key(
|
|
203
|
+
for (let t = 0; t < localStorage.length; t++) {
|
|
204
|
+
const r = localStorage.key(t);
|
|
205
205
|
if (r && r.startsWith(this.REPO_STATE_PREFIX)) {
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
206
|
+
const s = r.substring(this.REPO_STATE_PREFIX.length), a = localStorage.getItem(r);
|
|
207
|
+
if (a)
|
|
208
208
|
try {
|
|
209
|
-
e[
|
|
210
|
-
} catch (
|
|
209
|
+
e[s] = JSON.parse(a);
|
|
210
|
+
} catch (n) {
|
|
211
211
|
console.error(
|
|
212
|
-
`Failed to parse repository state for ${
|
|
213
|
-
|
|
212
|
+
`Failed to parse repository state for ${s}:`,
|
|
213
|
+
n
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -221,7 +221,7 @@ class oe {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class
|
|
224
|
+
class _ {
|
|
225
225
|
/**
|
|
226
226
|
* Configure a custom storage adapter (for Electron IPC or remote storage)
|
|
227
227
|
*/
|
|
@@ -248,7 +248,7 @@ class R {
|
|
|
248
248
|
* Create a new workspace layout
|
|
249
249
|
*/
|
|
250
250
|
static async createWorkspaceLayout(e) {
|
|
251
|
-
const
|
|
251
|
+
const t = await this.adapter.loadWorkspacePresets(), r = this.generateWorkspaceId(e.name), s = {
|
|
252
252
|
id: r,
|
|
253
253
|
name: e.name,
|
|
254
254
|
description: e.description,
|
|
@@ -258,46 +258,46 @@ class R {
|
|
|
258
258
|
createdAt: Date.now(),
|
|
259
259
|
updatedAt: Date.now(),
|
|
260
260
|
isBuiltIn: !1
|
|
261
|
-
},
|
|
262
|
-
...
|
|
263
|
-
[r]:
|
|
261
|
+
}, a = {
|
|
262
|
+
...t,
|
|
263
|
+
[r]: s
|
|
264
264
|
};
|
|
265
|
-
return await this.adapter.saveWorkspacePresets(
|
|
265
|
+
return await this.adapter.saveWorkspacePresets(a), s;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* Update an existing workspace layout
|
|
269
269
|
*/
|
|
270
|
-
static async updateWorkspaceLayout(e,
|
|
271
|
-
const r = await this.adapter.loadWorkspacePresets(),
|
|
272
|
-
if (!
|
|
270
|
+
static async updateWorkspaceLayout(e, t) {
|
|
271
|
+
const r = await this.adapter.loadWorkspacePresets(), s = r[e];
|
|
272
|
+
if (!s)
|
|
273
273
|
return console.error(`Workspace layout ${e} not found`), null;
|
|
274
|
-
if (
|
|
274
|
+
if (s.isBuiltIn)
|
|
275
275
|
return console.error(`Cannot update built-in workspace layout ${e}`), null;
|
|
276
|
-
const
|
|
277
|
-
...
|
|
278
|
-
...
|
|
276
|
+
const a = {
|
|
277
|
+
...s,
|
|
278
|
+
...t,
|
|
279
279
|
id: e,
|
|
280
280
|
// Preserve ID
|
|
281
|
-
createdAt:
|
|
281
|
+
createdAt: s.createdAt,
|
|
282
282
|
// Preserve creation time
|
|
283
283
|
updatedAt: Date.now()
|
|
284
|
-
},
|
|
284
|
+
}, n = {
|
|
285
285
|
...r,
|
|
286
|
-
[e]:
|
|
286
|
+
[e]: a
|
|
287
287
|
};
|
|
288
|
-
return await this.adapter.saveWorkspacePresets(
|
|
288
|
+
return await this.adapter.saveWorkspacePresets(n), a;
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* Delete a workspace layout
|
|
292
292
|
*/
|
|
293
293
|
static async deleteWorkspaceLayout(e) {
|
|
294
|
-
const
|
|
294
|
+
const t = await this.adapter.loadWorkspacePresets(), r = t[e];
|
|
295
295
|
if (!r)
|
|
296
296
|
return console.error(`Workspace layout ${e} not found`), !1;
|
|
297
297
|
if (r.isBuiltIn)
|
|
298
298
|
return console.error(`Cannot delete built-in workspace layout ${e}`), !1;
|
|
299
|
-
const
|
|
300
|
-
return delete
|
|
299
|
+
const s = { ...t };
|
|
300
|
+
return delete s[e], await this.adapter.saveWorkspacePresets(s), !0;
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
303
|
* Get repository state (which workspace + current sizes/collapsed)
|
|
@@ -308,64 +308,64 @@ class R {
|
|
|
308
308
|
/**
|
|
309
309
|
* Set repository state (which workspace + current sizes/collapsed/layout)
|
|
310
310
|
*/
|
|
311
|
-
static async setRepositoryState(e,
|
|
312
|
-
await this.adapter.saveRepositoryState(e,
|
|
311
|
+
static async setRepositoryState(e, t) {
|
|
312
|
+
await this.adapter.saveRepositoryState(e, t);
|
|
313
313
|
}
|
|
314
314
|
/**
|
|
315
315
|
* Update only sizes in repository state
|
|
316
316
|
*/
|
|
317
|
-
static async updateRepositorySizes(e,
|
|
317
|
+
static async updateRepositorySizes(e, t) {
|
|
318
318
|
const r = await this.getRepositoryState(e);
|
|
319
319
|
r && await this.setRepositoryState(e, {
|
|
320
320
|
...r,
|
|
321
|
-
sizes:
|
|
321
|
+
sizes: t
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
/**
|
|
325
325
|
* Update only collapsed state in repository state
|
|
326
326
|
*/
|
|
327
|
-
static async updateRepositoryCollapsed(e,
|
|
327
|
+
static async updateRepositoryCollapsed(e, t) {
|
|
328
328
|
const r = await this.getRepositoryState(e);
|
|
329
329
|
r && await this.setRepositoryState(e, {
|
|
330
330
|
...r,
|
|
331
|
-
collapsed:
|
|
331
|
+
collapsed: t
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* Check if repository state differs from workspace defaults
|
|
336
336
|
*/
|
|
337
|
-
static hasStateDeviation(e,
|
|
338
|
-
const r =
|
|
339
|
-
return { hasSizeDeviation: r, hasCollapsedDeviation:
|
|
337
|
+
static hasStateDeviation(e, t) {
|
|
338
|
+
const r = t.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(t.defaultSizes) : !1, s = t.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(t.defaultCollapsed) : !1;
|
|
339
|
+
return { hasSizeDeviation: r, hasCollapsedDeviation: s };
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
342
342
|
* Update workspace defaults from repository state
|
|
343
343
|
*/
|
|
344
|
-
static async updateWorkspaceFromRepositoryState(e,
|
|
345
|
-
const r = await this.getWorkspaceLayout(e),
|
|
346
|
-
if (!r || !
|
|
344
|
+
static async updateWorkspaceFromRepositoryState(e, t) {
|
|
345
|
+
const r = await this.getWorkspaceLayout(e), s = await this.getRepositoryState(t);
|
|
346
|
+
if (!r || !s || r.isBuiltIn) {
|
|
347
347
|
console.error(
|
|
348
348
|
"Cannot update built-in workspace or workspace/state not found"
|
|
349
349
|
);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
await this.updateWorkspaceLayout(e, {
|
|
353
|
-
defaultSizes:
|
|
354
|
-
defaultCollapsed:
|
|
353
|
+
defaultSizes: s.sizes,
|
|
354
|
+
defaultCollapsed: s.collapsed
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
358
|
* Reset repository state to workspace defaults
|
|
359
359
|
*/
|
|
360
|
-
static async resetRepositoryToWorkspaceDefaults(e,
|
|
361
|
-
const r = await this.getWorkspaceLayout(
|
|
360
|
+
static async resetRepositoryToWorkspaceDefaults(e, t) {
|
|
361
|
+
const r = await this.getWorkspaceLayout(t);
|
|
362
362
|
if (!r) {
|
|
363
|
-
console.error(`Workspace ${
|
|
363
|
+
console.error(`Workspace ${t} not found`);
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
...
|
|
366
|
+
const s = await this.getRepositoryState(e);
|
|
367
|
+
s && await this.setRepositoryState(e, {
|
|
368
|
+
...s,
|
|
369
369
|
sizes: r.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
370
370
|
collapsed: r.defaultCollapsed || { left: !1, right: !1 }
|
|
371
371
|
});
|
|
@@ -373,24 +373,24 @@ class R {
|
|
|
373
373
|
/**
|
|
374
374
|
* Check if a layout matches a workspace layout
|
|
375
375
|
*/
|
|
376
|
-
static isLayoutMatchingWorkspace(e,
|
|
377
|
-
return this.areLayoutsEqual(e,
|
|
376
|
+
static isLayoutMatchingWorkspace(e, t) {
|
|
377
|
+
return this.areLayoutsEqual(e, t.layout);
|
|
378
378
|
}
|
|
379
379
|
/**
|
|
380
380
|
* Find workspace ID that matches the given layout
|
|
381
381
|
*/
|
|
382
382
|
static async findMatchingWorkspace(e) {
|
|
383
|
-
const
|
|
384
|
-
for (const [r,
|
|
385
|
-
if (this.isLayoutMatchingWorkspace(e,
|
|
383
|
+
const t = await this.getWorkspaceLayouts();
|
|
384
|
+
for (const [r, s] of Object.entries(t))
|
|
385
|
+
if (this.isLayoutMatchingWorkspace(e, s))
|
|
386
386
|
return r;
|
|
387
387
|
return null;
|
|
388
388
|
}
|
|
389
389
|
/**
|
|
390
390
|
* Deep comparison of two panel layouts
|
|
391
391
|
*/
|
|
392
|
-
static areLayoutsEqual(e,
|
|
393
|
-
return JSON.stringify(e) === JSON.stringify(
|
|
392
|
+
static areLayoutsEqual(e, t) {
|
|
393
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
396
|
* Generate a unique ID from a workspace name
|
|
@@ -610,20 +610,20 @@ class R {
|
|
|
610
610
|
Object.keys(e).length;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
_
|
|
614
|
-
function
|
|
615
|
-
const { repositoryKey: e, autoInitialize:
|
|
613
|
+
H(_, "adapter", new Te());
|
|
614
|
+
function ot(o = {}) {
|
|
615
|
+
const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, a] = L(
|
|
616
616
|
{}
|
|
617
|
-
), [
|
|
617
|
+
), [n, i] = L(null), [p, u] = L(null), [h, d] = L(!0), [f, g] = L(null), m = x(async () => {
|
|
618
618
|
try {
|
|
619
|
-
|
|
620
|
-
const v = await
|
|
621
|
-
if (
|
|
622
|
-
let
|
|
623
|
-
if (!
|
|
624
|
-
const
|
|
625
|
-
S && (
|
|
626
|
-
workspaceId:
|
|
619
|
+
d(!0), g(null);
|
|
620
|
+
const v = await _.getWorkspaceLayouts();
|
|
621
|
+
if (a(v), e) {
|
|
622
|
+
let C = await _.getRepositoryState(e);
|
|
623
|
+
if (!C && t) {
|
|
624
|
+
const y = r || "project-management", S = await _.getWorkspaceLayout(y);
|
|
625
|
+
S && (C = {
|
|
626
|
+
workspaceId: y,
|
|
627
627
|
sizes: S.defaultSizes || {
|
|
628
628
|
left: 20,
|
|
629
629
|
middle: 45,
|
|
@@ -633,278 +633,278 @@ function De(t = {}) {
|
|
|
633
633
|
left: !1,
|
|
634
634
|
right: !1
|
|
635
635
|
}
|
|
636
|
-
}, await
|
|
636
|
+
}, await _.setRepositoryState(
|
|
637
637
|
e,
|
|
638
|
-
|
|
638
|
+
C
|
|
639
639
|
));
|
|
640
640
|
}
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
641
|
+
if (i(C), C != null && C.workspaceId) {
|
|
642
|
+
const y = await _.getWorkspaceLayout(
|
|
643
|
+
C.workspaceId
|
|
644
644
|
);
|
|
645
|
-
|
|
645
|
+
u(y);
|
|
646
646
|
} else
|
|
647
|
-
|
|
647
|
+
u(null);
|
|
648
648
|
}
|
|
649
649
|
} catch (v) {
|
|
650
|
-
|
|
650
|
+
g(v), console.error("Failed to load workspace data:", v);
|
|
651
651
|
} finally {
|
|
652
|
-
|
|
652
|
+
d(!1);
|
|
653
653
|
}
|
|
654
|
-
}, [e,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
const
|
|
659
|
-
async (v) => await
|
|
654
|
+
}, [e, t, r]);
|
|
655
|
+
W(() => {
|
|
656
|
+
m();
|
|
657
|
+
}, [m]);
|
|
658
|
+
const c = x(
|
|
659
|
+
async (v) => await _.getWorkspaceLayout(v),
|
|
660
660
|
[]
|
|
661
|
-
), k =
|
|
661
|
+
), k = x(
|
|
662
662
|
async (v) => {
|
|
663
|
-
const
|
|
664
|
-
return await
|
|
663
|
+
const C = await _.createWorkspaceLayout(v);
|
|
664
|
+
return await m(), C;
|
|
665
665
|
},
|
|
666
|
-
[
|
|
667
|
-
),
|
|
668
|
-
async (v,
|
|
669
|
-
const
|
|
670
|
-
return await
|
|
666
|
+
[m]
|
|
667
|
+
), R = x(
|
|
668
|
+
async (v, C) => {
|
|
669
|
+
const y = await _.updateWorkspaceLayout(v, C);
|
|
670
|
+
return await m(), y;
|
|
671
671
|
},
|
|
672
|
-
[
|
|
673
|
-
),
|
|
672
|
+
[m]
|
|
673
|
+
), A = x(
|
|
674
674
|
async (v) => {
|
|
675
|
-
const
|
|
676
|
-
return
|
|
675
|
+
const C = await _.deleteWorkspaceLayout(v);
|
|
676
|
+
return C && await m(), C;
|
|
677
677
|
},
|
|
678
|
-
[
|
|
679
|
-
),
|
|
678
|
+
[m]
|
|
679
|
+
), I = x(
|
|
680
680
|
async (v) => {
|
|
681
681
|
if (!e) {
|
|
682
682
|
console.error("Cannot apply workspace without repositoryKey");
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
685
|
+
const C = await _.getWorkspaceLayout(v);
|
|
686
|
+
if (!C) {
|
|
687
687
|
console.error(`Workspace ${v} not found`);
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
690
|
+
const y = {
|
|
691
691
|
workspaceId: v,
|
|
692
|
-
sizes:
|
|
693
|
-
collapsed:
|
|
692
|
+
sizes: C.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
693
|
+
collapsed: C.defaultCollapsed || {
|
|
694
694
|
left: !1,
|
|
695
695
|
right: !1
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
await
|
|
698
|
+
await _.setRepositoryState(e, y), await m();
|
|
699
699
|
},
|
|
700
|
-
[e,
|
|
701
|
-
),
|
|
700
|
+
[e, m]
|
|
701
|
+
), $ = x(
|
|
702
702
|
async (v) => {
|
|
703
703
|
if (!e) {
|
|
704
704
|
console.error("Cannot update sizes without repositoryKey");
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
await
|
|
707
|
+
await _.updateRepositorySizes(e, v), await m();
|
|
708
708
|
},
|
|
709
|
-
[e,
|
|
710
|
-
),
|
|
709
|
+
[e, m]
|
|
710
|
+
), D = x(
|
|
711
711
|
async (v) => {
|
|
712
712
|
if (!e) {
|
|
713
713
|
console.error("Cannot update collapsed without repositoryKey");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
await
|
|
716
|
+
await _.updateRepositoryCollapsed(
|
|
717
717
|
e,
|
|
718
718
|
v
|
|
719
|
-
), await
|
|
719
|
+
), await m();
|
|
720
720
|
},
|
|
721
|
-
[e,
|
|
722
|
-
),
|
|
723
|
-
if (!e || !(
|
|
721
|
+
[e, m]
|
|
722
|
+
), w = x(async () => {
|
|
723
|
+
if (!e || !(n != null && n.workspaceId)) {
|
|
724
724
|
console.error("Cannot reset without repositoryKey and active workspace");
|
|
725
725
|
return;
|
|
726
726
|
}
|
|
727
|
-
await
|
|
727
|
+
await _.resetRepositoryToWorkspaceDefaults(
|
|
728
728
|
e,
|
|
729
|
-
|
|
730
|
-
), await
|
|
731
|
-
}, [e,
|
|
732
|
-
await
|
|
733
|
-
}, [
|
|
729
|
+
n.workspaceId
|
|
730
|
+
), await m();
|
|
731
|
+
}, [e, n == null ? void 0 : n.workspaceId, m]), P = x(async () => {
|
|
732
|
+
await m();
|
|
733
|
+
}, [m]);
|
|
734
734
|
return {
|
|
735
|
-
workspaces:
|
|
736
|
-
repositoryState:
|
|
737
|
-
activeWorkspace:
|
|
738
|
-
loading:
|
|
739
|
-
error:
|
|
740
|
-
getWorkspace:
|
|
735
|
+
workspaces: s,
|
|
736
|
+
repositoryState: n,
|
|
737
|
+
activeWorkspace: p,
|
|
738
|
+
loading: h,
|
|
739
|
+
error: f,
|
|
740
|
+
getWorkspace: c,
|
|
741
741
|
createWorkspace: k,
|
|
742
|
-
updateWorkspace:
|
|
743
|
-
deleteWorkspace:
|
|
744
|
-
applyWorkspace:
|
|
745
|
-
updateSizes:
|
|
746
|
-
updateCollapsed:
|
|
747
|
-
resetToDefaults:
|
|
748
|
-
refresh:
|
|
742
|
+
updateWorkspace: R,
|
|
743
|
+
deleteWorkspace: A,
|
|
744
|
+
applyWorkspace: I,
|
|
745
|
+
updateSizes: $,
|
|
746
|
+
updateCollapsed: D,
|
|
747
|
+
resetToDefaults: w,
|
|
748
|
+
refresh: P
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function rt(o = {}) {
|
|
752
752
|
const {
|
|
753
753
|
initialFocus: e = null,
|
|
754
|
-
collapsed:
|
|
754
|
+
collapsed: t = {},
|
|
755
755
|
panelType: r = "three-panel",
|
|
756
|
-
onFocusChange:
|
|
757
|
-
events:
|
|
758
|
-
getPanelId:
|
|
759
|
-
} =
|
|
756
|
+
onFocusChange: s,
|
|
757
|
+
events: a,
|
|
758
|
+
getPanelId: n
|
|
759
|
+
} = o, [i, p] = L(
|
|
760
760
|
e
|
|
761
|
-
),
|
|
762
|
-
(
|
|
763
|
-
const k =
|
|
764
|
-
if (
|
|
761
|
+
), u = x(
|
|
762
|
+
(c) => {
|
|
763
|
+
const k = i;
|
|
764
|
+
if (p(c), s == null || s(c), a && n) {
|
|
765
765
|
if (k) {
|
|
766
|
-
const
|
|
767
|
-
|
|
766
|
+
const A = n(k);
|
|
767
|
+
A && a.emit({
|
|
768
768
|
type: "panel:blur",
|
|
769
769
|
source: "panel-layouts",
|
|
770
770
|
timestamp: Date.now(),
|
|
771
771
|
payload: {
|
|
772
|
-
panelId:
|
|
772
|
+
panelId: A,
|
|
773
773
|
panelSlot: k,
|
|
774
|
-
nextPanelId:
|
|
774
|
+
nextPanelId: n(c)
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const R = n(c);
|
|
779
|
+
R && a.emit({
|
|
780
780
|
type: "panel:focus",
|
|
781
781
|
source: "panel-layouts",
|
|
782
782
|
timestamp: Date.now(),
|
|
783
783
|
payload: {
|
|
784
|
-
panelId:
|
|
785
|
-
panelSlot:
|
|
784
|
+
panelId: R,
|
|
785
|
+
panelSlot: c,
|
|
786
786
|
source: "keyboard-shortcut"
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
|
-
[
|
|
792
|
-
),
|
|
793
|
-
const
|
|
794
|
-
if (
|
|
795
|
-
const k =
|
|
796
|
-
k &&
|
|
791
|
+
[i, s, a, n]
|
|
792
|
+
), h = x(() => {
|
|
793
|
+
const c = i;
|
|
794
|
+
if (p(null), s == null || s(null), a && n && c) {
|
|
795
|
+
const k = n(c);
|
|
796
|
+
k && a.emit({
|
|
797
797
|
type: "panel:blur",
|
|
798
798
|
source: "panel-layouts",
|
|
799
799
|
timestamp: Date.now(),
|
|
800
800
|
payload: {
|
|
801
801
|
panelId: k,
|
|
802
|
-
panelSlot:
|
|
802
|
+
panelSlot: c
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
}, [
|
|
807
|
-
const
|
|
808
|
-
return
|
|
809
|
-
}, [
|
|
810
|
-
const
|
|
811
|
-
if (
|
|
812
|
-
if (
|
|
813
|
-
|
|
806
|
+
}, [i, s, a, n]), d = x(() => {
|
|
807
|
+
const c = [];
|
|
808
|
+
return t.left || c.push("left"), c.push("middle"), r === "three-panel" && !t.right && c.push("right"), c;
|
|
809
|
+
}, [t, r]), f = x(() => {
|
|
810
|
+
const c = d();
|
|
811
|
+
if (c.length === 0) return;
|
|
812
|
+
if (i === null) {
|
|
813
|
+
u(c[0]);
|
|
814
814
|
return;
|
|
815
815
|
}
|
|
816
|
-
const k =
|
|
816
|
+
const k = c.indexOf(i);
|
|
817
817
|
if (k === -1) {
|
|
818
|
-
|
|
818
|
+
u(c[0]);
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
}, [
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
if (
|
|
827
|
-
|
|
821
|
+
const R = (k + 1) % c.length;
|
|
822
|
+
u(c[R]);
|
|
823
|
+
}, [i, d, u]), g = x(() => {
|
|
824
|
+
const c = d();
|
|
825
|
+
if (c.length === 0) return;
|
|
826
|
+
if (i === null) {
|
|
827
|
+
u(c[c.length - 1]);
|
|
828
828
|
return;
|
|
829
829
|
}
|
|
830
|
-
const k =
|
|
830
|
+
const k = c.indexOf(i);
|
|
831
831
|
if (k === -1) {
|
|
832
|
-
|
|
832
|
+
u(c[c.length - 1]);
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
}, [
|
|
838
|
-
(
|
|
839
|
-
[
|
|
835
|
+
const R = k === 0 ? c.length - 1 : k - 1;
|
|
836
|
+
u(c[R]);
|
|
837
|
+
}, [i, d, u]), m = x(
|
|
838
|
+
(c) => i === c,
|
|
839
|
+
[i]
|
|
840
840
|
);
|
|
841
841
|
return {
|
|
842
|
-
focusedPanel:
|
|
843
|
-
setFocus:
|
|
844
|
-
clearFocus:
|
|
845
|
-
focusNext:
|
|
846
|
-
focusPrevious:
|
|
847
|
-
isFocused:
|
|
842
|
+
focusedPanel: i,
|
|
843
|
+
setFocus: u,
|
|
844
|
+
clearFocus: h,
|
|
845
|
+
focusNext: f,
|
|
846
|
+
focusPrevious: g,
|
|
847
|
+
isFocused: m
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function st(o) {
|
|
851
851
|
const {
|
|
852
852
|
enabled: e = !0,
|
|
853
|
-
focusedPanel:
|
|
853
|
+
focusedPanel: t,
|
|
854
854
|
collapsed: r,
|
|
855
|
-
panelType:
|
|
856
|
-
setFocus:
|
|
857
|
-
onExpand:
|
|
858
|
-
onCollapse:
|
|
859
|
-
} =
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}, [
|
|
863
|
-
|
|
864
|
-
}, [r]),
|
|
865
|
-
|
|
866
|
-
}, [
|
|
867
|
-
const
|
|
868
|
-
(
|
|
869
|
-
if (!
|
|
855
|
+
panelType: s,
|
|
856
|
+
setFocus: a,
|
|
857
|
+
onExpand: n,
|
|
858
|
+
onCollapse: i
|
|
859
|
+
} = o, p = z(t), u = z(r), h = z(s);
|
|
860
|
+
W(() => {
|
|
861
|
+
p.current = t;
|
|
862
|
+
}, [t]), W(() => {
|
|
863
|
+
u.current = r;
|
|
864
|
+
}, [r]), W(() => {
|
|
865
|
+
h.current = s;
|
|
866
|
+
}, [s]);
|
|
867
|
+
const d = x(
|
|
868
|
+
(f) => {
|
|
869
|
+
if (!f.altKey || f.ctrlKey || f.metaKey || f.shiftKey)
|
|
870
870
|
return;
|
|
871
|
-
const
|
|
872
|
-
|
|
871
|
+
const g = f.code, m = p.current, c = u.current, k = h.current;
|
|
872
|
+
g === "Digit1" || g === "Numpad1" ? (f.preventDefault(), c.left ? n("left") : m !== "left" ? a("left") : (i("left"), a("middle"))) : g === "Digit2" || g === "Numpad2" ? (f.preventDefault(), a("middle")) : (g === "Digit3" || g === "Numpad3") && k === "three-panel" && (f.preventDefault(), c.right ? n("right") : m !== "right" ? a("right") : (i("right"), a("middle")));
|
|
873
873
|
},
|
|
874
|
-
[
|
|
874
|
+
[a, n, i]
|
|
875
875
|
);
|
|
876
|
-
|
|
876
|
+
W(() => {
|
|
877
877
|
if (e)
|
|
878
|
-
return window.addEventListener("keydown",
|
|
879
|
-
window.removeEventListener("keydown",
|
|
878
|
+
return window.addEventListener("keydown", d), () => {
|
|
879
|
+
window.removeEventListener("keydown", d);
|
|
880
880
|
};
|
|
881
|
-
}, [e,
|
|
881
|
+
}, [e, d]);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
884
|
-
|
|
885
|
-
const
|
|
883
|
+
function at(o, e, t, r) {
|
|
884
|
+
W(() => {
|
|
885
|
+
const s = e.on(
|
|
886
886
|
"panel:focus",
|
|
887
|
-
(
|
|
888
|
-
|
|
887
|
+
(n) => {
|
|
888
|
+
n.payload.panelId === o && t();
|
|
889
889
|
}
|
|
890
890
|
);
|
|
891
|
-
let
|
|
892
|
-
return r && (
|
|
891
|
+
let a;
|
|
892
|
+
return r && (a = e.on(
|
|
893
893
|
"panel:blur",
|
|
894
|
-
(
|
|
895
|
-
|
|
894
|
+
(n) => {
|
|
895
|
+
n.payload.panelId === o && r();
|
|
896
896
|
}
|
|
897
897
|
)), () => {
|
|
898
|
-
|
|
898
|
+
s(), a == null || a();
|
|
899
899
|
};
|
|
900
|
-
}, [
|
|
900
|
+
}, [o, e, t, r]);
|
|
901
901
|
}
|
|
902
|
-
const
|
|
903
|
-
isFocused:
|
|
902
|
+
const nt = ({
|
|
903
|
+
isFocused: o,
|
|
904
904
|
className: e = "",
|
|
905
|
-
style:
|
|
905
|
+
style: t = {}
|
|
906
906
|
}) => {
|
|
907
|
-
if (!
|
|
907
|
+
if (!o)
|
|
908
908
|
return null;
|
|
909
909
|
const r = {
|
|
910
910
|
position: "absolute",
|
|
@@ -918,9 +918,9 @@ const je = ({
|
|
|
918
918
|
boxShadow: "0 0 0 1px var(--panel-focus-shadow-color, rgba(0, 102, 204, 0.2))",
|
|
919
919
|
zIndex: 1e3,
|
|
920
920
|
transition: "opacity 0.15s ease-in-out",
|
|
921
|
-
...
|
|
921
|
+
...t
|
|
922
922
|
};
|
|
923
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ l(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
926
926
|
className: `panel-focus-indicator ${e}`,
|
|
@@ -929,54 +929,54 @@ const je = ({
|
|
|
929
929
|
"aria-hidden": "true"
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
|
-
},
|
|
933
|
-
value:
|
|
932
|
+
}, Pe = ({
|
|
933
|
+
value: o,
|
|
934
934
|
onChange: e,
|
|
935
|
-
placeholder:
|
|
935
|
+
placeholder: t = "> Type a command...",
|
|
936
936
|
onClose: r,
|
|
937
|
-
onEnter:
|
|
937
|
+
onEnter: s
|
|
938
938
|
}) => {
|
|
939
|
-
const { theme:
|
|
940
|
-
|
|
941
|
-
|
|
939
|
+
const { theme: a } = q(), n = z(null);
|
|
940
|
+
W(() => {
|
|
941
|
+
n.current && n.current.focus();
|
|
942
942
|
}, []);
|
|
943
|
-
const
|
|
944
|
-
switch (
|
|
943
|
+
const i = (p) => {
|
|
944
|
+
switch (p.key) {
|
|
945
945
|
case "Enter":
|
|
946
|
-
|
|
946
|
+
p.preventDefault(), s == null || s();
|
|
947
947
|
break;
|
|
948
948
|
case "Escape":
|
|
949
|
-
|
|
949
|
+
p.preventDefault(), r();
|
|
950
950
|
break;
|
|
951
951
|
}
|
|
952
952
|
};
|
|
953
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ l(
|
|
954
954
|
"div",
|
|
955
955
|
{
|
|
956
956
|
style: {
|
|
957
957
|
padding: "0",
|
|
958
|
-
borderBottom: `1px solid ${
|
|
959
|
-
backgroundColor:
|
|
958
|
+
borderBottom: `1px solid ${a.colors.border}`,
|
|
959
|
+
backgroundColor: a.colors.background
|
|
960
960
|
},
|
|
961
|
-
children: /* @__PURE__ */
|
|
961
|
+
children: /* @__PURE__ */ l(
|
|
962
962
|
"input",
|
|
963
963
|
{
|
|
964
|
-
ref:
|
|
964
|
+
ref: n,
|
|
965
965
|
type: "text",
|
|
966
|
-
value:
|
|
967
|
-
onChange: (
|
|
968
|
-
onKeyDown:
|
|
969
|
-
placeholder:
|
|
966
|
+
value: o,
|
|
967
|
+
onChange: (p) => e(p.target.value),
|
|
968
|
+
onKeyDown: i,
|
|
969
|
+
placeholder: t,
|
|
970
970
|
style: {
|
|
971
971
|
width: "100%",
|
|
972
972
|
padding: "16px 20px",
|
|
973
973
|
fontSize: "16px",
|
|
974
|
-
fontFamily:
|
|
974
|
+
fontFamily: a.fonts.monospace,
|
|
975
975
|
backgroundColor: "transparent",
|
|
976
976
|
border: "none",
|
|
977
977
|
outline: "none",
|
|
978
|
-
color:
|
|
979
|
-
caretColor:
|
|
978
|
+
color: a.colors.text,
|
|
979
|
+
caretColor: a.colors.primary
|
|
980
980
|
},
|
|
981
981
|
autoComplete: "off",
|
|
982
982
|
autoCorrect: "off",
|
|
@@ -986,33 +986,33 @@ const je = ({
|
|
|
986
986
|
)
|
|
987
987
|
}
|
|
988
988
|
);
|
|
989
|
-
},
|
|
990
|
-
({ command:
|
|
991
|
-
const { theme:
|
|
992
|
-
return /* @__PURE__ */
|
|
989
|
+
}, ae = ve(
|
|
990
|
+
({ command: o, isSelected: e, onClick: t, onMouseEnter: r }, s) => {
|
|
991
|
+
const { theme: a } = q(), { label: n, description: i, icon: p, shortcut: u } = o, [h, d] = Ce.useState(!1);
|
|
992
|
+
return /* @__PURE__ */ b(
|
|
993
993
|
"div",
|
|
994
994
|
{
|
|
995
|
-
ref:
|
|
996
|
-
onClick:
|
|
995
|
+
ref: s,
|
|
996
|
+
onClick: t,
|
|
997
997
|
onMouseEnter: () => {
|
|
998
|
-
|
|
998
|
+
d(!0), r();
|
|
999
999
|
},
|
|
1000
|
-
onMouseLeave: () =>
|
|
1000
|
+
onMouseLeave: () => d(!1),
|
|
1001
1001
|
style: {
|
|
1002
1002
|
padding: "10px 16px",
|
|
1003
1003
|
cursor: "pointer",
|
|
1004
|
-
backgroundColor: e ||
|
|
1005
|
-
borderLeft: e ||
|
|
1004
|
+
backgroundColor: e || h ? a.colors.backgroundSecondary : "transparent",
|
|
1005
|
+
borderLeft: e || h ? `3px solid ${a.colors.primary}` : "3px solid transparent",
|
|
1006
1006
|
transition: "all 0.1s ease",
|
|
1007
1007
|
display: "flex",
|
|
1008
1008
|
alignItems: "center",
|
|
1009
1009
|
gap: "12px"
|
|
1010
1010
|
},
|
|
1011
|
-
onMouseDown: (
|
|
1012
|
-
|
|
1011
|
+
onMouseDown: (f) => {
|
|
1012
|
+
f.preventDefault();
|
|
1013
1013
|
},
|
|
1014
1014
|
children: [
|
|
1015
|
-
|
|
1015
|
+
p && /* @__PURE__ */ l(
|
|
1016
1016
|
"div",
|
|
1017
1017
|
{
|
|
1018
1018
|
style: {
|
|
@@ -1023,52 +1023,52 @@ const je = ({
|
|
|
1023
1023
|
alignItems: "center",
|
|
1024
1024
|
justifyContent: "center",
|
|
1025
1025
|
fontSize: "16px",
|
|
1026
|
-
color: e ||
|
|
1026
|
+
color: e || h ? a.colors.primary : a.colors.textSecondary
|
|
1027
1027
|
},
|
|
1028
|
-
children:
|
|
1028
|
+
children: p
|
|
1029
1029
|
}
|
|
1030
1030
|
),
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ b("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1032
|
+
/* @__PURE__ */ l(
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
1035
1035
|
style: {
|
|
1036
1036
|
fontSize: "14px",
|
|
1037
1037
|
fontWeight: 500,
|
|
1038
|
-
color: e ||
|
|
1039
|
-
marginBottom:
|
|
1038
|
+
color: e || h ? a.colors.text : a.colors.textSecondary,
|
|
1039
|
+
marginBottom: i ? "2px" : 0
|
|
1040
1040
|
},
|
|
1041
|
-
children:
|
|
1041
|
+
children: n
|
|
1042
1042
|
}
|
|
1043
1043
|
),
|
|
1044
|
-
|
|
1044
|
+
i && /* @__PURE__ */ l(
|
|
1045
1045
|
"div",
|
|
1046
1046
|
{
|
|
1047
1047
|
style: {
|
|
1048
1048
|
fontSize: "12px",
|
|
1049
|
-
color:
|
|
1049
|
+
color: a.colors.textMuted,
|
|
1050
1050
|
overflow: "hidden",
|
|
1051
1051
|
textOverflow: "ellipsis",
|
|
1052
1052
|
whiteSpace: "nowrap"
|
|
1053
1053
|
},
|
|
1054
|
-
children:
|
|
1054
|
+
children: i
|
|
1055
1055
|
}
|
|
1056
1056
|
)
|
|
1057
1057
|
] }),
|
|
1058
|
-
|
|
1058
|
+
u && /* @__PURE__ */ l(
|
|
1059
1059
|
"div",
|
|
1060
1060
|
{
|
|
1061
1061
|
style: {
|
|
1062
1062
|
flexShrink: 0,
|
|
1063
1063
|
fontSize: "11px",
|
|
1064
|
-
color:
|
|
1064
|
+
color: a.colors.textMuted,
|
|
1065
1065
|
padding: "2px 8px",
|
|
1066
|
-
backgroundColor:
|
|
1067
|
-
border: `1px solid ${
|
|
1066
|
+
backgroundColor: a.colors.background,
|
|
1067
|
+
border: `1px solid ${a.colors.border}`,
|
|
1068
1068
|
borderRadius: "4px",
|
|
1069
|
-
fontFamily:
|
|
1069
|
+
fontFamily: a.fonts.monospace
|
|
1070
1070
|
},
|
|
1071
|
-
children:
|
|
1071
|
+
children: u
|
|
1072
1072
|
}
|
|
1073
1073
|
)
|
|
1074
1074
|
]
|
|
@@ -1076,37 +1076,37 @@ const je = ({
|
|
|
1076
1076
|
);
|
|
1077
1077
|
}
|
|
1078
1078
|
);
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
commands:
|
|
1079
|
+
ae.displayName = "CommandItem";
|
|
1080
|
+
const Ie = ({
|
|
1081
|
+
commands: o,
|
|
1082
1082
|
selectedIndex: e,
|
|
1083
|
-
onSelect:
|
|
1083
|
+
onSelect: t,
|
|
1084
1084
|
onHover: r,
|
|
1085
|
-
maxResults:
|
|
1085
|
+
maxResults: s = 10
|
|
1086
1086
|
}) => {
|
|
1087
|
-
const { theme:
|
|
1088
|
-
|
|
1089
|
-
if (
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1087
|
+
const { theme: a } = q(), n = z(null), i = z(null), p = o.slice(0, s);
|
|
1088
|
+
W(() => {
|
|
1089
|
+
if (i.current && n.current) {
|
|
1090
|
+
const d = i.current, f = n.current, g = d.offsetTop, m = g + d.offsetHeight, c = f.scrollTop, k = f.clientHeight;
|
|
1091
|
+
g < c ? f.scrollTop = g - 8 : m > c + k && (f.scrollTop = m - k + 8);
|
|
1092
1092
|
}
|
|
1093
1093
|
}, [e]);
|
|
1094
|
-
const
|
|
1095
|
-
const
|
|
1096
|
-
return
|
|
1097
|
-
}, {}),
|
|
1098
|
-
return /* @__PURE__ */
|
|
1094
|
+
const u = p.reduce((d, f, g) => {
|
|
1095
|
+
const m = f.category || "Other";
|
|
1096
|
+
return d[m] || (d[m] = []), d[m].push({ command: f, index: g }), d;
|
|
1097
|
+
}, {}), h = Object.keys(u).sort((d, f) => d === "Other" ? 1 : f === "Other" ? -1 : d.localeCompare(f));
|
|
1098
|
+
return /* @__PURE__ */ b(
|
|
1099
1099
|
"div",
|
|
1100
1100
|
{
|
|
1101
|
-
ref:
|
|
1101
|
+
ref: n,
|
|
1102
1102
|
style: {
|
|
1103
1103
|
overflowY: "auto",
|
|
1104
1104
|
maxHeight: "400px",
|
|
1105
1105
|
padding: "8px 0"
|
|
1106
1106
|
},
|
|
1107
1107
|
children: [
|
|
1108
|
-
|
|
1109
|
-
|
|
1108
|
+
h.map((d) => /* @__PURE__ */ b("div", { children: [
|
|
1109
|
+
h.length > 1 && /* @__PURE__ */ l(
|
|
1110
1110
|
"div",
|
|
1111
1111
|
{
|
|
1112
1112
|
style: {
|
|
@@ -1114,39 +1114,39 @@ const ae = ({
|
|
|
1114
1114
|
fontSize: "11px",
|
|
1115
1115
|
fontWeight: 600,
|
|
1116
1116
|
textTransform: "uppercase",
|
|
1117
|
-
color:
|
|
1117
|
+
color: a.colors.textMuted,
|
|
1118
1118
|
letterSpacing: "0.5px"
|
|
1119
1119
|
},
|
|
1120
|
-
children:
|
|
1120
|
+
children: d
|
|
1121
1121
|
}
|
|
1122
1122
|
),
|
|
1123
|
-
|
|
1124
|
-
|
|
1123
|
+
u[d].map(({ command: f, index: g }) => /* @__PURE__ */ l(
|
|
1124
|
+
ae,
|
|
1125
1125
|
{
|
|
1126
|
-
command:
|
|
1127
|
-
isSelected:
|
|
1128
|
-
onClick: () =>
|
|
1129
|
-
onMouseEnter: () => r(
|
|
1130
|
-
ref:
|
|
1126
|
+
command: f,
|
|
1127
|
+
isSelected: g === e,
|
|
1128
|
+
onClick: () => t(f),
|
|
1129
|
+
onMouseEnter: () => r(g),
|
|
1130
|
+
ref: g === e ? i : void 0
|
|
1131
1131
|
},
|
|
1132
|
-
|
|
1132
|
+
f.id
|
|
1133
1133
|
))
|
|
1134
|
-
] },
|
|
1135
|
-
|
|
1134
|
+
] }, d)),
|
|
1135
|
+
o.length > s && /* @__PURE__ */ b(
|
|
1136
1136
|
"div",
|
|
1137
1137
|
{
|
|
1138
1138
|
style: {
|
|
1139
1139
|
padding: "8px 16px",
|
|
1140
1140
|
fontSize: "12px",
|
|
1141
|
-
color:
|
|
1141
|
+
color: a.colors.textMuted,
|
|
1142
1142
|
textAlign: "center",
|
|
1143
|
-
borderTop: `1px solid ${
|
|
1143
|
+
borderTop: `1px solid ${a.colors.border}`
|
|
1144
1144
|
},
|
|
1145
1145
|
children: [
|
|
1146
1146
|
"Showing ",
|
|
1147
|
-
|
|
1147
|
+
s,
|
|
1148
1148
|
" of ",
|
|
1149
|
-
|
|
1149
|
+
o.length,
|
|
1150
1150
|
" results"
|
|
1151
1151
|
]
|
|
1152
1152
|
}
|
|
@@ -1154,35 +1154,35 @@ const ae = ({
|
|
|
1154
1154
|
]
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
|
-
},
|
|
1158
|
-
commandPalette:
|
|
1157
|
+
}, it = ({
|
|
1158
|
+
commandPalette: o,
|
|
1159
1159
|
config: e
|
|
1160
1160
|
}) => {
|
|
1161
|
-
const { theme:
|
|
1162
|
-
isOpen:
|
|
1163
|
-
close:
|
|
1164
|
-
query:
|
|
1165
|
-
setQuery:
|
|
1166
|
-
filteredCommands:
|
|
1167
|
-
selectedIndex:
|
|
1168
|
-
setSelectedIndex:
|
|
1169
|
-
executeSelected:
|
|
1170
|
-
} =
|
|
1171
|
-
if (
|
|
1172
|
-
if (!
|
|
1173
|
-
const
|
|
1174
|
-
r.current && !r.current.contains(k.target) &&
|
|
1175
|
-
},
|
|
1176
|
-
document.addEventListener("mousedown",
|
|
1161
|
+
const { theme: t } = q(), r = z(null), {
|
|
1162
|
+
isOpen: s,
|
|
1163
|
+
close: a,
|
|
1164
|
+
query: n,
|
|
1165
|
+
setQuery: i,
|
|
1166
|
+
filteredCommands: p,
|
|
1167
|
+
selectedIndex: u,
|
|
1168
|
+
setSelectedIndex: h,
|
|
1169
|
+
executeSelected: d
|
|
1170
|
+
} = o;
|
|
1171
|
+
if (W(() => {
|
|
1172
|
+
if (!s) return;
|
|
1173
|
+
const m = (k) => {
|
|
1174
|
+
r.current && !r.current.contains(k.target) && a();
|
|
1175
|
+
}, c = setTimeout(() => {
|
|
1176
|
+
document.addEventListener("mousedown", m);
|
|
1177
1177
|
}, 100);
|
|
1178
1178
|
return () => {
|
|
1179
|
-
clearTimeout(
|
|
1179
|
+
clearTimeout(c), document.removeEventListener("mousedown", m);
|
|
1180
1180
|
};
|
|
1181
|
-
}, [
|
|
1181
|
+
}, [s, a]), !s)
|
|
1182
1182
|
return null;
|
|
1183
|
-
const
|
|
1184
|
-
return /* @__PURE__ */
|
|
1185
|
-
/* @__PURE__ */
|
|
1183
|
+
const f = (e == null ? void 0 : e.maxHeight) || "50vh", g = (e == null ? void 0 : e.placeholder) || "> Type a command...";
|
|
1184
|
+
return /* @__PURE__ */ b(se, { children: [
|
|
1185
|
+
/* @__PURE__ */ l(
|
|
1186
1186
|
"div",
|
|
1187
1187
|
{
|
|
1188
1188
|
style: {
|
|
@@ -1192,10 +1192,10 @@ const ae = ({
|
|
|
1192
1192
|
backdropFilter: "blur(2px)",
|
|
1193
1193
|
zIndex: 999
|
|
1194
1194
|
},
|
|
1195
|
-
onClick:
|
|
1195
|
+
onClick: a
|
|
1196
1196
|
}
|
|
1197
1197
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ b(
|
|
1199
1199
|
"div",
|
|
1200
1200
|
{
|
|
1201
1201
|
ref: r,
|
|
@@ -1205,76 +1205,76 @@ const ae = ({
|
|
|
1205
1205
|
bottom: 0,
|
|
1206
1206
|
left: 0,
|
|
1207
1207
|
right: 0,
|
|
1208
|
-
maxHeight:
|
|
1209
|
-
backgroundColor:
|
|
1210
|
-
borderTop: `1px solid ${
|
|
1211
|
-
boxShadow:
|
|
1208
|
+
maxHeight: f,
|
|
1209
|
+
backgroundColor: t.colors.surface,
|
|
1210
|
+
borderTop: `1px solid ${t.colors.border}`,
|
|
1211
|
+
boxShadow: t.shadows[2],
|
|
1212
1212
|
zIndex: 1e3,
|
|
1213
1213
|
display: "flex",
|
|
1214
1214
|
flexDirection: "column-reverse",
|
|
1215
1215
|
...e == null ? void 0 : e.style
|
|
1216
1216
|
},
|
|
1217
1217
|
children: [
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1220
|
-
|
|
1218
|
+
/* @__PURE__ */ b("div", { children: [
|
|
1219
|
+
/* @__PURE__ */ l(
|
|
1220
|
+
Pe,
|
|
1221
1221
|
{
|
|
1222
|
-
value:
|
|
1223
|
-
onChange:
|
|
1224
|
-
placeholder:
|
|
1225
|
-
onClose:
|
|
1226
|
-
onEnter:
|
|
1222
|
+
value: n,
|
|
1223
|
+
onChange: i,
|
|
1224
|
+
placeholder: g,
|
|
1225
|
+
onClose: a,
|
|
1226
|
+
onEnter: d
|
|
1227
1227
|
}
|
|
1228
1228
|
),
|
|
1229
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ b(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
1232
|
style: {
|
|
1233
1233
|
padding: "8px 16px",
|
|
1234
|
-
borderTop: `1px solid ${
|
|
1234
|
+
borderTop: `1px solid ${t.colors.border}`,
|
|
1235
1235
|
display: "flex",
|
|
1236
1236
|
gap: "16px",
|
|
1237
1237
|
fontSize: "12px",
|
|
1238
|
-
color:
|
|
1239
|
-
backgroundColor:
|
|
1238
|
+
color: t.colors.textMuted,
|
|
1239
|
+
backgroundColor: t.colors.background
|
|
1240
1240
|
},
|
|
1241
1241
|
children: [
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ b("span", { children: [
|
|
1243
|
+
/* @__PURE__ */ l("kbd", { style: { padding: "2px 6px", backgroundColor: t.colors.backgroundSecondary, borderRadius: "3px", border: `1px solid ${t.colors.border}` }, children: "Enter" }),
|
|
1244
1244
|
" Execute"
|
|
1245
1245
|
] }),
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ b("span", { children: [
|
|
1247
|
+
/* @__PURE__ */ l("kbd", { style: { padding: "2px 6px", backgroundColor: t.colors.backgroundSecondary, borderRadius: "3px", border: `1px solid ${t.colors.border}` }, children: "Esc" }),
|
|
1248
1248
|
" Close"
|
|
1249
1249
|
] })
|
|
1250
1250
|
]
|
|
1251
1251
|
}
|
|
1252
1252
|
)
|
|
1253
1253
|
] }),
|
|
1254
|
-
|
|
1255
|
-
|
|
1254
|
+
p.length > 0 && /* @__PURE__ */ l(
|
|
1255
|
+
Ie,
|
|
1256
1256
|
{
|
|
1257
|
-
commands:
|
|
1258
|
-
selectedIndex:
|
|
1259
|
-
onSelect: (
|
|
1260
|
-
|
|
1257
|
+
commands: p,
|
|
1258
|
+
selectedIndex: u,
|
|
1259
|
+
onSelect: (m) => {
|
|
1260
|
+
o.executeCommand(m.id);
|
|
1261
1261
|
},
|
|
1262
|
-
onHover:
|
|
1262
|
+
onHover: h,
|
|
1263
1263
|
maxResults: e == null ? void 0 : e.maxResults
|
|
1264
1264
|
}
|
|
1265
1265
|
),
|
|
1266
|
-
|
|
1266
|
+
n && p.length === 0 && /* @__PURE__ */ b(
|
|
1267
1267
|
"div",
|
|
1268
1268
|
{
|
|
1269
1269
|
style: {
|
|
1270
1270
|
padding: "24px 16px",
|
|
1271
|
-
color:
|
|
1271
|
+
color: t.colors.textMuted,
|
|
1272
1272
|
textAlign: "center",
|
|
1273
1273
|
fontSize: "14px"
|
|
1274
1274
|
},
|
|
1275
1275
|
children: [
|
|
1276
1276
|
'No commands found for "',
|
|
1277
|
-
|
|
1277
|
+
n,
|
|
1278
1278
|
'"'
|
|
1279
1279
|
]
|
|
1280
1280
|
}
|
|
@@ -1284,18 +1284,18 @@ const ae = ({
|
|
|
1284
1284
|
)
|
|
1285
1285
|
] });
|
|
1286
1286
|
};
|
|
1287
|
-
class
|
|
1287
|
+
class ne {
|
|
1288
1288
|
constructor() {
|
|
1289
|
-
|
|
1290
|
-
|
|
1289
|
+
H(this, "commands", /* @__PURE__ */ new Map());
|
|
1290
|
+
H(this, "listeners", /* @__PURE__ */ new Set());
|
|
1291
1291
|
}
|
|
1292
1292
|
/**
|
|
1293
1293
|
* Register one or more commands
|
|
1294
1294
|
* @param commands - Array of commands to register
|
|
1295
1295
|
*/
|
|
1296
1296
|
registerCommands(e) {
|
|
1297
|
-
e.forEach((
|
|
1298
|
-
this.commands.set(
|
|
1297
|
+
e.forEach((t) => {
|
|
1298
|
+
this.commands.set(t.id, t);
|
|
1299
1299
|
}), this.notifyListeners();
|
|
1300
1300
|
}
|
|
1301
1301
|
/**
|
|
@@ -1310,8 +1310,8 @@ class K {
|
|
|
1310
1310
|
* @param commandIds - Array of command IDs to unregister
|
|
1311
1311
|
*/
|
|
1312
1312
|
unregisterCommands(e) {
|
|
1313
|
-
e.forEach((
|
|
1314
|
-
this.commands.delete(
|
|
1313
|
+
e.forEach((t) => {
|
|
1314
|
+
this.commands.delete(t);
|
|
1315
1315
|
}), this.notifyListeners();
|
|
1316
1316
|
}
|
|
1317
1317
|
/**
|
|
@@ -1327,8 +1327,8 @@ class K {
|
|
|
1327
1327
|
* @returns Array of available commands
|
|
1328
1328
|
*/
|
|
1329
1329
|
getCommands(e) {
|
|
1330
|
-
const
|
|
1331
|
-
return e ?
|
|
1330
|
+
const t = Array.from(this.commands.values());
|
|
1331
|
+
return e ? t.filter((r) => r.isAvailable ? r.isAvailable(e) : !0) : t;
|
|
1332
1332
|
}
|
|
1333
1333
|
/**
|
|
1334
1334
|
* Get a command by ID
|
|
@@ -1343,19 +1343,19 @@ class K {
|
|
|
1343
1343
|
* @param commandId - Command ID to execute
|
|
1344
1344
|
* @param context - Command context
|
|
1345
1345
|
*/
|
|
1346
|
-
async executeCommand(e,
|
|
1347
|
-
var
|
|
1346
|
+
async executeCommand(e, t) {
|
|
1347
|
+
var s, a;
|
|
1348
1348
|
const r = this.commands.get(e);
|
|
1349
1349
|
if (!r) {
|
|
1350
1350
|
console.warn(`Command not found: ${e}`);
|
|
1351
1351
|
return;
|
|
1352
1352
|
}
|
|
1353
|
-
if (r.isAvailable && !r.isAvailable(
|
|
1353
|
+
if (r.isAvailable && !r.isAvailable(t)) {
|
|
1354
1354
|
console.warn(`Command not available: ${e}`);
|
|
1355
1355
|
return;
|
|
1356
1356
|
}
|
|
1357
1357
|
try {
|
|
1358
|
-
await r.execute(
|
|
1358
|
+
await r.execute(t), (s = t.events) == null || s.emit({
|
|
1359
1359
|
type: "command:executed",
|
|
1360
1360
|
source: "command-palette",
|
|
1361
1361
|
timestamp: Date.now(),
|
|
@@ -1364,14 +1364,14 @@ class K {
|
|
|
1364
1364
|
commandLabel: r.label
|
|
1365
1365
|
}
|
|
1366
1366
|
});
|
|
1367
|
-
} catch (
|
|
1368
|
-
console.error(`Error executing command ${e}:`,
|
|
1367
|
+
} catch (n) {
|
|
1368
|
+
console.error(`Error executing command ${e}:`, n), (a = t.events) == null || a.emit({
|
|
1369
1369
|
type: "command:error",
|
|
1370
1370
|
source: "command-palette",
|
|
1371
1371
|
timestamp: Date.now(),
|
|
1372
1372
|
payload: {
|
|
1373
1373
|
commandId: r.id,
|
|
1374
|
-
error:
|
|
1374
|
+
error: n instanceof Error ? n.message : String(n)
|
|
1375
1375
|
}
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
@@ -1382,18 +1382,18 @@ class K {
|
|
|
1382
1382
|
* @param context - Command context for availability checks
|
|
1383
1383
|
* @returns Filtered and sorted commands
|
|
1384
1384
|
*/
|
|
1385
|
-
searchCommands(e,
|
|
1386
|
-
const r = this.getCommands(
|
|
1385
|
+
searchCommands(e, t) {
|
|
1386
|
+
const r = this.getCommands(t);
|
|
1387
1387
|
if (!e.trim())
|
|
1388
1388
|
return this.sortCommands(r);
|
|
1389
|
-
const
|
|
1390
|
-
return r.map((
|
|
1391
|
-
var
|
|
1392
|
-
let
|
|
1393
|
-
return
|
|
1394
|
-
(
|
|
1395
|
-
) && (
|
|
1396
|
-
}).filter((
|
|
1389
|
+
const s = e.toLowerCase();
|
|
1390
|
+
return r.map((n) => {
|
|
1391
|
+
var p, u;
|
|
1392
|
+
let i = 0;
|
|
1393
|
+
return n.label.toLowerCase() === s ? i += 1e3 : n.label.toLowerCase().startsWith(s) ? i += 500 : n.label.toLowerCase().includes(s) && (i += 250), (p = n.description) != null && p.toLowerCase().includes(s) && (i += 100), n.keywords && n.keywords.some(
|
|
1394
|
+
(d) => d.toLowerCase().includes(s)
|
|
1395
|
+
) && (i += 150), (u = n.category) != null && u.toLowerCase().includes(s) && (i += 50), i > 0 && n.priority && (i += n.priority), { command: n, score: i };
|
|
1396
|
+
}).filter((n) => n.score > 0).sort((n, i) => i.score - n.score).map((n) => n.command);
|
|
1397
1397
|
}
|
|
1398
1398
|
/**
|
|
1399
1399
|
* Sort commands by priority and label
|
|
@@ -1401,12 +1401,12 @@ class K {
|
|
|
1401
1401
|
* @returns Sorted commands
|
|
1402
1402
|
*/
|
|
1403
1403
|
sortCommands(e) {
|
|
1404
|
-
return e.sort((
|
|
1405
|
-
const
|
|
1406
|
-
if (
|
|
1407
|
-
return
|
|
1408
|
-
const
|
|
1409
|
-
return
|
|
1404
|
+
return e.sort((t, r) => {
|
|
1405
|
+
const s = (r.priority || 0) - (t.priority || 0);
|
|
1406
|
+
if (s !== 0)
|
|
1407
|
+
return s;
|
|
1408
|
+
const a = t.category || "", n = r.category || "", i = a.localeCompare(n);
|
|
1409
|
+
return i !== 0 ? i : t.label.localeCompare(r.label);
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
1412
|
/**
|
|
@@ -1438,136 +1438,136 @@ class K {
|
|
|
1438
1438
|
this.listeners.forEach((e) => e());
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
let
|
|
1442
|
-
function
|
|
1443
|
-
return
|
|
1441
|
+
let Y = null;
|
|
1442
|
+
function lt() {
|
|
1443
|
+
return Y || (Y = new ne()), Y;
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1446
|
-
|
|
1445
|
+
function ct() {
|
|
1446
|
+
Y = null;
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1449
|
-
context:
|
|
1448
|
+
function dt({
|
|
1449
|
+
context: o,
|
|
1450
1450
|
commands: e = [],
|
|
1451
|
-
keyboard:
|
|
1451
|
+
keyboard: t = { key: " ", altKey: !0 },
|
|
1452
1452
|
config: r = {},
|
|
1453
|
-
registry:
|
|
1453
|
+
registry: s
|
|
1454
1454
|
}) {
|
|
1455
|
-
const [
|
|
1456
|
-
() =>
|
|
1457
|
-
[
|
|
1458
|
-
),
|
|
1455
|
+
const [a, n] = L(!1), [i, p] = L(""), [u, h] = L(0), [d, f] = L([]), g = X(
|
|
1456
|
+
() => s || new ne(),
|
|
1457
|
+
[s]
|
|
1458
|
+
), m = X(
|
|
1459
1459
|
() => ({
|
|
1460
|
-
...
|
|
1461
|
-
closeCommandPalette: () =>
|
|
1460
|
+
...o,
|
|
1461
|
+
closeCommandPalette: () => n(!1)
|
|
1462
1462
|
}),
|
|
1463
|
-
[
|
|
1463
|
+
[o]
|
|
1464
1464
|
);
|
|
1465
|
-
|
|
1466
|
-
let
|
|
1467
|
-
const S =
|
|
1468
|
-
if (
|
|
1469
|
-
const E =
|
|
1470
|
-
|
|
1465
|
+
W(() => {
|
|
1466
|
+
let y = !0;
|
|
1467
|
+
const S = g.subscribe(() => {
|
|
1468
|
+
if (y) {
|
|
1469
|
+
const E = g.getCommands(m);
|
|
1470
|
+
f(E);
|
|
1471
1471
|
}
|
|
1472
1472
|
});
|
|
1473
1473
|
if (e.length > 0)
|
|
1474
|
-
|
|
1474
|
+
g.registerCommands(e);
|
|
1475
1475
|
else {
|
|
1476
|
-
const E =
|
|
1477
|
-
|
|
1476
|
+
const E = g.getCommands(m);
|
|
1477
|
+
f(E);
|
|
1478
1478
|
}
|
|
1479
1479
|
return () => {
|
|
1480
|
-
|
|
1480
|
+
y = !1, S();
|
|
1481
1481
|
};
|
|
1482
|
-
}, [
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
}, [
|
|
1487
|
-
const k =
|
|
1488
|
-
var
|
|
1489
|
-
|
|
1482
|
+
}, [g]);
|
|
1483
|
+
const c = X(() => (r.fuzzySearch === !1, g.searchCommands(i, m)), [i, g, m, r.fuzzySearch]);
|
|
1484
|
+
W(() => {
|
|
1485
|
+
h(0);
|
|
1486
|
+
}, [c]);
|
|
1487
|
+
const k = x(() => {
|
|
1488
|
+
var y;
|
|
1489
|
+
n(!0), p(""), h(0), (y = o.events) == null || y.emit({
|
|
1490
1490
|
type: "command-palette:opened",
|
|
1491
1491
|
source: "command-palette",
|
|
1492
1492
|
timestamp: Date.now(),
|
|
1493
1493
|
payload: {}
|
|
1494
1494
|
});
|
|
1495
|
-
}, [
|
|
1496
|
-
var
|
|
1497
|
-
|
|
1495
|
+
}, [o.events]), R = x(() => {
|
|
1496
|
+
var y;
|
|
1497
|
+
n(!1), p(""), h(0), (y = o.events) == null || y.emit({
|
|
1498
1498
|
type: "command-palette:closed",
|
|
1499
1499
|
source: "command-palette",
|
|
1500
1500
|
timestamp: Date.now(),
|
|
1501
1501
|
payload: {}
|
|
1502
1502
|
});
|
|
1503
|
-
}, [
|
|
1504
|
-
|
|
1505
|
-
}, [
|
|
1506
|
-
async (
|
|
1507
|
-
await
|
|
1503
|
+
}, [o.events]), A = x(() => {
|
|
1504
|
+
a ? R() : k();
|
|
1505
|
+
}, [a, k, R]), I = x(
|
|
1506
|
+
async (y) => {
|
|
1507
|
+
await g.executeCommand(y, m), R();
|
|
1508
1508
|
},
|
|
1509
|
-
[
|
|
1510
|
-
),
|
|
1511
|
-
|
|
1512
|
-
const S = r.maxResults ||
|
|
1513
|
-
return
|
|
1509
|
+
[g, m, R]
|
|
1510
|
+
), $ = x(() => {
|
|
1511
|
+
h((y) => {
|
|
1512
|
+
const S = r.maxResults || c.length, E = Math.min(c.length, S) - 1;
|
|
1513
|
+
return y < E ? y + 1 : 0;
|
|
1514
1514
|
});
|
|
1515
|
-
}, [
|
|
1516
|
-
|
|
1517
|
-
const S = r.maxResults ||
|
|
1518
|
-
return
|
|
1515
|
+
}, [c.length, r.maxResults]), D = x(() => {
|
|
1516
|
+
h((y) => {
|
|
1517
|
+
const S = r.maxResults || c.length, E = Math.min(c.length, S) - 1;
|
|
1518
|
+
return y > 0 ? y - 1 : E;
|
|
1519
1519
|
});
|
|
1520
|
-
}, [
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
}, [
|
|
1524
|
-
(
|
|
1525
|
-
|
|
1520
|
+
}, [c.length, r.maxResults]), w = x(async () => {
|
|
1521
|
+
const y = c[0];
|
|
1522
|
+
y && await I(y.id);
|
|
1523
|
+
}, [c, I]), P = x(
|
|
1524
|
+
(y) => {
|
|
1525
|
+
g.registerCommands(y);
|
|
1526
1526
|
},
|
|
1527
|
-
[
|
|
1528
|
-
), v =
|
|
1529
|
-
(
|
|
1530
|
-
|
|
1527
|
+
[g]
|
|
1528
|
+
), v = x(
|
|
1529
|
+
(y) => {
|
|
1530
|
+
g.unregisterCommands(y);
|
|
1531
1531
|
},
|
|
1532
|
-
[
|
|
1533
|
-
),
|
|
1534
|
-
(
|
|
1532
|
+
[g]
|
|
1533
|
+
), C = x(
|
|
1534
|
+
(y) => {
|
|
1535
1535
|
const {
|
|
1536
1536
|
key: S = " ",
|
|
1537
1537
|
altKey: E = !0,
|
|
1538
|
-
ctrlKey:
|
|
1539
|
-
metaKey:
|
|
1540
|
-
shiftKey:
|
|
1541
|
-
} =
|
|
1542
|
-
if ((S === " " ?
|
|
1543
|
-
const
|
|
1544
|
-
if (
|
|
1538
|
+
ctrlKey: O = !1,
|
|
1539
|
+
metaKey: V = !1,
|
|
1540
|
+
shiftKey: Q = !1
|
|
1541
|
+
} = t, Z = y.altKey === E && y.ctrlKey === O && y.metaKey === V && y.shiftKey === Q;
|
|
1542
|
+
if ((S === " " ? y.code === "Space" : y.key === S) && Z) {
|
|
1543
|
+
const G = y.target;
|
|
1544
|
+
if (G.tagName === "INPUT" || G.tagName === "TEXTAREA" || G.isContentEditable)
|
|
1545
1545
|
return;
|
|
1546
|
-
|
|
1546
|
+
y.preventDefault(), A();
|
|
1547
1547
|
}
|
|
1548
1548
|
},
|
|
1549
|
-
[
|
|
1549
|
+
[t, A]
|
|
1550
1550
|
);
|
|
1551
|
-
return
|
|
1552
|
-
isOpen:
|
|
1551
|
+
return W(() => (window.addEventListener("keydown", C), () => window.removeEventListener("keydown", C)), [C]), {
|
|
1552
|
+
isOpen: a,
|
|
1553
1553
|
open: k,
|
|
1554
|
-
close:
|
|
1555
|
-
toggle:
|
|
1556
|
-
query:
|
|
1557
|
-
setQuery:
|
|
1558
|
-
filteredCommands:
|
|
1559
|
-
executeCommand:
|
|
1560
|
-
selectedIndex:
|
|
1561
|
-
setSelectedIndex:
|
|
1562
|
-
selectNext:
|
|
1563
|
-
selectPrevious:
|
|
1564
|
-
executeSelected:
|
|
1565
|
-
commands:
|
|
1566
|
-
registerCommands:
|
|
1554
|
+
close: R,
|
|
1555
|
+
toggle: A,
|
|
1556
|
+
query: i,
|
|
1557
|
+
setQuery: p,
|
|
1558
|
+
filteredCommands: c,
|
|
1559
|
+
executeCommand: I,
|
|
1560
|
+
selectedIndex: u,
|
|
1561
|
+
setSelectedIndex: h,
|
|
1562
|
+
selectNext: $,
|
|
1563
|
+
selectPrevious: D,
|
|
1564
|
+
executeSelected: w,
|
|
1565
|
+
commands: d,
|
|
1566
|
+
registerCommands: P,
|
|
1567
1567
|
unregisterCommands: v
|
|
1568
1568
|
};
|
|
1569
1569
|
}
|
|
1570
|
-
const
|
|
1570
|
+
const Re = [
|
|
1571
1571
|
{
|
|
1572
1572
|
id: "panel.focus.left",
|
|
1573
1573
|
label: "Focus Left Panel",
|
|
@@ -1577,10 +1577,10 @@ const se = [
|
|
|
1577
1577
|
shortcut: "Alt+1",
|
|
1578
1578
|
priority: 100,
|
|
1579
1579
|
keywords: ["left", "sidebar", "focus", "switch"],
|
|
1580
|
-
execute: (
|
|
1581
|
-
|
|
1580
|
+
execute: (o) => {
|
|
1581
|
+
o.setFocus("left");
|
|
1582
1582
|
},
|
|
1583
|
-
isAvailable: (
|
|
1583
|
+
isAvailable: (o) => o.focusedPanel !== "left"
|
|
1584
1584
|
},
|
|
1585
1585
|
{
|
|
1586
1586
|
id: "panel.focus.middle",
|
|
@@ -1591,10 +1591,10 @@ const se = [
|
|
|
1591
1591
|
shortcut: "Alt+2",
|
|
1592
1592
|
priority: 100,
|
|
1593
1593
|
keywords: ["middle", "center", "main", "focus", "switch"],
|
|
1594
|
-
execute: (
|
|
1595
|
-
|
|
1594
|
+
execute: (o) => {
|
|
1595
|
+
o.setFocus("middle");
|
|
1596
1596
|
},
|
|
1597
|
-
isAvailable: (
|
|
1597
|
+
isAvailable: (o) => o.focusedPanel !== "middle"
|
|
1598
1598
|
},
|
|
1599
1599
|
{
|
|
1600
1600
|
id: "panel.focus.right",
|
|
@@ -1605,10 +1605,10 @@ const se = [
|
|
|
1605
1605
|
shortcut: "Alt+3",
|
|
1606
1606
|
priority: 100,
|
|
1607
1607
|
keywords: ["right", "sidebar", "focus", "switch"],
|
|
1608
|
-
execute: (
|
|
1609
|
-
|
|
1608
|
+
execute: (o) => {
|
|
1609
|
+
o.setFocus("right");
|
|
1610
1610
|
},
|
|
1611
|
-
isAvailable: (
|
|
1611
|
+
isAvailable: (o) => o.focusedPanel !== "right"
|
|
1612
1612
|
},
|
|
1613
1613
|
{
|
|
1614
1614
|
id: "panel.toggle.left",
|
|
@@ -1618,9 +1618,9 @@ const se = [
|
|
|
1618
1618
|
category: "Panel Control",
|
|
1619
1619
|
keywords: ["toggle", "left", "collapse", "expand", "hide", "show"],
|
|
1620
1620
|
priority: 80,
|
|
1621
|
-
execute: (
|
|
1621
|
+
execute: (o) => {
|
|
1622
1622
|
var e;
|
|
1623
|
-
(e =
|
|
1623
|
+
(e = o.events) == null || e.emit({
|
|
1624
1624
|
type: "panel:toggle",
|
|
1625
1625
|
source: "command-palette",
|
|
1626
1626
|
timestamp: Date.now(),
|
|
@@ -1636,9 +1636,9 @@ const se = [
|
|
|
1636
1636
|
category: "Panel Control",
|
|
1637
1637
|
keywords: ["toggle", "right", "collapse", "expand", "hide", "show"],
|
|
1638
1638
|
priority: 80,
|
|
1639
|
-
execute: (
|
|
1639
|
+
execute: (o) => {
|
|
1640
1640
|
var e;
|
|
1641
|
-
(e =
|
|
1641
|
+
(e = o.events) == null || e.emit({
|
|
1642
1642
|
type: "panel:toggle",
|
|
1643
1643
|
source: "command-palette",
|
|
1644
1644
|
timestamp: Date.now(),
|
|
@@ -1654,9 +1654,9 @@ const se = [
|
|
|
1654
1654
|
category: "Panel Control",
|
|
1655
1655
|
keywords: ["collapse", "hide", "all", "maximize", "focus mode"],
|
|
1656
1656
|
priority: 70,
|
|
1657
|
-
execute: (
|
|
1657
|
+
execute: (o) => {
|
|
1658
1658
|
var e;
|
|
1659
|
-
(e =
|
|
1659
|
+
(e = o.events) == null || e.emit({
|
|
1660
1660
|
type: "panel:collapse-all",
|
|
1661
1661
|
source: "command-palette",
|
|
1662
1662
|
timestamp: Date.now(),
|
|
@@ -1672,9 +1672,9 @@ const se = [
|
|
|
1672
1672
|
category: "Panel Control",
|
|
1673
1673
|
keywords: ["expand", "show", "all", "restore", "default"],
|
|
1674
1674
|
priority: 70,
|
|
1675
|
-
execute: (
|
|
1675
|
+
execute: (o) => {
|
|
1676
1676
|
var e;
|
|
1677
|
-
(e =
|
|
1677
|
+
(e = o.events) == null || e.emit({
|
|
1678
1678
|
type: "panel:expand-all",
|
|
1679
1679
|
source: "command-palette",
|
|
1680
1680
|
timestamp: Date.now(),
|
|
@@ -1690,17 +1690,17 @@ const se = [
|
|
|
1690
1690
|
category: "Panel Control",
|
|
1691
1691
|
keywords: ["refresh", "reload", "update", "sync"],
|
|
1692
1692
|
priority: 60,
|
|
1693
|
-
execute: (
|
|
1694
|
-
var
|
|
1695
|
-
const e =
|
|
1696
|
-
e && ((
|
|
1693
|
+
execute: (o) => {
|
|
1694
|
+
var t;
|
|
1695
|
+
const e = o.focusedPanel;
|
|
1696
|
+
e && ((t = o.events) == null || t.emit({
|
|
1697
1697
|
type: "panel:refresh",
|
|
1698
1698
|
source: "command-palette",
|
|
1699
1699
|
timestamp: Date.now(),
|
|
1700
1700
|
payload: { panelId: e }
|
|
1701
1701
|
}));
|
|
1702
1702
|
},
|
|
1703
|
-
isAvailable: (
|
|
1703
|
+
isAvailable: (o) => o.focusedPanel !== null
|
|
1704
1704
|
},
|
|
1705
1705
|
{
|
|
1706
1706
|
id: "panel.reset.layout",
|
|
@@ -1710,9 +1710,9 @@ const se = [
|
|
|
1710
1710
|
category: "Panel Control",
|
|
1711
1711
|
keywords: ["reset", "layout", "default", "restore"],
|
|
1712
1712
|
priority: 50,
|
|
1713
|
-
execute: (
|
|
1713
|
+
execute: (o) => {
|
|
1714
1714
|
var e;
|
|
1715
|
-
(e =
|
|
1715
|
+
(e = o.events) == null || e.emit({
|
|
1716
1716
|
type: "panel:reset-layout",
|
|
1717
1717
|
source: "command-palette",
|
|
1718
1718
|
timestamp: Date.now(),
|
|
@@ -1721,10 +1721,892 @@ const se = [
|
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
1723
|
];
|
|
1724
|
-
function
|
|
1725
|
-
return
|
|
1724
|
+
function pt() {
|
|
1725
|
+
return Re;
|
|
1726
1726
|
}
|
|
1727
|
-
const
|
|
1727
|
+
const ie = ({
|
|
1728
|
+
value: o,
|
|
1729
|
+
onChange: e,
|
|
1730
|
+
onSubmit: t,
|
|
1731
|
+
onClose: r,
|
|
1732
|
+
onHistoryPrevious: s,
|
|
1733
|
+
onHistoryNext: a,
|
|
1734
|
+
mode: n,
|
|
1735
|
+
status: i,
|
|
1736
|
+
placeholder: p = "What would you like to do?",
|
|
1737
|
+
disabled: u = !1,
|
|
1738
|
+
autoFocus: h = !0
|
|
1739
|
+
}) => {
|
|
1740
|
+
const { theme: d } = q(), f = z(null);
|
|
1741
|
+
W(() => {
|
|
1742
|
+
h && f.current && f.current.focus();
|
|
1743
|
+
}, [h]);
|
|
1744
|
+
const g = (c) => {
|
|
1745
|
+
switch (c.key) {
|
|
1746
|
+
case "Enter":
|
|
1747
|
+
c.preventDefault(), t();
|
|
1748
|
+
break;
|
|
1749
|
+
case "Escape":
|
|
1750
|
+
c.preventDefault(), r();
|
|
1751
|
+
break;
|
|
1752
|
+
case "ArrowUp":
|
|
1753
|
+
c.preventDefault(), s();
|
|
1754
|
+
break;
|
|
1755
|
+
case "ArrowDown":
|
|
1756
|
+
c.preventDefault(), a();
|
|
1757
|
+
break;
|
|
1758
|
+
}
|
|
1759
|
+
}, m = i === "thinking" || i === "executing";
|
|
1760
|
+
return /* @__PURE__ */ b(
|
|
1761
|
+
"div",
|
|
1762
|
+
{
|
|
1763
|
+
style: {
|
|
1764
|
+
display: "flex",
|
|
1765
|
+
alignItems: "center",
|
|
1766
|
+
gap: "8px",
|
|
1767
|
+
padding: "12px 16px",
|
|
1768
|
+
backgroundColor: d.colors.background,
|
|
1769
|
+
borderBottom: `1px solid ${d.colors.border}`
|
|
1770
|
+
},
|
|
1771
|
+
children: [
|
|
1772
|
+
/* @__PURE__ */ l(
|
|
1773
|
+
"span",
|
|
1774
|
+
{
|
|
1775
|
+
style: {
|
|
1776
|
+
color: n === "quick-command" ? d.colors.info : d.colors.textMuted,
|
|
1777
|
+
fontFamily: d.fonts.monospace,
|
|
1778
|
+
fontSize: "14px",
|
|
1779
|
+
userSelect: "none"
|
|
1780
|
+
},
|
|
1781
|
+
children: n === "quick-command" ? "/" : ">"
|
|
1782
|
+
}
|
|
1783
|
+
),
|
|
1784
|
+
/* @__PURE__ */ l(
|
|
1785
|
+
"input",
|
|
1786
|
+
{
|
|
1787
|
+
ref: f,
|
|
1788
|
+
"data-agent-command-palette-input": !0,
|
|
1789
|
+
type: "text",
|
|
1790
|
+
value: o,
|
|
1791
|
+
onChange: (c) => e(c.target.value),
|
|
1792
|
+
onKeyDown: g,
|
|
1793
|
+
placeholder: p,
|
|
1794
|
+
disabled: u || m,
|
|
1795
|
+
style: {
|
|
1796
|
+
flex: 1,
|
|
1797
|
+
backgroundColor: "transparent",
|
|
1798
|
+
border: "none",
|
|
1799
|
+
outline: "none",
|
|
1800
|
+
color: d.colors.text,
|
|
1801
|
+
fontFamily: d.fonts.monospace,
|
|
1802
|
+
fontSize: "14px",
|
|
1803
|
+
caretColor: d.colors.primary
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
),
|
|
1807
|
+
m && /* @__PURE__ */ b(
|
|
1808
|
+
"span",
|
|
1809
|
+
{
|
|
1810
|
+
style: {
|
|
1811
|
+
color: d.colors.info,
|
|
1812
|
+
fontSize: "12px",
|
|
1813
|
+
display: "flex",
|
|
1814
|
+
alignItems: "center",
|
|
1815
|
+
gap: "4px"
|
|
1816
|
+
},
|
|
1817
|
+
children: [
|
|
1818
|
+
/* @__PURE__ */ l(
|
|
1819
|
+
"span",
|
|
1820
|
+
{
|
|
1821
|
+
style: {
|
|
1822
|
+
display: "inline-block",
|
|
1823
|
+
width: "8px",
|
|
1824
|
+
height: "8px",
|
|
1825
|
+
borderRadius: "50%",
|
|
1826
|
+
backgroundColor: d.colors.info,
|
|
1827
|
+
animation: "pulse 1s ease-in-out infinite"
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
),
|
|
1831
|
+
i === "thinking" ? "Thinking..." : "Executing..."
|
|
1832
|
+
]
|
|
1833
|
+
}
|
|
1834
|
+
),
|
|
1835
|
+
!m && /* @__PURE__ */ l(
|
|
1836
|
+
"kbd",
|
|
1837
|
+
{
|
|
1838
|
+
style: {
|
|
1839
|
+
padding: "2px 6px",
|
|
1840
|
+
backgroundColor: d.colors.backgroundSecondary,
|
|
1841
|
+
borderRadius: "3px",
|
|
1842
|
+
border: `1px solid ${d.colors.border}`,
|
|
1843
|
+
fontSize: "11px",
|
|
1844
|
+
color: d.colors.textMuted
|
|
1845
|
+
},
|
|
1846
|
+
children: "Alt+P"
|
|
1847
|
+
}
|
|
1848
|
+
)
|
|
1849
|
+
]
|
|
1850
|
+
}
|
|
1851
|
+
);
|
|
1852
|
+
};
|
|
1853
|
+
ie.displayName = "AgentCommandInput";
|
|
1854
|
+
const Le = ({ status: o }) => {
|
|
1855
|
+
const { theme: e } = q(), t = {
|
|
1856
|
+
display: "inline-flex",
|
|
1857
|
+
alignItems: "center",
|
|
1858
|
+
justifyContent: "center",
|
|
1859
|
+
width: "16px",
|
|
1860
|
+
height: "16px",
|
|
1861
|
+
fontSize: "12px"
|
|
1862
|
+
};
|
|
1863
|
+
switch (o) {
|
|
1864
|
+
case "pending":
|
|
1865
|
+
return /* @__PURE__ */ l("span", { style: { ...t, color: e.colors.textMuted }, children: "○" });
|
|
1866
|
+
case "running":
|
|
1867
|
+
return /* @__PURE__ */ l(
|
|
1868
|
+
"span",
|
|
1869
|
+
{
|
|
1870
|
+
style: {
|
|
1871
|
+
...t,
|
|
1872
|
+
color: e.colors.info,
|
|
1873
|
+
animation: "spin 1s linear infinite"
|
|
1874
|
+
},
|
|
1875
|
+
children: "◐"
|
|
1876
|
+
}
|
|
1877
|
+
);
|
|
1878
|
+
case "success":
|
|
1879
|
+
return /* @__PURE__ */ l("span", { style: { ...t, color: e.colors.success }, children: "✓" });
|
|
1880
|
+
case "error":
|
|
1881
|
+
return /* @__PURE__ */ l("span", { style: { ...t, color: e.colors.error }, children: "✗" });
|
|
1882
|
+
}
|
|
1883
|
+
}, Ae = (o) => {
|
|
1884
|
+
const e = Object.entries(o);
|
|
1885
|
+
return e.length === 0 ? "" : e.map(([t, r]) => t === "args" && Array.isArray(r) ? r.join(", ") : typeof r == "string" ? `"${r}"` : JSON.stringify(r)).join(", ");
|
|
1886
|
+
}, We = ({ tool: o, compact: e }) => {
|
|
1887
|
+
const { theme: t } = q(), r = Ae(o.args);
|
|
1888
|
+
return /* @__PURE__ */ b(
|
|
1889
|
+
"div",
|
|
1890
|
+
{
|
|
1891
|
+
style: {
|
|
1892
|
+
display: "flex",
|
|
1893
|
+
alignItems: "center",
|
|
1894
|
+
gap: "8px",
|
|
1895
|
+
padding: e ? "4px 0" : "8px 0",
|
|
1896
|
+
fontFamily: t.fonts.monospace,
|
|
1897
|
+
fontSize: "13px"
|
|
1898
|
+
},
|
|
1899
|
+
children: [
|
|
1900
|
+
/* @__PURE__ */ l(Le, { status: o.status }),
|
|
1901
|
+
/* @__PURE__ */ b("span", { style: { color: t.colors.text }, children: [
|
|
1902
|
+
o.name,
|
|
1903
|
+
r && /* @__PURE__ */ b("span", { style: { color: t.colors.textMuted }, children: [
|
|
1904
|
+
"(",
|
|
1905
|
+
r,
|
|
1906
|
+
")"
|
|
1907
|
+
] })
|
|
1908
|
+
] }),
|
|
1909
|
+
o.status === "running" && /* @__PURE__ */ l(
|
|
1910
|
+
"span",
|
|
1911
|
+
{
|
|
1912
|
+
style: {
|
|
1913
|
+
marginLeft: "auto",
|
|
1914
|
+
color: t.colors.info,
|
|
1915
|
+
fontSize: "11px"
|
|
1916
|
+
},
|
|
1917
|
+
children: "[running]"
|
|
1918
|
+
}
|
|
1919
|
+
),
|
|
1920
|
+
o.status === "success" && /* @__PURE__ */ l(
|
|
1921
|
+
"span",
|
|
1922
|
+
{
|
|
1923
|
+
style: {
|
|
1924
|
+
marginLeft: "auto",
|
|
1925
|
+
color: t.colors.success,
|
|
1926
|
+
fontSize: "11px"
|
|
1927
|
+
},
|
|
1928
|
+
children: "[done]"
|
|
1929
|
+
}
|
|
1930
|
+
),
|
|
1931
|
+
o.status === "error" && /* @__PURE__ */ l(
|
|
1932
|
+
"span",
|
|
1933
|
+
{
|
|
1934
|
+
style: {
|
|
1935
|
+
marginLeft: "auto",
|
|
1936
|
+
color: t.colors.error,
|
|
1937
|
+
fontSize: "11px"
|
|
1938
|
+
},
|
|
1939
|
+
title: o.error,
|
|
1940
|
+
children: "[error]"
|
|
1941
|
+
}
|
|
1942
|
+
)
|
|
1943
|
+
]
|
|
1944
|
+
}
|
|
1945
|
+
);
|
|
1946
|
+
}, le = ({
|
|
1947
|
+
tools: o,
|
|
1948
|
+
compact: e = !1
|
|
1949
|
+
}) => {
|
|
1950
|
+
const { theme: t } = q();
|
|
1951
|
+
return o.length === 0 ? null : /* @__PURE__ */ l(
|
|
1952
|
+
"div",
|
|
1953
|
+
{
|
|
1954
|
+
style: {
|
|
1955
|
+
padding: e ? "8px 16px" : "12px 16px",
|
|
1956
|
+
backgroundColor: t.colors.backgroundSecondary,
|
|
1957
|
+
borderRadius: "4px",
|
|
1958
|
+
margin: "8px 16px"
|
|
1959
|
+
},
|
|
1960
|
+
children: o.map((r) => /* @__PURE__ */ l(We, { tool: r, compact: e }, r.id))
|
|
1961
|
+
}
|
|
1962
|
+
);
|
|
1963
|
+
};
|
|
1964
|
+
le.displayName = "ToolExecutionList";
|
|
1965
|
+
const ce = ({
|
|
1966
|
+
response: o,
|
|
1967
|
+
streaming: e = !1
|
|
1968
|
+
}) => {
|
|
1969
|
+
const { theme: t } = q();
|
|
1970
|
+
if (!o)
|
|
1971
|
+
return null;
|
|
1972
|
+
const r = o.toLowerCase().startsWith("error"), s = o.toLowerCase().startsWith("done") || o.toLowerCase().startsWith("executed");
|
|
1973
|
+
return /* @__PURE__ */ b(
|
|
1974
|
+
"div",
|
|
1975
|
+
{
|
|
1976
|
+
style: {
|
|
1977
|
+
padding: "12px 16px",
|
|
1978
|
+
color: r ? t.colors.error : s ? t.colors.success : t.colors.text,
|
|
1979
|
+
fontSize: "13px",
|
|
1980
|
+
display: "flex",
|
|
1981
|
+
alignItems: "center",
|
|
1982
|
+
gap: "8px"
|
|
1983
|
+
},
|
|
1984
|
+
children: [
|
|
1985
|
+
s && /* @__PURE__ */ l("span", { children: "✓" }),
|
|
1986
|
+
r && /* @__PURE__ */ l("span", { children: "✗" }),
|
|
1987
|
+
/* @__PURE__ */ b("span", { children: [
|
|
1988
|
+
o,
|
|
1989
|
+
e && /* @__PURE__ */ l(
|
|
1990
|
+
"span",
|
|
1991
|
+
{
|
|
1992
|
+
style: {
|
|
1993
|
+
display: "inline-block",
|
|
1994
|
+
width: "2px",
|
|
1995
|
+
height: "14px",
|
|
1996
|
+
backgroundColor: t.colors.primary,
|
|
1997
|
+
marginLeft: "2px",
|
|
1998
|
+
animation: "blink 1s step-end infinite"
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
)
|
|
2002
|
+
] })
|
|
2003
|
+
]
|
|
2004
|
+
}
|
|
2005
|
+
);
|
|
2006
|
+
};
|
|
2007
|
+
ce.displayName = "AgentResponseDisplay";
|
|
2008
|
+
const De = ({
|
|
2009
|
+
palette: o,
|
|
2010
|
+
config: e
|
|
2011
|
+
}) => {
|
|
2012
|
+
const { theme: t } = q(), r = z(null), {
|
|
2013
|
+
isOpen: s,
|
|
2014
|
+
close: a,
|
|
2015
|
+
query: n,
|
|
2016
|
+
setQuery: i,
|
|
2017
|
+
mode: p,
|
|
2018
|
+
status: u,
|
|
2019
|
+
pendingTools: h,
|
|
2020
|
+
completedTools: d,
|
|
2021
|
+
agentResponse: f,
|
|
2022
|
+
submit: g,
|
|
2023
|
+
historyPrevious: m,
|
|
2024
|
+
historyNext: c,
|
|
2025
|
+
suggestions: k
|
|
2026
|
+
} = o;
|
|
2027
|
+
W(() => {
|
|
2028
|
+
if (!s) return;
|
|
2029
|
+
const S = (O) => {
|
|
2030
|
+
r.current && !r.current.contains(O.target) && a();
|
|
2031
|
+
}, E = setTimeout(() => {
|
|
2032
|
+
document.addEventListener("mousedown", S);
|
|
2033
|
+
}, 100);
|
|
2034
|
+
return () => {
|
|
2035
|
+
clearTimeout(E), document.removeEventListener("mousedown", S);
|
|
2036
|
+
};
|
|
2037
|
+
}, [s, a]);
|
|
2038
|
+
const [R, A] = L(!1), [I, $] = L(!1);
|
|
2039
|
+
if (W(() => {
|
|
2040
|
+
if (s)
|
|
2041
|
+
$(!0), requestAnimationFrame(() => {
|
|
2042
|
+
requestAnimationFrame(() => {
|
|
2043
|
+
A(!0);
|
|
2044
|
+
});
|
|
2045
|
+
});
|
|
2046
|
+
else {
|
|
2047
|
+
A(!1);
|
|
2048
|
+
const S = setTimeout(() => {
|
|
2049
|
+
$(!1);
|
|
2050
|
+
}, 150);
|
|
2051
|
+
return () => clearTimeout(S);
|
|
2052
|
+
}
|
|
2053
|
+
}, [s]), !I)
|
|
2054
|
+
return null;
|
|
2055
|
+
const D = (e == null ? void 0 : e.placeholder) || "What would you like to do?", w = [...d, ...h], P = w.length > 0, v = f && u !== "idle", C = !n && u === "idle" && k.length > 0, y = p === "quick-command" && u === "idle";
|
|
2056
|
+
return /* @__PURE__ */ b(se, { children: [
|
|
2057
|
+
/* @__PURE__ */ l(
|
|
2058
|
+
"div",
|
|
2059
|
+
{
|
|
2060
|
+
style: {
|
|
2061
|
+
position: "fixed",
|
|
2062
|
+
inset: 0,
|
|
2063
|
+
zIndex: 999
|
|
2064
|
+
},
|
|
2065
|
+
onClick: a
|
|
2066
|
+
}
|
|
2067
|
+
),
|
|
2068
|
+
/* @__PURE__ */ b(
|
|
2069
|
+
"div",
|
|
2070
|
+
{
|
|
2071
|
+
ref: r,
|
|
2072
|
+
className: e == null ? void 0 : e.className,
|
|
2073
|
+
style: {
|
|
2074
|
+
position: "fixed",
|
|
2075
|
+
bottom: 0,
|
|
2076
|
+
left: 0,
|
|
2077
|
+
right: 0,
|
|
2078
|
+
maxHeight: "50vh",
|
|
2079
|
+
backgroundColor: t.colors.surface,
|
|
2080
|
+
borderTop: `1px solid ${t.colors.border}`,
|
|
2081
|
+
boxShadow: t.shadows[2],
|
|
2082
|
+
zIndex: 1e3,
|
|
2083
|
+
display: "flex",
|
|
2084
|
+
flexDirection: "column-reverse",
|
|
2085
|
+
overflow: "hidden",
|
|
2086
|
+
transform: R ? "translateY(0)" : "translateY(100%)",
|
|
2087
|
+
transition: "transform 150ms ease-out",
|
|
2088
|
+
...e == null ? void 0 : e.style
|
|
2089
|
+
},
|
|
2090
|
+
children: [
|
|
2091
|
+
/* @__PURE__ */ b("div", { children: [
|
|
2092
|
+
/* @__PURE__ */ l(
|
|
2093
|
+
ie,
|
|
2094
|
+
{
|
|
2095
|
+
value: n,
|
|
2096
|
+
onChange: i,
|
|
2097
|
+
onSubmit: g,
|
|
2098
|
+
onClose: a,
|
|
2099
|
+
onHistoryPrevious: m,
|
|
2100
|
+
onHistoryNext: c,
|
|
2101
|
+
mode: p,
|
|
2102
|
+
status: u,
|
|
2103
|
+
placeholder: D
|
|
2104
|
+
}
|
|
2105
|
+
),
|
|
2106
|
+
/* @__PURE__ */ b(
|
|
2107
|
+
"div",
|
|
2108
|
+
{
|
|
2109
|
+
style: {
|
|
2110
|
+
padding: "8px 16px",
|
|
2111
|
+
borderTop: `1px solid ${t.colors.border}`,
|
|
2112
|
+
display: "flex",
|
|
2113
|
+
gap: "16px",
|
|
2114
|
+
fontSize: "12px",
|
|
2115
|
+
color: t.colors.textMuted,
|
|
2116
|
+
backgroundColor: t.colors.background
|
|
2117
|
+
},
|
|
2118
|
+
children: [
|
|
2119
|
+
/* @__PURE__ */ b("span", { children: [
|
|
2120
|
+
/* @__PURE__ */ l(
|
|
2121
|
+
"kbd",
|
|
2122
|
+
{
|
|
2123
|
+
style: {
|
|
2124
|
+
padding: "2px 6px",
|
|
2125
|
+
backgroundColor: t.colors.backgroundSecondary,
|
|
2126
|
+
borderRadius: "3px",
|
|
2127
|
+
border: `1px solid ${t.colors.border}`
|
|
2128
|
+
},
|
|
2129
|
+
children: "Enter"
|
|
2130
|
+
}
|
|
2131
|
+
),
|
|
2132
|
+
" ",
|
|
2133
|
+
"Execute"
|
|
2134
|
+
] }),
|
|
2135
|
+
/* @__PURE__ */ b("span", { children: [
|
|
2136
|
+
/* @__PURE__ */ l(
|
|
2137
|
+
"kbd",
|
|
2138
|
+
{
|
|
2139
|
+
style: {
|
|
2140
|
+
padding: "2px 6px",
|
|
2141
|
+
backgroundColor: t.colors.backgroundSecondary,
|
|
2142
|
+
borderRadius: "3px",
|
|
2143
|
+
border: `1px solid ${t.colors.border}`
|
|
2144
|
+
},
|
|
2145
|
+
children: "Esc"
|
|
2146
|
+
}
|
|
2147
|
+
),
|
|
2148
|
+
" ",
|
|
2149
|
+
"Close"
|
|
2150
|
+
] }),
|
|
2151
|
+
/* @__PURE__ */ b("span", { children: [
|
|
2152
|
+
/* @__PURE__ */ l(
|
|
2153
|
+
"kbd",
|
|
2154
|
+
{
|
|
2155
|
+
style: {
|
|
2156
|
+
padding: "2px 6px",
|
|
2157
|
+
backgroundColor: t.colors.backgroundSecondary,
|
|
2158
|
+
borderRadius: "3px",
|
|
2159
|
+
border: `1px solid ${t.colors.border}`
|
|
2160
|
+
},
|
|
2161
|
+
children: "↑↓"
|
|
2162
|
+
}
|
|
2163
|
+
),
|
|
2164
|
+
" ",
|
|
2165
|
+
"History"
|
|
2166
|
+
] }),
|
|
2167
|
+
/* @__PURE__ */ b("span", { style: { marginLeft: "auto" }, children: [
|
|
2168
|
+
/* @__PURE__ */ l(
|
|
2169
|
+
"kbd",
|
|
2170
|
+
{
|
|
2171
|
+
style: {
|
|
2172
|
+
padding: "2px 6px",
|
|
2173
|
+
backgroundColor: t.colors.backgroundSecondary,
|
|
2174
|
+
borderRadius: "3px",
|
|
2175
|
+
border: `1px solid ${t.colors.border}`
|
|
2176
|
+
},
|
|
2177
|
+
children: "/"
|
|
2178
|
+
}
|
|
2179
|
+
),
|
|
2180
|
+
" ",
|
|
2181
|
+
"Quick command"
|
|
2182
|
+
] })
|
|
2183
|
+
]
|
|
2184
|
+
}
|
|
2185
|
+
)
|
|
2186
|
+
] }),
|
|
2187
|
+
/* @__PURE__ */ b("div", { style: { overflow: "auto" }, children: [
|
|
2188
|
+
P && /* @__PURE__ */ l(le, { tools: w, compact: w.length > 3 }),
|
|
2189
|
+
v && /* @__PURE__ */ l(
|
|
2190
|
+
ce,
|
|
2191
|
+
{
|
|
2192
|
+
response: f,
|
|
2193
|
+
streaming: u === "thinking"
|
|
2194
|
+
}
|
|
2195
|
+
),
|
|
2196
|
+
C && /* @__PURE__ */ b(
|
|
2197
|
+
"div",
|
|
2198
|
+
{
|
|
2199
|
+
style: {
|
|
2200
|
+
padding: "12px 16px",
|
|
2201
|
+
display: "flex",
|
|
2202
|
+
gap: "8px",
|
|
2203
|
+
flexWrap: "wrap"
|
|
2204
|
+
},
|
|
2205
|
+
children: [
|
|
2206
|
+
/* @__PURE__ */ l(
|
|
2207
|
+
"span",
|
|
2208
|
+
{
|
|
2209
|
+
style: {
|
|
2210
|
+
color: t.colors.textMuted,
|
|
2211
|
+
fontSize: "12px",
|
|
2212
|
+
marginRight: "4px"
|
|
2213
|
+
},
|
|
2214
|
+
children: "Try:"
|
|
2215
|
+
}
|
|
2216
|
+
),
|
|
2217
|
+
k.map((S, E) => /* @__PURE__ */ b(
|
|
2218
|
+
"button",
|
|
2219
|
+
{
|
|
2220
|
+
onClick: () => {
|
|
2221
|
+
i(S);
|
|
2222
|
+
},
|
|
2223
|
+
style: {
|
|
2224
|
+
padding: "4px 10px",
|
|
2225
|
+
backgroundColor: t.colors.backgroundSecondary,
|
|
2226
|
+
border: `1px solid ${t.colors.border}`,
|
|
2227
|
+
borderRadius: "12px",
|
|
2228
|
+
color: t.colors.textSecondary,
|
|
2229
|
+
fontSize: "12px",
|
|
2230
|
+
cursor: "pointer",
|
|
2231
|
+
transition: "background-color 150ms ease"
|
|
2232
|
+
},
|
|
2233
|
+
onMouseEnter: (O) => {
|
|
2234
|
+
O.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
|
|
2235
|
+
},
|
|
2236
|
+
onMouseLeave: (O) => {
|
|
2237
|
+
O.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
|
|
2238
|
+
},
|
|
2239
|
+
children: [
|
|
2240
|
+
'"',
|
|
2241
|
+
S,
|
|
2242
|
+
'"'
|
|
2243
|
+
]
|
|
2244
|
+
},
|
|
2245
|
+
E
|
|
2246
|
+
))
|
|
2247
|
+
]
|
|
2248
|
+
}
|
|
2249
|
+
),
|
|
2250
|
+
y && /* @__PURE__ */ b(
|
|
2251
|
+
"div",
|
|
2252
|
+
{
|
|
2253
|
+
style: {
|
|
2254
|
+
padding: "12px 16px",
|
|
2255
|
+
fontSize: "12px",
|
|
2256
|
+
color: t.colors.textMuted,
|
|
2257
|
+
fontFamily: t.fonts.monospace
|
|
2258
|
+
},
|
|
2259
|
+
children: [
|
|
2260
|
+
/* @__PURE__ */ l("div", { style: { marginBottom: "8px", color: t.colors.textSecondary }, children: "Quick commands:" }),
|
|
2261
|
+
/* @__PURE__ */ b("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2262
|
+
/* @__PURE__ */ b("div", { children: [
|
|
2263
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/toggle" }),
|
|
2264
|
+
" ",
|
|
2265
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.textMuted }, children: "<left|right>" }),
|
|
2266
|
+
" ",
|
|
2267
|
+
"- Toggle sidebar visibility"
|
|
2268
|
+
] }),
|
|
2269
|
+
/* @__PURE__ */ b("div", { children: [
|
|
2270
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/switch" }),
|
|
2271
|
+
" ",
|
|
2272
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.textMuted }, children: "<slot> <panel>" }),
|
|
2273
|
+
" ",
|
|
2274
|
+
"- Switch panel content"
|
|
2275
|
+
] }),
|
|
2276
|
+
/* @__PURE__ */ b("div", { children: [
|
|
2277
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/collapse" }),
|
|
2278
|
+
" ",
|
|
2279
|
+
"- Collapse all sidebars"
|
|
2280
|
+
] }),
|
|
2281
|
+
/* @__PURE__ */ b("div", { children: [
|
|
2282
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/expand" }),
|
|
2283
|
+
" ",
|
|
2284
|
+
"- Expand all sidebars"
|
|
2285
|
+
] })
|
|
2286
|
+
] })
|
|
2287
|
+
]
|
|
2288
|
+
}
|
|
2289
|
+
)
|
|
2290
|
+
] })
|
|
2291
|
+
]
|
|
2292
|
+
}
|
|
2293
|
+
),
|
|
2294
|
+
/* @__PURE__ */ l("style", { children: `
|
|
2295
|
+
@keyframes pulse {
|
|
2296
|
+
0%, 100% { opacity: 1; }
|
|
2297
|
+
50% { opacity: 0.5; }
|
|
2298
|
+
}
|
|
2299
|
+
@keyframes spin {
|
|
2300
|
+
from { transform: rotate(0deg); }
|
|
2301
|
+
to { transform: rotate(360deg); }
|
|
2302
|
+
}
|
|
2303
|
+
@keyframes blink {
|
|
2304
|
+
0%, 100% { opacity: 1; }
|
|
2305
|
+
50% { opacity: 0; }
|
|
2306
|
+
}
|
|
2307
|
+
` })
|
|
2308
|
+
] });
|
|
2309
|
+
};
|
|
2310
|
+
De.displayName = "AgentCommandPalette";
|
|
2311
|
+
const Ee = [
|
|
2312
|
+
"hide sidebars",
|
|
2313
|
+
"show terminal",
|
|
2314
|
+
"focus editor"
|
|
2315
|
+
];
|
|
2316
|
+
function ut({
|
|
2317
|
+
events: o,
|
|
2318
|
+
keyboard: e = { key: "p", altKey: !0 },
|
|
2319
|
+
config: t = {},
|
|
2320
|
+
onExecuteTool: r,
|
|
2321
|
+
initialSuggestions: s = Ee
|
|
2322
|
+
} = {}) {
|
|
2323
|
+
const [a, n] = L(!1), [i, p] = L(""), [u, h] = L("natural"), [d, f] = L("idle"), [g, m] = L([]), [c, k] = L([]), [R, A] = L(""), [I, $] = L([]), [D, w] = L(-1), P = X(() => s, [s]), v = x((T) => {
|
|
2324
|
+
p(T), h(T.startsWith("/") ? "quick-command" : "natural");
|
|
2325
|
+
}, []), C = x(() => {
|
|
2326
|
+
n(!0), p(""), h("natural"), f("idle"), m([]), k([]), A(""), w(-1), o == null || o.emit({
|
|
2327
|
+
type: "agent-command-palette:opened",
|
|
2328
|
+
source: "agent-command-palette",
|
|
2329
|
+
timestamp: Date.now(),
|
|
2330
|
+
payload: {}
|
|
2331
|
+
});
|
|
2332
|
+
}, [o]), y = x(() => {
|
|
2333
|
+
n(!1), o == null || o.emit({
|
|
2334
|
+
type: "agent-command-palette:closed",
|
|
2335
|
+
source: "agent-command-palette",
|
|
2336
|
+
timestamp: Date.now(),
|
|
2337
|
+
payload: {}
|
|
2338
|
+
});
|
|
2339
|
+
}, [o]), S = x(() => {
|
|
2340
|
+
a ? y() : C();
|
|
2341
|
+
}, [a, C, y]), E = x(() => {
|
|
2342
|
+
p(""), h("natural"), f("idle"), m([]), k([]), A(""), w(-1);
|
|
2343
|
+
}, []), O = x((T) => {
|
|
2344
|
+
const j = {
|
|
2345
|
+
...T,
|
|
2346
|
+
status: "pending"
|
|
2347
|
+
};
|
|
2348
|
+
return m((M) => [...M, j]), j;
|
|
2349
|
+
}, []), V = x(
|
|
2350
|
+
(T, j, M, J) => {
|
|
2351
|
+
m((N) => {
|
|
2352
|
+
const K = N.find((B) => B.id === T);
|
|
2353
|
+
if (!K) return N;
|
|
2354
|
+
const F = {
|
|
2355
|
+
...K,
|
|
2356
|
+
status: j,
|
|
2357
|
+
result: M,
|
|
2358
|
+
error: J
|
|
2359
|
+
};
|
|
2360
|
+
return j === "success" || j === "error" ? (k((B) => [...B, F]), N.filter((B) => B.id !== T)) : N.map((B) => B.id === T ? F : B);
|
|
2361
|
+
});
|
|
2362
|
+
},
|
|
2363
|
+
[]
|
|
2364
|
+
), Q = x(
|
|
2365
|
+
async (T) => {
|
|
2366
|
+
const j = T.replace(/^\//, "").trim().split(/\s+/), M = j[0], J = j.slice(1);
|
|
2367
|
+
if (!M) return;
|
|
2368
|
+
f("executing");
|
|
2369
|
+
const N = `quick-${Date.now()}`;
|
|
2370
|
+
O({
|
|
2371
|
+
id: N,
|
|
2372
|
+
name: M,
|
|
2373
|
+
args: { args: J }
|
|
2374
|
+
}), V(N, "running");
|
|
2375
|
+
try {
|
|
2376
|
+
if (r) {
|
|
2377
|
+
const F = await r(M, { args: J });
|
|
2378
|
+
V(N, "success", String(F));
|
|
2379
|
+
} else
|
|
2380
|
+
V(N, "success", "Tool executed (no handler)");
|
|
2381
|
+
$((F) => [
|
|
2382
|
+
{
|
|
2383
|
+
query: T,
|
|
2384
|
+
timestamp: Date.now(),
|
|
2385
|
+
toolsExecuted: [M],
|
|
2386
|
+
success: !0
|
|
2387
|
+
},
|
|
2388
|
+
...F.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2389
|
+
]), f("complete"), A(`Executed: ${M}`);
|
|
2390
|
+
const K = t.autoCloseDelay ?? 1e3;
|
|
2391
|
+
K > 0 && setTimeout(() => y(), K);
|
|
2392
|
+
} catch (K) {
|
|
2393
|
+
const F = K instanceof Error ? K.message : "Unknown error";
|
|
2394
|
+
V(N, "error", void 0, F), f("error"), A(`Error: ${F}`);
|
|
2395
|
+
}
|
|
2396
|
+
},
|
|
2397
|
+
[r, O, V, t.autoCloseDelay, t.maxHistoryEntries, y]
|
|
2398
|
+
), Z = x(() => {
|
|
2399
|
+
if (i.trim()) {
|
|
2400
|
+
if (u === "quick-command") {
|
|
2401
|
+
Q(i);
|
|
2402
|
+
return;
|
|
2403
|
+
}
|
|
2404
|
+
f("thinking"), o == null || o.emit({
|
|
2405
|
+
type: "agent-command-palette:submit",
|
|
2406
|
+
source: "agent-command-palette",
|
|
2407
|
+
timestamp: Date.now(),
|
|
2408
|
+
payload: { query: i, mode: u }
|
|
2409
|
+
}), $((T) => [
|
|
2410
|
+
{
|
|
2411
|
+
query: i,
|
|
2412
|
+
timestamp: Date.now(),
|
|
2413
|
+
toolsExecuted: [],
|
|
2414
|
+
success: !0
|
|
2415
|
+
},
|
|
2416
|
+
...T.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2417
|
+
]);
|
|
2418
|
+
}
|
|
2419
|
+
}, [i, u, Q, o, t.maxHistoryEntries]), te = x(() => {
|
|
2420
|
+
if (I.length === 0) return;
|
|
2421
|
+
const T = D < I.length - 1 ? D + 1 : D;
|
|
2422
|
+
w(T), I[T] && (p(I[T].query), h(I[T].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2423
|
+
}, [I, D]), G = x(() => {
|
|
2424
|
+
if (D <= 0) {
|
|
2425
|
+
w(-1), p(""), h("natural");
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
2428
|
+
const T = D - 1;
|
|
2429
|
+
w(T), I[T] && (p(I[T].query), h(I[T].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2430
|
+
}, [I, D]), ee = x(
|
|
2431
|
+
(T) => {
|
|
2432
|
+
const {
|
|
2433
|
+
key: j = "p",
|
|
2434
|
+
altKey: M = !0,
|
|
2435
|
+
ctrlKey: J = !1,
|
|
2436
|
+
metaKey: N = !1,
|
|
2437
|
+
shiftKey: K = !1
|
|
2438
|
+
} = e, F = T.altKey === M && T.ctrlKey === J && T.metaKey === N && T.shiftKey === K;
|
|
2439
|
+
if ((M ? T.code === `Key${j.toUpperCase()}` : T.key.toLowerCase() === j.toLowerCase()) && F) {
|
|
2440
|
+
const U = T.target;
|
|
2441
|
+
if (!U.closest("[data-agent-command-palette-input]") && (U.tagName === "INPUT" || U.tagName === "TEXTAREA" || U.isContentEditable))
|
|
2442
|
+
return;
|
|
2443
|
+
T.preventDefault(), S();
|
|
2444
|
+
}
|
|
2445
|
+
},
|
|
2446
|
+
[e, S]
|
|
2447
|
+
);
|
|
2448
|
+
return W(() => (window.addEventListener("keydown", ee), () => window.removeEventListener("keydown", ee)), [ee]), {
|
|
2449
|
+
// Visibility
|
|
2450
|
+
isOpen: a,
|
|
2451
|
+
open: C,
|
|
2452
|
+
close: y,
|
|
2453
|
+
toggle: S,
|
|
2454
|
+
// Input
|
|
2455
|
+
query: i,
|
|
2456
|
+
setQuery: v,
|
|
2457
|
+
mode: u,
|
|
2458
|
+
// Execution
|
|
2459
|
+
status: d,
|
|
2460
|
+
pendingTools: g,
|
|
2461
|
+
completedTools: c,
|
|
2462
|
+
agentResponse: R,
|
|
2463
|
+
submit: Z,
|
|
2464
|
+
executeQuickCommand: Q,
|
|
2465
|
+
// History
|
|
2466
|
+
history: I,
|
|
2467
|
+
historyPrevious: te,
|
|
2468
|
+
historyNext: G,
|
|
2469
|
+
// Suggestions
|
|
2470
|
+
suggestions: P,
|
|
2471
|
+
// Actions
|
|
2472
|
+
clear: E
|
|
2473
|
+
};
|
|
2474
|
+
}
|
|
2475
|
+
const de = {
|
|
2476
|
+
name: "get_visible_panels",
|
|
2477
|
+
description: "Get the current visibility state of all panel slots (left, middle, right). Returns which panels are active in each slot and whether side panels are collapsed.",
|
|
2478
|
+
inputs: {
|
|
2479
|
+
type: "object",
|
|
2480
|
+
properties: {},
|
|
2481
|
+
required: []
|
|
2482
|
+
},
|
|
2483
|
+
outputs: {
|
|
2484
|
+
type: "object",
|
|
2485
|
+
properties: {
|
|
2486
|
+
left: {
|
|
2487
|
+
type: "object",
|
|
2488
|
+
properties: {
|
|
2489
|
+
panelId: {
|
|
2490
|
+
type: "string",
|
|
2491
|
+
description: "The ID of the panel in the left slot"
|
|
2492
|
+
},
|
|
2493
|
+
collapsed: {
|
|
2494
|
+
type: "boolean",
|
|
2495
|
+
description: "Whether the left panel is collapsed"
|
|
2496
|
+
},
|
|
2497
|
+
size: {
|
|
2498
|
+
type: "number",
|
|
2499
|
+
description: "Width percentage of the left panel"
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
},
|
|
2503
|
+
middle: {
|
|
2504
|
+
type: "object",
|
|
2505
|
+
properties: {
|
|
2506
|
+
panelId: {
|
|
2507
|
+
type: "string",
|
|
2508
|
+
description: "The ID of the panel in the middle slot"
|
|
2509
|
+
},
|
|
2510
|
+
size: {
|
|
2511
|
+
type: "number",
|
|
2512
|
+
description: "Width percentage of the middle panel"
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
},
|
|
2516
|
+
right: {
|
|
2517
|
+
type: "object",
|
|
2518
|
+
properties: {
|
|
2519
|
+
panelId: {
|
|
2520
|
+
type: "string",
|
|
2521
|
+
description: "The ID of the panel in the right slot"
|
|
2522
|
+
},
|
|
2523
|
+
collapsed: {
|
|
2524
|
+
type: "boolean",
|
|
2525
|
+
description: "Whether the right panel is collapsed"
|
|
2526
|
+
},
|
|
2527
|
+
size: {
|
|
2528
|
+
type: "number",
|
|
2529
|
+
description: "Width percentage of the right panel"
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
},
|
|
2533
|
+
workspaceId: {
|
|
2534
|
+
type: "string",
|
|
2535
|
+
description: "The ID of the currently active workspace layout"
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
},
|
|
2539
|
+
tags: ["panel", "layout", "visibility", "state", "query"],
|
|
2540
|
+
tool_call_template: {
|
|
2541
|
+
call_template_type: "panel_event",
|
|
2542
|
+
event_type: "panel:get-visibility"
|
|
2543
|
+
}
|
|
2544
|
+
}, pe = {
|
|
2545
|
+
name: "get_panel_state",
|
|
2546
|
+
description: "Get the current state of a specific panel. Returns panel-specific state data if the panel supports state queries.",
|
|
2547
|
+
inputs: {
|
|
2548
|
+
type: "object",
|
|
2549
|
+
properties: {
|
|
2550
|
+
panelId: {
|
|
2551
|
+
type: "string",
|
|
2552
|
+
description: 'The ID of the panel to query state from (e.g., "file-tree", "terminal")'
|
|
2553
|
+
}
|
|
2554
|
+
},
|
|
2555
|
+
required: ["panelId"]
|
|
2556
|
+
},
|
|
2557
|
+
outputs: {
|
|
2558
|
+
type: "object",
|
|
2559
|
+
properties: {
|
|
2560
|
+
panelId: { type: "string", description: "The queried panel ID" },
|
|
2561
|
+
hasState: {
|
|
2562
|
+
type: "boolean",
|
|
2563
|
+
description: "Whether the panel supports state queries"
|
|
2564
|
+
},
|
|
2565
|
+
state: {
|
|
2566
|
+
type: "object",
|
|
2567
|
+
description: "The panel state (shape depends on the panel)"
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
},
|
|
2571
|
+
tags: ["panel", "state", "query"],
|
|
2572
|
+
tool_call_template: {
|
|
2573
|
+
call_template_type: "panel_event",
|
|
2574
|
+
event_type: "panel:get-state"
|
|
2575
|
+
}
|
|
2576
|
+
}, ue = {
|
|
2577
|
+
name: "list_panels_with_state",
|
|
2578
|
+
description: "Get a list of all panels that support state queries. Use this to discover which panels can be queried with get_panel_state.",
|
|
2579
|
+
inputs: {
|
|
2580
|
+
type: "object",
|
|
2581
|
+
properties: {},
|
|
2582
|
+
required: []
|
|
2583
|
+
},
|
|
2584
|
+
outputs: {
|
|
2585
|
+
type: "object",
|
|
2586
|
+
properties: {
|
|
2587
|
+
panels: {
|
|
2588
|
+
type: "array",
|
|
2589
|
+
items: {
|
|
2590
|
+
type: "object",
|
|
2591
|
+
properties: {
|
|
2592
|
+
panelId: { type: "string", description: "The panel ID" },
|
|
2593
|
+
name: { type: "string", description: "The panel display name" },
|
|
2594
|
+
description: {
|
|
2595
|
+
type: "string",
|
|
2596
|
+
description: "Description of the state this panel provides"
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
},
|
|
2600
|
+
description: "List of panels that support state queries"
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
},
|
|
2604
|
+
tags: ["panel", "state", "query", "discovery"],
|
|
2605
|
+
tool_call_template: {
|
|
2606
|
+
call_template_type: "panel_event",
|
|
2607
|
+
event_type: "panel:list-state-panels"
|
|
2608
|
+
}
|
|
2609
|
+
}, fe = {
|
|
1728
2610
|
name: "toggle_panel",
|
|
1729
2611
|
description: "Collapse or expand a side panel to give more space to the main content area.",
|
|
1730
2612
|
inputs: {
|
|
@@ -1751,7 +2633,7 @@ const ne = {
|
|
|
1751
2633
|
call_template_type: "panel_event",
|
|
1752
2634
|
event_type: "panel:toggle"
|
|
1753
2635
|
}
|
|
1754
|
-
},
|
|
2636
|
+
}, me = {
|
|
1755
2637
|
name: "collapse_all_panels",
|
|
1756
2638
|
description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
|
|
1757
2639
|
inputs: {
|
|
@@ -1771,7 +2653,7 @@ const ne = {
|
|
|
1771
2653
|
call_template_type: "panel_event",
|
|
1772
2654
|
event_type: "panel:collapse-all"
|
|
1773
2655
|
}
|
|
1774
|
-
},
|
|
2656
|
+
}, ye = {
|
|
1775
2657
|
name: "expand_all_panels",
|
|
1776
2658
|
description: "Expand both left and right panels to show all content. Restores the default layout.",
|
|
1777
2659
|
inputs: {
|
|
@@ -1791,7 +2673,7 @@ const ne = {
|
|
|
1791
2673
|
call_template_type: "panel_event",
|
|
1792
2674
|
event_type: "panel:expand-all"
|
|
1793
2675
|
}
|
|
1794
|
-
},
|
|
2676
|
+
}, he = {
|
|
1795
2677
|
name: "switch_panel",
|
|
1796
2678
|
description: "Change which content is displayed in a panel slot (left, middle, or right).",
|
|
1797
2679
|
inputs: {
|
|
@@ -1822,7 +2704,7 @@ const ne = {
|
|
|
1822
2704
|
call_template_type: "panel_event",
|
|
1823
2705
|
event_type: "panel:switch"
|
|
1824
2706
|
}
|
|
1825
|
-
},
|
|
2707
|
+
}, ge = {
|
|
1826
2708
|
name: "focus_panel",
|
|
1827
2709
|
description: "Set focus to a specific panel slot for keyboard navigation.",
|
|
1828
2710
|
inputs: {
|
|
@@ -1848,7 +2730,7 @@ const ne = {
|
|
|
1848
2730
|
call_template_type: "panel_event",
|
|
1849
2731
|
event_type: "panel:focus"
|
|
1850
2732
|
}
|
|
1851
|
-
},
|
|
2733
|
+
}, xe = {
|
|
1852
2734
|
name: "reset_layout",
|
|
1853
2735
|
description: "Reset panel sizes to the default layout configuration.",
|
|
1854
2736
|
inputs: {
|
|
@@ -1868,176 +2750,192 @@ const ne = {
|
|
|
1868
2750
|
call_template_type: "panel_event",
|
|
1869
2751
|
event_type: "panel:reset-layout"
|
|
1870
2752
|
}
|
|
1871
|
-
},
|
|
1872
|
-
|
|
1873
|
-
le,
|
|
1874
|
-
ie,
|
|
1875
|
-
ce,
|
|
2753
|
+
}, _e = [
|
|
2754
|
+
// State query tools
|
|
1876
2755
|
de,
|
|
1877
|
-
pe
|
|
1878
|
-
|
|
2756
|
+
pe,
|
|
2757
|
+
ue,
|
|
2758
|
+
// Layout action tools
|
|
2759
|
+
fe,
|
|
2760
|
+
me,
|
|
2761
|
+
ye,
|
|
2762
|
+
he,
|
|
2763
|
+
ge,
|
|
2764
|
+
xe
|
|
2765
|
+
], ft = [
|
|
2766
|
+
de,
|
|
2767
|
+
pe,
|
|
2768
|
+
ue
|
|
2769
|
+
], mt = [
|
|
2770
|
+
fe,
|
|
2771
|
+
me,
|
|
2772
|
+
ye,
|
|
2773
|
+
he,
|
|
2774
|
+
ge,
|
|
2775
|
+
xe
|
|
2776
|
+
], yt = {
|
|
1879
2777
|
id: "panel-layouts",
|
|
1880
2778
|
name: "Panel Layouts",
|
|
1881
|
-
description: "Generic panel layout operations",
|
|
1882
|
-
tools:
|
|
2779
|
+
description: "Generic panel layout and state query operations",
|
|
2780
|
+
tools: _e
|
|
1883
2781
|
};
|
|
1884
|
-
function
|
|
2782
|
+
function ze(o, e, t = {}) {
|
|
1885
2783
|
const {
|
|
1886
2784
|
categoryPrefix: r = "Panel Tools",
|
|
1887
|
-
basePriority:
|
|
1888
|
-
includePanelInCategory:
|
|
1889
|
-
} =
|
|
2785
|
+
basePriority: s = 50,
|
|
2786
|
+
includePanelInCategory: a = !0
|
|
2787
|
+
} = t, n = a ? `${r} > ${o.panelId}` : r, i = qe(o.inputs);
|
|
1890
2788
|
return {
|
|
1891
|
-
id: `tool.${
|
|
1892
|
-
label:
|
|
1893
|
-
description:
|
|
1894
|
-
category:
|
|
1895
|
-
keywords: [...
|
|
1896
|
-
priority:
|
|
1897
|
-
execute: async (
|
|
1898
|
-
var
|
|
1899
|
-
if (
|
|
2789
|
+
id: `tool.${o.qualifiedName}`,
|
|
2790
|
+
label: $e(o.name),
|
|
2791
|
+
description: o.description,
|
|
2792
|
+
category: n,
|
|
2793
|
+
keywords: [...o.tags, o.panelId, "tool"],
|
|
2794
|
+
priority: s,
|
|
2795
|
+
execute: async (p) => {
|
|
2796
|
+
var h;
|
|
2797
|
+
if (i) {
|
|
1900
2798
|
console.warn(
|
|
1901
|
-
`Tool "${
|
|
1902
|
-
), (
|
|
2799
|
+
`Tool "${o.qualifiedName}" requires parameters. Invoke programmatically with: registry.invokeTool('${o.qualifiedName}', { ... })`
|
|
2800
|
+
), (h = p.events) == null || h.emit({
|
|
1903
2801
|
type: "tool:requires-parameters",
|
|
1904
2802
|
source: "command-palette",
|
|
1905
2803
|
timestamp: Date.now(),
|
|
1906
2804
|
payload: {
|
|
1907
|
-
toolName:
|
|
1908
|
-
inputs:
|
|
2805
|
+
toolName: o.qualifiedName,
|
|
2806
|
+
inputs: o.inputs
|
|
1909
2807
|
}
|
|
1910
2808
|
});
|
|
1911
2809
|
return;
|
|
1912
2810
|
}
|
|
1913
|
-
const
|
|
1914
|
-
|
|
2811
|
+
const u = await e.invokeTool(
|
|
2812
|
+
o.qualifiedName,
|
|
1915
2813
|
{},
|
|
1916
2814
|
"command-palette"
|
|
1917
2815
|
);
|
|
1918
|
-
|
|
2816
|
+
u.success || console.error(`Tool invocation failed: ${u.error}`), p.closeCommandPalette();
|
|
1919
2817
|
}
|
|
1920
2818
|
};
|
|
1921
2819
|
}
|
|
1922
|
-
function
|
|
1923
|
-
return
|
|
2820
|
+
function be(o, e = {}) {
|
|
2821
|
+
return o.getAllTools().map((r) => ze(r, o, e));
|
|
1924
2822
|
}
|
|
1925
|
-
function
|
|
1926
|
-
return () =>
|
|
2823
|
+
function ht(o, e = {}) {
|
|
2824
|
+
return () => be(o, e);
|
|
1927
2825
|
}
|
|
1928
|
-
function
|
|
1929
|
-
return
|
|
2826
|
+
function $e(o) {
|
|
2827
|
+
return o.split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1930
2828
|
}
|
|
1931
|
-
function
|
|
1932
|
-
return !(
|
|
2829
|
+
function qe(o) {
|
|
2830
|
+
return !(o.type !== "object" || !o.required || o.required.length === 0);
|
|
1933
2831
|
}
|
|
1934
|
-
function
|
|
1935
|
-
return
|
|
2832
|
+
function gt(o, e = {}) {
|
|
2833
|
+
return be(o, e);
|
|
1936
2834
|
}
|
|
1937
|
-
function
|
|
1938
|
-
const { inputs: e } =
|
|
2835
|
+
function xt(o) {
|
|
2836
|
+
const { inputs: e } = o;
|
|
1939
2837
|
if (e.type !== "object" || !e.properties)
|
|
1940
2838
|
return [];
|
|
1941
|
-
const
|
|
1942
|
-
for (const [
|
|
2839
|
+
const t = new Set(e.required || []), r = [];
|
|
2840
|
+
for (const [s, a] of Object.entries(e.properties))
|
|
1943
2841
|
r.push({
|
|
1944
|
-
name:
|
|
1945
|
-
type:
|
|
1946
|
-
description:
|
|
1947
|
-
required:
|
|
1948
|
-
default:
|
|
1949
|
-
enum:
|
|
2842
|
+
name: s,
|
|
2843
|
+
type: a.type || "unknown",
|
|
2844
|
+
description: a.description || "",
|
|
2845
|
+
required: t.has(s),
|
|
2846
|
+
default: a.default,
|
|
2847
|
+
enum: a.enum
|
|
1950
2848
|
});
|
|
1951
2849
|
return r;
|
|
1952
2850
|
}
|
|
1953
|
-
function
|
|
2851
|
+
function je(o) {
|
|
1954
2852
|
const e = {};
|
|
1955
|
-
if (
|
|
1956
|
-
for (const [
|
|
1957
|
-
const
|
|
1958
|
-
e[
|
|
1959
|
-
type:
|
|
1960
|
-
description:
|
|
1961
|
-
...
|
|
2853
|
+
if (o.inputs.properties)
|
|
2854
|
+
for (const [t, r] of Object.entries(o.inputs.properties)) {
|
|
2855
|
+
const s = r;
|
|
2856
|
+
e[t] = {
|
|
2857
|
+
type: s.type || "string",
|
|
2858
|
+
description: s.description,
|
|
2859
|
+
...s.enum && { enum: s.enum }
|
|
1962
2860
|
};
|
|
1963
2861
|
}
|
|
1964
2862
|
return {
|
|
1965
|
-
name:
|
|
1966
|
-
description:
|
|
2863
|
+
name: o.name,
|
|
2864
|
+
description: o.description,
|
|
1967
2865
|
parameters: {
|
|
1968
2866
|
type: "object",
|
|
1969
2867
|
properties: e,
|
|
1970
|
-
required:
|
|
2868
|
+
required: o.inputs.required || []
|
|
1971
2869
|
}
|
|
1972
2870
|
};
|
|
1973
2871
|
}
|
|
1974
|
-
function
|
|
2872
|
+
function bt(o) {
|
|
1975
2873
|
return {
|
|
1976
|
-
functionDeclarations:
|
|
2874
|
+
functionDeclarations: o.map(je)
|
|
1977
2875
|
};
|
|
1978
2876
|
}
|
|
1979
|
-
function
|
|
2877
|
+
function Me(o) {
|
|
1980
2878
|
return {
|
|
1981
2879
|
type: "function",
|
|
1982
2880
|
function: {
|
|
1983
|
-
name:
|
|
1984
|
-
description:
|
|
1985
|
-
parameters:
|
|
2881
|
+
name: o.name,
|
|
2882
|
+
description: o.description,
|
|
2883
|
+
parameters: o.inputs
|
|
1986
2884
|
}
|
|
1987
2885
|
};
|
|
1988
2886
|
}
|
|
1989
|
-
function
|
|
1990
|
-
return
|
|
2887
|
+
function wt(o) {
|
|
2888
|
+
return o.map(Me);
|
|
1991
2889
|
}
|
|
1992
|
-
function
|
|
2890
|
+
function Ne(o) {
|
|
1993
2891
|
return {
|
|
1994
|
-
name:
|
|
1995
|
-
description:
|
|
1996
|
-
input_schema:
|
|
2892
|
+
name: o.name,
|
|
2893
|
+
description: o.description,
|
|
2894
|
+
input_schema: o.inputs
|
|
1997
2895
|
};
|
|
1998
2896
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return
|
|
2897
|
+
function kt(o) {
|
|
2898
|
+
return o.map(Ne);
|
|
2001
2899
|
}
|
|
2002
|
-
function
|
|
2900
|
+
function Fe(o) {
|
|
2003
2901
|
return {
|
|
2004
|
-
name:
|
|
2005
|
-
description:
|
|
2006
|
-
parameters:
|
|
2902
|
+
name: o.name,
|
|
2903
|
+
description: o.description,
|
|
2904
|
+
parameters: o.inputs
|
|
2007
2905
|
};
|
|
2008
2906
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return
|
|
2907
|
+
function Ct(o) {
|
|
2908
|
+
return o.map(Fe);
|
|
2011
2909
|
}
|
|
2012
|
-
function
|
|
2910
|
+
function vt(o, e = {}) {
|
|
2013
2911
|
const {
|
|
2014
|
-
header:
|
|
2912
|
+
header: t = "You have access to the following tools:",
|
|
2015
2913
|
includeParameters: r = !0
|
|
2016
|
-
} = e,
|
|
2017
|
-
let
|
|
2018
|
-
if (r &&
|
|
2019
|
-
const
|
|
2020
|
-
var
|
|
2021
|
-
const
|
|
2022
|
-
return ` - ${
|
|
2914
|
+
} = e, s = o.map((a) => {
|
|
2915
|
+
let n = `- ${a.name}: ${a.description}`;
|
|
2916
|
+
if (r && a.inputs.properties) {
|
|
2917
|
+
const i = Object.entries(a.inputs.properties).map(([p, u]) => {
|
|
2918
|
+
var f;
|
|
2919
|
+
const h = u, d = (f = a.inputs.required) != null && f.includes(p) ? " (required)" : "";
|
|
2920
|
+
return ` - ${p}: ${h.description || h.type}${d}`;
|
|
2023
2921
|
}).join(`
|
|
2024
2922
|
`);
|
|
2025
|
-
|
|
2026
|
-
${
|
|
2923
|
+
i && (n += `
|
|
2924
|
+
${i}`);
|
|
2027
2925
|
}
|
|
2028
|
-
return
|
|
2926
|
+
return n;
|
|
2029
2927
|
});
|
|
2030
|
-
return `${
|
|
2928
|
+
return `${t}
|
|
2031
2929
|
|
|
2032
|
-
${
|
|
2930
|
+
${s.join(`
|
|
2033
2931
|
|
|
2034
2932
|
`)}`;
|
|
2035
2933
|
}
|
|
2036
|
-
const
|
|
2934
|
+
const Oe = ({ size: o = 18 }) => /* @__PURE__ */ b(
|
|
2037
2935
|
"svg",
|
|
2038
2936
|
{
|
|
2039
|
-
width:
|
|
2040
|
-
height:
|
|
2937
|
+
width: o,
|
|
2938
|
+
height: o,
|
|
2041
2939
|
viewBox: "0 0 24 24",
|
|
2042
2940
|
fill: "none",
|
|
2043
2941
|
stroke: "currentColor",
|
|
@@ -2045,15 +2943,15 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2045
2943
|
strokeLinecap: "round",
|
|
2046
2944
|
strokeLinejoin: "round",
|
|
2047
2945
|
children: [
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2947
|
+
/* @__PURE__ */ l("path", { d: "M9 3v18" })
|
|
2050
2948
|
]
|
|
2051
2949
|
}
|
|
2052
|
-
),
|
|
2950
|
+
), Ke = ({ size: o = 18 }) => /* @__PURE__ */ b(
|
|
2053
2951
|
"svg",
|
|
2054
2952
|
{
|
|
2055
|
-
width:
|
|
2056
|
-
height:
|
|
2953
|
+
width: o,
|
|
2954
|
+
height: o,
|
|
2057
2955
|
viewBox: "0 0 24 24",
|
|
2058
2956
|
fill: "none",
|
|
2059
2957
|
stroke: "currentColor",
|
|
@@ -2061,16 +2959,16 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2061
2959
|
strokeLinecap: "round",
|
|
2062
2960
|
strokeLinejoin: "round",
|
|
2063
2961
|
children: [
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2963
|
+
/* @__PURE__ */ l("path", { d: "M9 3v18" }),
|
|
2964
|
+
/* @__PURE__ */ l("path", { d: "m16 15-3-3 3-3" })
|
|
2067
2965
|
]
|
|
2068
2966
|
}
|
|
2069
|
-
),
|
|
2967
|
+
), Be = ({ size: o = 18 }) => /* @__PURE__ */ b(
|
|
2070
2968
|
"svg",
|
|
2071
2969
|
{
|
|
2072
|
-
width:
|
|
2073
|
-
height:
|
|
2970
|
+
width: o,
|
|
2971
|
+
height: o,
|
|
2074
2972
|
viewBox: "0 0 24 24",
|
|
2075
2973
|
fill: "none",
|
|
2076
2974
|
stroke: "currentColor",
|
|
@@ -2078,15 +2976,15 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2078
2976
|
strokeLinecap: "round",
|
|
2079
2977
|
strokeLinejoin: "round",
|
|
2080
2978
|
children: [
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2979
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2980
|
+
/* @__PURE__ */ l("path", { d: "M15 3v18" })
|
|
2083
2981
|
]
|
|
2084
2982
|
}
|
|
2085
|
-
),
|
|
2983
|
+
), Ve = ({ size: o = 18 }) => /* @__PURE__ */ b(
|
|
2086
2984
|
"svg",
|
|
2087
2985
|
{
|
|
2088
|
-
width:
|
|
2089
|
-
height:
|
|
2986
|
+
width: o,
|
|
2987
|
+
height: o,
|
|
2090
2988
|
viewBox: "0 0 24 24",
|
|
2091
2989
|
fill: "none",
|
|
2092
2990
|
stroke: "currentColor",
|
|
@@ -2094,32 +2992,32 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2094
2992
|
strokeLinecap: "round",
|
|
2095
2993
|
strokeLinejoin: "round",
|
|
2096
2994
|
children: [
|
|
2097
|
-
/* @__PURE__ */
|
|
2098
|
-
/* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2996
|
+
/* @__PURE__ */ l("path", { d: "M15 3v18" }),
|
|
2997
|
+
/* @__PURE__ */ l("path", { d: "m8 9 3 3-3 3" })
|
|
2100
2998
|
]
|
|
2101
2999
|
}
|
|
2102
|
-
),
|
|
2103
|
-
isCollapsed:
|
|
3000
|
+
), oe = ({
|
|
3001
|
+
isCollapsed: o,
|
|
2104
3002
|
onToggle: e,
|
|
2105
|
-
side:
|
|
3003
|
+
side: t = "left",
|
|
2106
3004
|
iconSize: r = 18,
|
|
2107
|
-
style:
|
|
2108
|
-
shortcutHint:
|
|
2109
|
-
title:
|
|
2110
|
-
className:
|
|
3005
|
+
style: s,
|
|
3006
|
+
shortcutHint: a = "Cmd/Ctrl+B",
|
|
3007
|
+
title: n,
|
|
3008
|
+
className: i
|
|
2111
3009
|
}) => {
|
|
2112
|
-
const { theme:
|
|
2113
|
-
return /* @__PURE__ */
|
|
3010
|
+
const { theme: p } = q(), u = () => t === "right" ? o ? /* @__PURE__ */ l(Be, { size: r }) : /* @__PURE__ */ l(Ve, { size: r }) : o ? /* @__PURE__ */ l(Oe, { size: r }) : /* @__PURE__ */ l(Ke, { size: r });
|
|
3011
|
+
return /* @__PURE__ */ l(
|
|
2114
3012
|
"button",
|
|
2115
3013
|
{
|
|
2116
3014
|
onClick: e,
|
|
2117
|
-
title:
|
|
2118
|
-
className:
|
|
3015
|
+
title: n ?? `${o ? "Show" : "Hide"} ${t === "right" ? "Right Panel" : "Sidebar"}${a ? ` (${a})` : ""}`,
|
|
3016
|
+
className: i,
|
|
2119
3017
|
style: {
|
|
2120
3018
|
background: "transparent",
|
|
2121
3019
|
border: "none",
|
|
2122
|
-
color:
|
|
3020
|
+
color: o ? p.colors.textSecondary : p.colors.primary,
|
|
2123
3021
|
cursor: "pointer",
|
|
2124
3022
|
padding: "6px",
|
|
2125
3023
|
borderRadius: "4px",
|
|
@@ -2129,22 +3027,22 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2129
3027
|
transition: "all 0.2s",
|
|
2130
3028
|
width: "32px",
|
|
2131
3029
|
height: "32px",
|
|
2132
|
-
...
|
|
3030
|
+
...s
|
|
2133
3031
|
},
|
|
2134
|
-
onMouseEnter: (
|
|
2135
|
-
|
|
3032
|
+
onMouseEnter: (d) => {
|
|
3033
|
+
d.currentTarget.style.backgroundColor = p.colors.backgroundTertiary, d.currentTarget.style.color = p.colors.primary;
|
|
2136
3034
|
},
|
|
2137
|
-
onMouseLeave: (
|
|
2138
|
-
|
|
3035
|
+
onMouseLeave: (d) => {
|
|
3036
|
+
d.currentTarget.style.backgroundColor = "transparent", d.currentTarget.style.color = o ? p.colors.textSecondary : p.colors.primary;
|
|
2139
3037
|
},
|
|
2140
|
-
children:
|
|
3038
|
+
children: u()
|
|
2141
3039
|
}
|
|
2142
3040
|
);
|
|
2143
|
-
},
|
|
3041
|
+
}, He = ({ size: o = 14 }) => /* @__PURE__ */ b(
|
|
2144
3042
|
"svg",
|
|
2145
3043
|
{
|
|
2146
|
-
width:
|
|
2147
|
-
height:
|
|
3044
|
+
width: o,
|
|
3045
|
+
height: o,
|
|
2148
3046
|
viewBox: "0 0 24 24",
|
|
2149
3047
|
fill: "none",
|
|
2150
3048
|
stroke: "currentColor",
|
|
@@ -2152,17 +3050,17 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2152
3050
|
strokeLinecap: "round",
|
|
2153
3051
|
strokeLinejoin: "round",
|
|
2154
3052
|
children: [
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ l("path", { d: "M8 3 4 7l4 4" }),
|
|
3054
|
+
/* @__PURE__ */ l("path", { d: "M4 7h16" }),
|
|
3055
|
+
/* @__PURE__ */ l("path", { d: "m16 21 4-4-4-4" }),
|
|
3056
|
+
/* @__PURE__ */ l("path", { d: "M20 17H4" })
|
|
2159
3057
|
]
|
|
2160
3058
|
}
|
|
2161
|
-
),
|
|
3059
|
+
), Je = ({ size: o = 14 }) => /* @__PURE__ */ b(
|
|
2162
3060
|
"svg",
|
|
2163
3061
|
{
|
|
2164
|
-
width:
|
|
2165
|
-
height:
|
|
3062
|
+
width: o,
|
|
3063
|
+
height: o,
|
|
2166
3064
|
viewBox: "0 0 24 24",
|
|
2167
3065
|
fill: "none",
|
|
2168
3066
|
stroke: "currentColor",
|
|
@@ -2170,31 +3068,31 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2170
3068
|
strokeLinecap: "round",
|
|
2171
3069
|
strokeLinejoin: "round",
|
|
2172
3070
|
children: [
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
/* @__PURE__ */
|
|
2176
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ l("path", { d: "m16 3 4 4-4 4" }),
|
|
3072
|
+
/* @__PURE__ */ l("path", { d: "M20 7H4" }),
|
|
3073
|
+
/* @__PURE__ */ l("path", { d: "m8 21-4-4 4-4" }),
|
|
3074
|
+
/* @__PURE__ */ l("path", { d: "M4 17h16" })
|
|
2177
3075
|
]
|
|
2178
3076
|
}
|
|
2179
|
-
),
|
|
2180
|
-
onSwitch:
|
|
3077
|
+
), re = ({
|
|
3078
|
+
onSwitch: o,
|
|
2181
3079
|
variant: e = "left-middle",
|
|
2182
|
-
iconSize:
|
|
3080
|
+
iconSize: t = 14,
|
|
2183
3081
|
style: r,
|
|
2184
|
-
title:
|
|
2185
|
-
className:
|
|
3082
|
+
title: s,
|
|
3083
|
+
className: a
|
|
2186
3084
|
}) => {
|
|
2187
|
-
const { theme:
|
|
2188
|
-
return /* @__PURE__ */
|
|
3085
|
+
const { theme: n } = q(), i = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", p = e === "left-middle" ? He : Je;
|
|
3086
|
+
return /* @__PURE__ */ l(
|
|
2189
3087
|
"button",
|
|
2190
3088
|
{
|
|
2191
|
-
onClick:
|
|
2192
|
-
title:
|
|
2193
|
-
className:
|
|
3089
|
+
onClick: o,
|
|
3090
|
+
title: s ?? i(),
|
|
3091
|
+
className: a,
|
|
2194
3092
|
style: {
|
|
2195
3093
|
background: "transparent",
|
|
2196
3094
|
border: "none",
|
|
2197
|
-
color:
|
|
3095
|
+
color: n.colors.textSecondary,
|
|
2198
3096
|
cursor: "pointer",
|
|
2199
3097
|
padding: "6px",
|
|
2200
3098
|
borderRadius: "4px",
|
|
@@ -2206,20 +3104,20 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2206
3104
|
height: "32px",
|
|
2207
3105
|
...r
|
|
2208
3106
|
},
|
|
2209
|
-
onMouseEnter: (
|
|
2210
|
-
|
|
3107
|
+
onMouseEnter: (u) => {
|
|
3108
|
+
u.currentTarget.style.backgroundColor = n.colors.backgroundTertiary, u.currentTarget.style.color = n.colors.text;
|
|
2211
3109
|
},
|
|
2212
|
-
onMouseLeave: (
|
|
2213
|
-
|
|
3110
|
+
onMouseLeave: (u) => {
|
|
3111
|
+
u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.color = n.colors.textSecondary;
|
|
2214
3112
|
},
|
|
2215
|
-
children: /* @__PURE__ */
|
|
3113
|
+
children: /* @__PURE__ */ l(p, { size: t })
|
|
2216
3114
|
}
|
|
2217
3115
|
);
|
|
2218
|
-
},
|
|
3116
|
+
}, Qe = ({ size: o = 14 }) => /* @__PURE__ */ b(
|
|
2219
3117
|
"svg",
|
|
2220
3118
|
{
|
|
2221
|
-
width:
|
|
2222
|
-
height:
|
|
3119
|
+
width: o,
|
|
3120
|
+
height: o,
|
|
2223
3121
|
viewBox: "0 0 24 24",
|
|
2224
3122
|
fill: "none",
|
|
2225
3123
|
stroke: "currentColor",
|
|
@@ -2227,29 +3125,29 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2227
3125
|
strokeLinecap: "round",
|
|
2228
3126
|
strokeLinejoin: "round",
|
|
2229
3127
|
children: [
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
3129
|
+
/* @__PURE__ */ l("path", { d: "M3 9h18" }),
|
|
3130
|
+
/* @__PURE__ */ l("path", { d: "M9 21V9" })
|
|
2233
3131
|
]
|
|
2234
3132
|
}
|
|
2235
|
-
),
|
|
2236
|
-
onConfigure:
|
|
3133
|
+
), Ge = ({
|
|
3134
|
+
onConfigure: o,
|
|
2237
3135
|
iconSize: e = 14,
|
|
2238
|
-
style:
|
|
3136
|
+
style: t,
|
|
2239
3137
|
title: r = "Configure panel layout",
|
|
2240
|
-
className:
|
|
3138
|
+
className: s
|
|
2241
3139
|
}) => {
|
|
2242
|
-
const { theme:
|
|
2243
|
-
return /* @__PURE__ */
|
|
3140
|
+
const { theme: a } = q();
|
|
3141
|
+
return /* @__PURE__ */ l(
|
|
2244
3142
|
"button",
|
|
2245
3143
|
{
|
|
2246
|
-
onClick:
|
|
3144
|
+
onClick: o,
|
|
2247
3145
|
title: r,
|
|
2248
|
-
className:
|
|
3146
|
+
className: s,
|
|
2249
3147
|
style: {
|
|
2250
3148
|
background: "transparent",
|
|
2251
3149
|
border: "none",
|
|
2252
|
-
color:
|
|
3150
|
+
color: a.colors.textSecondary,
|
|
2253
3151
|
cursor: "pointer",
|
|
2254
3152
|
padding: "6px",
|
|
2255
3153
|
borderRadius: "4px",
|
|
@@ -2259,148 +3157,158 @@ const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
|
2259
3157
|
transition: "all 0.2s",
|
|
2260
3158
|
width: "32px",
|
|
2261
3159
|
height: "32px",
|
|
2262
|
-
...
|
|
3160
|
+
...t
|
|
2263
3161
|
},
|
|
2264
|
-
onMouseEnter: (
|
|
2265
|
-
|
|
3162
|
+
onMouseEnter: (n) => {
|
|
3163
|
+
n.currentTarget.style.backgroundColor = a.colors.backgroundTertiary, n.currentTarget.style.color = a.colors.text;
|
|
2266
3164
|
},
|
|
2267
|
-
onMouseLeave: (
|
|
2268
|
-
|
|
3165
|
+
onMouseLeave: (n) => {
|
|
3166
|
+
n.currentTarget.style.backgroundColor = "transparent", n.currentTarget.style.color = a.colors.textSecondary;
|
|
2269
3167
|
},
|
|
2270
|
-
children: /* @__PURE__ */
|
|
3168
|
+
children: /* @__PURE__ */ l(Qe, { size: e })
|
|
2271
3169
|
}
|
|
2272
3170
|
);
|
|
2273
|
-
},
|
|
2274
|
-
leftSidebarCollapsed:
|
|
3171
|
+
}, St = ({
|
|
3172
|
+
leftSidebarCollapsed: o = !1,
|
|
2275
3173
|
onToggleLeftSidebar: e,
|
|
2276
|
-
showLeftSidebarControl:
|
|
3174
|
+
showLeftSidebarControl: t = !1,
|
|
2277
3175
|
rightSidebarCollapsed: r = !1,
|
|
2278
|
-
onToggleRightSidebar:
|
|
2279
|
-
showRightSidebarControl:
|
|
2280
|
-
onSwitchLeftMiddlePanels:
|
|
2281
|
-
showSwitchLeftMiddle:
|
|
2282
|
-
onSwitchRightMiddlePanels:
|
|
2283
|
-
showSwitchRightMiddle:
|
|
2284
|
-
onConfigurePanels:
|
|
2285
|
-
showConfigureButton:
|
|
2286
|
-
gap:
|
|
2287
|
-
style:
|
|
2288
|
-
className:
|
|
2289
|
-
iconSize:
|
|
3176
|
+
onToggleRightSidebar: s,
|
|
3177
|
+
showRightSidebarControl: a = !1,
|
|
3178
|
+
onSwitchLeftMiddlePanels: n,
|
|
3179
|
+
showSwitchLeftMiddle: i = !1,
|
|
3180
|
+
onSwitchRightMiddlePanels: p,
|
|
3181
|
+
showSwitchRightMiddle: u = !1,
|
|
3182
|
+
onConfigurePanels: h,
|
|
3183
|
+
showConfigureButton: d = !1,
|
|
3184
|
+
gap: f = 4,
|
|
3185
|
+
style: g,
|
|
3186
|
+
className: m,
|
|
3187
|
+
iconSize: c,
|
|
2290
3188
|
leftCollapseButtonProps: k,
|
|
2291
|
-
rightCollapseButtonProps:
|
|
2292
|
-
leftMiddleSwitchButtonProps:
|
|
2293
|
-
rightMiddleSwitchButtonProps:
|
|
2294
|
-
configureButtonProps:
|
|
2295
|
-
}) =>
|
|
3189
|
+
rightCollapseButtonProps: R,
|
|
3190
|
+
leftMiddleSwitchButtonProps: A,
|
|
3191
|
+
rightMiddleSwitchButtonProps: I,
|
|
3192
|
+
configureButtonProps: $
|
|
3193
|
+
}) => t && e || i && n || d && h || u && p || a && s ? /* @__PURE__ */ b(
|
|
2296
3194
|
"div",
|
|
2297
3195
|
{
|
|
2298
|
-
className:
|
|
3196
|
+
className: m,
|
|
2299
3197
|
style: {
|
|
2300
3198
|
display: "flex",
|
|
2301
3199
|
alignItems: "center",
|
|
2302
|
-
gap: `${
|
|
2303
|
-
...
|
|
3200
|
+
gap: `${f}px`,
|
|
3201
|
+
...g
|
|
2304
3202
|
},
|
|
2305
3203
|
children: [
|
|
2306
|
-
|
|
2307
|
-
|
|
3204
|
+
t && e && /* @__PURE__ */ l(
|
|
3205
|
+
oe,
|
|
2308
3206
|
{
|
|
2309
|
-
isCollapsed:
|
|
3207
|
+
isCollapsed: o,
|
|
2310
3208
|
onToggle: e,
|
|
2311
3209
|
side: "left",
|
|
2312
|
-
iconSize:
|
|
3210
|
+
iconSize: c ?? 18,
|
|
2313
3211
|
...k
|
|
2314
3212
|
}
|
|
2315
3213
|
),
|
|
2316
|
-
|
|
2317
|
-
|
|
3214
|
+
i && n && /* @__PURE__ */ l(
|
|
3215
|
+
re,
|
|
2318
3216
|
{
|
|
2319
|
-
onSwitch:
|
|
3217
|
+
onSwitch: n,
|
|
2320
3218
|
variant: "left-middle",
|
|
2321
|
-
iconSize:
|
|
2322
|
-
...
|
|
3219
|
+
iconSize: c ?? 14,
|
|
3220
|
+
...A
|
|
2323
3221
|
}
|
|
2324
3222
|
),
|
|
2325
|
-
|
|
2326
|
-
|
|
3223
|
+
d && h && /* @__PURE__ */ l(
|
|
3224
|
+
Ge,
|
|
2327
3225
|
{
|
|
2328
|
-
onConfigure:
|
|
2329
|
-
iconSize:
|
|
2330
|
-
|
|
3226
|
+
onConfigure: h,
|
|
3227
|
+
iconSize: c ?? 14,
|
|
3228
|
+
...$
|
|
2331
3229
|
}
|
|
2332
3230
|
),
|
|
2333
|
-
|
|
2334
|
-
|
|
3231
|
+
u && p && /* @__PURE__ */ l(
|
|
3232
|
+
re,
|
|
2335
3233
|
{
|
|
2336
|
-
onSwitch:
|
|
3234
|
+
onSwitch: p,
|
|
2337
3235
|
variant: "right-middle",
|
|
2338
|
-
iconSize:
|
|
2339
|
-
...
|
|
3236
|
+
iconSize: c ?? 14,
|
|
3237
|
+
...I
|
|
2340
3238
|
}
|
|
2341
3239
|
),
|
|
2342
|
-
|
|
2343
|
-
|
|
3240
|
+
a && s && /* @__PURE__ */ l(
|
|
3241
|
+
oe,
|
|
2344
3242
|
{
|
|
2345
3243
|
isCollapsed: r,
|
|
2346
|
-
onToggle:
|
|
3244
|
+
onToggle: s,
|
|
2347
3245
|
side: "right",
|
|
2348
|
-
iconSize:
|
|
2349
|
-
...
|
|
3246
|
+
iconSize: c ?? 18,
|
|
3247
|
+
...R
|
|
2350
3248
|
}
|
|
2351
3249
|
)
|
|
2352
3250
|
]
|
|
2353
3251
|
}
|
|
2354
3252
|
) : null;
|
|
2355
3253
|
export {
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
3254
|
+
ie as AgentCommandInput,
|
|
3255
|
+
De as AgentCommandPalette,
|
|
3256
|
+
ce as AgentResponseDisplay,
|
|
3257
|
+
Pe as CommandInput,
|
|
3258
|
+
ae as CommandItem,
|
|
3259
|
+
Ie as CommandList,
|
|
3260
|
+
it as CommandPalette,
|
|
3261
|
+
ne as CommandRegistryService,
|
|
3262
|
+
It as EditableConfigurablePanelLayout,
|
|
3263
|
+
nt as FocusIndicator,
|
|
3264
|
+
Se as LocalStoragePersistenceAdapter,
|
|
3265
|
+
Te as LocalStorageWorkspaceAdapter,
|
|
3266
|
+
oe as PanelCollapseButton,
|
|
3267
|
+
Ge as PanelConfigureButton,
|
|
3268
|
+
St as PanelControls,
|
|
3269
|
+
re as PanelSwitchButton,
|
|
3270
|
+
Rt as ResponsiveConfigurablePanelLayout,
|
|
3271
|
+
le as ToolExecutionList,
|
|
3272
|
+
_ as WorkspaceLayoutService,
|
|
3273
|
+
me as collapseAllPanelsTool,
|
|
3274
|
+
ht as createToolCommandsProvider,
|
|
3275
|
+
ye as expandAllPanelsTool,
|
|
3276
|
+
ge as focusPanelTool,
|
|
3277
|
+
vt as generateToolsSystemPrompt,
|
|
3278
|
+
lt as getGlobalCommandRegistry,
|
|
3279
|
+
pt as getPanelCommands,
|
|
3280
|
+
pe as getPanelStateTool,
|
|
3281
|
+
xt as getToolParameterInfo,
|
|
3282
|
+
de as getVisiblePanelsTool,
|
|
3283
|
+
mt as layoutActionTools,
|
|
3284
|
+
_e as layoutTools,
|
|
3285
|
+
yt as layoutToolsMetadata,
|
|
3286
|
+
ue as listPanelsWithStateTool,
|
|
3287
|
+
Lt as mapThemeToPanelVars,
|
|
3288
|
+
At as mapThemeToTabVars,
|
|
3289
|
+
Re as panelCommands,
|
|
3290
|
+
ct as resetGlobalCommandRegistry,
|
|
3291
|
+
xe as resetLayoutTool,
|
|
3292
|
+
ft as stateQueryTools,
|
|
3293
|
+
he as switchPanelTool,
|
|
3294
|
+
fe as togglePanelTool,
|
|
3295
|
+
Fe as toolToAIFunction,
|
|
3296
|
+
Ne as toolToAnthropicFormat,
|
|
3297
|
+
ze as toolToCommand,
|
|
3298
|
+
je as toolToGeminiFunction,
|
|
3299
|
+
Me as toolToOpenAIFunction,
|
|
3300
|
+
Ct as toolsToAIFunctions,
|
|
3301
|
+
kt as toolsToAnthropicFormat,
|
|
3302
|
+
be as toolsToCommands,
|
|
3303
|
+
bt as toolsToGeminiFormat,
|
|
3304
|
+
wt as toolsToOpenAIFormat,
|
|
3305
|
+
ut as useAgentCommandPalette,
|
|
3306
|
+
dt as useCommandPalette,
|
|
3307
|
+
rt as usePanelFocus,
|
|
3308
|
+
at as usePanelFocusListener,
|
|
3309
|
+
st as usePanelKeyboardShortcuts,
|
|
3310
|
+
tt as usePanelPersistence,
|
|
3311
|
+
gt as useToolCommands,
|
|
3312
|
+
ot as useWorkspace
|
|
2405
3313
|
};
|
|
2406
3314
|
//# sourceMappingURL=index.esm.js.map
|