@arcote.tech/arc-ai 0.7.9 → 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 +3 -3
- package/src/index.ts +1 -1
- package/src/types.ts +12 -10
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.
|
|
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.
|
|
14
|
-
"@arcote.tech/arc-auth": "^0.7.
|
|
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
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
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
205
|
+
* Streamy są 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
|
-
|
|
223
|
-
|
|
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;
|