CellSpec 可移植声明
wesgine CellSpec 中 CellPortableSpec 的可移植性配置。
概述
CellPortableSpec 控制 Cell Export/Import 时的打包行为,决定哪些数据随 Cell 迁移。
Export 行为
默认包含
- 三层 SQLite 数据库(meta.db / state.db / sessions.db)
- workspace/ 目录(INV-IO-08)
- skills/ 目录
- knowledge/ 目录
可排除
spec := wesgine.CellSpec{
CellPortableSpec: wesgine.CellPortableSpec{
ExportOpts: wesgine.ExportOpts{
SkipWorkspace: true, // 排除 workspace/
},
},
}
永不包含
.scratch/临时计算域.cell.lock进程排他锁
Import 行为
cellID, err := hyp.Cells().Import(ctx, reader, ImportOpts{
Overwrite: true, // 覆盖已有 Cell
})
Import 后 Cell 需要重新 Start 才能使用。
与密钥的关系
Export 不包含 spec.key——密钥文件不随 Cell 包迁移。
Import 后需要重新配置 Provider 密钥(inline 密文无法在新机器上解密)。
不可变字段
CellSpec 中标记 wesgine:"immutable" 的字段在 Export/Import 后保持不变:
ID:Cell 标识符Timezone:时区
API
导出
GET /admin/cells/{id}/export
返回 tar.gz 流。
导入
POST /admin/cells/import?overwrite=1
接收 tar.gz body。