@fortemi/core 2026.8.0 → 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/benchmarks/dataset-materialization/small-corpus.v1.json +12 -0
- package/dist/index.d.ts +1173 -130
- package/dist/index.js +2121 -405
- 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.
|
|
@@ -104,6 +943,51 @@ interface EventMap {
|
|
|
104
943
|
id: string;
|
|
105
944
|
name: string;
|
|
106
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
|
+
};
|
|
107
991
|
'provider.fallback': {
|
|
108
992
|
error: string;
|
|
109
993
|
errorCategory: string;
|
|
@@ -3070,6 +3954,100 @@ declare function detectInferenceCapabilities(): Promise<InferenceCapabilities>;
|
|
|
3070
3954
|
*/
|
|
3071
3955
|
/** Split text into overlapping chunks for embedding. */
|
|
3072
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
|
+
}
|
|
3073
4051
|
/**
|
|
3074
4052
|
* Embedding generation job handler.
|
|
3075
4053
|
* Generates and stores vector embeddings for note content.
|
|
@@ -3077,9 +4055,22 @@ declare function chunkText(text: string, maxChars?: number, overlap?: number): s
|
|
|
3077
4055
|
*
|
|
3078
4056
|
* @implements #63 embedding generation
|
|
3079
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;
|
|
3080
4068
|
/** Type for the embed function — injected by the semantic capability module */
|
|
3081
|
-
type EmbedFunction = (texts: string[]) => Promise<number[][]>;
|
|
4069
|
+
type EmbedFunction = (texts: string[], options?: EmbedFunctionOptions) => Promise<number[][]>;
|
|
3082
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;
|
|
3083
4074
|
declare function getEmbedFunction(): EmbedFunction | null;
|
|
3084
4075
|
/** Job handler for embedding generation. Registered in JobQueueWorker. */
|
|
3085
4076
|
declare function embeddingGenerationHandler(job: {
|
|
@@ -3092,11 +4083,14 @@ declare function embeddingGenerationHandler(job: {
|
|
|
3092
4083
|
*
|
|
3093
4084
|
* @implements #66 AI title generation
|
|
3094
4085
|
*/
|
|
3095
|
-
|
|
3096
|
-
type LlmCompleteFn = (prompt: string, options?: {
|
|
4086
|
+
interface LlmCompleteOptions {
|
|
3097
4087
|
maxTokens?: number;
|
|
3098
4088
|
temperature?: number;
|
|
3099
|
-
|
|
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>;
|
|
3100
4094
|
declare function setLlmFunction(fn: LlmCompleteFn | null): void;
|
|
3101
4095
|
declare function getLlmFunction(): LlmCompleteFn | null;
|
|
3102
4096
|
/**
|
|
@@ -3309,86 +4303,6 @@ declare function registerLlmCapability(manager: CapabilityManager, completeFn: L
|
|
|
3309
4303
|
* Unregister the LLM capability — clears the completion function.
|
|
3310
4304
|
*/
|
|
3311
4305
|
declare function unregisterLlmCapability(): void;
|
|
3312
|
-
/**
|
|
3313
|
-
* Formal InferenceProvider interface.
|
|
3314
|
-
* Core contract for all inference providers — remote APIs, local servers, in-browser models.
|
|
3315
|
-
* Core stays dependency-free: interface only, no implementations.
|
|
3316
|
-
*
|
|
3317
|
-
* @implements #112 formal InferenceProvider interface
|
|
3318
|
-
*/
|
|
3319
|
-
interface ProviderCapabilities {
|
|
3320
|
-
embeddings: boolean;
|
|
3321
|
-
chat: boolean;
|
|
3322
|
-
streaming: boolean;
|
|
3323
|
-
vision: boolean;
|
|
3324
|
-
toolCalling: boolean;
|
|
3325
|
-
structuredOutput: boolean;
|
|
3326
|
-
maxContextTokens?: number;
|
|
3327
|
-
}
|
|
3328
|
-
interface EmbedRequest {
|
|
3329
|
-
texts: string[];
|
|
3330
|
-
model?: string;
|
|
3331
|
-
}
|
|
3332
|
-
interface EmbedResponse {
|
|
3333
|
-
vectors: number[][];
|
|
3334
|
-
model: string;
|
|
3335
|
-
usage?: {
|
|
3336
|
-
totalTokens: number;
|
|
3337
|
-
};
|
|
3338
|
-
}
|
|
3339
|
-
interface CompletionRequest {
|
|
3340
|
-
prompt: string;
|
|
3341
|
-
model?: string;
|
|
3342
|
-
maxTokens?: number;
|
|
3343
|
-
temperature?: number;
|
|
3344
|
-
systemPrompt?: string;
|
|
3345
|
-
stopSequences?: string[];
|
|
3346
|
-
}
|
|
3347
|
-
interface CompletionResponse {
|
|
3348
|
-
text: string;
|
|
3349
|
-
model: string;
|
|
3350
|
-
usage?: {
|
|
3351
|
-
completionTokens: number;
|
|
3352
|
-
promptTokens: number;
|
|
3353
|
-
};
|
|
3354
|
-
finishReason?: 'content_filter' | 'length' | 'stop';
|
|
3355
|
-
}
|
|
3356
|
-
interface StreamChunk {
|
|
3357
|
-
text: string;
|
|
3358
|
-
done: boolean;
|
|
3359
|
-
}
|
|
3360
|
-
interface ModelInfo {
|
|
3361
|
-
id: string;
|
|
3362
|
-
name?: string;
|
|
3363
|
-
capabilities: Partial<ProviderCapabilities>;
|
|
3364
|
-
contextWindow?: number;
|
|
3365
|
-
owned_by?: string;
|
|
3366
|
-
}
|
|
3367
|
-
type ProbeStatus = 'degraded' | 'down' | 'ok';
|
|
3368
|
-
interface ProbeResult {
|
|
3369
|
-
status: ProbeStatus;
|
|
3370
|
-
latencyMs: number;
|
|
3371
|
-
message?: string;
|
|
3372
|
-
}
|
|
3373
|
-
type ProviderTier = 'chrome-ai' | 'in-browser' | 'local-server' | 'remote';
|
|
3374
|
-
interface InferenceProvider {
|
|
3375
|
-
readonly id: string;
|
|
3376
|
-
readonly name: string;
|
|
3377
|
-
readonly tier: ProviderTier;
|
|
3378
|
-
readonly capabilities: ProviderCapabilities;
|
|
3379
|
-
/** Generate embeddings for text inputs */
|
|
3380
|
-
embed?(request: EmbedRequest): Promise<EmbedResponse>;
|
|
3381
|
-
/** Generate a completion (non-streaming) */
|
|
3382
|
-
complete?(request: CompletionRequest): Promise<CompletionResponse>;
|
|
3383
|
-
/** Generate a streaming completion */
|
|
3384
|
-
stream?(request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
3385
|
-
/** List available models from this provider */
|
|
3386
|
-
listModels(): Promise<ModelInfo[]>;
|
|
3387
|
-
/** Health check — probe the provider */
|
|
3388
|
-
probe(): Promise<ProbeResult>;
|
|
3389
|
-
/** Clean up resources */
|
|
3390
|
-
dispose(): void;
|
|
3391
|
-
}
|
|
3392
4306
|
/**
|
|
3393
4307
|
* ProviderRegistry — manages InferenceProvider instances.
|
|
3394
4308
|
* Supports add/remove/getActive/setActive and derives CapabilityManager state.
|
|
@@ -3399,6 +4313,7 @@ declare class ProviderRegistry {
|
|
|
3399
4313
|
private events?;
|
|
3400
4314
|
private providers;
|
|
3401
4315
|
private activeId;
|
|
4316
|
+
private routes;
|
|
3402
4317
|
constructor(events?: TypedEventBus | undefined);
|
|
3403
4318
|
/** Register a provider. First provider with embedding capability becomes active. */
|
|
3404
4319
|
add(provider: InferenceProvider): void;
|
|
@@ -3406,6 +4321,10 @@ declare class ProviderRegistry {
|
|
|
3406
4321
|
remove(id: string): void;
|
|
3407
4322
|
/** Set the active provider by ID */
|
|
3408
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;
|
|
3409
4328
|
/** Get the currently active provider */
|
|
3410
4329
|
getActive(): InferenceProvider | null;
|
|
3411
4330
|
/** Get a provider by ID */
|
|
@@ -3426,6 +4345,10 @@ declare class ProviderRegistry {
|
|
|
3426
4345
|
complete(request: CompletionRequest): Promise<CompletionResponse>;
|
|
3427
4346
|
/** Convenience: stream using active provider */
|
|
3428
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[];
|
|
3429
4352
|
/** Dispose all providers */
|
|
3430
4353
|
dispose(): void;
|
|
3431
4354
|
/**
|
|
@@ -3434,7 +4357,62 @@ declare class ProviderRegistry {
|
|
|
3434
4357
|
* consumers that call getEmbedFunction() / getLlmFunction() still work.
|
|
3435
4358
|
*/
|
|
3436
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;
|
|
3437
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;
|
|
3438
4416
|
/**
|
|
3439
4417
|
* Create an InferenceProvider from legacy bare functions.
|
|
3440
4418
|
* Used by setEmbedFunction/setLlmFunction backward compat layer.
|
|
@@ -3444,6 +4422,7 @@ declare function createLegacyProvider(options: {
|
|
|
3444
4422
|
id?: string;
|
|
3445
4423
|
llmFn?: LlmCompleteFn | null;
|
|
3446
4424
|
name?: string;
|
|
4425
|
+
profile?: InferenceProvider['profile'];
|
|
3447
4426
|
}): InferenceProvider;
|
|
3448
4427
|
/**
|
|
3449
4428
|
* OpenAI-compatible inference provider.
|
|
@@ -3464,12 +4443,14 @@ interface OpenAIProviderConfig {
|
|
|
3464
4443
|
tier?: ProviderTier;
|
|
3465
4444
|
headers?: Record<string, string>;
|
|
3466
4445
|
timeoutMs?: number;
|
|
4446
|
+
profile?: ProviderProfile;
|
|
3467
4447
|
}
|
|
3468
4448
|
declare class OpenAICompatibleProvider implements InferenceProvider {
|
|
3469
4449
|
readonly id: string;
|
|
3470
4450
|
readonly name: string;
|
|
3471
4451
|
readonly tier: ProviderTier;
|
|
3472
4452
|
readonly capabilities: ProviderCapabilities;
|
|
4453
|
+
readonly profile?: ProviderProfile;
|
|
3473
4454
|
private baseURL;
|
|
3474
4455
|
private apiKey?;
|
|
3475
4456
|
private defaultModel;
|
|
@@ -3486,11 +4467,70 @@ declare class OpenAICompatibleProvider implements InferenceProvider {
|
|
|
3486
4467
|
dispose(): void;
|
|
3487
4468
|
private buildMessages;
|
|
3488
4469
|
private mapFinishReason;
|
|
3489
|
-
private isEmbeddingModel;
|
|
3490
4470
|
private isLocalURL;
|
|
3491
4471
|
private fetch;
|
|
3492
4472
|
private rawFetch;
|
|
3493
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[]>;
|
|
3494
4534
|
/**
|
|
3495
4535
|
* Local inference server auto-discovery.
|
|
3496
4536
|
* Probes known local endpoints (Ollama, LM Studio, llama.cpp, vLLM, Jan, LocalAI)
|
|
@@ -3524,11 +4564,57 @@ type ModelCategory = 'chat' | 'embedding' | 'vision';
|
|
|
3524
4564
|
* Classify a model by its ID/name into embedding, vision, or chat.
|
|
3525
4565
|
*/
|
|
3526
4566
|
declare function classifyModel(modelId: string): ModelCategory;
|
|
4567
|
+
declare function inferLocalEmbeddingDimensions(models: ModelInfo[]): number[] | undefined;
|
|
4568
|
+
declare function createLocalProviderProfile(models?: ModelInfo[]): ProviderProfile;
|
|
3527
4569
|
/**
|
|
3528
4570
|
* Discover local inference servers by probing known endpoints.
|
|
3529
4571
|
* Returns all reachable providers with their available models.
|
|
3530
4572
|
*/
|
|
3531
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>;
|
|
3532
4618
|
/**
|
|
3533
4619
|
* FallbackRouter — wraps multiple InferenceProviders with automatic failover.
|
|
3534
4620
|
* Routes requests to the highest-priority available provider, falling through
|
|
@@ -3605,49 +4691,6 @@ declare class FallbackRouter implements InferenceProvider {
|
|
|
3605
4691
|
private withFallback;
|
|
3606
4692
|
private applyCooldown;
|
|
3607
4693
|
}
|
|
3608
|
-
interface FortemiBridgeCapabilities {
|
|
3609
|
-
secureSecrets: boolean;
|
|
3610
|
-
providerRouting: boolean;
|
|
3611
|
-
localNetworkAccess: boolean;
|
|
3612
|
-
auditLog: boolean;
|
|
3613
|
-
}
|
|
3614
|
-
interface FortemiSecretStore {
|
|
3615
|
-
isAvailable(): boolean | Promise<boolean>;
|
|
3616
|
-
getSecret(key: string): Promise<null | string>;
|
|
3617
|
-
setSecret(key: string, value: string): Promise<void>;
|
|
3618
|
-
deleteSecret(key: string): Promise<void>;
|
|
3619
|
-
}
|
|
3620
|
-
interface BridgeProviderInfo {
|
|
3621
|
-
id: string;
|
|
3622
|
-
name: string;
|
|
3623
|
-
tier: 'chrome-ai' | 'in-browser' | 'local-server' | 'remote';
|
|
3624
|
-
requiresApiKey: boolean;
|
|
3625
|
-
capabilities: {
|
|
3626
|
-
chat?: boolean;
|
|
3627
|
-
embeddings?: boolean;
|
|
3628
|
-
streaming?: boolean;
|
|
3629
|
-
};
|
|
3630
|
-
}
|
|
3631
|
-
interface FortemiInferenceRouter {
|
|
3632
|
-
listProviders(): Promise<BridgeProviderInfo[]>;
|
|
3633
|
-
probeProvider(providerId: string): Promise<ProbeResult>;
|
|
3634
|
-
complete(providerId: string, request: CompletionRequest): Promise<CompletionResponse>;
|
|
3635
|
-
embed(providerId: string, request: EmbedRequest): Promise<EmbedResponse>;
|
|
3636
|
-
stream?(providerId: string, request: CompletionRequest): AsyncIterable<StreamChunk>;
|
|
3637
|
-
}
|
|
3638
|
-
interface FortemiBridge {
|
|
3639
|
-
version: string;
|
|
3640
|
-
capabilities(): Promise<FortemiBridgeCapabilities>;
|
|
3641
|
-
secrets: FortemiSecretStore;
|
|
3642
|
-
inference?: FortemiInferenceRouter;
|
|
3643
|
-
}
|
|
3644
|
-
interface FortemiBridgeHost {
|
|
3645
|
-
fortemiBridge?: FortemiBridge;
|
|
3646
|
-
fortemiSecureStorage?: FortemiSecretStore;
|
|
3647
|
-
}
|
|
3648
|
-
declare function getFortemiBridge(host?: FortemiBridgeHost | undefined): FortemiBridge | null;
|
|
3649
|
-
declare function getFortemiSecretStore(host?: FortemiBridgeHost | undefined): FortemiSecretStore | null;
|
|
3650
|
-
declare function hasFortemiSecureSecrets(host?: FortemiBridgeHost | undefined): Promise<boolean>;
|
|
3651
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';
|
|
3652
4695
|
type CspDirectives = Partial<Record<CspDirectiveName, string[]>>;
|
|
3653
4696
|
interface PluginCspOptions {
|
|
@@ -4571,5 +5614,5 @@ declare function purgeRecordStoreGraph(store: RecordStore, selector: PurgeSelect
|
|
|
4571
5614
|
* @created 2026-07-17
|
|
4572
5615
|
* @agent Codex
|
|
4573
5616
|
*/
|
|
4574
|
-
declare const VERSION = "2026.
|
|
4575
|
-
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 DeletionReceipt, type DeletionReceiptRecord, 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, type EvidenceLocator, 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, LifecyclePurgeRepository, 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 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, ProviderRegistry, 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, 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, previewRecordStorePurge, profileSupportError, projectAttachments, projectNotes, projectRecords, provenanceEdgeToShard, purgeRecordStoreGraph, registerLlmCapability, registerSemanticCapability, registerSemanticCapabilityWorker, registerServiceWorker, restoreDbSnapshot, searchTool, selectBackend, selectLlmModel, setEmbedFunction, setLlmFunction, sha256Hex, skosConceptToShard, skosRelationToShard, skosSchemeToShard, suggestTags, tagsToShard, templateToShard, titleGenerationHandler, unpackTarGz, unregisterLlmCapability, unregisterSemanticCapability, upsertRecordStoreSources, 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 };
|