@framers/agentos-ext-voice-plivo 0.1.4 → 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 +86 -0
- package/manifest.json +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Plivo voice calls
|
|
2
|
+
|
|
3
|
+
This pack gives an agent a phone call management tool and registers a voice call provider. It uses the `plivo` SDK for outbound calls, in-call speech and hangup, and parses Plivo webhooks into AgentOS call events.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @framers/agentos-ext-voice-plivo
|
|
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-plivo',
|
|
23
|
+
options: {
|
|
24
|
+
authId: process.env.PLIVO_AUTH_ID,
|
|
25
|
+
authToken: process.env.PLIVO_AUTH_TOKEN,
|
|
26
|
+
fromNumber: process.env.PLIVO_FROM_NUMBER ?? process.env.PLIVO_PHONE_NUMBER,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Supply an existing AgentOS `CallManager` through `options.callManager` to enable the tool's call operations. The example registers the provider with the fallback tool handler.
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Credentials resolve from a nonempty direct option, then `options.secrets`, then the selected environment variable, then the fixed fallbacks in the order shown. The manifest requires `plivo.authId` and `plivo.authToken`; the factory also requires a caller number.
|
|
39
|
+
|
|
40
|
+
| Option | Secret id | Environment variable | Required | Default |
|
|
41
|
+
| --- | --- | --- | --- | --- |
|
|
42
|
+
| `authId` | `plivo.authId` | Name selected by `authIdEnv` (default `PLIVO_AUTH_ID`), then `PLIVO_AUTH_ID` | Yes | None |
|
|
43
|
+
| `authToken` | `plivo.authToken` | Name selected by `authTokenEnv` (default `PLIVO_AUTH_TOKEN`), then `PLIVO_AUTH_TOKEN` | Yes | None |
|
|
44
|
+
| `fromNumber` | `plivo.fromNumber` | Name selected by `fromNumberEnv` (default `PLIVO_FROM_NUMBER`), then `PLIVO_FROM_NUMBER`, then `PLIVO_PHONE_NUMBER` | Yes | None |
|
|
45
|
+
| `authIdEnv` | None | None | No | `PLIVO_AUTH_ID` |
|
|
46
|
+
| `authTokenEnv` | None | None | No | `PLIVO_AUTH_TOKEN` |
|
|
47
|
+
| `fromNumberEnv` | None | None | No | `PLIVO_FROM_NUMBER` |
|
|
48
|
+
| `secrets` | `plivo.authId`, `plivo.authToken`, `plivo.fromNumber` | None | No | Unset |
|
|
49
|
+
| `callManager` | None | None | No | Fallback handler |
|
|
50
|
+
| `priority` | None | None | No | `50` |
|
|
51
|
+
| `logger` (context field) | None | None | No | Unset |
|
|
52
|
+
| No option, webhook verification | None | `NODE_ENV`, then `PLIVO_SKIP_SIGNATURE` | No | Unset |
|
|
53
|
+
|
|
54
|
+
When signature headers are missing, `NODE_ENV` equal to `development` or `PLIVO_SKIP_SIGNATURE` equal to `true` allows the webhook. These variables do not bypass a signature mismatch when headers are present.
|
|
55
|
+
|
|
56
|
+
## Tools
|
|
57
|
+
|
|
58
|
+
| Tool | What it does |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `plivoVoiceCall` | Makes outbound calls, plays speech into calls, hangs up calls, queries call status and lists active calls. |
|
|
61
|
+
|
|
62
|
+
Parameters for `plivoVoiceCall`:
|
|
63
|
+
|
|
64
|
+
| Parameter | Type | Required | Description |
|
|
65
|
+
| --- | --- | --- | --- |
|
|
66
|
+
| `action` | string, enum: `call`, `speak`, `hangup`, `status`, `list` | Yes | The voice call action to perform. |
|
|
67
|
+
| `toNumber` | string | No | E.164 phone number to call (required for "call" action). |
|
|
68
|
+
| `callId` | string | No | Call ID (required for "speak", "hangup", "status" actions). |
|
|
69
|
+
| `message` | string | No | Text to speak. For "call" in notify mode, this is the message. For "speak", this is played into the active call. |
|
|
70
|
+
| `mode` | string, enum: `notify`, `conversation` | No | Call mode (default: "conversation"). "notify" speaks a message and hangs up. |
|
|
71
|
+
|
|
72
|
+
The schema requires `action`. The tool's validation and execution also require `toNumber` for `call`, `callId` for `speak`, `hangup` and `status`, and `message` for `speak`.
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
|
|
76
|
+
The package requires Node `>=22`. Plivo authentication credentials and an E.164 caller number are needed. Missing required settings cause the factory to throw an error naming the option, secret and primary environment variable.
|
|
77
|
+
|
|
78
|
+
Activation initializes the SDK client and registers the `plivo` voice provider with the supplied `CallManager`. Deactivation clears the service's client reference. Without a `CallManager`, call, speech and hangup operations return errors; status reports no matching call and list returns an empty collection.
|
|
79
|
+
|
|
80
|
+
The tool has side effects: it places calls, speaks into active calls and terminates calls. Its default call mode is `conversation`. The service's default speech voice is `Polly.Joanna`. Notify XML speaks a message then hangs up. Conversation XML uses speech input, sets `GetInput`'s `executionTimeout` to `30`, and redirects to the webhook URL. The provider generates answer XML during call initiation but does not store or serve it. The hosting application must expose a public answer endpoint that returns the XML. The answer URL appends `callId` and `mode` query parameters and uses POST.
|
|
81
|
+
|
|
82
|
+
Webhook parsing accepts a pre-parsed body, JSON or form-encoded data. A payload without `CallUUID` produces no call events. `Speech` produces a final transcript; call statuses and hangup causes map to call state events. `Digits` is declared but is not emitted as an event. Verification uses HMAC with `sha256` over the request URL plus nonce, authenticated with the resolved token.
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
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.plivo",
|
|
4
4
|
"name": "Plivo Voice Provider Extension",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.5",
|
|
6
6
|
"description": "Plivo telephony provider for voice calls — supports outbound/inbound calls, XML response generation, notify and conversation modes.",
|
|
7
7
|
"categories": ["voice", "telephony"],
|
|
8
8
|
"platforms": ["plivo"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framers/agentos-ext-voice-plivo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Plivo voice call provider for AgentOS — outbound/inbound calls via Plivo Voice API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/node": "^20.0.0",
|
|
31
31
|
"typescript": "^5.0.0",
|
|
32
32
|
"vitest": "^3.2.7",
|
|
33
|
-
"@framers/agentos": "^0.13.
|
|
33
|
+
"@framers/agentos": "^0.13.47"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=22"
|