@framers/agentos-ext-voice-twilio 0.1.3 → 0.1.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 ADDED
@@ -0,0 +1,81 @@
1
+ # Twilio voice calls
2
+
3
+ This pack gives an agent a voice call provider and a call management tool interface using the `twilio` SDK, Twilio REST API and TwiML. The provider creates calls, generates speech instructions and parses call status webhooks.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @framers/agentos-ext-voice-twilio
9
+ ```
10
+
11
+ Peer dependency: `@framers/agentos` (`>=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-voice-twilio',
23
+ options: {
24
+ accountSid: process.env.TWILIO_ACCOUNT_SID,
25
+ authToken: process.env.TWILIO_AUTH_TOKEN,
26
+ fromNumber: process.env.TWILIO_FROM_NUMBER,
27
+ webhookBaseUrl: process.env.TWILIO_WEBHOOK_BASE_URL,
28
+ },
29
+ },
30
+ ],
31
+ },
32
+ });
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ Credentials resolve from direct options, then `options.secrets`, then the selected environment variable. A custom environment name replaces the default name; caller number resolution then checks its fallback.
38
+
39
+ | Option | Secret id | Environment variable | Required | Default |
40
+ | --- | --- | --- | --- | --- |
41
+ | `accountSid` | `twilio.accountSid` | Name in `accountSidEnv`, otherwise `TWILIO_ACCOUNT_SID` | Yes | Empty string, then throws |
42
+ | `authToken` | `twilio.authToken` | Name in `authTokenEnv`, otherwise `TWILIO_AUTH_TOKEN` | Yes | Empty string, then throws |
43
+ | `fromNumber` | `twilio.fromNumber` | Name in `fromNumberEnv`, otherwise `TWILIO_FROM_NUMBER`; then `TWILIO_PHONE_NUMBER` | No | Empty string |
44
+ | `webhookBaseUrl` | None | `TWILIO_WEBHOOK_BASE_URL` | No | `undefined` |
45
+ | `accountSidEnv` | None | None | No | `TWILIO_ACCOUNT_SID` selected by resolver |
46
+ | `authTokenEnv` | None | None | No | `TWILIO_AUTH_TOKEN` selected by resolver |
47
+ | `fromNumberEnv` | None | None | No | `TWILIO_FROM_NUMBER` selected by resolver |
48
+ | `priority` | None | None | No | `50` |
49
+ | `secrets` | Map containing the secret ids above | None | No | `undefined` |
50
+
51
+ ## Tools
52
+
53
+ | Tool | What it does |
54
+ | --- | --- |
55
+ | `twilioVoiceCall` | Makes or manages Twilio phone calls through a handler, including outbound calls, speech, ending calls and status queries. |
56
+
57
+ ### `twilioVoiceCall` parameters
58
+
59
+ | Parameter | Type | Required | Description |
60
+ | --- | --- | --- | --- |
61
+ | `action` | `string`, enum: `initiate_call`, `speak`, `end_call`, `get_status` | Yes | The action to perform |
62
+ | `toNumber` | `string` | No | E.164 phone number to call (e.g., +15551234567). Required for `initiate_call`. |
63
+ | `message` | `string` | No | Text to speak. Used for `initiate_call` (notify mode) and `speak` action. |
64
+ | `callId` | `string` | No | Call ID. Required for `speak`, `end_call`, and `get_status` actions. |
65
+ | `mode` | `string`, enum: `notify`, `conversation` | No | Call mode. "`notify`" speaks a message and hangs up; "`conversation`" enables bidirectional audio. Defaults to "`conversation`". |
66
+
67
+ ## Notes
68
+
69
+ The package requires Node.js `>=22`. Activation dynamically loads the SDK and initializes the service. Deactivation releases the SDK client. Missing account credentials throw during pack creation.
70
+
71
+ The factory registers the tool with a placeholder handler: initiating, speaking and ending calls return handler-not-configured errors; status lookup finds no call, and listing returns an empty array. Although comments mention `setToolHandler`, the source exports no such function. The exported `VoiceCallTool` constructor accepts a host-provided `VoiceCallToolHandler` for separate construction.
72
+
73
+ With a configured handler, call operations have side effects. Runtime checks require `toNumber` for `initiate_call`, `callId` and `message` for `speak`, and `callId` for `end_call`. Despite its schema description, `get_status` accepts no `callId` to list active calls. The tool passes an omitted `mode` through to the handler without applying a default. Number validation checks for a string beginning with `+`.
74
+
75
+ The provider generates notify TwiML with speech followed by hangup, defaulting to `Polly.Joanna`. Its `playTts` method uses the same speech-and-hangup TwiML. Conversation TwiML connects a media stream when the caller supplies a stream URL. The service escapes XML values.
76
+
77
+ Webhook verification uses the request URL, body parameters and auth token. Missing signatures or invalid signatures are rejected. Form-encoded status callbacks map to normalized call events. The pack registers `voice-provider` named `twilio`; its files do not start webhook or media socket servers.
78
+
79
+ ## License
80
+
81
+ 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.voice.twilio",
4
4
  "name": "Twilio Voice Call Extension",
5
- "version": "0.1.3",
5
+ "version": "0.1.5",
6
6
  "description": "Twilio telephony provider for voice calls — supports outbound/inbound calls, TwiML, media streams, and bidirectional audio.",
7
7
  "categories": ["voice", "telephony"],
8
8
  "platforms": ["twilio"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos-ext-voice-twilio",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Twilio voice call provider for AgentOS — outbound/inbound calls via Twilio REST API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "name": "Framers AI",
17
17
  "url": "https://frame.dev"
18
18
  },
19
- "license": "MIT",
19
+ "license": "Apache-2.0",
20
20
  "files": [
21
21
  "dist",
22
22
  "manifest.json"
@@ -31,7 +31,7 @@
31
31
  "@types/node": "^20.0.0",
32
32
  "typescript": "^5.0.0",
33
33
  "vitest": "^3.2.7",
34
- "@framers/agentos": "^0.10.40"
34
+ "@framers/agentos": "^0.13.47"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=22"