Documentation

SDK Guide

Janus provides first-party SDKs for Go, Python, and TypeScript. All three implement the same core operations: create mailboxes, publish tasks, pull tasks, and acknowledge completion.

Go SDK

Installation

go get github.com/agentium-lab/janus-sdk-go

Client creation

import "github.com/agentium-lab/janus-sdk-go/janus"

client := janus.NewClient("http://localhost:8080", janus.WithTenant("acme"))

Key methods (39 total)

CreateMailbox
Create a new mailbox
PublishTask
Publish a task
PullTask
Pull next task
StartTask
Acquire lease
AckTask
Complete task
NackTask
Fail + retry
ListTasks
Query tasks
ResolveIntent
NL → capability
// Publish a task
resp, err := client.PublishTask(ctx, &janus.PublishRequest{
    SourceAgent: "product",
    TargetType:  "mailbox",
    TargetValue: "review-mb",
    Envelope: janus.Envelope{
        Type: "code_review",
        Payload: json.RawMessage(`{"pr_url": "..."}`),
    },
})

Python SDK

Installation

pip install janus-sdk

Client creation

from janus_sdk import JanusClient
client = JanusClient("http://localhost:8080", tenant_id="acme")

Key methods (34 total)

create_mailbox
Create a mailbox
publish_task
Publish a task
pull_task
Pull next task
start_task
Start + acquire lease
ack_task
Acknowledge completion
nack_task
Negative ACK
list_tasks
List/filter tasks
resolve_intent
Resolve intent
# Create mailbox
client.create_mailbox("review-mb", agent_id="reviewer")

# Publish task
resp = client.publish_task({
    "id": "task-001",
    "source_agent": "product",
    "target_type": "mailbox",
    "target_value": "review-mb",
    "envelope": {"type": "code_review", "payload": {...}}
})

TypeScript SDK

Installation

npm install @agentium/janus-sdk

Client creation

import { JanusClient } from "@agentium/janus-sdk";
const client = new JanusClient("http://localhost:8080", { tenantId: "acme" });

Key methods (30 total)

createMailbox
Create a mailbox
publishTask
Publish a task
pullTask
Pull next task
startTask
Start + acquire lease
ackTask
Acknowledge completion
nackTask
Negative ACK
listTasks
List/filter tasks
resolveIntent
Resolve intent
// Create mailbox
await client.createMailbox("review-mb", { agentId: "reviewer" });

// Publish task
const resp = await client.publishTask({
    id: "task-001",
    sourceAgent: "product",
    targetType: "mailbox",
    targetValue: "review-mb",
    envelope: { type: "code_review", payload: {...} }
});

CLI

The Janus CLI provides task and mailbox management from the terminal:

# Task operations
janus task list --tenant acme
janus task get task-001 --tenant acme
janus task replay task-001 --tenant acme

# Mailbox operations
janus mailbox list --tenant acme
janus mailbox inspect review-mb --tenant acme

# System
janus status
janus version
All three SDKs support HTTP and gRPC transports, and respect the same error envelope format. Use the CLI for ops tasks — replay from DLQ, inspect mailbox depth, check system health.