openclaw-brokerkit 0.3.2 → 0.3.4

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.
@@ -2,9 +2,11 @@
2
2
  // @ts-nocheck -- generated Ajv standalone code
3
3
  // Generated from protocol/openapi/operator-v1.yaml. Do not edit.
4
4
  import formatsModule from "ajv-formats/dist/formats.js";
5
- import equal from "ajv/dist/runtime/equal.js";
6
- import ucs2length from "ajv/dist/runtime/ucs2length.js";
5
+ import equalModule from "ajv/dist/runtime/equal.js";
6
+ import ucs2lengthModule from "ajv/dist/runtime/ucs2length.js";
7
7
  const formats = formatsModule.fullFormats;
8
+ const equal = equalModule.default ?? equalModule;
9
+ const ucs2length = ucs2lengthModule.default ?? ucs2lengthModule;
8
10
  "use strict";
9
11
  export const validateDescriptor = validate20;
10
12
  const schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/Descriptor", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/Descriptor" };
@@ -108,10 +110,10 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
108
110
  validate22.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
109
111
  export const validateBrokerRequest = validate23;
110
112
  const schema36 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/BrokerRequest", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/BrokerRequest" };
111
- const schema37 = { "type": "object", "additionalProperties": false, "required": ["id", "revision", "requester", "operation", "status", "requested_at", "requested_duration_seconds", "requested_max_uses", "granted_max_uses", "used_count", "presentation", "allowed_actions"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "integer", "minimum": 1 }, "requester": { "type": "string", "minLength": 1, "maxLength": 80 }, "operation": { "type": "string", "minLength": 1, "maxLength": 500 }, "status": { "$ref": "#/$defs/Status" }, "requested_at": { "type": "string", "format": "date-time" }, "pending_expires_at": { "type": "string", "format": "date-time" }, "active_expires_at": { "type": "string", "format": "date-time" }, "requested_duration_seconds": { "type": "integer", "minimum": 1 }, "requested_max_uses": { "type": ["integer", "null"], "minimum": 1 }, "granted_max_uses": { "type": ["integer", "null"], "minimum": 1 }, "used_count": { "type": "integer", "minimum": 0 }, "request_reason": { "type": "string", "maxLength": 2000 }, "decided_at": { "type": "string", "format": "date-time" }, "decided_by": { "type": "string", "maxLength": 200 }, "decided_on_behalf_of": { "type": "string", "maxLength": 200 }, "presentation": { "$ref": "#/$defs/Presentation" }, "presentation_unavailable": { "type": "boolean" }, "allowed_actions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/Action" } }, "approval_bounds": { "$ref": "#/$defs/ApprovalBounds" } } };
113
+ const schema37 = { "type": "object", "additionalProperties": false, "required": ["id", "revision", "requester", "operation", "status", "requested_at", "requested_duration_seconds", "requested_max_uses", "granted_max_uses", "used_count", "presentation", "allowed_actions"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "requester": { "type": "string", "minLength": 1, "maxLength": 80 }, "operation": { "type": "string", "minLength": 1, "maxLength": 500 }, "status": { "$ref": "#/$defs/Status" }, "requested_at": { "type": "string", "format": "date-time" }, "pending_expires_at": { "type": "string", "format": "date-time" }, "active_expires_at": { "type": "string", "format": "date-time" }, "requested_duration_seconds": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "requested_max_uses": { "type": ["integer", "null"], "minimum": 1, "maximum": 9007199254740991 }, "granted_max_uses": { "type": ["integer", "null"], "minimum": 1, "maximum": 9007199254740991 }, "used_count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "request_reason": { "type": "string", "maxLength": 2000 }, "decided_at": { "type": "string", "format": "date-time" }, "decided_by": { "type": "string", "maxLength": 200 }, "decided_on_behalf_of": { "type": "string", "maxLength": 200 }, "presentation": { "$ref": "#/$defs/Presentation" }, "presentation_unavailable": { "type": "boolean" }, "allowed_actions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/Action" } }, "approval_bounds": { "$ref": "#/$defs/ApprovalBounds" } } };
112
114
  const schema38 = { "type": "string", "enum": ["pending", "active", "denied", "canceled", "expired", "consumed", "revoked"] };
113
115
  const schema44 = { "type": "string", "enum": ["approve", "deny", "revoke"] };
114
- const schema45 = { "type": "object", "additionalProperties": false, "required": ["max_duration_seconds", "max_uses"], "properties": { "max_duration_seconds": { "type": "integer", "minimum": 1 }, "max_uses": { "type": ["integer", "null"], "minimum": 1 } } };
116
+ const schema45 = { "type": "object", "additionalProperties": false, "required": ["max_duration_seconds", "max_uses"], "properties": { "max_duration_seconds": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "max_uses": { "type": ["integer", "null"], "minimum": 1, "maximum": 9007199254740991 } } };
115
117
  const func3 = Object.prototype.hasOwnProperty;
116
118
  const func0 = equal;
117
119
  const formats0 = formats["date-time"];
@@ -547,10 +549,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
547
549
  }
548
550
  if (errors === _errs4) {
549
551
  if ((typeof data1 == "number") && (isFinite(data1))) {
550
- if (data1 < 1 || isNaN(data1)) {
551
- validate24.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
552
+ if (data1 > 9007199254740991 || isNaN(data1)) {
553
+ validate24.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
552
554
  return false;
553
555
  }
556
+ else {
557
+ if (data1 < 1 || isNaN(data1)) {
558
+ validate24.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
559
+ return false;
560
+ }
561
+ }
554
562
  }
555
563
  }
556
564
  var valid0 = _errs4 === errors;
@@ -708,10 +716,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
708
716
  }
709
717
  if (errors === _errs19) {
710
718
  if ((typeof data8 == "number") && (isFinite(data8))) {
711
- if (data8 < 1 || isNaN(data8)) {
712
- validate24.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
719
+ if (data8 > 9007199254740991 || isNaN(data8)) {
720
+ validate24.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
713
721
  return false;
714
722
  }
723
+ else {
724
+ if (data8 < 1 || isNaN(data8)) {
725
+ validate24.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
726
+ return false;
727
+ }
728
+ }
715
729
  }
716
730
  }
717
731
  var valid0 = _errs19 === errors;
@@ -729,10 +743,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
729
743
  }
730
744
  if (errors === _errs21) {
731
745
  if ((typeof data9 == "number") && (isFinite(data9))) {
732
- if (data9 < 1 || isNaN(data9)) {
733
- validate24.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
746
+ if (data9 > 9007199254740991 || isNaN(data9)) {
747
+ validate24.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
734
748
  return false;
735
749
  }
750
+ else {
751
+ if (data9 < 1 || isNaN(data9)) {
752
+ validate24.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
753
+ return false;
754
+ }
755
+ }
736
756
  }
737
757
  }
738
758
  var valid0 = _errs21 === errors;
@@ -750,10 +770,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
750
770
  }
751
771
  if (errors === _errs23) {
752
772
  if ((typeof data10 == "number") && (isFinite(data10))) {
753
- if (data10 < 1 || isNaN(data10)) {
754
- validate24.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
773
+ if (data10 > 9007199254740991 || isNaN(data10)) {
774
+ validate24.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
755
775
  return false;
756
776
  }
777
+ else {
778
+ if (data10 < 1 || isNaN(data10)) {
779
+ validate24.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
780
+ return false;
781
+ }
782
+ }
757
783
  }
758
784
  }
759
785
  var valid0 = _errs23 === errors;
@@ -771,10 +797,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
771
797
  }
772
798
  if (errors === _errs25) {
773
799
  if ((typeof data11 == "number") && (isFinite(data11))) {
774
- if (data11 < 0 || isNaN(data11)) {
775
- validate24.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
800
+ if (data11 > 9007199254740991 || isNaN(data11)) {
801
+ validate24.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
776
802
  return false;
777
803
  }
804
+ else {
805
+ if (data11 < 0 || isNaN(data11)) {
806
+ validate24.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
807
+ return false;
808
+ }
809
+ }
778
810
  }
779
811
  }
780
812
  var valid0 = _errs25 === errors;
@@ -973,10 +1005,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
973
1005
  }
974
1006
  if (errors === _errs47) {
975
1007
  if ((typeof data21 == "number") && (isFinite(data21))) {
976
- if (data21 < 1 || isNaN(data21)) {
977
- validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1008
+ if (data21 > 9007199254740991 || isNaN(data21)) {
1009
+ validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
978
1010
  return false;
979
1011
  }
1012
+ else {
1013
+ if (data21 < 1 || isNaN(data21)) {
1014
+ validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1015
+ return false;
1016
+ }
1017
+ }
980
1018
  }
981
1019
  }
982
1020
  var valid6 = _errs47 === errors;
@@ -994,10 +1032,16 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
994
1032
  }
995
1033
  if (errors === _errs49) {
996
1034
  if ((typeof data22 == "number") && (isFinite(data22))) {
997
- if (data22 < 1 || isNaN(data22)) {
998
- validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1035
+ if (data22 > 9007199254740991 || isNaN(data22)) {
1036
+ validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
999
1037
  return false;
1000
1038
  }
1039
+ else {
1040
+ if (data22 < 1 || isNaN(data22)) {
1041
+ validate24.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1042
+ return false;
1043
+ }
1044
+ }
1001
1045
  }
1002
1046
  }
1003
1047
  var valid6 = _errs49 === errors;
@@ -1116,10 +1160,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1116
1160
  }
1117
1161
  if (errors === _errs4) {
1118
1162
  if ((typeof data1 == "number") && (isFinite(data1))) {
1119
- if (data1 < 1 || isNaN(data1)) {
1120
- validate32.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1163
+ if (data1 > 9007199254740991 || isNaN(data1)) {
1164
+ validate32.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1121
1165
  return false;
1122
1166
  }
1167
+ else {
1168
+ if (data1 < 1 || isNaN(data1)) {
1169
+ validate32.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1170
+ return false;
1171
+ }
1172
+ }
1123
1173
  }
1124
1174
  }
1125
1175
  var valid0 = _errs4 === errors;
@@ -1277,10 +1327,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1277
1327
  }
1278
1328
  if (errors === _errs19) {
1279
1329
  if ((typeof data8 == "number") && (isFinite(data8))) {
1280
- if (data8 < 1 || isNaN(data8)) {
1281
- validate32.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1330
+ if (data8 > 9007199254740991 || isNaN(data8)) {
1331
+ validate32.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1282
1332
  return false;
1283
1333
  }
1334
+ else {
1335
+ if (data8 < 1 || isNaN(data8)) {
1336
+ validate32.errors = [{ instancePath: instancePath + "/requested_duration_seconds", schemaPath: "#/properties/requested_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1337
+ return false;
1338
+ }
1339
+ }
1284
1340
  }
1285
1341
  }
1286
1342
  var valid0 = _errs19 === errors;
@@ -1298,10 +1354,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1298
1354
  }
1299
1355
  if (errors === _errs21) {
1300
1356
  if ((typeof data9 == "number") && (isFinite(data9))) {
1301
- if (data9 < 1 || isNaN(data9)) {
1302
- validate32.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1357
+ if (data9 > 9007199254740991 || isNaN(data9)) {
1358
+ validate32.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1303
1359
  return false;
1304
1360
  }
1361
+ else {
1362
+ if (data9 < 1 || isNaN(data9)) {
1363
+ validate32.errors = [{ instancePath: instancePath + "/requested_max_uses", schemaPath: "#/properties/requested_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1364
+ return false;
1365
+ }
1366
+ }
1305
1367
  }
1306
1368
  }
1307
1369
  var valid0 = _errs21 === errors;
@@ -1319,10 +1381,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1319
1381
  }
1320
1382
  if (errors === _errs23) {
1321
1383
  if ((typeof data10 == "number") && (isFinite(data10))) {
1322
- if (data10 < 1 || isNaN(data10)) {
1323
- validate32.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1384
+ if (data10 > 9007199254740991 || isNaN(data10)) {
1385
+ validate32.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1324
1386
  return false;
1325
1387
  }
1388
+ else {
1389
+ if (data10 < 1 || isNaN(data10)) {
1390
+ validate32.errors = [{ instancePath: instancePath + "/granted_max_uses", schemaPath: "#/properties/granted_max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1391
+ return false;
1392
+ }
1393
+ }
1326
1394
  }
1327
1395
  }
1328
1396
  var valid0 = _errs23 === errors;
@@ -1340,10 +1408,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1340
1408
  }
1341
1409
  if (errors === _errs25) {
1342
1410
  if ((typeof data11 == "number") && (isFinite(data11))) {
1343
- if (data11 < 0 || isNaN(data11)) {
1344
- validate32.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
1411
+ if (data11 > 9007199254740991 || isNaN(data11)) {
1412
+ validate32.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1345
1413
  return false;
1346
1414
  }
1415
+ else {
1416
+ if (data11 < 0 || isNaN(data11)) {
1417
+ validate32.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
1418
+ return false;
1419
+ }
1420
+ }
1347
1421
  }
1348
1422
  }
1349
1423
  var valid0 = _errs25 === errors;
@@ -1542,10 +1616,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1542
1616
  }
1543
1617
  if (errors === _errs47) {
1544
1618
  if ((typeof data21 == "number") && (isFinite(data21))) {
1545
- if (data21 < 1 || isNaN(data21)) {
1546
- validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1619
+ if (data21 > 9007199254740991 || isNaN(data21)) {
1620
+ validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1547
1621
  return false;
1548
1622
  }
1623
+ else {
1624
+ if (data21 < 1 || isNaN(data21)) {
1625
+ validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_duration_seconds", schemaPath: "#/$defs/ApprovalBounds/properties/max_duration_seconds/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1626
+ return false;
1627
+ }
1628
+ }
1549
1629
  }
1550
1630
  }
1551
1631
  var valid6 = _errs47 === errors;
@@ -1563,10 +1643,16 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
1563
1643
  }
1564
1644
  if (errors === _errs49) {
1565
1645
  if ((typeof data22 == "number") && (isFinite(data22))) {
1566
- if (data22 < 1 || isNaN(data22)) {
1567
- validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1646
+ if (data22 > 9007199254740991 || isNaN(data22)) {
1647
+ validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1568
1648
  return false;
1569
1649
  }
1650
+ else {
1651
+ if (data22 < 1 || isNaN(data22)) {
1652
+ validate32.errors = [{ instancePath: instancePath + "/approval_bounds/max_uses", schemaPath: "#/$defs/ApprovalBounds/properties/max_uses/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1653
+ return false;
1654
+ }
1655
+ }
1570
1656
  }
1571
1657
  }
1572
1658
  var valid6 = _errs49 === errors;
@@ -1736,7 +1822,7 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
1736
1822
  validate30.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
1737
1823
  export const validateBrokerEvent = validate36;
1738
1824
  const schema52 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/BrokerEvent", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/BrokerEvent" };
1739
- const schema53 = { "type": "object", "additionalProperties": false, "required": ["cursor", "kind", "request_id", "revision", "status", "occurred_at", "used_count"], "properties": { "cursor": { "type": "string", "minLength": 1, "maxLength": 1024 }, "kind": { "type": "string", "enum": ["request.created", "request.approved", "request.denied", "request.canceled", "request.expired", "grant.revoked", "grant.reserved", "grant.consumed", "grant.released", "execution.succeeded", "execution.failed", "execution.ambiguous"] }, "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "integer", "minimum": 1 }, "status": { "$ref": "#/$defs/Status" }, "occurred_at": { "type": "string", "format": "date-time" }, "used_count": { "type": "integer", "minimum": 0 } } };
1825
+ const schema53 = { "type": "object", "additionalProperties": false, "required": ["cursor", "kind", "request_id", "revision", "status", "occurred_at", "used_count"], "properties": { "cursor": { "type": "string", "minLength": 1, "maxLength": 1024 }, "kind": { "type": "string", "enum": ["request.created", "request.approved", "request.denied", "request.canceled", "request.expired", "grant.revoked", "grant.reserved", "grant.consumed", "grant.released", "execution.succeeded", "execution.failed", "execution.ambiguous"] }, "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "status": { "$ref": "#/$defs/Status" }, "occurred_at": { "type": "string", "format": "date-time" }, "used_count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } };
1740
1826
  function validate37(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate37.evaluated; if (evaluated0.dynamicProps) {
1741
1827
  evaluated0.props = undefined;
1742
1828
  } if (evaluated0.dynamicItems) {
@@ -1838,10 +1924,16 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
1838
1924
  }
1839
1925
  if (errors === _errs8) {
1840
1926
  if ((typeof data3 == "number") && (isFinite(data3))) {
1841
- if (data3 < 1 || isNaN(data3)) {
1842
- validate37.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1927
+ if (data3 > 9007199254740991 || isNaN(data3)) {
1928
+ validate37.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1843
1929
  return false;
1844
1930
  }
1931
+ else {
1932
+ if (data3 < 1 || isNaN(data3)) {
1933
+ validate37.errors = [{ instancePath: instancePath + "/revision", schemaPath: "#/properties/revision/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
1934
+ return false;
1935
+ }
1936
+ }
1845
1937
  }
1846
1938
  }
1847
1939
  var valid0 = _errs8 === errors;
@@ -1899,10 +1991,16 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
1899
1991
  }
1900
1992
  if (errors === _errs15) {
1901
1993
  if ((typeof data6 == "number") && (isFinite(data6))) {
1902
- if (data6 < 0 || isNaN(data6)) {
1903
- validate37.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
1994
+ if (data6 > 9007199254740991 || isNaN(data6)) {
1995
+ validate37.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
1904
1996
  return false;
1905
1997
  }
1998
+ else {
1999
+ if (data6 < 0 || isNaN(data6)) {
2000
+ validate37.errors = [{ instancePath: instancePath + "/used_count", schemaPath: "#/properties/used_count/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
2001
+ return false;
2002
+ }
2003
+ }
1906
2004
  }
1907
2005
  }
1908
2006
  var valid0 = _errs15 === errors;
@@ -2100,7 +2198,7 @@ function validate39(data, { instancePath = "", parentData, parentDataProperty, r
2100
2198
  validate39.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
2101
2199
  export const validateUISnapshot = validate45;
2102
2200
  const schema58 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/UISnapshot", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISnapshot" };
2103
- const schema59 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "synchronized_at", "sources", "requests"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "synchronized_at": { "type": "string", "format": "date-time" }, "sources": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/UISourceHealth" } }, "requests": { "type": "array", "maxItems": 1000, "items": { "$ref": "#/$defs/UIRequest" } }, "delivery_failures": { "type": "integer", "minimum": 0 } } };
2201
+ const schema59 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "synchronized_at", "sources", "requests"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "synchronized_at": { "type": "string", "format": "date-time" }, "sources": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/UISourceHealth" } }, "requests": { "type": "array", "maxItems": 1000, "items": { "$ref": "#/$defs/UIRequest" } }, "delivery_failures": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } };
2104
2202
  const schema60 = { "type": "object", "additionalProperties": false, "required": ["id", "label", "healthy"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "label": { "type": "string", "minLength": 1, "maxLength": 200 }, "healthy": { "type": "boolean" }, "last_sync_at": { "type": "string", "format": "date-time" }, "error": { "type": "string", "maxLength": 200 } } };
2105
2203
  const schema61 = { "type": "object", "additionalProperties": false, "required": ["source_id", "source_label", "handle", "request"], "properties": { "source_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "source_label": { "type": "string", "minLength": 1, "maxLength": 200 }, "handle": { "type": "string", "minLength": 22, "maxLength": 256, "pattern": "^[A-Za-z0-9_-]+$" }, "request": { "$ref": "#/$defs/BrokerRequest" } } };
2106
2204
  const pattern4 = new RegExp("^[A-Za-z0-9_-]+$", "u");
@@ -2540,10 +2638,16 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
2540
2638
  }
2541
2639
  if (errors === _errs27) {
2542
2640
  if ((typeof data12 == "number") && (isFinite(data12))) {
2543
- if (data12 < 0 || isNaN(data12)) {
2544
- validate46.errors = [{ instancePath: instancePath + "/delivery_failures", schemaPath: "#/properties/delivery_failures/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
2641
+ if (data12 > 9007199254740991 || isNaN(data12)) {
2642
+ validate46.errors = [{ instancePath: instancePath + "/delivery_failures", schemaPath: "#/properties/delivery_failures/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
2545
2643
  return false;
2546
2644
  }
2645
+ else {
2646
+ if (data12 < 0 || isNaN(data12)) {
2647
+ validate46.errors = [{ instancePath: instancePath + "/delivery_failures", schemaPath: "#/properties/delivery_failures/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
2648
+ return false;
2649
+ }
2650
+ }
2547
2651
  }
2548
2652
  }
2549
2653
  var valid0 = _errs27 === errors;
@@ -2666,7 +2770,7 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
2666
2770
  validate51.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
2667
2771
  export const validateUISummary = validate52;
2668
2772
  const schema64 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://brokerkit.dev/schema/operator/v1/runtime/UISummary", "$ref": "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary" };
2669
- const schema65 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "pending", "healthy"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "pending": { "type": "integer", "minimum": 0 }, "healthy": { "type": "boolean" } } };
2773
+ const schema65 = { "type": "object", "additionalProperties": false, "required": ["api_version", "cursor", "pending", "healthy"], "properties": { "api_version": { "type": "string", "const": "brokerkit.io/operator-ui/v1" }, "cursor": { "type": "string", "minLength": 1, "maxLength": 128 }, "pending": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "healthy": { "type": "boolean" } } };
2670
2774
  function validate52(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://brokerkit.dev/schema/operator/v1/runtime/UISummary" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate52.evaluated; if (evaluated0.dynamicProps) {
2671
2775
  evaluated0.props = undefined;
2672
2776
  } if (evaluated0.dynamicItems) {
@@ -2741,10 +2845,16 @@ function validate52(data, { instancePath = "", parentData, parentDataProperty, r
2741
2845
  }
2742
2846
  if (errors === _errs7) {
2743
2847
  if ((typeof data2 == "number") && (isFinite(data2))) {
2744
- if (data2 < 0 || isNaN(data2)) {
2745
- validate52.errors = [{ instancePath: instancePath + "/pending", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/pending/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
2848
+ if (data2 > 9007199254740991 || isNaN(data2)) {
2849
+ validate52.errors = [{ instancePath: instancePath + "/pending", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/pending/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" }];
2746
2850
  return false;
2747
2851
  }
2852
+ else {
2853
+ if (data2 < 0 || isNaN(data2)) {
2854
+ validate52.errors = [{ instancePath: instancePath + "/pending", schemaPath: "https://brokerkit.dev/schema/operator/v1/runtime/components#/$defs/UISummary/properties/pending/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }];
2855
+ return false;
2856
+ }
2857
+ }
2748
2858
  }
2749
2859
  }
2750
2860
  var valid1 = _errs7 === errors;
@@ -0,0 +1,21 @@
1
+ import type { BrokerEvent, BrokerRequest, RequestPage, SafeRequest, Snapshot, SnapshotEvent } from "./types.js";
2
+ import type { Discovery, ErrorEnvelope } from "./generated/operator-v1.js";
3
+ export { OPERATOR_V1_SCHEMA_SHA256, operatorV1, } from "./generated/operator-v1.js";
4
+ export type { BrokerEvent, BrokerRequest, Decision, Discovery, ErrorEnvelope, Presentation, RequestPage, UISnapshot, UISnapshotEvent, UISummary, } from "./generated/operator-v1.js";
5
+ export declare function parseDescriptor(value: unknown): Discovery;
6
+ export declare function parseHealth(value: unknown): {
7
+ status: string;
8
+ };
9
+ export declare function parseRequest(value: unknown): BrokerRequest;
10
+ export declare function parseRequestPage(value: unknown): RequestPage;
11
+ export declare function parseBrokerEvent(value: unknown): BrokerEvent;
12
+ export declare function parseUIRequest(value: unknown): SafeRequest;
13
+ export declare function parseUISnapshot(value: unknown): Snapshot;
14
+ export declare function parseUISnapshotEvent(value: unknown): SnapshotEvent;
15
+ export declare function parseUISummary(value: unknown): {
16
+ api_version: "brokerkit.io/operator-ui/v1";
17
+ cursor: string;
18
+ pending: number;
19
+ healthy: boolean;
20
+ };
21
+ export declare function parseErrorEnvelope(value: unknown): ErrorEnvelope | undefined;
@@ -1,4 +1,5 @@
1
1
  import { validateBrokerEvent, validateBrokerRequest, validateDescriptor, validateErrorEnvelope, validateHealth, validateRequestPage, validateUIRequest, validateUISnapshot, validateUISnapshotEvent, validateUISummary, } from "./generated/operator-validators.js";
2
+ export { OPERATOR_V1_SCHEMA_SHA256, operatorV1, } from "./generated/operator-v1.js";
2
3
  export function parseDescriptor(value) {
3
4
  return validated(validateDescriptor, value);
4
5
  }
@@ -27,9 +28,7 @@ export function parseUISummary(value) {
27
28
  return validated(validateUISummary, value);
28
29
  }
29
30
  export function parseErrorEnvelope(value) {
30
- return validateErrorEnvelope(value)
31
- ? value
32
- : undefined;
31
+ return validateErrorEnvelope(value) ? value : undefined;
33
32
  }
34
33
  function validated(validate, value) {
35
34
  if (!validate(value))
@@ -0,0 +1,12 @@
1
+ import type { BrokerEvent as GeneratedBrokerEvent, BrokerRequest as GeneratedBrokerRequest, Decision as GeneratedDecision, Presentation, RequestPage as GeneratedRequestPage, UISnapshot as GeneratedSnapshot, UISnapshotEvent as GeneratedSnapshotEvent } from "./generated/operator-v1.js";
2
+ export type Risk = Presentation["risk"];
3
+ export type Action = GeneratedBrokerRequest["allowed_actions"][number];
4
+ export type Status = GeneratedBrokerRequest["status"];
5
+ export type BrokerRequest = GeneratedBrokerRequest;
6
+ export type RequestPage = GeneratedRequestPage;
7
+ export type BrokerEvent = GeneratedBrokerEvent;
8
+ export type Decision = GeneratedDecision;
9
+ export type Snapshot = GeneratedSnapshot;
10
+ export type SnapshotEvent = GeneratedSnapshotEvent;
11
+ export type SourceHealth = Snapshot["sources"][number];
12
+ export type SafeRequest = Snapshot["requests"][number];