SDKs
Use Mango from TypeScript, Python, or Go with typed resource clients.
The first-party SDKs handle authentication, request encoding, pagination, file uploads, and event streams. They connect to your Mango server through the same HTTP API documented in the API reference.
Choose a language
| Guide | Runtime | Package / module |
|---|---|---|
| TypeScript and JavaScript | Node.js 22+ | mango-sdk |
| Python | Python 3.11+ | mango-sdk, imported as mango_sdk |
| Go | Go 1.24+ | github.com/yanpgwang/mango/sdk/go |
For your first complete application, follow the Quickstart.
Current development version
The current resource-based clients are available from source or inspected
candidate packages: Python 0.1.0a2 and TypeScript 0.1.0-alpha.2 have not yet
been published to registries, and Go has no independently tagged release.
Use the same source revision as your server.
An inspected release candidate also provides wheel/source/npm packages and a Go module source archive from one recorded server revision. Candidate distribution does not imply registry publication.
The previously published alpha 1 packages use an earlier interface and do not run these examples. The release record identifies those artifacts. All SDKs remain alpha.
Install from source
Clone the repository if needed. For
TypeScript, build the SDK in that checkout before installing it in your app.
For Python and Go, run the installation commands from your application's directory.
Replace /absolute/path/to/mango with the checkout's actual location.
# In the Mango checkout:
npm --prefix sdk/typescript ci
npm --prefix sdk/typescript run build
# In your application directory:
npm install /absolute/path/to/mango/sdk/typescriptResource services
Services follow the API's resource relationships. They share the client's transport and credentials; getting a service does not issue an HTTP request.
| Resource | Python / TypeScript | Go |
|---|---|---|
| Agent definitions and versions | agents, agents.versions | Agents, Agents.Versions |
| Environments and queued Work | environments, environments.work | Environments, Environments.Work |
| Sessions and events | sessions, sessions.events | Sessions, Sessions.Events |
| Child Threads and their events | sessions.threads.events | Sessions.Threads.Events |
| Files and Skills | files, skills.versions | Files, Skills.Versions |
| Memory | memory_stores / memoryStores, with memories and versions | MemoryStores.Memories, MemoryStores.Versions |
| Credentials | vaults.credentials | Vaults.Credentials |
| Scheduling | deployments, deployment_runs / deploymentRuns | Deployments, DeploymentRuns |
| Webhooks and public probes | webhooks, system | Webhooks, System |
Python accepts request fields as keyword arguments; TypeScript accepts a direct
request object. Go uses request structs and constructors such as ModelID,
Coordinator, and UserMessage. Path identifiers precede parameters in HTTP
hierarchy order: Session ID, then Thread ID, for a Thread's events.
Lists provide one-page methods and explicit all-item iterators. Python uses
resource.list(...) / resource.iter(...); TypeScript uses list, listItems
and listPages; Go uses List / ListAutoPaging.
See the multi-agent SDK applications
for team configuration, completion handling, follow-ups and Thread inspection.
Authentication and errors
Configure your Mango URL and Workspace API key. Model-provider credentials stay on the Mango worker, not in the SDK client. Errors expose HTTP status, Mango error type and request ID for application handling and log correlation.
Optional fields preserve the difference between omission, explicit null,
false, zero and empty collections. The language README explains its
optional-value representation.
Events and recovery
The SDKs expose live SSE iteration and persisted event listing. Open a stream before sending work to observe the new turn. On reconnection, open a new stream first, list history while it is connected, and deduplicate the sources by event ID. Preview deltas are ephemeral, not durable history.
The generated one-shot methods do not automatically resend a message or tool
result after an ambiguous HTTP failure. Check persisted events before deciding
to retry. The Go SDK adds three handwritten, provider-neutral workflow helpers:
WorkPoller, SessionToolRunner, and their EnvironmentWorker composition.
The Session runner performs the result-history check before its bounded retry;
it still cannot make an external tool side effect exactly once. The composed
worker adds heartbeat, lease-loss cancellation, scoped credential handoff,
integrity-checked custom Skill preparation, transient retry/reclaim, durable
permanent-input failure, and final Stop without selecting a sandbox provider. See
Environment Work and Session events.
Its optional tools/agenttoolset package supplies the six core local tool
executors for an already-isolated worker; it does not create a sandbox.
Contributing to the SDKs
Bindings are generated from Mango's checked-in OpenAPI document. See the contributor guide for generation, drift checks, language tests, and HTTP conformance.