@fortemi/core 2026.7.10 → 2026.7.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/aiwg-index-shard-oG45XSCU.d.ts +502 -0
- package/dist/aiwg-index-shard.d.ts +1 -0
- package/dist/aiwg-index-shard.js +2195 -0
- package/dist/aiwg-index-shard.js.map +1 -0
- package/dist/aiwg-index.d.ts +16 -55
- package/dist/aiwg-index.js +11 -20
- package/dist/aiwg-index.js.map +1 -1
- package/dist/index.d.ts +28 -512
- package/dist/index.js +98 -18
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -123,8 +123,22 @@ const results = controller.query('deployment', {
|
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
Use this subpath for Pagenary-style command palettes, static docs search, and
|
|
126
|
-
vanilla JavaScript review surfaces.
|
|
127
|
-
|
|
126
|
+
vanilla JavaScript review surfaces. Its published `dist/aiwg-index.js` artifact
|
|
127
|
+
is dependency-free, contains no import statements, and is kept below 50 KB so
|
|
128
|
+
no-bundler consumers can vendor it verbatim.
|
|
129
|
+
|
|
130
|
+
Knowledge Shard conversion intentionally lives on the build-oriented subpath:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
import {
|
|
134
|
+
aiwgFortemiIndexFromKnowledgeShard,
|
|
135
|
+
aiwgFortemiIndexToKnowledgeShard,
|
|
136
|
+
} from '@fortemi/core/aiwg-index-shard'
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
That subpath owns the schema, tar/gzip, checksum, and UUID dependencies. The
|
|
140
|
+
top-level `@fortemi/core` export also remains available for full archive/runtime
|
|
141
|
+
integrations.
|
|
128
142
|
|
|
129
143
|
The AIWG index adapter accepts both `aiwg.fortemi.index.export.v1` and
|
|
130
144
|
`aiwg.fortemi.index.export.v2` envelopes. The v1 record contract keeps the
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
type AiwgFortemiRecordType = string;
|
|
2
|
+
type AiwgFortemiRecordSchemaVersion = 'aiwg.fortemi.index.record.v1' | 'aiwg.fortemi.index.record.v2';
|
|
3
|
+
type AiwgFortemiIndexExportSchemaVersion = 'aiwg.fortemi.index.export.v1' | 'aiwg.fortemi.index.export.v2';
|
|
4
|
+
type AiwgPrivacyClassification = 'private' | 'sanitized' | 'public';
|
|
5
|
+
type AiwgProvenanceConfidence = 'source' | 'candidate' | 'reviewed' | 'rejected';
|
|
6
|
+
type AiwgReviewAction = 'accept' | 'reject' | 'defer';
|
|
7
|
+
type AiwgFortemiRelationshipDirection = 'upstream' | 'downstream' | 'related';
|
|
8
|
+
interface AiwgFortemiRecordSource {
|
|
9
|
+
path: string;
|
|
10
|
+
repo_relative_path: string;
|
|
11
|
+
locator: string;
|
|
12
|
+
origin?: string;
|
|
13
|
+
generated?: boolean;
|
|
14
|
+
checksum?: string;
|
|
15
|
+
updated_at?: string;
|
|
16
|
+
}
|
|
17
|
+
interface AiwgFortemiRelationship {
|
|
18
|
+
type: string;
|
|
19
|
+
target_id: string;
|
|
20
|
+
source_path?: string;
|
|
21
|
+
target_path?: string;
|
|
22
|
+
direction?: AiwgFortemiRelationshipDirection;
|
|
23
|
+
label?: string;
|
|
24
|
+
confidence?: number;
|
|
25
|
+
privacy?: AiwgPrivacyClassification;
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
interface AiwgFortemiProvenance {
|
|
29
|
+
field: string;
|
|
30
|
+
source: string;
|
|
31
|
+
path: string;
|
|
32
|
+
confidence: AiwgProvenanceConfidence;
|
|
33
|
+
privacy: AiwgPrivacyClassification;
|
|
34
|
+
}
|
|
35
|
+
type AiwgFortemiSkosRelationType = 'broader' | 'narrower' | 'related' | string;
|
|
36
|
+
interface AiwgFortemiSkosConcept {
|
|
37
|
+
id: string;
|
|
38
|
+
prefLabel: string;
|
|
39
|
+
definition?: string;
|
|
40
|
+
scheme?: string;
|
|
41
|
+
notation?: string;
|
|
42
|
+
uri?: string;
|
|
43
|
+
altLabels?: string[];
|
|
44
|
+
metadata?: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
interface AiwgFortemiSkosRelation {
|
|
47
|
+
type: AiwgFortemiSkosRelationType;
|
|
48
|
+
source_id: string;
|
|
49
|
+
target_id: string;
|
|
50
|
+
source_path?: string;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
interface AiwgFortemiProvenanceEvent {
|
|
54
|
+
id?: string;
|
|
55
|
+
activity: string;
|
|
56
|
+
agent?: string;
|
|
57
|
+
started_at?: string;
|
|
58
|
+
ended_at?: string;
|
|
59
|
+
source?: string;
|
|
60
|
+
path?: string;
|
|
61
|
+
confidence?: AiwgProvenanceConfidence;
|
|
62
|
+
privacy?: AiwgPrivacyClassification;
|
|
63
|
+
attributes?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
interface AiwgFortemiSearchProjection {
|
|
66
|
+
title?: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
summary?: string;
|
|
69
|
+
body?: string;
|
|
70
|
+
triggers?: string[];
|
|
71
|
+
aliases?: string[];
|
|
72
|
+
capability?: string;
|
|
73
|
+
tags?: string[];
|
|
74
|
+
phase?: string;
|
|
75
|
+
type?: string;
|
|
76
|
+
frontmatter?: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
interface AiwgFortemiChunk {
|
|
79
|
+
id?: string;
|
|
80
|
+
text?: string;
|
|
81
|
+
body?: string;
|
|
82
|
+
summary?: string;
|
|
83
|
+
source_path?: string;
|
|
84
|
+
metadata?: Record<string, unknown>;
|
|
85
|
+
}
|
|
86
|
+
interface AiwgFortemiRecordEmbedding {
|
|
87
|
+
id?: string;
|
|
88
|
+
embedding?: number[];
|
|
89
|
+
vector?: number[];
|
|
90
|
+
model?: string;
|
|
91
|
+
granularity?: string;
|
|
92
|
+
input_hash?: string;
|
|
93
|
+
source_path?: string;
|
|
94
|
+
metadata?: Record<string, unknown>;
|
|
95
|
+
}
|
|
96
|
+
interface AiwgFortemiAttachmentReference {
|
|
97
|
+
id: string;
|
|
98
|
+
path: string;
|
|
99
|
+
mime: string | null;
|
|
100
|
+
checksum: string;
|
|
101
|
+
bytes: number;
|
|
102
|
+
}
|
|
103
|
+
interface AiwgFortemiBinarySource {
|
|
104
|
+
extracted_text: string | null;
|
|
105
|
+
created_at?: string;
|
|
106
|
+
deleted_at?: string | null;
|
|
107
|
+
extraction_status?: 'extracted' | 'pending' | 'failed' | 'blocked' | 'deferred';
|
|
108
|
+
reason?: null | 'extraction_pending' | 'extractor_failed' | 'quarantined' | 'large_binary' | 'unsupported_mime' | 'no_extracted_text';
|
|
109
|
+
attachment: AiwgFortemiAttachmentReference;
|
|
110
|
+
}
|
|
111
|
+
interface AiwgFortemiRecord {
|
|
112
|
+
schema_version: AiwgFortemiRecordSchemaVersion;
|
|
113
|
+
id: string;
|
|
114
|
+
type: AiwgFortemiRecordType;
|
|
115
|
+
source: AiwgFortemiRecordSource;
|
|
116
|
+
title?: string;
|
|
117
|
+
text?: string;
|
|
118
|
+
facets: Record<string, string[]>;
|
|
119
|
+
tags: string[];
|
|
120
|
+
concepts: string[];
|
|
121
|
+
relationships: AiwgFortemiRelationship[];
|
|
122
|
+
provenance: AiwgFortemiProvenance[];
|
|
123
|
+
search?: AiwgFortemiSearchProjection;
|
|
124
|
+
chunks?: AiwgFortemiChunk[];
|
|
125
|
+
binary_sources?: AiwgFortemiBinarySource[];
|
|
126
|
+
embeddings?: AiwgFortemiRecordEmbedding[];
|
|
127
|
+
compatibility?: Record<string, unknown>;
|
|
128
|
+
/** Optional rich SKOS metadata for static consumers that need labels/definitions without opening a shard. */
|
|
129
|
+
skos_concepts?: AiwgFortemiSkosConcept[];
|
|
130
|
+
/** Optional SKOS relationship edges among concepts referenced by this record. */
|
|
131
|
+
skos_relations?: AiwgFortemiSkosRelation[];
|
|
132
|
+
/** Optional W3C PROV-style activity chain for this record. */
|
|
133
|
+
provenance_events?: AiwgFortemiProvenanceEvent[];
|
|
134
|
+
privacy: {
|
|
135
|
+
classification: AiwgPrivacyClassification;
|
|
136
|
+
pii: boolean;
|
|
137
|
+
locality?: string;
|
|
138
|
+
};
|
|
139
|
+
updated_at: string;
|
|
140
|
+
}
|
|
141
|
+
interface AiwgFortemiIndexExport {
|
|
142
|
+
schema_version: AiwgFortemiIndexExportSchemaVersion;
|
|
143
|
+
generated_at: string;
|
|
144
|
+
source: {
|
|
145
|
+
repo: string;
|
|
146
|
+
privacy: AiwgPrivacyClassification;
|
|
147
|
+
graph?: string;
|
|
148
|
+
};
|
|
149
|
+
items: AiwgFortemiRecord[];
|
|
150
|
+
compatibility?: {
|
|
151
|
+
previous_schema_version: 'aiwg.fortemi.index.export.v1';
|
|
152
|
+
strategy: 'supported';
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
interface AiwgFortemiChunkPartRef {
|
|
156
|
+
href: string;
|
|
157
|
+
offset: number;
|
|
158
|
+
count: number;
|
|
159
|
+
}
|
|
160
|
+
declare const AIWG_SCAN_REQUIRED_FIELDS: Array<keyof AiwgFortemiRecord>;
|
|
161
|
+
type AiwgFortemiProjectedRecord = Pick<AiwgFortemiRecord, 'schema_version' | 'id' | 'type' | 'title' | 'text' | 'facets' | 'tags' | 'concepts' | 'privacy'> & Partial<AiwgFortemiRecord>;
|
|
162
|
+
type AiwgDetailIdEncoding = 'uri' | 'base64url';
|
|
163
|
+
interface AiwgFortemiChunkDetailRef {
|
|
164
|
+
href: string;
|
|
165
|
+
encoding?: AiwgDetailIdEncoding;
|
|
166
|
+
}
|
|
167
|
+
interface AiwgFortemiChunkManifest {
|
|
168
|
+
schema_version: 'aiwg.fortemi.index.chunk-manifest.v1';
|
|
169
|
+
generated_at: string;
|
|
170
|
+
source: AiwgFortemiIndexExport['source'];
|
|
171
|
+
source_export_schema_version?: AiwgFortemiIndexExportSchemaVersion;
|
|
172
|
+
total: number;
|
|
173
|
+
part_size: number;
|
|
174
|
+
facets?: Record<string, Record<string, number>>;
|
|
175
|
+
projection?: Array<keyof AiwgFortemiRecord>;
|
|
176
|
+
detail?: AiwgFortemiChunkDetailRef;
|
|
177
|
+
parts: AiwgFortemiChunkPartRef[];
|
|
178
|
+
}
|
|
179
|
+
interface AiwgFortemiChunkPart {
|
|
180
|
+
schema_version: 'aiwg.fortemi.index.chunk.v1';
|
|
181
|
+
manifest_schema_version: 'aiwg.fortemi.index.chunk-manifest.v1';
|
|
182
|
+
offset: number;
|
|
183
|
+
items: AiwgFortemiRecord[];
|
|
184
|
+
}
|
|
185
|
+
interface AiwgIndexValidationResult {
|
|
186
|
+
valid: boolean;
|
|
187
|
+
errors: string[];
|
|
188
|
+
counts: Partial<Record<string, number>>;
|
|
189
|
+
}
|
|
190
|
+
interface AiwgChunkedIndexValidationResult {
|
|
191
|
+
valid: boolean;
|
|
192
|
+
errors: string[];
|
|
193
|
+
}
|
|
194
|
+
interface AiwgIndexQueryOptions {
|
|
195
|
+
types?: AiwgFortemiRecordType[];
|
|
196
|
+
facets?: Record<string, string[]>;
|
|
197
|
+
tags?: string[];
|
|
198
|
+
concepts?: string[];
|
|
199
|
+
privacy?: AiwgPrivacyClassification[];
|
|
200
|
+
relationshipTargetId?: string;
|
|
201
|
+
limit?: number;
|
|
202
|
+
offset?: number;
|
|
203
|
+
rank?: boolean;
|
|
204
|
+
snippets?: boolean;
|
|
205
|
+
snippetLength?: number;
|
|
206
|
+
weights?: Partial<AiwgIndexQueryWeights>;
|
|
207
|
+
includeMatches?: boolean;
|
|
208
|
+
searchProfile?: 'default' | 'aiwg-discovery';
|
|
209
|
+
}
|
|
210
|
+
interface AiwgIndexQueryWeights {
|
|
211
|
+
title: number;
|
|
212
|
+
text: number;
|
|
213
|
+
tag: number;
|
|
214
|
+
concept: number;
|
|
215
|
+
facet: number;
|
|
216
|
+
id: number;
|
|
217
|
+
source: number;
|
|
218
|
+
}
|
|
219
|
+
interface AiwgIndexQueryMatch {
|
|
220
|
+
field: 'title' | 'text' | 'tag' | 'concept' | 'facet' | 'id' | 'source';
|
|
221
|
+
value: string;
|
|
222
|
+
score?: number;
|
|
223
|
+
reason?: string;
|
|
224
|
+
}
|
|
225
|
+
interface AiwgIndexQueryRankedItem {
|
|
226
|
+
item: AiwgFortemiRecord;
|
|
227
|
+
rank: number;
|
|
228
|
+
snippet?: string;
|
|
229
|
+
matches?: AiwgIndexQueryMatch[];
|
|
230
|
+
}
|
|
231
|
+
interface AiwgIndexQueryResult {
|
|
232
|
+
items: AiwgFortemiRecord[];
|
|
233
|
+
total: number;
|
|
234
|
+
facets: Record<string, Record<string, number>>;
|
|
235
|
+
rankedItems?: AiwgIndexQueryRankedItem[];
|
|
236
|
+
}
|
|
237
|
+
type AiwgChunkedIndexLoader = (part: AiwgFortemiChunkPartRef, manifest: AiwgFortemiChunkManifest) => Promise<unknown>;
|
|
238
|
+
type AiwgChunkedIndexDetailLoader = (id: string, manifest: AiwgFortemiChunkManifest) => Promise<unknown>;
|
|
239
|
+
interface AiwgChunkedIndexLoadOptions {
|
|
240
|
+
maxCachedParts?: number;
|
|
241
|
+
detailLoader?: AiwgChunkedIndexDetailLoader;
|
|
242
|
+
maxCachedDetails?: number;
|
|
243
|
+
maxCachedMatches?: number;
|
|
244
|
+
}
|
|
245
|
+
type AiwgChunkedIndexProgressPhase = 'part' | 'query';
|
|
246
|
+
interface AiwgChunkedIndexProgress {
|
|
247
|
+
phase: AiwgChunkedIndexProgressPhase;
|
|
248
|
+
done: number;
|
|
249
|
+
total: number;
|
|
250
|
+
href?: string;
|
|
251
|
+
}
|
|
252
|
+
interface AiwgChunkedIndexQueryOptions extends AiwgIndexQueryOptions {
|
|
253
|
+
onProgress?: (progress: AiwgChunkedIndexProgress) => void;
|
|
254
|
+
}
|
|
255
|
+
interface AiwgChunkedIndexQueryResult extends AiwgIndexQueryResult {
|
|
256
|
+
manifestTotal: number;
|
|
257
|
+
scannedParts: number;
|
|
258
|
+
fetchedParts: number;
|
|
259
|
+
complete: boolean;
|
|
260
|
+
}
|
|
261
|
+
interface AiwgReviewDecision {
|
|
262
|
+
item_id: string;
|
|
263
|
+
action: AiwgReviewAction;
|
|
264
|
+
reason?: string;
|
|
265
|
+
updated_at: string;
|
|
266
|
+
}
|
|
267
|
+
interface AiwgReviewDecisionExport {
|
|
268
|
+
schema_version: 'aiwg.fortemi.review-decisions.v1';
|
|
269
|
+
generated_at: string;
|
|
270
|
+
source_export_schema_version: AiwgFortemiIndexExportSchemaVersion;
|
|
271
|
+
decisions: AiwgReviewDecision[];
|
|
272
|
+
}
|
|
273
|
+
interface AiwgIndexGraphOptions {
|
|
274
|
+
communityFacet?: string;
|
|
275
|
+
communityTagPrefix?: string;
|
|
276
|
+
relationshipWeights?: Record<string, number>;
|
|
277
|
+
includeDanglingRelationships?: boolean;
|
|
278
|
+
}
|
|
279
|
+
type AiwgRelationshipDirection = 'in' | 'out' | 'both';
|
|
280
|
+
type AiwgRelationshipSetOperation = 'intersection' | 'union' | 'difference';
|
|
281
|
+
interface AiwgRelationshipTraversalOptions {
|
|
282
|
+
direction?: AiwgRelationshipDirection;
|
|
283
|
+
relationshipType?: string;
|
|
284
|
+
relationshipDirection?: AiwgFortemiRelationshipDirection;
|
|
285
|
+
limit?: number;
|
|
286
|
+
}
|
|
287
|
+
interface AiwgRelationshipQueryOptions extends AiwgRelationshipTraversalOptions {
|
|
288
|
+
sourceId?: string;
|
|
289
|
+
targetId?: string;
|
|
290
|
+
endpointId?: string;
|
|
291
|
+
type?: string;
|
|
292
|
+
}
|
|
293
|
+
interface AiwgRelationshipEdgeSummary {
|
|
294
|
+
source_id: string;
|
|
295
|
+
target_id: string;
|
|
296
|
+
type: string;
|
|
297
|
+
source_path?: string;
|
|
298
|
+
target_path?: string;
|
|
299
|
+
direction?: AiwgFortemiRelationshipDirection;
|
|
300
|
+
}
|
|
301
|
+
interface AiwgRelationshipNodeSummary {
|
|
302
|
+
id: string;
|
|
303
|
+
type: AiwgFortemiRecordType;
|
|
304
|
+
title: string;
|
|
305
|
+
}
|
|
306
|
+
interface AiwgRelationshipTraversalResult {
|
|
307
|
+
nodes: AiwgRelationshipNodeSummary[];
|
|
308
|
+
edges: AiwgRelationshipEdgeSummary[];
|
|
309
|
+
complete: boolean;
|
|
310
|
+
scannedParts?: number;
|
|
311
|
+
fetchedParts?: number;
|
|
312
|
+
}
|
|
313
|
+
interface AiwgRelationshipSetOptions extends AiwgRelationshipTraversalOptions {
|
|
314
|
+
op: AiwgRelationshipSetOperation;
|
|
315
|
+
a: string;
|
|
316
|
+
b: string;
|
|
317
|
+
}
|
|
318
|
+
interface AiwgRelationshipSetResult {
|
|
319
|
+
ids: string[];
|
|
320
|
+
op: AiwgRelationshipSetOperation;
|
|
321
|
+
}
|
|
322
|
+
interface AiwgStaticEmbeddingRecord {
|
|
323
|
+
record_id: string;
|
|
324
|
+
embedding: number[];
|
|
325
|
+
embedding_id?: string;
|
|
326
|
+
granularity?: string;
|
|
327
|
+
input_hash: string;
|
|
328
|
+
source_path?: string;
|
|
329
|
+
}
|
|
330
|
+
interface AiwgStaticEmbeddingSet {
|
|
331
|
+
schema_version: 'aiwg.fortemi.embedding.set.v1';
|
|
332
|
+
id: string;
|
|
333
|
+
model: string;
|
|
334
|
+
dimensions: number;
|
|
335
|
+
generated_at: string;
|
|
336
|
+
granularity: 'title-summary' | 'body' | 'chunked-body' | string;
|
|
337
|
+
metric?: 'cosine' | 'dot' | 'euclidean';
|
|
338
|
+
input_hash_algorithm?: string;
|
|
339
|
+
embeddings: AiwgStaticEmbeddingRecord[];
|
|
340
|
+
}
|
|
341
|
+
interface AiwgHeadlessEmbeddingBackend {
|
|
342
|
+
model: string;
|
|
343
|
+
dimensions: number;
|
|
344
|
+
embed(input: string, record: AiwgFortemiRecord): number[] | Promise<number[]>;
|
|
345
|
+
}
|
|
346
|
+
interface AiwgPrivacyFilterOptions {
|
|
347
|
+
/** Include records classified `private` (default false). */
|
|
348
|
+
includePrivate?: boolean;
|
|
349
|
+
/** Include records flagged `pii` (default false). */
|
|
350
|
+
includePii?: boolean;
|
|
351
|
+
}
|
|
352
|
+
/** Drop `private`/`pii` records unless explicitly opted in (SEC6, default-safe). */
|
|
353
|
+
declare function filterAiwgRecordsByPrivacy(records: AiwgFortemiRecord[], options?: AiwgPrivacyFilterOptions): AiwgFortemiRecord[];
|
|
354
|
+
interface BuildAiwgStaticEmbeddingSetOptions {
|
|
355
|
+
id: string;
|
|
356
|
+
backend: AiwgHeadlessEmbeddingBackend;
|
|
357
|
+
records?: AiwgFortemiRecord[];
|
|
358
|
+
generatedAt?: string | Date;
|
|
359
|
+
granularity?: AiwgStaticEmbeddingSet['granularity'];
|
|
360
|
+
metric?: AiwgStaticEmbeddingSet['metric'];
|
|
361
|
+
textForRecord?: (record: AiwgFortemiRecord) => string;
|
|
362
|
+
/** Privacy filtering (SEC6). Default-safe: excludes `private`/`pii` records. */
|
|
363
|
+
privacy?: AiwgPrivacyFilterOptions;
|
|
364
|
+
}
|
|
365
|
+
interface AiwgStaticSemanticQueryOptions {
|
|
366
|
+
limit?: number;
|
|
367
|
+
offset?: number;
|
|
368
|
+
minScore?: number;
|
|
369
|
+
}
|
|
370
|
+
interface AiwgStaticSemanticResult {
|
|
371
|
+
item: AiwgFortemiRecord;
|
|
372
|
+
score: number;
|
|
373
|
+
embedding?: AiwgStaticEmbeddingRecord;
|
|
374
|
+
}
|
|
375
|
+
interface AiwgStaticHybridQueryOptions extends AiwgStaticSemanticQueryOptions, AiwgIndexQueryOptions {
|
|
376
|
+
lexicalWeight?: number;
|
|
377
|
+
semanticWeight?: number;
|
|
378
|
+
}
|
|
379
|
+
interface AiwgStaticDuplicatePair {
|
|
380
|
+
left: AiwgFortemiRecord;
|
|
381
|
+
right: AiwgFortemiRecord;
|
|
382
|
+
score: number;
|
|
383
|
+
}
|
|
384
|
+
interface AiwgReviewInput {
|
|
385
|
+
item_id: string;
|
|
386
|
+
action: AiwgReviewAction;
|
|
387
|
+
reason?: string;
|
|
388
|
+
}
|
|
389
|
+
interface AiwgIndexControllerSnapshot {
|
|
390
|
+
index: AiwgFortemiIndexExport | null;
|
|
391
|
+
chunked: {
|
|
392
|
+
manifest: AiwgFortemiChunkManifest;
|
|
393
|
+
cachedParts: number;
|
|
394
|
+
maxCachedParts: number;
|
|
395
|
+
} | null;
|
|
396
|
+
data: AiwgIndexQueryResult | null;
|
|
397
|
+
error: Error | null;
|
|
398
|
+
reviewDecisions: AiwgReviewDecision[];
|
|
399
|
+
}
|
|
400
|
+
type AiwgIndexControllerListener = (snapshot: AiwgIndexControllerSnapshot) => void;
|
|
401
|
+
interface AiwgIndexController {
|
|
402
|
+
loadIndex(value: unknown): AiwgFortemiIndexExport;
|
|
403
|
+
loadChunkedIndex(manifest: unknown, loader: AiwgChunkedIndexLoader, options?: AiwgChunkedIndexLoadOptions): AiwgFortemiChunkManifest;
|
|
404
|
+
getIndex(): AiwgFortemiIndexExport | null;
|
|
405
|
+
getChunkedManifest(): AiwgFortemiChunkManifest | null;
|
|
406
|
+
getSnapshot(): AiwgIndexControllerSnapshot;
|
|
407
|
+
query(query?: string, options?: AiwgIndexQueryOptions): AiwgIndexQueryResult;
|
|
408
|
+
queryChunked(query?: string, options?: AiwgChunkedIndexQueryOptions): Promise<AiwgChunkedIndexQueryResult>;
|
|
409
|
+
getRecord(id: string): Promise<AiwgFortemiRecord>;
|
|
410
|
+
neighbors(id: string, options?: AiwgRelationshipTraversalOptions): Promise<AiwgRelationshipTraversalResult>;
|
|
411
|
+
relationshipQuery(options?: AiwgRelationshipQueryOptions): Promise<AiwgRelationshipTraversalResult>;
|
|
412
|
+
relationshipSet(options: AiwgRelationshipSetOptions): Promise<AiwgRelationshipSetResult>;
|
|
413
|
+
clearChunkCache(): void;
|
|
414
|
+
toCommunityGraph(options?: AiwgIndexGraphOptions): ReturnType<typeof aiwgFortemiIndexToCommunityGraph>;
|
|
415
|
+
toCommunityGraphChunked(options?: AiwgIndexGraphOptions & {
|
|
416
|
+
onProgress?: (progress: AiwgChunkedIndexProgress) => void;
|
|
417
|
+
}): Promise<ReturnType<typeof aiwgFortemiIndexToCommunityGraph>>;
|
|
418
|
+
setReviewDecision(input: AiwgReviewInput): AiwgReviewDecision;
|
|
419
|
+
clearReviewDecision(itemId: string): void;
|
|
420
|
+
createReviewDecisionExport(generatedAt?: string): AiwgReviewDecisionExport;
|
|
421
|
+
subscribe(listener: AiwgIndexControllerListener): () => void;
|
|
422
|
+
}
|
|
423
|
+
declare function validateAiwgFortemiIndexExport(value: unknown): AiwgIndexValidationResult;
|
|
424
|
+
declare function assertAiwgFortemiIndexExport(value: unknown): AiwgFortemiIndexExport;
|
|
425
|
+
declare function validateAiwgFortemiChunkManifest(value: unknown): AiwgChunkedIndexValidationResult;
|
|
426
|
+
declare function assertAiwgFortemiChunkManifest(value: unknown): AiwgFortemiChunkManifest;
|
|
427
|
+
declare function validateAiwgFortemiChunkPart(value: unknown, partRef?: AiwgFortemiChunkPartRef, manifest?: AiwgFortemiChunkManifest): AiwgChunkedIndexValidationResult;
|
|
428
|
+
declare function assertAiwgFortemiChunkPart(value: unknown, partRef?: AiwgFortemiChunkPartRef, manifest?: AiwgFortemiChunkManifest): AiwgFortemiChunkPart;
|
|
429
|
+
declare function createAiwgFetchChunkLoader(baseUrl?: string | URL): AiwgChunkedIndexLoader;
|
|
430
|
+
declare function createAiwgFetchDetailLoader(baseUrl?: string | URL): AiwgChunkedIndexDetailLoader;
|
|
431
|
+
declare function getAiwgFortemiFacets(items: AiwgFortemiRecord[]): Record<string, Record<string, number>>;
|
|
432
|
+
declare function buildAiwgStaticEmbeddingSet(index: AiwgFortemiIndexExport, options: BuildAiwgStaticEmbeddingSetOptions): Promise<AiwgStaticEmbeddingSet>;
|
|
433
|
+
interface AiwgChunkedIndexBuildOptions {
|
|
434
|
+
partSize?: number;
|
|
435
|
+
projection?: Array<keyof AiwgFortemiRecord>;
|
|
436
|
+
detailHref?: string;
|
|
437
|
+
idEncoding?: AiwgDetailIdEncoding;
|
|
438
|
+
generatedAt?: string;
|
|
439
|
+
/** Privacy filtering (SEC6). Default-safe: excludes `private`/`pii` records. */
|
|
440
|
+
privacy?: AiwgPrivacyFilterOptions;
|
|
441
|
+
}
|
|
442
|
+
interface AiwgChunkedIndexBuildResult {
|
|
443
|
+
manifest: AiwgFortemiChunkManifest;
|
|
444
|
+
parts: Array<{
|
|
445
|
+
href: string;
|
|
446
|
+
part: AiwgFortemiChunkPart;
|
|
447
|
+
}>;
|
|
448
|
+
details: Array<{
|
|
449
|
+
id: string;
|
|
450
|
+
href: string;
|
|
451
|
+
record: AiwgFortemiRecord;
|
|
452
|
+
}>;
|
|
453
|
+
}
|
|
454
|
+
declare function buildAiwgChunkedIndex(index: AiwgFortemiIndexExport, options?: AiwgChunkedIndexBuildOptions): AiwgChunkedIndexBuildResult;
|
|
455
|
+
declare function queryAiwgFortemiIndex(index: AiwgFortemiIndexExport, query?: string, options?: AiwgIndexQueryOptions): AiwgIndexQueryResult;
|
|
456
|
+
declare function validateAiwgStaticEmbeddingSet(value: unknown): AiwgChunkedIndexValidationResult;
|
|
457
|
+
declare function assertAiwgStaticEmbeddingSet(value: unknown): AiwgStaticEmbeddingSet;
|
|
458
|
+
declare function queryAiwgSemanticIndex(index: AiwgFortemiIndexExport, embeddingSet: AiwgStaticEmbeddingSet, queryEmbedding: number[], options?: AiwgStaticSemanticQueryOptions): AiwgStaticSemanticResult[];
|
|
459
|
+
declare function queryAiwgHybridIndex(index: AiwgFortemiIndexExport, embeddingSet: AiwgStaticEmbeddingSet, query: string, queryEmbedding: number[], options?: AiwgStaticHybridQueryOptions): AiwgStaticSemanticResult[];
|
|
460
|
+
declare function findAiwgStaticDuplicatePairs(index: AiwgFortemiIndexExport, embeddingSet: AiwgStaticEmbeddingSet, threshold?: number, options?: {
|
|
461
|
+
maxEmbeddings?: number;
|
|
462
|
+
}): AiwgStaticDuplicatePair[];
|
|
463
|
+
declare function createAiwgReviewDecisionExport(source: Pick<AiwgFortemiIndexExport, 'schema_version'>, decisions: AiwgReviewDecision[], generatedAt?: string): AiwgReviewDecisionExport;
|
|
464
|
+
declare function createAiwgIndexController(initialIndex?: AiwgFortemiIndexExport): AiwgIndexController;
|
|
465
|
+
declare function aiwgFortemiIndexToCommunityGraph(index: AiwgFortemiIndexExport, options?: AiwgIndexGraphOptions): {
|
|
466
|
+
nodes: {
|
|
467
|
+
id: string;
|
|
468
|
+
}[];
|
|
469
|
+
edges: {
|
|
470
|
+
source: string;
|
|
471
|
+
target: string;
|
|
472
|
+
kind: string;
|
|
473
|
+
weight: number;
|
|
474
|
+
}[];
|
|
475
|
+
communities: {
|
|
476
|
+
id: string;
|
|
477
|
+
nodes: string[];
|
|
478
|
+
}[];
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
interface AiwgKnowledgeShardOptions {
|
|
482
|
+
createdAt?: string;
|
|
483
|
+
matricVersion?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Reserved for a future full-v1 converter. Passing true currently fails
|
|
486
|
+
* closed because a partial rich-component inventory is not a valid profile.
|
|
487
|
+
*/
|
|
488
|
+
includeNativeRichComponents?: boolean;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Convert the static AIWG/Fortemi v2 index contract into a portable Knowledge
|
|
492
|
+
* Shard. Every note retains the complete source envelope and record in metadata,
|
|
493
|
+
* so the native note/link/SKOS/provenance projections are reversible.
|
|
494
|
+
*/
|
|
495
|
+
declare function aiwgFortemiIndexToKnowledgeShard(index: AiwgFortemiIndexExport, options?: AiwgKnowledgeShardOptions): Promise<Uint8Array>;
|
|
496
|
+
/**
|
|
497
|
+
* Recover the exact AIWG index envelope and records embedded by
|
|
498
|
+
* {@link aiwgFortemiIndexToKnowledgeShard}.
|
|
499
|
+
*/
|
|
500
|
+
declare function aiwgFortemiIndexFromKnowledgeShard(bytes: Uint8Array): AiwgFortemiIndexExport;
|
|
501
|
+
|
|
502
|
+
export { type AiwgRelationshipSetOperation as $, AIWG_SCAN_REQUIRED_FIELDS as A, type AiwgFortemiRecordType as B, type AiwgFortemiRelationship as C, type AiwgFortemiRelationshipDirection as D, type AiwgFortemiSearchProjection as E, type AiwgFortemiSkosConcept as F, type AiwgFortemiSkosRelation as G, type AiwgFortemiSkosRelationType as H, type AiwgHeadlessEmbeddingBackend as I, type AiwgIndexController as J, type AiwgIndexControllerListener as K, type AiwgIndexControllerSnapshot as L, type AiwgIndexGraphOptions as M, type AiwgIndexQueryMatch as N, type AiwgIndexQueryOptions as O, type AiwgIndexQueryRankedItem as P, type AiwgIndexQueryResult as Q, type AiwgIndexQueryWeights as R, type AiwgIndexValidationResult as S, type AiwgKnowledgeShardOptions as T, type AiwgPrivacyClassification as U, type AiwgPrivacyFilterOptions as V, type AiwgProvenanceConfidence as W, type AiwgRelationshipDirection as X, type AiwgRelationshipEdgeSummary as Y, type AiwgRelationshipNodeSummary as Z, type AiwgRelationshipQueryOptions as _, type AiwgChunkedIndexBuildOptions as a, type AiwgRelationshipSetOptions as a0, type AiwgRelationshipSetResult as a1, type AiwgRelationshipTraversalOptions as a2, type AiwgRelationshipTraversalResult as a3, type AiwgReviewAction as a4, type AiwgReviewDecision as a5, type AiwgReviewDecisionExport as a6, type AiwgReviewInput as a7, type AiwgStaticDuplicatePair as a8, type AiwgStaticEmbeddingRecord as a9, validateAiwgFortemiIndexExport as aA, validateAiwgStaticEmbeddingSet as aB, type AiwgStaticEmbeddingSet as aa, type AiwgStaticHybridQueryOptions as ab, type AiwgStaticSemanticQueryOptions as ac, type AiwgStaticSemanticResult as ad, type BuildAiwgStaticEmbeddingSetOptions as ae, aiwgFortemiIndexFromKnowledgeShard as af, aiwgFortemiIndexToCommunityGraph as ag, aiwgFortemiIndexToKnowledgeShard as ah, assertAiwgFortemiChunkManifest as ai, assertAiwgFortemiChunkPart as aj, assertAiwgFortemiIndexExport as ak, assertAiwgStaticEmbeddingSet as al, buildAiwgChunkedIndex as am, buildAiwgStaticEmbeddingSet as an, createAiwgFetchChunkLoader as ao, createAiwgFetchDetailLoader as ap, createAiwgIndexController as aq, createAiwgReviewDecisionExport as ar, filterAiwgRecordsByPrivacy as as, findAiwgStaticDuplicatePairs as at, getAiwgFortemiFacets as au, queryAiwgFortemiIndex as av, queryAiwgHybridIndex as aw, queryAiwgSemanticIndex as ax, validateAiwgFortemiChunkManifest as ay, validateAiwgFortemiChunkPart as az, type AiwgChunkedIndexBuildResult as b, type AiwgChunkedIndexDetailLoader as c, type AiwgChunkedIndexLoadOptions as d, type AiwgChunkedIndexLoader as e, type AiwgChunkedIndexProgress as f, type AiwgChunkedIndexProgressPhase as g, type AiwgChunkedIndexQueryOptions as h, type AiwgChunkedIndexQueryResult as i, type AiwgChunkedIndexValidationResult as j, type AiwgFortemiAttachmentReference as k, type AiwgFortemiBinarySource as l, type AiwgFortemiChunk as m, type AiwgFortemiChunkDetailRef as n, type AiwgFortemiChunkManifest as o, type AiwgFortemiChunkPart as p, type AiwgFortemiChunkPartRef as q, type AiwgFortemiIndexExport as r, type AiwgFortemiIndexExportSchemaVersion as s, type AiwgFortemiProjectedRecord as t, type AiwgFortemiProvenance as u, type AiwgFortemiProvenanceEvent as v, type AiwgFortemiRecord as w, type AiwgFortemiRecordEmbedding as x, type AiwgFortemiRecordSchemaVersion as y, type AiwgFortemiRecordSource as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { T as AiwgKnowledgeShardOptions, af as aiwgFortemiIndexFromKnowledgeShard, ah as aiwgFortemiIndexToKnowledgeShard } from './aiwg-index-shard-oG45XSCU.js';
|