@principal-ade/panel-layouts 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +605 -589
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import './index.css';var
|
|
2
|
-
var Ee = (o, e, t) => e in o ?
|
|
1
|
+
import './index.css';var _e = Object.defineProperty;
|
|
2
|
+
var Ee = (o, e, t) => e in o ? _e(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
3
|
var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { EditableConfigurablePanelLayout as zt, ResponsiveConfigurablePanelLayout as Pt, mapThemeToPanelVars as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { jsx as a, jsxs as
|
|
7
|
-
import { useTheme as
|
|
4
|
+
import { EditableConfigurablePanelLayout as zt, ResponsiveConfigurablePanelLayout as Pt, mapThemeToPanelVars as Lt, mapThemeToTabVars as Wt } from "@principal-ade/panels";
|
|
5
|
+
import { useState as L, useRef as J, useEffect as R, useCallback as b, useMemo as ne } from "react";
|
|
6
|
+
import { jsx as a, jsxs as y, Fragment as ce } from "react/jsx-runtime";
|
|
7
|
+
import { useTheme as Y } from "@principal-ade/industry-theme";
|
|
8
8
|
class Re {
|
|
9
9
|
constructor() {
|
|
10
10
|
le(this, "storageKey", "panel-layouts");
|
|
@@ -34,40 +34,40 @@ function dt(o) {
|
|
|
34
34
|
defaultSizes: t,
|
|
35
35
|
panelType: r,
|
|
36
36
|
adapter: s = new Re()
|
|
37
|
-
} = o, [i, l] =
|
|
37
|
+
} = o, [i, l] = L(t), [n, g] = L(o.collapsed), c = J(o.collapsed), k = J({}), u = J(null), h = J(null);
|
|
38
38
|
R(() => {
|
|
39
39
|
(async () => {
|
|
40
40
|
const w = await s.load(e);
|
|
41
|
-
w != null && w.sizes && (l(w.sizes),
|
|
41
|
+
w != null && w.sizes && (l(w.sizes), C(w.sizes));
|
|
42
42
|
})();
|
|
43
43
|
}, [e]);
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
"left" in
|
|
44
|
+
const C = b(
|
|
45
|
+
(S) => {
|
|
46
|
+
"left" in S && S.left > 0 && (k.current.left = S.left), "middle" in S && S.middle > 0 && (k.current.middle = S.middle), "right" in S && S.right > 0 && (k.current.right = S.right);
|
|
47
47
|
},
|
|
48
48
|
[]
|
|
49
|
-
),
|
|
50
|
-
(
|
|
51
|
-
const w =
|
|
49
|
+
), f = b(
|
|
50
|
+
(S) => {
|
|
51
|
+
const w = k.current[S];
|
|
52
52
|
if (w && w > 0)
|
|
53
53
|
return w;
|
|
54
|
-
if (
|
|
54
|
+
if (S === "left" && "left" in t && t.left > 0)
|
|
55
55
|
return t.left;
|
|
56
|
-
if (
|
|
56
|
+
if (S === "right" && "right" in t && t.right > 0)
|
|
57
57
|
return t.right;
|
|
58
58
|
},
|
|
59
59
|
[t]
|
|
60
|
-
), d =
|
|
60
|
+
), d = J(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) && (l(t),
|
|
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), C(t), d.current = t);
|
|
63
|
+
}, [t, C]), R(() => {
|
|
64
|
+
const S = o.collapsed.left !== c.current.left, w = "right" in o.collapsed && "right" in c.current && o.collapsed.right !== c.current.right;
|
|
65
|
+
(S || w) && (g(o.collapsed), c.current = { ...o.collapsed });
|
|
66
66
|
}, [o.collapsed.left, o.collapsed.right]);
|
|
67
|
-
const p =
|
|
68
|
-
async (
|
|
67
|
+
const p = b(
|
|
68
|
+
async (S) => {
|
|
69
69
|
try {
|
|
70
|
-
await s.save(e, { sizes:
|
|
70
|
+
await s.save(e, { sizes: S });
|
|
71
71
|
} catch (w) {
|
|
72
72
|
console.error(
|
|
73
73
|
`Failed to save panel preferences for ${e}:`,
|
|
@@ -76,68 +76,68 @@ function dt(o) {
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
[e, s]
|
|
79
|
-
),
|
|
80
|
-
(
|
|
81
|
-
const w = { ...
|
|
79
|
+
), T = b(
|
|
80
|
+
(S) => {
|
|
81
|
+
const w = { ...S };
|
|
82
82
|
let x = !0;
|
|
83
|
-
if ("left" in
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
} else
|
|
83
|
+
if ("left" in S) {
|
|
84
|
+
const A = !!(n != null && n.left), z = S.left;
|
|
85
|
+
if (A) {
|
|
86
|
+
const $ = f("left");
|
|
87
|
+
$ !== void 0 && $ > 0 ? w.left = $ : x = !1;
|
|
88
|
+
} else z === 0 && (x = !1);
|
|
89
89
|
}
|
|
90
|
-
if (r === "three-panel" && "right" in
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
} else
|
|
90
|
+
if (r === "three-panel" && "right" in S) {
|
|
91
|
+
const A = !!(n != null && n.right), z = S.right;
|
|
92
|
+
if (A) {
|
|
93
|
+
const $ = f("right");
|
|
94
|
+
$ !== void 0 && $ > 0 ? w.right = $ : x = !1;
|
|
95
|
+
} else z === 0 && (x = !1);
|
|
96
96
|
}
|
|
97
|
-
if (l(w),
|
|
97
|
+
if (l(w), C(w), u.current && (clearTimeout(u.current), u.current = null), !x) {
|
|
98
98
|
h.current = null;
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
h.current = w,
|
|
102
|
-
const
|
|
103
|
-
|
|
101
|
+
h.current = w, u.current = setTimeout(() => {
|
|
102
|
+
const A = h.current;
|
|
103
|
+
A && (p(A), h.current = null), u.current = null;
|
|
104
104
|
}, 500);
|
|
105
105
|
},
|
|
106
106
|
[
|
|
107
107
|
n,
|
|
108
|
-
|
|
108
|
+
f,
|
|
109
109
|
r,
|
|
110
110
|
p,
|
|
111
|
-
|
|
111
|
+
C
|
|
112
112
|
]
|
|
113
113
|
);
|
|
114
114
|
R(() => () => {
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
115
|
+
if (u.current) {
|
|
116
|
+
const S = h.current;
|
|
117
|
+
S && (p(S), h.current = null), clearTimeout(u.current), u.current = null;
|
|
118
118
|
}
|
|
119
119
|
}, [p]);
|
|
120
|
-
const
|
|
121
|
-
}, []),
|
|
122
|
-
}, []), I =
|
|
123
|
-
}, []),
|
|
120
|
+
const W = b(async () => {
|
|
121
|
+
}, []), D = b(async () => {
|
|
122
|
+
}, []), I = b(async () => {
|
|
123
|
+
}, []), _ = b(async () => {
|
|
124
124
|
}, []);
|
|
125
125
|
return r === "three-panel" ? {
|
|
126
126
|
type: "three-panel",
|
|
127
127
|
sizes: i,
|
|
128
128
|
collapsed: n,
|
|
129
|
-
handlePanelResize:
|
|
130
|
-
handleLeftCollapseComplete:
|
|
131
|
-
handleLeftExpandComplete:
|
|
129
|
+
handlePanelResize: T,
|
|
130
|
+
handleLeftCollapseComplete: W,
|
|
131
|
+
handleLeftExpandComplete: D,
|
|
132
132
|
handleRightCollapseComplete: I,
|
|
133
|
-
handleRightExpandComplete:
|
|
133
|
+
handleRightExpandComplete: _
|
|
134
134
|
} : {
|
|
135
135
|
type: "two-panel",
|
|
136
136
|
sizes: i,
|
|
137
137
|
collapsed: n,
|
|
138
|
-
handlePanelResize:
|
|
139
|
-
handleLeftCollapseComplete:
|
|
140
|
-
handleLeftExpandComplete:
|
|
138
|
+
handlePanelResize: T,
|
|
139
|
+
handleLeftCollapseComplete: W,
|
|
140
|
+
handleLeftExpandComplete: D
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
class De {
|
|
@@ -221,7 +221,7 @@ class De {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class
|
|
224
|
+
class O {
|
|
225
225
|
/**
|
|
226
226
|
* Configure a custom storage adapter (for Electron IPC or remote storage)
|
|
227
227
|
*/
|
|
@@ -610,141 +610,141 @@ class N {
|
|
|
610
610
|
Object.keys(e).length;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
le(
|
|
613
|
+
le(O, "adapter", new De());
|
|
614
614
|
function pt(o = {}) {
|
|
615
|
-
const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, i] =
|
|
615
|
+
const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, i] = L(
|
|
616
616
|
{}
|
|
617
|
-
), [l, n] =
|
|
617
|
+
), [l, n] = L(null), [g, c] = L(null), [k, u] = L(!0), [h, C] = L(null), f = b(async () => {
|
|
618
618
|
try {
|
|
619
|
-
|
|
620
|
-
const x = await
|
|
619
|
+
u(!0), C(null);
|
|
620
|
+
const x = await O.getWorkspaceLayouts();
|
|
621
621
|
if (i(x), e) {
|
|
622
|
-
let
|
|
623
|
-
if (!
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
workspaceId:
|
|
627
|
-
sizes:
|
|
622
|
+
let A = await O.getRepositoryState(e);
|
|
623
|
+
if (!A && t) {
|
|
624
|
+
const z = r || "project-management", $ = await O.getWorkspaceLayout(z);
|
|
625
|
+
$ && (A = {
|
|
626
|
+
workspaceId: z,
|
|
627
|
+
sizes: $.defaultSizes || {
|
|
628
628
|
left: 20,
|
|
629
629
|
middle: 45,
|
|
630
630
|
right: 35
|
|
631
631
|
},
|
|
632
|
-
collapsed:
|
|
632
|
+
collapsed: $.defaultCollapsed || {
|
|
633
633
|
left: !1,
|
|
634
634
|
right: !1
|
|
635
635
|
}
|
|
636
|
-
}, await
|
|
636
|
+
}, await O.setRepositoryState(
|
|
637
637
|
e,
|
|
638
|
-
|
|
638
|
+
A
|
|
639
639
|
));
|
|
640
640
|
}
|
|
641
|
-
if (n(
|
|
642
|
-
const
|
|
643
|
-
|
|
641
|
+
if (n(A), A != null && A.workspaceId) {
|
|
642
|
+
const z = await O.getWorkspaceLayout(
|
|
643
|
+
A.workspaceId
|
|
644
644
|
);
|
|
645
|
-
c(
|
|
645
|
+
c(z);
|
|
646
646
|
} else
|
|
647
647
|
c(null);
|
|
648
648
|
}
|
|
649
649
|
} catch (x) {
|
|
650
|
-
|
|
650
|
+
C(x), console.error("Failed to load workspace data:", x);
|
|
651
651
|
} finally {
|
|
652
|
-
|
|
652
|
+
u(!1);
|
|
653
653
|
}
|
|
654
654
|
}, [e, t, r]);
|
|
655
655
|
R(() => {
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
const d =
|
|
659
|
-
async (x) => await
|
|
656
|
+
f();
|
|
657
|
+
}, [f]);
|
|
658
|
+
const d = b(
|
|
659
|
+
async (x) => await O.getWorkspaceLayout(x),
|
|
660
660
|
[]
|
|
661
|
-
), p =
|
|
661
|
+
), p = b(
|
|
662
662
|
async (x) => {
|
|
663
|
-
const
|
|
664
|
-
return await
|
|
663
|
+
const A = await O.createWorkspaceLayout(x);
|
|
664
|
+
return await f(), A;
|
|
665
665
|
},
|
|
666
|
-
[
|
|
667
|
-
),
|
|
668
|
-
async (x,
|
|
669
|
-
const
|
|
670
|
-
return await
|
|
666
|
+
[f]
|
|
667
|
+
), T = b(
|
|
668
|
+
async (x, A) => {
|
|
669
|
+
const z = await O.updateWorkspaceLayout(x, A);
|
|
670
|
+
return await f(), z;
|
|
671
671
|
},
|
|
672
|
-
[
|
|
673
|
-
),
|
|
672
|
+
[f]
|
|
673
|
+
), W = b(
|
|
674
674
|
async (x) => {
|
|
675
|
-
const
|
|
676
|
-
return
|
|
675
|
+
const A = await O.deleteWorkspaceLayout(x);
|
|
676
|
+
return A && await f(), A;
|
|
677
677
|
},
|
|
678
|
-
[
|
|
679
|
-
),
|
|
678
|
+
[f]
|
|
679
|
+
), D = b(
|
|
680
680
|
async (x) => {
|
|
681
681
|
if (!e) {
|
|
682
682
|
console.error("Cannot apply workspace without repositoryKey");
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
685
|
+
const A = await O.getWorkspaceLayout(x);
|
|
686
|
+
if (!A) {
|
|
687
687
|
console.error(`Workspace ${x} not found`);
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
690
|
+
const z = {
|
|
691
691
|
workspaceId: x,
|
|
692
|
-
sizes:
|
|
693
|
-
collapsed:
|
|
692
|
+
sizes: A.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
693
|
+
collapsed: A.defaultCollapsed || {
|
|
694
694
|
left: !1,
|
|
695
695
|
right: !1
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
await
|
|
698
|
+
await O.setRepositoryState(e, z), await f();
|
|
699
699
|
},
|
|
700
|
-
[e,
|
|
701
|
-
), I =
|
|
700
|
+
[e, f]
|
|
701
|
+
), I = b(
|
|
702
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 O.updateRepositorySizes(e, x), await f();
|
|
708
708
|
},
|
|
709
|
-
[e,
|
|
710
|
-
),
|
|
709
|
+
[e, f]
|
|
710
|
+
), _ = b(
|
|
711
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 O.updateRepositoryCollapsed(
|
|
717
717
|
e,
|
|
718
718
|
x
|
|
719
|
-
), await
|
|
719
|
+
), await f();
|
|
720
720
|
},
|
|
721
|
-
[e,
|
|
722
|
-
),
|
|
721
|
+
[e, f]
|
|
722
|
+
), S = b(async () => {
|
|
723
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 O.resetRepositoryToWorkspaceDefaults(
|
|
728
728
|
e,
|
|
729
729
|
l.workspaceId
|
|
730
|
-
), await
|
|
731
|
-
}, [e, l == null ? void 0 : l.workspaceId,
|
|
732
|
-
await
|
|
733
|
-
}, [
|
|
730
|
+
), await f();
|
|
731
|
+
}, [e, l == null ? void 0 : l.workspaceId, f]), w = b(async () => {
|
|
732
|
+
await f();
|
|
733
|
+
}, [f]);
|
|
734
734
|
return {
|
|
735
735
|
workspaces: s,
|
|
736
736
|
repositoryState: l,
|
|
737
|
-
activeWorkspace:
|
|
738
|
-
loading:
|
|
737
|
+
activeWorkspace: g,
|
|
738
|
+
loading: k,
|
|
739
739
|
error: h,
|
|
740
740
|
getWorkspace: d,
|
|
741
741
|
createWorkspace: p,
|
|
742
|
-
updateWorkspace:
|
|
743
|
-
deleteWorkspace:
|
|
744
|
-
applyWorkspace:
|
|
742
|
+
updateWorkspace: T,
|
|
743
|
+
deleteWorkspace: W,
|
|
744
|
+
applyWorkspace: D,
|
|
745
745
|
updateSizes: I,
|
|
746
|
-
updateCollapsed:
|
|
747
|
-
resetToDefaults:
|
|
746
|
+
updateCollapsed: _,
|
|
747
|
+
resetToDefaults: S,
|
|
748
748
|
refresh: w
|
|
749
749
|
};
|
|
750
750
|
}
|
|
@@ -756,32 +756,32 @@ function ut(o = {}) {
|
|
|
756
756
|
onFocusChange: s,
|
|
757
757
|
events: i,
|
|
758
758
|
getPanelId: l
|
|
759
|
-
} = o, [n,
|
|
759
|
+
} = o, [n, g] = L(
|
|
760
760
|
e
|
|
761
|
-
), c =
|
|
761
|
+
), c = b(
|
|
762
762
|
(d) => {
|
|
763
763
|
const p = n;
|
|
764
|
-
if (
|
|
764
|
+
if (g(d), s == null || s(d), i && l) {
|
|
765
765
|
if (p) {
|
|
766
|
-
const
|
|
767
|
-
|
|
766
|
+
const W = l(p);
|
|
767
|
+
W && i.emit({
|
|
768
768
|
type: "panel:blur",
|
|
769
769
|
source: "panel-layouts",
|
|
770
770
|
timestamp: Date.now(),
|
|
771
771
|
payload: {
|
|
772
|
-
panelId:
|
|
772
|
+
panelId: W,
|
|
773
773
|
panelSlot: p,
|
|
774
774
|
nextPanelId: l(d)
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const T = l(d);
|
|
779
|
+
T && i.emit({
|
|
780
780
|
type: "panel:focus",
|
|
781
781
|
source: "panel-layouts",
|
|
782
782
|
timestamp: Date.now(),
|
|
783
783
|
payload: {
|
|
784
|
-
panelId:
|
|
784
|
+
panelId: T,
|
|
785
785
|
panelSlot: d,
|
|
786
786
|
source: "keyboard-shortcut"
|
|
787
787
|
}
|
|
@@ -789,9 +789,9 @@ function ut(o = {}) {
|
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
791
|
[n, s, i, l]
|
|
792
|
-
),
|
|
792
|
+
), k = b(() => {
|
|
793
793
|
const d = n;
|
|
794
|
-
if (
|
|
794
|
+
if (g(null), s == null || s(null), i && l && d) {
|
|
795
795
|
const p = l(d);
|
|
796
796
|
p && i.emit({
|
|
797
797
|
type: "panel:blur",
|
|
@@ -803,11 +803,11 @@ function ut(o = {}) {
|
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
}, [n, s, i, l]),
|
|
806
|
+
}, [n, s, i, l]), u = b(() => {
|
|
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]), h =
|
|
810
|
-
const d =
|
|
809
|
+
}, [t, r]), h = b(() => {
|
|
810
|
+
const d = u();
|
|
811
811
|
if (d.length === 0) return;
|
|
812
812
|
if (n === null) {
|
|
813
813
|
c(d[0]);
|
|
@@ -818,10 +818,10 @@ function ut(o = {}) {
|
|
|
818
818
|
c(d[0]);
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
const
|
|
822
|
-
c(d[
|
|
823
|
-
}, [n,
|
|
824
|
-
const d =
|
|
821
|
+
const T = (p + 1) % d.length;
|
|
822
|
+
c(d[T]);
|
|
823
|
+
}, [n, u, c]), C = b(() => {
|
|
824
|
+
const d = u();
|
|
825
825
|
if (d.length === 0) return;
|
|
826
826
|
if (n === null) {
|
|
827
827
|
c(d[d.length - 1]);
|
|
@@ -832,19 +832,19 @@ function ut(o = {}) {
|
|
|
832
832
|
c(d[d.length - 1]);
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
|
-
const
|
|
836
|
-
c(d[
|
|
837
|
-
}, [n,
|
|
835
|
+
const T = p === 0 ? d.length - 1 : p - 1;
|
|
836
|
+
c(d[T]);
|
|
837
|
+
}, [n, u, c]), f = b(
|
|
838
838
|
(d) => n === d,
|
|
839
839
|
[n]
|
|
840
840
|
);
|
|
841
841
|
return {
|
|
842
842
|
focusedPanel: n,
|
|
843
843
|
setFocus: c,
|
|
844
|
-
clearFocus:
|
|
844
|
+
clearFocus: k,
|
|
845
845
|
focusNext: h,
|
|
846
|
-
focusPrevious:
|
|
847
|
-
isFocused:
|
|
846
|
+
focusPrevious: C,
|
|
847
|
+
isFocused: f
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
850
|
function ft(o) {
|
|
@@ -856,29 +856,29 @@ function ft(o) {
|
|
|
856
856
|
setFocus: i,
|
|
857
857
|
onExpand: l,
|
|
858
858
|
onCollapse: n
|
|
859
|
-
} = o,
|
|
859
|
+
} = o, g = J(t), c = J(r), k = J(s);
|
|
860
860
|
R(() => {
|
|
861
|
-
|
|
861
|
+
g.current = t;
|
|
862
862
|
}, [t]), R(() => {
|
|
863
863
|
c.current = r;
|
|
864
864
|
}, [r]), R(() => {
|
|
865
|
-
|
|
865
|
+
k.current = s;
|
|
866
866
|
}, [s]);
|
|
867
|
-
const
|
|
867
|
+
const u = b(
|
|
868
868
|
(h) => {
|
|
869
869
|
if (!h.altKey || h.ctrlKey || h.metaKey || h.shiftKey)
|
|
870
870
|
return;
|
|
871
|
-
const
|
|
872
|
-
|
|
871
|
+
const C = h.code, f = g.current, d = c.current, p = k.current;
|
|
872
|
+
C === "Digit1" || C === "Numpad1" ? (h.preventDefault(), d.left ? l("left") : f !== "left" ? i("left") : (n("left"), i("middle"))) : C === "Digit2" || C === "Numpad2" ? (h.preventDefault(), i("middle")) : (C === "Digit3" || C === "Numpad3") && p === "three-panel" && (h.preventDefault(), d.right ? l("right") : f !== "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", u), () => {
|
|
879
|
+
window.removeEventListener("keydown", u);
|
|
880
880
|
};
|
|
881
|
-
}, [e,
|
|
881
|
+
}, [e, u]);
|
|
882
882
|
}
|
|
883
883
|
function gt(o, e, t, r) {
|
|
884
884
|
R(() => {
|
|
@@ -977,7 +977,7 @@ const ht = ({
|
|
|
977
977
|
}
|
|
978
978
|
|
|
979
979
|
`, document.head.appendChild(o);
|
|
980
|
-
},
|
|
980
|
+
}, mt = ({
|
|
981
981
|
active: o,
|
|
982
982
|
variant: e = "soft-fade",
|
|
983
983
|
effects: t = [],
|
|
@@ -985,20 +985,55 @@ const ht = ({
|
|
|
985
985
|
animationDuration: s = 300,
|
|
986
986
|
cascadeDelay: i = 0,
|
|
987
987
|
color: l,
|
|
988
|
-
|
|
989
|
-
|
|
988
|
+
hideOnHover: n = !0,
|
|
989
|
+
className: g = "",
|
|
990
|
+
style: c = {}
|
|
990
991
|
}) => {
|
|
991
|
-
const { theme:
|
|
992
|
+
const { theme: k } = Y(), [u, h] = L(!1), [C, f] = L(!1), d = J(null);
|
|
992
993
|
R(() => {
|
|
993
994
|
Me();
|
|
994
995
|
}, []), R(() => {
|
|
996
|
+
if (!n || !o) {
|
|
997
|
+
f(!1);
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
const X = (H) => {
|
|
1001
|
+
if (d.current) {
|
|
1002
|
+
const M = d.current.getBoundingClientRect(), te = H.clientX >= M.left && H.clientX <= M.right && H.clientY >= M.top && H.clientY <= M.bottom;
|
|
1003
|
+
f(te);
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
return document.addEventListener("mousemove", X), () => document.removeEventListener("mousemove", X);
|
|
1007
|
+
}, [n, o]), R(() => {
|
|
995
1008
|
if (o) {
|
|
996
|
-
const
|
|
997
|
-
return () => clearTimeout(
|
|
1009
|
+
const X = setTimeout(() => h(!0), i);
|
|
1010
|
+
return () => clearTimeout(X);
|
|
998
1011
|
} else
|
|
999
|
-
|
|
1012
|
+
h(!1);
|
|
1000
1013
|
}, [o, i]);
|
|
1001
|
-
const
|
|
1014
|
+
const p = l || k.colors.background, T = () => {
|
|
1015
|
+
switch (e) {
|
|
1016
|
+
case "soft-fade":
|
|
1017
|
+
return {
|
|
1018
|
+
backgroundColor: p,
|
|
1019
|
+
opacity: u ? r : 0,
|
|
1020
|
+
transition: `opacity ${s}ms ease-out`
|
|
1021
|
+
};
|
|
1022
|
+
case "cascading-fade":
|
|
1023
|
+
return {
|
|
1024
|
+
backgroundColor: p,
|
|
1025
|
+
opacity: u ? r : 0,
|
|
1026
|
+
transition: `opacity ${s}ms ease-out`,
|
|
1027
|
+
transitionDelay: u ? "0ms" : `${i}ms`
|
|
1028
|
+
};
|
|
1029
|
+
default:
|
|
1030
|
+
return {
|
|
1031
|
+
backgroundColor: p,
|
|
1032
|
+
opacity: u ? r : 0,
|
|
1033
|
+
transition: `opacity ${s}ms ease-out`
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
}, W = n && C, D = {
|
|
1002
1037
|
position: "absolute",
|
|
1003
1038
|
top: 0,
|
|
1004
1039
|
left: 0,
|
|
@@ -1007,155 +1042,136 @@ const ht = ({
|
|
|
1007
1042
|
pointerEvents: "none",
|
|
1008
1043
|
zIndex: 999,
|
|
1009
1044
|
overflow: "hidden",
|
|
1010
|
-
...(
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
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 = {
|
|
1045
|
+
...T(),
|
|
1046
|
+
// Override opacity when hovered
|
|
1047
|
+
...W ? { opacity: 0 } : {},
|
|
1048
|
+
...c
|
|
1049
|
+
}, I = t.includes("vignette-drift"), _ = t.includes("radial-breathing"), S = t.includes("snowfall"), w = (X, H) => {
|
|
1050
|
+
const M = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(X);
|
|
1051
|
+
if (!M) return `rgba(255, 255, 255, ${H})`;
|
|
1052
|
+
const te = parseInt(M[1], 16), B = parseInt(M[2], 16), U = parseInt(M[3], 16);
|
|
1053
|
+
return `rgba(${te}, ${B}, ${U}, ${H})`;
|
|
1054
|
+
}, x = k.colors.primary, A = {
|
|
1040
1055
|
position: "absolute",
|
|
1041
1056
|
top: 0,
|
|
1042
1057
|
left: 0,
|
|
1043
1058
|
right: 0,
|
|
1044
1059
|
bottom: 0,
|
|
1045
1060
|
pointerEvents: "none",
|
|
1046
|
-
opacity:
|
|
1061
|
+
opacity: u ? 1 : 0,
|
|
1047
1062
|
transition: `opacity ${s}ms ease-out`,
|
|
1048
|
-
background: `radial-gradient(circle at 50% 50%, ${
|
|
1063
|
+
background: `radial-gradient(circle at 50% 50%, ${w(x, 0.12)} 0%, ${w(x, 0.06)} 25%, transparent 50%)`,
|
|
1049
1064
|
backgroundSize: "150% 150%",
|
|
1050
|
-
animation:
|
|
1051
|
-
},
|
|
1065
|
+
animation: u ? "focus-overlay-vignette-drift 12s ease-in-out infinite" : "none"
|
|
1066
|
+
}, z = {
|
|
1052
1067
|
position: "absolute",
|
|
1053
1068
|
top: 0,
|
|
1054
1069
|
left: 0,
|
|
1055
1070
|
right: 0,
|
|
1056
1071
|
bottom: 0,
|
|
1057
1072
|
pointerEvents: "none",
|
|
1058
|
-
opacity:
|
|
1073
|
+
opacity: u ? 1 : 0,
|
|
1059
1074
|
transition: `opacity ${s}ms ease-out`,
|
|
1060
|
-
background: `radial-gradient(circle at center, ${
|
|
1061
|
-
animation:
|
|
1062
|
-
},
|
|
1075
|
+
background: `radial-gradient(circle at center, ${w(x, 0.15)} 0%, ${w(x, 0.06)} 30%, transparent 55%)`,
|
|
1076
|
+
animation: u ? "focus-overlay-radial-breathing 4s ease-in-out infinite" : "none"
|
|
1077
|
+
}, $ = w(x, 0.6), v = w(x, 0.4), P = w(x, 0.25), V = {
|
|
1063
1078
|
position: "absolute",
|
|
1064
1079
|
top: 0,
|
|
1065
1080
|
left: 0,
|
|
1066
1081
|
right: 0,
|
|
1067
1082
|
bottom: 0,
|
|
1068
1083
|
pointerEvents: "none",
|
|
1069
|
-
opacity:
|
|
1084
|
+
opacity: u ? 1 : 0,
|
|
1070
1085
|
transition: `opacity ${s}ms ease-out`
|
|
1071
|
-
},
|
|
1072
|
-
...
|
|
1086
|
+
}, ae = {
|
|
1087
|
+
...V,
|
|
1073
1088
|
background: `
|
|
1074
|
-
radial-gradient(circle, ${
|
|
1075
|
-
radial-gradient(circle, ${
|
|
1076
|
-
radial-gradient(circle, ${
|
|
1077
|
-
radial-gradient(circle, ${
|
|
1089
|
+
radial-gradient(circle, ${$} 0%, ${$} 3px, transparent 3px),
|
|
1090
|
+
radial-gradient(circle, ${$} 0%, ${$} 3px, transparent 3px),
|
|
1091
|
+
radial-gradient(circle, ${$} 0%, ${$} 3px, transparent 3px),
|
|
1092
|
+
radial-gradient(circle, ${$} 0%, ${$} 3px, transparent 3px)
|
|
1078
1093
|
`,
|
|
1079
1094
|
backgroundSize: "150px 150px",
|
|
1080
1095
|
backgroundPosition: "10px 20px, 60px 80px, 110px 40px, 40px 120px",
|
|
1081
|
-
animation:
|
|
1082
|
-
},
|
|
1083
|
-
...
|
|
1096
|
+
animation: u ? "focus-overlay-snowfall-1 4s linear infinite" : "none"
|
|
1097
|
+
}, K = {
|
|
1098
|
+
...V,
|
|
1084
1099
|
background: `
|
|
1085
|
-
radial-gradient(circle, ${
|
|
1086
|
-
radial-gradient(circle, ${
|
|
1087
|
-
radial-gradient(circle, ${
|
|
1088
|
-
radial-gradient(circle, ${
|
|
1089
|
-
radial-gradient(circle, ${
|
|
1100
|
+
radial-gradient(circle, ${v} 0%, ${v} 2px, transparent 2px),
|
|
1101
|
+
radial-gradient(circle, ${v} 0%, ${v} 2px, transparent 2px),
|
|
1102
|
+
radial-gradient(circle, ${v} 0%, ${v} 2px, transparent 2px),
|
|
1103
|
+
radial-gradient(circle, ${v} 0%, ${v} 2px, transparent 2px),
|
|
1104
|
+
radial-gradient(circle, ${v} 0%, ${v} 2px, transparent 2px)
|
|
1090
1105
|
`,
|
|
1091
1106
|
backgroundSize: "150px 150px",
|
|
1092
1107
|
backgroundPosition: "30px 10px, 90px 60px, 15px 100px, 120px 30px, 70px 130px",
|
|
1093
|
-
animation:
|
|
1094
|
-
},
|
|
1095
|
-
...
|
|
1108
|
+
animation: u ? "focus-overlay-snowfall-2 7s linear infinite" : "none"
|
|
1109
|
+
}, G = {
|
|
1110
|
+
...V,
|
|
1096
1111
|
background: `
|
|
1097
|
-
radial-gradient(circle, ${
|
|
1098
|
-
radial-gradient(circle, ${
|
|
1099
|
-
radial-gradient(circle, ${
|
|
1100
|
-
radial-gradient(circle, ${
|
|
1101
|
-
radial-gradient(circle, ${
|
|
1102
|
-
radial-gradient(circle, ${
|
|
1112
|
+
radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
|
|
1113
|
+
radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
|
|
1114
|
+
radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
|
|
1115
|
+
radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
|
|
1116
|
+
radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px),
|
|
1117
|
+
radial-gradient(circle, ${P} 0%, ${P} 1.5px, transparent 1.5px)
|
|
1103
1118
|
`,
|
|
1104
1119
|
backgroundSize: "150px 150px",
|
|
1105
1120
|
backgroundPosition: "20px 5px, 80px 45px, 45px 90px, 130px 20px, 5px 70px, 100px 110px",
|
|
1106
|
-
animation:
|
|
1121
|
+
animation: u ? "focus-overlay-snowfall-3 12s linear infinite" : "none"
|
|
1107
1122
|
};
|
|
1108
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ y(
|
|
1109
1124
|
"div",
|
|
1110
1125
|
{
|
|
1111
|
-
|
|
1112
|
-
|
|
1126
|
+
ref: d,
|
|
1127
|
+
className: `focus-mode-overlay focus-mode-overlay--${e} ${g}`,
|
|
1128
|
+
style: D,
|
|
1113
1129
|
role: "presentation",
|
|
1114
1130
|
"aria-hidden": "true",
|
|
1115
1131
|
"data-active": o,
|
|
1116
1132
|
"data-variant": e,
|
|
1117
1133
|
children: [
|
|
1118
|
-
|
|
1134
|
+
I && /* @__PURE__ */ a(
|
|
1119
1135
|
"div",
|
|
1120
1136
|
{
|
|
1121
1137
|
className: "focus-mode-overlay__vignette-drift",
|
|
1122
|
-
style:
|
|
1138
|
+
style: A
|
|
1123
1139
|
}
|
|
1124
1140
|
),
|
|
1125
|
-
|
|
1141
|
+
_ && /* @__PURE__ */ a(
|
|
1126
1142
|
"div",
|
|
1127
1143
|
{
|
|
1128
1144
|
className: "focus-mode-overlay__radial-breathing",
|
|
1129
|
-
style:
|
|
1145
|
+
style: z
|
|
1130
1146
|
}
|
|
1131
1147
|
),
|
|
1132
|
-
|
|
1148
|
+
S && /* @__PURE__ */ y(ce, { children: [
|
|
1133
1149
|
/* @__PURE__ */ a(
|
|
1134
1150
|
"div",
|
|
1135
1151
|
{
|
|
1136
1152
|
className: "focus-mode-overlay__snowfall-layer-3",
|
|
1137
|
-
style:
|
|
1153
|
+
style: G
|
|
1138
1154
|
}
|
|
1139
1155
|
),
|
|
1140
1156
|
/* @__PURE__ */ a(
|
|
1141
1157
|
"div",
|
|
1142
1158
|
{
|
|
1143
1159
|
className: "focus-mode-overlay__snowfall-layer-2",
|
|
1144
|
-
style:
|
|
1160
|
+
style: K
|
|
1145
1161
|
}
|
|
1146
1162
|
),
|
|
1147
1163
|
/* @__PURE__ */ a(
|
|
1148
1164
|
"div",
|
|
1149
1165
|
{
|
|
1150
1166
|
className: "focus-mode-overlay__snowfall-layer-1",
|
|
1151
|
-
style:
|
|
1167
|
+
style: ae
|
|
1152
1168
|
}
|
|
1153
1169
|
)
|
|
1154
1170
|
] })
|
|
1155
1171
|
]
|
|
1156
1172
|
}
|
|
1157
1173
|
);
|
|
1158
|
-
},
|
|
1174
|
+
}, ye = ({
|
|
1159
1175
|
value: o,
|
|
1160
1176
|
onChange: e,
|
|
1161
1177
|
onSubmit: t,
|
|
@@ -1164,20 +1180,20 @@ const ht = ({
|
|
|
1164
1180
|
onHistoryNext: i,
|
|
1165
1181
|
mode: l,
|
|
1166
1182
|
status: n,
|
|
1167
|
-
placeholder:
|
|
1183
|
+
placeholder: g = "What would you like to do?",
|
|
1168
1184
|
disabled: c = !1,
|
|
1169
|
-
autoFocus:
|
|
1170
|
-
agentAvailable:
|
|
1185
|
+
autoFocus: k = !0,
|
|
1186
|
+
agentAvailable: u = !0,
|
|
1171
1187
|
showAutocomplete: h = !1,
|
|
1172
|
-
onAutocompleteNext:
|
|
1173
|
-
onAutocompletePrevious:
|
|
1188
|
+
onAutocompleteNext: C,
|
|
1189
|
+
onAutocompletePrevious: f,
|
|
1174
1190
|
onAutocompleteAccept: d
|
|
1175
1191
|
}) => {
|
|
1176
|
-
const { theme: p } =
|
|
1192
|
+
const { theme: p } = Y(), T = J(null);
|
|
1177
1193
|
R(() => {
|
|
1178
|
-
|
|
1179
|
-
}, [
|
|
1180
|
-
const
|
|
1194
|
+
k && T.current && T.current.focus();
|
|
1195
|
+
}, [k]);
|
|
1196
|
+
const W = (I) => {
|
|
1181
1197
|
switch (I.stopPropagation(), I.key) {
|
|
1182
1198
|
case "Enter":
|
|
1183
1199
|
I.preventDefault(), t();
|
|
@@ -1189,14 +1205,14 @@ const ht = ({
|
|
|
1189
1205
|
h && d && (I.preventDefault(), d());
|
|
1190
1206
|
break;
|
|
1191
1207
|
case "ArrowUp":
|
|
1192
|
-
I.preventDefault(), h &&
|
|
1208
|
+
I.preventDefault(), h && f ? f() : s();
|
|
1193
1209
|
break;
|
|
1194
1210
|
case "ArrowDown":
|
|
1195
|
-
I.preventDefault(), h &&
|
|
1211
|
+
I.preventDefault(), h && C ? C() : i();
|
|
1196
1212
|
break;
|
|
1197
1213
|
}
|
|
1198
|
-
},
|
|
1199
|
-
return /* @__PURE__ */
|
|
1214
|
+
}, D = n === "thinking" || n === "executing";
|
|
1215
|
+
return /* @__PURE__ */ y(
|
|
1200
1216
|
"div",
|
|
1201
1217
|
{
|
|
1202
1218
|
style: {
|
|
@@ -1212,14 +1228,14 @@ const ht = ({
|
|
|
1212
1228
|
"span",
|
|
1213
1229
|
{
|
|
1214
1230
|
style: {
|
|
1215
|
-
color: l === "quick-command" ? p.colors.info :
|
|
1231
|
+
color: l === "quick-command" ? p.colors.info : u ? p.colors.primary : p.colors.textMuted,
|
|
1216
1232
|
fontFamily: p.fonts.monospace,
|
|
1217
1233
|
fontSize: p.fontSizes[1],
|
|
1218
1234
|
userSelect: "none",
|
|
1219
1235
|
display: "flex",
|
|
1220
1236
|
alignItems: "center"
|
|
1221
1237
|
},
|
|
1222
|
-
children: l === "quick-command" ? /* @__PURE__ */
|
|
1238
|
+
children: l === "quick-command" ? /* @__PURE__ */ y(
|
|
1223
1239
|
"svg",
|
|
1224
1240
|
{
|
|
1225
1241
|
width: "16",
|
|
@@ -1235,7 +1251,7 @@ const ht = ({
|
|
|
1235
1251
|
/* @__PURE__ */ a("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
1236
1252
|
]
|
|
1237
1253
|
}
|
|
1238
|
-
) :
|
|
1254
|
+
) : u ? /* @__PURE__ */ y(
|
|
1239
1255
|
"svg",
|
|
1240
1256
|
{
|
|
1241
1257
|
width: "16",
|
|
@@ -1260,14 +1276,14 @@ const ht = ({
|
|
|
1260
1276
|
/* @__PURE__ */ a(
|
|
1261
1277
|
"input",
|
|
1262
1278
|
{
|
|
1263
|
-
ref:
|
|
1279
|
+
ref: T,
|
|
1264
1280
|
"data-agent-command-palette-input": !0,
|
|
1265
1281
|
type: "text",
|
|
1266
1282
|
value: o,
|
|
1267
1283
|
onChange: (I) => e(I.target.value),
|
|
1268
|
-
onKeyDown:
|
|
1269
|
-
placeholder:
|
|
1270
|
-
disabled: c ||
|
|
1284
|
+
onKeyDown: W,
|
|
1285
|
+
placeholder: g,
|
|
1286
|
+
disabled: c || D,
|
|
1271
1287
|
style: {
|
|
1272
1288
|
flex: 1,
|
|
1273
1289
|
backgroundColor: "transparent",
|
|
@@ -1280,7 +1296,7 @@ const ht = ({
|
|
|
1280
1296
|
}
|
|
1281
1297
|
}
|
|
1282
1298
|
),
|
|
1283
|
-
|
|
1299
|
+
D && /* @__PURE__ */ y(
|
|
1284
1300
|
"span",
|
|
1285
1301
|
{
|
|
1286
1302
|
style: {
|
|
@@ -1308,7 +1324,7 @@ const ht = ({
|
|
|
1308
1324
|
]
|
|
1309
1325
|
}
|
|
1310
1326
|
),
|
|
1311
|
-
!
|
|
1327
|
+
!D && /* @__PURE__ */ a(
|
|
1312
1328
|
"kbd",
|
|
1313
1329
|
{
|
|
1314
1330
|
style: {
|
|
@@ -1326,9 +1342,9 @@ const ht = ({
|
|
|
1326
1342
|
}
|
|
1327
1343
|
);
|
|
1328
1344
|
};
|
|
1329
|
-
|
|
1345
|
+
ye.displayName = "AgentCommandInput";
|
|
1330
1346
|
const je = ({ status: o }) => {
|
|
1331
|
-
const { theme: e } =
|
|
1347
|
+
const { theme: e } = Y(), t = {
|
|
1332
1348
|
display: "inline-flex",
|
|
1333
1349
|
alignItems: "center",
|
|
1334
1350
|
justifyContent: "center",
|
|
@@ -1360,8 +1376,8 @@ const je = ({ status: o }) => {
|
|
|
1360
1376
|
const e = Object.entries(o);
|
|
1361
1377
|
return e.length === 0 ? "" : e.map(([t, r]) => t === "args" && Array.isArray(r) ? r.join(", ") : typeof r == "string" ? `"${r}"` : JSON.stringify(r)).join(", ");
|
|
1362
1378
|
}, Ne = ({ tool: o, compact: e }) => {
|
|
1363
|
-
const { theme: t } =
|
|
1364
|
-
return /* @__PURE__ */
|
|
1379
|
+
const { theme: t } = Y(), r = qe(o.args);
|
|
1380
|
+
return /* @__PURE__ */ y(
|
|
1365
1381
|
"div",
|
|
1366
1382
|
{
|
|
1367
1383
|
style: {
|
|
@@ -1374,9 +1390,9 @@ const je = ({ status: o }) => {
|
|
|
1374
1390
|
},
|
|
1375
1391
|
children: [
|
|
1376
1392
|
/* @__PURE__ */ a(je, { status: o.status }),
|
|
1377
|
-
/* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ y("span", { style: { color: t.colors.text }, children: [
|
|
1378
1394
|
o.name,
|
|
1379
|
-
r && /* @__PURE__ */
|
|
1395
|
+
r && /* @__PURE__ */ y("span", { style: { color: t.colors.textMuted }, children: [
|
|
1380
1396
|
"(",
|
|
1381
1397
|
r,
|
|
1382
1398
|
")"
|
|
@@ -1423,7 +1439,7 @@ const je = ({ status: o }) => {
|
|
|
1423
1439
|
tools: o,
|
|
1424
1440
|
compact: e = !1
|
|
1425
1441
|
}) => {
|
|
1426
|
-
const { theme: t } =
|
|
1442
|
+
const { theme: t } = Y();
|
|
1427
1443
|
return o.length === 0 ? null : /* @__PURE__ */ a(
|
|
1428
1444
|
"div",
|
|
1429
1445
|
{
|
|
@@ -1442,11 +1458,11 @@ const ke = ({
|
|
|
1442
1458
|
response: o,
|
|
1443
1459
|
streaming: e = !1
|
|
1444
1460
|
}) => {
|
|
1445
|
-
const { theme: t } =
|
|
1461
|
+
const { theme: t } = Y();
|
|
1446
1462
|
if (!o)
|
|
1447
1463
|
return null;
|
|
1448
1464
|
const r = o.toLowerCase().startsWith("error"), s = o.toLowerCase().startsWith("done") || o.toLowerCase().startsWith("executed");
|
|
1449
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ y(
|
|
1450
1466
|
"div",
|
|
1451
1467
|
{
|
|
1452
1468
|
style: {
|
|
@@ -1460,7 +1476,7 @@ const ke = ({
|
|
|
1460
1476
|
children: [
|
|
1461
1477
|
s && /* @__PURE__ */ a("span", { children: "✓" }),
|
|
1462
1478
|
r && /* @__PURE__ */ a("span", { children: "✗" }),
|
|
1463
|
-
/* @__PURE__ */
|
|
1479
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1464
1480
|
o,
|
|
1465
1481
|
e && /* @__PURE__ */ a(
|
|
1466
1482
|
"span",
|
|
@@ -1510,25 +1526,25 @@ const be = ({
|
|
|
1510
1526
|
onSelect: i,
|
|
1511
1527
|
maxVisible: l = 6
|
|
1512
1528
|
}) => {
|
|
1513
|
-
const { theme: n } =
|
|
1529
|
+
const { theme: n } = Y(), g = J(null), c = J(null);
|
|
1514
1530
|
if (R(() => {
|
|
1515
|
-
c.current &&
|
|
1531
|
+
c.current && g.current && c.current.scrollIntoView({
|
|
1516
1532
|
block: "nearest",
|
|
1517
1533
|
behavior: "smooth"
|
|
1518
1534
|
});
|
|
1519
1535
|
}, [s]), r && e.length > 0) {
|
|
1520
|
-
const
|
|
1521
|
-
return /* @__PURE__ */
|
|
1536
|
+
const C = 40 * l;
|
|
1537
|
+
return /* @__PURE__ */ y(
|
|
1522
1538
|
"div",
|
|
1523
1539
|
{
|
|
1524
|
-
ref:
|
|
1540
|
+
ref: g,
|
|
1525
1541
|
style: {
|
|
1526
|
-
maxHeight: `${
|
|
1542
|
+
maxHeight: `${C}px`,
|
|
1527
1543
|
overflowY: "auto",
|
|
1528
1544
|
borderTop: `1px solid ${n.colors.border}`
|
|
1529
1545
|
},
|
|
1530
1546
|
children: [
|
|
1531
|
-
t && /* @__PURE__ */
|
|
1547
|
+
t && /* @__PURE__ */ y(
|
|
1532
1548
|
"div",
|
|
1533
1549
|
{
|
|
1534
1550
|
style: {
|
|
@@ -1540,16 +1556,16 @@ const be = ({
|
|
|
1540
1556
|
},
|
|
1541
1557
|
children: [
|
|
1542
1558
|
/* @__PURE__ */ a("span", { style: { color: n.colors.textSecondary }, children: t.name }),
|
|
1543
|
-
t.description && /* @__PURE__ */
|
|
1559
|
+
t.description && /* @__PURE__ */ y("span", { style: { marginLeft: "8px" }, children: [
|
|
1544
1560
|
"— ",
|
|
1545
1561
|
t.description
|
|
1546
1562
|
] })
|
|
1547
1563
|
]
|
|
1548
1564
|
}
|
|
1549
1565
|
),
|
|
1550
|
-
e.map((
|
|
1566
|
+
e.map((f, d) => {
|
|
1551
1567
|
const p = d === s;
|
|
1552
|
-
return /* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ y(
|
|
1553
1569
|
"div",
|
|
1554
1570
|
{
|
|
1555
1571
|
ref: p ? c : void 0,
|
|
@@ -1564,11 +1580,11 @@ const be = ({
|
|
|
1564
1580
|
borderLeft: p ? `2px solid ${n.colors.primary}` : "2px solid transparent",
|
|
1565
1581
|
transition: "background-color 100ms ease"
|
|
1566
1582
|
},
|
|
1567
|
-
onMouseEnter: (
|
|
1568
|
-
p || (
|
|
1583
|
+
onMouseEnter: (T) => {
|
|
1584
|
+
p || (T.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
|
|
1569
1585
|
},
|
|
1570
|
-
onMouseLeave: (
|
|
1571
|
-
p || (
|
|
1586
|
+
onMouseLeave: (T) => {
|
|
1587
|
+
p || (T.currentTarget.style.backgroundColor = "transparent");
|
|
1572
1588
|
},
|
|
1573
1589
|
children: [
|
|
1574
1590
|
/* @__PURE__ */ a(
|
|
@@ -1583,8 +1599,8 @@ const be = ({
|
|
|
1583
1599
|
children: /* @__PURE__ */ a(
|
|
1584
1600
|
ge,
|
|
1585
1601
|
{
|
|
1586
|
-
text:
|
|
1587
|
-
matchedIndices:
|
|
1602
|
+
text: f.option,
|
|
1603
|
+
matchedIndices: f.matchedIndices,
|
|
1588
1604
|
highlightColor: n.colors.primary
|
|
1589
1605
|
}
|
|
1590
1606
|
)
|
|
@@ -1607,7 +1623,7 @@ const be = ({
|
|
|
1607
1623
|
)
|
|
1608
1624
|
]
|
|
1609
1625
|
},
|
|
1610
|
-
`${
|
|
1626
|
+
`${f.option}-${d}`
|
|
1611
1627
|
);
|
|
1612
1628
|
})
|
|
1613
1629
|
]
|
|
@@ -1616,38 +1632,38 @@ const be = ({
|
|
|
1616
1632
|
}
|
|
1617
1633
|
if (o.length === 0)
|
|
1618
1634
|
return null;
|
|
1619
|
-
const
|
|
1635
|
+
const u = 48 * l;
|
|
1620
1636
|
return /* @__PURE__ */ a(
|
|
1621
1637
|
"div",
|
|
1622
1638
|
{
|
|
1623
|
-
ref:
|
|
1639
|
+
ref: g,
|
|
1624
1640
|
style: {
|
|
1625
|
-
maxHeight: `${
|
|
1641
|
+
maxHeight: `${u}px`,
|
|
1626
1642
|
overflowY: "auto",
|
|
1627
1643
|
borderTop: `1px solid ${n.colors.border}`
|
|
1628
1644
|
},
|
|
1629
|
-
children: o.map((h,
|
|
1630
|
-
const
|
|
1631
|
-
return /* @__PURE__ */
|
|
1645
|
+
children: o.map((h, C) => {
|
|
1646
|
+
const f = C === s, d = h.command;
|
|
1647
|
+
return /* @__PURE__ */ y(
|
|
1632
1648
|
"div",
|
|
1633
1649
|
{
|
|
1634
|
-
ref:
|
|
1635
|
-
onClick: () => i(
|
|
1650
|
+
ref: f ? c : void 0,
|
|
1651
|
+
onClick: () => i(C),
|
|
1636
1652
|
style: {
|
|
1637
1653
|
display: "flex",
|
|
1638
1654
|
alignItems: "center",
|
|
1639
1655
|
gap: "12px",
|
|
1640
1656
|
padding: "10px 16px",
|
|
1641
1657
|
cursor: "pointer",
|
|
1642
|
-
backgroundColor:
|
|
1643
|
-
borderLeft:
|
|
1658
|
+
backgroundColor: f ? n.colors.backgroundSecondary : "transparent",
|
|
1659
|
+
borderLeft: f ? `2px solid ${n.colors.primary}` : "2px solid transparent",
|
|
1644
1660
|
transition: "background-color 100ms ease"
|
|
1645
1661
|
},
|
|
1646
1662
|
onMouseEnter: (p) => {
|
|
1647
|
-
|
|
1663
|
+
f || (p.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
|
|
1648
1664
|
},
|
|
1649
1665
|
onMouseLeave: (p) => {
|
|
1650
|
-
|
|
1666
|
+
f || (p.currentTarget.style.backgroundColor = "transparent");
|
|
1651
1667
|
},
|
|
1652
1668
|
children: [
|
|
1653
1669
|
/* @__PURE__ */ a(
|
|
@@ -1662,8 +1678,8 @@ const be = ({
|
|
|
1662
1678
|
children: "/"
|
|
1663
1679
|
}
|
|
1664
1680
|
),
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ y("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1682
|
+
/* @__PURE__ */ y(
|
|
1667
1683
|
"div",
|
|
1668
1684
|
{
|
|
1669
1685
|
style: {
|
|
@@ -1680,7 +1696,7 @@ const be = ({
|
|
|
1680
1696
|
highlightColor: n.colors.primary
|
|
1681
1697
|
}
|
|
1682
1698
|
),
|
|
1683
|
-
h.matchedOn !== d.name && /* @__PURE__ */
|
|
1699
|
+
h.matchedOn !== d.name && /* @__PURE__ */ y(
|
|
1684
1700
|
"span",
|
|
1685
1701
|
{
|
|
1686
1702
|
style: {
|
|
@@ -1722,8 +1738,8 @@ const be = ({
|
|
|
1722
1738
|
fontFamily: n.fonts.monospace,
|
|
1723
1739
|
flexShrink: 0
|
|
1724
1740
|
},
|
|
1725
|
-
children: d.args.map((p,
|
|
1726
|
-
|
|
1741
|
+
children: d.args.map((p, T) => /* @__PURE__ */ y("span", { children: [
|
|
1742
|
+
T > 0 && " ",
|
|
1727
1743
|
/* @__PURE__ */ a(
|
|
1728
1744
|
"span",
|
|
1729
1745
|
{
|
|
@@ -1736,7 +1752,7 @@ const be = ({
|
|
|
1736
1752
|
] }, p.name))
|
|
1737
1753
|
}
|
|
1738
1754
|
),
|
|
1739
|
-
|
|
1755
|
+
f && /* @__PURE__ */ a(
|
|
1740
1756
|
"kbd",
|
|
1741
1757
|
{
|
|
1742
1758
|
style: {
|
|
@@ -1753,73 +1769,73 @@ const be = ({
|
|
|
1753
1769
|
)
|
|
1754
1770
|
]
|
|
1755
1771
|
},
|
|
1756
|
-
`${d.name}-${
|
|
1772
|
+
`${d.name}-${C}`
|
|
1757
1773
|
);
|
|
1758
1774
|
})
|
|
1759
1775
|
}
|
|
1760
1776
|
);
|
|
1761
1777
|
};
|
|
1762
1778
|
be.displayName = "QuickCommandAutocomplete";
|
|
1763
|
-
const
|
|
1779
|
+
const Fe = ({
|
|
1764
1780
|
palette: o,
|
|
1765
1781
|
config: e
|
|
1766
1782
|
}) => {
|
|
1767
|
-
const { theme: t } =
|
|
1783
|
+
const { theme: t } = Y(), r = J(null), {
|
|
1768
1784
|
isOpen: s,
|
|
1769
1785
|
close: i,
|
|
1770
1786
|
query: l,
|
|
1771
1787
|
setQuery: n,
|
|
1772
|
-
mode:
|
|
1788
|
+
mode: g,
|
|
1773
1789
|
status: c,
|
|
1774
|
-
pendingTools:
|
|
1775
|
-
completedTools:
|
|
1790
|
+
pendingTools: k,
|
|
1791
|
+
completedTools: u,
|
|
1776
1792
|
agentResponse: h,
|
|
1777
|
-
submit:
|
|
1778
|
-
historyPrevious:
|
|
1793
|
+
submit: C,
|
|
1794
|
+
historyPrevious: f,
|
|
1779
1795
|
historyNext: d,
|
|
1780
1796
|
suggestions: p,
|
|
1781
|
-
agentAvailable:
|
|
1797
|
+
agentAvailable: T,
|
|
1782
1798
|
// Autocomplete
|
|
1783
|
-
quickCommandMatches:
|
|
1784
|
-
argumentOptionMatches:
|
|
1799
|
+
quickCommandMatches: W,
|
|
1800
|
+
argumentOptionMatches: D,
|
|
1785
1801
|
parsedQuery: I,
|
|
1786
|
-
currentArgDef:
|
|
1787
|
-
selectedAutocompleteIndex:
|
|
1802
|
+
currentArgDef: _,
|
|
1803
|
+
selectedAutocompleteIndex: S,
|
|
1788
1804
|
autocompleteNext: w,
|
|
1789
1805
|
autocompletePrevious: x,
|
|
1790
|
-
autocompleteAccept:
|
|
1791
|
-
showAutocomplete:
|
|
1806
|
+
autocompleteAccept: A,
|
|
1807
|
+
showAutocomplete: z
|
|
1792
1808
|
} = o;
|
|
1793
1809
|
R(() => {
|
|
1794
1810
|
if (!s) return;
|
|
1795
|
-
const
|
|
1796
|
-
r.current && !r.current.contains(
|
|
1811
|
+
const B = (j) => {
|
|
1812
|
+
r.current && !r.current.contains(j.target) && i();
|
|
1797
1813
|
}, U = setTimeout(() => {
|
|
1798
|
-
document.addEventListener("mousedown",
|
|
1814
|
+
document.addEventListener("mousedown", B);
|
|
1799
1815
|
}, 100);
|
|
1800
1816
|
return () => {
|
|
1801
|
-
clearTimeout(U), document.removeEventListener("mousedown",
|
|
1817
|
+
clearTimeout(U), document.removeEventListener("mousedown", B);
|
|
1802
1818
|
};
|
|
1803
1819
|
}, [s, i]);
|
|
1804
|
-
const [
|
|
1820
|
+
const [$, v] = L(!1), [P, V] = L(!1);
|
|
1805
1821
|
if (R(() => {
|
|
1806
1822
|
if (s)
|
|
1807
|
-
|
|
1823
|
+
V(!0), requestAnimationFrame(() => {
|
|
1808
1824
|
requestAnimationFrame(() => {
|
|
1809
|
-
|
|
1825
|
+
v(!0);
|
|
1810
1826
|
});
|
|
1811
1827
|
});
|
|
1812
1828
|
else {
|
|
1813
|
-
|
|
1814
|
-
const
|
|
1815
|
-
|
|
1829
|
+
v(!1);
|
|
1830
|
+
const B = setTimeout(() => {
|
|
1831
|
+
V(!1);
|
|
1816
1832
|
}, 150);
|
|
1817
|
-
return () => clearTimeout(
|
|
1833
|
+
return () => clearTimeout(B);
|
|
1818
1834
|
}
|
|
1819
|
-
}, [s]), !
|
|
1835
|
+
}, [s]), !P)
|
|
1820
1836
|
return null;
|
|
1821
|
-
const
|
|
1822
|
-
return /* @__PURE__ */
|
|
1837
|
+
const ae = T ? (e == null ? void 0 : e.placeholder) || "What would you like to do?" : "Quick command mode (agent unavailable)", K = [...u, ...k], G = K.length > 0, X = h && c !== "idle", H = T && !l && c === "idle" && p.length > 0, M = (g === "quick-command" || !T) && c === "idle", te = !T && g !== "quick-command" && c === "idle";
|
|
1838
|
+
return /* @__PURE__ */ y(ce, { children: [
|
|
1823
1839
|
/* @__PURE__ */ a(
|
|
1824
1840
|
"div",
|
|
1825
1841
|
{
|
|
@@ -1831,7 +1847,7 @@ const Oe = ({
|
|
|
1831
1847
|
onClick: i
|
|
1832
1848
|
}
|
|
1833
1849
|
),
|
|
1834
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ y(
|
|
1835
1851
|
"div",
|
|
1836
1852
|
{
|
|
1837
1853
|
ref: r,
|
|
@@ -1849,32 +1865,32 @@ const Oe = ({
|
|
|
1849
1865
|
display: "flex",
|
|
1850
1866
|
flexDirection: "column-reverse",
|
|
1851
1867
|
overflow: "hidden",
|
|
1852
|
-
transform:
|
|
1868
|
+
transform: $ ? "translateY(0)" : "translateY(100%)",
|
|
1853
1869
|
transition: "transform 150ms ease-out",
|
|
1854
1870
|
...e == null ? void 0 : e.style
|
|
1855
1871
|
},
|
|
1856
1872
|
children: [
|
|
1857
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ y("div", { children: [
|
|
1858
1874
|
/* @__PURE__ */ a(
|
|
1859
|
-
|
|
1875
|
+
ye,
|
|
1860
1876
|
{
|
|
1861
1877
|
value: l,
|
|
1862
1878
|
onChange: n,
|
|
1863
|
-
onSubmit:
|
|
1879
|
+
onSubmit: C,
|
|
1864
1880
|
onClose: i,
|
|
1865
|
-
onHistoryPrevious:
|
|
1881
|
+
onHistoryPrevious: f,
|
|
1866
1882
|
onHistoryNext: d,
|
|
1867
|
-
mode:
|
|
1883
|
+
mode: g,
|
|
1868
1884
|
status: c,
|
|
1869
|
-
placeholder:
|
|
1870
|
-
agentAvailable:
|
|
1871
|
-
showAutocomplete:
|
|
1885
|
+
placeholder: ae,
|
|
1886
|
+
agentAvailable: T,
|
|
1887
|
+
showAutocomplete: z,
|
|
1872
1888
|
onAutocompleteNext: w,
|
|
1873
1889
|
onAutocompletePrevious: x,
|
|
1874
|
-
onAutocompleteAccept:
|
|
1890
|
+
onAutocompleteAccept: A
|
|
1875
1891
|
}
|
|
1876
1892
|
),
|
|
1877
|
-
/* @__PURE__ */
|
|
1893
|
+
/* @__PURE__ */ y(
|
|
1878
1894
|
"div",
|
|
1879
1895
|
{
|
|
1880
1896
|
style: {
|
|
@@ -1887,7 +1903,7 @@ const Oe = ({
|
|
|
1887
1903
|
backgroundColor: t.colors.background
|
|
1888
1904
|
},
|
|
1889
1905
|
children: [
|
|
1890
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1891
1907
|
/* @__PURE__ */ a(
|
|
1892
1908
|
"kbd",
|
|
1893
1909
|
{
|
|
@@ -1903,7 +1919,7 @@ const Oe = ({
|
|
|
1903
1919
|
" ",
|
|
1904
1920
|
"Execute"
|
|
1905
1921
|
] }),
|
|
1906
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1907
1923
|
/* @__PURE__ */ a(
|
|
1908
1924
|
"kbd",
|
|
1909
1925
|
{
|
|
@@ -1919,7 +1935,7 @@ const Oe = ({
|
|
|
1919
1935
|
" ",
|
|
1920
1936
|
"Close"
|
|
1921
1937
|
] }),
|
|
1922
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ y("span", { children: [
|
|
1923
1939
|
/* @__PURE__ */ a(
|
|
1924
1940
|
"kbd",
|
|
1925
1941
|
{
|
|
@@ -1935,7 +1951,7 @@ const Oe = ({
|
|
|
1935
1951
|
" ",
|
|
1936
1952
|
"History"
|
|
1937
1953
|
] }),
|
|
1938
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ y("span", { style: { marginLeft: "auto" }, children: [
|
|
1939
1955
|
/* @__PURE__ */ a(
|
|
1940
1956
|
"kbd",
|
|
1941
1957
|
{
|
|
@@ -1955,16 +1971,16 @@ const Oe = ({
|
|
|
1955
1971
|
}
|
|
1956
1972
|
)
|
|
1957
1973
|
] }),
|
|
1958
|
-
/* @__PURE__ */
|
|
1959
|
-
|
|
1960
|
-
|
|
1974
|
+
/* @__PURE__ */ y("div", { style: { overflow: "auto" }, children: [
|
|
1975
|
+
G && /* @__PURE__ */ a(xe, { tools: K, compact: K.length > 3 }),
|
|
1976
|
+
X && /* @__PURE__ */ a(
|
|
1961
1977
|
ke,
|
|
1962
1978
|
{
|
|
1963
1979
|
response: h,
|
|
1964
1980
|
streaming: c === "thinking"
|
|
1965
1981
|
}
|
|
1966
1982
|
),
|
|
1967
|
-
|
|
1983
|
+
H && /* @__PURE__ */ y(
|
|
1968
1984
|
"div",
|
|
1969
1985
|
{
|
|
1970
1986
|
style: {
|
|
@@ -1985,11 +2001,11 @@ const Oe = ({
|
|
|
1985
2001
|
children: "Try:"
|
|
1986
2002
|
}
|
|
1987
2003
|
),
|
|
1988
|
-
p.map((
|
|
2004
|
+
p.map((B, U) => /* @__PURE__ */ y(
|
|
1989
2005
|
"button",
|
|
1990
2006
|
{
|
|
1991
2007
|
onClick: () => {
|
|
1992
|
-
n(
|
|
2008
|
+
n(B);
|
|
1993
2009
|
},
|
|
1994
2010
|
style: {
|
|
1995
2011
|
padding: "4px 10px",
|
|
@@ -2001,15 +2017,15 @@ const Oe = ({
|
|
|
2001
2017
|
cursor: "pointer",
|
|
2002
2018
|
transition: "background-color 150ms ease"
|
|
2003
2019
|
},
|
|
2004
|
-
onMouseEnter: (
|
|
2005
|
-
|
|
2020
|
+
onMouseEnter: (j) => {
|
|
2021
|
+
j.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
|
|
2006
2022
|
},
|
|
2007
|
-
onMouseLeave: (
|
|
2008
|
-
|
|
2023
|
+
onMouseLeave: (j) => {
|
|
2024
|
+
j.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
|
|
2009
2025
|
},
|
|
2010
2026
|
children: [
|
|
2011
2027
|
'"',
|
|
2012
|
-
|
|
2028
|
+
B,
|
|
2013
2029
|
'"'
|
|
2014
2030
|
]
|
|
2015
2031
|
},
|
|
@@ -2018,7 +2034,7 @@ const Oe = ({
|
|
|
2018
2034
|
]
|
|
2019
2035
|
}
|
|
2020
2036
|
),
|
|
2021
|
-
|
|
2037
|
+
te && /* @__PURE__ */ y(
|
|
2022
2038
|
"div",
|
|
2023
2039
|
{
|
|
2024
2040
|
style: {
|
|
@@ -2031,7 +2047,7 @@ const Oe = ({
|
|
|
2031
2047
|
},
|
|
2032
2048
|
children: [
|
|
2033
2049
|
/* @__PURE__ */ a("span", { children: "Agent unavailable." }),
|
|
2034
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ y("span", { style: { color: t.colors.textMuted }, children: [
|
|
2035
2051
|
"Use quick commands (start with ",
|
|
2036
2052
|
/* @__PURE__ */ a("kbd", { style: {
|
|
2037
2053
|
padding: "2px 6px",
|
|
@@ -2044,7 +2060,7 @@ const Oe = ({
|
|
|
2044
2060
|
]
|
|
2045
2061
|
}
|
|
2046
2062
|
),
|
|
2047
|
-
|
|
2063
|
+
M && /* @__PURE__ */ y(
|
|
2048
2064
|
"div",
|
|
2049
2065
|
{
|
|
2050
2066
|
style: {
|
|
@@ -2055,27 +2071,27 @@ const Oe = ({
|
|
|
2055
2071
|
},
|
|
2056
2072
|
children: [
|
|
2057
2073
|
/* @__PURE__ */ a("div", { style: { marginBottom: "8px", color: t.colors.textSecondary }, children: "Quick commands:" }),
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2075
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2060
2076
|
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/toggle" }),
|
|
2061
2077
|
" ",
|
|
2062
2078
|
/* @__PURE__ */ a("span", { style: { color: t.colors.textMuted }, children: "<left|right>" }),
|
|
2063
2079
|
" ",
|
|
2064
2080
|
"- Toggle sidebar visibility"
|
|
2065
2081
|
] }),
|
|
2066
|
-
/* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2067
2083
|
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/switch" }),
|
|
2068
2084
|
" ",
|
|
2069
2085
|
/* @__PURE__ */ a("span", { style: { color: t.colors.textMuted }, children: "<slot> <panel>" }),
|
|
2070
2086
|
" ",
|
|
2071
2087
|
"- Switch panel content"
|
|
2072
2088
|
] }),
|
|
2073
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2074
2090
|
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/collapse" }),
|
|
2075
2091
|
" ",
|
|
2076
2092
|
"- Collapse all sidebars"
|
|
2077
2093
|
] }),
|
|
2078
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ y("div", { children: [
|
|
2079
2095
|
/* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/expand" }),
|
|
2080
2096
|
" ",
|
|
2081
2097
|
"- Expand all sidebars"
|
|
@@ -2084,33 +2100,33 @@ const Oe = ({
|
|
|
2084
2100
|
]
|
|
2085
2101
|
}
|
|
2086
2102
|
),
|
|
2087
|
-
|
|
2103
|
+
z && /* @__PURE__ */ a(
|
|
2088
2104
|
be,
|
|
2089
2105
|
{
|
|
2090
|
-
matches:
|
|
2091
|
-
argumentMatches:
|
|
2092
|
-
currentArg:
|
|
2106
|
+
matches: W,
|
|
2107
|
+
argumentMatches: D,
|
|
2108
|
+
currentArg: _,
|
|
2093
2109
|
isEnteringArgs: I.isEnteringArgs,
|
|
2094
|
-
selectedIndex:
|
|
2095
|
-
onSelect: (
|
|
2096
|
-
var
|
|
2110
|
+
selectedIndex: S,
|
|
2111
|
+
onSelect: (B) => {
|
|
2112
|
+
var j;
|
|
2097
2113
|
if (I.isEnteringArgs) {
|
|
2098
|
-
const
|
|
2099
|
-
if (
|
|
2100
|
-
let
|
|
2114
|
+
const Z = D[B];
|
|
2115
|
+
if (Z) {
|
|
2116
|
+
let oe = `/${I.commandName}`;
|
|
2101
2117
|
for (const ie of I.enteredArgs)
|
|
2102
|
-
|
|
2103
|
-
|
|
2118
|
+
oe += ` ${ie}`;
|
|
2119
|
+
oe += ` ${Z.option}`;
|
|
2104
2120
|
const de = I.currentArgIndex + 1;
|
|
2105
|
-
((
|
|
2121
|
+
((j = I.command) == null ? void 0 : j.args) && de < I.command.args.length && (oe += " "), n(oe);
|
|
2106
2122
|
}
|
|
2107
2123
|
return;
|
|
2108
2124
|
}
|
|
2109
|
-
const U =
|
|
2125
|
+
const U = W[B];
|
|
2110
2126
|
if (U) {
|
|
2111
|
-
const
|
|
2112
|
-
let
|
|
2113
|
-
|
|
2127
|
+
const Z = U.command;
|
|
2128
|
+
let oe = `/${Z.name}`;
|
|
2129
|
+
Z.args && Z.args.length > 0 && (oe += " "), n(oe);
|
|
2114
2130
|
}
|
|
2115
2131
|
}
|
|
2116
2132
|
}
|
|
@@ -2135,18 +2151,18 @@ const Oe = ({
|
|
|
2135
2151
|
` })
|
|
2136
2152
|
] });
|
|
2137
2153
|
};
|
|
2138
|
-
|
|
2154
|
+
Fe.displayName = "AgentCommandPalette";
|
|
2139
2155
|
function pe(o, e) {
|
|
2140
2156
|
const t = o.toLowerCase(), r = e.toLowerCase();
|
|
2141
2157
|
if (!t)
|
|
2142
2158
|
return { score: 0, matchedIndices: [] };
|
|
2143
2159
|
const s = [];
|
|
2144
|
-
let i = 0, l = 0, n = 0,
|
|
2160
|
+
let i = 0, l = 0, n = 0, g = -1;
|
|
2145
2161
|
for (let c = 0; c < r.length && i < t.length; c++)
|
|
2146
|
-
r[c] === t[i] && (s.push(c),
|
|
2162
|
+
r[c] === t[i] && (s.push(c), g === c - 1 ? (n++, l += n * 2) : n = 1, c === 0 && (l += 10), c > 0 && /[_\-\s]/.test(e[c - 1]) && (l += 5), l += 1, g = c, i++);
|
|
2147
2163
|
return i < t.length ? null : (l -= e.length * 0.1, t === r && (l += 20), r.startsWith(t) && (l += 15), { score: l, matchedIndices: s });
|
|
2148
2164
|
}
|
|
2149
|
-
function
|
|
2165
|
+
function Oe(o, e, t = 10) {
|
|
2150
2166
|
const r = o.replace(/^\//, "").trim();
|
|
2151
2167
|
if (!r)
|
|
2152
2168
|
return e.slice(0, t).map((i) => ({
|
|
@@ -2169,13 +2185,13 @@ function Fe(o, e, t = 10) {
|
|
|
2169
2185
|
}
|
|
2170
2186
|
if (i.aliases)
|
|
2171
2187
|
for (const n of i.aliases) {
|
|
2172
|
-
const
|
|
2173
|
-
if (
|
|
2188
|
+
const g = pe(r, n);
|
|
2189
|
+
if (g) {
|
|
2174
2190
|
s.push({
|
|
2175
2191
|
command: i,
|
|
2176
|
-
score:
|
|
2192
|
+
score: g.score - 2,
|
|
2177
2193
|
// Slight penalty for alias match
|
|
2178
|
-
matchedIndices:
|
|
2194
|
+
matchedIndices: g.matchedIndices,
|
|
2179
2195
|
matchedOn: n
|
|
2180
2196
|
});
|
|
2181
2197
|
break;
|
|
@@ -2186,9 +2202,9 @@ function Fe(o, e, t = 10) {
|
|
|
2186
2202
|
}
|
|
2187
2203
|
function Ve(o, e) {
|
|
2188
2204
|
const r = o.replace(/^\//, "").split(/\s+/), s = r[0] || "", i = o.endsWith(" ") && o.trim().length > 0, l = e.find(
|
|
2189
|
-
(
|
|
2205
|
+
(g) => {
|
|
2190
2206
|
var c;
|
|
2191
|
-
return
|
|
2207
|
+
return g.name.toLowerCase() === s.toLowerCase() || ((c = g.aliases) == null ? void 0 : c.some((k) => k.toLowerCase() === s.toLowerCase()));
|
|
2192
2208
|
}
|
|
2193
2209
|
) || null;
|
|
2194
2210
|
if (!l)
|
|
@@ -2211,13 +2227,13 @@ function Ve(o, e) {
|
|
|
2211
2227
|
isEnteringArgs: !0
|
|
2212
2228
|
};
|
|
2213
2229
|
if (n.length > 0) {
|
|
2214
|
-
const
|
|
2230
|
+
const g = n.slice(0, -1), c = n[n.length - 1];
|
|
2215
2231
|
return {
|
|
2216
2232
|
commandName: l.name,
|
|
2217
2233
|
command: l,
|
|
2218
|
-
enteredArgs:
|
|
2234
|
+
enteredArgs: g,
|
|
2219
2235
|
currentArgValue: c,
|
|
2220
|
-
currentArgIndex:
|
|
2236
|
+
currentArgIndex: g.length,
|
|
2221
2237
|
isEnteringArgs: !0
|
|
2222
2238
|
};
|
|
2223
2239
|
}
|
|
@@ -2255,7 +2271,7 @@ const Ke = [
|
|
|
2255
2271
|
"show terminal",
|
|
2256
2272
|
"focus editor"
|
|
2257
2273
|
];
|
|
2258
|
-
function
|
|
2274
|
+
function yt({
|
|
2259
2275
|
events: o,
|
|
2260
2276
|
keyboard: e = { key: "p", altKey: !0 },
|
|
2261
2277
|
config: t = {},
|
|
@@ -2264,117 +2280,117 @@ function mt({
|
|
|
2264
2280
|
agentAvailable: i = !0,
|
|
2265
2281
|
quickCommands: l = []
|
|
2266
2282
|
} = {}) {
|
|
2267
|
-
const [n,
|
|
2283
|
+
const [n, g] = L(!1), [c, k] = L(""), [u, h] = L("natural"), [C, f] = L("idle"), [d, p] = L([]), [T, W] = L([]), [D, I] = L(""), [_, S] = L([]), [w, x] = L(-1), A = ne(() => s, [s]), [z, $] = L(-1), v = ne(() => u !== "quick-command" || !l.length ? {
|
|
2268
2284
|
commandName: "",
|
|
2269
2285
|
command: null,
|
|
2270
2286
|
enteredArgs: [],
|
|
2271
2287
|
currentArgValue: "",
|
|
2272
2288
|
currentArgIndex: -1,
|
|
2273
2289
|
isEnteringArgs: !1
|
|
2274
|
-
} : Ve(c, l), [c,
|
|
2290
|
+
} : Ve(c, l), [c, u, l]), P = ne(() => u !== "quick-command" || !l.length || v.isEnteringArgs ? [] : Oe(c, l), [c, u, l, v.isEnteringArgs]), V = ne(() => {
|
|
2275
2291
|
var E;
|
|
2276
|
-
if (!
|
|
2292
|
+
if (!v.isEnteringArgs || !((E = v.command) != null && E.args))
|
|
2277
2293
|
return [];
|
|
2278
|
-
const m =
|
|
2279
|
-
return m != null && m.options ? Be(
|
|
2280
|
-
}, [
|
|
2294
|
+
const m = v.command.args[v.currentArgIndex];
|
|
2295
|
+
return m != null && m.options ? Be(v.currentArgValue, m.options) : [];
|
|
2296
|
+
}, [v]), ae = ne(() => {
|
|
2281
2297
|
var m;
|
|
2282
|
-
return !
|
|
2283
|
-
}, [
|
|
2298
|
+
return !v.isEnteringArgs || !((m = v.command) != null && m.args) ? null : v.command.args[v.currentArgIndex] || null;
|
|
2299
|
+
}, [v]), K = ne(() => u !== "quick-command" || C !== "idle" || c.length === 0 ? !1 : P.length > 0 || V.length > 0, [u, C, c.length, P.length, V.length]), G = ne(() => v.isEnteringArgs ? V.length : P.length, [v.isEnteringArgs, V.length, P.length]);
|
|
2284
2300
|
R(() => {
|
|
2285
|
-
|
|
2286
|
-
}, [
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2289
|
-
}, []),
|
|
2290
|
-
|
|
2301
|
+
$(G > 0 ? 0 : -1);
|
|
2302
|
+
}, [G]);
|
|
2303
|
+
const X = b((m) => {
|
|
2304
|
+
k(m), h(m.startsWith("/") ? "quick-command" : "natural");
|
|
2305
|
+
}, []), H = b(() => {
|
|
2306
|
+
g(!0), i ? (k(""), h("natural")) : (k("/"), h("quick-command")), f("idle"), p([]), W([]), I(""), x(-1), o == null || o.emit({
|
|
2291
2307
|
type: "agent-command-palette:opened",
|
|
2292
2308
|
source: "agent-command-palette",
|
|
2293
2309
|
timestamp: Date.now(),
|
|
2294
2310
|
payload: {}
|
|
2295
2311
|
});
|
|
2296
|
-
}, [o, i]),
|
|
2297
|
-
|
|
2312
|
+
}, [o, i]), M = b(() => {
|
|
2313
|
+
g(!1), o == null || o.emit({
|
|
2298
2314
|
type: "agent-command-palette:closed",
|
|
2299
2315
|
source: "agent-command-palette",
|
|
2300
2316
|
timestamp: Date.now(),
|
|
2301
2317
|
payload: {}
|
|
2302
2318
|
});
|
|
2303
|
-
}, [o]),
|
|
2304
|
-
n ?
|
|
2305
|
-
}, [n,
|
|
2306
|
-
|
|
2307
|
-
}, []), U =
|
|
2319
|
+
}, [o]), te = b(() => {
|
|
2320
|
+
n ? M() : H();
|
|
2321
|
+
}, [n, H, M]), B = b(() => {
|
|
2322
|
+
k(""), h("natural"), f("idle"), p([]), W([]), I(""), x(-1);
|
|
2323
|
+
}, []), U = b((m) => {
|
|
2308
2324
|
const E = {
|
|
2309
2325
|
...m,
|
|
2310
2326
|
status: "pending"
|
|
2311
2327
|
};
|
|
2312
|
-
return p((
|
|
2313
|
-
}, []),
|
|
2314
|
-
(m, E,
|
|
2315
|
-
p((
|
|
2316
|
-
const
|
|
2317
|
-
if (!
|
|
2318
|
-
const
|
|
2319
|
-
...
|
|
2328
|
+
return p((q) => [...q, E]), E;
|
|
2329
|
+
}, []), j = b(
|
|
2330
|
+
(m, E, q, re) => {
|
|
2331
|
+
p((N) => {
|
|
2332
|
+
const F = N.find((ee) => ee.id === m);
|
|
2333
|
+
if (!F) return N;
|
|
2334
|
+
const Q = {
|
|
2335
|
+
...F,
|
|
2320
2336
|
status: E,
|
|
2321
|
-
result:
|
|
2322
|
-
error:
|
|
2337
|
+
result: q,
|
|
2338
|
+
error: re
|
|
2323
2339
|
};
|
|
2324
|
-
return E === "success" || E === "error" ? (
|
|
2340
|
+
return E === "success" || E === "error" ? (W((ee) => [...ee, Q]), N.filter((ee) => ee.id !== m)) : N.map((ee) => ee.id === m ? Q : ee);
|
|
2325
2341
|
});
|
|
2326
2342
|
},
|
|
2327
2343
|
[]
|
|
2328
|
-
),
|
|
2344
|
+
), Z = b(
|
|
2329
2345
|
async (m) => {
|
|
2330
|
-
const E = m.replace(/^\//, "").trim().split(/\s+/),
|
|
2331
|
-
if (!
|
|
2332
|
-
|
|
2333
|
-
const
|
|
2346
|
+
const E = m.replace(/^\//, "").trim().split(/\s+/), q = E[0], re = E.slice(1);
|
|
2347
|
+
if (!q) return;
|
|
2348
|
+
f("executing");
|
|
2349
|
+
const N = `quick-${Date.now()}`;
|
|
2334
2350
|
U({
|
|
2335
|
-
id:
|
|
2336
|
-
name:
|
|
2337
|
-
args: { args:
|
|
2338
|
-
}),
|
|
2351
|
+
id: N,
|
|
2352
|
+
name: q,
|
|
2353
|
+
args: { args: re }
|
|
2354
|
+
}), j(N, "running");
|
|
2339
2355
|
try {
|
|
2340
2356
|
if (r) {
|
|
2341
|
-
const
|
|
2342
|
-
|
|
2357
|
+
const Q = await r(q, { args: re });
|
|
2358
|
+
j(N, "success", String(Q));
|
|
2343
2359
|
} else
|
|
2344
|
-
|
|
2345
|
-
|
|
2360
|
+
j(N, "success", "Tool executed (no handler)");
|
|
2361
|
+
S((Q) => [
|
|
2346
2362
|
{
|
|
2347
2363
|
query: m,
|
|
2348
2364
|
timestamp: Date.now(),
|
|
2349
|
-
toolsExecuted: [
|
|
2365
|
+
toolsExecuted: [q],
|
|
2350
2366
|
success: !0
|
|
2351
2367
|
},
|
|
2352
|
-
...
|
|
2353
|
-
]),
|
|
2354
|
-
const
|
|
2355
|
-
|
|
2356
|
-
} catch (
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2368
|
+
...Q.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2369
|
+
]), f("complete"), I(`Executed: ${q}`);
|
|
2370
|
+
const F = t.autoCloseDelay ?? 1e3;
|
|
2371
|
+
F > 0 && setTimeout(() => M(), F);
|
|
2372
|
+
} catch (F) {
|
|
2373
|
+
const Q = F instanceof Error ? F.message : "Unknown error";
|
|
2374
|
+
j(N, "error", void 0, Q), f("error"), I(`Error: ${Q}`);
|
|
2359
2375
|
}
|
|
2360
2376
|
},
|
|
2361
|
-
[r, U,
|
|
2362
|
-
),
|
|
2377
|
+
[r, U, j, t.autoCloseDelay, t.maxHistoryEntries, M]
|
|
2378
|
+
), oe = b(() => {
|
|
2363
2379
|
if (c.trim()) {
|
|
2364
|
-
if (
|
|
2365
|
-
|
|
2380
|
+
if (u === "quick-command") {
|
|
2381
|
+
Z(c);
|
|
2366
2382
|
return;
|
|
2367
2383
|
}
|
|
2368
2384
|
if (!i) {
|
|
2369
|
-
I("Agent unavailable. Use quick commands (start with /)."),
|
|
2385
|
+
I("Agent unavailable. Use quick commands (start with /)."), f("error");
|
|
2370
2386
|
return;
|
|
2371
2387
|
}
|
|
2372
|
-
|
|
2388
|
+
f("thinking"), o == null || o.emit({
|
|
2373
2389
|
type: "agent-command-palette:submit",
|
|
2374
2390
|
source: "agent-command-palette",
|
|
2375
2391
|
timestamp: Date.now(),
|
|
2376
|
-
payload: { query: c, mode:
|
|
2377
|
-
}),
|
|
2392
|
+
payload: { query: c, mode: u }
|
|
2393
|
+
}), S((m) => [
|
|
2378
2394
|
{
|
|
2379
2395
|
query: c,
|
|
2380
2396
|
timestamp: Date.now(),
|
|
@@ -2384,106 +2400,106 @@ function mt({
|
|
|
2384
2400
|
...m.slice(0, (t.maxHistoryEntries || 50) - 1)
|
|
2385
2401
|
]);
|
|
2386
2402
|
}
|
|
2387
|
-
}, [c,
|
|
2388
|
-
if (
|
|
2389
|
-
const m = w <
|
|
2390
|
-
x(m),
|
|
2391
|
-
}, [
|
|
2403
|
+
}, [c, u, Z, o, t.maxHistoryEntries, i]), de = b(() => {
|
|
2404
|
+
if (_.length === 0) return;
|
|
2405
|
+
const m = w < _.length - 1 ? w + 1 : w;
|
|
2406
|
+
x(m), _[m] && (k(_[m].query), h(_[m].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2407
|
+
}, [_, w]), ue = b(() => {
|
|
2392
2408
|
if (w <= 0) {
|
|
2393
|
-
x(-1),
|
|
2409
|
+
x(-1), k(""), h("natural");
|
|
2394
2410
|
return;
|
|
2395
2411
|
}
|
|
2396
2412
|
const m = w - 1;
|
|
2397
|
-
x(m),
|
|
2398
|
-
}, [
|
|
2413
|
+
x(m), _[m] && (k(_[m].query), h(_[m].query.startsWith("/") ? "quick-command" : "natural"));
|
|
2414
|
+
}, [_, w]), ie = b(
|
|
2399
2415
|
(m) => {
|
|
2400
2416
|
const {
|
|
2401
2417
|
key: E = "p",
|
|
2402
|
-
altKey:
|
|
2403
|
-
ctrlKey:
|
|
2404
|
-
metaKey:
|
|
2405
|
-
shiftKey:
|
|
2406
|
-
} = e,
|
|
2407
|
-
if ((
|
|
2408
|
-
const
|
|
2409
|
-
if (!
|
|
2418
|
+
altKey: q = !0,
|
|
2419
|
+
ctrlKey: re = !1,
|
|
2420
|
+
metaKey: N = !1,
|
|
2421
|
+
shiftKey: F = !1
|
|
2422
|
+
} = e, Q = m.altKey === q && m.ctrlKey === re && m.metaKey === N && m.shiftKey === F;
|
|
2423
|
+
if ((q ? m.code === `Key${E.toUpperCase()}` : m.key.toLowerCase() === E.toLowerCase()) && Q) {
|
|
2424
|
+
const se = m.target;
|
|
2425
|
+
if (!se.closest("[data-agent-command-palette-input]") && (se.tagName === "INPUT" || se.tagName === "TEXTAREA" || se.isContentEditable))
|
|
2410
2426
|
return;
|
|
2411
|
-
m.preventDefault(),
|
|
2427
|
+
m.preventDefault(), te();
|
|
2412
2428
|
}
|
|
2413
2429
|
},
|
|
2414
|
-
[e,
|
|
2430
|
+
[e, te]
|
|
2415
2431
|
);
|
|
2416
2432
|
R(() => (window.addEventListener("keydown", ie), () => window.removeEventListener("keydown", ie)), [ie]);
|
|
2417
|
-
const Pe =
|
|
2418
|
-
|
|
2419
|
-
(m) => m <
|
|
2433
|
+
const Pe = b(() => {
|
|
2434
|
+
K && $(
|
|
2435
|
+
(m) => m < G - 1 ? m + 1 : 0
|
|
2420
2436
|
);
|
|
2421
|
-
}, [
|
|
2422
|
-
|
|
2423
|
-
(m) => m > 0 ? m - 1 :
|
|
2437
|
+
}, [K, G]), Le = b(() => {
|
|
2438
|
+
K && $(
|
|
2439
|
+
(m) => m > 0 ? m - 1 : G - 1
|
|
2424
2440
|
);
|
|
2425
|
-
}, [
|
|
2426
|
-
var
|
|
2427
|
-
if (!
|
|
2428
|
-
if (
|
|
2429
|
-
const
|
|
2430
|
-
if (!
|
|
2431
|
-
let
|
|
2432
|
-
for (const
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
const
|
|
2436
|
-
((
|
|
2441
|
+
}, [K, G]), We = b(() => {
|
|
2442
|
+
var re;
|
|
2443
|
+
if (!K || z < 0) return;
|
|
2444
|
+
if (v.isEnteringArgs) {
|
|
2445
|
+
const N = V[z];
|
|
2446
|
+
if (!N) return;
|
|
2447
|
+
let F = `/${v.commandName}`;
|
|
2448
|
+
for (const se of v.enteredArgs)
|
|
2449
|
+
F += ` ${se}`;
|
|
2450
|
+
F += ` ${N.option}`;
|
|
2451
|
+
const Q = v.currentArgIndex + 1;
|
|
2452
|
+
((re = v.command) == null ? void 0 : re.args) && Q < v.command.args.length && (F += " "), k(F), $(-1);
|
|
2437
2453
|
return;
|
|
2438
2454
|
}
|
|
2439
|
-
const m =
|
|
2455
|
+
const m = P[z];
|
|
2440
2456
|
if (!m) return;
|
|
2441
2457
|
const E = m.command;
|
|
2442
|
-
let
|
|
2443
|
-
E.args && E.args.length > 0 && (
|
|
2444
|
-
}, [
|
|
2458
|
+
let q = `/${E.name}`;
|
|
2459
|
+
E.args && E.args.length > 0 && (q += " "), k(q), $(-1);
|
|
2460
|
+
}, [K, z, v, V, P]);
|
|
2445
2461
|
return {
|
|
2446
2462
|
// Agent availability
|
|
2447
2463
|
agentAvailable: i,
|
|
2448
2464
|
// Visibility
|
|
2449
2465
|
isOpen: n,
|
|
2450
|
-
open:
|
|
2451
|
-
close:
|
|
2452
|
-
toggle:
|
|
2466
|
+
open: H,
|
|
2467
|
+
close: M,
|
|
2468
|
+
toggle: te,
|
|
2453
2469
|
// Input
|
|
2454
2470
|
query: c,
|
|
2455
|
-
setQuery:
|
|
2456
|
-
mode:
|
|
2471
|
+
setQuery: X,
|
|
2472
|
+
mode: u,
|
|
2457
2473
|
// Execution
|
|
2458
|
-
status:
|
|
2459
|
-
setStatus:
|
|
2474
|
+
status: C,
|
|
2475
|
+
setStatus: f,
|
|
2460
2476
|
pendingTools: d,
|
|
2461
|
-
completedTools:
|
|
2462
|
-
agentResponse:
|
|
2477
|
+
completedTools: T,
|
|
2478
|
+
agentResponse: D,
|
|
2463
2479
|
setAgentResponse: I,
|
|
2464
|
-
submit:
|
|
2465
|
-
executeQuickCommand:
|
|
2480
|
+
submit: oe,
|
|
2481
|
+
executeQuickCommand: Z,
|
|
2466
2482
|
// Tool management (for external AI integration)
|
|
2467
2483
|
addPendingTool: U,
|
|
2468
|
-
updateToolStatus:
|
|
2484
|
+
updateToolStatus: j,
|
|
2469
2485
|
// History
|
|
2470
|
-
history:
|
|
2486
|
+
history: _,
|
|
2471
2487
|
historyPrevious: de,
|
|
2472
2488
|
historyNext: ue,
|
|
2473
2489
|
// Suggestions
|
|
2474
|
-
suggestions:
|
|
2490
|
+
suggestions: A,
|
|
2475
2491
|
// Actions
|
|
2476
|
-
clear:
|
|
2492
|
+
clear: B,
|
|
2477
2493
|
// Quick command autocomplete
|
|
2478
|
-
quickCommandMatches:
|
|
2479
|
-
argumentOptionMatches:
|
|
2480
|
-
parsedQuery:
|
|
2481
|
-
currentArgDef:
|
|
2482
|
-
selectedAutocompleteIndex:
|
|
2494
|
+
quickCommandMatches: P,
|
|
2495
|
+
argumentOptionMatches: V,
|
|
2496
|
+
parsedQuery: v,
|
|
2497
|
+
currentArgDef: ae,
|
|
2498
|
+
selectedAutocompleteIndex: z,
|
|
2483
2499
|
autocompleteNext: Pe,
|
|
2484
|
-
autocompletePrevious:
|
|
2485
|
-
autocompleteAccept:
|
|
2486
|
-
showAutocomplete:
|
|
2500
|
+
autocompletePrevious: Le,
|
|
2501
|
+
autocompleteAccept: We,
|
|
2502
|
+
showAutocomplete: K
|
|
2487
2503
|
};
|
|
2488
2504
|
}
|
|
2489
2505
|
const we = {
|
|
@@ -2620,7 +2636,7 @@ const we = {
|
|
|
2620
2636
|
call_template_type: "panel_event",
|
|
2621
2637
|
event_type: "panel:list-state-panels"
|
|
2622
2638
|
}
|
|
2623
|
-
},
|
|
2639
|
+
}, Ce = {
|
|
2624
2640
|
name: "toggle_panel",
|
|
2625
2641
|
description: "Collapse or expand a side panel to give more space to the main content area.",
|
|
2626
2642
|
inputs: {
|
|
@@ -2647,7 +2663,7 @@ const we = {
|
|
|
2647
2663
|
call_template_type: "panel_event",
|
|
2648
2664
|
event_type: "panel:toggle"
|
|
2649
2665
|
}
|
|
2650
|
-
},
|
|
2666
|
+
}, Te = {
|
|
2651
2667
|
name: "collapse_all_panels",
|
|
2652
2668
|
description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
|
|
2653
2669
|
inputs: {
|
|
@@ -2770,8 +2786,8 @@ const we = {
|
|
|
2770
2786
|
Se,
|
|
2771
2787
|
ve,
|
|
2772
2788
|
// Layout action tools
|
|
2773
|
-
Te,
|
|
2774
2789
|
Ce,
|
|
2790
|
+
Te,
|
|
2775
2791
|
Ie,
|
|
2776
2792
|
Ae,
|
|
2777
2793
|
$e,
|
|
@@ -2781,8 +2797,8 @@ const we = {
|
|
|
2781
2797
|
Se,
|
|
2782
2798
|
ve
|
|
2783
2799
|
], kt = [
|
|
2784
|
-
Te,
|
|
2785
2800
|
Ce,
|
|
2801
|
+
Te,
|
|
2786
2802
|
Ie,
|
|
2787
2803
|
Ae,
|
|
2788
2804
|
$e,
|
|
@@ -2842,27 +2858,27 @@ function Ue(o) {
|
|
|
2842
2858
|
function vt(o) {
|
|
2843
2859
|
return o.map(Ue);
|
|
2844
2860
|
}
|
|
2845
|
-
function
|
|
2861
|
+
function Ye(o) {
|
|
2846
2862
|
return {
|
|
2847
2863
|
name: o.name,
|
|
2848
2864
|
description: o.description,
|
|
2849
2865
|
parameters: o.inputs
|
|
2850
2866
|
};
|
|
2851
2867
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return o.map(
|
|
2868
|
+
function Ct(o) {
|
|
2869
|
+
return o.map(Ye);
|
|
2854
2870
|
}
|
|
2855
|
-
function
|
|
2871
|
+
function Tt(o, e = {}) {
|
|
2856
2872
|
const {
|
|
2857
2873
|
header: t = "You have access to the following tools:",
|
|
2858
2874
|
includeParameters: r = !0
|
|
2859
2875
|
} = e, s = o.map((i) => {
|
|
2860
2876
|
let l = `- ${i.name}: ${i.description}`;
|
|
2861
2877
|
if (r && i.inputs.properties) {
|
|
2862
|
-
const n = Object.entries(i.inputs.properties).map(([
|
|
2878
|
+
const n = Object.entries(i.inputs.properties).map(([g, c]) => {
|
|
2863
2879
|
var h;
|
|
2864
|
-
const
|
|
2865
|
-
return ` - ${
|
|
2880
|
+
const k = c, u = (h = i.inputs.required) != null && h.includes(g) ? " (required)" : "";
|
|
2881
|
+
return ` - ${g}: ${k.description || k.type}${u}`;
|
|
2866
2882
|
}).join(`
|
|
2867
2883
|
`);
|
|
2868
2884
|
n && (l += `
|
|
@@ -2876,7 +2892,7 @@ ${s.join(`
|
|
|
2876
2892
|
|
|
2877
2893
|
`)}`;
|
|
2878
2894
|
}
|
|
2879
|
-
const
|
|
2895
|
+
const Ge = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2880
2896
|
"svg",
|
|
2881
2897
|
{
|
|
2882
2898
|
width: o,
|
|
@@ -2892,7 +2908,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
2892
2908
|
/* @__PURE__ */ a("path", { d: "M9 3v18" })
|
|
2893
2909
|
]
|
|
2894
2910
|
}
|
|
2895
|
-
), Xe = ({ size: o = 18 }) => /* @__PURE__ */
|
|
2911
|
+
), Xe = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2896
2912
|
"svg",
|
|
2897
2913
|
{
|
|
2898
2914
|
width: o,
|
|
@@ -2909,7 +2925,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
2909
2925
|
/* @__PURE__ */ a("path", { d: "m16 15-3-3 3-3" })
|
|
2910
2926
|
]
|
|
2911
2927
|
}
|
|
2912
|
-
), Ze = ({ size: o = 18 }) => /* @__PURE__ */
|
|
2928
|
+
), Ze = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2913
2929
|
"svg",
|
|
2914
2930
|
{
|
|
2915
2931
|
width: o,
|
|
@@ -2925,7 +2941,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
2925
2941
|
/* @__PURE__ */ a("path", { d: "M15 3v18" })
|
|
2926
2942
|
]
|
|
2927
2943
|
}
|
|
2928
|
-
), et = ({ size: o = 18 }) => /* @__PURE__ */
|
|
2944
|
+
), et = ({ size: o = 18 }) => /* @__PURE__ */ y(
|
|
2929
2945
|
"svg",
|
|
2930
2946
|
{
|
|
2931
2947
|
width: o,
|
|
@@ -2952,7 +2968,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
2952
2968
|
title: l,
|
|
2953
2969
|
className: n
|
|
2954
2970
|
}) => {
|
|
2955
|
-
const { theme:
|
|
2971
|
+
const { theme: g } = Y(), c = () => t === "right" ? o ? /* @__PURE__ */ a(Ze, { size: r }) : /* @__PURE__ */ a(et, { size: r }) : o ? /* @__PURE__ */ a(Ge, { size: r }) : /* @__PURE__ */ a(Xe, { size: r });
|
|
2956
2972
|
return /* @__PURE__ */ a(
|
|
2957
2973
|
"button",
|
|
2958
2974
|
{
|
|
@@ -2962,7 +2978,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
2962
2978
|
style: {
|
|
2963
2979
|
background: "transparent",
|
|
2964
2980
|
border: "none",
|
|
2965
|
-
color: o ?
|
|
2981
|
+
color: o ? g.colors.textSecondary : g.colors.primary,
|
|
2966
2982
|
cursor: "pointer",
|
|
2967
2983
|
padding: "6px",
|
|
2968
2984
|
borderRadius: "4px",
|
|
@@ -2974,16 +2990,16 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
2974
2990
|
height: "32px",
|
|
2975
2991
|
...s
|
|
2976
2992
|
},
|
|
2977
|
-
onMouseEnter: (
|
|
2978
|
-
|
|
2993
|
+
onMouseEnter: (u) => {
|
|
2994
|
+
u.currentTarget.style.backgroundColor = g.colors.backgroundTertiary, u.currentTarget.style.color = g.colors.primary;
|
|
2979
2995
|
},
|
|
2980
|
-
onMouseLeave: (
|
|
2981
|
-
|
|
2996
|
+
onMouseLeave: (u) => {
|
|
2997
|
+
u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.color = o ? g.colors.textSecondary : g.colors.primary;
|
|
2982
2998
|
},
|
|
2983
2999
|
children: c()
|
|
2984
3000
|
}
|
|
2985
3001
|
);
|
|
2986
|
-
}, tt = ({ size: o = 14 }) => /* @__PURE__ */
|
|
3002
|
+
}, tt = ({ size: o = 14 }) => /* @__PURE__ */ y(
|
|
2987
3003
|
"svg",
|
|
2988
3004
|
{
|
|
2989
3005
|
width: o,
|
|
@@ -3001,7 +3017,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3001
3017
|
/* @__PURE__ */ a("path", { d: "M20 17H4" })
|
|
3002
3018
|
]
|
|
3003
3019
|
}
|
|
3004
|
-
), ot = ({ size: o = 14 }) => /* @__PURE__ */
|
|
3020
|
+
), ot = ({ size: o = 14 }) => /* @__PURE__ */ y(
|
|
3005
3021
|
"svg",
|
|
3006
3022
|
{
|
|
3007
3023
|
width: o,
|
|
@@ -3019,7 +3035,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3019
3035
|
/* @__PURE__ */ a("path", { d: "M4 17h16" })
|
|
3020
3036
|
]
|
|
3021
3037
|
}
|
|
3022
|
-
),
|
|
3038
|
+
), me = ({
|
|
3023
3039
|
onSwitch: o,
|
|
3024
3040
|
variant: e = "left-middle",
|
|
3025
3041
|
iconSize: t = 14,
|
|
@@ -3027,7 +3043,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3027
3043
|
title: s,
|
|
3028
3044
|
className: i
|
|
3029
3045
|
}) => {
|
|
3030
|
-
const { theme: l } =
|
|
3046
|
+
const { theme: l } = Y(), n = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", g = e === "left-middle" ? tt : ot;
|
|
3031
3047
|
return /* @__PURE__ */ a(
|
|
3032
3048
|
"button",
|
|
3033
3049
|
{
|
|
@@ -3055,10 +3071,10 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3055
3071
|
onMouseLeave: (c) => {
|
|
3056
3072
|
c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = l.colors.textSecondary;
|
|
3057
3073
|
},
|
|
3058
|
-
children: /* @__PURE__ */ a(
|
|
3074
|
+
children: /* @__PURE__ */ a(g, { size: t })
|
|
3059
3075
|
}
|
|
3060
3076
|
);
|
|
3061
|
-
}, rt = ({ size: o = 14 }) => /* @__PURE__ */
|
|
3077
|
+
}, rt = ({ size: o = 14 }) => /* @__PURE__ */ y(
|
|
3062
3078
|
"svg",
|
|
3063
3079
|
{
|
|
3064
3080
|
width: o,
|
|
@@ -3082,7 +3098,7 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3082
3098
|
title: r = "Configure panel layout",
|
|
3083
3099
|
className: s
|
|
3084
3100
|
}) => {
|
|
3085
|
-
const { theme: i } =
|
|
3101
|
+
const { theme: i } = Y();
|
|
3086
3102
|
return /* @__PURE__ */ a(
|
|
3087
3103
|
"button",
|
|
3088
3104
|
{
|
|
@@ -3122,28 +3138,28 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3122
3138
|
showRightSidebarControl: i = !1,
|
|
3123
3139
|
onSwitchLeftMiddlePanels: l,
|
|
3124
3140
|
showSwitchLeftMiddle: n = !1,
|
|
3125
|
-
onSwitchRightMiddlePanels:
|
|
3141
|
+
onSwitchRightMiddlePanels: g,
|
|
3126
3142
|
showSwitchRightMiddle: c = !1,
|
|
3127
|
-
onConfigurePanels:
|
|
3128
|
-
showConfigureButton:
|
|
3143
|
+
onConfigurePanels: k,
|
|
3144
|
+
showConfigureButton: u = !1,
|
|
3129
3145
|
gap: h = 4,
|
|
3130
|
-
style:
|
|
3131
|
-
className:
|
|
3146
|
+
style: C,
|
|
3147
|
+
className: f,
|
|
3132
3148
|
iconSize: d,
|
|
3133
3149
|
leftCollapseButtonProps: p,
|
|
3134
|
-
rightCollapseButtonProps:
|
|
3135
|
-
leftMiddleSwitchButtonProps:
|
|
3136
|
-
rightMiddleSwitchButtonProps:
|
|
3150
|
+
rightCollapseButtonProps: T,
|
|
3151
|
+
leftMiddleSwitchButtonProps: W,
|
|
3152
|
+
rightMiddleSwitchButtonProps: D,
|
|
3137
3153
|
configureButtonProps: I
|
|
3138
|
-
}) => t && e || n && l ||
|
|
3154
|
+
}) => t && e || n && l || u && k || c && g || i && s ? /* @__PURE__ */ y(
|
|
3139
3155
|
"div",
|
|
3140
3156
|
{
|
|
3141
|
-
className:
|
|
3157
|
+
className: f,
|
|
3142
3158
|
style: {
|
|
3143
3159
|
display: "flex",
|
|
3144
3160
|
alignItems: "center",
|
|
3145
3161
|
gap: `${h}px`,
|
|
3146
|
-
...
|
|
3162
|
+
...C
|
|
3147
3163
|
},
|
|
3148
3164
|
children: [
|
|
3149
3165
|
t && e && /* @__PURE__ */ a(
|
|
@@ -3157,29 +3173,29 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3157
3173
|
}
|
|
3158
3174
|
),
|
|
3159
3175
|
n && l && /* @__PURE__ */ a(
|
|
3160
|
-
|
|
3176
|
+
me,
|
|
3161
3177
|
{
|
|
3162
3178
|
onSwitch: l,
|
|
3163
3179
|
variant: "left-middle",
|
|
3164
3180
|
iconSize: d ?? 14,
|
|
3165
|
-
|
|
3181
|
+
...W
|
|
3166
3182
|
}
|
|
3167
3183
|
),
|
|
3168
|
-
|
|
3184
|
+
u && k && /* @__PURE__ */ a(
|
|
3169
3185
|
nt,
|
|
3170
3186
|
{
|
|
3171
|
-
onConfigure:
|
|
3187
|
+
onConfigure: k,
|
|
3172
3188
|
iconSize: d ?? 14,
|
|
3173
3189
|
...I
|
|
3174
3190
|
}
|
|
3175
3191
|
),
|
|
3176
|
-
c &&
|
|
3177
|
-
|
|
3192
|
+
c && g && /* @__PURE__ */ a(
|
|
3193
|
+
me,
|
|
3178
3194
|
{
|
|
3179
|
-
onSwitch:
|
|
3195
|
+
onSwitch: g,
|
|
3180
3196
|
variant: "right-middle",
|
|
3181
3197
|
iconSize: d ?? 14,
|
|
3182
|
-
...
|
|
3198
|
+
...D
|
|
3183
3199
|
}
|
|
3184
3200
|
),
|
|
3185
3201
|
i && s && /* @__PURE__ */ a(
|
|
@@ -3189,56 +3205,56 @@ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
|
|
|
3189
3205
|
onToggle: s,
|
|
3190
3206
|
side: "right",
|
|
3191
3207
|
iconSize: d ?? 18,
|
|
3192
|
-
...
|
|
3208
|
+
...T
|
|
3193
3209
|
}
|
|
3194
3210
|
)
|
|
3195
3211
|
]
|
|
3196
3212
|
}
|
|
3197
3213
|
) : null;
|
|
3198
3214
|
export {
|
|
3199
|
-
|
|
3200
|
-
|
|
3215
|
+
ye as AgentCommandInput,
|
|
3216
|
+
Fe as AgentCommandPalette,
|
|
3201
3217
|
ke as AgentResponseDisplay,
|
|
3202
3218
|
zt as EditableConfigurablePanelLayout,
|
|
3203
3219
|
ht as FocusIndicator,
|
|
3204
|
-
|
|
3220
|
+
mt as FocusModeOverlay,
|
|
3205
3221
|
Re as LocalStoragePersistenceAdapter,
|
|
3206
3222
|
De as LocalStorageWorkspaceAdapter,
|
|
3207
3223
|
he as PanelCollapseButton,
|
|
3208
3224
|
nt as PanelConfigureButton,
|
|
3209
3225
|
It as PanelControls,
|
|
3210
|
-
|
|
3226
|
+
me as PanelSwitchButton,
|
|
3211
3227
|
be as QuickCommandAutocomplete,
|
|
3212
3228
|
Pt as ResponsiveConfigurablePanelLayout,
|
|
3213
3229
|
xe as ToolExecutionList,
|
|
3214
|
-
|
|
3215
|
-
|
|
3230
|
+
O as WorkspaceLayoutService,
|
|
3231
|
+
Te as collapseAllPanelsTool,
|
|
3216
3232
|
Ie as expandAllPanelsTool,
|
|
3217
3233
|
$e as focusPanelTool,
|
|
3218
3234
|
pe as fuzzyMatch,
|
|
3219
|
-
|
|
3235
|
+
Tt as generateToolsSystemPrompt,
|
|
3220
3236
|
Se as getPanelStateTool,
|
|
3221
3237
|
we as getVisiblePanelsTool,
|
|
3222
3238
|
kt as layoutActionTools,
|
|
3223
3239
|
He as layoutTools,
|
|
3224
3240
|
bt as layoutToolsMetadata,
|
|
3225
3241
|
ve as listPanelsWithStateTool,
|
|
3226
|
-
|
|
3227
|
-
|
|
3242
|
+
Lt as mapThemeToPanelVars,
|
|
3243
|
+
Wt as mapThemeToTabVars,
|
|
3228
3244
|
ze as resetLayoutTool,
|
|
3229
|
-
|
|
3245
|
+
Oe as searchQuickCommands,
|
|
3230
3246
|
xt as stateQueryTools,
|
|
3231
3247
|
Ae as switchPanelTool,
|
|
3232
|
-
|
|
3233
|
-
|
|
3248
|
+
Ce as togglePanelTool,
|
|
3249
|
+
Ye as toolToAIFunction,
|
|
3234
3250
|
Ue as toolToAnthropicFormat,
|
|
3235
3251
|
Qe as toolToGeminiFunction,
|
|
3236
3252
|
Je as toolToOpenAIFunction,
|
|
3237
|
-
|
|
3253
|
+
Ct as toolsToAIFunctions,
|
|
3238
3254
|
vt as toolsToAnthropicFormat,
|
|
3239
3255
|
wt as toolsToGeminiFormat,
|
|
3240
3256
|
St as toolsToOpenAIFormat,
|
|
3241
|
-
|
|
3257
|
+
yt as useAgentCommandPalette,
|
|
3242
3258
|
ut as usePanelFocus,
|
|
3243
3259
|
gt as usePanelFocusListener,
|
|
3244
3260
|
ft as usePanelKeyboardShortcuts,
|