@framers/agentos-ext-channel-sms 0.1.4 → 0.1.6
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 +79 -0
- package/manifest.json +1 -1
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# SMS channel
|
|
2
|
+
|
|
3
|
+
This pack gives an agent an SMS sending tool and a channel adapter using the `twilio` SDK. It receives inbound Twilio Messaging webhooks through an HTTP handler with signature verification.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @framers/agentos-ext-channel-sms
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependency: `@framers/agentos` at `>=0.10.40`.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { AgentOS } from '@framers/agentos';
|
|
17
|
+
|
|
18
|
+
const agentos = await AgentOS.create({
|
|
19
|
+
extensionManifest: {
|
|
20
|
+
packs: [
|
|
21
|
+
{
|
|
22
|
+
package: '@framers/agentos-ext-channel-sms',
|
|
23
|
+
options: {
|
|
24
|
+
accountSid: process.env.TWILIO_ACCOUNT_SID,
|
|
25
|
+
authToken: process.env.TWILIO_AUTH_TOKEN,
|
|
26
|
+
phoneNumber: process.env.TWILIO_PHONE_NUMBER,
|
|
27
|
+
webhookPath: process.env.TWILIO_SMS_WEBHOOK_PATH,
|
|
28
|
+
webhookUrl: process.env.TWILIO_SMS_WEBHOOK_URL,
|
|
29
|
+
publicBaseUrl: process.env.TWILIO_SMS_PUBLIC_BASE_URL,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
Credentials resolve from options, then `options.secrets`, then the environment.
|
|
40
|
+
|
|
41
|
+
| Option | Secret id | Environment variable | Required | Default |
|
|
42
|
+
| --- | --- | --- | --- | --- |
|
|
43
|
+
| `accountSid` | `twilio.accountSid` | `TWILIO_ACCOUNT_SID` | yes | None |
|
|
44
|
+
| `authToken` | `twilio.authToken` | `TWILIO_AUTH_TOKEN` | yes | None |
|
|
45
|
+
| `phoneNumber` | `twilio.phoneNumber` | `TWILIO_PHONE_NUMBER` | yes | None |
|
|
46
|
+
| `webhookPath` | None | `TWILIO_SMS_WEBHOOK_PATH` | no | `/webhooks/twilio/sms` |
|
|
47
|
+
| `webhookUrl` | None | `TWILIO_SMS_WEBHOOK_URL` | no | Reconstructed from base URL and request |
|
|
48
|
+
| `publicBaseUrl` | None | `TWILIO_SMS_PUBLIC_BASE_URL` | no | Request forwarded protocol and host headers, then HTTP and host header, then localhost |
|
|
49
|
+
| `skipSignatureValidation` | None | `TWILIO_SMS_SKIP_SIGNATURE_VALIDATION` | no | `false` |
|
|
50
|
+
| `maxBodyBytes` | None | None | no | `1024 * 1024` bytes |
|
|
51
|
+
| `priority` | None | None | no | `50` |
|
|
52
|
+
| `secrets` | Credential ids above | None | no | None |
|
|
53
|
+
|
|
54
|
+
## Tools
|
|
55
|
+
|
|
56
|
+
| Tool | What it does |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `smsChannelSendMessage` | Sends an SMS through Twilio to a phone number. |
|
|
59
|
+
|
|
60
|
+
### `smsChannelSendMessage`
|
|
61
|
+
|
|
62
|
+
| Parameter | Type | Required | Description |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `conversationId` | string | yes | Recipient phone number (E.164) |
|
|
65
|
+
| `text` | string | yes | Message text |
|
|
66
|
+
|
|
67
|
+
## Channel adapter
|
|
68
|
+
|
|
69
|
+
The adapter registers platform `sms`. Activation creates a Twilio client with the account credentials. Sending takes the first text block and sends it from `phoneNumber` to the recipient in `conversationId`. Inbound delivery uses the host HTTP server: the handler accepts POST requests with form or JSON payloads, verifies signatures and acknowledges with an empty XML response. It emits nonempty message bodies with the sender's phone number as the direct conversation id. Typing indicators do nothing.
|
|
70
|
+
|
|
71
|
+
## Notes
|
|
72
|
+
|
|
73
|
+
Sending calls Twilio's message creation API. Missing `accountSid`, `authToken` or `phoneNumber` makes pack creation throw. Sends require a nonempty recipient and message text.
|
|
74
|
+
|
|
75
|
+
`webhookUrl` overrides URL reconstruction for signature verification. Otherwise, the handler uses `publicBaseUrl` or request headers. Signature verification is skipped when the option is `true` or the environment setting is a case-insensitive true, yes or numeric one, even if the option is `false`. Oversized webhook bodies are rejected. Media-only inbound messages without text are ignored.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
Apache-2.0
|
package/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
|
|
3
3
|
"id": "com.framers.channels.sms",
|
|
4
4
|
"name": "SMS Channel Extension",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.6",
|
|
6
6
|
"description": "SMS messaging via Twilio — inbound webhook + outbound sends.",
|
|
7
7
|
"categories": ["channel", "communication"],
|
|
8
8
|
"platforms": ["sms"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-channel-sms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "SMS messaging channel adapter for AgentOS (Twilio)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^20.0.0",
|
|
29
|
-
"typescript": "^
|
|
29
|
+
"typescript": "^6.0.3",
|
|
30
30
|
"vitest": "^3.2.7",
|
|
31
|
-
"@framers/agentos": "^0.
|
|
31
|
+
"@framers/agentos": "^0.15.67"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=22"
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"bugs": {
|
|
46
46
|
"url": "https://github.com/framerslab/agentos-extensions/issues"
|
|
47
47
|
},
|
|
48
|
+
"gitHead": "6397d0f3417f6a74ad2fdcd666fd0634e832fb40",
|
|
48
49
|
"scripts": {
|
|
49
50
|
"build": "tsc",
|
|
50
51
|
"dev": "tsc --watch",
|