teodor-new-chat-ui 4.3.436 → 4.3.438

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.
@@ -52,7 +52,7 @@ export interface ThreadStateContextValue {
52
52
  namespace: string | null;
53
53
  };
54
54
  checkpoints: HydratedCheckpointSnapshot[];
55
- metadata: ThreadStateMetadata | null;
55
+ metadata: ThreadStateMetadata;
56
56
  isLoading: boolean;
57
57
  isHistoryLoading: boolean;
58
58
  error: string | null;
@@ -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: Role;
80
+ role: "default_message";
82
81
  content: string;
83
82
  createdAt?: string;
84
83
  }
@@ -38,7 +38,7 @@ export interface ThreadStateContextValue {
38
38
  checkpoints: HydratedCheckpointSnapshot[];
39
39
  checkpointIndex: CheckpointIndex;
40
40
  timelineCheckpoints: TimelineCheckpoint[];
41
- metadata: ThreadStateMetadata | null;
41
+ metadata: ThreadStateMetadata;
42
42
  isLoading: boolean;
43
43
  isHistoryLoading: boolean;
44
44
  isLoadingCheckpoint: boolean;
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 ("type" in e && e.type === "default_message")
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) {
@@ -4382,10 +4382,7 @@ function Iw({
4382
4382
  ), K = me(
4383
4383
  (q) => j(() => q),
4384
4384
  []
4385
- ), G = Ze(() => {
4386
- const q = c.assemblingId ?? null;
4387
- return q ? { assemblingMessageId: q } : null;
4388
- }, [c.assemblingId]), A = Ze(
4385
+ ), G = Ze(() => ({ assemblingMessageId: c.assemblingId ?? null }), [c.assemblingId]), A = Ze(
4389
4386
  () => ({
4390
4387
  threadId: l,
4391
4388
  messages: c.messages,
@@ -14588,7 +14585,7 @@ const Pl = Pg(function({
14588
14585
  onSelectCheckpoint: E,
14589
14586
  attemptMetas: R = []
14590
14587
  }) {
14591
- 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(() => "type" in t && t.type === "default_message" ? t : null, [t]), G = !!K, A = !(r && j !== "user"), {
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"), {
14592
14589
  uploadingFiles: _,
14593
14590
  handleFileClick: q,
14594
14591
  fileViewerOpen: X,
@@ -15050,7 +15047,7 @@ const xE = {
15050
15047
  checkpointIndex: w,
15051
15048
  onSelectCheckpoint: y
15052
15049
  }) {
15053
- const C = wh(t, n), S = "type" in t && t.type === "default_message", E = !!t.__syntheticStreaming, R = w ?? xE, P = !S && "checkpointId" in t ? t.checkpointId ?? null : null, { attemptCount: L, attemptIndex: B, attempts: W } = Ze(
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(
15054
15051
  () => sx(t.id, P, R),
15055
15052
  [t.id, P, R]
15056
15053
  );
@@ -15124,7 +15121,7 @@ const yh = O.forwardRef(({
15124
15121
  onSelectCheckpoint: L,
15125
15122
  createSyntheticThinkingMessage: B = !0
15126
15123
  }, W) => {
15127
- const z = $e(null), N = $e(null), U = $e(!1), $ = $e(!1), [M, j] = fe(!0), k = Ze(() => w ? e.some((F) => "type" in F && F.type === "default_message" ? !1 : Array.isArray(F == null ? void 0 : F.content) && F.content.some(
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(
15128
15125
  (te) => te && te.type === "interrupt" && (te.id ?? te.interrupt_id) === w.id
15129
15126
  )) : !1, [w, e]), K = Ze(() => {
15130
15127
  if (!w || k)
@@ -15177,8 +15174,7 @@ const yh = O.forwardRef(({
15177
15174
  const F = f.trim();
15178
15175
  return !F || _ && _.length > 0 ? null : {
15179
15176
  id: "default-message",
15180
- role: "assistant",
15181
- type: "default_message",
15177
+ role: "default_message",
15182
15178
  content: F,
15183
15179
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
15184
15180
  };