waygraph / Engine
Class: Engine<Label>
Defined in: src/engine/engine.ts:23
Holds engine-level configuration shared across every flow defined from it - for now, just how to launch a browser when a Flow owns its own (headless/browserName/slowMo); traits/interstitials/watchers land here in a later change.
Example
const engine = new Engine({ headless: false, slowMo: 250 });Type Parameters
Label
Label extends string = string
Constructors
Constructor
new Engine<
Label>(config?):Engine<Label>
Defined in: src/engine/engine.ts:25
How flows from this engine launch their own browser, and the defaults its flows take (memStub).
Parameters
config?
EngineConfig & object = {}
Returns
Engine<Label>
Properties
config
readonlyconfig:EngineConfig&object={}
Defined in: src/engine/engine.ts:25
Type Declaration
labels?
optionallabels?: readonly (Label| {name:Label; })[]
Methods
given()
given(
name,items):GivenGroup
Defined in: src/engine/engine.ts:34
A named list of preconditions, reused by every flow that needs them: given: [signedUpTenant]. It holds Given Blocks (or API Blocks, Methods, other groups); played in order, a Block named twice plays once. Shown in Studio by its name.
Parameters
name
string
items
readonly (SomeDefinedBlock | GivenGroup)[]
Returns
GivenGroup
Example
export const signedUpTenant = engine.given("signed-up-tenant", [SeedTenant, SeedProject]);map()
Call Signature
map<
P>(options):MapBuilder<Checkpoint<"__start__">,P["name"]>
Defined in: src/engine/engine.ts:54
Builds a flow, one kind-checked step at a time - see MapBuilder. Real, direct request this responds to: pia/zsign's own agents kept hand-editing/hand-composing Blocks into ad hoc shapes ("locks" convention tried, still got broken) - map() forces every step through this Engine's own define*Block factories (checked by the same __waygraphKind/__waygraphSalt runtime markers graph.ts/map-check.ts already trust), so a hand-rolled plain-object Block can never silently pass as a real navigation/assertion/method step. homeOrigin, if given, also gates .gotoPage()/.gotoExternal() against each Nav/Page Block's own static url (skipped, honestly, for click-based/dynamic nav - not statically checkable, same limitation map-check.ts already documents).
Type Parameters
P
P extends Pane<string>
Parameters
options
MapBuilderOptions<Label> & object
Returns
MapBuilder<Checkpoint<"__start__">, P["name"]>
Example
const flow = engine.map({ homeOrigin: "https://app.example.com" })
.gotoPage(NavHomeBlock)
.gotoExternal(NavMailpitBlock)Call Signature
map(
options?):MapBuilder<Checkpoint<"__start__">>
Defined in: src/engine/engine.ts:55
Builds a flow, one kind-checked step at a time - see MapBuilder. Real, direct request this responds to: pia/zsign's own agents kept hand-editing/hand-composing Blocks into ad hoc shapes ("locks" convention tried, still got broken) - map() forces every step through this Engine's own define*Block factories (checked by the same __waygraphKind/__waygraphSalt runtime markers graph.ts/map-check.ts already trust), so a hand-rolled plain-object Block can never silently pass as a real navigation/assertion/method step. homeOrigin, if given, also gates .gotoPage()/.gotoExternal() against each Nav/Page Block's own static url (skipped, honestly, for click-based/dynamic nav - not statically checkable, same limitation map-check.ts already documents).
Parameters
options?
MapBuilderOptions<Label>
Returns
MapBuilder<Checkpoint<"__start__">>
Example
const flow = engine.map({ homeOrigin: "https://app.example.com" })
.gotoPage(NavHomeBlock)
.gotoExternal(NavMailpitBlock)