@framers/agentos-ext-voice-plivo

中文文档
0.2.3发布于 2026/11/11Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 2万

Plivo voice call provider for AgentOS — outbound/inbound calls via Plivo Voice API

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. Configuration
  4. Tools
  5. Notes
  6. Host call manager binding
  7. Releases
  8. License

Plivo voice calls

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.

Installation

npm install @framers/agentos-ext-voice-plivo

Peer dependency: @framers/agentos, at the minimum version declared by this package.

Usage

import { AgentOS } from '@framers/agentos';

const agentos = await AgentOS.create({
  extensionManifest: {
    packs: [
      {
        package: '@framers/agentos-ext-voice-plivo',
        options: {
          authId: process.env.PLIVO_AUTH_ID,
          authToken: process.env.PLIVO_AUTH_TOKEN,
          fromNumber: process.env.PLIVO_FROM_NUMBER ?? process.env.PLIVO_PHONE_NUMBER,
        },
      },
    ],
  },
});

Supply options.callManager to use a host-owned manager. Otherwise the example creates an exposed pack-owned manager.

Configuration

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.

OptionSecret idEnvironment variableRequiredDefault
authIdplivo.authIdName selected by authIdEnv (default PLIVO_AUTH_ID), then PLIVO_AUTH_IDYesNone
authTokenplivo.authTokenName selected by authTokenEnv (default PLIVO_AUTH_TOKEN), then PLIVO_AUTH_TOKENYesNone
fromNumberplivo.fromNumberName selected by fromNumberEnv (default PLIVO_FROM_NUMBER), then PLIVO_FROM_NUMBER, then PLIVO_PHONE_NUMBERYesNone
authIdEnvNoneNoneNoPLIVO_AUTH_ID
authTokenEnvNoneNoneNoPLIVO_AUTH_TOKEN
fromNumberEnvNoneNoneNoPLIVO_FROM_NUMBER
secretsplivo.authId, plivo.authToken, plivo.fromNumberNoneNoUnset
callManagerNoneNoneNoExposed pack-owned manager
priorityNoneNoneNo50
logger (context field)NoneNoneNoUnset
No option, webhook verificationNoneNODE_ENV, then PLIVO_SKIP_SIGNATURENoUnset

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.

Tools

ToolWhat it does
plivoVoiceCallMakes outbound calls, plays speech into calls, hangs up calls, queries call status and lists active calls.

Parameters for plivoVoiceCall:

ParameterTypeRequiredDescription
actionstring, enum: call, speak, hangup, status, listYesThe voice call action to perform.
toNumberstringNoE.164 phone number to call (required for "call" action).
callIdstringNoCall ID (required for "speak", "hangup", "status" actions).
messagestringNoText to speak. For "call" in notify mode, this is the message. For "speak", this is played into the active call.
modestring, enum: notify, conversationNoCall mode (default: "conversation"). "notify" speaks a message and hangs up.

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.

Notes

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.

Construction registers the provider on the selected manager. Activation initializes the SDK client. Deactivation disposes only the original pack-owned manager and clears the service client reference.

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.

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.

Host call manager binding

The existing options.callManager is now exposed through the returned pack's binding.manager. The registered call tool uses that binding. binding.setManager(next) registers the provider on the replacement and changes subsequent tool operations; the host must drain or transfer active calls before doing so. Binding replacement does not migrate call state.

The voice-provider descriptor remains the raw Plivo provider and carries a read-only binding property for registry consumers. With no injected manager, construction creates an accessible pack-owned manager and places no call. Deactivation disposes only that original owned manager. Injected and replacement managers remain host-owned.

This binding does not change the pack's legacy answer XML, callback identities or signature behavior. Select the core carrier profile explicitly for durable carrier guarantees. The declared core peer floor is required for the binding API.

Releases

New versions are published from framerslab/agentos-extensions by GitHub Actions through npm trusted publishing, with a provenance statement.

License

Apache-2.0

版本与发布记录

@framers/agentos-ext-voice-plivo 共发布 10 个版本,首次发布于 2026/02/08;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.3latest2026/11/114 天前
0.2.22026/11/0114 天前
0.2.12026/11/0115 天前
0.2.02026/10/151 个月前
0.1.52026/10/121 个月前
0.1.42026/10/111 个月前

关于 @framers/agentos-ext-voice-plivo 的常见问题

@framers/agentos-ext-voice-plivo 是什么?

Plivo voice call provider for AgentOS — outbound/inbound calls via Plivo Voice API

如何安装 @framers/agentos-ext-voice-plivo?

在项目目录运行 npm install @framers/agentos-ext-voice-plivo,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@framers/agentos(>=0.13.104)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@framers/agentos-ext-voice-plivo 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@framers/agentos-ext-voice-plivo 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@framers/agentos-ext-voice-plivo 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@framers/agentos-ext-voice-plivo 可以商用吗?

@framers/agentos-ext-voice-plivo 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@framers/agentos-ext-voice-plivo 的下载量有多少?

根据 npm 官方下载统计,@framers/agentos-ext-voice-plivo 在 2026/10/16 – 2026/11/14 这 30 天内被下载 20,196 次,日均约 673 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@framers/agentos-ext-voice-plivo 还在维护吗?

最新版本 0.2.3 发布于 2026/11/11(4 天前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/02/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。