@far-world-labs/verblets 0.6.4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -4
- package/dist/index.browser.js +211 -221
- package/dist/index.js +587 -569
- package/dist/shared-Dc73O74G.js +12507 -0
- package/package.json +2 -2
- package/dist/shared-CsrVgt_K.js +0 -11483
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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 M, g as se, E as q, a as me, O as D, w as V, r as W, j as U, b as he, D as O, d as C, e as T, s as ae, f as ge, h as fe, k as be, l as ye, p as we } from "./shared-Dc73O74G.js";
|
|
3
|
+
import { cJ as Nt, L as $t, I as Bt, M as Mt, bX as Ut, aI as Ot, bV as zt, aE as _t, K as jt, J as qt, cH as Vt, bZ as Wt, b_ as Gt, an as Ht, cG as Jt, c0 as Kt, c1 as Xt, Q as Yt, a_ as Qt, b$ as Zt, b1 as es, bY as ts, bP as ss, bi as as, bd as ns, be as rs, bO as os, a4 as is, a3 as cs, bg as ls, u as us, aB as ps, bf as ds, aa as ms, F as hs, H as gs, G as fs, aA as bs, bb as ys, a6 as ws, a7 as vs, co as xs, bJ as Ss, x as ks, m as Cs, bU as Is, aC as As, bH as Es, aD as Ps, cp as Ts, b3 as Rs, cL as Ds, t as Ls, aF as Fs, cq as Ns, bL as $s, N as Bs, W as Ms, v as Us, bK as Os, U as zs, a8 as _s, a9 as js, ao as qs, aG as Vs, aJ as Ws, aL as Gs, bo as Hs, bF as Js, bp as Ks, bD as Xs, bq as Ys, bt as Qs, bu as Zs, bE as ea, bx as ta, bC as sa, bB as aa, cE as na, bw as ra, bA as oa, bG as ia, by as ca, bz as la, br as ua, ad as pa, ac as da, a1 as ma, a2 as ha, X as ga, bh as fa, ae as ba, ab as ya, cf as wa, aU as va, aM as xa, af as Sa, aN as ka, c8 as Ca, ag as Ia, c9 as Aa, al as Ea, aH as Pa, S as Ta, T as Ra, ah as Da, ai as La, cb as Fa, cK as Na, bj as $a, aj as Ba, aO as Ma, cr as Ua, ak as Oa, am as za, ap as _a, bk as ja, bl as qa, aq as Va, c7 as Wa, ay as Ga, aP as Ha, aQ as Ja, bR as Ka, bM as Xa, y as Ya, z as Qa, P as Za, R as en, cs as tn, c3 as sn, c4 as an, c6 as nn, c2 as rn, c5 as on, bN as cn, cn as ln, aW as un, aX as pn, aR as dn, bl as mn, ct as hn, cz as gn, aS as fn, cC as bn, cD as yn, cA as wn, aT as vn, bI as xn, ca as Sn, aY as kn, aV as Cn, cI as In, cF as An, o as En, bW as Pn, C as Tn, A as Rn, B as Dn, aZ as Ln, cB as Fn, ba as Nn, ar as $n, bv as Bn, au as Mn, at as Un, as as On, bm as zn, bs as _n, q as jn, bn as qn, cy as Vn, aK as Wn, bT as Gn, a$ as Hn, bc as Jn, av as Kn, cu as Xn, b0 as Yn, ch as Qn, cg as Zn, a5 as er, az as tr, aw as sr, ax as ar, b2 as nr, Z as rr, _ as or, Y as ir, a0 as cr, bS as lr, bQ as ur, b4 as pr, b5 as dr, ci as mr, ck as hr, cl as gr, cj as fr, cm as br, b6 as yr, b7 as wr, cv as vr, $ as xr, V as Sr, cw as kr, b9 as Cr, b8 as Ir, cc as Ar, cd as Er, ce as Pr, cx as Tr } from "./shared-Dc73O74G.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 z = 60, xe = (t) => ({
|
|
10
|
+
low: { width: 300, quality: z, format: "jpeg" },
|
|
11
|
+
med: { width: 100, quality: z, format: "jpeg" },
|
|
12
|
+
high: { width: 50, quality: z, 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
19
|
return [...document.querySelectorAll("a[href]")].map((n) => {
|
|
20
20
|
const o = n.href;
|
|
@@ -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"]'
|
|
@@ -93,7 +93,7 @@ const N = 60, de = (t) => ({
|
|
|
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,15 +143,15 @@ 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
148
|
const n = [...document.querySelectorAll('link[rel="stylesheet"]')].map((l) => l.href), o = /* @__PURE__ */ new Set(), i = (l) => {
|
|
149
|
-
const
|
|
150
|
-
return typeof
|
|
149
|
+
const p = l.className;
|
|
150
|
+
return typeof p == "string" ? p : p?.baseVal || "";
|
|
151
151
|
};
|
|
152
152
|
document.querySelectorAll("[class]").forEach((l) => {
|
|
153
|
-
i(l).split(/\s+/).slice(0, 5).forEach((
|
|
154
|
-
|
|
153
|
+
i(l).split(/\s+/).slice(0, 5).forEach((p) => {
|
|
154
|
+
p && o.add(p);
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
157
|
const r = [...o].slice(0, 200), c = {}, u = [
|
|
@@ -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,64 +198,64 @@ 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:
|
|
206
|
+
dataAttributes: Array.from(s).toSorted().slice(0, 100),
|
|
207
207
|
stylesheets: n.slice(0, 20),
|
|
208
208
|
sampleClasses: r,
|
|
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
|
-
}),
|
|
214
|
+
}), Pe = async (t) => {
|
|
215
215
|
const a = t.url(), e = new URL(a).origin, [s, n, o, i, r, c] = await Promise.all([
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
216
|
+
Se(t, e),
|
|
217
|
+
ke(t),
|
|
218
|
+
Ce(t),
|
|
219
|
+
Ie(t),
|
|
220
|
+
Ae(t),
|
|
221
|
+
Ee(t)
|
|
222
222
|
]);
|
|
223
223
|
return { url: a, links: s, forms: n, buttons: o, scripts: i, meta: r, structure: c };
|
|
224
|
-
},
|
|
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(([n], [o]) => n.localeCompare(o));
|
|
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, n = a.maxDepth ?? 10, o = [], i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u =
|
|
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, n = a.maxDepth ?? 10, o = [], i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = _(t);
|
|
233
233
|
return o.push({ url: t, normalized: u, depth: 0, source: "(start)" }), c.add(u), {
|
|
234
|
-
addLinks: (b,
|
|
235
|
-
let
|
|
236
|
-
for (const
|
|
237
|
-
const
|
|
238
|
-
if (c.has(
|
|
239
|
-
if (c.add(
|
|
240
|
-
r.set(
|
|
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
|
+
r.set(x, "external");
|
|
241
241
|
continue;
|
|
242
242
|
}
|
|
243
|
-
if (
|
|
244
|
-
r.set(
|
|
243
|
+
if (w + 1 > n) {
|
|
244
|
+
r.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
|
-
r.set(
|
|
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
|
+
r.set(x, "resource");
|
|
250
250
|
continue;
|
|
251
251
|
}
|
|
252
|
-
if (/^(mailto|tel|javascript):/i.test(
|
|
253
|
-
r.set(
|
|
252
|
+
if (/^(mailto|tel|javascript):/i.test(v)) {
|
|
253
|
+
r.set(x, "scheme");
|
|
254
254
|
continue;
|
|
255
255
|
}
|
|
256
|
-
o.push({ url:
|
|
256
|
+
o.push({ url: v, normalized: x, depth: w + 1, source: h }), y++;
|
|
257
257
|
}
|
|
258
|
-
return
|
|
258
|
+
return y;
|
|
259
259
|
},
|
|
260
260
|
next: () => {
|
|
261
261
|
const b = o.shift();
|
|
@@ -265,21 +265,22 @@ const N = 60, de = (t) => ({
|
|
|
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
|
+
r.set(x, w), h.add(x);
|
|
272
273
|
}
|
|
273
|
-
const y =
|
|
274
|
-
return o.
|
|
274
|
+
const y = o.length, f = o.filter((v) => !h.has(v.normalized));
|
|
275
|
+
return o.splice(0, o.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 o) {
|
|
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
285
|
size: () => o.length,
|
|
285
286
|
visitedCount: () => i.size,
|
|
@@ -290,17 +291,25 @@ const N = 60, de = (t) => ({
|
|
|
290
291
|
skipped: r.size,
|
|
291
292
|
seen: c.size
|
|
292
293
|
}),
|
|
293
|
-
visitedUrls: () => [...i.entries()].map(([b,
|
|
294
|
+
visitedUrls: () => [...i.entries()].map(([b, w]) => ({
|
|
294
295
|
normalized: b,
|
|
295
|
-
...
|
|
296
|
+
...w
|
|
296
297
|
})),
|
|
297
|
-
skippedUrls: () => [...r.entries()].map(([b,
|
|
298
|
+
skippedUrls: () => [...r.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
|
+
}), ne = {
|
|
304
313
|
baseDelay: 5e3,
|
|
305
314
|
// 5s initial wait
|
|
306
315
|
maxDelay: 3e5,
|
|
@@ -311,77 +320,88 @@ 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
|
-
},
|
|
335
|
+
return Math.round(Le(s, a.jitter));
|
|
336
|
+
}, Ne = async (t, a, e, s) => {
|
|
328
337
|
const n = Date.now(), o = n + t;
|
|
329
338
|
let i = 0;
|
|
330
339
|
for (; i < t; ) {
|
|
331
340
|
const r = t - i, c = Math.min(e, r);
|
|
332
341
|
await new Promise((u) => setTimeout(u, c)), i = Date.now() - n, a.emit({
|
|
333
|
-
event:
|
|
342
|
+
event: I.tick,
|
|
334
343
|
elapsedMs: i,
|
|
335
344
|
remainingMs: Math.max(0, o - Date.now()),
|
|
336
345
|
totalMs: t,
|
|
337
346
|
...s
|
|
338
347
|
});
|
|
339
348
|
}
|
|
340
|
-
},
|
|
341
|
-
const r = { ...
|
|
349
|
+
}, $e = async (t, a, e, s, n, o, i) => {
|
|
350
|
+
const r = { ...ne, ...n };
|
|
342
351
|
let c = 0;
|
|
343
352
|
for (let u = 0; u <= r.maxRetries; u++) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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 o(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 };
|
|
347
367
|
if (u >= r.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, r);
|
|
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
381
|
maxRetries: r.maxRetries,
|
|
362
382
|
delayMs: l,
|
|
363
383
|
totalCooldownMs: c
|
|
364
|
-
}), await
|
|
384
|
+
}), await Ne(l, s, i, {
|
|
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
|
+
}, Be = (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
|
-
},
|
|
404
|
+
}, K = "site-crawl", Me = "Browser support is disabled. Call init({ browser: true }) to enable.", Ue = (t, a) => {
|
|
385
405
|
const e = a.summary(), s = t.map((n) => `${new URL(n.url).pathname} — ${n.meta.title || "(no title)"} [${n.links.length} links, ${n.forms.length} forms, ${n.buttons.length} buttons]`);
|
|
386
406
|
return [
|
|
387
407
|
`Crawled ${e.visited} pages, ${e.pending} pending, ${e.skipped} skipped.`,
|
|
@@ -390,7 +410,7 @@ const N = 60, de = (t) => ({
|
|
|
390
410
|
...s.map((n) => ` ${n}`)
|
|
391
411
|
].join(`
|
|
392
412
|
`);
|
|
393
|
-
},
|
|
413
|
+
}, Oe = (t, a, e) => {
|
|
394
414
|
const s = [];
|
|
395
415
|
for (const [n, o] of t) {
|
|
396
416
|
const i = o.slice(0, 5).map((c) => ` ${c.url}`), r = o.length > 5 ? ` ... and ${o.length - 5} more` : "";
|
|
@@ -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
|
+
}, ze = U("crawl_gate", {
|
|
416
436
|
type: "object",
|
|
417
437
|
properties: {
|
|
418
438
|
decisions: {
|
|
@@ -439,34 +459,34 @@ const N = 60, de = (t) => ({
|
|
|
439
459
|
},
|
|
440
460
|
required: ["decisions"],
|
|
441
461
|
additionalProperties: !1
|
|
442
|
-
}),
|
|
462
|
+
}), _e = async (t, a, e, s) => {
|
|
443
463
|
const n = t.pendingByPrefix(2);
|
|
444
464
|
if (n.size === 0) return { explore: [], skip: [], decisions: [] };
|
|
445
|
-
const o =
|
|
465
|
+
const o = Ue(a, t), i = Oe(n, o, e), c = (await W(i, {
|
|
446
466
|
...s,
|
|
447
|
-
|
|
467
|
+
responseFormat: ze,
|
|
448
468
|
temperature: 0.2
|
|
449
|
-
}))?.decisions || [], u = [],
|
|
450
|
-
for (const
|
|
451
|
-
const l = n.get(
|
|
469
|
+
}))?.decisions || [], u = [], d = [];
|
|
470
|
+
for (const m of c) {
|
|
471
|
+
const l = n.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 n)
|
|
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, n, o) => {
|
|
464
484
|
await t.goto(a, { waitUntil: "domcontentloaded", timeout: 3e4 }), await t.waitForTimeout(1500);
|
|
465
|
-
const i = await
|
|
485
|
+
const i = await Pe(t);
|
|
466
486
|
if (n.screenshots) {
|
|
467
487
|
const c = `${s.dir}/crawl-${Date.now()}.png`;
|
|
468
488
|
if (await t.screenshot({ path: c, fullPage: !1 }), s.track(c), n.imageShrink) {
|
|
469
|
-
const u = await
|
|
489
|
+
const u = await he(c, {
|
|
470
490
|
...n.imageShrink,
|
|
471
491
|
outputDir: s.dir
|
|
472
492
|
});
|
|
@@ -483,14 +503,14 @@ const N = 60, de = (t) => ({
|
|
|
483
503
|
status: c.status(),
|
|
484
504
|
method: c.request().method()
|
|
485
505
|
})), e.clear(), i;
|
|
486
|
-
},
|
|
506
|
+
}, qe = (t) => {
|
|
487
507
|
const a = {};
|
|
488
508
|
for (const e of t) {
|
|
489
509
|
const s = e.links.filter((n) => n.isSameDomain && !n.isAnchor).map((n) => n.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 || []) {
|
|
@@ -498,100 +518,100 @@ const N = 60, de = (t) => ({
|
|
|
498
518
|
a.has(n) ? a.get(n).seenOn.push(e.url) : a.set(n, { ...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(Me);
|
|
523
|
+
const e = B(K, a), s = M(K, e.onProgress, e);
|
|
504
524
|
s.start();
|
|
505
|
-
const n = await
|
|
525
|
+
const n = 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
|
-
}), o = { ...
|
|
535
|
+
}), o = { ...ne, ...e.cooldown }, i = e.isBlocked || De, r = Re(t, {
|
|
516
536
|
sameDomain: n.sameDomain,
|
|
517
537
|
maxDepth: n.maxDepth
|
|
518
|
-
}), c = await
|
|
538
|
+
}), c = await me("site-crawl", e.outputDir), d = await (e.browserEngine ? J[e.browserEngine] : J.chromium).launch({
|
|
519
539
|
headless: n.headless,
|
|
520
540
|
...e.launchOptions
|
|
521
541
|
});
|
|
522
542
|
s.emit({ event: "browser", headless: n.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 P =
|
|
558
|
+
let S = 0, A = t;
|
|
559
|
+
const P = Be(s, n.heartbeatInterval, () => ({
|
|
540
560
|
pagesVisited: g.length,
|
|
541
561
|
maxPages: n.maxPages,
|
|
542
562
|
pending: r.size(),
|
|
543
|
-
currentUrl:
|
|
563
|
+
currentUrl: A,
|
|
544
564
|
...r.summary()
|
|
545
|
-
}));
|
|
565
|
+
})), L = s.batch(n.maxPages);
|
|
546
566
|
try {
|
|
547
567
|
for (; !r.isEmpty() && g.length < n.maxPages; ) {
|
|
548
568
|
if (g.length > 0 && g.length % n.gateInterval === 0 && r.size() > 0) {
|
|
549
569
|
const y = n.maxPages - g.length;
|
|
550
570
|
s.emit({ event: "gate:start", pending: r.size(), budget: y });
|
|
551
|
-
const f = await
|
|
552
|
-
|
|
571
|
+
const f = await _e(r, g, y, e);
|
|
572
|
+
S++, f.skip.length > 0 && r.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 = r.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
586
|
maxPages: n.maxPages
|
|
567
587
|
});
|
|
568
588
|
try {
|
|
569
|
-
const y = (
|
|
589
|
+
const y = (E, ue) => je(E, ue, p, c, n, s), { pageData: f, blocked: v } = await $e(
|
|
570
590
|
y,
|
|
571
591
|
l,
|
|
572
|
-
|
|
592
|
+
h.url,
|
|
573
593
|
s,
|
|
574
594
|
o,
|
|
575
595
|
i,
|
|
576
596
|
n.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 : r.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
610
|
pending: r.size(),
|
|
591
|
-
blocked:
|
|
592
|
-
});
|
|
611
|
+
blocked: v
|
|
612
|
+
}), L(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 }), n.errorPosture === q.strict) throw y;
|
|
595
615
|
}
|
|
596
616
|
}
|
|
597
617
|
} finally {
|
|
@@ -599,39 +619,41 @@ const N = 60, de = (t) => ({
|
|
|
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:
|
|
631
|
+
graph: H,
|
|
632
|
+
apis: b,
|
|
613
633
|
frontier: r.summary(),
|
|
614
634
|
skipped: r.skippedUrls(),
|
|
615
|
-
gateCallCount:
|
|
635
|
+
gateCallCount: S,
|
|
616
636
|
cleanup: () => c.cleanup()
|
|
617
637
|
};
|
|
618
638
|
return s.complete({
|
|
619
|
-
outcome:
|
|
639
|
+
outcome: D.success,
|
|
620
640
|
pagesVisited: g.length,
|
|
621
|
-
apisFound:
|
|
622
|
-
gateCallCount:
|
|
641
|
+
apisFound: b.length,
|
|
642
|
+
gateCallCount: S,
|
|
623
643
|
...r.summary()
|
|
624
|
-
}),
|
|
625
|
-
} catch (
|
|
626
|
-
throw s.error(
|
|
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 re = 1, F = 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 ? F : typeof t == "number" ? t : { small: 10, med: F, large: 40 }[t] ?? F, 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,7 +663,7 @@ function Oe(t, a) {
|
|
|
641
663
|
});
|
|
642
664
|
return e;
|
|
643
665
|
}
|
|
644
|
-
function
|
|
666
|
+
function Y(t, a, e, s, n, o) {
|
|
645
667
|
return {
|
|
646
668
|
chunkIndex: t.index,
|
|
647
669
|
totalChunks: a,
|
|
@@ -654,28 +676,22 @@ function W(t, a, e, s, n, o) {
|
|
|
654
676
|
parallelMode: !0
|
|
655
677
|
};
|
|
656
678
|
}
|
|
657
|
-
async function
|
|
679
|
+
async function Ye(t, a, e, s, n, o = {}) {
|
|
658
680
|
try {
|
|
659
|
-
const i = e.map((
|
|
681
|
+
const i = e.map((d) => ce(d(t))).filter(Boolean).join(`
|
|
660
682
|
|
|
661
683
|
`), r = [a, i].filter(Boolean).join(`
|
|
662
684
|
|
|
663
|
-
`), c =
|
|
685
|
+
`), c = ct(r, t, s, n === "files"), u = await W(c, {
|
|
664
686
|
...o,
|
|
665
|
-
|
|
666
|
-
type: "json_schema",
|
|
667
|
-
json_schema: {
|
|
668
|
-
name: "arch_result",
|
|
669
|
-
schema: Ke
|
|
670
|
-
}
|
|
671
|
-
}
|
|
687
|
+
responseFormat: U("arch_result", rt)
|
|
672
688
|
});
|
|
673
689
|
return { item: t, ...u, error: void 0 };
|
|
674
690
|
} catch (i) {
|
|
675
691
|
return { item: t, passed: !1, reason: `Analysis failed: ${i.message}`, error: i };
|
|
676
692
|
}
|
|
677
693
|
}
|
|
678
|
-
function
|
|
694
|
+
function Qe(t, a, e, s) {
|
|
679
695
|
const n = [], o = [];
|
|
680
696
|
let i = s;
|
|
681
697
|
for (const r of t)
|
|
@@ -688,57 +704,51 @@ function je(t, a, e, s) {
|
|
|
688
704
|
shouldStop: !a && i >= e
|
|
689
705
|
};
|
|
690
706
|
}
|
|
691
|
-
function
|
|
707
|
+
function R(t, a, e, s) {
|
|
692
708
|
t && t(a, e, s);
|
|
693
709
|
}
|
|
694
|
-
async function
|
|
695
|
-
|
|
710
|
+
async function oe(t, a, e, s, n, o = {}) {
|
|
711
|
+
R(s, t, void 0, {
|
|
696
712
|
...n,
|
|
697
|
-
status:
|
|
713
|
+
status: T.start
|
|
698
714
|
});
|
|
699
715
|
try {
|
|
700
|
-
const i =
|
|
716
|
+
const i = lt(a, t, e), r = {
|
|
701
717
|
...o,
|
|
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,
|
|
718
|
+
responseFormat: U("arch_bulk_result", ot),
|
|
719
|
+
onProgress: ae(s, "reduce")
|
|
720
|
+
}, c = await ge(t, i, r), 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 R(
|
|
719
729
|
s,
|
|
720
730
|
t,
|
|
721
|
-
|
|
731
|
+
m > 0 ? new Error(`${m} items failed`) : void 0,
|
|
722
732
|
{
|
|
723
733
|
...n,
|
|
724
|
-
status:
|
|
734
|
+
status: T.complete,
|
|
725
735
|
passed: l,
|
|
726
|
-
failed:
|
|
736
|
+
failed: m
|
|
727
737
|
}
|
|
728
|
-
),
|
|
738
|
+
), d;
|
|
729
739
|
} catch (i) {
|
|
730
740
|
const r = t.map((c) => ({
|
|
731
741
|
path: c,
|
|
732
742
|
passed: !1,
|
|
733
743
|
reason: `Processing error: ${i.message}`
|
|
734
744
|
}));
|
|
735
|
-
return
|
|
745
|
+
return R(s, t, i, {
|
|
736
746
|
...n,
|
|
737
|
-
status:
|
|
747
|
+
status: T.error
|
|
738
748
|
}), r;
|
|
739
749
|
}
|
|
740
750
|
}
|
|
741
|
-
function
|
|
751
|
+
function Ze(t, a) {
|
|
742
752
|
const e = a.filter((r) => r.passed).length, s = a.length - e, n = s === 0, o = a.length < t.length, i = a.filter((r) => !r.passed);
|
|
743
753
|
return {
|
|
744
754
|
passed: e,
|
|
@@ -750,18 +760,18 @@ function qe(t, a) {
|
|
|
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
|
-
`), n = t.failures.length >
|
|
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((o) => ` • ${o.item}: ${o.reason || "Failed"}`).join(`
|
|
767
|
+
`), n = t.failures.length > j ? `
|
|
768
|
+
... and ${t.failures.length - j} more failures` : "";
|
|
769
|
+
return `${t.failed}/${t.processed} items failed: ${a}${t.stoppedEarly && e !== re ? ` (stopped after ${e} failures)` : ""}
|
|
760
770
|
|
|
761
771
|
Failures:
|
|
762
772
|
${s}${n}`;
|
|
763
773
|
}
|
|
764
|
-
function
|
|
774
|
+
function tt(t, a) {
|
|
765
775
|
return {
|
|
766
776
|
passed: t.allPassed,
|
|
767
777
|
message: a,
|
|
@@ -774,12 +784,12 @@ function We(t, a) {
|
|
|
774
784
|
}
|
|
775
785
|
};
|
|
776
786
|
}
|
|
777
|
-
function
|
|
778
|
-
const n = a || e.length > 0 || s <=
|
|
787
|
+
function st(t, a, e, s) {
|
|
788
|
+
const n = a || e.length > 0 || s <= He;
|
|
779
789
|
return {
|
|
780
|
-
mode: n ?
|
|
790
|
+
mode: n ? $.INDIVIDUAL : $.BULK,
|
|
781
791
|
batchSize: n ? t.maxConcurrency : t.bulkSize,
|
|
782
|
-
processor: n ? (o, i, r) =>
|
|
792
|
+
processor: n ? (o, i, r) => ie(o, i, r) : (o, i, r) => oe(
|
|
783
793
|
o.items,
|
|
784
794
|
i,
|
|
785
795
|
r.description,
|
|
@@ -788,9 +798,9 @@ function Ge(t, a, e, s) {
|
|
|
788
798
|
)
|
|
789
799
|
};
|
|
790
800
|
}
|
|
791
|
-
|
|
801
|
+
function ie(t, a, e) {
|
|
792
802
|
const s = t.items.map(
|
|
793
|
-
(n) =>
|
|
803
|
+
(n) => Ye(
|
|
794
804
|
n,
|
|
795
805
|
a,
|
|
796
806
|
e.itemContextFns,
|
|
@@ -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: n, failures: o, shouldStop: i } =
|
|
814
|
+
function at(t, a, e) {
|
|
815
|
+
if (a === $.INDIVIDUAL) {
|
|
816
|
+
const { results: s, errors: n, failures: o, shouldStop: i } = Qe(
|
|
807
817
|
t,
|
|
808
818
|
e.isCoverageTest,
|
|
809
819
|
e.maxFailures,
|
|
@@ -837,27 +847,27 @@ function He(t, a, e) {
|
|
|
837
847
|
};
|
|
838
848
|
}
|
|
839
849
|
}
|
|
840
|
-
async function
|
|
841
|
-
const n =
|
|
850
|
+
async function nt(t, a, e, s) {
|
|
851
|
+
const n = Xe(t, e.batchSize), o = [];
|
|
842
852
|
let i = 0;
|
|
843
853
|
for (const r of n) {
|
|
844
854
|
if (!s.isCoverageTest && i >= s.maxFailures)
|
|
845
855
|
break;
|
|
846
|
-
const c =
|
|
856
|
+
const c = Y(
|
|
847
857
|
r,
|
|
848
858
|
n.length,
|
|
849
859
|
t.length,
|
|
850
|
-
|
|
860
|
+
T.start,
|
|
851
861
|
s,
|
|
852
862
|
e.mode
|
|
853
863
|
);
|
|
854
|
-
|
|
864
|
+
R(s.onChunkProcessed, r.items, void 0, c);
|
|
855
865
|
let u;
|
|
856
|
-
e.mode ===
|
|
866
|
+
e.mode === $.INDIVIDUAL ? u = await ie(r, a, {
|
|
857
867
|
itemContextFns: s.itemContextFns,
|
|
858
868
|
description: s.description,
|
|
859
869
|
targetType: s.targetType
|
|
860
|
-
}) : u = await
|
|
870
|
+
}) : u = await oe(
|
|
861
871
|
r.items,
|
|
862
872
|
a,
|
|
863
873
|
s.description,
|
|
@@ -865,38 +875,38 @@ async function Je(t, a, e, s) {
|
|
|
865
875
|
c,
|
|
866
876
|
s.runConfig
|
|
867
877
|
);
|
|
868
|
-
const
|
|
878
|
+
const d = at(u, e.mode, {
|
|
869
879
|
...s,
|
|
870
880
|
currentFailures: i
|
|
871
881
|
});
|
|
872
|
-
if (o.push(...
|
|
882
|
+
if (o.push(...d.results), i = d.failures, R(
|
|
873
883
|
s.onChunkProcessed,
|
|
874
884
|
r.items,
|
|
875
|
-
|
|
885
|
+
d.errors.length > 0 ? d.errors[0] : void 0,
|
|
876
886
|
{
|
|
877
|
-
...
|
|
887
|
+
...Y(
|
|
878
888
|
r,
|
|
879
889
|
n.length,
|
|
880
890
|
t.length,
|
|
881
|
-
|
|
891
|
+
T.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
900
|
return o;
|
|
891
901
|
}
|
|
892
|
-
const
|
|
902
|
+
const rt = {
|
|
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 n =
|
|
952
|
-
return
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
954
|
+
function ct(t, a, e, s) {
|
|
955
|
+
const n = it(a);
|
|
956
|
+
return [
|
|
957
|
+
t,
|
|
958
|
+
`Analyze this ${s ? "file" : "directory"}: ${a}`,
|
|
959
|
+
C(n, { 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 || re, this.bulkSize = e.bulkSize || F, 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,26 +990,26 @@ 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 = M("ai-arch-expect", a.onProgress, a);
|
|
999
|
+
e.start(), e.emit({ event: O.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(), n = this.contexts.map(
|
|
1003
|
+
const s = await this.target.resolve(), n = this.contexts.map(ce).filter(Boolean).join(`
|
|
995
1004
|
|
|
996
|
-
`), o =
|
|
1005
|
+
`), o = st(
|
|
997
1006
|
this,
|
|
998
1007
|
this.onChunkProcessed,
|
|
999
1008
|
this.itemContextFns,
|
|
1000
1009
|
s.length
|
|
1001
|
-
), { bulkSize: i, maxConcurrency: r, maxFailures: c } = await
|
|
1002
|
-
bulkSize:
|
|
1003
|
-
maxConcurrency:
|
|
1010
|
+
), { bulkSize: i, maxConcurrency: r, maxFailures: c } = await se(a, {
|
|
1011
|
+
bulkSize: V(Je),
|
|
1012
|
+
maxConcurrency: V(Ke),
|
|
1004
1013
|
maxFailures: this.maxFailures
|
|
1005
1014
|
}), u = {
|
|
1006
1015
|
bulkSize: i,
|
|
@@ -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 nt(s, n, o, u);
|
|
1025
|
+
if (d(m.length), this.isCoverageTest) {
|
|
1026
|
+
const p = m.filter((L) => L.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 P = { passed: S, coverage: g, message: A };
|
|
1030
|
+
return e.emit({ event: O.output, value: P }), e.complete({ outcome: D.success, coverage: g, total: s.length }), P;
|
|
1021
1031
|
}
|
|
1022
|
-
const l = this.summarize(s,
|
|
1023
|
-
return e.
|
|
1032
|
+
const l = this.summarize(s, m);
|
|
1033
|
+
return e.emit({ event: O.output, value: l }), e.complete({
|
|
1034
|
+
outcome: D.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), n = et(s, this.description, this.maxFailures);
|
|
1030
1044
|
if (!s.allPassed)
|
|
1031
1045
|
throw new Error(n);
|
|
1032
|
-
return
|
|
1046
|
+
return tt(s, n);
|
|
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 Q = {
|
|
1042
1057
|
name: "test_analysis_result",
|
|
1043
1058
|
schema: {
|
|
1044
1059
|
type: "object",
|
|
@@ -1059,14 +1074,17 @@ const G = {
|
|
|
1059
1074
|
required: ["hasIssues", "issues"],
|
|
1060
1075
|
additionalProperties: !1
|
|
1061
1076
|
}
|
|
1062
|
-
},
|
|
1063
|
-
async function
|
|
1064
|
-
|
|
1065
|
-
n
|
|
1077
|
+
}, Z = "test";
|
|
1078
|
+
async function le(t, a, e) {
|
|
1079
|
+
[a, e] = fe(a, e);
|
|
1080
|
+
const { text: s, context: n } = be(a, []), o = B(Z, e), i = M(Z, o.onProgress, o);
|
|
1081
|
+
i.start();
|
|
1066
1082
|
try {
|
|
1067
|
-
const
|
|
1083
|
+
const r = await ve.readFile(t, "utf-8"), c = n ? `
|
|
1068
1084
|
|
|
1069
|
-
${
|
|
1085
|
+
${n}` : "", u = `Analyze this code and ${s}:
|
|
1086
|
+
|
|
1087
|
+
${C(r, { tag: "code-to-analyze" })}
|
|
1070
1088
|
|
|
1071
1089
|
Return a JSON object with:
|
|
1072
1090
|
- "hasIssues": boolean indicating if any issues were found
|
|
@@ -1077,302 +1095,302 @@ GUIDELINES:
|
|
|
1077
1095
|
- Provide specific line numbers or code references when possible
|
|
1078
1096
|
- Suggest concrete fixes for each issue identified
|
|
1079
1097
|
- Be concise but clear in your feedback
|
|
1080
|
-
- If no issues are found, return {"hasIssues": false, "issues": []}`,
|
|
1081
|
-
() =>
|
|
1082
|
-
...
|
|
1083
|
-
|
|
1098
|
+
- If no issues are found, return {"hasIssues": false, "issues": []}${c}`, d = await ye(
|
|
1099
|
+
() => W(u, {
|
|
1100
|
+
...o,
|
|
1101
|
+
responseFormat: U(Q.name, Q.schema)
|
|
1084
1102
|
}),
|
|
1085
1103
|
{
|
|
1086
1104
|
label: "test chain",
|
|
1087
|
-
config:
|
|
1105
|
+
config: o
|
|
1088
1106
|
}
|
|
1089
|
-
),
|
|
1090
|
-
return
|
|
1091
|
-
} catch (
|
|
1092
|
-
throw
|
|
1107
|
+
), m = d.hasIssues ? d.issues : [];
|
|
1108
|
+
return i.complete({ outcome: D.success }), m;
|
|
1109
|
+
} catch (r) {
|
|
1110
|
+
throw i.error(r), r;
|
|
1093
1111
|
}
|
|
1094
1112
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1113
|
+
le.knownTexts = [];
|
|
1114
|
+
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 = [
|
|
1115
|
+
dt,
|
|
1116
|
+
mt,
|
|
1117
|
+
ht,
|
|
1118
|
+
gt,
|
|
1119
|
+
ft,
|
|
1120
|
+
bt,
|
|
1121
|
+
yt,
|
|
1122
|
+
wt
|
|
1104
1123
|
];
|
|
1105
|
-
async function
|
|
1106
|
-
const e =
|
|
1124
|
+
async function vt(t, a = {}) {
|
|
1125
|
+
const e = B(ee, a), s = M(ee, e.onProgress, e);
|
|
1107
1126
|
s.start();
|
|
1108
1127
|
try {
|
|
1109
|
-
const n = s.batch(
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1128
|
+
const n = s.batch(te.length), i = (await we(
|
|
1129
|
+
te,
|
|
1130
|
+
async (r) => {
|
|
1131
|
+
const c = await le(t, r, {
|
|
1132
|
+
...e,
|
|
1133
|
+
onProgress: ae(e.onProgress, "test-advice:test")
|
|
1134
|
+
});
|
|
1135
|
+
return n(1), c;
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
maxParallel: 3,
|
|
1139
|
+
errorPosture: q.resilient,
|
|
1140
|
+
abortSignal: e.abortSignal,
|
|
1141
|
+
label: "test-advice:instructions"
|
|
1142
|
+
}
|
|
1143
|
+
)).flat();
|
|
1144
|
+
return s.complete({ outcome: D.success, totalIssues: i.length }), i;
|
|
1118
1145
|
} catch (n) {
|
|
1119
1146
|
throw s.error(n), n;
|
|
1120
1147
|
}
|
|
1121
1148
|
}
|
|
1122
|
-
|
|
1149
|
+
vt.knownTexts = [];
|
|
1150
|
+
pe.config();
|
|
1123
1151
|
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
|
-
Ls as createEntityExtractor,
|
|
1188
|
-
L as createProgressEmitter,
|
|
1189
|
-
Fs as createRelationExtractor,
|
|
1190
|
-
Ms as createScale,
|
|
1191
|
-
Ns as createTagExtractor,
|
|
1192
|
-
_s as createTagger,
|
|
1193
|
-
oe as createTempDir,
|
|
1194
|
-
Bs as createTraceCollector,
|
|
1152
|
+
Nt as CAPABILITY_KEYS,
|
|
1153
|
+
$t as COMPLIANCE,
|
|
1154
|
+
Bt as CONTEXT_KINDS,
|
|
1155
|
+
Mt as COST_POSTURE,
|
|
1156
|
+
Ut as ChainEvent,
|
|
1157
|
+
Ot as ChainTree,
|
|
1158
|
+
zt as ContextBudget,
|
|
1159
|
+
_t as Conversation,
|
|
1160
|
+
jt as DOMAIN,
|
|
1161
|
+
O as DomainEvent,
|
|
1162
|
+
qt as ENVIRONMENT,
|
|
1163
|
+
Vt as EmbeddingService,
|
|
1164
|
+
Wt as Kind,
|
|
1165
|
+
Gt as Level,
|
|
1166
|
+
Ht as ListStyle,
|
|
1167
|
+
Jt as ModelService,
|
|
1168
|
+
Kt as ModelSource,
|
|
1169
|
+
T as OpEvent,
|
|
1170
|
+
Xt as OptionSource,
|
|
1171
|
+
Yt as QUALITY_INTENT,
|
|
1172
|
+
Qt as SocraticMethod,
|
|
1173
|
+
Zt as StatusCode,
|
|
1174
|
+
es as SummaryMap,
|
|
1175
|
+
ts as TelemetryEvent,
|
|
1176
|
+
ss as TimedAbortController,
|
|
1177
|
+
pt as aiArchExpect,
|
|
1178
|
+
as as aiExpect,
|
|
1179
|
+
ns as analyzeImage,
|
|
1180
|
+
rs as analyzeImageMapDetail,
|
|
1181
|
+
os as anySignal,
|
|
1182
|
+
is as applyAllTargetingRules,
|
|
1183
|
+
cs as applyFirstTargetingRule,
|
|
1184
|
+
ls as auto,
|
|
1185
|
+
us as bool,
|
|
1186
|
+
ps as buildSeedGenerationPrompt,
|
|
1187
|
+
ds as buildVisionPrompt,
|
|
1188
|
+
ms as calculateStatistics,
|
|
1189
|
+
hs as calibrate,
|
|
1190
|
+
gs as calibrateInstructions,
|
|
1191
|
+
fs as calibrateSpec,
|
|
1192
|
+
bs as categorySamples,
|
|
1193
|
+
ys as causalFramePrompt,
|
|
1194
|
+
ws as centralTendency,
|
|
1195
|
+
vs as centralTendencyLines,
|
|
1196
|
+
xs as chunk,
|
|
1197
|
+
Ss as chunkSentences,
|
|
1198
|
+
ks as classify,
|
|
1199
|
+
Cs as cleanupPaths,
|
|
1200
|
+
Is as collectEventsWith,
|
|
1201
|
+
As as collectTerms,
|
|
1202
|
+
Es as combinations,
|
|
1203
|
+
Ps as commonalities,
|
|
1204
|
+
Ts as compact,
|
|
1205
|
+
Rs as computeTagStatistics,
|
|
1206
|
+
Ds as config,
|
|
1207
|
+
Ls as constants,
|
|
1208
|
+
Fs as conversationTurnReduce,
|
|
1209
|
+
Ns as cosineSimilarity,
|
|
1210
|
+
$s as createBatches,
|
|
1211
|
+
Bs as createContextBuilder,
|
|
1212
|
+
M as createProgressEmitter,
|
|
1213
|
+
me as createTempDir,
|
|
1214
|
+
Ms as createTraceCollector,
|
|
1195
1215
|
Us as date,
|
|
1196
1216
|
Os as debug,
|
|
1197
|
-
|
|
1217
|
+
W as default,
|
|
1198
1218
|
zs as descriptorToSchema,
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1219
|
+
_s as detectPatterns,
|
|
1220
|
+
js as detectThreshold,
|
|
1221
|
+
qs as determineStyle,
|
|
1222
|
+
Vs as disambiguate,
|
|
1223
|
+
Ws as dismantle,
|
|
1224
|
+
Gs as documentShrink,
|
|
1225
|
+
Hs as embed,
|
|
1226
|
+
Js as embedAssembleSpan,
|
|
1227
|
+
Ks as embedBatch,
|
|
1228
|
+
Xs as embedBuildIndex,
|
|
1229
|
+
Ys as embedChunked,
|
|
1230
|
+
Qs as embedImage,
|
|
1231
|
+
Zs as embedImageBatch,
|
|
1211
1232
|
ea as embedMergeRanges,
|
|
1212
1233
|
ta as embedMultiQuery,
|
|
1213
1234
|
sa as embedNeighborChunks,
|
|
1214
1235
|
aa as embedNormalizeText,
|
|
1215
|
-
na as
|
|
1216
|
-
ra as
|
|
1217
|
-
oa as
|
|
1236
|
+
na as embedObject,
|
|
1237
|
+
ra as embedRewriteQuery,
|
|
1238
|
+
oa as embedRewriteToOutputDoc,
|
|
1218
1239
|
ia as embedStandaloneSpan,
|
|
1219
1240
|
ca as embedStepBack,
|
|
1220
1241
|
la as embedSubquestions,
|
|
1221
1242
|
ua as embedWarmup,
|
|
1222
|
-
pa as
|
|
1223
|
-
da as
|
|
1224
|
-
ma as
|
|
1225
|
-
ha as
|
|
1226
|
-
ga as
|
|
1227
|
-
fa as
|
|
1228
|
-
ba as
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
Ca as
|
|
1243
|
-
|
|
1244
|
-
Aa as
|
|
1245
|
-
Pa as find,
|
|
1243
|
+
pa as entityInstructions,
|
|
1244
|
+
da as entitySpec,
|
|
1245
|
+
ma as evaluateTargetingClause,
|
|
1246
|
+
ha as evaluateTargetingRule,
|
|
1247
|
+
ga as eventToTrace,
|
|
1248
|
+
fa as expect,
|
|
1249
|
+
ba as extractBlocks,
|
|
1250
|
+
Ce as extractButtons,
|
|
1251
|
+
ya as extractEntities,
|
|
1252
|
+
ke as extractForms,
|
|
1253
|
+
wa as extractJson,
|
|
1254
|
+
Se as extractLinks,
|
|
1255
|
+
Ae as extractMeta,
|
|
1256
|
+
Pe as extractPage,
|
|
1257
|
+
va as extractRelations,
|
|
1258
|
+
Ie as extractScripts,
|
|
1259
|
+
Ee as extractStructure,
|
|
1260
|
+
xa as fillMissing,
|
|
1261
|
+
Sa as filter,
|
|
1262
|
+
ka as filterAmbiguous,
|
|
1263
|
+
Ca as filterEach,
|
|
1264
|
+
Ia as find,
|
|
1265
|
+
Aa as findEach,
|
|
1246
1266
|
Ea as generateList,
|
|
1247
|
-
|
|
1267
|
+
Pa as getMeanings,
|
|
1248
1268
|
Ta as getOption,
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1269
|
+
Ra as getOptionDetail,
|
|
1270
|
+
se as getOptions,
|
|
1271
|
+
Da as glossary,
|
|
1252
1272
|
La as group,
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
Ua as
|
|
1261
|
-
Oa as
|
|
1262
|
-
za as
|
|
1263
|
-
|
|
1273
|
+
Fa as groupEach,
|
|
1274
|
+
Tt as imageToBase64,
|
|
1275
|
+
Na as init,
|
|
1276
|
+
$a as intent,
|
|
1277
|
+
Ba as intersections,
|
|
1278
|
+
Ma as join,
|
|
1279
|
+
U as jsonSchema,
|
|
1280
|
+
Ua as last,
|
|
1281
|
+
Oa as list,
|
|
1282
|
+
za as listBatch,
|
|
1283
|
+
_a as listExpand,
|
|
1284
|
+
W as llm,
|
|
1264
1285
|
ja as llmLogger,
|
|
1265
1286
|
qa as makePrompt,
|
|
1266
1287
|
Va as map,
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
Ga as
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
Ka as
|
|
1274
|
-
Xa as
|
|
1275
|
-
Ya as
|
|
1276
|
-
Qa as
|
|
1277
|
-
Za as
|
|
1278
|
-
en as
|
|
1279
|
-
tn as
|
|
1280
|
-
sn as
|
|
1281
|
-
an as
|
|
1282
|
-
nn as
|
|
1283
|
-
rn as
|
|
1284
|
-
on as
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
fn as
|
|
1295
|
-
bn as
|
|
1296
|
-
yn as
|
|
1297
|
-
wn as
|
|
1298
|
-
|
|
1299
|
-
xn as
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
Cn as
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
En as
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1288
|
+
Wa as mapEach,
|
|
1289
|
+
xe as mapImageShrink,
|
|
1290
|
+
Ga as mapTags,
|
|
1291
|
+
Ha as name,
|
|
1292
|
+
Ja as nameSimilarTo,
|
|
1293
|
+
B as nameStep,
|
|
1294
|
+
Ka as normalizeInstruction,
|
|
1295
|
+
Xa as normalizeLlm,
|
|
1296
|
+
Ya as number,
|
|
1297
|
+
Qa as numberWithUnits,
|
|
1298
|
+
Za as observeApplication,
|
|
1299
|
+
en as observeProviders,
|
|
1300
|
+
tn as omit,
|
|
1301
|
+
sn as pFilter,
|
|
1302
|
+
an as pFind,
|
|
1303
|
+
nn as pGroup,
|
|
1304
|
+
rn as pMap,
|
|
1305
|
+
on as pReduce,
|
|
1306
|
+
we as parallel,
|
|
1307
|
+
cn as parallelMap,
|
|
1308
|
+
ln as parseLLMList,
|
|
1309
|
+
un as parseRDFLiteral,
|
|
1310
|
+
pn as parseRelations,
|
|
1311
|
+
dn as people,
|
|
1312
|
+
mn as phailForge,
|
|
1313
|
+
hn as pick,
|
|
1314
|
+
gn as pipe,
|
|
1315
|
+
fn as popReference,
|
|
1316
|
+
bn as promptCache,
|
|
1317
|
+
yn as promptPiece,
|
|
1318
|
+
wn as prompts,
|
|
1319
|
+
vn as questions,
|
|
1320
|
+
xn as rangeCombinations,
|
|
1321
|
+
ge as reduce,
|
|
1322
|
+
Sn as reduceEach,
|
|
1323
|
+
kn as relationInstructions,
|
|
1324
|
+
Cn as relationSpec,
|
|
1325
|
+
Et as resizeImage,
|
|
1326
|
+
fe as resolveArgs,
|
|
1327
|
+
In as resolveEmbedding,
|
|
1328
|
+
An as resolveModel,
|
|
1329
|
+
En as resolveOutputDir,
|
|
1330
|
+
be as resolveTexts,
|
|
1331
|
+
ye as retry,
|
|
1332
|
+
Pn as ringBuffer,
|
|
1333
|
+
Tn as scaleInstructions,
|
|
1334
|
+
Rn as scaleItem,
|
|
1335
|
+
Dn as scaleSpec,
|
|
1336
|
+
Dt as scanJS,
|
|
1314
1337
|
Ln as schemaOrg,
|
|
1315
1338
|
Fn as schemas,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
Un as
|
|
1322
|
-
On as
|
|
1323
|
-
zn as
|
|
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
|
-
wt as webScrape,
|
|
1374
|
-
Lr as windowFor,
|
|
1375
|
-
Fr as withInactivityTimeout,
|
|
1376
|
-
B as withPolicy,
|
|
1377
|
-
Mr as zipWith
|
|
1339
|
+
Nn as scientificFramingPrompt,
|
|
1340
|
+
ae as scopePhase,
|
|
1341
|
+
$n as score,
|
|
1342
|
+
Bn as scoreChunksByProbes,
|
|
1343
|
+
Mn as scoreInstructions,
|
|
1344
|
+
Un as scoreItem,
|
|
1345
|
+
On as scoreSpec,
|
|
1346
|
+
zn as sentiment,
|
|
1347
|
+
_n as setEmbedEnabled,
|
|
1348
|
+
jn as setImageProcessingEnabled,
|
|
1349
|
+
qn as setInterval,
|
|
1350
|
+
Vn as shuffle,
|
|
1351
|
+
Wn as simplifyTree,
|
|
1352
|
+
We as siteCrawl,
|
|
1353
|
+
Gn as slot,
|
|
1354
|
+
Hn as socratic,
|
|
1355
|
+
Jn as softCoverPrompt,
|
|
1356
|
+
Kn as sort,
|
|
1357
|
+
Xn as sortBy,
|
|
1358
|
+
Yn as split,
|
|
1359
|
+
Qn as stripNumeric,
|
|
1360
|
+
Zn as stripResponse,
|
|
1361
|
+
er as suggestTargetingRules,
|
|
1362
|
+
tr as tagInstructions,
|
|
1363
|
+
sr as tagItem,
|
|
1364
|
+
ar as tagSpec,
|
|
1365
|
+
nr as tagVocabulary,
|
|
1366
|
+
rr as targetingClause,
|
|
1367
|
+
or as targetingRule,
|
|
1368
|
+
ir as targetingRuleOps,
|
|
1369
|
+
cr as targetingRuleSchema,
|
|
1370
|
+
lr as templateBuilder,
|
|
1371
|
+
ur as templateReplace,
|
|
1372
|
+
le as test,
|
|
1373
|
+
vt as testAdvice,
|
|
1374
|
+
pr as themes,
|
|
1375
|
+
Pt as tileImages,
|
|
1376
|
+
dr as timeline,
|
|
1377
|
+
mr as toBool,
|
|
1378
|
+
hr as toDate,
|
|
1379
|
+
gr as toEnum,
|
|
1380
|
+
fr as toNumber,
|
|
1381
|
+
br as toNumberWithUnits,
|
|
1382
|
+
yr as toObject,
|
|
1383
|
+
wr as truncate,
|
|
1384
|
+
vr as unionBy,
|
|
1385
|
+
xr as validateTargetingRules,
|
|
1386
|
+
Sr as valueArbitrate,
|
|
1387
|
+
kr as vectorSearch,
|
|
1388
|
+
Cr as veiledVariantStrategies,
|
|
1389
|
+
Ir as veiledVariants,
|
|
1390
|
+
Ar as version,
|
|
1391
|
+
Rt as webScrape,
|
|
1392
|
+
Er as windowFor,
|
|
1393
|
+
Pr as withInactivityTimeout,
|
|
1394
|
+
V as withPolicy,
|
|
1395
|
+
Tr as zipWith
|
|
1378
1396
|
};
|