@ottocode/server 0.1.260 → 0.1.261

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 (67) hide show
  1. package/package.json +4 -3
  2. package/src/index.ts +5 -4
  3. package/src/openapi/register.ts +92 -0
  4. package/src/openapi/route.ts +22 -0
  5. package/src/routes/ask.ts +210 -99
  6. package/src/routes/auth.ts +1701 -626
  7. package/src/routes/branch.ts +281 -90
  8. package/src/routes/config/agents.ts +79 -32
  9. package/src/routes/config/cwd.ts +46 -14
  10. package/src/routes/config/debug.ts +159 -30
  11. package/src/routes/config/defaults.ts +182 -64
  12. package/src/routes/config/main.ts +109 -73
  13. package/src/routes/config/models.ts +304 -137
  14. package/src/routes/config/providers.ts +462 -166
  15. package/src/routes/config/utils.ts +2 -2
  16. package/src/routes/doctor.ts +395 -161
  17. package/src/routes/files.ts +650 -260
  18. package/src/routes/git/branch.ts +143 -52
  19. package/src/routes/git/commit.ts +347 -141
  20. package/src/routes/git/diff.ts +239 -116
  21. package/src/routes/git/init.ts +103 -23
  22. package/src/routes/git/pull.ts +167 -65
  23. package/src/routes/git/push.ts +222 -117
  24. package/src/routes/git/remote.ts +401 -100
  25. package/src/routes/git/staging.ts +502 -141
  26. package/src/routes/git/status.ts +171 -78
  27. package/src/routes/mcp.ts +1129 -404
  28. package/src/routes/openapi.ts +27 -4
  29. package/src/routes/ottorouter.ts +1221 -389
  30. package/src/routes/provider-usage.ts +153 -36
  31. package/src/routes/research.ts +817 -370
  32. package/src/routes/root.ts +50 -6
  33. package/src/routes/session-approval.ts +228 -54
  34. package/src/routes/session-files.ts +265 -134
  35. package/src/routes/session-messages.ts +330 -150
  36. package/src/routes/session-stream.ts +83 -2
  37. package/src/routes/sessions.ts +1830 -780
  38. package/src/routes/skills.ts +849 -161
  39. package/src/routes/terminals.ts +469 -103
  40. package/src/routes/tunnel.ts +394 -118
  41. package/src/runtime/ask/service.ts +1 -0
  42. package/src/runtime/message/compaction-limits.ts +3 -3
  43. package/src/runtime/provider/reasoning.ts +2 -1
  44. package/src/runtime/session/db-operations.ts +4 -3
  45. package/src/runtime/utils/token.ts +7 -2
  46. package/src/tools/adapter.ts +21 -0
  47. package/src/openapi/paths/ask.ts +0 -81
  48. package/src/openapi/paths/auth.ts +0 -687
  49. package/src/openapi/paths/branch.ts +0 -102
  50. package/src/openapi/paths/config.ts +0 -485
  51. package/src/openapi/paths/doctor.ts +0 -165
  52. package/src/openapi/paths/files.ts +0 -236
  53. package/src/openapi/paths/git.ts +0 -690
  54. package/src/openapi/paths/mcp.ts +0 -339
  55. package/src/openapi/paths/messages.ts +0 -103
  56. package/src/openapi/paths/ottorouter.ts +0 -594
  57. package/src/openapi/paths/provider-usage.ts +0 -59
  58. package/src/openapi/paths/research.ts +0 -227
  59. package/src/openapi/paths/session-approval.ts +0 -93
  60. package/src/openapi/paths/session-extras.ts +0 -336
  61. package/src/openapi/paths/session-files.ts +0 -91
  62. package/src/openapi/paths/sessions.ts +0 -210
  63. package/src/openapi/paths/skills.ts +0 -377
  64. package/src/openapi/paths/stream.ts +0 -26
  65. package/src/openapi/paths/terminals.ts +0 -226
  66. package/src/openapi/paths/tunnel.ts +0 -163
  67. package/src/openapi/spec.ts +0 -73
@@ -1,91 +0,0 @@
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', '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;
@@ -1,210 +0,0 @@
1
- import { errorResponse, projectQueryParam } from '../helpers';
2
-
3
- export const sessionsPaths = {
4
- '/v1/sessions': {
5
- get: {
6
- tags: ['sessions'],
7
- operationId: 'listSessions',
8
- summary: 'List sessions',
9
- parameters: [
10
- projectQueryParam(),
11
- {
12
- in: 'query',
13
- name: 'limit',
14
- schema: { type: 'integer', default: 50, minimum: 1, maximum: 200 },
15
- description: 'Maximum number of sessions to return',
16
- },
17
- {
18
- in: 'query',
19
- name: 'offset',
20
- schema: { type: 'integer', default: 0, minimum: 0 },
21
- description: 'Offset for pagination',
22
- },
23
- ],
24
- responses: {
25
- 200: {
26
- description: 'OK',
27
- content: {
28
- 'application/json': {
29
- schema: {
30
- type: 'object',
31
- properties: {
32
- items: {
33
- type: 'array',
34
- items: { $ref: '#/components/schemas/Session' },
35
- },
36
- hasMore: { type: 'boolean' },
37
- nextOffset: { type: 'integer', nullable: true },
38
- },
39
- required: ['items', 'hasMore', 'nextOffset'],
40
- },
41
- },
42
- },
43
- },
44
- },
45
- },
46
- post: {
47
- tags: ['sessions'],
48
- operationId: 'createSession',
49
- summary: 'Create a new session',
50
- parameters: [projectQueryParam()],
51
- requestBody: {
52
- required: false,
53
- content: {
54
- 'application/json': {
55
- schema: {
56
- type: 'object',
57
- properties: {
58
- title: { type: 'string', nullable: true },
59
- agent: { type: 'string' },
60
- provider: { $ref: '#/components/schemas/Provider' },
61
- model: { type: 'string' },
62
- },
63
- },
64
- },
65
- },
66
- },
67
- responses: {
68
- 201: {
69
- description: 'Created',
70
- content: {
71
- 'application/json': {
72
- schema: { $ref: '#/components/schemas/Session' },
73
- },
74
- },
75
- },
76
- 400: errorResponse(),
77
- },
78
- },
79
- },
80
- '/v1/sessions/{sessionId}': {
81
- get: {
82
- tags: ['sessions'],
83
- operationId: 'getSession',
84
- summary: 'Get a single session by ID',
85
- parameters: [
86
- {
87
- in: 'path',
88
- name: 'sessionId',
89
- required: true,
90
- schema: { type: 'string' },
91
- },
92
- projectQueryParam(),
93
- ],
94
- responses: {
95
- 200: {
96
- description: 'OK',
97
- content: {
98
- 'application/json': {
99
- schema: { $ref: '#/components/schemas/Session' },
100
- },
101
- },
102
- },
103
- 404: errorResponse(),
104
- },
105
- },
106
- patch: {
107
- tags: ['sessions'],
108
- operationId: 'updateSession',
109
- summary: 'Update session preferences',
110
- parameters: [
111
- {
112
- in: 'path',
113
- name: 'sessionId',
114
- required: true,
115
- schema: { type: 'string' },
116
- },
117
- projectQueryParam(),
118
- ],
119
- requestBody: {
120
- required: true,
121
- content: {
122
- 'application/json': {
123
- schema: {
124
- type: 'object',
125
- properties: {
126
- title: { type: 'string' },
127
- agent: { type: 'string' },
128
- provider: { $ref: '#/components/schemas/Provider' },
129
- model: { type: 'string' },
130
- },
131
- },
132
- },
133
- },
134
- },
135
- responses: {
136
- 200: {
137
- description: 'OK',
138
- content: {
139
- 'application/json': {
140
- schema: { $ref: '#/components/schemas/Session' },
141
- },
142
- },
143
- },
144
- 400: errorResponse(),
145
- 404: errorResponse(),
146
- },
147
- },
148
- delete: {
149
- tags: ['sessions'],
150
- operationId: 'deleteSession',
151
- summary: 'Delete a session',
152
- parameters: [
153
- {
154
- in: 'path',
155
- name: 'sessionId',
156
- required: true,
157
- schema: { type: 'string' },
158
- },
159
- projectQueryParam(),
160
- ],
161
- responses: {
162
- 200: {
163
- description: 'OK',
164
- content: {
165
- 'application/json': {
166
- schema: {
167
- type: 'object',
168
- properties: { success: { type: 'boolean' } },
169
- required: ['success'],
170
- },
171
- },
172
- },
173
- },
174
- 404: errorResponse(),
175
- },
176
- },
177
- },
178
- '/v1/sessions/{sessionId}/abort': {
179
- delete: {
180
- tags: ['sessions'],
181
- operationId: 'abortSession',
182
- summary: 'Abort a running session',
183
- description:
184
- 'Aborts any currently running assistant generation for the session',
185
- parameters: [
186
- {
187
- in: 'path',
188
- name: 'sessionId',
189
- required: true,
190
- schema: { type: 'string' },
191
- description: 'Session ID to abort',
192
- },
193
- ],
194
- responses: {
195
- 200: {
196
- description: 'OK',
197
- content: {
198
- 'application/json': {
199
- schema: {
200
- type: 'object',
201
- properties: { success: { type: 'boolean' } },
202
- required: ['success'],
203
- },
204
- },
205
- },
206
- },
207
- },
208
- },
209
- },
210
- } as const;
@@ -1,377 +0,0 @@
1
- import { errorResponse, projectQueryParam } from '../helpers';
2
-
3
- export const skillsPaths = {
4
- '/v1/config/skills': {
5
- get: {
6
- tags: ['config'],
7
- operationId: 'getSkillsConfig',
8
- summary: 'Get skills enable/disable config and counts',
9
- parameters: [projectQueryParam()],
10
- responses: {
11
- 200: {
12
- description: 'OK',
13
- content: {
14
- 'application/json': {
15
- schema: {
16
- type: 'object',
17
- properties: {
18
- enabled: { type: 'boolean' },
19
- totalCount: { type: 'number' },
20
- enabledCount: { type: 'number' },
21
- items: {
22
- type: 'array',
23
- items: {
24
- type: 'object',
25
- properties: {
26
- name: { type: 'string' },
27
- description: { type: 'string' },
28
- scope: { type: 'string' },
29
- path: { type: 'string' },
30
- enabled: { type: 'boolean' },
31
- },
32
- required: [
33
- 'name',
34
- 'description',
35
- 'scope',
36
- 'path',
37
- 'enabled',
38
- ],
39
- },
40
- },
41
- },
42
- required: ['enabled', 'totalCount', 'enabledCount', 'items'],
43
- },
44
- },
45
- },
46
- },
47
- 500: errorResponse(),
48
- },
49
- },
50
- put: {
51
- tags: ['config'],
52
- operationId: 'updateSkillsConfig',
53
- summary: 'Update skills enable/disable config',
54
- parameters: [projectQueryParam()],
55
- requestBody: {
56
- required: true,
57
- content: {
58
- 'application/json': {
59
- schema: {
60
- type: 'object',
61
- properties: {
62
- enabled: { type: 'boolean' },
63
- items: {
64
- type: 'object',
65
- additionalProperties: {
66
- type: 'object',
67
- properties: {
68
- enabled: { type: 'boolean' },
69
- },
70
- },
71
- },
72
- },
73
- },
74
- },
75
- },
76
- },
77
- responses: {
78
- 200: {
79
- description: 'OK',
80
- content: {
81
- 'application/json': {
82
- schema: {
83
- type: 'object',
84
- properties: {
85
- success: { type: 'boolean' },
86
- enabled: { type: 'boolean' },
87
- totalCount: { type: 'number' },
88
- enabledCount: { type: 'number' },
89
- items: {
90
- type: 'array',
91
- items: {
92
- type: 'object',
93
- properties: {
94
- name: { type: 'string' },
95
- description: { type: 'string' },
96
- scope: { type: 'string' },
97
- path: { type: 'string' },
98
- enabled: { type: 'boolean' },
99
- },
100
- required: [
101
- 'name',
102
- 'description',
103
- 'scope',
104
- 'path',
105
- 'enabled',
106
- ],
107
- },
108
- },
109
- },
110
- required: [
111
- 'success',
112
- 'enabled',
113
- 'totalCount',
114
- 'enabledCount',
115
- 'items',
116
- ],
117
- },
118
- },
119
- },
120
- },
121
- 500: errorResponse(),
122
- },
123
- },
124
- },
125
- '/v1/skills': {
126
- get: {
127
- tags: ['config'],
128
- operationId: 'listSkills',
129
- summary: 'List discovered skills',
130
- parameters: [projectQueryParam()],
131
- responses: {
132
- 200: {
133
- description: 'OK',
134
- content: {
135
- 'application/json': {
136
- schema: {
137
- type: 'object',
138
- properties: {
139
- skills: {
140
- type: 'array',
141
- items: {
142
- type: 'object',
143
- properties: {
144
- name: { type: 'string' },
145
- description: { type: 'string' },
146
- scope: { type: 'string' },
147
- path: { type: 'string' },
148
- },
149
- required: ['name', 'description', 'scope', 'path'],
150
- },
151
- },
152
- },
153
- required: ['skills'],
154
- },
155
- },
156
- },
157
- },
158
- 500: errorResponse(),
159
- },
160
- },
161
- },
162
- '/v1/skills/{name}': {
163
- get: {
164
- tags: ['config'],
165
- operationId: 'getSkill',
166
- summary: 'Get a skill by name',
167
- parameters: [
168
- {
169
- in: 'path',
170
- name: 'name',
171
- required: true,
172
- schema: { type: 'string' },
173
- },
174
- projectQueryParam(),
175
- ],
176
- responses: {
177
- 200: {
178
- description: 'OK',
179
- content: {
180
- 'application/json': {
181
- schema: {
182
- type: 'object',
183
- properties: {
184
- name: { type: 'string' },
185
- description: { type: 'string' },
186
- license: {
187
- type: 'string',
188
- nullable: true,
189
- },
190
- compatibility: {
191
- type: 'string',
192
- nullable: true,
193
- },
194
- metadata: {
195
- type: 'object',
196
- nullable: true,
197
- },
198
- allowedTools: {
199
- type: 'array',
200
- items: { type: 'string' },
201
- nullable: true,
202
- },
203
- path: { type: 'string' },
204
- scope: { type: 'string' },
205
- content: { type: 'string' },
206
- },
207
- required: ['name', 'description', 'path', 'scope', 'content'],
208
- },
209
- },
210
- },
211
- },
212
- 404: errorResponse(),
213
- 500: errorResponse(),
214
- },
215
- },
216
- },
217
- '/v1/skills/{name}/files': {
218
- get: {
219
- tags: ['config'],
220
- operationId: 'listSkillFiles',
221
- summary: 'List files in a skill directory',
222
- parameters: [
223
- {
224
- in: 'path',
225
- name: 'name',
226
- required: true,
227
- schema: { type: 'string' },
228
- },
229
- projectQueryParam(),
230
- ],
231
- responses: {
232
- 200: {
233
- description: 'OK',
234
- content: {
235
- 'application/json': {
236
- schema: {
237
- type: 'object',
238
- properties: {
239
- files: {
240
- type: 'array',
241
- items: {
242
- type: 'object',
243
- properties: {
244
- relativePath: { type: 'string' },
245
- size: { type: 'number' },
246
- },
247
- required: ['relativePath', 'size'],
248
- },
249
- },
250
- },
251
- required: ['files'],
252
- },
253
- },
254
- },
255
- },
256
- 500: errorResponse(),
257
- },
258
- },
259
- },
260
- '/v1/skills/{name}/files/{filePath}': {
261
- get: {
262
- tags: ['config'],
263
- operationId: 'getSkillFile',
264
- summary: 'Read a specific file from a skill directory',
265
- parameters: [
266
- {
267
- in: 'path',
268
- name: 'name',
269
- required: true,
270
- schema: { type: 'string' },
271
- },
272
- {
273
- in: 'path',
274
- name: 'filePath',
275
- required: true,
276
- schema: { type: 'string' },
277
- },
278
- projectQueryParam(),
279
- ],
280
- responses: {
281
- 200: {
282
- description: 'OK',
283
- content: {
284
- 'application/json': {
285
- schema: {
286
- type: 'object',
287
- properties: {
288
- content: { type: 'string' },
289
- path: { type: 'string' },
290
- },
291
- required: ['content', 'path'],
292
- },
293
- },
294
- },
295
- },
296
- 404: errorResponse(),
297
- 500: errorResponse(),
298
- },
299
- },
300
- },
301
- '/v1/skills/validate': {
302
- post: {
303
- tags: ['config'],
304
- operationId: 'validateSkill',
305
- summary: 'Validate a SKILL.md content',
306
- requestBody: {
307
- required: true,
308
- content: {
309
- 'application/json': {
310
- schema: {
311
- type: 'object',
312
- properties: {
313
- content: { type: 'string' },
314
- path: { type: 'string' },
315
- },
316
- required: ['content'],
317
- },
318
- },
319
- },
320
- },
321
- responses: {
322
- 200: {
323
- description: 'OK',
324
- content: {
325
- 'application/json': {
326
- schema: {
327
- type: 'object',
328
- properties: {
329
- valid: { type: 'boolean' },
330
- name: { type: 'string' },
331
- description: { type: 'string' },
332
- license: {
333
- type: 'string',
334
- nullable: true,
335
- },
336
- error: { type: 'string' },
337
- },
338
- required: ['valid'],
339
- },
340
- },
341
- },
342
- },
343
- },
344
- },
345
- },
346
- '/v1/skills/validate-name/{name}': {
347
- get: {
348
- tags: ['config'],
349
- operationId: 'validateSkillName',
350
- summary: 'Check if a skill name is valid',
351
- parameters: [
352
- {
353
- in: 'path',
354
- name: 'name',
355
- required: true,
356
- schema: { type: 'string' },
357
- },
358
- ],
359
- responses: {
360
- 200: {
361
- description: 'OK',
362
- content: {
363
- 'application/json': {
364
- schema: {
365
- type: 'object',
366
- properties: {
367
- valid: { type: 'boolean' },
368
- },
369
- required: ['valid'],
370
- },
371
- },
372
- },
373
- },
374
- },
375
- },
376
- },
377
- } as const;
@@ -1,26 +0,0 @@
1
- import { projectQueryParam, sessionIdParam } from '../helpers';
2
-
3
- export const streamPaths = {
4
- '/v1/sessions/{id}/stream': {
5
- get: {
6
- tags: ['stream'],
7
- operationId: 'subscribeSessionStream',
8
- summary: 'Subscribe to session event stream (SSE)',
9
- parameters: [projectQueryParam(), sessionIdParam()],
10
- responses: {
11
- 200: {
12
- description: 'text/event-stream',
13
- content: {
14
- 'text/event-stream': {
15
- schema: {
16
- type: 'string',
17
- description:
18
- 'SSE event stream. Events include session.created, message.created, message.part.delta, tool.call, tool.delta, tool.result, message.completed, error.',
19
- },
20
- },
21
- },
22
- },
23
- },
24
- },
25
- },
26
- } as const;