@happyvertical/smrt-facts 0.51.32 → 0.51.34
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/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/__tests__/fixtures/decision-claim-support-3166.d.ts +33 -0
- package/dist/__tests__/fixtures/decision-claim-support-3166.d.ts.map +1 -0
- package/dist/catalog-search.d.ts +7 -0
- package/dist/catalog-search.d.ts.map +1 -0
- package/dist/fact-content.d.ts +39 -0
- package/dist/fact-content.d.ts.map +1 -0
- package/dist/fact-contents.d.ts +32 -0
- package/dist/fact-contents.d.ts.map +1 -0
- package/dist/fact-evidence.d.ts +37 -0
- package/dist/fact-evidence.d.ts.map +1 -0
- package/dist/fact-evidences.d.ts +32 -0
- package/dist/fact-evidences.d.ts.map +1 -0
- package/dist/fact-source.d.ts +29 -0
- package/dist/fact-source.d.ts.map +1 -0
- package/dist/fact-sources.d.ts +50 -0
- package/dist/fact-sources.d.ts.map +1 -0
- package/dist/fact-subject.d.ts +28 -0
- package/dist/fact-subject.d.ts.map +1 -0
- package/dist/fact-subjects.d.ts +56 -0
- package/dist/fact-subjects.d.ts.map +1 -0
- package/dist/fact-tag.d.ts +34 -0
- package/dist/fact-tag.d.ts.map +1 -0
- package/dist/fact-tags.d.ts +51 -0
- package/dist/fact-tags.d.ts.map +1 -0
- package/dist/fact.d.ts +77 -0
- package/dist/fact.d.ts.map +1 -0
- package/dist/facts.d.ts +173 -0
- package/dist/facts.d.ts.map +1 -0
- package/dist/index.d.ts +25 -854
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/prompts.d.ts +5 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +4 -4
- package/dist/types.d.ts +258 -382
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +6 -6
package/dist/types.d.ts
CHANGED
|
@@ -1,382 +1,258 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
/** Optional extraction
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
context
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
sourceType?: string;
|
|
260
|
-
sourceUrl?: string;
|
|
261
|
-
sourceTitle?: string;
|
|
262
|
-
credibility?: number;
|
|
263
|
-
extractedAt?: Date;
|
|
264
|
-
metadata?: string | Record<string, unknown>;
|
|
265
|
-
tenantId?: string | null;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Fact lifecycle status
|
|
270
|
-
*/
|
|
271
|
-
export declare type FactStatus = 'pending' | 'active' | 'disputed' | 'superseded' | 'archived' | 'retracted';
|
|
272
|
-
|
|
273
|
-
declare class FactSubject extends SmrtObject {
|
|
274
|
-
factId: string;
|
|
275
|
-
entityType: string;
|
|
276
|
-
entityId: string;
|
|
277
|
-
role: string;
|
|
278
|
-
metadata: string;
|
|
279
|
-
tenantId: string | null;
|
|
280
|
-
createdAt: Date;
|
|
281
|
-
updatedAt: Date;
|
|
282
|
-
constructor(options?: FactSubjectOptions);
|
|
283
|
-
getRole(): SubjectRole;
|
|
284
|
-
getMetadata(): Record<string, unknown>;
|
|
285
|
-
setMetadata(data: Record<string, unknown>): void;
|
|
286
|
-
updateMetadata(updates: Record<string, unknown>): void;
|
|
287
|
-
/**
|
|
288
|
-
* Get the fact this subject is linked to
|
|
289
|
-
*/
|
|
290
|
-
getFact(): Promise< Fact | null>;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Options for creating a FactSubject instance
|
|
295
|
-
*/
|
|
296
|
-
export declare interface FactSubjectOptions extends SmrtObjectOptions {
|
|
297
|
-
id?: string;
|
|
298
|
-
factId?: string;
|
|
299
|
-
entityType?: string;
|
|
300
|
-
entityId?: string;
|
|
301
|
-
role?: SubjectRole;
|
|
302
|
-
metadata?: string | Record<string, unknown>;
|
|
303
|
-
tenantId?: string | null;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Options for creating a FactTag join
|
|
308
|
-
*/
|
|
309
|
-
export declare interface FactTagOptions extends SmrtObjectOptions {
|
|
310
|
-
id?: string;
|
|
311
|
-
factId?: string;
|
|
312
|
-
tagSlug?: string;
|
|
313
|
-
metadata?: string | Record<string, unknown>;
|
|
314
|
-
tenantId?: string | null;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Fact type classification
|
|
319
|
-
*/
|
|
320
|
-
export declare type FactType = 'assertion' | 'observation' | 'measurement' | 'definition' | 'relationship' | 'event' | 'opinion' | 'prediction';
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Reconcile action taken
|
|
324
|
-
*/
|
|
325
|
-
export declare type ReconcileAction = 'created' | 'merged' | 'branched';
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Options for the reconcile() operation
|
|
329
|
-
*/
|
|
330
|
-
export declare interface ReconcileOptions {
|
|
331
|
-
/** Raw text input to reconcile */
|
|
332
|
-
rawInput: string;
|
|
333
|
-
/** Similarity threshold for automatic merge (default: 0.85) */
|
|
334
|
-
similarityThreshold?: number;
|
|
335
|
-
/** Minimum similarity to consider a conflict (default: 0.60) */
|
|
336
|
-
conflictThreshold?: number;
|
|
337
|
-
/**
|
|
338
|
-
* Minimum selected merge probability required before an ambiguous match can
|
|
339
|
-
* merge (default: 0.75). This is a conservative operating threshold, not a
|
|
340
|
-
* calibrated assurance score, and is separate from cosine similarity. Values
|
|
341
|
-
* outside [0, 1] are rejected before a configured provider is called.
|
|
342
|
-
*/
|
|
343
|
-
decisionMergeProbabilityThreshold?: number;
|
|
344
|
-
/** Fact type classification */
|
|
345
|
-
type?: FactType;
|
|
346
|
-
/** Domain for the fact */
|
|
347
|
-
domain?: string;
|
|
348
|
-
/** Source metadata */
|
|
349
|
-
source?: {
|
|
350
|
-
sourceType?: string;
|
|
351
|
-
sourceUrl?: string;
|
|
352
|
-
sourceTitle?: string;
|
|
353
|
-
credibility?: number;
|
|
354
|
-
metadata?: Record<string, unknown>;
|
|
355
|
-
};
|
|
356
|
-
tenantId?: string | null;
|
|
357
|
-
/** Runtime prompt override for AI-assisted ambiguous reconciliation */
|
|
358
|
-
promptOverride?: PromptConfigOverrideInput;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Result of the reconcile() operation
|
|
363
|
-
*/
|
|
364
|
-
export declare interface ReconcileResult {
|
|
365
|
-
/** Action taken: created, merged, or branched */
|
|
366
|
-
action: ReconcileAction;
|
|
367
|
-
/** The resulting fact (created, updated, or branched) */
|
|
368
|
-
fact: Fact;
|
|
369
|
-
/** Source record if source metadata was provided */
|
|
370
|
-
source?: FactSource;
|
|
371
|
-
/** Cosine similarity score of the best match */
|
|
372
|
-
similarity?: number;
|
|
373
|
-
/** The existing fact that was matched (for merge/branch) */
|
|
374
|
-
matchedFact?: Fact;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Role of a subject entity in relation to a fact
|
|
379
|
-
*/
|
|
380
|
-
export declare type SubjectRole = 'subject' | 'object' | 'source' | 'location' | 'participant' | 'related';
|
|
381
|
-
|
|
382
|
-
export { }
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for @happyvertical/smrt-facts
|
|
3
|
+
*/
|
|
4
|
+
import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
|
|
5
|
+
import type { PromptConfigOverrideInput } from '@happyvertical/smrt-prompts';
|
|
6
|
+
/**
|
|
7
|
+
* Fact type classification
|
|
8
|
+
*/
|
|
9
|
+
export type FactType = 'assertion' | 'observation' | 'measurement' | 'definition' | 'relationship' | 'event' | 'opinion' | 'prediction';
|
|
10
|
+
/**
|
|
11
|
+
* Fact lifecycle status
|
|
12
|
+
*/
|
|
13
|
+
export type FactStatus = 'pending' | 'active' | 'disputed' | 'superseded' | 'archived' | 'retracted';
|
|
14
|
+
/**
|
|
15
|
+
* Review status for a concrete evidence excerpt.
|
|
16
|
+
*/
|
|
17
|
+
export type FactEvidenceStatus = 'supports' | 'contradicts' | 'unclear' | 'irrelevant' | 'invalid';
|
|
18
|
+
/**
|
|
19
|
+
* How a fact evolved from its predecessor in the evolution chain.
|
|
20
|
+
*/
|
|
21
|
+
export type EvolutionType = 'original' | 'correction' | 'refinement' | 'contradiction' | 'extension' | 'merge';
|
|
22
|
+
/**
|
|
23
|
+
* Role of a subject entity in relation to a fact
|
|
24
|
+
*/
|
|
25
|
+
export type SubjectRole = 'subject' | 'object' | 'source' | 'location' | 'participant' | 'related';
|
|
26
|
+
/**
|
|
27
|
+
* Reconcile action taken
|
|
28
|
+
*/
|
|
29
|
+
export type ReconcileAction = 'created' | 'merged' | 'branched';
|
|
30
|
+
/**
|
|
31
|
+
* Relationship between a fact and content
|
|
32
|
+
*/
|
|
33
|
+
export type FactContentRelationship = 'extracted_from' | 'referenced_in' | 'supports' | 'contradicts' | 'related';
|
|
34
|
+
/**
|
|
35
|
+
* Options for creating a Fact instance
|
|
36
|
+
*/
|
|
37
|
+
export interface FactOptions extends SmrtObjectOptions {
|
|
38
|
+
id?: string;
|
|
39
|
+
slug?: string;
|
|
40
|
+
type?: FactType;
|
|
41
|
+
status?: FactStatus;
|
|
42
|
+
domain?: string;
|
|
43
|
+
textRaw?: string;
|
|
44
|
+
textRefined?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Self-referencing pointer to the predecessor fact in the evolution
|
|
47
|
+
* chain. NOT a structural hierarchy edge — see Fact.previousFactId.
|
|
48
|
+
*/
|
|
49
|
+
previousFactId?: string;
|
|
50
|
+
evolutionType?: EvolutionType;
|
|
51
|
+
sourceCount?: number;
|
|
52
|
+
confidence?: number;
|
|
53
|
+
metadata?: string | Record<string, unknown>;
|
|
54
|
+
tenantId?: string | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Options for creating a FactSource instance
|
|
58
|
+
*/
|
|
59
|
+
export interface FactSourceOptions extends SmrtObjectOptions {
|
|
60
|
+
id?: string;
|
|
61
|
+
factId?: string;
|
|
62
|
+
sourceType?: string;
|
|
63
|
+
sourceUrl?: string;
|
|
64
|
+
sourceTitle?: string;
|
|
65
|
+
credibility?: number;
|
|
66
|
+
extractedAt?: Date;
|
|
67
|
+
metadata?: string | Record<string, unknown>;
|
|
68
|
+
tenantId?: string | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Options for creating concrete evidence for a fact.
|
|
72
|
+
*/
|
|
73
|
+
export interface FactEvidenceOptions extends SmrtObjectOptions {
|
|
74
|
+
id?: string;
|
|
75
|
+
factId?: string;
|
|
76
|
+
evidenceKey?: string;
|
|
77
|
+
status?: FactEvidenceStatus;
|
|
78
|
+
sourceKind?: string;
|
|
79
|
+
sourceId?: string;
|
|
80
|
+
sourceUrl?: string;
|
|
81
|
+
sourceTitle?: string;
|
|
82
|
+
quote?: string;
|
|
83
|
+
locator?: string;
|
|
84
|
+
extractionMethod?: string;
|
|
85
|
+
confidence?: number;
|
|
86
|
+
metadata?: string | Record<string, unknown>;
|
|
87
|
+
tenantId?: string | null;
|
|
88
|
+
createdAt?: Date;
|
|
89
|
+
updatedAt?: Date;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Options for creating a FactSubject instance
|
|
93
|
+
*/
|
|
94
|
+
export interface FactSubjectOptions extends SmrtObjectOptions {
|
|
95
|
+
id?: string;
|
|
96
|
+
factId?: string;
|
|
97
|
+
entityType?: string;
|
|
98
|
+
entityId?: string;
|
|
99
|
+
role?: SubjectRole;
|
|
100
|
+
metadata?: string | Record<string, unknown>;
|
|
101
|
+
tenantId?: string | null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Options for creating a FactContent join
|
|
105
|
+
*/
|
|
106
|
+
export interface FactContentOptions extends SmrtObjectOptions {
|
|
107
|
+
id?: string;
|
|
108
|
+
factId?: string;
|
|
109
|
+
contentId?: string;
|
|
110
|
+
relationship?: FactContentRelationship;
|
|
111
|
+
metadata?: string | Record<string, unknown>;
|
|
112
|
+
tenantId?: string | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Options for creating a FactTag join
|
|
116
|
+
*/
|
|
117
|
+
export interface FactTagOptions extends SmrtObjectOptions {
|
|
118
|
+
id?: string;
|
|
119
|
+
factId?: string;
|
|
120
|
+
tagSlug?: string;
|
|
121
|
+
metadata?: string | Record<string, unknown>;
|
|
122
|
+
tenantId?: string | null;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Options for the reconcile() operation
|
|
126
|
+
*/
|
|
127
|
+
export interface ReconcileOptions {
|
|
128
|
+
/** Raw text input to reconcile */
|
|
129
|
+
rawInput: string;
|
|
130
|
+
/** Similarity threshold for automatic merge (default: 0.85) */
|
|
131
|
+
similarityThreshold?: number;
|
|
132
|
+
/** Minimum similarity to consider a conflict (default: 0.60) */
|
|
133
|
+
conflictThreshold?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Minimum selected merge probability required before an ambiguous match can
|
|
136
|
+
* merge (default: 0.75). This is a conservative operating threshold, not a
|
|
137
|
+
* calibrated assurance score, and is separate from cosine similarity. Values
|
|
138
|
+
* outside [0, 1] are rejected before a configured provider is called.
|
|
139
|
+
*/
|
|
140
|
+
decisionMergeProbabilityThreshold?: number;
|
|
141
|
+
/** Fact type classification */
|
|
142
|
+
type?: FactType;
|
|
143
|
+
/** Domain for the fact */
|
|
144
|
+
domain?: string;
|
|
145
|
+
/** Source metadata */
|
|
146
|
+
source?: {
|
|
147
|
+
sourceType?: string;
|
|
148
|
+
sourceUrl?: string;
|
|
149
|
+
sourceTitle?: string;
|
|
150
|
+
credibility?: number;
|
|
151
|
+
metadata?: Record<string, unknown>;
|
|
152
|
+
};
|
|
153
|
+
tenantId?: string | null;
|
|
154
|
+
/** Runtime prompt override for AI-assisted ambiguous reconciliation */
|
|
155
|
+
promptOverride?: PromptConfigOverrideInput;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A candidate factual statement extracted from unstructured source text.
|
|
159
|
+
*/
|
|
160
|
+
export interface FactExtractionCandidate {
|
|
161
|
+
/** Concise, atomic factual statement suitable for audit */
|
|
162
|
+
statement: string;
|
|
163
|
+
/** Fact type classification */
|
|
164
|
+
type?: FactType;
|
|
165
|
+
/** Short source excerpt that supports the statement */
|
|
166
|
+
sourceExcerpt?: string;
|
|
167
|
+
/** Optional extraction confidence from 0 to 1 */
|
|
168
|
+
confidence?: number;
|
|
169
|
+
/** Optional extraction metadata */
|
|
170
|
+
metadata?: Record<string, unknown>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Options for AI-assisted fact extraction from source text.
|
|
174
|
+
*/
|
|
175
|
+
export interface FactExtractionOptions {
|
|
176
|
+
/** Domain to guide extraction and later reconciliation */
|
|
177
|
+
domain?: string;
|
|
178
|
+
/** Source type, e.g. agenda, minutes, article, transcript */
|
|
179
|
+
sourceType?: string;
|
|
180
|
+
/** Human-readable context for the source text */
|
|
181
|
+
context?: string;
|
|
182
|
+
/** Maximum number of facts to extract */
|
|
183
|
+
maxFacts?: number;
|
|
184
|
+
/** Fact types the extractor may return */
|
|
185
|
+
allowedTypes?: FactType[];
|
|
186
|
+
/** Tenant id used when resolving stored prompt overrides */
|
|
187
|
+
tenantId?: string | null;
|
|
188
|
+
/** Runtime prompt override for a single extraction call */
|
|
189
|
+
promptOverride?: PromptConfigOverrideInput;
|
|
190
|
+
}
|
|
191
|
+
export type FactClaimSupportStatus = 'supported' | 'unsupported' | 'contradicted' | 'needs_review';
|
|
192
|
+
export interface FactClaimSupportCandidate {
|
|
193
|
+
id?: string | null;
|
|
194
|
+
statement: string;
|
|
195
|
+
evidence?: Array<{
|
|
196
|
+
id?: string | null;
|
|
197
|
+
status?: FactEvidenceStatus | null;
|
|
198
|
+
quote?: string | null;
|
|
199
|
+
sourceTitle?: string | null;
|
|
200
|
+
sourceUrl?: string | null;
|
|
201
|
+
locator?: string | null;
|
|
202
|
+
}>;
|
|
203
|
+
}
|
|
204
|
+
export interface FactClaimSupportAssessment {
|
|
205
|
+
status: FactClaimSupportStatus;
|
|
206
|
+
matchedFactIds: string[];
|
|
207
|
+
matchedEvidenceIds: string[];
|
|
208
|
+
rationale: string;
|
|
209
|
+
confidence?: number;
|
|
210
|
+
}
|
|
211
|
+
export interface FactClaimSupportOptions {
|
|
212
|
+
tenantId?: string | null;
|
|
213
|
+
promptOverride?: PromptConfigOverrideInput;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Result of the reconcile() operation
|
|
217
|
+
*/
|
|
218
|
+
export interface ReconcileResult {
|
|
219
|
+
/** Action taken: created, merged, or branched */
|
|
220
|
+
action: ReconcileAction;
|
|
221
|
+
/** The resulting fact (created, updated, or branched) */
|
|
222
|
+
fact: import('./fact').Fact;
|
|
223
|
+
/** Source record if source metadata was provided */
|
|
224
|
+
source?: import('./fact-source').FactSource;
|
|
225
|
+
/** Cosine similarity score of the best match */
|
|
226
|
+
similarity?: number;
|
|
227
|
+
/** The existing fact that was matched (for merge/branch) */
|
|
228
|
+
matchedFact?: import('./fact').Fact;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Entity briefing - summary of all facts about an entity
|
|
232
|
+
*/
|
|
233
|
+
export interface EntityBriefing {
|
|
234
|
+
entityType: string;
|
|
235
|
+
entityId: string;
|
|
236
|
+
facts: import('./fact').Fact[];
|
|
237
|
+
totalCount: number;
|
|
238
|
+
byType: Record<string, number>;
|
|
239
|
+
byStatus: Record<string, number>;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Fact metadata structure (flexible, application-specific)
|
|
243
|
+
*/
|
|
244
|
+
export interface FactMetadata {
|
|
245
|
+
/** Original extraction context */
|
|
246
|
+
extractionContext?: string;
|
|
247
|
+
/** AI model used for refinement */
|
|
248
|
+
refinedBy?: string;
|
|
249
|
+
/** Tags for categorization */
|
|
250
|
+
tags?: string[];
|
|
251
|
+
/** Related fact IDs */
|
|
252
|
+
relatedFactIds?: string[];
|
|
253
|
+
/** Corroboration score from cross-referencing */
|
|
254
|
+
corroborationScore?: number;
|
|
255
|
+
/** Allow any other properties */
|
|
256
|
+
[key: string]: unknown;
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,WAAW,GACX,aAAa,GACb,aAAa,GACb,YAAY,GACZ,cAAc,GACd,OAAO,GACP,SAAS,GACT,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,SAA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