@malloy-publisher/server 0.8.4 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.docker.md +45 -2
  2. package/dist/app/api-doc.yaml +9 -8
  3. package/dist/app/assets/{EnvironmentPage-CqhWacr8.js → EnvironmentPage-UMS7Py4Q.js} +1 -1
  4. package/dist/app/assets/{HomePage-Bvka32On.js → HomePage-D3MvQaZn.js} +1 -1
  5. package/dist/app/assets/{LightMode-Cbewcf9k.js → LightMode-e1lNBfpL.js} +1 -1
  6. package/dist/app/assets/{MainPage-COYTYOjz.js → MainPage-B0ozqtQO.js} +1 -1
  7. package/dist/app/assets/{ModelPage-Bgd6aix7.js → ModelPage-lQj4Axqu.js} +2 -2
  8. package/dist/app/assets/{PackagePage-dTZ47Ovr.js → PackagePage-BT0YKNKU.js} +1 -1
  9. package/dist/app/assets/{RenderedResult-6UKAHaAj.es-DwPcKrEj.js → RenderedResult-BRgIgxWh.es-DiE7kPNX.js} +3 -3
  10. package/dist/app/assets/{RouteError-eVUmHlyg.js → RouteError-BQnzPJvb.js} +1 -1
  11. package/dist/app/assets/{ThemeEditorPage-BMUZ6xO_.js → ThemeEditorPage-D6t7w9Js.js} +1 -1
  12. package/dist/app/assets/{ToggleButtonGroup-CcURl_SZ.js → ToggleButtonGroup-CJT2JKTC.js} +1 -1
  13. package/dist/app/assets/index-ByieDZlo.js +23 -0
  14. package/dist/app/assets/{index-DW7XZeXK.js → index-CCNqF0-G.js} +1 -1
  15. package/dist/app/assets/{index-Cn5hjjjT.js → index-CKmZ4HG7.js} +388 -388
  16. package/dist/app/assets/{index-BJ0aX8Z9.js → index-CdExa3Pk.js} +1 -1
  17. package/dist/app/assets/index-TiWjmdoW.js +450 -0
  18. package/dist/app/assets/{index-DSoCUF-f.js → index-ireHUsv_.js} +419 -422
  19. package/dist/app/assets/{index--kypg58s.js → index-ufFZR_K-.js} +1 -1
  20. package/dist/app/assets/{index.es-Cmnwwmfe.js → index.es-iUV0gCYk.js} +4 -4
  21. package/dist/app/index.html +1 -1
  22. package/dist/instrumentation.mjs +31332 -45893
  23. package/dist/package_load_worker.mjs +314 -197
  24. package/dist/server.mjs +138351 -137319
  25. package/package.json +17 -17
  26. package/dist/app/assets/index-D7mqb3VK.js +0 -447
  27. package/dist/app/assets/index-w_0OQJgZ.js +0 -23
@@ -131,6 +131,10 @@ var require_brace_expansion = __commonJS((exports, module) => {
131
131
  var escClose = "\x00CLOSE" + Math.random() + "\x00";
132
132
  var escComma = "\x00COMMA" + Math.random() + "\x00";
133
133
  var escPeriod = "\x00PERIOD" + Math.random() + "\x00";
134
+ var EXPANSION_MAX = 1e5;
135
+ var EXPANSION_MAX_LENGTH = 4000000;
136
+ var EXPANSION_MAX_DEPTH = 1000;
137
+ var EXPANSION_MAX_REWRITES = 1000;
134
138
  function numeric(str) {
135
139
  return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
136
140
  }
@@ -140,33 +144,49 @@ var require_brace_expansion = __commonJS((exports, module) => {
140
144
  function unescapeBraces(str) {
141
145
  return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
142
146
  }
147
+ function pushAll(target, items) {
148
+ for (var i = 0;i < items.length; i++) {
149
+ target.push(items[i]);
150
+ }
151
+ }
143
152
  function parseCommaParts(str) {
144
- if (!str)
145
- return [""];
146
153
  var parts = [];
147
- var m = balanced("{", "}", str);
148
- if (!m)
149
- return str.split(",");
150
- var pre = m.pre;
151
- var body = m.body;
152
- var post = m.post;
153
- var p = pre.split(",");
154
- p[p.length - 1] += "{" + body + "}";
155
- var postParts = parseCommaParts(post);
156
- if (post.length) {
157
- p[p.length - 1] += postParts.shift();
158
- p.push.apply(p, postParts);
159
- }
160
- parts.push.apply(parts, p);
161
- return parts;
162
- }
163
- function expandTop(str) {
154
+ var carry = "";
155
+ for (;; ) {
156
+ var m = balanced("{", "}", str);
157
+ if (!m) {
158
+ var tail = str.split(",");
159
+ tail[0] = carry + tail[0];
160
+ pushAll(parts, tail);
161
+ return parts;
162
+ }
163
+ var pre = m.pre;
164
+ var body = m.body;
165
+ var post = m.post;
166
+ var p = pre.split(",");
167
+ p[0] = carry + p[0];
168
+ p[p.length - 1] += "{" + body + "}";
169
+ if (!post.length) {
170
+ pushAll(parts, p);
171
+ return parts;
172
+ }
173
+ carry = p.pop();
174
+ pushAll(parts, p);
175
+ str = post;
176
+ }
177
+ }
178
+ function expandTop(str, options) {
164
179
  if (!str)
165
180
  return [];
181
+ options = options || {};
182
+ var max = options.max == null ? EXPANSION_MAX : options.max;
183
+ var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH : options.maxLength;
184
+ var maxDepth = options.maxDepth == null ? EXPANSION_MAX_DEPTH : options.maxDepth;
185
+ var maxRewrites = options.maxRewrites == null ? EXPANSION_MAX_REWRITES : options.maxRewrites;
166
186
  if (str.substr(0, 2) === "{}") {
167
187
  str = "\\{\\}" + str.substr(2);
168
188
  }
169
- return expand(escapeBraces(str), true).map(unescapeBraces);
189
+ return expand(escapeBraces(str), max, maxLength, maxDepth, 0, maxRewrites, true).map(unescapeBraces);
170
190
  }
171
191
  function embrace(str) {
172
192
  return "{" + str + "}";
@@ -180,87 +200,161 @@ var require_brace_expansion = __commonJS((exports, module) => {
180
200
  function gte(i, y) {
181
201
  return i >= y;
182
202
  }
183
- function expand(str, isTop) {
184
- var expansions = [];
185
- var m = balanced("{", "}", str);
186
- if (!m || /\$$/.test(m.pre))
187
- return [str];
188
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
189
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
190
- var isSequence = isNumericSequence || isAlphaSequence;
191
- var isOptions = m.body.indexOf(",") >= 0;
192
- if (!isSequence && !isOptions) {
193
- if (m.post.match(/,(?!,).*\}/)) {
194
- str = m.pre + "{" + m.body + escClose + m.post;
195
- return expand(str);
203
+ function combine(acc, base, pre, values, max, maxLength, dropEmpties, outBase) {
204
+ var out = [];
205
+ var length = 0;
206
+ for (var a = 0;a < acc.length; a++) {
207
+ for (var v = 0;v < values.length; v++) {
208
+ if (out.length >= max)
209
+ return out;
210
+ var expansion = acc[a] + pre + values[v];
211
+ if (dropEmpties && expansion.length === base[a])
212
+ continue;
213
+ if (length + expansion.length > maxLength)
214
+ return out;
215
+ out.push(expansion);
216
+ outBase.push(base[a]);
217
+ length += expansion.length;
196
218
  }
197
- return [str];
198
219
  }
199
- var n;
200
- if (isSequence) {
201
- n = m.body.split(/\.\./);
202
- } else {
203
- n = parseCommaParts(m.body);
204
- if (n.length === 1) {
205
- n = expand(n[0], false).map(embrace);
206
- if (n.length === 1) {
207
- var post = m.post.length ? expand(m.post, false) : [""];
208
- return post.map(function(p) {
209
- return m.pre + n[0] + p;
210
- });
220
+ return out;
221
+ }
222
+ function expandSequence(body, isAlphaSequence, max, maxLength) {
223
+ var n = body.split(/\.\./);
224
+ var N = [];
225
+ if (n[0] === undefined || n[1] === undefined) {
226
+ return N;
227
+ }
228
+ var x = numeric(n[0]);
229
+ var y = numeric(n[1]);
230
+ var width = Math.max(n[0].length, n[1].length);
231
+ var incr = n.length === 3 && n[2] !== undefined ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
232
+ var test = lte;
233
+ var reverse = y < x;
234
+ if (reverse) {
235
+ incr *= -1;
236
+ test = gte;
237
+ }
238
+ var pad = n.some(isPadded);
239
+ var length = 0;
240
+ for (var i = x;test(i, y) && N.length < max; i += incr) {
241
+ var c;
242
+ if (isAlphaSequence) {
243
+ c = String.fromCharCode(i);
244
+ if (c === "\\") {
245
+ c = "";
211
246
  }
212
- }
213
- }
214
- var pre = m.pre;
215
- var post = m.post.length ? expand(m.post, false) : [""];
216
- var N;
217
- if (isSequence) {
218
- var x = numeric(n[0]);
219
- var y = numeric(n[1]);
220
- var width = Math.max(n[0].length, n[1].length);
221
- var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
222
- var test = lte;
223
- var reverse = y < x;
224
- if (reverse) {
225
- incr *= -1;
226
- test = gte;
227
- }
228
- var pad = n.some(isPadded);
229
- N = [];
230
- for (var i = x;test(i, y); i += incr) {
231
- var c;
232
- if (isAlphaSequence) {
233
- c = String.fromCharCode(i);
234
- if (c === "\\")
235
- c = "";
236
- } else {
237
- c = String(i);
238
- if (pad) {
239
- var need = width - c.length;
240
- if (need > 0) {
241
- var z = new Array(need + 1).join("0");
242
- if (i < 0)
243
- c = "-" + z + c.slice(1);
244
- else
245
- c = z + c;
247
+ } else {
248
+ c = String(i);
249
+ if (pad) {
250
+ var need = width - c.length;
251
+ if (need > 0) {
252
+ var z = new Array(need + 1).join("0");
253
+ if (i < 0) {
254
+ c = "-" + z + c.slice(1);
255
+ } else {
256
+ c = z + c;
246
257
  }
247
258
  }
248
259
  }
249
- N.push(c);
250
260
  }
251
- } else {
252
- N = concatMap(n, function(el) {
253
- return expand(el, false);
254
- });
261
+ if (length + c.length > maxLength)
262
+ break;
263
+ N.push(c);
264
+ length += c.length;
255
265
  }
256
- for (var j = 0;j < N.length; j++) {
257
- for (var k = 0;k < post.length; k++) {
258
- var expansion = pre + N[j] + post[k];
259
- if (!isTop || isSequence || expansion)
260
- expansions.push(expansion);
266
+ return N;
267
+ }
268
+ function expand(str, max, maxLength, maxDepth, depth, maxRewrites, isTop) {
269
+ if (depth > maxDepth) {
270
+ return [str];
271
+ }
272
+ var acc = [""];
273
+ var accBase = [0];
274
+ var rewrites = 0;
275
+ var dropEmpties = false;
276
+ var firstGroup = true;
277
+ var nextBase;
278
+ for (;; ) {
279
+ var m = balanced("{", "}", str);
280
+ if (!m) {
281
+ return combine(acc, accBase, str, [""], max, maxLength, dropEmpties, []);
282
+ }
283
+ var pre = m.pre;
284
+ if (/\$$/.test(pre)) {
285
+ return combine(acc, accBase, str, [""], max, maxLength, dropEmpties, []);
286
+ }
287
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
288
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
289
+ var isSequence = isNumericSequence || isAlphaSequence;
290
+ var isOptions = m.body.indexOf(",") >= 0;
291
+ if (!isSequence && !isOptions) {
292
+ if (rewrites < maxRewrites && m.post.match(/,(?!,).*\}/)) {
293
+ rewrites++;
294
+ str = m.pre + "{" + m.body + escClose + m.post;
295
+ isTop = true;
296
+ firstGroup = true;
297
+ dropEmpties = false;
298
+ accBase = [];
299
+ for (var b = 0;b < acc.length; b++) {
300
+ accBase.push(acc[b].length);
301
+ }
302
+ continue;
303
+ }
304
+ return combine(acc, accBase, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties, []);
261
305
  }
306
+ if (firstGroup) {
307
+ dropEmpties = isTop && !isSequence;
308
+ firstGroup = false;
309
+ }
310
+ var values;
311
+ if (isSequence) {
312
+ values = expandSequence(m.body, isAlphaSequence, max, maxLength);
313
+ } else {
314
+ var n = parseCommaParts(m.body);
315
+ if (n.length === 1 && n[0] !== undefined) {
316
+ n = expand(n[0], max, maxLength, maxDepth, depth + 1, maxRewrites, false).map(embrace);
317
+ if (n.length === 1) {
318
+ nextBase = [];
319
+ acc = combine(acc, accBase, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length, nextBase);
320
+ accBase = nextBase;
321
+ if (!m.post.length)
322
+ break;
323
+ str = m.post;
324
+ continue;
325
+ }
326
+ }
327
+ var dropsEmpties = dropEmpties && !m.post.length && !pre;
328
+ for (var d = 0;dropsEmpties && d < acc.length; d++) {
329
+ if (acc[d].length !== accBase[d]) {
330
+ dropsEmpties = false;
331
+ }
332
+ }
333
+ values = [];
334
+ var valuesLength = 0;
335
+ outer:
336
+ for (var j = 0;j < n.length; j++) {
337
+ var expanded = expand(n[j], max, maxLength, maxDepth, depth + 1, maxRewrites, false);
338
+ for (var k = 0;k < expanded.length; k++) {
339
+ var v = expanded[k];
340
+ if (dropsEmpties && !v)
341
+ continue;
342
+ if (values.length >= max || valuesLength + v.length > maxLength) {
343
+ break outer;
344
+ }
345
+ values.push(v);
346
+ valuesLength += v.length;
347
+ }
348
+ }
349
+ }
350
+ nextBase = [];
351
+ acc = combine(acc, accBase, pre, values, max, maxLength, dropEmpties && !m.post.length, nextBase);
352
+ accBase = nextBase;
353
+ if (!m.post.length)
354
+ break;
355
+ str = m.post;
262
356
  }
263
- return expansions;
357
+ return acc;
264
358
  }
265
359
  });
266
360
 
@@ -370,6 +464,7 @@ var require_minimatch = __commonJS((exports, module) => {
370
464
  pattern = pattern.split(path.sep).join("/");
371
465
  }
372
466
  this.options = options;
467
+ this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined ? options.maxGlobstarRecursion : 200;
373
468
  this.set = [];
374
469
  this.pattern = pattern;
375
470
  this.regexp = null;
@@ -528,6 +623,8 @@ var require_minimatch = __commonJS((exports, module) => {
528
623
  re += c;
529
624
  continue;
530
625
  }
626
+ if (c === "*" && stateChar === "*")
627
+ continue;
531
628
  self2.debug("call clearStateChar %j", stateChar);
532
629
  clearStateChar();
533
630
  stateChar = c;
@@ -776,52 +873,127 @@ var require_minimatch = __commonJS((exports, module) => {
776
873
  return this.negate;
777
874
  };
778
875
  Minimatch.prototype.matchOne = function(file, pattern, partial) {
779
- var options = this.options;
780
- this.debug("matchOne", { this: this, file, pattern });
781
- this.debug("matchOne", file.length, pattern.length);
782
- for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
783
- this.debug("matchOne loop");
784
- var p = pattern[pi];
785
- var f = file[fi];
786
- this.debug(pattern, p, f);
787
- if (p === false)
876
+ if (pattern.indexOf(GLOBSTAR) !== -1) {
877
+ return this._matchGlobstar(file, pattern, partial, 0, 0);
878
+ }
879
+ return this._matchOne(file, pattern, partial, 0, 0);
880
+ };
881
+ Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
882
+ var i;
883
+ var firstgs = -1;
884
+ for (i = patternIndex;i < pattern.length; i++) {
885
+ if (pattern[i] === GLOBSTAR) {
886
+ firstgs = i;
887
+ break;
888
+ }
889
+ }
890
+ var lastgs = -1;
891
+ for (i = pattern.length - 1;i >= 0; i--) {
892
+ if (pattern[i] === GLOBSTAR) {
893
+ lastgs = i;
894
+ break;
895
+ }
896
+ }
897
+ var head = pattern.slice(patternIndex, firstgs);
898
+ var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
899
+ var tail = partial ? [] : pattern.slice(lastgs + 1);
900
+ if (head.length) {
901
+ var fileHead = file.slice(fileIndex, fileIndex + head.length);
902
+ if (!this._matchOne(fileHead, head, partial, 0, 0)) {
788
903
  return false;
789
- if (p === GLOBSTAR) {
790
- this.debug("GLOBSTAR", [pattern, p, f]);
791
- var fr = fi;
792
- var pr = pi + 1;
793
- if (pr === pl) {
794
- this.debug("** at the end");
795
- for (;fi < fl; fi++) {
796
- if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
797
- return false;
798
- }
799
- return true;
904
+ }
905
+ fileIndex += head.length;
906
+ }
907
+ var fileTailMatch = 0;
908
+ if (tail.length) {
909
+ if (tail.length + fileIndex > file.length)
910
+ return false;
911
+ var tailStart = file.length - tail.length;
912
+ if (this._matchOne(file, tail, partial, tailStart, 0)) {
913
+ fileTailMatch = tail.length;
914
+ } else {
915
+ if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
916
+ return false;
800
917
  }
801
- while (fr < fl) {
802
- var swallowee = file[fr];
803
- this.debug(`
804
- globstar while`, file, fr, pattern, pr, swallowee);
805
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
806
- this.debug("globstar found match!", fr, fl, swallowee);
807
- return true;
808
- } else {
809
- if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
810
- this.debug("dot detected!", file, fr, pattern, pr);
811
- break;
812
- }
813
- this.debug("globstar swallow a segment, and continue");
814
- fr++;
815
- }
918
+ tailStart--;
919
+ if (!this._matchOne(file, tail, partial, tailStart, 0)) {
920
+ return false;
921
+ }
922
+ fileTailMatch = tail.length + 1;
923
+ }
924
+ }
925
+ if (!body.length) {
926
+ var sawSome = !!fileTailMatch;
927
+ for (i = fileIndex;i < file.length - fileTailMatch; i++) {
928
+ var f = String(file[i]);
929
+ sawSome = true;
930
+ if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
931
+ return false;
932
+ }
933
+ }
934
+ return partial || sawSome;
935
+ }
936
+ var bodySegments = [[[], 0]];
937
+ var currentBody = bodySegments[0];
938
+ var nonGsParts = 0;
939
+ var nonGsPartsSums = [0];
940
+ for (var bi = 0;bi < body.length; bi++) {
941
+ var b = body[bi];
942
+ if (b === GLOBSTAR) {
943
+ nonGsPartsSums.push(nonGsParts);
944
+ currentBody = [[], 0];
945
+ bodySegments.push(currentBody);
946
+ } else {
947
+ currentBody[0].push(b);
948
+ nonGsParts++;
949
+ }
950
+ }
951
+ var idx = bodySegments.length - 1;
952
+ var fileLength = file.length - fileTailMatch;
953
+ for (var si = 0;si < bodySegments.length; si++) {
954
+ bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
955
+ }
956
+ return !!this._matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
957
+ };
958
+ Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
959
+ var bs = bodySegments[bodyIndex];
960
+ if (!bs) {
961
+ for (var i = fileIndex;i < file.length; i++) {
962
+ sawTail = true;
963
+ var f = file[i];
964
+ if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
965
+ return false;
816
966
  }
817
- if (partial) {
818
- this.debug(`
819
- >>> no match, partial?`, file, fr, pattern, pr);
820
- if (fr === fl)
821
- return true;
967
+ }
968
+ return sawTail;
969
+ }
970
+ var body = bs[0];
971
+ var after = bs[1];
972
+ while (fileIndex <= after) {
973
+ var m = this._matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
974
+ if (m && globStarDepth < this.maxGlobstarRecursion) {
975
+ var sub = this._matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
976
+ if (sub !== false) {
977
+ return sub;
822
978
  }
979
+ }
980
+ var f = file[fileIndex];
981
+ if (f === "." || f === ".." || !this.options.dot && f.charAt(0) === ".") {
823
982
  return false;
824
983
  }
984
+ fileIndex++;
985
+ }
986
+ return partial || null;
987
+ };
988
+ Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
989
+ var fi, pi, fl, pl;
990
+ for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
991
+ this.debug("matchOne loop");
992
+ var p = pattern[pi];
993
+ var f = file[fi];
994
+ this.debug(pattern, p, f);
995
+ if (p === false || p === GLOBSTAR)
996
+ return false;
825
997
  var hit;
826
998
  if (typeof p === "string") {
827
999
  hit = f === p;
@@ -15212,72 +15384,21 @@ function onMotlyRoute(text) {
15212
15384
  function hasEnvReference(annotation) {
15213
15385
  return annotation.includes("@env.");
15214
15386
  }
15215
- function pollutionTargets() {
15216
- const targets = [Object.prototype];
15217
- for (const key of Object.getOwnPropertyNames(Object.prototype)) {
15218
- const descriptor = Object.getOwnPropertyDescriptor(Object.prototype, key);
15219
- if (!descriptor)
15220
- continue;
15221
- let value;
15222
- if ("value" in descriptor) {
15223
- value = descriptor.value;
15224
- } else {
15225
- if (BUILT_IN_PROTO_GETTER === undefined || descriptor.get !== BUILT_IN_PROTO_GETTER) {
15226
- return;
15227
- }
15228
- continue;
15229
- }
15230
- if ((typeof value === "object" || typeof value === "function") && value !== null && !targets.includes(value)) {
15231
- targets.push(value);
15232
- }
15233
- }
15234
- return targets;
15235
- }
15236
- function parseGuarded(texts) {
15237
- const targets = pollutionTargets();
15238
- if (targets === undefined) {
15239
- return { tag: undefined, messages: [UNSAFE_TO_PARSE] };
15240
- }
15241
- let unreadable = false;
15242
- const ownNames = (target) => {
15243
- try {
15244
- return Object.getOwnPropertyNames(target);
15245
- } catch {
15246
- unreadable = true;
15247
- return [];
15248
- }
15249
- };
15250
- const before = targets.map(ownNames);
15251
- if (unreadable)
15252
- return { tag: undefined, messages: [UNSAFE_TO_PARSE] };
15253
- const undoPollution = () => {
15254
- let polluted = false;
15255
- targets.forEach((target, index) => {
15256
- for (const key of ownNames(target)) {
15257
- if (before[index].includes(key))
15258
- continue;
15259
- polluted = true;
15260
- try {
15261
- delete target[key];
15262
- } catch {}
15263
- }
15264
- });
15265
- return polluted || unreadable;
15266
- };
15387
+ function parseBounded(texts) {
15267
15388
  if (texts.some((text) => text.length > MAX_ANNOTATION_CHARS)) {
15268
15389
  return { tag: undefined, messages: [ANNOTATION_TOO_LONG] };
15269
15390
  }
15270
15391
  try {
15271
15392
  const result = parseAnnotation([...texts]);
15272
- if (undoPollution())
15273
- return { tag: undefined, messages: [UNSAFE_TO_PARSE] };
15274
15393
  return {
15275
15394
  tag: result.tag,
15276
15395
  messages: result.log.map((error) => error.message)
15277
15396
  };
15278
- } catch {
15279
- undoPollution();
15280
- return { tag: undefined, messages: [UNSAFE_TO_PARSE] };
15397
+ } catch (error) {
15398
+ return {
15399
+ tag: undefined,
15400
+ messages: [error instanceof Error ? error.message : String(error)]
15401
+ };
15281
15402
  }
15282
15403
  }
15283
15404
  function docCommentText(texts) {
@@ -15409,16 +15530,16 @@ function parseMotly(texts) {
15409
15530
  const envErrors = envDropped > 0 ? [ENV_REFERENCE_DROPPED] : [];
15410
15531
  if (motly.length === 0)
15411
15532
  return { tag: undefined, errors: envErrors };
15412
- const direct = parseGuarded(motly);
15533
+ const direct = parseBounded(motly);
15413
15534
  if (direct.messages.length === 0)
15414
15535
  return { tag: direct.tag, errors: envErrors };
15415
15536
  const rescued = motly.map((text) => {
15416
- if (parseGuarded([text]).messages.length === 0)
15537
+ if (parseBounded([text]).messages.length === 0)
15417
15538
  return text;
15418
15539
  const rewritten = quoteFilterLiterals(text);
15419
- return parseGuarded([rewritten]).messages.length === 0 ? rewritten : text;
15540
+ return parseBounded([rewritten]).messages.length === 0 ? rewritten : text;
15420
15541
  });
15421
- const after = parseGuarded(rescued);
15542
+ const after = parseBounded(rescued);
15422
15543
  return { tag: after.tag, errors: [...envErrors, ...after.messages] };
15423
15544
  }
15424
15545
  function tagText(tag, ...path) {
@@ -15484,9 +15605,8 @@ function readStartingGivens(tag, declaredType) {
15484
15605
  }
15485
15606
  return Object.keys(collected).length > 0 ? collected : undefined;
15486
15607
  }
15487
- var BUILT_IN_PROTO_GETTER, MAX_ANNOTATION_CHARS = 8192, ANNOTATION_TOO_LONG, ENV_REFERENCE_DROPPED = "annotation dropped for carrying an @env. reference", UNSAFE_TO_PARSE = "annotation could not be parsed safely";
15608
+ var MAX_ANNOTATION_CHARS = 8192, ANNOTATION_TOO_LONG, ENV_REFERENCE_DROPPED = "annotation dropped for carrying an @env. reference";
15488
15609
  var init_motly = __esm(() => {
15489
- BUILT_IN_PROTO_GETTER = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__")?.get;
15490
15610
  ANNOTATION_TOO_LONG = `annotation exceeds ${MAX_ANNOTATION_CHARS} characters and was not parsed`;
15491
15611
  });
15492
15612
 
@@ -23219,9 +23339,6 @@ function lintDashboard(facts, manifest) {
23219
23339
  return findings;
23220
23340
  }
23221
23341
  function describeParseFailure(message) {
23222
- if (message === UNSAFE_TO_PARSE) {
23223
- return `was refused rather than parsed (${message}), which can be caused by something outside this file`;
23224
- }
23225
23342
  if (message === ENV_REFERENCE_DROPPED) {
23226
23343
  return `was dropped rather than parsed (${message}), so nothing on that line took effect`;
23227
23344
  }