Interface: AgentApprovalEngine
@roomful/core / AgentApprovalEngine
Interface: AgentApprovalEngine
Section titled “Interface: AgentApprovalEngine”Defined in: packages/core/src/types.ts:2012
A room’s agent-approval workflow: agents propose actions, humans approve/reject them, and
every peer sees the synced proposal list. The proposer watches for the decision and applies (or
rolls back) the action, so nothing an agent proposes commits without a human in the loop.
Methods
Section titled “Methods”approve()
Section titled “approve()”approve(
id):void
Defined in: packages/core/src/types.ts:2026
Approves a pending proposal (if permitted) and broadcasts the decision.
Parameters
Section titled “Parameters”string
The proposal id.
Returns
Section titled “Returns”void
getPending()
Section titled “getPending()”getPending():
AgentProposal[]
Defined in: packages/core/src/types.ts:2047
Returns the proposals still awaiting a decision, newest first.
Returns
Section titled “Returns”The pending proposals.
getProposals()
Section titled “getProposals()”getProposals():
AgentProposal[]
Defined in: packages/core/src/types.ts:2040
Returns every proposal, newest first.
Returns
Section titled “Returns”The proposals.
propose()
Section titled “propose()”propose(
input):AgentProposal
Defined in: packages/core/src/types.ts:2019
Proposes an action for approval and broadcasts it to peers as pending.
Parameters
Section titled “Parameters”The action type and optional payload.
payload?
Section titled “payload?”unknown
string
Returns
Section titled “Returns”The created proposal.
reject()
Section titled “reject()”reject(
id):void
Defined in: packages/core/src/types.ts:2033
Rejects a pending proposal (if permitted) and broadcasts the decision.
Parameters
Section titled “Parameters”string
The proposal id.
Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”subscribe(
callback):Unsubscribe
Defined in: packages/core/src/types.ts:2055
Subscribes to proposal changes; fires immediately with the current list, then on every change.
Parameters
Section titled “Parameters”callback
Section titled “callback”(proposals) => void
The callback invoked with the latest proposals.
Returns
Section titled “Returns”A function that removes the listener.