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