/** * @module @nhtio/adk/batteries/vector/cloudflare * * Managed Cloudflare Vectorize V2 vector-store adapter over REST (pure fetch, no driver). * A logical collection maps to a Vectorize **index**. Supported dimensions: 32–1536. * * Upserter: POST /{name}/upsert via `multipart/form-data` with field name `vectors` * (content-type `application/x-ndjson`). Each line: `{"id":"..","values":[..],"metadata":{..}}`. * Query/get/delete use JSON bodies. Eventual consistency is handled by settle-polling. * * Native filtering: Vectorize requires pre-created metadata indexes and lacks `$and`/`$or`. * For guaranteed cross-adapter parity, **over-fetch + JS evaluateFilter** (topK cap 100). * * Scores: returned as-is from Vectorize, then re-computed locally (cosineSim/dotProd/euclideanDist) * to guarantee the [0,1] contract. * * Document: stored under the reserved metadata key `__document`; extracted on read. */ import { BaseVectorStore } from "../contract"; import type { SearchPlan, UpsertPlan, DeletePlan, CollectionSpec } from "../plan"; import type { VectorMatch, VectorStoreCapabilities, BaseVectorStoreOptions } from "../types"; export interface CloudflareVectorizeVectorStoreOptions extends BaseVectorStoreOptions { /** Connection and authentication parameters for the backend. */ connection: { accountId: string; apiKey: string; indexNamePrefix?: string; }; } export declare class CloudflareVectorizeVectorStore extends BaseVectorStore { #private; readonly capabilities: VectorStoreCapabilities; /** Static availability probe: whether this adapter's runtime driver can load in the current environment. */ static isAvailable(): boolean; isAvailable(): boolean; connect(): Promise; close(): Promise; createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise; dropCollection(collection: string, ifExists: boolean): Promise; hasCollection(collection: string): Promise; renameCollection(_from: string, _to: string): Promise; executeUpsert(plan: UpsertPlan): Promise; executeSearch(plan: SearchPlan): Promise; executeDelete(plan: DeletePlan): Promise; }