DevToolsComponent
The Dev tools section as a Milpa Component: the ledgers the house already writes, read — the agent's sessions with their state and real token cost, the debt signals by kind, the evidence ledger and the declared log's tail; or, when the section's query names a session, that session's timeline. The one prop it reads is `query` — the request's query params the shell hands every active section — and the one key it looks at is `session`: set, the mounted state carries the drill-down (`view: session`); absent, the overview (`view: overview`). The STATE THAT TRAVELS is only `{view, session}` ({@see self::envelope()}): the ledgers are a projection re-read on every mount, never signed and sent back to the browser — an envelope with a thousand rows would be a second copy of the ledger with a signature on it. Read-only in both views: it declares no action and refuses every one, because every mutation of the house is a governed operation, never a button here (greenhouse decisions/0205).
DevToolsComponent::__construct()
public function __construct(Milpa\Admin\Data\DevToolsSource $source):Parameters
| Name | Type | Description |
|---|---|---|
| $source | Milpa\Admin\Data\DevToolsSource |
DevToolsComponent::contract()
public static function contract(): Milpa\Live\ValueObjects\ComponentContractThe contract: the request's `query` as its one prop; the state that travels is `{view, session}`; no actions.
DevToolsComponent::mount()
public function mount(array $props, Milpa\Live\ValueObjects\ComponentContext $context): Milpa\Live\ValueObjects\StateSnapshotMounts with the overview, or with one session's timeline when `query.session` names it. The mounted data carries the whole projection for the renderer; what travels is {@see self::envelope()}.
Parameters
| Name | Type | Description |
|---|---|---|
| $props | array | |
| $context | Milpa\Live\ValueObjects\ComponentContext |
DevToolsComponent::handle()
public function handle(Milpa\Live\ValueObjects\InteractionRequest $request): Milpa\Live\ValueObjects\InteractionResultRefuses every action: the section reads; it never acts.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Milpa\Live\ValueObjects\InteractionRequest |
DevToolsComponent::envelope()
public static function envelope(Milpa\Live\ValueObjects\StateSnapshot $state): Milpa\Live\ValueObjects\StateSnapshotThe state that travels in the signed envelope: `{view, session}` and nothing else — the two facts a re-mount needs ({@see self::propsOf()}), never the rows, the log or the evidence.
Parameters
| Name | Type | Description |
|---|---|---|
| $state | Milpa\Live\ValueObjects\StateSnapshot |
DevToolsComponent::travels()
public static function travels(Milpa\Live\ValueObjects\StateSnapshot $state): boolWhether a state is the travelling envelope — `{view, session}` and nothing else — as opposed to a mounted state that carries the projection to paint.
Parameters
| Name | Type | Description |
|---|---|---|
| $state | Milpa\Live\ValueObjects\StateSnapshot |
DevToolsComponent::propsOf()
public static function propsOf(Milpa\Live\ValueObjects\StateSnapshot $carried): arrayThe props that re-mount the page a carried envelope names — so a renderer handed the travelling `{view, session}` reads the ledgers again instead of painting an envelope that holds none.
Parameters
| Name | Type | Description |
|---|---|---|
| $carried | Milpa\Live\ValueObjects\StateSnapshot |