Skip to main content

shared-action

A framework-agnostic system for registering, sequencing, and executing actions and workflows — the shared substrate that lets kits define a named action once and run it anywhere, with confirmation prompts and step-driven flows layered on top.

Registry
named actions + workflows
Connector
state-manager agnostic
Flows
confirm + resolve steps
Registry

Named actions & workflows

Register an action handler or a multi-step workflow once, then look it up and execute it by id across modules.

registerActionregisterWorkflowexecuteWorkflow
Connector

State-manager agnostic

A connector interface and factory functions decouple action execution from any specific store, so the same actions run under different runtimes.

createActionExecutorcreateWorkflowDispatcher
Flows

Confirmation & resolution

Step-based confirmation flows and an action resolver render dialogs (confirm / input / select) before an action commits.

confirmationresolveraction-forms

What it provides

The kit centralises what an action is and how it runs. A registry holds action handlers and named workflows keyed by id; a connector layer (createActionExecutor, createSequenceExecutor, createWorkflowDispatcher) wires those handlers to whatever state manager the host app uses, keeping the action definitions free of store-specific code. On top of that sit the interactive pieces: an action-flow builder for composing flows visually, action-forms (confirmation / input / select-option dialogs), a confirmation flow + service with a global renderer, and an action resolver that drives multi-step resolution with its own pipeline and storage.

Key exports

ExportKindPurpose
registerAction / getActionHandlerfnRegister and look up a named action handler
registerWorkflow / getWorkflowfnRegister and look up a named multi-step workflow
executeWorkflowfnCore workflow runner (used by dispatchWorkflow)
createActionExecutorfactoryBuild an executor bound to a state-manager connector
createSequenceExecutorfactoryRun a sequence of actions in order
createWorkflowDispatcherfactoryDispatch a registered workflow by id
StateManagerConnector / ActionOptionstypeConnector contract + per-action options
initializeMedicalActions / initializeUIActionsfnSeed the registry with example medical / UI actions
registerFormActions / registerSampleWorkflowsfnRegister form-driven actions and sample workflows
initializeFormActionsfnConvenience: register form actions + sample workflows together
ActionFlowBuildercomponentVisual builder for composing action flows
GlobalConfirmationRenderercomponentApp-level renderer for the confirmation service
ConfirmationForm / InputForm / SelectOptionFormcomponentBuilt-in action-form dialogs
ActionResolverContainercomponentHost for the step-based action resolver

How it fits

register* ──▶ registry (actions + workflows, keyed by id)

create*Executor ──▶ connector ──▶ host state manager

flows: action-forms · confirmation-service · action-resolver


runs an action / workflow, with confirm + input steps

Used by: consumed by other frontend kits (it depends on ui-kit, medical-kit, and design-kit) to give them a shared, store-agnostic way to define and run named actions and confirmation flows.

See the Frontend overview for how kits compose, and medical-kit for a domain kit that builds on shared primitives.