Commit 4c3a039
committed
feat(sdk,core): drop legacy chat stream-ID constants
Final Phase F cleanup — `CHAT_STREAM_KEY`, `CHAT_MESSAGES_STREAM_ID`,
and `CHAT_STOP_STREAM_ID` were meaningful only when chat.agent I/O
lived on run-scoped Redis streams. The Session migration moved all
chat I/O onto the backing Session's `.in` / `.out` channels, so these
constants stopped describing how anything is addressed months ago and
have been dead-weight re-exports since.
Dropped from the public surface:
- `@trigger.dev/core/v3/chat-client` no longer exports the three
constants. The file keeps `ChatStoreChunk` + `applyChatStorePatch`
(the chat.store primitive's shared types).
- `@trigger.dev/sdk/ai` no longer re-exports them via the
`CHAT_STREAM_KEY` / `CHAT_MESSAGES_STREAM_ID` / `CHAT_STOP_STREAM_ID`
aliases introduced by the migration commit.
- Deletes `packages/trigger-sdk/src/v3/chat-constants.ts` (the shim
that bridged core's definitions to the SDK's public surface).
What stayed the same:
- `chat.stream.id` / `chat.messages.id` / `chat.stopSignal.id` still
contain the literal strings `"chat"` / `"chat-messages"` /
`"chat-stop"` — inlined as opaque breadcrumbs rather than
user-consumable constants. Telemetry attrs keep the same values,
so dashboards/spans don't shift.
- All runtime behavior is untouched. The `chatStream` / `messagesInput` /
`stopInput` facades still delegate through the Session handle
exactly as before; only the constant symbols are gone.
Migration note for external callers:
Anyone still importing the old constants should migrate to the
session primitives:
- `streams.writer(CHAT_STREAM_KEY, …)` → `sessions.open(sessionId).out.writer(…)`
- `streams.input(CHAT_MESSAGES_STREAM_ID)` → `sessions.open(sessionId).in.on(…)`
(filtered by `chunk.kind === "message"`)
- `streams.input(CHAT_STOP_STREAM_ID)` → `sessions.open(sessionId).in.on(…)`
(filtered by `chunk.kind === "stop"`)
Validated
- 86/86 SDK tests green.
- Webapp typecheck clean (core types used in SpanPresenter + AgentView
are untouched).
- ai-chat UI smoke passes end-to-end: new chat → send "Say hi in
three words." → first assistant text in 4.9s → sessionId + runId +
lastEventId all set.1 parent 88c8f4d commit 4c3a039
5 files changed
Lines changed: 35 additions & 56 deletions
File tree
- .changeset
- packages
- core/src/v3
- trigger-sdk/src/v3
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 10 | | |
16 | 11 | | |
17 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 99 | | |
105 | 100 | | |
106 | 101 | | |
| |||
145 | 140 | | |
146 | 141 | | |
147 | 142 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 143 | + | |
| 144 | + | |
151 | 145 | | |
152 | 146 | | |
153 | 147 | | |
| |||
500 | 494 | | |
501 | 495 | | |
502 | 496 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | 497 | | |
514 | 498 | | |
515 | 499 | | |
| |||
533 | 517 | | |
534 | 518 | | |
535 | 519 | | |
536 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
537 | 526 | | |
538 | 527 | | |
539 | 528 | | |
| |||
966 | 955 | | |
967 | 956 | | |
968 | 957 | | |
969 | | - | |
| 958 | + | |
970 | 959 | | |
971 | 960 | | |
972 | 961 | | |
| |||
1003 | 992 | | |
1004 | 993 | | |
1005 | 994 | | |
1006 | | - | |
| 995 | + | |
1007 | 996 | | |
1008 | 997 | | |
1009 | | - | |
| 998 | + | |
1010 | 999 | | |
1011 | | - | |
| 1000 | + | |
1012 | 1001 | | |
1013 | 1002 | | |
1014 | 1003 | | |
| |||
1067 | 1056 | | |
1068 | 1057 | | |
1069 | 1058 | | |
1070 | | - | |
| 1059 | + | |
1071 | 1060 | | |
1072 | 1061 | | |
1073 | 1062 | | |
| |||
1105 | 1094 | | |
1106 | 1095 | | |
1107 | 1096 | | |
1108 | | - | |
| 1097 | + | |
1109 | 1098 | | |
1110 | 1099 | | |
1111 | | - | |
| 1100 | + | |
1112 | 1101 | | |
1113 | | - | |
| 1102 | + | |
1114 | 1103 | | |
1115 | 1104 | | |
1116 | 1105 | | |
| |||
3686 | 3675 | | |
3687 | 3676 | | |
3688 | 3677 | | |
3689 | | - | |
3690 | | - | |
| 3678 | + | |
| 3679 | + | |
3691 | 3680 | | |
3692 | 3681 | | |
3693 | 3682 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
| |||
0 commit comments