@principal-ade/panel-layouts 0.3.4 → 0.3.6

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 Le = Object.defineProperty;
2
+ var Ee = (o, e, t) => e in o ? Le(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { EditableConfigurablePanelLayout as zt, ResponsiveConfigurablePanelLayout as Pt, mapThemeToPanelVars as Wt, mapThemeToTabVars as _t } from "@principal-ade/panels";
5
+ import { useState as _, useRef as H, useEffect as R, useCallback as S, useMemo as oe } from "react";
6
+ import { jsx as a, jsxs as k, Fragment as ce } from "react/jsx-runtime";
7
+ import { useTheme as Q } from "@principal-ade/industry-theme";
8
+ class Re {
9
9
  constructor() {
10
- Y(this, "storageKey", "panel-layouts");
10
+ le(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 dt(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, l] = _(t), [n, f] = _(o.collapsed), c = H(o.collapsed), y = H({}), g = H(null), h = H(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 w = await s.load(e);
41
+ w != null && w.sizes && (l(w.sizes), v(w.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 v = S(
45
+ (b) => {
46
+ "left" in b && b.left > 0 && (y.current.left = b.left), "middle" in b && b.middle > 0 && (y.current.middle = b.middle), "right" in b && b.right > 0 && (y.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 = S(
50
+ (b) => {
51
+ const w = y.current[b];
52
+ if (w && w > 0)
53
+ return w;
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 = H(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) && (l(t), v(t), d.current = t);
63
+ }, [t, v]), R(() => {
64
+ const b = o.collapsed.left !== c.current.left, w = "right" in o.collapsed && "right" in c.current && o.collapsed.right !== c.current.right;
65
+ (b || w) && (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 = S(
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 (w) {
72
72
  console.error(
73
73
  `Failed to save panel preferences for ${e}:`,
74
- v
74
+ w
75
75
  );
76
76
  }
77
77
  },
78
- [e, n]
79
- ), C = k(
80
- (w) => {
81
- const v = { ...w };
82
- let S = !0;
83
- if ("left" in w) {
84
- const T = !!(c != null && c.left), W = w.left;
78
+ [e, s]
79
+ ), C = S(
80
+ (b) => {
81
+ const w = { ...b };
82
+ let x = !0;
83
+ if ("left" in b) {
84
+ const T = !!(n != null && n.left), P = b.left;
85
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);
86
+ const W = u("left");
87
+ W !== void 0 && W > 0 ? w.left = W : x = !1;
88
+ } else P === 0 && (x = !1);
89
89
  }
90
- if (r === "three-panel" && "right" in w) {
91
- const T = !!(c != null && c.right), W = w.right;
90
+ if (r === "three-panel" && "right" in b) {
91
+ const T = !!(n != null && n.right), P = b.right;
92
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);
93
+ const W = u("right");
94
+ W !== void 0 && W > 0 ? w.right = W : x = !1;
95
+ } else P === 0 && (x = !1);
96
96
  }
97
- if (i(v), x(v), p.current && (clearTimeout(p.current), p.current = null), !S) {
98
- f.current = null;
97
+ if (l(w), v(w), g.current && (clearTimeout(g.current), g.current = null), !x) {
98
+ h.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
+ h.current = w, g.current = setTimeout(() => {
102
+ const T = h.current;
103
+ T && (p(T), h.current = null), g.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
+ v
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 (g.current) {
116
+ const b = h.current;
117
+ b && (p(b), h.current = null), clearTimeout(g.current), g.current = null;
118
118
  }
119
- }, [u]);
120
- const L = k(async () => {
121
- }, []), $ = k(async () => {
122
- }, []), I = k(async () => {
123
- }, []), _ = k(async () => {
119
+ }, [p]);
120
+ const $ = S(async () => {
121
+ }, []), z = S(async () => {
122
+ }, []), I = S(async () => {
123
+ }, []), L = S(async () => {
124
124
  }, []);
125
125
  return r === "three-panel" ? {
126
126
  type: "three-panel",
127
- sizes: a,
128
- collapsed: c,
127
+ sizes: i,
128
+ collapsed: n,
129
129
  handlePanelResize: C,
130
- handleLeftCollapseComplete: L,
131
- handleLeftExpandComplete: $,
130
+ handleLeftCollapseComplete: $,
131
+ handleLeftExpandComplete: z,
132
132
  handleRightCollapseComplete: I,
133
- handleRightExpandComplete: _
133
+ handleRightExpandComplete: L
134
134
  } : {
135
135
  type: "two-panel",
136
- sizes: a,
137
- collapsed: c,
136
+ sizes: i,
137
+ collapsed: n,
138
138
  handlePanelResize: C,
139
- handleLeftCollapseComplete: L,
140
- handleLeftExpandComplete: $
139
+ handleLeftCollapseComplete: $,
140
+ handleLeftExpandComplete: z
141
141
  };
142
142
  }
143
- class Le {
143
+ class De {
144
144
  constructor() {
145
- Y(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
146
- Y(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
145
+ le(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
146
+ le(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 (l) {
211
211
  console.error(
212
- `Failed to parse repository state for ${n}:`,
213
- i
212
+ `Failed to parse repository state for ${s}:`,
213
+ l
214
214
  );
215
215
  }
216
216
  }
@@ -221,7 +221,7 @@ class Le {
221
221
  }
222
222
  }
223
223
  }
224
- class D {
224
+ class N {
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
+ }, l = {
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(l), 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,173 +610,173 @@ 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
+ le(N, "adapter", new De());
614
+ function pt(o = {}) {
615
+ const { repositoryKey: e, autoInitialize: t = !1, defaultWorkspaceId: r } = o, [s, i] = _(
616
616
  {}
617
- ), [i, c] = P(null), [y, l] = P(null), [b, p] = P(!0), [f, x] = P(null), h = k(async () => {
617
+ ), [l, n] = _(null), [f, c] = _(null), [y, g] = _(!0), [h, v] = _(null), u = S(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);
619
+ g(!0), v(null);
620
+ const x = await N.getWorkspaceLayouts();
621
+ if (i(x), e) {
622
+ let T = await N.getRepositoryState(e);
623
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 || {
624
+ const P = r || "project-management", W = await N.getWorkspaceLayout(P);
625
+ W && (T = {
626
+ workspaceId: P,
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 N.setRepositoryState(
637
637
  e,
638
638
  T
639
639
  ));
640
640
  }
641
- if (c(T), T != null && T.workspaceId) {
642
- const W = await D.getWorkspaceLayout(
641
+ if (n(T), T != null && T.workspaceId) {
642
+ const P = await N.getWorkspaceLayout(
643
643
  T.workspaceId
644
644
  );
645
- l(W);
645
+ c(P);
646
646
  } else
647
- l(null);
647
+ c(null);
648
648
  }
649
- } catch (S) {
650
- x(S), console.error("Failed to load workspace data:", S);
649
+ } catch (x) {
650
+ v(x), console.error("Failed to load workspace data:", x);
651
651
  } finally {
652
- p(!1);
652
+ g(!1);
653
653
  }
654
654
  }, [e, t, r]);
655
655
  R(() => {
656
- h();
657
- }, [h]);
658
- const d = k(
659
- async (S) => await D.getWorkspaceLayout(S),
656
+ u();
657
+ }, [u]);
658
+ const d = S(
659
+ async (x) => await N.getWorkspaceLayout(x),
660
660
  []
661
- ), u = k(
662
- async (S) => {
663
- const T = await D.createWorkspaceLayout(S);
664
- return await h(), T;
661
+ ), p = S(
662
+ async (x) => {
663
+ const T = await N.createWorkspaceLayout(x);
664
+ return await u(), T;
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
+ ), C = S(
668
+ async (x, T) => {
669
+ const P = await N.updateWorkspaceLayout(x, T);
670
+ return await u(), P;
671
671
  },
672
- [h]
673
- ), L = k(
674
- async (S) => {
675
- const T = await D.deleteWorkspaceLayout(S);
676
- return T && await h(), T;
672
+ [u]
673
+ ), $ = S(
674
+ async (x) => {
675
+ const T = await N.deleteWorkspaceLayout(x);
676
+ return T && await u(), T;
677
677
  },
678
- [h]
679
- ), $ = k(
680
- async (S) => {
678
+ [u]
679
+ ), z = S(
680
+ async (x) => {
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);
685
+ const T = await N.getWorkspaceLayout(x);
686
686
  if (!T) {
687
- console.error(`Workspace ${S} not found`);
687
+ console.error(`Workspace ${x} not found`);
688
688
  return;
689
689
  }
690
- const W = {
691
- workspaceId: S,
690
+ const P = {
691
+ workspaceId: x,
692
692
  sizes: T.defaultSizes || { left: 20, middle: 45, right: 35 },
693
693
  collapsed: T.defaultCollapsed || {
694
694
  left: !1,
695
695
  right: !1
696
696
  }
697
697
  };
698
- await D.setRepositoryState(e, W), await h();
698
+ await N.setRepositoryState(e, P), await u();
699
699
  },
700
- [e, h]
701
- ), I = k(
702
- async (S) => {
700
+ [e, u]
701
+ ), I = S(
702
+ async (x) => {
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 N.updateRepositorySizes(e, x), await u();
708
708
  },
709
- [e, h]
710
- ), _ = k(
711
- async (S) => {
709
+ [e, u]
710
+ ), L = S(
711
+ async (x) => {
712
712
  if (!e) {
713
713
  console.error("Cannot update collapsed without repositoryKey");
714
714
  return;
715
715
  }
716
- await D.updateRepositoryCollapsed(
716
+ await N.updateRepositoryCollapsed(
717
717
  e,
718
- S
719
- ), await h();
718
+ x
719
+ ), await u();
720
720
  },
721
- [e, h]
722
- ), w = k(async () => {
723
- if (!e || !(i != null && i.workspaceId)) {
721
+ [e, u]
722
+ ), b = S(async () => {
723
+ if (!e || !(l != null && l.workspaceId)) {
724
724
  console.error("Cannot reset without repositoryKey and active workspace");
725
725
  return;
726
726
  }
727
- await D.resetRepositoryToWorkspaceDefaults(
727
+ await N.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
+ l.workspaceId
730
+ ), await u();
731
+ }, [e, l == null ? void 0 : l.workspaceId, u]), w = S(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: l,
737
+ activeWorkspace: f,
738
+ loading: y,
739
+ error: h,
740
740
  getWorkspace: d,
741
- createWorkspace: u,
741
+ createWorkspace: p,
742
742
  updateWorkspace: C,
743
- deleteWorkspace: L,
744
- applyWorkspace: $,
743
+ deleteWorkspace: $,
744
+ applyWorkspace: z,
745
745
  updateSizes: I,
746
- updateCollapsed: _,
747
- resetToDefaults: w,
748
- refresh: v
746
+ updateCollapsed: L,
747
+ resetToDefaults: b,
748
+ refresh: w
749
749
  };
750
750
  }
751
- function nt(o = {}) {
751
+ function ut(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: l
759
+ } = o, [n, f] = _(
760
760
  e
761
- ), l = k(
761
+ ), c = S(
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 && l) {
765
+ if (p) {
766
+ const $ = l(p);
767
+ $ && 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: $,
773
+ panelSlot: p,
774
+ nextPanelId: l(d)
775
775
  }
776
776
  });
777
777
  }
778
- const C = i(d);
779
- C && a.emit({
778
+ const C = l(d);
779
+ C && i.emit({
780
780
  type: "panel:focus",
781
781
  source: "panel-layouts",
782
782
  timestamp: Date.now(),
@@ -788,118 +788,118 @@ function nt(o = {}) {
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, l]
792
+ ), y = S(() => {
793
+ const d = n;
794
+ if (f(null), s == null || s(null), i && l && d) {
795
+ const p = l(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, l]), g = S(() => {
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]), h = S(() => {
810
+ const d = g();
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 C = (p + 1) % d.length;
822
+ c(d[C]);
823
+ }, [n, g, c]), v = S(() => {
824
+ const d = g();
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 C = p === 0 ? d.length - 1 : p - 1;
836
+ c(d[C]);
837
+ }, [n, g, c]), u = S(
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: y,
845
+ focusNext: h,
846
+ focusPrevious: v,
847
+ isFocused: u
848
848
  };
849
849
  }
850
- function st(o) {
850
+ function ft(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: l,
858
+ onCollapse: n
859
+ } = o, f = H(t), c = H(r), y = H(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
+ y.current = s;
866
+ }, [s]);
867
+ const g = S(
868
+ (h) => {
869
+ if (!h.altKey || h.ctrlKey || h.metaKey || h.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 v = h.code, u = f.current, d = c.current, p = y.current;
872
+ v === "Digit1" || v === "Numpad1" ? (h.preventDefault(), d.left ? l("left") : u !== "left" ? i("left") : (n("left"), i("middle"))) : v === "Digit2" || v === "Numpad2" ? (h.preventDefault(), i("middle")) : (v === "Digit3" || v === "Numpad3") && p === "three-panel" && (h.preventDefault(), d.right ? l("right") : u !== "right" ? i("right") : (n("right"), i("middle")));
873
873
  },
874
- [a, i, c]
874
+ [i, l, 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", g), () => {
879
+ window.removeEventListener("keydown", g);
880
880
  };
881
- }, [e, p]);
881
+ }, [e, g]);
882
882
  }
883
- function at(o, e, t, r) {
883
+ function gt(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
+ (l) => {
888
+ l.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
+ (l) => {
895
+ l.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 ht = ({
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__ */ a(
924
924
  "div",
925
925
  {
926
926
  className: `panel-focus-indicator ${e}`,
@@ -929,29 +929,255 @@ const it = ({
929
929
  "aria-hidden": "true"
930
930
  }
931
931
  );
932
- }, ce = ({
932
+ }, fe = "focus-mode-overlay-keyframes", Me = () => {
933
+ if (typeof document > "u" || document.getElementById(fe)) return;
934
+ const o = document.createElement("style");
935
+ o.id = fe, o.textContent = `
936
+ @keyframes focus-overlay-vignette-drift {
937
+ 0%, 100% {
938
+ background-position: 50% 50%;
939
+ transform: scale(1);
940
+ }
941
+ 25% {
942
+ background-position: 20% 30%;
943
+ transform: scale(1.1);
944
+ }
945
+ 50% {
946
+ background-position: 80% 70%;
947
+ transform: scale(1.05);
948
+ }
949
+ 75% {
950
+ background-position: 70% 20%;
951
+ transform: scale(1.15);
952
+ }
953
+ }
954
+
955
+ @keyframes focus-overlay-radial-breathing {
956
+ 0%, 100% {
957
+ opacity: 1;
958
+ transform: scale(1);
959
+ }
960
+ 50% {
961
+ opacity: 0.4;
962
+ transform: scale(1.3);
963
+ }
964
+ }
965
+
966
+ @keyframes focus-overlay-snowfall-1 {
967
+ from { background-position: 0px 0px; }
968
+ to { background-position: 0px 150px; }
969
+ }
970
+ @keyframes focus-overlay-snowfall-2 {
971
+ from { background-position: 0px 0px; }
972
+ to { background-position: 0px 150px; }
973
+ }
974
+ @keyframes focus-overlay-snowfall-3 {
975
+ from { background-position: 0px 0px; }
976
+ to { background-position: 0px 150px; }
977
+ }
978
+
979
+ `, document.head.appendChild(o);
980
+ }, yt = ({
981
+ active: o,
982
+ variant: e = "soft-fade",
983
+ effects: t = [],
984
+ opacity: r = 0.95,
985
+ animationDuration: s = 300,
986
+ cascadeDelay: i = 0,
987
+ color: l,
988
+ className: n = "",
989
+ style: f = {}
990
+ }) => {
991
+ const { theme: c } = Q(), [y, g] = _(!1);
992
+ R(() => {
993
+ Me();
994
+ }, []), R(() => {
995
+ if (o) {
996
+ const O = setTimeout(() => g(!0), i);
997
+ return () => clearTimeout(O);
998
+ } else
999
+ g(!1);
1000
+ }, [o, i]);
1001
+ const h = l || c.colors.background, u = {
1002
+ position: "absolute",
1003
+ top: 0,
1004
+ left: 0,
1005
+ right: 0,
1006
+ bottom: 0,
1007
+ pointerEvents: "none",
1008
+ zIndex: 999,
1009
+ overflow: "hidden",
1010
+ ...(() => {
1011
+ switch (e) {
1012
+ case "soft-fade":
1013
+ return {
1014
+ backgroundColor: h,
1015
+ opacity: y ? r : 0,
1016
+ transition: `opacity ${s}ms ease-out`
1017
+ };
1018
+ case "cascading-fade":
1019
+ return {
1020
+ backgroundColor: h,
1021
+ opacity: y ? r : 0,
1022
+ transition: `opacity ${s}ms ease-out`,
1023
+ transitionDelay: y ? "0ms" : `${i}ms`
1024
+ };
1025
+ default:
1026
+ return {
1027
+ backgroundColor: h,
1028
+ opacity: y ? r : 0,
1029
+ transition: `opacity ${s}ms ease-out`
1030
+ };
1031
+ }
1032
+ })(),
1033
+ ...f
1034
+ }, d = t.includes("vignette-drift"), p = t.includes("radial-breathing"), C = t.includes("snowfall"), $ = (O, F) => {
1035
+ const ee = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(O);
1036
+ if (!ee) return `rgba(255, 255, 255, ${F})`;
1037
+ const V = parseInt(ee[1], 16), J = parseInt(ee[2], 16), ne = parseInt(ee[3], 16);
1038
+ return `rgba(${V}, ${J}, ${ne}, ${F})`;
1039
+ }, z = c.colors.primary, I = {
1040
+ position: "absolute",
1041
+ top: 0,
1042
+ left: 0,
1043
+ right: 0,
1044
+ bottom: 0,
1045
+ pointerEvents: "none",
1046
+ opacity: y ? 1 : 0,
1047
+ transition: `opacity ${s}ms ease-out`,
1048
+ background: `radial-gradient(circle at 50% 50%, ${$(z, 0.12)} 0%, ${$(z, 0.06)} 25%, transparent 50%)`,
1049
+ backgroundSize: "150% 150%",
1050
+ animation: y ? "focus-overlay-vignette-drift 12s ease-in-out infinite" : "none"
1051
+ }, L = {
1052
+ position: "absolute",
1053
+ top: 0,
1054
+ left: 0,
1055
+ right: 0,
1056
+ bottom: 0,
1057
+ pointerEvents: "none",
1058
+ opacity: y ? 1 : 0,
1059
+ transition: `opacity ${s}ms ease-out`,
1060
+ background: `radial-gradient(circle at center, ${$(z, 0.15)} 0%, ${$(z, 0.06)} 30%, transparent 55%)`,
1061
+ animation: y ? "focus-overlay-radial-breathing 4s ease-in-out infinite" : "none"
1062
+ }, b = $(z, 0.6), w = $(z, 0.4), x = $(z, 0.25), T = {
1063
+ position: "absolute",
1064
+ top: 0,
1065
+ left: 0,
1066
+ right: 0,
1067
+ bottom: 0,
1068
+ pointerEvents: "none",
1069
+ opacity: y ? 1 : 0,
1070
+ transition: `opacity ${s}ms ease-out`
1071
+ }, P = {
1072
+ ...T,
1073
+ background: `
1074
+ radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px),
1075
+ radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px),
1076
+ radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px),
1077
+ radial-gradient(circle, ${b} 0%, ${b} 3px, transparent 3px)
1078
+ `,
1079
+ backgroundSize: "150px 150px",
1080
+ backgroundPosition: "10px 20px, 60px 80px, 110px 40px, 40px 120px",
1081
+ animation: y ? "focus-overlay-snowfall-1 4s linear infinite" : "none"
1082
+ }, W = {
1083
+ ...T,
1084
+ background: `
1085
+ radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
1086
+ radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
1087
+ radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
1088
+ radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px),
1089
+ radial-gradient(circle, ${w} 0%, ${w} 2px, transparent 2px)
1090
+ `,
1091
+ backgroundSize: "150px 150px",
1092
+ backgroundPosition: "30px 10px, 90px 60px, 15px 100px, 120px 30px, 70px 130px",
1093
+ animation: y ? "focus-overlay-snowfall-2 7s linear infinite" : "none"
1094
+ }, A = {
1095
+ ...T,
1096
+ background: `
1097
+ radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
1098
+ radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
1099
+ radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
1100
+ radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
1101
+ radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px),
1102
+ radial-gradient(circle, ${x} 0%, ${x} 1.5px, transparent 1.5px)
1103
+ `,
1104
+ backgroundSize: "150px 150px",
1105
+ backgroundPosition: "20px 5px, 80px 45px, 45px 90px, 130px 20px, 5px 70px, 100px 110px",
1106
+ animation: y ? "focus-overlay-snowfall-3 12s linear infinite" : "none"
1107
+ };
1108
+ return /* @__PURE__ */ k(
1109
+ "div",
1110
+ {
1111
+ className: `focus-mode-overlay focus-mode-overlay--${e} ${n}`,
1112
+ style: u,
1113
+ role: "presentation",
1114
+ "aria-hidden": "true",
1115
+ "data-active": o,
1116
+ "data-variant": e,
1117
+ children: [
1118
+ d && /* @__PURE__ */ a(
1119
+ "div",
1120
+ {
1121
+ className: "focus-mode-overlay__vignette-drift",
1122
+ style: I
1123
+ }
1124
+ ),
1125
+ p && /* @__PURE__ */ a(
1126
+ "div",
1127
+ {
1128
+ className: "focus-mode-overlay__radial-breathing",
1129
+ style: L
1130
+ }
1131
+ ),
1132
+ C && /* @__PURE__ */ k(ce, { children: [
1133
+ /* @__PURE__ */ a(
1134
+ "div",
1135
+ {
1136
+ className: "focus-mode-overlay__snowfall-layer-3",
1137
+ style: A
1138
+ }
1139
+ ),
1140
+ /* @__PURE__ */ a(
1141
+ "div",
1142
+ {
1143
+ className: "focus-mode-overlay__snowfall-layer-2",
1144
+ style: W
1145
+ }
1146
+ ),
1147
+ /* @__PURE__ */ a(
1148
+ "div",
1149
+ {
1150
+ className: "focus-mode-overlay__snowfall-layer-1",
1151
+ style: P
1152
+ }
1153
+ )
1154
+ ] })
1155
+ ]
1156
+ }
1157
+ );
1158
+ }, me = ({
933
1159
  value: o,
934
1160
  onChange: e,
935
1161
  onSubmit: t,
936
1162
  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,
1163
+ onHistoryPrevious: s,
1164
+ onHistoryNext: i,
1165
+ mode: l,
1166
+ status: n,
1167
+ placeholder: f = "What would you like to do?",
1168
+ disabled: c = !1,
1169
+ autoFocus: y = !0,
1170
+ agentAvailable: g = !0,
1171
+ showAutocomplete: h = !1,
1172
+ onAutocompleteNext: v,
1173
+ onAutocompletePrevious: u,
948
1174
  onAutocompleteAccept: d
949
1175
  }) => {
950
- const { theme: u } = H(), C = N(null);
1176
+ const { theme: p } = Q(), C = H(null);
951
1177
  R(() => {
952
- b && C.current && C.current.focus();
953
- }, [b]);
954
- const L = (I) => {
1178
+ y && C.current && C.current.focus();
1179
+ }, [y]);
1180
+ const $ = (I) => {
955
1181
  switch (I.stopPropagation(), I.key) {
956
1182
  case "Enter":
957
1183
  I.preventDefault(), t();
@@ -960,17 +1186,17 @@ const it = ({
960
1186
  I.preventDefault(), r();
961
1187
  break;
962
1188
  case "Tab":
963
- f && d && (I.preventDefault(), d());
1189
+ h && d && (I.preventDefault(), d());
964
1190
  break;
965
1191
  case "ArrowUp":
966
- I.preventDefault(), f && h ? h() : n();
1192
+ I.preventDefault(), h && u ? u() : s();
967
1193
  break;
968
1194
  case "ArrowDown":
969
- I.preventDefault(), f && x ? x() : a();
1195
+ I.preventDefault(), h && v ? v() : i();
970
1196
  break;
971
1197
  }
972
- }, $ = c === "thinking" || c === "executing";
973
- return /* @__PURE__ */ m(
1198
+ }, z = n === "thinking" || n === "executing";
1199
+ return /* @__PURE__ */ k(
974
1200
  "div",
975
1201
  {
976
1202
  style: {
@@ -978,22 +1204,22 @@ const it = ({
978
1204
  alignItems: "center",
979
1205
  gap: "8px",
980
1206
  padding: "12px 16px",
981
- backgroundColor: u.colors.background,
982
- borderBottom: `1px solid ${u.colors.border}`
1207
+ backgroundColor: p.colors.background,
1208
+ borderBottom: `1px solid ${p.colors.border}`
983
1209
  },
984
1210
  children: [
985
- /* @__PURE__ */ s(
1211
+ /* @__PURE__ */ a(
986
1212
  "span",
987
1213
  {
988
1214
  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],
1215
+ color: l === "quick-command" ? p.colors.info : g ? p.colors.primary : p.colors.textMuted,
1216
+ fontFamily: p.fonts.monospace,
1217
+ fontSize: p.fontSizes[1],
992
1218
  userSelect: "none",
993
1219
  display: "flex",
994
1220
  alignItems: "center"
995
1221
  },
996
- children: i === "quick-command" ? /* @__PURE__ */ m(
1222
+ children: l === "quick-command" ? /* @__PURE__ */ k(
997
1223
  "svg",
998
1224
  {
999
1225
  width: "16",
@@ -1005,11 +1231,11 @@ const it = ({
1005
1231
  strokeLinecap: "round",
1006
1232
  strokeLinejoin: "round",
1007
1233
  children: [
1008
- /* @__PURE__ */ s("polyline", { points: "4 17 10 11 4 5" }),
1009
- /* @__PURE__ */ s("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
1234
+ /* @__PURE__ */ a("polyline", { points: "4 17 10 11 4 5" }),
1235
+ /* @__PURE__ */ a("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
1010
1236
  ]
1011
1237
  }
1012
- ) : p ? /* @__PURE__ */ m(
1238
+ ) : g ? /* @__PURE__ */ k(
1013
1239
  "svg",
1014
1240
  {
1015
1241
  width: "16",
@@ -1021,17 +1247,17 @@ const it = ({
1021
1247
  strokeLinecap: "round",
1022
1248
  strokeLinejoin: "round",
1023
1249
  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" })
1250
+ /* @__PURE__ */ a("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }),
1251
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "5", r: "2" }),
1252
+ /* @__PURE__ */ a("path", { d: "M12 7v4" }),
1253
+ /* @__PURE__ */ a("line", { x1: "8", y1: "16", x2: "8", y2: "16" }),
1254
+ /* @__PURE__ */ a("line", { x1: "16", y1: "16", x2: "16", y2: "16" })
1029
1255
  ]
1030
1256
  }
1031
1257
  ) : ">"
1032
1258
  }
1033
1259
  ),
1034
- /* @__PURE__ */ s(
1260
+ /* @__PURE__ */ a(
1035
1261
  "input",
1036
1262
  {
1037
1263
  ref: C,
@@ -1039,33 +1265,33 @@ const it = ({
1039
1265
  type: "text",
1040
1266
  value: o,
1041
1267
  onChange: (I) => e(I.target.value),
1042
- onKeyDown: L,
1043
- placeholder: y,
1044
- disabled: l || $,
1268
+ onKeyDown: $,
1269
+ placeholder: f,
1270
+ disabled: c || z,
1045
1271
  style: {
1046
1272
  flex: 1,
1047
1273
  backgroundColor: "transparent",
1048
1274
  border: "none",
1049
1275
  outline: "none",
1050
- color: u.colors.text,
1051
- fontFamily: u.fonts.monospace,
1052
- fontSize: u.fontSizes[1],
1053
- caretColor: u.colors.primary
1276
+ color: p.colors.text,
1277
+ fontFamily: p.fonts.monospace,
1278
+ fontSize: p.fontSizes[1],
1279
+ caretColor: p.colors.primary
1054
1280
  }
1055
1281
  }
1056
1282
  ),
1057
- $ && /* @__PURE__ */ m(
1283
+ z && /* @__PURE__ */ k(
1058
1284
  "span",
1059
1285
  {
1060
1286
  style: {
1061
- color: u.colors.info,
1062
- fontSize: u.fontSizes[0],
1287
+ color: p.colors.info,
1288
+ fontSize: p.fontSizes[0],
1063
1289
  display: "flex",
1064
1290
  alignItems: "center",
1065
1291
  gap: "4px"
1066
1292
  },
1067
1293
  children: [
1068
- /* @__PURE__ */ s(
1294
+ /* @__PURE__ */ a(
1069
1295
  "span",
1070
1296
  {
1071
1297
  style: {
@@ -1073,25 +1299,25 @@ const it = ({
1073
1299
  width: "8px",
1074
1300
  height: "8px",
1075
1301
  borderRadius: "50%",
1076
- backgroundColor: u.colors.info,
1302
+ backgroundColor: p.colors.info,
1077
1303
  animation: "pulse 1s ease-in-out infinite"
1078
1304
  }
1079
1305
  }
1080
1306
  ),
1081
- c === "thinking" ? "Thinking..." : "Executing..."
1307
+ n === "thinking" ? "Thinking..." : "Executing..."
1082
1308
  ]
1083
1309
  }
1084
1310
  ),
1085
- !$ && /* @__PURE__ */ s(
1311
+ !z && /* @__PURE__ */ a(
1086
1312
  "kbd",
1087
1313
  {
1088
1314
  style: {
1089
1315
  padding: "2px 6px",
1090
- backgroundColor: u.colors.backgroundSecondary,
1316
+ backgroundColor: p.colors.backgroundSecondary,
1091
1317
  borderRadius: "3px",
1092
- border: `1px solid ${u.colors.border}`,
1093
- fontSize: u.fontSizes[0],
1094
- color: u.colors.textMuted
1318
+ border: `1px solid ${p.colors.border}`,
1319
+ fontSize: p.fontSizes[0],
1320
+ color: p.colors.textMuted
1095
1321
  },
1096
1322
  children: "Alt+P"
1097
1323
  }
@@ -1100,9 +1326,9 @@ const it = ({
1100
1326
  }
1101
1327
  );
1102
1328
  };
1103
- ce.displayName = "AgentCommandInput";
1104
- const _e = ({ status: o }) => {
1105
- const { theme: e } = H(), t = {
1329
+ me.displayName = "AgentCommandInput";
1330
+ const je = ({ status: o }) => {
1331
+ const { theme: e } = Q(), t = {
1106
1332
  display: "inline-flex",
1107
1333
  alignItems: "center",
1108
1334
  justifyContent: "center",
@@ -1112,9 +1338,9 @@ const _e = ({ status: o }) => {
1112
1338
  };
1113
1339
  switch (o) {
1114
1340
  case "pending":
1115
- return /* @__PURE__ */ s("span", { style: { ...t, color: e.colors.textMuted }, children: "○" });
1341
+ return /* @__PURE__ */ a("span", { style: { ...t, color: e.colors.textMuted }, children: "○" });
1116
1342
  case "running":
1117
- return /* @__PURE__ */ s(
1343
+ return /* @__PURE__ */ a(
1118
1344
  "span",
1119
1345
  {
1120
1346
  style: {
@@ -1126,16 +1352,16 @@ const _e = ({ status: o }) => {
1126
1352
  }
1127
1353
  );
1128
1354
  case "success":
1129
- return /* @__PURE__ */ s("span", { style: { ...t, color: e.colors.success }, children: "✓" });
1355
+ return /* @__PURE__ */ a("span", { style: { ...t, color: e.colors.success }, children: "✓" });
1130
1356
  case "error":
1131
- return /* @__PURE__ */ s("span", { style: { ...t, color: e.colors.error }, children: "✗" });
1357
+ return /* @__PURE__ */ a("span", { style: { ...t, color: e.colors.error }, children: "✗" });
1132
1358
  }
1133
- }, Ae = (o) => {
1359
+ }, qe = (o) => {
1134
1360
  const e = Object.entries(o);
1135
1361
  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(
1362
+ }, Ne = ({ tool: o, compact: e }) => {
1363
+ const { theme: t } = Q(), r = qe(o.args);
1364
+ return /* @__PURE__ */ k(
1139
1365
  "div",
1140
1366
  {
1141
1367
  style: {
@@ -1147,16 +1373,16 @@ const _e = ({ status: o }) => {
1147
1373
  fontSize: t.fontSizes[1]
1148
1374
  },
1149
1375
  children: [
1150
- /* @__PURE__ */ s(_e, { status: o.status }),
1151
- /* @__PURE__ */ m("span", { style: { color: t.colors.text }, children: [
1376
+ /* @__PURE__ */ a(je, { status: o.status }),
1377
+ /* @__PURE__ */ k("span", { style: { color: t.colors.text }, children: [
1152
1378
  o.name,
1153
- r && /* @__PURE__ */ m("span", { style: { color: t.colors.textMuted }, children: [
1379
+ r && /* @__PURE__ */ k("span", { style: { color: t.colors.textMuted }, children: [
1154
1380
  "(",
1155
1381
  r,
1156
1382
  ")"
1157
1383
  ] })
1158
1384
  ] }),
1159
- o.status === "running" && /* @__PURE__ */ s(
1385
+ o.status === "running" && /* @__PURE__ */ a(
1160
1386
  "span",
1161
1387
  {
1162
1388
  style: {
@@ -1167,7 +1393,7 @@ const _e = ({ status: o }) => {
1167
1393
  children: "[running]"
1168
1394
  }
1169
1395
  ),
1170
- o.status === "success" && /* @__PURE__ */ s(
1396
+ o.status === "success" && /* @__PURE__ */ a(
1171
1397
  "span",
1172
1398
  {
1173
1399
  style: {
@@ -1178,7 +1404,7 @@ const _e = ({ status: o }) => {
1178
1404
  children: "[done]"
1179
1405
  }
1180
1406
  ),
1181
- o.status === "error" && /* @__PURE__ */ s(
1407
+ o.status === "error" && /* @__PURE__ */ a(
1182
1408
  "span",
1183
1409
  {
1184
1410
  style: {
@@ -1193,12 +1419,12 @@ const _e = ({ status: o }) => {
1193
1419
  ]
1194
1420
  }
1195
1421
  );
1196
- }, de = ({
1422
+ }, xe = ({
1197
1423
  tools: o,
1198
1424
  compact: e = !1
1199
1425
  }) => {
1200
- const { theme: t } = H();
1201
- return o.length === 0 ? null : /* @__PURE__ */ s(
1426
+ const { theme: t } = Q();
1427
+ return o.length === 0 ? null : /* @__PURE__ */ a(
1202
1428
  "div",
1203
1429
  {
1204
1430
  style: {
@@ -1207,36 +1433,36 @@ const _e = ({ status: o }) => {
1207
1433
  borderRadius: "4px",
1208
1434
  margin: "8px 16px"
1209
1435
  },
1210
- children: o.map((r) => /* @__PURE__ */ s(Re, { tool: r, compact: e }, r.id))
1436
+ children: o.map((r) => /* @__PURE__ */ a(Ne, { tool: r, compact: e }, r.id))
1211
1437
  }
1212
1438
  );
1213
1439
  };
1214
- de.displayName = "ToolExecutionList";
1215
- const pe = ({
1440
+ xe.displayName = "ToolExecutionList";
1441
+ const ke = ({
1216
1442
  response: o,
1217
1443
  streaming: e = !1
1218
1444
  }) => {
1219
- const { theme: t } = H();
1445
+ const { theme: t } = Q();
1220
1446
  if (!o)
1221
1447
  return null;
1222
- const r = o.toLowerCase().startsWith("error"), n = o.toLowerCase().startsWith("done") || o.toLowerCase().startsWith("executed");
1223
- return /* @__PURE__ */ m(
1448
+ const r = o.toLowerCase().startsWith("error"), s = o.toLowerCase().startsWith("done") || o.toLowerCase().startsWith("executed");
1449
+ return /* @__PURE__ */ k(
1224
1450
  "div",
1225
1451
  {
1226
1452
  style: {
1227
1453
  padding: "12px 16px",
1228
- color: r ? t.colors.error : n ? t.colors.success : t.colors.text,
1454
+ color: r ? t.colors.error : s ? t.colors.success : t.colors.text,
1229
1455
  fontSize: t.fontSizes[1],
1230
1456
  display: "flex",
1231
1457
  alignItems: "center",
1232
1458
  gap: "8px"
1233
1459
  },
1234
1460
  children: [
1235
- n && /* @__PURE__ */ s("span", { children: "✓" }),
1236
- r && /* @__PURE__ */ s("span", { children: "✗" }),
1237
- /* @__PURE__ */ m("span", { children: [
1461
+ s && /* @__PURE__ */ a("span", { children: "✓" }),
1462
+ r && /* @__PURE__ */ a("span", { children: "✗" }),
1463
+ /* @__PURE__ */ k("span", { children: [
1238
1464
  o,
1239
- e && /* @__PURE__ */ s(
1465
+ e && /* @__PURE__ */ a(
1240
1466
  "span",
1241
1467
  {
1242
1468
  style: {
@@ -1254,76 +1480,177 @@ const pe = ({
1254
1480
  }
1255
1481
  );
1256
1482
  };
1257
- pe.displayName = "AgentResponseDisplay";
1258
- function Ee({
1483
+ ke.displayName = "AgentResponseDisplay";
1484
+ function ge({
1259
1485
  text: o,
1260
1486
  matchedIndices: e,
1261
1487
  highlightColor: t
1262
1488
  }) {
1263
1489
  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(
1490
+ return /* @__PURE__ */ a(ce, { children: o });
1491
+ const r = new Set(e), s = o.split("");
1492
+ return /* @__PURE__ */ a(ce, { children: s.map((i, l) => /* @__PURE__ */ a(
1267
1493
  "span",
1268
1494
  {
1269
1495
  style: {
1270
- color: r.has(i) ? t : "inherit",
1271
- fontWeight: r.has(i) ? 600 : "inherit"
1496
+ color: r.has(l) ? t : "inherit",
1497
+ fontWeight: r.has(l) ? 600 : "inherit"
1272
1498
  },
1273
- children: a
1499
+ children: i
1274
1500
  },
1275
- i
1501
+ l
1276
1502
  )) });
1277
1503
  }
1278
- const ue = ({
1504
+ const be = ({
1279
1505
  matches: o,
1280
- selectedIndex: e,
1281
- onSelect: t,
1282
- maxVisible: r = 6
1506
+ argumentMatches: e = [],
1507
+ currentArg: t,
1508
+ isEnteringArgs: r = !1,
1509
+ selectedIndex: s,
1510
+ onSelect: i,
1511
+ maxVisible: l = 6
1283
1512
  }) => {
1284
- const { theme: n } = H(), a = N(null), i = N(null);
1513
+ const { theme: n } = Q(), f = H(null), c = H(null);
1285
1514
  if (R(() => {
1286
- i.current && a.current && i.current.scrollIntoView({
1515
+ c.current && f.current && c.current.scrollIntoView({
1287
1516
  block: "nearest",
1288
1517
  behavior: "smooth"
1289
1518
  });
1290
- }, [e]), o.length === 0)
1519
+ }, [s]), r && e.length > 0) {
1520
+ const v = 40 * l;
1521
+ return /* @__PURE__ */ k(
1522
+ "div",
1523
+ {
1524
+ ref: f,
1525
+ style: {
1526
+ maxHeight: `${v}px`,
1527
+ overflowY: "auto",
1528
+ borderTop: `1px solid ${n.colors.border}`
1529
+ },
1530
+ children: [
1531
+ t && /* @__PURE__ */ k(
1532
+ "div",
1533
+ {
1534
+ style: {
1535
+ padding: "8px 16px",
1536
+ fontSize: n.fontSizes[0],
1537
+ color: n.colors.textMuted,
1538
+ backgroundColor: n.colors.backgroundSecondary,
1539
+ borderBottom: `1px solid ${n.colors.border}`
1540
+ },
1541
+ children: [
1542
+ /* @__PURE__ */ a("span", { style: { color: n.colors.textSecondary }, children: t.name }),
1543
+ t.description && /* @__PURE__ */ k("span", { style: { marginLeft: "8px" }, children: [
1544
+ "— ",
1545
+ t.description
1546
+ ] })
1547
+ ]
1548
+ }
1549
+ ),
1550
+ e.map((u, d) => {
1551
+ const p = d === s;
1552
+ return /* @__PURE__ */ k(
1553
+ "div",
1554
+ {
1555
+ ref: p ? c : void 0,
1556
+ onClick: () => i(d),
1557
+ style: {
1558
+ display: "flex",
1559
+ alignItems: "center",
1560
+ gap: "12px",
1561
+ padding: "8px 16px",
1562
+ cursor: "pointer",
1563
+ backgroundColor: p ? n.colors.backgroundSecondary : "transparent",
1564
+ borderLeft: p ? `2px solid ${n.colors.primary}` : "2px solid transparent",
1565
+ transition: "background-color 100ms ease"
1566
+ },
1567
+ onMouseEnter: (C) => {
1568
+ p || (C.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
1569
+ },
1570
+ onMouseLeave: (C) => {
1571
+ p || (C.currentTarget.style.backgroundColor = "transparent");
1572
+ },
1573
+ children: [
1574
+ /* @__PURE__ */ a(
1575
+ "span",
1576
+ {
1577
+ style: {
1578
+ fontFamily: n.fonts.monospace,
1579
+ fontSize: n.fontSizes[1],
1580
+ color: n.colors.text,
1581
+ flex: 1
1582
+ },
1583
+ children: /* @__PURE__ */ a(
1584
+ ge,
1585
+ {
1586
+ text: u.option,
1587
+ matchedIndices: u.matchedIndices,
1588
+ highlightColor: n.colors.primary
1589
+ }
1590
+ )
1591
+ }
1592
+ ),
1593
+ p && /* @__PURE__ */ a(
1594
+ "kbd",
1595
+ {
1596
+ style: {
1597
+ padding: "2px 6px",
1598
+ backgroundColor: n.colors.backgroundTertiary,
1599
+ borderRadius: "3px",
1600
+ border: `1px solid ${n.colors.border}`,
1601
+ fontSize: n.fontSizes[0],
1602
+ color: n.colors.textMuted,
1603
+ flexShrink: 0
1604
+ },
1605
+ children: "Tab"
1606
+ }
1607
+ )
1608
+ ]
1609
+ },
1610
+ `${u.option}-${d}`
1611
+ );
1612
+ })
1613
+ ]
1614
+ }
1615
+ );
1616
+ }
1617
+ if (o.length === 0)
1291
1618
  return null;
1292
- const y = 48 * r;
1293
- return /* @__PURE__ */ s(
1619
+ const g = 48 * l;
1620
+ return /* @__PURE__ */ a(
1294
1621
  "div",
1295
1622
  {
1296
- ref: a,
1623
+ ref: f,
1297
1624
  style: {
1298
- maxHeight: `${y}px`,
1625
+ maxHeight: `${g}px`,
1299
1626
  overflowY: "auto",
1300
1627
  borderTop: `1px solid ${n.colors.border}`
1301
1628
  },
1302
- children: o.map((l, b) => {
1303
- const p = b === e, f = l.command;
1304
- return /* @__PURE__ */ m(
1629
+ children: o.map((h, v) => {
1630
+ const u = v === s, d = h.command;
1631
+ return /* @__PURE__ */ k(
1305
1632
  "div",
1306
1633
  {
1307
- ref: p ? i : void 0,
1308
- onClick: () => t(b),
1634
+ ref: u ? c : void 0,
1635
+ onClick: () => i(v),
1309
1636
  style: {
1310
1637
  display: "flex",
1311
1638
  alignItems: "center",
1312
1639
  gap: "12px",
1313
1640
  padding: "10px 16px",
1314
1641
  cursor: "pointer",
1315
- backgroundColor: p ? n.colors.backgroundSecondary : "transparent",
1316
- borderLeft: p ? `2px solid ${n.colors.primary}` : "2px solid transparent",
1642
+ backgroundColor: u ? n.colors.backgroundSecondary : "transparent",
1643
+ borderLeft: u ? `2px solid ${n.colors.primary}` : "2px solid transparent",
1317
1644
  transition: "background-color 100ms ease"
1318
1645
  },
1319
- onMouseEnter: (x) => {
1320
- p || (x.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
1646
+ onMouseEnter: (p) => {
1647
+ u || (p.currentTarget.style.backgroundColor = n.colors.backgroundSecondary);
1321
1648
  },
1322
- onMouseLeave: (x) => {
1323
- p || (x.currentTarget.style.backgroundColor = "transparent");
1649
+ onMouseLeave: (p) => {
1650
+ u || (p.currentTarget.style.backgroundColor = "transparent");
1324
1651
  },
1325
1652
  children: [
1326
- /* @__PURE__ */ s(
1653
+ /* @__PURE__ */ a(
1327
1654
  "span",
1328
1655
  {
1329
1656
  style: {
@@ -1335,8 +1662,8 @@ const ue = ({
1335
1662
  children: "/"
1336
1663
  }
1337
1664
  ),
1338
- /* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
1339
- /* @__PURE__ */ m(
1665
+ /* @__PURE__ */ k("div", { style: { flex: 1, minWidth: 0 }, children: [
1666
+ /* @__PURE__ */ k(
1340
1667
  "div",
1341
1668
  {
1342
1669
  style: {
@@ -1345,15 +1672,15 @@ const ue = ({
1345
1672
  color: n.colors.text
1346
1673
  },
1347
1674
  children: [
1348
- /* @__PURE__ */ s(
1349
- Ee,
1675
+ /* @__PURE__ */ a(
1676
+ ge,
1350
1677
  {
1351
- text: f.name,
1352
- matchedIndices: l.matchedOn === f.name ? l.matchedIndices : [],
1678
+ text: d.name,
1679
+ matchedIndices: h.matchedOn === d.name ? h.matchedIndices : [],
1353
1680
  highlightColor: n.colors.primary
1354
1681
  }
1355
1682
  ),
1356
- l.matchedOn !== f.name && /* @__PURE__ */ m(
1683
+ h.matchedOn !== d.name && /* @__PURE__ */ k(
1357
1684
  "span",
1358
1685
  {
1359
1686
  style: {
@@ -1363,7 +1690,7 @@ const ue = ({
1363
1690
  },
1364
1691
  children: [
1365
1692
  "(alias: ",
1366
- l.matchedOn,
1693
+ h.matchedOn,
1367
1694
  ")"
1368
1695
  ]
1369
1696
  }
@@ -1371,7 +1698,7 @@ const ue = ({
1371
1698
  ]
1372
1699
  }
1373
1700
  ),
1374
- /* @__PURE__ */ s(
1701
+ /* @__PURE__ */ a(
1375
1702
  "div",
1376
1703
  {
1377
1704
  style: {
@@ -1382,11 +1709,11 @@ const ue = ({
1382
1709
  overflow: "hidden",
1383
1710
  textOverflow: "ellipsis"
1384
1711
  },
1385
- children: f.description
1712
+ children: d.description
1386
1713
  }
1387
1714
  )
1388
1715
  ] }),
1389
- f.args && f.args.length > 0 && /* @__PURE__ */ s(
1716
+ d.args && d.args.length > 0 && /* @__PURE__ */ a(
1390
1717
  "div",
1391
1718
  {
1392
1719
  style: {
@@ -1395,21 +1722,21 @@ const ue = ({
1395
1722
  fontFamily: n.fonts.monospace,
1396
1723
  flexShrink: 0
1397
1724
  },
1398
- children: f.args.map((x, h) => /* @__PURE__ */ m("span", { children: [
1399
- h > 0 && " ",
1400
- /* @__PURE__ */ s(
1725
+ children: d.args.map((p, C) => /* @__PURE__ */ k("span", { children: [
1726
+ C > 0 && " ",
1727
+ /* @__PURE__ */ a(
1401
1728
  "span",
1402
1729
  {
1403
1730
  style: {
1404
- color: x.required ? n.colors.warning : n.colors.textMuted
1731
+ color: p.required ? n.colors.warning : n.colors.textMuted
1405
1732
  },
1406
- children: x.required ? `<${x.name}>` : `[${x.name}]`
1733
+ children: p.required ? `<${p.name}>` : `[${p.name}]`
1407
1734
  }
1408
1735
  )
1409
- ] }, x.name))
1736
+ ] }, p.name))
1410
1737
  }
1411
1738
  ),
1412
- p && /* @__PURE__ */ s(
1739
+ u && /* @__PURE__ */ a(
1413
1740
  "kbd",
1414
1741
  {
1415
1742
  style: {
@@ -1426,71 +1753,74 @@ const ue = ({
1426
1753
  )
1427
1754
  ]
1428
1755
  },
1429
- `${f.name}-${b}`
1756
+ `${d.name}-${v}`
1430
1757
  );
1431
1758
  })
1432
1759
  }
1433
1760
  );
1434
1761
  };
1435
- ue.displayName = "QuickCommandAutocomplete";
1436
- const De = ({
1762
+ be.displayName = "QuickCommandAutocomplete";
1763
+ const Oe = ({
1437
1764
  palette: o,
1438
1765
  config: e
1439
1766
  }) => {
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,
1767
+ const { theme: t } = Q(), r = H(null), {
1768
+ isOpen: s,
1769
+ close: i,
1770
+ query: l,
1771
+ setQuery: n,
1772
+ mode: f,
1773
+ status: c,
1774
+ pendingTools: y,
1775
+ completedTools: g,
1776
+ agentResponse: h,
1777
+ submit: v,
1778
+ historyPrevious: u,
1452
1779
  historyNext: d,
1453
- suggestions: u,
1780
+ suggestions: p,
1454
1781
  agentAvailable: C,
1455
1782
  // Autocomplete
1456
- quickCommandMatches: L,
1457
- selectedAutocompleteIndex: $,
1458
- autocompleteNext: I,
1459
- autocompletePrevious: _,
1460
- autocompleteAccept: w,
1461
- showAutocomplete: v
1783
+ quickCommandMatches: $,
1784
+ argumentOptionMatches: z,
1785
+ parsedQuery: I,
1786
+ currentArgDef: L,
1787
+ selectedAutocompleteIndex: b,
1788
+ autocompleteNext: w,
1789
+ autocompletePrevious: x,
1790
+ autocompleteAccept: T,
1791
+ showAutocomplete: P
1462
1792
  } = o;
1463
1793
  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);
1794
+ if (!s) return;
1795
+ const K = (D) => {
1796
+ r.current && !r.current.contains(D.target) && i();
1797
+ }, U = setTimeout(() => {
1798
+ document.addEventListener("mousedown", K);
1469
1799
  }, 100);
1470
1800
  return () => {
1471
- clearTimeout(M), document.removeEventListener("mousedown", j);
1801
+ clearTimeout(U), document.removeEventListener("mousedown", K);
1472
1802
  };
1473
- }, [n, a]);
1474
- const [S, T] = P(!1), [W, z] = P(!1);
1803
+ }, [s, i]);
1804
+ const [W, A] = _(!1), [O, F] = _(!1);
1475
1805
  if (R(() => {
1476
- if (n)
1477
- z(!0), requestAnimationFrame(() => {
1806
+ if (s)
1807
+ F(!0), requestAnimationFrame(() => {
1478
1808
  requestAnimationFrame(() => {
1479
- T(!0);
1809
+ A(!0);
1480
1810
  });
1481
1811
  });
1482
1812
  else {
1483
- T(!1);
1484
- const j = setTimeout(() => {
1485
- z(!1);
1813
+ A(!1);
1814
+ const K = setTimeout(() => {
1815
+ F(!1);
1486
1816
  }, 150);
1487
- return () => clearTimeout(j);
1817
+ return () => clearTimeout(K);
1488
1818
  }
1489
- }, [n]), !W)
1819
+ }, [s]), !O)
1490
1820
  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(
1821
+ const ee = C ? (e == null ? void 0 : e.placeholder) || "What would you like to do?" : "Quick command mode (agent unavailable)", V = [...g, ...y], J = V.length > 0, ne = h && c !== "idle", se = C && !l && c === "idle" && p.length > 0, te = (f === "quick-command" || !C) && c === "idle", ae = !C && f !== "quick-command" && c === "idle";
1822
+ return /* @__PURE__ */ k(ce, { children: [
1823
+ /* @__PURE__ */ a(
1494
1824
  "div",
1495
1825
  {
1496
1826
  style: {
@@ -1498,10 +1828,10 @@ const De = ({
1498
1828
  inset: 0,
1499
1829
  zIndex: 999
1500
1830
  },
1501
- onClick: a
1831
+ onClick: i
1502
1832
  }
1503
1833
  ),
1504
- /* @__PURE__ */ m(
1834
+ /* @__PURE__ */ k(
1505
1835
  "div",
1506
1836
  {
1507
1837
  ref: r,
@@ -1512,39 +1842,39 @@ const De = ({
1512
1842
  left: 0,
1513
1843
  right: 0,
1514
1844
  maxHeight: "50vh",
1515
- backgroundColor: t.colors.surface,
1845
+ backgroundColor: t.colors.background,
1516
1846
  borderTop: `1px solid ${t.colors.border}`,
1517
1847
  boxShadow: t.shadows[2],
1518
1848
  zIndex: 1e3,
1519
1849
  display: "flex",
1520
1850
  flexDirection: "column-reverse",
1521
1851
  overflow: "hidden",
1522
- transform: S ? "translateY(0)" : "translateY(100%)",
1852
+ transform: W ? "translateY(0)" : "translateY(100%)",
1523
1853
  transition: "transform 150ms ease-out",
1524
1854
  ...e == null ? void 0 : e.style
1525
1855
  },
1526
1856
  children: [
1527
- /* @__PURE__ */ m("div", { children: [
1528
- /* @__PURE__ */ s(
1529
- ce,
1857
+ /* @__PURE__ */ k("div", { children: [
1858
+ /* @__PURE__ */ a(
1859
+ me,
1530
1860
  {
1531
- value: i,
1532
- onChange: c,
1533
- onSubmit: x,
1534
- onClose: a,
1535
- onHistoryPrevious: h,
1861
+ value: l,
1862
+ onChange: n,
1863
+ onSubmit: v,
1864
+ onClose: i,
1865
+ onHistoryPrevious: u,
1536
1866
  onHistoryNext: d,
1537
- mode: y,
1538
- status: l,
1539
- placeholder: q,
1867
+ mode: f,
1868
+ status: c,
1869
+ placeholder: ee,
1540
1870
  agentAvailable: C,
1541
- showAutocomplete: v,
1542
- onAutocompleteNext: I,
1543
- onAutocompletePrevious: _,
1544
- onAutocompleteAccept: w
1871
+ showAutocomplete: P,
1872
+ onAutocompleteNext: w,
1873
+ onAutocompletePrevious: x,
1874
+ onAutocompleteAccept: T
1545
1875
  }
1546
1876
  ),
1547
- /* @__PURE__ */ m(
1877
+ /* @__PURE__ */ k(
1548
1878
  "div",
1549
1879
  {
1550
1880
  style: {
@@ -1557,8 +1887,8 @@ const De = ({
1557
1887
  backgroundColor: t.colors.background
1558
1888
  },
1559
1889
  children: [
1560
- /* @__PURE__ */ m("span", { children: [
1561
- /* @__PURE__ */ s(
1890
+ /* @__PURE__ */ k("span", { children: [
1891
+ /* @__PURE__ */ a(
1562
1892
  "kbd",
1563
1893
  {
1564
1894
  style: {
@@ -1573,8 +1903,8 @@ const De = ({
1573
1903
  " ",
1574
1904
  "Execute"
1575
1905
  ] }),
1576
- /* @__PURE__ */ m("span", { children: [
1577
- /* @__PURE__ */ s(
1906
+ /* @__PURE__ */ k("span", { children: [
1907
+ /* @__PURE__ */ a(
1578
1908
  "kbd",
1579
1909
  {
1580
1910
  style: {
@@ -1589,8 +1919,8 @@ const De = ({
1589
1919
  " ",
1590
1920
  "Close"
1591
1921
  ] }),
1592
- /* @__PURE__ */ m("span", { children: [
1593
- /* @__PURE__ */ s(
1922
+ /* @__PURE__ */ k("span", { children: [
1923
+ /* @__PURE__ */ a(
1594
1924
  "kbd",
1595
1925
  {
1596
1926
  style: {
@@ -1605,8 +1935,8 @@ const De = ({
1605
1935
  " ",
1606
1936
  "History"
1607
1937
  ] }),
1608
- /* @__PURE__ */ m("span", { style: { marginLeft: "auto" }, children: [
1609
- /* @__PURE__ */ s(
1938
+ /* @__PURE__ */ k("span", { style: { marginLeft: "auto" }, children: [
1939
+ /* @__PURE__ */ a(
1610
1940
  "kbd",
1611
1941
  {
1612
1942
  style: {
@@ -1625,16 +1955,16 @@ const De = ({
1625
1955
  }
1626
1956
  )
1627
1957
  ] }),
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,
1958
+ /* @__PURE__ */ k("div", { style: { overflow: "auto" }, children: [
1959
+ J && /* @__PURE__ */ a(xe, { tools: V, compact: V.length > 3 }),
1960
+ ne && /* @__PURE__ */ a(
1961
+ ke,
1632
1962
  {
1633
- response: f,
1634
- streaming: l === "thinking"
1963
+ response: h,
1964
+ streaming: c === "thinking"
1635
1965
  }
1636
1966
  ),
1637
- J && /* @__PURE__ */ m(
1967
+ se && /* @__PURE__ */ k(
1638
1968
  "div",
1639
1969
  {
1640
1970
  style: {
@@ -1644,7 +1974,7 @@ const De = ({
1644
1974
  flexWrap: "wrap"
1645
1975
  },
1646
1976
  children: [
1647
- /* @__PURE__ */ s(
1977
+ /* @__PURE__ */ a(
1648
1978
  "span",
1649
1979
  {
1650
1980
  style: {
@@ -1655,11 +1985,11 @@ const De = ({
1655
1985
  children: "Try:"
1656
1986
  }
1657
1987
  ),
1658
- u.map((j, M) => /* @__PURE__ */ m(
1988
+ p.map((K, U) => /* @__PURE__ */ k(
1659
1989
  "button",
1660
1990
  {
1661
1991
  onClick: () => {
1662
- c(j);
1992
+ n(K);
1663
1993
  },
1664
1994
  style: {
1665
1995
  padding: "4px 10px",
@@ -1671,24 +2001,24 @@ const De = ({
1671
2001
  cursor: "pointer",
1672
2002
  transition: "background-color 150ms ease"
1673
2003
  },
1674
- onMouseEnter: (O) => {
1675
- O.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
2004
+ onMouseEnter: (D) => {
2005
+ D.currentTarget.style.backgroundColor = t.colors.backgroundTertiary;
1676
2006
  },
1677
- onMouseLeave: (O) => {
1678
- O.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
2007
+ onMouseLeave: (D) => {
2008
+ D.currentTarget.style.backgroundColor = t.colors.backgroundSecondary;
1679
2009
  },
1680
2010
  children: [
1681
2011
  '"',
1682
- j,
2012
+ K,
1683
2013
  '"'
1684
2014
  ]
1685
2015
  },
1686
- M
2016
+ U
1687
2017
  ))
1688
2018
  ]
1689
2019
  }
1690
2020
  ),
1691
- oe && /* @__PURE__ */ m(
2021
+ ae && /* @__PURE__ */ k(
1692
2022
  "div",
1693
2023
  {
1694
2024
  style: {
@@ -1700,10 +2030,10 @@ const De = ({
1700
2030
  gap: "8px"
1701
2031
  },
1702
2032
  children: [
1703
- /* @__PURE__ */ s("span", { children: "Agent unavailable." }),
1704
- /* @__PURE__ */ m("span", { style: { color: t.colors.textMuted }, children: [
2033
+ /* @__PURE__ */ a("span", { children: "Agent unavailable." }),
2034
+ /* @__PURE__ */ k("span", { style: { color: t.colors.textMuted }, children: [
1705
2035
  "Use quick commands (start with ",
1706
- /* @__PURE__ */ s("kbd", { style: {
2036
+ /* @__PURE__ */ a("kbd", { style: {
1707
2037
  padding: "2px 6px",
1708
2038
  backgroundColor: t.colors.backgroundSecondary,
1709
2039
  borderRadius: "3px",
@@ -1714,7 +2044,7 @@ const De = ({
1714
2044
  ]
1715
2045
  }
1716
2046
  ),
1717
- X && /* @__PURE__ */ m(
2047
+ te && /* @__PURE__ */ k(
1718
2048
  "div",
1719
2049
  {
1720
2050
  style: {
@@ -1724,29 +2054,29 @@ const De = ({
1724
2054
  fontFamily: t.fonts.monospace
1725
2055
  },
1726
2056
  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" }),
2057
+ /* @__PURE__ */ a("div", { style: { marginBottom: "8px", color: t.colors.textSecondary }, children: "Quick commands:" }),
2058
+ /* @__PURE__ */ k("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
2059
+ /* @__PURE__ */ k("div", { children: [
2060
+ /* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/toggle" }),
1731
2061
  " ",
1732
- /* @__PURE__ */ s("span", { style: { color: t.colors.textMuted }, children: "<left|right>" }),
2062
+ /* @__PURE__ */ a("span", { style: { color: t.colors.textMuted }, children: "<left|right>" }),
1733
2063
  " ",
1734
2064
  "- Toggle sidebar visibility"
1735
2065
  ] }),
1736
- /* @__PURE__ */ m("div", { children: [
1737
- /* @__PURE__ */ s("span", { style: { color: t.colors.info }, children: "/switch" }),
2066
+ /* @__PURE__ */ k("div", { children: [
2067
+ /* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/switch" }),
1738
2068
  " ",
1739
- /* @__PURE__ */ s("span", { style: { color: t.colors.textMuted }, children: "<slot> <panel>" }),
2069
+ /* @__PURE__ */ a("span", { style: { color: t.colors.textMuted }, children: "<slot> <panel>" }),
1740
2070
  " ",
1741
2071
  "- Switch panel content"
1742
2072
  ] }),
1743
- /* @__PURE__ */ m("div", { children: [
1744
- /* @__PURE__ */ s("span", { style: { color: t.colors.info }, children: "/collapse" }),
2073
+ /* @__PURE__ */ k("div", { children: [
2074
+ /* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/collapse" }),
1745
2075
  " ",
1746
2076
  "- Collapse all sidebars"
1747
2077
  ] }),
1748
- /* @__PURE__ */ m("div", { children: [
1749
- /* @__PURE__ */ s("span", { style: { color: t.colors.info }, children: "/expand" }),
2078
+ /* @__PURE__ */ k("div", { children: [
2079
+ /* @__PURE__ */ a("span", { style: { color: t.colors.info }, children: "/expand" }),
1750
2080
  " ",
1751
2081
  "- Expand all sidebars"
1752
2082
  ] })
@@ -1754,17 +2084,33 @@ const De = ({
1754
2084
  ]
1755
2085
  }
1756
2086
  ),
1757
- v && /* @__PURE__ */ s(
1758
- ue,
2087
+ P && /* @__PURE__ */ a(
2088
+ be,
1759
2089
  {
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);
2090
+ matches: $,
2091
+ argumentMatches: z,
2092
+ currentArg: L,
2093
+ isEnteringArgs: I.isEnteringArgs,
2094
+ selectedIndex: b,
2095
+ onSelect: (K) => {
2096
+ var D;
2097
+ if (I.isEnteringArgs) {
2098
+ const G = z[K];
2099
+ if (G) {
2100
+ let X = `/${I.commandName}`;
2101
+ for (const ie of I.enteredArgs)
2102
+ X += ` ${ie}`;
2103
+ X += ` ${G.option}`;
2104
+ const de = I.currentArgIndex + 1;
2105
+ ((D = I.command) == null ? void 0 : D.args) && de < I.command.args.length && (X += " "), n(X);
2106
+ }
2107
+ return;
2108
+ }
2109
+ const U = $[K];
2110
+ if (U) {
2111
+ const G = U.command;
2112
+ let X = `/${G.name}`;
2113
+ G.args && G.args.length > 0 && (X += " "), n(X);
1768
2114
  }
1769
2115
  }
1770
2116
  }
@@ -1773,7 +2119,7 @@ const De = ({
1773
2119
  ]
1774
2120
  }
1775
2121
  ),
1776
- /* @__PURE__ */ s("style", { children: `
2122
+ /* @__PURE__ */ a("style", { children: `
1777
2123
  @keyframes pulse {
1778
2124
  0%, 100% { opacity: 1; }
1779
2125
  50% { opacity: 0.5; }
@@ -1789,261 +2135,358 @@ const De = ({
1789
2135
  ` })
1790
2136
  ] });
1791
2137
  };
1792
- De.displayName = "AgentCommandPalette";
1793
- function ae(o, e) {
2138
+ Oe.displayName = "AgentCommandPalette";
2139
+ function pe(o, e) {
1794
2140
  const t = o.toLowerCase(), r = e.toLowerCase();
1795
2141
  if (!t)
1796
2142
  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 });
2143
+ const s = [];
2144
+ let i = 0, l = 0, n = 0, f = -1;
2145
+ for (let c = 0; c < r.length && i < t.length; c++)
2146
+ r[c] === t[i] && (s.push(c), f === c - 1 ? (n++, l += n * 2) : n = 1, c === 0 && (l += 10), c > 0 && /[_\-\s]/.test(e[c - 1]) && (l += 5), l += 1, f = c, i++);
2147
+ return i < t.length ? null : (l -= e.length * 0.1, t === r && (l += 20), r.startsWith(t) && (l += 15), { score: l, matchedIndices: s });
1802
2148
  }
1803
- function $e(o, e, t = 10) {
2149
+ function Fe(o, e, t = 10) {
1804
2150
  const r = o.replace(/^\//, "").trim();
1805
2151
  if (!r)
1806
- return e.slice(0, t).map((a) => ({
1807
- command: a,
2152
+ return e.slice(0, t).map((i) => ({
2153
+ command: i,
1808
2154
  score: 0,
1809
2155
  matchedIndices: [],
1810
- matchedOn: a.name
2156
+ matchedOn: i.name
1811
2157
  }));
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
2158
+ const s = [];
2159
+ for (const i of e) {
2160
+ const l = pe(r, i.name);
2161
+ if (l) {
2162
+ s.push({
2163
+ command: i,
2164
+ score: l.score,
2165
+ matchedIndices: l.matchedIndices,
2166
+ matchedOn: i.name
1821
2167
  });
1822
2168
  continue;
1823
2169
  }
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,
2170
+ if (i.aliases)
2171
+ for (const n of i.aliases) {
2172
+ const f = pe(r, n);
2173
+ if (f) {
2174
+ s.push({
2175
+ command: i,
2176
+ score: f.score - 2,
1831
2177
  // Slight penalty for alias match
1832
- matchedIndices: y.matchedIndices,
1833
- matchedOn: c
2178
+ matchedIndices: f.matchedIndices,
2179
+ matchedOn: n
1834
2180
  });
1835
2181
  break;
1836
2182
  }
1837
2183
  }
1838
2184
  }
1839
- return n.sort((a, i) => i.score - a.score).slice(0, t);
2185
+ return s.sort((i, l) => l.score - i.score).slice(0, t);
1840
2186
  }
1841
- const qe = [
2187
+ function Ve(o, e) {
2188
+ const r = o.replace(/^\//, "").split(/\s+/), s = r[0] || "", i = o.endsWith(" ") && o.trim().length > 0, l = e.find(
2189
+ (f) => {
2190
+ var c;
2191
+ return f.name.toLowerCase() === s.toLowerCase() || ((c = f.aliases) == null ? void 0 : c.some((y) => y.toLowerCase() === s.toLowerCase()));
2192
+ }
2193
+ ) || null;
2194
+ if (!l)
2195
+ return {
2196
+ commandName: s,
2197
+ command: null,
2198
+ enteredArgs: [],
2199
+ currentArgValue: "",
2200
+ currentArgIndex: -1,
2201
+ isEnteringArgs: !1
2202
+ };
2203
+ const n = r.slice(1);
2204
+ if (i)
2205
+ return {
2206
+ commandName: l.name,
2207
+ command: l,
2208
+ enteredArgs: n,
2209
+ currentArgValue: "",
2210
+ currentArgIndex: n.length,
2211
+ isEnteringArgs: !0
2212
+ };
2213
+ if (n.length > 0) {
2214
+ const f = n.slice(0, -1), c = n[n.length - 1];
2215
+ return {
2216
+ commandName: l.name,
2217
+ command: l,
2218
+ enteredArgs: f,
2219
+ currentArgValue: c,
2220
+ currentArgIndex: f.length,
2221
+ isEnteringArgs: !0
2222
+ };
2223
+ }
2224
+ return {
2225
+ commandName: l.name,
2226
+ command: l,
2227
+ enteredArgs: [],
2228
+ currentArgValue: "",
2229
+ currentArgIndex: -1,
2230
+ isEnteringArgs: !1
2231
+ };
2232
+ }
2233
+ function Be(o, e, t = 10) {
2234
+ if (!e.length)
2235
+ return [];
2236
+ if (!o)
2237
+ return e.slice(0, t).map((s) => ({
2238
+ option: s,
2239
+ score: 0,
2240
+ matchedIndices: []
2241
+ }));
2242
+ const r = [];
2243
+ for (const s of e) {
2244
+ const i = pe(o, s);
2245
+ i && r.push({
2246
+ option: s,
2247
+ score: i.score,
2248
+ matchedIndices: i.matchedIndices
2249
+ });
2250
+ }
2251
+ return r.sort((s, i) => i.score - s.score).slice(0, t);
2252
+ }
2253
+ const Ke = [
1842
2254
  "hide sidebars",
1843
2255
  "show terminal",
1844
2256
  "focus editor"
1845
2257
  ];
1846
- function lt({
2258
+ function mt({
1847
2259
  events: o,
1848
2260
  keyboard: e = { key: "p", altKey: !0 },
1849
2261
  config: t = {},
1850
2262
  onExecuteTool: r,
1851
- initialSuggestions: n = qe,
1852
- agentAvailable: a = !0,
1853
- quickCommands: i = []
2263
+ initialSuggestions: s = Ke,
2264
+ agentAvailable: i = !0,
2265
+ quickCommands: l = []
1854
2266
  } = {}) {
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]);
2267
+ const [n, f] = _(!1), [c, y] = _(""), [g, h] = _("natural"), [v, u] = _("idle"), [d, p] = _([]), [C, $] = _([]), [z, I] = _(""), [L, b] = _([]), [w, x] = _(-1), T = oe(() => s, [s]), [P, W] = _(-1), A = oe(() => g !== "quick-command" || !l.length ? {
2268
+ commandName: "",
2269
+ command: null,
2270
+ enteredArgs: [],
2271
+ currentArgValue: "",
2272
+ currentArgIndex: -1,
2273
+ isEnteringArgs: !1
2274
+ } : Ve(c, l), [c, g, l]), O = oe(() => g !== "quick-command" || !l.length || A.isEnteringArgs ? [] : Fe(c, l), [c, g, l, A.isEnteringArgs]), F = oe(() => {
2275
+ var E;
2276
+ if (!A.isEnteringArgs || !((E = A.command) != null && E.args))
2277
+ return [];
2278
+ const m = A.command.args[A.currentArgIndex];
2279
+ return m != null && m.options ? Be(A.currentArgValue, m.options) : [];
2280
+ }, [A]), ee = oe(() => {
2281
+ var m;
2282
+ return !A.isEnteringArgs || !((m = A.command) != null && m.args) ? null : A.command.args[A.currentArgIndex] || null;
2283
+ }, [A]), V = oe(() => g !== "quick-command" || v !== "idle" || c.length === 0 ? !1 : O.length > 0 || F.length > 0, [g, v, c.length, O.length, F.length]), J = oe(() => A.isEnteringArgs ? F.length : O.length, [A.isEnteringArgs, F.length, O.length]);
1856
2284
  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({
2285
+ W(J > 0 ? 0 : -1);
2286
+ }, [J]);
2287
+ const ne = S((m) => {
2288
+ y(m), h(m.startsWith("/") ? "quick-command" : "natural");
2289
+ }, []), se = S(() => {
2290
+ f(!0), i ? (y(""), h("natural")) : (y("/"), h("quick-command")), u("idle"), p([]), $([]), I(""), x(-1), o == null || o.emit({
1863
2291
  type: "agent-command-palette:opened",
1864
2292
  source: "agent-command-palette",
1865
2293
  timestamp: Date.now(),
1866
2294
  payload: {}
1867
2295
  });
1868
- }, [o, a]), J = k(() => {
1869
- y(!1), o == null || o.emit({
2296
+ }, [o, i]), te = S(() => {
2297
+ f(!1), o == null || o.emit({
1870
2298
  type: "agent-command-palette:closed",
1871
2299
  source: "agent-command-palette",
1872
2300
  timestamp: Date.now(),
1873
2301
  payload: {}
1874
2302
  });
1875
- }, [o]), X = k(() => {
1876
- c ? J() : G();
1877
- }, [c, G, J]), oe = k(() => {
1878
- b(""), f("natural"), h("idle"), u([]), L([]), I(""), S(-1);
1879
- }, []), j = k((g) => {
1880
- const A = {
1881
- ...g,
2303
+ }, [o]), ae = S(() => {
2304
+ n ? te() : se();
2305
+ }, [n, se, te]), K = S(() => {
2306
+ y(""), h("natural"), u("idle"), p([]), $([]), I(""), x(-1);
2307
+ }, []), U = S((m) => {
2308
+ const E = {
2309
+ ...m,
1882
2310
  status: "pending"
1883
2311
  };
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
2312
+ return p((M) => [...M, E]), E;
2313
+ }, []), D = S(
2314
+ (m, E, M, Z) => {
2315
+ p((j) => {
2316
+ const q = j.find((Y) => Y.id === m);
2317
+ if (!q) return j;
2318
+ const B = {
2319
+ ...q,
2320
+ status: E,
2321
+ result: M,
2322
+ error: Z
1895
2323
  };
1896
- return A === "success" || A === "error" ? (L((Q) => [...Q, V]), F.filter((Q) => Q.id !== g)) : F.map((Q) => Q.id === g ? V : Q);
2324
+ return E === "success" || E === "error" ? ($((Y) => [...Y, B]), j.filter((Y) => Y.id !== m)) : j.map((Y) => Y.id === m ? B : Y);
1897
2325
  });
1898
2326
  },
1899
2327
  []
1900
- ), O = k(
1901
- async (g) => {
1902
- const A = g.replace(/^\//, "").trim().split(/\s+/), E = A[0], U = A.slice(1);
1903
- if (!E) return;
1904
- h("executing");
1905
- const F = `quick-${Date.now()}`;
1906
- j({
1907
- id: F,
1908
- name: E,
1909
- args: { args: U }
1910
- }), M(F, "running");
2328
+ ), G = S(
2329
+ async (m) => {
2330
+ const E = m.replace(/^\//, "").trim().split(/\s+/), M = E[0], Z = E.slice(1);
2331
+ if (!M) return;
2332
+ u("executing");
2333
+ const j = `quick-${Date.now()}`;
2334
+ U({
2335
+ id: j,
2336
+ name: M,
2337
+ args: { args: Z }
2338
+ }), D(j, "running");
1911
2339
  try {
1912
2340
  if (r) {
1913
- const V = await r(E, { args: U });
1914
- M(F, "success", String(V));
2341
+ const B = await r(M, { args: Z });
2342
+ D(j, "success", String(B));
1915
2343
  } else
1916
- M(F, "success", "Tool executed (no handler)");
1917
- w((V) => [
2344
+ D(j, "success", "Tool executed (no handler)");
2345
+ b((B) => [
1918
2346
  {
1919
- query: g,
2347
+ query: m,
1920
2348
  timestamp: Date.now(),
1921
- toolsExecuted: [E],
2349
+ toolsExecuted: [M],
1922
2350
  success: !0
1923
2351
  },
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}`);
2352
+ ...B.slice(0, (t.maxHistoryEntries || 50) - 1)
2353
+ ]), u("complete"), I(`Executed: ${M}`);
2354
+ const q = t.autoCloseDelay ?? 1e3;
2355
+ q > 0 && setTimeout(() => te(), q);
2356
+ } catch (q) {
2357
+ const B = q instanceof Error ? q.message : "Unknown error";
2358
+ D(j, "error", void 0, B), u("error"), I(`Error: ${B}`);
1931
2359
  }
1932
2360
  },
1933
- [r, j, M, t.autoCloseDelay, t.maxHistoryEntries, J]
1934
- ), Z = k(() => {
1935
- if (l.trim()) {
1936
- if (p === "quick-command") {
1937
- O(l);
2361
+ [r, U, D, t.autoCloseDelay, t.maxHistoryEntries, te]
2362
+ ), X = S(() => {
2363
+ if (c.trim()) {
2364
+ if (g === "quick-command") {
2365
+ G(c);
1938
2366
  return;
1939
2367
  }
1940
- if (!a) {
1941
- I("Agent unavailable. Use quick commands (start with /)."), h("error");
2368
+ if (!i) {
2369
+ I("Agent unavailable. Use quick commands (start with /)."), u("error");
1942
2370
  return;
1943
2371
  }
1944
- h("thinking"), o == null || o.emit({
2372
+ u("thinking"), o == null || o.emit({
1945
2373
  type: "agent-command-palette:submit",
1946
2374
  source: "agent-command-palette",
1947
2375
  timestamp: Date.now(),
1948
- payload: { query: l, mode: p }
1949
- }), w((g) => [
2376
+ payload: { query: c, mode: g }
2377
+ }), b((m) => [
1950
2378
  {
1951
- query: l,
2379
+ query: c,
1952
2380
  timestamp: Date.now(),
1953
2381
  toolsExecuted: [],
1954
2382
  success: !0
1955
2383
  },
1956
- ...g.slice(0, (t.maxHistoryEntries || 50) - 1)
2384
+ ...m.slice(0, (t.maxHistoryEntries || 50) - 1)
1957
2385
  ]);
1958
2386
  }
1959
- }, [l, p, O, o, t.maxHistoryEntries, a]), Se = k(() => {
1960
- if (_.length === 0) return;
1961
- const g = v < _.length - 1 ? v + 1 : v;
1962
- S(g), _[g] && (b(_[g].query), f(_[g].query.startsWith("/") ? "quick-command" : "natural"));
1963
- }, [_, v]), ve = k(() => {
1964
- if (v <= 0) {
1965
- S(-1), b(""), f("natural");
2387
+ }, [c, g, G, o, t.maxHistoryEntries, i]), de = S(() => {
2388
+ if (L.length === 0) return;
2389
+ const m = w < L.length - 1 ? w + 1 : w;
2390
+ x(m), L[m] && (y(L[m].query), h(L[m].query.startsWith("/") ? "quick-command" : "natural"));
2391
+ }, [L, w]), ue = S(() => {
2392
+ if (w <= 0) {
2393
+ x(-1), y(""), h("natural");
1966
2394
  return;
1967
2395
  }
1968
- const g = v - 1;
1969
- S(g), _[g] && (b(_[g].query), f(_[g].query.startsWith("/") ? "quick-command" : "natural"));
1970
- }, [_, v]), re = k(
1971
- (g) => {
2396
+ const m = w - 1;
2397
+ x(m), L[m] && (y(L[m].query), h(L[m].query.startsWith("/") ? "quick-command" : "natural"));
2398
+ }, [L, w]), ie = S(
2399
+ (m) => {
1972
2400
  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))
2401
+ key: E = "p",
2402
+ altKey: M = !0,
2403
+ ctrlKey: Z = !1,
2404
+ metaKey: j = !1,
2405
+ shiftKey: q = !1
2406
+ } = e, B = m.altKey === M && m.ctrlKey === Z && m.metaKey === j && m.shiftKey === q;
2407
+ if ((M ? m.code === `Key${E.toUpperCase()}` : m.key.toLowerCase() === E.toLowerCase()) && B) {
2408
+ const re = m.target;
2409
+ if (!re.closest("[data-agent-command-palette-input]") && (re.tagName === "INPUT" || re.tagName === "TEXTAREA" || re.isContentEditable))
1982
2410
  return;
1983
- g.preventDefault(), X();
2411
+ m.preventDefault(), ae();
1984
2412
  }
1985
2413
  },
1986
- [e, X]
2414
+ [e, ae]
1987
2415
  );
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
2416
+ R(() => (window.addEventListener("keydown", ie), () => window.removeEventListener("keydown", ie)), [ie]);
2417
+ const Pe = S(() => {
2418
+ V && W(
2419
+ (m) => m < J - 1 ? m + 1 : 0
1992
2420
  );
1993
- }, [B, q.length]), Ce = k(() => {
1994
- B && z(
1995
- (g) => g > 0 ? g - 1 : q.length - 1
2421
+ }, [V, J]), We = S(() => {
2422
+ V && W(
2423
+ (m) => m > 0 ? m - 1 : J - 1
1996
2424
  );
1997
- }, [B, q.length]), Ie = k(() => {
1998
- if (!B || W < 0) return;
1999
- const g = q[W];
2000
- if (!g) return;
2001
- const A = g.command;
2002
- let E = `/${A.name}`;
2003
- A.args && A.args.length > 0 && (E += " "), b(E), z(-1);
2004
- }, [B, W, q]);
2425
+ }, [V, J]), _e = S(() => {
2426
+ var Z;
2427
+ if (!V || P < 0) return;
2428
+ if (A.isEnteringArgs) {
2429
+ const j = F[P];
2430
+ if (!j) return;
2431
+ let q = `/${A.commandName}`;
2432
+ for (const re of A.enteredArgs)
2433
+ q += ` ${re}`;
2434
+ q += ` ${j.option}`;
2435
+ const B = A.currentArgIndex + 1;
2436
+ ((Z = A.command) == null ? void 0 : Z.args) && B < A.command.args.length && (q += " "), y(q), W(-1);
2437
+ return;
2438
+ }
2439
+ const m = O[P];
2440
+ if (!m) return;
2441
+ const E = m.command;
2442
+ let M = `/${E.name}`;
2443
+ E.args && E.args.length > 0 && (M += " "), y(M), W(-1);
2444
+ }, [V, P, A, F, O]);
2005
2445
  return {
2006
2446
  // Agent availability
2007
- agentAvailable: a,
2447
+ agentAvailable: i,
2008
2448
  // Visibility
2009
- isOpen: c,
2010
- open: G,
2011
- close: J,
2012
- toggle: X,
2449
+ isOpen: n,
2450
+ open: se,
2451
+ close: te,
2452
+ toggle: ae,
2013
2453
  // Input
2014
- query: l,
2015
- setQuery: te,
2016
- mode: p,
2454
+ query: c,
2455
+ setQuery: ne,
2456
+ mode: g,
2017
2457
  // Execution
2018
- status: x,
2019
- setStatus: h,
2458
+ status: v,
2459
+ setStatus: u,
2020
2460
  pendingTools: d,
2021
2461
  completedTools: C,
2022
- agentResponse: $,
2462
+ agentResponse: z,
2023
2463
  setAgentResponse: I,
2024
- submit: Z,
2025
- executeQuickCommand: O,
2464
+ submit: X,
2465
+ executeQuickCommand: G,
2026
2466
  // Tool management (for external AI integration)
2027
- addPendingTool: j,
2028
- updateToolStatus: M,
2467
+ addPendingTool: U,
2468
+ updateToolStatus: D,
2029
2469
  // History
2030
- history: _,
2031
- historyPrevious: Se,
2032
- historyNext: ve,
2470
+ history: L,
2471
+ historyPrevious: de,
2472
+ historyNext: ue,
2033
2473
  // Suggestions
2034
2474
  suggestions: T,
2035
2475
  // Actions
2036
- clear: oe,
2476
+ clear: K,
2037
2477
  // Quick command autocomplete
2038
- quickCommandMatches: q,
2039
- selectedAutocompleteIndex: W,
2040
- autocompleteNext: Te,
2041
- autocompletePrevious: Ce,
2042
- autocompleteAccept: Ie,
2043
- showAutocomplete: B
2478
+ quickCommandMatches: O,
2479
+ argumentOptionMatches: F,
2480
+ parsedQuery: A,
2481
+ currentArgDef: ee,
2482
+ selectedAutocompleteIndex: P,
2483
+ autocompleteNext: Pe,
2484
+ autocompletePrevious: We,
2485
+ autocompleteAccept: _e,
2486
+ showAutocomplete: V
2044
2487
  };
2045
2488
  }
2046
- const fe = {
2489
+ const we = {
2047
2490
  name: "get_visible_panels",
2048
2491
  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
2492
  inputs: {
@@ -2112,7 +2555,7 @@ const fe = {
2112
2555
  call_template_type: "panel_event",
2113
2556
  event_type: "panel:get-visibility"
2114
2557
  }
2115
- }, he = {
2558
+ }, Se = {
2116
2559
  name: "get_panel_state",
2117
2560
  description: "Get the current state of a specific panel. Returns panel-specific state data if the panel supports state queries.",
2118
2561
  inputs: {
@@ -2144,7 +2587,7 @@ const fe = {
2144
2587
  call_template_type: "panel_event",
2145
2588
  event_type: "panel:get-state"
2146
2589
  }
2147
- }, ye = {
2590
+ }, ve = {
2148
2591
  name: "list_panels_with_state",
2149
2592
  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
2593
  inputs: {
@@ -2177,7 +2620,7 @@ const fe = {
2177
2620
  call_template_type: "panel_event",
2178
2621
  event_type: "panel:list-state-panels"
2179
2622
  }
2180
- }, ge = {
2623
+ }, Te = {
2181
2624
  name: "toggle_panel",
2182
2625
  description: "Collapse or expand a side panel to give more space to the main content area.",
2183
2626
  inputs: {
@@ -2204,7 +2647,7 @@ const fe = {
2204
2647
  call_template_type: "panel_event",
2205
2648
  event_type: "panel:toggle"
2206
2649
  }
2207
- }, me = {
2650
+ }, Ce = {
2208
2651
  name: "collapse_all_panels",
2209
2652
  description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
2210
2653
  inputs: {
@@ -2224,7 +2667,7 @@ const fe = {
2224
2667
  call_template_type: "panel_event",
2225
2668
  event_type: "panel:collapse-all"
2226
2669
  }
2227
- }, ke = {
2670
+ }, Ie = {
2228
2671
  name: "expand_all_panels",
2229
2672
  description: "Expand both left and right panels to show all content. Restores the default layout.",
2230
2673
  inputs: {
@@ -2244,7 +2687,7 @@ const fe = {
2244
2687
  call_template_type: "panel_event",
2245
2688
  event_type: "panel:expand-all"
2246
2689
  }
2247
- }, xe = {
2690
+ }, Ae = {
2248
2691
  name: "switch_panel",
2249
2692
  description: "Change which content is displayed in a panel slot (left, middle, or right).",
2250
2693
  inputs: {
@@ -2275,7 +2718,7 @@ const fe = {
2275
2718
  call_template_type: "panel_event",
2276
2719
  event_type: "panel:switch"
2277
2720
  }
2278
- }, be = {
2721
+ }, $e = {
2279
2722
  name: "focus_panel",
2280
2723
  description: "Set focus to a specific panel slot for keyboard navigation.",
2281
2724
  inputs: {
@@ -2301,7 +2744,7 @@ const fe = {
2301
2744
  call_template_type: "panel_event",
2302
2745
  event_type: "panel:focus"
2303
2746
  }
2304
- }, we = {
2747
+ }, ze = {
2305
2748
  name: "reset_layout",
2306
2749
  description: "Reset panel sizes to the default layout configuration.",
2307
2750
  inputs: {
@@ -2321,44 +2764,44 @@ const fe = {
2321
2764
  call_template_type: "panel_event",
2322
2765
  event_type: "panel:reset-layout"
2323
2766
  }
2324
- }, je = [
2767
+ }, He = [
2325
2768
  // State query tools
2326
- fe,
2327
- he,
2328
- ye,
2769
+ we,
2770
+ Se,
2771
+ ve,
2329
2772
  // Layout action tools
2330
- ge,
2331
- me,
2332
- ke,
2333
- xe,
2334
- be,
2335
- we
2336
- ], ct = [
2337
- fe,
2338
- he,
2339
- ye
2340
- ], dt = [
2341
- ge,
2342
- me,
2343
- ke,
2344
- xe,
2345
- be,
2346
- we
2347
- ], pt = {
2773
+ Te,
2774
+ Ce,
2775
+ Ie,
2776
+ Ae,
2777
+ $e,
2778
+ ze
2779
+ ], xt = [
2780
+ we,
2781
+ Se,
2782
+ ve
2783
+ ], kt = [
2784
+ Te,
2785
+ Ce,
2786
+ Ie,
2787
+ Ae,
2788
+ $e,
2789
+ ze
2790
+ ], bt = {
2348
2791
  id: "panel-layouts",
2349
2792
  name: "Panel Layouts",
2350
2793
  description: "Generic panel layout and state query operations",
2351
- tools: je
2794
+ tools: He
2352
2795
  };
2353
- function Me(o) {
2796
+ function Qe(o) {
2354
2797
  const e = {};
2355
2798
  if (o.inputs.properties)
2356
2799
  for (const [t, r] of Object.entries(o.inputs.properties)) {
2357
- const n = r;
2800
+ const s = r;
2358
2801
  e[t] = {
2359
- type: n.type || "string",
2360
- description: n.description,
2361
- ...n.enum && { enum: n.enum }
2802
+ type: s.type || "string",
2803
+ description: s.description,
2804
+ ...s.enum && { enum: s.enum }
2362
2805
  };
2363
2806
  }
2364
2807
  return {
@@ -2371,12 +2814,12 @@ function Me(o) {
2371
2814
  }
2372
2815
  };
2373
2816
  }
2374
- function ut(o) {
2817
+ function wt(o) {
2375
2818
  return {
2376
- functionDeclarations: o.map(Me)
2819
+ functionDeclarations: o.map(Qe)
2377
2820
  };
2378
2821
  }
2379
- function Oe(o) {
2822
+ function Je(o) {
2380
2823
  return {
2381
2824
  type: "function",
2382
2825
  function: {
@@ -2386,54 +2829,54 @@ function Oe(o) {
2386
2829
  }
2387
2830
  };
2388
2831
  }
2389
- function ft(o) {
2390
- return o.map(Oe);
2832
+ function St(o) {
2833
+ return o.map(Je);
2391
2834
  }
2392
- function Fe(o) {
2835
+ function Ue(o) {
2393
2836
  return {
2394
2837
  name: o.name,
2395
2838
  description: o.description,
2396
2839
  input_schema: o.inputs
2397
2840
  };
2398
2841
  }
2399
- function ht(o) {
2400
- return o.map(Fe);
2842
+ function vt(o) {
2843
+ return o.map(Ue);
2401
2844
  }
2402
- function Ne(o) {
2845
+ function Ge(o) {
2403
2846
  return {
2404
2847
  name: o.name,
2405
2848
  description: o.description,
2406
2849
  parameters: o.inputs
2407
2850
  };
2408
2851
  }
2409
- function yt(o) {
2410
- return o.map(Ne);
2852
+ function Tt(o) {
2853
+ return o.map(Ge);
2411
2854
  }
2412
- function gt(o, e = {}) {
2855
+ function Ct(o, e = {}) {
2413
2856
  const {
2414
2857
  header: t = "You have access to the following tools:",
2415
2858
  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}`;
2859
+ } = e, s = o.map((i) => {
2860
+ let l = `- ${i.name}: ${i.description}`;
2861
+ if (r && i.inputs.properties) {
2862
+ const n = Object.entries(i.inputs.properties).map(([f, c]) => {
2863
+ var h;
2864
+ const y = c, g = (h = i.inputs.required) != null && h.includes(f) ? " (required)" : "";
2865
+ return ` - ${f}: ${y.description || y.type}${g}`;
2423
2866
  }).join(`
2424
2867
  `);
2425
- c && (i += `
2426
- ${c}`);
2868
+ n && (l += `
2869
+ ${n}`);
2427
2870
  }
2428
- return i;
2871
+ return l;
2429
2872
  });
2430
2873
  return `${t}
2431
2874
 
2432
- ${n.join(`
2875
+ ${s.join(`
2433
2876
 
2434
2877
  `)}`;
2435
2878
  }
2436
- const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2879
+ const Ye = ({ size: o = 18 }) => /* @__PURE__ */ k(
2437
2880
  "svg",
2438
2881
  {
2439
2882
  width: o,
@@ -2445,11 +2888,11 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2445
2888
  strokeLinecap: "round",
2446
2889
  strokeLinejoin: "round",
2447
2890
  children: [
2448
- /* @__PURE__ */ s("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2449
- /* @__PURE__ */ s("path", { d: "M9 3v18" })
2891
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2892
+ /* @__PURE__ */ a("path", { d: "M9 3v18" })
2450
2893
  ]
2451
2894
  }
2452
- ), Ve = ({ size: o = 18 }) => /* @__PURE__ */ m(
2895
+ ), Xe = ({ size: o = 18 }) => /* @__PURE__ */ k(
2453
2896
  "svg",
2454
2897
  {
2455
2898
  width: o,
@@ -2461,12 +2904,12 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2461
2904
  strokeLinecap: "round",
2462
2905
  strokeLinejoin: "round",
2463
2906
  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" })
2907
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2908
+ /* @__PURE__ */ a("path", { d: "M9 3v18" }),
2909
+ /* @__PURE__ */ a("path", { d: "m16 15-3-3 3-3" })
2467
2910
  ]
2468
2911
  }
2469
- ), Ke = ({ size: o = 18 }) => /* @__PURE__ */ m(
2912
+ ), Ze = ({ size: o = 18 }) => /* @__PURE__ */ k(
2470
2913
  "svg",
2471
2914
  {
2472
2915
  width: o,
@@ -2478,11 +2921,11 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2478
2921
  strokeLinecap: "round",
2479
2922
  strokeLinejoin: "round",
2480
2923
  children: [
2481
- /* @__PURE__ */ s("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2482
- /* @__PURE__ */ s("path", { d: "M15 3v18" })
2924
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2925
+ /* @__PURE__ */ a("path", { d: "M15 3v18" })
2483
2926
  ]
2484
2927
  }
2485
- ), He = ({ size: o = 18 }) => /* @__PURE__ */ m(
2928
+ ), et = ({ size: o = 18 }) => /* @__PURE__ */ k(
2486
2929
  "svg",
2487
2930
  {
2488
2931
  width: o,
@@ -2494,32 +2937,32 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2494
2937
  strokeLinecap: "round",
2495
2938
  strokeLinejoin: "round",
2496
2939
  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" })
2940
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2941
+ /* @__PURE__ */ a("path", { d: "M15 3v18" }),
2942
+ /* @__PURE__ */ a("path", { d: "m8 9 3 3-3 3" })
2500
2943
  ]
2501
2944
  }
2502
- ), ie = ({
2945
+ ), he = ({
2503
2946
  isCollapsed: o,
2504
2947
  onToggle: e,
2505
2948
  side: t = "left",
2506
2949
  iconSize: r = 18,
2507
- style: n,
2508
- shortcutHint: a = "Cmd/Ctrl+B",
2509
- title: i,
2510
- className: c
2950
+ style: s,
2951
+ shortcutHint: i = "Cmd/Ctrl+B",
2952
+ title: l,
2953
+ className: n
2511
2954
  }) => {
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(
2955
+ const { theme: f } = Q(), c = () => t === "right" ? o ? /* @__PURE__ */ a(Ze, { size: r }) : /* @__PURE__ */ a(et, { size: r }) : o ? /* @__PURE__ */ a(Ye, { size: r }) : /* @__PURE__ */ a(Xe, { size: r });
2956
+ return /* @__PURE__ */ a(
2514
2957
  "button",
2515
2958
  {
2516
2959
  onClick: e,
2517
- title: i ?? `${o ? "Show" : "Hide"} ${t === "right" ? "Right Panel" : "Sidebar"}${a ? ` (${a})` : ""}`,
2518
- className: c,
2960
+ title: l ?? `${o ? "Show" : "Hide"} ${t === "right" ? "Right Panel" : "Sidebar"}${i ? ` (${i})` : ""}`,
2961
+ className: n,
2519
2962
  style: {
2520
2963
  background: "transparent",
2521
2964
  border: "none",
2522
- color: o ? y.colors.textSecondary : y.colors.primary,
2965
+ color: o ? f.colors.textSecondary : f.colors.primary,
2523
2966
  cursor: "pointer",
2524
2967
  padding: "6px",
2525
2968
  borderRadius: "4px",
@@ -2529,18 +2972,18 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2529
2972
  transition: "all 0.2s",
2530
2973
  width: "32px",
2531
2974
  height: "32px",
2532
- ...n
2975
+ ...s
2533
2976
  },
2534
- onMouseEnter: (p) => {
2535
- p.currentTarget.style.backgroundColor = y.colors.backgroundTertiary, p.currentTarget.style.color = y.colors.primary;
2977
+ onMouseEnter: (g) => {
2978
+ g.currentTarget.style.backgroundColor = f.colors.backgroundTertiary, g.currentTarget.style.color = f.colors.primary;
2536
2979
  },
2537
- onMouseLeave: (p) => {
2538
- p.currentTarget.style.backgroundColor = "transparent", p.currentTarget.style.color = o ? y.colors.textSecondary : y.colors.primary;
2980
+ onMouseLeave: (g) => {
2981
+ g.currentTarget.style.backgroundColor = "transparent", g.currentTarget.style.color = o ? f.colors.textSecondary : f.colors.primary;
2539
2982
  },
2540
- children: l()
2983
+ children: c()
2541
2984
  }
2542
2985
  );
2543
- }, Qe = ({ size: o = 14 }) => /* @__PURE__ */ m(
2986
+ }, tt = ({ size: o = 14 }) => /* @__PURE__ */ k(
2544
2987
  "svg",
2545
2988
  {
2546
2989
  width: o,
@@ -2552,13 +2995,13 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2552
2995
  strokeLinecap: "round",
2553
2996
  strokeLinejoin: "round",
2554
2997
  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" })
2998
+ /* @__PURE__ */ a("path", { d: "M8 3 4 7l4 4" }),
2999
+ /* @__PURE__ */ a("path", { d: "M4 7h16" }),
3000
+ /* @__PURE__ */ a("path", { d: "m16 21 4-4-4-4" }),
3001
+ /* @__PURE__ */ a("path", { d: "M20 17H4" })
2559
3002
  ]
2560
3003
  }
2561
- ), Je = ({ size: o = 14 }) => /* @__PURE__ */ m(
3004
+ ), ot = ({ size: o = 14 }) => /* @__PURE__ */ k(
2562
3005
  "svg",
2563
3006
  {
2564
3007
  width: o,
@@ -2570,31 +3013,31 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2570
3013
  strokeLinecap: "round",
2571
3014
  strokeLinejoin: "round",
2572
3015
  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" })
3016
+ /* @__PURE__ */ a("path", { d: "m16 3 4 4-4 4" }),
3017
+ /* @__PURE__ */ a("path", { d: "M20 7H4" }),
3018
+ /* @__PURE__ */ a("path", { d: "m8 21-4-4 4-4" }),
3019
+ /* @__PURE__ */ a("path", { d: "M4 17h16" })
2577
3020
  ]
2578
3021
  }
2579
- ), le = ({
3022
+ ), ye = ({
2580
3023
  onSwitch: o,
2581
3024
  variant: e = "left-middle",
2582
3025
  iconSize: t = 14,
2583
3026
  style: r,
2584
- title: n,
2585
- className: a
3027
+ title: s,
3028
+ className: i
2586
3029
  }) => {
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(
3030
+ const { theme: l } = Q(), n = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", f = e === "left-middle" ? tt : ot;
3031
+ return /* @__PURE__ */ a(
2589
3032
  "button",
2590
3033
  {
2591
3034
  onClick: o,
2592
- title: n ?? c(),
2593
- className: a,
3035
+ title: s ?? n(),
3036
+ className: i,
2594
3037
  style: {
2595
3038
  background: "transparent",
2596
3039
  border: "none",
2597
- color: i.colors.textSecondary,
3040
+ color: l.colors.textSecondary,
2598
3041
  cursor: "pointer",
2599
3042
  padding: "6px",
2600
3043
  borderRadius: "4px",
@@ -2606,16 +3049,16 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2606
3049
  height: "32px",
2607
3050
  ...r
2608
3051
  },
2609
- onMouseEnter: (l) => {
2610
- l.currentTarget.style.backgroundColor = i.colors.backgroundTertiary, l.currentTarget.style.color = i.colors.text;
3052
+ onMouseEnter: (c) => {
3053
+ c.currentTarget.style.backgroundColor = l.colors.backgroundTertiary, c.currentTarget.style.color = l.colors.text;
2611
3054
  },
2612
- onMouseLeave: (l) => {
2613
- l.currentTarget.style.backgroundColor = "transparent", l.currentTarget.style.color = i.colors.textSecondary;
3055
+ onMouseLeave: (c) => {
3056
+ c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = l.colors.textSecondary;
2614
3057
  },
2615
- children: /* @__PURE__ */ s(y, { size: t })
3058
+ children: /* @__PURE__ */ a(f, { size: t })
2616
3059
  }
2617
3060
  );
2618
- }, Ue = ({ size: o = 14 }) => /* @__PURE__ */ m(
3061
+ }, rt = ({ size: o = 14 }) => /* @__PURE__ */ k(
2619
3062
  "svg",
2620
3063
  {
2621
3064
  width: o,
@@ -2627,29 +3070,29 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2627
3070
  strokeLinecap: "round",
2628
3071
  strokeLinejoin: "round",
2629
3072
  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" })
3073
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
3074
+ /* @__PURE__ */ a("path", { d: "M3 9h18" }),
3075
+ /* @__PURE__ */ a("path", { d: "M9 21V9" })
2633
3076
  ]
2634
3077
  }
2635
- ), Ge = ({
3078
+ ), nt = ({
2636
3079
  onConfigure: o,
2637
3080
  iconSize: e = 14,
2638
3081
  style: t,
2639
3082
  title: r = "Configure panel layout",
2640
- className: n
3083
+ className: s
2641
3084
  }) => {
2642
- const { theme: a } = H();
2643
- return /* @__PURE__ */ s(
3085
+ const { theme: i } = Q();
3086
+ return /* @__PURE__ */ a(
2644
3087
  "button",
2645
3088
  {
2646
3089
  onClick: o,
2647
3090
  title: r,
2648
- className: n,
3091
+ className: s,
2649
3092
  style: {
2650
3093
  background: "transparent",
2651
3094
  border: "none",
2652
- color: a.colors.textSecondary,
3095
+ color: i.colors.textSecondary,
2653
3096
  cursor: "pointer",
2654
3097
  padding: "6px",
2655
3098
  borderRadius: "4px",
@@ -2661,89 +3104,89 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2661
3104
  height: "32px",
2662
3105
  ...t
2663
3106
  },
2664
- onMouseEnter: (i) => {
2665
- i.currentTarget.style.backgroundColor = a.colors.backgroundTertiary, i.currentTarget.style.color = a.colors.text;
3107
+ onMouseEnter: (l) => {
3108
+ l.currentTarget.style.backgroundColor = i.colors.backgroundTertiary, l.currentTarget.style.color = i.colors.text;
2666
3109
  },
2667
- onMouseLeave: (i) => {
2668
- i.currentTarget.style.backgroundColor = "transparent", i.currentTarget.style.color = a.colors.textSecondary;
3110
+ onMouseLeave: (l) => {
3111
+ l.currentTarget.style.backgroundColor = "transparent", l.currentTarget.style.color = i.colors.textSecondary;
2669
3112
  },
2670
- children: /* @__PURE__ */ s(Ue, { size: e })
3113
+ children: /* @__PURE__ */ a(rt, { size: e })
2671
3114
  }
2672
3115
  );
2673
- }, mt = ({
3116
+ }, It = ({
2674
3117
  leftSidebarCollapsed: o = !1,
2675
3118
  onToggleLeftSidebar: e,
2676
3119
  showLeftSidebarControl: t = !1,
2677
3120
  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,
3121
+ onToggleRightSidebar: s,
3122
+ showRightSidebarControl: i = !1,
3123
+ onSwitchLeftMiddlePanels: l,
3124
+ showSwitchLeftMiddle: n = !1,
3125
+ onSwitchRightMiddlePanels: f,
3126
+ showSwitchRightMiddle: c = !1,
3127
+ onConfigurePanels: y,
3128
+ showConfigureButton: g = !1,
3129
+ gap: h = 4,
3130
+ style: v,
3131
+ className: u,
2689
3132
  iconSize: d,
2690
- leftCollapseButtonProps: u,
3133
+ leftCollapseButtonProps: p,
2691
3134
  rightCollapseButtonProps: C,
2692
- leftMiddleSwitchButtonProps: L,
2693
- rightMiddleSwitchButtonProps: $,
3135
+ leftMiddleSwitchButtonProps: $,
3136
+ rightMiddleSwitchButtonProps: z,
2694
3137
  configureButtonProps: I
2695
- }) => t && e || c && i || p && b || l && y || a && n ? /* @__PURE__ */ m(
3138
+ }) => t && e || n && l || g && y || c && f || i && s ? /* @__PURE__ */ k(
2696
3139
  "div",
2697
3140
  {
2698
- className: h,
3141
+ className: u,
2699
3142
  style: {
2700
3143
  display: "flex",
2701
3144
  alignItems: "center",
2702
- gap: `${f}px`,
2703
- ...x
3145
+ gap: `${h}px`,
3146
+ ...v
2704
3147
  },
2705
3148
  children: [
2706
- t && e && /* @__PURE__ */ s(
2707
- ie,
3149
+ t && e && /* @__PURE__ */ a(
3150
+ he,
2708
3151
  {
2709
3152
  isCollapsed: o,
2710
3153
  onToggle: e,
2711
3154
  side: "left",
2712
3155
  iconSize: d ?? 18,
2713
- ...u
3156
+ ...p
2714
3157
  }
2715
3158
  ),
2716
- c && i && /* @__PURE__ */ s(
2717
- le,
3159
+ n && l && /* @__PURE__ */ a(
3160
+ ye,
2718
3161
  {
2719
- onSwitch: i,
3162
+ onSwitch: l,
2720
3163
  variant: "left-middle",
2721
3164
  iconSize: d ?? 14,
2722
- ...L
3165
+ ...$
2723
3166
  }
2724
3167
  ),
2725
- p && b && /* @__PURE__ */ s(
2726
- Ge,
3168
+ g && y && /* @__PURE__ */ a(
3169
+ nt,
2727
3170
  {
2728
- onConfigure: b,
3171
+ onConfigure: y,
2729
3172
  iconSize: d ?? 14,
2730
3173
  ...I
2731
3174
  }
2732
3175
  ),
2733
- l && y && /* @__PURE__ */ s(
2734
- le,
3176
+ c && f && /* @__PURE__ */ a(
3177
+ ye,
2735
3178
  {
2736
- onSwitch: y,
3179
+ onSwitch: f,
2737
3180
  variant: "right-middle",
2738
3181
  iconSize: d ?? 14,
2739
- ...$
3182
+ ...z
2740
3183
  }
2741
3184
  ),
2742
- a && n && /* @__PURE__ */ s(
2743
- ie,
3185
+ i && s && /* @__PURE__ */ a(
3186
+ he,
2744
3187
  {
2745
3188
  isCollapsed: r,
2746
- onToggle: n,
3189
+ onToggle: s,
2747
3190
  side: "right",
2748
3191
  iconSize: d ?? 18,
2749
3192
  ...C
@@ -2753,52 +3196,53 @@ const Be = ({ size: o = 18 }) => /* @__PURE__ */ m(
2753
3196
  }
2754
3197
  ) : null;
2755
3198
  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
3199
+ me as AgentCommandInput,
3200
+ Oe as AgentCommandPalette,
3201
+ ke as AgentResponseDisplay,
3202
+ zt as EditableConfigurablePanelLayout,
3203
+ ht as FocusIndicator,
3204
+ yt as FocusModeOverlay,
3205
+ Re as LocalStoragePersistenceAdapter,
3206
+ De as LocalStorageWorkspaceAdapter,
3207
+ he as PanelCollapseButton,
3208
+ nt as PanelConfigureButton,
3209
+ It as PanelControls,
3210
+ ye as PanelSwitchButton,
3211
+ be as QuickCommandAutocomplete,
3212
+ Pt as ResponsiveConfigurablePanelLayout,
3213
+ xe as ToolExecutionList,
3214
+ N as WorkspaceLayoutService,
3215
+ Ce as collapseAllPanelsTool,
3216
+ Ie as expandAllPanelsTool,
3217
+ $e as focusPanelTool,
3218
+ pe as fuzzyMatch,
3219
+ Ct as generateToolsSystemPrompt,
3220
+ Se as getPanelStateTool,
3221
+ we as getVisiblePanelsTool,
3222
+ kt as layoutActionTools,
3223
+ He as layoutTools,
3224
+ bt as layoutToolsMetadata,
3225
+ ve as listPanelsWithStateTool,
3226
+ Wt as mapThemeToPanelVars,
3227
+ _t as mapThemeToTabVars,
3228
+ ze as resetLayoutTool,
3229
+ Fe as searchQuickCommands,
3230
+ xt as stateQueryTools,
3231
+ Ae as switchPanelTool,
3232
+ Te as togglePanelTool,
3233
+ Ge as toolToAIFunction,
3234
+ Ue as toolToAnthropicFormat,
3235
+ Qe as toolToGeminiFunction,
3236
+ Je as toolToOpenAIFunction,
3237
+ Tt as toolsToAIFunctions,
3238
+ vt as toolsToAnthropicFormat,
3239
+ wt as toolsToGeminiFormat,
3240
+ St as toolsToOpenAIFormat,
3241
+ mt as useAgentCommandPalette,
3242
+ ut as usePanelFocus,
3243
+ gt as usePanelFocusListener,
3244
+ ft as usePanelKeyboardShortcuts,
3245
+ dt as usePanelPersistence,
3246
+ pt as useWorkspace
2803
3247
  };
2804
3248
  //# sourceMappingURL=index.esm.js.map