Skip to content

toolmark-monorepo / @toolmark/core / WizardToolOptions

Interface: WizardToolOptions ​

Defined in: packages/core/src/wizard/wizard-tools.ts:77

Options for createWizardTools (spec §8.2, D25).

Properties ​

currentAdapter? ​

optional currentAdapter?: () => FormAdapter<Record<string, unknown>> | undefined

Defined in: packages/core/src/wizard/wizard-tools.ts:98

The mounted form of the current step, if any. When present, the current step is read from it and written through it (dirty-aware), so the visible form updates and keeps the user's edits.

Returns ​

FormAdapter<Record<string, unknown>> | undefined


description ​

description: string

Defined in: packages/core/src/wizard/wizard-tools.ts:81

LLM-facing description of the wizard.


name ​

name: string

Defined in: packages/core/src/wizard/wizard-tools.ts:79

Tool name prefix: registers <name>.fill, <name>.goTo, <name>.submit (+ .options).


resetCurrent? ​

optional resetCurrent?: (values) => void

Defined in: packages/core/src/wizard/wizard-tools.ts:103

Called with the current step's merged values after a fill (or undo) wrote them into parent data because no step adapter is mounted, so the app can reset the visible step form.

Parameters ​

values ​

Record<string, unknown>

Returns ​

void


steps ​

steps: WizardStep[]

Defined in: packages/core/src/wizard/wizard-tools.ts:85

The steps, in order. Empty or duplicate names → wizard_misconfigured.


submitSummary? ​

optional submitSummary?: (data) => string

Defined in: packages/core/src/wizard/wizard-tools.ts:112

User-facing submit confirmation summary (default "Submit <title ?? name>"). Receives a copy of the parent data in which the current step is replaced by its live values (the mounted step form's values when WizardToolOptions.currentAdapter returns one), so edits the user made on the visible step but not yet synced into parent data are shown in the confirmation.

Parameters ​

data ​

Record<string, Record<string, unknown>>

Returns ​

string


title? ​

optional title?: string

Defined in: packages/core/src/wizard/wizard-tools.ts:83

User-facing title (used in the submit confirmation summary).

Methods ​

getCurrent() ​

getCurrent(): string

Defined in: packages/core/src/wizard/wizard-tools.ts:91

Name of the current step.

Returns ​

string


getData() ​

getData(): Record<string, Record<string, unknown>>

Defined in: packages/core/src/wizard/wizard-tools.ts:87

The parent's source of truth: one values object per step name.

Returns ​

Record<string, Record<string, unknown>>


goTo() ​

goTo(step): void

Defined in: packages/core/src/wizard/wizard-tools.ts:93

Navigates to a step (<name>.goTo).

Parameters ​

step ​

string

Returns ​

void


setData() ​

setData(next): void

Defined in: packages/core/src/wizard/wizard-tools.ts:89

Replaces the parent data (called at most once per fill / undo).

Parameters ​

next ​

Record<string, Record<string, unknown>>

Returns ​

void


submit() ​

submit(): Promise<ToolResult<unknown>>

Defined in: packages/core/src/wizard/wizard-tools.ts:105

Submits the wizard (<name>.submit, consequential, after every step validated).

Returns ​

Promise<ToolResult<unknown>>