@konneal/engine 0.1.4 → 0.2.1

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 (58) hide show
  1. package/dist/admin.d.ts +1 -0
  2. package/dist/ask-47RNGK2R.js +12 -0
  3. package/dist/chunk-3OXSQH7Y.js +1852 -0
  4. package/dist/chunk-6GOSMLRH.js +2781 -0
  5. package/dist/{chunk-EHJEELVB.js → chunk-LNSDBEKS.js} +1 -1
  6. package/dist/{chunk-35ODH64W.js → chunk-Q327B27J.js} +33 -0
  7. package/dist/{chunk-OCNLV7Q7.js → chunk-Q6LI4T7M.js} +6 -1
  8. package/dist/{chunk-ROF3Q7UC.js → chunk-SN3ANQ3Y.js} +2 -2
  9. package/dist/chunk-VJZLVU3S.js +64 -0
  10. package/dist/{chunk-CAEHIVG5.js → chunk-WGXATDXY.js} +1 -1
  11. package/dist/codecs.d.ts +3 -3
  12. package/dist/completion.d.ts +1 -1
  13. package/dist/config.d.ts +9 -0
  14. package/dist/faithfulness.d.ts +1 -0
  15. package/dist/mcp-proto.d.ts +25 -0
  16. package/dist/mcp.d.ts +4 -0
  17. package/dist/openapi-surface.gen.d.ts +9 -0
  18. package/dist/openapi-types.d.ts +2141 -0
  19. package/dist/profile.gen.d.ts +1 -0
  20. package/dist/prompts/system.md +1 -0
  21. package/dist/quota.d.ts +4 -1
  22. package/dist/search-OMPBMZT4.js +11 -0
  23. package/dist/tablecontext.d.ts +7 -0
  24. package/dist/verdict-parse.d.ts +5 -0
  25. package/dist/worker_mcp/src/index.js +3 -3
  26. package/dist/worker_public/src/config.js +4 -2
  27. package/dist/worker_public/src/index.js +1193 -4932
  28. package/dist/worker_public/src/profile.js +1 -1
  29. package/dist/worker_public/src/refusal.js +2 -2
  30. package/dist/worker_public/src/requestScope.js +3 -3
  31. package/docs/spec-api.md +27 -13
  32. package/package.json +12 -3
  33. package/profile/prompts.yaml +3 -0
  34. package/workers/shared/router.ts +23 -16
  35. package/workers/worker_public/migrations/0014_usage_cache.sql +5 -0
  36. package/workers/worker_public/openapi.yaml +1169 -0
  37. package/workers/worker_public/prompts/system.md +1 -0
  38. package/workers/worker_public/schema.sql +3 -1
  39. package/workers/worker_public/src/admin.ts +51 -7
  40. package/workers/worker_public/src/ai.ts +10 -2
  41. package/workers/worker_public/src/ask.ts +94 -22
  42. package/workers/worker_public/src/codecs.ts +35 -10
  43. package/workers/worker_public/src/completion.ts +24 -1
  44. package/workers/worker_public/src/config.ts +10 -0
  45. package/workers/worker_public/src/faithfulness.ts +10 -17
  46. package/workers/worker_public/src/grader.ts +2 -2
  47. package/workers/worker_public/src/index.ts +106 -58
  48. package/workers/worker_public/src/lib/router.ts +1 -1
  49. package/workers/worker_public/src/mcp-proto.ts +71 -0
  50. package/workers/worker_public/src/mcp.ts +47 -0
  51. package/workers/worker_public/src/openapi-surface.gen.ts +318 -0
  52. package/workers/worker_public/src/pipeline.ts +4 -2
  53. package/workers/worker_public/src/profile.gen.ts +1 -0
  54. package/workers/worker_public/src/projects.ts +4 -2
  55. package/workers/worker_public/src/quota.ts +4 -2
  56. package/workers/worker_public/src/research.ts +55 -3
  57. package/workers/worker_public/src/tablecontext.ts +13 -2
  58. package/workers/worker_public/src/verdict-parse.ts +60 -0
@@ -0,0 +1,2141 @@
1
+ // GENERATED from workers/worker_public/openapi.yaml - do not edit.
2
+ // Regenerate: node scripts/gen-openapi-types.mjs (runs in npm run build)
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+
8
+ export interface paths {
9
+ "/api/ask": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ get?: never;
17
+ put?: never;
18
+ /**
19
+ * Ask a question anonymously
20
+ * @description Asks a question over the OIML corpus and receives an answer with clause-level citations. The anonymous allowance is 20 questions per day per IP address. The request body and the response are identical to /v1/ask.
21
+ */
22
+ post: operations["askAnonymous"];
23
+ delete?: never;
24
+ options?: never;
25
+ head?: never;
26
+ patch?: never;
27
+ trace?: never;
28
+ };
29
+ "/v1/ask": {
30
+ parameters: {
31
+ query?: never;
32
+ header?: never;
33
+ path?: never;
34
+ cookie?: never;
35
+ };
36
+ get?: never;
37
+ put?: never;
38
+ /**
39
+ * Ask a question with an API key
40
+ * @description Identical to /api/ask, with authentication by API key and a per-key daily allowance. Streaming responses are available by setting stream to true, which returns a server-sent event stream whose events carry citations, tokens and the completion marker.
41
+ */
42
+ post: operations["askKeyed"];
43
+ delete?: never;
44
+ options?: never;
45
+ head?: never;
46
+ patch?: never;
47
+ trace?: never;
48
+ };
49
+ "/api/search": {
50
+ parameters: {
51
+ query?: never;
52
+ header?: never;
53
+ path?: never;
54
+ cookie?: never;
55
+ };
56
+ get?: never;
57
+ put?: never;
58
+ /**
59
+ * Search ranked clauses
60
+ * @description Retrieves the ranked clauses for a query without generating an answer. Each hit carries its document identifier, edition, clause anchor, status and a link into the rendered document.
61
+ */
62
+ post: operations["search"];
63
+ delete?: never;
64
+ options?: never;
65
+ head?: never;
66
+ patch?: never;
67
+ trace?: never;
68
+ };
69
+ "/v1/search": {
70
+ parameters: {
71
+ query?: never;
72
+ header?: never;
73
+ path?: never;
74
+ cookie?: never;
75
+ };
76
+ get?: never;
77
+ put?: never;
78
+ /**
79
+ * Search ranked clauses with an API key
80
+ * @description Identical to /api/search, with authentication by API key and a per-key daily allowance.
81
+ */
82
+ post: operations["searchKeyed"];
83
+ delete?: never;
84
+ options?: never;
85
+ head?: never;
86
+ patch?: never;
87
+ trace?: never;
88
+ };
89
+ "/api/absence": {
90
+ parameters: {
91
+ query?: never;
92
+ header?: never;
93
+ path?: never;
94
+ cookie?: never;
95
+ };
96
+ get?: never;
97
+ put?: never;
98
+ /**
99
+ * Request a provable absence certificate
100
+ * @description Enumerates the entire machine-readable model of the named standard and reports how many nodes were examined and whether any matched the topic. A verdict of absent is an enumeration certificate that states its scope, not a statement that a search found nothing.
101
+ */
102
+ post: operations["absence"];
103
+ delete?: never;
104
+ options?: never;
105
+ head?: never;
106
+ patch?: never;
107
+ trace?: never;
108
+ };
109
+ "/v1/absence": {
110
+ parameters: {
111
+ query?: never;
112
+ header?: never;
113
+ path?: never;
114
+ cookie?: never;
115
+ };
116
+ get?: never;
117
+ put?: never;
118
+ /** Request a provable absence certificate with an API key */
119
+ post: operations["absenceKeyed"];
120
+ delete?: never;
121
+ options?: never;
122
+ head?: never;
123
+ patch?: never;
124
+ trace?: never;
125
+ };
126
+ "/api/verify": {
127
+ parameters: {
128
+ query?: never;
129
+ header?: never;
130
+ path?: never;
131
+ cookie?: never;
132
+ };
133
+ get?: never;
134
+ put?: never;
135
+ /**
136
+ * Verify an answer
137
+ * @description Applies the deterministic verification battery to any answer, whether generated by this service or by another system: every quoted span must be contained verbatim in a passage retrieved for the query, and every object reference must resolve to a served object. A judged faithfulness score is reported separately and is labelled as judged.
138
+ */
139
+ post: operations["verify"];
140
+ delete?: never;
141
+ options?: never;
142
+ head?: never;
143
+ patch?: never;
144
+ trace?: never;
145
+ };
146
+ "/v1/verify": {
147
+ parameters: {
148
+ query?: never;
149
+ header?: never;
150
+ path?: never;
151
+ cookie?: never;
152
+ };
153
+ get?: never;
154
+ put?: never;
155
+ /** Verify an answer with an API key */
156
+ post: operations["verifyKeyed"];
157
+ delete?: never;
158
+ options?: never;
159
+ head?: never;
160
+ patch?: never;
161
+ trace?: never;
162
+ };
163
+ "/api/research": {
164
+ parameters: {
165
+ query?: never;
166
+ header?: never;
167
+ path?: never;
168
+ cookie?: never;
169
+ };
170
+ get?: never;
171
+ put?: never;
172
+ /**
173
+ * Run a bounded research loop with the session cookie
174
+ * @description Identical to /v1/research, with authentication by the signed-in member's session cookie; research spend stays with signed-in members.
175
+ */
176
+ post: operations["research"];
177
+ delete?: never;
178
+ options?: never;
179
+ head?: never;
180
+ patch?: never;
181
+ trace?: never;
182
+ };
183
+ "/v1/research": {
184
+ parameters: {
185
+ query?: never;
186
+ header?: never;
187
+ path?: never;
188
+ cookie?: never;
189
+ };
190
+ get?: never;
191
+ put?: never;
192
+ /**
193
+ * Run a bounded research loop
194
+ * @description Runs a bounded iterative loop over the corpus. In each pass the service retrieves evidence, and an independent judge evaluates whether the evidence is sufficient and names what is missing; the next pass retrieves specifically for the missing parts, and the final answer is generated from the accumulated evidence. The response carries the answer, citations, typed blocks and the research metadata, including iterations, passages and elapsed time.
195
+ */
196
+ post: operations["researchKeyed"];
197
+ delete?: never;
198
+ options?: never;
199
+ head?: never;
200
+ patch?: never;
201
+ trace?: never;
202
+ };
203
+ "/mcp": {
204
+ parameters: {
205
+ query?: never;
206
+ header?: never;
207
+ path?: never;
208
+ cookie?: never;
209
+ };
210
+ get?: never;
211
+ put?: never;
212
+ /**
213
+ * The Model Context Protocol server
214
+ * @description Serves the Model Context Protocol over streamable HTTP for agent ecosystems, behind the same authentication as the /v1 endpoints. The protocol follows JSON-RPC 2.0 with the 2025-06-18 revision. The tools are ask, which asks a question and returns the answer with its citations, and retrieve, which returns ranked passages.
215
+ */
216
+ post: operations["mcp"];
217
+ delete?: never;
218
+ options?: never;
219
+ head?: never;
220
+ patch?: never;
221
+ trace?: never;
222
+ };
223
+ "/api/datasets": {
224
+ parameters: {
225
+ query?: never;
226
+ header?: never;
227
+ path?: never;
228
+ cookie?: never;
229
+ };
230
+ /**
231
+ * List the datasets
232
+ * @description Lists the available corpora with their access status. The OIML publications and the OIML SMART models are open to everyone; the ISO/IEC corpus requires a role that is managed in the identity service.
233
+ */
234
+ get: operations["datasets"];
235
+ put?: never;
236
+ post?: never;
237
+ delete?: never;
238
+ options?: never;
239
+ head?: never;
240
+ patch?: never;
241
+ trace?: never;
242
+ };
243
+ "/v1/usage": {
244
+ parameters: {
245
+ query?: never;
246
+ header?: never;
247
+ path?: never;
248
+ cookie?: never;
249
+ };
250
+ /**
251
+ * The presenting key's own usage
252
+ * @description Reports the key's own daily allowance consumption together with its seven-day request ledger. The identity is the presented credential itself, so a key can never read another key's usage.
253
+ */
254
+ get: operations["keyUsage"];
255
+ put?: never;
256
+ post?: never;
257
+ delete?: never;
258
+ options?: never;
259
+ head?: never;
260
+ patch?: never;
261
+ trace?: never;
262
+ };
263
+ "/health": {
264
+ parameters: {
265
+ query?: never;
266
+ header?: never;
267
+ path?: never;
268
+ cookie?: never;
269
+ };
270
+ /**
271
+ * Service health
272
+ * @description Reports service identity and index version.
273
+ */
274
+ get: operations["health"];
275
+ put?: never;
276
+ post?: never;
277
+ delete?: never;
278
+ options?: never;
279
+ head?: never;
280
+ patch?: never;
281
+ trace?: never;
282
+ };
283
+ "/api/conversations": {
284
+ parameters: {
285
+ query?: never;
286
+ header?: never;
287
+ path?: never;
288
+ cookie?: never;
289
+ };
290
+ /** List the member's conversations */
291
+ get: operations["listConversations"];
292
+ put?: never;
293
+ /** Create a conversation */
294
+ post: operations["createConversation"];
295
+ delete?: never;
296
+ options?: never;
297
+ head?: never;
298
+ patch?: never;
299
+ trace?: never;
300
+ };
301
+ "/api/conversations/{id}": {
302
+ parameters: {
303
+ query?: never;
304
+ header?: never;
305
+ path?: never;
306
+ cookie?: never;
307
+ };
308
+ /** Read a conversation with its messages */
309
+ get: operations["getConversation"];
310
+ put?: never;
311
+ post?: never;
312
+ /** Delete a conversation */
313
+ delete: operations["deleteConversation"];
314
+ options?: never;
315
+ head?: never;
316
+ /** Rename a conversation */
317
+ patch: operations["renameConversation"];
318
+ trace?: never;
319
+ };
320
+ "/api/conversations/{id}/messages": {
321
+ parameters: {
322
+ query?: never;
323
+ header?: never;
324
+ path?: never;
325
+ cookie?: never;
326
+ };
327
+ get?: never;
328
+ put?: never;
329
+ /** Append a message to a conversation */
330
+ post: operations["appendMessage"];
331
+ delete?: never;
332
+ options?: never;
333
+ head?: never;
334
+ patch?: never;
335
+ trace?: never;
336
+ };
337
+ "/api/conversations/{id}/share": {
338
+ parameters: {
339
+ query?: never;
340
+ header?: never;
341
+ path?: never;
342
+ cookie?: never;
343
+ };
344
+ get?: never;
345
+ put?: never;
346
+ /** Create a public permalink for a conversation */
347
+ post: operations["shareConversation"];
348
+ delete?: never;
349
+ options?: never;
350
+ head?: never;
351
+ patch?: never;
352
+ trace?: never;
353
+ };
354
+ "/api/shared/{slug}": {
355
+ parameters: {
356
+ query?: never;
357
+ header?: never;
358
+ path?: never;
359
+ cookie?: never;
360
+ };
361
+ /** Read a shared conversation by its permalink */
362
+ get: operations["getShared"];
363
+ put?: never;
364
+ post?: never;
365
+ delete?: never;
366
+ options?: never;
367
+ head?: never;
368
+ patch?: never;
369
+ trace?: never;
370
+ };
371
+ "/api/memories": {
372
+ parameters: {
373
+ query?: never;
374
+ header?: never;
375
+ path?: never;
376
+ cookie?: never;
377
+ };
378
+ /** List the member's memory notes */
379
+ get: operations["listMemories"];
380
+ put?: never;
381
+ /**
382
+ * Create a memory note, or replace one by supplying its identifier
383
+ * @description Creates a note from a name and a content of at most 8000 characters. When the body carries the identifier of an existing note, that note is replaced instead and no new note is created. At most ten notes are kept per member.
384
+ */
385
+ post: operations["createMemory"];
386
+ delete?: never;
387
+ options?: never;
388
+ head?: never;
389
+ patch?: never;
390
+ trace?: never;
391
+ };
392
+ "/api/memories/{id}": {
393
+ parameters: {
394
+ query?: never;
395
+ header?: never;
396
+ path?: never;
397
+ cookie?: never;
398
+ };
399
+ get?: never;
400
+ put?: never;
401
+ post?: never;
402
+ /** Delete a memory note */
403
+ delete: operations["deleteMemory"];
404
+ options?: never;
405
+ head?: never;
406
+ patch?: never;
407
+ trace?: never;
408
+ };
409
+ "/api/projects": {
410
+ parameters: {
411
+ query?: never;
412
+ header?: never;
413
+ path?: never;
414
+ cookie?: never;
415
+ };
416
+ /** List the member's contexts */
417
+ get: operations["listProjects"];
418
+ put?: never;
419
+ /**
420
+ * Create a context, rename one, or file a conversation into one
421
+ * @description The body selects the behaviour: a name alone creates a context; an identifier together with a name renames that context; a conversation identifier together with a context identifier (or null to unfile) moves the conversation into or out of the context. Filing a conversation into a context scopes its later retrieval to the context's files.
422
+ */
423
+ post: operations["createProject"];
424
+ delete?: never;
425
+ options?: never;
426
+ head?: never;
427
+ patch?: never;
428
+ trace?: never;
429
+ };
430
+ "/api/projects/{id}": {
431
+ parameters: {
432
+ query?: never;
433
+ header?: never;
434
+ path?: never;
435
+ cookie?: never;
436
+ };
437
+ get?: never;
438
+ put?: never;
439
+ post?: never;
440
+ /**
441
+ * Delete a context
442
+ * @description Deletes the context, detaches its files and returns its conversations to the general list.
443
+ */
444
+ delete: operations["deleteProject"];
445
+ options?: never;
446
+ head?: never;
447
+ patch?: never;
448
+ trace?: never;
449
+ };
450
+ "/api/projects/{id}/files": {
451
+ parameters: {
452
+ query?: never;
453
+ header?: never;
454
+ path?: never;
455
+ cookie?: never;
456
+ };
457
+ /** List a context's files */
458
+ get: operations["listProjectFiles"];
459
+ put?: never;
460
+ /**
461
+ * Attach a file to a context, or replace one by supplying its identifier
462
+ * @description Attaches a text file to the context named by project_id in the body. When the body carries the identifier of an existing file, that file is replaced instead and no new file is attached. At most ten files of 8000 characters are kept per context.
463
+ */
464
+ post: operations["attachProjectFile"];
465
+ delete?: never;
466
+ options?: never;
467
+ head?: never;
468
+ patch?: never;
469
+ trace?: never;
470
+ };
471
+ "/api/project-files/{id}": {
472
+ parameters: {
473
+ query?: never;
474
+ header?: never;
475
+ path?: never;
476
+ cookie?: never;
477
+ };
478
+ get?: never;
479
+ put?: never;
480
+ post?: never;
481
+ /** Detach a file from its context */
482
+ delete: operations["detachProjectFile"];
483
+ options?: never;
484
+ head?: never;
485
+ patch?: never;
486
+ trace?: never;
487
+ };
488
+ "/api/lane": {
489
+ parameters: {
490
+ query?: never;
491
+ header?: never;
492
+ path?: never;
493
+ cookie?: never;
494
+ };
495
+ get?: never;
496
+ put?: never;
497
+ /**
498
+ * Query one named experimental lane
499
+ * @description Retrieves from a single named experimental corpus (the comparison levels of the annealment measurement) without touching the production index.
500
+ */
501
+ post: operations["laneQuery"];
502
+ delete?: never;
503
+ options?: never;
504
+ head?: never;
505
+ patch?: never;
506
+ trace?: never;
507
+ };
508
+ "/v1/lane": {
509
+ parameters: {
510
+ query?: never;
511
+ header?: never;
512
+ path?: never;
513
+ cookie?: never;
514
+ };
515
+ get?: never;
516
+ put?: never;
517
+ /**
518
+ * Query one named experimental lane with an API key
519
+ * @description Identical to /api/lane, with authentication by API key and a per-key daily allowance.
520
+ */
521
+ post: operations["laneKeyed"];
522
+ delete?: never;
523
+ options?: never;
524
+ head?: never;
525
+ patch?: never;
526
+ trace?: never;
527
+ };
528
+ "/api/feedback": {
529
+ parameters: {
530
+ query?: never;
531
+ header?: never;
532
+ path?: never;
533
+ cookie?: never;
534
+ };
535
+ get?: never;
536
+ put?: never;
537
+ /**
538
+ * Rate an answer
539
+ * @description Records a thumbs rating against the query hash, which the feedback triage clusters for review.
540
+ */
541
+ post: operations["feedback"];
542
+ delete?: never;
543
+ options?: never;
544
+ head?: never;
545
+ patch?: never;
546
+ trace?: never;
547
+ };
548
+ "/v1/admin/enrich": {
549
+ parameters: {
550
+ query?: never;
551
+ header?: never;
552
+ path?: never;
553
+ cookie?: never;
554
+ };
555
+ get?: never;
556
+ put?: never;
557
+ /**
558
+ * The enrichment driver
559
+ * @description Batches chunks through the contextual-enrichment lane, with the per-chunk contexts cached server-side. The default mode writes to the production index; callers that only want the generated contexts pass mode context.
560
+ */
561
+ post: operations["adminEnrich"];
562
+ delete?: never;
563
+ options?: never;
564
+ head?: never;
565
+ patch?: never;
566
+ trace?: never;
567
+ };
568
+ "/admin/enrich": {
569
+ parameters: {
570
+ query?: never;
571
+ header?: never;
572
+ path?: never;
573
+ cookie?: never;
574
+ };
575
+ get?: never;
576
+ put?: never;
577
+ /**
578
+ * The enrichment driver (the operational path)
579
+ * @description The operational alias of /v1/admin/enrich, which the ingestion tooling calls; the behaviour and the credential are identical.
580
+ */
581
+ post: operations["adminEnrichAlias"];
582
+ delete?: never;
583
+ options?: never;
584
+ head?: never;
585
+ patch?: never;
586
+ trace?: never;
587
+ };
588
+ "/v1/admin/section": {
589
+ parameters: {
590
+ query?: never;
591
+ header?: never;
592
+ path?: never;
593
+ cookie?: never;
594
+ };
595
+ get?: never;
596
+ put?: never;
597
+ /**
598
+ * Write the section-summary units
599
+ * @description Generates a summary of each named top-level clause from its child chunks' excerpts, embeds it together with the table-of-contents path and upserts it as a navigation node, so that retrieval can descend from the summary to the quotable leaf clauses. Accepts at most six units per call; the credential and the batching mirror the enrichment driver.
600
+ */
601
+ post: operations["adminSection"];
602
+ delete?: never;
603
+ options?: never;
604
+ head?: never;
605
+ patch?: never;
606
+ trace?: never;
607
+ };
608
+ "/admin/section": {
609
+ parameters: {
610
+ query?: never;
611
+ header?: never;
612
+ path?: never;
613
+ cookie?: never;
614
+ };
615
+ get?: never;
616
+ put?: never;
617
+ /**
618
+ * Write the section-summary units (the operational path)
619
+ * @description The operational alias of /v1/admin/section; the behaviour and the credential are identical.
620
+ */
621
+ post: operations["adminSectionAlias"];
622
+ delete?: never;
623
+ options?: never;
624
+ head?: never;
625
+ patch?: never;
626
+ trace?: never;
627
+ };
628
+ "/admin/vectors": {
629
+ parameters: {
630
+ query?: never;
631
+ header?: never;
632
+ path?: never;
633
+ cookie?: never;
634
+ };
635
+ get?: never;
636
+ put?: never;
637
+ /**
638
+ * The vector admin route
639
+ * @description Embeds, upserts or reads index vectors by identifier through the binding lane, in batches of at most twenty identifiers; the binding is the credential, gated by the administrator token like the enrichment driver.
640
+ */
641
+ post: operations["adminVectors"];
642
+ delete?: never;
643
+ options?: never;
644
+ head?: never;
645
+ patch?: never;
646
+ trace?: never;
647
+ };
648
+ "/admin/caption": {
649
+ parameters: {
650
+ query?: never;
651
+ header?: never;
652
+ path?: never;
653
+ cookie?: never;
654
+ };
655
+ get?: never;
656
+ put?: never;
657
+ /**
658
+ * Caption one figure asset
659
+ * @description Fetches the named unit's figure asset from the object store, describes it with the vision-capable answer model and stores the description into the unit's payload. The operation is idempotent.
660
+ */
661
+ post: operations["adminCaption"];
662
+ delete?: never;
663
+ options?: never;
664
+ head?: never;
665
+ patch?: never;
666
+ trace?: never;
667
+ };
668
+ "/v1/admin/judge": {
669
+ parameters: {
670
+ query?: never;
671
+ header?: never;
672
+ path?: never;
673
+ cookie?: never;
674
+ };
675
+ get?: never;
676
+ put?: never;
677
+ /**
678
+ * Judge one answer against its passages
679
+ * @description Scores an answer's faithfulness and relevancy against the passages it claims to rest on, with a model that took no part in generating the answer. The promotion gate and the evaluation harness call this lane.
680
+ */
681
+ post: operations["adminJudge"];
682
+ delete?: never;
683
+ options?: never;
684
+ head?: never;
685
+ patch?: never;
686
+ trace?: never;
687
+ };
688
+ "/admin/judge": {
689
+ parameters: {
690
+ query?: never;
691
+ header?: never;
692
+ path?: never;
693
+ cookie?: never;
694
+ };
695
+ get?: never;
696
+ put?: never;
697
+ /**
698
+ * Judge one answer against its passages (the operational path)
699
+ * @description The operational alias of /v1/admin/judge; the behaviour and the credential are identical.
700
+ */
701
+ post: operations["adminJudgeAlias"];
702
+ delete?: never;
703
+ options?: never;
704
+ head?: never;
705
+ patch?: never;
706
+ trace?: never;
707
+ };
708
+ "/v1/admin/keys/{id}": {
709
+ parameters: {
710
+ query?: never;
711
+ header?: never;
712
+ path?: never;
713
+ cookie?: never;
714
+ };
715
+ get?: never;
716
+ put?: never;
717
+ post?: never;
718
+ /** Revoke an API key */
719
+ delete: operations["adminRevokeKey"];
720
+ options?: never;
721
+ head?: never;
722
+ patch?: never;
723
+ trace?: never;
724
+ };
725
+ "/auth/me": {
726
+ parameters: {
727
+ query?: never;
728
+ header?: never;
729
+ path?: never;
730
+ cookie?: never;
731
+ };
732
+ /**
733
+ * Report the caller's session state
734
+ * @description Reports whether the caller is signed in, together with the display name, the email and the estate roles when a session is present. The console uses this endpoint to state who is signed in.
735
+ */
736
+ get: operations["authMe"];
737
+ put?: never;
738
+ post?: never;
739
+ delete?: never;
740
+ options?: never;
741
+ head?: never;
742
+ patch?: never;
743
+ trace?: never;
744
+ };
745
+ "/auth/login": {
746
+ parameters: {
747
+ query?: never;
748
+ header?: never;
749
+ path?: never;
750
+ cookie?: never;
751
+ };
752
+ /**
753
+ * Begin sign-in
754
+ * @description Redirects to the estate's identity service with the OIDC authorization-code and PKCE parameters; the callback completes the sign-in and mints the session cookie.
755
+ */
756
+ get: operations["authLogin"];
757
+ put?: never;
758
+ post?: never;
759
+ delete?: never;
760
+ options?: never;
761
+ head?: never;
762
+ patch?: never;
763
+ trace?: never;
764
+ };
765
+ "/auth/callback": {
766
+ parameters: {
767
+ query?: never;
768
+ header?: never;
769
+ path?: never;
770
+ cookie?: never;
771
+ };
772
+ /**
773
+ * Complete sign-in
774
+ * @description The identity service's redirect target; completes the authorization-code exchange, mints the session cookie and returns the caller to the page they began from.
775
+ */
776
+ get: operations["authCallback"];
777
+ put?: never;
778
+ post?: never;
779
+ delete?: never;
780
+ options?: never;
781
+ head?: never;
782
+ patch?: never;
783
+ trace?: never;
784
+ };
785
+ "/auth/logout": {
786
+ parameters: {
787
+ query?: never;
788
+ header?: never;
789
+ path?: never;
790
+ cookie?: never;
791
+ };
792
+ /**
793
+ * End the session (the link form)
794
+ * @description The same operation as the post, provided so that a plain link can end the session.
795
+ */
796
+ get: operations["authLogoutLink"];
797
+ put?: never;
798
+ /** End the session */
799
+ post: operations["authLogout"];
800
+ delete?: never;
801
+ options?: never;
802
+ head?: never;
803
+ patch?: never;
804
+ trace?: never;
805
+ };
806
+ "/v1/admin/stats": {
807
+ parameters: {
808
+ query?: never;
809
+ header?: never;
810
+ path?: never;
811
+ cookie?: never;
812
+ };
813
+ /**
814
+ * Service statistics
815
+ * @description Reports the query volume by day and tier, the spend by model, the feedback counts, the answer-cache mix and the conversation count over a seven-day window.
816
+ */
817
+ get: operations["adminStats"];
818
+ put?: never;
819
+ post?: never;
820
+ delete?: never;
821
+ options?: never;
822
+ head?: never;
823
+ patch?: never;
824
+ trace?: never;
825
+ };
826
+ "/v1/admin/keys": {
827
+ parameters: {
828
+ query?: never;
829
+ header?: never;
830
+ path?: never;
831
+ cookie?: never;
832
+ };
833
+ /** List the issued API keys */
834
+ get: operations["adminListKeys"];
835
+ put?: never;
836
+ /**
837
+ * Issue an API key
838
+ * @description Issues an API key carrying its own daily allowance. The plaintext key is returned once and the store holds its hash only.
839
+ */
840
+ post: operations["adminCreateKey"];
841
+ delete?: never;
842
+ options?: never;
843
+ head?: never;
844
+ patch?: never;
845
+ trace?: never;
846
+ };
847
+ }
848
+ export type webhooks = Record<string, never>;
849
+ export interface components {
850
+ schemas: {
851
+ AskRequest: {
852
+ /** @description The question, at most 8000 characters. */
853
+ query: string;
854
+ /**
855
+ * @description When true, the response is a server-sent event stream whose events carry citations, tokens and the completion marker.
856
+ * @default false
857
+ */
858
+ stream: boolean;
859
+ /**
860
+ * @description Regenerates the answer and skips the answer caches, so the response also carries the grounding passages in context. Evaluation callers use it to observe what the answer was built from.
861
+ * @default false
862
+ */
863
+ fresh: boolean;
864
+ /** @description Forces the answer language, for example en or fr. */
865
+ lang?: string;
866
+ /** @description The previous question, for conversational context. */
867
+ prev?: string;
868
+ /** @description Recent turns, for conversational context. */
869
+ history?: {
870
+ /** @enum {string} */
871
+ role?: "user" | "assistant";
872
+ content?: string;
873
+ }[];
874
+ /** @description An application context, such as a certificate entity, that scopes the retrieval to the document the context names. */
875
+ context?: Record<string, never>;
876
+ };
877
+ AskResponse: {
878
+ /** @description The generated answer. */
879
+ answer?: string;
880
+ /** @description The passages the answer rests on. */
881
+ citations?: {
882
+ /** @description For example, OIML R 60-1. */
883
+ docidentifier?: string;
884
+ edition?: string;
885
+ /** @description The clause */
886
+ clause_anchor?: string;
887
+ clause_title?: string;
888
+ /** @description clean */
889
+ corpus?: string;
890
+ /** @description in-force */
891
+ status?: string;
892
+ /** Format: uri */
893
+ url?: string;
894
+ }[];
895
+ /** @description The typed objects the answer carries, such as tables, verdicts and unit blocks. */
896
+ blocks?: Record<string, never>[];
897
+ /** @description The model that generated the answer. */
898
+ model?: string;
899
+ /** @description The hash of the question, used for feedback. */
900
+ query_hash?: string;
901
+ /** @description The remaining daily allowance. */
902
+ quota?: Record<string, never>;
903
+ };
904
+ };
905
+ responses: never;
906
+ parameters: never;
907
+ requestBodies: never;
908
+ headers: never;
909
+ pathItems: never;
910
+ }
911
+ export type $defs = Record<string, never>;
912
+ export interface operations {
913
+ askAnonymous: {
914
+ parameters: {
915
+ query?: never;
916
+ header?: never;
917
+ path?: never;
918
+ cookie?: never;
919
+ };
920
+ requestBody: {
921
+ content: {
922
+ "application/json": components["schemas"]["AskRequest"];
923
+ };
924
+ };
925
+ responses: {
926
+ /** @description The answer with citations and typed blocks. */
927
+ 200: {
928
+ headers: {
929
+ [name: string]: unknown;
930
+ };
931
+ content: {
932
+ "application/json": components["schemas"]["AskResponse"];
933
+ };
934
+ };
935
+ /** @description The query is missing or exceeds 8000 characters. */
936
+ 400: {
937
+ headers: {
938
+ [name: string]: unknown;
939
+ };
940
+ content?: never;
941
+ };
942
+ /** @description The daily allowance is exhausted. */
943
+ 429: {
944
+ headers: {
945
+ [name: string]: unknown;
946
+ };
947
+ content?: never;
948
+ };
949
+ };
950
+ };
951
+ askKeyed: {
952
+ parameters: {
953
+ query?: never;
954
+ header?: never;
955
+ path?: never;
956
+ cookie?: never;
957
+ };
958
+ requestBody: {
959
+ content: {
960
+ "application/json": components["schemas"]["AskRequest"];
961
+ };
962
+ };
963
+ responses: {
964
+ /** @description The answer with citations and typed blocks. */
965
+ 200: {
966
+ headers: {
967
+ [name: string]: unknown;
968
+ };
969
+ content: {
970
+ "application/json": components["schemas"]["AskResponse"];
971
+ };
972
+ };
973
+ };
974
+ };
975
+ search: {
976
+ parameters: {
977
+ query?: never;
978
+ header?: never;
979
+ path?: never;
980
+ cookie?: never;
981
+ };
982
+ requestBody: {
983
+ content: {
984
+ "application/json": {
985
+ /** @description The search text, at most 8000 characters. */
986
+ query: string;
987
+ /**
988
+ * @description The number of hits to return.
989
+ * @default 5
990
+ */
991
+ k?: number;
992
+ };
993
+ };
994
+ };
995
+ responses: {
996
+ /** @description The ranked hits. */
997
+ 200: {
998
+ headers: {
999
+ [name: string]: unknown;
1000
+ };
1001
+ content?: never;
1002
+ };
1003
+ };
1004
+ };
1005
+ searchKeyed: {
1006
+ parameters: {
1007
+ query?: never;
1008
+ header?: never;
1009
+ path?: never;
1010
+ cookie?: never;
1011
+ };
1012
+ requestBody: {
1013
+ content: {
1014
+ "application/json": {
1015
+ query: string;
1016
+ /** @default 5 */
1017
+ k?: number;
1018
+ };
1019
+ };
1020
+ };
1021
+ responses: {
1022
+ /** @description The ranked hits. */
1023
+ 200: {
1024
+ headers: {
1025
+ [name: string]: unknown;
1026
+ };
1027
+ content?: never;
1028
+ };
1029
+ };
1030
+ };
1031
+ absence: {
1032
+ parameters: {
1033
+ query?: never;
1034
+ header?: never;
1035
+ path?: never;
1036
+ cookie?: never;
1037
+ };
1038
+ requestBody: {
1039
+ content: {
1040
+ "application/json": {
1041
+ /** @description The publication, for example R 60. */
1042
+ standard: string;
1043
+ /** @description The topic whose absence is to be proven. */
1044
+ topic: string;
1045
+ };
1046
+ };
1047
+ };
1048
+ responses: {
1049
+ /** @description The enumeration certificate. */
1050
+ 200: {
1051
+ headers: {
1052
+ [name: string]: unknown;
1053
+ };
1054
+ content?: never;
1055
+ };
1056
+ };
1057
+ };
1058
+ absenceKeyed: {
1059
+ parameters: {
1060
+ query?: never;
1061
+ header?: never;
1062
+ path?: never;
1063
+ cookie?: never;
1064
+ };
1065
+ requestBody: {
1066
+ content: {
1067
+ "application/json": {
1068
+ standard: string;
1069
+ topic: string;
1070
+ };
1071
+ };
1072
+ };
1073
+ responses: {
1074
+ /** @description The enumeration certificate. */
1075
+ 200: {
1076
+ headers: {
1077
+ [name: string]: unknown;
1078
+ };
1079
+ content?: never;
1080
+ };
1081
+ };
1082
+ };
1083
+ verify: {
1084
+ parameters: {
1085
+ query?: never;
1086
+ header?: never;
1087
+ path?: never;
1088
+ cookie?: never;
1089
+ };
1090
+ requestBody: {
1091
+ content: {
1092
+ "application/json": {
1093
+ /** @description The question the answer claims to answer. */
1094
+ query: string;
1095
+ /** @description The answer to verify. */
1096
+ answer: string;
1097
+ };
1098
+ };
1099
+ };
1100
+ responses: {
1101
+ /** @description The verification results. */
1102
+ 200: {
1103
+ headers: {
1104
+ [name: string]: unknown;
1105
+ };
1106
+ content?: never;
1107
+ };
1108
+ };
1109
+ };
1110
+ verifyKeyed: {
1111
+ parameters: {
1112
+ query?: never;
1113
+ header?: never;
1114
+ path?: never;
1115
+ cookie?: never;
1116
+ };
1117
+ requestBody: {
1118
+ content: {
1119
+ "application/json": {
1120
+ query: string;
1121
+ answer: string;
1122
+ };
1123
+ };
1124
+ };
1125
+ responses: {
1126
+ /** @description The verification results. */
1127
+ 200: {
1128
+ headers: {
1129
+ [name: string]: unknown;
1130
+ };
1131
+ content?: never;
1132
+ };
1133
+ };
1134
+ };
1135
+ research: {
1136
+ parameters: {
1137
+ query?: never;
1138
+ header?: never;
1139
+ path?: never;
1140
+ cookie?: never;
1141
+ };
1142
+ requestBody: {
1143
+ content: {
1144
+ "application/json": {
1145
+ /** @description The research question. */
1146
+ query: string;
1147
+ /** @description The iteration bound, at most 3. */
1148
+ max_iterations?: number;
1149
+ };
1150
+ };
1151
+ };
1152
+ responses: {
1153
+ /** @description The research result, carrying the answer, the citations, the typed blocks and the research metadata. */
1154
+ 200: {
1155
+ headers: {
1156
+ [name: string]: unknown;
1157
+ };
1158
+ content?: never;
1159
+ };
1160
+ };
1161
+ };
1162
+ researchKeyed: {
1163
+ parameters: {
1164
+ query?: never;
1165
+ header?: never;
1166
+ path?: never;
1167
+ cookie?: never;
1168
+ };
1169
+ requestBody: {
1170
+ content: {
1171
+ "application/json": {
1172
+ /** @description The research question. */
1173
+ query: string;
1174
+ /** @description The iteration bound, at most 3. */
1175
+ max_iterations?: number;
1176
+ };
1177
+ };
1178
+ };
1179
+ responses: {
1180
+ /** @description The research result, carrying the answer, the citations, the typed blocks and the research metadata, which includes the iteration count, the passages and the elapsed time. */
1181
+ 200: {
1182
+ headers: {
1183
+ [name: string]: unknown;
1184
+ };
1185
+ content?: never;
1186
+ };
1187
+ };
1188
+ };
1189
+ mcp: {
1190
+ parameters: {
1191
+ query?: never;
1192
+ header?: never;
1193
+ path?: never;
1194
+ cookie?: never;
1195
+ };
1196
+ requestBody: {
1197
+ content: {
1198
+ "application/json": {
1199
+ /** @enum {string} */
1200
+ jsonrpc: 2;
1201
+ /** @description The request identifier. */
1202
+ id?: unknown;
1203
+ /** @enum {string} */
1204
+ method: "initialize" | "ping" | "notifications/initialized" | "tools/list" | "tools/call";
1205
+ /** @description The method parameters; tools/call carries name and arguments. */
1206
+ params?: Record<string, never>;
1207
+ };
1208
+ };
1209
+ };
1210
+ responses: {
1211
+ /** @description The JSON-RPC response. */
1212
+ 200: {
1213
+ headers: {
1214
+ [name: string]: unknown;
1215
+ };
1216
+ content?: never;
1217
+ };
1218
+ /** @description The notification was accepted without a payload. */
1219
+ 202: {
1220
+ headers: {
1221
+ [name: string]: unknown;
1222
+ };
1223
+ content?: never;
1224
+ };
1225
+ };
1226
+ };
1227
+ datasets: {
1228
+ parameters: {
1229
+ query?: never;
1230
+ header?: never;
1231
+ path?: never;
1232
+ cookie?: never;
1233
+ };
1234
+ requestBody?: never;
1235
+ responses: {
1236
+ /** @description The dataset list. */
1237
+ 200: {
1238
+ headers: {
1239
+ [name: string]: unknown;
1240
+ };
1241
+ content?: never;
1242
+ };
1243
+ };
1244
+ };
1245
+ keyUsage: {
1246
+ parameters: {
1247
+ query?: never;
1248
+ header?: never;
1249
+ path?: never;
1250
+ cookie?: never;
1251
+ };
1252
+ requestBody?: never;
1253
+ responses: {
1254
+ /** @description The key's allowance and usage. */
1255
+ 200: {
1256
+ headers: {
1257
+ [name: string]: unknown;
1258
+ };
1259
+ content?: never;
1260
+ };
1261
+ /** @description No valid key was presented. */
1262
+ 401: {
1263
+ headers: {
1264
+ [name: string]: unknown;
1265
+ };
1266
+ content?: never;
1267
+ };
1268
+ };
1269
+ };
1270
+ health: {
1271
+ parameters: {
1272
+ query?: never;
1273
+ header?: never;
1274
+ path?: never;
1275
+ cookie?: never;
1276
+ };
1277
+ requestBody?: never;
1278
+ responses: {
1279
+ /** @description The health document. */
1280
+ 200: {
1281
+ headers: {
1282
+ [name: string]: unknown;
1283
+ };
1284
+ content?: never;
1285
+ };
1286
+ };
1287
+ };
1288
+ listConversations: {
1289
+ parameters: {
1290
+ query?: never;
1291
+ header?: never;
1292
+ path?: never;
1293
+ cookie?: never;
1294
+ };
1295
+ requestBody?: never;
1296
+ responses: {
1297
+ /** @description The conversation list with each conversation's context grouping. */
1298
+ 200: {
1299
+ headers: {
1300
+ [name: string]: unknown;
1301
+ };
1302
+ content?: never;
1303
+ };
1304
+ };
1305
+ };
1306
+ createConversation: {
1307
+ parameters: {
1308
+ query?: never;
1309
+ header?: never;
1310
+ path?: never;
1311
+ cookie?: never;
1312
+ };
1313
+ requestBody: {
1314
+ content: {
1315
+ "application/json": {
1316
+ /** @description The conversation's title, at most 120 characters. */
1317
+ title?: string;
1318
+ };
1319
+ };
1320
+ };
1321
+ responses: {
1322
+ /** @description The created conversation, with its identifier. */
1323
+ 200: {
1324
+ headers: {
1325
+ [name: string]: unknown;
1326
+ };
1327
+ content?: never;
1328
+ };
1329
+ };
1330
+ };
1331
+ getConversation: {
1332
+ parameters: {
1333
+ query?: never;
1334
+ header?: never;
1335
+ path: {
1336
+ id: string;
1337
+ };
1338
+ cookie?: never;
1339
+ };
1340
+ requestBody?: never;
1341
+ responses: {
1342
+ /** @description The conversation with its messages. */
1343
+ 200: {
1344
+ headers: {
1345
+ [name: string]: unknown;
1346
+ };
1347
+ content?: never;
1348
+ };
1349
+ };
1350
+ };
1351
+ deleteConversation: {
1352
+ parameters: {
1353
+ query?: never;
1354
+ header?: never;
1355
+ path: {
1356
+ id: string;
1357
+ };
1358
+ cookie?: never;
1359
+ };
1360
+ requestBody?: never;
1361
+ responses: {
1362
+ /** @description The conversation is deleted. */
1363
+ 200: {
1364
+ headers: {
1365
+ [name: string]: unknown;
1366
+ };
1367
+ content?: never;
1368
+ };
1369
+ };
1370
+ };
1371
+ renameConversation: {
1372
+ parameters: {
1373
+ query?: never;
1374
+ header?: never;
1375
+ path: {
1376
+ id: string;
1377
+ };
1378
+ cookie?: never;
1379
+ };
1380
+ requestBody: {
1381
+ content: {
1382
+ "application/json": {
1383
+ /** @description The new title, between 1 and 120 characters. */
1384
+ title: string;
1385
+ };
1386
+ };
1387
+ };
1388
+ responses: {
1389
+ /** @description The updated conversation. */
1390
+ 200: {
1391
+ headers: {
1392
+ [name: string]: unknown;
1393
+ };
1394
+ content?: never;
1395
+ };
1396
+ };
1397
+ };
1398
+ appendMessage: {
1399
+ parameters: {
1400
+ query?: never;
1401
+ header?: never;
1402
+ path: {
1403
+ id: string;
1404
+ };
1405
+ cookie?: never;
1406
+ };
1407
+ requestBody: {
1408
+ content: {
1409
+ "application/json": {
1410
+ /** @enum {string} */
1411
+ role: "user" | "assistant";
1412
+ content: string;
1413
+ };
1414
+ };
1415
+ };
1416
+ responses: {
1417
+ /** @description The appended message. */
1418
+ 200: {
1419
+ headers: {
1420
+ [name: string]: unknown;
1421
+ };
1422
+ content?: never;
1423
+ };
1424
+ };
1425
+ };
1426
+ shareConversation: {
1427
+ parameters: {
1428
+ query?: never;
1429
+ header?: never;
1430
+ path: {
1431
+ id: string;
1432
+ };
1433
+ cookie?: never;
1434
+ };
1435
+ requestBody?: never;
1436
+ responses: {
1437
+ /** @description The permalink slug. */
1438
+ 200: {
1439
+ headers: {
1440
+ [name: string]: unknown;
1441
+ };
1442
+ content?: never;
1443
+ };
1444
+ };
1445
+ };
1446
+ getShared: {
1447
+ parameters: {
1448
+ query?: never;
1449
+ header?: never;
1450
+ path: {
1451
+ slug: string;
1452
+ };
1453
+ cookie?: never;
1454
+ };
1455
+ requestBody?: never;
1456
+ responses: {
1457
+ /** @description The shared conversation, without member identity. */
1458
+ 200: {
1459
+ headers: {
1460
+ [name: string]: unknown;
1461
+ };
1462
+ content?: never;
1463
+ };
1464
+ };
1465
+ };
1466
+ listMemories: {
1467
+ parameters: {
1468
+ query?: never;
1469
+ header?: never;
1470
+ path?: never;
1471
+ cookie?: never;
1472
+ };
1473
+ requestBody?: never;
1474
+ responses: {
1475
+ /** @description The memory notes. */
1476
+ 200: {
1477
+ headers: {
1478
+ [name: string]: unknown;
1479
+ };
1480
+ content?: never;
1481
+ };
1482
+ };
1483
+ };
1484
+ createMemory: {
1485
+ parameters: {
1486
+ query?: never;
1487
+ header?: never;
1488
+ path?: never;
1489
+ cookie?: never;
1490
+ };
1491
+ requestBody: {
1492
+ content: {
1493
+ "application/json": {
1494
+ /** @description The note's name */
1495
+ name: string;
1496
+ /** @description The note's text */
1497
+ content: string;
1498
+ /** @description The identifier of the note to replace; when absent, a new note is created. */
1499
+ id?: string;
1500
+ };
1501
+ };
1502
+ };
1503
+ responses: {
1504
+ /** @description The created or replaced note. */
1505
+ 200: {
1506
+ headers: {
1507
+ [name: string]: unknown;
1508
+ };
1509
+ content?: never;
1510
+ };
1511
+ };
1512
+ };
1513
+ deleteMemory: {
1514
+ parameters: {
1515
+ query?: never;
1516
+ header?: never;
1517
+ path: {
1518
+ id: string;
1519
+ };
1520
+ cookie?: never;
1521
+ };
1522
+ requestBody?: never;
1523
+ responses: {
1524
+ /** @description The note is deleted. */
1525
+ 200: {
1526
+ headers: {
1527
+ [name: string]: unknown;
1528
+ };
1529
+ content?: never;
1530
+ };
1531
+ };
1532
+ };
1533
+ listProjects: {
1534
+ parameters: {
1535
+ query?: never;
1536
+ header?: never;
1537
+ path?: never;
1538
+ cookie?: never;
1539
+ };
1540
+ requestBody?: never;
1541
+ responses: {
1542
+ /** @description The contexts with their conversation counts and file counts. */
1543
+ 200: {
1544
+ headers: {
1545
+ [name: string]: unknown;
1546
+ };
1547
+ content?: never;
1548
+ };
1549
+ };
1550
+ };
1551
+ createProject: {
1552
+ parameters: {
1553
+ query?: never;
1554
+ header?: never;
1555
+ path?: never;
1556
+ cookie?: never;
1557
+ };
1558
+ requestBody: {
1559
+ content: {
1560
+ "application/json": {
1561
+ /** @description The context's name, at most 64 characters; creates or renames. */
1562
+ name?: string;
1563
+ /** @description The identifier of the context to rename; when absent, a new context is created. */
1564
+ id?: string;
1565
+ /** @description The conversation to file; selects the move behaviour. */
1566
+ conversation_id?: string;
1567
+ /** @description The target context, or null to unfile the conversation. */
1568
+ project_id?: string | null;
1569
+ };
1570
+ };
1571
+ };
1572
+ responses: {
1573
+ /** @description The created or renamed context, or the move confirmation. */
1574
+ 200: {
1575
+ headers: {
1576
+ [name: string]: unknown;
1577
+ };
1578
+ content?: never;
1579
+ };
1580
+ };
1581
+ };
1582
+ deleteProject: {
1583
+ parameters: {
1584
+ query?: never;
1585
+ header?: never;
1586
+ path: {
1587
+ id: string;
1588
+ };
1589
+ cookie?: never;
1590
+ };
1591
+ requestBody?: never;
1592
+ responses: {
1593
+ /** @description The context is deleted. */
1594
+ 200: {
1595
+ headers: {
1596
+ [name: string]: unknown;
1597
+ };
1598
+ content?: never;
1599
+ };
1600
+ };
1601
+ };
1602
+ listProjectFiles: {
1603
+ parameters: {
1604
+ query?: never;
1605
+ header?: never;
1606
+ path: {
1607
+ id: string;
1608
+ };
1609
+ cookie?: never;
1610
+ };
1611
+ requestBody?: never;
1612
+ responses: {
1613
+ /** @description The context's files. */
1614
+ 200: {
1615
+ headers: {
1616
+ [name: string]: unknown;
1617
+ };
1618
+ content?: never;
1619
+ };
1620
+ };
1621
+ };
1622
+ attachProjectFile: {
1623
+ parameters: {
1624
+ query?: never;
1625
+ header?: never;
1626
+ path: {
1627
+ id: string;
1628
+ };
1629
+ cookie?: never;
1630
+ };
1631
+ requestBody: {
1632
+ content: {
1633
+ "application/json": {
1634
+ /** @description The context to attach the file to. */
1635
+ project_id: string;
1636
+ /** @description The file's name */
1637
+ name: string;
1638
+ /** @description The file's text */
1639
+ content: string;
1640
+ /** @description The identifier of the file to replace; when absent, a new file is attached. */
1641
+ id?: string;
1642
+ };
1643
+ };
1644
+ };
1645
+ responses: {
1646
+ /** @description The attached or replaced file. */
1647
+ 200: {
1648
+ headers: {
1649
+ [name: string]: unknown;
1650
+ };
1651
+ content?: never;
1652
+ };
1653
+ };
1654
+ };
1655
+ detachProjectFile: {
1656
+ parameters: {
1657
+ query?: never;
1658
+ header?: never;
1659
+ path: {
1660
+ id: string;
1661
+ };
1662
+ cookie?: never;
1663
+ };
1664
+ requestBody?: never;
1665
+ responses: {
1666
+ /** @description The file is detached. */
1667
+ 200: {
1668
+ headers: {
1669
+ [name: string]: unknown;
1670
+ };
1671
+ content?: never;
1672
+ };
1673
+ };
1674
+ };
1675
+ laneQuery: {
1676
+ parameters: {
1677
+ query?: never;
1678
+ header?: never;
1679
+ path?: never;
1680
+ cookie?: never;
1681
+ };
1682
+ requestBody: {
1683
+ content: {
1684
+ "application/json": {
1685
+ /** @description The experimental corpus to query. */
1686
+ lane: string;
1687
+ query: string;
1688
+ };
1689
+ };
1690
+ };
1691
+ responses: {
1692
+ /** @description The lane's ranked hits. */
1693
+ 200: {
1694
+ headers: {
1695
+ [name: string]: unknown;
1696
+ };
1697
+ content?: never;
1698
+ };
1699
+ };
1700
+ };
1701
+ laneKeyed: {
1702
+ parameters: {
1703
+ query?: never;
1704
+ header?: never;
1705
+ path?: never;
1706
+ cookie?: never;
1707
+ };
1708
+ requestBody: {
1709
+ content: {
1710
+ "application/json": {
1711
+ lane: string;
1712
+ query: string;
1713
+ };
1714
+ };
1715
+ };
1716
+ responses: {
1717
+ /** @description The lane's ranked hits. */
1718
+ 200: {
1719
+ headers: {
1720
+ [name: string]: unknown;
1721
+ };
1722
+ content?: never;
1723
+ };
1724
+ };
1725
+ };
1726
+ feedback: {
1727
+ parameters: {
1728
+ query?: never;
1729
+ header?: never;
1730
+ path?: never;
1731
+ cookie?: never;
1732
+ };
1733
+ requestBody: {
1734
+ content: {
1735
+ "application/json": {
1736
+ query_hash: string;
1737
+ /** @enum {integer} */
1738
+ rating: 1 | -1;
1739
+ };
1740
+ };
1741
+ };
1742
+ responses: {
1743
+ /** @description The rating is recorded. */
1744
+ 200: {
1745
+ headers: {
1746
+ [name: string]: unknown;
1747
+ };
1748
+ content?: never;
1749
+ };
1750
+ };
1751
+ };
1752
+ adminEnrich: {
1753
+ parameters: {
1754
+ query?: never;
1755
+ header?: never;
1756
+ path?: never;
1757
+ cookie?: never;
1758
+ };
1759
+ requestBody: {
1760
+ content: {
1761
+ "application/json": {
1762
+ /** @description The chunks to enrich. */
1763
+ chunks?: unknown[];
1764
+ /** @enum {string} */
1765
+ mode?: "default" | "context" | "ab";
1766
+ /** @enum {string} */
1767
+ effort?: "low" | "high";
1768
+ };
1769
+ };
1770
+ };
1771
+ responses: {
1772
+ /** @description The enrichment results. */
1773
+ 200: {
1774
+ headers: {
1775
+ [name: string]: unknown;
1776
+ };
1777
+ content?: never;
1778
+ };
1779
+ };
1780
+ };
1781
+ adminEnrichAlias: {
1782
+ parameters: {
1783
+ query?: never;
1784
+ header?: never;
1785
+ path?: never;
1786
+ cookie?: never;
1787
+ };
1788
+ requestBody: {
1789
+ content: {
1790
+ "application/json": {
1791
+ /** @description The chunks to enrich. */
1792
+ chunks?: unknown[];
1793
+ /** @enum {string} */
1794
+ mode?: "default" | "context" | "ab";
1795
+ /** @enum {string} */
1796
+ effort?: "low" | "high";
1797
+ };
1798
+ };
1799
+ };
1800
+ responses: {
1801
+ /** @description The enrichment results. */
1802
+ 200: {
1803
+ headers: {
1804
+ [name: string]: unknown;
1805
+ };
1806
+ content?: never;
1807
+ };
1808
+ };
1809
+ };
1810
+ adminSection: {
1811
+ parameters: {
1812
+ query?: never;
1813
+ header?: never;
1814
+ path?: never;
1815
+ cookie?: never;
1816
+ };
1817
+ requestBody: {
1818
+ content: {
1819
+ "application/json": {
1820
+ /** @description The section units to write. */
1821
+ units: unknown[];
1822
+ };
1823
+ };
1824
+ };
1825
+ responses: {
1826
+ /** @description The written units with their usage. */
1827
+ 200: {
1828
+ headers: {
1829
+ [name: string]: unknown;
1830
+ };
1831
+ content?: never;
1832
+ };
1833
+ };
1834
+ };
1835
+ adminSectionAlias: {
1836
+ parameters: {
1837
+ query?: never;
1838
+ header?: never;
1839
+ path?: never;
1840
+ cookie?: never;
1841
+ };
1842
+ requestBody: {
1843
+ content: {
1844
+ "application/json": {
1845
+ units: unknown[];
1846
+ };
1847
+ };
1848
+ };
1849
+ responses: {
1850
+ /** @description The written units with their usage. */
1851
+ 200: {
1852
+ headers: {
1853
+ [name: string]: unknown;
1854
+ };
1855
+ content?: never;
1856
+ };
1857
+ };
1858
+ };
1859
+ adminVectors: {
1860
+ parameters: {
1861
+ query?: never;
1862
+ header?: never;
1863
+ path?: never;
1864
+ cookie?: never;
1865
+ };
1866
+ requestBody: {
1867
+ content: {
1868
+ "application/json": {
1869
+ /** @enum {string} */
1870
+ mode?: "get" | "upsert" | "embed";
1871
+ ids?: string[];
1872
+ vectors?: unknown[];
1873
+ };
1874
+ };
1875
+ };
1876
+ responses: {
1877
+ /** @description The requested vectors or the operation result. */
1878
+ 200: {
1879
+ headers: {
1880
+ [name: string]: unknown;
1881
+ };
1882
+ content?: never;
1883
+ };
1884
+ };
1885
+ };
1886
+ adminCaption: {
1887
+ parameters: {
1888
+ query?: never;
1889
+ header?: never;
1890
+ path?: never;
1891
+ cookie?: never;
1892
+ };
1893
+ requestBody: {
1894
+ content: {
1895
+ "application/json": {
1896
+ /** @description The figure unit to caption. */
1897
+ unit_id: string;
1898
+ /** @description Surrounding clause text, at most 400 characters, to steer the description. */
1899
+ context?: string;
1900
+ };
1901
+ };
1902
+ };
1903
+ responses: {
1904
+ /** @description The stored description. */
1905
+ 200: {
1906
+ headers: {
1907
+ [name: string]: unknown;
1908
+ };
1909
+ content?: never;
1910
+ };
1911
+ };
1912
+ };
1913
+ adminJudge: {
1914
+ parameters: {
1915
+ query?: never;
1916
+ header?: never;
1917
+ path?: never;
1918
+ cookie?: never;
1919
+ };
1920
+ requestBody: {
1921
+ content: {
1922
+ "application/json": {
1923
+ /** @description The question */
1924
+ question: string;
1925
+ /** @description The answer */
1926
+ answer: string;
1927
+ /** @description The passages, each at most 600 characters. */
1928
+ passages?: string[];
1929
+ };
1930
+ };
1931
+ };
1932
+ responses: {
1933
+ /** @description The verdict with its scores. */
1934
+ 200: {
1935
+ headers: {
1936
+ [name: string]: unknown;
1937
+ };
1938
+ content?: never;
1939
+ };
1940
+ };
1941
+ };
1942
+ adminJudgeAlias: {
1943
+ parameters: {
1944
+ query?: never;
1945
+ header?: never;
1946
+ path?: never;
1947
+ cookie?: never;
1948
+ };
1949
+ requestBody: {
1950
+ content: {
1951
+ "application/json": {
1952
+ question: string;
1953
+ answer: string;
1954
+ passages?: string[];
1955
+ };
1956
+ };
1957
+ };
1958
+ responses: {
1959
+ /** @description The verdict with its scores. */
1960
+ 200: {
1961
+ headers: {
1962
+ [name: string]: unknown;
1963
+ };
1964
+ content?: never;
1965
+ };
1966
+ };
1967
+ };
1968
+ adminRevokeKey: {
1969
+ parameters: {
1970
+ query?: never;
1971
+ header?: never;
1972
+ path: {
1973
+ id: string;
1974
+ };
1975
+ cookie?: never;
1976
+ };
1977
+ requestBody?: never;
1978
+ responses: {
1979
+ /** @description The key is revoked. */
1980
+ 200: {
1981
+ headers: {
1982
+ [name: string]: unknown;
1983
+ };
1984
+ content?: never;
1985
+ };
1986
+ };
1987
+ };
1988
+ authMe: {
1989
+ parameters: {
1990
+ query?: never;
1991
+ header?: never;
1992
+ path?: never;
1993
+ cookie?: never;
1994
+ };
1995
+ requestBody?: never;
1996
+ responses: {
1997
+ /** @description The session state. */
1998
+ 200: {
1999
+ headers: {
2000
+ [name: string]: unknown;
2001
+ };
2002
+ content?: never;
2003
+ };
2004
+ };
2005
+ };
2006
+ authLogin: {
2007
+ parameters: {
2008
+ query?: never;
2009
+ header?: never;
2010
+ path?: never;
2011
+ cookie?: never;
2012
+ };
2013
+ requestBody?: never;
2014
+ responses: {
2015
+ /** @description The redirect to the identity service. */
2016
+ 302: {
2017
+ headers: {
2018
+ [name: string]: unknown;
2019
+ };
2020
+ content?: never;
2021
+ };
2022
+ };
2023
+ };
2024
+ authCallback: {
2025
+ parameters: {
2026
+ query?: never;
2027
+ header?: never;
2028
+ path?: never;
2029
+ cookie?: never;
2030
+ };
2031
+ requestBody?: never;
2032
+ responses: {
2033
+ /** @description The redirect after sign-in completes. */
2034
+ 302: {
2035
+ headers: {
2036
+ [name: string]: unknown;
2037
+ };
2038
+ content?: never;
2039
+ };
2040
+ };
2041
+ };
2042
+ authLogoutLink: {
2043
+ parameters: {
2044
+ query?: never;
2045
+ header?: never;
2046
+ path?: never;
2047
+ cookie?: never;
2048
+ };
2049
+ requestBody?: never;
2050
+ responses: {
2051
+ /** @description The session is ended and the cookie is cleared. */
2052
+ 200: {
2053
+ headers: {
2054
+ [name: string]: unknown;
2055
+ };
2056
+ content?: never;
2057
+ };
2058
+ };
2059
+ };
2060
+ authLogout: {
2061
+ parameters: {
2062
+ query?: never;
2063
+ header?: never;
2064
+ path?: never;
2065
+ cookie?: never;
2066
+ };
2067
+ requestBody?: never;
2068
+ responses: {
2069
+ /** @description The session is ended and the cookie is cleared. */
2070
+ 200: {
2071
+ headers: {
2072
+ [name: string]: unknown;
2073
+ };
2074
+ content?: never;
2075
+ };
2076
+ };
2077
+ };
2078
+ adminStats: {
2079
+ parameters: {
2080
+ query?: never;
2081
+ header?: never;
2082
+ path?: never;
2083
+ cookie?: never;
2084
+ };
2085
+ requestBody?: never;
2086
+ responses: {
2087
+ /** @description The statistics document. */
2088
+ 200: {
2089
+ headers: {
2090
+ [name: string]: unknown;
2091
+ };
2092
+ content?: never;
2093
+ };
2094
+ };
2095
+ };
2096
+ adminListKeys: {
2097
+ parameters: {
2098
+ query?: never;
2099
+ header?: never;
2100
+ path?: never;
2101
+ cookie?: never;
2102
+ };
2103
+ requestBody?: never;
2104
+ responses: {
2105
+ /** @description The key registry, without plaintext. */
2106
+ 200: {
2107
+ headers: {
2108
+ [name: string]: unknown;
2109
+ };
2110
+ content?: never;
2111
+ };
2112
+ };
2113
+ };
2114
+ adminCreateKey: {
2115
+ parameters: {
2116
+ query?: never;
2117
+ header?: never;
2118
+ path?: never;
2119
+ cookie?: never;
2120
+ };
2121
+ requestBody: {
2122
+ content: {
2123
+ "application/json": {
2124
+ /** @description The key's label. */
2125
+ name: string;
2126
+ /** @description The per-day allowance. */
2127
+ day_limit?: number;
2128
+ };
2129
+ };
2130
+ };
2131
+ responses: {
2132
+ /** @description The issued key, with the plaintext returned once. */
2133
+ 200: {
2134
+ headers: {
2135
+ [name: string]: unknown;
2136
+ };
2137
+ content?: never;
2138
+ };
2139
+ };
2140
+ };
2141
+ }