Skip to main content

Crate marbots_sdk

Crate marbots_sdk 

Source
Expand description

Typed Rust SDK for Marbots, the multi-agent collaboration platform. Synchronous (no async runtime required); from async code, call it inside spawn_blocking. Kernel packs, permission profiles, task states, event types and model settings are enums/helpers, so typos are compile errors.

Built by Gravicode Studios, led by Kang Fadhil.

use marbots_sdk::{BotSpec, Client, EventType, KernelPack, ModelRef, PermissionProfile};

let mb = Client::new("http://localhost:5170");
// Every bot can run on its own model; ModelRef::DEFAULT follows the workspace default.
let sari = mb.bots().create(
    BotSpec::new("Sari")
        .role("UX designer")
        .kernel_functions([KernelPack::Files, KernelPack::Web])
        .permission_profile(PermissionProfile::WorkspaceWrite)
        .model(ModelRef::of("azure", "gpt-5.6-luna")),
)?;
mb.bots().set_model("atlas", ModelRef::DEFAULT)?;

let thread = mb.threads().create(&sari.id, None)?;
let result = mb.threads().send(&thread.id, "Sketch a wireframe", true)?;
println!("{:?}: {}", result.task.model, result.text());

for event in mb.events().stream(Some(&thread.id))? {
    let event = event?;
    if event.event_type == EventType::ToolCallStarted { println!("tool: {:?}", event.message); }
    if event.is_task_finished() { break; }
}

Structs§

AgentEvent
One item on the live event stream.
AgentHosts
Computers that run bots’ tools (see docs/en/computers.md).
ApiKeyInfo
A tenant API key as listed; the key itself is only returned when created.
ApprovalRequest
A risky action waiting for (or resolved by) a human.
Approvals
Human-in-the-loop approvals.
BootstrapOptions
SSH bootstrap of an agent host. The password/key is used for that call only.
BootstrapResult
What an SSH bootstrap did, step by step.
Bot
A durable AI teammate.
BotModelInfo
A bot’s model setting and the model it actually runs on.
BotSpec
Options for creating or updating a bot.
BotTemplate
A ready-made bot role from the template gallery.
Bots
Bot management.
ChatMessage
One chat message.
ChatThread
A conversation with one bot.
Client
A synchronous client for a Marbots server. Cheap to clone; safe to share between threads.
ContainerProfile
Runs the bot’s shell commands in a throwaway Docker container with these quotas.
EnrollmentToken
One-time token for marbots-host enroll.
EventStream
Iterator over live events.
Events
Live events (Server-Sent Events).
HostInfo
A machine that runs bots.
HostMetrics
A host’s latest load report.
HostRef
host_ref values besides a registered host id.
Mcp
MCP servers.
McpServer
An MCP server from the gallery.
Memory
Long-term memory.
MemoryRecord
A long-term memory.
ModelCatalog
The workspace default model, the choices and the profiles.
ModelProfileInfo
A named model profile.
ModelRef
Builds a bot’s model setting.
Models
Workspace default model and model choices.
NewApiKey
A freshly created key; key is shown only this once.
ScheduleJob
A saved schedule.
ScheduleSpec
A recurring (cron) or one-off (run_at, ISO-8601) job.
Schedules
Cron and one-off jobs.
SendResult
Returned by threads().send(...); reply is set when the call waited for the bot.
SkillEvaluation
Learning evaluation of one skill: outcomes of its current version and a verdict.
SkillInfo
An installed SKILL.md package.
SkillStats
Outcomes of the tasks that loaded one skill version.
Skills
SKILL.md packages.
SystemInfo
Server information.
TaskRecord
A durable unit of work.
Tasks
Tasks.
Templates
Template gallery.
Tenancy
Who am I, tenants and this tenant’s keys and members (see docs/en/multi-tenant.md).
Tenant
A tenant in multi-tenant mode; default always exists.
TenantMember
An OIDC user’s role in a tenant (matched by e-mail or subject).
Threads
Conversations.
ToolCall
A tool invocation requested by a model.
WhoAmI
Who the caller is.
WorkspaceFile
A file in a thread’s project workspace.

Enums§

ApprovalScope
How far an approval reaches.
ApprovalState
State of an approval request.
AutoLearnMode
Optional learning after tasks.
BotStatus
A bot’s lifecycle state.
Error
Errors returned by the SDK.
EventType
Types of events on the live stream. Types newer than this SDK deserialize as EventType::Unknown.
KernelPack
Built-in tool packs a bot can enable.
MemoryKind
Kind of long-term memory.
PermissionProfile
What a bot may do without asking.
SkillVerdict
The learning evaluation’s conclusion about a skill.
TaskState
A task’s lifecycle state.
TenantRole
A role inside a tenant, weakest first.

Constants§

BOSS_MAN
Id of the protected manager bot.

Type Aliases§

Result
SDK result type.