@sentry/craft 2.21.3 → 2.21.4

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/dist/craft +800 -523
  2. package/package.json +2 -1
package/dist/craft CHANGED
@@ -55567,6 +55567,155 @@ var init_dryRun = __esm({
55567
55567
  }
55568
55568
  });
55569
55569
 
55570
+ // node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.js
55571
+ var require_mod = __commonJS({
55572
+ "node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.js"(exports2) {
55573
+ "use strict";
55574
+ init_import_meta_url();
55575
+ exports2.__esModule = true;
55576
+ exports2.distance = exports2.closest = void 0;
55577
+ var peq = new Uint32Array(65536);
55578
+ var myers_32 = function(a4, b5) {
55579
+ var n4 = a4.length;
55580
+ var m5 = b5.length;
55581
+ var lst = 1 << n4 - 1;
55582
+ var pv = -1;
55583
+ var mv = 0;
55584
+ var sc = n4;
55585
+ var i4 = n4;
55586
+ while (i4--) {
55587
+ peq[a4.charCodeAt(i4)] |= 1 << i4;
55588
+ }
55589
+ for (i4 = 0; i4 < m5; i4++) {
55590
+ var eq = peq[b5.charCodeAt(i4)];
55591
+ var xv = eq | mv;
55592
+ eq |= (eq & pv) + pv ^ pv;
55593
+ mv |= ~(eq | pv);
55594
+ pv &= eq;
55595
+ if (mv & lst) {
55596
+ sc++;
55597
+ }
55598
+ if (pv & lst) {
55599
+ sc--;
55600
+ }
55601
+ mv = mv << 1 | 1;
55602
+ pv = pv << 1 | ~(xv | mv);
55603
+ mv &= xv;
55604
+ }
55605
+ i4 = n4;
55606
+ while (i4--) {
55607
+ peq[a4.charCodeAt(i4)] = 0;
55608
+ }
55609
+ return sc;
55610
+ };
55611
+ var myers_x = function(b5, a4) {
55612
+ var n4 = a4.length;
55613
+ var m5 = b5.length;
55614
+ var mhc = [];
55615
+ var phc = [];
55616
+ var hsize = Math.ceil(n4 / 32);
55617
+ var vsize = Math.ceil(m5 / 32);
55618
+ for (var i4 = 0; i4 < hsize; i4++) {
55619
+ phc[i4] = -1;
55620
+ mhc[i4] = 0;
55621
+ }
55622
+ var j5 = 0;
55623
+ for (; j5 < vsize - 1; j5++) {
55624
+ var mv_1 = 0;
55625
+ var pv_1 = -1;
55626
+ var start_1 = j5 * 32;
55627
+ var vlen_1 = Math.min(32, m5) + start_1;
55628
+ for (var k5 = start_1; k5 < vlen_1; k5++) {
55629
+ peq[b5.charCodeAt(k5)] |= 1 << k5;
55630
+ }
55631
+ for (var i4 = 0; i4 < n4; i4++) {
55632
+ var eq = peq[a4.charCodeAt(i4)];
55633
+ var pb = phc[i4 / 32 | 0] >>> i4 & 1;
55634
+ var mb = mhc[i4 / 32 | 0] >>> i4 & 1;
55635
+ var xv = eq | mv_1;
55636
+ var xh = ((eq | mb) & pv_1) + pv_1 ^ pv_1 | eq | mb;
55637
+ var ph = mv_1 | ~(xh | pv_1);
55638
+ var mh = pv_1 & xh;
55639
+ if (ph >>> 31 ^ pb) {
55640
+ phc[i4 / 32 | 0] ^= 1 << i4;
55641
+ }
55642
+ if (mh >>> 31 ^ mb) {
55643
+ mhc[i4 / 32 | 0] ^= 1 << i4;
55644
+ }
55645
+ ph = ph << 1 | pb;
55646
+ mh = mh << 1 | mb;
55647
+ pv_1 = mh | ~(xv | ph);
55648
+ mv_1 = ph & xv;
55649
+ }
55650
+ for (var k5 = start_1; k5 < vlen_1; k5++) {
55651
+ peq[b5.charCodeAt(k5)] = 0;
55652
+ }
55653
+ }
55654
+ var mv = 0;
55655
+ var pv = -1;
55656
+ var start = j5 * 32;
55657
+ var vlen = Math.min(32, m5 - start) + start;
55658
+ for (var k5 = start; k5 < vlen; k5++) {
55659
+ peq[b5.charCodeAt(k5)] |= 1 << k5;
55660
+ }
55661
+ var score = m5;
55662
+ for (var i4 = 0; i4 < n4; i4++) {
55663
+ var eq = peq[a4.charCodeAt(i4)];
55664
+ var pb = phc[i4 / 32 | 0] >>> i4 & 1;
55665
+ var mb = mhc[i4 / 32 | 0] >>> i4 & 1;
55666
+ var xv = eq | mv;
55667
+ var xh = ((eq | mb) & pv) + pv ^ pv | eq | mb;
55668
+ var ph = mv | ~(xh | pv);
55669
+ var mh = pv & xh;
55670
+ score += ph >>> m5 - 1 & 1;
55671
+ score -= mh >>> m5 - 1 & 1;
55672
+ if (ph >>> 31 ^ pb) {
55673
+ phc[i4 / 32 | 0] ^= 1 << i4;
55674
+ }
55675
+ if (mh >>> 31 ^ mb) {
55676
+ mhc[i4 / 32 | 0] ^= 1 << i4;
55677
+ }
55678
+ ph = ph << 1 | pb;
55679
+ mh = mh << 1 | mb;
55680
+ pv = mh | ~(xv | ph);
55681
+ mv = ph & xv;
55682
+ }
55683
+ for (var k5 = start; k5 < vlen; k5++) {
55684
+ peq[b5.charCodeAt(k5)] = 0;
55685
+ }
55686
+ return score;
55687
+ };
55688
+ var distance = function(a4, b5) {
55689
+ if (a4.length < b5.length) {
55690
+ var tmp2 = b5;
55691
+ b5 = a4;
55692
+ a4 = tmp2;
55693
+ }
55694
+ if (b5.length === 0) {
55695
+ return a4.length;
55696
+ }
55697
+ if (a4.length <= 32) {
55698
+ return myers_32(a4, b5);
55699
+ }
55700
+ return myers_x(a4, b5);
55701
+ };
55702
+ exports2.distance = distance;
55703
+ var closest = function(str2, arr) {
55704
+ var min_distance = Infinity;
55705
+ var min_index = 0;
55706
+ for (var i4 = 0; i4 < arr.length; i4++) {
55707
+ var dist = distance(str2, arr[i4]);
55708
+ if (dist < min_distance) {
55709
+ min_distance = dist;
55710
+ min_index = i4;
55711
+ }
55712
+ }
55713
+ return arr[min_index];
55714
+ };
55715
+ exports2.closest = closest;
55716
+ }
55717
+ });
55718
+
55570
55719
  // src/utils/git.ts
55571
55720
  async function getDefaultBranch(git, remoteName) {
55572
55721
  return stripRemoteName(
@@ -55645,7 +55794,45 @@ async function cloneRepo(url2, targetDirectory, options) {
55645
55794
  function isRepoDirty(repoStatus) {
55646
55795
  return !!(repoStatus.conflicted.length || repoStatus.created.length || repoStatus.deleted.length || repoStatus.modified.length || repoStatus.renamed.length || repoStatus.staged.length);
55647
55796
  }
55648
- var PRExtractor;
55797
+ function parseGitBranchOutput(output) {
55798
+ return output.split("\n").map((line) => line.trim()).filter((line) => line && !line.includes("->"));
55799
+ }
55800
+ async function findReleaseBranches(git, prefix, limit = 10) {
55801
+ const MAX_EDIT_DISTANCE = 3;
55802
+ try {
55803
+ await git.fetch();
55804
+ } catch (_err) {
55805
+ logger.debug("Failed to fetch from remote, using locally cached refs");
55806
+ }
55807
+ let allBranches;
55808
+ try {
55809
+ const output = await git.raw("branch", "-r");
55810
+ allBranches = parseGitBranchOutput(output);
55811
+ } catch (_err) {
55812
+ logger.debug("Failed to list remote branches");
55813
+ return { exactMatches: [], fuzzyMatches: [] };
55814
+ }
55815
+ const exactMatches = [];
55816
+ const fuzzyMatches = [];
55817
+ for (const branch of allBranches) {
55818
+ const withoutRemote = branch.replace(/^[^/]+\//, "");
55819
+ const slashIndex = withoutRemote.indexOf("/");
55820
+ const branchPrefix = slashIndex >= 0 ? withoutRemote.slice(0, slashIndex) : withoutRemote;
55821
+ if (!branchPrefix) {
55822
+ continue;
55823
+ }
55824
+ if (branchPrefix === prefix) {
55825
+ exactMatches.push(branch);
55826
+ } else if ((0, import_fastest_levenshtein.distance)(branchPrefix, prefix) <= MAX_EDIT_DISTANCE) {
55827
+ fuzzyMatches.push(branch);
55828
+ }
55829
+ }
55830
+ return {
55831
+ exactMatches: exactMatches.slice(-limit).reverse(),
55832
+ fuzzyMatches: fuzzyMatches.slice(-limit).reverse()
55833
+ };
55834
+ }
55835
+ var import_fastest_levenshtein, PRExtractor;
55649
55836
  var init_git = __esm({
55650
55837
  "src/utils/git.ts"() {
55651
55838
  init_import_meta_url();
@@ -55654,6 +55841,7 @@ var init_git = __esm({
55654
55841
  init_errors2();
55655
55842
  init_dryRun();
55656
55843
  init_logger2();
55844
+ import_fastest_levenshtein = __toESM(require_mod());
55657
55845
  PRExtractor = /(?<=\(#)\d+(?=\)$)/;
55658
55846
  }
55659
55847
  });
@@ -80403,6 +80591,487 @@ var init_files = __esm({
80403
80591
  }
80404
80592
  });
80405
80593
 
80594
+ // node_modules/.pnpm/mustache@3.0.1/node_modules/mustache/mustache.js
80595
+ var require_mustache = __commonJS({
80596
+ "node_modules/.pnpm/mustache@3.0.1/node_modules/mustache/mustache.js"(exports2) {
80597
+ init_import_meta_url();
80598
+ (function defineMustache(global2, factory) {
80599
+ if (typeof exports2 === "object" && exports2 && typeof exports2.nodeName !== "string") {
80600
+ factory(exports2);
80601
+ } else if (typeof define === "function" && define.amd) {
80602
+ define(["exports"], factory);
80603
+ } else {
80604
+ global2.Mustache = {};
80605
+ factory(global2.Mustache);
80606
+ }
80607
+ })(exports2, function mustacheFactory(mustache2) {
80608
+ var objectToString3 = Object.prototype.toString;
80609
+ var isArray = Array.isArray || function isArrayPolyfill(object) {
80610
+ return objectToString3.call(object) === "[object Array]";
80611
+ };
80612
+ function isFunction2(object) {
80613
+ return typeof object === "function";
80614
+ }
80615
+ function typeStr(obj) {
80616
+ return isArray(obj) ? "array" : typeof obj;
80617
+ }
80618
+ function escapeRegExp(string) {
80619
+ return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
80620
+ }
80621
+ function hasProperty(obj, propName2) {
80622
+ return obj != null && typeof obj === "object" && propName2 in obj;
80623
+ }
80624
+ function primitiveHasOwnProperty(primitive, propName2) {
80625
+ return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName2);
80626
+ }
80627
+ var regExpTest = RegExp.prototype.test;
80628
+ function testRegExp(re3, string) {
80629
+ return regExpTest.call(re3, string);
80630
+ }
80631
+ var nonSpaceRe = /\S/;
80632
+ function isWhitespace2(string) {
80633
+ return !testRegExp(nonSpaceRe, string);
80634
+ }
80635
+ var entityMap = {
80636
+ "&": "&amp;",
80637
+ "<": "&lt;",
80638
+ ">": "&gt;",
80639
+ '"': "&quot;",
80640
+ "'": "&#39;",
80641
+ "/": "&#x2F;",
80642
+ "`": "&#x60;",
80643
+ "=": "&#x3D;"
80644
+ };
80645
+ function escapeHtml(string) {
80646
+ return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s4) {
80647
+ return entityMap[s4];
80648
+ });
80649
+ }
80650
+ var whiteRe = /\s*/;
80651
+ var spaceRe = /\s+/;
80652
+ var equalsRe = /\s*=/;
80653
+ var curlyRe = /\s*\}/;
80654
+ var tagRe = /#|\^|\/|>|\{|&|=|!/;
80655
+ function parseTemplate(template, tags) {
80656
+ if (!template)
80657
+ return [];
80658
+ var sections = [];
80659
+ var tokens = [];
80660
+ var spaces = [];
80661
+ var hasTag = false;
80662
+ var nonSpace = false;
80663
+ function stripSpace() {
80664
+ if (hasTag && !nonSpace) {
80665
+ while (spaces.length)
80666
+ delete tokens[spaces.pop()];
80667
+ } else {
80668
+ spaces = [];
80669
+ }
80670
+ hasTag = false;
80671
+ nonSpace = false;
80672
+ }
80673
+ var openingTagRe, closingTagRe, closingCurlyRe;
80674
+ function compileTags(tagsToCompile) {
80675
+ if (typeof tagsToCompile === "string")
80676
+ tagsToCompile = tagsToCompile.split(spaceRe, 2);
80677
+ if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
80678
+ throw new Error("Invalid tags: " + tagsToCompile);
80679
+ openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
80680
+ closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
80681
+ closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
80682
+ }
80683
+ compileTags(tags || mustache2.tags);
80684
+ var scanner = new Scanner(template);
80685
+ var start, type2, value, chr, token, openSection;
80686
+ while (!scanner.eos()) {
80687
+ start = scanner.pos;
80688
+ value = scanner.scanUntil(openingTagRe);
80689
+ if (value) {
80690
+ for (var i4 = 0, valueLength = value.length; i4 < valueLength; ++i4) {
80691
+ chr = value.charAt(i4);
80692
+ if (isWhitespace2(chr)) {
80693
+ spaces.push(tokens.length);
80694
+ } else {
80695
+ nonSpace = true;
80696
+ }
80697
+ tokens.push(["text", chr, start, start + 1]);
80698
+ start += 1;
80699
+ if (chr === "\n")
80700
+ stripSpace();
80701
+ }
80702
+ }
80703
+ if (!scanner.scan(openingTagRe))
80704
+ break;
80705
+ hasTag = true;
80706
+ type2 = scanner.scan(tagRe) || "name";
80707
+ scanner.scan(whiteRe);
80708
+ if (type2 === "=") {
80709
+ value = scanner.scanUntil(equalsRe);
80710
+ scanner.scan(equalsRe);
80711
+ scanner.scanUntil(closingTagRe);
80712
+ } else if (type2 === "{") {
80713
+ value = scanner.scanUntil(closingCurlyRe);
80714
+ scanner.scan(curlyRe);
80715
+ scanner.scanUntil(closingTagRe);
80716
+ type2 = "&";
80717
+ } else {
80718
+ value = scanner.scanUntil(closingTagRe);
80719
+ }
80720
+ if (!scanner.scan(closingTagRe))
80721
+ throw new Error("Unclosed tag at " + scanner.pos);
80722
+ token = [type2, value, start, scanner.pos];
80723
+ tokens.push(token);
80724
+ if (type2 === "#" || type2 === "^") {
80725
+ sections.push(token);
80726
+ } else if (type2 === "/") {
80727
+ openSection = sections.pop();
80728
+ if (!openSection)
80729
+ throw new Error('Unopened section "' + value + '" at ' + start);
80730
+ if (openSection[1] !== value)
80731
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
80732
+ } else if (type2 === "name" || type2 === "{" || type2 === "&") {
80733
+ nonSpace = true;
80734
+ } else if (type2 === "=") {
80735
+ compileTags(value);
80736
+ }
80737
+ }
80738
+ openSection = sections.pop();
80739
+ if (openSection)
80740
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
80741
+ return nestTokens(squashTokens(tokens));
80742
+ }
80743
+ function squashTokens(tokens) {
80744
+ var squashedTokens = [];
80745
+ var token, lastToken;
80746
+ for (var i4 = 0, numTokens = tokens.length; i4 < numTokens; ++i4) {
80747
+ token = tokens[i4];
80748
+ if (token) {
80749
+ if (token[0] === "text" && lastToken && lastToken[0] === "text") {
80750
+ lastToken[1] += token[1];
80751
+ lastToken[3] = token[3];
80752
+ } else {
80753
+ squashedTokens.push(token);
80754
+ lastToken = token;
80755
+ }
80756
+ }
80757
+ }
80758
+ return squashedTokens;
80759
+ }
80760
+ function nestTokens(tokens) {
80761
+ var nestedTokens = [];
80762
+ var collector = nestedTokens;
80763
+ var sections = [];
80764
+ var token, section;
80765
+ for (var i4 = 0, numTokens = tokens.length; i4 < numTokens; ++i4) {
80766
+ token = tokens[i4];
80767
+ switch (token[0]) {
80768
+ case "#":
80769
+ case "^":
80770
+ collector.push(token);
80771
+ sections.push(token);
80772
+ collector = token[4] = [];
80773
+ break;
80774
+ case "/":
80775
+ section = sections.pop();
80776
+ section[5] = token[2];
80777
+ collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
80778
+ break;
80779
+ default:
80780
+ collector.push(token);
80781
+ }
80782
+ }
80783
+ return nestedTokens;
80784
+ }
80785
+ function Scanner(string) {
80786
+ this.string = string;
80787
+ this.tail = string;
80788
+ this.pos = 0;
80789
+ }
80790
+ Scanner.prototype.eos = function eos() {
80791
+ return this.tail === "";
80792
+ };
80793
+ Scanner.prototype.scan = function scan2(re3) {
80794
+ var match3 = this.tail.match(re3);
80795
+ if (!match3 || match3.index !== 0)
80796
+ return "";
80797
+ var string = match3[0];
80798
+ this.tail = this.tail.substring(string.length);
80799
+ this.pos += string.length;
80800
+ return string;
80801
+ };
80802
+ Scanner.prototype.scanUntil = function scanUntil(re3) {
80803
+ var index = this.tail.search(re3), match3;
80804
+ switch (index) {
80805
+ case -1:
80806
+ match3 = this.tail;
80807
+ this.tail = "";
80808
+ break;
80809
+ case 0:
80810
+ match3 = "";
80811
+ break;
80812
+ default:
80813
+ match3 = this.tail.substring(0, index);
80814
+ this.tail = this.tail.substring(index);
80815
+ }
80816
+ this.pos += match3.length;
80817
+ return match3;
80818
+ };
80819
+ function Context2(view, parentContext) {
80820
+ this.view = view;
80821
+ this.cache = { ".": this.view };
80822
+ this.parent = parentContext;
80823
+ }
80824
+ Context2.prototype.push = function push2(view) {
80825
+ return new Context2(view, this);
80826
+ };
80827
+ Context2.prototype.lookup = function lookup(name2) {
80828
+ var cache6 = this.cache;
80829
+ var value;
80830
+ if (cache6.hasOwnProperty(name2)) {
80831
+ value = cache6[name2];
80832
+ } else {
80833
+ var context2 = this, intermediateValue, names, index, lookupHit = false;
80834
+ while (context2) {
80835
+ if (name2.indexOf(".") > 0) {
80836
+ intermediateValue = context2.view;
80837
+ names = name2.split(".");
80838
+ index = 0;
80839
+ while (intermediateValue != null && index < names.length) {
80840
+ if (index === names.length - 1)
80841
+ lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
80842
+ intermediateValue = intermediateValue[names[index++]];
80843
+ }
80844
+ } else {
80845
+ intermediateValue = context2.view[name2];
80846
+ lookupHit = hasProperty(context2.view, name2);
80847
+ }
80848
+ if (lookupHit) {
80849
+ value = intermediateValue;
80850
+ break;
80851
+ }
80852
+ context2 = context2.parent;
80853
+ }
80854
+ cache6[name2] = value;
80855
+ }
80856
+ if (isFunction2(value))
80857
+ value = value.call(this.view);
80858
+ return value;
80859
+ };
80860
+ function Writer() {
80861
+ this.cache = {};
80862
+ }
80863
+ Writer.prototype.clearCache = function clearCache() {
80864
+ this.cache = {};
80865
+ };
80866
+ Writer.prototype.parse = function parse8(template, tags) {
80867
+ var cache6 = this.cache;
80868
+ var cacheKey = template + ":" + (tags || mustache2.tags).join(":");
80869
+ var tokens = cache6[cacheKey];
80870
+ if (tokens == null)
80871
+ tokens = cache6[cacheKey] = parseTemplate(template, tags);
80872
+ return tokens;
80873
+ };
80874
+ Writer.prototype.render = function render2(template, view, partials, tags) {
80875
+ var tokens = this.parse(template, tags);
80876
+ var context2 = view instanceof Context2 ? view : new Context2(view);
80877
+ return this.renderTokens(tokens, context2, partials, template, tags);
80878
+ };
80879
+ Writer.prototype.renderTokens = function renderTokens(tokens, context2, partials, originalTemplate, tags) {
80880
+ var buffer = "";
80881
+ var token, symbol, value;
80882
+ for (var i4 = 0, numTokens = tokens.length; i4 < numTokens; ++i4) {
80883
+ value = void 0;
80884
+ token = tokens[i4];
80885
+ symbol = token[0];
80886
+ if (symbol === "#") value = this.renderSection(token, context2, partials, originalTemplate);
80887
+ else if (symbol === "^") value = this.renderInverted(token, context2, partials, originalTemplate);
80888
+ else if (symbol === ">") value = this.renderPartial(token, context2, partials, tags);
80889
+ else if (symbol === "&") value = this.unescapedValue(token, context2);
80890
+ else if (symbol === "name") value = this.escapedValue(token, context2);
80891
+ else if (symbol === "text") value = this.rawValue(token);
80892
+ if (value !== void 0)
80893
+ buffer += value;
80894
+ }
80895
+ return buffer;
80896
+ };
80897
+ Writer.prototype.renderSection = function renderSection(token, context2, partials, originalTemplate) {
80898
+ var self2 = this;
80899
+ var buffer = "";
80900
+ var value = context2.lookup(token[1]);
80901
+ function subRender(template) {
80902
+ return self2.render(template, context2, partials);
80903
+ }
80904
+ if (!value) return;
80905
+ if (isArray(value)) {
80906
+ for (var j5 = 0, valueLength = value.length; j5 < valueLength; ++j5) {
80907
+ buffer += this.renderTokens(token[4], context2.push(value[j5]), partials, originalTemplate);
80908
+ }
80909
+ } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
80910
+ buffer += this.renderTokens(token[4], context2.push(value), partials, originalTemplate);
80911
+ } else if (isFunction2(value)) {
80912
+ if (typeof originalTemplate !== "string")
80913
+ throw new Error("Cannot use higher-order sections without the original template");
80914
+ value = value.call(context2.view, originalTemplate.slice(token[3], token[5]), subRender);
80915
+ if (value != null)
80916
+ buffer += value;
80917
+ } else {
80918
+ buffer += this.renderTokens(token[4], context2, partials, originalTemplate);
80919
+ }
80920
+ return buffer;
80921
+ };
80922
+ Writer.prototype.renderInverted = function renderInverted(token, context2, partials, originalTemplate) {
80923
+ var value = context2.lookup(token[1]);
80924
+ if (!value || isArray(value) && value.length === 0)
80925
+ return this.renderTokens(token[4], context2, partials, originalTemplate);
80926
+ };
80927
+ Writer.prototype.renderPartial = function renderPartial(token, context2, partials, tags) {
80928
+ if (!partials) return;
80929
+ var value = isFunction2(partials) ? partials(token[1]) : partials[token[1]];
80930
+ if (value != null)
80931
+ return this.renderTokens(this.parse(value, tags), context2, partials, value);
80932
+ };
80933
+ Writer.prototype.unescapedValue = function unescapedValue(token, context2) {
80934
+ var value = context2.lookup(token[1]);
80935
+ if (value != null)
80936
+ return value;
80937
+ };
80938
+ Writer.prototype.escapedValue = function escapedValue(token, context2) {
80939
+ var value = context2.lookup(token[1]);
80940
+ if (value != null)
80941
+ return mustache2.escape(value);
80942
+ };
80943
+ Writer.prototype.rawValue = function rawValue(token) {
80944
+ return token[1];
80945
+ };
80946
+ mustache2.name = "mustache.js";
80947
+ mustache2.version = "3.0.1";
80948
+ mustache2.tags = ["{{", "}}"];
80949
+ var defaultWriter = new Writer();
80950
+ mustache2.clearCache = function clearCache() {
80951
+ return defaultWriter.clearCache();
80952
+ };
80953
+ mustache2.parse = function parse8(template, tags) {
80954
+ return defaultWriter.parse(template, tags);
80955
+ };
80956
+ mustache2.render = function render2(template, view, partials, tags) {
80957
+ if (typeof template !== "string") {
80958
+ throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template) + '" was given as the first argument for mustache#render(template, view, partials)');
80959
+ }
80960
+ return defaultWriter.render(template, view, partials, tags);
80961
+ };
80962
+ mustache2.to_html = function to_html(template, view, partials, send) {
80963
+ var result = mustache2.render(template, view, partials);
80964
+ if (isFunction2(send)) {
80965
+ send(result);
80966
+ } else {
80967
+ return result;
80968
+ }
80969
+ };
80970
+ mustache2.escape = escapeHtml;
80971
+ mustache2.Scanner = Scanner;
80972
+ mustache2.Context = Context2;
80973
+ mustache2.Writer = Writer;
80974
+ return mustache2;
80975
+ });
80976
+ }
80977
+ });
80978
+
80979
+ // src/utils/strings.ts
80980
+ function sanitizeObject(obj) {
80981
+ if (typeof obj !== "object" || obj === null) {
80982
+ throw new Error(`Cannot normalize value: ${obj}`);
80983
+ }
80984
+ const result = {};
80985
+ for (const key of Object.keys(obj)) {
80986
+ const value = obj[key];
80987
+ const valueType = typeof value;
80988
+ let newValue;
80989
+ if (["boolean", "string", "number", "undefined"].indexOf(valueType) > -1) {
80990
+ newValue = value;
80991
+ } else if (value === null) {
80992
+ newValue = void 0;
80993
+ } else if (valueType === "object") {
80994
+ newValue = sanitizeObject(value);
80995
+ } else {
80996
+ continue;
80997
+ }
80998
+ result[key] = newValue;
80999
+ const normalizedKey = key.replace(/\./g, "__");
81000
+ if (key !== normalizedKey) {
81001
+ result[normalizedKey] = newValue;
81002
+ }
81003
+ }
81004
+ return result;
81005
+ }
81006
+ function renderTemplateSafe(template, context2) {
81007
+ const sanitizedContext = sanitizeObject(context2);
81008
+ const unknownVars = [];
81009
+ mustache.Context.prototype.lookup = function(name2) {
81010
+ const value = originalLookup.call(this, name2);
81011
+ if (value === void 0) {
81012
+ unknownVars.push(name2);
81013
+ }
81014
+ return value;
81015
+ };
81016
+ try {
81017
+ const result = mustache.render(template, sanitizedContext);
81018
+ if (unknownVars.length > 0) {
81019
+ const availableVars = Object.keys(sanitizedContext).join(", ");
81020
+ const unknownList = [...new Set(unknownVars)].join(", ");
81021
+ throw new ConfigurationError(
81022
+ `Unknown template variable(s): ${unknownList}. Available variables: ${availableVars}`
81023
+ );
81024
+ }
81025
+ return result;
81026
+ } finally {
81027
+ mustache.Context.prototype.lookup = originalLookup;
81028
+ }
81029
+ }
81030
+ function formatSize(size) {
81031
+ if (size < 1024) {
81032
+ return `${size} B`;
81033
+ }
81034
+ const kilobytes = size / 1024;
81035
+ if (kilobytes < 1024) {
81036
+ return `${kilobytes.toFixed(1)} kB`;
81037
+ } else {
81038
+ const megabytes = kilobytes / 1024;
81039
+ return `${megabytes.toFixed(2)} MB`;
81040
+ }
81041
+ }
81042
+ function formatJson(obj) {
81043
+ const result = JSON.stringify(obj, null, 4);
81044
+ if (obj instanceof Error && result === "{}") {
81045
+ return util4.format(obj);
81046
+ } else {
81047
+ return result;
81048
+ }
81049
+ }
81050
+ function formatArtifactConfigForError(artifactsConfig) {
81051
+ if (!artifactsConfig) {
81052
+ return "";
81053
+ }
81054
+ const yamlSnippet = dump(
81055
+ { artifacts: artifactsConfig },
81056
+ { indent: 2, flowLevel: 3 }
81057
+ ).trimEnd();
81058
+ return `
81059
+
81060
+ Your .craft.yml artifact configuration:
81061
+ ${yamlSnippet}`;
81062
+ }
81063
+ var mustache, util4, originalLookup;
81064
+ var init_strings = __esm({
81065
+ "src/utils/strings.ts"() {
81066
+ init_import_meta_url();
81067
+ init_js_yaml();
81068
+ mustache = __toESM(require_mustache());
81069
+ util4 = __toESM(require("util"));
81070
+ init_errors2();
81071
+ originalLookup = mustache.Context.prototype.lookup;
81072
+ }
81073
+ });
81074
+
80406
81075
  // src/artifact_providers/github.ts
80407
81076
  function normalizeArtifactPatterns(patterns) {
80408
81077
  if (!patterns) {
@@ -80457,6 +81126,7 @@ var init_github = __esm({
80457
81126
  init_system();
80458
81127
  init_async();
80459
81128
  init_filters();
81129
+ init_strings();
80460
81130
  MAX_TRIES = 3;
80461
81131
  MILLISECONDS = 1e3;
80462
81132
  ARTIFACTS_POLLING_INTERVAL = 10 * MILLISECONDS;
@@ -80641,12 +81311,17 @@ var init_github = __esm({
80641
81311
  return patterns;
80642
81312
  }
80643
81313
  /**
80644
- * Gets artifacts from workflow runs and filters them by patterns
81314
+ * Gets artifacts from workflow runs and filters them by patterns.
81315
+ *
81316
+ * Returns both the matching artifacts and all artifact names seen
81317
+ * (regardless of whether they matched). The allNames list is used
81318
+ * in error messages to help users identify naming mismatches.
80645
81319
  */
80646
81320
  async getArtifactsFromWorkflowRuns(runs, filters) {
80647
81321
  const { repoName: repo, repoOwner: owner } = this.config;
80648
81322
  const matchingArtifacts = [];
80649
81323
  const seenArtifactIds = /* @__PURE__ */ new Set();
81324
+ const allArtifactNames = /* @__PURE__ */ new Set();
80650
81325
  for (const run of runs) {
80651
81326
  const workflowName = run.name ?? "";
80652
81327
  const patterns = this.getApplicablePatterns(workflowName, filters);
@@ -80666,6 +81341,7 @@ var init_github = __esm({
80666
81341
  page
80667
81342
  });
80668
81343
  for (const artifact of response.data.artifacts) {
81344
+ allArtifactNames.add(artifact.name);
80669
81345
  if (seenArtifactIds.has(artifact.id)) {
80670
81346
  continue;
80671
81347
  }
@@ -80684,7 +81360,7 @@ var init_github = __esm({
80684
81360
  }
80685
81361
  }
80686
81362
  this.logger.debug(`Found ${matchingArtifacts.length} matching artifacts`);
80687
- return matchingArtifacts;
81363
+ return { matching: matchingArtifacts, allNames: [...allArtifactNames] };
80688
81364
  }
80689
81365
  /**
80690
81366
  * Downloads an artifact to a temp file
@@ -80827,6 +81503,14 @@ var init_github = __esm({
80827
81503
  }
80828
81504
  return errors;
80829
81505
  }
81506
+ /**
81507
+ * Formats the artifact provider config from .craft.yml as a YAML snippet
81508
+ * for inclusion in error messages. Returns an empty string if no artifact
81509
+ * config is defined.
81510
+ */
81511
+ formatArtifactConfigForError() {
81512
+ return formatArtifactConfigForError(this.config.artifacts);
81513
+ }
80830
81514
  /**
80831
81515
  * Fetches artifacts using the new workflow-based approach
80832
81516
  *
@@ -80835,6 +81519,7 @@ var init_github = __esm({
80835
81519
  * @returns Array of remote artifacts
80836
81520
  */
80837
81521
  async doListArtifactsWithFilters(revision, filters) {
81522
+ const configHint = this.formatArtifactConfigForError();
80838
81523
  for (let tries = 0; tries < MAX_TRIES; tries++) {
80839
81524
  this.logger.info(
80840
81525
  `Fetching GitHub artifacts for revision ${revision} using artifact filters (attempt ${tries + 1} of ${MAX_TRIES})`
@@ -80850,17 +81535,18 @@ var init_github = __esm({
80850
81535
  continue;
80851
81536
  }
80852
81537
  throw new Error(
80853
- `No workflow runs found for revision "${revision}" (tries: ${MAX_TRIES})`
81538
+ `No workflow runs found for revision "${revision}" after ${MAX_TRIES} attempts.
81539
+
81540
+ Check that:
81541
+ 1. Your CI workflow has completed successfully for this commit
81542
+ 2. The workflow names in .craft.yml match your actual GitHub Actions workflow names` + configHint
80854
81543
  );
80855
81544
  }
80856
81545
  const filteredRuns = this.filterWorkflowRuns(allRuns, filters);
80857
81546
  this.logger.debug(
80858
81547
  `${filteredRuns.length} of ${allRuns.length} workflow runs match filters`
80859
81548
  );
80860
- const matchingArtifacts = await this.getArtifactsFromWorkflowRuns(
80861
- filteredRuns,
80862
- filters
80863
- );
81549
+ const { matching: matchingArtifacts, allNames: allArtifactNames } = await this.getArtifactsFromWorkflowRuns(filteredRuns, filters);
80864
81550
  if (matchingArtifacts.length === 0) {
80865
81551
  this.logger.debug(`No matching artifacts found`);
80866
81552
  if (tries + 1 < MAX_TRIES) {
@@ -80870,8 +81556,16 @@ var init_github = __esm({
80870
81556
  await sleep(ARTIFACTS_POLLING_INTERVAL);
80871
81557
  continue;
80872
81558
  }
81559
+ const availableNames = allArtifactNames.length > 0 ? allArtifactNames.join(", ") : "(none)";
80873
81560
  throw new Error(
80874
- `No artifacts matching filters found for revision "${revision}" (tries: ${MAX_TRIES})`
81561
+ `No artifacts matching your configured patterns were found for revision "${revision}" after ${MAX_TRIES} attempts.
81562
+
81563
+ Found ${filteredRuns.length} workflow run(s), but none of their artifacts matched.
81564
+ Available artifact names from matching runs: ${availableNames}
81565
+
81566
+ Check that:
81567
+ 1. Your CI workflow is uploading artifacts with the expected names
81568
+ 2. The artifact names in .craft.yml match what your CI actually produces` + configHint
80875
81569
  );
80876
81570
  }
80877
81571
  const validationErrors = this.validateAllPatternsMatched(
@@ -80890,7 +81584,8 @@ var init_github = __esm({
80890
81584
  throw new Error(
80891
81585
  `Not all configured artifact patterns were satisfied:
80892
81586
  - ${validationErrors.join("\n - ")}
80893
- Check that your workflow names and artifact names in .craft.yml match what your CI actually produces.`
81587
+
81588
+ Check that your workflow names and artifact names in .craft.yml match what your CI actually produces.` + configHint
80894
81589
  );
80895
81590
  }
80896
81591
  this.logger.debug(
@@ -96186,7 +96881,7 @@ var require_duplexify = __commonJS({
96186
96881
  });
96187
96882
 
96188
96883
  // node_modules/.pnpm/@google-cloud+storage@7.18.0/node_modules/@google-cloud/storage/build/esm/src/nodejs-common/util.js
96189
- var import_projectify, import_google_auth_library, import_retry_request, import_stream2, import_teeny_request, import_duplexify, import_package_json_helper2, packageJson, GCCL_GCS_CMD_KEY, requestDefaults, AUTO_RETRY_DEFAULT, MAX_RETRY_DEFAULT, ApiError, PartialFailureError, Util, ProgressStream, util4;
96884
+ var import_projectify, import_google_auth_library, import_retry_request, import_stream2, import_teeny_request, import_duplexify, import_package_json_helper2, packageJson, GCCL_GCS_CMD_KEY, requestDefaults, AUTO_RETRY_DEFAULT, MAX_RETRY_DEFAULT, ApiError, PartialFailureError, Util, ProgressStream, util5;
96190
96885
  var init_util4 = __esm({
96191
96886
  "node_modules/.pnpm/@google-cloud+storage@7.18.0/node_modules/@google-cloud/storage/build/esm/src/nodejs-common/util.js"() {
96192
96887
  init_import_meta_url();
@@ -96297,11 +96992,11 @@ var init_util4 = __esm({
96297
96992
  * @param {function} callback - The callback function.
96298
96993
  */
96299
96994
  handleResp(err, resp, body, callback) {
96300
- callback = callback || util4.noop;
96995
+ callback = callback || util5.noop;
96301
96996
  const parsedResp = {
96302
96997
  err: err || null,
96303
- ...resp && util4.parseHttpRespMessage(resp),
96304
- ...body && util4.parseHttpRespBody(body)
96998
+ ...resp && util5.parseHttpRespMessage(resp),
96999
+ ...body && util5.parseHttpRespBody(body)
96305
97000
  };
96306
97001
  if (!parsedResp.err && resp && typeof parsedResp.body === "object") {
96307
97002
  parsedResp.resp.body = parsedResp.body;
@@ -96375,7 +97070,7 @@ var init_util4 = __esm({
96375
97070
  */
96376
97071
  makeWritableStream(dup, options, onComplete) {
96377
97072
  var _a4;
96378
- onComplete = onComplete || util4.noop;
97073
+ onComplete = onComplete || util5.noop;
96379
97074
  const writeStream = new ProgressStream();
96380
97075
  writeStream.on("progress", (evt) => dup.emit("progress", evt));
96381
97076
  dup.setWritable(writeStream);
@@ -96412,10 +97107,10 @@ var init_util4 = __esm({
96412
97107
  dup.destroy(err);
96413
97108
  return;
96414
97109
  }
96415
- requestDefaults.headers = util4._getDefaultHeaders(reqOpts[GCCL_GCS_CMD_KEY]);
97110
+ requestDefaults.headers = util5._getDefaultHeaders(reqOpts[GCCL_GCS_CMD_KEY]);
96416
97111
  const request3 = import_teeny_request.teenyRequest.defaults(requestDefaults);
96417
97112
  request3(authenticatedReqOpts, (err2, resp, body) => {
96418
- util4.handleResp(err2, resp, body, (err3, data2) => {
97113
+ util5.handleResp(err2, resp, body, (err3, data2) => {
96419
97114
  if (err3) {
96420
97115
  dup.destroy(err3);
96421
97116
  return;
@@ -96510,13 +97205,13 @@ var init_util4 = __esm({
96510
97205
  }
96511
97206
  if (!err || autoAuthFailed) {
96512
97207
  try {
96513
- authenticatedReqOpts = util4.decorateRequest(authenticatedReqOpts, projectId);
97208
+ authenticatedReqOpts = util5.decorateRequest(authenticatedReqOpts, projectId);
96514
97209
  err = null;
96515
97210
  } catch (e4) {
96516
97211
  if (e4 instanceof import_projectify.MissingProjectIdError) {
96517
97212
  try {
96518
97213
  await setProjectId();
96519
- authenticatedReqOpts = util4.decorateRequest(authenticatedReqOpts, projectId);
97214
+ authenticatedReqOpts = util5.decorateRequest(authenticatedReqOpts, projectId);
96520
97215
  err = null;
96521
97216
  } catch (e5) {
96522
97217
  err = err || e5;
@@ -96538,7 +97233,7 @@ var init_util4 = __esm({
96538
97233
  if (options && options.onAuthenticated) {
96539
97234
  options.onAuthenticated(null, authenticatedReqOpts);
96540
97235
  } else {
96541
- activeRequest_ = util4.makeRequest(authenticatedReqOpts, reqConfig, (apiResponseError, ...params) => {
97236
+ activeRequest_ = util5.makeRequest(authenticatedReqOpts, reqConfig, (apiResponseError, ...params) => {
96542
97237
  if (apiResponseError && apiResponseError.code === 401 && authLibraryError) {
96543
97238
  apiResponseError = authLibraryError;
96544
97239
  }
@@ -96632,11 +97327,11 @@ var init_util4 = __esm({
96632
97327
  noResponseRetries: autoRetryValue !== false ? maxRetryValue : 0,
96633
97328
  shouldRetryFn(httpRespMessage) {
96634
97329
  var _a5, _b3;
96635
- const err = util4.parseHttpRespMessage(httpRespMessage).err;
97330
+ const err = util5.parseHttpRespMessage(httpRespMessage).err;
96636
97331
  if ((_a5 = config3.retryOptions) === null || _a5 === void 0 ? void 0 : _a5.retryableErrorFn) {
96637
97332
  return err && ((_b3 = config3.retryOptions) === null || _b3 === void 0 ? void 0 : _b3.retryableErrorFn(err));
96638
97333
  }
96639
- return err && util4.shouldRetryRequest(err);
97334
+ return err && util5.shouldRetryRequest(err);
96640
97335
  },
96641
97336
  maxRetryDelay: (_c5 = config3.retryOptions) === null || _c5 === void 0 ? void 0 : _c5.maxRetryDelay,
96642
97337
  retryDelayMultiplier: (_d = config3.retryOptions) === null || _d === void 0 ? void 0 : _d.retryDelayMultiplier,
@@ -96652,7 +97347,7 @@ var init_util4 = __esm({
96652
97347
  options,
96653
97348
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
96654
97349
  (err, response, body) => {
96655
- util4.handleResp(err, response, body, callback);
97350
+ util5.handleResp(err, response, body, callback);
96656
97351
  }
96657
97352
  );
96658
97353
  }
@@ -96755,7 +97450,7 @@ var init_util4 = __esm({
96755
97450
  callback();
96756
97451
  }
96757
97452
  };
96758
- util4 = new Util();
97453
+ util5 = new Util();
96759
97454
  }
96760
97455
  });
96761
97456
 
@@ -96798,7 +97493,7 @@ var init_service = __esm({
96798
97493
  this.universeDomain = options.universeDomain || import_google_auth_library2.DEFAULT_UNIVERSE;
96799
97494
  this.customEndpoint = config3.customEndpoint || false;
96800
97495
  this.useAuthWithCustomEndpoint = config3.useAuthWithCustomEndpoint;
96801
- this.makeAuthenticatedRequest = util4.makeAuthenticatedRequestFactory({
97496
+ this.makeAuthenticatedRequest = util5.makeAuthenticatedRequestFactory({
96802
97497
  ...config3,
96803
97498
  projectIdRequired: this.projectIdRequired,
96804
97499
  projectId: this.projectId,
@@ -97100,7 +97795,7 @@ var init_service_object = __esm({
97100
97795
  }
97101
97796
  delete(optionsOrCallback, cb) {
97102
97797
  var _a4;
97103
- const [options, callback] = util4.maybeOptionsOrCallback(optionsOrCallback, cb);
97798
+ const [options, callback] = util5.maybeOptionsOrCallback(optionsOrCallback, cb);
97104
97799
  const ignoreNotFound = options.ignoreNotFound;
97105
97800
  delete options.ignoreNotFound;
97106
97801
  const methodConfig = typeof this.methods.delete === "object" && this.methods.delete || {};
@@ -97123,7 +97818,7 @@ var init_service_object = __esm({
97123
97818
  });
97124
97819
  }
97125
97820
  exists(optionsOrCallback, cb) {
97126
- const [options, callback] = util4.maybeOptionsOrCallback(optionsOrCallback, cb);
97821
+ const [options, callback] = util5.maybeOptionsOrCallback(optionsOrCallback, cb);
97127
97822
  this.get(options, (err) => {
97128
97823
  if (err) {
97129
97824
  if (err.code === 404) {
@@ -97138,7 +97833,7 @@ var init_service_object = __esm({
97138
97833
  }
97139
97834
  get(optionsOrCallback, cb) {
97140
97835
  const self2 = this;
97141
- const [opts, callback] = util4.maybeOptionsOrCallback(optionsOrCallback, cb);
97836
+ const [opts, callback] = util5.maybeOptionsOrCallback(optionsOrCallback, cb);
97142
97837
  const options = Object.assign({}, opts);
97143
97838
  const autoCreate = options.autoCreate && typeof this.create === "function";
97144
97839
  delete options.autoCreate;
@@ -97172,7 +97867,7 @@ var init_service_object = __esm({
97172
97867
  }
97173
97868
  getMetadata(optionsOrCallback, cb) {
97174
97869
  var _a4;
97175
- const [options, callback] = util4.maybeOptionsOrCallback(optionsOrCallback, cb);
97870
+ const [options, callback] = util5.maybeOptionsOrCallback(optionsOrCallback, cb);
97176
97871
  const methodConfig = typeof this.methods.getMetadata === "object" && this.methods.getMetadata || {};
97177
97872
  const reqOpts = {
97178
97873
  uri: "",
@@ -97196,7 +97891,7 @@ var init_service_object = __esm({
97196
97891
  }
97197
97892
  setMetadata(metadata, optionsOrCallback, cb) {
97198
97893
  var _a4, _b2;
97199
- const [options, callback] = util4.maybeOptionsOrCallback(optionsOrCallback, cb);
97894
+ const [options, callback] = util5.maybeOptionsOrCallback(optionsOrCallback, cb);
97200
97895
  const methodConfig = typeof this.methods.setMetadata === "object" && this.methods.setMetadata || {};
97201
97896
  const reqOpts = {
97202
97897
  method: "PATCH",
@@ -101376,7 +102071,7 @@ var init_file = __esm({
101376
102071
  } else if (optionsOrCallback) {
101377
102072
  options = { ...optionsOrCallback };
101378
102073
  }
101379
- callback = callback || util4.noop;
102074
+ callback = callback || util5.noop;
101380
102075
  let destBucket;
101381
102076
  let destName;
101382
102077
  let newFile;
@@ -101668,7 +102363,7 @@ var init_file = __esm({
101668
102363
  throughStream.destroy(err);
101669
102364
  }).on("response", (res) => {
101670
102365
  throughStream.emit("response", res);
101671
- util4.handleResp(null, res, null, onResponse);
102366
+ util5.handleResp(null, res, null, onResponse);
101672
102367
  }).resume();
101673
102368
  };
101674
102369
  throughStream.on("reading", makeRequest);
@@ -102930,7 +103625,7 @@ var init_file = __esm({
102930
103625
  Object.assign(acc, currentHeaders.headers);
102931
103626
  return acc;
102932
103627
  }, {});
102933
- util4.makeRequest({
103628
+ util5.makeRequest({
102934
103629
  method: "GET",
102935
103630
  uri: `${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,
102936
103631
  headers
@@ -103061,7 +103756,7 @@ var init_file = __esm({
103061
103756
  * Another example:
103062
103757
  */
103063
103758
  makePublic(callback) {
103064
- callback = callback || util4.noop;
103759
+ callback = callback || util5.noop;
103065
103760
  this.acl.add({
103066
103761
  entity: "allUsers",
103067
103762
  role: "READER"
@@ -103196,7 +103891,7 @@ var init_file = __esm({
103196
103891
  } else if (optionsOrCallback) {
103197
103892
  options = { ...optionsOrCallback };
103198
103893
  }
103199
- callback = callback || util4.noop;
103894
+ callback = callback || util5.noop;
103200
103895
  let destName;
103201
103896
  let newFile;
103202
103897
  if (typeof destination === "string") {
@@ -103372,7 +104067,7 @@ var init_file = __esm({
103372
104067
  move(destination, optionsOrCallback, callback) {
103373
104068
  const options = typeof optionsOrCallback === "object" ? optionsOrCallback : {};
103374
104069
  callback = typeof optionsOrCallback === "function" ? optionsOrCallback : callback;
103375
- callback = callback || util4.noop;
104070
+ callback = callback || util5.noop;
103376
104071
  this.copy(destination, options, (err, destinationFile, copyApiResponse) => {
103377
104072
  if (err) {
103378
104073
  err.message = "file#copy failed with an error - " + err.message;
@@ -103480,7 +104175,7 @@ var init_file = __esm({
103480
104175
  rename(destinationFile, optionsOrCallback, callback) {
103481
104176
  const options = typeof optionsOrCallback === "object" ? optionsOrCallback : {};
103482
104177
  callback = typeof optionsOrCallback === "function" ? optionsOrCallback : callback;
103483
- callback = callback || util4.noop;
104178
+ callback = callback || util5.noop;
103484
104179
  this.move(destinationFile, options, callback);
103485
104180
  }
103486
104181
  /**
@@ -103877,7 +104572,7 @@ var init_file = __esm({
103877
104572
  reqOpts.qs.predefinedAcl = "publicRead";
103878
104573
  }
103879
104574
  Object.assign(reqOpts.qs, this.instancePreconditionOpts, options.preconditionOpts);
103880
- util4.makeWritableStream(dup, {
104575
+ util5.makeWritableStream(dup, {
103881
104576
  makeAuthenticatedRequest: (reqOpts2) => {
103882
104577
  this.request(reqOpts2, (err, body, resp) => {
103883
104578
  if (err) {
@@ -105207,7 +105902,7 @@ var init_bucket = __esm({
105207
105902
  };
105208
105903
  sources = sources.map(convertToFile);
105209
105904
  const destinationFile = convertToFile(destination);
105210
- callback = callback || util4.noop;
105905
+ callback = callback || util5.noop;
105211
105906
  if (!destinationFile.metadata.contentType) {
105212
105907
  const destinationContentType = import_mime2.default.getType(destinationFile.name) || void 0;
105213
105908
  if (destinationContentType) {
@@ -105482,7 +106177,7 @@ var init_bucket = __esm({
105482
106177
  options = optionsOrCallback;
105483
106178
  }
105484
106179
  const topicIsObject = topic !== null && typeof topic === "object";
105485
- if (topicIsObject && util4.isCustomType(topic, "pubsub/topic")) {
106180
+ if (topicIsObject && util5.isCustomType(topic, "pubsub/topic")) {
105486
106181
  topic = topic.name;
105487
106182
  }
105488
106183
  if (typeof topic !== "string") {
@@ -106952,7 +107647,7 @@ var init_bucket = __esm({
106952
107647
  setLabels(labels, optionsOrCallback, callback) {
106953
107648
  const options = typeof optionsOrCallback === "object" ? optionsOrCallback : {};
106954
107649
  callback = typeof optionsOrCallback === "function" ? optionsOrCallback : callback;
106955
- callback = callback || util4.noop;
107650
+ callback = callback || util5.noop;
106956
107651
  this.setMetadata({ labels }, options, callback);
106957
107652
  }
106958
107653
  setMetadata(metadata, optionsOrCallback, cb) {
@@ -107627,7 +108322,7 @@ var init_channel = __esm({
107627
108322
  * ```
107628
108323
  */
107629
108324
  stop(callback) {
107630
- callback = callback || util4.noop;
108325
+ callback = callback || util5.noop;
107631
108326
  this.request({
107632
108327
  method: "POST",
107633
108328
  uri: "/stop",
@@ -110464,473 +111159,6 @@ var init_src = __esm({
110464
111159
  }
110465
111160
  });
110466
111161
 
110467
- // node_modules/.pnpm/mustache@3.0.1/node_modules/mustache/mustache.js
110468
- var require_mustache = __commonJS({
110469
- "node_modules/.pnpm/mustache@3.0.1/node_modules/mustache/mustache.js"(exports2) {
110470
- init_import_meta_url();
110471
- (function defineMustache(global2, factory) {
110472
- if (typeof exports2 === "object" && exports2 && typeof exports2.nodeName !== "string") {
110473
- factory(exports2);
110474
- } else if (typeof define === "function" && define.amd) {
110475
- define(["exports"], factory);
110476
- } else {
110477
- global2.Mustache = {};
110478
- factory(global2.Mustache);
110479
- }
110480
- })(exports2, function mustacheFactory(mustache2) {
110481
- var objectToString3 = Object.prototype.toString;
110482
- var isArray = Array.isArray || function isArrayPolyfill(object) {
110483
- return objectToString3.call(object) === "[object Array]";
110484
- };
110485
- function isFunction2(object) {
110486
- return typeof object === "function";
110487
- }
110488
- function typeStr(obj) {
110489
- return isArray(obj) ? "array" : typeof obj;
110490
- }
110491
- function escapeRegExp(string) {
110492
- return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
110493
- }
110494
- function hasProperty(obj, propName2) {
110495
- return obj != null && typeof obj === "object" && propName2 in obj;
110496
- }
110497
- function primitiveHasOwnProperty(primitive, propName2) {
110498
- return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName2);
110499
- }
110500
- var regExpTest = RegExp.prototype.test;
110501
- function testRegExp(re3, string) {
110502
- return regExpTest.call(re3, string);
110503
- }
110504
- var nonSpaceRe = /\S/;
110505
- function isWhitespace2(string) {
110506
- return !testRegExp(nonSpaceRe, string);
110507
- }
110508
- var entityMap = {
110509
- "&": "&amp;",
110510
- "<": "&lt;",
110511
- ">": "&gt;",
110512
- '"': "&quot;",
110513
- "'": "&#39;",
110514
- "/": "&#x2F;",
110515
- "`": "&#x60;",
110516
- "=": "&#x3D;"
110517
- };
110518
- function escapeHtml(string) {
110519
- return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s4) {
110520
- return entityMap[s4];
110521
- });
110522
- }
110523
- var whiteRe = /\s*/;
110524
- var spaceRe = /\s+/;
110525
- var equalsRe = /\s*=/;
110526
- var curlyRe = /\s*\}/;
110527
- var tagRe = /#|\^|\/|>|\{|&|=|!/;
110528
- function parseTemplate(template, tags) {
110529
- if (!template)
110530
- return [];
110531
- var sections = [];
110532
- var tokens = [];
110533
- var spaces = [];
110534
- var hasTag = false;
110535
- var nonSpace = false;
110536
- function stripSpace() {
110537
- if (hasTag && !nonSpace) {
110538
- while (spaces.length)
110539
- delete tokens[spaces.pop()];
110540
- } else {
110541
- spaces = [];
110542
- }
110543
- hasTag = false;
110544
- nonSpace = false;
110545
- }
110546
- var openingTagRe, closingTagRe, closingCurlyRe;
110547
- function compileTags(tagsToCompile) {
110548
- if (typeof tagsToCompile === "string")
110549
- tagsToCompile = tagsToCompile.split(spaceRe, 2);
110550
- if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
110551
- throw new Error("Invalid tags: " + tagsToCompile);
110552
- openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
110553
- closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
110554
- closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
110555
- }
110556
- compileTags(tags || mustache2.tags);
110557
- var scanner = new Scanner(template);
110558
- var start, type2, value, chr, token, openSection;
110559
- while (!scanner.eos()) {
110560
- start = scanner.pos;
110561
- value = scanner.scanUntil(openingTagRe);
110562
- if (value) {
110563
- for (var i4 = 0, valueLength = value.length; i4 < valueLength; ++i4) {
110564
- chr = value.charAt(i4);
110565
- if (isWhitespace2(chr)) {
110566
- spaces.push(tokens.length);
110567
- } else {
110568
- nonSpace = true;
110569
- }
110570
- tokens.push(["text", chr, start, start + 1]);
110571
- start += 1;
110572
- if (chr === "\n")
110573
- stripSpace();
110574
- }
110575
- }
110576
- if (!scanner.scan(openingTagRe))
110577
- break;
110578
- hasTag = true;
110579
- type2 = scanner.scan(tagRe) || "name";
110580
- scanner.scan(whiteRe);
110581
- if (type2 === "=") {
110582
- value = scanner.scanUntil(equalsRe);
110583
- scanner.scan(equalsRe);
110584
- scanner.scanUntil(closingTagRe);
110585
- } else if (type2 === "{") {
110586
- value = scanner.scanUntil(closingCurlyRe);
110587
- scanner.scan(curlyRe);
110588
- scanner.scanUntil(closingTagRe);
110589
- type2 = "&";
110590
- } else {
110591
- value = scanner.scanUntil(closingTagRe);
110592
- }
110593
- if (!scanner.scan(closingTagRe))
110594
- throw new Error("Unclosed tag at " + scanner.pos);
110595
- token = [type2, value, start, scanner.pos];
110596
- tokens.push(token);
110597
- if (type2 === "#" || type2 === "^") {
110598
- sections.push(token);
110599
- } else if (type2 === "/") {
110600
- openSection = sections.pop();
110601
- if (!openSection)
110602
- throw new Error('Unopened section "' + value + '" at ' + start);
110603
- if (openSection[1] !== value)
110604
- throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
110605
- } else if (type2 === "name" || type2 === "{" || type2 === "&") {
110606
- nonSpace = true;
110607
- } else if (type2 === "=") {
110608
- compileTags(value);
110609
- }
110610
- }
110611
- openSection = sections.pop();
110612
- if (openSection)
110613
- throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
110614
- return nestTokens(squashTokens(tokens));
110615
- }
110616
- function squashTokens(tokens) {
110617
- var squashedTokens = [];
110618
- var token, lastToken;
110619
- for (var i4 = 0, numTokens = tokens.length; i4 < numTokens; ++i4) {
110620
- token = tokens[i4];
110621
- if (token) {
110622
- if (token[0] === "text" && lastToken && lastToken[0] === "text") {
110623
- lastToken[1] += token[1];
110624
- lastToken[3] = token[3];
110625
- } else {
110626
- squashedTokens.push(token);
110627
- lastToken = token;
110628
- }
110629
- }
110630
- }
110631
- return squashedTokens;
110632
- }
110633
- function nestTokens(tokens) {
110634
- var nestedTokens = [];
110635
- var collector = nestedTokens;
110636
- var sections = [];
110637
- var token, section;
110638
- for (var i4 = 0, numTokens = tokens.length; i4 < numTokens; ++i4) {
110639
- token = tokens[i4];
110640
- switch (token[0]) {
110641
- case "#":
110642
- case "^":
110643
- collector.push(token);
110644
- sections.push(token);
110645
- collector = token[4] = [];
110646
- break;
110647
- case "/":
110648
- section = sections.pop();
110649
- section[5] = token[2];
110650
- collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
110651
- break;
110652
- default:
110653
- collector.push(token);
110654
- }
110655
- }
110656
- return nestedTokens;
110657
- }
110658
- function Scanner(string) {
110659
- this.string = string;
110660
- this.tail = string;
110661
- this.pos = 0;
110662
- }
110663
- Scanner.prototype.eos = function eos() {
110664
- return this.tail === "";
110665
- };
110666
- Scanner.prototype.scan = function scan2(re3) {
110667
- var match3 = this.tail.match(re3);
110668
- if (!match3 || match3.index !== 0)
110669
- return "";
110670
- var string = match3[0];
110671
- this.tail = this.tail.substring(string.length);
110672
- this.pos += string.length;
110673
- return string;
110674
- };
110675
- Scanner.prototype.scanUntil = function scanUntil(re3) {
110676
- var index = this.tail.search(re3), match3;
110677
- switch (index) {
110678
- case -1:
110679
- match3 = this.tail;
110680
- this.tail = "";
110681
- break;
110682
- case 0:
110683
- match3 = "";
110684
- break;
110685
- default:
110686
- match3 = this.tail.substring(0, index);
110687
- this.tail = this.tail.substring(index);
110688
- }
110689
- this.pos += match3.length;
110690
- return match3;
110691
- };
110692
- function Context2(view, parentContext) {
110693
- this.view = view;
110694
- this.cache = { ".": this.view };
110695
- this.parent = parentContext;
110696
- }
110697
- Context2.prototype.push = function push2(view) {
110698
- return new Context2(view, this);
110699
- };
110700
- Context2.prototype.lookup = function lookup(name2) {
110701
- var cache6 = this.cache;
110702
- var value;
110703
- if (cache6.hasOwnProperty(name2)) {
110704
- value = cache6[name2];
110705
- } else {
110706
- var context2 = this, intermediateValue, names, index, lookupHit = false;
110707
- while (context2) {
110708
- if (name2.indexOf(".") > 0) {
110709
- intermediateValue = context2.view;
110710
- names = name2.split(".");
110711
- index = 0;
110712
- while (intermediateValue != null && index < names.length) {
110713
- if (index === names.length - 1)
110714
- lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
110715
- intermediateValue = intermediateValue[names[index++]];
110716
- }
110717
- } else {
110718
- intermediateValue = context2.view[name2];
110719
- lookupHit = hasProperty(context2.view, name2);
110720
- }
110721
- if (lookupHit) {
110722
- value = intermediateValue;
110723
- break;
110724
- }
110725
- context2 = context2.parent;
110726
- }
110727
- cache6[name2] = value;
110728
- }
110729
- if (isFunction2(value))
110730
- value = value.call(this.view);
110731
- return value;
110732
- };
110733
- function Writer() {
110734
- this.cache = {};
110735
- }
110736
- Writer.prototype.clearCache = function clearCache() {
110737
- this.cache = {};
110738
- };
110739
- Writer.prototype.parse = function parse8(template, tags) {
110740
- var cache6 = this.cache;
110741
- var cacheKey = template + ":" + (tags || mustache2.tags).join(":");
110742
- var tokens = cache6[cacheKey];
110743
- if (tokens == null)
110744
- tokens = cache6[cacheKey] = parseTemplate(template, tags);
110745
- return tokens;
110746
- };
110747
- Writer.prototype.render = function render2(template, view, partials, tags) {
110748
- var tokens = this.parse(template, tags);
110749
- var context2 = view instanceof Context2 ? view : new Context2(view);
110750
- return this.renderTokens(tokens, context2, partials, template, tags);
110751
- };
110752
- Writer.prototype.renderTokens = function renderTokens(tokens, context2, partials, originalTemplate, tags) {
110753
- var buffer = "";
110754
- var token, symbol, value;
110755
- for (var i4 = 0, numTokens = tokens.length; i4 < numTokens; ++i4) {
110756
- value = void 0;
110757
- token = tokens[i4];
110758
- symbol = token[0];
110759
- if (symbol === "#") value = this.renderSection(token, context2, partials, originalTemplate);
110760
- else if (symbol === "^") value = this.renderInverted(token, context2, partials, originalTemplate);
110761
- else if (symbol === ">") value = this.renderPartial(token, context2, partials, tags);
110762
- else if (symbol === "&") value = this.unescapedValue(token, context2);
110763
- else if (symbol === "name") value = this.escapedValue(token, context2);
110764
- else if (symbol === "text") value = this.rawValue(token);
110765
- if (value !== void 0)
110766
- buffer += value;
110767
- }
110768
- return buffer;
110769
- };
110770
- Writer.prototype.renderSection = function renderSection(token, context2, partials, originalTemplate) {
110771
- var self2 = this;
110772
- var buffer = "";
110773
- var value = context2.lookup(token[1]);
110774
- function subRender(template) {
110775
- return self2.render(template, context2, partials);
110776
- }
110777
- if (!value) return;
110778
- if (isArray(value)) {
110779
- for (var j5 = 0, valueLength = value.length; j5 < valueLength; ++j5) {
110780
- buffer += this.renderTokens(token[4], context2.push(value[j5]), partials, originalTemplate);
110781
- }
110782
- } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
110783
- buffer += this.renderTokens(token[4], context2.push(value), partials, originalTemplate);
110784
- } else if (isFunction2(value)) {
110785
- if (typeof originalTemplate !== "string")
110786
- throw new Error("Cannot use higher-order sections without the original template");
110787
- value = value.call(context2.view, originalTemplate.slice(token[3], token[5]), subRender);
110788
- if (value != null)
110789
- buffer += value;
110790
- } else {
110791
- buffer += this.renderTokens(token[4], context2, partials, originalTemplate);
110792
- }
110793
- return buffer;
110794
- };
110795
- Writer.prototype.renderInverted = function renderInverted(token, context2, partials, originalTemplate) {
110796
- var value = context2.lookup(token[1]);
110797
- if (!value || isArray(value) && value.length === 0)
110798
- return this.renderTokens(token[4], context2, partials, originalTemplate);
110799
- };
110800
- Writer.prototype.renderPartial = function renderPartial(token, context2, partials, tags) {
110801
- if (!partials) return;
110802
- var value = isFunction2(partials) ? partials(token[1]) : partials[token[1]];
110803
- if (value != null)
110804
- return this.renderTokens(this.parse(value, tags), context2, partials, value);
110805
- };
110806
- Writer.prototype.unescapedValue = function unescapedValue(token, context2) {
110807
- var value = context2.lookup(token[1]);
110808
- if (value != null)
110809
- return value;
110810
- };
110811
- Writer.prototype.escapedValue = function escapedValue(token, context2) {
110812
- var value = context2.lookup(token[1]);
110813
- if (value != null)
110814
- return mustache2.escape(value);
110815
- };
110816
- Writer.prototype.rawValue = function rawValue(token) {
110817
- return token[1];
110818
- };
110819
- mustache2.name = "mustache.js";
110820
- mustache2.version = "3.0.1";
110821
- mustache2.tags = ["{{", "}}"];
110822
- var defaultWriter = new Writer();
110823
- mustache2.clearCache = function clearCache() {
110824
- return defaultWriter.clearCache();
110825
- };
110826
- mustache2.parse = function parse8(template, tags) {
110827
- return defaultWriter.parse(template, tags);
110828
- };
110829
- mustache2.render = function render2(template, view, partials, tags) {
110830
- if (typeof template !== "string") {
110831
- throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template) + '" was given as the first argument for mustache#render(template, view, partials)');
110832
- }
110833
- return defaultWriter.render(template, view, partials, tags);
110834
- };
110835
- mustache2.to_html = function to_html(template, view, partials, send) {
110836
- var result = mustache2.render(template, view, partials);
110837
- if (isFunction2(send)) {
110838
- send(result);
110839
- } else {
110840
- return result;
110841
- }
110842
- };
110843
- mustache2.escape = escapeHtml;
110844
- mustache2.Scanner = Scanner;
110845
- mustache2.Context = Context2;
110846
- mustache2.Writer = Writer;
110847
- return mustache2;
110848
- });
110849
- }
110850
- });
110851
-
110852
- // src/utils/strings.ts
110853
- function sanitizeObject(obj) {
110854
- if (typeof obj !== "object" || obj === null) {
110855
- throw new Error(`Cannot normalize value: ${obj}`);
110856
- }
110857
- const result = {};
110858
- for (const key of Object.keys(obj)) {
110859
- const value = obj[key];
110860
- const valueType = typeof value;
110861
- let newValue;
110862
- if (["boolean", "string", "number", "undefined"].indexOf(valueType) > -1) {
110863
- newValue = value;
110864
- } else if (value === null) {
110865
- newValue = void 0;
110866
- } else if (valueType === "object") {
110867
- newValue = sanitizeObject(value);
110868
- } else {
110869
- continue;
110870
- }
110871
- result[key] = newValue;
110872
- const normalizedKey = key.replace(/\./g, "__");
110873
- if (key !== normalizedKey) {
110874
- result[normalizedKey] = newValue;
110875
- }
110876
- }
110877
- return result;
110878
- }
110879
- function renderTemplateSafe(template, context2) {
110880
- const sanitizedContext = sanitizeObject(context2);
110881
- const unknownVars = [];
110882
- mustache.Context.prototype.lookup = function(name2) {
110883
- const value = originalLookup.call(this, name2);
110884
- if (value === void 0) {
110885
- unknownVars.push(name2);
110886
- }
110887
- return value;
110888
- };
110889
- try {
110890
- const result = mustache.render(template, sanitizedContext);
110891
- if (unknownVars.length > 0) {
110892
- const availableVars = Object.keys(sanitizedContext).join(", ");
110893
- const unknownList = [...new Set(unknownVars)].join(", ");
110894
- throw new ConfigurationError(
110895
- `Unknown template variable(s): ${unknownList}. Available variables: ${availableVars}`
110896
- );
110897
- }
110898
- return result;
110899
- } finally {
110900
- mustache.Context.prototype.lookup = originalLookup;
110901
- }
110902
- }
110903
- function formatSize(size) {
110904
- if (size < 1024) {
110905
- return `${size} B`;
110906
- }
110907
- const kilobytes = size / 1024;
110908
- if (kilobytes < 1024) {
110909
- return `${kilobytes.toFixed(1)} kB`;
110910
- } else {
110911
- const megabytes = kilobytes / 1024;
110912
- return `${megabytes.toFixed(2)} MB`;
110913
- }
110914
- }
110915
- function formatJson(obj) {
110916
- const result = JSON.stringify(obj, null, 4);
110917
- if (obj instanceof Error && result === "{}") {
110918
- return util5.format(obj);
110919
- } else {
110920
- return result;
110921
- }
110922
- }
110923
- var mustache, util5, originalLookup;
110924
- var init_strings = __esm({
110925
- "src/utils/strings.ts"() {
110926
- init_import_meta_url();
110927
- mustache = __toESM(require_mustache());
110928
- util5 = __toESM(require("util"));
110929
- init_errors2();
110930
- originalLookup = mustache.Context.prototype.lookup;
110931
- }
110932
- });
110933
-
110934
111162
  // src/utils/gcsApi.ts
110935
111163
  function getGCSCredsFromEnv(jsonVar, filepathVar) {
110936
111164
  const gcsCredsJson = process.env[jsonVar.name];
@@ -162436,7 +162664,7 @@ var require_package6 = __commonJS({
162436
162664
  "package.json"(exports2, module2) {
162437
162665
  module2.exports = {
162438
162666
  name: "@sentry/craft",
162439
- version: "2.21.3",
162667
+ version: "2.21.4",
162440
162668
  description: "The universal sentry workflow CLI",
162441
162669
  main: "dist/craft",
162442
162670
  repository: "https://github.com/getsentry/craft",
@@ -162532,6 +162760,7 @@ var require_package6 = __commonJS({
162532
162760
  pnpm: "10.27.0"
162533
162761
  },
162534
162762
  dependencies: {
162763
+ "fastest-levenshtein": "^1.0.16",
162535
162764
  ignore: "^7.0.5",
162536
162765
  marked: "^17.0.1",
162537
162766
  "p-limit": "^6.2.0",
@@ -162605,7 +162834,7 @@ function getPackage() {
162605
162834
  }
162606
162835
  function getPackageVersion() {
162607
162836
  const { version: version2 } = getPackage();
162608
- const buildInfo = "5d154a7facb096e38889be2c6caf2fd23649aa92";
162837
+ const buildInfo = "906009a1b771956757e521555b561379307eb667";
162609
162838
  return buildInfo ? `${version2} (${buildInfo})` : version2;
162610
162839
  }
162611
162840
  function semVerToString(s4) {
@@ -168639,7 +168868,7 @@ init_import_meta_url();
168639
168868
 
168640
168869
  // node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/build/lib/utils/levenshtein.js
168641
168870
  init_import_meta_url();
168642
- function levenshtein(a4, b5) {
168871
+ function levenshtein2(a4, b5) {
168643
168872
  if (a4.length === 0)
168644
168873
  return b5.length;
168645
168874
  if (b5.length === 0)
@@ -168909,7 +169138,7 @@ ${customMsgs.join("\n")}` : "";
168909
169138
  let recommended = null;
168910
169139
  let bestDistance = Infinity;
168911
169140
  for (let i4 = 0, candidate; (candidate = potentialCommands[i4]) !== void 0; i4++) {
168912
- const d5 = levenshtein(cmd, candidate);
169141
+ const d5 = levenshtein2(cmd, candidate);
168913
169142
  if (d5 <= threshold && d5 < bestDistance) {
168914
169143
  bestDistance = d5;
168915
169144
  recommended = candidate;
@@ -170817,7 +171046,20 @@ async function printRevisionSummary(artifactProvider, revision) {
170817
171046
  ${table.toString()}
170818
171047
  `);
170819
171048
  } else {
170820
- logger.warn("No artifacts found for the revision.");
171049
+ const config3 = getConfiguration();
171050
+ const artifactsConfig = config3?.artifactProvider?.config?.artifacts;
171051
+ if (artifactsConfig) {
171052
+ const configSnippet = formatArtifactConfigForError(artifactsConfig);
171053
+ reportError(
171054
+ `No artifacts found for the revision, but your .craft.yml defines artifact patterns.
171055
+
171056
+ Check that:
171057
+ 1. Your CI workflow has completed successfully for this commit
171058
+ 2. The artifact names in your CI match your .craft.yml configuration` + configSnippet
171059
+ );
171060
+ } else {
171061
+ logger.warn("No artifacts found for the revision.");
171062
+ }
170821
171063
  }
170822
171064
  }
170823
171065
  async function getTargetList(targetConfigList, artifactProvider) {
@@ -170958,6 +171200,7 @@ async function publishMain(argv) {
170958
171200
  );
170959
171201
  }
170960
171202
  }
171203
+ const branchPrefix = config3.releaseBranchPrefix || DEFAULT_RELEASE_BRANCH_NAME;
170961
171204
  const rev = argv.rev;
170962
171205
  let checkoutTarget;
170963
171206
  let branchName;
@@ -170965,13 +171208,47 @@ async function publishMain(argv) {
170965
171208
  logger.debug(`Trying to get branch name for provided revision: "${rev}"`);
170966
171209
  branchName = (await git.raw("name-rev", "--name-only", "--no-undefined", rev)).trim();
170967
171210
  checkoutTarget = branchName || rev;
171211
+ logger.debug("Checking out revision", checkoutTarget);
171212
+ await git.checkout(checkoutTarget);
170968
171213
  } else {
170969
- const branchPrefix = config3.releaseBranchPrefix || DEFAULT_RELEASE_BRANCH_NAME;
170970
171214
  branchName = `${branchPrefix}/${newVersion}`;
170971
171215
  checkoutTarget = branchName;
171216
+ try {
171217
+ logger.debug("Checking out release branch", branchName);
171218
+ await git.checkout(checkoutTarget);
171219
+ } catch (err) {
171220
+ const { exactMatches, fuzzyMatches } = await findReleaseBranches(
171221
+ git,
171222
+ branchPrefix
171223
+ );
171224
+ let message = `Could not find the release branch "${branchName}".
171225
+
171226
+ Have you run \`craft prepare\` for version ${newVersion}?
171227
+
171228
+ Release branch prefix: "${branchPrefix}"` + (config3.releaseBranchPrefix ? "" : " (default)");
171229
+ if (exactMatches.length > 0) {
171230
+ message += `
171231
+
171232
+ Existing release branches:
171233
+ ` + exactMatches.map((b5) => ` - ${b5}`).join("\n");
171234
+ }
171235
+ if (fuzzyMatches.length > 0) {
171236
+ message += `
171237
+
171238
+ Did you mean one of these? (similar branch prefix):
171239
+ ` + fuzzyMatches.map((b5) => ` - ${b5}`).join("\n");
171240
+ }
171241
+ if (exactMatches.length === 0 && fuzzyMatches.length === 0) {
171242
+ message += `
171243
+
171244
+ No release branches found on the remote.`;
171245
+ }
171246
+ message += `
171247
+
171248
+ Original error: ${err instanceof Error ? err.message : String(err)}`;
171249
+ throw new ConfigurationError(message);
171250
+ }
170972
171251
  }
170973
- logger.debug("Checking out release branch", branchName);
170974
- await git.checkout(checkoutTarget);
170975
171252
  const revision = await git.revparse("HEAD");
170976
171253
  logger.debug("Revision to publish: ", revision);
170977
171254
  const statusProvider = await getStatusProviderFromConfig();
@@ -171906,6 +172183,12 @@ tmp/lib/tmp.js:
171906
172183
  * MIT Licensed
171907
172184
  *)
171908
172185
 
172186
+ mustache/mustache.js:
172187
+ (*!
172188
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
172189
+ * http://github.com/janl/mustache.js
172190
+ *)
172191
+
171909
172192
  safe-buffer/index.js:
171910
172193
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
171911
172194
 
@@ -172098,12 +172381,6 @@ teeny-request/build/src/index.js:
172098
172381
  * that a callback is omitted.
172099
172382
  *)
172100
172383
 
172101
- mustache/mustache.js:
172102
- (*!
172103
- * mustache.js - Logic-less {{mustache}} templates with JavaScript
172104
- * http://github.com/janl/mustache.js
172105
- *)
172106
-
172107
172384
  yargs-parser/build/lib/string-utils.js:
172108
172385
  yargs-parser/build/lib/tokenize-arg-string.js:
172109
172386
  yargs-parser/build/lib/yargs-parser-types.js: