Every crate under crates/ now has a README (android, bench, cli, napi and wasm had none), each saying what the crate is, its main types and functions (names checked against the code), its cargo features with defaults and which ones build C (checked with `cargo tree`), and links to the top-level docs. Corrections to the old stubs: - clawhdf5-derive: the derive is `H5Type`, not `HDF5Type`, and it needs clawhdf5-format as a dependency. - clawhdf5-filters: deflate backends only, and no library crate depends on it; the filter pipeline and every other codec are in -format. - clawhdf5-gpu: vector distance compute, not I/O; not used by HDF5Memory::search. - clawhdf5-io: MpiVol is root-read + broadcast, not collective MPI-IO. - clawhdf5-ann: from_hdf5/search(q, k) did not exist; load_from_hdf5 and search(q, k, ef). - clawhdf5-accel: checksum::crc32_simd did not exist; the SSE4 and wasm backends are reported but run the scalar kernels. - clawhdf5-gpu: the old example called l2_distances, which does not exist (l2_search). - clawhdf5-agent: it described a "vector store" with "GPU acceleration"; it now covers HDF5Memory, search options, WAL, signing, the graph. - crates.io/docs.rs badges removed and `cargo install <crate>` replaced: nothing is published; depend on git. - fuzz: the opt-in CLAWHDF5_FUZZ_SECONDS smoke run in ci-test.sh. - tools: the FileEditor interop tests that live in this crate. - remote, py: license, other front ends, limits, File.mode/flush/chunks. The Rust examples of the facade, format, filters, accel, ann, derive and agent READMEs were compiled and run as tests (netcdf4, gpu and remote compiled only) in a scratch crate; the CLI example was run. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
39 lines
1.5 KiB
Markdown
39 lines
1.5 KiB
Markdown
# clawhdf5-napi
|
|
|
|
> **Status: does not work end to end.** The TypeScript package built on
|
|
> this crate (`packages/clawhdf5-node`) has never run successfully, is
|
|
> unpublished, and is not built or tested in CI. See "The Node.js package
|
|
> does not work" in [`docs/known-issues.md`](../../docs/known-issues.md).
|
|
> Fix it and add CI, or remove it, before depending on it.
|
|
|
|
A Node.js native addon ([napi-rs](https://napi.rs), N-API 9) exposing
|
|
[`clawhdf5-agent`](../clawhdf5-agent/README.md) as a `ClawhdfMemory`
|
|
class. It wraps `clawhdf5_agent::openclaw::ClawhdfBackend` (the agent's
|
|
`search` with re-ranking and confidence on) and the consolidation engine.
|
|
It was written for an OpenClaw integration that is not being pursued
|
|
([`docs/openclaw.md`](../../docs/openclaw.md)).
|
|
|
|
## What the addon exposes
|
|
|
|
`ClawhdfMemory.create(path, dim)`, `.open(path)`, `.openOrCreate(path,
|
|
dim)`, and on an instance: `search`, `get`, `write`, `ingestMarkdown`,
|
|
`exportMarkdown`, `save`, `saveBatch`, `stats`, `compact`, `tickSession`,
|
|
`flushWal`, `walPendingCount`, `runConsolidation`, and the ephemeral tier
|
|
(`enableEphemeral`, `ephemeralSet`/`Get`/`Delete`, `ephemeralStats`,
|
|
`promoteEphemeral`). napi-rs converts names and `#[napi(object)]` fields to
|
|
camelCase.
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cargo build --release -p clawhdf5-napi # the Rust cdylib
|
|
# the .node package: npm install -g @napi-rs/cli; cd packages/clawhdf5-node; napi build --platform --release
|
|
```
|
|
|
|
It links against Node's N-API through `napi-sys` (a `-sys` crate), so it is
|
|
exempt from CI's "no C in the default build" check.
|
|
|
|
## License
|
|
|
|
MIT
|