@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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  analyzeShellTargets,
3
3
  extractFileTargets
4
- } from "./chunk-BQUJ4AFJ.js";
4
+ } from "./chunk-PPQYQEIR.js";
5
5
  import {
6
6
  canonicalRepositoryPath
7
7
  } from "./chunk-TJTVHDJ5.js";
@@ -26,7 +26,7 @@ function preserveHookFileMetadata(payload, resolution) {
26
26
  return { ...payload, primitive };
27
27
  }
28
28
  function resolveHookFileRefs(args) {
29
- 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;
29
+ 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;
30
30
  const shell = command === void 0 ? void 0 : analyzeShellTargets(command);
31
31
  const shellMutation = shell?.mutation === "none" ? "none" : shell?.coverage === "complete" ? "resolved" : shell ? "unresolved" : void 0;
32
32
  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;
@@ -136,11 +136,18 @@ function extractCodexFileTargets(toolName, toolInput) {
136
136
  if (toolName !== "apply_patch") {
137
137
  return null;
138
138
  }
139
- if (!toolInput || typeof toolInput !== "object") {
140
- return { paths: [], complete: false };
139
+ const text = codexPatchText(toolInput);
140
+ return text !== null ? parseApplyPatchTargets(text) : { paths: [], complete: false };
141
+ }
142
+ function codexPatchText(toolInput) {
143
+ if (typeof toolInput === "string") return toolInput;
144
+ if (!toolInput || typeof toolInput !== "object") return null;
145
+ const input = toolInput;
146
+ for (const key of ["command", "input", "patch"]) {
147
+ const value = input[key];
148
+ if (typeof value === "string") return value;
141
149
  }
142
- const command = toolInput.command;
143
- return typeof command === "string" ? parseApplyPatchTargets(command) : { paths: [], complete: false };
150
+ return null;
144
151
  }
145
152
  var HERMES_EDITING_TOOLS = /* @__PURE__ */ new Set(["write_file", "patch"]);
146
153
  function extractHermesFileTargets(toolName, toolInput) {
@@ -674,6 +681,31 @@ function visitRedirect(redirect, state) {
674
681
  recordTarget(redirect.target, state);
675
682
  else unknown(state);
676
683
  }
684
+ function visitApplyPatch(command, state) {
685
+ state.mutation = true;
686
+ state.definiteEdit = true;
687
+ let hasBody = false;
688
+ if (command.suffix.length > 0) state.complete = false;
689
+ for (const redirect of command.redirects) {
690
+ if (redirect.operator !== "<<") {
691
+ visitRedirect(redirect, state);
692
+ continue;
693
+ }
694
+ if (typeof redirect.content !== "string") {
695
+ state.complete = false;
696
+ continue;
697
+ }
698
+ hasBody = true;
699
+ if (redirect.heredocQuoted !== true && redirect.body !== void 0) {
700
+ state.complete = false;
701
+ continue;
702
+ }
703
+ const targets = parseApplyPatchTargets(redirect.content);
704
+ for (const path of targets.paths) state.paths.add(path);
705
+ if (!targets.complete) state.complete = false;
706
+ }
707
+ if (!hasBody) state.complete = false;
708
+ }
677
709
  function operands(words, short = "", long = /* @__PURE__ */ new Set()) {
678
710
  const result = [];
679
711
  let optionsEnded = false;
@@ -688,10 +720,16 @@ function operands(words, short = "", long = /* @__PURE__ */ new Set()) {
688
720
  return result;
689
721
  }
690
722
  function visitCommand(command, state) {
691
- for (const redirect of command.redirects) visitRedirect(redirect, state);
692
723
  const name = staticWord(command.name);
693
- if (!name || name.includes("/") || command.suffix.some((word) => !staticWord(word))) {
724
+ const literalApplyPatch = name === "apply_patch" && !command.redirects.some((redirect) => redirect.operator === "<<-");
725
+ if (literalApplyPatch) {
726
+ visitApplyPatch(command, state);
727
+ } else {
728
+ for (const redirect of command.redirects) visitRedirect(redirect, state);
729
+ }
730
+ if (!name || name.includes("/") || !literalApplyPatch && command.suffix.some((word) => !staticWord(word))) {
694
731
  unknown(state);
732
+ } else if (literalApplyPatch) {
695
733
  } else if (!READ_ONLY_COMMANDS.has(name) && !knownNoWorktreeMutation(name, staticArgs(command.suffix))) {
696
734
  state.mutation = true;
697
735
  let targets;
@@ -744,13 +782,19 @@ function analyzeShellTargets(source) {
744
782
  return { paths: [], coverage: "complete", mutation: "none" };
745
783
  try {
746
784
  const script = parse(source);
747
- const state = { paths: /* @__PURE__ */ new Set(), complete: !script.errors?.length, mutation: false };
785
+ const state = {
786
+ paths: /* @__PURE__ */ new Set(),
787
+ complete: !script.errors?.length,
788
+ mutation: false,
789
+ definiteEdit: false
790
+ };
748
791
  for (const statement of script.commands) visitStatement(statement, state);
749
792
  if (script.errors?.length) state.mutation = true;
750
793
  return {
751
794
  paths: [...state.paths],
752
795
  coverage: state.complete ? "complete" : "unverified",
753
- mutation: state.mutation ? "present" : "none"
796
+ mutation: state.mutation ? "present" : "none",
797
+ ...state.definiteEdit ? { definiteEdit: true } : {}
754
798
  };
755
799
  } catch {
756
800
  return { paths: [], coverage: "unverified", mutation: "present" };
@@ -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;