@primitive.ai/prim 0.1.0-alpha.93 → 0.1.0-alpha.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +57 -12
  2. package/SKILL.md +5 -2
  3. package/dist/{chunk-UKUAAAXE.js → chunk-27ADT6FQ.js} +2 -2
  4. package/dist/{chunk-OTHKG76J.js → chunk-35FMRWJH.js} +1 -1
  5. package/dist/{chunk-DXJQR4QI.js → chunk-4GHANPWQ.js} +2 -2
  6. package/dist/{chunk-DCJN6LZH.js → chunk-7KABYYWG.js} +747 -430
  7. package/dist/{chunk-LFFLHSQO.js → chunk-CU7RW7XU.js} +63 -6
  8. package/dist/{chunk-H4UNYFUC.js → chunk-DHOQGHKQ.js} +184 -1
  9. package/dist/{chunk-2GP5UFV7.js → chunk-DWRSEC34.js} +5 -3
  10. package/dist/{chunk-36TWVNBE.js → chunk-FVDBULGZ.js} +9 -11
  11. package/dist/{chunk-G2VMA2QO.js → chunk-LY6NJ7KL.js} +6 -4
  12. package/dist/{chunk-ZB4F75SZ.js → chunk-MXVCP33E.js} +5 -1
  13. package/dist/{chunk-TYAHC25F.js → chunk-QCBB5HFX.js} +1 -1
  14. package/dist/{chunk-C3VAA5CG.js → chunk-RK4ZS3HG.js} +2 -2
  15. package/dist/{chunk-ZU563PQI.js → chunk-ROLYLXJS.js} +2 -2
  16. package/dist/{chunk-OH3EZXYX.js → chunk-UO2U6IKF.js} +1 -1
  17. package/dist/{chunk-K7D2EYBS.js → chunk-URLLSALP.js} +2 -2
  18. package/dist/chunk-XEDJ5N3M.js +177 -0
  19. package/dist/{chunk-X64HTHUF.js → chunk-Y5W4TZM7.js} +202 -10
  20. package/dist/{chunk-ICM2XCXS.js → chunk-YYE2NLWX.js} +2 -2
  21. package/dist/{chunk-DSWT6BCC.js → chunk-Z6NPNLOT.js} +825 -665
  22. package/dist/daemon/server.js +836 -540
  23. package/dist/hook-runtime/daemon/server.js +836 -540
  24. package/dist/hook-runtime/hooks/post-commit.js +978 -566
  25. package/dist/hook-runtime/hooks/post-rewrite.js +836 -540
  26. package/dist/hook-runtime/hooks/post-tool-use.js +1215 -796
  27. package/dist/hook-runtime/hooks/pre-tool-use.js +2100 -1741
  28. package/dist/hook-runtime/hooks/prim-hook.js +1312 -861
  29. package/dist/hook-runtime/hooks/session-end.js +232 -134
  30. package/dist/hook-runtime/hooks/session-start.js +1799 -935
  31. package/dist/hook-runtime/index.js +3628 -2461
  32. package/dist/hooks/post-commit.js +14 -10
  33. package/dist/hooks/post-rewrite.js +10 -10
  34. package/dist/hooks/post-tool-use.js +20 -20
  35. package/dist/hooks/pre-commit.js +4 -4
  36. package/dist/hooks/pre-tool-use.js +29 -17
  37. package/dist/hooks/prim-hook.js +22 -18
  38. package/dist/hooks/session-end.js +11 -5
  39. package/dist/hooks/session-start.js +46 -28
  40. package/dist/index.js +623 -390
  41. package/package.json +1 -1
@@ -499,6 +499,31 @@ function canonicalGitRoot(cwd) {
499
499
  return null;
500
500
  }
501
501
  }
502
+ function relatedWorktreeTarget(path, cwd, origin) {
503
+ let parent = dirname2(resolve(cwd, path));
504
+ while (true) {
505
+ try {
506
+ realpathSync.native(parent);
507
+ break;
508
+ } catch {
509
+ const next = dirname2(parent);
510
+ if (next === parent) return null;
511
+ parent = next;
512
+ }
513
+ }
514
+ const target = resolveRepositoryContext(parent);
515
+ if (!target || !target.repoKey || target.repoKey !== origin.repoKey) return null;
516
+ const common = (root) => {
517
+ const value = gitValue(root, ["rev-parse", "--git-common-dir"]);
518
+ try {
519
+ return value ? realpathSync.native(resolve(root, value)) : void 0;
520
+ } catch {
521
+ return void 0;
522
+ }
523
+ };
524
+ const originCommon = common(origin.repoRoot);
525
+ return originCommon && originCommon === common(target.repoRoot) ? target : null;
526
+ }
502
527
  function normalizeOriginRemote(remote) {
503
528
  const value = remote.trim();
504
529
  if (!value) return void 0;
@@ -12514,7 +12539,6 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
12514
12539
  return errors === 0;
12515
12540
  }
12516
12541
  validate45.evaluated = { "dynamicProps": true, "dynamicItems": false };
12517
- var schema83 = { "anyOf": [{ "type": "object", "properties": { "error": { "type": "string", "const": "Unauthorized" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "interactive_workos_authority_required" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "feature_disabled" }, "feature": { "type": "string", "const": "github-connect" } }, "required": ["error", "feature"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "enum": ["github_connect_unavailable", "feature_check_unavailable"] }, "feature": { "type": "string", "const": "github-connect" } }, "required": ["error", "feature"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "WorkOS identity authority is temporarily unavailable" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "github_install_intent_conflict" } }, "required": ["error"], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "github_install_intent_rate_limited" }, "retryAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": ["error", "retryAt"], "additionalProperties": false }] };
12518
12542
  function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
12519
12543
  ;
12520
12544
  let vErrors = null;
@@ -12664,7 +12688,7 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12664
12688
  if (errors === _errs12) {
12665
12689
  if (data && typeof data == "object" && !Array.isArray(data)) {
12666
12690
  let missing2;
12667
- if (data.error === void 0 && (missing2 = "error") || data.feature === void 0 && (missing2 = "feature")) {
12691
+ if (data.error === void 0 && (missing2 = "error")) {
12668
12692
  const err10 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" };
12669
12693
  if (vErrors === null) {
12670
12694
  vErrors = [err10];
@@ -12675,7 +12699,7 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12675
12699
  } else {
12676
12700
  const _errs14 = errors;
12677
12701
  for (const key2 in data) {
12678
- if (!(key2 === "error" || key2 === "feature")) {
12702
+ if (!(key2 === "error")) {
12679
12703
  const err11 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
12680
12704
  if (vErrors === null) {
12681
12705
  vErrors = [err11];
@@ -12689,7 +12713,6 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12689
12713
  if (_errs14 === errors) {
12690
12714
  if (data.error !== void 0) {
12691
12715
  let data2 = data.error;
12692
- const _errs15 = errors;
12693
12716
  if (typeof data2 !== "string") {
12694
12717
  const err12 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12695
12718
  if (vErrors === null) {
@@ -12699,8 +12722,8 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12699
12722
  }
12700
12723
  errors++;
12701
12724
  }
12702
- if ("feature_disabled" !== data2) {
12703
- const err13 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/properties/error/const", keyword: "const", params: { allowedValue: "feature_disabled" }, message: "must be equal to constant" };
12725
+ if ("github_connect_unavailable" !== data2) {
12726
+ const err13 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/properties/error/const", keyword: "const", params: { allowedValue: "github_connect_unavailable" }, message: "must be equal to constant" };
12704
12727
  if (vErrors === null) {
12705
12728
  vErrors = [err13];
12706
12729
  } else {
@@ -12708,45 +12731,15 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12708
12731
  }
12709
12732
  errors++;
12710
12733
  }
12711
- var valid4 = _errs15 === errors;
12712
- } else {
12713
- var valid4 = true;
12714
- }
12715
- if (valid4) {
12716
- if (data.feature !== void 0) {
12717
- let data3 = data.feature;
12718
- const _errs17 = errors;
12719
- if (typeof data3 !== "string") {
12720
- const err14 = { instancePath: instancePath + "/feature", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/properties/feature/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12721
- if (vErrors === null) {
12722
- vErrors = [err14];
12723
- } else {
12724
- vErrors.push(err14);
12725
- }
12726
- errors++;
12727
- }
12728
- if ("github-connect" !== data3) {
12729
- const err15 = { instancePath: instancePath + "/feature", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/properties/feature/const", keyword: "const", params: { allowedValue: "github-connect" }, message: "must be equal to constant" };
12730
- if (vErrors === null) {
12731
- vErrors = [err15];
12732
- } else {
12733
- vErrors.push(err15);
12734
- }
12735
- errors++;
12736
- }
12737
- var valid4 = _errs17 === errors;
12738
- } else {
12739
- var valid4 = true;
12740
- }
12741
12734
  }
12742
12735
  }
12743
12736
  }
12744
12737
  } else {
12745
- const err16 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12738
+ const err14 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/2/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12746
12739
  if (vErrors === null) {
12747
- vErrors = [err16];
12740
+ vErrors = [err14];
12748
12741
  } else {
12749
- vErrors.push(err16);
12742
+ vErrors.push(err14);
12750
12743
  }
12751
12744
  errors++;
12752
12745
  }
@@ -12758,148 +12751,117 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12758
12751
  props0 = true;
12759
12752
  }
12760
12753
  }
12761
- const _errs19 = errors;
12762
- if (errors === _errs19) {
12754
+ const _errs17 = errors;
12755
+ if (errors === _errs17) {
12763
12756
  if (data && typeof data == "object" && !Array.isArray(data)) {
12764
12757
  let missing3;
12765
- if (data.error === void 0 && (missing3 = "error") || data.feature === void 0 && (missing3 = "feature")) {
12766
- const err17 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" };
12758
+ if (data.error === void 0 && (missing3 = "error")) {
12759
+ const err15 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" };
12767
12760
  if (vErrors === null) {
12768
- vErrors = [err17];
12761
+ vErrors = [err15];
12769
12762
  } else {
12770
- vErrors.push(err17);
12763
+ vErrors.push(err15);
12771
12764
  }
12772
12765
  errors++;
12773
12766
  } else {
12774
- const _errs21 = errors;
12767
+ const _errs19 = errors;
12775
12768
  for (const key3 in data) {
12776
- if (!(key3 === "error" || key3 === "feature")) {
12777
- const err18 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
12769
+ if (!(key3 === "error")) {
12770
+ const err16 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
12778
12771
  if (vErrors === null) {
12779
- vErrors = [err18];
12772
+ vErrors = [err16];
12780
12773
  } else {
12781
- vErrors.push(err18);
12774
+ vErrors.push(err16);
12782
12775
  }
12783
12776
  errors++;
12784
12777
  break;
12785
12778
  }
12786
12779
  }
12787
- if (_errs21 === errors) {
12780
+ if (_errs19 === errors) {
12788
12781
  if (data.error !== void 0) {
12789
- let data4 = data.error;
12790
- const _errs22 = errors;
12791
- if (typeof data4 !== "string") {
12792
- const err19 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12782
+ let data3 = data.error;
12783
+ if (typeof data3 !== "string") {
12784
+ const err17 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12793
12785
  if (vErrors === null) {
12794
- vErrors = [err19];
12786
+ vErrors = [err17];
12795
12787
  } else {
12796
- vErrors.push(err19);
12788
+ vErrors.push(err17);
12797
12789
  }
12798
12790
  errors++;
12799
12791
  }
12800
- if (!(data4 === "github_connect_unavailable" || data4 === "feature_check_unavailable")) {
12801
- const err20 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/properties/error/enum", keyword: "enum", params: { allowedValues: schema83.anyOf[3].properties.error.enum }, message: "must be equal to one of the allowed values" };
12792
+ if ("WorkOS identity authority is temporarily unavailable" !== data3) {
12793
+ const err18 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/properties/error/const", keyword: "const", params: { allowedValue: "WorkOS identity authority is temporarily unavailable" }, message: "must be equal to constant" };
12802
12794
  if (vErrors === null) {
12803
- vErrors = [err20];
12795
+ vErrors = [err18];
12804
12796
  } else {
12805
- vErrors.push(err20);
12797
+ vErrors.push(err18);
12806
12798
  }
12807
12799
  errors++;
12808
12800
  }
12809
- var valid5 = _errs22 === errors;
12810
- } else {
12811
- var valid5 = true;
12812
- }
12813
- if (valid5) {
12814
- if (data.feature !== void 0) {
12815
- let data5 = data.feature;
12816
- const _errs24 = errors;
12817
- if (typeof data5 !== "string") {
12818
- const err21 = { instancePath: instancePath + "/feature", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/properties/feature/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12819
- if (vErrors === null) {
12820
- vErrors = [err21];
12821
- } else {
12822
- vErrors.push(err21);
12823
- }
12824
- errors++;
12825
- }
12826
- if ("github-connect" !== data5) {
12827
- const err22 = { instancePath: instancePath + "/feature", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/properties/feature/const", keyword: "const", params: { allowedValue: "github-connect" }, message: "must be equal to constant" };
12828
- if (vErrors === null) {
12829
- vErrors = [err22];
12830
- } else {
12831
- vErrors.push(err22);
12832
- }
12833
- errors++;
12834
- }
12835
- var valid5 = _errs24 === errors;
12836
- } else {
12837
- var valid5 = true;
12838
- }
12839
12801
  }
12840
12802
  }
12841
12803
  }
12842
12804
  } else {
12843
- const err23 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12805
+ const err19 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/3/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12844
12806
  if (vErrors === null) {
12845
- vErrors = [err23];
12807
+ vErrors = [err19];
12846
12808
  } else {
12847
- vErrors.push(err23);
12809
+ vErrors.push(err19);
12848
12810
  }
12849
12811
  errors++;
12850
12812
  }
12851
12813
  }
12852
- var _valid0 = _errs19 === errors;
12814
+ var _valid0 = _errs17 === errors;
12853
12815
  valid1 = valid1 || _valid0;
12854
12816
  if (_valid0) {
12855
12817
  if (props0 !== true) {
12856
12818
  props0 = true;
12857
12819
  }
12858
12820
  }
12859
- const _errs26 = errors;
12860
- if (errors === _errs26) {
12821
+ const _errs22 = errors;
12822
+ if (errors === _errs22) {
12861
12823
  if (data && typeof data == "object" && !Array.isArray(data)) {
12862
12824
  let missing4;
12863
12825
  if (data.error === void 0 && (missing4 = "error")) {
12864
- const err24 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" };
12826
+ const err20 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" };
12865
12827
  if (vErrors === null) {
12866
- vErrors = [err24];
12828
+ vErrors = [err20];
12867
12829
  } else {
12868
- vErrors.push(err24);
12830
+ vErrors.push(err20);
12869
12831
  }
12870
12832
  errors++;
12871
12833
  } else {
12872
- const _errs28 = errors;
12834
+ const _errs24 = errors;
12873
12835
  for (const key4 in data) {
12874
12836
  if (!(key4 === "error")) {
12875
- const err25 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" };
12837
+ const err21 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" };
12876
12838
  if (vErrors === null) {
12877
- vErrors = [err25];
12839
+ vErrors = [err21];
12878
12840
  } else {
12879
- vErrors.push(err25);
12841
+ vErrors.push(err21);
12880
12842
  }
12881
12843
  errors++;
12882
12844
  break;
12883
12845
  }
12884
12846
  }
12885
- if (_errs28 === errors) {
12847
+ if (_errs24 === errors) {
12886
12848
  if (data.error !== void 0) {
12887
- let data6 = data.error;
12888
- if (typeof data6 !== "string") {
12889
- const err26 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12849
+ let data4 = data.error;
12850
+ if (typeof data4 !== "string") {
12851
+ const err22 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12890
12852
  if (vErrors === null) {
12891
- vErrors = [err26];
12853
+ vErrors = [err22];
12892
12854
  } else {
12893
- vErrors.push(err26);
12855
+ vErrors.push(err22);
12894
12856
  }
12895
12857
  errors++;
12896
12858
  }
12897
- if ("WorkOS identity authority is temporarily unavailable" !== data6) {
12898
- const err27 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/properties/error/const", keyword: "const", params: { allowedValue: "WorkOS identity authority is temporarily unavailable" }, message: "must be equal to constant" };
12859
+ if ("github_install_intent_conflict" !== data4) {
12860
+ const err23 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_conflict" }, message: "must be equal to constant" };
12899
12861
  if (vErrors === null) {
12900
- vErrors = [err27];
12862
+ vErrors = [err23];
12901
12863
  } else {
12902
- vErrors.push(err27);
12864
+ vErrors.push(err23);
12903
12865
  }
12904
12866
  errors++;
12905
12867
  }
@@ -12907,195 +12869,128 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
12907
12869
  }
12908
12870
  }
12909
12871
  } else {
12910
- const err28 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12872
+ const err24 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/4/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12911
12873
  if (vErrors === null) {
12912
- vErrors = [err28];
12874
+ vErrors = [err24];
12913
12875
  } else {
12914
- vErrors.push(err28);
12876
+ vErrors.push(err24);
12915
12877
  }
12916
12878
  errors++;
12917
12879
  }
12918
12880
  }
12919
- var _valid0 = _errs26 === errors;
12881
+ var _valid0 = _errs22 === errors;
12920
12882
  valid1 = valid1 || _valid0;
12921
12883
  if (_valid0) {
12922
12884
  if (props0 !== true) {
12923
12885
  props0 = true;
12924
12886
  }
12925
12887
  }
12926
- const _errs31 = errors;
12927
- if (errors === _errs31) {
12888
+ const _errs27 = errors;
12889
+ if (errors === _errs27) {
12928
12890
  if (data && typeof data == "object" && !Array.isArray(data)) {
12929
12891
  let missing5;
12930
- if (data.error === void 0 && (missing5 = "error")) {
12931
- const err29 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" };
12892
+ if (data.error === void 0 && (missing5 = "error") || data.retryAt === void 0 && (missing5 = "retryAt")) {
12893
+ const err25 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" };
12932
12894
  if (vErrors === null) {
12933
- vErrors = [err29];
12895
+ vErrors = [err25];
12934
12896
  } else {
12935
- vErrors.push(err29);
12897
+ vErrors.push(err25);
12936
12898
  }
12937
12899
  errors++;
12938
12900
  } else {
12939
- const _errs33 = errors;
12901
+ const _errs29 = errors;
12940
12902
  for (const key5 in data) {
12941
- if (!(key5 === "error")) {
12942
- const err30 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
12943
- if (vErrors === null) {
12944
- vErrors = [err30];
12945
- } else {
12946
- vErrors.push(err30);
12947
- }
12948
- errors++;
12949
- break;
12950
- }
12951
- }
12952
- if (_errs33 === errors) {
12953
- if (data.error !== void 0) {
12954
- let data7 = data.error;
12955
- if (typeof data7 !== "string") {
12956
- const err31 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12957
- if (vErrors === null) {
12958
- vErrors = [err31];
12959
- } else {
12960
- vErrors.push(err31);
12961
- }
12962
- errors++;
12963
- }
12964
- if ("github_install_intent_conflict" !== data7) {
12965
- const err32 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_conflict" }, message: "must be equal to constant" };
12966
- if (vErrors === null) {
12967
- vErrors = [err32];
12968
- } else {
12969
- vErrors.push(err32);
12970
- }
12971
- errors++;
12972
- }
12973
- }
12974
- }
12975
- }
12976
- } else {
12977
- const err33 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12978
- if (vErrors === null) {
12979
- vErrors = [err33];
12980
- } else {
12981
- vErrors.push(err33);
12982
- }
12983
- errors++;
12984
- }
12985
- }
12986
- var _valid0 = _errs31 === errors;
12987
- valid1 = valid1 || _valid0;
12988
- if (_valid0) {
12989
- if (props0 !== true) {
12990
- props0 = true;
12991
- }
12992
- }
12993
- const _errs36 = errors;
12994
- if (errors === _errs36) {
12995
- if (data && typeof data == "object" && !Array.isArray(data)) {
12996
- let missing6;
12997
- if (data.error === void 0 && (missing6 = "error") || data.retryAt === void 0 && (missing6 = "retryAt")) {
12998
- const err34 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" };
12999
- if (vErrors === null) {
13000
- vErrors = [err34];
13001
- } else {
13002
- vErrors.push(err34);
13003
- }
13004
- errors++;
13005
- } else {
13006
- const _errs38 = errors;
13007
- for (const key6 in data) {
13008
- if (!(key6 === "error" || key6 === "retryAt")) {
13009
- const err35 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key6 }, message: "must NOT have additional properties" };
12903
+ if (!(key5 === "error" || key5 === "retryAt")) {
12904
+ const err26 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
13010
12905
  if (vErrors === null) {
13011
- vErrors = [err35];
12906
+ vErrors = [err26];
13012
12907
  } else {
13013
- vErrors.push(err35);
12908
+ vErrors.push(err26);
13014
12909
  }
13015
12910
  errors++;
13016
12911
  break;
13017
12912
  }
13018
12913
  }
13019
- if (_errs38 === errors) {
12914
+ if (_errs29 === errors) {
13020
12915
  if (data.error !== void 0) {
13021
- let data8 = data.error;
13022
- const _errs39 = errors;
13023
- if (typeof data8 !== "string") {
13024
- const err36 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
12916
+ let data5 = data.error;
12917
+ const _errs30 = errors;
12918
+ if (typeof data5 !== "string") {
12919
+ const err27 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/error/type", keyword: "type", params: { type: "string" }, message: "must be string" };
13025
12920
  if (vErrors === null) {
13026
- vErrors = [err36];
12921
+ vErrors = [err27];
13027
12922
  } else {
13028
- vErrors.push(err36);
12923
+ vErrors.push(err27);
13029
12924
  }
13030
12925
  errors++;
13031
12926
  }
13032
- if ("github_install_intent_rate_limited" !== data8) {
13033
- const err37 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_rate_limited" }, message: "must be equal to constant" };
12927
+ if ("github_install_intent_rate_limited" !== data5) {
12928
+ const err28 = { instancePath: instancePath + "/error", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/error/const", keyword: "const", params: { allowedValue: "github_install_intent_rate_limited" }, message: "must be equal to constant" };
13034
12929
  if (vErrors === null) {
13035
- vErrors = [err37];
12930
+ vErrors = [err28];
13036
12931
  } else {
13037
- vErrors.push(err37);
12932
+ vErrors.push(err28);
13038
12933
  }
13039
12934
  errors++;
13040
12935
  }
13041
- var valid8 = _errs39 === errors;
12936
+ var valid7 = _errs30 === errors;
13042
12937
  } else {
13043
- var valid8 = true;
12938
+ var valid7 = true;
13044
12939
  }
13045
- if (valid8) {
12940
+ if (valid7) {
13046
12941
  if (data.retryAt !== void 0) {
13047
- let data9 = data.retryAt;
13048
- const _errs41 = errors;
13049
- if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
13050
- const err38 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/retryAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
12942
+ let data6 = data.retryAt;
12943
+ const _errs32 = errors;
12944
+ if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6)) && isFinite(data6))) {
12945
+ const err29 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/retryAt/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
13051
12946
  if (vErrors === null) {
13052
- vErrors = [err38];
12947
+ vErrors = [err29];
13053
12948
  } else {
13054
- vErrors.push(err38);
12949
+ vErrors.push(err29);
13055
12950
  }
13056
12951
  errors++;
13057
12952
  }
13058
- if (errors === _errs41) {
13059
- if (typeof data9 == "number" && isFinite(data9)) {
13060
- if (data9 > 9007199254740991 || isNaN(data9)) {
13061
- const err39 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/retryAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
12953
+ if (errors === _errs32) {
12954
+ if (typeof data6 == "number" && isFinite(data6)) {
12955
+ if (data6 > 9007199254740991 || isNaN(data6)) {
12956
+ const err30 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/retryAt/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
13062
12957
  if (vErrors === null) {
13063
- vErrors = [err39];
12958
+ vErrors = [err30];
13064
12959
  } else {
13065
- vErrors.push(err39);
12960
+ vErrors.push(err30);
13066
12961
  }
13067
12962
  errors++;
13068
12963
  } else {
13069
- if (data9 < 0 || isNaN(data9)) {
13070
- const err40 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/properties/retryAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
12964
+ if (data6 < 0 || isNaN(data6)) {
12965
+ const err31 = { instancePath: instancePath + "/retryAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/properties/retryAt/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
13071
12966
  if (vErrors === null) {
13072
- vErrors = [err40];
12967
+ vErrors = [err31];
13073
12968
  } else {
13074
- vErrors.push(err40);
12969
+ vErrors.push(err31);
13075
12970
  }
13076
12971
  errors++;
13077
12972
  }
13078
12973
  }
13079
12974
  }
13080
12975
  }
13081
- var valid8 = _errs41 === errors;
12976
+ var valid7 = _errs32 === errors;
13082
12977
  } else {
13083
- var valid8 = true;
12978
+ var valid7 = true;
13084
12979
  }
13085
12980
  }
13086
12981
  }
13087
12982
  }
13088
12983
  } else {
13089
- const err41 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/6/type", keyword: "type", params: { type: "object" }, message: "must be object" };
12984
+ const err32 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf/5/type", keyword: "type", params: { type: "object" }, message: "must be object" };
13090
12985
  if (vErrors === null) {
13091
- vErrors = [err41];
12986
+ vErrors = [err32];
13092
12987
  } else {
13093
- vErrors.push(err41);
12988
+ vErrors.push(err32);
13094
12989
  }
13095
12990
  errors++;
13096
12991
  }
13097
12992
  }
13098
- var _valid0 = _errs36 === errors;
12993
+ var _valid0 = _errs27 === errors;
13099
12994
  valid1 = valid1 || _valid0;
13100
12995
  if (_valid0) {
13101
12996
  if (props0 !== true) {
@@ -13103,11 +12998,11 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
13103
12998
  }
13104
12999
  }
13105
13000
  if (!valid1) {
13106
- const err42 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
13001
+ const err33 = { instancePath, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/GitHubInstallIntentStartErrorResponse/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
13107
13002
  if (vErrors === null) {
13108
- vErrors = [err42];
13003
+ vErrors = [err33];
13109
13004
  } else {
13110
- vErrors.push(err42);
13005
+ vErrors.push(err33);
13111
13006
  }
13112
13007
  errors++;
13113
13008
  validate46.errors = vErrors;
@@ -15209,7 +15104,7 @@ function validate50(data, { instancePath = "", parentData, parentDataProperty, r
15209
15104
  return errors === 0;
15210
15105
  }
15211
15106
  validate50.evaluated = { "dynamicProps": true, "dynamicItems": false };
15212
- var schema93 = { "type": "object", "properties": { "batch": { "type": "array", "items": { "anyOf": [{ "type": "object", "properties": { "moveId": { "type": "string" }, "capturedAt": { "type": "number" }, "sessionId": { "type": "string" }, "invocationId": { "type": "string" }, "eventType": { "type": "string" }, "payload": {}, "env": {}, "capturedOrganizationId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9_-]+$" }, "captureAuthorityKind": { "type": "string", "enum": ["workos", "service_token"] }, "decisionLifecycleProtocolVersion": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "producer": { "type": "string", "enum": ["claude_code", "codex", "cursor", "hermes"] }, "toolOutcome": { "type": "string", "enum": ["succeeded", "returned", "failed", "interrupted", "prevented", "unknown"] }, "envelopeVersion": { "type": "number", "const": 4 } }, "required": ["moveId", "capturedAt", "sessionId", "eventType", "capturedOrganizationId", "captureAuthorityKind", "decisionLifecycleProtocolVersion", "envelopeVersion"], "additionalProperties": {} }, { "type": "object", "properties": { "moveId": { "type": "string" }, "capturedAt": { "type": "number" }, "sessionId": { "type": "string" }, "invocationId": { "type": "string" }, "eventType": { "type": "string" }, "payload": {}, "env": {}, "capturedOrganizationId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9_-]+$" }, "captureAuthorityKind": { "type": "string", "enum": ["workos", "service_token"] }, "decisionLifecycleProtocolVersion": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "producer": { "type": "string", "enum": ["claude_code", "codex", "cursor", "hermes"] }, "toolOutcome": { "type": "string", "enum": ["succeeded", "returned", "failed", "interrupted", "prevented", "unknown"] }, "envelopeVersion": { "type": "number", "exclusiveMaximum": 4 } }, "required": ["moveId", "capturedAt", "sessionId", "eventType"], "additionalProperties": {} }] } } }, "required": ["batch"], "additionalProperties": {} };
15107
+ var schema93 = { "type": "object", "properties": { "batch": { "type": "array", "items": { "anyOf": [{ "type": "object", "properties": { "moveId": { "type": "string" }, "capturedAt": { "type": "number" }, "sessionId": { "type": "string" }, "invocationId": { "type": "string" }, "eventType": { "type": "string" }, "payload": {}, "env": {}, "repositoryContext": { "oneOf": [{ "type": "object", "properties": { "kind": { "type": "string", "const": "repository_bound" }, "repoSyncId": { "type": "string", "minLength": 1, "maxLength": 128 } }, "required": ["kind", "repoSyncId"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "non_repository" } }, "required": ["kind"], "additionalProperties": false }] }, "capturedOrganizationId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9_-]+$" }, "captureAuthorityKind": { "type": "string", "enum": ["workos", "service_token"] }, "decisionLifecycleProtocolVersion": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "producer": { "type": "string", "enum": ["claude_code", "codex", "cursor", "hermes"] }, "toolOutcome": { "type": "string", "enum": ["succeeded", "returned", "failed", "interrupted", "prevented", "unknown"] }, "envelopeVersion": { "type": "number", "const": 4 } }, "required": ["moveId", "capturedAt", "sessionId", "eventType", "capturedOrganizationId", "captureAuthorityKind", "decisionLifecycleProtocolVersion", "envelopeVersion"], "additionalProperties": {} }, { "type": "object", "properties": { "moveId": { "type": "string" }, "capturedAt": { "type": "number" }, "sessionId": { "type": "string" }, "invocationId": { "type": "string" }, "eventType": { "type": "string" }, "payload": {}, "env": {}, "repositoryContext": { "oneOf": [{ "type": "object", "properties": { "kind": { "type": "string", "const": "repository_bound" }, "repoSyncId": { "type": "string", "minLength": 1, "maxLength": 128 } }, "required": ["kind", "repoSyncId"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "non_repository" } }, "required": ["kind"], "additionalProperties": false }] }, "capturedOrganizationId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9_-]+$" }, "captureAuthorityKind": { "type": "string", "enum": ["workos", "service_token"] }, "decisionLifecycleProtocolVersion": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "producer": { "type": "string", "enum": ["claude_code", "codex", "cursor", "hermes"] }, "toolOutcome": { "type": "string", "enum": ["succeeded", "returned", "failed", "interrupted", "prevented", "unknown"] }, "envelopeVersion": { "type": "number", "exclusiveMaximum": 4 } }, "required": ["moveId", "capturedAt", "sessionId", "eventType"], "additionalProperties": {} }] } } }, "required": ["batch"], "additionalProperties": {} };
15213
15108
  var pattern8 = new RegExp("^[A-Za-z0-9_-]+$", "u");
15214
15109
  function validate51(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
15215
15110
  ;
@@ -15336,13 +15231,18 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
15336
15231
  var valid4 = true;
15337
15232
  }
15338
15233
  if (valid4) {
15339
- if (data1.capturedOrganizationId !== void 0) {
15340
- let data7 = data1.capturedOrganizationId;
15234
+ if (data1.repositoryContext !== void 0) {
15235
+ let data7 = data1.repositoryContext;
15341
15236
  const _errs20 = errors;
15342
- if (errors === _errs20) {
15343
- if (typeof data7 === "string") {
15344
- if (func1(data7) > 128) {
15345
- const err6 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" };
15237
+ const _errs21 = errors;
15238
+ let valid5 = false;
15239
+ let passing0 = null;
15240
+ const _errs22 = errors;
15241
+ if (errors === _errs22) {
15242
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
15243
+ let missing2;
15244
+ if (data7.kind === void 0 && (missing2 = "kind") || data7.repoSyncId === void 0 && (missing2 = "repoSyncId")) {
15245
+ const err6 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" };
15346
15246
  if (vErrors === null) {
15347
15247
  vErrors = [err6];
15348
15248
  } else {
@@ -15350,184 +15250,392 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
15350
15250
  }
15351
15251
  errors++;
15352
15252
  } else {
15353
- if (func1(data7) < 1) {
15354
- const err7 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
15355
- if (vErrors === null) {
15356
- vErrors = [err7];
15357
- } else {
15358
- vErrors.push(err7);
15359
- }
15360
- errors++;
15361
- } else {
15362
- if (!pattern8.test(data7)) {
15363
- const err8 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: 'must match pattern "^[A-Za-z0-9_-]+$"' };
15253
+ const _errs24 = errors;
15254
+ for (const key0 in data7) {
15255
+ if (!(key0 === "kind" || key0 === "repoSyncId")) {
15256
+ const err7 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
15364
15257
  if (vErrors === null) {
15365
- vErrors = [err8];
15258
+ vErrors = [err7];
15366
15259
  } else {
15367
- vErrors.push(err8);
15260
+ vErrors.push(err7);
15368
15261
  }
15369
15262
  errors++;
15263
+ break;
15264
+ }
15265
+ }
15266
+ if (_errs24 === errors) {
15267
+ if (data7.kind !== void 0) {
15268
+ let data8 = data7.kind;
15269
+ const _errs25 = errors;
15270
+ if (typeof data8 !== "string") {
15271
+ const err8 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15272
+ if (vErrors === null) {
15273
+ vErrors = [err8];
15274
+ } else {
15275
+ vErrors.push(err8);
15276
+ }
15277
+ errors++;
15278
+ }
15279
+ if ("repository_bound" !== data8) {
15280
+ const err9 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/properties/kind/const", keyword: "const", params: { allowedValue: "repository_bound" }, message: "must be equal to constant" };
15281
+ if (vErrors === null) {
15282
+ vErrors = [err9];
15283
+ } else {
15284
+ vErrors.push(err9);
15285
+ }
15286
+ errors++;
15287
+ }
15288
+ var valid6 = _errs25 === errors;
15289
+ } else {
15290
+ var valid6 = true;
15291
+ }
15292
+ if (valid6) {
15293
+ if (data7.repoSyncId !== void 0) {
15294
+ let data9 = data7.repoSyncId;
15295
+ const _errs27 = errors;
15296
+ if (errors === _errs27) {
15297
+ if (typeof data9 === "string") {
15298
+ if (func1(data9) > 128) {
15299
+ const err10 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/repoSyncId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/properties/repoSyncId/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" };
15300
+ if (vErrors === null) {
15301
+ vErrors = [err10];
15302
+ } else {
15303
+ vErrors.push(err10);
15304
+ }
15305
+ errors++;
15306
+ } else {
15307
+ if (func1(data9) < 1) {
15308
+ const err11 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/repoSyncId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/properties/repoSyncId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
15309
+ if (vErrors === null) {
15310
+ vErrors = [err11];
15311
+ } else {
15312
+ vErrors.push(err11);
15313
+ }
15314
+ errors++;
15315
+ }
15316
+ }
15317
+ } else {
15318
+ const err12 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/repoSyncId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/properties/repoSyncId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15319
+ if (vErrors === null) {
15320
+ vErrors = [err12];
15321
+ } else {
15322
+ vErrors.push(err12);
15323
+ }
15324
+ errors++;
15325
+ }
15326
+ }
15327
+ var valid6 = _errs27 === errors;
15328
+ } else {
15329
+ var valid6 = true;
15330
+ }
15370
15331
  }
15371
15332
  }
15372
15333
  }
15373
15334
  } else {
15374
- const err9 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15335
+ const err13 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15375
15336
  if (vErrors === null) {
15376
- vErrors = [err9];
15337
+ vErrors = [err13];
15377
15338
  } else {
15378
- vErrors.push(err9);
15339
+ vErrors.push(err13);
15379
15340
  }
15380
15341
  errors++;
15381
15342
  }
15382
15343
  }
15383
- var valid4 = _errs20 === errors;
15384
- } else {
15385
- var valid4 = true;
15386
- }
15387
- if (valid4) {
15388
- if (data1.captureAuthorityKind !== void 0) {
15389
- let data8 = data1.captureAuthorityKind;
15390
- const _errs22 = errors;
15391
- if (typeof data8 !== "string") {
15392
- const err10 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/captureAuthorityKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15393
- if (vErrors === null) {
15394
- vErrors = [err10];
15395
- } else {
15396
- vErrors.push(err10);
15397
- }
15398
- errors++;
15399
- }
15400
- if (!(data8 === "workos" || data8 === "service_token")) {
15401
- const err11 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/captureAuthorityKind/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[0].properties.captureAuthorityKind.enum }, message: "must be equal to one of the allowed values" };
15402
- if (vErrors === null) {
15403
- vErrors = [err11];
15404
- } else {
15405
- vErrors.push(err11);
15406
- }
15407
- errors++;
15408
- }
15409
- var valid4 = _errs22 === errors;
15410
- } else {
15411
- var valid4 = true;
15344
+ var _valid1 = _errs22 === errors;
15345
+ if (_valid1) {
15346
+ valid5 = true;
15347
+ passing0 = 0;
15348
+ var props0 = true;
15412
15349
  }
15413
- if (valid4) {
15414
- if (data1.decisionLifecycleProtocolVersion !== void 0) {
15415
- let data9 = data1.decisionLifecycleProtocolVersion;
15416
- const _errs24 = errors;
15417
- if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
15418
- const err12 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/decisionLifecycleProtocolVersion/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
15350
+ const _errs29 = errors;
15351
+ if (errors === _errs29) {
15352
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
15353
+ let missing3;
15354
+ if (data7.kind === void 0 && (missing3 = "kind")) {
15355
+ const err14 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/1/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" };
15419
15356
  if (vErrors === null) {
15420
- vErrors = [err12];
15357
+ vErrors = [err14];
15421
15358
  } else {
15422
- vErrors.push(err12);
15359
+ vErrors.push(err14);
15423
15360
  }
15424
15361
  errors++;
15425
- }
15426
- if (errors === _errs24) {
15427
- if (typeof data9 == "number" && isFinite(data9)) {
15428
- if (data9 > 9007199254740991 || isNaN(data9)) {
15429
- const err13 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/decisionLifecycleProtocolVersion/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
15362
+ } else {
15363
+ const _errs31 = errors;
15364
+ for (const key1 in data7) {
15365
+ if (!(key1 === "kind")) {
15366
+ const err15 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/1/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
15430
15367
  if (vErrors === null) {
15431
- vErrors = [err13];
15368
+ vErrors = [err15];
15432
15369
  } else {
15433
- vErrors.push(err13);
15370
+ vErrors.push(err15);
15434
15371
  }
15435
15372
  errors++;
15436
- } else {
15437
- if (data9 < 1 || isNaN(data9)) {
15438
- const err14 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/decisionLifecycleProtocolVersion/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
15373
+ break;
15374
+ }
15375
+ }
15376
+ if (_errs31 === errors) {
15377
+ if (data7.kind !== void 0) {
15378
+ let data10 = data7.kind;
15379
+ if (typeof data10 !== "string") {
15380
+ const err16 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/1/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15381
+ if (vErrors === null) {
15382
+ vErrors = [err16];
15383
+ } else {
15384
+ vErrors.push(err16);
15385
+ }
15386
+ errors++;
15387
+ }
15388
+ if ("non_repository" !== data10) {
15389
+ const err17 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/1/properties/kind/const", keyword: "const", params: { allowedValue: "non_repository" }, message: "must be equal to constant" };
15439
15390
  if (vErrors === null) {
15440
- vErrors = [err14];
15391
+ vErrors = [err17];
15441
15392
  } else {
15442
- vErrors.push(err14);
15393
+ vErrors.push(err17);
15443
15394
  }
15444
15395
  errors++;
15445
15396
  }
15446
15397
  }
15447
15398
  }
15448
15399
  }
15449
- var valid4 = _errs24 === errors;
15450
15400
  } else {
15451
- var valid4 = true;
15401
+ const err18 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15402
+ if (vErrors === null) {
15403
+ vErrors = [err18];
15404
+ } else {
15405
+ vErrors.push(err18);
15406
+ }
15407
+ errors++;
15452
15408
  }
15453
- if (valid4) {
15454
- if (data1.producer !== void 0) {
15455
- let data10 = data1.producer;
15456
- const _errs26 = errors;
15457
- if (typeof data10 !== "string") {
15458
- const err15 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/producer/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15459
- if (vErrors === null) {
15460
- vErrors = [err15];
15409
+ }
15410
+ var _valid1 = _errs29 === errors;
15411
+ if (_valid1 && valid5) {
15412
+ valid5 = false;
15413
+ passing0 = [passing0, 1];
15414
+ } else {
15415
+ if (_valid1) {
15416
+ valid5 = true;
15417
+ passing0 = 1;
15418
+ if (props0 !== true) {
15419
+ props0 = true;
15420
+ }
15421
+ }
15422
+ }
15423
+ if (!valid5) {
15424
+ const err19 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/repositoryContext/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
15425
+ if (vErrors === null) {
15426
+ vErrors = [err19];
15427
+ } else {
15428
+ vErrors.push(err19);
15429
+ }
15430
+ errors++;
15431
+ } else {
15432
+ errors = _errs21;
15433
+ if (vErrors !== null) {
15434
+ if (_errs21) {
15435
+ vErrors.length = _errs21;
15436
+ } else {
15437
+ vErrors = null;
15438
+ }
15439
+ }
15440
+ }
15441
+ var valid4 = _errs20 === errors;
15442
+ } else {
15443
+ var valid4 = true;
15444
+ }
15445
+ if (valid4) {
15446
+ if (data1.capturedOrganizationId !== void 0) {
15447
+ let data11 = data1.capturedOrganizationId;
15448
+ const _errs34 = errors;
15449
+ if (errors === _errs34) {
15450
+ if (typeof data11 === "string") {
15451
+ if (func1(data11) > 128) {
15452
+ const err20 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" };
15453
+ if (vErrors === null) {
15454
+ vErrors = [err20];
15461
15455
  } else {
15462
- vErrors.push(err15);
15456
+ vErrors.push(err20);
15463
15457
  }
15464
15458
  errors++;
15459
+ } else {
15460
+ if (func1(data11) < 1) {
15461
+ const err21 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
15462
+ if (vErrors === null) {
15463
+ vErrors = [err21];
15464
+ } else {
15465
+ vErrors.push(err21);
15466
+ }
15467
+ errors++;
15468
+ } else {
15469
+ if (!pattern8.test(data11)) {
15470
+ const err22 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: 'must match pattern "^[A-Za-z0-9_-]+$"' };
15471
+ if (vErrors === null) {
15472
+ vErrors = [err22];
15473
+ } else {
15474
+ vErrors.push(err22);
15475
+ }
15476
+ errors++;
15477
+ }
15478
+ }
15479
+ }
15480
+ } else {
15481
+ const err23 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/capturedOrganizationId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15482
+ if (vErrors === null) {
15483
+ vErrors = [err23];
15484
+ } else {
15485
+ vErrors.push(err23);
15486
+ }
15487
+ errors++;
15488
+ }
15489
+ }
15490
+ var valid4 = _errs34 === errors;
15491
+ } else {
15492
+ var valid4 = true;
15493
+ }
15494
+ if (valid4) {
15495
+ if (data1.captureAuthorityKind !== void 0) {
15496
+ let data12 = data1.captureAuthorityKind;
15497
+ const _errs36 = errors;
15498
+ if (typeof data12 !== "string") {
15499
+ const err24 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/captureAuthorityKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15500
+ if (vErrors === null) {
15501
+ vErrors = [err24];
15502
+ } else {
15503
+ vErrors.push(err24);
15465
15504
  }
15466
- if (!(data10 === "claude_code" || data10 === "codex" || data10 === "cursor" || data10 === "hermes")) {
15467
- const err16 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/producer/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[0].properties.producer.enum }, message: "must be equal to one of the allowed values" };
15505
+ errors++;
15506
+ }
15507
+ if (!(data12 === "workos" || data12 === "service_token")) {
15508
+ const err25 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/captureAuthorityKind/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[0].properties.captureAuthorityKind.enum }, message: "must be equal to one of the allowed values" };
15509
+ if (vErrors === null) {
15510
+ vErrors = [err25];
15511
+ } else {
15512
+ vErrors.push(err25);
15513
+ }
15514
+ errors++;
15515
+ }
15516
+ var valid4 = _errs36 === errors;
15517
+ } else {
15518
+ var valid4 = true;
15519
+ }
15520
+ if (valid4) {
15521
+ if (data1.decisionLifecycleProtocolVersion !== void 0) {
15522
+ let data13 = data1.decisionLifecycleProtocolVersion;
15523
+ const _errs38 = errors;
15524
+ if (!(typeof data13 == "number" && (!(data13 % 1) && !isNaN(data13)) && isFinite(data13))) {
15525
+ const err26 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/decisionLifecycleProtocolVersion/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
15468
15526
  if (vErrors === null) {
15469
- vErrors = [err16];
15527
+ vErrors = [err26];
15470
15528
  } else {
15471
- vErrors.push(err16);
15529
+ vErrors.push(err26);
15472
15530
  }
15473
15531
  errors++;
15474
15532
  }
15475
- var valid4 = _errs26 === errors;
15533
+ if (errors === _errs38) {
15534
+ if (typeof data13 == "number" && isFinite(data13)) {
15535
+ if (data13 > 9007199254740991 || isNaN(data13)) {
15536
+ const err27 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/decisionLifecycleProtocolVersion/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
15537
+ if (vErrors === null) {
15538
+ vErrors = [err27];
15539
+ } else {
15540
+ vErrors.push(err27);
15541
+ }
15542
+ errors++;
15543
+ } else {
15544
+ if (data13 < 1 || isNaN(data13)) {
15545
+ const err28 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/decisionLifecycleProtocolVersion/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
15546
+ if (vErrors === null) {
15547
+ vErrors = [err28];
15548
+ } else {
15549
+ vErrors.push(err28);
15550
+ }
15551
+ errors++;
15552
+ }
15553
+ }
15554
+ }
15555
+ }
15556
+ var valid4 = _errs38 === errors;
15476
15557
  } else {
15477
15558
  var valid4 = true;
15478
15559
  }
15479
15560
  if (valid4) {
15480
- if (data1.toolOutcome !== void 0) {
15481
- let data11 = data1.toolOutcome;
15482
- const _errs28 = errors;
15483
- if (typeof data11 !== "string") {
15484
- const err17 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/toolOutcome/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15561
+ if (data1.producer !== void 0) {
15562
+ let data14 = data1.producer;
15563
+ const _errs40 = errors;
15564
+ if (typeof data14 !== "string") {
15565
+ const err29 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/producer/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15485
15566
  if (vErrors === null) {
15486
- vErrors = [err17];
15567
+ vErrors = [err29];
15487
15568
  } else {
15488
- vErrors.push(err17);
15569
+ vErrors.push(err29);
15489
15570
  }
15490
15571
  errors++;
15491
15572
  }
15492
- if (!(data11 === "succeeded" || data11 === "returned" || data11 === "failed" || data11 === "interrupted" || data11 === "prevented" || data11 === "unknown")) {
15493
- const err18 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/toolOutcome/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[0].properties.toolOutcome.enum }, message: "must be equal to one of the allowed values" };
15573
+ if (!(data14 === "claude_code" || data14 === "codex" || data14 === "cursor" || data14 === "hermes")) {
15574
+ const err30 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/producer/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[0].properties.producer.enum }, message: "must be equal to one of the allowed values" };
15494
15575
  if (vErrors === null) {
15495
- vErrors = [err18];
15576
+ vErrors = [err30];
15496
15577
  } else {
15497
- vErrors.push(err18);
15578
+ vErrors.push(err30);
15498
15579
  }
15499
15580
  errors++;
15500
15581
  }
15501
- var valid4 = _errs28 === errors;
15582
+ var valid4 = _errs40 === errors;
15502
15583
  } else {
15503
15584
  var valid4 = true;
15504
15585
  }
15505
15586
  if (valid4) {
15506
- if (data1.envelopeVersion !== void 0) {
15507
- let data12 = data1.envelopeVersion;
15508
- const _errs30 = errors;
15509
- if (!(typeof data12 == "number" && isFinite(data12))) {
15510
- const err19 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/envelopeVersion/type", keyword: "type", params: { type: "number" }, message: "must be number" };
15587
+ if (data1.toolOutcome !== void 0) {
15588
+ let data15 = data1.toolOutcome;
15589
+ const _errs42 = errors;
15590
+ if (typeof data15 !== "string") {
15591
+ const err31 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/toolOutcome/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15511
15592
  if (vErrors === null) {
15512
- vErrors = [err19];
15593
+ vErrors = [err31];
15513
15594
  } else {
15514
- vErrors.push(err19);
15595
+ vErrors.push(err31);
15515
15596
  }
15516
15597
  errors++;
15517
15598
  }
15518
- if (4 !== data12) {
15519
- const err20 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/envelopeVersion/const", keyword: "const", params: { allowedValue: 4 }, message: "must be equal to constant" };
15599
+ if (!(data15 === "succeeded" || data15 === "returned" || data15 === "failed" || data15 === "interrupted" || data15 === "prevented" || data15 === "unknown")) {
15600
+ const err32 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/toolOutcome/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[0].properties.toolOutcome.enum }, message: "must be equal to one of the allowed values" };
15520
15601
  if (vErrors === null) {
15521
- vErrors = [err20];
15602
+ vErrors = [err32];
15522
15603
  } else {
15523
- vErrors.push(err20);
15604
+ vErrors.push(err32);
15524
15605
  }
15525
15606
  errors++;
15526
15607
  }
15527
- var valid4 = _errs30 === errors;
15608
+ var valid4 = _errs42 === errors;
15528
15609
  } else {
15529
15610
  var valid4 = true;
15530
15611
  }
15612
+ if (valid4) {
15613
+ if (data1.envelopeVersion !== void 0) {
15614
+ let data16 = data1.envelopeVersion;
15615
+ const _errs44 = errors;
15616
+ if (!(typeof data16 == "number" && isFinite(data16))) {
15617
+ const err33 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/envelopeVersion/type", keyword: "type", params: { type: "number" }, message: "must be number" };
15618
+ if (vErrors === null) {
15619
+ vErrors = [err33];
15620
+ } else {
15621
+ vErrors.push(err33);
15622
+ }
15623
+ errors++;
15624
+ }
15625
+ if (4 !== data16) {
15626
+ const err34 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/properties/envelopeVersion/const", keyword: "const", params: { allowedValue: 4 }, message: "must be equal to constant" };
15627
+ if (vErrors === null) {
15628
+ vErrors = [err34];
15629
+ } else {
15630
+ vErrors.push(err34);
15631
+ }
15632
+ errors++;
15633
+ }
15634
+ var valid4 = _errs44 === errors;
15635
+ } else {
15636
+ var valid4 = true;
15637
+ }
15638
+ }
15531
15639
  }
15532
15640
  }
15533
15641
  }
@@ -15540,11 +15648,11 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
15540
15648
  }
15541
15649
  }
15542
15650
  } else {
15543
- const err21 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15651
+ const err35 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15544
15652
  if (vErrors === null) {
15545
- vErrors = [err21];
15653
+ vErrors = [err35];
15546
15654
  } else {
15547
- vErrors.push(err21);
15655
+ vErrors.push(err35);
15548
15656
  }
15549
15657
  errors++;
15550
15658
  }
@@ -15552,296 +15660,509 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
15552
15660
  var _valid0 = _errs7 === errors;
15553
15661
  valid3 = valid3 || _valid0;
15554
15662
  if (_valid0) {
15555
- var props0 = true;
15663
+ var props1 = true;
15556
15664
  }
15557
- const _errs32 = errors;
15558
- if (errors === _errs32) {
15665
+ const _errs46 = errors;
15666
+ if (errors === _errs46) {
15559
15667
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
15560
- let missing2;
15561
- if (data1.moveId === void 0 && (missing2 = "moveId") || data1.capturedAt === void 0 && (missing2 = "capturedAt") || data1.sessionId === void 0 && (missing2 = "sessionId") || data1.eventType === void 0 && (missing2 = "eventType")) {
15562
- const err22 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" };
15668
+ let missing4;
15669
+ if (data1.moveId === void 0 && (missing4 = "moveId") || data1.capturedAt === void 0 && (missing4 = "capturedAt") || data1.sessionId === void 0 && (missing4 = "sessionId") || data1.eventType === void 0 && (missing4 = "eventType")) {
15670
+ const err36 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" };
15563
15671
  if (vErrors === null) {
15564
- vErrors = [err22];
15672
+ vErrors = [err36];
15565
15673
  } else {
15566
- vErrors.push(err22);
15674
+ vErrors.push(err36);
15567
15675
  }
15568
15676
  errors++;
15569
15677
  } else {
15570
15678
  if (data1.moveId !== void 0) {
15571
- const _errs35 = errors;
15679
+ const _errs49 = errors;
15572
15680
  if (typeof data1.moveId !== "string") {
15573
- const err23 = { instancePath: instancePath + "/batch/" + i0 + "/moveId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/moveId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15681
+ const err37 = { instancePath: instancePath + "/batch/" + i0 + "/moveId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/moveId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15574
15682
  if (vErrors === null) {
15575
- vErrors = [err23];
15683
+ vErrors = [err37];
15576
15684
  } else {
15577
- vErrors.push(err23);
15685
+ vErrors.push(err37);
15578
15686
  }
15579
15687
  errors++;
15580
15688
  }
15581
- var valid5 = _errs35 === errors;
15689
+ var valid8 = _errs49 === errors;
15582
15690
  } else {
15583
- var valid5 = true;
15691
+ var valid8 = true;
15584
15692
  }
15585
- if (valid5) {
15693
+ if (valid8) {
15586
15694
  if (data1.capturedAt !== void 0) {
15587
- let data14 = data1.capturedAt;
15588
- const _errs37 = errors;
15589
- if (!(typeof data14 == "number" && isFinite(data14))) {
15590
- const err24 = { instancePath: instancePath + "/batch/" + i0 + "/capturedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedAt/type", keyword: "type", params: { type: "number" }, message: "must be number" };
15695
+ let data18 = data1.capturedAt;
15696
+ const _errs51 = errors;
15697
+ if (!(typeof data18 == "number" && isFinite(data18))) {
15698
+ const err38 = { instancePath: instancePath + "/batch/" + i0 + "/capturedAt", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedAt/type", keyword: "type", params: { type: "number" }, message: "must be number" };
15591
15699
  if (vErrors === null) {
15592
- vErrors = [err24];
15700
+ vErrors = [err38];
15593
15701
  } else {
15594
- vErrors.push(err24);
15702
+ vErrors.push(err38);
15595
15703
  }
15596
15704
  errors++;
15597
15705
  }
15598
- var valid5 = _errs37 === errors;
15706
+ var valid8 = _errs51 === errors;
15599
15707
  } else {
15600
- var valid5 = true;
15708
+ var valid8 = true;
15601
15709
  }
15602
- if (valid5) {
15710
+ if (valid8) {
15603
15711
  if (data1.sessionId !== void 0) {
15604
- const _errs39 = errors;
15712
+ const _errs53 = errors;
15605
15713
  if (typeof data1.sessionId !== "string") {
15606
- const err25 = { instancePath: instancePath + "/batch/" + i0 + "/sessionId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/sessionId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15714
+ const err39 = { instancePath: instancePath + "/batch/" + i0 + "/sessionId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/sessionId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15607
15715
  if (vErrors === null) {
15608
- vErrors = [err25];
15716
+ vErrors = [err39];
15609
15717
  } else {
15610
- vErrors.push(err25);
15718
+ vErrors.push(err39);
15611
15719
  }
15612
15720
  errors++;
15613
15721
  }
15614
- var valid5 = _errs39 === errors;
15722
+ var valid8 = _errs53 === errors;
15615
15723
  } else {
15616
- var valid5 = true;
15724
+ var valid8 = true;
15617
15725
  }
15618
- if (valid5) {
15726
+ if (valid8) {
15619
15727
  if (data1.invocationId !== void 0) {
15620
- const _errs41 = errors;
15728
+ const _errs55 = errors;
15621
15729
  if (typeof data1.invocationId !== "string") {
15622
- const err26 = { instancePath: instancePath + "/batch/" + i0 + "/invocationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/invocationId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15730
+ const err40 = { instancePath: instancePath + "/batch/" + i0 + "/invocationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/invocationId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15623
15731
  if (vErrors === null) {
15624
- vErrors = [err26];
15732
+ vErrors = [err40];
15625
15733
  } else {
15626
- vErrors.push(err26);
15734
+ vErrors.push(err40);
15627
15735
  }
15628
15736
  errors++;
15629
15737
  }
15630
- var valid5 = _errs41 === errors;
15738
+ var valid8 = _errs55 === errors;
15631
15739
  } else {
15632
- var valid5 = true;
15740
+ var valid8 = true;
15633
15741
  }
15634
- if (valid5) {
15742
+ if (valid8) {
15635
15743
  if (data1.eventType !== void 0) {
15636
- const _errs43 = errors;
15744
+ const _errs57 = errors;
15637
15745
  if (typeof data1.eventType !== "string") {
15638
- const err27 = { instancePath: instancePath + "/batch/" + i0 + "/eventType", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/eventType/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15746
+ const err41 = { instancePath: instancePath + "/batch/" + i0 + "/eventType", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/eventType/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15639
15747
  if (vErrors === null) {
15640
- vErrors = [err27];
15748
+ vErrors = [err41];
15641
15749
  } else {
15642
- vErrors.push(err27);
15750
+ vErrors.push(err41);
15643
15751
  }
15644
15752
  errors++;
15645
15753
  }
15646
- var valid5 = _errs43 === errors;
15754
+ var valid8 = _errs57 === errors;
15647
15755
  } else {
15648
- var valid5 = true;
15756
+ var valid8 = true;
15649
15757
  }
15650
- if (valid5) {
15651
- if (data1.capturedOrganizationId !== void 0) {
15652
- let data18 = data1.capturedOrganizationId;
15653
- const _errs45 = errors;
15654
- if (errors === _errs45) {
15655
- if (typeof data18 === "string") {
15656
- if (func1(data18) > 128) {
15657
- const err28 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" };
15758
+ if (valid8) {
15759
+ if (data1.repositoryContext !== void 0) {
15760
+ let data22 = data1.repositoryContext;
15761
+ const _errs59 = errors;
15762
+ const _errs60 = errors;
15763
+ let valid9 = false;
15764
+ let passing1 = null;
15765
+ const _errs61 = errors;
15766
+ if (errors === _errs61) {
15767
+ if (data22 && typeof data22 == "object" && !Array.isArray(data22)) {
15768
+ let missing5;
15769
+ if (data22.kind === void 0 && (missing5 = "kind") || data22.repoSyncId === void 0 && (missing5 = "repoSyncId")) {
15770
+ const err42 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" };
15658
15771
  if (vErrors === null) {
15659
- vErrors = [err28];
15772
+ vErrors = [err42];
15660
15773
  } else {
15661
- vErrors.push(err28);
15774
+ vErrors.push(err42);
15662
15775
  }
15663
15776
  errors++;
15664
15777
  } else {
15665
- if (func1(data18) < 1) {
15666
- const err29 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
15667
- if (vErrors === null) {
15668
- vErrors = [err29];
15669
- } else {
15670
- vErrors.push(err29);
15671
- }
15672
- errors++;
15673
- } else {
15674
- if (!pattern8.test(data18)) {
15675
- const err30 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: 'must match pattern "^[A-Za-z0-9_-]+$"' };
15778
+ const _errs63 = errors;
15779
+ for (const key2 in data22) {
15780
+ if (!(key2 === "kind" || key2 === "repoSyncId")) {
15781
+ const err43 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
15676
15782
  if (vErrors === null) {
15677
- vErrors = [err30];
15783
+ vErrors = [err43];
15678
15784
  } else {
15679
- vErrors.push(err30);
15785
+ vErrors.push(err43);
15680
15786
  }
15681
15787
  errors++;
15788
+ break;
15789
+ }
15790
+ }
15791
+ if (_errs63 === errors) {
15792
+ if (data22.kind !== void 0) {
15793
+ let data23 = data22.kind;
15794
+ const _errs64 = errors;
15795
+ if (typeof data23 !== "string") {
15796
+ const err44 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15797
+ if (vErrors === null) {
15798
+ vErrors = [err44];
15799
+ } else {
15800
+ vErrors.push(err44);
15801
+ }
15802
+ errors++;
15803
+ }
15804
+ if ("repository_bound" !== data23) {
15805
+ const err45 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/properties/kind/const", keyword: "const", params: { allowedValue: "repository_bound" }, message: "must be equal to constant" };
15806
+ if (vErrors === null) {
15807
+ vErrors = [err45];
15808
+ } else {
15809
+ vErrors.push(err45);
15810
+ }
15811
+ errors++;
15812
+ }
15813
+ var valid10 = _errs64 === errors;
15814
+ } else {
15815
+ var valid10 = true;
15816
+ }
15817
+ if (valid10) {
15818
+ if (data22.repoSyncId !== void 0) {
15819
+ let data24 = data22.repoSyncId;
15820
+ const _errs66 = errors;
15821
+ if (errors === _errs66) {
15822
+ if (typeof data24 === "string") {
15823
+ if (func1(data24) > 128) {
15824
+ const err46 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/repoSyncId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/properties/repoSyncId/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" };
15825
+ if (vErrors === null) {
15826
+ vErrors = [err46];
15827
+ } else {
15828
+ vErrors.push(err46);
15829
+ }
15830
+ errors++;
15831
+ } else {
15832
+ if (func1(data24) < 1) {
15833
+ const err47 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/repoSyncId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/properties/repoSyncId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
15834
+ if (vErrors === null) {
15835
+ vErrors = [err47];
15836
+ } else {
15837
+ vErrors.push(err47);
15838
+ }
15839
+ errors++;
15840
+ }
15841
+ }
15842
+ } else {
15843
+ const err48 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/repoSyncId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/properties/repoSyncId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15844
+ if (vErrors === null) {
15845
+ vErrors = [err48];
15846
+ } else {
15847
+ vErrors.push(err48);
15848
+ }
15849
+ errors++;
15850
+ }
15851
+ }
15852
+ var valid10 = _errs66 === errors;
15853
+ } else {
15854
+ var valid10 = true;
15855
+ }
15682
15856
  }
15683
15857
  }
15684
15858
  }
15685
15859
  } else {
15686
- const err31 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15860
+ const err49 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15687
15861
  if (vErrors === null) {
15688
- vErrors = [err31];
15862
+ vErrors = [err49];
15689
15863
  } else {
15690
- vErrors.push(err31);
15864
+ vErrors.push(err49);
15691
15865
  }
15692
15866
  errors++;
15693
15867
  }
15694
15868
  }
15695
- var valid5 = _errs45 === errors;
15696
- } else {
15697
- var valid5 = true;
15698
- }
15699
- if (valid5) {
15700
- if (data1.captureAuthorityKind !== void 0) {
15701
- let data19 = data1.captureAuthorityKind;
15702
- const _errs47 = errors;
15703
- if (typeof data19 !== "string") {
15704
- const err32 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/captureAuthorityKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15705
- if (vErrors === null) {
15706
- vErrors = [err32];
15869
+ var _valid2 = _errs61 === errors;
15870
+ if (_valid2) {
15871
+ valid9 = true;
15872
+ passing1 = 0;
15873
+ var props2 = true;
15874
+ }
15875
+ const _errs68 = errors;
15876
+ if (errors === _errs68) {
15877
+ if (data22 && typeof data22 == "object" && !Array.isArray(data22)) {
15878
+ let missing6;
15879
+ if (data22.kind === void 0 && (missing6 = "kind")) {
15880
+ const err50 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/1/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" };
15881
+ if (vErrors === null) {
15882
+ vErrors = [err50];
15883
+ } else {
15884
+ vErrors.push(err50);
15885
+ }
15886
+ errors++;
15707
15887
  } else {
15708
- vErrors.push(err32);
15888
+ const _errs70 = errors;
15889
+ for (const key3 in data22) {
15890
+ if (!(key3 === "kind")) {
15891
+ const err51 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/1/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
15892
+ if (vErrors === null) {
15893
+ vErrors = [err51];
15894
+ } else {
15895
+ vErrors.push(err51);
15896
+ }
15897
+ errors++;
15898
+ break;
15899
+ }
15900
+ }
15901
+ if (_errs70 === errors) {
15902
+ if (data22.kind !== void 0) {
15903
+ let data25 = data22.kind;
15904
+ if (typeof data25 !== "string") {
15905
+ const err52 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/1/properties/kind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15906
+ if (vErrors === null) {
15907
+ vErrors = [err52];
15908
+ } else {
15909
+ vErrors.push(err52);
15910
+ }
15911
+ errors++;
15912
+ }
15913
+ if ("non_repository" !== data25) {
15914
+ const err53 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext/kind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/1/properties/kind/const", keyword: "const", params: { allowedValue: "non_repository" }, message: "must be equal to constant" };
15915
+ if (vErrors === null) {
15916
+ vErrors = [err53];
15917
+ } else {
15918
+ vErrors.push(err53);
15919
+ }
15920
+ errors++;
15921
+ }
15922
+ }
15923
+ }
15709
15924
  }
15710
- errors++;
15711
- }
15712
- if (!(data19 === "workos" || data19 === "service_token")) {
15713
- const err33 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/captureAuthorityKind/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[1].properties.captureAuthorityKind.enum }, message: "must be equal to one of the allowed values" };
15925
+ } else {
15926
+ const err54 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15714
15927
  if (vErrors === null) {
15715
- vErrors = [err33];
15928
+ vErrors = [err54];
15716
15929
  } else {
15717
- vErrors.push(err33);
15930
+ vErrors.push(err54);
15718
15931
  }
15719
15932
  errors++;
15720
15933
  }
15721
- var valid5 = _errs47 === errors;
15934
+ }
15935
+ var _valid2 = _errs68 === errors;
15936
+ if (_valid2 && valid9) {
15937
+ valid9 = false;
15938
+ passing1 = [passing1, 1];
15722
15939
  } else {
15723
- var valid5 = true;
15940
+ if (_valid2) {
15941
+ valid9 = true;
15942
+ passing1 = 1;
15943
+ if (props2 !== true) {
15944
+ props2 = true;
15945
+ }
15946
+ }
15724
15947
  }
15725
- if (valid5) {
15726
- if (data1.decisionLifecycleProtocolVersion !== void 0) {
15727
- let data20 = data1.decisionLifecycleProtocolVersion;
15728
- const _errs49 = errors;
15729
- if (!(typeof data20 == "number" && (!(data20 % 1) && !isNaN(data20)) && isFinite(data20))) {
15730
- const err34 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/decisionLifecycleProtocolVersion/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
15731
- if (vErrors === null) {
15732
- vErrors = [err34];
15733
- } else {
15734
- vErrors.push(err34);
15735
- }
15736
- errors++;
15948
+ if (!valid9) {
15949
+ const err55 = { instancePath: instancePath + "/batch/" + i0 + "/repositoryContext", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/repositoryContext/oneOf", keyword: "oneOf", params: { passingSchemas: passing1 }, message: "must match exactly one schema in oneOf" };
15950
+ if (vErrors === null) {
15951
+ vErrors = [err55];
15952
+ } else {
15953
+ vErrors.push(err55);
15954
+ }
15955
+ errors++;
15956
+ } else {
15957
+ errors = _errs60;
15958
+ if (vErrors !== null) {
15959
+ if (_errs60) {
15960
+ vErrors.length = _errs60;
15961
+ } else {
15962
+ vErrors = null;
15737
15963
  }
15738
- if (errors === _errs49) {
15739
- if (typeof data20 == "number" && isFinite(data20)) {
15740
- if (data20 > 9007199254740991 || isNaN(data20)) {
15741
- const err35 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/decisionLifecycleProtocolVersion/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
15964
+ }
15965
+ }
15966
+ var valid8 = _errs59 === errors;
15967
+ } else {
15968
+ var valid8 = true;
15969
+ }
15970
+ if (valid8) {
15971
+ if (data1.capturedOrganizationId !== void 0) {
15972
+ let data26 = data1.capturedOrganizationId;
15973
+ const _errs73 = errors;
15974
+ if (errors === _errs73) {
15975
+ if (typeof data26 === "string") {
15976
+ if (func1(data26) > 128) {
15977
+ const err56 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/maxLength", keyword: "maxLength", params: { limit: 128 }, message: "must NOT have more than 128 characters" };
15978
+ if (vErrors === null) {
15979
+ vErrors = [err56];
15980
+ } else {
15981
+ vErrors.push(err56);
15982
+ }
15983
+ errors++;
15984
+ } else {
15985
+ if (func1(data26) < 1) {
15986
+ const err57 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
15742
15987
  if (vErrors === null) {
15743
- vErrors = [err35];
15988
+ vErrors = [err57];
15744
15989
  } else {
15745
- vErrors.push(err35);
15990
+ vErrors.push(err57);
15746
15991
  }
15747
15992
  errors++;
15748
15993
  } else {
15749
- if (data20 < 1 || isNaN(data20)) {
15750
- const err36 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/decisionLifecycleProtocolVersion/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
15994
+ if (!pattern8.test(data26)) {
15995
+ const err58 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: 'must match pattern "^[A-Za-z0-9_-]+$"' };
15751
15996
  if (vErrors === null) {
15752
- vErrors = [err36];
15997
+ vErrors = [err58];
15753
15998
  } else {
15754
- vErrors.push(err36);
15999
+ vErrors.push(err58);
15755
16000
  }
15756
16001
  errors++;
15757
16002
  }
15758
16003
  }
15759
16004
  }
16005
+ } else {
16006
+ const err59 = { instancePath: instancePath + "/batch/" + i0 + "/capturedOrganizationId", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/capturedOrganizationId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
16007
+ if (vErrors === null) {
16008
+ vErrors = [err59];
16009
+ } else {
16010
+ vErrors.push(err59);
16011
+ }
16012
+ errors++;
16013
+ }
16014
+ }
16015
+ var valid8 = _errs73 === errors;
16016
+ } else {
16017
+ var valid8 = true;
16018
+ }
16019
+ if (valid8) {
16020
+ if (data1.captureAuthorityKind !== void 0) {
16021
+ let data27 = data1.captureAuthorityKind;
16022
+ const _errs75 = errors;
16023
+ if (typeof data27 !== "string") {
16024
+ const err60 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/captureAuthorityKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
16025
+ if (vErrors === null) {
16026
+ vErrors = [err60];
16027
+ } else {
16028
+ vErrors.push(err60);
16029
+ }
16030
+ errors++;
16031
+ }
16032
+ if (!(data27 === "workos" || data27 === "service_token")) {
16033
+ const err61 = { instancePath: instancePath + "/batch/" + i0 + "/captureAuthorityKind", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/captureAuthorityKind/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[1].properties.captureAuthorityKind.enum }, message: "must be equal to one of the allowed values" };
16034
+ if (vErrors === null) {
16035
+ vErrors = [err61];
16036
+ } else {
16037
+ vErrors.push(err61);
16038
+ }
16039
+ errors++;
15760
16040
  }
15761
- var valid5 = _errs49 === errors;
16041
+ var valid8 = _errs75 === errors;
15762
16042
  } else {
15763
- var valid5 = true;
16043
+ var valid8 = true;
15764
16044
  }
15765
- if (valid5) {
15766
- if (data1.producer !== void 0) {
15767
- let data21 = data1.producer;
15768
- const _errs51 = errors;
15769
- if (typeof data21 !== "string") {
15770
- const err37 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/producer/type", keyword: "type", params: { type: "string" }, message: "must be string" };
16045
+ if (valid8) {
16046
+ if (data1.decisionLifecycleProtocolVersion !== void 0) {
16047
+ let data28 = data1.decisionLifecycleProtocolVersion;
16048
+ const _errs77 = errors;
16049
+ if (!(typeof data28 == "number" && (!(data28 % 1) && !isNaN(data28)) && isFinite(data28))) {
16050
+ const err62 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/decisionLifecycleProtocolVersion/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
15771
16051
  if (vErrors === null) {
15772
- vErrors = [err37];
16052
+ vErrors = [err62];
15773
16053
  } else {
15774
- vErrors.push(err37);
16054
+ vErrors.push(err62);
15775
16055
  }
15776
16056
  errors++;
15777
16057
  }
15778
- if (!(data21 === "claude_code" || data21 === "codex" || data21 === "cursor" || data21 === "hermes")) {
15779
- const err38 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/producer/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[1].properties.producer.enum }, message: "must be equal to one of the allowed values" };
15780
- if (vErrors === null) {
15781
- vErrors = [err38];
15782
- } else {
15783
- vErrors.push(err38);
16058
+ if (errors === _errs77) {
16059
+ if (typeof data28 == "number" && isFinite(data28)) {
16060
+ if (data28 > 9007199254740991 || isNaN(data28)) {
16061
+ const err63 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/decisionLifecycleProtocolVersion/maximum", keyword: "maximum", params: { comparison: "<=", limit: 9007199254740991 }, message: "must be <= 9007199254740991" };
16062
+ if (vErrors === null) {
16063
+ vErrors = [err63];
16064
+ } else {
16065
+ vErrors.push(err63);
16066
+ }
16067
+ errors++;
16068
+ } else {
16069
+ if (data28 < 1 || isNaN(data28)) {
16070
+ const err64 = { instancePath: instancePath + "/batch/" + i0 + "/decisionLifecycleProtocolVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/decisionLifecycleProtocolVersion/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
16071
+ if (vErrors === null) {
16072
+ vErrors = [err64];
16073
+ } else {
16074
+ vErrors.push(err64);
16075
+ }
16076
+ errors++;
16077
+ }
16078
+ }
15784
16079
  }
15785
- errors++;
15786
16080
  }
15787
- var valid5 = _errs51 === errors;
16081
+ var valid8 = _errs77 === errors;
15788
16082
  } else {
15789
- var valid5 = true;
16083
+ var valid8 = true;
15790
16084
  }
15791
- if (valid5) {
15792
- if (data1.toolOutcome !== void 0) {
15793
- let data22 = data1.toolOutcome;
15794
- const _errs53 = errors;
15795
- if (typeof data22 !== "string") {
15796
- const err39 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/toolOutcome/type", keyword: "type", params: { type: "string" }, message: "must be string" };
16085
+ if (valid8) {
16086
+ if (data1.producer !== void 0) {
16087
+ let data29 = data1.producer;
16088
+ const _errs79 = errors;
16089
+ if (typeof data29 !== "string") {
16090
+ const err65 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/producer/type", keyword: "type", params: { type: "string" }, message: "must be string" };
15797
16091
  if (vErrors === null) {
15798
- vErrors = [err39];
16092
+ vErrors = [err65];
15799
16093
  } else {
15800
- vErrors.push(err39);
16094
+ vErrors.push(err65);
15801
16095
  }
15802
16096
  errors++;
15803
16097
  }
15804
- if (!(data22 === "succeeded" || data22 === "returned" || data22 === "failed" || data22 === "interrupted" || data22 === "prevented" || data22 === "unknown")) {
15805
- const err40 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/toolOutcome/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[1].properties.toolOutcome.enum }, message: "must be equal to one of the allowed values" };
16098
+ if (!(data29 === "claude_code" || data29 === "codex" || data29 === "cursor" || data29 === "hermes")) {
16099
+ const err66 = { instancePath: instancePath + "/batch/" + i0 + "/producer", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/producer/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[1].properties.producer.enum }, message: "must be equal to one of the allowed values" };
15806
16100
  if (vErrors === null) {
15807
- vErrors = [err40];
16101
+ vErrors = [err66];
15808
16102
  } else {
15809
- vErrors.push(err40);
16103
+ vErrors.push(err66);
15810
16104
  }
15811
16105
  errors++;
15812
16106
  }
15813
- var valid5 = _errs53 === errors;
16107
+ var valid8 = _errs79 === errors;
15814
16108
  } else {
15815
- var valid5 = true;
16109
+ var valid8 = true;
15816
16110
  }
15817
- if (valid5) {
15818
- if (data1.envelopeVersion !== void 0) {
15819
- let data23 = data1.envelopeVersion;
15820
- const _errs55 = errors;
15821
- if (errors === _errs55) {
15822
- if (typeof data23 == "number" && isFinite(data23)) {
15823
- if (data23 >= 4 || isNaN(data23)) {
15824
- const err41 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/envelopeVersion/exclusiveMaximum", keyword: "exclusiveMaximum", params: { comparison: "<", limit: 4 }, message: "must be < 4" };
16111
+ if (valid8) {
16112
+ if (data1.toolOutcome !== void 0) {
16113
+ let data30 = data1.toolOutcome;
16114
+ const _errs81 = errors;
16115
+ if (typeof data30 !== "string") {
16116
+ const err67 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/toolOutcome/type", keyword: "type", params: { type: "string" }, message: "must be string" };
16117
+ if (vErrors === null) {
16118
+ vErrors = [err67];
16119
+ } else {
16120
+ vErrors.push(err67);
16121
+ }
16122
+ errors++;
16123
+ }
16124
+ if (!(data30 === "succeeded" || data30 === "returned" || data30 === "failed" || data30 === "interrupted" || data30 === "prevented" || data30 === "unknown")) {
16125
+ const err68 = { instancePath: instancePath + "/batch/" + i0 + "/toolOutcome", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/toolOutcome/enum", keyword: "enum", params: { allowedValues: schema93.properties.batch.items.anyOf[1].properties.toolOutcome.enum }, message: "must be equal to one of the allowed values" };
16126
+ if (vErrors === null) {
16127
+ vErrors = [err68];
16128
+ } else {
16129
+ vErrors.push(err68);
16130
+ }
16131
+ errors++;
16132
+ }
16133
+ var valid8 = _errs81 === errors;
16134
+ } else {
16135
+ var valid8 = true;
16136
+ }
16137
+ if (valid8) {
16138
+ if (data1.envelopeVersion !== void 0) {
16139
+ let data31 = data1.envelopeVersion;
16140
+ const _errs83 = errors;
16141
+ if (errors === _errs83) {
16142
+ if (typeof data31 == "number" && isFinite(data31)) {
16143
+ if (data31 >= 4 || isNaN(data31)) {
16144
+ const err69 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/envelopeVersion/exclusiveMaximum", keyword: "exclusiveMaximum", params: { comparison: "<", limit: 4 }, message: "must be < 4" };
16145
+ if (vErrors === null) {
16146
+ vErrors = [err69];
16147
+ } else {
16148
+ vErrors.push(err69);
16149
+ }
16150
+ errors++;
16151
+ }
16152
+ } else {
16153
+ const err70 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/envelopeVersion/type", keyword: "type", params: { type: "number" }, message: "must be number" };
15825
16154
  if (vErrors === null) {
15826
- vErrors = [err41];
16155
+ vErrors = [err70];
15827
16156
  } else {
15828
- vErrors.push(err41);
16157
+ vErrors.push(err70);
15829
16158
  }
15830
16159
  errors++;
15831
16160
  }
15832
- } else {
15833
- const err42 = { instancePath: instancePath + "/batch/" + i0 + "/envelopeVersion", schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/properties/envelopeVersion/type", keyword: "type", params: { type: "number" }, message: "must be number" };
15834
- if (vErrors === null) {
15835
- vErrors = [err42];
15836
- } else {
15837
- vErrors.push(err42);
15838
- }
15839
- errors++;
15840
16161
  }
16162
+ var valid8 = _errs83 === errors;
16163
+ } else {
16164
+ var valid8 = true;
15841
16165
  }
15842
- var valid5 = _errs55 === errors;
15843
- } else {
15844
- var valid5 = true;
15845
16166
  }
15846
16167
  }
15847
16168
  }
@@ -15855,28 +16176,28 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
15855
16176
  }
15856
16177
  }
15857
16178
  } else {
15858
- const err43 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
16179
+ const err71 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" };
15859
16180
  if (vErrors === null) {
15860
- vErrors = [err43];
16181
+ vErrors = [err71];
15861
16182
  } else {
15862
- vErrors.push(err43);
16183
+ vErrors.push(err71);
15863
16184
  }
15864
16185
  errors++;
15865
16186
  }
15866
16187
  }
15867
- var _valid0 = _errs32 === errors;
16188
+ var _valid0 = _errs46 === errors;
15868
16189
  valid3 = valid3 || _valid0;
15869
16190
  if (_valid0) {
15870
- if (props0 !== true) {
15871
- props0 = true;
16191
+ if (props1 !== true) {
16192
+ props1 = true;
15872
16193
  }
15873
16194
  }
15874
16195
  if (!valid3) {
15875
- const err44 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
16196
+ const err72 = { instancePath: instancePath + "/batch/" + i0, schemaPath: "https://api.getprimitive.ai/contracts/cli-http-v1.schema.json#/$defs/MoveIngestRequest/properties/batch/items/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
15876
16197
  if (vErrors === null) {
15877
- vErrors = [err44];
16198
+ vErrors = [err72];
15878
16199
  } else {
15879
- vErrors.push(err44);
16200
+ vErrors.push(err72);
15880
16201
  }
15881
16202
  errors++;
15882
16203
  validate51.errors = vErrors;
@@ -19998,6 +20319,13 @@ function shellQuote(value) {
19998
20319
  }
19999
20320
  var STABLE_HOOK_ARGUMENTS_RE = /^[-A-Za-z0-9_ ]*$/u;
20000
20321
  var STABLE_HOOK_BIN_RE = /^[A-Za-z0-9][A-Za-z0-9-]*$/u;
20322
+ var PRIM_CONFIG_SHELL_RESOLVER = [
20323
+ 'prim_absolute() { case "$1" in [/]* ) ;; *) return 1 ;; esac; case "$1" in [[:space:]]*|*[[:space:]]|*[/][/]*|*[/].[/]*|*[/]..[/]*|*[/].|*[/]..|?*[/]) return 1 ;; esac; }; ',
20324
+ 'prim_config=${PRIM_CONFIG_DIR:-}; if ! prim_absolute "$prim_config"; then prim_config=${XDG_CONFIG_HOME:-}; if prim_absolute "$prim_config"; then ',
20325
+ 'case "$prim_config" in /) prim_config=/prim ;; *) prim_config="$prim_config/prim" ;; esac; ',
20326
+ 'else prim_home=${HOME:-}; prim_absolute "$prim_home" || exit 78; case "$prim_home" in /) prim_config=/.config/prim ;; *) prim_config="$prim_home/.config/prim" ;; esac; ',
20327
+ "fi; fi; "
20328
+ ].join("");
20001
20329
  function stableHookCommand(bin, args = "") {
20002
20330
  if (!STABLE_HOOK_BIN_RE.test(bin) || !STABLE_HOOK_ARGUMENTS_RE.test(args)) {
20003
20331
  throw new Error("invalid stable hook command");
@@ -20007,11 +20335,7 @@ function stableHookCommand(bin, args = "") {
20007
20335
  // it as inert data during the rolling window so an older uninstall or
20008
20336
  // reinstall can remove the stable entry without invoking npm or PATH.
20009
20337
  `prim_legacy_reader='-p ${PKG_NAME}@stable prim-shim.sh ${bin} '; `,
20010
- 'prim_absolute() { case "$1" in [/]* ) ;; *) return 1 ;; esac; case "$1" in [[:space:]]*|*[[:space:]]|*[/][/]*|*[/].[/]*|*[/]..[/]*|*[/].|*[/]..|?*[/]) return 1 ;; esac; }; ',
20011
- 'prim_config=${PRIM_CONFIG_DIR:-}; if ! prim_absolute "$prim_config"; then prim_config=${XDG_CONFIG_HOME:-}; if prim_absolute "$prim_config"; then ',
20012
- 'case "$prim_config" in /) prim_config=/prim ;; *) prim_config="$prim_config/prim" ;; esac; ',
20013
- 'else prim_home=${HOME:-}; prim_absolute "$prim_home" || exit 78; case "$prim_home" in /) prim_config=/.config/prim ;; *) prim_config="$prim_home/.config/prim" ;; esac; ',
20014
- "fi; fi; ",
20338
+ PRIM_CONFIG_SHELL_RESOLVER,
20015
20339
  `case "$prim_config" in /) prim_launcher=/${STABLE_HOOK_LAUNCHER_NAME} ;; *) prim_launcher="$prim_config/${STABLE_HOOK_LAUNCHER_NAME}" ;; esac; `,
20016
20340
  'exec "$prim_launcher" "$@"'
20017
20341
  ].join("");
@@ -20661,6 +20985,53 @@ import {
20661
20985
  writeFileSync as writeFileSync5
20662
20986
  } from "fs";
20663
20987
  import { delimiter, dirname as dirname8, isAbsolute as isAbsolute5, join as join11, resolve as resolve4 } from "path";
20988
+
20989
+ // src/lib/git-hook-contract.ts
20990
+ var GIT_HOOK_ENTRYPOINT_CONTENT = `#!/bin/sh
20991
+ # prim git hook entrypoint v1 \u2014 managed by prim; do not edit.
20992
+ # Run by the "# >>> prim <hook> hook >>>" block in a Git hook file. Acts only
20993
+ # where prim is active (git config prim.active true) and never fails the hook.
20994
+ case "$0" in */*) prim_dir=\${0%/*} ;; *) exit 0 ;; esac
20995
+ prim_launcher="$prim_dir/${STABLE_HOOK_LAUNCHER_NAME}"
20996
+ [ -x "$prim_launcher" ] || exit 0
20997
+ [ "$(git config --get prim.active 2>/dev/null)" = "true" ] || exit 0
20998
+ prim_hook=\${1-}
20999
+ if [ "$#" -gt 0 ]; then shift; fi
21000
+ case "$prim_hook" in
21001
+ pre-commit)
21002
+ "$prim_launcher" prim-pre-commit "$@" || :
21003
+ ;;
21004
+ post-commit)
21005
+ prim_sha=$(git rev-parse --verify HEAD 2>/dev/null) || exit 0
21006
+ case "$prim_sha" in *[!0-9a-f]* | "") exit 0 ;; esac
21007
+ case "\${#prim_sha}" in 40 | 64) ;; *) exit 0 ;; esac
21008
+ prim_branch=$(git symbolic-ref --quiet --short HEAD 2>/dev/null) || prim_branch=
21009
+ prim_observed=$(mktemp "\${TMPDIR:-/tmp}/prim-post-commit-observed.XXXXXXXX" 2>/dev/null) || prim_observed=
21010
+ (
21011
+ trap '' HUP
21012
+ trap 'if [ -n "$prim_observed" ]; then rm -f "$prim_observed"; fi' 0
21013
+ PRIM_COMMIT_SHA=$prim_sha PRIM_COMMIT_BRANCH=$prim_branch PRIM_COMMIT_OBSERVED_FILE=$prim_observed "$prim_launcher" prim-post-commit
21014
+ ) </dev/null >/dev/null 2>&1 &
21015
+ ;;
21016
+ post-rewrite)
21017
+ case "\${1-}" in amend | rebase) prim_source=$1 ;; *) exit 0 ;; esac
21018
+ prim_pairs=$(mktemp "\${TMPDIR:-/tmp}/prim-post-rewrite-pairs.XXXXXXXX" 2>/dev/null) || exit 0
21019
+ if ! chmod 600 "$prim_pairs" 2>/dev/null || ! cat >"$prim_pairs"; then
21020
+ rm -f "$prim_pairs"
21021
+ exit 0
21022
+ fi
21023
+ prim_branch=$(git symbolic-ref --quiet --short HEAD 2>/dev/null) || prim_branch=
21024
+ (
21025
+ trap '' HUP
21026
+ trap 'rm -f "$prim_pairs"' 0
21027
+ PRIM_REWRITE_SOURCE=$prim_source PRIM_REWRITE_BRANCH=$prim_branch PRIM_REWRITE_PAIRS_FILE=$prim_pairs "$prim_launcher" prim-post-rewrite
21028
+ ) </dev/null >/dev/null 2>&1 &
21029
+ ;;
21030
+ esac
21031
+ exit 0
21032
+ `;
21033
+
21034
+ // src/lib/hook-runtime.ts
20664
21035
  var RELEASE_PREFIX = "release-";
20665
21036
  var MAX_MANIFEST_BYTES = 64 * 1024;
20666
21037
  var RELEASE_GRACE_MS = 10 * 60 * 1e3;
@@ -21028,6 +21399,254 @@ function extractFileTargets(toolName, toolInput, agent = "claude_code") {
21028
21399
  return { paths, complete: paths.length > 0 };
21029
21400
  }
21030
21401
 
21402
+ // src/hooks/redact.ts
21403
+ import { existsSync as existsSync10, readFileSync as readFileSync12, statSync as statSync5 } from "fs";
21404
+ import { join as join14 } from "path";
21405
+ import { Worker } from "worker_threads";
21406
+ var USER_HOME_RULES = [
21407
+ {
21408
+ pattern: /\/Users\/[^/\\\s"'`]+/g,
21409
+ reason: "user-home-path",
21410
+ replacement: "/Users/__redacted_user__"
21411
+ },
21412
+ {
21413
+ pattern: /\/home\/[^/\\\s"'`]+/g,
21414
+ reason: "user-home-path",
21415
+ replacement: "/home/__redacted_user__"
21416
+ },
21417
+ {
21418
+ pattern: /([A-Za-z]:\\Users\\)[^/\\\s"'`]+/gi,
21419
+ reason: "user-home-path",
21420
+ replacement: "$1__redacted_user__"
21421
+ },
21422
+ {
21423
+ pattern: /\/root(?=\/|$)/g,
21424
+ reason: "user-home-path",
21425
+ replacement: "/__redacted_user__"
21426
+ }
21427
+ ];
21428
+ var DEFAULT_RULES = [
21429
+ { pattern: /Bearer\s+[A-Za-z0-9._~+/=-]+/gi, reason: "bearer-token" },
21430
+ {
21431
+ pattern: /\bsk-(?:(?:ant|proj)-)?[A-Za-z0-9_-]{16,}(?![A-Za-z0-9_-])/g,
21432
+ reason: "sk-api-key"
21433
+ },
21434
+ {
21435
+ pattern: /-----BEGIN [A-Z ]+PRIVATE KEY-----[\s\S]+?-----END [A-Z ]+PRIVATE KEY-----/g,
21436
+ reason: "private-key"
21437
+ },
21438
+ { pattern: /xox[abprs]-[A-Za-z0-9-]{10,}/g, reason: "slack-token" },
21439
+ {
21440
+ pattern: /\b(?:gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9_]{50,})\b/g,
21441
+ reason: "github-pat"
21442
+ },
21443
+ { pattern: /\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/g, reason: "aws-access-key" },
21444
+ {
21445
+ pattern: /\bAWS_(?:SECRET_ACCESS_KEY|SESSION_TOKEN)"?\s*[:=]\s*["']?[A-Za-z0-9/+=]{20,}["']?/gi,
21446
+ reason: "aws-secret"
21447
+ },
21448
+ { pattern: /\bAIza[0-9A-Za-z_-]{35}(?![0-9A-Za-z_-])/g, reason: "gcp-api-key" },
21449
+ {
21450
+ pattern: /\bya29\.[0-9A-Za-z_-]{20,}(?![0-9A-Za-z_-])/g,
21451
+ reason: "gcp-oauth-token"
21452
+ },
21453
+ {
21454
+ pattern: /\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*(?![A-Za-z0-9_-])/g,
21455
+ reason: "jwt"
21456
+ },
21457
+ { pattern: /\bBasic\s+[A-Za-z0-9+/]+={0,2}/gi, reason: "basic-auth" },
21458
+ { pattern: /\bhttps?:\/\/[^/\s:@]+:[^/\s@]+@/gi, reason: "basic-auth" },
21459
+ ...USER_HOME_RULES
21460
+ ];
21461
+ var MAX_SCRUB_LEN = 256e3;
21462
+ var MAX_WORKSPACE_CONFIG_BYTES = 64 * 1024;
21463
+ var MAX_WORKSPACE_RULES = 32;
21464
+ var MAX_WORKSPACE_PATTERN_LENGTH = 512;
21465
+ var MAX_WORKSPACE_REASON_LENGTH = 64;
21466
+ var WORKSPACE_RULE_TIMEOUT_MS = 250;
21467
+ var WORKSPACE_FILE2 = ".prim/redaction.json";
21468
+ var SAFE_REASON_RE = /^[A-Za-z0-9][A-Za-z0-9_-]*$/u;
21469
+ var SAFE_WORKSPACE_FLAGS_RE = /^[gimsu]*$/u;
21470
+ function debugRedaction(message) {
21471
+ writeHookDebug(`redaction: ${message}`);
21472
+ }
21473
+ function normalizedWorkspaceFlags(value) {
21474
+ if (value !== void 0 && typeof value !== "string") return null;
21475
+ const requested = value ?? "";
21476
+ if (!SAFE_WORKSPACE_FLAGS_RE.test(requested)) return null;
21477
+ return [...new Set(`g${requested}`)].sort().join("");
21478
+ }
21479
+ function loadWorkspaceRules(cwd) {
21480
+ const path = join14(cwd, WORKSPACE_FILE2);
21481
+ if (!existsSync10(path)) return [];
21482
+ let cfg;
21483
+ try {
21484
+ if (statSync5(path).size > MAX_WORKSPACE_CONFIG_BYTES) {
21485
+ debugRedaction(`ignoring oversized ${WORKSPACE_FILE2}`);
21486
+ return [];
21487
+ }
21488
+ cfg = JSON.parse(readFileSync12(path, "utf-8"));
21489
+ } catch {
21490
+ debugRedaction(`ignoring unparseable ${WORKSPACE_FILE2}`);
21491
+ return [];
21492
+ }
21493
+ if (!Array.isArray(cfg.rules)) return [];
21494
+ const compiled = [];
21495
+ for (const candidate of cfg.rules.slice(0, MAX_WORKSPACE_RULES)) {
21496
+ if (!candidate || typeof candidate !== "object") continue;
21497
+ const { pattern, reason } = candidate;
21498
+ const flags = normalizedWorkspaceFlags(candidate.flags);
21499
+ if (typeof pattern !== "string" || pattern.length === 0 || pattern.length > MAX_WORKSPACE_PATTERN_LENGTH || typeof reason !== "string" || reason.length === 0 || reason.length > MAX_WORKSPACE_REASON_LENGTH || !SAFE_REASON_RE.test(reason) || flags === null) {
21500
+ debugRedaction("skipping invalid workspace rule metadata");
21501
+ continue;
21502
+ }
21503
+ try {
21504
+ compiled.push({ pattern: new RegExp(pattern, flags), reason });
21505
+ } catch {
21506
+ debugRedaction(`skipping invalid workspace rule ${reason}`);
21507
+ }
21508
+ }
21509
+ return compiled;
21510
+ }
21511
+ function applyRules(input, rules) {
21512
+ if (input.length > MAX_SCRUB_LEN) return "<REDACTED:oversized>";
21513
+ let out = input;
21514
+ for (const rule of rules) {
21515
+ out = out.replace(rule.pattern, rule.replacement ?? `<REDACTED:${rule.reason}>`);
21516
+ }
21517
+ return out;
21518
+ }
21519
+ var REDACTED_OBJECT_KEY = "<REDACTED:object-key>";
21520
+ function redactedObjectKey(input, transform) {
21521
+ return transform(input) === input ? input : REDACTED_OBJECT_KEY;
21522
+ }
21523
+ function uniqueObjectKey(output, key) {
21524
+ let candidate = key;
21525
+ let suffix = 2;
21526
+ while (Object.hasOwn(output, candidate)) candidate = `${key}_${suffix++}`;
21527
+ return candidate;
21528
+ }
21529
+ function mapStrings(value, transform) {
21530
+ if (typeof value === "string") return transform(value);
21531
+ if (Array.isArray(value)) return value.map((item) => mapStrings(item, transform));
21532
+ if (value && typeof value === "object") {
21533
+ const out = /* @__PURE__ */ Object.create(null);
21534
+ for (const [key, item] of Object.entries(value)) {
21535
+ out[uniqueObjectKey(out, redactedObjectKey(key, transform))] = mapStrings(item, transform);
21536
+ }
21537
+ return out;
21538
+ }
21539
+ return value;
21540
+ }
21541
+ function scrub(value, rules = DEFAULT_RULES) {
21542
+ return mapStrings(value, (input) => applyRules(input, rules));
21543
+ }
21544
+ function debugDetail(value) {
21545
+ try {
21546
+ return String(value instanceof Error ? value.message : value);
21547
+ } catch {
21548
+ return "unprintable detail";
21549
+ }
21550
+ }
21551
+ function writeHookDebug(context, ...details) {
21552
+ if (!process.env.PRIM_HOOK_DEBUG) return;
21553
+ const raw = details.length > 0 ? `${context}: ${details.map(debugDetail).join(": ")}` : context;
21554
+ const normalized = terminalSafeLine(raw);
21555
+ const message = boundedHealthError(scrub(normalized, DEFAULT_RULES)) ?? context;
21556
+ process.stderr.write(`[prim-hook] ${message === `${context}:` ? context : message}
21557
+ `);
21558
+ }
21559
+ function redactEveryString(value, reason) {
21560
+ return mapStrings(value, () => `<REDACTED:${reason}>`);
21561
+ }
21562
+ var WORKSPACE_REDACTION_WORKER = String.raw`
21563
+ const { parentPort, workerData } = require("node:worker_threads");
21564
+ const REDACTED_OBJECT_KEY = "<REDACTED:object-key>";
21565
+ const rules = workerData.rules.map((rule) => ({
21566
+ pattern: new RegExp(rule.source, rule.flags),
21567
+ reason: rule.reason,
21568
+ }));
21569
+ function redact(input) {
21570
+ let output = input;
21571
+ for (const rule of rules) {
21572
+ output = output.replace(rule.pattern, "<REDACTED:" + rule.reason + ">");
21573
+ }
21574
+ return output;
21575
+ }
21576
+ function objectKey(input) {
21577
+ return redact(input) === input ? input : REDACTED_OBJECT_KEY;
21578
+ }
21579
+ function uniqueKey(output, key) {
21580
+ let candidate = key;
21581
+ let suffix = 2;
21582
+ while (Object.hasOwn(output, candidate)) candidate = key + "_" + suffix++;
21583
+ return candidate;
21584
+ }
21585
+ function walk(value) {
21586
+ if (typeof value === "string") {
21587
+ return redact(value);
21588
+ }
21589
+ if (Array.isArray(value)) return value.map(walk);
21590
+ if (value && typeof value === "object") {
21591
+ const output = Object.create(null);
21592
+ for (const [key, item] of Object.entries(value)) {
21593
+ output[uniqueKey(output, objectKey(key))] = walk(item);
21594
+ }
21595
+ return output;
21596
+ }
21597
+ return value;
21598
+ }
21599
+ parentPort.postMessage(walk(workerData.value));
21600
+ `;
21601
+ function applyWorkspaceRules(value, rules) {
21602
+ const serialized = rules.map(({ pattern, reason }) => ({
21603
+ source: pattern.source,
21604
+ flags: pattern.flags,
21605
+ reason
21606
+ }));
21607
+ return new Promise((resolve6) => {
21608
+ let worker;
21609
+ try {
21610
+ worker = new Worker(WORKSPACE_REDACTION_WORKER, {
21611
+ eval: true,
21612
+ workerData: { value, rules: serialized }
21613
+ });
21614
+ } catch {
21615
+ resolve6(redactEveryString(value, "workspace-rule-failed"));
21616
+ return;
21617
+ }
21618
+ let settled = false;
21619
+ const finish2 = (result) => {
21620
+ if (settled) return;
21621
+ settled = true;
21622
+ clearTimeout(timer);
21623
+ void worker.terminate();
21624
+ resolve6(result);
21625
+ };
21626
+ const failClosed = () => finish2(redactEveryString(value, "workspace-rule-failed"));
21627
+ const timer = setTimeout(failClosed, WORKSPACE_RULE_TIMEOUT_MS);
21628
+ worker.once("message", finish2);
21629
+ worker.once("error", failClosed);
21630
+ worker.once("exit", (code) => {
21631
+ if (code !== 0) failClosed();
21632
+ });
21633
+ });
21634
+ }
21635
+ async function scrubFromCwd(value, cwd) {
21636
+ const defaultScrubbed = scrub(value, DEFAULT_RULES);
21637
+ const workspaceRules = loadWorkspaceRules(cwd);
21638
+ return workspaceRules.length === 0 ? defaultScrubbed : await applyWorkspaceRules(defaultScrubbed, workspaceRules);
21639
+ }
21640
+ function scrubEnvironmentPaths(environment) {
21641
+ const scrubPath = (value) => value === void 0 ? void 0 : applyRules(value, USER_HOME_RULES);
21642
+ return {
21643
+ ...environment,
21644
+ cwd: scrubPath(environment.cwd) ?? environment.cwd,
21645
+ ...environment.repoRoot === void 0 ? {} : { repoRoot: scrubPath(environment.repoRoot) },
21646
+ ...environment.gitRoot === void 0 ? {} : { gitRoot: scrubPath(environment.gitRoot) }
21647
+ };
21648
+ }
21649
+
21031
21650
  // node_modules/.pnpm/unbash@4.0.3/node_modules/unbash/dist/chars.js
21032
21651
  var CH_TAB = 9;
21033
21652
  var CH_NL = 10;
@@ -24882,7 +25501,7 @@ var COMMAND_OPTIONS = {
24882
25501
  longOptionalValues: set("--color")
24883
25502
  },
24884
25503
  grep: {
24885
- shortFlags: "EFGHIPRTUVabcdhLlnqrsuvwxyZz",
25504
+ shortFlags: "EFGHIPRTUVabcdhiLlnoqrsuvwxyZz",
24886
25505
  shortValues: "ABCDefm",
24887
25506
  longFlags: set(
24888
25507
  "--basic-regexp --binary-files-without-match --byte-offset --count --extended-regexp --files-with-matches --files-without-match --fixed-regexp --fixed-strings --help --ignore-case --initial-tab --invert-match --line-buffered --line-number --line-regexp --null --null-data --only-matching --perl-regexp --quiet --recursive --silent --unix-byte-offsets --version --with-filename --word-regexp"
@@ -24893,12 +25512,14 @@ var COMMAND_OPTIONS = {
24893
25512
  longOptionalValues: set("--color")
24894
25513
  },
24895
25514
  head: {
25515
+ numericCount: true,
24896
25516
  shortFlags: "qvz",
24897
25517
  shortValues: "cn",
24898
25518
  longFlags: set("--help --quiet --verbose --version --zero-terminated"),
24899
25519
  longValues: set("--bytes --lines")
24900
25520
  },
24901
25521
  tail: {
25522
+ numericCount: true,
24902
25523
  shortFlags: "Fqsvz",
24903
25524
  shortValues: "cn",
24904
25525
  longFlags: set("--help --quiet --retry --silent --verbose --version --zero-terminated"),
@@ -24923,6 +25544,7 @@ var COMMAND_OPTIONS = {
24923
25544
  }
24924
25545
  };
24925
25546
  var GIT_INSPECTION_OPTIONS = {
25547
+ numericCount: true,
24926
25548
  shortFlags: "abcdfhiklmnprstuvwz",
24927
25549
  shortValues: "ABCGLMSU",
24928
25550
  longFlags: set(
@@ -25065,6 +25687,7 @@ function parseOptions(args, spec) {
25065
25687
  optionsEnded = true;
25066
25688
  continue;
25067
25689
  }
25690
+ if (spec.numericCount && /^-\d+$/.test(arg)) continue;
25068
25691
  if (arg.startsWith("--")) {
25069
25692
  const separator = arg.indexOf("=");
25070
25693
  const option = separator === -1 ? arg : arg.slice(0, separator);
@@ -25459,10 +26082,11 @@ function analyzeShellTargets(source) {
25459
26082
  // src/hooks/file-refs.ts
25460
26083
  var MAX_PREFLIGHT_FILE_TARGETS = 25;
25461
26084
  function primitiveMetadataForResolution(resolution) {
25462
- const shouldAttach = resolution.fileRefs.length > 0 || resolution.rejected.length > 0 || resolution.targetsIncomplete || resolution.targetsTruncated || resolution.shellMutation !== void 0;
26085
+ const shouldAttach = resolution.fileRefs.length > 0 || (resolution.targetCheckouts?.length ?? 0) > 0 || resolution.rejected.length > 0 || resolution.targetsIncomplete || resolution.targetsTruncated || resolution.shellMutation !== void 0;
25463
26086
  if (!shouldAttach) return;
25464
26087
  return {
25465
26088
  fileRefs: [...resolution.fileRefs],
26089
+ ...resolution.targetCheckouts ? { targetCheckouts: resolution.targetCheckouts } : {},
25466
26090
  ...resolution.rejected.length > 0 || resolution.targetsIncomplete ? { fileRefsIncomplete: true } : {},
25467
26091
  ...resolution.targetsTruncated ? { fileRefsTruncated: true } : {},
25468
26092
  ...resolution.shellMutation !== void 0 ? { shellMutation: resolution.shellMutation } : {}
@@ -25487,13 +26111,55 @@ function resolveHookFileRefs(args) {
25487
26111
  const targetsTruncated = uniqueRawPaths.length > MAX_PREFLIGHT_FILE_TARGETS;
25488
26112
  const fileRefs = /* @__PURE__ */ new Set();
25489
26113
  const rejected = [];
26114
+ const targets = /* @__PURE__ */ new Map();
25490
26115
  for (const path of uniqueRawPaths.slice(0, MAX_PREFLIGHT_FILE_TARGETS)) {
25491
26116
  const canonical = canonicalRepositoryPath(path, args.repository, args.cwd);
25492
26117
  if (canonical.ok) fileRefs.add(canonical.file);
25493
- else rejected.push({ path, reason: canonical.reason });
26118
+ else {
26119
+ const target = args.captureTargets && canonical.reason === "outside_repository" ? relatedWorktreeTarget(path, args.cwd, args.repository) : null;
26120
+ const resolved = target ? canonicalRepositoryPath(path, target, args.cwd) : null;
26121
+ if (target && resolved?.ok && isRepoActiveForCapture(target.repoRoot) && repoSyncId(target.repoRoot) === args.repository.repoSyncId && args.repository.repoSyncId && cachedCollectScopeAdmits(target.repoRoot, {
26122
+ repository: target.repoFullName,
26123
+ branch: currentBranch(target.repoRoot),
26124
+ agent: args.agent,
26125
+ paths: [resolved.file],
26126
+ pathsComplete: true
26127
+ })) {
26128
+ const group = targets.get(target.repoRoot) ?? { repository: target, fileRefs: [] };
26129
+ group.fileRefs.push(resolved.file);
26130
+ targets.set(target.repoRoot, group);
26131
+ } else rejected.push({ path, reason: canonical.reason });
26132
+ }
26133
+ }
26134
+ const targetCheckouts = [];
26135
+ if (targets.size > 0) {
26136
+ if (fileRefs.size > 0)
26137
+ targets.set(args.repository.repoRoot, {
26138
+ repository: args.repository,
26139
+ fileRefs: [...fileRefs]
26140
+ });
26141
+ for (const { repository, fileRefs: paths } of targets.values()) {
26142
+ const identity = getOrCreateWorkspaceId(repository.repoRoot);
26143
+ const binding = repoSyncId(repository.repoRoot);
26144
+ if (identity.status !== "ready" || !binding) {
26145
+ rejected.push({ path: repository.repoRoot, reason: "invalid_path" });
26146
+ continue;
26147
+ }
26148
+ const root = scrubEnvironmentPaths({
26149
+ cwd: repository.repoRoot,
26150
+ gitRoot: repository.repoRoot
26151
+ }).gitRoot;
26152
+ targetCheckouts.push({
26153
+ gitRoot: root,
26154
+ workspaceId: identity.workspaceId,
26155
+ repoSyncId: binding,
26156
+ fileRefs: paths
26157
+ });
26158
+ }
25494
26159
  }
25495
26160
  return {
25496
26161
  fileRefs: [...fileRefs],
26162
+ ...targetCheckouts.length > 0 ? { targetCheckouts } : {},
25497
26163
  rejected,
25498
26164
  targetsIncomplete: nativeTargets?.complete === false,
25499
26165
  targetsTruncated,
@@ -25507,7 +26173,8 @@ function enrichHookPayloadWithFileRefs(args) {
25507
26173
  toolInput: args.parsed.tool_input,
25508
26174
  agent: args.agent,
25509
26175
  cwd: args.cwd,
25510
- repository: args.repository
26176
+ repository: args.repository,
26177
+ captureTargets: true
25511
26178
  });
25512
26179
  const primitive = primitiveMetadataForResolution(resolution);
25513
26180
  if (!primitive) return { parsed: args.parsed, resolution };
@@ -25744,30 +26411,30 @@ function requireDurableIngestAcknowledgement(value, expected, cwd = process.cwd(
25744
26411
  import {
25745
26412
  appendFileSync,
25746
26413
  closeSync as closeSync3,
25747
- existsSync as existsSync11,
26414
+ existsSync as existsSync12,
25748
26415
  fstatSync,
25749
26416
  mkdirSync as mkdirSync7,
25750
26417
  openSync as openSync3,
25751
26418
  opendirSync,
25752
- readFileSync as readFileSync13,
26419
+ readFileSync as readFileSync14,
25753
26420
  readSync,
25754
26421
  readdirSync as readdirSync4
25755
26422
  } from "fs";
25756
- import { dirname as dirname11, join as join15 } from "path";
26423
+ import { dirname as dirname11, join as join16 } from "path";
25757
26424
 
25758
26425
  // src/drain-progress.ts
25759
26426
  import {
25760
26427
  chmodSync as chmodSync5,
25761
- existsSync as existsSync10,
25762
- readFileSync as readFileSync12,
26428
+ existsSync as existsSync11,
26429
+ readFileSync as readFileSync13,
25763
26430
  readdirSync as readdirSync3,
25764
26431
  rmSync as rmSync6,
25765
26432
  rmdirSync
25766
26433
  } from "fs";
25767
- import { basename as basename2, dirname as dirname10, join as join14 } from "path";
26434
+ import { basename as basename2, dirname as dirname10, join as join15 } from "path";
25768
26435
 
25769
26436
  // src/journal.ts
25770
- var JOURNAL_DIR = join15(primConfigDirectory(), "moves");
26437
+ var JOURNAL_DIR = join16(primConfigDirectory(), "moves");
25771
26438
  var UNBOUND_BUCKET = "_unbound";
25772
26439
  var JOURNAL_BASENAME = "journal.ndjson";
25773
26440
  var JOURNAL_STATS_SAMPLE_BYTES = 64 * 1024;
@@ -25779,7 +26446,7 @@ function envSlug(apiUrl) {
25779
26446
  return slug;
25780
26447
  }
25781
26448
  function currentEnvDir() {
25782
- return join15(JOURNAL_DIR, envSlug(getSiteUrl()));
26449
+ return join16(JOURNAL_DIR, envSlug(getSiteUrl()));
25783
26450
  }
25784
26451
  var DIR_MODE = 448;
25785
26452
  var FILE_MODE2 = 384;
@@ -25787,7 +26454,7 @@ var SAFE_BUCKET = /^[A-Za-z0-9_-]+$/;
25787
26454
  var RESERVED_BUCKETS = /* @__PURE__ */ new Set([UNBOUND_BUCKET, "_legacy"]);
25788
26455
  function appendMoveToPath(path, move) {
25789
26456
  const dir = dirname11(path);
25790
- if (!existsSync11(dir)) {
26457
+ if (!existsSync12(dir)) {
25791
26458
  mkdirSync7(dir, { recursive: true, mode: DIR_MODE });
25792
26459
  }
25793
26460
  appendFileSync(path, `${JSON.stringify(move)}
@@ -25795,10 +26462,10 @@ function appendMoveToPath(path, move) {
25795
26462
  }
25796
26463
  function bucketDir(orgId) {
25797
26464
  const safe = orgId !== void 0 && SAFE_BUCKET.test(orgId) && !RESERVED_BUCKETS.has(orgId);
25798
- return join15(currentEnvDir(), safe ? orgId : UNBOUND_BUCKET);
26465
+ return join16(currentEnvDir(), safe ? orgId : UNBOUND_BUCKET);
25799
26466
  }
25800
26467
  function journalPath(orgId) {
25801
- return join15(bucketDir(orgId), JOURNAL_BASENAME);
26468
+ return join16(bucketDir(orgId), JOURNAL_BASENAME);
25802
26469
  }
25803
26470
  function appendMove(move, orgId) {
25804
26471
  appendMoveToPath(journalPath(orgId), move);
@@ -25824,254 +26491,6 @@ import { platform } from "os";
25824
26491
  // src/protocol/move.ts
25825
26492
  var AGENT_ENVELOPE_VERSION = 3;
25826
26493
 
25827
- // src/hooks/redact.ts
25828
- import { existsSync as existsSync12, readFileSync as readFileSync14, statSync as statSync5 } from "fs";
25829
- import { join as join16 } from "path";
25830
- import { Worker } from "worker_threads";
25831
- var USER_HOME_RULES = [
25832
- {
25833
- pattern: /\/Users\/[^/\\\s"'`]+/g,
25834
- reason: "user-home-path",
25835
- replacement: "/Users/__redacted_user__"
25836
- },
25837
- {
25838
- pattern: /\/home\/[^/\\\s"'`]+/g,
25839
- reason: "user-home-path",
25840
- replacement: "/home/__redacted_user__"
25841
- },
25842
- {
25843
- pattern: /([A-Za-z]:\\Users\\)[^/\\\s"'`]+/gi,
25844
- reason: "user-home-path",
25845
- replacement: "$1__redacted_user__"
25846
- },
25847
- {
25848
- pattern: /\/root(?=\/|$)/g,
25849
- reason: "user-home-path",
25850
- replacement: "/__redacted_user__"
25851
- }
25852
- ];
25853
- var DEFAULT_RULES = [
25854
- { pattern: /Bearer\s+[A-Za-z0-9._~+/=-]+/gi, reason: "bearer-token" },
25855
- {
25856
- pattern: /\bsk-(?:(?:ant|proj)-)?[A-Za-z0-9_-]{16,}(?![A-Za-z0-9_-])/g,
25857
- reason: "sk-api-key"
25858
- },
25859
- {
25860
- pattern: /-----BEGIN [A-Z ]+PRIVATE KEY-----[\s\S]+?-----END [A-Z ]+PRIVATE KEY-----/g,
25861
- reason: "private-key"
25862
- },
25863
- { pattern: /xox[abprs]-[A-Za-z0-9-]{10,}/g, reason: "slack-token" },
25864
- {
25865
- pattern: /\b(?:gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9_]{50,})\b/g,
25866
- reason: "github-pat"
25867
- },
25868
- { pattern: /\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/g, reason: "aws-access-key" },
25869
- {
25870
- pattern: /\bAWS_(?:SECRET_ACCESS_KEY|SESSION_TOKEN)"?\s*[:=]\s*["']?[A-Za-z0-9/+=]{20,}["']?/gi,
25871
- reason: "aws-secret"
25872
- },
25873
- { pattern: /\bAIza[0-9A-Za-z_-]{35}(?![0-9A-Za-z_-])/g, reason: "gcp-api-key" },
25874
- {
25875
- pattern: /\bya29\.[0-9A-Za-z_-]{20,}(?![0-9A-Za-z_-])/g,
25876
- reason: "gcp-oauth-token"
25877
- },
25878
- {
25879
- pattern: /\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*(?![A-Za-z0-9_-])/g,
25880
- reason: "jwt"
25881
- },
25882
- { pattern: /\bBasic\s+[A-Za-z0-9+/]+={0,2}/gi, reason: "basic-auth" },
25883
- { pattern: /\bhttps?:\/\/[^/\s:@]+:[^/\s@]+@/gi, reason: "basic-auth" },
25884
- ...USER_HOME_RULES
25885
- ];
25886
- var MAX_SCRUB_LEN = 256e3;
25887
- var MAX_WORKSPACE_CONFIG_BYTES = 64 * 1024;
25888
- var MAX_WORKSPACE_RULES = 32;
25889
- var MAX_WORKSPACE_PATTERN_LENGTH = 512;
25890
- var MAX_WORKSPACE_REASON_LENGTH = 64;
25891
- var WORKSPACE_RULE_TIMEOUT_MS = 250;
25892
- var WORKSPACE_FILE2 = ".prim/redaction.json";
25893
- var SAFE_REASON_RE = /^[A-Za-z0-9][A-Za-z0-9_-]*$/u;
25894
- var SAFE_WORKSPACE_FLAGS_RE = /^[gimsu]*$/u;
25895
- function debugRedaction(message) {
25896
- writeHookDebug(`redaction: ${message}`);
25897
- }
25898
- function normalizedWorkspaceFlags(value) {
25899
- if (value !== void 0 && typeof value !== "string") return null;
25900
- const requested = value ?? "";
25901
- if (!SAFE_WORKSPACE_FLAGS_RE.test(requested)) return null;
25902
- return [...new Set(`g${requested}`)].sort().join("");
25903
- }
25904
- function loadWorkspaceRules(cwd) {
25905
- const path = join16(cwd, WORKSPACE_FILE2);
25906
- if (!existsSync12(path)) return [];
25907
- let cfg;
25908
- try {
25909
- if (statSync5(path).size > MAX_WORKSPACE_CONFIG_BYTES) {
25910
- debugRedaction(`ignoring oversized ${WORKSPACE_FILE2}`);
25911
- return [];
25912
- }
25913
- cfg = JSON.parse(readFileSync14(path, "utf-8"));
25914
- } catch {
25915
- debugRedaction(`ignoring unparseable ${WORKSPACE_FILE2}`);
25916
- return [];
25917
- }
25918
- if (!Array.isArray(cfg.rules)) return [];
25919
- const compiled = [];
25920
- for (const candidate of cfg.rules.slice(0, MAX_WORKSPACE_RULES)) {
25921
- if (!candidate || typeof candidate !== "object") continue;
25922
- const { pattern, reason } = candidate;
25923
- const flags = normalizedWorkspaceFlags(candidate.flags);
25924
- if (typeof pattern !== "string" || pattern.length === 0 || pattern.length > MAX_WORKSPACE_PATTERN_LENGTH || typeof reason !== "string" || reason.length === 0 || reason.length > MAX_WORKSPACE_REASON_LENGTH || !SAFE_REASON_RE.test(reason) || flags === null) {
25925
- debugRedaction("skipping invalid workspace rule metadata");
25926
- continue;
25927
- }
25928
- try {
25929
- compiled.push({ pattern: new RegExp(pattern, flags), reason });
25930
- } catch {
25931
- debugRedaction(`skipping invalid workspace rule ${reason}`);
25932
- }
25933
- }
25934
- return compiled;
25935
- }
25936
- function applyRules(input, rules) {
25937
- if (input.length > MAX_SCRUB_LEN) return "<REDACTED:oversized>";
25938
- let out = input;
25939
- for (const rule of rules) {
25940
- out = out.replace(rule.pattern, rule.replacement ?? `<REDACTED:${rule.reason}>`);
25941
- }
25942
- return out;
25943
- }
25944
- var REDACTED_OBJECT_KEY = "<REDACTED:object-key>";
25945
- function redactedObjectKey(input, transform) {
25946
- return transform(input) === input ? input : REDACTED_OBJECT_KEY;
25947
- }
25948
- function uniqueObjectKey(output, key) {
25949
- let candidate = key;
25950
- let suffix = 2;
25951
- while (Object.hasOwn(output, candidate)) candidate = `${key}_${suffix++}`;
25952
- return candidate;
25953
- }
25954
- function mapStrings(value, transform) {
25955
- if (typeof value === "string") return transform(value);
25956
- if (Array.isArray(value)) return value.map((item) => mapStrings(item, transform));
25957
- if (value && typeof value === "object") {
25958
- const out = /* @__PURE__ */ Object.create(null);
25959
- for (const [key, item] of Object.entries(value)) {
25960
- out[uniqueObjectKey(out, redactedObjectKey(key, transform))] = mapStrings(item, transform);
25961
- }
25962
- return out;
25963
- }
25964
- return value;
25965
- }
25966
- function scrub(value, rules = DEFAULT_RULES) {
25967
- return mapStrings(value, (input) => applyRules(input, rules));
25968
- }
25969
- function debugDetail(value) {
25970
- try {
25971
- return String(value instanceof Error ? value.message : value);
25972
- } catch {
25973
- return "unprintable detail";
25974
- }
25975
- }
25976
- function writeHookDebug(context, ...details) {
25977
- if (!process.env.PRIM_HOOK_DEBUG) return;
25978
- const raw = details.length > 0 ? `${context}: ${details.map(debugDetail).join(": ")}` : context;
25979
- const normalized = terminalSafeLine(raw);
25980
- const message = boundedHealthError(scrub(normalized, DEFAULT_RULES)) ?? context;
25981
- process.stderr.write(`[prim-hook] ${message === `${context}:` ? context : message}
25982
- `);
25983
- }
25984
- function redactEveryString(value, reason) {
25985
- return mapStrings(value, () => `<REDACTED:${reason}>`);
25986
- }
25987
- var WORKSPACE_REDACTION_WORKER = String.raw`
25988
- const { parentPort, workerData } = require("node:worker_threads");
25989
- const REDACTED_OBJECT_KEY = "<REDACTED:object-key>";
25990
- const rules = workerData.rules.map((rule) => ({
25991
- pattern: new RegExp(rule.source, rule.flags),
25992
- reason: rule.reason,
25993
- }));
25994
- function redact(input) {
25995
- let output = input;
25996
- for (const rule of rules) {
25997
- output = output.replace(rule.pattern, "<REDACTED:" + rule.reason + ">");
25998
- }
25999
- return output;
26000
- }
26001
- function objectKey(input) {
26002
- return redact(input) === input ? input : REDACTED_OBJECT_KEY;
26003
- }
26004
- function uniqueKey(output, key) {
26005
- let candidate = key;
26006
- let suffix = 2;
26007
- while (Object.hasOwn(output, candidate)) candidate = key + "_" + suffix++;
26008
- return candidate;
26009
- }
26010
- function walk(value) {
26011
- if (typeof value === "string") {
26012
- return redact(value);
26013
- }
26014
- if (Array.isArray(value)) return value.map(walk);
26015
- if (value && typeof value === "object") {
26016
- const output = Object.create(null);
26017
- for (const [key, item] of Object.entries(value)) {
26018
- output[uniqueKey(output, objectKey(key))] = walk(item);
26019
- }
26020
- return output;
26021
- }
26022
- return value;
26023
- }
26024
- parentPort.postMessage(walk(workerData.value));
26025
- `;
26026
- function applyWorkspaceRules(value, rules) {
26027
- const serialized = rules.map(({ pattern, reason }) => ({
26028
- source: pattern.source,
26029
- flags: pattern.flags,
26030
- reason
26031
- }));
26032
- return new Promise((resolve6) => {
26033
- let worker;
26034
- try {
26035
- worker = new Worker(WORKSPACE_REDACTION_WORKER, {
26036
- eval: true,
26037
- workerData: { value, rules: serialized }
26038
- });
26039
- } catch {
26040
- resolve6(redactEveryString(value, "workspace-rule-failed"));
26041
- return;
26042
- }
26043
- let settled = false;
26044
- const finish2 = (result) => {
26045
- if (settled) return;
26046
- settled = true;
26047
- clearTimeout(timer);
26048
- void worker.terminate();
26049
- resolve6(result);
26050
- };
26051
- const failClosed = () => finish2(redactEveryString(value, "workspace-rule-failed"));
26052
- const timer = setTimeout(failClosed, WORKSPACE_RULE_TIMEOUT_MS);
26053
- worker.once("message", finish2);
26054
- worker.once("error", failClosed);
26055
- worker.once("exit", (code) => {
26056
- if (code !== 0) failClosed();
26057
- });
26058
- });
26059
- }
26060
- async function scrubFromCwd(value, cwd) {
26061
- const defaultScrubbed = scrub(value, DEFAULT_RULES);
26062
- const workspaceRules = loadWorkspaceRules(cwd);
26063
- return workspaceRules.length === 0 ? defaultScrubbed : await applyWorkspaceRules(defaultScrubbed, workspaceRules);
26064
- }
26065
- function scrubEnvironmentPaths(environment) {
26066
- const scrubPath = (value) => value === void 0 ? void 0 : applyRules(value, USER_HOME_RULES);
26067
- return {
26068
- ...environment,
26069
- cwd: scrubPath(environment.cwd) ?? environment.cwd,
26070
- ...environment.repoRoot === void 0 ? {} : { repoRoot: scrubPath(environment.repoRoot) },
26071
- ...environment.gitRoot === void 0 ? {} : { gitRoot: scrubPath(environment.gitRoot) }
26072
- };
26073
- }
26074
-
26075
26494
  // src/hooks/prim-hook-core.ts
26076
26495
  var CORRELATED_TOOL_EVENTS = /* @__PURE__ */ new Set([
26077
26496
  "PostToolUse",
@@ -26239,7 +26658,7 @@ async function emitWithAcknowledgment(output, acknowledge) {
26239
26658
  await acknowledge?.(handedOff);
26240
26659
  }
26241
26660
  async function emitCursorContext(envelope) {
26242
- if (typeof envelope.session_id !== "string" || envelope.session_id.length === 0 || typeof envelope.cwd !== "string" || envelope.cwd.length === 0) {
26661
+ if (!isRepoActiveForCapture(envelope.cwd ?? process.cwd()) || typeof envelope.session_id !== "string" || envelope.session_id.length === 0 || typeof envelope.cwd !== "string" || envelope.cwd.length === 0) {
26243
26662
  await emit();
26244
26663
  return;
26245
26664
  }
@@ -26337,7 +26756,7 @@ async function main() {
26337
26756
  await finish(agent, envelope);
26338
26757
  return;
26339
26758
  }
26340
- if (resolution.shellMutation === void 0 && resolution.fileRefs.length === 0) {
26759
+ if (resolution.shellMutation === void 0 && resolution.fileRefs.length === 0 && !resolution.targetCheckouts?.length) {
26341
26760
  await finish(agent, envelope);
26342
26761
  return;
26343
26762
  }