teodor-new-chat-ui 4.3.437 → 4.3.439
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Messaging domain models for conversation rendering and artifacts.
|
|
3
3
|
*/
|
|
4
|
-
export type Role = "system" | "user" | "assistant" | "tool";
|
|
4
|
+
export type Role = "system" | "user" | "assistant" | "tool" | "default_message";
|
|
5
5
|
export type TextPart = {
|
|
6
6
|
type: "text";
|
|
7
7
|
text: string;
|
|
@@ -75,10 +75,9 @@ export interface ChatMessage {
|
|
|
75
75
|
__syntheticStreaming?: boolean;
|
|
76
76
|
}
|
|
77
77
|
export interface DefaultMessage {
|
|
78
|
-
type?: "default_message";
|
|
79
78
|
id?: string;
|
|
80
79
|
threadId?: string;
|
|
81
|
-
role:
|
|
80
|
+
role: "default_message";
|
|
82
81
|
content: string;
|
|
83
82
|
createdAt?: string;
|
|
84
83
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -237,7 +237,7 @@ function ux(e) {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
function dx(e) {
|
|
240
|
-
return e === "assistant" || e === "user" || e === "system" || e === "tool";
|
|
240
|
+
return e === "assistant" || e === "user" || e === "system" || e === "tool" || e === "default_message";
|
|
241
241
|
}
|
|
242
242
|
function fx(e) {
|
|
243
243
|
return typeof e == "string" ? [{ type: "text", text: e }] : Array.isArray(e) ? e.filter(
|
|
@@ -3730,7 +3730,7 @@ function hw(e) {
|
|
|
3730
3730
|
return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
|
|
3731
3731
|
}
|
|
3732
3732
|
function Sc(e) {
|
|
3733
|
-
if (
|
|
3733
|
+
if (e.role === "default_message")
|
|
3734
3734
|
return `default:${e.content.length}`;
|
|
3735
3735
|
const t = e.updatedAt ?? e.createdAt ?? "", n = Array.isArray(e.content) ? e.content.map((a) => {
|
|
3736
3736
|
switch (a.type) {
|
|
@@ -14585,7 +14585,7 @@ const Pl = Pg(function({
|
|
|
14585
14585
|
onSelectCheckpoint: E,
|
|
14586
14586
|
attemptMetas: R = []
|
|
14587
14587
|
}) {
|
|
14588
|
-
const [P, L] = fe(!1), [B, W] = fe("preview"), [z, N] = fe(!1), { currentThreadId: U } = To(), { respondToInterrupt: $ } = Os(), M = l === "phone" || l === "half-screen", j = t.role, k = j === "tool", K = Ze(() =>
|
|
14588
|
+
const [P, L] = fe(!1), [B, W] = fe("preview"), [z, N] = fe(!1), { currentThreadId: U } = To(), { respondToInterrupt: $ } = Os(), M = l === "phone" || l === "half-screen", j = t.role, k = j === "tool", K = Ze(() => t.role === "default_message" ? t : null, [t]), G = !!K, A = !(r && j !== "user"), {
|
|
14589
14589
|
uploadingFiles: _,
|
|
14590
14590
|
handleFileClick: q,
|
|
14591
14591
|
fileViewerOpen: X,
|
|
@@ -15047,7 +15047,7 @@ const xE = {
|
|
|
15047
15047
|
checkpointIndex: w,
|
|
15048
15048
|
onSelectCheckpoint: y
|
|
15049
15049
|
}) {
|
|
15050
|
-
const C = wh(t, n), S =
|
|
15050
|
+
const C = wh(t, n), S = t.role === "default_message", E = !!t.__syntheticStreaming, R = w ?? xE, P = !S && "checkpointId" in t ? t.checkpointId ?? null : null, { attemptCount: L, attemptIndex: B, attempts: W } = Ze(
|
|
15051
15051
|
() => sx(t.id, P, R),
|
|
15052
15052
|
[t.id, P, R]
|
|
15053
15053
|
);
|
|
@@ -15121,7 +15121,7 @@ const yh = O.forwardRef(({
|
|
|
15121
15121
|
onSelectCheckpoint: L,
|
|
15122
15122
|
createSyntheticThinkingMessage: B = !0
|
|
15123
15123
|
}, W) => {
|
|
15124
|
-
const z = $e(null), N = $e(null), U = $e(!1), $ = $e(!1), [M, j] = fe(!0), k = Ze(() => w ? e.some((F) =>
|
|
15124
|
+
const z = $e(null), N = $e(null), U = $e(!1), $ = $e(!1), [M, j] = fe(!0), k = Ze(() => w ? e.some((F) => F.role === "default_message" ? !1 : Array.isArray(F == null ? void 0 : F.content) && F.content.some(
|
|
15125
15125
|
(te) => te && te.type === "interrupt" && (te.id ?? te.interrupt_id) === w.id
|
|
15126
15126
|
)) : !1, [w, e]), K = Ze(() => {
|
|
15127
15127
|
if (!w || k)
|
|
@@ -15146,16 +15146,16 @@ const yh = O.forwardRef(({
|
|
|
15146
15146
|
}
|
|
15147
15147
|
]
|
|
15148
15148
|
};
|
|
15149
|
-
}, [w, k]), G = Ze(() => K ? [...e, K] : e, [e, K]), A = Ze(() => !B || !t ? G : !G.some((te) => te.
|
|
15149
|
+
}, [w, k]), G = Ze(() => K ? [...e, K] : e, [e, K]), A = Ze(() => !B || !t ? G : !(n && G.some((te) => te.id === n)) && G.length > 0 ? [
|
|
15150
15150
|
...G,
|
|
15151
15151
|
{
|
|
15152
15152
|
id: "thinking-assistant",
|
|
15153
15153
|
role: "assistant",
|
|
15154
|
-
content: [],
|
|
15154
|
+
content: [{ type: "text", text: "" }],
|
|
15155
15155
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
15156
15156
|
__syntheticStreaming: !0
|
|
15157
15157
|
}
|
|
15158
|
-
] : G, [G, t, B]), _ = Ze(() => T ? A : A.filter((F) => (F == null ? void 0 : F.role) !== "tool"), [A, T]), q = me((F) => {
|
|
15158
|
+
] : G, [G, t, n, B]), _ = Ze(() => T ? A : A.filter((F) => (F == null ? void 0 : F.role) !== "tool"), [A, T]), q = me((F) => {
|
|
15159
15159
|
j(F), x && x(!F), b && b(F);
|
|
15160
15160
|
}, [x, b]), X = Ze(() => {
|
|
15161
15161
|
if (i)
|
|
@@ -15174,8 +15174,7 @@ const yh = O.forwardRef(({
|
|
|
15174
15174
|
const F = f.trim();
|
|
15175
15175
|
return !F || _ && _.length > 0 ? null : {
|
|
15176
15176
|
id: "default-message",
|
|
15177
|
-
role: "
|
|
15178
|
-
type: "default_message",
|
|
15177
|
+
role: "default_message",
|
|
15179
15178
|
content: F,
|
|
15180
15179
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
15181
15180
|
};
|