Cell 可移植规范

wesgine 的 CellPortableSpec,控制 Cell Export/Import 时的打包行为。


导出内容

Cell 导出为 tar.gz 包,默认包含:

内容默认包含可排除
三层数据库(meta/state/sessions)✅❌
记忆数据✅❌
知识库文件✅❌
技能包✅❌
workspace/ 产出目录✅ExportOpts{SkipWorkspace: true}
.scratch/ 临时目录❌ 永不包含—

导出 API

hyp.Cells().Export(ctx, cellID) (io.Reader, error)

HTTP 端点:GET /admin/cells/{id}/export

返回 tar.gz 流。


导入 API

hyp.Cells().Import(ctx, r io.Reader, opts ImportOpts) (string, error)

HTTP 端点:POST /admin/cells/import

支持 ?overwrite=1 参数覆盖已有 Cell。


可移植性保证


INV-IO-08

Cell Export 默认包含 workspace/,ExportOpts{SkipWorkspace: true} 可排除。

.scratch/ 永不包含——它是临时计算域,Run 结束后 GC。