@principal-ade/panel-layouts 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.d.ts +82 -1
- package/dist/index.esm.js +1334 -890
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +67 -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
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
class
|
|
1
|
+
import './index.css';var Le = Object.defineProperty;
|
|
2
|
+
var Ee = (o, e, t) => e in o ? Le(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { EditableConfigurablePanelLayout as zt, ResponsiveConfigurablePanelLayout as Pt, mapThemeToPanelVars as Wt, mapThemeToTabVars as _t } from "@principal-ade/panels";
|
|
5
|
+
import { useState as _, useRef as H, useEffect as R, useCallback as S, useMemo as oe } from "react";
|
|
6
|
+
import { jsx as a, jsxs as k, Fragment as ce } from "react/jsx-runtime";
|
|
7
|
+
import { useTheme as Q } from "@principal-ade/industry-theme";
|
|
8
|
+
class Re {
|
|
9
9
|
constructor() {
|
|
10
|
-
|
|
10
|
+
le(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 dt(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, l] = _(t), [n, f] = _(o.collapsed), c = H(o.collapsed), y = H({}), g = H(null), h = H(null);
|
|
38
38
|
R(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const w = await s.load(e);
|
|
41
|
+
w != null && w.sizes && (l(w.sizes), v(w.sizes));
|
|
42
42
|
})();
|
|
43
43
|
}, [e]);
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
"left" in
|
|
44
|
+
const v = S(
|
|
45
|
+
(b) => {
|
|
46
|
+
"left" in b && b.left > 0 && (y.current.left = b.left), "middle" in b && b.middle > 0 && (y.current.middle = b.middle), "right" in b && b.right > 0 && (y.current.right = b.right);
|
|
47
47
|
},
|
|
48
48
|
[]
|
|
49
|
-
),
|
|
50
|
-
(
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
if (
|
|
49
|
+
), u = S(
|
|
50
|
+
(b) => {
|
|
51
|
+
const w = y.current[b];
|
|
52
|
+
if (w && w > 0)
|
|
53
|
+
return w;
|
|
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 = H(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) && (l(t), v(t), d.current = t);
|
|
63
|
+
}, [t, v]), R(() => {
|
|
64
|
+
const b = o.collapsed.left !== c.current.left, w = "right" in o.collapsed && "right" in c.current && o.collapsed.right !== c.current.right;
|
|
65
|
+
(b || w) && (f(o.collapsed), c.current = { ...o.collapsed });
|
|
66
66
|
}, [o.collapsed.left, o.collapsed.right]);
|
|
67
|
-
const
|
|
68
|
-
async (
|
|
67
|
+
const p = S(
|
|
68
|
+
async (b) => {
|
|
69
69
|
try {
|
|
70
|
-
await
|
|
71
|
-
} catch (
|
|
70
|
+
await s.save(e, { sizes: b });
|
|
71
|
+
} catch (w) {
|
|
72
72
|
console.error(
|
|
73
73
|
`Failed to save panel preferences for ${e}:`,
|
|
74
|
-
|
|
74
|
+
w
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
[e,
|
|
79
|
-
), C =
|
|
80
|
-
(
|
|
81
|
-
const
|
|
82
|
-
let
|
|
83
|
-
if ("left" in
|
|
84
|
-
const T = !!(
|
|
78
|
+
[e, s]
|
|
79
|
+
), C = S(
|
|
80
|
+
(b) => {
|
|
81
|
+
const w = { ...b };
|
|
82
|
+
let x = !0;
|
|
83
|
+
if ("left" in b) {
|
|
84
|
+
const T = !!(n != null && n.left), P = b.left;
|
|
85
85
|
if (T) {
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
} else
|
|
86
|
+
const W = u("left");
|
|
87
|
+
W !== void 0 && W > 0 ? w.left = W : x = !1;
|
|
88
|
+
} else P === 0 && (x = !1);
|
|
89
89
|
}
|
|
90
|
-
if (r === "three-panel" && "right" in
|
|
91
|
-
const T = !!(
|
|
90
|
+
if (r === "three-panel" && "right" in b) {
|
|
91
|
+
const T = !!(n != null && n.right), P = b.right;
|
|
92
92
|
if (T) {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
} else
|
|
93
|
+
const W = u("right");
|
|
94
|
+
W !== void 0 && W > 0 ? w.right = W : x = !1;
|
|
95
|
+
} else P === 0 && (x = !1);
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
|
|
97
|
+
if (l(w), v(w), g.current && (clearTimeout(g.current), g.current = null), !x) {
|
|
98
|
+
h.current = null;
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
const T =
|
|
103
|
-
T && (
|
|
101
|
+
h.current = w, g.current = setTimeout(() => {
|
|
102
|
+
const T = h.current;
|
|
103
|
+
T && (p(T), h.current = null), g.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
|
+
v
|
|
112
112
|
]
|
|
113
113
|
);
|
|
114
114
|
R(() => () => {
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
115
|
+
if (g.current) {
|
|
116
|
+
const b = h.current;
|
|
117
|
+
b && (p(b), h.current = null), clearTimeout(g.current), g.current = null;
|
|
118
118
|
}
|
|
119
|
-
}, [
|
|
120
|
-
const
|
|
121
|
-
}, []),
|
|
122
|
-
}, []), I =
|
|
123
|
-
}, []),
|
|
119
|
+
}, [p]);
|
|
120
|
+
const $ = S(async () => {
|
|
121
|
+
}, []), z = S(async () => {
|
|
122
|
+
}, []), I = S(async () => {
|
|
123
|
+
}, []), L = S(async () => {
|
|
124
124
|
}, []);
|
|
125
125
|
return r === "three-panel" ? {
|
|
126
126
|
type: "three-panel",
|
|
127
|
-
sizes:
|
|
128
|
-
collapsed:
|
|
127
|
+
sizes: i,
|
|
128
|
+
collapsed: n,
|
|
129
129
|
handlePanelResize: C,
|
|
130
|
-
handleLeftCollapseComplete:
|
|
131
|
-
handleLeftExpandComplete:
|
|
130
|
+
handleLeftCollapseComplete: $,
|
|
131
|
+
handleLeftExpandComplete: z,
|
|
132
132
|
handleRightCollapseComplete: I,
|
|
133
|
-
handleRightExpandComplete:
|
|
133
|
+
handleRightExpandComplete: L
|
|
134
134
|
} : {
|
|
135
135
|
type: "two-panel",
|
|
136
|
-
sizes:
|
|
137
|
-
collapsed:
|
|
136
|
+
sizes: i,
|
|
137
|
+
collapsed: n,
|
|
138
138
|
handlePanelResize: C,
|
|
139
|
-
handleLeftCollapseComplete:
|
|
140
|
-
handleLeftExpandComplete:
|
|
139
|
+
handleLeftCollapseComplete: $,
|
|
140
|
+
handleLeftExpandComplete: z
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
class
|
|
143
|
+
class De {
|
|
144
144
|
constructor() {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
le(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
|
|
146
|
+
le(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 (l) {
|
|
211
211
|
console.error(
|
|
212
|
-
`Failed to parse repository state for ${
|
|
213
|
-
|
|
212
|
+
`Failed to parse repository state for ${s}:`,
|
|
213
|
+
l
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -221,7 +221,7 @@ class Le {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class
|
|
224
|
+
class N {
|
|
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
|
+
}, l = {
|
|
285
285
|
...r,
|
|
286
|
-
[e]:
|
|
286
|
+
[e]: i
|
|
287
287
|
};
|
|
288
|
-
return await this.adapter.saveWorkspacePresets(
|
|
288
|
+
return await this.adapter.saveWorkspacePresets(l), 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,173 +610,173 @@ 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
|
+
le(N, "adapter", new De());
|
|
614
|
+
function pt(o = {}) {
|
|
615
|
+
const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, i] = _(
|
|
616
616
|
{}
|
|
617
|
-
), [
|
|
617
|
+
), [l, n] = _(null), [f, c] = _(null), [y, g] = _(!0), [h, v] = _(null), u = S(async () => {
|
|
618
618
|
try {
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
let T = await
|
|
619
|
+
g(!0), v(null);
|
|
620
|
+
const x = await N.getWorkspaceLayouts();
|
|
621
|
+
if (i(x), e) {
|
|
622
|
+
let T = await N.getRepositoryState(e);
|
|
623
623
|
if (!T && t) {
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
workspaceId:
|
|
627
|
-
sizes:
|
|
624
|
+
const P = r || "project-management", W = await N.getWorkspaceLayout(P);
|
|
625
|
+
W && (T = {
|
|
626
|
+
workspaceId: P,
|
|
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 N.setRepositoryState(
|
|
637
637
|
e,
|
|
638
638
|
T
|
|
639
639
|
));
|
|
640
640
|
}
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
641
|
+
if (n(T), T != null && T.workspaceId) {
|
|
642
|
+
const P = await N.getWorkspaceLayout(
|
|
643
643
|
T.workspaceId
|
|
644
644
|
);
|
|
645
|
-
|
|
645
|
+
c(P);
|
|
646
646
|
} else
|
|
647
|
-
|
|
647
|
+
c(null);
|
|
648
648
|
}
|
|
649
|
-
} catch (
|
|
650
|
-
x
|
|
649
|
+
} catch (x) {
|
|
650
|
+
v(x), console.error("Failed to load workspace data:", x);
|
|
651
651
|
} finally {
|
|
652
|
-
|
|
652
|
+
g(!1);
|
|
653
653
|
}
|
|
654
654
|
}, [e, t, r]);
|
|
655
655
|
R(() => {
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
const d =
|
|
659
|
-
async (
|
|
656
|
+
u();
|
|
657
|
+
}, [u]);
|
|
658
|
+
const d = S(
|
|
659
|
+
async (x) => await N.getWorkspaceLayout(x),
|
|
660
660
|
[]
|
|
661
|
-
),
|
|
662
|
-
async (
|
|
663
|
-
const T = await
|
|
664
|
-
return await
|
|
661
|
+
), p = S(
|
|
662
|
+
async (x) => {
|
|
663
|
+
const T = await N.createWorkspaceLayout(x);
|
|
664
|
+
return await u(), T;
|
|
665
665
|
},
|
|
666
|
-
[
|
|
667
|
-
), C =
|
|
668
|
-
async (
|
|
669
|
-
const
|
|
670
|
-
return await
|
|
666
|
+
[u]
|
|
667
|
+
), C = S(
|
|
668
|
+
async (x, T) => {
|
|
669
|
+
const P = await N.updateWorkspaceLayout(x, T);
|
|
670
|
+
return await u(), P;
|
|
671
671
|
},
|
|
672
|
-
[
|
|
673
|
-
),
|
|
674
|
-
async (
|
|
675
|
-
const T = await
|
|
676
|
-
return T && await
|
|
672
|
+
[u]
|
|
673
|
+
), $ = S(
|
|
674
|
+
async (x) => {
|
|
675
|
+
const T = await N.deleteWorkspaceLayout(x);
|
|
676
|
+
return T && await u(), T;
|
|
677
677
|
},
|
|
678
|
-
[
|
|
679
|
-
),
|
|
680
|
-
async (
|
|
678
|
+
[u]
|
|
679
|
+
), z = S(
|
|
680
|
+
async (x) => {
|
|
681
681
|
if (!e) {
|
|
682
682
|
console.error("Cannot apply workspace without repositoryKey");
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
|
-
const T = await
|
|
685
|
+
const T = await N.getWorkspaceLayout(x);
|
|
686
686
|
if (!T) {
|
|
687
|
-
console.error(`Workspace ${
|
|
687
|
+
console.error(`Workspace ${x} not found`);
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
691
|
-
workspaceId:
|
|
690
|
+
const P = {
|
|
691
|
+
workspaceId: x,
|
|
692
692
|
sizes: T.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
693
693
|
collapsed: T.defaultCollapsed || {
|
|
694
694
|
left: !1,
|
|
695
695
|
right: !1
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
await
|
|
698
|
+
await N.setRepositoryState(e, P), await u();
|
|
699
699
|
},
|
|
700
|
-
[e,
|
|
701
|
-
), I =
|
|
702
|
-
async (
|
|
700
|
+
[e, u]
|
|
701
|
+
), I = S(
|
|
702
|
+
async (x) => {
|
|
703
703
|
if (!e) {
|
|
704
704
|
console.error("Cannot update sizes without repositoryKey");
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
await
|
|
707
|
+
await N.updateRepositorySizes(e, x), await u();
|
|
708
708
|
},
|
|
709
|
-
[e,
|
|
710
|
-
),
|
|
711
|
-
async (
|
|
709
|
+
[e, u]
|
|
710
|
+
), L = S(
|
|
711
|
+
async (x) => {
|
|
712
712
|
if (!e) {
|
|
713
713
|
console.error("Cannot update collapsed without repositoryKey");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
await
|
|
716
|
+
await N.updateRepositoryCollapsed(
|
|
717
717
|
e,
|
|
718
|
-
|
|
719
|
-
), await
|
|
718
|
+
x
|
|
719
|
+
), await u();
|
|
720
720
|
},
|
|
721
|
-
[e,
|
|
722
|
-
),
|
|
723
|
-
if (!e || !(
|
|
721
|
+
[e, u]
|
|
722
|
+
), b = S(async () => {
|
|
723
|
+
if (!e || !(l != null && l.workspaceId)) {
|
|
724
724
|
console.error("Cannot reset without repositoryKey and active workspace");
|
|
725
725
|
return;
|
|
726
726
|
}
|
|
727
|
-
await
|
|
727
|
+
await N.resetRepositoryToWorkspaceDefaults(
|
|
728
728
|
e,
|
|
729
|
-
|
|
730
|
-
), await
|
|
731
|
-
}, [e,
|
|
732
|
-
await
|
|
733
|
-
}, [
|
|
729
|
+
l.workspaceId
|
|
730
|
+
), await u();
|
|
731
|
+
}, [e, l == null ? void 0 : l.workspaceId, u]), w = S(async () => {
|
|
732
|
+
await u();
|
|
733
|
+
}, [u]);
|
|
734
734
|
return {
|
|
735
|
-
workspaces:
|
|
736
|
-
repositoryState:
|
|
737
|
-
activeWorkspace:
|
|
738
|
-
loading:
|
|
739
|
-
error:
|
|
735
|
+
workspaces: s,
|
|
736
|
+
repositoryState: l,
|
|
737
|
+
activeWorkspace: f,
|
|
738
|
+
loading: y,
|
|
739
|
+
error: h,
|
|
740
740
|
getWorkspace: d,
|
|
741
|
-
createWorkspace:
|
|
741
|
+
createWorkspace: p,
|
|
742
742
|
updateWorkspace: C,
|
|
743
|
-
deleteWorkspace:
|
|
744
|
-
applyWorkspace:
|
|
743
|
+
deleteWorkspace: $,
|
|
744
|
+
applyWorkspace: z,
|
|
745
745
|
updateSizes: I,
|
|
746
|
-
updateCollapsed:
|
|
747
|
-
resetToDefaults:
|
|
748
|
-
refresh:
|
|
746
|
+
updateCollapsed: L,
|
|
747
|
+
resetToDefaults: b,
|
|
748
|
+
refresh: w
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function ut(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: l
|
|
759
|
+
} = o, [n, f] = _(
|
|
760
760
|
e
|
|
761
|
-
),
|
|
761
|
+
), c = S(
|
|
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 && l) {
|
|
765
|
+
if (p) {
|
|
766
|
+
const $ = l(p);
|
|
767
|
+
$ && 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: $,
|
|
773
|
+
panelSlot: p,
|
|
774
|
+
nextPanelId: l(d)
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
const C =
|
|
779
|
-
C &&
|
|
778
|
+
const C = l(d);
|
|
779
|
+
C && i.emit({
|
|
780
780
|
type: "panel:focus",
|
|
781
781
|
source: "panel-layouts",
|
|
782
782
|
timestamp: Date.now(),
|
|
@@ -788,118 +788,118 @@ function nt(o = {}) {
|
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
|
-
[
|
|
792
|
-
),
|
|
793
|
-
const d =
|
|
794
|
-
if (
|
|
795
|
-
const
|
|
796
|
-
|
|
791
|
+
[n, s, i, l]
|
|
792
|
+
), y = S(() => {
|
|
793
|
+
const d = n;
|
|
794
|
+
if (f(null), s == null || s(null), i && l && d) {
|
|
795
|
+
const p = l(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, l]), g = S(() => {
|
|
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]), h = S(() => {
|
|
810
|
+
const d = g();
|
|
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 C = (
|
|
822
|
-
|
|
823
|
-
}, [
|
|
824
|
-
const d =
|
|
821
|
+
const C = (p + 1) % d.length;
|
|
822
|
+
c(d[C]);
|
|
823
|
+
}, [n, g, c]), v = S(() => {
|
|
824
|
+
const d = g();
|
|
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 C =
|
|
836
|
-
|
|
837
|
-
}, [
|
|
838
|
-
(d) =>
|
|
839
|
-
[
|
|
835
|
+
const C = p === 0 ? d.length - 1 : p - 1;
|
|
836
|
+
c(d[C]);
|
|
837
|
+
}, [n, g, c]), u = S(
|
|
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: y,
|
|
845
|
+
focusNext: h,
|
|
846
|
+
focusPrevious: v,
|
|
847
|
+
isFocused: u
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function ft(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: l,
|
|
858
|
+
onCollapse: n
|
|
859
|
+
} = o, f = H(t), c = H(r), y = H(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
|
+
y.current = s;
|
|
866
|
+
}, [s]);
|
|
867
|
+
const g = S(
|
|
868
|
+
(h) => {
|
|
869
|
+
if (!h.altKey || h.ctrlKey || h.metaKey || h.shiftKey)
|
|
870
870
|
return;
|
|
871
|
-
const
|
|
872
|
-
|
|
871
|
+
const v = h.code, u = f.current, d = c.current, p = y.current;
|
|
872
|
+
v === "Digit1" || v === "Numpad1" ? (h.preventDefault(), d.left ? l("left") : u !== "left" ? i("left") : (n("left"), i("middle"))) : v === "Digit2" || v === "Numpad2" ? (h.preventDefault(), i("middle")) : (v === "Digit3" || v === "Numpad3") && p === "three-panel" && (h.preventDefault(), d.right ? l("right") : u !== "right" ? i("right") : (n("right"), i("middle")));
|
|
873
873
|
},
|
|
874
|
-
[
|
|
874
|
+
[i, l, n]
|
|
875
875
|
);
|
|
876
876
|
R(() => {
|
|
877
877
|
if (e)
|
|
878
|
-
return window.addEventListener("keydown",
|
|
879
|
-
window.removeEventListener("keydown",
|
|
878
|
+
return window.addEventListener("keydown", g), () => {
|
|
879
|
+
window.removeEventListener("keydown", g);
|
|
880
880
|
};
|
|
881
|
-
}, [e,
|
|
881
|
+
}, [e, g]);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function gt(o, e, t, r) {
|
|
884
884
|
R(() => {
|
|
885
|
-
const
|
|
885
|
+
const s = e.on(
|
|
886
886
|
"panel:focus",
|
|
887
|
-
(
|
|
888
|
-
|
|
887
|
+
(l) => {
|
|
888
|
+
l.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
|
+
(l) => {
|
|
895
|
+
l.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 ht = ({
|
|
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__ */ a(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
926
926
|
className: `panel-focus-indicator ${e}`,
|
|
@@ -929,29 +929,255 @@ const it = ({
|
|
|
929
929
|
"aria-hidden": "true"
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
|
-
},
|
|
932
|
+
}, fe = "focus-mode-overlay-keyframes", Me = () => {
|
|
933
|
+
if (typeof document > "u" || document.getElementById(fe)) return;
|
|
934
|
+
const o = document.createElement("style");
|
|
935
|
+
o.id = fe, o.textContent = `
|
|
936
|
+
@keyframes focus-overlay-vignette-drift {
|
|
937
|
+
0%, 100% {
|
|
938
|
+
background-position: 50% 50%;
|
|
939
|
+
transform: scale(1);
|
|
940
|
+
}
|
|
941
|
+
25% {
|
|
942
|
+
background-position: 20% 30%;
|
|
943
|
+
transform: scale(1.1);
|
|
944
|
+
}
|
|
945
|
+
50% {
|
|
946
|
+
background-position: 80% 70%;
|
|
947
|
+
transform: scale(1.05);
|
|
948
|
+
}
|
|
949
|
+
75% {
|
|
950
|
+
background-position: 70% 20%;
|
|
951
|
+
transform: scale(1.15);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
@keyframes focus-overlay-radial-breathing {
|
|
956
|
+
0%, 100% {
|
|
957
|
+
opacity: 1;
|
|
958
|
+
transform: scale(1);
|
|
959
|
+
}
|
|
960
|
+
50% {
|
|
961
|
+
opacity: 0.4;
|
|
962
|
+
transform: scale(1.3);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
@keyframes focus-overlay-snowfall-1 {
|
|
967
|
+
from { background-position: 0px 0px; }
|
|
968
|
+
to { background-position: 0px 150px; }
|
|
969
|
+
}
|
|
970
|
+
@keyframes focus-overlay-snowfall-2 {
|
|
971
|
+
from { background-position: 0px 0px; }
|
|
972
|
+
to { background-position: 0px 150px; }
|
|
973
|
+
}
|
|
974
|
+
@keyframes focus-overlay-snowfall-3 {
|
|
975
|
+
from { background-position: 0px 0px; }
|
|
976
|
+
to { background-position: 0px 150px; }
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
`, document.head.appendChild(o);
|
|
980
|
+
}, yt = ({
|
|
981
|
+
active: o,
|
|
982
|
+
variant: e = "soft-fade",
|
|
983
|
+
effects: t = [],
|
|
984
|
+
opacity: r = 0.95,
|
|
985
|
+
animationDuration: s = 300,
|
|
986
|
+
cascadeDelay: i = 0,
|
|
987
|
+
color: l,
|
|
988
|
+
className: n = "",
|
|
989
|
+
style: f = {}
|
|
990
|
+
}) => {
|
|
991
|
+
const { theme: c } = Q(), [y, g] = _(!1);
|
|
992
|
+
R(() => {
|
|
993
|
+
Me();
|
|
994
|
+
}, []), R(() => {
|
|
995
|
+
if (o) {
|
|
996
|
+
const O = setTimeout(() => g(!0), i);
|
|
997
|
+
return () => clearTimeout(O);
|
|
998
|
+
} else
|
|
999
|
+
g(!1);
|
|
1000
|
+
}, [o, i]);
|
|
1001
|
+
const h = l || c.colors.background, u = {
|
|
1002
|
+
position: "absolute",
|
|
1003
|
+
top: 0,
|
|
1004
|
+
left: 0,
|
|
1005
|
+
right: 0,
|
|
1006
|
+
bottom: 0,
|
|
1007
|
+
pointerEvents: "none",
|
|
1008
|
+
zIndex: 999,
|
|
1009
|
+
overflow: "hidden",
|
|
1010
|
+
...(() => {
|
|
1011
|
+
switch (e) {
|
|
1012
|
+
case "soft-fade":
|
|
1013
|
+
return {
|
|
1014
|
+
backgroundColor: h,
|
|
1015
|
+
opacity: y ? r : 0,
|
|
1016
|
+
transition: `opacity ${s}ms ease-out`
|
|
1017
|
+
};
|
|
1018
|
+
case "cascading-fade":
|
|
1019
|
+
return {
|
|
1020
|
+
backgroundColor: h,
|
|
1021
|
+
opacity: y ? r : 0,
|
|
1022
|
+
transition: `opacity ${s}ms ease-out`,
|
|
1023
|
+
transitionDelay: y ? "0ms" : `${i}ms`
|
|
1024
|
+
};
|
|
1025
|
+
default:
|
|
1026
|
+
return {
|
|
1027
|
+
backgroundColor: h,
|
|
1028
|
+
opacity: y ? r : 0,
|
|
1029
|
+
transition: `opacity ${s}ms ease-out`
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
})(),
|
|
1033
|
+
...f
|
|
1034
|
+
}, d = t.includes("vignette-drift"), p = t.includes("radial-breathing"), C = t.includes("snowfall"), $ = (O, F) => {
|
|
1035
|
+
const ee = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(O);
|
|
1036
|
+
if (!ee) return `rgba(255, 255, 255, ${F})`;
|
|
1037
|
+
const V = parseInt(ee[1], 16), J = parseInt(ee[2], 16), ne = parseInt(ee[3], 16);
|
|
1038
|
+
return `rgba(${V}, ${J}, ${ne}, ${F})`;
|
|
1039
|
+
}, z = c.colors.primary, I = {
|
|
1040
|
+
position: "absolute",
|
|
1041
|
+
top: 0,
|
|
1042
|
+
left: 0,
|
|
1043
|
+
right: 0,
|
|
1044
|
+
bottom: 0,
|
|
1045
|
+
pointerEvents: "none",
|
|
1046
|
+
opacity: y ? 1 : 0,
|
|
1047
|
+
transition: `opacity ${s}ms ease-out`,
|
|
1048
|
+
background: `radial-gradient(circle at 50% 50%, ${$(z, 0.12)} 0%, ${$(z, 0.06)} 25%, transparent 50%)`,
|
|
1049
|
+
backgroundSize: "150% 150%",
|
|
1050
|
+
animation: y ? "focus-overlay-vignette-drift 12s ease-in-out infinite" : "none"
|
|
1051
|
+
}, L = {
|
|
1052
|
+
position: "absolute",
|
|
1053
|
+
top: 0,
|
|
1054
|
+
left: 0,
|
|
1055
|
+
right: 0,
|
|
1056
|
+
bottom: 0,
|
|
1057
|
+
pointerEvents: "none",
|
|
1058
|
+
opacity: y ? 1 : 0,
|
|
1059
|
+
transition: `opacity ${s}ms ease-out`,
|
|
1060
|
+
background: `radial-gradient(circle at center, ${$(z, 0.15)} 0%, ${$(z, 0.06)} 30%, transparent 55%)`,
|
|
1061
|
+
animation: y ? "focus-overlay-radial-breathing 4s ease-in-out infinite" : "none"
|
|
1062
|
+
}, b = $(z, 0.6), w = $(z, 0.4), x = $(z, 0.25), T = {
|
|
1063
|
+
position: "absolute",
|
|
1064
|
+
top: 0,
|
|
1065
|
+
left: 0,
|
|
1066
|
+
right: 0,
|
|
1067
|
+
bottom: 0,
|
|
1068
|
+
pointerEvents: "none",
|
|
1069
|
+
opacity: y ? 1 : 0,
|
|
1070
|
+
transition: `opacity ${s}ms ease-out`
|
|
1071
|
+
}, P = {
|
|
1072
|
+
...T,
|
|
1073
|
+
background: `
|
|
1074
|
+
radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px),
|
|
1075
|
+
radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px),
|
|
1076
|
+
radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px),
|
|
1077
|
+
radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px)
|
|
1078
|
+
`,
|
|
1079
|
+
backgroundSize: "150px 150px",
|
|
1080
|
+
backgroundPosition: "10px 20px, 60px 80px, 110px 40px, 40px 120px",
|
|
1081
|
+
animation: y ? "focus-overlay-snowfall-1 4s linear infinite" : "none"
|
|
1082
|
+
}, W = {
|
|
1083
|
+
...T,
|
|
1084
|
+
background: `
|
|
1085
|
+
radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
|
|
1086
|
+
radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
|
|
1087
|
+
radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
|
|
1088
|
+
radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
|
|
1089
|
+
radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px)
|
|
1090
|
+
`,
|
|
1091
|
+
backgroundSize: "150px 150px",
|
|
1092
|
+
backgroundPosition: "30px 10px, 90px 60px, 15px 100px, 120px 30px, 70px 130px",
|
|
1093
|
+
animation: y ? "focus-overlay-snowfall-2 7s linear infinite" : "none"
|
|
1094
|
+
}, A = {
|
|
1095
|
+
...T,
|
|
1096
|
+
background: `
|
|
1097
|
+
radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
|
|
1098
|
+
radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
|
|
1099
|
+
radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
|
|
1100
|
+
radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
|
|
1101
|
+
radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
|
|
1102
|
+
radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px)
|
|
1103
|
+
`,
|
|
1104
|
+
backgroundSize: "150px 150px",
|
|
1105
|
+
backgroundPosition: "20px 5px, 80px 45px, 45px 90px, 130px 20px, 5px 70px, 100px 110px",
|
|
1106
|
+
animation: y ? "focus-overlay-snowfall-3 12s linear infinite" : "none"
|
|
1107
|
+
};
|
|
1108
|
+
return /* @__PURE__ */ k(
|
|
1109
|
+
"div",
|
|
1110
|
+
{
|
|
1111
|
+
className: `focus-mode-overlay focus-mode-overlay--${e} ${n}`,
|
|
1112
|
+
style: u,
|
|
1113
|
+
role: "presentation",
|
|
1114
|
+
"aria-hidden": "true",
|
|
1115
|
+
"data-active": o,
|
|
1116
|
+
"data-variant": e,
|
|
1117
|
+
children: [
|
|
1118
|
+
d && /* @__PURE__ */ a(
|
|
1119
|
+
"div",
|
|
1120
|
+
{
|
|
1121
|
+
className: "focus-mode-overlay__vignette-drift",
|
|
1122
|
+
style: I
|
|
1123
|
+
}
|
|
1124
|
+
),
|
|
1125
|
+
p && /* @__PURE__ */ a(
|
|
1126
|
+
"div",
|
|
1127
|
+
{
|
|
1128
|
+
className: "focus-mode-overlay__radial-breathing",
|
|
1129
|
+
style: L
|
|
1130
|
+
}
|
|
1131
|
+
),
|
|
1132
|
+
C && /* @__PURE__ */ k(ce, { children: [
|
|
1133
|
+
/* @__PURE__ */ a(
|
|
1134
|
+
"div",
|
|
1135
|
+
{
|
|
1136
|
+
className: "focus-mode-overlay__snowfall-layer-3",
|
|
1137
|
+
style: A
|
|
1138
|
+
}
|
|
1139
|
+
),
|
|
1140
|
+
/* @__PURE__ */ a(
|
|
1141
|
+
"div",
|
|
1142
|
+
{
|
|
1143
|
+
className: "focus-mode-overlay__snowfall-layer-2",
|
|
1144
|
+
style: W
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ a(
|
|
1148
|
+
"div",
|
|
1149
|
+
{
|
|
1150
|
+
className: "focus-mode-overlay__snowfall-layer-1",
|
|
1151
|
+
style: P
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1154
|
+
] })
|
|
1155
|
+
]
|
|
1156
|
+
}
|
|
1157
|
+
);
|
|
1158
|
+
}, me = ({
|
|
933
1159
|
value: o,
|
|
934
1160
|
onChange: e,
|
|
935
1161
|
onSubmit: t,
|
|
936
1162
|
onClose: r,
|
|
937
|
-
onHistoryPrevious:
|
|
938
|
-
onHistoryNext:
|
|
939
|
-
mode:
|
|
940
|
-
status:
|
|
941
|
-
placeholder:
|
|
942
|
-
disabled:
|
|
943
|
-
autoFocus:
|
|
944
|
-
agentAvailable:
|
|
945
|
-
showAutocomplete:
|
|
946
|
-
onAutocompleteNext:
|
|
947
|
-
onAutocompletePrevious:
|
|
1163
|
+
onHistoryPrevious: s,
|
|
1164
|
+
onHistoryNext: i,
|
|
1165
|
+
mode: l,
|
|
1166
|
+
status: n,
|
|
1167
|
+
placeholder: f = "What would you like to do?",
|
|
1168
|
+
disabled: c = !1,
|
|
1169
|
+
autoFocus: y = !0,
|
|
1170
|
+
agentAvailable: g = !0,
|
|
1171
|
+
showAutocomplete: h = !1,
|
|
1172
|
+
onAutocompleteNext: v,
|
|
1173
|
+
onAutocompletePrevious: u,
|
|
948
1174
|
onAutocompleteAccept: d
|
|
949
1175
|
}) => {
|
|
950
|
-
const { theme:
|
|
1176
|
+
const { theme: p } = Q(), C = H(null);
|
|
951
1177
|
R(() => {
|
|
952
|
-
|
|
953
|
-
}, [
|
|
954
|
-
const
|
|
1178
|
+
y && C.current && C.current.focus();
|
|
1179
|
+
}, [y]);
|
|
1180
|
+
const $ = (I) => {
|
|
955
1181
|
switch (I.stopPropagation(), I.key) {
|
|
956
1182
|
case "Enter":
|
|
957
1183
|
I.preventDefault(), t();
|
|
@@ -960,17 +1186,17 @@ const it = ({
|
|
|
960
1186
|
I.preventDefault(), r();
|
|
961
1187
|
break;
|
|
962
1188
|
case "Tab":
|
|
963
|
-
|
|
1189
|
+
h && d && (I.preventDefault(), d());
|
|
964
1190
|
break;
|
|
965
1191
|
case "ArrowUp":
|
|
966
|
-
I.preventDefault(),
|
|
1192
|
+
I.preventDefault(), h && u ? u() : s();
|
|
967
1193
|
break;
|
|
968
1194
|
case "ArrowDown":
|
|
969
|
-
I.preventDefault(),
|
|
1195
|
+
I.preventDefault(), h && v ? v() : i();
|
|
970
1196
|
break;
|
|
971
1197
|
}
|
|
972
|
-
},
|
|
973
|
-
return /* @__PURE__ */
|
|
1198
|
+
}, z = n === "thinking" || n === "executing";
|
|
1199
|
+
return /* @__PURE__ */ k(
|
|
974
1200
|
"div",
|
|
975
1201
|
{
|
|
976
1202
|
style: {
|
|
@@ -978,22 +1204,22 @@ const it = ({
|
|
|
978
1204
|
alignItems: "center",
|
|
979
1205
|
gap: "8px",
|
|
980
1206
|
padding: "12px 16px",
|
|
981
|
-
backgroundColor:
|
|
982
|
-
borderBottom: `1px solid ${
|
|
1207
|
+
backgroundColor: p.colors.background,
|
|
1208
|
+
borderBottom: `1px solid ${p.colors.border}`
|
|
983
1209
|
},
|
|
984
1210
|
children: [
|
|
985
|
-
/* @__PURE__ */
|
|
1211
|
+
/* @__PURE__ */ a(
|
|
986
1212
|
"span",
|
|
987
1213
|
{
|
|
988
1214
|
style: {
|
|
989
|
-
color:
|
|
990
|
-
fontFamily:
|
|
991
|
-
fontSize:
|
|
1215
|
+
color: l === "quick-command" ? p.colors.info : g ? p.colors.primary : p.colors.textMuted,
|
|
1216
|
+
fontFamily: p.fonts.monospace,
|
|
1217
|
+
fontSize: p.fontSizes[1],
|
|
992
1218
|
userSelect: "none",
|
|
993
1219
|
display: "flex",
|
|
994
1220
|
alignItems: "center"
|
|
995
1221
|
},
|
|
996
|
-
children:
|
|
1222
|
+
children: l === "quick-command" ? /* @__PURE__ */ k(
|
|
997
1223
|
"svg",
|
|
998
1224
|
{
|
|
999
1225
|
width: "16",
|
|
@@ -1005,11 +1231,11 @@ const it = ({
|
|
|
1005
1231
|
strokeLinecap: "round",
|
|
1006
1232
|
strokeLinejoin: "round",
|
|
1007
1233
|
children: [
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ a("polyline", { points: "4 17 10 11 4 5" }),
|
|
1235
|
+
/* @__PURE__ */ a("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
1010
1236
|
]
|
|
1011
1237
|
}
|
|
1012
|
-
) :
|
|
1238
|
+
) : g ? /* @__PURE__ */ k(
|
|
1013
1239
|
"svg",
|
|
1014
1240
|
{
|
|
1015
1241
|
width: "16",
|
|
@@ -1021,17 +1247,17 @@ const it = ({
|
|
|
1021
1247
|
strokeLinecap: "round",
|
|
1022
1248
|
strokeLinejoin: "round",
|
|
1023
1249
|
children: [
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1250
|
+
/* @__PURE__ */ a("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }),
|
|
1251
|
+
/* @__PURE__ */ a("circle", { cx: "12", cy: "5", r: "2" }),
|
|
1252
|
+
/* @__PURE__ */ a("path", { d: "M12 7v4" }),
|
|
1253
|
+
/* @__PURE__ */ a("line", { x1: "8", y1: "16", x2: "8", y2: "16" }),
|
|
1254
|
+
/* @__PURE__ */ a("line", { x1: "16", y1: "16", x2: "16", y2: "16" })
|
|
1029
1255
|
]
|
|
1030
1256
|
}
|
|
1031
1257
|
) : ">"
|
|
1032
1258
|
}
|
|
1033
1259
|
),
|
|
1034
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ a(
|
|
1035
1261
|
"input",
|
|
1036
1262
|
{
|
|
1037
1263
|
ref: C,
|
|
@@ -1039,33 +1265,33 @@ const it = ({
|
|
|
1039
1265
|
type: "text",
|
|
1040
1266
|
value: o,
|
|
1041
1267
|
onChange: (I) => e(I.target.value),
|
|
1042
|
-
onKeyDown:
|
|
1043
|
-
placeholder:
|
|
1044
|
-
disabled:
|
|
1268
|
+
onKeyDown: $,
|
|
1269
|
+
placeholder: f,
|
|
1270
|
+
disabled: c || z,
|
|
1045
1271
|
style: {
|
|
1046
1272
|
flex: 1,
|
|
1047
1273
|
backgroundColor: "transparent",
|
|
1048
1274
|
border: "none",
|
|
1049
1275
|
outline: "none",
|
|
1050
|
-
color:
|
|
1051
|
-
fontFamily:
|
|
1052
|
-
fontSize:
|
|
1053
|
-
caretColor:
|
|
1276
|
+
color: p.colors.text,
|
|
1277
|
+
fontFamily: p.fonts.monospace,
|
|
1278
|
+
fontSize: p.fontSizes[1],
|
|
1279
|
+
caretColor: p.colors.primary
|
|
1054
1280
|
}
|
|
1055
1281
|
}
|
|
1056
1282
|
),
|
|
1057
|
-
|
|
1283
|
+
z && /* @__PURE__ */ k(
|
|
1058
1284
|
"span",
|
|
1059
1285
|
{
|
|
1060
1286
|
style: {
|
|
1061
|
-
color:
|
|
1062
|
-
fontSize:
|
|
1287
|
+
color: p.colors.info,
|
|
1288
|
+
fontSize: p.fontSizes[0],
|
|
1063
1289
|
display: "flex",
|
|
1064
1290
|
alignItems: "center",
|
|
1065
1291
|
gap: "4px"
|
|
1066
1292
|
},
|
|
1067
1293
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1294
|
+
/* @__PURE__ */ a(
|
|
1069
1295
|
"span",
|
|
1070
1296
|
{
|
|
1071
1297
|
style: {
|
|
@@ -1073,25 +1299,25 @@ const it = ({
|
|
|
1073
1299
|
width: "8px",
|
|
1074
1300
|
height: "8px",
|
|
1075
1301
|
borderRadius: "50%",
|
|
1076
|
-
backgroundColor:
|
|
1302
|
+
backgroundColor: p.colors.info,
|
|
1077
1303
|
animation: "pulse 1s ease-in-out infinite"
|
|
1078
1304
|
}
|
|
1079
1305
|
}
|
|
1080
1306
|
),
|
|
1081
|
-
|
|
1307
|
+
n === "thinking" ? "Thinking..." : "Executing..."
|
|
1082
1308
|
]
|
|
1083
1309
|
}
|
|
1084
1310
|
),
|
|
1085
|
-
|
|
1311
|
+
!z && /* @__PURE__ */ a(
|
|
1086
1312
|
"kbd",
|
|
1087
1313
|
{
|
|
1088
1314
|
style: {
|
|
1089
1315
|
padding: "2px 6px",
|
|
1090
|
-
backgroundColor:
|
|
1316
|
+
backgroundColor: p.colors.backgroundSecondary,
|
|
1091
1317
|
borderRadius: "3px",
|
|
1092
|
-
border: `1px solid ${
|
|
1093
|
-
fontSize:
|
|
1094
|
-
color:
|
|
1318
|
+
border: `1px solid ${p.colors.border}`,
|
|
1319
|
+
fontSize: p.fontSizes[0],
|
|
1320
|
+
color: p.colors.textMuted
|
|
1095
1321
|
},
|
|
1096
1322
|
children: "Alt+P"
|
|
1097
1323
|
}
|
|
@@ -1100,9 +1326,9 @@ const it = ({
|
|
|
1100
1326
|
}
|
|
1101
1327
|
);
|
|
1102
1328
|
};
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
const { theme: e } =
|
|
1329
|
+
me.displayName = "AgentCommandInput";
|
|
1330
|
+
const je = ({ status: o }) => {
|
|
1331
|
+
const { theme: e } = Q(), t = {
|
|
1106
1332
|
display: "inline-flex",
|
|
1107
1333
|
alignItems: "center",
|
|
1108
1334
|
justifyContent: "center",
|
|
@@ -1112,9 +1338,9 @@ const _e = ({ status: o }) => {
|
|
|
1112
1338
|
};
|
|
1113
1339
|
switch (o) {
|
|
1114
1340
|
case "pending":
|
|
1115
|
-
return /* @__PURE__ */
|
|
1341
|
+
return /* @__PURE__ */ a("span", { style: { ...t, color: e.colors.textMuted }, children: "○" });
|
|
1116
1342
|
case "running":
|
|
1117
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ a(
|
|
1118
1344
|
"span",
|
|
1119
1345
|
{
|
|
1120
1346
|
style: {
|
|
@@ -1126,16 +1352,16 @@ const _e = ({ status: o }) => {
|
|
|
1126
1352
|
}
|
|
1127
1353
|
);
|
|
1128
1354
|
case "success":
|
|
1129
|
-
return /* @__PURE__ */
|
|
1355
|
+
return /* @__PURE__ */ a("span", { style: { ...t, color: e.colors.success }, children: "✓" });
|
|
1130
1356
|
case "error":
|
|
1131
|
-
return /* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ a("span", { style: { ...t, color: e.colors.error }, children: "✗" });
|
|
1132
1358
|
}
|
|
1133
|
-
},
|
|
1359
|
+
}, qe = (o) => {
|
|
1134
1360
|
const e = Object.entries(o);
|
|
1135
1361
|
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__ */
|
|
1362
|
+
}, Ne = ({ tool: o, compact: e }) => {
|
|
1363
|
+
const { theme: t } = Q(), r = qe(o.args);
|
|
1364
|
+
return /* @__PURE__ */ k(
|
|
1139
1365
|
"div",
|
|
1140
1366
|
{
|
|
1141
1367
|
style: {
|
|
@@ -1147,16 +1373,16 @@ const _e = ({ status: o }) => {
|
|
|
1147
1373
|
fontSize: t.fontSizes[1]
|
|
1148
1374
|
},
|
|
1149
1375
|
children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ a(je, { status: o.status }),
|
|
1377
|
+
/* @__PURE__ */ k("span", { style: { color: t.colors.text }, children: [
|
|
1152
1378
|
o.name,
|
|
1153
|
-
r && /* @__PURE__ */
|
|
1379
|
+
r && /* @__PURE__ */ k("span", { style: { color: t.colors.textMuted }, children: [
|
|
1154
1380
|
"(",
|
|
1155
1381
|
r,
|
|
1156
1382
|
")"
|
|
1157
1383
|
] })
|
|
1158
1384
|
] }),
|
|
1159
|
-
o.status === "running" && /* @__PURE__ */
|
|
1385
|
+
o.status === "running" && /* @__PURE__ */ a(
|
|
1160
1386
|
"span",
|
|
1161
1387
|
{
|
|
1162
1388
|
style: {
|
|
@@ -1167,7 +1393,7 @@ const _e = ({ status: o }) => {
|
|
|
1167
1393
|
children: "[running]"
|
|
1168
1394
|
}
|
|
1169
1395
|
),
|
|
1170
|
-
o.status === "success" && /* @__PURE__ */
|
|
1396
|
+
o.status === "success" && /* @__PURE__ */ a(
|
|
1171
1397
|
"span",
|
|
1172
1398
|
{
|
|
1173
1399
|
style: {
|
|
@@ -1178,7 +1404,7 @@ const _e = ({ status: o }) => {
|
|
|
1178
1404
|
children: "[done]"
|
|
1179
1405
|
}
|
|
1180
1406
|
),
|
|
1181
|
-
o.status === "error" && /* @__PURE__ */
|
|
1407
|
+
o.status === "error" && /* @__PURE__ */ a(
|
|
1182
1408
|
"span",
|
|
1183
1409
|
{
|
|
1184
1410
|
style: {
|
|
@@ -1193,12 +1419,12 @@ const _e = ({ status: o }) => {
|
|
|
1193
1419
|
]
|
|
1194
1420
|
}
|
|
1195
1421
|
);
|
|
1196
|
-
},
|
|
1422
|
+
}, xe = ({
|
|
1197
1423
|
tools: o,
|
|
1198
1424
|
compact: e = !1
|
|
1199
1425
|
}) => {
|
|
1200
|
-
const { theme: t } =
|
|
1201
|
-
return o.length === 0 ? null : /* @__PURE__ */
|
|
1426
|
+
const { theme: t } = Q();
|
|
1427
|
+
return o.length === 0 ? null : /* @__PURE__ */ a(
|
|
1202
1428
|
"div",
|
|
1203
1429
|
{
|
|
1204
1430
|
style: {
|
|
@@ -1207,36 +1433,36 @@ const _e = ({ status: o }) => {
|
|
|
1207
1433
|
borderRadius: "4px",
|
|
1208
1434
|
margin: "8px 16px"
|
|
1209
1435
|
},
|
|
1210
|
-
children: o.map((r) => /* @__PURE__ */
|
|
1436
|
+
children: o.map((r) => /* @__PURE__ */ a(Ne, { tool: r, compact: e }, r.id))
|
|
1211
1437
|
}
|
|
1212
1438
|
);
|
|
1213
1439
|
};
|
|
1214
|
-
|
|
1215
|
-
const
|
|
1440
|
+
xe.displayName = "ToolExecutionList";
|
|
1441
|
+
const ke = ({
|
|
1216
1442
|
response: o,
|
|
1217
1443
|
streaming: e = !1
|
|
1218
1444
|
}) => {
|
|
1219
|
-
const { theme: t } =
|
|
1445
|
+
const { theme: t } = Q();
|
|
1220
1446
|
if (!o)
|
|
1221
1447
|
return null;
|
|
1222
|
-
const r = o.toLowerCase().startsWith("error"),
|
|
1223
|
-
return /* @__PURE__ */
|
|
1448
|
+
const r = o.toLowerCase().startsWith("error"), s = o.toLowerCase().startsWith("done") || o.toLowerCase().startsWith("executed");
|
|
1449
|
+
return /* @__PURE__ */ k(
|
|
1224
1450
|
"div",
|
|
1225
1451
|
{
|
|
1226
1452
|
style: {
|
|
1227
1453
|
padding: "12px 16px",
|
|
1228
|
-
color: r ? t.colors.error :
|
|
1454
|
+
color: r ? t.colors.error : s ? t.colors.success : t.colors.text,
|
|
1229
1455
|
fontSize: t.fontSizes[1],
|
|
1230
1456
|
display: "flex",
|
|
1231
1457
|
alignItems: "center",
|
|
1232
1458
|
gap: "8px"
|
|
1233
1459
|
},
|
|
1234
1460
|
children: [
|
|
1235
|
-
|
|
1236
|
-
r && /* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1461
|
+
s && /* @__PURE__ */ a("span", { children: "✓" }),
|
|
1462
|
+
r && /* @__PURE__ */ a("span", { children: "✗" }),
|
|
1463
|
+
/* @__PURE__ */ k("span", { children: [
|
|
1238
1464
|
o,
|
|
1239
|
-
e && /* @__PURE__ */
|
|
1465
|
+
e && /* @__PURE__ */ a(
|
|
1240
1466
|
"span",
|
|
1241
1467
|
{
|
|
1242
1468
|
style: {
|
|
@@ -1254,76 +1480,177 @@ const pe = ({
|
|
|
1254
1480
|
}
|
|
1255
1481
|
);
|
|
1256
1482
|
};
|
|
1257
|
-
|
|
1258
|
-
function
|
|
1483
|
+
ke.displayName = "AgentResponseDisplay";
|
|
1484
|
+
function ge({
|
|
1259
1485
|
text: o,
|
|
1260
1486
|
matchedIndices: e,
|
|
1261
1487
|
highlightColor: t
|
|
1262
1488
|
}) {
|
|
1263
1489
|
if (!e.length)
|
|
1264
|
-
return /* @__PURE__ */
|
|
1265
|
-
const r = new Set(e),
|
|
1266
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ a(ce, { children: o });
|
|
1491
|
+
const r = new Set(e), s = o.split("");
|
|
1492
|
+
return /* @__PURE__ */ a(ce, { children: s.map((i, l) => /* @__PURE__ */ a(
|
|
1267
1493
|
"span",
|
|
1268
1494
|
{
|
|
1269
1495
|
style: {
|
|
1270
|
-
color: r.has(
|
|
1271
|
-
fontWeight: r.has(
|
|
1496
|
+
color: r.has(l) ? t : "inherit",
|
|
1497
|
+
fontWeight: r.has(l) ? 600 : "inherit"
|
|
1272
1498
|
},
|
|
1273
|
-
children:
|
|
1499
|
+
children: i
|
|
1274
1500
|
},
|
|
1275
|
-
|
|
1501
|
+
l
|
|
1276
1502
|
)) });
|
|
1277
1503
|
}
|
|
1278
|
-
const
|
|
1504
|
+
const be = ({
|
|
1279
1505
|
matches: o,
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1506
|
+
argumentMatches: e = [],
|
|
1507
|
+
currentArg: t,
|
|
1508
|
+
isEnteringArgs: r = !1,
|
|
1509
|
+
selectedIndex: s,
|
|
1510
|
+
onSelect: i,
|
|
1511
|
+
maxVisible: l = 6
|
|
1283
1512
|
}) => {
|
|
1284
|
-
const { theme: n } =
|
|
1513
|
+
const { theme: n } = Q(), f = H(null), c = H(null);
|
|
1285
1514
|
if (R(() => {
|
|
1286
|
-
|
|
1515
|
+
c.current && f.current && c.current.scrollIntoView({
|
|
1287
1516
|
block: "nearest",
|
|
1288
1517
|
behavior: "smooth"
|
|
1289
1518
|
});
|
|
1290
|
-
}, [
|
|
1519
|
+
}, [s]), r && e.length > 0) {
|
|
1520
|
+
const v = 40 * l;
|
|
1521
|
+
return /* @__PURE__ */ k(
|
|
1522
|
+
"div",
|
|
1523
|
+
{
|
|
1524
|
+
ref: f,
|
|
1525
|
+
style: {
|
|
1526
|
+
maxHeight: `${v}px`,
|
|
1527
|
+
overflowY: "auto",
|
|
1528
|
+
borderTop: `1px solid ${n.colors.border}`
|
|
1529
|
+
},
|
|
1530
|
+
children: [
|
|
1531
|
+
t && /* @__PURE__ */ k(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
style: {
|
|
1535
|
+
padding: "8px 16px",
|
|
1536
|
+
fontSize: n.fontSizes[0],
|
|
1537
|
+
color: n.colors.textMuted,
|
|
1538
|
+
backgroundColor: n.colors.backgroundSecondary,
|
|
1539
|
+
borderBottom: `1px solid ${n.colors.border}`
|
|
1540
|
+
},
|
|
1541
|
+
children: [
|
|
1542
|
+
/* @__PURE__ */ a("span", { style: { color: n.colors.textSecondary }, children: t.name }),
|
|
1543
|
+
t.description && /* @__PURE__ */ k("span", { style: { marginLeft: "8px" }, children: [
|
|
1544
|
+
"— ",
|
|
1545
|
+
t.description
|
|
1546
|
+
] })
|
|
1547
|
+
]
|
|
1548
|
+
}
|
|
1549
|
+
),
|
|
1550
|
+
e.map((u, d) => {
|
|
1551
|
+
const p = d === s;
|
|
1552
|
+
return /* @__PURE__ */ k(
|
|
1553
|
+
"div",
|
|
1554
|
+
{
|
|
1555
|
+
ref: p ? c : void 0,
|
|
1556
|
+
onClick: () => i(d),
|
|
1557
|
+
style: {
|
|
1558
|
+
display: "flex",
|
|
1559
|
+
alignItems: "center",
|
|
1560
|
+
gap: "12px",
|
|
1561
|
+
padding: "8px 16px",
|
|
1562
|
+
cursor: "pointer",
|
|
1563
|
+
backgroundColor: p ? n.colors.backgroundSecondary : "transparent",
|
|
1564
|
+
borderLeft: p ? `2px solid ${n.colors.primary}` : "2px solid transparent",
|
|
1565
|
+
transition: "background-color 100ms ease"
|
|
1566
|
+
},
|
|
1567
|
+
onMouseEnter: (C) => {
|
|
1568
|
+
p || (C.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
|
|
1569
|
+
},
|
|
1570
|
+
onMouseLeave: (C) => {
|
|
1571
|
+
p || (C.currentTarget.style.backgroundColor = "transparent");
|
|
1572
|
+
},
|
|
1573
|
+
children: [
|
|
1574
|
+
/* @__PURE__ */ a(
|
|
1575
|
+
"span",
|
|
1576
|
+
{
|
|
1577
|
+
style: {
|
|
1578
|
+
fontFamily: n.fonts.monospace,
|
|
1579
|
+
fontSize: n.fontSizes[1],
|
|
1580
|
+
color: n.colors.text,
|
|
1581
|
+
flex: 1
|
|
1582
|
+
},
|
|
1583
|
+
children: /* @__PURE__ */ a(
|
|
1584
|
+
ge,
|
|
1585
|
+
{
|
|
1586
|
+
text: u.option,
|
|
1587
|
+
matchedIndices: u.matchedIndices,
|
|
1588
|
+
highlightColor: n.colors.primary
|
|
1589
|
+
}
|
|
1590
|
+
)
|
|
1591
|
+
}
|
|
1592
|
+
),
|
|
1593
|
+
p && /* @__PURE__ */ a(
|
|
1594
|
+
"kbd",
|
|
1595
|
+
{
|
|
1596
|
+
style: {
|
|
1597
|
+
padding: "2px 6px",
|
|
1598
|
+
backgroundColor: n.colors.backgroundTertiary,
|
|
1599
|
+
borderRadius: "3px",
|
|
1600
|
+
border: `1px solid ${n.colors.border}`,
|
|
1601
|
+
fontSize: n.fontSizes[0],
|
|
1602
|
+
color: n.colors.textMuted,
|
|
1603
|
+
flexShrink: 0
|
|
1604
|
+
},
|
|
1605
|
+
children: "Tab"
|
|
1606
|
+
}
|
|
1607
|
+
)
|
|
1608
|
+
]
|
|
1609
|
+
},
|
|
1610
|
+
`${u.option}-${d}`
|
|
1611
|
+
);
|
|
1612
|
+
})
|
|
1613
|
+
]
|
|
1614
|
+
}
|
|
1615
|
+
);
|
|
1616
|
+
}
|
|
1617
|
+
if (o.length === 0)
|
|
1291
1618
|
return null;
|
|
1292
|
-
const
|
|
1293
|
-
return /* @__PURE__ */
|
|
1619
|
+
const g = 48 * l;
|
|
1620
|
+
return /* @__PURE__ */ a(
|
|
1294
1621
|
"div",
|
|
1295
1622
|
{
|
|
1296
|
-
ref:
|
|
1623
|
+
ref: f,
|
|
1297
1624
|
style: {
|
|
1298
|
-
maxHeight: `${
|
|
1625
|
+
maxHeight: `${g}px`,
|
|
1299
1626
|
overflowY: "auto",
|
|
1300
1627
|
borderTop: `1px solid ${n.colors.border}`
|
|
1301
1628
|
},
|
|
1302
|
-
children: o.map((
|
|
1303
|
-
const
|
|
1304
|
-
return /* @__PURE__ */
|
|
1629
|
+
children: o.map((h, v) => {
|
|
1630
|
+
const u = v === s, d = h.command;
|
|
1631
|
+
return /* @__PURE__ */ k(
|
|
1305
1632
|
"div",
|
|
1306
1633
|
{
|
|
1307
|
-
ref:
|
|
1308
|
-
onClick: () =>
|
|
1634
|
+
ref: u ? c : void 0,
|
|
1635
|
+
onClick: () => i(v),
|
|
1309
1636
|
style: {
|
|
1310
1637
|
display: "flex",
|
|
1311
1638
|
alignItems: "center",
|
|
1312
1639
|
gap: "12px",
|
|
1313
1640
|
padding: "10px 16px",
|
|
1314
1641
|
cursor: "pointer",
|
|
1315
|
-
backgroundColor:
|
|
1316
|
-
borderLeft:
|
|
1642
|
+
backgroundColor: u ? n.colors.backgroundSecondary : "transparent",
|
|
1643
|
+
borderLeft: u ? `2px solid ${n.colors.primary}` : "2px solid transparent",
|
|
1317
1644
|
transition: "background-color 100ms ease"
|
|
1318
1645
|
},
|
|
1319
|
-
onMouseEnter: (
|
|
1320
|
-
|
|
1646
|
+
onMouseEnter: (p) => {
|
|
1647
|
+
u || (p.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
|
|
1321
1648
|
},
|
|
1322
|
-
onMouseLeave: (
|
|
1323
|
-
|
|
1649
|
+
onMouseLeave: (p) => {
|
|
1650
|
+
u || (p.currentTarget.style.backgroundColor = "transparent");
|
|
1324
1651
|
},
|
|
1325
1652
|
children: [
|
|
1326
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ a(
|
|
1327
1654
|
"span",
|
|
1328
1655
|
{
|
|
1329
1656
|
style: {
|
|
@@ -1335,8 +1662,8 @@ const ue = ({
|
|
|
1335
1662
|
children: "/"
|
|
1336
1663
|
}
|
|
1337
1664
|
),
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ k("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1666
|
+
/* @__PURE__ */ k(
|
|
1340
1667
|
"div",
|
|
1341
1668
|
{
|
|
1342
1669
|
style: {
|
|
@@ -1345,15 +1672,15 @@ const ue = ({
|
|
|
1345
1672
|
color: n.colors.text
|
|
1346
1673
|
},
|
|
1347
1674
|
children: [
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
|
|
1675
|
+
/* @__PURE__ */ a(
|
|
1676
|
+
ge,
|
|
1350
1677
|
{
|
|
1351
|
-
text:
|
|
1352
|
-
matchedIndices:
|
|
1678
|
+
text: d.name,
|
|
1679
|
+
matchedIndices: h.matchedOn === d.name ? h.matchedIndices : [],
|
|
1353
1680
|
highlightColor: n.colors.primary
|
|
1354
1681
|
}
|
|
1355
1682
|
),
|
|
1356
|
-
|
|
1683
|
+
h.matchedOn !== d.name && /* @__PURE__ */ k(
|
|
1357
1684
|
"span",
|
|
1358
1685
|
{
|
|
1359
1686
|
style: {
|
|
@@ -1363,7 +1690,7 @@ const ue = ({
|
|
|
1363
1690
|
},
|
|
1364
1691
|
children: [
|
|
1365
1692
|
"(alias: ",
|
|
1366
|
-
|
|
1693
|
+
h.matchedOn,
|
|
1367
1694
|
")"
|
|
1368
1695
|
]
|
|
1369
1696
|
}
|
|
@@ -1371,7 +1698,7 @@ const ue = ({
|
|
|
1371
1698
|
]
|
|
1372
1699
|
}
|
|
1373
1700
|
),
|
|
1374
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ a(
|
|
1375
1702
|
"div",
|
|
1376
1703
|
{
|
|
1377
1704
|
style: {
|
|
@@ -1382,11 +1709,11 @@ const ue = ({
|
|
|
1382
1709
|
overflow: "hidden",
|
|
1383
1710
|
textOverflow: "ellipsis"
|
|
1384
1711
|
},
|
|
1385
|
-
children:
|
|
1712
|
+
children: d.description
|
|
1386
1713
|
}
|
|
1387
1714
|
)
|
|
1388
1715
|
] }),
|
|
1389
|
-
|
|
1716
|
+
d.args && d.args.length > 0 && /* @__PURE__ */ a(
|
|
1390
1717
|
"div",
|
|
1391
1718
|
{
|
|
1392
1719
|
style: {
|
|
@@ -1395,21 +1722,21 @@ const ue = ({
|
|
|
1395
1722
|
fontFamily: n.fonts.monospace,
|
|
1396
1723
|
flexShrink: 0
|
|
1397
1724
|
},
|
|
1398
|
-
children:
|
|
1399
|
-
|
|
1400
|
-
/* @__PURE__ */
|
|
1725
|
+
children: d.args.map((p, C) => /* @__PURE__ */ k("span", { children: [
|
|
1726
|
+
C > 0 && " ",
|
|
1727
|
+
/* @__PURE__ */ a(
|
|
1401
1728
|
"span",
|
|
1402
1729
|
{
|
|
1403
1730
|
style: {
|
|
1404
|
-
color:
|
|
1731
|
+
color: p.required ? n.colors.warning : n.colors.textMuted
|
|
1405
1732
|
},
|
|
1406
|
-
children:
|
|
1733
|
+
children: p.required ? `<${p.name}>` : `[${p.name}]`
|
|
1407
1734
|
}
|
|
1408
1735
|
)
|
|
1409
|
-
] },
|
|
1736
|
+
] }, p.name))
|
|
1410
1737
|
}
|
|
1411
1738
|
),
|
|
1412
|
-
|
|
1739
|
+
u && /* @__PURE__ */ a(
|
|
1413
1740
|
"kbd",
|
|
1414
1741
|
{
|
|
1415
1742
|
style: {
|
|
@@ -1426,71 +1753,74 @@ const ue = ({
|
|
|
1426
1753
|
)
|
|
1427
1754
|
]
|
|
1428
1755
|
},
|
|
1429
|
-
`${
|
|
1756
|
+
`${d.name}-${v}`
|
|
1430
1757
|
);
|
|
1431
1758
|
})
|
|
1432
1759
|
}
|
|
1433
1760
|
);
|
|
1434
1761
|
};
|
|
1435
|
-
|
|
1436
|
-
const
|
|
1762
|
+
be.displayName = "QuickCommandAutocomplete";
|
|
1763
|
+
const Oe = ({
|
|
1437
1764
|
palette: o,
|
|
1438
1765
|
config: e
|
|
1439
1766
|
}) => {
|
|
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:
|
|
1767
|
+
const { theme: t } = Q(), r = H(null), {
|
|
1768
|
+
isOpen: s,
|
|
1769
|
+
close: i,
|
|
1770
|
+
query: l,
|
|
1771
|
+
setQuery: n,
|
|
1772
|
+
mode: f,
|
|
1773
|
+
status: c,
|
|
1774
|
+
pendingTools: y,
|
|
1775
|
+
completedTools: g,
|
|
1776
|
+
agentResponse: h,
|
|
1777
|
+
submit: v,
|
|
1778
|
+
historyPrevious: u,
|
|
1452
1779
|
historyNext: d,
|
|
1453
|
-
suggestions:
|
|
1780
|
+
suggestions: p,
|
|
1454
1781
|
agentAvailable: C,
|
|
1455
1782
|
// Autocomplete
|
|
1456
|
-
quickCommandMatches:
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1783
|
+
quickCommandMatches: $,
|
|
1784
|
+
argumentOptionMatches: z,
|
|
1785
|
+
parsedQuery: I,
|
|
1786
|
+
currentArgDef: L,
|
|
1787
|
+
selectedAutocompleteIndex: b,
|
|
1788
|
+
autocompleteNext: w,
|
|
1789
|
+
autocompletePrevious: x,
|
|
1790
|
+
autocompleteAccept: T,
|
|
1791
|
+
showAutocomplete: P
|
|
1462
1792
|
} = o;
|
|
1463
1793
|
R(() => {
|
|
1464
|
-
if (!
|
|
1465
|
-
const
|
|
1466
|
-
r.current && !r.current.contains(
|
|
1467
|
-
},
|
|
1468
|
-
document.addEventListener("mousedown",
|
|
1794
|
+
if (!s) return;
|
|
1795
|
+
const K = (D) => {
|
|
1796
|
+
r.current && !r.current.contains(D.target) && i();
|
|
1797
|
+
}, U = setTimeout(() => {
|
|
1798
|
+
document.addEventListener("mousedown", K);
|
|
1469
1799
|
}, 100);
|
|
1470
1800
|
return () => {
|
|
1471
|
-
clearTimeout(
|
|
1801
|
+
clearTimeout(U), document.removeEventListener("mousedown", K);
|
|
1472
1802
|
};
|
|
1473
|
-
}, [
|
|
1474
|
-
const [
|
|
1803
|
+
}, [s, i]);
|
|
1804
|
+
const [W, A] = _(!1), [O, F] = _(!1);
|
|
1475
1805
|
if (R(() => {
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1806
|
+
if (s)
|
|
1807
|
+
F(!0), requestAnimationFrame(() => {
|
|
1478
1808
|
requestAnimationFrame(() => {
|
|
1479
|
-
|
|
1809
|
+
A(!0);
|
|
1480
1810
|
});
|
|
1481
1811
|
});
|
|
1482
1812
|
else {
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1813
|
+
A(!1);
|
|
1814
|
+
const K = setTimeout(() => {
|
|
1815
|
+
F(!1);
|
|
1486
1816
|
}, 150);
|
|
1487
|
-
return () => clearTimeout(
|
|
1817
|
+
return () => clearTimeout(K);
|
|
1488
1818
|
}
|
|
1489
|
-
}, [
|
|
1819
|
+
}, [s]), !O)
|
|
1490
1820
|
return null;
|
|
1491
|
-
const
|
|
1492
|
-
return /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1821
|
+
const ee = C ? (e == null ? void 0 : e.placeholder) || "What would you like to do?" : "Quick command mode (agent unavailable)", V = [...g, ...y], J = V.length > 0, ne = h && c !== "idle", se = C && !l && c === "idle" && p.length > 0, te = (f === "quick-command" || !C) && c === "idle", ae = !C && f !== "quick-command" && c === "idle";
|
|
1822
|
+
return /* @__PURE__ */ k(ce, { children: [
|
|
1823
|
+
/* @__PURE__ */ a(
|
|
1494
1824
|
"div",
|
|
1495
1825
|
{
|
|
1496
1826
|
style: {
|
|
@@ -1498,10 +1828,10 @@ const De = ({
|
|
|
1498
1828
|
inset: 0,
|
|
1499
1829
|
zIndex: 999
|
|
1500
1830
|
},
|
|
1501
|
-
onClick:
|
|
1831
|
+
onClick: i
|
|
1502
1832
|
}
|
|
1503
1833
|
),
|
|
1504
|
-
/* @__PURE__ */
|
|
1834
|
+
/* @__PURE__ */ k(
|
|
1505
1835
|
"div",
|
|
1506
1836
|
{
|
|
1507
1837
|
ref: r,
|
|
@@ -1512,39 +1842,39 @@ const De = ({
|
|
|
1512
1842
|
left: 0,
|
|
1513
1843
|
right: 0,
|
|
1514
1844
|
maxHeight: "50vh",
|
|
1515
|
-
backgroundColor: t.colors.
|
|
1845
|
+
backgroundColor: t.colors.background,
|
|
1516
1846
|
borderTop: `1px solid ${t.colors.border}`,
|
|
1517
1847
|
boxShadow: t.shadows[2],
|
|
1518
1848
|
zIndex: 1e3,
|
|
1519
1849
|
display: "flex",
|
|
1520
1850
|
flexDirection: "column-reverse",
|
|
1521
1851
|
overflow: "hidden",
|
|
1522
|
-
transform:
|
|
1852
|
+
transform: W ? "translateY(0)" : "translateY(100%)",
|
|
1523
1853
|
transition: "transform 150ms ease-out",
|
|
1524
1854
|
...e == null ? void 0 : e.style
|
|
1525
1855
|
},
|
|
1526
1856
|
children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
-
|
|
1857
|
+
/* @__PURE__ */ k("div", { children: [
|
|
1858
|
+
/* @__PURE__ */ a(
|
|
1859
|
+
me,
|
|
1530
1860
|
{
|
|
1531
|
-
value:
|
|
1532
|
-
onChange:
|
|
1533
|
-
onSubmit:
|
|
1534
|
-
onClose:
|
|
1535
|
-
onHistoryPrevious:
|
|
1861
|
+
value: l,
|
|
1862
|
+
onChange: n,
|
|
1863
|
+
onSubmit: v,
|
|
1864
|
+
onClose: i,
|
|
1865
|
+
onHistoryPrevious: u,
|
|
1536
1866
|
onHistoryNext: d,
|
|
1537
|
-
mode:
|
|
1538
|
-
status:
|
|
1539
|
-
placeholder:
|
|
1867
|
+
mode: f,
|
|
1868
|
+
status: c,
|
|
1869
|
+
placeholder: ee,
|
|
1540
1870
|
agentAvailable: C,
|
|
1541
|
-
showAutocomplete:
|
|
1542
|
-
onAutocompleteNext:
|
|
1543
|
-
onAutocompletePrevious:
|
|
1544
|
-
onAutocompleteAccept:
|
|
1871
|
+
showAutocomplete: P,
|
|
1872
|
+
onAutocompleteNext: w,
|
|
1873
|
+
onAutocompletePrevious: x,
|
|
1874
|
+
onAutocompleteAccept: T
|
|
1545
1875
|
}
|
|
1546
1876
|
),
|
|
1547
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ k(
|
|
1548
1878
|
"div",
|
|
1549
1879
|
{
|
|
1550
1880
|
style: {
|
|
@@ -1557,8 +1887,8 @@ const De = ({
|
|
|
1557
1887
|
backgroundColor: t.colors.background
|
|
1558
1888
|
},
|
|
1559
1889
|
children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ k("span", { children: [
|
|
1891
|
+
/* @__PURE__ */ a(
|
|
1562
1892
|
"kbd",
|
|
1563
1893
|
{
|
|
1564
1894
|
style: {
|
|
@@ -1573,8 +1903,8 @@ const De = ({
|
|
|
1573
1903
|
" ",
|
|
1574
1904
|
"Execute"
|
|
1575
1905
|
] }),
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ k("span", { children: [
|
|
1907
|
+
/* @__PURE__ */ a(
|
|
1578
1908
|
"kbd",
|
|
1579
1909
|
{
|
|
1580
1910
|
style: {
|
|
@@ -1589,8 +1919,8 @@ const De = ({
|
|
|
1589
1919
|
" ",
|
|
1590
1920
|
"Close"
|
|
1591
1921
|
] }),
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ k("span", { children: [
|
|
1923
|
+
/* @__PURE__ */ a(
|
|
1594
1924
|
"kbd",
|
|
1595
1925
|
{
|
|
1596
1926
|
style: {
|
|
@@ -1605,8 +1935,8 @@ const De = ({
|
|
|
1605
1935
|
" ",
|
|
1606
1936
|
"History"
|
|
1607
1937
|
] }),
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ k("span", { style: { marginLeft: "auto" }, children: [
|
|
1939
|
+
/* @__PURE__ */ a(
|
|
1610
1940
|
"kbd",
|
|
1611
1941
|
{
|
|
1612
1942
|
style: {
|
|
@@ -1625,16 +1955,16 @@ const De = ({
|
|
|
1625
1955
|
}
|
|
1626
1956
|
)
|
|
1627
1957
|
] }),
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1958
|
+
/* @__PURE__ */ k("div", { style: { overflow: "auto" }, children: [
|
|
1959
|
+
J && /* @__PURE__ */ a(xe, { tools: V, compact: V.length > 3 }),
|
|
1960
|
+
ne && /* @__PURE__ */ a(
|
|
1961
|
+
ke,
|
|
1632
1962
|
{
|
|
1633
|
-
response:
|
|
1634
|
-
streaming:
|
|
1963
|
+
response: h,
|
|
1964
|
+
streaming: c === "thinking"
|
|
1635
1965
|
}
|
|
1636
1966
|
),
|
|
1637
|
-
|
|
1967
|
+
se && /* @__PURE__ */ k(
|
|
1638
1968
|
"div",
|
|
1639
1969
|
{
|
|
1640
1970
|
style: {
|
|
@@ -1644,7 +1974,7 @@ const De = ({
|
|
|
1644
1974
|
flexWrap: "wrap"
|
|
1645
1975
|
},
|
|
1646
1976
|
children: [
|
|
1647
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ a(
|
|
1648
1978
|
"span",
|
|
1649
1979
|
{
|
|
1650
1980
|
style: {
|
|
@@ -1655,11 +1985,11 @@ const De = ({
|
|
|
1655
1985
|
children: "Try:"
|
|
1656
1986
|
}
|
|
1657
1987
|
),
|
|
1658
|
-
|
|
1988
|
+
p.map((K, U) => /* @__PURE__ */ k(
|
|
1659
1989
|
"button",
|
|
1660
1990
|
{
|
|
1661
1991
|
onClick: () => {
|
|
1662
|
-
|
|
1992
|
+
n(K);
|
|
1663
1993
|
},
|
|
1664
1994
|
style: {
|
|
1665
1995
|
padding: "4px 10px",
|
|
@@ -1671,24 +2001,24 @@ const De = ({
|
|
|
1671
2001
|
cursor: "pointer",
|
|
1672
2002
|
transition: "background-color 150ms ease"
|
|
1673
2003
|
},
|
|
1674
|
-
onMouseEnter: (
|
|
1675
|
-
|
|
2004
|
+
onMouseEnter: (D) => {
|
|
2005
|
+
D.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
|
|
1676
2006
|
},
|
|
1677
|
-
onMouseLeave: (
|
|
1678
|
-
|
|
2007
|
+
onMouseLeave: (D) => {
|
|
2008
|
+
D.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
|
|
1679
2009
|
},
|
|
1680
2010
|
children: [
|
|
1681
2011
|
'"',
|
|
1682
|
-
|
|
2012
|
+
K,
|
|
1683
2013
|
'"'
|
|
1684
2014
|
]
|
|
1685
2015
|
},
|
|
1686
|
-
|
|
2016
|
+
U
|
|
1687
2017
|
))
|
|
1688
2018
|
]
|
|
1689
2019
|
}
|
|
1690
2020
|
),
|
|
1691
|
-
|
|
2021
|
+
ae && /* @__PURE__ */ k(
|
|
1692
2022
|
"div",
|
|
1693
2023
|
{
|
|
1694
2024
|
style: {
|
|
@@ -1700,10 +2030,10 @@ const De = ({
|
|
|
1700
2030
|
gap: "8px"
|
|
1701
2031
|
},
|
|
1702
2032
|
children: [
|
|
1703
|
-
/* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ a("span", { children: "Agent unavailable." }),
|
|
2034
|
+
/* @__PURE__ */ k("span", { style: { color: t.colors.textMuted }, children: [
|
|
1705
2035
|
"Use quick commands (start with ",
|
|
1706
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ a("kbd", { style: {
|
|
1707
2037
|
padding: "2px 6px",
|
|
1708
2038
|
backgroundColor: t.colors.backgroundSecondary,
|
|
1709
2039
|
borderRadius: "3px",
|
|
@@ -1714,7 +2044,7 @@ const De = ({
|
|
|
1714
2044
|
]
|
|
1715
2045
|
}
|
|
1716
2046
|
),
|
|
1717
|
-
|
|
2047
|
+
te && /* @__PURE__ */ k(
|
|
1718
2048
|
"div",
|
|
1719
2049
|
{
|
|
1720
2050
|
style: {
|
|
@@ -1724,29 +2054,29 @@ const De = ({
|
|
|
1724
2054
|
fontFamily: t.fonts.monospace
|
|
1725
2055
|
},
|
|
1726
2056
|
children: [
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
2057
|
+
/* @__PURE__ */ a("div", { style: { marginBottom: "8px", color: t.colors.textSecondary }, children: "Quick commands:" }),
|
|
2058
|
+
/* @__PURE__ */ k("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2059
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2060
|
+
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/toggle" }),
|
|
1731
2061
|
" ",
|
|
1732
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ a("span", { style: { color: t.colors.textMuted }, children: "<left|right>" }),
|
|
1733
2063
|
" ",
|
|
1734
2064
|
"- Toggle sidebar visibility"
|
|
1735
2065
|
] }),
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2067
|
+
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/switch" }),
|
|
1738
2068
|
" ",
|
|
1739
|
-
/* @__PURE__ */
|
|
2069
|
+
/* @__PURE__ */ a("span", { style: { color: t.colors.textMuted }, children: "<slot> <panel>" }),
|
|
1740
2070
|
" ",
|
|
1741
2071
|
"- Switch panel content"
|
|
1742
2072
|
] }),
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2074
|
+
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/collapse" }),
|
|
1745
2075
|
" ",
|
|
1746
2076
|
"- Collapse all sidebars"
|
|
1747
2077
|
] }),
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2079
|
+
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/expand" }),
|
|
1750
2080
|
" ",
|
|
1751
2081
|
"- Expand all sidebars"
|
|
1752
2082
|
] })
|
|
@@ -1754,17 +2084,33 @@ const De = ({
|
|
|
1754
2084
|
]
|
|
1755
2085
|
}
|
|
1756
2086
|
),
|
|
1757
|
-
|
|
1758
|
-
|
|
2087
|
+
P && /* @__PURE__ */ a(
|
|
2088
|
+
be,
|
|
1759
2089
|
{
|
|
1760
|
-
matches:
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
2090
|
+
matches: $,
|
|
2091
|
+
argumentMatches: z,
|
|
2092
|
+
currentArg: L,
|
|
2093
|
+
isEnteringArgs: I.isEnteringArgs,
|
|
2094
|
+
selectedIndex: b,
|
|
2095
|
+
onSelect: (K) => {
|
|
2096
|
+
var D;
|
|
2097
|
+
if (I.isEnteringArgs) {
|
|
2098
|
+
const G = z[K];
|
|
2099
|
+
if (G) {
|
|
2100
|
+
let X = `/${I.commandName}`;
|
|
2101
|
+
for (const ie of I.enteredArgs)
|
|
2102
|
+
X += ` ${ie}`;
|
|
2103
|
+
X += ` ${G.option}`;
|
|
2104
|
+
const de = I.currentArgIndex + 1;
|
|
2105
|
+
((D = I.command) == null ? void 0 : D.args) && de < I.command.args.length && (X += " "), n(X);
|
|
2106
|
+
}
|
|
2107
|
+
return;
|
|
2108
|
+
}
|
|
2109
|
+
const U = $[K];
|
|
2110
|
+
if (U) {
|
|
2111
|
+
const G = U.command;
|
|
2112
|
+
let X = `/${G.name}`;
|
|
2113
|
+
G.args && G.args.length > 0 && (X += " "), n(X);
|
|
1768
2114
|
}
|
|
1769
2115
|
}
|
|
1770
2116
|
}
|
|
@@ -1773,7 +2119,7 @@ const De = ({
|
|
|
1773
2119
|
]
|
|
1774
2120
|
}
|
|
1775
2121
|
),
|
|
1776
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ a("style", { children: `
|
|
1777
2123
|
@keyframes pulse {
|
|
1778
2124
|
0%, 100% { opacity: 1; }
|
|
1779
2125
|
50% { opacity: 0.5; }
|
|
@@ -1789,261 +2135,358 @@ const De = ({
|
|
|
1789
2135
|
` })
|
|
1790
2136
|
] });
|
|
1791
2137
|
};
|
|
1792
|
-
|
|
1793
|
-
function
|
|
2138
|
+
Oe.displayName = "AgentCommandPalette";
|
|
2139
|
+
function pe(o, e) {
|
|
1794
2140
|
const t = o.toLowerCase(), r = e.toLowerCase();
|
|
1795
2141
|
if (!t)
|
|
1796
2142
|
return { score: 0, matchedIndices: [] };
|
|
1797
|
-
const
|
|
1798
|
-
let
|
|
1799
|
-
for (let
|
|
1800
|
-
r[
|
|
1801
|
-
return
|
|
2143
|
+
const s = [];
|
|
2144
|
+
let i = 0, l = 0, n = 0, f = -1;
|
|
2145
|
+
for (let c = 0; c < r.length && i < t.length; c++)
|
|
2146
|
+
r[c] === t[i] && (s.push(c), f === c - 1 ? (n++, l += n * 2) : n = 1, c === 0 && (l += 10), c > 0 && /[_\-\s]/.test(e[c - 1]) && (l += 5), l += 1, f = c, i++);
|
|
2147
|
+
return i < t.length ? null : (l -= e.length * 0.1, t === r && (l += 20), r.startsWith(t) && (l += 15), { score: l, matchedIndices: s });
|
|
1802
2148
|
}
|
|
1803
|
-
function
|
|
2149
|
+
function Fe(o, e, t = 10) {
|
|
1804
2150
|
const r = o.replace(/^\//, "").trim();
|
|
1805
2151
|
if (!r)
|
|
1806
|
-
return e.slice(0, t).map((
|
|
1807
|
-
command:
|
|
2152
|
+
return e.slice(0, t).map((i) => ({
|
|
2153
|
+
command: i,
|
|
1808
2154
|
score: 0,
|
|
1809
2155
|
matchedIndices: [],
|
|
1810
|
-
matchedOn:
|
|
2156
|
+
matchedOn: i.name
|
|
1811
2157
|
}));
|
|
1812
|
-
const
|
|
1813
|
-
for (const
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
1817
|
-
command:
|
|
1818
|
-
score:
|
|
1819
|
-
matchedIndices:
|
|
1820
|
-
matchedOn:
|
|
2158
|
+
const s = [];
|
|
2159
|
+
for (const i of e) {
|
|
2160
|
+
const l = pe(r, i.name);
|
|
2161
|
+
if (l) {
|
|
2162
|
+
s.push({
|
|
2163
|
+
command: i,
|
|
2164
|
+
score: l.score,
|
|
2165
|
+
matchedIndices: l.matchedIndices,
|
|
2166
|
+
matchedOn: i.name
|
|
1821
2167
|
});
|
|
1822
2168
|
continue;
|
|
1823
2169
|
}
|
|
1824
|
-
if (
|
|
1825
|
-
for (const
|
|
1826
|
-
const
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1829
|
-
command:
|
|
1830
|
-
score:
|
|
2170
|
+
if (i.aliases)
|
|
2171
|
+
for (const n of i.aliases) {
|
|
2172
|
+
const f = pe(r, n);
|
|
2173
|
+
if (f) {
|
|
2174
|
+
s.push({
|
|
2175
|
+
command: i,
|
|
2176
|
+
score: f.score - 2,
|
|
1831
2177
|
// Slight penalty for alias match
|
|
1832
|
-
matchedIndices:
|
|
1833
|
-
matchedOn:
|
|
2178
|
+
matchedIndices: f.matchedIndices,
|
|
2179
|
+
matchedOn: n
|
|
1834
2180
|
});
|
|
1835
2181
|
break;
|
|
1836
2182
|
}
|
|
1837
2183
|
}
|
|
1838
2184
|
}
|
|
1839
|
-
return
|
|
2185
|
+
return s.sort((i, l) => l.score - i.score).slice(0, t);
|
|
1840
2186
|
}
|
|
1841
|
-
|
|
2187
|
+
function Ve(o, e) {
|
|
2188
|
+
const r = o.replace(/^\//, "").split(/\s+/), s = r[0] || "", i = o.endsWith(" ") && o.trim().length > 0, l = e.find(
|
|
2189
|
+
(f) => {
|
|
2190
|
+
var c;
|
|
2191
|
+
return f.name.toLowerCase() === s.toLowerCase() || ((c = f.aliases) == null ? void 0 : c.some((y) => y.toLowerCase() === s.toLowerCase()));
|
|
2192
|
+
}
|
|
2193
|
+
) || null;
|
|
2194
|
+
if (!l)
|
|
2195
|
+
return {
|
|
2196
|
+
commandName: s,
|
|
2197
|
+
command: null,
|
|
2198
|
+
enteredArgs: [],
|
|
2199
|
+
currentArgValue: "",
|
|
2200
|
+
currentArgIndex: -1,
|
|
2201
|
+
isEnteringArgs: !1
|
|
2202
|
+
};
|
|
2203
|
+
const n = r.slice(1);
|
|
2204
|
+
if (i)
|
|
2205
|
+
return {
|
|
2206
|
+
commandName: l.name,
|
|
2207
|
+
command: l,
|
|
2208
|
+
enteredArgs: n,
|
|
2209
|
+
currentArgValue: "",
|
|
2210
|
+
currentArgIndex: n.length,
|
|
2211
|
+
isEnteringArgs: !0
|
|
2212
|
+
};
|
|
2213
|
+
if (n.length > 0) {
|
|
2214
|
+
const f = n.slice(0, -1), c = n[n.length - 1];
|
|
2215
|
+
return {
|
|
2216
|
+
commandName: l.name,
|
|
2217
|
+
command: l,
|
|
2218
|
+
enteredArgs: f,
|
|
2219
|
+
currentArgValue: c,
|
|
2220
|
+
currentArgIndex: f.length,
|
|
2221
|
+
isEnteringArgs: !0
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
return {
|
|
2225
|
+
commandName: l.name,
|
|
2226
|
+
command: l,
|
|
2227
|
+
enteredArgs: [],
|
|
2228
|
+
currentArgValue: "",
|
|
2229
|
+
currentArgIndex: -1,
|
|
2230
|
+
isEnteringArgs: !1
|
|
2231
|
+
};
|
|
2232
|
+
}
|
|
2233
|
+
function Be(o, e, t = 10) {
|
|
2234
|
+
if (!e.length)
|
|
2235
|
+
return [];
|
|
2236
|
+
if (!o)
|
|
2237
|
+
return e.slice(0, t).map((s) => ({
|
|
2238
|
+
option: s,
|
|
2239
|
+
score: 0,
|
|
2240
|
+
matchedIndices: []
|
|
2241
|
+
}));
|
|
2242
|
+
const r = [];
|
|
2243
|
+
for (const s of e) {
|
|
2244
|
+
const i = pe(o, s);
|
|
2245
|
+
i && r.push({
|
|
2246
|
+
option: s,
|
|
2247
|
+
score: i.score,
|
|
2248
|
+
matchedIndices: i.matchedIndices
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
return r.sort((s, i) => i.score - s.score).slice(0, t);
|
|
2252
|
+
}
|
|
2253
|
+
const Ke = [
|
|
1842
2254
|
"hide sidebars",
|
|
1843
2255
|
"show terminal",
|
|
1844
2256
|
"focus editor"
|
|
1845
2257
|
];
|
|
1846
|
-
function
|
|
2258
|
+
function mt({
|
|
1847
2259
|
events: o,
|
|
1848
2260
|
keyboard: e = { key: "p", altKey: !0 },
|
|
1849
2261
|
config: t = {},
|
|
1850
2262
|
onExecuteTool: r,
|
|
1851
|
-
initialSuggestions:
|
|
1852
|
-
agentAvailable:
|
|
1853
|
-
quickCommands:
|
|
2263
|
+
initialSuggestions: s = Ke,
|
|
2264
|
+
agentAvailable: i = !0,
|
|
2265
|
+
quickCommands: l = []
|
|
1854
2266
|
} = {}) {
|
|
1855
|
-
const [
|
|
2267
|
+
const [n, f] = _(!1), [c, y] = _(""), [g, h] = _("natural"), [v, u] = _("idle"), [d, p] = _([]), [C, $] = _([]), [z, I] = _(""), [L, b] = _([]), [w, x] = _(-1), T = oe(() => s, [s]), [P, W] = _(-1), A = oe(() => g !== "quick-command" || !l.length ? {
|
|
2268
|
+
commandName: "",
|
|
2269
|
+
command: null,
|
|
2270
|
+
enteredArgs: [],
|
|
2271
|
+
currentArgValue: "",
|
|
2272
|
+
currentArgIndex: -1,
|
|
2273
|
+
isEnteringArgs: !1
|
|
2274
|
+
} : Ve(c, l), [c, g, l]), O = oe(() => g !== "quick-command" || !l.length || A.isEnteringArgs ? [] : Fe(c, l), [c, g, l, A.isEnteringArgs]), F = oe(() => {
|
|
2275
|
+
var E;
|
|
2276
|
+
if (!A.isEnteringArgs || !((E = A.command) != null && E.args))
|
|
2277
|
+
return [];
|
|
2278
|
+
const m = A.command.args[A.currentArgIndex];
|
|
2279
|
+
return m != null && m.options ? Be(A.currentArgValue, m.options) : [];
|
|
2280
|
+
}, [A]), ee = oe(() => {
|
|
2281
|
+
var m;
|
|
2282
|
+
return !A.isEnteringArgs || !((m = A.command) != null && m.args) ? null : A.command.args[A.currentArgIndex] || null;
|
|
2283
|
+
}, [A]), V = oe(() => g !== "quick-command" || v !== "idle" || c.length === 0 ? !1 : O.length > 0 || F.length > 0, [g, v, c.length, O.length, F.length]), J = oe(() => A.isEnteringArgs ? F.length : O.length, [A.isEnteringArgs, F.length, O.length]);
|
|
1856
2284
|
R(() => {
|
|
1857
|
-
|
|
1858
|
-
}, [
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1861
|
-
}, []),
|
|
1862
|
-
|
|
2285
|
+
W(J > 0 ? 0 : -1);
|
|
2286
|
+
}, [J]);
|
|
2287
|
+
const ne = S((m) => {
|
|
2288
|
+
y(m), h(m.startsWith("/") ? "quick-command" : "natural");
|
|
2289
|
+
}, []), se = S(() => {
|
|
2290
|
+
f(!0), i ? (y(""), h("natural")) : (y("/"), h("quick-command")), u("idle"), p([]), $([]), I(""), x(-1), o == null || o.emit({
|
|
1863
2291
|
type: "agent-command-palette:opened",
|
|
1864
2292
|
source: "agent-command-palette",
|
|
1865
2293
|
timestamp: Date.now(),
|
|
1866
2294
|
payload: {}
|
|
1867
2295
|
});
|
|
1868
|
-
}, [o,
|
|
1869
|
-
|
|
2296
|
+
}, [o, i]), te = S(() => {
|
|
2297
|
+
f(!1), o == null || o.emit({
|
|
1870
2298
|
type: "agent-command-palette:closed",
|
|
1871
2299
|
source: "agent-command-palette",
|
|
1872
2300
|
timestamp: Date.now(),
|
|
1873
2301
|
payload: {}
|
|
1874
2302
|
});
|
|
1875
|
-
}, [o]),
|
|
1876
|
-
|
|
1877
|
-
}, [
|
|
1878
|
-
|
|
1879
|
-
}, []),
|
|
1880
|
-
const
|
|
1881
|
-
...
|
|
2303
|
+
}, [o]), ae = S(() => {
|
|
2304
|
+
n ? te() : se();
|
|
2305
|
+
}, [n, se, te]), K = S(() => {
|
|
2306
|
+
y(""), h("natural"), u("idle"), p([]), $([]), I(""), x(-1);
|
|
2307
|
+
}, []), U = S((m) => {
|
|
2308
|
+
const E = {
|
|
2309
|
+
...m,
|
|
1882
2310
|
status: "pending"
|
|
1883
2311
|
};
|
|
1884
|
-
return
|
|
1885
|
-
}, []),
|
|
1886
|
-
(
|
|
1887
|
-
|
|
1888
|
-
const
|
|
1889
|
-
if (!
|
|
1890
|
-
const
|
|
1891
|
-
...
|
|
1892
|
-
status:
|
|
1893
|
-
result:
|
|
1894
|
-
error:
|
|
2312
|
+
return p((M) => [...M, E]), E;
|
|
2313
|
+
}, []), D = S(
|
|
2314
|
+
(m, E, M, Z) => {
|
|
2315
|
+
p((j) => {
|
|
2316
|
+
const q = j.find((Y) => Y.id === m);
|
|
2317
|
+
if (!q) return j;
|
|
2318
|
+
const B = {
|
|
2319
|
+
...q,
|
|
2320
|
+
status: E,
|
|
2321
|
+
result: M,
|
|
2322
|
+
error: Z
|
|
1895
2323
|
};
|
|
1896
|
-
return
|
|
2324
|
+
return E === "success" || E === "error" ? ($((Y) => [...Y, B]), j.filter((Y) => Y.id !== m)) : j.map((Y) => Y.id === m ? B : Y);
|
|
1897
2325
|
});
|
|
1898
2326
|
},
|
|
1899
2327
|
[]
|
|
1900
|
-
),
|
|
1901
|
-
async (
|
|
1902
|
-
const
|
|
1903
|
-
if (!
|
|
1904
|
-
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
id:
|
|
1908
|
-
name:
|
|
1909
|
-
args: { args:
|
|
1910
|
-
}),
|
|
2328
|
+
), G = S(
|
|
2329
|
+
async (m) => {
|
|
2330
|
+
const E = m.replace(/^\//, "").trim().split(/\s+/), M = E[0], Z = E.slice(1);
|
|
2331
|
+
if (!M) return;
|
|
2332
|
+
u("executing");
|
|
2333
|
+
const j = `quick-${Date.now()}`;
|
|
2334
|
+
U({
|
|
2335
|
+
id: j,
|
|
2336
|
+
name: M,
|
|
2337
|
+
args: { args: Z }
|
|
2338
|
+
}), D(j, "running");
|
|
1911
2339
|
try {
|
|
1912
2340
|
if (r) {
|
|
1913
|
-
const
|
|
1914
|
-
|
|
2341
|
+
const B = await r(M, { args: Z });
|
|
2342
|
+
D(j, "success", String(B));
|
|
1915
2343
|
} else
|
|
1916
|
-
|
|
1917
|
-
|
|
2344
|
+
D(j, "success", "Tool executed (no handler)");
|
|
2345
|
+
b((B) => [
|
|
1918
2346
|
{
|
|
1919
|
-
query:
|
|
2347
|
+
query: m,
|
|
1920
2348
|
timestamp: Date.now(),
|
|
1921
|
-
toolsExecuted: [
|
|
2349
|
+
toolsExecuted: [M],
|
|
1922
2350
|
success: !0
|
|
1923
2351
|
},
|
|
1924
|
-
...
|
|
1925
|
-
]),
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
} catch (
|
|
1929
|
-
const
|
|
1930
|
-
|
|
2352
|
+
...B.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2353
|
+
]), u("complete"), I(`Executed: ${M}`);
|
|
2354
|
+
const q = t.autoCloseDelay ?? 1e3;
|
|
2355
|
+
q > 0 && setTimeout(() => te(), q);
|
|
2356
|
+
} catch (q) {
|
|
2357
|
+
const B = q instanceof Error ? q.message : "Unknown error";
|
|
2358
|
+
D(j, "error", void 0, B), u("error"), I(`Error: ${B}`);
|
|
1931
2359
|
}
|
|
1932
2360
|
},
|
|
1933
|
-
[r,
|
|
1934
|
-
),
|
|
1935
|
-
if (
|
|
1936
|
-
if (
|
|
1937
|
-
|
|
2361
|
+
[r, U, D, t.autoCloseDelay, t.maxHistoryEntries, te]
|
|
2362
|
+
), X = S(() => {
|
|
2363
|
+
if (c.trim()) {
|
|
2364
|
+
if (g === "quick-command") {
|
|
2365
|
+
G(c);
|
|
1938
2366
|
return;
|
|
1939
2367
|
}
|
|
1940
|
-
if (!
|
|
1941
|
-
I("Agent unavailable. Use quick commands (start with /)."),
|
|
2368
|
+
if (!i) {
|
|
2369
|
+
I("Agent unavailable. Use quick commands (start with /)."), u("error");
|
|
1942
2370
|
return;
|
|
1943
2371
|
}
|
|
1944
|
-
|
|
2372
|
+
u("thinking"), o == null || o.emit({
|
|
1945
2373
|
type: "agent-command-palette:submit",
|
|
1946
2374
|
source: "agent-command-palette",
|
|
1947
2375
|
timestamp: Date.now(),
|
|
1948
|
-
payload: { query:
|
|
1949
|
-
}),
|
|
2376
|
+
payload: { query: c, mode: g }
|
|
2377
|
+
}), b((m) => [
|
|
1950
2378
|
{
|
|
1951
|
-
query:
|
|
2379
|
+
query: c,
|
|
1952
2380
|
timestamp: Date.now(),
|
|
1953
2381
|
toolsExecuted: [],
|
|
1954
2382
|
success: !0
|
|
1955
2383
|
},
|
|
1956
|
-
...
|
|
2384
|
+
...m.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
1957
2385
|
]);
|
|
1958
2386
|
}
|
|
1959
|
-
}, [
|
|
1960
|
-
if (
|
|
1961
|
-
const
|
|
1962
|
-
|
|
1963
|
-
}, [
|
|
1964
|
-
if (
|
|
1965
|
-
|
|
2387
|
+
}, [c, g, G, o, t.maxHistoryEntries, i]), de = S(() => {
|
|
2388
|
+
if (L.length === 0) return;
|
|
2389
|
+
const m = w < L.length - 1 ? w + 1 : w;
|
|
2390
|
+
x(m), L[m] && (y(L[m].query), h(L[m].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2391
|
+
}, [L, w]), ue = S(() => {
|
|
2392
|
+
if (w <= 0) {
|
|
2393
|
+
x(-1), y(""), h("natural");
|
|
1966
2394
|
return;
|
|
1967
2395
|
}
|
|
1968
|
-
const
|
|
1969
|
-
|
|
1970
|
-
}, [
|
|
1971
|
-
(
|
|
2396
|
+
const m = w - 1;
|
|
2397
|
+
x(m), L[m] && (y(L[m].query), h(L[m].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2398
|
+
}, [L, w]), ie = S(
|
|
2399
|
+
(m) => {
|
|
1972
2400
|
const {
|
|
1973
|
-
key:
|
|
1974
|
-
altKey:
|
|
1975
|
-
ctrlKey:
|
|
1976
|
-
metaKey:
|
|
1977
|
-
shiftKey:
|
|
1978
|
-
} = e,
|
|
1979
|
-
if ((
|
|
1980
|
-
const
|
|
1981
|
-
if (!
|
|
2401
|
+
key: E = "p",
|
|
2402
|
+
altKey: M = !0,
|
|
2403
|
+
ctrlKey: Z = !1,
|
|
2404
|
+
metaKey: j = !1,
|
|
2405
|
+
shiftKey: q = !1
|
|
2406
|
+
} = e, B = m.altKey === M && m.ctrlKey === Z && m.metaKey === j && m.shiftKey === q;
|
|
2407
|
+
if ((M ? m.code === `Key${E.toUpperCase()}` : m.key.toLowerCase() === E.toLowerCase()) && B) {
|
|
2408
|
+
const re = m.target;
|
|
2409
|
+
if (!re.closest("[data-agent-command-palette-input]") && (re.tagName === "INPUT" || re.tagName === "TEXTAREA" || re.isContentEditable))
|
|
1982
2410
|
return;
|
|
1983
|
-
|
|
2411
|
+
m.preventDefault(), ae();
|
|
1984
2412
|
}
|
|
1985
2413
|
},
|
|
1986
|
-
[e,
|
|
2414
|
+
[e, ae]
|
|
1987
2415
|
);
|
|
1988
|
-
R(() => (window.addEventListener("keydown",
|
|
1989
|
-
const
|
|
1990
|
-
|
|
1991
|
-
(
|
|
2416
|
+
R(() => (window.addEventListener("keydown", ie), () => window.removeEventListener("keydown", ie)), [ie]);
|
|
2417
|
+
const Pe = S(() => {
|
|
2418
|
+
V && W(
|
|
2419
|
+
(m) => m < J - 1 ? m + 1 : 0
|
|
1992
2420
|
);
|
|
1993
|
-
}, [
|
|
1994
|
-
|
|
1995
|
-
(
|
|
2421
|
+
}, [V, J]), We = S(() => {
|
|
2422
|
+
V && W(
|
|
2423
|
+
(m) => m > 0 ? m - 1 : J - 1
|
|
1996
2424
|
);
|
|
1997
|
-
}, [
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2425
|
+
}, [V, J]), _e = S(() => {
|
|
2426
|
+
var Z;
|
|
2427
|
+
if (!V || P < 0) return;
|
|
2428
|
+
if (A.isEnteringArgs) {
|
|
2429
|
+
const j = F[P];
|
|
2430
|
+
if (!j) return;
|
|
2431
|
+
let q = `/${A.commandName}`;
|
|
2432
|
+
for (const re of A.enteredArgs)
|
|
2433
|
+
q += ` ${re}`;
|
|
2434
|
+
q += ` ${j.option}`;
|
|
2435
|
+
const B = A.currentArgIndex + 1;
|
|
2436
|
+
((Z = A.command) == null ? void 0 : Z.args) && B < A.command.args.length && (q += " "), y(q), W(-1);
|
|
2437
|
+
return;
|
|
2438
|
+
}
|
|
2439
|
+
const m = O[P];
|
|
2440
|
+
if (!m) return;
|
|
2441
|
+
const E = m.command;
|
|
2442
|
+
let M = `/${E.name}`;
|
|
2443
|
+
E.args && E.args.length > 0 && (M += " "), y(M), W(-1);
|
|
2444
|
+
}, [V, P, A, F, O]);
|
|
2005
2445
|
return {
|
|
2006
2446
|
// Agent availability
|
|
2007
|
-
agentAvailable:
|
|
2447
|
+
agentAvailable: i,
|
|
2008
2448
|
// Visibility
|
|
2009
|
-
isOpen:
|
|
2010
|
-
open:
|
|
2011
|
-
close:
|
|
2012
|
-
toggle:
|
|
2449
|
+
isOpen: n,
|
|
2450
|
+
open: se,
|
|
2451
|
+
close: te,
|
|
2452
|
+
toggle: ae,
|
|
2013
2453
|
// Input
|
|
2014
|
-
query:
|
|
2015
|
-
setQuery:
|
|
2016
|
-
mode:
|
|
2454
|
+
query: c,
|
|
2455
|
+
setQuery: ne,
|
|
2456
|
+
mode: g,
|
|
2017
2457
|
// Execution
|
|
2018
|
-
status:
|
|
2019
|
-
setStatus:
|
|
2458
|
+
status: v,
|
|
2459
|
+
setStatus: u,
|
|
2020
2460
|
pendingTools: d,
|
|
2021
2461
|
completedTools: C,
|
|
2022
|
-
agentResponse:
|
|
2462
|
+
agentResponse: z,
|
|
2023
2463
|
setAgentResponse: I,
|
|
2024
|
-
submit:
|
|
2025
|
-
executeQuickCommand:
|
|
2464
|
+
submit: X,
|
|
2465
|
+
executeQuickCommand: G,
|
|
2026
2466
|
// Tool management (for external AI integration)
|
|
2027
|
-
addPendingTool:
|
|
2028
|
-
updateToolStatus:
|
|
2467
|
+
addPendingTool: U,
|
|
2468
|
+
updateToolStatus: D,
|
|
2029
2469
|
// History
|
|
2030
|
-
history:
|
|
2031
|
-
historyPrevious:
|
|
2032
|
-
historyNext:
|
|
2470
|
+
history: L,
|
|
2471
|
+
historyPrevious: de,
|
|
2472
|
+
historyNext: ue,
|
|
2033
2473
|
// Suggestions
|
|
2034
2474
|
suggestions: T,
|
|
2035
2475
|
// Actions
|
|
2036
|
-
clear:
|
|
2476
|
+
clear: K,
|
|
2037
2477
|
// Quick command autocomplete
|
|
2038
|
-
quickCommandMatches:
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2478
|
+
quickCommandMatches: O,
|
|
2479
|
+
argumentOptionMatches: F,
|
|
2480
|
+
parsedQuery: A,
|
|
2481
|
+
currentArgDef: ee,
|
|
2482
|
+
selectedAutocompleteIndex: P,
|
|
2483
|
+
autocompleteNext: Pe,
|
|
2484
|
+
autocompletePrevious: We,
|
|
2485
|
+
autocompleteAccept: _e,
|
|
2486
|
+
showAutocomplete: V
|
|
2044
2487
|
};
|
|
2045
2488
|
}
|
|
2046
|
-
const
|
|
2489
|
+
const we = {
|
|
2047
2490
|
name: "get_visible_panels",
|
|
2048
2491
|
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
2492
|
inputs: {
|
|
@@ -2112,7 +2555,7 @@ const fe = {
|
|
|
2112
2555
|
call_template_type: "panel_event",
|
|
2113
2556
|
event_type: "panel:get-visibility"
|
|
2114
2557
|
}
|
|
2115
|
-
},
|
|
2558
|
+
}, Se = {
|
|
2116
2559
|
name: "get_panel_state",
|
|
2117
2560
|
description: "Get the current state of a specific panel. Returns panel-specific state data if the panel supports state queries.",
|
|
2118
2561
|
inputs: {
|
|
@@ -2144,7 +2587,7 @@ const fe = {
|
|
|
2144
2587
|
call_template_type: "panel_event",
|
|
2145
2588
|
event_type: "panel:get-state"
|
|
2146
2589
|
}
|
|
2147
|
-
},
|
|
2590
|
+
}, ve = {
|
|
2148
2591
|
name: "list_panels_with_state",
|
|
2149
2592
|
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
2593
|
inputs: {
|
|
@@ -2177,7 +2620,7 @@ const fe = {
|
|
|
2177
2620
|
call_template_type: "panel_event",
|
|
2178
2621
|
event_type: "panel:list-state-panels"
|
|
2179
2622
|
}
|
|
2180
|
-
},
|
|
2623
|
+
}, Te = {
|
|
2181
2624
|
name: "toggle_panel",
|
|
2182
2625
|
description: "Collapse or expand a side panel to give more space to the main content area.",
|
|
2183
2626
|
inputs: {
|
|
@@ -2204,7 +2647,7 @@ const fe = {
|
|
|
2204
2647
|
call_template_type: "panel_event",
|
|
2205
2648
|
event_type: "panel:toggle"
|
|
2206
2649
|
}
|
|
2207
|
-
},
|
|
2650
|
+
}, Ce = {
|
|
2208
2651
|
name: "collapse_all_panels",
|
|
2209
2652
|
description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
|
|
2210
2653
|
inputs: {
|
|
@@ -2224,7 +2667,7 @@ const fe = {
|
|
|
2224
2667
|
call_template_type: "panel_event",
|
|
2225
2668
|
event_type: "panel:collapse-all"
|
|
2226
2669
|
}
|
|
2227
|
-
},
|
|
2670
|
+
}, Ie = {
|
|
2228
2671
|
name: "expand_all_panels",
|
|
2229
2672
|
description: "Expand both left and right panels to show all content. Restores the default layout.",
|
|
2230
2673
|
inputs: {
|
|
@@ -2244,7 +2687,7 @@ const fe = {
|
|
|
2244
2687
|
call_template_type: "panel_event",
|
|
2245
2688
|
event_type: "panel:expand-all"
|
|
2246
2689
|
}
|
|
2247
|
-
},
|
|
2690
|
+
}, Ae = {
|
|
2248
2691
|
name: "switch_panel",
|
|
2249
2692
|
description: "Change which content is displayed in a panel slot (left, middle, or right).",
|
|
2250
2693
|
inputs: {
|
|
@@ -2275,7 +2718,7 @@ const fe = {
|
|
|
2275
2718
|
call_template_type: "panel_event",
|
|
2276
2719
|
event_type: "panel:switch"
|
|
2277
2720
|
}
|
|
2278
|
-
},
|
|
2721
|
+
}, $e = {
|
|
2279
2722
|
name: "focus_panel",
|
|
2280
2723
|
description: "Set focus to a specific panel slot for keyboard navigation.",
|
|
2281
2724
|
inputs: {
|
|
@@ -2301,7 +2744,7 @@ const fe = {
|
|
|
2301
2744
|
call_template_type: "panel_event",
|
|
2302
2745
|
event_type: "panel:focus"
|
|
2303
2746
|
}
|
|
2304
|
-
},
|
|
2747
|
+
}, ze = {
|
|
2305
2748
|
name: "reset_layout",
|
|
2306
2749
|
description: "Reset panel sizes to the default layout configuration.",
|
|
2307
2750
|
inputs: {
|
|
@@ -2321,44 +2764,44 @@ const fe = {
|
|
|
2321
2764
|
call_template_type: "panel_event",
|
|
2322
2765
|
event_type: "panel:reset-layout"
|
|
2323
2766
|
}
|
|
2324
|
-
},
|
|
2767
|
+
}, He = [
|
|
2325
2768
|
// State query tools
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2769
|
+
we,
|
|
2770
|
+
Se,
|
|
2771
|
+
ve,
|
|
2329
2772
|
// Layout action tools
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
],
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
],
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
],
|
|
2773
|
+
Te,
|
|
2774
|
+
Ce,
|
|
2775
|
+
Ie,
|
|
2776
|
+
Ae,
|
|
2777
|
+
$e,
|
|
2778
|
+
ze
|
|
2779
|
+
], xt = [
|
|
2780
|
+
we,
|
|
2781
|
+
Se,
|
|
2782
|
+
ve
|
|
2783
|
+
], kt = [
|
|
2784
|
+
Te,
|
|
2785
|
+
Ce,
|
|
2786
|
+
Ie,
|
|
2787
|
+
Ae,
|
|
2788
|
+
$e,
|
|
2789
|
+
ze
|
|
2790
|
+
], bt = {
|
|
2348
2791
|
id: "panel-layouts",
|
|
2349
2792
|
name: "Panel Layouts",
|
|
2350
2793
|
description: "Generic panel layout and state query operations",
|
|
2351
|
-
tools:
|
|
2794
|
+
tools: He
|
|
2352
2795
|
};
|
|
2353
|
-
function
|
|
2796
|
+
function Qe(o) {
|
|
2354
2797
|
const e = {};
|
|
2355
2798
|
if (o.inputs.properties)
|
|
2356
2799
|
for (const [t, r] of Object.entries(o.inputs.properties)) {
|
|
2357
|
-
const
|
|
2800
|
+
const s = r;
|
|
2358
2801
|
e[t] = {
|
|
2359
|
-
type:
|
|
2360
|
-
description:
|
|
2361
|
-
...
|
|
2802
|
+
type: s.type || "string",
|
|
2803
|
+
description: s.description,
|
|
2804
|
+
...s.enum && { enum: s.enum }
|
|
2362
2805
|
};
|
|
2363
2806
|
}
|
|
2364
2807
|
return {
|
|
@@ -2371,12 +2814,12 @@ function Me(o) {
|
|
|
2371
2814
|
}
|
|
2372
2815
|
};
|
|
2373
2816
|
}
|
|
2374
|
-
function
|
|
2817
|
+
function wt(o) {
|
|
2375
2818
|
return {
|
|
2376
|
-
functionDeclarations: o.map(
|
|
2819
|
+
functionDeclarations: o.map(Qe)
|
|
2377
2820
|
};
|
|
2378
2821
|
}
|
|
2379
|
-
function
|
|
2822
|
+
function Je(o) {
|
|
2380
2823
|
return {
|
|
2381
2824
|
type: "function",
|
|
2382
2825
|
function: {
|
|
@@ -2386,54 +2829,54 @@ function Oe(o) {
|
|
|
2386
2829
|
}
|
|
2387
2830
|
};
|
|
2388
2831
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return o.map(
|
|
2832
|
+
function St(o) {
|
|
2833
|
+
return o.map(Je);
|
|
2391
2834
|
}
|
|
2392
|
-
function
|
|
2835
|
+
function Ue(o) {
|
|
2393
2836
|
return {
|
|
2394
2837
|
name: o.name,
|
|
2395
2838
|
description: o.description,
|
|
2396
2839
|
input_schema: o.inputs
|
|
2397
2840
|
};
|
|
2398
2841
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return o.map(
|
|
2842
|
+
function vt(o) {
|
|
2843
|
+
return o.map(Ue);
|
|
2401
2844
|
}
|
|
2402
|
-
function
|
|
2845
|
+
function Ge(o) {
|
|
2403
2846
|
return {
|
|
2404
2847
|
name: o.name,
|
|
2405
2848
|
description: o.description,
|
|
2406
2849
|
parameters: o.inputs
|
|
2407
2850
|
};
|
|
2408
2851
|
}
|
|
2409
|
-
function
|
|
2410
|
-
return o.map(
|
|
2852
|
+
function Tt(o) {
|
|
2853
|
+
return o.map(Ge);
|
|
2411
2854
|
}
|
|
2412
|
-
function
|
|
2855
|
+
function Ct(o, e = {}) {
|
|
2413
2856
|
const {
|
|
2414
2857
|
header: t = "You have access to the following tools:",
|
|
2415
2858
|
includeParameters: r = !0
|
|
2416
|
-
} = e,
|
|
2417
|
-
let
|
|
2418
|
-
if (r &&
|
|
2419
|
-
const
|
|
2420
|
-
var
|
|
2421
|
-
const
|
|
2422
|
-
return ` - ${
|
|
2859
|
+
} = e, s = o.map((i) => {
|
|
2860
|
+
let l = `- ${i.name}: ${i.description}`;
|
|
2861
|
+
if (r && i.inputs.properties) {
|
|
2862
|
+
const n = Object.entries(i.inputs.properties).map(([f, c]) => {
|
|
2863
|
+
var h;
|
|
2864
|
+
const y = c, g = (h = i.inputs.required) != null && h.includes(f) ? " (required)" : "";
|
|
2865
|
+
return ` - ${f}: ${y.description || y.type}${g}`;
|
|
2423
2866
|
}).join(`
|
|
2424
2867
|
`);
|
|
2425
|
-
|
|
2426
|
-
${
|
|
2868
|
+
n && (l += `
|
|
2869
|
+
${n}`);
|
|
2427
2870
|
}
|
|
2428
|
-
return
|
|
2871
|
+
return l;
|
|
2429
2872
|
});
|
|
2430
2873
|
return `${t}
|
|
2431
2874
|
|
|
2432
|
-
${
|
|
2875
|
+
${s.join(`
|
|
2433
2876
|
|
|
2434
2877
|
`)}`;
|
|
2435
2878
|
}
|
|
2436
|
-
const
|
|
2879
|
+
const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
2437
2880
|
"svg",
|
|
2438
2881
|
{
|
|
2439
2882
|
width: o,
|
|
@@ -2445,11 +2888,11 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2445
2888
|
strokeLinecap: "round",
|
|
2446
2889
|
strokeLinejoin: "round",
|
|
2447
2890
|
children: [
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
/* @__PURE__ */
|
|
2891
|
+
/* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2892
|
+
/* @__PURE__ */ a("path", { d: "M9 3v18" })
|
|
2450
2893
|
]
|
|
2451
2894
|
}
|
|
2452
|
-
),
|
|
2895
|
+
), Xe = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
2453
2896
|
"svg",
|
|
2454
2897
|
{
|
|
2455
2898
|
width: o,
|
|
@@ -2461,12 +2904,12 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2461
2904
|
strokeLinecap: "round",
|
|
2462
2905
|
strokeLinejoin: "round",
|
|
2463
2906
|
children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
-
/* @__PURE__ */
|
|
2907
|
+
/* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2908
|
+
/* @__PURE__ */ a("path", { d: "M9 3v18" }),
|
|
2909
|
+
/* @__PURE__ */ a("path", { d: "m16 15-3-3 3-3" })
|
|
2467
2910
|
]
|
|
2468
2911
|
}
|
|
2469
|
-
),
|
|
2912
|
+
), Ze = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
2470
2913
|
"svg",
|
|
2471
2914
|
{
|
|
2472
2915
|
width: o,
|
|
@@ -2478,11 +2921,11 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2478
2921
|
strokeLinecap: "round",
|
|
2479
2922
|
strokeLinejoin: "round",
|
|
2480
2923
|
children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2925
|
+
/* @__PURE__ */ a("path", { d: "M15 3v18" })
|
|
2483
2926
|
]
|
|
2484
2927
|
}
|
|
2485
|
-
),
|
|
2928
|
+
), et = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
2486
2929
|
"svg",
|
|
2487
2930
|
{
|
|
2488
2931
|
width: o,
|
|
@@ -2494,32 +2937,32 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2494
2937
|
strokeLinecap: "round",
|
|
2495
2938
|
strokeLinejoin: "round",
|
|
2496
2939
|
children: [
|
|
2497
|
-
/* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
2940
|
+
/* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2941
|
+
/* @__PURE__ */ a("path", { d: "M15 3v18" }),
|
|
2942
|
+
/* @__PURE__ */ a("path", { d: "m8 9 3 3-3 3" })
|
|
2500
2943
|
]
|
|
2501
2944
|
}
|
|
2502
|
-
),
|
|
2945
|
+
), he = ({
|
|
2503
2946
|
isCollapsed: o,
|
|
2504
2947
|
onToggle: e,
|
|
2505
2948
|
side: t = "left",
|
|
2506
2949
|
iconSize: r = 18,
|
|
2507
|
-
style:
|
|
2508
|
-
shortcutHint:
|
|
2509
|
-
title:
|
|
2510
|
-
className:
|
|
2950
|
+
style: s,
|
|
2951
|
+
shortcutHint: i = "Cmd/Ctrl+B",
|
|
2952
|
+
title: l,
|
|
2953
|
+
className: n
|
|
2511
2954
|
}) => {
|
|
2512
|
-
const { theme:
|
|
2513
|
-
return /* @__PURE__ */
|
|
2955
|
+
const { theme: f } = Q(), c = () => t === "right" ? o ? /* @__PURE__ */ a(Ze, { size: r }) : /* @__PURE__ */ a(et, { size: r }) : o ? /* @__PURE__ */ a(Ye, { size: r }) : /* @__PURE__ */ a(Xe, { size: r });
|
|
2956
|
+
return /* @__PURE__ */ a(
|
|
2514
2957
|
"button",
|
|
2515
2958
|
{
|
|
2516
2959
|
onClick: e,
|
|
2517
|
-
title:
|
|
2518
|
-
className:
|
|
2960
|
+
title: l ?? `${o ? "Show" : "Hide"} ${t === "right" ? "Right Panel" : "Sidebar"}${i ? ` (${i})` : ""}`,
|
|
2961
|
+
className: n,
|
|
2519
2962
|
style: {
|
|
2520
2963
|
background: "transparent",
|
|
2521
2964
|
border: "none",
|
|
2522
|
-
color: o ?
|
|
2965
|
+
color: o ? f.colors.textSecondary : f.colors.primary,
|
|
2523
2966
|
cursor: "pointer",
|
|
2524
2967
|
padding: "6px",
|
|
2525
2968
|
borderRadius: "4px",
|
|
@@ -2529,18 +2972,18 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2529
2972
|
transition: "all 0.2s",
|
|
2530
2973
|
width: "32px",
|
|
2531
2974
|
height: "32px",
|
|
2532
|
-
...
|
|
2975
|
+
...s
|
|
2533
2976
|
},
|
|
2534
|
-
onMouseEnter: (
|
|
2535
|
-
|
|
2977
|
+
onMouseEnter: (g) => {
|
|
2978
|
+
g.currentTarget.style.backgroundColor = f.colors.backgroundTertiary, g.currentTarget.style.color = f.colors.primary;
|
|
2536
2979
|
},
|
|
2537
|
-
onMouseLeave: (
|
|
2538
|
-
|
|
2980
|
+
onMouseLeave: (g) => {
|
|
2981
|
+
g.currentTarget.style.backgroundColor = "transparent", g.currentTarget.style.color = o ? f.colors.textSecondary : f.colors.primary;
|
|
2539
2982
|
},
|
|
2540
|
-
children:
|
|
2983
|
+
children: c()
|
|
2541
2984
|
}
|
|
2542
2985
|
);
|
|
2543
|
-
},
|
|
2986
|
+
}, tt = ({ size: o = 14 }) => /* @__PURE__ */ k(
|
|
2544
2987
|
"svg",
|
|
2545
2988
|
{
|
|
2546
2989
|
width: o,
|
|
@@ -2552,13 +2995,13 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2552
2995
|
strokeLinecap: "round",
|
|
2553
2996
|
strokeLinejoin: "round",
|
|
2554
2997
|
children: [
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
/* @__PURE__ */
|
|
2558
|
-
/* @__PURE__ */
|
|
2998
|
+
/* @__PURE__ */ a("path", { d: "M8 3 4 7l4 4" }),
|
|
2999
|
+
/* @__PURE__ */ a("path", { d: "M4 7h16" }),
|
|
3000
|
+
/* @__PURE__ */ a("path", { d: "m16 21 4-4-4-4" }),
|
|
3001
|
+
/* @__PURE__ */ a("path", { d: "M20 17H4" })
|
|
2559
3002
|
]
|
|
2560
3003
|
}
|
|
2561
|
-
),
|
|
3004
|
+
), ot = ({ size: o = 14 }) => /* @__PURE__ */ k(
|
|
2562
3005
|
"svg",
|
|
2563
3006
|
{
|
|
2564
3007
|
width: o,
|
|
@@ -2570,31 +3013,31 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2570
3013
|
strokeLinecap: "round",
|
|
2571
3014
|
strokeLinejoin: "round",
|
|
2572
3015
|
children: [
|
|
2573
|
-
/* @__PURE__ */
|
|
2574
|
-
/* @__PURE__ */
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
/* @__PURE__ */
|
|
3016
|
+
/* @__PURE__ */ a("path", { d: "m16 3 4 4-4 4" }),
|
|
3017
|
+
/* @__PURE__ */ a("path", { d: "M20 7H4" }),
|
|
3018
|
+
/* @__PURE__ */ a("path", { d: "m8 21-4-4 4-4" }),
|
|
3019
|
+
/* @__PURE__ */ a("path", { d: "M4 17h16" })
|
|
2577
3020
|
]
|
|
2578
3021
|
}
|
|
2579
|
-
),
|
|
3022
|
+
), ye = ({
|
|
2580
3023
|
onSwitch: o,
|
|
2581
3024
|
variant: e = "left-middle",
|
|
2582
3025
|
iconSize: t = 14,
|
|
2583
3026
|
style: r,
|
|
2584
|
-
title:
|
|
2585
|
-
className:
|
|
3027
|
+
title: s,
|
|
3028
|
+
className: i
|
|
2586
3029
|
}) => {
|
|
2587
|
-
const { theme:
|
|
2588
|
-
return /* @__PURE__ */
|
|
3030
|
+
const { theme: l } = Q(), n = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", f = e === "left-middle" ? tt : ot;
|
|
3031
|
+
return /* @__PURE__ */ a(
|
|
2589
3032
|
"button",
|
|
2590
3033
|
{
|
|
2591
3034
|
onClick: o,
|
|
2592
|
-
title:
|
|
2593
|
-
className:
|
|
3035
|
+
title: s ?? n(),
|
|
3036
|
+
className: i,
|
|
2594
3037
|
style: {
|
|
2595
3038
|
background: "transparent",
|
|
2596
3039
|
border: "none",
|
|
2597
|
-
color:
|
|
3040
|
+
color: l.colors.textSecondary,
|
|
2598
3041
|
cursor: "pointer",
|
|
2599
3042
|
padding: "6px",
|
|
2600
3043
|
borderRadius: "4px",
|
|
@@ -2606,16 +3049,16 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2606
3049
|
height: "32px",
|
|
2607
3050
|
...r
|
|
2608
3051
|
},
|
|
2609
|
-
onMouseEnter: (
|
|
2610
|
-
|
|
3052
|
+
onMouseEnter: (c) => {
|
|
3053
|
+
c.currentTarget.style.backgroundColor = l.colors.backgroundTertiary, c.currentTarget.style.color = l.colors.text;
|
|
2611
3054
|
},
|
|
2612
|
-
onMouseLeave: (
|
|
2613
|
-
|
|
3055
|
+
onMouseLeave: (c) => {
|
|
3056
|
+
c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = l.colors.textSecondary;
|
|
2614
3057
|
},
|
|
2615
|
-
children: /* @__PURE__ */
|
|
3058
|
+
children: /* @__PURE__ */ a(f, { size: t })
|
|
2616
3059
|
}
|
|
2617
3060
|
);
|
|
2618
|
-
},
|
|
3061
|
+
}, rt = ({ size: o = 14 }) => /* @__PURE__ */ k(
|
|
2619
3062
|
"svg",
|
|
2620
3063
|
{
|
|
2621
3064
|
width: o,
|
|
@@ -2627,29 +3070,29 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2627
3070
|
strokeLinecap: "round",
|
|
2628
3071
|
strokeLinejoin: "round",
|
|
2629
3072
|
children: [
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
3074
|
+
/* @__PURE__ */ a("path", { d: "M3 9h18" }),
|
|
3075
|
+
/* @__PURE__ */ a("path", { d: "M9 21V9" })
|
|
2633
3076
|
]
|
|
2634
3077
|
}
|
|
2635
|
-
),
|
|
3078
|
+
), nt = ({
|
|
2636
3079
|
onConfigure: o,
|
|
2637
3080
|
iconSize: e = 14,
|
|
2638
3081
|
style: t,
|
|
2639
3082
|
title: r = "Configure panel layout",
|
|
2640
|
-
className:
|
|
3083
|
+
className: s
|
|
2641
3084
|
}) => {
|
|
2642
|
-
const { theme:
|
|
2643
|
-
return /* @__PURE__ */
|
|
3085
|
+
const { theme: i } = Q();
|
|
3086
|
+
return /* @__PURE__ */ a(
|
|
2644
3087
|
"button",
|
|
2645
3088
|
{
|
|
2646
3089
|
onClick: o,
|
|
2647
3090
|
title: r,
|
|
2648
|
-
className:
|
|
3091
|
+
className: s,
|
|
2649
3092
|
style: {
|
|
2650
3093
|
background: "transparent",
|
|
2651
3094
|
border: "none",
|
|
2652
|
-
color:
|
|
3095
|
+
color: i.colors.textSecondary,
|
|
2653
3096
|
cursor: "pointer",
|
|
2654
3097
|
padding: "6px",
|
|
2655
3098
|
borderRadius: "4px",
|
|
@@ -2661,89 +3104,89 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2661
3104
|
height: "32px",
|
|
2662
3105
|
...t
|
|
2663
3106
|
},
|
|
2664
|
-
onMouseEnter: (
|
|
2665
|
-
|
|
3107
|
+
onMouseEnter: (l) => {
|
|
3108
|
+
l.currentTarget.style.backgroundColor = i.colors.backgroundTertiary, l.currentTarget.style.color = i.colors.text;
|
|
2666
3109
|
},
|
|
2667
|
-
onMouseLeave: (
|
|
2668
|
-
|
|
3110
|
+
onMouseLeave: (l) => {
|
|
3111
|
+
l.currentTarget.style.backgroundColor = "transparent", l.currentTarget.style.color = i.colors.textSecondary;
|
|
2669
3112
|
},
|
|
2670
|
-
children: /* @__PURE__ */
|
|
3113
|
+
children: /* @__PURE__ */ a(rt, { size: e })
|
|
2671
3114
|
}
|
|
2672
3115
|
);
|
|
2673
|
-
},
|
|
3116
|
+
}, It = ({
|
|
2674
3117
|
leftSidebarCollapsed: o = !1,
|
|
2675
3118
|
onToggleLeftSidebar: e,
|
|
2676
3119
|
showLeftSidebarControl: t = !1,
|
|
2677
3120
|
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:
|
|
3121
|
+
onToggleRightSidebar: s,
|
|
3122
|
+
showRightSidebarControl: i = !1,
|
|
3123
|
+
onSwitchLeftMiddlePanels: l,
|
|
3124
|
+
showSwitchLeftMiddle: n = !1,
|
|
3125
|
+
onSwitchRightMiddlePanels: f,
|
|
3126
|
+
showSwitchRightMiddle: c = !1,
|
|
3127
|
+
onConfigurePanels: y,
|
|
3128
|
+
showConfigureButton: g = !1,
|
|
3129
|
+
gap: h = 4,
|
|
3130
|
+
style: v,
|
|
3131
|
+
className: u,
|
|
2689
3132
|
iconSize: d,
|
|
2690
|
-
leftCollapseButtonProps:
|
|
3133
|
+
leftCollapseButtonProps: p,
|
|
2691
3134
|
rightCollapseButtonProps: C,
|
|
2692
|
-
leftMiddleSwitchButtonProps:
|
|
2693
|
-
rightMiddleSwitchButtonProps:
|
|
3135
|
+
leftMiddleSwitchButtonProps: $,
|
|
3136
|
+
rightMiddleSwitchButtonProps: z,
|
|
2694
3137
|
configureButtonProps: I
|
|
2695
|
-
}) => t && e ||
|
|
3138
|
+
}) => t && e || n && l || g && y || c && f || i && s ? /* @__PURE__ */ k(
|
|
2696
3139
|
"div",
|
|
2697
3140
|
{
|
|
2698
|
-
className:
|
|
3141
|
+
className: u,
|
|
2699
3142
|
style: {
|
|
2700
3143
|
display: "flex",
|
|
2701
3144
|
alignItems: "center",
|
|
2702
|
-
gap: `${
|
|
2703
|
-
...
|
|
3145
|
+
gap: `${h}px`,
|
|
3146
|
+
...v
|
|
2704
3147
|
},
|
|
2705
3148
|
children: [
|
|
2706
|
-
t && e && /* @__PURE__ */
|
|
2707
|
-
|
|
3149
|
+
t && e && /* @__PURE__ */ a(
|
|
3150
|
+
he,
|
|
2708
3151
|
{
|
|
2709
3152
|
isCollapsed: o,
|
|
2710
3153
|
onToggle: e,
|
|
2711
3154
|
side: "left",
|
|
2712
3155
|
iconSize: d ?? 18,
|
|
2713
|
-
...
|
|
3156
|
+
...p
|
|
2714
3157
|
}
|
|
2715
3158
|
),
|
|
2716
|
-
|
|
2717
|
-
|
|
3159
|
+
n && l && /* @__PURE__ */ a(
|
|
3160
|
+
ye,
|
|
2718
3161
|
{
|
|
2719
|
-
onSwitch:
|
|
3162
|
+
onSwitch: l,
|
|
2720
3163
|
variant: "left-middle",
|
|
2721
3164
|
iconSize: d ?? 14,
|
|
2722
|
-
|
|
3165
|
+
...$
|
|
2723
3166
|
}
|
|
2724
3167
|
),
|
|
2725
|
-
|
|
2726
|
-
|
|
3168
|
+
g && y && /* @__PURE__ */ a(
|
|
3169
|
+
nt,
|
|
2727
3170
|
{
|
|
2728
|
-
onConfigure:
|
|
3171
|
+
onConfigure: y,
|
|
2729
3172
|
iconSize: d ?? 14,
|
|
2730
3173
|
...I
|
|
2731
3174
|
}
|
|
2732
3175
|
),
|
|
2733
|
-
|
|
2734
|
-
|
|
3176
|
+
c && f && /* @__PURE__ */ a(
|
|
3177
|
+
ye,
|
|
2735
3178
|
{
|
|
2736
|
-
onSwitch:
|
|
3179
|
+
onSwitch: f,
|
|
2737
3180
|
variant: "right-middle",
|
|
2738
3181
|
iconSize: d ?? 14,
|
|
2739
|
-
|
|
3182
|
+
...z
|
|
2740
3183
|
}
|
|
2741
3184
|
),
|
|
2742
|
-
|
|
2743
|
-
|
|
3185
|
+
i && s && /* @__PURE__ */ a(
|
|
3186
|
+
he,
|
|
2744
3187
|
{
|
|
2745
3188
|
isCollapsed: r,
|
|
2746
|
-
onToggle:
|
|
3189
|
+
onToggle: s,
|
|
2747
3190
|
side: "right",
|
|
2748
3191
|
iconSize: d ?? 18,
|
|
2749
3192
|
...C
|
|
@@ -2753,52 +3196,53 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
|
|
|
2753
3196
|
}
|
|
2754
3197
|
) : null;
|
|
2755
3198
|
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
|
-
|
|
3199
|
+
me as AgentCommandInput,
|
|
3200
|
+
Oe as AgentCommandPalette,
|
|
3201
|
+
ke as AgentResponseDisplay,
|
|
3202
|
+
zt as EditableConfigurablePanelLayout,
|
|
3203
|
+
ht as FocusIndicator,
|
|
3204
|
+
yt as FocusModeOverlay,
|
|
3205
|
+
Re as LocalStoragePersistenceAdapter,
|
|
3206
|
+
De as LocalStorageWorkspaceAdapter,
|
|
3207
|
+
he as PanelCollapseButton,
|
|
3208
|
+
nt as PanelConfigureButton,
|
|
3209
|
+
It as PanelControls,
|
|
3210
|
+
ye as PanelSwitchButton,
|
|
3211
|
+
be as QuickCommandAutocomplete,
|
|
3212
|
+
Pt as ResponsiveConfigurablePanelLayout,
|
|
3213
|
+
xe as ToolExecutionList,
|
|
3214
|
+
N as WorkspaceLayoutService,
|
|
3215
|
+
Ce as collapseAllPanelsTool,
|
|
3216
|
+
Ie as expandAllPanelsTool,
|
|
3217
|
+
$e as focusPanelTool,
|
|
3218
|
+
pe as fuzzyMatch,
|
|
3219
|
+
Ct as generateToolsSystemPrompt,
|
|
3220
|
+
Se as getPanelStateTool,
|
|
3221
|
+
we as getVisiblePanelsTool,
|
|
3222
|
+
kt as layoutActionTools,
|
|
3223
|
+
He as layoutTools,
|
|
3224
|
+
bt as layoutToolsMetadata,
|
|
3225
|
+
ve as listPanelsWithStateTool,
|
|
3226
|
+
Wt as mapThemeToPanelVars,
|
|
3227
|
+
_t as mapThemeToTabVars,
|
|
3228
|
+
ze as resetLayoutTool,
|
|
3229
|
+
Fe as searchQuickCommands,
|
|
3230
|
+
xt as stateQueryTools,
|
|
3231
|
+
Ae as switchPanelTool,
|
|
3232
|
+
Te as togglePanelTool,
|
|
3233
|
+
Ge as toolToAIFunction,
|
|
3234
|
+
Ue as toolToAnthropicFormat,
|
|
3235
|
+
Qe as toolToGeminiFunction,
|
|
3236
|
+
Je as toolToOpenAIFunction,
|
|
3237
|
+
Tt as toolsToAIFunctions,
|
|
3238
|
+
vt as toolsToAnthropicFormat,
|
|
3239
|
+
wt as toolsToGeminiFormat,
|
|
3240
|
+
St as toolsToOpenAIFormat,
|
|
3241
|
+
mt as useAgentCommandPalette,
|
|
3242
|
+
ut as usePanelFocus,
|
|
3243
|
+
gt as usePanelFocusListener,
|
|
3244
|
+
ft as usePanelKeyboardShortcuts,
|
|
3245
|
+
dt as usePanelPersistence,
|
|
3246
|
+
pt as useWorkspace
|
|
2803
3247
|
};
|
|
2804
3248
|
//# sourceMappingURL=index.esm.js.map
|