Skip to content
docsv0.1.0

ProcessListPendingApprovalsTool

`process_list_pending_approvals` — a pure READ across every stream {@see EventStoreInterface} has ever seen (via {@see EventStoreInterface::streams()}): which ones are currently awaiting a human decision. Uses {@see HumanGate::pendingFor()} (never {@see HumanGate::openFor()}), so listing never appends a redundant `GateOpened` event — see that method's docblock. Returns each pending decision's mounted {@see \Milpa\Live\ValueObjects\StateSnapshot} data (`{component, data}`) rather than pre-rendered markup — turning a mounted `milpa/live` component into markup/TUI text is a separate {@see \Milpa\Live\Contracts\Rendering\ComponentRendererInterface}'s job this engine does not own (a consumer pairs its {@see \Milpa\Orchestrator\DecisionSurfaceInterface} implementation with a real renderer for that).

ProcessListPendingApprovalsTool::__construct()

public function __construct(Milpa\EventStore\EventStoreInterface $store, Milpa\Orchestrator\HumanGate $gate, Milpa\Orchestrator\ProcessDefinitionRegistry $registry):

Parameters

Parameters of __construct()
NameTypeDescription
$storeMilpa\EventStore\EventStoreInterface
$gateMilpa\Orchestrator\HumanGate
$registryMilpa\Orchestrator\ProcessDefinitionRegistry

ProcessListPendingApprovalsTool::list()

public function list(?string $assignee = null): Milpa\ToolRuntime\ToolResult

Lists every process instance currently awaiting a human decision, optionally filtered by the gate's approver role.

Parameters

Parameters of list()
NameTypeDescription
$assignee?string

Returns

with data `{pending: list<array{instance_id: string, gate_id: string, assignee: string, options: list<string>, artifact: array{component: string, data: array<string,mixed>}}>}`