@relaymessenger/chat-sdk-adapter 0.3.0-staging.3 → 0.3.0-staging.5

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/README.md CHANGED
@@ -4,8 +4,15 @@ Vendor-official Relay adapter for
4
4
  [Vercel Chat SDK](https://chat-sdk.dev), targeting `chat@4.39.0`.
5
5
 
6
6
  Source is maintained in
7
- [`RelayMessenger/Relay-SDK`](https://github.com/RelayMessenger/Relay-SDK/tree/main/packages/chat-sdk-adapter)
8
- under `packages/chat-sdk-adapter`.
7
+ [`RelayMessenger/Relay-SDK`](https://github.com/RelayMessenger/Relay-SDK/tree/9180450baf5691f8172514b7117cd92ba5879674/packages/chat-sdk-adapter)
8
+ under `packages/chat-sdk-adapter`. That link is pinned to a commit rather than
9
+ a branch, as the Chat SDK listing guide requires, so it keeps showing the tree
10
+ a listing was reviewed against. Re-pin it whenever the listing is updated.
11
+
12
+ `SOURCE.json` in this directory records where the code was imported from, not
13
+ which repository owns it. Every package in this monorepo carries the same
14
+ record, and its `canonical` field names `Relay-SDK` -- the same repository
15
+ `package.json` points at.
9
16
 
10
17
  Relay Chats map one-to-one to Chat SDK threads. Provider thread IDs are stable
11
18
  `relay:<chat UUID>` values; provider message IDs are bare Relay Message UUIDs.
@@ -63,6 +70,8 @@ interface RelayAdapterOptions {
63
70
  fetch?: typeof fetch;
64
71
  client?: RelayClient;
65
72
  signatureToleranceSeconds?: number; // default 300
73
+ markReadOnReceipt?: boolean; // default false
74
+ abortActiveTurnOnReceipt?: boolean; // default false
66
75
  idempotencyKeyResolver?: (context: {
67
76
  chatId: string;
68
77
  threadId: string;
@@ -91,6 +100,46 @@ therefore requires `idempotencyKeyResolver` for those non-empty posts rather
91
100
  than manufacturing a random key that changes on recovery. Think integrations
92
101
  should return their stable Action/delivery identity from this resolver.
93
102
 
103
+ ### Read on receipt
104
+
105
+ `markReadOnReceipt: true` stamps `POST /v1/chats/{id}/read` for an inbound
106
+ `message.received` as soon as its signature verifies, before the event reaches
107
+ Chat SDK dispatch. A read receipt states that the message arrived, not that the
108
+ answer is ready, so it must not wait behind a debounce window or a model turn.
109
+ Turn it on whenever `concurrency` defers the handler.
110
+
111
+ Only a real inbound message stamps a read. The agent's own outbound messages
112
+ and the `message.sent`, `message.delivered` and `message.read` receipts do not.
113
+ A failed read is logged and never blocks the delivery's 2xx, because holding
114
+ the response open to retry a receipt costs a redelivery of the whole event.
115
+
116
+ Group messages are read too, including ones the agent stays silent on, and
117
+ there is no flag to change that. Two reasons. Mention detection happens in Chat
118
+ SDK dispatch, which is the very thing read-on-receipt gets ahead of, so at
119
+ receipt the adapter cannot yet know whether it will answer. And it costs a
120
+ human nothing: Relay renders only Delivered in a group and never a member's
121
+ Read, so an agent's read in a group is not visible to anyone.
122
+
123
+ ### Abort on receipt
124
+
125
+ `abortActiveTurnOnReceipt: true` calls `ChatInstance.abortTurn(threadId)` when
126
+ a newer inbound message arrives, before the new event reaches dispatch. A
127
+ person who sends again while the agent is answering has changed the question,
128
+ so the running turn's `context.signal` fires and the deferring `concurrency`
129
+ strategy hands the newer message to a fresh turn.
130
+
131
+ Cancellation crosses processes: this adapter sets `supportsTurnCancellation`,
132
+ so Chat publishes the active turn to the state adapter and a turn running in
133
+ another isolate stops when it next polls. A failed abort is logged and the
134
+ newer message is still dispatched; the running turn then finishes normally,
135
+ which is the behaviour of an agent without the option.
136
+
137
+ Concurrency strategies do not change this. `burst`, `debounce` and `queue`
138
+ defer the handler, but they await it inside the webhook call that carried the
139
+ message, so the turn is still in scope and `thread.post()` gets its key. The
140
+ test suite asserts that for all three, because the day a strategy resumes a
141
+ handler out of band is the day replies would start being refused.
142
+
94
143
  ### Think runtime typing
95
144
 
96
145
  For a runtime that owns typing timing, disable Chat SDK surface typing:
@@ -112,9 +161,9 @@ normal `POST`/`DELETE /v1/chats/{chatId}/typing` support.
112
161
 
113
162
  This package was rewritten against:
114
163
 
115
- - Relay Server `ddcbccb44b9f85e8c2e3e63fead9b81d52f2bd15`
164
+ - Relay Server `4506b8cb6f41da0b39f3e23a285daf3805fcf3a3`
116
165
  - OpenAPI SHA-256
117
- `26a6bc047286e09df6ef95f3c6b09f0437260ecc94e12c5fb3ce1704910f8ba1`
166
+ `e58ffd5de05250a7a218735cb6bffd854d2d1198134f3f8876b2be109f606fde`
118
167
  - public `ChatHandle.image_url` and `ChatHandle.about` fields, with no legacy
119
168
  aliases
120
169
  - Relay API `v1`
@@ -132,12 +181,13 @@ reproducible contract tests and is excluded from the npm package.
132
181
  | `reply` | Same route with `message.reply_to` |
133
182
  | `stream` | Buffered, then one canonical Message; never partial bubbles |
134
183
  | outbound public-URL media | Message `media` part |
135
- | outbound bytes/files | Explicitly allocate/upload with `@relaymessenger/sdk`, then post a stable public HTTPS URL |
184
+ | outbound bytes/files | `POST /v1/attachments` allocate, upload, then a Message `media` part |
136
185
  | inbound media | Chat SDK `Attachment` with `fetchData()` |
137
186
  | `addReaction`, `removeReaction` | `POST /v1/messages/{messageId}/reactions` |
138
187
  | `startTyping`, `endTyping` | `POST`/`DELETE /v1/chats/{chatId}/typing` |
139
188
  | `markAsRead` | `POST /v1/chats/{chatId}/read` |
140
- | `fetchMessages({ direction: "forward" })` | `GET /v1/chats/{chatId}/messages` |
189
+ | `fetchMessages()` (backward, the default) | Forward walk to the tail over `GET /v1/chats/{chatId}/messages` |
190
+ | `fetchMessages({ direction: "forward" })` | One `GET /v1/chats/{chatId}/messages` |
141
191
  | `fetchMessage` | `GET /v1/messages/{messageId}` |
142
192
  | `fetchThread`, `fetchChannelInfo` | `GET /v1/chats/{chatId}` |
143
193
 
@@ -189,11 +239,22 @@ rules are at <https://docs.relayapp.im>.
189
239
 
190
240
  Relay text parts are plain text and are limited to 10,000 UTF-16 code units.
191
241
  Long Chat SDK text is split without breaking surrogate pairs. A Relay Message
192
- is limited to 100 parts. A public HTTPS attachment URL is sent directly.
193
- Automatic byte/file uploads are rejected because a fresh Attachment allocation
194
- would change the Message body after an ambiguous send. Allocate and upload with
195
- `@relaymessenger/sdk`, retain that prepared identity durably, then give this
196
- adapter the stable HTTPS URL.
242
+ is limited to 100 parts.
243
+
244
+ A public HTTPS attachment URL is sent by reference and costs no upload. Local
245
+ bytes -- `files`, or an `attachment` carrying `data` or `fetchData` -- are
246
+ allocated through `POST /v1/attachments`, uploaded, and then referenced by
247
+ `attachment_id`. Uploads finish before the send, so the Message body names
248
+ attachments that already exist.
249
+
250
+ One consequence is worth knowing. Inside an inbound webhook turn the send is
251
+ keyed on the event ID, so a webhook redelivery re-uploads the bytes, mints new
252
+ attachment IDs, and presents a different body under the same `Idempotency-Key`.
253
+ Relay answers HTTP 409 rather than posting the Message twice. A loud refusal on
254
+ redelivery is the safe end of that trade; a silent duplicate is not. To make a
255
+ file post survive redelivery unchanged, allocate and upload once with
256
+ `@relaymessenger/sdk`, retain that identity durably, and give this adapter the
257
+ stable HTTPS URL instead.
197
258
 
198
259
  Think's `thread.post(callback.stream())` path is safe when the stream is empty:
199
260
  the adapter returns a local no-op result so Chat SDK does not enter its
package/dist/adapter.d.ts CHANGED
@@ -4,6 +4,21 @@ import type { RelayClientOptions } from "./client.js";
4
4
  import { type RelayCredential } from "./credentials.js";
5
5
  import type { RelayRawMessage, RelayThreadId } from "./types.js";
6
6
  export declare const RELAY_ADAPTER_NAME = "relay";
7
+ /**
8
+ * Bounds on the forward walk that serves a backward `fetchMessages`. The page
9
+ * size is the contract's maximum (`contracts/relay-openapi.yaml`, `getMessages`
10
+ * `limit` maximum 100), so the walk reaches the tail in the fewest requests
11
+ * Relay allows.
12
+ */
13
+ export declare const RELAY_BACKWARD_WALK_PAGE_SIZE = 100;
14
+ export declare const RELAY_BACKWARD_WALK_MAX_PAGES = 10;
15
+ /**
16
+ * How many Chat kinds one adapter remembers for {@link RelayAdapter.isDM}.
17
+ * A Chat is created direct or group and never changes, so an entry never goes
18
+ * stale; the bound exists only so a long-lived agent cannot grow the memo
19
+ * without limit.
20
+ */
21
+ export declare const RELAY_CHAT_KIND_CACHE_LIMIT = 1000;
7
22
  export interface RelayIdempotencyKeyContext {
8
23
  chatId: string;
9
24
  parts: ReadonlyArray<import("./types.js").RelayOutgoingPart>;
@@ -33,6 +48,33 @@ export interface RelayAdapterOptions extends Omit<RelayClientOptions, "token"> {
33
48
  agentId?: string;
34
49
  /** Standard Webhooks timestamp tolerance in seconds. */
35
50
  signatureToleranceSeconds?: number;
51
+ /**
52
+ * Mark the Relay chat read as soon as an inbound message is verified,
53
+ * before the event reaches Chat SDK dispatch.
54
+ *
55
+ * A read receipt is a statement about delivery, not about the answer, so a
56
+ * debounce window, a queue or a model turn must never delay it. Turn this on
57
+ * whenever the agent uses a `concurrency` strategy that defers the handler,
58
+ * or whenever the read should land within a second of the send.
59
+ *
60
+ * Defaults to false, which leaves the read to the handler.
61
+ */
62
+ markReadOnReceipt?: boolean;
63
+ /**
64
+ * Cancel the chat's running turn when a newer inbound message arrives,
65
+ * before the new event reaches Chat SDK dispatch.
66
+ *
67
+ * A person who sends again while the agent is answering has changed the
68
+ * question. Finishing the old answer spends a model turn on a question that
69
+ * no longer stands and posts a reply to nothing. This calls
70
+ * `ChatInstance.abortTurn(threadId)`, so the running turn's `context.signal`
71
+ * fires and the deferring `concurrency` strategy hands the newer message to
72
+ * a fresh turn.
73
+ *
74
+ * Requires `supportsTurnCancellation`, which this adapter sets. Defaults to
75
+ * false, which lets the running turn finish.
76
+ */
77
+ abortActiveTurnOnReceipt?: boolean;
36
78
  /**
37
79
  * Stable key source for posts made outside an inbound webhook turn.
38
80
  * Inbound turns always derive keys from event_id plus send ordinal.
@@ -50,21 +92,45 @@ export declare class RelayAdapter implements Adapter<RelayThreadId, RelayRawMess
50
92
  readonly botUserId?: string;
51
93
  readonly lockScope: "thread";
52
94
  readonly persistThreadHistory = false;
95
+ /**
96
+ * Publish active turns so `ChatInstance.abortTurn(threadId)` cancels work
97
+ * running in another process that shares the configured state adapter. A
98
+ * Relay send is one idempotent HTTP request, so an aborted turn leaves no
99
+ * partial bubble to reconcile.
100
+ */
101
+ readonly supportsTurnCancellation = true;
53
102
  readonly typing: boolean;
54
103
  readonly client: RelayClient;
104
+ private readonly abortActiveTurnOnReceipt;
105
+ private readonly markReadOnReceipt;
55
106
  private readonly signatureToleranceSeconds?;
56
107
  private readonly webhookSecret;
57
108
  private readonly idempotencyKeyResolver;
58
109
  private readonly turns;
59
110
  /**
60
- * Request-scoped Chat kind hints. Entries exist only while an inbound
61
- * dispatch is active; this is not persistence or a delivery-idempotency
62
- * store.
111
+ * Chat UUID to `is_group`, as Relay reported it.
112
+ *
113
+ * `isDM` must answer synchronously, and Relay's stable thread ID carries
114
+ * only the Chat UUID by design, so the answer has to come from somewhere
115
+ * the adapter already learned it. Every path that reads a Chat from Relay
116
+ * records the flag here: inbound webhook dispatch, `fetchThread`, and
117
+ * `onThreadSubscribe`.
118
+ *
119
+ * This is a memo of an immutable Relay fact — a Chat is created direct or
120
+ * group and never changes — not a delivery record and not persistence. It
121
+ * is bounded so a long-lived agent in many chats cannot grow it without
122
+ * limit.
63
123
  */
64
- private readonly activeChatKinds;
124
+ private readonly chatIsGroup;
65
125
  private chat?;
66
126
  constructor(options?: RelayAdapterOptions);
67
127
  initialize(chat: ChatInstance): Promise<void>;
128
+ /**
129
+ * Report a non-fatal condition through Chat's logger once initialized, and
130
+ * through the console before that, so a warning is never lost to whichever
131
+ * side of `initialize` it happens on.
132
+ */
133
+ private warn;
68
134
  encodeThreadId(data: RelayThreadId): string;
69
135
  decodeThreadId(threadId: string): RelayThreadId;
70
136
  channelIdFromThreadId(threadId: string): string;
@@ -111,13 +177,29 @@ export declare class RelayAdapter implements Adapter<RelayThreadId, RelayRawMess
111
177
  private resolveExternalIdempotencyKey;
112
178
  private noopResult;
113
179
  private isMentioned;
114
- private enterChatKind;
115
180
  /**
116
- * Chat SDK asks synchronously while dispatching. Relay's stable thread ID
117
- * intentionally contains only the Chat UUID, so the direct/group hint is
118
- * scoped to the active webhook dispatch and never persisted.
181
+ * Record what Relay said about a Chat's kind. Re-recording a known chat
182
+ * refreshes its position so the bound evicts the least recently learned.
183
+ */
184
+ private rememberChatKind;
185
+ /**
186
+ * Whether a thread is a direct conversation rather than a group.
187
+ *
188
+ * Chat SDK asks synchronously, and Relay's stable thread ID carries only
189
+ * the Chat UUID, so this answers from what the adapter has already learned:
190
+ * an inbound webhook dispatch, a `fetchThread`, or `onThreadSubscribe`.
191
+ *
192
+ * A chat this adapter has never seen answers `false` and says so on the
193
+ * debug log. `false` is the safe direction — it is the group answer, so a
194
+ * handler gates on mentions rather than replying to everything — and
195
+ * `fetchThread(threadId)` settles the question for good.
119
196
  */
120
197
  isDM(threadId: string): boolean;
198
+ /**
199
+ * Learn a thread's kind when Chat SDK subscribes to it, so `isDM` answers
200
+ * correctly from the first handler call rather than after the first fetch.
201
+ */
202
+ onThreadSubscribe(threadId: string): Promise<void>;
121
203
  postMessage(threadId: string, message: AdapterPostableMessage): Promise<RawMessage<RelayRawMessage>>;
122
204
  postChannelMessage(channelId: string, message: AdapterPostableMessage): Promise<RawMessage<RelayRawMessage>>;
123
205
  reply(threadId: string, messageId: string, message: AdapterPostableMessage): Promise<RawMessage<RelayRawMessage>>;
@@ -129,9 +211,37 @@ export declare class RelayAdapter implements Adapter<RelayThreadId, RelayRawMess
129
211
  endTyping(threadId: string): Promise<void>;
130
212
  markAsRead(threadId: string, messageId: string): Promise<void>;
131
213
  /**
132
- * Relay's public chat cursor advances oldest-to-newest. Chat SDK's backward
133
- * cursor contract cannot be represented, so only explicit forward reads are
134
- * supported rather than faking backward pagination.
214
+ * Fetch messages from a Relay chat.
215
+ *
216
+ * `forward` is Relay's native shape: one `GET /v1/chats/{id}/messages` per
217
+ * call, and `nextCursor` is Relay's own cursor pointing at newer messages.
218
+ *
219
+ * `backward` — the Chat SDK default, and what `thread.fetchMessages()` asks
220
+ * for when loading a chat view — has no native Relay equivalent, because
221
+ * the public contract publishes exactly one opaque cursor and it advances
222
+ * oldest-to-newest. It is served by walking forward to the tail and keeping
223
+ * the newest `limit` messages seen.
224
+ *
225
+ * **The cost is real and worth knowing before you call it.** One backward
226
+ * call issues up to {@link RELAY_BACKWARD_WALK_MAX_PAGES} requests of
227
+ * {@link RELAY_BACKWARD_WALK_PAGE_SIZE} messages each — up to 10 round
228
+ * trips covering 1000 messages — rather than the single request `forward`
229
+ * costs. Chats shorter than one page cost exactly one request, which is the
230
+ * common case.
231
+ *
232
+ * If the walk reaches the end of the chat, the result is exactly the most
233
+ * recent `limit` messages and there is no `nextCursor`: Relay cannot
234
+ * address older messages, so there is no further backward page to offer.
235
+ *
236
+ * If the walk is cut short by the page cap, the messages are the newest the
237
+ * bounded walk could reach and `nextCursor` carries Relay's live forward
238
+ * cursor. Passing it back as `cursor` resumes the walk from that point
239
+ * rather than moving to older messages, so repeated calls converge on the
240
+ * true tail. That is the opposite of the generic backward contract, and it
241
+ * is the only meaning Relay's single forward cursor can carry.
242
+ *
243
+ * Messages are returned oldest-first within the page in every direction, as
244
+ * the interface requires.
135
245
  */
136
246
  fetchMessages(threadId: string, options?: FetchOptions): Promise<FetchResult<RelayRawMessage>>;
137
247
  fetchChannelMessages(channelId: string, options?: FetchOptions): Promise<FetchResult<RelayRawMessage>>;
@@ -149,6 +259,23 @@ export declare class RelayAdapter implements Adapter<RelayThreadId, RelayRawMess
149
259
  openDM(_userId: string): Promise<string>;
150
260
  stream(threadId: string, stream: AsyncIterable<string | StreamChunk>): Promise<RawMessage<RelayRawMessage> | null>;
151
261
  handleWebhook(request: Request, options?: WebhookOptions): Promise<Response>;
262
+ /**
263
+ * Stamp the Relay read receipt for one inbound chat.
264
+ *
265
+ * A failed read never blocks the webhook's 2xx. Holding the response open
266
+ * for it would make Relay time the delivery out and redeliver, which costs
267
+ * the agent a retry to buy a receipt that Relay will re-request anyway.
268
+ */
269
+ private readOnReceipt;
270
+ /**
271
+ * Cancel the chat's running turn, if there is one.
272
+ *
273
+ * `abortTurn` is a no-op when nothing is active, so a burst's first message
274
+ * costs one state read. A failure is logged and never blocks the delivery:
275
+ * the worst case is that the superseded turn finishes and posts, which is
276
+ * the behaviour of an agent without this option.
277
+ */
278
+ private abortOnReceipt;
152
279
  private initializedChat;
153
280
  private dispatch;
154
281
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAMP,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,MAAM,CAAC;AACd,OAAO,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAoB1B,OAAO,KAAK,EAIV,eAAe,EAEf,aAAa,EAGd,MAAM,YAAY,CAAC;AAcpB,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC,OAAO,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,0BAA0B,KAChC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9B,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACzC;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAA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