@mechane-ai/elements 0.59.0 → 0.61.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
@@ -5,35 +5,35 @@ import { t as d } from "./content-link-PnpcnTCx.js";
5
5
  import { n as f, r as p } from "./markdown-VpLw_P9T.js";
6
6
  import { r as m, t as h } from "./src-na2DdkKI.js";
7
7
  import { c as g, d as _ } from "./src-C-Wg9m9H.js";
8
- import { i as ee, t as v } from "./forms-CEbwzlRR.js";
9
- import { t as te } from "./accessibility-P89UG9-r.js";
10
- import { r as y } from "./control-styles-D3q_Qyxi.js";
11
- import * as b from "@stylexjs/stylex";
12
- import { createParts as x } from "@ui-sdk/react/primitive";
13
- import { createContext as S, useCallback as C, useContext as w, useEffect as T, useId as ne, useLayoutEffect as E, useRef as D, useState as O } from "react";
14
- import { createInputHistory as re, definePrimitive as k, dispatch as ie, isComposing as ae } from "@ui-sdk/core";
15
- import { jsx as A, jsxs as j } from "react/jsx-runtime";
16
- import { ArrowDown as M, ArrowUp as oe, File as N, GitBranch as P, Square as se, Terminal as F } from "lucide-react";
17
- import { matchesShortcut as I } from "@ui-sdk/core/shortcuts";
18
- import { useShortcutHint as ce } from "@ui-sdk/react/shortcuts";
19
- import { ScrollArea as L, ScrollAreaContent as R, ScrollAreaScrollToEnd as z, ScrollAreaViewport as B, createScrollAreaController as V } from "@ui-sdk/react/scroll-area";
8
+ import { i as v, t as y } from "./forms-CEbwzlRR.js";
9
+ import { t as b } from "./accessibility-P89UG9-r.js";
10
+ import { r as x } from "./control-styles-D3q_Qyxi.js";
11
+ import * as S from "@stylexjs/stylex";
12
+ import { createParts as C } from "@ui-sdk/react/primitive";
13
+ import { createContext as w, useCallback as T, useContext as E, useEffect as D, useId as ee, useLayoutEffect as O, useRef as k, useState as A } from "react";
14
+ import { createInputHistory as te, definePrimitive as j, dispatch as ne, isComposing as re } from "@ui-sdk/core";
15
+ import { jsx as M, jsxs as N } from "react/jsx-runtime";
16
+ import { ArrowDown as P, ArrowUp as ie, File as F, GitBranch as I, Square as ae, Terminal as L } from "lucide-react";
17
+ import { matchesShortcut as R } from "@ui-sdk/core/shortcuts";
18
+ import { useShortcutHint as oe } from "@ui-sdk/react/shortcuts";
19
+ import { ScrollArea as z, ScrollAreaContent as B, ScrollAreaScrollToEnd as V, ScrollAreaViewport as H, createScrollAreaController as U } from "@ui-sdk/react/scroll-area";
20
20
  // packages/ai/src/approval.tsx
21
- function H(e) {
22
- return /* @__PURE__ */ j("section", {
21
+ function W(e) {
22
+ return /* @__PURE__ */ N("section", {
23
23
  "aria-label": e.title,
24
24
  "data-request-id": e.requestId,
25
25
  className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
26
26
  children: [
27
- /* @__PURE__ */ A("h3", {
27
+ /* @__PURE__ */ M("h3", {
28
28
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
29
29
  children: e.title
30
30
  }),
31
- e.description !== void 0 && /* @__PURE__ */ A("p", {
31
+ e.description !== void 0 && /* @__PURE__ */ M("p", {
32
32
  className: "x1ghz6dp x153jb6y xj0a0fe",
33
33
  children: e.description
34
34
  }),
35
35
  e.children,
36
- e.status === "pending" ? /* @__PURE__ */ j(o, { children: [/* @__PURE__ */ A(n, {
36
+ e.status === "pending" ? /* @__PURE__ */ N(o, { children: [/* @__PURE__ */ M(n, {
37
37
  variant: "solid",
38
38
  "data-agent-confirm": `Approve ${e.title}?`,
39
39
  onClick: e.onApprove,
@@ -41,23 +41,23 @@ function H(e) {
41
41
  isPending: e.busy === "approve",
42
42
  pendingLabel: "Approving…",
43
43
  children: e.approveLabel ?? "Approve"
44
- }), /* @__PURE__ */ A(n, {
44
+ }), /* @__PURE__ */ M(n, {
45
45
  "data-agent-confirm": `Deny ${e.title}?`,
46
46
  onClick: e.onDeny,
47
47
  disabled: e.isDisabled === !0 || e.busy !== void 0,
48
48
  isPending: e.busy === "deny",
49
49
  pendingLabel: "Denying…",
50
50
  children: e.denyLabel ?? "Deny"
51
- })] }) : /* @__PURE__ */ A(s, { children: e.statusLabel })
51
+ })] }) : /* @__PURE__ */ M(s, { children: e.statusLabel })
52
52
  ]
53
53
  });
54
54
  }
55
55
  // packages/ai/src/command-details.tsx
56
- function U({ command: e, output: t, commandNotice: n, outputNotice: a, outputLanguage: o, isRunning: s = !1 }) {
57
- return /* @__PURE__ */ j(r, {
56
+ function G({ command: e, output: t, commandNotice: n, outputNotice: a, outputLanguage: o, isRunning: s = !1 }) {
57
+ return /* @__PURE__ */ N(r, {
58
58
  isCompact: !0,
59
59
  children: [
60
- e === "" && n !== void 0 ? /* @__PURE__ */ A(i, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ A(i, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ A(l, {
60
+ e === "" && n !== void 0 ? /* @__PURE__ */ M(i, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ M(i, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ M(l, {
61
61
  code: e,
62
62
  language: "bash",
63
63
  filename: "Command",
@@ -66,13 +66,13 @@ function U({ command: e, output: t, commandNotice: n, outputNotice: a, outputLan
66
66
  shouldWrap: !0,
67
67
  maxHeight: 240
68
68
  }),
69
- n !== void 0 && /* @__PURE__ */ A(i, { children: n }),
70
- t === void 0 || t.length === 0 ? /* @__PURE__ */ A(i, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : a === void 0 ? "No output." : "Output omitted from this preview." }) : o === void 0 ? /* @__PURE__ */ A(u, {
69
+ n !== void 0 && /* @__PURE__ */ M(i, { children: n }),
70
+ t === void 0 || t.length === 0 ? /* @__PURE__ */ M(i, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : a === void 0 ? "No output." : "Output omitted from this preview." }) : o === void 0 ? /* @__PURE__ */ M(u, {
71
71
  output: t,
72
72
  label: "Output",
73
73
  variant: "embedded",
74
74
  isRunning: s
75
- }) : /* @__PURE__ */ A(l, {
75
+ }) : /* @__PURE__ */ M(l, {
76
76
  code: t,
77
77
  language: o,
78
78
  filename: "Output",
@@ -82,74 +82,90 @@ function U({ command: e, output: t, commandNotice: n, outputNotice: a, outputLan
82
82
  isStreaming: s,
83
83
  maxHeight: 320
84
84
  }),
85
- a !== void 0 && /* @__PURE__ */ A(i, { children: a })
85
+ a !== void 0 && /* @__PURE__ */ M(i, { children: a })
86
86
  ]
87
87
  });
88
88
  }
89
89
  // packages/ai/src/command-activity.tsx
90
- var W = {
90
+ var K = {
91
91
  pending: "Preparing",
92
92
  running: "Running",
93
93
  complete: "",
94
94
  failed: "Failed",
95
95
  stopped: "Stopped",
96
96
  unknown: "Outcome unknown"
97
- }, G = /* @__PURE__ */ new Set(["pending", "running"]);
98
- function le({ status: e, ...t }) {
99
- let n = t.command?.trim().split(/\r\n|\n|\r/u)[0], r = n === void 0 || n.length === 0 ? "Command" : n;
100
- return /* @__PURE__ */ j(c.Root, {
97
+ }, se = /* @__PURE__ */ new Set(["pending", "running"]);
98
+ function ce({ status: e, duration: t, meta: n, ...r }) {
99
+ let i = r.command?.trim().split(/\r\n|\n|\r/u)[0], a = i === void 0 || i.length === 0 ? "Command" : i, o = n !== void 0 && n.length > 0, s = t !== void 0 && t.length > 0, l = o || s, u = l ? /* @__PURE__ */ N("span", {
100
+ className: "x3nfvp2 x6s0dn4 x1hnptsi xvc5jky x2lah0s xy8obcc xss6m8b x153jb6y xuxw1ft",
101
+ children: [o && /* @__PURE__ */ M("span", {
102
+ className: "x153jb6y",
103
+ children: n
104
+ }), s && /* @__PURE__ */ M("span", {
105
+ className: "x153jb6y",
106
+ children: t
107
+ })]
108
+ }) : null, d = /* @__PURE__ */ N("span", {
109
+ ...{
110
+ 0: { className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli x153jb6y xj57cvi" },
111
+ 1: { className: "x6s0dn4 x1hnptsi xeuugli x153jb6y xj57cvi x78zum5 x12lumcd" }
112
+ }[!!l | 0],
113
+ children: [
114
+ /* @__PURE__ */ M(L, {
115
+ size: 14,
116
+ "aria-hidden": !0,
117
+ className: "x2lah0s"
118
+ }),
119
+ /* @__PURE__ */ M("span", {
120
+ className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
121
+ children: a
122
+ }),
123
+ K[e].length > 0 && /* @__PURE__ */ M("span", {
124
+ className: "x2lah0s xy8obcc x153jb6y",
125
+ children: K[e]
126
+ }),
127
+ u
128
+ ]
129
+ });
130
+ return /* @__PURE__ */ N(c.Root, {
101
131
  defaultOpen: !1,
102
- children: [/* @__PURE__ */ A(c.Trigger, {
132
+ children: [l ? /* @__PURE__ */ M(c.Trigger, {
133
+ className: "xt970qd xunmzkg x153jb6y xj57cvi",
134
+ children: d
135
+ }) : /* @__PURE__ */ M(c.Trigger, {
103
136
  variant: "inline",
104
- children: /* @__PURE__ */ j("span", {
105
- className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
106
- children: [
107
- /* @__PURE__ */ A(F, {
108
- size: 14,
109
- "aria-hidden": !0,
110
- className: "x2lah0s"
111
- }),
112
- /* @__PURE__ */ A("span", {
113
- className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
114
- children: r
115
- }),
116
- W[e].length > 0 && /* @__PURE__ */ A("span", {
117
- className: "x2lah0s xy8obcc x153jb6y",
118
- children: W[e]
119
- })
120
- ]
121
- })
122
- }), /* @__PURE__ */ A(c.Panel, { children: /* @__PURE__ */ A(U, {
123
- ...t,
124
- isRunning: G.has(e)
137
+ children: d
138
+ }), /* @__PURE__ */ M(c.Panel, { children: /* @__PURE__ */ M(G, {
139
+ ...r,
140
+ isRunning: se.has(e)
125
141
  }) })]
126
142
  });
127
143
  }
128
144
  // packages/ai/src/conversation.tsx
129
- var K = S(void 0);
130
- function q() {
131
- let e = w(K);
145
+ var q = w(void 0);
146
+ function J() {
147
+ let e = E(q);
132
148
  if (e === void 0) throw Error("Render the parts of a conversation inside Conversation.Root.");
133
149
  return e;
134
150
  }
135
- function J(e) {
151
+ function Y(e) {
136
152
  return e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
137
153
  }
138
- function ue({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
139
- let i = D(null), a = r ?? i, [o] = O(t), [s] = O(V), [c, l] = O(o === "end"), [u] = O(() => ({
154
+ function le({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
155
+ let i = k(null), a = r ?? i, [o] = A(t), [s] = A(U), [c, l] = A(o === "end"), [u] = A(() => ({
140
156
  controller: s,
141
157
  viewport: a,
142
158
  reachEnd: () => l(!0)
143
159
  }));
144
- return E(() => {
160
+ return O(() => {
145
161
  typeof o == "object" && a.current?.scrollTo({
146
162
  top: o.top,
147
163
  left: o.left ?? 0,
148
164
  behavior: "instant"
149
165
  });
150
- }, [o, a]), /* @__PURE__ */ A(K.Provider, {
166
+ }, [o, a]), /* @__PURE__ */ M(q.Provider, {
151
167
  value: u,
152
- children: /* @__PURE__ */ A(L, {
168
+ children: /* @__PURE__ */ M(z, {
153
169
  stickToEnd: n && c,
154
170
  controller: s,
155
171
  className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
@@ -157,25 +173,25 @@ function ue({ children: e, initialPosition: t = "end", shouldFollow: n = !0, vie
157
173
  })
158
174
  });
159
175
  }
160
- function de({ label: e, children: t, scrollRestorationId: n }) {
161
- let { viewport: r, reachEnd: i } = q(), a = C((e) => {
162
- r.current = e, e !== null && J(e) && i();
176
+ function ue({ label: e, children: t, scrollRestorationId: n }) {
177
+ let { viewport: r, reachEnd: i } = J(), a = T((e) => {
178
+ r.current = e, e !== null && Y(e) && i();
163
179
  }, [r, i]);
164
- return /* @__PURE__ */ A(B, {
180
+ return /* @__PURE__ */ M(H, {
165
181
  ref: a,
166
182
  role: "region",
167
183
  "aria-label": e,
168
184
  tabIndex: 0,
169
185
  "data-scroll-restoration-id": n,
170
186
  onScroll: (e) => {
171
- J(e.currentTarget) && i();
187
+ Y(e.currentTarget) && i();
172
188
  },
173
189
  className: "x98rzlu x2lwn1j xeuugli x1odjw0f x1046ku7 x185mbhu xbluxkr x1ok0vyi x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal",
174
190
  children: t
175
191
  });
176
192
  }
177
- function Y({ children: e, isStreaming: t = !1 }) {
178
- return /* @__PURE__ */ A(R, {
193
+ function de({ children: e, isStreaming: t = !1 }) {
194
+ return /* @__PURE__ */ M(B, {
179
195
  "aria-live": "polite",
180
196
  "aria-relevant": "additions",
181
197
  "aria-busy": t,
@@ -184,32 +200,32 @@ function Y({ children: e, isStreaming: t = !1 }) {
184
200
  });
185
201
  }
186
202
  function fe({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
187
- let { controller: r } = q();
188
- return E(() => {
203
+ let { controller: r } = J();
204
+ return O(() => {
189
205
  t && r.scrollToEnd({ behavior: "instant" });
190
206
  }, [
191
207
  e,
192
208
  t,
193
209
  r
194
- ]), /* @__PURE__ */ A("div", {
210
+ ]), /* @__PURE__ */ M("div", {
195
211
  "data-message-id": e,
196
212
  className: "xeuugli xj0a0fe",
197
213
  children: n
198
214
  });
199
215
  }
200
216
  function pe({ children: e }) {
201
- return /* @__PURE__ */ A("div", {
217
+ return /* @__PURE__ */ M("div", {
202
218
  className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
203
219
  children: e
204
220
  });
205
221
  }
206
222
  function me({ label: e = "Jump to latest" }) {
207
- return /* @__PURE__ */ A(z, { render: (t, { visible: r }) => /* @__PURE__ */ A("div", {
223
+ return /* @__PURE__ */ M(V, { render: (t, { visible: r }) => /* @__PURE__ */ M("div", {
208
224
  hidden: !r,
209
225
  className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
210
- children: /* @__PURE__ */ j(n, {
226
+ children: /* @__PURE__ */ N(n, {
211
227
  ...t,
212
- children: [/* @__PURE__ */ A(M, {
228
+ children: [/* @__PURE__ */ M(P, {
213
229
  size: 14,
214
230
  "aria-hidden": !0
215
231
  }), e]
@@ -217,23 +233,23 @@ function me({ label: e = "Jump to latest" }) {
217
233
  }) });
218
234
  }
219
235
  function he({ label: e, onActivate: t }) {
220
- let { controller: r, viewport: i } = q();
221
- return /* @__PURE__ */ j(n, {
236
+ let { controller: r, viewport: i } = J();
237
+ return /* @__PURE__ */ N(n, {
222
238
  onClick: () => {
223
239
  t?.(), requestAnimationFrame(() => {
224
240
  r.scrollToEnd({ behavior: "instant" }), i.current?.focus({ preventScroll: !0 });
225
241
  });
226
242
  },
227
- children: [/* @__PURE__ */ A(M, {
243
+ children: [/* @__PURE__ */ M(P, {
228
244
  size: 14,
229
245
  "aria-hidden": !0
230
246
  }), e]
231
247
  });
232
248
  }
233
249
  var ge = {
234
- Root: ue,
235
- Viewport: de,
236
- Content: Y,
250
+ Root: le,
251
+ Viewport: ue,
252
+ Content: de,
237
253
  Item: fe,
238
254
  Controls: pe,
239
255
  LatestButton: he,
@@ -251,6 +267,44 @@ var ge = {
251
267
  k63SB2: "xj57cvi",
252
268
  $$css: !0
253
269
  },
270
+ speaker: {
271
+ k1xSpc: "x3nfvp2",
272
+ kGNEyG: "x6s0dn4",
273
+ kmuXW: "x2lah0s",
274
+ k8WAf4: "x10dazmo",
275
+ kg3NbH: "x5g2kb4",
276
+ kaIpWk: "xy32g2j",
277
+ kGuDYH: "xy8obcc",
278
+ kLWn49: "xas2l8k",
279
+ k63SB2: "xk4h15q",
280
+ khDVqt: "xuxw1ft",
281
+ $$css: !0
282
+ },
283
+ speakerNeutral: {
284
+ kMwMTN: "x153jb6y",
285
+ kWkggS: "x1r7kqkb",
286
+ $$css: !0
287
+ },
288
+ speakerAccent: {
289
+ kMwMTN: "x1v5v99g",
290
+ kWkggS: "x1ld8el8",
291
+ $$css: !0
292
+ },
293
+ speakerPositive: {
294
+ kMwMTN: "x7ixh4y",
295
+ kWkggS: "x1r8u7ye",
296
+ $$css: !0
297
+ },
298
+ speakerWarning: {
299
+ kMwMTN: "x1f9ixgr",
300
+ kWkggS: "x1dqe72f",
301
+ $$css: !0
302
+ },
303
+ speakerNegative: {
304
+ kMwMTN: "xr5kp14",
305
+ kWkggS: "xcqwzn",
306
+ $$css: !0
307
+ },
254
308
  user: {
255
309
  k8WAf4: "x1qokhjc",
256
310
  kg3NbH: "x1m92p3w",
@@ -280,6 +334,12 @@ var ge = {
280
334
  assistant: X.assistant,
281
335
  system: X.system
282
336
  }, ve = {
337
+ neutral: X.speakerNeutral,
338
+ accent: X.speakerAccent,
339
+ positive: X.speakerPositive,
340
+ warning: X.speakerWarning,
341
+ negative: X.speakerNegative
342
+ }, ye = {
283
343
  user: X.bubble,
284
344
  assistant: X.chatReply,
285
345
  system: null
@@ -287,7 +347,7 @@ var ge = {
287
347
  function Z({ kind: e }) {
288
348
  return { kind: e };
289
349
  }
290
- var ye = k({
350
+ var be = j({
291
351
  name: "message",
292
352
  options: { kind: "string" },
293
353
  state: Z,
@@ -299,76 +359,85 @@ var ye = k({
299
359
  root: e({}),
300
360
  description: e({})
301
361
  })
302
- }), { Root: be, Description: xe } = x(ye, {
362
+ }), { Root: xe, Description: Se } = C(be, {
303
363
  root: "article",
304
364
  description: "div"
305
- }), Se = {
365
+ }), Ce = {
306
366
  "x-default-marker": "x-default-marker",
307
367
  $$css: !0
308
368
  };
309
- function Ce({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default" }) {
310
- let l = c === "chat", u = !l || a !== void 0 || i !== void 0, d = l && r === "assistant", p = u ? /* @__PURE__ */ j("header", {
369
+ function we({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, variant: c = "default", speaker: l, speakerTone: u = "neutral", quote: d }) {
370
+ let p = c === "chat", m = l !== void 0 && l.length > 0, h = d !== void 0 && d.length > 0, g = !p || a !== void 0 || i !== void 0 || m, _ = e.length > 0 && (!m || e !== l), v = e.length > 0 ? e : l ?? "", y = p && r === "assistant", b = g ? /* @__PURE__ */ N("header", {
311
371
  className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
312
372
  children: [
313
- a !== void 0 && /* @__PURE__ */ A("span", {
373
+ a !== void 0 && /* @__PURE__ */ M("span", {
314
374
  className: "x3nfvp2 x2lah0s",
315
375
  children: a
316
376
  }),
317
- /* @__PURE__ */ A("span", {
377
+ _ && /* @__PURE__ */ M("span", {
318
378
  className: "xk4h15q xeuugli xj0a0fe",
319
379
  children: e
320
380
  }),
321
- i !== void 0 && /* @__PURE__ */ A("div", {
322
- className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
381
+ m && /* @__PURE__ */ M("span", {
382
+ ...S.props(X.speaker, ve[u]),
383
+ children: l
384
+ }),
385
+ i !== void 0 && /* @__PURE__ */ M("div", {
386
+ className: "x153jb6y xy8obcc xas2l8k xss6m8b xeuugli xj0a0fe",
323
387
  children: i
324
388
  })
325
389
  ]
326
390
  }) : null;
327
- return /* @__PURE__ */ j(be, {
391
+ return /* @__PURE__ */ N(xe, {
328
392
  kind: r,
329
393
  ...n !== void 0 && { id: n },
330
- "aria-label": e,
331
- ...b.props(X.root, _e[r], l && ve[r], Se),
394
+ "aria-label": v,
395
+ ...S.props(X.root, _e[r], p && ye[r], Ce),
332
396
  children: [
333
- p,
334
- /* @__PURE__ */ A(xe, {
397
+ b,
398
+ h && /* @__PURE__ */ M("p", {
399
+ title: d,
400
+ className: "x1ghz6dp xyibt8p xyumdvf x1t7ytsu x97x49r x153jb6y xy8obcc xas2l8k xb3r6kr xlyipyv xuxw1ft xeuugli x193iq5w",
401
+ children: d
402
+ }),
403
+ /* @__PURE__ */ M(Se, {
335
404
  className: "xeuugli xj0a0fe x1ytb0s6",
336
- children: l && r === "assistant" && typeof t == "string" ? /* @__PURE__ */ A(f, { children: t }) : t
405
+ children: p && r === "assistant" && typeof t == "string" ? /* @__PURE__ */ M(f, { children: t }) : t
337
406
  }),
338
- s !== void 0 && /* @__PURE__ */ A("div", {
407
+ s !== void 0 && /* @__PURE__ */ M("div", {
339
408
  className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
340
409
  children: s
341
410
  }),
342
- (o !== void 0 || d) && /* @__PURE__ */ A("footer", {
411
+ (o !== void 0 || y) && /* @__PURE__ */ M("footer", {
343
412
  ...{
344
413
  0: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b" },
345
414
  1: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b x17tes2r x17oiadl" }
346
- }[!!d | 0],
415
+ }[!!y | 0],
347
416
  children: o
348
417
  })
349
418
  ]
350
419
  });
351
420
  }
352
- function we({ name: e, description: t, href: n, actions: r }) {
353
- return /* @__PURE__ */ j("div", {
421
+ function Te({ name: e, description: t, href: n, actions: r }) {
422
+ return /* @__PURE__ */ N("div", {
354
423
  className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
355
424
  children: [
356
- /* @__PURE__ */ A(N, {
425
+ /* @__PURE__ */ M(F, {
357
426
  size: 16,
358
427
  "aria-hidden": !0,
359
428
  className: "x153jb6y x2lah0s"
360
429
  }),
361
- /* @__PURE__ */ j("div", {
430
+ /* @__PURE__ */ N("div", {
362
431
  className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
363
- children: [n === void 0 ? /* @__PURE__ */ A("span", { children: e }) : /* @__PURE__ */ A(d, {
432
+ children: [n === void 0 ? /* @__PURE__ */ M("span", { children: e }) : /* @__PURE__ */ M(d, {
364
433
  href: n,
365
434
  children: e
366
- }), t !== void 0 && /* @__PURE__ */ A("span", {
367
- className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
435
+ }), t !== void 0 && /* @__PURE__ */ M("span", {
436
+ className: "x153jb6y xy8obcc xas2l8k xss6m8b xeuugli xj0a0fe",
368
437
  children: t
369
438
  })]
370
439
  }),
371
- r !== void 0 && /* @__PURE__ */ A("div", {
440
+ r !== void 0 && /* @__PURE__ */ M("div", {
372
441
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
373
442
  children: r
374
443
  })
@@ -376,39 +445,39 @@ function we({ name: e, description: t, href: n, actions: r }) {
376
445
  });
377
446
  }
378
447
  // packages/ai/src/message-action.tsx
379
- function Te(n) {
448
+ function Ee(n) {
380
449
  if (n.kind === "link") {
381
450
  let { kind: e, label: r, ...i } = n;
382
- return /* @__PURE__ */ A(t, {
451
+ return /* @__PURE__ */ M(t, {
383
452
  ...i,
384
453
  "aria-label": r
385
454
  });
386
455
  }
387
456
  let { kind: r, label: i, ...a } = n;
388
- return /* @__PURE__ */ A(e, {
457
+ return /* @__PURE__ */ M(e, {
389
458
  ...a,
390
459
  variant: "ghost",
391
460
  "aria-label": i
392
461
  });
393
462
  }
394
- function Ee(e) {
395
- return /* @__PURE__ */ j(h.Root, { children: [/* @__PURE__ */ A(h.Trigger, { render: Te(e) }), /* @__PURE__ */ A(h.Popup, { children: e.label })] });
463
+ function De(e) {
464
+ return /* @__PURE__ */ N(h.Root, { children: [/* @__PURE__ */ M(h.Trigger, { render: Ee(e) }), /* @__PURE__ */ M(h.Popup, { children: e.label })] });
396
465
  }
397
466
  // packages/ai/src/message-boundary.tsx
398
- function De({ label: e, children: t }) {
399
- return /* @__PURE__ */ j(c.Root, {
467
+ function Oe({ label: e, children: t }) {
468
+ return /* @__PURE__ */ N(c.Root, {
400
469
  className: "xeuugli x1kbiq1m xykt701 xpu655y",
401
- children: [/* @__PURE__ */ j(c.Trigger, {
470
+ children: [/* @__PURE__ */ N(c.Trigger, {
402
471
  className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
403
- children: [/* @__PURE__ */ A(P, {
472
+ children: [/* @__PURE__ */ M(I, {
404
473
  size: 14,
405
474
  "aria-hidden": !0,
406
475
  className: "x2lah0s"
407
- }), /* @__PURE__ */ A("span", {
476
+ }), /* @__PURE__ */ M("span", {
408
477
  className: "xeuugli xj0a0fe",
409
478
  children: e
410
479
  })]
411
- }), /* @__PURE__ */ A(c.Panel, {
480
+ }), /* @__PURE__ */ M(c.Panel, {
412
481
  className: "x153jb6y xy8obcc xas2l8k",
413
482
  children: t
414
483
  })]
@@ -426,25 +495,25 @@ var Q = {
426
495
  $$css: !0
427
496
  }
428
497
  }, $ = "mod+enter";
429
- function Oe({ isCompact: e = !1 }) {
430
- return /* @__PURE__ */ A("div", {
498
+ function ke({ isCompact: e = !1 }) {
499
+ return /* @__PURE__ */ M("div", {
431
500
  "aria-hidden": !0,
432
501
  inert: !0,
433
502
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
434
- children: /* @__PURE__ */ j("div", {
503
+ children: /* @__PURE__ */ N("div", {
435
504
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
436
- children: [/* @__PURE__ */ A("div", {
437
- ...b.props(y.base, y.field, y.textarea, y.plainTextarea),
438
- children: /* @__PURE__ */ A(_, {
505
+ children: [/* @__PURE__ */ M("div", {
506
+ ...S.props(x.base, x.field, x.textarea, x.plainTextarea),
507
+ children: /* @__PURE__ */ M(_, {
439
508
  lines: e ? 1 : 2,
440
509
  width: "22ch"
441
510
  })
442
- }), /* @__PURE__ */ j("div", {
511
+ }), /* @__PURE__ */ N("div", {
443
512
  className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
444
- children: [/* @__PURE__ */ A("div", {
513
+ children: [/* @__PURE__ */ M("div", {
445
514
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
446
- children: /* @__PURE__ */ A(_, { width: "8ch" })
447
- }), /* @__PURE__ */ A(g, {
515
+ children: /* @__PURE__ */ M(_, { width: "8ch" })
516
+ }), /* @__PURE__ */ M(g, {
448
517
  isIconOnly: !0,
449
518
  xstyle: Q.action
450
519
  })]
@@ -452,132 +521,132 @@ function Oe({ isCompact: e = !1 }) {
452
521
  })
453
522
  });
454
523
  }
455
- function ke({ label: t, value: n, 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: m = "newline", history: g, isCompact: _ = !1, description: y, error: x, controls: S, attachments: C, onStop: w, isStopPending: T = !1, stopLabel: k = "Stop response" }) {
456
- let M = ne(), N = u, P = _ && C === void 0 && S === void 0, F = !N && !l && !d, L = ce($), R = D({
524
+ function Ae({ label: t, value: n, 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: m = "newline", history: g, isCompact: _ = !1, description: x, error: C, controls: w, attachments: T, onStop: E, isStopPending: D = !1, stopLabel: j = "Stop response" }) {
525
+ let P = ee(), F = u, I = _ && T === void 0 && w === void 0, L = !F && !l && !d, z = oe($), B = k({
457
526
  history: g,
458
527
  value: n,
459
528
  onValueChange: r
460
529
  });
461
- E(() => {
462
- R.current = {
530
+ O(() => {
531
+ B.current = {
463
532
  history: g,
464
533
  value: n,
465
534
  onValueChange: r
466
535
  };
467
536
  });
468
- let [z] = O(() => re({
469
- entries: () => R.current.history,
470
- read: () => R.current.value,
471
- write: (e, t) => !ie({ options: () => R.current }, "onValueChange", e, {
537
+ let [V] = A(() => te({
538
+ entries: () => B.current.history,
539
+ read: () => B.current.value,
540
+ write: (e, t) => !ne({ options: () => B.current }, "onValueChange", e, {
472
541
  reason: "input-change",
473
542
  event: t
474
543
  })
475
- })), B = `${f} · ${L.text}`;
476
- w === void 0 ? l ? B = p : m === "submit" && (B = `${f} · Enter`) : B = T ? "Stopping…" : k;
477
- function V(e) {
478
- if (z.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || ae(e)) return;
479
- let t = I(e.nativeEvent, $), n = !t && I(e.nativeEvent, "enter");
480
- (t || m === "submit" && n) && (e.preventDefault(), F && w === void 0 && e.currentTarget.form?.requestSubmit());
544
+ })), H = `${f} · ${z.text}`;
545
+ E === void 0 ? l ? H = p : m === "submit" && (H = `${f} · Enter`) : H = D ? "Stopping…" : j;
546
+ function U(e) {
547
+ if (V.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || re(e)) return;
548
+ let t = R(e.nativeEvent, $), n = !t && R(e.nativeEvent, "enter");
549
+ (t || m === "submit" && n) && (e.preventDefault(), L && E === void 0 && e.currentTarget.form?.requestSubmit());
481
550
  }
482
- function H(e) {
483
- e.preventDefault(), F && w === void 0 && i(e);
551
+ function W(e) {
552
+ e.preventDefault(), L && E === void 0 && i(e);
484
553
  }
485
- return /* @__PURE__ */ A("form", {
486
- onSubmit: H,
554
+ return /* @__PURE__ */ M("form", {
555
+ onSubmit: W,
487
556
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
488
- children: /* @__PURE__ */ j(v.Root, {
489
- invalid: x !== void 0,
557
+ children: /* @__PURE__ */ N(y.Root, {
558
+ invalid: C !== void 0,
490
559
  children: [
491
- /* @__PURE__ */ A(v.Label, {
492
- ...b.props(te.hidden),
560
+ /* @__PURE__ */ M(y.Label, {
561
+ ...S.props(b.hidden),
493
562
  children: t
494
563
  }),
495
- /* @__PURE__ */ j("div", {
564
+ /* @__PURE__ */ N("div", {
496
565
  ...{
497
566
  0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
498
567
  2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
499
568
  1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" },
500
569
  3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
501
- }[!!P << 1 | x !== void 0],
570
+ }[!!I << 1 | C !== void 0],
502
571
  children: [
503
- /* @__PURE__ */ A(ee, {
572
+ /* @__PURE__ */ M(v, {
504
573
  isSensitive: !0,
505
574
  appearance: "plain",
506
575
  rows: _ ? 1 : 2,
507
576
  isCompact: _,
508
- shouldGrow: P,
509
- xstyle: P ? Q.inlineInput : void 0,
577
+ shouldGrow: I,
578
+ xstyle: I ? Q.inlineInput : void 0,
510
579
  name: a,
511
580
  value: n,
512
581
  onValueChange: r,
513
- onKeyDown: V,
582
+ onKeyDown: U,
514
583
  placeholder: o ?? t,
515
584
  maxLength: s,
516
585
  required: c,
517
586
  disabled: u,
518
- "aria-errormessage": x === void 0 ? void 0 : M
587
+ "aria-errormessage": C === void 0 ? void 0 : P
519
588
  }),
520
- C,
521
- /* @__PURE__ */ j("div", {
589
+ T,
590
+ /* @__PURE__ */ N("div", {
522
591
  ...{
523
592
  0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
524
593
  1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
525
- }[!!P | 0],
526
- children: [S !== void 0 && /* @__PURE__ */ A("div", {
594
+ }[!!I | 0],
595
+ children: [w !== void 0 && /* @__PURE__ */ M("div", {
527
596
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
528
- children: S
529
- }), /* @__PURE__ */ j(h.Root, { children: [/* @__PURE__ */ A(h.Trigger, { render: w === void 0 ? /* @__PURE__ */ A(e, {
597
+ children: w
598
+ }), /* @__PURE__ */ N(h.Root, { children: [/* @__PURE__ */ M(h.Trigger, { render: E === void 0 ? /* @__PURE__ */ M(e, {
530
599
  xstyle: Q.action,
531
600
  type: "submit",
532
601
  "data-agent-confirm": f,
533
602
  variant: "solid",
534
603
  "aria-label": l ? p : f,
535
- "aria-keyshortcuts": m === "submit" ? `Enter ${L.ariaKeyshortcuts}` : L.ariaKeyshortcuts,
604
+ "aria-keyshortcuts": m === "submit" ? `Enter ${z.ariaKeyshortcuts}` : z.ariaKeyshortcuts,
536
605
  disabled: u || d,
537
606
  isPending: l,
538
- children: /* @__PURE__ */ A(oe, {
607
+ children: /* @__PURE__ */ M(ie, {
539
608
  size: 16,
540
609
  "aria-hidden": !0
541
610
  })
542
- }) : /* @__PURE__ */ A(e, {
611
+ }) : /* @__PURE__ */ M(e, {
543
612
  xstyle: Q.action,
544
613
  type: "button",
545
- "data-agent-confirm": k,
546
- "aria-label": T ? "Stopping…" : k,
614
+ "data-agent-confirm": j,
615
+ "aria-label": D ? "Stopping…" : j,
547
616
  onClick: (e) => {
548
- e.preventDefault(), w();
617
+ e.preventDefault(), E();
549
618
  },
550
619
  disabled: u,
551
- isPending: T,
552
- children: /* @__PURE__ */ A(se, {
620
+ isPending: D,
621
+ children: /* @__PURE__ */ M(ae, {
553
622
  size: 14,
554
623
  "aria-hidden": !0
555
624
  })
556
- }) }), /* @__PURE__ */ A(h.Popup, { children: B })] })]
625
+ }) }), /* @__PURE__ */ M(h.Popup, { children: H })] })]
557
626
  })
558
627
  ]
559
628
  }),
560
- y !== void 0 && /* @__PURE__ */ A(v.Description, { children: y }),
561
- x !== void 0 && /* @__PURE__ */ A(v.Error, {
562
- id: M,
629
+ x !== void 0 && /* @__PURE__ */ M(y.Description, { children: x }),
630
+ C !== void 0 && /* @__PURE__ */ M(y.Error, {
631
+ id: P,
563
632
  match: !0,
564
633
  role: "alert",
565
- children: x
634
+ children: C
566
635
  })
567
636
  ]
568
637
  })
569
638
  });
570
639
  }
571
640
  // packages/ai/src/reply-indicator.tsx
572
- function Ae({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
573
- let [r, i] = O(t === 0), { ref: a, isActive: o } = p(n && r);
574
- return T(() => {
641
+ function je({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
642
+ let [r, i] = A(t === 0), { ref: a, isActive: o } = p(n && r);
643
+ return D(() => {
575
644
  let e = setTimeout(() => i(!0), t);
576
645
  return () => clearTimeout(e);
577
- }, [t]), /* @__PURE__ */ A("div", {
646
+ }, [t]), /* @__PURE__ */ M("div", {
578
647
  ref: a,
579
648
  className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
580
- children: r && /* @__PURE__ */ A("span", {
649
+ children: r && /* @__PURE__ */ M("span", {
581
650
  role: "status",
582
651
  ...{
583
652
  0: {},
@@ -590,27 +659,27 @@ function Ae({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
590
659
  });
591
660
  }
592
661
  // packages/ai/src/sources.tsx
593
- function je({ sources: e, label: t = "Sources" }) {
594
- return /* @__PURE__ */ j("section", {
662
+ function Me({ sources: e, label: t = "Sources" }) {
663
+ return /* @__PURE__ */ N("section", {
595
664
  "aria-label": t,
596
665
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
597
666
  children: [
598
- /* @__PURE__ */ A("h3", {
667
+ /* @__PURE__ */ M("h3", {
599
668
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
600
669
  children: t
601
670
  }),
602
- e.length === 0 && /* @__PURE__ */ A("p", {
671
+ e.length === 0 && /* @__PURE__ */ M("p", {
603
672
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
604
673
  children: "No sources supplied."
605
674
  }),
606
- /* @__PURE__ */ A("ol", {
675
+ /* @__PURE__ */ M("ol", {
607
676
  className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
608
- children: e.map((e) => /* @__PURE__ */ j("li", {
677
+ children: e.map((e) => /* @__PURE__ */ N("li", {
609
678
  className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
610
- children: [/* @__PURE__ */ A("span", { children: /* @__PURE__ */ A(d, {
679
+ children: [/* @__PURE__ */ M("span", { children: /* @__PURE__ */ M(d, {
611
680
  href: e.href,
612
681
  children: e.title
613
- }) }), e.description !== void 0 && /* @__PURE__ */ A("p", {
682
+ }) }), e.description !== void 0 && /* @__PURE__ */ M("p", {
614
683
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
615
684
  children: e.description
616
685
  })]
@@ -619,21 +688,21 @@ function je({ sources: e, label: t = "Sources" }) {
619
688
  ]
620
689
  });
621
690
  }
622
- function Me({ source: e, label: t }) {
623
- return /* @__PURE__ */ A("span", {
691
+ function Ne({ source: e, label: t }) {
692
+ return /* @__PURE__ */ M("span", {
624
693
  className: "xt0psk2 x11njtxf xss6m8b",
625
- children: /* @__PURE__ */ j(m.Root, { children: [/* @__PURE__ */ A(m.Trigger, {
626
- render: /* @__PURE__ */ A(a, {}),
694
+ children: /* @__PURE__ */ N(m.Root, { children: [/* @__PURE__ */ M(m.Trigger, {
695
+ render: /* @__PURE__ */ M(a, {}),
627
696
  "aria-label": `Source ${t}: ${e.title}`,
628
697
  children: t
629
- }), /* @__PURE__ */ A(m.Popup, {
698
+ }), /* @__PURE__ */ M(m.Popup, {
630
699
  side: "top",
631
- children: /* @__PURE__ */ j(r, {
700
+ children: /* @__PURE__ */ N(r, {
632
701
  isCompact: !0,
633
702
  children: [
634
- /* @__PURE__ */ A(m.Title, { children: e.title }),
635
- e.description !== void 0 && /* @__PURE__ */ A(m.Description, { children: e.description }),
636
- /* @__PURE__ */ A(d, {
703
+ /* @__PURE__ */ M(m.Title, { children: e.title }),
704
+ e.description !== void 0 && /* @__PURE__ */ M(m.Description, { children: e.description }),
705
+ /* @__PURE__ */ M(d, {
637
706
  href: e.href,
638
707
  children: "Open source"
639
708
  })
@@ -642,4 +711,4 @@ function Me({ source: e, label: t }) {
642
711
  })] })
643
712
  });
644
713
  }
645
- export { H as Approval, le as CommandActivity, U as CommandDetails, ge as Conversation, Me as InlineCitation, Ce as Message, Ee as MessageAction, we as MessageAttachment, De as MessageBoundary, ke as PromptInput, Oe as PromptInputPlaceholder, Ae as ReplyIndicator, je as Sources };
714
+ export { W as Approval, ce as CommandActivity, G as CommandDetails, ge as Conversation, Ne as InlineCitation, we as Message, De as MessageAction, Te as MessageAttachment, Oe as MessageBoundary, Ae as PromptInput, ke as PromptInputPlaceholder, je as ReplyIndicator, Me as Sources };