@ottocode/server 0.1.213 → 0.1.216

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,91 @@
1
+ import { projectQueryParam } from '../helpers';
2
+
3
+ export const sessionFilesPaths = {
4
+ '/v1/sessions/{sessionId}/files': {
5
+ get: {
6
+ tags: ['sessions'],
7
+ operationId: 'getSessionFiles',
8
+ summary: 'Get files modified in a session',
9
+ parameters: [
10
+ {
11
+ in: 'path',
12
+ name: 'sessionId',
13
+ required: true,
14
+ schema: { type: 'string' },
15
+ },
16
+ projectQueryParam(),
17
+ ],
18
+ responses: {
19
+ 200: {
20
+ description: 'OK',
21
+ content: {
22
+ 'application/json': {
23
+ schema: {
24
+ type: 'object',
25
+ properties: {
26
+ files: {
27
+ type: 'array',
28
+ items: {
29
+ type: 'object',
30
+ properties: {
31
+ path: { type: 'string' },
32
+ operationCount: { type: 'integer' },
33
+ firstModified: { type: 'integer' },
34
+ lastModified: { type: 'integer' },
35
+ operations: {
36
+ type: 'array',
37
+ items: {
38
+ type: 'object',
39
+ properties: {
40
+ path: { type: 'string' },
41
+ operation: {
42
+ type: 'string',
43
+ enum: ['write', 'patch', 'edit', 'create'],
44
+ },
45
+ timestamp: { type: 'integer' },
46
+ toolCallId: { type: 'string' },
47
+ toolName: { type: 'string' },
48
+ },
49
+ required: [
50
+ 'path',
51
+ 'operation',
52
+ 'timestamp',
53
+ 'toolCallId',
54
+ 'toolName',
55
+ ],
56
+ },
57
+ },
58
+ },
59
+ required: [
60
+ 'path',
61
+ 'operationCount',
62
+ 'firstModified',
63
+ 'lastModified',
64
+ 'operations',
65
+ ],
66
+ },
67
+ },
68
+ totalFiles: { type: 'integer' },
69
+ totalOperations: { type: 'integer' },
70
+ },
71
+ required: ['files', 'totalFiles', 'totalOperations'],
72
+ },
73
+ },
74
+ },
75
+ },
76
+ 404: {
77
+ description: 'Session not found',
78
+ content: {
79
+ 'application/json': {
80
+ schema: {
81
+ type: 'object',
82
+ properties: { error: { type: 'string' } },
83
+ required: ['error'],
84
+ },
85
+ },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ },
91
+ } as const;
@@ -151,4 +151,262 @@ export const setuPaths = {
151
151
  },
152
152
  },
153
153
  },
154
+ '/v1/setu/topup/polar': {
155
+ post: {
156
+ tags: ['setu'],
157
+ operationId: 'createPolarCheckout',
158
+ summary: 'Create a Polar checkout for topping up',
159
+ requestBody: {
160
+ required: true,
161
+ content: {
162
+ 'application/json': {
163
+ schema: {
164
+ type: 'object',
165
+ properties: {
166
+ amount: { type: 'number' },
167
+ successUrl: { type: 'string' },
168
+ },
169
+ required: ['amount', 'successUrl'],
170
+ },
171
+ },
172
+ },
173
+ },
174
+ responses: {
175
+ 200: {
176
+ description: 'OK',
177
+ content: {
178
+ 'application/json': {
179
+ schema: { type: 'object' },
180
+ },
181
+ },
182
+ },
183
+ 401: {
184
+ description: 'Wallet not configured',
185
+ content: {
186
+ 'application/json': {
187
+ schema: {
188
+ type: 'object',
189
+ properties: { error: { type: 'string' } },
190
+ required: ['error'],
191
+ },
192
+ },
193
+ },
194
+ },
195
+ },
196
+ },
197
+ },
198
+ '/v1/setu/topup/select': {
199
+ post: {
200
+ tags: ['setu'],
201
+ operationId: 'selectTopupMethod',
202
+ summary: 'Select topup method for pending request',
203
+ requestBody: {
204
+ required: true,
205
+ content: {
206
+ 'application/json': {
207
+ schema: {
208
+ type: 'object',
209
+ properties: {
210
+ sessionId: { type: 'string' },
211
+ method: {
212
+ type: 'string',
213
+ enum: ['crypto', 'fiat'],
214
+ },
215
+ },
216
+ required: ['sessionId', 'method'],
217
+ },
218
+ },
219
+ },
220
+ },
221
+ responses: {
222
+ 200: {
223
+ description: 'OK',
224
+ content: {
225
+ 'application/json': {
226
+ schema: {
227
+ type: 'object',
228
+ properties: {
229
+ success: { type: 'boolean' },
230
+ method: { type: 'string' },
231
+ },
232
+ required: ['success', 'method'],
233
+ },
234
+ },
235
+ },
236
+ },
237
+ 404: {
238
+ description: 'No pending topup',
239
+ content: {
240
+ 'application/json': {
241
+ schema: {
242
+ type: 'object',
243
+ properties: { error: { type: 'string' } },
244
+ required: ['error'],
245
+ },
246
+ },
247
+ },
248
+ },
249
+ },
250
+ },
251
+ },
252
+ '/v1/setu/topup/cancel': {
253
+ post: {
254
+ tags: ['setu'],
255
+ operationId: 'cancelTopup',
256
+ summary: 'Cancel pending topup',
257
+ requestBody: {
258
+ required: true,
259
+ content: {
260
+ 'application/json': {
261
+ schema: {
262
+ type: 'object',
263
+ properties: {
264
+ sessionId: { type: 'string' },
265
+ reason: { type: 'string' },
266
+ },
267
+ required: ['sessionId'],
268
+ },
269
+ },
270
+ },
271
+ },
272
+ responses: {
273
+ 200: {
274
+ description: 'OK',
275
+ content: {
276
+ 'application/json': {
277
+ schema: {
278
+ type: 'object',
279
+ properties: {
280
+ success: { type: 'boolean' },
281
+ },
282
+ required: ['success'],
283
+ },
284
+ },
285
+ },
286
+ },
287
+ 404: {
288
+ description: 'No pending topup',
289
+ content: {
290
+ 'application/json': {
291
+ schema: {
292
+ type: 'object',
293
+ properties: { error: { type: 'string' } },
294
+ required: ['error'],
295
+ },
296
+ },
297
+ },
298
+ },
299
+ },
300
+ },
301
+ },
302
+ '/v1/setu/topup/pending': {
303
+ get: {
304
+ tags: ['setu'],
305
+ operationId: 'getPendingTopup',
306
+ summary: 'Get pending topup for a session',
307
+ parameters: [
308
+ {
309
+ in: 'query',
310
+ name: 'sessionId',
311
+ required: true,
312
+ schema: { type: 'string' },
313
+ },
314
+ ],
315
+ responses: {
316
+ 200: {
317
+ description: 'OK',
318
+ content: {
319
+ 'application/json': {
320
+ schema: {
321
+ type: 'object',
322
+ properties: {
323
+ hasPending: { type: 'boolean' },
324
+ sessionId: { type: 'string' },
325
+ messageId: { type: 'string' },
326
+ amountUsd: { type: 'number' },
327
+ currentBalance: { type: 'number' },
328
+ createdAt: { type: 'integer' },
329
+ },
330
+ required: ['hasPending'],
331
+ },
332
+ },
333
+ },
334
+ },
335
+ },
336
+ },
337
+ },
338
+ '/v1/setu/topup/polar/estimate': {
339
+ get: {
340
+ tags: ['setu'],
341
+ operationId: 'getPolarTopupEstimate',
342
+ summary: 'Get estimated fees for a Polar topup',
343
+ parameters: [
344
+ {
345
+ in: 'query',
346
+ name: 'amount',
347
+ required: true,
348
+ schema: { type: 'number' },
349
+ description: 'Amount in USD',
350
+ },
351
+ ],
352
+ responses: {
353
+ 200: {
354
+ description: 'OK',
355
+ content: {
356
+ 'application/json': {
357
+ schema: {
358
+ type: 'object',
359
+ properties: {
360
+ creditAmount: { type: 'number' },
361
+ chargeAmount: { type: 'number' },
362
+ feeAmount: { type: 'number' },
363
+ feeBreakdown: {
364
+ type: 'object',
365
+ properties: {
366
+ basePercent: { type: 'number' },
367
+ internationalPercent: { type: 'number' },
368
+ fixedCents: { type: 'number' },
369
+ },
370
+ },
371
+ },
372
+ },
373
+ },
374
+ },
375
+ },
376
+ },
377
+ },
378
+ },
379
+ '/v1/setu/topup/polar/status': {
380
+ get: {
381
+ tags: ['setu'],
382
+ operationId: 'getPolarTopupStatus',
383
+ summary: 'Get status of a Polar checkout',
384
+ parameters: [
385
+ {
386
+ in: 'query',
387
+ name: 'checkoutId',
388
+ required: true,
389
+ schema: { type: 'string' },
390
+ },
391
+ ],
392
+ responses: {
393
+ 200: {
394
+ description: 'OK',
395
+ content: {
396
+ 'application/json': {
397
+ schema: {
398
+ type: 'object',
399
+ properties: {
400
+ checkoutId: { type: 'string' },
401
+ confirmed: { type: 'boolean' },
402
+ amountUsd: { type: 'number', nullable: true },
403
+ confirmedAt: { type: 'string', nullable: true },
404
+ },
405
+ },
406
+ },
407
+ },
408
+ },
409
+ },
410
+ },
411
+ },
154
412
  } as const;
@@ -0,0 +1,256 @@
1
+ import { errorResponse, projectQueryParam } from '../helpers';
2
+
3
+ export const skillsPaths = {
4
+ '/v1/skills': {
5
+ get: {
6
+ tags: ['config'],
7
+ operationId: 'listSkills',
8
+ summary: 'List discovered skills',
9
+ parameters: [projectQueryParam()],
10
+ responses: {
11
+ 200: {
12
+ description: 'OK',
13
+ content: {
14
+ 'application/json': {
15
+ schema: {
16
+ type: 'object',
17
+ properties: {
18
+ skills: {
19
+ type: 'array',
20
+ items: {
21
+ type: 'object',
22
+ properties: {
23
+ name: { type: 'string' },
24
+ description: { type: 'string' },
25
+ scope: { type: 'string' },
26
+ path: { type: 'string' },
27
+ },
28
+ required: ['name', 'description', 'scope', 'path'],
29
+ },
30
+ },
31
+ },
32
+ required: ['skills'],
33
+ },
34
+ },
35
+ },
36
+ },
37
+ 500: errorResponse(),
38
+ },
39
+ },
40
+ },
41
+ '/v1/skills/{name}': {
42
+ get: {
43
+ tags: ['config'],
44
+ operationId: 'getSkill',
45
+ summary: 'Get a skill by name',
46
+ parameters: [
47
+ {
48
+ in: 'path',
49
+ name: 'name',
50
+ required: true,
51
+ schema: { type: 'string' },
52
+ },
53
+ projectQueryParam(),
54
+ ],
55
+ responses: {
56
+ 200: {
57
+ description: 'OK',
58
+ content: {
59
+ 'application/json': {
60
+ schema: {
61
+ type: 'object',
62
+ properties: {
63
+ name: { type: 'string' },
64
+ description: { type: 'string' },
65
+ license: {
66
+ type: 'string',
67
+ nullable: true,
68
+ },
69
+ compatibility: {
70
+ type: 'string',
71
+ nullable: true,
72
+ },
73
+ metadata: {
74
+ type: 'object',
75
+ nullable: true,
76
+ },
77
+ allowedTools: {
78
+ type: 'array',
79
+ items: { type: 'string' },
80
+ nullable: true,
81
+ },
82
+ path: { type: 'string' },
83
+ scope: { type: 'string' },
84
+ content: { type: 'string' },
85
+ },
86
+ required: ['name', 'description', 'path', 'scope', 'content'],
87
+ },
88
+ },
89
+ },
90
+ },
91
+ 404: errorResponse(),
92
+ 500: errorResponse(),
93
+ },
94
+ },
95
+ },
96
+ '/v1/skills/{name}/files': {
97
+ get: {
98
+ tags: ['config'],
99
+ operationId: 'listSkillFiles',
100
+ summary: 'List files in a skill directory',
101
+ parameters: [
102
+ {
103
+ in: 'path',
104
+ name: 'name',
105
+ required: true,
106
+ schema: { type: 'string' },
107
+ },
108
+ projectQueryParam(),
109
+ ],
110
+ responses: {
111
+ 200: {
112
+ description: 'OK',
113
+ content: {
114
+ 'application/json': {
115
+ schema: {
116
+ type: 'object',
117
+ properties: {
118
+ files: {
119
+ type: 'array',
120
+ items: {
121
+ type: 'object',
122
+ properties: {
123
+ relativePath: { type: 'string' },
124
+ size: { type: 'number' },
125
+ },
126
+ required: ['relativePath', 'size'],
127
+ },
128
+ },
129
+ },
130
+ required: ['files'],
131
+ },
132
+ },
133
+ },
134
+ },
135
+ 500: errorResponse(),
136
+ },
137
+ },
138
+ },
139
+ '/v1/skills/{name}/files/{filePath}': {
140
+ get: {
141
+ tags: ['config'],
142
+ operationId: 'getSkillFile',
143
+ summary: 'Read a specific file from a skill directory',
144
+ parameters: [
145
+ {
146
+ in: 'path',
147
+ name: 'name',
148
+ required: true,
149
+ schema: { type: 'string' },
150
+ },
151
+ {
152
+ in: 'path',
153
+ name: 'filePath',
154
+ required: true,
155
+ schema: { type: 'string' },
156
+ },
157
+ projectQueryParam(),
158
+ ],
159
+ responses: {
160
+ 200: {
161
+ description: 'OK',
162
+ content: {
163
+ 'application/json': {
164
+ schema: {
165
+ type: 'object',
166
+ properties: {
167
+ content: { type: 'string' },
168
+ path: { type: 'string' },
169
+ },
170
+ required: ['content', 'path'],
171
+ },
172
+ },
173
+ },
174
+ },
175
+ 404: errorResponse(),
176
+ 500: errorResponse(),
177
+ },
178
+ },
179
+ },
180
+ '/v1/skills/validate': {
181
+ post: {
182
+ tags: ['config'],
183
+ operationId: 'validateSkill',
184
+ summary: 'Validate a SKILL.md content',
185
+ requestBody: {
186
+ required: true,
187
+ content: {
188
+ 'application/json': {
189
+ schema: {
190
+ type: 'object',
191
+ properties: {
192
+ content: { type: 'string' },
193
+ path: { type: 'string' },
194
+ },
195
+ required: ['content'],
196
+ },
197
+ },
198
+ },
199
+ },
200
+ responses: {
201
+ 200: {
202
+ description: 'OK',
203
+ content: {
204
+ 'application/json': {
205
+ schema: {
206
+ type: 'object',
207
+ properties: {
208
+ valid: { type: 'boolean' },
209
+ name: { type: 'string' },
210
+ description: { type: 'string' },
211
+ license: {
212
+ type: 'string',
213
+ nullable: true,
214
+ },
215
+ error: { type: 'string' },
216
+ },
217
+ required: ['valid'],
218
+ },
219
+ },
220
+ },
221
+ },
222
+ },
223
+ },
224
+ },
225
+ '/v1/skills/validate-name/{name}': {
226
+ get: {
227
+ tags: ['config'],
228
+ operationId: 'validateSkillName',
229
+ summary: 'Check if a skill name is valid',
230
+ parameters: [
231
+ {
232
+ in: 'path',
233
+ name: 'name',
234
+ required: true,
235
+ schema: { type: 'string' },
236
+ },
237
+ ],
238
+ responses: {
239
+ 200: {
240
+ description: 'OK',
241
+ content: {
242
+ 'application/json': {
243
+ schema: {
244
+ type: 'object',
245
+ properties: {
246
+ valid: { type: 'boolean' },
247
+ },
248
+ required: ['valid'],
249
+ },
250
+ },
251
+ },
252
+ },
253
+ },
254
+ },
255
+ },
256
+ } as const;