Skip to content

运行时 & Agent API ​

运行时守护进程是在本地执行 AI Agent 任务的进程。它们注册到服务器、轮询任务并报告结果。

Agent 发现 ​

列出可用 Agent ​

返回从已注册运行时聚合的所有已知 Agent。

http
GET /api/v1/agents/available
Authorization: Bearer <token>

响应 200 OK

json
[
  {
    "agent_id": "claude",
    "display_name": "Claude Code",
    "available": true,
    "runtime_count": 2,
    "compatibility_level": "full",
    "versions": ["1.0.22"]
  },
  {
    "agent_id": "gemini",
    "display_name": "Gemini CLI",
    "available": true,
    "runtime_count": 1,
    "compatibility_level": "full",
    "versions": ["2.1.0"]
  }
]

Agent 集成:claude、codex、copilot、gemini、opencode、kimi、mimo、qwen、codebuddy、qoder、trae、zcode、deepseek

显式 Agent 路由策略

7 个集成需显式选择:mimo、qwen、codebuddy、qoder、trae、zcode、deepseek,自动路由和默认 fallback 排除它们。版本要求见安装指南。TraeCode CLI/ZCode 保留 live gate,ZCode 另要求二进制 fingerprint 批准;Harness 还要求精确构件/Node/平台验收,且仅个人 Runtime 可调度。

运行时管理(平台管理员) ​

deepseek 是第 7 个显式集成,为仅用于 Desktop/个人 Runtime 的开发者预览。可用状态要求精确 0.2.0-rc.2 与安装构件/Node/平台验收匹配,发现 CLI 不等于 ready。共享 Runtime 的 inventory 不能使它变成可调度;原生 Windows 仍未就绪。显式 override 与 attempt-chain 遥测保留规范 ID,自动路由/default fallback 排除它。参阅 Harness 安装。

列出运行时 ​

需要平台管理员权限。

http
GET /api/v1/runtimes
Authorization: Bearer <token>

响应 200 OK

json
[
  {
    "id": "uuid",
    "daemon_id": "mac-studio-01",
    "device_name": "Mac Studio M2",
    "status": "online",
    "available_agents": ["claude", "gemini", "mimo", "qwen"],
    "max_concurrent_tasks": 3,
    "last_heartbeat": "2026-01-01T00:00:00Z"
  }
]

获取运行时详情 ​

http
GET /api/v1/runtimes/{runtime_id}

移除运行时 ​

http
DELETE /api/v1/runtimes/{runtime_id}

守护进程注册(内部接口) ​

守护进程启动时自动调用。

注册 ​

http
POST /api/v1/runtimes/register
Content-Type: application/json

{
  "daemon_id": "mac-studio-01",
  "device_name": "Mac Studio M2",
  "available_agents": ["claude", "gemini", "mimo", "qwen"],
  "max_concurrent_tasks": 3
}

心跳 ​

http
POST /api/v1/runtimes/{runtime_id}/heartbeat

领取任务 ​

http
POST /api/v1/runtimes/{runtime_id}/poll

报告完成 ​

http
POST /api/v1/runtimes/{runtime_id}/complete
Content-Type: application/json

{
  "node_id": "uuid",
  "status": "completed",
  "metrics": {
    "duration_seconds": 120,
    "tokens_used": 50000
  }
}

Forgexa — AI 软件工厂