intentcall_core 0.6.0
intentcall_core: ^0.6.0 copied to clipboard
PRE-RELEASE — Transport-agnostic agent intent registry and runtime.
⚠️ Pre-release train — Highly experimental. APIs may change without notice. Not for production. Details.
intentcall_core #
Transport-agnostic agent intent registry and runtime for Dart and Flutter apps.
Authoring #
| Style | Runtime registration | Consumer host |
|---|---|---|
| Hand-written | RegisteredAgentIntent via AgentCallEntry |
Flutter, CLI, MCP, WebMCP, or custom adapters |
| Codegen (optional) | @AgentTool + build_runner pilot |
Generated entries can be composed by any host |
Authors define descriptors + executors; they do not implement a public AgentIntent interface. The registry stores RegisteredAgentIntent (descriptor + execute).
Invoke path #
MCP CallToolRequest → AgentRegistry.invoke → AgentResult → CallToolResult
A concrete consumer such as Flutter MCP can compose AgentRuntime with McpPublishAdapter; the core contract is registry registration, adapter publish, and AgentRegistry.invoke(...). Registry registration drives publish via IntentRegistered events, and hosts stop their runtime on dispose.
MCP publish lives in intentcall_mcp (McpPublishAdapter). WebMCP and Gemma use parallel adapters on the same registry:
final runtime = AgentRuntime(
registry: InMemoryAgentRegistry(),
adapters: [
McpPublishAdapter(publish: ..., unpublish: ...),
WebMcpPublishAdapter(publish: ..., unpublish: ...),
GemmaPublishAdapter(register: ..., unregister: ...),
],
);
await runtime.start();
Client helpers #
AgentResult.envelope/resourceEnvelope(intentcall_schema)AgentWireArgsfor string-key maps- Tool/resource registration contracts for hosts that expose capability surfaces without depending on a concrete transport adapter
- Example consumer helper:
AgentClientInstall.onceinmcp_toolkitfor lazy registration in the Flutter MCP product harness
Public surface ownership #
intentcall_core owns the transport-neutral registry, invocation, and
registration vocabulary:
AgentRegistry,AgentRuntime,AgentCallEntry, andRegisteredAgentIntentToolRegistration/ToolHandlerResourceRegistration,ResourceTemplateRegistration, andResourceHandler
Adapters may re-export these value objects for source compatibility, but they
should treat intentcall_core as the canonical owner. Use
intentcall_mcp only when you need the MCP publishing adapter or MCP result and
resource mapping helpers.
import 'package:intentcall_core/intentcall_core.dart';
import 'package:intentcall_schema/intentcall_schema.dart';
final registration = ToolRegistration(
name: 'echo',
description: 'Echo arguments',
inputSchema: const <String, Object?>{'type': 'object'},
handler: (arguments) async => AgentResult.success(data: arguments),
);
Migration helpers #
The main intentcall_core.dart barrel is the runtime/authoring API. The legacy
MCPCallEntry migration helpers are intentionally exposed through a separate
library so downstream packages can depend on them explicitly:
import 'package:intentcall_core/intentcall_core_migration.dart';
Use this import for MigrateAgentEntriesMigrator,
MigrateAgentEntriesReport, MigrateAgentEntriesPathNotFound, and
migrateAgentEntriesAtPath.
Related packages #
intentcall_schema— results, validation, wire argsintentcall_session— reusable runtime session state, lifecycle, and JSON snapshot persistenceintentcall_mcp— MCP bridge, publish adapter, resource mapper; re-exports core registration value objects for compatibilityintentcall_webmcp— WebMCPmodelContextpublish adapterintentcall_gemma— on-device Gemma function-calling adapterintentcall_apple/intentcall_android—agent_manifest.jsoncodegenintentcall_testing— registry contract helpers
Canonical design docs: North Star, Design FAQ, and DX FAQ.