Files
ocas/.changeset/export-import-bundle.md
T
xiaoju 4ba3a00de9 feat: add CAS closure export/import bundles
Implements `ocas export` / `ocas import` for shipping a self-contained
closure of CAS nodes, variables and tags between stores, plus a
read-only `--store <bundle.tar>` flag for inspecting bundles without
extracting them.

- core: computeClosure walks refs + schema chains and gathers vars/tags
- core: exportBundle / importBundle / loadBundleStore use a custom
  POSIX/ustar tar (no external deps); content-addressed dedup on import,
  optional --scope remap of non-@ocas variable names
- core: new @ocas/output/export and @ocas/output/import builtin schemas
- cli: new export and import commands, --store read-only mode, write
  commands rejected with a clear error when --store is set

Closes #83
2026-06-07 01:13:36 +00:00

812 B

@ocas/core, @ocas/cli
@ocas/core @ocas/cli
minor minor

Add CAS closure export/import (ocas export / ocas import):

  • @ocas/core: New computeClosure(store, roots) traverses references and schema chains to gather a complete CAS closure. New exportBundle() / importBundle() / loadBundleStore() produce and consume self-contained POSIX-tar bundles (cas/*.bin CBOR payloads, vars.jsonl, tags.jsonl). Added @ocas/output/export and @ocas/output/import builtin output schemas.
  • @ocas/cli: New ocas export <root> [<root> ...] -o <bundle.tar> and ocas import <bundle.tar> [--scope @new] commands. New global --store <bundle.tar> flag opens a bundle as a read-only store for inspection commands (get, walk, refs, var list, …). Write commands reject --store with a clear error.