@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.
Files changed (69) 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/agent/runner-reasoning.ts +38 -3
  42. package/src/runtime/agent/runner.ts +1 -0
  43. package/src/runtime/ask/service.ts +1 -0
  44. package/src/runtime/message/compaction-limits.ts +3 -3
  45. package/src/runtime/provider/reasoning.ts +18 -7
  46. package/src/runtime/session/db-operations.ts +4 -3
  47. package/src/runtime/utils/token.ts +7 -2
  48. package/src/tools/adapter.ts +21 -0
  49. package/src/openapi/paths/ask.ts +0 -81
  50. package/src/openapi/paths/auth.ts +0 -687
  51. package/src/openapi/paths/branch.ts +0 -102
  52. package/src/openapi/paths/config.ts +0 -485
  53. package/src/openapi/paths/doctor.ts +0 -165
  54. package/src/openapi/paths/files.ts +0 -236
  55. package/src/openapi/paths/git.ts +0 -690
  56. package/src/openapi/paths/mcp.ts +0 -339
  57. package/src/openapi/paths/messages.ts +0 -103
  58. package/src/openapi/paths/ottorouter.ts +0 -594
  59. package/src/openapi/paths/provider-usage.ts +0 -59
  60. package/src/openapi/paths/research.ts +0 -227
  61. package/src/openapi/paths/session-approval.ts +0 -93
  62. package/src/openapi/paths/session-extras.ts +0 -336
  63. package/src/openapi/paths/session-files.ts +0 -91
  64. package/src/openapi/paths/sessions.ts +0 -210
  65. package/src/openapi/paths/skills.ts +0 -377
  66. package/src/openapi/paths/stream.ts +0 -26
  67. package/src/openapi/paths/terminals.ts +0 -226
  68. package/src/openapi/paths/tunnel.ts +0 -163
  69. package/src/openapi/spec.ts +0 -73
@@ -1,690 +0,0 @@
1
- import { gitErrorResponse, projectQueryParam } from '../helpers';
2
-
3
- export const gitPaths = {
4
- '/v1/git/init': {
5
- post: {
6
- tags: ['git'],
7
- operationId: 'initGitRepo',
8
- summary: 'Initialize a git repository',
9
- requestBody: {
10
- required: false,
11
- content: {
12
- 'application/json': {
13
- schema: {
14
- type: 'object',
15
- properties: {
16
- project: { type: 'string' },
17
- },
18
- },
19
- },
20
- },
21
- },
22
- responses: {
23
- 200: {
24
- description: 'OK',
25
- content: {
26
- 'application/json': {
27
- schema: {
28
- type: 'object',
29
- properties: {
30
- status: { type: 'string', enum: ['ok'] },
31
- data: {
32
- type: 'object',
33
- properties: {
34
- initialized: { type: 'boolean' },
35
- path: { type: 'string' },
36
- },
37
- required: ['initialized', 'path'],
38
- },
39
- },
40
- required: ['status', 'data'],
41
- },
42
- },
43
- },
44
- },
45
- 500: gitErrorResponse(),
46
- },
47
- },
48
- },
49
- '/v1/git/status': {
50
- get: {
51
- tags: ['git'],
52
- operationId: 'getGitStatus',
53
- summary: 'Get git status',
54
- description:
55
- 'Returns current git status including staged, unstaged, and untracked files',
56
- parameters: [projectQueryParam()],
57
- responses: {
58
- 200: {
59
- description: 'OK',
60
- content: {
61
- 'application/json': {
62
- schema: {
63
- type: 'object',
64
- properties: {
65
- status: { type: 'string', enum: ['ok'] },
66
- data: { $ref: '#/components/schemas/GitStatus' },
67
- },
68
- required: ['status', 'data'],
69
- },
70
- },
71
- },
72
- },
73
- 400: gitErrorResponse(),
74
- 500: gitErrorResponse(),
75
- },
76
- },
77
- },
78
- '/v1/git/diff': {
79
- get: {
80
- tags: ['git'],
81
- operationId: 'getGitDiff',
82
- summary: 'Get git diff for a file',
83
- parameters: [
84
- projectQueryParam(),
85
- {
86
- in: 'query',
87
- name: 'file',
88
- required: true,
89
- schema: { type: 'string' },
90
- description: 'File path to get diff for',
91
- },
92
- {
93
- in: 'query',
94
- name: 'staged',
95
- required: false,
96
- schema: { type: 'string', enum: ['true', 'false'] },
97
- description: 'Show staged diff (default: unstaged)',
98
- },
99
- {
100
- in: 'query',
101
- name: 'fullFile',
102
- required: false,
103
- schema: { type: 'string', enum: ['true', 'false'] },
104
- description: 'Include full file content in diff',
105
- },
106
- ],
107
- responses: {
108
- 200: {
109
- description: 'OK',
110
- content: {
111
- 'application/json': {
112
- schema: {
113
- type: 'object',
114
- properties: {
115
- status: { type: 'string', enum: ['ok'] },
116
- data: { $ref: '#/components/schemas/GitDiff' },
117
- },
118
- required: ['status', 'data'],
119
- },
120
- },
121
- },
122
- },
123
- 400: gitErrorResponse(),
124
- 500: gitErrorResponse(),
125
- },
126
- },
127
- },
128
- '/v1/git/branch': {
129
- get: {
130
- tags: ['git'],
131
- operationId: 'getGitBranch',
132
- summary: 'Get git branch information',
133
- parameters: [projectQueryParam()],
134
- responses: {
135
- 200: {
136
- description: 'OK',
137
- content: {
138
- 'application/json': {
139
- schema: {
140
- type: 'object',
141
- properties: {
142
- status: { type: 'string', enum: ['ok'] },
143
- data: { $ref: '#/components/schemas/GitBranch' },
144
- },
145
- required: ['status', 'data'],
146
- },
147
- },
148
- },
149
- },
150
- 400: gitErrorResponse(),
151
- 500: gitErrorResponse(),
152
- },
153
- },
154
- },
155
- '/v1/git/stage': {
156
- post: {
157
- tags: ['git'],
158
- operationId: 'stageFiles',
159
- summary: 'Stage files',
160
- requestBody: {
161
- required: true,
162
- content: {
163
- 'application/json': {
164
- schema: {
165
- type: 'object',
166
- properties: {
167
- project: { type: 'string' },
168
- files: {
169
- type: 'array',
170
- items: { type: 'string' },
171
- },
172
- },
173
- required: ['files'],
174
- },
175
- },
176
- },
177
- },
178
- responses: {
179
- 200: {
180
- description: 'OK',
181
- content: {
182
- 'application/json': {
183
- schema: {
184
- type: 'object',
185
- properties: {
186
- status: { type: 'string', enum: ['ok'] },
187
- data: {
188
- type: 'object',
189
- properties: {
190
- staged: {
191
- type: 'array',
192
- items: { type: 'string' },
193
- },
194
- failed: {
195
- type: 'array',
196
- items: { type: 'string' },
197
- },
198
- },
199
- required: ['staged', 'failed'],
200
- },
201
- },
202
- required: ['status', 'data'],
203
- },
204
- },
205
- },
206
- },
207
- 500: gitErrorResponse(),
208
- },
209
- },
210
- },
211
- '/v1/git/unstage': {
212
- post: {
213
- tags: ['git'],
214
- operationId: 'unstageFiles',
215
- summary: 'Unstage files',
216
- requestBody: {
217
- required: true,
218
- content: {
219
- 'application/json': {
220
- schema: {
221
- type: 'object',
222
- properties: {
223
- project: { type: 'string' },
224
- files: {
225
- type: 'array',
226
- items: { type: 'string' },
227
- },
228
- },
229
- required: ['files'],
230
- },
231
- },
232
- },
233
- },
234
- responses: {
235
- 200: {
236
- description: 'OK',
237
- content: {
238
- 'application/json': {
239
- schema: {
240
- type: 'object',
241
- properties: {
242
- status: { type: 'string', enum: ['ok'] },
243
- data: {
244
- type: 'object',
245
- properties: {
246
- unstaged: {
247
- type: 'array',
248
- items: { type: 'string' },
249
- },
250
- failed: {
251
- type: 'array',
252
- items: { type: 'string' },
253
- },
254
- },
255
- required: ['unstaged', 'failed'],
256
- },
257
- },
258
- required: ['status', 'data'],
259
- },
260
- },
261
- },
262
- },
263
- 500: gitErrorResponse(),
264
- },
265
- },
266
- },
267
- '/v1/git/commit': {
268
- post: {
269
- tags: ['git'],
270
- operationId: 'commitChanges',
271
- summary: 'Commit staged changes',
272
- requestBody: {
273
- required: true,
274
- content: {
275
- 'application/json': {
276
- schema: {
277
- type: 'object',
278
- properties: {
279
- project: { type: 'string' },
280
- message: { type: 'string', minLength: 1 },
281
- },
282
- required: ['message'],
283
- },
284
- },
285
- },
286
- },
287
- responses: {
288
- 200: {
289
- description: 'OK',
290
- content: {
291
- 'application/json': {
292
- schema: {
293
- type: 'object',
294
- properties: {
295
- status: { type: 'string', enum: ['ok'] },
296
- data: { $ref: '#/components/schemas/GitCommit' },
297
- },
298
- required: ['status', 'data'],
299
- },
300
- },
301
- },
302
- },
303
- 400: gitErrorResponse(),
304
- 500: gitErrorResponse(),
305
- },
306
- },
307
- },
308
- '/v1/git/generate-commit-message': {
309
- post: {
310
- tags: ['git'],
311
- operationId: 'generateCommitMessage',
312
- summary: 'Generate AI-powered commit message',
313
- description:
314
- 'Uses AI to generate a commit message based on staged changes',
315
- requestBody: {
316
- required: false,
317
- content: {
318
- 'application/json': {
319
- schema: {
320
- type: 'object',
321
- properties: {
322
- project: { type: 'string' },
323
- sessionId: {
324
- type: 'string',
325
- description: 'Session ID to use session provider',
326
- },
327
- },
328
- },
329
- },
330
- },
331
- },
332
- responses: {
333
- 200: {
334
- description: 'OK',
335
- content: {
336
- 'application/json': {
337
- schema: {
338
- type: 'object',
339
- properties: {
340
- status: { type: 'string', enum: ['ok'] },
341
- data: {
342
- type: 'object',
343
- properties: {
344
- message: { type: 'string' },
345
- },
346
- required: ['message'],
347
- },
348
- },
349
- required: ['status', 'data'],
350
- },
351
- },
352
- },
353
- },
354
- 400: gitErrorResponse(),
355
- 500: gitErrorResponse(),
356
- },
357
- },
358
- },
359
- '/v1/git/push': {
360
- post: {
361
- tags: ['git'],
362
- operationId: 'pushCommits',
363
- summary: 'Push commits to remote',
364
- description: 'Pushes local commits to the configured remote repository',
365
- requestBody: {
366
- required: false,
367
- content: {
368
- 'application/json': {
369
- schema: {
370
- type: 'object',
371
- properties: {
372
- project: { type: 'string' },
373
- },
374
- },
375
- },
376
- },
377
- },
378
- responses: {
379
- 200: {
380
- description: 'OK',
381
- content: {
382
- 'application/json': {
383
- schema: {
384
- type: 'object',
385
- properties: {
386
- status: { type: 'string', enum: ['ok'] },
387
- data: {
388
- type: 'object',
389
- properties: {
390
- output: { type: 'string' },
391
- },
392
- required: ['output'],
393
- },
394
- },
395
- required: ['status', 'data'],
396
- },
397
- },
398
- },
399
- },
400
- 400: gitErrorResponse(),
401
- 500: gitErrorResponse(),
402
- },
403
- },
404
- },
405
- '/v1/git/pull': {
406
- post: {
407
- tags: ['git'],
408
- operationId: 'pullChanges',
409
- summary: 'Pull changes from remote',
410
- description: 'Pulls changes from the configured remote repository',
411
- requestBody: {
412
- required: false,
413
- content: {
414
- 'application/json': {
415
- schema: {
416
- type: 'object',
417
- properties: {
418
- project: { type: 'string' },
419
- },
420
- },
421
- },
422
- },
423
- },
424
- responses: {
425
- 200: {
426
- description: 'OK',
427
- content: {
428
- 'application/json': {
429
- schema: {
430
- type: 'object',
431
- properties: {
432
- status: { type: 'string', enum: ['ok'] },
433
- data: {
434
- type: 'object',
435
- properties: {
436
- output: { type: 'string' },
437
- },
438
- required: ['output'],
439
- },
440
- },
441
- required: ['status', 'data'],
442
- },
443
- },
444
- },
445
- },
446
- 400: gitErrorResponse(),
447
- 500: gitErrorResponse(),
448
- },
449
- },
450
- },
451
- '/v1/git/restore': {
452
- post: {
453
- tags: ['git'],
454
- operationId: 'restoreFiles',
455
- summary: 'Restore files to HEAD',
456
- requestBody: {
457
- required: true,
458
- content: {
459
- 'application/json': {
460
- schema: {
461
- type: 'object',
462
- properties: {
463
- project: { type: 'string' },
464
- files: {
465
- type: 'array',
466
- items: { type: 'string' },
467
- },
468
- },
469
- required: ['files'],
470
- },
471
- },
472
- },
473
- },
474
- responses: {
475
- 200: {
476
- description: 'OK',
477
- content: {
478
- 'application/json': {
479
- schema: {
480
- type: 'object',
481
- properties: {
482
- status: { type: 'string', enum: ['ok'] },
483
- data: {
484
- type: 'object',
485
- properties: {
486
- restored: {
487
- type: 'array',
488
- items: { type: 'string' },
489
- },
490
- },
491
- required: ['restored'],
492
- },
493
- },
494
- required: ['status', 'data'],
495
- },
496
- },
497
- },
498
- },
499
- 500: gitErrorResponse(),
500
- },
501
- },
502
- },
503
- '/v1/git/delete': {
504
- post: {
505
- tags: ['git'],
506
- operationId: 'deleteFiles',
507
- summary: 'Delete untracked files',
508
- requestBody: {
509
- required: true,
510
- content: {
511
- 'application/json': {
512
- schema: {
513
- type: 'object',
514
- properties: {
515
- project: { type: 'string' },
516
- files: {
517
- type: 'array',
518
- items: { type: 'string' },
519
- },
520
- },
521
- required: ['files'],
522
- },
523
- },
524
- },
525
- },
526
- responses: {
527
- 200: {
528
- description: 'OK',
529
- content: {
530
- 'application/json': {
531
- schema: {
532
- type: 'object',
533
- properties: {
534
- status: { type: 'string', enum: ['ok'] },
535
- data: {
536
- type: 'object',
537
- properties: {
538
- deleted: {
539
- type: 'array',
540
- items: { type: 'string' },
541
- },
542
- },
543
- required: ['deleted'],
544
- },
545
- },
546
- required: ['status', 'data'],
547
- },
548
- },
549
- },
550
- },
551
- 500: gitErrorResponse(),
552
- },
553
- },
554
- },
555
- '/v1/git/remotes': {
556
- get: {
557
- tags: ['git'],
558
- operationId: 'getGitRemotes',
559
- summary: 'List git remotes',
560
- parameters: [projectQueryParam()],
561
- responses: {
562
- 200: {
563
- description: 'OK',
564
- content: {
565
- 'application/json': {
566
- schema: {
567
- type: 'object',
568
- properties: {
569
- status: { type: 'string', enum: ['ok'] },
570
- data: {
571
- type: 'object',
572
- properties: {
573
- remotes: {
574
- type: 'array',
575
- items: {
576
- type: 'object',
577
- properties: {
578
- name: { type: 'string' },
579
- url: { type: 'string' },
580
- type: { type: 'string' },
581
- },
582
- required: ['name', 'url', 'type'],
583
- },
584
- },
585
- },
586
- required: ['remotes'],
587
- },
588
- },
589
- required: ['status', 'data'],
590
- },
591
- },
592
- },
593
- },
594
- 400: gitErrorResponse(),
595
- 500: gitErrorResponse(),
596
- },
597
- },
598
- post: {
599
- tags: ['git'],
600
- operationId: 'addGitRemote',
601
- summary: 'Add a git remote',
602
- requestBody: {
603
- required: true,
604
- content: {
605
- 'application/json': {
606
- schema: {
607
- type: 'object',
608
- properties: {
609
- project: { type: 'string' },
610
- name: { type: 'string' },
611
- url: { type: 'string' },
612
- },
613
- required: ['name', 'url'],
614
- },
615
- },
616
- },
617
- },
618
- responses: {
619
- 200: {
620
- description: 'OK',
621
- content: {
622
- 'application/json': {
623
- schema: {
624
- type: 'object',
625
- properties: {
626
- status: { type: 'string', enum: ['ok'] },
627
- data: {
628
- type: 'object',
629
- properties: {
630
- name: { type: 'string' },
631
- url: { type: 'string' },
632
- },
633
- required: ['name', 'url'],
634
- },
635
- },
636
- required: ['status', 'data'],
637
- },
638
- },
639
- },
640
- },
641
- 400: gitErrorResponse(),
642
- 500: gitErrorResponse(),
643
- },
644
- },
645
- delete: {
646
- tags: ['git'],
647
- operationId: 'removeGitRemote',
648
- summary: 'Remove a git remote',
649
- requestBody: {
650
- required: true,
651
- content: {
652
- 'application/json': {
653
- schema: {
654
- type: 'object',
655
- properties: {
656
- project: { type: 'string' },
657
- name: { type: 'string' },
658
- },
659
- required: ['name'],
660
- },
661
- },
662
- },
663
- },
664
- responses: {
665
- 200: {
666
- description: 'OK',
667
- content: {
668
- 'application/json': {
669
- schema: {
670
- type: 'object',
671
- properties: {
672
- status: { type: 'string', enum: ['ok'] },
673
- data: {
674
- type: 'object',
675
- properties: {
676
- removed: { type: 'string' },
677
- },
678
- required: ['removed'],
679
- },
680
- },
681
- required: ['status', 'data'],
682
- },
683
- },
684
- },
685
- },
686
- 500: gitErrorResponse(),
687
- },
688
- },
689
- },
690
- } as const;