@caido/schema-proxy 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +395 -0
  2. package/openapi.yaml +754 -0
  3. package/package.json +16 -0
  4. package/schema.graphql +5278 -0
package/openapi.yaml ADDED
@@ -0,0 +1,754 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Caido Proxy API
4
+ paths:
5
+ /ai/completion:
6
+ post:
7
+ tags:
8
+ - ai
9
+ operationId: completion
10
+ requestBody:
11
+ content:
12
+ application/json:
13
+ schema:
14
+ $ref: '#/components/schemas/CompletionInput'
15
+ required: true
16
+ responses:
17
+ '200':
18
+ description: Streaming completion response
19
+ content:
20
+ application/json:
21
+ schema:
22
+ $ref: '#/components/schemas/CompletionPayload'
23
+ text/event-stream:
24
+ schema:
25
+ $ref: '#/components/schemas/AIStreamedAssistantContent'
26
+ '500':
27
+ description: Internal server error
28
+ content:
29
+ application/json:
30
+ schema:
31
+ $ref: '#/components/schemas/ErrorResponse'
32
+ /backup/{backup_id}:
33
+ get:
34
+ tags:
35
+ - backup
36
+ operationId: backup
37
+ parameters:
38
+ - name: backup_id
39
+ in: path
40
+ required: true
41
+ schema:
42
+ $ref: '#/components/schemas/ID'
43
+ responses:
44
+ '200':
45
+ description: Streaming backup file
46
+ content:
47
+ application/zip: {}
48
+ '500':
49
+ description: Internal server error
50
+ content:
51
+ application/json:
52
+ schema:
53
+ $ref: '#/components/schemas/ErrorResponse'
54
+ /ca.crt:
55
+ get:
56
+ tags:
57
+ - proxy
58
+ operationId: ca_cert
59
+ responses:
60
+ '200':
61
+ description: CA certificate
62
+ content:
63
+ application/octet-stream: {}
64
+ '500':
65
+ description: Internal server error
66
+ content:
67
+ text/plain:
68
+ schema:
69
+ type: string
70
+ /exports/data/{export_id}:
71
+ get:
72
+ tags:
73
+ - export
74
+ operationId: data_export
75
+ parameters:
76
+ - name: export_id
77
+ in: path
78
+ required: true
79
+ schema:
80
+ $ref: '#/components/schemas/ID'
81
+ responses:
82
+ '200':
83
+ description: Streamed data export
84
+ '500':
85
+ description: Internal server error
86
+ content:
87
+ application/json:
88
+ schema:
89
+ $ref: '#/components/schemas/ErrorResponse'
90
+ /exports/logs:
91
+ get:
92
+ tags:
93
+ - export
94
+ operationId: logs_export
95
+ responses:
96
+ '200':
97
+ description: Logs archive
98
+ content:
99
+ application/zip: {}
100
+ '500':
101
+ description: Internal server error
102
+ content:
103
+ text/plain:
104
+ schema:
105
+ type: string
106
+ /graphql:
107
+ get:
108
+ tags:
109
+ - graphql
110
+ operationId: graphql_playground
111
+ responses:
112
+ '200':
113
+ description: GraphQL playground
114
+ post:
115
+ tags:
116
+ - graphql
117
+ operationId: graphql
118
+ responses:
119
+ '200':
120
+ description: GraphQL request
121
+ content:
122
+ application/json: {}
123
+ /graphql/{filename}:
124
+ get:
125
+ tags:
126
+ - graphql
127
+ operationId: graphql_playground_file
128
+ responses:
129
+ '200':
130
+ description: GraphQL playground file
131
+ /health:
132
+ get:
133
+ tags:
134
+ - proxy
135
+ operationId: health
136
+ responses:
137
+ '200':
138
+ description: Proxy API health
139
+ content:
140
+ application/json:
141
+ schema:
142
+ $ref: '#/components/schemas/HealthPayload'
143
+ /plugin/backend/{plugin_id}/function:
144
+ post:
145
+ tags:
146
+ - plugin
147
+ operationId: function
148
+ parameters:
149
+ - name: plugin_id
150
+ in: path
151
+ required: true
152
+ schema:
153
+ $ref: '#/components/schemas/ID'
154
+ requestBody:
155
+ content:
156
+ application/json:
157
+ schema:
158
+ $ref: '#/components/schemas/FunctionInput'
159
+ required: true
160
+ responses:
161
+ '200':
162
+ description: Plugin function call
163
+ content:
164
+ application/json:
165
+ schema:
166
+ $ref: '#/components/schemas/FunctionPayload'
167
+ '500':
168
+ description: Internal server error
169
+ content:
170
+ application/json:
171
+ schema:
172
+ $ref: '#/components/schemas/ErrorResponse'
173
+ /plugin/frontend/{plugin_id}/assets/{file_path}:
174
+ get:
175
+ tags:
176
+ - plugin
177
+ operationId: get_plugin_assets_file
178
+ parameters:
179
+ - name: plugin_id
180
+ in: path
181
+ required: true
182
+ schema:
183
+ $ref: '#/components/schemas/ID'
184
+ - name: file_path
185
+ in: path
186
+ required: true
187
+ schema:
188
+ type: string
189
+ responses:
190
+ '200':
191
+ description: Plugin asset file
192
+ '500':
193
+ description: Internal server error
194
+ content:
195
+ application/json:
196
+ schema:
197
+ $ref: '#/components/schemas/ErrorResponse'
198
+ /plugin/frontend/{plugin_id}/{file_name}:
199
+ get:
200
+ tags:
201
+ - plugin
202
+ operationId: get_plugin_file
203
+ parameters:
204
+ - name: plugin_id
205
+ in: path
206
+ required: true
207
+ schema:
208
+ $ref: '#/components/schemas/ID'
209
+ - name: file_name
210
+ in: path
211
+ required: true
212
+ schema:
213
+ type: string
214
+ responses:
215
+ '200':
216
+ description: Plugin file
217
+ '500':
218
+ description: Internal server error
219
+ content:
220
+ application/json:
221
+ schema:
222
+ $ref: '#/components/schemas/ErrorResponse'
223
+ /ws/graphql:
224
+ get:
225
+ tags:
226
+ - graphql
227
+ operationId: graphql_ws
228
+ responses:
229
+ '101':
230
+ description: GraphQL WebSocket
231
+ components:
232
+ schemas:
233
+ AIAssistantContent:
234
+ oneOf:
235
+ - allOf:
236
+ - $ref: '#/components/schemas/AIText'
237
+ - type: object
238
+ required:
239
+ - kind
240
+ properties:
241
+ kind:
242
+ type: string
243
+ enum:
244
+ - text
245
+ - allOf:
246
+ - $ref: '#/components/schemas/AIToolCall'
247
+ - type: object
248
+ required:
249
+ - kind
250
+ properties:
251
+ kind:
252
+ type: string
253
+ enum:
254
+ - toolcall
255
+ - allOf:
256
+ - $ref: '#/components/schemas/AIReasoning'
257
+ - type: object
258
+ required:
259
+ - kind
260
+ properties:
261
+ kind:
262
+ type: string
263
+ enum:
264
+ - reasoning
265
+ AIMessage:
266
+ oneOf:
267
+ - type: object
268
+ required:
269
+ - content
270
+ - role
271
+ properties:
272
+ content:
273
+ type: array
274
+ items:
275
+ $ref: '#/components/schemas/AIUserContent'
276
+ role:
277
+ type: string
278
+ enum:
279
+ - user
280
+ - type: object
281
+ required:
282
+ - content
283
+ - role
284
+ properties:
285
+ content:
286
+ type: array
287
+ items:
288
+ $ref: '#/components/schemas/AIAssistantContent'
289
+ id:
290
+ type:
291
+ - string
292
+ - 'null'
293
+ role:
294
+ type: string
295
+ enum:
296
+ - assistant
297
+ AIReasoning:
298
+ type: object
299
+ required:
300
+ - reasoning
301
+ properties:
302
+ id:
303
+ type:
304
+ - string
305
+ - 'null'
306
+ reasoning:
307
+ type: array
308
+ items:
309
+ type: string
310
+ signature:
311
+ type:
312
+ - string
313
+ - 'null'
314
+ AIReasoningEffort:
315
+ type: string
316
+ enum:
317
+ - low
318
+ - medium
319
+ - high
320
+ AIReasoningEnd:
321
+ type: object
322
+ properties:
323
+ id:
324
+ type:
325
+ - string
326
+ - 'null'
327
+ signature:
328
+ type:
329
+ - string
330
+ - 'null'
331
+ AIStreamError:
332
+ type: object
333
+ required:
334
+ - error
335
+ - message
336
+ properties:
337
+ error:
338
+ type: string
339
+ message:
340
+ type: string
341
+ AIStreamedAssistantContent:
342
+ oneOf:
343
+ - allOf:
344
+ - $ref: '#/components/schemas/AIText'
345
+ - type: object
346
+ required:
347
+ - kind
348
+ properties:
349
+ kind:
350
+ type: string
351
+ enum:
352
+ - text
353
+ - allOf:
354
+ - $ref: '#/components/schemas/AIToolCall'
355
+ - type: object
356
+ required:
357
+ - kind
358
+ properties:
359
+ kind:
360
+ type: string
361
+ enum:
362
+ - tool-call
363
+ - allOf:
364
+ - $ref: '#/components/schemas/AIToolCallDelta'
365
+ - type: object
366
+ required:
367
+ - kind
368
+ properties:
369
+ kind:
370
+ type: string
371
+ enum:
372
+ - tool-call-delta
373
+ - allOf:
374
+ - $ref: '#/components/schemas/AIReasoning'
375
+ - type: object
376
+ required:
377
+ - kind
378
+ properties:
379
+ kind:
380
+ type: string
381
+ enum:
382
+ - reasoning
383
+ - allOf:
384
+ - $ref: '#/components/schemas/AIReasoningEnd'
385
+ - type: object
386
+ required:
387
+ - kind
388
+ properties:
389
+ kind:
390
+ type: string
391
+ enum:
392
+ - reasoning-end
393
+ - allOf:
394
+ - $ref: '#/components/schemas/AIStreamError'
395
+ - type: object
396
+ required:
397
+ - kind
398
+ properties:
399
+ kind:
400
+ type: string
401
+ enum:
402
+ - error
403
+ - type: object
404
+ required:
405
+ - kind
406
+ properties:
407
+ kind:
408
+ type: string
409
+ enum:
410
+ - final
411
+ AIStructuredOutput:
412
+ type: object
413
+ required:
414
+ - name
415
+ - schema
416
+ properties:
417
+ name:
418
+ type: string
419
+ schema: {}
420
+ strict:
421
+ type:
422
+ - boolean
423
+ - 'null'
424
+ AIText:
425
+ type: object
426
+ required:
427
+ - text
428
+ properties:
429
+ text:
430
+ type: string
431
+ AIToolCall:
432
+ type: object
433
+ required:
434
+ - call_id
435
+ - function
436
+ properties:
437
+ additional_params: {}
438
+ call_id:
439
+ type: string
440
+ function:
441
+ $ref: '#/components/schemas/AIToolFunction'
442
+ signature:
443
+ type:
444
+ - string
445
+ - 'null'
446
+ AIToolCallDelta:
447
+ type: object
448
+ required:
449
+ - call_id
450
+ - content
451
+ properties:
452
+ call_id:
453
+ type: string
454
+ content:
455
+ $ref: '#/components/schemas/AIToolCallDeltaContent'
456
+ AIToolCallDeltaContent:
457
+ oneOf:
458
+ - type: object
459
+ required:
460
+ - name
461
+ - kind
462
+ properties:
463
+ kind:
464
+ type: string
465
+ enum:
466
+ - name
467
+ name:
468
+ type: string
469
+ - type: object
470
+ required:
471
+ - delta
472
+ - kind
473
+ properties:
474
+ delta:
475
+ type: string
476
+ kind:
477
+ type: string
478
+ enum:
479
+ - delta
480
+ AIToolDefinition:
481
+ type: object
482
+ required:
483
+ - name
484
+ - description
485
+ - parameters
486
+ properties:
487
+ description:
488
+ type: string
489
+ name:
490
+ type: string
491
+ parameters: {}
492
+ AIToolFunction:
493
+ type: object
494
+ required:
495
+ - name
496
+ - arguments
497
+ properties:
498
+ arguments: {}
499
+ name:
500
+ type: string
501
+ AIToolResult:
502
+ type: object
503
+ required:
504
+ - call_id
505
+ - content
506
+ properties:
507
+ call_id:
508
+ type: string
509
+ content:
510
+ type: array
511
+ items:
512
+ $ref: '#/components/schemas/AIToolResultContent'
513
+ AIToolResultContent:
514
+ oneOf:
515
+ - allOf:
516
+ - $ref: '#/components/schemas/AIText'
517
+ - type: object
518
+ required:
519
+ - kind
520
+ properties:
521
+ kind:
522
+ type: string
523
+ enum:
524
+ - text
525
+ AIUserContent:
526
+ oneOf:
527
+ - allOf:
528
+ - $ref: '#/components/schemas/AIText'
529
+ - type: object
530
+ required:
531
+ - kind
532
+ properties:
533
+ kind:
534
+ type: string
535
+ enum:
536
+ - text
537
+ - allOf:
538
+ - $ref: '#/components/schemas/AIToolResult'
539
+ - type: object
540
+ required:
541
+ - kind
542
+ properties:
543
+ kind:
544
+ type: string
545
+ enum:
546
+ - toolresult
547
+ CompletionCapabilities:
548
+ type: object
549
+ required:
550
+ - reasoning
551
+ - structured_output
552
+ properties:
553
+ reasoning:
554
+ type: boolean
555
+ structured_output:
556
+ type: boolean
557
+ CompletionInput:
558
+ type: object
559
+ required:
560
+ - stream
561
+ - model
562
+ - request
563
+ properties:
564
+ model:
565
+ $ref: '#/components/schemas/CompletionModel'
566
+ request:
567
+ $ref: '#/components/schemas/CompletionRequest'
568
+ stream:
569
+ type: boolean
570
+ CompletionModel:
571
+ type: object
572
+ required:
573
+ - provider
574
+ - name
575
+ properties:
576
+ capabilities:
577
+ oneOf:
578
+ - type: 'null'
579
+ - $ref: '#/components/schemas/CompletionCapabilities'
580
+ name:
581
+ type: string
582
+ provider:
583
+ $ref: '#/components/schemas/CompletionProvider'
584
+ CompletionPayload:
585
+ type: object
586
+ required:
587
+ - choices
588
+ properties:
589
+ choices:
590
+ type: array
591
+ items:
592
+ $ref: '#/components/schemas/AIAssistantContent'
593
+ CompletionProvider:
594
+ type: string
595
+ enum:
596
+ - openai
597
+ - anthropic
598
+ - google
599
+ - openrouter
600
+ CompletionReasoning:
601
+ type: object
602
+ required:
603
+ - effort
604
+ properties:
605
+ effort:
606
+ $ref: '#/components/schemas/AIReasoningEffort'
607
+ CompletionRequest:
608
+ type: object
609
+ required:
610
+ - messages
611
+ properties:
612
+ max_tokens:
613
+ type:
614
+ - integer
615
+ - 'null'
616
+ format: int64
617
+ minimum: 0
618
+ messages:
619
+ type: array
620
+ items:
621
+ $ref: '#/components/schemas/AIMessage'
622
+ reasoning:
623
+ oneOf:
624
+ - type: 'null'
625
+ - $ref: '#/components/schemas/CompletionReasoning'
626
+ structured_output:
627
+ oneOf:
628
+ - type: 'null'
629
+ - $ref: '#/components/schemas/AIStructuredOutput'
630
+ system:
631
+ type:
632
+ - string
633
+ - 'null'
634
+ temperature:
635
+ type:
636
+ - number
637
+ - 'null'
638
+ format: double
639
+ tools:
640
+ type:
641
+ - array
642
+ - 'null'
643
+ items:
644
+ $ref: '#/components/schemas/AIToolDefinition'
645
+ ErrorResponse:
646
+ type: object
647
+ required:
648
+ - code
649
+ - error
650
+ - message
651
+ properties:
652
+ code:
653
+ type: integer
654
+ format: int32
655
+ minimum: 0
656
+ error:
657
+ type: string
658
+ message:
659
+ type: string
660
+ FunctionErrorPayload:
661
+ oneOf:
662
+ - type: object
663
+ required:
664
+ - name
665
+ - kind
666
+ properties:
667
+ kind:
668
+ type: string
669
+ enum:
670
+ - invalid_procedure
671
+ name:
672
+ type: string
673
+ - type: object
674
+ required:
675
+ - expected
676
+ - found
677
+ - kind
678
+ properties:
679
+ expected:
680
+ type: string
681
+ found:
682
+ type: string
683
+ kind:
684
+ type: string
685
+ enum:
686
+ - invalid_output
687
+ - type: object
688
+ required:
689
+ - kind
690
+ properties:
691
+ kind:
692
+ type: string
693
+ enum:
694
+ - thrown
695
+ message:
696
+ type:
697
+ - string
698
+ - 'null'
699
+ stack:
700
+ type:
701
+ - string
702
+ - 'null'
703
+ FunctionInput:
704
+ type: object
705
+ required:
706
+ - name
707
+ - args
708
+ properties:
709
+ args:
710
+ type: array
711
+ items:
712
+ type: string
713
+ name:
714
+ type: string
715
+ FunctionPayload:
716
+ oneOf:
717
+ - type: object
718
+ required:
719
+ - kind
720
+ properties:
721
+ kind:
722
+ type: string
723
+ enum:
724
+ - success
725
+ returns:
726
+ type:
727
+ - string
728
+ - 'null'
729
+ - type: object
730
+ required:
731
+ - error
732
+ - kind
733
+ properties:
734
+ error:
735
+ $ref: '#/components/schemas/FunctionErrorPayload'
736
+ kind:
737
+ type: string
738
+ enum:
739
+ - error
740
+ HealthPayload:
741
+ type: object
742
+ required:
743
+ - name
744
+ - version
745
+ - ready
746
+ properties:
747
+ name:
748
+ type: string
749
+ ready:
750
+ type: boolean
751
+ version:
752
+ type: string
753
+ ID:
754
+ type: string