MAP Docs
SDKs

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.

What lives in each SDK

The crates and packages under /Volumes/L1feAI/l1feosx/map/sdks/:

LanguagePathCrates / packages
Rustsdks/rust/macs-sdkMacsClient (auth profiles, challenge generation)
Rustsdks/rust/marc-sdkMarcClient (reasoning tasks, model publishing)
Rustsdks/rust/mata-sdkMataClient (trust queries, reputation updates)
Rustsdks/rust/plugin-sdkPlugin development kit (WASM helpers, manifest builder)
TypeScriptsdks/typescript/mind-wmMindWmClient, types for working-memory bridge
TypeScriptbundledMapClient — 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:

  1. Authenticate (Bearer token or session cookie)
  2. POST /v1/dispatch with { protocol, version, operation, input, tenant_id }
  3. Propagate traceparent for cross-trace correlation
  4. 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:

  1. Explicit constructor args (apiKey, agentDid, apiUrl)
  2. Environment variables (MAP_API_KEY, MAP_AGENT_DID, MAP_API_URL)
  3. 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 — respects Retry-After
  • CircuitOpen — 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.

On this page