@principal-ade/panel-layouts 0.3.4 → 0.3.5

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