@far-world-labs/verblets 0.6.4 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -4
- package/dist/index.browser.js +217 -221
- package/dist/index.js +768 -736
- package/dist/shared-CNTi6iN9.js +13472 -0
- package/package.json +2 -2
- package/dist/shared-CsrVgt_K.js +0 -11483
package/dist/index.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
1
|
+
import pe from "dotenv";
|
|
2
|
+
import { i as de, n as B, c as z, g as se, E as q, a as me, O as L, r as W, j as O, b as he, w as V, D as P, d as C, e as R, s as ae, f as ge, h as fe, k as be, l as ye, p as we } from "./shared-CNTi6iN9.js";
|
|
3
|
+
import { cP as Mt, L as Nt, I as $t, M as Bt, b$ as zt, aL as Ot, bZ as Ut, aH as _t, K as jt, J as qt, cN as Vt, c6 as Wt, c1 as Gt, c2 as Ht, an as Jt, cM as Kt, c4 as Xt, c5 as Qt, Q as Yt, c7 as Zt, b1 as es, c3 as ts, b4 as ss, c0 as as, bT as rs, bl as ns, bg as os, bh as is, bS as cs, a4 as ls, a3 as us, bj as ps, u as ds, aE as ms, bi as hs, aa as gs, F as fs, H as bs, G as ys, bP as ws, aD as vs, be as xs, a6 as Ss, a7 as ks, cu as Cs, bM as Is, x as As, m as Es, bY as Ps, aF as Ts, bK as Rs, aG as Ds, cv as Ls, b6 as Fs, cR as Ms, t as Ns, aI as $s, cw as Bs, bO as zs, N as Os, W as Us, v as _s, bN as js, U as qs, a8 as Vs, a9 as Ws, ao as Gs, aJ as Hs, aM as Js, aO as Ks, br as Xs, bI as Qs, bs as Ys, bG as Zs, bt as ea, bw as ta, bx as sa, bH as aa, bA as ra, bF as na, bE as oa, cK as ia, bz as ca, bD as la, bJ as ua, bB as pa, bC as da, bu as ma, ad as ha, ac as ga, a1 as fa, a2 as ba, X as ya, bk as wa, ae as va, ab as xa, cl as Sa, aX as ka, aP as Ca, af as Ia, aQ as Aa, ce as Ea, ag as Pa, cf as Ta, al as Ra, aK as Da, S as La, T as Fa, ah as Ma, ai as Na, ch as $a, cQ as Ba, bm as za, aj as Oa, aR as Ua, cx as _a, ak as ja, am as qa, ap as Va, bn as Wa, bo as Ga, aq as Ha, cd as Ja, aB as Ka, aS as Xa, aT as Qa, bV as Ya, bQ as Za, aw as er, y as tr, z as sr, P as ar, R as rr, cy as nr, c9 as or, ca as ir, cc as cr, c8 as lr, cb as ur, bR as pr, ct as dr, aZ as mr, a_ as hr, aU as gr, bo as fr, cz as br, cF as yr, aV as wr, cI as vr, cJ as xr, cG as Sr, aW as kr, bL as Cr, cg as Ir, a$ as Ar, aY as Er, cO as Pr, cL as Tr, o as Rr, b_ as Dr, C as Lr, A as Fr, B as Mr, b0 as Nr, cH as $r, bd as Br, ar as zr, by as Or, au as Ur, at as _r, av as jr, ax as qr, as as Vr, bp as Wr, bv as Gr, q as Hr, bq as Jr, cE as Kr, aN as Xr, bX as Qr, b2 as Yr, bf as Zr, ay as en, cA as tn, b3 as sn, cn as an, cm as rn, a5 as nn, aC as on, az as cn, aA as ln, b5 as un, Z as pn, _ as dn, Y as mn, a0 as hn, bW as gn, bU as fn, b7 as bn, b8 as yn, co as wn, cq as vn, cr as xn, cp as Sn, cs as kn, b9 as Cn, ba as In, cB as An, $ as En, V as Pn, cC as Tn, bc as Rn, bb as Dn, ci as Ln, cj as Fn, ck as Mn, cD as Nn } from "./shared-CNTi6iN9.js";
|
|
4
|
+
import * as J from "playwright-core";
|
|
5
|
+
import k from "node:fs";
|
|
6
6
|
import "node:path";
|
|
7
7
|
import "glob";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
low: { width: 300, quality:
|
|
11
|
-
med: { width: 100, quality:
|
|
12
|
-
high: { width: 50, quality:
|
|
13
|
-
})[t],
|
|
8
|
+
import ve from "node:fs/promises";
|
|
9
|
+
const U = 60, xe = (t) => ({
|
|
10
|
+
low: { width: 300, quality: U, format: "jpeg" },
|
|
11
|
+
med: { width: 100, quality: U, format: "jpeg" },
|
|
12
|
+
high: { width: 50, quality: U, format: "jpeg" }
|
|
13
|
+
})[t], G = (t) => () => {
|
|
14
14
|
throw new Error(`${t} is not available in browser environment`);
|
|
15
|
-
},
|
|
15
|
+
}, Et = G("resizeImage"), Pt = G("tileImages"), Tt = G("imageToBase64"), Rt = () => {
|
|
16
16
|
throw new Error("webScrape is not available in browser environment");
|
|
17
|
-
},
|
|
17
|
+
}, Se = async (t, a) => (await t.evaluate(() => {
|
|
18
18
|
const s = /* @__PURE__ */ new Set();
|
|
19
|
-
return [...document.querySelectorAll("a[href]")].map((
|
|
20
|
-
const
|
|
21
|
-
if (s.has(
|
|
22
|
-
s.add(
|
|
23
|
-
const
|
|
19
|
+
return [...document.querySelectorAll("a[href]")].map((r) => {
|
|
20
|
+
const i = r.href;
|
|
21
|
+
if (s.has(i)) return;
|
|
22
|
+
s.add(i);
|
|
23
|
+
const o = r.getBoundingClientRect();
|
|
24
24
|
return {
|
|
25
|
-
href:
|
|
26
|
-
text:
|
|
27
|
-
ariaLabel:
|
|
28
|
-
rel:
|
|
29
|
-
target:
|
|
30
|
-
isVisible:
|
|
31
|
-
classes:
|
|
25
|
+
href: i,
|
|
26
|
+
text: r.textContent?.trim()?.slice(0, 120) || "",
|
|
27
|
+
ariaLabel: r.getAttribute("aria-label") || "",
|
|
28
|
+
rel: r.getAttribute("rel") || "",
|
|
29
|
+
target: r.getAttribute("target") || "",
|
|
30
|
+
isVisible: o.width > 0 && o.height > 0,
|
|
31
|
+
classes: r.className?.slice?.(0, 120) || "",
|
|
32
32
|
dataAttrs: Object.fromEntries(
|
|
33
|
-
[...
|
|
33
|
+
[...r.attributes].filter((n) => n.name.startsWith("data-")).map((n) => [n.name, n.value?.slice(0, 80)])
|
|
34
34
|
),
|
|
35
|
-
inNav: !!
|
|
36
|
-
inFooter: !!
|
|
37
|
-
inMain: !!
|
|
35
|
+
inNav: !!r.closest('nav, [role="navigation"], header'),
|
|
36
|
+
inFooter: !!r.closest("footer"),
|
|
37
|
+
inMain: !!r.closest('main, [role="main"], #main, .main-content')
|
|
38
38
|
};
|
|
39
39
|
}).filter(Boolean);
|
|
40
40
|
})).map((s) => ({
|
|
@@ -42,7 +42,7 @@ const N = 60, de = (t) => ({
|
|
|
42
42
|
isExternal: !s.href.startsWith(a),
|
|
43
43
|
isSameDomain: s.href.startsWith(a),
|
|
44
44
|
isAnchor: s.href.includes("#") && new URL(s.href).pathname === new URL(t.url()).pathname
|
|
45
|
-
})),
|
|
45
|
+
})), ke = (t) => t.evaluate(
|
|
46
46
|
() => [...document.querySelectorAll("form")].map((a) => ({
|
|
47
47
|
action: a.action || "",
|
|
48
48
|
method: (a.method || "GET").toUpperCase(),
|
|
@@ -67,7 +67,7 @@ const N = 60, de = (t) => ({
|
|
|
67
67
|
})) : void 0
|
|
68
68
|
}))
|
|
69
69
|
}))
|
|
70
|
-
),
|
|
70
|
+
), Ce = (t) => t.evaluate(() => {
|
|
71
71
|
const a = [
|
|
72
72
|
...document.querySelectorAll(
|
|
73
73
|
'button, [role="button"], input[type="button"], input[type="submit"]'
|
|
@@ -75,25 +75,25 @@ const N = 60, de = (t) => ({
|
|
|
75
75
|
], e = [
|
|
76
76
|
...document.querySelectorAll("[onclick], [data-action], [data-toggle], [data-target]")
|
|
77
77
|
];
|
|
78
|
-
return [.../* @__PURE__ */ new Set([...a, ...e])].map((
|
|
79
|
-
const
|
|
78
|
+
return [.../* @__PURE__ */ new Set([...a, ...e])].map((r) => {
|
|
79
|
+
const i = r.getBoundingClientRect();
|
|
80
80
|
return {
|
|
81
|
-
tag:
|
|
82
|
-
type:
|
|
83
|
-
text:
|
|
84
|
-
id:
|
|
85
|
-
classes: (typeof
|
|
86
|
-
ariaLabel:
|
|
87
|
-
isVisible:
|
|
88
|
-
disabled:
|
|
89
|
-
hasOnclick: !!
|
|
90
|
-
onclick:
|
|
81
|
+
tag: r.tagName.toLowerCase(),
|
|
82
|
+
type: r.type || "",
|
|
83
|
+
text: r.textContent?.trim()?.slice(0, 80) || "",
|
|
84
|
+
id: r.id || "",
|
|
85
|
+
classes: (typeof r.className == "string" ? r.className : r.className?.baseVal || "").slice(0, 120),
|
|
86
|
+
ariaLabel: r.getAttribute("aria-label") || "",
|
|
87
|
+
isVisible: i.width > 0 && i.height > 0,
|
|
88
|
+
disabled: r.disabled || r.getAttribute("aria-disabled") === "true",
|
|
89
|
+
hasOnclick: !!r.getAttribute("onclick"),
|
|
90
|
+
onclick: r.getAttribute("onclick")?.slice(0, 120) || "",
|
|
91
91
|
dataAttrs: Object.fromEntries(
|
|
92
|
-
[...
|
|
92
|
+
[...r.attributes].filter((o) => o.name.startsWith("data-")).map((o) => [o.name, o.value?.slice(0, 80)])
|
|
93
93
|
)
|
|
94
94
|
};
|
|
95
95
|
});
|
|
96
|
-
}),
|
|
96
|
+
}), Ie = (t) => t.evaluate(() => [...document.querySelectorAll("script")].map((e) => ({
|
|
97
97
|
src: e.src || "",
|
|
98
98
|
type: e.type || "",
|
|
99
99
|
isModule: e.type === "module",
|
|
@@ -101,7 +101,7 @@ const N = 60, de = (t) => ({
|
|
|
101
101
|
size: e.textContent?.length || 0,
|
|
102
102
|
// First 200 chars of inline scripts to identify patterns
|
|
103
103
|
preview: e.src ? "" : e.textContent?.trim()?.slice(0, 200)
|
|
104
|
-
}))),
|
|
104
|
+
}))), Ae = (t) => t.evaluate(() => {
|
|
105
105
|
const a = (e) => document.querySelector(`meta[name="${e}"], meta[property="${e}"]`)?.content || "";
|
|
106
106
|
return {
|
|
107
107
|
title: document.title || "",
|
|
@@ -128,7 +128,7 @@ const N = 60, de = (t) => ({
|
|
|
128
128
|
content: e.content?.slice(0, 120)
|
|
129
129
|
}))
|
|
130
130
|
};
|
|
131
|
-
}),
|
|
131
|
+
}), Ee = (t) => t.evaluate(() => {
|
|
132
132
|
const a = [...document.querySelectorAll("h1, h2, h3, h4, h5, h6")].slice(0, 30).map((l) => ({
|
|
133
133
|
level: parseInt(l.tagName[1], 10),
|
|
134
134
|
text: l.textContent?.trim()?.slice(0, 100)
|
|
@@ -143,18 +143,18 @@ const N = 60, de = (t) => ({
|
|
|
143
143
|
classes: (typeof l.className == "string" ? l.className : l.className?.baseVal || "").slice(0, 80)
|
|
144
144
|
})), s = /* @__PURE__ */ new Set();
|
|
145
145
|
document.querySelectorAll("*").forEach((l) => {
|
|
146
|
-
[...l.attributes].filter((
|
|
146
|
+
[...l.attributes].filter((p) => p.name.startsWith("data-")).forEach((p) => s.add(p.name));
|
|
147
147
|
});
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
return typeof
|
|
148
|
+
const r = [...document.querySelectorAll('link[rel="stylesheet"]')].map((l) => l.href), i = /* @__PURE__ */ new Set(), o = (l) => {
|
|
149
|
+
const p = l.className;
|
|
150
|
+
return typeof p == "string" ? p : p?.baseVal || "";
|
|
151
151
|
};
|
|
152
152
|
document.querySelectorAll("[class]").forEach((l) => {
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
o(l).split(/\s+/).slice(0, 5).forEach((p) => {
|
|
154
|
+
p && i.add(p);
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
|
-
const
|
|
157
|
+
const n = [...i].slice(0, 200), c = {}, u = [
|
|
158
158
|
"jQuery",
|
|
159
159
|
"$",
|
|
160
160
|
"React",
|
|
@@ -182,12 +182,12 @@ const N = 60, de = (t) => ({
|
|
|
182
182
|
for (const l of u)
|
|
183
183
|
try {
|
|
184
184
|
if (window[l] !== void 0) {
|
|
185
|
-
const
|
|
186
|
-
c[l] = typeof
|
|
185
|
+
const p = window[l];
|
|
186
|
+
c[l] = typeof p == "function" ? p.fn?.jquery || p.version || "present" : typeof p == "object" ? "present" : String(p).slice(0, 40);
|
|
187
187
|
}
|
|
188
188
|
} catch {
|
|
189
189
|
}
|
|
190
|
-
const
|
|
190
|
+
const d = /* @__PURE__ */ new Set(), m = [
|
|
191
191
|
"onclick",
|
|
192
192
|
"onsubmit",
|
|
193
193
|
"onchange",
|
|
@@ -198,109 +198,118 @@ const N = 60, de = (t) => ({
|
|
|
198
198
|
"onkeyup",
|
|
199
199
|
"onkeydown"
|
|
200
200
|
];
|
|
201
|
-
for (const l of
|
|
202
|
-
document.querySelectorAll(`[${l}]`).length > 0 &&
|
|
201
|
+
for (const l of m)
|
|
202
|
+
document.querySelectorAll(`[${l}]`).length > 0 && d.add(l);
|
|
203
203
|
return {
|
|
204
204
|
headings: a,
|
|
205
205
|
landmarks: e,
|
|
206
|
-
dataAttributes:
|
|
207
|
-
stylesheets:
|
|
208
|
-
sampleClasses:
|
|
206
|
+
dataAttributes: Array.from(s).toSorted().slice(0, 100),
|
|
207
|
+
stylesheets: r.slice(0, 20),
|
|
208
|
+
sampleClasses: n,
|
|
209
209
|
globals: c,
|
|
210
|
-
inlineHandlers: [...
|
|
210
|
+
inlineHandlers: [...d],
|
|
211
211
|
iframeCount: document.querySelectorAll("iframe").length,
|
|
212
212
|
shadowRootCount: [...document.querySelectorAll("*")].filter((l) => l.shadowRoot).length
|
|
213
213
|
};
|
|
214
|
-
}),
|
|
215
|
-
const a = t.url(), e = new URL(a).origin, [s,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
}), Pe = async (t) => {
|
|
215
|
+
const a = t.url(), e = new URL(a).origin, [s, r, i, o, n, c] = await Promise.all([
|
|
216
|
+
Se(t, e),
|
|
217
|
+
ke(t),
|
|
218
|
+
Ce(t),
|
|
219
|
+
Ie(t),
|
|
220
|
+
Ae(t),
|
|
221
|
+
Ee(t)
|
|
222
222
|
]);
|
|
223
|
-
return { url: a, links: s, forms:
|
|
224
|
-
},
|
|
223
|
+
return { url: a, links: s, forms: r, buttons: i, scripts: o, meta: n, structure: c };
|
|
224
|
+
}, _ = (t) => {
|
|
225
225
|
const a = new URL(t);
|
|
226
226
|
a.hash = "";
|
|
227
|
-
const e =
|
|
227
|
+
const e = Array.from(a.searchParams.entries()).toSorted(([r], [i]) => r.localeCompare(i));
|
|
228
228
|
a.search = new URLSearchParams(e).toString();
|
|
229
229
|
const s = a.toString();
|
|
230
230
|
return s.endsWith("/") && a.pathname !== "/" ? s.slice(0, -1) : s;
|
|
231
|
-
},
|
|
232
|
-
const e = new URL(t).origin, s = a.sameDomain !== !1,
|
|
233
|
-
return
|
|
234
|
-
addLinks: (b,
|
|
235
|
-
let
|
|
236
|
-
for (const
|
|
237
|
-
const
|
|
238
|
-
if (c.has(
|
|
239
|
-
if (c.add(
|
|
240
|
-
|
|
231
|
+
}, Te = (t, a = 2) => `/${new URL(t).pathname.split("/").filter(Boolean).slice(0, a).join("/")}`, Re = (t, a = {}) => {
|
|
232
|
+
const e = new URL(t).origin, s = a.sameDomain !== !1, r = a.maxDepth ?? 10, i = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = _(t);
|
|
233
|
+
return i.push({ url: t, normalized: u, depth: 0, source: "(start)" }), c.add(u), {
|
|
234
|
+
addLinks: (b, w, h) => {
|
|
235
|
+
let y = 0;
|
|
236
|
+
for (const f of b) {
|
|
237
|
+
const v = f.href || f, x = _(v);
|
|
238
|
+
if (c.has(x)) continue;
|
|
239
|
+
if (c.add(x), s && !v.startsWith(e)) {
|
|
240
|
+
n.set(x, "external");
|
|
241
241
|
continue;
|
|
242
242
|
}
|
|
243
|
-
if (
|
|
244
|
-
|
|
243
|
+
if (w + 1 > r) {
|
|
244
|
+
n.set(x, "max-depth");
|
|
245
245
|
continue;
|
|
246
246
|
}
|
|
247
|
-
const
|
|
248
|
-
if (/\.(png|jpg|jpeg|gif|svg|ico|css|js|woff2?|ttf|eot|pdf|zip|mp[34])$/i.test(
|
|
249
|
-
|
|
247
|
+
const E = new URL(v).pathname;
|
|
248
|
+
if (/\.(png|jpg|jpeg|gif|svg|ico|css|js|woff2?|ttf|eot|pdf|zip|mp[34])$/i.test(E)) {
|
|
249
|
+
n.set(x, "resource");
|
|
250
250
|
continue;
|
|
251
251
|
}
|
|
252
|
-
if (/^(mailto|tel|javascript):/i.test(
|
|
253
|
-
|
|
252
|
+
if (/^(mailto|tel|javascript):/i.test(v)) {
|
|
253
|
+
n.set(x, "scheme");
|
|
254
254
|
continue;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
i.push({ url: v, normalized: x, depth: w + 1, source: h }), y++;
|
|
257
257
|
}
|
|
258
|
-
return
|
|
258
|
+
return y;
|
|
259
259
|
},
|
|
260
260
|
next: () => {
|
|
261
|
-
const b =
|
|
262
|
-
return b &&
|
|
261
|
+
const b = i.shift();
|
|
262
|
+
return b && o.set(b.normalized, {
|
|
263
263
|
url: b.url,
|
|
264
264
|
depth: b.depth,
|
|
265
265
|
source: b.source
|
|
266
266
|
}), b;
|
|
267
267
|
},
|
|
268
|
-
skip: (b,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
skip: (b, w) => {
|
|
269
|
+
const h = /* @__PURE__ */ new Set();
|
|
270
|
+
for (const v of b) {
|
|
271
|
+
const x = _(v);
|
|
272
|
+
n.set(x, w), h.add(x);
|
|
272
273
|
}
|
|
273
|
-
const y =
|
|
274
|
-
return
|
|
274
|
+
const y = i.length, f = i.filter((v) => !h.has(v.normalized));
|
|
275
|
+
return i.splice(0, i.length, ...f), y - f.length;
|
|
275
276
|
},
|
|
276
277
|
pendingByPrefix: (b = 2) => {
|
|
277
|
-
const
|
|
278
|
-
for (const
|
|
279
|
-
const
|
|
280
|
-
|
|
278
|
+
const w = /* @__PURE__ */ new Map();
|
|
279
|
+
for (const h of i) {
|
|
280
|
+
const y = Te(h.url, b), f = w.get(y) || [];
|
|
281
|
+
f.push(h), w.set(y, f);
|
|
281
282
|
}
|
|
282
|
-
return
|
|
283
|
+
return w;
|
|
283
284
|
},
|
|
284
|
-
size: () =>
|
|
285
|
-
visitedCount: () =>
|
|
286
|
-
isEmpty: () =>
|
|
285
|
+
size: () => i.length,
|
|
286
|
+
visitedCount: () => o.size,
|
|
287
|
+
isEmpty: () => i.length === 0,
|
|
287
288
|
summary: () => ({
|
|
288
|
-
pending:
|
|
289
|
-
visited:
|
|
290
|
-
skipped:
|
|
289
|
+
pending: i.length,
|
|
290
|
+
visited: o.size,
|
|
291
|
+
skipped: n.size,
|
|
291
292
|
seen: c.size
|
|
292
293
|
}),
|
|
293
|
-
visitedUrls: () => [...
|
|
294
|
+
visitedUrls: () => [...o.entries()].map(([b, w]) => ({
|
|
294
295
|
normalized: b,
|
|
295
|
-
...
|
|
296
|
+
...w
|
|
296
297
|
})),
|
|
297
|
-
skippedUrls: () => [...
|
|
298
|
+
skippedUrls: () => [...n.entries()].map(([b, w]) => ({
|
|
298
299
|
url: b,
|
|
299
|
-
reason:
|
|
300
|
+
reason: w
|
|
300
301
|
})),
|
|
301
302
|
origin: e
|
|
302
303
|
};
|
|
303
|
-
},
|
|
304
|
+
}, I = Object.freeze({
|
|
305
|
+
tick: "cooldown:tick",
|
|
306
|
+
visitError: "cooldown:visitError",
|
|
307
|
+
blockCheckError: "cooldown:blockCheckError",
|
|
308
|
+
exhausted: "cooldown:exhausted",
|
|
309
|
+
start: "cooldown:start",
|
|
310
|
+
retry: "cooldown:retry",
|
|
311
|
+
heartbeat: "heartbeat"
|
|
312
|
+
}), re = {
|
|
304
313
|
baseDelay: 5e3,
|
|
305
314
|
// 5s initial wait
|
|
306
315
|
maxDelay: 3e5,
|
|
@@ -311,90 +320,101 @@ const N = 60, de = (t) => ({
|
|
|
311
320
|
// up to 6 retries (~5m20s total at 2x backoff from 5s)
|
|
312
321
|
jitter: 0.2
|
|
313
322
|
// ±20% randomization to avoid thundering herd
|
|
314
|
-
},
|
|
323
|
+
}, De = async (t) => {
|
|
315
324
|
const a = t.url(), e = await t.evaluate(() => document.body?.innerText?.slice(0, 500)).catch(() => "");
|
|
316
325
|
if (e.includes("Access Denied")) return "access-denied";
|
|
317
326
|
if (e.includes("Rate limit") || e.includes("Too many requests")) return "rate-limit";
|
|
318
327
|
if (e.includes("Please verify you are a human")) return "captcha";
|
|
319
328
|
if (e.includes("Checking your browser")) return "challenge";
|
|
320
329
|
if (a.includes("errors.edgesuite.net")) return "akamai-block";
|
|
321
|
-
},
|
|
330
|
+
}, Le = (t, a) => {
|
|
322
331
|
const e = t * a;
|
|
323
332
|
return t + (Math.random() * 2 - 1) * e;
|
|
324
|
-
},
|
|
333
|
+
}, Fe = (t, a) => {
|
|
325
334
|
const e = a.baseDelay * Math.pow(a.backoffFactor, t), s = Math.min(e, a.maxDelay);
|
|
326
|
-
return Math.round(
|
|
327
|
-
},
|
|
328
|
-
const
|
|
329
|
-
let
|
|
330
|
-
for (;
|
|
331
|
-
const
|
|
332
|
-
await new Promise((u) => setTimeout(u, c)),
|
|
333
|
-
event:
|
|
334
|
-
elapsedMs:
|
|
335
|
-
remainingMs: Math.max(0,
|
|
335
|
+
return Math.round(Le(s, a.jitter));
|
|
336
|
+
}, Me = async (t, a, e, s) => {
|
|
337
|
+
const r = Date.now(), i = r + t;
|
|
338
|
+
let o = 0;
|
|
339
|
+
for (; o < t; ) {
|
|
340
|
+
const n = t - o, c = Math.min(e, n);
|
|
341
|
+
await new Promise((u) => setTimeout(u, c)), o = Date.now() - r, a.emit({
|
|
342
|
+
event: I.tick,
|
|
343
|
+
elapsedMs: o,
|
|
344
|
+
remainingMs: Math.max(0, i - Date.now()),
|
|
336
345
|
totalMs: t,
|
|
337
346
|
...s
|
|
338
347
|
});
|
|
339
348
|
}
|
|
340
|
-
},
|
|
341
|
-
const
|
|
349
|
+
}, Ne = async (t, a, e, s, r, i, o) => {
|
|
350
|
+
const n = { ...re, ...r };
|
|
342
351
|
let c = 0;
|
|
343
|
-
for (let u = 0; u <=
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
352
|
+
for (let u = 0; u <= n.maxRetries; u++) {
|
|
353
|
+
let d;
|
|
354
|
+
try {
|
|
355
|
+
d = await t(a, e);
|
|
356
|
+
} catch (p) {
|
|
357
|
+
throw s.emit({ event: I.visitError, url: e, attempt: u, error: p.message }), p;
|
|
358
|
+
}
|
|
359
|
+
let m;
|
|
360
|
+
try {
|
|
361
|
+
m = await i(a);
|
|
362
|
+
} catch (p) {
|
|
363
|
+
throw s.emit({ event: I.blockCheckError, url: e, attempt: u, error: p.message }), p;
|
|
364
|
+
}
|
|
365
|
+
if (!m)
|
|
366
|
+
return { pageData: d, retries: u, totalCooldownMs: c };
|
|
367
|
+
if (u >= n.maxRetries)
|
|
348
368
|
return s.emit({
|
|
349
|
-
event:
|
|
369
|
+
event: I.exhausted,
|
|
350
370
|
url: e,
|
|
351
|
-
reason:
|
|
371
|
+
reason: m,
|
|
352
372
|
attempts: u + 1,
|
|
353
373
|
totalCooldownMs: c
|
|
354
|
-
}), { pageData:
|
|
355
|
-
const l =
|
|
374
|
+
}), { pageData: d, retries: u, totalCooldownMs: c, blocked: m };
|
|
375
|
+
const l = Fe(u, n);
|
|
356
376
|
c += l, s.emit({
|
|
357
|
-
event:
|
|
377
|
+
event: I.start,
|
|
358
378
|
url: e,
|
|
359
|
-
reason:
|
|
379
|
+
reason: m,
|
|
360
380
|
attempt: u + 1,
|
|
361
|
-
maxRetries:
|
|
381
|
+
maxRetries: n.maxRetries,
|
|
362
382
|
delayMs: l,
|
|
363
383
|
totalCooldownMs: c
|
|
364
|
-
}), await
|
|
384
|
+
}), await Me(l, s, o, {
|
|
365
385
|
url: e,
|
|
366
|
-
reason:
|
|
386
|
+
reason: m,
|
|
367
387
|
attempt: u + 1
|
|
368
388
|
}), s.emit({
|
|
369
|
-
event:
|
|
389
|
+
event: I.retry,
|
|
370
390
|
url: e,
|
|
371
391
|
attempt: u + 1
|
|
372
392
|
});
|
|
373
393
|
}
|
|
374
|
-
},
|
|
394
|
+
}, $e = (t, a, e) => {
|
|
375
395
|
const s = setInterval(() => {
|
|
376
396
|
t.emit({
|
|
377
|
-
event:
|
|
397
|
+
event: I.heartbeat,
|
|
378
398
|
...e()
|
|
379
399
|
});
|
|
380
400
|
}, a);
|
|
381
401
|
return {
|
|
382
402
|
stop: () => clearInterval(s)
|
|
383
403
|
};
|
|
384
|
-
},
|
|
385
|
-
const e = a.summary(), s = t.map((
|
|
404
|
+
}, K = "site-crawl", Be = "Browser support is disabled. Call init({ browser: true }) to enable.", ze = (t, a) => {
|
|
405
|
+
const e = a.summary(), s = t.map((r) => `${new URL(r.url).pathname} — ${r.meta.title || "(no title)"} [${r.links.length} links, ${r.forms.length} forms, ${r.buttons.length} buttons]`);
|
|
386
406
|
return [
|
|
387
407
|
`Crawled ${e.visited} pages, ${e.pending} pending, ${e.skipped} skipped.`,
|
|
388
408
|
"",
|
|
389
409
|
"Pages visited:",
|
|
390
|
-
...s.map((
|
|
410
|
+
...s.map((r) => ` ${r}`)
|
|
391
411
|
].join(`
|
|
392
412
|
`);
|
|
393
|
-
},
|
|
413
|
+
}, Oe = (t, a, e) => {
|
|
394
414
|
const s = [];
|
|
395
|
-
for (const [
|
|
396
|
-
const
|
|
397
|
-
s.push(` ${
|
|
415
|
+
for (const [r, i] of t) {
|
|
416
|
+
const o = i.slice(0, 5).map((c) => ` ${c.url}`), n = i.length > 5 ? ` ... and ${i.length - 5} more` : "";
|
|
417
|
+
s.push(` ${r} (${i.length} URLs):`), s.push(...o), n && s.push(n);
|
|
398
418
|
}
|
|
399
419
|
return [
|
|
400
420
|
"You are a site crawler deciding which URL branches to explore next.",
|
|
@@ -412,7 +432,7 @@ const N = 60, de = (t) => ({
|
|
|
412
432
|
"Skip groups that are clearly non-functional (help/support, legal, marketing pages)."
|
|
413
433
|
].join(`
|
|
414
434
|
`);
|
|
415
|
-
},
|
|
435
|
+
}, Ue = O("crawl_gate", {
|
|
416
436
|
type: "object",
|
|
417
437
|
properties: {
|
|
418
438
|
decisions: {
|
|
@@ -439,199 +459,201 @@ const N = 60, de = (t) => ({
|
|
|
439
459
|
},
|
|
440
460
|
required: ["decisions"],
|
|
441
461
|
additionalProperties: !1
|
|
442
|
-
}),
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
445
|
-
const
|
|
462
|
+
}), _e = async (t, a, e, s) => {
|
|
463
|
+
const r = t.pendingByPrefix(2);
|
|
464
|
+
if (r.size === 0) return { explore: [], skip: [], decisions: [] };
|
|
465
|
+
const i = ze(a, t), o = Oe(r, i, e), c = (await W(o, {
|
|
446
466
|
...s,
|
|
447
|
-
|
|
467
|
+
responseFormat: Ue,
|
|
448
468
|
temperature: 0.2
|
|
449
|
-
}))?.decisions || [], u = [],
|
|
450
|
-
for (const
|
|
451
|
-
const l =
|
|
469
|
+
}))?.decisions || [], u = [], d = [];
|
|
470
|
+
for (const m of c) {
|
|
471
|
+
const l = r.get(m.prefix);
|
|
452
472
|
if (l)
|
|
453
|
-
if (
|
|
454
|
-
|
|
473
|
+
if (m.action === "skip")
|
|
474
|
+
d.push(...l.map((p) => p.url));
|
|
455
475
|
else {
|
|
456
|
-
const
|
|
457
|
-
u.push(...l.slice(0,
|
|
476
|
+
const p = Math.min(m.maxFromGroup || 3, 5, l.length);
|
|
477
|
+
u.push(...l.slice(0, p).map((g) => g.url)), l.length > p && d.push(...l.slice(p).map((g) => g.url));
|
|
458
478
|
}
|
|
459
479
|
}
|
|
460
|
-
for (const [
|
|
461
|
-
c.some((g) => g.prefix ===
|
|
462
|
-
return { explore: u, skip:
|
|
463
|
-
},
|
|
480
|
+
for (const [m, l] of r)
|
|
481
|
+
c.some((g) => g.prefix === m) || (u.push(l[0].url), l.length > 1 && d.push(...l.slice(1).map((g) => g.url)));
|
|
482
|
+
return { explore: u, skip: d, decisions: c };
|
|
483
|
+
}, je = async (t, a, e, s, r, i) => {
|
|
464
484
|
await t.goto(a, { waitUntil: "domcontentloaded", timeout: 3e4 }), await t.waitForTimeout(1500);
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
485
|
+
const o = await Pe(t);
|
|
486
|
+
if (r.screenshots) {
|
|
467
487
|
const c = `${s.dir}/crawl-${Date.now()}.png`;
|
|
468
|
-
if (await t.screenshot({ path: c, fullPage: !1 }), s.track(c),
|
|
469
|
-
const u = await
|
|
470
|
-
...
|
|
488
|
+
if (await t.screenshot({ path: c, fullPage: !1 }), s.track(c), r.imageShrink) {
|
|
489
|
+
const u = await he(c, {
|
|
490
|
+
...r.imageShrink,
|
|
471
491
|
outputDir: s.dir
|
|
472
492
|
});
|
|
473
|
-
s.track(u.path),
|
|
493
|
+
s.track(u.path), o.screenshot = u.path;
|
|
474
494
|
} else
|
|
475
|
-
|
|
495
|
+
o.screenshot = c;
|
|
476
496
|
}
|
|
477
|
-
const
|
|
478
|
-
return
|
|
497
|
+
const n = e.responses();
|
|
498
|
+
return o.apis = n.filter((c) => {
|
|
479
499
|
const u = c.url();
|
|
480
500
|
return u.includes("/api/") || u.includes("/v1/") || u.includes("/v2/") || u.includes("/graphql");
|
|
481
501
|
}).map((c) => ({
|
|
482
502
|
url: c.url(),
|
|
483
503
|
status: c.status(),
|
|
484
504
|
method: c.request().method()
|
|
485
|
-
})), e.clear(),
|
|
486
|
-
},
|
|
505
|
+
})), e.clear(), o;
|
|
506
|
+
}, qe = (t) => {
|
|
487
507
|
const a = {};
|
|
488
508
|
for (const e of t) {
|
|
489
|
-
const s = e.links.filter((
|
|
509
|
+
const s = e.links.filter((r) => r.isSameDomain && !r.isAnchor).map((r) => r.href);
|
|
490
510
|
a[e.url] = [...new Set(s)];
|
|
491
511
|
}
|
|
492
512
|
return a;
|
|
493
|
-
},
|
|
513
|
+
}, Ve = (t) => {
|
|
494
514
|
const a = /* @__PURE__ */ new Map();
|
|
495
515
|
for (const e of t)
|
|
496
516
|
for (const s of e.apis || []) {
|
|
497
|
-
const
|
|
498
|
-
a.has(
|
|
517
|
+
const r = `${s.method} ${new URL(s.url).pathname}`;
|
|
518
|
+
a.has(r) ? a.get(r).seenOn.push(e.url) : a.set(r, { ...s, seenOn: [e.url] });
|
|
499
519
|
}
|
|
500
520
|
return [...a.values()];
|
|
501
|
-
},
|
|
502
|
-
if (!
|
|
503
|
-
const e =
|
|
521
|
+
}, We = async (t, a = {}) => {
|
|
522
|
+
if (!de()) throw new Error(Be);
|
|
523
|
+
const e = B(K, a), s = z(K, e.onProgress, e);
|
|
504
524
|
s.start();
|
|
505
|
-
const
|
|
525
|
+
const r = await se(e, {
|
|
506
526
|
maxPages: 20,
|
|
507
527
|
maxDepth: 5,
|
|
508
528
|
sameDomain: !0,
|
|
509
529
|
gateInterval: 5,
|
|
510
530
|
headless: !0,
|
|
511
531
|
screenshots: !1,
|
|
512
|
-
errorPosture:
|
|
513
|
-
imageShrink:
|
|
532
|
+
errorPosture: q.resilient,
|
|
533
|
+
imageShrink: V(xe),
|
|
514
534
|
heartbeatInterval: 1e3
|
|
515
|
-
}),
|
|
516
|
-
sameDomain:
|
|
517
|
-
maxDepth:
|
|
518
|
-
}), c = await
|
|
519
|
-
headless:
|
|
535
|
+
}), i = { ...re, ...e.cooldown }, o = e.isBlocked || De, n = Re(t, {
|
|
536
|
+
sameDomain: r.sameDomain,
|
|
537
|
+
maxDepth: r.maxDepth
|
|
538
|
+
}), c = await me("site-crawl", e.outputDir), d = await (e.browserEngine ? J[e.browserEngine] : J.chromium).launch({
|
|
539
|
+
headless: r.headless,
|
|
520
540
|
...e.launchOptions
|
|
521
541
|
});
|
|
522
|
-
s.emit({ event: "browser", headless:
|
|
542
|
+
s.emit({ event: "browser", headless: r.headless });
|
|
523
543
|
try {
|
|
524
|
-
const
|
|
544
|
+
const m = await d.newContext(e.contextOptions);
|
|
525
545
|
if (e.setup) {
|
|
526
|
-
const
|
|
527
|
-
await e.setup(
|
|
546
|
+
const h = await m.newPage();
|
|
547
|
+
await e.setup(h), await h.close(), s.emit({ event: "setup" });
|
|
528
548
|
}
|
|
529
|
-
const l = await
|
|
530
|
-
const
|
|
531
|
-
return l.on("response", (y) =>
|
|
532
|
-
responses: () => [...
|
|
549
|
+
const l = await m.newPage(), p = (() => {
|
|
550
|
+
const h = [];
|
|
551
|
+
return l.on("response", (y) => h.push(y)), {
|
|
552
|
+
responses: () => [...h],
|
|
533
553
|
clear: () => {
|
|
534
|
-
|
|
554
|
+
h.length = 0;
|
|
535
555
|
}
|
|
536
556
|
};
|
|
537
557
|
})(), g = [];
|
|
538
|
-
let
|
|
539
|
-
const
|
|
558
|
+
let S = 0, A = t;
|
|
559
|
+
const T = $e(s, r.heartbeatInterval, () => ({
|
|
540
560
|
pagesVisited: g.length,
|
|
541
|
-
maxPages:
|
|
542
|
-
pending:
|
|
543
|
-
currentUrl:
|
|
544
|
-
...
|
|
545
|
-
}));
|
|
561
|
+
maxPages: r.maxPages,
|
|
562
|
+
pending: n.size(),
|
|
563
|
+
currentUrl: A,
|
|
564
|
+
...n.summary()
|
|
565
|
+
})), F = s.batch(r.maxPages);
|
|
546
566
|
try {
|
|
547
|
-
for (; !
|
|
548
|
-
if (g.length > 0 && g.length %
|
|
549
|
-
const y =
|
|
550
|
-
s.emit({ event: "gate:start", pending:
|
|
551
|
-
const f = await
|
|
552
|
-
|
|
567
|
+
for (; !n.isEmpty() && g.length < r.maxPages; ) {
|
|
568
|
+
if (g.length > 0 && g.length % r.gateInterval === 0 && n.size() > 0) {
|
|
569
|
+
const y = r.maxPages - g.length;
|
|
570
|
+
s.emit({ event: "gate:start", pending: n.size(), budget: y });
|
|
571
|
+
const f = await _e(n, g, y, e);
|
|
572
|
+
S++, f.skip.length > 0 && n.skip(f.skip, "llm-gate"), s.emit({
|
|
553
573
|
event: "gate:complete",
|
|
554
574
|
explored: f.explore.length,
|
|
555
575
|
skipped: f.skip.length,
|
|
556
576
|
decisions: f.decisions.length
|
|
557
577
|
});
|
|
558
578
|
}
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
561
|
-
|
|
579
|
+
const h = n.next();
|
|
580
|
+
if (!h) break;
|
|
581
|
+
A = h.url, s.emit({
|
|
562
582
|
event: "page:start",
|
|
563
|
-
url:
|
|
564
|
-
depth:
|
|
583
|
+
url: h.url,
|
|
584
|
+
depth: h.depth,
|
|
565
585
|
pageNumber: g.length + 1,
|
|
566
|
-
maxPages:
|
|
586
|
+
maxPages: r.maxPages
|
|
567
587
|
});
|
|
568
588
|
try {
|
|
569
|
-
const y = (
|
|
589
|
+
const y = (E, ue) => je(E, ue, p, c, r, s), { pageData: f, blocked: v } = await Ne(
|
|
570
590
|
y,
|
|
571
591
|
l,
|
|
572
|
-
|
|
592
|
+
h.url,
|
|
573
593
|
s,
|
|
574
|
-
o,
|
|
575
594
|
i,
|
|
576
|
-
|
|
595
|
+
o,
|
|
596
|
+
r.heartbeatInterval
|
|
577
597
|
);
|
|
578
|
-
f.depth =
|
|
579
|
-
const x =
|
|
580
|
-
f.links.filter((
|
|
581
|
-
|
|
582
|
-
|
|
598
|
+
f.depth = h.depth, f.source = h.source, v && (f.blocked = v), g.push(f);
|
|
599
|
+
const x = v ? 0 : n.addLinks(
|
|
600
|
+
f.links.filter((E) => E.isSameDomain && !E.isAnchor),
|
|
601
|
+
h.depth,
|
|
602
|
+
h.url
|
|
583
603
|
);
|
|
584
604
|
s.emit({
|
|
585
605
|
event: "page:complete",
|
|
586
|
-
url:
|
|
606
|
+
url: h.url,
|
|
587
607
|
links: f.links.length,
|
|
588
608
|
forms: f.forms.length,
|
|
589
609
|
newUrls: x,
|
|
590
|
-
pending:
|
|
591
|
-
blocked:
|
|
592
|
-
});
|
|
610
|
+
pending: n.size(),
|
|
611
|
+
blocked: v
|
|
612
|
+
}), F(1);
|
|
593
613
|
} catch (y) {
|
|
594
|
-
if (s.emit({ event: "page:error", url:
|
|
614
|
+
if (s.emit({ event: "page:error", url: h.url, error: y.message }), r.errorPosture === q.strict) throw y;
|
|
595
615
|
}
|
|
596
616
|
}
|
|
597
617
|
} finally {
|
|
598
|
-
|
|
618
|
+
T.stop();
|
|
599
619
|
}
|
|
600
620
|
if (await l.close(), e.teardown) {
|
|
601
621
|
try {
|
|
602
|
-
const
|
|
603
|
-
await e.teardown(
|
|
622
|
+
const h = await m.newPage();
|
|
623
|
+
await e.teardown(h), await h.close();
|
|
604
624
|
} catch {
|
|
605
625
|
}
|
|
606
626
|
s.emit({ event: "teardown" });
|
|
607
627
|
}
|
|
608
|
-
await
|
|
609
|
-
const
|
|
628
|
+
await m.close();
|
|
629
|
+
const H = qe(g), b = Ve(g), w = {
|
|
610
630
|
pages: g,
|
|
611
|
-
graph:
|
|
612
|
-
apis:
|
|
613
|
-
frontier:
|
|
614
|
-
skipped:
|
|
615
|
-
gateCallCount:
|
|
631
|
+
graph: H,
|
|
632
|
+
apis: b,
|
|
633
|
+
frontier: n.summary(),
|
|
634
|
+
skipped: n.skippedUrls(),
|
|
635
|
+
gateCallCount: S,
|
|
616
636
|
cleanup: () => c.cleanup()
|
|
617
637
|
};
|
|
618
638
|
return s.complete({
|
|
619
|
-
outcome:
|
|
639
|
+
outcome: L.success,
|
|
620
640
|
pagesVisited: g.length,
|
|
621
|
-
apisFound:
|
|
622
|
-
gateCallCount:
|
|
623
|
-
...
|
|
624
|
-
}),
|
|
625
|
-
} catch (
|
|
626
|
-
throw s.error(
|
|
641
|
+
apisFound: b.length,
|
|
642
|
+
gateCallCount: S,
|
|
643
|
+
...n.summary()
|
|
644
|
+
}), w;
|
|
645
|
+
} catch (m) {
|
|
646
|
+
throw s.error(m, { pagesVisited: 0 }), m;
|
|
627
647
|
} finally {
|
|
628
|
-
await
|
|
648
|
+
await d.close();
|
|
629
649
|
}
|
|
630
|
-
}
|
|
650
|
+
};
|
|
651
|
+
We.knownTexts = [];
|
|
652
|
+
const ne = 1, M = 20, N = 5, Ge = 0.5, He = 5, X = 8e3, j = 5, $ = {
|
|
631
653
|
INDIVIDUAL: "individual",
|
|
632
654
|
BULK: "bulk"
|
|
633
|
-
},
|
|
634
|
-
function
|
|
655
|
+
}, Je = (t) => t === void 0 ? M : typeof t == "number" ? t : { small: 10, med: M, large: 40 }[t] ?? M, Ke = (t) => t === void 0 ? N : typeof t == "number" ? t : { low: 2, med: N, high: 10 }[t] ?? N;
|
|
656
|
+
function Xe(t, a) {
|
|
635
657
|
const e = [];
|
|
636
658
|
for (let s = 0; s < t.length; s += a)
|
|
637
659
|
e.push({
|
|
@@ -641,127 +663,115 @@ function Oe(t, a) {
|
|
|
641
663
|
});
|
|
642
664
|
return e;
|
|
643
665
|
}
|
|
644
|
-
function
|
|
666
|
+
function Q(t, a, e, s, r, i) {
|
|
645
667
|
return {
|
|
646
668
|
chunkIndex: t.index,
|
|
647
669
|
totalChunks: a,
|
|
648
670
|
itemsInChunk: t.items.length,
|
|
649
671
|
totalItems: e,
|
|
650
672
|
status: s,
|
|
651
|
-
bulkSize:
|
|
652
|
-
maxConcurrency:
|
|
653
|
-
processingMode:
|
|
673
|
+
bulkSize: r.bulkSize,
|
|
674
|
+
maxConcurrency: r.maxConcurrency,
|
|
675
|
+
processingMode: i,
|
|
654
676
|
parallelMode: !0
|
|
655
677
|
};
|
|
656
678
|
}
|
|
657
|
-
async function
|
|
679
|
+
async function Qe(t, a, e, s, r, i = {}) {
|
|
658
680
|
try {
|
|
659
|
-
const
|
|
681
|
+
const o = e.map((d) => ce(d(t))).filter(Boolean).join(`
|
|
660
682
|
|
|
661
|
-
`),
|
|
683
|
+
`), n = [a, o].filter(Boolean).join(`
|
|
662
684
|
|
|
663
|
-
`), c =
|
|
664
|
-
...
|
|
665
|
-
|
|
666
|
-
type: "json_schema",
|
|
667
|
-
json_schema: {
|
|
668
|
-
name: "arch_result",
|
|
669
|
-
schema: Ke
|
|
670
|
-
}
|
|
671
|
-
}
|
|
685
|
+
`), c = ct(n, t, s, r === "files"), u = await W(c, {
|
|
686
|
+
...i,
|
|
687
|
+
responseFormat: O("arch_result", nt)
|
|
672
688
|
});
|
|
673
689
|
return { item: t, ...u, error: void 0 };
|
|
674
|
-
} catch (
|
|
675
|
-
return { item: t, passed: !1, reason: `Analysis failed: ${
|
|
690
|
+
} catch (o) {
|
|
691
|
+
return { item: t, passed: !1, reason: `Analysis failed: ${o.message}`, error: o };
|
|
676
692
|
}
|
|
677
693
|
}
|
|
678
|
-
function
|
|
679
|
-
const
|
|
680
|
-
let
|
|
681
|
-
for (const
|
|
682
|
-
if (
|
|
694
|
+
function Ye(t, a, e, s) {
|
|
695
|
+
const r = [], i = [];
|
|
696
|
+
let o = s;
|
|
697
|
+
for (const n of t)
|
|
698
|
+
if (r.push(n), n.passed || (o++, i.push(n.error || new Error(n.reason))), !a && o >= e)
|
|
683
699
|
break;
|
|
684
700
|
return {
|
|
685
|
-
results:
|
|
686
|
-
errors:
|
|
687
|
-
failures:
|
|
688
|
-
shouldStop: !a &&
|
|
701
|
+
results: r,
|
|
702
|
+
errors: i,
|
|
703
|
+
failures: o,
|
|
704
|
+
shouldStop: !a && o >= e
|
|
689
705
|
};
|
|
690
706
|
}
|
|
691
|
-
function
|
|
707
|
+
function D(t, a, e, s) {
|
|
692
708
|
t && t(a, e, s);
|
|
693
709
|
}
|
|
694
|
-
async function
|
|
695
|
-
|
|
696
|
-
...
|
|
697
|
-
status:
|
|
710
|
+
async function oe(t, a, e, s, r, i = {}) {
|
|
711
|
+
D(s, t, void 0, {
|
|
712
|
+
...r,
|
|
713
|
+
status: R.start
|
|
698
714
|
});
|
|
699
715
|
try {
|
|
700
|
-
const
|
|
701
|
-
...
|
|
702
|
-
responseFormat:
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
},
|
|
709
|
-
onProgress: Q(o.onProgress, "reduce")
|
|
710
|
-
}, c = await ce(t, i, r), u = c.results || c;
|
|
711
|
-
let m = [];
|
|
712
|
-
Array.isArray(u) ? m = u : m = t.map((d) => ({
|
|
713
|
-
path: d,
|
|
716
|
+
const o = lt(a, t, e), n = {
|
|
717
|
+
...i,
|
|
718
|
+
responseFormat: O("arch_bulk_result", ot),
|
|
719
|
+
onProgress: ae(s, "reduce")
|
|
720
|
+
}, c = await ge(t, o, n), u = c.results || c;
|
|
721
|
+
let d = [];
|
|
722
|
+
Array.isArray(u) ? d = u : d = t.map((p) => ({
|
|
723
|
+
path: p,
|
|
714
724
|
passed: !1,
|
|
715
725
|
reason: "Invalid response format"
|
|
716
726
|
}));
|
|
717
|
-
const
|
|
718
|
-
return
|
|
727
|
+
const m = d.filter((p) => !p.passed).length, l = d.length - m;
|
|
728
|
+
return D(
|
|
719
729
|
s,
|
|
720
730
|
t,
|
|
721
|
-
|
|
731
|
+
m > 0 ? new Error(`${m} items failed`) : void 0,
|
|
722
732
|
{
|
|
723
|
-
...
|
|
724
|
-
status:
|
|
733
|
+
...r,
|
|
734
|
+
status: R.complete,
|
|
725
735
|
passed: l,
|
|
726
|
-
failed:
|
|
736
|
+
failed: m
|
|
727
737
|
}
|
|
728
|
-
),
|
|
729
|
-
} catch (
|
|
730
|
-
const
|
|
738
|
+
), d;
|
|
739
|
+
} catch (o) {
|
|
740
|
+
const n = t.map((c) => ({
|
|
731
741
|
path: c,
|
|
732
742
|
passed: !1,
|
|
733
|
-
reason: `Processing error: ${
|
|
743
|
+
reason: `Processing error: ${o.message}`
|
|
734
744
|
}));
|
|
735
|
-
return
|
|
736
|
-
...
|
|
737
|
-
status:
|
|
738
|
-
}),
|
|
745
|
+
return D(s, t, o, {
|
|
746
|
+
...r,
|
|
747
|
+
status: R.error
|
|
748
|
+
}), n;
|
|
739
749
|
}
|
|
740
750
|
}
|
|
741
|
-
function
|
|
742
|
-
const e = a.filter((
|
|
751
|
+
function Ze(t, a) {
|
|
752
|
+
const e = a.filter((n) => n.passed).length, s = a.length - e, r = s === 0, i = a.length < t.length, o = a.filter((n) => !n.passed);
|
|
743
753
|
return {
|
|
744
754
|
passed: e,
|
|
745
755
|
failed: s,
|
|
746
|
-
allPassed:
|
|
747
|
-
stoppedEarly:
|
|
748
|
-
failures:
|
|
756
|
+
allPassed: r,
|
|
757
|
+
stoppedEarly: i,
|
|
758
|
+
failures: o,
|
|
749
759
|
total: t.length,
|
|
750
760
|
processed: a.length
|
|
751
761
|
};
|
|
752
762
|
}
|
|
753
|
-
function
|
|
763
|
+
function et(t, a, e) {
|
|
754
764
|
if (t.allPassed)
|
|
755
765
|
return `All ${t.processed}/${t.total} items satisfy: ${a}`;
|
|
756
|
-
const s = t.failures.slice(0,
|
|
757
|
-
`),
|
|
758
|
-
... and ${t.failures.length -
|
|
759
|
-
return `${t.failed}/${t.processed} items failed: ${a}${t.stoppedEarly && e !==
|
|
766
|
+
const s = t.failures.slice(0, j).map((i) => ` • ${i.item}: ${i.reason || "Failed"}`).join(`
|
|
767
|
+
`), r = t.failures.length > j ? `
|
|
768
|
+
... and ${t.failures.length - j} more failures` : "";
|
|
769
|
+
return `${t.failed}/${t.processed} items failed: ${a}${t.stoppedEarly && e !== ne ? ` (stopped after ${e} failures)` : ""}
|
|
760
770
|
|
|
761
771
|
Failures:
|
|
762
|
-
${s}${
|
|
772
|
+
${s}${r}`;
|
|
763
773
|
}
|
|
764
|
-
function
|
|
774
|
+
function tt(t, a) {
|
|
765
775
|
return {
|
|
766
776
|
passed: t.allPassed,
|
|
767
777
|
message: a,
|
|
@@ -774,24 +784,24 @@ function We(t, a) {
|
|
|
774
784
|
}
|
|
775
785
|
};
|
|
776
786
|
}
|
|
777
|
-
function
|
|
778
|
-
const
|
|
787
|
+
function st(t, a, e, s) {
|
|
788
|
+
const r = a || e.length > 0 || s <= He;
|
|
779
789
|
return {
|
|
780
|
-
mode:
|
|
781
|
-
batchSize:
|
|
782
|
-
processor:
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
790
|
+
mode: r ? $.INDIVIDUAL : $.BULK,
|
|
791
|
+
batchSize: r ? t.maxConcurrency : t.bulkSize,
|
|
792
|
+
processor: r ? (i, o, n) => ie(i, o, n) : (i, o, n) => oe(
|
|
793
|
+
i.items,
|
|
794
|
+
o,
|
|
795
|
+
n.description,
|
|
796
|
+
n.onProgress,
|
|
797
|
+
n.metadata
|
|
788
798
|
)
|
|
789
799
|
};
|
|
790
800
|
}
|
|
791
|
-
|
|
801
|
+
function ie(t, a, e) {
|
|
792
802
|
const s = t.items.map(
|
|
793
|
-
(
|
|
794
|
-
|
|
803
|
+
(r) => Qe(
|
|
804
|
+
r,
|
|
795
805
|
a,
|
|
796
806
|
e.itemContextFns,
|
|
797
807
|
e.description,
|
|
@@ -799,11 +809,11 @@ async function se(t, a, e) {
|
|
|
799
809
|
e.runConfig
|
|
800
810
|
)
|
|
801
811
|
);
|
|
802
|
-
return
|
|
812
|
+
return Promise.all(s);
|
|
803
813
|
}
|
|
804
|
-
function
|
|
805
|
-
if (a ===
|
|
806
|
-
const { results: s, errors:
|
|
814
|
+
function at(t, a, e) {
|
|
815
|
+
if (a === $.INDIVIDUAL) {
|
|
816
|
+
const { results: s, errors: r, failures: i, shouldStop: o } = Ye(
|
|
807
817
|
t,
|
|
808
818
|
e.isCoverageTest,
|
|
809
819
|
e.maxFailures,
|
|
@@ -811,19 +821,19 @@ function He(t, a, e) {
|
|
|
811
821
|
);
|
|
812
822
|
return {
|
|
813
823
|
results: s,
|
|
814
|
-
errors:
|
|
815
|
-
failures:
|
|
816
|
-
shouldStop:
|
|
824
|
+
errors: r,
|
|
825
|
+
failures: i,
|
|
826
|
+
shouldStop: o,
|
|
817
827
|
progressData: {
|
|
818
|
-
passed: s.filter((
|
|
819
|
-
failed:
|
|
828
|
+
passed: s.filter((n) => n.passed).length,
|
|
829
|
+
failed: r.length
|
|
820
830
|
}
|
|
821
831
|
};
|
|
822
832
|
} else {
|
|
823
|
-
const s = t.map((
|
|
824
|
-
item:
|
|
825
|
-
passed:
|
|
826
|
-
reason:
|
|
833
|
+
const s = t.map((r) => ({
|
|
834
|
+
item: r.path,
|
|
835
|
+
passed: r.passed,
|
|
836
|
+
reason: r.reason
|
|
827
837
|
}));
|
|
828
838
|
return {
|
|
829
839
|
results: s,
|
|
@@ -831,72 +841,72 @@ function He(t, a, e) {
|
|
|
831
841
|
failures: e.currentFailures || 0,
|
|
832
842
|
shouldStop: !1,
|
|
833
843
|
progressData: {
|
|
834
|
-
passed: s.filter((
|
|
835
|
-
failed: s.filter((
|
|
844
|
+
passed: s.filter((r) => r.passed).length,
|
|
845
|
+
failed: s.filter((r) => !r.passed).length
|
|
836
846
|
}
|
|
837
847
|
};
|
|
838
848
|
}
|
|
839
849
|
}
|
|
840
|
-
async function
|
|
841
|
-
const
|
|
842
|
-
let
|
|
843
|
-
for (const
|
|
844
|
-
if (!s.isCoverageTest &&
|
|
850
|
+
async function rt(t, a, e, s) {
|
|
851
|
+
const r = Xe(t, e.batchSize), i = [];
|
|
852
|
+
let o = 0;
|
|
853
|
+
for (const n of r) {
|
|
854
|
+
if (!s.isCoverageTest && o >= s.maxFailures)
|
|
845
855
|
break;
|
|
846
|
-
const c =
|
|
847
|
-
|
|
848
|
-
|
|
856
|
+
const c = Q(
|
|
857
|
+
n,
|
|
858
|
+
r.length,
|
|
849
859
|
t.length,
|
|
850
|
-
|
|
860
|
+
R.start,
|
|
851
861
|
s,
|
|
852
862
|
e.mode
|
|
853
863
|
);
|
|
854
|
-
|
|
864
|
+
D(s.onChunkProcessed, n.items, void 0, c);
|
|
855
865
|
let u;
|
|
856
|
-
e.mode ===
|
|
866
|
+
e.mode === $.INDIVIDUAL ? u = await ie(n, a, {
|
|
857
867
|
itemContextFns: s.itemContextFns,
|
|
858
868
|
description: s.description,
|
|
859
869
|
targetType: s.targetType
|
|
860
|
-
}) : u = await
|
|
861
|
-
|
|
870
|
+
}) : u = await oe(
|
|
871
|
+
n.items,
|
|
862
872
|
a,
|
|
863
873
|
s.description,
|
|
864
874
|
s.onChunkProcessed,
|
|
865
875
|
c,
|
|
866
876
|
s.runConfig
|
|
867
877
|
);
|
|
868
|
-
const
|
|
878
|
+
const d = at(u, e.mode, {
|
|
869
879
|
...s,
|
|
870
|
-
currentFailures:
|
|
880
|
+
currentFailures: o
|
|
871
881
|
});
|
|
872
|
-
if (
|
|
882
|
+
if (i.push(...d.results), o = d.failures, D(
|
|
873
883
|
s.onChunkProcessed,
|
|
874
|
-
|
|
875
|
-
|
|
884
|
+
n.items,
|
|
885
|
+
d.errors.length > 0 ? d.errors[0] : void 0,
|
|
876
886
|
{
|
|
877
|
-
...
|
|
878
|
-
|
|
879
|
-
|
|
887
|
+
...Q(
|
|
888
|
+
n,
|
|
889
|
+
r.length,
|
|
880
890
|
t.length,
|
|
881
|
-
|
|
891
|
+
R.complete,
|
|
882
892
|
s,
|
|
883
893
|
e.mode
|
|
884
894
|
),
|
|
885
|
-
...
|
|
895
|
+
...d.progressData
|
|
886
896
|
}
|
|
887
|
-
),
|
|
897
|
+
), d.shouldStop)
|
|
888
898
|
break;
|
|
889
899
|
}
|
|
890
|
-
return
|
|
900
|
+
return i;
|
|
891
901
|
}
|
|
892
|
-
const
|
|
902
|
+
const nt = {
|
|
893
903
|
type: "object",
|
|
894
904
|
properties: {
|
|
895
905
|
passed: { type: "boolean" },
|
|
896
906
|
reason: { type: "string" }
|
|
897
907
|
},
|
|
898
908
|
required: ["passed", "reason"]
|
|
899
|
-
},
|
|
909
|
+
}, ot = {
|
|
900
910
|
type: "object",
|
|
901
911
|
properties: {
|
|
902
912
|
results: {
|
|
@@ -914,61 +924,60 @@ const Ke = {
|
|
|
914
924
|
},
|
|
915
925
|
required: ["results"]
|
|
916
926
|
};
|
|
917
|
-
function
|
|
927
|
+
function ce(t) {
|
|
918
928
|
switch (t.type) {
|
|
919
929
|
case "file":
|
|
920
|
-
return
|
|
921
|
-
${I.readFileSync(t.filePath, "utf8")}
|
|
922
|
-
</${t.name}>` : "";
|
|
930
|
+
return k.existsSync(t.filePath) ? C(k.readFileSync(t.filePath, "utf8"), { tag: t.name }) : "";
|
|
923
931
|
case "json": {
|
|
924
|
-
if (!
|
|
925
|
-
const a = JSON.parse(
|
|
926
|
-
return
|
|
927
|
-
${JSON.stringify(a, void 0, 2)}
|
|
928
|
-
</${t.name}>`;
|
|
932
|
+
if (!k.existsSync(t.filePath)) return "";
|
|
933
|
+
const a = JSON.parse(k.readFileSync(t.filePath, "utf8"));
|
|
934
|
+
return C(JSON.stringify(a, void 0, 2), { tag: t.name });
|
|
929
935
|
}
|
|
930
936
|
case "data": {
|
|
931
937
|
const a = typeof t.data == "string" ? t.data : JSON.stringify(t.data, void 0, 2);
|
|
932
|
-
return
|
|
933
|
-
${a}
|
|
934
|
-
</${t.name}>`;
|
|
938
|
+
return C(a, { tag: t.name });
|
|
935
939
|
}
|
|
936
940
|
default:
|
|
937
941
|
return "";
|
|
938
942
|
}
|
|
939
943
|
}
|
|
940
|
-
function
|
|
941
|
-
if (!
|
|
942
|
-
if (
|
|
943
|
-
return
|
|
944
|
+
function it(t) {
|
|
945
|
+
if (!k.existsSync(t)) return "Item does not exist";
|
|
946
|
+
if (k.statSync(t).isDirectory())
|
|
947
|
+
return k.readdirSync(t).join(", ");
|
|
944
948
|
{
|
|
945
|
-
const e =
|
|
946
|
-
return e.length >
|
|
949
|
+
const e = k.readFileSync(t, "utf8");
|
|
950
|
+
return e.length > X ? `${e.substring(0, X)}
|
|
947
951
|
... (truncated)` : e;
|
|
948
952
|
}
|
|
949
953
|
}
|
|
950
|
-
function
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
954
|
+
function ct(t, a, e, s) {
|
|
955
|
+
const r = it(a);
|
|
956
|
+
return [
|
|
957
|
+
t,
|
|
958
|
+
`Analyze this ${s ? "file" : "directory"}: ${a}`,
|
|
959
|
+
C(r, { tag: "content" }),
|
|
960
|
+
C(e, { tag: "description" }),
|
|
961
|
+
'Return JSON with "passed" (boolean) and "reason" (string).'
|
|
962
|
+
].filter(Boolean).join(`
|
|
959
963
|
|
|
960
|
-
|
|
964
|
+
`);
|
|
961
965
|
}
|
|
962
|
-
function
|
|
963
|
-
return
|
|
964
|
-
|
|
965
|
-
|
|
966
|
+
function lt(t, a, e) {
|
|
967
|
+
return [
|
|
968
|
+
t,
|
|
969
|
+
"Analyze each item and determine if it satisfies the given description.",
|
|
970
|
+
C(e, { tag: "description" }),
|
|
971
|
+
C(a.join(`
|
|
972
|
+
`), { tag: "items" }),
|
|
973
|
+
'Return JSON with "results" array containing objects with "path", "passed" (boolean), and "reason" (string).'
|
|
974
|
+
].filter(Boolean).join(`
|
|
966
975
|
|
|
967
|
-
|
|
976
|
+
`);
|
|
968
977
|
}
|
|
969
|
-
class
|
|
978
|
+
class ut {
|
|
970
979
|
constructor(a, e = {}) {
|
|
971
|
-
this.target = a, this.options = e, this.contexts = [], this.itemContextFns = [], this.maxFailures = e.maxFailures ||
|
|
980
|
+
this.target = a, this.options = e, this.contexts = [], this.itemContextFns = [], this.maxFailures = e.maxFailures || ne, this.bulkSize = e.bulkSize || M, this.maxConcurrency = e.maxConcurrency || N, this.onChunkProcessed = void 0, this.description = void 0, this.threshold = void 0, this.isCoverageTest = !1;
|
|
972
981
|
}
|
|
973
982
|
withContext(a) {
|
|
974
983
|
return this.contexts.push(a), this;
|
|
@@ -981,30 +990,30 @@ class et {
|
|
|
981
990
|
return this.description = a, this;
|
|
982
991
|
}
|
|
983
992
|
// Set up for a coverage test
|
|
984
|
-
coverage(a =
|
|
993
|
+
coverage(a = Ge) {
|
|
985
994
|
return this.threshold = a, this.isCoverageTest = !0, this;
|
|
986
995
|
}
|
|
987
996
|
// Start processing - this is the fluent terminator
|
|
988
997
|
async start() {
|
|
989
|
-
const a =
|
|
990
|
-
e.start();
|
|
998
|
+
const a = B("ai-arch-expect", this.options), e = z("ai-arch-expect", a.onProgress, a);
|
|
999
|
+
e.start(), e.emit({ event: P.input, value: this.description });
|
|
991
1000
|
try {
|
|
992
1001
|
if (!this.description)
|
|
993
1002
|
throw new Error("Must call satisfies() before start()");
|
|
994
|
-
const s = await this.target.resolve(),
|
|
1003
|
+
const s = await this.target.resolve(), r = this.contexts.map(ce).filter(Boolean).join(`
|
|
995
1004
|
|
|
996
|
-
`),
|
|
1005
|
+
`), i = st(
|
|
997
1006
|
this,
|
|
998
1007
|
this.onChunkProcessed,
|
|
999
1008
|
this.itemContextFns,
|
|
1000
1009
|
s.length
|
|
1001
|
-
), { bulkSize:
|
|
1002
|
-
bulkSize:
|
|
1003
|
-
maxConcurrency:
|
|
1010
|
+
), { bulkSize: o, maxConcurrency: n, maxFailures: c } = await se(a, {
|
|
1011
|
+
bulkSize: V(Je),
|
|
1012
|
+
maxConcurrency: V(Ke),
|
|
1004
1013
|
maxFailures: this.maxFailures
|
|
1005
1014
|
}), u = {
|
|
1006
|
-
bulkSize:
|
|
1007
|
-
maxConcurrency:
|
|
1015
|
+
bulkSize: o,
|
|
1016
|
+
maxConcurrency: n,
|
|
1008
1017
|
description: this.description,
|
|
1009
1018
|
onChunkProcessed: this.onChunkProcessed,
|
|
1010
1019
|
itemContextFns: this.itemContextFns,
|
|
@@ -1012,33 +1021,39 @@ class et {
|
|
|
1012
1021
|
maxFailures: c,
|
|
1013
1022
|
isCoverageTest: this.isCoverageTest,
|
|
1014
1023
|
runConfig: a
|
|
1015
|
-
},
|
|
1016
|
-
if (m
|
|
1017
|
-
const
|
|
1018
|
-
if (!
|
|
1019
|
-
throw new Error(
|
|
1020
|
-
|
|
1024
|
+
}, d = e.batch(s.length), m = await rt(s, r, i, u);
|
|
1025
|
+
if (d(m.length), this.isCoverageTest) {
|
|
1026
|
+
const p = m.filter((F) => F.passed).length, g = s.length > 0 ? p / s.length : 0, S = g >= this.threshold, A = `Coverage: ${p}/${s.length} (${(g * 100).toFixed(1)}%) - ${S ? "meets" : "below"} ${(this.threshold * 100).toFixed(1)}% threshold`;
|
|
1027
|
+
if (!S)
|
|
1028
|
+
throw new Error(A);
|
|
1029
|
+
const T = { passed: S, coverage: g, message: A };
|
|
1030
|
+
return e.emit({ event: P.output, value: T }), e.complete({ outcome: L.success, coverage: g, total: s.length }), T;
|
|
1021
1031
|
}
|
|
1022
|
-
const l = this.summarize(s,
|
|
1023
|
-
return e.
|
|
1032
|
+
const l = this.summarize(s, m);
|
|
1033
|
+
return e.emit({ event: P.output, value: l }), e.complete({
|
|
1034
|
+
outcome: L.success,
|
|
1035
|
+
total: s.length,
|
|
1036
|
+
passed: l.details.passed
|
|
1037
|
+
}), l;
|
|
1024
1038
|
} catch (s) {
|
|
1025
1039
|
throw e.error(s), s;
|
|
1026
1040
|
}
|
|
1027
1041
|
}
|
|
1028
1042
|
summarize(a, e) {
|
|
1029
|
-
const s =
|
|
1043
|
+
const s = Ze(a, e), r = et(s, this.description, this.maxFailures);
|
|
1030
1044
|
if (!s.allPassed)
|
|
1031
|
-
throw new Error(
|
|
1032
|
-
return
|
|
1045
|
+
throw new Error(r);
|
|
1046
|
+
return tt(s, r);
|
|
1033
1047
|
}
|
|
1034
1048
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return new
|
|
1049
|
+
function pt(t, a = {}) {
|
|
1050
|
+
return new ut(t, a);
|
|
1037
1051
|
}
|
|
1038
|
-
|
|
1052
|
+
pt.knownTexts = [];
|
|
1053
|
+
function Dt() {
|
|
1039
1054
|
return console.warn("scanJS is not available in browser environment"), Promise.resolve({});
|
|
1040
1055
|
}
|
|
1041
|
-
const
|
|
1056
|
+
const Y = {
|
|
1042
1057
|
name: "test_analysis_result",
|
|
1043
1058
|
schema: {
|
|
1044
1059
|
type: "object",
|
|
@@ -1059,14 +1074,19 @@ const G = {
|
|
|
1059
1074
|
required: ["hasIssues", "issues"],
|
|
1060
1075
|
additionalProperties: !1
|
|
1061
1076
|
}
|
|
1062
|
-
},
|
|
1063
|
-
async function
|
|
1064
|
-
|
|
1065
|
-
|
|
1077
|
+
}, Z = "test";
|
|
1078
|
+
async function le(t, a, e) {
|
|
1079
|
+
[a, e] = fe(a, e);
|
|
1080
|
+
const { text: s, context: r } = be(a, []), i = B(Z, e), o = z(Z, i.onProgress, i);
|
|
1081
|
+
o.start();
|
|
1066
1082
|
try {
|
|
1067
|
-
const
|
|
1083
|
+
const n = await ve.readFile(t, "utf-8");
|
|
1084
|
+
o.emit({ event: P.phase, phase: "file-read", path: t });
|
|
1085
|
+
const c = r ? `
|
|
1086
|
+
|
|
1087
|
+
${r}` : "", u = `Analyze this code and ${s}:
|
|
1068
1088
|
|
|
1069
|
-
${
|
|
1089
|
+
${C(n, { tag: "code-to-analyze" })}
|
|
1070
1090
|
|
|
1071
1091
|
Return a JSON object with:
|
|
1072
1092
|
- "hasIssues": boolean indicating if any issues were found
|
|
@@ -1077,302 +1097,314 @@ GUIDELINES:
|
|
|
1077
1097
|
- Provide specific line numbers or code references when possible
|
|
1078
1098
|
- Suggest concrete fixes for each issue identified
|
|
1079
1099
|
- Be concise but clear in your feedback
|
|
1080
|
-
- If no issues are found, return {"hasIssues": false, "issues": []}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1100
|
+
- If no issues are found, return {"hasIssues": false, "issues": []}${c}`;
|
|
1101
|
+
o.emit({ event: P.phase, phase: "analyzing" });
|
|
1102
|
+
const d = await ye(
|
|
1103
|
+
() => W(u, {
|
|
1104
|
+
...i,
|
|
1105
|
+
responseFormat: O(Y.name, Y.schema)
|
|
1084
1106
|
}),
|
|
1085
1107
|
{
|
|
1086
1108
|
label: "test chain",
|
|
1087
|
-
config:
|
|
1109
|
+
config: i
|
|
1088
1110
|
}
|
|
1089
|
-
),
|
|
1090
|
-
return
|
|
1091
|
-
|
|
1092
|
-
|
|
1111
|
+
), m = d.hasIssues ? d.issues : [];
|
|
1112
|
+
return o.emit({
|
|
1113
|
+
event: P.phase,
|
|
1114
|
+
phase: "analysis-complete",
|
|
1115
|
+
issueCount: m.length
|
|
1116
|
+
}), o.complete({ outcome: L.success }), m;
|
|
1117
|
+
} catch (n) {
|
|
1118
|
+
throw o.error(n), n;
|
|
1093
1119
|
}
|
|
1094
1120
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1121
|
+
le.knownTexts = [];
|
|
1122
|
+
const ee = "test-advice", dt = "Run the code with 5 boundary value test cases and report any that fail", mt = "Identify 5 passing scenarios and significant boundary conditions in this code. Provide minimal input examples for each scenario to demonstrate correctness.", ht = "Identify 5 failing scenarios and significant boundary conditions in this code. Provide minimal input examples for each scenario to demonstrate the failure. Assume DBC, and don't complain when types are specified in jsDoc.", gt = "Identify 5 defects in this code. Provide minimal input examples to demonstrate each defect.", ft = "Suggest 5 best practices improvements for this code.", bt = 'Suggest 5 "clean code" improvements for this code.', yt = "Identify 5 specific issues related to code quality, readability, and maintainability.", wt = "Suggest 5 refactors that would most improve the composibility of this code.", te = [
|
|
1123
|
+
dt,
|
|
1124
|
+
mt,
|
|
1125
|
+
ht,
|
|
1126
|
+
gt,
|
|
1127
|
+
ft,
|
|
1128
|
+
bt,
|
|
1129
|
+
yt,
|
|
1130
|
+
wt
|
|
1104
1131
|
];
|
|
1105
|
-
async function
|
|
1106
|
-
const e =
|
|
1132
|
+
async function vt(t, a = {}) {
|
|
1133
|
+
const e = B(ee, a), s = z(ee, e.onProgress, e);
|
|
1107
1134
|
s.start();
|
|
1108
1135
|
try {
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1136
|
+
const r = s.batch(te.length), o = (await we(
|
|
1137
|
+
te,
|
|
1138
|
+
async (n) => {
|
|
1139
|
+
const c = await le(t, n, {
|
|
1140
|
+
...e,
|
|
1141
|
+
onProgress: ae(e.onProgress, "test-advice:test")
|
|
1142
|
+
});
|
|
1143
|
+
return r(1), c;
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
maxParallel: 3,
|
|
1147
|
+
errorPosture: q.resilient,
|
|
1148
|
+
abortSignal: e.abortSignal,
|
|
1149
|
+
label: "test-advice:instructions"
|
|
1150
|
+
}
|
|
1151
|
+
)).filter(Array.isArray).flat();
|
|
1152
|
+
return s.complete({ outcome: L.success, totalIssues: o.length }), o;
|
|
1153
|
+
} catch (r) {
|
|
1154
|
+
throw s.error(r), r;
|
|
1120
1155
|
}
|
|
1121
1156
|
}
|
|
1122
|
-
|
|
1157
|
+
vt.knownTexts = [];
|
|
1158
|
+
pe.config();
|
|
1123
1159
|
export {
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
Ws as disambiguate,
|
|
1203
|
-
Gs as dismantle,
|
|
1204
|
-
Hs as dismantleFactory,
|
|
1205
|
-
Js as documentShrink,
|
|
1206
|
-
Ks as embed,
|
|
1207
|
-
Xs as embedAssembleSpan,
|
|
1160
|
+
Mt as CAPABILITY_KEYS,
|
|
1161
|
+
Nt as COMPLIANCE,
|
|
1162
|
+
$t as CONTEXT_KINDS,
|
|
1163
|
+
Bt as COST_POSTURE,
|
|
1164
|
+
zt as ChainEvent,
|
|
1165
|
+
Ot as ChainTree,
|
|
1166
|
+
Ut as ContextBudget,
|
|
1167
|
+
_t as Conversation,
|
|
1168
|
+
jt as DOMAIN,
|
|
1169
|
+
P as DomainEvent,
|
|
1170
|
+
qt as ENVIRONMENT,
|
|
1171
|
+
Vt as EmbeddingService,
|
|
1172
|
+
Wt as ErrorCategory,
|
|
1173
|
+
Gt as Kind,
|
|
1174
|
+
Ht as Level,
|
|
1175
|
+
Jt as ListStyle,
|
|
1176
|
+
Kt as ModelService,
|
|
1177
|
+
Xt as ModelSource,
|
|
1178
|
+
R as OpEvent,
|
|
1179
|
+
Qt as OptionSource,
|
|
1180
|
+
Yt as QUALITY_INTENT,
|
|
1181
|
+
Zt as RetryMode,
|
|
1182
|
+
es as SocraticMethod,
|
|
1183
|
+
ts as StatusCode,
|
|
1184
|
+
ss as SummaryMap,
|
|
1185
|
+
as as TelemetryEvent,
|
|
1186
|
+
rs as TimedAbortController,
|
|
1187
|
+
pt as aiArchExpect,
|
|
1188
|
+
ns as aiExpect,
|
|
1189
|
+
os as analyzeImage,
|
|
1190
|
+
is as analyzeImageMapDetail,
|
|
1191
|
+
cs as anySignal,
|
|
1192
|
+
ls as applyAllTargetingRules,
|
|
1193
|
+
us as applyFirstTargetingRule,
|
|
1194
|
+
ps as auto,
|
|
1195
|
+
ds as bool,
|
|
1196
|
+
ms as buildSeedGenerationPrompt,
|
|
1197
|
+
hs as buildVisionPrompt,
|
|
1198
|
+
gs as calculateStatistics,
|
|
1199
|
+
fs as calibrate,
|
|
1200
|
+
bs as calibrateInstructions,
|
|
1201
|
+
ys as calibrateSpec,
|
|
1202
|
+
ws as callAgent,
|
|
1203
|
+
vs as categorySamples,
|
|
1204
|
+
xs as causalFramePrompt,
|
|
1205
|
+
Ss as centralTendency,
|
|
1206
|
+
ks as centralTendencyLines,
|
|
1207
|
+
Cs as chunk,
|
|
1208
|
+
Is as chunkSentences,
|
|
1209
|
+
As as classify,
|
|
1210
|
+
Es as cleanupPaths,
|
|
1211
|
+
Ps as collectEventsWith,
|
|
1212
|
+
Ts as collectTerms,
|
|
1213
|
+
Rs as combinations,
|
|
1214
|
+
Ds as commonalities,
|
|
1215
|
+
Ls as compact,
|
|
1216
|
+
Fs as computeTagStatistics,
|
|
1217
|
+
Ms as config,
|
|
1218
|
+
Ns as constants,
|
|
1219
|
+
$s as conversationTurnReduce,
|
|
1220
|
+
Bs as cosineSimilarity,
|
|
1221
|
+
zs as createBatches,
|
|
1222
|
+
Os as createContextBuilder,
|
|
1223
|
+
z as createProgressEmitter,
|
|
1224
|
+
me as createTempDir,
|
|
1225
|
+
Us as createTraceCollector,
|
|
1226
|
+
_s as date,
|
|
1227
|
+
js as debug,
|
|
1228
|
+
W as default,
|
|
1229
|
+
qs as descriptorToSchema,
|
|
1230
|
+
Vs as detectPatterns,
|
|
1231
|
+
Ws as detectThreshold,
|
|
1232
|
+
Gs as determineStyle,
|
|
1233
|
+
Hs as disambiguate,
|
|
1234
|
+
Js as dismantle,
|
|
1235
|
+
Ks as documentShrink,
|
|
1236
|
+
Xs as embed,
|
|
1237
|
+
Qs as embedAssembleSpan,
|
|
1208
1238
|
Ys as embedBatch,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
na as
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
wa as evaluateTargetingRule,
|
|
1231
|
-
Sa as eventToTrace,
|
|
1232
|
-
xa as expect,
|
|
1239
|
+
Zs as embedBuildIndex,
|
|
1240
|
+
ea as embedChunked,
|
|
1241
|
+
ta as embedImage,
|
|
1242
|
+
sa as embedImageBatch,
|
|
1243
|
+
aa as embedMergeRanges,
|
|
1244
|
+
ra as embedMultiQuery,
|
|
1245
|
+
na as embedNeighborChunks,
|
|
1246
|
+
oa as embedNormalizeText,
|
|
1247
|
+
ia as embedObject,
|
|
1248
|
+
ca as embedRewriteQuery,
|
|
1249
|
+
la as embedRewriteToOutputDoc,
|
|
1250
|
+
ua as embedStandaloneSpan,
|
|
1251
|
+
pa as embedStepBack,
|
|
1252
|
+
da as embedSubquestions,
|
|
1253
|
+
ma as embedWarmup,
|
|
1254
|
+
ha as entityInstructions,
|
|
1255
|
+
ga as entitySpec,
|
|
1256
|
+
fa as evaluateTargetingClause,
|
|
1257
|
+
ba as evaluateTargetingRule,
|
|
1258
|
+
ya as eventToTrace,
|
|
1259
|
+
wa as expect,
|
|
1233
1260
|
va as extractBlocks,
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1261
|
+
Ce as extractButtons,
|
|
1262
|
+
xa as extractEntities,
|
|
1263
|
+
ke as extractForms,
|
|
1264
|
+
Sa as extractJson,
|
|
1265
|
+
Se as extractLinks,
|
|
1266
|
+
Ae as extractMeta,
|
|
1267
|
+
Pe as extractPage,
|
|
1268
|
+
ka as extractRelations,
|
|
1269
|
+
Ie as extractScripts,
|
|
1270
|
+
Ee as extractStructure,
|
|
1242
1271
|
Ca as fillMissing,
|
|
1243
|
-
|
|
1272
|
+
Ia as filter,
|
|
1244
1273
|
Aa as filterAmbiguous,
|
|
1274
|
+
Ea as filterEach,
|
|
1245
1275
|
Pa as find,
|
|
1246
|
-
|
|
1247
|
-
Ra as
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
Ya as
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1276
|
+
Ta as findEach,
|
|
1277
|
+
Ra as generateList,
|
|
1278
|
+
Da as getMeanings,
|
|
1279
|
+
La as getOption,
|
|
1280
|
+
Fa as getOptionDetail,
|
|
1281
|
+
se as getOptions,
|
|
1282
|
+
Ma as glossary,
|
|
1283
|
+
Na as group,
|
|
1284
|
+
$a as groupEach,
|
|
1285
|
+
Tt as imageToBase64,
|
|
1286
|
+
Ba as init,
|
|
1287
|
+
za as intent,
|
|
1288
|
+
Oa as intersections,
|
|
1289
|
+
Ua as join,
|
|
1290
|
+
O as jsonSchema,
|
|
1291
|
+
_a as last,
|
|
1292
|
+
ja as list,
|
|
1293
|
+
qa as listBatch,
|
|
1294
|
+
Va as listExpand,
|
|
1295
|
+
W as llm,
|
|
1296
|
+
Wa as llmLogger,
|
|
1297
|
+
Ga as makePrompt,
|
|
1298
|
+
Ha as map,
|
|
1299
|
+
Ja as mapEach,
|
|
1300
|
+
xe as mapImageShrink,
|
|
1301
|
+
Ka as mapTags,
|
|
1302
|
+
Xa as name,
|
|
1303
|
+
Qa as nameSimilarTo,
|
|
1304
|
+
B as nameStep,
|
|
1305
|
+
Ya as normalizeInstruction,
|
|
1306
|
+
Za as normalizeLlm,
|
|
1307
|
+
er as normalizeRubric,
|
|
1308
|
+
tr as number,
|
|
1309
|
+
sr as numberWithUnits,
|
|
1310
|
+
ar as observeApplication,
|
|
1311
|
+
rr as observeProviders,
|
|
1312
|
+
nr as omit,
|
|
1313
|
+
or as pFilter,
|
|
1314
|
+
ir as pFind,
|
|
1315
|
+
cr as pGroup,
|
|
1316
|
+
lr as pMap,
|
|
1317
|
+
ur as pReduce,
|
|
1318
|
+
we as parallel,
|
|
1319
|
+
pr as parallelMap,
|
|
1320
|
+
dr as parseLLMList,
|
|
1321
|
+
mr as parseRDFLiteral,
|
|
1322
|
+
hr as parseRelations,
|
|
1323
|
+
gr as people,
|
|
1324
|
+
fr as phailForge,
|
|
1325
|
+
br as pick,
|
|
1326
|
+
yr as pipe,
|
|
1327
|
+
wr as popReference,
|
|
1328
|
+
vr as promptCache,
|
|
1329
|
+
xr as promptPiece,
|
|
1330
|
+
Sr as prompts,
|
|
1331
|
+
kr as questions,
|
|
1332
|
+
Cr as rangeCombinations,
|
|
1333
|
+
ge as reduce,
|
|
1334
|
+
Ir as reduceEach,
|
|
1335
|
+
Ar as relationInstructions,
|
|
1336
|
+
Er as relationSpec,
|
|
1337
|
+
Et as resizeImage,
|
|
1338
|
+
fe as resolveArgs,
|
|
1339
|
+
Pr as resolveEmbedding,
|
|
1340
|
+
Tr as resolveModel,
|
|
1341
|
+
Rr as resolveOutputDir,
|
|
1342
|
+
be as resolveTexts,
|
|
1343
|
+
ye as retry,
|
|
1344
|
+
Dr as ringBuffer,
|
|
1345
|
+
Lr as scaleInstructions,
|
|
1346
|
+
Fr as scaleItem,
|
|
1347
|
+
Mr as scaleSpec,
|
|
1348
|
+
Dt as scanJS,
|
|
1349
|
+
Nr as schemaOrg,
|
|
1350
|
+
$r as schemas,
|
|
1351
|
+
Br as scientificFramingPrompt,
|
|
1352
|
+
ae as scopePhase,
|
|
1353
|
+
zr as score,
|
|
1354
|
+
Or as scoreChunksByProbes,
|
|
1355
|
+
Ur as scoreInstructions,
|
|
1356
|
+
_r as scoreItem,
|
|
1357
|
+
jr as scoreMatrix,
|
|
1358
|
+
qr as scoreMatrixInstructions,
|
|
1359
|
+
Vr as scoreSpec,
|
|
1360
|
+
Wr as sentiment,
|
|
1361
|
+
Gr as setEmbedEnabled,
|
|
1362
|
+
Hr as setImageProcessingEnabled,
|
|
1363
|
+
Jr as setInterval,
|
|
1364
|
+
Kr as shuffle,
|
|
1365
|
+
Xr as simplifyTree,
|
|
1366
|
+
We as siteCrawl,
|
|
1367
|
+
Qr as slot,
|
|
1368
|
+
Yr as socratic,
|
|
1369
|
+
Zr as softCoverPrompt,
|
|
1370
|
+
en as sort,
|
|
1371
|
+
tn as sortBy,
|
|
1372
|
+
sn as split,
|
|
1373
|
+
an as stripNumeric,
|
|
1374
|
+
rn as stripResponse,
|
|
1375
|
+
nn as suggestTargetingRules,
|
|
1376
|
+
on as tagInstructions,
|
|
1377
|
+
cn as tagItem,
|
|
1378
|
+
ln as tagSpec,
|
|
1379
|
+
un as tagVocabulary,
|
|
1380
|
+
pn as targetingClause,
|
|
1381
|
+
dn as targetingRule,
|
|
1382
|
+
mn as targetingRuleOps,
|
|
1383
|
+
hn as targetingRuleSchema,
|
|
1384
|
+
gn as templateBuilder,
|
|
1385
|
+
fn as templateReplace,
|
|
1386
|
+
le as test,
|
|
1387
|
+
vt as testAdvice,
|
|
1388
|
+
bn as themes,
|
|
1389
|
+
Pt as tileImages,
|
|
1390
|
+
yn as timeline,
|
|
1391
|
+
wn as toBool,
|
|
1392
|
+
vn as toDate,
|
|
1393
|
+
xn as toEnum,
|
|
1394
|
+
Sn as toNumber,
|
|
1395
|
+
kn as toNumberWithUnits,
|
|
1396
|
+
Cn as toObject,
|
|
1397
|
+
In as truncate,
|
|
1398
|
+
An as unionBy,
|
|
1399
|
+
En as validateTargetingRules,
|
|
1400
|
+
Pn as valueArbitrate,
|
|
1401
|
+
Tn as vectorSearch,
|
|
1402
|
+
Rn as veiledVariantStrategies,
|
|
1403
|
+
Dn as veiledVariants,
|
|
1404
|
+
Ln as version,
|
|
1405
|
+
Rt as webScrape,
|
|
1406
|
+
Fn as windowFor,
|
|
1407
|
+
Mn as withInactivityTimeout,
|
|
1408
|
+
V as withPolicy,
|
|
1409
|
+
Nn as zipWith
|
|
1378
1410
|
};
|