Skip to content

workflow-step-ctx

Workflow-step context helpers.

Workflow skills cross a devalue serialization boundary every time the workflow body calls a step. The live page / renderer host-bridge proxies can't survive that hop, so each step needs to re-acquire them locally by reading globalThis.__mwHost (installed by the assistant's WorkflowSandbox / cloud equivalent).

This module centralizes that re-acquisition so skill authors don't have to maintain their own src/shared/host.ts. The useStepCtx helper is the one entry point step bodies need; getPage / getRenderer are exposed for the rare case where you want a single handle and not the full enriched context.

The companion piece is skill-scripts' workflow-prebuild: when a step is called directly by the workflow body, the prebuild auto-injects ctx = useStepCtx(ctx); at the start of that step's body so users don't have to write it themselves.

Functions

Matterway Assistant SDK Documentation