@primitive.ai/prim 0.1.0-alpha.83 → 0.1.0-alpha.85

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.
@@ -12918,6 +12918,417 @@ function validate61(data, { instancePath = "", parentData, parentDataProperty, r
12918
12918
  return errors === 0;
12919
12919
  }
12920
12920
  validate61.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12921
+ function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12922
+ ;
12923
+ let vErrors = null;
12924
+ let errors = 0;
12925
+ const evaluated0 = validate62.evaluated;
12926
+ if (evaluated0.dynamicProps) {
12927
+ evaluated0.props = void 0;
12928
+ }
12929
+ if (evaluated0.dynamicItems) {
12930
+ evaluated0.items = void 0;
12931
+ }
12932
+ const _errs0 = errors;
12933
+ if (errors === _errs0) {
12934
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12935
+ let missing0;
12936
+ if (data.error === void 0 && (missing0 = "error")) {
12937
+ validate62.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
12938
+ return false;
12939
+ } else {
12940
+ const _errs2 = errors;
12941
+ for (const key0 in data) {
12942
+ if (!(key0 === "error")) {
12943
+ validate62.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
12944
+ return false;
12945
+ break;
12946
+ }
12947
+ }
12948
+ if (_errs2 === errors) {
12949
+ if (data.error !== void 0) {
12950
+ let data0 = data.error;
12951
+ if (typeof data0 !== "string") {
12952
+ validate62.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
12953
+ return false;
12954
+ }
12955
+ if ("Not found" !== data0) {
12956
+ validate62.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/properties/error/const", keyword: "const", params: { allowedValue: "Not found" }, message: "must be equal to constant" }];
12957
+ return false;
12958
+ }
12959
+ }
12960
+ }
12961
+ }
12962
+ } else {
12963
+ validate62.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationDisabled/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
12964
+ return false;
12965
+ }
12966
+ }
12967
+ validate62.errors = vErrors;
12968
+ return errors === 0;
12969
+ }
12970
+ validate62.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12971
+ function validate63(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12972
+ ;
12973
+ let vErrors = null;
12974
+ let errors = 0;
12975
+ const evaluated0 = validate63.evaluated;
12976
+ if (evaluated0.dynamicProps) {
12977
+ evaluated0.props = void 0;
12978
+ }
12979
+ if (evaluated0.dynamicItems) {
12980
+ evaluated0.items = void 0;
12981
+ }
12982
+ const _errs1 = errors;
12983
+ let valid1 = false;
12984
+ const _errs2 = errors;
12985
+ if (errors === _errs2) {
12986
+ if (data && typeof data == "object" && !Array.isArray(data)) {
12987
+ let missing0;
12988
+ if (data.error === void 0 && (missing0 = "error")) {
12989
+ const err0 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" };
12990
+ if (vErrors === null) {
12991
+ vErrors = [err0];
12992
+ } else {
12993
+ vErrors.push(err0);
12994
+ }
12995
+ errors++;
12996
+ } else {
12997
+ const _errs4 = errors;
12998
+ for (const key0 in data) {
12999
+ if (!(key0 === "error")) {
13000
+ const err1 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
13001
+ if (vErrors === null) {
13002
+ vErrors = [err1];
13003
+ } else {
13004
+ vErrors.push(err1);
13005
+ }
13006
+ errors++;
13007
+ break;
13008
+ }
13009
+ }
13010
+ if (_errs4 === errors) {
13011
+ if (data.error !== void 0) {
13012
+ let data0 = data.error;
13013
+ if (typeof data0 !== "string") {
13014
+ const err2 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
13015
+ if (vErrors === null) {
13016
+ vErrors = [err2];
13017
+ } else {
13018
+ vErrors.push(err2);
13019
+ }
13020
+ errors++;
13021
+ }
13022
+ if ("Not found" !== data0) {
13023
+ const err3 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/properties/error/const", keyword: "const", params: { allowedValue: "Not found" }, message: "must be equal to constant" };
13024
+ if (vErrors === null) {
13025
+ vErrors = [err3];
13026
+ } else {
13027
+ vErrors.push(err3);
13028
+ }
13029
+ errors++;
13030
+ }
13031
+ }
13032
+ }
13033
+ }
13034
+ } else {
13035
+ const err4 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" };
13036
+ if (vErrors === null) {
13037
+ vErrors = [err4];
13038
+ } else {
13039
+ vErrors.push(err4);
13040
+ }
13041
+ errors++;
13042
+ }
13043
+ }
13044
+ var _valid0 = _errs2 === errors;
13045
+ valid1 = valid1 || _valid0;
13046
+ if (_valid0) {
13047
+ var props0 = true;
13048
+ }
13049
+ const _errs7 = errors;
13050
+ if (errors === _errs7) {
13051
+ if (data && typeof data == "object" && !Array.isArray(data)) {
13052
+ let missing1;
13053
+ if (data.error === void 0 && (missing1 = "error")) {
13054
+ const err5 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
13055
+ if (vErrors === null) {
13056
+ vErrors = [err5];
13057
+ } else {
13058
+ vErrors.push(err5);
13059
+ }
13060
+ errors++;
13061
+ } else {
13062
+ const _errs9 = errors;
13063
+ for (const key1 in data) {
13064
+ if (!(key1 === "error")) {
13065
+ const err6 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
13066
+ if (vErrors === null) {
13067
+ vErrors = [err6];
13068
+ } else {
13069
+ vErrors.push(err6);
13070
+ }
13071
+ errors++;
13072
+ break;
13073
+ }
13074
+ }
13075
+ if (_errs9 === errors) {
13076
+ if (data.error !== void 0) {
13077
+ let data1 = data.error;
13078
+ if (typeof data1 !== "string") {
13079
+ const err7 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
13080
+ if (vErrors === null) {
13081
+ vErrors = [err7];
13082
+ } else {
13083
+ vErrors.push(err7);
13084
+ }
13085
+ errors++;
13086
+ }
13087
+ if ("connect_device_auth_unavailable" !== data1) {
13088
+ const err8 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/properties/error/const", keyword: "const", params: { allowedValue: "connect_device_auth_unavailable" }, message: "must be equal to constant" };
13089
+ if (vErrors === null) {
13090
+ vErrors = [err8];
13091
+ } else {
13092
+ vErrors.push(err8);
13093
+ }
13094
+ errors++;
13095
+ }
13096
+ }
13097
+ }
13098
+ }
13099
+ } else {
13100
+ const err9 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
13101
+ if (vErrors === null) {
13102
+ vErrors = [err9];
13103
+ } else {
13104
+ vErrors.push(err9);
13105
+ }
13106
+ errors++;
13107
+ }
13108
+ }
13109
+ var _valid0 = _errs7 === errors;
13110
+ valid1 = valid1 || _valid0;
13111
+ if (_valid0) {
13112
+ if (props0 !== true) {
13113
+ props0 = true;
13114
+ }
13115
+ }
13116
+ if (!valid1) {
13117
+ const err10 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationError/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
13118
+ if (vErrors === null) {
13119
+ vErrors = [err10];
13120
+ } else {
13121
+ vErrors.push(err10);
13122
+ }
13123
+ errors++;
13124
+ validate63.errors = vErrors;
13125
+ return false;
13126
+ } else {
13127
+ errors = _errs1;
13128
+ if (vErrors !== null) {
13129
+ if (_errs1) {
13130
+ vErrors.length = _errs1;
13131
+ } else {
13132
+ vErrors = null;
13133
+ }
13134
+ }
13135
+ }
13136
+ validate63.errors = vErrors;
13137
+ evaluated0.props = props0;
13138
+ return errors === 0;
13139
+ }
13140
+ validate63.evaluated = { "dynamicProps": true, "dynamicItems": false };
13141
+ var schema119 = { "type": "object", "properties": { "protocol_version": { "type": "number", "const": 1 }, "issuer": { "type": "string", "format": "uri" }, "client_id": { "type": "string", "maxLength": 256, "pattern": "^client_[A-Za-z0-9_-]+$" }, "default_scopes": { "minItems": 4, "maxItems": 4, "type": "array", "items": { "type": "string", "enum": ["openid", "profile", "email", "offline_access"] } } }, "required": ["protocol_version", "issuer", "client_id", "default_scopes"], "additionalProperties": false, "x-primitive-runtime-refinements": ["canonical_https_origin", "exact_workos_connect_device_scopes"] };
13142
+ var pattern37 = new RegExp("^client_[A-Za-z0-9_-]+$", "u");
13143
+ function validate64(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
13144
+ ;
13145
+ let vErrors = null;
13146
+ let errors = 0;
13147
+ const evaluated0 = validate64.evaluated;
13148
+ if (evaluated0.dynamicProps) {
13149
+ evaluated0.props = void 0;
13150
+ }
13151
+ if (evaluated0.dynamicItems) {
13152
+ evaluated0.items = void 0;
13153
+ }
13154
+ const _errs0 = errors;
13155
+ if (errors === _errs0) {
13156
+ if (data && typeof data == "object" && !Array.isArray(data)) {
13157
+ let missing0;
13158
+ if (data.protocol_version === void 0 && (missing0 = "protocol_version") || data.issuer === void 0 && (missing0 = "issuer") || data.client_id === void 0 && (missing0 = "client_id") || data.default_scopes === void 0 && (missing0 = "default_scopes")) {
13159
+ validate64.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
13160
+ return false;
13161
+ } else {
13162
+ const _errs3 = errors;
13163
+ for (const key0 in data) {
13164
+ if (!(key0 === "protocol_version" || key0 === "issuer" || key0 === "client_id" || key0 === "default_scopes")) {
13165
+ validate64.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
13166
+ return false;
13167
+ break;
13168
+ }
13169
+ }
13170
+ if (_errs3 === errors) {
13171
+ if (data.protocol_version !== void 0) {
13172
+ let data0 = data.protocol_version;
13173
+ const _errs4 = errors;
13174
+ if (!(typeof data0 == "number" && isFinite(data0))) {
13175
+ validate64.errors = [{ instancePath: instancePath + "/protocol_version", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/protocol_version/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
13176
+ return false;
13177
+ }
13178
+ if (1 !== data0) {
13179
+ validate64.errors = [{ instancePath: instancePath + "/protocol_version", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/protocol_version/const", keyword: "const", params: { allowedValue: 1 }, message: "must be equal to constant" }];
13180
+ return false;
13181
+ }
13182
+ var valid1 = _errs4 === errors;
13183
+ } else {
13184
+ var valid1 = true;
13185
+ }
13186
+ if (valid1) {
13187
+ if (data.issuer !== void 0) {
13188
+ const _errs6 = errors;
13189
+ if (errors === _errs6) {
13190
+ if (errors === _errs6) {
13191
+ if (!(typeof data.issuer === "string")) {
13192
+ validate64.errors = [{ instancePath: instancePath + "/issuer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/issuer/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
13193
+ return false;
13194
+ }
13195
+ }
13196
+ }
13197
+ var valid1 = _errs6 === errors;
13198
+ } else {
13199
+ var valid1 = true;
13200
+ }
13201
+ if (valid1) {
13202
+ if (data.client_id !== void 0) {
13203
+ let data2 = data.client_id;
13204
+ const _errs8 = errors;
13205
+ if (errors === _errs8) {
13206
+ if (typeof data2 === "string") {
13207
+ if (func1(data2) > 256) {
13208
+ validate64.errors = [{ instancePath: instancePath + "/client_id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/client_id/maxLength", keyword: "maxLength", params: { limit: 256 }, message: "must NOT have more than 256 characters" }];
13209
+ return false;
13210
+ } else {
13211
+ if (!pattern37.test(data2)) {
13212
+ validate64.errors = [{ instancePath: instancePath + "/client_id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/client_id/pattern", keyword: "pattern", params: { pattern: "^client_[A-Za-z0-9_-]+$" }, message: 'must match pattern "^client_[A-Za-z0-9_-]+$"' }];
13213
+ return false;
13214
+ }
13215
+ }
13216
+ } else {
13217
+ validate64.errors = [{ instancePath: instancePath + "/client_id", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/client_id/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
13218
+ return false;
13219
+ }
13220
+ }
13221
+ var valid1 = _errs8 === errors;
13222
+ } else {
13223
+ var valid1 = true;
13224
+ }
13225
+ if (valid1) {
13226
+ if (data.default_scopes !== void 0) {
13227
+ let data3 = data.default_scopes;
13228
+ const _errs10 = errors;
13229
+ if (errors === _errs10) {
13230
+ if (Array.isArray(data3)) {
13231
+ if (data3.length > 4) {
13232
+ validate64.errors = [{ instancePath: instancePath + "/default_scopes", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/maxItems", keyword: "maxItems", params: { limit: 4 }, message: "must NOT have more than 4 items" }];
13233
+ return false;
13234
+ } else {
13235
+ if (data3.length < 4) {
13236
+ validate64.errors = [{ instancePath: instancePath + "/default_scopes", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/minItems", keyword: "minItems", params: { limit: 4 }, message: "must NOT have fewer than 4 items" }];
13237
+ return false;
13238
+ } else {
13239
+ var valid2 = true;
13240
+ const len0 = data3.length;
13241
+ for (let i0 = 0; i0 < len0; i0++) {
13242
+ let data4 = data3[i0];
13243
+ const _errs12 = errors;
13244
+ if (typeof data4 !== "string") {
13245
+ validate64.errors = [{ instancePath: instancePath + "/default_scopes/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
13246
+ return false;
13247
+ }
13248
+ if (!(data4 === "openid" || data4 === "profile" || data4 === "email" || data4 === "offline_access")) {
13249
+ validate64.errors = [{ instancePath: instancePath + "/default_scopes/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/items/enum", keyword: "enum", params: { allowedValues: schema119.properties.default_scopes.items.enum }, message: "must be equal to one of the allowed values" }];
13250
+ return false;
13251
+ }
13252
+ var valid2 = _errs12 === errors;
13253
+ if (!valid2) {
13254
+ break;
13255
+ }
13256
+ }
13257
+ }
13258
+ }
13259
+ } else {
13260
+ validate64.errors = [{ instancePath: instancePath + "/default_scopes", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/properties/default_scopes/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
13261
+ return false;
13262
+ }
13263
+ }
13264
+ var valid1 = _errs10 === errors;
13265
+ } else {
13266
+ var valid1 = true;
13267
+ }
13268
+ }
13269
+ }
13270
+ }
13271
+ }
13272
+ }
13273
+ } else {
13274
+ validate64.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationSuccess/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
13275
+ return false;
13276
+ }
13277
+ }
13278
+ validate64.errors = vErrors;
13279
+ return errors === 0;
13280
+ }
13281
+ validate64.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
13282
+ function validate65(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
13283
+ ;
13284
+ let vErrors = null;
13285
+ let errors = 0;
13286
+ const evaluated0 = validate65.evaluated;
13287
+ if (evaluated0.dynamicProps) {
13288
+ evaluated0.props = void 0;
13289
+ }
13290
+ if (evaluated0.dynamicItems) {
13291
+ evaluated0.items = void 0;
13292
+ }
13293
+ const _errs0 = errors;
13294
+ if (errors === _errs0) {
13295
+ if (data && typeof data == "object" && !Array.isArray(data)) {
13296
+ let missing0;
13297
+ if (data.error === void 0 && (missing0 = "error")) {
13298
+ validate65.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
13299
+ return false;
13300
+ } else {
13301
+ const _errs2 = errors;
13302
+ for (const key0 in data) {
13303
+ if (!(key0 === "error")) {
13304
+ validate65.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
13305
+ return false;
13306
+ break;
13307
+ }
13308
+ }
13309
+ if (_errs2 === errors) {
13310
+ if (data.error !== void 0) {
13311
+ let data0 = data.error;
13312
+ if (typeof data0 !== "string") {
13313
+ validate65.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
13314
+ return false;
13315
+ }
13316
+ if ("connect_device_auth_unavailable" !== data0) {
13317
+ validate65.errors = [{ instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/properties/error/const", keyword: "const", params: { allowedValue: "connect_device_auth_unavailable" }, message: "must be equal to constant" }];
13318
+ return false;
13319
+ }
13320
+ }
13321
+ }
13322
+ }
13323
+ } else {
13324
+ validate65.errors = [{ instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/WorkosConnectDeviceConfigurationUnavailable/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
13325
+ return false;
13326
+ }
13327
+ }
13328
+ validate65.errors = vErrors;
13329
+ return errors === 0;
13330
+ }
13331
+ validate65.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12921
13332
 
12922
13333
  // src/protocol/decision-lifecycle.ts
12923
13334
  var DECISION_LIFECYCLE_PROTOCOL_VERSION = 2;
@@ -2380,11 +2380,18 @@ function extractCodexFileTargets(toolName, toolInput) {
2380
2380
  if (toolName !== "apply_patch") {
2381
2381
  return null;
2382
2382
  }
2383
- if (!toolInput || typeof toolInput !== "object") {
2384
- return { paths: [], complete: false };
2383
+ const text = codexPatchText(toolInput);
2384
+ return text !== null ? parseApplyPatchTargets(text) : { paths: [], complete: false };
2385
+ }
2386
+ function codexPatchText(toolInput) {
2387
+ if (typeof toolInput === "string") return toolInput;
2388
+ if (!toolInput || typeof toolInput !== "object") return null;
2389
+ const input = toolInput;
2390
+ for (const key of ["command", "input", "patch"]) {
2391
+ const value = input[key];
2392
+ if (typeof value === "string") return value;
2385
2393
  }
2386
- const command = toolInput.command;
2387
- return typeof command === "string" ? parseApplyPatchTargets(command) : { paths: [], complete: false };
2394
+ return null;
2388
2395
  }
2389
2396
  var HERMES_EDITING_TOOLS = /* @__PURE__ */ new Set(["write_file", "patch"]);
2390
2397
  function extractHermesFileTargets(toolName, toolInput) {
@@ -6732,6 +6739,31 @@ function visitRedirect(redirect, state) {
6732
6739
  recordTarget(redirect.target, state);
6733
6740
  else unknown(state);
6734
6741
  }
6742
+ function visitApplyPatch(command, state) {
6743
+ state.mutation = true;
6744
+ state.definiteEdit = true;
6745
+ let hasBody = false;
6746
+ if (command.suffix.length > 0) state.complete = false;
6747
+ for (const redirect of command.redirects) {
6748
+ if (redirect.operator !== "<<") {
6749
+ visitRedirect(redirect, state);
6750
+ continue;
6751
+ }
6752
+ if (typeof redirect.content !== "string") {
6753
+ state.complete = false;
6754
+ continue;
6755
+ }
6756
+ hasBody = true;
6757
+ if (redirect.heredocQuoted !== true && redirect.body !== void 0) {
6758
+ state.complete = false;
6759
+ continue;
6760
+ }
6761
+ const targets = parseApplyPatchTargets(redirect.content);
6762
+ for (const path of targets.paths) state.paths.add(path);
6763
+ if (!targets.complete) state.complete = false;
6764
+ }
6765
+ if (!hasBody) state.complete = false;
6766
+ }
6735
6767
  function operands(words, short = "", long = /* @__PURE__ */ new Set()) {
6736
6768
  const result = [];
6737
6769
  let optionsEnded = false;
@@ -6746,10 +6778,16 @@ function operands(words, short = "", long = /* @__PURE__ */ new Set()) {
6746
6778
  return result;
6747
6779
  }
6748
6780
  function visitCommand(command, state) {
6749
- for (const redirect of command.redirects) visitRedirect(redirect, state);
6750
6781
  const name = staticWord(command.name);
6751
- if (!name || name.includes("/") || command.suffix.some((word) => !staticWord(word))) {
6782
+ const literalApplyPatch = name === "apply_patch" && !command.redirects.some((redirect) => redirect.operator === "<<-");
6783
+ if (literalApplyPatch) {
6784
+ visitApplyPatch(command, state);
6785
+ } else {
6786
+ for (const redirect of command.redirects) visitRedirect(redirect, state);
6787
+ }
6788
+ if (!name || name.includes("/") || !literalApplyPatch && command.suffix.some((word) => !staticWord(word))) {
6752
6789
  unknown(state);
6790
+ } else if (literalApplyPatch) {
6753
6791
  } else if (!READ_ONLY_COMMANDS.has(name) && !knownNoWorktreeMutation(name, staticArgs(command.suffix))) {
6754
6792
  state.mutation = true;
6755
6793
  let targets;
@@ -6802,13 +6840,19 @@ function analyzeShellTargets(source) {
6802
6840
  return { paths: [], coverage: "complete", mutation: "none" };
6803
6841
  try {
6804
6842
  const script = parse(source);
6805
- const state = { paths: /* @__PURE__ */ new Set(), complete: !script.errors?.length, mutation: false };
6843
+ const state = {
6844
+ paths: /* @__PURE__ */ new Set(),
6845
+ complete: !script.errors?.length,
6846
+ mutation: false,
6847
+ definiteEdit: false
6848
+ };
6806
6849
  for (const statement of script.commands) visitStatement(statement, state);
6807
6850
  if (script.errors?.length) state.mutation = true;
6808
6851
  return {
6809
6852
  paths: [...state.paths],
6810
6853
  coverage: state.complete ? "complete" : "unverified",
6811
- mutation: state.mutation ? "present" : "none"
6854
+ mutation: state.mutation ? "present" : "none",
6855
+ ...state.definiteEdit ? { definiteEdit: true } : {}
6812
6856
  };
6813
6857
  } catch {
6814
6858
  return { paths: [], coverage: "unverified", mutation: "present" };
@@ -6835,7 +6879,7 @@ function preserveHookFileMetadata(payload, resolution) {
6835
6879
  return { ...payload, primitive };
6836
6880
  }
6837
6881
  function resolveHookFileRefs(args) {
6838
- const command = (args.agent === "claude_code" || args.agent === "codex") && args.toolName === "Bash" && args.toolInput && typeof args.toolInput === "object" && typeof args.toolInput.command === "string" ? args.toolInput.command : void 0;
6882
+ const command = (args.agent === "claude_code" || args.agent === "codex") && args.toolName === "Bash" ? typeof args.toolInput === "string" ? args.toolInput : args.toolInput && typeof args.toolInput === "object" && typeof args.toolInput.command === "string" ? args.toolInput.command : void 0 : void 0;
6839
6883
  const shell = command === void 0 ? void 0 : analyzeShellTargets(command);
6840
6884
  const shellMutation = shell?.mutation === "none" ? "none" : shell?.coverage === "complete" ? "resolved" : shell ? "unresolved" : void 0;
6841
6885
  const readPath = args.agent === "claude_code" && args.toolName === "Read" && args.toolInput && typeof args.toolInput === "object" && typeof args.toolInput.file_path === "string" ? [args.toolInput.file_path] : void 0;