@ottocode/server 0.1.260 → 0.1.262

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,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;