@principal-ade/panel-layouts 0.2.8 → 0.2.9

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