@ottocode/server 0.1.212 → 0.1.215

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,172 @@
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/validate': {
97
+ post: {
98
+ tags: ['config'],
99
+ operationId: 'validateSkill',
100
+ summary: 'Validate a SKILL.md content',
101
+ requestBody: {
102
+ required: true,
103
+ content: {
104
+ 'application/json': {
105
+ schema: {
106
+ type: 'object',
107
+ properties: {
108
+ content: { type: 'string' },
109
+ path: { type: 'string' },
110
+ },
111
+ required: ['content'],
112
+ },
113
+ },
114
+ },
115
+ },
116
+ responses: {
117
+ 200: {
118
+ description: 'OK',
119
+ content: {
120
+ 'application/json': {
121
+ schema: {
122
+ type: 'object',
123
+ properties: {
124
+ valid: { type: 'boolean' },
125
+ name: { type: 'string' },
126
+ description: { type: 'string' },
127
+ license: {
128
+ type: 'string',
129
+ nullable: true,
130
+ },
131
+ error: { type: 'string' },
132
+ },
133
+ required: ['valid'],
134
+ },
135
+ },
136
+ },
137
+ },
138
+ },
139
+ },
140
+ },
141
+ '/v1/skills/validate-name/{name}': {
142
+ get: {
143
+ tags: ['config'],
144
+ operationId: 'validateSkillName',
145
+ summary: 'Check if a skill name is valid',
146
+ parameters: [
147
+ {
148
+ in: 'path',
149
+ name: 'name',
150
+ required: true,
151
+ schema: { type: 'string' },
152
+ },
153
+ ],
154
+ responses: {
155
+ 200: {
156
+ description: 'OK',
157
+ content: {
158
+ 'application/json': {
159
+ schema: {
160
+ type: 'object',
161
+ properties: {
162
+ valid: { type: 'boolean' },
163
+ },
164
+ required: ['valid'],
165
+ },
166
+ },
167
+ },
168
+ },
169
+ },
170
+ },
171
+ },
172
+ } as const;
@@ -0,0 +1,163 @@
1
+ import { errorResponse } from '../helpers';
2
+
3
+ export const tunnelPaths = {
4
+ '/v1/tunnel/status': {
5
+ get: {
6
+ tags: ['tunnel'],
7
+ operationId: 'getTunnelStatus',
8
+ summary: 'Get tunnel status',
9
+ responses: {
10
+ 200: {
11
+ description: 'OK',
12
+ content: {
13
+ 'application/json': {
14
+ schema: {
15
+ type: 'object',
16
+ properties: {
17
+ status: {
18
+ type: 'string',
19
+ enum: ['idle', 'starting', 'connected', 'error'],
20
+ },
21
+ url: { type: 'string', nullable: true },
22
+ error: { type: 'string', nullable: true },
23
+ binaryInstalled: { type: 'boolean' },
24
+ isRunning: { type: 'boolean' },
25
+ },
26
+ required: ['status', 'binaryInstalled', 'isRunning'],
27
+ },
28
+ },
29
+ },
30
+ },
31
+ },
32
+ },
33
+ },
34
+ '/v1/tunnel/start': {
35
+ post: {
36
+ tags: ['tunnel'],
37
+ operationId: 'startTunnel',
38
+ summary: 'Start a tunnel',
39
+ requestBody: {
40
+ required: false,
41
+ content: {
42
+ 'application/json': {
43
+ schema: {
44
+ type: 'object',
45
+ properties: {
46
+ port: { type: 'integer' },
47
+ },
48
+ },
49
+ },
50
+ },
51
+ },
52
+ responses: {
53
+ 200: {
54
+ description: 'OK',
55
+ content: {
56
+ 'application/json': {
57
+ schema: {
58
+ type: 'object',
59
+ properties: {
60
+ ok: { type: 'boolean' },
61
+ url: { type: 'string' },
62
+ message: { type: 'string' },
63
+ error: { type: 'string' },
64
+ },
65
+ required: ['ok'],
66
+ },
67
+ },
68
+ },
69
+ },
70
+ },
71
+ },
72
+ },
73
+ '/v1/tunnel/register': {
74
+ post: {
75
+ tags: ['tunnel'],
76
+ operationId: 'registerTunnel',
77
+ summary: 'Register an external tunnel URL',
78
+ requestBody: {
79
+ required: true,
80
+ content: {
81
+ 'application/json': {
82
+ schema: {
83
+ type: 'object',
84
+ properties: {
85
+ url: { type: 'string' },
86
+ },
87
+ required: ['url'],
88
+ },
89
+ },
90
+ },
91
+ },
92
+ responses: {
93
+ 200: {
94
+ description: 'OK',
95
+ content: {
96
+ 'application/json': {
97
+ schema: {
98
+ type: 'object',
99
+ properties: {
100
+ ok: { type: 'boolean' },
101
+ url: { type: 'string' },
102
+ message: { type: 'string' },
103
+ },
104
+ required: ['ok'],
105
+ },
106
+ },
107
+ },
108
+ },
109
+ 400: errorResponse(),
110
+ },
111
+ },
112
+ },
113
+ '/v1/tunnel/stop': {
114
+ post: {
115
+ tags: ['tunnel'],
116
+ operationId: 'stopTunnel',
117
+ summary: 'Stop the tunnel',
118
+ responses: {
119
+ 200: {
120
+ description: 'OK',
121
+ content: {
122
+ 'application/json': {
123
+ schema: {
124
+ type: 'object',
125
+ properties: {
126
+ ok: { type: 'boolean' },
127
+ message: { type: 'string' },
128
+ },
129
+ required: ['ok'],
130
+ },
131
+ },
132
+ },
133
+ },
134
+ },
135
+ },
136
+ },
137
+ '/v1/tunnel/qr': {
138
+ get: {
139
+ tags: ['tunnel'],
140
+ operationId: 'getTunnelQR',
141
+ summary: 'Get QR code for tunnel URL',
142
+ responses: {
143
+ 200: {
144
+ description: 'OK',
145
+ content: {
146
+ 'application/json': {
147
+ schema: {
148
+ type: 'object',
149
+ properties: {
150
+ ok: { type: 'boolean' },
151
+ url: { type: 'string' },
152
+ qrCode: { type: 'string' },
153
+ },
154
+ required: ['ok'],
155
+ },
156
+ },
157
+ },
158
+ },
159
+ 400: errorResponse(),
160
+ },
161
+ },
162
+ },
163
+ } as const;