/agents/<name>/<conversation>/rpc/<method> calls one method on the conversation’s instance. mountAgents resolves the address to the instance and hands the POST to the class’s fetch(), and only a method marked @rpc answers. Who may call is decided by authorize(), which The Streams shows with fetch. The class marks five methods.
receive()
invoke, chat and rpc … receive post ["text"] to …/rpc/receive:
lastReply, which is what invoke waits for. It is never sent out on a channel. key makes a redelivered message a no-op, answered with duplicate: true. Admit is the next step.
receive carries @rpc, as @rpc({ description: "Deliver one inbound message; the reply is produced off the request path" }).
- Only a method that carries it dispatches over the mount. Every other method of the class is private there.
descriptionis whatrpcSurface()reports for the method.
Approvals and Runs
approve, deny, inspectApproval, pendingApproval and run are reached the same way, and through telnyx-acp rpc:
ask continues on its own task once approve grants its approval. pendingApproval names the approval a paused run waits on, read from the ledger on that later call; telnyx-acp invoke asks for it when the state stream has not named it.
approvals.grant(), approvals.deny() and approvals.inspect() are the harness’s approvals ledger, and get(runId) is the harness’s get().
approvalIdnames an approval, and each of the three returns itsHarnessApproval.deny()also continues the run. The call is not executed, and the model is told it was denied.- Each of the three is checked against the authorization port for its required action. The constructor registers that port from the host’s
authorization, as The Harness shows. runIdnames a run, andget()returns itsHarnessRun, orundefinedfor an unknown id.- Each method calls
ready()first, so the runs a restart interrupted are recovered before anything is read or decided.