@arcote.tech/arc-ai 0.7.10 → 0.7.11

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcote.tech/arc-ai",
3
3
  "type": "module",
4
- "version": "0.7.10",
4
+ "version": "0.7.11",
5
5
  "private": false,
6
6
  "description": "AI provider abstraction, completion tracking, and budget management for Arc framework",
7
7
  "main": "./src/index.ts",
@@ -10,8 +10,8 @@
10
10
  "type-check": "tsc --noEmit"
11
11
  },
12
12
  "peerDependencies": {
13
- "@arcote.tech/arc": "^0.7.10",
14
- "@arcote.tech/arc-auth": "^0.7.10",
13
+ "@arcote.tech/arc": "^0.7.11",
14
+ "@arcote.tech/arc-auth": "^0.7.11",
15
15
  "typescript": "^5.0.0"
16
16
  },
17
17
  "devDependencies": {
package/src/index.ts CHANGED
@@ -34,7 +34,7 @@ export type {
34
34
  TextBlock,
35
35
  ToolCallBlock,
36
36
  StreamChunk,
37
- StreamEventType,
37
+ StreamChunkType,
38
38
  ChatStreamEvent,
39
39
  ChatStreamEventType,
40
40
  ToolCall,
package/src/types.ts CHANGED
@@ -202,11 +202,13 @@ export interface LLMProvider {
202
202
  /**
203
203
  * SSE event types pomiędzy listenerem (serwer) a `chat-component.tsx` (klient).
204
204
  *
205
- * Każdy event niesie monotonicznie rosnące `seq` per session klient trzyma
206
- * `lastSeq` i odrzuca eventy które już zaaplikował (deduplication przy
207
- * replay buffer / SSE reconnect).
205
+ * Streamy per-messageId każda assistant wiadomość ma własny in-memory
206
+ * stream w stream-registry. Pierwszy event po `subscribe(messageId)` to
207
+ * `init` z aktualnym `currentBlocks` (snapshot stanu in-memory); następne
208
+ * eventy lecą live; turn kończy się `done`.
208
209
  */
209
210
  export type ChatStreamEventType =
211
+ | "init"
210
212
  | "text_delta"
211
213
  | "tool_call_pending"
212
214
  | "tool_call_arguments_delta"
@@ -219,12 +221,14 @@ export type ChatStreamEventType =
219
221
 
220
222
  export interface ChatStreamEvent {
221
223
  type: ChatStreamEventType;
222
- sessionId: string;
223
- /** Monotonicznie rosnący per session — klient dedupuje. */
224
- seq: number;
225
- /** ID wiadomości asystenta do której event się odnosi. */
224
+ /** ID wiadomości asystenta do której event się odnosi. Stream-registry
225
+ * wstrzykuje go automatycznie w `publish()`. */
226
226
  messageId?: string;
227
227
 
228
+ /** init — snapshot in-memory `currentBlocks` przy subscribe (graceful
229
+ * reconnect mid-stream: klient renderuje stan i kontynuuje live). */
230
+ currentBlocks?: AssistantContentBlock[];
231
+
228
232
  /** text_delta */
229
233
  textDelta?: string;
230
234
 
@@ -241,13 +245,11 @@ export interface ChatStreamEvent {
241
245
  /** interactive_tool_request — multi tools awaiting user input */
242
246
  toolCalls?: ToolCall[];
243
247
 
244
- /** usage_update */
248
+ /** usage_update / done */
245
249
  usage?: TokenUsage;
246
250
 
247
251
  /** done */
248
252
  finishReason?: FinishReason;
249
- /** done — total liczba seq w tej sesji (klient może sanity-checkować). */
250
- lastSeq?: number;
251
253
 
252
254
  /** error */
253
255
  error?: string;