@codai/axiom-mcp 2.1.0 → 2.2.0

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.
@@ -515,6 +515,7 @@ function constantCatch(value) {
515
515
  return fn;
516
516
  }
517
517
  var _a$1;
518
+ const NEVER = /*@__PURE__*/ Object.freeze({ status: "aborted" });
518
519
  const _zodDesc = {
519
520
  value: void 0,
520
521
  enumerable: false
@@ -945,7 +946,7 @@ const uuid = (version) => {
945
946
  if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
946
947
  return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
947
948
  };
948
- const email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
949
+ const email$1 = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
949
950
  const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
950
951
  function emoji() {
951
952
  return new RegExp(_emoji$1, "u");
@@ -962,7 +963,7 @@ const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468
962
963
  function anchor(source) {
963
964
  return new RegExp(`^${source}$`);
964
965
  }
965
- const date = /*@__PURE__*/ anchor(dateSource);
966
+ const date$1 = /*@__PURE__*/ anchor(dateSource);
966
967
  function timeSource(args) {
967
968
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
968
969
  return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -1476,7 +1477,7 @@ const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
1476
1477
  $ZodStringFormat.init(inst, def);
1477
1478
  });
1478
1479
  const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
1479
- def.pattern ?? (def.pattern = email);
1480
+ def.pattern ?? (def.pattern = email$1);
1480
1481
  $ZodStringFormat.init(inst, def);
1481
1482
  });
1482
1483
  function canParseURL(input) {
@@ -1612,7 +1613,7 @@ const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def
1612
1613
  $ZodStringFormat.init(inst, def);
1613
1614
  });
1614
1615
  const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1615
- def.pattern ?? (def.pattern = date);
1616
+ def.pattern ?? (def.pattern = date$1);
1616
1617
  $ZodStringFormat.init(inst, def);
1617
1618
  });
1618
1619
  const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
@@ -1808,6 +1809,10 @@ const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
1808
1809
  return payload;
1809
1810
  };
1810
1811
  });
1812
+ const $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def) => {
1813
+ $ZodType.init(inst, def);
1814
+ inst._zod.parse = (payload) => payload;
1815
+ });
1811
1816
  const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
1812
1817
  $ZodType.init(inst, def);
1813
1818
  inst._zod.parse = (payload) => payload;
@@ -3528,6 +3533,15 @@ function _number(Class, params) {
3528
3533
  }));
3529
3534
  }
3530
3535
  // @__NO_SIDE_EFFECTS__
3536
+ function _coercedNumber(Class, params) {
3537
+ return new Class(snapshotChecks({
3538
+ type: "number",
3539
+ coerce: true,
3540
+ checks: [],
3541
+ ...normalizeParams(params)
3542
+ }));
3543
+ }
3544
+ // @__NO_SIDE_EFFECTS__
3531
3545
  function _int(Class, params) {
3532
3546
  return new Class({
3533
3547
  type: "number",
@@ -3552,6 +3566,10 @@ function _null$1(Class, params) {
3552
3566
  });
3553
3567
  }
3554
3568
  // @__NO_SIDE_EFFECTS__
3569
+ function _any(Class) {
3570
+ return new Class({ type: "any" });
3571
+ }
3572
+ // @__NO_SIDE_EFFECTS__
3555
3573
  function _unknown(Class) {
3556
3574
  return new Class({ type: "unknown" });
3557
3575
  }
@@ -3718,17 +3736,6 @@ function _array(Class, element, params) {
3718
3736
  });
3719
3737
  }
3720
3738
  // @__NO_SIDE_EFFECTS__
3721
- function _custom(Class, fn, _params) {
3722
- const norm = normalizeParams(_params);
3723
- norm.abort ?? (norm.abort = true);
3724
- return new Class({
3725
- type: "custom",
3726
- check: "custom",
3727
- fn,
3728
- ...norm
3729
- });
3730
- }
3731
- // @__NO_SIDE_EFFECTS__
3732
3739
  function _refine(Class, fn, _params) {
3733
3740
  return new Class({
3734
3741
  type: "custom",
@@ -4316,6 +4323,12 @@ const numberProcessor = (schema, ctx, _json, params) => {
4316
4323
  const booleanProcessor = (_schema, _ctx, json, _params) => {
4317
4324
  json.type = "boolean";
4318
4325
  };
4326
+ const bigintProcessor = (schema, ctx, json, params) => {
4327
+ handleUnrepresentable(schema, ctx, json, params, "BigInt cannot be represented in JSON Schema");
4328
+ };
4329
+ const symbolProcessor = (schema, ctx, json, params) => {
4330
+ handleUnrepresentable(schema, ctx, json, params, "Symbols cannot be represented in JSON Schema");
4331
+ };
4319
4332
  const nullProcessor = (_schema, ctx, json, _params) => {
4320
4333
  if (ctx.target === "openapi-3.0") {
4321
4334
  json.type = "string";
@@ -4323,9 +4336,20 @@ const nullProcessor = (_schema, ctx, json, _params) => {
4323
4336
  json.enum = [null];
4324
4337
  } else json.type = "null";
4325
4338
  };
4339
+ const undefinedProcessor = (schema, ctx, json, params) => {
4340
+ handleUnrepresentable(schema, ctx, json, params, "Undefined cannot be represented in JSON Schema");
4341
+ };
4342
+ const voidProcessor = (schema, ctx, json, params) => {
4343
+ handleUnrepresentable(schema, ctx, json, params, "Void cannot be represented in JSON Schema");
4344
+ };
4326
4345
  const neverProcessor = (_schema, _ctx, json, _params) => {
4327
4346
  json.not = {};
4328
4347
  };
4348
+ const anyProcessor = (_schema, _ctx, _json, _params) => {};
4349
+ const unknownProcessor = (_schema, _ctx, _json, _params) => {};
4350
+ const dateProcessor = (schema, ctx, json, params) => {
4351
+ handleUnrepresentable(schema, ctx, json, params, "Date cannot be represented in JSON Schema");
4352
+ };
4329
4353
  const enumProcessor = (schema, _ctx, json, _params) => {
4330
4354
  const def = schema._zod.def;
4331
4355
  const values = getEnumValues(def.entries);
@@ -4363,6 +4387,9 @@ const literalProcessor = (schema, ctx, json, params) => {
4363
4387
  json.enum = vals;
4364
4388
  }
4365
4389
  };
4390
+ const nanProcessor = (schema, ctx, json, params) => {
4391
+ handleUnrepresentable(schema, ctx, json, params, "NaN cannot be represented in JSON Schema");
4392
+ };
4366
4393
  const templateLiteralProcessor = (schema, _ctx, json, _params) => {
4367
4394
  const _json = json;
4368
4395
  const pattern = schema._zod.pattern;
@@ -4370,12 +4397,37 @@ const templateLiteralProcessor = (schema, _ctx, json, _params) => {
4370
4397
  _json.type = "string";
4371
4398
  _json.pattern = pattern.source;
4372
4399
  };
4400
+ const fileProcessor = (schema, _ctx, json, _params) => {
4401
+ const _json = json;
4402
+ _json.type = "string";
4403
+ _json.format = "binary";
4404
+ _json.contentEncoding = "binary";
4405
+ const { minimum, maximum, mime } = aggregateChecks(schema);
4406
+ if (minimum !== void 0) _json.minLength = minimum;
4407
+ if (maximum !== void 0) _json.maxLength = maximum;
4408
+ if (!mime) return;
4409
+ if (mime.length === 0) _json.not = {};
4410
+ else if (mime.length === 1) _json.contentMediaType = mime[0];
4411
+ else _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
4412
+ };
4413
+ const successProcessor = (_schema, _ctx, json, _params) => {
4414
+ json.type = "boolean";
4415
+ };
4373
4416
  const customProcessor = (schema, ctx, json, params) => {
4374
4417
  handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
4375
4418
  };
4419
+ const functionProcessor = (schema, ctx, json, params) => {
4420
+ handleUnrepresentable(schema, ctx, json, params, "Function types cannot be represented in JSON Schema");
4421
+ };
4376
4422
  const transformProcessor = (schema, ctx, json, params) => {
4377
4423
  handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
4378
4424
  };
4425
+ const mapProcessor = (schema, ctx, json, params) => {
4426
+ handleUnrepresentable(schema, ctx, json, params, "Map cannot be represented in JSON Schema");
4427
+ };
4428
+ const setProcessor = (schema, ctx, json, params) => {
4429
+ handleUnrepresentable(schema, ctx, json, params, "Set cannot be represented in JSON Schema");
4430
+ };
4379
4431
  const arrayProcessor = (schema, ctx, _json, params) => {
4380
4432
  const json = _json;
4381
4433
  const def = schema._zod.def;
@@ -4460,6 +4512,58 @@ const intersectionProcessor = (schema, ctx, json, params) => {
4460
4512
  json.allOf = allOf;
4461
4513
  ctx.intersections.push(allOf);
4462
4514
  };
4515
+ const tupleProcessor = (schema, ctx, _json, params) => {
4516
+ const json = _json;
4517
+ const def = schema._zod.def;
4518
+ json.type = "array";
4519
+ const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
4520
+ const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
4521
+ const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
4522
+ ...params,
4523
+ path: [
4524
+ ...params.path,
4525
+ prefixPath,
4526
+ i
4527
+ ]
4528
+ }));
4529
+ const rest = def.rest ? processSchema(def.rest, ctx, {
4530
+ ...params,
4531
+ path: [
4532
+ ...params.path,
4533
+ restPath,
4534
+ ...ctx.target === "openapi-3.0" ? [def.items.length] : []
4535
+ ]
4536
+ }) : null;
4537
+ let minItems = def.items.length;
4538
+ while (minItems > 0) {
4539
+ const item = def.items[minItems - 1];
4540
+ if (!(ctx.io === "input" ? inputOptin(item) !== void 0 : item._zod.optout === "optional")) break;
4541
+ minItems--;
4542
+ }
4543
+ const maxItems = def.items.length;
4544
+ const isClosed = !def.rest;
4545
+ if (ctx.target === "draft-2020-12") {
4546
+ json.prefixItems = prefixItems;
4547
+ if (isClosed) json.items = false;
4548
+ else if (rest) json.items = rest;
4549
+ if (minItems > 0) json.minItems = minItems;
4550
+ if (isClosed) json.maxItems = maxItems;
4551
+ } else if (ctx.target === "openapi-3.0") {
4552
+ json.items = { anyOf: prefixItems };
4553
+ if (rest) json.items.anyOf.push(rest);
4554
+ if (minItems > 0) json.minItems = minItems;
4555
+ if (isClosed) json.maxItems = maxItems;
4556
+ } else {
4557
+ json.items = prefixItems;
4558
+ if (isClosed) json.additionalItems = false;
4559
+ else if (rest) json.additionalItems = rest;
4560
+ if (minItems > 0) json.minItems = minItems;
4561
+ if (isClosed) json.maxItems = maxItems;
4562
+ }
4563
+ const { minimum, maximum } = aggregateChecks(schema);
4564
+ if (typeof minimum === "number") json.minItems = minimum;
4565
+ if (typeof maximum === "number") json.maxItems = maximum;
4566
+ };
4463
4567
  function stringifyKeyNames(bySchema, json, visited) {
4464
4568
  if (json.$ref) {
4465
4569
  if (visited.has(json)) return json;
@@ -4624,6 +4728,12 @@ const readonlyProcessor = (schema, ctx, json, params) => {
4624
4728
  seen.ref = def.innerType;
4625
4729
  json.readOnly = true;
4626
4730
  };
4731
+ const promiseProcessor = (schema, ctx, _json, params) => {
4732
+ const def = schema._zod.def;
4733
+ processSchema(def.innerType, ctx, params);
4734
+ const seen = ctx.seen.get(schema);
4735
+ seen.ref = def.innerType;
4736
+ };
4627
4737
  const optionalProcessor = (schema, ctx, _json, params) => {
4628
4738
  const def = schema._zod.def;
4629
4739
  processSchema(def.innerType, ctx, params);
@@ -4636,6 +4746,81 @@ const lazyProcessor = (schema, ctx, _json, params) => {
4636
4746
  const seen = ctx.seen.get(schema);
4637
4747
  seen.ref = innerType;
4638
4748
  };
4749
+ const allProcessors = {
4750
+ string: stringProcessor,
4751
+ number: numberProcessor,
4752
+ boolean: booleanProcessor,
4753
+ bigint: bigintProcessor,
4754
+ symbol: symbolProcessor,
4755
+ null: nullProcessor,
4756
+ undefined: undefinedProcessor,
4757
+ void: voidProcessor,
4758
+ never: neverProcessor,
4759
+ any: anyProcessor,
4760
+ unknown: unknownProcessor,
4761
+ date: dateProcessor,
4762
+ enum: enumProcessor,
4763
+ literal: literalProcessor,
4764
+ nan: nanProcessor,
4765
+ template_literal: templateLiteralProcessor,
4766
+ file: fileProcessor,
4767
+ success: successProcessor,
4768
+ custom: customProcessor,
4769
+ function: functionProcessor,
4770
+ transform: transformProcessor,
4771
+ map: mapProcessor,
4772
+ set: setProcessor,
4773
+ array: arrayProcessor,
4774
+ object: objectProcessor,
4775
+ union: unionProcessor,
4776
+ intersection: intersectionProcessor,
4777
+ tuple: tupleProcessor,
4778
+ record: recordProcessor,
4779
+ nullable: nullableProcessor,
4780
+ nonoptional: nonoptionalProcessor,
4781
+ default: defaultProcessor,
4782
+ prefault: prefaultProcessor,
4783
+ catch: catchProcessor,
4784
+ pipe: pipeProcessor,
4785
+ readonly: readonlyProcessor,
4786
+ promise: promiseProcessor,
4787
+ optional: optionalProcessor,
4788
+ lazy: lazyProcessor
4789
+ };
4790
+ function toJSONSchema(input, params) {
4791
+ if ("_idmap" in input) {
4792
+ const registry = input;
4793
+ const ctx = initializeContext({
4794
+ ...params,
4795
+ processors: allProcessors
4796
+ });
4797
+ const defs = {};
4798
+ for (const entry of registry._idmap.entries()) {
4799
+ const [_, schema] = entry;
4800
+ processSchema(schema, ctx);
4801
+ }
4802
+ const schemas = {};
4803
+ ctx.external = {
4804
+ registry,
4805
+ uri: params?.uri,
4806
+ defs
4807
+ };
4808
+ for (const entry of registry._idmap.entries()) {
4809
+ const [key, schema] = entry;
4810
+ extractDefs(ctx, schema);
4811
+ assignProp(schemas, key, finalize(ctx, schema));
4812
+ }
4813
+ if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
4814
+ return { schemas };
4815
+ }
4816
+ const ctx = initializeContext({
4817
+ ...params,
4818
+ processors: allProcessors
4819
+ });
4820
+ processSchema(input, ctx);
4821
+ extractDefs(ctx, input);
4822
+ return finalize(ctx, input);
4823
+ }
4639
4824
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4640
4825
  function _lazyMethod(proto, key, make) {
4641
4826
  Object.defineProperty(proto, key, {
@@ -5036,6 +5221,9 @@ const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
5036
5221
  $ZodEmail.init(inst, def);
5037
5222
  ZodStringFormat.init(inst, def);
5038
5223
  });
5224
+ function email(params) {
5225
+ return /* @__PURE__ */ _email(ZodEmail, params);
5226
+ }
5039
5227
  const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
5040
5228
  $ZodGUID.init(inst, def);
5041
5229
  ZodStringFormat.init(inst, def);
@@ -5206,6 +5394,14 @@ const ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
5206
5394
  function _null(params) {
5207
5395
  return /* @__PURE__ */ _null$1(ZodNull, params);
5208
5396
  }
5397
+ const ZodAny = /*@__PURE__*/ $constructor("ZodAny", (inst, def) => {
5398
+ $ZodAny.init(inst, def);
5399
+ ZodType.init(inst, def);
5400
+ inst._zod.processJSONSchema = (ctx, json, params) => void 0;
5401
+ });
5402
+ function any() {
5403
+ return /* @__PURE__ */ _any(ZodAny);
5404
+ }
5209
5405
  const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
5210
5406
  $ZodUnknown.init(inst, def);
5211
5407
  ZodType.init(inst, def);
@@ -5614,9 +5810,6 @@ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
5614
5810
  ZodType.init(inst, def);
5615
5811
  inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
5616
5812
  });
5617
- function custom(fn, _params) {
5618
- return /* @__PURE__ */ _custom(ZodCustom, fn ?? (() => true), _params);
5619
- }
5620
5813
  function refine(fn, _params = {}) {
5621
5814
  return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
5622
5815
  }
@@ -5646,6 +5839,9 @@ function preprocess(fn, schema) {
5646
5839
  function datetime(params) {
5647
5840
  return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
5648
5841
  }
5842
+ function date(params) {
5843
+ return /* @__PURE__ */ _isoDate(ZodISODate, params);
5844
+ }
5649
5845
  const Sha256HexSchema = string().regex(/^[a-f0-9]{64}$/, "ERR_DIGEST_FORMAT").describe("Lowercase hex-encoded sha256");
5650
5846
  const DigestSchema = object({ sha256: Sha256HexSchema }).strict();
5651
5847
  const DigestRefSchema = templateLiteral(["sha256:", Sha256HexSchema]).describe("sha256:<64 lowercase hex>");
@@ -5687,18 +5883,26 @@ const ERROR_CODES = [
5687
5883
  "ERR_PROVIDER_FAILED",
5688
5884
  "ERR_GUARD_TIMEOUT",
5689
5885
  "ERR_GUARD_OUTPUT",
5886
+ "ERR_FACT_DISABLED",
5690
5887
  "ERR_SIGNATURE_MISSING",
5691
5888
  "ERR_SIGNATURE_INVALID",
5889
+ "ERR_TRUST_STATE_CORRUPT",
5692
5890
  "ERR_ROLLBACK",
5693
5891
  "ERR_EMITTER_UNKNOWN",
5694
5892
  "ERR_TEMPLATE_UNKNOWN",
5695
5893
  "ERR_TEMPLATE_PARAMS",
5894
+ "ERR_PATCH_FORMAT",
5895
+ "ERR_PATCH_PREIMAGE",
5896
+ "ERR_PATCH_NO_MATCH",
5696
5897
  "ERR_GIT_NOT_FOUND",
5697
5898
  "ERR_GIT_NOT_REPO",
5698
5899
  "ERR_GIT_DIRTY",
5699
5900
  "ERR_GIT_BRANCH_EXISTS",
5700
5901
  "ERR_GIT_BRANCH_INVALID",
5701
5902
  "ERR_GIT_FAILED",
5903
+ "ERR_TASK_NOT_FOUND",
5904
+ "ERR_TASK_CANCELLED",
5905
+ "ERR_PLAN_SESSION_STATE",
5702
5906
  "ERR_REF_OFFLINE",
5703
5907
  "ERR_NET_DISABLED",
5704
5908
  "ERR_NET_DENIED",
@@ -5809,7 +6013,12 @@ const CheckReportSchema = object({
5809
6013
  findings: array(FindingSchema),
5810
6014
  factsDigest: DigestRefSchema,
5811
6015
  durationMs: int().nonnegative(),
5812
- providers: array(ProviderStatusSchema)
6016
+ providers: array(ProviderStatusSchema),
6017
+ preImage: _enum([
6018
+ "verified",
6019
+ "drifted",
6020
+ "unverified"
6021
+ ]).optional()
5813
6022
  }).strict();
5814
6023
  const API_VERSION = "axiom.dev/v2";
5815
6024
  const ApiVersionSchema = literal(API_VERSION);
@@ -5849,7 +6058,17 @@ const PlanArtifactSourceSchema = discriminatedUnion("type", [
5849
6058
  emitter: string().min(1),
5850
6059
  template: string().min(1),
5851
6060
  params: record(string(), json()).default({})
5852
- }).strict().describe("v2.1")
6061
+ }).strict().describe("template source rendered by a registered emitter at compile time"),
6062
+ object({
6063
+ type: literal("patch"),
6064
+ format: _enum([
6065
+ "unified",
6066
+ "v4a",
6067
+ "search-replace"
6068
+ ]),
6069
+ preImage: union([DigestRefSchema, literal("absent")]),
6070
+ body: string().max(INLINE_CONTENT_MAX)
6071
+ }).strict().describe("patch applied at compile time to the pre-image named by its digest")
5853
6072
  ]);
5854
6073
  const PlanArtifactSchema = object({
5855
6074
  path: RelPathSchema,
@@ -5924,6 +6143,7 @@ const ApplyResultSchema = object({
5924
6143
  diff: string().optional(),
5925
6144
  journal: string().optional(),
5926
6145
  git: GitResultSchema.optional(),
6146
+ drifted: array(RelPathSchema).optional(),
5927
6147
  error: ApplyErrorSchema.optional()
5928
6148
  }).strict().superRefine((r, ctx) => {
5929
6149
  if (r.status === "failed" && r.error === void 0) ctx.addIssue({
@@ -5985,7 +6205,8 @@ const ManifestArtifactSchema = object({
5985
6205
  "inline",
5986
6206
  "template",
5987
6207
  "cas",
5988
- "ref"
6208
+ "ref",
6209
+ "patch"
5989
6210
  ]).optional()
5990
6211
  }).strict().superRefine((a, ctx) => {
5991
6212
  if (a.op !== "delete" && a.digest === void 0) ctx.addIssue({
@@ -5999,6 +6220,10 @@ const ToolchainSchema = object({
5999
6220
  axiom: string().min(1),
6000
6221
  emitters: record(string(), string())
6001
6222
  }).strict();
6223
+ const PreImageEntrySchema = object({
6224
+ path: RelPathSchema,
6225
+ sha256: union([Sha256HexSchema, literal("absent")])
6226
+ }).strict();
6002
6227
  const ManifestBodySchema = object({
6003
6228
  apiVersion: ApiVersionSchema,
6004
6229
  kind: literal("Manifest"),
@@ -6008,8 +6233,15 @@ const ManifestBodySchema = object({
6008
6233
  artifacts: array(ManifestArtifactSchema).min(1).max(2e3),
6009
6234
  checks: array(CheckRefSchema),
6010
6235
  toolchain: ToolchainSchema,
6011
- counter: int().nonnegative().optional()
6236
+ counter: int().nonnegative().optional(),
6237
+ preImage: array(PreImageEntrySchema).optional()
6012
6238
  }).strict().superRefine((m, ctx) => {
6239
+ if (m.preImage !== void 0 && !isSortedUnique(m.preImage.map((p) => p.path))) ctx.addIssue({
6240
+ code: "custom",
6241
+ path: ["preImage"],
6242
+ message: "preImage must be sorted by path (UTF-8 byte order) and unique",
6243
+ params: { code: "ERR_NOT_CANONICAL" }
6244
+ });
6013
6245
  if (!isSortedUnique(m.artifacts.map((a) => a.path))) ctx.addIssue({
6014
6246
  code: "custom",
6015
6247
  path: ["artifacts"],
@@ -6049,8 +6281,11 @@ const DsseEnvelopeSchema = object({
6049
6281
  sig: base64()
6050
6282
  }).strict())
6051
6283
  }).strict();
6284
+ const AXIOM_MANIFEST_PAYLOAD_TYPE = "application/vnd.axiom.manifest+json";
6285
+ const AXIOM_MANIFEST_BOUND_PAYLOAD_TYPE = "application/vnd.axiom.manifest-bound+json";
6286
+ const RootIdSchema = string().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/@-]*$/, "rootId: letters, digits, . _ : / @ - only");
6052
6287
  const ManifestSignatureSchema = object({
6053
- payloadType: literal("application/vnd.axiom.manifest+json"),
6288
+ payloadType: union([literal(AXIOM_MANIFEST_PAYLOAD_TYPE), literal(AXIOM_MANIFEST_BOUND_PAYLOAD_TYPE)]),
6054
6289
  payload: base64(),
6055
6290
  signatures: array(object({
6056
6291
  keyid: string().optional(),
@@ -6067,12 +6302,14 @@ const TrustedKeySchema = object({
6067
6302
  const TrustStoreSchema = object({
6068
6303
  version: literal(1),
6069
6304
  keys: array(TrustedKeySchema),
6070
- minCounter: int().nonnegative().optional()
6305
+ minCounter: int().nonnegative().optional(),
6306
+ rootId: RootIdSchema.optional()
6071
6307
  }).strict();
6072
6308
  const TrustStateSchema = object({
6073
6309
  version: literal(1),
6074
6310
  lastCounter: int().nonnegative(),
6075
- manifestDigest: DigestRefSchema.optional()
6311
+ manifestDigest: DigestRefSchema.optional(),
6312
+ mac: string().regex(/^[0-9a-f]{64}$/).optional()
6076
6313
  }).strict();
6077
6314
  const ManifestBundleSchema = object({
6078
6315
  manifest: ManifestBodySchema,
@@ -6136,6 +6373,6 @@ const RepoSnapshotSchema = object({
6136
6373
  snapshotDigest: DigestRefSchema,
6137
6374
  body: RepoSnapshotBodySchema
6138
6375
  }).strict();
6139
- export { custom as A, preprocess as B, relPathIssues as C, _null as D, _enum as E, literal as F, string as H, looseObject as I, number as L, int as M, intersection as N, array as O, json as P, object as R, isValidRelPath as S, datetime as T, union as U, record as V, unknown as W, TrustStateSchema as _, CheckReportSchema as a, isAxiomError as b, INLINE_CONTENT_MAX as c, ManifestBundleSchema as d, PlanSchema as f, RepoSnapshotSchema as g, RelPathSchema as h, BUNDLE_BLOB_BYTES_MAX as i, discriminatedUnion as j, boolean as k, JournalPhaseSchema as l, ProfileSchema as m, ApplyResultSchema as n, DigestRefSchema as o, ProfileNameSchema as p, AxiomError as r, ErrorCodeSchema as s, API_VERSION as t, JournalSchema as u, TrustStoreSchema as v, toDigestRef as w, isErrorCode as x, compareUtf8 as y, optional as z };
6376
+ export { _coercedNumber as $, _null as A, literal as B, isValidRelPath as C, datetime as D, date as E, email as F, preprocess as G, number as H, int as I, union as J, record as K, intersection as L, array as M, boolean as N, ZodNumber as O, discriminatedUnion as P, toJSONSchema as Q, json as R, isErrorCode as S, toDigestRef as T, object as U, looseObject as V, optional as W, url as X, unknown as Y, safeParse as Z, RepoSnapshotSchema as _, CheckReportSchema as a, compareUtf8 as b, INLINE_CONTENT_MAX as c, ManifestBundleSchema as d, NEVER as et, PlanArtifactSchema as f, RelPathSchema as g, ProfileSchema as h, BUNDLE_BLOB_BYTES_MAX as i, any as j, _enum as k, JournalPhaseSchema as l, ProfileNameSchema as m, ApplyResultSchema as n, DigestRefSchema as o, PlanSchema as p, string as q, AxiomError as r, ErrorCodeSchema as s, API_VERSION as t, JournalSchema as u, TrustStateSchema as v, relPathIssues as w, isAxiomError as x, TrustStoreSchema as y, lazy as z };
6140
6377
 
6141
- //# sourceMappingURL=dist-FFqnyzCe.js.map
6378
+ //# sourceMappingURL=dist-D4M2Lyji.js.map