CellSpec 外设声明
wesgine CellSpec 中外设(Adapter)相关字段的声明式配置。
Channels
IM 渠道声明:
spec := wesgine.CellSpec{
Channels: []ChannelConfig{
{Platform: "wecom", CorpID: "wx...", AgentID: 1000001},
{Platform: "feishu", AppID: "cli_..."},
},
}
运行时管理:cell.Channels()。
邮箱账号声明:
spec := wesgine.CellSpec{
Email: []EmailConfig{
{Address: "ai@company.com", SMTPHost: "smtp.company.com"},
},
}
运行时管理:cell.Email()。
MCPs
MCP Server 声明:
spec := wesgine.CellSpec{
MCPs: []mcp.ServerConfig{
{Name: "custom-mcp", Transport: "stdio", Command: "/path/to/server"},
},
}
运行时管理:cell.MCPs()。
Cron
定时任务声明:
spec := wesgine.CellSpec{
Cron: []CronJobConfig{
{Name: "daily-report", Schedule: "0 9 * * *", AgentID: "reporter"},
},
}
运行时管理:cell.Cron()。
种子声明(INV-SEED-01)
Channels / Email / Cron 是出生声明,不是常驻状态:
- 只在 Cell 首次 boot 播种
- 此后存储是唯一权威
- 声明不再被读
标记表 wes_spec_seed 与守护行同层(state.db)。
HeadlessBrowser
服务端匿名浏览:
spec := wesgine.CellSpec{
HeadlessBrowser: &HeadlessBrowserConfig{},
}
非 nil 即启用。运行时状态:GET /cells/{id}/headless-browser/state。
Playwright
用户浏览器自动化:
spec := wesgine.CellSpec{
Playwright: &PlaywrightConfig{
Mode: "user",
},
}
运行时状态:GET /cells/{id}/playwright/status。
Desktop
桌面自动化 Device Agent:
spec := wesgine.CellSpec{
Desktop: &DesktopConfig{
Command: "/path/to/device-agent",
Transport: "stdio",
},
}
运行时状态:GET /cells/{id}/desktop/status。
STT
语音转写:
spec := wesgine.CellSpec{
STT: &STTConfig{},
}
非 nil 即启用。
Plugins
JSON-RPC 子进程插件:
spec := wesgine.CellSpec{
Plugins: []PluginDir{"/path/to/plugins"},
}
受 MaxPlugins 配额限制 + PluginPolicy ed25519 签名验证。
HITL
Human-in-the-Loop 配置:
spec := wesgine.CellSpec{
HITL: &HITLConfig{
Timeout: 60 * time.Second,
},
}
设置 HITL 请求的超时时间。
外设配额限制
所有外设受 CellSpec.Quotas 限制:
| 配额 | 外设 |
|---|---|
| MaxIMChannels | Channels |
| MaxMCPServers | MCPs |
| MaxCronJobs | Cron |
| MaxEmailAccounts | |
| MaxSkillsInstalled | Skills |
| MaxPlugins | Plugins |