@principal-ade/panel-layouts 0.3.3 → 0.3.5
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.css +1 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.esm.js +1102 -885
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import './index.css';var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { EditableConfigurablePanelLayout as
|
|
5
|
-
import { useState as P, useRef as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
class
|
|
1
|
+
import './index.css';var Ee = Object.defineProperty;
|
|
2
|
+
var _e = (o, e, t) => e in o ? Ee(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var ae = (o, e, t) => _e(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { EditableConfigurablePanelLayout as It, ResponsiveConfigurablePanelLayout as At, mapThemeToPanelVars as zt, mapThemeToTabVars as Pt } from "@principal-ade/panels";
|
|
5
|
+
import { useState as P, useRef as V, useEffect as R, useCallback as k, useMemo as te } from "react";
|
|
6
|
+
import { jsx as l, jsxs as y, Fragment as de } from "react/jsx-runtime";
|
|
7
|
+
import { useTheme as U } from "@principal-ade/industry-theme";
|
|
8
|
+
class Re {
|
|
9
9
|
constructor() {
|
|
10
|
-
|
|
10
|
+
ae(this, "storageKey", "panel-layouts");
|
|
11
11
|
}
|
|
12
12
|
async load(e) {
|
|
13
13
|
try {
|
|
@@ -28,122 +28,122 @@ class ze {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function lt(o) {
|
|
32
32
|
const {
|
|
33
33
|
viewKey: e,
|
|
34
34
|
defaultSizes: t,
|
|
35
35
|
panelType: r,
|
|
36
|
-
adapter:
|
|
37
|
-
} = o, [
|
|
36
|
+
adapter: s = new Re()
|
|
37
|
+
} = o, [i, a] = P(t), [n, f] = P(o.collapsed), c = V(o.collapsed), x = V({}), h = V(null), m = V(null);
|
|
38
38
|
R(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const T = await s.load(e);
|
|
41
|
+
T != null && T.sizes && (a(T.sizes), w(T.sizes));
|
|
42
42
|
})();
|
|
43
43
|
}, [e]);
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
"left" in
|
|
44
|
+
const w = k(
|
|
45
|
+
(b) => {
|
|
46
|
+
"left" in b && b.left > 0 && (x.current.left = b.left), "middle" in b && b.middle > 0 && (x.current.middle = b.middle), "right" in b && b.right > 0 && (x.current.right = b.right);
|
|
47
47
|
},
|
|
48
48
|
[]
|
|
49
|
-
),
|
|
50
|
-
(
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
if (
|
|
49
|
+
), u = k(
|
|
50
|
+
(b) => {
|
|
51
|
+
const T = x.current[b];
|
|
52
|
+
if (T && T > 0)
|
|
53
|
+
return T;
|
|
54
|
+
if (b === "left" && "left" in t && t.left > 0)
|
|
55
55
|
return t.left;
|
|
56
|
-
if (
|
|
56
|
+
if (b === "right" && "right" in t && t.right > 0)
|
|
57
57
|
return t.right;
|
|
58
58
|
},
|
|
59
59
|
[t]
|
|
60
|
-
), d =
|
|
60
|
+
), d = V(t);
|
|
61
61
|
R(() => {
|
|
62
|
-
("left" in t && t.left !== d.current.left || "middle" in t && "middle" in d.current && t.middle !== d.current.middle || "right" in t && t.right !== d.current.right) && (
|
|
63
|
-
}, [t,
|
|
64
|
-
const
|
|
65
|
-
(
|
|
62
|
+
("left" in t && t.left !== d.current.left || "middle" in t && "middle" in d.current && t.middle !== d.current.middle || "right" in t && t.right !== d.current.right) && (a(t), w(t), d.current = t);
|
|
63
|
+
}, [t, w]), R(() => {
|
|
64
|
+
const b = o.collapsed.left !== c.current.left, T = "right" in o.collapsed && "right" in c.current && o.collapsed.right !== c.current.right;
|
|
65
|
+
(b || T) && (f(o.collapsed), c.current = { ...o.collapsed });
|
|
66
66
|
}, [o.collapsed.left, o.collapsed.right]);
|
|
67
|
-
const
|
|
68
|
-
async (
|
|
67
|
+
const p = k(
|
|
68
|
+
async (b) => {
|
|
69
69
|
try {
|
|
70
|
-
await
|
|
71
|
-
} catch (
|
|
70
|
+
await s.save(e, { sizes: b });
|
|
71
|
+
} catch (T) {
|
|
72
72
|
console.error(
|
|
73
73
|
`Failed to save panel preferences for ${e}:`,
|
|
74
|
-
|
|
74
|
+
T
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
[e,
|
|
79
|
-
),
|
|
80
|
-
(
|
|
81
|
-
const
|
|
78
|
+
[e, s]
|
|
79
|
+
), v = k(
|
|
80
|
+
(b) => {
|
|
81
|
+
const T = { ...b };
|
|
82
82
|
let S = !0;
|
|
83
|
-
if ("left" in
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
} else
|
|
83
|
+
if ("left" in b) {
|
|
84
|
+
const I = !!(n != null && n.left), z = b.left;
|
|
85
|
+
if (I) {
|
|
86
|
+
const W = u("left");
|
|
87
|
+
W !== void 0 && W > 0 ? T.left = W : S = !1;
|
|
88
|
+
} else z === 0 && (S = !1);
|
|
89
89
|
}
|
|
90
|
-
if (r === "three-panel" && "right" in
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
} else
|
|
90
|
+
if (r === "three-panel" && "right" in b) {
|
|
91
|
+
const I = !!(n != null && n.right), z = b.right;
|
|
92
|
+
if (I) {
|
|
93
|
+
const W = u("right");
|
|
94
|
+
W !== void 0 && W > 0 ? T.right = W : S = !1;
|
|
95
|
+
} else z === 0 && (S = !1);
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
|
|
97
|
+
if (a(T), w(T), h.current && (clearTimeout(h.current), h.current = null), !S) {
|
|
98
|
+
m.current = null;
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
101
|
+
m.current = T, h.current = setTimeout(() => {
|
|
102
|
+
const I = m.current;
|
|
103
|
+
I && (p(I), m.current = null), h.current = null;
|
|
104
104
|
}, 500);
|
|
105
105
|
},
|
|
106
106
|
[
|
|
107
|
-
|
|
108
|
-
h,
|
|
109
|
-
r,
|
|
107
|
+
n,
|
|
110
108
|
u,
|
|
111
|
-
|
|
109
|
+
r,
|
|
110
|
+
p,
|
|
111
|
+
w
|
|
112
112
|
]
|
|
113
113
|
);
|
|
114
114
|
R(() => () => {
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
115
|
+
if (h.current) {
|
|
116
|
+
const b = m.current;
|
|
117
|
+
b && (p(b), m.current = null), clearTimeout(h.current), h.current = null;
|
|
118
118
|
}
|
|
119
|
-
}, [
|
|
120
|
-
const
|
|
119
|
+
}, [p]);
|
|
120
|
+
const E = k(async () => {
|
|
121
121
|
}, []), $ = k(async () => {
|
|
122
|
-
}, []),
|
|
122
|
+
}, []), C = k(async () => {
|
|
123
123
|
}, []), _ = k(async () => {
|
|
124
124
|
}, []);
|
|
125
125
|
return r === "three-panel" ? {
|
|
126
126
|
type: "three-panel",
|
|
127
|
-
sizes:
|
|
128
|
-
collapsed:
|
|
129
|
-
handlePanelResize:
|
|
130
|
-
handleLeftCollapseComplete:
|
|
127
|
+
sizes: i,
|
|
128
|
+
collapsed: n,
|
|
129
|
+
handlePanelResize: v,
|
|
130
|
+
handleLeftCollapseComplete: E,
|
|
131
131
|
handleLeftExpandComplete: $,
|
|
132
|
-
handleRightCollapseComplete:
|
|
132
|
+
handleRightCollapseComplete: C,
|
|
133
133
|
handleRightExpandComplete: _
|
|
134
134
|
} : {
|
|
135
135
|
type: "two-panel",
|
|
136
|
-
sizes:
|
|
137
|
-
collapsed:
|
|
138
|
-
handlePanelResize:
|
|
139
|
-
handleLeftCollapseComplete:
|
|
136
|
+
sizes: i,
|
|
137
|
+
collapsed: n,
|
|
138
|
+
handlePanelResize: v,
|
|
139
|
+
handleLeftCollapseComplete: E,
|
|
140
140
|
handleLeftExpandComplete: $
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
class
|
|
143
|
+
class $e {
|
|
144
144
|
constructor() {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
ae(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
|
|
146
|
+
ae(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Load all user-created workspace presets
|
|
@@ -203,14 +203,14 @@ class Le {
|
|
|
203
203
|
for (let t = 0; t < localStorage.length; t++) {
|
|
204
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), i = localStorage.getItem(r);
|
|
207
|
+
if (i)
|
|
208
208
|
try {
|
|
209
|
-
e[
|
|
210
|
-
} catch (
|
|
209
|
+
e[s] = JSON.parse(i);
|
|
210
|
+
} catch (a) {
|
|
211
211
|
console.error(
|
|
212
|
-
`Failed to parse repository state for ${
|
|
213
|
-
|
|
212
|
+
`Failed to parse repository state for ${s}:`,
|
|
213
|
+
a
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -221,7 +221,7 @@ class Le {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class
|
|
224
|
+
class O {
|
|
225
225
|
/**
|
|
226
226
|
* Configure a custom storage adapter (for Electron IPC or remote storage)
|
|
227
227
|
*/
|
|
@@ -248,7 +248,7 @@ class D {
|
|
|
248
248
|
* Create a new workspace layout
|
|
249
249
|
*/
|
|
250
250
|
static async createWorkspaceLayout(e) {
|
|
251
|
-
const t = await this.adapter.loadWorkspacePresets(), r = this.generateWorkspaceId(e.name),
|
|
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,34 +258,34 @@ class D {
|
|
|
258
258
|
createdAt: Date.now(),
|
|
259
259
|
updatedAt: Date.now(),
|
|
260
260
|
isBuiltIn: !1
|
|
261
|
-
},
|
|
261
|
+
}, i = {
|
|
262
262
|
...t,
|
|
263
|
-
[r]:
|
|
263
|
+
[r]: s
|
|
264
264
|
};
|
|
265
|
-
return await this.adapter.saveWorkspacePresets(
|
|
265
|
+
return await this.adapter.saveWorkspacePresets(i), s;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* Update an existing workspace layout
|
|
269
269
|
*/
|
|
270
270
|
static async updateWorkspaceLayout(e, t) {
|
|
271
|
-
const r = await this.adapter.loadWorkspacePresets(),
|
|
272
|
-
if (!
|
|
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
|
-
...
|
|
276
|
+
const i = {
|
|
277
|
+
...s,
|
|
278
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
|
+
}, a = {
|
|
285
285
|
...r,
|
|
286
|
-
[e]:
|
|
286
|
+
[e]: i
|
|
287
287
|
};
|
|
288
|
-
return await this.adapter.saveWorkspacePresets(
|
|
288
|
+
return await this.adapter.saveWorkspacePresets(a), i;
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* Delete a workspace layout
|
|
@@ -296,8 +296,8 @@ class D {
|
|
|
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)
|
|
@@ -335,23 +335,23 @@ class D {
|
|
|
335
335
|
* Check if repository state differs from workspace defaults
|
|
336
336
|
*/
|
|
337
337
|
static hasStateDeviation(e, t) {
|
|
338
|
-
const r = t.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(t.defaultSizes) : !1,
|
|
339
|
-
return { hasSizeDeviation: r, hasCollapsedDeviation:
|
|
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
344
|
static async updateWorkspaceFromRepositoryState(e, t) {
|
|
345
|
-
const r = await this.getWorkspaceLayout(e),
|
|
346
|
-
if (!r || !
|
|
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
|
/**
|
|
@@ -363,9 +363,9 @@ class D {
|
|
|
363
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
|
});
|
|
@@ -381,8 +381,8 @@ class D {
|
|
|
381
381
|
*/
|
|
382
382
|
static async findMatchingWorkspace(e) {
|
|
383
383
|
const t = await this.getWorkspaceLayouts();
|
|
384
|
-
for (const [r,
|
|
385
|
-
if (this.isLayoutMatchingWorkspace(e,
|
|
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
|
}
|
|
@@ -610,296 +610,296 @@ class D {
|
|
|
610
610
|
Object.keys(e).length;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
|
|
614
|
-
function
|
|
615
|
-
const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [
|
|
613
|
+
ae(O, "adapter", new $e());
|
|
614
|
+
function ct(o = {}) {
|
|
615
|
+
const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, i] = P(
|
|
616
616
|
{}
|
|
617
|
-
), [
|
|
617
|
+
), [a, n] = P(null), [f, c] = P(null), [x, h] = P(!0), [m, w] = P(null), u = k(async () => {
|
|
618
618
|
try {
|
|
619
|
-
|
|
620
|
-
const S = await
|
|
621
|
-
if (
|
|
622
|
-
let
|
|
623
|
-
if (!
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
workspaceId:
|
|
627
|
-
sizes:
|
|
619
|
+
h(!0), w(null);
|
|
620
|
+
const S = await O.getWorkspaceLayouts();
|
|
621
|
+
if (i(S), e) {
|
|
622
|
+
let I = await O.getRepositoryState(e);
|
|
623
|
+
if (!I && t) {
|
|
624
|
+
const z = r || "project-management", W = await O.getWorkspaceLayout(z);
|
|
625
|
+
W && (I = {
|
|
626
|
+
workspaceId: z,
|
|
627
|
+
sizes: W.defaultSizes || {
|
|
628
628
|
left: 20,
|
|
629
629
|
middle: 45,
|
|
630
630
|
right: 35
|
|
631
631
|
},
|
|
632
|
-
collapsed:
|
|
632
|
+
collapsed: W.defaultCollapsed || {
|
|
633
633
|
left: !1,
|
|
634
634
|
right: !1
|
|
635
635
|
}
|
|
636
|
-
}, await
|
|
636
|
+
}, await O.setRepositoryState(
|
|
637
637
|
e,
|
|
638
|
-
|
|
638
|
+
I
|
|
639
639
|
));
|
|
640
640
|
}
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
641
|
+
if (n(I), I != null && I.workspaceId) {
|
|
642
|
+
const z = await O.getWorkspaceLayout(
|
|
643
|
+
I.workspaceId
|
|
644
644
|
);
|
|
645
|
-
|
|
645
|
+
c(z);
|
|
646
646
|
} else
|
|
647
|
-
|
|
647
|
+
c(null);
|
|
648
648
|
}
|
|
649
649
|
} catch (S) {
|
|
650
|
-
|
|
650
|
+
w(S), console.error("Failed to load workspace data:", S);
|
|
651
651
|
} finally {
|
|
652
|
-
|
|
652
|
+
h(!1);
|
|
653
653
|
}
|
|
654
654
|
}, [e, t, r]);
|
|
655
655
|
R(() => {
|
|
656
|
-
|
|
657
|
-
}, [
|
|
656
|
+
u();
|
|
657
|
+
}, [u]);
|
|
658
658
|
const d = k(
|
|
659
|
-
async (S) => await
|
|
659
|
+
async (S) => await O.getWorkspaceLayout(S),
|
|
660
660
|
[]
|
|
661
|
-
),
|
|
661
|
+
), p = k(
|
|
662
662
|
async (S) => {
|
|
663
|
-
const
|
|
664
|
-
return await
|
|
663
|
+
const I = await O.createWorkspaceLayout(S);
|
|
664
|
+
return await u(), I;
|
|
665
665
|
},
|
|
666
|
-
[
|
|
667
|
-
),
|
|
668
|
-
async (S,
|
|
669
|
-
const
|
|
670
|
-
return await
|
|
666
|
+
[u]
|
|
667
|
+
), v = k(
|
|
668
|
+
async (S, I) => {
|
|
669
|
+
const z = await O.updateWorkspaceLayout(S, I);
|
|
670
|
+
return await u(), z;
|
|
671
671
|
},
|
|
672
|
-
[
|
|
673
|
-
),
|
|
672
|
+
[u]
|
|
673
|
+
), E = k(
|
|
674
674
|
async (S) => {
|
|
675
|
-
const
|
|
676
|
-
return
|
|
675
|
+
const I = await O.deleteWorkspaceLayout(S);
|
|
676
|
+
return I && await u(), I;
|
|
677
677
|
},
|
|
678
|
-
[
|
|
678
|
+
[u]
|
|
679
679
|
), $ = k(
|
|
680
680
|
async (S) => {
|
|
681
681
|
if (!e) {
|
|
682
682
|
console.error("Cannot apply workspace without repositoryKey");
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
685
|
+
const I = await O.getWorkspaceLayout(S);
|
|
686
|
+
if (!I) {
|
|
687
687
|
console.error(`Workspace ${S} not found`);
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
690
|
+
const z = {
|
|
691
691
|
workspaceId: S,
|
|
692
|
-
sizes:
|
|
693
|
-
collapsed:
|
|
692
|
+
sizes: I.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
693
|
+
collapsed: I.defaultCollapsed || {
|
|
694
694
|
left: !1,
|
|
695
695
|
right: !1
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
await
|
|
698
|
+
await O.setRepositoryState(e, z), await u();
|
|
699
699
|
},
|
|
700
|
-
[e,
|
|
701
|
-
),
|
|
700
|
+
[e, u]
|
|
701
|
+
), C = k(
|
|
702
702
|
async (S) => {
|
|
703
703
|
if (!e) {
|
|
704
704
|
console.error("Cannot update sizes without repositoryKey");
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
await
|
|
707
|
+
await O.updateRepositorySizes(e, S), await u();
|
|
708
708
|
},
|
|
709
|
-
[e,
|
|
709
|
+
[e, u]
|
|
710
710
|
), _ = k(
|
|
711
711
|
async (S) => {
|
|
712
712
|
if (!e) {
|
|
713
713
|
console.error("Cannot update collapsed without repositoryKey");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
await
|
|
716
|
+
await O.updateRepositoryCollapsed(
|
|
717
717
|
e,
|
|
718
718
|
S
|
|
719
|
-
), await
|
|
719
|
+
), await u();
|
|
720
720
|
},
|
|
721
|
-
[e,
|
|
722
|
-
),
|
|
723
|
-
if (!e || !(
|
|
721
|
+
[e, u]
|
|
722
|
+
), b = k(async () => {
|
|
723
|
+
if (!e || !(a != null && a.workspaceId)) {
|
|
724
724
|
console.error("Cannot reset without repositoryKey and active workspace");
|
|
725
725
|
return;
|
|
726
726
|
}
|
|
727
|
-
await
|
|
727
|
+
await O.resetRepositoryToWorkspaceDefaults(
|
|
728
728
|
e,
|
|
729
|
-
|
|
730
|
-
), await
|
|
731
|
-
}, [e,
|
|
732
|
-
await
|
|
733
|
-
}, [
|
|
729
|
+
a.workspaceId
|
|
730
|
+
), await u();
|
|
731
|
+
}, [e, a == null ? void 0 : a.workspaceId, u]), T = k(async () => {
|
|
732
|
+
await u();
|
|
733
|
+
}, [u]);
|
|
734
734
|
return {
|
|
735
|
-
workspaces:
|
|
736
|
-
repositoryState:
|
|
737
|
-
activeWorkspace:
|
|
738
|
-
loading:
|
|
739
|
-
error:
|
|
735
|
+
workspaces: s,
|
|
736
|
+
repositoryState: a,
|
|
737
|
+
activeWorkspace: f,
|
|
738
|
+
loading: x,
|
|
739
|
+
error: m,
|
|
740
740
|
getWorkspace: d,
|
|
741
|
-
createWorkspace:
|
|
742
|
-
updateWorkspace:
|
|
743
|
-
deleteWorkspace:
|
|
741
|
+
createWorkspace: p,
|
|
742
|
+
updateWorkspace: v,
|
|
743
|
+
deleteWorkspace: E,
|
|
744
744
|
applyWorkspace: $,
|
|
745
|
-
updateSizes:
|
|
745
|
+
updateSizes: C,
|
|
746
746
|
updateCollapsed: _,
|
|
747
|
-
resetToDefaults:
|
|
748
|
-
refresh:
|
|
747
|
+
resetToDefaults: b,
|
|
748
|
+
refresh: T
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function dt(o = {}) {
|
|
752
752
|
const {
|
|
753
753
|
initialFocus: e = null,
|
|
754
754
|
collapsed: t = {},
|
|
755
755
|
panelType: r = "three-panel",
|
|
756
|
-
onFocusChange:
|
|
757
|
-
events:
|
|
758
|
-
getPanelId:
|
|
759
|
-
} = o, [
|
|
756
|
+
onFocusChange: s,
|
|
757
|
+
events: i,
|
|
758
|
+
getPanelId: a
|
|
759
|
+
} = o, [n, f] = P(
|
|
760
760
|
e
|
|
761
|
-
),
|
|
761
|
+
), c = k(
|
|
762
762
|
(d) => {
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
765
|
-
if (
|
|
766
|
-
const
|
|
767
|
-
|
|
763
|
+
const p = n;
|
|
764
|
+
if (f(d), s == null || s(d), i && a) {
|
|
765
|
+
if (p) {
|
|
766
|
+
const E = a(p);
|
|
767
|
+
E && i.emit({
|
|
768
768
|
type: "panel:blur",
|
|
769
769
|
source: "panel-layouts",
|
|
770
770
|
timestamp: Date.now(),
|
|
771
771
|
payload: {
|
|
772
|
-
panelId:
|
|
773
|
-
panelSlot:
|
|
774
|
-
nextPanelId:
|
|
772
|
+
panelId: E,
|
|
773
|
+
panelSlot: p,
|
|
774
|
+
nextPanelId: a(d)
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const v = a(d);
|
|
779
|
+
v && i.emit({
|
|
780
780
|
type: "panel:focus",
|
|
781
781
|
source: "panel-layouts",
|
|
782
782
|
timestamp: Date.now(),
|
|
783
783
|
payload: {
|
|
784
|
-
panelId:
|
|
784
|
+
panelId: v,
|
|
785
785
|
panelSlot: d,
|
|
786
786
|
source: "keyboard-shortcut"
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
|
-
[
|
|
792
|
-
),
|
|
793
|
-
const d =
|
|
794
|
-
if (
|
|
795
|
-
const
|
|
796
|
-
|
|
791
|
+
[n, s, i, a]
|
|
792
|
+
), x = k(() => {
|
|
793
|
+
const d = n;
|
|
794
|
+
if (f(null), s == null || s(null), i && a && d) {
|
|
795
|
+
const p = a(d);
|
|
796
|
+
p && i.emit({
|
|
797
797
|
type: "panel:blur",
|
|
798
798
|
source: "panel-layouts",
|
|
799
799
|
timestamp: Date.now(),
|
|
800
800
|
payload: {
|
|
801
|
-
panelId:
|
|
801
|
+
panelId: p,
|
|
802
802
|
panelSlot: d
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
}, [
|
|
806
|
+
}, [n, s, i, a]), h = k(() => {
|
|
807
807
|
const d = [];
|
|
808
808
|
return t.left || d.push("left"), d.push("middle"), r === "three-panel" && !t.right && d.push("right"), d;
|
|
809
|
-
}, [t, r]),
|
|
810
|
-
const d =
|
|
809
|
+
}, [t, r]), m = k(() => {
|
|
810
|
+
const d = h();
|
|
811
811
|
if (d.length === 0) return;
|
|
812
|
-
if (
|
|
813
|
-
|
|
812
|
+
if (n === null) {
|
|
813
|
+
c(d[0]);
|
|
814
814
|
return;
|
|
815
815
|
}
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
|
|
816
|
+
const p = d.indexOf(n);
|
|
817
|
+
if (p === -1) {
|
|
818
|
+
c(d[0]);
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
}, [
|
|
824
|
-
const d =
|
|
821
|
+
const v = (p + 1) % d.length;
|
|
822
|
+
c(d[v]);
|
|
823
|
+
}, [n, h, c]), w = k(() => {
|
|
824
|
+
const d = h();
|
|
825
825
|
if (d.length === 0) return;
|
|
826
|
-
if (
|
|
827
|
-
|
|
826
|
+
if (n === null) {
|
|
827
|
+
c(d[d.length - 1]);
|
|
828
828
|
return;
|
|
829
829
|
}
|
|
830
|
-
const
|
|
831
|
-
if (
|
|
832
|
-
|
|
830
|
+
const p = d.indexOf(n);
|
|
831
|
+
if (p === -1) {
|
|
832
|
+
c(d[d.length - 1]);
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
}, [
|
|
838
|
-
(d) =>
|
|
839
|
-
[
|
|
835
|
+
const v = p === 0 ? d.length - 1 : p - 1;
|
|
836
|
+
c(d[v]);
|
|
837
|
+
}, [n, h, c]), u = k(
|
|
838
|
+
(d) => n === d,
|
|
839
|
+
[n]
|
|
840
840
|
);
|
|
841
841
|
return {
|
|
842
|
-
focusedPanel:
|
|
843
|
-
setFocus:
|
|
844
|
-
clearFocus:
|
|
845
|
-
focusNext:
|
|
846
|
-
focusPrevious:
|
|
847
|
-
isFocused:
|
|
842
|
+
focusedPanel: n,
|
|
843
|
+
setFocus: c,
|
|
844
|
+
clearFocus: x,
|
|
845
|
+
focusNext: m,
|
|
846
|
+
focusPrevious: w,
|
|
847
|
+
isFocused: u
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function pt(o) {
|
|
851
851
|
const {
|
|
852
852
|
enabled: e = !0,
|
|
853
853
|
focusedPanel: t,
|
|
854
854
|
collapsed: r,
|
|
855
|
-
panelType:
|
|
856
|
-
setFocus:
|
|
857
|
-
onExpand:
|
|
858
|
-
onCollapse:
|
|
859
|
-
} = o,
|
|
855
|
+
panelType: s,
|
|
856
|
+
setFocus: i,
|
|
857
|
+
onExpand: a,
|
|
858
|
+
onCollapse: n
|
|
859
|
+
} = o, f = V(t), c = V(r), x = V(s);
|
|
860
860
|
R(() => {
|
|
861
|
-
|
|
861
|
+
f.current = t;
|
|
862
862
|
}, [t]), R(() => {
|
|
863
|
-
|
|
863
|
+
c.current = r;
|
|
864
864
|
}, [r]), R(() => {
|
|
865
|
-
|
|
866
|
-
}, [
|
|
867
|
-
const
|
|
868
|
-
(
|
|
869
|
-
if (!
|
|
865
|
+
x.current = s;
|
|
866
|
+
}, [s]);
|
|
867
|
+
const h = k(
|
|
868
|
+
(m) => {
|
|
869
|
+
if (!m.altKey || m.ctrlKey || m.metaKey || m.shiftKey)
|
|
870
870
|
return;
|
|
871
|
-
const
|
|
872
|
-
|
|
871
|
+
const w = m.code, u = f.current, d = c.current, p = x.current;
|
|
872
|
+
w === "Digit1" || w === "Numpad1" ? (m.preventDefault(), d.left ? a("left") : u !== "left" ? i("left") : (n("left"), i("middle"))) : w === "Digit2" || w === "Numpad2" ? (m.preventDefault(), i("middle")) : (w === "Digit3" || w === "Numpad3") && p === "three-panel" && (m.preventDefault(), d.right ? a("right") : u !== "right" ? i("right") : (n("right"), i("middle")));
|
|
873
873
|
},
|
|
874
|
-
[
|
|
874
|
+
[i, a, n]
|
|
875
875
|
);
|
|
876
876
|
R(() => {
|
|
877
877
|
if (e)
|
|
878
|
-
return window.addEventListener("keydown",
|
|
879
|
-
window.removeEventListener("keydown",
|
|
878
|
+
return window.addEventListener("keydown", h), () => {
|
|
879
|
+
window.removeEventListener("keydown", h);
|
|
880
880
|
};
|
|
881
|
-
}, [e,
|
|
881
|
+
}, [e, h]);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function ut(o, e, t, r) {
|
|
884
884
|
R(() => {
|
|
885
|
-
const
|
|
885
|
+
const s = e.on(
|
|
886
886
|
"panel:focus",
|
|
887
|
-
(
|
|
888
|
-
|
|
887
|
+
(a) => {
|
|
888
|
+
a.payload.panelId === o && t();
|
|
889
889
|
}
|
|
890
890
|
);
|
|
891
|
-
let
|
|
892
|
-
return r && (
|
|
891
|
+
let i;
|
|
892
|
+
return r && (i = e.on(
|
|
893
893
|
"panel:blur",
|
|
894
|
-
(
|
|
895
|
-
|
|
894
|
+
(a) => {
|
|
895
|
+
a.payload.panelId === o && r();
|
|
896
896
|
}
|
|
897
897
|
)), () => {
|
|
898
|
-
|
|
898
|
+
s(), i == null || i();
|
|
899
899
|
};
|
|
900
900
|
}, [o, e, t, r]);
|
|
901
901
|
}
|
|
902
|
-
const
|
|
902
|
+
const ft = ({
|
|
903
903
|
isFocused: o,
|
|
904
904
|
className: e = "",
|
|
905
905
|
style: t = {}
|
|
@@ -920,7 +920,7 @@ const it = ({
|
|
|
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,48 +929,48 @@ const it = ({
|
|
|
929
929
|
"aria-hidden": "true"
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
|
-
},
|
|
932
|
+
}, me = ({
|
|
933
933
|
value: o,
|
|
934
934
|
onChange: e,
|
|
935
935
|
onSubmit: t,
|
|
936
936
|
onClose: r,
|
|
937
|
-
onHistoryPrevious:
|
|
938
|
-
onHistoryNext:
|
|
939
|
-
mode:
|
|
940
|
-
status:
|
|
941
|
-
placeholder:
|
|
942
|
-
disabled:
|
|
943
|
-
autoFocus:
|
|
944
|
-
agentAvailable:
|
|
945
|
-
showAutocomplete:
|
|
946
|
-
onAutocompleteNext:
|
|
947
|
-
onAutocompletePrevious:
|
|
937
|
+
onHistoryPrevious: s,
|
|
938
|
+
onHistoryNext: i,
|
|
939
|
+
mode: a,
|
|
940
|
+
status: n,
|
|
941
|
+
placeholder: f = "What would you like to do?",
|
|
942
|
+
disabled: c = !1,
|
|
943
|
+
autoFocus: x = !0,
|
|
944
|
+
agentAvailable: h = !0,
|
|
945
|
+
showAutocomplete: m = !1,
|
|
946
|
+
onAutocompleteNext: w,
|
|
947
|
+
onAutocompletePrevious: u,
|
|
948
948
|
onAutocompleteAccept: d
|
|
949
949
|
}) => {
|
|
950
|
-
const { theme:
|
|
950
|
+
const { theme: p } = U(), v = V(null);
|
|
951
951
|
R(() => {
|
|
952
|
-
|
|
953
|
-
}, [
|
|
954
|
-
const
|
|
955
|
-
switch (
|
|
952
|
+
x && v.current && v.current.focus();
|
|
953
|
+
}, [x]);
|
|
954
|
+
const E = (C) => {
|
|
955
|
+
switch (C.stopPropagation(), C.key) {
|
|
956
956
|
case "Enter":
|
|
957
|
-
|
|
957
|
+
C.preventDefault(), t();
|
|
958
958
|
break;
|
|
959
959
|
case "Escape":
|
|
960
|
-
|
|
960
|
+
C.preventDefault(), r();
|
|
961
961
|
break;
|
|
962
962
|
case "Tab":
|
|
963
|
-
|
|
963
|
+
m && d && (C.preventDefault(), d());
|
|
964
964
|
break;
|
|
965
965
|
case "ArrowUp":
|
|
966
|
-
|
|
966
|
+
C.preventDefault(), m && u ? u() : s();
|
|
967
967
|
break;
|
|
968
968
|
case "ArrowDown":
|
|
969
|
-
|
|
969
|
+
C.preventDefault(), m && w ? w() : i();
|
|
970
970
|
break;
|
|
971
971
|
}
|
|
972
|
-
}, $ =
|
|
973
|
-
return /* @__PURE__ */
|
|
972
|
+
}, $ = n === "thinking" || n === "executing";
|
|
973
|
+
return /* @__PURE__ */ y(
|
|
974
974
|
"div",
|
|
975
975
|
{
|
|
976
976
|
style: {
|
|
@@ -978,22 +978,22 @@ const it = ({
|
|
|
978
978
|
alignItems: "center",
|
|
979
979
|
gap: "8px",
|
|
980
980
|
padding: "12px 16px",
|
|
981
|
-
backgroundColor:
|
|
982
|
-
borderBottom: `1px solid ${
|
|
981
|
+
backgroundColor: p.colors.background,
|
|
982
|
+
borderBottom: `1px solid ${p.colors.border}`
|
|
983
983
|
},
|
|
984
984
|
children: [
|
|
985
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ l(
|
|
986
986
|
"span",
|
|
987
987
|
{
|
|
988
988
|
style: {
|
|
989
|
-
color:
|
|
990
|
-
fontFamily:
|
|
991
|
-
fontSize:
|
|
989
|
+
color: a === "quick-command" ? p.colors.info : h ? p.colors.primary : p.colors.textMuted,
|
|
990
|
+
fontFamily: p.fonts.monospace,
|
|
991
|
+
fontSize: p.fontSizes[1],
|
|
992
992
|
userSelect: "none",
|
|
993
993
|
display: "flex",
|
|
994
994
|
alignItems: "center"
|
|
995
995
|
},
|
|
996
|
-
children:
|
|
996
|
+
children: a === "quick-command" ? /* @__PURE__ */ y(
|
|
997
997
|
"svg",
|
|
998
998
|
{
|
|
999
999
|
width: "16",
|
|
@@ -1005,11 +1005,11 @@ const it = ({
|
|
|
1005
1005
|
strokeLinecap: "round",
|
|
1006
1006
|
strokeLinejoin: "round",
|
|
1007
1007
|
children: [
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ l("polyline", { points: "4 17 10 11 4 5" }),
|
|
1009
|
+
/* @__PURE__ */ l("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
1010
1010
|
]
|
|
1011
1011
|
}
|
|
1012
|
-
) :
|
|
1012
|
+
) : h ? /* @__PURE__ */ y(
|
|
1013
1013
|
"svg",
|
|
1014
1014
|
{
|
|
1015
1015
|
width: "16",
|
|
@@ -1021,51 +1021,51 @@ const it = ({
|
|
|
1021
1021
|
strokeLinecap: "round",
|
|
1022
1022
|
strokeLinejoin: "round",
|
|
1023
1023
|
children: [
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ l("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }),
|
|
1025
|
+
/* @__PURE__ */ l("circle", { cx: "12", cy: "5", r: "2" }),
|
|
1026
|
+
/* @__PURE__ */ l("path", { d: "M12 7v4" }),
|
|
1027
|
+
/* @__PURE__ */ l("line", { x1: "8", y1: "16", x2: "8", y2: "16" }),
|
|
1028
|
+
/* @__PURE__ */ l("line", { x1: "16", y1: "16", x2: "16", y2: "16" })
|
|
1029
1029
|
]
|
|
1030
1030
|
}
|
|
1031
1031
|
) : ">"
|
|
1032
1032
|
}
|
|
1033
1033
|
),
|
|
1034
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ l(
|
|
1035
1035
|
"input",
|
|
1036
1036
|
{
|
|
1037
|
-
ref:
|
|
1037
|
+
ref: v,
|
|
1038
1038
|
"data-agent-command-palette-input": !0,
|
|
1039
1039
|
type: "text",
|
|
1040
1040
|
value: o,
|
|
1041
|
-
onChange: (
|
|
1042
|
-
onKeyDown:
|
|
1043
|
-
placeholder:
|
|
1044
|
-
disabled:
|
|
1041
|
+
onChange: (C) => e(C.target.value),
|
|
1042
|
+
onKeyDown: E,
|
|
1043
|
+
placeholder: f,
|
|
1044
|
+
disabled: c || $,
|
|
1045
1045
|
style: {
|
|
1046
1046
|
flex: 1,
|
|
1047
1047
|
backgroundColor: "transparent",
|
|
1048
1048
|
border: "none",
|
|
1049
1049
|
outline: "none",
|
|
1050
|
-
color:
|
|
1051
|
-
fontFamily:
|
|
1052
|
-
fontSize:
|
|
1053
|
-
caretColor:
|
|
1050
|
+
color: p.colors.text,
|
|
1051
|
+
fontFamily: p.fonts.monospace,
|
|
1052
|
+
fontSize: p.fontSizes[1],
|
|
1053
|
+
caretColor: p.colors.primary
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
),
|
|
1057
|
-
$ && /* @__PURE__ */
|
|
1057
|
+
$ && /* @__PURE__ */ y(
|
|
1058
1058
|
"span",
|
|
1059
1059
|
{
|
|
1060
1060
|
style: {
|
|
1061
|
-
color:
|
|
1062
|
-
fontSize:
|
|
1061
|
+
color: p.colors.info,
|
|
1062
|
+
fontSize: p.fontSizes[0],
|
|
1063
1063
|
display: "flex",
|
|
1064
1064
|
alignItems: "center",
|
|
1065
1065
|
gap: "4px"
|
|
1066
1066
|
},
|
|
1067
1067
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ l(
|
|
1069
1069
|
"span",
|
|
1070
1070
|
{
|
|
1071
1071
|
style: {
|
|
@@ -1073,25 +1073,25 @@ const it = ({
|
|
|
1073
1073
|
width: "8px",
|
|
1074
1074
|
height: "8px",
|
|
1075
1075
|
borderRadius: "50%",
|
|
1076
|
-
backgroundColor:
|
|
1076
|
+
backgroundColor: p.colors.info,
|
|
1077
1077
|
animation: "pulse 1s ease-in-out infinite"
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
),
|
|
1081
|
-
|
|
1081
|
+
n === "thinking" ? "Thinking..." : "Executing..."
|
|
1082
1082
|
]
|
|
1083
1083
|
}
|
|
1084
1084
|
),
|
|
1085
|
-
!$ && /* @__PURE__ */
|
|
1085
|
+
!$ && /* @__PURE__ */ l(
|
|
1086
1086
|
"kbd",
|
|
1087
1087
|
{
|
|
1088
1088
|
style: {
|
|
1089
1089
|
padding: "2px 6px",
|
|
1090
|
-
backgroundColor:
|
|
1090
|
+
backgroundColor: p.colors.backgroundSecondary,
|
|
1091
1091
|
borderRadius: "3px",
|
|
1092
|
-
border: `1px solid ${
|
|
1093
|
-
fontSize:
|
|
1094
|
-
color:
|
|
1092
|
+
border: `1px solid ${p.colors.border}`,
|
|
1093
|
+
fontSize: p.fontSizes[0],
|
|
1094
|
+
color: p.colors.textMuted
|
|
1095
1095
|
},
|
|
1096
1096
|
children: "Alt+P"
|
|
1097
1097
|
}
|
|
@@ -1100,9 +1100,9 @@ const it = ({
|
|
|
1100
1100
|
}
|
|
1101
1101
|
);
|
|
1102
1102
|
};
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
const { theme: e } =
|
|
1103
|
+
me.displayName = "AgentCommandInput";
|
|
1104
|
+
const De = ({ status: o }) => {
|
|
1105
|
+
const { theme: e } = U(), t = {
|
|
1106
1106
|
display: "inline-flex",
|
|
1107
1107
|
alignItems: "center",
|
|
1108
1108
|
justifyContent: "center",
|
|
@@ -1112,9 +1112,9 @@ const _e = ({ status: o }) => {
|
|
|
1112
1112
|
};
|
|
1113
1113
|
switch (o) {
|
|
1114
1114
|
case "pending":
|
|
1115
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ l("span", { style: { ...t, color: e.colors.textMuted }, children: "○" });
|
|
1116
1116
|
case "running":
|
|
1117
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ l(
|
|
1118
1118
|
"span",
|
|
1119
1119
|
{
|
|
1120
1120
|
style: {
|
|
@@ -1126,16 +1126,16 @@ const _e = ({ status: o }) => {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
);
|
|
1128
1128
|
case "success":
|
|
1129
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ l("span", { style: { ...t, color: e.colors.success }, children: "✓" });
|
|
1130
1130
|
case "error":
|
|
1131
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ l("span", { style: { ...t, color: e.colors.error }, children: "✗" });
|
|
1132
1132
|
}
|
|
1133
|
-
},
|
|
1133
|
+
}, Me = (o) => {
|
|
1134
1134
|
const e = Object.entries(o);
|
|
1135
1135
|
return e.length === 0 ? "" : e.map(([t, r]) => t === "args" && Array.isArray(r) ? r.join(", ") : typeof r == "string" ? `"${r}"` : JSON.stringify(r)).join(", ");
|
|
1136
|
-
},
|
|
1137
|
-
const { theme: t } =
|
|
1138
|
-
return /* @__PURE__ */
|
|
1136
|
+
}, qe = ({ tool: o, compact: e }) => {
|
|
1137
|
+
const { theme: t } = U(), r = Me(o.args);
|
|
1138
|
+
return /* @__PURE__ */ y(
|
|
1139
1139
|
"div",
|
|
1140
1140
|
{
|
|
1141
1141
|
style: {
|
|
@@ -1147,16 +1147,16 @@ const _e = ({ status: o }) => {
|
|
|
1147
1147
|
fontSize: t.fontSizes[1]
|
|
1148
1148
|
},
|
|
1149
1149
|
children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1150
|
+
/* @__PURE__ */ l(De, { status: o.status }),
|
|
1151
|
+
/* @__PURE__ */ y("span", { style: { color: t.colors.text }, children: [
|
|
1152
1152
|
o.name,
|
|
1153
|
-
r && /* @__PURE__ */
|
|
1153
|
+
r && /* @__PURE__ */ y("span", { style: { color: t.colors.textMuted }, children: [
|
|
1154
1154
|
"(",
|
|
1155
1155
|
r,
|
|
1156
1156
|
")"
|
|
1157
1157
|
] })
|
|
1158
1158
|
] }),
|
|
1159
|
-
o.status === "running" && /* @__PURE__ */
|
|
1159
|
+
o.status === "running" && /* @__PURE__ */ l(
|
|
1160
1160
|
"span",
|
|
1161
1161
|
{
|
|
1162
1162
|
style: {
|
|
@@ -1167,7 +1167,7 @@ const _e = ({ status: o }) => {
|
|
|
1167
1167
|
children: "[running]"
|
|
1168
1168
|
}
|
|
1169
1169
|
),
|
|
1170
|
-
o.status === "success" && /* @__PURE__ */
|
|
1170
|
+
o.status === "success" && /* @__PURE__ */ l(
|
|
1171
1171
|
"span",
|
|
1172
1172
|
{
|
|
1173
1173
|
style: {
|
|
@@ -1178,7 +1178,7 @@ const _e = ({ status: o }) => {
|
|
|
1178
1178
|
children: "[done]"
|
|
1179
1179
|
}
|
|
1180
1180
|
),
|
|
1181
|
-
o.status === "error" && /* @__PURE__ */
|
|
1181
|
+
o.status === "error" && /* @__PURE__ */ l(
|
|
1182
1182
|
"span",
|
|
1183
1183
|
{
|
|
1184
1184
|
style: {
|
|
@@ -1193,12 +1193,12 @@ const _e = ({ status: o }) => {
|
|
|
1193
1193
|
]
|
|
1194
1194
|
}
|
|
1195
1195
|
);
|
|
1196
|
-
},
|
|
1196
|
+
}, ye = ({
|
|
1197
1197
|
tools: o,
|
|
1198
1198
|
compact: e = !1
|
|
1199
1199
|
}) => {
|
|
1200
|
-
const { theme: t } =
|
|
1201
|
-
return o.length === 0 ? null : /* @__PURE__ */
|
|
1200
|
+
const { theme: t } = U();
|
|
1201
|
+
return o.length === 0 ? null : /* @__PURE__ */ l(
|
|
1202
1202
|
"div",
|
|
1203
1203
|
{
|
|
1204
1204
|
style: {
|
|
@@ -1207,36 +1207,36 @@ const _e = ({ status: o }) => {
|
|
|
1207
1207
|
borderRadius: "4px",
|
|
1208
1208
|
margin: "8px 16px"
|
|
1209
1209
|
},
|
|
1210
|
-
children: o.map((r) => /* @__PURE__ */
|
|
1210
|
+
children: o.map((r) => /* @__PURE__ */ l(qe, { tool: r, compact: e }, r.id))
|
|
1211
1211
|
}
|
|
1212
1212
|
);
|
|
1213
1213
|
};
|
|
1214
|
-
|
|
1215
|
-
const
|
|
1214
|
+
ye.displayName = "ToolExecutionList";
|
|
1215
|
+
const ke = ({
|
|
1216
1216
|
response: o,
|
|
1217
1217
|
streaming: e = !1
|
|
1218
1218
|
}) => {
|
|
1219
|
-
const { theme: t } =
|
|
1219
|
+
const { theme: t } = U();
|
|
1220
1220
|
if (!o)
|
|
1221
1221
|
return null;
|
|
1222
|
-
const r = o.toLowerCase().startsWith("error"),
|
|
1223
|
-
return /* @__PURE__ */
|
|
1222
|
+
const r = o.toLowerCase().startsWith("error"), s = o.toLowerCase().startsWith("done") || o.toLowerCase().startsWith("executed");
|
|
1223
|
+
return /* @__PURE__ */ y(
|
|
1224
1224
|
"div",
|
|
1225
1225
|
{
|
|
1226
1226
|
style: {
|
|
1227
1227
|
padding: "12px 16px",
|
|
1228
|
-
color: r ? t.colors.error :
|
|
1228
|
+
color: r ? t.colors.error : s ? t.colors.success : t.colors.text,
|
|
1229
1229
|
fontSize: t.fontSizes[1],
|
|
1230
1230
|
display: "flex",
|
|
1231
1231
|
alignItems: "center",
|
|
1232
1232
|
gap: "8px"
|
|
1233
1233
|
},
|
|
1234
1234
|
children: [
|
|
1235
|
-
|
|
1236
|
-
r && /* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1235
|
+
s && /* @__PURE__ */ l("span", { children: "✓" }),
|
|
1236
|
+
r && /* @__PURE__ */ l("span", { children: "✗" }),
|
|
1237
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1238
1238
|
o,
|
|
1239
|
-
e && /* @__PURE__ */
|
|
1239
|
+
e && /* @__PURE__ */ l(
|
|
1240
1240
|
"span",
|
|
1241
1241
|
{
|
|
1242
1242
|
style: {
|
|
@@ -1254,76 +1254,177 @@ const pe = ({
|
|
|
1254
1254
|
}
|
|
1255
1255
|
);
|
|
1256
1256
|
};
|
|
1257
|
-
|
|
1258
|
-
function
|
|
1257
|
+
ke.displayName = "AgentResponseDisplay";
|
|
1258
|
+
function fe({
|
|
1259
1259
|
text: o,
|
|
1260
1260
|
matchedIndices: e,
|
|
1261
1261
|
highlightColor: t
|
|
1262
1262
|
}) {
|
|
1263
1263
|
if (!e.length)
|
|
1264
|
-
return /* @__PURE__ */
|
|
1265
|
-
const r = new Set(e),
|
|
1266
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ l(de, { children: o });
|
|
1265
|
+
const r = new Set(e), s = o.split("");
|
|
1266
|
+
return /* @__PURE__ */ l(de, { children: s.map((i, a) => /* @__PURE__ */ l(
|
|
1267
1267
|
"span",
|
|
1268
1268
|
{
|
|
1269
1269
|
style: {
|
|
1270
|
-
color: r.has(
|
|
1271
|
-
fontWeight: r.has(
|
|
1270
|
+
color: r.has(a) ? t : "inherit",
|
|
1271
|
+
fontWeight: r.has(a) ? 600 : "inherit"
|
|
1272
1272
|
},
|
|
1273
|
-
children:
|
|
1273
|
+
children: i
|
|
1274
1274
|
},
|
|
1275
|
-
|
|
1275
|
+
a
|
|
1276
1276
|
)) });
|
|
1277
1277
|
}
|
|
1278
|
-
const
|
|
1278
|
+
const xe = ({
|
|
1279
1279
|
matches: o,
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1280
|
+
argumentMatches: e = [],
|
|
1281
|
+
currentArg: t,
|
|
1282
|
+
isEnteringArgs: r = !1,
|
|
1283
|
+
selectedIndex: s,
|
|
1284
|
+
onSelect: i,
|
|
1285
|
+
maxVisible: a = 6
|
|
1283
1286
|
}) => {
|
|
1284
|
-
const { theme: n } =
|
|
1287
|
+
const { theme: n } = U(), f = V(null), c = V(null);
|
|
1285
1288
|
if (R(() => {
|
|
1286
|
-
|
|
1289
|
+
c.current && f.current && c.current.scrollIntoView({
|
|
1287
1290
|
block: "nearest",
|
|
1288
1291
|
behavior: "smooth"
|
|
1289
1292
|
});
|
|
1290
|
-
}, [
|
|
1293
|
+
}, [s]), r && e.length > 0) {
|
|
1294
|
+
const w = 40 * a;
|
|
1295
|
+
return /* @__PURE__ */ y(
|
|
1296
|
+
"div",
|
|
1297
|
+
{
|
|
1298
|
+
ref: f,
|
|
1299
|
+
style: {
|
|
1300
|
+
maxHeight: `${w}px`,
|
|
1301
|
+
overflowY: "auto",
|
|
1302
|
+
borderTop: `1px solid ${n.colors.border}`
|
|
1303
|
+
},
|
|
1304
|
+
children: [
|
|
1305
|
+
t && /* @__PURE__ */ y(
|
|
1306
|
+
"div",
|
|
1307
|
+
{
|
|
1308
|
+
style: {
|
|
1309
|
+
padding: "8px 16px",
|
|
1310
|
+
fontSize: n.fontSizes[0],
|
|
1311
|
+
color: n.colors.textMuted,
|
|
1312
|
+
backgroundColor: n.colors.backgroundSecondary,
|
|
1313
|
+
borderBottom: `1px solid ${n.colors.border}`
|
|
1314
|
+
},
|
|
1315
|
+
children: [
|
|
1316
|
+
/* @__PURE__ */ l("span", { style: { color: n.colors.textSecondary }, children: t.name }),
|
|
1317
|
+
t.description && /* @__PURE__ */ y("span", { style: { marginLeft: "8px" }, children: [
|
|
1318
|
+
"— ",
|
|
1319
|
+
t.description
|
|
1320
|
+
] })
|
|
1321
|
+
]
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
e.map((u, d) => {
|
|
1325
|
+
const p = d === s;
|
|
1326
|
+
return /* @__PURE__ */ y(
|
|
1327
|
+
"div",
|
|
1328
|
+
{
|
|
1329
|
+
ref: p ? c : void 0,
|
|
1330
|
+
onClick: () => i(d),
|
|
1331
|
+
style: {
|
|
1332
|
+
display: "flex",
|
|
1333
|
+
alignItems: "center",
|
|
1334
|
+
gap: "12px",
|
|
1335
|
+
padding: "8px 16px",
|
|
1336
|
+
cursor: "pointer",
|
|
1337
|
+
backgroundColor: p ? n.colors.backgroundSecondary : "transparent",
|
|
1338
|
+
borderLeft: p ? `2px solid ${n.colors.primary}` : "2px solid transparent",
|
|
1339
|
+
transition: "background-color 100ms ease"
|
|
1340
|
+
},
|
|
1341
|
+
onMouseEnter: (v) => {
|
|
1342
|
+
p || (v.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
|
|
1343
|
+
},
|
|
1344
|
+
onMouseLeave: (v) => {
|
|
1345
|
+
p || (v.currentTarget.style.backgroundColor = "transparent");
|
|
1346
|
+
},
|
|
1347
|
+
children: [
|
|
1348
|
+
/* @__PURE__ */ l(
|
|
1349
|
+
"span",
|
|
1350
|
+
{
|
|
1351
|
+
style: {
|
|
1352
|
+
fontFamily: n.fonts.monospace,
|
|
1353
|
+
fontSize: n.fontSizes[1],
|
|
1354
|
+
color: n.colors.text,
|
|
1355
|
+
flex: 1
|
|
1356
|
+
},
|
|
1357
|
+
children: /* @__PURE__ */ l(
|
|
1358
|
+
fe,
|
|
1359
|
+
{
|
|
1360
|
+
text: u.option,
|
|
1361
|
+
matchedIndices: u.matchedIndices,
|
|
1362
|
+
highlightColor: n.colors.primary
|
|
1363
|
+
}
|
|
1364
|
+
)
|
|
1365
|
+
}
|
|
1366
|
+
),
|
|
1367
|
+
p && /* @__PURE__ */ l(
|
|
1368
|
+
"kbd",
|
|
1369
|
+
{
|
|
1370
|
+
style: {
|
|
1371
|
+
padding: "2px 6px",
|
|
1372
|
+
backgroundColor: n.colors.backgroundTertiary,
|
|
1373
|
+
borderRadius: "3px",
|
|
1374
|
+
border: `1px solid ${n.colors.border}`,
|
|
1375
|
+
fontSize: n.fontSizes[0],
|
|
1376
|
+
color: n.colors.textMuted,
|
|
1377
|
+
flexShrink: 0
|
|
1378
|
+
},
|
|
1379
|
+
children: "Tab"
|
|
1380
|
+
}
|
|
1381
|
+
)
|
|
1382
|
+
]
|
|
1383
|
+
},
|
|
1384
|
+
`${u.option}-${d}`
|
|
1385
|
+
);
|
|
1386
|
+
})
|
|
1387
|
+
]
|
|
1388
|
+
}
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
if (o.length === 0)
|
|
1291
1392
|
return null;
|
|
1292
|
-
const
|
|
1293
|
-
return /* @__PURE__ */
|
|
1393
|
+
const h = 48 * a;
|
|
1394
|
+
return /* @__PURE__ */ l(
|
|
1294
1395
|
"div",
|
|
1295
1396
|
{
|
|
1296
|
-
ref:
|
|
1397
|
+
ref: f,
|
|
1297
1398
|
style: {
|
|
1298
|
-
maxHeight: `${
|
|
1399
|
+
maxHeight: `${h}px`,
|
|
1299
1400
|
overflowY: "auto",
|
|
1300
1401
|
borderTop: `1px solid ${n.colors.border}`
|
|
1301
1402
|
},
|
|
1302
|
-
children: o.map((
|
|
1303
|
-
const
|
|
1304
|
-
return /* @__PURE__ */
|
|
1403
|
+
children: o.map((m, w) => {
|
|
1404
|
+
const u = w === s, d = m.command;
|
|
1405
|
+
return /* @__PURE__ */ y(
|
|
1305
1406
|
"div",
|
|
1306
1407
|
{
|
|
1307
|
-
ref:
|
|
1308
|
-
onClick: () =>
|
|
1408
|
+
ref: u ? c : void 0,
|
|
1409
|
+
onClick: () => i(w),
|
|
1309
1410
|
style: {
|
|
1310
1411
|
display: "flex",
|
|
1311
1412
|
alignItems: "center",
|
|
1312
1413
|
gap: "12px",
|
|
1313
1414
|
padding: "10px 16px",
|
|
1314
1415
|
cursor: "pointer",
|
|
1315
|
-
backgroundColor:
|
|
1316
|
-
borderLeft:
|
|
1416
|
+
backgroundColor: u ? n.colors.backgroundSecondary : "transparent",
|
|
1417
|
+
borderLeft: u ? `2px solid ${n.colors.primary}` : "2px solid transparent",
|
|
1317
1418
|
transition: "background-color 100ms ease"
|
|
1318
1419
|
},
|
|
1319
|
-
onMouseEnter: (
|
|
1320
|
-
|
|
1420
|
+
onMouseEnter: (p) => {
|
|
1421
|
+
u || (p.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
|
|
1321
1422
|
},
|
|
1322
|
-
onMouseLeave: (
|
|
1323
|
-
|
|
1423
|
+
onMouseLeave: (p) => {
|
|
1424
|
+
u || (p.currentTarget.style.backgroundColor = "transparent");
|
|
1324
1425
|
},
|
|
1325
1426
|
children: [
|
|
1326
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ l(
|
|
1327
1428
|
"span",
|
|
1328
1429
|
{
|
|
1329
1430
|
style: {
|
|
@@ -1335,8 +1436,8 @@ const ue = ({
|
|
|
1335
1436
|
children: "/"
|
|
1336
1437
|
}
|
|
1337
1438
|
),
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ y("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1440
|
+
/* @__PURE__ */ y(
|
|
1340
1441
|
"div",
|
|
1341
1442
|
{
|
|
1342
1443
|
style: {
|
|
@@ -1345,15 +1446,15 @@ const ue = ({
|
|
|
1345
1446
|
color: n.colors.text
|
|
1346
1447
|
},
|
|
1347
1448
|
children: [
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
|
|
1449
|
+
/* @__PURE__ */ l(
|
|
1450
|
+
fe,
|
|
1350
1451
|
{
|
|
1351
|
-
text:
|
|
1352
|
-
matchedIndices:
|
|
1452
|
+
text: d.name,
|
|
1453
|
+
matchedIndices: m.matchedOn === d.name ? m.matchedIndices : [],
|
|
1353
1454
|
highlightColor: n.colors.primary
|
|
1354
1455
|
}
|
|
1355
1456
|
),
|
|
1356
|
-
|
|
1457
|
+
m.matchedOn !== d.name && /* @__PURE__ */ y(
|
|
1357
1458
|
"span",
|
|
1358
1459
|
{
|
|
1359
1460
|
style: {
|
|
@@ -1363,7 +1464,7 @@ const ue = ({
|
|
|
1363
1464
|
},
|
|
1364
1465
|
children: [
|
|
1365
1466
|
"(alias: ",
|
|
1366
|
-
|
|
1467
|
+
m.matchedOn,
|
|
1367
1468
|
")"
|
|
1368
1469
|
]
|
|
1369
1470
|
}
|
|
@@ -1371,7 +1472,7 @@ const ue = ({
|
|
|
1371
1472
|
]
|
|
1372
1473
|
}
|
|
1373
1474
|
),
|
|
1374
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ l(
|
|
1375
1476
|
"div",
|
|
1376
1477
|
{
|
|
1377
1478
|
style: {
|
|
@@ -1382,11 +1483,11 @@ const ue = ({
|
|
|
1382
1483
|
overflow: "hidden",
|
|
1383
1484
|
textOverflow: "ellipsis"
|
|
1384
1485
|
},
|
|
1385
|
-
children:
|
|
1486
|
+
children: d.description
|
|
1386
1487
|
}
|
|
1387
1488
|
)
|
|
1388
1489
|
] }),
|
|
1389
|
-
|
|
1490
|
+
d.args && d.args.length > 0 && /* @__PURE__ */ l(
|
|
1390
1491
|
"div",
|
|
1391
1492
|
{
|
|
1392
1493
|
style: {
|
|
@@ -1395,21 +1496,21 @@ const ue = ({
|
|
|
1395
1496
|
fontFamily: n.fonts.monospace,
|
|
1396
1497
|
flexShrink: 0
|
|
1397
1498
|
},
|
|
1398
|
-
children:
|
|
1399
|
-
|
|
1400
|
-
/* @__PURE__ */
|
|
1499
|
+
children: d.args.map((p, v) => /* @__PURE__ */ y("span", { children: [
|
|
1500
|
+
v > 0 && " ",
|
|
1501
|
+
/* @__PURE__ */ l(
|
|
1401
1502
|
"span",
|
|
1402
1503
|
{
|
|
1403
1504
|
style: {
|
|
1404
|
-
color:
|
|
1505
|
+
color: p.required ? n.colors.warning : n.colors.textMuted
|
|
1405
1506
|
},
|
|
1406
|
-
children:
|
|
1507
|
+
children: p.required ? `<${p.name}>` : `[${p.name}]`
|
|
1407
1508
|
}
|
|
1408
1509
|
)
|
|
1409
|
-
] },
|
|
1510
|
+
] }, p.name))
|
|
1410
1511
|
}
|
|
1411
1512
|
),
|
|
1412
|
-
|
|
1513
|
+
u && /* @__PURE__ */ l(
|
|
1413
1514
|
"kbd",
|
|
1414
1515
|
{
|
|
1415
1516
|
style: {
|
|
@@ -1426,71 +1527,74 @@ const ue = ({
|
|
|
1426
1527
|
)
|
|
1427
1528
|
]
|
|
1428
1529
|
},
|
|
1429
|
-
`${
|
|
1530
|
+
`${d.name}-${w}`
|
|
1430
1531
|
);
|
|
1431
1532
|
})
|
|
1432
1533
|
}
|
|
1433
1534
|
);
|
|
1434
1535
|
};
|
|
1435
|
-
|
|
1436
|
-
const
|
|
1536
|
+
xe.displayName = "QuickCommandAutocomplete";
|
|
1537
|
+
const je = ({
|
|
1437
1538
|
palette: o,
|
|
1438
1539
|
config: e
|
|
1439
1540
|
}) => {
|
|
1440
|
-
const { theme: t } =
|
|
1441
|
-
isOpen:
|
|
1442
|
-
close:
|
|
1443
|
-
query:
|
|
1444
|
-
setQuery:
|
|
1445
|
-
mode:
|
|
1446
|
-
status:
|
|
1447
|
-
pendingTools:
|
|
1448
|
-
completedTools:
|
|
1449
|
-
agentResponse:
|
|
1450
|
-
submit:
|
|
1451
|
-
historyPrevious:
|
|
1541
|
+
const { theme: t } = U(), r = V(null), {
|
|
1542
|
+
isOpen: s,
|
|
1543
|
+
close: i,
|
|
1544
|
+
query: a,
|
|
1545
|
+
setQuery: n,
|
|
1546
|
+
mode: f,
|
|
1547
|
+
status: c,
|
|
1548
|
+
pendingTools: x,
|
|
1549
|
+
completedTools: h,
|
|
1550
|
+
agentResponse: m,
|
|
1551
|
+
submit: w,
|
|
1552
|
+
historyPrevious: u,
|
|
1452
1553
|
historyNext: d,
|
|
1453
|
-
suggestions:
|
|
1454
|
-
agentAvailable:
|
|
1554
|
+
suggestions: p,
|
|
1555
|
+
agentAvailable: v,
|
|
1455
1556
|
// Autocomplete
|
|
1456
|
-
quickCommandMatches:
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1557
|
+
quickCommandMatches: E,
|
|
1558
|
+
argumentOptionMatches: $,
|
|
1559
|
+
parsedQuery: C,
|
|
1560
|
+
currentArgDef: _,
|
|
1561
|
+
selectedAutocompleteIndex: b,
|
|
1562
|
+
autocompleteNext: T,
|
|
1563
|
+
autocompletePrevious: S,
|
|
1564
|
+
autocompleteAccept: I,
|
|
1565
|
+
showAutocomplete: z
|
|
1462
1566
|
} = o;
|
|
1463
1567
|
R(() => {
|
|
1464
|
-
if (!
|
|
1465
|
-
const
|
|
1466
|
-
r.current && !r.current.contains(
|
|
1467
|
-
},
|
|
1468
|
-
document.addEventListener("mousedown",
|
|
1568
|
+
if (!s) return;
|
|
1569
|
+
const F = (D) => {
|
|
1570
|
+
r.current && !r.current.contains(D.target) && i();
|
|
1571
|
+
}, H = setTimeout(() => {
|
|
1572
|
+
document.addEventListener("mousedown", F);
|
|
1469
1573
|
}, 100);
|
|
1470
1574
|
return () => {
|
|
1471
|
-
clearTimeout(
|
|
1575
|
+
clearTimeout(H), document.removeEventListener("mousedown", F);
|
|
1472
1576
|
};
|
|
1473
|
-
}, [
|
|
1474
|
-
const [
|
|
1577
|
+
}, [s, i]);
|
|
1578
|
+
const [W, A] = P(!1), [G, K] = P(!1);
|
|
1475
1579
|
if (R(() => {
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1580
|
+
if (s)
|
|
1581
|
+
K(!0), requestAnimationFrame(() => {
|
|
1478
1582
|
requestAnimationFrame(() => {
|
|
1479
|
-
|
|
1583
|
+
A(!0);
|
|
1480
1584
|
});
|
|
1481
1585
|
});
|
|
1482
1586
|
else {
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1587
|
+
A(!1);
|
|
1588
|
+
const F = setTimeout(() => {
|
|
1589
|
+
K(!1);
|
|
1486
1590
|
}, 150);
|
|
1487
|
-
return () => clearTimeout(
|
|
1591
|
+
return () => clearTimeout(F);
|
|
1488
1592
|
}
|
|
1489
|
-
}, [
|
|
1593
|
+
}, [s]), !G)
|
|
1490
1594
|
return null;
|
|
1491
|
-
const
|
|
1492
|
-
return /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1595
|
+
const ie = v ? (e == null ? void 0 : e.placeholder) || "What would you like to do?" : "Quick command mode (agent unavailable)", B = [...h, ...x], Z = B.length > 0, le = m && c !== "idle", re = v && !a && c === "idle" && p.length > 0, ee = (f === "quick-command" || !v) && c === "idle", ne = !v && f !== "quick-command" && c === "idle";
|
|
1596
|
+
return /* @__PURE__ */ y(de, { children: [
|
|
1597
|
+
/* @__PURE__ */ l(
|
|
1494
1598
|
"div",
|
|
1495
1599
|
{
|
|
1496
1600
|
style: {
|
|
@@ -1498,10 +1602,10 @@ const De = ({
|
|
|
1498
1602
|
inset: 0,
|
|
1499
1603
|
zIndex: 999
|
|
1500
1604
|
},
|
|
1501
|
-
onClick:
|
|
1605
|
+
onClick: i
|
|
1502
1606
|
}
|
|
1503
1607
|
),
|
|
1504
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ y(
|
|
1505
1609
|
"div",
|
|
1506
1610
|
{
|
|
1507
1611
|
ref: r,
|
|
@@ -1512,39 +1616,39 @@ const De = ({
|
|
|
1512
1616
|
left: 0,
|
|
1513
1617
|
right: 0,
|
|
1514
1618
|
maxHeight: "50vh",
|
|
1515
|
-
backgroundColor: t.colors.
|
|
1619
|
+
backgroundColor: t.colors.background,
|
|
1516
1620
|
borderTop: `1px solid ${t.colors.border}`,
|
|
1517
1621
|
boxShadow: t.shadows[2],
|
|
1518
1622
|
zIndex: 1e3,
|
|
1519
1623
|
display: "flex",
|
|
1520
1624
|
flexDirection: "column-reverse",
|
|
1521
1625
|
overflow: "hidden",
|
|
1522
|
-
transform:
|
|
1626
|
+
transform: W ? "translateY(0)" : "translateY(100%)",
|
|
1523
1627
|
transition: "transform 150ms ease-out",
|
|
1524
1628
|
...e == null ? void 0 : e.style
|
|
1525
1629
|
},
|
|
1526
1630
|
children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
-
|
|
1631
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1632
|
+
/* @__PURE__ */ l(
|
|
1633
|
+
me,
|
|
1530
1634
|
{
|
|
1531
|
-
value:
|
|
1532
|
-
onChange:
|
|
1533
|
-
onSubmit:
|
|
1534
|
-
onClose:
|
|
1535
|
-
onHistoryPrevious:
|
|
1635
|
+
value: a,
|
|
1636
|
+
onChange: n,
|
|
1637
|
+
onSubmit: w,
|
|
1638
|
+
onClose: i,
|
|
1639
|
+
onHistoryPrevious: u,
|
|
1536
1640
|
onHistoryNext: d,
|
|
1537
|
-
mode:
|
|
1538
|
-
status:
|
|
1539
|
-
placeholder:
|
|
1540
|
-
agentAvailable:
|
|
1541
|
-
showAutocomplete:
|
|
1542
|
-
onAutocompleteNext:
|
|
1543
|
-
onAutocompletePrevious:
|
|
1544
|
-
onAutocompleteAccept:
|
|
1641
|
+
mode: f,
|
|
1642
|
+
status: c,
|
|
1643
|
+
placeholder: ie,
|
|
1644
|
+
agentAvailable: v,
|
|
1645
|
+
showAutocomplete: z,
|
|
1646
|
+
onAutocompleteNext: T,
|
|
1647
|
+
onAutocompletePrevious: S,
|
|
1648
|
+
onAutocompleteAccept: I
|
|
1545
1649
|
}
|
|
1546
1650
|
),
|
|
1547
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ y(
|
|
1548
1652
|
"div",
|
|
1549
1653
|
{
|
|
1550
1654
|
style: {
|
|
@@ -1557,8 +1661,8 @@ const De = ({
|
|
|
1557
1661
|
backgroundColor: t.colors.background
|
|
1558
1662
|
},
|
|
1559
1663
|
children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1665
|
+
/* @__PURE__ */ l(
|
|
1562
1666
|
"kbd",
|
|
1563
1667
|
{
|
|
1564
1668
|
style: {
|
|
@@ -1573,8 +1677,8 @@ const De = ({
|
|
|
1573
1677
|
" ",
|
|
1574
1678
|
"Execute"
|
|
1575
1679
|
] }),
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1681
|
+
/* @__PURE__ */ l(
|
|
1578
1682
|
"kbd",
|
|
1579
1683
|
{
|
|
1580
1684
|
style: {
|
|
@@ -1589,8 +1693,8 @@ const De = ({
|
|
|
1589
1693
|
" ",
|
|
1590
1694
|
"Close"
|
|
1591
1695
|
] }),
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1697
|
+
/* @__PURE__ */ l(
|
|
1594
1698
|
"kbd",
|
|
1595
1699
|
{
|
|
1596
1700
|
style: {
|
|
@@ -1605,8 +1709,8 @@ const De = ({
|
|
|
1605
1709
|
" ",
|
|
1606
1710
|
"History"
|
|
1607
1711
|
] }),
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ y("span", { style: { marginLeft: "auto" }, children: [
|
|
1713
|
+
/* @__PURE__ */ l(
|
|
1610
1714
|
"kbd",
|
|
1611
1715
|
{
|
|
1612
1716
|
style: {
|
|
@@ -1625,16 +1729,16 @@ const De = ({
|
|
|
1625
1729
|
}
|
|
1626
1730
|
)
|
|
1627
1731
|
] }),
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1732
|
+
/* @__PURE__ */ y("div", { style: { overflow: "auto" }, children: [
|
|
1733
|
+
Z && /* @__PURE__ */ l(ye, { tools: B, compact: B.length > 3 }),
|
|
1734
|
+
le && /* @__PURE__ */ l(
|
|
1735
|
+
ke,
|
|
1632
1736
|
{
|
|
1633
|
-
response:
|
|
1634
|
-
streaming:
|
|
1737
|
+
response: m,
|
|
1738
|
+
streaming: c === "thinking"
|
|
1635
1739
|
}
|
|
1636
1740
|
),
|
|
1637
|
-
|
|
1741
|
+
re && /* @__PURE__ */ y(
|
|
1638
1742
|
"div",
|
|
1639
1743
|
{
|
|
1640
1744
|
style: {
|
|
@@ -1644,7 +1748,7 @@ const De = ({
|
|
|
1644
1748
|
flexWrap: "wrap"
|
|
1645
1749
|
},
|
|
1646
1750
|
children: [
|
|
1647
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ l(
|
|
1648
1752
|
"span",
|
|
1649
1753
|
{
|
|
1650
1754
|
style: {
|
|
@@ -1655,11 +1759,11 @@ const De = ({
|
|
|
1655
1759
|
children: "Try:"
|
|
1656
1760
|
}
|
|
1657
1761
|
),
|
|
1658
|
-
|
|
1762
|
+
p.map((F, H) => /* @__PURE__ */ y(
|
|
1659
1763
|
"button",
|
|
1660
1764
|
{
|
|
1661
1765
|
onClick: () => {
|
|
1662
|
-
|
|
1766
|
+
n(F);
|
|
1663
1767
|
},
|
|
1664
1768
|
style: {
|
|
1665
1769
|
padding: "4px 10px",
|
|
@@ -1671,24 +1775,24 @@ const De = ({
|
|
|
1671
1775
|
cursor: "pointer",
|
|
1672
1776
|
transition: "background-color 150ms ease"
|
|
1673
1777
|
},
|
|
1674
|
-
onMouseEnter: (
|
|
1675
|
-
|
|
1778
|
+
onMouseEnter: (D) => {
|
|
1779
|
+
D.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
|
|
1676
1780
|
},
|
|
1677
|
-
onMouseLeave: (
|
|
1678
|
-
|
|
1781
|
+
onMouseLeave: (D) => {
|
|
1782
|
+
D.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
|
|
1679
1783
|
},
|
|
1680
1784
|
children: [
|
|
1681
1785
|
'"',
|
|
1682
|
-
|
|
1786
|
+
F,
|
|
1683
1787
|
'"'
|
|
1684
1788
|
]
|
|
1685
1789
|
},
|
|
1686
|
-
|
|
1790
|
+
H
|
|
1687
1791
|
))
|
|
1688
1792
|
]
|
|
1689
1793
|
}
|
|
1690
1794
|
),
|
|
1691
|
-
|
|
1795
|
+
ne && /* @__PURE__ */ y(
|
|
1692
1796
|
"div",
|
|
1693
1797
|
{
|
|
1694
1798
|
style: {
|
|
@@ -1700,10 +1804,10 @@ const De = ({
|
|
|
1700
1804
|
gap: "8px"
|
|
1701
1805
|
},
|
|
1702
1806
|
children: [
|
|
1703
|
-
/* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ l("span", { children: "Agent unavailable." }),
|
|
1808
|
+
/* @__PURE__ */ y("span", { style: { color: t.colors.textMuted }, children: [
|
|
1705
1809
|
"Use quick commands (start with ",
|
|
1706
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ l("kbd", { style: {
|
|
1707
1811
|
padding: "2px 6px",
|
|
1708
1812
|
backgroundColor: t.colors.backgroundSecondary,
|
|
1709
1813
|
borderRadius: "3px",
|
|
@@ -1714,7 +1818,7 @@ const De = ({
|
|
|
1714
1818
|
]
|
|
1715
1819
|
}
|
|
1716
1820
|
),
|
|
1717
|
-
|
|
1821
|
+
ee && /* @__PURE__ */ y(
|
|
1718
1822
|
"div",
|
|
1719
1823
|
{
|
|
1720
1824
|
style: {
|
|
@@ -1724,29 +1828,29 @@ const De = ({
|
|
|
1724
1828
|
fontFamily: t.fonts.monospace
|
|
1725
1829
|
},
|
|
1726
1830
|
children: [
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ l("div", { style: { marginBottom: "8px", color: t.colors.textSecondary }, children: "Quick commands:" }),
|
|
1832
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
1833
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1834
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/toggle" }),
|
|
1731
1835
|
" ",
|
|
1732
|
-
/* @__PURE__ */
|
|
1836
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.textMuted }, children: "<left|right>" }),
|
|
1733
1837
|
" ",
|
|
1734
1838
|
"- Toggle sidebar visibility"
|
|
1735
1839
|
] }),
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */
|
|
1840
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1841
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/switch" }),
|
|
1738
1842
|
" ",
|
|
1739
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.textMuted }, children: "<slot> <panel>" }),
|
|
1740
1844
|
" ",
|
|
1741
1845
|
"- Switch panel content"
|
|
1742
1846
|
] }),
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1848
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/collapse" }),
|
|
1745
1849
|
" ",
|
|
1746
1850
|
"- Collapse all sidebars"
|
|
1747
1851
|
] }),
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1853
|
+
/* @__PURE__ */ l("span", { style: { color: t.colors.info }, children: "/expand" }),
|
|
1750
1854
|
" ",
|
|
1751
1855
|
"- Expand all sidebars"
|
|
1752
1856
|
] })
|
|
@@ -1754,17 +1858,33 @@ const De = ({
|
|
|
1754
1858
|
]
|
|
1755
1859
|
}
|
|
1756
1860
|
),
|
|
1757
|
-
|
|
1758
|
-
|
|
1861
|
+
z && /* @__PURE__ */ l(
|
|
1862
|
+
xe,
|
|
1759
1863
|
{
|
|
1760
|
-
matches:
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1864
|
+
matches: E,
|
|
1865
|
+
argumentMatches: $,
|
|
1866
|
+
currentArg: _,
|
|
1867
|
+
isEnteringArgs: C.isEnteringArgs,
|
|
1868
|
+
selectedIndex: b,
|
|
1869
|
+
onSelect: (F) => {
|
|
1870
|
+
var D;
|
|
1871
|
+
if (C.isEnteringArgs) {
|
|
1872
|
+
const Q = $[F];
|
|
1873
|
+
if (Q) {
|
|
1874
|
+
let Y = `/${C.commandName}`;
|
|
1875
|
+
for (const se of C.enteredArgs)
|
|
1876
|
+
Y += ` ${se}`;
|
|
1877
|
+
Y += ` ${Q.option}`;
|
|
1878
|
+
const ce = C.currentArgIndex + 1;
|
|
1879
|
+
((D = C.command) == null ? void 0 : D.args) && ce < C.command.args.length && (Y += " "), n(Y);
|
|
1880
|
+
}
|
|
1881
|
+
return;
|
|
1882
|
+
}
|
|
1883
|
+
const H = E[F];
|
|
1884
|
+
if (H) {
|
|
1885
|
+
const Q = H.command;
|
|
1886
|
+
let Y = `/${Q.name}`;
|
|
1887
|
+
Q.args && Q.args.length > 0 && (Y += " "), n(Y);
|
|
1768
1888
|
}
|
|
1769
1889
|
}
|
|
1770
1890
|
}
|
|
@@ -1773,7 +1893,7 @@ const De = ({
|
|
|
1773
1893
|
]
|
|
1774
1894
|
}
|
|
1775
1895
|
),
|
|
1776
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ l("style", { children: `
|
|
1777
1897
|
@keyframes pulse {
|
|
1778
1898
|
0%, 100% { opacity: 1; }
|
|
1779
1899
|
50% { opacity: 0.5; }
|
|
@@ -1789,166 +1909,248 @@ const De = ({
|
|
|
1789
1909
|
` })
|
|
1790
1910
|
] });
|
|
1791
1911
|
};
|
|
1792
|
-
|
|
1793
|
-
function
|
|
1912
|
+
je.displayName = "AgentCommandPalette";
|
|
1913
|
+
function pe(o, e) {
|
|
1794
1914
|
const t = o.toLowerCase(), r = e.toLowerCase();
|
|
1795
1915
|
if (!t)
|
|
1796
1916
|
return { score: 0, matchedIndices: [] };
|
|
1797
|
-
const
|
|
1798
|
-
let
|
|
1799
|
-
for (let
|
|
1800
|
-
r[
|
|
1801
|
-
return
|
|
1917
|
+
const s = [];
|
|
1918
|
+
let i = 0, a = 0, n = 0, f = -1;
|
|
1919
|
+
for (let c = 0; c < r.length && i < t.length; c++)
|
|
1920
|
+
r[c] === t[i] && (s.push(c), f === c - 1 ? (n++, a += n * 2) : n = 1, c === 0 && (a += 10), c > 0 && /[_\-\s]/.test(e[c - 1]) && (a += 5), a += 1, f = c, i++);
|
|
1921
|
+
return i < t.length ? null : (a -= e.length * 0.1, t === r && (a += 20), r.startsWith(t) && (a += 15), { score: a, matchedIndices: s });
|
|
1802
1922
|
}
|
|
1803
|
-
function
|
|
1923
|
+
function Oe(o, e, t = 10) {
|
|
1804
1924
|
const r = o.replace(/^\//, "").trim();
|
|
1805
1925
|
if (!r)
|
|
1806
|
-
return e.slice(0, t).map((
|
|
1807
|
-
command:
|
|
1926
|
+
return e.slice(0, t).map((i) => ({
|
|
1927
|
+
command: i,
|
|
1808
1928
|
score: 0,
|
|
1809
1929
|
matchedIndices: [],
|
|
1810
|
-
matchedOn:
|
|
1930
|
+
matchedOn: i.name
|
|
1811
1931
|
}));
|
|
1812
|
-
const
|
|
1813
|
-
for (const
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
1817
|
-
command:
|
|
1818
|
-
score:
|
|
1819
|
-
matchedIndices:
|
|
1820
|
-
matchedOn:
|
|
1932
|
+
const s = [];
|
|
1933
|
+
for (const i of e) {
|
|
1934
|
+
const a = pe(r, i.name);
|
|
1935
|
+
if (a) {
|
|
1936
|
+
s.push({
|
|
1937
|
+
command: i,
|
|
1938
|
+
score: a.score,
|
|
1939
|
+
matchedIndices: a.matchedIndices,
|
|
1940
|
+
matchedOn: i.name
|
|
1821
1941
|
});
|
|
1822
1942
|
continue;
|
|
1823
1943
|
}
|
|
1824
|
-
if (
|
|
1825
|
-
for (const
|
|
1826
|
-
const
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1829
|
-
command:
|
|
1830
|
-
score:
|
|
1944
|
+
if (i.aliases)
|
|
1945
|
+
for (const n of i.aliases) {
|
|
1946
|
+
const f = pe(r, n);
|
|
1947
|
+
if (f) {
|
|
1948
|
+
s.push({
|
|
1949
|
+
command: i,
|
|
1950
|
+
score: f.score - 2,
|
|
1831
1951
|
// Slight penalty for alias match
|
|
1832
|
-
matchedIndices:
|
|
1833
|
-
matchedOn:
|
|
1952
|
+
matchedIndices: f.matchedIndices,
|
|
1953
|
+
matchedOn: n
|
|
1834
1954
|
});
|
|
1835
1955
|
break;
|
|
1836
1956
|
}
|
|
1837
1957
|
}
|
|
1838
1958
|
}
|
|
1839
|
-
return
|
|
1959
|
+
return s.sort((i, a) => a.score - i.score).slice(0, t);
|
|
1960
|
+
}
|
|
1961
|
+
function Ne(o, e) {
|
|
1962
|
+
const r = o.replace(/^\//, "").split(/\s+/), s = r[0] || "", i = o.endsWith(" ") && o.trim().length > 0, a = e.find(
|
|
1963
|
+
(f) => {
|
|
1964
|
+
var c;
|
|
1965
|
+
return f.name.toLowerCase() === s.toLowerCase() || ((c = f.aliases) == null ? void 0 : c.some((x) => x.toLowerCase() === s.toLowerCase()));
|
|
1966
|
+
}
|
|
1967
|
+
) || null;
|
|
1968
|
+
if (!a)
|
|
1969
|
+
return {
|
|
1970
|
+
commandName: s,
|
|
1971
|
+
command: null,
|
|
1972
|
+
enteredArgs: [],
|
|
1973
|
+
currentArgValue: "",
|
|
1974
|
+
currentArgIndex: -1,
|
|
1975
|
+
isEnteringArgs: !1
|
|
1976
|
+
};
|
|
1977
|
+
const n = r.slice(1);
|
|
1978
|
+
if (i)
|
|
1979
|
+
return {
|
|
1980
|
+
commandName: a.name,
|
|
1981
|
+
command: a,
|
|
1982
|
+
enteredArgs: n,
|
|
1983
|
+
currentArgValue: "",
|
|
1984
|
+
currentArgIndex: n.length,
|
|
1985
|
+
isEnteringArgs: !0
|
|
1986
|
+
};
|
|
1987
|
+
if (n.length > 0) {
|
|
1988
|
+
const f = n.slice(0, -1), c = n[n.length - 1];
|
|
1989
|
+
return {
|
|
1990
|
+
commandName: a.name,
|
|
1991
|
+
command: a,
|
|
1992
|
+
enteredArgs: f,
|
|
1993
|
+
currentArgValue: c,
|
|
1994
|
+
currentArgIndex: f.length,
|
|
1995
|
+
isEnteringArgs: !0
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
return {
|
|
1999
|
+
commandName: a.name,
|
|
2000
|
+
command: a,
|
|
2001
|
+
enteredArgs: [],
|
|
2002
|
+
currentArgValue: "",
|
|
2003
|
+
currentArgIndex: -1,
|
|
2004
|
+
isEnteringArgs: !1
|
|
2005
|
+
};
|
|
2006
|
+
}
|
|
2007
|
+
function Fe(o, e, t = 10) {
|
|
2008
|
+
if (!e.length)
|
|
2009
|
+
return [];
|
|
2010
|
+
if (!o)
|
|
2011
|
+
return e.slice(0, t).map((s) => ({
|
|
2012
|
+
option: s,
|
|
2013
|
+
score: 0,
|
|
2014
|
+
matchedIndices: []
|
|
2015
|
+
}));
|
|
2016
|
+
const r = [];
|
|
2017
|
+
for (const s of e) {
|
|
2018
|
+
const i = pe(o, s);
|
|
2019
|
+
i && r.push({
|
|
2020
|
+
option: s,
|
|
2021
|
+
score: i.score,
|
|
2022
|
+
matchedIndices: i.matchedIndices
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
return r.sort((s, i) => i.score - s.score).slice(0, t);
|
|
1840
2026
|
}
|
|
1841
|
-
const
|
|
2027
|
+
const Ve = [
|
|
1842
2028
|
"hide sidebars",
|
|
1843
2029
|
"show terminal",
|
|
1844
2030
|
"focus editor"
|
|
1845
2031
|
];
|
|
1846
|
-
function
|
|
2032
|
+
function ht({
|
|
1847
2033
|
events: o,
|
|
1848
2034
|
keyboard: e = { key: "p", altKey: !0 },
|
|
1849
2035
|
config: t = {},
|
|
1850
2036
|
onExecuteTool: r,
|
|
1851
|
-
initialSuggestions:
|
|
1852
|
-
agentAvailable:
|
|
1853
|
-
quickCommands:
|
|
2037
|
+
initialSuggestions: s = Ve,
|
|
2038
|
+
agentAvailable: i = !0,
|
|
2039
|
+
quickCommands: a = []
|
|
1854
2040
|
} = {}) {
|
|
1855
|
-
const [
|
|
2041
|
+
const [n, f] = P(!1), [c, x] = P(""), [h, m] = P("natural"), [w, u] = P("idle"), [d, p] = P([]), [v, E] = P([]), [$, C] = P(""), [_, b] = P([]), [T, S] = P(-1), I = te(() => s, [s]), [z, W] = P(-1), A = te(() => h !== "quick-command" || !a.length ? {
|
|
2042
|
+
commandName: "",
|
|
2043
|
+
command: null,
|
|
2044
|
+
enteredArgs: [],
|
|
2045
|
+
currentArgValue: "",
|
|
2046
|
+
currentArgIndex: -1,
|
|
2047
|
+
isEnteringArgs: !1
|
|
2048
|
+
} : Ne(c, a), [c, h, a]), G = te(() => h !== "quick-command" || !a.length || A.isEnteringArgs ? [] : Oe(c, a), [c, h, a, A.isEnteringArgs]), K = te(() => {
|
|
2049
|
+
var L;
|
|
2050
|
+
if (!A.isEnteringArgs || !((L = A.command) != null && L.args))
|
|
2051
|
+
return [];
|
|
2052
|
+
const g = A.command.args[A.currentArgIndex];
|
|
2053
|
+
return g != null && g.options ? Fe(A.currentArgValue, g.options) : [];
|
|
2054
|
+
}, [A]), ie = te(() => {
|
|
2055
|
+
var g;
|
|
2056
|
+
return !A.isEnteringArgs || !((g = A.command) != null && g.args) ? null : A.command.args[A.currentArgIndex] || null;
|
|
2057
|
+
}, [A]), B = te(() => h !== "quick-command" || w !== "idle" || c.length === 0 ? !1 : G.length > 0 || K.length > 0, [h, w, c.length, G.length, K.length]), Z = te(() => A.isEnteringArgs ? K.length : G.length, [A.isEnteringArgs, K.length, G.length]);
|
|
1856
2058
|
R(() => {
|
|
1857
|
-
|
|
1858
|
-
}, [
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1861
|
-
}, []),
|
|
1862
|
-
|
|
2059
|
+
W(Z > 0 ? 0 : -1);
|
|
2060
|
+
}, [Z]);
|
|
2061
|
+
const le = k((g) => {
|
|
2062
|
+
x(g), m(g.startsWith("/") ? "quick-command" : "natural");
|
|
2063
|
+
}, []), re = k(() => {
|
|
2064
|
+
f(!0), i ? (x(""), m("natural")) : (x("/"), m("quick-command")), u("idle"), p([]), E([]), C(""), S(-1), o == null || o.emit({
|
|
1863
2065
|
type: "agent-command-palette:opened",
|
|
1864
2066
|
source: "agent-command-palette",
|
|
1865
2067
|
timestamp: Date.now(),
|
|
1866
2068
|
payload: {}
|
|
1867
2069
|
});
|
|
1868
|
-
}, [o,
|
|
1869
|
-
|
|
2070
|
+
}, [o, i]), ee = k(() => {
|
|
2071
|
+
f(!1), o == null || o.emit({
|
|
1870
2072
|
type: "agent-command-palette:closed",
|
|
1871
2073
|
source: "agent-command-palette",
|
|
1872
2074
|
timestamp: Date.now(),
|
|
1873
2075
|
payload: {}
|
|
1874
2076
|
});
|
|
1875
|
-
}, [o]),
|
|
1876
|
-
|
|
1877
|
-
}, [
|
|
1878
|
-
|
|
1879
|
-
}, []),
|
|
1880
|
-
const
|
|
2077
|
+
}, [o]), ne = k(() => {
|
|
2078
|
+
n ? ee() : re();
|
|
2079
|
+
}, [n, re, ee]), F = k(() => {
|
|
2080
|
+
x(""), m("natural"), u("idle"), p([]), E([]), C(""), S(-1);
|
|
2081
|
+
}, []), H = k((g) => {
|
|
2082
|
+
const L = {
|
|
1881
2083
|
...g,
|
|
1882
2084
|
status: "pending"
|
|
1883
2085
|
};
|
|
1884
|
-
return
|
|
1885
|
-
}, []),
|
|
1886
|
-
(g,
|
|
1887
|
-
|
|
1888
|
-
const
|
|
1889
|
-
if (!
|
|
1890
|
-
const
|
|
1891
|
-
...
|
|
1892
|
-
status:
|
|
1893
|
-
result:
|
|
1894
|
-
error:
|
|
2086
|
+
return p((M) => [...M, L]), L;
|
|
2087
|
+
}, []), D = k(
|
|
2088
|
+
(g, L, M, X) => {
|
|
2089
|
+
p((q) => {
|
|
2090
|
+
const j = q.find((J) => J.id === g);
|
|
2091
|
+
if (!j) return q;
|
|
2092
|
+
const N = {
|
|
2093
|
+
...j,
|
|
2094
|
+
status: L,
|
|
2095
|
+
result: M,
|
|
2096
|
+
error: X
|
|
1895
2097
|
};
|
|
1896
|
-
return
|
|
2098
|
+
return L === "success" || L === "error" ? (E((J) => [...J, N]), q.filter((J) => J.id !== g)) : q.map((J) => J.id === g ? N : J);
|
|
1897
2099
|
});
|
|
1898
2100
|
},
|
|
1899
2101
|
[]
|
|
1900
|
-
),
|
|
2102
|
+
), Q = k(
|
|
1901
2103
|
async (g) => {
|
|
1902
|
-
const
|
|
1903
|
-
if (!
|
|
1904
|
-
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
id:
|
|
1908
|
-
name:
|
|
1909
|
-
args: { args:
|
|
1910
|
-
}),
|
|
2104
|
+
const L = g.replace(/^\//, "").trim().split(/\s+/), M = L[0], X = L.slice(1);
|
|
2105
|
+
if (!M) return;
|
|
2106
|
+
u("executing");
|
|
2107
|
+
const q = `quick-${Date.now()}`;
|
|
2108
|
+
H({
|
|
2109
|
+
id: q,
|
|
2110
|
+
name: M,
|
|
2111
|
+
args: { args: X }
|
|
2112
|
+
}), D(q, "running");
|
|
1911
2113
|
try {
|
|
1912
2114
|
if (r) {
|
|
1913
|
-
const
|
|
1914
|
-
|
|
2115
|
+
const N = await r(M, { args: X });
|
|
2116
|
+
D(q, "success", String(N));
|
|
1915
2117
|
} else
|
|
1916
|
-
|
|
1917
|
-
|
|
2118
|
+
D(q, "success", "Tool executed (no handler)");
|
|
2119
|
+
b((N) => [
|
|
1918
2120
|
{
|
|
1919
2121
|
query: g,
|
|
1920
2122
|
timestamp: Date.now(),
|
|
1921
|
-
toolsExecuted: [
|
|
2123
|
+
toolsExecuted: [M],
|
|
1922
2124
|
success: !0
|
|
1923
2125
|
},
|
|
1924
|
-
...
|
|
1925
|
-
]),
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
} catch (
|
|
1929
|
-
const
|
|
1930
|
-
|
|
2126
|
+
...N.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2127
|
+
]), u("complete"), C(`Executed: ${M}`);
|
|
2128
|
+
const j = t.autoCloseDelay ?? 1e3;
|
|
2129
|
+
j > 0 && setTimeout(() => ee(), j);
|
|
2130
|
+
} catch (j) {
|
|
2131
|
+
const N = j instanceof Error ? j.message : "Unknown error";
|
|
2132
|
+
D(q, "error", void 0, N), u("error"), C(`Error: ${N}`);
|
|
1931
2133
|
}
|
|
1932
2134
|
},
|
|
1933
|
-
[r,
|
|
1934
|
-
),
|
|
1935
|
-
if (
|
|
1936
|
-
if (
|
|
1937
|
-
|
|
2135
|
+
[r, H, D, t.autoCloseDelay, t.maxHistoryEntries, ee]
|
|
2136
|
+
), Y = k(() => {
|
|
2137
|
+
if (c.trim()) {
|
|
2138
|
+
if (h === "quick-command") {
|
|
2139
|
+
Q(c);
|
|
1938
2140
|
return;
|
|
1939
2141
|
}
|
|
1940
|
-
if (!
|
|
1941
|
-
|
|
2142
|
+
if (!i) {
|
|
2143
|
+
C("Agent unavailable. Use quick commands (start with /)."), u("error");
|
|
1942
2144
|
return;
|
|
1943
2145
|
}
|
|
1944
|
-
|
|
2146
|
+
u("thinking"), o == null || o.emit({
|
|
1945
2147
|
type: "agent-command-palette:submit",
|
|
1946
2148
|
source: "agent-command-palette",
|
|
1947
2149
|
timestamp: Date.now(),
|
|
1948
|
-
payload: { query:
|
|
1949
|
-
}),
|
|
2150
|
+
payload: { query: c, mode: h }
|
|
2151
|
+
}), b((g) => [
|
|
1950
2152
|
{
|
|
1951
|
-
query:
|
|
2153
|
+
query: c,
|
|
1952
2154
|
timestamp: Date.now(),
|
|
1953
2155
|
toolsExecuted: [],
|
|
1954
2156
|
success: !0
|
|
@@ -1956,94 +2158,109 @@ function lt({
|
|
|
1956
2158
|
...g.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
1957
2159
|
]);
|
|
1958
2160
|
}
|
|
1959
|
-
}, [
|
|
2161
|
+
}, [c, h, Q, o, t.maxHistoryEntries, i]), ce = k(() => {
|
|
1960
2162
|
if (_.length === 0) return;
|
|
1961
|
-
const g =
|
|
1962
|
-
S(g), _[g] && (
|
|
1963
|
-
}, [_,
|
|
1964
|
-
if (
|
|
1965
|
-
S(-1),
|
|
2163
|
+
const g = T < _.length - 1 ? T + 1 : T;
|
|
2164
|
+
S(g), _[g] && (x(_[g].query), m(_[g].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2165
|
+
}, [_, T]), ue = k(() => {
|
|
2166
|
+
if (T <= 0) {
|
|
2167
|
+
S(-1), x(""), m("natural");
|
|
1966
2168
|
return;
|
|
1967
2169
|
}
|
|
1968
|
-
const g =
|
|
1969
|
-
S(g), _[g] && (
|
|
1970
|
-
}, [_,
|
|
2170
|
+
const g = T - 1;
|
|
2171
|
+
S(g), _[g] && (x(_[g].query), m(_[g].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2172
|
+
}, [_, T]), se = k(
|
|
1971
2173
|
(g) => {
|
|
1972
2174
|
const {
|
|
1973
|
-
key:
|
|
1974
|
-
altKey:
|
|
1975
|
-
ctrlKey:
|
|
1976
|
-
metaKey:
|
|
1977
|
-
shiftKey:
|
|
1978
|
-
} = e,
|
|
1979
|
-
if ((
|
|
1980
|
-
const
|
|
1981
|
-
if (!
|
|
2175
|
+
key: L = "p",
|
|
2176
|
+
altKey: M = !0,
|
|
2177
|
+
ctrlKey: X = !1,
|
|
2178
|
+
metaKey: q = !1,
|
|
2179
|
+
shiftKey: j = !1
|
|
2180
|
+
} = e, N = g.altKey === M && g.ctrlKey === X && g.metaKey === q && g.shiftKey === j;
|
|
2181
|
+
if ((M ? g.code === `Key${L.toUpperCase()}` : g.key.toLowerCase() === L.toLowerCase()) && N) {
|
|
2182
|
+
const oe = g.target;
|
|
2183
|
+
if (!oe.closest("[data-agent-command-palette-input]") && (oe.tagName === "INPUT" || oe.tagName === "TEXTAREA" || oe.isContentEditable))
|
|
1982
2184
|
return;
|
|
1983
|
-
g.preventDefault(),
|
|
2185
|
+
g.preventDefault(), ne();
|
|
1984
2186
|
}
|
|
1985
2187
|
},
|
|
1986
|
-
[e,
|
|
2188
|
+
[e, ne]
|
|
1987
2189
|
);
|
|
1988
|
-
R(() => (window.addEventListener("keydown",
|
|
1989
|
-
const
|
|
1990
|
-
B &&
|
|
1991
|
-
(g) => g <
|
|
2190
|
+
R(() => (window.addEventListener("keydown", se), () => window.removeEventListener("keydown", se)), [se]);
|
|
2191
|
+
const Pe = k(() => {
|
|
2192
|
+
B && W(
|
|
2193
|
+
(g) => g < Z - 1 ? g + 1 : 0
|
|
1992
2194
|
);
|
|
1993
|
-
}, [B,
|
|
1994
|
-
B &&
|
|
1995
|
-
(g) => g > 0 ? g - 1 :
|
|
2195
|
+
}, [B, Z]), We = k(() => {
|
|
2196
|
+
B && W(
|
|
2197
|
+
(g) => g > 0 ? g - 1 : Z - 1
|
|
1996
2198
|
);
|
|
1997
|
-
}, [B,
|
|
1998
|
-
|
|
1999
|
-
|
|
2199
|
+
}, [B, Z]), Le = k(() => {
|
|
2200
|
+
var X;
|
|
2201
|
+
if (!B || z < 0) return;
|
|
2202
|
+
if (A.isEnteringArgs) {
|
|
2203
|
+
const q = K[z];
|
|
2204
|
+
if (!q) return;
|
|
2205
|
+
let j = `/${A.commandName}`;
|
|
2206
|
+
for (const oe of A.enteredArgs)
|
|
2207
|
+
j += ` ${oe}`;
|
|
2208
|
+
j += ` ${q.option}`;
|
|
2209
|
+
const N = A.currentArgIndex + 1;
|
|
2210
|
+
((X = A.command) == null ? void 0 : X.args) && N < A.command.args.length && (j += " "), x(j), W(-1);
|
|
2211
|
+
return;
|
|
2212
|
+
}
|
|
2213
|
+
const g = G[z];
|
|
2000
2214
|
if (!g) return;
|
|
2001
|
-
const
|
|
2002
|
-
let
|
|
2003
|
-
|
|
2004
|
-
}, [B,
|
|
2215
|
+
const L = g.command;
|
|
2216
|
+
let M = `/${L.name}`;
|
|
2217
|
+
L.args && L.args.length > 0 && (M += " "), x(M), W(-1);
|
|
2218
|
+
}, [B, z, A, K, G]);
|
|
2005
2219
|
return {
|
|
2006
2220
|
// Agent availability
|
|
2007
|
-
agentAvailable:
|
|
2221
|
+
agentAvailable: i,
|
|
2008
2222
|
// Visibility
|
|
2009
|
-
isOpen:
|
|
2010
|
-
open:
|
|
2011
|
-
close:
|
|
2012
|
-
toggle:
|
|
2223
|
+
isOpen: n,
|
|
2224
|
+
open: re,
|
|
2225
|
+
close: ee,
|
|
2226
|
+
toggle: ne,
|
|
2013
2227
|
// Input
|
|
2014
|
-
query:
|
|
2015
|
-
setQuery:
|
|
2016
|
-
mode:
|
|
2228
|
+
query: c,
|
|
2229
|
+
setQuery: le,
|
|
2230
|
+
mode: h,
|
|
2017
2231
|
// Execution
|
|
2018
|
-
status:
|
|
2019
|
-
setStatus:
|
|
2232
|
+
status: w,
|
|
2233
|
+
setStatus: u,
|
|
2020
2234
|
pendingTools: d,
|
|
2021
|
-
completedTools:
|
|
2235
|
+
completedTools: v,
|
|
2022
2236
|
agentResponse: $,
|
|
2023
|
-
setAgentResponse:
|
|
2024
|
-
submit:
|
|
2025
|
-
executeQuickCommand:
|
|
2237
|
+
setAgentResponse: C,
|
|
2238
|
+
submit: Y,
|
|
2239
|
+
executeQuickCommand: Q,
|
|
2026
2240
|
// Tool management (for external AI integration)
|
|
2027
|
-
addPendingTool:
|
|
2028
|
-
updateToolStatus:
|
|
2241
|
+
addPendingTool: H,
|
|
2242
|
+
updateToolStatus: D,
|
|
2029
2243
|
// History
|
|
2030
2244
|
history: _,
|
|
2031
|
-
historyPrevious:
|
|
2032
|
-
historyNext:
|
|
2245
|
+
historyPrevious: ce,
|
|
2246
|
+
historyNext: ue,
|
|
2033
2247
|
// Suggestions
|
|
2034
|
-
suggestions:
|
|
2248
|
+
suggestions: I,
|
|
2035
2249
|
// Actions
|
|
2036
|
-
clear:
|
|
2250
|
+
clear: F,
|
|
2037
2251
|
// Quick command autocomplete
|
|
2038
|
-
quickCommandMatches:
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2252
|
+
quickCommandMatches: G,
|
|
2253
|
+
argumentOptionMatches: K,
|
|
2254
|
+
parsedQuery: A,
|
|
2255
|
+
currentArgDef: ie,
|
|
2256
|
+
selectedAutocompleteIndex: z,
|
|
2257
|
+
autocompleteNext: Pe,
|
|
2258
|
+
autocompletePrevious: We,
|
|
2259
|
+
autocompleteAccept: Le,
|
|
2043
2260
|
showAutocomplete: B
|
|
2044
2261
|
};
|
|
2045
2262
|
}
|
|
2046
|
-
const
|
|
2263
|
+
const be = {
|
|
2047
2264
|
name: "get_visible_panels",
|
|
2048
2265
|
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.",
|
|
2049
2266
|
inputs: {
|
|
@@ -2112,7 +2329,7 @@ const fe = {
|
|
|
2112
2329
|
call_template_type: "panel_event",
|
|
2113
2330
|
event_type: "panel:get-visibility"
|
|
2114
2331
|
}
|
|
2115
|
-
},
|
|
2332
|
+
}, we = {
|
|
2116
2333
|
name: "get_panel_state",
|
|
2117
2334
|
description: "Get the current state of a specific panel. Returns panel-specific state data if the panel supports state queries.",
|
|
2118
2335
|
inputs: {
|
|
@@ -2144,7 +2361,7 @@ const fe = {
|
|
|
2144
2361
|
call_template_type: "panel_event",
|
|
2145
2362
|
event_type: "panel:get-state"
|
|
2146
2363
|
}
|
|
2147
|
-
},
|
|
2364
|
+
}, Se = {
|
|
2148
2365
|
name: "list_panels_with_state",
|
|
2149
2366
|
description: "Get a list of all panels that support state queries. Use this to discover which panels can be queried with get_panel_state.",
|
|
2150
2367
|
inputs: {
|
|
@@ -2177,7 +2394,7 @@ const fe = {
|
|
|
2177
2394
|
call_template_type: "panel_event",
|
|
2178
2395
|
event_type: "panel:list-state-panels"
|
|
2179
2396
|
}
|
|
2180
|
-
},
|
|
2397
|
+
}, ve = {
|
|
2181
2398
|
name: "toggle_panel",
|
|
2182
2399
|
description: "Collapse or expand a side panel to give more space to the main content area.",
|
|
2183
2400
|
inputs: {
|
|
@@ -2204,7 +2421,7 @@ const fe = {
|
|
|
2204
2421
|
call_template_type: "panel_event",
|
|
2205
2422
|
event_type: "panel:toggle"
|
|
2206
2423
|
}
|
|
2207
|
-
},
|
|
2424
|
+
}, Te = {
|
|
2208
2425
|
name: "collapse_all_panels",
|
|
2209
2426
|
description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
|
|
2210
2427
|
inputs: {
|
|
@@ -2224,7 +2441,7 @@ const fe = {
|
|
|
2224
2441
|
call_template_type: "panel_event",
|
|
2225
2442
|
event_type: "panel:collapse-all"
|
|
2226
2443
|
}
|
|
2227
|
-
},
|
|
2444
|
+
}, Ce = {
|
|
2228
2445
|
name: "expand_all_panels",
|
|
2229
2446
|
description: "Expand both left and right panels to show all content. Restores the default layout.",
|
|
2230
2447
|
inputs: {
|
|
@@ -2244,7 +2461,7 @@ const fe = {
|
|
|
2244
2461
|
call_template_type: "panel_event",
|
|
2245
2462
|
event_type: "panel:expand-all"
|
|
2246
2463
|
}
|
|
2247
|
-
},
|
|
2464
|
+
}, Ie = {
|
|
2248
2465
|
name: "switch_panel",
|
|
2249
2466
|
description: "Change which content is displayed in a panel slot (left, middle, or right).",
|
|
2250
2467
|
inputs: {
|
|
@@ -2275,7 +2492,7 @@ const fe = {
|
|
|
2275
2492
|
call_template_type: "panel_event",
|
|
2276
2493
|
event_type: "panel:switch"
|
|
2277
2494
|
}
|
|
2278
|
-
},
|
|
2495
|
+
}, Ae = {
|
|
2279
2496
|
name: "focus_panel",
|
|
2280
2497
|
description: "Set focus to a specific panel slot for keyboard navigation.",
|
|
2281
2498
|
inputs: {
|
|
@@ -2301,7 +2518,7 @@ const fe = {
|
|
|
2301
2518
|
call_template_type: "panel_event",
|
|
2302
2519
|
event_type: "panel:focus"
|
|
2303
2520
|
}
|
|
2304
|
-
},
|
|
2521
|
+
}, ze = {
|
|
2305
2522
|
name: "reset_layout",
|
|
2306
2523
|
description: "Reset panel sizes to the default layout configuration.",
|
|
2307
2524
|
inputs: {
|
|
@@ -2321,44 +2538,44 @@ const fe = {
|
|
|
2321
2538
|
call_template_type: "panel_event",
|
|
2322
2539
|
event_type: "panel:reset-layout"
|
|
2323
2540
|
}
|
|
2324
|
-
},
|
|
2541
|
+
}, Be = [
|
|
2325
2542
|
// State query tools
|
|
2326
|
-
fe,
|
|
2327
|
-
he,
|
|
2328
|
-
ye,
|
|
2329
|
-
// Layout action tools
|
|
2330
|
-
ge,
|
|
2331
|
-
me,
|
|
2332
|
-
ke,
|
|
2333
|
-
xe,
|
|
2334
2543
|
be,
|
|
2335
|
-
we
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2544
|
+
we,
|
|
2545
|
+
Se,
|
|
2546
|
+
// Layout action tools
|
|
2547
|
+
ve,
|
|
2548
|
+
Te,
|
|
2549
|
+
Ce,
|
|
2550
|
+
Ie,
|
|
2551
|
+
Ae,
|
|
2552
|
+
ze
|
|
2553
|
+
], gt = [
|
|
2345
2554
|
be,
|
|
2346
|
-
we
|
|
2347
|
-
|
|
2555
|
+
we,
|
|
2556
|
+
Se
|
|
2557
|
+
], mt = [
|
|
2558
|
+
ve,
|
|
2559
|
+
Te,
|
|
2560
|
+
Ce,
|
|
2561
|
+
Ie,
|
|
2562
|
+
Ae,
|
|
2563
|
+
ze
|
|
2564
|
+
], yt = {
|
|
2348
2565
|
id: "panel-layouts",
|
|
2349
2566
|
name: "Panel Layouts",
|
|
2350
2567
|
description: "Generic panel layout and state query operations",
|
|
2351
|
-
tools:
|
|
2568
|
+
tools: Be
|
|
2352
2569
|
};
|
|
2353
|
-
function
|
|
2570
|
+
function Ke(o) {
|
|
2354
2571
|
const e = {};
|
|
2355
2572
|
if (o.inputs.properties)
|
|
2356
2573
|
for (const [t, r] of Object.entries(o.inputs.properties)) {
|
|
2357
|
-
const
|
|
2574
|
+
const s = r;
|
|
2358
2575
|
e[t] = {
|
|
2359
|
-
type:
|
|
2360
|
-
description:
|
|
2361
|
-
...
|
|
2576
|
+
type: s.type || "string",
|
|
2577
|
+
description: s.description,
|
|
2578
|
+
...s.enum && { enum: s.enum }
|
|
2362
2579
|
};
|
|
2363
2580
|
}
|
|
2364
2581
|
return {
|
|
@@ -2371,12 +2588,12 @@ function Me(o) {
|
|
|
2371
2588
|
}
|
|
2372
2589
|
};
|
|
2373
2590
|
}
|
|
2374
|
-
function
|
|
2591
|
+
function kt(o) {
|
|
2375
2592
|
return {
|
|
2376
|
-
functionDeclarations: o.map(
|
|
2593
|
+
functionDeclarations: o.map(Ke)
|
|
2377
2594
|
};
|
|
2378
2595
|
}
|
|
2379
|
-
function
|
|
2596
|
+
function He(o) {
|
|
2380
2597
|
return {
|
|
2381
2598
|
type: "function",
|
|
2382
2599
|
function: {
|
|
@@ -2386,54 +2603,54 @@ function Oe(o) {
|
|
|
2386
2603
|
}
|
|
2387
2604
|
};
|
|
2388
2605
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return o.map(
|
|
2606
|
+
function xt(o) {
|
|
2607
|
+
return o.map(He);
|
|
2391
2608
|
}
|
|
2392
|
-
function
|
|
2609
|
+
function Qe(o) {
|
|
2393
2610
|
return {
|
|
2394
2611
|
name: o.name,
|
|
2395
2612
|
description: o.description,
|
|
2396
2613
|
input_schema: o.inputs
|
|
2397
2614
|
};
|
|
2398
2615
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return o.map(
|
|
2616
|
+
function bt(o) {
|
|
2617
|
+
return o.map(Qe);
|
|
2401
2618
|
}
|
|
2402
|
-
function
|
|
2619
|
+
function Je(o) {
|
|
2403
2620
|
return {
|
|
2404
2621
|
name: o.name,
|
|
2405
2622
|
description: o.description,
|
|
2406
2623
|
parameters: o.inputs
|
|
2407
2624
|
};
|
|
2408
2625
|
}
|
|
2409
|
-
function
|
|
2410
|
-
return o.map(
|
|
2626
|
+
function wt(o) {
|
|
2627
|
+
return o.map(Je);
|
|
2411
2628
|
}
|
|
2412
|
-
function
|
|
2629
|
+
function St(o, e = {}) {
|
|
2413
2630
|
const {
|
|
2414
2631
|
header: t = "You have access to the following tools:",
|
|
2415
2632
|
includeParameters: r = !0
|
|
2416
|
-
} = e,
|
|
2417
|
-
let
|
|
2418
|
-
if (r &&
|
|
2419
|
-
const
|
|
2420
|
-
var
|
|
2421
|
-
const
|
|
2422
|
-
return ` - ${
|
|
2633
|
+
} = e, s = o.map((i) => {
|
|
2634
|
+
let a = `- ${i.name}: ${i.description}`;
|
|
2635
|
+
if (r && i.inputs.properties) {
|
|
2636
|
+
const n = Object.entries(i.inputs.properties).map(([f, c]) => {
|
|
2637
|
+
var m;
|
|
2638
|
+
const x = c, h = (m = i.inputs.required) != null && m.includes(f) ? " (required)" : "";
|
|
2639
|
+
return ` - ${f}: ${x.description || x.type}${h}`;
|
|
2423
2640
|
}).join(`
|
|
2424
2641
|
`);
|
|
2425
|
-
|
|
2426
|
-
${
|
|
2642
|
+
n && (a += `
|
|
2643
|
+
${n}`);
|
|
2427
2644
|
}
|
|
2428
|
-
return
|
|
2645
|
+
return a;
|
|
2429
2646
|
});
|
|
2430
2647
|
return `${t}
|
|
2431
2648
|
|
|
2432
|
-
${
|
|
2649
|
+
${s.join(`
|
|
2433
2650
|
|
|
2434
2651
|
`)}`;
|
|
2435
2652
|
}
|
|
2436
|
-
const
|
|
2653
|
+
const Ue = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2437
2654
|
"svg",
|
|
2438
2655
|
{
|
|
2439
2656
|
width: o,
|
|
@@ -2445,11 +2662,11 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2445
2662
|
strokeLinecap: "round",
|
|
2446
2663
|
strokeLinejoin: "round",
|
|
2447
2664
|
children: [
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2666
|
+
/* @__PURE__ */ l("path", { d: "M9 3v18" })
|
|
2450
2667
|
]
|
|
2451
2668
|
}
|
|
2452
|
-
),
|
|
2669
|
+
), Ge = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2453
2670
|
"svg",
|
|
2454
2671
|
{
|
|
2455
2672
|
width: o,
|
|
@@ -2461,12 +2678,12 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2461
2678
|
strokeLinecap: "round",
|
|
2462
2679
|
strokeLinejoin: "round",
|
|
2463
2680
|
children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2681
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2682
|
+
/* @__PURE__ */ l("path", { d: "M9 3v18" }),
|
|
2683
|
+
/* @__PURE__ */ l("path", { d: "m16 15-3-3 3-3" })
|
|
2467
2684
|
]
|
|
2468
2685
|
}
|
|
2469
|
-
),
|
|
2686
|
+
), Ye = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2470
2687
|
"svg",
|
|
2471
2688
|
{
|
|
2472
2689
|
width: o,
|
|
@@ -2478,11 +2695,11 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2478
2695
|
strokeLinecap: "round",
|
|
2479
2696
|
strokeLinejoin: "round",
|
|
2480
2697
|
children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2698
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2699
|
+
/* @__PURE__ */ l("path", { d: "M15 3v18" })
|
|
2483
2700
|
]
|
|
2484
2701
|
}
|
|
2485
|
-
),
|
|
2702
|
+
), Xe = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2486
2703
|
"svg",
|
|
2487
2704
|
{
|
|
2488
2705
|
width: o,
|
|
@@ -2494,32 +2711,32 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2494
2711
|
strokeLinecap: "round",
|
|
2495
2712
|
strokeLinejoin: "round",
|
|
2496
2713
|
children: [
|
|
2497
|
-
/* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2715
|
+
/* @__PURE__ */ l("path", { d: "M15 3v18" }),
|
|
2716
|
+
/* @__PURE__ */ l("path", { d: "m8 9 3 3-3 3" })
|
|
2500
2717
|
]
|
|
2501
2718
|
}
|
|
2502
|
-
),
|
|
2719
|
+
), he = ({
|
|
2503
2720
|
isCollapsed: o,
|
|
2504
2721
|
onToggle: e,
|
|
2505
2722
|
side: t = "left",
|
|
2506
2723
|
iconSize: r = 18,
|
|
2507
|
-
style:
|
|
2508
|
-
shortcutHint:
|
|
2509
|
-
title:
|
|
2510
|
-
className:
|
|
2724
|
+
style: s,
|
|
2725
|
+
shortcutHint: i = "Cmd/Ctrl+B",
|
|
2726
|
+
title: a,
|
|
2727
|
+
className: n
|
|
2511
2728
|
}) => {
|
|
2512
|
-
const { theme:
|
|
2513
|
-
return /* @__PURE__ */
|
|
2729
|
+
const { theme: f } = U(), c = () => t === "right" ? o ? /* @__PURE__ */ l(Ye, { size: r }) : /* @__PURE__ */ l(Xe, { size: r }) : o ? /* @__PURE__ */ l(Ue, { size: r }) : /* @__PURE__ */ l(Ge, { size: r });
|
|
2730
|
+
return /* @__PURE__ */ l(
|
|
2514
2731
|
"button",
|
|
2515
2732
|
{
|
|
2516
2733
|
onClick: e,
|
|
2517
|
-
title:
|
|
2518
|
-
className:
|
|
2734
|
+
title: a ?? `${o ? "Show" : "Hide"} ${t === "right" ? "Right Panel" : "Sidebar"}${i ? ` (${i})` : ""}`,
|
|
2735
|
+
className: n,
|
|
2519
2736
|
style: {
|
|
2520
2737
|
background: "transparent",
|
|
2521
2738
|
border: "none",
|
|
2522
|
-
color: o ?
|
|
2739
|
+
color: o ? f.colors.textSecondary : f.colors.primary,
|
|
2523
2740
|
cursor: "pointer",
|
|
2524
2741
|
padding: "6px",
|
|
2525
2742
|
borderRadius: "4px",
|
|
@@ -2529,18 +2746,18 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2529
2746
|
transition: "all 0.2s",
|
|
2530
2747
|
width: "32px",
|
|
2531
2748
|
height: "32px",
|
|
2532
|
-
...
|
|
2749
|
+
...s
|
|
2533
2750
|
},
|
|
2534
|
-
onMouseEnter: (
|
|
2535
|
-
|
|
2751
|
+
onMouseEnter: (h) => {
|
|
2752
|
+
h.currentTarget.style.backgroundColor = f.colors.backgroundTertiary, h.currentTarget.style.color = f.colors.primary;
|
|
2536
2753
|
},
|
|
2537
|
-
onMouseLeave: (
|
|
2538
|
-
|
|
2754
|
+
onMouseLeave: (h) => {
|
|
2755
|
+
h.currentTarget.style.backgroundColor = "transparent", h.currentTarget.style.color = o ? f.colors.textSecondary : f.colors.primary;
|
|
2539
2756
|
},
|
|
2540
|
-
children:
|
|
2757
|
+
children: c()
|
|
2541
2758
|
}
|
|
2542
2759
|
);
|
|
2543
|
-
},
|
|
2760
|
+
}, Ze = ({ size: o = 14 }) => /* @__PURE__ */ y(
|
|
2544
2761
|
"svg",
|
|
2545
2762
|
{
|
|
2546
2763
|
width: o,
|
|
@@ -2552,13 +2769,13 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2552
2769
|
strokeLinecap: "round",
|
|
2553
2770
|
strokeLinejoin: "round",
|
|
2554
2771
|
children: [
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
/* @__PURE__ */
|
|
2558
|
-
/* @__PURE__ */
|
|
2772
|
+
/* @__PURE__ */ l("path", { d: "M8 3 4 7l4 4" }),
|
|
2773
|
+
/* @__PURE__ */ l("path", { d: "M4 7h16" }),
|
|
2774
|
+
/* @__PURE__ */ l("path", { d: "m16 21 4-4-4-4" }),
|
|
2775
|
+
/* @__PURE__ */ l("path", { d: "M20 17H4" })
|
|
2559
2776
|
]
|
|
2560
2777
|
}
|
|
2561
|
-
),
|
|
2778
|
+
), et = ({ size: o = 14 }) => /* @__PURE__ */ y(
|
|
2562
2779
|
"svg",
|
|
2563
2780
|
{
|
|
2564
2781
|
width: o,
|
|
@@ -2570,31 +2787,31 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2570
2787
|
strokeLinecap: "round",
|
|
2571
2788
|
strokeLinejoin: "round",
|
|
2572
2789
|
children: [
|
|
2573
|
-
/* @__PURE__ */
|
|
2574
|
-
/* @__PURE__ */
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ l("path", { d: "m16 3 4 4-4 4" }),
|
|
2791
|
+
/* @__PURE__ */ l("path", { d: "M20 7H4" }),
|
|
2792
|
+
/* @__PURE__ */ l("path", { d: "m8 21-4-4 4-4" }),
|
|
2793
|
+
/* @__PURE__ */ l("path", { d: "M4 17h16" })
|
|
2577
2794
|
]
|
|
2578
2795
|
}
|
|
2579
|
-
),
|
|
2796
|
+
), ge = ({
|
|
2580
2797
|
onSwitch: o,
|
|
2581
2798
|
variant: e = "left-middle",
|
|
2582
2799
|
iconSize: t = 14,
|
|
2583
2800
|
style: r,
|
|
2584
|
-
title:
|
|
2585
|
-
className:
|
|
2801
|
+
title: s,
|
|
2802
|
+
className: i
|
|
2586
2803
|
}) => {
|
|
2587
|
-
const { theme:
|
|
2588
|
-
return /* @__PURE__ */
|
|
2804
|
+
const { theme: a } = U(), n = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", f = e === "left-middle" ? Ze : et;
|
|
2805
|
+
return /* @__PURE__ */ l(
|
|
2589
2806
|
"button",
|
|
2590
2807
|
{
|
|
2591
2808
|
onClick: o,
|
|
2592
|
-
title:
|
|
2593
|
-
className:
|
|
2809
|
+
title: s ?? n(),
|
|
2810
|
+
className: i,
|
|
2594
2811
|
style: {
|
|
2595
2812
|
background: "transparent",
|
|
2596
2813
|
border: "none",
|
|
2597
|
-
color:
|
|
2814
|
+
color: a.colors.textSecondary,
|
|
2598
2815
|
cursor: "pointer",
|
|
2599
2816
|
padding: "6px",
|
|
2600
2817
|
borderRadius: "4px",
|
|
@@ -2606,16 +2823,16 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2606
2823
|
height: "32px",
|
|
2607
2824
|
...r
|
|
2608
2825
|
},
|
|
2609
|
-
onMouseEnter: (
|
|
2610
|
-
|
|
2826
|
+
onMouseEnter: (c) => {
|
|
2827
|
+
c.currentTarget.style.backgroundColor = a.colors.backgroundTertiary, c.currentTarget.style.color = a.colors.text;
|
|
2611
2828
|
},
|
|
2612
|
-
onMouseLeave: (
|
|
2613
|
-
|
|
2829
|
+
onMouseLeave: (c) => {
|
|
2830
|
+
c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = a.colors.textSecondary;
|
|
2614
2831
|
},
|
|
2615
|
-
children: /* @__PURE__ */
|
|
2832
|
+
children: /* @__PURE__ */ l(f, { size: t })
|
|
2616
2833
|
}
|
|
2617
2834
|
);
|
|
2618
|
-
},
|
|
2835
|
+
}, tt = ({ size: o = 14 }) => /* @__PURE__ */ y(
|
|
2619
2836
|
"svg",
|
|
2620
2837
|
{
|
|
2621
2838
|
width: o,
|
|
@@ -2627,29 +2844,29 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2627
2844
|
strokeLinecap: "round",
|
|
2628
2845
|
strokeLinejoin: "round",
|
|
2629
2846
|
children: [
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ l("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2848
|
+
/* @__PURE__ */ l("path", { d: "M3 9h18" }),
|
|
2849
|
+
/* @__PURE__ */ l("path", { d: "M9 21V9" })
|
|
2633
2850
|
]
|
|
2634
2851
|
}
|
|
2635
|
-
),
|
|
2852
|
+
), ot = ({
|
|
2636
2853
|
onConfigure: o,
|
|
2637
2854
|
iconSize: e = 14,
|
|
2638
2855
|
style: t,
|
|
2639
2856
|
title: r = "Configure panel layout",
|
|
2640
|
-
className:
|
|
2857
|
+
className: s
|
|
2641
2858
|
}) => {
|
|
2642
|
-
const { theme:
|
|
2643
|
-
return /* @__PURE__ */
|
|
2859
|
+
const { theme: i } = U();
|
|
2860
|
+
return /* @__PURE__ */ l(
|
|
2644
2861
|
"button",
|
|
2645
2862
|
{
|
|
2646
2863
|
onClick: o,
|
|
2647
2864
|
title: r,
|
|
2648
|
-
className:
|
|
2865
|
+
className: s,
|
|
2649
2866
|
style: {
|
|
2650
2867
|
background: "transparent",
|
|
2651
2868
|
border: "none",
|
|
2652
|
-
color:
|
|
2869
|
+
color: i.colors.textSecondary,
|
|
2653
2870
|
cursor: "pointer",
|
|
2654
2871
|
padding: "6px",
|
|
2655
2872
|
borderRadius: "4px",
|
|
@@ -2661,144 +2878,144 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2661
2878
|
height: "32px",
|
|
2662
2879
|
...t
|
|
2663
2880
|
},
|
|
2664
|
-
onMouseEnter: (
|
|
2665
|
-
|
|
2881
|
+
onMouseEnter: (a) => {
|
|
2882
|
+
a.currentTarget.style.backgroundColor = i.colors.backgroundTertiary, a.currentTarget.style.color = i.colors.text;
|
|
2666
2883
|
},
|
|
2667
|
-
onMouseLeave: (
|
|
2668
|
-
|
|
2884
|
+
onMouseLeave: (a) => {
|
|
2885
|
+
a.currentTarget.style.backgroundColor = "transparent", a.currentTarget.style.color = i.colors.textSecondary;
|
|
2669
2886
|
},
|
|
2670
|
-
children: /* @__PURE__ */
|
|
2887
|
+
children: /* @__PURE__ */ l(tt, { size: e })
|
|
2671
2888
|
}
|
|
2672
2889
|
);
|
|
2673
|
-
},
|
|
2890
|
+
}, vt = ({
|
|
2674
2891
|
leftSidebarCollapsed: o = !1,
|
|
2675
2892
|
onToggleLeftSidebar: e,
|
|
2676
2893
|
showLeftSidebarControl: t = !1,
|
|
2677
2894
|
rightSidebarCollapsed: r = !1,
|
|
2678
|
-
onToggleRightSidebar:
|
|
2679
|
-
showRightSidebarControl:
|
|
2680
|
-
onSwitchLeftMiddlePanels:
|
|
2681
|
-
showSwitchLeftMiddle:
|
|
2682
|
-
onSwitchRightMiddlePanels:
|
|
2683
|
-
showSwitchRightMiddle:
|
|
2684
|
-
onConfigurePanels:
|
|
2685
|
-
showConfigureButton:
|
|
2686
|
-
gap:
|
|
2687
|
-
style:
|
|
2688
|
-
className:
|
|
2895
|
+
onToggleRightSidebar: s,
|
|
2896
|
+
showRightSidebarControl: i = !1,
|
|
2897
|
+
onSwitchLeftMiddlePanels: a,
|
|
2898
|
+
showSwitchLeftMiddle: n = !1,
|
|
2899
|
+
onSwitchRightMiddlePanels: f,
|
|
2900
|
+
showSwitchRightMiddle: c = !1,
|
|
2901
|
+
onConfigurePanels: x,
|
|
2902
|
+
showConfigureButton: h = !1,
|
|
2903
|
+
gap: m = 4,
|
|
2904
|
+
style: w,
|
|
2905
|
+
className: u,
|
|
2689
2906
|
iconSize: d,
|
|
2690
|
-
leftCollapseButtonProps:
|
|
2691
|
-
rightCollapseButtonProps:
|
|
2692
|
-
leftMiddleSwitchButtonProps:
|
|
2907
|
+
leftCollapseButtonProps: p,
|
|
2908
|
+
rightCollapseButtonProps: v,
|
|
2909
|
+
leftMiddleSwitchButtonProps: E,
|
|
2693
2910
|
rightMiddleSwitchButtonProps: $,
|
|
2694
|
-
configureButtonProps:
|
|
2695
|
-
}) => t && e ||
|
|
2911
|
+
configureButtonProps: C
|
|
2912
|
+
}) => t && e || n && a || h && x || c && f || i && s ? /* @__PURE__ */ y(
|
|
2696
2913
|
"div",
|
|
2697
2914
|
{
|
|
2698
|
-
className:
|
|
2915
|
+
className: u,
|
|
2699
2916
|
style: {
|
|
2700
2917
|
display: "flex",
|
|
2701
2918
|
alignItems: "center",
|
|
2702
|
-
gap: `${
|
|
2703
|
-
...
|
|
2919
|
+
gap: `${m}px`,
|
|
2920
|
+
...w
|
|
2704
2921
|
},
|
|
2705
2922
|
children: [
|
|
2706
|
-
t && e && /* @__PURE__ */
|
|
2707
|
-
|
|
2923
|
+
t && e && /* @__PURE__ */ l(
|
|
2924
|
+
he,
|
|
2708
2925
|
{
|
|
2709
2926
|
isCollapsed: o,
|
|
2710
2927
|
onToggle: e,
|
|
2711
2928
|
side: "left",
|
|
2712
2929
|
iconSize: d ?? 18,
|
|
2713
|
-
...
|
|
2930
|
+
...p
|
|
2714
2931
|
}
|
|
2715
2932
|
),
|
|
2716
|
-
|
|
2717
|
-
|
|
2933
|
+
n && a && /* @__PURE__ */ l(
|
|
2934
|
+
ge,
|
|
2718
2935
|
{
|
|
2719
|
-
onSwitch:
|
|
2936
|
+
onSwitch: a,
|
|
2720
2937
|
variant: "left-middle",
|
|
2721
2938
|
iconSize: d ?? 14,
|
|
2722
|
-
...
|
|
2939
|
+
...E
|
|
2723
2940
|
}
|
|
2724
2941
|
),
|
|
2725
|
-
|
|
2726
|
-
|
|
2942
|
+
h && x && /* @__PURE__ */ l(
|
|
2943
|
+
ot,
|
|
2727
2944
|
{
|
|
2728
|
-
onConfigure:
|
|
2945
|
+
onConfigure: x,
|
|
2729
2946
|
iconSize: d ?? 14,
|
|
2730
|
-
...
|
|
2947
|
+
...C
|
|
2731
2948
|
}
|
|
2732
2949
|
),
|
|
2733
|
-
|
|
2734
|
-
|
|
2950
|
+
c && f && /* @__PURE__ */ l(
|
|
2951
|
+
ge,
|
|
2735
2952
|
{
|
|
2736
|
-
onSwitch:
|
|
2953
|
+
onSwitch: f,
|
|
2737
2954
|
variant: "right-middle",
|
|
2738
2955
|
iconSize: d ?? 14,
|
|
2739
2956
|
...$
|
|
2740
2957
|
}
|
|
2741
2958
|
),
|
|
2742
|
-
|
|
2743
|
-
|
|
2959
|
+
i && s && /* @__PURE__ */ l(
|
|
2960
|
+
he,
|
|
2744
2961
|
{
|
|
2745
2962
|
isCollapsed: r,
|
|
2746
|
-
onToggle:
|
|
2963
|
+
onToggle: s,
|
|
2747
2964
|
side: "right",
|
|
2748
2965
|
iconSize: d ?? 18,
|
|
2749
|
-
...
|
|
2966
|
+
...v
|
|
2750
2967
|
}
|
|
2751
2968
|
)
|
|
2752
2969
|
]
|
|
2753
2970
|
}
|
|
2754
2971
|
) : null;
|
|
2755
2972
|
export {
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2973
|
+
me as AgentCommandInput,
|
|
2974
|
+
je as AgentCommandPalette,
|
|
2975
|
+
ke as AgentResponseDisplay,
|
|
2976
|
+
It as EditableConfigurablePanelLayout,
|
|
2977
|
+
ft as FocusIndicator,
|
|
2978
|
+
Re as LocalStoragePersistenceAdapter,
|
|
2979
|
+
$e as LocalStorageWorkspaceAdapter,
|
|
2980
|
+
he as PanelCollapseButton,
|
|
2981
|
+
ot as PanelConfigureButton,
|
|
2982
|
+
vt as PanelControls,
|
|
2983
|
+
ge as PanelSwitchButton,
|
|
2984
|
+
xe as QuickCommandAutocomplete,
|
|
2985
|
+
At as ResponsiveConfigurablePanelLayout,
|
|
2986
|
+
ye as ToolExecutionList,
|
|
2987
|
+
O as WorkspaceLayoutService,
|
|
2988
|
+
Te as collapseAllPanelsTool,
|
|
2989
|
+
Ce as expandAllPanelsTool,
|
|
2990
|
+
Ae as focusPanelTool,
|
|
2991
|
+
pe as fuzzyMatch,
|
|
2992
|
+
St as generateToolsSystemPrompt,
|
|
2993
|
+
we as getPanelStateTool,
|
|
2994
|
+
be as getVisiblePanelsTool,
|
|
2995
|
+
mt as layoutActionTools,
|
|
2996
|
+
Be as layoutTools,
|
|
2997
|
+
yt as layoutToolsMetadata,
|
|
2998
|
+
Se as listPanelsWithStateTool,
|
|
2999
|
+
zt as mapThemeToPanelVars,
|
|
3000
|
+
Pt as mapThemeToTabVars,
|
|
3001
|
+
ze as resetLayoutTool,
|
|
3002
|
+
Oe as searchQuickCommands,
|
|
3003
|
+
gt as stateQueryTools,
|
|
3004
|
+
Ie as switchPanelTool,
|
|
3005
|
+
ve as togglePanelTool,
|
|
3006
|
+
Je as toolToAIFunction,
|
|
3007
|
+
Qe as toolToAnthropicFormat,
|
|
3008
|
+
Ke as toolToGeminiFunction,
|
|
3009
|
+
He as toolToOpenAIFunction,
|
|
3010
|
+
wt as toolsToAIFunctions,
|
|
3011
|
+
bt as toolsToAnthropicFormat,
|
|
3012
|
+
kt as toolsToGeminiFormat,
|
|
3013
|
+
xt as toolsToOpenAIFormat,
|
|
3014
|
+
ht as useAgentCommandPalette,
|
|
3015
|
+
dt as usePanelFocus,
|
|
3016
|
+
ut as usePanelFocusListener,
|
|
3017
|
+
pt as usePanelKeyboardShortcuts,
|
|
3018
|
+
lt as usePanelPersistence,
|
|
3019
|
+
ct as useWorkspace
|
|
2803
3020
|
};
|
|
2804
3021
|
//# sourceMappingURL=index.esm.js.map
|