agent-contracts 0.30.1 → 0.30.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/cli-contract.yaml +80 -1
- package/dist/cli.js +455 -954
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +324 -951
- package/dist/index.js.map +1 -1
- package/dsl_base/agents/dsl-designer.yaml +4 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -3951,7 +3951,7 @@ var require_lodash = __commonJS({
|
|
|
3951
3951
|
}
|
|
3952
3952
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
3953
3953
|
});
|
|
3954
|
-
function
|
|
3954
|
+
function join4(array, separator) {
|
|
3955
3955
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
3956
3956
|
}
|
|
3957
3957
|
function last(array) {
|
|
@@ -5875,7 +5875,7 @@ var require_lodash = __commonJS({
|
|
|
5875
5875
|
lodash.isUndefined = isUndefined;
|
|
5876
5876
|
lodash.isWeakMap = isWeakMap;
|
|
5877
5877
|
lodash.isWeakSet = isWeakSet;
|
|
5878
|
-
lodash.join =
|
|
5878
|
+
lodash.join = join4;
|
|
5879
5879
|
lodash.kebabCase = kebabCase;
|
|
5880
5880
|
lodash.last = last;
|
|
5881
5881
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -7496,7 +7496,7 @@ var require_stable = __commonJS({
|
|
|
7496
7496
|
return result;
|
|
7497
7497
|
}
|
|
7498
7498
|
function stringifyFullFn(key, parent, stack, replacer, indent) {
|
|
7499
|
-
var i3, res,
|
|
7499
|
+
var i3, res, join4;
|
|
7500
7500
|
const originalIndentation = indentation;
|
|
7501
7501
|
var value = parent[key];
|
|
7502
7502
|
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
@@ -7522,12 +7522,12 @@ var require_stable = __commonJS({
|
|
|
7522
7522
|
indentation += indent;
|
|
7523
7523
|
res += `
|
|
7524
7524
|
${indentation}`;
|
|
7525
|
-
|
|
7525
|
+
join4 = `,
|
|
7526
7526
|
${indentation}`;
|
|
7527
7527
|
for (i3 = 0; i3 < value.length - 1; i3++) {
|
|
7528
7528
|
const tmp2 = stringifyFullFn(i3, value, stack, replacer, indent);
|
|
7529
7529
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7530
|
-
res +=
|
|
7530
|
+
res += join4;
|
|
7531
7531
|
}
|
|
7532
7532
|
const tmp = stringifyFullFn(i3, value, stack, replacer, indent);
|
|
7533
7533
|
res += tmp !== void 0 ? tmp : "null";
|
|
@@ -7549,7 +7549,7 @@ ${originalIndentation}`;
|
|
|
7549
7549
|
indentation += indent;
|
|
7550
7550
|
res += `
|
|
7551
7551
|
${indentation}`;
|
|
7552
|
-
|
|
7552
|
+
join4 = `,
|
|
7553
7553
|
${indentation}`;
|
|
7554
7554
|
var separator = "";
|
|
7555
7555
|
for (i3 = 0; i3 < keys.length; i3++) {
|
|
@@ -7557,7 +7557,7 @@ ${indentation}`;
|
|
|
7557
7557
|
const tmp = stringifyFullFn(key, value, stack, replacer, indent);
|
|
7558
7558
|
if (tmp !== void 0) {
|
|
7559
7559
|
res += `${separator}"${strEscape(key)}": ${tmp}`;
|
|
7560
|
-
separator =
|
|
7560
|
+
separator = join4;
|
|
7561
7561
|
}
|
|
7562
7562
|
}
|
|
7563
7563
|
if (separator !== "") {
|
|
@@ -7579,7 +7579,7 @@ ${originalIndentation}`;
|
|
|
7579
7579
|
}
|
|
7580
7580
|
}
|
|
7581
7581
|
function stringifyFullArr(key, value, stack, replacer, indent) {
|
|
7582
|
-
var i3, res,
|
|
7582
|
+
var i3, res, join4;
|
|
7583
7583
|
const originalIndentation = indentation;
|
|
7584
7584
|
if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
|
|
7585
7585
|
value = value.toJSON(key);
|
|
@@ -7603,12 +7603,12 @@ ${originalIndentation}`;
|
|
|
7603
7603
|
indentation += indent;
|
|
7604
7604
|
res += `
|
|
7605
7605
|
${indentation}`;
|
|
7606
|
-
|
|
7606
|
+
join4 = `,
|
|
7607
7607
|
${indentation}`;
|
|
7608
7608
|
for (i3 = 0; i3 < value.length - 1; i3++) {
|
|
7609
7609
|
const tmp2 = stringifyFullArr(i3, value[i3], stack, replacer, indent);
|
|
7610
7610
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7611
|
-
res +=
|
|
7611
|
+
res += join4;
|
|
7612
7612
|
}
|
|
7613
7613
|
const tmp = stringifyFullArr(i3, value[i3], stack, replacer, indent);
|
|
7614
7614
|
res += tmp !== void 0 ? tmp : "null";
|
|
@@ -7629,7 +7629,7 @@ ${originalIndentation}`;
|
|
|
7629
7629
|
indentation += indent;
|
|
7630
7630
|
res += `
|
|
7631
7631
|
${indentation}`;
|
|
7632
|
-
|
|
7632
|
+
join4 = `,
|
|
7633
7633
|
${indentation}`;
|
|
7634
7634
|
var separator = "";
|
|
7635
7635
|
for (i3 = 0; i3 < replacer.length; i3++) {
|
|
@@ -7638,7 +7638,7 @@ ${indentation}`;
|
|
|
7638
7638
|
const tmp = stringifyFullArr(key, value[key], stack, replacer, indent);
|
|
7639
7639
|
if (tmp !== void 0) {
|
|
7640
7640
|
res += `${separator}"${strEscape(key)}": ${tmp}`;
|
|
7641
|
-
separator =
|
|
7641
|
+
separator = join4;
|
|
7642
7642
|
}
|
|
7643
7643
|
}
|
|
7644
7644
|
}
|
|
@@ -7661,7 +7661,7 @@ ${originalIndentation}`;
|
|
|
7661
7661
|
}
|
|
7662
7662
|
}
|
|
7663
7663
|
function stringifyIndent(key, value, stack, indent) {
|
|
7664
|
-
var i3, res,
|
|
7664
|
+
var i3, res, join4;
|
|
7665
7665
|
const originalIndentation = indentation;
|
|
7666
7666
|
switch (typeof value) {
|
|
7667
7667
|
case "object":
|
|
@@ -7691,12 +7691,12 @@ ${originalIndentation}`;
|
|
|
7691
7691
|
indentation += indent;
|
|
7692
7692
|
res += `
|
|
7693
7693
|
${indentation}`;
|
|
7694
|
-
|
|
7694
|
+
join4 = `,
|
|
7695
7695
|
${indentation}`;
|
|
7696
7696
|
for (i3 = 0; i3 < value.length - 1; i3++) {
|
|
7697
7697
|
const tmp2 = stringifyIndent(i3, value[i3], stack, indent);
|
|
7698
7698
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7699
|
-
res +=
|
|
7699
|
+
res += join4;
|
|
7700
7700
|
}
|
|
7701
7701
|
const tmp = stringifyIndent(i3, value[i3], stack, indent);
|
|
7702
7702
|
res += tmp !== void 0 ? tmp : "null";
|
|
@@ -7718,7 +7718,7 @@ ${originalIndentation}`;
|
|
|
7718
7718
|
indentation += indent;
|
|
7719
7719
|
res += `
|
|
7720
7720
|
${indentation}`;
|
|
7721
|
-
|
|
7721
|
+
join4 = `,
|
|
7722
7722
|
${indentation}`;
|
|
7723
7723
|
var separator = "";
|
|
7724
7724
|
for (i3 = 0; i3 < keys.length; i3++) {
|
|
@@ -7726,7 +7726,7 @@ ${indentation}`;
|
|
|
7726
7726
|
const tmp = stringifyIndent(key, value[key], stack, indent);
|
|
7727
7727
|
if (tmp !== void 0) {
|
|
7728
7728
|
res += `${separator}"${strEscape(key)}": ${tmp}`;
|
|
7729
|
-
separator =
|
|
7729
|
+
separator = join4;
|
|
7730
7730
|
}
|
|
7731
7731
|
}
|
|
7732
7732
|
if (separator !== "") {
|
|
@@ -39127,916 +39127,19 @@ var require_runner3 = __commonJS({
|
|
|
39127
39127
|
}
|
|
39128
39128
|
});
|
|
39129
39129
|
|
|
39130
|
-
// node_modules/concat-map/index.js
|
|
39131
|
-
var require_concat_map = __commonJS({
|
|
39132
|
-
"node_modules/concat-map/index.js"(exports, module) {
|
|
39133
|
-
"use strict";
|
|
39134
|
-
module.exports = function(xs, fn) {
|
|
39135
|
-
var res = [];
|
|
39136
|
-
for (var i3 = 0; i3 < xs.length; i3++) {
|
|
39137
|
-
var x3 = fn(xs[i3], i3);
|
|
39138
|
-
if (isArray(x3)) res.push.apply(res, x3);
|
|
39139
|
-
else res.push(x3);
|
|
39140
|
-
}
|
|
39141
|
-
return res;
|
|
39142
|
-
};
|
|
39143
|
-
var isArray = Array.isArray || function(xs) {
|
|
39144
|
-
return Object.prototype.toString.call(xs) === "[object Array]";
|
|
39145
|
-
};
|
|
39146
|
-
}
|
|
39147
|
-
});
|
|
39148
|
-
|
|
39149
|
-
// node_modules/balanced-match/index.js
|
|
39150
|
-
var require_balanced_match = __commonJS({
|
|
39151
|
-
"node_modules/balanced-match/index.js"(exports, module) {
|
|
39152
|
-
"use strict";
|
|
39153
|
-
module.exports = balanced;
|
|
39154
|
-
function balanced(a3, b3, str) {
|
|
39155
|
-
if (a3 instanceof RegExp) a3 = maybeMatch(a3, str);
|
|
39156
|
-
if (b3 instanceof RegExp) b3 = maybeMatch(b3, str);
|
|
39157
|
-
var r3 = range(a3, b3, str);
|
|
39158
|
-
return r3 && {
|
|
39159
|
-
start: r3[0],
|
|
39160
|
-
end: r3[1],
|
|
39161
|
-
pre: str.slice(0, r3[0]),
|
|
39162
|
-
body: str.slice(r3[0] + a3.length, r3[1]),
|
|
39163
|
-
post: str.slice(r3[1] + b3.length)
|
|
39164
|
-
};
|
|
39165
|
-
}
|
|
39166
|
-
function maybeMatch(reg, str) {
|
|
39167
|
-
var m2 = str.match(reg);
|
|
39168
|
-
return m2 ? m2[0] : null;
|
|
39169
|
-
}
|
|
39170
|
-
balanced.range = range;
|
|
39171
|
-
function range(a3, b3, str) {
|
|
39172
|
-
var begs, beg, left, right, result;
|
|
39173
|
-
var ai = str.indexOf(a3);
|
|
39174
|
-
var bi = str.indexOf(b3, ai + 1);
|
|
39175
|
-
var i3 = ai;
|
|
39176
|
-
if (ai >= 0 && bi > 0) {
|
|
39177
|
-
if (a3 === b3) {
|
|
39178
|
-
return [ai, bi];
|
|
39179
|
-
}
|
|
39180
|
-
begs = [];
|
|
39181
|
-
left = str.length;
|
|
39182
|
-
while (i3 >= 0 && !result) {
|
|
39183
|
-
if (i3 == ai) {
|
|
39184
|
-
begs.push(i3);
|
|
39185
|
-
ai = str.indexOf(a3, i3 + 1);
|
|
39186
|
-
} else if (begs.length == 1) {
|
|
39187
|
-
result = [begs.pop(), bi];
|
|
39188
|
-
} else {
|
|
39189
|
-
beg = begs.pop();
|
|
39190
|
-
if (beg < left) {
|
|
39191
|
-
left = beg;
|
|
39192
|
-
right = bi;
|
|
39193
|
-
}
|
|
39194
|
-
bi = str.indexOf(b3, i3 + 1);
|
|
39195
|
-
}
|
|
39196
|
-
i3 = ai < bi && ai >= 0 ? ai : bi;
|
|
39197
|
-
}
|
|
39198
|
-
if (begs.length) {
|
|
39199
|
-
result = [left, right];
|
|
39200
|
-
}
|
|
39201
|
-
}
|
|
39202
|
-
return result;
|
|
39203
|
-
}
|
|
39204
|
-
}
|
|
39205
|
-
});
|
|
39206
|
-
|
|
39207
|
-
// node_modules/brace-expansion/index.js
|
|
39208
|
-
var require_brace_expansion = __commonJS({
|
|
39209
|
-
"node_modules/brace-expansion/index.js"(exports, module) {
|
|
39210
|
-
"use strict";
|
|
39211
|
-
var concatMap = require_concat_map();
|
|
39212
|
-
var balanced = require_balanced_match();
|
|
39213
|
-
module.exports = expandTop;
|
|
39214
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
39215
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
39216
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
39217
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
39218
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
39219
|
-
function numeric(str) {
|
|
39220
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
39221
|
-
}
|
|
39222
|
-
function escapeBraces(str) {
|
|
39223
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
39224
|
-
}
|
|
39225
|
-
function unescapeBraces(str) {
|
|
39226
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
39227
|
-
}
|
|
39228
|
-
function parseCommaParts(str) {
|
|
39229
|
-
if (!str)
|
|
39230
|
-
return [""];
|
|
39231
|
-
var parts = [];
|
|
39232
|
-
var m2 = balanced("{", "}", str);
|
|
39233
|
-
if (!m2)
|
|
39234
|
-
return str.split(",");
|
|
39235
|
-
var pre = m2.pre;
|
|
39236
|
-
var body = m2.body;
|
|
39237
|
-
var post = m2.post;
|
|
39238
|
-
var p2 = pre.split(",");
|
|
39239
|
-
p2[p2.length - 1] += "{" + body + "}";
|
|
39240
|
-
var postParts = parseCommaParts(post);
|
|
39241
|
-
if (post.length) {
|
|
39242
|
-
p2[p2.length - 1] += postParts.shift();
|
|
39243
|
-
p2.push.apply(p2, postParts);
|
|
39244
|
-
}
|
|
39245
|
-
parts.push.apply(parts, p2);
|
|
39246
|
-
return parts;
|
|
39247
|
-
}
|
|
39248
|
-
function expandTop(str, options) {
|
|
39249
|
-
if (!str)
|
|
39250
|
-
return [];
|
|
39251
|
-
options = options || {};
|
|
39252
|
-
var max = options.max == null ? Infinity : options.max;
|
|
39253
|
-
if (str.substr(0, 2) === "{}") {
|
|
39254
|
-
str = "\\{\\}" + str.substr(2);
|
|
39255
|
-
}
|
|
39256
|
-
return expand(escapeBraces(str), max, true).map(unescapeBraces);
|
|
39257
|
-
}
|
|
39258
|
-
function embrace(str) {
|
|
39259
|
-
return "{" + str + "}";
|
|
39260
|
-
}
|
|
39261
|
-
function isPadded(el) {
|
|
39262
|
-
return /^-?0\d/.test(el);
|
|
39263
|
-
}
|
|
39264
|
-
function lte(i3, y) {
|
|
39265
|
-
return i3 <= y;
|
|
39266
|
-
}
|
|
39267
|
-
function gte(i3, y) {
|
|
39268
|
-
return i3 >= y;
|
|
39269
|
-
}
|
|
39270
|
-
function expand(str, max, isTop) {
|
|
39271
|
-
var expansions = [];
|
|
39272
|
-
var m2 = balanced("{", "}", str);
|
|
39273
|
-
if (!m2 || /\$$/.test(m2.pre)) return [str];
|
|
39274
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m2.body);
|
|
39275
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m2.body);
|
|
39276
|
-
var isSequence = isNumericSequence || isAlphaSequence;
|
|
39277
|
-
var isOptions = m2.body.indexOf(",") >= 0;
|
|
39278
|
-
if (!isSequence && !isOptions) {
|
|
39279
|
-
if (m2.post.match(/,(?!,).*\}/)) {
|
|
39280
|
-
str = m2.pre + "{" + m2.body + escClose + m2.post;
|
|
39281
|
-
return expand(str, max, true);
|
|
39282
|
-
}
|
|
39283
|
-
return [str];
|
|
39284
|
-
}
|
|
39285
|
-
var n3;
|
|
39286
|
-
if (isSequence) {
|
|
39287
|
-
n3 = m2.body.split(/\.\./);
|
|
39288
|
-
} else {
|
|
39289
|
-
n3 = parseCommaParts(m2.body);
|
|
39290
|
-
if (n3.length === 1) {
|
|
39291
|
-
n3 = expand(n3[0], max, false).map(embrace);
|
|
39292
|
-
if (n3.length === 1) {
|
|
39293
|
-
var post = m2.post.length ? expand(m2.post, max, false) : [""];
|
|
39294
|
-
return post.map(function(p2) {
|
|
39295
|
-
return m2.pre + n3[0] + p2;
|
|
39296
|
-
});
|
|
39297
|
-
}
|
|
39298
|
-
}
|
|
39299
|
-
}
|
|
39300
|
-
var pre = m2.pre;
|
|
39301
|
-
var post = m2.post.length ? expand(m2.post, max, false) : [""];
|
|
39302
|
-
var N2;
|
|
39303
|
-
if (isSequence) {
|
|
39304
|
-
var x3 = numeric(n3[0]);
|
|
39305
|
-
var y = numeric(n3[1]);
|
|
39306
|
-
var width = Math.max(n3[0].length, n3[1].length);
|
|
39307
|
-
var incr = n3.length == 3 ? Math.max(Math.abs(numeric(n3[2])), 1) : 1;
|
|
39308
|
-
var test = lte;
|
|
39309
|
-
var reverse = y < x3;
|
|
39310
|
-
if (reverse) {
|
|
39311
|
-
incr *= -1;
|
|
39312
|
-
test = gte;
|
|
39313
|
-
}
|
|
39314
|
-
var pad = n3.some(isPadded);
|
|
39315
|
-
N2 = [];
|
|
39316
|
-
for (var i3 = x3; test(i3, y); i3 += incr) {
|
|
39317
|
-
var c2;
|
|
39318
|
-
if (isAlphaSequence) {
|
|
39319
|
-
c2 = String.fromCharCode(i3);
|
|
39320
|
-
if (c2 === "\\")
|
|
39321
|
-
c2 = "";
|
|
39322
|
-
} else {
|
|
39323
|
-
c2 = String(i3);
|
|
39324
|
-
if (pad) {
|
|
39325
|
-
var need = width - c2.length;
|
|
39326
|
-
if (need > 0) {
|
|
39327
|
-
var z21 = new Array(need + 1).join("0");
|
|
39328
|
-
if (i3 < 0)
|
|
39329
|
-
c2 = "-" + z21 + c2.slice(1);
|
|
39330
|
-
else
|
|
39331
|
-
c2 = z21 + c2;
|
|
39332
|
-
}
|
|
39333
|
-
}
|
|
39334
|
-
}
|
|
39335
|
-
N2.push(c2);
|
|
39336
|
-
}
|
|
39337
|
-
} else {
|
|
39338
|
-
N2 = concatMap(n3, function(el) {
|
|
39339
|
-
return expand(el, max, false);
|
|
39340
|
-
});
|
|
39341
|
-
}
|
|
39342
|
-
for (var j2 = 0; j2 < N2.length; j2++) {
|
|
39343
|
-
for (var k2 = 0; k2 < post.length && expansions.length < max; k2++) {
|
|
39344
|
-
var expansion = pre + N2[j2] + post[k2];
|
|
39345
|
-
if (!isTop || isSequence || expansion)
|
|
39346
|
-
expansions.push(expansion);
|
|
39347
|
-
}
|
|
39348
|
-
}
|
|
39349
|
-
return expansions;
|
|
39350
|
-
}
|
|
39351
|
-
}
|
|
39352
|
-
});
|
|
39353
|
-
|
|
39354
|
-
// node_modules/minimatch/minimatch.js
|
|
39355
|
-
var require_minimatch = __commonJS({
|
|
39356
|
-
"node_modules/minimatch/minimatch.js"(exports, module) {
|
|
39357
|
-
"use strict";
|
|
39358
|
-
module.exports = minimatch;
|
|
39359
|
-
minimatch.Minimatch = Minimatch;
|
|
39360
|
-
var path = (function() {
|
|
39361
|
-
try {
|
|
39362
|
-
return __require("path");
|
|
39363
|
-
} catch (e3) {
|
|
39364
|
-
}
|
|
39365
|
-
})() || {
|
|
39366
|
-
sep: "/"
|
|
39367
|
-
};
|
|
39368
|
-
minimatch.sep = path.sep;
|
|
39369
|
-
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
39370
|
-
var expand = require_brace_expansion();
|
|
39371
|
-
var plTypes = {
|
|
39372
|
-
"!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
|
|
39373
|
-
"?": { open: "(?:", close: ")?" },
|
|
39374
|
-
"+": { open: "(?:", close: ")+" },
|
|
39375
|
-
"*": { open: "(?:", close: ")*" },
|
|
39376
|
-
"@": { open: "(?:", close: ")" }
|
|
39377
|
-
};
|
|
39378
|
-
var qmark = "[^/]";
|
|
39379
|
-
var star = qmark + "*?";
|
|
39380
|
-
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
39381
|
-
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
39382
|
-
var reSpecials = charSet("().*{}+?[]^$\\!");
|
|
39383
|
-
function charSet(s2) {
|
|
39384
|
-
return s2.split("").reduce(function(set, c2) {
|
|
39385
|
-
set[c2] = true;
|
|
39386
|
-
return set;
|
|
39387
|
-
}, {});
|
|
39388
|
-
}
|
|
39389
|
-
var slashSplit = /\/+/;
|
|
39390
|
-
minimatch.filter = filter;
|
|
39391
|
-
function filter(pattern, options) {
|
|
39392
|
-
options = options || {};
|
|
39393
|
-
return function(p2, i3, list) {
|
|
39394
|
-
return minimatch(p2, pattern, options);
|
|
39395
|
-
};
|
|
39396
|
-
}
|
|
39397
|
-
function ext(a3, b3) {
|
|
39398
|
-
b3 = b3 || {};
|
|
39399
|
-
var t3 = {};
|
|
39400
|
-
Object.keys(a3).forEach(function(k2) {
|
|
39401
|
-
t3[k2] = a3[k2];
|
|
39402
|
-
});
|
|
39403
|
-
Object.keys(b3).forEach(function(k2) {
|
|
39404
|
-
t3[k2] = b3[k2];
|
|
39405
|
-
});
|
|
39406
|
-
return t3;
|
|
39407
|
-
}
|
|
39408
|
-
minimatch.defaults = function(def) {
|
|
39409
|
-
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
39410
|
-
return minimatch;
|
|
39411
|
-
}
|
|
39412
|
-
var orig = minimatch;
|
|
39413
|
-
var m2 = function minimatch2(p2, pattern, options) {
|
|
39414
|
-
return orig(p2, pattern, ext(def, options));
|
|
39415
|
-
};
|
|
39416
|
-
m2.Minimatch = function Minimatch2(pattern, options) {
|
|
39417
|
-
return new orig.Minimatch(pattern, ext(def, options));
|
|
39418
|
-
};
|
|
39419
|
-
m2.Minimatch.defaults = function defaults(options) {
|
|
39420
|
-
return orig.defaults(ext(def, options)).Minimatch;
|
|
39421
|
-
};
|
|
39422
|
-
m2.filter = function filter2(pattern, options) {
|
|
39423
|
-
return orig.filter(pattern, ext(def, options));
|
|
39424
|
-
};
|
|
39425
|
-
m2.defaults = function defaults(options) {
|
|
39426
|
-
return orig.defaults(ext(def, options));
|
|
39427
|
-
};
|
|
39428
|
-
m2.makeRe = function makeRe2(pattern, options) {
|
|
39429
|
-
return orig.makeRe(pattern, ext(def, options));
|
|
39430
|
-
};
|
|
39431
|
-
m2.braceExpand = function braceExpand2(pattern, options) {
|
|
39432
|
-
return orig.braceExpand(pattern, ext(def, options));
|
|
39433
|
-
};
|
|
39434
|
-
m2.match = function(list, pattern, options) {
|
|
39435
|
-
return orig.match(list, pattern, ext(def, options));
|
|
39436
|
-
};
|
|
39437
|
-
return m2;
|
|
39438
|
-
};
|
|
39439
|
-
Minimatch.defaults = function(def) {
|
|
39440
|
-
return minimatch.defaults(def).Minimatch;
|
|
39441
|
-
};
|
|
39442
|
-
function minimatch(p2, pattern, options) {
|
|
39443
|
-
assertValidPattern(pattern);
|
|
39444
|
-
if (!options) options = {};
|
|
39445
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
39446
|
-
return false;
|
|
39447
|
-
}
|
|
39448
|
-
return new Minimatch(pattern, options).match(p2);
|
|
39449
|
-
}
|
|
39450
|
-
function Minimatch(pattern, options) {
|
|
39451
|
-
if (!(this instanceof Minimatch)) {
|
|
39452
|
-
return new Minimatch(pattern, options);
|
|
39453
|
-
}
|
|
39454
|
-
assertValidPattern(pattern);
|
|
39455
|
-
if (!options) options = {};
|
|
39456
|
-
pattern = pattern.trim();
|
|
39457
|
-
if (!options.allowWindowsEscape && path.sep !== "/") {
|
|
39458
|
-
pattern = pattern.split(path.sep).join("/");
|
|
39459
|
-
}
|
|
39460
|
-
this.options = options;
|
|
39461
|
-
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
|
39462
|
-
this.set = [];
|
|
39463
|
-
this.pattern = pattern;
|
|
39464
|
-
this.regexp = null;
|
|
39465
|
-
this.negate = false;
|
|
39466
|
-
this.comment = false;
|
|
39467
|
-
this.empty = false;
|
|
39468
|
-
this.partial = !!options.partial;
|
|
39469
|
-
this.make();
|
|
39470
|
-
}
|
|
39471
|
-
Minimatch.prototype.debug = function() {
|
|
39472
|
-
};
|
|
39473
|
-
Minimatch.prototype.make = make;
|
|
39474
|
-
function make() {
|
|
39475
|
-
var pattern = this.pattern;
|
|
39476
|
-
var options = this.options;
|
|
39477
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
39478
|
-
this.comment = true;
|
|
39479
|
-
return;
|
|
39480
|
-
}
|
|
39481
|
-
if (!pattern) {
|
|
39482
|
-
this.empty = true;
|
|
39483
|
-
return;
|
|
39484
|
-
}
|
|
39485
|
-
this.parseNegate();
|
|
39486
|
-
var set = this.globSet = this.braceExpand();
|
|
39487
|
-
if (options.debug) this.debug = function debug() {
|
|
39488
|
-
console.error.apply(console, arguments);
|
|
39489
|
-
};
|
|
39490
|
-
this.debug(this.pattern, set);
|
|
39491
|
-
set = this.globParts = set.map(function(s2) {
|
|
39492
|
-
return s2.split(slashSplit);
|
|
39493
|
-
});
|
|
39494
|
-
this.debug(this.pattern, set);
|
|
39495
|
-
set = set.map(function(s2, si, set2) {
|
|
39496
|
-
return s2.map(this.parse, this);
|
|
39497
|
-
}, this);
|
|
39498
|
-
this.debug(this.pattern, set);
|
|
39499
|
-
set = set.filter(function(s2) {
|
|
39500
|
-
return s2.indexOf(false) === -1;
|
|
39501
|
-
});
|
|
39502
|
-
this.debug(this.pattern, set);
|
|
39503
|
-
this.set = set;
|
|
39504
|
-
}
|
|
39505
|
-
Minimatch.prototype.parseNegate = parseNegate;
|
|
39506
|
-
function parseNegate() {
|
|
39507
|
-
var pattern = this.pattern;
|
|
39508
|
-
var negate = false;
|
|
39509
|
-
var options = this.options;
|
|
39510
|
-
var negateOffset = 0;
|
|
39511
|
-
if (options.nonegate) return;
|
|
39512
|
-
for (var i3 = 0, l2 = pattern.length; i3 < l2 && pattern.charAt(i3) === "!"; i3++) {
|
|
39513
|
-
negate = !negate;
|
|
39514
|
-
negateOffset++;
|
|
39515
|
-
}
|
|
39516
|
-
if (negateOffset) this.pattern = pattern.substr(negateOffset);
|
|
39517
|
-
this.negate = negate;
|
|
39518
|
-
}
|
|
39519
|
-
minimatch.braceExpand = function(pattern, options) {
|
|
39520
|
-
return braceExpand(pattern, options);
|
|
39521
|
-
};
|
|
39522
|
-
Minimatch.prototype.braceExpand = braceExpand;
|
|
39523
|
-
function braceExpand(pattern, options) {
|
|
39524
|
-
if (!options) {
|
|
39525
|
-
if (this instanceof Minimatch) {
|
|
39526
|
-
options = this.options;
|
|
39527
|
-
} else {
|
|
39528
|
-
options = {};
|
|
39529
|
-
}
|
|
39530
|
-
}
|
|
39531
|
-
pattern = typeof pattern === "undefined" ? this.pattern : pattern;
|
|
39532
|
-
assertValidPattern(pattern);
|
|
39533
|
-
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
39534
|
-
return [pattern];
|
|
39535
|
-
}
|
|
39536
|
-
return expand(pattern);
|
|
39537
|
-
}
|
|
39538
|
-
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
39539
|
-
var assertValidPattern = function(pattern) {
|
|
39540
|
-
if (typeof pattern !== "string") {
|
|
39541
|
-
throw new TypeError("invalid pattern");
|
|
39542
|
-
}
|
|
39543
|
-
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
39544
|
-
throw new TypeError("pattern is too long");
|
|
39545
|
-
}
|
|
39546
|
-
};
|
|
39547
|
-
Minimatch.prototype.parse = parse2;
|
|
39548
|
-
var SUBPARSE = {};
|
|
39549
|
-
function parse2(pattern, isSub) {
|
|
39550
|
-
assertValidPattern(pattern);
|
|
39551
|
-
var options = this.options;
|
|
39552
|
-
if (pattern === "**") {
|
|
39553
|
-
if (!options.noglobstar)
|
|
39554
|
-
return GLOBSTAR;
|
|
39555
|
-
else
|
|
39556
|
-
pattern = "*";
|
|
39557
|
-
}
|
|
39558
|
-
if (pattern === "") return "";
|
|
39559
|
-
var re2 = "";
|
|
39560
|
-
var hasMagic = !!options.nocase;
|
|
39561
|
-
var escaping = false;
|
|
39562
|
-
var patternListStack = [];
|
|
39563
|
-
var negativeLists = [];
|
|
39564
|
-
var stateChar;
|
|
39565
|
-
var inClass = false;
|
|
39566
|
-
var reClassStart = -1;
|
|
39567
|
-
var classStart = -1;
|
|
39568
|
-
var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
39569
|
-
var self2 = this;
|
|
39570
|
-
function clearStateChar() {
|
|
39571
|
-
if (stateChar) {
|
|
39572
|
-
switch (stateChar) {
|
|
39573
|
-
case "*":
|
|
39574
|
-
re2 += star;
|
|
39575
|
-
hasMagic = true;
|
|
39576
|
-
break;
|
|
39577
|
-
case "?":
|
|
39578
|
-
re2 += qmark;
|
|
39579
|
-
hasMagic = true;
|
|
39580
|
-
break;
|
|
39581
|
-
default:
|
|
39582
|
-
re2 += "\\" + stateChar;
|
|
39583
|
-
break;
|
|
39584
|
-
}
|
|
39585
|
-
self2.debug("clearStateChar %j %j", stateChar, re2);
|
|
39586
|
-
stateChar = false;
|
|
39587
|
-
}
|
|
39588
|
-
}
|
|
39589
|
-
for (var i3 = 0, len = pattern.length, c2; i3 < len && (c2 = pattern.charAt(i3)); i3++) {
|
|
39590
|
-
this.debug("%s %s %s %j", pattern, i3, re2, c2);
|
|
39591
|
-
if (escaping && reSpecials[c2]) {
|
|
39592
|
-
re2 += "\\" + c2;
|
|
39593
|
-
escaping = false;
|
|
39594
|
-
continue;
|
|
39595
|
-
}
|
|
39596
|
-
switch (c2) {
|
|
39597
|
-
/* istanbul ignore next */
|
|
39598
|
-
case "/": {
|
|
39599
|
-
return false;
|
|
39600
|
-
}
|
|
39601
|
-
case "\\":
|
|
39602
|
-
clearStateChar();
|
|
39603
|
-
escaping = true;
|
|
39604
|
-
continue;
|
|
39605
|
-
// the various stateChar values
|
|
39606
|
-
// for the "extglob" stuff.
|
|
39607
|
-
case "?":
|
|
39608
|
-
case "*":
|
|
39609
|
-
case "+":
|
|
39610
|
-
case "@":
|
|
39611
|
-
case "!":
|
|
39612
|
-
this.debug("%s %s %s %j <-- stateChar", pattern, i3, re2, c2);
|
|
39613
|
-
if (inClass) {
|
|
39614
|
-
this.debug(" in class");
|
|
39615
|
-
if (c2 === "!" && i3 === classStart + 1) c2 = "^";
|
|
39616
|
-
re2 += c2;
|
|
39617
|
-
continue;
|
|
39618
|
-
}
|
|
39619
|
-
if (c2 === "*" && stateChar === "*") continue;
|
|
39620
|
-
self2.debug("call clearStateChar %j", stateChar);
|
|
39621
|
-
clearStateChar();
|
|
39622
|
-
stateChar = c2;
|
|
39623
|
-
if (options.noext) clearStateChar();
|
|
39624
|
-
continue;
|
|
39625
|
-
case "(":
|
|
39626
|
-
if (inClass) {
|
|
39627
|
-
re2 += "(";
|
|
39628
|
-
continue;
|
|
39629
|
-
}
|
|
39630
|
-
if (!stateChar) {
|
|
39631
|
-
re2 += "\\(";
|
|
39632
|
-
continue;
|
|
39633
|
-
}
|
|
39634
|
-
patternListStack.push({
|
|
39635
|
-
type: stateChar,
|
|
39636
|
-
start: i3 - 1,
|
|
39637
|
-
reStart: re2.length,
|
|
39638
|
-
open: plTypes[stateChar].open,
|
|
39639
|
-
close: plTypes[stateChar].close
|
|
39640
|
-
});
|
|
39641
|
-
re2 += stateChar === "!" ? "(?:(?!(?:" : "(?:";
|
|
39642
|
-
this.debug("plType %j %j", stateChar, re2);
|
|
39643
|
-
stateChar = false;
|
|
39644
|
-
continue;
|
|
39645
|
-
case ")":
|
|
39646
|
-
if (inClass || !patternListStack.length) {
|
|
39647
|
-
re2 += "\\)";
|
|
39648
|
-
continue;
|
|
39649
|
-
}
|
|
39650
|
-
clearStateChar();
|
|
39651
|
-
hasMagic = true;
|
|
39652
|
-
var pl = patternListStack.pop();
|
|
39653
|
-
re2 += pl.close;
|
|
39654
|
-
if (pl.type === "!") {
|
|
39655
|
-
negativeLists.push(pl);
|
|
39656
|
-
}
|
|
39657
|
-
pl.reEnd = re2.length;
|
|
39658
|
-
continue;
|
|
39659
|
-
case "|":
|
|
39660
|
-
if (inClass || !patternListStack.length || escaping) {
|
|
39661
|
-
re2 += "\\|";
|
|
39662
|
-
escaping = false;
|
|
39663
|
-
continue;
|
|
39664
|
-
}
|
|
39665
|
-
clearStateChar();
|
|
39666
|
-
re2 += "|";
|
|
39667
|
-
continue;
|
|
39668
|
-
// these are mostly the same in regexp and glob
|
|
39669
|
-
case "[":
|
|
39670
|
-
clearStateChar();
|
|
39671
|
-
if (inClass) {
|
|
39672
|
-
re2 += "\\" + c2;
|
|
39673
|
-
continue;
|
|
39674
|
-
}
|
|
39675
|
-
inClass = true;
|
|
39676
|
-
classStart = i3;
|
|
39677
|
-
reClassStart = re2.length;
|
|
39678
|
-
re2 += c2;
|
|
39679
|
-
continue;
|
|
39680
|
-
case "]":
|
|
39681
|
-
if (i3 === classStart + 1 || !inClass) {
|
|
39682
|
-
re2 += "\\" + c2;
|
|
39683
|
-
escaping = false;
|
|
39684
|
-
continue;
|
|
39685
|
-
}
|
|
39686
|
-
var cs = pattern.substring(classStart + 1, i3);
|
|
39687
|
-
try {
|
|
39688
|
-
RegExp("[" + cs + "]");
|
|
39689
|
-
} catch (er) {
|
|
39690
|
-
var sp = this.parse(cs, SUBPARSE);
|
|
39691
|
-
re2 = re2.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
|
|
39692
|
-
hasMagic = hasMagic || sp[1];
|
|
39693
|
-
inClass = false;
|
|
39694
|
-
continue;
|
|
39695
|
-
}
|
|
39696
|
-
hasMagic = true;
|
|
39697
|
-
inClass = false;
|
|
39698
|
-
re2 += c2;
|
|
39699
|
-
continue;
|
|
39700
|
-
default:
|
|
39701
|
-
clearStateChar();
|
|
39702
|
-
if (escaping) {
|
|
39703
|
-
escaping = false;
|
|
39704
|
-
} else if (reSpecials[c2] && !(c2 === "^" && inClass)) {
|
|
39705
|
-
re2 += "\\";
|
|
39706
|
-
}
|
|
39707
|
-
re2 += c2;
|
|
39708
|
-
}
|
|
39709
|
-
}
|
|
39710
|
-
if (inClass) {
|
|
39711
|
-
cs = pattern.substr(classStart + 1);
|
|
39712
|
-
sp = this.parse(cs, SUBPARSE);
|
|
39713
|
-
re2 = re2.substr(0, reClassStart) + "\\[" + sp[0];
|
|
39714
|
-
hasMagic = hasMagic || sp[1];
|
|
39715
|
-
}
|
|
39716
|
-
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
|
39717
|
-
var tail = re2.slice(pl.reStart + pl.open.length);
|
|
39718
|
-
this.debug("setting tail", re2, pl);
|
|
39719
|
-
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_2, $1, $2) {
|
|
39720
|
-
if (!$2) {
|
|
39721
|
-
$2 = "\\";
|
|
39722
|
-
}
|
|
39723
|
-
return $1 + $1 + $2 + "|";
|
|
39724
|
-
});
|
|
39725
|
-
this.debug("tail=%j\n %s", tail, tail, pl, re2);
|
|
39726
|
-
var t3 = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
|
|
39727
|
-
hasMagic = true;
|
|
39728
|
-
re2 = re2.slice(0, pl.reStart) + t3 + "\\(" + tail;
|
|
39729
|
-
}
|
|
39730
|
-
clearStateChar();
|
|
39731
|
-
if (escaping) {
|
|
39732
|
-
re2 += "\\\\";
|
|
39733
|
-
}
|
|
39734
|
-
var addPatternStart = false;
|
|
39735
|
-
switch (re2.charAt(0)) {
|
|
39736
|
-
case "[":
|
|
39737
|
-
case ".":
|
|
39738
|
-
case "(":
|
|
39739
|
-
addPatternStart = true;
|
|
39740
|
-
}
|
|
39741
|
-
for (var n3 = negativeLists.length - 1; n3 > -1; n3--) {
|
|
39742
|
-
var nl = negativeLists[n3];
|
|
39743
|
-
var nlBefore = re2.slice(0, nl.reStart);
|
|
39744
|
-
var nlFirst = re2.slice(nl.reStart, nl.reEnd - 8);
|
|
39745
|
-
var nlLast = re2.slice(nl.reEnd - 8, nl.reEnd);
|
|
39746
|
-
var nlAfter = re2.slice(nl.reEnd);
|
|
39747
|
-
nlLast += nlAfter;
|
|
39748
|
-
var openParensBefore = nlBefore.split("(").length - 1;
|
|
39749
|
-
var cleanAfter = nlAfter;
|
|
39750
|
-
for (i3 = 0; i3 < openParensBefore; i3++) {
|
|
39751
|
-
cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
|
|
39752
|
-
}
|
|
39753
|
-
nlAfter = cleanAfter;
|
|
39754
|
-
var dollar = "";
|
|
39755
|
-
if (nlAfter === "" && isSub !== SUBPARSE) {
|
|
39756
|
-
dollar = "$";
|
|
39757
|
-
}
|
|
39758
|
-
var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
|
39759
|
-
re2 = newRe;
|
|
39760
|
-
}
|
|
39761
|
-
if (re2 !== "" && hasMagic) {
|
|
39762
|
-
re2 = "(?=.)" + re2;
|
|
39763
|
-
}
|
|
39764
|
-
if (addPatternStart) {
|
|
39765
|
-
re2 = patternStart + re2;
|
|
39766
|
-
}
|
|
39767
|
-
if (isSub === SUBPARSE) {
|
|
39768
|
-
return [re2, hasMagic];
|
|
39769
|
-
}
|
|
39770
|
-
if (!hasMagic) {
|
|
39771
|
-
return globUnescape(pattern);
|
|
39772
|
-
}
|
|
39773
|
-
var flags = options.nocase ? "i" : "";
|
|
39774
|
-
try {
|
|
39775
|
-
var regExp = new RegExp("^" + re2 + "$", flags);
|
|
39776
|
-
} catch (er) {
|
|
39777
|
-
return new RegExp("$.");
|
|
39778
|
-
}
|
|
39779
|
-
regExp._glob = pattern;
|
|
39780
|
-
regExp._src = re2;
|
|
39781
|
-
return regExp;
|
|
39782
|
-
}
|
|
39783
|
-
minimatch.makeRe = function(pattern, options) {
|
|
39784
|
-
return new Minimatch(pattern, options || {}).makeRe();
|
|
39785
|
-
};
|
|
39786
|
-
Minimatch.prototype.makeRe = makeRe;
|
|
39787
|
-
function makeRe() {
|
|
39788
|
-
if (this.regexp || this.regexp === false) return this.regexp;
|
|
39789
|
-
var set = this.set;
|
|
39790
|
-
if (!set.length) {
|
|
39791
|
-
this.regexp = false;
|
|
39792
|
-
return this.regexp;
|
|
39793
|
-
}
|
|
39794
|
-
var options = this.options;
|
|
39795
|
-
var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
39796
|
-
var flags = options.nocase ? "i" : "";
|
|
39797
|
-
var re2 = set.map(function(pattern) {
|
|
39798
|
-
return pattern.map(function(p2) {
|
|
39799
|
-
return p2 === GLOBSTAR ? twoStar : typeof p2 === "string" ? regExpEscape(p2) : p2._src;
|
|
39800
|
-
}).join("\\/");
|
|
39801
|
-
}).join("|");
|
|
39802
|
-
re2 = "^(?:" + re2 + ")$";
|
|
39803
|
-
if (this.negate) re2 = "^(?!" + re2 + ").*$";
|
|
39804
|
-
try {
|
|
39805
|
-
this.regexp = new RegExp(re2, flags);
|
|
39806
|
-
} catch (ex) {
|
|
39807
|
-
this.regexp = false;
|
|
39808
|
-
}
|
|
39809
|
-
return this.regexp;
|
|
39810
|
-
}
|
|
39811
|
-
minimatch.match = function(list, pattern, options) {
|
|
39812
|
-
options = options || {};
|
|
39813
|
-
var mm = new Minimatch(pattern, options);
|
|
39814
|
-
list = list.filter(function(f2) {
|
|
39815
|
-
return mm.match(f2);
|
|
39816
|
-
});
|
|
39817
|
-
if (mm.options.nonull && !list.length) {
|
|
39818
|
-
list.push(pattern);
|
|
39819
|
-
}
|
|
39820
|
-
return list;
|
|
39821
|
-
};
|
|
39822
|
-
Minimatch.prototype.match = function match(f2, partial) {
|
|
39823
|
-
if (typeof partial === "undefined") partial = this.partial;
|
|
39824
|
-
this.debug("match", f2, this.pattern);
|
|
39825
|
-
if (this.comment) return false;
|
|
39826
|
-
if (this.empty) return f2 === "";
|
|
39827
|
-
if (f2 === "/" && partial) return true;
|
|
39828
|
-
var options = this.options;
|
|
39829
|
-
if (path.sep !== "/") {
|
|
39830
|
-
f2 = f2.split(path.sep).join("/");
|
|
39831
|
-
}
|
|
39832
|
-
f2 = f2.split(slashSplit);
|
|
39833
|
-
this.debug(this.pattern, "split", f2);
|
|
39834
|
-
var set = this.set;
|
|
39835
|
-
this.debug(this.pattern, "set", set);
|
|
39836
|
-
var filename;
|
|
39837
|
-
var i3;
|
|
39838
|
-
for (i3 = f2.length - 1; i3 >= 0; i3--) {
|
|
39839
|
-
filename = f2[i3];
|
|
39840
|
-
if (filename) break;
|
|
39841
|
-
}
|
|
39842
|
-
for (i3 = 0; i3 < set.length; i3++) {
|
|
39843
|
-
var pattern = set[i3];
|
|
39844
|
-
var file = f2;
|
|
39845
|
-
if (options.matchBase && pattern.length === 1) {
|
|
39846
|
-
file = [filename];
|
|
39847
|
-
}
|
|
39848
|
-
var hit = this.matchOne(file, pattern, partial);
|
|
39849
|
-
if (hit) {
|
|
39850
|
-
if (options.flipNegate) return true;
|
|
39851
|
-
return !this.negate;
|
|
39852
|
-
}
|
|
39853
|
-
}
|
|
39854
|
-
if (options.flipNegate) return false;
|
|
39855
|
-
return this.negate;
|
|
39856
|
-
};
|
|
39857
|
-
Minimatch.prototype.matchOne = function(file, pattern, partial) {
|
|
39858
|
-
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
|
39859
|
-
return this._matchGlobstar(file, pattern, partial, 0, 0);
|
|
39860
|
-
}
|
|
39861
|
-
return this._matchOne(file, pattern, partial, 0, 0);
|
|
39862
|
-
};
|
|
39863
|
-
Minimatch.prototype._matchGlobstar = function(file, pattern, partial, fileIndex, patternIndex) {
|
|
39864
|
-
var i3;
|
|
39865
|
-
var firstgs = -1;
|
|
39866
|
-
for (i3 = patternIndex; i3 < pattern.length; i3++) {
|
|
39867
|
-
if (pattern[i3] === GLOBSTAR) {
|
|
39868
|
-
firstgs = i3;
|
|
39869
|
-
break;
|
|
39870
|
-
}
|
|
39871
|
-
}
|
|
39872
|
-
var lastgs = -1;
|
|
39873
|
-
for (i3 = pattern.length - 1; i3 >= 0; i3--) {
|
|
39874
|
-
if (pattern[i3] === GLOBSTAR) {
|
|
39875
|
-
lastgs = i3;
|
|
39876
|
-
break;
|
|
39877
|
-
}
|
|
39878
|
-
}
|
|
39879
|
-
var head = pattern.slice(patternIndex, firstgs);
|
|
39880
|
-
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs);
|
|
39881
|
-
var tail = partial ? [] : pattern.slice(lastgs + 1);
|
|
39882
|
-
if (head.length) {
|
|
39883
|
-
var fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
39884
|
-
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
|
39885
|
-
return false;
|
|
39886
|
-
}
|
|
39887
|
-
fileIndex += head.length;
|
|
39888
|
-
}
|
|
39889
|
-
var fileTailMatch = 0;
|
|
39890
|
-
if (tail.length) {
|
|
39891
|
-
if (tail.length + fileIndex > file.length) return false;
|
|
39892
|
-
var tailStart = file.length - tail.length;
|
|
39893
|
-
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
|
39894
|
-
fileTailMatch = tail.length;
|
|
39895
|
-
} else {
|
|
39896
|
-
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
|
39897
|
-
return false;
|
|
39898
|
-
}
|
|
39899
|
-
tailStart--;
|
|
39900
|
-
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
|
39901
|
-
return false;
|
|
39902
|
-
}
|
|
39903
|
-
fileTailMatch = tail.length + 1;
|
|
39904
|
-
}
|
|
39905
|
-
}
|
|
39906
|
-
if (!body.length) {
|
|
39907
|
-
var sawSome = !!fileTailMatch;
|
|
39908
|
-
for (i3 = fileIndex; i3 < file.length - fileTailMatch; i3++) {
|
|
39909
|
-
var f2 = String(file[i3]);
|
|
39910
|
-
sawSome = true;
|
|
39911
|
-
if (f2 === "." || f2 === ".." || !this.options.dot && f2.charAt(0) === ".") {
|
|
39912
|
-
return false;
|
|
39913
|
-
}
|
|
39914
|
-
}
|
|
39915
|
-
return partial || sawSome;
|
|
39916
|
-
}
|
|
39917
|
-
var bodySegments = [[[], 0]];
|
|
39918
|
-
var currentBody = bodySegments[0];
|
|
39919
|
-
var nonGsParts = 0;
|
|
39920
|
-
var nonGsPartsSums = [0];
|
|
39921
|
-
for (var bi = 0; bi < body.length; bi++) {
|
|
39922
|
-
var b3 = body[bi];
|
|
39923
|
-
if (b3 === GLOBSTAR) {
|
|
39924
|
-
nonGsPartsSums.push(nonGsParts);
|
|
39925
|
-
currentBody = [[], 0];
|
|
39926
|
-
bodySegments.push(currentBody);
|
|
39927
|
-
} else {
|
|
39928
|
-
currentBody[0].push(b3);
|
|
39929
|
-
nonGsParts++;
|
|
39930
|
-
}
|
|
39931
|
-
}
|
|
39932
|
-
var idx = bodySegments.length - 1;
|
|
39933
|
-
var fileLength = file.length - fileTailMatch;
|
|
39934
|
-
for (var si = 0; si < bodySegments.length; si++) {
|
|
39935
|
-
bodySegments[si][1] = fileLength - (nonGsPartsSums[idx--] + bodySegments[si][0].length);
|
|
39936
|
-
}
|
|
39937
|
-
return !!this._matchGlobStarBodySections(
|
|
39938
|
-
file,
|
|
39939
|
-
bodySegments,
|
|
39940
|
-
fileIndex,
|
|
39941
|
-
0,
|
|
39942
|
-
partial,
|
|
39943
|
-
0,
|
|
39944
|
-
!!fileTailMatch
|
|
39945
|
-
);
|
|
39946
|
-
};
|
|
39947
|
-
Minimatch.prototype._matchGlobStarBodySections = function(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
39948
|
-
var bs = bodySegments[bodyIndex];
|
|
39949
|
-
if (!bs) {
|
|
39950
|
-
for (var i3 = fileIndex; i3 < file.length; i3++) {
|
|
39951
|
-
sawTail = true;
|
|
39952
|
-
var f2 = file[i3];
|
|
39953
|
-
if (f2 === "." || f2 === ".." || !this.options.dot && f2.charAt(0) === ".") {
|
|
39954
|
-
return false;
|
|
39955
|
-
}
|
|
39956
|
-
}
|
|
39957
|
-
return sawTail;
|
|
39958
|
-
}
|
|
39959
|
-
var body = bs[0];
|
|
39960
|
-
var after = bs[1];
|
|
39961
|
-
while (fileIndex <= after) {
|
|
39962
|
-
var m2 = this._matchOne(
|
|
39963
|
-
file.slice(0, fileIndex + body.length),
|
|
39964
|
-
body,
|
|
39965
|
-
partial,
|
|
39966
|
-
fileIndex,
|
|
39967
|
-
0
|
|
39968
|
-
);
|
|
39969
|
-
if (m2 && globStarDepth < this.maxGlobstarRecursion) {
|
|
39970
|
-
var sub = this._matchGlobStarBodySections(
|
|
39971
|
-
file,
|
|
39972
|
-
bodySegments,
|
|
39973
|
-
fileIndex + body.length,
|
|
39974
|
-
bodyIndex + 1,
|
|
39975
|
-
partial,
|
|
39976
|
-
globStarDepth + 1,
|
|
39977
|
-
sawTail
|
|
39978
|
-
);
|
|
39979
|
-
if (sub !== false) {
|
|
39980
|
-
return sub;
|
|
39981
|
-
}
|
|
39982
|
-
}
|
|
39983
|
-
var f2 = file[fileIndex];
|
|
39984
|
-
if (f2 === "." || f2 === ".." || !this.options.dot && f2.charAt(0) === ".") {
|
|
39985
|
-
return false;
|
|
39986
|
-
}
|
|
39987
|
-
fileIndex++;
|
|
39988
|
-
}
|
|
39989
|
-
return partial || null;
|
|
39990
|
-
};
|
|
39991
|
-
Minimatch.prototype._matchOne = function(file, pattern, partial, fileIndex, patternIndex) {
|
|
39992
|
-
var fi, pi, fl, pl;
|
|
39993
|
-
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
39994
|
-
this.debug("matchOne loop");
|
|
39995
|
-
var p2 = pattern[pi];
|
|
39996
|
-
var f2 = file[fi];
|
|
39997
|
-
this.debug(pattern, p2, f2);
|
|
39998
|
-
if (p2 === false || p2 === GLOBSTAR) return false;
|
|
39999
|
-
var hit;
|
|
40000
|
-
if (typeof p2 === "string") {
|
|
40001
|
-
hit = f2 === p2;
|
|
40002
|
-
this.debug("string match", p2, f2, hit);
|
|
40003
|
-
} else {
|
|
40004
|
-
hit = f2.match(p2);
|
|
40005
|
-
this.debug("pattern match", p2, f2, hit);
|
|
40006
|
-
}
|
|
40007
|
-
if (!hit) return false;
|
|
40008
|
-
}
|
|
40009
|
-
if (fi === fl && pi === pl) {
|
|
40010
|
-
return true;
|
|
40011
|
-
} else if (fi === fl) {
|
|
40012
|
-
return partial;
|
|
40013
|
-
} else if (pi === pl) {
|
|
40014
|
-
return fi === fl - 1 && file[fi] === "";
|
|
40015
|
-
}
|
|
40016
|
-
throw new Error("wtf?");
|
|
40017
|
-
};
|
|
40018
|
-
function globUnescape(s2) {
|
|
40019
|
-
return s2.replace(/\\(.)/g, "$1");
|
|
40020
|
-
}
|
|
40021
|
-
function regExpEscape(s2) {
|
|
40022
|
-
return s2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
40023
|
-
}
|
|
40024
|
-
}
|
|
40025
|
-
});
|
|
40026
|
-
|
|
40027
39130
|
// node_modules/@stoplight/spectral-core/dist/ruleset/utils/minimatch.js
|
|
40028
|
-
var
|
|
39131
|
+
var require_minimatch = __commonJS({
|
|
40029
39132
|
"node_modules/@stoplight/spectral-core/dist/ruleset/utils/minimatch.js"(exports) {
|
|
40030
39133
|
"use strict";
|
|
40031
39134
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40032
39135
|
exports.minimatch = void 0;
|
|
40033
39136
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
40034
|
-
var minimatch_1 = (0, tslib_1.__importDefault)(
|
|
39137
|
+
var minimatch_1 = (0, tslib_1.__importDefault)(__require("minimatch"));
|
|
40035
39138
|
var DEFAULT_OPTS = { matchBase: true };
|
|
40036
|
-
function
|
|
39139
|
+
function minimatch3(source, pattern) {
|
|
40037
39140
|
return (0, minimatch_1.default)(source, pattern, DEFAULT_OPTS);
|
|
40038
39141
|
}
|
|
40039
|
-
exports.minimatch =
|
|
39142
|
+
exports.minimatch = minimatch3;
|
|
40040
39143
|
}
|
|
40041
39144
|
});
|
|
40042
39145
|
|
|
@@ -40189,7 +39292,7 @@ var require_rule = __commonJS({
|
|
|
40189
39292
|
var path_1 = (init_index_es(), __toCommonJS(index_es_exports));
|
|
40190
39293
|
var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2));
|
|
40191
39294
|
var severity_1 = require_severity();
|
|
40192
|
-
var minimatch_1 =
|
|
39295
|
+
var minimatch_1 = require_minimatch();
|
|
40193
39296
|
var formats_1 = require_formats();
|
|
40194
39297
|
var alias_1 = require_alias();
|
|
40195
39298
|
var Rule = class _Rule {
|
|
@@ -46094,7 +45197,7 @@ var require_ruleset = __commonJS({
|
|
|
46094
45197
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
46095
45198
|
var path_1 = (init_index_es(), __toCommonJS(index_es_exports));
|
|
46096
45199
|
var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2));
|
|
46097
|
-
var minimatch_1 =
|
|
45200
|
+
var minimatch_1 = require_minimatch();
|
|
46098
45201
|
var rule_1 = require_rule();
|
|
46099
45202
|
var index_1 = require_validation();
|
|
46100
45203
|
var rules_1 = require_rules();
|
|
@@ -54687,33 +53790,7 @@ function buildNavigationIndex(dsl) {
|
|
|
54687
53790
|
};
|
|
54688
53791
|
}
|
|
54689
53792
|
|
|
54690
|
-
// src/renderer/
|
|
54691
|
-
Handlebars.registerHelper("eq", (a3, b3) => a3 === b3);
|
|
54692
|
-
Handlebars.registerHelper("notEmpty", (obj) => {
|
|
54693
|
-
if (!obj || typeof obj !== "object") return false;
|
|
54694
|
-
return Object.keys(obj).length > 0;
|
|
54695
|
-
});
|
|
54696
|
-
Handlebars.registerHelper("inc", (val) => val + 1);
|
|
54697
|
-
Handlebars.registerHelper(
|
|
54698
|
-
"lookupPayloadFields",
|
|
54699
|
-
(schema) => {
|
|
54700
|
-
const effective = resolveAllOf(schema ?? {});
|
|
54701
|
-
const props = effective["properties"];
|
|
54702
|
-
if (!props) return [];
|
|
54703
|
-
const requiredSet = new Set(
|
|
54704
|
-
effective["required"] ?? []
|
|
54705
|
-
);
|
|
54706
|
-
return Object.entries(props).map(([name, sub]) => {
|
|
54707
|
-
const enumVals = sub["enum"];
|
|
54708
|
-
return {
|
|
54709
|
-
name,
|
|
54710
|
-
type: sub["type"] ?? "any",
|
|
54711
|
-
required: requiredSet.has(name),
|
|
54712
|
-
enum: enumVals ? enumVals.join(" | ") : void 0
|
|
54713
|
-
};
|
|
54714
|
-
});
|
|
54715
|
-
}
|
|
54716
|
-
);
|
|
53793
|
+
// src/renderer/serialization.ts
|
|
54717
53794
|
function toYamlLines(obj, indent) {
|
|
54718
53795
|
const pad = " ".repeat(indent);
|
|
54719
53796
|
if (obj === null || obj === void 0) return [`${pad}null`];
|
|
@@ -54780,9 +53857,146 @@ function toYamlLines(obj, indent) {
|
|
|
54780
53857
|
}
|
|
54781
53858
|
return [`${pad}${String(obj)}`];
|
|
54782
53859
|
}
|
|
54783
|
-
|
|
53860
|
+
function toYamlString(obj) {
|
|
54784
53861
|
return toYamlLines(obj, 0).join("\n");
|
|
53862
|
+
}
|
|
53863
|
+
function toJsonString(obj, indent = 2) {
|
|
53864
|
+
return JSON.stringify(obj, null, indent);
|
|
53865
|
+
}
|
|
53866
|
+
function toYamlFrontmatter(obj) {
|
|
53867
|
+
const body = toYamlString(obj);
|
|
53868
|
+
if (!body) return "---\n---\n";
|
|
53869
|
+
return `---
|
|
53870
|
+
${body}
|
|
53871
|
+
---
|
|
53872
|
+
`;
|
|
53873
|
+
}
|
|
53874
|
+
|
|
53875
|
+
// src/renderer/handoff-payload.ts
|
|
53876
|
+
function resolveHandoffPayload(handoffType) {
|
|
53877
|
+
if (!handoffType) return {};
|
|
53878
|
+
if (handoffType.example && typeof handoffType.example === "object" && !Array.isArray(handoffType.example)) {
|
|
53879
|
+
return handoffType.example;
|
|
53880
|
+
}
|
|
53881
|
+
if (handoffType.schema && typeof handoffType.schema === "object") {
|
|
53882
|
+
return exampleFromSchema(handoffType.schema);
|
|
53883
|
+
}
|
|
53884
|
+
return {};
|
|
53885
|
+
}
|
|
53886
|
+
function buildHandoffEnvelope(handoffType, idOverride) {
|
|
53887
|
+
if (!handoffType) return {};
|
|
53888
|
+
const type = idOverride ?? handoffType.id;
|
|
53889
|
+
return {
|
|
53890
|
+
...type ? { type } : {},
|
|
53891
|
+
...handoffType.version !== void 0 ? { version: handoffType.version } : {},
|
|
53892
|
+
payload: resolveHandoffPayload(handoffType)
|
|
53893
|
+
};
|
|
53894
|
+
}
|
|
53895
|
+
function exampleFromSchema(schema) {
|
|
53896
|
+
const effective = resolveAllOf(schema);
|
|
53897
|
+
if (effective["$ref"] && !effective["properties"] && !effective["type"]) {
|
|
53898
|
+
return {};
|
|
53899
|
+
}
|
|
53900
|
+
return exampleFromJsonSchema(effective);
|
|
53901
|
+
}
|
|
53902
|
+
function exampleFromJsonSchema(schema) {
|
|
53903
|
+
const type = schema["type"];
|
|
53904
|
+
if (type === "object" || schema["properties"]) {
|
|
53905
|
+
return exampleFromObjectSchema(schema);
|
|
53906
|
+
}
|
|
53907
|
+
return {};
|
|
53908
|
+
}
|
|
53909
|
+
function exampleFromObjectSchema(schema) {
|
|
53910
|
+
const props = schema["properties"];
|
|
53911
|
+
if (!props) return {};
|
|
53912
|
+
const required = new Set(
|
|
53913
|
+
schema["required"] ?? []
|
|
53914
|
+
);
|
|
53915
|
+
const result = {};
|
|
53916
|
+
for (const [key, propSchema] of Object.entries(props)) {
|
|
53917
|
+
if (!required.has(key)) continue;
|
|
53918
|
+
result[key] = exampleFromPropertySchema(
|
|
53919
|
+
propSchema,
|
|
53920
|
+
key
|
|
53921
|
+
);
|
|
53922
|
+
}
|
|
53923
|
+
return result;
|
|
53924
|
+
}
|
|
53925
|
+
function exampleFromPropertySchema(schema, propName) {
|
|
53926
|
+
const effective = resolveAllOf(schema);
|
|
53927
|
+
if (effective["example"] !== void 0) return effective["example"];
|
|
53928
|
+
if (effective["const"] !== void 0) return effective["const"];
|
|
53929
|
+
const enumVals = effective["enum"];
|
|
53930
|
+
if (enumVals && enumVals.length > 0) return enumVals[0];
|
|
53931
|
+
const type = effective["type"];
|
|
53932
|
+
if (type === "string" || !type && effective["format"]) {
|
|
53933
|
+
return `<${propName}>`;
|
|
53934
|
+
}
|
|
53935
|
+
if (type === "integer") return 0;
|
|
53936
|
+
if (type === "number") return 0;
|
|
53937
|
+
if (type === "boolean") return false;
|
|
53938
|
+
if (type === "array") {
|
|
53939
|
+
const items = effective["items"];
|
|
53940
|
+
if (items && typeof items === "object") {
|
|
53941
|
+
return [exampleFromPropertySchema(items, "item")];
|
|
53942
|
+
}
|
|
53943
|
+
return [];
|
|
53944
|
+
}
|
|
53945
|
+
if (type === "object" || effective["properties"]) {
|
|
53946
|
+
return exampleFromObjectSchema(effective);
|
|
53947
|
+
}
|
|
53948
|
+
return null;
|
|
53949
|
+
}
|
|
53950
|
+
|
|
53951
|
+
// src/renderer/renderer.ts
|
|
53952
|
+
Handlebars.registerHelper("eq", (a3, b3) => a3 === b3);
|
|
53953
|
+
Handlebars.registerHelper("notEmpty", (obj) => {
|
|
53954
|
+
if (!obj || typeof obj !== "object") return false;
|
|
53955
|
+
return Object.keys(obj).length > 0;
|
|
54785
53956
|
});
|
|
53957
|
+
Handlebars.registerHelper("inc", (val) => val + 1);
|
|
53958
|
+
Handlebars.registerHelper(
|
|
53959
|
+
"lookupPayloadFields",
|
|
53960
|
+
(schema) => {
|
|
53961
|
+
const effective = resolveAllOf(schema ?? {});
|
|
53962
|
+
const props = effective["properties"];
|
|
53963
|
+
if (!props) return [];
|
|
53964
|
+
const requiredSet = new Set(
|
|
53965
|
+
effective["required"] ?? []
|
|
53966
|
+
);
|
|
53967
|
+
return Object.entries(props).map(([name, sub]) => {
|
|
53968
|
+
const enumVals = sub["enum"];
|
|
53969
|
+
return {
|
|
53970
|
+
name,
|
|
53971
|
+
type: sub["type"] ?? "any",
|
|
53972
|
+
required: requiredSet.has(name),
|
|
53973
|
+
enum: enumVals ? enumVals.join(" | ") : void 0
|
|
53974
|
+
};
|
|
53975
|
+
});
|
|
53976
|
+
}
|
|
53977
|
+
);
|
|
53978
|
+
Handlebars.registerHelper("yamlBlock", (obj) => {
|
|
53979
|
+
return toYamlString(obj);
|
|
53980
|
+
});
|
|
53981
|
+
Handlebars.registerHelper("jsonBlock", (obj) => {
|
|
53982
|
+
return toJsonString(obj);
|
|
53983
|
+
});
|
|
53984
|
+
Handlebars.registerHelper("yamlFrontmatter", (obj) => {
|
|
53985
|
+
return toYamlFrontmatter(obj);
|
|
53986
|
+
});
|
|
53987
|
+
Handlebars.registerHelper(
|
|
53988
|
+
"handoffPayload",
|
|
53989
|
+
(handoffType) => {
|
|
53990
|
+
return resolveHandoffPayload(handoffType ?? void 0);
|
|
53991
|
+
}
|
|
53992
|
+
);
|
|
53993
|
+
Handlebars.registerHelper(
|
|
53994
|
+
"handoffEnvelope",
|
|
53995
|
+
(handoffType, options) => {
|
|
53996
|
+
const idOverride = typeof options?.hash?.id === "string" ? options.hash.id : void 0;
|
|
53997
|
+
return buildHandoffEnvelope(handoffType ?? void 0, idOverride);
|
|
53998
|
+
}
|
|
53999
|
+
);
|
|
54786
54000
|
Handlebars.registerHelper(
|
|
54787
54001
|
"join",
|
|
54788
54002
|
(arr, separator) => {
|
|
@@ -55141,6 +54355,9 @@ var AuditConfigSchema = z19.object({
|
|
|
55141
54355
|
temperature: z19.number().min(0).max(2).optional(),
|
|
55142
54356
|
cache_dir: z19.string().optional()
|
|
55143
54357
|
}).optional();
|
|
54358
|
+
var ArtifactCoverageConfigSchema = z19.object({
|
|
54359
|
+
exclude_patterns: z19.array(z19.string()).default([])
|
|
54360
|
+
}).optional();
|
|
55144
54361
|
var AgentContractsConfigSchema = z19.object({
|
|
55145
54362
|
dsl: z19.string().optional(),
|
|
55146
54363
|
vars: z19.record(z19.string(), z19.string()).optional(),
|
|
@@ -55149,7 +54366,8 @@ var AgentContractsConfigSchema = z19.object({
|
|
|
55149
54366
|
active_guardrail_policy: z19.string().optional(),
|
|
55150
54367
|
paths: z19.record(z19.string(), z19.string()).optional(),
|
|
55151
54368
|
teams: z19.record(z19.string(), TeamConfigSchema).optional(),
|
|
55152
|
-
audit: AuditConfigSchema
|
|
54369
|
+
audit: AuditConfigSchema,
|
|
54370
|
+
artifact_coverage: ArtifactCoverageConfigSchema
|
|
55153
54371
|
}).superRefine((data, ctx) => {
|
|
55154
54372
|
if (data.dsl !== void 0 && data.teams !== void 0) {
|
|
55155
54373
|
ctx.addIssue({
|
|
@@ -55277,7 +54495,8 @@ ${issues}`,
|
|
|
55277
54495
|
activeGuardrailPolicy: void 0,
|
|
55278
54496
|
paths: void 0,
|
|
55279
54497
|
teams: resolveTeamConfigs(config.teams, configDir),
|
|
55280
|
-
audit: config.audit ?? void 0
|
|
54498
|
+
audit: config.audit ?? void 0,
|
|
54499
|
+
artifactCoverage: config.artifact_coverage ?? void 0
|
|
55281
54500
|
};
|
|
55282
54501
|
}
|
|
55283
54502
|
return {
|
|
@@ -55288,7 +54507,8 @@ ${issues}`,
|
|
|
55288
54507
|
bindings: (config.bindings ?? []).map((b3) => resolve5(configDir, b3)),
|
|
55289
54508
|
activeGuardrailPolicy: config.active_guardrail_policy,
|
|
55290
54509
|
paths: config.paths,
|
|
55291
|
-
audit: config.audit ?? void 0
|
|
54510
|
+
audit: config.audit ?? void 0,
|
|
54511
|
+
artifactCoverage: config.artifact_coverage ?? void 0
|
|
55292
54512
|
};
|
|
55293
54513
|
}
|
|
55294
54514
|
function resolveDslPath(dirArg, dirArgDefault, config) {
|
|
@@ -57064,6 +56284,155 @@ function resolveBindingRenderOutputPath(output, paths) {
|
|
|
57064
56284
|
return value !== void 0 ? value : match;
|
|
57065
56285
|
});
|
|
57066
56286
|
}
|
|
56287
|
+
|
|
56288
|
+
// src/artifact-coverage/enumerator.ts
|
|
56289
|
+
import { execSync } from "child_process";
|
|
56290
|
+
import { readdirSync } from "fs";
|
|
56291
|
+
import { join as join3 } from "path";
|
|
56292
|
+
import { minimatch } from "minimatch";
|
|
56293
|
+
function enumerateProjectFiles(cwd, excludePatterns) {
|
|
56294
|
+
const filePaths = listFiles(cwd);
|
|
56295
|
+
if (excludePatterns.length === 0) {
|
|
56296
|
+
return filePaths;
|
|
56297
|
+
}
|
|
56298
|
+
return filePaths.filter(
|
|
56299
|
+
(f2) => !excludePatterns.some((p2) => minimatch(f2, p2, { dot: true }))
|
|
56300
|
+
);
|
|
56301
|
+
}
|
|
56302
|
+
function listFiles(cwd) {
|
|
56303
|
+
try {
|
|
56304
|
+
const output = execSync("git ls-files", {
|
|
56305
|
+
encoding: "utf-8",
|
|
56306
|
+
cwd
|
|
56307
|
+
});
|
|
56308
|
+
return output.trim().split("\n").filter(Boolean);
|
|
56309
|
+
} catch {
|
|
56310
|
+
return walkDir(cwd, cwd);
|
|
56311
|
+
}
|
|
56312
|
+
}
|
|
56313
|
+
var IGNORE_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".next", "coverage"]);
|
|
56314
|
+
function walkDir(root, dir) {
|
|
56315
|
+
const results = [];
|
|
56316
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
56317
|
+
if (entry.isDirectory()) {
|
|
56318
|
+
if (IGNORE_DIRS.has(entry.name)) continue;
|
|
56319
|
+
results.push(...walkDir(root, join3(dir, entry.name)));
|
|
56320
|
+
} else {
|
|
56321
|
+
const rel = join3(dir, entry.name).slice(root.length + 1).replace(/\\/g, "/");
|
|
56322
|
+
results.push(rel);
|
|
56323
|
+
}
|
|
56324
|
+
}
|
|
56325
|
+
return results;
|
|
56326
|
+
}
|
|
56327
|
+
|
|
56328
|
+
// src/artifact-coverage/matcher.ts
|
|
56329
|
+
import { minimatch as minimatch2 } from "minimatch";
|
|
56330
|
+
function matchFileToArtifacts(filePath, artifacts) {
|
|
56331
|
+
const normalized = filePath.replace(/\\/g, "/");
|
|
56332
|
+
return Object.entries(artifacts).filter(([, art]) => {
|
|
56333
|
+
const included = art.path_patterns.some(
|
|
56334
|
+
(p2) => minimatch2(normalized, p2, { dot: true })
|
|
56335
|
+
);
|
|
56336
|
+
if (!included) return false;
|
|
56337
|
+
if (art.exclude_patterns.length === 0) return true;
|
|
56338
|
+
return !art.exclude_patterns.some(
|
|
56339
|
+
(p2) => minimatch2(normalized, p2, { dot: true })
|
|
56340
|
+
);
|
|
56341
|
+
}).map(([id]) => id);
|
|
56342
|
+
}
|
|
56343
|
+
|
|
56344
|
+
// src/artifact-coverage/reporter.ts
|
|
56345
|
+
function buildCoverageReport(files, artifacts) {
|
|
56346
|
+
const uncovered = [];
|
|
56347
|
+
const overlapping = [];
|
|
56348
|
+
const artifactHits = {};
|
|
56349
|
+
for (const id of Object.keys(artifacts)) {
|
|
56350
|
+
artifactHits[id] = 0;
|
|
56351
|
+
}
|
|
56352
|
+
for (const file of files) {
|
|
56353
|
+
const matches = matchFileToArtifacts(file, artifacts);
|
|
56354
|
+
if (matches.length === 0) {
|
|
56355
|
+
uncovered.push(file);
|
|
56356
|
+
} else if (matches.length > 1) {
|
|
56357
|
+
overlapping.push({ path: file, artifacts: matches });
|
|
56358
|
+
}
|
|
56359
|
+
for (const id of matches) {
|
|
56360
|
+
artifactHits[id] = (artifactHits[id] ?? 0) + 1;
|
|
56361
|
+
}
|
|
56362
|
+
}
|
|
56363
|
+
const totalFiles = files.length;
|
|
56364
|
+
const coveredFiles = totalFiles - uncovered.length;
|
|
56365
|
+
const coveragePercent = totalFiles === 0 ? 100 : Math.round(coveredFiles / totalFiles * 1e3) / 10;
|
|
56366
|
+
const perArtifact = {};
|
|
56367
|
+
for (const [id, info] of Object.entries(artifacts)) {
|
|
56368
|
+
perArtifact[id] = {
|
|
56369
|
+
matched_files: artifactHits[id] ?? 0,
|
|
56370
|
+
patterns: info.path_patterns
|
|
56371
|
+
};
|
|
56372
|
+
}
|
|
56373
|
+
return {
|
|
56374
|
+
summary: {
|
|
56375
|
+
total_files: totalFiles,
|
|
56376
|
+
covered_files: coveredFiles,
|
|
56377
|
+
uncovered_files: uncovered.length,
|
|
56378
|
+
overlapping_files: overlapping.length,
|
|
56379
|
+
coverage_percent: coveragePercent
|
|
56380
|
+
},
|
|
56381
|
+
uncovered: uncovered.sort(),
|
|
56382
|
+
overlapping: overlapping.sort((a3, b3) => a3.path.localeCompare(b3.path)),
|
|
56383
|
+
per_artifact: perArtifact
|
|
56384
|
+
};
|
|
56385
|
+
}
|
|
56386
|
+
function formatCoverageText(report) {
|
|
56387
|
+
const { summary } = report;
|
|
56388
|
+
const lines = [];
|
|
56389
|
+
lines.push("=== Artifact Coverage ===");
|
|
56390
|
+
lines.push("");
|
|
56391
|
+
lines.push(`Total files: ${summary.total_files}`);
|
|
56392
|
+
lines.push(
|
|
56393
|
+
`Covered: ${summary.covered_files} (${summary.coverage_percent}%)`
|
|
56394
|
+
);
|
|
56395
|
+
lines.push(
|
|
56396
|
+
`Uncovered: ${summary.uncovered_files} (${(100 - summary.coverage_percent).toFixed(1)}%)`
|
|
56397
|
+
);
|
|
56398
|
+
lines.push(
|
|
56399
|
+
`Overlapping: ${summary.overlapping_files} (${summary.total_files === 0 ? 0 : (summary.overlapping_files / summary.total_files * 100).toFixed(1)}%)`
|
|
56400
|
+
);
|
|
56401
|
+
if (report.uncovered.length > 0) {
|
|
56402
|
+
const byDir = groupByDirectory(report.uncovered);
|
|
56403
|
+
lines.push("");
|
|
56404
|
+
lines.push("--- Uncovered files (by directory) ---");
|
|
56405
|
+
for (const [dir, count] of byDir.slice(0, 10)) {
|
|
56406
|
+
lines.push(`${dir.padEnd(20)} ${count} file${count > 1 ? "s" : ""}`);
|
|
56407
|
+
}
|
|
56408
|
+
if (byDir.length > 10) {
|
|
56409
|
+
lines.push(`... and ${byDir.length - 10} more directories`);
|
|
56410
|
+
}
|
|
56411
|
+
lines.push("");
|
|
56412
|
+
lines.push("--- Uncovered files ---");
|
|
56413
|
+
for (const f2 of report.uncovered) {
|
|
56414
|
+
lines.push(f2);
|
|
56415
|
+
}
|
|
56416
|
+
}
|
|
56417
|
+
if (report.overlapping.length > 0) {
|
|
56418
|
+
lines.push("");
|
|
56419
|
+
lines.push("--- Overlapping files ---");
|
|
56420
|
+
for (const o3 of report.overlapping) {
|
|
56421
|
+
lines.push(`${o3.path} [${o3.artifacts.join(", ")}]`);
|
|
56422
|
+
}
|
|
56423
|
+
}
|
|
56424
|
+
lines.push("");
|
|
56425
|
+
return lines.join("\n");
|
|
56426
|
+
}
|
|
56427
|
+
function groupByDirectory(files) {
|
|
56428
|
+
const dirs = {};
|
|
56429
|
+
for (const f2 of files) {
|
|
56430
|
+
const parts = f2.split("/");
|
|
56431
|
+
const dir = parts.length > 1 ? parts.slice(0, -1).join("/") + "/" : "./";
|
|
56432
|
+
dirs[dir] = (dirs[dir] ?? 0) + 1;
|
|
56433
|
+
}
|
|
56434
|
+
return Object.entries(dirs).sort((a3, b3) => b3[1] - a3[1]);
|
|
56435
|
+
}
|
|
57067
56436
|
export {
|
|
57068
56437
|
AgentContractsConfigSchema,
|
|
57069
56438
|
AgentSchema,
|
|
@@ -57120,6 +56489,7 @@ export {
|
|
|
57120
56489
|
XExtensionDeclSchema,
|
|
57121
56490
|
buildArtifactContext,
|
|
57122
56491
|
buildAuditContext,
|
|
56492
|
+
buildCoverageReport,
|
|
57123
56493
|
buildGlobalContext,
|
|
57124
56494
|
buildGuardrailContext,
|
|
57125
56495
|
buildGuardrailPolicyContext,
|
|
@@ -57136,14 +56506,17 @@ export {
|
|
|
57136
56506
|
checkDriftFromConfig,
|
|
57137
56507
|
checkReferences,
|
|
57138
56508
|
computeExitCode,
|
|
56509
|
+
enumerateProjectFiles,
|
|
57139
56510
|
expandDefaults,
|
|
57140
56511
|
formatAuditResult,
|
|
57141
56512
|
formatAuditResults,
|
|
56513
|
+
formatCoverageText,
|
|
57142
56514
|
generateGuardrails,
|
|
57143
56515
|
lint,
|
|
57144
56516
|
loadBindings,
|
|
57145
56517
|
loadConfig,
|
|
57146
56518
|
loadDsl,
|
|
56519
|
+
matchFileToArtifacts,
|
|
57147
56520
|
mergeDsl,
|
|
57148
56521
|
renderFromConfig,
|
|
57149
56522
|
resolve3 as resolve,
|