@eduwork/dsh-oidc 0.2.4 → 0.3.0-dev.2

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 (72) hide show
  1. package/CHANGELOG.en.md +6 -0
  2. package/CHANGELOG.md +6 -0
  3. package/README.md +20 -132
  4. package/README_EN.md +20 -177
  5. package/docs/EDUWORK-MIGRATION.en.md +3 -25
  6. package/docs/EDUWORK-MIGRATION.md +3 -25
  7. package/docs/account-extensions.en.md +6 -6
  8. package/docs/account-extensions.md +3 -3
  9. package/docs/architecture.en.md +12 -117
  10. package/docs/architecture.md +12 -118
  11. package/docs/compatibility.en.md +6 -40
  12. package/docs/compatibility.md +6 -40
  13. package/docs/decisions/0001-one-plugin-composition-boundary.en.md +2 -2
  14. package/docs/decisions/0001-one-plugin-composition-boundary.md +2 -2
  15. package/docs/desktop-host.en.md +4 -5
  16. package/docs/desktop-host.md +8 -9
  17. package/docs/development.en.md +2 -2
  18. package/docs/development.md +2 -2
  19. package/docs/dsh-integration.en.md +11 -46
  20. package/docs/dsh-integration.md +12 -47
  21. package/docs/ecnu-reference.en.md +4 -61
  22. package/docs/ecnu-reference.md +4 -61
  23. package/docs/enterprise-profile.en.md +11 -32
  24. package/docs/enterprise-profile.md +12 -33
  25. package/docs/gateway-auth/README.md +168 -0
  26. package/docs/gateway-auth/README_EN.md +70 -0
  27. package/docs/gateway-auth/experimental-oidc-llm.en.md +53 -0
  28. package/docs/gateway-auth/experimental-oidc-llm.md +53 -0
  29. package/docs/gateway-auth/litellm-setup.en.md +114 -0
  30. package/docs/gateway-auth/litellm-setup.md +114 -0
  31. package/docs/gateway-auth/oidc-llm-draft.en.md +141 -0
  32. package/docs/gateway-auth/oidc-llm-draft.md +141 -0
  33. package/docs/getting-started.en.md +17 -122
  34. package/docs/getting-started.md +16 -225
  35. package/docs/key-binding-protocol.en.md +10 -220
  36. package/docs/key-binding-protocol.md +10 -220
  37. package/docs/oidc-interoperability.en.md +1 -1
  38. package/docs/oidc-interoperability.md +1 -1
  39. package/docs/open-integration.en.md +5 -67
  40. package/docs/open-integration.md +5 -67
  41. package/docs/public-resource-protocol.en.md +8 -44
  42. package/docs/public-resource-protocol.md +8 -43
  43. package/docs/security-model.en.md +10 -132
  44. package/docs/security-model.md +10 -132
  45. package/docs/server-integration-contract.en.md +12 -813
  46. package/docs/server-integration-contract.md +12 -825
  47. package/examples/ecnu.enterprise-profile.example.json +16 -20
  48. package/examples/enterprise-profile.example.json +16 -20
  49. package/examples/identity-only.example.json +7 -2
  50. package/examples/litellm.enterprise-profile.example.json +10 -0
  51. package/examples/oidc-llm.enterprise-profile.example.json +13 -0
  52. package/examples/resources-discovery.example.json +7 -9
  53. package/lib/callback-page.js +5 -5
  54. package/lib/client.js +31 -48
  55. package/lib/desktop-oidc.js +7 -11
  56. package/lib/gateway-backend.js +443 -0
  57. package/lib/gateway-protocol.js +6 -0
  58. package/lib/index.js +14 -15
  59. package/lib/litellm-protocol.js +117 -0
  60. package/lib/model-resource-transport.js +19 -0
  61. package/lib/oidc-llm-protocol.js +87 -0
  62. package/lib/oidc.js +40 -338
  63. package/lib/profile.js +42 -74
  64. package/lib/provider/authorization-scope.js +46 -0
  65. package/lib/provider/core.js +5 -16
  66. package/lib/provider/index.js +11 -2
  67. package/lib/transport.js +5 -0
  68. package/lib/typert-schemas.js +1 -1
  69. package/package.json +2 -2
  70. package/protocol/openapi.yaml +33 -240
  71. package/protocol/resources.openapi.yaml +8 -9
  72. package/schema/enterprise-profile.v1alpha1.schema.json +508 -107
@@ -4,129 +4,481 @@
4
4
  "title": "dsh-oidc Enterprise Profile v1alpha1",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["schemaVersion", "id", "displayName", "oidc"],
8
- "dependentRequired": { "keyBinding": ["provider"], "provider": ["keyBinding"] },
7
+ "required": [
8
+ "schemaVersion",
9
+ "id",
10
+ "displayName"
11
+ ],
12
+ "oneOf": [
13
+ {
14
+ "required": [
15
+ "oidc"
16
+ ],
17
+ "properties": {
18
+ "oidc": {},
19
+ "auth": false,
20
+ "provider": false
21
+ }
22
+ },
23
+ {
24
+ "required": [
25
+ "auth"
26
+ ],
27
+ "properties": {
28
+ "auth": {},
29
+ "oidc": false,
30
+ "provider": {
31
+ "$ref": "#/$defs/gatewayProvider"
32
+ }
33
+ }
34
+ }
35
+ ],
9
36
  "properties": {
10
- "schemaVersion": { "const": "dsh-oidc/v1alpha1" },
11
- "id": { "$ref": "#/$defs/id" },
12
- "displayName": { "$ref": "#/$defs/nonEmpty120" },
13
- "organization": { "$ref": "#/$defs/nonEmpty120" },
14
- "nativeInstitutionID": { "type": "string", "minLength": 1, "maxLength": 64 },
15
- "allowInsecureDevelopment": { "type": "boolean", "default": false },
16
- "insecureDevelopmentOrigin": { "type": "string", "minLength": 8, "maxLength": 2048, "pattern": "^http://" },
17
- "brand": { "$ref": "#/$defs/brand" },
18
- "oidc": { "$ref": "#/$defs/oidc" },
19
- "keyBinding": { "$ref": "#/$defs/keyBinding" },
20
- "provider": { "$ref": "#/$defs/provider" }
37
+ "schemaVersion": {
38
+ "const": "dsh-oidc/v1alpha1"
39
+ },
40
+ "id": {
41
+ "$ref": "#/$defs/id"
42
+ },
43
+ "displayName": {
44
+ "$ref": "#/$defs/nonEmpty120"
45
+ },
46
+ "organization": {
47
+ "$ref": "#/$defs/nonEmpty120"
48
+ },
49
+ "nativeInstitutionID": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "maxLength": 64
53
+ },
54
+ "allowInsecureDevelopment": {
55
+ "type": "boolean",
56
+ "default": false,
57
+ "description": "false (default): HTTPS only. true: allow HTTP service URLs too. Does not change issuer or OAuth validation."
58
+ },
59
+ "insecureDevelopmentOrigin": {
60
+ "deprecated": true,
61
+ "description": "Accepted for older configuration files; ignored. Use allowInsecureDevelopment only."
62
+ },
63
+ "brand": {
64
+ "$ref": "#/$defs/brand"
65
+ },
66
+ "oidc": {
67
+ "$ref": "#/$defs/oidc"
68
+ },
69
+ "auth": {
70
+ "$ref": "#/$defs/gatewayAuth"
71
+ },
72
+ "provider": {
73
+ "type": "object"
74
+ }
21
75
  },
22
76
  "allOf": [
23
77
  {
24
78
  "if": {
25
79
  "not": {
26
80
  "type": "object",
27
- "properties": { "insecureDevelopmentOrigin": {} },
28
- "required": ["insecureDevelopmentOrigin"]
81
+ "properties": {
82
+ "insecureDevelopmentOrigin": {}
83
+ },
84
+ "required": [
85
+ "insecureDevelopmentOrigin"
86
+ ]
29
87
  }
30
88
  },
31
89
  "then": {
32
90
  "type": "object",
33
91
  "properties": {
34
- "oidc": { "type": "object", "properties": { "issuer": { "$ref": "#/$defs/secureEndpointURL" } } },
35
- "keyBinding": { "type": "object", "properties": { "baseURL": { "$ref": "#/$defs/secureEndpointURL" } } },
36
- "provider": { "type": "object", "properties": { "baseURL": { "$ref": "#/$defs/secureEndpointURL" } } }
92
+ "oidc": {
93
+ "type": "object",
94
+ "properties": {
95
+ "issuer": {
96
+ "$ref": "#/$defs/secureEndpointURL"
97
+ }
98
+ }
99
+ },
100
+ "auth": {
101
+ "type": "object",
102
+ "properties": {
103
+ "discoveryUrl": {
104
+ "$ref": "#/$defs/secureEndpointURL"
105
+ },
106
+ "expectedIssuer": {
107
+ "$ref": "#/$defs/secureEndpointURL"
108
+ }
109
+ }
110
+ },
111
+ "provider": {
112
+ "type": "object",
113
+ "properties": {
114
+ "baseURL": {
115
+ "$ref": "#/$defs/secureEndpointURL"
116
+ }
117
+ }
118
+ }
37
119
  }
38
120
  }
39
121
  },
40
122
  {
41
123
  "if": {
42
124
  "type": "object",
43
- "properties": { "insecureDevelopmentOrigin": {} },
44
- "required": ["insecureDevelopmentOrigin"]
125
+ "properties": {
126
+ "insecureDevelopmentOrigin": {}
127
+ },
128
+ "required": [
129
+ "insecureDevelopmentOrigin"
130
+ ]
45
131
  },
46
- "then": { "type": "object", "properties": { "allowInsecureDevelopment": { "const": true } } }
132
+ "then": {
133
+ "type": "object",
134
+ "properties": {
135
+ "allowInsecureDevelopment": {
136
+ "const": true
137
+ }
138
+ }
139
+ }
47
140
  }
48
141
  ],
49
142
  "$defs": {
50
- "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,63}$" },
51
- "nonEmpty120": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^\\S(?:.*\\S)?$" },
52
- "positiveInteger": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
53
- "httpsURL": { "type": "string", "minLength": 9, "maxLength": 2048, "pattern": "^https://" },
54
- "secureEndpointURL": { "type": "string", "minLength": 9, "maxLength": 2048, "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(?=[:/]))" },
55
- "endpointURL": { "type": "string", "minLength": 8, "maxLength": 2048, "pattern": "^(https://|http://)" },
143
+ "gatewayAuth": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "discoveryUrl"
148
+ ],
149
+ "properties": {
150
+ "discoveryUrl": {
151
+ "$ref": "#/$defs/endpointURL"
152
+ },
153
+ "expectedIssuer": {
154
+ "$ref": "#/$defs/endpointURL"
155
+ },
156
+ "experimentalOidcLlm": {
157
+ "type": "boolean"
158
+ },
159
+ "clientId": {
160
+ "type": "string",
161
+ "minLength": 1,
162
+ "maxLength": 256
163
+ },
164
+ "identityMode": {
165
+ "enum": [
166
+ "oauth",
167
+ "oidc"
168
+ ]
169
+ }
170
+ },
171
+ "allOf": [
172
+ {
173
+ "if": {
174
+ "required": [
175
+ "experimentalOidcLlm"
176
+ ],
177
+ "properties": {
178
+ "experimentalOidcLlm": {
179
+ "const": true
180
+ }
181
+ }
182
+ },
183
+ "then": {
184
+ "required": [
185
+ "clientId",
186
+ "identityMode"
187
+ ],
188
+ "properties": {
189
+ "clientId": {},
190
+ "identityMode": {}
191
+ }
192
+ },
193
+ "else": {
194
+ "properties": {
195
+ "clientId": false,
196
+ "identityMode": false,
197
+ "discoveryUrl": {
198
+ "$ref": "#/$defs/secureEndpointURL"
199
+ },
200
+ "expectedIssuer": {
201
+ "$ref": "#/$defs/secureEndpointURL"
202
+ }
203
+ }
204
+ }
205
+ }
206
+ ]
207
+ },
208
+ "gatewayProvider": {
209
+ "type": "object",
210
+ "additionalProperties": false,
211
+ "properties": {
212
+ "id": {
213
+ "$ref": "#/$defs/id"
214
+ },
215
+ "displayName": {
216
+ "$ref": "#/$defs/nonEmpty120"
217
+ },
218
+ "adapter": {
219
+ "const": "openai-compatible"
220
+ },
221
+ "reasoning": {
222
+ "enum": [
223
+ "off",
224
+ "minimal",
225
+ "low",
226
+ "medium",
227
+ "high",
228
+ "xhigh",
229
+ "max"
230
+ ]
231
+ },
232
+ "defaultContextWindow": {
233
+ "$ref": "#/$defs/positiveInteger"
234
+ },
235
+ "defaultMaxTokens": {
236
+ "$ref": "#/$defs/positiveInteger"
237
+ },
238
+ "maxRequestImageBytes": {
239
+ "$ref": "#/$defs/positiveInteger"
240
+ },
241
+ "requestImagePixelBudget": {
242
+ "$ref": "#/$defs/positiveInteger"
243
+ },
244
+ "requestImageMaxBytes": {
245
+ "$ref": "#/$defs/positiveInteger"
246
+ },
247
+ "streamIdleTimeoutMs": {
248
+ "$ref": "#/$defs/positiveInteger"
249
+ },
250
+ "retryPolicy": {
251
+ "$ref": "#/$defs/retryPolicy"
252
+ },
253
+ "compat": {
254
+ "$ref": "#/$defs/compat"
255
+ },
256
+ "modelSource": {
257
+ "const": "discovery"
258
+ },
259
+ "models": {
260
+ "type": "array",
261
+ "minItems": 0,
262
+ "maxItems": 128,
263
+ "items": {
264
+ "$ref": "#/$defs/model"
265
+ }
266
+ }
267
+ }
268
+ },
269
+ "id": {
270
+ "type": "string",
271
+ "pattern": "^[a-z][a-z0-9-]{0,63}$"
272
+ },
273
+ "nonEmpty120": {
274
+ "type": "string",
275
+ "minLength": 1,
276
+ "maxLength": 120,
277
+ "pattern": "^\\S(?:.*\\S)?$"
278
+ },
279
+ "positiveInteger": {
280
+ "type": "integer",
281
+ "minimum": 1,
282
+ "maximum": 9007199254740991
283
+ },
284
+ "httpsURL": {
285
+ "type": "string",
286
+ "minLength": 9,
287
+ "maxLength": 2048,
288
+ "pattern": "^https://"
289
+ },
290
+ "secureEndpointURL": {
291
+ "type": "string",
292
+ "minLength": 9,
293
+ "maxLength": 2048,
294
+ "pattern": "^(https://|http://(localhost|127\\.0\\.0\\.1|\\[::1\\])(?=[:/]))"
295
+ },
296
+ "endpointURL": {
297
+ "type": "string",
298
+ "minLength": 8,
299
+ "maxLength": 2048,
300
+ "pattern": "^(https://|http://)"
301
+ },
56
302
  "brand": {
57
303
  "type": "object",
58
304
  "additionalProperties": false,
59
305
  "properties": {
60
- "productName": { "type": "string", "minLength": 1, "maxLength": 80 },
61
- "organizationName": { "$ref": "#/$defs/nonEmpty120" },
62
- "mark": { "type": "string", "minLength": 1, "maxLength": 4 },
63
- "logoURL": { "type": "string", "minLength": 9, "maxLength": 131072, "pattern": "^(https://|data:image/(png|webp);base64,)" },
64
- "primaryColor": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
65
- "loginTitle": { "type": "string", "minLength": 1, "maxLength": 120 },
66
- "loginDescription": { "type": "string", "minLength": 1, "maxLength": 500 },
67
- "supportURL": { "$ref": "#/$defs/httpsURL" }
306
+ "productName": {
307
+ "type": "string",
308
+ "minLength": 1,
309
+ "maxLength": 80
310
+ },
311
+ "organizationName": {
312
+ "$ref": "#/$defs/nonEmpty120"
313
+ },
314
+ "mark": {
315
+ "type": "string",
316
+ "minLength": 1,
317
+ "maxLength": 4
318
+ },
319
+ "logoURL": {
320
+ "type": "string",
321
+ "minLength": 9,
322
+ "maxLength": 131072,
323
+ "pattern": "^(https://|data:image/(png|webp);base64,)"
324
+ },
325
+ "primaryColor": {
326
+ "type": "string",
327
+ "pattern": "^#[0-9a-fA-F]{6}$"
328
+ },
329
+ "loginTitle": {
330
+ "type": "string",
331
+ "minLength": 1,
332
+ "maxLength": 120
333
+ },
334
+ "loginDescription": {
335
+ "type": "string",
336
+ "minLength": 1,
337
+ "maxLength": 500
338
+ },
339
+ "supportURL": {
340
+ "$ref": "#/$defs/httpsURL"
341
+ }
68
342
  }
69
343
  },
70
344
  "oidc": {
71
345
  "type": "object",
72
346
  "additionalProperties": false,
73
- "required": ["issuer", "clientId", "scopes"],
347
+ "required": [
348
+ "issuer",
349
+ "clientId",
350
+ "scopes"
351
+ ],
74
352
  "properties": {
75
- "issuer": { "$ref": "#/$defs/endpointURL" },
76
- "clientId": { "type": "string", "minLength": 1, "maxLength": 256 },
353
+ "issuer": {
354
+ "$ref": "#/$defs/endpointURL"
355
+ },
356
+ "clientId": {
357
+ "type": "string",
358
+ "minLength": 1,
359
+ "maxLength": 256
360
+ },
77
361
  "scopes": {
78
362
  "type": "array",
79
363
  "minItems": 2,
80
364
  "maxItems": 64,
81
365
  "uniqueItems": true,
82
366
  "allOf": [
83
- { "contains": { "const": "openid" } },
84
- { "contains": { "const": "profile" } }
367
+ {
368
+ "contains": {
369
+ "const": "openid"
370
+ }
371
+ },
372
+ {
373
+ "contains": {
374
+ "const": "profile"
375
+ }
376
+ }
85
377
  ],
86
- "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^\\S+$" }
378
+ "items": {
379
+ "type": "string",
380
+ "minLength": 1,
381
+ "maxLength": 128,
382
+ "pattern": "^\\S+$"
383
+ }
87
384
  }
88
385
  }
89
386
  },
90
- "keyBinding": {
91
- "type": "object",
92
- "additionalProperties": false,
93
- "required": ["baseURL"],
94
- "properties": {
95
- "type": { "enum": ["worker-user-center-v1", "eduwork-resources-v1"], "default": "worker-user-center-v1" },
96
- "baseURL": { "$ref": "#/$defs/endpointURL" },
97
- "credentialRef": { "type": "string", "default": "EDUWORK_API_KEY", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", "maxLength": 128 }
98
- }
99
- },
100
387
  "compat": {
101
388
  "type": "object",
102
389
  "additionalProperties": false,
103
390
  "properties": {
104
- "supportsDeveloperRole": { "type": "boolean" },
105
- "supportsStore": { "type": "boolean" },
106
- "supportsReasoningEffort": { "type": "boolean" },
107
- "supportsUsageInStreaming": { "type": "boolean" },
108
- "maxTokensField": { "enum": ["max_completion_tokens", "max_tokens"] },
109
- "supportsStrictMode": { "type": "boolean" },
110
- "supportsLongCacheRetention": { "type": "boolean" },
111
- "thinkingFormat": { "enum": ["openai", "deepseek", "openrouter", "together", "baseten", "zai", "qwen", "chat-template", "qwen-chat-template", "string-thinking", "ant-ling"] },
112
- "requiresReasoningContentOnAssistantMessages": { "type": "boolean" }
391
+ "supportsDeveloperRole": {
392
+ "type": "boolean"
393
+ },
394
+ "supportsStore": {
395
+ "type": "boolean"
396
+ },
397
+ "supportsReasoningEffort": {
398
+ "type": "boolean"
399
+ },
400
+ "supportsUsageInStreaming": {
401
+ "type": "boolean"
402
+ },
403
+ "maxTokensField": {
404
+ "enum": [
405
+ "max_completion_tokens",
406
+ "max_tokens"
407
+ ]
408
+ },
409
+ "supportsStrictMode": {
410
+ "type": "boolean"
411
+ },
412
+ "supportsLongCacheRetention": {
413
+ "type": "boolean"
414
+ },
415
+ "thinkingFormat": {
416
+ "enum": [
417
+ "openai",
418
+ "deepseek",
419
+ "openrouter",
420
+ "together",
421
+ "baseten",
422
+ "zai",
423
+ "qwen",
424
+ "chat-template",
425
+ "qwen-chat-template",
426
+ "string-thinking",
427
+ "ant-ling"
428
+ ]
429
+ },
430
+ "requiresReasoningContentOnAssistantMessages": {
431
+ "type": "boolean"
432
+ }
113
433
  }
114
434
  },
115
435
  "retryPolicy": {
116
436
  "type": "object",
117
437
  "additionalProperties": false,
118
- "required": ["mode"],
438
+ "required": [
439
+ "mode"
440
+ ],
119
441
  "properties": {
120
- "mode": { "enum": ["normal", "always"] },
121
- "maxRetries": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
122
- "retryableCodes": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 128 } },
442
+ "mode": {
443
+ "enum": [
444
+ "normal",
445
+ "always"
446
+ ]
447
+ },
448
+ "maxRetries": {
449
+ "type": "integer",
450
+ "minimum": 0,
451
+ "maximum": 9007199254740991
452
+ },
453
+ "retryableCodes": {
454
+ "type": "array",
455
+ "minItems": 1,
456
+ "uniqueItems": true,
457
+ "items": {
458
+ "type": "string",
459
+ "minLength": 1,
460
+ "maxLength": 128
461
+ }
462
+ },
123
463
  "backoff": {
124
464
  "type": "object",
125
465
  "additionalProperties": false,
126
466
  "properties": {
127
- "initialDelayMs": { "type": "number", "exclusiveMinimum": 0, "maximum": 2147483647 },
128
- "maxDelayMs": { "type": "number", "exclusiveMinimum": 0, "maximum": 2147483647 },
129
- "jitterRatio": { "type": "number", "minimum": 0, "maximum": 1 }
467
+ "initialDelayMs": {
468
+ "type": "number",
469
+ "exclusiveMinimum": 0,
470
+ "maximum": 2147483647
471
+ },
472
+ "maxDelayMs": {
473
+ "type": "number",
474
+ "exclusiveMinimum": 0,
475
+ "maximum": 2147483647
476
+ },
477
+ "jitterRatio": {
478
+ "type": "number",
479
+ "minimum": 0,
480
+ "maximum": 1
481
+ }
130
482
  }
131
483
  }
132
484
  }
@@ -134,59 +486,108 @@
134
486
  "model": {
135
487
  "type": "object",
136
488
  "additionalProperties": false,
137
- "required": ["id"],
489
+ "required": [
490
+ "id"
491
+ ],
138
492
  "properties": {
139
- "id": { "type": "string", "minLength": 1, "maxLength": 256 },
140
- "name": { "type": "string", "minLength": 1, "maxLength": 256 },
141
- "input": { "type": "array", "minItems": 1, "maxItems": 2, "uniqueItems": true, "items": { "enum": ["text", "image"] } },
142
- "contextWindow": { "$ref": "#/$defs/positiveInteger" },
143
- "maxTokens": { "$ref": "#/$defs/positiveInteger" },
144
- "reasoning": { "type": "boolean" },
145
- "defaultReasoningEffort": { "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max"] },
493
+ "id": {
494
+ "type": "string",
495
+ "minLength": 1,
496
+ "maxLength": 256
497
+ },
498
+ "name": {
499
+ "type": "string",
500
+ "minLength": 1,
501
+ "maxLength": 256
502
+ },
503
+ "input": {
504
+ "type": "array",
505
+ "minItems": 1,
506
+ "maxItems": 2,
507
+ "uniqueItems": true,
508
+ "items": {
509
+ "enum": [
510
+ "text",
511
+ "image"
512
+ ]
513
+ }
514
+ },
515
+ "contextWindow": {
516
+ "$ref": "#/$defs/positiveInteger"
517
+ },
518
+ "maxTokens": {
519
+ "$ref": "#/$defs/positiveInteger"
520
+ },
521
+ "reasoning": {
522
+ "type": "boolean"
523
+ },
524
+ "defaultReasoningEffort": {
525
+ "enum": [
526
+ "off",
527
+ "minimal",
528
+ "low",
529
+ "medium",
530
+ "high",
531
+ "xhigh",
532
+ "max"
533
+ ]
534
+ },
146
535
  "reasoningEfforts": {
147
536
  "oneOf": [
148
- { "const": false },
537
+ {
538
+ "const": false
539
+ },
149
540
  {
150
541
  "type": "object",
151
542
  "minProperties": 1,
152
543
  "maxProperties": 7,
153
544
  "additionalProperties": false,
154
545
  "properties": {
155
- "off": { "type": ["string", "null"], "minLength": 1, "maxLength": 32 },
156
- "minimal": { "type": "string", "minLength": 1, "maxLength": 32 },
157
- "low": { "type": "string", "minLength": 1, "maxLength": 32 },
158
- "medium": { "type": "string", "minLength": 1, "maxLength": 32 },
159
- "high": { "type": "string", "minLength": 1, "maxLength": 32 },
160
- "xhigh": { "type": "string", "minLength": 1, "maxLength": 32 },
161
- "max": { "type": "string", "minLength": 1, "maxLength": 32 }
546
+ "off": {
547
+ "type": [
548
+ "string",
549
+ "null"
550
+ ],
551
+ "minLength": 1,
552
+ "maxLength": 32
553
+ },
554
+ "minimal": {
555
+ "type": "string",
556
+ "minLength": 1,
557
+ "maxLength": 32
558
+ },
559
+ "low": {
560
+ "type": "string",
561
+ "minLength": 1,
562
+ "maxLength": 32
563
+ },
564
+ "medium": {
565
+ "type": "string",
566
+ "minLength": 1,
567
+ "maxLength": 32
568
+ },
569
+ "high": {
570
+ "type": "string",
571
+ "minLength": 1,
572
+ "maxLength": 32
573
+ },
574
+ "xhigh": {
575
+ "type": "string",
576
+ "minLength": 1,
577
+ "maxLength": 32
578
+ },
579
+ "max": {
580
+ "type": "string",
581
+ "minLength": 1,
582
+ "maxLength": 32
583
+ }
162
584
  }
163
585
  }
164
586
  ]
165
587
  },
166
- "compat": { "$ref": "#/$defs/compat" }
167
- }
168
- },
169
- "provider": {
170
- "type": "object",
171
- "additionalProperties": false,
172
- "required": ["id", "adapter", "baseURL"],
173
- "allOf": [{ "if": { "required": ["modelSource"], "properties": { "modelSource": { "const": "discovery" } } }, "else": { "required": ["models"], "properties": { "models": { "type": "array", "minItems": 1 } } } }],
174
- "properties": {
175
- "id": { "$ref": "#/$defs/id" },
176
- "displayName": { "$ref": "#/$defs/nonEmpty120" },
177
- "adapter": { "const": "openai-compatible" },
178
- "baseURL": { "$ref": "#/$defs/endpointURL" },
179
- "reasoning": { "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max"] },
180
- "defaultContextWindow": { "$ref": "#/$defs/positiveInteger" },
181
- "defaultMaxTokens": { "$ref": "#/$defs/positiveInteger" },
182
- "maxRequestImageBytes": { "$ref": "#/$defs/positiveInteger" },
183
- "requestImagePixelBudget": { "$ref": "#/$defs/positiveInteger" },
184
- "requestImageMaxBytes": { "$ref": "#/$defs/positiveInteger" },
185
- "streamIdleTimeoutMs": { "$ref": "#/$defs/positiveInteger" },
186
- "retryPolicy": { "$ref": "#/$defs/retryPolicy" },
187
- "compat": { "$ref": "#/$defs/compat" },
188
- "modelSource": { "enum": ["profile", "discovery"], "default": "profile" },
189
- "models": { "type": "array", "minItems": 0, "maxItems": 128, "items": { "$ref": "#/$defs/model" } }
588
+ "compat": {
589
+ "$ref": "#/$defs/compat"
590
+ }
190
591
  }
191
592
  }
192
593
  }