hyperspace-sdk-ts 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -10
- package/dist/agents.d.ts +16 -0
- package/dist/agents.js +64 -0
- package/dist/client.d.ts +50 -1
- package/dist/client.js +362 -16
- package/dist/math.d.ts +44 -0
- package/dist/math.js +234 -0
- package/dist/proto/hyperspace_grpc_pb.js +403 -0
- package/dist/proto/hyperspace_pb.js +9920 -2559
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# HyperspaceDB TypeScript SDK
|
|
2
2
|
|
|
3
|
-
Official TypeScript client for HyperspaceDB gRPC API.
|
|
3
|
+
Official TypeScript client for HyperspaceDB gRPC API (v3.0.0-alpha.2).
|
|
4
4
|
|
|
5
5
|
Use this SDK for:
|
|
6
6
|
- collection lifecycle management
|
|
@@ -8,6 +8,9 @@ Use this SDK for:
|
|
|
8
8
|
- high-throughput batched search (`searchBatch`)
|
|
9
9
|
- bulk insertion (`batchInsert`)
|
|
10
10
|
- advanced filtering and hybrid search
|
|
11
|
+
- typed metadata (`string | number | boolean`)
|
|
12
|
+
- graph traversal APIs (`getNode`, `getNeighbors`, `getConceptParents`, `traverse`, `findSemanticClusters`)
|
|
13
|
+
- rebuild with metadata pruning (`rebuildIndexWithFilter`)
|
|
11
14
|
- multi-tenant authentication headers (`x-api-key`, `x-hyperspace-user-id`)
|
|
12
15
|
|
|
13
16
|
## Requirements
|
|
@@ -57,7 +60,7 @@ main().catch(console.error);
|
|
|
57
60
|
|
|
58
61
|
Create a new collection.
|
|
59
62
|
|
|
60
|
-
- `metric`: `"l2" | "cosine" | "poincare"`
|
|
63
|
+
- `metric`: `"l2" | "cosine" | "poincare" | "lorentz"`
|
|
61
64
|
|
|
62
65
|
### `deleteCollection(name)`
|
|
63
66
|
|
|
@@ -66,6 +69,16 @@ Delete collection and all its data.
|
|
|
66
69
|
### `insert(id, vector, meta?, collection?, durability?)`
|
|
67
70
|
|
|
68
71
|
Insert one vector. Accepts `number[]`, `Float32Array`, `Float64Array`.
|
|
72
|
+
Optional `typedMetadata` supports typed values for range/boolean filters.
|
|
73
|
+
|
|
74
|
+
### `insertText(id, text, meta?, collection?, durability?)`
|
|
75
|
+
|
|
76
|
+
Insert text to be vectorized and stored on the server side (Server-Side Embedding).
|
|
77
|
+
|
|
78
|
+
### `vectorize(text, metric?)`
|
|
79
|
+
|
|
80
|
+
Convert text to a dense vector using the server's embedding engine.
|
|
81
|
+
- `metric`: defaults to `"l2"`.
|
|
69
82
|
|
|
70
83
|
### `batchInsert(items, collection?, durability?)`
|
|
71
84
|
|
|
@@ -79,17 +92,17 @@ await client.batchInsert([
|
|
|
79
92
|
|
|
80
93
|
### `search(vector, topK, collection?, options?)`
|
|
81
94
|
|
|
82
|
-
Run nearest-neighbor search.
|
|
83
|
-
|
|
95
|
+
Run nearest-neighbor search with a raw vector.
|
|
96
|
+
|
|
97
|
+
### `searchText(text, topK, collection?, options?)`
|
|
98
|
+
|
|
99
|
+
Run nearest-neighbor search using text input. The text is vectorized on the server before searching.
|
|
84
100
|
|
|
85
101
|
```ts
|
|
86
|
-
const results = await client.
|
|
102
|
+
const results = await client.searchText("How to use HyperspaceDB?", 10, "coll", {
|
|
87
103
|
filters: [
|
|
88
|
-
{ match: { key: "category", value: "
|
|
89
|
-
|
|
90
|
-
],
|
|
91
|
-
hybridQuery: "latest smartphone",
|
|
92
|
-
hybridAlpha: 0.5
|
|
104
|
+
{ match: { key: "category", value: "docs" } }
|
|
105
|
+
]
|
|
93
106
|
});
|
|
94
107
|
```
|
|
95
108
|
|
|
@@ -97,6 +110,14 @@ const results = await client.search(vector, 10, "coll", {
|
|
|
97
110
|
|
|
98
111
|
Run multiple searches in one gRPC request to reduce RPC overhead.
|
|
99
112
|
|
|
113
|
+
### `searchWasserstein(vector, topK, collection?)`
|
|
114
|
+
|
|
115
|
+
Execute O(N) Cross-Feature Match (1D L1 CDF distance) instead of generic Poincare/L2. Ideal for comparing distributions.
|
|
116
|
+
|
|
117
|
+
### `searchMultiCollection(vector, collections, topK)`
|
|
118
|
+
|
|
119
|
+
Submit one vector and run parallel searches across multiple collections in one batch request (e.g. for Multi-Geometry benchmarks comparing L2, Cosine, Poincare, Lorentz).
|
|
120
|
+
|
|
100
121
|
### `getDigest(collection?)`
|
|
101
122
|
|
|
102
123
|
Retrieve collection stats and logical clock.
|
|
@@ -105,10 +126,142 @@ Retrieve collection stats and logical clock.
|
|
|
105
126
|
|
|
106
127
|
Close underlying gRPC channel.
|
|
107
128
|
|
|
129
|
+
### `subscribeToEvents(options, onEvent, onError?)`
|
|
130
|
+
|
|
131
|
+
Subscribe to CDC stream events from server:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
const stream = client.subscribeToEvents(
|
|
135
|
+
{ types: ["insert", "delete"], collection: "docs_ts" },
|
|
136
|
+
(event) => console.log("event:", event.toObject()),
|
|
137
|
+
(err) => console.error(err),
|
|
138
|
+
);
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `rebuildIndex(collection)`
|
|
142
|
+
|
|
143
|
+
Trigger index rebuild/vacuum for a collection.
|
|
144
|
+
|
|
145
|
+
### `triggerReconsolidation(collection, targetVector, learningRate)`
|
|
146
|
+
|
|
147
|
+
Trigger AI Sleep Mode natively: updates parameters using Flow Matching (Riemannian SGD) instantly via the database engine.
|
|
148
|
+
|
|
149
|
+
### `rebuildIndexWithFilter(collection, filter)`
|
|
150
|
+
|
|
151
|
+
Rebuild with metadata pruning for sleep/reconsolidation workflows.
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
await client.rebuildIndexWithFilter("docs_ts", {
|
|
155
|
+
key: "energy",
|
|
156
|
+
op: "lt",
|
|
157
|
+
value: 0.1,
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### `HyperbolicMath`
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
import { HyperbolicMath } from "hyperspace-sdk-ts";
|
|
165
|
+
|
|
166
|
+
const z = HyperbolicMath.mobiusAdd([0.1, 0.0], [0.2, 0.0]);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Provided utilities:
|
|
170
|
+
- `mobiusAdd(x, y, c?)`
|
|
171
|
+
- `expMap(x, v, c?)`
|
|
172
|
+
- `logMap(x, y, c?)`
|
|
173
|
+
- `riemannianGradient(x, euclideanGrad, c?)`
|
|
174
|
+
- `parallelTransport(x, y, v, c?)`
|
|
175
|
+
- `frechetMean(points, c?, maxIter?, tol?)`
|
|
176
|
+
|
|
177
|
+
### `CognitiveMath` (Spatial AI Engine)
|
|
178
|
+
|
|
179
|
+
Provides advanced tools for Agentic AI, running entirely on the client side:
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { CognitiveMath } from "hyperspace-sdk-ts";
|
|
183
|
+
|
|
184
|
+
// 1. Detect Hallucinations (Entropy approaches 1.0)
|
|
185
|
+
const entropy = CognitiveMath.localEntropy(candidateThought, neighbors, 1.0);
|
|
186
|
+
|
|
187
|
+
// 2. Proof of Convergence (Negative derivative = convergence)
|
|
188
|
+
const stability = CognitiveMath.lyapunovConvergence(chainOfThought, 1.0);
|
|
189
|
+
|
|
190
|
+
// 3. Extrapolate next thought (Koopman linearization)
|
|
191
|
+
const nextThought = CognitiveMath.koopmanExtrapolate(past, current, 1.0, 1.0);
|
|
192
|
+
|
|
193
|
+
// 4. Phase-Locked Loop for topic tracking
|
|
194
|
+
const syncedThought = CognitiveMath.contextResonance(thought, globalContext, 0.5, 1.0);
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Embedding Pipeline (Optional)
|
|
198
|
+
|
|
199
|
+
HyperspaceDB supports **per-geometry embeddings** — each geometry (`l2`, `cosine`, `poincare`, `lorentz`) can have its own backend independently.
|
|
200
|
+
|
|
201
|
+
### Server-Side Config (`.env`)
|
|
202
|
+
|
|
203
|
+
```env
|
|
204
|
+
HYPERSPACE_EMBED=true
|
|
205
|
+
|
|
206
|
+
# Cosine via OpenAI
|
|
207
|
+
HS_EMBED_COSINE_PROVIDER=openai
|
|
208
|
+
HS_EMBED_COSINE_EMBED_MODEL=text-embedding-3-small
|
|
209
|
+
HS_EMBED_COSINE_API_KEY=sk-...
|
|
210
|
+
|
|
211
|
+
# Poincaré via HuggingFace Hub (downloads model.onnx + tokenizer.json)
|
|
212
|
+
HS_EMBED_POINCARE_PROVIDER=huggingface
|
|
213
|
+
HS_EMBED_POINCARE_HF_MODEL_ID=your-org/cde-spatial-poincare-128d
|
|
214
|
+
HS_EMBED_POINCARE_DIM=128
|
|
215
|
+
HF_TOKEN=hf_... # Optional — for gated/private models
|
|
216
|
+
|
|
217
|
+
# Lorentz via local ONNX file
|
|
218
|
+
HS_EMBED_LORENTZ_PROVIDER=local
|
|
219
|
+
HS_EMBED_LORENTZ_MODEL_PATH=./models/lorentz_128d.onnx
|
|
220
|
+
HS_EMBED_LORENTZ_TOKENIZER_PATH=./models/lorentz_128d_tokenizer.json
|
|
221
|
+
HS_EMBED_LORENTZ_DIM=129 # spatial_dim + 1 for time component
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Client-Side Embedder
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
import { OpenAIEmbedder, HuggingFaceEmbedder, LocalOnnxEmbedder } from "hyperspace-sdk-ts";
|
|
228
|
+
|
|
229
|
+
// OpenAI API
|
|
230
|
+
const embedder = new OpenAIEmbedder({ apiKey: "sk-...", model: "text-embedding-3-small" });
|
|
231
|
+
const vector = await embedder.encode("my text");
|
|
232
|
+
|
|
233
|
+
// HuggingFace Hub — downloads model.onnx + tokenizer.json on first use
|
|
234
|
+
const embedder = new HuggingFaceEmbedder({
|
|
235
|
+
modelId: "BAAI/bge-small-en-v1.5",
|
|
236
|
+
geometry: "cosine",
|
|
237
|
+
hfToken: process.env.HF_TOKEN, // Optional
|
|
238
|
+
});
|
|
239
|
+
const vector = await embedder.encode("my text");
|
|
240
|
+
|
|
241
|
+
// Local ONNX file
|
|
242
|
+
const embedder = new LocalOnnxEmbedder({
|
|
243
|
+
modelPath: "./models/bge-small.onnx",
|
|
244
|
+
tokenizerPath: "./models/bge-small-tokenizer.json",
|
|
245
|
+
geometry: "cosine",
|
|
246
|
+
});
|
|
247
|
+
const vector = await embedder.encode("my text");
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Supported Geometries
|
|
251
|
+
|
|
252
|
+
| Geometry | Post-Processing | Best For |
|
|
253
|
+
|---|---|---|
|
|
254
|
+
| `cosine` | Unit normalize | Semantic similarity |
|
|
255
|
+
| `l2` | Unit normalize | Euclidean distance tasks |
|
|
256
|
+
| `poincare` | Clamp to unit ball | Hierarchical data (trees, ontologies) |
|
|
257
|
+
| `lorentz` | None (model handles it) | Mixed hierarchical + semantic |
|
|
258
|
+
|
|
108
259
|
## Performance Notes
|
|
109
260
|
|
|
110
261
|
- Prefer `searchBatch` and `batchInsert` for throughput-heavy services.
|
|
111
262
|
- Reuse one client instance per process or worker.
|
|
263
|
+
- For `lorentz` geometry, dimension = spatial_dim + 1 (the time component x₀).
|
|
264
|
+
- For `huggingface` provider, models are cached locally after first download.
|
|
112
265
|
|
|
113
266
|
## Error Handling
|
|
114
267
|
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HyperspaceClient } from './client';
|
|
2
|
+
export declare class TribunalContext {
|
|
3
|
+
private client;
|
|
4
|
+
private collectionName;
|
|
5
|
+
/**
|
|
6
|
+
* Heterogeneous Tribunal Framework (Tribunal Router).
|
|
7
|
+
* Evaluates LLM claims by verifying geometric/logical paths between concepts
|
|
8
|
+
* using the HyperspaceDB Graph Traversal API.
|
|
9
|
+
*/
|
|
10
|
+
constructor(client: HyperspaceClient, collectionName: string);
|
|
11
|
+
/**
|
|
12
|
+
* Calculates Graph-Geometric Trust Score by traversing from Concept A to Concept B.
|
|
13
|
+
* Returns a score in [0.0, 1.0]. A score of 0.0 means disconnected (Hallucination).
|
|
14
|
+
*/
|
|
15
|
+
evaluateClaim(conceptAId: number, conceptBId: number, maxDepth?: number, maxNodes?: number): Promise<number>;
|
|
16
|
+
}
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TribunalContext = void 0;
|
|
4
|
+
class TribunalContext {
|
|
5
|
+
/**
|
|
6
|
+
* Heterogeneous Tribunal Framework (Tribunal Router).
|
|
7
|
+
* Evaluates LLM claims by verifying geometric/logical paths between concepts
|
|
8
|
+
* using the HyperspaceDB Graph Traversal API.
|
|
9
|
+
*/
|
|
10
|
+
constructor(client, collectionName) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
this.collectionName = collectionName;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Calculates Graph-Geometric Trust Score by traversing from Concept A to Concept B.
|
|
16
|
+
* Returns a score in [0.0, 1.0]. A score of 0.0 means disconnected (Hallucination).
|
|
17
|
+
*/
|
|
18
|
+
async evaluateClaim(conceptAId, conceptBId, maxDepth = 5, maxNodes = 256) {
|
|
19
|
+
if (conceptAId === conceptBId)
|
|
20
|
+
return 1.0;
|
|
21
|
+
try {
|
|
22
|
+
// Extract local geometric subgraph via the Graph Traversal API
|
|
23
|
+
const nodes = await this.client.traverse(conceptAId, 0, maxDepth, maxNodes, this.collectionName);
|
|
24
|
+
if (!nodes || nodes.length === 0)
|
|
25
|
+
return 0.0;
|
|
26
|
+
const adjList = {};
|
|
27
|
+
for (const node of nodes) {
|
|
28
|
+
adjList[node.id] = node.neighbors;
|
|
29
|
+
}
|
|
30
|
+
if (!adjList[conceptAId])
|
|
31
|
+
return 0.0;
|
|
32
|
+
// Perform BFS to find the shortest geometric path distance
|
|
33
|
+
const queue = [[conceptAId, 0]];
|
|
34
|
+
const visited = new Set([conceptAId]);
|
|
35
|
+
let pathLength = -1;
|
|
36
|
+
while (queue.length > 0) {
|
|
37
|
+
const [current, depth] = queue.shift();
|
|
38
|
+
if (current === conceptBId) {
|
|
39
|
+
pathLength = depth;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
if (depth >= maxDepth)
|
|
43
|
+
continue;
|
|
44
|
+
const neighbors = adjList[current] || [];
|
|
45
|
+
for (const neighbor of neighbors) {
|
|
46
|
+
if (!visited.has(neighbor)) {
|
|
47
|
+
visited.add(neighbor);
|
|
48
|
+
queue.push([neighbor, depth + 1]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (pathLength === -1)
|
|
53
|
+
return 0.0; // No logical pathway
|
|
54
|
+
// Geometric Trust Score decays smoothly based on shortest path
|
|
55
|
+
const trustScore = Math.exp(-0.4 * pathLength);
|
|
56
|
+
return trustScore;
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
console.error("TribunalContext evaluateClaim Error:", e);
|
|
60
|
+
return 0.0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.TribunalContext = TribunalContext;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as grpc from '@grpc/grpc-js';
|
|
2
|
+
import { DurabilityLevel, EventMessage } from './proto/hyperspace_pb';
|
|
3
|
+
import * as hyperspace_pb from './proto/hyperspace_pb';
|
|
4
|
+
export * as CognitiveMath from './math';
|
|
5
|
+
export { TribunalContext } from './agents';
|
|
2
6
|
export { DurabilityLevel };
|
|
7
|
+
export type TypedMetadataValue = string | number | boolean;
|
|
3
8
|
export interface Filter {
|
|
4
9
|
match?: {
|
|
5
10
|
key: string;
|
|
@@ -17,6 +22,9 @@ export interface SearchResult {
|
|
|
17
22
|
metadata: {
|
|
18
23
|
[key: string]: string;
|
|
19
24
|
};
|
|
25
|
+
typedMetadata: {
|
|
26
|
+
[key: string]: TypedMetadataValue;
|
|
27
|
+
};
|
|
20
28
|
}
|
|
21
29
|
export interface GraphNode {
|
|
22
30
|
id: number;
|
|
@@ -25,35 +33,73 @@ export interface GraphNode {
|
|
|
25
33
|
metadata: {
|
|
26
34
|
[key: string]: string;
|
|
27
35
|
};
|
|
36
|
+
typedMetadata: {
|
|
37
|
+
[key: string]: TypedMetadataValue;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface VacuumFilter {
|
|
41
|
+
key: string;
|
|
42
|
+
op: 'lt' | 'lte' | 'gt' | 'gte' | 'eq' | 'ne';
|
|
43
|
+
value: number;
|
|
44
|
+
}
|
|
45
|
+
export type EventTypeName = 'insert' | 'delete';
|
|
46
|
+
export interface SubscribeOptions {
|
|
47
|
+
types?: EventTypeName[];
|
|
48
|
+
collection?: string;
|
|
28
49
|
}
|
|
50
|
+
export declare const HyperbolicMath: {
|
|
51
|
+
projectToBall(x: number[], c?: number): number[];
|
|
52
|
+
mobiusAdd(x: number[], y: number[], c?: number): number[];
|
|
53
|
+
expMap(x: number[], v: number[], c?: number): number[];
|
|
54
|
+
logMap(x: number[], y: number[], c?: number): number[];
|
|
55
|
+
riemannianGradient(x: number[], euclideanGrad: number[], c?: number): number[];
|
|
56
|
+
parallelTransport(x: number[], y: number[], v: number[], c?: number): number[];
|
|
57
|
+
frechetMean(points: number[][], c?: number, maxIter?: number, tol?: number): number[];
|
|
58
|
+
};
|
|
29
59
|
export declare class HyperspaceClient {
|
|
30
60
|
private client;
|
|
31
61
|
private metadata;
|
|
32
62
|
private static toVectorList;
|
|
63
|
+
private static toProtoMetadataValue;
|
|
64
|
+
private static parseTypedMetadata;
|
|
33
65
|
constructor(host?: string, apiKey?: string, userId?: string);
|
|
34
66
|
createCollection(name: string, dimension: number, metric: string): Promise<boolean>;
|
|
35
67
|
deleteCollection(name: string): Promise<boolean>;
|
|
36
68
|
insert(id: number, vector: number[] | Float32Array | Float64Array, meta?: {
|
|
37
69
|
[key: string]: string;
|
|
70
|
+
}, collection?: string, durability?: DurabilityLevel, typedMetadata?: {
|
|
71
|
+
[key: string]: TypedMetadataValue;
|
|
72
|
+
}): Promise<boolean>;
|
|
73
|
+
insertText(id: number, text: string, meta?: {
|
|
74
|
+
[key: string]: string;
|
|
38
75
|
}, collection?: string, durability?: DurabilityLevel): Promise<boolean>;
|
|
76
|
+
vectorize(text: string, metric?: string): Promise<number[]>;
|
|
39
77
|
batchInsert(items: {
|
|
40
78
|
id: number;
|
|
41
79
|
vector: number[] | Float32Array | Float64Array;
|
|
42
80
|
metadata?: {
|
|
43
81
|
[key: string]: string;
|
|
44
82
|
};
|
|
83
|
+
typedMetadata?: {
|
|
84
|
+
[key: string]: TypedMetadataValue;
|
|
85
|
+
};
|
|
45
86
|
}[], collection?: string, durability?: DurabilityLevel): Promise<boolean>;
|
|
46
87
|
search(vector: number[] | Float32Array | Float64Array, topK: number, collection?: string, options?: {
|
|
47
88
|
filters?: Filter[];
|
|
48
89
|
hybridQuery?: string;
|
|
49
90
|
hybridAlpha?: number;
|
|
50
91
|
}): Promise<SearchResult[]>;
|
|
92
|
+
searchText(text: string, topK: number, collection?: string, options?: {
|
|
93
|
+
filters?: Filter[];
|
|
94
|
+
}): Promise<SearchResult[]>;
|
|
51
95
|
searchBatch(vectors: Array<number[] | Float32Array | Float64Array>, topK: number, collection?: string): Promise<SearchResult[][]>;
|
|
52
96
|
getDigest(collection?: string): Promise<{
|
|
53
97
|
logicalClock: number;
|
|
54
98
|
stateHash: number;
|
|
55
99
|
count: number;
|
|
56
100
|
}>;
|
|
101
|
+
rebuildIndex(collection: string): Promise<boolean>;
|
|
102
|
+
rebuildIndexWithFilter(collection: string, filter: VacuumFilter): Promise<boolean>;
|
|
57
103
|
getNode(id: number, layer?: number, collection?: string): Promise<GraphNode>;
|
|
58
104
|
getNeighbors(id: number, layer?: number, limit?: number, offset?: number, collection?: string): Promise<GraphNode[]>;
|
|
59
105
|
getConceptParents(id: number, layer?: number, limit?: number, collection?: string): Promise<GraphNode[]>;
|
|
@@ -64,5 +110,8 @@ export declare class HyperspaceClient {
|
|
|
64
110
|
filters?: Filter[];
|
|
65
111
|
}): Promise<GraphNode[]>;
|
|
66
112
|
findSemanticClusters(layer?: number, minClusterSize?: number, maxClusters?: number, maxNodes?: number, collection?: string): Promise<number[][]>;
|
|
113
|
+
subscribeToEvents(options: SubscribeOptions, onEvent: (event: EventMessage) => void, onError?: (err: Error) => void): grpc.ClientReadableStream<EventMessage>;
|
|
114
|
+
syncHandshake(collection: string, clientBuckets: number[], clientLogicalClock?: number, clientCount?: number): Promise<hyperspace_pb.SyncHandshakeResponse.AsObject>;
|
|
115
|
+
syncPull(collection: string, bucketIndices: number[], onData: (data: hyperspace_pb.SyncVectorData.AsObject) => void, onError?: (err: Error) => void): grpc.ClientReadableStream<hyperspace_pb.SyncVectorData>;
|
|
67
116
|
close(): void;
|
|
68
117
|
}
|