@kya-os/checkpoint-shared 1.3.0 → 1.3.1

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 (52) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/beacon-types/index.d.mts +3 -1
  3. package/dist/beacon-types/index.d.ts +3 -1
  4. package/dist/beacon-types/index.js +15 -2
  5. package/dist/beacon-types/index.mjs +15 -2
  6. package/dist/browser-posture-report.d.mts +85 -0
  7. package/dist/browser-posture-report.d.ts +85 -0
  8. package/dist/browser-posture-report.js +1 -0
  9. package/dist/browser-posture-report.mjs +1 -0
  10. package/dist/browser-posture.d.mts +114 -0
  11. package/dist/browser-posture.d.ts +114 -0
  12. package/dist/browser-posture.js +4204 -0
  13. package/dist/browser-posture.mjs +4187 -0
  14. package/dist/browser.d.mts +30 -1
  15. package/dist/browser.d.ts +30 -1
  16. package/dist/browser.js +1 -1
  17. package/dist/browser.mjs +1 -1
  18. package/dist/errors/index.d.mts +104 -0
  19. package/dist/errors/index.d.ts +104 -0
  20. package/dist/errors/index.js +338 -0
  21. package/dist/errors/index.mjs +333 -0
  22. package/dist/gateway/index.d.mts +6 -1
  23. package/dist/gateway/index.d.ts +6 -1
  24. package/dist/gateway/index.js +4 -0
  25. package/dist/gateway/index.mjs +4 -1
  26. package/dist/index.d.mts +769 -146
  27. package/dist/index.d.ts +769 -146
  28. package/dist/index.js +926 -282
  29. package/dist/index.mjs +903 -283
  30. package/dist/signals/index.d.mts +1 -1
  31. package/dist/signals/index.d.ts +1 -1
  32. package/dist/signals/index.js +95 -2
  33. package/dist/signals/index.mjs +95 -2
  34. package/fixtures/client-ip-resolution.json +103 -0
  35. package/fixtures/detection/reason-codes.json +35 -0
  36. package/fixtures/detection/signal-exposure-example.json +62 -0
  37. package/fixtures/kya-http/README.md +112 -0
  38. package/fixtures/kya-http/challenge-proof.canonical.json +25 -0
  39. package/fixtures/kya-http/challenge.approval-quorum.json +37 -0
  40. package/fixtures/kya-http/challenge.delegation.fetcher-200.json +55 -0
  41. package/fixtures/kya-http/challenge.delegation.full.json +81 -0
  42. package/fixtures/kya-http/challenge.delegation.minimal.json +57 -0
  43. package/fixtures/kya-http/error-codes.json +35 -0
  44. package/fixtures/kya-http/fetcher-200-predicate.vectors.json +72 -0
  45. package/fixtures/kya-http/negative.challenges.json +54 -0
  46. package/fixtures/kya-http/pickup.transcript.json +96 -0
  47. package/fixtures/kya-http/pickup.transcript.quorum.json +156 -0
  48. package/fixtures/kya-http/protected-resource-metadata.full.json +30 -0
  49. package/fixtures/kya-http/protected-resource-metadata.global.json +28 -0
  50. package/fixtures/kya-http/registration.request.json +33 -0
  51. package/fixtures/kya-http/registration.response.json +32 -0
  52. package/package.json +20 -2
package/dist/index.mjs CHANGED
@@ -1528,9 +1528,9 @@ var ParseInputLazyPath = class {
1528
1528
  return this._cachedPath;
1529
1529
  }
1530
1530
  };
1531
- var handleResult = (ctx, result) => {
1532
- if (isValid(result)) {
1533
- return { success: true, data: result.value };
1531
+ var handleResult = (ctx, result2) => {
1532
+ if (isValid(result2)) {
1533
+ return { success: true, data: result2.value };
1534
1534
  } else {
1535
1535
  if (!ctx.common.issues.length) {
1536
1536
  throw new Error("Validation failed but no issues detected.");
@@ -1601,21 +1601,21 @@ var ZodType = class {
1601
1601
  };
1602
1602
  }
1603
1603
  _parseSync(input) {
1604
- const result = this._parse(input);
1605
- if (isAsync(result)) {
1604
+ const result2 = this._parse(input);
1605
+ if (isAsync(result2)) {
1606
1606
  throw new Error("Synchronous parse encountered promise.");
1607
1607
  }
1608
- return result;
1608
+ return result2;
1609
1609
  }
1610
1610
  _parseAsync(input) {
1611
- const result = this._parse(input);
1612
- return Promise.resolve(result);
1611
+ const result2 = this._parse(input);
1612
+ return Promise.resolve(result2);
1613
1613
  }
1614
1614
  parse(data, params) {
1615
- const result = this.safeParse(data, params);
1616
- if (result.success)
1617
- return result.data;
1618
- throw result.error;
1615
+ const result2 = this.safeParse(data, params);
1616
+ if (result2.success)
1617
+ return result2.data;
1618
+ throw result2.error;
1619
1619
  }
1620
1620
  safeParse(data, params) {
1621
1621
  const ctx = {
@@ -1630,8 +1630,8 @@ var ZodType = class {
1630
1630
  data,
1631
1631
  parsedType: getParsedType(data)
1632
1632
  };
1633
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
1634
- return handleResult(ctx, result);
1633
+ const result2 = this._parseSync({ data, path: ctx.path, parent: ctx });
1634
+ return handleResult(ctx, result2);
1635
1635
  }
1636
1636
  "~validate"(data) {
1637
1637
  const ctx = {
@@ -1647,9 +1647,9 @@ var ZodType = class {
1647
1647
  };
1648
1648
  if (!this["~standard"].async) {
1649
1649
  try {
1650
- const result = this._parseSync({ data, path: [], parent: ctx });
1651
- return isValid(result) ? {
1652
- value: result.value
1650
+ const result2 = this._parseSync({ data, path: [], parent: ctx });
1651
+ return isValid(result2) ? {
1652
+ value: result2.value
1653
1653
  } : {
1654
1654
  issues: ctx.common.issues
1655
1655
  };
@@ -1663,17 +1663,17 @@ var ZodType = class {
1663
1663
  };
1664
1664
  }
1665
1665
  }
1666
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
1667
- value: result.value
1666
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result2) => isValid(result2) ? {
1667
+ value: result2.value
1668
1668
  } : {
1669
1669
  issues: ctx.common.issues
1670
1670
  });
1671
1671
  }
1672
1672
  async parseAsync(data, params) {
1673
- const result = await this.safeParseAsync(data, params);
1674
- if (result.success)
1675
- return result.data;
1676
- throw result.error;
1673
+ const result2 = await this.safeParseAsync(data, params);
1674
+ if (result2.success)
1675
+ return result2.data;
1676
+ throw result2.error;
1677
1677
  }
1678
1678
  async safeParseAsync(data, params) {
1679
1679
  const ctx = {
@@ -1689,8 +1689,8 @@ var ZodType = class {
1689
1689
  parsedType: getParsedType(data)
1690
1690
  };
1691
1691
  const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
1692
- const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
1693
- return handleResult(ctx, result);
1692
+ const result2 = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
1693
+ return handleResult(ctx, result2);
1694
1694
  }
1695
1695
  refine(check, message) {
1696
1696
  const getIssueProperties = (val) => {
@@ -1703,13 +1703,13 @@ var ZodType = class {
1703
1703
  }
1704
1704
  };
1705
1705
  return this._refinement((val, ctx) => {
1706
- const result = check(val);
1706
+ const result2 = check(val);
1707
1707
  const setError = () => ctx.addIssue({
1708
1708
  code: ZodIssueCode.custom,
1709
1709
  ...getIssueProperties(val)
1710
1710
  });
1711
- if (typeof Promise !== "undefined" && result instanceof Promise) {
1712
- return result.then((data) => {
1711
+ if (typeof Promise !== "undefined" && result2 instanceof Promise) {
1712
+ return result2.then((data) => {
1713
1713
  if (!data) {
1714
1714
  setError();
1715
1715
  return false;
@@ -1718,7 +1718,7 @@ var ZodType = class {
1718
1718
  }
1719
1719
  });
1720
1720
  }
1721
- if (!result) {
1721
+ if (!result2) {
1722
1722
  setError();
1723
1723
  return false;
1724
1724
  } else {
@@ -3213,14 +3213,14 @@ var ZodArray = class _ZodArray extends ZodType {
3213
3213
  if (ctx.common.async) {
3214
3214
  return Promise.all([...ctx.data].map((item, i) => {
3215
3215
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
3216
- })).then((result2) => {
3217
- return ParseStatus.mergeArray(status, result2);
3216
+ })).then((result3) => {
3217
+ return ParseStatus.mergeArray(status, result3);
3218
3218
  });
3219
3219
  }
3220
- const result = [...ctx.data].map((item, i) => {
3220
+ const result2 = [...ctx.data].map((item, i) => {
3221
3221
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
3222
3222
  });
3223
- return ParseStatus.mergeArray(status, result);
3223
+ return ParseStatus.mergeArray(status, result2);
3224
3224
  }
3225
3225
  get element() {
3226
3226
  return this._def.type;
@@ -3625,18 +3625,18 @@ var ZodUnion = class extends ZodType {
3625
3625
  const { ctx } = this._processInputParams(input);
3626
3626
  const options = this._def.options;
3627
3627
  function handleResults(results) {
3628
- for (const result of results) {
3629
- if (result.result.status === "valid") {
3630
- return result.result;
3628
+ for (const result2 of results) {
3629
+ if (result2.result.status === "valid") {
3630
+ return result2.result;
3631
3631
  }
3632
3632
  }
3633
- for (const result of results) {
3634
- if (result.result.status === "dirty") {
3635
- ctx.common.issues.push(...result.ctx.common.issues);
3636
- return result.result;
3633
+ for (const result2 of results) {
3634
+ if (result2.result.status === "dirty") {
3635
+ ctx.common.issues.push(...result2.ctx.common.issues);
3636
+ return result2.result;
3637
3637
  }
3638
3638
  }
3639
- const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
3639
+ const unionErrors = results.map((result2) => new ZodError(result2.ctx.common.issues));
3640
3640
  addIssueToContext(ctx, {
3641
3641
  code: ZodIssueCode.invalid_union,
3642
3642
  unionErrors
@@ -3674,15 +3674,15 @@ var ZodUnion = class extends ZodType {
3674
3674
  },
3675
3675
  parent: null
3676
3676
  };
3677
- const result = option._parseSync({
3677
+ const result2 = option._parseSync({
3678
3678
  data: ctx.data,
3679
3679
  path: ctx.path,
3680
3680
  parent: childCtx
3681
3681
  });
3682
- if (result.status === "valid") {
3683
- return result;
3684
- } else if (result.status === "dirty" && !dirty) {
3685
- dirty = { result, ctx: childCtx };
3682
+ if (result2.status === "valid") {
3683
+ return result2;
3684
+ } else if (result2.status === "dirty" && !dirty) {
3685
+ dirty = { result: result2, ctx: childCtx };
3686
3686
  }
3687
3687
  if (childCtx.common.issues.length) {
3688
3688
  issues.push(childCtx.common.issues);
@@ -4227,9 +4227,9 @@ var ZodFunction = class _ZodFunction extends ZodType {
4227
4227
  error.addIssue(makeArgsIssue(args, e));
4228
4228
  throw error;
4229
4229
  });
4230
- const result = await Reflect.apply(fn, this, parsedArgs);
4231
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
4232
- error.addIssue(makeReturnsIssue(result, e));
4230
+ const result2 = await Reflect.apply(fn, this, parsedArgs);
4231
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result2, params).catch((e) => {
4232
+ error.addIssue(makeReturnsIssue(result2, e));
4233
4233
  throw error;
4234
4234
  });
4235
4235
  return parsedReturns;
@@ -4241,10 +4241,10 @@ var ZodFunction = class _ZodFunction extends ZodType {
4241
4241
  if (!parsedArgs.success) {
4242
4242
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
4243
4243
  }
4244
- const result = Reflect.apply(fn, this, parsedArgs.data);
4245
- const parsedReturns = me._def.returns.safeParse(result, params);
4244
+ const result2 = Reflect.apply(fn, this, parsedArgs.data);
4245
+ const parsedReturns = me._def.returns.safeParse(result2, params);
4246
4246
  if (!parsedReturns.success) {
4247
- throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
4247
+ throw new ZodError([makeReturnsIssue(result2, parsedReturns.error)]);
4248
4248
  }
4249
4249
  return parsedReturns.data;
4250
4250
  });
@@ -4496,43 +4496,43 @@ var ZodEffects = class extends ZodType {
4496
4496
  return Promise.resolve(processed).then(async (processed2) => {
4497
4497
  if (status.value === "aborted")
4498
4498
  return INVALID;
4499
- const result = await this._def.schema._parseAsync({
4499
+ const result2 = await this._def.schema._parseAsync({
4500
4500
  data: processed2,
4501
4501
  path: ctx.path,
4502
4502
  parent: ctx
4503
4503
  });
4504
- if (result.status === "aborted")
4504
+ if (result2.status === "aborted")
4505
4505
  return INVALID;
4506
- if (result.status === "dirty")
4507
- return DIRTY(result.value);
4506
+ if (result2.status === "dirty")
4507
+ return DIRTY(result2.value);
4508
4508
  if (status.value === "dirty")
4509
- return DIRTY(result.value);
4510
- return result;
4509
+ return DIRTY(result2.value);
4510
+ return result2;
4511
4511
  });
4512
4512
  } else {
4513
4513
  if (status.value === "aborted")
4514
4514
  return INVALID;
4515
- const result = this._def.schema._parseSync({
4515
+ const result2 = this._def.schema._parseSync({
4516
4516
  data: processed,
4517
4517
  path: ctx.path,
4518
4518
  parent: ctx
4519
4519
  });
4520
- if (result.status === "aborted")
4520
+ if (result2.status === "aborted")
4521
4521
  return INVALID;
4522
- if (result.status === "dirty")
4523
- return DIRTY(result.value);
4522
+ if (result2.status === "dirty")
4523
+ return DIRTY(result2.value);
4524
4524
  if (status.value === "dirty")
4525
- return DIRTY(result.value);
4526
- return result;
4525
+ return DIRTY(result2.value);
4526
+ return result2;
4527
4527
  }
4528
4528
  }
4529
4529
  if (effect.type === "refinement") {
4530
4530
  const executeRefinement = (acc) => {
4531
- const result = effect.refinement(acc, checkCtx);
4531
+ const result2 = effect.refinement(acc, checkCtx);
4532
4532
  if (ctx.common.async) {
4533
- return Promise.resolve(result);
4533
+ return Promise.resolve(result2);
4534
4534
  }
4535
- if (result instanceof Promise) {
4535
+ if (result2 instanceof Promise) {
4536
4536
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
4537
4537
  }
4538
4538
  return acc;
@@ -4570,18 +4570,18 @@ var ZodEffects = class extends ZodType {
4570
4570
  });
4571
4571
  if (!isValid(base))
4572
4572
  return INVALID;
4573
- const result = effect.transform(base.value, checkCtx);
4574
- if (result instanceof Promise) {
4573
+ const result2 = effect.transform(base.value, checkCtx);
4574
+ if (result2 instanceof Promise) {
4575
4575
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
4576
4576
  }
4577
- return { status: status.value, value: result };
4577
+ return { status: status.value, value: result2 };
4578
4578
  } else {
4579
4579
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
4580
4580
  if (!isValid(base))
4581
4581
  return INVALID;
4582
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
4582
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result2) => ({
4583
4583
  status: status.value,
4584
- value: result
4584
+ value: result2
4585
4585
  }));
4586
4586
  });
4587
4587
  }
@@ -4678,18 +4678,18 @@ var ZodCatch = class extends ZodType {
4678
4678
  issues: []
4679
4679
  }
4680
4680
  };
4681
- const result = this._def.innerType._parse({
4681
+ const result2 = this._def.innerType._parse({
4682
4682
  data: newCtx.data,
4683
4683
  path: newCtx.path,
4684
4684
  parent: {
4685
4685
  ...newCtx
4686
4686
  }
4687
4687
  });
4688
- if (isAsync(result)) {
4689
- return result.then((result2) => {
4688
+ if (isAsync(result2)) {
4689
+ return result2.then((result3) => {
4690
4690
  return {
4691
4691
  status: "valid",
4692
- value: result2.status === "valid" ? result2.value : this._def.catchValue({
4692
+ value: result3.status === "valid" ? result3.value : this._def.catchValue({
4693
4693
  get error() {
4694
4694
  return new ZodError(newCtx.common.issues);
4695
4695
  },
@@ -4700,7 +4700,7 @@ var ZodCatch = class extends ZodType {
4700
4700
  } else {
4701
4701
  return {
4702
4702
  status: "valid",
4703
- value: result.status === "valid" ? result.value : this._def.catchValue({
4703
+ value: result2.status === "valid" ? result2.value : this._def.catchValue({
4704
4704
  get error() {
4705
4705
  return new ZodError(newCtx.common.issues);
4706
4706
  },
@@ -4814,14 +4814,14 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
4814
4814
  };
4815
4815
  var ZodReadonly = class extends ZodType {
4816
4816
  _parse(input) {
4817
- const result = this._def.innerType._parse(input);
4817
+ const result2 = this._def.innerType._parse(input);
4818
4818
  const freeze = (data) => {
4819
4819
  if (isValid(data)) {
4820
4820
  data.value = Object.freeze(data.value);
4821
4821
  }
4822
4822
  return data;
4823
4823
  };
4824
- return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
4824
+ return isAsync(result2) ? result2.then((data) => freeze(data)) : freeze(result2);
4825
4825
  }
4826
4826
  unwrap() {
4827
4827
  return this._def.innerType;
@@ -4988,7 +4988,7 @@ var DetectionInputSchema = external_exports.object({
4988
4988
  ip: external_exports.string().optional(),
4989
4989
  ipAddress: external_exports.string().optional(),
4990
4990
  // Alias for ip
4991
- headers: external_exports.record(external_exports.string()).optional(),
4991
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
4992
4992
  url: external_exports.string().optional(),
4993
4993
  method: external_exports.string().optional(),
4994
4994
  body: external_exports.unknown().optional(),
@@ -4997,19 +4997,25 @@ var DetectionInputSchema = external_exports.object({
4997
4997
  var RequestContextSchema = external_exports.object({
4998
4998
  userAgent: external_exports.string().optional(),
4999
4999
  ipAddress: external_exports.string().optional(),
5000
- headers: external_exports.record(external_exports.string()).optional(),
5000
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
5001
5001
  url: external_exports.string().optional(),
5002
5002
  method: external_exports.string().optional(),
5003
5003
  body: external_exports.unknown().optional(),
5004
5004
  timestamp: external_exports.date().default(() => /* @__PURE__ */ new Date())
5005
5005
  });
5006
5006
  var DetectionSignalSchema = external_exports.object({
5007
- signalType: external_exports.enum(["signature", "pattern", "behavioral", "network", "fingerprint"]),
5008
- confidence: external_exports.number().min(0).max(100),
5009
- weight: external_exports.number().min(0).max(1),
5010
- source: external_exports.string(),
5011
- explanation: external_exports.string(),
5012
- metadata: external_exports.record(external_exports.unknown()).optional()
5007
+ signalType: external_exports.enum(["signature", "pattern", "behavioral", "network", "fingerprint"]).describe(
5008
+ "Evidence plane this signal was observed on: cryptographic signature, User-Agent/header pattern, behavioral interaction, network/IP, or transport fingerprint."
5009
+ ),
5010
+ confidence: external_exports.number().min(0).max(100).describe("This signal's own confidence contribution on the 0-100 scale."),
5011
+ weight: external_exports.number().min(0).max(1).describe("This signal's relative weight (0-1) in the combined verdict."),
5012
+ source: external_exports.string().describe(
5013
+ "Machine-readable evidence source (e.g. 'user_agent_pattern', 'vendor_ip_feed', 'transport.ja4', 'mcp_i'). New signal families (e.g. request-velocity, platform bot-management corroboration) appear as new source values: additive, never a breaking change."
5014
+ ),
5015
+ explanation: external_exports.string().describe("Human-readable explanation of what this signal observed. Prose, not a contract."),
5016
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe(
5017
+ "Optional source-specific structured details (e.g. the matched pattern, the vendor feed name)."
5018
+ )
5013
5019
  });
5014
5020
  var ReasoningStepSchema = external_exports.object({
5015
5021
  signalType: external_exports.string(),
@@ -5051,6 +5057,7 @@ var DetectionReasoningSchema = external_exports.object({
5051
5057
  primaryFactors: external_exports.array(external_exports.string()),
5052
5058
  supportingEvidence: external_exports.array(external_exports.string()),
5053
5059
  confidenceBreakdown: external_exports.record(
5060
+ external_exports.string(),
5054
5061
  external_exports.object({
5055
5062
  confidence: external_exports.number().min(0).max(100),
5056
5063
  weight: external_exports.number().min(0).max(1),
@@ -5067,7 +5074,7 @@ var EngineInfoSchema = external_exports.object({
5067
5074
  rulesetHash: external_exports.string(),
5068
5075
  rulesetVersion: external_exports.string(),
5069
5076
  buildSha: external_exports.string().optional(),
5070
- extras: external_exports.record(external_exports.unknown()).optional()
5077
+ extras: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
5071
5078
  });
5072
5079
  var DetectionDetailSchema = external_exports.object({
5073
5080
  // Core fields
@@ -5145,7 +5152,7 @@ var DetectionDetailSchema = external_exports.object({
5145
5152
  recommendations: external_exports.array(external_exports.string()).optional()
5146
5153
  }).optional(),
5147
5154
  // Metadata
5148
- metadata: external_exports.record(external_exports.unknown()).optional(),
5155
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
5149
5156
  timestamp: external_exports.union([external_exports.date(), external_exports.number()]).default(() => /* @__PURE__ */ new Date()),
5150
5157
  requestId: external_exports.string().optional(),
5151
5158
  /** Engine self-identification — see EngineInfoSchema. Optional for
@@ -5306,7 +5313,7 @@ var AgentPatternSchema = external_exports.object({
5306
5313
  type: AgentTypeSchema,
5307
5314
  name: external_exports.string(),
5308
5315
  patterns: external_exports.array(external_exports.string()),
5309
- headers: external_exports.record(external_exports.string()).optional(),
5316
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
5310
5317
  ipRanges: external_exports.array(external_exports.string()).optional(),
5311
5318
  confidence: external_exports.number().min(0).max(1).default(0.8),
5312
5319
  category: external_exports.enum([
@@ -5485,6 +5492,232 @@ function reconstructConfidenceFromEvidence(evidence) {
5485
5492
  return (1 - probabilityAbsent) * 100;
5486
5493
  }
5487
5494
 
5495
+ // src/core/detection-reason-codes.ts
5496
+ var DETECTION_REASON_CODES = {
5497
+ // ── Cryptographic / verified attribution (strongest evidence, first) ────
5498
+ /** `verificationMethod === 'kya-http'` — a kya-http/RFC 9421 signature verified. */
5499
+ SIGNATURE_VERIFIED: "detection/signature-verified",
5500
+ /** `verificationMethod === 'kya-http-delegated'` — a verified delegation credential rode the request. */
5501
+ DELEGATION_VERIFIED: "detection/delegation-verified",
5502
+ /** `verificationMethod === 'mcp-i' | 'kya-os'` (the wire values; `isKyaOsWireMethod`) — the MCP-I/KYA-OS handshake verified. */
5503
+ MCP_I_VERIFIED: "detection/mcp-i-verified",
5504
+ /** `verificationMethod === 'did'` — the worker's DID-header scheme verified an Ed25519 signature against the agent's DID Document. */
5505
+ DID_SIGNATURE_VERIFIED: "detection/did-signature-verified",
5506
+ /** `verificationMethod === 'signature'` — the worker's RFC 9421 signature verifier (ChatGPT et al.) verified against the DB-refreshed key directory. */
5507
+ RFC9421_SIGNATURE_VERIFIED: "detection/rfc9421-signature-verified",
5508
+ /** `verificationMethod` starts with `tier1_` (e.g. `tier1_rfc9421`) — the engine's Tier-1 protocol attribution verified. */
5509
+ TIER1_ATTRIBUTION_VERIFIED: "detection/tier1-attribution-verified",
5510
+ /** `verificationMethod === 'error'` — a presented credential was demoted/rejected during verification; see the sibling `kyaErrorCode`. */
5511
+ VERIFICATION_ERROR: "detection/verification-error",
5512
+ // ── Structured evidence signals (one per distinct `signals[].source`) ───
5513
+ /** A `signals[]` entry with `source === 'user_agent_pattern'` — the User-Agent matched a known pattern. */
5514
+ UA_PATTERN_MATCH: "detection/ua-pattern-match",
5515
+ /** `source === 'header_heuristic'` — a header shape/combination heuristic matched. */
5516
+ HEADER_HEURISTIC: "detection/header-heuristic",
5517
+ /** `source === 'ip_heuristic'` — an IP-based heuristic matched. */
5518
+ IP_HEURISTIC: "detection/ip-heuristic",
5519
+ /** `source === 'vendor_ip_feed'` — the request IP matched a known vendor's published IP range. */
5520
+ VENDOR_IP_CORROBORATED: "detection/vendor-ip-corroborated",
5521
+ /** `source === 'transport.ja4'` — the TLS JA4 fingerprint matched a known client library. */
5522
+ JA4_FINGERPRINT_MATCH: "detection/ja4-fingerprint-match",
5523
+ /** `source === 'client.attributes'` — a pixel/beacon-reported client attribute contributed. */
5524
+ CLIENT_ATTRIBUTE_SIGNAL: "detection/client-attribute-signal",
5525
+ /** `source === 'behavioural.interaction'` — a behavioral/interaction signal contributed. */
5526
+ BEHAVIORAL_SIGNAL: "detection/behavioral-signal",
5527
+ /** `source === 'mcp_i'` — an MCP-I header was present (evidence short of a completed handshake). */
5528
+ MCP_I_SIGNAL: "detection/mcp-i-signal",
5529
+ /** `source === 'kya_http_binding'` — a kya-http binding was presented (evidence short of full verification). */
5530
+ KYA_HTTP_BINDING_SIGNAL: "detection/kya-http-binding-signal",
5531
+ /** `source === 'kya_delegation_bearer'` — a delegation bearer credential was presented. */
5532
+ KYA_DELEGATION_BEARER_SIGNAL: "detection/kya-delegation-bearer-signal",
5533
+ /** A `signals[]` entry whose `source` starts with `tier1_` — raw Tier-1 protocol evidence, short of (or alongside) full verification. */
5534
+ TIER1_ATTRIBUTION_SIGNAL: "detection/tier1-attribution-signal",
5535
+ // ── Classification flags ─────────────────────────────────────────────────
5536
+ /** `isAiCrawler === true` — classified as an AI training crawler (GPTBot, ClaudeBot, etc.), not an interactive agent. */
5537
+ AI_CRAWLER_FLAG: "detection/ai-crawler-flag",
5538
+ // ── Zero-evidence fallbacks — an assumed verdict deserves a code saying so
5539
+ // (in the spirit of #4800): these fire ONLY when nothing above matched,
5540
+ // so the mapping never returns an empty list. ───────────────────────────
5541
+ /** `detectionClass === 'human'` with no contributing signals and no verification — the baseline "nothing matched" human path. */
5542
+ ZERO_EVIDENCE_HUMAN: "detection/zero-evidence-human",
5543
+ /** `detectionClass === 'incomplete_data' | 'unknown'` (or absent) — the engine could not classify confidently. */
5544
+ INCOMPLETE_DATA_OVERRIDE: "detection/incomplete-data-override",
5545
+ /** A non-human, non-incomplete-data class (`ai_agent` / `bot` / `automation`) reached with zero contributing signals and no verification — classified on prior/heuristic grounds alone. */
5546
+ CLASSIFIED_WITHOUT_SIGNAL_EVIDENCE: "detection/classified-without-signal-evidence"
5547
+ };
5548
+
5549
+ // src/utils/verification.ts
5550
+ var KYA_OS_HANDSHAKE_METHODS = {
5551
+ /** New canonical engine value. Not emitted yet — accepted on read. */
5552
+ CANONICAL: "kyaos_handshake",
5553
+ /** @deprecated Legacy engine value. Still emitted by the Rust engine. */
5554
+ LEGACY: "mcp_i_handshake"
5555
+ };
5556
+ var KYA_OS_WIRE_METHODS = {
5557
+ /** New canonical wire value. Not emitted yet — accepted on read. */
5558
+ CANONICAL: "kya-os",
5559
+ /** @deprecated Legacy wire value. Still emitted by the gateway worker. */
5560
+ LEGACY: "mcp-i"
5561
+ };
5562
+ function isKyaOsHandshakeMethod(value) {
5563
+ return value === KYA_OS_HANDSHAKE_METHODS.LEGACY || value === KYA_OS_HANDSHAKE_METHODS.CANONICAL;
5564
+ }
5565
+ function isKyaOsWireMethod(value) {
5566
+ return value === KYA_OS_WIRE_METHODS.LEGACY || value === KYA_OS_WIRE_METHODS.CANONICAL;
5567
+ }
5568
+ function normalizeHandshakeMethod(value) {
5569
+ return isKyaOsHandshakeMethod(value) ? KYA_OS_HANDSHAKE_METHODS.CANONICAL : value;
5570
+ }
5571
+ function normalizeWireMethod(value) {
5572
+ return isKyaOsWireMethod(value) ? KYA_OS_WIRE_METHODS.CANONICAL : value;
5573
+ }
5574
+ function getVerificationMethodDescription(method) {
5575
+ switch (normalizeHandshakeMethod(method)) {
5576
+ case "signature":
5577
+ return "HTTP Signature Verification";
5578
+ case "pattern":
5579
+ return "User-Agent Pattern Matching";
5580
+ case "behavioral":
5581
+ return "Behavioral Analysis";
5582
+ case "network":
5583
+ return "Network-based Detection";
5584
+ case KYA_OS_HANDSHAKE_METHODS.CANONICAL:
5585
+ return "MCP Handshake Detection";
5586
+ case "error":
5587
+ return "Detection Error";
5588
+ case "none":
5589
+ default:
5590
+ return "No Verification";
5591
+ }
5592
+ }
5593
+ function getVerificationReliability(method) {
5594
+ switch (normalizeHandshakeMethod(method)) {
5595
+ case "signature":
5596
+ return 1;
5597
+ // Highest reliability
5598
+ case KYA_OS_HANDSHAKE_METHODS.CANONICAL:
5599
+ return 0.95;
5600
+ case "behavioral":
5601
+ return 0.8;
5602
+ case "network":
5603
+ return 0.6;
5604
+ case "pattern":
5605
+ return 0.5;
5606
+ case "none":
5607
+ return 0.3;
5608
+ case "error":
5609
+ default:
5610
+ return 0.1;
5611
+ }
5612
+ }
5613
+ function isHighConfidenceVerification(method) {
5614
+ return method === "signature" || isKyaOsHandshakeMethod(method);
5615
+ }
5616
+ function getVerificationRiskLevel(method, confidence) {
5617
+ if (method === "signature") {
5618
+ return "low";
5619
+ }
5620
+ if (isKyaOsHandshakeMethod(method)) {
5621
+ return "low";
5622
+ }
5623
+ if (confidence >= 0.9) {
5624
+ return method === "behavioral" ? "medium" : "high";
5625
+ }
5626
+ if (confidence >= 0.7) {
5627
+ return "medium";
5628
+ }
5629
+ return "high";
5630
+ }
5631
+
5632
+ // src/core/detection-reason-mapping.ts
5633
+ var VERIFICATION_METHOD_CODES = {
5634
+ "kya-http-delegated": DETECTION_REASON_CODES.DELEGATION_VERIFIED,
5635
+ "kya-http": DETECTION_REASON_CODES.SIGNATURE_VERIFIED,
5636
+ did: DETECTION_REASON_CODES.DID_SIGNATURE_VERIFIED,
5637
+ signature: DETECTION_REASON_CODES.RFC9421_SIGNATURE_VERIFIED,
5638
+ error: DETECTION_REASON_CODES.VERIFICATION_ERROR
5639
+ };
5640
+ var SIGNAL_SOURCE_CODES = {
5641
+ mcp_i: DETECTION_REASON_CODES.MCP_I_SIGNAL,
5642
+ kya_http_binding: DETECTION_REASON_CODES.KYA_HTTP_BINDING_SIGNAL,
5643
+ kya_delegation_bearer: DETECTION_REASON_CODES.KYA_DELEGATION_BEARER_SIGNAL,
5644
+ user_agent_pattern: DETECTION_REASON_CODES.UA_PATTERN_MATCH,
5645
+ header_heuristic: DETECTION_REASON_CODES.HEADER_HEURISTIC,
5646
+ ip_heuristic: DETECTION_REASON_CODES.IP_HEURISTIC,
5647
+ vendor_ip_feed: DETECTION_REASON_CODES.VENDOR_IP_CORROBORATED,
5648
+ "transport.ja4": DETECTION_REASON_CODES.JA4_FINGERPRINT_MATCH,
5649
+ "client.attributes": DETECTION_REASON_CODES.CLIENT_ATTRIBUTE_SIGNAL,
5650
+ "behavioural.interaction": DETECTION_REASON_CODES.BEHAVIORAL_SIGNAL
5651
+ };
5652
+ function mapDetectionToReasonCodes(detail) {
5653
+ const codes = [];
5654
+ const seen = /* @__PURE__ */ new Set();
5655
+ const push = (code) => {
5656
+ if (code && !seen.has(code)) {
5657
+ seen.add(code);
5658
+ codes.push(code);
5659
+ }
5660
+ };
5661
+ const verificationMethod = detail.verificationMethod;
5662
+ if (verificationMethod) {
5663
+ if (verificationMethod.startsWith("tier1_")) {
5664
+ push(DETECTION_REASON_CODES.TIER1_ATTRIBUTION_VERIFIED);
5665
+ } else if (
5666
+ // Dual-accept BOTH value spaces for the KYA-OS handshake: the gateway
5667
+ // worker normalizes to the WIRE values (`mcp-i`/`kya-os`) before
5668
+ // calling in, while the enforce route's engine-refined detail carries
5669
+ // the ENGINE values (`mcp_i_handshake`/`kyaos_handshake`). Routing
5670
+ // both through the shared predicates keeps the alias pairs in exactly
5671
+ // one place and closes the exact single-value-space gap Bugbot
5672
+ // caught on PR #4874.
5673
+ isKyaOsWireMethod(verificationMethod) || isKyaOsHandshakeMethod(verificationMethod)
5674
+ ) {
5675
+ push(DETECTION_REASON_CODES.MCP_I_VERIFIED);
5676
+ } else {
5677
+ push(VERIFICATION_METHOD_CODES[verificationMethod]);
5678
+ }
5679
+ }
5680
+ const presentSources = /* @__PURE__ */ new Set();
5681
+ let hasTier1Signal = false;
5682
+ for (const signal of detail.signals ?? []) {
5683
+ presentSources.add(signal.source);
5684
+ if (signal.source.startsWith("tier1_")) hasTier1Signal = true;
5685
+ }
5686
+ for (const source of Object.keys(SIGNAL_SOURCE_CODES)) {
5687
+ if (presentSources.has(source)) push(SIGNAL_SOURCE_CODES[source]);
5688
+ }
5689
+ if (hasTier1Signal) {
5690
+ push(DETECTION_REASON_CODES.TIER1_ATTRIBUTION_SIGNAL);
5691
+ }
5692
+ if (detail.isAiCrawler) {
5693
+ push(DETECTION_REASON_CODES.AI_CRAWLER_FLAG);
5694
+ }
5695
+ if (codes.length === 0) {
5696
+ if (detail.detectionClass === "human") {
5697
+ push(DETECTION_REASON_CODES.ZERO_EVIDENCE_HUMAN);
5698
+ } else if (detail.detectionClass === "incomplete_data" || detail.detectionClass === "unknown" || !detail.detectionClass) {
5699
+ push(DETECTION_REASON_CODES.INCOMPLETE_DATA_OVERRIDE);
5700
+ } else {
5701
+ push(DETECTION_REASON_CODES.CLASSIFIED_WITHOUT_SIGNAL_EVIDENCE);
5702
+ }
5703
+ }
5704
+ return codes;
5705
+ }
5706
+ var MAX_REASON_CODES_ON_WIRE = 5;
5707
+ var MAX_REASON_CODES_HEADER_BYTES = 256;
5708
+ var HEADER_BYTES_ENCODER = new TextEncoder();
5709
+ function formatReasonCodesHeader(codes) {
5710
+ const capped = codes.slice(0, MAX_REASON_CODES_ON_WIRE);
5711
+ while (capped.length > 0) {
5712
+ const joined = capped.join(",");
5713
+ if (HEADER_BYTES_ENCODER.encode(joined).byteLength <= MAX_REASON_CODES_HEADER_BYTES) {
5714
+ return joined;
5715
+ }
5716
+ capped.pop();
5717
+ }
5718
+ return "";
5719
+ }
5720
+
5488
5721
  // src/config/shield.ts
5489
5722
  var CacheConfigSchema = external_exports.object({
5490
5723
  enabled: external_exports.boolean().default(true),
@@ -5537,7 +5770,7 @@ var AgentShieldConfigSchema = external_exports.object({
5537
5770
  wasm: WasmConfigSchema.optional(),
5538
5771
  // Custom rules and patterns
5539
5772
  customRules: external_exports.array(external_exports.string()).optional(),
5540
- customPatterns: external_exports.record(external_exports.string()).optional(),
5773
+ customPatterns: external_exports.record(external_exports.string(), external_exports.string()).optional(),
5541
5774
  // Allowlists and blocklists
5542
5775
  allowedAgents: external_exports.array(external_exports.string()).optional(),
5543
5776
  blockedAgents: external_exports.array(external_exports.string()).optional(),
@@ -5574,7 +5807,7 @@ var ResponseActionSchema = external_exports.object({
5574
5807
  statusCode: external_exports.number().default(403),
5575
5808
  message: external_exports.string().default("Access denied"),
5576
5809
  redirect: external_exports.string().optional(),
5577
- addHeaders: external_exports.record(external_exports.string()).optional(),
5810
+ addHeaders: external_exports.record(external_exports.string(), external_exports.string()).optional(),
5578
5811
  customResponse: external_exports.any().optional()
5579
5812
  });
5580
5813
  var EventConfigSchema = external_exports.object({
@@ -5607,7 +5840,7 @@ var MiddlewareSessionDataSchema = external_exports.object({
5607
5840
  firstSeen: external_exports.number(),
5608
5841
  lastSeen: external_exports.number(),
5609
5842
  requestCount: external_exports.number(),
5610
- metadata: external_exports.record(external_exports.any()).optional()
5843
+ metadata: external_exports.record(external_exports.string(), external_exports.any()).optional()
5611
5844
  });
5612
5845
  var MiddlewareConfigSchema = external_exports.object({
5613
5846
  action: MiddlewareActionSchema.default("log"),
@@ -6713,7 +6946,11 @@ var VALIDATION_ERRORS = {
6713
6946
  INVALID_URL: "VALIDATION_INVALID_URL",
6714
6947
  INVALID_UUID: "VALIDATION_INVALID_UUID",
6715
6948
  INVALID_IP_ADDRESS: "VALIDATION_INVALID_IP_ADDRESS",
6716
- INVALID_USER_AGENT: "VALIDATION_INVALID_USER_AGENT"
6949
+ INVALID_USER_AGENT: "VALIDATION_INVALID_USER_AGENT",
6950
+ BAD_REQUEST: "VALIDATION_BAD_REQUEST",
6951
+ INVALID_START_DATE: "VALIDATION_INVALID_START_DATE",
6952
+ INVALID_END_DATE: "VALIDATION_INVALID_END_DATE",
6953
+ INVALID_DATE_RANGE: "VALIDATION_INVALID_DATE_RANGE"
6717
6954
  };
6718
6955
  var DETECTION_ERRORS = {
6719
6956
  DETECTION_FAILED: "DETECTION_FAILED",
@@ -6738,7 +6975,8 @@ var PERMISSION_ERRORS = {
6738
6975
  RESOURCE_ACCESS_DENIED: "PERMISSION_ACCESS_DENIED",
6739
6976
  OPERATION_NOT_ALLOWED: "PERMISSION_OPERATION_NOT_ALLOWED",
6740
6977
  PROJECT_ACCESS_DENIED: "PERMISSION_PROJECT_ACCESS_DENIED",
6741
- PIXEL_ACCESS_DENIED: "PERMISSION_PIXEL_ACCESS_DENIED"
6978
+ PIXEL_ACCESS_DENIED: "PERMISSION_PIXEL_ACCESS_DENIED",
6979
+ FORBIDDEN: "PERMISSION_FORBIDDEN"
6742
6980
  };
6743
6981
  var NETWORK_ERRORS = {
6744
6982
  CONNECTION_FAILED: "NETWORK_CONNECTION_FAILED",
@@ -6755,7 +6993,8 @@ var INTERNAL_ERRORS = {
6755
6993
  CONFIGURATION_ERROR: "INTERNAL_CONFIGURATION_ERROR",
6756
6994
  INITIALIZATION_ERROR: "INTERNAL_INITIALIZATION_ERROR",
6757
6995
  PROCESSING_ERROR: "INTERNAL_PROCESSING_ERROR",
6758
- UNKNOWN_ERROR: "INTERNAL_UNKNOWN_ERROR"
6996
+ UNKNOWN_ERROR: "INTERNAL_UNKNOWN_ERROR",
6997
+ SERVICE_UNAVAILABLE_TRANSIENT: "SERVICE_UNAVAILABLE_TRANSIENT"
6759
6998
  };
6760
6999
  var SESSION_ERRORS = {
6761
7000
  SESSION_NOT_FOUND: "SESSION_NOT_FOUND",
@@ -6773,7 +7012,10 @@ var PIXEL_ERRORS = {
6773
7012
  PIXEL_DOMAIN_NOT_ALLOWED: "PIXEL_DOMAIN_NOT_ALLOWED",
6774
7013
  PIXEL_PATH_SKIPPED: "PIXEL_PATH_SKIPPED",
6775
7014
  PIXEL_EVENT_INVALID: "PIXEL_EVENT_INVALID",
6776
- PIXEL_BATCH_TOO_LARGE: "PIXEL_BATCH_TOO_LARGE"
7015
+ PIXEL_BATCH_TOO_LARGE: "PIXEL_BATCH_TOO_LARGE",
7016
+ MISSING_PIXEL_ID: "MISSING_PIXEL_ID",
7017
+ INVALID_EDGE_SIGNATURE: "INVALID_EDGE_SIGNATURE",
7018
+ DETECTION_STORAGE_FAILED: "DETECTION_STORAGE_FAILED"
6777
7019
  };
6778
7020
  var API_ERRORS = {
6779
7021
  ENDPOINT_NOT_FOUND: "API_ENDPOINT_NOT_FOUND",
@@ -6783,6 +7025,27 @@ var API_ERRORS = {
6783
7025
  RESPONSE_TOO_LARGE: "API_RESPONSE_TOO_LARGE",
6784
7026
  REQUEST_TOO_LARGE: "API_REQUEST_TOO_LARGE"
6785
7027
  };
7028
+ var BILLING_ERRORS = {
7029
+ LIMIT_EXCEEDED: "LIMIT_EXCEEDED",
7030
+ BILLING_SUSPENDED: "BILLING_SUSPENDED",
7031
+ BILLING_GRACE_PERIOD: "BILLING_GRACE_PERIOD"
7032
+ };
7033
+ var RESOURCE_ERRORS = {
7034
+ CONFLICT: "CONFLICT",
7035
+ PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
7036
+ REVIEW_REQUIRED: "REVIEW_REQUIRED"
7037
+ };
7038
+ var POLICY_ERRORS = {
7039
+ POLICY_FETCH_FAILED: "POLICY_FETCH_FAILED"
7040
+ };
7041
+ var BARE_ERRORS = {
7042
+ BARE_VALIDATION_ERROR: "VALIDATION_ERROR",
7043
+ BARE_INTERNAL_ERROR: "INTERNAL_ERROR"
7044
+ };
7045
+ var LOWERCASE_ERRORS = {
7046
+ LOWERCASE_INVALID_JSON: "invalid_json",
7047
+ LOWERCASE_VALIDATION_ERROR: "validation_error"
7048
+ };
6786
7049
  var ERROR_CODES = {
6787
7050
  ...AUTH_ERRORS,
6788
7051
  ...VALIDATION_ERRORS,
@@ -6793,7 +7056,12 @@ var ERROR_CODES = {
6793
7056
  ...INTERNAL_ERRORS,
6794
7057
  ...SESSION_ERRORS,
6795
7058
  ...PIXEL_ERRORS,
6796
- ...API_ERRORS
7059
+ ...API_ERRORS,
7060
+ ...BILLING_ERRORS,
7061
+ ...RESOURCE_ERRORS,
7062
+ ...POLICY_ERRORS,
7063
+ ...BARE_ERRORS,
7064
+ ...LOWERCASE_ERRORS
6797
7065
  };
6798
7066
  var ERROR_MESSAGES = {
6799
7067
  // Authentication
@@ -6817,6 +7085,10 @@ var ERROR_MESSAGES = {
6817
7085
  [VALIDATION_ERRORS.INVALID_UUID]: "Invalid UUID format",
6818
7086
  [VALIDATION_ERRORS.INVALID_IP_ADDRESS]: "Invalid IP address format",
6819
7087
  [VALIDATION_ERRORS.INVALID_USER_AGENT]: "Invalid or missing user agent",
7088
+ [VALIDATION_ERRORS.BAD_REQUEST]: "Bad request",
7089
+ [VALIDATION_ERRORS.INVALID_START_DATE]: "Invalid request data",
7090
+ [VALIDATION_ERRORS.INVALID_END_DATE]: "Invalid request data",
7091
+ [VALIDATION_ERRORS.INVALID_DATE_RANGE]: "Invalid request data",
6820
7092
  // Detection
6821
7093
  [DETECTION_ERRORS.DETECTION_FAILED]: "Agent detection failed",
6822
7094
  [DETECTION_ERRORS.INSUFFICIENT_DATA]: "Insufficient data for detection",
@@ -6839,6 +7111,7 @@ var ERROR_MESSAGES = {
6839
7111
  [PERMISSION_ERRORS.OPERATION_NOT_ALLOWED]: "Operation not allowed",
6840
7112
  [PERMISSION_ERRORS.PROJECT_ACCESS_DENIED]: "Project access denied",
6841
7113
  [PERMISSION_ERRORS.PIXEL_ACCESS_DENIED]: "Pixel access denied",
7114
+ [PERMISSION_ERRORS.FORBIDDEN]: "Access denied",
6842
7115
  // Network
6843
7116
  [NETWORK_ERRORS.CONNECTION_FAILED]: "Connection failed",
6844
7117
  [NETWORK_ERRORS.TIMEOUT]: "Request timeout",
@@ -6854,6 +7127,7 @@ var ERROR_MESSAGES = {
6854
7127
  [INTERNAL_ERRORS.INITIALIZATION_ERROR]: "Initialization error",
6855
7128
  [INTERNAL_ERRORS.PROCESSING_ERROR]: "Processing error",
6856
7129
  [INTERNAL_ERRORS.UNKNOWN_ERROR]: "An unknown error occurred",
7130
+ [INTERNAL_ERRORS.SERVICE_UNAVAILABLE_TRANSIENT]: "A dependency is temporarily unavailable. Retry shortly.",
6857
7131
  // Session
6858
7132
  [SESSION_ERRORS.SESSION_NOT_FOUND]: "Session not found",
6859
7133
  [SESSION_ERRORS.SESSION_EXPIRED]: "Session has expired",
@@ -6870,20 +7144,49 @@ var ERROR_MESSAGES = {
6870
7144
  [PIXEL_ERRORS.PIXEL_PATH_SKIPPED]: "Path is configured to be skipped",
6871
7145
  [PIXEL_ERRORS.PIXEL_EVENT_INVALID]: "Invalid pixel event",
6872
7146
  [PIXEL_ERRORS.PIXEL_BATCH_TOO_LARGE]: "Event batch exceeds maximum size",
7147
+ [PIXEL_ERRORS.MISSING_PIXEL_ID]: "Project ID is required",
7148
+ [PIXEL_ERRORS.INVALID_EDGE_SIGNATURE]: "Invalid request signature",
7149
+ [PIXEL_ERRORS.DETECTION_STORAGE_FAILED]: "Failed to store detection data",
6873
7150
  // API
6874
7151
  [API_ERRORS.ENDPOINT_NOT_FOUND]: "API endpoint not found",
6875
7152
  [API_ERRORS.METHOD_NOT_ALLOWED]: "HTTP method not allowed",
6876
7153
  [API_ERRORS.VERSION_NOT_SUPPORTED]: "API version not supported",
6877
7154
  [API_ERRORS.CONTENT_TYPE_NOT_SUPPORTED]: "Content type not supported",
6878
7155
  [API_ERRORS.RESPONSE_TOO_LARGE]: "Response exceeds maximum size",
6879
- [API_ERRORS.REQUEST_TOO_LARGE]: "Request exceeds maximum size"
7156
+ [API_ERRORS.REQUEST_TOO_LARGE]: "Request exceeds maximum size",
7157
+ // Billing
7158
+ [BILLING_ERRORS.LIMIT_EXCEEDED]: "Billing limit exceeded",
7159
+ [BILLING_ERRORS.BILLING_SUSPENDED]: "Account billing suspended",
7160
+ [BILLING_ERRORS.BILLING_GRACE_PERIOD]: "Account in billing grace period",
7161
+ // Resources
7162
+ [RESOURCE_ERRORS.CONFLICT]: "Resource conflict",
7163
+ [RESOURCE_ERRORS.PROJECT_NOT_FOUND]: "Project not found",
7164
+ [RESOURCE_ERRORS.REVIEW_REQUIRED]: "Deploy requires explicit confirmation of the consequential writes it will perform.",
7165
+ // Policy
7166
+ [POLICY_ERRORS.POLICY_FETCH_FAILED]: "Failed to fetch policy",
7167
+ // Bare (un-prefixed, shared across pixel/openclaw/deploy/shopify/bouncer)
7168
+ [BARE_ERRORS.BARE_VALIDATION_ERROR]: "Invalid request data",
7169
+ [BARE_ERRORS.BARE_INTERNAL_ERROR]: "Internal server error",
7170
+ // Lowercase (kya-os events wire format)
7171
+ [LOWERCASE_ERRORS.LOWERCASE_INVALID_JSON]: "Request body must be valid JSON",
7172
+ [LOWERCASE_ERRORS.LOWERCASE_VALIDATION_ERROR]: "Invalid request body"
6880
7173
  };
6881
7174
  var ERROR_STATUS_CODES = {
7175
+ // 200 OK (billing grace period is a soft warning, not a failure)
7176
+ [BILLING_ERRORS.BILLING_GRACE_PERIOD]: 200,
6882
7177
  // 400 Bad Request
6883
7178
  [VALIDATION_ERRORS.INVALID_REQUEST]: 400,
6884
7179
  [VALIDATION_ERRORS.MISSING_REQUIRED_FIELD]: 400,
6885
7180
  [VALIDATION_ERRORS.INVALID_FIELD_TYPE]: 400,
6886
7181
  [VALIDATION_ERRORS.INVALID_FIELD_VALUE]: 400,
7182
+ [VALIDATION_ERRORS.BAD_REQUEST]: 400,
7183
+ [VALIDATION_ERRORS.INVALID_START_DATE]: 400,
7184
+ [VALIDATION_ERRORS.INVALID_END_DATE]: 400,
7185
+ [VALIDATION_ERRORS.INVALID_DATE_RANGE]: 400,
7186
+ [PIXEL_ERRORS.MISSING_PIXEL_ID]: 400,
7187
+ [BARE_ERRORS.BARE_VALIDATION_ERROR]: 400,
7188
+ [LOWERCASE_ERRORS.LOWERCASE_INVALID_JSON]: 400,
7189
+ [LOWERCASE_ERRORS.LOWERCASE_VALIDATION_ERROR]: 400,
6887
7190
  // 401 Unauthorized
6888
7191
  [AUTH_ERRORS.INVALID_API_KEY]: 401,
6889
7192
  [AUTH_ERRORS.EXPIRED_API_KEY]: 401,
@@ -6891,10 +7194,15 @@ var ERROR_STATUS_CODES = {
6891
7194
  [AUTH_ERRORS.EXPIRED_TOKEN]: 401,
6892
7195
  [AUTH_ERRORS.MISSING_CREDENTIALS]: 401,
6893
7196
  [AUTH_ERRORS.UNAUTHORIZED]: 401,
7197
+ // 402 Payment Required
7198
+ [BILLING_ERRORS.LIMIT_EXCEEDED]: 402,
7199
+ [BILLING_ERRORS.BILLING_SUSPENDED]: 402,
6894
7200
  // 403 Forbidden
6895
7201
  [PERMISSION_ERRORS.INSUFFICIENT_PERMISSIONS]: 403,
6896
7202
  [PERMISSION_ERRORS.RESOURCE_ACCESS_DENIED]: 403,
6897
7203
  [PERMISSION_ERRORS.OPERATION_NOT_ALLOWED]: 403,
7204
+ [PERMISSION_ERRORS.FORBIDDEN]: 403,
7205
+ [PIXEL_ERRORS.INVALID_EDGE_SIGNATURE]: 403,
6898
7206
  // 404 Not Found
6899
7207
  [PERMISSION_ERRORS.RESOURCE_NOT_FOUND]: 404,
6900
7208
  [API_ERRORS.ENDPOINT_NOT_FOUND]: 404,
@@ -6902,11 +7210,20 @@ var ERROR_STATUS_CODES = {
6902
7210
  [SESSION_ERRORS.SESSION_NOT_FOUND]: 404,
6903
7211
  // 405 Method Not Allowed
6904
7212
  [API_ERRORS.METHOD_NOT_ALLOWED]: 405,
7213
+ // 409 Conflict
7214
+ [RESOURCE_ERRORS.CONFLICT]: 409,
7215
+ // NOTE: RESOURCE_ERRORS.PROJECT_NOT_FOUND deliberately has no entry here.
7216
+ // The pixel API emits it with 400, while enforce and the policy
7217
+ // middleware emit it with 404. There is no single correct status, so it
7218
+ // stays unpinned and callers set their own status per surface. Locked by
7219
+ // a test in __tests__/errors.test.ts.
6905
7220
  // 413 Payload Too Large
6906
7221
  [API_ERRORS.REQUEST_TOO_LARGE]: 413,
6907
7222
  [PIXEL_ERRORS.PIXEL_BATCH_TOO_LARGE]: 413,
6908
7223
  // 415 Unsupported Media Type
6909
7224
  [API_ERRORS.CONTENT_TYPE_NOT_SUPPORTED]: 415,
7225
+ // 422 Unprocessable Entity
7226
+ [RESOURCE_ERRORS.REVIEW_REQUIRED]: 422,
6910
7227
  // 429 Too Many Requests
6911
7228
  [RATE_LIMIT_ERRORS.RATE_LIMIT_EXCEEDED]: 429,
6912
7229
  [RATE_LIMIT_ERRORS.BURST_LIMIT_EXCEEDED]: 429,
@@ -6915,10 +7232,14 @@ var ERROR_STATUS_CODES = {
6915
7232
  [INTERNAL_ERRORS.INTERNAL_SERVER_ERROR]: 500,
6916
7233
  [INTERNAL_ERRORS.DATABASE_ERROR]: 500,
6917
7234
  [INTERNAL_ERRORS.PROCESSING_ERROR]: 500,
7235
+ [PIXEL_ERRORS.DETECTION_STORAGE_FAILED]: 500,
7236
+ [POLICY_ERRORS.POLICY_FETCH_FAILED]: 500,
7237
+ [BARE_ERRORS.BARE_INTERNAL_ERROR]: 500,
6918
7238
  // 502 Bad Gateway
6919
7239
  [NETWORK_ERRORS.UPSTREAM_ERROR]: 502,
6920
7240
  // 503 Service Unavailable
6921
7241
  [INTERNAL_ERRORS.INITIALIZATION_ERROR]: 503,
7242
+ [INTERNAL_ERRORS.SERVICE_UNAVAILABLE_TRANSIENT]: 503,
6922
7243
  // 504 Gateway Timeout
6923
7244
  [NETWORK_ERRORS.TIMEOUT]: 504
6924
7245
  };
@@ -7493,7 +7814,7 @@ var DetectionRequestSchema = external_exports.object({
7493
7814
  userAgent: external_exports.string(),
7494
7815
  // Optional fields
7495
7816
  ipAddress: external_exports.string().optional(),
7496
- headers: external_exports.record(external_exports.string()).optional(),
7817
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
7497
7818
  url: external_exports.string().optional(),
7498
7819
  method: external_exports.string().optional(),
7499
7820
  // Behavioral data
@@ -7589,6 +7910,7 @@ var HealthResponseSchema = external_exports.object({
7589
7910
  version: external_exports.string(),
7590
7911
  uptime: external_exports.number().min(0),
7591
7912
  checks: external_exports.record(
7913
+ external_exports.string(),
7592
7914
  external_exports.object({
7593
7915
  status: external_exports.enum(["pass", "fail"]),
7594
7916
  message: external_exports.string().optional()
@@ -7669,13 +7991,13 @@ var PixelEventSchema = external_exports.object({
7669
7991
  // Request Information
7670
7992
  userAgent: external_exports.string(),
7671
7993
  ipAddress: external_exports.string().optional(),
7672
- headers: external_exports.record(external_exports.string()).optional(),
7994
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
7673
7995
  // Detection Results
7674
7996
  detection: DetectionResultSchema.optional(),
7675
7997
  // Behavioral Data
7676
7998
  behavioral: BehavioralSignalsSchema.optional(),
7677
7999
  // Custom Data
7678
- metadata: external_exports.record(external_exports.unknown()).optional(),
8000
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
7679
8001
  customEventName: external_exports.string().optional()
7680
8002
  });
7681
8003
  var BatchPixelEventRequestSchema = external_exports.object({
@@ -7744,6 +8066,40 @@ var ClientDetectionSchema = external_exports.object({
7744
8066
  scrollEvents: external_exports.number().optional(),
7745
8067
  clickEvents: external_exports.number().optional(),
7746
8068
  touchEvents: external_exports.number().optional(),
8069
+ // Input events dispatched with isTrusted:false (synthetic script/extension
8070
+ // input, never real hardware). Provenance signal for content-script agent
8071
+ // drivers — see human-promotion-audit.untrustedInputShare.
8072
+ untrustedEvents: external_exports.number().optional(),
8073
+ // Timing physics, counters only (checkpoint-detector.js). Bucket edges sit
8074
+ // below the floor a hand showed on the lab gauntlet; the server derives
8075
+ // shares and means (lib/detection/timing-physics.ts). No timestamps,
8076
+ // coordinates, or key identity ever ride here. `timingVersion` names the
8077
+ // detector's guard set (IME, modifier, multi-touch skips) so rows from
8078
+ // different sets can be told apart at calibration.
8079
+ timingVersion: external_exports.number().optional(),
8080
+ keyDwellCount: external_exports.number().optional(),
8081
+ keyDwellUnder5: external_exports.number().optional(),
8082
+ keyDwellSumMs: external_exports.number().optional(),
8083
+ keyGapCount: external_exports.number().optional(),
8084
+ keyGapUnder5: external_exports.number().optional(),
8085
+ pressCount: external_exports.number().optional(),
8086
+ pressAdjacencyCount: external_exports.number().int().nonnegative().optional(),
8087
+ pressAdjacentUnder5: external_exports.number().int().nonnegative().optional(),
8088
+ pressUnder10: external_exports.number().optional(),
8089
+ pressSumMs: external_exports.number().optional(),
8090
+ mouseClicks: external_exports.number().optional(),
8091
+ zeroTrailClicks: external_exports.number().optional(),
8092
+ // Path kinematics, counters only (checkpoint-detector.js), for the driver
8093
+ // that manufactures a hand's timing: coalesced samples per pointermove,
8094
+ // and whether consecutive steps repeat their length or their heading.
8095
+ // Mouse pointer only; no coordinate rides here. `kinematicsVersion` names
8096
+ // the rule set (tolerances, pointer filter) the way `timingVersion` does.
8097
+ kinematicsVersion: external_exports.number().optional(),
8098
+ pointerMoves: external_exports.number().optional(),
8099
+ coalescedMoves: external_exports.number().optional(),
8100
+ stepPairs: external_exports.number().optional(),
8101
+ equalSteps: external_exports.number().optional(),
8102
+ straightSteps: external_exports.number().optional(),
7747
8103
  hasInteraction: external_exports.boolean().optional(),
7748
8104
  // Connection info
7749
8105
  connection: external_exports.object({
@@ -7780,7 +8136,7 @@ var PixelTrackingRequestSchema = external_exports.object({
7780
8136
  // profile onto the newly-identified one (properties are never merged across
7781
8137
  // profiles automatically). Mirrors the analytics-SDK `identify(previousId)` arg.
7782
8138
  previousId: external_exports.string().optional(),
7783
- userTraits: external_exports.record(external_exports.unknown()).optional().refine((traits) => !traits || JSON.stringify(traits).length < 1e4, {
8139
+ userTraits: external_exports.record(external_exports.string(), external_exports.unknown()).optional().refine((traits) => !traits || JSON.stringify(traits).length < 1e4, {
7784
8140
  message: "User traits too large (max 10KB)"
7785
8141
  }).refine((traits) => !traits || Object.keys(traits).length < 50, {
7786
8142
  message: "Too many user trait properties (max 50)"
@@ -7810,7 +8166,7 @@ var PixelTrackingRequestSchema = external_exports.object({
7810
8166
  // Detection data
7811
8167
  userAgent: external_exports.string(),
7812
8168
  // Browser user agent
7813
- headers: external_exports.record(external_exports.string()).optional(),
8169
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
7814
8170
  // Any additional headers
7815
8171
  // Client info
7816
8172
  screenResolution: external_exports.string().optional(),
@@ -7951,7 +8307,7 @@ var PixelVerificationStatusSchema = external_exports.object({
7951
8307
  });
7952
8308
  var PixelUserIdentificationSchema = external_exports.object({
7953
8309
  userId: external_exports.string(),
7954
- traits: external_exports.record(external_exports.unknown()).optional().refine((traits) => !traits || JSON.stringify(traits).length < 1e4, {
8310
+ traits: external_exports.record(external_exports.string(), external_exports.unknown()).optional().refine((traits) => !traits || JSON.stringify(traits).length < 1e4, {
7955
8311
  message: "User traits too large (max 10KB)"
7956
8312
  }).refine((traits) => !traits || Object.keys(traits).length < 50, {
7957
8313
  message: "Too many user trait properties (max 50)"
@@ -7983,7 +8339,7 @@ var EventTrackingRequestSchema = external_exports.object({
7983
8339
  referrer: external_exports.string().url().optional(),
7984
8340
  method: external_exports.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional(),
7985
8341
  // Headers for additional context
7986
- headers: external_exports.record(external_exports.string()).optional(),
8342
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
7987
8343
  // Behavioral tracking data
7988
8344
  behavioralData: BehavioralDataSchema.optional(),
7989
8345
  // Client-side browser fingerprint (headless/automation tells, interaction).
@@ -7999,7 +8355,7 @@ var EventTrackingRequestSchema = external_exports.object({
7999
8355
  screenResolution: external_exports.string().optional(),
8000
8356
  viewport: external_exports.string().optional(),
8001
8357
  // Custom metadata
8002
- metadata: external_exports.record(external_exports.unknown()).optional()
8358
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
8003
8359
  });
8004
8360
  var EventTrackingResponseSchema = external_exports.object({
8005
8361
  success: external_exports.boolean(),
@@ -8085,7 +8441,7 @@ var EventStorageRecordSchema = external_exports.object({
8085
8441
  scrollDepth: external_exports.number().optional(),
8086
8442
  clickCount: external_exports.number().optional(),
8087
8443
  // Metadata
8088
- metadata: external_exports.record(external_exports.unknown()).optional(),
8444
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
8089
8445
  // Timestamps
8090
8446
  createdAt: external_exports.date(),
8091
8447
  processedAt: external_exports.date()
@@ -8124,7 +8480,7 @@ var SignatureVerificationRequestSchema = external_exports.object({
8124
8480
  // Algorithm hint
8125
8481
  algorithm: SignatureAlgorithmSchema.optional(),
8126
8482
  // Additional headers for context
8127
- headers: external_exports.record(external_exports.string()).optional()
8483
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional()
8128
8484
  });
8129
8485
  var SignatureVerificationResponseSchema = external_exports.object({
8130
8486
  success: external_exports.boolean(),
@@ -8522,7 +8878,7 @@ var PixelConfigurationSchema = external_exports.object({
8522
8878
  flushInterval: external_exports.number().min(100).max(6e4).default(5e3),
8523
8879
  enableBehavioralTracking: external_exports.boolean().default(true),
8524
8880
  enableSessionReplay: external_exports.boolean().default(false),
8525
- customHeaders: external_exports.record(external_exports.string()).default({})
8881
+ customHeaders: external_exports.record(external_exports.string(), external_exports.string()).default({})
8526
8882
  });
8527
8883
  var PixelSchema = external_exports.object({
8528
8884
  id: external_exports.string().uuid(),
@@ -8573,7 +8929,7 @@ var DetectionLogSchema = external_exports.object({
8573
8929
  agentType: external_exports.string().optional(),
8574
8930
  userAgent: external_exports.string().optional(),
8575
8931
  ipAddress: external_exports.string().ip().optional(),
8576
- metadata: external_exports.record(external_exports.unknown()).optional(),
8932
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
8577
8933
  sessionId: external_exports.string().optional(),
8578
8934
  createdAt: external_exports.date()
8579
8935
  });
@@ -8966,7 +9322,7 @@ var BouncerConfigSchema = external_exports.object({
8966
9322
  // Consent page configuration
8967
9323
  consentConfig: ConsentConfigSchema.optional(),
8968
9324
  // Tool discovery
8969
- discoveredTools: external_exports.record(external_exports.unknown()).default({}),
9325
+ discoveredTools: external_exports.record(external_exports.string(), external_exports.unknown()).default({}),
8970
9326
  mcpServerUrl: httpUrlSchema().nullable().optional(),
8971
9327
  mcpWorkerUrl: httpUrlSchema().nullable().optional(),
8972
9328
  // Organization settings
@@ -9027,14 +9383,14 @@ var DelegationSchema = external_exports.object({
9027
9383
  userIdentifier: external_exports.string().max(500).nullable().optional(),
9028
9384
  // Human-readable (email)
9029
9385
  scopes: external_exports.array(external_exports.string()),
9030
- constraints: external_exports.record(external_exports.unknown()).nullable().optional(),
9386
+ constraints: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
9031
9387
  status: DelegationStatusSchema.default("active"),
9032
9388
  issuedAt: external_exports.string().datetime(),
9033
9389
  expiresAt: external_exports.string().datetime().nullable().optional(),
9034
9390
  revokedAt: external_exports.string().datetime().nullable().optional(),
9035
9391
  revocationReason: external_exports.string().max(500).nullable().optional(),
9036
9392
  credentialJwt: external_exports.string().nullable().optional(),
9037
- metadata: external_exports.record(external_exports.unknown()).default({}),
9393
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).default({}),
9038
9394
  createdAt: external_exports.string().datetime(),
9039
9395
  updatedAt: external_exports.string().datetime()
9040
9396
  });
@@ -9047,15 +9403,15 @@ var BouncerProofSchema = external_exports.object({
9047
9403
  agentDid: external_exports.string().max(500),
9048
9404
  userIdentifier: external_exports.string().max(500).nullable().optional(),
9049
9405
  toolName: external_exports.string().max(255),
9050
- toolArgs: external_exports.record(external_exports.unknown()).nullable().optional(),
9051
- toolResult: external_exports.record(external_exports.unknown()).nullable().optional(),
9406
+ toolArgs: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
9407
+ toolResult: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
9052
9408
  scopes: external_exports.array(external_exports.string()).nullable().optional(),
9053
9409
  signature: external_exports.string(),
9054
9410
  publicKey: external_exports.string(),
9055
9411
  timestamp: external_exports.number().int(),
9056
9412
  // Unix timestamp
9057
9413
  nonce: external_exports.string().max(100),
9058
- crispDelta: external_exports.record(external_exports.unknown()).nullable().optional(),
9414
+ crispDelta: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional(),
9059
9415
  outcome: BouncerOutcomeSchema.default("success"),
9060
9416
  errorMessage: external_exports.string().nullable().optional(),
9061
9417
  createdAt: external_exports.string().datetime()
@@ -9199,7 +9555,7 @@ external_exports.object({
9199
9555
  function toProviderRegistryFormat(provider) {
9200
9556
  const { type, authorizationUrl, tokenUrl, userInfoUrl, ...rest } = provider;
9201
9557
  const authType = type;
9202
- const result = {
9558
+ const result2 = {
9203
9559
  id: rest.id,
9204
9560
  authType,
9205
9561
  displayName: rest.displayName,
@@ -9207,7 +9563,7 @@ function toProviderRegistryFormat(provider) {
9207
9563
  metadata: rest.metadata
9208
9564
  };
9209
9565
  if (authType === "oauth2" && (authorizationUrl || tokenUrl)) {
9210
- result.oauthConfig = {
9566
+ result2.oauthConfig = {
9211
9567
  authorizationEndpoint: authorizationUrl || "",
9212
9568
  tokenEndpoint: tokenUrl || "",
9213
9569
  userInfoEndpoint: userInfoUrl,
@@ -9216,7 +9572,7 @@ function toProviderRegistryFormat(provider) {
9216
9572
  defaultScopes: rest.defaultScopes || rest.scopes
9217
9573
  };
9218
9574
  }
9219
- return result;
9575
+ return result2;
9220
9576
  }
9221
9577
  function isSupportedAuthType(authType) {
9222
9578
  return authType === "oauth2" || authType === "password";
@@ -9353,7 +9709,7 @@ function validateOrganizationName(name) {
9353
9709
  return { valid: true };
9354
9710
  } catch (error) {
9355
9711
  if (error instanceof external_exports.ZodError) {
9356
- return { valid: false, error: error.errors[0]?.message || "Invalid organization name" };
9712
+ return { valid: false, error: error.issues[0]?.message || "Invalid organization name" };
9357
9713
  }
9358
9714
  return { valid: false, error: "Invalid organization name" };
9359
9715
  }
@@ -9501,7 +9857,8 @@ var MarketplaceSourceSchema = external_exports.enum([
9501
9857
  "shopify",
9502
9858
  "netlify",
9503
9859
  "railway",
9504
- "shopware"
9860
+ "shopware",
9861
+ "mixer"
9505
9862
  ]);
9506
9863
  var ProvisioningModeSchema = external_exports.enum(["observe", "enforce"]);
9507
9864
  var ProvisionKeyRequestSchema = external_exports.object({
@@ -9547,7 +9904,7 @@ var ProvisionKeyRequestSchema = external_exports.object({
9547
9904
  */
9548
9905
  organizationId: external_exports.string().uuid().optional(),
9549
9906
  /** Optional non-secret provider context (teamId, userId, resource name). */
9550
- metadata: external_exports.record(external_exports.unknown()).optional()
9907
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
9551
9908
  });
9552
9909
  var ProvisionKeyResponseSchema = external_exports.object({
9553
9910
  /**
@@ -9842,6 +10199,26 @@ var PublicApiHeadersSchema = external_exports.object({
9842
10199
  "x-request-id": external_exports.string().optional()
9843
10200
  });
9844
10201
 
10202
+ // src/api/signal-exposure.ts
10203
+ var REASON_CODE_VALUES = Object.values(DETECTION_REASON_CODES);
10204
+ var DetectionReasonCodeSchema = external_exports.enum(REASON_CODE_VALUES).describe(
10205
+ "A machine-readable detection/* reason code from the DETECTION_REASON_CODES registry (see docs/architecture/detection-reason-codes.generated.md)."
10206
+ );
10207
+ var DetectionSignalExposureSchema = external_exports.object({
10208
+ signals: external_exports.array(DetectionSignalSchema).describe(
10209
+ "The engine's full per-signal evidence breakdown, verbatim (not the condensed single-entry summary). Empty when the engine did not run (skipDetection) or faulted. THE extension point: future signal families arrive as new entries/sources here, additively."
10210
+ ),
10211
+ reasonCodes: external_exports.array(DetectionReasonCodeSchema).min(1).describe(
10212
+ "Ordered detection/* reason codes, most-significant-evidence first, derived by the same mapDetectionToReasonCodes projection that feeds the gateway KYA-Reason-Codes header. Never empty: an assumed verdict carries a zero-evidence fallback code."
10213
+ ),
10214
+ confidenceLevel: ConfidenceLevelSchema.optional().describe(
10215
+ "The engine's banded confidence level (low | medium | high | very_high). Omitted when the engine did not produce one (engine fault, skipDetection, or a demoted forged-credential verdict)."
10216
+ ),
10217
+ isAiCrawler: external_exports.boolean().optional().describe(
10218
+ "True when the engine classified the client as an AI training crawler (GPTBot, ClaudeBot, \u2026) rather than an interactive agent. Omitted when the engine did not run."
10219
+ )
10220
+ });
10221
+
9845
10222
  // src/api/fingerprint.ts
9846
10223
  var ClientDetectionSchema2 = external_exports.object({
9847
10224
  // Core detection
@@ -9921,15 +10298,15 @@ var FingerprintAnalysisSchema = external_exports.object({
9921
10298
  });
9922
10299
  var FingerprintDetectRequestSchema = external_exports.object({
9923
10300
  clientDetection: ClientDetectionSchema2,
9924
- metadata: external_exports.record(external_exports.unknown()).optional()
10301
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
9925
10302
  });
9926
10303
  var FingerprintResponseSchema = external_exports.object({
9927
10304
  timestamp: external_exports.string(),
9928
10305
  method: external_exports.string(),
9929
10306
  url: external_exports.string(),
9930
10307
  path: external_exports.string(),
9931
- queryParams: external_exports.record(external_exports.string()),
9932
- headers: external_exports.record(external_exports.string()),
10308
+ queryParams: external_exports.record(external_exports.string(), external_exports.string()),
10309
+ headers: external_exports.record(external_exports.string(), external_exports.string()),
9933
10310
  headerCount: external_exports.number(),
9934
10311
  ip: external_exports.string(),
9935
10312
  httpVersion: external_exports.string(),
@@ -9969,7 +10346,7 @@ var EnhancedFingerprintResponseSchema = external_exports.object({
9969
10346
  http: external_exports.object({
9970
10347
  method: external_exports.string(),
9971
10348
  url: external_exports.string(),
9972
- headers: external_exports.record(external_exports.string()),
10349
+ headers: external_exports.record(external_exports.string(), external_exports.string()),
9973
10350
  headerCount: external_exports.number(),
9974
10351
  ip: external_exports.string(),
9975
10352
  userAgent: external_exports.string()
@@ -10009,7 +10386,7 @@ var FingerprintRecordSchema = external_exports.object({
10009
10386
  ip: external_exports.string(),
10010
10387
  // Headers
10011
10388
  userAgent: external_exports.string().nullable(),
10012
- headers: external_exports.record(external_exports.string()),
10389
+ headers: external_exports.record(external_exports.string(), external_exports.string()),
10013
10390
  // Detection results
10014
10391
  isBot: external_exports.boolean(),
10015
10392
  botType: external_exports.string().nullable(),
@@ -10022,7 +10399,7 @@ var FingerprintRecordSchema = external_exports.object({
10022
10399
  // Metadata
10023
10400
  sessionId: external_exports.string().nullable(),
10024
10401
  projectId: external_exports.string().nullable(),
10025
- metadata: external_exports.record(external_exports.unknown()).nullable()
10402
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).nullable()
10026
10403
  });
10027
10404
  var BotPatternSchema2 = external_exports.object({
10028
10405
  name: external_exports.string(),
@@ -10583,7 +10960,7 @@ var DeploymentMetadataSchema = external_exports.object({
10583
10960
  privateKey: external_exports.string()
10584
10961
  }).optional(),
10585
10962
  /** Validated source-specific secrets forwarded to GitHub/Cloudflare. */
10586
- additionalSecrets: external_exports.record(external_exports.string()).optional(),
10963
+ additionalSecrets: external_exports.record(external_exports.string(), external_exports.string()).optional(),
10587
10964
  /** Semantic source type used for descriptions and registry metadata. */
10588
10965
  agentType: external_exports.string().optional(),
10589
10966
  createdAt: external_exports.number(),
@@ -10727,8 +11104,8 @@ function isValidWasmRequestMetadata(value) {
10727
11104
  return WasmRequestMetadataSchema.safeParse(value).success;
10728
11105
  }
10729
11106
  function parseAgentName(value) {
10730
- const result = AgentTypeSchema.safeParse(value);
10731
- return result.success ? result.data : "unknown";
11107
+ const result2 = AgentTypeSchema.safeParse(value);
11108
+ return result2.success ? result2.data : "unknown";
10732
11109
  }
10733
11110
  function normalizeAgentName(value) {
10734
11111
  const normalized = value.toLowerCase().trim();
@@ -10806,13 +11183,13 @@ var SessionDataSchema = external_exports.object({
10806
11183
  // Request Context
10807
11184
  userAgent: external_exports.string().optional(),
10808
11185
  ipAddress: external_exports.string().optional(),
10809
- headers: external_exports.record(external_exports.string()).optional(),
11186
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
10810
11187
  // Behavioral Data
10811
11188
  behavioral: BehavioralSignalsSchema.optional(),
10812
11189
  pageViews: external_exports.number().int().min(0).default(0),
10813
11190
  interactions: external_exports.number().int().min(0).default(0),
10814
11191
  // Custom Metadata
10815
- metadata: external_exports.record(external_exports.unknown()).optional()
11192
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10816
11193
  });
10817
11194
  var SessionCreateRequestSchema = external_exports.object({
10818
11195
  userId: external_exports.string().optional(),
@@ -10820,10 +11197,10 @@ var SessionCreateRequestSchema = external_exports.object({
10820
11197
  projectId: external_exports.string().optional(),
10821
11198
  userAgent: external_exports.string().optional(),
10822
11199
  ipAddress: external_exports.string().optional(),
10823
- headers: external_exports.record(external_exports.string()).optional(),
11200
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
10824
11201
  ttl: external_exports.number().min(60).default(3600),
10825
11202
  // Time to live in seconds
10826
- metadata: external_exports.record(external_exports.unknown()).optional()
11203
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10827
11204
  });
10828
11205
  var SessionUpdateRequestSchema = external_exports.object({
10829
11206
  sessionId: external_exports.string(),
@@ -10831,7 +11208,7 @@ var SessionUpdateRequestSchema = external_exports.object({
10831
11208
  state: SessionStateSchema.optional(),
10832
11209
  detectionResult: DetectionResultSchema.optional(),
10833
11210
  behavioral: BehavioralSignalsSchema.optional(),
10834
- metadata: external_exports.record(external_exports.unknown()).optional(),
11211
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
10835
11212
  lastActivityAt: external_exports.date().optional()
10836
11213
  }),
10837
11214
  extendTtl: external_exports.boolean().default(true)
@@ -10850,7 +11227,7 @@ var SessionQueryOptionsSchema = external_exports.object({
10850
11227
  var SessionConfigSchema = external_exports.object({
10851
11228
  // Storage
10852
11229
  storage: SessionStorageTypeSchema.default("memory"),
10853
- storageOptions: external_exports.record(external_exports.unknown()).optional(),
11230
+ storageOptions: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
10854
11231
  // Timing
10855
11232
  ttl: external_exports.number().min(60).default(3600),
10856
11233
  // Default 1 hour
@@ -10897,7 +11274,7 @@ var SessionEventSchema = external_exports.object({
10897
11274
  type: SessionEventTypeSchema,
10898
11275
  sessionId: external_exports.string(),
10899
11276
  timestamp: external_exports.date(),
10900
- data: external_exports.record(external_exports.unknown()).optional()
11277
+ data: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10901
11278
  });
10902
11279
  var SessionTokenPayloadSchema = external_exports.object({
10903
11280
  sessionId: external_exports.string(),
@@ -10907,7 +11284,7 @@ var SessionTokenPayloadSchema = external_exports.object({
10907
11284
  // Issued at
10908
11285
  exp: external_exports.number(),
10909
11286
  // Expires at
10910
- metadata: external_exports.record(external_exports.unknown()).optional()
11287
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
10911
11288
  });
10912
11289
 
10913
11290
  // src/types/transport.ts
@@ -11101,7 +11478,7 @@ var WorkerErrorSchema = external_exports.object({
11101
11478
  code: external_exports.string().optional(),
11102
11479
  stack: external_exports.string().optional(),
11103
11480
  timestamp: external_exports.number(),
11104
- context: external_exports.record(external_exports.any()).optional(),
11481
+ context: external_exports.record(external_exports.string(), external_exports.any()).optional(),
11105
11482
  recoverable: external_exports.boolean().default(true),
11106
11483
  retryAfter: external_exports.number().optional()
11107
11484
  });
@@ -11181,7 +11558,7 @@ var ProtocolVersionSchema = external_exports.literal("1.0.0");
11181
11558
  // src/types/database.ts
11182
11559
  var BulkOperationParamsSchema = external_exports.object({
11183
11560
  operation: external_exports.enum(["create", "update", "delete", "upsert"]),
11184
- data: external_exports.array(external_exports.record(external_exports.unknown())),
11561
+ data: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())),
11185
11562
  options: external_exports.object({
11186
11563
  skipValidation: external_exports.boolean().optional(),
11187
11564
  returnResults: external_exports.boolean().optional(),
@@ -11197,7 +11574,7 @@ var BulkOperationResultSchema = external_exports.object({
11197
11574
  external_exports.object({
11198
11575
  index: external_exports.number(),
11199
11576
  error: external_exports.string(),
11200
- data: external_exports.record(external_exports.unknown()).optional()
11577
+ data: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11201
11578
  })
11202
11579
  ).default([])
11203
11580
  });
@@ -11283,7 +11660,7 @@ var DetectionMetadataSchema = external_exports.object({
11283
11660
  touchEvents: external_exports.number().optional()
11284
11661
  }).optional(),
11285
11662
  // Custom fields
11286
- custom: external_exports.record(external_exports.unknown()).optional()
11663
+ custom: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11287
11664
  });
11288
11665
  var AnalyticsExportParamsSchema = external_exports.object({
11289
11666
  format: external_exports.enum(["csv", "json", "xlsx"]).default("json"),
@@ -11334,7 +11711,7 @@ var AnalyticsDataPointSchema = external_exports.object({
11334
11711
  timestamp: external_exports.date(),
11335
11712
  value: external_exports.number(),
11336
11713
  label: external_exports.string().optional(),
11337
- metadata: external_exports.record(external_exports.unknown()).optional()
11714
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11338
11715
  });
11339
11716
  var AnalyticsSummarySchema = external_exports.object({
11340
11717
  total: external_exports.number(),
@@ -11398,7 +11775,7 @@ var DatabaseDetectionMetadataSchema = external_exports.object({
11398
11775
  // Request context
11399
11776
  userAgent: external_exports.string().optional(),
11400
11777
  ipAddress: external_exports.string().optional(),
11401
- headers: external_exports.record(external_exports.string()).optional(),
11778
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
11402
11779
  // Browser fingerprint data
11403
11780
  clientDetection: external_exports.object({
11404
11781
  headless: external_exports.boolean().optional(),
@@ -11513,7 +11890,7 @@ var CollectedDataSchema = external_exports.object({
11513
11890
  timestamp: external_exports.date()
11514
11891
  }),
11515
11892
  // HEADERS (noscript, middleware, express, edge)
11516
- headers: external_exports.record(external_exports.string()).optional(),
11893
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
11517
11894
  // CLIENT-SIDE (pixel, beacon only)
11518
11895
  clientSide: external_exports.object({
11519
11896
  canvas: external_exports.object({
@@ -11586,7 +11963,7 @@ var CollectedDataSchema = external_exports.object({
11586
11963
  httpVersion: external_exports.string(),
11587
11964
  protocol: external_exports.string(),
11588
11965
  requestSize: external_exports.number().optional(),
11589
- cookies: external_exports.record(external_exports.string()).optional(),
11966
+ cookies: external_exports.record(external_exports.string(), external_exports.string()).optional(),
11590
11967
  sessionData: external_exports.any().optional(),
11591
11968
  geoLocation: external_exports.object({
11592
11969
  country: external_exports.string(),
@@ -11794,7 +12171,7 @@ external_exports.object({
11794
12171
  integrationType: IntegrationTypeSchema,
11795
12172
  userAgent: external_exports.string(),
11796
12173
  ipAddress: external_exports.string(),
11797
- headers: external_exports.record(external_exports.string()).optional(),
12174
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
11798
12175
  // Fingerprint hashes
11799
12176
  canvasHash: external_exports.string().optional(),
11800
12177
  webglHash: external_exports.string().optional(),
@@ -11942,6 +12319,68 @@ var AgentCategorySchema = external_exports.enum([
11942
12319
  "unknown"
11943
12320
  // Unclassified agents
11944
12321
  ]);
12322
+ var AGENT_CATEGORY_META = {
12323
+ ai_assistant: {
12324
+ label: "AI assistant",
12325
+ inline: "AI assistant",
12326
+ definition: "An AI assistant acting for a person in real time (ChatGPT, Claude, Perplexity)."
12327
+ },
12328
+ search_engine: {
12329
+ label: "Search engine",
12330
+ inline: "search engine",
12331
+ definition: "An indexing crawler that makes your pages findable (Googlebot, Bingbot)."
12332
+ },
12333
+ social_media: {
12334
+ label: "Social media",
12335
+ inline: "social media",
12336
+ definition: "A crawler building link previews for a social platform."
12337
+ },
12338
+ monitoring: {
12339
+ label: "Monitoring",
12340
+ inline: "monitoring",
12341
+ definition: "An uptime or health checker polling your endpoints."
12342
+ },
12343
+ scraper: {
12344
+ label: "Scraper",
12345
+ inline: "scraper",
12346
+ definition: "Bulk content extraction, including AI training crawlers such as GPTBot and ClaudeBot."
12347
+ },
12348
+ automation: {
12349
+ label: "Automation",
12350
+ inline: "automation",
12351
+ definition: "A headless browser or scripted driver (Puppeteer, Playwright, Selenium)."
12352
+ },
12353
+ security: {
12354
+ label: "Security",
12355
+ inline: "security",
12356
+ definition: "A vulnerability scanner or security research crawler."
12357
+ },
12358
+ analytics: {
12359
+ label: "Analytics",
12360
+ inline: "analytics",
12361
+ definition: "An SEO or analytics tool sampling your pages."
12362
+ },
12363
+ unknown: {
12364
+ label: "Other",
12365
+ inline: "other",
12366
+ definition: "Detected and classified traffic that has not been attributed to a named vendor, usually because it matched only a generic bot signature. Not a detection failure, and worth sampling periodically: a new agent lands here before anyone writes a signature for it."
12367
+ }
12368
+ };
12369
+ function formatUnrecognizedValue(value) {
12370
+ return value.replace(/_/g, " ");
12371
+ }
12372
+ var LEGACY_CATEGORY_SENTINELS = /* @__PURE__ */ new Set(["__uncategorized__", "__unidentified__"]);
12373
+ function formatAgentCategory(value) {
12374
+ if (!value || LEGACY_CATEGORY_SENTINELS.has(value)) return AGENT_CATEGORY_META.unknown.label;
12375
+ const meta = AGENT_CATEGORY_META[value];
12376
+ return meta ? meta.label : formatUnrecognizedValue(value);
12377
+ }
12378
+ function formatAgentCategoryInline(value) {
12379
+ if (!value || LEGACY_CATEGORY_SENTINELS.has(value)) return AGENT_CATEGORY_META.unknown.inline;
12380
+ const meta = AGENT_CATEGORY_META[value];
12381
+ return meta ? meta.inline : formatUnrecognizedValue(value);
12382
+ }
12383
+ var UNNAMED_AGENT_LABEL = "Unnamed agent";
11945
12384
  var AgentTypeDefinitionSchema = external_exports.object({
11946
12385
  id: external_exports.string().uuid(),
11947
12386
  name: external_exports.string(),
@@ -11970,14 +12409,14 @@ var AgentClassificationResultSchema = external_exports.object({
11970
12409
  isLegitimate: external_exports.boolean(),
11971
12410
  signatureVerified: external_exports.boolean().optional(),
11972
12411
  matchedPatterns: external_exports.array(external_exports.string()),
11973
- metadata: external_exports.record(external_exports.unknown()).optional()
12412
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11974
12413
  });
11975
12414
  var AgentClassificationRequestSchema = external_exports.object({
11976
12415
  userAgent: external_exports.string().optional(),
11977
- headers: external_exports.record(external_exports.string()).optional(),
12416
+ headers: external_exports.record(external_exports.string(), external_exports.string()).optional(),
11978
12417
  ipAddress: external_exports.string().optional(),
11979
12418
  sessionId: external_exports.string().optional(),
11980
- metadata: external_exports.record(external_exports.unknown()).optional()
12419
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
11981
12420
  });
11982
12421
  var AgentStatisticsSchema = external_exports.object({
11983
12422
  agentTypeId: external_exports.string().uuid(),
@@ -12182,7 +12621,13 @@ var EXCLUSION_BUCKETS = [
12182
12621
  "shopify_review",
12183
12622
  "cohort"
12184
12623
  ];
12185
- var ADMIN_OVERVIEW_SECTIONS = ["ladder", "installations", "traffic", "lists"];
12624
+ var ADMIN_OVERVIEW_SECTIONS = [
12625
+ "ladder",
12626
+ "installations",
12627
+ "traffic",
12628
+ "lists",
12629
+ "hiAi"
12630
+ ];
12186
12631
  var ADMIN_OVERVIEW_CACHE_STATUSES = ["hit", "stale", "miss", "bypass"];
12187
12632
  var SERVICE_TRAFFIC_KEYS = [...INSTALLATION_KINDS, "mixed", "none"];
12188
12633
 
@@ -12353,89 +12798,6 @@ function createValidationErrorResponse(message, details, meta) {
12353
12798
  };
12354
12799
  }
12355
12800
 
12356
- // src/utils/verification.ts
12357
- var KYA_OS_HANDSHAKE_METHODS = {
12358
- /** New canonical engine value. Not emitted yet — accepted on read. */
12359
- CANONICAL: "kyaos_handshake",
12360
- /** @deprecated Legacy engine value. Still emitted by the Rust engine. */
12361
- LEGACY: "mcp_i_handshake"
12362
- };
12363
- var KYA_OS_WIRE_METHODS = {
12364
- /** New canonical wire value. Not emitted yet — accepted on read. */
12365
- CANONICAL: "kya-os",
12366
- /** @deprecated Legacy wire value. Still emitted by the gateway worker. */
12367
- LEGACY: "mcp-i"
12368
- };
12369
- function isKyaOsHandshakeMethod(value) {
12370
- return value === KYA_OS_HANDSHAKE_METHODS.LEGACY || value === KYA_OS_HANDSHAKE_METHODS.CANONICAL;
12371
- }
12372
- function isKyaOsWireMethod(value) {
12373
- return value === KYA_OS_WIRE_METHODS.LEGACY || value === KYA_OS_WIRE_METHODS.CANONICAL;
12374
- }
12375
- function normalizeHandshakeMethod(value) {
12376
- return isKyaOsHandshakeMethod(value) ? KYA_OS_HANDSHAKE_METHODS.CANONICAL : value;
12377
- }
12378
- function normalizeWireMethod(value) {
12379
- return isKyaOsWireMethod(value) ? KYA_OS_WIRE_METHODS.CANONICAL : value;
12380
- }
12381
- function getVerificationMethodDescription(method) {
12382
- switch (normalizeHandshakeMethod(method)) {
12383
- case "signature":
12384
- return "HTTP Signature Verification";
12385
- case "pattern":
12386
- return "User-Agent Pattern Matching";
12387
- case "behavioral":
12388
- return "Behavioral Analysis";
12389
- case "network":
12390
- return "Network-based Detection";
12391
- case KYA_OS_HANDSHAKE_METHODS.CANONICAL:
12392
- return "MCP Handshake Detection";
12393
- case "error":
12394
- return "Detection Error";
12395
- case "none":
12396
- default:
12397
- return "No Verification";
12398
- }
12399
- }
12400
- function getVerificationReliability(method) {
12401
- switch (normalizeHandshakeMethod(method)) {
12402
- case "signature":
12403
- return 1;
12404
- // Highest reliability
12405
- case KYA_OS_HANDSHAKE_METHODS.CANONICAL:
12406
- return 0.95;
12407
- case "behavioral":
12408
- return 0.8;
12409
- case "network":
12410
- return 0.6;
12411
- case "pattern":
12412
- return 0.5;
12413
- case "none":
12414
- return 0.3;
12415
- case "error":
12416
- default:
12417
- return 0.1;
12418
- }
12419
- }
12420
- function isHighConfidenceVerification(method) {
12421
- return method === "signature" || isKyaOsHandshakeMethod(method);
12422
- }
12423
- function getVerificationRiskLevel(method, confidence) {
12424
- if (method === "signature") {
12425
- return "low";
12426
- }
12427
- if (isKyaOsHandshakeMethod(method)) {
12428
- return "low";
12429
- }
12430
- if (confidence >= 0.9) {
12431
- return method === "behavioral" ? "medium" : "high";
12432
- }
12433
- if (confidence >= 0.7) {
12434
- return "medium";
12435
- }
12436
- return "high";
12437
- }
12438
-
12439
12801
  // src/utils/detection-class.ts
12440
12802
  function detectionClassToEnum(detectionClass) {
12441
12803
  switch (detectionClass.type) {
@@ -12506,17 +12868,264 @@ function isClaudeProductLabel(displayName) {
12506
12868
  const d = displayName.trim();
12507
12869
  return d === CLAUDE_CANONICAL_DISPLAY || CLAUDE_DEPRECATED_TWIN.test(d);
12508
12870
  }
12509
- function claudeRuntimeLabel(userAgent) {
12871
+ function hasClaudeCodeToken(userAgent) {
12510
12872
  const ua = (userAgent ?? "").toLowerCase();
12511
- if (!ua) return "Claude";
12512
- if (ua.includes("claude-code") || ua.includes("claude code")) return "Claude Code";
12513
- if (ua.includes("claude-cowork")) return "Claude Cowork";
12514
- if (ua.includes("claude-searchbot")) return "Claude SearchBot";
12515
- if (ua.includes("claude-user")) return "Claude (web fetch)";
12873
+ return ua.includes("claude-code") || ua.includes("claude code");
12874
+ }
12875
+ function hasClaudeUserToken(userAgent) {
12876
+ return (userAgent ?? "").toLowerCase().includes("claude-user");
12877
+ }
12878
+ function hasClaudeSearchBotToken(userAgent) {
12879
+ return (userAgent ?? "").toLowerCase().includes("claude-searchbot");
12880
+ }
12881
+ function claudeRuntimeLabel(userAgent, runtimeSurface) {
12882
+ const ua = (userAgent ?? "").toLowerCase();
12883
+ if (ua) {
12884
+ const hasClaudeCode = hasClaudeCodeToken(ua);
12885
+ const hasClaudeUser = hasClaudeUserToken(ua);
12886
+ if (hasClaudeCode && hasClaudeUser) return "Claude Code (web fetch)";
12887
+ if (hasClaudeCode) return "Claude Code";
12888
+ if (ua.includes("claude-cowork")) return "Claude Cowork";
12889
+ if (hasClaudeSearchBotToken(ua)) return "Claude SearchBot";
12890
+ if (hasClaudeUser) return "Claude (web fetch)";
12891
+ }
12892
+ if (runtimeSurface === "cli") {
12893
+ if (ua.startsWith("curl/")) return "Claude Code (curl)";
12894
+ if (ua.startsWith("wget/")) return "Claude Code (wget)";
12895
+ return "Claude Code";
12896
+ }
12897
+ if (runtimeSurface === "native_app") return "Claude Desktop";
12898
+ if (runtimeSurface === "browser") return "Claude (browser)";
12516
12899
  return "Claude";
12517
12900
  }
12518
- function refineClaudeDisplayLabel(displayName, userAgent) {
12519
- return isClaudeProductLabel(displayName) ? claudeRuntimeLabel(userAgent) : displayName;
12901
+ function refineClaudeDisplayLabel(displayName, userAgent, runtimeSurface) {
12902
+ return isClaudeProductLabel(displayName) ? claudeRuntimeLabel(userAgent, runtimeSurface) : displayName;
12903
+ }
12904
+ function refineSessionGrainClaudeLabel(displayName, runtimeSurface) {
12905
+ return refineClaudeDisplayLabel(displayName, null, runtimeSurface);
12906
+ }
12907
+
12908
+ // src/utils/client-ip.ts
12909
+ var MAX_INPUT_LENGTH = 4096;
12910
+ var MAX_TOKEN_LENGTH = 128;
12911
+ var MAX_FORWARDED_HOPS = 32;
12912
+ function hasControlCharacter(value) {
12913
+ for (let i = 0; i < value.length; i++) {
12914
+ const code = value.charCodeAt(i);
12915
+ if (code <= 31 || code === 127) return true;
12916
+ }
12917
+ return false;
12918
+ }
12919
+ function parsePort(value) {
12920
+ return /^(?:0|[1-9]\d{0,4})$/.test(value) && Number(value) <= 65535;
12921
+ }
12922
+ function parseIpv4(value) {
12923
+ const parts = value.split(".");
12924
+ if (parts.length !== 4) return null;
12925
+ const octets = [];
12926
+ for (const part of parts) {
12927
+ if (!/^\d{1,3}$/.test(part)) return null;
12928
+ const octet = Number(part);
12929
+ if (octet > 255) return null;
12930
+ octets.push(octet);
12931
+ }
12932
+ return octets;
12933
+ }
12934
+ function parseHexGroup(value) {
12935
+ if (!/^[0-9a-fA-F]{1,4}$/.test(value)) return null;
12936
+ return Number.parseInt(value, 16);
12937
+ }
12938
+ function parseIpv6(value) {
12939
+ if (!value || value.includes("%") || hasControlCharacter(value)) return null;
12940
+ let address = value;
12941
+ if (address.includes(".")) {
12942
+ const lastColon = address.lastIndexOf(":");
12943
+ if (lastColon < 0) return null;
12944
+ const ipv4 = parseIpv4(address.slice(lastColon + 1));
12945
+ if (!ipv4) return null;
12946
+ const first = ipv4[0] << 8 | ipv4[1];
12947
+ const second = ipv4[2] << 8 | ipv4[3];
12948
+ address = `${address.slice(0, lastColon + 1)}${first.toString(16)}:${second.toString(16)}`;
12949
+ }
12950
+ const doubleColon = address.indexOf("::");
12951
+ if (doubleColon !== address.lastIndexOf("::")) return null;
12952
+ const parseGroups = (part) => {
12953
+ if (!part) return [];
12954
+ const groups2 = part.split(":");
12955
+ const parsed = [];
12956
+ for (const group of groups2) {
12957
+ const number = parseHexGroup(group);
12958
+ if (number === null) return null;
12959
+ parsed.push(number);
12960
+ }
12961
+ return parsed;
12962
+ };
12963
+ if (doubleColon >= 0) {
12964
+ const head = parseGroups(address.slice(0, doubleColon));
12965
+ const tail = parseGroups(address.slice(doubleColon + 2));
12966
+ if (!head || !tail) return null;
12967
+ const missing = 8 - head.length - tail.length;
12968
+ if (missing < 1) return null;
12969
+ return [...head, ...Array(missing).fill(0), ...tail];
12970
+ }
12971
+ const groups = parseGroups(address);
12972
+ return groups?.length === 8 ? groups : null;
12973
+ }
12974
+ function compressIpv6(groups) {
12975
+ const rendered = groups.map((group) => group.toString(16));
12976
+ let bestStart = -1;
12977
+ let bestLength = 1;
12978
+ let runStart = -1;
12979
+ for (let index = 0; index <= groups.length; index += 1) {
12980
+ if (index < groups.length && groups[index] === 0) {
12981
+ if (runStart < 0) runStart = index;
12982
+ continue;
12983
+ }
12984
+ if (runStart >= 0) {
12985
+ const runLength = index - runStart;
12986
+ if (runLength > bestLength) {
12987
+ bestStart = runStart;
12988
+ bestLength = runLength;
12989
+ }
12990
+ runStart = -1;
12991
+ }
12992
+ }
12993
+ if (bestStart < 0) return rendered.join(":");
12994
+ const before = rendered.slice(0, bestStart).join(":");
12995
+ const after = rendered.slice(bestStart + bestLength).join(":");
12996
+ if (!before && !after) return "::";
12997
+ if (!before) return `::${after}`;
12998
+ if (!after) return `${before}::`;
12999
+ return `${before}::${after}`;
13000
+ }
13001
+ function normalizeToken(rawToken) {
13002
+ const token = rawToken.trim();
13003
+ if (!token || token.length > MAX_TOKEN_LENGTH || hasControlCharacter(token)) return null;
13004
+ let address = token;
13005
+ if (token.startsWith("[")) {
13006
+ const closing = token.indexOf("]");
13007
+ if (closing <= 1) return null;
13008
+ const suffix = token.slice(closing + 1);
13009
+ if (suffix && (!suffix.startsWith(":") || !parsePort(suffix.slice(1)))) return null;
13010
+ address = token.slice(1, closing);
13011
+ } else if ((token.match(/:/g) ?? []).length === 1 && token.includes(".")) {
13012
+ const colon = token.indexOf(":");
13013
+ if (!parsePort(token.slice(colon + 1))) return null;
13014
+ address = token.slice(0, colon);
13015
+ }
13016
+ const ipv4 = parseIpv4(address);
13017
+ if (ipv4) return ipv4.join(".");
13018
+ const ipv6 = parseIpv6(address);
13019
+ return ipv6 ? compressIpv6(ipv6) : null;
13020
+ }
13021
+ function boundedTokens(raw) {
13022
+ if (raw == null || !raw || raw.length > MAX_INPUT_LENGTH || hasControlCharacter(raw)) return null;
13023
+ const tokens = raw.split(",");
13024
+ if (tokens.length > MAX_FORWARDED_HOPS) return null;
13025
+ return tokens;
13026
+ }
13027
+ function normalizeClientIp(raw) {
13028
+ const tokens = boundedTokens(raw);
13029
+ if (!tokens) return null;
13030
+ for (const token of tokens) {
13031
+ const normalized = normalizeToken(token);
13032
+ if (normalized) return normalized;
13033
+ }
13034
+ return null;
13035
+ }
13036
+ function getHeader(headers, name) {
13037
+ if ("get" in headers && typeof headers.get === "function") {
13038
+ return headers.get(name) ?? void 0;
13039
+ }
13040
+ const wanted = name.toLowerCase();
13041
+ for (const [key, value] of Object.entries(headers)) {
13042
+ if (key.toLowerCase() !== wanted || value === void 0) continue;
13043
+ return Array.isArray(value) ? value.join(",") : value;
13044
+ }
13045
+ return void 0;
13046
+ }
13047
+ function result(ip, source, trusted) {
13048
+ return ip ? { ip, source, trusted } : null;
13049
+ }
13050
+ function resolveAddress(raw, source) {
13051
+ return result(normalizeClientIp(raw), source, true);
13052
+ }
13053
+ function resolveExplicit(input) {
13054
+ if (input.explicitAddressTrusted !== true) return null;
13055
+ return result(normalizeClientIp(input.explicitAddress), "explicit", true);
13056
+ }
13057
+ function resolveVercel(input) {
13058
+ const platform = result(
13059
+ normalizeClientIp(getHeader(input.headers, "x-vercel-forwarded-for")),
13060
+ "x-vercel-forwarded-for",
13061
+ true
13062
+ );
13063
+ if (platform) return platform;
13064
+ const overwrittenXff = result(
13065
+ normalizeClientIp(getHeader(input.headers, "x-forwarded-for")),
13066
+ "x-forwarded-for",
13067
+ true
13068
+ );
13069
+ if (overwrittenXff) return overwrittenXff;
13070
+ const realIp = result(
13071
+ normalizeClientIp(getHeader(input.headers, "x-real-ip")),
13072
+ "x-real-ip",
13073
+ false
13074
+ );
13075
+ if (realIp) return realIp;
13076
+ return resolveAddress(input.frameworkAddress, "framework") ?? resolveAddress(input.directAddress, "socket") ?? { ip: null, source: "none", trusted: false };
13077
+ }
13078
+ function resolveCloudflare(input) {
13079
+ const cloudflare = result(
13080
+ normalizeClientIp(getHeader(input.headers, "cf-connecting-ip")),
13081
+ "cf-connecting-ip",
13082
+ true
13083
+ );
13084
+ if (cloudflare) return cloudflare;
13085
+ return resolveAddress(input.directAddress, "socket") ?? resolveAddress(input.frameworkAddress, "framework") ?? result(
13086
+ normalizeClientIp(getHeader(input.headers, "x-forwarded-for")),
13087
+ "x-forwarded-for",
13088
+ false
13089
+ ) ?? result(normalizeClientIp(getHeader(input.headers, "x-real-ip")), "x-real-ip", false) ?? {
13090
+ ip: null,
13091
+ source: "none",
13092
+ trusted: false
13093
+ };
13094
+ }
13095
+ function resolveTrustedProxy(input, trustedHops) {
13096
+ const raw = getHeader(input.headers, "x-forwarded-for");
13097
+ const tokens = boundedTokens(raw);
13098
+ if (tokens && Number.isInteger(trustedHops) && trustedHops > 0 && tokens.length > trustedHops) {
13099
+ const parsed = tokens.map(normalizeToken);
13100
+ const selectedIndex = tokens.length - trustedHops - 1;
13101
+ const selected = parsed[selectedIndex];
13102
+ if (selected && parsed.every((token) => token !== null)) {
13103
+ return { ip: selected, source: "x-forwarded-for", trusted: true };
13104
+ }
13105
+ }
13106
+ return resolveAddress(input.frameworkAddress, "framework") ?? resolveAddress(input.directAddress, "socket") ?? result(normalizeClientIp(getHeader(input.headers, "x-real-ip")), "x-real-ip", false) ?? {
13107
+ ip: null,
13108
+ source: "none",
13109
+ trusted: false
13110
+ };
13111
+ }
13112
+ function resolveClientIp(input) {
13113
+ const explicit = resolveExplicit(input);
13114
+ if (explicit) return explicit;
13115
+ switch (input.policy.platform) {
13116
+ case "vercel":
13117
+ return resolveVercel(input);
13118
+ case "cloudflare":
13119
+ return resolveCloudflare(input);
13120
+ case "trusted-proxy":
13121
+ return resolveTrustedProxy(input, input.policy.trustedHops);
13122
+ case "direct":
13123
+ return resolveAddress(input.frameworkAddress, "framework") ?? resolveAddress(input.directAddress, "socket") ?? {
13124
+ ip: null,
13125
+ source: "none",
13126
+ trusted: false
13127
+ };
13128
+ }
12520
13129
  }
12521
13130
 
12522
13131
  // src/utils/correlation-id.ts
@@ -12524,7 +13133,7 @@ var CORRELATION_ID_HEADER = "x-kya-correlation-id";
12524
13133
  var CorrelationIdSchema = external_exports.string().regex(/^[0-9a-f]{32}$/);
12525
13134
  var TRACEPARENT_RE = /^(?<ver>[0-9a-f]{2})-(?<trace>[0-9a-f]{32})-(?<span>[0-9a-f]{16})-(?<flags>[0-9a-f]{2})$/;
12526
13135
  var ZERO_TRACE_ID = "0".repeat(32);
12527
- function getHeader(headers, name) {
13136
+ function getHeader2(headers, name) {
12528
13137
  const lower = name.toLowerCase();
12529
13138
  if (typeof headers.get === "function") {
12530
13139
  const value = headers.get(lower);
@@ -12556,9 +13165,9 @@ function toStoredCorrelationId(value) {
12556
13165
  return normalizeHex(value);
12557
13166
  }
12558
13167
  function extractCorrelationIdFromHeaders(headers) {
12559
- const fromTrace = extractTraceId(getHeader(headers, "traceparent"));
13168
+ const fromTrace = extractTraceId(getHeader2(headers, "traceparent"));
12560
13169
  if (fromTrace) return fromTrace;
12561
- return normalizeHex(getHeader(headers, CORRELATION_ID_HEADER));
13170
+ return normalizeHex(getHeader2(headers, CORRELATION_ID_HEADER));
12562
13171
  }
12563
13172
  function deriveCorrelationId(headers, fallback) {
12564
13173
  const fromHeaders = extractCorrelationIdFromHeaders(headers);
@@ -12694,7 +13303,7 @@ var discoveredToolSchema = external_exports.object({
12694
13303
  * Schema draft here. The Tool Testing Panel renders a
12695
13304
  * skeleton from whatever it gets.
12696
13305
  */
12697
- inputSchema: external_exports.record(external_exports.unknown()).optional()
13306
+ inputSchema: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
12698
13307
  }).strict();
12699
13308
  var upstreamDiscoveryErrorSchema = external_exports.object({
12700
13309
  code: external_exports.enum([
@@ -12715,7 +13324,7 @@ var upstreamDiscoveryErrorSchema = external_exports.object({
12715
13324
  }).strict();
12716
13325
  var gatewayInternalToolsListSchema = external_exports.object({
12717
13326
  totalCount: external_exports.number().int().min(0),
12718
- upstreamCounts: external_exports.record(external_exports.number().int().min(0)),
13327
+ upstreamCounts: external_exports.record(external_exports.string(), external_exports.number().int().min(0)),
12719
13328
  tools: external_exports.array(discoveredToolSchema),
12720
13329
  /**
12721
13330
  * Sparse map keyed by upstream slug. Empty / absent when every
@@ -12723,7 +13332,7 @@ var gatewayInternalToolsListSchema = external_exports.object({
12723
13332
  * when serialized — always-object keeps the shape stable for
12724
13333
  * consumers that read `Object.keys(errors).length`.
12725
13334
  */
12726
- errors: external_exports.record(upstreamDiscoveryErrorSchema)
13335
+ errors: external_exports.record(external_exports.string(), upstreamDiscoveryErrorSchema)
12727
13336
  }).strict();
12728
13337
  var gatewayInternalDiscoverSuccessSchema = external_exports.object({
12729
13338
  tools: external_exports.array(discoveredToolSchema)
@@ -12866,7 +13475,7 @@ var upstreamServerSchema = external_exports.object({
12866
13475
  // `staticHeadersEncrypted` before persisting and opportunistically
12867
13476
  // migrates any legacy plaintext it finds on every save that touches
12868
13477
  // an upstream). Never populated in an API response.
12869
- staticHeaders: external_exports.record(external_exports.string()).optional(),
13478
+ staticHeaders: external_exports.record(external_exports.string(), external_exports.string()).optional(),
12870
13479
  // AES-256-GCM ciphertext (base64: iv|ciphertext|authTag) of the
12871
13480
  // JSON-serialized staticHeaders map — the at-rest form going
12872
13481
  // forward. Encrypt/decrypt via `@kya-os/checkpoint-db/crypto`'s
@@ -13010,7 +13619,7 @@ var DEFAULT_EXTERNAL_ACCESS = {
13010
13619
  var gatewayConfigSchema = external_exports.object({
13011
13620
  enabled: external_exports.boolean().default(false),
13012
13621
  upstreamServers: external_exports.array(upstreamServerSchema).default([]),
13013
- roleScopes: external_exports.record(external_exports.array(external_exports.string())).optional(),
13622
+ roleScopes: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).optional(),
13014
13623
  oauthClients: external_exports.array(oauthClientSchema).default([]),
13015
13624
  rateLimits: external_exports.object({
13016
13625
  toolCallsPerMinute: external_exports.number().int().positive().default(DEFAULT_RATE_LIMITS.toolCallsPerMinute)
@@ -13018,7 +13627,7 @@ var gatewayConfigSchema = external_exports.object({
13018
13627
  externalAccess: external_exports.object({
13019
13628
  enabled: external_exports.boolean().default(DEFAULT_EXTERNAL_ACCESS.enabled),
13020
13629
  allowedDids: external_exports.array(external_exports.string()).default(DEFAULT_EXTERNAL_ACCESS.allowedDids),
13021
- externalScopes: external_exports.record(external_exports.array(external_exports.string())).default(DEFAULT_EXTERNAL_ACCESS.externalScopes)
13630
+ externalScopes: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).default(DEFAULT_EXTERNAL_ACCESS.externalScopes)
13022
13631
  }).default(DEFAULT_EXTERNAL_ACCESS),
13023
13632
  // T6 #2899 M2 — per-org fleet-server endpoint. When set, the gateway's
13024
13633
  // DiscoveryUpstreamProvider injects a synthetic `fleet` upstream so
@@ -13076,11 +13685,11 @@ var gatewayConnectionsSummarySchema = external_exports.object({
13076
13685
 
13077
13686
  // src/schemas/index.ts
13078
13687
  function validate(schema, data) {
13079
- const result = schema.safeParse(data);
13080
- if (result.success) {
13081
- return { success: true, data: result.data };
13688
+ const result2 = schema.safeParse(data);
13689
+ if (result2.success) {
13690
+ return { success: true, data: result2.data };
13082
13691
  }
13083
- return { success: false, error: result.error };
13692
+ return { success: false, error: result2.error };
13084
13693
  }
13085
13694
  function validateOrThrow(schema, data) {
13086
13695
  return schema.parse(data);
@@ -13231,7 +13840,7 @@ var BehavioralThresholdSchema = external_exports.object({
13231
13840
  var BehavioralPatternSchema = external_exports.object({
13232
13841
  name: external_exports.string().min(1),
13233
13842
  type: external_exports.enum(["rapid_requests", "no_interaction", "perfect_scrolling", "sequential_access"]),
13234
- config: external_exports.record(external_exports.any()),
13843
+ config: external_exports.record(external_exports.string(), external_exports.any()),
13235
13844
  confidenceModifier: external_exports.number().min(-1).max(1)
13236
13845
  });
13237
13846
  var BehavioralRulesSchema = external_exports.object({
@@ -13254,13 +13863,13 @@ var HeaderRulesSchema = external_exports.object({
13254
13863
  var IpRangeCollectionSchema = external_exports.union([
13255
13864
  // Old structure with providers
13256
13865
  external_exports.object({
13257
- providers: external_exports.record(IpRangeRuleSchema),
13866
+ providers: external_exports.record(external_exports.string(), IpRangeRuleSchema),
13258
13867
  updateUrl: external_exports.string().url().optional(),
13259
13868
  updateFrequency: external_exports.enum(["hourly", "daily", "weekly", "monthly"]).optional(),
13260
13869
  cacheDuration: external_exports.number().min(0).optional()
13261
13870
  }),
13262
13871
  // New merged structure - IP ranges directly as properties
13263
- external_exports.record(IpRangeRuleSchema).refine(
13872
+ external_exports.record(external_exports.string(), IpRangeRuleSchema).refine(
13264
13873
  (val) => {
13265
13874
  return Object.values(val).some(
13266
13875
  (v) => v && typeof v === "object" && "ranges" in v && Array.isArray(v.ranges)
@@ -13279,9 +13888,9 @@ var DetectionRulesSchema = external_exports.object({
13279
13888
  source: external_exports.string().optional()
13280
13889
  }).optional(),
13281
13890
  rules: external_exports.object({
13282
- userAgents: external_exports.record(UserAgentRuleSchema),
13891
+ userAgents: external_exports.record(external_exports.string(), UserAgentRuleSchema),
13283
13892
  ipRanges: IpRangeCollectionSchema,
13284
- signatures: external_exports.record(SignatureRuleSchema),
13893
+ signatures: external_exports.record(external_exports.string(), SignatureRuleSchema),
13285
13894
  behavioral: BehavioralRulesSchema,
13286
13895
  headers: HeaderRulesSchema
13287
13896
  })
@@ -13323,7 +13932,7 @@ var RuleMatchResultSchema = external_exports.object({
13323
13932
  rule: external_exports.string().optional(),
13324
13933
  category: external_exports.enum(["userAgent", "ipRange", "signature", "behavioral", "header"]).optional(),
13325
13934
  confidence: external_exports.number().min(0).max(1).optional(),
13326
- details: external_exports.record(external_exports.any()).optional()
13935
+ details: external_exports.record(external_exports.string(), external_exports.any()).optional()
13327
13936
  });
13328
13937
  function validateRules(rules) {
13329
13938
  try {
@@ -13333,7 +13942,7 @@ function validateRules(rules) {
13333
13942
  if (error instanceof external_exports.ZodError) {
13334
13943
  return {
13335
13944
  valid: false,
13336
- errors: error.errors.map((e) => ({
13945
+ errors: error.issues.map((e) => ({
13337
13946
  path: e.path.join("."),
13338
13947
  message: e.message,
13339
13948
  type: e.code
@@ -13363,7 +13972,7 @@ function validateRulesLoose(rules) {
13363
13972
  if (error instanceof external_exports.ZodError) {
13364
13973
  return {
13365
13974
  valid: false,
13366
- errors: error.errors.map((e) => ({
13975
+ errors: error.issues.map((e) => ({
13367
13976
  path: e.path.join("."),
13368
13977
  message: e.message,
13369
13978
  type: e.code
@@ -13404,9 +14013,9 @@ var RuleValidator = class {
13404
14013
  * Validate and throw on error
13405
14014
  */
13406
14015
  static validateOrThrow(rules, mode = "strict") {
13407
- const result = this.validate(rules, mode);
13408
- if (!result.valid) {
13409
- const errors = result.errors?.map((e) => `${e.path}: ${e.message}`).join(", ");
14016
+ const result2 = this.validate(rules, mode);
14017
+ if (!result2.valid) {
14018
+ const errors = result2.errors?.map((e) => `${e.path}: ${e.message}`).join(", ");
13410
14019
  throw new Error(`${RULE_ERRORS.VALIDATION_FAILED}: ${errors}`);
13411
14020
  }
13412
14021
  return rules;
@@ -13419,7 +14028,7 @@ var RuleValidator = class {
13419
14028
  return DetectionRulesSchema.parse(rules);
13420
14029
  } catch (error) {
13421
14030
  if (error instanceof external_exports.ZodError) {
13422
- const errors = error.errors.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ");
14031
+ const errors = error.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ");
13423
14032
  throw new Error(`${RULE_ERRORS.VALIDATION_FAILED}: ${errors}`);
13424
14033
  }
13425
14034
  throw error;
@@ -13477,18 +14086,18 @@ var RuleValidator = class {
13477
14086
  /**
13478
14087
  * Get validation errors as formatted string
13479
14088
  */
13480
- static formatErrors(result) {
13481
- if (result.valid) {
14089
+ static formatErrors(result2) {
14090
+ if (result2.valid) {
13482
14091
  return "";
13483
14092
  }
13484
- const errors = result.errors || [];
14093
+ const errors = result2.errors || [];
13485
14094
  return errors.map((e) => ` - ${e.path}: ${e.message}`).join("\n");
13486
14095
  }
13487
14096
  /**
13488
14097
  * Get validation warnings as formatted string
13489
14098
  */
13490
- static formatWarnings(result) {
13491
- const warnings = result.warnings || [];
14099
+ static formatWarnings(result2) {
14100
+ const warnings = result2.warnings || [];
13492
14101
  return warnings.map((w) => ` - ${w.path}: ${w.message}`).join("\n");
13493
14102
  }
13494
14103
  };
@@ -14228,8 +14837,8 @@ function parsePolicyConfig(data) {
14228
14837
  return PolicyConfigSchema.parse(data);
14229
14838
  }
14230
14839
  function safeParsePolicyConfig(data) {
14231
- const result = PolicyConfigSchema.safeParse(data);
14232
- return result.success ? result.data : null;
14840
+ const result2 = PolicyConfigSchema.safeParse(data);
14841
+ return result2.success ? result2.data : null;
14233
14842
  }
14234
14843
  function parseEvaluationContext(data) {
14235
14844
  return PolicyEvaluationContextSchema.parse(data);
@@ -15473,7 +16082,7 @@ var vaultResolveMetaSchema = external_exports.object({
15473
16082
  upstreamSlug: external_exports.string().optional()
15474
16083
  }).strict();
15475
16084
  var vaultResolveDataSchema = external_exports.object({
15476
- secrets: external_exports.record(external_exports.string()),
16085
+ secrets: external_exports.record(external_exports.string(), external_exports.string()),
15477
16086
  _meta: vaultResolveMetaSchema.optional()
15478
16087
  }).strict();
15479
16088
  var vaultResolveSuccessSchema = external_exports.object({
@@ -15612,9 +16221,20 @@ var ReportedPrincipalSchema = external_exports.object({
15612
16221
  }).describe("Asserted identity of the principal the agent acted for");
15613
16222
  var DelegationResultSchema = external_exports.enum(["verified", "failed", "not_presented"]);
15614
16223
  var DelegationVerifiedBySchema = external_exports.enum(["reporter", "gateway", "checkpoint"]);
16224
+ var REGISTERED_SID_MAX_LENGTH = 100;
16225
+ var SID_ATTRIBUTABLE_RESULT = "verified";
15615
16226
  var ReportedDelegationSchema = external_exports.object({
15616
16227
  /** Delegation credential id — the join key into `delegations`. */
15617
16228
  jti: NonEmptyTrimmed.optional(),
16229
+ /**
16230
+ * The registered session anchor: the draft-kya-http-02 `sid` claim of the
16231
+ * presented credential (the top-level VC-JWT `sid` minted in
16232
+ * `mint-vc-jwt.ts`), distinct from any gateway or MCP session id. Optional,
16233
+ * and attributed to a session timeline only when `result` is `verified`
16234
+ * ({@link SID_ATTRIBUTABLE_RESULT}); ingest nulls it for any other result.
16235
+ * No refine here: the identity block must never fail a request.
16236
+ */
16237
+ sid: NonEmptyTrimmed.max(REGISTERED_SID_MAX_LENGTH).optional(),
15618
16238
  /** Issuer DID (usually the principal). */
15619
16239
  iss: DidStringSchema2.optional(),
15620
16240
  /** Audience DID (the intended verifier / resource). */
@@ -15863,18 +16483,18 @@ function parseJafarFeed(json) {
15863
16483
  } catch (err) {
15864
16484
  throw new JafarParseError("JAFAR feed is not valid JSON", err);
15865
16485
  }
15866
- const result = jafarFeedSchema.safeParse(raw);
15867
- if (!result.success) {
16486
+ const result2 = jafarFeedSchema.safeParse(raw);
16487
+ if (!result2.success) {
15868
16488
  throw new JafarParseError(
15869
- `JAFAR feed failed schema validation: ${result.error.message}`,
15870
- result.error
16489
+ `JAFAR feed failed schema validation: ${result2.error.message}`,
16490
+ result2.error
15871
16491
  );
15872
16492
  }
15873
- return result.data;
16493
+ return result2.data;
15874
16494
  }
15875
16495
 
15876
16496
  // src/index.ts
15877
16497
  var VERSION = "0.1.0";
15878
16498
  var PACKAGE_NAME = "@kya-os/checkpoint-shared";
15879
16499
 
15880
- export { ACCEPT_CHALLENGE_HEADER, ADMIN_DELTA_BASES, ADMIN_OVERVIEW_CACHE_STATUSES, ADMIN_OVERVIEW_LIST_LIMIT_DEFAULT, ADMIN_OVERVIEW_LIST_LIMIT_MAX, ADMIN_OVERVIEW_SECTIONS, ADMIN_OVERVIEW_WINDOWS, AI_AGENT_HEADERS, ANONYMOUS_PRINCIPAL_DID, API_ERRORS, API_ERROR_CODES, API_REQUEST_LIMITS, ATTESTED_BEARER_MAX_TTL_SECONDS, AUTHORIZATION_MODES, AUTH_ERRORS, AUTH_ERROR_MESSAGES, AccountSchema, AddFingerprintToProfileRequestSchema, AddUpdateProviderRequestSchema, AdminQueryParamsSchema, AgentCategorySchema, AgentClassificationRequestSchema, AgentClassificationResultSchema, AgentClassificationSchema, AgentInfoSchema, AgentPatternSchema, AgentProfileSchema, AgentShieldConfigSchema, AgentSourceDistributionSchema, AgentStatisticsSchema, AgentTypeDefinitionSchema, AgentTypeSchema, AggregationTypeSchema, AllowListEntrySchema, AnalyticsAgentSourcesQuerySchema, AnalyticsAgentTypesQuerySchema, AnalyticsChartDataSchema, AnalyticsDataPointSchema, AnalyticsExportParamsSchema, AnalyticsExportQuerySchema, AnalyticsQuerySchema2 as AnalyticsQuerySchema, AnalyticsRealtimeQuerySchema, AnalyticsSessionsQuerySchema, AnalyticsSessionsResponseSchema, AnalyticsSummarySchema2 as AnalyticsSessionsSummarySchema, AnalyticsSummarySchema, AnalyticsTimeSeriesSchema, AnalyticsTimeWindowSchema, ApiKeyPermissionSchema, ApiKeyRateLimitsSchema, ApiKeySchema, ApiKeysBulkCreateItemSchema, ApiKeysBulkRequestSchema, ApiKeysBulkRevokeItemSchema, ApiKeysBulkUpdateItemSchema, ApiKeysQuerySchema, ApiResponseSchema, AssuranceTierSchema, AuthErrorType, AuthProviderTypeSchema, BASELINE_ALLOW_POLICY_ID, BESPOKE_POLICY_IDS, BLOCKED_PATH, BOT_USER_AGENT_PATTERNS, BROWSER_PATTERNS, BULK_ERROR_CODES, BaseAuthProviderSchema, BaseBulkRequestSchema, BatchDetectionRequestSchema, BatchDetectionResponseSchema, BatchEventRequestSchema, BatchEventResponseSchema, BatchEventSchema, BatchPixelEventRequestSchema, BehavioralAnalysisSchema, BehavioralDataSchema, BehavioralPatternSchema, BehavioralRulesSchema, BehavioralSignalsSchema, BehavioralThresholdSchema, BlockEventSchema, BlockReasonSchema, BotPatternSchema2 as BotPatternSchema, BotTypeSchema, BouncerConfigSchema, BouncerOutcomeSchema, BouncerProofSchema, BrowserInfoSchema, BulkDeletePreviewStatsSchema, BulkDeleteResponseSchema, BulkOperationOptionsSchema, BulkOperationParamsSchema, BulkOperationResultSchema, BulkOperationTypeSchema, BulkResponseSchema, BulkResultItemSchema, CACHE_LIMITS, CACHE_TTL, CLOUD_PROVIDER_RANGES, CONDITION_FIELDS, CONDITION_OPERATORS, CONFIDENCE_THRESHOLDS, CORRELATION_ID_HEADER, CRISPBudgetSchema, CURRENT_POLICY_VERSION, CacheConfigSchema, CachedDetectionDataSchema, ChallengeParamsSchema, ChallengeWireError, CircuitBreakerConfigSchema, CircuitBreakerStateSchema, ClickEventSchema, ClientDetectionSchema, CollectFingerprintRequestSchema, CollectFingerprintResponseSchema, CollectedDataSchema, ConditionFieldSchema, ConditionOperatorSchema, ConditionValueSchema, ConfidenceBreakdownSchema, ConfidenceLevelSchema, ConfidenceThresholdSchema, ConfidenceUtils, ConfiguredProviderSchema, ConsentAgentMetadataSchema, ConsentBrandingSchema, ConsentCapabilityGroupSchema, ConsentCapabilitySchema, ConsentConfigMetadataSchema, ConsentConfigSchema, ConsentTermsSchema, ConsentUISchema, CorrelationIdSchema, CreateApiKeySchema, CreateOrganizationInputSchema, CreateOrganizationSchema, CreatePixelSchema, CreateProfileRequestSchema, CreateProjectSchema, CreateProvisioningOrganizationRequestSchema, CreateProvisioningOrganizationResponseSchema, CredentialProviderSchema, CustomRuleSchema, DATABASE_LIMITS, DEFAULT_ADMIN_OVERVIEW_WINDOW, DEFAULT_AGENTSHIELD_CONFIG, DEFAULT_AGENT_TYPES, DEFAULT_API_KEY_RATE_LIMITS, DEFAULT_AUTHORIZATION_HOST, DEFAULT_BEHAVIORAL_THRESHOLDS, DEFAULT_CACHE_CONFIG, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, DEFAULT_CONFIDENCE_THRESHOLDS, DEFAULT_CORS_CONFIG, DEFAULT_DETECTION_OPTIONS, DEFAULT_ENV_VARS, DEFAULT_LOG_CONFIG, DEFAULT_MAX_VENDOR_RANGE_AGE_MS, DEFAULT_PASSWORD_REQUIREMENTS, DEFAULT_PIXEL_CONFIG, DEFAULT_POLICY, DEFAULT_PROJECT_SETTINGS, DEFAULT_RESPONSE_HEADERS, DEFAULT_RETRY_CONFIG, DEFAULT_RULE_PRIORITY, DEFAULT_SESSION_CONFIG, DEFAULT_THRESHOLDS, DEFAULT_TIMEOUTS, DEFAULT_WEBHOOK_EVENTS, DELEGATION_PROOF_HEADERS, DEPLOY_STEPS, DETECTION_ERRORS, DETECTION_LIMITS, DashboardStatsRequestSchema, DatabaseDetectionMetadataSchema, DatabaseStatusSchema, DecisionSchema, DelegationPollingStatusSchema, DelegationResultSchema, DelegationSchema, DelegationStatusSchema, DelegationVerifiedBySchema, DeleteAccountSchema, DenyListEntrySchema, DeployProgressEventSchema, DeployStepIdSchema, DeployStepStateSchema, DeployStepStatusSchema, DeploymentMetadataSchema, DetectionClassSchema, DetectionDetailSchema, DetectionErrorDetailsSchema, DetectionEventSchema, DetectionInputSchema, DetectionLogSchema, DetectionMetadataSchema, DetectionModeSchema, DetectionOptionsSchema, DetectionReasoningSchema, DetectionRequestSchema, DetectionResponseSchema, DetectionResultSchema, DetectionRuleSchema, DetectionRulesSchema, DetectionSignalSchema, DetectionStatusSchema, DetectionTestResultSchema, DetectionViewTypeSchema, ENFORCEMENT_ACTIONS, ENFORCEMENT_MODES, ENTROPY_CONFIDENCE_CEILING, ENTROPY_CONFIDENCE_FLOOR, ERROR_CATEGORIES, ERROR_CODES, ERROR_MESSAGES, ERROR_STATUS_CODES, EXCLUSION_BUCKETS, EXPORT_LIMITS, EnforcementActionSchema, EnforcementModeSchema, EngineInfoSchema, EnhancedFingerprintResponseSchema, ErrorResponseSchema, EventConfigSchema, EventStorageRecordSchema, EventTrackingRequestSchema, EventTrackingResponseSchema, ExportAnalyticsSchema, ExpressMiddlewareOptionsSchema, FallbackOptionsSchema, FilterOperatorSchema, FingerprintAnalysisSchema, ClientDetectionSchema2 as FingerprintClientDetectionSchema, FingerprintDetectRequestSchema, FingerprintRecordSchema, FingerprintResponseSchema, FingerprintSearchQuerySchema, ForgeabilityRiskSchema, GrowthBatchRequestSchema, GrowthConfigurationResetSchema, GrowthConfigurationThresholdsSchema, GrowthConfigurationUpdateSchema, GrowthOpportunitiesQuerySchema, GrowthOpportunityUpdateSchema, HEADER_PATTERNS, HTTP_STATUS, HeaderRuleSchema, HeaderRulesSchema, HealthResponseSchema, HomeRailRollupsRequestSchema, INSTALLATION_KINDS, INSTALLATION_TYPES, INTERNAL_ERRORS, InstructPayloadSchema, IntegrationTypeSchema, InternalProcessingFlagsSchema, IpRangeCollectionSchema, IpRangeRuleSchema, JafarParseError, KNOWN_AGENT_PATTERNS, KYA_HTTP_ERROR, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KeyboardEventSchema, ListProvisioningOrganizationsRequestSchema, ListProvisioningOrganizationsResponseSchema, LoggingConfigSchema, MATCH_ACTIONS, MAX_BULK_BATCH_SIZE, MAX_ED25519_KEY_BODY_LENGTH, MCPI_ORG_DID_HOST, MCP_CLIENT_DID_HOST, MOBILE_PATTERNS, MarketplaceSourceSchema, MessagePrioritySchema, MiddlewareActionSchema, MiddlewareConfigSchema, MiddlewareSessionConfigSchema, MiddlewareSessionDataSchema, MigrationStatusSchema, MouseEventSchema, NETWORK_ERRORS, NetworkConfigSchema, NetworkInfoSchema, NetworkTimingSchema, NextMiddlewareOptionsSchema, OAuth2ProviderSchema, OAuthConnectionStatusSchema, OAuthModeSchema, OAuthProviderMetadataSchema, OAuthProviderTypeSchema, OAuthProvidersMapSchema, OAuthTokensResponseSchema, OS_PATTERNS, OfflineQueueEntrySchema, OrganizationErrorCode, OrganizationIdSchema, OrganizationRoleSchema, OrganizationSettingsSchema, OrganizationSsoModeSchema, OrganizationSsoProviderSchema, OrganizationSsoSettingsSchema, PACKAGE_NAME, PAGINATION_DEFAULTS, PERFORMANCE_THRESHOLDS, PERMISSION_ERRORS, PINNED_SIGNING_VENDORS, PIXEL_ERRORS, PIXEL_EVENT_LIMITS, PLAN_FEATURE_LIMITS, PLAN_RATE_LIMITS, POLICY_MATCH_TYPES, PUBLIC_API_ERROR_CODES, PageContextSchema, PaginatedResponseSchema, PaginationInfoSchema, PaginationParamsSchema, PaginationResponseSchema, PatternUpdateRequestSchema, PerformanceRecalculationRequestSchema, PixelAnalyticsSchema, PixelConfigurationSchema, PixelEventSchema, PixelEventTypeSchema, PixelInitSchema, PixelInstallConfigSchema, PixelSchema, PixelSessionSchema, PixelStatsSchema, PixelTrackingRequestSchema, PixelTrackingResponseSchema, PixelUserIdentificationSchema, PixelVerificationStatusSchema, PixelsBulkCreateItemSchema, PixelsBulkDeleteItemSchema, PixelsBulkRegenerateItemSchema, PixelsBulkRequestSchema, PixelsBulkUpdateItemSchema, PixelsQuerySchema, PolicyConditionSchema, PolicyConfigSchema, PolicyEvaluationContextSchema, PolicyEvaluationResultSchema, PolicyFetcher, PolicyMatchTypeSchema, PolicyMetadataSchema, PolicyRuleSchema, ProjectIdSchema, ProjectSchema, ProjectSettingsSchema, ProjectsBulkCreateItemSchema, ProjectsBulkDeleteItemSchema, ProjectsBulkRequestSchema, ProjectsBulkUpdateItemSchema, ProjectsQuerySchema, ProtocolVersionSchema, ProviderDefinitionSchema2 as ProviderDefinitionSchema, ProvidersResponseSchema, ProvisionKeyRequestSchema, ProvisionKeyResponseSchema, ProvisioningModeSchema, ProvisioningOrganizationRoleSchema, ProvisioningOrganizationSummarySchema, PublicAnalyticsBotTypeSchema, PublicAnalyticsSchema, PublicAnalyticsSummarySchema, PublicAnalyticsTimeSeriesPointSchema, PublicApiHeadersSchema, PublicApiQueryParamsSchema, PublicApiResponseSchema, PublicDetectionSchema, PublicKeyConfigSchema, PaginationResponseSchema as PublicPaginationResponseSchema, PublicProjectSchema, PublishProfileRequestSchema, QueryFilterSchema, QuerySchema, RATE_LIMIT_ERRORS, REPORT_AI_AGENT_NAMES, REPORT_AI_CRAWLER_NAMES, RULE_CACHE, RULE_CATEGORIES, RULE_CDN, RULE_ERRORS, RULE_PATHS, RULE_VERSION, RealtimeEventSchema, RealtimeEventTypeSchema, ReasoningStepSchema, RecommendationGenerationSchema, RecommendationQuerySchema, RedirectTargetSchema, RedisSessionDataSchema, RedisStatsSchema, RefreshScopesRequestSchema, ReportedAgentSchema, ReportedDelegationSchema, ReportedIdentitySchema, ReportedPrincipalSchema, RequestContextSchema, ResourceUsageSchema, ResponseActionSchema, RetryStrategySchema, RevokeProvisionQuerySchema, RevokeProvisionResponseSchema, RiskAssessmentSchema, RuleLoadOptionsSchema, RuleLoader, RuleMatchResultSchema, RuleMetadataSchema, RuleParser, RuleUpdateEventSchema, RuleValidationResultSchema, RuleValidator, SECURITY_LIMITS, SERVICE_TRAFFIC_KEYS, SESSION_ERRORS, SESSION_LIMITS, SLUG_REGEX, SUSPICIOUS_HEADERS, SUSPICIOUS_PATTERNS, ScopeSchema, ScrollEventSchema, SdkSessionDataSchema, SessionConfigSchema, SessionCreateRequestSchema, SessionDataSchema, SessionEventSchema, SessionEventTypeSchema, SessionQueryOptionsSchema, SessionSchema, SessionStateSchema, SessionStorageTypeSchema, SessionTokenPayloadSchema, SessionUpdateRequestSchema, AgentTypeDistributionSchema as SharedAgentTypeDistributionSchema, ConfidenceDistributionSchema as SharedConfidenceDistributionSchema, ShopifyProjectProvisionRequestSchema, ShopifyProjectProvisionResultSchema, ShopifyProjectSettingsUpdateSchema, ShopifyStatsResponseSchema, ShopifyThreatSchema, SignatureAlgorithmSchema, SignatureRuleSchema, SignatureVerificationRequestSchema, SignatureVerificationResponseSchema, SingleItemResponseSchema, SsoLinkRequestSchema, SsoLinkResponseSchema, StaleVendorRangesError, StatsResponseSchema, StatsUpdateEventSchema, StrictEnforcementActionSchema, SuggestedActionSchema, SystemStatsSchema, TIME_WINDOWS, TLSFingerprintSchema, TRADITIONAL_BOT_PATTERNS, TRAFFIC_TAXONOMY_BUCKETS, TRUSTED_BOTS, TestDetectionRequestSchema, ThresholdConfigSchema, ToolConsentOverridesSchema, TouchEventSchema, TraceStepSchema, TransportConfigSchema, TransportMetricsSchema, TransportOptionsSchema, TransportResponseSchema, TransportStateSchema, UNCALIBRATED_NOISY_OR_PRIOR, UPDATE_FREQUENCIES, USER_AGENT_PATTERNS, UpdateApiKeySchema, UpdateBouncerConfigSchema, UpdateOrganizationInputSchema, UpdateOrganizationSchema, UpdatePixelSchema, UpdateProfileRequestSchema, UpdateProjectSchema, UpdateSettingsSchema, UserAgentRuleSchema, UserPlanSchema, UserSchema, VALIDATION_ERRORS, VALIDATION_MODES, VALIDATION_PATTERNS, VERDICT_COOKIE_NAME, VERSION, VerdictEvidenceSchema, VerificationCacheEntrySchema, VerificationProviderSchema, VerificationRequestSchema, VerificationResponseSchema, VerificationTokenSchema, WEBHOOK_LIMITS, WasmAgentNameSchema, AgentTypeSchema as WasmAgentTypeSchema, WasmConfigSchema, WasmDetectionResultSchema, WasmRequestMetadataSchema, WasmRiskLevel, WasmVerificationMethod, WorkerActionSchema, WorkerCapabilitiesSchema, WorkerConfigSchema, WorkerErrorSchema, WorkerErrorTypeSchema, WorkerHealthStatusSchema, WorkerMessageSchema, WorkerMessageTypeSchema, WorkerMetricsSchema, WorkerPoolConfigSchema, WorkerStateSchema, WorkerTaskSchema, acceptsHtml, adminOverviewQuerySchema, approvalQuorumForRequest, assertVendorRangesFresh, assignmentChangeRequestSchema, auditLogQuerySchema, base58btcDecode, base58btcEncode, batchAssignmentRequestSchema, bespokePolicyLabel, blockDelegationVerdict, blockEqualityLiterals, buildChallengeWire, buildDelegationBearerHeader, buildDelegationChallengeBody, buildDelegationChallengeEnvelope, buildDelegationChallengeHeader, buildDelegationInstructions, buildInitialStepsState, buildKnownPatternLookup, buildVerdictEvidence, calculateDeployProgress, cedarQuotedValueRegExp, changePasswordSchema, classifyAgentTaxonomy, classifyResponseShape, claudeRuntimeLabel, computeEntropyConfidence, createError, createErrorResponse, createEvaluationContext, createPaginatedResponse, createPaginatedResponseSchema, createPolicyFetcher, createPublicErrorResponse, createPublicPaginatedResponse, createPublicSuccessResponse, createSuccessResponse, createValidationErrorResponse, decisionPolicyId, decodeDidKeyEd25519, decodeEd25519PublicKeyMultibaseTolerant, defaultConfig, deriveCorrelationId, deriveDelegationPickupUri, deriveMcpClientDid, deriveMcpiOrgDid, deriveMcpiOrgKid, deriveMcpiUserDid, deriveVerdict, detectionClassToEnum, discoveredToolSchema, encodeDidKeyEd25519, encodeEd25519PublicKeyMultibase, encodeVerdictCookie, enumToDetectionClass, escapeCedarString, evaluatePolicy, extractCorrelationIdFromHeaders, extractMatch, fetchPolicy, findMatchingPattern, findStaleVendorRanges, forgotPasswordSchema, formatConfidence, fromProviderRegistryFormat, fromProviderRegistryFormatSafe, gatewayConfigInputSchema, gatewayConfigSchema, gatewayConnectedAgentSchema, gatewayConnectionsSummarySchema, gatewayInternalDiscoverErrorSchema, gatewayInternalDiscoverSuccessSchema, gatewayInternalToolsListSchema, gatewayToolCallSchema, generateDelegationSid, generateTestId, getAgentDisplayName, getBotType, getCategoryBadgeVariant, getCategoryColor, getConfidenceLevel, getDefaultPolicyFetcher, getEnvVar, getRateLimitWindow, getRemainingQuota, getStepInfo, getStepOrder, getVerificationMethodDescription, getVerificationReliability, getVerificationRiskLevel, hasPinnedSigningVendor, initializePolicyFetcher, isBespokePolicyId, isBlockingAction, isClaudeProductLabel, isForbidBlock, isHighConfidenceVerification, isKnownAgentType, isKnownAiCrawler, isKyaOsHandshakeMethod, isKyaOsWireMethod, isLegacyDetectionClass, isLegitimateCategory, isLimitExceeded, isNonNavigablePolicyId, isPassThroughAction, isPrivateOrReservedHost, isSupportedAuthType, isTraditionalBot, isUnnarrowedDenyBlock, isValidAuthorizationHost, isValidFingerprintResponse, isValidMcpiOrgSlug, isValidWasmDetectionResult, isValidWasmRequestMetadata, lintUnnarrowedDenyRules, loadRulesAsync, mapLegacyAuthType, mapToLegacyAuthType, matchPath, mergeWithDefaults, migrateLegacyDetectionClass, nonNavigablePolicyLabel, normalizeAgentName, normalizeConfidence, normalizeDetectionClass, normalizeDetectionClassEnum, normalizeHandshakeMethod, normalizeOrganizationName, normalizeWireMethod, oauthClientSchema, parseAgentName, parseEvaluationContext, parseJafarFeed, parsePolicyConfig, parseRules, partial, passwordSchema, pathHasUnnarrowedDenyRule, pathLiteralsInBlock, permitDelegationVerdict, projectResetRequestSchema, reconstructConfidenceFromEvidence, refineClaudeDisplayLabel, requestCarriesDelegationProof, requiredScopesForRequest, resetPasswordSchema, resetPolicyFetcher, resolveAuthorizationHost, resolveChallengeContext, resolveTrustedDelegationRoots, safeParsePolicyConfig, safeUrl, selectBodyReadable200, serveBodyReadable200, signInSchema, signUpSchema, splitCedarBlocks, strict, supportsClientSide, supportsHeaders, supportsServerEnhanced, testPattern, testPatterns, toBareHost, toCoarseReasonKind, toPercent, toProviderRegistryFormat, toStoredCorrelationId, toWasmRequestMetadata, unescapeCedarString, updateStepsState, upstreamDiscoveryErrorSchema, upstreamServerInputSchema, upstreamServerSchema, validate, validateClientDetection, validateFingerprintRequest, validateOrThrow, validateOrganizationName, validateRules, validateRulesLoose, validateStepUpQuorum, vaultResolveDataSchema, vaultResolveErrorSchema, vaultResolveMetaSchema, vaultResolveResponseSchema, vaultResolveSuccessSchema, verifyEmailSchema, wasmToDetectionResult };
16500
+ export { ACCEPT_CHALLENGE_HEADER, ADMIN_DELTA_BASES, ADMIN_OVERVIEW_CACHE_STATUSES, ADMIN_OVERVIEW_LIST_LIMIT_DEFAULT, ADMIN_OVERVIEW_LIST_LIMIT_MAX, ADMIN_OVERVIEW_SECTIONS, ADMIN_OVERVIEW_WINDOWS, AGENT_CATEGORY_META, AI_AGENT_HEADERS, ANONYMOUS_PRINCIPAL_DID, API_ERRORS, API_ERROR_CODES, API_REQUEST_LIMITS, ATTESTED_BEARER_MAX_TTL_SECONDS, AUTHORIZATION_MODES, AUTH_ERRORS, AUTH_ERROR_MESSAGES, AccountSchema, AddFingerprintToProfileRequestSchema, AddUpdateProviderRequestSchema, AdminQueryParamsSchema, AgentCategorySchema, AgentClassificationRequestSchema, AgentClassificationResultSchema, AgentClassificationSchema, AgentInfoSchema, AgentPatternSchema, AgentProfileSchema, AgentShieldConfigSchema, AgentSourceDistributionSchema, AgentStatisticsSchema, AgentTypeDefinitionSchema, AgentTypeSchema, AggregationTypeSchema, AllowListEntrySchema, AnalyticsAgentSourcesQuerySchema, AnalyticsAgentTypesQuerySchema, AnalyticsChartDataSchema, AnalyticsDataPointSchema, AnalyticsExportParamsSchema, AnalyticsExportQuerySchema, AnalyticsQuerySchema2 as AnalyticsQuerySchema, AnalyticsRealtimeQuerySchema, AnalyticsSessionsQuerySchema, AnalyticsSessionsResponseSchema, AnalyticsSummarySchema2 as AnalyticsSessionsSummarySchema, AnalyticsSummarySchema, AnalyticsTimeSeriesSchema, AnalyticsTimeWindowSchema, ApiKeyPermissionSchema, ApiKeyRateLimitsSchema, ApiKeySchema, ApiKeysBulkCreateItemSchema, ApiKeysBulkRequestSchema, ApiKeysBulkRevokeItemSchema, ApiKeysBulkUpdateItemSchema, ApiKeysQuerySchema, ApiResponseSchema, AssuranceTierSchema, AuthErrorType, AuthProviderTypeSchema, BARE_ERRORS, BASELINE_ALLOW_POLICY_ID, BESPOKE_POLICY_IDS, BILLING_ERRORS, BLOCKED_PATH, BOT_USER_AGENT_PATTERNS, BROWSER_PATTERNS, BULK_ERROR_CODES, BaseAuthProviderSchema, BaseBulkRequestSchema, BatchDetectionRequestSchema, BatchDetectionResponseSchema, BatchEventRequestSchema, BatchEventResponseSchema, BatchEventSchema, BatchPixelEventRequestSchema, BehavioralAnalysisSchema, BehavioralDataSchema, BehavioralPatternSchema, BehavioralRulesSchema, BehavioralSignalsSchema, BehavioralThresholdSchema, BlockEventSchema, BlockReasonSchema, BotPatternSchema2 as BotPatternSchema, BotTypeSchema, BouncerConfigSchema, BouncerOutcomeSchema, BouncerProofSchema, BrowserInfoSchema, BulkDeletePreviewStatsSchema, BulkDeleteResponseSchema, BulkOperationOptionsSchema, BulkOperationParamsSchema, BulkOperationResultSchema, BulkOperationTypeSchema, BulkResponseSchema, BulkResultItemSchema, CACHE_LIMITS, CACHE_TTL, CLOUD_PROVIDER_RANGES, CONDITION_FIELDS, CONDITION_OPERATORS, CONFIDENCE_THRESHOLDS, CORRELATION_ID_HEADER, CRISPBudgetSchema, CURRENT_POLICY_VERSION, CacheConfigSchema, CachedDetectionDataSchema, ChallengeParamsSchema, ChallengeWireError, CircuitBreakerConfigSchema, CircuitBreakerStateSchema, ClickEventSchema, ClientDetectionSchema, CollectFingerprintRequestSchema, CollectFingerprintResponseSchema, CollectedDataSchema, ConditionFieldSchema, ConditionOperatorSchema, ConditionValueSchema, ConfidenceBreakdownSchema, ConfidenceLevelSchema, ConfidenceThresholdSchema, ConfidenceUtils, ConfiguredProviderSchema, ConsentAgentMetadataSchema, ConsentBrandingSchema, ConsentCapabilityGroupSchema, ConsentCapabilitySchema, ConsentConfigMetadataSchema, ConsentConfigSchema, ConsentTermsSchema, ConsentUISchema, CorrelationIdSchema, CreateApiKeySchema, CreateOrganizationInputSchema, CreateOrganizationSchema, CreatePixelSchema, CreateProfileRequestSchema, CreateProjectSchema, CreateProvisioningOrganizationRequestSchema, CreateProvisioningOrganizationResponseSchema, CredentialProviderSchema, CustomRuleSchema, DATABASE_LIMITS, DEFAULT_ADMIN_OVERVIEW_WINDOW, DEFAULT_AGENTSHIELD_CONFIG, DEFAULT_AGENT_TYPES, DEFAULT_API_KEY_RATE_LIMITS, DEFAULT_AUTHORIZATION_HOST, DEFAULT_BEHAVIORAL_THRESHOLDS, DEFAULT_CACHE_CONFIG, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, DEFAULT_CONFIDENCE_THRESHOLDS, DEFAULT_CORS_CONFIG, DEFAULT_DETECTION_OPTIONS, DEFAULT_ENV_VARS, DEFAULT_LOG_CONFIG, DEFAULT_MAX_VENDOR_RANGE_AGE_MS, DEFAULT_PASSWORD_REQUIREMENTS, DEFAULT_PIXEL_CONFIG, DEFAULT_POLICY, DEFAULT_PROJECT_SETTINGS, DEFAULT_RESPONSE_HEADERS, DEFAULT_RETRY_CONFIG, DEFAULT_RULE_PRIORITY, DEFAULT_SESSION_CONFIG, DEFAULT_THRESHOLDS, DEFAULT_TIMEOUTS, DEFAULT_WEBHOOK_EVENTS, DELEGATION_PROOF_HEADERS, DEPLOY_STEPS, DETECTION_ERRORS, DETECTION_LIMITS, DETECTION_REASON_CODES, DashboardStatsRequestSchema, DatabaseDetectionMetadataSchema, DatabaseStatusSchema, DecisionSchema, DelegationPollingStatusSchema, DelegationResultSchema, DelegationSchema, DelegationStatusSchema, DelegationVerifiedBySchema, DeleteAccountSchema, DenyListEntrySchema, DeployProgressEventSchema, DeployStepIdSchema, DeployStepStateSchema, DeployStepStatusSchema, DeploymentMetadataSchema, DetectionClassSchema, DetectionDetailSchema, DetectionErrorDetailsSchema, DetectionEventSchema, DetectionInputSchema, DetectionLogSchema, DetectionMetadataSchema, DetectionModeSchema, DetectionOptionsSchema, DetectionReasonCodeSchema, DetectionReasoningSchema, DetectionRequestSchema, DetectionResponseSchema, DetectionResultSchema, DetectionRuleSchema, DetectionRulesSchema, DetectionSignalExposureSchema, DetectionSignalSchema, DetectionStatusSchema, DetectionTestResultSchema, DetectionViewTypeSchema, ENFORCEMENT_ACTIONS, ENFORCEMENT_MODES, ENTROPY_CONFIDENCE_CEILING, ENTROPY_CONFIDENCE_FLOOR, ERROR_CATEGORIES, ERROR_CODES, ERROR_MESSAGES, ERROR_STATUS_CODES, EXCLUSION_BUCKETS, EXPORT_LIMITS, EnforcementActionSchema, EnforcementModeSchema, EngineInfoSchema, EnhancedFingerprintResponseSchema, ErrorResponseSchema, EventConfigSchema, EventStorageRecordSchema, EventTrackingRequestSchema, EventTrackingResponseSchema, ExportAnalyticsSchema, ExpressMiddlewareOptionsSchema, FallbackOptionsSchema, FilterOperatorSchema, FingerprintAnalysisSchema, ClientDetectionSchema2 as FingerprintClientDetectionSchema, FingerprintDetectRequestSchema, FingerprintRecordSchema, FingerprintResponseSchema, FingerprintSearchQuerySchema, ForgeabilityRiskSchema, GrowthBatchRequestSchema, GrowthConfigurationResetSchema, GrowthConfigurationThresholdsSchema, GrowthConfigurationUpdateSchema, GrowthOpportunitiesQuerySchema, GrowthOpportunityUpdateSchema, HEADER_PATTERNS, HTTP_STATUS, HeaderRuleSchema, HeaderRulesSchema, HealthResponseSchema, HomeRailRollupsRequestSchema, INSTALLATION_KINDS, INSTALLATION_TYPES, INTERNAL_ERRORS, InstructPayloadSchema, IntegrationTypeSchema, InternalProcessingFlagsSchema, IpRangeCollectionSchema, IpRangeRuleSchema, JafarParseError, KNOWN_AGENT_PATTERNS, KYA_HTTP_ERROR, KYA_OS_HANDSHAKE_METHODS, KYA_OS_WIRE_METHODS, KeyboardEventSchema, LOWERCASE_ERRORS, ListProvisioningOrganizationsRequestSchema, ListProvisioningOrganizationsResponseSchema, LoggingConfigSchema, MATCH_ACTIONS, MAX_BULK_BATCH_SIZE, MAX_ED25519_KEY_BODY_LENGTH, MAX_REASON_CODES_HEADER_BYTES, MAX_REASON_CODES_ON_WIRE, MCPI_ORG_DID_HOST, MCP_CLIENT_DID_HOST, MOBILE_PATTERNS, MarketplaceSourceSchema, MessagePrioritySchema, MiddlewareActionSchema, MiddlewareConfigSchema, MiddlewareSessionConfigSchema, MiddlewareSessionDataSchema, MigrationStatusSchema, MouseEventSchema, NETWORK_ERRORS, NetworkConfigSchema, NetworkInfoSchema, NetworkTimingSchema, NextMiddlewareOptionsSchema, OAuth2ProviderSchema, OAuthConnectionStatusSchema, OAuthModeSchema, OAuthProviderMetadataSchema, OAuthProviderTypeSchema, OAuthProvidersMapSchema, OAuthTokensResponseSchema, OS_PATTERNS, OfflineQueueEntrySchema, OrganizationErrorCode, OrganizationIdSchema, OrganizationRoleSchema, OrganizationSettingsSchema, OrganizationSsoModeSchema, OrganizationSsoProviderSchema, OrganizationSsoSettingsSchema, PACKAGE_NAME, PAGINATION_DEFAULTS, PERFORMANCE_THRESHOLDS, PERMISSION_ERRORS, PINNED_SIGNING_VENDORS, PIXEL_ERRORS, PIXEL_EVENT_LIMITS, PLAN_FEATURE_LIMITS, PLAN_RATE_LIMITS, POLICY_ERRORS, POLICY_MATCH_TYPES, PUBLIC_API_ERROR_CODES, PageContextSchema, PaginatedResponseSchema, PaginationInfoSchema, PaginationParamsSchema, PaginationResponseSchema, PatternUpdateRequestSchema, PerformanceRecalculationRequestSchema, PixelAnalyticsSchema, PixelConfigurationSchema, PixelEventSchema, PixelEventTypeSchema, PixelInitSchema, PixelInstallConfigSchema, PixelSchema, PixelSessionSchema, PixelStatsSchema, PixelTrackingRequestSchema, PixelTrackingResponseSchema, PixelUserIdentificationSchema, PixelVerificationStatusSchema, PixelsBulkCreateItemSchema, PixelsBulkDeleteItemSchema, PixelsBulkRegenerateItemSchema, PixelsBulkRequestSchema, PixelsBulkUpdateItemSchema, PixelsQuerySchema, PolicyConditionSchema, PolicyConfigSchema, PolicyEvaluationContextSchema, PolicyEvaluationResultSchema, PolicyFetcher, PolicyMatchTypeSchema, PolicyMetadataSchema, PolicyRuleSchema, ProjectIdSchema, ProjectSchema, ProjectSettingsSchema, ProjectsBulkCreateItemSchema, ProjectsBulkDeleteItemSchema, ProjectsBulkRequestSchema, ProjectsBulkUpdateItemSchema, ProjectsQuerySchema, ProtocolVersionSchema, ProviderDefinitionSchema2 as ProviderDefinitionSchema, ProvidersResponseSchema, ProvisionKeyRequestSchema, ProvisionKeyResponseSchema, ProvisioningModeSchema, ProvisioningOrganizationRoleSchema, ProvisioningOrganizationSummarySchema, PublicAnalyticsBotTypeSchema, PublicAnalyticsSchema, PublicAnalyticsSummarySchema, PublicAnalyticsTimeSeriesPointSchema, PublicApiHeadersSchema, PublicApiQueryParamsSchema, PublicApiResponseSchema, PublicDetectionSchema, PublicKeyConfigSchema, PaginationResponseSchema as PublicPaginationResponseSchema, PublicProjectSchema, PublishProfileRequestSchema, QueryFilterSchema, QuerySchema, RATE_LIMIT_ERRORS, REGISTERED_SID_MAX_LENGTH, REPORT_AI_AGENT_NAMES, REPORT_AI_CRAWLER_NAMES, RESOURCE_ERRORS, RULE_CACHE, RULE_CATEGORIES, RULE_CDN, RULE_ERRORS, RULE_PATHS, RULE_VERSION, RealtimeEventSchema, RealtimeEventTypeSchema, ReasoningStepSchema, RecommendationGenerationSchema, RecommendationQuerySchema, RedirectTargetSchema, RedisSessionDataSchema, RedisStatsSchema, RefreshScopesRequestSchema, ReportedAgentSchema, ReportedDelegationSchema, ReportedIdentitySchema, ReportedPrincipalSchema, RequestContextSchema, ResourceUsageSchema, ResponseActionSchema, RetryStrategySchema, RevokeProvisionQuerySchema, RevokeProvisionResponseSchema, RiskAssessmentSchema, RuleLoadOptionsSchema, RuleLoader, RuleMatchResultSchema, RuleMetadataSchema, RuleParser, RuleUpdateEventSchema, RuleValidationResultSchema, RuleValidator, SECURITY_LIMITS, SERVICE_TRAFFIC_KEYS, SESSION_ERRORS, SESSION_LIMITS, SID_ATTRIBUTABLE_RESULT, SLUG_REGEX, SUSPICIOUS_HEADERS, SUSPICIOUS_PATTERNS, ScopeSchema, ScrollEventSchema, SdkSessionDataSchema, SessionConfigSchema, SessionCreateRequestSchema, SessionDataSchema, SessionEventSchema, SessionEventTypeSchema, SessionQueryOptionsSchema, SessionSchema, SessionStateSchema, SessionStorageTypeSchema, SessionTokenPayloadSchema, SessionUpdateRequestSchema, AgentTypeDistributionSchema as SharedAgentTypeDistributionSchema, ConfidenceDistributionSchema as SharedConfidenceDistributionSchema, ShopifyProjectProvisionRequestSchema, ShopifyProjectProvisionResultSchema, ShopifyProjectSettingsUpdateSchema, ShopifyStatsResponseSchema, ShopifyThreatSchema, SignatureAlgorithmSchema, SignatureRuleSchema, SignatureVerificationRequestSchema, SignatureVerificationResponseSchema, SingleItemResponseSchema, SsoLinkRequestSchema, SsoLinkResponseSchema, StaleVendorRangesError, StatsResponseSchema, StatsUpdateEventSchema, StrictEnforcementActionSchema, SuggestedActionSchema, SystemStatsSchema, TIME_WINDOWS, TLSFingerprintSchema, TRADITIONAL_BOT_PATTERNS, TRAFFIC_TAXONOMY_BUCKETS, TRUSTED_BOTS, TestDetectionRequestSchema, ThresholdConfigSchema, ToolConsentOverridesSchema, TouchEventSchema, TraceStepSchema, TransportConfigSchema, TransportMetricsSchema, TransportOptionsSchema, TransportResponseSchema, TransportStateSchema, UNCALIBRATED_NOISY_OR_PRIOR, UNNAMED_AGENT_LABEL, UPDATE_FREQUENCIES, USER_AGENT_PATTERNS, UpdateApiKeySchema, UpdateBouncerConfigSchema, UpdateOrganizationInputSchema, UpdateOrganizationSchema, UpdatePixelSchema, UpdateProfileRequestSchema, UpdateProjectSchema, UpdateSettingsSchema, UserAgentRuleSchema, UserPlanSchema, UserSchema, VALIDATION_ERRORS, VALIDATION_MODES, VALIDATION_PATTERNS, VERDICT_COOKIE_NAME, VERSION, VerdictEvidenceSchema, VerificationCacheEntrySchema, VerificationProviderSchema, VerificationRequestSchema, VerificationResponseSchema, VerificationTokenSchema, WEBHOOK_LIMITS, WasmAgentNameSchema, AgentTypeSchema as WasmAgentTypeSchema, WasmConfigSchema, WasmDetectionResultSchema, WasmRequestMetadataSchema, WasmRiskLevel, WasmVerificationMethod, WorkerActionSchema, WorkerCapabilitiesSchema, WorkerConfigSchema, WorkerErrorSchema, WorkerErrorTypeSchema, WorkerHealthStatusSchema, WorkerMessageSchema, WorkerMessageTypeSchema, WorkerMetricsSchema, WorkerPoolConfigSchema, WorkerStateSchema, WorkerTaskSchema, acceptsHtml, adminOverviewQuerySchema, approvalQuorumForRequest, assertVendorRangesFresh, assignmentChangeRequestSchema, auditLogQuerySchema, base58btcDecode, base58btcEncode, batchAssignmentRequestSchema, bespokePolicyLabel, blockDelegationVerdict, blockEqualityLiterals, buildChallengeWire, buildDelegationBearerHeader, buildDelegationChallengeBody, buildDelegationChallengeEnvelope, buildDelegationChallengeHeader, buildDelegationInstructions, buildInitialStepsState, buildKnownPatternLookup, buildVerdictEvidence, calculateDeployProgress, cedarQuotedValueRegExp, changePasswordSchema, classifyAgentTaxonomy, classifyResponseShape, claudeRuntimeLabel, computeEntropyConfidence, createError, createErrorResponse, createEvaluationContext, createPaginatedResponse, createPaginatedResponseSchema, createPolicyFetcher, createPublicErrorResponse, createPublicPaginatedResponse, createPublicSuccessResponse, createSuccessResponse, createValidationErrorResponse, decisionPolicyId, decodeDidKeyEd25519, decodeEd25519PublicKeyMultibaseTolerant, defaultConfig, deriveCorrelationId, deriveDelegationPickupUri, deriveMcpClientDid, deriveMcpiOrgDid, deriveMcpiOrgKid, deriveMcpiUserDid, deriveVerdict, detectionClassToEnum, discoveredToolSchema, encodeDidKeyEd25519, encodeEd25519PublicKeyMultibase, encodeVerdictCookie, enumToDetectionClass, escapeCedarString, evaluatePolicy, extractCorrelationIdFromHeaders, extractMatch, fetchPolicy, findMatchingPattern, findStaleVendorRanges, forgotPasswordSchema, formatAgentCategory, formatAgentCategoryInline, formatConfidence, formatReasonCodesHeader, fromProviderRegistryFormat, fromProviderRegistryFormatSafe, gatewayConfigInputSchema, gatewayConfigSchema, gatewayConnectedAgentSchema, gatewayConnectionsSummarySchema, gatewayInternalDiscoverErrorSchema, gatewayInternalDiscoverSuccessSchema, gatewayInternalToolsListSchema, gatewayToolCallSchema, generateDelegationSid, generateTestId, getAgentDisplayName, getBotType, getCategoryBadgeVariant, getCategoryColor, getConfidenceLevel, getDefaultPolicyFetcher, getEnvVar, getRateLimitWindow, getRemainingQuota, getStepInfo, getStepOrder, getVerificationMethodDescription, getVerificationReliability, getVerificationRiskLevel, hasClaudeCodeToken, hasClaudeSearchBotToken, hasClaudeUserToken, hasPinnedSigningVendor, initializePolicyFetcher, isBespokePolicyId, isBlockingAction, isClaudeProductLabel, isForbidBlock, isHighConfidenceVerification, isKnownAgentType, isKnownAiCrawler, isKyaOsHandshakeMethod, isKyaOsWireMethod, isLegacyDetectionClass, isLegitimateCategory, isLimitExceeded, isNonNavigablePolicyId, isPassThroughAction, isPrivateOrReservedHost, isSupportedAuthType, isTraditionalBot, isUnnarrowedDenyBlock, isValidAuthorizationHost, isValidFingerprintResponse, isValidMcpiOrgSlug, isValidWasmDetectionResult, isValidWasmRequestMetadata, lintUnnarrowedDenyRules, loadRulesAsync, mapDetectionToReasonCodes, mapLegacyAuthType, mapToLegacyAuthType, matchPath, mergeWithDefaults, migrateLegacyDetectionClass, nonNavigablePolicyLabel, normalizeAgentName, normalizeClientIp, normalizeConfidence, normalizeDetectionClass, normalizeDetectionClassEnum, normalizeHandshakeMethod, normalizeOrganizationName, normalizeWireMethod, oauthClientSchema, parseAgentName, parseEvaluationContext, parseJafarFeed, parsePolicyConfig, parseRules, partial, passwordSchema, pathHasUnnarrowedDenyRule, pathLiteralsInBlock, permitDelegationVerdict, projectResetRequestSchema, reconstructConfidenceFromEvidence, refineClaudeDisplayLabel, refineSessionGrainClaudeLabel, requestCarriesDelegationProof, requiredScopesForRequest, resetPasswordSchema, resetPolicyFetcher, resolveAuthorizationHost, resolveChallengeContext, resolveClientIp, resolveTrustedDelegationRoots, safeParsePolicyConfig, safeUrl, selectBodyReadable200, serveBodyReadable200, signInSchema, signUpSchema, splitCedarBlocks, strict, supportsClientSide, supportsHeaders, supportsServerEnhanced, testPattern, testPatterns, toBareHost, toCoarseReasonKind, toPercent, toProviderRegistryFormat, toStoredCorrelationId, toWasmRequestMetadata, unescapeCedarString, updateStepsState, upstreamDiscoveryErrorSchema, upstreamServerInputSchema, upstreamServerSchema, validate, validateClientDetection, validateFingerprintRequest, validateOrThrow, validateOrganizationName, validateRules, validateRulesLoose, validateStepUpQuorum, vaultResolveDataSchema, vaultResolveErrorSchema, vaultResolveMetaSchema, vaultResolveResponseSchema, vaultResolveSuccessSchema, verifyEmailSchema, wasmToDetectionResult };