Skip to main content

praxo_core 0.8.2 copy "praxo_core: ^0.8.2" to clipboard
praxo_core: ^0.8.2 copied to clipboard

Embeddable MIT-licensed native Dart agent framework with tools, policy, events, tutorials, and an agent loop.

PRAXO-CORE Dart Core #

PRAXO-CORE is an embeddable, MIT-licensed agent framework. This package is its native Dart Core: an agent loop with tool registration and dispatch, policy hooks, typed events, memory, checkpoints, context budgets, middleware, OTel and Harmovela sinks, MCP, retriever and synchronous delegation seams, JSON Schema validation, and plugin manifest parsing. It runs in-process and does not require a hosted service.

The normative contract is spec/; Go remains the reference implementation.

  • SPEC_VERSION: 0.2.0
  • Core version: 0.8.2
  • Tier: core
  • License: MIT
  • Dependencies: Dart standard library only
  • Published on pub.dev as praxo_core@0.8.2; source is 0.8.2
  • Publishing setup: PUBLISHING.md

Install #

dart pub add praxo_core:0.8.2

Quickstart #

import 'package:praxo_core/praxo_core.dart';

void main() {
  final agent = Agent(AgentOptions(StaticModel('hello')));
  final result = agent.run(const Session(id: 'demo'), 'hello');
  print(result.output);
}

Tools register on the options object:

final registry = Registry();
registry.register(FuncTool('echo', 'Echo arguments', (arguments) => arguments));

final options = AgentOptions(StaticModel('hello'))
  ..tools = registry
  ..maxSteps = 8;

Examples #

The pub package ships a minimal example/ and links the full repository examples. Fifteen runnable themes live under language/dart/examples:

Example What it shows
consumer Deterministic model, one tool, allow/deny
live-model OpenAI-compatible endpoint and get_time
structured-output Schema validation and rejection
identity-policy Trusted principal and denial
service Transport-neutral request handler
checkpoint Allowlisted checkpoint round trip
session-checkpoint Multi-turn continuation
event-sink Sink fan-out and filtering
retry Bounded retry and exhausted failure
provider-fallback Primary/fallback selection
streaming Chunk accumulation
mcp MCP transport example
hitl Approval, edit, and reauthorization
representative-chain MCP record, delegation, OTel/Harmovela, denied edit
advanced-delegation Parent/child scope and six governance checks

These are deterministic local checks, not live-provider or production evidence.

Tutorials and Reference Applications #

Language-specific scenario tutorials and reference applications for Dart.

Scenario Tutorials #

Tutorial What it shows
audiobook-production A bounded first slice of MD-06, not an audio-production pipeline. It reads a fixed licensed book fixtur...
cbt-exercise A bounded first slice of HC-05, not a therapist or crisis service. It walks a fixed synthetic CBT exerc...
chronic-care A bounded first slice of HC-02, not a clinical decision system. It summarizes fixed synthetic wearable...
digital-twin-memory A bounded first slice of OG-06, not a personal memory hub. It stores one consent-scoped synthetic memor...
marketing-segments Fixed customer spend produces two high-value customers and a review-only campaign draft. No customer records, sends or live model.
meeting-coordination A bounded first slice of OP-02, not full multi-party scheduling or calendar control. It reads a fixed c...
onboarding-plan A bounded first slice of OP-06, not an HR or permissions system. It reads a fixed employee profile and...
travel-booking Fixed trip inventory produces a review-only fare hold. No payment, ticketing or inventory write.
waste-collection A bounded first slice of CT-06, not a fleet-dispatch system. It reads a fixed collection queue and draf...

Index: language/dart/Tutorial.

Reference Applications #

No accepted end-to-end reference application is recorded for this language yet. Candidate goals are tracked in the Reference Application Portfolio.

Planning context: Tutorial Plan, 100 candidate agent scenarios, and Tutorial Catalog. Chinese: 教程计划, 候选场景, 教程目录.

Registry and Coding-Agent Entry #

Scope #

The Core implements all eleven vector groups: toolcall, JSON Schema, plugin, memory, event, stream, checkpoint, policy, context, middleware, and the agent loop. It includes a public API snapshot and a dependency-free test runner.

Build and test #

dart run conformance/run.dart
python api-snapshot.py --check
dart run test/run.dart

Run from the dart/ directory, or use dart language/dart/conformance/run.dart from the repository root.

OpenAI-Compatible Adapter #

OpenAICompatibleModel maps Core requests to POST {baseUrl}/chat/completions, including messages, tools, tool choice, assistant tool calls, token usage, and provider HTTP errors (PROVIDER_HTTP). generateStream sets stream: true, parses SSE, reassembles content, fragmented tool calls, usage, and finish_reason, and invokes the delta callback. Inject streamTransport returning SSE text, or use the synchronous http transport. HTTPS streaming requires a caller-supplied transport; generateStreamAsync is not part of the synchronous Agent seam.

final model = OpenAICompatibleModel(
  baseUrl: 'https://api.example.com/v1',
  model: 'provider-model-id',
  apiKey: Platform.environment['API_KEY'],
);
final response = await model.generateAsync(const Request(messages: [
  Message.text(roleUser, 'hello'),
]));

generate is synchronous for the existing Model seam; inject a synchronous transport or use an http endpoint. generateAsync uses dart:io's HTTP client and supports https. Pass transport or asyncTransport in tests to avoid network calls.

Anthropic and Gemini Adapters #

AnthropicModel maps the native Messages API with generateStream SSE\nreassembly. GeminiModel maps generateContent APIs. Both provide synchronous and asynchronous generation, injectable transports, tool-call mapping, usage, and provider error handling.

final claude = AnthropicModel(
  model: 'claude-sonnet-4-5',
  apiKey: Platform.environment['ANTHROPIC_API_KEY'],
);
final gemini = GeminiModel(
  model: 'gemini-2.5-pro',
  apiKey: Platform.environment['GEMINI_API_KEY'],
);

MCP Client #

McpClient implements a stdio JSON-RPC MCP session with initialize, paginated tool listing, tool calls, timeouts, cancellation notifications, and a StdioMcpTransport backed by Process.start. Tests can implement McpTransport directly.

Harmovela Event Sink #

HarmovelaSink implements the native EventSink seam. It posts each event to POST {baseUrl}/events with the documented envelope. Supply transport to run without network access; it receives (baseUrl, path, body, headers) and returns a HarmovelaResponse. Supply clock to return (seconds, nanos) for deterministic ids and timestamps.

final sink = HarmovelaSink(
  baseUrl: 'http://127.0.0.1:8790/aep/api',
  source: 'praxo-core',
  specVersion: '0.2',
);
final options = AgentOptions(StaticModel('hello'))..events = sink;
final result = Agent(options).run(const Session(id: 'demo'), 'hello');

A 2xx status is success. Any other status throws PraxoError with code HARMOVELA_HTTP; a missing base URL throws HARMOVELA_URL. The synchronous default transport supports http only; inject a transport for https. The sink adds no authentication, retries, buffering, ordering, or exactly-once delivery. Use HTTPS and caller-side filtering for sensitive event data.

Process plugin host #

PluginProcessHost speaks the framework JSON-Lines process plugin protocol with token authentication, health handshake, invocation timeout, cooperative cancel, and typed call errors.

Layout #

  • lib/ package source.
  • conformance/run.dart vector runner.
  • api-snapshot.py and api/ public API snapshot.
  • test/run.dart test suite.

Release #

Tag shape: dart/v0.1.0. The tag targets SPEC_VERSION 0.2.0.

Community #

1
likes
160
points
1.22k
downloads

Documentation

API reference

Publisher

verified publisheraxisvela.com

Weekly Downloads

Embeddable MIT-licensed native Dart agent framework with tools, policy, events, tutorials, and an agent loop.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#agents #llm #framework

License

MIT (license)

More

Packages that depend on praxo_core