SDKs
Rust (reference) and TypeScript clients for MAP. Authentication, dispatch, retry, error handling.
MAP has SDKs in two languages today. The Rust SDKs are the reference implementation; the TypeScript SDK is built against the same wire protocol.
Rust
macs-sdk, marc-sdk, mata-sdk, plugin-sdk. Async/await. tokio-native. No unwrap() in production paths.
TypeScript
@l1fe/mind-wm and the MapClient family. Bun- and Node-compatible. Zod-validated payloads.
Wire protocol
HTTP envelope, auth headers, trace context, error mapping. Build your own client in any language.
What lives in each SDK
The crates and packages under /Volumes/L1feAI/l1feosx/map/sdks/:
| Language | Path | Crates / packages |
|---|---|---|
| Rust | sdks/rust/macs-sdk | MacsClient (auth profiles, challenge generation) |
| Rust | sdks/rust/marc-sdk | MarcClient (reasoning tasks, model publishing) |
| Rust | sdks/rust/mata-sdk | MataClient (trust queries, reputation updates) |
| Rust | sdks/rust/plugin-sdk | Plugin development kit (WASM helpers, manifest builder) |
| TypeScript | sdks/typescript/mind-wm | MindWmClient, types for working-memory bridge |
| TypeScript | bundled | MapClient — general dispatch surface, in same package family |
The wire protocol is stable
All SDKs target the same wire protocol — see wire protocol. If your language is not listed, you can implement a client in ~200 lines:
- Authenticate (Bearer token or session cookie)
- POST
/v1/dispatchwith{ protocol, version, operation, input, tenant_id } - Propagate
traceparentfor cross-trace correlation - Handle the standard error envelope
Python, Go, Swift, and Kotlin SDKs are not currently shipped. Build against the wire protocol for now. We accept contributions — see sdks/CONTRIBUTING.md in the repo.
Common patterns
Authentication
Every SDK reads from one of three sources in order:
- Explicit constructor args (
apiKey,agentDid,apiUrl) - Environment variables (
MAP_API_KEY,MAP_AGENT_DID,MAP_API_URL) - The CLI config at
~/.map/config.json
If none of the three is set, the SDK fails fast at construction.
Retry
Built-in retry only on idempotent operations and only for these errors:
RateLimited— respectsRetry-AfterCircuitOpen— exponential backoff up to 30s- Network errors — 3 retries with jitter
State-changing operations (anything that writes) do not retry automatically. Build idempotency keys into your application logic.
Errors
Every SDK maps the wire error envelope to its language's idiom:
// Rust
match client.dispatch(...).await {
Err(MapError::CapabilityDenied { protocol, operation }) => { ... },
Err(MapError::RateLimited { retry_after }) => { ... },
Ok(response) => { ... },
}// TypeScript
try {
const r = await map.dispatch(...);
} catch (err) {
if (err instanceof CapabilityDeniedError) {
// ...
}
}Trace propagation
Every SDK accepts an optional traceparent header for distributed tracing. If you're calling MAP from inside an OTEL-instrumented service, the SDK reads the active span automatically.
Building a new client
If you need to support a language that does not have an SDK yet, follow wire protocol. The wire is intentionally small (one POST /v1/dispatch endpoint plus the auth header). A working client in a new language is typically a few hundred lines.
If you're going to publish it as an official SDK, file a proposal to map@l1fe.ai — we'll review and link from this page.