ProcessInstantiateTool
`process_instantiate` — starts a new process instance from a named process definition (resolved through the injected {@see ProcessDefinitionRegistry}) and auto-advances it (via {@see ProcessRunner}) up to its first human decision point or terminal state. `inputs` is declared `array` with `#[Param(type: 'object')]` (tool-runtime 0.6): the wire value arrives as a plain associative PHP array (the host's JSON decode already produced it), so no manual `json_decode()` is needed in this method body — see {@see Param}'s own docblock for why a bare `array $inputs` (without the `type: 'object'` override) would infer JSON-Schema `type: array` instead, rejecting an associative payload like `{"post_id": 1}`.
ProcessInstantiateTool::__construct()
public function __construct(Milpa\EventStore\EventStoreInterface $store, Milpa\Orchestrator\HumanGate $gate, Milpa\Orchestrator\ProcessRunner $runner, Milpa\Orchestrator\ProcessDefinitionRegistry $registry):Parameters
| Name | Type | Description |
|---|---|---|
| $store | Milpa\EventStore\EventStoreInterface | |
| $gate | Milpa\Orchestrator\HumanGate | |
| $runner | Milpa\Orchestrator\ProcessRunner | |
| $registry | Milpa\Orchestrator\ProcessDefinitionRegistry |
ProcessInstantiateTool::setCurrentContext()
public function setCurrentContext(Milpa\ToolRuntime\Contracts\ToolContext $ctx): voidCaptures the calling {@see ToolContext} — the tool scanner injects it when this method exists.
Parameters
| Name | Type | Description |
|---|---|---|
| $ctx | Milpa\ToolRuntime\Contracts\ToolContext |
ProcessInstantiateTool::instantiate()
public function instantiate(string $definition, array $inputs): Milpa\ToolRuntime\ToolResultStarts `$definition` with `$inputs` and auto-advances it to its first gate or terminal state.
Parameters
| Name | Type | Description |
|---|---|---|
| $definition | string | |
| $inputs | array<string, mixed> |
Returns
with data `{instance_id: string, current_state: string}` on success