公司初始化 API
这组 API 是 AIDC Control Plane 的真实初始化链路:创建/复用名为 AIDC 的 AWS instance,初始化 10 个 C-suite 空文件夹,创建 10 个 Hermes profile skeleton,并把 live metadata 写回 Control Plane。
// 当前状态
第一版已经完成 live bootstrap。后台真实 AWS 链接已建立:instance 位于 ap-southeast-1,状态 running,system/instance status 均为 ok。Control Plane 只保存 metadata,不保存客户原文、token、key 或私钥。
API 总览
| API | 作用 | 可重复运行 |
|---|---|---|
POST /api/v1/control-plane/companies/initialize | 公司创建总入口:company + AWS + folders + Hermes + metadata sync | 是 |
POST /api/v1/control-plane/companies/{cell}/aws-instance | 创建或复用 AWS instance,并同步 server metadata | 是 |
POST /api/v1/control-plane/companies/{cell}/folders | 初始化 C-suite 文件夹 | 是 |
POST /api/v1/control-plane/companies/{cell}/hermes-agents | 创建或刷新 Hermes profile skeleton 与精简 SOUL.md | 是 |
GET /api/v1/control-plane/companies/{cell}/provisioning-status | 查询初始化状态、server、folders/agents 与 sync runs | 只读 |
初始化请求
POST /api/v1/control-plane/companies/initialize
Content-Type: application/json
{
"nameEn": "AIDC",
"nameZh": "AIDC",
"companyKey": "aidc",
"cellId": "cell-aidc",
"rootPath": "/opt/<company-key>-live",
"aws": {
"profile": "<aws-cli-profile>",
"accountId": "<aws-account-id>",
"region": "ap-southeast-1",
"instanceName": "AIDC"
}
}
Live evidence
下表是首次 live bootstrap 的验收结果。账号 ID、instance ID、公网 IP 属于基础设施标识,不在公开文档中披露;内部记录见 Control Plane 的 provisioning-status 与 ActionLog。
| 项目 | 结果 |
|---|---|
| AWS Account | 已接入(值不公开) |
| Region | ap-southeast-1 |
| Instance Name | AIDC |
| Instance ID | 已分配(值不公开) |
| State | running |
| System / Instance Status | ok / ok |
| Remote folders | 10 |
| Remote Hermes profiles | 10 |
C-suite 文件夹与 Hermes profiles
| Folder | Profile | Name | 职责 |
|---|---|---|---|
01_executive | aidc-ceo | CEO小A | 公司方向、战略、总览与最终决策 |
02_information | aidc-cio | CIO小A | 信息资产、OKF、知识系统和数据治理 |
03_finance | aidc-cfo | CFO小A | 财务、成本、定价、预算与用量 |
04_products | aidc-cpo | CPO小A | 产品、路线图、平台体验与需求 |
05_technology | aidc-cto | CTO小A | 技术架构、后端/API、云与安全 |
06_operations | aidc-coo | COO小A | 交付、SOP、部署、运维与复盘 |
07_human_resources | aidc-cho | CHO小A | 角色、招聘、培训与组织设计 |
08_legal | aidc-clo | CLO小A | 合规、风险、合同与边界 |
09_marketing | aidc-cmo | CMO小A | 品牌、内容、官网和市场叙事 |
10_sales | aidc-cso | CSO小A | 销售、客户、pipeline 与合作 |
SOUL.md 精简模板
每个 Hermes profile 的 SOUL.md 只保留三块,便于批量生成、审核和后续升级:
- 职责描述:这个 Agent 负责什么,不负责什么。
- 工具路径:公司文件夹、profile 路径、日志路径。
- 业务背景:这是 AIDC 自己的 live company cell;只存 metadata 和空目录。
数据边界
| 允许进入 Control Plane | 禁止进入 Control Plane |
|---|---|
| AWS instance id / state / status / IP / SG metadata | AWS credentials / SSH private key |
| C-suite folder names and paths | raw customer files / raw chats / raw documents |
| Hermes profile names and SOUL.md metadata | model provider tokens / Hermes auth files |
| sync run summary and ActionLog evidence | 任何密钥、私钥、token、connection string |
实现位置
src/server/modules/company-initialization/
src/server/integrations/aws/aws-cli.ts
src/server/integrations/runtime/remote-bootstrap.ts
src/app/api/v1/control-plane/companies/initialize/route.ts
src/app/api/v1/control-plane/companies/[cell]/aws-instance/route.ts
src/app/api/v1/control-plane/companies/[cell]/folders/route.ts
src/app/api/v1/control-plane/companies/[cell]/hermes-agents/route.ts
src/app/api/v1/control-plane/companies/[cell]/provisioning-status/route.ts