v0.9.4
·
328 commits
to master
since this release
What's New in v0.9.4
Uniform Declarative Schema System
DeclarativeMetaclass— shared metaclass for all schema types withAnnotatedtype hint introspection- 6 schema types:
StateSchema,ToolSchema,CallbackSchema,PredicateSchema,PromptSchema,MiddlewareSchema - 5 annotation types:
Reads,Writes,Param,Confirms,Timeout PredicateSchemais callable — works directly withRoute.when()andS.guard()- Contract checker Pass 13 validates schema
reads_keysagainst upstream availability - Contract checker Pass 14 validates scoped middleware schemas at target agent position
Middleware v2: Mechanism-Level Redesign
TraceContext— per-invocation state bag flowing through all middleware hooks- Per-agent scoping —
agentsclass attribute with string, tuple, regex, or callable matching - Topology hooks —
on_loop_iteration,on_fanout_start/complete,on_route_selected,on_fallback_attempt,on_timeout - Controllable dispatch —
DispatchDirective(cancel=True)to skip dispatch tasks - Error boundary — middleware exceptions caught, logged, and reported via
on_middleware_error - Stream lifecycle —
on_stream_start,on_stream_end,on_backpressure - Built-in middleware —
TopologyLogMiddleware,LatencyMiddleware,CostTracker
M Module — Fluent Middleware Composition
Mclass — consistent withP,C,Scomposition surfaces|operator —M.retry(3) | M.log() | M.topology_log()M.scope()— restrict middleware to specific agentsM.when()— conditional middleware with string shortcuts, callables, orPredicateSchema- Single-hook shortcuts —
M.before_agent(),M.on_loop(),M.on_route(), etc.
MiddlewareSchema — Typed State Declarations for Middleware
MiddlewareSchemaclass withReads/Writesannotationsschemaclass attribute on middleware (parallel toagents)- Deferred evaluation in
_ConditionalMiddleware— guarded async wrappers instead of earlyNone M.when(PredicateSchema)— state-aware conditional middleware
Dispatch/Join/Stream Primitives
dispatch()andjoin()extracted as standalone primitive buildersStreamRunnerfor callback-driven execution with configurable concurrencySourceandInboxfor stream input management- Execution mode tracking via
get_execution_mode()
P Namespace — Composable Prompt System
P.system(),P.template(),P.conditional()— frozen, composable prompt transforms.when()conditionality unified acrossP,C,Smodules
Engineering
- Composable S transforms —
S.rename(),S.pick(),S.merge(),S.compute(),S.guard() - Copy-on-write frozen builders — thread-safe builder reuse
- Rich
.explain()output with data flow visualization - 85 commits since v0.9.3, 2062 tests passing