Juncture Core
Core types and execution engine for the Juncture state machine framework. This crate provides the fundamental building blocks: State trait, Channel system, Pregel execution engine, and graph primitives.
Key Components
State System
Statetrait with#[derive(State)]proc-macroCowState<S>for copy-on-write state managementFieldsChangedbitmask for tracking state changes- Reducer semantics: Replace, Append, LastWriteWins, Any, Custom
Pregel Engine
- Multi-core parallel execution via
tokio::spawn+JoinSet - Bounded concurrency with
Semaphore - Field version tracking for deterministic execution
Graph Primitives
StateGraph<S,I,O>builderCompiledGraph<S,I,O>executionNode<S>trait andIntoNodeconversionsEdge,Router,PathMapfor graph topology
HITL Support
interrupt!()andinterrupt_with_ctx!()macrosResumeValuefor single/ID-based/namespace-based resumesScratchpadfor persistent interrupt context
Usage
use *;
// Build and compile a graph
let graph = new
.add_node
.add_edge
.add_edge
.compile;
Feature Flags
| Feature | Description |
|---|---|
multi-thread |
Tokio multi-thread runtime |
wasm |
WebAssembly support |
otel |
OpenTelemetry integration |
sqlite |
SQLite checkpoint storage |
postgres |
PostgreSQL checkpoint storage |
chat |
LLM provider support (reqwest) |
License
Licensed under Apache License, Version 2.0. See LICENSE for details.