@ottocode/api 0.1.295 → 0.1.297

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.
@@ -1,1090 +1,356 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- export const ProviderSchema = {
3
- type: 'string',
4
- description: 'Built-in or custom provider identifier'
5
- };
6
- export const ProviderDetailSchema = {
2
+ export const MCPServerSchema = {
7
3
  type: 'object',
8
4
  properties: {
9
- id: {
10
- '$ref': '#/components/schemas/Provider'
11
- },
12
- label: {
5
+ name: {
13
6
  type: 'string'
14
7
  },
15
- source: {
16
- type: 'string',
17
- enum: ['built-in', 'custom']
18
- },
19
- enabled: {
20
- type: 'boolean'
21
- },
22
- authorized: {
23
- type: 'boolean'
24
- },
25
- custom: {
26
- type: 'boolean'
27
- },
28
- compatibility: {
29
- type: 'string',
30
- nullable: true
31
- },
32
- family: {
33
- type: 'string',
34
- nullable: true
35
- },
36
- baseURL: {
37
- type: 'string',
38
- nullable: true
39
- },
40
- apiKeyEnv: {
8
+ transport: {
41
9
  type: 'string',
42
- nullable: true
43
- },
44
- hasApiKey: {
45
- type: 'boolean'
46
- },
47
- allowAnyModel: {
48
- type: 'boolean'
49
- },
50
- modelCount: {
51
- type: 'integer'
10
+ enum: ['stdio', 'http', 'sse']
52
11
  },
53
- authType: {
54
- type: 'string',
55
- nullable: true
56
- }
57
- },
58
- required: ['id', 'label', 'source', 'enabled', 'authorized', 'custom', 'hasApiKey', 'allowAnyModel', 'modelCount']
59
- };
60
- export const AskResponseSchema = {
61
- type: 'object',
62
- properties: {
63
- sessionId: {
12
+ command: {
64
13
  type: 'string'
65
14
  },
66
- header: {
67
- '$ref': '#/components/schemas/AskResponseHeader'
68
- },
69
- provider: {
70
- '$ref': '#/components/schemas/Provider'
15
+ args: {
16
+ type: 'array',
17
+ items: {
18
+ type: 'string'
19
+ }
71
20
  },
72
- model: {
21
+ url: {
73
22
  type: 'string'
74
23
  },
75
- agent: {
76
- type: 'string'
24
+ disabled: {
25
+ type: 'boolean'
77
26
  },
78
- assistantMessageId: {
79
- type: 'string'
27
+ connected: {
28
+ type: 'boolean'
80
29
  },
81
- message: {
82
- '$ref': '#/components/schemas/AskResponseMessage',
83
- nullable: true,
84
- description: 'Present when the request created a new session or reused the last session for the project.'
85
- }
86
- },
87
- required: ['sessionId', 'header', 'provider', 'model', 'agent', 'assistantMessageId']
88
- };
89
- export const AskResponseHeaderSchema = {
90
- type: 'object',
91
- properties: {
92
- sessionId: {
93
- type: 'string'
30
+ tools: {
31
+ type: 'array',
32
+ items: {
33
+ type: 'string'
34
+ }
94
35
  },
95
- agent: {
96
- type: 'string',
97
- nullable: true
36
+ authRequired: {
37
+ type: 'boolean'
98
38
  },
99
- provider: {
100
- '$ref': '#/components/schemas/Provider',
101
- nullable: true
39
+ authenticated: {
40
+ type: 'boolean'
102
41
  },
103
- model: {
104
- type: 'string',
105
- nullable: true
106
- }
107
- },
108
- required: ['sessionId']
109
- };
110
- export const AskResponseMessageSchema = {
111
- type: 'object',
112
- properties: {
113
- kind: {
42
+ scope: {
114
43
  type: 'string',
115
- enum: ['created', 'last']
44
+ enum: ['global', 'project']
116
45
  },
117
- sessionId: {
46
+ authType: {
118
47
  type: 'string'
119
48
  }
120
49
  },
121
- required: ['kind', 'sessionId']
50
+ required: ['name', 'transport', 'args', 'disabled', 'connected', 'tools', 'authRequired', 'authenticated', 'scope'],
51
+ additionalProperties: {
52
+ nullable: true
53
+ }
122
54
  };
123
- export const SessionSchema = {
55
+ export const UsageStatsSchema = {
124
56
  type: 'object',
125
57
  properties: {
126
- id: {
127
- type: 'string'
128
- },
129
- title: {
58
+ scope: {
130
59
  type: 'string',
131
- nullable: true
132
- },
133
- agent: {
134
- type: 'string'
135
- },
136
- provider: {
137
- '$ref': '#/components/schemas/Provider'
138
- },
139
- model: {
140
- type: 'string'
60
+ enum: ['project', 'global']
141
61
  },
142
- projectPath: {
62
+ project: {
143
63
  type: 'string'
144
64
  },
145
- createdAt: {
146
- type: 'integer',
147
- format: 'int64'
148
- },
149
- lastActiveAt: {
150
- type: 'integer',
151
- format: 'int64',
152
- nullable: true
153
- },
154
- lastViewedAt: {
155
- type: 'integer',
156
- format: 'int64',
157
- nullable: true
158
- },
159
- totalInputTokens: {
160
- type: 'integer',
161
- nullable: true
162
- },
163
- totalOutputTokens: {
164
- type: 'integer',
165
- nullable: true
166
- },
167
- totalCachedTokens: {
168
- type: 'integer',
169
- nullable: true
170
- },
171
- totalCacheCreationTokens: {
172
- type: 'integer',
173
- nullable: true
174
- },
175
- currentContextTokens: {
176
- type: 'integer',
177
- nullable: true
178
- },
179
- totalToolTimeMs: {
180
- type: 'integer',
181
- nullable: true
182
- },
183
- toolCounts: {
184
- type: 'object',
185
- additionalProperties: {
186
- type: 'integer'
187
- },
188
- nullable: true
65
+ generatedAt: {
66
+ type: 'integer'
189
67
  },
190
- fileStats: {
68
+ totals: {
191
69
  type: 'object',
192
70
  properties: {
193
- changedFiles: {
71
+ messages: {
194
72
  type: 'integer'
195
73
  },
196
- additions: {
74
+ sessions: {
197
75
  type: 'integer'
198
76
  },
199
- deletions: {
77
+ inputTokens: {
200
78
  type: 'integer'
201
79
  },
202
- operations: {
80
+ outputTokens: {
203
81
  type: 'integer'
204
- }
205
- },
206
- required: ['changedFiles', 'additions', 'deletions', 'operations'],
207
- nullable: true
208
- },
209
- isRunning: {
210
- type: 'boolean'
211
- }
212
- },
213
- required: ['id', 'agent', 'provider', 'model', 'projectPath', 'createdAt']
214
- };
215
- export const MessageSchema = {
216
- type: 'object',
217
- properties: {
218
- id: {
219
- type: 'string'
220
- },
221
- sessionId: {
222
- type: 'string'
223
- },
224
- role: {
225
- type: 'string',
226
- enum: ['system', 'user', 'assistant', 'tool']
227
- },
228
- status: {
229
- type: 'string',
230
- enum: ['pending', 'complete', 'error']
231
- },
232
- agent: {
233
- type: 'string'
234
- },
235
- provider: {
236
- '$ref': '#/components/schemas/Provider'
237
- },
238
- model: {
239
- type: 'string'
240
- },
241
- createdAt: {
242
- type: 'integer',
243
- format: 'int64'
244
- },
245
- completedAt: {
246
- type: 'integer',
247
- format: 'int64',
248
- nullable: true
249
- },
250
- latencyMs: {
251
- type: 'integer',
252
- nullable: true
253
- },
254
- inputTokens: {
255
- type: 'integer',
256
- nullable: true
257
- },
258
- outputTokens: {
259
- type: 'integer',
260
- nullable: true
261
- },
262
- totalTokens: {
263
- type: 'integer',
264
- nullable: true
265
- },
266
- error: {
267
- type: 'string',
268
- nullable: true
269
- }
270
- },
271
- required: ['id', 'sessionId', 'role', 'status', 'agent', 'provider', 'model', 'createdAt']
272
- };
273
- export const MessagePartSchema = {
274
- type: 'object',
275
- properties: {
276
- id: {
277
- type: 'string'
278
- },
279
- messageId: {
280
- type: 'string'
281
- },
282
- index: {
283
- type: 'integer',
284
- format: 'int64'
285
- },
286
- type: {
287
- type: 'string',
288
- enum: ['text', 'tool_call', 'tool_result', 'image', 'error']
289
- },
290
- content: {
291
- type: 'string',
292
- description: 'JSON-encoded content. For text: {"text": string}. For tool_call: {"name": string, "args": object}. For tool_result: {"name": string, "result"?: any, "artifact"?: Artifact}.'
293
- },
294
- agent: {
295
- type: 'string'
296
- },
297
- provider: {
298
- '$ref': '#/components/schemas/Provider'
299
- },
300
- model: {
301
- type: 'string'
302
- },
303
- startedAt: {
304
- type: 'integer',
305
- format: 'int64',
306
- nullable: true
307
- },
308
- completedAt: {
309
- type: 'integer',
310
- format: 'int64',
311
- nullable: true
312
- },
313
- toolName: {
314
- type: 'string',
315
- nullable: true
316
- },
317
- toolCallId: {
318
- type: 'string',
319
- nullable: true
320
- },
321
- toolDurationMs: {
322
- type: 'integer',
323
- nullable: true
324
- }
325
- },
326
- required: ['id', 'messageId', 'index', 'type', 'content', 'agent', 'provider', 'model']
327
- };
328
- export const ArtifactSchema = {
329
- oneOf: [
330
- {
331
- '$ref': '#/components/schemas/FileDiffArtifact'
332
- },
333
- {
334
- '$ref': '#/components/schemas/FileArtifact'
335
- }
336
- ]
337
- };
338
- export const FileDiffArtifactSchema = {
339
- type: 'object',
340
- properties: {
341
- kind: {
342
- type: 'string',
343
- enum: ['file_diff']
344
- },
345
- patchFormat: {
346
- type: 'string',
347
- enum: ['unified']
348
- },
349
- patch: {
350
- type: 'string'
351
- },
352
- summary: {
353
- type: 'object',
354
- properties: {
355
- files: {
82
+ },
83
+ cachedInputTokens: {
356
84
  type: 'integer'
357
85
  },
358
- additions: {
86
+ cacheCreationInputTokens: {
359
87
  type: 'integer'
360
88
  },
361
- deletions: {
89
+ reasoningTokens: {
362
90
  type: 'integer'
91
+ },
92
+ costUsd: {
93
+ type: 'number'
94
+ },
95
+ notionalCostUsd: {
96
+ type: 'number'
97
+ },
98
+ savedUsd: {
99
+ type: 'number'
100
+ },
101
+ costByAuth: {
102
+ type: 'object',
103
+ properties: {
104
+ oauth: {
105
+ type: 'number'
106
+ },
107
+ api: {
108
+ type: 'number'
109
+ },
110
+ subscription: {
111
+ type: 'number'
112
+ }
113
+ },
114
+ required: ['oauth', 'api', 'subscription']
115
+ },
116
+ messagesByAuth: {
117
+ type: 'object',
118
+ properties: {
119
+ oauth: {
120
+ type: 'integer'
121
+ },
122
+ api: {
123
+ type: 'integer'
124
+ },
125
+ subscription: {
126
+ type: 'integer'
127
+ }
128
+ },
129
+ required: ['oauth', 'api', 'subscription']
363
130
  }
364
131
  },
365
- additionalProperties: false
366
- }
367
- },
368
- required: ['kind', 'patchFormat', 'patch']
369
- };
370
- export const FileArtifactSchema = {
371
- type: 'object',
372
- properties: {
373
- kind: {
374
- type: 'string',
375
- enum: ['file']
376
- },
377
- path: {
378
- type: 'string'
132
+ required: ['messages', 'sessions', 'inputTokens', 'outputTokens', 'cachedInputTokens', 'cacheCreationInputTokens', 'reasoningTokens', 'costUsd', 'notionalCostUsd', 'savedUsd', 'costByAuth', 'messagesByAuth']
379
133
  },
380
- mime: {
381
- type: 'string'
382
- },
383
- size: {
384
- type: 'integer'
385
- },
386
- sha256: {
387
- type: 'string'
388
- }
389
- },
390
- required: ['kind', 'path']
391
- };
392
- export const ConfigSchema = {
393
- type: 'object',
394
- properties: {
395
- agents: {
134
+ providers: {
396
135
  type: 'array',
397
136
  items: {
398
- type: 'string'
137
+ type: 'object',
138
+ properties: {
139
+ provider: {
140
+ type: 'string'
141
+ },
142
+ authType: {
143
+ type: 'string',
144
+ enum: ['oauth', 'api', 'wallet', 'subscription', 'unknown']
145
+ },
146
+ messages: {
147
+ type: 'integer'
148
+ },
149
+ sessions: {
150
+ type: 'integer'
151
+ },
152
+ inputTokens: {
153
+ type: 'integer'
154
+ },
155
+ outputTokens: {
156
+ type: 'integer'
157
+ },
158
+ cachedInputTokens: {
159
+ type: 'integer'
160
+ },
161
+ cacheCreationInputTokens: {
162
+ type: 'integer'
163
+ },
164
+ reasoningTokens: {
165
+ type: 'integer'
166
+ },
167
+ costUsd: {
168
+ type: 'number'
169
+ },
170
+ notionalCostUsd: {
171
+ type: 'number'
172
+ }
173
+ },
174
+ required: ['provider', 'authType', 'messages', 'sessions', 'inputTokens', 'outputTokens', 'cachedInputTokens', 'cacheCreationInputTokens', 'reasoningTokens', 'costUsd', 'notionalCostUsd']
399
175
  }
400
176
  },
401
- providers: {
177
+ models: {
402
178
  type: 'array',
403
179
  items: {
404
- '$ref': '#/components/schemas/Provider'
180
+ type: 'object',
181
+ properties: {
182
+ provider: {
183
+ type: 'string'
184
+ },
185
+ model: {
186
+ type: 'string'
187
+ },
188
+ authType: {
189
+ type: 'string',
190
+ enum: ['oauth', 'api', 'wallet', 'subscription', 'unknown']
191
+ },
192
+ messages: {
193
+ type: 'integer'
194
+ },
195
+ inputTokens: {
196
+ type: 'integer'
197
+ },
198
+ outputTokens: {
199
+ type: 'integer'
200
+ },
201
+ cachedInputTokens: {
202
+ type: 'integer'
203
+ },
204
+ cacheCreationInputTokens: {
205
+ type: 'integer'
206
+ },
207
+ reasoningTokens: {
208
+ type: 'integer'
209
+ },
210
+ costUsd: {
211
+ type: 'number'
212
+ },
213
+ notionalCostUsd: {
214
+ type: 'number'
215
+ }
216
+ },
217
+ required: ['provider', 'model', 'authType', 'messages', 'inputTokens', 'outputTokens', 'cachedInputTokens', 'cacheCreationInputTokens', 'reasoningTokens', 'costUsd', 'notionalCostUsd']
405
218
  }
406
219
  },
407
- providerDetails: {
220
+ daily: {
408
221
  type: 'array',
409
222
  items: {
410
- '$ref': '#/components/schemas/ProviderDetail'
223
+ type: 'object',
224
+ properties: {
225
+ date: {
226
+ type: 'string'
227
+ },
228
+ messages: {
229
+ type: 'integer'
230
+ },
231
+ inputTokens: {
232
+ type: 'integer'
233
+ },
234
+ outputTokens: {
235
+ type: 'integer'
236
+ },
237
+ costUsd: {
238
+ type: 'number'
239
+ },
240
+ notionalCostUsd: {
241
+ type: 'number'
242
+ },
243
+ costByAuth: {
244
+ type: 'object',
245
+ properties: {
246
+ oauth: {
247
+ type: 'number'
248
+ },
249
+ api: {
250
+ type: 'number'
251
+ },
252
+ subscription: {
253
+ type: 'number'
254
+ }
255
+ },
256
+ required: ['oauth', 'api', 'subscription']
257
+ },
258
+ notionalByAuth: {
259
+ type: 'object',
260
+ properties: {
261
+ oauth: {
262
+ type: 'number'
263
+ },
264
+ api: {
265
+ type: 'number'
266
+ },
267
+ subscription: {
268
+ type: 'number'
269
+ }
270
+ },
271
+ required: ['oauth', 'api', 'subscription']
272
+ }
273
+ },
274
+ required: ['date', 'messages', 'inputTokens', 'outputTokens', 'costUsd', 'notionalCostUsd', 'costByAuth', 'notionalByAuth']
411
275
  }
412
276
  },
413
- defaults: {
277
+ notes: {
414
278
  type: 'object',
415
279
  properties: {
416
- agent: {
417
- type: 'string'
280
+ oauthProviders: {
281
+ type: 'array',
282
+ items: {
283
+ type: 'string'
284
+ }
418
285
  },
419
- provider: {
420
- '$ref': '#/components/schemas/Provider'
286
+ subscriptionProviders: {
287
+ type: 'array',
288
+ items: {
289
+ type: 'string'
290
+ }
421
291
  },
422
- model: {
423
- type: 'string'
292
+ missingPricing: {
293
+ type: 'array',
294
+ items: {
295
+ type: 'string'
296
+ }
297
+ }
298
+ },
299
+ required: ['oauthProviders', 'subscriptionProviders', 'missingPricing']
300
+ },
301
+ projects: {
302
+ type: 'object',
303
+ properties: {
304
+ included: {
305
+ type: 'array',
306
+ items: {
307
+ type: 'object',
308
+ properties: {
309
+ id: {
310
+ type: 'string'
311
+ },
312
+ name: {
313
+ type: 'string'
314
+ },
315
+ path: {
316
+ type: 'string'
317
+ },
318
+ lastSeenAt: {
319
+ type: 'integer'
320
+ },
321
+ messages: {
322
+ type: 'integer'
323
+ },
324
+ notionalCostUsd: {
325
+ type: 'number'
326
+ }
327
+ },
328
+ required: ['id', 'name', 'path', 'lastSeenAt', 'messages', 'notionalCostUsd']
329
+ }
424
330
  },
425
- theme: {
426
- type: 'string',
427
- enum: ['light', 'dark']
428
- },
429
- vimMode: {
430
- type: 'boolean'
431
- },
432
- compactThread: {
433
- type: 'boolean'
434
- },
435
- fontFamily: {
436
- type: 'string'
437
- },
438
- smartEdges: {
439
- type: 'boolean'
440
- },
441
- releaseToSend: {
442
- type: 'boolean'
443
- },
444
- fullWidthContent: {
445
- type: 'boolean'
446
- },
447
- autoCompactThresholdTokens: {
448
- type: 'integer',
449
- nullable: true
450
- },
451
- reasoningText: {
452
- type: 'boolean'
453
- },
454
- reasoningLevel: {
455
- type: 'string',
456
- enum: ['minimal', 'low', 'medium', 'high', 'max', 'xhigh']
457
- }
458
- },
459
- required: ['agent', 'provider', 'model']
460
- }
461
- },
462
- required: ['agents', 'providers', 'defaults']
463
- };
464
- export const ModelSchema = {
465
- type: 'object',
466
- properties: {
467
- id: {
468
- type: 'string'
469
- },
470
- label: {
471
- type: 'string'
472
- },
473
- toolCall: {
474
- type: 'boolean'
475
- },
476
- reasoningText: {
477
- type: 'boolean'
478
- }
479
- },
480
- required: ['id', 'label']
481
- };
482
- export const GitStatusSchema = {
483
- type: 'object',
484
- properties: {
485
- branch: {
486
- type: 'string'
487
- },
488
- headSha: {
489
- type: 'string'
490
- },
491
- shortHeadSha: {
492
- type: 'string'
493
- },
494
- isDetached: {
495
- type: 'boolean'
496
- },
497
- operation: {
498
- '$ref': '#/components/schemas/GitOperation',
499
- nullable: true
500
- },
501
- ahead: {
502
- type: 'integer'
503
- },
504
- behind: {
505
- type: 'integer'
506
- },
507
- staged: {
508
- type: 'array',
509
- items: {
510
- '$ref': '#/components/schemas/GitFile'
511
- }
512
- },
513
- unstaged: {
514
- type: 'array',
515
- items: {
516
- '$ref': '#/components/schemas/GitFile'
517
- }
518
- },
519
- untracked: {
520
- type: 'array',
521
- items: {
522
- '$ref': '#/components/schemas/GitFile'
523
- }
524
- },
525
- conflicted: {
526
- type: 'array',
527
- items: {
528
- '$ref': '#/components/schemas/GitFile'
529
- }
530
- },
531
- hasChanges: {
532
- type: 'boolean'
533
- },
534
- hasConflicts: {
535
- type: 'boolean'
536
- },
537
- hasUpstream: {
538
- type: 'boolean'
539
- },
540
- remotes: {
541
- type: 'array',
542
- items: {
543
- type: 'string'
544
- }
545
- }
546
- },
547
- required: ['branch', 'headSha', 'shortHeadSha', 'isDetached', 'operation', 'ahead', 'behind', 'staged', 'unstaged', 'untracked', 'conflicted', 'hasChanges', 'hasConflicts', 'hasUpstream', 'remotes']
548
- };
549
- export const GitOperationSchema = {
550
- type: 'object',
551
- properties: {
552
- type: {
553
- type: 'string',
554
- enum: ['rebase', 'rebase-interactive', 'merge', 'cherry-pick', 'revert', 'bisect']
555
- },
556
- label: {
557
- type: 'string'
558
- },
559
- current: {
560
- type: 'integer'
561
- },
562
- total: {
563
- type: 'integer'
564
- },
565
- headName: {
566
- type: 'string'
567
- },
568
- onto: {
569
- type: 'string'
570
- }
571
- },
572
- required: ['type', 'label']
573
- };
574
- export const GitFileSchema = {
575
- type: 'object',
576
- properties: {
577
- path: {
578
- type: 'string'
579
- },
580
- status: {
581
- type: 'string',
582
- enum: ['modified', 'added', 'deleted', 'renamed', 'untracked', 'conflicted']
583
- },
584
- staged: {
585
- type: 'boolean'
586
- },
587
- insertions: {
588
- type: 'integer'
589
- },
590
- deletions: {
591
- type: 'integer'
592
- },
593
- oldPath: {
594
- type: 'string'
595
- },
596
- conflictType: {
597
- type: 'string',
598
- enum: ['both-modified', 'deleted-by-us', 'deleted-by-them', 'both-added', 'both-deleted']
599
- }
600
- },
601
- required: ['path', 'status', 'staged']
602
- };
603
- export const GitDiffSchema = {
604
- type: 'object',
605
- properties: {
606
- file: {
607
- type: 'string'
608
- },
609
- diff: {
610
- type: 'string'
611
- },
612
- insertions: {
613
- type: 'integer'
614
- },
615
- deletions: {
616
- type: 'integer'
617
- },
618
- language: {
619
- type: 'string'
620
- },
621
- binary: {
622
- type: 'boolean'
623
- }
624
- },
625
- required: ['file', 'diff', 'insertions', 'deletions', 'language', 'binary']
626
- };
627
- export const GitBranchSchema = {
628
- type: 'object',
629
- properties: {
630
- current: {
631
- type: 'string'
632
- },
633
- upstream: {
634
- type: 'string'
635
- },
636
- ahead: {
637
- type: 'integer'
638
- },
639
- behind: {
640
- type: 'integer'
641
- },
642
- all: {
643
- type: 'array',
644
- items: {
645
- type: 'string'
646
- }
647
- }
648
- },
649
- required: ['current', 'upstream', 'ahead', 'behind', 'all']
650
- };
651
- export const GitCommitSchema = {
652
- type: 'object',
653
- properties: {
654
- hash: {
655
- type: 'string'
656
- },
657
- message: {
658
- type: 'string'
659
- },
660
- filesChanged: {
661
- type: 'integer'
662
- },
663
- insertions: {
664
- type: 'integer'
665
- },
666
- deletions: {
667
- type: 'integer'
668
- }
669
- },
670
- required: ['hash', 'message', 'filesChanged', 'insertions', 'deletions']
671
- };
672
- export const TerminalSchema = {
673
- type: 'object',
674
- properties: {
675
- id: {
676
- type: 'string'
677
- },
678
- pid: {
679
- type: 'integer'
680
- },
681
- command: {
682
- type: 'string'
683
- },
684
- args: {
685
- type: 'array',
686
- items: {
687
- type: 'string'
688
- }
689
- },
690
- cwd: {
691
- type: 'string'
692
- },
693
- purpose: {
694
- type: 'string'
695
- },
696
- createdBy: {
697
- type: 'string',
698
- enum: ['user', 'llm']
699
- },
700
- title: {
701
- type: 'string'
702
- },
703
- status: {
704
- type: 'string',
705
- enum: ['running', 'exited']
706
- },
707
- exitCode: {
708
- type: 'integer'
709
- },
710
- createdAt: {
711
- type: 'string',
712
- format: 'date-time'
713
- },
714
- uptime: {
715
- type: 'integer'
716
- }
717
- }
718
- };
719
- export const MCPServerSchema = {
720
- type: 'object',
721
- properties: {
722
- name: {
723
- type: 'string'
724
- },
725
- transport: {
726
- type: 'string',
727
- enum: ['stdio', 'http', 'sse']
728
- },
729
- command: {
730
- type: 'string'
731
- },
732
- args: {
733
- type: 'array',
734
- items: {
735
- type: 'string'
736
- }
737
- },
738
- url: {
739
- type: 'string'
740
- },
741
- disabled: {
742
- type: 'boolean'
743
- },
744
- connected: {
745
- type: 'boolean'
746
- },
747
- tools: {
748
- type: 'array',
749
- items: {
750
- type: 'object',
751
- properties: {
752
- name: {
753
- type: 'string'
754
- },
755
- description: {
756
- type: 'string'
331
+ unavailable: {
332
+ type: 'array',
333
+ items: {
334
+ type: 'object',
335
+ properties: {
336
+ id: {
337
+ type: 'string'
338
+ },
339
+ name: {
340
+ type: 'string'
341
+ },
342
+ path: {
343
+ type: 'string'
344
+ },
345
+ reason: {
346
+ type: 'string'
347
+ }
348
+ },
349
+ required: ['id', 'name', 'path', 'reason']
757
350
  }
758
351
  }
759
- }
760
- },
761
- authRequired: {
762
- type: 'boolean'
763
- },
764
- authenticated: {
765
- type: 'boolean'
766
- },
767
- scope: {
768
- type: 'string',
769
- enum: ['global', 'project']
770
- },
771
- authType: {
772
- type: 'string'
773
- }
774
- },
775
- required: ['name', 'transport', 'connected']
776
- };
777
- export const UsageAuthBucketSchema = {
778
- type: 'string',
779
- enum: ['oauth', 'api', 'subscription']
780
- };
781
- export const UsageAuthTypeSchema = {
782
- type: 'string',
783
- enum: ['oauth', 'api', 'wallet', 'subscription', 'unknown']
784
- };
785
- export const UsageAuthAmountSchema = {
786
- type: 'object',
787
- properties: {
788
- oauth: {
789
- type: 'number'
790
- },
791
- api: {
792
- type: 'number'
793
- },
794
- subscription: {
795
- type: 'number'
796
- }
797
- },
798
- required: ['oauth', 'api', 'subscription']
799
- };
800
- export const UsageAuthCountSchema = {
801
- type: 'object',
802
- properties: {
803
- oauth: {
804
- type: 'integer'
805
- },
806
- api: {
807
- type: 'integer'
808
- },
809
- subscription: {
810
- type: 'integer'
811
- }
812
- },
813
- required: ['oauth', 'api', 'subscription']
814
- };
815
- export const UsageTotalsSchema = {
816
- type: 'object',
817
- properties: {
818
- messages: {
819
- type: 'integer'
820
- },
821
- sessions: {
822
- type: 'integer'
823
- },
824
- inputTokens: {
825
- type: 'integer'
826
- },
827
- outputTokens: {
828
- type: 'integer'
829
- },
830
- cachedInputTokens: {
831
- type: 'integer'
832
- },
833
- cacheCreationInputTokens: {
834
- type: 'integer'
835
- },
836
- reasoningTokens: {
837
- type: 'integer'
838
- },
839
- costUsd: {
840
- type: 'number'
841
- },
842
- notionalCostUsd: {
843
- type: 'number'
844
- },
845
- savedUsd: {
846
- type: 'number'
847
- },
848
- costByAuth: {
849
- '$ref': '#/components/schemas/UsageAuthAmount'
850
- },
851
- messagesByAuth: {
852
- '$ref': '#/components/schemas/UsageAuthCount'
853
- }
854
- },
855
- required: ['messages', 'sessions', 'inputTokens', 'outputTokens', 'cachedInputTokens', 'cacheCreationInputTokens', 'reasoningTokens', 'costUsd', 'notionalCostUsd', 'savedUsd', 'costByAuth', 'messagesByAuth']
856
- };
857
- export const UsageProviderAggSchema = {
858
- type: 'object',
859
- properties: {
860
- provider: {
861
- type: 'string'
862
- },
863
- authType: {
864
- '$ref': '#/components/schemas/UsageAuthType'
865
- },
866
- messages: {
867
- type: 'integer'
868
- },
869
- sessions: {
870
- type: 'integer'
871
- },
872
- inputTokens: {
873
- type: 'integer'
874
- },
875
- outputTokens: {
876
- type: 'integer'
877
- },
878
- cachedInputTokens: {
879
- type: 'integer'
880
- },
881
- cacheCreationInputTokens: {
882
- type: 'integer'
883
- },
884
- reasoningTokens: {
885
- type: 'integer'
886
- },
887
- costUsd: {
888
- type: 'number'
889
- },
890
- notionalCostUsd: {
891
- type: 'number'
892
- }
893
- },
894
- required: ['provider', 'authType', 'messages', 'sessions', 'inputTokens', 'outputTokens', 'cachedInputTokens', 'cacheCreationInputTokens', 'reasoningTokens', 'costUsd', 'notionalCostUsd']
895
- };
896
- export const UsageModelAggSchema = {
897
- type: 'object',
898
- properties: {
899
- provider: {
900
- type: 'string'
901
- },
902
- model: {
903
- type: 'string'
904
- },
905
- authType: {
906
- '$ref': '#/components/schemas/UsageAuthType'
907
- },
908
- messages: {
909
- type: 'integer'
910
- },
911
- inputTokens: {
912
- type: 'integer'
913
- },
914
- outputTokens: {
915
- type: 'integer'
916
- },
917
- cachedInputTokens: {
918
- type: 'integer'
919
- },
920
- cacheCreationInputTokens: {
921
- type: 'integer'
922
- },
923
- reasoningTokens: {
924
- type: 'integer'
925
- },
926
- costUsd: {
927
- type: 'number'
928
- },
929
- notionalCostUsd: {
930
- type: 'number'
931
- }
932
- },
933
- required: ['provider', 'model', 'authType', 'messages', 'inputTokens', 'outputTokens', 'cachedInputTokens', 'cacheCreationInputTokens', 'reasoningTokens', 'costUsd', 'notionalCostUsd']
934
- };
935
- export const UsageDailyAggSchema = {
936
- type: 'object',
937
- properties: {
938
- date: {
939
- type: 'string'
940
- },
941
- messages: {
942
- type: 'integer'
943
- },
944
- inputTokens: {
945
- type: 'integer'
946
- },
947
- outputTokens: {
948
- type: 'integer'
949
- },
950
- costUsd: {
951
- type: 'number'
952
- },
953
- notionalCostUsd: {
954
- type: 'number'
955
- },
956
- costByAuth: {
957
- '$ref': '#/components/schemas/UsageAuthAmount'
958
- },
959
- notionalByAuth: {
960
- '$ref': '#/components/schemas/UsageAuthAmount'
961
- }
962
- },
963
- required: ['date', 'messages', 'inputTokens', 'outputTokens', 'costUsd', 'notionalCostUsd', 'costByAuth', 'notionalByAuth']
964
- };
965
- export const UsageProjectInfoSchema = {
966
- type: 'object',
967
- properties: {
968
- id: {
969
- type: 'string'
970
- },
971
- name: {
972
- type: 'string'
973
- },
974
- path: {
975
- type: 'string'
976
- },
977
- lastSeenAt: {
978
- type: 'integer'
979
- },
980
- messages: {
981
- type: 'integer'
982
- },
983
- notionalCostUsd: {
984
- type: 'number'
985
- }
986
- },
987
- required: ['id', 'name', 'path', 'lastSeenAt', 'messages', 'notionalCostUsd']
988
- };
989
- export const UsageProjectUnavailableSchema = {
990
- type: 'object',
991
- properties: {
992
- id: {
993
- type: 'string'
994
- },
995
- name: {
996
- type: 'string'
997
- },
998
- path: {
999
- type: 'string'
1000
- },
1001
- reason: {
1002
- type: 'string'
1003
- }
1004
- },
1005
- required: ['id', 'name', 'path', 'reason']
1006
- };
1007
- export const UsageProjectsBreakdownSchema = {
1008
- type: 'object',
1009
- properties: {
1010
- included: {
1011
- type: 'array',
1012
- items: {
1013
- '$ref': '#/components/schemas/UsageProjectInfo'
1014
- }
1015
- },
1016
- unavailable: {
1017
- type: 'array',
1018
- items: {
1019
- '$ref': '#/components/schemas/UsageProjectUnavailable'
1020
- }
1021
- }
1022
- },
1023
- required: ['included', 'unavailable']
1024
- };
1025
- export const UsageStatsNotesSchema = {
1026
- type: 'object',
1027
- properties: {
1028
- oauthProviders: {
1029
- type: 'array',
1030
- items: {
1031
- type: 'string'
1032
- }
1033
- },
1034
- subscriptionProviders: {
1035
- type: 'array',
1036
- items: {
1037
- type: 'string'
1038
- }
1039
- },
1040
- missingPricing: {
1041
- type: 'array',
1042
- items: {
1043
- type: 'string'
1044
- }
1045
- }
1046
- },
1047
- required: ['oauthProviders', 'subscriptionProviders', 'missingPricing']
1048
- };
1049
- export const UsageStatsSchema = {
1050
- type: 'object',
1051
- properties: {
1052
- scope: {
1053
- type: 'string',
1054
- enum: ['project', 'global']
1055
- },
1056
- project: {
1057
- type: 'string'
1058
- },
1059
- generatedAt: {
1060
- type: 'integer'
1061
- },
1062
- totals: {
1063
- '$ref': '#/components/schemas/UsageTotals'
1064
- },
1065
- providers: {
1066
- type: 'array',
1067
- items: {
1068
- '$ref': '#/components/schemas/UsageProviderAgg'
1069
- }
1070
- },
1071
- models: {
1072
- type: 'array',
1073
- items: {
1074
- '$ref': '#/components/schemas/UsageModelAgg'
1075
- }
1076
- },
1077
- daily: {
1078
- type: 'array',
1079
- items: {
1080
- '$ref': '#/components/schemas/UsageDailyAgg'
1081
- }
1082
- },
1083
- notes: {
1084
- '$ref': '#/components/schemas/UsageStatsNotes'
1085
- },
1086
- projects: {
1087
- '$ref': '#/components/schemas/UsageProjectsBreakdown'
352
+ },
353
+ required: ['included', 'unavailable']
1088
354
  }
1089
355
  },
1090
356
  required: ['scope', 'project', 'generatedAt', 'totals', 'providers', 'models', 'daily', 'notes']