@mechane-ai/elements 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ai.js CHANGED
@@ -1,73 +1,148 @@
1
- import { D as e, E as t, T as n, _ as r, k as i, m as a, p as o, t as s, w as c } from "./src-E3Or8tkO.js";
2
- import { t as l } from "./content-link-5oRGjDHa.js";
3
- import { r as u, t as d } from "./src-d7EAi61b.js";
4
- import { c as f, d as p } from "./src-eWcNz_oB.js";
5
- import { c as m, u as h } from "./src-BfPaaDxg.js";
6
- import { t as g } from "./accessibility-C-aIZ1Yx.js";
7
- import { t as _ } from "./visible-motion-1GcUaEi4.js";
8
- import * as v from "@stylexjs/stylex";
9
- import { createContext as y, useContext as b, useEffect as x, useId as S, useLayoutEffect as C, useRef as w, useState as T } from "react";
10
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
11
- import { ArrowDown as O, ArrowUp as ee, File as k, GitBranch as A, Square as j } from "lucide-react";
12
- import { MessageScroller as M, useMessageScroller as N, useMessageScrollerScrollable as P } from "@shadcn/react/message-scroller";
1
+ import { D as e, E as t, T as n, _ as r, i, k as a, m as o, p as s, t as c, w as l } from "./src-E3Or8tkO.js";
2
+ import { t as u } from "./code-block-BX51BVe1.js";
3
+ import { a as d } from "./src-DlNMCgVy.js";
4
+ import { t as f } from "./content-link-5oRGjDHa.js";
5
+ import { r as p, t as m } from "./src-d7EAi61b.js";
6
+ import { c as h, d as g } from "./src-eWcNz_oB.js";
7
+ import { c as _, u as ee } from "./src-BfPaaDxg.js";
8
+ import { t as v } from "./accessibility-C-aIZ1Yx.js";
9
+ import { t as y } from "./visible-motion-1GcUaEi4.js";
10
+ import * as b from "@stylexjs/stylex";
11
+ import { createContext as x, useContext as S, useEffect as C, useId as w, useLayoutEffect as T, useRef as E, useState as D } from "react";
12
+ import { jsx as O, jsxs as k } from "react/jsx-runtime";
13
+ import { ArrowDown as A, ArrowUp as j, File as M, GitBranch as N, Square as te, Terminal as P } from "lucide-react";
14
+ import { MessageScroller as F, useMessageScroller as I, useMessageScrollerScrollable as L } from "@shadcn/react/message-scroller";
13
15
  // packages/ai/src/approval.tsx
14
- function F(e) {
15
- return /* @__PURE__ */ D("section", {
16
+ function R(e) {
17
+ return /* @__PURE__ */ k("section", {
16
18
  "aria-label": e.title,
17
19
  "data-request-id": e.requestId,
18
20
  className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
19
21
  children: [
20
- /* @__PURE__ */ E("h3", {
22
+ /* @__PURE__ */ O("h3", {
21
23
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
22
24
  children: e.title
23
25
  }),
24
- e.description !== void 0 && /* @__PURE__ */ E("p", {
26
+ e.description !== void 0 && /* @__PURE__ */ O("p", {
25
27
  className: "x1ghz6dp x153jb6y xj0a0fe",
26
28
  children: e.description
27
29
  }),
28
30
  e.children,
29
- e.status === "pending" ? /* @__PURE__ */ D(o, { children: [/* @__PURE__ */ E(c, {
31
+ e.status === "pending" ? /* @__PURE__ */ k(s, { children: [/* @__PURE__ */ O(l, {
30
32
  variant: "solid",
31
33
  onClick: e.onApprove,
32
34
  disabled: e.isDisabled === !0 || e.busy !== void 0,
33
35
  isPending: e.busy === "approve",
34
36
  pendingLabel: "Approving…",
35
37
  children: e.approveLabel ?? "Approve"
36
- }), /* @__PURE__ */ E(c, {
38
+ }), /* @__PURE__ */ O(l, {
37
39
  onClick: e.onDeny,
38
40
  disabled: e.isDisabled === !0 || e.busy !== void 0,
39
41
  isPending: e.busy === "deny",
40
42
  pendingLabel: "Denying…",
41
43
  children: e.denyLabel ?? "Deny"
42
- })] }) : /* @__PURE__ */ E(s, { children: e.statusLabel })
44
+ })] }) : /* @__PURE__ */ O(c, { children: e.statusLabel })
43
45
  ]
44
46
  });
45
47
  }
48
+ // packages/ai/src/command-details.tsx
49
+ function z({ command: e, output: t, commandNotice: n, outputNotice: r, outputLanguage: a, isRunning: s = !1 }) {
50
+ return /* @__PURE__ */ k(o, {
51
+ isCompact: !0,
52
+ children: [
53
+ e === "" && n !== void 0 ? /* @__PURE__ */ O(i, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ O(i, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ O(u, {
54
+ code: e,
55
+ language: "bash",
56
+ filename: "Command",
57
+ variant: "embedded",
58
+ showLineNumbers: !1,
59
+ shouldWrap: !0,
60
+ maxHeight: 240
61
+ }),
62
+ n !== void 0 && /* @__PURE__ */ O(i, { children: n }),
63
+ t === void 0 || t.length === 0 ? /* @__PURE__ */ O(i, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : r === void 0 ? "No output." : "Output omitted from this preview." }) : a === void 0 ? /* @__PURE__ */ O(d, {
64
+ output: t,
65
+ label: "Output",
66
+ variant: "embedded",
67
+ isRunning: s
68
+ }) : /* @__PURE__ */ O(u, {
69
+ code: t,
70
+ language: a,
71
+ filename: "Output",
72
+ variant: "embedded",
73
+ showLineNumbers: !1,
74
+ shouldWrap: !0,
75
+ isStreaming: s,
76
+ maxHeight: 320
77
+ }),
78
+ r !== void 0 && /* @__PURE__ */ O(i, { children: r })
79
+ ]
80
+ });
81
+ }
82
+ // packages/ai/src/command-activity.tsx
83
+ var B = {
84
+ pending: "Preparing",
85
+ running: "Running",
86
+ complete: "",
87
+ failed: "Failed",
88
+ stopped: "Stopped",
89
+ unknown: "Outcome unknown"
90
+ }, V = /* @__PURE__ */ new Set(["pending", "running"]);
91
+ function H({ status: e, ...t }) {
92
+ let n = t.command?.trim().split(/\r\n|\n|\r/u)[0], i = n === void 0 || n.length === 0 ? "Command" : n;
93
+ return /* @__PURE__ */ k(r.Root, {
94
+ defaultOpen: !1,
95
+ children: [/* @__PURE__ */ O(r.Trigger, {
96
+ variant: "inline",
97
+ children: /* @__PURE__ */ k("span", {
98
+ className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
99
+ children: [
100
+ /* @__PURE__ */ O(P, {
101
+ size: 14,
102
+ "aria-hidden": !0,
103
+ className: "x2lah0s"
104
+ }),
105
+ /* @__PURE__ */ O("span", {
106
+ className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
107
+ children: i
108
+ }),
109
+ B[e].length > 0 && /* @__PURE__ */ O("span", {
110
+ className: "x2lah0s xy8obcc x153jb6y",
111
+ children: B[e]
112
+ })
113
+ ]
114
+ })
115
+ }), /* @__PURE__ */ O(r.Panel, { children: /* @__PURE__ */ O(z, {
116
+ ...t,
117
+ isRunning: V.has(e)
118
+ }) })]
119
+ });
120
+ }
46
121
  // packages/ai/src/conversation.tsx
47
- var I = y(void 0);
48
- function L({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
49
- let i = w(null), a = r ?? i, [o] = T(t);
50
- return C(() => {
122
+ var U = x(void 0);
123
+ function W({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
124
+ let i = E(null), a = r ?? i, [o] = D(t);
125
+ return T(() => {
51
126
  typeof o == "object" && a.current?.scrollTo({
52
127
  top: o.top,
53
128
  left: o.left ?? 0,
54
129
  behavior: "instant"
55
130
  });
56
- }, [o, a]), /* @__PURE__ */ E(I.Provider, {
131
+ }, [o, a]), /* @__PURE__ */ O(U.Provider, {
57
132
  value: a,
58
- children: /* @__PURE__ */ E(M.Provider, {
133
+ children: /* @__PURE__ */ O(F.Provider, {
59
134
  autoScroll: n,
60
135
  defaultScrollPosition: typeof o == "object" ? "start" : o,
61
- children: /* @__PURE__ */ E(M.Root, {
136
+ children: /* @__PURE__ */ O(F.Root, {
62
137
  className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
63
138
  children: e
64
139
  })
65
140
  })
66
141
  });
67
142
  }
68
- function R({ label: e, children: t, scrollRestorationId: n }) {
69
- let r = b(I);
70
- return /* @__PURE__ */ E(M.Viewport, {
143
+ function G({ label: e, children: t, scrollRestorationId: n }) {
144
+ let r = S(U);
145
+ return /* @__PURE__ */ O(F.Viewport, {
71
146
  ref: r,
72
147
  "aria-label": e,
73
148
  "data-scroll-restoration-id": n,
@@ -75,8 +150,8 @@ function R({ label: e, children: t, scrollRestorationId: n }) {
75
150
  children: t
76
151
  });
77
152
  }
78
- function z({ children: e, isStreaming: t = !1 }) {
79
- return /* @__PURE__ */ E(M.Content, {
153
+ function K({ children: e, isStreaming: t = !1 }) {
154
+ return /* @__PURE__ */ O(F.Content, {
80
155
  "aria-live": "polite",
81
156
  "aria-relevant": "additions",
82
157
  "aria-busy": t,
@@ -84,57 +159,57 @@ function z({ children: e, isStreaming: t = !1 }) {
84
159
  children: e
85
160
  });
86
161
  }
87
- function B({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
88
- let { scrollToEnd: r } = N();
89
- return C(() => {
162
+ function q({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
163
+ let { scrollToEnd: r } = I();
164
+ return T(() => {
90
165
  t && r({ behavior: "instant" });
91
166
  }, [
92
167
  e,
93
168
  t,
94
169
  r
95
- ]), /* @__PURE__ */ E(M.Item, {
170
+ ]), /* @__PURE__ */ O(F.Item, {
96
171
  messageId: e,
97
172
  className: "xeuugli xj0a0fe",
98
173
  children: n
99
174
  });
100
175
  }
101
- function V({ children: e }) {
102
- return /* @__PURE__ */ E("div", {
176
+ function J({ children: e }) {
177
+ return /* @__PURE__ */ O("div", {
103
178
  className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
104
179
  children: e
105
180
  });
106
181
  }
107
- function H({ label: e = "Jump to latest" }) {
108
- let { end: t } = P();
109
- return t ? /* @__PURE__ */ E("div", {
182
+ function Y({ label: e = "Jump to latest" }) {
183
+ let { end: t } = L();
184
+ return t ? /* @__PURE__ */ O("div", {
110
185
  className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
111
- children: /* @__PURE__ */ E(U, { label: e })
186
+ children: /* @__PURE__ */ O(X, { label: e })
112
187
  }) : null;
113
188
  }
114
- function U({ label: e, onActivate: t }) {
115
- let { scrollToEnd: n } = N(), r = b(I);
116
- return /* @__PURE__ */ D(c, {
189
+ function X({ label: e, onActivate: t }) {
190
+ let { scrollToEnd: n } = I(), r = S(U);
191
+ return /* @__PURE__ */ k(l, {
117
192
  onClick: () => {
118
193
  t?.(), requestAnimationFrame(() => {
119
194
  let e = r?.current;
120
195
  e != null && (n({ behavior: "instant" }), e.focus({ preventScroll: !0 }));
121
196
  });
122
197
  },
123
- children: [/* @__PURE__ */ E(O, {
198
+ children: [/* @__PURE__ */ O(A, {
124
199
  size: 14,
125
200
  "aria-hidden": !0
126
201
  }), e]
127
202
  });
128
203
  }
129
- var W = {
130
- Root: L,
131
- Viewport: R,
132
- Content: z,
133
- Item: B,
134
- Controls: V,
135
- LatestButton: U,
136
- JumpToLatest: H
137
- }, G = {
204
+ var Z = {
205
+ Root: W,
206
+ Viewport: G,
207
+ Content: K,
208
+ Item: q,
209
+ Controls: J,
210
+ LatestButton: X,
211
+ JumpToLatest: Y
212
+ }, Q = {
138
213
  root: {
139
214
  k1xSpc: "x78zum5",
140
215
  kXwgrk: "xdt5ytf",
@@ -171,77 +246,80 @@ var W = {
171
246
  k8WAf4: "xn9t2bk",
172
247
  $$css: !0
173
248
  }
174
- }, K = {
175
- user: G.user,
176
- assistant: G.assistant,
177
- system: G.system
178
- }, q = {
179
- user: G.bubble,
180
- assistant: G.chatReply,
249
+ }, ne = {
250
+ user: Q.user,
251
+ assistant: Q.assistant,
252
+ system: Q.system
253
+ }, re = {
254
+ user: Q.bubble,
255
+ assistant: Q.chatReply,
181
256
  system: null
182
- }, J = {
257
+ }, ie = {
183
258
  "x-default-marker": "x-default-marker",
184
259
  $$css: !0
185
260
  };
186
- function Y({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default" }) {
187
- let l = c === "chat", u = !l || a !== void 0 || i !== void 0 ? /* @__PURE__ */ D("header", {
261
+ function ae({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default" }) {
262
+ let l = c === "chat", u = !l || a !== void 0 || i !== void 0, d = l && r === "assistant", f = u ? /* @__PURE__ */ k("header", {
188
263
  className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
189
264
  children: [
190
- a !== void 0 && /* @__PURE__ */ E("span", {
265
+ a !== void 0 && /* @__PURE__ */ O("span", {
191
266
  className: "x3nfvp2 x2lah0s",
192
267
  children: a
193
268
  }),
194
- /* @__PURE__ */ E("span", {
269
+ /* @__PURE__ */ O("span", {
195
270
  className: "xk4h15q xeuugli xj0a0fe",
196
271
  children: e
197
272
  }),
198
- i !== void 0 && /* @__PURE__ */ E("div", {
273
+ i !== void 0 && /* @__PURE__ */ O("div", {
199
274
  className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
200
275
  children: i
201
276
  })
202
277
  ]
203
278
  }) : null;
204
- return /* @__PURE__ */ D("article", {
279
+ return /* @__PURE__ */ k("article", {
205
280
  id: n,
206
281
  "aria-label": e,
207
- ...v.props(G.root, K[r], l && q[r], J),
282
+ ...b.props(Q.root, ne[r], l && re[r], ie),
208
283
  children: [
209
- u,
210
- /* @__PURE__ */ E("div", {
284
+ f,
285
+ /* @__PURE__ */ O("div", {
211
286
  className: "xeuugli xj0a0fe x1ytb0s6",
212
287
  children: t
213
288
  }),
214
- s !== void 0 && /* @__PURE__ */ E("div", {
289
+ s !== void 0 && /* @__PURE__ */ O("div", {
215
290
  className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
216
291
  children: s
217
292
  }),
218
- o !== void 0 && /* @__PURE__ */ E("footer", {
219
- className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b",
293
+ (o !== void 0 || d) && /* @__PURE__ */ O("footer", {
294
+ ...{
295
+ 0: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b" },
296
+ 1: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b x17tes2r x17oiadl" }
297
+ }[!!d | 0],
220
298
  children: o
221
299
  })
222
300
  ]
223
301
  });
224
302
  }
225
- function X({ name: e, description: t, href: n, actions: r }) {
226
- return /* @__PURE__ */ D("div", {
303
+ function oe({ name: e, description: t, href: n, actions: r }) {
304
+ return /* @__PURE__ */ k("div", {
227
305
  className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
228
306
  children: [
229
- /* @__PURE__ */ E(k, {
307
+ /* @__PURE__ */ O(M, {
230
308
  size: 16,
231
309
  "aria-hidden": !0,
232
310
  className: "x153jb6y x2lah0s"
233
311
  }),
234
- /* @__PURE__ */ D("div", {
312
+ /* @__PURE__ */ k("div", {
235
313
  className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
236
- children: [n === void 0 ? /* @__PURE__ */ E("span", { children: e }) : /* @__PURE__ */ E(l, {
314
+ children: [n === void 0 ? /* @__PURE__ */ O("span", { children: e }) : /* @__PURE__ */ O(f, {
237
315
  href: n,
238
316
  children: e
239
- }), t !== void 0 && /* @__PURE__ */ E("span", {
317
+ }), t !== void 0 && /* @__PURE__ */ O("span", {
240
318
  className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
241
319
  children: t
242
320
  })]
243
321
  }),
244
- r !== void 0 && /* @__PURE__ */ E("div", {
322
+ r !== void 0 && /* @__PURE__ */ O("div", {
245
323
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
246
324
  children: r
247
325
  })
@@ -249,39 +327,39 @@ function X({ name: e, description: t, href: n, actions: r }) {
249
327
  });
250
328
  }
251
329
  // packages/ai/src/message-action.tsx
252
- function Z(e) {
330
+ function se(e) {
253
331
  if (e.kind === "link") {
254
332
  let { kind: n, label: r, ...i } = e;
255
- return /* @__PURE__ */ E(t, {
333
+ return /* @__PURE__ */ O(t, {
256
334
  ...i,
257
335
  "aria-label": r
258
336
  });
259
337
  }
260
338
  let { kind: r, label: i, ...a } = e;
261
- return /* @__PURE__ */ E(n, {
339
+ return /* @__PURE__ */ O(n, {
262
340
  ...a,
263
341
  variant: "ghost",
264
342
  "aria-label": i
265
343
  });
266
344
  }
267
- function Q(e) {
268
- return /* @__PURE__ */ D(d.Root, { children: [/* @__PURE__ */ E(d.Trigger, { render: Z(e) }), /* @__PURE__ */ E(d.Portal, { children: /* @__PURE__ */ E(d.Positioner, { children: /* @__PURE__ */ E(d.Popup, { children: e.label }) }) })] });
345
+ function ce(e) {
346
+ return /* @__PURE__ */ k(m.Root, { children: [/* @__PURE__ */ O(m.Trigger, { render: se(e) }), /* @__PURE__ */ O(m.Portal, { children: /* @__PURE__ */ O(m.Positioner, { children: /* @__PURE__ */ O(m.Popup, { children: e.label }) }) })] });
269
347
  }
270
348
  // packages/ai/src/message-boundary.tsx
271
- function te({ label: e, children: t }) {
272
- return /* @__PURE__ */ D(r.Root, {
349
+ function le({ label: e, children: t }) {
350
+ return /* @__PURE__ */ k(r.Root, {
273
351
  className: "xeuugli x1kbiq1m xykt701 xpu655y",
274
- children: [/* @__PURE__ */ D(r.Trigger, {
352
+ children: [/* @__PURE__ */ k(r.Trigger, {
275
353
  className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
276
- children: [/* @__PURE__ */ E(A, {
354
+ children: [/* @__PURE__ */ O(N, {
277
355
  size: 14,
278
356
  "aria-hidden": !0,
279
357
  className: "x2lah0s"
280
- }), /* @__PURE__ */ E("span", {
358
+ }), /* @__PURE__ */ O("span", {
281
359
  className: "xeuugli xj0a0fe",
282
360
  children: e
283
361
  })]
284
- }), /* @__PURE__ */ E(r.Panel, {
362
+ }), /* @__PURE__ */ O(r.Panel, {
285
363
  className: "x153jb6y xy8obcc xas2l8k",
286
364
  children: t
287
365
  })]
@@ -299,25 +377,25 @@ var $ = {
299
377
  $$css: !0
300
378
  }
301
379
  };
302
- function ne({ isCompact: e = !1 }) {
303
- return /* @__PURE__ */ E("div", {
380
+ function ue({ isCompact: e = !1 }) {
381
+ return /* @__PURE__ */ O("div", {
304
382
  "aria-hidden": !0,
305
383
  inert: !0,
306
384
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
307
- children: /* @__PURE__ */ D("div", {
385
+ children: /* @__PURE__ */ k("div", {
308
386
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
309
- children: [/* @__PURE__ */ E("div", {
310
- ...v.props(i.base, i.field, i.textarea, i.plainTextarea),
311
- children: /* @__PURE__ */ E(p, {
387
+ children: [/* @__PURE__ */ O("div", {
388
+ ...b.props(a.base, a.field, a.textarea, a.plainTextarea),
389
+ children: /* @__PURE__ */ O(g, {
312
390
  lines: e ? 1 : 2,
313
391
  width: "22ch"
314
392
  })
315
- }), /* @__PURE__ */ D("div", {
393
+ }), /* @__PURE__ */ k("div", {
316
394
  className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
317
- children: [/* @__PURE__ */ E("div", {
395
+ children: [/* @__PURE__ */ O("div", {
318
396
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
319
- children: /* @__PURE__ */ E(p, { width: "8ch" })
320
- }), /* @__PURE__ */ E(f, {
397
+ children: /* @__PURE__ */ O(g, { width: "8ch" })
398
+ }), /* @__PURE__ */ O(h, {
321
399
  isIconOnly: !0,
322
400
  xstyle: $.action
323
401
  })]
@@ -325,109 +403,109 @@ function ne({ isCompact: e = !1 }) {
325
403
  })
326
404
  });
327
405
  }
328
- function re({ label: e, value: t, onValueChange: r, onSubmit: i, name: a = "prompt", placeholder: o, maxLength: s, required: c = !0, isPending: l = !1, disabled: u = !1, isSubmitDisabled: f = !1, submitLabel: p = "Send message", pendingLabel: _ = "Sending…", enterBehavior: y = "newline", isCompact: b = !1, description: x, error: C, controls: w, attachments: T, onStop: O, isStopPending: k = !1, stopLabel: A = "Stop response" }) {
329
- let M = S(), N = u, P = b && T === void 0 && w === void 0, F = !N && !l && !f, I = p;
330
- O === void 0 ? l ? I = _ : y === "submit" && (I = `${p} · Enter`) : I = k ? "Stopping…" : A;
331
- function L(e) {
332
- if (y !== "submit" || e.key !== "Enter" || e.repeat) return;
406
+ function de({ label: e, value: t, onValueChange: r, onSubmit: i, name: a = "prompt", placeholder: o, maxLength: s, required: c = !0, isPending: l = !1, disabled: u = !1, isSubmitDisabled: d = !1, submitLabel: f = "Send message", pendingLabel: p = "Sending…", enterBehavior: h = "newline", isCompact: g = !1, description: y, error: x, controls: S, attachments: C, onStop: T, isStopPending: E = !1, stopLabel: D = "Stop response" }) {
407
+ let A = w(), M = u, N = g && C === void 0 && S === void 0, P = !M && !l && !d, F = f;
408
+ T === void 0 ? l ? F = p : h === "submit" && (F = `${f} · Enter`) : F = E ? "Stopping…" : D;
409
+ function I(e) {
410
+ if (h !== "submit" || e.key !== "Enter" || e.repeat) return;
333
411
  let t = e.altKey || e.ctrlKey || e.metaKey;
334
- e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), F && O === void 0 && e.currentTarget.form?.requestSubmit());
412
+ e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), P && T === void 0 && e.currentTarget.form?.requestSubmit());
335
413
  }
336
- function R(e) {
337
- e.preventDefault(), F && O === void 0 && i(e);
414
+ function L(e) {
415
+ e.preventDefault(), P && T === void 0 && i(e);
338
416
  }
339
- return /* @__PURE__ */ E("form", {
340
- onSubmit: R,
417
+ return /* @__PURE__ */ O("form", {
418
+ onSubmit: L,
341
419
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
342
- children: /* @__PURE__ */ D(m.Root, {
343
- invalid: C !== void 0,
420
+ children: /* @__PURE__ */ k(_.Root, {
421
+ invalid: x !== void 0,
344
422
  children: [
345
- /* @__PURE__ */ E(m.Label, {
346
- ...v.props(g.hidden),
423
+ /* @__PURE__ */ O(_.Label, {
424
+ ...b.props(v.hidden),
347
425
  children: e
348
426
  }),
349
- /* @__PURE__ */ D("div", {
427
+ /* @__PURE__ */ k("div", {
350
428
  ...{
351
429
  0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
352
430
  2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
353
431
  1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" },
354
432
  3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
355
- }[!!P << 1 | C !== void 0],
433
+ }[!!N << 1 | x !== void 0],
356
434
  children: [
357
- /* @__PURE__ */ E(h, {
435
+ /* @__PURE__ */ O(ee, {
358
436
  appearance: "plain",
359
- rows: b ? 1 : 2,
360
- isCompact: b,
361
- shouldGrow: P,
362
- xstyle: P ? $.inlineInput : void 0,
437
+ rows: g ? 1 : 2,
438
+ isCompact: g,
439
+ shouldGrow: N,
440
+ xstyle: N ? $.inlineInput : void 0,
363
441
  name: a,
364
442
  value: t,
365
443
  onChange: (e) => r(e.currentTarget.value),
366
- onKeyDown: L,
444
+ onKeyDown: I,
367
445
  placeholder: o ?? e,
368
446
  maxLength: s,
369
447
  required: c,
370
448
  disabled: u,
371
- "aria-errormessage": C === void 0 ? void 0 : M
449
+ "aria-errormessage": x === void 0 ? void 0 : A
372
450
  }),
373
- T,
374
- /* @__PURE__ */ D("div", {
451
+ C,
452
+ /* @__PURE__ */ k("div", {
375
453
  ...{
376
454
  0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
377
455
  1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
378
- }[!!P | 0],
379
- children: [w !== void 0 && /* @__PURE__ */ E("div", {
456
+ }[!!N | 0],
457
+ children: [S !== void 0 && /* @__PURE__ */ O("div", {
380
458
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
381
- children: w
382
- }), /* @__PURE__ */ D(d.Root, { children: [/* @__PURE__ */ E(d.Trigger, { render: O === void 0 ? /* @__PURE__ */ E(n, {
459
+ children: S
460
+ }), /* @__PURE__ */ k(m.Root, { children: [/* @__PURE__ */ O(m.Trigger, { render: T === void 0 ? /* @__PURE__ */ O(n, {
383
461
  xstyle: $.action,
384
462
  type: "submit",
385
463
  variant: "solid",
386
- "aria-label": l ? _ : p,
387
- disabled: u || f,
464
+ "aria-label": l ? p : f,
465
+ disabled: u || d,
388
466
  isPending: l,
389
- children: /* @__PURE__ */ E(ee, {
467
+ children: /* @__PURE__ */ O(j, {
390
468
  size: 16,
391
469
  "aria-hidden": !0
392
470
  })
393
- }) : /* @__PURE__ */ E(n, {
471
+ }) : /* @__PURE__ */ O(n, {
394
472
  xstyle: $.action,
395
473
  type: "button",
396
- "aria-label": k ? "Stopping…" : A,
474
+ "aria-label": E ? "Stopping…" : D,
397
475
  onClick: (e) => {
398
- e.preventDefault(), O();
476
+ e.preventDefault(), T();
399
477
  },
400
478
  disabled: u,
401
- isPending: k,
402
- children: /* @__PURE__ */ E(j, {
479
+ isPending: E,
480
+ children: /* @__PURE__ */ O(te, {
403
481
  size: 14,
404
482
  "aria-hidden": !0
405
483
  })
406
- }) }), /* @__PURE__ */ E(d.Portal, { children: /* @__PURE__ */ E(d.Positioner, { children: /* @__PURE__ */ E(d.Popup, { children: I }) }) })] })]
484
+ }) }), /* @__PURE__ */ O(m.Portal, { children: /* @__PURE__ */ O(m.Positioner, { children: /* @__PURE__ */ O(m.Popup, { children: F }) }) })] })]
407
485
  })
408
486
  ]
409
487
  }),
410
- x !== void 0 && /* @__PURE__ */ E(m.Description, { children: x }),
411
- C !== void 0 && /* @__PURE__ */ E(m.Error, {
412
- id: M,
488
+ y !== void 0 && /* @__PURE__ */ O(_.Description, { children: y }),
489
+ x !== void 0 && /* @__PURE__ */ O(_.Error, {
490
+ id: A,
413
491
  match: !0,
414
492
  role: "alert",
415
- children: C
493
+ children: x
416
494
  })
417
495
  ]
418
496
  })
419
497
  });
420
498
  }
421
499
  // packages/ai/src/reply-indicator.tsx
422
- function ie({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
423
- let [r, i] = T(t === 0), { ref: a, isActive: o } = _(n && r);
424
- return x(() => {
500
+ function fe({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
501
+ let [r, i] = D(t === 0), { ref: a, isActive: o } = y(n && r);
502
+ return C(() => {
425
503
  let e = setTimeout(() => i(!0), t);
426
504
  return () => clearTimeout(e);
427
- }, [t]), /* @__PURE__ */ E("div", {
505
+ }, [t]), /* @__PURE__ */ O("div", {
428
506
  ref: a,
429
- className: "x17tes2r x17oiadl x78zum5 x6s0dn4 x153jb6y x1hz01jw xy8obcc xas2l8k",
430
- children: r && /* @__PURE__ */ E("span", {
507
+ className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
508
+ children: r && /* @__PURE__ */ O("span", {
431
509
  role: "status",
432
510
  ...{
433
511
  0: {},
@@ -440,27 +518,27 @@ function ie({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
440
518
  });
441
519
  }
442
520
  // packages/ai/src/sources.tsx
443
- function ae({ sources: e, label: t = "Sources" }) {
444
- return /* @__PURE__ */ D("section", {
521
+ function pe({ sources: e, label: t = "Sources" }) {
522
+ return /* @__PURE__ */ k("section", {
445
523
  "aria-label": t,
446
524
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
447
525
  children: [
448
- /* @__PURE__ */ E("h3", {
526
+ /* @__PURE__ */ O("h3", {
449
527
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
450
528
  children: t
451
529
  }),
452
- e.length === 0 && /* @__PURE__ */ E("p", {
530
+ e.length === 0 && /* @__PURE__ */ O("p", {
453
531
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
454
532
  children: "No sources supplied."
455
533
  }),
456
- /* @__PURE__ */ E("ol", {
534
+ /* @__PURE__ */ O("ol", {
457
535
  className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
458
- children: e.map((e) => /* @__PURE__ */ D("li", {
536
+ children: e.map((e) => /* @__PURE__ */ k("li", {
459
537
  className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
460
- children: [/* @__PURE__ */ E("span", { children: /* @__PURE__ */ E(l, {
538
+ children: [/* @__PURE__ */ O("span", { children: /* @__PURE__ */ O(f, {
461
539
  href: e.href,
462
540
  children: e.title
463
- }) }), e.description !== void 0 && /* @__PURE__ */ E("p", {
541
+ }) }), e.description !== void 0 && /* @__PURE__ */ O("p", {
464
542
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
465
543
  children: e.description
466
544
  })]
@@ -469,21 +547,21 @@ function ae({ sources: e, label: t = "Sources" }) {
469
547
  ]
470
548
  });
471
549
  }
472
- function oe({ source: t, label: n }) {
473
- return /* @__PURE__ */ E("span", {
550
+ function me({ source: t, label: n }) {
551
+ return /* @__PURE__ */ O("span", {
474
552
  className: "xt0psk2 x11njtxf xss6m8b",
475
- children: /* @__PURE__ */ D(u.Root, { children: [/* @__PURE__ */ E(u.Trigger, {
476
- render: /* @__PURE__ */ E(e, {}),
553
+ children: /* @__PURE__ */ k(p.Root, { children: [/* @__PURE__ */ O(p.Trigger, {
554
+ render: /* @__PURE__ */ O(e, {}),
477
555
  "aria-label": `Source ${n}: ${t.title}`,
478
556
  children: n
479
- }), /* @__PURE__ */ E(u.Portal, { children: /* @__PURE__ */ E(u.Positioner, {
557
+ }), /* @__PURE__ */ O(p.Portal, { children: /* @__PURE__ */ O(p.Positioner, {
480
558
  side: "top",
481
- children: /* @__PURE__ */ E(u.Popup, { children: /* @__PURE__ */ D(a, {
559
+ children: /* @__PURE__ */ O(p.Popup, { children: /* @__PURE__ */ k(o, {
482
560
  isCompact: !0,
483
561
  children: [
484
- /* @__PURE__ */ E(u.Title, { children: t.title }),
485
- t.description !== void 0 && /* @__PURE__ */ E(u.Description, { children: t.description }),
486
- /* @__PURE__ */ E(l, {
562
+ /* @__PURE__ */ O(p.Title, { children: t.title }),
563
+ t.description !== void 0 && /* @__PURE__ */ O(p.Description, { children: t.description }),
564
+ /* @__PURE__ */ O(f, {
487
565
  href: t.href,
488
566
  children: "Open source"
489
567
  })
@@ -492,4 +570,4 @@ function oe({ source: t, label: n }) {
492
570
  }) })] })
493
571
  });
494
572
  }
495
- export { F as Approval, W as Conversation, oe as InlineCitation, Y as Message, Q as MessageAction, X as MessageAttachment, te as MessageBoundary, re as PromptInput, ne as PromptInputPlaceholder, ie as ReplyIndicator, ae as Sources };
573
+ export { R as Approval, H as CommandActivity, z as CommandDetails, Z as Conversation, me as InlineCitation, ae as Message, ce as MessageAction, oe as MessageAttachment, le as MessageBoundary, de as PromptInput, ue as PromptInputPlaceholder, fe as ReplyIndicator, pe as Sources };