@aid-framework/ir 0.0.0 → 0.1.48

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 (122) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +199 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/build.d.ts +74 -0
  5. package/dist/build.d.ts.map +1 -0
  6. package/dist/build.js +1079 -0
  7. package/dist/build.js.map +1 -0
  8. package/dist/capabilities.d.ts +65 -0
  9. package/dist/capabilities.d.ts.map +1 -0
  10. package/dist/capabilities.js +176 -0
  11. package/dist/capabilities.js.map +1 -0
  12. package/dist/catalog/index.d.ts +36 -0
  13. package/dist/catalog/index.d.ts.map +1 -0
  14. package/dist/catalog/index.js +43 -0
  15. package/dist/catalog/index.js.map +1 -0
  16. package/dist/catalog/models.json +52 -0
  17. package/dist/diagnostics.d.ts +90 -0
  18. package/dist/diagnostics.d.ts.map +1 -0
  19. package/dist/diagnostics.js +103 -0
  20. package/dist/diagnostics.js.map +1 -0
  21. package/dist/gates/agents.d.ts +34 -0
  22. package/dist/gates/agents.d.ts.map +1 -0
  23. package/dist/gates/agents.js +233 -0
  24. package/dist/gates/agents.js.map +1 -0
  25. package/dist/gates/capability.d.ts +15 -0
  26. package/dist/gates/capability.d.ts.map +1 -0
  27. package/dist/gates/capability.js +81 -0
  28. package/dist/gates/capability.js.map +1 -0
  29. package/dist/gates/contract.d.ts +35 -0
  30. package/dist/gates/contract.d.ts.map +1 -0
  31. package/dist/gates/contract.js +19 -0
  32. package/dist/gates/contract.js.map +1 -0
  33. package/dist/gates/cost.d.ts +40 -0
  34. package/dist/gates/cost.d.ts.map +1 -0
  35. package/dist/gates/cost.js +167 -0
  36. package/dist/gates/cost.js.map +1 -0
  37. package/dist/gates/deploy.d.ts +23 -0
  38. package/dist/gates/deploy.d.ts.map +1 -0
  39. package/dist/gates/deploy.js +44 -0
  40. package/dist/gates/deploy.js.map +1 -0
  41. package/dist/gates/eval-coverage.d.ts +11 -0
  42. package/dist/gates/eval-coverage.d.ts.map +1 -0
  43. package/dist/gates/eval-coverage.js +50 -0
  44. package/dist/gates/eval-coverage.js.map +1 -0
  45. package/dist/gates/guardrails.d.ts +24 -0
  46. package/dist/gates/guardrails.d.ts.map +1 -0
  47. package/dist/gates/guardrails.js +112 -0
  48. package/dist/gates/guardrails.js.map +1 -0
  49. package/dist/gates/hitl.d.ts +17 -0
  50. package/dist/gates/hitl.d.ts.map +1 -0
  51. package/dist/gates/hitl.js +40 -0
  52. package/dist/gates/hitl.js.map +1 -0
  53. package/dist/gates/index.d.ts +66 -0
  54. package/dist/gates/index.d.ts.map +1 -0
  55. package/dist/gates/index.js +77 -0
  56. package/dist/gates/index.js.map +1 -0
  57. package/dist/gates/memory.d.ts +13 -0
  58. package/dist/gates/memory.d.ts.map +1 -0
  59. package/dist/gates/memory.js +67 -0
  60. package/dist/gates/memory.js.map +1 -0
  61. package/dist/gates/normalize.d.ts +26 -0
  62. package/dist/gates/normalize.d.ts.map +1 -0
  63. package/dist/gates/normalize.js +228 -0
  64. package/dist/gates/normalize.js.map +1 -0
  65. package/dist/gates/orchestration.d.ts +17 -0
  66. package/dist/gates/orchestration.d.ts.map +1 -0
  67. package/dist/gates/orchestration.js +46 -0
  68. package/dist/gates/orchestration.js.map +1 -0
  69. package/dist/gates/referential.d.ts +12 -0
  70. package/dist/gates/referential.d.ts.map +1 -0
  71. package/dist/gates/referential.js +554 -0
  72. package/dist/gates/referential.js.map +1 -0
  73. package/dist/gates/security.d.ts +22 -0
  74. package/dist/gates/security.d.ts.map +1 -0
  75. package/dist/gates/security.js +225 -0
  76. package/dist/gates/security.js.map +1 -0
  77. package/dist/index.d.ts +27 -0
  78. package/dist/index.d.ts.map +1 -0
  79. package/dist/index.js +19 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/policy/ast.d.ts +61 -0
  82. package/dist/policy/ast.d.ts.map +1 -0
  83. package/dist/policy/ast.js +48 -0
  84. package/dist/policy/ast.js.map +1 -0
  85. package/dist/policy/index.d.ts +7 -0
  86. package/dist/policy/index.d.ts.map +1 -0
  87. package/dist/policy/index.js +4 -0
  88. package/dist/policy/index.js.map +1 -0
  89. package/dist/policy/lexer.d.ts +27 -0
  90. package/dist/policy/lexer.d.ts.map +1 -0
  91. package/dist/policy/lexer.js +147 -0
  92. package/dist/policy/lexer.js.map +1 -0
  93. package/dist/policy/parser.d.ts +15 -0
  94. package/dist/policy/parser.d.ts.map +1 -0
  95. package/dist/policy/parser.js +202 -0
  96. package/dist/policy/parser.js.map +1 -0
  97. package/dist/predicate/ast.d.ts +125 -0
  98. package/dist/predicate/ast.d.ts.map +1 -0
  99. package/dist/predicate/ast.js +111 -0
  100. package/dist/predicate/ast.js.map +1 -0
  101. package/dist/predicate/index.d.ts +7 -0
  102. package/dist/predicate/index.d.ts.map +1 -0
  103. package/dist/predicate/index.js +4 -0
  104. package/dist/predicate/index.js.map +1 -0
  105. package/dist/predicate/lexer.d.ts +30 -0
  106. package/dist/predicate/lexer.d.ts.map +1 -0
  107. package/dist/predicate/lexer.js +176 -0
  108. package/dist/predicate/lexer.js.map +1 -0
  109. package/dist/predicate/parser.d.ts +16 -0
  110. package/dist/predicate/parser.d.ts.map +1 -0
  111. package/dist/predicate/parser.js +317 -0
  112. package/dist/predicate/parser.js.map +1 -0
  113. package/dist/schema/ir.schema.json +1144 -0
  114. package/dist/serialize.d.ts +15 -0
  115. package/dist/serialize.d.ts.map +1 -0
  116. package/dist/serialize.js +53 -0
  117. package/dist/serialize.js.map +1 -0
  118. package/dist/shapes.d.ts +671 -0
  119. package/dist/shapes.d.ts.map +1 -0
  120. package/dist/shapes.js +159 -0
  121. package/dist/shapes.js.map +1 -0
  122. package/package.json +44 -14
@@ -0,0 +1,1144 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aid-framework.dev/schema/ir-0.1.json",
4
+ "title": "AID IR v0.1",
5
+ "description": "The packed intermediate representation produced from an AID spec document. Every top-level key is always present; deferred collections are empty arrays in Phase 0 rather than absent.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "irVersion",
10
+ "specVersion",
11
+ "project",
12
+ "types",
13
+ "models",
14
+ "prompts",
15
+ "tools",
16
+ "retrievers",
17
+ "embeddings",
18
+ "stores",
19
+ "memory",
20
+ "agents",
21
+ "pipelines",
22
+ "evals",
23
+ "guardrails",
24
+ "deployments",
25
+ "observability",
26
+ "runtime",
27
+ "requiredCapabilities"
28
+ ],
29
+ "properties": {
30
+ "irVersion": {
31
+ "type": "string",
32
+ "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
33
+ "description": "Semver of the IR format, independent of specVersion."
34
+ },
35
+ "specVersion": {
36
+ "type": "string",
37
+ "pattern": "^[0-9]+\\.[0-9]+$",
38
+ "description": "The spec language version this IR was built from."
39
+ },
40
+ "project": { "$ref": "#/$defs/project" },
41
+ "types": { "type": "array", "items": { "$ref": "#/$defs/typeShape" } },
42
+ "models": { "type": "array", "items": { "$ref": "#/$defs/model" } },
43
+ "prompts": { "type": "array", "items": { "$ref": "#/$defs/prompt" } },
44
+ "tools": { "type": "array", "items": { "$ref": "#/$defs/tool" } },
45
+ "pipelines": { "type": "array", "items": { "$ref": "#/$defs/pipeline" } },
46
+ "evals": { "type": "array", "items": { "$ref": "#/$defs/eval" } },
47
+ "retrievers": { "type": "array", "items": { "$ref": "#/$defs/retriever" } },
48
+ "embeddings": { "type": "array", "items": { "$ref": "#/$defs/embedding" } },
49
+ "stores": { "type": "array", "items": { "$ref": "#/$defs/vectorStore" } },
50
+ "memory": { "type": "array", "items": { "$ref": "#/$defs/memory" } },
51
+ "agents": { "type": "array", "items": { "$ref": "#/$defs/agent" } },
52
+ "guardrails": { "type": "array", "items": { "$ref": "#/$defs/guardrail" } },
53
+ "deployments": { "type": "array", "items": { "$ref": "#/$defs/deployment" } },
54
+ "observability": { "$ref": "#/$defs/observability" },
55
+ "runtime": { "$ref": "#/$defs/runtime" },
56
+ "requiredCapabilities": {
57
+ "type": "array",
58
+ "items": { "$ref": "#/$defs/requiredCapability" },
59
+ "uniqueItems": true
60
+ }
61
+ },
62
+ "$defs": {
63
+ "requiredCapability": {
64
+ "enum": [
65
+ "http-trigger",
66
+ "json-schema",
67
+ "streaming",
68
+ "tool-calling",
69
+ "cursor-memory",
70
+ "otel",
71
+ "vision",
72
+ "audio",
73
+ "embeddings",
74
+ "rerank",
75
+ "long-context",
76
+ "reasoning",
77
+ "prompt-cache",
78
+ "agents",
79
+ "guardrails"
80
+ ]
81
+ },
82
+ "modelCapability": {
83
+ "enum": [
84
+ "json-schema",
85
+ "streaming",
86
+ "tool-calling",
87
+ "vision",
88
+ "audio",
89
+ "embeddings",
90
+ "rerank",
91
+ "long-context",
92
+ "reasoning",
93
+ "prompt-cache"
94
+ ]
95
+ },
96
+ "provider": {
97
+ "enum": [
98
+ "openai",
99
+ "openai-compatible",
100
+ "anthropic",
101
+ "azure",
102
+ "bedrock",
103
+ "google",
104
+ "ollama",
105
+ "vllm",
106
+ "fake",
107
+ "custom"
108
+ ]
109
+ },
110
+ "identifier": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" },
111
+ "typeName": { "type": "string", "pattern": "^[A-Z][A-Za-z0-9]{0,63}$" },
112
+ "semanticCache": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": ["threshold", "ttlSeconds"],
116
+ "properties": {
117
+ "threshold": { "type": "number", "minimum": 0, "maximum": 1 },
118
+ "ttlSeconds": { "type": "integer", "minimum": 1 }
119
+ }
120
+ },
121
+ "trait": {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": ["name"],
125
+ "properties": {
126
+ "name": { "type": "string", "minLength": 1 },
127
+ "value": true
128
+ }
129
+ },
130
+ "typeRef": {
131
+ "oneOf": [
132
+ {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["kind", "name", "list"],
136
+ "properties": {
137
+ "kind": { "const": "primitive" },
138
+ "name": { "enum": ["string", "number", "integer", "boolean"] },
139
+ "list": { "type": "boolean" }
140
+ }
141
+ },
142
+ {
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "required": ["kind", "name", "list", "resolved"],
146
+ "properties": {
147
+ "kind": { "const": "named" },
148
+ "name": { "$ref": "#/$defs/typeName" },
149
+ "list": { "type": "boolean" },
150
+ "resolved": {
151
+ "type": "boolean",
152
+ "description": "False when the name matches no entry in `types`; the referential gate rejects those."
153
+ }
154
+ }
155
+ }
156
+ ]
157
+ },
158
+ "typeField": {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": ["name", "type", "required"],
162
+ "properties": {
163
+ "name": { "$ref": "#/$defs/identifier" },
164
+ "type": { "$ref": "#/$defs/typeRef" },
165
+ "required": { "type": "boolean" },
166
+ "description": { "type": "string" },
167
+ "enum": {
168
+ "type": "array",
169
+ "items": { "type": ["string", "number", "boolean"] }
170
+ },
171
+ "minimum": { "type": "number" },
172
+ "maximum": { "type": "number" },
173
+ "sensitive": { "type": "boolean" }
174
+ }
175
+ },
176
+ "typeShape": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "required": ["id", "kind", "fields"],
180
+ "properties": {
181
+ "id": { "$ref": "#/$defs/typeName" },
182
+ "kind": { "const": "struct" },
183
+ "description": { "type": "string" },
184
+ "fields": { "type": "array", "items": { "$ref": "#/$defs/typeField" } }
185
+ }
186
+ },
187
+ "modelParams": {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "properties": {
191
+ "temperature": { "type": "number" },
192
+ "topP": { "type": "number" },
193
+ "maxTokens": { "type": "integer", "minimum": 1 },
194
+ "seed": { "type": "integer" },
195
+ "stop": { "type": "array", "items": { "type": "string" } }
196
+ }
197
+ },
198
+ "modelLimits": {
199
+ "type": "object",
200
+ "additionalProperties": false,
201
+ "required": ["contextTokens"],
202
+ "properties": {
203
+ "contextTokens": { "type": "integer", "minimum": 1 },
204
+ "maxOutputTokens": { "type": "integer", "minimum": 1 },
205
+ "rpm": { "type": "number", "minimum": 0 },
206
+ "tpm": { "type": "number", "minimum": 0 }
207
+ }
208
+ },
209
+ "costProfile": {
210
+ "type": "object",
211
+ "additionalProperties": false,
212
+ "required": ["inputPerMTok", "outputPerMTok"],
213
+ "properties": {
214
+ "inputPerMTok": { "type": "number", "minimum": 0 },
215
+ "outputPerMTok": { "type": "number", "minimum": 0 }
216
+ }
217
+ },
218
+ "model": {
219
+ "type": "object",
220
+ "additionalProperties": false,
221
+ "required": [
222
+ "id",
223
+ "identity",
224
+ "provider",
225
+ "modelId",
226
+ "capabilities",
227
+ "params",
228
+ "limits",
229
+ "fallbacks",
230
+ "traits"
231
+ ],
232
+ "properties": {
233
+ "id": { "$ref": "#/$defs/identifier" },
234
+ "identity": { "type": "string", "pattern": "^model:[a-z][a-z0-9_]{0,63}$" },
235
+ "provider": { "$ref": "#/$defs/provider" },
236
+ "modelId": { "type": "string", "minLength": 1 },
237
+ "capabilities": {
238
+ "type": "array",
239
+ "items": { "$ref": "#/$defs/modelCapability" },
240
+ "uniqueItems": true
241
+ },
242
+ "params": { "$ref": "#/$defs/modelParams" },
243
+ "limits": { "$ref": "#/$defs/modelLimits" },
244
+ "costProfile": { "$ref": "#/$defs/costProfile" },
245
+ "costProfileId": { "type": "string", "minLength": 1 },
246
+ "fallbacks": { "type": "array", "items": { "$ref": "#/$defs/identifier" } },
247
+ "cache": {
248
+ "type": "object",
249
+ "additionalProperties": false,
250
+ "properties": {
251
+ "prompt": { "type": "boolean" },
252
+ "semantic": { "$ref": "#/$defs/semanticCache" }
253
+ }
254
+ },
255
+ "baseUrl": { "type": "string", "minLength": 1 },
256
+ "apiKeyEnv": { "type": "string", "minLength": 1 },
257
+ "description": { "type": "string" },
258
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
259
+ }
260
+ },
261
+ "promptVariable": {
262
+ "type": "object",
263
+ "additionalProperties": false,
264
+ "required": ["name", "type", "required"],
265
+ "properties": {
266
+ "name": { "$ref": "#/$defs/identifier" },
267
+ "type": { "$ref": "#/$defs/typeRef" },
268
+ "required": { "type": "boolean" },
269
+ "default": true,
270
+ "description": { "type": "string" },
271
+ "sensitive": { "type": "boolean" }
272
+ }
273
+ },
274
+ "promptOutput": {
275
+ "type": "object",
276
+ "additionalProperties": false,
277
+ "required": ["kind"],
278
+ "properties": {
279
+ "kind": { "enum": ["text", "json", "structured"] },
280
+ "schema": { "$ref": "#/$defs/typeRef" }
281
+ }
282
+ },
283
+ "prompt": {
284
+ "type": "object",
285
+ "additionalProperties": false,
286
+ "required": [
287
+ "id",
288
+ "version",
289
+ "identity",
290
+ "model",
291
+ "template",
292
+ "variables",
293
+ "output",
294
+ "params",
295
+ "examples",
296
+ "guardrails",
297
+ "evals",
298
+ "traits"
299
+ ],
300
+ "properties": {
301
+ "id": { "$ref": "#/$defs/identifier" },
302
+ "version": { "type": "integer", "minimum": 1 },
303
+ "identity": {
304
+ "type": "string",
305
+ "pattern": "^prompt:[a-z][a-z0-9_]{0,63}@[1-9][0-9]*$"
306
+ },
307
+ "model": { "$ref": "#/$defs/identifier" },
308
+ "template": { "type": "string" },
309
+ "variables": { "type": "array", "items": { "$ref": "#/$defs/promptVariable" } },
310
+ "output": { "$ref": "#/$defs/promptOutput" },
311
+ "params": { "$ref": "#/$defs/modelParams" },
312
+ "examples": { "type": "array", "items": true },
313
+ "guardrails": { "type": "array", "items": { "type": "string" } },
314
+ "evals": { "type": "array", "items": { "type": "string" } },
315
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
316
+ }
317
+ },
318
+ "policyExpr": {
319
+ "type": "object",
320
+ "description": "A parsed PolicyExpr node. Operands recurse, so the shape is validated structurally rather than exhaustively.",
321
+ "additionalProperties": true,
322
+ "required": ["kind"],
323
+ "properties": {
324
+ "kind": { "enum": ["literal", "comparison", "and", "or", "not", "call"] }
325
+ },
326
+ "$comment": "Intentionally loose: the AST's `kind` discriminator is enforced, the recursive operand shape is checked by the parser that produced it."
327
+ },
328
+ "toolHandler": {
329
+ "type": "object",
330
+ "additionalProperties": false,
331
+ "required": ["kind"],
332
+ "properties": {
333
+ "kind": { "enum": ["generated", "business", "mcp"] },
334
+ "symbol": { "type": "string" },
335
+ "mcp": {
336
+ "type": "object",
337
+ "additionalProperties": false,
338
+ "required": ["server", "tool"],
339
+ "properties": {
340
+ "server": { "type": "string" },
341
+ "tool": { "type": "string" }
342
+ }
343
+ }
344
+ }
345
+ },
346
+ "tool": {
347
+ "type": "object",
348
+ "additionalProperties": false,
349
+ "required": [
350
+ "id",
351
+ "identity",
352
+ "name",
353
+ "description",
354
+ "input",
355
+ "output",
356
+ "sideEffects",
357
+ "requiresConfirmation",
358
+ "timeoutMs",
359
+ "retries",
360
+ "idempotency",
361
+ "handler",
362
+ "traits"
363
+ ],
364
+ "properties": {
365
+ "id": { "$ref": "#/$defs/identifier" },
366
+ "identity": { "type": "string", "pattern": "^tool:[a-z][a-z0-9_]{0,63}$" },
367
+ "name": { "type": "string", "minLength": 1 },
368
+ "description": { "type": "string" },
369
+ "input": { "$ref": "#/$defs/typeRef" },
370
+ "output": { "$ref": "#/$defs/typeRef" },
371
+ "sideEffects": { "enum": ["none", "read", "write", "destructive"] },
372
+ "requiresConfirmation": { "type": "boolean" },
373
+ "auth": { "$ref": "#/$defs/policyExpr" },
374
+ "timeoutMs": { "type": "integer", "minimum": 0 },
375
+ "retries": { "type": "integer", "minimum": 0 },
376
+ "idempotency": { "enum": ["none", "key", "natural"] },
377
+ "handler": { "$ref": "#/$defs/toolHandler" },
378
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
379
+ }
380
+ },
381
+ "pipelineTrigger": {
382
+ "oneOf": [
383
+ {
384
+ "type": "object",
385
+ "additionalProperties": false,
386
+ "required": ["kind", "method", "path"],
387
+ "properties": {
388
+ "kind": { "const": "http" },
389
+ "method": { "type": "string", "minLength": 1 },
390
+ "path": { "type": "string", "minLength": 1 }
391
+ }
392
+ },
393
+ {
394
+ "type": "object",
395
+ "additionalProperties": false,
396
+ "required": ["kind", "schedule"],
397
+ "properties": {
398
+ "kind": { "const": "schedule" },
399
+ "schedule": { "type": "string", "minLength": 1 }
400
+ }
401
+ },
402
+ {
403
+ "type": "object",
404
+ "additionalProperties": false,
405
+ "required": ["kind", "event"],
406
+ "properties": {
407
+ "kind": { "const": "event" },
408
+ "event": { "type": "string", "minLength": 1 }
409
+ }
410
+ },
411
+ {
412
+ "type": "object",
413
+ "additionalProperties": false,
414
+ "required": ["kind"],
415
+ "properties": { "kind": { "const": "manual" } }
416
+ }
417
+ ]
418
+ },
419
+ "stepInputValue": {
420
+ "oneOf": [
421
+ {
422
+ "type": "object",
423
+ "additionalProperties": false,
424
+ "required": ["kind", "value"],
425
+ "properties": {
426
+ "kind": { "const": "literal" },
427
+ "value": { "type": ["string", "number", "boolean", "null"] }
428
+ }
429
+ },
430
+ {
431
+ "type": "object",
432
+ "additionalProperties": false,
433
+ "required": ["kind", "path"],
434
+ "properties": {
435
+ "kind": { "const": "reference" },
436
+ "path": { "type": "array", "items": { "type": "string" }, "minItems": 1 }
437
+ }
438
+ },
439
+ {
440
+ "type": "object",
441
+ "additionalProperties": false,
442
+ "required": ["kind", "template"],
443
+ "properties": {
444
+ "kind": { "const": "template" },
445
+ "template": { "type": "string" }
446
+ }
447
+ }
448
+ ]
449
+ },
450
+ "stepInput": {
451
+ "type": "object",
452
+ "additionalProperties": { "$ref": "#/$defs/stepInputValue" }
453
+ },
454
+ "step": {
455
+ "oneOf": [
456
+ {
457
+ "type": "object",
458
+ "additionalProperties": false,
459
+ "required": ["kind", "prompt", "model", "input", "as"],
460
+ "properties": {
461
+ "kind": { "const": "generate" },
462
+ "prompt": { "$ref": "#/$defs/identifier" },
463
+ "model": { "$ref": "#/$defs/identifier" },
464
+ "input": { "$ref": "#/$defs/stepInput" },
465
+ "as": { "$ref": "#/$defs/identifier" },
466
+ "context": { "$ref": "#/$defs/identifier" }
467
+ }
468
+ },
469
+ {
470
+ "type": "object",
471
+ "additionalProperties": false,
472
+ "required": ["kind", "retriever", "query", "as"],
473
+ "properties": {
474
+ "kind": { "const": "retrieve" },
475
+ "retriever": { "$ref": "#/$defs/identifier" },
476
+ "query": { "type": "string", "minLength": 1 },
477
+ "as": { "$ref": "#/$defs/identifier" }
478
+ }
479
+ },
480
+ {
481
+ "type": "object",
482
+ "additionalProperties": false,
483
+ "required": ["kind", "tool", "input", "as"],
484
+ "properties": {
485
+ "kind": { "const": "tool" },
486
+ "tool": { "$ref": "#/$defs/identifier" },
487
+ "input": { "$ref": "#/$defs/stepInput" },
488
+ "as": { "$ref": "#/$defs/identifier" }
489
+ }
490
+ },
491
+ {
492
+ "type": "object",
493
+ "additionalProperties": false,
494
+ "required": ["kind", "event"],
495
+ "properties": {
496
+ "kind": { "const": "emit" },
497
+ "event": { "type": "string", "minLength": 1 }
498
+ }
499
+ },
500
+ {
501
+ "type": "object",
502
+ "additionalProperties": false,
503
+ "description": "Authorization branching: runs one of two step lists. `when` reads the caller's Principal and never a context value, because the policy grammar has no operand for one.",
504
+ "required": ["kind", "when", "then", "else"],
505
+ "properties": {
506
+ "kind": { "const": "branch" },
507
+ "when": { "$ref": "#/$defs/policyExpr" },
508
+ "then": { "$ref": "#/$defs/stepList" },
509
+ "else": {
510
+ "type": "array",
511
+ "description": "Empty when the spec declared no alternative, so a false predicate runs nothing and the branch binds nothing.",
512
+ "items": { "$ref": "#/$defs/step" }
513
+ }
514
+ }
515
+ },
516
+ {
517
+ "type": "object",
518
+ "additionalProperties": false,
519
+ "description": "Runs every arm concurrently under the deployment's one cap and merges their bindings in branch order.",
520
+ "required": ["kind", "branches"],
521
+ "properties": {
522
+ "kind": { "const": "parallel" },
523
+ "branches": {
524
+ "type": "array",
525
+ "minItems": 1,
526
+ "maxItems": 16,
527
+ "items": { "$ref": "#/$defs/stepList" }
528
+ }
529
+ }
530
+ },
531
+ {
532
+ "type": "object",
533
+ "additionalProperties": false,
534
+ "description": "Applies one step to every item of a bound list and binds the ordered list of results.",
535
+ "required": ["kind", "over", "as", "step"],
536
+ "properties": {
537
+ "kind": { "const": "map" },
538
+ "over": { "$ref": "#/$defs/identifier" },
539
+ "as": { "$ref": "#/$defs/identifier" },
540
+ "step": { "$ref": "#/$defs/step" }
541
+ }
542
+ },
543
+ {
544
+ "type": "object",
545
+ "additionalProperties": false,
546
+ "description": "Applies one prompt to every item of a bound list and binds the ordered list of replies.",
547
+ "required": ["kind", "over", "prompt", "model", "as"],
548
+ "properties": {
549
+ "kind": { "const": "reduce" },
550
+ "over": { "$ref": "#/$defs/identifier" },
551
+ "prompt": { "$ref": "#/$defs/identifier" },
552
+ "model": { "$ref": "#/$defs/identifier" },
553
+ "as": { "$ref": "#/$defs/identifier" }
554
+ }
555
+ },
556
+ {
557
+ "type": "object",
558
+ "additionalProperties": false,
559
+ "description": "Reorders the retrieval result bound by `over` against `query`. A leaf: it nests no steps.",
560
+ "required": ["kind", "over", "query", "model", "topN", "as"],
561
+ "properties": {
562
+ "kind": { "const": "rerank" },
563
+ "over": { "$ref": "#/$defs/identifier" },
564
+ "query": { "type": "string", "minLength": 1 },
565
+ "model": {
566
+ "type": "string",
567
+ "minLength": 1,
568
+ "description": "Reranker alias matched by the runtime, not a models[] id, so it is looser than an identifier."
569
+ },
570
+ "topN": { "type": "integer", "minimum": 1 },
571
+ "as": { "$ref": "#/$defs/identifier" }
572
+ }
573
+ },
574
+ {
575
+ "type": "object",
576
+ "additionalProperties": false,
577
+ "description": "Runs one declared guardrail at one stage. Binds nothing: a `flag` is observability only.",
578
+ "required": ["kind", "guardrail", "stage", "text"],
579
+ "properties": {
580
+ "kind": { "const": "guard" },
581
+ "guardrail": { "$ref": "#/$defs/identifier" },
582
+ "stage": { "enum": ["input", "output", "retrieval", "tool-call"] },
583
+ "text": {
584
+ "type": "string",
585
+ "minLength": 1,
586
+ "description": "Template text at input/output; a single reference to a retrieval binding at retrieval."
587
+ }
588
+ }
589
+ },
590
+ {
591
+ "type": "object",
592
+ "additionalProperties": false,
593
+ "description": "Runs a declared agent to completion and binds its answer. A leaf: it opens no thread and resumes nothing.",
594
+ "required": ["kind", "agent", "text", "as"],
595
+ "properties": {
596
+ "kind": { "const": "agent" },
597
+ "agent": { "$ref": "#/$defs/identifier" },
598
+ "text": { "type": "string", "minLength": 1 },
599
+ "as": { "$ref": "#/$defs/identifier" }
600
+ }
601
+ }
602
+ ]
603
+ },
604
+ "stepList": {
605
+ "type": "array",
606
+ "description": "A step list nested inside a composite. Non-empty: an arm that runs nothing is one the author should delete, not a no-op to emit.",
607
+ "minItems": 1,
608
+ "items": { "$ref": "#/$defs/step" }
609
+ },
610
+ "errorPolicy": {
611
+ "type": "object",
612
+ "additionalProperties": false,
613
+ "required": ["retries"],
614
+ "properties": {
615
+ "retries": { "type": "integer", "minimum": 0 },
616
+ "fallback": { "type": "string" },
617
+ "deadLetter": { "type": "string" }
618
+ }
619
+ },
620
+ "observability": {
621
+ "type": "object",
622
+ "additionalProperties": false,
623
+ "required": ["trace", "redact"],
624
+ "properties": {
625
+ "trace": { "type": "boolean" },
626
+ "redact": { "type": "array", "items": { "type": "string" } }
627
+ }
628
+ },
629
+ "pipeline": {
630
+ "type": "object",
631
+ "additionalProperties": false,
632
+ "required": ["id", "identity", "trigger", "steps", "errorPolicy", "observability"],
633
+ "properties": {
634
+ "id": { "$ref": "#/$defs/identifier" },
635
+ "identity": { "type": "string", "pattern": "^pipeline:[a-z][a-z0-9_]{0,63}$" },
636
+ "description": { "type": "string" },
637
+ "trigger": { "$ref": "#/$defs/pipelineTrigger" },
638
+ "steps": { "type": "array", "items": { "$ref": "#/$defs/step" } },
639
+ "errorPolicy": { "$ref": "#/$defs/errorPolicy" },
640
+ "observability": { "$ref": "#/$defs/observability" }
641
+ }
642
+ },
643
+ "evalTarget": {
644
+ "type": "object",
645
+ "additionalProperties": false,
646
+ "required": ["kind", "id", "qualified", "valid"],
647
+ "properties": {
648
+ "kind": { "enum": ["pipeline", "prompt"] },
649
+ "id": { "type": "string" },
650
+ "qualified": { "type": "string" },
651
+ "valid": {
652
+ "type": "boolean",
653
+ "description": "False when `qualified` is not a `kind:id` pair with a known kind; the referential gate rejects those."
654
+ }
655
+ }
656
+ },
657
+ "evalDataset": {
658
+ "type": "object",
659
+ "additionalProperties": false,
660
+ "required": ["source"],
661
+ "properties": {
662
+ "source": { "enum": ["inline", "file", "synthetic"] },
663
+ "uri": { "type": "string" }
664
+ }
665
+ },
666
+ "predicate": {
667
+ "description": "A parsed PredicateExpr AST. Recursive and closed. There is no `invalid` arm: a build that cannot parse the predicate fails instead of emitting a node no evaluator could score.",
668
+ "oneOf": [
669
+ {
670
+ "type": "object",
671
+ "additionalProperties": false,
672
+ "required": ["kind", "path"],
673
+ "properties": {
674
+ "kind": { "const": "path" },
675
+ "path": { "enum": ["prediction", "case.id"] }
676
+ }
677
+ },
678
+ {
679
+ "type": "object",
680
+ "additionalProperties": false,
681
+ "required": ["kind", "path", "name"],
682
+ "properties": {
683
+ "kind": { "const": "path" },
684
+ "path": { "const": "case.metadata" },
685
+ "name": { "type": "string", "minLength": 1 }
686
+ }
687
+ },
688
+ {
689
+ "type": "object",
690
+ "additionalProperties": false,
691
+ "required": ["kind", "value"],
692
+ "properties": {
693
+ "kind": { "const": "string" },
694
+ "value": { "type": "string" }
695
+ }
696
+ },
697
+ {
698
+ "type": "object",
699
+ "additionalProperties": false,
700
+ "required": ["kind", "value"],
701
+ "properties": {
702
+ "kind": { "const": "number" },
703
+ "value": { "type": "number" }
704
+ }
705
+ },
706
+ {
707
+ "type": "object",
708
+ "additionalProperties": false,
709
+ "required": ["kind", "value"],
710
+ "properties": {
711
+ "kind": { "const": "boolean" },
712
+ "value": { "type": "boolean" }
713
+ }
714
+ },
715
+ {
716
+ "type": "object",
717
+ "additionalProperties": false,
718
+ "required": ["kind", "name", "args"],
719
+ "properties": {
720
+ "kind": { "const": "call" },
721
+ "name": { "enum": ["contains", "startswith", "endswith", "length"] },
722
+ "args": { "type": "array", "items": { "$ref": "#/$defs/predicate" } }
723
+ }
724
+ },
725
+ {
726
+ "type": "object",
727
+ "additionalProperties": false,
728
+ "required": ["kind", "op", "left", "right"],
729
+ "properties": {
730
+ "kind": { "const": "comparison" },
731
+ "op": { "enum": ["==", "!=", "<=", ">=", "<", ">"] },
732
+ "left": { "$ref": "#/$defs/predicate" },
733
+ "right": { "$ref": "#/$defs/predicate" }
734
+ }
735
+ },
736
+ {
737
+ "type": "object",
738
+ "additionalProperties": false,
739
+ "required": ["kind", "left", "right"],
740
+ "properties": {
741
+ "kind": { "enum": ["and", "or"] },
742
+ "left": { "$ref": "#/$defs/predicate" },
743
+ "right": { "$ref": "#/$defs/predicate" }
744
+ }
745
+ },
746
+ {
747
+ "type": "object",
748
+ "additionalProperties": false,
749
+ "required": ["kind", "operand"],
750
+ "properties": {
751
+ "kind": { "const": "not" },
752
+ "operand": { "$ref": "#/$defs/predicate" }
753
+ }
754
+ }
755
+ ]
756
+ },
757
+ "metric": {
758
+ "oneOf": [
759
+ {
760
+ "type": "object",
761
+ "additionalProperties": false,
762
+ "required": ["kind", "field"],
763
+ "properties": {
764
+ "kind": { "const": "exact" },
765
+ "field": { "type": "string" }
766
+ }
767
+ },
768
+ {
769
+ "type": "object",
770
+ "additionalProperties": false,
771
+ "required": ["kind", "field"],
772
+ "properties": {
773
+ "kind": { "const": "contains" },
774
+ "field": { "type": "string" },
775
+ "value": { "type": "string" }
776
+ }
777
+ },
778
+ {
779
+ "type": "object",
780
+ "additionalProperties": false,
781
+ "required": ["kind", "schema"],
782
+ "properties": {
783
+ "kind": { "const": "json-schema" },
784
+ "schema": { "$ref": "#/$defs/typeRef" }
785
+ }
786
+ },
787
+ {
788
+ "type": "object",
789
+ "additionalProperties": false,
790
+ "required": ["kind", "expect", "ordered"],
791
+ "properties": {
792
+ "kind": { "const": "tool-trace" },
793
+ "expect": { "type": "array", "items": { "type": "string" } },
794
+ "ordered": { "type": "boolean" }
795
+ }
796
+ },
797
+ {
798
+ "type": "object",
799
+ "additionalProperties": false,
800
+ "required": ["kind", "max"],
801
+ "properties": {
802
+ "kind": { "const": "cost" },
803
+ "max": { "type": "number", "minimum": 0 }
804
+ }
805
+ },
806
+ {
807
+ "type": "object",
808
+ "additionalProperties": false,
809
+ "required": ["kind", "maxMs"],
810
+ "properties": {
811
+ "kind": { "const": "latency" },
812
+ "maxMs": { "type": "number", "minimum": 0 }
813
+ }
814
+ },
815
+ {
816
+ "type": "object",
817
+ "additionalProperties": false,
818
+ "required": ["kind", "rubric"],
819
+ "properties": {
820
+ "kind": { "const": "llm-judge" },
821
+ "rubric": { "type": "string" },
822
+ "field": { "type": "string" },
823
+ "model": { "type": "string" },
824
+ "threshold": { "type": "number", "minimum": 0, "maximum": 1 }
825
+ }
826
+ },
827
+ {
828
+ "type": "object",
829
+ "additionalProperties": false,
830
+ "required": ["kind", "expectDocs", "k"],
831
+ "properties": {
832
+ "kind": { "const": "retrieval" },
833
+ "expectDocs": { "type": "array", "items": { "type": "string" } },
834
+ "k": { "type": "integer", "minimum": 1 }
835
+ }
836
+ },
837
+ {
838
+ "type": "object",
839
+ "additionalProperties": false,
840
+ "required": ["kind", "expr", "message"],
841
+ "properties": {
842
+ "kind": { "const": "assert" },
843
+ "expr": { "$ref": "#/$defs/predicate" },
844
+ "message": { "type": "string", "minLength": 1 }
845
+ }
846
+ }
847
+ ]
848
+ },
849
+ "evalGate": {
850
+ "type": "object",
851
+ "additionalProperties": false,
852
+ "required": ["ci", "maxRegression", "samples"],
853
+ "properties": {
854
+ "ci": { "type": "boolean" },
855
+ "maxRegression": { "type": "number", "minimum": 0 },
856
+ "samples": { "type": "integer", "minimum": 1 },
857
+ "minMean": {
858
+ "type": "number",
859
+ "minimum": 0,
860
+ "maximum": 1,
861
+ "description": "Absolute floor on the mean of every metric, checked before the maxRegression delta. An eval carrying an assert must declare 1.0, since a false assertion is not sampling noise."
862
+ }
863
+ }
864
+ },
865
+ "eval": {
866
+ "type": "object",
867
+ "additionalProperties": false,
868
+ "required": ["id", "target", "dataset", "metrics", "gate", "traits"],
869
+ "properties": {
870
+ "id": { "$ref": "#/$defs/identifier" },
871
+ "description": { "type": "string" },
872
+ "target": { "$ref": "#/$defs/evalTarget" },
873
+ "dataset": { "$ref": "#/$defs/evalDataset" },
874
+ "metrics": { "type": "array", "items": { "$ref": "#/$defs/metric" } },
875
+ "gate": { "$ref": "#/$defs/evalGate" },
876
+ "costBudget": { "type": "number", "minimum": 0 },
877
+ "latencyBudgetP95Ms": { "type": "number", "minimum": 0 },
878
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
879
+ }
880
+ },
881
+ "project": {
882
+ "type": "object",
883
+ "additionalProperties": false,
884
+ "required": ["name", "namespace", "targets"],
885
+ "properties": {
886
+ "name": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,63}$" },
887
+ "namespace": { "type": "string", "minLength": 1 },
888
+ "description": { "type": "string" },
889
+ "targets": { "type": "array", "items": { "type": "string" }, "minItems": 1 }
890
+ }
891
+ },
892
+ "runtime": {
893
+ "type": "object",
894
+ "additionalProperties": false,
895
+ "required": ["controlFlow"],
896
+ "properties": {
897
+ "controlFlow": { "const": "plain-async" },
898
+ "orchestration": { "type": "string" }
899
+ }
900
+ },
901
+ "retriever": {
902
+ "type": "object",
903
+ "additionalProperties": false,
904
+ "required": [
905
+ "id",
906
+ "source",
907
+ "chunking",
908
+ "embedModel",
909
+ "store",
910
+ "index",
911
+ "topK",
912
+ "refresh",
913
+ "traits"
914
+ ],
915
+ "properties": {
916
+ "id": { "$ref": "#/$defs/identifier" },
917
+ "source": {
918
+ "type": "object",
919
+ "additionalProperties": false,
920
+ "required": ["kind", "uri"],
921
+ "properties": {
922
+ "kind": { "enum": ["file", "s3", "http", "db", "mcp"] },
923
+ "uri": { "type": "string" },
924
+ "glob": { "type": "string" }
925
+ }
926
+ },
927
+ "chunking": {
928
+ "type": "object",
929
+ "additionalProperties": false,
930
+ "required": ["strategy", "size", "overlap", "keepMetadata"],
931
+ "properties": {
932
+ "strategy": { "enum": ["fixed", "recursive", "semantic", "code"] },
933
+ "size": { "type": "integer", "minimum": 1 },
934
+ "overlap": { "type": "integer", "minimum": 0 },
935
+ "keepMetadata": { "type": "array", "items": { "type": "string" } }
936
+ }
937
+ },
938
+ "embedModel": { "type": "string" },
939
+ "store": { "type": "string" },
940
+ "index": {
941
+ "type": "object",
942
+ "additionalProperties": false,
943
+ "required": ["metric", "hybrid"],
944
+ "properties": {
945
+ "metric": { "enum": ["cosine", "dot", "l2"] },
946
+ "hybrid": { "type": "boolean" },
947
+ "params": { "type": "object" }
948
+ }
949
+ },
950
+ "topK": { "type": "integer", "minimum": 1 },
951
+ "rerank": {
952
+ "type": "object",
953
+ "additionalProperties": false,
954
+ "required": ["model", "topN"],
955
+ "properties": {
956
+ "model": { "type": "string" },
957
+ "topN": { "type": "integer", "minimum": 1 }
958
+ }
959
+ },
960
+ "filters": { "type": "array", "items": { "type": "string" } },
961
+ "refresh": {
962
+ "type": "object",
963
+ "additionalProperties": false,
964
+ "required": ["mode"],
965
+ "properties": {
966
+ "mode": { "enum": ["full", "incremental"] },
967
+ "schedule": { "type": "string" }
968
+ }
969
+ },
970
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
971
+ }
972
+ },
973
+ "embedding": {
974
+ "type": "object",
975
+ "additionalProperties": false,
976
+ "required": ["id", "provider", "modelId", "traits"],
977
+ "properties": {
978
+ "id": { "$ref": "#/$defs/identifier" },
979
+ "provider": { "$ref": "#/$defs/provider" },
980
+ "modelId": { "type": "string" },
981
+ "dimensions": { "type": "integer", "minimum": 1 },
982
+ "costProfile": { "$ref": "#/$defs/costProfile" },
983
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
984
+ }
985
+ },
986
+ "vectorStore": {
987
+ "type": "object",
988
+ "additionalProperties": false,
989
+ "required": ["id", "kind", "traits"],
990
+ "properties": {
991
+ "id": { "$ref": "#/$defs/identifier" },
992
+ "kind": {
993
+ "enum": ["memory", "pgvector", "qdrant", "pinecone", "weaviate", "custom"]
994
+ },
995
+ "uri": { "type": "string" },
996
+ "dimensions": { "type": "integer", "minimum": 1 },
997
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
998
+ }
999
+ },
1000
+ "memory": {
1001
+ "type": "object",
1002
+ "additionalProperties": false,
1003
+ "required": ["id", "kind", "scope", "tokenBudget", "redact", "traits"],
1004
+ "properties": {
1005
+ "id": { "$ref": "#/$defs/identifier" },
1006
+ "kind": {
1007
+ "enum": ["buffer", "window", "summary", "semantic", "episodic", "vector"]
1008
+ },
1009
+ "scope": { "enum": ["thread", "user", "global"] },
1010
+ "tokenBudget": { "type": "integer", "minimum": 1 },
1011
+ "summarizeModel": { "type": "string" },
1012
+ "store": { "type": "string" },
1013
+ "backend": { "type": "string" },
1014
+ "ttl": { "type": "string" },
1015
+ "redact": { "type": "array", "items": { "type": "string" } },
1016
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
1017
+ }
1018
+ },
1019
+ "agent": {
1020
+ "type": "object",
1021
+ "additionalProperties": false,
1022
+ "required": [
1023
+ "id",
1024
+ "name",
1025
+ "instructions",
1026
+ "model",
1027
+ "tools",
1028
+ "retrievers",
1029
+ "memory",
1030
+ "guardrails",
1031
+ "maxSteps",
1032
+ "handoffs",
1033
+ "delegates",
1034
+ "engine",
1035
+ "traits"
1036
+ ],
1037
+ "properties": {
1038
+ "id": { "$ref": "#/$defs/identifier" },
1039
+ "name": { "type": "string" },
1040
+ "instructions": { "type": "string" },
1041
+ "model": { "type": "string" },
1042
+ "tools": { "type": "array", "items": { "type": "string" } },
1043
+ "retrievers": { "type": "array", "items": { "type": "string" } },
1044
+ "memory": { "type": "array", "items": { "type": "string" } },
1045
+ "guardrails": { "type": "array", "items": { "type": "string" } },
1046
+ "structuredOutput": { "$ref": "#/$defs/typeRef" },
1047
+ "maxSteps": { "type": "integer", "minimum": 1 },
1048
+ "maxTokensBudget": { "type": "integer", "minimum": 1 },
1049
+ "maxCostBudget": { "type": "number", "minimum": 0 },
1050
+ "onBudgetExhausted": { "enum": ["fail", "degrade"] },
1051
+ "handoffs": { "type": "array", "items": { "type": "string" } },
1052
+ "delegates": { "type": "array", "items": { "type": "string" } },
1053
+ "engine": { "enum": ["native", "deepagents"] },
1054
+ "engineVersion": { "type": "string" },
1055
+ "humanInTheLoop": {
1056
+ "type": "object",
1057
+ "additionalProperties": false,
1058
+ "required": ["when", "channel"],
1059
+ "properties": {
1060
+ "when": { "$ref": "#/$defs/policyExpr" },
1061
+ "channel": { "type": "string" }
1062
+ }
1063
+ },
1064
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
1065
+ }
1066
+ },
1067
+ "guardrail": {
1068
+ "type": "object",
1069
+ "additionalProperties": false,
1070
+ "required": ["id", "stages", "policies", "action", "redact", "tools", "onFail", "traits"],
1071
+ "properties": {
1072
+ "id": { "$ref": "#/$defs/identifier" },
1073
+ "stages": {
1074
+ "type": "array",
1075
+ "items": { "enum": ["input", "output", "retrieval", "tool-call"] }
1076
+ },
1077
+ "policies": {
1078
+ "type": "array",
1079
+ "items": {
1080
+ "enum": [
1081
+ "pii-detect",
1082
+ "pii-redact",
1083
+ "prompt-injection",
1084
+ "jailbreak",
1085
+ "moderation",
1086
+ "toxicity",
1087
+ "secret-scan"
1088
+ ]
1089
+ }
1090
+ },
1091
+ "action": { "enum": ["block", "redact", "flag", "escalate"] },
1092
+ "redact": { "type": "array", "items": { "type": "string" } },
1093
+ "tools": { "type": "array", "items": { "type": "string" } },
1094
+ "onFail": {
1095
+ "type": "object",
1096
+ "additionalProperties": false,
1097
+ "required": ["message", "log"],
1098
+ "properties": {
1099
+ "message": { "type": "string" },
1100
+ "fallbackPrompt": { "type": "string" },
1101
+ "log": { "type": "boolean" }
1102
+ }
1103
+ },
1104
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
1105
+ }
1106
+ },
1107
+ "deployment": {
1108
+ "type": "object",
1109
+ "additionalProperties": false,
1110
+ "required": ["id", "target", "streaming", "secrets", "env", "traits"],
1111
+ "properties": {
1112
+ "id": { "$ref": "#/$defs/identifier" },
1113
+ "target": { "enum": ["serverless", "container", "batch", "edge"] },
1114
+ "streaming": { "type": "boolean" },
1115
+ "concurrency": { "type": "integer", "minimum": 1 },
1116
+ "autoscale": {
1117
+ "type": "object",
1118
+ "additionalProperties": false,
1119
+ "required": ["min", "max", "metric"],
1120
+ "properties": {
1121
+ "min": { "type": "integer", "minimum": 0 },
1122
+ "max": { "type": "integer", "minimum": 1 },
1123
+ "metric": { "type": "string" }
1124
+ }
1125
+ },
1126
+ "secrets": { "type": "array", "items": { "type": "string" } },
1127
+ "env": {
1128
+ "type": "array",
1129
+ "items": {
1130
+ "type": "object",
1131
+ "additionalProperties": false,
1132
+ "required": ["name"],
1133
+ "properties": {
1134
+ "name": { "type": "string" },
1135
+ "value": { "type": "string" },
1136
+ "secret": { "type": "boolean" }
1137
+ }
1138
+ }
1139
+ },
1140
+ "traits": { "type": "array", "items": { "$ref": "#/$defs/trait" } }
1141
+ }
1142
+ }
1143
+ }
1144
+ }