@ottocode/server 0.1.244 → 0.1.246
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/events/types.ts +9 -9
- package/src/index.ts +9 -4
- package/src/openapi/paths/auth.ts +11 -11
- package/src/openapi/paths/config.ts +118 -2
- package/src/openapi/paths/{setu.ts → ottorouter.ts} +31 -31
- package/src/openapi/paths/skills.ts +122 -0
- package/src/openapi/schemas.ts +35 -3
- package/src/openapi/spec.ts +3 -3
- package/src/routes/auth.ts +40 -46
- package/src/routes/branch.ts +3 -2
- package/src/routes/config/defaults.ts +10 -3
- package/src/routes/config/main.ts +3 -0
- package/src/routes/config/models.ts +84 -14
- package/src/routes/config/providers.ts +137 -4
- package/src/routes/config/utils.ts +72 -2
- package/src/routes/doctor.ts +15 -27
- package/src/routes/git/commit.ts +16 -5
- package/src/routes/{setu.ts → ottorouter.ts} +52 -49
- package/src/routes/research.ts +3 -3
- package/src/routes/session-messages.ts +14 -8
- package/src/routes/sessions.ts +12 -18
- package/src/routes/skills.ts +140 -59
- package/src/runtime/agent/registry.ts +5 -2
- package/src/runtime/agent/runner-setup.ts +123 -38
- package/src/runtime/agent/runner.ts +140 -4
- package/src/runtime/ask/service.ts +14 -11
- package/src/runtime/message/history-builder.ts +22 -6
- package/src/runtime/message/service.ts +7 -1
- package/src/runtime/prompt/builder.ts +12 -0
- package/src/runtime/prompt/capabilities.ts +200 -0
- package/src/runtime/provider/index.ts +106 -5
- package/src/runtime/provider/{setu.ts → ottorouter.ts} +22 -22
- package/src/runtime/provider/reasoning.ts +73 -17
- package/src/runtime/provider/selection.ts +17 -15
- package/src/runtime/session/db-operations.ts +1 -1
- package/src/runtime/session/manager.ts +1 -1
- package/src/runtime/session/queue.ts +7 -2
- package/src/runtime/stream/error-handler.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ottocode/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.246",
|
|
4
4
|
"description": "HTTP API server for ottocode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -49,8 +49,9 @@
|
|
|
49
49
|
"typecheck": "tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@ottocode/
|
|
53
|
-
"@ottocode/
|
|
52
|
+
"@ottocode/database": "0.1.246",
|
|
53
|
+
"@ottocode/sdk": "0.1.246",
|
|
54
|
+
"ai-sdk-ollama": "^3.8.3",
|
|
54
55
|
"drizzle-orm": "^0.44.5",
|
|
55
56
|
"hono": "^4.9.9",
|
|
56
57
|
"zod": "^4.3.6"
|
package/src/events/types.ts
CHANGED
|
@@ -2,15 +2,15 @@ export type OttoEventType =
|
|
|
2
2
|
| 'tool.approval.required'
|
|
3
3
|
| 'tool.approval.updated'
|
|
4
4
|
| 'tool.approval.resolved'
|
|
5
|
-
| '
|
|
6
|
-
| '
|
|
7
|
-
| '
|
|
8
|
-
| '
|
|
9
|
-
| '
|
|
10
|
-
| '
|
|
11
|
-
| '
|
|
12
|
-
| '
|
|
13
|
-
| '
|
|
5
|
+
| 'ottorouter.payment.required'
|
|
6
|
+
| 'ottorouter.payment.signing'
|
|
7
|
+
| 'ottorouter.payment.complete'
|
|
8
|
+
| 'ottorouter.payment.error'
|
|
9
|
+
| 'ottorouter.topup.required'
|
|
10
|
+
| 'ottorouter.topup.method_selected'
|
|
11
|
+
| 'ottorouter.topup.cancelled'
|
|
12
|
+
| 'ottorouter.fiat.checkout_created'
|
|
13
|
+
| 'ottorouter.balance.updated'
|
|
14
14
|
| 'session.created'
|
|
15
15
|
| 'session.deleted'
|
|
16
16
|
| 'session.updated'
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { registerSessionFilesRoutes } from './routes/session-files.ts';
|
|
|
17
17
|
import { registerBranchRoutes } from './routes/branch.ts';
|
|
18
18
|
import { registerResearchRoutes } from './routes/research.ts';
|
|
19
19
|
import { registerSessionApprovalRoute } from './routes/session-approval.ts';
|
|
20
|
-
import {
|
|
20
|
+
import { registerOttoRouterRoutes } from './routes/ottorouter.ts';
|
|
21
21
|
import { registerAuthRoutes } from './routes/auth.ts';
|
|
22
22
|
import { registerTunnelRoutes } from './routes/tunnel.ts';
|
|
23
23
|
import { registerMCPRoutes } from './routes/mcp.ts';
|
|
@@ -81,7 +81,7 @@ function initApp() {
|
|
|
81
81
|
registerSessionFilesRoutes(app);
|
|
82
82
|
registerBranchRoutes(app);
|
|
83
83
|
registerResearchRoutes(app);
|
|
84
|
-
|
|
84
|
+
registerOttoRouterRoutes(app);
|
|
85
85
|
registerAuthRoutes(app);
|
|
86
86
|
registerTunnelRoutes(app);
|
|
87
87
|
registerMCPRoutes(app);
|
|
@@ -156,7 +156,7 @@ export function createStandaloneApp(_config?: StandaloneAppConfig) {
|
|
|
156
156
|
registerSessionFilesRoutes(honoApp);
|
|
157
157
|
registerBranchRoutes(honoApp);
|
|
158
158
|
registerResearchRoutes(honoApp);
|
|
159
|
-
|
|
159
|
+
registerOttoRouterRoutes(honoApp);
|
|
160
160
|
registerAuthRoutes(honoApp);
|
|
161
161
|
registerTunnelRoutes(honoApp);
|
|
162
162
|
registerMCPRoutes(honoApp);
|
|
@@ -267,7 +267,7 @@ export function createEmbeddedApp(config: EmbeddedAppConfig = {}) {
|
|
|
267
267
|
registerSessionFilesRoutes(honoApp);
|
|
268
268
|
registerBranchRoutes(honoApp);
|
|
269
269
|
registerResearchRoutes(honoApp);
|
|
270
|
-
|
|
270
|
+
registerOttoRouterRoutes(honoApp);
|
|
271
271
|
registerAuthRoutes(honoApp);
|
|
272
272
|
registerTunnelRoutes(honoApp);
|
|
273
273
|
registerMCPRoutes(honoApp);
|
|
@@ -284,6 +284,11 @@ export {
|
|
|
284
284
|
composeSystemPrompt,
|
|
285
285
|
type ComposedSystemPrompt,
|
|
286
286
|
} from './runtime/prompt/builder.ts';
|
|
287
|
+
export {
|
|
288
|
+
buildCapabilitySummary,
|
|
289
|
+
type CapabilitySummaryResult,
|
|
290
|
+
type CapabilitySummaryMCPTool,
|
|
291
|
+
} from './runtime/prompt/capabilities.ts';
|
|
287
292
|
export {
|
|
288
293
|
AskServiceError,
|
|
289
294
|
handleAskRequest,
|
|
@@ -15,7 +15,7 @@ export const authPaths = {
|
|
|
15
15
|
type: 'object',
|
|
16
16
|
properties: {
|
|
17
17
|
onboardingComplete: { type: 'boolean' },
|
|
18
|
-
|
|
18
|
+
ottorouter: {
|
|
19
19
|
type: 'object',
|
|
20
20
|
properties: {
|
|
21
21
|
configured: { type: 'boolean' },
|
|
@@ -65,7 +65,7 @@ export const authPaths = {
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
|
-
required: ['onboardingComplete', '
|
|
68
|
+
required: ['onboardingComplete', 'ottorouter', 'providers'],
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
71
|
},
|
|
@@ -73,11 +73,11 @@ export const authPaths = {
|
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
|
-
'/v1/auth/
|
|
76
|
+
'/v1/auth/ottorouter/setup': {
|
|
77
77
|
post: {
|
|
78
78
|
tags: ['auth'],
|
|
79
|
-
operationId: '
|
|
80
|
-
summary: 'Setup or ensure
|
|
79
|
+
operationId: 'setupOttoRouterWallet',
|
|
80
|
+
summary: 'Setup or ensure OttoRouter wallet',
|
|
81
81
|
responses: {
|
|
82
82
|
200: {
|
|
83
83
|
description: 'OK',
|
|
@@ -98,11 +98,11 @@ export const authPaths = {
|
|
|
98
98
|
},
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
|
-
'/v1/auth/
|
|
101
|
+
'/v1/auth/ottorouter/import': {
|
|
102
102
|
post: {
|
|
103
103
|
tags: ['auth'],
|
|
104
|
-
operationId: '
|
|
105
|
-
summary: 'Import
|
|
104
|
+
operationId: 'importOttoRouterWallet',
|
|
105
|
+
summary: 'Import OttoRouter wallet from private key',
|
|
106
106
|
requestBody: {
|
|
107
107
|
required: true,
|
|
108
108
|
content: {
|
|
@@ -137,11 +137,11 @@ export const authPaths = {
|
|
|
137
137
|
},
|
|
138
138
|
},
|
|
139
139
|
},
|
|
140
|
-
'/v1/auth/
|
|
140
|
+
'/v1/auth/ottorouter/export': {
|
|
141
141
|
get: {
|
|
142
142
|
tags: ['auth'],
|
|
143
|
-
operationId: '
|
|
144
|
-
summary: 'Export
|
|
143
|
+
operationId: 'exportOttoRouterWallet',
|
|
144
|
+
summary: 'Export OttoRouter wallet private key',
|
|
145
145
|
responses: {
|
|
146
146
|
200: {
|
|
147
147
|
description: 'OK',
|
|
@@ -91,9 +91,123 @@ export const configPaths = {
|
|
|
91
91
|
type: 'array',
|
|
92
92
|
items: { $ref: '#/components/schemas/Provider' },
|
|
93
93
|
},
|
|
94
|
+
details: {
|
|
95
|
+
type: 'array',
|
|
96
|
+
items: { $ref: '#/components/schemas/ProviderDetail' },
|
|
97
|
+
},
|
|
94
98
|
default: { $ref: '#/components/schemas/Provider' },
|
|
95
99
|
},
|
|
96
|
-
required: ['providers', 'default'],
|
|
100
|
+
required: ['providers', 'details', 'default'],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
'/v1/config/providers/{provider}': {
|
|
109
|
+
put: {
|
|
110
|
+
tags: ['config'],
|
|
111
|
+
operationId: 'updateProviderSettings',
|
|
112
|
+
summary: 'Create or update provider settings',
|
|
113
|
+
parameters: [
|
|
114
|
+
projectQueryParam(),
|
|
115
|
+
{
|
|
116
|
+
in: 'path',
|
|
117
|
+
name: 'provider',
|
|
118
|
+
required: true,
|
|
119
|
+
schema: { $ref: '#/components/schemas/Provider' },
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
requestBody: {
|
|
123
|
+
required: true,
|
|
124
|
+
content: {
|
|
125
|
+
'application/json': {
|
|
126
|
+
schema: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
properties: {
|
|
129
|
+
enabled: { type: 'boolean' },
|
|
130
|
+
custom: { type: 'boolean' },
|
|
131
|
+
label: { type: 'string' },
|
|
132
|
+
compatibility: { type: 'string' },
|
|
133
|
+
family: { type: 'string' },
|
|
134
|
+
baseURL: { type: 'string', nullable: true },
|
|
135
|
+
apiKey: { type: 'string', nullable: true },
|
|
136
|
+
apiKeyEnv: { type: 'string', nullable: true },
|
|
137
|
+
models: {
|
|
138
|
+
type: 'array',
|
|
139
|
+
items: { type: 'string' },
|
|
140
|
+
},
|
|
141
|
+
allowAnyModel: { type: 'boolean' },
|
|
142
|
+
scope: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
enum: ['global', 'local'],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
responses: {
|
|
152
|
+
200: {
|
|
153
|
+
description: 'OK',
|
|
154
|
+
content: {
|
|
155
|
+
'application/json': {
|
|
156
|
+
schema: {
|
|
157
|
+
type: 'object',
|
|
158
|
+
properties: {
|
|
159
|
+
success: { type: 'boolean' },
|
|
160
|
+
provider: { $ref: '#/components/schemas/Provider' },
|
|
161
|
+
details: {
|
|
162
|
+
type: 'array',
|
|
163
|
+
items: { $ref: '#/components/schemas/ProviderDetail' },
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
required: ['success', 'provider', 'details'],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
delete: {
|
|
174
|
+
tags: ['config'],
|
|
175
|
+
operationId: 'deleteProviderSettings',
|
|
176
|
+
summary: 'Delete provider override or custom provider entry',
|
|
177
|
+
parameters: [
|
|
178
|
+
projectQueryParam(),
|
|
179
|
+
{
|
|
180
|
+
in: 'query',
|
|
181
|
+
name: 'scope',
|
|
182
|
+
required: false,
|
|
183
|
+
schema: {
|
|
184
|
+
type: 'string',
|
|
185
|
+
enum: ['global', 'local'],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
in: 'path',
|
|
190
|
+
name: 'provider',
|
|
191
|
+
required: true,
|
|
192
|
+
schema: { $ref: '#/components/schemas/Provider' },
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
responses: {
|
|
196
|
+
200: {
|
|
197
|
+
description: 'OK',
|
|
198
|
+
content: {
|
|
199
|
+
'application/json': {
|
|
200
|
+
schema: {
|
|
201
|
+
type: 'object',
|
|
202
|
+
properties: {
|
|
203
|
+
success: { type: 'boolean' },
|
|
204
|
+
provider: { $ref: '#/components/schemas/Provider' },
|
|
205
|
+
details: {
|
|
206
|
+
type: 'array',
|
|
207
|
+
items: { $ref: '#/components/schemas/ProviderDetail' },
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
required: ['success', 'provider', 'details'],
|
|
97
211
|
},
|
|
98
212
|
},
|
|
99
213
|
},
|
|
@@ -128,8 +242,10 @@ export const configPaths = {
|
|
|
128
242
|
items: { $ref: '#/components/schemas/Model' },
|
|
129
243
|
},
|
|
130
244
|
default: { type: 'string', nullable: true },
|
|
245
|
+
allowAnyModel: { type: 'boolean' },
|
|
246
|
+
label: { type: 'string' },
|
|
131
247
|
},
|
|
132
|
-
required: ['models'],
|
|
248
|
+
required: ['models', 'allowAnyModel', 'label'],
|
|
133
249
|
},
|
|
134
250
|
},
|
|
135
251
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const
|
|
2
|
-
'/v1/
|
|
1
|
+
export const ottorouterPaths = {
|
|
2
|
+
'/v1/ottorouter/balance': {
|
|
3
3
|
get: {
|
|
4
|
-
tags: ['
|
|
5
|
-
operationId: '
|
|
6
|
-
summary: 'Get
|
|
4
|
+
tags: ['ottorouter'],
|
|
5
|
+
operationId: 'getOttoRouterBalance',
|
|
6
|
+
summary: 'Get OttoRouter account balance',
|
|
7
7
|
description:
|
|
8
8
|
'Returns wallet balance, subscription, account info, limits, and usage data',
|
|
9
9
|
responses: {
|
|
@@ -82,7 +82,7 @@ export const setuPaths = {
|
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
84
|
502: {
|
|
85
|
-
description: 'Failed to fetch balance from
|
|
85
|
+
description: 'Failed to fetch balance from OttoRouter',
|
|
86
86
|
content: {
|
|
87
87
|
'application/json': {
|
|
88
88
|
schema: {
|
|
@@ -96,11 +96,11 @@ export const setuPaths = {
|
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
|
-
'/v1/
|
|
99
|
+
'/v1/ottorouter/wallet': {
|
|
100
100
|
get: {
|
|
101
|
-
tags: ['
|
|
102
|
-
operationId: '
|
|
103
|
-
summary: 'Get
|
|
101
|
+
tags: ['ottorouter'],
|
|
102
|
+
operationId: 'getOttoRouterWallet',
|
|
103
|
+
summary: 'Get OttoRouter wallet info',
|
|
104
104
|
description:
|
|
105
105
|
'Returns whether the wallet is configured and its public key',
|
|
106
106
|
responses: {
|
|
@@ -123,10 +123,10 @@ export const setuPaths = {
|
|
|
123
123
|
},
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
|
-
'/v1/
|
|
126
|
+
'/v1/ottorouter/usdc-balance': {
|
|
127
127
|
get: {
|
|
128
|
-
tags: ['
|
|
129
|
-
operationId: '
|
|
128
|
+
tags: ['ottorouter'],
|
|
129
|
+
operationId: 'getOttoRouterUsdcBalance',
|
|
130
130
|
summary: 'Get USDC token balance',
|
|
131
131
|
description:
|
|
132
132
|
'Fetches USDC balance from Solana blockchain for the configured wallet',
|
|
@@ -189,9 +189,9 @@ export const setuPaths = {
|
|
|
189
189
|
},
|
|
190
190
|
},
|
|
191
191
|
},
|
|
192
|
-
'/v1/
|
|
192
|
+
'/v1/ottorouter/topup/polar': {
|
|
193
193
|
post: {
|
|
194
|
-
tags: ['
|
|
194
|
+
tags: ['ottorouter'],
|
|
195
195
|
operationId: 'createPolarCheckout',
|
|
196
196
|
summary: 'Create a Polar checkout for topping up',
|
|
197
197
|
requestBody: {
|
|
@@ -233,9 +233,9 @@ export const setuPaths = {
|
|
|
233
233
|
},
|
|
234
234
|
},
|
|
235
235
|
},
|
|
236
|
-
'/v1/
|
|
236
|
+
'/v1/ottorouter/topup/select': {
|
|
237
237
|
post: {
|
|
238
|
-
tags: ['
|
|
238
|
+
tags: ['ottorouter'],
|
|
239
239
|
operationId: 'selectTopupMethod',
|
|
240
240
|
summary: 'Select topup method for pending request',
|
|
241
241
|
requestBody: {
|
|
@@ -287,9 +287,9 @@ export const setuPaths = {
|
|
|
287
287
|
},
|
|
288
288
|
},
|
|
289
289
|
},
|
|
290
|
-
'/v1/
|
|
290
|
+
'/v1/ottorouter/topup/cancel': {
|
|
291
291
|
post: {
|
|
292
|
-
tags: ['
|
|
292
|
+
tags: ['ottorouter'],
|
|
293
293
|
operationId: 'cancelTopup',
|
|
294
294
|
summary: 'Cancel pending topup',
|
|
295
295
|
requestBody: {
|
|
@@ -337,9 +337,9 @@ export const setuPaths = {
|
|
|
337
337
|
},
|
|
338
338
|
},
|
|
339
339
|
},
|
|
340
|
-
'/v1/
|
|
340
|
+
'/v1/ottorouter/topup/pending': {
|
|
341
341
|
get: {
|
|
342
|
-
tags: ['
|
|
342
|
+
tags: ['ottorouter'],
|
|
343
343
|
operationId: 'getPendingTopup',
|
|
344
344
|
summary: 'Get pending topup for a session',
|
|
345
345
|
parameters: [
|
|
@@ -373,9 +373,9 @@ export const setuPaths = {
|
|
|
373
373
|
},
|
|
374
374
|
},
|
|
375
375
|
},
|
|
376
|
-
'/v1/
|
|
376
|
+
'/v1/ottorouter/topup/polar/estimate': {
|
|
377
377
|
get: {
|
|
378
|
-
tags: ['
|
|
378
|
+
tags: ['ottorouter'],
|
|
379
379
|
operationId: 'getPolarTopupEstimate',
|
|
380
380
|
summary: 'Get estimated fees for a Polar topup',
|
|
381
381
|
parameters: [
|
|
@@ -414,9 +414,9 @@ export const setuPaths = {
|
|
|
414
414
|
},
|
|
415
415
|
},
|
|
416
416
|
},
|
|
417
|
-
'/v1/
|
|
417
|
+
'/v1/ottorouter/topup/polar/status': {
|
|
418
418
|
get: {
|
|
419
|
-
tags: ['
|
|
419
|
+
tags: ['ottorouter'],
|
|
420
420
|
operationId: 'getPolarTopupStatus',
|
|
421
421
|
summary: 'Get status of a Polar checkout',
|
|
422
422
|
parameters: [
|
|
@@ -447,9 +447,9 @@ export const setuPaths = {
|
|
|
447
447
|
},
|
|
448
448
|
},
|
|
449
449
|
},
|
|
450
|
-
'/v1/
|
|
450
|
+
'/v1/ottorouter/topup/razorpay/estimate': {
|
|
451
451
|
get: {
|
|
452
|
-
tags: ['
|
|
452
|
+
tags: ['ottorouter'],
|
|
453
453
|
operationId: 'getRazorpayTopupEstimate',
|
|
454
454
|
summary: 'Get estimated fees for a Razorpay topup',
|
|
455
455
|
parameters: [
|
|
@@ -482,9 +482,9 @@ export const setuPaths = {
|
|
|
482
482
|
},
|
|
483
483
|
},
|
|
484
484
|
},
|
|
485
|
-
'/v1/
|
|
485
|
+
'/v1/ottorouter/topup/razorpay': {
|
|
486
486
|
post: {
|
|
487
|
-
tags: ['
|
|
487
|
+
tags: ['ottorouter'],
|
|
488
488
|
operationId: 'createRazorpayOrder',
|
|
489
489
|
summary: 'Create a Razorpay order for topping up',
|
|
490
490
|
requestBody: {
|
|
@@ -535,9 +535,9 @@ export const setuPaths = {
|
|
|
535
535
|
},
|
|
536
536
|
},
|
|
537
537
|
},
|
|
538
|
-
'/v1/
|
|
538
|
+
'/v1/ottorouter/topup/razorpay/verify': {
|
|
539
539
|
post: {
|
|
540
|
-
tags: ['
|
|
540
|
+
tags: ['ottorouter'],
|
|
541
541
|
operationId: 'verifyRazorpayPayment',
|
|
542
542
|
summary: 'Verify Razorpay payment and credit balance',
|
|
543
543
|
requestBody: {
|
|
@@ -1,6 +1,128 @@
|
|
|
1
1
|
import { errorResponse, projectQueryParam } from '../helpers';
|
|
2
2
|
|
|
3
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
|
+
scope: { type: 'string', enum: ['global', 'local'] },
|
|
64
|
+
items: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
additionalProperties: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
enabled: { type: 'boolean' },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
responses: {
|
|
79
|
+
200: {
|
|
80
|
+
description: 'OK',
|
|
81
|
+
content: {
|
|
82
|
+
'application/json': {
|
|
83
|
+
schema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
success: { type: 'boolean' },
|
|
87
|
+
enabled: { type: 'boolean' },
|
|
88
|
+
totalCount: { type: 'number' },
|
|
89
|
+
enabledCount: { type: 'number' },
|
|
90
|
+
items: {
|
|
91
|
+
type: 'array',
|
|
92
|
+
items: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: {
|
|
95
|
+
name: { type: 'string' },
|
|
96
|
+
description: { type: 'string' },
|
|
97
|
+
scope: { type: 'string' },
|
|
98
|
+
path: { type: 'string' },
|
|
99
|
+
enabled: { type: 'boolean' },
|
|
100
|
+
},
|
|
101
|
+
required: [
|
|
102
|
+
'name',
|
|
103
|
+
'description',
|
|
104
|
+
'scope',
|
|
105
|
+
'path',
|
|
106
|
+
'enabled',
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
required: [
|
|
112
|
+
'success',
|
|
113
|
+
'enabled',
|
|
114
|
+
'totalCount',
|
|
115
|
+
'enabledCount',
|
|
116
|
+
'items',
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
500: errorResponse(),
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
4
126
|
'/v1/skills': {
|
|
5
127
|
get: {
|
|
6
128
|
tags: ['config'],
|
package/src/openapi/schemas.ts
CHANGED
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
import { providerIds } from '@ottocode/sdk';
|
|
2
|
-
|
|
3
1
|
export const schemas = {
|
|
4
2
|
Provider: {
|
|
5
3
|
type: 'string',
|
|
6
|
-
|
|
4
|
+
description: 'Built-in or custom provider identifier',
|
|
5
|
+
},
|
|
6
|
+
ProviderDetail: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
id: { $ref: '#/components/schemas/Provider' },
|
|
10
|
+
label: { type: 'string' },
|
|
11
|
+
source: { type: 'string', enum: ['built-in', 'custom'] },
|
|
12
|
+
enabled: { type: 'boolean' },
|
|
13
|
+
authorized: { type: 'boolean' },
|
|
14
|
+
custom: { type: 'boolean' },
|
|
15
|
+
compatibility: { type: 'string', nullable: true },
|
|
16
|
+
family: { type: 'string', nullable: true },
|
|
17
|
+
baseURL: { type: 'string', nullable: true },
|
|
18
|
+
apiKeyEnv: { type: 'string', nullable: true },
|
|
19
|
+
hasApiKey: { type: 'boolean' },
|
|
20
|
+
allowAnyModel: { type: 'boolean' },
|
|
21
|
+
modelCount: { type: 'integer' },
|
|
22
|
+
authType: { type: 'string', nullable: true },
|
|
23
|
+
},
|
|
24
|
+
required: [
|
|
25
|
+
'id',
|
|
26
|
+
'label',
|
|
27
|
+
'source',
|
|
28
|
+
'enabled',
|
|
29
|
+
'authorized',
|
|
30
|
+
'custom',
|
|
31
|
+
'hasApiKey',
|
|
32
|
+
'allowAnyModel',
|
|
33
|
+
'modelCount',
|
|
34
|
+
],
|
|
7
35
|
},
|
|
8
36
|
AskResponse: {
|
|
9
37
|
type: 'object',
|
|
@@ -190,6 +218,10 @@ export const schemas = {
|
|
|
190
218
|
type: 'array',
|
|
191
219
|
items: { $ref: '#/components/schemas/Provider' },
|
|
192
220
|
},
|
|
221
|
+
providerDetails: {
|
|
222
|
+
type: 'array',
|
|
223
|
+
items: { $ref: '#/components/schemas/ProviderDetail' },
|
|
224
|
+
},
|
|
193
225
|
defaults: {
|
|
194
226
|
type: 'object',
|
|
195
227
|
properties: {
|
package/src/openapi/spec.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { sessionApprovalPaths } from './paths/session-approval';
|
|
|
13
13
|
import { sessionExtrasPaths } from './paths/session-extras';
|
|
14
14
|
import { sessionFilesPaths } from './paths/session-files';
|
|
15
15
|
import { sessionsPaths } from './paths/sessions';
|
|
16
|
-
import {
|
|
16
|
+
import { ottorouterPaths } from './paths/ottorouter';
|
|
17
17
|
import { skillsPaths } from './paths/skills';
|
|
18
18
|
import { streamPaths } from './paths/stream';
|
|
19
19
|
import { terminalsPath } from './paths/terminals';
|
|
@@ -38,7 +38,7 @@ export function getOpenAPISpec() {
|
|
|
38
38
|
{ name: 'files' },
|
|
39
39
|
{ name: 'git' },
|
|
40
40
|
{ name: 'terminals' },
|
|
41
|
-
{ name: '
|
|
41
|
+
{ name: 'ottorouter' },
|
|
42
42
|
{ name: 'auth' },
|
|
43
43
|
{ name: 'mcp' },
|
|
44
44
|
{ name: 'tunnel' },
|
|
@@ -59,7 +59,7 @@ export function getOpenAPISpec() {
|
|
|
59
59
|
...sessionExtrasPaths,
|
|
60
60
|
...sessionFilesPaths,
|
|
61
61
|
...sessionsPaths,
|
|
62
|
-
...
|
|
62
|
+
...ottorouterPaths,
|
|
63
63
|
...skillsPaths,
|
|
64
64
|
...streamPaths,
|
|
65
65
|
...terminalsPath,
|