Skip to main content
@telnyx/acp/managed exports the classes the CLI generates for a configuration project. A code-based agent extends them. Every class is a runtime SDK Agent, so this.messages, getState() and setState(), queue(), schedule(), @rpc methods and the rest of its API are there to use.

The Host

The second argument is what agent.json cannot say:

Approvals, End to End

A run that reaches a tool marked ask pauses, and the state records the paused run as awaitingApprovalRunId; invoke ends with a line naming that run instead of waiting. Under dev, the line also carries the approval’s id. A decision is one RPC on the conversation:
Under dev, approvals are authorized by a fixed local identity that allows every decision, and a paused run is printed with the rpc … --local approve <id> line to decide it. Deployed, a host that passes no authorization gets the loop’s built-in default: every decision is allowed, under the agent’s own identity (agent:<name>), so whoever the mount admits to rpc decides (everyone, in the beta phase). Pass authorization to require a real caller identity and policy; the harness itself refuses a run with an ask tool when no provider is registered at all.

What to Override

The loop keeps its six @rpc methods, receive, approve, deny, inspectApproval, pendingApproval and run. Methods without @rpc are private over the mount, which is how the webhook handler’s receiveVia (which names where a reply goes) is reachable in-process only.

The Voice Hooks

defineManagedVoiceAgent(spec) answers calls. Its hooks, all overridable: call.from and call.to are the numbers, call.callControlId the call. The Voice Loop shows how the class drives the mixin.

Dropping to the SDK

A class that extends the runtime SDK’s Agent directly, or voice(Agent), is also a valid entry. The CLI deploys any exported agent class and wires the declared channels to it, and the loop is left to the user. The webhook handlers then call receiveVia(text, from, key, via) on that class for a text and open the media socket to it for a call. A class of the user’s own implements them as the managed loop does, or as Bring Your Own Framework shows.