From 522b7825717ef668b960bc558dca119f76cb8869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=9C=88?= Date: Sun, 7 Jun 2026 13:25:10 +0800 Subject: [PATCH 1/2] chore: release @ocas/core@0.4.0, @ocas/fs@0.4.0, @ocas/cli@0.4.0 --- packages/cli/package.json | 2 +- packages/cli/tests/__snapshots__/edge-cases.test.ts.snap | 2 +- packages/core/package.json | 2 +- packages/fs/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 308bbdb..e2b075a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@ocas/cli", - "version": "0.3.1", + "version": "0.4.0", "description": "CLI for OCAS content-addressed store", "keywords": [ "cas", diff --git a/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap b/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap index 6a80cf1..3f5189a 100644 --- a/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap +++ b/packages/cli/tests/__snapshots__/edge-cases.test.ts.snap @@ -485,5 +485,5 @@ Flags: --scope Variable name remap target for import (e.g. --scope @imported) -o Output path for export -Agent: If you have not installed the ocas skill for this version (0.3.1), run \`ocas prompt bootstrap\` and follow the instructions." +Agent: If you have not installed the ocas skill for this version (0.4.0), run \`ocas prompt bootstrap\` and follow the instructions." `; diff --git a/packages/core/package.json b/packages/core/package.json index 78a1d8c..b467c9e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@ocas/core", - "version": "0.3.0", + "version": "0.4.0", "description": "Core CAS engine — hashing, schema, store, verify, bootstrap", "keywords": [ "cas", diff --git a/packages/fs/package.json b/packages/fs/package.json index 93e60b4..4e12aaf 100644 --- a/packages/fs/package.json +++ b/packages/fs/package.json @@ -1,6 +1,6 @@ { "name": "@ocas/fs", - "version": "0.3.0", + "version": "0.4.0", "description": "Filesystem-backed CAS store with SQLite", "keywords": [ "cas", -- 2.43.0 From 741fea9e514e94a8350f453a5fd82219f2f14091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Sun, 7 Jun 2026 13:25:45 +0800 Subject: [PATCH 2/2] release: v0.4.0 --- .changeset/bootstrap-rename.md | 5 ----- .changeset/export-import-bundle.md | 9 --------- .changeset/fsstore-lazy-loading.md | 5 ----- .changeset/nodes-subdirectory.md | 5 ----- packages/cli/CHANGELOG.md | 8 ++++++++ packages/core/CHANGELOG.md | 7 +++++++ packages/fs/CHANGELOG.md | 5 +++++ 7 files changed, 20 insertions(+), 24 deletions(-) delete mode 100644 .changeset/bootstrap-rename.md delete mode 100644 .changeset/export-import-bundle.md delete mode 100644 .changeset/fsstore-lazy-loading.md delete mode 100644 .changeset/nodes-subdirectory.md diff --git a/.changeset/bootstrap-rename.md b/.changeset/bootstrap-rename.md deleted file mode 100644 index 42d59ea..0000000 --- a/.changeset/bootstrap-rename.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ocas/cli": patch ---- - -Rename `ocas prompt setup` to `ocas prompt bootstrap` with programmatic generation (dynamic CLI_VERSION injection). Add `ocas prompt list` subcommand. diff --git a/.changeset/export-import-bundle.md b/.changeset/export-import-bundle.md deleted file mode 100644 index 22ebf99..0000000 --- a/.changeset/export-import-bundle.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@ocas/core": minor -"@ocas/cli": 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 [ ...] -o ` and `ocas import [--scope @new]` commands. New global `--store ` 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. diff --git a/.changeset/fsstore-lazy-loading.md b/.changeset/fsstore-lazy-loading.md deleted file mode 100644 index 595afc4..0000000 --- a/.changeset/fsstore-lazy-loading.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ocas/fs": patch ---- - -`FsStore` now uses lazy loading: at startup it scans only filenames in the `nodes/` subdirectory (no CBOR decoding) and reads each node from disk on first `get()`. This makes startup O(filenames) instead of O(decoded-bytes), keeps memory usage bounded by what's actually accessed, and avoids paying the full-load cost for stores with many nodes. Behaviour is unchanged: `has()`, `listAll()`, `listByType()`, `listMeta()`, and `listSchemas()` return the same results as before. Index/meta migration paths still work — they perform a one-time scan + decode when `_index/` is missing. diff --git a/.changeset/nodes-subdirectory.md b/.changeset/nodes-subdirectory.md deleted file mode 100644 index f6c9451..0000000 --- a/.changeset/nodes-subdirectory.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@ocas/fs": minor ---- - -Move CAS node files from the store root into a `nodes/` subdirectory. Pre-existing flat-layout stores are auto-migrated on first open: any `.bin` files in the store root are renamed into `nodes/`. Metadata (`_index/`, `_store.db`, `_meta`) remain at the store root unchanged. diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index a197cd2..01b819c 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @ocas/cli +## 0.4.0 — 2026-06-07 + +- Rename `ocas prompt setup` to `ocas prompt bootstrap` with programmatic generation (dynamic CLI_VERSION injection). Add `ocas prompt list` subcommand. +- 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 [ ...] -o ` and `ocas import [--scope @new]` commands. New global `--store ` 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. + ## 0.3.1 ### Patch Changes diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index aafff83..c8758fa 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @ocas/core +## 0.4.0 — 2026-06-07 + +- 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 [ ...] -o ` and `ocas import [--scope @new]` commands. New global `--store ` 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. + ## 0.2.0 ### Breaking Changes diff --git a/packages/fs/CHANGELOG.md b/packages/fs/CHANGELOG.md index 1090ab9..8b5bc98 100644 --- a/packages/fs/CHANGELOG.md +++ b/packages/fs/CHANGELOG.md @@ -1,5 +1,10 @@ # @ocas/fs +## 0.4.0 — 2026-06-07 + +- `FsStore` now uses lazy loading: at startup it scans only filenames in the `nodes/` subdirectory (no CBOR decoding) and reads each node from disk on first `get()`. This makes startup O(filenames) instead of O(decoded-bytes), keeps memory usage bounded by what's actually accessed, and avoids paying the full-load cost for stores with many nodes. Behaviour is unchanged: `has()`, `listAll()`, `listByType()`, `listMeta()`, and `listSchemas()` return the same results as before. Index/meta migration paths still work — they perform a one-time scan + decode when `_index/` is missing. +- Move CAS node files from the store root into a `nodes/` subdirectory. Pre-existing flat-layout stores are auto-migrated on first open: any `.bin` files in the store root are renamed into `nodes/`. Metadata (`_index/`, `_store.db`, `_meta`) remain at the store root unchanged. + ## 0.3.0 — 2026-06-03 - Migrate from better-sqlite3 to built-in node:sqlite — zero native addon dependencies, no more NODE_MODULE_VERSION mismatch across Node upgrades. -- 2.43.0