@kortyx/react 0.0.1 → 0.2.1
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/CHANGELOG.md +20 -0
- package/dist/index.d.ts +126 -126
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @kortyx/react
|
|
2
2
|
|
|
3
|
+
## [0.2.1](https://github.com/kortyx-io/kortyx/compare/react-v0.2.0...react-v0.2.1) (2026-05-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update vulnerable dependency versions ([274bc41](https://github.com/kortyx-io/kortyx/commit/274bc410fe04d53da9db941ef8d62407dadd4c54))
|
|
9
|
+
|
|
10
|
+
## [0.2.0](https://github.com/kortyx-io/kortyx/compare/react-v0.1.0...react-v0.2.0) (2026-04-23)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **react:** add assistant message builder ([56a8878](https://github.com/kortyx-io/kortyx/commit/56a88785961526293ad79ca9e6154385a09b3f66))
|
|
16
|
+
* **react:** add chat stream debug hook ([0117fa1](https://github.com/kortyx-io/kortyx/commit/0117fa13e630aff5fc658b8802eaddc312005730))
|
|
17
|
+
* **react:** add chat transport and browser storage helpers ([fb7a37a](https://github.com/kortyx-io/kortyx/commit/fb7a37a85a9c19f0342ccbb527ecf132eb4f74c8))
|
|
18
|
+
* **react:** add chat types and interrupt mapping helpers ([7da61dd](https://github.com/kortyx-io/kortyx/commit/7da61dd81ba6276162ee8580a9342b32da7e70d6))
|
|
19
|
+
* **react:** add live chat pieces helper ([1052969](https://github.com/kortyx-io/kortyx/commit/10529698f92c26b2e673f6477707f0ca918047e4))
|
|
20
|
+
* **react:** add structured stream hooks package ([5c2abd2](https://github.com/kortyx-io/kortyx/commit/5c2abd227f0def674ad099fffe2f7e8b3afbee42))
|
|
21
|
+
* **react:** add useChat hook ([4a277b1](https://github.com/kortyx-io/kortyx/commit/4a277b1b806b9d5e4781f3dc9c90b16e928cc76d))
|
|
22
|
+
|
|
3
23
|
## 0.1.0
|
|
4
24
|
|
|
5
25
|
### Features
|
package/dist/index.d.ts
CHANGED
|
@@ -181,253 +181,253 @@ declare function useChat(options: UseChatOptions): UseChatValue;
|
|
|
181
181
|
|
|
182
182
|
declare function useChatStreamDebug(): {
|
|
183
183
|
streamDebug: ({
|
|
184
|
-
type
|
|
185
|
-
sessionId
|
|
184
|
+
type: "session";
|
|
185
|
+
sessionId: string;
|
|
186
186
|
} | {
|
|
187
|
-
type
|
|
188
|
-
message
|
|
187
|
+
type: "status";
|
|
188
|
+
message: string;
|
|
189
189
|
node?: string;
|
|
190
190
|
} | {
|
|
191
|
-
type
|
|
191
|
+
type: "message";
|
|
192
|
+
content: string;
|
|
192
193
|
node?: string;
|
|
193
|
-
content?: string;
|
|
194
194
|
} | {
|
|
195
|
-
type
|
|
196
|
-
id?: string;
|
|
195
|
+
type: "text-start";
|
|
197
196
|
node?: string;
|
|
197
|
+
id?: string;
|
|
198
198
|
opId?: string;
|
|
199
199
|
segmentId?: string;
|
|
200
200
|
} | {
|
|
201
|
-
type
|
|
202
|
-
|
|
201
|
+
type: "text-delta";
|
|
202
|
+
delta: string;
|
|
203
203
|
node?: string;
|
|
204
|
-
|
|
204
|
+
id?: string;
|
|
205
205
|
opId?: string;
|
|
206
206
|
segmentId?: string;
|
|
207
207
|
} | {
|
|
208
|
-
type
|
|
209
|
-
id?: string;
|
|
208
|
+
type: "text-end";
|
|
210
209
|
node?: string;
|
|
210
|
+
id?: string;
|
|
211
211
|
opId?: string;
|
|
212
212
|
segmentId?: string;
|
|
213
213
|
} | {
|
|
214
|
-
type
|
|
215
|
-
|
|
216
|
-
content?: unknown;
|
|
214
|
+
type: "tool-result";
|
|
215
|
+
content: unknown;
|
|
217
216
|
tool?: string;
|
|
217
|
+
node?: string;
|
|
218
218
|
} | {
|
|
219
|
-
type
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
type: "interrupt";
|
|
220
|
+
requestId: string;
|
|
221
|
+
resumeToken: string;
|
|
222
|
+
workflow?: string;
|
|
223
223
|
node?: string;
|
|
224
|
+
id?: string;
|
|
224
225
|
opId?: string;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
workflow?: string;
|
|
226
|
+
schemaId?: string;
|
|
227
|
+
schemaVersion?: string;
|
|
228
228
|
input?: {
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
kind: "text";
|
|
230
|
+
multiple: boolean;
|
|
231
|
+
question?: string;
|
|
232
|
+
id?: string;
|
|
231
233
|
schemaId?: string;
|
|
232
234
|
schemaVersion?: string;
|
|
233
|
-
id?: string;
|
|
234
|
-
multiple?: boolean;
|
|
235
|
-
question?: string;
|
|
236
235
|
meta?: Record<string, unknown>;
|
|
236
|
+
options?: never[];
|
|
237
237
|
} | {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
kind: "choice" | "multi-choice";
|
|
239
|
+
multiple: boolean;
|
|
240
|
+
question: string;
|
|
241
|
+
options: {
|
|
242
|
+
id: string;
|
|
243
|
+
label: string;
|
|
241
244
|
description?: string;
|
|
242
245
|
}[];
|
|
243
|
-
|
|
246
|
+
id?: string;
|
|
244
247
|
schemaId?: string;
|
|
245
248
|
schemaVersion?: string;
|
|
246
|
-
id?: string;
|
|
247
|
-
multiple?: boolean;
|
|
248
|
-
question?: string;
|
|
249
249
|
meta?: Record<string, unknown>;
|
|
250
250
|
};
|
|
251
251
|
meta?: Record<string, unknown>;
|
|
252
252
|
} | {
|
|
253
|
-
type
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
type: "structured-data";
|
|
254
|
+
streamId: string;
|
|
255
|
+
dataType: string;
|
|
256
|
+
kind: "set";
|
|
257
|
+
path: string;
|
|
258
|
+
value: unknown;
|
|
259
259
|
schemaId?: string;
|
|
260
260
|
schemaVersion?: string;
|
|
261
261
|
id?: string;
|
|
262
262
|
node?: string;
|
|
263
263
|
} | {
|
|
264
|
-
type
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
type: "structured-data";
|
|
265
|
+
streamId: string;
|
|
266
|
+
dataType: string;
|
|
267
|
+
kind: "append";
|
|
268
|
+
path: string;
|
|
269
|
+
items: unknown[];
|
|
269
270
|
schemaId?: string;
|
|
270
271
|
schemaVersion?: string;
|
|
271
272
|
id?: string;
|
|
272
273
|
node?: string;
|
|
273
|
-
items?: unknown[];
|
|
274
274
|
} | {
|
|
275
|
-
type
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
275
|
+
type: "structured-data";
|
|
276
|
+
streamId: string;
|
|
277
|
+
dataType: string;
|
|
278
|
+
kind: "text-delta";
|
|
279
|
+
path: string;
|
|
280
|
+
delta: string;
|
|
280
281
|
schemaId?: string;
|
|
281
282
|
schemaVersion?: string;
|
|
282
283
|
id?: string;
|
|
283
284
|
node?: string;
|
|
284
|
-
delta?: string;
|
|
285
285
|
} | {
|
|
286
|
-
type
|
|
287
|
-
streamId
|
|
288
|
-
dataType
|
|
289
|
-
kind
|
|
286
|
+
type: "structured-data";
|
|
287
|
+
streamId: string;
|
|
288
|
+
dataType: string;
|
|
289
|
+
kind: "final";
|
|
290
|
+
data: unknown;
|
|
290
291
|
schemaId?: string;
|
|
291
292
|
schemaVersion?: string;
|
|
292
293
|
id?: string;
|
|
293
294
|
node?: string;
|
|
294
|
-
data?: unknown;
|
|
295
295
|
} | {
|
|
296
|
-
type
|
|
297
|
-
transitionTo
|
|
296
|
+
type: "transition";
|
|
297
|
+
transitionTo: string;
|
|
298
298
|
payload?: any;
|
|
299
299
|
} | {
|
|
300
|
-
type
|
|
300
|
+
type: "done";
|
|
301
301
|
data?: any;
|
|
302
302
|
} | {
|
|
303
|
-
type
|
|
304
|
-
message
|
|
303
|
+
type: "error";
|
|
304
|
+
message: string;
|
|
305
305
|
})[];
|
|
306
306
|
clearStreamDebug: () => void;
|
|
307
307
|
createRecorder: (initialMessage: string) => {
|
|
308
308
|
push: (chunk: StreamChunk) => void;
|
|
309
309
|
getAll: () => ({
|
|
310
|
-
type
|
|
311
|
-
sessionId
|
|
310
|
+
type: "session";
|
|
311
|
+
sessionId: string;
|
|
312
312
|
} | {
|
|
313
|
-
type
|
|
314
|
-
message
|
|
313
|
+
type: "status";
|
|
314
|
+
message: string;
|
|
315
315
|
node?: string;
|
|
316
316
|
} | {
|
|
317
|
-
type
|
|
317
|
+
type: "message";
|
|
318
|
+
content: string;
|
|
318
319
|
node?: string;
|
|
319
|
-
content?: string;
|
|
320
320
|
} | {
|
|
321
|
-
type
|
|
322
|
-
id?: string;
|
|
321
|
+
type: "text-start";
|
|
323
322
|
node?: string;
|
|
323
|
+
id?: string;
|
|
324
324
|
opId?: string;
|
|
325
325
|
segmentId?: string;
|
|
326
326
|
} | {
|
|
327
|
-
type
|
|
328
|
-
|
|
327
|
+
type: "text-delta";
|
|
328
|
+
delta: string;
|
|
329
329
|
node?: string;
|
|
330
|
-
|
|
330
|
+
id?: string;
|
|
331
331
|
opId?: string;
|
|
332
332
|
segmentId?: string;
|
|
333
333
|
} | {
|
|
334
|
-
type
|
|
335
|
-
id?: string;
|
|
334
|
+
type: "text-end";
|
|
336
335
|
node?: string;
|
|
336
|
+
id?: string;
|
|
337
337
|
opId?: string;
|
|
338
338
|
segmentId?: string;
|
|
339
339
|
} | {
|
|
340
|
-
type
|
|
341
|
-
|
|
342
|
-
content?: unknown;
|
|
340
|
+
type: "tool-result";
|
|
341
|
+
content: unknown;
|
|
343
342
|
tool?: string;
|
|
343
|
+
node?: string;
|
|
344
344
|
} | {
|
|
345
|
-
type
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
type: "interrupt";
|
|
346
|
+
requestId: string;
|
|
347
|
+
resumeToken: string;
|
|
348
|
+
workflow?: string;
|
|
349
349
|
node?: string;
|
|
350
|
+
id?: string;
|
|
350
351
|
opId?: string;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
workflow?: string;
|
|
352
|
+
schemaId?: string;
|
|
353
|
+
schemaVersion?: string;
|
|
354
354
|
input?: {
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
kind: "text";
|
|
356
|
+
multiple: boolean;
|
|
357
|
+
question?: string;
|
|
358
|
+
id?: string;
|
|
357
359
|
schemaId?: string;
|
|
358
360
|
schemaVersion?: string;
|
|
359
|
-
id?: string;
|
|
360
|
-
multiple?: boolean;
|
|
361
|
-
question?: string;
|
|
362
361
|
meta?: Record<string, unknown>;
|
|
362
|
+
options?: never[];
|
|
363
363
|
} | {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
kind: "choice" | "multi-choice";
|
|
365
|
+
multiple: boolean;
|
|
366
|
+
question: string;
|
|
367
|
+
options: {
|
|
368
|
+
id: string;
|
|
369
|
+
label: string;
|
|
367
370
|
description?: string;
|
|
368
371
|
}[];
|
|
369
|
-
|
|
372
|
+
id?: string;
|
|
370
373
|
schemaId?: string;
|
|
371
374
|
schemaVersion?: string;
|
|
372
|
-
id?: string;
|
|
373
|
-
multiple?: boolean;
|
|
374
|
-
question?: string;
|
|
375
375
|
meta?: Record<string, unknown>;
|
|
376
376
|
};
|
|
377
377
|
meta?: Record<string, unknown>;
|
|
378
378
|
} | {
|
|
379
|
-
type
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
379
|
+
type: "structured-data";
|
|
380
|
+
streamId: string;
|
|
381
|
+
dataType: string;
|
|
382
|
+
kind: "set";
|
|
383
|
+
path: string;
|
|
384
|
+
value: unknown;
|
|
385
385
|
schemaId?: string;
|
|
386
386
|
schemaVersion?: string;
|
|
387
387
|
id?: string;
|
|
388
388
|
node?: string;
|
|
389
389
|
} | {
|
|
390
|
-
type
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
390
|
+
type: "structured-data";
|
|
391
|
+
streamId: string;
|
|
392
|
+
dataType: string;
|
|
393
|
+
kind: "append";
|
|
394
|
+
path: string;
|
|
395
|
+
items: unknown[];
|
|
395
396
|
schemaId?: string;
|
|
396
397
|
schemaVersion?: string;
|
|
397
398
|
id?: string;
|
|
398
399
|
node?: string;
|
|
399
|
-
items?: unknown[];
|
|
400
400
|
} | {
|
|
401
|
-
type
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
401
|
+
type: "structured-data";
|
|
402
|
+
streamId: string;
|
|
403
|
+
dataType: string;
|
|
404
|
+
kind: "text-delta";
|
|
405
|
+
path: string;
|
|
406
|
+
delta: string;
|
|
406
407
|
schemaId?: string;
|
|
407
408
|
schemaVersion?: string;
|
|
408
409
|
id?: string;
|
|
409
410
|
node?: string;
|
|
410
|
-
delta?: string;
|
|
411
411
|
} | {
|
|
412
|
-
type
|
|
413
|
-
streamId
|
|
414
|
-
dataType
|
|
415
|
-
kind
|
|
412
|
+
type: "structured-data";
|
|
413
|
+
streamId: string;
|
|
414
|
+
dataType: string;
|
|
415
|
+
kind: "final";
|
|
416
|
+
data: unknown;
|
|
416
417
|
schemaId?: string;
|
|
417
418
|
schemaVersion?: string;
|
|
418
419
|
id?: string;
|
|
419
420
|
node?: string;
|
|
420
|
-
data?: unknown;
|
|
421
421
|
} | {
|
|
422
|
-
type
|
|
423
|
-
transitionTo
|
|
422
|
+
type: "transition";
|
|
423
|
+
transitionTo: string;
|
|
424
424
|
payload?: any;
|
|
425
425
|
} | {
|
|
426
|
-
type
|
|
426
|
+
type: "done";
|
|
427
427
|
data?: any;
|
|
428
428
|
} | {
|
|
429
|
-
type
|
|
430
|
-
message
|
|
429
|
+
type: "error";
|
|
430
|
+
message: string;
|
|
431
431
|
})[];
|
|
432
432
|
};
|
|
433
433
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortyx/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "React hooks for Kortyx client streaming experiences.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@testing-library/react": "^16.3.0",
|
|
42
42
|
"@types/react": "^19",
|
|
43
|
-
"jsdom": "^
|
|
43
|
+
"jsdom": "^29.1.1",
|
|
44
44
|
"react": "19.2.1",
|
|
45
45
|
"react-dom": "19.2.1",
|
|
46
|
-
"turbo": "
|
|
46
|
+
"turbo": "2.6.1",
|
|
47
47
|
"tsup": "^8.5.1",
|
|
48
|
-
"typescript": "5.
|
|
49
|
-
"vitest": "^
|
|
48
|
+
"typescript": "5.9.3",
|
|
49
|
+
"vitest": "^4.1.5"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"repository": {
|