Expand description
wavekat-flow — the call-flow (“Receptionist”) document model for the
WaveKat voice platform.
The types in this crate are generated at build time from the
normative JSON Schema at schema/flow.v1.schema.json — the single
source of truth shared with the @wavekat/flow-schema npm package.
See build.rs.
Phase 2 (this milestone) adds the semantic validator (validate), the
hours/timezone math (hours), and the interpreter (engine + its
trace output) alongside the generated model, adapted to the generated
types and pinned by the shared conformance corpus. The engine owns the
engine::FlowEffects trait definition; the daemon keeps its live impl
in its own codebase. Comment-preserving mutation stays TS-only.
Re-exports§
pub use model::*;
Modules§
- engine
- The flow interpreter — doc 48’s “the daemon runs the flow”.
- hours
- Evaluation of the
hoursnode’s schedule — the one v1 component with real branching logic, kept pure so it is directly unit-testable (feed a fixed instant, assert open/closed) without a call or a clock. The TypeScript twin ispackages/flow-schema/src/hours.ts; a config is valid on one side iff it is on the other (pinned by the conformance corpus). - model
- The generated document model (
Flow,Node,Prompt, …), emitted from the schema bytypifyintoOUT_DIR/flow_types.rs. - trace
- What a flow run did — the trace (doc 48 “Traces: what the flow did,
visible everywhere”). The engine appends one
TraceStepper node it executes and ends with aFlowOutcome. The daemon maps this to call events (a flow timeline in Call details) and to the push uploader that syncs it to the platform; the editor later overlays step counts on the flow diagram. - validate
- Publish-time / load-time validation — the gate that keeps a bad document
from ever becoming a live phone line (doc 48). The platform runs the same
checks before publish (
packages/flow-schema/src/validate.ts); the daemon re-runs them on load so a corrupted cache or a version mismatch fails safe rather than executing undefined behavior. Every rule here has a TypeScript twin, and both are pinned by the shared conformance corpus.
Constants§
- FLOW_
V1_ SCHEMA - The normative JSON Schema (draft 2020-12) as a string, bundled so
consumers can run structural validation without reaching outside the
crate. The crate-local copy is synced from the repo-root schema by
build.rs(and is what ships in the published package). - SUPPORTED_
SCHEMA_ VERSIONS - Schema versions this crate’s model describes. Twin:
packages/flow-schema/src/model.tsSUPPORTED_SCHEMA_VERSIONS.
Type Aliases§
- NodeId
- A node’s key within a flow. Human-meaningful (
night_menu, notn7).