@happyvertical/smrt-facts 0.51.32 → 0.51.33

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.
Files changed (42) hide show
  1. package/dist/__smrt-register__.d.ts +2 -0
  2. package/dist/__smrt-register__.d.ts.map +1 -0
  3. package/dist/__tests__/fixtures/decision-claim-support-3166.d.ts +33 -0
  4. package/dist/__tests__/fixtures/decision-claim-support-3166.d.ts.map +1 -0
  5. package/dist/catalog-search.d.ts +7 -0
  6. package/dist/catalog-search.d.ts.map +1 -0
  7. package/dist/fact-content.d.ts +39 -0
  8. package/dist/fact-content.d.ts.map +1 -0
  9. package/dist/fact-contents.d.ts +32 -0
  10. package/dist/fact-contents.d.ts.map +1 -0
  11. package/dist/fact-evidence.d.ts +37 -0
  12. package/dist/fact-evidence.d.ts.map +1 -0
  13. package/dist/fact-evidences.d.ts +32 -0
  14. package/dist/fact-evidences.d.ts.map +1 -0
  15. package/dist/fact-source.d.ts +29 -0
  16. package/dist/fact-source.d.ts.map +1 -0
  17. package/dist/fact-sources.d.ts +50 -0
  18. package/dist/fact-sources.d.ts.map +1 -0
  19. package/dist/fact-subject.d.ts +28 -0
  20. package/dist/fact-subject.d.ts.map +1 -0
  21. package/dist/fact-subjects.d.ts +56 -0
  22. package/dist/fact-subjects.d.ts.map +1 -0
  23. package/dist/fact-tag.d.ts +34 -0
  24. package/dist/fact-tag.d.ts.map +1 -0
  25. package/dist/fact-tags.d.ts +51 -0
  26. package/dist/fact-tags.d.ts.map +1 -0
  27. package/dist/fact.d.ts +77 -0
  28. package/dist/fact.d.ts.map +1 -0
  29. package/dist/facts.d.ts +173 -0
  30. package/dist/facts.d.ts.map +1 -0
  31. package/dist/index.d.ts +25 -854
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +1 -1
  34. package/dist/manifest.json +1 -1
  35. package/dist/prompts.d.ts +5 -0
  36. package/dist/prompts.d.ts.map +1 -0
  37. package/dist/smrt-knowledge.json +4 -4
  38. package/dist/types.d.ts +258 -382
  39. package/dist/types.d.ts.map +1 -0
  40. package/dist/utils.d.ts +26 -0
  41. package/dist/utils.d.ts.map +1 -0
  42. package/package.json +6 -6
package/dist/types.d.ts CHANGED
@@ -1,382 +1,258 @@
1
- import { PromptConfigOverrideInput } from '@happyvertical/smrt-prompts';
2
- import { SmrtObject } from '@happyvertical/smrt-core';
3
- import { SmrtObjectOptions } from '@happyvertical/smrt-core';
4
-
5
- /**
6
- * Entity briefing - summary of all facts about an entity
7
- */
8
- export declare interface EntityBriefing {
9
- entityType: string;
10
- entityId: string;
11
- facts: Fact[];
12
- totalCount: number;
13
- byType: Record<string, number>;
14
- byStatus: Record<string, number>;
15
- }
16
-
17
- /**
18
- * How a fact evolved from its predecessor in the evolution chain.
19
- */
20
- export declare type EvolutionType = 'original' | 'correction' | 'refinement' | 'contradiction' | 'extension' | 'merge';
21
-
22
- declare class Fact extends SmrtObject {
23
- textRefined: string;
24
- textRaw: string;
25
- /** Derived search storage. NULL requires the explicit catalog backfill. */
26
- catalogSearch: string | null;
27
- type: string;
28
- status: string;
29
- domain: string;
30
- /**
31
- * Self-referencing pointer to the predecessor fact in an evolution chain.
32
- *
33
- * This is NOT a structural hierarchy edge — Fact does not extend
34
- * SmrtHierarchical. The chain represents knowledge evolution: an original
35
- * fact, then corrections, refinements, contradictions, or extensions of
36
- * that fact. See `evolutionType` for the kind of step.
37
- */
38
- previousFactId: string;
39
- evolutionType: string;
40
- sourceCount: number;
41
- confidence: number;
42
- metadata: string;
43
- tenantId: string | null;
44
- createdAt: Date;
45
- updatedAt: Date;
46
- constructor(options?: FactOptions);
47
- protected getPersistenceDerivedColumns(): readonly string[];
48
- protected normalizePersistenceData(data: Readonly<Record<string, unknown>>): Record<string, unknown>;
49
- getMetadata(): FactMetadata;
50
- setMetadata(data: FactMetadata): void;
51
- updateMetadata(updates: Partial<FactMetadata>): void;
52
- getType(): FactType;
53
- getStatus(): FactStatus;
54
- getEvolutionType(): EvolutionType;
55
- isActive(): boolean;
56
- isSuperseded(): boolean;
57
- /**
58
- * Whether this fact has a predecessor in the evolution chain.
59
- *
60
- * Returns false for the framework default (`''`) and for any nullish
61
- * value — defensive against rows whose `previous_fact_id` column is
62
- * NULL (e.g. after a migration that left root facts un-backfilled).
63
- */
64
- hasPredecessor(): boolean;
65
- /**
66
- * Get the predecessor fact (the prior version in the evolution chain).
67
- */
68
- getPredecessor(): Promise<Fact | null>;
69
- /**
70
- * Get successor facts (facts that evolved directly from this one).
71
- */
72
- getSuccessors(): Promise<Fact[]>;
73
- /**
74
- * Get all sources for this fact
75
- */
76
- getSources(): Promise< FactSource[]>;
77
- /**
78
- * Get all subjects linked to this fact
79
- */
80
- getSubjects(): Promise< FactSubject[]>;
81
- }
82
-
83
- export declare interface FactClaimSupportAssessment {
84
- status: FactClaimSupportStatus;
85
- matchedFactIds: string[];
86
- matchedEvidenceIds: string[];
87
- rationale: string;
88
- confidence?: number;
89
- }
90
-
91
- export declare interface FactClaimSupportCandidate {
92
- id?: string | null;
93
- statement: string;
94
- evidence?: Array<{
95
- id?: string | null;
96
- status?: FactEvidenceStatus | null;
97
- quote?: string | null;
98
- sourceTitle?: string | null;
99
- sourceUrl?: string | null;
100
- locator?: string | null;
101
- }>;
102
- }
103
-
104
- export declare interface FactClaimSupportOptions {
105
- tenantId?: string | null;
106
- promptOverride?: PromptConfigOverrideInput;
107
- }
108
-
109
- export declare type FactClaimSupportStatus = 'supported' | 'unsupported' | 'contradicted' | 'needs_review';
110
-
111
- /**
112
- * Options for creating a FactContent join
113
- */
114
- export declare interface FactContentOptions extends SmrtObjectOptions {
115
- id?: string;
116
- factId?: string;
117
- contentId?: string;
118
- relationship?: FactContentRelationship;
119
- metadata?: string | Record<string, unknown>;
120
- tenantId?: string | null;
121
- }
122
-
123
- /**
124
- * Relationship between a fact and content
125
- */
126
- export declare type FactContentRelationship = 'extracted_from' | 'referenced_in' | 'supports' | 'contradicts' | 'related';
127
-
128
- /**
129
- * Options for creating concrete evidence for a fact.
130
- */
131
- export declare interface FactEvidenceOptions extends SmrtObjectOptions {
132
- id?: string;
133
- factId?: string;
134
- evidenceKey?: string;
135
- status?: FactEvidenceStatus;
136
- sourceKind?: string;
137
- sourceId?: string;
138
- sourceUrl?: string;
139
- sourceTitle?: string;
140
- quote?: string;
141
- locator?: string;
142
- extractionMethod?: string;
143
- confidence?: number;
144
- metadata?: string | Record<string, unknown>;
145
- tenantId?: string | null;
146
- createdAt?: Date;
147
- updatedAt?: Date;
148
- }
149
-
150
- /**
151
- * Review status for a concrete evidence excerpt.
152
- */
153
- export declare type FactEvidenceStatus = 'supports' | 'contradicts' | 'unclear' | 'irrelevant' | 'invalid';
154
-
155
- /**
156
- * A candidate factual statement extracted from unstructured source text.
157
- */
158
- export declare interface FactExtractionCandidate {
159
- /** Concise, atomic factual statement suitable for audit */
160
- statement: string;
161
- /** Fact type classification */
162
- type?: FactType;
163
- /** Short source excerpt that supports the statement */
164
- sourceExcerpt?: string;
165
- /** Optional extraction confidence from 0 to 1 */
166
- confidence?: number;
167
- /** Optional extraction metadata */
168
- metadata?: Record<string, unknown>;
169
- }
170
-
171
- /**
172
- * Options for AI-assisted fact extraction from source text.
173
- */
174
- export declare interface FactExtractionOptions {
175
- /** Domain to guide extraction and later reconciliation */
176
- domain?: string;
177
- /** Source type, e.g. agenda, minutes, article, transcript */
178
- sourceType?: string;
179
- /** Human-readable context for the source text */
180
- context?: string;
181
- /** Maximum number of facts to extract */
182
- maxFacts?: number;
183
- /** Fact types the extractor may return */
184
- allowedTypes?: FactType[];
185
- /** Tenant id used when resolving stored prompt overrides */
186
- tenantId?: string | null;
187
- /** Runtime prompt override for a single extraction call */
188
- promptOverride?: PromptConfigOverrideInput;
189
- }
190
-
191
- /**
192
- * Fact metadata structure (flexible, application-specific)
193
- */
194
- export declare interface FactMetadata {
195
- /** Original extraction context */
196
- extractionContext?: string;
197
- /** AI model used for refinement */
198
- refinedBy?: string;
199
- /** Tags for categorization */
200
- tags?: string[];
201
- /** Related fact IDs */
202
- relatedFactIds?: string[];
203
- /** Corroboration score from cross-referencing */
204
- corroborationScore?: number;
205
- /** Allow any other properties */
206
- [key: string]: unknown;
207
- }
208
-
209
- /**
210
- * Options for creating a Fact instance
211
- */
212
- export declare interface FactOptions extends SmrtObjectOptions {
213
- id?: string;
214
- slug?: string;
215
- type?: FactType;
216
- status?: FactStatus;
217
- domain?: string;
218
- textRaw?: string;
219
- textRefined?: string;
220
- /**
221
- * Self-referencing pointer to the predecessor fact in the evolution
222
- * chain. NOT a structural hierarchy edge — see Fact.previousFactId.
223
- */
224
- previousFactId?: string;
225
- evolutionType?: EvolutionType;
226
- sourceCount?: number;
227
- confidence?: number;
228
- metadata?: string | Record<string, unknown>;
229
- tenantId?: string | null;
230
- }
231
-
232
- declare class FactSource extends SmrtObject {
233
- factId: string;
234
- sourceType: string;
235
- sourceUrl: string;
236
- sourceTitle: string;
237
- credibility: number;
238
- extractedAt: Date;
239
- metadata: string;
240
- tenantId: string | null;
241
- createdAt: Date;
242
- updatedAt: Date;
243
- constructor(options?: FactSourceOptions);
244
- getMetadata(): Record<string, unknown>;
245
- setMetadata(data: Record<string, unknown>): void;
246
- updateMetadata(updates: Record<string, unknown>): void;
247
- /**
248
- * Get the fact this source belongs to
249
- */
250
- getFact(): Promise< Fact | null>;
251
- }
252
-
253
- /**
254
- * Options for creating a FactSource instance
255
- */
256
- export declare interface FactSourceOptions extends SmrtObjectOptions {
257
- id?: string;
258
- factId?: string;
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,SAAS,GACT,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,UAAU,GACV,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,aAAa,GACb,SAAS,GACT,YAAY,GACZ,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,WAAW,GACX,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM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