mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-27 17:23:34 +00:00
- Build NAPI native addon (linux-x64-gnu, 1.3MB) and WASM binary (42KB) - Fix NodeBackend to use RvfDatabase class instance methods instead of module-level functions - Fix WasmBackend to use C-ABI store functions with integer handles - Add platform loader (index.js) and TypeScript declarations (index.d.ts) - Create JS glue and type declarations for WASM package - Set up platform-specific npm packages for all 5 targets - Bump rvf-node/rvf-wasm to 0.1.4, SDK to 0.1.6 - Fix version pins from 0.1.0 to ^0.1.4 Resolves: rvf-node and rvf-wasm published as empty stubs with no binaries Verified: E2E test passes (create -> ingest -> query -> status -> close) Co-Authored-By: claude-flow <ruv@ruv.net>
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
/**
|
|
* Error codes mirroring the Rust `ErrorCode` enum (rvf-types).
|
|
*
|
|
* The high byte is the category, the low byte is the specific error.
|
|
*/
|
|
export declare enum RvfErrorCode {
|
|
Ok = 0,
|
|
OkPartial = 1,
|
|
InvalidMagic = 256,
|
|
InvalidVersion = 257,
|
|
InvalidChecksum = 258,
|
|
InvalidSignature = 259,
|
|
TruncatedSegment = 260,
|
|
InvalidManifest = 261,
|
|
ManifestNotFound = 262,
|
|
UnknownSegmentType = 263,
|
|
AlignmentError = 264,
|
|
DimensionMismatch = 512,
|
|
EmptyIndex = 513,
|
|
MetricUnsupported = 514,
|
|
FilterParseError = 515,
|
|
KTooLarge = 516,
|
|
Timeout = 517,
|
|
LockHeld = 768,
|
|
LockStale = 769,
|
|
DiskFull = 770,
|
|
FsyncFailed = 771,
|
|
SegmentTooLarge = 772,
|
|
ReadOnly = 773,
|
|
TileTrap = 1024,
|
|
TileOom = 1025,
|
|
TileTimeout = 1026,
|
|
TileInvalidMsg = 1027,
|
|
TileUnsupportedOp = 1028,
|
|
KeyNotFound = 1280,
|
|
KeyExpired = 1281,
|
|
DecryptFailed = 1282,
|
|
AlgoUnsupported = 1283,
|
|
BackendNotFound = 65280,
|
|
BackendInitFailed = 65281,
|
|
StoreClosed = 65282
|
|
}
|
|
/**
|
|
* Custom error class for all RVF operations.
|
|
*
|
|
* Carries a typed `code` field for programmatic matching and a
|
|
* human-readable `message`.
|
|
*/
|
|
export declare class RvfError extends Error {
|
|
/** The RVF error code. */
|
|
readonly code: RvfErrorCode;
|
|
/** Error category (high byte of the code). */
|
|
get category(): number;
|
|
/** True when the category indicates a format-level (fatal) error. */
|
|
get isFormatError(): boolean;
|
|
constructor(code: RvfErrorCode, detail?: string);
|
|
/**
|
|
* Create an RvfError from a native binding error.
|
|
* Attempts to extract an error code from the message or object.
|
|
*/
|
|
static fromNative(err: unknown): RvfError;
|
|
}
|