@agent-ix/quoin 0.21.9 → 0.22.5
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/default-modules.yaml +18 -2
- package/dist/{advisor-BiKhR9Yp.js → advisor-BkgwDKvQ.js} +1 -1
- package/dist/auditor/audit.d.ts +23 -18
- package/dist/auditor/audit.d.ts.map +1 -1
- package/dist/auditor/index.d.ts +2 -1
- package/dist/auditor/index.d.ts.map +1 -1
- package/dist/{auditor-ww0MC62a.js → auditor-C3bSmPD_.js} +82 -65
- package/dist/{base-W7vrLi5E.js → base-CqKNs2Kd.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/advise.js +16 -15
- package/dist/commands/assurance.d.ts.map +1 -1
- package/dist/commands/assurance.js +84 -61
- package/dist/commands/catalog/list.js +2 -2
- package/dist/commands/catalog/methods.js +3 -3
- package/dist/commands/catalog/show.js +2 -2
- package/dist/commands/catalog/validate.js +2 -2
- package/dist/commands/completeness.js +2 -2
- package/dist/commands/config/doctor.d.ts.map +1 -1
- package/dist/commands/config/doctor.js +3 -3
- package/dist/commands/config/edit.d.ts.map +1 -1
- package/dist/commands/config/edit.js +3 -3
- package/dist/commands/config/get.js +1 -1
- package/dist/commands/config/set.js +1 -1
- package/dist/commands/evidence/affirm.js +6 -5
- package/dist/commands/evidence/audit.d.ts.map +1 -1
- package/dist/commands/evidence/audit.js +57 -45
- package/dist/commands/evidence/baseline.d.ts.map +1 -1
- package/dist/commands/evidence/baseline.js +52 -42
- package/dist/commands/evidence/gc.js +3 -2
- package/dist/commands/evidence/index.js +1 -1
- package/dist/commands/evidence/inspect-mocks.d.ts +16 -0
- package/dist/commands/evidence/inspect-mocks.d.ts.map +1 -0
- package/dist/commands/evidence/inspect-mocks.js +49 -0
- package/dist/commands/evidence/record.d.ts +1 -0
- package/dist/commands/evidence/record.d.ts.map +1 -1
- package/dist/commands/evidence/record.js +42 -31
- package/dist/commands/matrix.js +1 -1
- package/dist/commands/measurement/index.d.ts +7 -0
- package/dist/commands/measurement/index.d.ts.map +1 -0
- package/dist/commands/measurement/index.js +11 -0
- package/dist/commands/measurement/record.d.ts +10 -0
- package/dist/commands/measurement/record.d.ts.map +1 -0
- package/dist/commands/measurement/record.js +35 -0
- package/dist/commands/module/ensure-defaults.js +3 -3
- package/dist/commands/module/install.js +2 -2
- package/dist/commands/module/list.js +2 -2
- package/dist/commands/module/remove.js +2 -2
- package/dist/commands/report.d.ts +15 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +70 -0
- package/dist/commands/review.js +1 -1
- package/dist/commands/to-plan.js +1 -1
- package/dist/commands/update.js +2 -2
- package/dist/commands/validate.d.ts +13 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +123 -0
- package/dist/commands/write.js +3 -3
- package/dist/{completeness-BQDxME0a.js → completeness-DamWradt.js} +1 -1
- package/dist/evidence/index.d.ts +3 -2
- package/dist/evidence/index.d.ts.map +1 -1
- package/dist/evidence/mock-inspection.d.ts +16 -0
- package/dist/evidence/mock-inspection.d.ts.map +1 -0
- package/dist/evidence/store.d.ts +11 -1
- package/dist/evidence/store.d.ts.map +1 -1
- package/dist/evidence/types.d.ts +31 -0
- package/dist/evidence/types.d.ts.map +1 -1
- package/dist/{evidence-BA5vyZJk.js → evidence-DD0CHzJ0.js} +246 -316
- package/dist/{flow-command-C_dUJNm-.js → flow-command-BfFNY0Rv.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -8
- package/dist/measurement/compare.d.ts +4 -0
- package/dist/measurement/compare.d.ts.map +1 -0
- package/dist/measurement/index.d.ts +9 -0
- package/dist/measurement/index.d.ts.map +1 -0
- package/dist/measurement/plans.d.ts +4 -0
- package/dist/measurement/plans.d.ts.map +1 -0
- package/dist/measurement/portfolio.d.ts +48 -0
- package/dist/measurement/portfolio.d.ts.map +1 -0
- package/dist/measurement/profiles.d.ts +9 -0
- package/dist/measurement/profiles.d.ts.map +1 -0
- package/dist/measurement/report.d.ts +44 -0
- package/dist/measurement/report.d.ts.map +1 -0
- package/dist/measurement/store.d.ts +7 -0
- package/dist/measurement/store.d.ts.map +1 -0
- package/dist/measurement/types.d.ts +83 -0
- package/dist/measurement/types.d.ts.map +1 -0
- package/dist/measurement/validate.d.ts +9 -0
- package/dist/measurement/validate.d.ts.map +1 -0
- package/dist/measurement-CzB74Q07.js +595 -0
- package/dist/{modules-Cn9Htfp0.js → modules-ez9httBA.js} +2 -2
- package/dist/{plugins-Byi1bWLD.js → plugins-C-ta0llj.js} +1 -1
- package/dist/quire/contract.d.ts +11 -12
- package/dist/quire/contract.d.ts.map +1 -1
- package/dist/quire/exec.d.ts +10 -0
- package/dist/quire/exec.d.ts.map +1 -1
- package/dist/quire/index.d.ts +2 -2
- package/dist/quire/index.d.ts.map +1 -1
- package/dist/quire/types.d.ts +119 -1
- package/dist/quire/types.d.ts.map +1 -1
- package/dist/{quire-UzoK3Azf.js → quire-D8tCpgyA.js} +526 -499
- package/dist/schemas/coverage-v1.schema.json +919 -105
- package/dist/schemas/properties-v1.schema.json +25 -0
- package/dist/store--2sAv12X.js +219 -0
- package/dist/validators/gates.d.ts +18 -0
- package/dist/validators/gates.d.ts.map +1 -0
- package/dist/validators/index.d.ts +2 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/{version-BMXhyIie.js → version-Dg0e6CZU.js} +1 -1
- package/dist/{write-BDxILTLC.js → write-DElwS9xc.js} +1 -1
- package/package.json +22 -16
- package/skills/assurance-status-report/SKILL.md +135 -0
- package/skills/assurance-status-report/references/report-contract.md +110 -0
- package/skills/spec-architecture-evaluation/SKILL.md +30 -0
|
@@ -1,254 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var c = "runs", l = "scans", u = "mutation-score";
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/evidence/store.ts
|
|
7
|
-
function d(e) {
|
|
8
|
-
return s(e, "spec", "evidence");
|
|
9
|
-
}
|
|
10
|
-
function f(e) {
|
|
11
|
-
return s(d(e), "bindings.json");
|
|
12
|
-
}
|
|
13
|
-
function p(e) {
|
|
14
|
-
return s(d(e), "baseline.json");
|
|
15
|
-
}
|
|
16
|
-
function m(e, t, n) {
|
|
17
|
-
return s(d(e), c, t, `${g(n)}.json`);
|
|
18
|
-
}
|
|
19
|
-
function h(e, t, n) {
|
|
20
|
-
return s(d(e), l, t, `${g(n)}.json`);
|
|
21
|
-
}
|
|
22
|
-
function g(e) {
|
|
23
|
-
return e.slice(0, 12);
|
|
24
|
-
}
|
|
25
|
-
function _(e) {
|
|
26
|
-
return `${JSON.stringify(v(e), null, 2)}\n`;
|
|
27
|
-
}
|
|
28
|
-
function v(e) {
|
|
29
|
-
if (Array.isArray(e)) return e.map(v);
|
|
30
|
-
if (typeof e != "object" || !e) return e;
|
|
31
|
-
let t = {};
|
|
32
|
-
for (let n of Object.keys(e).sort()) t[n] = v(e[n]);
|
|
33
|
-
return t;
|
|
34
|
-
}
|
|
35
|
-
function y(e, n) {
|
|
36
|
-
t(o(e), { recursive: !0 }), a(e, _(n), "utf8");
|
|
37
|
-
}
|
|
38
|
-
var b = class extends Error {
|
|
39
|
-
path;
|
|
40
|
-
cause;
|
|
41
|
-
constructor(e, t) {
|
|
42
|
-
let n = t instanceof Error ? t.message : String(t);
|
|
43
|
-
super(`${e} exists but is not readable JSON: ${n}. A merge conflict in a checked-in store file is the usual cause — resolve it, or delete the file to start from an empty store.`), this.path = e, this.cause = t, this.name = "StoreReadError";
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
function x(t) {
|
|
47
|
-
if (!e(t)) return null;
|
|
48
|
-
try {
|
|
49
|
-
return JSON.parse(n(t, "utf8"));
|
|
50
|
-
} catch (e) {
|
|
51
|
-
throw new b(t, e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function S(e, t) {
|
|
55
|
-
try {
|
|
56
|
-
return x(e);
|
|
57
|
-
} catch (n) {
|
|
58
|
-
if (n instanceof b) return t.push(e), null;
|
|
59
|
-
throw n;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function ee(e, t) {
|
|
63
|
-
let n = m(e, t.suite, t.commit);
|
|
64
|
-
return y(n, {
|
|
65
|
-
...t,
|
|
66
|
-
schemaVersion: 1
|
|
67
|
-
}), n;
|
|
68
|
-
}
|
|
69
|
-
function te(e, t) {
|
|
70
|
-
let n = h(e, t.suite, t.commit);
|
|
71
|
-
return y(n, {
|
|
72
|
-
...t,
|
|
73
|
-
schemaVersion: 1
|
|
74
|
-
}), n;
|
|
75
|
-
}
|
|
76
|
-
function C(t, n) {
|
|
77
|
-
let i = s(d(t), l, n);
|
|
78
|
-
return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
|
|
79
|
-
}
|
|
80
|
-
function ne(e, t, n = []) {
|
|
81
|
-
return C(e, t).map((r) => S(h(e, t, r.replace(/\.json$/, "")), n)).filter((e) => e !== null).sort((e, t) => k(e.timestamp, t.timestamp) || k(e.commit, t.commit));
|
|
82
|
-
}
|
|
83
|
-
function w(e, t, n = []) {
|
|
84
|
-
return ne(e, t, n).at(-1) ?? null;
|
|
85
|
-
}
|
|
86
|
-
function re(e) {
|
|
87
|
-
return e.rulesEvaluated === void 0 ? null : e.rulesEvaluated === 0;
|
|
88
|
-
}
|
|
89
|
-
function T(t, n) {
|
|
90
|
-
let i = s(d(t), c, n);
|
|
91
|
-
return e(i) ? r(i).filter((e) => e.endsWith(".json")).sort() : [];
|
|
92
|
-
}
|
|
93
|
-
function E(e, t, n = []) {
|
|
94
|
-
return T(e, t).map((r) => S(m(e, t, r.replace(/\.json$/, "")), n)).filter((e) => e !== null).sort((e, t) => k(e.timestamp, t.timestamp) || k(e.commit, t.commit));
|
|
95
|
-
}
|
|
96
|
-
function D(e, t, n = []) {
|
|
97
|
-
return E(e, t, n).at(-1) ?? null;
|
|
98
|
-
}
|
|
99
|
-
function O(e) {
|
|
100
|
-
return A(e).map((t) => D(e, t)).filter((e) => e !== null);
|
|
101
|
-
}
|
|
102
|
-
function ie(e) {
|
|
103
|
-
return A(e).map((t) => w(e, t)).filter((e) => e !== null);
|
|
104
|
-
}
|
|
105
|
-
function k(e, t) {
|
|
106
|
-
return e === t ? 0 : e < t ? -1 : 1;
|
|
107
|
-
}
|
|
108
|
-
function A(t) {
|
|
109
|
-
let n = /* @__PURE__ */ new Set();
|
|
110
|
-
for (let i of [c, l]) {
|
|
111
|
-
let a = s(d(t), i);
|
|
112
|
-
if (e(a)) for (let e of r(a, { withFileTypes: !0 })) e.isDirectory() && n.add(e.name);
|
|
113
|
-
}
|
|
114
|
-
return [...n].sort();
|
|
115
|
-
}
|
|
116
|
-
function j(e) {
|
|
117
|
-
return x(f(e)) ?? {
|
|
118
|
-
schemaVersion: 1,
|
|
119
|
-
bindings: []
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function M(e, t) {
|
|
123
|
-
let n = [...t.bindings].sort(F);
|
|
124
|
-
y(f(e), {
|
|
125
|
-
schemaVersion: 1,
|
|
126
|
-
bindings: n
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function ae(e) {
|
|
130
|
-
return x(p(e));
|
|
131
|
-
}
|
|
132
|
-
function N(e, t) {
|
|
133
|
-
y(p(e), {
|
|
134
|
-
schemaVersion: 1,
|
|
135
|
-
commit: t.commit,
|
|
136
|
-
accepted: [...t.accepted].sort(k)
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
function P(e, t = !1) {
|
|
140
|
-
let n = new Set(j(e).bindings.map((e) => `${e.suite}/${g(e.commit)}.json`)), r = [];
|
|
141
|
-
for (let a of A(e)) {
|
|
142
|
-
let o = T(e, a), u = /* @__PURE__ */ new Set(), f = D(e, a);
|
|
143
|
-
f && u.add(`${g(f.commit)}.json`);
|
|
144
|
-
for (let l of o) {
|
|
145
|
-
if (u.has(l) || n.has(`${a}/${l}`)) continue;
|
|
146
|
-
let o = s(d(e), c, a, l);
|
|
147
|
-
r.push(o), t || i(o);
|
|
148
|
-
}
|
|
149
|
-
let p = C(e, a), m = /* @__PURE__ */ new Set(), h = w(e, a);
|
|
150
|
-
h && m.add(`${g(h.commit)}.json`);
|
|
151
|
-
for (let o of p) {
|
|
152
|
-
if (m.has(o) || n.has(`${a}/${o}`)) continue;
|
|
153
|
-
let c = s(d(e), l, a, o);
|
|
154
|
-
r.push(c), t || i(c);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return r.sort();
|
|
158
|
-
}
|
|
159
|
-
function F(e, t) {
|
|
160
|
-
return e.obligation === t.obligation ? e.suite === t.suite ? 0 : e.suite < t.suite ? -1 : 1 : e.obligation < t.obligation ? -1 : 1;
|
|
161
|
-
}
|
|
162
|
-
function I(e, t) {
|
|
163
|
-
let n = e.findIndex((e) => e.obligation === t.obligation && e.suite === t.suite);
|
|
164
|
-
if (n === -1) return {
|
|
165
|
-
bindings: [...e, { ...t }],
|
|
166
|
-
created: !0,
|
|
167
|
-
suspect: !1
|
|
168
|
-
};
|
|
169
|
-
let r = e[n], i = r.statementHashAtBinding !== t.statementHashAtBinding, a = {
|
|
170
|
-
...r,
|
|
171
|
-
commit: t.commit,
|
|
172
|
-
symbols: t.symbols
|
|
173
|
-
}, o = [...e];
|
|
174
|
-
return o[n] = a, {
|
|
175
|
-
bindings: o,
|
|
176
|
-
created: !1,
|
|
177
|
-
suspect: i
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
function L(e, t, n, r, i, a, o) {
|
|
181
|
-
let s = e.map((e, t) => [e, t]).filter(([e]) => e.obligation === t && (!o || e.suite === o));
|
|
182
|
-
if (s.length === 0) return {
|
|
183
|
-
bindings: e,
|
|
184
|
-
found: !1
|
|
185
|
-
};
|
|
186
|
-
let c = [...e];
|
|
187
|
-
for (let [e, t] of s) c[t] = {
|
|
188
|
-
...e,
|
|
189
|
-
statementHashAtBinding: n,
|
|
190
|
-
affirmations: [...e.affirmations ?? [], {
|
|
191
|
-
who: r,
|
|
192
|
-
commit: i,
|
|
193
|
-
note: a
|
|
194
|
-
}]
|
|
195
|
-
};
|
|
196
|
-
return {
|
|
197
|
-
bindings: c,
|
|
198
|
-
found: !0
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
//#endregion
|
|
1
|
+
import { _ as e, f as t, p as n, r, u as i, x as a, y as o } from "./store--2sAv12X.js";
|
|
2
|
+
import { readFileSync as s, readdirSync as c } from "node:fs";
|
|
3
|
+
import { extname as l, join as u, relative as d } from "node:path";
|
|
202
4
|
//#region src/evidence/record.ts
|
|
203
|
-
function
|
|
204
|
-
let
|
|
5
|
+
function f(n) {
|
|
6
|
+
let i = o(n.repo, {
|
|
205
7
|
schemaVersion: 1,
|
|
206
|
-
suite:
|
|
207
|
-
commit:
|
|
208
|
-
tool:
|
|
209
|
-
evidenceKind:
|
|
210
|
-
timestamp:
|
|
211
|
-
entries:
|
|
212
|
-
}),
|
|
213
|
-
for (let
|
|
214
|
-
let
|
|
215
|
-
for (let
|
|
216
|
-
let
|
|
217
|
-
if (
|
|
218
|
-
|
|
8
|
+
suite: n.suite,
|
|
9
|
+
commit: n.commit,
|
|
10
|
+
tool: n.tool,
|
|
11
|
+
evidenceKind: n.evidenceKind,
|
|
12
|
+
timestamp: n.timestamp,
|
|
13
|
+
entries: n.entries
|
|
14
|
+
}), a = new Map(n.obligations.map((e) => [e.id, e])), s = /* @__PURE__ */ new Map();
|
|
15
|
+
for (let e of n.obligations) for (let t of e.target_ids ?? []) a.has(t) || s.set(t, [...s.get(t) ?? [], e]);
|
|
16
|
+
let c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
|
|
17
|
+
for (let e of n.entries) for (let t of e.traceIds ?? []) {
|
|
18
|
+
let n = a.has(t) ? [a.get(t)] : s.get(t) ?? [];
|
|
19
|
+
if (n.length === 0) {
|
|
20
|
+
l.add(t);
|
|
219
21
|
continue;
|
|
220
22
|
}
|
|
221
|
-
if (
|
|
222
|
-
let n =
|
|
223
|
-
n.push(
|
|
23
|
+
if (e.outcome === "pass") for (let t of n) {
|
|
24
|
+
let n = c.get(t.id) ?? [];
|
|
25
|
+
n.push(e.symbol), c.set(t.id, n);
|
|
224
26
|
}
|
|
225
27
|
}
|
|
226
|
-
let
|
|
227
|
-
for (let [
|
|
228
|
-
let i =
|
|
28
|
+
let u = t(n.repo).bindings, d = [], f = [];
|
|
29
|
+
for (let [e, t] of [...c].sort(([e], [t]) => e === t ? 0 : e < t ? -1 : 1)) {
|
|
30
|
+
let i = a.get(e);
|
|
229
31
|
if (!i) continue;
|
|
230
|
-
let
|
|
231
|
-
obligation:
|
|
32
|
+
let o = r(u, {
|
|
33
|
+
obligation: e,
|
|
232
34
|
statementHashAtBinding: i.statement_hash,
|
|
233
|
-
suite:
|
|
234
|
-
commit:
|
|
235
|
-
symbols: [...
|
|
35
|
+
suite: n.suite,
|
|
36
|
+
commit: n.commit,
|
|
37
|
+
symbols: [...t].sort()
|
|
236
38
|
});
|
|
237
|
-
|
|
39
|
+
u = o.bindings, o.created && d.push(e), o.suspect && f.push(e);
|
|
238
40
|
}
|
|
239
|
-
return
|
|
240
|
-
runPath:
|
|
241
|
-
bound:
|
|
242
|
-
suspect:
|
|
243
|
-
unmatched: [...
|
|
41
|
+
return e(n.repo, { bindings: u }), {
|
|
42
|
+
runPath: i,
|
|
43
|
+
bound: d.sort(),
|
|
44
|
+
suspect: f.sort(),
|
|
45
|
+
unmatched: [...l].sort()
|
|
244
46
|
};
|
|
245
47
|
}
|
|
246
|
-
function
|
|
48
|
+
function p(e) {
|
|
247
49
|
return e.obligations ?? [];
|
|
248
50
|
}
|
|
249
51
|
//#endregion
|
|
250
52
|
//#region src/evidence/adapters/types.ts
|
|
251
|
-
var
|
|
53
|
+
var m = class extends Error {
|
|
252
54
|
adapter;
|
|
253
55
|
constructor(e, t) {
|
|
254
56
|
super(`${e}: ${t}`), this.adapter = e, this.name = "AdapterError";
|
|
@@ -256,11 +58,11 @@ var B = class extends Error {
|
|
|
256
58
|
};
|
|
257
59
|
//#endregion
|
|
258
60
|
//#region src/evidence/adapters/cargo-mutants.ts
|
|
259
|
-
function
|
|
61
|
+
function h(e) {
|
|
260
62
|
let t = e.file?.trim(), n = e.function?.function_name?.trim();
|
|
261
63
|
if (t !== void 0 && t !== "" && n !== void 0 && n !== "") return `${t}::${n}`;
|
|
262
64
|
}
|
|
263
|
-
var
|
|
65
|
+
var g = {
|
|
264
66
|
name: "cargo-mutants",
|
|
265
67
|
summary: "cargo-mutants outcomes.json — mutation score per mutated function.",
|
|
266
68
|
tools: ["cargo-mutants", "cargo mutants"],
|
|
@@ -269,55 +71,55 @@ var H = {
|
|
|
269
71
|
try {
|
|
270
72
|
t = JSON.parse(e);
|
|
271
73
|
} catch (e) {
|
|
272
|
-
throw new
|
|
74
|
+
throw new m("cargo-mutants", `input is not JSON: ${e.message}`);
|
|
273
75
|
}
|
|
274
|
-
if (!Array.isArray(t.outcomes)) throw new
|
|
76
|
+
if (!Array.isArray(t.outcomes)) throw new m("cargo-mutants", "no `outcomes` array — expected the contents of mutants.out/outcomes.json");
|
|
275
77
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
276
78
|
for (let e of t.outcomes) {
|
|
277
79
|
if (e.scenario === "Baseline" || typeof e.scenario != "object") continue;
|
|
278
80
|
let t = e.scenario.Mutant;
|
|
279
81
|
if (t === void 0) continue;
|
|
280
|
-
let i =
|
|
82
|
+
let i = h(t);
|
|
281
83
|
i !== void 0 && (e.summary === "CaughtMutant" ? n.set(i, (n.get(i) ?? 0) + 1) : (e.summary === "MissedMutant" || e.summary === "Timeout") && r.set(i, (r.get(i) ?? 0) + 1));
|
|
282
84
|
}
|
|
283
85
|
let i = [.../* @__PURE__ */ new Set([...n.keys(), ...r.keys()])].sort();
|
|
284
|
-
if (i.length === 0) throw new
|
|
86
|
+
if (i.length === 0) throw new m("cargo-mutants", "no viable mutants in the report — nothing was measured");
|
|
285
87
|
return { entries: i.map((e) => {
|
|
286
|
-
let t = n.get(e) ?? 0, i = r.get(e) ?? 0,
|
|
88
|
+
let t = n.get(e) ?? 0, i = r.get(e) ?? 0, o = t + i;
|
|
287
89
|
return {
|
|
288
90
|
symbol: e,
|
|
289
91
|
outcome: i === 0 ? "pass" : "fail",
|
|
290
|
-
score: t /
|
|
291
|
-
metric:
|
|
92
|
+
score: t / o,
|
|
93
|
+
metric: a
|
|
292
94
|
};
|
|
293
95
|
}) };
|
|
294
96
|
}
|
|
295
|
-
},
|
|
296
|
-
function
|
|
97
|
+
}, _ = /<testcase\b([^>]*?)(\/>|>([\s\S]*?)<\/testcase\s*>)/g, v = /([\w:.-]+)\s*=\s*"([^"]*)"/g;
|
|
98
|
+
function y(e) {
|
|
297
99
|
let t = /* @__PURE__ */ new Map();
|
|
298
|
-
for (let n of e.matchAll(
|
|
100
|
+
for (let n of e.matchAll(v)) t.set(n[1], ee(n[2]));
|
|
299
101
|
return t;
|
|
300
102
|
}
|
|
301
|
-
function
|
|
103
|
+
function ee(e) {
|
|
302
104
|
return e.replaceAll("<", "<").replaceAll(">", ">").replaceAll(""", "\"").replaceAll("'", "'").replaceAll("&", "&");
|
|
303
105
|
}
|
|
304
|
-
function
|
|
106
|
+
function b(e, t) {
|
|
305
107
|
let n = e.trim(), r = t.trim();
|
|
306
108
|
return n === "" ? r : r === "" ? n : n === r ? r : n.endsWith(`::${r}`) || n.endsWith(`.${r}`) ? n.replaceAll(".", "::") : `${n.replaceAll(".", "::")}::${r}`;
|
|
307
109
|
}
|
|
308
|
-
var
|
|
309
|
-
function
|
|
110
|
+
var x = /<property\b([^>]*)\/?>/g;
|
|
111
|
+
function S(e) {
|
|
310
112
|
let t = [];
|
|
311
|
-
for (let n of e.matchAll(
|
|
312
|
-
let e =
|
|
113
|
+
for (let n of e.matchAll(x)) {
|
|
114
|
+
let e = y(n[1]), r = e.get("name"), i = e.get("value");
|
|
313
115
|
if (r !== void 0 && i !== void 0 && (r === "trace" || r === "traceIds" || r === "trace_ids")) for (let e of i.split(/[,\s]+/)) e !== "" && t.push(e);
|
|
314
116
|
}
|
|
315
117
|
return t.length > 0 ? t : void 0;
|
|
316
118
|
}
|
|
317
|
-
function
|
|
119
|
+
function C(e) {
|
|
318
120
|
return /<error\b/.test(e) ? "error" : /<failure\b/.test(e) ? "fail" : /<skipped\b/.test(e) ? "skip" : "pass";
|
|
319
121
|
}
|
|
320
|
-
var
|
|
122
|
+
var w = {
|
|
321
123
|
name: "junit",
|
|
322
124
|
summary: "JUnit XML (<testsuite>/<testcase>), as emitted by most runners.",
|
|
323
125
|
tools: [
|
|
@@ -330,34 +132,34 @@ var ce = {
|
|
|
330
132
|
],
|
|
331
133
|
parse(e) {
|
|
332
134
|
let t = [];
|
|
333
|
-
for (let n of e.matchAll(
|
|
334
|
-
let e =
|
|
135
|
+
for (let n of e.matchAll(_)) {
|
|
136
|
+
let e = y(n[1]), r = n[3] ?? "", i = b(e.get("classname") ?? "", e.get("name") ?? "");
|
|
335
137
|
if (i === "") continue;
|
|
336
|
-
let a =
|
|
138
|
+
let a = S(r);
|
|
337
139
|
t.push({
|
|
338
140
|
symbol: i,
|
|
339
|
-
outcome:
|
|
141
|
+
outcome: C(r),
|
|
340
142
|
...a === void 0 ? {} : { traceIds: a }
|
|
341
143
|
});
|
|
342
144
|
}
|
|
343
|
-
if (t.length === 0) throw new
|
|
145
|
+
if (t.length === 0) throw new m("junit", "no <testcase> elements found — is this JUnit XML?");
|
|
344
146
|
return { entries: t };
|
|
345
147
|
}
|
|
346
|
-
},
|
|
347
|
-
function
|
|
348
|
-
let t =
|
|
148
|
+
}, T = /^([A-Za-z0-9._-]+):\s*(OK|FAIL)\b\s*(?:[—-]\s*)?(.*)$/, E = /\(([^)]*)\)[.\s]*$/, D = /\b((?:FR|NFR|StR|US)-\d+-AC-\d+|TC-\d+)\b/g;
|
|
149
|
+
function O(e) {
|
|
150
|
+
let t = E.exec(e);
|
|
349
151
|
if (!t) return;
|
|
350
|
-
let n = [...t[1].matchAll(
|
|
152
|
+
let n = [...t[1].matchAll(D)].map((e) => e[1]);
|
|
351
153
|
return n.length > 0 ? n : void 0;
|
|
352
154
|
}
|
|
353
|
-
function
|
|
155
|
+
function k(e) {
|
|
354
156
|
let t = [], n = 0;
|
|
355
157
|
for (let r of e.split("\n")) {
|
|
356
|
-
let e =
|
|
158
|
+
let e = T.exec(r.trim());
|
|
357
159
|
if (!e) continue;
|
|
358
160
|
let [, i, a, o] = e;
|
|
359
161
|
if (n += 1, a === "OK") continue;
|
|
360
|
-
let s = o.trim(), c =
|
|
162
|
+
let s = o.trim(), c = O(s);
|
|
361
163
|
t.push({
|
|
362
164
|
ruleId: i,
|
|
363
165
|
severity: "violation",
|
|
@@ -365,7 +167,7 @@ function pe(e) {
|
|
|
365
167
|
...c === void 0 ? {} : { traceIds: c }
|
|
366
168
|
});
|
|
367
169
|
}
|
|
368
|
-
if (n === 0) throw new
|
|
170
|
+
if (n === 0) throw new m("audit-script", "no `<name>: OK` or `<name>: FAIL` line found — is this audit-script output?");
|
|
369
171
|
return {
|
|
370
172
|
findings: t,
|
|
371
173
|
tool: "audit-script",
|
|
@@ -374,15 +176,15 @@ function pe(e) {
|
|
|
374
176
|
}
|
|
375
177
|
//#endregion
|
|
376
178
|
//#region src/evidence/adapters/agent-eval.ts
|
|
377
|
-
function
|
|
179
|
+
function A(e) {
|
|
378
180
|
let t;
|
|
379
181
|
try {
|
|
380
182
|
t = JSON.parse(e);
|
|
381
183
|
} catch (e) {
|
|
382
|
-
throw new
|
|
184
|
+
throw new m("agent-eval", `not JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
383
185
|
}
|
|
384
186
|
let n = t;
|
|
385
|
-
if (!n || typeof n != "object" || !Array.isArray(n.results)) throw new
|
|
187
|
+
if (!n || typeof n != "object" || !Array.isArray(n.results)) throw new m("agent-eval", "expected a cli-agent-evals report with a \"results\" array");
|
|
386
188
|
let r = [];
|
|
387
189
|
for (let e of n.results) {
|
|
388
190
|
let t = typeof e.id == "string" ? e.id : null;
|
|
@@ -390,19 +192,19 @@ function me(e) {
|
|
|
390
192
|
symbol: t,
|
|
391
193
|
outcome: e.ok === !0 ? "pass" : "fail",
|
|
392
194
|
traceIds: [t],
|
|
393
|
-
...
|
|
195
|
+
...j(e)
|
|
394
196
|
});
|
|
395
197
|
}
|
|
396
|
-
if (r.length === 0) throw new
|
|
198
|
+
if (r.length === 0) throw new m("agent-eval", "no scenario results in the report — did the suite run?");
|
|
397
199
|
return { entries: r };
|
|
398
200
|
}
|
|
399
|
-
function
|
|
201
|
+
function j(e) {
|
|
400
202
|
let t = e.passRate;
|
|
401
203
|
if (typeof t != "string") return {};
|
|
402
204
|
let [n, r] = t.split("/").map(Number);
|
|
403
205
|
return !Number.isFinite(n) || !Number.isFinite(r) || r === 0 ? {} : { score: n / r };
|
|
404
206
|
}
|
|
405
|
-
var
|
|
207
|
+
var M = {
|
|
406
208
|
name: "agent-eval",
|
|
407
209
|
summary: "cli-agent-evals report JSON — one entry per scenario, keyed on the scenario id.",
|
|
408
210
|
tools: [
|
|
@@ -410,22 +212,22 @@ var ge = {
|
|
|
410
212
|
"agent-evals",
|
|
411
213
|
"agent-pty"
|
|
412
214
|
],
|
|
413
|
-
parse:
|
|
215
|
+
parse: A
|
|
414
216
|
};
|
|
415
217
|
//#endregion
|
|
416
218
|
//#region src/evidence/adapters/sbom.ts
|
|
417
|
-
function
|
|
219
|
+
function N(e) {
|
|
418
220
|
let t;
|
|
419
221
|
try {
|
|
420
222
|
t = JSON.parse(e);
|
|
421
223
|
} catch (e) {
|
|
422
|
-
throw new
|
|
224
|
+
throw new m("sbom", `not JSON: ${e instanceof Error ? e.message : String(e)}. CycloneDX and SPDX both have JSON serialisations; the tag-value SPDX form is not read here.`);
|
|
423
225
|
}
|
|
424
|
-
if (!t || typeof t != "object") throw new
|
|
226
|
+
if (!t || typeof t != "object") throw new m("sbom", "expected a JSON object");
|
|
425
227
|
let n = t;
|
|
426
|
-
return { entries:
|
|
228
|
+
return { entries: P(n) ?? F(n) ?? te(n) };
|
|
427
229
|
}
|
|
428
|
-
function
|
|
230
|
+
function P(e) {
|
|
429
231
|
return String(e.bomFormat ?? "") === "CycloneDX" ? (Array.isArray(e.components) ? e.components : []).map((e) => {
|
|
430
232
|
let t = e, n = typeof t.purl == "string" ? t.purl : null, r = typeof t.name == "string" ? t.name : null;
|
|
431
233
|
if (!n && !r) return null;
|
|
@@ -436,7 +238,7 @@ function Y(e) {
|
|
|
436
238
|
};
|
|
437
239
|
}).filter((e) => e !== null) : null;
|
|
438
240
|
}
|
|
439
|
-
function
|
|
241
|
+
function F(e) {
|
|
440
242
|
return typeof e.spdxVersion == "string" ? (Array.isArray(e.packages) ? e.packages : []).map((e) => {
|
|
441
243
|
let t = e, n = (Array.isArray(t.externalRefs) ? t.externalRefs : []).map((e) => e).find((e) => String(e.referenceType ?? "") === "purl"), r = n && typeof n.referenceLocator == "string" ? n.referenceLocator : null, i = typeof t.name == "string" ? t.name : null;
|
|
442
244
|
if (!r && !i) return null;
|
|
@@ -447,10 +249,10 @@ function ve(e) {
|
|
|
447
249
|
};
|
|
448
250
|
}).filter((e) => e !== null) : null;
|
|
449
251
|
}
|
|
450
|
-
function
|
|
451
|
-
throw new
|
|
252
|
+
function te(e) {
|
|
253
|
+
throw new m("sbom", `neither a CycloneDX (\`bomFormat\`) nor an SPDX (\`spdxVersion\`) document — top-level keys: ${Object.keys(e).slice(0, 6).join(", ") || "(none)"}`);
|
|
452
254
|
}
|
|
453
|
-
var
|
|
255
|
+
var I = {
|
|
454
256
|
name: "sbom",
|
|
455
257
|
summary: "CycloneDX or SPDX JSON — one entry per component, so an empty inventory reads as vacuous.",
|
|
456
258
|
tools: [
|
|
@@ -460,19 +262,19 @@ var be = {
|
|
|
460
262
|
"cdxgen",
|
|
461
263
|
"cargo-cyclonedx"
|
|
462
264
|
],
|
|
463
|
-
parse:
|
|
265
|
+
parse: N
|
|
464
266
|
};
|
|
465
267
|
//#endregion
|
|
466
268
|
//#region src/evidence/adapters/sarif.ts
|
|
467
|
-
function
|
|
269
|
+
function L(e) {
|
|
468
270
|
let t;
|
|
469
271
|
try {
|
|
470
272
|
t = JSON.parse(e);
|
|
471
273
|
} catch (e) {
|
|
472
|
-
throw new
|
|
274
|
+
throw new m("sarif", `input is not JSON: ${e.message}`);
|
|
473
275
|
}
|
|
474
|
-
if (!Array.isArray(t.runs)) throw new
|
|
475
|
-
if (t.runs.length === 0) throw new
|
|
276
|
+
if (!Array.isArray(t.runs)) throw new m("sarif", "no `runs` array — expected a SARIF 2.1.0 log");
|
|
277
|
+
if (t.runs.length === 0) throw new m("sarif", "`runs` is empty — a log with no run proves no scan executed");
|
|
476
278
|
let n = [], r = [], i;
|
|
477
279
|
for (let e of t.runs) {
|
|
478
280
|
let t = e.tool?.driver;
|
|
@@ -496,14 +298,14 @@ function xe(e) {
|
|
|
496
298
|
...i === void 0 ? {} : { rulesEvaluated: i }
|
|
497
299
|
};
|
|
498
300
|
}
|
|
499
|
-
function
|
|
301
|
+
function R(e) {
|
|
500
302
|
let t;
|
|
501
303
|
try {
|
|
502
304
|
t = JSON.parse(e);
|
|
503
305
|
} catch (e) {
|
|
504
|
-
throw new
|
|
306
|
+
throw new m("cargo-audit", `input is not JSON: ${e.message}`);
|
|
505
307
|
}
|
|
506
|
-
if (t.vulnerabilities === void 0) throw new
|
|
308
|
+
if (t.vulnerabilities === void 0) throw new m("cargo-audit", "no `vulnerabilities` object — expected `cargo audit --json` output");
|
|
507
309
|
let n = [], r = (e, t) => {
|
|
508
310
|
let r = e.advisory?.id;
|
|
509
311
|
if (r === void 0 || r === "") return;
|
|
@@ -526,7 +328,7 @@ function Se(e) {
|
|
|
526
328
|
}
|
|
527
329
|
//#endregion
|
|
528
330
|
//#region src/evidence/adapters/registry.ts
|
|
529
|
-
var
|
|
331
|
+
var z = {
|
|
530
332
|
name: "entries",
|
|
531
333
|
summary: "Normalized {\"entries\": [{symbol, outcome, traceIds?}]} — the default.",
|
|
532
334
|
tools: [],
|
|
@@ -535,18 +337,18 @@ var X = {
|
|
|
535
337
|
try {
|
|
536
338
|
t = JSON.parse(e);
|
|
537
339
|
} catch (e) {
|
|
538
|
-
throw new
|
|
340
|
+
throw new m("entries", `input is not JSON: ${e.message}`);
|
|
539
341
|
}
|
|
540
|
-
if (!Array.isArray(t.entries)) throw new
|
|
342
|
+
if (!Array.isArray(t.entries)) throw new m("entries", "expected JSON of the form {\"entries\": [{symbol, outcome, traceIds?}]}");
|
|
541
343
|
return { entries: t.entries };
|
|
542
344
|
}
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
],
|
|
345
|
+
}, B = [
|
|
346
|
+
z,
|
|
347
|
+
w,
|
|
348
|
+
g,
|
|
349
|
+
I,
|
|
350
|
+
M
|
|
351
|
+
], V = [
|
|
550
352
|
{
|
|
551
353
|
name: "sarif",
|
|
552
354
|
summary: "SARIF 2.1.0 — semgrep --sarif, CodeQL, ESLint, ZAP via converter.",
|
|
@@ -555,7 +357,7 @@ var X = {
|
|
|
555
357
|
"semgrep",
|
|
556
358
|
"codeql"
|
|
557
359
|
],
|
|
558
|
-
parse:
|
|
360
|
+
parse: L
|
|
559
361
|
},
|
|
560
362
|
{
|
|
561
363
|
name: "audit-script",
|
|
@@ -567,7 +369,7 @@ var X = {
|
|
|
567
369
|
"import-linter",
|
|
568
370
|
"dependency-cruiser"
|
|
569
371
|
],
|
|
570
|
-
parse:
|
|
372
|
+
parse: k
|
|
571
373
|
},
|
|
572
374
|
{
|
|
573
375
|
name: "cargo-audit",
|
|
@@ -578,26 +380,154 @@ var X = {
|
|
|
578
380
|
"cargo-deny",
|
|
579
381
|
"cargo deny"
|
|
580
382
|
],
|
|
581
|
-
parse:
|
|
383
|
+
parse: R
|
|
582
384
|
}
|
|
583
|
-
],
|
|
584
|
-
function
|
|
585
|
-
if (e.adapter !== void 0 && e.adapter !== "") return
|
|
385
|
+
], H = [...B.map((e) => e.name), ...V.map((e) => e.name)];
|
|
386
|
+
function U(e) {
|
|
387
|
+
if (e.adapter !== void 0 && e.adapter !== "") return V.find((t) => t.name === e.adapter);
|
|
586
388
|
let t = (e.tool ?? "").toLowerCase();
|
|
587
|
-
if (t !== "") return
|
|
389
|
+
if (t !== "") return V.find((e) => e.tools.some((e) => t.includes(e)));
|
|
588
390
|
}
|
|
589
|
-
function
|
|
391
|
+
function W(e) {
|
|
590
392
|
if (e.adapter !== void 0 && e.adapter !== "") {
|
|
591
|
-
let t =
|
|
592
|
-
if (t === void 0) throw new
|
|
393
|
+
let t = B.find((t) => t.name === e.adapter);
|
|
394
|
+
if (t === void 0) throw new m("adapter", `unknown adapter '${e.adapter}'. Available: ${H.join(", ")}`);
|
|
593
395
|
return t;
|
|
594
396
|
}
|
|
595
397
|
let t = (e.tool ?? "").toLowerCase();
|
|
596
398
|
if (t !== "") {
|
|
597
|
-
let e =
|
|
399
|
+
let e = B.find((e) => e.tools.some((e) => t.includes(e)));
|
|
598
400
|
if (e !== void 0) return e;
|
|
599
401
|
}
|
|
600
|
-
return
|
|
402
|
+
return z;
|
|
403
|
+
}
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/evidence/mock-inspection.ts
|
|
406
|
+
var G = /* @__PURE__ */ new Set([
|
|
407
|
+
".rs",
|
|
408
|
+
".py",
|
|
409
|
+
".ts",
|
|
410
|
+
".tsx",
|
|
411
|
+
".js",
|
|
412
|
+
".jsx"
|
|
413
|
+
]), K = /* @__PURE__ */ new Set([
|
|
414
|
+
".git",
|
|
415
|
+
"dist",
|
|
416
|
+
"node_modules",
|
|
417
|
+
"spec",
|
|
418
|
+
"target",
|
|
419
|
+
"vendor"
|
|
420
|
+
]);
|
|
421
|
+
function q(e, t) {
|
|
422
|
+
if (!t) return {
|
|
423
|
+
injections: [],
|
|
424
|
+
suites: []
|
|
425
|
+
};
|
|
426
|
+
let r = i(e).map((r) => n(e, r, t)).filter((e) => e !== null && e.commit === t);
|
|
427
|
+
return {
|
|
428
|
+
suites: r.map((e) => e.suite).sort($),
|
|
429
|
+
injections: r.flatMap((e) => e.injections).sort((e, t) => $(e.suite, t.suite) || $(e.path ?? "", t.path ?? "") || (e.line ?? 0) - (t.line ?? 0))
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
function J(e, t) {
|
|
433
|
+
let n = [];
|
|
434
|
+
for (let r of Y(e)) {
|
|
435
|
+
let i = s(r, "utf8"), a = X(i, l(r));
|
|
436
|
+
if (a.length !== 0) for (let o of i.matchAll(/\b([A-Z][A-Za-z0-9_]*(?:(?:::|\.)[A-Za-z_][A-Za-z0-9_]*)+)\s*\(/g)) {
|
|
437
|
+
let s = o[1];
|
|
438
|
+
if (!re(s)) continue;
|
|
439
|
+
let c = Z(a, o.index ?? -1);
|
|
440
|
+
c && n.push({
|
|
441
|
+
suite: t,
|
|
442
|
+
symbol: c.symbol,
|
|
443
|
+
injects: [s],
|
|
444
|
+
path: d(e, r),
|
|
445
|
+
line: i.slice(0, o.index).split("\n").length
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
let r = /* @__PURE__ */ new Map();
|
|
450
|
+
for (let e of n) {
|
|
451
|
+
let t = `${e.path ?? ""}:${e.line ?? 0}:${e.symbol}`, n = r.get(t);
|
|
452
|
+
n ? n.injects = [.../* @__PURE__ */ new Set([...n.injects, ...e.injects])].sort() : r.set(t, {
|
|
453
|
+
...e,
|
|
454
|
+
injects: [...e.injects].sort()
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
return [...r.values()].sort((e, t) => $(e.path ?? "", t.path ?? "") || (e.line ?? 0) - (t.line ?? 0) || $(e.symbol, t.symbol));
|
|
458
|
+
}
|
|
459
|
+
function Y(e) {
|
|
460
|
+
let t = [], n = (e) => {
|
|
461
|
+
for (let r of c(e, { withFileTypes: !0 })) {
|
|
462
|
+
if (r.isDirectory() && K.has(r.name)) continue;
|
|
463
|
+
let i = u(e, r.name);
|
|
464
|
+
r.isDirectory() ? n(i) : r.isFile() && G.has(l(i)) && t.push(i);
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
return n(e), t.sort($);
|
|
468
|
+
}
|
|
469
|
+
function X(e, t) {
|
|
470
|
+
let n = [], r = t === ".rs" ? [/#\s*\[\s*test\s*\][\s\S]{0,240}?\bfn\s+([A-Za-z_][A-Za-z0-9_]*)\s*\(/g] : t === ".py" ? [/(?:^|\n)\s*(?:async\s+)?def\s+(test_[A-Za-z0-9_]*)\s*\(/g] : [/\b(?:test|it)\s*\(\s*["'`]([^"'`]+)["'`]/g, /\b(?:async\s+)?function\s+(test[A-Za-z0-9_]*)\s*\(/g];
|
|
471
|
+
for (let i of r) for (let r of e.matchAll(i)) {
|
|
472
|
+
let i = r.index ?? 0, a = t === ".py" ? i + r[0].lastIndexOf(r[1]) : i, o = t === ".py" ? Q(e, a) : ne(e, a + r[0].length);
|
|
473
|
+
n.push({
|
|
474
|
+
at: a,
|
|
475
|
+
end: o,
|
|
476
|
+
symbol: r[1]
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
return n.sort((e, t) => e.at - t.at);
|
|
480
|
+
}
|
|
481
|
+
function Z(e, t) {
|
|
482
|
+
let n = null;
|
|
483
|
+
for (let r of e) {
|
|
484
|
+
if (r.at > t) break;
|
|
485
|
+
t <= r.end && (n = r);
|
|
486
|
+
}
|
|
487
|
+
return n;
|
|
488
|
+
}
|
|
489
|
+
function Q(e, t) {
|
|
490
|
+
let n = e.lastIndexOf("\n", t) + 1, r = /^\s*/.exec(e.slice(n))?.[0].length ?? 0, i = e.indexOf("\n", t);
|
|
491
|
+
if (i < 0) return e.length;
|
|
492
|
+
for (i += 1; i < e.length;) {
|
|
493
|
+
let t = e.indexOf("\n", i), n = t < 0 ? e.length : t, a = e.slice(i, n);
|
|
494
|
+
if (a.trim() && !a.trimStart().startsWith("#") && (/^\s*/.exec(a)?.[0].length ?? 0) <= r) return i - 1;
|
|
495
|
+
i = n + 1;
|
|
496
|
+
}
|
|
497
|
+
return e.length;
|
|
498
|
+
}
|
|
499
|
+
function ne(e, t) {
|
|
500
|
+
let n = e.indexOf("{", t);
|
|
501
|
+
if (n < 0 || n - t > 500) return t;
|
|
502
|
+
let r = 0, i = null, a = !1, o = !1, s = !1;
|
|
503
|
+
for (let t = n; t < e.length; t += 1) {
|
|
504
|
+
let n = e[t], c = e[t + 1] ?? "";
|
|
505
|
+
if (o) {
|
|
506
|
+
n === "\n" && (o = !1);
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
if (s) {
|
|
510
|
+
n === "*" && c === "/" && (s = !1, t += 1);
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
if (i) {
|
|
514
|
+
a ? a = !1 : n === "\\" ? a = !0 : n === i && (i = null);
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
if (n === "/" && c === "/") o = !0, t += 1;
|
|
518
|
+
else if (n === "/" && c === "*") s = !0, t += 1;
|
|
519
|
+
else if (n === "\"" || n === "'" || n === "`") i = n;
|
|
520
|
+
else if (n === "{") r += 1;
|
|
521
|
+
else if (n === "}" && --r === 0) return t;
|
|
522
|
+
}
|
|
523
|
+
return e.length;
|
|
524
|
+
}
|
|
525
|
+
function re(e) {
|
|
526
|
+
let t = e.split(/::|\./), n = t[0], r = t.at(-1) ?? "";
|
|
527
|
+
return /^(?:mock|fake|stub|spy)/i.test(n) || /^(?:allow|approve|approved|bypass|fake|mock|stub|succeed|success)$/i.test(r);
|
|
528
|
+
}
|
|
529
|
+
function $(e, t) {
|
|
530
|
+
return e === t ? 0 : e < t ? -1 : 1;
|
|
601
531
|
}
|
|
602
532
|
//#endregion
|
|
603
|
-
export {
|
|
533
|
+
export { U as a, W as i, q as n, p as o, H as r, f as s, J as t };
|