@fern-api/fern-api-dev 5.35.0 → 5.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.cjs +439 -222
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -6865,14 +6865,14 @@ var init_RequireInTheMiddleSingleton = __esm({
6865
6865
  { internals: true },
6866
6866
  (exports2, name2, basedir) => {
6867
6867
  const normalizedModuleName = normalizePathSeparators(name2);
6868
- const matches = this._moduleNameTrie.search(normalizedModuleName, {
6868
+ const matches2 = this._moduleNameTrie.search(normalizedModuleName, {
6869
6869
  maintainInsertionOrder: true,
6870
6870
  // For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises').
6871
6871
  // This matches the behavior of `require-in-the-middle`.
6872
6872
  // `basedir` is always `undefined` for core modules.
6873
6873
  fullOnly: basedir === void 0
6874
6874
  });
6875
- for (const { onRequire } of matches) {
6875
+ for (const { onRequire } of matches2) {
6876
6876
  exports2 = onRequire(exports2, name2, basedir);
6877
6877
  }
6878
6878
  return exports2;
@@ -7939,12 +7939,12 @@ var require_utils = __commonJS({
7939
7939
  if (requestOptions.hostname && requestOptions.port) {
7940
7940
  return { hostname: requestOptions.hostname, port: requestOptions.port };
7941
7941
  }
7942
- const matches = requestOptions.host?.match(/^([^:/ ]+)(:\d{1,5})?/) || null;
7943
- const hostname4 = requestOptions.hostname || (matches === null ? "localhost" : matches[1]);
7942
+ const matches2 = requestOptions.host?.match(/^([^:/ ]+)(:\d{1,5})?/) || null;
7943
+ const hostname4 = requestOptions.hostname || (matches2 === null ? "localhost" : matches2[1]);
7944
7944
  let port = requestOptions.port;
7945
7945
  if (!port) {
7946
- if (matches && matches[2]) {
7947
- port = matches[2].substring(1);
7946
+ if (matches2 && matches2[2]) {
7947
+ port = matches2[2].substring(1);
7948
7948
  } else {
7949
7949
  port = requestOptions.protocol === "https:" ? "443" : "80";
7950
7950
  }
@@ -10249,14 +10249,14 @@ var init_RequireInTheMiddleSingleton2 = __esm({
10249
10249
  { internals: true },
10250
10250
  (exports2, name2, basedir) => {
10251
10251
  const normalizedModuleName = normalizePathSeparators2(name2);
10252
- const matches = this._moduleNameTrie.search(normalizedModuleName, {
10252
+ const matches2 = this._moduleNameTrie.search(normalizedModuleName, {
10253
10253
  maintainInsertionOrder: true,
10254
10254
  // For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises').
10255
10255
  // This matches the behavior of `require-in-the-middle`.
10256
10256
  // `basedir` is always `undefined` for core modules.
10257
10257
  fullOnly: basedir === void 0
10258
10258
  });
10259
- for (const { onRequire } of matches) {
10259
+ for (const { onRequire } of matches2) {
10260
10260
  exports2 = onRequire(exports2, name2, basedir);
10261
10261
  }
10262
10262
  return exports2;
@@ -32977,18 +32977,18 @@ var require_ua_parser = __commonJS({
32977
32977
  }
32978
32978
  };
32979
32979
  var rgxMapper = function(ua7, arrays) {
32980
- var i9 = 0, j7, k5, p14, q6, matches, match3;
32981
- while (i9 < arrays.length && !matches) {
32980
+ var i9 = 0, j7, k5, p14, q6, matches2, match3;
32981
+ while (i9 < arrays.length && !matches2) {
32982
32982
  var regex5 = arrays[i9], props = arrays[i9 + 1];
32983
32983
  j7 = k5 = 0;
32984
- while (j7 < regex5.length && !matches) {
32984
+ while (j7 < regex5.length && !matches2) {
32985
32985
  if (!regex5[j7]) {
32986
32986
  break;
32987
32987
  }
32988
- matches = regex5[j7++].exec(ua7);
32989
- if (!!matches) {
32988
+ matches2 = regex5[j7++].exec(ua7);
32989
+ if (!!matches2) {
32990
32990
  for (p14 = 0; p14 < props.length; p14++) {
32991
- match3 = matches[++k5];
32991
+ match3 = matches2[++k5];
32992
32992
  q6 = props[p14];
32993
32993
  if (typeof q6 === OBJ_TYPE && q6.length > 0) {
32994
32994
  if (q6.length === 2) {
@@ -39983,11 +39983,11 @@ var require_validate = __commonJS({
39983
39983
  jsonPointer = $data;
39984
39984
  data2 = names_1.default.rootData;
39985
39985
  } else {
39986
- const matches = RELATIVE_JSON_POINTER.exec($data);
39987
- if (!matches)
39986
+ const matches2 = RELATIVE_JSON_POINTER.exec($data);
39987
+ if (!matches2)
39988
39988
  throw new Error(`Invalid JSON-pointer: ${$data}`);
39989
- const up4 = +matches[1];
39990
- jsonPointer = matches[2];
39989
+ const up4 = +matches2[1];
39990
+ jsonPointer = matches2[2];
39991
39991
  if (jsonPointer === "#") {
39992
39992
  if (up4 >= dataLevel)
39993
39993
  throw new Error(errorMsg("property/index", up4));
@@ -40684,11 +40684,11 @@ var require_schemes = __commonJS({
40684
40684
  urnComponent.error = "URN can not be parsed";
40685
40685
  return urnComponent;
40686
40686
  }
40687
- const matches = urnComponent.path.match(URN_REG);
40688
- if (matches) {
40687
+ const matches2 = urnComponent.path.match(URN_REG);
40688
+ if (matches2) {
40689
40689
  const scheme = options2.scheme || urnComponent.scheme || "urn";
40690
- urnComponent.nid = matches[1].toLowerCase();
40691
- urnComponent.nss = matches[2];
40690
+ urnComponent.nid = matches2[1].toLowerCase();
40691
+ urnComponent.nss = matches2[2];
40692
40692
  const urnScheme = `${scheme}:${options2.nid || urnComponent.nid}`;
40693
40693
  const schemeHandler = getSchemeHandler(urnScheme);
40694
40694
  urnComponent.path = void 0;
@@ -40958,8 +40958,8 @@ var require_fast_uri = __commonJS({
40958
40958
  return uriTokens.join("");
40959
40959
  }
40960
40960
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
40961
- function getParseError(parsed, matches) {
40962
- if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
40961
+ function getParseError(parsed, matches2) {
40962
+ if (matches2[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
40963
40963
  return 'URI path must start with "/" when authority is present.';
40964
40964
  }
40965
40965
  if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
@@ -40987,19 +40987,19 @@ var require_fast_uri = __commonJS({
40987
40987
  uri = "//" + uri;
40988
40988
  }
40989
40989
  }
40990
- const matches = uri.match(URI_PARSE);
40991
- if (matches) {
40992
- parsed.scheme = matches[1];
40993
- parsed.userinfo = matches[3];
40994
- parsed.host = matches[4];
40995
- parsed.port = parseInt(matches[5], 10);
40996
- parsed.path = matches[6] || "";
40997
- parsed.query = matches[7];
40998
- parsed.fragment = matches[8];
40990
+ const matches2 = uri.match(URI_PARSE);
40991
+ if (matches2) {
40992
+ parsed.scheme = matches2[1];
40993
+ parsed.userinfo = matches2[3];
40994
+ parsed.host = matches2[4];
40995
+ parsed.port = parseInt(matches2[5], 10);
40996
+ parsed.path = matches2[6] || "";
40997
+ parsed.query = matches2[7];
40998
+ parsed.fragment = matches2[8];
40999
40999
  if (isNaN(parsed.port)) {
41000
- parsed.port = matches[5];
41000
+ parsed.port = matches2[5];
41001
41001
  }
41002
- const parseError = getParseError(parsed, matches);
41002
+ const parseError = getParseError(parsed, matches2);
41003
41003
  if (parseError !== void 0) {
41004
41004
  parsed.error = parsed.error || parseError;
41005
41005
  malformedAuthorityOrPort = true;
@@ -58243,6 +58243,11 @@ var init_ClonedRepository = __esm({
58243
58243
  }
58244
58244
  await this.git.raw([...args, ...Array.isArray(files) ? files : [files]]);
58245
58245
  }
58246
+ async listTrackedFiles() {
58247
+ await this.git.cwd(this.clonePath);
58248
+ const result = await this.git.raw(["ls-tree", "-r", "HEAD", "--name-only"]);
58249
+ return result.split("\n").filter((line) => line.length > 0);
58250
+ }
58246
58251
  async restoreFilesFromCommit(commitSha, files) {
58247
58252
  await this.git.cwd(this.clonePath);
58248
58253
  const fileList = Array.isArray(files) ? files : [files];
@@ -58767,6 +58772,25 @@ var init_deleteBranch = __esm({
58767
58772
  }
58768
58773
  });
58769
58774
 
58775
+ // ../../commons/github/lib/expandFernignorePatterns.js
58776
+ function expandFernignorePatterns(fernignoreContent, candidatePaths) {
58777
+ const patterns = fernignoreContent.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
58778
+ return candidatePaths.filter((candidate) => patterns.some((pattern) => matches(candidate, pattern)));
58779
+ }
58780
+ function matches(candidate, pattern) {
58781
+ const normalized = pattern.endsWith("/") ? pattern.slice(0, -1) : pattern;
58782
+ if (minimatch(candidate, normalized, { dot: true, nonegate: true })) {
58783
+ return true;
58784
+ }
58785
+ return candidate === normalized || candidate.startsWith(normalized + "/");
58786
+ }
58787
+ var init_expandFernignorePatterns = __esm({
58788
+ "../../commons/github/lib/expandFernignorePatterns.js"() {
58789
+ "use strict";
58790
+ init_esm11();
58791
+ }
58792
+ });
58793
+
58770
58794
  // ../../../node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.js
58771
58795
  function getUserAgent() {
58772
58796
  if (typeof navigator === "object" && "userAgent" in navigator) {
@@ -58989,11 +59013,11 @@ function removeNonChars(variableName) {
58989
59013
  return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
58990
59014
  }
58991
59015
  function extractUrlVariableNames(url3) {
58992
- const matches = url3.match(urlVariableRegex);
58993
- if (!matches) {
59016
+ const matches2 = url3.match(urlVariableRegex);
59017
+ if (!matches2) {
58994
59018
  return [];
58995
59019
  }
58996
- return matches.map(removeNonChars).reduce((a3, b8) => a3.concat(b8), []);
59020
+ return matches2.map(removeNonChars).reduce((a3, b8) => a3.concat(b8), []);
58997
59021
  }
58998
59022
  function omit2(object23, keysToOmit) {
58999
59023
  const result = { __proto__: null };
@@ -59446,8 +59470,8 @@ async function fetchWrapper(requestOptions) {
59446
59470
  data: ""
59447
59471
  };
59448
59472
  if ("deprecation" in responseHeaders) {
59449
- const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
59450
- const deprecationLink = matches && matches.pop();
59473
+ const matches2 = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
59474
+ const deprecationLink = matches2 && matches2.pop();
59451
59475
  log4.warn(
59452
59476
  `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
59453
59477
  );
@@ -67050,6 +67074,7 @@ __export(lib_exports5, {
67050
67074
  cloneRepository: () => cloneRepository,
67051
67075
  createOrUpdatePullRequest: () => createOrUpdatePullRequest,
67052
67076
  deleteBranch: () => deleteBranch,
67077
+ expandFernignorePatterns: () => expandFernignorePatterns,
67053
67078
  getFileContent: () => getFileContent,
67054
67079
  getGithubApiBaseUrl: () => getGithubApiBaseUrl,
67055
67080
  getLatestRelease: () => getLatestRelease,
@@ -67063,6 +67088,7 @@ var init_lib9 = __esm({
67063
67088
  init_cloneRepository();
67064
67089
  init_createOrUpdatePullRequest();
67065
67090
  init_deleteBranch();
67091
+ init_expandFernignorePatterns();
67066
67092
  init_getFileContent();
67067
67093
  init_getGithubApiBaseUrl();
67068
67094
  init_getLatestRelease();
@@ -88676,11 +88702,11 @@ var require_validate2 = __commonJS({
88676
88702
  jsonPointer = $data;
88677
88703
  data2 = names_1.default.rootData;
88678
88704
  } else {
88679
- const matches = RELATIVE_JSON_POINTER.exec($data);
88680
- if (!matches)
88705
+ const matches2 = RELATIVE_JSON_POINTER.exec($data);
88706
+ if (!matches2)
88681
88707
  throw new Error(`Invalid JSON-pointer: ${$data}`);
88682
- const up4 = +matches[1];
88683
- jsonPointer = matches[2];
88708
+ const up4 = +matches2[1];
88709
+ jsonPointer = matches2[2];
88684
88710
  if (jsonPointer === "#") {
88685
88711
  if (up4 >= dataLevel)
88686
88712
  throw new Error(errorMsg("property/index", up4));
@@ -96478,8 +96504,8 @@ var require_utils21 = __commonJS({
96478
96504
  }
96479
96505
  }
96480
96506
  function regexFromString(input3) {
96481
- const matches = input3.match(/^\/(.*)\/(.*)|(.*)/);
96482
- return matches && new RegExp(matches[1] || matches[3], matches[2]);
96507
+ const matches2 = input3.match(/^\/(.*)\/(.*)|(.*)/);
96508
+ return matches2 && new RegExp(matches2[1] || matches2[3], matches2[2]);
96483
96509
  }
96484
96510
  }
96485
96511
  });
@@ -98164,8 +98190,8 @@ var require_path_excludes_patterns = __commonJS({
98164
98190
  throw new Error(`Parameter "patterns" is not provided for "path-excludes-patterns" rule`);
98165
98191
  const pathKey = key2.toString();
98166
98192
  if (pathKey.startsWith("/")) {
98167
- const matches = patterns.filter((pattern) => pathKey.match(pattern));
98168
- for (const match3 of matches) {
98193
+ const matches2 = patterns.filter((pattern) => pathKey.match(pattern));
98194
+ for (const match3 of matches2) {
98169
98195
  report({
98170
98196
  message: `path \`${pathKey}\` should not match regex pattern: \`${match3}\``,
98171
98197
  location: location2.key()
@@ -257632,13 +257658,13 @@ var require_templates = __commonJS({
257632
257658
  function parseArguments(name2, arguments_) {
257633
257659
  const results = [];
257634
257660
  const chunks = arguments_.trim().split(/\s*,\s*/g);
257635
- let matches;
257661
+ let matches2;
257636
257662
  for (const chunk2 of chunks) {
257637
257663
  const number26 = Number(chunk2);
257638
257664
  if (!Number.isNaN(number26)) {
257639
257665
  results.push(number26);
257640
- } else if (matches = chunk2.match(STRING_REGEX)) {
257641
- results.push(matches[2].replace(ESCAPE_REGEX3, (m7, escape6, character) => escape6 ? unescape3(escape6) : character));
257666
+ } else if (matches2 = chunk2.match(STRING_REGEX)) {
257667
+ results.push(matches2[2].replace(ESCAPE_REGEX3, (m7, escape6, character) => escape6 ? unescape3(escape6) : character));
257642
257668
  } else {
257643
257669
  throw new Error(`Invalid Chalk template style argument: ${chunk2} (in style '${name2}')`);
257644
257670
  }
@@ -257648,11 +257674,11 @@ var require_templates = __commonJS({
257648
257674
  function parseStyle2(style2) {
257649
257675
  STYLE_REGEX.lastIndex = 0;
257650
257676
  const results = [];
257651
- let matches;
257652
- while ((matches = STYLE_REGEX.exec(style2)) !== null) {
257653
- const name2 = matches[1];
257654
- if (matches[2]) {
257655
- const args = parseArguments(name2, matches[2]);
257677
+ let matches2;
257678
+ while ((matches2 = STYLE_REGEX.exec(style2)) !== null) {
257679
+ const name2 = matches2[1];
257680
+ if (matches2[2]) {
257681
+ const args = parseArguments(name2, matches2[2]);
257656
257682
  results.push([name2].concat(args));
257657
257683
  } else {
257658
257684
  results.push([name2]);
@@ -264570,8 +264596,8 @@ var require_lib9 = __commonJS({
264570
264596
  new ascii_1.default()
264571
264597
  ];
264572
264598
  var detect2 = (buffer) => {
264573
- const matches = (0, exports2.analyse)(buffer);
264574
- return matches.length > 0 ? matches[0].name : null;
264599
+ const matches2 = (0, exports2.analyse)(buffer);
264600
+ return matches2.length > 0 ? matches2[0].name : null;
264575
264601
  };
264576
264602
  exports2.detect = detect2;
264577
264603
  var analyse = (buffer) => {
@@ -264598,14 +264624,14 @@ var require_lib9 = __commonJS({
264598
264624
  inputBytes: buffer,
264599
264625
  inputLen: buffer.length
264600
264626
  };
264601
- const matches = recognisers.map((rec) => {
264627
+ const matches2 = recognisers.map((rec) => {
264602
264628
  return rec.match(context3);
264603
264629
  }).filter((match3) => {
264604
264630
  return !!match3;
264605
264631
  }).sort((a3, b8) => {
264606
264632
  return b8.confidence - a3.confidence;
264607
264633
  });
264608
- return matches;
264634
+ return matches2;
264609
264635
  };
264610
264636
  exports2.analyse = analyse;
264611
264637
  var detectFile = (filepath, opts = {}) => new Promise((resolve15, reject) => {
@@ -328683,9 +328709,9 @@ var require_fresh = __commonJS({
328683
328709
  return false;
328684
328710
  }
328685
328711
  var etagStale = true;
328686
- var matches = parseTokenList(noneMatch);
328687
- for (var i9 = 0; i9 < matches.length; i9++) {
328688
- var match3 = matches[i9];
328712
+ var matches2 = parseTokenList(noneMatch);
328713
+ for (var i9 = 0; i9 < matches2.length; i9++) {
328714
+ var match3 = matches2[i9];
328689
328715
  if (match3 === etag || match3 === "W/" + etag || "W/" + match3 === etag) {
328690
328716
  etagStale = false;
328691
328717
  break;
@@ -360366,9 +360392,9 @@ var require_diff3 = __commonJS({
360366
360392
  }
360367
360393
  });
360368
360394
 
360369
- // ../../../node_modules/.pnpm/@fern-api+replay@0.16.1/node_modules/@fern-api/replay/dist/index.cjs
360395
+ // ../../../node_modules/.pnpm/@fern-api+replay@0.16.2/node_modules/@fern-api/replay/dist/index.cjs
360370
360396
  var require_dist14 = __commonJS({
360371
- "../../../node_modules/.pnpm/@fern-api+replay@0.16.1/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
360397
+ "../../../node_modules/.pnpm/@fern-api+replay@0.16.2/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
360372
360398
  "use strict";
360373
360399
  var __defProp4 = Object.defineProperty;
360374
360400
  var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
@@ -360885,13 +360911,13 @@ var require_dist14 = __commonJS({
360885
360911
  return SENSITIVE_FILE_PATTERNS.some((re10) => re10.test(filePath));
360886
360912
  }
360887
360913
  function scanForCredentials(content5) {
360888
- const matches = [];
360914
+ const matches2 = [];
360889
360915
  for (const { name: name2, re: re10 } of CREDENTIAL_PATTERNS) {
360890
360916
  if (re10.test(content5)) {
360891
- matches.push(name2);
360917
+ matches2.push(name2);
360892
360918
  }
360893
360919
  }
360894
- return matches;
360920
+ return matches2;
360895
360921
  }
360896
360922
  init_GitClient();
360897
360923
  var FERN_BOT_NAME = "fern-api";
@@ -360936,7 +360962,7 @@ var require_dist14 = __commonJS({
360936
360962
  }
360937
360963
  var import_node_fs32 = require("fs");
360938
360964
  var import_node_path42 = require("path");
360939
- var import_minimatch8 = require_commonjs3();
360965
+ var import_minimatch9 = require_commonjs3();
360940
360966
  var import_yaml18 = require_dist11();
360941
360967
  var LOCKFILE_HEADER = "# DO NOT EDIT MANUALLY - Managed by Fern Replay\n";
360942
360968
  var LockfileNotFoundError = class extends Error {
@@ -361034,7 +361060,7 @@ var require_dist14 = __commonJS({
361034
361060
  reasons.push(`sensitive files: ${sensitiveFiles.join(", ")}`);
361035
361061
  }
361036
361062
  const allProtected = patch5.files.length > 0 && patch5.files.every(
361037
- (f4) => this.fernignorePatterns.some((p14) => f4 === p14 || (0, import_minimatch8.minimatch)(f4, p14))
361063
+ (f4) => this.fernignorePatterns.some((p14) => f4 === p14 || (0, import_minimatch9.minimatch)(f4, p14))
361038
361064
  );
361039
361065
  if (!allProtected) {
361040
361066
  this.warnings.push(
@@ -361147,6 +361173,7 @@ var require_dist14 = __commonJS({
361147
361173
  }
361148
361174
  };
361149
361175
  var import_node_crypto7 = require("crypto");
361176
+ var import_minimatch22 = require_commonjs3();
361150
361177
  var import_node_path210 = require("path");
361151
361178
  var BINARY_EXTENSIONS2 = /* @__PURE__ */ new Set([
361152
361179
  ".png",
@@ -361202,6 +361229,15 @@ var require_dist14 = __commonJS({
361202
361229
  return BINARY_EXTENSIONS2.has(ext2);
361203
361230
  }
361204
361231
  var INFRASTRUCTURE_FILES = /* @__PURE__ */ new Set([".fernignore"]);
361232
+ function matchesFernignorePattern(filePath, patterns) {
361233
+ if (patterns.length === 0) return false;
361234
+ return patterns.some((p14) => {
361235
+ if (filePath === p14) return true;
361236
+ if ((0, import_minimatch22.minimatch)(filePath, p14)) return true;
361237
+ if (!p14.includes("*") && !p14.includes("?") && filePath.startsWith(p14 + "/")) return true;
361238
+ return false;
361239
+ });
361240
+ }
361205
361241
  function parsePatchFileHeaders(patchContent) {
361206
361242
  const results = [];
361207
361243
  let currentPath = null;
@@ -361242,21 +361278,25 @@ var require_dist14 = __commonJS({
361242
361278
  }
361243
361279
  return snapshot;
361244
361280
  }
361245
- function filterInfrastructureAndSensitiveFiles(rawFilesOutput) {
361281
+ function filterInfrastructureAndSensitiveFiles(rawFilesOutput, fernignorePatterns) {
361246
361282
  const allFiles = rawFilesOutput.trim().split("\n").filter(Boolean).filter((f4) => !INFRASTRUCTURE_FILES.has(f4)).filter((f4) => !f4.startsWith(".fern/"));
361247
361283
  const sensitiveFiles = allFiles.filter((f4) => isSensitiveFile(f4));
361248
- const files = allFiles.filter((f4) => !isSensitiveFile(f4));
361249
- return { files, sensitiveFiles };
361284
+ const nonSensitive = allFiles.filter((f4) => !isSensitiveFile(f4));
361285
+ const fernignoredFiles = nonSensitive.filter((f4) => matchesFernignorePattern(f4, fernignorePatterns));
361286
+ const files = nonSensitive.filter((f4) => !matchesFernignorePattern(f4, fernignorePatterns));
361287
+ return { files, sensitiveFiles, fernignoredFiles };
361250
361288
  }
361251
361289
  var ReplayDetector = class {
361252
361290
  git;
361253
361291
  lockManager;
361254
361292
  sdkOutputDir;
361293
+ fernignorePatterns;
361255
361294
  warnings = [];
361256
- constructor(git, lockManager, sdkOutputDir) {
361295
+ constructor(git, lockManager, sdkOutputDir, fernignorePatterns = []) {
361257
361296
  this.git = git;
361258
361297
  this.lockManager = lockManager;
361259
361298
  this.sdkOutputDir = sdkOutputDir;
361299
+ this.fernignorePatterns = fernignorePatterns;
361260
361300
  }
361261
361301
  /**
361262
361302
  * Derive the previous-generation SHA from git history instead of trusting
@@ -361363,22 +361403,30 @@ var require_dist14 = __commonJS({
361363
361403
  continue;
361364
361404
  }
361365
361405
  const filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
361366
- const { files, sensitiveFiles } = filterInfrastructureAndSensitiveFiles(filesOutput);
361406
+ const { files, sensitiveFiles, fernignoredFiles } = filterInfrastructureAndSensitiveFiles(
361407
+ filesOutput,
361408
+ this.fernignorePatterns
361409
+ );
361367
361410
  if (sensitiveFiles.length > 0) {
361368
361411
  this.warnings.push(
361369
361412
  `Sensitive file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
361370
361413
  );
361371
- if (files.length > 0) {
361372
- const parentSha = parents[0];
361373
- if (parentSha) {
361374
- try {
361375
- patchContent = await this.git.exec(["diff", parentSha, commit.sha, "--", ...files]);
361376
- } catch {
361377
- continue;
361378
- }
361379
- if (!patchContent.trim()) continue;
361380
- contentHash = this.computeContentHash(patchContent);
361414
+ }
361415
+ if (fernignoredFiles.length > 0) {
361416
+ this.warnings.push(
361417
+ `.fernignore-protected file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${fernignoredFiles.join(", ")}. These files are managed by .fernignore, not Replay.`
361418
+ );
361419
+ }
361420
+ if ((sensitiveFiles.length > 0 || fernignoredFiles.length > 0) && files.length > 0) {
361421
+ const parentSha = parents[0];
361422
+ if (parentSha) {
361423
+ try {
361424
+ patchContent = await this.git.exec(["diff", parentSha, commit.sha, "--", ...files]);
361425
+ } catch {
361426
+ continue;
361381
361427
  }
361428
+ if (!patchContent.trim()) continue;
361429
+ contentHash = this.computeContentHash(patchContent);
361382
361430
  }
361383
361431
  }
361384
361432
  if (files.length === 0) {
@@ -361577,12 +361625,20 @@ var require_dist14 = __commonJS({
361577
361625
  resolvedBaseGeneration = fallback2;
361578
361626
  }
361579
361627
  const filesOutput = await this.git.exec(["diff", "--name-only", diffBase, "HEAD"]);
361580
- const { files, sensitiveFiles } = filterInfrastructureAndSensitiveFiles(filesOutput);
361628
+ const { files, sensitiveFiles, fernignoredFiles } = filterInfrastructureAndSensitiveFiles(
361629
+ filesOutput,
361630
+ this.fernignorePatterns
361631
+ );
361581
361632
  if (sensitiveFiles.length > 0) {
361582
361633
  this.warnings.push(
361583
361634
  `Sensitive file(s) excluded from composite patch: ${sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
361584
361635
  );
361585
361636
  }
361637
+ if (fernignoredFiles.length > 0) {
361638
+ this.warnings.push(
361639
+ `.fernignore-protected file(s) excluded from composite patch: ${fernignoredFiles.join(", ")}. These files are managed by .fernignore, not Replay.`
361640
+ );
361641
+ }
361586
361642
  if (files.length === 0) return { patches: [], revertedPatchIds: [] };
361587
361643
  const diff2 = await this.git.exec(["diff", diffBase, "HEAD", "--", ...files]);
361588
361644
  if (!diff2.trim()) return { patches: [], revertedPatchIds: [] };
@@ -361665,23 +361721,31 @@ var require_dist14 = __commonJS({
361665
361721
  continue;
361666
361722
  }
361667
361723
  const filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
361668
- const { files, sensitiveFiles } = filterInfrastructureAndSensitiveFiles(filesOutput);
361724
+ const { files, sensitiveFiles, fernignoredFiles } = filterInfrastructureAndSensitiveFiles(
361725
+ filesOutput,
361726
+ this.fernignorePatterns
361727
+ );
361669
361728
  if (sensitiveFiles.length > 0) {
361670
361729
  this.warnings.push(
361671
361730
  `Sensitive file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
361672
361731
  );
361673
- if (files.length > 0) {
361674
- if (parents.length === 0) {
361675
- continue;
361676
- }
361677
- try {
361678
- patchContent = await this.git.exec(["diff", parents[0], commit.sha, "--", ...files]);
361679
- } catch {
361680
- continue;
361681
- }
361682
- if (!patchContent.trim()) continue;
361683
- contentHash = this.computeContentHash(patchContent);
361732
+ }
361733
+ if (fernignoredFiles.length > 0) {
361734
+ this.warnings.push(
361735
+ `.fernignore-protected file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${fernignoredFiles.join(", ")}. These files are managed by .fernignore, not Replay.`
361736
+ );
361737
+ }
361738
+ if ((sensitiveFiles.length > 0 || fernignoredFiles.length > 0) && files.length > 0) {
361739
+ if (parents.length === 0) {
361740
+ continue;
361684
361741
  }
361742
+ try {
361743
+ patchContent = await this.git.exec(["diff", parents[0], commit.sha, "--", ...files]);
361744
+ } catch {
361745
+ continue;
361746
+ }
361747
+ if (!patchContent.trim()) continue;
361748
+ contentHash = this.computeContentHash(patchContent);
361685
361749
  }
361686
361750
  if (files.length === 0) {
361687
361751
  continue;
@@ -361913,7 +361977,7 @@ var require_dist14 = __commonJS({
361913
361977
  var import_promises310 = require("fs/promises");
361914
361978
  var import_node_os15 = require("os");
361915
361979
  var import_node_path52 = require("path");
361916
- var import_minimatch22 = require_commonjs3();
361980
+ var import_minimatch32 = require_commonjs3();
361917
361981
  var MergeAccumulator = class {
361918
361982
  constructor(mode, sharedFiles) {
361919
361983
  this.mode = mode;
@@ -362617,13 +362681,13 @@ var require_dist14 = __commonJS({
362617
362681
  isExcluded(patch5) {
362618
362682
  const config5 = this.lockManager.getCustomizationsConfig();
362619
362683
  if (!config5.exclude) return false;
362620
- return patch5.files.some((file4) => config5.exclude.some((pattern) => (0, import_minimatch22.minimatch)(file4, pattern)));
362684
+ return patch5.files.some((file4) => config5.exclude.some((pattern) => (0, import_minimatch32.minimatch)(file4, pattern)));
362621
362685
  }
362622
362686
  async resolveFilePath(filePath, baseTreeHash, currentTreeHash) {
362623
362687
  const config5 = this.lockManager.getCustomizationsConfig();
362624
362688
  if (config5.moves) {
362625
362689
  for (const move of config5.moves) {
362626
- if ((0, import_minimatch22.minimatch)(filePath, move.from) || filePath === move.from) {
362690
+ if ((0, import_minimatch32.minimatch)(filePath, move.from) || filePath === move.from) {
362627
362691
  if (filePath === move.from) {
362628
362692
  return move.to;
362629
362693
  }
@@ -362910,7 +362974,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
362910
362974
  var import_node_fs210 = require("fs");
362911
362975
  var import_promises610 = require("fs/promises");
362912
362976
  var import_node_path82 = require("path");
362913
- var import_minimatch42 = require_commonjs3();
362977
+ var import_minimatch52 = require_commonjs3();
362914
362978
  init_GitClient();
362915
362979
  var import_promises410 = require("fs/promises");
362916
362980
  var import_node_os22 = require("os");
@@ -363213,7 +363277,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
363213
363277
  const trailer = hasTrailingNewline ? "" : "\n\";
363214
363278
  return header + "\n" + body + trailer + "\n";
363215
363279
  }
363216
- var import_minimatch32 = require_commonjs3();
363280
+ var import_minimatch42 = require_commonjs3();
363217
363281
  var FileOwnership = class {
363218
363282
  constructor(git) {
363219
363283
  this.git = git;
@@ -363237,7 +363301,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
363237
363301
  const { file: file4, originalFileName, patch: patch5, currentGenSha, fernignorePatterns, warnedGens, warnings } = ctx;
363238
363302
  if (patch5.user_owned) return true;
363239
363303
  if (file4 === ".fernignore") return true;
363240
- if (fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch32.minimatch)(file4, p14))) return true;
363304
+ if (fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch42.minimatch)(file4, p14))) return true;
363241
363305
  if (fileIsCreationInPatchContent(patch5.patch_content, originalFileName ?? file4)) {
363242
363306
  return true;
363243
363307
  }
@@ -363733,7 +363797,8 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
363733
363797
  this.git = git;
363734
363798
  this.outputDir = outputDir;
363735
363799
  this.lockManager = new LockfileManager(outputDir);
363736
- this.detector = new ReplayDetector(git, this.lockManager, outputDir);
363800
+ const fernignorePatterns = this.readFernignorePatterns();
363801
+ this.detector = new ReplayDetector(git, this.lockManager, outputDir, fernignorePatterns);
363737
363802
  this.applicator = new ReplayApplicator(git, this.lockManager, outputDir);
363738
363803
  this.committer = new ReplayCommitter(git, outputDir);
363739
363804
  this.fileOwnership = new FileOwnership(git);
@@ -363753,8 +363818,60 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
363753
363818
  async prepareReplay(options2) {
363754
363819
  this.warnings = [];
363755
363820
  this.detector.warnings.length = 0;
363821
+ this.cleanseLegacyFernignoreEntries();
363756
363822
  return this.selectFlow(options2).prepare(options2);
363757
363823
  }
363824
+ /**
363825
+ * ADR 0002 migration step. Strips `.fernignore`-matched entries from
363826
+ * `patch.files`, `patch.theirs_snapshot` keys, and `diff --git` sections
363827
+ * in `patch.patch_content` for every patch in the lockfile. Patches that
363828
+ * end up with no surviving files are removed entirely.
363829
+ *
363830
+ * Idempotent: a second run is a no-op because the first run already
363831
+ * matches the contract. Per-patch try/catch ensures one bad patch does
363832
+ * not block the rest. Each affected patch emits a warning naming the
363833
+ * stripped paths. `patch_content` is left untouched if no parseable
363834
+ * `diff --git` headers are found (fail-safe for exotic legacy formats).
363835
+ */
363836
+ cleanseLegacyFernignoreEntries() {
363837
+ const patterns = this.readFernignorePatterns();
363838
+ if (patterns.length === 0) return;
363839
+ if (!this.lockManager.exists()) return;
363840
+ this.lockManager.read();
363841
+ let lockfileMutated = false;
363842
+ const patches = this.lockManager.getPatches();
363843
+ for (const patch5 of patches) {
363844
+ try {
363845
+ const result = computeLegacyFernignoreCleanse(
363846
+ patch5,
363847
+ patterns,
363848
+ (content5) => this.detector.computeContentHash(content5)
363849
+ );
363850
+ if (result.unchanged) continue;
363851
+ if (result.remove) {
363852
+ this.lockManager.removePatch(patch5.id);
363853
+ this.warnings.push(
363854
+ `Cleansed legacy patch ${patch5.id}: all referenced files match .fernignore \u2014 patch removed. Customer's on-disk content for those files is preserved by .fernignore. (ADR 0002: .fernignore-protected files are not tracked by Replay.)`
363855
+ );
363856
+ } else {
363857
+ this.lockManager.updatePatch(patch5.id, {
363858
+ files: result.files,
363859
+ patch_content: result.patch_content,
363860
+ content_hash: result.content_hash,
363861
+ ...result.theirs_snapshot !== void 0 ? { theirs_snapshot: result.theirs_snapshot } : {}
363862
+ });
363863
+ this.warnings.push(
363864
+ `Cleansed legacy patch ${patch5.id}: stripped .fernignore-matched entries (${result.strippedPaths.join(", ")}). Customer's on-disk content for those files is preserved by .fernignore. (ADR 0002.)`
363865
+ );
363866
+ }
363867
+ lockfileMutated = true;
363868
+ } catch {
363869
+ }
363870
+ }
363871
+ if (lockfileMutated) {
363872
+ this.lockManager.save();
363873
+ }
363874
+ }
363758
363875
  /**
363759
363876
  * Phase 2 of the two-phase replay flow. Applies patches, rebases them against
363760
363877
  * the generation, saves the lockfile, and commits `[fern-replay]` (or stages
@@ -363886,7 +364003,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
363886
364003
  )
363887
364004
  );
363888
364005
  const hasProtectedFiles = patch5.files.some(
363889
- (file4) => file4 === ".fernignore" || fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch42.minimatch)(file4, p14))
364006
+ (file4) => file4 === ".fernignore" || fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch52.minimatch)(file4, p14))
363890
364007
  );
363891
364008
  const allUserOwned = isUserOwnedPerFile.every(Boolean);
363892
364009
  if (allUserOwned && patch5.files.length > 0) {
@@ -364326,7 +364443,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
364326
364443
  );
364327
364444
  if (snapHasStaleMarkers) continue;
364328
364445
  const isProtectedSnap = patch5.files.some(
364329
- (file4) => file4 === ".fernignore" || fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch42.minimatch)(file4, p14))
364446
+ (file4) => file4 === ".fernignore" || fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch52.minimatch)(file4, p14))
364330
364447
  );
364331
364448
  if (isProtectedSnap) continue;
364332
364449
  const snapHash = this.detector.computeContentHash(snapshotDiff);
@@ -364366,7 +364483,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
364366
364483
  continue;
364367
364484
  }
364368
364485
  const isProtected = patch5.files.some(
364369
- (file4) => file4 === ".fernignore" || fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch42.minimatch)(file4, p14))
364486
+ (file4) => file4 === ".fernignore" || fernignorePatterns.some((p14) => file4 === p14 || (0, import_minimatch52.minimatch)(file4, p14))
364370
364487
  );
364371
364488
  if (isProtected) {
364372
364489
  continue;
@@ -364530,7 +364647,7 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
364530
364647
  if (files.length === 0) return;
364531
364648
  const fernignorePatterns = this.readFernignorePatterns();
364532
364649
  for (const file4 of files) {
364533
- if (fernignorePatterns.some((pattern) => (0, import_minimatch42.minimatch)(file4, pattern))) continue;
364650
+ if (fernignorePatterns.some((pattern) => (0, import_minimatch52.minimatch)(file4, pattern))) continue;
364534
364651
  try {
364535
364652
  await this.git.exec(["checkout", "HEAD", "--", file4]);
364536
364653
  } catch {
@@ -364615,10 +364732,97 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
364615
364732
  }
364616
364733
  return { applied, unresolved, absorbed };
364617
364734
  }
364735
+ function computeLegacyFernignoreCleanse(patch5, fernignorePatterns, computeContentHash2) {
364736
+ const matchesFernignore = (filePath) => fernignorePatterns.some((p14) => {
364737
+ if (filePath === p14) return true;
364738
+ if ((0, import_minimatch52.minimatch)(filePath, p14)) return true;
364739
+ if (!p14.includes("*") && !p14.includes("?") && filePath.startsWith(p14 + "/")) return true;
364740
+ return false;
364741
+ });
364742
+ const strippedFromFiles = patch5.files.filter(matchesFernignore);
364743
+ const survivingFiles = patch5.files.filter((f4) => !matchesFernignore(f4));
364744
+ let survivingSnapshot = void 0;
364745
+ let snapshotChanged = false;
364746
+ if (patch5.theirs_snapshot) {
364747
+ survivingSnapshot = {};
364748
+ for (const [key2, value2] of Object.entries(patch5.theirs_snapshot)) {
364749
+ if (matchesFernignore(key2)) {
364750
+ snapshotChanged = true;
364751
+ } else {
364752
+ survivingSnapshot[key2] = value2;
364753
+ }
364754
+ }
364755
+ }
364756
+ const { stripped: patchContentStripped, content: newPatchContent, strippedSectionPaths } = stripFernignoreDiffSections(patch5.patch_content, matchesFernignore);
364757
+ const unchanged = strippedFromFiles.length === 0 && !snapshotChanged && !patchContentStripped;
364758
+ if (unchanged) {
364759
+ return {
364760
+ unchanged: true,
364761
+ remove: false,
364762
+ files: patch5.files,
364763
+ patch_content: patch5.patch_content,
364764
+ content_hash: patch5.content_hash,
364765
+ theirs_snapshot: patch5.theirs_snapshot,
364766
+ strippedPaths: []
364767
+ };
364768
+ }
364769
+ const strippedPaths = Array.from(/* @__PURE__ */ new Set([...strippedFromFiles, ...strippedSectionPaths]));
364770
+ if (survivingFiles.length === 0 || newPatchContent.trim() === "") {
364771
+ return {
364772
+ unchanged: false,
364773
+ remove: true,
364774
+ files: [],
364775
+ patch_content: "",
364776
+ content_hash: "",
364777
+ strippedPaths
364778
+ };
364779
+ }
364780
+ const newContentHash = patchContentStripped ? computeContentHash2(newPatchContent) : patch5.content_hash;
364781
+ return {
364782
+ unchanged: false,
364783
+ remove: false,
364784
+ files: survivingFiles,
364785
+ patch_content: newPatchContent,
364786
+ content_hash: newContentHash,
364787
+ ...survivingSnapshot !== void 0 ? { theirs_snapshot: survivingSnapshot } : {},
364788
+ strippedPaths
364789
+ };
364790
+ }
364791
+ function stripFernignoreDiffSections(patchContent, matchesFernignore) {
364792
+ const lines = patchContent.split("\n");
364793
+ const sectionStarts = [];
364794
+ for (let i9 = 0; i9 < lines.length; i9++) {
364795
+ const line = lines[i9];
364796
+ if (line.startsWith("diff --git ")) {
364797
+ const match3 = line.match(/^diff --git a\/(.+?) b\/(.+?)$/);
364798
+ const path115 = match3 ? match3[2] : null;
364799
+ sectionStarts.push({ idx: i9, path: path115 });
364800
+ }
364801
+ }
364802
+ if (sectionStarts.length === 0) {
364803
+ return { stripped: false, content: patchContent, strippedSectionPaths: [] };
364804
+ }
364805
+ const preamble = lines.slice(0, sectionStarts[0].idx);
364806
+ const newLines = [...preamble];
364807
+ const strippedSectionPaths = [];
364808
+ let stripped = false;
364809
+ for (let i9 = 0; i9 < sectionStarts.length; i9++) {
364810
+ const section = sectionStarts[i9];
364811
+ const next2 = sectionStarts[i9 + 1];
364812
+ const endIdx = next2 ? next2.idx : lines.length;
364813
+ if (section.path !== null && matchesFernignore(section.path)) {
364814
+ stripped = true;
364815
+ strippedSectionPaths.push(section.path);
364816
+ continue;
364817
+ }
364818
+ newLines.push(...lines.slice(section.idx, endIdx));
364819
+ }
364820
+ return { stripped, content: newLines.join("\n"), strippedSectionPaths };
364821
+ }
364618
364822
  var import_node_crypto22 = require("crypto");
364619
364823
  var import_node_fs33 = require("fs");
364620
364824
  var import_node_path92 = require("path");
364621
- var import_minimatch52 = require_commonjs3();
364825
+ var import_minimatch62 = require_commonjs3();
364622
364826
  var import_yaml22 = require_dist11();
364623
364827
  var FernignoreMigrator = class {
364624
364828
  git;
@@ -364650,7 +364854,7 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
364650
364854
  const commitsOnly = [];
364651
364855
  const syntheticPatches = [];
364652
364856
  for (const pattern of patterns) {
364653
- const matchingPatch = patches.find((p14) => p14.files.some((f4) => (0, import_minimatch52.minimatch)(f4, pattern) || f4 === pattern));
364857
+ const matchingPatch = patches.find((p14) => p14.files.some((f4) => (0, import_minimatch62.minimatch)(f4, pattern) || f4 === pattern));
364654
364858
  if (matchingPatch) {
364655
364859
  trackedByBoth.push({
364656
364860
  file: pattern,
@@ -364723,7 +364927,7 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
364723
364927
  fernignoreOnly.push(...remainingFernignoreOnly);
364724
364928
  }
364725
364929
  for (const patch5 of patches) {
364726
- const hasUnprotectedFiles = patch5.files.some((f4) => !patterns.some((p14) => (0, import_minimatch52.minimatch)(f4, p14) || f4 === p14));
364930
+ const hasUnprotectedFiles = patch5.files.some((f4) => !patterns.some((p14) => (0, import_minimatch62.minimatch)(f4, p14) || f4 === p14));
364727
364931
  if (hasUnprotectedFiles) {
364728
364932
  commitsOnly.push(patch5);
364729
364933
  }
@@ -364735,7 +364939,7 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
364735
364939
  const results = [];
364736
364940
  for (const pattern of patterns) {
364737
364941
  const matching = allFiles.filter(
364738
- (f4) => (0, import_minimatch52.minimatch)(f4, pattern) || f4 === pattern || f4.startsWith(pattern + "/")
364942
+ (f4) => (0, import_minimatch62.minimatch)(f4, pattern) || f4 === pattern || f4.startsWith(pattern + "/")
364739
364943
  );
364740
364944
  results.push({ pattern, files: matching.length > 0 ? matching : [pattern] });
364741
364945
  }
@@ -365044,7 +365248,7 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
365044
365248
  const normalized = relevantLines.filter((line) => !line.startsWith("index ")).join("\n").replace(/\n-- \n[\d]+\.[\d]+[^\n]*\s*$/, "");
365045
365249
  return `sha256:${(0, import_node_crypto32.createHash)("sha256").update(normalized).digest("hex")}`;
365046
365250
  }
365047
- var import_minimatch62 = require_commonjs3();
365251
+ var import_minimatch72 = require_commonjs3();
365048
365252
  function parseDiffStat(patchContent) {
365049
365253
  let additions = 0;
365050
365254
  let deletions = 0;
@@ -365074,7 +365278,7 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
365074
365278
  }
365075
365279
  function matchesPatch(patch5, pattern) {
365076
365280
  const fileMatch = patch5.files.some(
365077
- (file4) => file4 === pattern || (0, import_minimatch62.minimatch)(file4, pattern)
365281
+ (file4) => file4 === pattern || (0, import_minimatch72.minimatch)(file4, pattern)
365078
365282
  );
365079
365283
  if (fileMatch) return true;
365080
365284
  return patch5.original_message.toLowerCase().includes(pattern.toLowerCase());
@@ -365935,11 +366139,11 @@ function removeNonChars2(variableName) {
365935
366139
  return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
365936
366140
  }
365937
366141
  function extractUrlVariableNames2(url3) {
365938
- const matches = url3.match(urlVariableRegex2);
365939
- if (!matches) {
366142
+ const matches2 = url3.match(urlVariableRegex2);
366143
+ if (!matches2) {
365940
366144
  return [];
365941
366145
  }
365942
- return matches.map(removeNonChars2).reduce((a3, b8) => a3.concat(b8), []);
366146
+ return matches2.map(removeNonChars2).reduce((a3, b8) => a3.concat(b8), []);
365943
366147
  }
365944
366148
  function omit4(object23, keysToOmit) {
365945
366149
  const result = { __proto__: null };
@@ -366501,8 +366705,8 @@ async function fetchWrapper2(requestOptions) {
366501
366705
  data: ""
366502
366706
  };
366503
366707
  if ("deprecation" in responseHeaders) {
366504
- const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
366505
- const deprecationLink = matches && matches.pop();
366708
+ const matches2 = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
366709
+ const deprecationLink = matches2 && matches2.pop();
366506
366710
  log4.warn(
366507
366711
  `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
366508
366712
  );
@@ -373106,12 +373310,12 @@ var require_isMatchWith = __commonJS({
373106
373310
  continue;
373107
373311
  }
373108
373312
  const targetItem = target[j7];
373109
- let matches = false;
373313
+ let matches2 = false;
373110
373314
  const isEqual3 = compare2(targetItem, sourceItem, i9, target, source2, stack);
373111
373315
  if (isEqual3) {
373112
- matches = true;
373316
+ matches2 = true;
373113
373317
  }
373114
- if (matches) {
373318
+ if (matches2) {
373115
373319
  countedIndex.add(j7);
373116
373320
  found = true;
373117
373321
  break;
@@ -373449,13 +373653,13 @@ var require_matches = __commonJS({
373449
373653
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
373450
373654
  var isMatch = require_isMatch();
373451
373655
  var cloneDeep = require_cloneDeep();
373452
- function matches(source2) {
373656
+ function matches2(source2) {
373453
373657
  source2 = cloneDeep.cloneDeep(source2);
373454
373658
  return (target) => {
373455
373659
  return isMatch.isMatch(target, source2);
373456
373660
  };
373457
373661
  }
373458
- exports2.matches = matches;
373662
+ exports2.matches = matches2;
373459
373663
  }
373460
373664
  });
373461
373665
 
@@ -373640,7 +373844,7 @@ var require_iteratee = __commonJS({
373640
373844
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
373641
373845
  var identity5 = require_identity3();
373642
373846
  var property24 = require_property2();
373643
- var matches = require_matches();
373847
+ var matches2 = require_matches();
373644
373848
  var matchesProperty = require_matchesProperty();
373645
373849
  function iteratee(value2) {
373646
373850
  if (value2 == null) {
@@ -373654,7 +373858,7 @@ var require_iteratee = __commonJS({
373654
373858
  if (Array.isArray(value2) && value2.length === 2) {
373655
373859
  return matchesProperty.matchesProperty(value2[0], value2[1]);
373656
373860
  }
373657
- return matches.matches(value2);
373861
+ return matches2.matches(value2);
373658
373862
  }
373659
373863
  case "string":
373660
373864
  case "symbol":
@@ -374051,7 +374255,7 @@ var require_dropRightWhile2 = __commonJS({
374051
374255
  var identity5 = require_identity3();
374052
374256
  var property24 = require_property2();
374053
374257
  var isArrayLike4 = require_isArrayLike2();
374054
- var matches = require_matches();
374258
+ var matches2 = require_matches();
374055
374259
  var matchesProperty = require_matchesProperty();
374056
374260
  function dropRightWhile(arr, predicate = identity5.identity) {
374057
374261
  if (!isArrayLike4.isArrayLike(arr)) {
@@ -374070,7 +374274,7 @@ var require_dropRightWhile2 = __commonJS({
374070
374274
  const value2 = predicate[1];
374071
374275
  return dropRightWhile$1.dropRightWhile(arr, matchesProperty.matchesProperty(key2, value2));
374072
374276
  } else {
374073
- return dropRightWhile$1.dropRightWhile(arr, matches.matches(predicate));
374277
+ return dropRightWhile$1.dropRightWhile(arr, matches2.matches(predicate));
374074
374278
  }
374075
374279
  }
374076
374280
  case "symbol":
@@ -374110,7 +374314,7 @@ var require_dropWhile2 = __commonJS({
374110
374314
  var toArray4 = require_toArray2();
374111
374315
  var property24 = require_property2();
374112
374316
  var isArrayLike4 = require_isArrayLike2();
374113
- var matches = require_matches();
374317
+ var matches2 = require_matches();
374114
374318
  var matchesProperty = require_matchesProperty();
374115
374319
  function dropWhile(arr, predicate = identity5.identity) {
374116
374320
  if (!isArrayLike4.isArrayLike(arr)) {
@@ -374129,7 +374333,7 @@ var require_dropWhile2 = __commonJS({
374129
374333
  const value2 = predicate[1];
374130
374334
  return dropWhile$1.dropWhile(arr, matchesProperty.matchesProperty(key2, value2));
374131
374335
  } else {
374132
- return dropWhile$1.dropWhile(arr, matches.matches(predicate));
374336
+ return dropWhile$1.dropWhile(arr, matches2.matches(predicate));
374133
374337
  }
374134
374338
  }
374135
374339
  case "number":
@@ -374252,7 +374456,7 @@ var require_every2 = __commonJS({
374252
374456
  var isIterateeCall2 = require_isIterateeCall();
374253
374457
  var property24 = require_property2();
374254
374458
  var isArrayLike4 = require_isArrayLike2();
374255
- var matches = require_matches();
374459
+ var matches2 = require_matches();
374256
374460
  var matchesProperty = require_matchesProperty();
374257
374461
  function every(source2, doesMatch, guard) {
374258
374462
  if (!source2) {
@@ -374276,7 +374480,7 @@ var require_every2 = __commonJS({
374276
374480
  const value2 = doesMatch[1];
374277
374481
  predicate = matchesProperty.matchesProperty(key2, value2);
374278
374482
  } else {
374279
- predicate = matches.matches(doesMatch);
374483
+ predicate = matches2.matches(doesMatch);
374280
374484
  }
374281
374485
  break;
374282
374486
  }
@@ -374458,7 +374662,7 @@ var require_findIndex2 = __commonJS({
374458
374662
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
374459
374663
  var identity5 = require_identity4();
374460
374664
  var property24 = require_property2();
374461
- var matches = require_matches();
374665
+ var matches2 = require_matches();
374462
374666
  var matchesProperty = require_matchesProperty();
374463
374667
  function findIndex(arr, doesMatch = identity5.identity, fromIndex = 0) {
374464
374668
  if (!arr) {
@@ -374480,7 +374684,7 @@ var require_findIndex2 = __commonJS({
374480
374684
  const value2 = doesMatch[1];
374481
374685
  index3 = subArray.findIndex(matchesProperty.matchesProperty(key2, value2));
374482
374686
  } else {
374483
- index3 = subArray.findIndex(matches.matches(doesMatch));
374687
+ index3 = subArray.findIndex(matches2.matches(doesMatch));
374484
374688
  }
374485
374689
  break;
374486
374690
  }
@@ -374541,7 +374745,7 @@ var require_findLastIndex = __commonJS({
374541
374745
  var identity5 = require_identity3();
374542
374746
  var toArray4 = require_toArray2();
374543
374747
  var property24 = require_property2();
374544
- var matches = require_matches();
374748
+ var matches2 = require_matches();
374545
374749
  var matchesProperty = require_matchesProperty();
374546
374750
  function findLastIndex(arr, doesMatch = identity5.identity, fromIndex = arr ? arr.length - 1 : 0) {
374547
374751
  if (!arr) {
@@ -374563,7 +374767,7 @@ var require_findLastIndex = __commonJS({
374563
374767
  const value2 = doesMatch[1];
374564
374768
  return subArray.findLastIndex(matchesProperty.matchesProperty(key2, value2));
374565
374769
  } else {
374566
- return subArray.findLastIndex(matches.matches(doesMatch));
374770
+ return subArray.findLastIndex(matches2.matches(doesMatch));
374567
374771
  }
374568
374772
  }
374569
374773
  case "number":
@@ -376212,7 +376416,7 @@ var require_some = __commonJS({
376212
376416
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
376213
376417
  var identity5 = require_identity3();
376214
376418
  var property24 = require_property2();
376215
- var matches = require_matches();
376419
+ var matches2 = require_matches();
376216
376420
  var matchesProperty = require_matchesProperty();
376217
376421
  function some(source2, predicate, guard) {
376218
376422
  if (!source2) {
@@ -376260,7 +376464,7 @@ var require_some = __commonJS({
376260
376464
  }
376261
376465
  return values2.some(matchFunc);
376262
376466
  } else {
376263
- const matchFunc = matches.matches(predicate);
376467
+ const matchFunc = matches2.matches(predicate);
376264
376468
  if (Array.isArray(source2)) {
376265
376469
  for (let i9 = 0; i9 < source2.length; i9++) {
376266
376470
  if (matchFunc(source2[i9])) {
@@ -382745,7 +382949,7 @@ var require_compat = __commonJS({
382745
382949
  var isTypedArray3 = require_isTypedArray2();
382746
382950
  var isWeakMap = require_isWeakMap2();
382747
382951
  var isWeakSet = require_isWeakSet2();
382748
- var matches = require_matches();
382952
+ var matches2 = require_matches();
382749
382953
  var matchesProperty = require_matchesProperty();
382750
382954
  var capitalize2 = require_capitalize2();
382751
382955
  var bindAll = require_bindAll();
@@ -383041,7 +383245,7 @@ var require_compat = __commonJS({
383041
383245
  exports2.isTypedArray = isTypedArray3.isTypedArray;
383042
383246
  exports2.isWeakMap = isWeakMap.isWeakMap;
383043
383247
  exports2.isWeakSet = isWeakSet.isWeakSet;
383044
- exports2.matches = matches.matches;
383248
+ exports2.matches = matches2.matches;
383045
383249
  exports2.matchesProperty = matchesProperty.matchesProperty;
383046
383250
  exports2.capitalize = capitalize2.capitalize;
383047
383251
  exports2.bindAll = bindAll.bindAll;
@@ -383357,7 +383561,7 @@ var require_compat2 = __commonJS({
383357
383561
  var isTypedArray3 = require_isTypedArray2();
383358
383562
  var isWeakMap = require_isWeakMap2();
383359
383563
  var isWeakSet = require_isWeakSet2();
383360
- var matches = require_matches();
383564
+ var matches2 = require_matches();
383361
383565
  var matchesProperty = require_matchesProperty();
383362
383566
  var capitalize2 = require_capitalize2();
383363
383567
  var bindAll = require_bindAll();
@@ -383654,7 +383858,7 @@ var require_compat2 = __commonJS({
383654
383858
  exports2.isTypedArray = isTypedArray3.isTypedArray;
383655
383859
  exports2.isWeakMap = isWeakMap.isWeakMap;
383656
383860
  exports2.isWeakSet = isWeakSet.isWeakSet;
383657
- exports2.matches = matches.matches;
383861
+ exports2.matches = matches2.matches;
383658
383862
  exports2.matchesProperty = matchesProperty.matchesProperty;
383659
383863
  exports2.capitalize = capitalize2.capitalize;
383660
383864
  exports2.bindAll = bindAll.bindAll;
@@ -392364,15 +392568,8 @@ var require_GitHub = __commonJS({
392364
392568
  if (fernignore === void 0) {
392365
392569
  return [];
392366
392570
  }
392367
- const fernignoreLines = fernignore.split("\n");
392368
- const fernignoreFiles = [];
392369
- for (const line of fernignoreLines) {
392370
- const trimmedLine = line.trim();
392371
- if (!trimmedLine.startsWith("#") && trimmedLine.length > 0 && await repository.fileExists({ relativeFilePath: trimmedLine })) {
392372
- fernignoreFiles.push(trimmedLine);
392373
- }
392374
- }
392375
- return fernignoreFiles;
392571
+ const tracked = await repository.listTrackedFiles();
392572
+ return (0, github_1.expandFernignorePatterns)(fernignore, tracked);
392376
392573
  }
392377
392574
  async restoreFiles(repository, files) {
392378
392575
  if (files.length === 0) {
@@ -459578,14 +459775,14 @@ var require_localHostOrDomainIs = __commonJS({
459578
459775
  function localHostOrDomainIs(host, hostdom) {
459579
459776
  const parts = host.split(".");
459580
459777
  const domparts = hostdom.split(".");
459581
- let matches = true;
459778
+ let matches2 = true;
459582
459779
  for (let i9 = 0; i9 < parts.length; i9++) {
459583
459780
  if (parts[i9] !== domparts[i9]) {
459584
- matches = false;
459781
+ matches2 = false;
459585
459782
  break;
459586
459783
  }
459587
459784
  }
459588
- return matches;
459785
+ return matches2;
459589
459786
  }
459590
459787
  exports2.default = localHostOrDomainIs;
459591
459788
  }
@@ -502800,20 +502997,20 @@ function extractTraceparentData(traceparent) {
502800
502997
  if (!traceparent) {
502801
502998
  return void 0;
502802
502999
  }
502803
- const matches = traceparent.match(TRACEPARENT_REGEXP);
502804
- if (!matches) {
503000
+ const matches2 = traceparent.match(TRACEPARENT_REGEXP);
503001
+ if (!matches2) {
502805
503002
  return void 0;
502806
503003
  }
502807
503004
  let parentSampled;
502808
- if (matches[3] === "1") {
503005
+ if (matches2[3] === "1") {
502809
503006
  parentSampled = true;
502810
- } else if (matches[3] === "0") {
503007
+ } else if (matches2[3] === "0") {
502811
503008
  parentSampled = false;
502812
503009
  }
502813
503010
  return {
502814
- traceId: matches[1],
503011
+ traceId: matches2[1],
502815
503012
  parentSampled,
502816
- parentSpanId: matches[2]
503013
+ parentSpanId: matches2[2]
502817
503014
  };
502818
503015
  }
502819
503016
  function propagationContextFromHeaders(sentryTrace, baggage) {
@@ -520082,14 +520279,14 @@ var RequireInTheMiddleSingleton3 = class _RequireInTheMiddleSingleton {
520082
520279
  { internals: true },
520083
520280
  (exports2, name2, basedir) => {
520084
520281
  const normalizedModuleName = normalizePathSeparators3(name2);
520085
- const matches = this._moduleNameTrie.search(normalizedModuleName, {
520282
+ const matches2 = this._moduleNameTrie.search(normalizedModuleName, {
520086
520283
  maintainInsertionOrder: true,
520087
520284
  // For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises').
520088
520285
  // This matches the behavior of `require-in-the-middle`.
520089
520286
  // `basedir` is always `undefined` for core modules.
520090
520287
  fullOnly: basedir === void 0
520091
520288
  });
520092
- for (const { onRequire } of matches) {
520289
+ for (const { onRequire } of matches2) {
520093
520290
  exports2 = onRequire(exports2, name2, basedir);
520094
520291
  }
520095
520292
  return exports2;
@@ -522610,11 +522807,11 @@ function assembleStyles() {
522610
522807
  },
522611
522808
  hexToRgb: {
522612
522809
  value(hex3) {
522613
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
522614
- if (!matches) {
522810
+ const matches2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
522811
+ if (!matches2) {
522615
522812
  return [0, 0, 0];
522616
522813
  }
522617
- let [colorString] = matches;
522814
+ let [colorString] = matches2;
522618
522815
  if (colorString.length === 3) {
522619
522816
  colorString = [...colorString].map((character) => character + character).join("");
522620
522817
  }
@@ -561826,6 +562023,7 @@ var OpenApiSettingsSchema = schemas_exports8.object({
561826
562023
  "prefer-undiscriminated-unions-with-literals": schemas_exports8.boolean().optional(),
561827
562024
  "object-query-parameters": schemas_exports8.boolean().optional(),
561828
562025
  "respect-readonly-schemas": schemas_exports8.boolean().optional(),
562026
+ "use-read-variant-for-responses": schemas_exports8.boolean().optional(),
561829
562027
  "respect-forward-compatible-enums": schemas_exports8.boolean().optional(),
561830
562028
  "use-bytes-for-binary-response": schemas_exports8.boolean().optional(),
561831
562029
  "default-form-parameter-encoding": FormParameterEncoding2.optional(),
@@ -562345,6 +562543,7 @@ var DEFAULT_CONVERT_OPENAPI_OPTIONS = {
562345
562543
  detectGlobalHeaders: true,
562346
562544
  objectQueryParameters: true,
562347
562545
  respectReadonlySchemas: false,
562546
+ useReadVariantForResponses: false,
562348
562547
  respectNullableSchemas: true,
562349
562548
  onlyIncludeReferencedSchemas: false,
562350
562549
  inlinePathParameters: true,
@@ -568069,9 +568268,9 @@ init_lodash();
568069
568268
 
568070
568269
  // ../api-importers/openapi/openapi-ir/lib/utils/replaceStartingNumber.js
568071
568270
  function replaceStartingNumber(input3) {
568072
- const matches = input3.match(NUMERIC_REGEX);
568073
- if (matches && matches[0] != null) {
568074
- const numericPart = matches[0];
568271
+ const matches2 = input3.match(NUMERIC_REGEX);
568272
+ if (matches2 && matches2[0] != null) {
568273
+ const numericPart = matches2[0];
568075
568274
  const nonNumericPart = input3.substring(numericPart.length);
568076
568275
  const parsedNumber = parseFloat(numericPart);
568077
568276
  if (!isNaN(parsedNumber) && isFinite(parsedNumber)) {
@@ -571978,7 +572177,8 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
571978
572177
  context: context3,
571979
572178
  fileContainingReference: declarationFile,
571980
572179
  namespace: maybeEndpointNamespace,
571981
- declarationDepth: 0
572180
+ declarationDepth: 0,
572181
+ variant: context3.options.respectReadonlySchemas && context3.options.useReadVariantForResponses ? "read" : void 0
571982
572182
  });
571983
572183
  convertedEndpoint.response = {
571984
572184
  docs: jsonResponse.description ?? void 0,
@@ -571997,7 +572197,8 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
571997
572197
  context: context3,
571998
572198
  fileContainingReference: declarationFile,
571999
572199
  namespace: maybeEndpointNamespace,
572000
- declarationDepth: 0
572200
+ declarationDepth: 0,
572201
+ variant: context3.options.respectReadonlySchemas && context3.options.useReadVariantForResponses ? "read" : void 0
572001
572202
  });
572002
572203
  convertedEndpoint["response-stream"] = {
572003
572204
  docs: jsonResponse.description ?? void 0,
@@ -572012,7 +572213,8 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
572012
572213
  context: context3,
572013
572214
  fileContainingReference: declarationFile,
572014
572215
  namespace: maybeEndpointNamespace,
572015
- declarationDepth: 0
572216
+ declarationDepth: 0,
572217
+ variant: context3.options.respectReadonlySchemas && context3.options.useReadVariantForResponses ? "read" : void 0
572016
572218
  });
572017
572219
  convertedEndpoint["response-stream"] = {
572018
572220
  docs: jsonResponse.description ?? void 0,
@@ -573341,8 +573543,18 @@ function buildFernDefinition(context3) {
573341
573543
  if (context3.ir.hasEndpointsMarkedInternal) {
573342
573544
  context3.builder.addAudience(EXTERNAL_AUDIENCE);
573343
573545
  }
573546
+ if (context3.options.respectReadonlySchemas && context3.options.useReadVariantForResponses) {
573547
+ const reachability = computeSchemaReachability(context3.ir);
573548
+ const variantPlan = computeVariantPlan(context3.ir, reachability);
573549
+ context3.setVariantPlan(variantPlan, reachability);
573550
+ }
573344
573551
  const convertedServices = buildServices(context3);
573345
573552
  const sdkGroups = convertedServices.sdkGroups;
573553
+ if (context3.options.respectReadonlySchemas && !context3.options.useReadVariantForResponses) {
573554
+ const reachability = computeSchemaReachability(context3.ir);
573555
+ const variantPlan = computeVariantPlan(context3.ir, reachability);
573556
+ context3.setVariantPlan(variantPlan, reachability);
573557
+ }
573346
573558
  context3.setInState(State.Webhook);
573347
573559
  buildWebhooks(context3);
573348
573560
  context3.unsetInState(State.Webhook);
@@ -573356,11 +573568,6 @@ function buildFernDefinition(context3) {
573356
573568
  context: context3,
573357
573569
  schemaIdsToExcludeFromServices: convertedServices.schemaIdsToExclude
573358
573570
  });
573359
- if (context3.options.respectReadonlySchemas) {
573360
- const reachability = computeSchemaReachability(context3.ir);
573361
- const variantPlan = computeVariantPlan(context3.ir, reachability);
573362
- context3.setVariantPlan(variantPlan, reachability);
573363
- }
573364
573571
  addSchemas({ schemas: context3.ir.groupedSchemas.rootSchemas, schemaIdsToExclude, namespace: void 0, context: context3 });
573365
573572
  for (const [namespace, schemas] of Object.entries(context3.ir.groupedSchemas.namespacedSchemas)) {
573366
573573
  addSchemas({ schemas, schemaIdsToExclude, namespace, context: context3 });
@@ -574261,6 +574468,7 @@ var BaseOpenAPIWorkspace = class extends AbstractAPIWorkspace {
574261
574468
  objectQueryParameters;
574262
574469
  onlyIncludeReferencedSchemas;
574263
574470
  respectReadonlySchemas;
574471
+ useReadVariantForResponses;
574264
574472
  respectNullableSchemas;
574265
574473
  wrapReferencesToNullableInOptional;
574266
574474
  coerceOptionalSchemasToNullable;
@@ -574284,6 +574492,7 @@ var BaseOpenAPIWorkspace = class extends AbstractAPIWorkspace {
574284
574492
  this.objectQueryParameters = args.objectQueryParameters;
574285
574493
  this.onlyIncludeReferencedSchemas = args.onlyIncludeReferencedSchemas;
574286
574494
  this.respectReadonlySchemas = args.respectReadonlySchemas;
574495
+ this.useReadVariantForResponses = args.useReadVariantForResponses;
574287
574496
  this.respectNullableSchemas = args.respectNullableSchemas;
574288
574497
  this.wrapReferencesToNullableInOptional = args.wrapReferencesToNullableInOptional;
574289
574498
  this.coerceOptionalSchemasToNullable = args.coerceOptionalSchemasToNullable;
@@ -579767,11 +579976,11 @@ var ExampleTypeFactory = class _ExampleTypeFactory {
579767
579976
  }
579768
579977
  return schema2.schemas[0];
579769
579978
  }
579770
- const matches = schema2.schemas.map((schema3) => ({
579979
+ const matches2 = schema2.schemas.map((schema3) => ({
579771
579980
  schema: schema3,
579772
579981
  heuristic: this.calcExampleHeuristic(schema3, fullExample)
579773
579982
  }));
579774
- const sortedMatches = matches.sort((a3, b8) => b8.heuristic - a3.heuristic);
579983
+ const sortedMatches = matches2.sort((a3, b8) => b8.heuristic - a3.heuristic);
579775
579984
  return sortedMatches[0]?.schema;
579776
579985
  }
579777
579986
  // this is not a perfect heuristic, but it's a start. algorithm is as follows:
@@ -579834,14 +580043,14 @@ var ExampleTypeFactory = class _ExampleTypeFactory {
579834
580043
  return this.calcExampleHeuristic(resolvedSchema, fullExample);
579835
580044
  }
579836
580045
  case "oneOf": {
579837
- const matches = Object.values(schema2.value.schemas).map((schema3) => this.calcExampleHeuristic(schema3, fullExample));
579838
- return matches.sort((a3, b8) => b8 - a3)[0] ?? 0;
580046
+ const matches2 = Object.values(schema2.value.schemas).map((schema3) => this.calcExampleHeuristic(schema3, fullExample));
580047
+ return matches2.sort((a3, b8) => b8 - a3)[0] ?? 0;
579839
580048
  }
579840
580049
  case "primitive": {
579841
580050
  if (fullExample == null) {
579842
580051
  return 0;
579843
580052
  }
579844
- const matches = schema2.schema._visit({
580053
+ const matches2 = schema2.schema._visit({
579845
580054
  int: () => typeof fullExample === "number",
579846
580055
  int64: () => typeof fullExample === "number",
579847
580056
  uint: () => typeof fullExample === "number",
@@ -579856,7 +580065,7 @@ var ExampleTypeFactory = class _ExampleTypeFactory {
579856
580065
  boolean: () => typeof fullExample === "boolean",
579857
580066
  _other: () => true
579858
580067
  });
579859
- return matches ? 1 : -1;
580068
+ return matches2 ? 1 : -1;
579860
580069
  }
579861
580070
  default:
579862
580071
  return 0;
@@ -586647,6 +586856,7 @@ var FIELD_MAPPINGS = {
586647
586856
  coerceEnumsToLiterals: "coerceEnumsToLiterals",
586648
586857
  objectQueryParameters: "objectQueryParameters",
586649
586858
  respectReadonlySchemas: "respectReadonlySchemas",
586859
+ useReadVariantForResponses: "useReadVariantForResponses",
586650
586860
  respectNullableSchemas: "respectNullableSchemas",
586651
586861
  onlyIncludeReferencedSchemas: "onlyIncludeReferencedSchemas",
586652
586862
  inlinePathParameters: "inlinePathParameters",
@@ -595902,6 +596112,7 @@ var UNDEFINED_API_DEFINITION_SETTINGS = {
595902
596112
  coerceEnumsToLiterals: void 0,
595903
596113
  objectQueryParameters: void 0,
595904
596114
  respectReadonlySchemas: void 0,
596115
+ useReadVariantForResponses: void 0,
595905
596116
  respectNullableSchemas: void 0,
595906
596117
  inlinePathParameters: void 0,
595907
596118
  useBytesForBinaryResponse: void 0,
@@ -595980,6 +596191,7 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
595980
596191
  onlyIncludeReferencedSchemas: settings?.["only-include-referenced-schemas"],
595981
596192
  objectQueryParameters: settings?.["object-query-parameters"],
595982
596193
  respectReadonlySchemas: settings?.["respect-readonly-schemas"],
596194
+ useReadVariantForResponses: settings?.["use-read-variant-for-responses"],
595983
596195
  inlinePathParameters: settings?.["inline-path-parameters"],
595984
596196
  filter: settings?.filter,
595985
596197
  exampleGeneration: settings?.["example-generation"],
@@ -597103,25 +597315,25 @@ async function findUpMultiple(name2, options2 = {}) {
597103
597315
  }
597104
597316
  return foundPath;
597105
597317
  };
597106
- const matches = [];
597318
+ const matches2 = [];
597107
597319
  while (true) {
597108
597320
  const foundPath = await runMatcher({ ...options2, cwd: directory });
597109
597321
  if (foundPath === findUpStop) {
597110
597322
  break;
597111
597323
  }
597112
597324
  if (foundPath) {
597113
- matches.push(import_node_path8.default.resolve(directory, foundPath));
597325
+ matches2.push(import_node_path8.default.resolve(directory, foundPath));
597114
597326
  }
597115
- if (directory === stopAt || matches.length >= limit) {
597327
+ if (directory === stopAt || matches2.length >= limit) {
597116
597328
  break;
597117
597329
  }
597118
597330
  directory = import_node_path8.default.dirname(directory);
597119
597331
  }
597120
- return matches;
597332
+ return matches2;
597121
597333
  }
597122
597334
  async function findUp(name2, options2 = {}) {
597123
- const matches = await findUpMultiple(name2, { ...options2, limit: 1 });
597124
- return matches[0];
597335
+ const matches2 = await findUpMultiple(name2, { ...options2, limit: 1 });
597336
+ return matches2[0];
597125
597337
  }
597126
597338
 
597127
597339
  // ../configuration-loader/lib/getFernDirectory.js
@@ -627231,10 +627443,10 @@ var forEachEntry = (obj, fn10) => {
627231
627443
  }
627232
627444
  };
627233
627445
  var matchAll = (regExp, str3) => {
627234
- let matches;
627446
+ let matches2;
627235
627447
  const arr = [];
627236
- while ((matches = regExp.exec(str3)) !== null) {
627237
- arr.push(matches);
627448
+ while ((matches2 = regExp.exec(str3)) !== null) {
627449
+ arr.push(matches2);
627238
627450
  }
627239
627451
  return arr;
627240
627452
  };
@@ -659853,6 +660065,7 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
659853
660065
  super({
659854
660066
  ...superArgs,
659855
660067
  respectReadonlySchemas: collapseSpecBooleanSetting(specs, (s9) => s9?.respectReadonlySchemas),
660068
+ useReadVariantForResponses: collapseSpecBooleanSetting(specs, (s9) => s9?.useReadVariantForResponses),
659856
660069
  respectNullableSchemas: collapseSpecBooleanSetting(specs, (s9) => s9?.respectNullableSchemas),
659857
660070
  wrapReferencesToNullableInOptional: collapseSpecBooleanSetting(specs, (s9) => s9?.wrapReferencesToNullableInOptional),
659858
660071
  removeDiscriminantsFromSchemas: convertRemoveDiscriminantsFromSchemas(specs),
@@ -661425,6 +661638,8 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
661425
661638
  objectQueryParameters: external_exports.boolean().optional(),
661426
661639
  /** Enables exploring readonly schemas in OpenAPI specifications. */
661427
661640
  respectReadonlySchemas: external_exports.boolean().optional(),
661641
+ /** If true, endpoint response types will use the Read variant of schemas when respect-readonly-schemas is enabled. Defaults to false. */
661642
+ useReadVariantForResponses: external_exports.boolean().optional(),
661428
661643
  /** Enables respecting forward compatible enums in OpenAPI specifications. Defaults to false. */
661429
661644
  respectForwardCompatibleEnums: external_exports.boolean().optional(),
661430
661645
  /** Enables using the `bytes` type for binary responses in OpenAPI specifications. Defaults to a file stream. */
@@ -667193,9 +667408,9 @@ var FeatureFlagsPoller = class {
667193
667408
  if ((condition.properties || []).length > 0) {
667194
667409
  for (const prop of condition.properties) {
667195
667410
  const propertyType = prop.type;
667196
- let matches = false;
667197
- matches = "cohort" === propertyType ? matchCohort(prop, properties7, this.cohorts, this.debugMode) : "flag" === propertyType ? await this.evaluateFlagDependency(prop, properties7, evaluationContext) : matchProperty(prop, properties7, warnFunction);
667198
- if (!matches) return false;
667411
+ let matches2 = false;
667412
+ matches2 = "cohort" === propertyType ? matchCohort(prop, properties7, this.cohorts, this.debugMode) : "flag" === propertyType ? await this.evaluateFlagDependency(prop, properties7, evaluationContext) : matchProperty(prop, properties7, warnFunction);
667413
+ if (!matches2) return false;
667199
667414
  }
667200
667415
  if (void 0 == rolloutPercentage) return true;
667201
667416
  }
@@ -667522,10 +667737,10 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
667522
667737
  let errorMatchingLocally = false;
667523
667738
  if ("values" in properties7[0]) {
667524
667739
  for (const prop of properties7) try {
667525
- const matches = matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode);
667740
+ const matches2 = matchPropertyGroup(prop, propertyValues, cohortProperties, debugMode);
667526
667741
  if ("AND" === propertyGroupType) {
667527
- if (!matches) return false;
667528
- } else if (matches) return true;
667742
+ if (!matches2) return false;
667743
+ } else if (matches2) return true;
667529
667744
  } catch (err) {
667530
667745
  if (err instanceof RequiresServerEvaluation) throw err;
667531
667746
  if (err instanceof InconclusiveMatchError) {
@@ -667537,19 +667752,19 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
667537
667752
  return "AND" === propertyGroupType;
667538
667753
  }
667539
667754
  for (const prop of properties7) try {
667540
- let matches;
667541
- if ("cohort" === prop.type) matches = matchCohort(prop, propertyValues, cohortProperties, debugMode);
667755
+ let matches2;
667756
+ if ("cohort" === prop.type) matches2 = matchCohort(prop, propertyValues, cohortProperties, debugMode);
667542
667757
  else if ("flag" === prop.type) {
667543
667758
  if (debugMode) console.warn(`[FEATURE FLAGS] Flag dependency filters are not supported in local evaluation. Skipping condition with dependency on flag '${prop.key || "unknown"}'`);
667544
667759
  continue;
667545
- } else matches = matchProperty(prop, propertyValues);
667760
+ } else matches2 = matchProperty(prop, propertyValues);
667546
667761
  const negation = prop.negation || false;
667547
667762
  if ("AND" === propertyGroupType) {
667548
- if (!matches && !negation) return false;
667549
- if (matches && negation) return false;
667763
+ if (!matches2 && !negation) return false;
667764
+ if (matches2 && negation) return false;
667550
667765
  } else {
667551
- if (matches && !negation) return true;
667552
- if (!matches && negation) return true;
667766
+ if (matches2 && !negation) return true;
667767
+ if (!matches2 && negation) return true;
667553
667768
  }
667554
667769
  } catch (err) {
667555
667770
  if (err instanceof RequiresServerEvaluation) throw err;
@@ -668568,7 +668783,7 @@ var AccessTokenPosthogManager = class {
668568
668783
  properties: {
668569
668784
  ...event,
668570
668785
  ...event.properties,
668571
- version: "5.35.0",
668786
+ version: "5.35.1",
668572
668787
  usingAccessToken: true,
668573
668788
  ...getRunIdProperties()
668574
668789
  }
@@ -668632,7 +668847,7 @@ var UserPosthogManager = class {
668632
668847
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
668633
668848
  event: "CLI",
668634
668849
  properties: {
668635
- version: "5.35.0",
668850
+ version: "5.35.1",
668636
668851
  ...event,
668637
668852
  ...event.properties,
668638
668853
  usingAccessToken: false,
@@ -668992,11 +669207,11 @@ function assembleStyles2() {
668992
669207
  },
668993
669208
  hexToRgb: {
668994
669209
  value(hex3) {
668995
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
668996
- if (!matches) {
669210
+ const matches2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
669211
+ if (!matches2) {
668997
669212
  return [0, 0, 0];
668998
669213
  }
668999
- let [colorString] = matches;
669214
+ let [colorString] = matches2;
669000
669215
  if (colorString.length === 3) {
669001
669216
  colorString = [...colorString].map((character) => character + character).join("");
669002
669217
  }
@@ -674691,6 +674906,7 @@ var LegacyApiSpecAdapter = class {
674691
674906
  pathParameterOrder: this.adaptPathParameterOrder(settings.pathParameterOrder),
674692
674907
  // OpenAPI-specific settings
674693
674908
  respectReadonlySchemas: settings.respectReadonlySchemas,
674909
+ useReadVariantForResponses: settings.useReadVariantForResponses,
674694
674910
  onlyIncludeReferencedSchemas: settings.onlyIncludeReferencedSchemas,
674695
674911
  inlinePathParameters: settings.inlinePathParameters,
674696
674912
  shouldUseUndiscriminatedUnionsWithLiterals: settings.preferUndiscriminatedUnionsWithLiterals,
@@ -831672,7 +831888,7 @@ function tokensToFunction(tokens, options2) {
831672
831888
  var _a12 = options2.encode, encode6 = _a12 === void 0 ? function(x5) {
831673
831889
  return x5;
831674
831890
  } : _a12, _b3 = options2.validate, validate3 = _b3 === void 0 ? true : _b3;
831675
- var matches = tokens.map(function(token) {
831891
+ var matches2 = tokens.map(function(token) {
831676
831892
  if (typeof token === "object") {
831677
831893
  return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags);
831678
831894
  }
@@ -831699,7 +831915,7 @@ function tokensToFunction(tokens, options2) {
831699
831915
  }
831700
831916
  for (var j7 = 0; j7 < value2.length; j7++) {
831701
831917
  var segment = encode6(value2[j7], token);
831702
- if (validate3 && !matches[i9].test(segment)) {
831918
+ if (validate3 && !matches2[i9].test(segment)) {
831703
831919
  throw new TypeError('Expected all "'.concat(token.name, '" to match "').concat(token.pattern, '", but got "').concat(segment, '"'));
831704
831920
  }
831705
831921
  path115 += token.prefix + segment + token.suffix;
@@ -831708,7 +831924,7 @@ function tokensToFunction(tokens, options2) {
831708
831924
  }
831709
831925
  if (typeof value2 === "string" || typeof value2 === "number") {
831710
831926
  var segment = encode6(String(value2), token);
831711
- if (validate3 && !matches[i9].test(segment)) {
831927
+ if (validate3 && !matches2[i9].test(segment)) {
831712
831928
  throw new TypeError('Expected "'.concat(token.name, '" to match "').concat(token.pattern, '", but got "').concat(segment, '"'));
831713
831929
  }
831714
831930
  path115 += token.prefix + segment + token.suffix;
@@ -856942,6 +857158,7 @@ var SETTINGS_KEY_MAP = {
856942
857158
  "prefer-undiscriminated-unions-with-literals": "preferUndiscriminatedUnionsWithLiterals",
856943
857159
  "object-query-parameters": "objectQueryParameters",
856944
857160
  "respect-readonly-schemas": "respectReadonlySchemas",
857161
+ "use-read-variant-for-responses": "useReadVariantForResponses",
856945
857162
  "respect-forward-compatible-enums": "respectForwardCompatibleEnums",
856946
857163
  "use-bytes-for-binary-response": "useBytesForBinaryResponse",
856947
857164
  "default-form-parameter-encoding": "defaultFormParameterEncoding",
@@ -860485,7 +860702,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
860485
860702
  var LOGS_FOLDER_NAME = "logs";
860486
860703
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
860487
860704
  function getCliSource() {
860488
- const version7 = "5.35.0";
860705
+ const version7 = "5.35.1";
860489
860706
  return `cli@${version7}`;
860490
860707
  }
860491
860708
  var DebugLogger = class {
@@ -867857,8 +868074,8 @@ function extractLinksFromTypes(typeStrings, ctx, currentModulePath) {
867857
868074
  if (!typeStr) {
867858
868075
  continue;
867859
868076
  }
867860
- const matches = typeStr.match(QUALIFIED_PATH_REGEX) || [];
867861
- for (const path115 of matches) {
868077
+ const matches2 = typeStr.match(QUALIFIED_PATH_REGEX) || [];
868078
+ for (const path115 of matches2) {
867862
868079
  if (links[path115]) {
867863
868080
  continue;
867864
868081
  }
@@ -879357,7 +879574,7 @@ var LegacyDocsPublisher = class {
879357
879574
  previewId,
879358
879575
  disableTemplates: void 0,
879359
879576
  skipUpload,
879360
- cliVersion: "5.35.0",
879577
+ cliVersion: "5.35.1",
879361
879578
  loginCommand: "fern auth login"
879362
879579
  });
879363
879580
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -954097,7 +954314,7 @@ function getAutomationContextFromEnv() {
954097
954314
  config_branch: process.env.FERN_CONFIG_BRANCH,
954098
954315
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
954099
954316
  trigger: process.env.GITHUB_EVENT_NAME,
954100
- cli_version: "5.35.0"
954317
+ cli_version: "5.35.1"
954101
954318
  };
954102
954319
  }
954103
954320
  function isAutomationMode() {
@@ -954923,7 +955140,7 @@ var CliContext = class _CliContext {
954923
955140
  if (false) {
954924
955141
  this.logger.error("CLI_VERSION is not defined");
954925
955142
  }
954926
- return "5.35.0";
955143
+ return "5.35.1";
954927
955144
  }
954928
955145
  getCliName() {
954929
955146
  if (false) {
@@ -967250,7 +967467,7 @@ function findMatchingSpecPath(overridePath, specPaths) {
967250
967467
  if (specSegments.length !== overrideSegments.length) {
967251
967468
  continue;
967252
967469
  }
967253
- let matches = true;
967470
+ let matches2 = true;
967254
967471
  for (let i9 = 0; i9 < specSegments.length; i9++) {
967255
967472
  const specSeg = specSegments[i9];
967256
967473
  const overrideSeg = overrideSegments[i9];
@@ -967263,10 +967480,10 @@ function findMatchingSpecPath(overridePath, specPaths) {
967263
967480
  continue;
967264
967481
  }
967265
967482
  }
967266
- matches = false;
967483
+ matches2 = false;
967267
967484
  break;
967268
967485
  }
967269
- if (matches) {
967486
+ if (matches2) {
967270
967487
  return specPath;
967271
967488
  }
967272
967489
  }