@rpcbase/agents-sdk 0.2.0 → 0.3.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/agents-sdk.css +1 -1
- package/dist/api/chat/handler.d.ts.map +1 -1
- package/dist/api/chat/messages/handler.d.ts.map +1 -1
- package/dist/api/chat/messages/trailing/handler.d.ts.map +1 -1
- package/dist/api/chat/runtimeConfig.d.ts +11 -0
- package/dist/api/chat/runtimeConfig.d.ts.map +1 -1
- package/dist/api/chatDb.d.ts +35 -1
- package/dist/api/chatDb.d.ts.map +1 -1
- package/dist/api/chatStore.d.ts +11 -2
- package/dist/api/chatStore.d.ts.map +1 -1
- package/dist/api/session/current/handler.d.ts +4 -0
- package/dist/api/session/current/handler.d.ts.map +1 -0
- package/dist/api/session/current/index.d.ts +11 -0
- package/dist/api/session/current/index.d.ts.map +1 -0
- package/dist/{chatDb-CpCFaAxK.js → chatDb-CcAjAGX7.js} +76 -61
- package/dist/{chatDb-hVHCr0j0.js → chatDb-DfmUbQT2.js} +76 -61
- package/dist/client-routes.browser.js +9 -8
- package/dist/client-routes.js +9 -8
- package/dist/components/ai-elements/model-selector.d.ts.map +1 -1
- package/dist/components/chat.d.ts.map +1 -1
- package/dist/components/multimodal-input.d.ts.map +1 -1
- package/dist/components/sidebar-history.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +4 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/{data-stream-handler-DMKVEvOY.js → data-stream-handler-CTBOlLdZ.js} +109 -95
- package/dist/{data-stream-handler-6o0tw3-M.js → data-stream-handler-LGFXl3Kj.js} +116 -102
- package/dist/{handler-BcbiHqzs.js → handler-5D9tLMpX.js} +418 -274
- package/dist/{handler-CwGQ3dV4.js → handler-B6kVyUoS.js} +1 -1
- package/dist/{handler-B3iF4jS4.js → handler-BKT8Hl0a.js} +1 -1
- package/dist/{handler-CzKTKfwA.js → handler-BLG0AYVC.js} +1 -1
- package/dist/handler-BQZNf9EG.js +21 -0
- package/dist/{handler-Bb3YEDwz.js → handler-BUvspcpX.js} +1 -1
- package/dist/handler-BdCGoVUM.js +21 -0
- package/dist/{handler-CZ-GUuYr.js → handler-BeWk8pDD.js} +1 -1
- package/dist/handler-BgY0anAs.js +19 -0
- package/dist/{handler-BU60I9Tt.js → handler-BqHuBA6Q.js} +1 -1
- package/dist/{handler-C2MJfgeU.js → handler-CEk1hut1.js} +1 -1
- package/dist/{handler-DRk4qlh0.js → handler-CGV7uuUA.js} +1 -1
- package/dist/{handler-DBFa5_B9.js → handler-CKmHOFMG.js} +1 -1
- package/dist/{handler-ImeP5Thm.js → handler-ClWOGjB_.js} +455 -311
- package/dist/{handler-Dmw-3E9n.js → handler-PkV1nrcU.js} +1 -1
- package/dist/handler-dVlpopfq.js +21 -0
- package/dist/handler-klwfX3CY.js +21 -0
- package/dist/handler-mbDBRYl8.js +19 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/ai/openai-reasoning.d.ts +1 -1
- package/dist/lib/ai/openai-reasoning.d.ts.map +1 -1
- package/dist/lib/db/schema.d.ts +29 -0
- package/dist/lib/db/schema.d.ts.map +1 -1
- package/dist/loaders/chatLoader.d.ts +1 -0
- package/dist/loaders/chatLoader.d.ts.map +1 -1
- package/dist/models/RBAgentsChatThread.d.ts +3 -0
- package/dist/models/RBAgentsChatThread.d.ts.map +1 -1
- package/dist/models/RBAgentsUsageEvent.d.ts +45 -0
- package/dist/models/RBAgentsUsageEvent.d.ts.map +1 -0
- package/dist/models/index.browser.d.ts +4 -0
- package/dist/models/index.browser.d.ts.map +1 -1
- package/dist/models/index.d.ts +34 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models.browser.js +35 -3
- package/dist/models.js +204 -4
- package/dist/{openai-reasoning-ARz6ZvZ_.js → openai-reasoning-CLjhz1V1.js} +1 -1
- package/dist/{openai-reasoning-jbPa-xup.js → openai-reasoning-kFq60GX9.js} +1 -1
- package/dist/pages/ChatPage.d.ts.map +1 -1
- package/dist/routes.browser.js +12 -11
- package/dist/routes.js +12 -11
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/tailwind-source.js +1 -1
- package/package.json +1 -1
- package/dist/handler-B4PUL3Fm.js +0 -21
- package/dist/handler-DAjf6ro0.js +0 -19
- package/dist/handler-DN-H4zmz.js +0 -19
- package/dist/handler-Df8dOV-8.js +0 -21
- /package/dist/{handler-CxfBBYhN.js → handler-BdEE0--D.js} +0 -0
- /package/dist/{handler-CzHg9puj.js → handler-BdXUC9Rg.js} +0 -0
- /package/dist/{handler-_UsjVWVA.js → handler-D74Wi6e9.js} +0 -0
- /package/dist/{handler-Ct7ZyGSn.js → handler-D752oOcY.js} +0 -0
- /package/dist/{handler-CSLr0jTM.js → handler-hV65_Dui.js} +0 -0
- /package/dist/{handler-oJ8qxBLd.js → handler-jpHBMoww.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as e, n as t, r as n, t as r } from "./models-CF61gMjU.js";
|
|
2
|
-
import { i, n as a, r as o, t as s } from "./openai-reasoning-
|
|
2
|
+
import { i, n as a, r as o, t as s } from "./openai-reasoning-CLjhz1V1.js";
|
|
3
3
|
import * as c from "react";
|
|
4
4
|
import l, { Children as u, Component as d, Fragment as f, createContext as p, createElement as m, forwardRef as h, isValidElement as g, memo as _, useCallback as v, useContext as y, useDebugValue as b, useEffect as x, useEffectEvent as S, useId as C, useImperativeHandle as w, useInsertionEffect as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k, useSyncExternalStore as A, useSyncExternalStore as j } from "react";
|
|
5
5
|
import { Link as M, Outlet as N, useLocation as P, useNavigate as F, useRevalidator as I, useRouteLoaderData as L, useSearchParams as R } from "@rpcbase/router";
|
|
@@ -40150,7 +40150,10 @@ function Lg() {
|
|
|
40150
40150
|
});
|
|
40151
40151
|
}
|
|
40152
40152
|
function Rg(e = "") {
|
|
40153
|
-
let t = e.trim(), n = le("RBAgentsChatThread", {
|
|
40153
|
+
let t = e.trim(), n = le("RBAgentsChatThread", {
|
|
40154
|
+
userId: t,
|
|
40155
|
+
deletedAt: null
|
|
40156
|
+
}, {
|
|
40154
40157
|
...Fg,
|
|
40155
40158
|
enabled: !!t
|
|
40156
40159
|
}), [r, i] = k(null), [a, o] = k(!1);
|
|
@@ -40297,7 +40300,7 @@ function Bg({ historyState: e, onActiveChatTitleChange: t }) {
|
|
|
40297
40300
|
})] }) }) }), /* @__PURE__ */ B(gf, {
|
|
40298
40301
|
onOpenChange: w,
|
|
40299
40302
|
open: C,
|
|
40300
|
-
children: /* @__PURE__ */ V(bf, { children: [/* @__PURE__ */ V(xf, { children: [/* @__PURE__ */ B(Cf, { children: "Are you absolutely sure?" }), /* @__PURE__ */ B(wf, { children: "This action cannot be undone. This will
|
|
40303
|
+
children: /* @__PURE__ */ V(bf, { children: [/* @__PURE__ */ V(xf, { children: [/* @__PURE__ */ B(Cf, { children: "Are you absolutely sure?" }), /* @__PURE__ */ B(wf, { children: "This action cannot be undone. This will hide the chat from your history." })] }), /* @__PURE__ */ V(Sf, { children: [/* @__PURE__ */ B(Ef, { children: "Cancel" }), /* @__PURE__ */ B(Tf, {
|
|
40301
40304
|
onClick: T,
|
|
40302
40305
|
children: "Continue"
|
|
40303
40306
|
})] })] })
|
|
@@ -50854,7 +50857,7 @@ var GF = new TM({
|
|
|
50854
50857
|
//#endregion
|
|
50855
50858
|
//#region src/components/artifact-actions.tsx
|
|
50856
50859
|
function KF({ artifact: e, handleVersionChange: t, currentVersionIndex: n, isCurrentVersion: r, mode: i, metadata: a, setMetadata: o }) {
|
|
50857
|
-
let [s, c] = k(!1), l =
|
|
50860
|
+
let [s, c] = k(!1), l = xV.find((t) => t.kind === e.kind);
|
|
50858
50861
|
if (!l) throw Error("Artifact definition not found!");
|
|
50859
50862
|
let u = {
|
|
50860
50863
|
content: e.content,
|
|
@@ -52944,7 +52947,7 @@ var LL = _(FL, IL), RL = ep, zL = Sd, BL = c.forwardRef(({ className: e, ...t },
|
|
|
52944
52947
|
let { resolvedTheme: r, theme: i } = hf();
|
|
52945
52948
|
return /* @__PURE__ */ B(qu, {
|
|
52946
52949
|
ref: n,
|
|
52947
|
-
className: W("agents-sdk fixed inset-0 z-50 bg-foreground/50
|
|
52950
|
+
className: W("agents-sdk fixed inset-0 z-50 bg-foreground/50 opacity-100 transition-opacity duration-150 data-closed:opacity-0 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", e),
|
|
52948
52951
|
"data-agents-sdk-resolved-theme": r,
|
|
52949
52952
|
"data-agents-sdk-theme": i,
|
|
52950
52953
|
...t
|
|
@@ -52965,15 +52968,15 @@ var HL = c.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE_
|
|
|
52965
52968
|
children: t
|
|
52966
52969
|
}));
|
|
52967
52970
|
HL.displayName = "DialogClose";
|
|
52968
|
-
var UL = c.forwardRef(({
|
|
52969
|
-
let { resolvedTheme:
|
|
52970
|
-
return /* @__PURE__ */ V(zL, { children: [/* @__PURE__ */ B(BL, {}), /* @__PURE__ */ V(yd, {
|
|
52971
|
-
ref:
|
|
52972
|
-
className: W("agents-sdk fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 sm:rounded-lg",
|
|
52973
|
-
"data-agents-sdk-resolved-theme":
|
|
52974
|
-
"data-agents-sdk-theme":
|
|
52975
|
-
...
|
|
52976
|
-
children: [
|
|
52971
|
+
var UL = c.forwardRef(({ backdropClassName: e, className: t, children: n, ...r }, i) => {
|
|
52972
|
+
let { resolvedTheme: a, theme: o } = hf();
|
|
52973
|
+
return /* @__PURE__ */ V(zL, { children: [/* @__PURE__ */ B(BL, { className: e }), /* @__PURE__ */ V(yd, {
|
|
52974
|
+
ref: i,
|
|
52975
|
+
className: W("agents-sdk fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-closed:fill-mode-forwards data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 sm:rounded-lg", t),
|
|
52976
|
+
"data-agents-sdk-resolved-theme": a,
|
|
52977
|
+
"data-agents-sdk-theme": o,
|
|
52978
|
+
...r,
|
|
52979
|
+
children: [n, /* @__PURE__ */ V(nd, {
|
|
52977
52980
|
className: "absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-disabled:pointer-events-none",
|
|
52978
52981
|
children: [/* @__PURE__ */ B(Xf, { className: "h-4 w-4" }), /* @__PURE__ */ B("span", {
|
|
52979
52982
|
className: "sr-only",
|
|
@@ -53234,6 +53237,7 @@ oR.displayName = "CommandShortcut";
|
|
|
53234
53237
|
//#endregion
|
|
53235
53238
|
//#region src/components/ai-elements/model-selector.tsx
|
|
53236
53239
|
var sR = (e) => /* @__PURE__ */ B(RL, { ...e }), cR = (e) => /* @__PURE__ */ B(VL, { ...e }), lR = ({ className: e, children: t, title: n = "Model Selector", ...r }) => /* @__PURE__ */ V(UL, {
|
|
53240
|
+
backdropClassName: "!bg-transparent",
|
|
53237
53241
|
className: W("p-0", e),
|
|
53238
53242
|
...r,
|
|
53239
53243
|
children: [/* @__PURE__ */ B(KL, {
|
|
@@ -55627,35 +55631,43 @@ var XB = _(YB, (e, t) => e.chatId === t.chatId);
|
|
|
55627
55631
|
function ZB(e, t) {
|
|
55628
55632
|
document.cookie = `${e}=${encodeURIComponent(t)}; path=/; max-age=31536000`;
|
|
55629
55633
|
}
|
|
55630
|
-
var QB = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_") || "default", $B = 40, eV =
|
|
55634
|
+
var QB = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_") || "default", $B = 40, eV = 9;
|
|
55631
55635
|
function tV(e) {
|
|
55632
55636
|
let t = e?.firstElementChild;
|
|
55633
55637
|
return t instanceof HTMLElement ? t : null;
|
|
55634
55638
|
}
|
|
55635
|
-
function nV(e
|
|
55639
|
+
function nV(e) {
|
|
55640
|
+
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
|
|
55641
|
+
return {
|
|
55642
|
+
minHeight: Math.max(a + o + s, $B),
|
|
55643
|
+
maxHeight: a * eV + o + s
|
|
55644
|
+
};
|
|
55645
|
+
}
|
|
55646
|
+
function rV(e, t) {
|
|
55636
55647
|
if (!e) return;
|
|
55637
55648
|
e.style.height = "auto";
|
|
55638
|
-
let n = e.scrollHeight,
|
|
55639
|
-
if (e.style.height = `${
|
|
55640
|
-
if (
|
|
55641
|
-
|
|
55649
|
+
let { minHeight: n, maxHeight: r } = nV(e), i = e.scrollHeight, a = Math.max(i, n), o = Math.min(a, r), s = tV(t.scrollArea);
|
|
55650
|
+
if (e.style.height = `${a}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight((e) => e === o ? e : o), s) {
|
|
55651
|
+
if (a <= r) {
|
|
55652
|
+
s.scrollTop = 0;
|
|
55642
55653
|
return;
|
|
55643
55654
|
}
|
|
55644
55655
|
e.selectionEnd >= e.value.length && requestAnimationFrame(() => {
|
|
55645
|
-
|
|
55656
|
+
s.scrollTop = s.scrollHeight;
|
|
55646
55657
|
});
|
|
55647
55658
|
}
|
|
55648
55659
|
}
|
|
55649
|
-
function
|
|
55660
|
+
function iV(e, t) {
|
|
55650
55661
|
if (!e) return;
|
|
55651
|
-
|
|
55652
|
-
|
|
55653
|
-
|
|
55662
|
+
let { minHeight: n } = nV(e);
|
|
55663
|
+
e.style.height = `${n}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight(n);
|
|
55664
|
+
let r = tV(t.scrollArea);
|
|
55665
|
+
r && (r.scrollTop = 0);
|
|
55654
55666
|
}
|
|
55655
|
-
function
|
|
55667
|
+
function aV({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: c, setMessages: l, sendMessage: u, className: d, selectedModelId: f, onModelChange: p, openaiReasoningEffort: m = s, onOpenAIReasoningEffortChange: h }) {
|
|
55656
55668
|
let g = O(null), _ = O(null), [y, b] = k($B), { width: S } = vM(), { getChatPath: C } = lt();
|
|
55657
55669
|
x(() => {
|
|
55658
|
-
|
|
55670
|
+
rV(g.current, {
|
|
55659
55671
|
scrollArea: _.current,
|
|
55660
55672
|
setScrollAreaHeight: b
|
|
55661
55673
|
});
|
|
@@ -55676,7 +55688,7 @@ function iV({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55676
55688
|
E(t);
|
|
55677
55689
|
}, [t, E]);
|
|
55678
55690
|
let D = (e) => {
|
|
55679
|
-
n(e.target.value),
|
|
55691
|
+
n(e.target.value), rV(e.currentTarget, {
|
|
55680
55692
|
scrollArea: _.current,
|
|
55681
55693
|
setScrollAreaHeight: b
|
|
55682
55694
|
});
|
|
@@ -55693,7 +55705,7 @@ function iV({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55693
55705
|
type: "text",
|
|
55694
55706
|
text: t
|
|
55695
55707
|
}]
|
|
55696
|
-
}), o([]), E(""), n(""),
|
|
55708
|
+
}), o([]), E(""), n(""), iV(g.current, {
|
|
55697
55709
|
scrollArea: _.current,
|
|
55698
55710
|
setScrollAreaHeight: b
|
|
55699
55711
|
}), S && S > 768 && g.current?.focus();
|
|
@@ -55865,18 +55877,18 @@ function iV({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55865
55877
|
children: [/* @__PURE__ */ V(KB, {
|
|
55866
55878
|
className: "gap-0 sm:gap-0.5",
|
|
55867
55879
|
children: [
|
|
55868
|
-
/* @__PURE__ */ B(
|
|
55880
|
+
/* @__PURE__ */ B(cV, {
|
|
55869
55881
|
fileInputRef: A,
|
|
55870
55882
|
selectedModelId: f,
|
|
55871
55883
|
status: r
|
|
55872
55884
|
}),
|
|
55873
|
-
/* @__PURE__ */ B(
|
|
55885
|
+
/* @__PURE__ */ B(uV, {
|
|
55874
55886
|
focusTargetRef: g,
|
|
55875
55887
|
idScope: e,
|
|
55876
55888
|
onModelChange: p,
|
|
55877
55889
|
selectedModelId: f
|
|
55878
55890
|
}),
|
|
55879
|
-
/* @__PURE__ */ B(
|
|
55891
|
+
/* @__PURE__ */ B(fV, {
|
|
55880
55892
|
disabled: r !== "ready",
|
|
55881
55893
|
idScope: e,
|
|
55882
55894
|
onChange: h,
|
|
@@ -55884,7 +55896,7 @@ function iV({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55884
55896
|
value: m
|
|
55885
55897
|
})
|
|
55886
55898
|
]
|
|
55887
|
-
}), r === "submitted" || r === "streaming" ? /* @__PURE__ */ B(
|
|
55899
|
+
}), r === "submitted" || r === "streaming" ? /* @__PURE__ */ B(mV, {
|
|
55888
55900
|
setMessages: l,
|
|
55889
55901
|
stop: i
|
|
55890
55902
|
}) : /* @__PURE__ */ B(qB, {
|
|
@@ -55900,8 +55912,8 @@ function iV({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
55900
55912
|
]
|
|
55901
55913
|
});
|
|
55902
55914
|
}
|
|
55903
|
-
var
|
|
55904
|
-
function
|
|
55915
|
+
var oV = _(aV, (e, t) => !(e.input !== t.input || e.status !== t.status || !_e(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort));
|
|
55916
|
+
function sV({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
55905
55917
|
let r = n.includes("reasoning") || n.includes("think");
|
|
55906
55918
|
return /* @__PURE__ */ B(lf, {
|
|
55907
55919
|
className: "aspect-square h-8 rounded-lg p-1 transition-colors hover:bg-accent",
|
|
@@ -55920,8 +55932,8 @@ function oV({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
|
55920
55932
|
})
|
|
55921
55933
|
});
|
|
55922
55934
|
}
|
|
55923
|
-
var
|
|
55924
|
-
function
|
|
55935
|
+
var cV = _(sV);
|
|
55936
|
+
function lV({ focusTargetRef: t, idScope: r, selectedModelId: i, onModelChange: a }) {
|
|
55925
55937
|
let [o, s] = k(!1), c = O(!1), l = QB(r), u = n.find((e) => e.id === i) ?? n.find((e) => e.id === "openai/gpt-5.4-mini") ?? n[0], [d] = u.id.split("/"), f = {
|
|
55926
55938
|
anthropic: "Anthropic",
|
|
55927
55939
|
openai: "OpenAI",
|
|
@@ -55965,20 +55977,21 @@ function cV({ focusTargetRef: t, idScope: r, selectedModelId: i, onModelChange:
|
|
|
55965
55977
|
})]
|
|
55966
55978
|
});
|
|
55967
55979
|
}
|
|
55968
|
-
var
|
|
55969
|
-
function
|
|
55970
|
-
let
|
|
55980
|
+
var uV = _(lV), dV = (e, t) => t.includes(e);
|
|
55981
|
+
function fV({ idScope: e, selectedModelId: t, value: n, onChange: r, disabled: s }) {
|
|
55982
|
+
let c = i(t), l = o(t), u = a(t), d = u && dV(u, l) ? u : l[0], f = dV(n, l) ? n : d ?? "default";
|
|
55971
55983
|
return x(() => {
|
|
55972
|
-
!
|
|
55984
|
+
!c || !r || dV(n, l) || r(d ?? "default");
|
|
55973
55985
|
}, [
|
|
55974
|
-
r,
|
|
55975
|
-
d,
|
|
55976
55986
|
l,
|
|
55987
|
+
d,
|
|
55988
|
+
r,
|
|
55989
|
+
c,
|
|
55977
55990
|
n
|
|
55978
|
-
]), !
|
|
55979
|
-
disabled:
|
|
55991
|
+
]), !c || !r || f === "default" ? null : /* @__PURE__ */ V(DB, {
|
|
55992
|
+
disabled: s,
|
|
55980
55993
|
onValueChange: (e) => r(e),
|
|
55981
|
-
value:
|
|
55994
|
+
value: f,
|
|
55982
55995
|
children: [/* @__PURE__ */ B(kB, {
|
|
55983
55996
|
className: "h-8 w-[180px] gap-1 border-0 bg-transparent px-2 text-xs hover:bg-accent focus:ring-0 focus:ring-offset-0",
|
|
55984
55997
|
id: `agents-sdk-reasoning-effort-${QB(e)}`,
|
|
@@ -55989,16 +56002,13 @@ function dV({ idScope: e, selectedModelId: t, value: n, onChange: r, disabled: c
|
|
|
55989
56002
|
children: /* @__PURE__ */ B(OB, { placeholder: "Reasoning" })
|
|
55990
56003
|
})]
|
|
55991
56004
|
})
|
|
55992
|
-
}), /* @__PURE__ */
|
|
55993
|
-
value: s,
|
|
55994
|
-
children: /* @__PURE__ */ B("span", { children: f ? `Reasoning: Default (${f})` : "Reasoning: Default" })
|
|
55995
|
-
}), u.map((e) => /* @__PURE__ */ B(PB, {
|
|
56005
|
+
}), /* @__PURE__ */ B(MB, { children: l.map((e) => /* @__PURE__ */ B(PB, {
|
|
55996
56006
|
value: e,
|
|
55997
56007
|
children: /* @__PURE__ */ B("span", { children: `Reasoning: ${e}` })
|
|
55998
|
-
}, e))
|
|
56008
|
+
}, e)) })]
|
|
55999
56009
|
});
|
|
56000
56010
|
}
|
|
56001
|
-
function
|
|
56011
|
+
function pV({ stop: e, setMessages: t }) {
|
|
56002
56012
|
return /* @__PURE__ */ B(lf, {
|
|
56003
56013
|
className: "size-8 rounded-full bg-primary p-1 text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
|
|
56004
56014
|
"data-testid": "stop-button",
|
|
@@ -56008,7 +56018,7 @@ function fV({ stop: e, setMessages: t }) {
|
|
|
56008
56018
|
children: /* @__PURE__ */ B(bt, { size: 14 })
|
|
56009
56019
|
});
|
|
56010
56020
|
}
|
|
56011
|
-
var
|
|
56021
|
+
var mV = _(pV), hV = ({ description: e, icon: t, selectedTool: n, setSelectedTool: r, isToolbarVisible: i, setIsToolbarVisible: a, isAnimating: o, sendMessage: s, onClick: c }) => {
|
|
56012
56022
|
let [l, u] = k(!1);
|
|
56013
56023
|
x(() => {
|
|
56014
56024
|
n !== e && u(!1);
|
|
@@ -56066,14 +56076,14 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56066
56076
|
children: e
|
|
56067
56077
|
})]
|
|
56068
56078
|
});
|
|
56069
|
-
},
|
|
56079
|
+
}, gV = [...[
|
|
56070
56080
|
,
|
|
56071
56081
|
,
|
|
56072
56082
|
,
|
|
56073
56083
|
,
|
|
56074
56084
|
,
|
|
56075
56085
|
,
|
|
56076
|
-
]].map((e) => Ye(5)),
|
|
56086
|
+
]].map((e) => Ye(5)), _V = ({ setSelectedTool: e, sendMessage: t, isAnimating: n }) => {
|
|
56077
56087
|
let r = [
|
|
56078
56088
|
"Elementary",
|
|
56079
56089
|
"Middle School",
|
|
@@ -56089,7 +56099,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56089
56099
|
return () => e();
|
|
56090
56100
|
}, [a]), /* @__PURE__ */ V("div", {
|
|
56091
56101
|
className: "relative flex flex-col items-center justify-end",
|
|
56092
|
-
children: [
|
|
56102
|
+
children: [gV.map((e) => /* @__PURE__ */ B(Dj.div, {
|
|
56093
56103
|
animate: { opacity: 1 },
|
|
56094
56104
|
className: "flex size-[40px] flex-row items-center justify-center",
|
|
56095
56105
|
exit: { opacity: 0 },
|
|
@@ -56141,7 +56151,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56141
56151
|
})]
|
|
56142
56152
|
}) })]
|
|
56143
56153
|
});
|
|
56144
|
-
},
|
|
56154
|
+
}, vV = ({ isToolbarVisible: e, selectedTool: t, setSelectedTool: n, sendMessage: r, isAnimating: i, setIsToolbarVisible: a, tools: o }) => {
|
|
56145
56155
|
let [s, ...c] = o;
|
|
56146
56156
|
return /* @__PURE__ */ V(Dj.div, {
|
|
56147
56157
|
animate: {
|
|
@@ -56157,7 +56167,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56157
56167
|
opacity: 0,
|
|
56158
56168
|
scale: .95
|
|
56159
56169
|
},
|
|
56160
|
-
children: [/* @__PURE__ */ B(Pk, { children: e && c.map((e) => /* @__PURE__ */ B(
|
|
56170
|
+
children: [/* @__PURE__ */ B(Pk, { children: e && c.map((e) => /* @__PURE__ */ B(hV, {
|
|
56161
56171
|
description: e.description,
|
|
56162
56172
|
icon: e.icon,
|
|
56163
56173
|
isAnimating: i,
|
|
@@ -56165,7 +56175,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56165
56175
|
selectedTool: t,
|
|
56166
56176
|
sendMessage: r,
|
|
56167
56177
|
setSelectedTool: n
|
|
56168
|
-
}, e.description)) }), /* @__PURE__ */ B(
|
|
56178
|
+
}, e.description)) }), /* @__PURE__ */ B(hV, {
|
|
56169
56179
|
description: s.description,
|
|
56170
56180
|
icon: s.icon,
|
|
56171
56181
|
isAnimating: i,
|
|
@@ -56177,7 +56187,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56177
56187
|
setSelectedTool: n
|
|
56178
56188
|
})]
|
|
56179
56189
|
});
|
|
56180
|
-
},
|
|
56190
|
+
}, yV = _(({ isToolbarVisible: e, setIsToolbarVisible: t, sendMessage: n, status: r, stop: i, setMessages: a, artifactKind: o }) => {
|
|
56181
56191
|
let s = O(null), c = O(null), [l, u] = k(null), [d, f] = k(!1);
|
|
56182
56192
|
gM(s, () => {
|
|
56183
56193
|
t(!1), u(null);
|
|
@@ -56194,7 +56204,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56194
56204
|
}, []), x(() => {
|
|
56195
56205
|
r === "streaming" && t(!1);
|
|
56196
56206
|
}, [r, t]);
|
|
56197
|
-
let h =
|
|
56207
|
+
let h = xV.find((e) => e.kind === o);
|
|
56198
56208
|
if (!h) throw Error("Artifact definition not found!");
|
|
56199
56209
|
let g = h.toolbar;
|
|
56200
56210
|
return g.length === 0 ? null : /* @__PURE__ */ B(mm, {
|
|
@@ -56256,11 +56266,11 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56256
56266
|
i(), a((e) => e);
|
|
56257
56267
|
},
|
|
56258
56268
|
children: /* @__PURE__ */ B(bt, {})
|
|
56259
|
-
}, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ B(
|
|
56269
|
+
}, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ B(_V, {
|
|
56260
56270
|
isAnimating: d,
|
|
56261
56271
|
sendMessage: n,
|
|
56262
56272
|
setSelectedTool: u
|
|
56263
|
-
}, "reading-level-selector") : /* @__PURE__ */ B(
|
|
56273
|
+
}, "reading-level-selector") : /* @__PURE__ */ B(vV, {
|
|
56264
56274
|
isAnimating: d,
|
|
56265
56275
|
isToolbarVisible: e,
|
|
56266
56276
|
selectedTool: l,
|
|
@@ -56271,7 +56281,7 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56271
56281
|
}, "tools")
|
|
56272
56282
|
})
|
|
56273
56283
|
});
|
|
56274
|
-
}, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)),
|
|
56284
|
+
}, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)), bV = ({ handleVersionChange: e, documents: t, currentVersionIndex: n }) => {
|
|
56275
56285
|
let { artifact: r } = Xy(), { width: i } = vM(), a = i < 768, { mutate: o } = $_(), [s, c] = k(!1);
|
|
56276
56286
|
if (t) return /* @__PURE__ */ V(Dj.div, {
|
|
56277
56287
|
animate: { y: 0 },
|
|
@@ -56306,13 +56316,13 @@ var pV = _(fV), mV = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
56306
56316
|
})]
|
|
56307
56317
|
})]
|
|
56308
56318
|
});
|
|
56309
|
-
},
|
|
56319
|
+
}, xV = [
|
|
56310
56320
|
GF,
|
|
56311
56321
|
OM,
|
|
56312
56322
|
AM,
|
|
56313
56323
|
XP
|
|
56314
56324
|
];
|
|
56315
|
-
function
|
|
56325
|
+
function SV({ 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 }) {
|
|
56316
56326
|
let { artifact: h, setArtifact: g, metadata: _, setMetadata: y } = Xy(), { data: b, isLoading: S, mutate: C } = gv(h.documentId !== "init" && h.status !== "streaming" ? `/api/rb/agents/document?id=${h.documentId}` : null, ef), [w, T] = k("edit"), [E, D] = k(null), [O, A] = k(-1);
|
|
56317
56327
|
x(() => {
|
|
56318
56328
|
if (b && b.length > 0) {
|
|
@@ -56360,7 +56370,7 @@ function xV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56360
56370
|
}
|
|
56361
56371
|
let R = (e) => {
|
|
56362
56372
|
b && (e === "latest" && (A(b.length - 1), T("edit")), e === "toggle" && T((e) => e === "edit" ? "diff" : "edit"), e === "prev" ? O > 0 && A((e) => e - 1) : e === "next" && O < b.length - 1 && A((e) => e + 1));
|
|
56363
|
-
}, [z, ee] = k(!1), te = b && b.length > 0 ? O === b.length - 1 : !0, ne = ym(), re =
|
|
56373
|
+
}, [z, ee] = k(!1), te = b && b.length > 0 ? O === b.length - 1 : !0, ne = ym(), re = xV.find((e) => e.kind === h.kind);
|
|
56364
56374
|
if (!re) throw Error("Artifact definition not found!");
|
|
56365
56375
|
return x(() => {
|
|
56366
56376
|
h.documentId !== "init" && re.initialize && re.initialize({
|
|
@@ -56423,7 +56433,7 @@ function xV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56423
56433
|
votes: f
|
|
56424
56434
|
}), /* @__PURE__ */ B("div", {
|
|
56425
56435
|
className: "relative flex w-full flex-row items-end gap-2 px-4 pb-4",
|
|
56426
|
-
children: /* @__PURE__ */ B(
|
|
56436
|
+
children: /* @__PURE__ */ B(oV, {
|
|
56427
56437
|
attachments: o,
|
|
56428
56438
|
chatId: t,
|
|
56429
56439
|
className: "bg-background dark:bg-muted",
|
|
@@ -56519,7 +56529,7 @@ function xV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56519
56529
|
status: h.status,
|
|
56520
56530
|
suggestions: [],
|
|
56521
56531
|
title: h.title
|
|
56522
|
-
}), /* @__PURE__ */ B(Pk, { children: te && /* @__PURE__ */ B(
|
|
56532
|
+
}), /* @__PURE__ */ B(Pk, { children: te && /* @__PURE__ */ B(yV, {
|
|
56523
56533
|
artifactKind: h.kind,
|
|
56524
56534
|
isToolbarVisible: z,
|
|
56525
56535
|
sendMessage: c,
|
|
@@ -56529,7 +56539,7 @@ function xV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56529
56539
|
stop: a
|
|
56530
56540
|
}) })]
|
|
56531
56541
|
}),
|
|
56532
|
-
/* @__PURE__ */ B(Pk, { children: !te && /* @__PURE__ */ B(
|
|
56542
|
+
/* @__PURE__ */ B(Pk, { children: !te && /* @__PURE__ */ B(bV, {
|
|
56533
56543
|
currentVersionIndex: O,
|
|
56534
56544
|
documents: b,
|
|
56535
56545
|
handleVersionChange: R
|
|
@@ -56538,7 +56548,7 @@ function xV({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
56538
56548
|
})]
|
|
56539
56549
|
}) });
|
|
56540
56550
|
}
|
|
56541
|
-
var
|
|
56551
|
+
var CV = _(SV, (e, t) => !(e.status !== t.status || !_e(e.votes, t.votes) || e.input !== t.input || !_e(e.messages, t.messages.length))), wV = () => /* @__PURE__ */ V("div", {
|
|
56542
56552
|
className: "mx-auto mt-4 flex size-full max-w-3xl flex-col justify-center px-4 md:mt-16 md:px-8",
|
|
56543
56553
|
children: [/* @__PURE__ */ B(Dj.div, {
|
|
56544
56554
|
animate: {
|
|
@@ -56576,7 +56586,7 @@ var SV = _(xV, (e, t) => !(e.status !== t.status || !_e(e.votes, t.votes) || e.i
|
|
|
56576
56586
|
}, "overview");
|
|
56577
56587
|
//#endregion
|
|
56578
56588
|
//#region src/components/messages.tsx
|
|
56579
|
-
function
|
|
56589
|
+
function TV({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, setMessages: a, regenerate: o, isReadonly: s, selectedModelId: c }) {
|
|
56580
56590
|
let l = i.at(-1), u = (e) => e === "dynamic-tool" || e.startsWith("tool-"), d = l?.role === "assistant" && (l.parts?.some((e) => e.type === "text" ? !!e.text?.trim() : e.type === "reasoning" ? kL(e) : !!u(e.type)) ?? !1), f = n === "submitted" || n === "streaming" && l?.role === "assistant" && !d, p = n === "streaming" && l?.role === "assistant" && !d, { containerRef: m, endRef: h, isAtBottom: g, scrollToBottom: _, hasSentMessage: v } = ZF({ status: n });
|
|
56581
56591
|
return mt(), /* @__PURE__ */ V("div", {
|
|
56582
56592
|
className: "relative flex-1",
|
|
@@ -56586,7 +56596,7 @@ function wV({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
|
|
|
56586
56596
|
children: /* @__PURE__ */ V("div", {
|
|
56587
56597
|
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",
|
|
56588
56598
|
children: [
|
|
56589
|
-
i.length === 0 && /* @__PURE__ */ B(
|
|
56599
|
+
i.length === 0 && /* @__PURE__ */ B(wV, {}),
|
|
56590
56600
|
i.map((c, l) => p && l === i.length - 1 && c.role === "assistant" ? null : /* @__PURE__ */ B(NL, {
|
|
56591
56601
|
addToolApprovalResponse: e,
|
|
56592
56602
|
chatId: t,
|
|
@@ -56614,15 +56624,17 @@ function wV({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
|
|
|
56614
56624
|
})]
|
|
56615
56625
|
});
|
|
56616
56626
|
}
|
|
56617
|
-
var
|
|
56627
|
+
var EV = TV, DV = (e) => e?.parts?.some((e) => {
|
|
56618
56628
|
let t = e.state;
|
|
56619
56629
|
return t === "approval-responded" || t === "output-denied";
|
|
56620
|
-
}) ?? !1,
|
|
56621
|
-
function
|
|
56622
|
-
let { setDataStream:
|
|
56630
|
+
}) ?? !1, OV = (e) => `agents-sdk:chat:${e}:stream`, kV = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), AV = (e) => a(e) ?? "default";
|
|
56631
|
+
function jV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, autoResume: s }) {
|
|
56632
|
+
let { setDataStream: c } = mt(), { getChatPath: l } = lt(), u = t.has(a) ? a : r, d = AV(u), [f, p] = k(""), [m, h] = k(u), g = O(m), [_, v] = k(d), y = O(_);
|
|
56623
56633
|
x(() => {
|
|
56624
56634
|
g.current = m;
|
|
56625
56635
|
}, [m]), x(() => {
|
|
56636
|
+
h(u), v(AV(u));
|
|
56637
|
+
}, [e, u]), x(() => {
|
|
56626
56638
|
y.current = _;
|
|
56627
56639
|
}, [_]);
|
|
56628
56640
|
let { messages: b, setMessages: S, sendMessage: C, status: w, stop: T, regenerate: E, resumeStream: D, addToolApprovalResponse: A } = qy({
|
|
@@ -56635,15 +56647,15 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56635
56647
|
api: "/api/rb/agents/chat",
|
|
56636
56648
|
fetch: tf,
|
|
56637
56649
|
prepareSendMessagesRequest(e) {
|
|
56638
|
-
let t = e.messages.at(-1),
|
|
56650
|
+
let t = g.current, n = y.current, r = e.messages.at(-1), a = e.messages.at(-2), o = Zd(e.headers, Yd()), s = r?.role !== "user" || r?.role === "user" && DV(a);
|
|
56639
56651
|
return {
|
|
56640
|
-
...
|
|
56652
|
+
...o ? { headers: o } : {},
|
|
56641
56653
|
body: {
|
|
56642
56654
|
id: e.id,
|
|
56643
|
-
...
|
|
56644
|
-
selectedChatModel:
|
|
56645
|
-
...i(
|
|
56646
|
-
openaiReasoningEffort:
|
|
56655
|
+
...s ? { messages: e.messages } : { message: r },
|
|
56656
|
+
selectedChatModel: t,
|
|
56657
|
+
...i(t) && n !== "default" ? {
|
|
56658
|
+
openaiReasoningEffort: n,
|
|
56647
56659
|
openaiReasoningSummary: "detailed"
|
|
56648
56660
|
} : {},
|
|
56649
56661
|
...e.body
|
|
@@ -56656,7 +56668,7 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56656
56668
|
}
|
|
56657
56669
|
}),
|
|
56658
56670
|
onData: (e) => {
|
|
56659
|
-
|
|
56671
|
+
c((t) => t ? [...t, e] : []);
|
|
56660
56672
|
},
|
|
56661
56673
|
onError: (e) => {
|
|
56662
56674
|
if (e instanceof Vd) {
|
|
@@ -56670,17 +56682,17 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56670
56682
|
se.error("Something went wrong. Please try again.");
|
|
56671
56683
|
}
|
|
56672
56684
|
}), j = O(null), M = O("");
|
|
56673
|
-
x(() => ce(
|
|
56674
|
-
if (!
|
|
56685
|
+
x(() => ce(OV(e), (t) => {
|
|
56686
|
+
if (!kV(t) || t.chatId !== e) return;
|
|
56675
56687
|
let n = t.message;
|
|
56676
|
-
if (
|
|
56688
|
+
if (kV(n)) {
|
|
56677
56689
|
let e = typeof n.id == "string" ? n.id : null, t = typeof n.role == "string" ? n.role : null, r = Array.isArray(n.parts) ? n.parts : null;
|
|
56678
56690
|
if (e && t && r) {
|
|
56679
56691
|
let i = {
|
|
56680
56692
|
id: e,
|
|
56681
56693
|
role: t,
|
|
56682
56694
|
parts: r,
|
|
56683
|
-
metadata:
|
|
56695
|
+
metadata: kV(n.metadata) ? n.metadata : { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
56684
56696
|
};
|
|
56685
56697
|
S((t) => {
|
|
56686
56698
|
let n = t.findIndex((t) => t.id === e);
|
|
@@ -56693,12 +56705,12 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56693
56705
|
return;
|
|
56694
56706
|
}
|
|
56695
56707
|
let r = t.part;
|
|
56696
|
-
if (!
|
|
56708
|
+
if (!kV(r)) return;
|
|
56697
56709
|
if (r.type === "start" && typeof r.messageId == "string") {
|
|
56698
56710
|
j.current = r.messageId, M.current = "";
|
|
56699
56711
|
return;
|
|
56700
56712
|
}
|
|
56701
|
-
if (typeof r.type == "string" && r.type.startsWith("data-") &&
|
|
56713
|
+
if (typeof r.type == "string" && r.type.startsWith("data-") && c((e) => e ? [...e, r] : []), r.type !== "text-delta" || typeof r.delta != "string") return;
|
|
56702
56714
|
let i = j.current;
|
|
56703
56715
|
if (!i) return;
|
|
56704
56716
|
M.current += r.delta;
|
|
@@ -56717,7 +56729,7 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56717
56729
|
});
|
|
56718
56730
|
}), [
|
|
56719
56731
|
e,
|
|
56720
|
-
|
|
56732
|
+
c,
|
|
56721
56733
|
S
|
|
56722
56734
|
]);
|
|
56723
56735
|
let [N] = R(), P = N.get("query"), [F, I] = k(!1);
|
|
@@ -56733,18 +56745,18 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56733
56745
|
let t = new URLSearchParams(window.location.search);
|
|
56734
56746
|
t.delete("query");
|
|
56735
56747
|
let n = t.toString();
|
|
56736
|
-
window.history.replaceState({}, "", `${
|
|
56748
|
+
window.history.replaceState({}, "", `${l(e)}${n ? `?${n}` : ""}`);
|
|
56737
56749
|
}
|
|
56738
56750
|
}, [
|
|
56739
56751
|
P,
|
|
56740
56752
|
C,
|
|
56741
56753
|
F,
|
|
56742
56754
|
e,
|
|
56743
|
-
|
|
56755
|
+
l
|
|
56744
56756
|
]);
|
|
56745
56757
|
let { data: L } = gv(b.length >= 2 ? `/api/rb/agents/vote?chatId=${e}` : null, ef), [z, ee] = k([]), H = Yy((e) => e.isVisible);
|
|
56746
56758
|
return Zy({
|
|
56747
|
-
autoResume:
|
|
56759
|
+
autoResume: s,
|
|
56748
56760
|
initialMessages: n,
|
|
56749
56761
|
resumeStream: D,
|
|
56750
56762
|
setMessages: S
|
|
@@ -56752,25 +56764,27 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56752
56764
|
className: "relative flex h-full min-h-0 min-w-0 overflow-hidden bg-background",
|
|
56753
56765
|
children: [/* @__PURE__ */ V("div", {
|
|
56754
56766
|
className: "overscroll-behavior-contain flex h-full min-h-0 min-w-0 flex-1 touch-pan-y flex-col bg-background",
|
|
56755
|
-
children: [/* @__PURE__ */ B(
|
|
56767
|
+
children: [/* @__PURE__ */ B(EV, {
|
|
56756
56768
|
addToolApprovalResponse: A,
|
|
56757
56769
|
chatId: e,
|
|
56758
56770
|
isArtifactVisible: H,
|
|
56759
56771
|
isReadonly: o,
|
|
56760
56772
|
messages: b,
|
|
56761
56773
|
regenerate: E,
|
|
56762
|
-
selectedModelId:
|
|
56774
|
+
selectedModelId: u,
|
|
56763
56775
|
setMessages: S,
|
|
56764
56776
|
status: w,
|
|
56765
56777
|
votes: L
|
|
56766
56778
|
}), /* @__PURE__ */ B("div", {
|
|
56767
56779
|
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",
|
|
56768
|
-
children: !o && /* @__PURE__ */ B(
|
|
56780
|
+
children: !o && /* @__PURE__ */ B(oV, {
|
|
56769
56781
|
attachments: z,
|
|
56770
56782
|
chatId: e,
|
|
56771
56783
|
input: f,
|
|
56772
56784
|
messages: b,
|
|
56773
|
-
onModelChange:
|
|
56785
|
+
onModelChange: (e) => {
|
|
56786
|
+
h(e), v(AV(e));
|
|
56787
|
+
},
|
|
56774
56788
|
onOpenAIReasoningEffortChange: v,
|
|
56775
56789
|
openaiReasoningEffort: _,
|
|
56776
56790
|
selectedModelId: m,
|
|
@@ -56782,7 +56796,7 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56782
56796
|
stop: T
|
|
56783
56797
|
})
|
|
56784
56798
|
})]
|
|
56785
|
-
}), /* @__PURE__ */ B(
|
|
56799
|
+
}), /* @__PURE__ */ B(CV, {
|
|
56786
56800
|
addToolApprovalResponse: A,
|
|
56787
56801
|
attachments: z,
|
|
56788
56802
|
chatId: e,
|
|
@@ -56803,7 +56817,7 @@ function kV({ id: e, initialMessages: n, initialChatModel: a, isReadonly: o, aut
|
|
|
56803
56817
|
}
|
|
56804
56818
|
//#endregion
|
|
56805
56819
|
//#region src/components/data-stream-handler.tsx
|
|
56806
|
-
function
|
|
56820
|
+
function MV() {
|
|
56807
56821
|
let { dataStream: e, setDataStream: t } = mt(), { artifact: n, setArtifact: r, setMetadata: i } = Xy();
|
|
56808
56822
|
return x(() => {
|
|
56809
56823
|
if (!e?.length) return;
|
|
@@ -56811,7 +56825,7 @@ function AV() {
|
|
|
56811
56825
|
t([]);
|
|
56812
56826
|
for (let e of a) {
|
|
56813
56827
|
if (e.type === "data-chat-title") continue;
|
|
56814
|
-
let t =
|
|
56828
|
+
let t = xV.find((e) => e.kind === n.kind);
|
|
56815
56829
|
t?.onStreamPart && t.onStreamPart({
|
|
56816
56830
|
streamPart: e,
|
|
56817
56831
|
setArtifact: r,
|
|
@@ -56859,4 +56873,4 @@ function AV() {
|
|
|
56859
56873
|
]), null;
|
|
56860
56874
|
}
|
|
56861
56875
|
//#endregion
|
|
56862
|
-
export { zg as a, Xd as c, ct as d, dt as f, rt as g, lt as h, Kg as i, Jd as l, G as m,
|
|
56876
|
+
export { zg as a, Xd as c, ct as d, dt as f, rt as g, lt as h, Kg as i, Jd as l, G as m, jV as n, of as o, ut as p, Ug as r, Yd as s, MV as t, pt as u };
|