@rpcbase/agents-sdk 0.4.0 → 0.5.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/client-routes.browser.js +31 -17
- package/dist/client-routes.d.ts +4 -1
- package/dist/client-routes.d.ts.map +1 -1
- package/dist/client-routes.js +31 -17
- package/dist/components/artifact.d.ts +2 -1
- package/dist/components/artifact.d.ts.map +1 -1
- package/dist/components/chat.d.ts +4 -1
- package/dist/components/chat.d.ts.map +1 -1
- package/dist/components/greeting.d.ts +6 -1
- package/dist/components/greeting.d.ts.map +1 -1
- package/dist/components/messages.d.ts +3 -1
- package/dist/components/messages.d.ts.map +1 -1
- package/dist/components/multimodal-input.d.ts +2 -1
- package/dist/components/multimodal-input.d.ts.map +1 -1
- package/dist/components/suggested-actions.d.ts +2 -1
- package/dist/components/suggested-actions.d.ts.map +1 -1
- package/dist/{data-stream-handler-D9R15ZTc.js → data-stream-handler-COHb5rm3.js} +264 -257
- package/dist/{data-stream-handler-eapMI8kQ.js → data-stream-handler-YDybFA4k.js} +263 -256
- package/dist/{handler-BgRhcxRI.js → handler-CmhA4mQ1.js} +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/pages/ChatNewPage.d.ts +7 -1
- package/dist/pages/ChatNewPage.d.ts.map +1 -1
- package/dist/pages/ChatPage.d.ts +7 -1
- package/dist/pages/ChatPage.d.ts.map +1 -1
- package/dist/routes.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/tailwind-source.js +1 -1
- package/package.json +1 -1
|
@@ -55563,17 +55563,12 @@ var FB = ({ className: e, ...t }) => /* @__PURE__ */ H("form", {
|
|
|
55563
55563
|
});
|
|
55564
55564
|
//#endregion
|
|
55565
55565
|
//#region src/components/suggested-actions.tsx
|
|
55566
|
-
function VB({ chatId: e, sendMessage: t }) {
|
|
55567
|
-
let { getChatPath:
|
|
55568
|
-
|
|
55569
|
-
"Write code to demonstrate Dijkstra's algorithm",
|
|
55570
|
-
"Help me write an essay about Silicon Valley",
|
|
55571
|
-
"What is the weather in San Francisco?"
|
|
55572
|
-
];
|
|
55573
|
-
return /* @__PURE__ */ H("div", {
|
|
55566
|
+
function VB({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
55567
|
+
let { getChatPath: r } = et(), i = n.map((e) => e.trim()).filter(Boolean);
|
|
55568
|
+
return i.length === 0 ? null : /* @__PURE__ */ H("div", {
|
|
55574
55569
|
className: "grid w-full gap-2 sm:grid-cols-2",
|
|
55575
55570
|
"data-testid": "suggested-actions",
|
|
55576
|
-
children:
|
|
55571
|
+
children: i.map((n, i) => /* @__PURE__ */ H(yj.div, {
|
|
55577
55572
|
animate: {
|
|
55578
55573
|
opacity: 1,
|
|
55579
55574
|
y: 0
|
|
@@ -55589,22 +55584,22 @@ function VB({ chatId: e, sendMessage: t }) {
|
|
|
55589
55584
|
transition: { delay: .05 * i },
|
|
55590
55585
|
children: /* @__PURE__ */ H(BB, {
|
|
55591
55586
|
className: "h-auto w-full whitespace-normal p-3 text-left",
|
|
55592
|
-
onClick: (
|
|
55593
|
-
window.history.pushState({}, "",
|
|
55587
|
+
onClick: (n) => {
|
|
55588
|
+
window.history.pushState({}, "", r(e)), t({
|
|
55594
55589
|
role: "user",
|
|
55595
55590
|
parts: [{
|
|
55596
55591
|
type: "text",
|
|
55597
|
-
text:
|
|
55592
|
+
text: n
|
|
55598
55593
|
}]
|
|
55599
55594
|
});
|
|
55600
55595
|
},
|
|
55601
|
-
suggestion:
|
|
55602
|
-
children:
|
|
55596
|
+
suggestion: n,
|
|
55597
|
+
children: n
|
|
55603
55598
|
})
|
|
55604
|
-
},
|
|
55599
|
+
}, `${i}-${n}`))
|
|
55605
55600
|
});
|
|
55606
55601
|
}
|
|
55607
|
-
var HB = S(VB, (e, t) => e.chatId
|
|
55602
|
+
var HB = S(VB, (e, t) => !(e.chatId !== t.chatId || !xe(e.suggestedActions, t.suggestedActions)));
|
|
55608
55603
|
//#endregion
|
|
55609
55604
|
//#region src/components/multimodal-input.tsx
|
|
55610
55605
|
function UB(e, t) {
|
|
@@ -55643,37 +55638,37 @@ function XB(e, t) {
|
|
|
55643
55638
|
let r = qB(t.scrollArea);
|
|
55644
55639
|
r && (r.scrollTop = 0);
|
|
55645
55640
|
}
|
|
55646
|
-
function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: s, setMessages: c, sendMessage: l, className: u, selectedModelId: d, onModelChange: p, openaiReasoningEffort: m = f, onOpenAIReasoningEffortChange: h }) {
|
|
55647
|
-
let
|
|
55641
|
+
function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: s, setMessages: c, sendMessage: l, className: u, selectedModelId: d, onModelChange: p, openaiReasoningEffort: m = f, onOpenAIReasoningEffortChange: h, suggestedActions: g }) {
|
|
55642
|
+
let _ = N(null), v = N(null), [y, b] = P(GB), { width: x } = uM(), { getChatPath: S } = et();
|
|
55648
55643
|
E(() => {
|
|
55649
|
-
YB(
|
|
55650
|
-
scrollArea:
|
|
55651
|
-
setScrollAreaHeight:
|
|
55644
|
+
YB(_.current, {
|
|
55645
|
+
scrollArea: v.current,
|
|
55646
|
+
setScrollAreaHeight: b
|
|
55652
55647
|
});
|
|
55653
|
-
}, [t,
|
|
55654
|
-
let
|
|
55648
|
+
}, [t, x]);
|
|
55649
|
+
let w = N(!1);
|
|
55655
55650
|
E(() => {
|
|
55656
|
-
if (!
|
|
55651
|
+
if (!w.current && x) {
|
|
55657
55652
|
let e = setTimeout(() => {
|
|
55658
|
-
|
|
55653
|
+
_.current?.focus(), w.current = !0;
|
|
55659
55654
|
}, 100);
|
|
55660
55655
|
return () => clearTimeout(e);
|
|
55661
55656
|
}
|
|
55662
|
-
}, [
|
|
55663
|
-
let [
|
|
55657
|
+
}, [x]);
|
|
55658
|
+
let [T, D] = aM("input", "");
|
|
55664
55659
|
E(() => {
|
|
55665
|
-
|
|
55666
|
-
}, [
|
|
55667
|
-
|
|
55668
|
-
}, [t,
|
|
55669
|
-
let
|
|
55660
|
+
_.current && n(_.current.value || T || "");
|
|
55661
|
+
}, [T, n]), E(() => {
|
|
55662
|
+
D(t);
|
|
55663
|
+
}, [t, D]);
|
|
55664
|
+
let O = (e) => {
|
|
55670
55665
|
n(e.target.value), YB(e.currentTarget, {
|
|
55671
|
-
scrollArea:
|
|
55672
|
-
setScrollAreaHeight:
|
|
55666
|
+
scrollArea: v.current,
|
|
55667
|
+
setScrollAreaHeight: b
|
|
55673
55668
|
});
|
|
55674
|
-
},
|
|
55669
|
+
}, k = N(null), [A, j] = P([]), M = C(() => {
|
|
55675
55670
|
let r = Vd();
|
|
55676
|
-
window.history.pushState({}, "", Gd(
|
|
55671
|
+
window.history.pushState({}, "", Gd(S(e), r)), l({
|
|
55677
55672
|
role: "user",
|
|
55678
55673
|
parts: [...a.map((e) => ({
|
|
55679
55674
|
type: "file",
|
|
@@ -55684,21 +55679,21 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55684
55679
|
type: "text",
|
|
55685
55680
|
text: t
|
|
55686
55681
|
}]
|
|
55687
|
-
}), o([]),
|
|
55688
|
-
scrollArea:
|
|
55689
|
-
setScrollAreaHeight:
|
|
55690
|
-
}),
|
|
55682
|
+
}), o([]), D(""), n(""), XB(_.current, {
|
|
55683
|
+
scrollArea: v.current,
|
|
55684
|
+
setScrollAreaHeight: b
|
|
55685
|
+
}), x && x > 768 && _.current?.focus();
|
|
55691
55686
|
}, [
|
|
55692
55687
|
t,
|
|
55693
55688
|
n,
|
|
55694
55689
|
a,
|
|
55695
55690
|
l,
|
|
55696
55691
|
o,
|
|
55697
|
-
|
|
55698
|
-
|
|
55692
|
+
D,
|
|
55693
|
+
x,
|
|
55699
55694
|
e,
|
|
55700
|
-
|
|
55701
|
-
]),
|
|
55695
|
+
S
|
|
55696
|
+
]), F = C(async (e) => {
|
|
55702
55697
|
try {
|
|
55703
55698
|
let t = Vd(), n = await fetch("/api/rb/file-uploads", {
|
|
55704
55699
|
method: "POST",
|
|
@@ -55759,48 +55754,49 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55759
55754
|
} catch {
|
|
55760
55755
|
de.error("Failed to upload file, please try again!");
|
|
55761
55756
|
}
|
|
55762
|
-
}, []),
|
|
55757
|
+
}, []), I = C(async (e) => {
|
|
55763
55758
|
let t = Array.from(e.target.files || []);
|
|
55764
|
-
|
|
55759
|
+
j(t.map((e) => e.name));
|
|
55765
55760
|
try {
|
|
55766
|
-
let e = t.map((e) =>
|
|
55761
|
+
let e = t.map((e) => F(e)), n = (await Promise.all(e)).filter((e) => e !== void 0);
|
|
55767
55762
|
o((e) => [...e, ...n]);
|
|
55768
55763
|
} catch (e) {
|
|
55769
55764
|
console.error("Error uploading files!", e);
|
|
55770
55765
|
} finally {
|
|
55771
|
-
|
|
55766
|
+
j([]);
|
|
55772
55767
|
}
|
|
55773
|
-
}, [o,
|
|
55768
|
+
}, [o, F]), L = C(async (e) => {
|
|
55774
55769
|
let t = e.clipboardData?.items;
|
|
55775
55770
|
if (!t) return;
|
|
55776
55771
|
let n = Array.from(t).filter((e) => e.type.startsWith("image/"));
|
|
55777
55772
|
if (n.length !== 0) {
|
|
55778
|
-
e.preventDefault(),
|
|
55773
|
+
e.preventDefault(), j((e) => [...e, "Pasted image"]);
|
|
55779
55774
|
try {
|
|
55780
|
-
let e = n.map((e) => e.getAsFile()).filter((e) => e !== null).map((e) =>
|
|
55775
|
+
let e = n.map((e) => e.getAsFile()).filter((e) => e !== null).map((e) => F(e)), t = (await Promise.all(e)).filter((e) => e !== void 0 && e.url !== void 0 && e.contentType !== void 0);
|
|
55781
55776
|
o((e) => [...e, ...t]);
|
|
55782
55777
|
} catch (e) {
|
|
55783
55778
|
console.error("Error uploading pasted images:", e), de.error("Failed to upload pasted image(s)");
|
|
55784
55779
|
} finally {
|
|
55785
|
-
|
|
55780
|
+
j([]);
|
|
55786
55781
|
}
|
|
55787
55782
|
}
|
|
55788
|
-
}, [o,
|
|
55783
|
+
}, [o, F]);
|
|
55789
55784
|
return E(() => {
|
|
55790
|
-
let e =
|
|
55791
|
-
if (e) return e.addEventListener("paste",
|
|
55792
|
-
}, [
|
|
55785
|
+
let e = _.current;
|
|
55786
|
+
if (e) return e.addEventListener("paste", L), () => e.removeEventListener("paste", L);
|
|
55787
|
+
}, [L]), /* @__PURE__ */ U("div", {
|
|
55793
55788
|
className: G("relative flex w-full flex-col gap-4", u),
|
|
55794
55789
|
children: [
|
|
55795
|
-
s.length === 0 && a.length === 0 &&
|
|
55790
|
+
s.length === 0 && a.length === 0 && A.length === 0 && g && g.length > 0 && /* @__PURE__ */ H(HB, {
|
|
55796
55791
|
chatId: e,
|
|
55797
|
-
sendMessage: l
|
|
55792
|
+
sendMessage: l,
|
|
55793
|
+
suggestedActions: g
|
|
55798
55794
|
}),
|
|
55799
55795
|
/* @__PURE__ */ H("input", {
|
|
55800
55796
|
className: "-top-4 -left-4 pointer-events-none fixed size-0.5 opacity-0",
|
|
55801
55797
|
multiple: !0,
|
|
55802
|
-
onChange:
|
|
55803
|
-
ref:
|
|
55798
|
+
onChange: I,
|
|
55799
|
+
ref: k,
|
|
55804
55800
|
tabIndex: -1,
|
|
55805
55801
|
type: "file"
|
|
55806
55802
|
}),
|
|
@@ -55808,23 +55804,23 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55808
55804
|
className: "rounded-xl border border-border bg-background p-3 shadow-xs transition-all duration-200 focus-within:border-border hover:border-muted-foreground/50",
|
|
55809
55805
|
onSubmit: (e) => {
|
|
55810
55806
|
if (e.preventDefault(), !(!t.trim() && a.length === 0)) {
|
|
55811
|
-
if (
|
|
55807
|
+
if (A.length > 0) {
|
|
55812
55808
|
de.error("Please wait for uploads to finish!");
|
|
55813
55809
|
return;
|
|
55814
55810
|
}
|
|
55815
|
-
r === "ready" ?
|
|
55811
|
+
r === "ready" ? M() : de.error("Please wait for the model to finish its response!");
|
|
55816
55812
|
}
|
|
55817
55813
|
},
|
|
55818
55814
|
children: [
|
|
55819
|
-
(a.length > 0 ||
|
|
55815
|
+
(a.length > 0 || A.length > 0) && /* @__PURE__ */ U("div", {
|
|
55820
55816
|
className: "flex flex-row items-end gap-2 overflow-x-scroll",
|
|
55821
55817
|
"data-testid": "attachments-preview",
|
|
55822
55818
|
children: [a.map((e) => /* @__PURE__ */ H(uL, {
|
|
55823
55819
|
attachment: e,
|
|
55824
55820
|
onRemove: () => {
|
|
55825
|
-
o((t) => t.filter((t) => t.url !== e.url)),
|
|
55821
|
+
o((t) => t.filter((t) => t.url !== e.url)), k.current && (k.current.value = "");
|
|
55826
55822
|
}
|
|
55827
|
-
}, e.url)),
|
|
55823
|
+
}, e.url)), A.map((e) => /* @__PURE__ */ H(uL, {
|
|
55828
55824
|
attachment: {
|
|
55829
55825
|
url: "",
|
|
55830
55826
|
name: e,
|
|
@@ -55837,15 +55833,15 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55837
55833
|
className: "flex flex-row items-start gap-1 sm:gap-2",
|
|
55838
55834
|
children: /* @__PURE__ */ H(WR, {
|
|
55839
55835
|
className: "grow rounded-md",
|
|
55840
|
-
ref:
|
|
55841
|
-
style: { height:
|
|
55836
|
+
ref: v,
|
|
55837
|
+
style: { height: y },
|
|
55842
55838
|
children: /* @__PURE__ */ H(IB, {
|
|
55843
55839
|
className: "min-h-10 w-full resize-none overflow-y-hidden border-0! border-none! bg-transparent p-2 text-base outline-none ring-0 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
55844
55840
|
"data-testid": "multimodal-input",
|
|
55845
55841
|
disableAutoResize: !0,
|
|
55846
|
-
onChange:
|
|
55842
|
+
onChange: O,
|
|
55847
55843
|
placeholder: "Send a message...",
|
|
55848
|
-
ref:
|
|
55844
|
+
ref: _,
|
|
55849
55845
|
rows: 1,
|
|
55850
55846
|
value: t
|
|
55851
55847
|
})
|
|
@@ -55857,12 +55853,12 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55857
55853
|
className: "gap-0 sm:gap-0.5",
|
|
55858
55854
|
children: [
|
|
55859
55855
|
/* @__PURE__ */ H(eV, {
|
|
55860
|
-
fileInputRef:
|
|
55856
|
+
fileInputRef: k,
|
|
55861
55857
|
selectedModelId: d,
|
|
55862
55858
|
status: r
|
|
55863
55859
|
}),
|
|
55864
55860
|
/* @__PURE__ */ H(nV, {
|
|
55865
|
-
focusTargetRef:
|
|
55861
|
+
focusTargetRef: _,
|
|
55866
55862
|
idScope: e,
|
|
55867
55863
|
onModelChange: p,
|
|
55868
55864
|
selectedModelId: d
|
|
@@ -55881,7 +55877,7 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55881
55877
|
}) : /* @__PURE__ */ H(zB, {
|
|
55882
55878
|
className: "size-8 rounded-full bg-primary text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
|
|
55883
55879
|
"data-testid": "send-button",
|
|
55884
|
-
disabled: !t.trim() ||
|
|
55880
|
+
disabled: !t.trim() || A.length > 0,
|
|
55885
55881
|
status: r,
|
|
55886
55882
|
children: /* @__PURE__ */ H(K, { size: 14 })
|
|
55887
55883
|
})]
|
|
@@ -55891,7 +55887,7 @@ function ZB({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55891
55887
|
]
|
|
55892
55888
|
});
|
|
55893
55889
|
}
|
|
55894
|
-
var QB = S(ZB, (e, t) => !(e.input !== t.input || e.status !== t.status || !xe(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort));
|
|
55890
|
+
var QB = S(ZB, (e, t) => !(e.input !== t.input || e.status !== t.status || !xe(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort || !xe(e.suggestedActions, t.suggestedActions)));
|
|
55895
55891
|
function $B({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
55896
55892
|
let r = n.includes("reasoning") || n.includes("think");
|
|
55897
55893
|
return /* @__PURE__ */ H(ef, {
|
|
@@ -56301,33 +56297,33 @@ var oV = S(aV), sV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56301
56297
|
SM,
|
|
56302
56298
|
HP
|
|
56303
56299
|
];
|
|
56304
|
-
function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, status: i, stop: a, attachments: o, setAttachments: s, sendMessage: c, messages: l, setMessages: u, regenerate: d, votes: f, isReadonly: p, selectedModelId: m }) {
|
|
56305
|
-
let { artifact:
|
|
56300
|
+
function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, status: i, stop: a, attachments: o, setAttachments: s, sendMessage: c, messages: l, setMessages: u, regenerate: d, votes: f, isReadonly: p, selectedModelId: m, suggestedActions: h }) {
|
|
56301
|
+
let { artifact: g, setArtifact: _, metadata: v, setMetadata: y } = Hy(), { data: b, isLoading: x, mutate: S } = cv(g.documentId !== "init" && g.status !== "streaming" ? `/api/rb/agents/document?id=${g.documentId}` : null, Kd), [w, T] = P("edit"), [D, O] = P(null), [k, A] = P(-1);
|
|
56306
56302
|
E(() => {
|
|
56307
|
-
if (
|
|
56308
|
-
let e =
|
|
56309
|
-
e && (
|
|
56303
|
+
if (b && b.length > 0) {
|
|
56304
|
+
let e = b.at(-1);
|
|
56305
|
+
e && (O(e), A(b.length - 1), _((t) => ({
|
|
56310
56306
|
...t,
|
|
56311
56307
|
content: e.content ?? ""
|
|
56312
56308
|
})));
|
|
56313
56309
|
}
|
|
56314
|
-
}, [
|
|
56315
|
-
|
|
56316
|
-
}, [
|
|
56317
|
-
let { mutate:
|
|
56318
|
-
|
|
56310
|
+
}, [b, _]), E(() => {
|
|
56311
|
+
S();
|
|
56312
|
+
}, [S]);
|
|
56313
|
+
let { mutate: j } = G_(), [M, N] = P(!1), F = C((e) => {
|
|
56314
|
+
g && j(`/api/rb/agents/document?id=${g.documentId}`, async (t) => {
|
|
56319
56315
|
if (!t) return [];
|
|
56320
56316
|
let n = t.at(-1);
|
|
56321
|
-
if (!n || !n.content) return
|
|
56317
|
+
if (!n || !n.content) return N(!1), t;
|
|
56322
56318
|
if (n.content !== e) {
|
|
56323
|
-
await fetch(`/api/rb/agents/document?id=${
|
|
56319
|
+
await fetch(`/api/rb/agents/document?id=${g.documentId}`, {
|
|
56324
56320
|
method: "POST",
|
|
56325
56321
|
body: JSON.stringify({
|
|
56326
|
-
title:
|
|
56322
|
+
title: g.title,
|
|
56327
56323
|
content: e,
|
|
56328
|
-
kind:
|
|
56324
|
+
kind: g.kind
|
|
56329
56325
|
})
|
|
56330
|
-
}),
|
|
56326
|
+
}), N(!1);
|
|
56331
56327
|
let r = {
|
|
56332
56328
|
...n,
|
|
56333
56329
|
content: e,
|
|
@@ -56337,30 +56333,30 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56337
56333
|
}
|
|
56338
56334
|
return t;
|
|
56339
56335
|
}, { revalidate: !1 });
|
|
56340
|
-
}, [
|
|
56341
|
-
|
|
56336
|
+
}, [g, j]), I = sM(F, 2e3), L = C((e, t) => {
|
|
56337
|
+
D && e !== D.content && (N(!0), t ? I(e) : F(e));
|
|
56342
56338
|
}, [
|
|
56343
|
-
|
|
56344
|
-
|
|
56345
|
-
|
|
56339
|
+
D,
|
|
56340
|
+
I,
|
|
56341
|
+
F
|
|
56346
56342
|
]);
|
|
56347
|
-
function
|
|
56348
|
-
return !
|
|
56343
|
+
function R(e) {
|
|
56344
|
+
return !b || !b[e] ? "" : b[e].content ?? "";
|
|
56349
56345
|
}
|
|
56350
|
-
let
|
|
56351
|
-
|
|
56352
|
-
}, [
|
|
56353
|
-
if (!
|
|
56346
|
+
let z = (e) => {
|
|
56347
|
+
b && (e === "latest" && (A(b.length - 1), T("edit")), e === "toggle" && T((e) => e === "edit" ? "diff" : "edit"), e === "prev" ? k > 0 && A((e) => e - 1) : e === "next" && k < b.length - 1 && A((e) => e + 1));
|
|
56348
|
+
}, [ee, B] = P(!1), te = b && b.length > 0 ? k === b.length - 1 : !0, V = dm(), ne = pV.find((e) => e.kind === g.kind);
|
|
56349
|
+
if (!ne) throw Error("Artifact definition not found!");
|
|
56354
56350
|
return E(() => {
|
|
56355
|
-
|
|
56356
|
-
documentId:
|
|
56357
|
-
setMetadata:
|
|
56351
|
+
g.documentId !== "init" && ne.initialize && ne.initialize({
|
|
56352
|
+
documentId: g.documentId,
|
|
56353
|
+
setMetadata: y
|
|
56358
56354
|
});
|
|
56359
56355
|
}, [
|
|
56360
|
-
|
|
56361
|
-
|
|
56362
|
-
|
|
56363
|
-
]), /* @__PURE__ */ H(Ek, { children:
|
|
56356
|
+
g.documentId,
|
|
56357
|
+
ne,
|
|
56358
|
+
y
|
|
56359
|
+
]), /* @__PURE__ */ H(Ek, { children: g.isVisible && /* @__PURE__ */ U(yj.div, {
|
|
56364
56360
|
animate: { opacity: 1 },
|
|
56365
56361
|
className: "absolute inset-0 z-50 flex min-h-0 min-w-0 flex-row overflow-hidden bg-background",
|
|
56366
56362
|
"data-testid": "artifact",
|
|
@@ -56369,7 +56365,7 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56369
56365
|
transition: { delay: .4 }
|
|
56370
56366
|
},
|
|
56371
56367
|
initial: { opacity: 1 },
|
|
56372
|
-
children: [!
|
|
56368
|
+
children: [!V && /* @__PURE__ */ U(yj.div, {
|
|
56373
56369
|
animate: {
|
|
56374
56370
|
opacity: 1,
|
|
56375
56371
|
x: 0,
|
|
@@ -56393,7 +56389,7 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56393
56389
|
x: 10,
|
|
56394
56390
|
scale: 1
|
|
56395
56391
|
},
|
|
56396
|
-
children: [/* @__PURE__ */ H(Ek, { children: !
|
|
56392
|
+
children: [/* @__PURE__ */ H(Ek, { children: !te && /* @__PURE__ */ H(yj.div, {
|
|
56397
56393
|
animate: { opacity: 1 },
|
|
56398
56394
|
className: "absolute inset-0 z-50 bg-background/70",
|
|
56399
56395
|
exit: { opacity: 0 },
|
|
@@ -56402,7 +56398,7 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56402
56398
|
className: "flex h-full flex-col items-center justify-between",
|
|
56403
56399
|
children: [/* @__PURE__ */ H(kL, {
|
|
56404
56400
|
addToolApprovalResponse: e,
|
|
56405
|
-
artifactStatus:
|
|
56401
|
+
artifactStatus: g.status,
|
|
56406
56402
|
chatId: t,
|
|
56407
56403
|
isReadonly: p,
|
|
56408
56404
|
messages: l,
|
|
@@ -56424,7 +56420,8 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56424
56420
|
setInput: r,
|
|
56425
56421
|
setMessages: u,
|
|
56426
56422
|
status: i,
|
|
56427
|
-
stop: a
|
|
56423
|
+
stop: a,
|
|
56424
|
+
suggestedActions: h
|
|
56428
56425
|
})
|
|
56429
56426
|
})]
|
|
56430
56427
|
})]
|
|
@@ -56453,7 +56450,7 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56453
56450
|
damping: 30
|
|
56454
56451
|
}
|
|
56455
56452
|
},
|
|
56456
|
-
initial:
|
|
56453
|
+
initial: V ? {
|
|
56457
56454
|
opacity: 0,
|
|
56458
56455
|
x: 0,
|
|
56459
56456
|
y: 16,
|
|
@@ -56473,131 +56470,137 @@ function mV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56473
56470
|
className: "flex flex-col",
|
|
56474
56471
|
children: [/* @__PURE__ */ H("div", {
|
|
56475
56472
|
className: "font-medium",
|
|
56476
|
-
children:
|
|
56477
|
-
}),
|
|
56473
|
+
children: g.title
|
|
56474
|
+
}), M ? /* @__PURE__ */ H("div", {
|
|
56478
56475
|
className: "text-muted-foreground text-sm",
|
|
56479
56476
|
children: "Saving changes..."
|
|
56480
|
-
}) :
|
|
56477
|
+
}) : D ? /* @__PURE__ */ H("div", {
|
|
56481
56478
|
className: "text-muted-foreground text-sm",
|
|
56482
|
-
children: `Updated ${re(new Date(
|
|
56479
|
+
children: `Updated ${re(new Date(D.createdAt), /* @__PURE__ */ new Date(), { addSuffix: !0 })}`
|
|
56483
56480
|
}) : /* @__PURE__ */ H("div", { className: "mt-2 h-3 w-32 animate-pulse rounded-md bg-muted-foreground/20" })]
|
|
56484
56481
|
})]
|
|
56485
56482
|
}), /* @__PURE__ */ H(zF, {
|
|
56486
|
-
artifact:
|
|
56487
|
-
currentVersionIndex:
|
|
56488
|
-
handleVersionChange:
|
|
56489
|
-
isCurrentVersion:
|
|
56490
|
-
metadata:
|
|
56491
|
-
mode:
|
|
56492
|
-
setMetadata:
|
|
56483
|
+
artifact: g,
|
|
56484
|
+
currentVersionIndex: k,
|
|
56485
|
+
handleVersionChange: z,
|
|
56486
|
+
isCurrentVersion: te,
|
|
56487
|
+
metadata: v,
|
|
56488
|
+
mode: w,
|
|
56489
|
+
setMetadata: y
|
|
56493
56490
|
})]
|
|
56494
56491
|
}),
|
|
56495
56492
|
/* @__PURE__ */ U("div", {
|
|
56496
56493
|
className: "h-full max-w-full! items-center overflow-y-scroll bg-background dark:bg-muted",
|
|
56497
|
-
children: [/* @__PURE__ */ H(
|
|
56498
|
-
content:
|
|
56499
|
-
currentVersionIndex:
|
|
56500
|
-
getDocumentContentById:
|
|
56501
|
-
isCurrentVersion:
|
|
56494
|
+
children: [/* @__PURE__ */ H(ne.content, {
|
|
56495
|
+
content: te ? g.content : R(k),
|
|
56496
|
+
currentVersionIndex: k,
|
|
56497
|
+
getDocumentContentById: R,
|
|
56498
|
+
isCurrentVersion: te,
|
|
56502
56499
|
isInline: !1,
|
|
56503
|
-
isLoading:
|
|
56504
|
-
metadata:
|
|
56505
|
-
mode:
|
|
56506
|
-
onSaveContent:
|
|
56507
|
-
setMetadata:
|
|
56508
|
-
status:
|
|
56500
|
+
isLoading: x && !g.content,
|
|
56501
|
+
metadata: v,
|
|
56502
|
+
mode: w,
|
|
56503
|
+
onSaveContent: L,
|
|
56504
|
+
setMetadata: y,
|
|
56505
|
+
status: g.status,
|
|
56509
56506
|
suggestions: [],
|
|
56510
|
-
title:
|
|
56511
|
-
}), /* @__PURE__ */ H(Ek, { children:
|
|
56512
|
-
artifactKind:
|
|
56513
|
-
isToolbarVisible:
|
|
56507
|
+
title: g.title
|
|
56508
|
+
}), /* @__PURE__ */ H(Ek, { children: te && /* @__PURE__ */ H(dV, {
|
|
56509
|
+
artifactKind: g.kind,
|
|
56510
|
+
isToolbarVisible: ee,
|
|
56514
56511
|
sendMessage: c,
|
|
56515
|
-
setIsToolbarVisible:
|
|
56512
|
+
setIsToolbarVisible: B,
|
|
56516
56513
|
setMessages: u,
|
|
56517
56514
|
status: i,
|
|
56518
56515
|
stop: a
|
|
56519
56516
|
}) })]
|
|
56520
56517
|
}),
|
|
56521
|
-
/* @__PURE__ */ H(Ek, { children: !
|
|
56522
|
-
currentVersionIndex:
|
|
56523
|
-
documents:
|
|
56524
|
-
handleVersionChange:
|
|
56518
|
+
/* @__PURE__ */ H(Ek, { children: !te && /* @__PURE__ */ H(fV, {
|
|
56519
|
+
currentVersionIndex: k,
|
|
56520
|
+
documents: b,
|
|
56521
|
+
handleVersionChange: z
|
|
56525
56522
|
}) })
|
|
56526
56523
|
]
|
|
56527
56524
|
})]
|
|
56528
56525
|
}) });
|
|
56529
56526
|
}
|
|
56530
|
-
var hV = S(mV, (e, t) => !(e.status !== t.status || !xe(e.votes, t.votes) || e.input !== t.input || !xe(e.messages, t.messages.length))), gV = (
|
|
56531
|
-
|
|
56532
|
-
|
|
56533
|
-
|
|
56534
|
-
|
|
56535
|
-
|
|
56536
|
-
|
|
56537
|
-
|
|
56538
|
-
|
|
56539
|
-
|
|
56540
|
-
|
|
56541
|
-
|
|
56542
|
-
|
|
56543
|
-
|
|
56544
|
-
|
|
56545
|
-
|
|
56546
|
-
|
|
56547
|
-
|
|
56548
|
-
|
|
56549
|
-
|
|
56550
|
-
|
|
56551
|
-
|
|
56552
|
-
|
|
56553
|
-
|
|
56554
|
-
|
|
56555
|
-
|
|
56556
|
-
|
|
56557
|
-
|
|
56558
|
-
|
|
56559
|
-
|
|
56560
|
-
|
|
56561
|
-
|
|
56562
|
-
|
|
56563
|
-
|
|
56564
|
-
|
|
56565
|
-
|
|
56527
|
+
var hV = S(mV, (e, t) => !(e.status !== t.status || !xe(e.votes, t.votes) || e.input !== t.input || !xe(e.messages, t.messages.length) || !xe(e.suggestedActions, t.suggestedActions))), gV = ({ title1: e, title2: t }) => {
|
|
56528
|
+
let n = e?.trim(), r = t?.trim();
|
|
56529
|
+
return !n && !r ? null : /* @__PURE__ */ U("div", {
|
|
56530
|
+
className: "mx-auto mt-4 flex size-full max-w-3xl flex-col justify-center px-4 md:mt-16 md:px-8",
|
|
56531
|
+
children: [n && /* @__PURE__ */ H(yj.div, {
|
|
56532
|
+
animate: {
|
|
56533
|
+
opacity: 1,
|
|
56534
|
+
y: 0
|
|
56535
|
+
},
|
|
56536
|
+
className: "font-semibold text-xl md:text-2xl",
|
|
56537
|
+
exit: {
|
|
56538
|
+
opacity: 0,
|
|
56539
|
+
y: 10
|
|
56540
|
+
},
|
|
56541
|
+
initial: {
|
|
56542
|
+
opacity: 0,
|
|
56543
|
+
y: 10
|
|
56544
|
+
},
|
|
56545
|
+
transition: { delay: .5 },
|
|
56546
|
+
children: n
|
|
56547
|
+
}), r && /* @__PURE__ */ H(yj.div, {
|
|
56548
|
+
animate: {
|
|
56549
|
+
opacity: 1,
|
|
56550
|
+
y: 0
|
|
56551
|
+
},
|
|
56552
|
+
className: "text-xl text-muted-foreground md:text-2xl",
|
|
56553
|
+
exit: {
|
|
56554
|
+
opacity: 0,
|
|
56555
|
+
y: 10
|
|
56556
|
+
},
|
|
56557
|
+
initial: {
|
|
56558
|
+
opacity: 0,
|
|
56559
|
+
y: 10
|
|
56560
|
+
},
|
|
56561
|
+
transition: { delay: .6 },
|
|
56562
|
+
children: r
|
|
56563
|
+
})]
|
|
56564
|
+
}, "overview");
|
|
56565
|
+
};
|
|
56566
56566
|
//#endregion
|
|
56567
56567
|
//#region src/components/messages.tsx
|
|
56568
|
-
function _V({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, setMessages: a, regenerate: o, isReadonly: s, selectedModelId: c }) {
|
|
56569
|
-
let
|
|
56568
|
+
function _V({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, setMessages: a, regenerate: o, isReadonly: s, selectedModelId: c, title1: l, title2: u }) {
|
|
56569
|
+
let d = i.at(-1), f = (e) => e === "dynamic-tool" || e.startsWith("tool-"), p = d?.role === "assistant" && (d.parts?.some((e) => e.type === "text" ? !!e.text?.trim() : e.type === "reasoning" ? xL(e) : !!f(e.type)) ?? !1), m = n === "submitted" || n === "streaming" && d?.role === "assistant" && !p, h = n === "streaming" && d?.role === "assistant" && !p, { containerRef: g, endRef: _, isAtBottom: v, scrollToBottom: y, hasSentMessage: b } = UF({ status: n });
|
|
56570
56570
|
return ot(), /* @__PURE__ */ U("div", {
|
|
56571
56571
|
className: "relative flex-1",
|
|
56572
56572
|
children: [/* @__PURE__ */ H("div", {
|
|
56573
56573
|
className: "absolute inset-0 touch-pan-y overflow-y-auto",
|
|
56574
|
-
ref:
|
|
56574
|
+
ref: g,
|
|
56575
56575
|
children: /* @__PURE__ */ U("div", {
|
|
56576
56576
|
className: "mx-auto flex min-w-0 max-w-4xl flex-col gap-4 px-2 pt-[60px] pb-4 md:gap-6 md:px-4",
|
|
56577
56577
|
children: [
|
|
56578
|
-
i.length === 0 && /* @__PURE__ */ H(gV, {
|
|
56579
|
-
|
|
56578
|
+
i.length === 0 && /* @__PURE__ */ H(gV, {
|
|
56579
|
+
title1: l,
|
|
56580
|
+
title2: u
|
|
56581
|
+
}),
|
|
56582
|
+
i.map((c, l) => h && l === i.length - 1 && c.role === "assistant" ? null : /* @__PURE__ */ H(TL, {
|
|
56580
56583
|
addToolApprovalResponse: e,
|
|
56581
56584
|
chatId: t,
|
|
56582
56585
|
isLoading: n === "streaming" && i.length - 1 === l,
|
|
56583
56586
|
isReadonly: s,
|
|
56584
56587
|
message: c,
|
|
56585
56588
|
regenerate: o,
|
|
56586
|
-
requiresScrollPadding:
|
|
56589
|
+
requiresScrollPadding: b && l === i.length - 1,
|
|
56587
56590
|
setMessages: a,
|
|
56588
56591
|
vote: r ? r.find((e) => e.messageId === c.id) : void 0
|
|
56589
56592
|
}, c.id)),
|
|
56590
|
-
|
|
56593
|
+
m && /* @__PURE__ */ H(EL, {}),
|
|
56591
56594
|
/* @__PURE__ */ H("div", {
|
|
56592
56595
|
className: "min-h-[24px] min-w-[24px] shrink-0",
|
|
56593
|
-
ref:
|
|
56596
|
+
ref: _
|
|
56594
56597
|
})
|
|
56595
56598
|
]
|
|
56596
56599
|
})
|
|
56597
56600
|
}), /* @__PURE__ */ H("button", {
|
|
56598
56601
|
"aria-label": "Scroll to bottom",
|
|
56599
|
-
className: `-translate-x-1/2 absolute bottom-4 left-1/2 z-10 rounded-full border bg-background p-2 shadow-lg transition-all hover:bg-muted ${
|
|
56600
|
-
onClick: () =>
|
|
56602
|
+
className: `-translate-x-1/2 absolute bottom-4 left-1/2 z-10 rounded-full border bg-background p-2 shadow-lg transition-all hover:bg-muted ${v ? "pointer-events-none scale-0 opacity-0" : "pointer-events-auto scale-100 opacity-100"}`,
|
|
56603
|
+
onClick: () => y("smooth"),
|
|
56601
56604
|
type: "button",
|
|
56602
56605
|
children: /* @__PURE__ */ H(Ef, { className: "size-4" })
|
|
56603
56606
|
})]
|
|
@@ -56607,16 +56610,16 @@ var vV = _V, yV = (e) => e?.parts?.some((e) => {
|
|
|
56607
56610
|
let t = e.state;
|
|
56608
56611
|
return t === "approval-responded" || t === "output-denied";
|
|
56609
56612
|
}) ?? !1, bV = (e) => `agents-sdk:chat:${e}:stream`, xV = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), SV = (e) => u(e) ?? "default";
|
|
56610
|
-
function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, autoResume: i }) {
|
|
56611
|
-
let { setDataStream:
|
|
56613
|
+
function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, autoResume: i, suggestedActions: a, title1: s, title2: u }) {
|
|
56614
|
+
let { setDataStream: d } = ot(), { getChatPath: f } = et(), p = o.has(n) ? n : c, m = SV(p), [h, g] = P(""), [_, v] = P(p), y = N(_), [b, x] = P(m), S = N(b);
|
|
56612
56615
|
E(() => {
|
|
56613
|
-
g.current = m;
|
|
56614
|
-
}, [m]), E(() => {
|
|
56615
|
-
h(u), v(SV(u));
|
|
56616
|
-
}, [e, u]), E(() => {
|
|
56617
56616
|
y.current = _;
|
|
56618
|
-
}, [_])
|
|
56619
|
-
|
|
56617
|
+
}, [_]), E(() => {
|
|
56618
|
+
v(p), x(SV(p));
|
|
56619
|
+
}, [e, p]), E(() => {
|
|
56620
|
+
S.current = b;
|
|
56621
|
+
}, [b]);
|
|
56622
|
+
let { messages: C, setMessages: w, sendMessage: T, status: D, stop: O, regenerate: k, resumeStream: A, addToolApprovalResponse: j } = zy({
|
|
56620
56623
|
id: e,
|
|
56621
56624
|
messages: t,
|
|
56622
56625
|
experimental_throttle: 100,
|
|
@@ -56626,7 +56629,7 @@ function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, aut
|
|
|
56626
56629
|
api: "/api/rb/agents/chat",
|
|
56627
56630
|
fetch: qd,
|
|
56628
56631
|
prepareSendMessagesRequest(e) {
|
|
56629
|
-
let t =
|
|
56632
|
+
let t = y.current, n = S.current, r = e.messages.at(-1), i = e.messages.at(-2), a = Ud(e.headers, Vd()), o = r?.role !== "user" || r?.role === "user" && yV(i);
|
|
56630
56633
|
return {
|
|
56631
56634
|
...a ? { headers: a } : {},
|
|
56632
56635
|
body: {
|
|
@@ -56647,7 +56650,7 @@ function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, aut
|
|
|
56647
56650
|
}
|
|
56648
56651
|
}),
|
|
56649
56652
|
onData: (e) => {
|
|
56650
|
-
|
|
56653
|
+
d((t) => t ? [...t, e] : []);
|
|
56651
56654
|
},
|
|
56652
56655
|
onError: (e) => {
|
|
56653
56656
|
if (e instanceof Nd) {
|
|
@@ -56660,7 +56663,7 @@ function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, aut
|
|
|
56660
56663
|
}
|
|
56661
56664
|
de.error("Something went wrong. Please try again.");
|
|
56662
56665
|
}
|
|
56663
|
-
}),
|
|
56666
|
+
}), M = N(null), F = N("");
|
|
56664
56667
|
E(() => fe(bV(e), (t) => {
|
|
56665
56668
|
if (!xV(t) || t.chatId !== e) return;
|
|
56666
56669
|
let n = t.message;
|
|
@@ -56673,34 +56676,34 @@ function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, aut
|
|
|
56673
56676
|
parts: r,
|
|
56674
56677
|
metadata: xV(n.metadata) ? n.metadata : { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
56675
56678
|
};
|
|
56676
|
-
|
|
56679
|
+
w((t) => {
|
|
56677
56680
|
let n = t.findIndex((t) => t.id === e);
|
|
56678
56681
|
return n === -1 ? [...t, i] : t.map((e, t) => t === n ? i : e);
|
|
56679
56682
|
});
|
|
56680
56683
|
}
|
|
56681
56684
|
}
|
|
56682
56685
|
if (t.done === !0) {
|
|
56683
|
-
|
|
56686
|
+
M.current = null, F.current = "";
|
|
56684
56687
|
return;
|
|
56685
56688
|
}
|
|
56686
56689
|
let r = t.part;
|
|
56687
56690
|
if (!xV(r)) return;
|
|
56688
56691
|
if (r.type === "start" && typeof r.messageId == "string") {
|
|
56689
|
-
|
|
56692
|
+
M.current = r.messageId, F.current = "";
|
|
56690
56693
|
return;
|
|
56691
56694
|
}
|
|
56692
|
-
if (typeof r.type == "string" && r.type.startsWith("data-") &&
|
|
56693
|
-
let i =
|
|
56695
|
+
if (typeof r.type == "string" && r.type.startsWith("data-") && d((e) => e ? [...e, r] : []), r.type !== "text-delta" || typeof r.delta != "string") return;
|
|
56696
|
+
let i = M.current;
|
|
56694
56697
|
if (!i) return;
|
|
56695
|
-
|
|
56696
|
-
let
|
|
56697
|
-
|
|
56698
|
+
F.current += r.delta;
|
|
56699
|
+
let a = F.current;
|
|
56700
|
+
w((e) => {
|
|
56698
56701
|
let t = e.findIndex((e) => e.id === i), n = {
|
|
56699
56702
|
id: i,
|
|
56700
56703
|
role: "assistant",
|
|
56701
56704
|
parts: [{
|
|
56702
56705
|
type: "text",
|
|
56703
|
-
text:
|
|
56706
|
+
text: a
|
|
56704
56707
|
}],
|
|
56705
56708
|
metadata: { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
56706
56709
|
};
|
|
@@ -56708,89 +56711,93 @@ function CV({ id: e, initialMessages: t, initialChatModel: n, isReadonly: r, aut
|
|
|
56708
56711
|
});
|
|
56709
56712
|
}), [
|
|
56710
56713
|
e,
|
|
56711
|
-
|
|
56712
|
-
|
|
56714
|
+
d,
|
|
56715
|
+
w
|
|
56713
56716
|
]);
|
|
56714
|
-
let [
|
|
56717
|
+
let [I] = V(), L = I.get("query"), [R, z] = P(!1);
|
|
56715
56718
|
E(() => {
|
|
56716
|
-
if (
|
|
56717
|
-
|
|
56719
|
+
if (L && !R) {
|
|
56720
|
+
T({
|
|
56718
56721
|
role: "user",
|
|
56719
56722
|
parts: [{
|
|
56720
56723
|
type: "text",
|
|
56721
|
-
text:
|
|
56724
|
+
text: L
|
|
56722
56725
|
}]
|
|
56723
|
-
}),
|
|
56726
|
+
}), z(!0);
|
|
56724
56727
|
let t = new URLSearchParams(window.location.search);
|
|
56725
56728
|
t.delete("query");
|
|
56726
56729
|
let n = t.toString();
|
|
56727
|
-
window.history.replaceState({}, "", `${
|
|
56730
|
+
window.history.replaceState({}, "", `${f(e)}${n ? `?${n}` : ""}`);
|
|
56728
56731
|
}
|
|
56729
56732
|
}, [
|
|
56730
|
-
|
|
56731
|
-
|
|
56732
|
-
|
|
56733
|
+
L,
|
|
56734
|
+
T,
|
|
56735
|
+
R,
|
|
56733
56736
|
e,
|
|
56734
|
-
|
|
56737
|
+
f
|
|
56735
56738
|
]);
|
|
56736
|
-
let { data:
|
|
56739
|
+
let { data: ee } = cv(C.length >= 2 ? `/api/rb/agents/vote?chatId=${e}` : null, Kd), [B, te] = P([]), ne = Vy((e) => e.isVisible);
|
|
56737
56740
|
return Uy({
|
|
56738
56741
|
autoResume: i,
|
|
56739
56742
|
initialMessages: t,
|
|
56740
|
-
resumeStream:
|
|
56741
|
-
setMessages:
|
|
56743
|
+
resumeStream: A,
|
|
56744
|
+
setMessages: w
|
|
56742
56745
|
}), /* @__PURE__ */ U("div", {
|
|
56743
56746
|
className: "relative flex h-full min-h-0 min-w-0 overflow-hidden bg-background",
|
|
56744
56747
|
children: [/* @__PURE__ */ U("div", {
|
|
56745
56748
|
className: "overscroll-behavior-contain flex h-full min-h-0 min-w-0 flex-1 touch-pan-y flex-col bg-background",
|
|
56746
56749
|
children: [/* @__PURE__ */ H(vV, {
|
|
56747
|
-
addToolApprovalResponse:
|
|
56750
|
+
addToolApprovalResponse: j,
|
|
56748
56751
|
chatId: e,
|
|
56749
|
-
isArtifactVisible:
|
|
56752
|
+
isArtifactVisible: ne,
|
|
56750
56753
|
isReadonly: r,
|
|
56751
|
-
messages:
|
|
56752
|
-
regenerate:
|
|
56753
|
-
selectedModelId:
|
|
56754
|
-
setMessages:
|
|
56755
|
-
status:
|
|
56756
|
-
|
|
56754
|
+
messages: C,
|
|
56755
|
+
regenerate: k,
|
|
56756
|
+
selectedModelId: p,
|
|
56757
|
+
setMessages: w,
|
|
56758
|
+
status: D,
|
|
56759
|
+
title1: s,
|
|
56760
|
+
title2: u,
|
|
56761
|
+
votes: ee
|
|
56757
56762
|
}), /* @__PURE__ */ H("div", {
|
|
56758
56763
|
className: "sticky bottom-0 z-1 mx-auto flex w-full max-w-4xl gap-2 border-t-0 bg-background px-2 pb-3 md:px-4 md:pb-4",
|
|
56759
56764
|
children: !r && /* @__PURE__ */ H(QB, {
|
|
56760
|
-
attachments:
|
|
56765
|
+
attachments: B,
|
|
56761
56766
|
chatId: e,
|
|
56762
|
-
input:
|
|
56763
|
-
messages:
|
|
56767
|
+
input: h,
|
|
56768
|
+
messages: C,
|
|
56764
56769
|
onModelChange: (e) => {
|
|
56765
|
-
|
|
56770
|
+
v(e), x(SV(e));
|
|
56766
56771
|
},
|
|
56767
|
-
onOpenAIReasoningEffortChange:
|
|
56768
|
-
openaiReasoningEffort:
|
|
56769
|
-
selectedModelId:
|
|
56770
|
-
sendMessage:
|
|
56771
|
-
setAttachments:
|
|
56772
|
-
setInput:
|
|
56773
|
-
setMessages:
|
|
56774
|
-
status:
|
|
56775
|
-
stop:
|
|
56772
|
+
onOpenAIReasoningEffortChange: x,
|
|
56773
|
+
openaiReasoningEffort: b,
|
|
56774
|
+
selectedModelId: _,
|
|
56775
|
+
sendMessage: T,
|
|
56776
|
+
setAttachments: te,
|
|
56777
|
+
setInput: g,
|
|
56778
|
+
setMessages: w,
|
|
56779
|
+
status: D,
|
|
56780
|
+
stop: O,
|
|
56781
|
+
suggestedActions: a
|
|
56776
56782
|
})
|
|
56777
56783
|
})]
|
|
56778
56784
|
}), /* @__PURE__ */ H(hV, {
|
|
56779
|
-
addToolApprovalResponse:
|
|
56780
|
-
attachments:
|
|
56785
|
+
addToolApprovalResponse: j,
|
|
56786
|
+
attachments: B,
|
|
56781
56787
|
chatId: e,
|
|
56782
|
-
input:
|
|
56788
|
+
input: h,
|
|
56783
56789
|
isReadonly: r,
|
|
56784
|
-
messages:
|
|
56785
|
-
regenerate:
|
|
56786
|
-
selectedModelId:
|
|
56787
|
-
sendMessage:
|
|
56788
|
-
setAttachments:
|
|
56789
|
-
setInput:
|
|
56790
|
-
setMessages:
|
|
56791
|
-
status:
|
|
56792
|
-
stop:
|
|
56793
|
-
|
|
56790
|
+
messages: C,
|
|
56791
|
+
regenerate: k,
|
|
56792
|
+
selectedModelId: _,
|
|
56793
|
+
sendMessage: T,
|
|
56794
|
+
setAttachments: te,
|
|
56795
|
+
setInput: g,
|
|
56796
|
+
setMessages: w,
|
|
56797
|
+
status: D,
|
|
56798
|
+
stop: O,
|
|
56799
|
+
suggestedActions: a,
|
|
56800
|
+
votes: ee
|
|
56794
56801
|
})]
|
|
56795
56802
|
});
|
|
56796
56803
|
}
|