-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathopenapi.yaml
More file actions
9682 lines (9487 loc) · 254 KB
/
Copy pathopenapi.yaml
File metadata and controls
9682 lines (9487 loc) · 254 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: WikiMind Gateway
description: Local LLM Knowledge OS — Personal API
version: 0.1.0
paths:
/metrics:
get:
summary: Metrics
description: Endpoint that serves Prometheus metrics.
operationId: metrics_metrics_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
/api/ingest/url:
post:
tags:
- Ingest
summary: Ingest Url
description: Ingest a web URL or YouTube video.
operationId: ingest_url_api_ingest_url_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IngestURLRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Source'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/pdf:
post:
tags:
- Ingest
summary: Ingest Pdf
description: 'Upload and ingest a PDF.
The ``auto_compile`` query parameter (default ``True``) controls whether the
source is enqueued for background compilation immediately after upload.'
operationId: ingest_pdf_api_ingest_pdf_post
parameters:
- name: auto_compile
in: query
required: false
schema:
type: boolean
default: true
title: Auto Compile
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/Body_ingest_pdf_api_ingest_pdf_post'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Source'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/text:
post:
tags:
- Ingest
summary: Ingest Text
description: Ingest raw text or a note.
operationId: ingest_text_api_ingest_text_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IngestTextRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Source'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources:
get:
tags:
- Ingest
summary: List Sources
description: List all ingested sources.
operationId: list_sources_api_ingest_sources_get
parameters:
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Status
- name: limit
in: query
required: false
schema:
type: integer
maximum: 200
minimum: 1
default: 50
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: Offset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Source'
title: Response List Sources Api Ingest Sources Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}:
get:
tags:
- Ingest
summary: Get Source
description: Get source by ID.
operationId: get_source_api_ingest_sources__source_id__get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Source'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Ingest
summary: Delete Source
description: Delete a source by ID.
operationId: delete_source_api_ingest_sources__source_id__delete
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteConfirmation'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/detail:
get:
tags:
- Ingest
summary: Get Source Detail
description: Get full source detail with pipeline steps, images, and linked
articles.
operationId: get_source_detail_api_ingest_sources__source_id__detail_get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SourceDetailResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/content:
get:
tags:
- Ingest
summary: Get Source Content
description: Return the raw text content of a source for side-by-side reading.
operationId: get_source_content_api_ingest_sources__source_id__content_get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SourceContentResponse'
'404':
description: Source not found or has no content
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/spans:
get:
tags:
- Ingest
summary: List Source Spans
description: 'Return all source spans for a source document.
Each span anchors a verbatim text excerpt to a precise location in the
original source (PDF page, byte range, HTML paragraph).'
operationId: list_source_spans_api_ingest_sources__source_id__spans_get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SourceSpanResponse'
title: Response List Source Spans Api Ingest Sources Source Id Spans
Get
'404':
description: Source not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/original:
get:
tags:
- Ingest
summary: Get Source Original
description: 'Stream the original source document (PDF, HTML, etc.).
Returns the raw binary stored during ingest — not the extracted text.
Sources that have no original (text, YouTube) return 404.'
operationId: get_source_original_api_ingest_sources__source_id__original_get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/images:
get:
tags:
- Ingest
summary: List Source Images
description: 'List extracted images for a PDF source.
Reads from the ``source_image`` table first (DB-backed storage),
falling back to the filesystem for pre-migration sources.'
operationId: list_source_images_api_ingest_sources__source_id__images_get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
type: object
additionalProperties:
type: string
title: Response List Source Images Api Ingest Sources Source Id Images
Get
'404':
description: Source not found or no images available
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/images/{filename}:
get:
tags:
- Ingest
summary: Get Source Image
description: 'Serve an extracted image file for a PDF source.
Reads from the ``source_image`` table first (DB-backed storage),
falling back to the filesystem for pre-migration sources.'
operationId: get_source_image_api_ingest_sources__source_id__images__filename__get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
- name: filename
in: path
required: true
schema:
type: string
title: Filename
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'404':
description: Image not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/ambient/configure:
post:
tags:
- Capture
summary: Configure Ambient Adapter
description: Enable or disable an ambient capture adapter.
operationId: configure_ambient_adapter_api_capture_ambient_configure_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AmbientAdapterConfigureRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AmbientAdapterStatusResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/ambient/adapters:
get:
tags:
- Capture
summary: List Ambient Adapters
description: List all configured ambient adapters.
operationId: list_ambient_adapters_api_capture_ambient_adapters_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AmbientAdapterListResponse'
/api/capture/ambient/adapters/{adapter_type}/poll:
post:
tags:
- Capture
summary: Poll Ambient Adapter
description: Manually trigger a poll for a specific ambient adapter.
operationId: poll_ambient_adapter_api_capture_ambient_adapters__adapter_type__poll_post
parameters:
- name: adapter_type
in: path
required: true
schema:
type: string
title: Adapter Type
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/AmbientPollResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture:
get:
tags:
- Capture
summary: List Captures
description: List captures (the capture inbox).
operationId: list_captures_api_capture_get
parameters:
- name: status
in: query
required: false
schema:
anyOf:
- $ref: '#/components/schemas/CaptureStatus'
- type: 'null'
title: Status
- name: kind
in: query
required: false
schema:
anyOf:
- $ref: '#/components/schemas/CaptureKind'
- type: 'null'
title: Kind
- name: limit
in: query
required: false
schema:
type: integer
maximum: 200
minimum: 1
default: 50
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: Offset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CaptureListResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/{capture_id}/ingest:
post:
tags:
- Capture
summary: Ingest Capture
description: Promote a capture to a full source for compilation.
operationId: ingest_capture_api_capture__capture_id__ingest_post
parameters:
- name: capture_id
in: path
required: true
schema:
type: string
title: Capture Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CaptureIngestResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/{capture_id}/discard:
post:
tags:
- Capture
summary: Discard Capture
description: Mark a capture as not-worth-keeping.
operationId: discard_capture_api_capture__capture_id__discard_post
parameters:
- name: capture_id
in: path
required: true
schema:
type: string
title: Capture Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/DiscardCaptureRequest'
- type: 'null'
title: Request
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CaptureDiscardResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/{kind}:
post:
tags:
- Capture
summary: Create Capture
description: Push a raw capture from an ambient adapter.
operationId: create_capture_api_capture__kind__post
parameters:
- name: kind
in: path
required: true
schema:
$ref: '#/components/schemas/CaptureKind'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CaptureRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CaptureResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/rss/feeds:
get:
tags:
- Capture
summary: List Rss Feeds
description: List all RSS feed subscriptions.
operationId: list_rss_feeds_api_capture_rss_feeds_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RssFeedListResponse'
post:
tags:
- Capture
summary: Subscribe Rss Feed
description: Subscribe to an RSS/Atom feed.
operationId: subscribe_rss_feed_api_capture_rss_feeds_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RssFeedRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RssFeedResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/rss/feeds/{feed_id}:
patch:
tags:
- Capture
summary: Toggle Rss Feed
description: Enable or disable an RSS feed.
operationId: toggle_rss_feed_api_capture_rss_feeds__feed_id__patch
parameters:
- name: feed_id
in: path
required: true
schema:
type: string
title: Feed Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RssFeedToggleRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RssFeedResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Capture
summary: Delete Rss Feed
description: Delete an RSS feed subscription.
operationId: delete_rss_feed_api_capture_rss_feeds__feed_id__delete
parameters:
- name: feed_id
in: path
required: true
schema:
type: string
title: Feed Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteConfirmation'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/capture/rss/feeds/{feed_id}/poll:
post:
tags:
- Capture
summary: Poll Rss Feed
description: Manually trigger a poll for a single RSS feed.
operationId: poll_rss_feed_api_capture_rss_feeds__feed_id__poll_post
parameters:
- name: feed_id
in: path
required: true
schema:
type: string
title: Feed Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RssPollResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/draft:
get:
tags:
- Ingest
summary: Get Draft
description: Get the pending compilation draft for a source.
operationId: get_draft_api_ingest_sources__source_id__draft_get
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CompilationDraftResponse'
'404':
description: No pending draft for this source
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/draft/approve:
post:
tags:
- Ingest
summary: Approve Draft
description: 'Approve a compilation draft, optionally with focus guidance.
When ``guidance`` is provided, the source is re-compiled with the
user''s direction. Otherwise the original draft is saved as-is.'
operationId: approve_draft_api_ingest_sources__source_id__draft_approve_post
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/ApproveDraftRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ApproveDraftResponse'
'404':
description: No pending draft for this source
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/ingest/sources/{source_id}/draft/reject:
post:
tags:
- Ingest
summary: Reject Draft
description: Reject a compilation draft and reset the source to pending.
operationId: reject_draft_api_ingest_sources__source_id__draft_reject_post
parameters:
- name: source_id
in: path
required: true
schema:
type: string
title: Source Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RejectDraftResponse'
'404':
description: No pending draft for this source
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/wiki/contradiction-resolutions:
get:
tags:
- Wiki
summary: List Contradiction Resolutions
description: Return the valid contradiction resolution options.
operationId: list_contradiction_resolutions_api_wiki_contradiction_resolutions_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/ContradictionResolutionOption'
type: array
title: Response List Contradiction Resolutions Api Wiki Contradiction
Resolutions Get
/api/wiki/contradictions:
get:
tags:
- Wiki
summary: List Contradictions
description: List all contradictions for the user, optionally filtered by status.
operationId: list_contradictions_api_wiki_contradictions_get
parameters:
- name: status
in: query
required: false
schema:
anyOf:
- $ref: '#/components/schemas/ContradictionStatus'
- type: 'null'
title: Status
- name: limit
in: query
required: false
schema:
type: integer
maximum: 200
minimum: 1
default: 50
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: Offset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ContradictionResponse'
title: Response List Contradictions Api Wiki Contradictions Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/wiki/contradictions/{contradiction_id}:
get:
tags:
- Wiki
summary: Get Contradiction
description: Get a single contradiction with article details.
operationId: get_contradiction_api_wiki_contradictions__contradiction_id__get
parameters:
- name: contradiction_id
in: path
required: true
schema:
type: string
title: Contradiction Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContradictionResponse'
'404':
description: Contradiction not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- Wiki
summary: Resolve Persisted Contradiction
description: Resolve or dismiss a contradiction.
operationId: resolve_persisted_contradiction_api_wiki_contradictions__contradiction_id__patch
parameters:
- name: contradiction_id
in: path
required: true
schema:
type: string
title: Contradiction Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ResolveContradictionBody'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ContradictionResponse'
'404':
description: Contradiction not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/wiki/articles:
get:
tags:
- Wiki
summary: List Articles
description: List wiki articles with optional filtering and source provenance.
operationId: list_articles_api_wiki_articles_get
parameters:
- name: concept
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'