@mechane-ai/elements 0.67.0 → 0.68.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 +225 -224
- package/dist/{article-anMy8fA5.js → article-Ni152e-v.js} +104 -89
- package/dist/article.js +1 -1
- package/dist/catalog.json +71 -1
- package/dist/{categorical-values-Bh7ZkEQn.js → categorical-values-6Iz03F1i.js} +1 -1
- package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/plot.js +16 -15
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +2 -2
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/{dumbbell-plot-BQDGe0sQ.js → dumbbell-plot-jaQvOctJ.js} +4 -4
- package/dist/{embedding-map-DmmknG7A.js → embedding-map-DnZL1kvY.js} +5 -5
- package/dist/figure-format-BVb7yFCA.js +46 -0
- package/dist/{figure-frame-DlyNTDzh.js → figure-frame-96zFqsWz.js} +1 -1
- package/dist/{image-grid-CxEAQvTf.js → image-grid-B6fdmE9c.js} +3 -3
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +8 -8
- package/dist/kits/operations.js +4 -4
- package/dist/kits/research.js +641 -229
- package/dist/kits/training.js +4 -4
- package/dist/lesson.js +3 -3
- package/dist/markdown-JeuBeMDZ.js +293 -0
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/plot/index.d.ts +2 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
- package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
- package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
- package/dist/packages/kits/src/research/index.d.ts +7 -0
- package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
- package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
- package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
- package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
- package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
- package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
- package/dist/{param-CKr8EYxF.js → param-Dk92C-K1.js} +1 -1
- package/dist/plot-CpTwLIYN.js +101 -0
- package/dist/{plot-layout-CVzSbcU7.js → plot-layout-1MG72ZWn.js} +151 -101
- package/dist/{plot-surface-CBhI1alw.js → plot-surface-8-FZI94y.js} +1 -1
- package/dist/{reference-lines-C970JwWZ.js → reference-lines-C18o1yEY.js} +1 -1
- package/dist/{scene-C3dCxckI.js → scene-B8dppj5V.js} +7 -7
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-DekEJxsy.js → slope-chart-CELflRJd.js} +5 -5
- package/dist/styles2.css +12 -0
- package/dist/{time-series-BSNnijxf.js → time-series-DtAtGoT_.js} +6 -6
- package/dist/{timeline-CnxfYSIg.js → timeline-CzianQir.js} +4 -4
- package/dist/{token-heatmap-CJaXo56P.js → token-heatmap-m6oaMwkK.js} +273 -288
- package/dist/{token-predictions-Bi7aKPnh.js → token-predictions-CpGVjOIs.js} +4 -4
- package/dist/{transport-CXj0DV6o.js → transport-DQ1yzsQl.js} +2 -2
- package/dist/{tree-diagram-BxOZsjr1.js → tree-diagram-D9ekymCQ.js} +4 -4
- package/dist/{treemap-B2yOAetT.js → treemap-DT8q65LQ.js} +5 -5
- package/dist/{use-tween-C1TWJwce.js → use-tween-DbXVZBR8.js} +1 -1
- package/dist/{violin-plot-W2L_2JRo.js → violin-plot-83HSjnQM.js} +4 -4
- package/dist/visible-motion-D6NwjGNz.js +24 -0
- package/dist/{waterfall-Bt73N2Ng.js → waterfall-DmApvdrY.js} +4 -4
- package/package.json +1 -1
- package/recipes/recorded-motion.tsx +14 -0
- package/skills/review-elements/SKILL.md +4 -0
- package/skills/review-explainer/SKILL.md +4 -0
- package/skills/use-elements/SKILL.md +2 -0
- package/skills/use-elements/references/kits.md +23 -0
- package/skills/write-explainer/SKILL.md +5 -0
- package/dist/figure-format-B8kRZMlo.js +0 -36
- package/dist/markdown-Diffqqm7.js +0 -313
package/dist/ai.js
CHANGED
|
@@ -2,38 +2,39 @@ import { A as e, E as t, F as n, O as r, h as i, i as a, k as o, m as s, t as c,
|
|
|
2
2
|
import { t as u } from "./code-block-DbW_t9U4.js";
|
|
3
3
|
import { f as d } from "./src-BsqbWDxS.js";
|
|
4
4
|
import { t as f } from "./content-link-BN4NPp0u.js";
|
|
5
|
-
import { n as p
|
|
6
|
-
import { i as
|
|
7
|
-
import { c as
|
|
8
|
-
import { i as
|
|
9
|
-
import { t as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
5
|
+
import { n as p } from "./markdown-JeuBeMDZ.js";
|
|
6
|
+
import { i as m, r as h, t as g } from "./src-na2DdkKI.js";
|
|
7
|
+
import { c as _, d as v } from "./src-CIyuaSCi.js";
|
|
8
|
+
import { i as y, t as b } from "./forms-iAOjGRTO.js";
|
|
9
|
+
import { t as x } from "./accessibility-P89UG9-r.js";
|
|
10
|
+
import { t as S } from "./visible-motion-D6NwjGNz.js";
|
|
11
|
+
import * as C from "@stylexjs/stylex";
|
|
12
|
+
import { createParts as w } from "@ui-sdk/react/primitive";
|
|
13
|
+
import { createContext as T, useCallback as E, useContext as D, useEffect as O, useId as ee, useLayoutEffect as k, useRef as A, useState as j } from "react";
|
|
14
|
+
import { createInputHistory as te, definePrimitive as M, dispatch as ne, isComposing as re } from "@ui-sdk/core";
|
|
15
|
+
import { jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
16
|
+
import { ArrowDown as F, ArrowUp as ie, File as I, GitBranch as L, SmilePlus as R, Square as ae, Terminal as z } from "lucide-react";
|
|
17
|
+
import { Toggle as B } from "@ui-sdk/react/toggle";
|
|
18
|
+
import { matchesShortcut as V } from "@ui-sdk/core/shortcuts";
|
|
19
|
+
import { useShortcutHint as oe } from "@ui-sdk/react/shortcuts";
|
|
20
|
+
import { ScrollArea as H, ScrollAreaContent as U, ScrollAreaScrollToEnd as W, ScrollAreaViewport as se, createScrollAreaController as ce } from "@ui-sdk/react/scroll-area";
|
|
20
21
|
// packages/ai/src/approval.tsx
|
|
21
|
-
function
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
function le(e) {
|
|
23
|
+
return /* @__PURE__ */ P("section", {
|
|
23
24
|
"aria-label": e.title,
|
|
24
25
|
"data-request-id": e.requestId,
|
|
25
26
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
26
27
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ N("h3", {
|
|
28
29
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
29
30
|
children: e.title
|
|
30
31
|
}),
|
|
31
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
32
|
+
e.description !== void 0 && /* @__PURE__ */ N("p", {
|
|
32
33
|
className: "x1ghz6dp x153jb6y xj0a0fe",
|
|
33
34
|
children: e.description
|
|
34
35
|
}),
|
|
35
36
|
e.children,
|
|
36
|
-
e.status === "pending" ? /* @__PURE__ */
|
|
37
|
+
e.status === "pending" ? /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(t, {
|
|
37
38
|
variant: "solid",
|
|
38
39
|
"data-agent-confirm": `Approve ${e.title}?`,
|
|
39
40
|
onClick: e.onApprove,
|
|
@@ -41,23 +42,23 @@ function ue(e) {
|
|
|
41
42
|
isPending: e.busy === "approve",
|
|
42
43
|
pendingLabel: "Approving…",
|
|
43
44
|
children: e.approveLabel ?? "Approve"
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
+
}), /* @__PURE__ */ N(t, {
|
|
45
46
|
"data-agent-confirm": `Deny ${e.title}?`,
|
|
46
47
|
onClick: e.onDeny,
|
|
47
48
|
disabled: e.isDisabled === !0 || e.busy !== void 0,
|
|
48
49
|
isPending: e.busy === "deny",
|
|
49
50
|
pendingLabel: "Denying…",
|
|
50
51
|
children: e.denyLabel ?? "Deny"
|
|
51
|
-
})] }) : /* @__PURE__ */
|
|
52
|
+
})] }) : /* @__PURE__ */ N(c, { children: e.statusLabel })
|
|
52
53
|
]
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
// packages/ai/src/command-details.tsx
|
|
56
|
-
function
|
|
57
|
-
return /* @__PURE__ */
|
|
57
|
+
function G({ command: e, output: t, commandNotice: n, outputNotice: r, outputLanguage: o, isRunning: s = !1 }) {
|
|
58
|
+
return /* @__PURE__ */ P(i, {
|
|
58
59
|
isCompact: !0,
|
|
59
60
|
children: [
|
|
60
|
-
e === "" && n !== void 0 ? /* @__PURE__ */
|
|
61
|
+
e === "" && n !== void 0 ? /* @__PURE__ */ N(a, { children: "Command omitted from this preview." }) : e === void 0 ? /* @__PURE__ */ N(a, { children: s ? "Preparing command…" : "Command unavailable." }) : /* @__PURE__ */ N(u, {
|
|
61
62
|
code: e,
|
|
62
63
|
language: "bash",
|
|
63
64
|
filename: "Command",
|
|
@@ -66,13 +67,13 @@ function W({ command: e, output: t, commandNotice: n, outputNotice: r, outputLan
|
|
|
66
67
|
shouldWrap: !0,
|
|
67
68
|
maxHeight: 240
|
|
68
69
|
}),
|
|
69
|
-
n !== void 0 && /* @__PURE__ */
|
|
70
|
-
t === void 0 || t.length === 0 ? /* @__PURE__ */
|
|
70
|
+
n !== void 0 && /* @__PURE__ */ N(a, { children: n }),
|
|
71
|
+
t === void 0 || t.length === 0 ? /* @__PURE__ */ N(a, { children: s ? "Waiting for output…" : t === void 0 ? "Output unavailable." : r === void 0 ? "No output." : "Output omitted from this preview." }) : o === void 0 ? /* @__PURE__ */ N(d, {
|
|
71
72
|
output: t,
|
|
72
73
|
label: "Output",
|
|
73
74
|
variant: "embedded",
|
|
74
75
|
isRunning: s
|
|
75
|
-
}) : /* @__PURE__ */
|
|
76
|
+
}) : /* @__PURE__ */ N(u, {
|
|
76
77
|
code: t,
|
|
77
78
|
language: o,
|
|
78
79
|
filename: "Output",
|
|
@@ -82,90 +83,90 @@ function W({ command: e, output: t, commandNotice: n, outputNotice: r, outputLan
|
|
|
82
83
|
isStreaming: s,
|
|
83
84
|
maxHeight: 320
|
|
84
85
|
}),
|
|
85
|
-
r !== void 0 && /* @__PURE__ */
|
|
86
|
+
r !== void 0 && /* @__PURE__ */ N(a, { children: r })
|
|
86
87
|
]
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
// packages/ai/src/command-activity.tsx
|
|
90
|
-
var
|
|
91
|
+
var K = {
|
|
91
92
|
pending: "Preparing",
|
|
92
93
|
running: "Running",
|
|
93
94
|
complete: "",
|
|
94
95
|
failed: "Failed",
|
|
95
96
|
stopped: "Stopped",
|
|
96
97
|
unknown: "Outcome unknown"
|
|
97
|
-
},
|
|
98
|
-
function
|
|
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, c = o || s, u = c ? /* @__PURE__ */
|
|
98
|
+
}, ue = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
99
|
+
function de({ status: e, duration: t, meta: n, ...r }) {
|
|
100
|
+
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, c = o || s, u = c ? /* @__PURE__ */ P("span", {
|
|
100
101
|
className: "x3nfvp2 x6s0dn4 x1hnptsi xvc5jky x2lah0s xy8obcc xss6m8b x153jb6y xuxw1ft",
|
|
101
|
-
children: [o && /* @__PURE__ */
|
|
102
|
+
children: [o && /* @__PURE__ */ N("span", {
|
|
102
103
|
className: "x153jb6y",
|
|
103
104
|
children: n
|
|
104
|
-
}), s && /* @__PURE__ */
|
|
105
|
+
}), s && /* @__PURE__ */ N("span", {
|
|
105
106
|
className: "x153jb6y",
|
|
106
107
|
children: t
|
|
107
108
|
})]
|
|
108
|
-
}) : null, d = /* @__PURE__ */
|
|
109
|
+
}) : null, d = /* @__PURE__ */ P("span", {
|
|
109
110
|
...{
|
|
110
111
|
0: { className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli x153jb6y xj57cvi" },
|
|
111
112
|
1: { className: "x6s0dn4 x1hnptsi xeuugli x153jb6y xj57cvi x78zum5 x12lumcd" }
|
|
112
113
|
}[!!c | 0],
|
|
113
114
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ N(z, {
|
|
115
116
|
size: 14,
|
|
116
117
|
"aria-hidden": !0,
|
|
117
118
|
className: "x2lah0s"
|
|
118
119
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ N("span", {
|
|
120
121
|
className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
|
|
121
122
|
children: a
|
|
122
123
|
}),
|
|
123
|
-
|
|
124
|
+
K[e].length > 0 && /* @__PURE__ */ N("span", {
|
|
124
125
|
className: "x2lah0s xy8obcc x153jb6y",
|
|
125
|
-
children:
|
|
126
|
+
children: K[e]
|
|
126
127
|
}),
|
|
127
128
|
u
|
|
128
129
|
]
|
|
129
130
|
});
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ P(l.Root, {
|
|
131
132
|
defaultOpen: !1,
|
|
132
|
-
children: [c ? /* @__PURE__ */
|
|
133
|
+
children: [c ? /* @__PURE__ */ N(l.Trigger, {
|
|
133
134
|
className: "xt970qd xunmzkg x153jb6y xj57cvi",
|
|
134
135
|
children: d
|
|
135
|
-
}) : /* @__PURE__ */
|
|
136
|
+
}) : /* @__PURE__ */ N(l.Trigger, {
|
|
136
137
|
variant: "inline",
|
|
137
138
|
children: d
|
|
138
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ N(l.Panel, { children: /* @__PURE__ */ N(G, {
|
|
139
140
|
...r,
|
|
140
|
-
isRunning:
|
|
141
|
+
isRunning: ue.has(e)
|
|
141
142
|
}) })]
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
145
|
// packages/ai/src/conversation.tsx
|
|
145
|
-
var
|
|
146
|
-
function
|
|
147
|
-
let e =
|
|
146
|
+
var q = T(void 0);
|
|
147
|
+
function J() {
|
|
148
|
+
let e = D(q);
|
|
148
149
|
if (e === void 0) throw Error("Render the parts of a conversation inside Conversation.Root.");
|
|
149
150
|
return e;
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
+
function Y(e) {
|
|
152
153
|
return e.scrollHeight - e.clientHeight - e.scrollTop <= 1;
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
-
let i =
|
|
155
|
+
function fe({ children: e, initialPosition: t = "end", shouldFollow: n = !0, viewportRef: r }) {
|
|
156
|
+
let i = A(null), a = r ?? i, [o] = j(t), [s] = j(ce), [c, l] = j(o === "end"), [u] = j(() => ({
|
|
156
157
|
controller: s,
|
|
157
158
|
viewport: a,
|
|
158
159
|
reachEnd: () => l(!0)
|
|
159
160
|
}));
|
|
160
|
-
return
|
|
161
|
+
return k(() => {
|
|
161
162
|
typeof o == "object" && a.current?.scrollTo({
|
|
162
163
|
top: o.top,
|
|
163
164
|
left: o.left ?? 0,
|
|
164
165
|
behavior: "instant"
|
|
165
166
|
});
|
|
166
|
-
}, [o, a]), /* @__PURE__ */
|
|
167
|
+
}, [o, a]), /* @__PURE__ */ N(q.Provider, {
|
|
167
168
|
value: u,
|
|
168
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ N(H, {
|
|
169
170
|
stickToEnd: n && c,
|
|
170
171
|
controller: s,
|
|
171
172
|
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
@@ -173,25 +174,25 @@ function pe({ children: e, initialPosition: t = "end", shouldFollow: n = !0, vie
|
|
|
173
174
|
})
|
|
174
175
|
});
|
|
175
176
|
}
|
|
176
|
-
function
|
|
177
|
-
let { viewport: r, reachEnd: i } =
|
|
178
|
-
r.current = e, e !== null &&
|
|
177
|
+
function pe({ label: e, children: t, scrollRestorationId: n }) {
|
|
178
|
+
let { viewport: r, reachEnd: i } = J(), a = E((e) => {
|
|
179
|
+
r.current = e, e !== null && Y(e) && i();
|
|
179
180
|
}, [r, i]);
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ N(se, {
|
|
181
182
|
ref: a,
|
|
182
183
|
role: "region",
|
|
183
184
|
"aria-label": e,
|
|
184
185
|
tabIndex: 0,
|
|
185
186
|
"data-scroll-restoration-id": n,
|
|
186
187
|
onScroll: (e) => {
|
|
187
|
-
|
|
188
|
+
Y(e.currentTarget) && i();
|
|
188
189
|
},
|
|
189
190
|
className: "x98rzlu x2lwn1j xeuugli x1odjw0f x1046ku7 x185mbhu xbluxkr x1ok0vyi x1t137rt x13qnu6 x9v5kkp x19rmrnh x1bqaal",
|
|
190
191
|
children: t
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
-
return /* @__PURE__ */
|
|
194
|
+
function me({ children: e, isStreaming: t = !1 }) {
|
|
195
|
+
return /* @__PURE__ */ N(U, {
|
|
195
196
|
"aria-live": "polite",
|
|
196
197
|
"aria-relevant": "additions",
|
|
197
198
|
"aria-busy": t,
|
|
@@ -199,62 +200,62 @@ function he({ children: e, isStreaming: t = !1 }) {
|
|
|
199
200
|
children: e
|
|
200
201
|
});
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
-
let { controller: r } =
|
|
204
|
-
return
|
|
203
|
+
function he({ messageId: e, shouldRevealOnAppend: t = !1, children: n }) {
|
|
204
|
+
let { controller: r } = J();
|
|
205
|
+
return k(() => {
|
|
205
206
|
t && r.scrollToEnd({ behavior: "instant" });
|
|
206
207
|
}, [
|
|
207
208
|
e,
|
|
208
209
|
t,
|
|
209
210
|
r
|
|
210
|
-
]), /* @__PURE__ */
|
|
211
|
+
]), /* @__PURE__ */ N("div", {
|
|
211
212
|
"data-message-id": e,
|
|
212
213
|
className: "xeuugli xj0a0fe",
|
|
213
214
|
children: n
|
|
214
215
|
});
|
|
215
216
|
}
|
|
216
|
-
function
|
|
217
|
-
return /* @__PURE__ */
|
|
217
|
+
function ge({ children: e }) {
|
|
218
|
+
return /* @__PURE__ */ N("div", {
|
|
218
219
|
className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
|
|
219
220
|
children: e
|
|
220
221
|
});
|
|
221
222
|
}
|
|
222
|
-
function
|
|
223
|
-
return /* @__PURE__ */
|
|
223
|
+
function _e({ label: e = "Jump to latest" }) {
|
|
224
|
+
return /* @__PURE__ */ N(W, { render: (n, { visible: r }) => /* @__PURE__ */ N("div", {
|
|
224
225
|
hidden: !r,
|
|
225
226
|
className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ P(t, {
|
|
227
228
|
...n,
|
|
228
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ N(F, {
|
|
229
230
|
size: 14,
|
|
230
231
|
"aria-hidden": !0
|
|
231
232
|
}), e]
|
|
232
233
|
})
|
|
233
234
|
}) });
|
|
234
235
|
}
|
|
235
|
-
function
|
|
236
|
-
let { controller: r, viewport: i } =
|
|
237
|
-
return /* @__PURE__ */
|
|
236
|
+
function ve({ label: e, onActivate: n }) {
|
|
237
|
+
let { controller: r, viewport: i } = J();
|
|
238
|
+
return /* @__PURE__ */ P(t, {
|
|
238
239
|
onClick: () => {
|
|
239
240
|
n?.(), requestAnimationFrame(() => {
|
|
240
241
|
r.scrollToEnd({ behavior: "instant" }), i.current?.focus({ preventScroll: !0 });
|
|
241
242
|
});
|
|
242
243
|
},
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ N(F, {
|
|
244
245
|
size: 14,
|
|
245
246
|
"aria-hidden": !0
|
|
246
247
|
}), e]
|
|
247
248
|
});
|
|
248
249
|
}
|
|
249
|
-
var
|
|
250
|
-
Root:
|
|
251
|
-
Viewport:
|
|
252
|
-
Content:
|
|
253
|
-
Item:
|
|
254
|
-
Controls:
|
|
255
|
-
LatestButton:
|
|
256
|
-
JumpToLatest:
|
|
257
|
-
},
|
|
250
|
+
var ye = {
|
|
251
|
+
Root: fe,
|
|
252
|
+
Viewport: pe,
|
|
253
|
+
Content: me,
|
|
254
|
+
Item: he,
|
|
255
|
+
Controls: ge,
|
|
256
|
+
LatestButton: ve,
|
|
257
|
+
JumpToLatest: _e
|
|
258
|
+
}, X = {
|
|
258
259
|
root: {
|
|
259
260
|
k1xSpc: "x78zum5",
|
|
260
261
|
kXwgrk: "xdt5ytf",
|
|
@@ -329,29 +330,29 @@ var be = {
|
|
|
329
330
|
k8WAf4: "xn9t2bk",
|
|
330
331
|
$$css: !0
|
|
331
332
|
}
|
|
333
|
+
}, be = {
|
|
334
|
+
user: X.user,
|
|
335
|
+
assistant: X.assistant,
|
|
336
|
+
system: X.system
|
|
332
337
|
}, xe = {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
338
|
+
neutral: X.speakerNeutral,
|
|
339
|
+
accent: X.speakerAccent,
|
|
340
|
+
positive: X.speakerPositive,
|
|
341
|
+
warning: X.speakerWarning,
|
|
342
|
+
negative: X.speakerNegative
|
|
336
343
|
}, Se = {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
positive: Y.speakerPositive,
|
|
340
|
-
warning: Y.speakerWarning,
|
|
341
|
-
negative: Y.speakerNegative
|
|
342
|
-
}, Ce = {
|
|
343
|
-
user: Y.bubble,
|
|
344
|
-
assistant: Y.chatReply,
|
|
344
|
+
user: X.bubble,
|
|
345
|
+
assistant: X.chatReply,
|
|
345
346
|
system: null
|
|
346
347
|
};
|
|
347
|
-
function
|
|
348
|
+
function Z({ kind: e }) {
|
|
348
349
|
return { kind: e };
|
|
349
350
|
}
|
|
350
|
-
var
|
|
351
|
+
var Ce = M({
|
|
351
352
|
name: "message",
|
|
352
353
|
options: { kind: "string" },
|
|
353
|
-
state:
|
|
354
|
-
sync:
|
|
354
|
+
state: Z,
|
|
355
|
+
sync: Z,
|
|
355
356
|
controlled: ["kind"],
|
|
356
357
|
api: () => ({}),
|
|
357
358
|
agent: { actions: [] },
|
|
@@ -359,57 +360,57 @@ var we = j({
|
|
|
359
360
|
root: e({}),
|
|
360
361
|
description: e({})
|
|
361
362
|
})
|
|
362
|
-
}), { Root:
|
|
363
|
+
}), { Root: we, Description: Te } = w(Ce, {
|
|
363
364
|
root: "article",
|
|
364
365
|
description: "div"
|
|
365
|
-
}),
|
|
366
|
+
}), Ee = {
|
|
366
367
|
"x-default-marker": "x-default-marker",
|
|
367
368
|
$$css: !0
|
|
368
369
|
};
|
|
369
|
-
function
|
|
370
|
-
let m = l === "chat", h = u !== void 0 && u.length > 0, g = f !== void 0 && f.length > 0, _ = !m || a !== void 0 || i !== void 0 || h, v = e.length > 0 && (!h || e !== u), y = e.length > 0 ? e : u ?? "", b = m && r === "assistant", x = _ ? /* @__PURE__ */
|
|
370
|
+
function De({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s, reactions: c, variant: l = "default", speaker: u, speakerTone: d = "neutral", quote: f }) {
|
|
371
|
+
let m = l === "chat", h = u !== void 0 && u.length > 0, g = f !== void 0 && f.length > 0, _ = !m || a !== void 0 || i !== void 0 || h, v = e.length > 0 && (!h || e !== u), y = e.length > 0 ? e : u ?? "", b = m && r === "assistant", x = _ ? /* @__PURE__ */ P("header", {
|
|
371
372
|
className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
|
|
372
373
|
children: [
|
|
373
|
-
a !== void 0 && /* @__PURE__ */
|
|
374
|
+
a !== void 0 && /* @__PURE__ */ N("span", {
|
|
374
375
|
className: "x3nfvp2 x2lah0s",
|
|
375
376
|
children: a
|
|
376
377
|
}),
|
|
377
|
-
v && /* @__PURE__ */
|
|
378
|
+
v && /* @__PURE__ */ N("span", {
|
|
378
379
|
className: "xk4h15q xeuugli xj0a0fe",
|
|
379
380
|
children: e
|
|
380
381
|
}),
|
|
381
|
-
h && /* @__PURE__ */
|
|
382
|
-
...
|
|
382
|
+
h && /* @__PURE__ */ N("span", {
|
|
383
|
+
...C.props(X.speaker, xe[d]),
|
|
383
384
|
children: u
|
|
384
385
|
}),
|
|
385
|
-
i !== void 0 && /* @__PURE__ */
|
|
386
|
+
i !== void 0 && /* @__PURE__ */ N("div", {
|
|
386
387
|
className: "x153jb6y xy8obcc xas2l8k xss6m8b xeuugli xj0a0fe",
|
|
387
388
|
children: i
|
|
388
389
|
})
|
|
389
390
|
]
|
|
390
391
|
}) : null;
|
|
391
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ P(we, {
|
|
392
393
|
kind: r,
|
|
393
394
|
...n !== void 0 && { id: n },
|
|
394
395
|
"aria-label": y,
|
|
395
|
-
...
|
|
396
|
+
...C.props(X.root, be[r], m && Se[r], Ee),
|
|
396
397
|
children: [
|
|
397
398
|
x,
|
|
398
|
-
g && /* @__PURE__ */
|
|
399
|
+
g && /* @__PURE__ */ N("p", {
|
|
399
400
|
title: f,
|
|
400
401
|
className: "x1ghz6dp xyibt8p xyumdvf x1t7ytsu x97x49r x153jb6y xy8obcc xas2l8k xb3r6kr xlyipyv xuxw1ft xeuugli x193iq5w",
|
|
401
402
|
children: f
|
|
402
403
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ N(Te, {
|
|
404
405
|
className: "xeuugli xj0a0fe x1ytb0s6",
|
|
405
|
-
children: m && r === "assistant" && typeof t == "string" ? /* @__PURE__ */
|
|
406
|
+
children: m && r === "assistant" && typeof t == "string" ? /* @__PURE__ */ N(p, { children: t }) : t
|
|
406
407
|
}),
|
|
407
|
-
s !== void 0 && /* @__PURE__ */
|
|
408
|
+
s !== void 0 && /* @__PURE__ */ N("div", {
|
|
408
409
|
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
|
|
409
410
|
children: s
|
|
410
411
|
}),
|
|
411
412
|
c,
|
|
412
|
-
(o !== void 0 || b) && /* @__PURE__ */
|
|
413
|
+
(o !== void 0 || b) && /* @__PURE__ */ N("footer", {
|
|
413
414
|
...{
|
|
414
415
|
0: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b" },
|
|
415
416
|
1: { className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b x17tes2r x17oiadl" }
|
|
@@ -419,26 +420,26 @@ function Oe({ author: e, children: t, id: n, kind: r = "assistant", meta: i, ava
|
|
|
419
420
|
]
|
|
420
421
|
});
|
|
421
422
|
}
|
|
422
|
-
function
|
|
423
|
-
return /* @__PURE__ */
|
|
423
|
+
function Oe({ name: e, description: t, href: n, actions: r }) {
|
|
424
|
+
return /* @__PURE__ */ P("div", {
|
|
424
425
|
className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
425
426
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ N(I, {
|
|
427
428
|
size: 16,
|
|
428
429
|
"aria-hidden": !0,
|
|
429
430
|
className: "x153jb6y x2lah0s"
|
|
430
431
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ P("div", {
|
|
432
433
|
className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
|
|
433
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
434
|
+
children: [n === void 0 ? /* @__PURE__ */ N("span", { children: e }) : /* @__PURE__ */ N(f, {
|
|
434
435
|
href: n,
|
|
435
436
|
children: e
|
|
436
|
-
}), t !== void 0 && /* @__PURE__ */
|
|
437
|
+
}), t !== void 0 && /* @__PURE__ */ N("span", {
|
|
437
438
|
className: "x153jb6y xy8obcc xas2l8k xss6m8b xeuugli xj0a0fe",
|
|
438
439
|
children: t
|
|
439
440
|
})]
|
|
440
441
|
}),
|
|
441
|
-
r !== void 0 && /* @__PURE__ */
|
|
442
|
+
r !== void 0 && /* @__PURE__ */ N("div", {
|
|
442
443
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
443
444
|
children: r
|
|
444
445
|
})
|
|
@@ -446,13 +447,13 @@ function ke({ name: e, description: t, href: n, actions: r }) {
|
|
|
446
447
|
});
|
|
447
448
|
}
|
|
448
449
|
// packages/ai/src/message-reactions.tsx
|
|
449
|
-
var
|
|
450
|
+
var ke = {
|
|
450
451
|
reactions: "Reactions",
|
|
451
452
|
addReaction: "Add reaction",
|
|
452
453
|
reactionName: ({ name: e, count: t }) => `${e}, ${t}`
|
|
453
454
|
};
|
|
454
455
|
function Ae({ reaction: e, count: t, isDisabled: n, labels: r, onReactionToggle: i }) {
|
|
455
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ P(B, {
|
|
456
457
|
pressed: e.isReacted,
|
|
457
458
|
disabled: n,
|
|
458
459
|
"aria-label": r.reactionName({
|
|
@@ -464,26 +465,26 @@ function Ae({ reaction: e, count: t, isDisabled: n, labels: r, onReactionToggle:
|
|
|
464
465
|
isReacted: t
|
|
465
466
|
}),
|
|
466
467
|
className: "x3nfvp2 x6s0dn4 xva7r70 x9f619 x159bbqr x17oiadl xt970qd x5g2kb4 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x153jb6y x1hz01jw xvmahel xy8obcc xas2l8k xj57cvi xss6m8b xuxw1ft x1ypdohk x17lu4q8 x1480za7 x726p7d x1h1mp10 x1lf1diw xqmg3gf xwj21n9 x1m8qfh3 x13qnu6 x9v5kkp x19rmrnh x13iak60",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ N("span", {
|
|
468
469
|
"aria-hidden": !0,
|
|
469
470
|
className: "xtqrqnz xo5v014",
|
|
470
471
|
children: e.emoji
|
|
471
|
-
}), /* @__PURE__ */
|
|
472
|
+
}), /* @__PURE__ */ N("span", {
|
|
472
473
|
"aria-hidden": !0,
|
|
473
474
|
children: t
|
|
474
475
|
})]
|
|
475
476
|
});
|
|
476
477
|
}
|
|
477
478
|
function je({ reactions: e, choices: t, isDisabled: n = !1, labels: i, onReactionToggle: a }) {
|
|
478
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ P(m.Root, { children: [/* @__PURE__ */ N(m.Trigger, { render: /* @__PURE__ */ N(r, {
|
|
479
480
|
variant: "ghost",
|
|
480
481
|
density: "compact",
|
|
481
482
|
disabled: n,
|
|
482
483
|
"aria-label": i.addReaction,
|
|
483
|
-
children: /* @__PURE__ */
|
|
484
|
-
}) }), /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ N(R, { size: 14 })
|
|
485
|
+
}) }), /* @__PURE__ */ N(m.Popup, {
|
|
485
486
|
align: "start",
|
|
486
|
-
children: t.map((t) => /* @__PURE__ */
|
|
487
|
+
children: t.map((t) => /* @__PURE__ */ N(m.CheckboxItem, {
|
|
487
488
|
value: t.emoji,
|
|
488
489
|
closeOnSelect: !0,
|
|
489
490
|
checked: e.some((e) => e.emoji === t.emoji && e.isReacted),
|
|
@@ -491,32 +492,32 @@ function je({ reactions: e, choices: t, isDisabled: n = !1, labels: i, onReactio
|
|
|
491
492
|
emoji: t.emoji,
|
|
492
493
|
isReacted: e
|
|
493
494
|
}),
|
|
494
|
-
children: /* @__PURE__ */
|
|
495
|
+
children: /* @__PURE__ */ P("span", {
|
|
495
496
|
className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ N("span", {
|
|
497
498
|
"aria-hidden": !0,
|
|
498
499
|
children: t.emoji
|
|
499
|
-
}), /* @__PURE__ */
|
|
500
|
+
}), /* @__PURE__ */ N("span", { children: t.name })]
|
|
500
501
|
})
|
|
501
502
|
}, t.emoji))
|
|
502
503
|
})] });
|
|
503
504
|
}
|
|
504
505
|
function Me({ reactions: e, choices: t, locale: n, onReactionToggle: r, isDisabled: i = !1, labels: a }) {
|
|
505
506
|
let o = {
|
|
506
|
-
...
|
|
507
|
+
...ke,
|
|
507
508
|
...a
|
|
508
509
|
}, s = new Intl.NumberFormat(n), c = t.length > 0;
|
|
509
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ P("div", {
|
|
510
511
|
role: "group",
|
|
511
512
|
"aria-label": o.reactions,
|
|
512
513
|
className: "x78zum5 x1a02dak x6s0dn4 xunmzkg xeuugli",
|
|
513
|
-
children: [e.map((e) => /* @__PURE__ */
|
|
514
|
+
children: [e.map((e) => /* @__PURE__ */ N(Ae, {
|
|
514
515
|
reaction: e,
|
|
515
516
|
count: s.format(e.count),
|
|
516
517
|
isDisabled: i,
|
|
517
518
|
labels: o,
|
|
518
519
|
onReactionToggle: r
|
|
519
|
-
}, e.emoji)), c && /* @__PURE__ */
|
|
520
|
+
}, e.emoji)), c && /* @__PURE__ */ N(je, {
|
|
520
521
|
reactions: e,
|
|
521
522
|
choices: t,
|
|
522
523
|
isDisabled: i,
|
|
@@ -529,36 +530,36 @@ function Me({ reactions: e, choices: t, locale: n, onReactionToggle: r, isDisabl
|
|
|
529
530
|
function Ne(e) {
|
|
530
531
|
if (e.kind === "link") {
|
|
531
532
|
let { kind: t, label: n, ...r } = e;
|
|
532
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ N(o, {
|
|
533
534
|
...r,
|
|
534
535
|
"aria-label": n
|
|
535
536
|
});
|
|
536
537
|
}
|
|
537
538
|
let { kind: t, label: n, ...i } = e;
|
|
538
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ N(r, {
|
|
539
540
|
...i,
|
|
540
541
|
variant: "ghost",
|
|
541
542
|
"aria-label": n
|
|
542
543
|
});
|
|
543
544
|
}
|
|
544
545
|
function Pe(e) {
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ P(g.Root, { children: [/* @__PURE__ */ N(g.Trigger, { render: Ne(e) }), /* @__PURE__ */ N(g.Popup, { children: e.label })] });
|
|
546
547
|
}
|
|
547
548
|
// packages/ai/src/message-boundary.tsx
|
|
548
549
|
function Fe({ label: e, children: t }) {
|
|
549
|
-
return /* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ P(l.Root, {
|
|
550
551
|
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ P(l.Trigger, {
|
|
552
553
|
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ N(L, {
|
|
554
555
|
size: 14,
|
|
555
556
|
"aria-hidden": !0,
|
|
556
557
|
className: "x2lah0s"
|
|
557
|
-
}), /* @__PURE__ */
|
|
558
|
+
}), /* @__PURE__ */ N("span", {
|
|
558
559
|
className: "xeuugli xj0a0fe",
|
|
559
560
|
children: e
|
|
560
561
|
})]
|
|
561
|
-
}), /* @__PURE__ */
|
|
562
|
+
}), /* @__PURE__ */ N(l.Panel, {
|
|
562
563
|
className: "x153jb6y xy8obcc xas2l8k",
|
|
563
564
|
children: t
|
|
564
565
|
})]
|
|
@@ -577,24 +578,24 @@ var Q = {
|
|
|
577
578
|
}
|
|
578
579
|
}, $ = "mod+enter";
|
|
579
580
|
function Ie({ isCompact: e = !1 }) {
|
|
580
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ N("div", {
|
|
581
582
|
"aria-hidden": !0,
|
|
582
583
|
inert: !0,
|
|
583
584
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
584
|
-
children: /* @__PURE__ */
|
|
585
|
+
children: /* @__PURE__ */ P("div", {
|
|
585
586
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
|
|
586
|
-
children: [/* @__PURE__ */
|
|
587
|
-
...
|
|
588
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ N("div", {
|
|
588
|
+
...C.props(n.base, n.field, n.textarea, n.plainTextarea),
|
|
589
|
+
children: /* @__PURE__ */ N(v, {
|
|
589
590
|
lines: e ? 1 : 2,
|
|
590
591
|
width: "22ch"
|
|
591
592
|
})
|
|
592
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ P("div", {
|
|
593
594
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
595
|
+
children: [/* @__PURE__ */ N("div", {
|
|
595
596
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
|
|
596
|
-
children: /* @__PURE__ */
|
|
597
|
-
}), /* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ N(v, { width: "8ch" })
|
|
598
|
+
}), /* @__PURE__ */ N(_, {
|
|
598
599
|
isIconOnly: !0,
|
|
599
600
|
xstyle: Q.action
|
|
600
601
|
})]
|
|
@@ -602,117 +603,117 @@ function Ie({ isCompact: e = !1 }) {
|
|
|
602
603
|
})
|
|
603
604
|
});
|
|
604
605
|
}
|
|
605
|
-
function Le({ label: e, value: t, onValueChange: n, 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: h, isCompact:
|
|
606
|
-
let
|
|
606
|
+
function Le({ label: e, value: t, onValueChange: n, 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: h, isCompact: _ = !1, description: v, error: S, controls: w, attachments: T, onStop: E, isStopPending: D = !1, stopLabel: O = "Stop response" }) {
|
|
607
|
+
let M = ee(), F = u, I = _ && T === void 0 && w === void 0, L = !F && !l && !d, R = oe($), z = A({
|
|
607
608
|
history: h,
|
|
608
609
|
value: t,
|
|
609
610
|
onValueChange: n
|
|
610
611
|
});
|
|
611
|
-
|
|
612
|
-
|
|
612
|
+
k(() => {
|
|
613
|
+
z.current = {
|
|
613
614
|
history: h,
|
|
614
615
|
value: t,
|
|
615
616
|
onValueChange: n
|
|
616
617
|
};
|
|
617
618
|
});
|
|
618
|
-
let [
|
|
619
|
-
entries: () =>
|
|
620
|
-
read: () =>
|
|
621
|
-
write: (e, t) => !
|
|
619
|
+
let [B] = j(() => te({
|
|
620
|
+
entries: () => z.current.history,
|
|
621
|
+
read: () => z.current.value,
|
|
622
|
+
write: (e, t) => !ne({ options: () => z.current }, "onValueChange", e, {
|
|
622
623
|
reason: "input-change",
|
|
623
624
|
event: t
|
|
624
625
|
})
|
|
625
|
-
})),
|
|
626
|
-
|
|
627
|
-
function H(e) {
|
|
628
|
-
if (z.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || ie(e)) return;
|
|
629
|
-
let t = B(e.nativeEvent, $), n = !t && B(e.nativeEvent, "enter");
|
|
630
|
-
(t || m === "submit" && n) && (e.preventDefault(), I && T === void 0 && e.currentTarget.form?.requestSubmit());
|
|
631
|
-
}
|
|
626
|
+
})), H = `${f} · ${R.text}`;
|
|
627
|
+
E === void 0 ? l ? H = p : m === "submit" && (H = `${f} · Enter`) : H = D ? "Stopping…" : O;
|
|
632
628
|
function U(e) {
|
|
633
|
-
e.
|
|
629
|
+
if (B.keydown(e.nativeEvent) || e.key !== "Enter" || e.repeat || re(e)) return;
|
|
630
|
+
let t = V(e.nativeEvent, $), n = !t && V(e.nativeEvent, "enter");
|
|
631
|
+
(t || m === "submit" && n) && (e.preventDefault(), L && E === void 0 && e.currentTarget.form?.requestSubmit());
|
|
634
632
|
}
|
|
635
|
-
|
|
636
|
-
|
|
633
|
+
function W(e) {
|
|
634
|
+
e.preventDefault(), L && E === void 0 && i(e);
|
|
635
|
+
}
|
|
636
|
+
return /* @__PURE__ */ N("form", {
|
|
637
|
+
onSubmit: W,
|
|
637
638
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
638
|
-
children: /* @__PURE__ */
|
|
639
|
-
invalid:
|
|
639
|
+
children: /* @__PURE__ */ P(b.Root, {
|
|
640
|
+
invalid: S !== void 0,
|
|
640
641
|
children: [
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
...
|
|
642
|
+
/* @__PURE__ */ N(b.Label, {
|
|
643
|
+
...C.props(x.hidden),
|
|
643
644
|
children: e
|
|
644
645
|
}),
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ P("div", {
|
|
646
647
|
...{
|
|
647
648
|
0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
|
|
648
649
|
2: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk" },
|
|
649
650
|
1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" },
|
|
650
651
|
3: { className: "x78zum5 x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1q0g3np xuk3077 xn9t2bk x1oddvo6" }
|
|
651
|
-
}[!!
|
|
652
|
+
}[!!I << 1 | S !== void 0],
|
|
652
653
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ N(y, {
|
|
654
655
|
isSensitive: !0,
|
|
655
656
|
appearance: "plain",
|
|
656
|
-
rows:
|
|
657
|
-
isCompact:
|
|
658
|
-
shouldGrow:
|
|
659
|
-
xstyle:
|
|
657
|
+
rows: _ ? 1 : 2,
|
|
658
|
+
isCompact: _,
|
|
659
|
+
shouldGrow: I,
|
|
660
|
+
xstyle: I ? Q.inlineInput : void 0,
|
|
660
661
|
name: a,
|
|
661
662
|
value: t,
|
|
662
663
|
onValueChange: n,
|
|
663
|
-
onKeyDown:
|
|
664
|
+
onKeyDown: U,
|
|
664
665
|
placeholder: o ?? e,
|
|
665
666
|
maxLength: s,
|
|
666
667
|
required: c,
|
|
667
668
|
disabled: u,
|
|
668
|
-
"aria-errormessage":
|
|
669
|
+
"aria-errormessage": S === void 0 ? void 0 : M
|
|
669
670
|
}),
|
|
670
|
-
|
|
671
|
-
/* @__PURE__ */
|
|
671
|
+
T,
|
|
672
|
+
/* @__PURE__ */ P("div", {
|
|
672
673
|
...{
|
|
673
674
|
0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi" },
|
|
674
675
|
1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x2lah0s" }
|
|
675
|
-
}[!!
|
|
676
|
-
children: [
|
|
676
|
+
}[!!I | 0],
|
|
677
|
+
children: [w !== void 0 && /* @__PURE__ */ N("div", {
|
|
677
678
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
678
|
-
children:
|
|
679
|
-
}), /* @__PURE__ */
|
|
679
|
+
children: w
|
|
680
|
+
}), /* @__PURE__ */ P(g.Root, { children: [/* @__PURE__ */ N(g.Trigger, { render: E === void 0 ? /* @__PURE__ */ N(r, {
|
|
680
681
|
xstyle: Q.action,
|
|
681
682
|
type: "submit",
|
|
682
683
|
"data-agent-confirm": f,
|
|
683
684
|
variant: "solid",
|
|
684
685
|
"aria-label": l ? p : f,
|
|
685
|
-
"aria-keyshortcuts": m === "submit" ? `Enter ${
|
|
686
|
+
"aria-keyshortcuts": m === "submit" ? `Enter ${R.ariaKeyshortcuts}` : R.ariaKeyshortcuts,
|
|
686
687
|
disabled: u || d,
|
|
687
688
|
isPending: l,
|
|
688
|
-
children: /* @__PURE__ */
|
|
689
|
+
children: /* @__PURE__ */ N(ie, {
|
|
689
690
|
size: 16,
|
|
690
691
|
"aria-hidden": !0
|
|
691
692
|
})
|
|
692
|
-
}) : /* @__PURE__ */
|
|
693
|
+
}) : /* @__PURE__ */ N(r, {
|
|
693
694
|
xstyle: Q.action,
|
|
694
695
|
type: "button",
|
|
695
|
-
"data-agent-confirm":
|
|
696
|
-
"aria-label":
|
|
696
|
+
"data-agent-confirm": O,
|
|
697
|
+
"aria-label": D ? "Stopping…" : O,
|
|
697
698
|
onClick: (e) => {
|
|
698
|
-
e.preventDefault(),
|
|
699
|
+
e.preventDefault(), E();
|
|
699
700
|
},
|
|
700
701
|
disabled: u,
|
|
701
|
-
isPending:
|
|
702
|
-
children: /* @__PURE__ */
|
|
702
|
+
isPending: D,
|
|
703
|
+
children: /* @__PURE__ */ N(ae, {
|
|
703
704
|
size: 14,
|
|
704
705
|
"aria-hidden": !0
|
|
705
706
|
})
|
|
706
|
-
}) }), /* @__PURE__ */
|
|
707
|
+
}) }), /* @__PURE__ */ N(g.Popup, { children: H })] })]
|
|
707
708
|
})
|
|
708
709
|
]
|
|
709
710
|
}),
|
|
710
|
-
v !== void 0 && /* @__PURE__ */
|
|
711
|
-
|
|
712
|
-
id:
|
|
711
|
+
v !== void 0 && /* @__PURE__ */ N(b.Description, { children: v }),
|
|
712
|
+
S !== void 0 && /* @__PURE__ */ N(b.Error, {
|
|
713
|
+
id: M,
|
|
713
714
|
match: !0,
|
|
714
715
|
role: "alert",
|
|
715
|
-
children:
|
|
716
|
+
children: S
|
|
716
717
|
})
|
|
717
718
|
]
|
|
718
719
|
})
|
|
@@ -720,14 +721,14 @@ function Le({ label: e, value: t, onValueChange: n, onSubmit: i, name: a = "prom
|
|
|
720
721
|
}
|
|
721
722
|
// packages/ai/src/reply-indicator.tsx
|
|
722
723
|
function Re({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
|
|
723
|
-
let [r, i] =
|
|
724
|
-
return
|
|
724
|
+
let [r, i] = j(t === 0), { ref: a, isActive: o } = S(n && r);
|
|
725
|
+
return O(() => {
|
|
725
726
|
let e = setTimeout(() => i(!0), t);
|
|
726
727
|
return () => clearTimeout(e);
|
|
727
|
-
}, [t]), /* @__PURE__ */
|
|
728
|
+
}, [t]), /* @__PURE__ */ N("div", {
|
|
728
729
|
ref: a,
|
|
729
730
|
className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
|
|
730
|
-
children: r && /* @__PURE__ */
|
|
731
|
+
children: r && /* @__PURE__ */ N("span", {
|
|
731
732
|
role: "status",
|
|
732
733
|
...{
|
|
733
734
|
0: {},
|
|
@@ -741,26 +742,26 @@ function Re({ label: e, delayMs: t = 200, isAnimated: n = !0 }) {
|
|
|
741
742
|
}
|
|
742
743
|
// packages/ai/src/sources.tsx
|
|
743
744
|
function ze({ sources: e, label: t = "Sources" }) {
|
|
744
|
-
return /* @__PURE__ */
|
|
745
|
+
return /* @__PURE__ */ P("section", {
|
|
745
746
|
"aria-label": t,
|
|
746
747
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
|
|
747
748
|
children: [
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ N("h3", {
|
|
749
750
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
750
751
|
children: t
|
|
751
752
|
}),
|
|
752
|
-
e.length === 0 && /* @__PURE__ */
|
|
753
|
+
e.length === 0 && /* @__PURE__ */ N("p", {
|
|
753
754
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
754
755
|
children: "No sources supplied."
|
|
755
756
|
}),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ N("ol", {
|
|
757
758
|
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
758
|
-
children: e.map((e) => /* @__PURE__ */
|
|
759
|
+
children: e.map((e) => /* @__PURE__ */ P("li", {
|
|
759
760
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
760
|
-
children: [/* @__PURE__ */
|
|
761
|
+
children: [/* @__PURE__ */ N("span", { children: /* @__PURE__ */ N(f, {
|
|
761
762
|
href: e.href,
|
|
762
763
|
children: e.title
|
|
763
|
-
}) }), e.description !== void 0 && /* @__PURE__ */
|
|
764
|
+
}) }), e.description !== void 0 && /* @__PURE__ */ N("p", {
|
|
764
765
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
765
766
|
children: e.description
|
|
766
767
|
})]
|
|
@@ -770,20 +771,20 @@ function ze({ sources: e, label: t = "Sources" }) {
|
|
|
770
771
|
});
|
|
771
772
|
}
|
|
772
773
|
function Be({ source: t, label: n }) {
|
|
773
|
-
return /* @__PURE__ */
|
|
774
|
+
return /* @__PURE__ */ N("span", {
|
|
774
775
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
775
|
-
children: /* @__PURE__ */
|
|
776
|
-
render: /* @__PURE__ */
|
|
776
|
+
children: /* @__PURE__ */ P(h.Root, { children: [/* @__PURE__ */ N(h.Trigger, {
|
|
777
|
+
render: /* @__PURE__ */ N(e, {}),
|
|
777
778
|
"aria-label": `Source ${n}: ${t.title}`,
|
|
778
779
|
children: n
|
|
779
|
-
}), /* @__PURE__ */
|
|
780
|
+
}), /* @__PURE__ */ N(h.Popup, {
|
|
780
781
|
side: "top",
|
|
781
|
-
children: /* @__PURE__ */
|
|
782
|
+
children: /* @__PURE__ */ P(i, {
|
|
782
783
|
isCompact: !0,
|
|
783
784
|
children: [
|
|
784
|
-
/* @__PURE__ */
|
|
785
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ N(h.Title, { children: t.title }),
|
|
786
|
+
t.description !== void 0 && /* @__PURE__ */ N(h.Description, { children: t.description }),
|
|
787
|
+
/* @__PURE__ */ N(f, {
|
|
787
788
|
href: t.href,
|
|
788
789
|
children: "Open source"
|
|
789
790
|
})
|
|
@@ -792,4 +793,4 @@ function Be({ source: t, label: n }) {
|
|
|
792
793
|
})] })
|
|
793
794
|
});
|
|
794
795
|
}
|
|
795
|
-
export {
|
|
796
|
+
export { le as Approval, de as CommandActivity, G as CommandDetails, ye as Conversation, Be as InlineCitation, De as Message, Pe as MessageAction, Oe as MessageAttachment, Fe as MessageBoundary, Me as MessageReactions, Le as PromptInput, Ie as PromptInputPlaceholder, Re as ReplyIndicator, ze as Sources };
|