@independo/inderun-contracts 0.1.0
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/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/generated/http-request.d.ts +34 -0
- package/dist/generated/http-request.d.ts.map +1 -0
- package/dist/generated/http-request.js +2 -0
- package/dist/generated/http-response.d.ts +25 -0
- package/dist/generated/http-response.d.ts.map +1 -0
- package/dist/generated/http-response.js +2 -0
- package/dist/generated/inderun-error.d.ts +45 -0
- package/dist/generated/inderun-error.d.ts.map +1 -0
- package/dist/generated/inderun-error.js +2 -0
- package/dist/generated/index.d.ts +10 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +2 -0
- package/dist/generated/route-plan.d.ts +59 -0
- package/dist/generated/route-plan.d.ts.map +1 -0
- package/dist/generated/route-plan.js +2 -0
- package/dist/generated/route-planner-input.d.ts +104 -0
- package/dist/generated/route-planner-input.d.ts.map +1 -0
- package/dist/generated/route-planner-input.js +2 -0
- package/dist/generated/schemas.d.ts +610 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +773 -0
- package/dist/generated/task-request.d.ts +171 -0
- package/dist/generated/task-request.d.ts.map +1 -0
- package/dist/generated/task-request.js +2 -0
- package/dist/generated/task-result.d.ts +96 -0
- package/dist/generated/task-result.d.ts.map +1 -0
- package/dist/generated/task-result.js +2 -0
- package/dist/generated/telemetry-event.d.ts +29 -0
- package/dist/generated/telemetry-event.d.ts.map +1 -0
- package/dist/generated/telemetry-event.js +2 -0
- package/dist/host.d.ts +111 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/validators.d.ts +30 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +158 -0
- package/package.json +33 -0
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
/* This file was generated from JSON Schema. Do not edit by hand. */
|
|
2
|
+
export const taskRequestSchema = {
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$id": "https://schemas.inderun.dev/1.0/task-request.schema.json",
|
|
5
|
+
"title": "TaskRequest",
|
|
6
|
+
"description": "The standard request payload for initiating a text-to-text execution task within the IndeRun framework.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": true,
|
|
9
|
+
"required": [
|
|
10
|
+
"schemaVersion",
|
|
11
|
+
"task"
|
|
12
|
+
],
|
|
13
|
+
"anyOf": [
|
|
14
|
+
{
|
|
15
|
+
"required": [
|
|
16
|
+
"prompt"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"required": [
|
|
21
|
+
"messages"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"properties": {
|
|
26
|
+
"schemaVersion": {
|
|
27
|
+
"description": "Contract schema version used to interpret the request payload.",
|
|
28
|
+
"const": "1.0"
|
|
29
|
+
},
|
|
30
|
+
"requestId": {
|
|
31
|
+
"description": "Optional identifier for tracking or correlating this specific execution attempt.",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1
|
|
34
|
+
},
|
|
35
|
+
"task": {
|
|
36
|
+
"description": "A descriptor specifying the type of work to be performed. For text-to-text, the kind must be 'text_to_text'.",
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": true,
|
|
39
|
+
"required": [
|
|
40
|
+
"kind"
|
|
41
|
+
],
|
|
42
|
+
"properties": {
|
|
43
|
+
"kind": {
|
|
44
|
+
"description": "The standard task category. Currently supports 'text_to_text' for prompt-based interactions.",
|
|
45
|
+
"const": "text_to_text"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"prompt": {
|
|
50
|
+
"description": "A simple, single-turn text prompt used to trigger a response from the AI model.",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"minLength": 1
|
|
53
|
+
},
|
|
54
|
+
"messages": {
|
|
55
|
+
"description": "A list of interaction messages for multi-turn conversation or chat-style execution.",
|
|
56
|
+
"type": "array",
|
|
57
|
+
"minItems": 1,
|
|
58
|
+
"items": {
|
|
59
|
+
"description": "An individual message in a conversation.",
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": true,
|
|
62
|
+
"required": [
|
|
63
|
+
"role",
|
|
64
|
+
"content"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"role": {
|
|
68
|
+
"description": "The role of the author (e.g., 'user', 'assistant').",
|
|
69
|
+
"enum": [
|
|
70
|
+
"system",
|
|
71
|
+
"user",
|
|
72
|
+
"assistant"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"content": {
|
|
76
|
+
"description": "The actual text content of the message.",
|
|
77
|
+
"type": "string",
|
|
78
|
+
"minLength": 1
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"generation": {
|
|
84
|
+
"description": "Optional configuration for fine-tuning how the AI model generates its response.",
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": true,
|
|
87
|
+
"properties": {
|
|
88
|
+
"maxOutputTokens": {
|
|
89
|
+
"description": "The maximum number of tokens to generate in a single response.",
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"minimum": 1
|
|
92
|
+
},
|
|
93
|
+
"temperature": {
|
|
94
|
+
"description": "Controls the randomness of the output. Range: 0 (most deterministic) to 2 (highest variance).",
|
|
95
|
+
"type": "number",
|
|
96
|
+
"minimum": 0,
|
|
97
|
+
"maximum": 2
|
|
98
|
+
},
|
|
99
|
+
"topP": {
|
|
100
|
+
"description": "Nucleus sampling parameter for controlling diversity vs focus in the output.",
|
|
101
|
+
"type": "number",
|
|
102
|
+
"minimum": 0,
|
|
103
|
+
"maximum": 1
|
|
104
|
+
},
|
|
105
|
+
"seed": {
|
|
106
|
+
"description": "A fixed seed for deterministic generation (where supported by the underlying provider).",
|
|
107
|
+
"type": "integer"
|
|
108
|
+
},
|
|
109
|
+
"stop": {
|
|
110
|
+
"description": "Sequence tokens that should terminate the generation process.",
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"constraints": {
|
|
119
|
+
"description": "Request-level routing constraints used by the planner.",
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": true,
|
|
122
|
+
"properties": {
|
|
123
|
+
"privacy": {
|
|
124
|
+
"description": "Privacy requirement or preference for execution placement.",
|
|
125
|
+
"enum": [
|
|
126
|
+
"local_required",
|
|
127
|
+
"local_preferred",
|
|
128
|
+
"cloud_allowed",
|
|
129
|
+
"cloud_required"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"cloud": {
|
|
133
|
+
"description": "Cloud execution constraint.",
|
|
134
|
+
"enum": [
|
|
135
|
+
"forbidden",
|
|
136
|
+
"allowed",
|
|
137
|
+
"required"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"timeoutMs": {
|
|
141
|
+
"description": "Optional routing timeout budget in milliseconds.",
|
|
142
|
+
"type": "integer",
|
|
143
|
+
"minimum": 1
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"preferences": {
|
|
148
|
+
"description": "Soft routing preferences used for deterministic provider ordering.",
|
|
149
|
+
"type": "object",
|
|
150
|
+
"additionalProperties": true,
|
|
151
|
+
"properties": {
|
|
152
|
+
"optimizeFor": {
|
|
153
|
+
"description": "Primary optimization goal when multiple providers remain eligible.",
|
|
154
|
+
"enum": [
|
|
155
|
+
"privacy",
|
|
156
|
+
"latency",
|
|
157
|
+
"cost",
|
|
158
|
+
"balanced"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"telemetry": {
|
|
164
|
+
"description": "Execution preferences for tracking usage and performance metrics.",
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": true,
|
|
167
|
+
"properties": {
|
|
168
|
+
"consent": {
|
|
169
|
+
"description": "Whether the user consents to telemetry collection for this specific request.",
|
|
170
|
+
"type": "boolean"
|
|
171
|
+
},
|
|
172
|
+
"level": {
|
|
173
|
+
"description": "The granularity of the collected metrics (off, minimal, or debug).",
|
|
174
|
+
"enum": [
|
|
175
|
+
"off",
|
|
176
|
+
"minimal",
|
|
177
|
+
"debug"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"tags": {
|
|
181
|
+
"description": "Optional key-value pairs for correlating telemetry data with specific features or users.",
|
|
182
|
+
"type": "object",
|
|
183
|
+
"additionalProperties": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"authContextRef": {
|
|
190
|
+
"description": "A unique identifier used to retrieve credentials from a secure local storage. Raw sensitive keys (API keys, etc.) should NEVER be placed directly in the request payload.",
|
|
191
|
+
"type": "string",
|
|
192
|
+
"minLength": 1
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
export const taskResultSchema = {
|
|
197
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
198
|
+
"$id": "https://schemas.inderun.dev/1.0/task-result.schema.json",
|
|
199
|
+
"title": "TaskResult",
|
|
200
|
+
"description": "The standard response payload for completed text-to-text execution within the IndeRun framework.",
|
|
201
|
+
"type": "object",
|
|
202
|
+
"additionalProperties": true,
|
|
203
|
+
"required": [
|
|
204
|
+
"schemaVersion",
|
|
205
|
+
"runId",
|
|
206
|
+
"output",
|
|
207
|
+
"finishReason",
|
|
208
|
+
"telemetry"
|
|
209
|
+
],
|
|
210
|
+
"properties": {
|
|
211
|
+
"schemaVersion": {
|
|
212
|
+
"description": "Contract schema version used to interpret the result payload.",
|
|
213
|
+
"const": "1.0"
|
|
214
|
+
},
|
|
215
|
+
"runId": {
|
|
216
|
+
"description": "A unique, opaque identifier assigned by the engine for this specific execution attempt.",
|
|
217
|
+
"type": "string",
|
|
218
|
+
"minLength": 1
|
|
219
|
+
},
|
|
220
|
+
"output": {
|
|
221
|
+
"description": "The normalized content returned from the selected provider.",
|
|
222
|
+
"type": "object",
|
|
223
|
+
"additionalProperties": true,
|
|
224
|
+
"required": [
|
|
225
|
+
"type",
|
|
226
|
+
"text"
|
|
227
|
+
],
|
|
228
|
+
"properties": {
|
|
229
|
+
"type": {
|
|
230
|
+
"description": "Output payload category (e.g., 'text' for Mode 1 text-to-text).",
|
|
231
|
+
"const": "text"
|
|
232
|
+
},
|
|
233
|
+
"text": {
|
|
234
|
+
"description": "The actual text generated by the execution.",
|
|
235
|
+
"type": "string"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"finishReason": {
|
|
240
|
+
"description": "Standardized reason describing how generation concluded (e.g., 'stop', 'length', 'cancelled', or 'error').",
|
|
241
|
+
"enum": [
|
|
242
|
+
"stop",
|
|
243
|
+
"length",
|
|
244
|
+
"cancelled",
|
|
245
|
+
"error"
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
"usage": {
|
|
249
|
+
"description": "Optional metadata regarding the quantity of tokens processed by the provider.",
|
|
250
|
+
"type": "object",
|
|
251
|
+
"additionalProperties": true,
|
|
252
|
+
"properties": {
|
|
253
|
+
"inputTokens": {
|
|
254
|
+
"description": "Number of input tokens consumed, as reported by the provider.",
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"minimum": 0
|
|
257
|
+
},
|
|
258
|
+
"outputTokens": {
|
|
259
|
+
"description": "Number of output tokens generated, as reported by the provider.",
|
|
260
|
+
"type": "integer",
|
|
261
|
+
"minimum": 0
|
|
262
|
+
},
|
|
263
|
+
"totalTokens": {
|
|
264
|
+
"description": "Aggregated token count for this request, as reported by the provider.",
|
|
265
|
+
"type": "integer",
|
|
266
|
+
"minimum": 0
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"telemetry": {
|
|
271
|
+
"description": "Required metadata providing an overview of the execution result and performance metrics.",
|
|
272
|
+
"type": "object",
|
|
273
|
+
"additionalProperties": true,
|
|
274
|
+
"required": [
|
|
275
|
+
"providerUsed",
|
|
276
|
+
"totalMs"
|
|
277
|
+
],
|
|
278
|
+
"properties": {
|
|
279
|
+
"providerUsed": {
|
|
280
|
+
"description": "The identifier for the specific provider that handled the request (e.g., 'openai_compatible_cloud').",
|
|
281
|
+
"type": "string",
|
|
282
|
+
"minLength": 1
|
|
283
|
+
},
|
|
284
|
+
"totalMs": {
|
|
285
|
+
"description": "Measured execution duration in milliseconds, including route selection and result processing.",
|
|
286
|
+
"type": "number",
|
|
287
|
+
"minimum": 0
|
|
288
|
+
},
|
|
289
|
+
"errorClass": {
|
|
290
|
+
"description": "Included if the request resulted in a provider-level error (e.g., 'CapabilityMismatch' or 'Unavailable').",
|
|
291
|
+
"enum": [
|
|
292
|
+
"CapabilityMismatch",
|
|
293
|
+
"Offline",
|
|
294
|
+
"AuthError",
|
|
295
|
+
"RateLimited",
|
|
296
|
+
"Timeout",
|
|
297
|
+
"Unavailable",
|
|
298
|
+
"Internal"
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
export const inderunErrorSchema = {
|
|
306
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
307
|
+
"$id": "https://schemas.inderun.dev/1.0/inderun-error.schema.json",
|
|
308
|
+
"title": "IndeRunError",
|
|
309
|
+
"description": "Normalized Milestone-1 error contract.",
|
|
310
|
+
"type": "object",
|
|
311
|
+
"additionalProperties": true,
|
|
312
|
+
"required": [
|
|
313
|
+
"schemaVersion",
|
|
314
|
+
"errorClass",
|
|
315
|
+
"message"
|
|
316
|
+
],
|
|
317
|
+
"properties": {
|
|
318
|
+
"schemaVersion": {
|
|
319
|
+
"description": "Contract schema version used to interpret the error payload.",
|
|
320
|
+
"const": "1.0"
|
|
321
|
+
},
|
|
322
|
+
"errorClass": {
|
|
323
|
+
"description": "Normalized error taxonomy class.",
|
|
324
|
+
"enum": [
|
|
325
|
+
"CapabilityMismatch",
|
|
326
|
+
"Offline",
|
|
327
|
+
"AuthError",
|
|
328
|
+
"RateLimited",
|
|
329
|
+
"Timeout",
|
|
330
|
+
"Unavailable",
|
|
331
|
+
"Internal"
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
"message": {
|
|
335
|
+
"description": "Human-readable error message suitable for logs and developer diagnostics.",
|
|
336
|
+
"type": "string",
|
|
337
|
+
"minLength": 1
|
|
338
|
+
},
|
|
339
|
+
"runId": {
|
|
340
|
+
"description": "Opaque run identifier associated with the failed execution, if available.",
|
|
341
|
+
"type": "string",
|
|
342
|
+
"minLength": 1
|
|
343
|
+
},
|
|
344
|
+
"providerId": {
|
|
345
|
+
"description": "Identifier of the provider associated with the failure, if execution reached a provider.",
|
|
346
|
+
"type": "string",
|
|
347
|
+
"minLength": 1
|
|
348
|
+
},
|
|
349
|
+
"retryable": {
|
|
350
|
+
"description": "Whether retrying the same request may succeed.",
|
|
351
|
+
"type": "boolean"
|
|
352
|
+
},
|
|
353
|
+
"retryAfterMs": {
|
|
354
|
+
"description": "Optional suggested delay before retrying, in milliseconds.",
|
|
355
|
+
"type": "integer",
|
|
356
|
+
"minimum": 0
|
|
357
|
+
},
|
|
358
|
+
"details": {
|
|
359
|
+
"description": "Optional structured diagnostic details. It must not contain raw secrets.",
|
|
360
|
+
"type": "object",
|
|
361
|
+
"additionalProperties": true
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
export const httpRequestSchema = {
|
|
366
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
367
|
+
"$id": "https://schemas.inderun.dev/1.0/http-request.schema.json",
|
|
368
|
+
"title": "HttpRequest",
|
|
369
|
+
"description": "Normalized HTTP request payload for host-provided cloud transport.",
|
|
370
|
+
"type": "object",
|
|
371
|
+
"additionalProperties": true,
|
|
372
|
+
"required": [
|
|
373
|
+
"method",
|
|
374
|
+
"url"
|
|
375
|
+
],
|
|
376
|
+
"properties": {
|
|
377
|
+
"method": {
|
|
378
|
+
"description": "HTTP method to use for the request.",
|
|
379
|
+
"enum": [
|
|
380
|
+
"GET",
|
|
381
|
+
"POST",
|
|
382
|
+
"PUT",
|
|
383
|
+
"DELETE",
|
|
384
|
+
"PATCH"
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
"url": {
|
|
388
|
+
"description": "Absolute target URL for the provider transport request.",
|
|
389
|
+
"type": "string",
|
|
390
|
+
"minLength": 1
|
|
391
|
+
},
|
|
392
|
+
"headers": {
|
|
393
|
+
"description": "HTTP headers to send after the provider adapter has applied any required transport-level credentials.",
|
|
394
|
+
"type": "object",
|
|
395
|
+
"additionalProperties": {
|
|
396
|
+
"type": "string"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
"body": {
|
|
400
|
+
"description": "Optional serialized request body. For JSON APIs this should be a JSON string.",
|
|
401
|
+
"type": "string"
|
|
402
|
+
},
|
|
403
|
+
"timeoutMs": {
|
|
404
|
+
"description": "Optional maximum duration for the host transport attempt in milliseconds.",
|
|
405
|
+
"type": "integer",
|
|
406
|
+
"minimum": 1
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
export const httpResponseSchema = {
|
|
411
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
412
|
+
"$id": "https://schemas.inderun.dev/1.0/http-response.schema.json",
|
|
413
|
+
"title": "HttpResponse",
|
|
414
|
+
"description": "Normalized HTTP response payload returned by host-provided cloud transport.",
|
|
415
|
+
"type": "object",
|
|
416
|
+
"additionalProperties": true,
|
|
417
|
+
"required": [
|
|
418
|
+
"status",
|
|
419
|
+
"statusText",
|
|
420
|
+
"headers",
|
|
421
|
+
"body"
|
|
422
|
+
],
|
|
423
|
+
"properties": {
|
|
424
|
+
"status": {
|
|
425
|
+
"description": "HTTP status code returned by the provider transport.",
|
|
426
|
+
"type": "integer",
|
|
427
|
+
"minimum": 100,
|
|
428
|
+
"maximum": 599
|
|
429
|
+
},
|
|
430
|
+
"statusText": {
|
|
431
|
+
"description": "HTTP status text returned by the provider transport.",
|
|
432
|
+
"type": "string"
|
|
433
|
+
},
|
|
434
|
+
"headers": {
|
|
435
|
+
"description": "HTTP response headers normalized to string key-value pairs.",
|
|
436
|
+
"type": "object",
|
|
437
|
+
"additionalProperties": {
|
|
438
|
+
"type": "string"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"body": {
|
|
442
|
+
"description": "Serialized response body returned by the provider transport.",
|
|
443
|
+
"type": "string"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
export const telemetryEventSchema = {
|
|
448
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
449
|
+
"$id": "https://schemas.inderun.dev/1.0/telemetry-event.schema.json",
|
|
450
|
+
"title": "TelemetryEvent",
|
|
451
|
+
"description": "Normalized telemetry event emitted by the orchestrator and providers.",
|
|
452
|
+
"type": "object",
|
|
453
|
+
"additionalProperties": true,
|
|
454
|
+
"required": [
|
|
455
|
+
"type",
|
|
456
|
+
"runId",
|
|
457
|
+
"timestamp",
|
|
458
|
+
"payload"
|
|
459
|
+
],
|
|
460
|
+
"properties": {
|
|
461
|
+
"type": {
|
|
462
|
+
"description": "Telemetry event kind emitted by the orchestrator or provider integration.",
|
|
463
|
+
"enum": [
|
|
464
|
+
"route_decided",
|
|
465
|
+
"attempt_succeeded",
|
|
466
|
+
"attempt_failed"
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
"runId": {
|
|
470
|
+
"description": "Opaque run identifier associated with this execution event.",
|
|
471
|
+
"type": "string",
|
|
472
|
+
"minLength": 1
|
|
473
|
+
},
|
|
474
|
+
"timestamp": {
|
|
475
|
+
"description": "Wall-clock event timestamp in Unix epoch milliseconds.",
|
|
476
|
+
"type": "number",
|
|
477
|
+
"minimum": 0
|
|
478
|
+
},
|
|
479
|
+
"payload": {
|
|
480
|
+
"description": "Event-specific metadata. It must not contain prompt payloads or raw secrets.",
|
|
481
|
+
"type": "object",
|
|
482
|
+
"additionalProperties": true
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
export const routePlannerInputSchema = {
|
|
487
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
488
|
+
"$id": "https://schemas.inderun.dev/1.0/route-planner-input.schema.json",
|
|
489
|
+
"title": "RoutePlannerInput",
|
|
490
|
+
"description": "Pure data input contract for deterministic shared-core Mode-1 route planning.",
|
|
491
|
+
"type": "object",
|
|
492
|
+
"additionalProperties": true,
|
|
493
|
+
"required": [
|
|
494
|
+
"task",
|
|
495
|
+
"constraints",
|
|
496
|
+
"preferences",
|
|
497
|
+
"providers"
|
|
498
|
+
],
|
|
499
|
+
"properties": {
|
|
500
|
+
"task": {
|
|
501
|
+
"description": "Minimal task descriptor for provider task matching.",
|
|
502
|
+
"type": "object",
|
|
503
|
+
"additionalProperties": true,
|
|
504
|
+
"required": [
|
|
505
|
+
"kind"
|
|
506
|
+
],
|
|
507
|
+
"properties": {
|
|
508
|
+
"kind": {
|
|
509
|
+
"type": "string",
|
|
510
|
+
"minLength": 1
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
"constraints": {
|
|
515
|
+
"description": "Hard routing constraints evaluated before provider selection.",
|
|
516
|
+
"type": "object",
|
|
517
|
+
"additionalProperties": true,
|
|
518
|
+
"properties": {
|
|
519
|
+
"privacy": {
|
|
520
|
+
"description": "Privacy requirement or preference for execution placement.",
|
|
521
|
+
"enum": [
|
|
522
|
+
"local_required",
|
|
523
|
+
"local_preferred",
|
|
524
|
+
"cloud_allowed",
|
|
525
|
+
"cloud_required"
|
|
526
|
+
]
|
|
527
|
+
},
|
|
528
|
+
"cloud": {
|
|
529
|
+
"description": "Cloud execution constraint.",
|
|
530
|
+
"enum": [
|
|
531
|
+
"forbidden",
|
|
532
|
+
"allowed",
|
|
533
|
+
"required"
|
|
534
|
+
]
|
|
535
|
+
},
|
|
536
|
+
"networkOnline": {
|
|
537
|
+
"description": "Current connectivity snapshot used for cloud route planning.",
|
|
538
|
+
"type": "boolean"
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
"preferences": {
|
|
543
|
+
"description": "Soft route ordering preferences applied after hard filtering.",
|
|
544
|
+
"type": "object",
|
|
545
|
+
"additionalProperties": true,
|
|
546
|
+
"properties": {
|
|
547
|
+
"optimizeFor": {
|
|
548
|
+
"description": "Primary optimization goal when multiple providers remain eligible.",
|
|
549
|
+
"enum": [
|
|
550
|
+
"privacy",
|
|
551
|
+
"latency",
|
|
552
|
+
"cost",
|
|
553
|
+
"balanced"
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
"providers": {
|
|
559
|
+
"description": "Static descriptors plus dynamic capability snapshots for planning.",
|
|
560
|
+
"type": "array",
|
|
561
|
+
"items": {
|
|
562
|
+
"type": "object",
|
|
563
|
+
"additionalProperties": true,
|
|
564
|
+
"required": [
|
|
565
|
+
"descriptor",
|
|
566
|
+
"capabilities"
|
|
567
|
+
],
|
|
568
|
+
"properties": {
|
|
569
|
+
"descriptor": {
|
|
570
|
+
"type": "object",
|
|
571
|
+
"additionalProperties": true,
|
|
572
|
+
"required": [
|
|
573
|
+
"id",
|
|
574
|
+
"type",
|
|
575
|
+
"supports",
|
|
576
|
+
"tasks"
|
|
577
|
+
],
|
|
578
|
+
"properties": {
|
|
579
|
+
"id": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"minLength": 1
|
|
582
|
+
},
|
|
583
|
+
"type": {
|
|
584
|
+
"enum": [
|
|
585
|
+
"local",
|
|
586
|
+
"edge",
|
|
587
|
+
"cloud"
|
|
588
|
+
]
|
|
589
|
+
},
|
|
590
|
+
"supports": {
|
|
591
|
+
"type": "object",
|
|
592
|
+
"additionalProperties": true,
|
|
593
|
+
"required": [
|
|
594
|
+
"run"
|
|
595
|
+
],
|
|
596
|
+
"properties": {
|
|
597
|
+
"run": {
|
|
598
|
+
"type": "boolean"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"tasks": {
|
|
603
|
+
"type": "array",
|
|
604
|
+
"items": {
|
|
605
|
+
"type": "string",
|
|
606
|
+
"minLength": 1
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
"privacy": {
|
|
610
|
+
"description": "Descriptor privacy metadata used to enforce local/cloud routing rules.",
|
|
611
|
+
"type": "object",
|
|
612
|
+
"additionalProperties": true,
|
|
613
|
+
"required": [
|
|
614
|
+
"dataLeavesDevice"
|
|
615
|
+
],
|
|
616
|
+
"properties": {
|
|
617
|
+
"dataLeavesDevice": {
|
|
618
|
+
"type": "boolean"
|
|
619
|
+
},
|
|
620
|
+
"regions": {
|
|
621
|
+
"type": "array",
|
|
622
|
+
"items": {
|
|
623
|
+
"type": "string",
|
|
624
|
+
"minLength": 1
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
"capabilities": {
|
|
632
|
+
"type": "object",
|
|
633
|
+
"additionalProperties": true,
|
|
634
|
+
"required": [
|
|
635
|
+
"available"
|
|
636
|
+
],
|
|
637
|
+
"properties": {
|
|
638
|
+
"available": {
|
|
639
|
+
"type": "boolean"
|
|
640
|
+
},
|
|
641
|
+
"reason": {
|
|
642
|
+
"type": "string",
|
|
643
|
+
"minLength": 1
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
export const routePlanSchema = {
|
|
653
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
654
|
+
"$id": "https://schemas.inderun.dev/1.0/route-plan.schema.json",
|
|
655
|
+
"title": "RoutePlan",
|
|
656
|
+
"description": "Deterministic shared-core Mode-1 route planning result.",
|
|
657
|
+
"type": "object",
|
|
658
|
+
"additionalProperties": true,
|
|
659
|
+
"required": [
|
|
660
|
+
"fallbackProviderIds",
|
|
661
|
+
"candidates",
|
|
662
|
+
"rejectedProviders",
|
|
663
|
+
"explanation"
|
|
664
|
+
],
|
|
665
|
+
"properties": {
|
|
666
|
+
"selectedProviderId": {
|
|
667
|
+
"description": "Chosen primary provider ID, if any.",
|
|
668
|
+
"type": "string",
|
|
669
|
+
"minLength": 1
|
|
670
|
+
},
|
|
671
|
+
"fallbackProviderIds": {
|
|
672
|
+
"description": "Fallback provider IDs ordered after the primary selection.",
|
|
673
|
+
"type": "array",
|
|
674
|
+
"items": {
|
|
675
|
+
"type": "string",
|
|
676
|
+
"minLength": 1
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
"candidates": {
|
|
680
|
+
"description": "Eligible candidates in deterministic order.",
|
|
681
|
+
"type": "array",
|
|
682
|
+
"items": {
|
|
683
|
+
"type": "object",
|
|
684
|
+
"additionalProperties": true,
|
|
685
|
+
"required": [
|
|
686
|
+
"providerId",
|
|
687
|
+
"order"
|
|
688
|
+
],
|
|
689
|
+
"properties": {
|
|
690
|
+
"providerId": {
|
|
691
|
+
"type": "string",
|
|
692
|
+
"minLength": 1
|
|
693
|
+
},
|
|
694
|
+
"order": {
|
|
695
|
+
"type": "integer",
|
|
696
|
+
"minimum": 0
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
"rejectedProviders": {
|
|
702
|
+
"description": "Providers filtered out during planning together with machine-readable reasons.",
|
|
703
|
+
"type": "array",
|
|
704
|
+
"items": {
|
|
705
|
+
"type": "object",
|
|
706
|
+
"additionalProperties": true,
|
|
707
|
+
"required": [
|
|
708
|
+
"providerId",
|
|
709
|
+
"reasons"
|
|
710
|
+
],
|
|
711
|
+
"properties": {
|
|
712
|
+
"providerId": {
|
|
713
|
+
"type": "string",
|
|
714
|
+
"minLength": 1
|
|
715
|
+
},
|
|
716
|
+
"reasons": {
|
|
717
|
+
"type": "array",
|
|
718
|
+
"items": {
|
|
719
|
+
"type": "object",
|
|
720
|
+
"additionalProperties": true,
|
|
721
|
+
"required": [
|
|
722
|
+
"code",
|
|
723
|
+
"message"
|
|
724
|
+
],
|
|
725
|
+
"properties": {
|
|
726
|
+
"code": {
|
|
727
|
+
"enum": [
|
|
728
|
+
"task_not_supported",
|
|
729
|
+
"run_not_supported",
|
|
730
|
+
"privacy_constraint",
|
|
731
|
+
"cloud_constraint",
|
|
732
|
+
"offline",
|
|
733
|
+
"capability_unavailable"
|
|
734
|
+
]
|
|
735
|
+
},
|
|
736
|
+
"message": {
|
|
737
|
+
"type": "string",
|
|
738
|
+
"minLength": 1
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
"failureCode": {
|
|
747
|
+
"description": "Normalized routing failure class when no provider is selected.",
|
|
748
|
+
"enum": [
|
|
749
|
+
"capability_mismatch",
|
|
750
|
+
"offline",
|
|
751
|
+
"unavailable"
|
|
752
|
+
]
|
|
753
|
+
},
|
|
754
|
+
"explanation": {
|
|
755
|
+
"description": "Human-readable selection or failure explanation suitable for telemetry/debugging.",
|
|
756
|
+
"type": "object",
|
|
757
|
+
"additionalProperties": true,
|
|
758
|
+
"required": [
|
|
759
|
+
"summary"
|
|
760
|
+
],
|
|
761
|
+
"properties": {
|
|
762
|
+
"summary": {
|
|
763
|
+
"type": "string",
|
|
764
|
+
"minLength": 1
|
|
765
|
+
},
|
|
766
|
+
"selectedProviderId": {
|
|
767
|
+
"type": "string",
|
|
768
|
+
"minLength": 1
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
};
|