@clinia/context-engine-js 0.5.0-rc.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.
@@ -0,0 +1,1706 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export interface paths {
6
+ "/": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /**
14
+ * Get service info
15
+ * @description Returns the service name and the build identity of the running process. Use it to confirm which build a deployment is serving.
16
+ */
17
+ get: operations["get-service-info"];
18
+ put?: never;
19
+ post?: never;
20
+ delete?: never;
21
+ options?: never;
22
+ head?: never;
23
+ patch?: never;
24
+ trace?: never;
25
+ };
26
+ "/v1/patients": {
27
+ parameters: {
28
+ query?: never;
29
+ header?: never;
30
+ path?: never;
31
+ cookie?: never;
32
+ };
33
+ /**
34
+ * List patients
35
+ * @description Returns all patients currently loaded in the registry. An empty array is returned if no patients have been ingested yet.
36
+ */
37
+ get: operations["list-patients"];
38
+ put?: never;
39
+ post?: never;
40
+ delete?: never;
41
+ options?: never;
42
+ head?: never;
43
+ patch?: never;
44
+ trace?: never;
45
+ };
46
+ "/v1/patients/{patientId}": {
47
+ parameters: {
48
+ query?: never;
49
+ header?: never;
50
+ path?: never;
51
+ cookie?: never;
52
+ };
53
+ /**
54
+ * Get patient
55
+ * @description Returns demographic metadata and pipeline stats for a patient identified by its registry key.
56
+ */
57
+ get: operations["get-patient"];
58
+ /**
59
+ * Upsert patient
60
+ * @description Creates the patient entry if it does not yet exist, or returns the existing record unchanged. Fully idempotent — safe to call before or after the first ingest.
61
+ */
62
+ put: operations["upsert-patient"];
63
+ post?: never;
64
+ /**
65
+ * Delete patient
66
+ * @description Removes a patient and all associated entities, events, and relationships from the registry. Irreversible.
67
+ */
68
+ delete: operations["delete-patient"];
69
+ options?: never;
70
+ head?: never;
71
+ patch?: never;
72
+ trace?: never;
73
+ };
74
+ "/v1/patients/{patientId}/resolution": {
75
+ parameters: {
76
+ query?: never;
77
+ header?: never;
78
+ path?: never;
79
+ cookie?: never;
80
+ };
81
+ /**
82
+ * Get resolution report
83
+ * @description Returns the fact-resolution report for a patient: a paginated list of persisted facts of every fact type with their provenance traces, source contributions, field-level conflict resolutions, and merge confidence scores. Summary counts always cover the full graph, not just the returned page.
84
+ */
85
+ get: operations["get-resolution"];
86
+ put?: never;
87
+ post?: never;
88
+ delete?: never;
89
+ options?: never;
90
+ head?: never;
91
+ patch?: never;
92
+ trace?: never;
93
+ };
94
+ "/v1/patients/{patientId}/reconciliation": {
95
+ parameters: {
96
+ query?: never;
97
+ header?: never;
98
+ path?: never;
99
+ cookie?: never;
100
+ };
101
+ /**
102
+ * Get reconciliation summary
103
+ * @description Returns the post-pipeline reconciliation summary including entity merge stats and inferred relationships. Defaults to Markdown; pass `?format=json` for structured data.
104
+ */
105
+ get: operations["get-reconciliation"];
106
+ put?: never;
107
+ post?: never;
108
+ delete?: never;
109
+ options?: never;
110
+ head?: never;
111
+ patch?: never;
112
+ trace?: never;
113
+ };
114
+ "/v1/patients/{patientId}/ingest/fhir": {
115
+ parameters: {
116
+ query?: never;
117
+ header?: never;
118
+ path?: never;
119
+ cookie?: never;
120
+ };
121
+ get?: never;
122
+ put?: never;
123
+ /**
124
+ * Ingest FHIR R4
125
+ * @description Submits a FHIR R4 Bundle or single resource for ingestion. Returns an `IngestExecutionEnvelope` immediately with status `pending` or `running`. Pass `?wait=<ms>` (max 30 000) to block until the execution reaches a terminal status. Multiple ingest calls for the same registry key accumulate sources; entity resolution re-runs after each call.
126
+ */
127
+ post: operations["ingest-fhir"];
128
+ delete?: never;
129
+ options?: never;
130
+ head?: never;
131
+ patch?: never;
132
+ trace?: never;
133
+ };
134
+ "/v1/patients/{patientId}/ingest/cda": {
135
+ parameters: {
136
+ query?: never;
137
+ header?: never;
138
+ path?: never;
139
+ cookie?: never;
140
+ };
141
+ get?: never;
142
+ put?: never;
143
+ /**
144
+ * Ingest CDA
145
+ * @description Submits a CDA/C-CDA XML document for ingestion. Body must be `text/plain`. Returns an `IngestExecutionEnvelope` immediately; use `?wait=<ms>` to block until terminal status.
146
+ */
147
+ post: operations["ingest-cda"];
148
+ delete?: never;
149
+ options?: never;
150
+ head?: never;
151
+ patch?: never;
152
+ trace?: never;
153
+ };
154
+ "/v1/patients/{patientId}/ingest/document": {
155
+ parameters: {
156
+ query?: never;
157
+ header?: never;
158
+ path?: never;
159
+ cookie?: never;
160
+ };
161
+ get?: never;
162
+ put?: never;
163
+ /**
164
+ * Register unstructured document
165
+ * @description Registers an unstructured document by name and MIME type. Used for documents that cannot be parsed as FHIR or CDA (e.g., PDFs). The document is tracked as an ingest source but does not contribute extracted clinical entities.
166
+ */
167
+ post: operations["ingest-document"];
168
+ delete?: never;
169
+ options?: never;
170
+ head?: never;
171
+ patch?: never;
172
+ trace?: never;
173
+ };
174
+ "/v1/patients/{patientId}/ingest": {
175
+ parameters: {
176
+ query?: never;
177
+ header?: never;
178
+ path?: never;
179
+ cookie?: never;
180
+ };
181
+ get?: never;
182
+ put?: never;
183
+ /**
184
+ * Batch ingest
185
+ * @description Submits FHIR bundles, CDA documents, and unstructured document registrations in a single request. Each source type is processed independently; the graph is rebuilt once after all sources are loaded.
186
+ */
187
+ post: operations["ingest-batch"];
188
+ delete?: never;
189
+ options?: never;
190
+ head?: never;
191
+ patch?: never;
192
+ trace?: never;
193
+ };
194
+ "/v1/patients/{patientId}/ingest/status": {
195
+ parameters: {
196
+ query?: never;
197
+ header?: never;
198
+ path?: never;
199
+ cookie?: never;
200
+ };
201
+ /**
202
+ * Get ingest status
203
+ * @description Returns whether the patient graph is ready to query, per-source extraction stats, aggregate load stats, and extraction warnings that did not halt ingestion. Poll this endpoint after a fire-and-forget ingest call.
204
+ */
205
+ get: operations["get-ingest-status"];
206
+ put?: never;
207
+ post?: never;
208
+ delete?: never;
209
+ options?: never;
210
+ head?: never;
211
+ patch?: never;
212
+ trace?: never;
213
+ };
214
+ "/v1/patients/{patientId}/ingest/executions": {
215
+ parameters: {
216
+ query?: never;
217
+ header?: never;
218
+ path?: never;
219
+ cookie?: never;
220
+ };
221
+ /**
222
+ * List ingest executions
223
+ * @description Returns a cursor-paginated list of ingest executions for a patient, ordered by start time descending. Each item includes status, source type, delta counts, and error code if failed.
224
+ */
225
+ get: operations["list-executions"];
226
+ put?: never;
227
+ post?: never;
228
+ delete?: never;
229
+ options?: never;
230
+ head?: never;
231
+ patch?: never;
232
+ trace?: never;
233
+ };
234
+ "/v1/patients/{patientId}/ingest/executions/{executionId}": {
235
+ parameters: {
236
+ query?: never;
237
+ header?: never;
238
+ path?: never;
239
+ cookie?: never;
240
+ };
241
+ /**
242
+ * Get ingest execution
243
+ * @description Returns full detail for a single ingest execution: stage-level timings, per-entity-type and per-source delta breakdowns, entity merge count, extraction warnings, and error detail if failed.
244
+ */
245
+ get: operations["get-execution"];
246
+ put?: never;
247
+ post?: never;
248
+ delete?: never;
249
+ options?: never;
250
+ head?: never;
251
+ patch?: never;
252
+ trace?: never;
253
+ };
254
+ "/v1/patients/{patientId}/sessions": {
255
+ parameters: {
256
+ query?: never;
257
+ header?: never;
258
+ path?: never;
259
+ cookie?: never;
260
+ };
261
+ get?: never;
262
+ put?: never;
263
+ /**
264
+ * Create session
265
+ * @description Opens a new query session scoped to a patient. Sessions track interaction context across multiple MCP tool calls within a single agent run.
266
+ */
267
+ post: operations["create-session"];
268
+ delete?: never;
269
+ options?: never;
270
+ head?: never;
271
+ patch?: never;
272
+ trace?: never;
273
+ };
274
+ "/v1/patients/{patientId}/sessions/{sessionId}": {
275
+ parameters: {
276
+ query?: never;
277
+ header?: never;
278
+ path?: never;
279
+ cookie?: never;
280
+ };
281
+ /**
282
+ * Get session
283
+ * @description Returns metadata for a session.
284
+ */
285
+ get: operations["get-session"];
286
+ /**
287
+ * Upsert a session
288
+ * @description Idempotently opens a session under a caller-provided id: creates it if new, or returns the existing session unchanged. Sessions track interaction context across multiple MCP tool calls within a single agent run.
289
+ */
290
+ put: operations["upsert-session"];
291
+ post?: never;
292
+ delete?: never;
293
+ options?: never;
294
+ head?: never;
295
+ patch?: never;
296
+ trace?: never;
297
+ };
298
+ "/v1/patients/{patientId}/sessions/{sessionId}/messages": {
299
+ parameters: {
300
+ query?: never;
301
+ header?: never;
302
+ path?: never;
303
+ cookie?: never;
304
+ };
305
+ get?: never;
306
+ put?: never;
307
+ /**
308
+ * Append session messages
309
+ * @description Appends user/assistant messages to an open session's transcript, in order. The session stays open. Tool-call turns are recorded separately by the MCP layer and are not accepted here.
310
+ */
311
+ post: operations["append-messages"];
312
+ delete?: never;
313
+ options?: never;
314
+ head?: never;
315
+ patch?: never;
316
+ trace?: never;
317
+ };
318
+ "/v1/patients/{patientId}/sessions/{sessionId}/memories": {
319
+ parameters: {
320
+ query?: never;
321
+ header?: never;
322
+ path?: never;
323
+ cookie?: never;
324
+ };
325
+ /**
326
+ * List session memories
327
+ * @description Returns the memories extracted from this session, paginated. Sorted by `createdAt` descending (newest first) by default.
328
+ */
329
+ get: operations["list-session-memories"];
330
+ put?: never;
331
+ /**
332
+ * Generate session memories
333
+ * @description Extracts memories from messages appended since the last run and infers memory↔fact relationships. The session stays active and can keep receiving messages. Append-only: it never re-extracts messages already covered by a prior run, so re-running it only adds memories for what's new, but it does not deduplicate against memories from a previous run. Call it intentionally rather than on every turn.
334
+ */
335
+ post: operations["generate-memories"];
336
+ delete?: never;
337
+ options?: never;
338
+ head?: never;
339
+ patch?: never;
340
+ trace?: never;
341
+ };
342
+ "/v1/patients/{patientId}/sessions/ingest": {
343
+ parameters: {
344
+ query?: never;
345
+ header?: never;
346
+ path?: never;
347
+ cookie?: never;
348
+ };
349
+ get?: never;
350
+ put?: never;
351
+ /**
352
+ * Ingest a session transcript
353
+ * @description Replays a complete chat transcript as one session: creates the session, appends every message in order, then generates memories from it synchronously, so the response returns only after the patient's memories reflect the conversation. Messages can still be appended to the session. Intended for batch/replay use, not interactive sessions.
354
+ */
355
+ post: operations["ingest-session"];
356
+ delete?: never;
357
+ options?: never;
358
+ head?: never;
359
+ patch?: never;
360
+ trace?: never;
361
+ };
362
+ "/v1/patients/{patientId}/vfs": {
363
+ parameters: {
364
+ query?: never;
365
+ header?: never;
366
+ path?: never;
367
+ cookie?: never;
368
+ };
369
+ /**
370
+ * Browse VFS
371
+ * @description Lists the contents of a VFS path. Returns directory children with name, type, and preview, or file content when the path resolves to a file. Paths are relative to the patient root (e.g. `/conditions/active`); the patient is identified by the `patientId` route param. Defaults to the root when `path` is omitted.
372
+ */
373
+ get: operations["browse-vfs"];
374
+ put?: never;
375
+ post?: never;
376
+ delete?: never;
377
+ options?: never;
378
+ head?: never;
379
+ patch?: never;
380
+ trace?: never;
381
+ };
382
+ "/v1/patients/{patientId}/read": {
383
+ parameters: {
384
+ query?: never;
385
+ header?: never;
386
+ path?: never;
387
+ cookie?: never;
388
+ };
389
+ /**
390
+ * Read VFS path
391
+ * @description Returns the content of a VFS file at the given path. Three output formats are supported: `narrative` (full Markdown, default), `compact` (condensed Markdown), and `structured` (machine-readable JSON). Use `token_budget` to cap approximate output length in tokens.
392
+ */
393
+ get: operations["read-vfs"];
394
+ put?: never;
395
+ post?: never;
396
+ delete?: never;
397
+ options?: never;
398
+ head?: never;
399
+ patch?: never;
400
+ trace?: never;
401
+ };
402
+ }
403
+ export type webhooks = Record<string, never>;
404
+ export interface components {
405
+ schemas: {
406
+ /** @description Identity of the running service: its name and the build it came from. Reports what this process resolved at startup, which for edge builds is more specific than any released version. */
407
+ ServiceInfo: {
408
+ /** @description Display name of the service. */
409
+ name: string;
410
+ /** @description Build identity of the running process. */
411
+ version: {
412
+ /** @description Product version of the running build. Injected as `VERSION` at image build time; falls back to the server package version outside a built image. */
413
+ number: string;
414
+ /** @description Full 40-character git commit the build came from, or `unknown`. An `unknown` value means the build did not come from CI — do not read the version alone as proof of provenance. */
415
+ buildSha: string;
416
+ /** @description ISO 8601 timestamp of when the image was built, or `unknown`. */
417
+ buildDate: string;
418
+ };
419
+ };
420
+ /** @description List of patients. */
421
+ PatientList: {
422
+ /** @description Caller-assigned identifier used in all REST API routes. */
423
+ registryKey: string;
424
+ /** @description Demographic data extracted from the ingested record. Null if no patient resource was found during ingestion. */
425
+ patient: {
426
+ /** @description Internal patient ID extracted from the ingested record (e.g., FHIR Patient.id). Used in VFS paths. */
427
+ id: string;
428
+ /** @description Patient display name extracted from the ingested record. */
429
+ name: string;
430
+ } | null;
431
+ /** @description Whether the patient graph has finished processing and is ready to query. */
432
+ ready: boolean;
433
+ /** @description Aggregate counts for the patient graph. Null if ingestion has not completed. */
434
+ stats: {
435
+ /** @description Total number of resolved clinical entities in the graph. */
436
+ entities: number;
437
+ /** @description Total number of clinical events in the graph. */
438
+ events: number;
439
+ /** @description Total number of typed relationship edges in the graph. */
440
+ relationships: number;
441
+ } | null;
442
+ }[];
443
+ /** @description Demographic metadata and pipeline stats for a single patient. */
444
+ PatientDetail: {
445
+ /** @description Internal patient ID extracted from the ingested record. Used in VFS paths. */
446
+ id: string;
447
+ /** @description Patient display name extracted from the ingested record. */
448
+ name: string;
449
+ /** @description Patient date of birth in ISO 8601 format (YYYY-MM-DD), if present in the source. */
450
+ birthDate?: string;
451
+ /** @description Administrative gender extracted from the ingested record. */
452
+ gender?: string;
453
+ /** @description Aggregate counts for the patient graph after the most recent ingest. */
454
+ stats: {
455
+ /** @description Total number of resolved clinical entities in the graph. */
456
+ entities: number;
457
+ /** @description Total number of clinical events in the graph. */
458
+ events: number;
459
+ /** @description Total number of typed relationship edges in the graph. */
460
+ relationships: number;
461
+ /** @description Number of extraction warnings raised during the most recent ingest run. */
462
+ warnings: number;
463
+ /** @description Wall-clock time in milliseconds for the most recent graph load. */
464
+ loadMs: number;
465
+ };
466
+ };
467
+ /** @description Standard error envelope returned on all non-2xx responses. */
468
+ ApiError: {
469
+ /** @description HTTP status code. */
470
+ code: number;
471
+ /**
472
+ * @description Machine-readable error classification.
473
+ * @enum {string}
474
+ */
475
+ type: "ALREADY_EXISTS" | "FAILED_PRECONDITION" | "INTERNAL" | "INVALID_ARGUMENT" | "NOT_FOUND" | "OUT_OF_RANGE" | "UNIMPLEMENTED" | "UNAUTHENTICATED" | "PERMISSION_DENIED" | "CONTENT_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE";
476
+ /** @description Human-readable error detail. */
477
+ message: string;
478
+ };
479
+ /** @description Patient. */
480
+ Patient: {
481
+ /** @description Id of the patient. */
482
+ id: string;
483
+ /** @description ISO 8601 timestamp when the patient was first registered. */
484
+ createdAt: string;
485
+ /** @description ISO 8601 timestamp when the patient record was last updated. */
486
+ updatedAt: string;
487
+ };
488
+ /** @description Full fact-resolution report for a patient: every persisted fact with its complete provenance trace and field-level conflict resolutions. */
489
+ ResolutionReport: {
490
+ /** @description Aggregate resolution stats. Null if resolution has not run. */
491
+ summary: {
492
+ /** @description Total number of facts in the graph after resolution. */
493
+ totalFacts: number;
494
+ /** @description Total number of clinical events in the graph. */
495
+ totalEvents: number;
496
+ /** @description Number of facts carrying more than one contributing source after resolution. */
497
+ mergedFacts: number;
498
+ /** @description Number of resolution warnings raised. */
499
+ warningCount: number;
500
+ /** @description Wall-clock time in milliseconds for the resolution pass. */
501
+ loadMs: number;
502
+ } | null;
503
+ /** @description Pagination metadata for the `facts` array. Null if resolution has not run. */
504
+ meta: {
505
+ /** @description Total number of facts across all pages. */
506
+ total: number;
507
+ /** @description Zero-indexed page returned in `facts`. */
508
+ page: number;
509
+ /** @description Page size used for this response. */
510
+ perPage: number;
511
+ } | null;
512
+ /** @description The requested page of persisted facts — every fact type, single- or multi-source — with provenance and conflict resolution details. Ordered by fact type (alphabetical), then display. */
513
+ facts: {
514
+ /** @description Stable fact ID assigned by the resolution engine. */
515
+ id: string;
516
+ /** @description Fact type (e.g., "condition", "medication", "immunization"). */
517
+ type: string;
518
+ /** @description Human-readable display name for the fact. */
519
+ display: string;
520
+ /** @description Complete provenance trace for this fact. Resolution always persists one; a null value indicates a server-side bug and is logged as an error. */
521
+ provenance: {
522
+ /** @description Resolution layer that produced this fact (e.g., deterministic-code, nlp-normalization, llm-adjudication, novel-entity). */
523
+ resolvedBy: string;
524
+ /** @description Resolution confidence score between 0 and 1. */
525
+ confidence: number;
526
+ /** @description Human-readable explanation of why sources were merged or kept separate. */
527
+ reasoning: string;
528
+ /** @description Contributing source records folded into this fact. */
529
+ sources: {
530
+ /** @description Reference to the contributing source record (e.g., "Condition/abc"). */
531
+ origin: string;
532
+ /** @description Format of the contributing source (e.g., "fhir", "cda"). */
533
+ type: string;
534
+ /** @description Reliability weight assigned to this source, between 0 and 1. */
535
+ reliability: number;
536
+ }[];
537
+ /** @description Field-level conflicts detected across sources, with the winning value and resolution strategy. */
538
+ conflicts: {
539
+ /** @description Name of the conflicting field. */
540
+ field: string;
541
+ /** @description All candidate values from contributing sources. */
542
+ values: {
543
+ /** @description Candidate field value. */
544
+ value: string;
545
+ /** @description Label of the source that contributed this value. */
546
+ source: string;
547
+ /** @description ISO 8601 timestamp when this value was recorded at the source, if known. */
548
+ date: string | null;
549
+ }[];
550
+ /** @description The value selected as authoritative after conflict resolution. */
551
+ winner: string;
552
+ /** @description Conflict resolution strategy applied (e.g., most-recent, highest-reliability, llm). */
553
+ strategy: string;
554
+ /** @description Human-readable explanation of why the winning value was selected. */
555
+ explanation: string;
556
+ }[];
557
+ } | null;
558
+ }[];
559
+ /** @description Extraction warnings raised during the resolution pass. */
560
+ warnings: {
561
+ /** @description Label of the ingest source that produced the warning. */
562
+ source: string;
563
+ /** @description Identifier of the resource or record that triggered the warning. */
564
+ id: string;
565
+ /** @description Human-readable warning message. */
566
+ message: string;
567
+ /** @description Warning severity level (info, warn, or error). */
568
+ severity: string;
569
+ }[];
570
+ /** @description Top-level error message if resolution failed entirely. */
571
+ error?: string;
572
+ };
573
+ /** @description Post-pipeline reconciliation summary including merge stats and inferred relationships. */
574
+ ReconciliationData: {
575
+ /** @description Display name of the patient this reconciliation summary belongs to. */
576
+ patientName: string;
577
+ /** @description Aggregate counts from the reconciliation pass. */
578
+ stats: {
579
+ /** @description Number of raw entities before resolution. */
580
+ inputEntities: number;
581
+ /** @description Number of entities after resolution (input minus merged duplicates). */
582
+ resolvedEntities: number;
583
+ /** @description Number of merge groups where two or more source records were collapsed into one entity. */
584
+ mergedGroups: number;
585
+ /** @description Number of relationships extracted directly from source records. */
586
+ explicitRelationships: number;
587
+ /** @description Number of relationships inferred by the pipeline from clinical knowledge. */
588
+ inferredRelationships: number;
589
+ };
590
+ /** @description Entities where two or more source records were merged by resolution. */
591
+ mergedEntities: {
592
+ /** @description Display name of the merged entity. */
593
+ display: string;
594
+ /** @description Clinical entity type (e.g., Condition, Medication, Observation). */
595
+ type: string;
596
+ /** @description Number of source records that were merged into this entity. */
597
+ sourceCount: number;
598
+ /** @description Resolution strategy that produced the merge. */
599
+ resolvedBy: string;
600
+ /** @description Merge confidence score between 0 and 1. */
601
+ confidence: number;
602
+ /** @description Human-readable explanation of why these records were merged. */
603
+ reasoning: string;
604
+ }[];
605
+ /** @description Relationships inferred by the pipeline that were not explicit in any source record. */
606
+ inferredRelationships: {
607
+ /** @description Display name of the source entity in the relationship. */
608
+ fromDisplay: string;
609
+ /** @description Display name of the target entity in the relationship. */
610
+ toDisplay: string;
611
+ /** @description Relationship type (e.g., has_complication, prescribed_for, monitors). */
612
+ type: string;
613
+ /** @description Inference confidence score between 0 and 1. */
614
+ confidence: number;
615
+ /** @description Human-readable explanation of why this relationship was inferred. */
616
+ reasoning: string;
617
+ }[];
618
+ };
619
+ /** @description Response returned immediately on ingest submission, containing the execution ID and current status. */
620
+ IngestExecutionEnvelope: {
621
+ /** @description Unique identifier for this ingest execution. Use with the executions endpoints to poll status or retrieve detail. */
622
+ executionId: string;
623
+ status: components["schemas"]["IngestExecutionStatus"];
624
+ sourceLabel: components["schemas"]["IngestSourceLabel"];
625
+ /** @description Graph changes produced by this execution. Null if the execution has not yet completed. */
626
+ deltas: {
627
+ /** @description Number of new clinical entities added to the graph. */
628
+ entitiesAdded: number;
629
+ /** @description Number of new clinical events added to the graph. */
630
+ eventsAdded: number;
631
+ /** @description Number of new relationship edges added to the graph. */
632
+ relsAdded: number;
633
+ } | null;
634
+ /** @description Number of extraction warnings raised during this execution. */
635
+ warningsCount: number;
636
+ /** @description Error detail if the execution failed. Null on success. */
637
+ error: {
638
+ /** @description Machine-readable error code. */
639
+ code: string;
640
+ /** @description Human-readable error message. */
641
+ message: string;
642
+ } | null;
643
+ /** @description Human-readable reason the execution was skipped (e.g., duplicate payload). Null if not skipped. */
644
+ skippedReason: string | null;
645
+ patient: components["schemas"]["PatientRef"];
646
+ /** @description Hypermedia links for follow-up requests. */
647
+ links: {
648
+ /** @description URL to retrieve this execution's detail. */
649
+ self: string;
650
+ /** @description URL to retrieve the patient record. */
651
+ patient: string;
652
+ };
653
+ };
654
+ /**
655
+ * @description Current execution status.
656
+ * @enum {string}
657
+ */
658
+ IngestExecutionStatus: "pending" | "running" | "succeeded" | "failed" | "skipped";
659
+ /**
660
+ * @description Ingest source type that was submitted.
661
+ * @enum {string}
662
+ */
663
+ IngestSourceLabel: "fhir" | "cda" | "document" | "batch";
664
+ /** @description Patient reference resolved from the ingested record. */
665
+ PatientRef: {
666
+ /** @description Internal patient ID extracted from the ingested record. Used in VFS paths. */
667
+ id: string;
668
+ /** @description Patient display name extracted from the ingested record. */
669
+ name: string;
670
+ } | null;
671
+ /** @description Registration payload for an unstructured document. */
672
+ IngestDocumentBody: {
673
+ /**
674
+ * @description File name of the document, including extension. Used as the source label in the ingest status and execution history.
675
+ * @example discharge-summary.pdf
676
+ */
677
+ name: string;
678
+ /**
679
+ * @description MIME type of the document (e.g., application/pdf, text/plain). Used to determine how the document is stored and referenced.
680
+ * @example application/pdf
681
+ */
682
+ mimeType?: string;
683
+ };
684
+ /** @description Mixed batch of FHIR bundles, CDA documents, and unstructured document registrations to process in a single ingest request. */
685
+ IngestBatchBody: {
686
+ /** @description FHIR R4 Bundles or single resources */
687
+ fhir?: {
688
+ [key: string]: unknown;
689
+ }[];
690
+ /** @description CDA/C-CDA XML document strings */
691
+ cda?: string[];
692
+ /** @description Unstructured documents to register in this batch. Each entry is an IngestDocumentBody with name and MIME type. */
693
+ documents?: components["schemas"]["IngestDocumentBody"][];
694
+ };
695
+ /** @description Aggregate ingest status for a patient, including graph readiness, per-source extraction stats, load metrics, and patient reference. */
696
+ IngestStatusResponse: {
697
+ /** @description Whether the patient graph has finished all ingest processing and is ready to query. */
698
+ ready: boolean;
699
+ /** @description Per-source breakdown of extraction stats, one entry per distinct ingest source. */
700
+ sources: {
701
+ /** @description Human-readable source label (e.g., "FHIR Bundle", "Summary_20230907.xml"). */
702
+ label: string;
703
+ stats: components["schemas"]["IngestStats"];
704
+ }[];
705
+ patient: components["schemas"]["PatientRef"] & unknown;
706
+ /** @description Aggregate extraction counts from the most recent graph load. Null if no graph load has completed. */
707
+ loadStats: {
708
+ /** @description Total number of clinical entities extracted across all sources. */
709
+ entitiesExtracted: number;
710
+ /** @description Total number of clinical events extracted across all sources. */
711
+ eventsExtracted: number;
712
+ /** @description Total number of relationship edges extracted across all sources. */
713
+ relationshipsExtracted: number;
714
+ } | null;
715
+ /** @description Wall-clock time in milliseconds for the most recent graph load. */
716
+ loadMs: number;
717
+ };
718
+ /** @description Extraction counts for this source. */
719
+ IngestStats: {
720
+ /** @description Number of top-level items (resources or records) scanned in the source. */
721
+ itemsScanned: number;
722
+ };
723
+ /** @description Cursor-paginated list of ingest executions for a patient. */
724
+ IngestExecutionList: {
725
+ /** @description Ordered list of execution summaries, newest first. */
726
+ executions: components["schemas"]["IngestExecutionListItem"][];
727
+ /** @description Opaque cursor to pass as `cursor` in the next request to retrieve the following page. Null when no further pages remain. */
728
+ nextCursor: number | null;
729
+ };
730
+ /** @description Summary of a single ingest execution as returned in the execution list. */
731
+ IngestExecutionListItem: {
732
+ /** @description Unique identifier for this execution. */
733
+ id: string;
734
+ sourceLabel: components["schemas"]["IngestSourceLabel"] & unknown;
735
+ status: components["schemas"]["IngestExecutionStatus"] & unknown;
736
+ /** @description Unix timestamp (milliseconds) when the execution started. */
737
+ startedAt: number;
738
+ /** @description Unix timestamp (milliseconds) when the execution reached a terminal status. Null if still in progress. */
739
+ finishedAt: number | null;
740
+ /** @description SHA-256 hash of the submitted payload. Used for duplicate detection. Null if hashing is not supported for this source type. */
741
+ payloadHash: string | null;
742
+ /** @description Aggregate graph changes produced by this execution. */
743
+ deltasSummary: {
744
+ /** @description Number of new clinical entities added to the graph. */
745
+ entitiesAdded: number;
746
+ /** @description Number of new clinical events added to the graph. */
747
+ eventsAdded: number;
748
+ /** @description Number of new relationship edges added to the graph. */
749
+ relsAdded: number;
750
+ };
751
+ /** @description Number of LLM inference calls consumed by this execution. */
752
+ llmCallsUsed: number;
753
+ /** @description Machine-readable error code if the execution failed. Null on success. */
754
+ errorCode: string | null;
755
+ /** @description Human-readable reason the execution was skipped. Null if not skipped. */
756
+ skippedReason: string | null;
757
+ };
758
+ /** @description Full detail for a single ingest execution, including stage timings, per-type and per-source delta breakdowns, warnings, and error detail. */
759
+ IngestExecutionDetail: {
760
+ execution: components["schemas"]["IngestExecutionListItem"] & unknown;
761
+ /** @description Wall-clock duration in milliseconds for each named pipeline stage (e.g., parse, extract, resolve, load). */
762
+ stageTimings: {
763
+ [key: string]: number;
764
+ };
765
+ /** @description Full graph delta breakdown for this execution, split by entity type and by source. */
766
+ deltasFull: {
767
+ /** @description Count of entities added, keyed by clinical entity type (e.g., Condition, Medication). */
768
+ byEntityType: {
769
+ [key: string]: number;
770
+ };
771
+ /** @description Delta counts keyed by source label, showing how much each individual source contributed. */
772
+ bySource: {
773
+ [key: string]: {
774
+ /** @description Number of new clinical entities added to the graph. */
775
+ entitiesAdded: number;
776
+ /** @description Number of new clinical events added to the graph. */
777
+ eventsAdded: number;
778
+ /** @description Number of new relationship edges added to the graph. */
779
+ relsAdded: number;
780
+ };
781
+ };
782
+ /** @description Number of entity pairs that were merged by resolution during this execution. */
783
+ entitiesMerged: number;
784
+ };
785
+ /** @description Extraction warnings raised during this execution that did not halt processing. */
786
+ warnings: {
787
+ /** @description Label of the ingest source that produced the warning. */
788
+ source: string;
789
+ /** @description Identifier of the resource or record that triggered the warning. */
790
+ id?: string;
791
+ /** @description Human-readable warning message. */
792
+ message: string;
793
+ /**
794
+ * @description Warning severity level.
795
+ * @enum {string}
796
+ */
797
+ severity: "info" | "warn" | "error";
798
+ }[];
799
+ /** @description Structured error detail if the execution failed. Null on success. */
800
+ errorDetail: {
801
+ /** @description Machine-readable error code. */
802
+ code: string;
803
+ /** @description Human-readable error message. */
804
+ message: string;
805
+ /** @description Extended diagnostic detail, if available. */
806
+ detail?: string;
807
+ } | null;
808
+ };
809
+ /** @description A session opened or confirmed by the upsert-session endpoint. */
810
+ Session: {
811
+ /** @description Unique identifier for this session. */
812
+ sessionId: string;
813
+ /** @description Unique identifier for the patient this session is scoped to. */
814
+ patientId: string;
815
+ /** @description ISO 8601 timestamp when the session was created. */
816
+ createdAt: string;
817
+ };
818
+ /** @description Messages to append to an open session. */
819
+ AppendMessagesBody: {
820
+ /** @description Messages to append to the session, in chronological order. */
821
+ messages: {
822
+ /**
823
+ * @description Author of the message.
824
+ * @enum {string}
825
+ */
826
+ role: "user" | "assistant";
827
+ /** @description Message text. */
828
+ content: string;
829
+ }[];
830
+ };
831
+ /** @description A page of memories extracted from a session. */
832
+ SessionMemoryList: {
833
+ /** @description The requested page of items. */
834
+ data: components["schemas"]["SessionMemory"][];
835
+ /** @description Pagination metadata for the returned page. */
836
+ meta: {
837
+ /** @description Total number of items across all pages. */
838
+ total: number;
839
+ /** @description Zero-indexed page returned in `data`. */
840
+ page: number;
841
+ /** @description Page size used for this response. */
842
+ perPage: number;
843
+ };
844
+ };
845
+ /** @description A memory extracted from a chat session's transcript. */
846
+ SessionMemory: {
847
+ /** @description Stable unique identifier for this memory. */
848
+ id: string;
849
+ /**
850
+ * @description The memory taxonomy — symptom | adherence | concern | preference.
851
+ * @enum {string}
852
+ */
853
+ type: "symptom" | "adherence" | "concern" | "preference";
854
+ /** @description The statement as expressed by or on behalf of the patient. */
855
+ content: string;
856
+ /** @description Id of the chat session that produced this memory. */
857
+ sessionId: string;
858
+ /** @description ISO 8601 timestamp when this memory was recorded. */
859
+ createdAt: string;
860
+ };
861
+ /** @description A complete chat transcript to ingest as a single closed session. */
862
+ IngestSessionBody: {
863
+ /** @description Full transcript to replay, in chronological order. */
864
+ messages: {
865
+ /**
866
+ * @description Author of the message.
867
+ * @enum {string}
868
+ */
869
+ role: "user" | "assistant";
870
+ /** @description Message text. */
871
+ content: string;
872
+ }[];
873
+ };
874
+ /** @description Result of a VFS browse operation. Contains directory children when the path resolves to a directory, or file content metadata when it resolves to a file. */
875
+ BrowseResult: {
876
+ /** @description VFS path of the browsed node, relative to the patient root. */
877
+ path: string;
878
+ /**
879
+ * @description Whether the browsed node is a directory or a file.
880
+ * @enum {string}
881
+ */
882
+ type: "directory" | "file";
883
+ /** @description Immediate children of this directory. Present when type is `directory`, absent when type is `file`. */
884
+ children?: {
885
+ /** @description Name of the child node (filename or directory name). */
886
+ name: string;
887
+ /**
888
+ * @description Whether this child is a directory or a file.
889
+ * @enum {string}
890
+ */
891
+ type: "directory" | "file";
892
+ /** @description Short content preview for file nodes. Absent for directories. */
893
+ preview?: string;
894
+ }[];
895
+ /** @description Full content of the file node. Present when type is `file`, absent for directories. */
896
+ content?: string;
897
+ };
898
+ /** @description Content returned from a VFS read operation. */
899
+ ReadResponse: {
900
+ /** @description Rendered content of the VFS file in the requested format (narrative Markdown, compact Markdown, or structured JSON string). */
901
+ content: string;
902
+ };
903
+ };
904
+ responses: never;
905
+ parameters: never;
906
+ requestBodies: never;
907
+ headers: never;
908
+ pathItems: never;
909
+ }
910
+ export type $defs = Record<string, never>;
911
+ export interface operations {
912
+ "get-service-info": {
913
+ parameters: {
914
+ query?: never;
915
+ header?: never;
916
+ path?: never;
917
+ cookie?: never;
918
+ };
919
+ requestBody?: never;
920
+ responses: {
921
+ /** @description Service name and build identity */
922
+ 200: {
923
+ headers: {
924
+ [name: string]: unknown;
925
+ };
926
+ content: {
927
+ "application/json": components["schemas"]["ServiceInfo"];
928
+ };
929
+ };
930
+ };
931
+ };
932
+ "list-patients": {
933
+ parameters: {
934
+ query?: never;
935
+ header?: never;
936
+ path?: never;
937
+ cookie?: never;
938
+ };
939
+ requestBody?: never;
940
+ responses: {
941
+ /** @description List all registered patients */
942
+ 200: {
943
+ headers: {
944
+ [name: string]: unknown;
945
+ };
946
+ content: {
947
+ "application/json": components["schemas"]["PatientList"];
948
+ };
949
+ };
950
+ };
951
+ };
952
+ "get-patient": {
953
+ parameters: {
954
+ query?: never;
955
+ header?: never;
956
+ path: {
957
+ /** @description ID of the patient */
958
+ patientId: string;
959
+ };
960
+ cookie?: never;
961
+ };
962
+ requestBody?: never;
963
+ responses: {
964
+ /** @description Patient metadata and stats */
965
+ 200: {
966
+ headers: {
967
+ [name: string]: unknown;
968
+ };
969
+ content: {
970
+ "application/json": components["schemas"]["PatientDetail"];
971
+ };
972
+ };
973
+ /** @description Patient not found or no data ingested */
974
+ 404: {
975
+ headers: {
976
+ [name: string]: unknown;
977
+ };
978
+ content: {
979
+ "application/json": components["schemas"]["ApiError"];
980
+ };
981
+ };
982
+ };
983
+ };
984
+ "upsert-patient": {
985
+ parameters: {
986
+ query?: never;
987
+ header?: never;
988
+ path: {
989
+ /** @description ID of the patient */
990
+ patientId: string;
991
+ };
992
+ cookie?: never;
993
+ };
994
+ requestBody?: never;
995
+ responses: {
996
+ /** @description Patient created or confirmed. */
997
+ 200: {
998
+ headers: {
999
+ [name: string]: unknown;
1000
+ };
1001
+ content: {
1002
+ "application/json": components["schemas"]["Patient"];
1003
+ };
1004
+ };
1005
+ };
1006
+ };
1007
+ "delete-patient": {
1008
+ parameters: {
1009
+ query?: never;
1010
+ header?: never;
1011
+ path: {
1012
+ /** @description ID of the patient */
1013
+ patientId: string;
1014
+ };
1015
+ cookie?: never;
1016
+ };
1017
+ requestBody?: never;
1018
+ responses: {
1019
+ /** @description Patient deleted */
1020
+ 204: {
1021
+ headers: {
1022
+ [name: string]: unknown;
1023
+ };
1024
+ content?: never;
1025
+ };
1026
+ /** @description Patient not found */
1027
+ 404: {
1028
+ headers: {
1029
+ [name: string]: unknown;
1030
+ };
1031
+ content: {
1032
+ "application/json": components["schemas"]["ApiError"];
1033
+ };
1034
+ };
1035
+ };
1036
+ };
1037
+ "get-resolution": {
1038
+ parameters: {
1039
+ query?: {
1040
+ /** @description Zero-indexed page of facts to return. Defaults to 0. */
1041
+ page?: number | null;
1042
+ /** @description Number of facts per page. Defaults to 100; maximum is 1000. */
1043
+ perPage?: number;
1044
+ };
1045
+ header?: never;
1046
+ path: {
1047
+ /** @description ID of the patient */
1048
+ patientId: string;
1049
+ };
1050
+ cookie?: never;
1051
+ };
1052
+ requestBody?: never;
1053
+ responses: {
1054
+ /** @description Entity resolution report */
1055
+ 200: {
1056
+ headers: {
1057
+ [name: string]: unknown;
1058
+ };
1059
+ content: {
1060
+ "application/json": components["schemas"]["ResolutionReport"];
1061
+ };
1062
+ };
1063
+ /** @description Patient not found */
1064
+ 404: {
1065
+ headers: {
1066
+ [name: string]: unknown;
1067
+ };
1068
+ content: {
1069
+ "application/json": components["schemas"]["ApiError"];
1070
+ };
1071
+ };
1072
+ };
1073
+ };
1074
+ "get-reconciliation": {
1075
+ parameters: {
1076
+ query?: {
1077
+ /** @description Response format. `json` returns a structured ReconciliationData object; `markdown` (default) returns a human-readable plain-text report. */
1078
+ format?: "json" | "markdown";
1079
+ };
1080
+ header?: never;
1081
+ path: {
1082
+ /** @description ID of the patient */
1083
+ patientId: string;
1084
+ };
1085
+ cookie?: never;
1086
+ };
1087
+ requestBody?: never;
1088
+ responses: {
1089
+ /** @description Reconciliation summary. Returns JSON when ?format=json, Markdown (text/plain) otherwise. */
1090
+ 200: {
1091
+ headers: {
1092
+ [name: string]: unknown;
1093
+ };
1094
+ content: {
1095
+ "application/json": components["schemas"]["ReconciliationData"];
1096
+ "text/plain": string;
1097
+ };
1098
+ };
1099
+ /** @description Patient not found or no data ingested */
1100
+ 404: {
1101
+ headers: {
1102
+ [name: string]: unknown;
1103
+ };
1104
+ content: {
1105
+ "application/json": components["schemas"]["ApiError"];
1106
+ };
1107
+ };
1108
+ };
1109
+ };
1110
+ "ingest-fhir": {
1111
+ parameters: {
1112
+ query?: {
1113
+ /** @description Block up to this many ms for the execution to reach terminal status. 0 or omitted = return immediately with current status. */
1114
+ wait?: number | null;
1115
+ };
1116
+ header?: never;
1117
+ path: {
1118
+ /** @description ID of the patient */
1119
+ patientId: string;
1120
+ };
1121
+ cookie?: never;
1122
+ };
1123
+ /** @description FHIR R4 Bundle or single resource to ingest. */
1124
+ requestBody: {
1125
+ content: {
1126
+ "application/json": {
1127
+ [key: string]: unknown;
1128
+ };
1129
+ };
1130
+ };
1131
+ responses: {
1132
+ /** @description Ingest execution accepted */
1133
+ 202: {
1134
+ headers: {
1135
+ [name: string]: unknown;
1136
+ };
1137
+ content: {
1138
+ "application/json": components["schemas"]["IngestExecutionEnvelope"];
1139
+ };
1140
+ };
1141
+ /** @description Failed to parse FHIR resource */
1142
+ 422: {
1143
+ headers: {
1144
+ [name: string]: unknown;
1145
+ };
1146
+ content: {
1147
+ "application/json": components["schemas"]["ApiError"];
1148
+ };
1149
+ };
1150
+ };
1151
+ };
1152
+ "ingest-cda": {
1153
+ parameters: {
1154
+ query?: {
1155
+ /** @description Block up to this many ms for the execution to reach terminal status. 0 or omitted = return immediately with current status. */
1156
+ wait?: number | null;
1157
+ };
1158
+ header?: never;
1159
+ path: {
1160
+ /** @description ID of the patient */
1161
+ patientId: string;
1162
+ };
1163
+ cookie?: never;
1164
+ };
1165
+ /** @description CDA/C-CDA XML document to ingest. Must be a non-empty XML string. */
1166
+ requestBody: {
1167
+ content: {
1168
+ "text/plain": string;
1169
+ };
1170
+ };
1171
+ responses: {
1172
+ /** @description Ingest execution accepted */
1173
+ 202: {
1174
+ headers: {
1175
+ [name: string]: unknown;
1176
+ };
1177
+ content: {
1178
+ "application/json": components["schemas"]["IngestExecutionEnvelope"];
1179
+ };
1180
+ };
1181
+ /** @description Empty request body */
1182
+ 400: {
1183
+ headers: {
1184
+ [name: string]: unknown;
1185
+ };
1186
+ content: {
1187
+ "application/json": components["schemas"]["ApiError"];
1188
+ };
1189
+ };
1190
+ /** @description Failed to parse CDA document */
1191
+ 422: {
1192
+ headers: {
1193
+ [name: string]: unknown;
1194
+ };
1195
+ content: {
1196
+ "application/json": components["schemas"]["ApiError"];
1197
+ };
1198
+ };
1199
+ };
1200
+ };
1201
+ "ingest-document": {
1202
+ parameters: {
1203
+ query?: {
1204
+ /** @description Block up to this many ms for the execution to reach terminal status. 0 or omitted = return immediately with current status. */
1205
+ wait?: number | null;
1206
+ };
1207
+ header?: never;
1208
+ path: {
1209
+ /** @description ID of the patient */
1210
+ patientId: string;
1211
+ };
1212
+ cookie?: never;
1213
+ };
1214
+ /** @description Document registration payload containing the file name and optional MIME type. */
1215
+ requestBody: {
1216
+ content: {
1217
+ "application/json": components["schemas"]["IngestDocumentBody"];
1218
+ };
1219
+ };
1220
+ responses: {
1221
+ /** @description Document ingest execution accepted */
1222
+ 202: {
1223
+ headers: {
1224
+ [name: string]: unknown;
1225
+ };
1226
+ content: {
1227
+ "application/json": components["schemas"]["IngestExecutionEnvelope"];
1228
+ };
1229
+ };
1230
+ };
1231
+ };
1232
+ "ingest-batch": {
1233
+ parameters: {
1234
+ query?: {
1235
+ /** @description Block up to this many ms for the execution to reach terminal status. 0 or omitted = return immediately with current status. */
1236
+ wait?: number | null;
1237
+ };
1238
+ header?: never;
1239
+ path: {
1240
+ /** @description ID of the patient */
1241
+ patientId: string;
1242
+ };
1243
+ cookie?: never;
1244
+ };
1245
+ /** @description Batch payload containing any combination of FHIR bundles, CDA documents, and document registrations. At least one of `fhir`, `cda`, or `documents` must be non-empty. */
1246
+ requestBody: {
1247
+ content: {
1248
+ "application/json": components["schemas"]["IngestBatchBody"];
1249
+ };
1250
+ };
1251
+ responses: {
1252
+ /** @description Batch ingest execution accepted */
1253
+ 202: {
1254
+ headers: {
1255
+ [name: string]: unknown;
1256
+ };
1257
+ content: {
1258
+ "application/json": components["schemas"]["IngestExecutionEnvelope"];
1259
+ };
1260
+ };
1261
+ /** @description No valid input provided */
1262
+ 400: {
1263
+ headers: {
1264
+ [name: string]: unknown;
1265
+ };
1266
+ content: {
1267
+ "application/json": components["schemas"]["ApiError"];
1268
+ };
1269
+ };
1270
+ };
1271
+ };
1272
+ "get-ingest-status": {
1273
+ parameters: {
1274
+ query?: never;
1275
+ header?: never;
1276
+ path: {
1277
+ /** @description ID of the patient */
1278
+ patientId: string;
1279
+ };
1280
+ cookie?: never;
1281
+ };
1282
+ requestBody?: never;
1283
+ responses: {
1284
+ /** @description Current ingest status */
1285
+ 200: {
1286
+ headers: {
1287
+ [name: string]: unknown;
1288
+ };
1289
+ content: {
1290
+ "application/json": components["schemas"]["IngestStatusResponse"];
1291
+ };
1292
+ };
1293
+ };
1294
+ };
1295
+ "list-executions": {
1296
+ parameters: {
1297
+ query?: {
1298
+ /** @description Maximum number of executions to return per page. Defaults to 50; maximum is 200. */
1299
+ limit?: number;
1300
+ /** @description Pagination cursor returned as `nextCursor` from the previous page. Omit to start from the most recent execution. */
1301
+ cursor?: number | null;
1302
+ };
1303
+ header?: never;
1304
+ path: {
1305
+ /** @description ID of the patient */
1306
+ patientId: string;
1307
+ };
1308
+ cookie?: never;
1309
+ };
1310
+ requestBody?: never;
1311
+ responses: {
1312
+ /** @description Paginated execution history */
1313
+ 200: {
1314
+ headers: {
1315
+ [name: string]: unknown;
1316
+ };
1317
+ content: {
1318
+ "application/json": components["schemas"]["IngestExecutionList"];
1319
+ };
1320
+ };
1321
+ };
1322
+ };
1323
+ "get-execution": {
1324
+ parameters: {
1325
+ query?: never;
1326
+ header?: never;
1327
+ path: {
1328
+ /** @description ID of the patient */
1329
+ patientId: string;
1330
+ /** @description Unique execution ID returned in the IngestExecutionEnvelope or execution list. */
1331
+ executionId: string;
1332
+ };
1333
+ cookie?: never;
1334
+ };
1335
+ requestBody?: never;
1336
+ responses: {
1337
+ /** @description Execution detail with stage timings, full deltas, and warnings */
1338
+ 200: {
1339
+ headers: {
1340
+ [name: string]: unknown;
1341
+ };
1342
+ content: {
1343
+ "application/json": components["schemas"]["IngestExecutionDetail"];
1344
+ };
1345
+ };
1346
+ /** @description Execution not found (or already retention-pruned) */
1347
+ 404: {
1348
+ headers: {
1349
+ [name: string]: unknown;
1350
+ };
1351
+ content: {
1352
+ "application/json": components["schemas"]["ApiError"];
1353
+ };
1354
+ };
1355
+ };
1356
+ };
1357
+ "create-session": {
1358
+ parameters: {
1359
+ query?: never;
1360
+ header?: never;
1361
+ path: {
1362
+ /** @description ID of the patient */
1363
+ patientId: string;
1364
+ };
1365
+ cookie?: never;
1366
+ };
1367
+ requestBody?: never;
1368
+ responses: {
1369
+ /** @description Session created */
1370
+ 201: {
1371
+ headers: {
1372
+ [name: string]: unknown;
1373
+ };
1374
+ content: {
1375
+ "application/json": components["schemas"]["Session"];
1376
+ };
1377
+ };
1378
+ /** @description Patient not found or no data ingested */
1379
+ 404: {
1380
+ headers: {
1381
+ [name: string]: unknown;
1382
+ };
1383
+ content: {
1384
+ "application/json": components["schemas"]["ApiError"];
1385
+ };
1386
+ };
1387
+ };
1388
+ };
1389
+ "get-session": {
1390
+ parameters: {
1391
+ query?: never;
1392
+ header?: never;
1393
+ path: {
1394
+ /** @description ID of the patient */
1395
+ patientId: string;
1396
+ /** @description Unique session ID returned when the session was created. */
1397
+ sessionId: string;
1398
+ };
1399
+ cookie?: never;
1400
+ };
1401
+ requestBody?: never;
1402
+ responses: {
1403
+ /** @description Session info */
1404
+ 200: {
1405
+ headers: {
1406
+ [name: string]: unknown;
1407
+ };
1408
+ content: {
1409
+ "application/json": components["schemas"]["Session"];
1410
+ };
1411
+ };
1412
+ /** @description Session not found */
1413
+ 404: {
1414
+ headers: {
1415
+ [name: string]: unknown;
1416
+ };
1417
+ content: {
1418
+ "application/json": components["schemas"]["ApiError"];
1419
+ };
1420
+ };
1421
+ };
1422
+ };
1423
+ "upsert-session": {
1424
+ parameters: {
1425
+ query?: never;
1426
+ header?: never;
1427
+ path: {
1428
+ /** @description ID of the patient */
1429
+ patientId: string;
1430
+ /** @description Unique session ID returned when the session was created. */
1431
+ sessionId: string;
1432
+ };
1433
+ cookie?: never;
1434
+ };
1435
+ requestBody?: never;
1436
+ responses: {
1437
+ /** @description Session confirmed. */
1438
+ 200: {
1439
+ headers: {
1440
+ [name: string]: unknown;
1441
+ };
1442
+ content: {
1443
+ "application/json": components["schemas"]["Session"];
1444
+ };
1445
+ };
1446
+ /** @description Session created. */
1447
+ 201: {
1448
+ headers: {
1449
+ [name: string]: unknown;
1450
+ };
1451
+ content: {
1452
+ "application/json": components["schemas"]["Session"];
1453
+ };
1454
+ };
1455
+ /** @description Patient not found or no data ingested */
1456
+ 404: {
1457
+ headers: {
1458
+ [name: string]: unknown;
1459
+ };
1460
+ content: {
1461
+ "application/json": components["schemas"]["ApiError"];
1462
+ };
1463
+ };
1464
+ };
1465
+ };
1466
+ "append-messages": {
1467
+ parameters: {
1468
+ query?: never;
1469
+ header?: never;
1470
+ path: {
1471
+ /** @description ID of the patient */
1472
+ patientId: string;
1473
+ /** @description Unique session ID returned when the session was created. */
1474
+ sessionId: string;
1475
+ };
1476
+ cookie?: never;
1477
+ };
1478
+ requestBody: {
1479
+ content: {
1480
+ "application/json": components["schemas"]["AppendMessagesBody"];
1481
+ };
1482
+ };
1483
+ responses: {
1484
+ /** @description Messages appended */
1485
+ 200: {
1486
+ headers: {
1487
+ [name: string]: unknown;
1488
+ };
1489
+ content: {
1490
+ "application/json": {
1491
+ /** @description Always `true` when the messages were appended. */
1492
+ ok: boolean;
1493
+ /** @description Number of messages appended. */
1494
+ messageCount: number;
1495
+ };
1496
+ };
1497
+ };
1498
+ /** @description Patient or session not found */
1499
+ 404: {
1500
+ headers: {
1501
+ [name: string]: unknown;
1502
+ };
1503
+ content: {
1504
+ "application/json": components["schemas"]["ApiError"];
1505
+ };
1506
+ };
1507
+ };
1508
+ };
1509
+ "list-session-memories": {
1510
+ parameters: {
1511
+ query?: {
1512
+ /** @description Zero-indexed page of memories to return. Defaults to 0. */
1513
+ page?: number | null;
1514
+ /** @description Number of memories per page. Defaults to 100; maximum is 1000. */
1515
+ perPage?: number;
1516
+ /** @description Field to sort by. One of: createdAt. Defaults to `createdAt`. */
1517
+ sort?: "createdAt";
1518
+ /** @description Sort direction. Defaults to `desc`. */
1519
+ order?: "asc" | "desc";
1520
+ };
1521
+ header?: never;
1522
+ path: {
1523
+ /** @description ID of the patient */
1524
+ patientId: string;
1525
+ /** @description Unique session ID returned when the session was created. */
1526
+ sessionId: string;
1527
+ };
1528
+ cookie?: never;
1529
+ };
1530
+ requestBody?: never;
1531
+ responses: {
1532
+ /** @description Session memories */
1533
+ 200: {
1534
+ headers: {
1535
+ [name: string]: unknown;
1536
+ };
1537
+ content: {
1538
+ "application/json": components["schemas"]["SessionMemoryList"];
1539
+ };
1540
+ };
1541
+ /** @description Patient or session not found */
1542
+ 404: {
1543
+ headers: {
1544
+ [name: string]: unknown;
1545
+ };
1546
+ content: {
1547
+ "application/json": components["schemas"]["ApiError"];
1548
+ };
1549
+ };
1550
+ };
1551
+ };
1552
+ "generate-memories": {
1553
+ parameters: {
1554
+ query?: never;
1555
+ header?: never;
1556
+ path: {
1557
+ /** @description ID of the patient */
1558
+ patientId: string;
1559
+ /** @description Unique session ID returned when the session was created. */
1560
+ sessionId: string;
1561
+ };
1562
+ cookie?: never;
1563
+ };
1564
+ requestBody?: never;
1565
+ responses: {
1566
+ /** @description Memories generated */
1567
+ 200: {
1568
+ headers: {
1569
+ [name: string]: unknown;
1570
+ };
1571
+ content: {
1572
+ "application/json": {
1573
+ /** @description Always `true` when generation succeeded. */
1574
+ ok: boolean;
1575
+ };
1576
+ };
1577
+ };
1578
+ /** @description Patient or session not found */
1579
+ 404: {
1580
+ headers: {
1581
+ [name: string]: unknown;
1582
+ };
1583
+ content: {
1584
+ "application/json": components["schemas"]["ApiError"];
1585
+ };
1586
+ };
1587
+ };
1588
+ };
1589
+ "ingest-session": {
1590
+ parameters: {
1591
+ query?: never;
1592
+ header?: never;
1593
+ path: {
1594
+ /** @description ID of the patient */
1595
+ patientId: string;
1596
+ };
1597
+ cookie?: never;
1598
+ };
1599
+ requestBody: {
1600
+ content: {
1601
+ "application/json": components["schemas"]["IngestSessionBody"];
1602
+ };
1603
+ };
1604
+ responses: {
1605
+ /** @description Session ingested and closed */
1606
+ 200: {
1607
+ headers: {
1608
+ [name: string]: unknown;
1609
+ };
1610
+ content: {
1611
+ "application/json": {
1612
+ /** @description Always `true` when the session was ingested successfully. */
1613
+ ok: boolean;
1614
+ /** @description ID of the session that was created and closed. */
1615
+ sessionId: string;
1616
+ /** @description Number of messages appended to the session. */
1617
+ messageCount: number;
1618
+ };
1619
+ };
1620
+ };
1621
+ /** @description Patient not found or no data ingested */
1622
+ 404: {
1623
+ headers: {
1624
+ [name: string]: unknown;
1625
+ };
1626
+ content: {
1627
+ "application/json": components["schemas"]["ApiError"];
1628
+ };
1629
+ };
1630
+ };
1631
+ };
1632
+ "browse-vfs": {
1633
+ parameters: {
1634
+ query?: {
1635
+ /** @description VFS path to browse, relative to the patient root (e.g. `/conditions/active`). Defaults to the root when omitted. */
1636
+ path?: string;
1637
+ };
1638
+ header?: never;
1639
+ path: {
1640
+ /** @description ID of the patient */
1641
+ patientId: string;
1642
+ };
1643
+ cookie?: never;
1644
+ };
1645
+ requestBody?: never;
1646
+ responses: {
1647
+ /** @description VFS browse result */
1648
+ 200: {
1649
+ headers: {
1650
+ [name: string]: unknown;
1651
+ };
1652
+ content: {
1653
+ "application/json": components["schemas"]["BrowseResult"];
1654
+ };
1655
+ };
1656
+ /** @description Patient not found or no data ingested */
1657
+ 404: {
1658
+ headers: {
1659
+ [name: string]: unknown;
1660
+ };
1661
+ content: {
1662
+ "application/json": components["schemas"]["ApiError"];
1663
+ };
1664
+ };
1665
+ };
1666
+ };
1667
+ "read-vfs": {
1668
+ parameters: {
1669
+ query?: {
1670
+ /** @description VFS path of the file to read, relative to the patient root (e.g. `/conditions/active`). Defaults to the root when omitted. */
1671
+ path?: string;
1672
+ /** @description Output format. `narrative` (default) returns full Markdown; `compact` returns condensed Markdown; `structured` returns machine-readable JSON. */
1673
+ format?: "narrative" | "structured" | "compact";
1674
+ /** @description Approximate token budget for the response */
1675
+ token_budget?: number;
1676
+ };
1677
+ header?: never;
1678
+ path: {
1679
+ /** @description ID of the patient */
1680
+ patientId: string;
1681
+ };
1682
+ cookie?: never;
1683
+ };
1684
+ requestBody?: never;
1685
+ responses: {
1686
+ /** @description VFS path content */
1687
+ 200: {
1688
+ headers: {
1689
+ [name: string]: unknown;
1690
+ };
1691
+ content: {
1692
+ "application/json": components["schemas"]["ReadResponse"];
1693
+ };
1694
+ };
1695
+ /** @description Patient not found or no data ingested */
1696
+ 404: {
1697
+ headers: {
1698
+ [name: string]: unknown;
1699
+ };
1700
+ content: {
1701
+ "application/json": components["schemas"]["ApiError"];
1702
+ };
1703
+ };
1704
+ };
1705
+ };
1706
+ }