@fabric-harness/channels 0.27.1 → 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/README.md +121 -3
- package/dist/buzz.d.ts +8 -5
- package/dist/buzz.d.ts.map +1 -1
- package/dist/buzz.js +3 -2
- package/dist/buzz.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/twilio.d.ts +245 -4
- package/dist/twilio.d.ts.map +1 -1
- package/dist/twilio.js +558 -28
- package/dist/twilio.js.map +1 -1
- package/package.json +15 -10
package/README.md
CHANGED
|
@@ -172,8 +172,9 @@ emoji surface for audit, free-form replies resolve to **edit proposals** that re
|
|
|
172
172
|
structured confirmation, and everything else is ordinary conversation. The bridge
|
|
173
173
|
performs zero authorization and signals nothing — the vertical's governed decision
|
|
174
174
|
action owns binding resolution, capability, validation, and the decision transaction.
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
Reactions from the Buzz Desktop app in `block/buzz-app` carry the `h` channel tag and route
|
|
176
|
+
by it. The earlier Desktop app in `block/buzz` (0.5.x releases) and the Buzz SDK and CLI emit
|
|
177
|
+
NIP-25 reactions with an `e` target and no `h` channel tag. To support that shape, give `createBuzzChannel` the same durable receipt store used by
|
|
177
178
|
`postBuzzDecisionCard` plus an explicit `channels` allowlist. The route derives the
|
|
178
179
|
channel only when the reaction has one target and exactly one receipt matches it inside
|
|
179
180
|
that allowlist. Missing, malformed, cross-channel, and ambiguous matches are ignored;
|
|
@@ -239,9 +240,126 @@ Kinds are `opt_out` (when Twilio reports code 21610), `rate_limited`, `rejected`
|
|
|
239
240
|
The generic error message excludes provider text; `providerMessage` and `moreInfo`
|
|
240
241
|
contain provider details. Transport errors retain their original `cause`.
|
|
241
242
|
Applications own retries, deduplication, opt-out state and consent. The client sends
|
|
242
|
-
no idempotency key and performs no automatic retries.
|
|
243
|
+
no idempotency key and performs no automatic retries. For inbound messages,
|
|
244
|
+
`createTwilioChannel` classifies carrier keywords and, when a callback is configured, reports
|
|
245
|
+
them to `onOptOut`, `onOptIn` and `onHelp`. It stores no opt-out state; see below.
|
|
246
|
+
|
|
247
|
+
### Person takeover
|
|
248
|
+
|
|
249
|
+
`replyWithTwilio(ref, { ownershipStore })` and `createTwilioMessagingClient({ ownershipStore })`
|
|
250
|
+
refuse an agent send while a person owns the conversation, with `ConversationOwnedByPersonError`
|
|
251
|
+
from `@fabric-harness/sdk`, before any request reaches Twilio. Ownership is the SDK's
|
|
252
|
+
`ConversationOwnershipStore` record, written by `takeOver` and `handBack`. Every ownership
|
|
253
|
+
decision takes its key from `twilioOwnershipKey(accountSid, customer, sender)`, which returns
|
|
254
|
+
`null` for an address outside the supported forms listed under
|
|
255
|
+
[supported addresses](https://harness.techfabric.com/docs/ecosystem/channels/twilio#supported-addresses);
|
|
256
|
+
for supported addresses it equals `twilioConversationKey({ accountSid, from: customer, to: sender })`.
|
|
257
|
+
A client agent send is checked against `twilioOwnershipKey(accountSid, to, from)` only;
|
|
258
|
+
`conversation.instanceId` is not checked. With an `ownershipStore`, an agent send whose key is
|
|
259
|
+
`null`, including a Messaging-Service-only send, throws a `TypeError` before anything is read or sent. Pass `sentBy: 'person'` to skip the check on the caller's word: set it in trusted application code for an authenticated staff action, and never forward a sender value the model supplied to an agent-facing tool. A
|
|
260
|
+
store that cannot be read refuses the send with `ConversationOwnershipReadError`. When an ownership store is configured and the key is valid, each agent send
|
|
261
|
+
makes one ownership read, after validation, as the last await before the request, keyed by the
|
|
262
|
+
same account the request uses. A takeover written after the store answered that read, while the answer is on its way back or the request to Twilio is in flight, does not stop that message. The check is only as current as the store's read, so a store that answers from a stale replica can miss a takeover written before the read. `timeoutMs` does not cover the read.
|
|
263
|
+
|
|
264
|
+
Wrap the channel with the SDK's `withConversationOwnership(channel, { store, onPersonOwnedMessage })`
|
|
265
|
+
to send inbound messages on a person-owned conversation to your callback instead of the agent. The
|
|
266
|
+
keyword callbacks and `onDeliveryEvent` still run; dispatches they would have made go to the
|
|
267
|
+
callback. Inbound and delivery-status dispatches carry `twilioOwnershipKey` of the webhook's
|
|
268
|
+
addresses as their `ownershipKey`, so a delivery status is decided on the conversation, not on the
|
|
269
|
+
`instanceId` recorded with the send. When that key is `null`, the wrapped channel fails the
|
|
270
|
+
request with `ConversationOwnershipReadError` (`unknown_conversation`) and dispatches nothing. Without an `ownershipStore` or the wrapper, behavior is unchanged, except that an unwrapped Twilio channel now passes `ownershipKey` on its dispatch requests to whatever supplies dispatch (the Node runtime ignores it). Supported addresses: a short code of 3 to 7 digits is accepted on either side; a longer digit string is refused. The address table decides which conversations can be checked, not which sends Twilio accepts (Twilio refuses SMS to a short code, error 21265). Ownership is per key: a WhatsApp customer reachable under both a phone number and a business-scoped user id has two keys, the channel cannot resolve one to the other, and an application must take over both, or the one it uses only if the inbound and delivery-status webhooks for that customer also arrive under that key; the address chosen for outbound sends does not control which form Twilio puts in a webhook. The send check covers
|
|
271
|
+
Twilio messaging (SMS and WhatsApp) only for now; the other channels' outbound tools do not check ownership.
|
|
272
|
+
|
|
273
|
+
### Inbound compliance keywords
|
|
274
|
+
|
|
275
|
+
`classifyTwilioKeyword(body, optOutType?)` returns `'opt_out'`, `'opt_in'`, `'help'` or
|
|
276
|
+
`undefined`. The whole trimmed, case-folded body must match one of the default keywords on Twilio's
|
|
277
|
+
[Advanced Opt-Out page](https://www.twilio.com/docs/messaging/tutorials/advanced-opt-out):
|
|
278
|
+
STOP, UNSUBSCRIBE, END, QUIT, STOPALL, REVOKE, OPTOUT, CANCEL (opt-out); START, UNSTOP
|
|
279
|
+
(opt-in); HELP. A sentence containing a keyword is not one. A valid `OptOutType`
|
|
280
|
+
parameter (STOP, START, HELP) wins over the body; any other value is ignored.
|
|
281
|
+
|
|
282
|
+
YES and INFO are not in this adapter's fallback list. Twilio can treat them as keywords for some
|
|
283
|
+
senders; when it does and sends `OptOutType`, the adapter classifies from `OptOutType`
|
|
284
|
+
(`Body=YES&OptOutType=START` is `opt_in`, `Body=INFO&OptOutType=HELP` is `help`). The same
|
|
285
|
+
page says Advanced Opt-Out also works with
|
|
286
|
+
[WhatsApp-enabled senders added to a Messaging Service](https://www.twilio.com/docs/messaging/tutorials/advanced-opt-out#add-a-whatsapp-enabled-number-to-your-messaging-service)
|
|
287
|
+
and is disabled by default. A bare WhatsApp START therefore reaches `onOptIn`, when configured, with
|
|
288
|
+
`source: 'body'`, which does not show that Twilio applied an opt-in: decide in the callback, and treat
|
|
289
|
+
`source: 'opt_out_type'` as Twilio's own classification.
|
|
290
|
+
|
|
291
|
+
`createTwilioChannel` applies this to SMS and `whatsapp:` messages after the signature check. The class
|
|
292
|
+
callback (`onOptOut`, `onOptIn`, `onHelp`), when configured, is awaited under each of the three
|
|
293
|
+
policies and runs before dispatch deduplication, so a redelivered webhook calls it again: make it
|
|
294
|
+
idempotent. With no callback and the default policy, a keyword gets an empty reply, no callback and no
|
|
295
|
+
agent turn. A signed non-status webhook with a valid `OptOutType` reaches the callback when one is configured, even
|
|
296
|
+
without `Body`; it is not dispatched to the agent under any policy. If a callback throws, nothing is
|
|
297
|
+
dispatched and the handler rejects, so the host can answer with an error and Twilio sees the failure.
|
|
298
|
+
`keywords: { optOut, optIn, help }` sets what reaches the agent: `'callback_only'` (default, no
|
|
299
|
+
dispatch), `'deliver_with_classification'` (dispatch plus `input.keyword`) or `'deliver'` (dispatch
|
|
300
|
+
as before). The policies and callbacks are read once when the channel is created. An unset
|
|
301
|
+
`keywords` means the defaults; `null`, an array, an unsupported policy value, an unknown enumerable key or a
|
|
302
|
+
callback that is not a function makes `createTwilioChannel` throw. A status callback is not
|
|
303
|
+
checked for keywords: it takes the delivery-status path below before classification runs.
|
|
243
304
|
|
|
244
305
|
`parseTwilioStatusParams` is pure and does not authenticate. The request parser
|
|
245
306
|
uses the bounded webhook reader and verifies the signature before returning a
|
|
246
307
|
record; set `webhookUrl` to the public URL when a proxy rewrites it. Unknown status
|
|
247
308
|
strings and additional parameters are preserved (first value per parameter).
|
|
309
|
+
These parsers do not dispatch to an agent.
|
|
310
|
+
|
|
311
|
+
## Twilio delivery status callbacks
|
|
312
|
+
|
|
313
|
+
`createTwilioChannel` treats a signed request to its `/messages` route that carries a non-empty
|
|
314
|
+
`MessageStatus` as a status callback; an empty `MessageStatus` takes the inbound path. It looks up the `MessageSid` in the application's
|
|
315
|
+
`sentMessageStore` (a `TwilioSentMessageStore` with `recordSent` and `findSent`) and routes the
|
|
316
|
+
status to the conversation recorded at send time, not to a key built from the callback's
|
|
317
|
+
`From`/`To` (for an outbound message `From` is the Twilio number, which reverses the inbound key).
|
|
318
|
+
Record sends with `createTwilioMessagingClient({ ..., sentMessageStore })` and
|
|
319
|
+
`send({ ..., conversation: { instanceId, agent?, actor?, tenantId? } })`, or with
|
|
320
|
+
`replyWithTwilio(ref, { authToken, statusCallbackUrl, sentMessageStore, agent? })`.
|
|
321
|
+
`inMemoryTwilioSentMessageStore()` is a test double and is not durable.
|
|
322
|
+
|
|
323
|
+
- A recorded `delivered`, `failed` or `undelivered` status is passed to the awaited
|
|
324
|
+
`onDeliveryEvent` as a `TwilioDeliveryEvent` (`status`, `reason`, raw `errorCode`,
|
|
325
|
+
`messageSid`, `dedupeKey`, `conversation`, `startsAgentTurn`). Statuses in
|
|
326
|
+
`dispatchDeliveryStatuses` (default `['failed', 'undelivered']`) are then dispatched (to
|
|
327
|
+
`onPersonOwnedMessage` instead of the agent when the channel is wrapped with
|
|
328
|
+
`withConversationOwnership` and a person owns the conversation's address key) as a `twilio.delivery` signal message with dedupe key `${MessageSid}:status:${status}`. Other
|
|
329
|
+
statuses, such as `queued` or `sent`, are acknowledged and nothing else. The dispatch is
|
|
330
|
+
built before the hook runs from its own copy of the record, and the event holds a separate
|
|
331
|
+
copy, so a hook that changes its event changes neither the dispatch nor the store's object.
|
|
332
|
+
- Records are copied field by field, not cloned, so a class instance or a record with methods
|
|
333
|
+
works; extra fields are dropped. A record from `findSent` whose documented fields have the
|
|
334
|
+
wrong types, or whose `messageSid` differs from the callback's, answers `500`. A `conversation`
|
|
335
|
+
whose fields have the wrong types makes `send()` throw a `TypeError` before anything is sent.
|
|
336
|
+
- Each matched `delivered`, `failed` or `undelivered` callback invokes `onDeliveryEvent`
|
|
337
|
+
when one is configured. A redelivered callback invokes it again with the same `dedupeKey`,
|
|
338
|
+
so make the hook idempotent. The adapter passes that key on the dispatch request; whether a
|
|
339
|
+
repeat starts a second agent turn depends on the host honoring it. The Node host uses it as
|
|
340
|
+
the submission id; the Twilio guide describes how that host treats a repeat.
|
|
341
|
+
- `send()` and the `replyWithTwilio` tool read their input, `ref`, options and store once,
|
|
342
|
+
before the request, so replacing the store mid-flight does not change where a send is recorded.
|
|
343
|
+
- A sid that is not in the store, or any status when no store is configured, goes to the awaited
|
|
344
|
+
`onUnmatchedStatus(record, 'not_recorded' | 'no_store')` and is not dispatched. Without the
|
|
345
|
+
hook, the channel writes one `console.warn` line per callback with four fields: `event`
|
|
346
|
+
(`twilio.status_unmatched`), `reason` (the cause), `status` (when it is one of Twilio's
|
|
347
|
+
documented message statuses, otherwise `unrecognized`) and `messageSid` (when it is `SM` or
|
|
348
|
+
`MM` followed by 32 hex digits, otherwise `unrecognized`). Nothing else from the request is
|
|
349
|
+
written. Supply the hook to replace or silence it. A channel
|
|
350
|
+
configured without a store or hook, as `fh add channel twilio` generates, is inbound-only.
|
|
351
|
+
- A rejected lookup answers `500`; a callback or dispatch rejection makes the handler reject.
|
|
352
|
+
- Set `webhookUrl` without a fragment. Twilio leaves connection overrides such as `#rp=5xx` out of
|
|
353
|
+
the signature, but the channel signs `webhookUrl` as given; put overrides on the
|
|
354
|
+
`statusCallbackUrl` only.
|
|
355
|
+
- `classifyTwilioDeliveryFailure(code)` maps 21610 to `opt_out`, 30034 to
|
|
356
|
+
`unregistered_sender`, 30003, 30005 and 30006 to `unreachable`, and 30007 to
|
|
357
|
+
`carrier_filtered`, per Twilio's error pages (`https://www.twilio.com/docs/api/errors/<code>`).
|
|
358
|
+
Other codes are `unknown`.
|
|
359
|
+
- When Twilio accepts a message but `recordSent` rejects, the send throws
|
|
360
|
+
`TwilioSentMessageRecordError` (`messageSent: true`). Do not resend; retry the record write.
|
|
361
|
+
|
|
362
|
+
Before this release a status callback that carried both `From` and `To` was dispatched to
|
|
363
|
+
`agent` as a `twilio.status` input on the key built from them. Configure a store and record sends to keep agent notifications. The
|
|
364
|
+
[Twilio channel guide](https://harness.techfabric.com/docs/ecosystem/channels/twilio) has the full table
|
|
365
|
+
and migration notes.
|
package/dist/buzz.d.ts
CHANGED
|
@@ -15,9 +15,11 @@ import type { BuzzCardReceiptStore } from "./buzz-decisions.js";
|
|
|
15
15
|
* performs no authorization and never talks to Temporal. It stamps the Nostr
|
|
16
16
|
* pubkey as the acting `actor` (candidate identity); binding resolution and
|
|
17
17
|
* capability checks happen in the vertical's governed decision-ingress action.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the
|
|
18
|
+
* Reactions from the Buzz Desktop app in `block/buzz-app` carry the NIP-29
|
|
19
|
+
* channel (`h`) tag. Reactions from the earlier Desktop app in `block/buzz`
|
|
20
|
+
* (`desktop/`, 0.5.x releases) and from the Buzz SDK and CLI omit it, so the
|
|
21
|
+
* adapter may derive that transport scope from one exact, persisted
|
|
22
|
+
* decision-card receipt; the receipt grants no decision authority.
|
|
21
23
|
*/
|
|
22
24
|
/** Nostr event shape (NIP-01). Kept local so the handler path stays SDK-only. */
|
|
23
25
|
export interface BuzzEvent {
|
|
@@ -93,8 +95,9 @@ export interface BuzzChannelOptions {
|
|
|
93
95
|
/**
|
|
94
96
|
* Server-owned channel allowlist for this deployment. When present,
|
|
95
97
|
* channel-tagged events outside this list are ignored. This list is also
|
|
96
|
-
* required for receipt-aware correlation of
|
|
97
|
-
*
|
|
98
|
+
* required for receipt-aware correlation of reactions that carry an `e`
|
|
99
|
+
* target but no `h` channel tag, as the `block/buzz` Desktop app (0.5.x)
|
|
100
|
+
* and the Buzz SDK and CLI send them.
|
|
98
101
|
*/
|
|
99
102
|
channels?: readonly string[];
|
|
100
103
|
/**
|
package/dist/buzz.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buzz.d.ts","sourceRoot":"","sources":["../src/buzz.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAkB,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE
|
|
1
|
+
{"version":3,"file":"buzz.d.ts","sourceRoot":"","sources":["../src/buzz.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAkB,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAEzD;AAED,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wEAAwE;AACxE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AAe,CAC7B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,EAAE,cAAc,CAAC,CAwBnE;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,cAAc,GACrB,OAAO,CACR;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAC9E,cAAc,CACf,CAgCA;AAED,wEAAwE;AACxE,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,gFAAgF;AAChF,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,OAAO,KAAa,EAC/B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAO,GAChE,OAAO,CAAC,aAAa,CAAC,CAaxB"}
|
package/dist/buzz.js
CHANGED
|
@@ -214,8 +214,9 @@ export function createBuzzChannel(options) {
|
|
|
214
214
|
const receiptStore = options.decisionReceiptStore;
|
|
215
215
|
if (!receiptStore || !configuredChannels)
|
|
216
216
|
return undefined;
|
|
217
|
-
//
|
|
218
|
-
// NIP-29 `h` tag. Multiple targets
|
|
217
|
+
// The `block/buzz` Desktop app (0.5.x) and the Buzz SDK and CLI emit NIP-25
|
|
218
|
+
// reactions with one `e` target and no NIP-29 `h` tag. Multiple targets
|
|
219
|
+
// are ambiguous and fail closed.
|
|
219
220
|
const targets = tagValues(event, "e");
|
|
220
221
|
if (targets.length !== 1)
|
|
221
222
|
return undefined;
|
package/dist/buzz.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buzz.js","sourceRoot":"","sources":["../src/buzz.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAiC7C,+DAA+D;AAC/D,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,OAAO,WAAW,CAAC,KAA0C,CAAC,CAAC;AACjE,CAAC;AAgBD,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,eAAe,EAAE,UAAU;IAC3B,aAAa,EAAE,UAAU;IACzB,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,cAAc;IAC9B,eAAe,EAAE,mCAAmC;IACpD,eAAe,EAAE,cAAc;IAC/B,oBAAoB,EAAE,gCAAgC;IACtD,cAAc,EAAE,aAAa;IAC7B,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,aAAa;IACpB,oBAAoB,EAAE,aAAa;CAC3B,CAAC;AAmEX,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAEhC,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,YAAoB;IAChD,OAAO,YAAY,CA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AM,GAAG;gBACjD,IAAI,EAAE;oBACJ,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC;oBACpB,CAAC,UAAU,EAAE,iBAAiB,CAAC;iBAChC;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAWD,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAgB,EAChB,YAA0B,KAAK,EAC/B,UAA+D,EAAE;IAEjE,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CACrC,SAAS,EACT,WAAW,CAAC,QAAQ,CAAC,EACrB;QACE,OAAO,EAAE,EAAE,MAAM,EAAE,wBAAwB,EAAE;KAC9C,EACD,OAAO,CAAC,gBAAgB,IAAI,MAAM,EAClC,OAAO,CAAC,MAAM,CACf,CAAC;IACF,IAAI,CAAC,QAAQ,CAAC,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAC,MAAM,GAAG,MAAM,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClG,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;AAClD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { defineChannel, hmacSha256, verifyHmacSha256, bytesToHex, hexToBytes, conversationKey, parseConversationKey, readRequestBody, } from '@fabric-harness/sdk/channel';
|
|
2
2
|
export type { Channel, ChannelRoute, ChannelContext, ChannelDispatch, ChannelDispatchRequest, ParsedConversationKey } from '@fabric-harness/sdk/channel';
|
|
3
|
+
export { ConversationOwnedByPersonError, ConversationOwnershipReadError, agentMaySend, assertAgentMaySend, handBack, inMemoryConversationOwnershipStore, readConversationOwnership, takeOver, withConversationOwnership, } from '@fabric-harness/sdk/channel';
|
|
4
|
+
export type { ConversationOwner, ConversationOwnership, ConversationOwnershipChannelOptions, ConversationOwnershipStore, PersonOwnedMessage, } from '@fabric-harness/sdk/channel';
|
|
3
5
|
export { channelCompatibility, channelCompatibilityPolicy } from './compatibility.js';
|
|
4
6
|
export type { ChannelCompatibility, ChannelCompatibilityStatus, FirstPartyChannelName } from './compatibility.js';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzJ,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzJ,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,kCAAkC,EAClC,yBAAyB,EACzB,QAAQ,EACR,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mCAAmC,EACnC,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Convenience re-export of the core channel seam (defined in @fabric-harness/sdk). Vendor adapters
|
|
2
2
|
// live behind subpath exports, e.g. `@fabric-harness/channels/slack`.
|
|
3
3
|
export { defineChannel, hmacSha256, verifyHmacSha256, bytesToHex, hexToBytes, conversationKey, parseConversationKey, readRequestBody, } from '@fabric-harness/sdk/channel';
|
|
4
|
+
export { ConversationOwnedByPersonError, ConversationOwnershipReadError, agentMaySend, assertAgentMaySend, handBack, inMemoryConversationOwnershipStore, readConversationOwnership, takeOver, withConversationOwnership, } from '@fabric-harness/sdk/channel';
|
|
4
5
|
export { channelCompatibility, channelCompatibilityPolicy } from './compatibility.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,sEAAsE;AACtE,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,sEAAsE;AACtE,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,kCAAkC,EAClC,yBAAyB,EACzB,QAAQ,EACR,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC"}
|
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,21 +14,81 @@ 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;
|
|
32
92
|
/**
|
|
33
93
|
* Verify HMAC-SHA1 using deduplicated, sorted form values and the exact URL,
|
|
34
94
|
* its parsed port-free form, or its parsed form with an explicit port.
|
|
@@ -39,10 +99,37 @@ export declare function createTwilioChannel(options: TwilioChannelOptions): Twil
|
|
|
39
99
|
* pass the exact string Twilio signed as the URL.
|
|
40
100
|
*/
|
|
41
101
|
export declare function verifyTwilioSignature(authToken: string, url: string, params: URLSearchParams, signature: string): Promise<boolean>;
|
|
42
|
-
|
|
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 {
|
|
43
107
|
authToken: string;
|
|
44
108
|
fetchImpl?: typeof fetch;
|
|
45
|
-
|
|
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<{
|
|
46
133
|
text: string;
|
|
47
134
|
}, unknown>;
|
|
48
135
|
/** Documented message states; future provider states are preserved by parsers. */
|
|
@@ -95,7 +182,23 @@ export interface TwilioMessagingClientOptions {
|
|
|
95
182
|
timeoutMs?: number;
|
|
96
183
|
statusCallbackUrl?: string;
|
|
97
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">;
|
|
98
199
|
}
|
|
200
|
+
/** Who a send is for: the agent (the default) or the person who owns the conversation. */
|
|
201
|
+
export type TwilioMessagingSender = "agent" | "person";
|
|
99
202
|
/** Both sender selectors may be supplied together. */
|
|
100
203
|
export interface TwilioMessagingSendInput {
|
|
101
204
|
to: string;
|
|
@@ -104,6 +207,21 @@ export interface TwilioMessagingSendInput {
|
|
|
104
207
|
messagingServiceSid?: string;
|
|
105
208
|
statusCallback?: string;
|
|
106
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;
|
|
107
225
|
}
|
|
108
226
|
/** Projection of a successful provider response. */
|
|
109
227
|
export interface TwilioMessagingResult {
|
|
@@ -121,4 +239,127 @@ export interface TwilioMessagingResult {
|
|
|
121
239
|
export declare function createTwilioMessagingClient(options: TwilioMessagingClientOptions): {
|
|
122
240
|
send(input: TwilioMessagingSendInput): Promise<TwilioMessagingResult>;
|
|
123
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
|
+
}
|
|
124
365
|
//# sourceMappingURL=twilio.d.ts.map
|