@principal-ade/panel-layouts 0.2.9 → 0.3.0

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