@kodycodes/cli 3.46.1 → 3.46.3

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 (75) hide show
  1. package/dist/{auth-6YVS765B.js → auth-Q6TDDWB2.js} +4 -4
  2. package/dist/bin.js +5 -5
  3. package/dist/capability-proxy.d.ts +2 -0
  4. package/dist/{chunk-2OMFUIFM.js → chunk-2G3YXYZ4.js} +2 -2
  5. package/dist/{chunk-2PJZFZB4.js → chunk-3YQOVS3N.js} +13 -6
  6. package/dist/{chunk-2PJZFZB4.js.map → chunk-3YQOVS3N.js.map} +1 -1
  7. package/dist/{chunk-C4GIPPQ6.js → chunk-5LC5QQ67.js} +6 -6
  8. package/dist/{chunk-L6VBRGS6.js → chunk-6HPU7SMS.js} +22 -2
  9. package/dist/chunk-6HPU7SMS.js.map +6 -0
  10. package/dist/{chunk-YFE7AQ4A.js → chunk-BYZB4U4P.js} +4 -4
  11. package/dist/{chunk-ZADDFBAP.js → chunk-EJOF2MYU.js} +2 -2
  12. package/dist/{chunk-YZLBZLOI.js → chunk-HQ6Q5IU6.js} +49 -50
  13. package/dist/chunk-HQ6Q5IU6.js.map +6 -0
  14. package/dist/{chunk-BYPUQBDP.js → chunk-MWC6FYWF.js} +3 -3
  15. package/dist/{chunk-HPFMVYSE.js → chunk-OBK4CIB2.js} +2 -2
  16. package/dist/{chunk-ZOF46RPD.js → chunk-Q7XRVWKZ.js} +3 -3
  17. package/dist/{chunk-HYL2OFVE.js → chunk-VX2KDCQF.js} +3 -3
  18. package/dist/{chunk-MYAA4EUX.js → chunk-XSRTFMCF.js} +2 -2
  19. package/dist/{chunk-QCIN3KQT.js → chunk-ZER4SBOV.js} +5 -5
  20. package/dist/{chunk-SRHOJETK.js → chunk-ZIL2JPJC.js} +2 -2
  21. package/dist/cli.js +5 -5
  22. package/dist/{commands-7VKD36R4.js → commands-LHAEANQD.js} +2 -2
  23. package/dist/credential-call-map.d.ts +3 -0
  24. package/dist/{dev-command-W3G4XFCI.js → dev-command-FJ3UVYU3.js} +9 -9
  25. package/dist/{execute-local-package-IY5GFYAX.js → execute-local-package-PVPTFQFM.js} +9 -9
  26. package/dist/{git-credential-5GEHTTH2.js → git-credential-BL7KCA76.js} +5 -5
  27. package/dist/{local-execute-WNLIXCWZ.js → local-execute-AQEAOJXS.js} +13 -10
  28. package/dist/local-execute-AQEAOJXS.js.map +6 -0
  29. package/dist/local-gateway-fetch-forward.d.ts +2 -0
  30. package/dist/{local-kody-IO7UOYO6.js → local-kody-BJ7OORPF.js} +6 -6
  31. package/dist/{local-package-graph-JH4L7OF3.js → local-package-graph-7A4ZQBXJ.js} +3 -3
  32. package/dist/{local-package-run-XQZPNN2V.js → local-package-run-GP4WFMDG.js} +7 -7
  33. package/dist/local-package-secret-write.d.ts +5 -2
  34. package/dist/{local-secrets-N272AT7P.js → local-secrets-2S7KJ6EI.js} +3 -3
  35. package/dist/{mock-dep-resolve-VA4P5AOO.js → mock-dep-resolve-ACHQAI36.js} +2 -2
  36. package/dist/{mock-local-deps-4FWQ2M2T.js → mock-local-deps-43QBYHHF.js} +4 -4
  37. package/dist/{open-api-client-2WF6OBN3.js → open-api-client-Z3LIDWQ2.js} +3 -3
  38. package/dist/{package-run-6QLZSYSK.js → package-run-E34M5ERO.js} +3 -3
  39. package/dist/publish-builder.js +930 -214
  40. package/dist/{remote-execute-W5VKF2UH.js → remote-execute-CINWGFKJ.js} +4 -4
  41. package/dist/{run-executor-XWWOYYVC.js → run-executor-66E7F2CW.js} +2 -2
  42. package/dist/{setup-git-Q73BJOGI.js → setup-git-P5HLZX3R.js} +4 -4
  43. package/dist/{whoami-CC7O3IEO.js → whoami-EU7HSV45.js} +3 -3
  44. package/package.json +1 -1
  45. package/dist/chunk-L6VBRGS6.js.map +0 -6
  46. package/dist/chunk-YZLBZLOI.js.map +0 -6
  47. package/dist/local-execute-WNLIXCWZ.js.map +0 -6
  48. /package/dist/{auth-6YVS765B.js.map → auth-Q6TDDWB2.js.map} +0 -0
  49. /package/dist/{chunk-2OMFUIFM.js.map → chunk-2G3YXYZ4.js.map} +0 -0
  50. /package/dist/{chunk-C4GIPPQ6.js.map → chunk-5LC5QQ67.js.map} +0 -0
  51. /package/dist/{chunk-YFE7AQ4A.js.map → chunk-BYZB4U4P.js.map} +0 -0
  52. /package/dist/{chunk-ZADDFBAP.js.map → chunk-EJOF2MYU.js.map} +0 -0
  53. /package/dist/{chunk-BYPUQBDP.js.map → chunk-MWC6FYWF.js.map} +0 -0
  54. /package/dist/{chunk-HPFMVYSE.js.map → chunk-OBK4CIB2.js.map} +0 -0
  55. /package/dist/{chunk-ZOF46RPD.js.map → chunk-Q7XRVWKZ.js.map} +0 -0
  56. /package/dist/{chunk-HYL2OFVE.js.map → chunk-VX2KDCQF.js.map} +0 -0
  57. /package/dist/{chunk-MYAA4EUX.js.map → chunk-XSRTFMCF.js.map} +0 -0
  58. /package/dist/{chunk-QCIN3KQT.js.map → chunk-ZER4SBOV.js.map} +0 -0
  59. /package/dist/{chunk-SRHOJETK.js.map → chunk-ZIL2JPJC.js.map} +0 -0
  60. /package/dist/{commands-7VKD36R4.js.map → commands-LHAEANQD.js.map} +0 -0
  61. /package/dist/{dev-command-W3G4XFCI.js.map → dev-command-FJ3UVYU3.js.map} +0 -0
  62. /package/dist/{execute-local-package-IY5GFYAX.js.map → execute-local-package-PVPTFQFM.js.map} +0 -0
  63. /package/dist/{git-credential-5GEHTTH2.js.map → git-credential-BL7KCA76.js.map} +0 -0
  64. /package/dist/{local-kody-IO7UOYO6.js.map → local-kody-BJ7OORPF.js.map} +0 -0
  65. /package/dist/{local-package-graph-JH4L7OF3.js.map → local-package-graph-7A4ZQBXJ.js.map} +0 -0
  66. /package/dist/{local-package-run-XQZPNN2V.js.map → local-package-run-GP4WFMDG.js.map} +0 -0
  67. /package/dist/{local-secrets-N272AT7P.js.map → local-secrets-2S7KJ6EI.js.map} +0 -0
  68. /package/dist/{mock-dep-resolve-VA4P5AOO.js.map → mock-dep-resolve-ACHQAI36.js.map} +0 -0
  69. /package/dist/{mock-local-deps-4FWQ2M2T.js.map → mock-local-deps-43QBYHHF.js.map} +0 -0
  70. /package/dist/{open-api-client-2WF6OBN3.js.map → open-api-client-Z3LIDWQ2.js.map} +0 -0
  71. /package/dist/{package-run-6QLZSYSK.js.map → package-run-E34M5ERO.js.map} +0 -0
  72. /package/dist/{remote-execute-W5VKF2UH.js.map → remote-execute-CINWGFKJ.js.map} +0 -0
  73. /package/dist/{run-executor-XWWOYYVC.js.map → run-executor-66E7F2CW.js.map} +0 -0
  74. /package/dist/{setup-git-Q73BJOGI.js.map → setup-git-P5HLZX3R.js.map} +0 -0
  75. /package/dist/{whoami-CC7O3IEO.js.map → whoami-EU7HSV45.js.map} +0 -0
@@ -848,11 +848,11 @@ var init_package_app_host_label = __esm({
848
848
  });
849
849
 
850
850
  // ../shared/src/package-app-host-paths.ts
851
- function isPackageAppHostProbeFirstSegment(segment) {
852
- return packageAppHostProbeFirstSegments.has(segment.trim().toLowerCase());
851
+ function isPackageAppHostProbeFirstSegment(segment2) {
852
+ return packageAppHostProbeFirstSegments.has(segment2.trim().toLowerCase());
853
853
  }
854
- function isPackageAppHostReservedFirstSegment(segment) {
855
- return packageAppHostReservedFirstSegments.has(segment.trim().toLowerCase());
854
+ function isPackageAppHostReservedFirstSegment(segment2) {
855
+ return packageAppHostReservedFirstSegments.has(segment2.trim().toLowerCase());
856
856
  }
857
857
  function isPackageAppHostReservedPackageLeaf(leaf) {
858
858
  const normalized = leaf.trim().toLowerCase();
@@ -2180,18 +2180,18 @@ var init_parse = __esm({
2180
2180
  return result.issues.length === 0;
2181
2181
  };
2182
2182
  _encode = (_Err) => {
2183
- const parse9 = _parse(_Err);
2183
+ const parse10 = _parse(_Err);
2184
2184
  const fn = (schema, value, _ctx, _params) => {
2185
2185
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
2186
- return parse9(schema, value, ctx, finalizeParams(fn, _params));
2186
+ return parse10(schema, value, ctx, finalizeParams(fn, _params));
2187
2187
  };
2188
2188
  return fn;
2189
2189
  };
2190
2190
  encode = /* @__PURE__ */ _encode($ZodRealError);
2191
2191
  _decode = (_Err) => {
2192
- const parse9 = _parse(_Err);
2192
+ const parse10 = _parse(_Err);
2193
2193
  const fn = (schema, value, _ctx, _params) => {
2194
- return parse9(schema, value, _ctx, finalizeParams(fn, _params));
2194
+ return parse10(schema, value, _ctx, finalizeParams(fn, _params));
2195
2195
  };
2196
2196
  return fn;
2197
2197
  };
@@ -2445,13 +2445,13 @@ var init_checks = __esm({
2445
2445
  };
2446
2446
  $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
2447
2447
  $ZodCheck.init(inst, def);
2448
- const origin = numericOriginMap[typeof def.value];
2448
+ const origin2 = numericOriginMap[typeof def.value];
2449
2449
  inst._zod.check = (payload) => {
2450
2450
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
2451
2451
  return;
2452
2452
  }
2453
2453
  payload.issues.push({
2454
- origin: numericOriginMap[typeof payload.value] ?? origin,
2454
+ origin: numericOriginMap[typeof payload.value] ?? origin2,
2455
2455
  code: "too_big",
2456
2456
  maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
2457
2457
  input: payload.value,
@@ -2463,13 +2463,13 @@ var init_checks = __esm({
2463
2463
  });
2464
2464
  $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
2465
2465
  $ZodCheck.init(inst, def);
2466
- const origin = numericOriginMap[typeof def.value];
2466
+ const origin2 = numericOriginMap[typeof def.value];
2467
2467
  inst._zod.check = (payload) => {
2468
2468
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
2469
2469
  return;
2470
2470
  }
2471
2471
  payload.issues.push({
2472
- origin: numericOriginMap[typeof payload.value] ?? origin,
2472
+ origin: numericOriginMap[typeof payload.value] ?? origin2,
2473
2473
  code: "too_small",
2474
2474
  minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
2475
2475
  input: payload.value,
@@ -2504,14 +2504,14 @@ var init_checks = __esm({
2504
2504
  $ZodCheck.init(inst, def);
2505
2505
  def.format = def.format || "float64";
2506
2506
  const isInt = def.format?.includes("int");
2507
- const origin = isInt ? "int" : "number";
2507
+ const origin2 = isInt ? "int" : "number";
2508
2508
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
2509
2509
  inst._zod.check = (payload) => {
2510
2510
  const input3 = payload.value;
2511
2511
  if (isInt) {
2512
2512
  if (!Number.isInteger(input3)) {
2513
2513
  payload.issues.push({
2514
- expected: origin,
2514
+ expected: origin2,
2515
2515
  format: def.format,
2516
2516
  code: "invalid_type",
2517
2517
  continue: false,
@@ -2528,7 +2528,7 @@ var init_checks = __esm({
2528
2528
  maximum: Number.MAX_SAFE_INTEGER,
2529
2529
  note: "Integers must be within the safe integer range.",
2530
2530
  inst,
2531
- origin,
2531
+ origin: origin2,
2532
2532
  inclusive: true,
2533
2533
  continue: !def.abort
2534
2534
  });
@@ -2539,7 +2539,7 @@ var init_checks = __esm({
2539
2539
  minimum: Number.MIN_SAFE_INTEGER,
2540
2540
  note: "Integers must be within the safe integer range.",
2541
2541
  inst,
2542
- origin,
2542
+ origin: origin2,
2543
2543
  inclusive: true,
2544
2544
  continue: !def.abort
2545
2545
  });
@@ -2671,9 +2671,9 @@ var init_checks = __esm({
2671
2671
  const length = typeof input3 === "string" && units > def.maximum ? codePointLength(input3) : units;
2672
2672
  if (length <= def.maximum)
2673
2673
  return;
2674
- const origin = getLengthableOrigin(input3);
2674
+ const origin2 = getLengthableOrigin(input3);
2675
2675
  payload.issues.push({
2676
- origin,
2676
+ origin: origin2,
2677
2677
  code: "too_big",
2678
2678
  maximum: def.maximum,
2679
2679
  inclusive: true,
@@ -2693,9 +2693,9 @@ var init_checks = __esm({
2693
2693
  const length = typeof input3 === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input3) : units;
2694
2694
  if (length >= def.minimum)
2695
2695
  return;
2696
- const origin = getLengthableOrigin(input3);
2696
+ const origin2 = getLengthableOrigin(input3);
2697
2697
  payload.issues.push({
2698
- origin,
2698
+ origin: origin2,
2699
2699
  code: "too_small",
2700
2700
  minimum: def.minimum,
2701
2701
  inclusive: true,
@@ -2715,10 +2715,10 @@ var init_checks = __esm({
2715
2715
  const length = typeof input3 === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input3) : units;
2716
2716
  if (length === def.length)
2717
2717
  return;
2718
- const origin = getLengthableOrigin(input3);
2718
+ const origin2 = getLengthableOrigin(input3);
2719
2719
  const tooBig = length > def.length;
2720
2720
  payload.issues.push({
2721
- origin,
2721
+ origin: origin2,
2722
2722
  ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
2723
2723
  inclusive: true,
2724
2724
  exact: true,
@@ -3116,7 +3116,7 @@ function capSize(inst, size) {
3116
3116
  if (!caps.length)
3117
3117
  return;
3118
3118
  const cap = Math.min(...caps.map((c2) => c2[0]));
3119
- const parse9 = inst._zod.parse;
3119
+ const parse10 = inst._zod.parse;
3120
3120
  inst._zod.parse = (payload, ctx) => {
3121
3121
  const n3 = size(payload.value);
3122
3122
  if (n3 > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
@@ -3130,7 +3130,7 @@ function capSize(inst, size) {
3130
3130
  }
3131
3131
  }
3132
3132
  }
3133
- return parse9(payload, ctx);
3133
+ return parse10(payload, ctx);
3134
3134
  };
3135
3135
  }
3136
3136
  function handleArrayResult(result, final, index) {
@@ -5709,8 +5709,8 @@ var init_en = __esm({
5709
5709
  set: { unit: "items", verb: "to have" },
5710
5710
  map: { unit: "entries", verb: "to have" }
5711
5711
  };
5712
- function getSizing(origin) {
5713
- return Sizable[origin] ?? null;
5712
+ function getSizing(origin2) {
5713
+ return Sizable[origin2] ?? null;
5714
5714
  }
5715
5715
  const FormatDictionary = {
5716
5716
  regex: "input",
@@ -6923,12 +6923,12 @@ function _stringbool(Classes, _params) {
6923
6923
  return codec2;
6924
6924
  }
6925
6925
  // @__NO_SIDE_EFFECTS__
6926
- function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
6926
+ function _stringFormat(Class2, format2, fnOrRegex, _params = {}) {
6927
6927
  const params = normalizeParams(_params);
6928
6928
  const def = {
6929
6929
  check: "string_format",
6930
6930
  type: "string",
6931
- format,
6931
+ format: format2,
6932
6932
  fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
6933
6933
  ...params
6934
6934
  };
@@ -7056,8 +7056,8 @@ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
7056
7056
  const _result = ctx.seen.get(schema);
7057
7057
  return _result.schema;
7058
7058
  }
7059
- function encodeJSONPointerSegment(segment) {
7060
- return segment.replace(/~/g, "~0").replace(/\//g, "~1");
7059
+ function encodeJSONPointerSegment(segment2) {
7060
+ return segment2.replace(/~/g, "~0").replace(/\//g, "~1");
7061
7061
  }
7062
7062
  function extractDefs(ctx, schema) {
7063
7063
  const root = ctx.seen.get(schema);
@@ -7555,7 +7555,7 @@ function stringifyKeyNames(bySchema, json2, visited) {
7555
7555
  const values = json2.enum ?? (json2.const !== void 0 ? [json2.const] : void 0);
7556
7556
  if (!numericType && !values?.some((v) => typeof v === "number"))
7557
7557
  return json2;
7558
- const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json2;
7558
+ const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id, ...rest } = json2;
7559
7559
  if (rest.enum)
7560
7560
  rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
7561
7561
  else if (typeof rest.const === "number")
@@ -7671,9 +7671,9 @@ var init_json_schema_processors = __esm({
7671
7671
  intersectMime = (agg, mime) => {
7672
7672
  agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
7673
7673
  };
7674
- setFormat = (agg, format) => {
7675
- agg.format = format;
7676
- if (format.includes("int"))
7674
+ setFormat = (agg, format2) => {
7675
+ agg.format = format2;
7676
+ if (format2.includes("int"))
7677
7677
  agg.isInt = true;
7678
7678
  };
7679
7679
  minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
@@ -7723,16 +7723,16 @@ var init_json_schema_processors = __esm({
7723
7723
  stringProcessor = (schema, ctx, _json, _params) => {
7724
7724
  const json2 = _json;
7725
7725
  json2.type = "string";
7726
- const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
7726
+ const { minimum, maximum, format: format2, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
7727
7727
  if (typeof minimum === "number")
7728
7728
  json2.minLength = minimum;
7729
7729
  if (typeof maximum === "number")
7730
7730
  json2.maxLength = maximum;
7731
- if (format) {
7732
- json2.format = formatMap[format] ?? format;
7731
+ if (format2) {
7732
+ json2.format = formatMap[format2] ?? format2;
7733
7733
  if (json2.format === "")
7734
7734
  delete json2.format;
7735
- if (format === "time" || laxFormat) {
7735
+ if (format2 === "time" || laxFormat) {
7736
7736
  delete json2.format;
7737
7737
  }
7738
7738
  }
@@ -8851,8 +8851,8 @@ function iban2(params) {
8851
8851
  function jwt(params) {
8852
8852
  return _jwt(ZodJWT, params);
8853
8853
  }
8854
- function stringFormat(format, fnOrRegex, _params = {}) {
8855
- return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
8854
+ function stringFormat(format2, fnOrRegex, _params = {}) {
8855
+ return _stringFormat(ZodCustomStringFormat, format2, fnOrRegex, _params);
8856
8856
  }
8857
8857
  function hostname2(_params) {
8858
8858
  return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
@@ -8865,11 +8865,11 @@ function currencyCode2(_params) {
8865
8865
  }
8866
8866
  function hash(alg, params) {
8867
8867
  const enc = params?.enc ?? "hex";
8868
- const format = `${alg}_${enc}`;
8869
- const regex = regexes_exports[format];
8868
+ const format2 = `${alg}_${enc}`;
8869
+ const regex = regexes_exports[format2];
8870
8870
  if (!regex)
8871
- throw new Error(`Unrecognized hash format: ${format}`);
8872
- return _stringFormat(ZodCustomStringFormat, format, regex, params);
8871
+ throw new Error(`Unrecognized hash format: ${format2}`);
8872
+ return _stringFormat(ZodCustomStringFormat, format2, regex, params);
8873
8873
  }
8874
8874
  function number2(params) {
8875
8875
  return _number(ZodNumber, params);
@@ -11442,7 +11442,8 @@ var init_types = __esm({
11442
11442
  secretName: external_exports.string().min(1).optional(),
11443
11443
  encoding: external_exports.enum(["hex", "base64"]),
11444
11444
  prefix: external_exports.string().optional(),
11445
- signedPayload: external_exports.enum(webhookSignedPayloadValues).optional()
11445
+ signedPayload: external_exports.enum(webhookSignedPayloadValues).optional(),
11446
+ profile: external_exports.literal("standard-webhooks").optional()
11446
11447
  });
11447
11448
  packageWebhookUrlSecretVerificationSchema = external_exports.object({
11448
11449
  type: external_exports.literal("url-secret")
@@ -11605,6 +11606,22 @@ var init_types = __esm({
11605
11606
  challenge: packageWebhookChallengeSchema.optional(),
11606
11607
  execution: automationExecutionSchema.optional()
11607
11608
  }).superRefine((webhook, ctx) => {
11609
+ const verification = webhook.verification;
11610
+ if (verification?.type !== "url-secret" && verification?.profile === "standard-webhooks") {
11611
+ const replay = webhook.replay;
11612
+ const headers = [
11613
+ verification.header,
11614
+ replay?.timestampHeader,
11615
+ replay?.deliveryIdHeader
11616
+ ].map((header) => header?.toLowerCase());
11617
+ if (verification.type !== "hmac-sha256" || verification.encoding !== "base64" || !verification.secretName || verification.prefix !== void 0 || verification.signedPayload !== void 0 || replay?.timestampFormat !== "unix-seconds" || (replay.toleranceSeconds ?? 300) > 300 || headers.includes(void 0) || new Set(headers).size !== 3) {
11618
+ ctx.addIssue({
11619
+ code: "custom",
11620
+ path: ["verification", "profile"],
11621
+ message: "Standard Webhooks requires a saved HMAC-SHA256 key, base64 signatures, distinct signature, delivery ID, and Unix timestamp headers, and a replay tolerance of at most 300 seconds. The profile fixes the signature prefix and payload."
11622
+ });
11623
+ }
11624
+ }
11608
11625
  if (webhook.verification?.type !== "url-secret" && webhook.verification?.signedPayload === "timestamp.body" && !webhook.replay?.timestampHeader) {
11609
11626
  ctx.addIssue({
11610
11627
  code: "custom",
@@ -12261,13 +12278,13 @@ function createRelativeImportSpecifier(fromPath, targetPath) {
12261
12278
  }
12262
12279
  function normalizeWorkspaceModulePath(path) {
12263
12280
  const parts = [];
12264
- for (const segment of path.replace(/\\/g, "/").split("/")) {
12265
- if (!segment || segment === ".") continue;
12266
- if (segment === "..") {
12281
+ for (const segment2 of path.replace(/\\/g, "/").split("/")) {
12282
+ if (!segment2 || segment2 === ".") continue;
12283
+ if (segment2 === "..") {
12267
12284
  parts.pop();
12268
12285
  continue;
12269
12286
  }
12270
- parts.push(segment);
12287
+ parts.push(segment2);
12271
12288
  }
12272
12289
  return parts.join("/");
12273
12290
  }
@@ -15995,14 +16012,14 @@ var init_lib = __esm({
15995
16012
  super.checkParams(node2, false, true);
15996
16013
  this.scope.exit();
15997
16014
  }
15998
- forwardNoArrowParamsConversionAt(node2, parse9) {
16015
+ forwardNoArrowParamsConversionAt(node2, parse10) {
15999
16016
  let result;
16000
16017
  if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node2.start))) {
16001
16018
  this.state.noArrowParamsConversionAt.push(this.state.start);
16002
- result = parse9();
16019
+ result = parse10();
16003
16020
  this.state.noArrowParamsConversionAt.pop();
16004
16021
  } else {
16005
- result = parse9();
16022
+ result = parse10();
16006
16023
  }
16007
16024
  return result;
16008
16025
  }
@@ -16678,35 +16695,35 @@ var init_lib = __esm({
16678
16695
  const endOfInit = () => this.match(8) || this.match(4);
16679
16696
  switch (this.state.type) {
16680
16697
  case 132: {
16681
- const literal3 = this.parseNumericLiteral(this.state.value);
16698
+ const literal4 = this.parseNumericLiteral(this.state.value);
16682
16699
  if (endOfInit()) {
16683
16700
  return {
16684
16701
  type: "number",
16685
- loc: literal3.start,
16686
- value: literal3
16702
+ loc: literal4.start,
16703
+ value: literal4
16687
16704
  };
16688
16705
  }
16689
16706
  break;
16690
16707
  }
16691
16708
  case 131: {
16692
- const literal3 = this.parseStringLiteral(this.state.value);
16709
+ const literal4 = this.parseStringLiteral(this.state.value);
16693
16710
  if (endOfInit()) {
16694
16711
  return {
16695
16712
  type: "string",
16696
- loc: literal3.start,
16697
- value: literal3
16713
+ loc: literal4.start,
16714
+ value: literal4
16698
16715
  };
16699
16716
  }
16700
16717
  break;
16701
16718
  }
16702
16719
  case 81:
16703
16720
  case 82: {
16704
- const literal3 = this.parseBooleanLiteral(this.match(81));
16721
+ const literal4 = this.parseBooleanLiteral(this.match(81));
16705
16722
  if (endOfInit()) {
16706
16723
  return {
16707
16724
  type: "boolean",
16708
- loc: literal3.start,
16709
- value: literal3
16725
+ loc: literal4.start,
16726
+ value: literal4
16710
16727
  };
16711
16728
  }
16712
16729
  }
@@ -19254,11 +19271,11 @@ var init_lib = __esm({
19254
19271
  stack
19255
19272
  } = this;
19256
19273
  const scope = stack[stack.length - 1];
19257
- const origin = node2.start;
19274
+ const origin2 = node2.start;
19258
19275
  if (scope.isCertainlyParameterDeclaration()) {
19259
- this.parser.raise(error2, origin);
19276
+ this.parser.raise(error2, origin2);
19260
19277
  } else if (scope.canBeArrowParameterDeclaration()) {
19261
- scope.recordDeclarationError(error2, origin);
19278
+ scope.recordDeclarationError(error2, origin2);
19262
19279
  } else {
19263
19280
  return;
19264
19281
  }
@@ -24244,10 +24261,10 @@ var init_lib = __esm({
24244
24261
  const quasis = [curElt];
24245
24262
  if (curElt.tail) {
24246
24263
  const node2 = this.startNodeAt(startLoc);
24247
- const literal3 = this.startNodeAt(startLoc);
24248
- literal3.expressions = [];
24249
- literal3.quasis = quasis;
24250
- node2.literal = this.finishNode(literal3, "TemplateLiteral");
24264
+ const literal4 = this.startNodeAt(startLoc);
24265
+ literal4.expressions = [];
24266
+ literal4.quasis = quasis;
24267
+ node2.literal = this.finishNode(literal4, "TemplateLiteral");
24251
24268
  return this.finishNode(node2, "TSLiteralType");
24252
24269
  } else {
24253
24270
  const substitutions = [];
@@ -26680,9 +26697,9 @@ function describeModuleSourceParseError(error2) {
26680
26697
  message: raw.replace(/\s*\(\d+:\d+\)\s*$/, "")
26681
26698
  };
26682
26699
  }
26683
- function createModuleSourceParser(parse9) {
26700
+ function createModuleSourceParser(parse10) {
26684
26701
  function parseModuleSource2(source, options) {
26685
- return parse9(source, {
26702
+ return parse10(source, {
26686
26703
  sourceType: "module",
26687
26704
  plugins: moduleSourceParserPlugins(options?.filePath),
26688
26705
  createImportExpressions: true
@@ -26694,7 +26711,7 @@ function createModuleSourceParser(parse9) {
26694
26711
  } catch (error2) {
26695
26712
  for (const plugins of fallbackParserPlugins) {
26696
26713
  try {
26697
- return parse9(source, {
26714
+ return parse10(source, {
26698
26715
  sourceType: "module",
26699
26716
  plugins,
26700
26717
  createImportExpressions: true
@@ -26985,16 +27002,16 @@ function collectMemberWriteStarts(parsed) {
26985
27002
  });
26986
27003
  return starts;
26987
27004
  }
26988
- function walkAst(node2, visit2, parent) {
27005
+ function walkAst(node2, visit4, parent) {
26989
27006
  if (!node2 || typeof node2 !== "object") return;
26990
27007
  const typed = node2;
26991
- if (typeof typed.type === "string") visit2(typed, parent);
27008
+ if (typeof typed.type === "string") visit4(typed, parent);
26992
27009
  for (const value of Object.values(typed)) {
26993
27010
  if (Array.isArray(value)) {
26994
- for (const entry of value) walkAst(entry, visit2, typed);
27011
+ for (const entry of value) walkAst(entry, visit4, typed);
26995
27012
  continue;
26996
27013
  }
26997
- walkAst(value, visit2, typed);
27014
+ walkAst(value, visit4, typed);
26998
27015
  }
26999
27016
  }
27000
27017
  function getBindingIdentifierName(node2) {
@@ -27476,7 +27493,8 @@ var init_package_bound_runtime_exports = __esm({
27476
27493
  },
27477
27494
  { name: "credential", creator: "__kodyCreatePackageBoundCredentialRuntime" },
27478
27495
  { name: "credentials", creator: "__kodyCreatePackageBoundCredentialRuntime" },
27479
- { name: "packageContext", creator: "__kodyCreatePackageBoundPackageContext" }
27496
+ { name: "packageContext", creator: "__kodyCreatePackageBoundPackageContext" },
27497
+ { name: "events", creator: "__kodyCreatePackageBoundEvents" }
27480
27498
  ];
27481
27499
  packageBoundRuntimeExportNames = packageBoundRuntimeExports.map((entry) => entry.name);
27482
27500
  credentialRuntimeName = "__kodyPackageCredentialRuntime";
@@ -29389,7 +29407,9 @@ function profileDenialMessage(access, permission, resource) {
29389
29407
  if (blocked.code === "profile_inactive") {
29390
29408
  return layer.self ? `Profile "${layer.name}" is ${layer.reason ?? "revoked"}, so it cannot use ${permission}${target}.` : `Parent profile "${layer.name}" is ${layer.reason ?? "revoked"}, so the profiles below it cannot use ${permission}${target}.`;
29391
29409
  }
29392
- const grantHint = resource?.type === "credential" ? 'The person it acts for can share the credential with it under Credentials (or accessGrant with resource_type "credential" and subject_type "profile").' : 'The person it acts for can grant it (accessGrant with subject_type "profile").';
29410
+ const resourceType = resource?.type ?? "org";
29411
+ const onPage = ["org", "package", "credential"].includes(resourceType) ? "under Agent profiles (/account/profiles) or " : "";
29412
+ const grantHint = `The person it acts for can grant it ${onPage}with accessGrant (resource_type "${resourceType}", subject_type "profile", subject_id the profile id).`;
29393
29413
  const message = layer.self ? `Profile "${layer.name}" was not granted ${permission}${target}. ${grantHint}` : `Parent profile "${layer.name}" does not hold ${permission}${target}, so the profiles below it cannot use it.`;
29394
29414
  return access.credentialScopes && !access.credentialScopes.has(permission) ? `${message} This token is also not scoped for ${permission}; after the grant, mint one whose scopes include it.` : message;
29395
29415
  }
@@ -29516,7 +29536,7 @@ function parseKodyPackageSpecifier(specifier) {
29516
29536
  if (!trimmed) {
29517
29537
  throw unsupportedSpecifierError(specifier);
29518
29538
  }
29519
- const segments = trimmed.split("/").map((segment) => segment.trim());
29539
+ const segments = trimmed.split("/").map((segment2) => segment2.trim());
29520
29540
  if (segments.length < 2 || segments[0] === "" || segments[1] === "") {
29521
29541
  throw unsupportedSpecifierError(specifier);
29522
29542
  }
@@ -30337,6 +30357,32 @@ export function __kodyCreatePackageBoundStorage(packageId) {
30337
30357
  };
30338
30358
  }
30339
30359
 
30360
+ // Factory for the per-package virtual runtime modules: events.dispatch from a
30361
+ // package's modules emits as that package wherever the module runs (its own
30362
+ // run, ad hoc execute, another package's run). With a trusted binding in
30363
+ // scope the host-bound dispatcher stamps the package; without one only the
30364
+ // run's own package may use the run's events helper.
30365
+ export function __kodyCreatePackageBoundEvents(packageId) {
30366
+ return {
30367
+ dispatch: async (input) => {
30368
+ const binding = __kodyPackageBindingFor(packageId);
30369
+ if (binding != null && typeof binding.packageEventDispatch === 'function') {
30370
+ return await __kodyReflectApply(binding.packageEventDispatch, binding, [
30371
+ input ?? {},
30372
+ ]);
30373
+ }
30374
+ __kodyAssertUnboundIsRunPackage(packageId, 'events.dispatch');
30375
+ const runEvents = __kodyGetRuntimeStore()?.events;
30376
+ if (runEvents == null || typeof runEvents.dispatch !== 'function') {
30377
+ throw new __kodyErrorCtor(
30378
+ 'events.dispatch is not available in this execution context.',
30379
+ );
30380
+ }
30381
+ return await runEvents.dispatch(input ?? {});
30382
+ },
30383
+ };
30384
+ }
30385
+
30340
30386
  function __kodyResolvePackageSecrets(packageId) {
30341
30387
  const currentRuntime = __kodyGetRuntimeStore();
30342
30388
  const factory = currentRuntime?.__kodyPackageSecrets;
@@ -31771,9 +31817,9 @@ ${helpers.bindings}`,
31771
31817
  )
31772
31818
  };
31773
31819
  }
31774
- function parseStringLiteral(literal3) {
31820
+ function parseStringLiteral(literal4) {
31775
31821
  try {
31776
- const value = JSON.parse(literal3);
31822
+ const value = JSON.parse(literal4);
31777
31823
  return typeof value === "string" ? value : null;
31778
31824
  } catch {
31779
31825
  return null;
@@ -32676,8 +32722,8 @@ var require_createActor_25900f76_cjs = __commonJS({
32676
32722
  return incarnation === void 0 || typeof incarnation === "string";
32677
32723
  }
32678
32724
  function getAddressId(address) {
32679
- const segment = address.slice(address.lastIndexOf("/") + 1);
32680
- return segment.includes("%") ? segment.replaceAll("%2F", "/").replaceAll("%25", "%") : segment;
32725
+ const segment2 = address.slice(address.lastIndexOf("/") + 1);
32726
+ return segment2.includes("%") ? segment2.replaceAll("%2F", "/").replaceAll("%25", "%") : segment2;
32681
32727
  }
32682
32728
  function createMissingAddressError(target) {
32683
32729
  return new Error(xstateError(50, ...target.incarnation === void 0 ? [target.$actor] : [target.$actor, target.incarnation]));
@@ -36645,24 +36691,24 @@ var require_createActor_25900f76_cjs = __commonJS({
36645
36691
  return stateId;
36646
36692
  }
36647
36693
  const result = [];
36648
- let segment = "";
36694
+ let segment2 = "";
36649
36695
  for (let i4 = 0; i4 < stateId.length; i4++) {
36650
36696
  const char = stateId.charCodeAt(i4);
36651
36697
  switch (char) {
36652
36698
  // \
36653
36699
  case 92:
36654
- segment += stateId[i4 + 1] === "." ? "\\." : stateId[i4 + 1];
36700
+ segment2 += stateId[i4 + 1] === "." ? "\\." : stateId[i4 + 1];
36655
36701
  i4++;
36656
36702
  continue;
36657
36703
  // .
36658
36704
  case 46:
36659
- result.push(segment);
36660
- segment = "";
36705
+ result.push(segment2);
36706
+ segment2 = "";
36661
36707
  continue;
36662
36708
  }
36663
- segment += stateId[i4];
36709
+ segment2 += stateId[i4];
36664
36710
  }
36665
- result.push(segment);
36711
+ result.push(segment2);
36666
36712
  return result;
36667
36713
  }
36668
36714
  function toStateValue(stateValue) {
@@ -40455,7 +40501,7 @@ var require_xstate_cjs = __commonJS({
40455
40501
  function getMachineSerializationDiagnostics2(machine) {
40456
40502
  const diagnostics = [];
40457
40503
  const ancestors = /* @__PURE__ */ new Set();
40458
- const visit2 = (value, path, runtimeSource = false) => {
40504
+ const visit4 = (value, path, runtimeSource = false) => {
40459
40505
  const report = (code2, message) => diagnostics.push({
40460
40506
  code: code2,
40461
40507
  path,
@@ -40499,11 +40545,11 @@ var require_xstate_cjs = __commonJS({
40499
40545
  for (const [key, entry] of Object.entries(value)) {
40500
40546
  const pointer = `${path}/${key.replaceAll("~", "~0").replaceAll("/", "~1")}`;
40501
40547
  const sourceEntry = /^\/(actions|guards|actors|delays)$/.test(path);
40502
- visit2(entry, pointer, sourceEntry);
40548
+ visit4(entry, pointer, sourceEntry);
40503
40549
  }
40504
40550
  ancestors.delete(value);
40505
40551
  };
40506
- visit2(machine._json ?? machine.config, "");
40552
+ visit4(machine._json ?? machine.config, "");
40507
40553
  return diagnostics;
40508
40554
  }
40509
40555
  function machineToJSON2(machine) {
@@ -42101,13 +42147,13 @@ var require_xstate_cjs = __commonJS({
42101
42147
  for (const [name, child] of Object.entries(machine.sources?.actors ?? {})) {
42102
42148
  add(`${key}/actors/${createActor2.encodeAddressSegment(name)}`, child);
42103
42149
  }
42104
- function visit2(node2) {
42150
+ function visit4(node2) {
42105
42151
  for (const invoke of node2.invoke ?? []) {
42106
42152
  if (typeof invoke.logic === "object") add(`${key}/invoke/${createActor2.encodeAddressSegment(node2.id)}/${createActor2.encodeAddressSegment(invoke.id)}`, invoke.logic);
42107
42153
  }
42108
- for (const child of Object.values(node2.states ?? {})) visit2(child);
42154
+ for (const child of Object.values(node2.states ?? {})) visit4(child);
42109
42155
  }
42110
- if (machine.root) visit2(machine.root);
42156
+ if (machine.root) visit4(machine.root);
42111
42157
  }
42112
42158
  add("root", systemLogic.root);
42113
42159
  for (const [key, logic] of Object.entries(systemLogic.actors ?? {})) add(`actors/${createActor2.encodeAddressSegment(key)}`, logic);
@@ -42937,7 +42983,7 @@ function defineStatusEnum(definition) {
42937
42983
  function is(value) {
42938
42984
  return typeof value === "string" && values.includes(value);
42939
42985
  }
42940
- function parse9(value) {
42986
+ function parse10(value) {
42941
42987
  if (!is(value))
42942
42988
  throw new Error(
42943
42989
  `${name}: expected one of ${values.join(", ")}, got ${String(value)}`
@@ -42949,8 +42995,8 @@ function defineStatusEnum(definition) {
42949
42995
  description,
42950
42996
  values,
42951
42997
  is,
42952
- parse: parse9,
42953
- sql: (selected) => sqlStateValues(name, selected.map(parse9))
42998
+ parse: parse10,
42999
+ sql: (selected) => sqlStateValues(name, selected.map(parse10))
42954
43000
  });
42955
43001
  }
42956
43002
  var IllegalStateTransitionError;
@@ -43844,14 +43890,6 @@ async function requestArtifactsEnvelope(client, input3) {
43844
43890
  query: input3.query,
43845
43891
  body: input3.body
43846
43892
  });
43847
- if (response.cfRay) {
43848
- console.info("artifacts-rest", {
43849
- method: input3.method,
43850
- path: redactArtifactsRestPath(input3.path),
43851
- status: response.status,
43852
- cfRay: response.cfRay
43853
- });
43854
- }
43855
43893
  const envelope = response.body;
43856
43894
  if (!envelope?.success) {
43857
43895
  const primaryError = envelope?.errors?.[0];
@@ -43864,6 +43902,12 @@ async function requestArtifactsEnvelope(client, input3) {
43864
43902
  messages: []
43865
43903
  };
43866
43904
  }
43905
+ console.warn("artifacts-rest", {
43906
+ method: input3.method,
43907
+ path: redactArtifactsRestPath(input3.path),
43908
+ status: response.status,
43909
+ cfRay: response.cfRay
43910
+ });
43867
43911
  throw new Error(
43868
43912
  message,
43869
43913
  primaryError ? { cause: primaryError } : void 0
@@ -46030,7 +46074,7 @@ var require_constants = __commonJS({
46030
46074
  "use strict";
46031
46075
  var SEMVER_SPEC_VERSION = "2.0.0";
46032
46076
  var MAX_LENGTH = 256;
46033
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
46077
+ var MAX_SAFE_INTEGER2 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
46034
46078
  9007199254740991;
46035
46079
  var MAX_SAFE_COMPONENT_LENGTH = 16;
46036
46080
  var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
@@ -46047,7 +46091,7 @@ var require_constants = __commonJS({
46047
46091
  MAX_LENGTH,
46048
46092
  MAX_SAFE_COMPONENT_LENGTH,
46049
46093
  MAX_SAFE_BUILD_LENGTH,
46050
- MAX_SAFE_INTEGER,
46094
+ MAX_SAFE_INTEGER: MAX_SAFE_INTEGER2,
46051
46095
  RELEASE_TYPES,
46052
46096
  SEMVER_SPEC_VERSION,
46053
46097
  FLAG_INCLUDE_PRERELEASE: 1,
@@ -46203,7 +46247,7 @@ var require_semver = __commonJS({
46203
46247
  "../../node_modules/semver/classes/semver.js"(exports, module) {
46204
46248
  "use strict";
46205
46249
  var debug = require_debug();
46206
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
46250
+ var { MAX_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER2 } = require_constants();
46207
46251
  var { safeRe: re, t: t4 } = require_re();
46208
46252
  var parseOptions = require_parse_options();
46209
46253
  var { compareIdentifiers } = require_identifiers();
@@ -46248,13 +46292,13 @@ var require_semver = __commonJS({
46248
46292
  this.major = +m[1];
46249
46293
  this.minor = +m[2];
46250
46294
  this.patch = +m[3];
46251
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
46295
+ if (this.major > MAX_SAFE_INTEGER2 || this.major < 0) {
46252
46296
  throw new TypeError("Invalid major version");
46253
46297
  }
46254
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
46298
+ if (this.minor > MAX_SAFE_INTEGER2 || this.minor < 0) {
46255
46299
  throw new TypeError("Invalid minor version");
46256
46300
  }
46257
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
46301
+ if (this.patch > MAX_SAFE_INTEGER2 || this.patch < 0) {
46258
46302
  throw new TypeError("Invalid patch version");
46259
46303
  }
46260
46304
  if (!m[4]) {
@@ -46263,7 +46307,7 @@ var require_semver = __commonJS({
46263
46307
  this.prerelease = m[4].split(".").map((id) => {
46264
46308
  if (/^[0-9]+$/.test(id)) {
46265
46309
  const num = +id;
46266
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
46310
+ if (num >= 0 && num < MAX_SAFE_INTEGER2) {
46267
46311
  return num;
46268
46312
  }
46269
46313
  }
@@ -46495,7 +46539,7 @@ var require_parse = __commonJS({
46495
46539
  "../../node_modules/semver/functions/parse.js"(exports, module) {
46496
46540
  "use strict";
46497
46541
  var SemVer = require_semver();
46498
- var parse9 = (version2, options, throwErrors = false) => {
46542
+ var parse10 = (version2, options, throwErrors = false) => {
46499
46543
  if (version2 instanceof SemVer) {
46500
46544
  return version2;
46501
46545
  }
@@ -46508,7 +46552,7 @@ var require_parse = __commonJS({
46508
46552
  throw er;
46509
46553
  }
46510
46554
  };
46511
- module.exports = parse9;
46555
+ module.exports = parse10;
46512
46556
  }
46513
46557
  });
46514
46558
 
@@ -46516,9 +46560,9 @@ var require_parse = __commonJS({
46516
46560
  var require_valid = __commonJS({
46517
46561
  "../../node_modules/semver/functions/valid.js"(exports, module) {
46518
46562
  "use strict";
46519
- var parse9 = require_parse();
46563
+ var parse10 = require_parse();
46520
46564
  var valid = (version2, options) => {
46521
- const v = parse9(version2, options);
46565
+ const v = parse10(version2, options);
46522
46566
  return v ? v.version : null;
46523
46567
  };
46524
46568
  module.exports = valid;
@@ -46529,9 +46573,9 @@ var require_valid = __commonJS({
46529
46573
  var require_clean = __commonJS({
46530
46574
  "../../node_modules/semver/functions/clean.js"(exports, module) {
46531
46575
  "use strict";
46532
- var parse9 = require_parse();
46576
+ var parse10 = require_parse();
46533
46577
  var clean = (version2, options) => {
46534
- const s3 = parse9(version2.trim().replace(/^[=v]+/, ""), options);
46578
+ const s3 = parse10(version2.trim().replace(/^[=v]+/, ""), options);
46535
46579
  return s3 ? s3.version : null;
46536
46580
  };
46537
46581
  module.exports = clean;
@@ -46566,10 +46610,10 @@ var require_inc = __commonJS({
46566
46610
  var require_diff = __commonJS({
46567
46611
  "../../node_modules/semver/functions/diff.js"(exports, module) {
46568
46612
  "use strict";
46569
- var parse9 = require_parse();
46613
+ var parse10 = require_parse();
46570
46614
  var diff = (version1, version2) => {
46571
- const v1 = parse9(version1, null, true);
46572
- const v2 = parse9(version2, null, true);
46615
+ const v1 = parse10(version1, null, true);
46616
+ const v2 = parse10(version2, null, true);
46573
46617
  const comparison = v1.compare(v2);
46574
46618
  if (comparison === 0) {
46575
46619
  return null;
@@ -46640,9 +46684,9 @@ var require_patch = __commonJS({
46640
46684
  var require_prerelease = __commonJS({
46641
46685
  "../../node_modules/semver/functions/prerelease.js"(exports, module) {
46642
46686
  "use strict";
46643
- var parse9 = require_parse();
46687
+ var parse10 = require_parse();
46644
46688
  var prerelease = (version2, options) => {
46645
- const parsed = parse9(version2, options);
46689
+ const parsed = parse10(version2, options);
46646
46690
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
46647
46691
  };
46648
46692
  module.exports = prerelease;
@@ -46828,7 +46872,7 @@ var require_coerce = __commonJS({
46828
46872
  "../../node_modules/semver/functions/coerce.js"(exports, module) {
46829
46873
  "use strict";
46830
46874
  var SemVer = require_semver();
46831
- var parse9 = require_parse();
46875
+ var parse10 = require_parse();
46832
46876
  var { safeRe: re, t: t4 } = require_re();
46833
46877
  var coerce = (version2, options) => {
46834
46878
  if (version2 instanceof SemVer) {
@@ -46863,7 +46907,7 @@ var require_coerce = __commonJS({
46863
46907
  const patch = match2[4] || "0";
46864
46908
  const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
46865
46909
  const build2 = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
46866
- return parse9(`${major}.${minor}.${patch}${prerelease}${build2}`, options);
46910
+ return parse10(`${major}.${minor}.${patch}${prerelease}${build2}`, options);
46867
46911
  };
46868
46912
  module.exports = coerce;
46869
46913
  }
@@ -46873,7 +46917,7 @@ var require_coerce = __commonJS({
46873
46917
  var require_truncate = __commonJS({
46874
46918
  "../../node_modules/semver/functions/truncate.js"(exports, module) {
46875
46919
  "use strict";
46876
- var parse9 = require_parse();
46920
+ var parse10 = require_parse();
46877
46921
  var constants = require_constants();
46878
46922
  var SemVer = require_semver();
46879
46923
  var truncate = (version2, truncation, options) => {
@@ -46885,7 +46929,7 @@ var require_truncate = __commonJS({
46885
46929
  };
46886
46930
  var cloneInputVersion = (version2, options) => {
46887
46931
  const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
46888
- return parse9(versionStringToParse, options);
46932
+ return parse10(versionStringToParse, options);
46889
46933
  };
46890
46934
  var doTruncation = (version2, truncation) => {
46891
46935
  if (isPrerelease(truncation)) {
@@ -47929,7 +47973,7 @@ var require_semver2 = __commonJS({
47929
47973
  var constants = require_constants();
47930
47974
  var SemVer = require_semver();
47931
47975
  var identifiers = require_identifiers();
47932
- var parse9 = require_parse();
47976
+ var parse10 = require_parse();
47933
47977
  var valid = require_valid();
47934
47978
  var clean = require_clean();
47935
47979
  var inc = require_inc();
@@ -47968,7 +48012,7 @@ var require_semver2 = __commonJS({
47968
48012
  var simplifyRange = require_simplify();
47969
48013
  var subset = require_subset();
47970
48014
  module.exports = {
47971
- parse: parse9,
48015
+ parse: parse10,
47972
48016
  valid,
47973
48017
  clean,
47974
48018
  inc,
@@ -48242,7 +48286,7 @@ function selectLatestCompatibleWheel(files) {
48242
48286
  return latest;
48243
48287
  }
48244
48288
  function comparePythonVersions(a2, b3) {
48245
- const parse9 = (v) => {
48289
+ const parse10 = (v) => {
48246
48290
  const releaseMatch = v.match(/^[0-9]+(?:\.[0-9]+)*/);
48247
48291
  const release = (releaseMatch?.[0] ?? "0").split(".").map(Number);
48248
48292
  const rest = v.slice(releaseMatch?.[0].length ?? 0);
@@ -48251,8 +48295,8 @@ function comparePythonVersions(a2, b3) {
48251
48295
  isPre: /^[.\-_]?(a|b|c|rc|alpha|beta|dev|pre)/i.test(rest)
48252
48296
  };
48253
48297
  };
48254
- const av = parse9(a2);
48255
- const bv = parse9(b3);
48298
+ const av = parse10(a2);
48299
+ const bv = parse10(b3);
48256
48300
  const len = Math.max(av.release.length, bv.release.length);
48257
48301
  for (let i4 = 0; i4 < len; i4++) {
48258
48302
  const diff = (av.release[i4] ?? 0) - (bv.release[i4] ?? 0);
@@ -48567,7 +48611,7 @@ var require_browser = __commonJS({
48567
48611
  });
48568
48612
  module2.exports = __toCommonJS(browser_exports);
48569
48613
  function encodePacket(packet) {
48570
- let visit2 = (value) => {
48614
+ let visit4 = (value) => {
48571
48615
  if (value === null) {
48572
48616
  bb.write8(0);
48573
48617
  } else if (typeof value === "boolean") {
@@ -48586,7 +48630,7 @@ var require_browser = __commonJS({
48586
48630
  bb.write8(5);
48587
48631
  bb.write32(value.length);
48588
48632
  for (let item of value) {
48589
- visit2(item);
48633
+ visit4(item);
48590
48634
  }
48591
48635
  } else {
48592
48636
  let keys = Object.keys(value);
@@ -48594,19 +48638,19 @@ var require_browser = __commonJS({
48594
48638
  bb.write32(keys.length);
48595
48639
  for (let key of keys) {
48596
48640
  bb.write(encodeUTF8(key));
48597
- visit2(value[key]);
48641
+ visit4(value[key]);
48598
48642
  }
48599
48643
  }
48600
48644
  };
48601
48645
  let bb = new ByteBuffer();
48602
48646
  bb.write32(0);
48603
48647
  bb.write32(packet.id << 1 | +!packet.isRequest);
48604
- visit2(packet.value);
48648
+ visit4(packet.value);
48605
48649
  writeUInt32LE(bb.buf, bb.len - 4, 0);
48606
48650
  return bb.buf.subarray(0, bb.len);
48607
48651
  }
48608
48652
  function decodePacket(bytes) {
48609
- let visit2 = () => {
48653
+ let visit4 = () => {
48610
48654
  switch (bb.read8()) {
48611
48655
  case 0:
48612
48656
  return null;
@@ -48622,7 +48666,7 @@ var require_browser = __commonJS({
48622
48666
  let count = bb.read32();
48623
48667
  let value2 = [];
48624
48668
  for (let i4 = 0; i4 < count; i4++) {
48625
- value2.push(visit2());
48669
+ value2.push(visit4());
48626
48670
  }
48627
48671
  return value2;
48628
48672
  }
@@ -48630,7 +48674,7 @@ var require_browser = __commonJS({
48630
48674
  let count = bb.read32();
48631
48675
  let value2 = {};
48632
48676
  for (let i4 = 0; i4 < count; i4++) {
48633
- value2[decodeUTF8(bb.read())] = visit2();
48677
+ value2[decodeUTF8(bb.read())] = visit4();
48634
48678
  }
48635
48679
  return value2;
48636
48680
  }
@@ -48642,7 +48686,7 @@ var require_browser = __commonJS({
48642
48686
  let id = bb.read32();
48643
48687
  let isRequest = (id & 1) === 0;
48644
48688
  id >>>= 1;
48645
- let value = visit2();
48689
+ let value = visit4();
48646
48690
  if (bb.ptr !== bytes.length) {
48647
48691
  throw new Error("Invalid packet");
48648
48692
  }
@@ -49103,7 +49147,7 @@ is not a problem with esbuild. You need to fix your environment instead.
49103
49147
  let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString);
49104
49148
  let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean);
49105
49149
  let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings);
49106
- let format = getFlag(options, keys, "format", mustBeString);
49150
+ let format2 = getFlag(options, keys, "format", mustBeString);
49107
49151
  let globalName = getFlag(options, keys, "globalName", mustBeString);
49108
49152
  let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp);
49109
49153
  let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp);
@@ -49136,7 +49180,7 @@ is not a problem with esbuild. You need to fix your environment instead.
49136
49180
  if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
49137
49181
  if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
49138
49182
  if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`);
49139
- if (format) flags.push(`--format=${format}`);
49183
+ if (format2) flags.push(`--format=${format2}`);
49140
49184
  if (globalName) flags.push(`--global-name=${globalName}`);
49141
49185
  if (platform) flags.push(`--platform=${platform}`);
49142
49186
  if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`);
@@ -49819,10 +49863,10 @@ is not a problem with esbuild. You need to fix your environment instead.
49819
49863
  if (fallback !== void 0) request2.fallback = fallback;
49820
49864
  if (cors) {
49821
49865
  const corsKeys = {};
49822
- const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
49866
+ const origin2 = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
49823
49867
  checkForInvalidFlags(cors, corsKeys, `on "cors" object`);
49824
- if (Array.isArray(origin)) request2.corsOrigin = origin;
49825
- else if (origin !== void 0) request2.corsOrigin = [origin];
49868
+ if (Array.isArray(origin2)) request2.corsOrigin = origin2;
49869
+ else if (origin2 !== void 0) request2.corsOrigin = [origin2];
49826
49870
  }
49827
49871
  sendRequest(refs, request2, (error22, response2) => {
49828
49872
  if (error22) return reject(new Error(error22));
@@ -66426,20 +66470,20 @@ function encode3(decoded) {
66426
66470
  if (line.length === 0) continue;
66427
66471
  let genColumn = 0;
66428
66472
  for (let j = 0; j < line.length; j++) {
66429
- const segment = line[j];
66473
+ const segment2 = line[j];
66430
66474
  if (j > 0) writer.write(comma);
66431
- encodeInteger(writer, encodeSign(segment[0] - genColumn));
66432
- genColumn = segment[0];
66433
- if (segment.length === 1) continue;
66434
- encodeInteger(writer, encodeSign(segment[1] - sourcesIndex));
66435
- encodeInteger(writer, encodeSign(segment[2] - sourceLine));
66436
- encodeInteger(writer, encodeSign(segment[3] - sourceColumn));
66437
- sourcesIndex = segment[1];
66438
- sourceLine = segment[2];
66439
- sourceColumn = segment[3];
66440
- if (segment.length === 4) continue;
66441
- encodeInteger(writer, encodeSign(segment[4] - namesIndex));
66442
- namesIndex = segment[4];
66475
+ encodeInteger(writer, encodeSign(segment2[0] - genColumn));
66476
+ genColumn = segment2[0];
66477
+ if (segment2.length === 1) continue;
66478
+ encodeInteger(writer, encodeSign(segment2[1] - sourcesIndex));
66479
+ encodeInteger(writer, encodeSign(segment2[2] - sourceLine));
66480
+ encodeInteger(writer, encodeSign(segment2[3] - sourceColumn));
66481
+ sourcesIndex = segment2[1];
66482
+ sourceLine = segment2[2];
66483
+ sourceColumn = segment2[3];
66484
+ if (segment2.length === 4) continue;
66485
+ encodeInteger(writer, encodeSign(segment2[4] - namesIndex));
66486
+ namesIndex = segment2[4];
66443
66487
  }
66444
66488
  }
66445
66489
  return writer.flush();
@@ -76613,20 +76657,20 @@ function attachCustomHeaders(request, response, config2) {
76613
76657
  return response;
76614
76658
  }
76615
76659
  function decodePath(pathname) {
76616
- return pathname.split("/").map((segment) => {
76660
+ return pathname.split("/").map((segment2) => {
76617
76661
  try {
76618
- return decodeURIComponent(segment);
76662
+ return decodeURIComponent(segment2);
76619
76663
  } catch {
76620
- return segment;
76664
+ return segment2;
76621
76665
  }
76622
76666
  }).join("/").replaceAll(/\/+/g, "/");
76623
76667
  }
76624
76668
  function encodePath(pathname) {
76625
- return pathname.split("/").map((segment) => {
76669
+ return pathname.split("/").map((segment2) => {
76626
76670
  try {
76627
- return encodeURIComponent(segment);
76671
+ return encodeURIComponent(segment2);
76628
76672
  } catch {
76629
- return segment;
76673
+ return segment2;
76630
76674
  }
76631
76675
  }).join("/");
76632
76676
  }
@@ -79468,7 +79512,7 @@ var init_typescript2 = __esm({
79468
79512
  rangeOverlapsWithStartEnd: () => TP,
79469
79513
  rangeStartIsOnSameLineAsRangeEnd: () => See,
79470
79514
  rangeStartPositionsAreOnSameLine: () => q5,
79471
- readBuilderProgram: () => _9,
79515
+ readBuilderProgram: () => _92,
79472
79516
  readConfigFile: () => aA,
79473
79517
  readJson: () => KC,
79474
79518
  readJsonConfigFile: () => Xre,
@@ -119776,7 +119820,7 @@ ${It.join(`
119776
119820
  y = wa(a10, x10, r7.symbol);
119777
119821
  } else {
119778
119822
  let x10 = r7.propertyName || r7.name, A = Mh(x10);
119779
- y = Vg(r7, gf(a10, A, d, x10));
119823
+ y = Vg(r7, gf2(a10, A, d, x10));
119780
119824
  }
119781
119825
  else {
119782
119826
  let x10 = Q0(65 | (r7.dotDotDotToken ? 0 : 128), a10, Ze, f10), A = f10.elements.indexOf(r7);
@@ -120422,7 +120466,7 @@ ${It.join(`
120422
120466
  return r7.resolvedBaseTypes;
120423
120467
  }
120424
120468
  function Det(r7) {
120425
- return pu(Xn(Uc(r7.typeParameters, (l10, f10) => r7.elementFlags[f10] & 8 ? gf(l10, Ge) : l10) || qe), r7.readonly);
120469
+ return pu(Xn(Uc(r7.typeParameters, (l10, f10) => r7.elementFlags[f10] & 8 ? gf2(l10, Ge) : l10) || qe), r7.readonly);
120426
120470
  }
120427
120471
  function Pet(r7) {
120428
120472
  r7.resolvedBaseTypes = cB;
@@ -122589,7 +122633,7 @@ ${It.join(`
122589
122633
  else We(dt, jt, (y = r7.labeledElementDeclarations) == null ? void 0 : y[lt]);
122590
122634
  }
122591
122635
  for (let lt = 0; lt < U; lt++) A[lt] & 2 && (A[lt] = 1);
122592
- X >= 0 && X < ge && (x10[X] = Xn(Uc(x10.slice(X, ge + 1), (lt, dt) => A[X + dt] & 8 ? gf(lt, Ge) : lt)), x10.splice(X + 1, ge - X), A.splice(X + 1, ge - X), J.splice(X + 1, ge - X));
122636
+ X >= 0 && X < ge && (x10[X] = Xn(Uc(x10.slice(X, ge + 1), (lt, dt) => A[X + dt] & 8 ? gf2(lt, Ge) : lt)), x10.splice(X + 1, ge - X), A.splice(X + 1, ge - X), J.splice(X + 1, ge - X));
122593
122637
  let fe = ppe(A, r7.readonly, J);
122594
122638
  return fe === Ys ? yi : A.length ? Lh(fe, x10) : fe;
122595
122639
  function We(lt, dt, jt) {
@@ -123251,13 +123295,13 @@ ${It.join(`
123251
123295
  }
123252
123296
  function CNe(r7, a10, l10) {
123253
123297
  if (r7.flags & 134217728 || r7.flags & 268435456 && !Tpe(r7)) {
123254
- let f10 = dr(r7.types, (d) => Rh(gf(d, a10), l10));
123298
+ let f10 = dr(r7.types, (d) => Rh(gf2(d, a10), l10));
123255
123299
  return r7.flags & 268435456 || l10 ? ra(f10) : Xn(f10);
123256
123300
  }
123257
123301
  }
123258
123302
  function Urt(r7, a10, l10) {
123259
123303
  if (a10.flags & 134217728) {
123260
- let f10 = dr(a10.types, (d) => Rh(gf(r7, d), l10));
123304
+ let f10 = dr(a10.types, (d) => Rh(gf2(r7, d), l10));
123261
123305
  return l10 ? ra(f10) : Xn(f10);
123262
123306
  }
123263
123307
  }
@@ -123302,7 +123346,7 @@ ${It.join(`
123302
123346
  let l10 = eu(a10);
123303
123347
  return !!l10 && ct(qa(r7), (f10) => !!(f10.flags & 16777216) && Ns(iC(f10, 19456), l10));
123304
123348
  }
123305
- function gf(r7, a10, l10 = 0, f10, d, y) {
123349
+ function gf2(r7, a10, l10 = 0, f10, d, y) {
123306
123350
  return m1(r7, a10, l10, f10, d, y) || (f10 ? et2 : W);
123307
123351
  }
123308
123352
  function DNe(r7, a10) {
@@ -123341,7 +123385,7 @@ ${It.join(`
123341
123385
  let a10 = Dn(r7);
123342
123386
  if (!a10.resolvedType) {
123343
123387
  let l10 = Ci(r7.objectType), f10 = Ci(r7.indexType), d = aC(r7);
123344
- a10.resolvedType = gf(l10, f10, 0, r7, d, J6(d));
123388
+ a10.resolvedType = gf2(l10, f10, 0, r7, d, J6(d));
123345
123389
  }
123346
123390
  return a10.resolvedType;
123347
123391
  }
@@ -123354,7 +123398,7 @@ ${It.join(`
123354
123398
  return a10.resolvedType;
123355
123399
  }
123356
123400
  function jh(r7) {
123357
- return r7.flags & 16777216 ? jh(r7.baseType) : r7.flags & 33554432 && (r7.objectType.flags & 16777216 || r7.indexType.flags & 16777216) ? gf(jh(r7.objectType), jh(r7.indexType)) : r7;
123401
+ return r7.flags & 16777216 ? jh(r7.baseType) : r7.flags & 33554432 && (r7.objectType.flags & 16777216 || r7.indexType.flags & 16777216) ? gf2(jh(r7.objectType), jh(r7.indexType)) : r7;
123358
123402
  }
123359
123403
  function wNe(r7) {
123360
123404
  return $x(r7) && kr(r7.elements) > 0 && !ct(r7.elements, (a10) => LF(a10) || MF(a10) || lE(a10) && !!(a10.questionToken || a10.dotDotDotToken));
@@ -124051,7 +124095,7 @@ ${It.join(`
124051
124095
  if (d & 8388608) return sC(r7.symbol, Mi(r7.type, a10));
124052
124096
  if (d & 33554432) {
124053
124097
  let y = l10 || r7.aliasSymbol, x10 = l10 ? f10 : Bh(r7.aliasTypeArguments, a10);
124054
- return gf(Mi(r7.objectType, a10), Mi(r7.indexType, a10), r7.accessFlags, void 0, y, x10);
124098
+ return gf2(Mi(r7.objectType, a10), Mi(r7.indexType, a10), r7.accessFlags, void 0, y, x10);
124055
124099
  }
124056
124100
  if (d & 67108864) return Rpe(r7, Qv(r7.mapper, a10), false, l10, f10);
124057
124101
  if (d & 16777216) {
@@ -124348,7 +124392,7 @@ ${It.join(`
124348
124392
  function xnt(r7, a10, l10, f10, d, y) {
124349
124393
  let x10 = EM(Snt(r7), a10, l10, f10, d, y), A;
124350
124394
  if (Td(r7.parent) && cm(r7.parent.parent)) {
124351
- let U = r7.parent.parent, X = $M(jT(r7)), ge = X === void 0 ? "children" : mi(X), fe = R_(ge), We = gf(l10, fe), lt = XC(U.children);
124395
+ let U = r7.parent.parent, X = $M(jT(r7)), ge = X === void 0 ? "children" : mi(X), fe = R_(ge), We = gf2(l10, fe), lt = XC(U.children);
124352
124396
  if (!kr(lt)) return x10;
124353
124397
  let dt = kr(lt) > 1, jt, ir;
124354
124398
  if (hM(false) !== Ys) {
@@ -124359,7 +124403,7 @@ ${It.join(`
124359
124403
  if (jt !== qt) {
124360
124404
  let Yr = ng(lX(U, 0));
124361
124405
  x10 = bnt(Tnt(U, J), Yr, jt, f10, d, y) || x10;
124362
- } else if (!Am(gf(a10, fe), We, f10)) {
124406
+ } else if (!Am(gf2(a10, fe), We, f10)) {
124363
124407
  x10 = true;
124364
124408
  let Yr = ze(U.openingElement.tagName, p.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, ge, Xr(We));
124365
124409
  y && y.skipLogging && (y.errors || (y.errors = [])).push(Yr);
@@ -124369,7 +124413,7 @@ ${It.join(`
124369
124413
  ar && (x10 = EM((function* () {
124370
124414
  yield ar;
124371
124415
  })(), a10, l10, f10, d, y) || x10);
124372
- } else if (!Am(gf(a10, fe), We, f10)) {
124416
+ } else if (!Am(gf2(a10, fe), We, f10)) {
124373
124417
  x10 = true;
124374
124418
  let Yr = ze(U.openingElement.tagName, p.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, ge, Xr(We));
124375
124419
  y && y.skipLogging && (y.errors || (y.errors = [])).push(Yr);
@@ -124378,7 +124422,7 @@ ${It.join(`
124378
124422
  return x10;
124379
124423
  function J() {
124380
124424
  if (!A) {
124381
- let U = Go(r7.parent.tagName), X = $M(jT(r7)), ge = X === void 0 ? "children" : mi(X), fe = gf(l10, R_(ge)), We = p._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;
124425
+ let U = Go(r7.parent.tagName), X = $M(jT(r7)), ge = X === void 0 ? "children" : mi(X), fe = gf2(l10, R_(ge)), We = p._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;
124382
124426
  A = {
124383
124427
  ...We,
124384
124428
  key: "!!ALREADY FORMATTED!!",
@@ -125075,7 +125119,7 @@ ${It.join(`
125075
125119
  if (fAe(Te) && !Te.target.readonly && (Mt = Zr(Eo(Te)[0], Le, 1)) || fAe(Le) && (Le.target.readonly || AM(eu(Te) || Te)) && (Mt = Zr(Te, Eo(Le)[0], 2))) return Mt;
125076
125120
  if (yn & 524288) {
125077
125121
  if (gn(Te) & 32 && !Te.declaration.nameType && Zr(Nm(Le), Wf(Te), 3) && !(tg(Te) & 4)) {
125078
- if (Mt = Zr(Xg(Te), gf(Le, Rd(Te)), 3, rt)) return Mt;
125122
+ if (Mt = Zr(Xg(Te), gf2(Le, Rd(Te)), 3, rt)) return Mt;
125079
125123
  }
125080
125124
  if (l10 === Uo && en & 524288) {
125081
125125
  let Wr = qu(Te);
@@ -125129,7 +125173,7 @@ ${It.join(`
125129
125173
  if (Mt = Zr(Te, Ba.objectType, 2, rt)) return Mt;
125130
125174
  } else {
125131
125175
  let ns = Wr ? us || Ta : us ? ra([us, ca]) : ca;
125132
- if (Mt = Zr(gf(Te, ns), $i, 3, rt)) return Mt;
125176
+ if (Mt = Zr(gf2(Te, ns), $i, 3, rt)) return Mt;
125133
125177
  }
125134
125178
  }
125135
125179
  Yt = J, Wn($t);
@@ -125156,7 +125200,7 @@ ${It.join(`
125156
125200
  if (Mt = Zr(mf(Wr, Te), Le, 1, rt && Wr !== W && !(yn & en & 524288), void 0, wt)) return Mt;
125157
125201
  if (Hfe(Te)) {
125158
125202
  let si = bT(Te.indexType);
125159
- if (si && (Mt = Zr(gf(Te.objectType, si), Le, 1, rt))) return Mt;
125203
+ if (si && (Mt = Zr(gf2(Te.objectType, si), Le, 1, rt))) return Mt;
125160
125204
  }
125161
125205
  }
125162
125206
  } else if (en & 2097152) {
@@ -125900,7 +125944,7 @@ ${It.join(`
125900
125944
  let x10 = Eo(r7), A = [];
125901
125945
  for (let J = a10; J < y; J++) {
125902
125946
  let U = x10[J];
125903
- A.push(r7.target.elementFlags[J] & 8 ? gf(U, Ge) : U);
125947
+ A.push(r7.target.elementFlags[J] & 8 ? gf2(U, Ge) : U);
125904
125948
  }
125905
125949
  return f10 ? ra(A) : Xn(A, d ? 0 : 1);
125906
125950
  }
@@ -126295,7 +126339,7 @@ ${It.join(`
126295
126339
  return a10.type || (a10.type = V$(r7.links.propertyType, r7.links.mappedType, r7.links.constraintType) || W), a10.type;
126296
126340
  }
126297
126341
  function Sit(r7, a10, l10) {
126298
- let f10 = gf(l10.type, Rd(a10)), d = Xg(a10), y = sde(f10);
126342
+ let f10 = gf2(l10.type, Rd(a10)), d = Xg(a10), y = sde(f10);
126299
126343
  return eh([y], r7, d), j_(xAe(y) || W);
126300
126344
  }
126301
126345
  function V$(r7, a10, l10) {
@@ -128390,7 +128434,7 @@ ${It.join(`
128390
128434
  let x10 = N8(y);
128391
128435
  if (x10 && x10.parameters.length === 1 && xu(x10)) {
128392
128436
  let A = pw(Mi(Gr(x10.parameters[0]), (l10 = M2(y)) == null ? void 0 : l10.nonFixingMapper));
128393
- if (A.flags & 134217728 && B_(A, ga) && !ct(y.parameters, Cde)) return gf(Vh(y, A, A, void 0, a10.flowNode), Bd(y.parameters.indexOf(d) - (Cb(y) ? 1 : 0)));
128437
+ if (A.flags & 134217728 && B_(A, ga) && !ct(y.parameters, Cde)) return gf2(Vh(y, A, A, void 0, a10.flowNode), Bd(y.parameters.indexOf(d) - (Cb(y) ? 1 : 0)));
128394
128438
  }
128395
128439
  }
128396
128440
  }
@@ -128818,7 +128862,7 @@ ${It.join(`
128818
128862
  let l10 = Dn(r7).resolvedSignature === ka ? ka : $6(r7);
128819
128863
  if (vu(r7) && a10 === 0) return aX(l10, r7);
128820
128864
  let f10 = l10.parameters.length - 1;
128821
- return xu(l10) && a10 >= f10 ? gf(Gr(l10.parameters[f10]), Bd(a10 - f10), 256) : Wd(l10, a10);
128865
+ return xu(l10) && a10 >= f10 ? gf2(Gr(l10.parameters[f10]), Bd(a10 - f10), 256) : Wd(l10, a10);
128822
128866
  }
128823
128867
  function Rst(r7) {
128824
128868
  let a10 = yme(r7);
@@ -129044,7 +129088,7 @@ ${It.join(`
129044
129088
  let f10 = rb(r7.openingElement.attributes, l10), d = $M(jT(r7));
129045
129089
  if (!(f10 && !xn(f10) && d && d !== "")) return;
129046
129090
  let y = XC(r7.children), x10 = y.indexOf(a10), A = tb(f10, d);
129047
- return A && (y.length === 1 ? A : Vo(A, (J) => $0(J) ? gf(J, Bd(x10)) : J, true));
129091
+ return A && (y.length === 1 ? A : Vo(A, (J) => $0(J) ? gf2(J, Bd(x10)) : J, true));
129048
129092
  }
129049
129093
  function Hst(r7, a10) {
129050
129094
  let l10 = r7.parent;
@@ -129381,7 +129425,7 @@ ${It.join(`
129381
129425
  return Q0(33, qi(r7.expression, a10), Ze, r7.expression);
129382
129426
  }
129383
129427
  function mat(r7) {
129384
- return r7.isSpread ? gf(r7.type, Ge) : r7.type;
129428
+ return r7.isSpread ? gf2(r7.type, Ge) : r7.type;
129385
129429
  }
129386
129430
  function fC(r7) {
129387
129431
  return r7.kind === 209 && !!r7.initializer || r7.kind === 304 && fC(r7.initializer) || r7.kind === 305 && !!r7.objectAssignmentInitializer || r7.kind === 227 && r7.operatorToken.kind === 64;
@@ -130441,7 +130485,7 @@ ${It.join(`
130441
130485
  let fe = ge.kind === 238 ? ge.type : qi(ge.expression);
130442
130486
  $0(fe) ? (A.push(fe), J.push(8)) : (A.push(Q0(33, fe, Ze, ge.kind === 231 ? ge.expression : ge)), J.push(4));
130443
130487
  } else {
130444
- let fe = ga(f10) ? Bde(f10, X - a10, l10 - a10) || W : gf(f10, Bd(X - a10), 256), We = X6(ge, fe, d, y), lt = x10 || yc(fe, 14811132);
130488
+ let fe = ga(f10) ? Bde(f10, X - a10, l10 - a10) || W : gf2(f10, Bd(X - a10), 256), We = X6(ge, fe, d, y), lt = x10 || yc(fe, 14811132);
130445
130489
  A.push(lt ? tu(We) : Kv(We)), J.push(1);
130446
130490
  }
130447
130491
  ge.kind === 238 && ge.tupleNameSource ? U.push(ge.tupleNameSource) : U.push(void 0);
@@ -131532,12 +131576,12 @@ ${It.join(`
131532
131576
  if (a10 < l10) return nR(r7.parameters[a10]);
131533
131577
  if (xu(r7)) {
131534
131578
  let f10 = Gr(r7.parameters[l10]), d = a10 - l10;
131535
- if (!ga(f10) || f10.target.combinedFlags & 12 || d < f10.target.fixedLength) return gf(f10, Bd(d));
131579
+ if (!ga(f10) || f10.target.combinedFlags & 12 || d < f10.target.fixedLength) return gf2(f10, Bd(d));
131536
131580
  }
131537
131581
  }
131538
131582
  function iR(r7, a10, l10) {
131539
131583
  let f10 = J_(r7), d = Ud(r7), y = M8(r7);
131540
- if (y && a10 >= f10 - 1) return a10 === f10 - 1 ? y : pu(gf(y, Ge));
131584
+ if (y && a10 >= f10 - 1) return a10 === f10 - 1 ? y : pu(gf2(y, Ge));
131541
131585
  let x10 = [], A = [], J = [];
131542
131586
  for (let U = a10; U < f10; U++) !y || U < f10 - 1 ? (x10.push(Wd(r7, U)), A.push(U < d ? 1 : 2)) : (x10.push(y), A.push(8)), J.push(qot(r7, U));
131543
131587
  return ng(x10, A, l10, J);
@@ -132239,7 +132283,7 @@ ${It.join(`
132239
132283
  let fe = $s(a10, ap(J));
132240
132284
  fe && (KM(fe, x10, d), qde(x10, false, true, a10, fe));
132241
132285
  }
132242
- let X = Vg(x10, gf(a10, J, 32 | (fC(x10) ? 16 : 0), A));
132286
+ let X = Vg(x10, gf2(a10, J, 32 | (fC(x10) ? 16 : 0), A));
132243
132287
  return zT(x10.kind === 305 ? x10 : x10.initializer, X);
132244
132288
  } else if (x10.kind === 306) if (l10 < y.length - 1) ze(x10, p.A_rest_element_must_be_last_in_a_destructuring_pattern);
132245
132289
  else {
@@ -156308,7 +156352,7 @@ ${It.join(`
156308
156352
  let t7 = e4.system || cl, n8 = e4.host || (e4.host = f9(e4.options, t7)), i8 = dse(e4), s8 = ZU(i8, e4.reportDiagnostic || pk(t7), (o8) => n8.trace && n8.trace(o8), e4.reportErrorSummary || e4.options.pretty ? (o8, c2) => t7.write(qU(o8, c2, t7.newLine, n8)) : void 0);
156309
156353
  return e4.afterProgramEmitAndDiagnostics && e4.afterProgramEmitAndDiagnostics(i8), s8;
156310
156354
  }
156311
- function _9(e4, t7) {
156355
+ function _92(e4, t7) {
156312
156356
  let n8 = _v(e4);
156313
156357
  if (!n8) return;
156314
156358
  let i8;
@@ -156326,7 +156370,7 @@ ${It.join(`
156326
156370
  }
156327
156371
  function dse({ rootNames: e4, options: t7, configFileParsingDiagnostics: n8, projectReferences: i8, host: s8, createProgram: o8 }) {
156328
156372
  s8 = s8 || f9(t7), o8 = o8 || BU;
156329
- let c2 = _9(t7, s8);
156373
+ let c2 = _92(t7, s8);
156330
156374
  return o8(e4, t7, s8, c2, n8, i8);
156331
156375
  }
156332
156376
  function lbe(e4, t7, n8, i8, s8, o8, c2, _) {
@@ -156364,7 +156408,7 @@ ${It.join(`
156364
156408
  let Ke = WU(Ce, I ? qn(Xi(I, w)) : w, false);
156365
156409
  Ce.resolveModuleNameLiterals = Ps(e4, e4.resolveModuleNameLiterals), Ce.resolveModuleNames = Ps(e4, e4.resolveModuleNames), !Ce.resolveModuleNameLiterals && !Ce.resolveModuleNames && (Ce.resolveModuleNameLiterals = Ke.resolveModuleNameLiterals.bind(Ke)), Ce.resolveTypeReferenceDirectiveReferences = Ps(e4, e4.resolveTypeReferenceDirectiveReferences), Ce.resolveTypeReferenceDirectives = Ps(e4, e4.resolveTypeReferenceDirectives), !Ce.resolveTypeReferenceDirectiveReferences && !Ce.resolveTypeReferenceDirectives && (Ce.resolveTypeReferenceDirectiveReferences = Ke.resolveTypeReferenceDirectiveReferences.bind(Ke)), Ce.resolveLibrary = e4.resolveLibrary ? e4.resolveLibrary.bind(e4) : Ke.resolveLibrary.bind(Ke), Ce.getModuleResolutionCache = e4.resolveModuleNameLiterals || e4.resolveModuleNames ? Ps(e4, e4.getModuleResolutionCache) : (() => Ke.getModuleResolutionCache());
156366
156410
  let Be = !!e4.resolveModuleNameLiterals || !!e4.resolveTypeReferenceDirectiveReferences || !!e4.resolveModuleNames || !!e4.resolveTypeReferenceDirectives ? Ps(e4, e4.hasInvalidatedResolutions) || lb : sh, K = e4.resolveLibrary ? Ps(e4, e4.hasInvalidatedLibResolutions) || lb : sh;
156367
- return t7 = _9(G, Ce), mt(), I ? {
156411
+ return t7 = _92(G, Ce), mt(), I ? {
156368
156412
  getCurrentProgram: be,
156369
156413
  getProgram: Gn,
156370
156414
  close: De,
@@ -157003,7 +157047,7 @@ ${It.join(`
157003
157047
  }
157004
157048
  function jBe({ options: e4, builderPrograms: t7, compilerHost: n8 }, i8, s8) {
157005
157049
  if (e4.force) return;
157006
- return t7.get(i8) || _9(s8.options, n8);
157050
+ return t7.get(i8) || _92(s8.options, n8);
157007
157051
  }
157008
157052
  function BBe(e4, t7) {
157009
157053
  t7 && (e4.host.afterProgramEmitAndDiagnostics && e4.host.afterProgramEmitAndDiagnostics(t7), t7.releaseProgram()), e4.projectCompilerOptions = e4.baseCompilerOptions;
@@ -188061,7 +188105,7 @@ ${i8.prefix}` : `
188061
188105
  rangeOverlapsWithStartEnd: () => TP,
188062
188106
  rangeStartIsOnSameLineAsRangeEnd: () => See,
188063
188107
  rangeStartPositionsAreOnSameLine: () => q5,
188064
- readBuilderProgram: () => _9,
188108
+ readBuilderProgram: () => _92,
188065
188109
  readConfigFile: () => aA,
188066
188110
  readJson: () => KC,
188067
188111
  readJsonConfigFile: () => Xre,
@@ -195375,10 +195419,10 @@ function moduleImportNodesCacheKey(source, options) {
195375
195419
  async function collectModuleImportNodes(source, options) {
195376
195420
  const literalImports = [];
195377
195421
  const dynamicImportExpressions = [];
195378
- function visit2(node2) {
195422
+ function visit4(node2) {
195379
195423
  if (node2 == null || typeof node2 !== "object") return;
195380
195424
  if (Array.isArray(node2)) {
195381
- for (const item of node2) visit2(item);
195425
+ for (const item of node2) visit4(item);
195382
195426
  return;
195383
195427
  }
195384
195428
  if (!("type" in node2)) return;
@@ -195429,13 +195473,13 @@ async function collectModuleImportNodes(source, options) {
195429
195473
  )) {
195430
195474
  if (value == null) continue;
195431
195475
  if (typeof value === "object") {
195432
- visit2(value);
195476
+ visit4(value);
195433
195477
  }
195434
195478
  }
195435
195479
  }
195436
195480
  await loadModuleSourceParser();
195437
195481
  try {
195438
- visit2(await parseModuleSource(source, { filePath: options?.filePath }));
195482
+ visit4(await parseModuleSource(source, { filePath: options?.filePath }));
195439
195483
  } catch {
195440
195484
  return { literalImports: [], dynamicImportExpressions: [] };
195441
195485
  }
@@ -195471,8 +195515,8 @@ function unwrapTypeOnlyExpression(node2) {
195471
195515
  }
195472
195516
  function readStaticSpecifierNode(wrapped) {
195473
195517
  const node2 = unwrapTypeOnlyExpression(wrapped);
195474
- const literal3 = readLiteralStringNode(node2);
195475
- if (literal3) return literal3.specifier;
195518
+ const literal4 = readLiteralStringNode(node2);
195519
+ if (literal4) return literal4.specifier;
195476
195520
  if (node2 == null || typeof node2 !== "object") return null;
195477
195521
  const template = node2;
195478
195522
  if (template.type === "TemplateLiteral" && template.expressions?.length === 0 && template.quasis?.length === 1) {
@@ -195498,10 +195542,10 @@ async function parseBundlerResolvedSpecifiers(source, options) {
195498
195542
  const specifier = readStaticSpecifierNode(node2);
195499
195543
  if (specifier != null) specifiers.push(specifier);
195500
195544
  };
195501
- function visit2(node2) {
195545
+ function visit4(node2) {
195502
195546
  if (node2 == null || typeof node2 !== "object") return;
195503
195547
  if (Array.isArray(node2)) {
195504
- for (const item of node2) visit2(item);
195548
+ for (const item of node2) visit4(item);
195505
195549
  return;
195506
195550
  }
195507
195551
  if (!("type" in node2)) return;
@@ -195534,10 +195578,10 @@ async function parseBundlerResolvedSpecifiers(source, options) {
195534
195578
  for (const value of Object.values(
195535
195579
  typedNode
195536
195580
  )) {
195537
- if (value != null && typeof value === "object") visit2(value);
195581
+ if (value != null && typeof value === "object") visit4(value);
195538
195582
  }
195539
195583
  }
195540
- visit2(program);
195584
+ visit4(program);
195541
195585
  return { ok: true, specifiers };
195542
195586
  }
195543
195587
  async function collectLiteralImportSpecifiers(source, options) {
@@ -197348,10 +197392,31 @@ var init_allowed_hosts2 = __esm({
197348
197392
  });
197349
197393
 
197350
197394
  // ../worker/src/credentials/credential-request.ts
197395
+ function isCredentialPlacementHeader(name) {
197396
+ const lower = name.toLowerCase();
197397
+ return /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(name) && !reservedPlacementHeaders.has(lower) && !lower.startsWith("x-kody-");
197398
+ }
197399
+ var reservedPlacementHeaders;
197351
197400
  var init_credential_request = __esm({
197352
197401
  "../worker/src/credentials/credential-request.ts"() {
197353
197402
  "use strict";
197354
197403
  init_allowed_hosts2();
197404
+ reservedPlacementHeaders = /* @__PURE__ */ new Set([
197405
+ "connection",
197406
+ "content-encoding",
197407
+ "content-length",
197408
+ "content-type",
197409
+ "host",
197410
+ "keep-alive",
197411
+ "proxy-authorization",
197412
+ "te",
197413
+ "trailer",
197414
+ "transfer-encoding",
197415
+ "upgrade",
197416
+ "user-agent",
197417
+ "x-http-method-override",
197418
+ "x-method-override"
197419
+ ]);
197355
197420
  }
197356
197421
  });
197357
197422
 
@@ -202006,6 +202071,21 @@ var init_sealed_token = __esm({
202006
202071
  }
202007
202072
  });
202008
202073
 
202074
+ // ../worker/src/mcp/secrets/vault-item-config.ts
202075
+ var vaultItemConfigSchema;
202076
+ var init_vault_item_config = __esm({
202077
+ "../worker/src/mcp/secrets/vault-item-config.ts"() {
202078
+ "use strict";
202079
+ init_zod();
202080
+ vaultItemConfigSchema = external_exports.strictObject({
202081
+ kind: external_exports.literal("vault-item"),
202082
+ bindingId: external_exports.string().min(1),
202083
+ providerId: external_exports.string().min(1),
202084
+ encryptedRef: external_exports.string().min(1)
202085
+ });
202086
+ }
202087
+ });
202088
+
202009
202089
  // ../worker/src/mcp/secrets/update-secret-placement.ts
202010
202090
  var init_update_secret_placement = __esm({
202011
202091
  "../worker/src/mcp/secrets/update-secret-placement.ts"() {
@@ -202037,6 +202117,7 @@ var init_service6 = __esm({
202037
202117
  init_resolve_package_secret_placement();
202038
202118
  init_sealed_token();
202039
202119
  init_disconnected();
202120
+ init_vault_item_config();
202040
202121
  init_update_secret_placement();
202041
202122
  init_credential_audit();
202042
202123
  init_audit_log();
@@ -203378,14 +203459,14 @@ function normalizeJoin(directory, relativePath2) {
203378
203459
  const absolute = directory.startsWith("/");
203379
203460
  const segments = directory.split("/").filter(Boolean);
203380
203461
  const floor = segments.length;
203381
- for (const segment of relativePath2.split("/")) {
203382
- if (segment === "" || segment === ".") continue;
203383
- if (segment === "..") {
203462
+ for (const segment2 of relativePath2.split("/")) {
203463
+ if (segment2 === "" || segment2 === ".") continue;
203464
+ if (segment2 === "..") {
203384
203465
  if (segments.length <= floor) return null;
203385
203466
  segments.pop();
203386
203467
  continue;
203387
203468
  }
203388
- segments.push(segment);
203469
+ segments.push(segment2);
203389
203470
  }
203390
203471
  const joined = segments.join("/");
203391
203472
  return absolute ? `/${joined}` : joined;
@@ -205189,6 +205270,608 @@ var init_secret_placeholder_request_placement = __esm({
205189
205270
  }
205190
205271
  });
205191
205272
 
205273
+ // ../../node_modules/jsonc-parser/lib/esm/impl/scanner.js
205274
+ var CharacterCodes;
205275
+ var init_scanner = __esm({
205276
+ "../../node_modules/jsonc-parser/lib/esm/impl/scanner.js"() {
205277
+ "use strict";
205278
+ (function(CharacterCodes2) {
205279
+ CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
205280
+ CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
205281
+ CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
205282
+ CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
205283
+ CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
205284
+ CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
205285
+ CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
205286
+ CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
205287
+ CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
205288
+ CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
205289
+ CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
205290
+ CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
205291
+ CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
205292
+ CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
205293
+ CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
205294
+ CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
205295
+ CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
205296
+ CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
205297
+ CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
205298
+ CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
205299
+ CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
205300
+ CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
205301
+ CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
205302
+ CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
205303
+ CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
205304
+ CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
205305
+ CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
205306
+ CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
205307
+ CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
205308
+ CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
205309
+ CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
205310
+ CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
205311
+ CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
205312
+ CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
205313
+ CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
205314
+ CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
205315
+ CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
205316
+ CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
205317
+ CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
205318
+ CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
205319
+ CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
205320
+ CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
205321
+ CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
205322
+ CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
205323
+ CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
205324
+ CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
205325
+ CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
205326
+ CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
205327
+ CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
205328
+ CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
205329
+ CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
205330
+ CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
205331
+ CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
205332
+ CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
205333
+ CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
205334
+ CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
205335
+ CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
205336
+ CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
205337
+ CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
205338
+ CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
205339
+ CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
205340
+ CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
205341
+ CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
205342
+ CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
205343
+ CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
205344
+ CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
205345
+ CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
205346
+ CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
205347
+ CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
205348
+ CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
205349
+ CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
205350
+ CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
205351
+ CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
205352
+ CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
205353
+ CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
205354
+ CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
205355
+ CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
205356
+ CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
205357
+ CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
205358
+ CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
205359
+ })(CharacterCodes || (CharacterCodes = {}));
205360
+ }
205361
+ });
205362
+
205363
+ // ../../node_modules/jsonc-parser/lib/esm/impl/string-intern.js
205364
+ var cachedSpaces, maxCachedValues, cachedBreakLinesWithSpaces;
205365
+ var init_string_intern = __esm({
205366
+ "../../node_modules/jsonc-parser/lib/esm/impl/string-intern.js"() {
205367
+ cachedSpaces = new Array(20).fill(0).map((_, index) => {
205368
+ return " ".repeat(index);
205369
+ });
205370
+ maxCachedValues = 200;
205371
+ cachedBreakLinesWithSpaces = {
205372
+ " ": {
205373
+ "\n": new Array(maxCachedValues).fill(0).map((_, index) => {
205374
+ return "\n" + " ".repeat(index);
205375
+ }),
205376
+ "\r": new Array(maxCachedValues).fill(0).map((_, index) => {
205377
+ return "\r" + " ".repeat(index);
205378
+ }),
205379
+ "\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
205380
+ return "\r\n" + " ".repeat(index);
205381
+ })
205382
+ },
205383
+ " ": {
205384
+ "\n": new Array(maxCachedValues).fill(0).map((_, index) => {
205385
+ return "\n" + " ".repeat(index);
205386
+ }),
205387
+ "\r": new Array(maxCachedValues).fill(0).map((_, index) => {
205388
+ return "\r" + " ".repeat(index);
205389
+ }),
205390
+ "\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
205391
+ return "\r\n" + " ".repeat(index);
205392
+ })
205393
+ }
205394
+ };
205395
+ }
205396
+ });
205397
+
205398
+ // ../../node_modules/jsonc-parser/lib/esm/impl/format.js
205399
+ var init_format = __esm({
205400
+ "../../node_modules/jsonc-parser/lib/esm/impl/format.js"() {
205401
+ "use strict";
205402
+ init_scanner();
205403
+ init_string_intern();
205404
+ }
205405
+ });
205406
+
205407
+ // ../../node_modules/jsonc-parser/lib/esm/impl/parser.js
205408
+ var ParseOptions;
205409
+ var init_parser2 = __esm({
205410
+ "../../node_modules/jsonc-parser/lib/esm/impl/parser.js"() {
205411
+ "use strict";
205412
+ init_scanner();
205413
+ (function(ParseOptions2) {
205414
+ ParseOptions2.DEFAULT = {
205415
+ allowTrailingComma: false
205416
+ };
205417
+ })(ParseOptions || (ParseOptions = {}));
205418
+ }
205419
+ });
205420
+
205421
+ // ../../node_modules/jsonc-parser/lib/esm/impl/edit.js
205422
+ var init_edit = __esm({
205423
+ "../../node_modules/jsonc-parser/lib/esm/impl/edit.js"() {
205424
+ "use strict";
205425
+ init_format();
205426
+ init_parser2();
205427
+ }
205428
+ });
205429
+
205430
+ // ../../node_modules/jsonc-parser/lib/esm/main.js
205431
+ var ScanError, SyntaxKind, ParseErrorCode;
205432
+ var init_main = __esm({
205433
+ "../../node_modules/jsonc-parser/lib/esm/main.js"() {
205434
+ "use strict";
205435
+ init_format();
205436
+ init_edit();
205437
+ init_scanner();
205438
+ init_parser2();
205439
+ (function(ScanError2) {
205440
+ ScanError2[ScanError2["None"] = 0] = "None";
205441
+ ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
205442
+ ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
205443
+ ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
205444
+ ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
205445
+ ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
205446
+ ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
205447
+ })(ScanError || (ScanError = {}));
205448
+ (function(SyntaxKind2) {
205449
+ SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
205450
+ SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
205451
+ SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
205452
+ SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
205453
+ SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
205454
+ SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
205455
+ SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
205456
+ SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
205457
+ SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
205458
+ SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
205459
+ SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
205460
+ SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
205461
+ SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
205462
+ SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
205463
+ SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
205464
+ SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
205465
+ SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
205466
+ })(SyntaxKind || (SyntaxKind = {}));
205467
+ (function(ParseErrorCode2) {
205468
+ ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
205469
+ ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
205470
+ ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
205471
+ ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
205472
+ ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
205473
+ ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
205474
+ ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
205475
+ ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
205476
+ ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
205477
+ ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
205478
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
205479
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
205480
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
205481
+ ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
205482
+ ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
205483
+ ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
205484
+ })(ParseErrorCode || (ParseErrorCode = {}));
205485
+ }
205486
+ });
205487
+
205488
+ // ../../node_modules/@stablelib/random/lib/source/system.js
205489
+ var QUOTA, SystemRandomSource;
205490
+ var init_system = __esm({
205491
+ "../../node_modules/@stablelib/random/lib/source/system.js"() {
205492
+ QUOTA = 65536;
205493
+ SystemRandomSource = class {
205494
+ isAvailable = false;
205495
+ isInstantiated = false;
205496
+ constructor() {
205497
+ if (typeof crypto !== "undefined" && "getRandomValues" in crypto) {
205498
+ this.isAvailable = true;
205499
+ this.isInstantiated = true;
205500
+ }
205501
+ }
205502
+ randomBytes(length) {
205503
+ if (!this.isAvailable) {
205504
+ throw new Error("System random byte generator is not available.");
205505
+ }
205506
+ const out = new Uint8Array(length);
205507
+ for (let i4 = 0; i4 < out.length; i4 += QUOTA) {
205508
+ crypto.getRandomValues(out.subarray(i4, i4 + Math.min(out.length - i4, QUOTA)));
205509
+ }
205510
+ return out;
205511
+ }
205512
+ };
205513
+ }
205514
+ });
205515
+
205516
+ // ../../node_modules/@stablelib/int/lib/int.js
205517
+ var isInteger, MAX_SAFE_INTEGER, isSafeInteger;
205518
+ var init_int = __esm({
205519
+ "../../node_modules/@stablelib/int/lib/int.js"() {
205520
+ isInteger = Number.isInteger;
205521
+ MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
205522
+ isSafeInteger = Number.isSafeInteger;
205523
+ }
205524
+ });
205525
+
205526
+ // ../../node_modules/@stablelib/binary/lib/binary.js
205527
+ var init_binary = __esm({
205528
+ "../../node_modules/@stablelib/binary/lib/binary.js"() {
205529
+ init_int();
205530
+ }
205531
+ });
205532
+
205533
+ // ../../node_modules/@stablelib/wipe/lib/wipe.js
205534
+ var init_wipe = __esm({
205535
+ "../../node_modules/@stablelib/wipe/lib/wipe.js"() {
205536
+ }
205537
+ });
205538
+
205539
+ // ../../node_modules/@stablelib/random/lib/random.js
205540
+ var defaultRandomSource;
205541
+ var init_random = __esm({
205542
+ "../../node_modules/@stablelib/random/lib/random.js"() {
205543
+ init_system();
205544
+ init_binary();
205545
+ init_wipe();
205546
+ defaultRandomSource = new SystemRandomSource();
205547
+ }
205548
+ });
205549
+
205550
+ // ../../node_modules/@stablelib/x25519/lib/x25519.js
205551
+ function gf(init) {
205552
+ const r3 = new Float64Array(16);
205553
+ if (init) {
205554
+ for (let i4 = 0; i4 < init.length; i4++) {
205555
+ r3[i4] = init[i4];
205556
+ }
205557
+ }
205558
+ return r3;
205559
+ }
205560
+ var _9, _121665;
205561
+ var init_x25519 = __esm({
205562
+ "../../node_modules/@stablelib/x25519/lib/x25519.js"() {
205563
+ init_random();
205564
+ init_wipe();
205565
+ _9 = new Uint8Array(32);
205566
+ _9[0] = 9;
205567
+ _121665 = gf([56129, 1]);
205568
+ }
205569
+ });
205570
+
205571
+ // ../../node_modules/@stablelib/salsa20/lib/salsa20.js
205572
+ var init_salsa20 = __esm({
205573
+ "../../node_modules/@stablelib/salsa20/lib/salsa20.js"() {
205574
+ init_binary();
205575
+ init_wipe();
205576
+ }
205577
+ });
205578
+
205579
+ // ../../node_modules/@stablelib/xsalsa20/lib/xsalsa20.js
205580
+ var init_xsalsa20 = __esm({
205581
+ "../../node_modules/@stablelib/xsalsa20/lib/xsalsa20.js"() {
205582
+ init_binary();
205583
+ init_salsa20();
205584
+ init_wipe();
205585
+ }
205586
+ });
205587
+
205588
+ // ../../node_modules/@stablelib/constant-time/lib/constant-time.js
205589
+ var init_constant_time = __esm({
205590
+ "../../node_modules/@stablelib/constant-time/lib/constant-time.js"() {
205591
+ }
205592
+ });
205593
+
205594
+ // ../../node_modules/@stablelib/poly1305/lib/poly1305.js
205595
+ var init_poly1305 = __esm({
205596
+ "../../node_modules/@stablelib/poly1305/lib/poly1305.js"() {
205597
+ init_constant_time();
205598
+ init_wipe();
205599
+ }
205600
+ });
205601
+
205602
+ // ../../node_modules/@stablelib/nacl/lib/secretbox.js
205603
+ var init_secretbox = __esm({
205604
+ "../../node_modules/@stablelib/nacl/lib/secretbox.js"() {
205605
+ init_xsalsa20();
205606
+ init_poly1305();
205607
+ init_wipe();
205608
+ init_random();
205609
+ }
205610
+ });
205611
+
205612
+ // ../../node_modules/@stablelib/nacl/lib/box.js
205613
+ var zeros16;
205614
+ var init_box = __esm({
205615
+ "../../node_modules/@stablelib/nacl/lib/box.js"() {
205616
+ init_x25519();
205617
+ init_xsalsa20();
205618
+ init_secretbox();
205619
+ init_wipe();
205620
+ init_x25519();
205621
+ zeros16 = new Uint8Array(16);
205622
+ }
205623
+ });
205624
+
205625
+ // ../../node_modules/@stablelib/nacl/lib/nacl.js
205626
+ var init_nacl = __esm({
205627
+ "../../node_modules/@stablelib/nacl/lib/nacl.js"() {
205628
+ init_box();
205629
+ init_secretbox();
205630
+ }
205631
+ });
205632
+
205633
+ // ../worker/src/credentials/sealed-box.ts
205634
+ var init_sealed_box = __esm({
205635
+ "../worker/src/credentials/sealed-box.ts"() {
205636
+ "use strict";
205637
+ init_base64();
205638
+ init_nacl();
205639
+ init_x25519();
205640
+ }
205641
+ });
205642
+
205643
+ // ../worker/src/credentials/body-placement.ts
205644
+ function isCanonicalEndpoint(endpoint) {
205645
+ try {
205646
+ const url3 = new URL(endpoint);
205647
+ return url3.protocol === "https:" && !url3.username && !url3.password && !url3.search && !url3.hash && `${url3.origin}${url3.pathname}` === endpoint && !/%|\/\//.test(url3.pathname);
205648
+ } catch {
205649
+ return false;
205650
+ }
205651
+ }
205652
+ function overlaps(left, right) {
205653
+ return left.length <= right.length ? left.every((key, index) => key === right[index]) : overlaps(right, left);
205654
+ }
205655
+ var maxBodyBytes, forbiddenKeys, fieldName, fieldPath, bodyPlacementSchema;
205656
+ var init_body_placement = __esm({
205657
+ "../worker/src/credentials/body-placement.ts"() {
205658
+ "use strict";
205659
+ init_main();
205660
+ init_zod();
205661
+ init_credential_request();
205662
+ init_sealed_box();
205663
+ maxBodyBytes = 256 * 1024;
205664
+ forbiddenKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
205665
+ fieldName = external_exports.string().min(1).max(100).refine((key) => !forbiddenKeys.has(key), "This field name is reserved.");
205666
+ fieldPath = external_exports.array(external_exports.union([fieldName, external_exports.int().min(0).max(999)])).min(1).max(12);
205667
+ bodyPlacementSchema = external_exports.strictObject({
205668
+ kind: external_exports.literal("body"),
205669
+ packageId: external_exports.string().min(1).max(100),
205670
+ endpoint: external_exports.string().max(2e3).refine(
205671
+ isCanonicalEndpoint,
205672
+ "Use a canonical HTTPS endpoint without user info, query, fragment, or encoded path segments."
205673
+ ),
205674
+ method: external_exports.enum(["POST", "PUT", "PATCH", "DELETE"]),
205675
+ mediaType: external_exports.literal("application/json"),
205676
+ fields: external_exports.array(fieldPath).min(1).max(16),
205677
+ selectors: external_exports.array(
205678
+ external_exports.strictObject({
205679
+ path: fieldPath,
205680
+ value: external_exports.union([external_exports.string().max(1e3), external_exports.boolean(), external_exports.int()])
205681
+ })
205682
+ ).max(16).default([]),
205683
+ graphql: external_exports.strictObject({
205684
+ document: external_exports.string().min(1).max(2e4),
205685
+ operationName: external_exports.string().regex(/^[_A-Za-z][_0-9A-Za-z]*$/).max(100)
205686
+ }).optional(),
205687
+ output: external_exports.discriminatedUnion("format", [
205688
+ external_exports.strictObject({ format: external_exports.literal("plaintext") }),
205689
+ external_exports.strictObject({
205690
+ format: external_exports.literal("sealed-box-base64"),
205691
+ recipientPublicKey: external_exports.string().regex(/^[A-Za-z0-9+/]{43}=$/),
205692
+ recipientKeyId: external_exports.string().min(1).max(256),
205693
+ keyIdField: fieldPath
205694
+ })
205695
+ ]).default({ format: "plaintext" })
205696
+ }).superRefine((placement, ctx) => {
205697
+ const writes = [...placement.fields];
205698
+ if (placement.output.format === "sealed-box-base64") {
205699
+ writes.push(placement.output.keyIdField);
205700
+ }
205701
+ const paths = [...writes, ...placement.selectors.map(({ path }) => path)];
205702
+ for (const [index, path] of paths.entries()) {
205703
+ if (paths.slice(0, index).some((prior) => overlaps(prior, path)) || typeof path[0] !== "string" || placement.graphql && (path[0] !== "variables" || path.length < 2 || typeof path[1] !== "string")) {
205704
+ ctx.addIssue({
205705
+ code: "custom",
205706
+ message: "Placement paths must be distinct, non-overlapping object fields (inside variables for GraphQL)."
205707
+ });
205708
+ return;
205709
+ }
205710
+ }
205711
+ if (writes.some((path) => typeof path.at(-1) !== "string")) {
205712
+ ctx.addIssue({
205713
+ code: "custom",
205714
+ message: "A placed value must end at an object field."
205715
+ });
205716
+ }
205717
+ if (placement.graphql && placement.selectors.length === 0) {
205718
+ ctx.addIssue({
205719
+ code: "custom",
205720
+ message: "Pin at least one GraphQL resource selector."
205721
+ });
205722
+ }
205723
+ });
205724
+ }
205725
+ });
205726
+
205727
+ // ../worker/src/credentials/path-placement.ts
205728
+ var segmentPattern, segment, origin, pathPlacementSchema;
205729
+ var init_path_placement = __esm({
205730
+ "../worker/src/credentials/path-placement.ts"() {
205731
+ "use strict";
205732
+ init_zod();
205733
+ init_credential_request();
205734
+ segmentPattern = /^[a-zA-Z0-9_~-][a-zA-Z0-9._~-]{0,127}$/;
205735
+ segment = external_exports.string().regex(segmentPattern);
205736
+ origin = external_exports.string().max(500).refine((value) => {
205737
+ try {
205738
+ const parsed = new URL(value);
205739
+ return parsed.protocol === "https:" && parsed.origin === value;
205740
+ } catch {
205741
+ return false;
205742
+ }
205743
+ }, "Use a canonical HTTPS origin.");
205744
+ pathPlacementSchema = external_exports.strictObject({
205745
+ kind: external_exports.literal("path"),
205746
+ packageId: external_exports.string().min(1).max(100),
205747
+ origin,
205748
+ method: external_exports.enum(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]),
205749
+ segments: external_exports.array(
205750
+ external_exports.union([
205751
+ segment,
205752
+ external_exports.strictObject({ parameter: external_exports.enum(["slug", "integer", "uuid"]) }),
205753
+ external_exports.strictObject({ credential: external_exports.literal(true) })
205754
+ ])
205755
+ ).min(2).max(24).refine(
205756
+ (segments) => segments.filter(
205757
+ (part) => typeof part === "object" && "credential" in part
205758
+ ).length === 1,
205759
+ "Include exactly one credential segment."
205760
+ )
205761
+ });
205762
+ }
205763
+ });
205764
+
205765
+ // ../worker/src/credentials/credential-composition.ts
205766
+ function siteCredentialIds(site) {
205767
+ switch (site.kind) {
205768
+ case "header":
205769
+ return site.parts.flatMap(
205770
+ (part) => typeof part === "string" ? [] : [part.credentialId]
205771
+ );
205772
+ case "basic":
205773
+ return [site.usernameId, site.passwordId];
205774
+ case "query":
205775
+ case "body":
205776
+ case "connection":
205777
+ return [site.credentialId];
205778
+ }
205779
+ }
205780
+ function compositionCredentialIds(profile) {
205781
+ return new Set(profile.sites.flatMap(siteCredentialIds));
205782
+ }
205783
+ var credentialId, headerName, literal3, headerPart, compositionSite, credentialCompositionSchema;
205784
+ var init_credential_composition = __esm({
205785
+ "../worker/src/credentials/credential-composition.ts"() {
205786
+ "use strict";
205787
+ init_base64();
205788
+ init_zod();
205789
+ init_body_placement();
205790
+ init_credential_request();
205791
+ credentialId = external_exports.string().min(1).max(100);
205792
+ headerName = external_exports.string().regex(/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/);
205793
+ literal3 = external_exports.string().max(200).regex(/^[\x20-\x7e]*$/);
205794
+ headerPart = external_exports.union([literal3, external_exports.strictObject({ credentialId })]);
205795
+ compositionSite = external_exports.union([
205796
+ external_exports.strictObject({
205797
+ kind: external_exports.literal("header"),
205798
+ name: headerName,
205799
+ parts: external_exports.array(headerPart).min(1).max(24).refine((parts) => parts.some((part) => typeof part !== "string"))
205800
+ }),
205801
+ external_exports.strictObject({
205802
+ kind: external_exports.literal("basic"),
205803
+ usernameId: credentialId,
205804
+ passwordId: credentialId
205805
+ }),
205806
+ external_exports.strictObject({
205807
+ kind: external_exports.literal("query"),
205808
+ param: external_exports.string().min(1).max(100),
205809
+ credentialId
205810
+ }),
205811
+ external_exports.strictObject({
205812
+ kind: external_exports.literal("body"),
205813
+ credentialId,
205814
+ placement: bodyPlacementSchema
205815
+ }),
205816
+ external_exports.strictObject({
205817
+ kind: external_exports.literal("connection"),
205818
+ connection: external_exports.enum(["login", "oauth"]),
205819
+ credentialId,
205820
+ inject: external_exports.union([
205821
+ external_exports.strictObject({
205822
+ kind: external_exports.literal("header"),
205823
+ name: headerName,
205824
+ format: literal3
205825
+ }),
205826
+ external_exports.strictObject({
205827
+ kind: external_exports.literal("query"),
205828
+ param: external_exports.string().min(1).max(100)
205829
+ })
205830
+ ])
205831
+ })
205832
+ ]);
205833
+ credentialCompositionSchema = external_exports.strictObject({
205834
+ kind: external_exports.literal("composition"),
205835
+ packageId: external_exports.string().min(1).max(100),
205836
+ endpoint: external_exports.string().max(2e3).refine(isCanonicalEndpoint),
205837
+ method: external_exports.enum(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]),
205838
+ entryCredentialId: credentialId,
205839
+ publicBody: external_exports.literal("application/json").optional(),
205840
+ sites: external_exports.array(compositionSite).min(1).max(16)
205841
+ }).superRefine((profile, ctx) => {
205842
+ if (profile.publicBody && (profile.method === "GET" || profile.method === "HEAD" || profile.sites.some((site) => site.kind === "body"))) {
205843
+ ctx.addIssue({
205844
+ code: "custom",
205845
+ message: "Approve a public JSON body only on a body-capable method without credential body fields."
205846
+ });
205847
+ }
205848
+ const ids = compositionCredentialIds(profile);
205849
+ if (ids.size < 2 || ids.size > 8 || !ids.has(profile.entryCredentialId)) {
205850
+ ctx.addIssue({
205851
+ code: "custom",
205852
+ message: "Approve two to eight credentials, including the entry credential."
205853
+ });
205854
+ }
205855
+ for (const site of profile.sites) {
205856
+ if (site.kind === "connection" && (profile.entryCredentialId === site.credentialId || profile.sites.filter(
205857
+ (entry) => siteCredentialIds(entry).includes(site.credentialId)
205858
+ ).length !== 1 || site.connection === "oauth" && (site.inject.kind !== "header" || site.inject.name !== "Authorization" || site.inject.format !== "Bearer {value}"))) {
205859
+ ctx.addIssue({
205860
+ code: "custom",
205861
+ message: "A connection must occupy its own approved location. OAuth uses Authorization: Bearer."
205862
+ });
205863
+ }
205864
+ if (site.kind === "body" && (site.placement.endpoint !== profile.endpoint || site.placement.method !== profile.method || site.placement.packageId !== profile.packageId)) {
205865
+ ctx.addIssue({
205866
+ code: "custom",
205867
+ message: "Every body placement must use the composition package, method, and endpoint."
205868
+ });
205869
+ }
205870
+ }
205871
+ });
205872
+ }
205873
+ });
205874
+
205192
205875
  // ../worker/src/credentials/credential-resolver.ts
205193
205876
  var init_credential_resolver = __esm({
205194
205877
  "../worker/src/credentials/credential-resolver.ts"() {
@@ -205217,6 +205900,7 @@ var init_login_resolver = __esm({
205217
205900
  "use strict";
205218
205901
  init_zod();
205219
205902
  init_read_bounded_body();
205903
+ init_ssrf();
205220
205904
  init_crypto();
205221
205905
  init_service6();
205222
205906
  init_org_audit();
@@ -205245,7 +205929,16 @@ var init_login_resolver = __esm({
205245
205929
  refreshToken: external_exports.object({
205246
205930
  path: external_exports.string().min(1),
205247
205931
  field: external_exports.string().regex(/^[A-Za-z0-9_.-]+$/)
205248
- }).strict().optional()
205932
+ }).strict().optional(),
205933
+ singleRequest: external_exports.strictObject({
205934
+ logoutUrl: external_exports.url({ protocol: /^https$/ }),
205935
+ headers: external_exports.array(
205936
+ external_exports.strictObject({
205937
+ name: external_exports.string().max(100).refine(isCredentialPlacementHeader),
205938
+ field: external_exports.string().regex(/^[A-Za-z0-9_.-]+$/)
205939
+ })
205940
+ ).max(8).default([])
205941
+ }).optional()
205249
205942
  }).strict().refine(
205250
205943
  (exchange) => !exchange.refreshToken || Object.values(exchange.body).some(
205251
205944
  (template) => template.includes(`{${exchange.refreshToken.field}}`)
@@ -205254,7 +205947,24 @@ var init_login_resolver = __esm({
205254
205947
  message: "refreshToken.field must be a login field the exchange body sends.",
205255
205948
  path: ["refreshToken", "field"]
205256
205949
  }
205257
- );
205950
+ ).superRefine((exchange, ctx) => {
205951
+ const profile = exchange.singleRequest;
205952
+ if (!profile) return;
205953
+ const loginUrl = URL.parse(exchange.url);
205954
+ const logoutUrl = URL.parse(profile.logoutUrl);
205955
+ const names = profile.headers.map(({ name }) => name.toLowerCase());
205956
+ if (exchange.refreshToken || !loginUrl || loginUrl.protocol !== "https:" || loginUrl.hash || !isPublicFetchHostname(loginUrl.hostname) || !logoutUrl || logoutUrl.origin !== loginUrl.origin || logoutUrl.username || logoutUrl.password || logoutUrl.hash || new Set(names).size !== names.length || profile.headers.some(
205957
+ ({ field }) => !Object.values(exchange.body).some(
205958
+ (value) => value.includes(`{${field}}`)
205959
+ )
205960
+ )) {
205961
+ ctx.addIssue({
205962
+ code: "custom",
205963
+ path: ["singleRequest"],
205964
+ message: "Single-request Login requires a same-origin logout URL, distinct headers from existing login fields, and no refresh token rotation."
205965
+ });
205966
+ }
205967
+ });
205258
205968
  sessionInjectSchema = external_exports.discriminatedUnion("kind", [
205259
205969
  external_exports.object({
205260
205970
  kind: external_exports.literal("header"),
@@ -205288,6 +205998,9 @@ var init_credential_fields = __esm({
205288
205998
  init_caller_error();
205289
205999
  init_org_audit();
205290
206000
  init_credential_ids();
206001
+ init_body_placement();
206002
+ init_path_placement();
206003
+ init_credential_composition();
205291
206004
  init_credential_request();
205292
206005
  init_fill_placement();
205293
206006
  init_fill_placement_opt_ins();
@@ -205303,7 +206016,7 @@ var init_credential_fields = __esm({
205303
206016
  external_exports.strictObject({
205304
206017
  kind: external_exports.literal("header"),
205305
206018
  name: external_exports.string().regex(httpFieldNamePattern4),
205306
- format: external_exports.string().max(200).refine((format) => format.split("{value}").length === 2, {
206019
+ format: external_exports.string().max(200).refine((format2) => format2.split("{value}").length === 2, {
205307
206020
  message: 'An inject format holds "{value}" exactly once.'
205308
206021
  })
205309
206022
  }),
@@ -205315,7 +206028,10 @@ var init_credential_fields = __esm({
205315
206028
  external_exports.strictObject({
205316
206029
  kind: external_exports.literal("query"),
205317
206030
  param: external_exports.string().min(1).max(100)
205318
- })
206031
+ }),
206032
+ bodyPlacementSchema,
206033
+ pathPlacementSchema,
206034
+ credentialCompositionSchema
205319
206035
  ]);
205320
206036
  hostLabel = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
205321
206037
  bareHostPattern = new RegExp(