Janus 提供 Go、Python 与 TypeScript 的一等公民 SDK。三者实现相同的核心操作:创建邮箱、发布任务、拉取任务、确认完成。
安装
go get github.com/agentium-lab/Janus/sdk/go
创建客户端
import janus "github.com/agentium-lab/Janus/sdk/go"
client := janus.NewClient("http://localhost:8080", janus.WithTenant("acme"))
关键方法(共 39 个)
// 发布任务
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": "..."}`),
},
})
安装
pip install janus-broker
创建客户端
from janus_broker import Client
client = Client("http://localhost:8080", tenant_id="acme")
关键方法(共 34 个)
# 创建邮箱
client.create_mailbox("review-mb", agent_id="reviewer")
# 发布任务
resp = client.publish_task({
"id": "task-001",
"source_agent": "product",
"target_type": "mailbox",
"target_value": "review-mb",
"envelope": {"type": "code_review", "payload": {...}}
})
安装
npm install @agentium-lab/janus-broker
创建客户端
import { Client } from "@agentium-lab/janus-sdk";
const client = new Client("http://localhost:8080", { tenantId: "acme" });
关键方法(共 30 个)
// 创建邮箱
await client.createMailbox("review-mb", { agentId: "reviewer" });
// 发布任务
const resp = await client.publishTask({
id: "task-001",
sourceAgent: "product",
targetType: "mailbox",
targetValue: "review-mb",
envelope: { type: "code_review", payload: {...} }
});
Janus CLI 提供终端下的任务与邮箱管理:
# 任务操作
janus task list --tenant acme
janus task get task-001 --tenant acme
janus task replay task-001 --tenant acme
# 邮箱操作
janus mailbox list --tenant acme
janus mailbox inspect review-mb --tenant acme
# 系统
janus status
janus version