@fabric-harness/channels 0.27.0 → 0.28.0

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/dist/twilio.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Channel, ToolDef } from '@fabric-harness/sdk/channel';
1
+ import type { Channel, ChannelDispatchRequest, ConversationOwnershipStore, ToolDef } from '@fabric-harness/sdk/channel';
2
2
  export interface TwilioConversationRef {
3
3
  accountSid: string;
4
4
  from: string;
@@ -14,26 +14,122 @@ export interface TwilioMessagePayload {
14
14
  MessageStatus?: string;
15
15
  ErrorCode?: string;
16
16
  }
17
- export interface TwilioChannelOptions {
17
+ export interface TwilioChannelOptions extends TwilioDeliveryStatusOptions {
18
18
  accountSid: string;
19
19
  authToken: string;
20
20
  agent: string;
21
21
  /** Public webhook URL configured in Twilio. Required when a proxy rewrites the request URL. */
22
22
  webhookUrl?: string;
23
23
  tenantId?: string;
24
+ /**
25
+ * What reaches the agent for each carrier compliance keyword class (see
26
+ * `classifyTwilioKeyword`). A class left unset defaults to `'callback_only'`. The three keys are read
27
+ * once when the channel is created; later changes to this object have no effect. `null` throws.
28
+ */
29
+ keywords?: {
30
+ optOut?: TwilioKeywordPolicy;
31
+ optIn?: TwilioKeywordPolicy;
32
+ help?: TwilioKeywordPolicy;
33
+ };
34
+ /** Awaited for an opt-out keyword under each of the three policies. Keep the consent record here. */
35
+ onOptOut?: (event: TwilioKeywordEvent) => void | Promise<void>;
36
+ /** Awaited for an opt-in keyword under each of the three policies. */
37
+ onOptIn?: (event: TwilioKeywordEvent) => void | Promise<void>;
38
+ /** Awaited for a help keyword under each of the three policies. */
39
+ onHelp?: (event: TwilioKeywordEvent) => void | Promise<void>;
24
40
  }
25
41
  export interface TwilioChannel extends Channel {
26
42
  conversationKey(ref: TwilioConversationRef): string;
27
43
  parseConversationKey(id: string): TwilioConversationRef;
28
44
  }
29
45
  export declare function twilioConversationKey(ref: TwilioConversationRef): string;
46
+ /**
47
+ * The conversation-ownership key for a Twilio conversation, or `null` when it cannot be named: the
48
+ * account id is not `AC` followed by letters or digits, or an address is not one of the supported
49
+ * forms for its side. The customer may be an E.164 number, `whatsapp:` + an E.164 number, a short code
50
+ * (3 to 7 digits), or a WhatsApp business-scoped user id (`whatsapp:US.ABC123XYZ`); the sender may be an
51
+ * E.164 number, `whatsapp:` + an E.164 number, or a short code. A long number typed without "+" is refused.
52
+ * Ownership is per key: a WhatsApp customer reachable under both a phone number and a business-scoped
53
+ * user id has two keys, and this function cannot resolve one to the other. For a supported tuple the key equals
54
+ * `twilioConversationKey({ accountSid, from: customer, to: sender })`, the inbound dispatch's
55
+ * `instanceId`. Every ownership decision in this module takes its key from this function: the
56
+ * inbound and delivery-status dispatches' `ownershipKey`, `replyWithTwilio` and the messaging
57
+ * client's agent sends (tests: twilio-ownership.test.ts, "every Twilio ownership decision uses one
58
+ * key function").
59
+ */
60
+ export declare function twilioOwnershipKey(accountSid: unknown, customer: unknown, sender: unknown): string | null;
30
61
  export declare function parseTwilioConversationKey(id: string): TwilioConversationRef;
31
62
  export declare function createTwilioChannel(options: TwilioChannelOptions): TwilioChannel;
63
+ /** The carrier compliance class of an inbound keyword: opt-out, opt-in or help. */
64
+ export type TwilioKeywordClass = 'opt_out' | 'opt_in' | 'help';
65
+ /** What reaches the agent for a keyword class: nothing for `callback_only`, the message as before for `deliver`, or the message plus a classification for `deliver_with_classification`. */
66
+ export type TwilioKeywordPolicy = 'deliver' | 'deliver_with_classification' | 'callback_only';
67
+ /** Whether Twilio classified the message through its `OptOutType` parameter or the adapter matched the message body. */
68
+ export type TwilioKeywordSource = 'opt_out_type' | 'body';
69
+ /** The classification attached to the agent input under `deliver_with_classification`. */
70
+ export interface TwilioKeywordClassification {
71
+ class: TwilioKeywordClass;
72
+ /** Trimmed, upper-cased message body. Under `opt_out_type` it may be a custom keyword. */
73
+ keyword: string;
74
+ source: TwilioKeywordSource;
75
+ }
76
+ /** The event passed to `onOptOut`, `onOptIn` and `onHelp`: the classification plus the sender, recipient, message SID, account and channel. */
77
+ export interface TwilioKeywordEvent extends TwilioKeywordClassification {
78
+ from: string;
79
+ to: string;
80
+ messageSid: string | null;
81
+ accountSid: string;
82
+ tenantId?: string;
83
+ channel: 'sms' | 'whatsapp';
84
+ }
85
+ /**
86
+ * Classify an inbound Twilio message. The whole trimmed, case-folded body must be
87
+ * a keyword; a sentence containing one is not. A valid `OptOutType` webhook value
88
+ * (STOP, START or HELP, which Twilio sends when Advanced Opt-Out matches a keyword)
89
+ * wins over the body; an unrecognized value falls back to the body.
90
+ */
91
+ export declare function classifyTwilioKeyword(body: string, optOutType?: string): TwilioKeywordClass | undefined;
92
+ /**
93
+ * Verify HMAC-SHA1 using deduplicated, sorted form values and the exact URL,
94
+ * its parsed port-free form, or its parsed form with an explicit port.
95
+ * Default ports are 443 for HTTPS/WSS and 80 for HTTP/WS; other schemes
96
+ * do not gain a default port. Unparseable URLs retain exact-string verification.
97
+ * Does not implement the SDK's legacy querystring variant, which depends on Node's
98
+ * querystring re-encoding: when Twilio signs a differently encoded query string,
99
+ * pass the exact string Twilio signed as the URL.
100
+ */
32
101
  export declare function verifyTwilioSignature(authToken: string, url: string, params: URLSearchParams, signature: string): Promise<boolean>;
33
- export declare function replyWithTwilio(ref: TwilioConversationRef, options: {
102
+ /**
103
+ * Options for {@link replyWithTwilio}. Set `sentMessageStore` to record each accepted reply's
104
+ * MessageSid against `twilioConversationKey(ref)`, so its status callback reaches this conversation.
105
+ */
106
+ export interface ReplyWithTwilioOptions {
34
107
  authToken: string;
35
108
  fetchImpl?: typeof fetch;
36
- }): ToolDef<{
109
+ /** Absolute HTTP(S) URL sent as the message's `StatusCallback`. */
110
+ statusCallbackUrl?: string;
111
+ sentMessageStore?: Pick<TwilioSentMessageStore, 'recordSent'>;
112
+ /** Agent recorded for the conversation; the channel's `agent` is used when omitted. */
113
+ agent?: string;
114
+ actor?: TwilioSentMessageActor;
115
+ tenantId?: string;
116
+ /**
117
+ * Conversation ownership. When set, each run reads the owner of
118
+ * `twilioOwnershipKey(ref.accountSid, ref.from, ref.to)` immediately before the request to
119
+ * Twilio and refuses the reply while a person owns it. When that key is `null` the reply throws
120
+ * a `TypeError` before any read or request.
121
+ */
122
+ ownershipStore?: Pick<ConversationOwnershipStore, 'getOwnership'>;
123
+ }
124
+ /**
125
+ * Tool that replies from `ref.to` to `ref.from`. It returns Twilio's JSON response. With a
126
+ * `sentMessageStore`, an accepted reply without a sid throws `TwilioMessagingError`
127
+ * (`invalid_response`), and a failed record write throws `TwilioSentMessageRecordError`
128
+ * after the message was sent. With an `ownershipStore`, a reply on a person-owned conversation
129
+ * throws `ConversationOwnedByPersonError` and a failed ownership read throws
130
+ * `ConversationOwnershipReadError`; in both cases nothing is sent.
131
+ */
132
+ export declare function replyWithTwilio(ref: TwilioConversationRef, options: ReplyWithTwilioOptions): ToolDef<{
37
133
  text: string;
38
134
  }, unknown>;
39
135
  /** Documented message states; future provider states are preserved by parsers. */
@@ -86,7 +182,23 @@ export interface TwilioMessagingClientOptions {
86
182
  timeoutMs?: number;
87
183
  statusCallbackUrl?: string;
88
184
  fetchImpl?: typeof fetch;
185
+ /**
186
+ * Records each send that carries a `conversation`, after Twilio returns its sid. A failed
187
+ * write throws `TwilioSentMessageRecordError`; the message has already been sent.
188
+ */
189
+ sentMessageStore?: Pick<TwilioSentMessageStore, "recordSent">;
190
+ /**
191
+ * Conversation ownership. When set, and the key is valid, each agent send makes one ownership read of
192
+ * `twilioOwnershipKey(accountSid, to, from)` as its last await before the request to Twilio,
193
+ * and is refused while a person owns that conversation. When that key is `null` (no `from`, as
194
+ * for a send through a Messaging Service alone, or an address outside the forms
195
+ * `twilioOwnershipKey` lists), the send throws a `TypeError` before any read or request. A send
196
+ * with `sentBy: "person"` skips the check.
197
+ */
198
+ ownershipStore?: Pick<ConversationOwnershipStore, "getOwnership">;
89
199
  }
200
+ /** Who a send is for: the agent (the default) or the person who owns the conversation. */
201
+ export type TwilioMessagingSender = "agent" | "person";
90
202
  /** Both sender selectors may be supplied together. */
91
203
  export interface TwilioMessagingSendInput {
92
204
  to: string;
@@ -95,6 +207,21 @@ export interface TwilioMessagingSendInput {
95
207
  messagingServiceSid?: string;
96
208
  statusCallback?: string;
97
209
  signal?: AbortSignal;
210
+ /**
211
+ * Conversation to record against the returned sid, so the status callback reaches it.
212
+ * Requires the client's `sentMessageStore`; checked before anything is sent.
213
+ */
214
+ conversation?: TwilioSentMessageConversation;
215
+ /**
216
+ * `"agent"` (the default) or `"person"`. With the client's `ownershipStore`, an agent send is
217
+ * checked against `twilioOwnershipKey(accountSid, to, from)` only, and refused with a
218
+ * `TypeError` before anything is read when that key is `null`; `conversation.instanceId` is
219
+ * not an ownership key. `"person"` skips the ownership check on the caller's
220
+ * word: set it only in trusted application code, for an authenticated staff action on a message
221
+ * the person who owns the conversation wrote. An agent-facing tool must never forward a
222
+ * model-supplied value for this field.
223
+ */
224
+ sentBy?: TwilioMessagingSender;
98
225
  }
99
226
  /** Projection of a successful provider response. */
100
227
  export interface TwilioMessagingResult {
@@ -112,4 +239,127 @@ export interface TwilioMessagingResult {
112
239
  export declare function createTwilioMessagingClient(options: TwilioMessagingClientOptions): {
113
240
  send(input: TwilioMessagingSendInput): Promise<TwilioMessagingResult>;
114
241
  };
242
+ /** Statuses that produce a {@link TwilioDeliveryEvent}. Other statuses are acknowledged only. */
243
+ export type TwilioDeliveryStatus = "delivered" | "failed" | "undelivered";
244
+ /** Stable reason for a failed or undelivered message, from Twilio's `ErrorCode`. */
245
+ export type TwilioDeliveryFailureReason = "opt_out" | "unregistered_sender" | "unreachable" | "carrier_filtered" | "unknown";
246
+ /**
247
+ * Classify a Twilio delivery error code. Codes outside the documented table, and a missing
248
+ * code, return `unknown`; the raw code stays on the event.
249
+ */
250
+ export declare function classifyTwilioDeliveryFailure(errorCode: number | null | undefined): TwilioDeliveryFailureReason;
251
+ /** Actor recorded with a send and passed on the delivery dispatch. */
252
+ export type TwilioSentMessageActor = NonNullable<ChannelDispatchRequest["actor"]>;
253
+ /** The conversation a message was sent from, recorded against its sid. */
254
+ export interface TwilioSentMessageConversation {
255
+ /**
256
+ * Persistent-agent instance id the delivery dispatch goes to, usually `twilioConversationKey(ref)`.
257
+ * It is not an ownership key: a channel wrapped with `withConversationOwnership` decides a
258
+ * delivery dispatch on the key the status callback's addresses give.
259
+ */
260
+ instanceId: string;
261
+ /** Agent to dispatch delivery events to; the channel's `agent` is used when omitted. */
262
+ agent?: string;
263
+ actor?: TwilioSentMessageActor;
264
+ /** Tenant for the dispatch; the channel's `tenantId` is used when omitted. */
265
+ tenantId?: string;
266
+ }
267
+ /** One recorded send. */
268
+ export interface TwilioSentMessage extends TwilioSentMessageConversation {
269
+ messageSid: string;
270
+ }
271
+ /**
272
+ * Application-owned correlation from MessageSid to the sending conversation. Implement it
273
+ * over durable storage: `recordSent` should resolve only once the record is durable, and
274
+ * `findSent` should reject (not resolve `undefined`) when it cannot read the store.
275
+ */
276
+ export interface TwilioSentMessageStore {
277
+ recordSent(message: TwilioSentMessage): Promise<void>;
278
+ findSent(messageSid: string): Promise<TwilioSentMessage | undefined>;
279
+ }
280
+ /**
281
+ * Test/development sent-message store. Not durable: records live in process memory. It keeps its
282
+ * own field-by-field copy of each record and returns a fresh copy from `findSent` and `all`.
283
+ */
284
+ export declare function inMemoryTwilioSentMessageStore(): TwilioSentMessageStore & {
285
+ all(): TwilioSentMessage[];
286
+ };
287
+ /**
288
+ * The message was sent (Twilio returned its sid) but the store write failed, so its status
289
+ * callbacks are reported as unmatched until the record is written. Do not resend; retry
290
+ * `recordSent(sentMessage)`.
291
+ */
292
+ export declare class TwilioSentMessageRecordError extends Error {
293
+ readonly sentMessage: TwilioSentMessage;
294
+ readonly result?: TwilioMessagingResult | undefined;
295
+ name: string;
296
+ readonly messageSent = true;
297
+ readonly messageSid: string;
298
+ constructor(sentMessage: TwilioSentMessage, result?: TwilioMessagingResult | undefined, cause?: unknown);
299
+ }
300
+ /** A delivered, failed or undelivered status for a message recorded at send time. */
301
+ export interface TwilioDeliveryEvent {
302
+ type: "twilio.delivery";
303
+ messageSid: string;
304
+ status: TwilioDeliveryStatus;
305
+ /** Present for `failed` and `undelivered`. */
306
+ reason?: TwilioDeliveryFailureReason;
307
+ /** Twilio's raw `ErrorCode`, when it sent an integer one. */
308
+ errorCode?: number;
309
+ /**
310
+ * `${messageSid}:status:${status}`, also the dispatch request's `dedupeKey`. A redelivered
311
+ * callback produces an event with the same key.
312
+ */
313
+ dedupeKey: string;
314
+ /**
315
+ * A copy of the documented fields of the record the store returned, with the callback's
316
+ * `messageSid`. The dispatch targets this conversation's `instanceId`, not the callback's
317
+ * From/To; ownership of the dispatch is decided on the From/To key (see `startsAgentTurn`).
318
+ */
319
+ conversation: TwilioSentMessage;
320
+ /**
321
+ * Whether the channel makes a dispatch for this event after the hook returns. Decided before
322
+ * the hook runs from a separate copy, so changing the event does not alter the dispatch. The
323
+ * dispatch goes through the route's `ChannelContext.dispatch` with `ownershipKey` set to
324
+ * `twilioOwnershipKey(AccountSid, To, From)` from the callback (the channel's `accountSid` when
325
+ * AccountSid is absent; `null` when AccountSid, To or From has two different values), the key
326
+ * inbound messages from that person to that number dispatch under. A channel wrapped with
327
+ * `withConversationOwnership` sends it to `onPersonOwnedMessage` instead of the agent while a
328
+ * person owns that key, and fails the request, dispatching nothing, when the key is `null`.
329
+ */
330
+ startsAgentTurn: boolean;
331
+ record: TwilioStatusRecord;
332
+ }
333
+ /** Why a status callback could not be matched to a recorded send. */
334
+ export type TwilioUnmatchedStatusCause = "no_store" | "not_recorded";
335
+ /** Delivery-status handling for {@link createTwilioChannel}. */
336
+ export interface TwilioDeliveryStatusOptions {
337
+ /** Looks up the conversation recorded when the message was sent. */
338
+ sentMessageStore?: Pick<TwilioSentMessageStore, "findSent">;
339
+ /**
340
+ * Awaited, when configured, for each matched delivered, failed or undelivered callback, before
341
+ * the dispatch. A redelivered callback invokes it again with the same `dedupeKey`, so make it
342
+ * idempotent. The adapter passes that key as the dispatch request's `dedupeKey`; whether a
343
+ * repeat starts a second agent turn depends on the host honoring the key. The hook gets its own
344
+ * copy of the event; a rejection fails the request.
345
+ */
346
+ onDeliveryEvent?: (event: TwilioDeliveryEvent) => void | Promise<void>;
347
+ /**
348
+ * Awaited for a status callback that matches no recorded send: `no_store` when no
349
+ * `sentMessageStore` is configured, `not_recorded` when the sid is not in it. The channel
350
+ * does not dispatch these to an agent. A rejection fails the request. When omitted, the
351
+ * channel writes one `console.warn` line per callback with four fields: `event`
352
+ * (`twilio.status_unmatched`), `reason` (the cause), `status` (the callback's status when it
353
+ * is a documented Twilio message status, otherwise `unrecognized`) and `messageSid` (the
354
+ * callback's sid when it is `SM` or `MM` followed by 32 hex digits, otherwise
355
+ * `unrecognized`). Supply this hook to replace or silence it.
356
+ */
357
+ onUnmatchedStatus?: (record: TwilioStatusRecord, cause: TwilioUnmatchedStatusCause) => void | Promise<void>;
358
+ /**
359
+ * Matched statuses the channel dispatches. Default `["failed", "undelivered"]`; `[]` dispatches
360
+ * none. Each dispatch starts an agent turn unless a wrapper such as `withConversationOwnership`
361
+ * redirects it.
362
+ */
363
+ dispatchDeliveryStatuses?: readonly TwilioDeliveryStatus[];
364
+ }
115
365
  //# sourceMappingURL=twilio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"twilio.d.ts","sourceRoot":"","sources":["../src/twilio.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAkB,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGpF,MAAM,WAAW,qBAAqB;IAAG,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE;AACvF,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IAC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