@mechane-ai/elements 0.52.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.
- package/dist/ai.js +169 -169
- package/dist/catalog.json +1 -1
- package/dist/content/markdown.js +1 -278
- package/dist/markdown-VpLw_P9T.js +313 -0
- package/dist/packages/content/src/markdown/markdown.d.ts +8 -1
- package/package.json +1 -1
- package/dist/visible-motion-1GcUaEi4.js +0 -23
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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
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
|
|
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
|
|
22
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
51
|
+
})] }) : /* @__PURE__ */ A(s, { children: e.statusLabel })
|
|
52
52
|
]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
// packages/ai/src/command-details.tsx
|
|
56
|
-
function
|
|
57
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
70
|
-
t === void 0 || t.length === 0 ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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
|
-
},
|
|
98
|
-
function
|
|
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__ */
|
|
100
|
+
return /* @__PURE__ */ j(c.Root, {
|
|
101
101
|
defaultOpen: !1,
|
|
102
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ A(c.Trigger, {
|
|
103
103
|
variant: "inline",
|
|
104
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ j("span", {
|
|
105
105
|
className: "x3nfvp2 x6s0dn4 x1hnptsi xeuugli",
|
|
106
106
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ A(F, {
|
|
108
108
|
size: 14,
|
|
109
109
|
"aria-hidden": !0,
|
|
110
110
|
className: "x2lah0s"
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ A("span", {
|
|
113
113
|
className: "xiard35 xy8obcc xeuugli xb3r6kr xlyipyv x1sdyfia",
|
|
114
114
|
children: r
|
|
115
115
|
}),
|
|
116
|
-
|
|
116
|
+
W[e].length > 0 && /* @__PURE__ */ A("span", {
|
|
117
117
|
className: "x2lah0s xy8obcc x153jb6y",
|
|
118
|
-
children:
|
|
118
|
+
children: W[e]
|
|
119
119
|
})
|
|
120
120
|
]
|
|
121
121
|
})
|
|
122
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ A(c.Panel, { children: /* @__PURE__ */ A(U, {
|
|
123
123
|
...t,
|
|
124
|
-
isRunning:
|
|
124
|
+
isRunning: G.has(e)
|
|
125
125
|
}) })]
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
// packages/ai/src/conversation.tsx
|
|
129
|
-
var K =
|
|
129
|
+
var K = S(void 0);
|
|
130
130
|
function q() {
|
|
131
|
-
let e =
|
|
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
|
|
139
|
-
let i =
|
|
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
|
|
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__ */
|
|
150
|
+
}, [o, a]), /* @__PURE__ */ A(K.Provider, {
|
|
151
151
|
value: u,
|
|
152
|
-
children: /* @__PURE__ */
|
|
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
|
|
161
|
-
let { viewport: r, reachEnd: i } = q(), a =
|
|
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__ */
|
|
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
|
|
178
|
-
return /* @__PURE__ */
|
|
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
|
|
188
|
+
return E(() => {
|
|
189
189
|
t && r.scrollToEnd({ behavior: "instant" });
|
|
190
190
|
}, [
|
|
191
191
|
e,
|
|
192
192
|
t,
|
|
193
193
|
r
|
|
194
|
-
]), /* @__PURE__ */
|
|
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
|
|
201
|
-
return /* @__PURE__ */
|
|
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
|
|
207
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
210
|
+
children: /* @__PURE__ */ j(n, {
|
|
211
211
|
...t,
|
|
212
|
-
children: [/* @__PURE__ */
|
|
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
|
|
219
|
+
function he({ label: e, onActivate: t }) {
|
|
220
220
|
let { controller: r, viewport: i } = q();
|
|
221
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
227
|
+
children: [/* @__PURE__ */ A(M, {
|
|
228
228
|
size: 14,
|
|
229
229
|
"aria-hidden": !0
|
|
230
230
|
}), e]
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
var
|
|
234
|
-
Root:
|
|
235
|
-
Viewport:
|
|
236
|
-
Content:
|
|
233
|
+
var ge = {
|
|
234
|
+
Root: ue,
|
|
235
|
+
Viewport: de,
|
|
236
|
+
Content: Y,
|
|
237
237
|
Item: fe,
|
|
238
|
-
Controls:
|
|
239
|
-
LatestButton:
|
|
240
|
-
JumpToLatest:
|
|
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
|
-
},
|
|
278
|
+
}, _e = {
|
|
279
279
|
user: X.user,
|
|
280
280
|
assistant: X.assistant,
|
|
281
281
|
system: X.system
|
|
282
|
-
},
|
|
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
|
|
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:
|
|
302
|
+
}), { Root: be, Description: xe } = x(ye, {
|
|
303
303
|
root: "article",
|
|
304
304
|
description: "div"
|
|
305
|
-
}),
|
|
305
|
+
}), Se = {
|
|
306
306
|
"x-default-marker": "x-default-marker",
|
|
307
307
|
$$css: !0
|
|
308
308
|
};
|
|
309
|
-
function
|
|
310
|
-
let l = c === "chat", u = !l || a !== void 0 || i !== void 0, d = l && r === "assistant",
|
|
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__ */
|
|
313
|
+
a !== void 0 && /* @__PURE__ */ A("span", {
|
|
314
314
|
className: "x3nfvp2 x2lah0s",
|
|
315
315
|
children: a
|
|
316
316
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ A("span", {
|
|
318
318
|
className: "xk4h15q xeuugli xj0a0fe",
|
|
319
319
|
children: e
|
|
320
320
|
}),
|
|
321
|
-
i !== void 0 && /* @__PURE__ */
|
|
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__ */
|
|
327
|
+
return /* @__PURE__ */ j(be, {
|
|
328
328
|
kind: r,
|
|
329
329
|
...n !== void 0 && { id: n },
|
|
330
330
|
"aria-label": e,
|
|
331
|
-
...
|
|
331
|
+
...b.props(X.root, _e[r], l && ve[r], Se),
|
|
332
332
|
children: [
|
|
333
|
-
|
|
334
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
353
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
356
|
+
/* @__PURE__ */ A(N, {
|
|
357
357
|
size: 16,
|
|
358
358
|
"aria-hidden": !0,
|
|
359
359
|
className: "x153jb6y x2lah0s"
|
|
360
360
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ j("div", {
|
|
362
362
|
className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
|
|
363
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
379
|
+
function Te(n) {
|
|
380
380
|
if (n.kind === "link") {
|
|
381
381
|
let { kind: e, label: r, ...i } = n;
|
|
382
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
388
|
+
return /* @__PURE__ */ A(e, {
|
|
389
389
|
...a,
|
|
390
390
|
variant: "ghost",
|
|
391
391
|
"aria-label": i
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
return /* @__PURE__ */
|
|
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
|
|
399
|
-
return /* @__PURE__ */
|
|
398
|
+
function De({ label: e, children: t }) {
|
|
399
|
+
return /* @__PURE__ */ j(c.Root, {
|
|
400
400
|
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ j(c.Trigger, {
|
|
402
402
|
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ A(P, {
|
|
404
404
|
size: 14,
|
|
405
405
|
"aria-hidden": !0,
|
|
406
406
|
className: "x2lah0s"
|
|
407
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ A("span", {
|
|
408
408
|
className: "xeuugli xj0a0fe",
|
|
409
409
|
children: e
|
|
410
410
|
})]
|
|
411
|
-
}), /* @__PURE__ */
|
|
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
|
|
430
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
437
|
-
...
|
|
438
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
442
|
+
}), /* @__PURE__ */ j("div", {
|
|
443
443
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ A("div", {
|
|
445
445
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
|
|
446
|
-
children: /* @__PURE__ */
|
|
447
|
-
}), /* @__PURE__ */
|
|
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
|
|
456
|
-
let M = ne(), N = u, P =
|
|
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
|
-
|
|
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] =
|
|
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 =
|
|
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 =
|
|
480
|
-
(t ||
|
|
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(),
|
|
483
|
+
e.preventDefault(), F && w === void 0 && i(e);
|
|
484
484
|
}
|
|
485
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
488
|
+
children: /* @__PURE__ */ j(v.Root, {
|
|
489
489
|
invalid: x !== void 0,
|
|
490
490
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
...
|
|
491
|
+
/* @__PURE__ */ A(v.Label, {
|
|
492
|
+
...b.props(te.hidden),
|
|
493
493
|
children: t
|
|
494
494
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
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__ */
|
|
503
|
+
/* @__PURE__ */ A(ee, {
|
|
504
504
|
isSensitive: !0,
|
|
505
505
|
appearance: "plain",
|
|
506
|
-
rows:
|
|
507
|
-
isCompact:
|
|
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__ */
|
|
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__ */
|
|
526
|
+
children: [S !== void 0 && /* @__PURE__ */ A("div", {
|
|
527
527
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
528
528
|
children: S
|
|
529
|
-
}), /* @__PURE__ */
|
|
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 ?
|
|
535
|
-
"aria-keyshortcuts":
|
|
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__ */
|
|
538
|
+
children: /* @__PURE__ */ A(oe, {
|
|
539
539
|
size: 16,
|
|
540
540
|
"aria-hidden": !0
|
|
541
541
|
})
|
|
542
|
-
}) : /* @__PURE__ */
|
|
542
|
+
}) : /* @__PURE__ */ A(e, {
|
|
543
543
|
xstyle: Q.action,
|
|
544
544
|
type: "button",
|
|
545
|
-
"data-agent-confirm":
|
|
546
|
-
"aria-label":
|
|
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:
|
|
552
|
-
children: /* @__PURE__ */
|
|
551
|
+
isPending: T,
|
|
552
|
+
children: /* @__PURE__ */ A(se, {
|
|
553
553
|
size: 14,
|
|
554
554
|
"aria-hidden": !0
|
|
555
555
|
})
|
|
556
|
-
}) }), /* @__PURE__ */
|
|
556
|
+
}) }), /* @__PURE__ */ A(h.Popup, { children: B })] })]
|
|
557
557
|
})
|
|
558
558
|
]
|
|
559
559
|
}),
|
|
560
|
-
|
|
561
|
-
x !== void 0 && /* @__PURE__ */
|
|
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
|
|
573
|
-
let [r, i] =
|
|
574
|
-
return
|
|
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__ */
|
|
577
|
+
}, [t]), /* @__PURE__ */ A("div", {
|
|
578
578
|
ref: a,
|
|
579
579
|
className: "x1tn5z8q x153jb6y x1hz01jw xtqrqnz x1ytb0s6",
|
|
580
|
-
children: r && /* @__PURE__ */
|
|
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
|
|
594
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
598
|
+
/* @__PURE__ */ A("h3", {
|
|
599
599
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
600
600
|
children: t
|
|
601
601
|
}),
|
|
602
|
-
e.length === 0 && /* @__PURE__ */
|
|
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__ */
|
|
606
|
+
/* @__PURE__ */ A("ol", {
|
|
607
607
|
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
608
|
-
children: e.map((e) => /* @__PURE__ */
|
|
608
|
+
children: e.map((e) => /* @__PURE__ */ j("li", {
|
|
609
609
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
623
|
-
return /* @__PURE__ */
|
|
622
|
+
function Me({ source: e, label: t }) {
|
|
623
|
+
return /* @__PURE__ */ A("span", {
|
|
624
624
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
render: /* @__PURE__ */
|
|
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__ */
|
|
629
|
+
}), /* @__PURE__ */ A(m.Popup, {
|
|
630
630
|
side: "top",
|
|
631
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ j(r, {
|
|
632
632
|
isCompact: !0,
|
|
633
633
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
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 {
|
|
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 };
|