agentic_core 0.1.0
agentic_core: ^0.1.0 copied to clipboard
Foundation layer of the agentic framework for Dart and Flutter: immutable message and content models, JSON Schema, a structured error hierarchy, cancellation, retry and circuit-breaker policies, a typ [...]
Changelog #
0.1.0 #
Initial release of the foundation layer.
Added #
- Messaging —
Message,MessageRoleand a sealedContentParthierarchy covering text, reasoning, images, files, audio, tool calls and tool results.ConversationHistoryextensions for trimming and for finding unanswered tool calls.TokenUsagewith cache and reasoning accounting, and addition. - Schema —
JsonSchema, an immutable validating subset of JSON Schema matched to what LLM providers actually accept, with full-violation reporting,coercefor the near-misses models really produce, andtoStrict()for guaranteed structured output. - Errors —
AgenticExceptionand eighteen concrete failures, each with a stable code, anisRetryableanswer and JSON serialisation. Errors accumulateannotationsas they propagate. - Cancellation —
CancellationToken/CancellationTokenSourcewith callbacks, future racing, stream binding that closes the underlying socket, token merging and clock-driven deadlines. - Resilience —
RetryPolicywith budgets andRetry-Aftersupport;ExponentialBackoff,LinearBackoff,ConstantBackoffandFixedScheduleBackoffwith four jitter modes;CircuitBreakerwith a half-open probe phase. - Events —
AgenticEventandBroadcastEventBuswith bounded replay for late subscribers, typedon<T>()filtering and run-scoped selection. - Telemetry —
StructuredLoggerwith bound fields, child scopes and credential redaction by default;Tracerwith spans, events, sampling and pluggable exporters. - Primitives — web-safe monotonic
Ulid, injectableClock,DisposableandDisposableBag, checked JSON accessors,Result, typedRegistry. - Context —
AgenticContextbundling run identity, logger, bus, tracer, clock, IDs, cancellation and deadlines, with scoped derivation. - Testing —
package:agentic_core/testing.dartexportsFakeClock,SequentialIdGenerator,InMemoryLogSinkandInMemorySpanExporter.