@teodorruskvi/chat-core 0.1.34 → 0.1.35

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,5 +1,7 @@
1
1
  import type { ChatMessage, PendingInterrupt, StreamEvent } from "@/types";
2
+ export type ChatStatus = 'idle' | 'loading' | 'streaming' | 'awaiting_input' | 'error';
2
3
  export interface MessagesState {
4
+ status: ChatStatus;
3
5
  messages: ChatMessage[];
4
6
  taskMessagesByScope: Record<string, ChatMessage[]>;
5
7
  assemblingId: string | null;
@@ -11,6 +13,7 @@ export interface MessagesState {
11
13
  lastText?: string;
12
14
  }>;
13
15
  values: Record<string, unknown>;
16
+ error: string | null;
14
17
  }
15
18
  export type MessagesAction = {
16
19
  type: "reset";
@@ -26,6 +29,12 @@ export type MessagesAction = {
26
29
  pendingInterrupt?: PendingInterrupt;
27
30
  values?: Record<string, unknown>;
28
31
  };
32
+ } | {
33
+ type: "status";
34
+ payload: {
35
+ status: ChatStatus;
36
+ error?: string | null;
37
+ };
29
38
  } | {
30
39
  type: "prepend";
31
40
  payload: {
@@ -89,13 +89,14 @@ export type ToolEndEvent = {
89
89
  tool?: string;
90
90
  seq?: number;
91
91
  additionalKwargs?: Record<string, unknown>;
92
+ status?: "completed" | "failed";
92
93
  } & ToolEventIdentity;
93
94
  export type ToolProgressEvent = {
94
95
  type: "tool.progress";
95
96
  content?: string;
96
97
  id?: string;
97
98
  callId?: string;
98
- status?: string;
99
+ status?: "running" | "completed" | "failed" | string;
99
100
  step?: string;
100
101
  metadata?: Record<string, unknown>;
101
102
  idx?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teodorruskvi/chat-core",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "Core chat protocols, hooks, and utilities (UI-agnostic)",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
@@ -1,11 +0,0 @@
1
- import type { TimelineCheckpoint } from "../types";
2
- type ParentCheckpointInfo = {
3
- checkpointId: string;
4
- checkpointNs: string | null;
5
- };
6
- /**
7
- * Given the timeline checkpoints for a thread, find the parent checkpoint that the
8
- * backend should branch from when editing the provided message id.
9
- */
10
- export declare function findParentCheckpointForEdit(timeline: TimelineCheckpoint[], messageId: string): ParentCheckpointInfo;
11
- export {};