@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
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { errorResponse, projectQueryParam } from '../helpers';
|
|
2
|
-
|
|
3
|
-
export const doctorPaths = {
|
|
4
|
-
'/v1/doctor': {
|
|
5
|
-
get: {
|
|
6
|
-
tags: ['config'],
|
|
7
|
-
operationId: 'runDoctor',
|
|
8
|
-
summary: 'Run diagnostics on the current configuration',
|
|
9
|
-
parameters: [projectQueryParam()],
|
|
10
|
-
responses: {
|
|
11
|
-
200: {
|
|
12
|
-
description: 'OK',
|
|
13
|
-
content: {
|
|
14
|
-
'application/json': {
|
|
15
|
-
schema: {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
providers: {
|
|
19
|
-
type: 'array',
|
|
20
|
-
items: {
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {
|
|
23
|
-
id: { type: 'string' },
|
|
24
|
-
ok: { type: 'boolean' },
|
|
25
|
-
configured: { type: 'boolean' },
|
|
26
|
-
sources: {
|
|
27
|
-
type: 'array',
|
|
28
|
-
items: { type: 'string' },
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
required: ['id', 'ok', 'configured', 'sources'],
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
defaults: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
properties: {
|
|
37
|
-
agent: { type: 'string' },
|
|
38
|
-
provider: { type: 'string' },
|
|
39
|
-
model: { type: 'string' },
|
|
40
|
-
providerAuthorized: {
|
|
41
|
-
type: 'boolean',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
required: [
|
|
45
|
-
'agent',
|
|
46
|
-
'provider',
|
|
47
|
-
'model',
|
|
48
|
-
'providerAuthorized',
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
agents: {
|
|
52
|
-
type: 'object',
|
|
53
|
-
properties: {
|
|
54
|
-
globalPath: {
|
|
55
|
-
type: 'string',
|
|
56
|
-
nullable: true,
|
|
57
|
-
},
|
|
58
|
-
localPath: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
nullable: true,
|
|
61
|
-
},
|
|
62
|
-
globalNames: {
|
|
63
|
-
type: 'array',
|
|
64
|
-
items: { type: 'string' },
|
|
65
|
-
},
|
|
66
|
-
localNames: {
|
|
67
|
-
type: 'array',
|
|
68
|
-
items: { type: 'string' },
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
required: [
|
|
72
|
-
'globalPath',
|
|
73
|
-
'localPath',
|
|
74
|
-
'globalNames',
|
|
75
|
-
'localNames',
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
tools: {
|
|
79
|
-
type: 'object',
|
|
80
|
-
properties: {
|
|
81
|
-
defaultNames: {
|
|
82
|
-
type: 'array',
|
|
83
|
-
items: { type: 'string' },
|
|
84
|
-
},
|
|
85
|
-
globalPath: {
|
|
86
|
-
type: 'string',
|
|
87
|
-
nullable: true,
|
|
88
|
-
},
|
|
89
|
-
globalNames: {
|
|
90
|
-
type: 'array',
|
|
91
|
-
items: { type: 'string' },
|
|
92
|
-
},
|
|
93
|
-
localPath: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
nullable: true,
|
|
96
|
-
},
|
|
97
|
-
localNames: {
|
|
98
|
-
type: 'array',
|
|
99
|
-
items: { type: 'string' },
|
|
100
|
-
},
|
|
101
|
-
effectiveNames: {
|
|
102
|
-
type: 'array',
|
|
103
|
-
items: { type: 'string' },
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
required: [
|
|
107
|
-
'defaultNames',
|
|
108
|
-
'globalNames',
|
|
109
|
-
'localNames',
|
|
110
|
-
'effectiveNames',
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
commands: {
|
|
114
|
-
type: 'object',
|
|
115
|
-
properties: {
|
|
116
|
-
globalPath: {
|
|
117
|
-
type: 'string',
|
|
118
|
-
nullable: true,
|
|
119
|
-
},
|
|
120
|
-
globalNames: {
|
|
121
|
-
type: 'array',
|
|
122
|
-
items: { type: 'string' },
|
|
123
|
-
},
|
|
124
|
-
localPath: {
|
|
125
|
-
type: 'string',
|
|
126
|
-
nullable: true,
|
|
127
|
-
},
|
|
128
|
-
localNames: {
|
|
129
|
-
type: 'array',
|
|
130
|
-
items: { type: 'string' },
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
required: ['globalNames', 'localNames'],
|
|
134
|
-
},
|
|
135
|
-
issues: {
|
|
136
|
-
type: 'array',
|
|
137
|
-
items: { type: 'string' },
|
|
138
|
-
},
|
|
139
|
-
suggestions: {
|
|
140
|
-
type: 'array',
|
|
141
|
-
items: { type: 'string' },
|
|
142
|
-
},
|
|
143
|
-
globalAuthPath: {
|
|
144
|
-
type: 'string',
|
|
145
|
-
nullable: true,
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
required: [
|
|
149
|
-
'providers',
|
|
150
|
-
'defaults',
|
|
151
|
-
'agents',
|
|
152
|
-
'tools',
|
|
153
|
-
'commands',
|
|
154
|
-
'issues',
|
|
155
|
-
'suggestions',
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
500: errorResponse(),
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
} as const;
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { projectQueryParam } from '../helpers';
|
|
2
|
-
|
|
3
|
-
export const filesPaths = {
|
|
4
|
-
'/v1/files': {
|
|
5
|
-
get: {
|
|
6
|
-
tags: ['files'],
|
|
7
|
-
operationId: 'listFiles',
|
|
8
|
-
summary: 'List project files',
|
|
9
|
-
description:
|
|
10
|
-
'Returns list of files in the project directory, excluding common build artifacts and dependencies',
|
|
11
|
-
parameters: [
|
|
12
|
-
projectQueryParam(),
|
|
13
|
-
{
|
|
14
|
-
in: 'query',
|
|
15
|
-
name: 'maxDepth',
|
|
16
|
-
required: false,
|
|
17
|
-
schema: { type: 'integer', default: 10 },
|
|
18
|
-
description: 'Maximum directory depth to traverse',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
in: 'query',
|
|
22
|
-
name: 'limit',
|
|
23
|
-
required: false,
|
|
24
|
-
schema: { type: 'integer', default: 1000 },
|
|
25
|
-
description: 'Maximum number of files to return',
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
responses: {
|
|
29
|
-
200: {
|
|
30
|
-
description: 'OK',
|
|
31
|
-
content: {
|
|
32
|
-
'application/json': {
|
|
33
|
-
schema: {
|
|
34
|
-
type: 'object',
|
|
35
|
-
properties: {
|
|
36
|
-
files: {
|
|
37
|
-
type: 'array',
|
|
38
|
-
items: { type: 'string' },
|
|
39
|
-
},
|
|
40
|
-
changedFiles: {
|
|
41
|
-
type: 'array',
|
|
42
|
-
items: {
|
|
43
|
-
type: 'object',
|
|
44
|
-
properties: {
|
|
45
|
-
path: { type: 'string' },
|
|
46
|
-
status: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
enum: [
|
|
49
|
-
'added',
|
|
50
|
-
'modified',
|
|
51
|
-
'deleted',
|
|
52
|
-
'renamed',
|
|
53
|
-
'untracked',
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
required: ['path', 'status'],
|
|
58
|
-
},
|
|
59
|
-
description:
|
|
60
|
-
'List of files with uncommitted changes (from git status)',
|
|
61
|
-
},
|
|
62
|
-
truncated: { type: 'boolean' },
|
|
63
|
-
},
|
|
64
|
-
required: ['files', 'changedFiles', 'truncated'],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
'/v1/files/search': {
|
|
73
|
-
get: {
|
|
74
|
-
tags: ['files'],
|
|
75
|
-
operationId: 'searchFiles',
|
|
76
|
-
summary: 'Search project files',
|
|
77
|
-
description:
|
|
78
|
-
'Searches files for mentions and quick-open. Excludes dependencies, build artifacts, and gitignored files by default.',
|
|
79
|
-
parameters: [
|
|
80
|
-
projectQueryParam(),
|
|
81
|
-
{
|
|
82
|
-
in: 'query',
|
|
83
|
-
name: 'q',
|
|
84
|
-
required: false,
|
|
85
|
-
schema: { type: 'string', default: '' },
|
|
86
|
-
description: 'Search query',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
in: 'query',
|
|
90
|
-
name: 'maxDepth',
|
|
91
|
-
required: false,
|
|
92
|
-
schema: { type: 'integer' },
|
|
93
|
-
description: 'Maximum directory depth to traverse',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
in: 'query',
|
|
97
|
-
name: 'limit',
|
|
98
|
-
required: false,
|
|
99
|
-
schema: { type: 'integer' },
|
|
100
|
-
description: 'Maximum number of files to return',
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
responses: {
|
|
104
|
-
200: {
|
|
105
|
-
description: 'OK',
|
|
106
|
-
content: {
|
|
107
|
-
'application/json': {
|
|
108
|
-
schema: {
|
|
109
|
-
type: 'object',
|
|
110
|
-
properties: {
|
|
111
|
-
files: {
|
|
112
|
-
type: 'array',
|
|
113
|
-
items: { type: 'string' },
|
|
114
|
-
},
|
|
115
|
-
changedFiles: {
|
|
116
|
-
type: 'array',
|
|
117
|
-
items: {
|
|
118
|
-
type: 'object',
|
|
119
|
-
properties: {
|
|
120
|
-
path: { type: 'string' },
|
|
121
|
-
status: { type: 'string' },
|
|
122
|
-
},
|
|
123
|
-
required: ['path', 'status'],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
truncated: { type: 'boolean' },
|
|
127
|
-
},
|
|
128
|
-
required: ['files', 'changedFiles', 'truncated'],
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
'/v1/files/tree': {
|
|
137
|
-
get: {
|
|
138
|
-
tags: ['files'],
|
|
139
|
-
operationId: 'getFileTree',
|
|
140
|
-
summary: 'Get directory tree listing',
|
|
141
|
-
parameters: [
|
|
142
|
-
projectQueryParam(),
|
|
143
|
-
{
|
|
144
|
-
in: 'query',
|
|
145
|
-
name: 'path',
|
|
146
|
-
required: false,
|
|
147
|
-
schema: { type: 'string', default: '.' },
|
|
148
|
-
description: 'Directory path relative to project root',
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
responses: {
|
|
152
|
-
200: {
|
|
153
|
-
description: 'OK',
|
|
154
|
-
content: {
|
|
155
|
-
'application/json': {
|
|
156
|
-
schema: {
|
|
157
|
-
type: 'object',
|
|
158
|
-
properties: {
|
|
159
|
-
items: {
|
|
160
|
-
type: 'array',
|
|
161
|
-
items: {
|
|
162
|
-
type: 'object',
|
|
163
|
-
properties: {
|
|
164
|
-
name: { type: 'string' },
|
|
165
|
-
path: { type: 'string' },
|
|
166
|
-
type: {
|
|
167
|
-
type: 'string',
|
|
168
|
-
enum: ['file', 'directory'],
|
|
169
|
-
},
|
|
170
|
-
gitignored: { type: 'boolean' },
|
|
171
|
-
vendor: { type: 'boolean' },
|
|
172
|
-
searchable: { type: 'boolean' },
|
|
173
|
-
},
|
|
174
|
-
required: ['name', 'path', 'type'],
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
path: { type: 'string' },
|
|
178
|
-
truncated: { type: 'boolean' },
|
|
179
|
-
},
|
|
180
|
-
required: ['items', 'path', 'truncated'],
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
'/v1/files/read': {
|
|
189
|
-
get: {
|
|
190
|
-
tags: ['files'],
|
|
191
|
-
operationId: 'readFile',
|
|
192
|
-
summary: 'Read file content',
|
|
193
|
-
parameters: [
|
|
194
|
-
projectQueryParam(),
|
|
195
|
-
{
|
|
196
|
-
in: 'query',
|
|
197
|
-
name: 'path',
|
|
198
|
-
required: true,
|
|
199
|
-
schema: { type: 'string' },
|
|
200
|
-
description: 'File path relative to project root',
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
responses: {
|
|
204
|
-
200: {
|
|
205
|
-
description: 'OK',
|
|
206
|
-
content: {
|
|
207
|
-
'application/json': {
|
|
208
|
-
schema: {
|
|
209
|
-
type: 'object',
|
|
210
|
-
properties: {
|
|
211
|
-
content: { type: 'string' },
|
|
212
|
-
path: { type: 'string' },
|
|
213
|
-
extension: { type: 'string' },
|
|
214
|
-
lineCount: { type: 'integer' },
|
|
215
|
-
},
|
|
216
|
-
required: ['content', 'path', 'extension', 'lineCount'],
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
400: {
|
|
222
|
-
description: 'Bad Request',
|
|
223
|
-
content: {
|
|
224
|
-
'application/json': {
|
|
225
|
-
schema: {
|
|
226
|
-
type: 'object',
|
|
227
|
-
properties: { error: { type: 'string' } },
|
|
228
|
-
required: ['error'],
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
} as const;
|