@ottocode/server 0.1.259 → 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.
- package/package.json +4 -3
- package/src/index.ts +5 -4
- package/src/openapi/register.ts +92 -0
- package/src/openapi/route.ts +22 -0
- package/src/routes/ask.ts +210 -99
- package/src/routes/auth.ts +1701 -626
- package/src/routes/branch.ts +281 -90
- package/src/routes/config/agents.ts +79 -32
- package/src/routes/config/cwd.ts +46 -14
- package/src/routes/config/debug.ts +159 -30
- package/src/routes/config/defaults.ts +182 -64
- package/src/routes/config/main.ts +109 -73
- package/src/routes/config/models.ts +304 -137
- package/src/routes/config/providers.ts +462 -166
- package/src/routes/config/utils.ts +2 -2
- package/src/routes/doctor.ts +395 -161
- package/src/routes/files.ts +650 -260
- package/src/routes/git/branch.ts +143 -52
- package/src/routes/git/commit.ts +347 -141
- package/src/routes/git/diff.ts +239 -116
- package/src/routes/git/init.ts +103 -23
- package/src/routes/git/pull.ts +167 -65
- package/src/routes/git/push.ts +222 -117
- package/src/routes/git/remote.ts +401 -100
- package/src/routes/git/staging.ts +502 -141
- package/src/routes/git/status.ts +171 -78
- package/src/routes/mcp.ts +1129 -404
- package/src/routes/openapi.ts +27 -4
- package/src/routes/ottorouter.ts +1221 -389
- package/src/routes/provider-usage.ts +153 -36
- package/src/routes/research.ts +817 -370
- package/src/routes/root.ts +50 -6
- package/src/routes/session-approval.ts +228 -54
- package/src/routes/session-files.ts +265 -134
- package/src/routes/session-messages.ts +330 -150
- package/src/routes/session-stream.ts +83 -2
- package/src/routes/sessions.ts +1830 -780
- package/src/routes/skills.ts +849 -161
- package/src/routes/terminals.ts +469 -103
- package/src/routes/tunnel.ts +394 -118
- package/src/runtime/agent/runner-reasoning.ts +38 -3
- package/src/runtime/agent/runner.ts +1 -0
- package/src/runtime/ask/service.ts +1 -0
- package/src/runtime/message/compaction-limits.ts +3 -3
- package/src/runtime/provider/reasoning.ts +18 -7
- package/src/runtime/session/db-operations.ts +4 -3
- package/src/runtime/utils/token.ts +7 -2
- package/src/tools/adapter.ts +21 -0
- package/src/openapi/paths/ask.ts +0 -81
- package/src/openapi/paths/auth.ts +0 -687
- package/src/openapi/paths/branch.ts +0 -102
- package/src/openapi/paths/config.ts +0 -485
- package/src/openapi/paths/doctor.ts +0 -165
- package/src/openapi/paths/files.ts +0 -236
- package/src/openapi/paths/git.ts +0 -690
- package/src/openapi/paths/mcp.ts +0 -339
- package/src/openapi/paths/messages.ts +0 -103
- package/src/openapi/paths/ottorouter.ts +0 -594
- package/src/openapi/paths/provider-usage.ts +0 -59
- package/src/openapi/paths/research.ts +0 -227
- package/src/openapi/paths/session-approval.ts +0 -93
- package/src/openapi/paths/session-extras.ts +0 -336
- package/src/openapi/paths/session-files.ts +0 -91
- package/src/openapi/paths/sessions.ts +0 -210
- package/src/openapi/paths/skills.ts +0 -377
- package/src/openapi/paths/stream.ts +0 -26
- package/src/openapi/paths/terminals.ts +0 -226
- package/src/openapi/paths/tunnel.ts +0 -163
- package/src/openapi/spec.ts +0 -73
package/src/openapi/paths/mcp.ts
DELETED
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { errorResponse } from '../helpers';
|
|
2
|
-
|
|
3
|
-
const nameParam = {
|
|
4
|
-
in: 'path',
|
|
5
|
-
name: 'name',
|
|
6
|
-
required: true,
|
|
7
|
-
schema: { type: 'string' },
|
|
8
|
-
description: 'MCP server name',
|
|
9
|
-
} as const;
|
|
10
|
-
|
|
11
|
-
const okErrorSchema = {
|
|
12
|
-
type: 'object',
|
|
13
|
-
properties: {
|
|
14
|
-
ok: { type: 'boolean' },
|
|
15
|
-
error: { type: 'string' },
|
|
16
|
-
},
|
|
17
|
-
required: ['ok'],
|
|
18
|
-
} as const;
|
|
19
|
-
|
|
20
|
-
export const mcpPaths = {
|
|
21
|
-
'/v1/mcp/servers': {
|
|
22
|
-
get: {
|
|
23
|
-
tags: ['mcp'],
|
|
24
|
-
operationId: 'listMCPServers',
|
|
25
|
-
summary: 'List configured MCP servers',
|
|
26
|
-
responses: {
|
|
27
|
-
200: {
|
|
28
|
-
description: 'OK',
|
|
29
|
-
content: {
|
|
30
|
-
'application/json': {
|
|
31
|
-
schema: {
|
|
32
|
-
type: 'object',
|
|
33
|
-
properties: {
|
|
34
|
-
servers: {
|
|
35
|
-
type: 'array',
|
|
36
|
-
items: { $ref: '#/components/schemas/MCPServer' },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: ['servers'],
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
post: {
|
|
47
|
-
tags: ['mcp'],
|
|
48
|
-
operationId: 'addMCPServer',
|
|
49
|
-
summary: 'Add a new MCP server',
|
|
50
|
-
requestBody: {
|
|
51
|
-
required: true,
|
|
52
|
-
content: {
|
|
53
|
-
'application/json': {
|
|
54
|
-
schema: {
|
|
55
|
-
type: 'object',
|
|
56
|
-
properties: {
|
|
57
|
-
name: { type: 'string' },
|
|
58
|
-
transport: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
enum: ['stdio', 'http', 'sse'],
|
|
61
|
-
default: 'stdio',
|
|
62
|
-
},
|
|
63
|
-
command: { type: 'string' },
|
|
64
|
-
args: {
|
|
65
|
-
type: 'array',
|
|
66
|
-
items: { type: 'string' },
|
|
67
|
-
},
|
|
68
|
-
env: {
|
|
69
|
-
type: 'object',
|
|
70
|
-
additionalProperties: { type: 'string' },
|
|
71
|
-
},
|
|
72
|
-
url: { type: 'string' },
|
|
73
|
-
headers: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
additionalProperties: { type: 'string' },
|
|
76
|
-
},
|
|
77
|
-
oauth: { type: 'object' },
|
|
78
|
-
scope: {
|
|
79
|
-
type: 'string',
|
|
80
|
-
enum: ['global', 'project'],
|
|
81
|
-
default: 'global',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
required: ['name'],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
responses: {
|
|
90
|
-
200: {
|
|
91
|
-
description: 'OK',
|
|
92
|
-
content: { 'application/json': { schema: okErrorSchema } },
|
|
93
|
-
},
|
|
94
|
-
400: errorResponse(),
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
'/v1/mcp/servers/{name}': {
|
|
99
|
-
delete: {
|
|
100
|
-
tags: ['mcp'],
|
|
101
|
-
operationId: 'removeMCPServer',
|
|
102
|
-
summary: 'Remove an MCP server',
|
|
103
|
-
parameters: [nameParam],
|
|
104
|
-
responses: {
|
|
105
|
-
200: {
|
|
106
|
-
description: 'OK',
|
|
107
|
-
content: { 'application/json': { schema: okErrorSchema } },
|
|
108
|
-
},
|
|
109
|
-
404: errorResponse(),
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
'/v1/mcp/servers/{name}/start': {
|
|
114
|
-
post: {
|
|
115
|
-
tags: ['mcp'],
|
|
116
|
-
operationId: 'startMCPServer',
|
|
117
|
-
summary: 'Start an MCP server',
|
|
118
|
-
parameters: [nameParam],
|
|
119
|
-
responses: {
|
|
120
|
-
200: {
|
|
121
|
-
description: 'OK',
|
|
122
|
-
content: {
|
|
123
|
-
'application/json': {
|
|
124
|
-
schema: {
|
|
125
|
-
type: 'object',
|
|
126
|
-
properties: {
|
|
127
|
-
ok: { type: 'boolean' },
|
|
128
|
-
name: { type: 'string' },
|
|
129
|
-
connected: { type: 'boolean' },
|
|
130
|
-
tools: {
|
|
131
|
-
type: 'array',
|
|
132
|
-
items: {
|
|
133
|
-
type: 'object',
|
|
134
|
-
properties: {
|
|
135
|
-
name: { type: 'string' },
|
|
136
|
-
description: { type: 'string' },
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
authRequired: { type: 'boolean' },
|
|
141
|
-
authType: { type: 'string' },
|
|
142
|
-
sessionId: { type: 'string' },
|
|
143
|
-
userCode: { type: 'string' },
|
|
144
|
-
verificationUri: { type: 'string' },
|
|
145
|
-
interval: { type: 'integer' },
|
|
146
|
-
authUrl: { type: 'string' },
|
|
147
|
-
error: { type: 'string' },
|
|
148
|
-
},
|
|
149
|
-
required: ['ok'],
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
404: errorResponse(),
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
'/v1/mcp/servers/{name}/stop': {
|
|
159
|
-
post: {
|
|
160
|
-
tags: ['mcp'],
|
|
161
|
-
operationId: 'stopMCPServer',
|
|
162
|
-
summary: 'Stop an MCP server',
|
|
163
|
-
parameters: [nameParam],
|
|
164
|
-
responses: {
|
|
165
|
-
200: {
|
|
166
|
-
description: 'OK',
|
|
167
|
-
content: { 'application/json': { schema: okErrorSchema } },
|
|
168
|
-
},
|
|
169
|
-
400: errorResponse(),
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
'/v1/mcp/servers/{name}/auth': {
|
|
174
|
-
post: {
|
|
175
|
-
tags: ['mcp'],
|
|
176
|
-
operationId: 'initiateMCPAuth',
|
|
177
|
-
summary: 'Initiate auth for an MCP server',
|
|
178
|
-
parameters: [nameParam],
|
|
179
|
-
responses: {
|
|
180
|
-
200: {
|
|
181
|
-
description: 'OK',
|
|
182
|
-
content: {
|
|
183
|
-
'application/json': {
|
|
184
|
-
schema: {
|
|
185
|
-
type: 'object',
|
|
186
|
-
properties: {
|
|
187
|
-
ok: { type: 'boolean' },
|
|
188
|
-
name: { type: 'string' },
|
|
189
|
-
authUrl: { type: 'string' },
|
|
190
|
-
authType: { type: 'string' },
|
|
191
|
-
authenticated: { type: 'boolean' },
|
|
192
|
-
sessionId: { type: 'string' },
|
|
193
|
-
userCode: { type: 'string' },
|
|
194
|
-
verificationUri: { type: 'string' },
|
|
195
|
-
interval: { type: 'integer' },
|
|
196
|
-
message: { type: 'string' },
|
|
197
|
-
error: { type: 'string' },
|
|
198
|
-
},
|
|
199
|
-
required: ['ok'],
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
404: errorResponse(),
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
delete: {
|
|
208
|
-
tags: ['mcp'],
|
|
209
|
-
operationId: 'revokeMCPAuth',
|
|
210
|
-
summary: 'Revoke auth for an MCP server',
|
|
211
|
-
parameters: [nameParam],
|
|
212
|
-
responses: {
|
|
213
|
-
200: {
|
|
214
|
-
description: 'OK',
|
|
215
|
-
content: { 'application/json': { schema: okErrorSchema } },
|
|
216
|
-
},
|
|
217
|
-
400: errorResponse(),
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
'/v1/mcp/servers/{name}/auth/callback': {
|
|
222
|
-
post: {
|
|
223
|
-
tags: ['mcp'],
|
|
224
|
-
operationId: 'completeMCPAuth',
|
|
225
|
-
summary: 'Complete MCP server auth callback',
|
|
226
|
-
parameters: [nameParam],
|
|
227
|
-
requestBody: {
|
|
228
|
-
required: true,
|
|
229
|
-
content: {
|
|
230
|
-
'application/json': {
|
|
231
|
-
schema: {
|
|
232
|
-
type: 'object',
|
|
233
|
-
properties: {
|
|
234
|
-
code: { type: 'string' },
|
|
235
|
-
sessionId: { type: 'string' },
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
responses: {
|
|
242
|
-
200: {
|
|
243
|
-
description: 'OK',
|
|
244
|
-
content: {
|
|
245
|
-
'application/json': {
|
|
246
|
-
schema: {
|
|
247
|
-
type: 'object',
|
|
248
|
-
properties: {
|
|
249
|
-
ok: { type: 'boolean' },
|
|
250
|
-
status: {
|
|
251
|
-
type: 'string',
|
|
252
|
-
enum: ['complete', 'pending', 'error'],
|
|
253
|
-
},
|
|
254
|
-
name: { type: 'string' },
|
|
255
|
-
connected: { type: 'boolean' },
|
|
256
|
-
tools: {
|
|
257
|
-
type: 'array',
|
|
258
|
-
items: {
|
|
259
|
-
type: 'object',
|
|
260
|
-
properties: {
|
|
261
|
-
name: { type: 'string' },
|
|
262
|
-
description: { type: 'string' },
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
error: { type: 'string' },
|
|
267
|
-
},
|
|
268
|
-
required: ['ok'],
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
400: errorResponse(),
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
'/v1/mcp/servers/{name}/auth/status': {
|
|
278
|
-
get: {
|
|
279
|
-
tags: ['mcp'],
|
|
280
|
-
operationId: 'getMCPAuthStatus',
|
|
281
|
-
summary: 'Get auth status for an MCP server',
|
|
282
|
-
parameters: [nameParam],
|
|
283
|
-
responses: {
|
|
284
|
-
200: {
|
|
285
|
-
description: 'OK',
|
|
286
|
-
content: {
|
|
287
|
-
'application/json': {
|
|
288
|
-
schema: {
|
|
289
|
-
type: 'object',
|
|
290
|
-
properties: {
|
|
291
|
-
authenticated: { type: 'boolean' },
|
|
292
|
-
authType: { type: 'string' },
|
|
293
|
-
},
|
|
294
|
-
required: ['authenticated'],
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
'/v1/mcp/servers/{name}/test': {
|
|
303
|
-
post: {
|
|
304
|
-
tags: ['mcp'],
|
|
305
|
-
operationId: 'testMCPServer',
|
|
306
|
-
summary: 'Test connection to an MCP server',
|
|
307
|
-
parameters: [nameParam],
|
|
308
|
-
responses: {
|
|
309
|
-
200: {
|
|
310
|
-
description: 'OK',
|
|
311
|
-
content: {
|
|
312
|
-
'application/json': {
|
|
313
|
-
schema: {
|
|
314
|
-
type: 'object',
|
|
315
|
-
properties: {
|
|
316
|
-
ok: { type: 'boolean' },
|
|
317
|
-
name: { type: 'string' },
|
|
318
|
-
tools: {
|
|
319
|
-
type: 'array',
|
|
320
|
-
items: {
|
|
321
|
-
type: 'object',
|
|
322
|
-
properties: {
|
|
323
|
-
name: { type: 'string' },
|
|
324
|
-
description: { type: 'string' },
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
|
-
error: { type: 'string' },
|
|
329
|
-
},
|
|
330
|
-
required: ['ok'],
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
},
|
|
335
|
-
404: errorResponse(),
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
} as const;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
errorResponse,
|
|
3
|
-
projectQueryParam,
|
|
4
|
-
sessionIdParam,
|
|
5
|
-
withoutParam,
|
|
6
|
-
} from '../helpers';
|
|
7
|
-
|
|
8
|
-
export const messagesPaths = {
|
|
9
|
-
'/v1/sessions/{id}/messages': {
|
|
10
|
-
get: {
|
|
11
|
-
tags: ['messages'],
|
|
12
|
-
operationId: 'listMessages',
|
|
13
|
-
summary: 'List messages for a session',
|
|
14
|
-
parameters: [projectQueryParam(), sessionIdParam(), withoutParam()],
|
|
15
|
-
responses: {
|
|
16
|
-
200: {
|
|
17
|
-
description: 'OK',
|
|
18
|
-
content: {
|
|
19
|
-
'application/json': {
|
|
20
|
-
schema: {
|
|
21
|
-
type: 'array',
|
|
22
|
-
items: {
|
|
23
|
-
allOf: [
|
|
24
|
-
{ $ref: '#/components/schemas/Message' },
|
|
25
|
-
{
|
|
26
|
-
type: 'object',
|
|
27
|
-
properties: {
|
|
28
|
-
parts: {
|
|
29
|
-
type: 'array',
|
|
30
|
-
items: {
|
|
31
|
-
$ref: '#/components/schemas/MessagePart',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
required: [],
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
post: {
|
|
46
|
-
tags: ['messages'],
|
|
47
|
-
operationId: 'createMessage',
|
|
48
|
-
summary: 'Send a user message and enqueue assistant run',
|
|
49
|
-
parameters: [projectQueryParam(), sessionIdParam()],
|
|
50
|
-
requestBody: {
|
|
51
|
-
required: true,
|
|
52
|
-
content: {
|
|
53
|
-
'application/json': {
|
|
54
|
-
schema: {
|
|
55
|
-
type: 'object',
|
|
56
|
-
required: ['content'],
|
|
57
|
-
properties: {
|
|
58
|
-
content: { type: 'string' },
|
|
59
|
-
agent: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'Agent name. Defaults to config if omitted.',
|
|
62
|
-
},
|
|
63
|
-
provider: { $ref: '#/components/schemas/Provider' },
|
|
64
|
-
model: { type: 'string' },
|
|
65
|
-
userContext: {
|
|
66
|
-
type: 'string',
|
|
67
|
-
description:
|
|
68
|
-
'Optional user-provided context to include in the system prompt.',
|
|
69
|
-
},
|
|
70
|
-
reasoningText: {
|
|
71
|
-
type: 'boolean',
|
|
72
|
-
description:
|
|
73
|
-
'Enable extended thinking / reasoning for models that support it.',
|
|
74
|
-
},
|
|
75
|
-
reasoningLevel: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
enum: ['minimal', 'low', 'medium', 'high', 'max', 'xhigh'],
|
|
78
|
-
description:
|
|
79
|
-
'Reasoning intensity level for providers/models that support it.',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
responses: {
|
|
87
|
-
202: {
|
|
88
|
-
description: 'Accepted',
|
|
89
|
-
content: {
|
|
90
|
-
'application/json': {
|
|
91
|
-
schema: {
|
|
92
|
-
type: 'object',
|
|
93
|
-
properties: { messageId: { type: 'string' } },
|
|
94
|
-
required: ['messageId'],
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
400: errorResponse(),
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
} as const;
|