@tenphi/akno-protocol 0.1.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/LICENSE +83 -0
- package/README.md +26 -0
- package/dist/common.d.ts +1553 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +309 -0
- package/dist/common.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +69 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/ops/answer.d.ts +207 -0
- package/dist/ops/answer.d.ts.map +1 -0
- package/dist/ops/answer.js +90 -0
- package/dist/ops/answer.js.map +1 -0
- package/dist/ops/context.d.ts +845 -0
- package/dist/ops/context.d.ts.map +1 -0
- package/dist/ops/context.js +82 -0
- package/dist/ops/context.js.map +1 -0
- package/dist/ops/folder.d.ts +85 -0
- package/dist/ops/folder.d.ts.map +1 -0
- package/dist/ops/folder.js +56 -0
- package/dist/ops/folder.js.map +1 -0
- package/dist/ops/graph.d.ts +352 -0
- package/dist/ops/graph.d.ts.map +1 -0
- package/dist/ops/graph.js +63 -0
- package/dist/ops/graph.js.map +1 -0
- package/dist/ops/list.d.ts +136 -0
- package/dist/ops/list.d.ts.map +1 -0
- package/dist/ops/list.js +57 -0
- package/dist/ops/list.js.map +1 -0
- package/dist/ops/mutate.d.ts +432 -0
- package/dist/ops/mutate.d.ts.map +1 -0
- package/dist/ops/mutate.js +234 -0
- package/dist/ops/mutate.js.map +1 -0
- package/dist/ops/read.d.ts +242 -0
- package/dist/ops/read.d.ts.map +1 -0
- package/dist/ops/read.js +65 -0
- package/dist/ops/read.js.map +1 -0
- package/dist/ops/recall.d.ts +531 -0
- package/dist/ops/recall.d.ts.map +1 -0
- package/dist/ops/recall.js +59 -0
- package/dist/ops/recall.js.map +1 -0
- package/dist/ops/timeline.d.ts +264 -0
- package/dist/ops/timeline.d.ts.map +1 -0
- package/dist/ops/timeline.js +68 -0
- package/dist/ops/timeline.js.map +1 -0
- package/dist/ops/write.d.ts +182 -0
- package/dist/ops/write.d.ts.map +1 -0
- package/dist/ops/write.js +114 -0
- package/dist/ops/write.js.map +1 -0
- package/dist/registry.d.ts +2657 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +191 -0
- package/dist/registry.js.map +1 -0
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +14 -0
- package/dist/version.js.map +1 -0
- package/dist/wire.d.ts +112 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +102 -0
- package/dist/wire.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RecallInput: z.ZodObject<{
|
|
3
|
+
query: z.ZodString;
|
|
4
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
lookup: "lookup";
|
|
6
|
+
question: "question";
|
|
7
|
+
explore: "explore";
|
|
8
|
+
}>>;
|
|
9
|
+
depth: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
summary: "summary";
|
|
11
|
+
lines: "lines";
|
|
12
|
+
full: "full";
|
|
13
|
+
}>>;
|
|
14
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
budget: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
17
|
+
knowledge: "knowledge";
|
|
18
|
+
source: "source";
|
|
19
|
+
inference: "inference";
|
|
20
|
+
ignored: "ignored";
|
|
21
|
+
}>>>;
|
|
22
|
+
expand: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
graph: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
rerank: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
27
|
+
type: z.ZodOptional<z.ZodString>;
|
|
28
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
knowledge: "knowledge";
|
|
31
|
+
source: "source";
|
|
32
|
+
inference: "inference";
|
|
33
|
+
ignored: "ignored";
|
|
34
|
+
}>>;
|
|
35
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
page: "page";
|
|
37
|
+
document: "document";
|
|
38
|
+
both: "both";
|
|
39
|
+
}>>;
|
|
40
|
+
ownership: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
any: "any";
|
|
42
|
+
orphan: "orphan";
|
|
43
|
+
owned: "owned";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
since: z.ZodOptional<z.ZodString>;
|
|
47
|
+
until: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type RecallInput = z.infer<typeof RecallInput>;
|
|
50
|
+
export declare const RecallOutput: z.ZodObject<{
|
|
51
|
+
status: z.ZodEnum<{
|
|
52
|
+
ok: "ok";
|
|
53
|
+
empty: "empty";
|
|
54
|
+
degraded: "degraded";
|
|
55
|
+
unavailable: "unavailable";
|
|
56
|
+
}>;
|
|
57
|
+
degraded: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
58
|
+
no_embedding_model: "no_embedding_model";
|
|
59
|
+
no_reranker: "no_reranker";
|
|
60
|
+
no_derive_model: "no_derive_model";
|
|
61
|
+
no_expansion_model: "no_expansion_model";
|
|
62
|
+
embedding_failed: "embedding_failed";
|
|
63
|
+
rerank_failed: "rerank_failed";
|
|
64
|
+
derive_failed: "derive_failed";
|
|
65
|
+
expansion_failed: "expansion_failed";
|
|
66
|
+
no_vector_index: "no_vector_index";
|
|
67
|
+
partial_index: "partial_index";
|
|
68
|
+
no_document_text: "no_document_text";
|
|
69
|
+
document_source_missing: "document_source_missing";
|
|
70
|
+
no_graph_index: "no_graph_index";
|
|
71
|
+
no_entity_index: "no_entity_index";
|
|
72
|
+
entity_resolution_failed: "entity_resolution_failed";
|
|
73
|
+
partial_graph_index: "partial_graph_index";
|
|
74
|
+
graph_traversal_limited: "graph_traversal_limited";
|
|
75
|
+
no_answer_model: "no_answer_model";
|
|
76
|
+
answer_failed: "answer_failed";
|
|
77
|
+
answer_verification_failed: "answer_verification_failed";
|
|
78
|
+
answer_truncated: "answer_truncated";
|
|
79
|
+
}>>>;
|
|
80
|
+
note: z.ZodOptional<z.ZodString>;
|
|
81
|
+
results: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
82
|
+
slug: z.ZodString;
|
|
83
|
+
title: z.ZodString;
|
|
84
|
+
role: z.ZodEnum<{
|
|
85
|
+
knowledge: "knowledge";
|
|
86
|
+
source: "source";
|
|
87
|
+
inference: "inference";
|
|
88
|
+
ignored: "ignored";
|
|
89
|
+
}>;
|
|
90
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
91
|
+
breadcrumb: z.ZodOptional<z.ZodString>;
|
|
92
|
+
updated: z.ZodOptional<z.ZodString>;
|
|
93
|
+
score: z.ZodNumber;
|
|
94
|
+
relevance: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
96
|
+
n: z.ZodNumber;
|
|
97
|
+
text: z.ZodString;
|
|
98
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
superseded: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
102
|
+
claim: z.ZodString;
|
|
103
|
+
valid_to: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
links: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
|
+
documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
rel_path: z.ZodOptional<z.ZodString>;
|
|
109
|
+
mime: z.ZodOptional<z.ZodString>;
|
|
110
|
+
label: z.ZodOptional<z.ZodString>;
|
|
111
|
+
pages: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
parts: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
matched_page: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
115
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
116
|
+
availability: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
status: z.ZodEnum<{
|
|
118
|
+
degraded: "degraded";
|
|
119
|
+
unavailable: "unavailable";
|
|
120
|
+
available: "available";
|
|
121
|
+
}>;
|
|
122
|
+
available_from: z.ZodArray<z.ZodEnum<{
|
|
123
|
+
original: "original";
|
|
124
|
+
indexed_text: "indexed_text";
|
|
125
|
+
rendition: "rendition";
|
|
126
|
+
}>>;
|
|
127
|
+
missing_originals: z.ZodArray<z.ZodString>;
|
|
128
|
+
available_renditions: z.ZodArray<z.ZodString>;
|
|
129
|
+
missing_since: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
}, z.core.$strip>>>;
|
|
132
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
matched_by: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
134
|
+
lexical: "lexical";
|
|
135
|
+
vector: "vector";
|
|
136
|
+
graph: "graph";
|
|
137
|
+
}>>>;
|
|
138
|
+
graph_paths: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
139
|
+
seed: z.ZodObject<{
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
kind: z.ZodEnum<{
|
|
142
|
+
fact: "fact";
|
|
143
|
+
entity: "entity";
|
|
144
|
+
page: "page";
|
|
145
|
+
document: "document";
|
|
146
|
+
event: "event";
|
|
147
|
+
}>;
|
|
148
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
149
|
+
label: z.ZodOptional<z.ZodString>;
|
|
150
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
knowledge: "knowledge";
|
|
152
|
+
source: "source";
|
|
153
|
+
inference: "inference";
|
|
154
|
+
ignored: "ignored";
|
|
155
|
+
}>>;
|
|
156
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
157
|
+
entity_type: z.ZodOptional<z.ZodEnum<{
|
|
158
|
+
event: "event";
|
|
159
|
+
person: "person";
|
|
160
|
+
organization: "organization";
|
|
161
|
+
place: "place";
|
|
162
|
+
product: "product";
|
|
163
|
+
concept: "concept";
|
|
164
|
+
other: "other";
|
|
165
|
+
}>>;
|
|
166
|
+
document: z.ZodOptional<z.ZodString>;
|
|
167
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
168
|
+
event: z.ZodOptional<z.ZodString>;
|
|
169
|
+
date: z.ZodOptional<z.ZodString>;
|
|
170
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
degraded: "degraded";
|
|
174
|
+
unavailable: "unavailable";
|
|
175
|
+
available: "available";
|
|
176
|
+
}>>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
target: z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
kind: z.ZodEnum<{
|
|
181
|
+
fact: "fact";
|
|
182
|
+
entity: "entity";
|
|
183
|
+
page: "page";
|
|
184
|
+
document: "document";
|
|
185
|
+
event: "event";
|
|
186
|
+
}>;
|
|
187
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
188
|
+
label: z.ZodOptional<z.ZodString>;
|
|
189
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
190
|
+
knowledge: "knowledge";
|
|
191
|
+
source: "source";
|
|
192
|
+
inference: "inference";
|
|
193
|
+
ignored: "ignored";
|
|
194
|
+
}>>;
|
|
195
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
196
|
+
entity_type: z.ZodOptional<z.ZodEnum<{
|
|
197
|
+
event: "event";
|
|
198
|
+
person: "person";
|
|
199
|
+
organization: "organization";
|
|
200
|
+
place: "place";
|
|
201
|
+
product: "product";
|
|
202
|
+
concept: "concept";
|
|
203
|
+
other: "other";
|
|
204
|
+
}>>;
|
|
205
|
+
document: z.ZodOptional<z.ZodString>;
|
|
206
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
207
|
+
event: z.ZodOptional<z.ZodString>;
|
|
208
|
+
date: z.ZodOptional<z.ZodString>;
|
|
209
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
212
|
+
degraded: "degraded";
|
|
213
|
+
unavailable: "unavailable";
|
|
214
|
+
available: "available";
|
|
215
|
+
}>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
218
|
+
id: z.ZodString;
|
|
219
|
+
kind: z.ZodEnum<{
|
|
220
|
+
fact: "fact";
|
|
221
|
+
entity: "entity";
|
|
222
|
+
page: "page";
|
|
223
|
+
document: "document";
|
|
224
|
+
event: "event";
|
|
225
|
+
}>;
|
|
226
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
227
|
+
label: z.ZodOptional<z.ZodString>;
|
|
228
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
229
|
+
knowledge: "knowledge";
|
|
230
|
+
source: "source";
|
|
231
|
+
inference: "inference";
|
|
232
|
+
ignored: "ignored";
|
|
233
|
+
}>>;
|
|
234
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
235
|
+
entity_type: z.ZodOptional<z.ZodEnum<{
|
|
236
|
+
event: "event";
|
|
237
|
+
person: "person";
|
|
238
|
+
organization: "organization";
|
|
239
|
+
place: "place";
|
|
240
|
+
product: "product";
|
|
241
|
+
concept: "concept";
|
|
242
|
+
other: "other";
|
|
243
|
+
}>>;
|
|
244
|
+
document: z.ZodOptional<z.ZodString>;
|
|
245
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
246
|
+
event: z.ZodOptional<z.ZodString>;
|
|
247
|
+
date: z.ZodOptional<z.ZodString>;
|
|
248
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
251
|
+
degraded: "degraded";
|
|
252
|
+
unavailable: "unavailable";
|
|
253
|
+
available: "available";
|
|
254
|
+
}>>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
relations: z.ZodArray<z.ZodEnum<{
|
|
257
|
+
canonical_record: "canonical_record";
|
|
258
|
+
links_to: "links_to";
|
|
259
|
+
mentions: "mentions";
|
|
260
|
+
about: "about";
|
|
261
|
+
has_attribute: "has_attribute";
|
|
262
|
+
related_entity: "related_entity";
|
|
263
|
+
owns_document: "owns_document";
|
|
264
|
+
participates_in: "participates_in";
|
|
265
|
+
}>>;
|
|
266
|
+
hops: z.ZodNumber;
|
|
267
|
+
confidence: z.ZodNumber;
|
|
268
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
269
|
+
kind: z.ZodEnum<{
|
|
270
|
+
document: "document";
|
|
271
|
+
page_line: "page_line";
|
|
272
|
+
fact_line: "fact_line";
|
|
273
|
+
frontmatter: "frontmatter";
|
|
274
|
+
}>;
|
|
275
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
276
|
+
document: z.ZodOptional<z.ZodString>;
|
|
277
|
+
event: z.ZodOptional<z.ZodString>;
|
|
278
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
279
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
field: z.ZodOptional<z.ZodString>;
|
|
282
|
+
}, z.core.$strip>>;
|
|
283
|
+
}, z.core.$strip>>>;
|
|
284
|
+
type: z.ZodLiteral<"page">;
|
|
285
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"document">;
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
path: z.ZodString;
|
|
289
|
+
label: z.ZodString;
|
|
290
|
+
mime: z.ZodNullable<z.ZodString>;
|
|
291
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
292
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
293
|
+
matched_page: z.ZodOptional<z.ZodNumber>;
|
|
294
|
+
parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
295
|
+
id: z.ZodString;
|
|
296
|
+
path: z.ZodString;
|
|
297
|
+
pages: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
298
|
+
}, z.core.$strip>>>;
|
|
299
|
+
source: z.ZodObject<{
|
|
300
|
+
kind: z.ZodEnum<{
|
|
301
|
+
none: "none";
|
|
302
|
+
original_text: "original_text";
|
|
303
|
+
ocr_text: "ocr_text";
|
|
304
|
+
model_description: "model_description";
|
|
305
|
+
}>;
|
|
306
|
+
via: z.ZodEnum<{
|
|
307
|
+
none: "none";
|
|
308
|
+
plain: "plain";
|
|
309
|
+
textutil: "textutil";
|
|
310
|
+
"text-layer": "text-layer";
|
|
311
|
+
ocr: "ocr";
|
|
312
|
+
vision: "vision";
|
|
313
|
+
}>;
|
|
314
|
+
confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
availability: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
status: z.ZodEnum<{
|
|
318
|
+
degraded: "degraded";
|
|
319
|
+
unavailable: "unavailable";
|
|
320
|
+
available: "available";
|
|
321
|
+
}>;
|
|
322
|
+
available_from: z.ZodArray<z.ZodEnum<{
|
|
323
|
+
original: "original";
|
|
324
|
+
indexed_text: "indexed_text";
|
|
325
|
+
rendition: "rendition";
|
|
326
|
+
}>>;
|
|
327
|
+
missing_originals: z.ZodArray<z.ZodString>;
|
|
328
|
+
available_renditions: z.ZodArray<z.ZodString>;
|
|
329
|
+
missing_since: z.ZodOptional<z.ZodString>;
|
|
330
|
+
}, z.core.$strip>>;
|
|
331
|
+
ownership: z.ZodObject<{
|
|
332
|
+
status: z.ZodLiteral<"orphan">;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
suggested_actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
335
|
+
op: z.ZodLiteral<"adopt">;
|
|
336
|
+
args: z.ZodObject<{
|
|
337
|
+
documentId: z.ZodString;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
}, z.core.$strip>>>;
|
|
340
|
+
score: z.ZodNumber;
|
|
341
|
+
relevance: z.ZodOptional<z.ZodNumber>;
|
|
342
|
+
matched_by: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
343
|
+
lexical: "lexical";
|
|
344
|
+
vector: "vector";
|
|
345
|
+
graph: "graph";
|
|
346
|
+
}>>>;
|
|
347
|
+
graph_paths: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
348
|
+
seed: z.ZodObject<{
|
|
349
|
+
id: z.ZodString;
|
|
350
|
+
kind: z.ZodEnum<{
|
|
351
|
+
fact: "fact";
|
|
352
|
+
entity: "entity";
|
|
353
|
+
page: "page";
|
|
354
|
+
document: "document";
|
|
355
|
+
event: "event";
|
|
356
|
+
}>;
|
|
357
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
358
|
+
label: z.ZodOptional<z.ZodString>;
|
|
359
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
360
|
+
knowledge: "knowledge";
|
|
361
|
+
source: "source";
|
|
362
|
+
inference: "inference";
|
|
363
|
+
ignored: "ignored";
|
|
364
|
+
}>>;
|
|
365
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
366
|
+
entity_type: z.ZodOptional<z.ZodEnum<{
|
|
367
|
+
event: "event";
|
|
368
|
+
person: "person";
|
|
369
|
+
organization: "organization";
|
|
370
|
+
place: "place";
|
|
371
|
+
product: "product";
|
|
372
|
+
concept: "concept";
|
|
373
|
+
other: "other";
|
|
374
|
+
}>>;
|
|
375
|
+
document: z.ZodOptional<z.ZodString>;
|
|
376
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
377
|
+
event: z.ZodOptional<z.ZodString>;
|
|
378
|
+
date: z.ZodOptional<z.ZodString>;
|
|
379
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
382
|
+
degraded: "degraded";
|
|
383
|
+
unavailable: "unavailable";
|
|
384
|
+
available: "available";
|
|
385
|
+
}>>;
|
|
386
|
+
}, z.core.$strip>;
|
|
387
|
+
target: z.ZodObject<{
|
|
388
|
+
id: z.ZodString;
|
|
389
|
+
kind: z.ZodEnum<{
|
|
390
|
+
fact: "fact";
|
|
391
|
+
entity: "entity";
|
|
392
|
+
page: "page";
|
|
393
|
+
document: "document";
|
|
394
|
+
event: "event";
|
|
395
|
+
}>;
|
|
396
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
397
|
+
label: z.ZodOptional<z.ZodString>;
|
|
398
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
399
|
+
knowledge: "knowledge";
|
|
400
|
+
source: "source";
|
|
401
|
+
inference: "inference";
|
|
402
|
+
ignored: "ignored";
|
|
403
|
+
}>>;
|
|
404
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
405
|
+
entity_type: z.ZodOptional<z.ZodEnum<{
|
|
406
|
+
event: "event";
|
|
407
|
+
person: "person";
|
|
408
|
+
organization: "organization";
|
|
409
|
+
place: "place";
|
|
410
|
+
product: "product";
|
|
411
|
+
concept: "concept";
|
|
412
|
+
other: "other";
|
|
413
|
+
}>>;
|
|
414
|
+
document: z.ZodOptional<z.ZodString>;
|
|
415
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
416
|
+
event: z.ZodOptional<z.ZodString>;
|
|
417
|
+
date: z.ZodOptional<z.ZodString>;
|
|
418
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
419
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
420
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
421
|
+
degraded: "degraded";
|
|
422
|
+
unavailable: "unavailable";
|
|
423
|
+
available: "available";
|
|
424
|
+
}>>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
427
|
+
id: z.ZodString;
|
|
428
|
+
kind: z.ZodEnum<{
|
|
429
|
+
fact: "fact";
|
|
430
|
+
entity: "entity";
|
|
431
|
+
page: "page";
|
|
432
|
+
document: "document";
|
|
433
|
+
event: "event";
|
|
434
|
+
}>;
|
|
435
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
436
|
+
label: z.ZodOptional<z.ZodString>;
|
|
437
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
438
|
+
knowledge: "knowledge";
|
|
439
|
+
source: "source";
|
|
440
|
+
inference: "inference";
|
|
441
|
+
ignored: "ignored";
|
|
442
|
+
}>>;
|
|
443
|
+
entity: z.ZodOptional<z.ZodString>;
|
|
444
|
+
entity_type: z.ZodOptional<z.ZodEnum<{
|
|
445
|
+
event: "event";
|
|
446
|
+
person: "person";
|
|
447
|
+
organization: "organization";
|
|
448
|
+
place: "place";
|
|
449
|
+
product: "product";
|
|
450
|
+
concept: "concept";
|
|
451
|
+
other: "other";
|
|
452
|
+
}>>;
|
|
453
|
+
document: z.ZodOptional<z.ZodString>;
|
|
454
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
455
|
+
event: z.ZodOptional<z.ZodString>;
|
|
456
|
+
date: z.ZodOptional<z.ZodString>;
|
|
457
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
458
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
460
|
+
degraded: "degraded";
|
|
461
|
+
unavailable: "unavailable";
|
|
462
|
+
available: "available";
|
|
463
|
+
}>>;
|
|
464
|
+
}, z.core.$strip>>;
|
|
465
|
+
relations: z.ZodArray<z.ZodEnum<{
|
|
466
|
+
canonical_record: "canonical_record";
|
|
467
|
+
links_to: "links_to";
|
|
468
|
+
mentions: "mentions";
|
|
469
|
+
about: "about";
|
|
470
|
+
has_attribute: "has_attribute";
|
|
471
|
+
related_entity: "related_entity";
|
|
472
|
+
owns_document: "owns_document";
|
|
473
|
+
participates_in: "participates_in";
|
|
474
|
+
}>>;
|
|
475
|
+
hops: z.ZodNumber;
|
|
476
|
+
confidence: z.ZodNumber;
|
|
477
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
478
|
+
kind: z.ZodEnum<{
|
|
479
|
+
document: "document";
|
|
480
|
+
page_line: "page_line";
|
|
481
|
+
fact_line: "fact_line";
|
|
482
|
+
frontmatter: "frontmatter";
|
|
483
|
+
}>;
|
|
484
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
485
|
+
document: z.ZodOptional<z.ZodString>;
|
|
486
|
+
event: z.ZodOptional<z.ZodString>;
|
|
487
|
+
fact: z.ZodOptional<z.ZodString>;
|
|
488
|
+
line_start: z.ZodOptional<z.ZodNumber>;
|
|
489
|
+
line_end: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
field: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strip>>;
|
|
492
|
+
}, z.core.$strip>>>;
|
|
493
|
+
}, z.core.$strip>], "type">>;
|
|
494
|
+
searched: z.ZodArray<z.ZodString>;
|
|
495
|
+
budget_used: z.ZodNumber;
|
|
496
|
+
scores: z.ZodEnum<{
|
|
497
|
+
absolute: "absolute";
|
|
498
|
+
relative: "relative";
|
|
499
|
+
}>;
|
|
500
|
+
qualification: z.ZodOptional<z.ZodObject<{
|
|
501
|
+
model: z.ZodEnum<{
|
|
502
|
+
llm: "llm";
|
|
503
|
+
native: "native";
|
|
504
|
+
}>;
|
|
505
|
+
model_id: z.ZodOptional<z.ZodString>;
|
|
506
|
+
latency_ms: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
input_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
508
|
+
output_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
509
|
+
total_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
510
|
+
applied: z.ZodBoolean;
|
|
511
|
+
judged: z.ZodNumber;
|
|
512
|
+
rejected: z.ZodNumber;
|
|
513
|
+
unjudged: z.ZodNumber;
|
|
514
|
+
basis: z.ZodEnum<{
|
|
515
|
+
llm_grade: "llm_grade";
|
|
516
|
+
native_auto: "native_auto";
|
|
517
|
+
native_manual: "native_manual";
|
|
518
|
+
disabled: "disabled";
|
|
519
|
+
calibration_failed: "calibration_failed";
|
|
520
|
+
}>;
|
|
521
|
+
threshold: z.ZodNullable<z.ZodNumber>;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
coverage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
524
|
+
mode: z.ZodEnum<{
|
|
525
|
+
lookup: "lookup";
|
|
526
|
+
question: "question";
|
|
527
|
+
explore: "explore";
|
|
528
|
+
}>;
|
|
529
|
+
}, z.core.$strip>;
|
|
530
|
+
export type RecallOutput = z.infer<typeof RecallOutput>;
|
|
531
|
+
//# sourceMappingURL=recall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recall.d.ts","sourceRoot":"","sources":["../../src/ops/recall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DatePrefix, Depth, PageRole, RecallMode, RecallQualification, RecallResult, ResultEnvelope, SlugFilter, } from "../common.js";
|
|
3
|
+
export const RecallInput = z.object({
|
|
4
|
+
query: z.string().min(1),
|
|
5
|
+
/** Inferred from the query when absent. Passing it explicitly always wins, and
|
|
6
|
+
* getting it wrong costs relevance, never correctness. */
|
|
7
|
+
mode: RecallMode.optional(),
|
|
8
|
+
depth: Depth.optional(),
|
|
9
|
+
limit: z.number().int().positive().max(100).optional(),
|
|
10
|
+
/** Token budget for the assembled response. Whole cards are filled first. */
|
|
11
|
+
budget: z.number().int().positive().optional(),
|
|
12
|
+
/** `source` pages compete for relevance on equal terms and come back capped.
|
|
13
|
+
* Passing `include: ['source']` with `depth: 'full'` overrides the cap —
|
|
14
|
+
* role is a relevance policy, not access control. */
|
|
15
|
+
include: z.array(PageRole).optional(),
|
|
16
|
+
/**
|
|
17
|
+
* Skip query expansion for this call. Worth it when the query is already the text
|
|
18
|
+
* you want to match — routing a document by its own summary, say — where a model
|
|
19
|
+
* rewriting it costs a round trip and buys nothing.
|
|
20
|
+
*/
|
|
21
|
+
expand: z.boolean().optional(),
|
|
22
|
+
/** Add exact, bounded evidence-graph candidates before ordinary reranking. */
|
|
23
|
+
graph: z.boolean().optional(),
|
|
24
|
+
/** Run the configured reranker and relevance qualifier. Defaults to true for recall. */
|
|
25
|
+
rerank: z.boolean().optional(),
|
|
26
|
+
filter: SlugFilter.optional(),
|
|
27
|
+
since: DatePrefix.optional(),
|
|
28
|
+
until: DatePrefix.optional(),
|
|
29
|
+
});
|
|
30
|
+
export const RecallOutput = ResultEnvelope.extend({
|
|
31
|
+
/** Authoritative mixed page/document results. Use `type` to select the variant. */
|
|
32
|
+
results: z.array(RecallResult),
|
|
33
|
+
/** Every query actually issued, including expansions. On `empty` this is the
|
|
34
|
+
* proof — an agent can say "not recorded" because the layer showed its work. */
|
|
35
|
+
searched: z.array(z.string()),
|
|
36
|
+
budget_used: z.number().int().nonnegative(),
|
|
37
|
+
/**
|
|
38
|
+
* Whether `score` means anything on its own.
|
|
39
|
+
*
|
|
40
|
+
* `absolute` — a cross-encoder or the embedding arm supplied a real 0..1 relevance,
|
|
41
|
+
* and `relevance` is set on every card. Safe to threshold.
|
|
42
|
+
* `relative` — scores only order this result set. The top hit is 1.0 whether it is
|
|
43
|
+
* a perfect match or the least bad of a bad batch, so thresholding it is a mistake:
|
|
44
|
+
* every query appears to succeed.
|
|
45
|
+
*/
|
|
46
|
+
scores: z.enum(['absolute', 'relative']),
|
|
47
|
+
/** Present when a reranker judged candidates, including when filtering was disabled or unavailable. */
|
|
48
|
+
qualification: RecallQualification.optional(),
|
|
49
|
+
/**
|
|
50
|
+
* `question` mode only. Which concepts from the question the results
|
|
51
|
+
* actually cover. Deterministic — did the key terms appear in what came back —
|
|
52
|
+
* not a model judging whether the answer is there. Closes the most common
|
|
53
|
+
* hallucination path: a page ranks first because it matches half the question,
|
|
54
|
+
* and the agent invents the other half.
|
|
55
|
+
*/
|
|
56
|
+
coverage: z.record(z.string(), z.boolean()).optional(),
|
|
57
|
+
mode: RecallMode,
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=recall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recall.js","sourceRoot":"","sources":["../../src/ops/recall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,UAAU,EACV,KAAK,EACL,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB;+DAC2D;IAC3D,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,6EAA6E;IAC7E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C;;0DAEsD;IACtD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE;IACrC;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,8EAA8E;IAC9E,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,wFAAwF;IACxF,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,UAAU,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC,MAAM,CAAC;IAChD,mFAAmF;IACnF,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;IAC9B;qFACiF;IACjF,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC3C;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACxC,uGAAuG;IACvG,aAAa,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IAC7C;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtD,IAAI,EAAE,UAAU;CACjB,CAAC,CAAC"}
|