@littlebigbrain/client 0.8.0 → 0.9.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 +25 -5
- package/dist/client.d.ts +55 -176
- package/dist/client.js +184 -236
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/namespaces.d.ts +15 -84
- package/dist/namespaces.js +31 -190
- package/dist/schema.d.ts +1164 -5164
- package/dist/transport.d.ts +9 -2
- package/dist/transport.js +9 -0
- package/dist/types.d.ts +6 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @littlebigbrain/client
|
|
2
2
|
|
|
3
|
-
The typed TypeScript client for [Little Big Brain](https://littlebigbrain.com) — write graph facts
|
|
3
|
+
The typed TypeScript client for [Little Big Brain](https://littlebigbrain.com) — write graph facts and query one immutable published snapshot. Request and response types are generated from the API contract, so every call is fully typed. Runs anywhere there's a global `fetch`: Node 18+, browsers, and edge workers.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
npm install @littlebigbrain/client
|
|
@@ -32,13 +32,14 @@ await graph.facts.create(
|
|
|
32
32
|
{ idempotencyKey: "policy-42-v1" },
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
// 2.
|
|
36
|
-
await
|
|
35
|
+
// 2. Publication is automatic. Inspect one coherent watermark when needed.
|
|
36
|
+
const published = await lbb.readSnapshot();
|
|
37
|
+
console.log(published.snapshot.served_at_seq, published.query_lag_commits);
|
|
37
38
|
|
|
38
39
|
// 3. Hybrid search over the snapshot.
|
|
39
40
|
const results = await graph.search.hybrid(
|
|
40
41
|
"How long are customer records retained?",
|
|
41
|
-
{ topK: 10,
|
|
42
|
+
{ topK: 10, consistency: "eventual" },
|
|
42
43
|
);
|
|
43
44
|
```
|
|
44
45
|
|
|
@@ -77,6 +78,20 @@ await graph.facts.import(
|
|
|
77
78
|
);
|
|
78
79
|
```
|
|
79
80
|
|
|
81
|
+
For large or long-running loads, stream records to a durable job instead:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const accepted = await lbb.submitImport(records(), {
|
|
85
|
+
idempotencyKey: "hubspot:portal-42:run-2026-07-29",
|
|
86
|
+
});
|
|
87
|
+
const completed = await lbb.waitForImportJob(accepted.job_id);
|
|
88
|
+
console.log(completed.state, completed.committed_commit_seq);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`records()` may be an iterable or async iterable. Success means every grouped
|
|
92
|
+
commit is durable and final publication was enqueued; it does not mean indexes
|
|
93
|
+
have already reached `committed_commit_seq`.
|
|
94
|
+
|
|
80
95
|
**Time-travel read.** Pin any search to a past instant — results reflect the graph as it was then:
|
|
81
96
|
|
|
82
97
|
```ts
|
|
@@ -97,7 +112,12 @@ Methods return parsed JSON and throw `LbbError` (with `status`, `code`, `message
|
|
|
97
112
|
|
|
98
113
|
## More
|
|
99
114
|
|
|
100
|
-
The `graph(...)` scope exposes `facts`, `search`, `entities`, `
|
|
115
|
+
The `graph(...)` scope exposes `facts`, `search`, `entities`, `ontology`,
|
|
116
|
+
`query`, `schema`, and `context` namespaces. `context` includes vocabulary
|
|
117
|
+
suggestion, term resolution, relation decoding, and groundability inspection; `schema`
|
|
118
|
+
reads or atomically publishes the active ontology/shapes bundle. Writes enqueue
|
|
119
|
+
published-generation maintenance automatically. Every generated shape is
|
|
120
|
+
available as `Schemas["TypeName"]`.
|
|
101
121
|
|
|
102
122
|
Full reference and guides: [docs.littlebigbrain.com/sdks/typescript](https://docs.littlebigbrain.com/sdks/typescript/).
|
|
103
123
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ImportLine, LbbClientOptions, ListResponse, RawLbbResponse, ReadConsistencyOptions,
|
|
1
|
+
import type { DurableImportSource, ImportLine, LbbClientOptions, ListResponse, RawLbbResponse, ReadConsistencyOptions, RdfImportOptions, Schemas, SearchConsistency, SparqlResults } from "./types.js";
|
|
2
2
|
import { type CallOptions, type RequestOptions } from "./transport.js";
|
|
3
|
-
import { ContextNamespace, EntityNamespace, GraphNamespace,
|
|
3
|
+
import { ContextNamespace, EntityNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace } from "./namespaces.js";
|
|
4
4
|
export { parseSparqlResults } from "./types.js";
|
|
5
|
-
export type { AttributeFilter, AttributeFilterOp, AttributeFilterValue, EntityAttributeFilterOptions, EntityPropertiesLine, FetchLike, FlatProperties, ImportLine, LbbClientOptions, LbbRequestEvent, LbbResponseEvent, LbbRetryEvent, LbbErrorPayload, ListResponse, RawLbbResponse, ReadConsistencyOptions,
|
|
6
|
-
export { LbbError } from "./transport.js";
|
|
5
|
+
export type { AttributeFilter, AttributeFilterOp, AttributeFilterValue, EntityAttributeFilterOptions, EntityPropertiesLine, DurableImportLine, DurableImportSource, FetchLike, FlatProperties, ImportLine, LbbClientOptions, LbbRequestEvent, LbbResponseEvent, LbbRetryEvent, LbbErrorPayload, ListResponse, RawLbbResponse, ReadConsistencyOptions, RdfImportOptions, Schemas, SearchConsistency, SparqlResults, SparqlResultsJson, SparqlTerm, CommitRequest, CommitResponse, Entity, EntitySelector, GraphMetadata, GraphSummary, SchemaView, SearchRequest, SearchResponse, SearchResult, Snapshot, } from "./types.js";
|
|
6
|
+
export { LbbCapabilityError, LbbError } from "./transport.js";
|
|
7
7
|
export type { CallOptions, Query, QueryValue, RequestOptions, } from "./transport.js";
|
|
8
|
-
export type {
|
|
9
|
-
export { ContextNamespace, EntityNamespace, FactsNamespace, GraphNamespace,
|
|
8
|
+
export type { HybridSearchOptions } from "./namespaces.js";
|
|
9
|
+
export { ContextNamespace, EntityNamespace, FactsNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, } from "./namespaces.js";
|
|
10
10
|
export interface IndexLineageObservation {
|
|
11
11
|
metadata: Schemas["GraphMetadataResponse"];
|
|
12
12
|
lineage: Schemas["IndexLineage"];
|
|
@@ -36,11 +36,11 @@ export declare class LbbClient {
|
|
|
36
36
|
private readonly onRequest?;
|
|
37
37
|
private readonly onResponse?;
|
|
38
38
|
private readonly onRetry?;
|
|
39
|
+
private capabilities?;
|
|
39
40
|
/** A5 default read consistency applied when a read omits its own value. */
|
|
40
41
|
readonly defaultConsistency?: SearchConsistency;
|
|
41
42
|
readonly context: ContextNamespace;
|
|
42
43
|
readonly search: SearchNamespace;
|
|
43
|
-
readonly indexes: IndexNamespace;
|
|
44
44
|
readonly entities: EntityNamespace;
|
|
45
45
|
readonly schema: SchemaNamespace;
|
|
46
46
|
readonly ontology: OntologyNamespace;
|
|
@@ -76,6 +76,7 @@ export declare class LbbClient {
|
|
|
76
76
|
request<T>(method: string, path: string, opts?: RequestOptions): Promise<T>;
|
|
77
77
|
private mutationKey;
|
|
78
78
|
idempotencyKey(prefix?: string): string;
|
|
79
|
+
private requireCapability;
|
|
79
80
|
/** Commit triplets and optional entity embeddings. Prefer `client.graph("main").facts.create(...)`. */
|
|
80
81
|
commit(body: Schemas["TripletCommitFile"], opts?: {
|
|
81
82
|
idempotencyKey?: string;
|
|
@@ -97,30 +98,47 @@ export declare class LbbClient {
|
|
|
97
98
|
* streamed request without a single oversized commit. Pass `lines` as an array
|
|
98
99
|
* (serialized to NDJSON here) or a pre-built NDJSON string.
|
|
99
100
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* the throttle): import the whole dataset, index once. The response's `index`
|
|
105
|
-
* object reports whether the build ran or was skipped.
|
|
101
|
+
* A successful import durably enqueues one complete published-generation
|
|
102
|
+
* build after the final batch. It does not build index families or wait for
|
|
103
|
+
* visibility; the response's `published_generation` object carries the
|
|
104
|
+
* durable job and due sequence to observe.
|
|
106
105
|
*/
|
|
107
106
|
import(lines: ImportLine[] | string, opts?: {
|
|
108
107
|
batch?: number;
|
|
109
108
|
strict?: boolean;
|
|
110
109
|
observedAt?: string;
|
|
111
|
-
index?: boolean;
|
|
112
110
|
idempotencyKey?: string;
|
|
113
111
|
}): Promise<Schemas["GraphImportResponse"] & {
|
|
114
112
|
commitSeq: number | null;
|
|
115
113
|
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Stream NDJSON into immutable storage and enqueue a durable import job.
|
|
116
|
+
*
|
|
117
|
+
* The idempotency key is mandatory and binds the key to the uploaded content.
|
|
118
|
+
* Streaming uploads are attempted once: a one-shot async iterator cannot be
|
|
119
|
+
* replayed safely by an automatic HTTP retry. Call this method again with a
|
|
120
|
+
* fresh iterable and the same key to perform an explicit idempotent replay.
|
|
121
|
+
*/
|
|
122
|
+
submitImport(lines: DurableImportSource, opts: {
|
|
123
|
+
idempotencyKey: string;
|
|
124
|
+
batch?: number;
|
|
125
|
+
strict?: boolean;
|
|
126
|
+
observedAt?: string;
|
|
127
|
+
signal?: AbortSignal;
|
|
128
|
+
}): Promise<Schemas["GraphImportJobAccepted"]>;
|
|
129
|
+
getImportJob(jobId: string): Promise<Schemas["GraphImportJobStatus"]>;
|
|
130
|
+
cancelImportJob(jobId: string): Promise<Schemas["GraphImportJobCancelResponse"]>;
|
|
131
|
+
waitForImportJob(jobId: string, opts?: {
|
|
132
|
+
pollIntervalMs?: number;
|
|
133
|
+
timeoutMs?: number;
|
|
134
|
+
signal?: AbortSignal;
|
|
135
|
+
}): Promise<Schemas["GraphImportJobStatus"]>;
|
|
116
136
|
/**
|
|
117
137
|
* Bulk-ingest N-Triples, Turtle, N-Quads, or TriG without client-side conversion. Resource-object
|
|
118
138
|
* triples become keyed Resource edges; literal-object triples become text
|
|
119
139
|
* properties on the subject Resource.
|
|
120
140
|
*/
|
|
121
141
|
importRdf(rdf: string, opts?: RdfImportOptions): Promise<Schemas["GraphRdfImportResponse"]>;
|
|
122
|
-
/** Export the snapshot-visible RDF projection as Turtle, N-Triples, TriG, or N-Quads. */
|
|
123
|
-
exportRdf(opts?: RdfExportOptions): Promise<string>;
|
|
124
142
|
/**
|
|
125
143
|
* Retract specific edges and/or every edge touching given entities. Appends
|
|
126
144
|
* superseding retract events rather than deleting — history stays visible in an
|
|
@@ -273,19 +291,15 @@ export declare class LbbClient {
|
|
|
273
291
|
kind: string;
|
|
274
292
|
run: number;
|
|
275
293
|
}): Promise<Schemas["ModelSplitAudit"]>;
|
|
276
|
-
/**
|
|
277
|
-
* Champion vs challenger retrieval over one pinned snapshot. Returns
|
|
278
|
-
* promotion evidence (hit-rate@k, latency, overlap); never promotes.
|
|
279
|
-
*/
|
|
280
|
-
shadowEval(body: Schemas["ShadowEvalRequest"]): Promise<Schemas["ShadowEvalResponse"]>;
|
|
281
|
-
/**
|
|
282
|
-
* Execution-verified QA probes generated from the graph's current edges —
|
|
283
|
-
* labels are the executed projections, so they are verified by construction.
|
|
284
|
-
* Feeds `shadowEval` directly.
|
|
285
|
-
*/
|
|
294
|
+
/** Execution-verified QA probes generated from the graph's current edges. */
|
|
286
295
|
syntheticEval(opts?: {
|
|
287
296
|
limit?: number;
|
|
288
297
|
}): Promise<Schemas["SyntheticEvalResponse"]>;
|
|
298
|
+
/**
|
|
299
|
+
* Compare champion and challenger retrieval over one pinned published
|
|
300
|
+
* snapshot. The endpoint returns promotion evidence but never promotes.
|
|
301
|
+
*/
|
|
302
|
+
shadowEval(body: Schemas["ShadowEvalRequest"]): Promise<Schemas["ShadowEvalResponse"]>;
|
|
289
303
|
/** The doubling retrain policy: is a retrain due for this model kind? */
|
|
290
304
|
modelCadence(opts: {
|
|
291
305
|
kind: string;
|
|
@@ -303,15 +317,6 @@ export declare class LbbClient {
|
|
|
303
317
|
trainingConfig(): Promise<Schemas["ModelTrainingConfig"]>;
|
|
304
318
|
/** Set the automatic-training configuration (`auto_train` toggle + kinds). */
|
|
305
319
|
setTrainingConfig(body: Schemas["ModelTrainingConfig"]): Promise<Schemas["ModelTrainingConfig"]>;
|
|
306
|
-
/**
|
|
307
|
-
* Verdict on an ask (`accepted` | `rejected` | `corrected` + the right
|
|
308
|
-
* plan), joined to the ask's trace by `ask_id` — the planner fine-tune's
|
|
309
|
-
* explicit feedback capture. `accepted: false` in the response means
|
|
310
|
-
* signal capture is off on this deployment (the contract is identical).
|
|
311
|
-
*/
|
|
312
|
-
askFeedback(body: Schemas["AskFeedbackRequest"], opts?: {
|
|
313
|
-
idempotencyKey?: string;
|
|
314
|
-
}): Promise<Schemas["AskFeedbackResponse"]>;
|
|
315
320
|
ingestSignals(body: Schemas["SignalIngestRequest"], opts?: {
|
|
316
321
|
idempotencyKey?: string;
|
|
317
322
|
}): Promise<Schemas["SignalIngestResponse"]>;
|
|
@@ -324,36 +329,22 @@ export declare class LbbClient {
|
|
|
324
329
|
externalPlannerTrace(payload: Schemas["ExternalPlannerTraceV1"], opts?: {
|
|
325
330
|
idempotencyKey?: string;
|
|
326
331
|
}): Promise<Schemas["SignalIngestResponse"]>;
|
|
327
|
-
/**
|
|
328
|
-
* The planner fine-tune's training feed: accepted/corrected feedback
|
|
329
|
-
* joined to its traces (signals ≤ the split pin), topped up with
|
|
330
|
-
* execution-verified synthetic plans.
|
|
331
|
-
*/
|
|
332
|
+
/** Planner training examples at or before an optional signal split. */
|
|
332
333
|
plannerDataset(opts?: {
|
|
333
334
|
limit?: number;
|
|
334
335
|
splitSeq?: number;
|
|
335
336
|
}): Promise<Schemas["PlannerDatasetResponse"]>;
|
|
336
|
-
/**
|
|
337
|
-
* The DPO pass's training feed: preference pairs from corrected verdicts,
|
|
338
|
-
* paired rejections, and synthetic corrupted-slot pairs.
|
|
339
|
-
*/
|
|
337
|
+
/** Planner preference pairs at or before an optional signal split. */
|
|
340
338
|
plannerPreferenceDataset(opts?: {
|
|
341
339
|
limit?: number;
|
|
342
340
|
splitSeq?: number;
|
|
343
341
|
}): Promise<Schemas["PlannerPreferenceDatasetResponse"]>;
|
|
344
|
-
/**
|
|
345
|
-
* The suggest-ranker trainer's probe feed: `suggestion_adopted` signals
|
|
346
|
-
* (typed prefix + adopted text) ≤ the split pin, topped up with
|
|
347
|
-
* execution-verified synthetic vocabulary pairs.
|
|
348
|
-
*/
|
|
342
|
+
/** Suggest-ranker examples at or before an optional signal split. */
|
|
349
343
|
suggestDataset(opts?: {
|
|
350
344
|
limit?: number;
|
|
351
345
|
splitSeq?: number;
|
|
352
346
|
}): Promise<Schemas["SuggestDatasetResponse"]>;
|
|
353
|
-
/**
|
|
354
|
-
* The extractor fine-tune's training feed: EPISODE transcripts joined to
|
|
355
|
-
* the facts the observe pipeline committed from them.
|
|
356
|
-
*/
|
|
347
|
+
/** Extractor examples at or before an optional signal split. */
|
|
357
348
|
extractorDataset(opts?: {
|
|
358
349
|
limit?: number;
|
|
359
350
|
splitSeq?: number;
|
|
@@ -369,8 +360,7 @@ export declare class LbbClient {
|
|
|
369
360
|
}): Promise<unknown>;
|
|
370
361
|
/**
|
|
371
362
|
* Promote a finished `planner_lora` training run: gated on held-out slot
|
|
372
|
-
* exactness
|
|
373
|
-
* then serves.
|
|
363
|
+
* exactness and recorded as a `kind=planner` training run.
|
|
374
364
|
*/
|
|
375
365
|
promotePlanner(opts: {
|
|
376
366
|
runId: string;
|
|
@@ -386,28 +376,11 @@ export declare class LbbClient {
|
|
|
386
376
|
* pair that admits a single relation flags `signature_forced`.
|
|
387
377
|
*/
|
|
388
378
|
suggest(body: Schemas["SearchSuggestRequest"]): Promise<Schemas["SearchSuggestResponse"]>;
|
|
389
|
-
/**
|
|
390
|
-
* Snap free text to the nearest real vocabulary item. Embedding cosine
|
|
391
|
-
* on a managed graph, else lexical; never fabricates a term.
|
|
392
|
-
*/
|
|
379
|
+
/** Snap free text to the nearest term in the pinned published vocabulary. */
|
|
393
380
|
resolveTerm(body: Schemas["ResolveTermRequest"]): Promise<Schemas["ResolveTermResponse"]>;
|
|
394
|
-
/**
|
|
395
|
-
* Ground a natural-language question to the graph's real vocabulary, retrieve
|
|
396
|
-
* against the pinned snapshot, and answer with citations (`/v1/ask`).
|
|
397
|
-
*/
|
|
398
|
-
ask(body: Schemas["AskRequest"]): Promise<Schemas["AskResponse"]>;
|
|
399
|
-
/**
|
|
400
|
-
* Name the relation between two entities (`/v1/decode`): the DB narrows the
|
|
401
|
-
* candidates to the type pair's admissible relations, answers alone
|
|
402
|
-
* when the pair forces a single relation, and otherwise decodes it with the
|
|
403
|
-
* graph-native fine-tuned model — the "DB narrows, cheap model decodes" call.
|
|
404
|
-
*/
|
|
381
|
+
/** Decode a relation from the graph's admissible published vocabulary. */
|
|
405
382
|
decode(body: Schemas["DecodeRequest"]): Promise<Schemas["DecodeResponse"]>;
|
|
406
|
-
/**
|
|
407
|
-
* Report which completion mechanisms will carry on this graph:
|
|
408
|
-
* signature sparsity, name semantics, sampled narrowing recall, and a
|
|
409
|
-
* narrow / narrow+finetune / lexical-first recommendation.
|
|
410
|
-
*/
|
|
383
|
+
/** Report completion strategy fitness for the pinned published graph. */
|
|
411
384
|
groundability(opts?: {
|
|
412
385
|
sample?: number;
|
|
413
386
|
}): Promise<Schemas["GroundabilityReport"]>;
|
|
@@ -438,8 +411,6 @@ export declare class LbbClient {
|
|
|
438
411
|
name?: string;
|
|
439
412
|
relations?: string[];
|
|
440
413
|
asOf?: string;
|
|
441
|
-
/** Require the bounded ranged-adjacency path; returns `index_busy` while unavailable. */
|
|
442
|
-
indexed?: boolean;
|
|
443
414
|
}): Promise<Schemas["EntityNeighborhoodResponse"]>;
|
|
444
415
|
/** Exact type cardinality plus a bounded deterministic sample from ranged adjacency. */
|
|
445
416
|
entityTypeSample(opts: {
|
|
@@ -466,37 +437,11 @@ export declare class LbbClient {
|
|
|
466
437
|
asOf?: string;
|
|
467
438
|
asOfCommitSeq?: number;
|
|
468
439
|
}): Promise<Schemas["EntityDetailResponse"]>;
|
|
469
|
-
/**
|
|
470
|
-
* Paged edge listing. Scope to one node with `id` (or `type`+`name`) and a
|
|
471
|
-
* `direction` (`out`/`in`/`both`) to walk **every** edge of a high-degree node
|
|
472
|
-
* — `entityDetail` returns the full set but is awkward to page; this carries
|
|
473
|
-
* `offset`/`limit` and reports `total_count`. Optional `relation`/`q` filters
|
|
474
|
-
* and an `asOf`/`asOfCommitSeq` snapshot pin. Each row carries `valid_time`, so
|
|
475
|
-
* the page is enough to reconstruct a per-edge timeline.
|
|
476
|
-
*/
|
|
477
|
-
graphEdges(opts?: {
|
|
478
|
-
id?: string;
|
|
479
|
-
type?: string;
|
|
480
|
-
name?: string;
|
|
481
|
-
direction?: "out" | "in" | "both";
|
|
482
|
-
relation?: string;
|
|
483
|
-
q?: string;
|
|
484
|
-
limit?: number;
|
|
485
|
-
/** Opaque cursor from a previous page's `next_cursor`. */
|
|
486
|
-
cursor?: string | number;
|
|
487
|
-
/** @deprecated Legacy alias for `cursor` (still accepted by the server). */
|
|
488
|
-
offset?: number;
|
|
489
|
-
asOf?: string;
|
|
490
|
-
asOfCommitSeq?: number;
|
|
491
|
-
}): Promise<ListResponse<Schemas["GraphEdgeRow"]>>;
|
|
492
440
|
/**
|
|
493
441
|
* Page through every row of a list endpoint, following `next_cursor` until
|
|
494
442
|
* exhausted. Pass a fetcher that takes a cursor and returns a
|
|
495
443
|
* {@link ListResponse}:
|
|
496
|
-
*
|
|
497
|
-
* for await (const e of client.listAll((cursor) =>
|
|
498
|
-
* client.entities.list({ cursor, fields: "title" }))) { … }
|
|
499
|
-
* ```
|
|
444
|
+
* The caller supplies a bounded collection endpoint and its cursor.
|
|
500
445
|
*/
|
|
501
446
|
listAll<T>(fetchPage: (cursor?: string) => Promise<ListResponse<T>>): AsyncGenerator<T, void, unknown>;
|
|
502
447
|
/** Current state of an entity's relations, optionally as-of a timestamp. */
|
|
@@ -507,8 +452,6 @@ export declare class LbbClient {
|
|
|
507
452
|
transitions(body: Schemas["EntityTransitionsRequest"]): Promise<Schemas["EntityTransitionsResponse"]>;
|
|
508
453
|
/** Lineage and evidence for a single edge. */
|
|
509
454
|
why(body: Schemas["WhyRequest"]): Promise<Schemas["WhyResponse"]>;
|
|
510
|
-
/** SHACL-style shape/pattern query. */
|
|
511
|
-
shacl(body: Schemas["ShaclQueryRequest"]): Promise<Schemas["ShaclQueryResponse"]>;
|
|
512
455
|
/**
|
|
513
456
|
* SPARQL-subset SELECT/ASK/aggregate query (FILTER, HAVING, ORDER BY, ASK,
|
|
514
457
|
* COUNT/SUM/AVG/MIN/MAX). GROUP BY is not limited to entity identity:
|
|
@@ -538,28 +481,6 @@ export declare class LbbClient {
|
|
|
538
481
|
* optional/union/negated leg rather than a grouped aggregate.
|
|
539
482
|
*/
|
|
540
483
|
analytics(body: Schemas["AnalyticQueryRequest"]): Promise<Schemas["AnalyticQueryResponse"]>;
|
|
541
|
-
/**
|
|
542
|
-
* Run inference rules (SHACL-AF `sh:TripleRule` shape) to a bounded fixpoint
|
|
543
|
-
* and return the derived edges as a **preview** — derived facts are never
|
|
544
|
-
* written to the asserted graph. Each rule is a BGP `body`/`where` plus a
|
|
545
|
-
* `head` triple template instantiated per binding.
|
|
546
|
-
*/
|
|
547
|
-
infer(body: Schemas["InferenceRunRequest"]): Promise<Schemas["InferenceRunResponse"]>;
|
|
548
|
-
/**
|
|
549
|
-
* Define (replace) the versioned rule set stored on the scoped graph branch.
|
|
550
|
-
* The stored set is what SHACL `include_derived` and `infer` use when a
|
|
551
|
-
* request carries no inline rules. Returns the new `rules_version`.
|
|
552
|
-
*/
|
|
553
|
-
defineRules(body: Schemas["RuleSetDefineRequest"]): Promise<Schemas["RuleSetDefineResponse"]>;
|
|
554
|
-
/** The rule set stored on the scoped graph branch (version + rules). */
|
|
555
|
-
graphRules(): Promise<Schemas["RuleSet"]>;
|
|
556
|
-
/**
|
|
557
|
-
* Derive edges from calibrated retrieval matches (preview): each
|
|
558
|
-
* candidate scored `P >= threshold` becomes a derived edge `(anchor, relation,
|
|
559
|
-
* matched)` with a typed `Retrieval` provenance leaf. Pass either explicit
|
|
560
|
-
* `candidates` or a `query` the server runs as BM25 entity retrieval.
|
|
561
|
-
*/
|
|
562
|
-
retrievalPremises(body: Schemas["RetrievalPremiseRequest"]): Promise<Schemas["RetrievalPremiseResponse"]>;
|
|
563
484
|
/**
|
|
564
485
|
* The active ontology (entity types and relations) for the scoped graph.
|
|
565
486
|
* Pass `{ counts: true }` to include a per-relation current-edge count
|
|
@@ -573,11 +494,10 @@ export declare class LbbClient {
|
|
|
573
494
|
* Audit the current snapshot against the ontology's *implied* constraints —
|
|
574
495
|
* capped `cardinality` derived as `sh:maxCount` — returning a SHACL-shaped
|
|
575
496
|
* report. Whole-snapshot and never blocks a write. Unlike
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
* {@link ontologyView} for which decorations are enforced.
|
|
497
|
+
* The report is referenced by the pinned published read root and carries its
|
|
498
|
+
* own validation watermark and ontology/shapes provenance.
|
|
579
499
|
*/
|
|
580
|
-
ontologyConformance(): Promise<Schemas["SchemaAuditReport"]>;
|
|
500
|
+
ontologyConformance(opts?: Pick<ReadConsistencyOptions, "consistency">): Promise<Schemas["SchemaAuditReport"]>;
|
|
581
501
|
/** Discover ontology concepts, terms, and relations. */
|
|
582
502
|
ontologySearch(body: Schemas["OntologySearchRequest"]): Promise<Schemas["OntologySearchResponse"]>;
|
|
583
503
|
/** Resolve mentions to concepts/entities. */
|
|
@@ -593,47 +513,6 @@ export declare class LbbClient {
|
|
|
593
513
|
evolveOntology(body: Schemas["OntologyEvolveRequest"]): Promise<Schemas["OntologyEvolveResponse"]>;
|
|
594
514
|
/** Suggest ontology additions from the current graph without mutating it. */
|
|
595
515
|
induceOntology(body: Schemas["OntologyInduceRequest"]): Promise<Schemas["OntologyInduceResponse"]>;
|
|
596
|
-
/**
|
|
597
|
-
* Build default ANN + BM25 indexes. With `{ background: true }` the build
|
|
598
|
-
* runs detached on the server and the call returns immediately — use it for
|
|
599
|
-
* large corpora whose synchronous build would exceed a fronting gateway's
|
|
600
|
-
* timeout (a 504), then poll `metadata()` for completion.
|
|
601
|
-
*/
|
|
602
|
-
indexBuild(opts?: {
|
|
603
|
-
background?: boolean;
|
|
604
|
-
}): Promise<unknown>;
|
|
605
|
-
/**
|
|
606
|
-
* Build BM25, ANN/vector, and adjacency index families. With
|
|
607
|
-
* `{ background: true }` the build runs detached on the server and the call
|
|
608
|
-
* returns immediately — use it for large corpora whose synchronous build would
|
|
609
|
-
* exceed a fronting gateway's timeout, then poll `metadata()` for completion.
|
|
610
|
-
*/
|
|
611
|
-
indexRun(opts?: {
|
|
612
|
-
background?: boolean;
|
|
613
|
-
}): Promise<unknown>;
|
|
614
|
-
/** Submit a durable full-index build. Requires a reconnect-safe idempotency key. */
|
|
615
|
-
indexSubmit(body: Partial<Schemas["IndexBuildOptions"]> | undefined, opts: {
|
|
616
|
-
idempotencyKey: string;
|
|
617
|
-
}): Promise<Schemas["SearchIndexJobStatusResponse"]>;
|
|
618
|
-
/** Poll a durable full-index build. */
|
|
619
|
-
indexJob(jobId: string): Promise<Schemas["SearchIndexJobStatusResponse"]>;
|
|
620
|
-
/** Cancel a durable full-index build. Repeated cancellation returns its current terminal status. */
|
|
621
|
-
cancelIndexJob(jobId: string): Promise<Schemas["SearchIndexJobStatusResponse"]>;
|
|
622
|
-
/** Append a BM25 delta segment for the unindexed WAL tail. */
|
|
623
|
-
indexDelta(): Promise<Schemas["IndexDeltaResponse"]>;
|
|
624
|
-
/** Preview or delete superseded persisted index runs. */
|
|
625
|
-
indexGc(opts?: {
|
|
626
|
-
keepRuns?: number;
|
|
627
|
-
dryRun?: boolean;
|
|
628
|
-
}): Promise<Schemas["IndexGcResponse"]>;
|
|
629
|
-
/** Submit durable, cancellable index garbage collection. */
|
|
630
|
-
indexGcSubmit(body: Schemas["IndexGcRequest"] | undefined, opts: {
|
|
631
|
-
idempotencyKey: string;
|
|
632
|
-
}): Promise<Schemas["IndexGcJobStatusResponse"]>;
|
|
633
|
-
/** Poll exact planning/deletion progress for durable index garbage collection. */
|
|
634
|
-
indexGcJob(jobId: string): Promise<Schemas["IndexGcJobStatusResponse"]>;
|
|
635
|
-
/** Cancel durable index garbage collection. */
|
|
636
|
-
cancelIndexGcJob(jobId: string): Promise<Schemas["IndexGcJobStatusResponse"]>;
|
|
637
516
|
/** Fold the WAL tail into snapshot segments. */
|
|
638
517
|
compact(opts?: {
|
|
639
518
|
minTailCommits?: number;
|
|
@@ -641,11 +520,9 @@ export declare class LbbClient {
|
|
|
641
520
|
}): Promise<Schemas["WalCompactResponse"]>;
|
|
642
521
|
/** Server, graph, and persisted-index status. */
|
|
643
522
|
status(): Promise<unknown>;
|
|
644
|
-
/** Graph footprint, WAL tail, and index coverage.
|
|
523
|
+
/** Graph footprint, WAL tail, and published-index coverage. */
|
|
645
524
|
metadata(opts?: {
|
|
646
|
-
includeObjects?: boolean;
|
|
647
525
|
includeIndexes?: boolean;
|
|
648
|
-
includeTemporalCoverage?: boolean;
|
|
649
526
|
}): Promise<Schemas["GraphMetadataResponse"]>;
|
|
650
527
|
waitForIndexLineage(targetSeq: number, opts?: {
|
|
651
528
|
timeoutMs?: number;
|
|
@@ -653,6 +530,8 @@ export declare class LbbClient {
|
|
|
653
530
|
}): Promise<IndexLineageObservation>;
|
|
654
531
|
/** Graph counts and type/relation buckets. Carries `consistency`/`min_indexed_seq` on the URL. */
|
|
655
532
|
summary(opts?: ReadConsistencyOptions): Promise<Schemas["GraphSummaryResponse"]>;
|
|
533
|
+
/** Pinned published read root and its query/conformance lag against one coherent head. */
|
|
534
|
+
readSnapshot(): Promise<Schemas["PublishedReadStatusResponse"]>;
|
|
656
535
|
/** List the graphs (and branches) under the scoped tenant. */
|
|
657
536
|
listGraphs(): Promise<Schemas["GraphListResponse"]>;
|
|
658
537
|
}
|