Skip to main content

Crate adk_drivers

Crate adk_drivers 

Source
Expand description

§adk-drivers

Service drivers for ADK-Rust agents (spec 3.5 §7.13): DNS and registrar, email, analytics and search console, social and advertising.

A driver is a kernel driver — a supervised MCP server under a manifest the owner approved (spec 3.2 §7.7) — or an in-process adapter with the same tools. For each class this crate gives:

PartWhat it is
ContractA trait for in-process adapters (dns::DnsDriver, email::EmailDriver, …) and the class’s tool list with effect classes, sides and default autonomy caps (DriverClass)
ManifestDriverClass::manifest and DriverClass::manifest_toml make the kernel DriverManifest of one side; DriverClass::check_manifest and DriverClass::check_listing tell whether any MCP server and its manifest satisfy the class, so the owner connects whichever server they choose (D-13)
RulesDriverCapPolicy holds DNS changes and campaign launches in every mode (A-I21) and within-budget calls beyond the owner’s DriverBudget; the email and social outboxes keep the Disclosure line, unsubscribes, consent and reply_in_thread’s limits (§7.10, A-I8, A-I17)
ConformanceA suite per contract (conformance, feature conformance)
AdaptersIn-memory adapters for hermetic tests, and a reference adapter per class over an open protocol or a common API
ClassToolsReference adapter
DNSdns_list_records, dns_change_recordsdns::Rfc2136Dns: RFC 2136 with TSIG, AXFR
Registrarregistrar_domain_status, registrar_renew_domaindns::RdapRegistrar: RDAP expiry
Emailemail_list_inbox, email_reply_in_thread, email_send_sequence_step, email_send_newsletter, email_delivery_stats, email_check_domainemail::ImapSmtpEmail: IMAP and SMTP
Analyticsanalytics_metricanalytics::PlausibleAnalytics: Plausible Stats API v2
Search consolesearch_console_performanceanalytics::SearchAnalyticsApi: Search Analytics API
Socialsocial_list_mentions, social_list_messages, social_reply_in_thread, social_postsocial::MastodonSocial: Mastodon client API
Advertisingads_performance, ads_launch_campaign, ads_set_bid, ads_pause_campaignads::RecordedAds: recorded responses, no live spend

reply_in_thread (ReplyInThread) is the public partition’s one SendExternal tool (§7.10, A-I2): it answers an email or social thread through its outbox.

Delivery statistics, analytics, search performance and ad spend are KpiSources the KPI tracker reads (§7.11, §7.12).

§Features

FeatureDefaultAdds
rfc2136yesdns::Rfc2136Dns and dns::tsig
rdapyesdns::RdapRegistrar
imap-smtpyesemail::ImapSmtpEmail
system-dnsyesemail::SystemTxtLookup for SPF, DKIM and DMARC checks
plausibleyesanalytics::PlausibleAnalytics
search-consoleyesanalytics::SearchAnalyticsApi
mastodonyessocial::MastodonSocial
conformancenoThe conformance suites

§Example

use std::sync::Arc;
use adk_core::{PolicyDecision, ToolPolicy, ToolPolicyRequest};
use adk_drivers::{DriverBudget, DriverCapPolicy, DriverKind, Side};
use adk_drivers::dns::{InMemoryDns, dns_tools};
use serde_json::json;

// The DNS class's tools over an in-process adapter...
let tools = dns_tools(Arc::new(InMemoryDns::new().with_zone("bakery.example", [])));
assert_eq!(tools[1].name(), "dns_change_records");

// ...or a manifest for any MCP server that serves them.
let manifest = DriverKind::Dns.class().manifest_toml("dns", "mcp-dns", &[], Side::BackOffice);
assert!(manifest.contains("dns_change_records = \"publish_public\""));

// Either way, a change is held for the owner in every mode (A-I21).
let policy = DriverCapPolicy::new(DriverBudget::new());
let change = ToolPolicyRequest::new("dns_change_records", json!({"zone": "bakery.example"}));
assert!(matches!(policy.evaluate(&change).await, PolicyDecision::RequireApproval { .. }));

§Stability

Experimental — new in 3.0.0 (spec 3.5), and its API may change while the spec lands. See STABILITY.md.

Modules§

ads
Advertising drivers (spec 3.5 §7.13): spend and performance read, campaigns launched only by a person’s decision, bids and pauses within budget.
analytics
Analytics and search-console drivers (spec 3.5 §7.12, §7.13): read-only metrics, each a KpiSource for the KPI tracker.
conformance
Conformance suites for every driver contract (spec 3.5 §11; feature conformance).
dns
DNS and registrar drivers (spec 3.5 §7.13): records and their changes, domain expiry and renewal.
email
Email drivers (spec 3.5 §7.13): the inbox in the public partition, reply_in_thread, sequences and newsletters in the back office, and delivery statistics as a metric source.
social
Social drivers (spec 3.5 §7.13): mentions and messages read in the public partition, replies in their thread, posts from the back office; Propose by default.

Structs§

BudgetCap
The owner’s budget for one AutonomyCap::WithinBudget tool (spec 3.5 §7.13): the most a single call may commit, in minor units of currency.
Disclosure
The line every outbound message carries (spec 3.5 A-I17, §13 Q6): it names the site’s owner and says an AI agent wrote the message.
DriverBudget
The owner’s budgets for the driver tools that act within budget (spec 3.5 §7.13): a domain renewal’s price, an advertising bid.
DriverCapPolicy
Enforces the driver classes’ autonomy caps on the governed path (spec 3.5 §7.13, A-I21).
DriverClass
A class of driver and its tools (spec 3.5 §7.13), as kernel driver manifests.
InMemoryConsent
Consent receipts in process memory, for tests.
InMemorySuppressions
Suppressions in process memory, for tests and single-process hosts.
ManifestCheck
The result of checking a manifest or a listing against a driver class.
RateLimit
At most max calls per per (spec 3.5 §7.10: reply_in_thread is rate limited).
ReplyInThread
reply_in_thread, the public partition’s only SendExternal tool (spec 3.5 §7.10, A-I2): answers the person who wrote, in their thread, within a playbook template, at a rate limit, with no new recipients and no attachments.
ReplyTemplates
The playbook’s reply templates (spec 3.5 §7.10: reply_in_thread answers “within a playbook template”): a public agent fills a template’s {fields}, never writes a message from nothing.
Suppression
A recipient who unsubscribed or revoked (spec 3.5 A-I17).
ToolSpec
One tool of a driver class (spec 3.5 §7.13): its name, effect class, side and default autonomy cap, and the JSON Schema of its arguments.

Enums§

AutonomyCap
How far a job goes with a tool before a person decides, by default (spec 3.5 §7.13, “Default autonomy cap”; §7.11 autonomy ladder).
DriverError
Why a driver call did not happen (spec 3.5 §7.13).
DriverKind
A class of driver (spec 3.5 §7.13).
Gap
What keeps a manifest or a server’s listing from satisfying a driver class (spec 3.5 §7.13).
Side
Which of a website’s two partitions a driver tool serves (spec 3.5 §7.10).
SuppressionScope
What an unsubscribe or a revocation stops (spec 3.5 A-I17).

Constants§

BACK_OFFICE_PARTITION
The partition of a website’s back office (spec 3.5 §7.10): Steward, Growth, Revenue, Guardian, Finance.
DRIVER_CAP_POLICY_REF
The policy reference of DriverCapPolicy in audit records: tool_policy:adk-drivers/caps.
IN_PROCESS_ORIGIN_PREFIX
The origin every in-process driver tool reports: adk-drivers:<class>.
PUBLIC_PARTITION
The partition of a website’s public agents (spec 3.5 §7.10): Concierge, Agent desk, Inbox.

Traits§

ConsentCheck
Whether a recipient holds a live consent receipt for a scope (spec 3.5 A-I8): the edge’s consent store answers it; sequences and newsletters ask it at send time.
KpiSource
A source of KPI measurements (spec 3.5 §7.11, §7.12): the edge beacon, host logs, an analytics driver, the commerce or spend ledger, the email driver. The product and the edge implement them; the tracker reads each KPI’s source by its name, the KPI’s SourceRef.
SuppressionList
Where unsubscribes and revocations are kept (spec 3.5 A-I17): every driver’s outbox reads it before each send, so one takes effect before the next send.
ThreadReplier
A driver that answers the person who wrote, in the same thread (spec 3.5 §7.10): the email and social outboxes.

Functions§

all_tools
The spec of every driver tool of every class.
recipient_key
A recipient as suppressions and consent key it: trimmed and in lower case.
tool_spec
The spec of the driver tool named name, of any class.

Type Aliases§

Result
The result of a driver call.