@fortemi/core 2026.7.15 → 2026.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 +3 -1
- package/benchmarks/dataset-materialization/small-corpus.v1.json +12 -0
- package/dist/index.d.ts +1379 -130
- package/dist/index.js +3180 -425
- package/dist/index.js.map +1 -1
- package/package.json +10 -1
- package/schemas/dataset-execution-capabilities/fixtures/browser-local.json +14 -0
- package/schemas/dataset-execution-capabilities/fixtures/invalid-field-lineage-without-evidence.json +10 -0
- package/schemas/dataset-execution-capabilities/fixtures/invalid-incremental-without-checkpoint.json +10 -0
- package/schemas/dataset-execution-capabilities/fixtures/portable-shard.json +12 -0
- package/schemas/dataset-execution-capabilities/fixtures/remote-alpha.json +12 -0
- package/schemas/dataset-execution-capabilities/fixtures/static-cache.json +12 -0
- package/schemas/dataset-execution-capabilities/v1.schema.json +164 -0
- package/schemas/dataset-ingest/v1.schema.json +138 -0
- package/schemas/dataset-lineage/fixtures/golden-observed-field.json +20 -0
- package/schemas/dataset-lineage/v1.schema.json +126 -0
- package/schemas/dataset-materialization/fixtures/browser.json +11 -0
- package/schemas/dataset-materialization/fixtures/degraded.json +12 -0
- package/schemas/dataset-materialization/fixtures/deterministic.json +11 -0
- package/schemas/dataset-materialization/fixtures/external-adapter.json +11 -0
- package/schemas/dataset-materialization/fixtures/nondeterministic.json +11 -0
- package/schemas/dataset-materialization/fixtures/server.json +11 -0
- package/schemas/dataset-materialization/fixtures/supported.json +12 -0
- package/schemas/dataset-materialization/fixtures/unsupported.json +11 -0
- package/schemas/dataset-materialization/v1.schema.json +169 -0
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,845 @@ import '@bytecask/core';
|
|
|
11
11
|
* time-sortable and monotonic within the same millisecond.
|
|
12
12
|
*/
|
|
13
13
|
declare function generateId(): string;
|
|
14
|
+
declare const DATASET_INGEST_CONTRACT: "fortemi.dataset-ingest/v1";
|
|
15
|
+
declare const DATASET_INGEST_SCHEMA_VERSION: "1.0.0";
|
|
16
|
+
type DatasetIngestMode = 'full' | 'incremental' | 'snapshot';
|
|
17
|
+
type DatasetRunState = 'cancelled' | 'committed' | 'degraded' | 'failed' | 'running';
|
|
18
|
+
type DatasetVerificationState = 'failed' | 'pending' | 'verified';
|
|
19
|
+
interface DatasetDestinationScope {
|
|
20
|
+
tenant: string;
|
|
21
|
+
dataset: string;
|
|
22
|
+
sourceBinding: string;
|
|
23
|
+
stream: string;
|
|
24
|
+
partition?: string;
|
|
25
|
+
}
|
|
26
|
+
interface DatasetProcessingPlan {
|
|
27
|
+
contract: typeof DATASET_INGEST_CONTRACT;
|
|
28
|
+
schemaVersion: string;
|
|
29
|
+
planId: string;
|
|
30
|
+
planDigest: string;
|
|
31
|
+
sourceRevision: string;
|
|
32
|
+
configurationDigest: string;
|
|
33
|
+
transformationDigest: string;
|
|
34
|
+
destination: DatasetDestinationScope;
|
|
35
|
+
mode: DatasetIngestMode;
|
|
36
|
+
rejectionPolicy: {
|
|
37
|
+
maxRejectedRecords: number;
|
|
38
|
+
mode: 'bounded-reject' | 'dlq' | 'fail-fast';
|
|
39
|
+
};
|
|
40
|
+
reconciliation: {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
maxTombstones: number;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface DatasetCheckpoint {
|
|
46
|
+
contract: typeof DATASET_INGEST_CONTRACT;
|
|
47
|
+
schemaVersion: string;
|
|
48
|
+
scope: DatasetDestinationScope;
|
|
49
|
+
opaque: string;
|
|
50
|
+
sequence: number;
|
|
51
|
+
}
|
|
52
|
+
interface DatasetUpsertMutation {
|
|
53
|
+
operation: 'upsert';
|
|
54
|
+
logicalId: string;
|
|
55
|
+
revision: string;
|
|
56
|
+
digest: string;
|
|
57
|
+
value: unknown;
|
|
58
|
+
locator?: string;
|
|
59
|
+
}
|
|
60
|
+
interface DatasetTombstoneMutation {
|
|
61
|
+
operation: 'tombstone';
|
|
62
|
+
logicalId: string;
|
|
63
|
+
revision: string;
|
|
64
|
+
digest: string;
|
|
65
|
+
locator?: string;
|
|
66
|
+
}
|
|
67
|
+
type DatasetMutation = DatasetTombstoneMutation | DatasetUpsertMutation;
|
|
68
|
+
interface DatasetMutationBatch {
|
|
69
|
+
contract: typeof DATASET_INGEST_CONTRACT;
|
|
70
|
+
schemaVersion: string;
|
|
71
|
+
sequence: number;
|
|
72
|
+
idempotencyKey?: string;
|
|
73
|
+
mutations: DatasetMutation[];
|
|
74
|
+
checkpointBefore?: DatasetCheckpoint;
|
|
75
|
+
checkpointAfter: DatasetCheckpoint;
|
|
76
|
+
enumeration?: {
|
|
77
|
+
approvalId?: string;
|
|
78
|
+
complete: boolean;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
interface DatasetRecordRejection {
|
|
82
|
+
logicalIdDigest: string;
|
|
83
|
+
locator?: string;
|
|
84
|
+
code: string;
|
|
85
|
+
message: string;
|
|
86
|
+
}
|
|
87
|
+
interface DatasetRunReceipt {
|
|
88
|
+
contract: typeof DATASET_INGEST_CONTRACT;
|
|
89
|
+
schemaVersion: string;
|
|
90
|
+
runId: string;
|
|
91
|
+
idempotencyKey: string;
|
|
92
|
+
requestDigest: string;
|
|
93
|
+
planId: string;
|
|
94
|
+
planDigest: string;
|
|
95
|
+
sourceRevision: string;
|
|
96
|
+
destination: DatasetDestinationScope;
|
|
97
|
+
mode: DatasetIngestMode;
|
|
98
|
+
state: 'committed' | 'degraded';
|
|
99
|
+
effects: Array<{
|
|
100
|
+
digest: string;
|
|
101
|
+
logicalId: string;
|
|
102
|
+
operation: DatasetMutation['operation'];
|
|
103
|
+
revision: string;
|
|
104
|
+
}>;
|
|
105
|
+
acceptedRecords: number;
|
|
106
|
+
rejectedRecords: number;
|
|
107
|
+
rejections: DatasetRecordRejection[];
|
|
108
|
+
outputDigest: string;
|
|
109
|
+
checkpointBefore?: DatasetCheckpoint;
|
|
110
|
+
checkpointAfter: DatasetCheckpoint;
|
|
111
|
+
verification: 'verified';
|
|
112
|
+
}
|
|
113
|
+
interface DatasetRunAttempt {
|
|
114
|
+
runId: string;
|
|
115
|
+
state: DatasetRunState;
|
|
116
|
+
verification: DatasetVerificationState;
|
|
117
|
+
idempotencyKey: string;
|
|
118
|
+
errorCode?: DatasetIngestErrorCode;
|
|
119
|
+
}
|
|
120
|
+
interface DatasetRunStatus {
|
|
121
|
+
scope: DatasetDestinationScope;
|
|
122
|
+
lastAttempt?: DatasetRunAttempt;
|
|
123
|
+
lastSuccessful?: DatasetRunReceipt;
|
|
124
|
+
freshness: 'current' | 'never' | 'stale';
|
|
125
|
+
}
|
|
126
|
+
type DatasetIngestErrorCode = 'BATCH_OUT_OF_ORDER' | 'CHECKPOINT_MISMATCH' | 'CHECKPOINT_REGRESSION' | 'CHECKPOINT_SCOPE_MISMATCH' | 'CHECKPOINT_VERSION_UNSUPPORTED' | 'IDEMPOTENCY_CONFLICT' | 'INGEST_CANCELLED' | 'INGEST_CONTRACT_UNSUPPORTED' | 'INGEST_SCHEMA_UNSUPPORTED' | 'RECONCILIATION_APPROVAL_REQUIRED' | 'RECONCILIATION_INCOMPLETE' | 'RECONCILIATION_NOT_ENABLED' | 'RECORD_REJECTED' | 'REJECTION_LIMIT_EXCEEDED';
|
|
127
|
+
declare class DatasetIngestError extends Error {
|
|
128
|
+
readonly code: DatasetIngestErrorCode;
|
|
129
|
+
constructor(code: DatasetIngestErrorCode, message: string);
|
|
130
|
+
}
|
|
131
|
+
interface DatasetStoredRecord {
|
|
132
|
+
logicalId: string;
|
|
133
|
+
revision: string;
|
|
134
|
+
digest: string;
|
|
135
|
+
value?: unknown;
|
|
136
|
+
tombstoned: boolean;
|
|
137
|
+
}
|
|
138
|
+
interface DatasetIngestTransaction {
|
|
139
|
+
getRecord(logicalId: string): DatasetStoredRecord | undefined;
|
|
140
|
+
setRecord(record: DatasetStoredRecord): void;
|
|
141
|
+
getReceipt(idempotencyKey: string): DatasetRunReceipt | undefined;
|
|
142
|
+
setReceipt(receipt: DatasetRunReceipt): void;
|
|
143
|
+
getCheckpoint(): DatasetCheckpoint | undefined;
|
|
144
|
+
setCheckpoint(checkpoint: DatasetCheckpoint): void;
|
|
145
|
+
}
|
|
146
|
+
interface DatasetIngestStore {
|
|
147
|
+
transact<T>(scopeKey: string, operation: (transaction: DatasetIngestTransaction) => Promise<T> | T): Promise<T>;
|
|
148
|
+
getReceipt(scopeKey: string, idempotencyKey: string): Promise<DatasetRunReceipt | undefined>;
|
|
149
|
+
getCheckpoint(scopeKey: string): Promise<DatasetCheckpoint | undefined>;
|
|
150
|
+
getRecords(scopeKey: string): Promise<DatasetStoredRecord[]>;
|
|
151
|
+
}
|
|
152
|
+
declare class MemoryDatasetIngestStore implements DatasetIngestStore {
|
|
153
|
+
private readonly scopes;
|
|
154
|
+
private readonly queues;
|
|
155
|
+
transact<T>(scopeKey: string, operation: (transaction: DatasetIngestTransaction) => Promise<T> | T): Promise<T>;
|
|
156
|
+
getReceipt(scopeKey: string, idempotencyKey: string): Promise<DatasetRunReceipt | undefined>;
|
|
157
|
+
getCheckpoint(scopeKey: string): Promise<DatasetCheckpoint | undefined>;
|
|
158
|
+
getRecords(scopeKey: string): Promise<DatasetStoredRecord[]>;
|
|
159
|
+
}
|
|
160
|
+
declare function datasetDestinationScopeKey(scope: DatasetDestinationScope): string;
|
|
161
|
+
declare function deriveDatasetIngestIdempotencyKey(plan: DatasetProcessingPlan, batch: DatasetMutationBatch): string;
|
|
162
|
+
interface DatasetIngestHooks {
|
|
163
|
+
beforeCommit?: () => Promise<void> | void;
|
|
164
|
+
afterCommit?: (receipt: DatasetRunReceipt) => Promise<void> | void;
|
|
165
|
+
}
|
|
166
|
+
interface ExecuteDatasetBatchOptions {
|
|
167
|
+
signal?: AbortSignal;
|
|
168
|
+
hooks?: DatasetIngestHooks;
|
|
169
|
+
validateRecord?: (mutation: DatasetMutation) => {
|
|
170
|
+
code: string;
|
|
171
|
+
message: string;
|
|
172
|
+
} | undefined;
|
|
173
|
+
}
|
|
174
|
+
declare class DatasetIngestExecutor {
|
|
175
|
+
private readonly store;
|
|
176
|
+
private readonly attempts;
|
|
177
|
+
private readonly successes;
|
|
178
|
+
constructor(store: DatasetIngestStore);
|
|
179
|
+
preview(plan: DatasetProcessingPlan, batch: DatasetMutationBatch): {
|
|
180
|
+
idempotencyKey: string;
|
|
181
|
+
tombstones: number;
|
|
182
|
+
upserts: number;
|
|
183
|
+
};
|
|
184
|
+
connectionCheck(plan: DatasetProcessingPlan, batch: DatasetMutationBatch): {
|
|
185
|
+
compatible: true;
|
|
186
|
+
idempotencyKey: string;
|
|
187
|
+
scopeKey: string;
|
|
188
|
+
};
|
|
189
|
+
executeBatch(plan: DatasetProcessingPlan, batch: DatasetMutationBatch, options?: ExecuteDatasetBatchOptions): Promise<DatasetRunReceipt>;
|
|
190
|
+
resolveAmbiguousCommit(plan: DatasetProcessingPlan, batch: DatasetMutationBatch): Promise<DatasetRunReceipt | undefined>;
|
|
191
|
+
status(scope: DatasetDestinationScope, expectedSourceRevision?: string): DatasetRunStatus;
|
|
192
|
+
}
|
|
193
|
+
declare const DATASET_LINEAGE_CONTRACT: "fortemi.dataset-lineage/v1";
|
|
194
|
+
declare const DATASET_LINEAGE_SCHEMA_VERSION: "1.0.0";
|
|
195
|
+
declare const LINEAGE_ENTITY_KINDS: readonly [
|
|
196
|
+
"dataset",
|
|
197
|
+
"dataset-revision",
|
|
198
|
+
"distribution",
|
|
199
|
+
"record",
|
|
200
|
+
"field",
|
|
201
|
+
"chunk",
|
|
202
|
+
"index",
|
|
203
|
+
"embedding-set",
|
|
204
|
+
"graph-artifact",
|
|
205
|
+
"community-artifact",
|
|
206
|
+
"processing-plan",
|
|
207
|
+
"run"
|
|
208
|
+
];
|
|
209
|
+
type LineageEntityKind = typeof LINEAGE_ENTITY_KINDS[number];
|
|
210
|
+
declare const LINEAGE_RELATIONSHIP_KINDS: readonly [
|
|
211
|
+
"derived-from",
|
|
212
|
+
"field-derived-from",
|
|
213
|
+
"extracted-from",
|
|
214
|
+
"chunk-of",
|
|
215
|
+
"indexed-from",
|
|
216
|
+
"embedded-from",
|
|
217
|
+
"graph-derived-from",
|
|
218
|
+
"community-derived-from",
|
|
219
|
+
"revision-of",
|
|
220
|
+
"distributed-as",
|
|
221
|
+
"join-influence",
|
|
222
|
+
"filter-influence",
|
|
223
|
+
"aggregation-influence",
|
|
224
|
+
"ordering-influence",
|
|
225
|
+
"similarity-influence"
|
|
226
|
+
];
|
|
227
|
+
type LineageRelationshipKind = typeof LINEAGE_RELATIONSHIP_KINDS[number];
|
|
228
|
+
type LineageAssertionKind = 'declared' | 'observed';
|
|
229
|
+
type LineagePrivacy = 'confidential' | 'internal' | 'public' | 'restricted';
|
|
230
|
+
interface LineageEntity {
|
|
231
|
+
id: string;
|
|
232
|
+
kind: LineageEntityKind;
|
|
233
|
+
schemaId: string;
|
|
234
|
+
schemaVersion: string;
|
|
235
|
+
revision?: string;
|
|
236
|
+
datasetId?: string;
|
|
237
|
+
createdAt: string;
|
|
238
|
+
attributes?: Record<string, unknown>;
|
|
239
|
+
}
|
|
240
|
+
interface LineageAgent {
|
|
241
|
+
id: string;
|
|
242
|
+
kind: 'organization' | 'person' | 'service' | 'software';
|
|
243
|
+
name: string;
|
|
244
|
+
version?: string;
|
|
245
|
+
}
|
|
246
|
+
interface LineageActivity {
|
|
247
|
+
id: string;
|
|
248
|
+
kind: 'correction' | 'export' | 'import' | 'index' | 'ingest' | 'query' | 'transform';
|
|
249
|
+
planId?: string;
|
|
250
|
+
runId?: string;
|
|
251
|
+
startedAt: string;
|
|
252
|
+
endedAt?: string;
|
|
253
|
+
agentIds: string[];
|
|
254
|
+
}
|
|
255
|
+
interface LineageEvidence {
|
|
256
|
+
id: string;
|
|
257
|
+
revision: string;
|
|
258
|
+
locator: string;
|
|
259
|
+
digest: string;
|
|
260
|
+
mediaType?: string;
|
|
261
|
+
privacy: LineagePrivacy;
|
|
262
|
+
capturedAt: string;
|
|
263
|
+
payload?: unknown;
|
|
264
|
+
}
|
|
265
|
+
interface LineageEvidenceReference {
|
|
266
|
+
evidenceId: string;
|
|
267
|
+
revision: string;
|
|
268
|
+
digest: string;
|
|
269
|
+
locator?: string;
|
|
270
|
+
}
|
|
271
|
+
interface LineageAssertion {
|
|
272
|
+
id: string;
|
|
273
|
+
revision: string;
|
|
274
|
+
relationship: LineageRelationshipKind;
|
|
275
|
+
assertionKind: LineageAssertionKind;
|
|
276
|
+
sourceEntityId: string;
|
|
277
|
+
targetEntityId: string;
|
|
278
|
+
issuerAgentId: string;
|
|
279
|
+
producingActivityId?: string;
|
|
280
|
+
method: string;
|
|
281
|
+
evidence: LineageEvidenceReference[];
|
|
282
|
+
confidence: number;
|
|
283
|
+
privacy: LineagePrivacy;
|
|
284
|
+
schemaId: string;
|
|
285
|
+
schemaVersion: string;
|
|
286
|
+
assertedAt: string;
|
|
287
|
+
}
|
|
288
|
+
interface LineageCorrection {
|
|
289
|
+
id: string;
|
|
290
|
+
assertionId: string;
|
|
291
|
+
assertionRevision: string;
|
|
292
|
+
action: 'correct' | 'retract' | 'supersede';
|
|
293
|
+
issuerAgentId: string;
|
|
294
|
+
activityId: string;
|
|
295
|
+
reason: string;
|
|
296
|
+
recordedAt: string;
|
|
297
|
+
replacementAssertionId?: string;
|
|
298
|
+
replacementRevision?: string;
|
|
299
|
+
}
|
|
300
|
+
interface LineageLedgerArchive {
|
|
301
|
+
contract: typeof DATASET_LINEAGE_CONTRACT;
|
|
302
|
+
schemaVersion: string;
|
|
303
|
+
snapshot: number;
|
|
304
|
+
entities: LineageEntity[];
|
|
305
|
+
agents: LineageAgent[];
|
|
306
|
+
activities: LineageActivity[];
|
|
307
|
+
evidence: LineageEvidence[];
|
|
308
|
+
assertions: LineageAssertion[];
|
|
309
|
+
corrections: LineageCorrection[];
|
|
310
|
+
digest: string;
|
|
311
|
+
}
|
|
312
|
+
interface LineageAuthorizationPolicy {
|
|
313
|
+
canReadEntity(entity: LineageEntity): boolean;
|
|
314
|
+
canReadAssertion(assertion: LineageAssertion): boolean;
|
|
315
|
+
canReadEvidence(evidence: LineageEvidence): boolean;
|
|
316
|
+
}
|
|
317
|
+
interface LineageTraversalRequest {
|
|
318
|
+
startEntityIds: string[];
|
|
319
|
+
direction: 'both' | 'downstream' | 'upstream';
|
|
320
|
+
entityKinds?: LineageEntityKind[];
|
|
321
|
+
relationshipKinds?: LineageRelationshipKind[];
|
|
322
|
+
assertionKinds?: LineageAssertionKind[];
|
|
323
|
+
maximumDepth: number;
|
|
324
|
+
maximumResults: number;
|
|
325
|
+
pageSize: number;
|
|
326
|
+
snapshot?: number;
|
|
327
|
+
cursor?: string;
|
|
328
|
+
includeEvidence?: boolean;
|
|
329
|
+
}
|
|
330
|
+
interface LineageTraversalNode {
|
|
331
|
+
entity: LineageEntity;
|
|
332
|
+
depth: number;
|
|
333
|
+
pathAssertionIds: string[];
|
|
334
|
+
}
|
|
335
|
+
interface LineageTraversalEdge {
|
|
336
|
+
assertion: LineageAssertion;
|
|
337
|
+
status: 'active' | 'corrected' | 'retracted' | 'superseded';
|
|
338
|
+
evidence?: LineageEvidence[];
|
|
339
|
+
}
|
|
340
|
+
interface LineageTraversalResult {
|
|
341
|
+
contract: typeof DATASET_LINEAGE_CONTRACT;
|
|
342
|
+
schemaVersion: string;
|
|
343
|
+
snapshot: number;
|
|
344
|
+
nodes: LineageTraversalNode[];
|
|
345
|
+
edges: LineageTraversalEdge[];
|
|
346
|
+
nextCursor?: string;
|
|
347
|
+
truncated: boolean;
|
|
348
|
+
}
|
|
349
|
+
type LineageValidationCode = 'ACTIVITY_REQUIRED' | 'AGENT_DANGLING' | 'CORRECTION_INVALID' | 'CURSOR_INVALID' | 'EVIDENCE_DANGLING' | 'EVIDENCE_DIGEST_MISMATCH' | 'IDENTITY_DANGLING' | 'IDENTITY_DUPLICATE' | 'IDENTITY_REQUIRED' | 'SNAPSHOT_UNAVAILABLE' | 'TRAVERSAL_LIMIT_EXCEEDED' | 'TYPE_DIRECTION_INVALID' | 'VALUE_INVALID';
|
|
350
|
+
declare class LineageValidationError extends Error {
|
|
351
|
+
readonly code: LineageValidationCode;
|
|
352
|
+
constructor(code: LineageValidationCode, message: string);
|
|
353
|
+
}
|
|
354
|
+
interface LineageProjectionCapabilities {
|
|
355
|
+
entityKinds: LineageEntityKind[];
|
|
356
|
+
relationshipKinds: LineageRelationshipKind[];
|
|
357
|
+
assertionKinds: LineageAssertionKind[];
|
|
358
|
+
preservesEvidence: boolean;
|
|
359
|
+
preservesCorrections: boolean;
|
|
360
|
+
}
|
|
361
|
+
interface LineageLossItem {
|
|
362
|
+
path: string;
|
|
363
|
+
reason: 'corrections-omitted' | 'evidence-omitted' | 'unsupported-assertion-kind' | 'unsupported-entity-kind' | 'unsupported-relationship-kind';
|
|
364
|
+
canonicalDigest: string;
|
|
365
|
+
}
|
|
366
|
+
interface LineageLossReceipt {
|
|
367
|
+
contract: typeof DATASET_LINEAGE_CONTRACT;
|
|
368
|
+
schemaVersion: string;
|
|
369
|
+
sourceDigest: string;
|
|
370
|
+
projectionDigest: string;
|
|
371
|
+
lossless: boolean;
|
|
372
|
+
losses: LineageLossItem[];
|
|
373
|
+
}
|
|
374
|
+
interface LineageProjection {
|
|
375
|
+
contract: typeof DATASET_LINEAGE_CONTRACT;
|
|
376
|
+
schemaVersion: string;
|
|
377
|
+
canonical: false;
|
|
378
|
+
regenerable: true;
|
|
379
|
+
sourceDigest: string;
|
|
380
|
+
entities: LineageEntity[];
|
|
381
|
+
assertions: LineageAssertion[];
|
|
382
|
+
evidence: LineageEvidence[];
|
|
383
|
+
corrections: LineageCorrection[];
|
|
384
|
+
digest: string;
|
|
385
|
+
lossReceipt: LineageLossReceipt;
|
|
386
|
+
}
|
|
387
|
+
declare function computeLineageDigest(value: unknown): string;
|
|
388
|
+
interface DatasetLineageLedgerOptions {
|
|
389
|
+
maximumTraversalDepth?: number;
|
|
390
|
+
maximumTraversalResults?: number;
|
|
391
|
+
maximumPageSize?: number;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Append-only canonical lineage ledger. Graph and index views are projections;
|
|
395
|
+
* this ledger remains the authority for assertions and their evidence.
|
|
396
|
+
*/
|
|
397
|
+
declare class DatasetLineageLedger {
|
|
398
|
+
private sequence;
|
|
399
|
+
private readonly entities;
|
|
400
|
+
private readonly agents;
|
|
401
|
+
private readonly activities;
|
|
402
|
+
private readonly evidence;
|
|
403
|
+
private readonly assertions;
|
|
404
|
+
private readonly corrections;
|
|
405
|
+
private readonly maximumTraversalDepth;
|
|
406
|
+
private readonly maximumTraversalResults;
|
|
407
|
+
private readonly maximumPageSize;
|
|
408
|
+
constructor(options?: DatasetLineageLedgerOptions);
|
|
409
|
+
get snapshot(): number;
|
|
410
|
+
appendEntity(entity: LineageEntity): number;
|
|
411
|
+
appendAgent(agent: LineageAgent): number;
|
|
412
|
+
appendActivity(activity: LineageActivity): number;
|
|
413
|
+
appendEvidence(item: LineageEvidence): number;
|
|
414
|
+
appendAssertion(assertion: LineageAssertion): number;
|
|
415
|
+
appendCorrection(correction: LineageCorrection): number;
|
|
416
|
+
traverse(request: LineageTraversalRequest, policy: LineageAuthorizationPolicy): LineageTraversalResult;
|
|
417
|
+
exportArchive(snapshot?: number): LineageLedgerArchive;
|
|
418
|
+
static importArchive(archive: LineageLedgerArchive, options?: DatasetLineageLedgerOptions): DatasetLineageLedger;
|
|
419
|
+
project(capabilities: LineageProjectionCapabilities, snapshot?: number): LineageProjection;
|
|
420
|
+
private append;
|
|
421
|
+
private ensureUnique;
|
|
422
|
+
private visibleAt;
|
|
423
|
+
private sorted;
|
|
424
|
+
private hasReplacementPermission;
|
|
425
|
+
private statusAt;
|
|
426
|
+
private validateTraversalRequest;
|
|
427
|
+
private traversalFingerprint;
|
|
428
|
+
private decodeCursor;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Language-neutral dataset execution capability negotiation contract.
|
|
432
|
+
*
|
|
433
|
+
* A descriptor reports demonstrated behavior for one concrete runtime. It is
|
|
434
|
+
* not inferred from a package/backend name and it does not establish liveness.
|
|
435
|
+
*/
|
|
436
|
+
declare const DATASET_EXECUTION_CONTRACT: "fortemi.dataset-execution-capabilities/v1";
|
|
437
|
+
declare const DATASET_EXECUTION_SCHEMA_VERSION: "1.0.0";
|
|
438
|
+
declare const DATASET_EXECUTION_CAPABILITY_IDS: readonly [
|
|
439
|
+
"ingest.full",
|
|
440
|
+
"ingest.snapshot",
|
|
441
|
+
"ingest.incremental",
|
|
442
|
+
"ingest.stream",
|
|
443
|
+
"schema.inspect",
|
|
444
|
+
"identity.stable-revision",
|
|
445
|
+
"identity.record",
|
|
446
|
+
"mutation.upsert",
|
|
447
|
+
"mutation.tombstone",
|
|
448
|
+
"mutation.reconcile",
|
|
449
|
+
"checkpoint.read",
|
|
450
|
+
"checkpoint.write",
|
|
451
|
+
"execution.cancel",
|
|
452
|
+
"rejection.record",
|
|
453
|
+
"index.lexical",
|
|
454
|
+
"index.chunk",
|
|
455
|
+
"index.vector",
|
|
456
|
+
"index.hybrid",
|
|
457
|
+
"index.rerank",
|
|
458
|
+
"index.graph",
|
|
459
|
+
"index.community",
|
|
460
|
+
"lineage.dataset",
|
|
461
|
+
"lineage.record",
|
|
462
|
+
"lineage.field",
|
|
463
|
+
"lineage.relationship-evidence",
|
|
464
|
+
"transaction.atomic-batch",
|
|
465
|
+
"privacy.pre-materialization-filter",
|
|
466
|
+
"pagination.cursor",
|
|
467
|
+
"ordering.deterministic"
|
|
468
|
+
];
|
|
469
|
+
type DatasetExecutionCapabilityId = typeof DATASET_EXECUTION_CAPABILITY_IDS[number];
|
|
470
|
+
type DatasetExecutionPlane = 'browser-local-archive' | 'live-remote-persistence' | 'portable-shard' | 'server-process' | 'static-cache';
|
|
471
|
+
type DatasetExecutionDataClass = 'canonical' | 'portable-projection' | 'regenerable-index' | 'remote-persistence' | 'static-cache';
|
|
472
|
+
type DatasetExecutionMaturity = 'alpha' | 'beta' | 'experimental' | 'stable';
|
|
473
|
+
type DatasetCapabilityStatus = 'experimental' | 'supported' | 'unsupported';
|
|
474
|
+
interface DatasetCapabilityEvidence {
|
|
475
|
+
id: string;
|
|
476
|
+
kind: 'conformance-report' | 'fixture' | 'live-qualification';
|
|
477
|
+
uri: string;
|
|
478
|
+
digest?: string;
|
|
479
|
+
}
|
|
480
|
+
interface DatasetCapabilityLimits {
|
|
481
|
+
maxInputBytes?: number;
|
|
482
|
+
maxRecordBytes?: number;
|
|
483
|
+
maxBatchRecords?: number;
|
|
484
|
+
maxConcurrency?: number;
|
|
485
|
+
maxPageSize?: number;
|
|
486
|
+
maxTraversalDepth?: number;
|
|
487
|
+
}
|
|
488
|
+
interface DatasetCapabilityDeclaration {
|
|
489
|
+
id: DatasetExecutionCapabilityId;
|
|
490
|
+
version: string;
|
|
491
|
+
status: DatasetCapabilityStatus;
|
|
492
|
+
limits?: DatasetCapabilityLimits;
|
|
493
|
+
evidence: string[];
|
|
494
|
+
}
|
|
495
|
+
interface DatasetExecutionCapabilityDescriptor {
|
|
496
|
+
contract: typeof DATASET_EXECUTION_CONTRACT;
|
|
497
|
+
schemaVersion: string;
|
|
498
|
+
runtime: {
|
|
499
|
+
dataClass: DatasetExecutionDataClass;
|
|
500
|
+
id: string;
|
|
501
|
+
maturity: DatasetExecutionMaturity;
|
|
502
|
+
plane: DatasetExecutionPlane;
|
|
503
|
+
version: string;
|
|
504
|
+
};
|
|
505
|
+
guarantees: {
|
|
506
|
+
availability: 'local-process' | 'remote-service' | 'single-host';
|
|
507
|
+
durability: 'filesystem' | 'memory' | 'process' | 'replicated' | 'wal';
|
|
508
|
+
isolation: 'none' | 'serializable' | 'snapshot';
|
|
509
|
+
ordering: 'backend-cursor' | 'stable-identity' | 'unspecified';
|
|
510
|
+
transaction: 'atomic-batch' | 'none' | 'single-record';
|
|
511
|
+
};
|
|
512
|
+
capabilities: DatasetCapabilityDeclaration[];
|
|
513
|
+
evidence: DatasetCapabilityEvidence[];
|
|
514
|
+
}
|
|
515
|
+
interface DatasetCapabilityRequirement {
|
|
516
|
+
id: DatasetExecutionCapabilityId;
|
|
517
|
+
minimumVersion?: string;
|
|
518
|
+
minimumLimits?: DatasetCapabilityLimits;
|
|
519
|
+
}
|
|
520
|
+
interface DatasetOptionalCapabilityRequirement extends DatasetCapabilityRequirement {
|
|
521
|
+
fallback?: DatasetExecutionCapabilityId[];
|
|
522
|
+
}
|
|
523
|
+
interface DatasetCapabilityNegotiationRequest {
|
|
524
|
+
contract: typeof DATASET_EXECUTION_CONTRACT;
|
|
525
|
+
required: DatasetCapabilityRequirement[];
|
|
526
|
+
optional?: DatasetOptionalCapabilityRequirement[];
|
|
527
|
+
}
|
|
528
|
+
type DatasetCapabilityDiagnosticCode = 'CAPABILITY_DUPLICATE' | 'CAPABILITY_INCONSISTENT' | 'CAPABILITY_LIMIT_INSUFFICIENT' | 'CAPABILITY_VERSION_INSUFFICIENT' | 'CONTRACT_MAJOR_UNSUPPORTED' | 'DESCRIPTOR_INVALID' | 'REQUIRED_CAPABILITY_MISSING' | 'SCHEMA_VERSION_UNSUPPORTED';
|
|
529
|
+
interface DatasetCapabilityDiagnostic {
|
|
530
|
+
code: DatasetCapabilityDiagnosticCode;
|
|
531
|
+
capability?: DatasetExecutionCapabilityId;
|
|
532
|
+
path?: string;
|
|
533
|
+
message: string;
|
|
534
|
+
}
|
|
535
|
+
interface DatasetCapabilityDegradation {
|
|
536
|
+
requested: DatasetExecutionCapabilityId;
|
|
537
|
+
selected?: DatasetExecutionCapabilityId;
|
|
538
|
+
reason: 'limit-insufficient' | 'unsupported' | 'version-insufficient';
|
|
539
|
+
changedGuarantees: string[];
|
|
540
|
+
}
|
|
541
|
+
interface DatasetCapabilityNegotiationResult {
|
|
542
|
+
contract: typeof DATASET_EXECUTION_CONTRACT;
|
|
543
|
+
accepted: boolean;
|
|
544
|
+
runtime: DatasetExecutionCapabilityDescriptor['runtime'];
|
|
545
|
+
selected: DatasetExecutionCapabilityId[];
|
|
546
|
+
degradations: DatasetCapabilityDegradation[];
|
|
547
|
+
diagnostics: DatasetCapabilityDiagnostic[];
|
|
548
|
+
}
|
|
549
|
+
declare function validateDatasetExecutionDescriptor(descriptor: DatasetExecutionCapabilityDescriptor): DatasetCapabilityDiagnostic[];
|
|
550
|
+
/** Pure negotiation: performs no I/O and cannot mutate the descriptor or request. */
|
|
551
|
+
declare function negotiateDatasetExecutionCapabilities(descriptor: DatasetExecutionCapabilityDescriptor, request: DatasetCapabilityNegotiationRequest): DatasetCapabilityNegotiationResult;
|
|
552
|
+
/** Descriptor for the journaled browser-local RecordStore/PGlite projection. */
|
|
553
|
+
declare const FORTEMI_BROWSER_LOCAL_DATASET_EXECUTION_DESCRIPTOR: DatasetExecutionCapabilityDescriptor;
|
|
554
|
+
/** Descriptor for the read-only generated Fortemi index cache. */
|
|
555
|
+
declare const FORTEMI_STATIC_CACHE_DATASET_EXECUTION_DESCRIPTOR: DatasetExecutionCapabilityDescriptor;
|
|
556
|
+
/** Descriptor for a verified, immutable Knowledge Shard projection. */
|
|
557
|
+
declare const FORTEMI_PORTABLE_SHARD_DATASET_EXECUTION_DESCRIPTOR: DatasetExecutionCapabilityDescriptor;
|
|
558
|
+
declare const DATASET_MATERIALIZATION_CONTRACT: "fortemi.dataset-materialization-profile/v1";
|
|
559
|
+
declare const DATASET_MATERIALIZATION_SCHEMA_VERSION: "1.0.0";
|
|
560
|
+
declare const DATASET_MATERIALIZATION_KINDS: readonly [
|
|
561
|
+
"chunking",
|
|
562
|
+
"lexical",
|
|
563
|
+
"vector",
|
|
564
|
+
"hybrid",
|
|
565
|
+
"rerank",
|
|
566
|
+
"entity-relationship-extraction",
|
|
567
|
+
"graph-retrieval",
|
|
568
|
+
"community"
|
|
569
|
+
];
|
|
570
|
+
type DatasetMaterializationKind = typeof DATASET_MATERIALIZATION_KINDS[number];
|
|
571
|
+
type DatasetMaterializationOperation = 'build' | 'query';
|
|
572
|
+
type DatasetDeterminismClass = 'deterministic' | 'nondeterministic' | 'seeded';
|
|
573
|
+
type DatasetPrivacyBoundary = 'chunking' | 'index-persistence' | 'model-invocation';
|
|
574
|
+
type DatasetProfileStatus = 'experimental' | 'supported' | 'unsupported';
|
|
575
|
+
type DatasetDigest = `sha256:${string}`;
|
|
576
|
+
interface DatasetImplementationIdentity {
|
|
577
|
+
id: string;
|
|
578
|
+
version: string;
|
|
579
|
+
digest: DatasetDigest;
|
|
580
|
+
model?: {
|
|
581
|
+
digest: DatasetDigest;
|
|
582
|
+
id: string;
|
|
583
|
+
version: string;
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
interface DatasetMaterializationProfile {
|
|
587
|
+
contract: typeof DATASET_MATERIALIZATION_CONTRACT;
|
|
588
|
+
schemaVersion: string;
|
|
589
|
+
id: string;
|
|
590
|
+
version: string;
|
|
591
|
+
kind: DatasetMaterializationKind;
|
|
592
|
+
status: DatasetProfileStatus;
|
|
593
|
+
operations: DatasetMaterializationOperation[];
|
|
594
|
+
inputTypes: string[];
|
|
595
|
+
implementation: DatasetImplementationIdentity;
|
|
596
|
+
configurationSchema: Record<string, unknown>;
|
|
597
|
+
requiredRuntimeCapabilities: DatasetCapabilityRequirement[];
|
|
598
|
+
optionalRuntimeCapabilities?: Array<DatasetCapabilityRequirement & {
|
|
599
|
+
fallback?: DatasetExecutionCapabilityId[];
|
|
600
|
+
}>;
|
|
601
|
+
determinism: {
|
|
602
|
+
class: DatasetDeterminismClass;
|
|
603
|
+
seedRequired?: boolean;
|
|
604
|
+
};
|
|
605
|
+
privacy: {
|
|
606
|
+
authorizationRequired: true;
|
|
607
|
+
behavior: 'local-only' | 'policy-filtered-external';
|
|
608
|
+
filtersBefore: DatasetPrivacyBoundary[];
|
|
609
|
+
};
|
|
610
|
+
resourceLimits: {
|
|
611
|
+
maxConcurrency: number;
|
|
612
|
+
maxInputBytes: number;
|
|
613
|
+
maxMemoryBytes?: number;
|
|
614
|
+
maxRecords: number;
|
|
615
|
+
timeoutMs?: number;
|
|
616
|
+
};
|
|
617
|
+
output: {
|
|
618
|
+
canonicalMutation: false;
|
|
619
|
+
dataClass: 'regenerable-index';
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
interface DatasetProfileNegotiationRequest {
|
|
623
|
+
operation: DatasetMaterializationOperation;
|
|
624
|
+
profile: DatasetMaterializationProfile;
|
|
625
|
+
runtime: DatasetExecutionCapabilityDescriptor;
|
|
626
|
+
fallbackProfiles?: DatasetMaterializationProfile[];
|
|
627
|
+
}
|
|
628
|
+
interface DatasetProfileNegotiationResult {
|
|
629
|
+
accepted: boolean;
|
|
630
|
+
requestedProfile: string;
|
|
631
|
+
selectedProfile?: string;
|
|
632
|
+
runtime: DatasetExecutionCapabilityDescriptor['runtime'];
|
|
633
|
+
degraded: boolean;
|
|
634
|
+
degradations: DatasetCapabilityDegradation[];
|
|
635
|
+
diagnostics: Array<{
|
|
636
|
+
code: 'NO_FALLBACK_PROFILE' | 'OPERATION_UNSUPPORTED' | 'PROFILE_INVALID' | 'PROFILE_UNSUPPORTED';
|
|
637
|
+
message: string;
|
|
638
|
+
path?: string;
|
|
639
|
+
} | DatasetCapabilityDiagnostic>;
|
|
640
|
+
}
|
|
641
|
+
interface DatasetSourceRecord {
|
|
642
|
+
logicalId: string;
|
|
643
|
+
revision: string;
|
|
644
|
+
digest: DatasetDigest;
|
|
645
|
+
content: unknown;
|
|
646
|
+
locator?: string;
|
|
647
|
+
}
|
|
648
|
+
interface DatasetSourceSnapshot {
|
|
649
|
+
datasetId: string;
|
|
650
|
+
revision: string;
|
|
651
|
+
schemaId: string;
|
|
652
|
+
schemaVersion: string;
|
|
653
|
+
schemaDigest: DatasetDigest;
|
|
654
|
+
sourceDigests: DatasetDigest[];
|
|
655
|
+
records: DatasetSourceRecord[];
|
|
656
|
+
}
|
|
657
|
+
interface DatasetPrivacyDecision {
|
|
658
|
+
policyId: string;
|
|
659
|
+
policyVersion: string;
|
|
660
|
+
policyDigest: DatasetDigest;
|
|
661
|
+
allowedRecordDigests: DatasetDigest[];
|
|
662
|
+
deniedRecordDigests: DatasetDigest[];
|
|
663
|
+
evaluatedAt: string;
|
|
664
|
+
}
|
|
665
|
+
interface DatasetMaterializationArtifact {
|
|
666
|
+
kind: 'chunk' | 'community' | 'entity' | 'graph-result' | 'lexical-entry' | 'relationship' | 'reranked-hit' | 'vector';
|
|
667
|
+
logicalId: string;
|
|
668
|
+
sourceRecordDigests: DatasetDigest[];
|
|
669
|
+
digest: DatasetDigest;
|
|
670
|
+
payload?: unknown;
|
|
671
|
+
score?: number;
|
|
672
|
+
}
|
|
673
|
+
interface DatasetMeasuredResources {
|
|
674
|
+
elapsedMs: number;
|
|
675
|
+
inputBytes: number;
|
|
676
|
+
peakMemoryBytes?: number;
|
|
677
|
+
modelInvocations: number;
|
|
678
|
+
persistedBytes: number;
|
|
679
|
+
}
|
|
680
|
+
interface DatasetMaterializationRequest {
|
|
681
|
+
runId: string;
|
|
682
|
+
processingRunId: string;
|
|
683
|
+
snapshot: DatasetSourceSnapshot;
|
|
684
|
+
profile: DatasetMaterializationProfile;
|
|
685
|
+
configuration: unknown;
|
|
686
|
+
operation: 'build';
|
|
687
|
+
mode: 'full' | 'incremental';
|
|
688
|
+
affected?: {
|
|
689
|
+
chunkDigests: DatasetDigest[];
|
|
690
|
+
recordDigests: DatasetDigest[];
|
|
691
|
+
sourceRevisions: string[];
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
interface DatasetMaterializationReceipt {
|
|
695
|
+
contract: typeof DATASET_MATERIALIZATION_CONTRACT;
|
|
696
|
+
schemaVersion: string;
|
|
697
|
+
receiptId: string;
|
|
698
|
+
runId: string;
|
|
699
|
+
processingRunId: string;
|
|
700
|
+
source: {
|
|
701
|
+
datasetId: string;
|
|
702
|
+
digests: DatasetDigest[];
|
|
703
|
+
revision: string;
|
|
704
|
+
};
|
|
705
|
+
schema: {
|
|
706
|
+
digest: DatasetDigest;
|
|
707
|
+
id: string;
|
|
708
|
+
version: string;
|
|
709
|
+
};
|
|
710
|
+
profile: {
|
|
711
|
+
configurationDigest: DatasetDigest;
|
|
712
|
+
digest: DatasetDigest;
|
|
713
|
+
id: string;
|
|
714
|
+
implementation: DatasetImplementationIdentity;
|
|
715
|
+
version: string;
|
|
716
|
+
};
|
|
717
|
+
runtime: DatasetExecutionCapabilityDescriptor['runtime'];
|
|
718
|
+
negotiation: Pick<DatasetProfileNegotiationResult, 'degradations' | 'degraded' | 'requestedProfile' | 'selectedProfile'>;
|
|
719
|
+
mode: 'full' | 'incremental';
|
|
720
|
+
affected: {
|
|
721
|
+
chunkDigests: DatasetDigest[];
|
|
722
|
+
recordDigests: DatasetDigest[];
|
|
723
|
+
sourceRevisions: string[];
|
|
724
|
+
};
|
|
725
|
+
output: {
|
|
726
|
+
aggregateDigest: DatasetDigest;
|
|
727
|
+
counts: Record<string, number>;
|
|
728
|
+
digests: DatasetDigest[];
|
|
729
|
+
};
|
|
730
|
+
privacy: DatasetPrivacyDecision;
|
|
731
|
+
resources: DatasetMeasuredResources;
|
|
732
|
+
createdAt: string;
|
|
733
|
+
}
|
|
734
|
+
interface DatasetRetrievalRequest {
|
|
735
|
+
queryId: string;
|
|
736
|
+
operation: 'query';
|
|
737
|
+
profile: DatasetMaterializationProfile;
|
|
738
|
+
query: unknown;
|
|
739
|
+
limit: number;
|
|
740
|
+
}
|
|
741
|
+
interface DatasetRetrievalResponse {
|
|
742
|
+
contract: typeof DATASET_MATERIALIZATION_CONTRACT;
|
|
743
|
+
schemaVersion: string;
|
|
744
|
+
queryId: string;
|
|
745
|
+
requestedProfile: string;
|
|
746
|
+
actualProfile: string;
|
|
747
|
+
actualBackend: {
|
|
748
|
+
id: string;
|
|
749
|
+
plane: DatasetExecutionCapabilityDescriptor['runtime']['plane'];
|
|
750
|
+
version: string;
|
|
751
|
+
};
|
|
752
|
+
degraded: boolean;
|
|
753
|
+
fallbackReason?: string;
|
|
754
|
+
scoreSemantics: {
|
|
755
|
+
comparableAcrossImplementations: false;
|
|
756
|
+
implementationScoped: true;
|
|
757
|
+
};
|
|
758
|
+
results: DatasetMaterializationArtifact[];
|
|
759
|
+
receiptId: string;
|
|
760
|
+
}
|
|
761
|
+
interface DatasetBenchmarkEvidence {
|
|
762
|
+
contract: typeof DATASET_MATERIALIZATION_CONTRACT;
|
|
763
|
+
schemaVersion: string;
|
|
764
|
+
evidenceType: 'benchmark';
|
|
765
|
+
benchmarkId: string;
|
|
766
|
+
corpus: {
|
|
767
|
+
bytes: number;
|
|
768
|
+
digest: DatasetDigest;
|
|
769
|
+
id: string;
|
|
770
|
+
records: number;
|
|
771
|
+
revision: string;
|
|
772
|
+
};
|
|
773
|
+
hardware: {
|
|
774
|
+
accelerator?: string;
|
|
775
|
+
cpu: string;
|
|
776
|
+
memoryBytes: number;
|
|
777
|
+
runtime: string;
|
|
778
|
+
};
|
|
779
|
+
implementation: DatasetImplementationIdentity;
|
|
780
|
+
profile: {
|
|
781
|
+
configurationDigest: DatasetDigest;
|
|
782
|
+
digest: DatasetDigest;
|
|
783
|
+
id: string;
|
|
784
|
+
version: string;
|
|
785
|
+
};
|
|
786
|
+
correctness: {
|
|
787
|
+
passed: boolean;
|
|
788
|
+
receiptDigest: DatasetDigest;
|
|
789
|
+
suite: string;
|
|
790
|
+
};
|
|
791
|
+
freshness: {
|
|
792
|
+
measuredAt: string;
|
|
793
|
+
sourceRevision: string;
|
|
794
|
+
};
|
|
795
|
+
measurements: Array<{
|
|
796
|
+
name: string;
|
|
797
|
+
unit: 'bytes' | 'ms' | 'queries/s' | 'records/s';
|
|
798
|
+
value: number;
|
|
799
|
+
}>;
|
|
800
|
+
claims: {
|
|
801
|
+
corpusScoped: true;
|
|
802
|
+
universalScaleLimit: false;
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
interface DatasetMaterializationAdapter {
|
|
806
|
+
readonly backend: {
|
|
807
|
+
id: string;
|
|
808
|
+
version: string;
|
|
809
|
+
};
|
|
810
|
+
materialize(input: Readonly<{
|
|
811
|
+
affected: DatasetMaterializationReceipt['affected'];
|
|
812
|
+
configuration: unknown;
|
|
813
|
+
mode: 'full' | 'incremental';
|
|
814
|
+
profile: DatasetMaterializationProfile;
|
|
815
|
+
snapshot: DatasetSourceSnapshot;
|
|
816
|
+
}>): Promise<{
|
|
817
|
+
artifacts: DatasetMaterializationArtifact[];
|
|
818
|
+
resources: DatasetMeasuredResources;
|
|
819
|
+
}>;
|
|
820
|
+
retrieve?(input: Readonly<{
|
|
821
|
+
profile: DatasetMaterializationProfile;
|
|
822
|
+
request: DatasetRetrievalRequest;
|
|
823
|
+
}>): Promise<DatasetMaterializationArtifact[]>;
|
|
824
|
+
}
|
|
825
|
+
type DatasetRecordAuthorizer = (record: Readonly<DatasetSourceRecord>) => boolean | Promise<boolean>;
|
|
826
|
+
declare class DatasetMaterializationError extends Error {
|
|
827
|
+
readonly code: 'ADAPTER_MISMATCH' | 'CONFIGURATION_INVALID' | 'NEGOTIATION_FAILED' | 'PROFILE_INVALID' | 'RESOURCE_LIMIT_EXCEEDED';
|
|
828
|
+
constructor(code: 'ADAPTER_MISMATCH' | 'CONFIGURATION_INVALID' | 'NEGOTIATION_FAILED' | 'PROFILE_INVALID' | 'RESOURCE_LIMIT_EXCEEDED', message: string);
|
|
829
|
+
}
|
|
830
|
+
declare function digestDatasetMaterializationValue(value: unknown): DatasetDigest;
|
|
831
|
+
/** Negotiate the profile and its required/optional runtime capabilities before any build or query I/O. */
|
|
832
|
+
declare function negotiateDatasetMaterializationProfile(request: DatasetProfileNegotiationRequest): DatasetProfileNegotiationResult;
|
|
833
|
+
/**
|
|
834
|
+
* Runs authorization before the adapter sees text, model inputs, or persistence inputs.
|
|
835
|
+
* The adapter receives a detached immutable snapshot and can only return derived artifacts.
|
|
836
|
+
*/
|
|
837
|
+
declare function executeDatasetMaterialization(request: DatasetMaterializationRequest, runtime: DatasetExecutionCapabilityDescriptor, adapter: DatasetMaterializationAdapter, authorize: DatasetRecordAuthorizer, options?: {
|
|
838
|
+
fallbackProfiles?: DatasetMaterializationProfile[];
|
|
839
|
+
now?: () => string;
|
|
840
|
+
}): Promise<{
|
|
841
|
+
artifacts: DatasetMaterializationArtifact[];
|
|
842
|
+
receipt: DatasetMaterializationReceipt;
|
|
843
|
+
}>;
|
|
844
|
+
declare function executeDatasetRetrieval(request: DatasetRetrievalRequest, runtime: DatasetExecutionCapabilityDescriptor, adapter: DatasetMaterializationAdapter, receiptId: string, fallbackProfiles?: DatasetMaterializationProfile[]): Promise<DatasetRetrievalResponse>;
|
|
845
|
+
interface DatasetIncrementalParityResult {
|
|
846
|
+
equivalent: boolean;
|
|
847
|
+
mismatches: Array<'chunks' | 'communities' | 'digests' | 'identities' | 'ordering' | 'relationships'>;
|
|
848
|
+
}
|
|
849
|
+
/** Compares every correctness dimension required before incremental output may replace a full rebuild. */
|
|
850
|
+
declare function compareDatasetIncrementalParity(full: readonly DatasetMaterializationArtifact[], incremental: readonly DatasetMaterializationArtifact[]): DatasetIncrementalParityResult;
|
|
851
|
+
/** Benchmark evidence is publishable only after correctness and source-binding gates pass. */
|
|
852
|
+
declare function validateDatasetBenchmarkEvidence(evidence: DatasetBenchmarkEvidence): string[];
|
|
14
853
|
/**
|
|
15
854
|
* Typed event bus with IDisposable subscriptions (Monaco-style).
|
|
16
855
|
* SSE-style pub/sub across all layers.
|
|
@@ -40,6 +879,14 @@ interface EventMap {
|
|
|
40
879
|
id: string;
|
|
41
880
|
revisionNumber: number;
|
|
42
881
|
};
|
|
882
|
+
'source.upserted': {
|
|
883
|
+
counts: Record<string, number>;
|
|
884
|
+
importRunId: string;
|
|
885
|
+
};
|
|
886
|
+
'purge.completed': {
|
|
887
|
+
counts: Record<string, number>;
|
|
888
|
+
receiptId: string;
|
|
889
|
+
};
|
|
43
890
|
'search.reindexed': Record<string, never>;
|
|
44
891
|
'embedding.ready': {
|
|
45
892
|
noteId: string;
|
|
@@ -96,6 +943,51 @@ interface EventMap {
|
|
|
96
943
|
id: string;
|
|
97
944
|
name: string;
|
|
98
945
|
};
|
|
946
|
+
'provider.route.configured': {
|
|
947
|
+
fallback?: boolean;
|
|
948
|
+
hasRequirements: boolean;
|
|
949
|
+
model?: string;
|
|
950
|
+
providerIds: string[];
|
|
951
|
+
task: string;
|
|
952
|
+
};
|
|
953
|
+
'provider.route.cleared': {
|
|
954
|
+
task?: string;
|
|
955
|
+
};
|
|
956
|
+
'provider.route.selected': {
|
|
957
|
+
capability: string;
|
|
958
|
+
model?: string;
|
|
959
|
+
providerId: string;
|
|
960
|
+
providerName: string;
|
|
961
|
+
routeMatched: boolean;
|
|
962
|
+
task?: string;
|
|
963
|
+
tier: string;
|
|
964
|
+
};
|
|
965
|
+
'provider.route.completed': {
|
|
966
|
+
attempt: number;
|
|
967
|
+
capability: string;
|
|
968
|
+
fallbackCount: number;
|
|
969
|
+
latencyMs: number;
|
|
970
|
+
model?: string;
|
|
971
|
+
providerId: string;
|
|
972
|
+
providerName: string;
|
|
973
|
+
routeMatched: boolean;
|
|
974
|
+
task?: string;
|
|
975
|
+
tier: string;
|
|
976
|
+
};
|
|
977
|
+
'provider.route.failed': {
|
|
978
|
+
attempt: number;
|
|
979
|
+
capability: string;
|
|
980
|
+
error: string;
|
|
981
|
+
errorCategory: string;
|
|
982
|
+
fallbackCount: number;
|
|
983
|
+
latencyMs: number;
|
|
984
|
+
model?: string;
|
|
985
|
+
providerId?: string;
|
|
986
|
+
providerName?: string;
|
|
987
|
+
routeMatched: boolean;
|
|
988
|
+
task?: string;
|
|
989
|
+
tier?: string;
|
|
990
|
+
};
|
|
99
991
|
'provider.fallback': {
|
|
100
992
|
error: string;
|
|
101
993
|
errorCategory: string;
|
|
@@ -1542,6 +2434,58 @@ declare class EmbeddingSetsRepository {
|
|
|
1542
2434
|
private inferDefinitionModel;
|
|
1543
2435
|
private inferDefinitionDimension;
|
|
1544
2436
|
}
|
|
2437
|
+
declare const REGISTERED_METADATA_PATHS: readonly [
|
|
2438
|
+
"provider",
|
|
2439
|
+
"model",
|
|
2440
|
+
"role",
|
|
2441
|
+
"event_kind",
|
|
2442
|
+
"sensitivity",
|
|
2443
|
+
"import_run_id"
|
|
2444
|
+
];
|
|
2445
|
+
type RegisteredMetadataPath = typeof REGISTERED_METADATA_PATHS[number];
|
|
2446
|
+
type MetadataPredicate = {
|
|
2447
|
+
gte?: number | string;
|
|
2448
|
+
lte?: number | string;
|
|
2449
|
+
op: 'range';
|
|
2450
|
+
path: RegisteredMetadataPath;
|
|
2451
|
+
} | {
|
|
2452
|
+
op: 'eq';
|
|
2453
|
+
path: RegisteredMetadataPath;
|
|
2454
|
+
value: boolean | null | number | string;
|
|
2455
|
+
} | {
|
|
2456
|
+
op: 'exists';
|
|
2457
|
+
path: RegisteredMetadataPath;
|
|
2458
|
+
value?: boolean;
|
|
2459
|
+
} | {
|
|
2460
|
+
op: 'in';
|
|
2461
|
+
path: RegisteredMetadataPath;
|
|
2462
|
+
value: readonly (boolean | null | number | string)[];
|
|
2463
|
+
};
|
|
2464
|
+
interface EvidenceLocator {
|
|
2465
|
+
note_id: string;
|
|
2466
|
+
chunk?: {
|
|
2467
|
+
index: number;
|
|
2468
|
+
kind: 'attachment' | 'current' | 'title';
|
|
2469
|
+
};
|
|
2470
|
+
span?: {
|
|
2471
|
+
end: number;
|
|
2472
|
+
start: number;
|
|
2473
|
+
};
|
|
2474
|
+
source?: {
|
|
2475
|
+
external_id_hash: string;
|
|
2476
|
+
import_run_id: string;
|
|
2477
|
+
namespace: string;
|
|
2478
|
+
schema_version: string;
|
|
2479
|
+
};
|
|
2480
|
+
metadata_paths: RegisteredMetadataPath[];
|
|
2481
|
+
}
|
|
2482
|
+
interface MetadataPredicateConditionResult {
|
|
2483
|
+
conditions: string[];
|
|
2484
|
+
joins: string[];
|
|
2485
|
+
params: unknown[];
|
|
2486
|
+
nextIdx: number;
|
|
2487
|
+
}
|
|
2488
|
+
declare function buildMetadataPredicateConditions(options: Pick<SearchOptions, 'archive_id' | 'metadataPredicates' | 'tenant_id'>, startIdx: number): MetadataPredicateConditionResult;
|
|
1545
2489
|
/**
|
|
1546
2490
|
* Shared types for repository layer.
|
|
1547
2491
|
* All repository methods use these types as inputs and outputs.
|
|
@@ -1628,6 +2572,7 @@ interface SearchResult {
|
|
|
1628
2572
|
updated_at: Date;
|
|
1629
2573
|
tags: string[];
|
|
1630
2574
|
has_embedding?: boolean;
|
|
2575
|
+
locators?: EvidenceLocator[];
|
|
1631
2576
|
}
|
|
1632
2577
|
interface SearchFacets {
|
|
1633
2578
|
tags: {
|
|
@@ -1662,6 +2607,9 @@ interface SearchOptions {
|
|
|
1662
2607
|
format?: string;
|
|
1663
2608
|
source?: string;
|
|
1664
2609
|
visibility?: string;
|
|
2610
|
+
tenant_id?: string;
|
|
2611
|
+
archive_id?: null | string;
|
|
2612
|
+
metadataPredicates?: readonly MetadataPredicate[];
|
|
1665
2613
|
include_facets?: boolean;
|
|
1666
2614
|
mode?: 'auto' | 'hybrid' | 'semantic' | 'text';
|
|
1667
2615
|
embeddingSetId?: string;
|
|
@@ -1756,6 +2704,8 @@ declare class SearchRepository {
|
|
|
1756
2704
|
private scopeToResolvedEmbeddingRows;
|
|
1757
2705
|
private fetchEmbeddingStatus;
|
|
1758
2706
|
private attachEmbeddingStatus;
|
|
2707
|
+
private fetchLocatorMap;
|
|
2708
|
+
private metadataPaths;
|
|
1759
2709
|
search(query: string, options?: SearchOptions, queryEmbedding?: number[]): Promise<SearchResponse>;
|
|
1760
2710
|
semanticSearch(queryEmbedding: number[], options?: SearchOptions): Promise<SearchResponse>;
|
|
1761
2711
|
hybridSearch(query: string, queryEmbedding: number[], options?: SearchOptions): Promise<SearchResponse>;
|
|
@@ -1763,6 +2713,100 @@ declare class SearchRepository {
|
|
|
1763
2713
|
private fetchFacets;
|
|
1764
2714
|
private fetchTagMap;
|
|
1765
2715
|
}
|
|
2716
|
+
type SourceUpsertPolicy = 'conflict' | 'replace' | 'version';
|
|
2717
|
+
type SourceUpsertOutcome = 'conflict' | 'inserted' | 'rejected' | 'replaced' | 'unchanged' | 'versioned';
|
|
2718
|
+
interface SourceIdentityInput {
|
|
2719
|
+
tenant_id?: string;
|
|
2720
|
+
archive_id?: null | string;
|
|
2721
|
+
namespace: string;
|
|
2722
|
+
external_id: string;
|
|
2723
|
+
source_schema_version: string;
|
|
2724
|
+
import_run_id: string;
|
|
2725
|
+
caller_stable_id?: string;
|
|
2726
|
+
}
|
|
2727
|
+
interface SourceUpsertItem {
|
|
2728
|
+
source: SourceIdentityInput;
|
|
2729
|
+
title?: null | string;
|
|
2730
|
+
content: string;
|
|
2731
|
+
format?: string;
|
|
2732
|
+
visibility?: string;
|
|
2733
|
+
metadata?: null | Record<string, unknown>;
|
|
2734
|
+
policy?: SourceUpsertPolicy;
|
|
2735
|
+
}
|
|
2736
|
+
interface SourceUpsertOptions {
|
|
2737
|
+
dryRun?: boolean;
|
|
2738
|
+
maxItems?: number;
|
|
2739
|
+
}
|
|
2740
|
+
interface SourceUpsertItemResult {
|
|
2741
|
+
index: number;
|
|
2742
|
+
outcome: SourceUpsertOutcome;
|
|
2743
|
+
note_id?: string;
|
|
2744
|
+
external_id_hash: string;
|
|
2745
|
+
content_digest: string;
|
|
2746
|
+
reason?: string;
|
|
2747
|
+
}
|
|
2748
|
+
interface SourceUpsertBatchResult {
|
|
2749
|
+
import_run_id: string;
|
|
2750
|
+
dry_run: boolean;
|
|
2751
|
+
outcomes: SourceUpsertItemResult[];
|
|
2752
|
+
counts: Record<SourceUpsertOutcome, number>;
|
|
2753
|
+
}
|
|
2754
|
+
declare class SourceUpsertRepository {
|
|
2755
|
+
private db;
|
|
2756
|
+
private events?;
|
|
2757
|
+
constructor(db: DatabaseClient, events?: TypedEventBus | undefined);
|
|
2758
|
+
upsertBatch(items: readonly SourceUpsertItem[], options?: SourceUpsertOptions): Promise<SourceUpsertBatchResult>;
|
|
2759
|
+
private finish;
|
|
2760
|
+
}
|
|
2761
|
+
interface PurgeSelector {
|
|
2762
|
+
tenant_id?: string;
|
|
2763
|
+
archive_id?: null | string;
|
|
2764
|
+
note_ids?: readonly string[];
|
|
2765
|
+
source?: {
|
|
2766
|
+
external_id?: string;
|
|
2767
|
+
namespace: string;
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
interface PurgeCounts {
|
|
2771
|
+
notes: number;
|
|
2772
|
+
revisions: number;
|
|
2773
|
+
links: number;
|
|
2774
|
+
tags: number;
|
|
2775
|
+
embeddings: number;
|
|
2776
|
+
attachments: number;
|
|
2777
|
+
blobs: number;
|
|
2778
|
+
graph_edges: number;
|
|
2779
|
+
provenance_edges: number;
|
|
2780
|
+
source_identities: number;
|
|
2781
|
+
}
|
|
2782
|
+
interface DeletionReceipt {
|
|
2783
|
+
id: string;
|
|
2784
|
+
operation_key: string;
|
|
2785
|
+
tenant_id: string;
|
|
2786
|
+
archive_id: null | string;
|
|
2787
|
+
selector_hash: string;
|
|
2788
|
+
outcome: 'completed';
|
|
2789
|
+
counts: PurgeCounts;
|
|
2790
|
+
completed_at: string;
|
|
2791
|
+
policy: {
|
|
2792
|
+
authority: 'fortemi#1092';
|
|
2793
|
+
mode: 'terminal-purge';
|
|
2794
|
+
receipt_contains_content: false;
|
|
2795
|
+
};
|
|
2796
|
+
}
|
|
2797
|
+
interface PurgePreview {
|
|
2798
|
+
selector_hash: string;
|
|
2799
|
+
counts: PurgeCounts;
|
|
2800
|
+
}
|
|
2801
|
+
declare class LifecyclePurgeRepository {
|
|
2802
|
+
private db;
|
|
2803
|
+
private events?;
|
|
2804
|
+
constructor(db: DatabaseClient, events?: TypedEventBus | undefined);
|
|
2805
|
+
preview(selector: PurgeSelector): Promise<PurgePreview>;
|
|
2806
|
+
purge(selector: PurgeSelector, operationKey: string): Promise<DeletionReceipt>;
|
|
2807
|
+
private count;
|
|
2808
|
+
private deleteSelected;
|
|
2809
|
+
}
|
|
1766
2810
|
interface GraphNode {
|
|
1767
2811
|
id: string;
|
|
1768
2812
|
}
|
|
@@ -2910,6 +3954,100 @@ declare function detectInferenceCapabilities(): Promise<InferenceCapabilities>;
|
|
|
2910
3954
|
*/
|
|
2911
3955
|
/** Split text into overlapping chunks for embedding. */
|
|
2912
3956
|
declare function chunkText(text: string, maxChars?: number, overlap?: number): string[];
|
|
3957
|
+
/**
|
|
3958
|
+
* Formal InferenceProvider interface.
|
|
3959
|
+
* Core contract for all inference providers — remote APIs, local servers, in-browser models.
|
|
3960
|
+
* Core stays dependency-free: interface only, no implementations.
|
|
3961
|
+
*
|
|
3962
|
+
* @implements #112 formal InferenceProvider interface
|
|
3963
|
+
*/
|
|
3964
|
+
interface ProviderCapabilities {
|
|
3965
|
+
embeddings: boolean;
|
|
3966
|
+
chat: boolean;
|
|
3967
|
+
streaming: boolean;
|
|
3968
|
+
vision: boolean;
|
|
3969
|
+
toolCalling: boolean;
|
|
3970
|
+
structuredOutput: boolean;
|
|
3971
|
+
maxContextTokens?: number;
|
|
3972
|
+
}
|
|
3973
|
+
type ProviderPrivacyTier = 'external' | 'host-managed' | 'local';
|
|
3974
|
+
type ProviderCostTier = 'free' | 'high' | 'low' | 'medium';
|
|
3975
|
+
type ProviderDataClass = 'private' | 'public' | 'regulated' | 'sensitive';
|
|
3976
|
+
interface ProviderProfile {
|
|
3977
|
+
privacyTier?: ProviderPrivacyTier;
|
|
3978
|
+
costTier?: ProviderCostTier;
|
|
3979
|
+
maxInputChars?: number;
|
|
3980
|
+
embeddingDimensions?: number[];
|
|
3981
|
+
dataClasses?: ProviderDataClass[];
|
|
3982
|
+
}
|
|
3983
|
+
type InferenceTask = 'chat.general' | 'chat.linking' | 'chat.revision' | 'chat.tagging' | 'embedding.document' | 'embedding.large-document' | 'embedding.query' | 'vision.general';
|
|
3984
|
+
interface EmbedRequest {
|
|
3985
|
+
texts: string[];
|
|
3986
|
+
model?: string;
|
|
3987
|
+
task?: InferenceTask;
|
|
3988
|
+
}
|
|
3989
|
+
interface EmbedResponse {
|
|
3990
|
+
vectors: number[][];
|
|
3991
|
+
model: string;
|
|
3992
|
+
usage?: {
|
|
3993
|
+
totalTokens: number;
|
|
3994
|
+
};
|
|
3995
|
+
}
|
|
3996
|
+
interface CompletionRequest {
|
|
3997
|
+
prompt: string;
|
|
3998
|
+
model?: string;
|
|
3999
|
+
task?: InferenceTask;
|
|
4000
|
+
maxTokens?: number;
|
|
4001
|
+
temperature?: number;
|
|
4002
|
+
systemPrompt?: string;
|
|
4003
|
+
stopSequences?: string[];
|
|
4004
|
+
}
|
|
4005
|
+
interface CompletionResponse {
|
|
4006
|
+
text: string;
|
|
4007
|
+
model: string;
|
|
4008
|
+
usage?: {
|
|
4009
|
+
completionTokens: number;
|
|
4010
|
+
promptTokens: number;
|
|
4011
|
+
};
|
|
4012
|
+
finishReason?: 'content_filter' | 'length' | 'stop';
|
|
4013
|
+
}
|
|
4014
|
+
interface StreamChunk {
|
|
4015
|
+
text: string;
|
|
4016
|
+
done: boolean;
|
|
4017
|
+
}
|
|
4018
|
+
interface ModelInfo {
|
|
4019
|
+
id: string;
|
|
4020
|
+
name?: string;
|
|
4021
|
+
capabilities: Partial<ProviderCapabilities>;
|
|
4022
|
+
contextWindow?: number;
|
|
4023
|
+
owned_by?: string;
|
|
4024
|
+
}
|
|
4025
|
+
type ProbeStatus = 'degraded' | 'down' | 'ok';
|
|
4026
|
+
interface ProbeResult {
|
|
4027
|
+
status: ProbeStatus;
|
|
4028
|
+
latencyMs: number;
|
|
4029
|
+
message?: string;
|
|
4030
|
+
}
|
|
4031
|
+
type ProviderTier = 'chrome-ai' | 'in-browser' | 'local-server' | 'remote';
|
|
4032
|
+
interface InferenceProvider {
|
|
4033
|
+
readonly id: string;
|
|
4034
|
+
readonly name: string;
|
|
4035
|
+
readonly tier: ProviderTier;
|
|
4036
|
+
readonly capabilities: ProviderCapabilities;
|
|
4037
|
+
readonly profile?: ProviderProfile;
|
|
4038
|
+
/** Generate embeddings for text inputs */
|
|
4039
|
+
embed?(request: EmbedRequest): Promise<EmbedResponse>;
|
|
4040
|
+
/** Generate a completion (non-streaming) */
|
|
4041
|
+
complete?(request: CompletionRequest): Promise<CompletionResponse>;
|
|
4042
|
+
/** Generate a streaming completion */
|
|
4043
|
+
stream?(request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
4044
|
+
/** List available models from this provider */
|
|
4045
|
+
listModels(): Promise<ModelInfo[]>;
|
|
4046
|
+
/** Health check — probe the provider */
|
|
4047
|
+
probe(): Promise<ProbeResult>;
|
|
4048
|
+
/** Clean up resources */
|
|
4049
|
+
dispose(): void;
|
|
4050
|
+
}
|
|
2913
4051
|
/**
|
|
2914
4052
|
* Embedding generation job handler.
|
|
2915
4053
|
* Generates and stores vector embeddings for note content.
|
|
@@ -2917,9 +4055,22 @@ declare function chunkText(text: string, maxChars?: number, overlap?: number): s
|
|
|
2917
4055
|
*
|
|
2918
4056
|
* @implements #63 embedding generation
|
|
2919
4057
|
*/
|
|
4058
|
+
interface EmbedFunctionOptions {
|
|
4059
|
+
task?: InferenceTask;
|
|
4060
|
+
model?: string;
|
|
4061
|
+
}
|
|
4062
|
+
interface EmbeddingTaskSelectionOptions {
|
|
4063
|
+
largeDocumentChars?: number;
|
|
4064
|
+
largeDocumentChunks?: number;
|
|
4065
|
+
}
|
|
4066
|
+
declare const DEFAULT_LARGE_DOCUMENT_CHARS = 12000;
|
|
4067
|
+
declare const DEFAULT_LARGE_DOCUMENT_CHUNKS = 12;
|
|
2920
4068
|
/** Type for the embed function — injected by the semantic capability module */
|
|
2921
|
-
type EmbedFunction = (texts: string[]) => Promise<number[][]>;
|
|
4069
|
+
type EmbedFunction = (texts: string[], options?: EmbedFunctionOptions) => Promise<number[][]>;
|
|
2922
4070
|
declare function setEmbedFunction(fn: EmbedFunction | null): void;
|
|
4071
|
+
declare function setEmbeddingTaskSelectionOptions(options?: EmbeddingTaskSelectionOptions): void;
|
|
4072
|
+
declare function getEmbeddingTaskSelectionOptions(): EmbeddingTaskSelectionOptions;
|
|
4073
|
+
declare function selectEmbeddingTask(content: string, chunks: string[], options?: EmbeddingTaskSelectionOptions): InferenceTask;
|
|
2923
4074
|
declare function getEmbedFunction(): EmbedFunction | null;
|
|
2924
4075
|
/** Job handler for embedding generation. Registered in JobQueueWorker. */
|
|
2925
4076
|
declare function embeddingGenerationHandler(job: {
|
|
@@ -2932,11 +4083,14 @@ declare function embeddingGenerationHandler(job: {
|
|
|
2932
4083
|
*
|
|
2933
4084
|
* @implements #66 AI title generation
|
|
2934
4085
|
*/
|
|
2935
|
-
|
|
2936
|
-
type LlmCompleteFn = (prompt: string, options?: {
|
|
4086
|
+
interface LlmCompleteOptions {
|
|
2937
4087
|
maxTokens?: number;
|
|
2938
4088
|
temperature?: number;
|
|
2939
|
-
|
|
4089
|
+
task?: InferenceTask;
|
|
4090
|
+
model?: string;
|
|
4091
|
+
}
|
|
4092
|
+
/** Type for the LLM completion function — injected by the llm capability module */
|
|
4093
|
+
type LlmCompleteFn = (prompt: string, options?: LlmCompleteOptions) => Promise<string>;
|
|
2940
4094
|
declare function setLlmFunction(fn: LlmCompleteFn | null): void;
|
|
2941
4095
|
declare function getLlmFunction(): LlmCompleteFn | null;
|
|
2942
4096
|
/**
|
|
@@ -3149,86 +4303,6 @@ declare function registerLlmCapability(manager: CapabilityManager, completeFn: L
|
|
|
3149
4303
|
* Unregister the LLM capability — clears the completion function.
|
|
3150
4304
|
*/
|
|
3151
4305
|
declare function unregisterLlmCapability(): void;
|
|
3152
|
-
/**
|
|
3153
|
-
* Formal InferenceProvider interface.
|
|
3154
|
-
* Core contract for all inference providers — remote APIs, local servers, in-browser models.
|
|
3155
|
-
* Core stays dependency-free: interface only, no implementations.
|
|
3156
|
-
*
|
|
3157
|
-
* @implements #112 formal InferenceProvider interface
|
|
3158
|
-
*/
|
|
3159
|
-
interface ProviderCapabilities {
|
|
3160
|
-
embeddings: boolean;
|
|
3161
|
-
chat: boolean;
|
|
3162
|
-
streaming: boolean;
|
|
3163
|
-
vision: boolean;
|
|
3164
|
-
toolCalling: boolean;
|
|
3165
|
-
structuredOutput: boolean;
|
|
3166
|
-
maxContextTokens?: number;
|
|
3167
|
-
}
|
|
3168
|
-
interface EmbedRequest {
|
|
3169
|
-
texts: string[];
|
|
3170
|
-
model?: string;
|
|
3171
|
-
}
|
|
3172
|
-
interface EmbedResponse {
|
|
3173
|
-
vectors: number[][];
|
|
3174
|
-
model: string;
|
|
3175
|
-
usage?: {
|
|
3176
|
-
totalTokens: number;
|
|
3177
|
-
};
|
|
3178
|
-
}
|
|
3179
|
-
interface CompletionRequest {
|
|
3180
|
-
prompt: string;
|
|
3181
|
-
model?: string;
|
|
3182
|
-
maxTokens?: number;
|
|
3183
|
-
temperature?: number;
|
|
3184
|
-
systemPrompt?: string;
|
|
3185
|
-
stopSequences?: string[];
|
|
3186
|
-
}
|
|
3187
|
-
interface CompletionResponse {
|
|
3188
|
-
text: string;
|
|
3189
|
-
model: string;
|
|
3190
|
-
usage?: {
|
|
3191
|
-
completionTokens: number;
|
|
3192
|
-
promptTokens: number;
|
|
3193
|
-
};
|
|
3194
|
-
finishReason?: 'content_filter' | 'length' | 'stop';
|
|
3195
|
-
}
|
|
3196
|
-
interface StreamChunk {
|
|
3197
|
-
text: string;
|
|
3198
|
-
done: boolean;
|
|
3199
|
-
}
|
|
3200
|
-
interface ModelInfo {
|
|
3201
|
-
id: string;
|
|
3202
|
-
name?: string;
|
|
3203
|
-
capabilities: Partial<ProviderCapabilities>;
|
|
3204
|
-
contextWindow?: number;
|
|
3205
|
-
owned_by?: string;
|
|
3206
|
-
}
|
|
3207
|
-
type ProbeStatus = 'degraded' | 'down' | 'ok';
|
|
3208
|
-
interface ProbeResult {
|
|
3209
|
-
status: ProbeStatus;
|
|
3210
|
-
latencyMs: number;
|
|
3211
|
-
message?: string;
|
|
3212
|
-
}
|
|
3213
|
-
type ProviderTier = 'chrome-ai' | 'in-browser' | 'local-server' | 'remote';
|
|
3214
|
-
interface InferenceProvider {
|
|
3215
|
-
readonly id: string;
|
|
3216
|
-
readonly name: string;
|
|
3217
|
-
readonly tier: ProviderTier;
|
|
3218
|
-
readonly capabilities: ProviderCapabilities;
|
|
3219
|
-
/** Generate embeddings for text inputs */
|
|
3220
|
-
embed?(request: EmbedRequest): Promise<EmbedResponse>;
|
|
3221
|
-
/** Generate a completion (non-streaming) */
|
|
3222
|
-
complete?(request: CompletionRequest): Promise<CompletionResponse>;
|
|
3223
|
-
/** Generate a streaming completion */
|
|
3224
|
-
stream?(request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
3225
|
-
/** List available models from this provider */
|
|
3226
|
-
listModels(): Promise<ModelInfo[]>;
|
|
3227
|
-
/** Health check — probe the provider */
|
|
3228
|
-
probe(): Promise<ProbeResult>;
|
|
3229
|
-
/** Clean up resources */
|
|
3230
|
-
dispose(): void;
|
|
3231
|
-
}
|
|
3232
4306
|
/**
|
|
3233
4307
|
* ProviderRegistry — manages InferenceProvider instances.
|
|
3234
4308
|
* Supports add/remove/getActive/setActive and derives CapabilityManager state.
|
|
@@ -3239,6 +4313,7 @@ declare class ProviderRegistry {
|
|
|
3239
4313
|
private events?;
|
|
3240
4314
|
private providers;
|
|
3241
4315
|
private activeId;
|
|
4316
|
+
private routes;
|
|
3242
4317
|
constructor(events?: TypedEventBus | undefined);
|
|
3243
4318
|
/** Register a provider. First provider with embedding capability becomes active. */
|
|
3244
4319
|
add(provider: InferenceProvider): void;
|
|
@@ -3246,6 +4321,10 @@ declare class ProviderRegistry {
|
|
|
3246
4321
|
remove(id: string): void;
|
|
3247
4322
|
/** Set the active provider by ID */
|
|
3248
4323
|
setActive(id: string): void;
|
|
4324
|
+
setRoute(task: InferenceTask, policy: ProviderRoutePolicy): void;
|
|
4325
|
+
getRoute(task: InferenceTask): ProviderRoutePolicy | undefined;
|
|
4326
|
+
clearRoute(task: InferenceTask): void;
|
|
4327
|
+
clearRoutes(): void;
|
|
3249
4328
|
/** Get the currently active provider */
|
|
3250
4329
|
getActive(): InferenceProvider | null;
|
|
3251
4330
|
/** Get a provider by ID */
|
|
@@ -3266,6 +4345,10 @@ declare class ProviderRegistry {
|
|
|
3266
4345
|
complete(request: CompletionRequest): Promise<CompletionResponse>;
|
|
3267
4346
|
/** Convenience: stream using active provider */
|
|
3268
4347
|
stream(request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
4348
|
+
previewRoute(task: InferenceTask | undefined, capability: keyof ProviderCapabilities, requestModel?: string): ProviderRouteSelection;
|
|
4349
|
+
probeRoute(task: InferenceTask | undefined, capability: keyof ProviderCapabilities, requestModel?: string): Promise<ProviderRouteProbeResult>;
|
|
4350
|
+
validateRoute(task: InferenceTask, capability?: keyof ProviderCapabilities, policy?: ProviderRoutePolicy | undefined): ProviderRouteValidation;
|
|
4351
|
+
validateRoutes(): ProviderRouteValidation[];
|
|
3269
4352
|
/** Dispose all providers */
|
|
3270
4353
|
dispose(): void;
|
|
3271
4354
|
/**
|
|
@@ -3274,7 +4357,62 @@ declare class ProviderRegistry {
|
|
|
3274
4357
|
* consumers that call getEmbedFunction() / getLlmFunction() still work.
|
|
3275
4358
|
*/
|
|
3276
4359
|
private syncLegacyFunctions;
|
|
4360
|
+
private resolveProvider;
|
|
4361
|
+
private resolveRouteSelections;
|
|
4362
|
+
private emitRouteSelected;
|
|
4363
|
+
private withRouteFallback;
|
|
4364
|
+
private emitRouteCompleted;
|
|
4365
|
+
private emitRouteFailed;
|
|
4366
|
+
private resolveCandidates;
|
|
4367
|
+
}
|
|
4368
|
+
interface ProviderRoutePolicy {
|
|
4369
|
+
providerIds?: string[];
|
|
4370
|
+
tiers?: ProviderTier[];
|
|
4371
|
+
model?: string;
|
|
4372
|
+
fallback?: boolean;
|
|
4373
|
+
requirements?: ProviderRouteRequirements;
|
|
4374
|
+
}
|
|
4375
|
+
interface ProviderRouteRequirements {
|
|
4376
|
+
privacyTiers?: ProviderPrivacyTier[];
|
|
4377
|
+
maxCostTier?: ProviderCostTier;
|
|
4378
|
+
minContextTokens?: number;
|
|
4379
|
+
minEmbeddingDimensions?: number;
|
|
4380
|
+
dataClass?: ProviderDataClass;
|
|
4381
|
+
maxInputChars?: number;
|
|
4382
|
+
}
|
|
4383
|
+
interface ProviderRouteSelection {
|
|
4384
|
+
provider: InferenceProvider;
|
|
4385
|
+
providerId: string;
|
|
4386
|
+
providerName: string;
|
|
4387
|
+
tier: ProviderTier;
|
|
4388
|
+
capability: keyof ProviderCapabilities;
|
|
4389
|
+
task?: InferenceTask;
|
|
4390
|
+
model?: string;
|
|
4391
|
+
routeMatched: boolean;
|
|
4392
|
+
}
|
|
4393
|
+
interface ProviderRouteProbeResult extends ProviderRouteSelection {
|
|
4394
|
+
probe: ProbeResult;
|
|
4395
|
+
}
|
|
4396
|
+
type ProviderRouteValidationSeverity = 'error' | 'warning';
|
|
4397
|
+
interface ProviderRouteValidationIssue {
|
|
4398
|
+
severity: ProviderRouteValidationSeverity;
|
|
4399
|
+
code: 'empty-explicit-chain' | 'missing-handler' | 'missing-provider' | 'no-eligible-provider' | 'profile-requirement' | 'unsupported-capability';
|
|
4400
|
+
message: string;
|
|
4401
|
+
providerId?: string;
|
|
4402
|
+
}
|
|
4403
|
+
interface ProviderRouteValidation {
|
|
4404
|
+
task: InferenceTask;
|
|
4405
|
+
capability: keyof ProviderCapabilities;
|
|
4406
|
+
policy?: ProviderRoutePolicy;
|
|
4407
|
+
providerIds: string[];
|
|
4408
|
+
eligibleProviderIds: string[];
|
|
4409
|
+
issues: ProviderRouteValidationIssue[];
|
|
4410
|
+
ok: boolean;
|
|
3277
4411
|
}
|
|
4412
|
+
declare function inferInferenceTaskCapability(task: InferenceTask): keyof ProviderCapabilities;
|
|
4413
|
+
declare function validateProviderRoute(task: InferenceTask, capability: keyof ProviderCapabilities, policy: ProviderRoutePolicy | undefined, providers: InferenceProvider[]): ProviderRouteValidation;
|
|
4414
|
+
declare function providerSatisfiesRouteRequirements(provider: InferenceProvider, requirements: ProviderRouteRequirements | undefined, capability: keyof ProviderCapabilities): boolean;
|
|
4415
|
+
declare function getProviderRouteRequirementIssue(provider: InferenceProvider, requirements: ProviderRouteRequirements | undefined, capability: keyof ProviderCapabilities): string | undefined;
|
|
3278
4416
|
/**
|
|
3279
4417
|
* Create an InferenceProvider from legacy bare functions.
|
|
3280
4418
|
* Used by setEmbedFunction/setLlmFunction backward compat layer.
|
|
@@ -3284,6 +4422,7 @@ declare function createLegacyProvider(options: {
|
|
|
3284
4422
|
id?: string;
|
|
3285
4423
|
llmFn?: LlmCompleteFn | null;
|
|
3286
4424
|
name?: string;
|
|
4425
|
+
profile?: InferenceProvider['profile'];
|
|
3287
4426
|
}): InferenceProvider;
|
|
3288
4427
|
/**
|
|
3289
4428
|
* OpenAI-compatible inference provider.
|
|
@@ -3304,12 +4443,14 @@ interface OpenAIProviderConfig {
|
|
|
3304
4443
|
tier?: ProviderTier;
|
|
3305
4444
|
headers?: Record<string, string>;
|
|
3306
4445
|
timeoutMs?: number;
|
|
4446
|
+
profile?: ProviderProfile;
|
|
3307
4447
|
}
|
|
3308
4448
|
declare class OpenAICompatibleProvider implements InferenceProvider {
|
|
3309
4449
|
readonly id: string;
|
|
3310
4450
|
readonly name: string;
|
|
3311
4451
|
readonly tier: ProviderTier;
|
|
3312
4452
|
readonly capabilities: ProviderCapabilities;
|
|
4453
|
+
readonly profile?: ProviderProfile;
|
|
3313
4454
|
private baseURL;
|
|
3314
4455
|
private apiKey?;
|
|
3315
4456
|
private defaultModel;
|
|
@@ -3326,11 +4467,70 @@ declare class OpenAICompatibleProvider implements InferenceProvider {
|
|
|
3326
4467
|
dispose(): void;
|
|
3327
4468
|
private buildMessages;
|
|
3328
4469
|
private mapFinishReason;
|
|
3329
|
-
private isEmbeddingModel;
|
|
3330
4470
|
private isLocalURL;
|
|
3331
4471
|
private fetch;
|
|
3332
4472
|
private rawFetch;
|
|
3333
4473
|
}
|
|
4474
|
+
interface FortemiBridgeCapabilities {
|
|
4475
|
+
secureSecrets: boolean;
|
|
4476
|
+
providerRouting: boolean;
|
|
4477
|
+
localNetworkAccess: boolean;
|
|
4478
|
+
auditLog: boolean;
|
|
4479
|
+
}
|
|
4480
|
+
interface FortemiSecretStore {
|
|
4481
|
+
isAvailable(): boolean | Promise<boolean>;
|
|
4482
|
+
getSecret(key: string): Promise<null | string>;
|
|
4483
|
+
setSecret(key: string, value: string): Promise<void>;
|
|
4484
|
+
deleteSecret(key: string): Promise<void>;
|
|
4485
|
+
}
|
|
4486
|
+
interface BridgeProviderInfo {
|
|
4487
|
+
id: string;
|
|
4488
|
+
name: string;
|
|
4489
|
+
tier: 'chrome-ai' | 'in-browser' | 'local-server' | 'remote';
|
|
4490
|
+
requiresApiKey: boolean;
|
|
4491
|
+
capabilities: {
|
|
4492
|
+
chat?: boolean;
|
|
4493
|
+
embeddings?: boolean;
|
|
4494
|
+
streaming?: boolean;
|
|
4495
|
+
};
|
|
4496
|
+
profile?: ProviderProfile;
|
|
4497
|
+
}
|
|
4498
|
+
interface FortemiInferenceRouter {
|
|
4499
|
+
listProviders(): Promise<BridgeProviderInfo[]>;
|
|
4500
|
+
probeProvider(providerId: string): Promise<ProbeResult>;
|
|
4501
|
+
complete(providerId: string, request: CompletionRequest): Promise<CompletionResponse>;
|
|
4502
|
+
embed(providerId: string, request: EmbedRequest): Promise<EmbedResponse>;
|
|
4503
|
+
stream?(providerId: string, request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
4504
|
+
}
|
|
4505
|
+
interface FortemiBridge {
|
|
4506
|
+
version: string;
|
|
4507
|
+
capabilities(): Promise<FortemiBridgeCapabilities>;
|
|
4508
|
+
secrets: FortemiSecretStore;
|
|
4509
|
+
inference?: FortemiInferenceRouter;
|
|
4510
|
+
}
|
|
4511
|
+
interface FortemiBridgeHost {
|
|
4512
|
+
fortemiBridge?: FortemiBridge;
|
|
4513
|
+
fortemiSecureStorage?: FortemiSecretStore;
|
|
4514
|
+
}
|
|
4515
|
+
declare function getFortemiBridge(host?: FortemiBridgeHost | undefined): FortemiBridge | null;
|
|
4516
|
+
declare function getFortemiSecretStore(host?: FortemiBridgeHost | undefined): FortemiSecretStore | null;
|
|
4517
|
+
declare function hasFortemiSecureSecrets(host?: FortemiBridgeHost | undefined): Promise<boolean>;
|
|
4518
|
+
declare class BridgeInferenceProvider implements InferenceProvider {
|
|
4519
|
+
private bridge;
|
|
4520
|
+
readonly id: string;
|
|
4521
|
+
readonly name: string;
|
|
4522
|
+
readonly tier: ProviderTier;
|
|
4523
|
+
readonly capabilities: ProviderCapabilities;
|
|
4524
|
+
readonly profile: InferenceProvider['profile'];
|
|
4525
|
+
constructor(bridge: FortemiBridge, info: BridgeProviderInfo);
|
|
4526
|
+
embed(request: EmbedRequest): Promise<EmbedResponse>;
|
|
4527
|
+
complete(request: CompletionRequest): Promise<CompletionResponse>;
|
|
4528
|
+
stream(request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
4529
|
+
listModels(): Promise<ModelInfo[]>;
|
|
4530
|
+
probe(): Promise<ProbeResult>;
|
|
4531
|
+
dispose(): void;
|
|
4532
|
+
}
|
|
4533
|
+
declare function createBridgeInferenceProviders(bridge: FortemiBridge): Promise<BridgeInferenceProvider[]>;
|
|
3334
4534
|
/**
|
|
3335
4535
|
* Local inference server auto-discovery.
|
|
3336
4536
|
* Probes known local endpoints (Ollama, LM Studio, llama.cpp, vLLM, Jan, LocalAI)
|
|
@@ -3364,11 +4564,57 @@ type ModelCategory = 'chat' | 'embedding' | 'vision';
|
|
|
3364
4564
|
* Classify a model by its ID/name into embedding, vision, or chat.
|
|
3365
4565
|
*/
|
|
3366
4566
|
declare function classifyModel(modelId: string): ModelCategory;
|
|
4567
|
+
declare function inferLocalEmbeddingDimensions(models: ModelInfo[]): number[] | undefined;
|
|
4568
|
+
declare function createLocalProviderProfile(models?: ModelInfo[]): ProviderProfile;
|
|
3367
4569
|
/**
|
|
3368
4570
|
* Discover local inference servers by probing known endpoints.
|
|
3369
4571
|
* Returns all reachable providers with their available models.
|
|
3370
4572
|
*/
|
|
3371
4573
|
declare function discoverLocalProviders(options?: DiscoveryOptions): Promise<DiscoveredProvider[]>;
|
|
4574
|
+
type ConfiguredInferenceProvider = {
|
|
4575
|
+
config: OpenAIProviderConfig;
|
|
4576
|
+
kind: 'openai-compatible';
|
|
4577
|
+
} | {
|
|
4578
|
+
embedFn?: EmbedFunction | null;
|
|
4579
|
+
id?: string;
|
|
4580
|
+
kind: 'legacy';
|
|
4581
|
+
llmFn?: LlmCompleteFn | null;
|
|
4582
|
+
name?: string;
|
|
4583
|
+
profile?: InferenceProvider['profile'];
|
|
4584
|
+
} | {
|
|
4585
|
+
kind: 'provider';
|
|
4586
|
+
provider: InferenceProvider;
|
|
4587
|
+
};
|
|
4588
|
+
type LegacyInferenceProviderConfig = Omit<Extract<ConfiguredInferenceProvider, {
|
|
4589
|
+
kind: 'legacy';
|
|
4590
|
+
}>, 'kind'>;
|
|
4591
|
+
interface InferenceRuntimeConfig {
|
|
4592
|
+
providers?: ConfiguredInferenceProvider[];
|
|
4593
|
+
routes?: Partial<Record<InferenceTask, ProviderRoutePolicy>>;
|
|
4594
|
+
activeProviderId?: string;
|
|
4595
|
+
bridgeHost?: FortemiBridgeHost;
|
|
4596
|
+
includeBridgeProviders?: boolean;
|
|
4597
|
+
discoverLocal?: boolean | DiscoveryOptions;
|
|
4598
|
+
embeddingTaskSelection?: EmbeddingTaskSelectionOptions;
|
|
4599
|
+
}
|
|
4600
|
+
interface ConfigureInferenceRuntimeOptions extends InferenceRuntimeConfig {
|
|
4601
|
+
registry?: ProviderRegistry;
|
|
4602
|
+
events?: TypedEventBus;
|
|
4603
|
+
capabilityManager?: CapabilityManager;
|
|
4604
|
+
}
|
|
4605
|
+
interface ConfiguredInferenceRuntime {
|
|
4606
|
+
registry: ProviderRegistry;
|
|
4607
|
+
providers: InferenceProvider[];
|
|
4608
|
+
routeValidation: ProviderRouteValidation[];
|
|
4609
|
+
routeIssues: ProviderRouteValidation['issues'];
|
|
4610
|
+
}
|
|
4611
|
+
declare function defineInferenceRuntime(config: InferenceRuntimeConfig): InferenceRuntimeConfig;
|
|
4612
|
+
declare function defineInferenceProvider(provider: InferenceProvider): ConfiguredInferenceProvider;
|
|
4613
|
+
declare function defineOpenAICompatibleProvider(config: OpenAIProviderConfig): ConfiguredInferenceProvider;
|
|
4614
|
+
declare function defineLegacyInferenceProvider(config: LegacyInferenceProviderConfig): ConfiguredInferenceProvider;
|
|
4615
|
+
declare function mergeInferenceRuntimeConfigs(...configs: Array<InferenceRuntimeConfig | null | undefined>): InferenceRuntimeConfig;
|
|
4616
|
+
declare function getConfiguredInferenceProviderId(config: ConfiguredInferenceProvider): string;
|
|
4617
|
+
declare function configureInferenceRuntime(options?: ConfigureInferenceRuntimeOptions): Promise<ConfiguredInferenceRuntime>;
|
|
3372
4618
|
/**
|
|
3373
4619
|
* FallbackRouter — wraps multiple InferenceProviders with automatic failover.
|
|
3374
4620
|
* Routes requests to the highest-priority available provider, falling through
|
|
@@ -3445,49 +4691,6 @@ declare class FallbackRouter implements InferenceProvider {
|
|
|
3445
4691
|
private withFallback;
|
|
3446
4692
|
private applyCooldown;
|
|
3447
4693
|
}
|
|
3448
|
-
interface FortemiBridgeCapabilities {
|
|
3449
|
-
secureSecrets: boolean;
|
|
3450
|
-
providerRouting: boolean;
|
|
3451
|
-
localNetworkAccess: boolean;
|
|
3452
|
-
auditLog: boolean;
|
|
3453
|
-
}
|
|
3454
|
-
interface FortemiSecretStore {
|
|
3455
|
-
isAvailable(): boolean | Promise<boolean>;
|
|
3456
|
-
getSecret(key: string): Promise<null | string>;
|
|
3457
|
-
setSecret(key: string, value: string): Promise<void>;
|
|
3458
|
-
deleteSecret(key: string): Promise<void>;
|
|
3459
|
-
}
|
|
3460
|
-
interface BridgeProviderInfo {
|
|
3461
|
-
id: string;
|
|
3462
|
-
name: string;
|
|
3463
|
-
tier: 'chrome-ai' | 'in-browser' | 'local-server' | 'remote';
|
|
3464
|
-
requiresApiKey: boolean;
|
|
3465
|
-
capabilities: {
|
|
3466
|
-
chat?: boolean;
|
|
3467
|
-
embeddings?: boolean;
|
|
3468
|
-
streaming?: boolean;
|
|
3469
|
-
};
|
|
3470
|
-
}
|
|
3471
|
-
interface FortemiInferenceRouter {
|
|
3472
|
-
listProviders(): Promise<BridgeProviderInfo[]>;
|
|
3473
|
-
probeProvider(providerId: string): Promise<ProbeResult>;
|
|
3474
|
-
complete(providerId: string, request: CompletionRequest): Promise<CompletionResponse>;
|
|
3475
|
-
embed(providerId: string, request: EmbedRequest): Promise<EmbedResponse>;
|
|
3476
|
-
stream?(providerId: string, request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
3477
|
-
}
|
|
3478
|
-
interface FortemiBridge {
|
|
3479
|
-
version: string;
|
|
3480
|
-
capabilities(): Promise<FortemiBridgeCapabilities>;
|
|
3481
|
-
secrets: FortemiSecretStore;
|
|
3482
|
-
inference?: FortemiInferenceRouter;
|
|
3483
|
-
}
|
|
3484
|
-
interface FortemiBridgeHost {
|
|
3485
|
-
fortemiBridge?: FortemiBridge;
|
|
3486
|
-
fortemiSecureStorage?: FortemiSecretStore;
|
|
3487
|
-
}
|
|
3488
|
-
declare function getFortemiBridge(host?: FortemiBridgeHost | undefined): FortemiBridge | null;
|
|
3489
|
-
declare function getFortemiSecretStore(host?: FortemiBridgeHost | undefined): FortemiSecretStore | null;
|
|
3490
|
-
declare function hasFortemiSecureSecrets(host?: FortemiBridgeHost | undefined): Promise<boolean>;
|
|
3491
4694
|
type CspDirectiveName = 'base-uri' | 'connect-src' | 'default-src' | 'font-src' | 'frame-ancestors' | 'img-src' | 'manifest-src' | 'object-src' | 'report-uri' | 'script-src' | 'style-src' | 'worker-src';
|
|
3492
4695
|
type CspDirectives = Partial<Record<CspDirectiveName, string[]>>;
|
|
3493
4696
|
interface PluginCspOptions {
|
|
@@ -3956,6 +5159,42 @@ interface ShardManifestRecord extends PresenceTrackedRecord {
|
|
|
3956
5159
|
id: string;
|
|
3957
5160
|
manifest: Record<string, unknown>;
|
|
3958
5161
|
}
|
|
5162
|
+
interface SourceIdentityRecord extends PresenceTrackedRecord {
|
|
5163
|
+
id: string;
|
|
5164
|
+
tenant_id: string;
|
|
5165
|
+
archive_id: null | string;
|
|
5166
|
+
namespace: string;
|
|
5167
|
+
external_id: string;
|
|
5168
|
+
external_id_hash: string;
|
|
5169
|
+
source_schema_version: string;
|
|
5170
|
+
content_digest: string;
|
|
5171
|
+
import_run_id: string;
|
|
5172
|
+
caller_stable_id: null | string;
|
|
5173
|
+
note_id: string;
|
|
5174
|
+
created_at: string;
|
|
5175
|
+
updated_at: string;
|
|
5176
|
+
}
|
|
5177
|
+
interface SourceImportRunRecord extends PresenceTrackedRecord {
|
|
5178
|
+
id: string;
|
|
5179
|
+
tenant_id: string;
|
|
5180
|
+
archive_id: null | string;
|
|
5181
|
+
namespace: string;
|
|
5182
|
+
started_at: string;
|
|
5183
|
+
completed_at: null | string;
|
|
5184
|
+
checkpoint: Record<string, unknown>;
|
|
5185
|
+
receipt: Record<string, unknown>;
|
|
5186
|
+
}
|
|
5187
|
+
interface DeletionReceiptRecord extends PresenceTrackedRecord {
|
|
5188
|
+
id: string;
|
|
5189
|
+
operation_key: string;
|
|
5190
|
+
tenant_id: string;
|
|
5191
|
+
archive_id: null | string;
|
|
5192
|
+
selector_hash: string;
|
|
5193
|
+
outcome: string;
|
|
5194
|
+
counts: Record<string, number>;
|
|
5195
|
+
completed_at: string;
|
|
5196
|
+
policy: Record<string, unknown>;
|
|
5197
|
+
}
|
|
3959
5198
|
/** Collection name → record type. The store is generic over this map. */
|
|
3960
5199
|
interface RecordCollections {
|
|
3961
5200
|
note: NoteRecord0;
|
|
@@ -3968,6 +5207,9 @@ interface RecordCollections {
|
|
|
3968
5207
|
attachment: AttachmentRecord;
|
|
3969
5208
|
attachment_blob: AttachmentBlobRecord;
|
|
3970
5209
|
shard_manifest: ShardManifestRecord;
|
|
5210
|
+
source_identity: SourceIdentityRecord;
|
|
5211
|
+
source_import_run: SourceImportRunRecord;
|
|
5212
|
+
deletion_receipt: DeletionReceiptRecord;
|
|
3971
5213
|
}
|
|
3972
5214
|
type RecordCollectionName = keyof RecordCollections;
|
|
3973
5215
|
declare const RECORD_COLLECTIONS: readonly RecordCollectionName[];
|
|
@@ -3999,6 +5241,10 @@ interface RecordStoreCapabilities {
|
|
|
3999
5241
|
atomicBatch?: true;
|
|
4000
5242
|
/** Bounded substring scan over titles/content — not ranked FTS. */
|
|
4001
5243
|
boundedTextScan: true;
|
|
5244
|
+
sourceAddressedUpsert?: true;
|
|
5245
|
+
deletionReceipts?: true;
|
|
5246
|
+
typedMetadataPredicates?: false;
|
|
5247
|
+
evidenceLocators?: true;
|
|
4002
5248
|
fullTextSearch: false;
|
|
4003
5249
|
vectorSearch: false;
|
|
4004
5250
|
sqlJoins: false;
|
|
@@ -4359,11 +5605,14 @@ declare function exportShardFromRecords(store: RecordStore, options?: ExportOpti
|
|
|
4359
5605
|
* explicit warnings and reported under `skipped`.
|
|
4360
5606
|
*/
|
|
4361
5607
|
declare function importShardToRecords(store: RecordStore, data: ArrayBuffer | Uint8Array, options?: ImportOptions): Promise<ImportResult>;
|
|
5608
|
+
declare function upsertRecordStoreSources(store: RecordStore, items: readonly SourceUpsertItem[], options?: SourceUpsertOptions): Promise<SourceUpsertBatchResult>;
|
|
5609
|
+
declare function previewRecordStorePurge(store: RecordStore, selector: PurgeSelector): Promise<PurgePreview>;
|
|
5610
|
+
declare function purgeRecordStoreGraph(store: RecordStore, selector: PurgeSelector, operationKey: string): Promise<DeletionReceipt>;
|
|
4362
5611
|
/**
|
|
4363
5612
|
* @implements @.aiwg/adrs/ADR-011-shard-server-conformance-and-version-negotiation.md
|
|
4364
5613
|
* @source @packages/core/src/shard/schema-validator.ts
|
|
4365
5614
|
* @created 2026-07-17
|
|
4366
5615
|
* @agent Codex
|
|
4367
5616
|
*/
|
|
4368
|
-
declare const VERSION = "2026.
|
|
4369
|
-
export { type ArchiveInfo, ArchiveManager, type AttachInput, type AttachmentBlobRecord, type AttachmentBlobRow, type AttachmentProjectionResult, type AttachmentRecord, type AttachmentRow, AttachmentsRepository, type BackendCandidate, type BackendCapabilities, type BackendConcept, type BackendLink, type BackendListOptions, type BackendNote, type BackendNoteFull, type BackendProvenanceEdge, type BackendRequest, type BackendSearchHit, type BackendSearchQueryOptions, type BackendSearchResult, type BackendSelection, type BackendSemanticTier, type BackendStartupCost, BlobGcOptions, BlobGcResult, BlobReconcileOptions, BlobReconcileResult, BlobStore, type BridgeCapability, type BridgeProviderInfo, type BrowserNoteExport, CORE_V1_COMPONENTS, CURRENT_MIGRATION_HEAD, type CanonicalAttachInput, CanonicalAttachmentsRepository, type CanonicalNoteCreateInput, type CanonicalNoteUpdateInput, type CanonicalNoteView, CanonicalNotesRepository, type CapabilityInfo, CapabilityManager, type CapabilityName, type CapabilityState, type CaptureKnowledgeInput, CaptureKnowledgeInputSchema, type CaptureKnowledgeResult, type CollectionCreateInput, type CollectionNoteRecord, type CollectionRecord, type CollectionRow, CollectionsRepository, CommunitiesRepository, type CommunityAssignmentView, type CommunityCreateInput, type CommunityFilterDefinition, type CommunityGraph, type CommunityOptions, type CommunitySourceDescriptor, type CommunitySourceType, type CommunitySummary, type CompletionRequest, type CompletionResponse, type ConditionResult, type CooldownConfig, type CooldownEvent, type CosineSemanticProviderOptions, type CreatePGliteOptions, type CreateRecordStoreOptions, type CspDirectiveName, type CspDirectives, type CspViolationReport, DB_SNAPSHOT_SCHEMA_VERSION, type DataBackend, type DatabaseClient, type DbSnapshot, type DbSnapshotCompat, type DbSnapshotCompression, type DbSnapshotExpectations, type DbSnapshotMeta, type DbSnapshotSource, DbSnapshotVersionError, type DiscoveredProvider, type DiscoveryOptions, type DumpDbSnapshotOptions, type DumpableDb, EMBED_REQUEST_KIND, EMBED_RESPONSE_KIND, type EmbedFunction, type EmbedRequest, type EmbedRequestMessage, type EmbedResponse, type EmbedResponseMessage, type EmbedTransportPort, type EmbedWorkerOptions, type EmbeddingCompatibilityPolicy, type EmbeddingSetCreateInput, type EmbeddingSetCriteria, type EmbeddingSetDescriptor, type EmbeddingSetEmbeddingInput, type EmbeddingSetFreshness, type EmbeddingSetKind, type EmbeddingSetMode, type EmbeddingSetRow, type EmbeddingSetSelector, EmbeddingSetsRepository, type EnqueueJobInput, type ErrorCategory, type EventMap, ExportOptions, FORTEMI_COMPATIBILITY_PATH, FORTEMI_COMPATIBILITY_STATES, FORTEMI_REQUIRED_COMPATIBILITY_CAPABILITIES, FORTEMI_SERVER_COMPATIBILITY_REVISION, type FallbackEvent, FallbackRouter, type FallbackRouterConfig, type FetchFortemiCompatibilityOptions, type FortemiBridge, type FortemiBridgeCapabilities, type FortemiBridgeHost, type FortemiCompatibilityCapability, type FortemiCompatibilityResponse, type FortemiCompatibilityState, type FortemiCompatibilityValidationResult, type FortemiConfig, type FortemiCore, type FortemiInferenceRouter, type FortemiRequiredCompatibilityCapability, type FortemiSecretStore, type FortemiToolDefinition, FortemiToolManifest, type GetNoteInput, GetNoteInputSchema, type GpuCapabilities, type GraphCommunity, type GraphEdge, type GraphNode, GraphRepository, type IDisposable, IdbRecordStore, ImportOptions, ImportResult, type InferenceCapabilities, type InferenceProvider, JOB_CAPABILITIES, JOB_PRIORITIES, type JobQueueOptions, JobQueueWorker, type JobStatus, type JobType, type JournalEntry, LOCAL_ENDPOINTS, type LegacyMigrationReport, type LinkRecord0, type LinkRow, LinksRepository, type ListNotesInput, ListNotesInputSchema, type LlmCapabilityOptions, type LlmCompleteFn, type LoadedPluginScript, type LocalEndpoint, type ManageArchiveInput, ManageArchiveInputSchema, type ManageArchiveResult, type ManageAttachmentsInput, ManageAttachmentsInputSchema, type ManageAttachmentsResult, type ManageCapabilitiesInput, ManageCapabilitiesInputSchema, type ManageCapabilitiesResult, type ManageCollectionsInput, ManageCollectionsInputSchema, type ManageCollectionsResult, type ManageLinksInput, ManageLinksInputSchema, type ManageLinksResult, type ManageNoteInput, ManageNoteInputSchema, type ManageNoteResult, type ManageTagsInput, ManageTagsInputSchema, type ManageTagsResult, MemoryRecordStore, type Migration, MigrationRunner, type ModelCategory, type ModelFitResult, type ModelInfo, type NoteCreateInput, type NoteFull, type NoteListOptions, type NoteOriginalRecord, type NoteProjectionResult, type NoteRecord0, type NoteRevisedCurrentRecord, type NoteRevision, type NoteSkosTag, type NoteSummary, type NoteTagRecord, type NoteUpdateInput, NotesRepository, OpenAICompatibleProvider, type OpenAIProviderConfig, type OpenShardOptions, type PGliteBackendOptions, PGliteStorageBackend, PGliteStorageBackendFactory, PGliteWorkerClient, PGliteWorkerStorageBackend, PGliteWorkerStorageBackendFactory, type PGliteWorkerStorageBackendFactoryOptions, type PaginatedResult, type PersistenceMode, type PluginCspOptions, type PluginScriptDescriptor, type PluginScriptPolicy, type PrefetchOptions, type PrefetchResult, type PresenceTrackedRecord, type ProbeResult, type ProbeStatus, type ProvenanceEdge, ProvenanceRepository, type ProviderCapabilities, ProviderRegistry, type ProviderTier, type QueryExecutor, type QueryResult, RECORD_COLLECTIONS, RECORD_SCHEMA_VERSION, RECORD_STORE_CAPABILITIES, type RecommendedTier, type RecordBackendManageNoteResult, type RecordBackendOptions, type RecordCollectionName, type RecordCollections, type RecordListOptions, type RecordMutation, type RecordProjectionResult, type RecordProvenanceInput, type RecordStore, type RecordStoreCapabilities, type RemoteBackendConfig, type RemoteBackendPaths, type ResolvedEmbeddingRow, type ResolvedEmbeddingSet, type RestoreDbSnapshotOptions, type RouteHandler, SUPPORTED_PGLITE_VERSION, type SWRegistrationResult, type SearchFacets, type SearchInput, SearchInputSchema, type SearchOptions, SearchRepository, type SearchResponse, type SearchResult, ShardBackend, type ShardBackendOptions, ShardCapabilityReport, ShardCollection, ShardComponent, type ShardComponentStore, ShardEmbedding, ShardEmbeddingConfig, ShardEmbeddingSet, ShardEmbeddingSetMember, ShardExportResult, ShardLink, type ShardListOptions, ShardLossEntry, ShardManifest, ShardNote, type ShardNoteFull, ShardNoteSkosTag, ShardOperation, ShardProfileRegistryEntry, ShardProvenanceEdge, type ShardReader, type ShardReaderNote, type ShardReaderSource, type ShardSchemaValidationResult, type ShardSearchOptions, type ShardSearchRankedNote, type ShardSearchResult, type ShardSearchWeights, ShardSkosConcept, ShardSkosRelation, ShardSkosScheme, ShardTag, ShardTemplate, type SimilarityGraphCacheKey, type SimilarityGraphOptions, type SimilarityGraphRequest, type SimilarityGraphResult, type SkosConcept, type SkosRelation, SkosRepository, type SkosScheme, type StaticSemanticProvider, type StorageBackend, type StorageBackendFactory, type StorageOpenRequest, type StorageTopology, type StreamChunk, TagsRepository, TransactionProxy, TypedEventBus, VERSION, type VectorEntry, type VirtualEmbeddingSetDefinition, type VirtualEmbeddingSetSource, type VirtualEmbeddingSetValidationError, type VirtualMaterializationPolicy, type VramTier, type WorkerRequest, type WorkerResponse, aiRevisionHandler, allMigrations, appendPluginScript, assertShardComponentRecord, buildNoteConditions, buildPluginCsp, captureKnowledge, chunkText, classifyError, classifyModel, clearPrefetchedShard, collectionFromShard, collectionToShard, computeBlobHash, computeHash, computeSri, conceptTaggingHandler, cosineSimilarity, createCosineSemanticProvider, createCspReportHandler, createFortemi, createLegacyProvider, createPGliteBackend, createPGliteInstance, createRecordBackend, createRecordStore, createRemoteBackend, createRoutes, createShardBackend, createShardCapabilityReport, createWorkerEmbedFunction, defaultStorageBackendFactory, detectCommunities, detectGpuCapabilities, detectInferenceCapabilities, discoverLocalProviders, dropAttachmentProjection, dropNoteProjection, dumpDbSnapshot, embeddingConfigToShard, embeddingFromShard, embeddingGenerationHandler, embeddingSetFromShard, embeddingSetMemberToShard, embeddingSetToShard, embeddingToShard, enqueueFullWorkflow, enqueueJob, enqueueNoteCreationJobs, estimateModelFit, estimateVramMB, estimateVramTier, exportShard, exportShardFromRecords, exportShardFromRecordsWithReport, exportShardWithReport, fetchAndValidateFortemiCompatibility, fetchPluginScript, formatFortemiCompatibilitySummary, fortemiCompatibilityUrl, fortemiManifest, fromPrefetched, generateId, getEmbedFunction, getFortemiBridge, getFortemiSecretStore, getJobQueueStatus, getKnowledgeShardContractReceipt, getKnowledgeShardProfileRegistry, getKnowledgeShardSchema, getLlmFunction, getNote, getPrefetchedSha256, handleEmbedRequests, hasFortemiSecureSecrets, importShard, importShardToRecords, isPluginScriptAllowed, isShardPrefetched, linkFromShard, linkToShard, linkingHandler, listNotes, manageArchive, manageAttachments, manageCapabilities, manageCollections, manageLinks, manageNote, manageTags, matchRoute, migrateLegacyBlobStore, noteFromShard, noteSkosTagToShard, noteToShard, openShard, packTarGz, parseCspReport, prefetchShard, profileSupportError, projectAttachments, projectNotes, projectRecords, provenanceEdgeToShard, registerLlmCapability, registerSemanticCapability, registerSemanticCapabilityWorker, registerServiceWorker, restoreDbSnapshot, searchTool, selectBackend, selectLlmModel, setEmbedFunction, setLlmFunction, sha256Hex, skosConceptToShard, skosRelationToShard, skosSchemeToShard, suggestTags, tagsToShard, templateToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, urlLinkToShard, validateChecksums, validateCoreV1ShardArchive, validateFortemiCompatibilityResponse, validateFullV1ShardArchive, validateRecordV1ShardArchive, validateShardArchive, validateShardComponentRecord, validateShardManifest, verifyDbSnapshotMeta, verifySri };
|
|
5617
|
+
declare const VERSION = "2026.9.0";
|
|
5618
|
+
export { type ArchiveInfo, ArchiveManager, type AttachInput, type AttachmentBlobRecord, type AttachmentBlobRow, type AttachmentProjectionResult, type AttachmentRecord, type AttachmentRow, AttachmentsRepository, type BackendCandidate, type BackendCapabilities, type BackendConcept, type BackendLink, type BackendListOptions, type BackendNote, type BackendNoteFull, type BackendProvenanceEdge, type BackendRequest, type BackendSearchHit, type BackendSearchQueryOptions, type BackendSearchResult, type BackendSelection, type BackendSemanticTier, type BackendStartupCost, BlobGcOptions, BlobGcResult, BlobReconcileOptions, BlobReconcileResult, BlobStore, type BridgeCapability, BridgeInferenceProvider, type BridgeProviderInfo, type BrowserNoteExport, CORE_V1_COMPONENTS, CURRENT_MIGRATION_HEAD, type CanonicalAttachInput, CanonicalAttachmentsRepository, type CanonicalNoteCreateInput, type CanonicalNoteUpdateInput, type CanonicalNoteView, CanonicalNotesRepository, type CapabilityInfo, CapabilityManager, type CapabilityName, type CapabilityState, type CaptureKnowledgeInput, CaptureKnowledgeInputSchema, type CaptureKnowledgeResult, type CollectionCreateInput, type CollectionNoteRecord, type CollectionRecord, type CollectionRow, CollectionsRepository, CommunitiesRepository, type CommunityAssignmentView, type CommunityCreateInput, type CommunityFilterDefinition, type CommunityGraph, type CommunityOptions, type CommunitySourceDescriptor, type CommunitySourceType, type CommunitySummary, type CompletionRequest, type CompletionResponse, type ConditionResult, type ConfigureInferenceRuntimeOptions, type ConfiguredInferenceProvider, type ConfiguredInferenceRuntime, type CooldownConfig, type CooldownEvent, type CosineSemanticProviderOptions, type CreatePGliteOptions, type CreateRecordStoreOptions, type CspDirectiveName, type CspDirectives, type CspViolationReport, DATASET_EXECUTION_CAPABILITY_IDS, DATASET_EXECUTION_CONTRACT, DATASET_EXECUTION_SCHEMA_VERSION, DATASET_INGEST_CONTRACT, DATASET_INGEST_SCHEMA_VERSION, DATASET_LINEAGE_CONTRACT, DATASET_LINEAGE_SCHEMA_VERSION, DATASET_MATERIALIZATION_CONTRACT, DATASET_MATERIALIZATION_KINDS, DATASET_MATERIALIZATION_SCHEMA_VERSION, DB_SNAPSHOT_SCHEMA_VERSION, DEFAULT_LARGE_DOCUMENT_CHARS, DEFAULT_LARGE_DOCUMENT_CHUNKS, type DataBackend, type DatabaseClient, type DatasetBenchmarkEvidence, type DatasetCapabilityDeclaration, type DatasetCapabilityDegradation, type DatasetCapabilityDiagnostic, type DatasetCapabilityDiagnosticCode, type DatasetCapabilityEvidence, type DatasetCapabilityLimits, type DatasetCapabilityNegotiationRequest, type DatasetCapabilityNegotiationResult, type DatasetCapabilityRequirement, type DatasetCapabilityStatus, type DatasetCheckpoint, type DatasetDestinationScope, type DatasetDeterminismClass, type DatasetDigest, type DatasetExecutionCapabilityDescriptor, type DatasetExecutionCapabilityId, type DatasetExecutionDataClass, type DatasetExecutionMaturity, type DatasetExecutionPlane, type DatasetImplementationIdentity, type DatasetIncrementalParityResult, DatasetIngestError, type DatasetIngestErrorCode, DatasetIngestExecutor, type DatasetIngestHooks, type DatasetIngestMode, type DatasetIngestStore, type DatasetIngestTransaction, DatasetLineageLedger, type DatasetLineageLedgerOptions, type DatasetMaterializationAdapter, type DatasetMaterializationArtifact, DatasetMaterializationError, type DatasetMaterializationKind, type DatasetMaterializationOperation, type DatasetMaterializationProfile, type DatasetMaterializationReceipt, type DatasetMaterializationRequest, type DatasetMeasuredResources, type DatasetMutation, type DatasetMutationBatch, type DatasetOptionalCapabilityRequirement, type DatasetPrivacyBoundary, type DatasetPrivacyDecision, type DatasetProcessingPlan, type DatasetProfileNegotiationRequest, type DatasetProfileNegotiationResult, type DatasetProfileStatus, type DatasetRecordAuthorizer, type DatasetRecordRejection, type DatasetRetrievalRequest, type DatasetRetrievalResponse, type DatasetRunAttempt, type DatasetRunReceipt, type DatasetRunState, type DatasetRunStatus, type DatasetSourceRecord, type DatasetSourceSnapshot, type DatasetStoredRecord, type DatasetTombstoneMutation, type DatasetUpsertMutation, type DatasetVerificationState, type DbSnapshot, type DbSnapshotCompat, type DbSnapshotCompression, type DbSnapshotExpectations, type DbSnapshotMeta, type DbSnapshotSource, DbSnapshotVersionError, type DeletionReceipt, type DeletionReceiptRecord, type DiscoveredProvider, type DiscoveryOptions, type DumpDbSnapshotOptions, type DumpableDb, EMBED_REQUEST_KIND, EMBED_RESPONSE_KIND, type EmbedFunction, type EmbedFunctionOptions, type EmbedRequest, type EmbedRequestMessage, type EmbedResponse, type EmbedResponseMessage, type EmbedTransportPort, type EmbedWorkerOptions, type EmbeddingCompatibilityPolicy, type EmbeddingSetCreateInput, type EmbeddingSetCriteria, type EmbeddingSetDescriptor, type EmbeddingSetEmbeddingInput, type EmbeddingSetFreshness, type EmbeddingSetKind, type EmbeddingSetMode, type EmbeddingSetRow, type EmbeddingSetSelector, EmbeddingSetsRepository, type EmbeddingTaskSelectionOptions, type EnqueueJobInput, type ErrorCategory, type EventMap, type EvidenceLocator, type ExecuteDatasetBatchOptions, ExportOptions, FORTEMI_BROWSER_LOCAL_DATASET_EXECUTION_DESCRIPTOR, FORTEMI_COMPATIBILITY_PATH, FORTEMI_COMPATIBILITY_STATES, FORTEMI_PORTABLE_SHARD_DATASET_EXECUTION_DESCRIPTOR, FORTEMI_REQUIRED_COMPATIBILITY_CAPABILITIES, FORTEMI_SERVER_COMPATIBILITY_REVISION, FORTEMI_STATIC_CACHE_DATASET_EXECUTION_DESCRIPTOR, type FallbackEvent, FallbackRouter, type FallbackRouterConfig, type FetchFortemiCompatibilityOptions, type FortemiBridge, type FortemiBridgeCapabilities, type FortemiBridgeHost, type FortemiCompatibilityCapability, type FortemiCompatibilityResponse, type FortemiCompatibilityState, type FortemiCompatibilityValidationResult, type FortemiConfig, type FortemiCore, type FortemiInferenceRouter, type FortemiRequiredCompatibilityCapability, type FortemiSecretStore, type FortemiToolDefinition, FortemiToolManifest, type GetNoteInput, GetNoteInputSchema, type GpuCapabilities, type GraphCommunity, type GraphEdge, type GraphNode, GraphRepository, type IDisposable, IdbRecordStore, ImportOptions, ImportResult, type InferenceCapabilities, type InferenceProvider, type InferenceRuntimeConfig, type InferenceTask, JOB_CAPABILITIES, JOB_PRIORITIES, type JobQueueOptions, JobQueueWorker, type JobStatus, type JobType, type JournalEntry, LINEAGE_ENTITY_KINDS, LINEAGE_RELATIONSHIP_KINDS, LOCAL_ENDPOINTS, type LegacyInferenceProviderConfig, type LegacyMigrationReport, LifecyclePurgeRepository, type LineageActivity, type LineageAgent, type LineageAssertion, type LineageAssertionKind, type LineageAuthorizationPolicy, type LineageCorrection, type LineageEntity, type LineageEntityKind, type LineageEvidence, type LineageEvidenceReference, type LineageLedgerArchive, type LineageLossItem, type LineageLossReceipt, type LineagePrivacy, type LineageProjection, type LineageProjectionCapabilities, type LineageRelationshipKind, type LineageTraversalEdge, type LineageTraversalNode, type LineageTraversalRequest, type LineageTraversalResult, type LineageValidationCode, LineageValidationError, type LinkRecord0, type LinkRow, LinksRepository, type ListNotesInput, ListNotesInputSchema, type LlmCapabilityOptions, type LlmCompleteFn, type LlmCompleteOptions, type LoadedPluginScript, type LocalEndpoint, type ManageArchiveInput, ManageArchiveInputSchema, type ManageArchiveResult, type ManageAttachmentsInput, ManageAttachmentsInputSchema, type ManageAttachmentsResult, type ManageCapabilitiesInput, ManageCapabilitiesInputSchema, type ManageCapabilitiesResult, type ManageCollectionsInput, ManageCollectionsInputSchema, type ManageCollectionsResult, type ManageLinksInput, ManageLinksInputSchema, type ManageLinksResult, type ManageNoteInput, ManageNoteInputSchema, type ManageNoteResult, type ManageTagsInput, ManageTagsInputSchema, type ManageTagsResult, MemoryDatasetIngestStore, MemoryRecordStore, type MetadataPredicate, type Migration, MigrationRunner, type ModelCategory, type ModelFitResult, type ModelInfo, type NoteCreateInput, type NoteFull, type NoteListOptions, type NoteOriginalRecord, type NoteProjectionResult, type NoteRecord0, type NoteRevisedCurrentRecord, type NoteRevision, type NoteSkosTag, type NoteSummary, type NoteTagRecord, type NoteUpdateInput, NotesRepository, OpenAICompatibleProvider, type OpenAIProviderConfig, type OpenShardOptions, type PGliteBackendOptions, PGliteStorageBackend, PGliteStorageBackendFactory, PGliteWorkerClient, PGliteWorkerStorageBackend, PGliteWorkerStorageBackendFactory, type PGliteWorkerStorageBackendFactoryOptions, type PaginatedResult, type PersistenceMode, type PluginCspOptions, type PluginScriptDescriptor, type PluginScriptPolicy, type PrefetchOptions, type PrefetchResult, type PresenceTrackedRecord, type ProbeResult, type ProbeStatus, type ProvenanceEdge, ProvenanceRepository, type ProviderCapabilities, type ProviderCostTier, type ProviderDataClass, type ProviderPrivacyTier, type ProviderProfile, ProviderRegistry, type ProviderRoutePolicy, type ProviderRouteProbeResult, type ProviderRouteRequirements, type ProviderRouteSelection, type ProviderRouteValidation, type ProviderRouteValidationIssue, type ProviderRouteValidationSeverity, type ProviderTier, type PurgeCounts, type PurgePreview, type PurgeSelector, type QueryExecutor, type QueryResult, RECORD_COLLECTIONS, RECORD_SCHEMA_VERSION, RECORD_STORE_CAPABILITIES, REGISTERED_METADATA_PATHS, type RecommendedTier, type RecordBackendManageNoteResult, type RecordBackendOptions, type RecordCollectionName, type RecordCollections, type RecordListOptions, type RecordMutation, type RecordProjectionResult, type RecordProvenanceInput, type RecordStore, type RecordStoreCapabilities, type RegisteredMetadataPath, type RemoteBackendConfig, type RemoteBackendPaths, type ResolvedEmbeddingRow, type ResolvedEmbeddingSet, type RestoreDbSnapshotOptions, type RouteHandler, SUPPORTED_PGLITE_VERSION, type SWRegistrationResult, type SearchFacets, type SearchInput, SearchInputSchema, type SearchOptions, SearchRepository, type SearchResponse, type SearchResult, ShardBackend, type ShardBackendOptions, ShardCapabilityReport, ShardCollection, ShardComponent, type ShardComponentStore, ShardEmbedding, ShardEmbeddingConfig, ShardEmbeddingSet, ShardEmbeddingSetMember, ShardExportResult, ShardLink, type ShardListOptions, ShardLossEntry, ShardManifest, ShardNote, type ShardNoteFull, ShardNoteSkosTag, ShardOperation, ShardProfileRegistryEntry, ShardProvenanceEdge, type ShardReader, type ShardReaderNote, type ShardReaderSource, type ShardSchemaValidationResult, type ShardSearchOptions, type ShardSearchRankedNote, type ShardSearchResult, type ShardSearchWeights, ShardSkosConcept, ShardSkosRelation, ShardSkosScheme, ShardTag, ShardTemplate, type SimilarityGraphCacheKey, type SimilarityGraphOptions, type SimilarityGraphRequest, type SimilarityGraphResult, type SkosConcept, type SkosRelation, SkosRepository, type SkosScheme, type SourceIdentityInput, type SourceIdentityRecord, type SourceImportRunRecord, type SourceUpsertBatchResult, type SourceUpsertItem, type SourceUpsertItemResult, type SourceUpsertOptions, type SourceUpsertOutcome, type SourceUpsertPolicy, SourceUpsertRepository, type StaticSemanticProvider, type StorageBackend, type StorageBackendFactory, type StorageOpenRequest, type StorageTopology, type StreamChunk, TagsRepository, TransactionProxy, TypedEventBus, VERSION, type VectorEntry, type VirtualEmbeddingSetDefinition, type VirtualEmbeddingSetSource, type VirtualEmbeddingSetValidationError, type VirtualMaterializationPolicy, type VramTier, type WorkerRequest, type WorkerResponse, aiRevisionHandler, allMigrations, appendPluginScript, assertShardComponentRecord, buildMetadataPredicateConditions, buildNoteConditions, buildPluginCsp, captureKnowledge, chunkText, classifyError, classifyModel, clearPrefetchedShard, collectionFromShard, collectionToShard, compareDatasetIncrementalParity, computeBlobHash, computeHash, computeLineageDigest, computeSri, conceptTaggingHandler, configureInferenceRuntime, cosineSimilarity, createBridgeInferenceProviders, createCosineSemanticProvider, createCspReportHandler, createFortemi, createLegacyProvider, createLocalProviderProfile, createPGliteBackend, createPGliteInstance, createRecordBackend, createRecordStore, createRemoteBackend, createRoutes, createShardBackend, createShardCapabilityReport, createWorkerEmbedFunction, datasetDestinationScopeKey, defaultStorageBackendFactory, defineInferenceProvider, defineInferenceRuntime, defineLegacyInferenceProvider, defineOpenAICompatibleProvider, deriveDatasetIngestIdempotencyKey, detectCommunities, detectGpuCapabilities, detectInferenceCapabilities, digestDatasetMaterializationValue, discoverLocalProviders, dropAttachmentProjection, dropNoteProjection, dumpDbSnapshot, embeddingConfigToShard, embeddingFromShard, embeddingGenerationHandler, embeddingSetFromShard, embeddingSetMemberToShard, embeddingSetToShard, embeddingToShard, enqueueFullWorkflow, enqueueJob, enqueueNoteCreationJobs, estimateModelFit, estimateVramMB, estimateVramTier, executeDatasetMaterialization, executeDatasetRetrieval, exportShard, exportShardFromRecords, exportShardFromRecordsWithReport, exportShardWithReport, fetchAndValidateFortemiCompatibility, fetchPluginScript, formatFortemiCompatibilitySummary, fortemiCompatibilityUrl, fortemiManifest, fromPrefetched, generateId, getConfiguredInferenceProviderId, getEmbedFunction, getEmbeddingTaskSelectionOptions, getFortemiBridge, getFortemiSecretStore, getJobQueueStatus, getKnowledgeShardContractReceipt, getKnowledgeShardProfileRegistry, getKnowledgeShardSchema, getLlmFunction, getNote, getPrefetchedSha256, getProviderRouteRequirementIssue, handleEmbedRequests, hasFortemiSecureSecrets, importShard, importShardToRecords, inferInferenceTaskCapability, inferLocalEmbeddingDimensions, isPluginScriptAllowed, isShardPrefetched, linkFromShard, linkToShard, linkingHandler, listNotes, manageArchive, manageAttachments, manageCapabilities, manageCollections, manageLinks, manageNote, manageTags, matchRoute, mergeInferenceRuntimeConfigs, migrateLegacyBlobStore, negotiateDatasetExecutionCapabilities, negotiateDatasetMaterializationProfile, noteFromShard, noteSkosTagToShard, noteToShard, openShard, packTarGz, parseCspReport, prefetchShard, previewRecordStorePurge, profileSupportError, projectAttachments, projectNotes, projectRecords, provenanceEdgeToShard, providerSatisfiesRouteRequirements, purgeRecordStoreGraph, registerLlmCapability, registerSemanticCapability, registerSemanticCapabilityWorker, registerServiceWorker, restoreDbSnapshot, searchTool, selectBackend, selectEmbeddingTask, selectLlmModel, setEmbedFunction, setEmbeddingTaskSelectionOptions, setLlmFunction, sha256Hex, skosConceptToShard, skosRelationToShard, skosSchemeToShard, suggestTags, tagsToShard, templateToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, upsertRecordStoreSources, urlLinkToShard, validateChecksums, validateCoreV1ShardArchive, validateDatasetBenchmarkEvidence, validateDatasetExecutionDescriptor, validateFortemiCompatibilityResponse, validateFullV1ShardArchive, validateProviderRoute, validateRecordV1ShardArchive, validateShardArchive, validateShardComponentRecord, validateShardManifest, verifyDbSnapshotMeta, verifySri };
|