@openclaw/lobster 2026.11.3 → 2026.11.5-beta.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 (89) hide show
  1. package/README.md +8 -0
  2. package/dist/.setup/lobster-schema-compiler-Dxya_m9g.mjs +33 -0
  3. package/dist/.source-module-urls/00dc8c474cfa3e6e755374b6a78ce42a8dcd5a5a37a90df29d7baaef767292a6.json +1 -0
  4. package/dist/index.js +17 -11
  5. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/llm_invoke.js +1 -82
  6. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/llm_invoke_schemas.js +79 -0
  7. package/node_modules/@clawdbot/lobster/dist/src/commands/stdlib/llm_invoke_validators.generated.js +1008 -0
  8. package/node_modules/@clawdbot/lobster/dist/src/core/index.js +1 -1
  9. package/node_modules/@clawdbot/lobster/dist/src/validation.js +25 -4
  10. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  11. package/node_modules/typebox/build/format/duration.mjs +2 -2
  12. package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
  13. package/node_modules/typebox/build/format/idn_email.mjs +1 -0
  14. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  15. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  16. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  17. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  18. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  19. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  20. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  21. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  22. package/node_modules/typebox/build/schema/build.mjs +1 -0
  23. package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
  24. package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
  25. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  26. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
  27. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
  28. package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
  29. package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
  30. package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
  31. package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
  32. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
  33. package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
  34. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  35. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
  36. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
  37. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  38. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  39. package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
  40. package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
  41. package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
  42. package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
  43. package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
  44. package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
  45. package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
  46. package/node_modules/typebox/build/system/memory/create.mjs +18 -13
  47. package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
  48. package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
  49. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  50. package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
  51. package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
  52. package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
  53. package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
  54. package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
  55. package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
  56. package/node_modules/typebox/build/system/memory/update.mjs +43 -16
  57. package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
  58. package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
  59. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
  60. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
  61. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
  62. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
  63. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
  64. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
  65. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
  66. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
  67. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
  68. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
  69. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  70. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  71. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  72. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  73. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
  74. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
  75. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
  76. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
  77. package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
  78. package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
  79. package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
  80. package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
  81. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
  82. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
  83. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
  84. package/node_modules/typebox/package.json +1 -1
  85. package/node_modules/typebox/readme.md +1 -1
  86. package/package.json +5 -5
  87. package/node_modules/@clawdbot/lobster/dist/src/workflows/types.js +0 -2
  88. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  89. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
@@ -0,0 +1,1008 @@
1
+ // Generated by pnpm lobster:validators:gen. Do not edit.
2
+ // Ajv 8.20.0 standalone validators.
3
+ // Unicode-length helper SHA-256: 5c6046751d39c9fa014b557a89c28c56fc190aa659892bd8bdb74a8fc64e59c4
4
+ "use strict";
5
+ export const validatePayload = validate10;
6
+ const schema11 = {
7
+ type: "object",
8
+ properties: {
9
+ prompt: { type: "string", minLength: 1 },
10
+ model: { type: "string", minLength: 1 },
11
+ artifacts: {
12
+ type: "array",
13
+ items: {
14
+ type: "object",
15
+ properties: {
16
+ kind: { type: "string" },
17
+ role: { type: "string" },
18
+ name: { type: "string" },
19
+ mimeType: { type: "string" },
20
+ text: { type: "string" },
21
+ data: {},
22
+ uri: { type: "string" },
23
+ },
24
+ additionalProperties: true,
25
+ },
26
+ },
27
+ artifactHashes: { type: "array", items: { type: "string", minLength: 10 } },
28
+ schemaVersion: { type: "string" },
29
+ metadata: { type: "object", additionalProperties: true },
30
+ outputSchema: { type: "object", additionalProperties: true },
31
+ temperature: { type: "number" },
32
+ maxOutputTokens: { type: "number" },
33
+ retryContext: {
34
+ type: "object",
35
+ properties: {
36
+ attempt: { type: "number" },
37
+ validationErrors: { type: "array", items: { type: "string" } },
38
+ },
39
+ additionalProperties: false,
40
+ },
41
+ },
42
+ required: ["prompt", "artifacts", "artifactHashes"],
43
+ additionalProperties: false,
44
+ };
45
+ const func2 = Object.prototype.hasOwnProperty;
46
+ const func3 = function ucs2length(str) {
47
+ const len = str.length;
48
+ let length = 0;
49
+ let pos = 0;
50
+ let value;
51
+ while (pos < len) {
52
+ length++;
53
+ value = str.charCodeAt(pos++);
54
+ if (value >= 0xd800 && value <= 0xdbff && pos < len) {
55
+ // high surrogate, and there is a next character
56
+ value = str.charCodeAt(pos);
57
+ if ((value & 0xfc00) === 0xdc00) pos++; // low surrogate
58
+ }
59
+ }
60
+ return length;
61
+ };
62
+
63
+ function validate10(
64
+ data,
65
+ { instancePath = "", parentData, parentDataProperty, rootData = data } = {},
66
+ ) {
67
+ let vErrors = null;
68
+ let errors = 0;
69
+ if (data && typeof data == "object" && !Array.isArray(data)) {
70
+ if (data.prompt === undefined) {
71
+ const err0 = {
72
+ instancePath,
73
+ schemaPath: "#/required",
74
+ keyword: "required",
75
+ params: { missingProperty: "prompt" },
76
+ message: "must have required property '" + "prompt" + "'",
77
+ };
78
+ if (vErrors === null) {
79
+ vErrors = [err0];
80
+ } else {
81
+ vErrors.push(err0);
82
+ }
83
+ errors++;
84
+ }
85
+ if (data.artifacts === undefined) {
86
+ const err1 = {
87
+ instancePath,
88
+ schemaPath: "#/required",
89
+ keyword: "required",
90
+ params: { missingProperty: "artifacts" },
91
+ message: "must have required property '" + "artifacts" + "'",
92
+ };
93
+ if (vErrors === null) {
94
+ vErrors = [err1];
95
+ } else {
96
+ vErrors.push(err1);
97
+ }
98
+ errors++;
99
+ }
100
+ if (data.artifactHashes === undefined) {
101
+ const err2 = {
102
+ instancePath,
103
+ schemaPath: "#/required",
104
+ keyword: "required",
105
+ params: { missingProperty: "artifactHashes" },
106
+ message: "must have required property '" + "artifactHashes" + "'",
107
+ };
108
+ if (vErrors === null) {
109
+ vErrors = [err2];
110
+ } else {
111
+ vErrors.push(err2);
112
+ }
113
+ errors++;
114
+ }
115
+ for (const key0 in data) {
116
+ if (!func2.call(schema11.properties, key0)) {
117
+ const err3 = {
118
+ instancePath,
119
+ schemaPath: "#/additionalProperties",
120
+ keyword: "additionalProperties",
121
+ params: { additionalProperty: key0 },
122
+ message: "must NOT have additional properties",
123
+ };
124
+ if (vErrors === null) {
125
+ vErrors = [err3];
126
+ } else {
127
+ vErrors.push(err3);
128
+ }
129
+ errors++;
130
+ }
131
+ }
132
+ if (data.prompt !== undefined) {
133
+ let data0 = data.prompt;
134
+ if (typeof data0 === "string") {
135
+ if (func3(data0) < 1) {
136
+ const err4 = {
137
+ instancePath: instancePath + "/prompt",
138
+ schemaPath: "#/properties/prompt/minLength",
139
+ keyword: "minLength",
140
+ params: { limit: 1 },
141
+ message: "must NOT have fewer than 1 characters",
142
+ };
143
+ if (vErrors === null) {
144
+ vErrors = [err4];
145
+ } else {
146
+ vErrors.push(err4);
147
+ }
148
+ errors++;
149
+ }
150
+ } else {
151
+ const err5 = {
152
+ instancePath: instancePath + "/prompt",
153
+ schemaPath: "#/properties/prompt/type",
154
+ keyword: "type",
155
+ params: { type: "string" },
156
+ message: "must be string",
157
+ };
158
+ if (vErrors === null) {
159
+ vErrors = [err5];
160
+ } else {
161
+ vErrors.push(err5);
162
+ }
163
+ errors++;
164
+ }
165
+ }
166
+ if (data.model !== undefined) {
167
+ let data1 = data.model;
168
+ if (typeof data1 === "string") {
169
+ if (func3(data1) < 1) {
170
+ const err6 = {
171
+ instancePath: instancePath + "/model",
172
+ schemaPath: "#/properties/model/minLength",
173
+ keyword: "minLength",
174
+ params: { limit: 1 },
175
+ message: "must NOT have fewer than 1 characters",
176
+ };
177
+ if (vErrors === null) {
178
+ vErrors = [err6];
179
+ } else {
180
+ vErrors.push(err6);
181
+ }
182
+ errors++;
183
+ }
184
+ } else {
185
+ const err7 = {
186
+ instancePath: instancePath + "/model",
187
+ schemaPath: "#/properties/model/type",
188
+ keyword: "type",
189
+ params: { type: "string" },
190
+ message: "must be string",
191
+ };
192
+ if (vErrors === null) {
193
+ vErrors = [err7];
194
+ } else {
195
+ vErrors.push(err7);
196
+ }
197
+ errors++;
198
+ }
199
+ }
200
+ if (data.artifacts !== undefined) {
201
+ let data2 = data.artifacts;
202
+ if (Array.isArray(data2)) {
203
+ const len0 = data2.length;
204
+ for (let i0 = 0; i0 < len0; i0++) {
205
+ let data3 = data2[i0];
206
+ if (data3 && typeof data3 == "object" && !Array.isArray(data3)) {
207
+ if (data3.kind !== undefined) {
208
+ if (typeof data3.kind !== "string") {
209
+ const err8 = {
210
+ instancePath: instancePath + "/artifacts/" + i0 + "/kind",
211
+ schemaPath: "#/properties/artifacts/items/properties/kind/type",
212
+ keyword: "type",
213
+ params: { type: "string" },
214
+ message: "must be string",
215
+ };
216
+ if (vErrors === null) {
217
+ vErrors = [err8];
218
+ } else {
219
+ vErrors.push(err8);
220
+ }
221
+ errors++;
222
+ }
223
+ }
224
+ if (data3.role !== undefined) {
225
+ if (typeof data3.role !== "string") {
226
+ const err9 = {
227
+ instancePath: instancePath + "/artifacts/" + i0 + "/role",
228
+ schemaPath: "#/properties/artifacts/items/properties/role/type",
229
+ keyword: "type",
230
+ params: { type: "string" },
231
+ message: "must be string",
232
+ };
233
+ if (vErrors === null) {
234
+ vErrors = [err9];
235
+ } else {
236
+ vErrors.push(err9);
237
+ }
238
+ errors++;
239
+ }
240
+ }
241
+ if (data3.name !== undefined) {
242
+ if (typeof data3.name !== "string") {
243
+ const err10 = {
244
+ instancePath: instancePath + "/artifacts/" + i0 + "/name",
245
+ schemaPath: "#/properties/artifacts/items/properties/name/type",
246
+ keyword: "type",
247
+ params: { type: "string" },
248
+ message: "must be string",
249
+ };
250
+ if (vErrors === null) {
251
+ vErrors = [err10];
252
+ } else {
253
+ vErrors.push(err10);
254
+ }
255
+ errors++;
256
+ }
257
+ }
258
+ if (data3.mimeType !== undefined) {
259
+ if (typeof data3.mimeType !== "string") {
260
+ const err11 = {
261
+ instancePath: instancePath + "/artifacts/" + i0 + "/mimeType",
262
+ schemaPath: "#/properties/artifacts/items/properties/mimeType/type",
263
+ keyword: "type",
264
+ params: { type: "string" },
265
+ message: "must be string",
266
+ };
267
+ if (vErrors === null) {
268
+ vErrors = [err11];
269
+ } else {
270
+ vErrors.push(err11);
271
+ }
272
+ errors++;
273
+ }
274
+ }
275
+ if (data3.text !== undefined) {
276
+ if (typeof data3.text !== "string") {
277
+ const err12 = {
278
+ instancePath: instancePath + "/artifacts/" + i0 + "/text",
279
+ schemaPath: "#/properties/artifacts/items/properties/text/type",
280
+ keyword: "type",
281
+ params: { type: "string" },
282
+ message: "must be string",
283
+ };
284
+ if (vErrors === null) {
285
+ vErrors = [err12];
286
+ } else {
287
+ vErrors.push(err12);
288
+ }
289
+ errors++;
290
+ }
291
+ }
292
+ if (data3.uri !== undefined) {
293
+ if (typeof data3.uri !== "string") {
294
+ const err13 = {
295
+ instancePath: instancePath + "/artifacts/" + i0 + "/uri",
296
+ schemaPath: "#/properties/artifacts/items/properties/uri/type",
297
+ keyword: "type",
298
+ params: { type: "string" },
299
+ message: "must be string",
300
+ };
301
+ if (vErrors === null) {
302
+ vErrors = [err13];
303
+ } else {
304
+ vErrors.push(err13);
305
+ }
306
+ errors++;
307
+ }
308
+ }
309
+ } else {
310
+ const err14 = {
311
+ instancePath: instancePath + "/artifacts/" + i0,
312
+ schemaPath: "#/properties/artifacts/items/type",
313
+ keyword: "type",
314
+ params: { type: "object" },
315
+ message: "must be object",
316
+ };
317
+ if (vErrors === null) {
318
+ vErrors = [err14];
319
+ } else {
320
+ vErrors.push(err14);
321
+ }
322
+ errors++;
323
+ }
324
+ }
325
+ } else {
326
+ const err15 = {
327
+ instancePath: instancePath + "/artifacts",
328
+ schemaPath: "#/properties/artifacts/type",
329
+ keyword: "type",
330
+ params: { type: "array" },
331
+ message: "must be array",
332
+ };
333
+ if (vErrors === null) {
334
+ vErrors = [err15];
335
+ } else {
336
+ vErrors.push(err15);
337
+ }
338
+ errors++;
339
+ }
340
+ }
341
+ if (data.artifactHashes !== undefined) {
342
+ let data10 = data.artifactHashes;
343
+ if (Array.isArray(data10)) {
344
+ const len1 = data10.length;
345
+ for (let i1 = 0; i1 < len1; i1++) {
346
+ let data11 = data10[i1];
347
+ if (typeof data11 === "string") {
348
+ if (func3(data11) < 10) {
349
+ const err16 = {
350
+ instancePath: instancePath + "/artifactHashes/" + i1,
351
+ schemaPath: "#/properties/artifactHashes/items/minLength",
352
+ keyword: "minLength",
353
+ params: { limit: 10 },
354
+ message: "must NOT have fewer than 10 characters",
355
+ };
356
+ if (vErrors === null) {
357
+ vErrors = [err16];
358
+ } else {
359
+ vErrors.push(err16);
360
+ }
361
+ errors++;
362
+ }
363
+ } else {
364
+ const err17 = {
365
+ instancePath: instancePath + "/artifactHashes/" + i1,
366
+ schemaPath: "#/properties/artifactHashes/items/type",
367
+ keyword: "type",
368
+ params: { type: "string" },
369
+ message: "must be string",
370
+ };
371
+ if (vErrors === null) {
372
+ vErrors = [err17];
373
+ } else {
374
+ vErrors.push(err17);
375
+ }
376
+ errors++;
377
+ }
378
+ }
379
+ } else {
380
+ const err18 = {
381
+ instancePath: instancePath + "/artifactHashes",
382
+ schemaPath: "#/properties/artifactHashes/type",
383
+ keyword: "type",
384
+ params: { type: "array" },
385
+ message: "must be array",
386
+ };
387
+ if (vErrors === null) {
388
+ vErrors = [err18];
389
+ } else {
390
+ vErrors.push(err18);
391
+ }
392
+ errors++;
393
+ }
394
+ }
395
+ if (data.schemaVersion !== undefined) {
396
+ if (typeof data.schemaVersion !== "string") {
397
+ const err19 = {
398
+ instancePath: instancePath + "/schemaVersion",
399
+ schemaPath: "#/properties/schemaVersion/type",
400
+ keyword: "type",
401
+ params: { type: "string" },
402
+ message: "must be string",
403
+ };
404
+ if (vErrors === null) {
405
+ vErrors = [err19];
406
+ } else {
407
+ vErrors.push(err19);
408
+ }
409
+ errors++;
410
+ }
411
+ }
412
+ if (data.metadata !== undefined) {
413
+ let data13 = data.metadata;
414
+ if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
415
+ } else {
416
+ const err20 = {
417
+ instancePath: instancePath + "/metadata",
418
+ schemaPath: "#/properties/metadata/type",
419
+ keyword: "type",
420
+ params: { type: "object" },
421
+ message: "must be object",
422
+ };
423
+ if (vErrors === null) {
424
+ vErrors = [err20];
425
+ } else {
426
+ vErrors.push(err20);
427
+ }
428
+ errors++;
429
+ }
430
+ }
431
+ if (data.outputSchema !== undefined) {
432
+ let data14 = data.outputSchema;
433
+ if (data14 && typeof data14 == "object" && !Array.isArray(data14)) {
434
+ } else {
435
+ const err21 = {
436
+ instancePath: instancePath + "/outputSchema",
437
+ schemaPath: "#/properties/outputSchema/type",
438
+ keyword: "type",
439
+ params: { type: "object" },
440
+ message: "must be object",
441
+ };
442
+ if (vErrors === null) {
443
+ vErrors = [err21];
444
+ } else {
445
+ vErrors.push(err21);
446
+ }
447
+ errors++;
448
+ }
449
+ }
450
+ if (data.temperature !== undefined) {
451
+ if (!(typeof data.temperature == "number")) {
452
+ const err22 = {
453
+ instancePath: instancePath + "/temperature",
454
+ schemaPath: "#/properties/temperature/type",
455
+ keyword: "type",
456
+ params: { type: "number" },
457
+ message: "must be number",
458
+ };
459
+ if (vErrors === null) {
460
+ vErrors = [err22];
461
+ } else {
462
+ vErrors.push(err22);
463
+ }
464
+ errors++;
465
+ }
466
+ }
467
+ if (data.maxOutputTokens !== undefined) {
468
+ if (!(typeof data.maxOutputTokens == "number")) {
469
+ const err23 = {
470
+ instancePath: instancePath + "/maxOutputTokens",
471
+ schemaPath: "#/properties/maxOutputTokens/type",
472
+ keyword: "type",
473
+ params: { type: "number" },
474
+ message: "must be number",
475
+ };
476
+ if (vErrors === null) {
477
+ vErrors = [err23];
478
+ } else {
479
+ vErrors.push(err23);
480
+ }
481
+ errors++;
482
+ }
483
+ }
484
+ if (data.retryContext !== undefined) {
485
+ let data17 = data.retryContext;
486
+ if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
487
+ for (const key1 in data17) {
488
+ if (!(key1 === "attempt" || key1 === "validationErrors")) {
489
+ const err24 = {
490
+ instancePath: instancePath + "/retryContext",
491
+ schemaPath: "#/properties/retryContext/additionalProperties",
492
+ keyword: "additionalProperties",
493
+ params: { additionalProperty: key1 },
494
+ message: "must NOT have additional properties",
495
+ };
496
+ if (vErrors === null) {
497
+ vErrors = [err24];
498
+ } else {
499
+ vErrors.push(err24);
500
+ }
501
+ errors++;
502
+ }
503
+ }
504
+ if (data17.attempt !== undefined) {
505
+ if (!(typeof data17.attempt == "number")) {
506
+ const err25 = {
507
+ instancePath: instancePath + "/retryContext/attempt",
508
+ schemaPath: "#/properties/retryContext/properties/attempt/type",
509
+ keyword: "type",
510
+ params: { type: "number" },
511
+ message: "must be number",
512
+ };
513
+ if (vErrors === null) {
514
+ vErrors = [err25];
515
+ } else {
516
+ vErrors.push(err25);
517
+ }
518
+ errors++;
519
+ }
520
+ }
521
+ if (data17.validationErrors !== undefined) {
522
+ let data19 = data17.validationErrors;
523
+ if (Array.isArray(data19)) {
524
+ const len2 = data19.length;
525
+ for (let i2 = 0; i2 < len2; i2++) {
526
+ if (typeof data19[i2] !== "string") {
527
+ const err26 = {
528
+ instancePath: instancePath + "/retryContext/validationErrors/" + i2,
529
+ schemaPath: "#/properties/retryContext/properties/validationErrors/items/type",
530
+ keyword: "type",
531
+ params: { type: "string" },
532
+ message: "must be string",
533
+ };
534
+ if (vErrors === null) {
535
+ vErrors = [err26];
536
+ } else {
537
+ vErrors.push(err26);
538
+ }
539
+ errors++;
540
+ }
541
+ }
542
+ } else {
543
+ const err27 = {
544
+ instancePath: instancePath + "/retryContext/validationErrors",
545
+ schemaPath: "#/properties/retryContext/properties/validationErrors/type",
546
+ keyword: "type",
547
+ params: { type: "array" },
548
+ message: "must be array",
549
+ };
550
+ if (vErrors === null) {
551
+ vErrors = [err27];
552
+ } else {
553
+ vErrors.push(err27);
554
+ }
555
+ errors++;
556
+ }
557
+ }
558
+ } else {
559
+ const err28 = {
560
+ instancePath: instancePath + "/retryContext",
561
+ schemaPath: "#/properties/retryContext/type",
562
+ keyword: "type",
563
+ params: { type: "object" },
564
+ message: "must be object",
565
+ };
566
+ if (vErrors === null) {
567
+ vErrors = [err28];
568
+ } else {
569
+ vErrors.push(err28);
570
+ }
571
+ errors++;
572
+ }
573
+ }
574
+ } else {
575
+ const err29 = {
576
+ instancePath,
577
+ schemaPath: "#/type",
578
+ keyword: "type",
579
+ params: { type: "object" },
580
+ message: "must be object",
581
+ };
582
+ if (vErrors === null) {
583
+ vErrors = [err29];
584
+ } else {
585
+ vErrors.push(err29);
586
+ }
587
+ errors++;
588
+ }
589
+ validate10.errors = vErrors;
590
+ return errors === 0;
591
+ }
592
+
593
+ export const validateResponseEnvelope = validate11;
594
+ const schema12 = {
595
+ type: "object",
596
+ properties: {
597
+ ok: { type: "boolean" },
598
+ result: {
599
+ type: "object",
600
+ properties: {
601
+ runId: { type: "string" },
602
+ model: { type: "string" },
603
+ prompt: { type: "string" },
604
+ status: { type: "string" },
605
+ output: {
606
+ type: "object",
607
+ properties: { text: { type: "string" }, data: {}, format: { type: "string" } },
608
+ required: [],
609
+ additionalProperties: true,
610
+ },
611
+ usage: {
612
+ type: "object",
613
+ properties: {
614
+ inputTokens: { type: "number" },
615
+ outputTokens: { type: "number" },
616
+ totalTokens: { type: "number" },
617
+ },
618
+ additionalProperties: true,
619
+ },
620
+ warnings: { type: "array", items: { type: "string" } },
621
+ metadata: { type: "object", additionalProperties: true },
622
+ diagnostics: { type: "object", additionalProperties: true },
623
+ },
624
+ required: ["output"],
625
+ additionalProperties: true,
626
+ },
627
+ error: { type: "object", additionalProperties: true },
628
+ },
629
+ required: ["ok"],
630
+ additionalProperties: true,
631
+ };
632
+
633
+ function validate11(
634
+ data,
635
+ { instancePath = "", parentData, parentDataProperty, rootData = data } = {},
636
+ ) {
637
+ let vErrors = null;
638
+ let errors = 0;
639
+ if (data && typeof data == "object" && !Array.isArray(data)) {
640
+ if (data.ok === undefined) {
641
+ const err0 = {
642
+ instancePath,
643
+ schemaPath: "#/required",
644
+ keyword: "required",
645
+ params: { missingProperty: "ok" },
646
+ message: "must have required property '" + "ok" + "'",
647
+ };
648
+ if (vErrors === null) {
649
+ vErrors = [err0];
650
+ } else {
651
+ vErrors.push(err0);
652
+ }
653
+ errors++;
654
+ }
655
+ if (data.ok !== undefined) {
656
+ if (typeof data.ok !== "boolean") {
657
+ const err1 = {
658
+ instancePath: instancePath + "/ok",
659
+ schemaPath: "#/properties/ok/type",
660
+ keyword: "type",
661
+ params: { type: "boolean" },
662
+ message: "must be boolean",
663
+ };
664
+ if (vErrors === null) {
665
+ vErrors = [err1];
666
+ } else {
667
+ vErrors.push(err1);
668
+ }
669
+ errors++;
670
+ }
671
+ }
672
+ if (data.result !== undefined) {
673
+ let data1 = data.result;
674
+ if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
675
+ if (data1.output === undefined) {
676
+ const err2 = {
677
+ instancePath: instancePath + "/result",
678
+ schemaPath: "#/properties/result/required",
679
+ keyword: "required",
680
+ params: { missingProperty: "output" },
681
+ message: "must have required property '" + "output" + "'",
682
+ };
683
+ if (vErrors === null) {
684
+ vErrors = [err2];
685
+ } else {
686
+ vErrors.push(err2);
687
+ }
688
+ errors++;
689
+ }
690
+ if (data1.runId !== undefined) {
691
+ if (typeof data1.runId !== "string") {
692
+ const err3 = {
693
+ instancePath: instancePath + "/result/runId",
694
+ schemaPath: "#/properties/result/properties/runId/type",
695
+ keyword: "type",
696
+ params: { type: "string" },
697
+ message: "must be string",
698
+ };
699
+ if (vErrors === null) {
700
+ vErrors = [err3];
701
+ } else {
702
+ vErrors.push(err3);
703
+ }
704
+ errors++;
705
+ }
706
+ }
707
+ if (data1.model !== undefined) {
708
+ if (typeof data1.model !== "string") {
709
+ const err4 = {
710
+ instancePath: instancePath + "/result/model",
711
+ schemaPath: "#/properties/result/properties/model/type",
712
+ keyword: "type",
713
+ params: { type: "string" },
714
+ message: "must be string",
715
+ };
716
+ if (vErrors === null) {
717
+ vErrors = [err4];
718
+ } else {
719
+ vErrors.push(err4);
720
+ }
721
+ errors++;
722
+ }
723
+ }
724
+ if (data1.prompt !== undefined) {
725
+ if (typeof data1.prompt !== "string") {
726
+ const err5 = {
727
+ instancePath: instancePath + "/result/prompt",
728
+ schemaPath: "#/properties/result/properties/prompt/type",
729
+ keyword: "type",
730
+ params: { type: "string" },
731
+ message: "must be string",
732
+ };
733
+ if (vErrors === null) {
734
+ vErrors = [err5];
735
+ } else {
736
+ vErrors.push(err5);
737
+ }
738
+ errors++;
739
+ }
740
+ }
741
+ if (data1.status !== undefined) {
742
+ if (typeof data1.status !== "string") {
743
+ const err6 = {
744
+ instancePath: instancePath + "/result/status",
745
+ schemaPath: "#/properties/result/properties/status/type",
746
+ keyword: "type",
747
+ params: { type: "string" },
748
+ message: "must be string",
749
+ };
750
+ if (vErrors === null) {
751
+ vErrors = [err6];
752
+ } else {
753
+ vErrors.push(err6);
754
+ }
755
+ errors++;
756
+ }
757
+ }
758
+ if (data1.output !== undefined) {
759
+ let data6 = data1.output;
760
+ if (data6 && typeof data6 == "object" && !Array.isArray(data6)) {
761
+ if (data6.text !== undefined) {
762
+ if (typeof data6.text !== "string") {
763
+ const err7 = {
764
+ instancePath: instancePath + "/result/output/text",
765
+ schemaPath: "#/properties/result/properties/output/properties/text/type",
766
+ keyword: "type",
767
+ params: { type: "string" },
768
+ message: "must be string",
769
+ };
770
+ if (vErrors === null) {
771
+ vErrors = [err7];
772
+ } else {
773
+ vErrors.push(err7);
774
+ }
775
+ errors++;
776
+ }
777
+ }
778
+ if (data6.format !== undefined) {
779
+ if (typeof data6.format !== "string") {
780
+ const err8 = {
781
+ instancePath: instancePath + "/result/output/format",
782
+ schemaPath: "#/properties/result/properties/output/properties/format/type",
783
+ keyword: "type",
784
+ params: { type: "string" },
785
+ message: "must be string",
786
+ };
787
+ if (vErrors === null) {
788
+ vErrors = [err8];
789
+ } else {
790
+ vErrors.push(err8);
791
+ }
792
+ errors++;
793
+ }
794
+ }
795
+ } else {
796
+ const err9 = {
797
+ instancePath: instancePath + "/result/output",
798
+ schemaPath: "#/properties/result/properties/output/type",
799
+ keyword: "type",
800
+ params: { type: "object" },
801
+ message: "must be object",
802
+ };
803
+ if (vErrors === null) {
804
+ vErrors = [err9];
805
+ } else {
806
+ vErrors.push(err9);
807
+ }
808
+ errors++;
809
+ }
810
+ }
811
+ if (data1.usage !== undefined) {
812
+ let data9 = data1.usage;
813
+ if (data9 && typeof data9 == "object" && !Array.isArray(data9)) {
814
+ if (data9.inputTokens !== undefined) {
815
+ if (!(typeof data9.inputTokens == "number")) {
816
+ const err10 = {
817
+ instancePath: instancePath + "/result/usage/inputTokens",
818
+ schemaPath: "#/properties/result/properties/usage/properties/inputTokens/type",
819
+ keyword: "type",
820
+ params: { type: "number" },
821
+ message: "must be number",
822
+ };
823
+ if (vErrors === null) {
824
+ vErrors = [err10];
825
+ } else {
826
+ vErrors.push(err10);
827
+ }
828
+ errors++;
829
+ }
830
+ }
831
+ if (data9.outputTokens !== undefined) {
832
+ if (!(typeof data9.outputTokens == "number")) {
833
+ const err11 = {
834
+ instancePath: instancePath + "/result/usage/outputTokens",
835
+ schemaPath: "#/properties/result/properties/usage/properties/outputTokens/type",
836
+ keyword: "type",
837
+ params: { type: "number" },
838
+ message: "must be number",
839
+ };
840
+ if (vErrors === null) {
841
+ vErrors = [err11];
842
+ } else {
843
+ vErrors.push(err11);
844
+ }
845
+ errors++;
846
+ }
847
+ }
848
+ if (data9.totalTokens !== undefined) {
849
+ if (!(typeof data9.totalTokens == "number")) {
850
+ const err12 = {
851
+ instancePath: instancePath + "/result/usage/totalTokens",
852
+ schemaPath: "#/properties/result/properties/usage/properties/totalTokens/type",
853
+ keyword: "type",
854
+ params: { type: "number" },
855
+ message: "must be number",
856
+ };
857
+ if (vErrors === null) {
858
+ vErrors = [err12];
859
+ } else {
860
+ vErrors.push(err12);
861
+ }
862
+ errors++;
863
+ }
864
+ }
865
+ } else {
866
+ const err13 = {
867
+ instancePath: instancePath + "/result/usage",
868
+ schemaPath: "#/properties/result/properties/usage/type",
869
+ keyword: "type",
870
+ params: { type: "object" },
871
+ message: "must be object",
872
+ };
873
+ if (vErrors === null) {
874
+ vErrors = [err13];
875
+ } else {
876
+ vErrors.push(err13);
877
+ }
878
+ errors++;
879
+ }
880
+ }
881
+ if (data1.warnings !== undefined) {
882
+ let data13 = data1.warnings;
883
+ if (Array.isArray(data13)) {
884
+ const len0 = data13.length;
885
+ for (let i0 = 0; i0 < len0; i0++) {
886
+ if (typeof data13[i0] !== "string") {
887
+ const err14 = {
888
+ instancePath: instancePath + "/result/warnings/" + i0,
889
+ schemaPath: "#/properties/result/properties/warnings/items/type",
890
+ keyword: "type",
891
+ params: { type: "string" },
892
+ message: "must be string",
893
+ };
894
+ if (vErrors === null) {
895
+ vErrors = [err14];
896
+ } else {
897
+ vErrors.push(err14);
898
+ }
899
+ errors++;
900
+ }
901
+ }
902
+ } else {
903
+ const err15 = {
904
+ instancePath: instancePath + "/result/warnings",
905
+ schemaPath: "#/properties/result/properties/warnings/type",
906
+ keyword: "type",
907
+ params: { type: "array" },
908
+ message: "must be array",
909
+ };
910
+ if (vErrors === null) {
911
+ vErrors = [err15];
912
+ } else {
913
+ vErrors.push(err15);
914
+ }
915
+ errors++;
916
+ }
917
+ }
918
+ if (data1.metadata !== undefined) {
919
+ let data15 = data1.metadata;
920
+ if (data15 && typeof data15 == "object" && !Array.isArray(data15)) {
921
+ } else {
922
+ const err16 = {
923
+ instancePath: instancePath + "/result/metadata",
924
+ schemaPath: "#/properties/result/properties/metadata/type",
925
+ keyword: "type",
926
+ params: { type: "object" },
927
+ message: "must be object",
928
+ };
929
+ if (vErrors === null) {
930
+ vErrors = [err16];
931
+ } else {
932
+ vErrors.push(err16);
933
+ }
934
+ errors++;
935
+ }
936
+ }
937
+ if (data1.diagnostics !== undefined) {
938
+ let data16 = data1.diagnostics;
939
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
940
+ } else {
941
+ const err17 = {
942
+ instancePath: instancePath + "/result/diagnostics",
943
+ schemaPath: "#/properties/result/properties/diagnostics/type",
944
+ keyword: "type",
945
+ params: { type: "object" },
946
+ message: "must be object",
947
+ };
948
+ if (vErrors === null) {
949
+ vErrors = [err17];
950
+ } else {
951
+ vErrors.push(err17);
952
+ }
953
+ errors++;
954
+ }
955
+ }
956
+ } else {
957
+ const err18 = {
958
+ instancePath: instancePath + "/result",
959
+ schemaPath: "#/properties/result/type",
960
+ keyword: "type",
961
+ params: { type: "object" },
962
+ message: "must be object",
963
+ };
964
+ if (vErrors === null) {
965
+ vErrors = [err18];
966
+ } else {
967
+ vErrors.push(err18);
968
+ }
969
+ errors++;
970
+ }
971
+ }
972
+ if (data.error !== undefined) {
973
+ let data17 = data.error;
974
+ if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
975
+ } else {
976
+ const err19 = {
977
+ instancePath: instancePath + "/error",
978
+ schemaPath: "#/properties/error/type",
979
+ keyword: "type",
980
+ params: { type: "object" },
981
+ message: "must be object",
982
+ };
983
+ if (vErrors === null) {
984
+ vErrors = [err19];
985
+ } else {
986
+ vErrors.push(err19);
987
+ }
988
+ errors++;
989
+ }
990
+ }
991
+ } else {
992
+ const err20 = {
993
+ instancePath,
994
+ schemaPath: "#/type",
995
+ keyword: "type",
996
+ params: { type: "object" },
997
+ message: "must be object",
998
+ };
999
+ if (vErrors === null) {
1000
+ vErrors = [err20];
1001
+ } else {
1002
+ vErrors.push(err20);
1003
+ }
1004
+ errors++;
1005
+ }
1006
+ validate11.errors = vErrors;
1007
+ return errors === 0;
1008
+ }