@primitive.ai/prim 0.1.0-alpha.94 → 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 (40) hide show
  1. package/README.md +7 -4
  2. package/dist/{chunk-UKUAAAXE.js → chunk-27ADT6FQ.js} +2 -2
  3. package/dist/{chunk-OTHKG76J.js → chunk-35FMRWJH.js} +1 -1
  4. package/dist/{chunk-DXJQR4QI.js → chunk-4GHANPWQ.js} +2 -2
  5. package/dist/{chunk-WUXFLE7X.js → chunk-7KABYYWG.js} +64 -66
  6. package/dist/{chunk-LFFLHSQO.js → chunk-CU7RW7XU.js} +63 -6
  7. package/dist/{chunk-H4UNYFUC.js → chunk-DHOQGHKQ.js} +184 -1
  8. package/dist/{chunk-2GP5UFV7.js → chunk-DWRSEC34.js} +5 -3
  9. package/dist/{chunk-O7YAW7G6.js → chunk-FVDBULGZ.js} +9 -11
  10. package/dist/{chunk-G2VMA2QO.js → chunk-LY6NJ7KL.js} +6 -4
  11. package/dist/{chunk-ZB4F75SZ.js → chunk-MXVCP33E.js} +5 -1
  12. package/dist/{chunk-TYAHC25F.js → chunk-QCBB5HFX.js} +1 -1
  13. package/dist/{chunk-IMK4JKTA.js → chunk-RK4ZS3HG.js} +2 -2
  14. package/dist/{chunk-ZU563PQI.js → chunk-ROLYLXJS.js} +2 -2
  15. package/dist/{chunk-OH3EZXYX.js → chunk-UO2U6IKF.js} +1 -1
  16. package/dist/{chunk-K7D2EYBS.js → chunk-URLLSALP.js} +2 -2
  17. package/dist/{chunk-FXF4JWK2.js → chunk-XEDJ5N3M.js} +17 -2
  18. package/dist/{chunk-AXQQMX2U.js → chunk-Y5W4TZM7.js} +2 -2
  19. package/dist/{chunk-ICM2XCXS.js → chunk-YYE2NLWX.js} +2 -2
  20. package/dist/{chunk-DSWT6BCC.js → chunk-Z6NPNLOT.js} +825 -665
  21. package/dist/daemon/server.js +836 -540
  22. package/dist/hook-runtime/daemon/server.js +836 -540
  23. package/dist/hook-runtime/hooks/post-commit.js +836 -540
  24. package/dist/hook-runtime/hooks/post-rewrite.js +836 -540
  25. package/dist/hook-runtime/hooks/post-tool-use.js +1160 -791
  26. package/dist/hook-runtime/hooks/pre-tool-use.js +2060 -1751
  27. package/dist/hook-runtime/hooks/prim-hook.js +1257 -856
  28. package/dist/hook-runtime/hooks/session-end.js +179 -129
  29. package/dist/hook-runtime/hooks/session-start.js +938 -640
  30. package/dist/hook-runtime/index.js +892 -554
  31. package/dist/hooks/post-commit.js +11 -11
  32. package/dist/hooks/post-rewrite.js +10 -10
  33. package/dist/hooks/post-tool-use.js +20 -20
  34. package/dist/hooks/pre-commit.js +4 -4
  35. package/dist/hooks/pre-tool-use.js +29 -17
  36. package/dist/hooks/prim-hook.js +22 -18
  37. package/dist/hooks/session-end.js +11 -5
  38. package/dist/hooks/session-start.js +26 -22
  39. package/dist/index.js +79 -60
  40. package/package.json +1 -1
@@ -12924,6 +12924,24 @@ function gitToplevel(cwd) {
12924
12924
  return null;
12925
12925
  }
12926
12926
  }
12927
+ function mainWorktreeRoot(cwd) {
12928
+ try {
12929
+ const [gitDir, commonDir] = execFileSync(
12930
+ "git",
12931
+ ["rev-parse", "--git-dir", "--git-common-dir"],
12932
+ {
12933
+ cwd,
12934
+ encoding: "utf-8",
12935
+ stdio: ["ignore", "pipe", "ignore"],
12936
+ timeout: GIT_TIMEOUT_MS
12937
+ }
12938
+ ).trim().split("\n").map((value) => resolve(cwd ?? process.cwd(), value));
12939
+ if (gitDir === void 0 || commonDir === void 0 || gitDir === commonDir) return null;
12940
+ return basename(commonDir) === ".git" ? dirname(commonDir) : null;
12941
+ } catch {
12942
+ return null;
12943
+ }
12944
+ }
12927
12945
  function gitValue(cwd, args) {
12928
12946
  try {
12929
12947
  const value = execFileSync("git", args, {
@@ -25113,7 +25131,6 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
25113
25131
  }
25114
25132
  validate45.evaluated = { "dynamicProps": true, "dynamicItems": false };
25115
25133
  var isGitHubInstallIntentStartErrorResponse = validate46;
25116
- 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 }] };
25117
25134
  function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
25118
25135
  ;
25119
25136
  let vErrors = null;
@@ -25263,7 +25280,7 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25263
25280
  if (errors === _errs12) {
25264
25281
  if (data && typeof data == "object" && !Array.isArray(data)) {
25265
25282
  let missing2;
25266
- if (data.error === void 0 && (missing2 = "error") || data.feature === void 0 && (missing2 = "feature")) {
25283
+ if (data.error === void 0 && (missing2 = "error")) {
25267
25284
  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 + "'" };
25268
25285
  if (vErrors === null) {
25269
25286
  vErrors = [err10];
@@ -25274,7 +25291,7 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25274
25291
  } else {
25275
25292
  const _errs14 = errors;
25276
25293
  for (const key2 in data) {
25277
- if (!(key2 === "error" || key2 === "feature")) {
25294
+ if (!(key2 === "error")) {
25278
25295
  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" };
25279
25296
  if (vErrors === null) {
25280
25297
  vErrors = [err11];
@@ -25288,7 +25305,6 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25288
25305
  if (_errs14 === errors) {
25289
25306
  if (data.error !== void 0) {
25290
25307
  let data2 = data.error;
25291
- const _errs15 = errors;
25292
25308
  if (typeof data2 !== "string") {
25293
25309
  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" };
25294
25310
  if (vErrors === null) {
@@ -25298,8 +25314,8 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25298
25314
  }
25299
25315
  errors++;
25300
25316
  }
25301
- if ("feature_disabled" !== data2) {
25302
- 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" };
25317
+ if ("github_connect_unavailable" !== data2) {
25318
+ 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" };
25303
25319
  if (vErrors === null) {
25304
25320
  vErrors = [err13];
25305
25321
  } else {
@@ -25307,45 +25323,15 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25307
25323
  }
25308
25324
  errors++;
25309
25325
  }
25310
- var valid4 = _errs15 === errors;
25311
- } else {
25312
- var valid4 = true;
25313
- }
25314
- if (valid4) {
25315
- if (data.feature !== void 0) {
25316
- let data3 = data.feature;
25317
- const _errs17 = errors;
25318
- if (typeof data3 !== "string") {
25319
- 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" };
25320
- if (vErrors === null) {
25321
- vErrors = [err14];
25322
- } else {
25323
- vErrors.push(err14);
25324
- }
25325
- errors++;
25326
- }
25327
- if ("github-connect" !== data3) {
25328
- 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" };
25329
- if (vErrors === null) {
25330
- vErrors = [err15];
25331
- } else {
25332
- vErrors.push(err15);
25333
- }
25334
- errors++;
25335
- }
25336
- var valid4 = _errs17 === errors;
25337
- } else {
25338
- var valid4 = true;
25339
- }
25340
25326
  }
25341
25327
  }
25342
25328
  }
25343
25329
  } else {
25344
- 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" };
25330
+ 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" };
25345
25331
  if (vErrors === null) {
25346
- vErrors = [err16];
25332
+ vErrors = [err14];
25347
25333
  } else {
25348
- vErrors.push(err16);
25334
+ vErrors.push(err14);
25349
25335
  }
25350
25336
  errors++;
25351
25337
  }
@@ -25357,148 +25343,117 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25357
25343
  props0 = true;
25358
25344
  }
25359
25345
  }
25360
- const _errs19 = errors;
25361
- if (errors === _errs19) {
25346
+ const _errs17 = errors;
25347
+ if (errors === _errs17) {
25362
25348
  if (data && typeof data == "object" && !Array.isArray(data)) {
25363
25349
  let missing3;
25364
- if (data.error === void 0 && (missing3 = "error") || data.feature === void 0 && (missing3 = "feature")) {
25365
- 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 + "'" };
25350
+ if (data.error === void 0 && (missing3 = "error")) {
25351
+ 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 + "'" };
25366
25352
  if (vErrors === null) {
25367
- vErrors = [err17];
25353
+ vErrors = [err15];
25368
25354
  } else {
25369
- vErrors.push(err17);
25355
+ vErrors.push(err15);
25370
25356
  }
25371
25357
  errors++;
25372
25358
  } else {
25373
- const _errs21 = errors;
25359
+ const _errs19 = errors;
25374
25360
  for (const key3 in data) {
25375
- if (!(key3 === "error" || key3 === "feature")) {
25376
- 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" };
25361
+ if (!(key3 === "error")) {
25362
+ 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" };
25377
25363
  if (vErrors === null) {
25378
- vErrors = [err18];
25364
+ vErrors = [err16];
25379
25365
  } else {
25380
- vErrors.push(err18);
25366
+ vErrors.push(err16);
25381
25367
  }
25382
25368
  errors++;
25383
25369
  break;
25384
25370
  }
25385
25371
  }
25386
- if (_errs21 === errors) {
25372
+ if (_errs19 === errors) {
25387
25373
  if (data.error !== void 0) {
25388
- let data4 = data.error;
25389
- const _errs22 = errors;
25390
- if (typeof data4 !== "string") {
25391
- 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" };
25374
+ let data3 = data.error;
25375
+ if (typeof data3 !== "string") {
25376
+ 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" };
25392
25377
  if (vErrors === null) {
25393
- vErrors = [err19];
25378
+ vErrors = [err17];
25394
25379
  } else {
25395
- vErrors.push(err19);
25380
+ vErrors.push(err17);
25396
25381
  }
25397
25382
  errors++;
25398
25383
  }
25399
- if (!(data4 === "github_connect_unavailable" || data4 === "feature_check_unavailable")) {
25400
- 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" };
25384
+ if ("WorkOS identity authority is temporarily unavailable" !== data3) {
25385
+ 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" };
25401
25386
  if (vErrors === null) {
25402
- vErrors = [err20];
25387
+ vErrors = [err18];
25403
25388
  } else {
25404
- vErrors.push(err20);
25389
+ vErrors.push(err18);
25405
25390
  }
25406
25391
  errors++;
25407
25392
  }
25408
- var valid5 = _errs22 === errors;
25409
- } else {
25410
- var valid5 = true;
25411
- }
25412
- if (valid5) {
25413
- if (data.feature !== void 0) {
25414
- let data5 = data.feature;
25415
- const _errs24 = errors;
25416
- if (typeof data5 !== "string") {
25417
- 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" };
25418
- if (vErrors === null) {
25419
- vErrors = [err21];
25420
- } else {
25421
- vErrors.push(err21);
25422
- }
25423
- errors++;
25424
- }
25425
- if ("github-connect" !== data5) {
25426
- 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" };
25427
- if (vErrors === null) {
25428
- vErrors = [err22];
25429
- } else {
25430
- vErrors.push(err22);
25431
- }
25432
- errors++;
25433
- }
25434
- var valid5 = _errs24 === errors;
25435
- } else {
25436
- var valid5 = true;
25437
- }
25438
25393
  }
25439
25394
  }
25440
25395
  }
25441
25396
  } else {
25442
- 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" };
25397
+ 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" };
25443
25398
  if (vErrors === null) {
25444
- vErrors = [err23];
25399
+ vErrors = [err19];
25445
25400
  } else {
25446
- vErrors.push(err23);
25401
+ vErrors.push(err19);
25447
25402
  }
25448
25403
  errors++;
25449
25404
  }
25450
25405
  }
25451
- var _valid0 = _errs19 === errors;
25406
+ var _valid0 = _errs17 === errors;
25452
25407
  valid1 = valid1 || _valid0;
25453
25408
  if (_valid0) {
25454
25409
  if (props0 !== true) {
25455
25410
  props0 = true;
25456
25411
  }
25457
25412
  }
25458
- const _errs26 = errors;
25459
- if (errors === _errs26) {
25413
+ const _errs22 = errors;
25414
+ if (errors === _errs22) {
25460
25415
  if (data && typeof data == "object" && !Array.isArray(data)) {
25461
25416
  let missing4;
25462
25417
  if (data.error === void 0 && (missing4 = "error")) {
25463
- 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 + "'" };
25418
+ 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 + "'" };
25464
25419
  if (vErrors === null) {
25465
- vErrors = [err24];
25420
+ vErrors = [err20];
25466
25421
  } else {
25467
- vErrors.push(err24);
25422
+ vErrors.push(err20);
25468
25423
  }
25469
25424
  errors++;
25470
25425
  } else {
25471
- const _errs28 = errors;
25426
+ const _errs24 = errors;
25472
25427
  for (const key4 in data) {
25473
25428
  if (!(key4 === "error")) {
25474
- 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" };
25429
+ 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" };
25475
25430
  if (vErrors === null) {
25476
- vErrors = [err25];
25431
+ vErrors = [err21];
25477
25432
  } else {
25478
- vErrors.push(err25);
25433
+ vErrors.push(err21);
25479
25434
  }
25480
25435
  errors++;
25481
25436
  break;
25482
25437
  }
25483
25438
  }
25484
- if (_errs28 === errors) {
25439
+ if (_errs24 === errors) {
25485
25440
  if (data.error !== void 0) {
25486
- let data6 = data.error;
25487
- if (typeof data6 !== "string") {
25488
- 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" };
25441
+ let data4 = data.error;
25442
+ if (typeof data4 !== "string") {
25443
+ 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" };
25489
25444
  if (vErrors === null) {
25490
- vErrors = [err26];
25445
+ vErrors = [err22];
25491
25446
  } else {
25492
- vErrors.push(err26);
25447
+ vErrors.push(err22);
25493
25448
  }
25494
25449
  errors++;
25495
25450
  }
25496
- if ("WorkOS identity authority is temporarily unavailable" !== data6) {
25497
- 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" };
25451
+ if ("github_install_intent_conflict" !== data4) {
25452
+ 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" };
25498
25453
  if (vErrors === null) {
25499
- vErrors = [err27];
25454
+ vErrors = [err23];
25500
25455
  } else {
25501
- vErrors.push(err27);
25456
+ vErrors.push(err23);
25502
25457
  }
25503
25458
  errors++;
25504
25459
  }
@@ -25506,195 +25461,128 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25506
25461
  }
25507
25462
  }
25508
25463
  } else {
25509
- 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" };
25464
+ 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" };
25510
25465
  if (vErrors === null) {
25511
- vErrors = [err28];
25466
+ vErrors = [err24];
25512
25467
  } else {
25513
- vErrors.push(err28);
25468
+ vErrors.push(err24);
25514
25469
  }
25515
25470
  errors++;
25516
25471
  }
25517
25472
  }
25518
- var _valid0 = _errs26 === errors;
25473
+ var _valid0 = _errs22 === errors;
25519
25474
  valid1 = valid1 || _valid0;
25520
25475
  if (_valid0) {
25521
25476
  if (props0 !== true) {
25522
25477
  props0 = true;
25523
25478
  }
25524
25479
  }
25525
- const _errs31 = errors;
25526
- if (errors === _errs31) {
25480
+ const _errs27 = errors;
25481
+ if (errors === _errs27) {
25527
25482
  if (data && typeof data == "object" && !Array.isArray(data)) {
25528
25483
  let missing5;
25529
- if (data.error === void 0 && (missing5 = "error")) {
25530
- 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 + "'" };
25484
+ if (data.error === void 0 && (missing5 = "error") || data.retryAt === void 0 && (missing5 = "retryAt")) {
25485
+ 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 + "'" };
25531
25486
  if (vErrors === null) {
25532
- vErrors = [err29];
25487
+ vErrors = [err25];
25533
25488
  } else {
25534
- vErrors.push(err29);
25489
+ vErrors.push(err25);
25535
25490
  }
25536
25491
  errors++;
25537
25492
  } else {
25538
- const _errs33 = errors;
25493
+ const _errs29 = errors;
25539
25494
  for (const key5 in data) {
25540
- if (!(key5 === "error")) {
25541
- 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" };
25495
+ if (!(key5 === "error" || key5 === "retryAt")) {
25496
+ 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" };
25542
25497
  if (vErrors === null) {
25543
- vErrors = [err30];
25498
+ vErrors = [err26];
25544
25499
  } else {
25545
- vErrors.push(err30);
25500
+ vErrors.push(err26);
25546
25501
  }
25547
25502
  errors++;
25548
25503
  break;
25549
25504
  }
25550
25505
  }
25551
- if (_errs33 === errors) {
25506
+ if (_errs29 === errors) {
25552
25507
  if (data.error !== void 0) {
25553
- let data7 = data.error;
25554
- if (typeof data7 !== "string") {
25555
- 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" };
25556
- if (vErrors === null) {
25557
- vErrors = [err31];
25558
- } else {
25559
- vErrors.push(err31);
25560
- }
25561
- errors++;
25562
- }
25563
- if ("github_install_intent_conflict" !== data7) {
25564
- 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" };
25565
- if (vErrors === null) {
25566
- vErrors = [err32];
25567
- } else {
25568
- vErrors.push(err32);
25569
- }
25570
- errors++;
25571
- }
25572
- }
25573
- }
25574
- }
25575
- } else {
25576
- 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" };
25577
- if (vErrors === null) {
25578
- vErrors = [err33];
25579
- } else {
25580
- vErrors.push(err33);
25581
- }
25582
- errors++;
25583
- }
25584
- }
25585
- var _valid0 = _errs31 === errors;
25586
- valid1 = valid1 || _valid0;
25587
- if (_valid0) {
25588
- if (props0 !== true) {
25589
- props0 = true;
25590
- }
25591
- }
25592
- const _errs36 = errors;
25593
- if (errors === _errs36) {
25594
- if (data && typeof data == "object" && !Array.isArray(data)) {
25595
- let missing6;
25596
- if (data.error === void 0 && (missing6 = "error") || data.retryAt === void 0 && (missing6 = "retryAt")) {
25597
- 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 + "'" };
25598
- if (vErrors === null) {
25599
- vErrors = [err34];
25600
- } else {
25601
- vErrors.push(err34);
25602
- }
25603
- errors++;
25604
- } else {
25605
- const _errs38 = errors;
25606
- for (const key6 in data) {
25607
- if (!(key6 === "error" || key6 === "retryAt")) {
25608
- 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" };
25609
- if (vErrors === null) {
25610
- vErrors = [err35];
25611
- } else {
25612
- vErrors.push(err35);
25613
- }
25614
- errors++;
25615
- break;
25616
- }
25617
- }
25618
- if (_errs38 === errors) {
25619
- if (data.error !== void 0) {
25620
- let data8 = data.error;
25621
- const _errs39 = errors;
25622
- if (typeof data8 !== "string") {
25623
- 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" };
25508
+ let data5 = data.error;
25509
+ const _errs30 = errors;
25510
+ if (typeof data5 !== "string") {
25511
+ 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" };
25624
25512
  if (vErrors === null) {
25625
- vErrors = [err36];
25513
+ vErrors = [err27];
25626
25514
  } else {
25627
- vErrors.push(err36);
25515
+ vErrors.push(err27);
25628
25516
  }
25629
25517
  errors++;
25630
25518
  }
25631
- if ("github_install_intent_rate_limited" !== data8) {
25632
- 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" };
25519
+ if ("github_install_intent_rate_limited" !== data5) {
25520
+ 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" };
25633
25521
  if (vErrors === null) {
25634
- vErrors = [err37];
25522
+ vErrors = [err28];
25635
25523
  } else {
25636
- vErrors.push(err37);
25524
+ vErrors.push(err28);
25637
25525
  }
25638
25526
  errors++;
25639
25527
  }
25640
- var valid8 = _errs39 === errors;
25528
+ var valid7 = _errs30 === errors;
25641
25529
  } else {
25642
- var valid8 = true;
25530
+ var valid7 = true;
25643
25531
  }
25644
- if (valid8) {
25532
+ if (valid7) {
25645
25533
  if (data.retryAt !== void 0) {
25646
- let data9 = data.retryAt;
25647
- const _errs41 = errors;
25648
- if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
25649
- 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" };
25534
+ let data6 = data.retryAt;
25535
+ const _errs32 = errors;
25536
+ if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6)) && isFinite(data6))) {
25537
+ 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" };
25650
25538
  if (vErrors === null) {
25651
- vErrors = [err38];
25539
+ vErrors = [err29];
25652
25540
  } else {
25653
- vErrors.push(err38);
25541
+ vErrors.push(err29);
25654
25542
  }
25655
25543
  errors++;
25656
25544
  }
25657
- if (errors === _errs41) {
25658
- if (typeof data9 == "number" && isFinite(data9)) {
25659
- if (data9 > 9007199254740991 || isNaN(data9)) {
25660
- 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" };
25545
+ if (errors === _errs32) {
25546
+ if (typeof data6 == "number" && isFinite(data6)) {
25547
+ if (data6 > 9007199254740991 || isNaN(data6)) {
25548
+ 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" };
25661
25549
  if (vErrors === null) {
25662
- vErrors = [err39];
25550
+ vErrors = [err30];
25663
25551
  } else {
25664
- vErrors.push(err39);
25552
+ vErrors.push(err30);
25665
25553
  }
25666
25554
  errors++;
25667
25555
  } else {
25668
- if (data9 < 0 || isNaN(data9)) {
25669
- 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" };
25556
+ if (data6 < 0 || isNaN(data6)) {
25557
+ 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" };
25670
25558
  if (vErrors === null) {
25671
- vErrors = [err40];
25559
+ vErrors = [err31];
25672
25560
  } else {
25673
- vErrors.push(err40);
25561
+ vErrors.push(err31);
25674
25562
  }
25675
25563
  errors++;
25676
25564
  }
25677
25565
  }
25678
25566
  }
25679
25567
  }
25680
- var valid8 = _errs41 === errors;
25568
+ var valid7 = _errs32 === errors;
25681
25569
  } else {
25682
- var valid8 = true;
25570
+ var valid7 = true;
25683
25571
  }
25684
25572
  }
25685
25573
  }
25686
25574
  }
25687
25575
  } else {
25688
- 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" };
25576
+ 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" };
25689
25577
  if (vErrors === null) {
25690
- vErrors = [err41];
25578
+ vErrors = [err32];
25691
25579
  } else {
25692
- vErrors.push(err41);
25580
+ vErrors.push(err32);
25693
25581
  }
25694
25582
  errors++;
25695
25583
  }
25696
25584
  }
25697
- var _valid0 = _errs36 === errors;
25585
+ var _valid0 = _errs27 === errors;
25698
25586
  valid1 = valid1 || _valid0;
25699
25587
  if (_valid0) {
25700
25588
  if (props0 !== true) {
@@ -25702,11 +25590,11 @@ function validate46(data, { instancePath = "", parentData, parentDataProperty, r
25702
25590
  }
25703
25591
  }
25704
25592
  if (!valid1) {
25705
- 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" };
25593
+ 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" };
25706
25594
  if (vErrors === null) {
25707
- vErrors = [err42];
25595
+ vErrors = [err33];
25708
25596
  } else {
25709
- vErrors.push(err42);
25597
+ vErrors.push(err33);
25710
25598
  }
25711
25599
  errors++;
25712
25600
  validate46.errors = vErrors;
@@ -27811,7 +27699,7 @@ function validate50(data, { instancePath = "", parentData, parentDataProperty, r
27811
27699
  }
27812
27700
  validate50.evaluated = { "dynamicProps": true, "dynamicItems": false };
27813
27701
  var isMoveIngestRequest = validate51;
27814
- 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": {} };
27702
+ 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": {} };
27815
27703
  var pattern8 = new RegExp("^[A-Za-z0-9_-]+$", "u");
27816
27704
  function validate51(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
27817
27705
  ;
@@ -27938,13 +27826,18 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
27938
27826
  var valid4 = true;
27939
27827
  }
27940
27828
  if (valid4) {
27941
- if (data1.capturedOrganizationId !== void 0) {
27942
- let data7 = data1.capturedOrganizationId;
27829
+ if (data1.repositoryContext !== void 0) {
27830
+ let data7 = data1.repositoryContext;
27943
27831
  const _errs20 = errors;
27944
- if (errors === _errs20) {
27945
- if (typeof data7 === "string") {
27946
- if (func1(data7) > 128) {
27947
- 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" };
27832
+ const _errs21 = errors;
27833
+ let valid5 = false;
27834
+ let passing0 = null;
27835
+ const _errs22 = errors;
27836
+ if (errors === _errs22) {
27837
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
27838
+ let missing2;
27839
+ if (data7.kind === void 0 && (missing2 = "kind") || data7.repoSyncId === void 0 && (missing2 = "repoSyncId")) {
27840
+ 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 + "'" };
27948
27841
  if (vErrors === null) {
27949
27842
  vErrors = [err6];
27950
27843
  } else {
@@ -27952,184 +27845,392 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
27952
27845
  }
27953
27846
  errors++;
27954
27847
  } else {
27955
- if (func1(data7) < 1) {
27956
- 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" };
27957
- if (vErrors === null) {
27958
- vErrors = [err7];
27959
- } else {
27960
- vErrors.push(err7);
27961
- }
27962
- errors++;
27963
- } else {
27964
- if (!pattern8.test(data7)) {
27965
- 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_-]+$"' };
27848
+ const _errs24 = errors;
27849
+ for (const key0 in data7) {
27850
+ if (!(key0 === "kind" || key0 === "repoSyncId")) {
27851
+ 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" };
27966
27852
  if (vErrors === null) {
27967
- vErrors = [err8];
27853
+ vErrors = [err7];
27968
27854
  } else {
27969
- vErrors.push(err8);
27855
+ vErrors.push(err7);
27970
27856
  }
27971
27857
  errors++;
27858
+ break;
27859
+ }
27860
+ }
27861
+ if (_errs24 === errors) {
27862
+ if (data7.kind !== void 0) {
27863
+ let data8 = data7.kind;
27864
+ const _errs25 = errors;
27865
+ if (typeof data8 !== "string") {
27866
+ 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" };
27867
+ if (vErrors === null) {
27868
+ vErrors = [err8];
27869
+ } else {
27870
+ vErrors.push(err8);
27871
+ }
27872
+ errors++;
27873
+ }
27874
+ if ("repository_bound" !== data8) {
27875
+ 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" };
27876
+ if (vErrors === null) {
27877
+ vErrors = [err9];
27878
+ } else {
27879
+ vErrors.push(err9);
27880
+ }
27881
+ errors++;
27882
+ }
27883
+ var valid6 = _errs25 === errors;
27884
+ } else {
27885
+ var valid6 = true;
27886
+ }
27887
+ if (valid6) {
27888
+ if (data7.repoSyncId !== void 0) {
27889
+ let data9 = data7.repoSyncId;
27890
+ const _errs27 = errors;
27891
+ if (errors === _errs27) {
27892
+ if (typeof data9 === "string") {
27893
+ if (func1(data9) > 128) {
27894
+ 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" };
27895
+ if (vErrors === null) {
27896
+ vErrors = [err10];
27897
+ } else {
27898
+ vErrors.push(err10);
27899
+ }
27900
+ errors++;
27901
+ } else {
27902
+ if (func1(data9) < 1) {
27903
+ 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" };
27904
+ if (vErrors === null) {
27905
+ vErrors = [err11];
27906
+ } else {
27907
+ vErrors.push(err11);
27908
+ }
27909
+ errors++;
27910
+ }
27911
+ }
27912
+ } else {
27913
+ 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" };
27914
+ if (vErrors === null) {
27915
+ vErrors = [err12];
27916
+ } else {
27917
+ vErrors.push(err12);
27918
+ }
27919
+ errors++;
27920
+ }
27921
+ }
27922
+ var valid6 = _errs27 === errors;
27923
+ } else {
27924
+ var valid6 = true;
27925
+ }
27972
27926
  }
27973
27927
  }
27974
27928
  }
27975
27929
  } else {
27976
- 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" };
27930
+ 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" };
27977
27931
  if (vErrors === null) {
27978
- vErrors = [err9];
27932
+ vErrors = [err13];
27979
27933
  } else {
27980
- vErrors.push(err9);
27934
+ vErrors.push(err13);
27981
27935
  }
27982
27936
  errors++;
27983
27937
  }
27984
27938
  }
27985
- var valid4 = _errs20 === errors;
27986
- } else {
27987
- var valid4 = true;
27988
- }
27989
- if (valid4) {
27990
- if (data1.captureAuthorityKind !== void 0) {
27991
- let data8 = data1.captureAuthorityKind;
27992
- const _errs22 = errors;
27993
- if (typeof data8 !== "string") {
27994
- 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" };
27995
- if (vErrors === null) {
27996
- vErrors = [err10];
27939
+ var _valid1 = _errs22 === errors;
27940
+ if (_valid1) {
27941
+ valid5 = true;
27942
+ passing0 = 0;
27943
+ var props0 = true;
27944
+ }
27945
+ const _errs29 = errors;
27946
+ if (errors === _errs29) {
27947
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
27948
+ let missing3;
27949
+ if (data7.kind === void 0 && (missing3 = "kind")) {
27950
+ 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 + "'" };
27951
+ if (vErrors === null) {
27952
+ vErrors = [err14];
27953
+ } else {
27954
+ vErrors.push(err14);
27955
+ }
27956
+ errors++;
27997
27957
  } else {
27998
- vErrors.push(err10);
27958
+ const _errs31 = errors;
27959
+ for (const key1 in data7) {
27960
+ if (!(key1 === "kind")) {
27961
+ 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" };
27962
+ if (vErrors === null) {
27963
+ vErrors = [err15];
27964
+ } else {
27965
+ vErrors.push(err15);
27966
+ }
27967
+ errors++;
27968
+ break;
27969
+ }
27970
+ }
27971
+ if (_errs31 === errors) {
27972
+ if (data7.kind !== void 0) {
27973
+ let data10 = data7.kind;
27974
+ if (typeof data10 !== "string") {
27975
+ 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" };
27976
+ if (vErrors === null) {
27977
+ vErrors = [err16];
27978
+ } else {
27979
+ vErrors.push(err16);
27980
+ }
27981
+ errors++;
27982
+ }
27983
+ if ("non_repository" !== data10) {
27984
+ 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" };
27985
+ if (vErrors === null) {
27986
+ vErrors = [err17];
27987
+ } else {
27988
+ vErrors.push(err17);
27989
+ }
27990
+ errors++;
27991
+ }
27992
+ }
27993
+ }
27999
27994
  }
28000
- errors++;
28001
- }
28002
- if (!(data8 === "workos" || data8 === "service_token")) {
28003
- 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" };
27995
+ } else {
27996
+ 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" };
28004
27997
  if (vErrors === null) {
28005
- vErrors = [err11];
27998
+ vErrors = [err18];
28006
27999
  } else {
28007
- vErrors.push(err11);
28000
+ vErrors.push(err18);
28008
28001
  }
28009
28002
  errors++;
28010
28003
  }
28011
- var valid4 = _errs22 === errors;
28004
+ }
28005
+ var _valid1 = _errs29 === errors;
28006
+ if (_valid1 && valid5) {
28007
+ valid5 = false;
28008
+ passing0 = [passing0, 1];
28012
28009
  } else {
28013
- var valid4 = true;
28010
+ if (_valid1) {
28011
+ valid5 = true;
28012
+ passing0 = 1;
28013
+ if (props0 !== true) {
28014
+ props0 = true;
28015
+ }
28016
+ }
28014
28017
  }
28015
- if (valid4) {
28016
- if (data1.decisionLifecycleProtocolVersion !== void 0) {
28017
- let data9 = data1.decisionLifecycleProtocolVersion;
28018
- const _errs24 = errors;
28019
- if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9)) && isFinite(data9))) {
28020
- 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" };
28021
- if (vErrors === null) {
28022
- vErrors = [err12];
28023
- } else {
28024
- vErrors.push(err12);
28025
- }
28026
- errors++;
28018
+ if (!valid5) {
28019
+ 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" };
28020
+ if (vErrors === null) {
28021
+ vErrors = [err19];
28022
+ } else {
28023
+ vErrors.push(err19);
28024
+ }
28025
+ errors++;
28026
+ } else {
28027
+ errors = _errs21;
28028
+ if (vErrors !== null) {
28029
+ if (_errs21) {
28030
+ vErrors.length = _errs21;
28031
+ } else {
28032
+ vErrors = null;
28027
28033
  }
28028
- if (errors === _errs24) {
28029
- if (typeof data9 == "number" && isFinite(data9)) {
28030
- if (data9 > 9007199254740991 || isNaN(data9)) {
28031
- 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" };
28034
+ }
28035
+ }
28036
+ var valid4 = _errs20 === errors;
28037
+ } else {
28038
+ var valid4 = true;
28039
+ }
28040
+ if (valid4) {
28041
+ if (data1.capturedOrganizationId !== void 0) {
28042
+ let data11 = data1.capturedOrganizationId;
28043
+ const _errs34 = errors;
28044
+ if (errors === _errs34) {
28045
+ if (typeof data11 === "string") {
28046
+ if (func1(data11) > 128) {
28047
+ 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" };
28048
+ if (vErrors === null) {
28049
+ vErrors = [err20];
28050
+ } else {
28051
+ vErrors.push(err20);
28052
+ }
28053
+ errors++;
28054
+ } else {
28055
+ if (func1(data11) < 1) {
28056
+ 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" };
28032
28057
  if (vErrors === null) {
28033
- vErrors = [err13];
28058
+ vErrors = [err21];
28034
28059
  } else {
28035
- vErrors.push(err13);
28060
+ vErrors.push(err21);
28036
28061
  }
28037
28062
  errors++;
28038
28063
  } else {
28039
- if (data9 < 1 || isNaN(data9)) {
28040
- 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" };
28064
+ if (!pattern8.test(data11)) {
28065
+ 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_-]+$"' };
28041
28066
  if (vErrors === null) {
28042
- vErrors = [err14];
28067
+ vErrors = [err22];
28043
28068
  } else {
28044
- vErrors.push(err14);
28069
+ vErrors.push(err22);
28045
28070
  }
28046
28071
  errors++;
28047
28072
  }
28048
28073
  }
28049
28074
  }
28075
+ } else {
28076
+ 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" };
28077
+ if (vErrors === null) {
28078
+ vErrors = [err23];
28079
+ } else {
28080
+ vErrors.push(err23);
28081
+ }
28082
+ errors++;
28050
28083
  }
28051
- var valid4 = _errs24 === errors;
28084
+ }
28085
+ var valid4 = _errs34 === errors;
28086
+ } else {
28087
+ var valid4 = true;
28088
+ }
28089
+ if (valid4) {
28090
+ if (data1.captureAuthorityKind !== void 0) {
28091
+ let data12 = data1.captureAuthorityKind;
28092
+ const _errs36 = errors;
28093
+ if (typeof data12 !== "string") {
28094
+ 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" };
28095
+ if (vErrors === null) {
28096
+ vErrors = [err24];
28097
+ } else {
28098
+ vErrors.push(err24);
28099
+ }
28100
+ errors++;
28101
+ }
28102
+ if (!(data12 === "workos" || data12 === "service_token")) {
28103
+ 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" };
28104
+ if (vErrors === null) {
28105
+ vErrors = [err25];
28106
+ } else {
28107
+ vErrors.push(err25);
28108
+ }
28109
+ errors++;
28110
+ }
28111
+ var valid4 = _errs36 === errors;
28052
28112
  } else {
28053
28113
  var valid4 = true;
28054
28114
  }
28055
28115
  if (valid4) {
28056
- if (data1.producer !== void 0) {
28057
- let data10 = data1.producer;
28058
- const _errs26 = errors;
28059
- if (typeof data10 !== "string") {
28060
- 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" };
28116
+ if (data1.decisionLifecycleProtocolVersion !== void 0) {
28117
+ let data13 = data1.decisionLifecycleProtocolVersion;
28118
+ const _errs38 = errors;
28119
+ if (!(typeof data13 == "number" && (!(data13 % 1) && !isNaN(data13)) && isFinite(data13))) {
28120
+ 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" };
28061
28121
  if (vErrors === null) {
28062
- vErrors = [err15];
28122
+ vErrors = [err26];
28063
28123
  } else {
28064
- vErrors.push(err15);
28124
+ vErrors.push(err26);
28065
28125
  }
28066
28126
  errors++;
28067
28127
  }
28068
- if (!(data10 === "claude_code" || data10 === "codex" || data10 === "cursor" || data10 === "hermes")) {
28069
- 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" };
28070
- if (vErrors === null) {
28071
- vErrors = [err16];
28072
- } else {
28073
- vErrors.push(err16);
28128
+ if (errors === _errs38) {
28129
+ if (typeof data13 == "number" && isFinite(data13)) {
28130
+ if (data13 > 9007199254740991 || isNaN(data13)) {
28131
+ 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" };
28132
+ if (vErrors === null) {
28133
+ vErrors = [err27];
28134
+ } else {
28135
+ vErrors.push(err27);
28136
+ }
28137
+ errors++;
28138
+ } else {
28139
+ if (data13 < 1 || isNaN(data13)) {
28140
+ 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" };
28141
+ if (vErrors === null) {
28142
+ vErrors = [err28];
28143
+ } else {
28144
+ vErrors.push(err28);
28145
+ }
28146
+ errors++;
28147
+ }
28148
+ }
28074
28149
  }
28075
- errors++;
28076
28150
  }
28077
- var valid4 = _errs26 === errors;
28151
+ var valid4 = _errs38 === errors;
28078
28152
  } else {
28079
28153
  var valid4 = true;
28080
28154
  }
28081
28155
  if (valid4) {
28082
- if (data1.toolOutcome !== void 0) {
28083
- let data11 = data1.toolOutcome;
28084
- const _errs28 = errors;
28085
- if (typeof data11 !== "string") {
28086
- 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" };
28156
+ if (data1.producer !== void 0) {
28157
+ let data14 = data1.producer;
28158
+ const _errs40 = errors;
28159
+ if (typeof data14 !== "string") {
28160
+ 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" };
28087
28161
  if (vErrors === null) {
28088
- vErrors = [err17];
28162
+ vErrors = [err29];
28089
28163
  } else {
28090
- vErrors.push(err17);
28164
+ vErrors.push(err29);
28091
28165
  }
28092
28166
  errors++;
28093
28167
  }
28094
- if (!(data11 === "succeeded" || data11 === "returned" || data11 === "failed" || data11 === "interrupted" || data11 === "prevented" || data11 === "unknown")) {
28095
- 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" };
28168
+ if (!(data14 === "claude_code" || data14 === "codex" || data14 === "cursor" || data14 === "hermes")) {
28169
+ 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" };
28096
28170
  if (vErrors === null) {
28097
- vErrors = [err18];
28171
+ vErrors = [err30];
28098
28172
  } else {
28099
- vErrors.push(err18);
28173
+ vErrors.push(err30);
28100
28174
  }
28101
28175
  errors++;
28102
28176
  }
28103
- var valid4 = _errs28 === errors;
28177
+ var valid4 = _errs40 === errors;
28104
28178
  } else {
28105
28179
  var valid4 = true;
28106
28180
  }
28107
28181
  if (valid4) {
28108
- if (data1.envelopeVersion !== void 0) {
28109
- let data12 = data1.envelopeVersion;
28110
- const _errs30 = errors;
28111
- if (!(typeof data12 == "number" && isFinite(data12))) {
28112
- 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" };
28182
+ if (data1.toolOutcome !== void 0) {
28183
+ let data15 = data1.toolOutcome;
28184
+ const _errs42 = errors;
28185
+ if (typeof data15 !== "string") {
28186
+ 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" };
28113
28187
  if (vErrors === null) {
28114
- vErrors = [err19];
28188
+ vErrors = [err31];
28115
28189
  } else {
28116
- vErrors.push(err19);
28190
+ vErrors.push(err31);
28117
28191
  }
28118
28192
  errors++;
28119
28193
  }
28120
- if (4 !== data12) {
28121
- 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" };
28194
+ if (!(data15 === "succeeded" || data15 === "returned" || data15 === "failed" || data15 === "interrupted" || data15 === "prevented" || data15 === "unknown")) {
28195
+ 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" };
28122
28196
  if (vErrors === null) {
28123
- vErrors = [err20];
28197
+ vErrors = [err32];
28124
28198
  } else {
28125
- vErrors.push(err20);
28199
+ vErrors.push(err32);
28126
28200
  }
28127
28201
  errors++;
28128
28202
  }
28129
- var valid4 = _errs30 === errors;
28203
+ var valid4 = _errs42 === errors;
28130
28204
  } else {
28131
28205
  var valid4 = true;
28132
28206
  }
28207
+ if (valid4) {
28208
+ if (data1.envelopeVersion !== void 0) {
28209
+ let data16 = data1.envelopeVersion;
28210
+ const _errs44 = errors;
28211
+ if (!(typeof data16 == "number" && isFinite(data16))) {
28212
+ 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" };
28213
+ if (vErrors === null) {
28214
+ vErrors = [err33];
28215
+ } else {
28216
+ vErrors.push(err33);
28217
+ }
28218
+ errors++;
28219
+ }
28220
+ if (4 !== data16) {
28221
+ 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" };
28222
+ if (vErrors === null) {
28223
+ vErrors = [err34];
28224
+ } else {
28225
+ vErrors.push(err34);
28226
+ }
28227
+ errors++;
28228
+ }
28229
+ var valid4 = _errs44 === errors;
28230
+ } else {
28231
+ var valid4 = true;
28232
+ }
28233
+ }
28133
28234
  }
28134
28235
  }
28135
28236
  }
@@ -28142,11 +28243,11 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
28142
28243
  }
28143
28244
  }
28144
28245
  } else {
28145
- 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" };
28246
+ 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" };
28146
28247
  if (vErrors === null) {
28147
- vErrors = [err21];
28248
+ vErrors = [err35];
28148
28249
  } else {
28149
- vErrors.push(err21);
28250
+ vErrors.push(err35);
28150
28251
  }
28151
28252
  errors++;
28152
28253
  }
@@ -28154,296 +28255,509 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
28154
28255
  var _valid0 = _errs7 === errors;
28155
28256
  valid3 = valid3 || _valid0;
28156
28257
  if (_valid0) {
28157
- var props0 = true;
28258
+ var props1 = true;
28158
28259
  }
28159
- const _errs32 = errors;
28160
- if (errors === _errs32) {
28260
+ const _errs46 = errors;
28261
+ if (errors === _errs46) {
28161
28262
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
28162
- let missing2;
28163
- 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")) {
28164
- 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 + "'" };
28263
+ let missing4;
28264
+ 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")) {
28265
+ 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 + "'" };
28165
28266
  if (vErrors === null) {
28166
- vErrors = [err22];
28267
+ vErrors = [err36];
28167
28268
  } else {
28168
- vErrors.push(err22);
28269
+ vErrors.push(err36);
28169
28270
  }
28170
28271
  errors++;
28171
28272
  } else {
28172
28273
  if (data1.moveId !== void 0) {
28173
- const _errs35 = errors;
28274
+ const _errs49 = errors;
28174
28275
  if (typeof data1.moveId !== "string") {
28175
- 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" };
28276
+ 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" };
28176
28277
  if (vErrors === null) {
28177
- vErrors = [err23];
28278
+ vErrors = [err37];
28178
28279
  } else {
28179
- vErrors.push(err23);
28280
+ vErrors.push(err37);
28180
28281
  }
28181
28282
  errors++;
28182
28283
  }
28183
- var valid5 = _errs35 === errors;
28284
+ var valid8 = _errs49 === errors;
28184
28285
  } else {
28185
- var valid5 = true;
28286
+ var valid8 = true;
28186
28287
  }
28187
- if (valid5) {
28288
+ if (valid8) {
28188
28289
  if (data1.capturedAt !== void 0) {
28189
- let data14 = data1.capturedAt;
28190
- const _errs37 = errors;
28191
- if (!(typeof data14 == "number" && isFinite(data14))) {
28192
- 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" };
28290
+ let data18 = data1.capturedAt;
28291
+ const _errs51 = errors;
28292
+ if (!(typeof data18 == "number" && isFinite(data18))) {
28293
+ 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" };
28193
28294
  if (vErrors === null) {
28194
- vErrors = [err24];
28295
+ vErrors = [err38];
28195
28296
  } else {
28196
- vErrors.push(err24);
28297
+ vErrors.push(err38);
28197
28298
  }
28198
28299
  errors++;
28199
28300
  }
28200
- var valid5 = _errs37 === errors;
28301
+ var valid8 = _errs51 === errors;
28201
28302
  } else {
28202
- var valid5 = true;
28303
+ var valid8 = true;
28203
28304
  }
28204
- if (valid5) {
28305
+ if (valid8) {
28205
28306
  if (data1.sessionId !== void 0) {
28206
- const _errs39 = errors;
28307
+ const _errs53 = errors;
28207
28308
  if (typeof data1.sessionId !== "string") {
28208
- 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" };
28309
+ 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" };
28209
28310
  if (vErrors === null) {
28210
- vErrors = [err25];
28311
+ vErrors = [err39];
28211
28312
  } else {
28212
- vErrors.push(err25);
28313
+ vErrors.push(err39);
28213
28314
  }
28214
28315
  errors++;
28215
28316
  }
28216
- var valid5 = _errs39 === errors;
28317
+ var valid8 = _errs53 === errors;
28217
28318
  } else {
28218
- var valid5 = true;
28319
+ var valid8 = true;
28219
28320
  }
28220
- if (valid5) {
28321
+ if (valid8) {
28221
28322
  if (data1.invocationId !== void 0) {
28222
- const _errs41 = errors;
28323
+ const _errs55 = errors;
28223
28324
  if (typeof data1.invocationId !== "string") {
28224
- 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" };
28325
+ 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" };
28225
28326
  if (vErrors === null) {
28226
- vErrors = [err26];
28327
+ vErrors = [err40];
28227
28328
  } else {
28228
- vErrors.push(err26);
28329
+ vErrors.push(err40);
28229
28330
  }
28230
28331
  errors++;
28231
28332
  }
28232
- var valid5 = _errs41 === errors;
28333
+ var valid8 = _errs55 === errors;
28233
28334
  } else {
28234
- var valid5 = true;
28335
+ var valid8 = true;
28235
28336
  }
28236
- if (valid5) {
28337
+ if (valid8) {
28237
28338
  if (data1.eventType !== void 0) {
28238
- const _errs43 = errors;
28339
+ const _errs57 = errors;
28239
28340
  if (typeof data1.eventType !== "string") {
28240
- 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" };
28341
+ 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" };
28241
28342
  if (vErrors === null) {
28242
- vErrors = [err27];
28343
+ vErrors = [err41];
28243
28344
  } else {
28244
- vErrors.push(err27);
28345
+ vErrors.push(err41);
28245
28346
  }
28246
28347
  errors++;
28247
28348
  }
28248
- var valid5 = _errs43 === errors;
28349
+ var valid8 = _errs57 === errors;
28249
28350
  } else {
28250
- var valid5 = true;
28351
+ var valid8 = true;
28251
28352
  }
28252
- if (valid5) {
28253
- if (data1.capturedOrganizationId !== void 0) {
28254
- let data18 = data1.capturedOrganizationId;
28255
- const _errs45 = errors;
28256
- if (errors === _errs45) {
28257
- if (typeof data18 === "string") {
28258
- if (func1(data18) > 128) {
28259
- 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" };
28353
+ if (valid8) {
28354
+ if (data1.repositoryContext !== void 0) {
28355
+ let data22 = data1.repositoryContext;
28356
+ const _errs59 = errors;
28357
+ const _errs60 = errors;
28358
+ let valid9 = false;
28359
+ let passing1 = null;
28360
+ const _errs61 = errors;
28361
+ if (errors === _errs61) {
28362
+ if (data22 && typeof data22 == "object" && !Array.isArray(data22)) {
28363
+ let missing5;
28364
+ if (data22.kind === void 0 && (missing5 = "kind") || data22.repoSyncId === void 0 && (missing5 = "repoSyncId")) {
28365
+ 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 + "'" };
28260
28366
  if (vErrors === null) {
28261
- vErrors = [err28];
28367
+ vErrors = [err42];
28262
28368
  } else {
28263
- vErrors.push(err28);
28369
+ vErrors.push(err42);
28264
28370
  }
28265
28371
  errors++;
28266
28372
  } else {
28267
- if (func1(data18) < 1) {
28268
- 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" };
28269
- if (vErrors === null) {
28270
- vErrors = [err29];
28271
- } else {
28272
- vErrors.push(err29);
28273
- }
28274
- errors++;
28275
- } else {
28276
- if (!pattern8.test(data18)) {
28277
- 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_-]+$"' };
28373
+ const _errs63 = errors;
28374
+ for (const key2 in data22) {
28375
+ if (!(key2 === "kind" || key2 === "repoSyncId")) {
28376
+ 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" };
28278
28377
  if (vErrors === null) {
28279
- vErrors = [err30];
28378
+ vErrors = [err43];
28280
28379
  } else {
28281
- vErrors.push(err30);
28380
+ vErrors.push(err43);
28282
28381
  }
28283
28382
  errors++;
28383
+ break;
28384
+ }
28385
+ }
28386
+ if (_errs63 === errors) {
28387
+ if (data22.kind !== void 0) {
28388
+ let data23 = data22.kind;
28389
+ const _errs64 = errors;
28390
+ if (typeof data23 !== "string") {
28391
+ 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" };
28392
+ if (vErrors === null) {
28393
+ vErrors = [err44];
28394
+ } else {
28395
+ vErrors.push(err44);
28396
+ }
28397
+ errors++;
28398
+ }
28399
+ if ("repository_bound" !== data23) {
28400
+ 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" };
28401
+ if (vErrors === null) {
28402
+ vErrors = [err45];
28403
+ } else {
28404
+ vErrors.push(err45);
28405
+ }
28406
+ errors++;
28407
+ }
28408
+ var valid10 = _errs64 === errors;
28409
+ } else {
28410
+ var valid10 = true;
28411
+ }
28412
+ if (valid10) {
28413
+ if (data22.repoSyncId !== void 0) {
28414
+ let data24 = data22.repoSyncId;
28415
+ const _errs66 = errors;
28416
+ if (errors === _errs66) {
28417
+ if (typeof data24 === "string") {
28418
+ if (func1(data24) > 128) {
28419
+ 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" };
28420
+ if (vErrors === null) {
28421
+ vErrors = [err46];
28422
+ } else {
28423
+ vErrors.push(err46);
28424
+ }
28425
+ errors++;
28426
+ } else {
28427
+ if (func1(data24) < 1) {
28428
+ 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" };
28429
+ if (vErrors === null) {
28430
+ vErrors = [err47];
28431
+ } else {
28432
+ vErrors.push(err47);
28433
+ }
28434
+ errors++;
28435
+ }
28436
+ }
28437
+ } else {
28438
+ 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" };
28439
+ if (vErrors === null) {
28440
+ vErrors = [err48];
28441
+ } else {
28442
+ vErrors.push(err48);
28443
+ }
28444
+ errors++;
28445
+ }
28446
+ }
28447
+ var valid10 = _errs66 === errors;
28448
+ } else {
28449
+ var valid10 = true;
28450
+ }
28284
28451
  }
28285
28452
  }
28286
28453
  }
28287
28454
  } else {
28288
- 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" };
28455
+ 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" };
28289
28456
  if (vErrors === null) {
28290
- vErrors = [err31];
28457
+ vErrors = [err49];
28291
28458
  } else {
28292
- vErrors.push(err31);
28459
+ vErrors.push(err49);
28293
28460
  }
28294
28461
  errors++;
28295
28462
  }
28296
28463
  }
28297
- var valid5 = _errs45 === errors;
28298
- } else {
28299
- var valid5 = true;
28300
- }
28301
- if (valid5) {
28302
- if (data1.captureAuthorityKind !== void 0) {
28303
- let data19 = data1.captureAuthorityKind;
28304
- const _errs47 = errors;
28305
- if (typeof data19 !== "string") {
28306
- 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" };
28307
- if (vErrors === null) {
28308
- vErrors = [err32];
28464
+ var _valid2 = _errs61 === errors;
28465
+ if (_valid2) {
28466
+ valid9 = true;
28467
+ passing1 = 0;
28468
+ var props2 = true;
28469
+ }
28470
+ const _errs68 = errors;
28471
+ if (errors === _errs68) {
28472
+ if (data22 && typeof data22 == "object" && !Array.isArray(data22)) {
28473
+ let missing6;
28474
+ if (data22.kind === void 0 && (missing6 = "kind")) {
28475
+ 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 + "'" };
28476
+ if (vErrors === null) {
28477
+ vErrors = [err50];
28478
+ } else {
28479
+ vErrors.push(err50);
28480
+ }
28481
+ errors++;
28309
28482
  } else {
28310
- vErrors.push(err32);
28483
+ const _errs70 = errors;
28484
+ for (const key3 in data22) {
28485
+ if (!(key3 === "kind")) {
28486
+ 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" };
28487
+ if (vErrors === null) {
28488
+ vErrors = [err51];
28489
+ } else {
28490
+ vErrors.push(err51);
28491
+ }
28492
+ errors++;
28493
+ break;
28494
+ }
28495
+ }
28496
+ if (_errs70 === errors) {
28497
+ if (data22.kind !== void 0) {
28498
+ let data25 = data22.kind;
28499
+ if (typeof data25 !== "string") {
28500
+ 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" };
28501
+ if (vErrors === null) {
28502
+ vErrors = [err52];
28503
+ } else {
28504
+ vErrors.push(err52);
28505
+ }
28506
+ errors++;
28507
+ }
28508
+ if ("non_repository" !== data25) {
28509
+ 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" };
28510
+ if (vErrors === null) {
28511
+ vErrors = [err53];
28512
+ } else {
28513
+ vErrors.push(err53);
28514
+ }
28515
+ errors++;
28516
+ }
28517
+ }
28518
+ }
28311
28519
  }
28312
- errors++;
28313
- }
28314
- if (!(data19 === "workos" || data19 === "service_token")) {
28315
- 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" };
28520
+ } else {
28521
+ 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" };
28316
28522
  if (vErrors === null) {
28317
- vErrors = [err33];
28523
+ vErrors = [err54];
28318
28524
  } else {
28319
- vErrors.push(err33);
28525
+ vErrors.push(err54);
28320
28526
  }
28321
28527
  errors++;
28322
28528
  }
28323
- var valid5 = _errs47 === errors;
28529
+ }
28530
+ var _valid2 = _errs68 === errors;
28531
+ if (_valid2 && valid9) {
28532
+ valid9 = false;
28533
+ passing1 = [passing1, 1];
28324
28534
  } else {
28325
- var valid5 = true;
28535
+ if (_valid2) {
28536
+ valid9 = true;
28537
+ passing1 = 1;
28538
+ if (props2 !== true) {
28539
+ props2 = true;
28540
+ }
28541
+ }
28326
28542
  }
28327
- if (valid5) {
28328
- if (data1.decisionLifecycleProtocolVersion !== void 0) {
28329
- let data20 = data1.decisionLifecycleProtocolVersion;
28330
- const _errs49 = errors;
28331
- if (!(typeof data20 == "number" && (!(data20 % 1) && !isNaN(data20)) && isFinite(data20))) {
28332
- 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" };
28333
- if (vErrors === null) {
28334
- vErrors = [err34];
28335
- } else {
28336
- vErrors.push(err34);
28337
- }
28338
- errors++;
28543
+ if (!valid9) {
28544
+ 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" };
28545
+ if (vErrors === null) {
28546
+ vErrors = [err55];
28547
+ } else {
28548
+ vErrors.push(err55);
28549
+ }
28550
+ errors++;
28551
+ } else {
28552
+ errors = _errs60;
28553
+ if (vErrors !== null) {
28554
+ if (_errs60) {
28555
+ vErrors.length = _errs60;
28556
+ } else {
28557
+ vErrors = null;
28339
28558
  }
28340
- if (errors === _errs49) {
28341
- if (typeof data20 == "number" && isFinite(data20)) {
28342
- if (data20 > 9007199254740991 || isNaN(data20)) {
28343
- 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" };
28559
+ }
28560
+ }
28561
+ var valid8 = _errs59 === errors;
28562
+ } else {
28563
+ var valid8 = true;
28564
+ }
28565
+ if (valid8) {
28566
+ if (data1.capturedOrganizationId !== void 0) {
28567
+ let data26 = data1.capturedOrganizationId;
28568
+ const _errs73 = errors;
28569
+ if (errors === _errs73) {
28570
+ if (typeof data26 === "string") {
28571
+ if (func1(data26) > 128) {
28572
+ 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" };
28573
+ if (vErrors === null) {
28574
+ vErrors = [err56];
28575
+ } else {
28576
+ vErrors.push(err56);
28577
+ }
28578
+ errors++;
28579
+ } else {
28580
+ if (func1(data26) < 1) {
28581
+ 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" };
28344
28582
  if (vErrors === null) {
28345
- vErrors = [err35];
28583
+ vErrors = [err57];
28346
28584
  } else {
28347
- vErrors.push(err35);
28585
+ vErrors.push(err57);
28348
28586
  }
28349
28587
  errors++;
28350
28588
  } else {
28351
- if (data20 < 1 || isNaN(data20)) {
28352
- 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" };
28589
+ if (!pattern8.test(data26)) {
28590
+ 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_-]+$"' };
28353
28591
  if (vErrors === null) {
28354
- vErrors = [err36];
28592
+ vErrors = [err58];
28355
28593
  } else {
28356
- vErrors.push(err36);
28594
+ vErrors.push(err58);
28357
28595
  }
28358
28596
  errors++;
28359
28597
  }
28360
28598
  }
28361
28599
  }
28600
+ } else {
28601
+ 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" };
28602
+ if (vErrors === null) {
28603
+ vErrors = [err59];
28604
+ } else {
28605
+ vErrors.push(err59);
28606
+ }
28607
+ errors++;
28608
+ }
28609
+ }
28610
+ var valid8 = _errs73 === errors;
28611
+ } else {
28612
+ var valid8 = true;
28613
+ }
28614
+ if (valid8) {
28615
+ if (data1.captureAuthorityKind !== void 0) {
28616
+ let data27 = data1.captureAuthorityKind;
28617
+ const _errs75 = errors;
28618
+ if (typeof data27 !== "string") {
28619
+ 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" };
28620
+ if (vErrors === null) {
28621
+ vErrors = [err60];
28622
+ } else {
28623
+ vErrors.push(err60);
28624
+ }
28625
+ errors++;
28362
28626
  }
28363
- var valid5 = _errs49 === errors;
28627
+ if (!(data27 === "workos" || data27 === "service_token")) {
28628
+ 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" };
28629
+ if (vErrors === null) {
28630
+ vErrors = [err61];
28631
+ } else {
28632
+ vErrors.push(err61);
28633
+ }
28634
+ errors++;
28635
+ }
28636
+ var valid8 = _errs75 === errors;
28364
28637
  } else {
28365
- var valid5 = true;
28638
+ var valid8 = true;
28366
28639
  }
28367
- if (valid5) {
28368
- if (data1.producer !== void 0) {
28369
- let data21 = data1.producer;
28370
- const _errs51 = errors;
28371
- if (typeof data21 !== "string") {
28372
- 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" };
28640
+ if (valid8) {
28641
+ if (data1.decisionLifecycleProtocolVersion !== void 0) {
28642
+ let data28 = data1.decisionLifecycleProtocolVersion;
28643
+ const _errs77 = errors;
28644
+ if (!(typeof data28 == "number" && (!(data28 % 1) && !isNaN(data28)) && isFinite(data28))) {
28645
+ 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" };
28373
28646
  if (vErrors === null) {
28374
- vErrors = [err37];
28647
+ vErrors = [err62];
28375
28648
  } else {
28376
- vErrors.push(err37);
28649
+ vErrors.push(err62);
28377
28650
  }
28378
28651
  errors++;
28379
28652
  }
28380
- if (!(data21 === "claude_code" || data21 === "codex" || data21 === "cursor" || data21 === "hermes")) {
28381
- 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" };
28382
- if (vErrors === null) {
28383
- vErrors = [err38];
28384
- } else {
28385
- vErrors.push(err38);
28653
+ if (errors === _errs77) {
28654
+ if (typeof data28 == "number" && isFinite(data28)) {
28655
+ if (data28 > 9007199254740991 || isNaN(data28)) {
28656
+ 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" };
28657
+ if (vErrors === null) {
28658
+ vErrors = [err63];
28659
+ } else {
28660
+ vErrors.push(err63);
28661
+ }
28662
+ errors++;
28663
+ } else {
28664
+ if (data28 < 1 || isNaN(data28)) {
28665
+ 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" };
28666
+ if (vErrors === null) {
28667
+ vErrors = [err64];
28668
+ } else {
28669
+ vErrors.push(err64);
28670
+ }
28671
+ errors++;
28672
+ }
28673
+ }
28386
28674
  }
28387
- errors++;
28388
28675
  }
28389
- var valid5 = _errs51 === errors;
28676
+ var valid8 = _errs77 === errors;
28390
28677
  } else {
28391
- var valid5 = true;
28678
+ var valid8 = true;
28392
28679
  }
28393
- if (valid5) {
28394
- if (data1.toolOutcome !== void 0) {
28395
- let data22 = data1.toolOutcome;
28396
- const _errs53 = errors;
28397
- if (typeof data22 !== "string") {
28398
- 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" };
28680
+ if (valid8) {
28681
+ if (data1.producer !== void 0) {
28682
+ let data29 = data1.producer;
28683
+ const _errs79 = errors;
28684
+ if (typeof data29 !== "string") {
28685
+ 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" };
28399
28686
  if (vErrors === null) {
28400
- vErrors = [err39];
28687
+ vErrors = [err65];
28401
28688
  } else {
28402
- vErrors.push(err39);
28689
+ vErrors.push(err65);
28403
28690
  }
28404
28691
  errors++;
28405
28692
  }
28406
- if (!(data22 === "succeeded" || data22 === "returned" || data22 === "failed" || data22 === "interrupted" || data22 === "prevented" || data22 === "unknown")) {
28407
- 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" };
28693
+ if (!(data29 === "claude_code" || data29 === "codex" || data29 === "cursor" || data29 === "hermes")) {
28694
+ 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" };
28408
28695
  if (vErrors === null) {
28409
- vErrors = [err40];
28696
+ vErrors = [err66];
28410
28697
  } else {
28411
- vErrors.push(err40);
28698
+ vErrors.push(err66);
28412
28699
  }
28413
28700
  errors++;
28414
28701
  }
28415
- var valid5 = _errs53 === errors;
28702
+ var valid8 = _errs79 === errors;
28416
28703
  } else {
28417
- var valid5 = true;
28704
+ var valid8 = true;
28418
28705
  }
28419
- if (valid5) {
28420
- if (data1.envelopeVersion !== void 0) {
28421
- let data23 = data1.envelopeVersion;
28422
- const _errs55 = errors;
28423
- if (errors === _errs55) {
28424
- if (typeof data23 == "number" && isFinite(data23)) {
28425
- if (data23 >= 4 || isNaN(data23)) {
28426
- 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" };
28706
+ if (valid8) {
28707
+ if (data1.toolOutcome !== void 0) {
28708
+ let data30 = data1.toolOutcome;
28709
+ const _errs81 = errors;
28710
+ if (typeof data30 !== "string") {
28711
+ 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" };
28712
+ if (vErrors === null) {
28713
+ vErrors = [err67];
28714
+ } else {
28715
+ vErrors.push(err67);
28716
+ }
28717
+ errors++;
28718
+ }
28719
+ if (!(data30 === "succeeded" || data30 === "returned" || data30 === "failed" || data30 === "interrupted" || data30 === "prevented" || data30 === "unknown")) {
28720
+ 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" };
28721
+ if (vErrors === null) {
28722
+ vErrors = [err68];
28723
+ } else {
28724
+ vErrors.push(err68);
28725
+ }
28726
+ errors++;
28727
+ }
28728
+ var valid8 = _errs81 === errors;
28729
+ } else {
28730
+ var valid8 = true;
28731
+ }
28732
+ if (valid8) {
28733
+ if (data1.envelopeVersion !== void 0) {
28734
+ let data31 = data1.envelopeVersion;
28735
+ const _errs83 = errors;
28736
+ if (errors === _errs83) {
28737
+ if (typeof data31 == "number" && isFinite(data31)) {
28738
+ if (data31 >= 4 || isNaN(data31)) {
28739
+ 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" };
28740
+ if (vErrors === null) {
28741
+ vErrors = [err69];
28742
+ } else {
28743
+ vErrors.push(err69);
28744
+ }
28745
+ errors++;
28746
+ }
28747
+ } else {
28748
+ 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" };
28427
28749
  if (vErrors === null) {
28428
- vErrors = [err41];
28750
+ vErrors = [err70];
28429
28751
  } else {
28430
- vErrors.push(err41);
28752
+ vErrors.push(err70);
28431
28753
  }
28432
28754
  errors++;
28433
28755
  }
28434
- } else {
28435
- 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" };
28436
- if (vErrors === null) {
28437
- vErrors = [err42];
28438
- } else {
28439
- vErrors.push(err42);
28440
- }
28441
- errors++;
28442
28756
  }
28757
+ var valid8 = _errs83 === errors;
28758
+ } else {
28759
+ var valid8 = true;
28443
28760
  }
28444
- var valid5 = _errs55 === errors;
28445
- } else {
28446
- var valid5 = true;
28447
28761
  }
28448
28762
  }
28449
28763
  }
@@ -28457,28 +28771,28 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
28457
28771
  }
28458
28772
  }
28459
28773
  } else {
28460
- 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" };
28774
+ 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" };
28461
28775
  if (vErrors === null) {
28462
- vErrors = [err43];
28776
+ vErrors = [err71];
28463
28777
  } else {
28464
- vErrors.push(err43);
28778
+ vErrors.push(err71);
28465
28779
  }
28466
28780
  errors++;
28467
28781
  }
28468
28782
  }
28469
- var _valid0 = _errs32 === errors;
28783
+ var _valid0 = _errs46 === errors;
28470
28784
  valid3 = valid3 || _valid0;
28471
28785
  if (_valid0) {
28472
- if (props0 !== true) {
28473
- props0 = true;
28786
+ if (props1 !== true) {
28787
+ props1 = true;
28474
28788
  }
28475
28789
  }
28476
28790
  if (!valid3) {
28477
- 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" };
28791
+ 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" };
28478
28792
  if (vErrors === null) {
28479
- vErrors = [err44];
28793
+ vErrors = [err72];
28480
28794
  } else {
28481
- vErrors.push(err44);
28795
+ vErrors.push(err72);
28482
28796
  }
28483
28797
  errors++;
28484
28798
  validate51.errors = vErrors;
@@ -32072,6 +32386,13 @@ function readStampAt(path9) {
32072
32386
  return void 0;
32073
32387
  }
32074
32388
  }
32389
+ function lastConversationCaptured(cwd, agent) {
32390
+ try {
32391
+ return readStampAt(gitPath(cwd, `prim/conversation-captured/${agent}`));
32392
+ } catch {
32393
+ return void 0;
32394
+ }
32395
+ }
32075
32396
  function readFiredStamps(cwd) {
32076
32397
  try {
32077
32398
  const dir = gitPath(cwd, FIRED_DIR);
@@ -36740,22 +37061,32 @@ function performStatus2() {
36740
37061
  };
36741
37062
  return { user: statusFor2(USER_SCOPE_PATH2), project: statusFor2(projectScopePath2()) };
36742
37063
  }
37064
+ function uncoveredWorktreeHooks(status) {
37065
+ if (status.user.present || status.project.present) return null;
37066
+ const main = mainWorktreeRoot();
37067
+ if (main === null) return null;
37068
+ const path9 = join14(main, ".codex", "hooks.json");
37069
+ return hasAnyHookRegistration2(readSettings(path9)) ? path9 : null;
37070
+ }
37071
+ function uncoveredWorktreeAdvice(path9) {
37072
+ return `prim Codex hooks in ${path9} don't load in this worktree \u2014 run \`prim codex install\`, then \`prim codex uninstall --scope project\` in that checkout`;
37073
+ }
36743
37074
  function resolveScope2(input) {
36744
- if (input === void 0 || input === "project") {
36745
- return "project";
36746
- }
36747
- if (input === "user") {
37075
+ if (input === void 0 || input === "user") {
36748
37076
  return "user";
36749
37077
  }
37078
+ if (input === "project") {
37079
+ return "project";
37080
+ }
36750
37081
  console.error(`[prim] unknown --scope "${input}" (expected: user or project)`);
36751
37082
  process.exit(1);
36752
37083
  }
36753
37084
  var TRUST_NOTICE = "[prim] Codex requires hook trust: run `/hooks` in Codex to review and trust these hooks (or start Codex with --dangerously-bypass-hook-trust). Until trusted, the hooks will not fire.";
36754
37085
  function registerCodexCommands(program3) {
36755
37086
  const codex = program3.command("codex").description("Manage the prim Codex integration (capture, gate, ingest, presence)");
36756
- codex.command("install").description("Register the prim hooks in Codex's hooks.json (project scope by default)").option(
37087
+ codex.command("install").description("Register the prim hooks in Codex's hooks.json (user scope by default)").option(
36757
37088
  "--scope <scope>",
36758
- "project (default, the repo's .codex/hooks.json) or user (~/.codex/hooks.json)"
37089
+ "user (default, ~/.codex/hooks.json) or project (this checkout's .codex/hooks.json)"
36759
37090
  ).option("--force", "Replace any drifted prim hook entries").action((opts) => {
36760
37091
  const scope = resolveScope2(opts.scope);
36761
37092
  const result = performInstall2(scope, opts.force ?? false);
@@ -36769,7 +37100,7 @@ function registerCodexCommands(program3) {
36769
37100
  });
36770
37101
  codex.command("uninstall").description("Remove all prim hooks from Codex's hooks.json").option(
36771
37102
  "--scope <scope>",
36772
- "project (default, the repo's .codex/hooks.json) or user (~/.codex/hooks.json)"
37103
+ "user (default, ~/.codex/hooks.json) or project (this checkout's .codex/hooks.json)"
36773
37104
  ).action((opts) => {
36774
37105
  const scope = resolveScope2(opts.scope);
36775
37106
  const result = performUninstall2(scope);
@@ -36786,6 +37117,9 @@ function registerCodexCommands(program3) {
36786
37117
  const line = (label, s) => `[prim] ${label}: gate ${mark(s.gate)} \xB7 capture ${mark(s.capture)} (${s.path})`;
36787
37118
  console.error(`${line("user", result.user)}
36788
37119
  ${line("project", result.project)}`);
37120
+ const uncovered = uncoveredWorktreeHooks(result);
37121
+ if (uncovered !== null)
37122
+ console.error(`[prim] warning: ${uncoveredWorktreeAdvice(uncovered)}`);
36789
37123
  console.log(JSON.stringify(result, null, JSON_INDENT2));
36790
37124
  });
36791
37125
  }
@@ -39858,8 +40192,6 @@ var DECISION_NOT_FOUND_MESSAGE = "Decision not found";
39858
40192
  var REPLACEMENT_NOT_FOUND_MESSAGE = "Replacement decision not found";
39859
40193
  var SELF_REPLACEMENT_MESSAGE = "A decision cannot supersede itself";
39860
40194
  var OLD_SERVER_NOT_FOUND_MESSAGE = "Not found";
39861
- var FEATURE_DISABLED_MESSAGE = "feature_disabled";
39862
- var FEATURE_CHECK_UNAVAILABLE_MESSAGE = "feature_check_unavailable";
39863
40195
  var STAGE_NAME = "(?:draft|provisional|adopted|superseded|abandoned)";
39864
40196
  var IMMUTABLE_MESSAGE = new RegExp(
39865
40197
  `^An ${STAGE_NAME} decision is immutable \u2014 supersede it to change it$`,
@@ -39936,12 +40268,6 @@ function classifyHttpError2(error) {
39936
40268
  if (error.status === 403 && message === NOT_AUTHOR_MESSAGE) {
39937
40269
  return failure2("not_author", DECISION_LIFECYCLE_EXIT.rejected, error.status);
39938
40270
  }
39939
- if (error.status === 403 && message === FEATURE_DISABLED_MESSAGE) {
39940
- return failure2("feature_disabled", DECISION_LIFECYCLE_EXIT.rejected, error.status);
39941
- }
39942
- if (error.status === 503 && message === FEATURE_CHECK_UNAVAILABLE_MESSAGE) {
39943
- return failure2("feature_check_unavailable", DECISION_LIFECYCLE_EXIT.server, error.status);
39944
- }
39945
40271
  if (error.status === 409 && message === AMBIGUOUS_MESSAGE) {
39946
40272
  return failure2("ambiguous_identifier", DECISION_LIFECYCLE_EXIT.rejected, error.status);
39947
40273
  }
@@ -40001,10 +40327,6 @@ function formatFailureHuman(operation, result) {
40001
40327
  return `[prim] ${verb} rejected: Decision not found.`;
40002
40328
  case "replacement_not_found":
40003
40329
  return "[prim] supersede rejected: replacement Decision not found.";
40004
- case "feature_disabled":
40005
- return `[prim] ${verb} rejected: manual lifecycle actions are not enabled for this account.`;
40006
- case "feature_check_unavailable":
40007
- return `[prim] ${verb} unavailable: the server could not verify feature availability; retry shortly.`;
40008
40330
  case "unsupported_server":
40009
40331
  return `[prim] ${verb} unavailable: this Primitive server does not support this Decision lifecycle operation; upgrade the server before retrying.`;
40010
40332
  case "rejected":
@@ -49435,9 +49757,16 @@ function classifyClaudeHooks(statuses) {
49435
49757
  }
49436
49758
  return { name: "feedback-hooks", status: "ok", detail: "complete Claude lifecycle ready" };
49437
49759
  }
49438
- function classifyCodexHooks(statuses) {
49760
+ function classifyCodexHooks(statuses, uncoveredWorktree = null, capturedAt) {
49439
49761
  const installed = statuses.filter((status) => status.present);
49440
49762
  if (installed.length === 0) {
49763
+ if (uncoveredWorktree !== null) {
49764
+ return {
49765
+ name: "codex-hooks",
49766
+ status: "warn",
49767
+ detail: uncoveredWorktreeAdvice(uncoveredWorktree)
49768
+ };
49769
+ }
49441
49770
  return { name: "codex-hooks", status: "ok", detail: "not installed" };
49442
49771
  }
49443
49772
  if (installed.some((status) => !status.complete)) {
@@ -49449,8 +49778,8 @@ function classifyCodexHooks(statuses) {
49449
49778
  }
49450
49779
  return {
49451
49780
  name: "codex-hooks",
49452
- status: "warn",
49453
- detail: "installed; Codex trust is not machine-readable \u2014 verify with `/hooks`"
49781
+ status: capturedAt === void 0 ? "warn" : "ok",
49782
+ detail: capturedAt === void 0 ? "installed; conversation capture unverified; Codex trust unknown \u2014 verify with `/hooks`" : `installed; conversation capture observed ${new Date(capturedAt).toISOString()}; current trust unknown`
49454
49783
  };
49455
49784
  }
49456
49785
  function classifyCursorHooks(statuses) {
@@ -49502,7 +49831,13 @@ function checkAgentHooks() {
49502
49831
  const checks = [];
49503
49832
  try {
49504
49833
  const status = performStatus2();
49505
- checks.push(classifyCodexHooks([status.project, status.user]));
49834
+ checks.push(
49835
+ classifyCodexHooks(
49836
+ [status.project, status.user],
49837
+ uncoveredWorktreeHooks(status),
49838
+ lastConversationCaptured(process.cwd(), "codex")
49839
+ )
49840
+ );
49506
49841
  } catch (error) {
49507
49842
  const detail = boundedHealthError(error instanceof Error ? error.message : String(error));
49508
49843
  checks.push({
@@ -49654,7 +49989,7 @@ function parseMovesStatus(value) {
49654
49989
  }
49655
49990
  const status = value;
49656
49991
  const nullableNumber = (candidate) => candidate === null || typeof candidate === "number" && Number.isFinite(candidate);
49657
- if (status.captureState !== "enabled" && status.captureState !== "disabled" || !nullableNumber(status.latestIngestAt) || !nullableNumber(status.latestClassificationAt) || !nullableNumber(status.highWaterMark) || typeof status.pendingSessionCount !== "number" || !Number.isInteger(status.pendingSessionCount) || status.pendingSessionCount < 0 || typeof status.sampled !== "boolean") {
49992
+ if (status.captureState !== "enabled" || !nullableNumber(status.latestIngestAt) || !nullableNumber(status.latestClassificationAt) || !nullableNumber(status.highWaterMark) || typeof status.pendingSessionCount !== "number" || !Number.isInteger(status.pendingSessionCount) || status.pendingSessionCount < 0 || typeof status.sampled !== "boolean") {
49658
49993
  throw new Error("moves status returned an invalid response");
49659
49994
  }
49660
49995
  if (status.oldestPendingAt !== void 0 && !nullableNumber(status.oldestPendingAt) || status.oldestPendingAgeMs !== void 0 && !nullableNumber(status.oldestPendingAgeMs) || typeof status.oldestPendingAgeMs === "number" && status.oldestPendingAgeMs < 0 || status.pendingCommitCorrelationCount !== void 0 && (!Number.isInteger(status.pendingCommitCorrelationCount) || status.pendingCommitCorrelationCount < 0)) {
@@ -49663,10 +49998,10 @@ function parseMovesStatus(value) {
49663
49998
  return status;
49664
49999
  }
49665
50000
  function classifyMovesStatus(status) {
49666
- const capture = status.captureState === "enabled" ? { name: "capture", status: "ok", detail: "enabled; ingest endpoint durable" } : {
50001
+ const capture = {
49667
50002
  name: "capture",
49668
- status: "fail",
49669
- detail: "disabled for the current organization; local Moves are retained"
50003
+ status: "ok",
50004
+ detail: "enabled; ingest endpoint durable"
49670
50005
  };
49671
50006
  const correlation = status.pendingCommitCorrelationCount === void 0 ? void 0 : status.pendingCommitCorrelationCount > 0 ? {
49672
50007
  name: "commit-correlation",
@@ -50592,7 +50927,7 @@ var SESSION_LABELS = {
50592
50927
  };
50593
50928
  function planSetupSteps(opts) {
50594
50929
  const scopeArgs = opts.scope === "user" ? ["--scope", "user"] : [];
50595
- const sessionArgs = opts.agent === "hermes" ? [opts.agent, "install"] : [opts.agent, "install", ...scopeArgs];
50930
+ const sessionArgs = opts.agent === "hermes" ? [opts.agent, "install"] : [opts.agent, "install", "--scope", opts.scope];
50596
50931
  const steps = [
50597
50932
  {
50598
50933
  key: "session",
@@ -52350,14 +52685,17 @@ function startDriftHeal(options) {
52350
52685
  if (!runsConfigRoot()) return false;
52351
52686
  const primEntry = options.primEntry === void 0 ? binFile("prim") : options.primEntry;
52352
52687
  if (!primEntry) return false;
52353
- const attempt = {
52354
- attemptedAt: (options.nowMs ?? Date.now)(),
52355
- fromVersion: launcher.runtimeVersion,
52356
- toVersion
52357
- };
52358
52688
  const claimed = withFileLockSync(
52359
52689
  daemonDriftHealClaimPath(paths),
52360
- () => claimAttempt(daemonDriftHealMarkerPath(paths), attempt),
52690
+ () => (
52691
+ // Sample after acquiring the claim: an earlier timestamp from a delayed
52692
+ // command must not make the previous winner look like a clock rollback.
52693
+ claimAttempt(daemonDriftHealMarkerPath(paths), {
52694
+ attemptedAt: (options.nowMs ?? Date.now)(),
52695
+ fromVersion: launcher.runtimeVersion,
52696
+ toVersion
52697
+ })
52698
+ ),
52361
52699
  { timeoutMs: 0, sleep: claimHeld }
52362
52700
  );
52363
52701
  if (!claimed) return false;