@geotechcli/core 0.4.44 → 0.4.46

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 (47) hide show
  1. package/dist/agents/brain.d.ts.map +1 -1
  2. package/dist/agents/brain.js +9 -5
  3. package/dist/agents/brain.js.map +1 -1
  4. package/dist/agents/data-tools.js +44 -5
  5. package/dist/agents/data-tools.js.map +1 -1
  6. package/dist/agents/orchestrator.d.ts.map +1 -1
  7. package/dist/agents/orchestrator.js +25 -12
  8. package/dist/agents/orchestrator.js.map +1 -1
  9. package/dist/agents/provider-operating-contract.d.ts +20 -0
  10. package/dist/agents/provider-operating-contract.d.ts.map +1 -0
  11. package/dist/agents/provider-operating-contract.js +146 -0
  12. package/dist/agents/provider-operating-contract.js.map +1 -0
  13. package/dist/agents/safety.d.ts +1 -0
  14. package/dist/agents/safety.d.ts.map +1 -1
  15. package/dist/agents/safety.js +26 -0
  16. package/dist/agents/safety.js.map +1 -1
  17. package/dist/agents/swarm.d.ts.map +1 -1
  18. package/dist/agents/swarm.js +22 -11
  19. package/dist/agents/swarm.js.map +1 -1
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +1 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/ingest/document-evidence-packet.d.ts +814 -0
  25. package/dist/ingest/document-evidence-packet.d.ts.map +1 -0
  26. package/dist/ingest/document-evidence-packet.js +727 -0
  27. package/dist/ingest/document-evidence-packet.js.map +1 -0
  28. package/dist/ingest/geotech-document-benchmark.d.ts +15 -0
  29. package/dist/ingest/geotech-document-benchmark.d.ts.map +1 -1
  30. package/dist/ingest/geotech-document-benchmark.js +18 -0
  31. package/dist/ingest/geotech-document-benchmark.js.map +1 -1
  32. package/dist/ingest/geotech-document.d.ts +2 -0
  33. package/dist/ingest/geotech-document.d.ts.map +1 -1
  34. package/dist/ingest/geotech-document.js +12 -107
  35. package/dist/ingest/geotech-document.js.map +1 -1
  36. package/dist/ingest/index.d.ts +1 -0
  37. package/dist/ingest/index.d.ts.map +1 -1
  38. package/dist/ingest/index.js +1 -0
  39. package/dist/ingest/index.js.map +1 -1
  40. package/dist/ingest/job-worker.d.ts.map +1 -1
  41. package/dist/ingest/job-worker.js +4 -2
  42. package/dist/ingest/job-worker.js.map +1 -1
  43. package/dist/llm/capabilities.d.ts.map +1 -1
  44. package/dist/llm/capabilities.js +42 -0
  45. package/dist/llm/capabilities.js.map +1 -1
  46. package/dist/meta/metadata.json +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,814 @@
1
+ import { z } from 'zod';
2
+ import type { GeotechDocumentIngestResult } from './geotech-document.js';
3
+ export declare const DOCUMENT_EVIDENCE_PACKET_SCHEMA_VERSION = 2;
4
+ export declare const DocumentEvidenceMethodSchema: z.ZodEnum<["native-pdf-text", "layout-ocr", "visual-reasoning", "hybrid", "none"]>;
5
+ export declare const DocumentEvidenceReviewStatusSchema: z.ZodEnum<["verified", "needs_review", "missing", "uncertain"]>;
6
+ export declare const DocumentEvidenceObservationTypeSchema: z.ZodEnum<["material", "classification", "parameter"]>;
7
+ export declare const DocumentEvidencePacketSchema: z.ZodObject<{
8
+ kind: z.ZodLiteral<"document-evidence-packet">;
9
+ schemaVersion: z.ZodLiteral<2>;
10
+ generatedAt: z.ZodString;
11
+ providerContract: z.ZodObject<{
12
+ providerNeutral: z.ZodLiteral<true>;
13
+ purpose: z.ZodLiteral<"byok-document-understanding">;
14
+ normalizedMethods: z.ZodArray<z.ZodEnum<["native-pdf-text", "layout-ocr", "visual-reasoning", "hybrid", "none"]>, "many">;
15
+ reviewGates: z.ZodArray<z.ZodString, "many">;
16
+ }, "strip", z.ZodTypeAny, {
17
+ providerNeutral: true;
18
+ purpose: "byok-document-understanding";
19
+ normalizedMethods: ("none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid")[];
20
+ reviewGates: string[];
21
+ }, {
22
+ providerNeutral: true;
23
+ purpose: "byok-document-understanding";
24
+ normalizedMethods: ("none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid")[];
25
+ reviewGates: string[];
26
+ }>;
27
+ source: z.ZodObject<{
28
+ fileName: z.ZodOptional<z.ZodString>;
29
+ filePath: z.ZodOptional<z.ZodString>;
30
+ inputKind: z.ZodEnum<["image", "pdf"]>;
31
+ pageRange: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
32
+ totalPages: z.ZodNumber;
33
+ successfulPages: z.ZodNumber;
34
+ failedPages: z.ZodNumber;
35
+ }, "strip", z.ZodTypeAny, {
36
+ totalPages: number;
37
+ successfulPages: number;
38
+ failedPages: number;
39
+ inputKind: "image" | "pdf";
40
+ fileName?: string | undefined;
41
+ filePath?: string | undefined;
42
+ pageRange?: [number, number] | undefined;
43
+ }, {
44
+ totalPages: number;
45
+ successfulPages: number;
46
+ failedPages: number;
47
+ inputKind: "image" | "pdf";
48
+ fileName?: string | undefined;
49
+ filePath?: string | undefined;
50
+ pageRange?: [number, number] | undefined;
51
+ }>;
52
+ document: z.ZodObject<{
53
+ title: z.ZodNullable<z.ZodString>;
54
+ documentClass: z.ZodNullable<z.ZodString>;
55
+ parseStatus: z.ZodEnum<["parsed", "partial", "failed"]>;
56
+ confidence: z.ZodNumber;
57
+ reviewRequired: z.ZodBoolean;
58
+ canAutoProceed: z.ZodBoolean;
59
+ }, "strip", z.ZodTypeAny, {
60
+ confidence: number;
61
+ parseStatus: "partial" | "parsed" | "failed";
62
+ canAutoProceed: boolean;
63
+ reviewRequired: boolean;
64
+ documentClass: string | null;
65
+ title: string | null;
66
+ }, {
67
+ confidence: number;
68
+ parseStatus: "partial" | "parsed" | "failed";
69
+ canAutoProceed: boolean;
70
+ reviewRequired: boolean;
71
+ documentClass: string | null;
72
+ title: string | null;
73
+ }>;
74
+ pages: z.ZodArray<z.ZodObject<{
75
+ pageNumber: z.ZodNumber;
76
+ classification: z.ZodNullable<z.ZodString>;
77
+ parseStatus: z.ZodEnum<["parsed", "partial", "failed"]>;
78
+ confidence: z.ZodNumber;
79
+ method: z.ZodEnum<["native-pdf-text", "layout-ocr", "visual-reasoning", "hybrid", "none"]>;
80
+ rawSource: z.ZodString;
81
+ sourceCategory: z.ZodEnum<["native-text", "layout-ocr", "vision", "none"]>;
82
+ cacheStatus: z.ZodEnum<["hit", "miss", "stored", "skipped", "unavailable"]>;
83
+ cacheEntryId: z.ZodOptional<z.ZodString>;
84
+ counts: z.ZodObject<{
85
+ materials: z.ZodNumber;
86
+ classifications: z.ZodNumber;
87
+ parameters: z.ZodNumber;
88
+ }, "strip", z.ZodTypeAny, {
89
+ materials: number;
90
+ classifications: number;
91
+ parameters: number;
92
+ }, {
93
+ materials: number;
94
+ classifications: number;
95
+ parameters: number;
96
+ }>;
97
+ warnings: z.ZodArray<z.ZodString, "many">;
98
+ }, "strip", z.ZodTypeAny, {
99
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
100
+ confidence: number;
101
+ warnings: string[];
102
+ classification: string | null;
103
+ pageNumber: number;
104
+ parseStatus: "partial" | "parsed" | "failed";
105
+ rawSource: string;
106
+ sourceCategory: "vision" | "none" | "native-text" | "layout-ocr";
107
+ cacheStatus: "unavailable" | "hit" | "miss" | "stored" | "skipped";
108
+ counts: {
109
+ materials: number;
110
+ classifications: number;
111
+ parameters: number;
112
+ };
113
+ cacheEntryId?: string | undefined;
114
+ }, {
115
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
116
+ confidence: number;
117
+ warnings: string[];
118
+ classification: string | null;
119
+ pageNumber: number;
120
+ parseStatus: "partial" | "parsed" | "failed";
121
+ rawSource: string;
122
+ sourceCategory: "vision" | "none" | "native-text" | "layout-ocr";
123
+ cacheStatus: "unavailable" | "hit" | "miss" | "stored" | "skipped";
124
+ counts: {
125
+ materials: number;
126
+ classifications: number;
127
+ parameters: number;
128
+ };
129
+ cacheEntryId?: string | undefined;
130
+ }>, "many">;
131
+ observations: z.ZodObject<{
132
+ materials: z.ZodArray<z.ZodObject<{
133
+ id: z.ZodString;
134
+ type: z.ZodEnum<["material", "classification", "parameter"]>;
135
+ label: z.ZodString;
136
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
137
+ numericValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
138
+ unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ material: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ sourcePages: z.ZodArray<z.ZodNumber, "many">;
142
+ method: z.ZodEnum<["native-pdf-text", "layout-ocr", "visual-reasoning", "hybrid", "none"]>;
143
+ confidence: z.ZodNumber;
144
+ reviewStatus: z.ZodEnum<["verified", "needs_review", "missing", "uncertain"]>;
145
+ warnings: z.ZodArray<z.ZodString, "many">;
146
+ }, "strip", z.ZodTypeAny, {
147
+ type: "classification" | "parameter" | "material";
148
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
149
+ value: string | number | boolean | null;
150
+ confidence: number;
151
+ warnings: string[];
152
+ label: string;
153
+ sourcePages: number[];
154
+ id: string;
155
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
156
+ unit?: string | null | undefined;
157
+ context?: string | null | undefined;
158
+ numericValue?: number | null | undefined;
159
+ material?: string | null | undefined;
160
+ }, {
161
+ type: "classification" | "parameter" | "material";
162
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
163
+ value: string | number | boolean | null;
164
+ confidence: number;
165
+ warnings: string[];
166
+ label: string;
167
+ sourcePages: number[];
168
+ id: string;
169
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
170
+ unit?: string | null | undefined;
171
+ context?: string | null | undefined;
172
+ numericValue?: number | null | undefined;
173
+ material?: string | null | undefined;
174
+ }>, "many">;
175
+ classifications: z.ZodArray<z.ZodObject<{
176
+ id: z.ZodString;
177
+ type: z.ZodEnum<["material", "classification", "parameter"]>;
178
+ label: z.ZodString;
179
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
180
+ numericValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
181
+ unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
182
+ material: z.ZodOptional<z.ZodNullable<z.ZodString>>;
183
+ context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
184
+ sourcePages: z.ZodArray<z.ZodNumber, "many">;
185
+ method: z.ZodEnum<["native-pdf-text", "layout-ocr", "visual-reasoning", "hybrid", "none"]>;
186
+ confidence: z.ZodNumber;
187
+ reviewStatus: z.ZodEnum<["verified", "needs_review", "missing", "uncertain"]>;
188
+ warnings: z.ZodArray<z.ZodString, "many">;
189
+ }, "strip", z.ZodTypeAny, {
190
+ type: "classification" | "parameter" | "material";
191
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
192
+ value: string | number | boolean | null;
193
+ confidence: number;
194
+ warnings: string[];
195
+ label: string;
196
+ sourcePages: number[];
197
+ id: string;
198
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
199
+ unit?: string | null | undefined;
200
+ context?: string | null | undefined;
201
+ numericValue?: number | null | undefined;
202
+ material?: string | null | undefined;
203
+ }, {
204
+ type: "classification" | "parameter" | "material";
205
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
206
+ value: string | number | boolean | null;
207
+ confidence: number;
208
+ warnings: string[];
209
+ label: string;
210
+ sourcePages: number[];
211
+ id: string;
212
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
213
+ unit?: string | null | undefined;
214
+ context?: string | null | undefined;
215
+ numericValue?: number | null | undefined;
216
+ material?: string | null | undefined;
217
+ }>, "many">;
218
+ parameters: z.ZodArray<z.ZodObject<{
219
+ id: z.ZodString;
220
+ type: z.ZodEnum<["material", "classification", "parameter"]>;
221
+ label: z.ZodString;
222
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
223
+ numericValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
224
+ unit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ material: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ sourcePages: z.ZodArray<z.ZodNumber, "many">;
228
+ method: z.ZodEnum<["native-pdf-text", "layout-ocr", "visual-reasoning", "hybrid", "none"]>;
229
+ confidence: z.ZodNumber;
230
+ reviewStatus: z.ZodEnum<["verified", "needs_review", "missing", "uncertain"]>;
231
+ warnings: z.ZodArray<z.ZodString, "many">;
232
+ }, "strip", z.ZodTypeAny, {
233
+ type: "classification" | "parameter" | "material";
234
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
235
+ value: string | number | boolean | null;
236
+ confidence: number;
237
+ warnings: string[];
238
+ label: string;
239
+ sourcePages: number[];
240
+ id: string;
241
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
242
+ unit?: string | null | undefined;
243
+ context?: string | null | undefined;
244
+ numericValue?: number | null | undefined;
245
+ material?: string | null | undefined;
246
+ }, {
247
+ type: "classification" | "parameter" | "material";
248
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
249
+ value: string | number | boolean | null;
250
+ confidence: number;
251
+ warnings: string[];
252
+ label: string;
253
+ sourcePages: number[];
254
+ id: string;
255
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
256
+ unit?: string | null | undefined;
257
+ context?: string | null | undefined;
258
+ numericValue?: number | null | undefined;
259
+ material?: string | null | undefined;
260
+ }>, "many">;
261
+ }, "strip", z.ZodTypeAny, {
262
+ materials: {
263
+ type: "classification" | "parameter" | "material";
264
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
265
+ value: string | number | boolean | null;
266
+ confidence: number;
267
+ warnings: string[];
268
+ label: string;
269
+ sourcePages: number[];
270
+ id: string;
271
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
272
+ unit?: string | null | undefined;
273
+ context?: string | null | undefined;
274
+ numericValue?: number | null | undefined;
275
+ material?: string | null | undefined;
276
+ }[];
277
+ classifications: {
278
+ type: "classification" | "parameter" | "material";
279
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
280
+ value: string | number | boolean | null;
281
+ confidence: number;
282
+ warnings: string[];
283
+ label: string;
284
+ sourcePages: number[];
285
+ id: string;
286
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
287
+ unit?: string | null | undefined;
288
+ context?: string | null | undefined;
289
+ numericValue?: number | null | undefined;
290
+ material?: string | null | undefined;
291
+ }[];
292
+ parameters: {
293
+ type: "classification" | "parameter" | "material";
294
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
295
+ value: string | number | boolean | null;
296
+ confidence: number;
297
+ warnings: string[];
298
+ label: string;
299
+ sourcePages: number[];
300
+ id: string;
301
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
302
+ unit?: string | null | undefined;
303
+ context?: string | null | undefined;
304
+ numericValue?: number | null | undefined;
305
+ material?: string | null | undefined;
306
+ }[];
307
+ }, {
308
+ materials: {
309
+ type: "classification" | "parameter" | "material";
310
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
311
+ value: string | number | boolean | null;
312
+ confidence: number;
313
+ warnings: string[];
314
+ label: string;
315
+ sourcePages: number[];
316
+ id: string;
317
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
318
+ unit?: string | null | undefined;
319
+ context?: string | null | undefined;
320
+ numericValue?: number | null | undefined;
321
+ material?: string | null | undefined;
322
+ }[];
323
+ classifications: {
324
+ type: "classification" | "parameter" | "material";
325
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
326
+ value: string | number | boolean | null;
327
+ confidence: number;
328
+ warnings: string[];
329
+ label: string;
330
+ sourcePages: number[];
331
+ id: string;
332
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
333
+ unit?: string | null | undefined;
334
+ context?: string | null | undefined;
335
+ numericValue?: number | null | undefined;
336
+ material?: string | null | undefined;
337
+ }[];
338
+ parameters: {
339
+ type: "classification" | "parameter" | "material";
340
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
341
+ value: string | number | boolean | null;
342
+ confidence: number;
343
+ warnings: string[];
344
+ label: string;
345
+ sourcePages: number[];
346
+ id: string;
347
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
348
+ unit?: string | null | undefined;
349
+ context?: string | null | undefined;
350
+ numericValue?: number | null | undefined;
351
+ material?: string | null | undefined;
352
+ }[];
353
+ }>;
354
+ contentChunks: z.ZodArray<z.ZodObject<{
355
+ chunkId: z.ZodString;
356
+ pageRange: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
357
+ headingAncestry: z.ZodArray<z.ZodString, "many">;
358
+ scope: z.ZodEnum<["page", "table", "figure", "section"]>;
359
+ sectionType: z.ZodOptional<z.ZodString>;
360
+ significance: z.ZodOptional<z.ZodNumber>;
361
+ sourcePages: z.ZodArray<z.ZodNumber, "many">;
362
+ text: z.ZodString;
363
+ }, "strip", z.ZodTypeAny, {
364
+ text: string;
365
+ sourcePages: number[];
366
+ pageRange: [number, number];
367
+ chunkId: string;
368
+ headingAncestry: string[];
369
+ scope: "table" | "page" | "figure" | "section";
370
+ sectionType?: string | undefined;
371
+ significance?: number | undefined;
372
+ }, {
373
+ text: string;
374
+ sourcePages: number[];
375
+ pageRange: [number, number];
376
+ chunkId: string;
377
+ headingAncestry: string[];
378
+ scope: "table" | "page" | "figure" | "section";
379
+ sectionType?: string | undefined;
380
+ significance?: number | undefined;
381
+ }>, "many">;
382
+ engineeringSignals: z.ZodObject<{
383
+ risks: z.ZodArray<z.ZodString, "many">;
384
+ recommendations: z.ZodArray<z.ZodString, "many">;
385
+ }, "strip", z.ZodTypeAny, {
386
+ recommendations: string[];
387
+ risks: string[];
388
+ }, {
389
+ recommendations: string[];
390
+ risks: string[];
391
+ }>;
392
+ synthesis: z.ZodNullable<z.ZodObject<{
393
+ takeaways: z.ZodArray<z.ZodString, "many">;
394
+ groundModel: z.ZodArray<z.ZodString, "many">;
395
+ keyParameters: z.ZodArray<z.ZodString, "many">;
396
+ interpretation: z.ZodArray<z.ZodString, "many">;
397
+ limitations: z.ZodArray<z.ZodString, "many">;
398
+ sourcePages: z.ZodArray<z.ZodNumber, "many">;
399
+ latencyMs: z.ZodOptional<z.ZodNumber>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ interpretation: string[];
402
+ sourcePages: number[];
403
+ takeaways: string[];
404
+ groundModel: string[];
405
+ keyParameters: string[];
406
+ limitations: string[];
407
+ latencyMs?: number | undefined;
408
+ }, {
409
+ interpretation: string[];
410
+ sourcePages: number[];
411
+ takeaways: string[];
412
+ groundModel: string[];
413
+ keyParameters: string[];
414
+ limitations: string[];
415
+ latencyMs?: number | undefined;
416
+ }>>;
417
+ review: z.ZodObject<{
418
+ warnings: z.ZodArray<z.ZodString, "many">;
419
+ reviewReasons: z.ZodArray<z.ZodString, "many">;
420
+ findings: z.ZodArray<z.ZodObject<{
421
+ code: z.ZodString;
422
+ severity: z.ZodEnum<["advisory", "review", "blocking"]>;
423
+ scope: z.ZodEnum<["document", "page", "material"]>;
424
+ message: z.ZodString;
425
+ pageNumber: z.ZodOptional<z.ZodNumber>;
426
+ materialDescription: z.ZodOptional<z.ZodString>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ message: string;
429
+ code: string;
430
+ severity: "advisory" | "review" | "blocking";
431
+ scope: "document" | "page" | "material";
432
+ pageNumber?: number | undefined;
433
+ materialDescription?: string | undefined;
434
+ }, {
435
+ message: string;
436
+ code: string;
437
+ severity: "advisory" | "review" | "blocking";
438
+ scope: "document" | "page" | "material";
439
+ pageNumber?: number | undefined;
440
+ materialDescription?: string | undefined;
441
+ }>, "many">;
442
+ }, "strip", z.ZodTypeAny, {
443
+ warnings: string[];
444
+ reviewReasons: string[];
445
+ findings: {
446
+ message: string;
447
+ code: string;
448
+ severity: "advisory" | "review" | "blocking";
449
+ scope: "document" | "page" | "material";
450
+ pageNumber?: number | undefined;
451
+ materialDescription?: string | undefined;
452
+ }[];
453
+ }, {
454
+ warnings: string[];
455
+ reviewReasons: string[];
456
+ findings: {
457
+ message: string;
458
+ code: string;
459
+ severity: "advisory" | "review" | "blocking";
460
+ scope: "document" | "page" | "material";
461
+ pageNumber?: number | undefined;
462
+ materialDescription?: string | undefined;
463
+ }[];
464
+ }>;
465
+ traceability: z.ZodObject<{
466
+ sourcePages: z.ZodArray<z.ZodNumber, "many">;
467
+ pagesWithEvidence: z.ZodArray<z.ZodNumber, "many">;
468
+ directVisualPages: z.ZodArray<z.ZodNumber, "many">;
469
+ layoutOcrPages: z.ZodArray<z.ZodNumber, "many">;
470
+ nativeTextPages: z.ZodArray<z.ZodNumber, "many">;
471
+ boreholeIds: z.ZodArray<z.ZodString, "many">;
472
+ maxDepthMeters: z.ZodNullable<z.ZodNumber>;
473
+ parametersWithSourcePage: z.ZodNumber;
474
+ parametersWithoutSourcePage: z.ZodNumber;
475
+ parameterTraceabilityRate: z.ZodNumber;
476
+ methodCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ sourcePages: number[];
479
+ pagesWithEvidence: number[];
480
+ directVisualPages: number[];
481
+ layoutOcrPages: number[];
482
+ nativeTextPages: number[];
483
+ boreholeIds: string[];
484
+ maxDepthMeters: number | null;
485
+ parametersWithSourcePage: number;
486
+ parametersWithoutSourcePage: number;
487
+ parameterTraceabilityRate: number;
488
+ methodCounts: Record<string, number>;
489
+ }, {
490
+ sourcePages: number[];
491
+ pagesWithEvidence: number[];
492
+ directVisualPages: number[];
493
+ layoutOcrPages: number[];
494
+ nativeTextPages: number[];
495
+ boreholeIds: string[];
496
+ maxDepthMeters: number | null;
497
+ parametersWithSourcePage: number;
498
+ parametersWithoutSourcePage: number;
499
+ parameterTraceabilityRate: number;
500
+ methodCounts: Record<string, number>;
501
+ }>;
502
+ }, "strip", z.ZodTypeAny, {
503
+ kind: "document-evidence-packet";
504
+ source: {
505
+ totalPages: number;
506
+ successfulPages: number;
507
+ failedPages: number;
508
+ inputKind: "image" | "pdf";
509
+ fileName?: string | undefined;
510
+ filePath?: string | undefined;
511
+ pageRange?: [number, number] | undefined;
512
+ };
513
+ pages: {
514
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
515
+ confidence: number;
516
+ warnings: string[];
517
+ classification: string | null;
518
+ pageNumber: number;
519
+ parseStatus: "partial" | "parsed" | "failed";
520
+ rawSource: string;
521
+ sourceCategory: "vision" | "none" | "native-text" | "layout-ocr";
522
+ cacheStatus: "unavailable" | "hit" | "miss" | "stored" | "skipped";
523
+ counts: {
524
+ materials: number;
525
+ classifications: number;
526
+ parameters: number;
527
+ };
528
+ cacheEntryId?: string | undefined;
529
+ }[];
530
+ review: {
531
+ warnings: string[];
532
+ reviewReasons: string[];
533
+ findings: {
534
+ message: string;
535
+ code: string;
536
+ severity: "advisory" | "review" | "blocking";
537
+ scope: "document" | "page" | "material";
538
+ pageNumber?: number | undefined;
539
+ materialDescription?: string | undefined;
540
+ }[];
541
+ };
542
+ document: {
543
+ confidence: number;
544
+ parseStatus: "partial" | "parsed" | "failed";
545
+ canAutoProceed: boolean;
546
+ reviewRequired: boolean;
547
+ documentClass: string | null;
548
+ title: string | null;
549
+ };
550
+ schemaVersion: 2;
551
+ generatedAt: string;
552
+ providerContract: {
553
+ providerNeutral: true;
554
+ purpose: "byok-document-understanding";
555
+ normalizedMethods: ("none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid")[];
556
+ reviewGates: string[];
557
+ };
558
+ observations: {
559
+ materials: {
560
+ type: "classification" | "parameter" | "material";
561
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
562
+ value: string | number | boolean | null;
563
+ confidence: number;
564
+ warnings: string[];
565
+ label: string;
566
+ sourcePages: number[];
567
+ id: string;
568
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
569
+ unit?: string | null | undefined;
570
+ context?: string | null | undefined;
571
+ numericValue?: number | null | undefined;
572
+ material?: string | null | undefined;
573
+ }[];
574
+ classifications: {
575
+ type: "classification" | "parameter" | "material";
576
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
577
+ value: string | number | boolean | null;
578
+ confidence: number;
579
+ warnings: string[];
580
+ label: string;
581
+ sourcePages: number[];
582
+ id: string;
583
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
584
+ unit?: string | null | undefined;
585
+ context?: string | null | undefined;
586
+ numericValue?: number | null | undefined;
587
+ material?: string | null | undefined;
588
+ }[];
589
+ parameters: {
590
+ type: "classification" | "parameter" | "material";
591
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
592
+ value: string | number | boolean | null;
593
+ confidence: number;
594
+ warnings: string[];
595
+ label: string;
596
+ sourcePages: number[];
597
+ id: string;
598
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
599
+ unit?: string | null | undefined;
600
+ context?: string | null | undefined;
601
+ numericValue?: number | null | undefined;
602
+ material?: string | null | undefined;
603
+ }[];
604
+ };
605
+ contentChunks: {
606
+ text: string;
607
+ sourcePages: number[];
608
+ pageRange: [number, number];
609
+ chunkId: string;
610
+ headingAncestry: string[];
611
+ scope: "table" | "page" | "figure" | "section";
612
+ sectionType?: string | undefined;
613
+ significance?: number | undefined;
614
+ }[];
615
+ engineeringSignals: {
616
+ recommendations: string[];
617
+ risks: string[];
618
+ };
619
+ synthesis: {
620
+ interpretation: string[];
621
+ sourcePages: number[];
622
+ takeaways: string[];
623
+ groundModel: string[];
624
+ keyParameters: string[];
625
+ limitations: string[];
626
+ latencyMs?: number | undefined;
627
+ } | null;
628
+ traceability: {
629
+ sourcePages: number[];
630
+ pagesWithEvidence: number[];
631
+ directVisualPages: number[];
632
+ layoutOcrPages: number[];
633
+ nativeTextPages: number[];
634
+ boreholeIds: string[];
635
+ maxDepthMeters: number | null;
636
+ parametersWithSourcePage: number;
637
+ parametersWithoutSourcePage: number;
638
+ parameterTraceabilityRate: number;
639
+ methodCounts: Record<string, number>;
640
+ };
641
+ }, {
642
+ kind: "document-evidence-packet";
643
+ source: {
644
+ totalPages: number;
645
+ successfulPages: number;
646
+ failedPages: number;
647
+ inputKind: "image" | "pdf";
648
+ fileName?: string | undefined;
649
+ filePath?: string | undefined;
650
+ pageRange?: [number, number] | undefined;
651
+ };
652
+ pages: {
653
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
654
+ confidence: number;
655
+ warnings: string[];
656
+ classification: string | null;
657
+ pageNumber: number;
658
+ parseStatus: "partial" | "parsed" | "failed";
659
+ rawSource: string;
660
+ sourceCategory: "vision" | "none" | "native-text" | "layout-ocr";
661
+ cacheStatus: "unavailable" | "hit" | "miss" | "stored" | "skipped";
662
+ counts: {
663
+ materials: number;
664
+ classifications: number;
665
+ parameters: number;
666
+ };
667
+ cacheEntryId?: string | undefined;
668
+ }[];
669
+ review: {
670
+ warnings: string[];
671
+ reviewReasons: string[];
672
+ findings: {
673
+ message: string;
674
+ code: string;
675
+ severity: "advisory" | "review" | "blocking";
676
+ scope: "document" | "page" | "material";
677
+ pageNumber?: number | undefined;
678
+ materialDescription?: string | undefined;
679
+ }[];
680
+ };
681
+ document: {
682
+ confidence: number;
683
+ parseStatus: "partial" | "parsed" | "failed";
684
+ canAutoProceed: boolean;
685
+ reviewRequired: boolean;
686
+ documentClass: string | null;
687
+ title: string | null;
688
+ };
689
+ schemaVersion: 2;
690
+ generatedAt: string;
691
+ providerContract: {
692
+ providerNeutral: true;
693
+ purpose: "byok-document-understanding";
694
+ normalizedMethods: ("none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid")[];
695
+ reviewGates: string[];
696
+ };
697
+ observations: {
698
+ materials: {
699
+ type: "classification" | "parameter" | "material";
700
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
701
+ value: string | number | boolean | null;
702
+ confidence: number;
703
+ warnings: string[];
704
+ label: string;
705
+ sourcePages: number[];
706
+ id: string;
707
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
708
+ unit?: string | null | undefined;
709
+ context?: string | null | undefined;
710
+ numericValue?: number | null | undefined;
711
+ material?: string | null | undefined;
712
+ }[];
713
+ classifications: {
714
+ type: "classification" | "parameter" | "material";
715
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
716
+ value: string | number | boolean | null;
717
+ confidence: number;
718
+ warnings: string[];
719
+ label: string;
720
+ sourcePages: number[];
721
+ id: string;
722
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
723
+ unit?: string | null | undefined;
724
+ context?: string | null | undefined;
725
+ numericValue?: number | null | undefined;
726
+ material?: string | null | undefined;
727
+ }[];
728
+ parameters: {
729
+ type: "classification" | "parameter" | "material";
730
+ method: "none" | "native-pdf-text" | "layout-ocr" | "visual-reasoning" | "hybrid";
731
+ value: string | number | boolean | null;
732
+ confidence: number;
733
+ warnings: string[];
734
+ label: string;
735
+ sourcePages: number[];
736
+ id: string;
737
+ reviewStatus: "verified" | "needs_review" | "missing" | "uncertain";
738
+ unit?: string | null | undefined;
739
+ context?: string | null | undefined;
740
+ numericValue?: number | null | undefined;
741
+ material?: string | null | undefined;
742
+ }[];
743
+ };
744
+ contentChunks: {
745
+ text: string;
746
+ sourcePages: number[];
747
+ pageRange: [number, number];
748
+ chunkId: string;
749
+ headingAncestry: string[];
750
+ scope: "table" | "page" | "figure" | "section";
751
+ sectionType?: string | undefined;
752
+ significance?: number | undefined;
753
+ }[];
754
+ engineeringSignals: {
755
+ recommendations: string[];
756
+ risks: string[];
757
+ };
758
+ synthesis: {
759
+ interpretation: string[];
760
+ sourcePages: number[];
761
+ takeaways: string[];
762
+ groundModel: string[];
763
+ keyParameters: string[];
764
+ limitations: string[];
765
+ latencyMs?: number | undefined;
766
+ } | null;
767
+ traceability: {
768
+ sourcePages: number[];
769
+ pagesWithEvidence: number[];
770
+ directVisualPages: number[];
771
+ layoutOcrPages: number[];
772
+ nativeTextPages: number[];
773
+ boreholeIds: string[];
774
+ maxDepthMeters: number | null;
775
+ parametersWithSourcePage: number;
776
+ parametersWithoutSourcePage: number;
777
+ parameterTraceabilityRate: number;
778
+ methodCounts: Record<string, number>;
779
+ };
780
+ }>;
781
+ export type DocumentEvidenceMethod = z.infer<typeof DocumentEvidenceMethodSchema>;
782
+ export type DocumentEvidencePacket = z.infer<typeof DocumentEvidencePacketSchema>;
783
+ export type DocumentEvidenceReviewStatus = z.infer<typeof DocumentEvidenceReviewStatusSchema>;
784
+ export interface SummarizeDocumentEvidencePacketForAgentOptions {
785
+ maxObservationsPerGroup?: number;
786
+ maxReviewGates?: number;
787
+ maxContentChars?: number;
788
+ }
789
+ export interface CompileDocumentEvidenceSynthesisPromptOptions {
790
+ maxEvidenceChars?: number;
791
+ maxOutlineChunks?: number;
792
+ maxHighSignalChunks?: number;
793
+ maxParameters?: number;
794
+ maxMaterials?: number;
795
+ maxClassifications?: number;
796
+ }
797
+ export interface CompiledDocumentEvidenceSynthesisPrompt {
798
+ systemPrompt: string;
799
+ prompt: string;
800
+ evidence: string;
801
+ hasEngineeringSignal: boolean;
802
+ sourcePages: number[];
803
+ reviewGates: string[];
804
+ schemaVersion: number;
805
+ }
806
+ export declare function buildDocumentEvidencePacket(result: GeotechDocumentIngestResult): DocumentEvidencePacket;
807
+ export declare function attachDocumentEvidencePacket<T extends GeotechDocumentIngestResult>(result: T): T & {
808
+ evidencePacket: DocumentEvidencePacket;
809
+ };
810
+ export declare function documentEvidencePacketHasEngineeringSignal(packet: DocumentEvidencePacket): boolean;
811
+ export declare function compileDocumentEvidenceSynthesisPrompt(packet: DocumentEvidencePacket, options?: CompileDocumentEvidenceSynthesisPromptOptions): CompiledDocumentEvidenceSynthesisPrompt;
812
+ export declare function summarizeDocumentEvidencePacketForAgent(packet: DocumentEvidencePacket, options?: SummarizeDocumentEvidencePacketForAgentOptions): string;
813
+ export declare function summarizeGeotechDocumentResultForAgent(result: GeotechDocumentIngestResult, options?: SummarizeDocumentEvidencePacketForAgentOptions): string;
814
+ //# sourceMappingURL=document-evidence-packet.d.ts.map