@principal-ade/panel-layouts 0.3.0 → 0.3.2

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