@mechane-ai/elements 0.51.0 → 0.52.1

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.
Files changed (62) hide show
  1. package/dist/ai.js +169 -169
  2. package/dist/{article-CRlhq9oA.js → article-BDVuehRt.js} +1 -1
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +42 -1
  5. package/dist/{categorical-values-BYP_R5gS.js → categorical-values-BoS03HcI.js} +1 -1
  6. package/dist/charts/cartesian.js +1 -1
  7. package/dist/charts/comparison.js +1 -1
  8. package/dist/charts/distribution.js +1 -1
  9. package/dist/charts/figure.js +12 -13
  10. package/dist/charts/graph.js +1 -1
  11. package/dist/charts/hierarchy.js +1 -1
  12. package/dist/charts/image.js +1 -1
  13. package/dist/charts/matrix.js +1 -1
  14. package/dist/charts/plot.js +3 -3
  15. package/dist/charts/relationship.js +1 -1
  16. package/dist/charts/text.js +1 -1
  17. package/dist/charts/timeline.js +1 -1
  18. package/dist/charts/trend.js +1 -1
  19. package/dist/charts.js +2 -2
  20. package/dist/collections.js +1 -1
  21. package/dist/content/markdown.js +1 -278
  22. package/dist/{dates-ckJdYF7t.js → dates-CjlTzw00.js} +1 -1
  23. package/dist/{dumbbell-plot-BC8d_IJy.js → dumbbell-plot-Xxl6P7D1.js} +3 -3
  24. package/dist/{embedding-map-Bj8krO-d.js → embedding-map-tU8hT_aC.js} +3 -3
  25. package/dist/{figure-frame-koVKcXph.js → figure-frame-BKc9TvtX.js} +1 -1
  26. package/dist/forms/dates.js +1 -1
  27. package/dist/{image-grid-CLhol2jy.js → image-grid-BZy2lkNb.js} +2 -2
  28. package/dist/kits/evaluation.js +4 -4
  29. package/dist/kits/interpretability.js +7 -7
  30. package/dist/kits/operations.js +4 -4
  31. package/dist/kits/research.js +463 -183
  32. package/dist/kits/training.js +3 -3
  33. package/dist/markdown-VpLw_P9T.js +313 -0
  34. package/dist/mdx.js +2 -2
  35. package/dist/packages/charts/src/graph/tree-diagram.d.ts +1 -1
  36. package/dist/packages/charts/src/plot/plot-layout.d.ts +0 -6
  37. package/dist/packages/charts/src/timeline/event-strip.d.ts +12 -2
  38. package/dist/packages/charts/src/timeline/index.d.ts +1 -1
  39. package/dist/packages/collections/src/metrics.d.ts +5 -11
  40. package/dist/packages/content/src/markdown/markdown.d.ts +8 -1
  41. package/dist/packages/kits/src/research/collection-page.d.ts +9 -0
  42. package/dist/packages/kits/src/research/index.d.ts +3 -1
  43. package/dist/packages/kits/src/research/lineage-graph.d.ts +40 -0
  44. package/dist/{plot-layout-B2xRt-_k.js → plot-layout-D8j-ozGR.js} +102 -86
  45. package/dist/{plot-surface-0cKFwtws.js → plot-surface-5e3xeiub.js} +1 -1
  46. package/dist/{reference-lines-nSxcZVF5.js → reference-lines-1FttCg46.js} +1 -1
  47. package/dist/{scene-4ePpWdmE.js → scene-8F-fQksU.js} +4 -4
  48. package/dist/scene.js +1 -1
  49. package/dist/{slope-chart-DWZIYDty.js → slope-chart-B35ZfaYn.js} +4 -4
  50. package/dist/{src-DNclWY4V.js → src-fvoTU3Bq.js} +377 -377
  51. package/dist/{time-series-CsngFxr1.js → time-series-DoFMGmFV.js} +612 -590
  52. package/dist/{token-heatmap-BQLIxPky.js → token-heatmap-DLPQWwMv.js} +3 -3
  53. package/dist/{token-predictions-C3B5L-eO.js → token-predictions-D_Jwf8Aw.js} +3 -3
  54. package/dist/{tree-diagram-Dau9jeXS.js → tree-diagram-DreDBCvt.js} +4 -4
  55. package/dist/{treemap-DWrMQndu.js → treemap-MVX-wa4t.js} +4 -4
  56. package/dist/{violin-plot-D05ODcyc.js → violin-plot-Bi71NqXF.js} +3 -3
  57. package/dist/waterfall-8y8ANO3c.js +605 -0
  58. package/package.json +1 -1
  59. package/recipes/calendar-workspace.tsx +39 -0
  60. package/skills/use-elements/references/workspace.md +8 -6
  61. package/dist/visible-motion-1GcUaEi4.js +0 -23
  62. package/dist/waterfall-BkLLv2Lm.js +0 -576
package/dist/ai.js CHANGED
@@ -2,38 +2,38 @@ import { D as e, O as t, T as n, h as r, i, k as a, m as o, t as s, v as c } fro
2
2
  import { t as l } from "./code-block-BZsY2sh3.js";
3
3
  import { l as u } from "./src-DFW49IAs.js";
4
4
  import { t as d } from "./content-link-PnpcnTCx.js";
5
- import { r as f, t as p } from "./src-na2DdkKI.js";
6
- import { c as m, d as h } from "./src-npqwq3Sa.js";
7
- import { i as ee, t as g } from "./forms-CEbwzlRR.js";
5
+ import { n as f, r as p } from "./markdown-VpLw_P9T.js";
6
+ import { r as m, t as h } from "./src-na2DdkKI.js";
7
+ import { c as g, d as _ } from "./src-npqwq3Sa.js";
8
+ import { i as ee, t as v } from "./forms-CEbwzlRR.js";
8
9
  import { t as te } from "./accessibility-P89UG9-r.js";
9
- import { r as _ } from "./control-styles-D3q_Qyxi.js";
10
- import { t as v } from "./visible-motion-1GcUaEi4.js";
11
- import * as y from "@stylexjs/stylex";
12
- import { createParts as b } from "@ui-sdk/react/primitive";
13
- import { createContext as x, useCallback as S, useContext as C, useEffect as w, useId as ne, useLayoutEffect as T, useRef as E, useState as D } from "react";
14
- import { createInputHistory as re, definePrimitive as O, dispatch as ie, isComposing as ae } from "@ui-sdk/core";
15
- import { jsx as k, jsxs as A } from "react/jsx-runtime";
16
- import { ArrowDown as j, ArrowUp as oe, File as M, GitBranch as N, Square as se, Terminal as P } from "lucide-react";
17
- import { matchesShortcut as F } from "@ui-sdk/core/shortcuts";
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
18
  import { useShortcutHint as ce } from "@ui-sdk/react/shortcuts";
19
- import { ScrollArea as I, ScrollAreaContent as L, ScrollAreaScrollToEnd as R, ScrollAreaViewport as z, createScrollAreaController as B } from "@ui-sdk/react/scroll-area";
19
+ import { ScrollArea as L, ScrollAreaContent as R, ScrollAreaScrollToEnd as z, ScrollAreaViewport as B, createScrollAreaController as V } from "@ui-sdk/react/scroll-area";
20
20
  // packages/ai/src/approval.tsx
21
- function V(e) {
22
- return /* @__PURE__ */ A("section", {
21
+ function H(e) {
22
+ return /* @__PURE__ */ j("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__ */ k("h3", {
27
+ /* @__PURE__ */ A("h3", {
28
28
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
29
29
  children: e.title
30
30
  }),
31
- e.description !== void 0 && /* @__PURE__ */ k("p", {
31
+ e.description !== void 0 && /* @__PURE__ */ A("p", {
32
32
  className: "x1ghz6dp x153jb6y xj0a0fe",
33
33
  children: e.description
34
34
  }),
35
35
  e.children,
36
- e.status === "pending" ? /* @__PURE__ */ A(o, { children: [/* @__PURE__ */ k(n, {
36
+ e.status === "pending" ? /* @__PURE__ */ j(o, { children: [/* @__PURE__ */ A(n, {
37
37
  variant: "solid",
38
38
  "data-agent-confirm": `Approve ${e.title}?`,
39
39
  onClick: e.onApprove,
@@ -41,23 +41,23 @@ function V(e) {
41
41
  isPending: e.busy === "approve",
42
42
  pendingLabel: "Approving…",
43
43
  children: e.approveLabel ?? "Approve"
44
- }), /* @__PURE__ */ k(n, {
44
+ }), /* @__PURE__ */ A(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__ */ k(s, { children: e.statusLabel })
51
+ })] }) : /* @__PURE__ */ A(s, { children: e.statusLabel })
52
52
  ]
53
53
  });
54
54
  }
55
55
  // packages/ai/src/command-details.tsx
56
- function H({ command: e, output: t, commandNotice: n, outputNotice: a, outputLanguage: o, isRunning: s = !1 }) {
57
- return /* @__PURE__ */ A(r, {
56
+ function U({ command: e, output: t, commandNotice: n, outputNotice: a, outputLanguage: o, isRunning: s = !1 }) {
57
+ return /* @__PURE__ */ j(r, {
58
58
  isCompact: !0,
59
59
  children: [
60
- e === "" && n !== void 0 ? /* @__PURE__ */ k(i, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ k(i, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ k(l, {
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, {
61
61
  code: e,
62
62
  language: "bash",
63
63
  filename: "Command",
@@ -66,13 +66,13 @@ function H({ command: e, output: t, commandNotice: n, outputNotice: a, outputLan
66
66
  shouldWrap: !0,
67
67
  maxHeight: 240
68
68
  }),
69
- n !== void 0 && /* @__PURE__ */ k(i, { children: n }),
70
- t === void 0 || t.length === 0 ? /* @__PURE__ */ k(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__ */ k(u, {
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, {
71
71
  output: t,
72
72
  label: "Output",
73
73
  variant: "embedded",
74
74
  isRunning: s
75
- }) : /* @__PURE__ */ k(l, {
75
+ }) : /* @__PURE__ */ A(l, {
76
76
  code: t,
77
77
  language: o,
78
78
  filename: "Output",
@@ -82,74 +82,74 @@ function H({ command: e, output: t, commandNotice: n, outputNotice: a, outputLan
82
82
  isStreaming: s,
83
83
  maxHeight: 320
84
84
  }),
85
- a !== void 0 && /* @__PURE__ */ k(i, { children: a })
85
+ a !== void 0 && /* @__PURE__ */ A(i, { children: a })
86
86
  ]
87
87
  });
88
88
  }
89
89
  // packages/ai/src/command-activity.tsx
90
- var U = {
90
+ var W = {
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
- }, W = /* @__PURE__ */ new Set(["pending", "running"]);
98
- function G({ status: e, ...t }) {
97
+ }, G = /* @__PURE__ */ new Set(["pending", "running"]);
98
+ function le({ status: e, ...t }) {
99
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__ */ A(c.Root, {
100
+ return /* @__PURE__ */ j(c.Root, {
101
101
  defaultOpen: !1,
102
- children: [/* @__PURE__ */ k(c.Trigger, {
102
+ children: [/* @__PURE__ */ A(c.Trigger, {
103
103
  variant: "inline",
104
- children: /* @__PURE__ */ A("span", {
104
+ children: /* @__PURE__ */ j("span", {
105
105
  className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
106
106
  children: [
107
- /* @__PURE__ */ k(P, {
107
+ /* @__PURE__ */ A(F, {
108
108
  size: 14,
109
109
  "aria-hidden": !0,
110
110
  className: "x2lah0s"
111
111
  }),
112
- /* @__PURE__ */ k("span", {
112
+ /* @__PURE__ */ A("span", {
113
113
  className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
114
114
  children: r
115
115
  }),
116
- U[e].length > 0 && /* @__PURE__ */ k("span", {
116
+ W[e].length > 0 && /* @__PURE__ */ A("span", {
117
117
  className: "x2lah0s xy8obcc x153jb6y",
118
- children: U[e]
118
+ children: W[e]
119
119
  })
120
120
  ]
121
121
  })
122
- }), /* @__PURE__ */ k(c.Panel, { children: /* @__PURE__ */ k(H, {
122
+ }), /* @__PURE__ */ A(c.Panel, { children: /* @__PURE__ */ A(U, {
123
123
  ...t,
124
- isRunning: W.has(e)
124
+ isRunning: G.has(e)
125
125
  }) })]
126
126
  });
127
127
  }
128
128
  // packages/ai/src/conversation.tsx
129
- var K = x(void 0);
129
+ var K = S(void 0);
130
130
  function q() {
131
- let e = C(K);
131
+ let e = w(K);
132
132
  if (e === void 0) throw Error("Render the parts of a conversation inside Conversation.Root.");
133
133
  return e;
134
134
  }
135
135
  function J(e) {
136
136
  return e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
137
137
  }
138
- function le({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
139
- let i = E(null), a = r ?? i, [o] = D(t), [s] = D(B), [c, l] = D(o === "end"), [u] = D(() => ({
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(() => ({
140
140
  controller: s,
141
141
  viewport: a,
142
142
  reachEnd: () => l(!0)
143
143
  }));
144
- return T(() => {
144
+ return E(() => {
145
145
  typeof o == "object" && a.current?.scrollTo({
146
146
  top: o.top,
147
147
  left: o.left ?? 0,
148
148
  behavior: "instant"
149
149
  });
150
- }, [o, a]), /* @__PURE__ */ k(K.Provider, {
150
+ }, [o, a]), /* @__PURE__ */ A(K.Provider, {
151
151
  value: u,
152
- children: /* @__PURE__ */ k(I, {
152
+ children: /* @__PURE__ */ A(L, {
153
153
  stickToEnd: n && c,
154
154
  controller: s,
155
155
  className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
@@ -157,11 +157,11 @@ function le({ children: e, initialPosition: t = "end", shouldFollow: n = !0, vie
157
157
  })
158
158
  });
159
159
  }
160
- function ue({ label: e, children: t, scrollRestorationId: n }) {
161
- let { viewport: r, reachEnd: i } = q(), a = S((e) => {
160
+ function de({ label: e, children: t, scrollRestorationId: n }) {
161
+ let { viewport: r, reachEnd: i } = q(), a = C((e) => {
162
162
  r.current = e, e !== null && J(e) && i();
163
163
  }, [r, i]);
164
- return /* @__PURE__ */ k(z, {
164
+ return /* @__PURE__ */ A(B, {
165
165
  ref: a,
166
166
  role: "region",
167
167
  "aria-label": e,
@@ -174,8 +174,8 @@ function ue({ label: e, children: t, scrollRestorationId: n }) {
174
174
  children: t
175
175
  });
176
176
  }
177
- function de({ children: e, isStreaming: t = !1 }) {
178
- return /* @__PURE__ */ k(L, {
177
+ function Y({ children: e, isStreaming: t = !1 }) {
178
+ return /* @__PURE__ */ A(R, {
179
179
  "aria-live": "polite",
180
180
  "aria-relevant": "additions",
181
181
  "aria-busy": t,
@@ -185,59 +185,59 @@ function de({ children: e, isStreaming: t = !1 }) {
185
185
  }
186
186
  function fe({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
187
187
  let { controller: r } = q();
188
- return T(() => {
188
+ return E(() => {
189
189
  t && r.scrollToEnd({ behavior: "instant" });
190
190
  }, [
191
191
  e,
192
192
  t,
193
193
  r
194
- ]), /* @__PURE__ */ k("div", {
194
+ ]), /* @__PURE__ */ A("div", {
195
195
  "data-message-id": e,
196
196
  className: "xeuugli xj0a0fe",
197
197
  children: n
198
198
  });
199
199
  }
200
- function Y({ children: e }) {
201
- return /* @__PURE__ */ k("div", {
200
+ function pe({ children: e }) {
201
+ return /* @__PURE__ */ A("div", {
202
202
  className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
203
203
  children: e
204
204
  });
205
205
  }
206
- function pe({ label: e = "Jump to latest" }) {
207
- return /* @__PURE__ */ k(R, { render: (t, { visible: r }) => /* @__PURE__ */ k("div", {
206
+ function me({ label: e = "Jump to latest" }) {
207
+ return /* @__PURE__ */ A(z, { render: (t, { visible: r }) => /* @__PURE__ */ A("div", {
208
208
  hidden: !r,
209
209
  className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
210
- children: /* @__PURE__ */ A(n, {
210
+ children: /* @__PURE__ */ j(n, {
211
211
  ...t,
212
- children: [/* @__PURE__ */ k(j, {
212
+ children: [/* @__PURE__ */ A(M, {
213
213
  size: 14,
214
214
  "aria-hidden": !0
215
215
  }), e]
216
216
  })
217
217
  }) });
218
218
  }
219
- function me({ label: e, onActivate: t }) {
219
+ function he({ label: e, onActivate: t }) {
220
220
  let { controller: r, viewport: i } = q();
221
- return /* @__PURE__ */ A(n, {
221
+ return /* @__PURE__ */ j(n, {
222
222
  onClick: () => {
223
223
  t?.(), requestAnimationFrame(() => {
224
224
  r.scrollToEnd({ behavior: "instant" }), i.current?.focus({ preventScroll: !0 });
225
225
  });
226
226
  },
227
- children: [/* @__PURE__ */ k(j, {
227
+ children: [/* @__PURE__ */ A(M, {
228
228
  size: 14,
229
229
  "aria-hidden": !0
230
230
  }), e]
231
231
  });
232
232
  }
233
- var he = {
234
- Root: le,
235
- Viewport: ue,
236
- Content: de,
233
+ var ge = {
234
+ Root: ue,
235
+ Viewport: de,
236
+ Content: Y,
237
237
  Item: fe,
238
- Controls: Y,
239
- LatestButton: me,
240
- JumpToLatest: pe
238
+ Controls: pe,
239
+ LatestButton: he,
240
+ JumpToLatest: me
241
241
  }, X = {
242
242
  root: {
243
243
  k1xSpc: "x78zum5",
@@ -275,11 +275,11 @@ var he = {
275
275
  k8WAf4: "xn9t2bk",
276
276
  $$css: !0
277
277
  }
278
- }, ge = {
278
+ }, _e = {
279
279
  user: X.user,
280
280
  assistant: X.assistant,
281
281
  system: X.system
282
- }, _e = {
282
+ }, ve = {
283
283
  user: X.bubble,
284
284
  assistant: X.chatReply,
285
285
  system: null
@@ -287,7 +287,7 @@ var he = {
287
287
  function Z({ kind: e }) {
288
288
  return { kind: e };
289
289
  }
290
- var ve = O({
290
+ var ye = k({
291
291
  name: "message",
292
292
  options: { kind: "string" },
293
293
  state: Z,
@@ -299,47 +299,47 @@ var ve = O({
299
299
  root: e({}),
300
300
  description: e({})
301
301
  })
302
- }), { Root: ye, Description: be } = b(ve, {
302
+ }), { Root: be, Description: xe } = x(ye, {
303
303
  root: "article",
304
304
  description: "div"
305
- }), xe = {
305
+ }), Se = {
306
306
  "x-default-marker": "x-default-marker",
307
307
  $$css: !0
308
308
  };
309
- function Se({ 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", f = u ? /* @__PURE__ */ A("header", {
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", {
311
311
  className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
312
312
  children: [
313
- a !== void 0 && /* @__PURE__ */ k("span", {
313
+ a !== void 0 && /* @__PURE__ */ A("span", {
314
314
  className: "x3nfvp2 x2lah0s",
315
315
  children: a
316
316
  }),
317
- /* @__PURE__ */ k("span", {
317
+ /* @__PURE__ */ A("span", {
318
318
  className: "xk4h15q xeuugli xj0a0fe",
319
319
  children: e
320
320
  }),
321
- i !== void 0 && /* @__PURE__ */ k("div", {
321
+ i !== void 0 && /* @__PURE__ */ A("div", {
322
322
  className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
323
323
  children: i
324
324
  })
325
325
  ]
326
326
  }) : null;
327
- return /* @__PURE__ */ A(ye, {
327
+ return /* @__PURE__ */ j(be, {
328
328
  kind: r,
329
329
  ...n !== void 0 && { id: n },
330
330
  "aria-label": e,
331
- ...y.props(X.root, ge[r], l && _e[r], xe),
331
+ ...b.props(X.root, _e[r], l && ve[r], Se),
332
332
  children: [
333
- f,
334
- /* @__PURE__ */ k(be, {
333
+ p,
334
+ /* @__PURE__ */ A(xe, {
335
335
  className: "xeuugli xj0a0fe x1ytb0s6",
336
- children: t
336
+ children: l && r === "assistant" && typeof t == "string" ? /* @__PURE__ */ A(f, { children: t }) : t
337
337
  }),
338
- s !== void 0 && /* @__PURE__ */ k("div", {
338
+ s !== void 0 && /* @__PURE__ */ A("div", {
339
339
  className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
340
340
  children: s
341
341
  }),
342
- (o !== void 0 || d) && /* @__PURE__ */ k("footer", {
342
+ (o !== void 0 || d) && /* @__PURE__ */ A("footer", {
343
343
  ...{
344
344
  0: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b" },
345
345
  1: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b x17tes2r x17oiadl" }
@@ -349,26 +349,26 @@ function Se({ author: e, children: t, id: n, kind: r = "assistant", meta: i, ava
349
349
  ]
350
350
  });
351
351
  }
352
- function Ce({ name: e, description: t, href: n, actions: r }) {
353
- return /* @__PURE__ */ A("div", {
352
+ function we({ name: e, description: t, href: n, actions: r }) {
353
+ return /* @__PURE__ */ j("div", {
354
354
  className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
355
355
  children: [
356
- /* @__PURE__ */ k(M, {
356
+ /* @__PURE__ */ A(N, {
357
357
  size: 16,
358
358
  "aria-hidden": !0,
359
359
  className: "x153jb6y x2lah0s"
360
360
  }),
361
- /* @__PURE__ */ A("div", {
361
+ /* @__PURE__ */ j("div", {
362
362
  className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
363
- children: [n === void 0 ? /* @__PURE__ */ k("span", { children: e }) : /* @__PURE__ */ k(d, {
363
+ children: [n === void 0 ? /* @__PURE__ */ A("span", { children: e }) : /* @__PURE__ */ A(d, {
364
364
  href: n,
365
365
  children: e
366
- }), t !== void 0 && /* @__PURE__ */ k("span", {
366
+ }), t !== void 0 && /* @__PURE__ */ A("span", {
367
367
  className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
368
368
  children: t
369
369
  })]
370
370
  }),
371
- r !== void 0 && /* @__PURE__ */ k("div", {
371
+ r !== void 0 && /* @__PURE__ */ A("div", {
372
372
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
373
373
  children: r
374
374
  })
@@ -376,39 +376,39 @@ function Ce({ name: e, description: t, href: n, actions: r }) {
376
376
  });
377
377
  }
378
378
  // packages/ai/src/message-action.tsx
379
- function we(n) {
379
+ function Te(n) {
380
380
  if (n.kind === "link") {
381
381
  let { kind: e, label: r, ...i } = n;
382
- return /* @__PURE__ */ k(t, {
382
+ return /* @__PURE__ */ A(t, {
383
383
  ...i,
384
384
  "aria-label": r
385
385
  });
386
386
  }
387
387
  let { kind: r, label: i, ...a } = n;
388
- return /* @__PURE__ */ k(e, {
388
+ return /* @__PURE__ */ A(e, {
389
389
  ...a,
390
390
  variant: "ghost",
391
391
  "aria-label": i
392
392
  });
393
393
  }
394
- function Te(e) {
395
- return /* @__PURE__ */ A(p.Root, { children: [/* @__PURE__ */ k(p.Trigger, { render: we(e) }), /* @__PURE__ */ k(p.Popup, { children: e.label })] });
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 })] });
396
396
  }
397
397
  // packages/ai/src/message-boundary.tsx
398
- function Ee({ label: e, children: t }) {
399
- return /* @__PURE__ */ A(c.Root, {
398
+ function De({ label: e, children: t }) {
399
+ return /* @__PURE__ */ j(c.Root, {
400
400
  className: "xeuugli x1kbiq1m xykt701 xpu655y",
401
- children: [/* @__PURE__ */ A(c.Trigger, {
401
+ children: [/* @__PURE__ */ j(c.Trigger, {
402
402
  className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
403
- children: [/* @__PURE__ */ k(N, {
403
+ children: [/* @__PURE__ */ A(P, {
404
404
  size: 14,
405
405
  "aria-hidden": !0,
406
406
  className: "x2lah0s"
407
- }), /* @__PURE__ */ k("span", {
407
+ }), /* @__PURE__ */ A("span", {
408
408
  className: "xeuugli xj0a0fe",
409
409
  children: e
410
410
  })]
411
- }), /* @__PURE__ */ k(c.Panel, {
411
+ }), /* @__PURE__ */ A(c.Panel, {
412
412
  className: "x153jb6y xy8obcc xas2l8k",
413
413
  children: t
414
414
  })]
@@ -426,25 +426,25 @@ var Q = {
426
426
  $$css: !0
427
427
  }
428
428
  }, $ = "mod+enter";
429
- function De({ isCompact: e = !1 }) {
430
- return /* @__PURE__ */ k("div", {
429
+ function Oe({ isCompact: e = !1 }) {
430
+ return /* @__PURE__ */ A("div", {
431
431
  "aria-hidden": !0,
432
432
  inert: !0,
433
433
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
434
- children: /* @__PURE__ */ A("div", {
434
+ children: /* @__PURE__ */ j("div", {
435
435
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
436
- children: [/* @__PURE__ */ k("div", {
437
- ...y.props(_.base, _.field, _.textarea, _.plainTextarea),
438
- children: /* @__PURE__ */ k(h, {
436
+ children: [/* @__PURE__ */ A("div", {
437
+ ...b.props(y.base, y.field, y.textarea, y.plainTextarea),
438
+ children: /* @__PURE__ */ A(_, {
439
439
  lines: e ? 1 : 2,
440
440
  width: "22ch"
441
441
  })
442
- }), /* @__PURE__ */ A("div", {
442
+ }), /* @__PURE__ */ j("div", {
443
443
  className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
444
- children: [/* @__PURE__ */ k("div", {
444
+ children: [/* @__PURE__ */ A("div", {
445
445
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
446
- children: /* @__PURE__ */ k(h, { width: "8ch" })
447
- }), /* @__PURE__ */ k(m, {
446
+ children: /* @__PURE__ */ A(_, { width: "8ch" })
447
+ }), /* @__PURE__ */ A(g, {
448
448
  isIconOnly: !0,
449
449
  xstyle: Q.action
450
450
  })]
@@ -452,20 +452,20 @@ function De({ isCompact: e = !1 }) {
452
452
  })
453
453
  });
454
454
  }
455
- function Oe({ 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: m = "Sending…", enterBehavior: h = "newline", history: _, isCompact: v = !1, description: b, error: x, controls: S, attachments: C, onStop: w, isStopPending: O = !1, stopLabel: j = "Stop response" }) {
456
- let M = ne(), N = u, P = v && C === void 0 && S === void 0, I = !N && !l && !d, L = ce($), R = E({
457
- history: _,
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({
457
+ history: g,
458
458
  value: n,
459
459
  onValueChange: r
460
460
  });
461
- T(() => {
461
+ E(() => {
462
462
  R.current = {
463
- history: _,
463
+ history: g,
464
464
  value: n,
465
465
  onValueChange: r
466
466
  };
467
467
  });
468
- let [z] = D(() => re({
468
+ let [z] = O(() => re({
469
469
  entries: () => R.current.history,
470
470
  read: () => R.current.value,
471
471
  write: (e, t) => !ie({ options: () => R.current }, "onValueChange", e, {
@@ -473,26 +473,26 @@ function Oe({ label: t, value: n, onValueChange: r, onSubmit: i, name: a = "prom
473
473
  event: t
474
474
  })
475
475
  })), B = `${f} · ${L.text}`;
476
- w === void 0 ? l ? B = m : h === "submit" && (B = `${f} · Enter`) : B = O ? "Stopping…" : j;
476
+ w === void 0 ? l ? B = p : m === "submit" && (B = `${f} · Enter`) : B = T ? "Stopping…" : k;
477
477
  function V(e) {
478
478
  if (z.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || ae(e)) return;
479
- let t = F(e.nativeEvent, $), n = !t && F(e.nativeEvent, "enter");
480
- (t || h === "submit" && n) && (e.preventDefault(), I && w === void 0 && e.currentTarget.form?.requestSubmit());
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());
481
481
  }
482
482
  function H(e) {
483
- e.preventDefault(), I && w === void 0 && i(e);
483
+ e.preventDefault(), F && w === void 0 && i(e);
484
484
  }
485
- return /* @__PURE__ */ k("form", {
485
+ return /* @__PURE__ */ A("form", {
486
486
  onSubmit: H,
487
487
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
488
- children: /* @__PURE__ */ A(g.Root, {
488
+ children: /* @__PURE__ */ j(v.Root, {
489
489
  invalid: x !== void 0,
490
490
  children: [
491
- /* @__PURE__ */ k(g.Label, {
492
- ...y.props(te.hidden),
491
+ /* @__PURE__ */ A(v.Label, {
492
+ ...b.props(te.hidden),
493
493
  children: t
494
494
  }),
495
- /* @__PURE__ */ A("div", {
495
+ /* @__PURE__ */ j("div", {
496
496
  ...{
497
497
  0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
498
498
  2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
@@ -500,11 +500,11 @@ function Oe({ label: t, value: n, onValueChange: r, onSubmit: i, name: a = "prom
500
500
  3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
501
501
  }[!!P << 1 | x !== void 0],
502
502
  children: [
503
- /* @__PURE__ */ k(ee, {
503
+ /* @__PURE__ */ A(ee, {
504
504
  isSensitive: !0,
505
505
  appearance: "plain",
506
- rows: v ? 1 : 2,
507
- isCompact: v,
506
+ rows: _ ? 1 : 2,
507
+ isCompact: _,
508
508
  shouldGrow: P,
509
509
  xstyle: P ? Q.inlineInput : void 0,
510
510
  name: a,
@@ -518,47 +518,47 @@ function Oe({ label: t, value: n, onValueChange: r, onSubmit: i, name: a = "prom
518
518
  "aria-errormessage": x === void 0 ? void 0 : M
519
519
  }),
520
520
  C,
521
- /* @__PURE__ */ A("div", {
521
+ /* @__PURE__ */ j("div", {
522
522
  ...{
523
523
  0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
524
524
  1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
525
525
  }[!!P | 0],
526
- children: [S !== void 0 && /* @__PURE__ */ k("div", {
526
+ children: [S !== void 0 && /* @__PURE__ */ A("div", {
527
527
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
528
528
  children: S
529
- }), /* @__PURE__ */ A(p.Root, { children: [/* @__PURE__ */ k(p.Trigger, { render: w === void 0 ? /* @__PURE__ */ k(e, {
529
+ }), /* @__PURE__ */ j(h.Root, { children: [/* @__PURE__ */ A(h.Trigger, { render: w === void 0 ? /* @__PURE__ */ A(e, {
530
530
  xstyle: Q.action,
531
531
  type: "submit",
532
532
  "data-agent-confirm": f,
533
533
  variant: "solid",
534
- "aria-label": l ? m : f,
535
- "aria-keyshortcuts": h === "submit" ? `Enter ${L.ariaKeyshortcuts}` : L.ariaKeyshortcuts,
534
+ "aria-label": l ? p : f,
535
+ "aria-keyshortcuts": m === "submit" ? `Enter ${L.ariaKeyshortcuts}` : L.ariaKeyshortcuts,
536
536
  disabled: u || d,
537
537
  isPending: l,
538
- children: /* @__PURE__ */ k(oe, {
538
+ children: /* @__PURE__ */ A(oe, {
539
539
  size: 16,
540
540
  "aria-hidden": !0
541
541
  })
542
- }) : /* @__PURE__ */ k(e, {
542
+ }) : /* @__PURE__ */ A(e, {
543
543
  xstyle: Q.action,
544
544
  type: "button",
545
- "data-agent-confirm": j,
546
- "aria-label": O ? "Stopping…" : j,
545
+ "data-agent-confirm": k,
546
+ "aria-label": T ? "Stopping…" : k,
547
547
  onClick: (e) => {
548
548
  e.preventDefault(), w();
549
549
  },
550
550
  disabled: u,
551
- isPending: O,
552
- children: /* @__PURE__ */ k(se, {
551
+ isPending: T,
552
+ children: /* @__PURE__ */ A(se, {
553
553
  size: 14,
554
554
  "aria-hidden": !0
555
555
  })
556
- }) }), /* @__PURE__ */ k(p.Popup, { children: B })] })]
556
+ }) }), /* @__PURE__ */ A(h.Popup, { children: B })] })]
557
557
  })
558
558
  ]
559
559
  }),
560
- b !== void 0 && /* @__PURE__ */ k(g.Description, { children: b }),
561
- x !== void 0 && /* @__PURE__ */ k(g.Error, {
560
+ y !== void 0 && /* @__PURE__ */ A(v.Description, { children: y }),
561
+ x !== void 0 && /* @__PURE__ */ A(v.Error, {
562
562
  id: M,
563
563
  match: !0,
564
564
  role: "alert",
@@ -569,15 +569,15 @@ function Oe({ label: t, value: n, onValueChange: r, onSubmit: i, name: a = "prom
569
569
  });
570
570
  }
571
571
  // packages/ai/src/reply-indicator.tsx
572
- function ke({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
573
- let [r, i] = D(t === 0), { ref: a, isActive: o } = v(n && r);
574
- return w(() => {
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(() => {
575
575
  let e = setTimeout(() => i(!0), t);
576
576
  return () => clearTimeout(e);
577
- }, [t]), /* @__PURE__ */ k("div", {
577
+ }, [t]), /* @__PURE__ */ A("div", {
578
578
  ref: a,
579
579
  className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
580
- children: r && /* @__PURE__ */ k("span", {
580
+ children: r && /* @__PURE__ */ A("span", {
581
581
  role: "status",
582
582
  ...{
583
583
  0: {},
@@ -590,27 +590,27 @@ function ke({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
590
590
  });
591
591
  }
592
592
  // packages/ai/src/sources.tsx
593
- function Ae({ sources: e, label: t = "Sources" }) {
594
- return /* @__PURE__ */ A("section", {
593
+ function je({ sources: e, label: t = "Sources" }) {
594
+ return /* @__PURE__ */ j("section", {
595
595
  "aria-label": t,
596
596
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
597
597
  children: [
598
- /* @__PURE__ */ k("h3", {
598
+ /* @__PURE__ */ A("h3", {
599
599
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
600
600
  children: t
601
601
  }),
602
- e.length === 0 && /* @__PURE__ */ k("p", {
602
+ e.length === 0 && /* @__PURE__ */ A("p", {
603
603
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
604
604
  children: "No sources supplied."
605
605
  }),
606
- /* @__PURE__ */ k("ol", {
606
+ /* @__PURE__ */ A("ol", {
607
607
  className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
608
- children: e.map((e) => /* @__PURE__ */ A("li", {
608
+ children: e.map((e) => /* @__PURE__ */ j("li", {
609
609
  className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
610
- children: [/* @__PURE__ */ k("span", { children: /* @__PURE__ */ k(d, {
610
+ children: [/* @__PURE__ */ A("span", { children: /* @__PURE__ */ A(d, {
611
611
  href: e.href,
612
612
  children: e.title
613
- }) }), e.description !== void 0 && /* @__PURE__ */ k("p", {
613
+ }) }), e.description !== void 0 && /* @__PURE__ */ A("p", {
614
614
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
615
615
  children: e.description
616
616
  })]
@@ -619,21 +619,21 @@ function Ae({ sources: e, label: t = "Sources" }) {
619
619
  ]
620
620
  });
621
621
  }
622
- function je({ source: e, label: t }) {
623
- return /* @__PURE__ */ k("span", {
622
+ function Me({ source: e, label: t }) {
623
+ return /* @__PURE__ */ A("span", {
624
624
  className: "xt0psk2 x11njtxf xss6m8b",
625
- children: /* @__PURE__ */ A(f.Root, { children: [/* @__PURE__ */ k(f.Trigger, {
626
- render: /* @__PURE__ */ k(a, {}),
625
+ children: /* @__PURE__ */ j(m.Root, { children: [/* @__PURE__ */ A(m.Trigger, {
626
+ render: /* @__PURE__ */ A(a, {}),
627
627
  "aria-label": `Source ${t}: ${e.title}`,
628
628
  children: t
629
- }), /* @__PURE__ */ k(f.Popup, {
629
+ }), /* @__PURE__ */ A(m.Popup, {
630
630
  side: "top",
631
- children: /* @__PURE__ */ A(r, {
631
+ children: /* @__PURE__ */ j(r, {
632
632
  isCompact: !0,
633
633
  children: [
634
- /* @__PURE__ */ k(f.Title, { children: e.title }),
635
- e.description !== void 0 && /* @__PURE__ */ k(f.Description, { children: e.description }),
636
- /* @__PURE__ */ k(d, {
634
+ /* @__PURE__ */ A(m.Title, { children: e.title }),
635
+ e.description !== void 0 && /* @__PURE__ */ A(m.Description, { children: e.description }),
636
+ /* @__PURE__ */ A(d, {
637
637
  href: e.href,
638
638
  children: "Open source"
639
639
  })
@@ -642,4 +642,4 @@ function je({ source: e, label: t }) {
642
642
  })] })
643
643
  });
644
644
  }
645
- export { V as Approval, G as CommandActivity, H as CommandDetails, he as Conversation, je as InlineCitation, Se as Message, Te as MessageAction, Ce as MessageAttachment, Ee as MessageBoundary, Oe as PromptInput, De as PromptInputPlaceholder, ke as ReplyIndicator, Ae as Sources };
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 };