Skip to content

waygraph / AutoSession

Class: AutoSession ​

Defined in: src/live/auto-session/auto-session.ts:43

A live session driven over IPC (browser start, pilot start): the same graph, library, mem and browser as waygraph auto, moved one call at a time (applyPick, applyPath, the raw actions) instead of a menu loop.

Accessors ​

where ​

Get Signature ​

get where(): string | null

Defined in: src/live/auto-session/auto-session.ts:193

The Checkpoint the session is at, if known.

Returns ​

string | null

Methods ​

applyHighlight() ​

applyHighlight(fixtures): Promise<{ missing: string[]; ok: true; painted: number; snapshot: SessionSnapshot; } | { error: string; ok: false; }>

Defined in: src/live/auto-session/auto-session.ts:423

Agent-sent highlight fixtures (rings + optional todos) on the live page - the Pilot equivalent of Block stubBefore narration in waygraph demo. Does not run a Block; paint-only. Missing selectors are reported, not fatal.

Parameters ​

fixtures ​

PilotHighlightFixtures

Returns ​

Promise<{ missing: string[]; ok: true; painted: number; snapshot: SessionSnapshot; } | { error: string; ok: false; }>


applyPath() ​

applyPath(targetCheckpoint): Promise<ApplyPathResult>

Defined in: src/live/auto-session/auto-session.ts:454

Runs a whole route to targetCheckpoint in one call, instead of one applyPick per step. The path is computed once with findBlockPathDetailed (the BFS auto --blocks <From> <To> uses) and each hop's Block runs directly on the session's live page and mem, trusting the graph rather than live-menu visibility. Per-step choosing was tried and fails: a from: "*" edge looks reachable from anywhere to a static BFS. A step whose precondition isn't met fails loud, naming it; so does a step that runs but lands somewhere other than its edge promised.

Parameters ​

targetCheckpoint ​

string

Returns ​

Promise<ApplyPathResult>


applyPick() ​

applyPick(raw): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:298

Applies exactly one pick: runs at most one Block, returns the resulting state.

Parameters ​

raw ​

string

Returns ​

Promise<ApplyPickResult>


close() ​

close(): Promise<void>

Defined in: src/live/auto-session/auto-session.ts:490

Returns ​

Promise<void>


currentSnapshot() ​

currentSnapshot(): Promise<SessionSnapshot>

Defined in: src/live/auto-session/auto-session.ts:196

Pure getter - no Block runs, no mem/page mutation.

Returns ​

Promise<SessionSnapshot>


getConsoleLog() ​

getConsoleLog(): ConsoleLogEntry[]

Defined in: src/live/auto-session/auto-session.ts:129

Pure getter - returns a copy, not the live array.

Returns ​

ConsoleLogEntry[]


getTrace() ​

getTrace(): TraceStep[]

Defined in: src/live/auto-session/auto-session.ts:119

Pure getter - returns a copy, not the live array.

Returns ​

TraceStep[]


inspectDom() ​

inspectDom(opts): Promise<InspectDomResult>

Defined in: src/live/auto-session/auto-session.ts:222

Pure getter - reads the live page's structure at the requested fidelity. No Block runs, no mem/page mutation. selector scopes either mode to one element's subtree; it is a modifier, not a third mode.

Parameters ​

opts ​

InspectDomOptions

Returns ​

Promise<InspectDomResult>


inspectStorage() ​

inspectStorage(): Promise<StorageSnapshot>

Defined in: src/live/auto-session/auto-session.ts:228

Reads the live page's client state: storage, cookies, service workers (where web-push state lives).

Returns ​

Promise<StorageSnapshot>


rawClick() ​

rawClick(selector): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:356

Raw actions for a page no Block covers yet (Blind Pilot). The Checkpoint they land on isn't known ahead, so each one forgets here and the next menu re-detects it. A selector that matches nothing is a reported failure.

Parameters ​

selector ​

string

Returns ​

Promise<ApplyPickResult>


rawGoto() ​

rawGoto(url): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:381

Parameters ​

url ​

string

Returns ​

Promise<ApplyPickResult>


rawPress() ​

rawPress(selector, key): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:373

Presses a key on an element (Enter, Escape, ...): inline-edit inputs often commit on Enter, with no Save button.

Parameters ​

selector ​

string

key ​

string

Returns ​

Promise<ApplyPickResult>


rawType() ​

rawType(selector, text): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:364

Parameters ​

selector ​

string

text ​

string

Returns ​

Promise<ApplyPickResult>


rawUpload() ​

rawUpload(selector, stub): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:392

Fills an <input type="file"> with a built-in stub file ("image", "pdf", "video") or a filePath of your own.

Parameters ​

selector ​

string

stub ​

StubFileKind | { filePath: string; }

Returns ​

Promise<ApplyPickResult>


read() ​

read(path?, list?): Promise<SessionRead>

Defined in: src/live/auto-session/auto-session.ts:212

Pure getter - what the page shows, from the project's Read Blocks.

Parameters ​

path? ​

string

list? ​

ListPick

Returns ​

Promise<SessionRead>


registerSelector() ​

registerSelector(page, key, selector): RegisterResponse

Defined in: src/live/auto-session/auto-session.ts:185

Writes a selector a person picked into the page's _sel.ts, so a Block can use it.

Parameters ​

page ​

string

key ​

string

selector ​

string

Returns ​

RegisterResponse


reloadLibrary() ​

reloadLibrary(): Promise<void>

Defined in: src/live/auto-session/auto-session.ts:323

Re-reads the project's Blocks and graph from disk (the same call start() makes) and swaps them in, keeping the page, mem, browser and here: a Block written mid-session becomes pickable without a restart.

Returns ​

Promise<void>


resync() ​

resync(): Promise<ApplyPickResult>

Defined in: src/live/auto-session/auto-session.ts:342

Re-detects here from the live page, whatever is cached. here only changes when this session acts; a person clicking in a visible session moves the page without it, and later send / reach calls would use a stale menu.

Returns ​

Promise<ApplyPickResult>


setCoverage() ​

setCoverage(on): Promise<CoverageResponse>

Defined in: src/live/auto-session/auto-session.ts:188

The coverage outlines on or off (visible sessions).

Parameters ​

on ​

boolean

Returns ​

Promise<CoverageResponse>


setData() ​

setData(data): string | undefined

Defined in: src/live/auto-session/auto-session.ts:207

Sets keys for the steps that follow (--data on send / reach); an error when a name is no Block's key.

Parameters ​

data ​

Record<string, unknown>

Returns ​

string | undefined


start() ​

static start(init): Promise<AutoSession>

Defined in: src/live/auto-session/auto-session.ts:69

Parameters ​

init ​

AutoSessionInit

Returns ​

Promise<AutoSession>

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed