Commit 8ead6fd
committed
feat(sdk): route chat.agent transcript persistence through a TranscriptStorage seam
Introduces the TranscriptStorage interface (load/save over id-addressed changes: put, remove, truncateAfter, state) and makes the built-in snapshot writer its default implementation. The runtime keeps a shadow of the transcript it last saved and hands the storage the diff after every turn, failed turn and history-changing action, together with the stream cursors the next boot resumes from. The default storage reduces each changeset onto an in-memory copy and rewrites the blob as version 2, so a turn still costs one PUT and no GET, and the boot read goes through load.
The snapshot read/write helpers move to their own module so the storage can import them without a cycle; the test seams keep their import path. The mock chat agent harness now reports version 2 snapshots and accepts either version as a seed.1 parent d37c018 commit 8ead6fd
12 files changed
Lines changed: 1077 additions & 315 deletions
File tree
- apps/webapp/test
- packages/trigger-sdk
- src/v3
- test
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 1 | | |
20 | | - | |
| 2 | + | |
21 | 3 | | |
22 | 4 | | |
23 | 5 | | |
24 | | - | |
25 | 6 | | |
26 | 7 | | |
27 | 8 | | |
| |||
35 | 16 | | |
36 | 17 | | |
37 | 18 | | |
38 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
39 | 32 | | |
40 | | - | |
| 33 | + | |
41 | 34 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 35 | + | |
| 36 | + | |
54 | 37 | | |
55 | 38 | | |
56 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
265 | 264 | | |
266 | 265 | | |
267 | 266 | | |
268 | | - | |
269 | | - | |
| 267 | + | |
| 268 | + | |
270 | 269 | | |
271 | 270 | | |
272 | | - | |
273 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
274 | 285 | | |
| 286 | + | |
275 | 287 | | |
276 | 288 | | |
277 | 289 | | |
| |||
0 commit comments