@far-world-labs/verblets 0.7.4 → 0.8.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/dist/index.browser.js +213 -192
- package/dist/index.js +341 -299
- package/dist/shared-XTpEaaip.js +15133 -0
- package/package.json +1 -1
- package/dist/shared-BuJg0Ijm.js +0 -13465
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import pe from "dotenv";
|
|
2
|
-
import { i as de, n as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
2
|
+
import { i as de, n as U, c as z, g as se, E as V, a as me, O as R, r as G, j as O, b as he, w as W, D as E, d as C, e as D, s as ae, f as ge, h as fe, k as be, l as ye, p as we } from "./shared-XTpEaaip.js";
|
|
3
|
+
import { d6 as Mt, Q as Ft, M as Nt, S as Bt, ci as Ut, aY as zt, cg as Ot, aU as _t, P as jt, N as qt, d4 as Vt, cp as Wt, ck as Gt, cl as Ht, ax as Jt, d3 as Xt, cn as Kt, co as Yt, R as Qt, cq as Zt, bk as es, cm as ts, bn as ss, cj as as, ca as rs, bE as ns, bz as os, bA as is, c9 as cs, a8 as ls, a7 as us, bC as ps, u as ds, aR as ms, bB as hs, ae as gs, L as fs, H as bs, K as ys, c6 as ws, aQ as vs, bx as Ss, aa as xs, ab as ks, cN as Cs, c3 as Is, x as Ps, m as As, cf as Es, aS as Rs, c1 as Ts, aT as Ds, cO as Ls, bp as $s, d8 as Ms, t as Fs, aV as Ns, cP as Bs, c5 as Us, T as zs, _ as Os, v as _s, c4 as js, Y as qs, ac as Vs, ad as Ws, ay as Gs, aW as Hs, aZ as Js, a$ as Xs, bK as Ks, b$ as Ys, bL as Qs, bZ as Zs, bM as ea, bP as ta, bQ as sa, b_ as aa, bT as ra, bY as na, bX as oa, d1 as ia, bS as ca, bW as la, c0 as ua, bU as pa, bV as da, bN as ma, aj as ha, af as ga, ai as fa, a5 as ba, a6 as ya, $ as wa, bD as va, ak as Sa, cE as xa, b0 as ka, al as Ca, b1 as Ia, cx as Pa, u as Aa, am as Ea, an as Ra, cy as Ta, u as Da, ao as La, av as $a, aX as Ma, W as Fa, X as Na, ap as Ba, aq as Ua, cA as za, ar as Oa, as as _a, d7 as ja, bF as qa, at as Va, b2 as Wa, cQ as Ga, au as Ha, aw as Ja, az as Xa, bG as Ka, bH as Ya, aA as Qa, I as Za, J as er, cw as tr, ag as sr, ah as ar, aB as rr, aC as nr, b6 as or, b7 as ir, b9 as cr, ba as lr, bd as ur, be as pr, B as dr, C as mr, aO as hr, b3 as gr, b4 as fr, cc as br, c7 as yr, aJ as wr, y as vr, z as Sr, U as xr, V as kr, cR as Cr, cs as Ir, ct as Pr, cv as Ar, cr as Er, cu as Rr, c8 as Tr, cM as Dr, bg as Lr, bh as $r, b5 as Mr, bH as Fr, cS as Nr, cY as Br, b8 as Ur, c$ as zr, d0 as Or, cZ as _r, bb as jr, c2 as qr, cz as Vr, aD as Wr, bi as Gr, bc as Hr, bf as Jr, d5 as Xr, d2 as Kr, o as Yr, ch as Qr, G as Zr, A as en, F as tn, bj as sn, c_ as an, bw as rn, aE as nn, bR as on, aH as cn, aG as ln, aI as un, aK as pn, aF as dn, bI as mn, bO as hn, q as gn, bJ as fn, cX as bn, a_ as yn, ce as wn, bl as vn, by as Sn, aL as xn, cT as kn, bm as Cn, cG as In, cF as Pn, a9 as An, aP as En, aM as Rn, aN as Tn, bo as Dn, a1 as Ln, a2 as $n, a0 as Mn, a4 as Fn, cd as Nn, cb as Bn, bq as Un, br as zn, cH as On, cJ as _n, cK as jn, cI as qn, cL as Vn, bs as Wn, bt as Gn, cU as Hn, a3 as Jn, Z as Xn, cV as Kn, bv as Yn, bu as Qn, cB as Zn, cC as eo, cD as to, cW as so } from "./shared-XTpEaaip.js";
|
|
4
|
+
import * as X from "playwright-core";
|
|
5
5
|
import k from "node:fs";
|
|
6
6
|
import "node:path";
|
|
7
7
|
import "glob";
|
|
8
8
|
import ve from "node:fs/promises";
|
|
9
|
-
const
|
|
10
|
-
low: { width: 300, quality:
|
|
11
|
-
med: { width: 100, quality:
|
|
12
|
-
high: { width: 50, quality:
|
|
13
|
-
})[t],
|
|
9
|
+
const _ = 60, Se = (t) => ({
|
|
10
|
+
low: { width: 300, quality: _, format: "jpeg" },
|
|
11
|
+
med: { width: 100, quality: _, format: "jpeg" },
|
|
12
|
+
high: { width: 50, quality: _, format: "jpeg" }
|
|
13
|
+
})[t], H = (t) => () => {
|
|
14
14
|
throw new Error(`${t} is not available in browser environment`);
|
|
15
|
-
},
|
|
15
|
+
}, At = H("resizeImage"), Et = H("tileImages"), Rt = H("imageToBase64"), Tt = () => {
|
|
16
16
|
throw new Error("webScrape is not available in browser environment");
|
|
17
|
-
},
|
|
17
|
+
}, xe = async (t, a) => (await t.evaluate(() => {
|
|
18
18
|
const s = /* @__PURE__ */ new Set();
|
|
19
19
|
return [...document.querySelectorAll("a[href]")].map((r) => {
|
|
20
20
|
const i = r.href;
|
|
@@ -101,7 +101,7 @@ const U = 60, xe = (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
|
+
}))), Pe = (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 U = 60, xe = (t) => ({
|
|
|
128
128
|
content: e.content?.slice(0, 120)
|
|
129
129
|
}))
|
|
130
130
|
};
|
|
131
|
-
}),
|
|
131
|
+
}), Ae = (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)
|
|
@@ -211,49 +211,49 @@ const U = 60, xe = (t) => ({
|
|
|
211
211
|
iframeCount: document.querySelectorAll("iframe").length,
|
|
212
212
|
shadowRootCount: [...document.querySelectorAll("*")].filter((l) => l.shadowRoot).length
|
|
213
213
|
};
|
|
214
|
-
}),
|
|
214
|
+
}), Ee = async (t) => {
|
|
215
215
|
const a = t.url(), e = new URL(a).origin, [s, r, i, o, n, c] = await Promise.all([
|
|
216
|
-
|
|
216
|
+
xe(t, e),
|
|
217
217
|
ke(t),
|
|
218
218
|
Ce(t),
|
|
219
219
|
Ie(t),
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
Pe(t),
|
|
221
|
+
Ae(t)
|
|
222
222
|
]);
|
|
223
223
|
return { url: a, links: s, forms: r, buttons: i, scripts: o, meta: n, structure: c };
|
|
224
|
-
},
|
|
224
|
+
}, j = (t) => {
|
|
225
225
|
const a = new URL(t);
|
|
226
226
|
a.hash = "";
|
|
227
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, r = a.maxDepth ?? 10, i = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u =
|
|
231
|
+
}, Re = (t, a = 2) => `/${new URL(t).pathname.split("/").filter(Boolean).slice(0, a).join("/")}`, Te = (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 = j(t);
|
|
233
233
|
return i.push({ url: t, normalized: u, depth: 0, source: "(start)" }), c.add(u), {
|
|
234
234
|
addLinks: (b, w, h) => {
|
|
235
235
|
let y = 0;
|
|
236
236
|
for (const f of b) {
|
|
237
|
-
const v = f.href || f,
|
|
238
|
-
if (c.has(
|
|
239
|
-
if (c.add(
|
|
240
|
-
n.set(
|
|
237
|
+
const v = f.href || f, S = j(v);
|
|
238
|
+
if (c.has(S)) continue;
|
|
239
|
+
if (c.add(S), s && !v.startsWith(e)) {
|
|
240
|
+
n.set(S, "external");
|
|
241
241
|
continue;
|
|
242
242
|
}
|
|
243
243
|
if (w + 1 > r) {
|
|
244
|
-
n.set(
|
|
244
|
+
n.set(S, "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
|
-
n.set(
|
|
247
|
+
const A = new URL(v).pathname;
|
|
248
|
+
if (/\.(png|jpg|jpeg|gif|svg|ico|css|js|woff2?|ttf|eot|pdf|zip|mp[34])$/i.test(A)) {
|
|
249
|
+
n.set(S, "resource");
|
|
250
250
|
continue;
|
|
251
251
|
}
|
|
252
252
|
if (/^(mailto|tel|javascript):/i.test(v)) {
|
|
253
|
-
n.set(
|
|
253
|
+
n.set(S, "scheme");
|
|
254
254
|
continue;
|
|
255
255
|
}
|
|
256
|
-
i.push({ url: v, normalized:
|
|
256
|
+
i.push({ url: v, normalized: S, depth: w + 1, source: h }), y++;
|
|
257
257
|
}
|
|
258
258
|
return y;
|
|
259
259
|
},
|
|
@@ -268,8 +268,8 @@ const U = 60, xe = (t) => ({
|
|
|
268
268
|
skip: (b, w) => {
|
|
269
269
|
const h = /* @__PURE__ */ new Set();
|
|
270
270
|
for (const v of b) {
|
|
271
|
-
const
|
|
272
|
-
n.set(
|
|
271
|
+
const S = j(v);
|
|
272
|
+
n.set(S, w), h.add(S);
|
|
273
273
|
}
|
|
274
274
|
const y = i.length, f = i.filter((v) => !h.has(v.normalized));
|
|
275
275
|
return i.splice(0, i.length, ...f), y - f.length;
|
|
@@ -277,7 +277,7 @@ const U = 60, xe = (t) => ({
|
|
|
277
277
|
pendingByPrefix: (b = 2) => {
|
|
278
278
|
const w = /* @__PURE__ */ new Map();
|
|
279
279
|
for (const h of i) {
|
|
280
|
-
const y =
|
|
280
|
+
const y = Re(h.url, b), f = w.get(y) || [];
|
|
281
281
|
f.push(h), w.set(y, f);
|
|
282
282
|
}
|
|
283
283
|
return w;
|
|
@@ -330,7 +330,7 @@ const U = 60, xe = (t) => ({
|
|
|
330
330
|
}, Le = (t, a) => {
|
|
331
331
|
const e = t * a;
|
|
332
332
|
return t + (Math.random() * 2 - 1) * e;
|
|
333
|
-
},
|
|
333
|
+
}, $e = (t, a) => {
|
|
334
334
|
const e = a.baseDelay * Math.pow(a.backoffFactor, t), s = Math.min(e, a.maxDelay);
|
|
335
335
|
return Math.round(Le(s, a.jitter));
|
|
336
336
|
}, Me = async (t, a, e, s) => {
|
|
@@ -346,7 +346,7 @@ const U = 60, xe = (t) => ({
|
|
|
346
346
|
...s
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
},
|
|
349
|
+
}, Fe = async (t, a, e, s, r, i, o) => {
|
|
350
350
|
const n = { ...re, ...r };
|
|
351
351
|
let c = 0;
|
|
352
352
|
for (let u = 0; u <= n.maxRetries; u++) {
|
|
@@ -372,7 +372,7 @@ const U = 60, xe = (t) => ({
|
|
|
372
372
|
attempts: u + 1,
|
|
373
373
|
totalCooldownMs: c
|
|
374
374
|
}), { pageData: d, retries: u, totalCooldownMs: c, blocked: m };
|
|
375
|
-
const l =
|
|
375
|
+
const l = $e(u, n);
|
|
376
376
|
c += l, s.emit({
|
|
377
377
|
event: I.start,
|
|
378
378
|
url: e,
|
|
@@ -391,7 +391,7 @@ const U = 60, xe = (t) => ({
|
|
|
391
391
|
attempt: u + 1
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
-
},
|
|
394
|
+
}, Ne = (t, a, e) => {
|
|
395
395
|
const s = setInterval(() => {
|
|
396
396
|
t.emit({
|
|
397
397
|
event: I.heartbeat,
|
|
@@ -401,7 +401,7 @@ const U = 60, xe = (t) => ({
|
|
|
401
401
|
return {
|
|
402
402
|
stop: () => clearInterval(s)
|
|
403
403
|
};
|
|
404
|
-
}, K = "site-crawl", Be = "Browser support is disabled. Call init({ browser: true }) to enable.",
|
|
404
|
+
}, K = "site-crawl", Be = "Browser support is disabled. Call init({ browser: true }) to enable.", Ue = (t, a) => {
|
|
405
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]`);
|
|
406
406
|
return [
|
|
407
407
|
`Crawled ${e.visited} pages, ${e.pending} pending, ${e.skipped} skipped.`,
|
|
@@ -410,7 +410,7 @@ const U = 60, xe = (t) => ({
|
|
|
410
410
|
...s.map((r) => ` ${r}`)
|
|
411
411
|
].join(`
|
|
412
412
|
`);
|
|
413
|
-
},
|
|
413
|
+
}, ze = (t, a, e) => {
|
|
414
414
|
const s = [];
|
|
415
415
|
for (const [r, i] of t) {
|
|
416
416
|
const o = i.slice(0, 5).map((c) => ` ${c.url}`), n = i.length > 5 ? ` ... and ${i.length - 5} more` : "";
|
|
@@ -432,7 +432,7 @@ const U = 60, xe = (t) => ({
|
|
|
432
432
|
"Skip groups that are clearly non-functional (help/support, legal, marketing pages)."
|
|
433
433
|
].join(`
|
|
434
434
|
`);
|
|
435
|
-
},
|
|
435
|
+
}, Oe = O("crawl_gate", {
|
|
436
436
|
type: "object",
|
|
437
437
|
properties: {
|
|
438
438
|
decisions: {
|
|
@@ -462,11 +462,16 @@ const U = 60, xe = (t) => ({
|
|
|
462
462
|
}), _e = async (t, a, e, s) => {
|
|
463
463
|
const r = t.pendingByPrefix(2);
|
|
464
464
|
if (r.size === 0) return { explore: [], skip: [], decisions: [] };
|
|
465
|
-
const i =
|
|
465
|
+
const i = Ue(a, t), o = ze(r, i, e), n = await G(o, {
|
|
466
466
|
...s,
|
|
467
|
-
responseFormat:
|
|
467
|
+
responseFormat: Oe,
|
|
468
468
|
temperature: 0.2
|
|
469
|
-
})
|
|
469
|
+
});
|
|
470
|
+
if (!n || typeof n != "object" || !Array.isArray(n.decisions))
|
|
471
|
+
throw new Error(
|
|
472
|
+
`site-crawl: expected { decisions: [] } from gate LLM (got ${n === null ? "null" : typeof n})`
|
|
473
|
+
);
|
|
474
|
+
const { decisions: c } = n, u = [], d = [];
|
|
470
475
|
for (const m of c) {
|
|
471
476
|
const l = r.get(m.prefix);
|
|
472
477
|
if (l)
|
|
@@ -482,7 +487,7 @@ const U = 60, xe = (t) => ({
|
|
|
482
487
|
return { explore: u, skip: d, decisions: c };
|
|
483
488
|
}, je = async (t, a, e, s, r, i) => {
|
|
484
489
|
await t.goto(a, { waitUntil: "domcontentloaded", timeout: 3e4 }), await t.waitForTimeout(1500);
|
|
485
|
-
const o = await
|
|
490
|
+
const o = await Ee(t);
|
|
486
491
|
if (r.screenshots) {
|
|
487
492
|
const c = `${s.dir}/crawl-${Date.now()}.png`;
|
|
488
493
|
if (await t.screenshot({ path: c, fullPage: !1 }), s.track(c), r.imageShrink) {
|
|
@@ -520,7 +525,7 @@ const U = 60, xe = (t) => ({
|
|
|
520
525
|
return [...a.values()];
|
|
521
526
|
}, We = async (t, a = {}) => {
|
|
522
527
|
if (!de()) throw new Error(Be);
|
|
523
|
-
const e =
|
|
528
|
+
const e = U(K, a), s = z(K, e.onProgress, e);
|
|
524
529
|
s.start();
|
|
525
530
|
const r = await se(e, {
|
|
526
531
|
maxPages: 20,
|
|
@@ -529,13 +534,13 @@ const U = 60, xe = (t) => ({
|
|
|
529
534
|
gateInterval: 5,
|
|
530
535
|
headless: !0,
|
|
531
536
|
screenshots: !1,
|
|
532
|
-
errorPosture:
|
|
533
|
-
imageShrink:
|
|
537
|
+
errorPosture: V.resilient,
|
|
538
|
+
imageShrink: W(Se),
|
|
534
539
|
heartbeatInterval: 1e3
|
|
535
|
-
}), i = { ...re, ...e.cooldown }, o = e.isBlocked || De, n =
|
|
540
|
+
}), i = { ...re, ...e.cooldown }, o = e.isBlocked || De, n = Te(t, {
|
|
536
541
|
sameDomain: r.sameDomain,
|
|
537
542
|
maxDepth: r.maxDepth
|
|
538
|
-
}), c = await me("site-crawl", e.outputDir), d = await (e.browserEngine ?
|
|
543
|
+
}), c = await me("site-crawl", e.outputDir), d = await (e.browserEngine ? X[e.browserEngine] : X.chromium).launch({
|
|
539
544
|
headless: r.headless,
|
|
540
545
|
...e.launchOptions
|
|
541
546
|
});
|
|
@@ -555,21 +560,21 @@ const U = 60, xe = (t) => ({
|
|
|
555
560
|
}
|
|
556
561
|
};
|
|
557
562
|
})(), g = [];
|
|
558
|
-
let
|
|
559
|
-
const T =
|
|
563
|
+
let x = 0, P = t;
|
|
564
|
+
const T = Ne(s, r.heartbeatInterval, () => ({
|
|
560
565
|
pagesVisited: g.length,
|
|
561
566
|
maxPages: r.maxPages,
|
|
562
567
|
pending: n.size(),
|
|
563
|
-
currentUrl:
|
|
568
|
+
currentUrl: P,
|
|
564
569
|
...n.summary()
|
|
565
|
-
})),
|
|
570
|
+
})), $ = s.batch(r.maxPages);
|
|
566
571
|
try {
|
|
567
572
|
for (; !n.isEmpty() && g.length < r.maxPages; ) {
|
|
568
573
|
if (g.length > 0 && g.length % r.gateInterval === 0 && n.size() > 0) {
|
|
569
574
|
const y = r.maxPages - g.length;
|
|
570
575
|
s.emit({ event: "gate:start", pending: n.size(), budget: y });
|
|
571
576
|
const f = await _e(n, g, y, e);
|
|
572
|
-
|
|
577
|
+
x++, f.skip.length > 0 && n.skip(f.skip, "llm-gate"), s.emit({
|
|
573
578
|
event: "gate:complete",
|
|
574
579
|
explored: f.explore.length,
|
|
575
580
|
skipped: f.skip.length,
|
|
@@ -578,7 +583,7 @@ const U = 60, xe = (t) => ({
|
|
|
578
583
|
}
|
|
579
584
|
const h = n.next();
|
|
580
585
|
if (!h) break;
|
|
581
|
-
|
|
586
|
+
P = h.url, s.emit({
|
|
582
587
|
event: "page:start",
|
|
583
588
|
url: h.url,
|
|
584
589
|
depth: h.depth,
|
|
@@ -586,7 +591,7 @@ const U = 60, xe = (t) => ({
|
|
|
586
591
|
maxPages: r.maxPages
|
|
587
592
|
});
|
|
588
593
|
try {
|
|
589
|
-
const y = (
|
|
594
|
+
const y = (A, ue) => je(A, ue, p, c, r, s), { pageData: f, blocked: v } = await Fe(
|
|
590
595
|
y,
|
|
591
596
|
l,
|
|
592
597
|
h.url,
|
|
@@ -596,8 +601,8 @@ const U = 60, xe = (t) => ({
|
|
|
596
601
|
r.heartbeatInterval
|
|
597
602
|
);
|
|
598
603
|
f.depth = h.depth, f.source = h.source, v && (f.blocked = v), g.push(f);
|
|
599
|
-
const
|
|
600
|
-
f.links.filter((
|
|
604
|
+
const S = v ? 0 : n.addLinks(
|
|
605
|
+
f.links.filter((A) => A.isSameDomain && !A.isAnchor),
|
|
601
606
|
h.depth,
|
|
602
607
|
h.url
|
|
603
608
|
);
|
|
@@ -606,12 +611,12 @@ const U = 60, xe = (t) => ({
|
|
|
606
611
|
url: h.url,
|
|
607
612
|
links: f.links.length,
|
|
608
613
|
forms: f.forms.length,
|
|
609
|
-
newUrls:
|
|
614
|
+
newUrls: S,
|
|
610
615
|
pending: n.size(),
|
|
611
616
|
blocked: v
|
|
612
|
-
}),
|
|
617
|
+
}), $(1);
|
|
613
618
|
} catch (y) {
|
|
614
|
-
if (s.emit({ event: "page:error", url: h.url, error: y.message }), r.errorPosture ===
|
|
619
|
+
if (s.emit({ event: "page:error", url: h.url, error: y.message }), r.errorPosture === V.strict) throw y;
|
|
615
620
|
}
|
|
616
621
|
}
|
|
617
622
|
} finally {
|
|
@@ -626,20 +631,20 @@ const U = 60, xe = (t) => ({
|
|
|
626
631
|
s.emit({ event: "teardown" });
|
|
627
632
|
}
|
|
628
633
|
await m.close();
|
|
629
|
-
const
|
|
634
|
+
const J = qe(g), b = Ve(g), w = {
|
|
630
635
|
pages: g,
|
|
631
|
-
graph:
|
|
636
|
+
graph: J,
|
|
632
637
|
apis: b,
|
|
633
638
|
frontier: n.summary(),
|
|
634
639
|
skipped: n.skippedUrls(),
|
|
635
|
-
gateCallCount:
|
|
640
|
+
gateCallCount: x,
|
|
636
641
|
cleanup: () => c.cleanup()
|
|
637
642
|
};
|
|
638
643
|
return s.complete({
|
|
639
|
-
outcome:
|
|
644
|
+
outcome: R.success,
|
|
640
645
|
pagesVisited: g.length,
|
|
641
646
|
apisFound: b.length,
|
|
642
|
-
gateCallCount:
|
|
647
|
+
gateCallCount: x,
|
|
643
648
|
...n.summary()
|
|
644
649
|
}), w;
|
|
645
650
|
} catch (m) {
|
|
@@ -649,11 +654,11 @@ const U = 60, xe = (t) => ({
|
|
|
649
654
|
}
|
|
650
655
|
};
|
|
651
656
|
We.knownTexts = [];
|
|
652
|
-
const ne = 1,
|
|
657
|
+
const ne = 1, F = 20, N = 5, Ge = 0.5, He = 5, Y = 8e3, q = 5, B = {
|
|
653
658
|
INDIVIDUAL: "individual",
|
|
654
659
|
BULK: "bulk"
|
|
655
|
-
}, Je = (t) => t === void 0 ?
|
|
656
|
-
function
|
|
660
|
+
}, Je = (t) => t === void 0 ? F : typeof t == "number" ? t : { small: 10, med: F, large: 40 }[t] ?? F, Xe = (t) => t === void 0 ? N : typeof t == "number" ? t : { low: 2, med: N, high: 10 }[t] ?? N;
|
|
661
|
+
function Ke(t, a) {
|
|
657
662
|
const e = [];
|
|
658
663
|
for (let s = 0; s < t.length; s += a)
|
|
659
664
|
e.push({
|
|
@@ -676,13 +681,13 @@ function Q(t, a, e, s, r, i) {
|
|
|
676
681
|
parallelMode: !0
|
|
677
682
|
};
|
|
678
683
|
}
|
|
679
|
-
async function
|
|
684
|
+
async function Ye(t, a, e, s, r, i = {}) {
|
|
680
685
|
try {
|
|
681
686
|
const o = e.map((d) => ce(d(t))).filter(Boolean).join(`
|
|
682
687
|
|
|
683
688
|
`), n = [a, o].filter(Boolean).join(`
|
|
684
689
|
|
|
685
|
-
`), c = ct(n, t, s, r === "files"), u = await
|
|
690
|
+
`), c = ct(n, t, s, r === "files"), u = await G(c, {
|
|
686
691
|
...i,
|
|
687
692
|
responseFormat: O("arch_result", nt)
|
|
688
693
|
});
|
|
@@ -691,7 +696,7 @@ async function Qe(t, a, e, s, r, i = {}) {
|
|
|
691
696
|
return { item: t, passed: !1, reason: `Analysis failed: ${o.message}`, error: o };
|
|
692
697
|
}
|
|
693
698
|
}
|
|
694
|
-
function
|
|
699
|
+
function Qe(t, a, e, s) {
|
|
695
700
|
const r = [], i = [];
|
|
696
701
|
let o = s;
|
|
697
702
|
for (const n of t)
|
|
@@ -704,34 +709,39 @@ function Ye(t, a, e, s) {
|
|
|
704
709
|
shouldStop: !a && o >= e
|
|
705
710
|
};
|
|
706
711
|
}
|
|
707
|
-
function
|
|
712
|
+
function L(t, a, e, s) {
|
|
708
713
|
t && t(a, e, s);
|
|
709
714
|
}
|
|
710
715
|
async function oe(t, a, e, s, r, i = {}) {
|
|
711
|
-
|
|
716
|
+
L(s, t, void 0, {
|
|
712
717
|
...r,
|
|
713
|
-
status:
|
|
718
|
+
status: D.start
|
|
714
719
|
});
|
|
715
720
|
try {
|
|
716
721
|
const o = lt(a, t, e), n = {
|
|
717
722
|
...i,
|
|
718
723
|
responseFormat: O("arch_bulk_result", ot),
|
|
719
724
|
onProgress: ae(s, "reduce")
|
|
720
|
-
}, c = await ge(t, o, n), u = c
|
|
725
|
+
}, c = await ge(t, o, n), u = Array.isArray(c) ? c : c?.results;
|
|
721
726
|
let d = [];
|
|
722
|
-
Array.isArray(u)
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
+
if (Array.isArray(u))
|
|
728
|
+
d = u;
|
|
729
|
+
else {
|
|
730
|
+
const p = c === null ? "null" : typeof c;
|
|
731
|
+
d = t.map((g) => ({
|
|
732
|
+
path: g,
|
|
733
|
+
passed: !1,
|
|
734
|
+
reason: `Invalid bulk response shape (expected array or { results: [] }, got ${p})`
|
|
735
|
+
}));
|
|
736
|
+
}
|
|
727
737
|
const m = d.filter((p) => !p.passed).length, l = d.length - m;
|
|
728
|
-
return
|
|
738
|
+
return L(
|
|
729
739
|
s,
|
|
730
740
|
t,
|
|
731
741
|
m > 0 ? new Error(`${m} items failed`) : void 0,
|
|
732
742
|
{
|
|
733
743
|
...r,
|
|
734
|
-
status:
|
|
744
|
+
status: D.complete,
|
|
735
745
|
passed: l,
|
|
736
746
|
failed: m
|
|
737
747
|
}
|
|
@@ -742,9 +752,9 @@ async function oe(t, a, e, s, r, i = {}) {
|
|
|
742
752
|
passed: !1,
|
|
743
753
|
reason: `Processing error: ${o.message}`
|
|
744
754
|
}));
|
|
745
|
-
return
|
|
755
|
+
return L(s, t, o, {
|
|
746
756
|
...r,
|
|
747
|
-
status:
|
|
757
|
+
status: D.error
|
|
748
758
|
}), n;
|
|
749
759
|
}
|
|
750
760
|
}
|
|
@@ -763,9 +773,9 @@ function Ze(t, a) {
|
|
|
763
773
|
function et(t, a, e) {
|
|
764
774
|
if (t.allPassed)
|
|
765
775
|
return `All ${t.processed}/${t.total} items satisfy: ${a}`;
|
|
766
|
-
const s = t.failures.slice(0,
|
|
767
|
-
`), r = t.failures.length >
|
|
768
|
-
... and ${t.failures.length -
|
|
776
|
+
const s = t.failures.slice(0, q).map((i) => ` • ${i.item}: ${i.reason || "Failed"}`).join(`
|
|
777
|
+
`), r = t.failures.length > q ? `
|
|
778
|
+
... and ${t.failures.length - q} more failures` : "";
|
|
769
779
|
return `${t.failed}/${t.processed} items failed: ${a}${t.stoppedEarly && e !== ne ? ` (stopped after ${e} failures)` : ""}
|
|
770
780
|
|
|
771
781
|
Failures:
|
|
@@ -787,7 +797,7 @@ function tt(t, a) {
|
|
|
787
797
|
function st(t, a, e, s) {
|
|
788
798
|
const r = a || e.length > 0 || s <= He;
|
|
789
799
|
return {
|
|
790
|
-
mode: r ?
|
|
800
|
+
mode: r ? B.INDIVIDUAL : B.BULK,
|
|
791
801
|
batchSize: r ? t.maxConcurrency : t.bulkSize,
|
|
792
802
|
processor: r ? (i, o, n) => ie(i, o, n) : (i, o, n) => oe(
|
|
793
803
|
i.items,
|
|
@@ -800,7 +810,7 @@ function st(t, a, e, s) {
|
|
|
800
810
|
}
|
|
801
811
|
function ie(t, a, e) {
|
|
802
812
|
const s = t.items.map(
|
|
803
|
-
(r) =>
|
|
813
|
+
(r) => Ye(
|
|
804
814
|
r,
|
|
805
815
|
a,
|
|
806
816
|
e.itemContextFns,
|
|
@@ -812,8 +822,8 @@ function ie(t, a, e) {
|
|
|
812
822
|
return Promise.all(s);
|
|
813
823
|
}
|
|
814
824
|
function at(t, a, e) {
|
|
815
|
-
if (a ===
|
|
816
|
-
const { results: s, errors: r, failures: i, shouldStop: o } =
|
|
825
|
+
if (a === B.INDIVIDUAL) {
|
|
826
|
+
const { results: s, errors: r, failures: i, shouldStop: o } = Qe(
|
|
817
827
|
t,
|
|
818
828
|
e.isCoverageTest,
|
|
819
829
|
e.maxFailures,
|
|
@@ -848,7 +858,7 @@ function at(t, a, e) {
|
|
|
848
858
|
}
|
|
849
859
|
}
|
|
850
860
|
async function rt(t, a, e, s) {
|
|
851
|
-
const r =
|
|
861
|
+
const r = Ke(t, e.batchSize), i = [];
|
|
852
862
|
let o = 0;
|
|
853
863
|
for (const n of r) {
|
|
854
864
|
if (!s.isCoverageTest && o >= s.maxFailures)
|
|
@@ -857,13 +867,13 @@ async function rt(t, a, e, s) {
|
|
|
857
867
|
n,
|
|
858
868
|
r.length,
|
|
859
869
|
t.length,
|
|
860
|
-
|
|
870
|
+
D.start,
|
|
861
871
|
s,
|
|
862
872
|
e.mode
|
|
863
873
|
);
|
|
864
|
-
|
|
874
|
+
L(s.onChunkProcessed, n.items, void 0, c);
|
|
865
875
|
let u;
|
|
866
|
-
e.mode ===
|
|
876
|
+
e.mode === B.INDIVIDUAL ? u = await ie(n, a, {
|
|
867
877
|
itemContextFns: s.itemContextFns,
|
|
868
878
|
description: s.description,
|
|
869
879
|
targetType: s.targetType
|
|
@@ -879,7 +889,7 @@ async function rt(t, a, e, s) {
|
|
|
879
889
|
...s,
|
|
880
890
|
currentFailures: o
|
|
881
891
|
});
|
|
882
|
-
if (i.push(...d.results), o = d.failures,
|
|
892
|
+
if (i.push(...d.results), o = d.failures, L(
|
|
883
893
|
s.onChunkProcessed,
|
|
884
894
|
n.items,
|
|
885
895
|
d.errors.length > 0 ? d.errors[0] : void 0,
|
|
@@ -888,7 +898,7 @@ async function rt(t, a, e, s) {
|
|
|
888
898
|
n,
|
|
889
899
|
r.length,
|
|
890
900
|
t.length,
|
|
891
|
-
|
|
901
|
+
D.complete,
|
|
892
902
|
s,
|
|
893
903
|
e.mode
|
|
894
904
|
),
|
|
@@ -947,7 +957,7 @@ function it(t) {
|
|
|
947
957
|
return k.readdirSync(t).join(", ");
|
|
948
958
|
{
|
|
949
959
|
const e = k.readFileSync(t, "utf8");
|
|
950
|
-
return e.length >
|
|
960
|
+
return e.length > Y ? `${e.substring(0, Y)}
|
|
951
961
|
... (truncated)` : e;
|
|
952
962
|
}
|
|
953
963
|
}
|
|
@@ -977,7 +987,7 @@ function lt(t, a, e) {
|
|
|
977
987
|
}
|
|
978
988
|
class ut {
|
|
979
989
|
constructor(a, e = {}) {
|
|
980
|
-
this.target = a, this.options = e, this.contexts = [], this.itemContextFns = [], this.maxFailures = e.maxFailures || ne, this.bulkSize = e.bulkSize ||
|
|
990
|
+
this.target = a, this.options = e, this.contexts = [], this.itemContextFns = [], this.maxFailures = e.maxFailures || ne, 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;
|
|
981
991
|
}
|
|
982
992
|
withContext(a) {
|
|
983
993
|
return this.contexts.push(a), this;
|
|
@@ -995,8 +1005,8 @@ class ut {
|
|
|
995
1005
|
}
|
|
996
1006
|
// Start processing - this is the fluent terminator
|
|
997
1007
|
async start() {
|
|
998
|
-
const a =
|
|
999
|
-
e.start(), e.emit({ event:
|
|
1008
|
+
const a = U("ai-arch-expect", this.options), e = z("ai-arch-expect", a.onProgress, a);
|
|
1009
|
+
e.start(), e.emit({ event: E.input, value: this.description });
|
|
1000
1010
|
try {
|
|
1001
1011
|
if (!this.description)
|
|
1002
1012
|
throw new Error("Must call satisfies() before start()");
|
|
@@ -1008,8 +1018,8 @@ class ut {
|
|
|
1008
1018
|
this.itemContextFns,
|
|
1009
1019
|
s.length
|
|
1010
1020
|
), { bulkSize: o, maxConcurrency: n, maxFailures: c } = await se(a, {
|
|
1011
|
-
bulkSize:
|
|
1012
|
-
maxConcurrency:
|
|
1021
|
+
bulkSize: W(Je),
|
|
1022
|
+
maxConcurrency: W(Xe),
|
|
1013
1023
|
maxFailures: this.maxFailures
|
|
1014
1024
|
}), u = {
|
|
1015
1025
|
bulkSize: o,
|
|
@@ -1023,15 +1033,15 @@ class ut {
|
|
|
1023
1033
|
runConfig: a
|
|
1024
1034
|
}, d = e.batch(s.length), m = await rt(s, r, i, u);
|
|
1025
1035
|
if (d(m.length), this.isCoverageTest) {
|
|
1026
|
-
const p = m.filter((
|
|
1027
|
-
if (!
|
|
1028
|
-
throw new Error(
|
|
1029
|
-
const T = { passed:
|
|
1030
|
-
return e.emit({ event:
|
|
1036
|
+
const p = m.filter(($) => $.passed).length, g = s.length > 0 ? p / s.length : 0, x = g >= this.threshold, P = `Coverage: ${p}/${s.length} (${(g * 100).toFixed(1)}%) - ${x ? "meets" : "below"} ${(this.threshold * 100).toFixed(1)}% threshold`;
|
|
1037
|
+
if (!x)
|
|
1038
|
+
throw new Error(P);
|
|
1039
|
+
const T = { passed: x, coverage: g, message: P };
|
|
1040
|
+
return e.emit({ event: E.output, value: T }), e.complete({ outcome: R.success, coverage: g, total: s.length }), T;
|
|
1031
1041
|
}
|
|
1032
1042
|
const l = this.summarize(s, m);
|
|
1033
|
-
return e.emit({ event:
|
|
1034
|
-
outcome:
|
|
1043
|
+
return e.emit({ event: E.output, value: l }), e.complete({
|
|
1044
|
+
outcome: R.success,
|
|
1035
1045
|
total: s.length,
|
|
1036
1046
|
passed: l.details.passed
|
|
1037
1047
|
}), l;
|
|
@@ -1053,7 +1063,7 @@ pt.knownTexts = [];
|
|
|
1053
1063
|
function Dt() {
|
|
1054
1064
|
return console.warn("scanJS is not available in browser environment"), Promise.resolve({});
|
|
1055
1065
|
}
|
|
1056
|
-
const
|
|
1066
|
+
const Z = {
|
|
1057
1067
|
name: "test_analysis_result",
|
|
1058
1068
|
schema: {
|
|
1059
1069
|
type: "object",
|
|
@@ -1074,14 +1084,14 @@ const Y = {
|
|
|
1074
1084
|
required: ["hasIssues", "issues"],
|
|
1075
1085
|
additionalProperties: !1
|
|
1076
1086
|
}
|
|
1077
|
-
},
|
|
1087
|
+
}, ee = "test";
|
|
1078
1088
|
async function le(t, a, e) {
|
|
1079
1089
|
[a, e] = fe(a, e);
|
|
1080
|
-
const { text: s, context: r } = be(a, []), i =
|
|
1090
|
+
const { text: s, context: r } = be(a, []), i = U(ee, e), o = z(ee, i.onProgress, i);
|
|
1081
1091
|
o.start();
|
|
1082
1092
|
try {
|
|
1083
1093
|
const n = await ve.readFile(t, "utf-8");
|
|
1084
|
-
o.emit({ event:
|
|
1094
|
+
o.emit({ event: E.phase, phase: "file-read", path: t });
|
|
1085
1095
|
const c = r ? `
|
|
1086
1096
|
|
|
1087
1097
|
${r}` : "", u = `Analyze this code and ${s}:
|
|
@@ -1098,11 +1108,11 @@ GUIDELINES:
|
|
|
1098
1108
|
- Suggest concrete fixes for each issue identified
|
|
1099
1109
|
- Be concise but clear in your feedback
|
|
1100
1110
|
- If no issues are found, return {"hasIssues": false, "issues": []}${c}`;
|
|
1101
|
-
o.emit({ event:
|
|
1111
|
+
o.emit({ event: E.phase, phase: "analyzing" });
|
|
1102
1112
|
const d = await ye(
|
|
1103
|
-
() =>
|
|
1113
|
+
() => G(u, {
|
|
1104
1114
|
...i,
|
|
1105
|
-
responseFormat: O(
|
|
1115
|
+
responseFormat: O(Z.name, Z.schema)
|
|
1106
1116
|
}),
|
|
1107
1117
|
{
|
|
1108
1118
|
label: "test chain",
|
|
@@ -1110,16 +1120,16 @@ GUIDELINES:
|
|
|
1110
1120
|
}
|
|
1111
1121
|
), m = d.hasIssues ? d.issues : [];
|
|
1112
1122
|
return o.emit({
|
|
1113
|
-
event:
|
|
1123
|
+
event: E.phase,
|
|
1114
1124
|
phase: "analysis-complete",
|
|
1115
1125
|
issueCount: m.length
|
|
1116
|
-
}), o.complete({ outcome:
|
|
1126
|
+
}), o.complete({ outcome: R.success }), m;
|
|
1117
1127
|
} catch (n) {
|
|
1118
1128
|
throw o.error(n), n;
|
|
1119
1129
|
}
|
|
1120
1130
|
}
|
|
1121
1131
|
le.knownTexts = [];
|
|
1122
|
-
const
|
|
1132
|
+
const te = "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.", M = [
|
|
1123
1133
|
dt,
|
|
1124
1134
|
mt,
|
|
1125
1135
|
ht,
|
|
@@ -1130,26 +1140,37 @@ const ee = "test-advice", dt = "Run the code with 5 boundary value test cases an
|
|
|
1130
1140
|
wt
|
|
1131
1141
|
];
|
|
1132
1142
|
async function vt(t, a = {}) {
|
|
1133
|
-
|
|
1143
|
+
if (typeof t != "string" || t.length === 0)
|
|
1144
|
+
throw new Error(
|
|
1145
|
+
`test-advice: path must be a non-empty string (got ${t === null ? "null" : typeof t})`
|
|
1146
|
+
);
|
|
1147
|
+
const e = U(te, a), s = z(te, e.onProgress, e);
|
|
1134
1148
|
s.start();
|
|
1135
1149
|
try {
|
|
1136
|
-
const r = s.batch(
|
|
1137
|
-
|
|
1138
|
-
async (
|
|
1139
|
-
const
|
|
1150
|
+
const r = s.batch(M.length), o = (await we(
|
|
1151
|
+
M,
|
|
1152
|
+
async (u) => {
|
|
1153
|
+
const d = await le(t, u, {
|
|
1140
1154
|
...e,
|
|
1141
1155
|
onProgress: ae(e.onProgress, "test-advice:test")
|
|
1142
1156
|
});
|
|
1143
|
-
return r(1),
|
|
1157
|
+
return r(1), d;
|
|
1144
1158
|
},
|
|
1145
1159
|
{
|
|
1146
1160
|
maxParallel: 3,
|
|
1147
|
-
errorPosture:
|
|
1161
|
+
errorPosture: V.resilient,
|
|
1148
1162
|
abortSignal: e.abortSignal,
|
|
1149
1163
|
label: "test-advice:instructions"
|
|
1150
1164
|
}
|
|
1151
|
-
)).filter(Array.isArray).
|
|
1152
|
-
|
|
1165
|
+
)).filter(Array.isArray), n = M.length - o.length;
|
|
1166
|
+
if (o.length === 0)
|
|
1167
|
+
throw new Error(`test-advice: all ${M.length} instructions failed`);
|
|
1168
|
+
const c = o.flat();
|
|
1169
|
+
return s.complete({
|
|
1170
|
+
outcome: n > 0 ? R.partial : R.success,
|
|
1171
|
+
totalIssues: c.length,
|
|
1172
|
+
failedInstructions: n
|
|
1173
|
+
}), c;
|
|
1153
1174
|
} catch (r) {
|
|
1154
1175
|
throw s.error(r), r;
|
|
1155
1176
|
}
|
|
@@ -1158,26 +1179,26 @@ vt.knownTexts = [];
|
|
|
1158
1179
|
pe.config();
|
|
1159
1180
|
export {
|
|
1160
1181
|
Mt as CAPABILITY_KEYS,
|
|
1161
|
-
|
|
1162
|
-
|
|
1182
|
+
Ft as COMPLIANCE,
|
|
1183
|
+
Nt as CONTEXT_KINDS,
|
|
1163
1184
|
Bt as COST_POSTURE,
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1185
|
+
Ut as ChainEvent,
|
|
1186
|
+
zt as ChainTree,
|
|
1187
|
+
Ot as ContextBudget,
|
|
1167
1188
|
_t as Conversation,
|
|
1168
1189
|
jt as DOMAIN,
|
|
1169
|
-
|
|
1190
|
+
E as DomainEvent,
|
|
1170
1191
|
qt as ENVIRONMENT,
|
|
1171
1192
|
Vt as EmbeddingService,
|
|
1172
1193
|
Wt as ErrorCategory,
|
|
1173
1194
|
Gt as Kind,
|
|
1174
1195
|
Ht as Level,
|
|
1175
1196
|
Jt as ListStyle,
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1197
|
+
Xt as ModelService,
|
|
1198
|
+
Kt as ModelSource,
|
|
1199
|
+
D as OpEvent,
|
|
1200
|
+
Yt as OptionSource,
|
|
1201
|
+
Qt as QUALITY_INTENT,
|
|
1181
1202
|
Zt as RetryMode,
|
|
1182
1203
|
es as SocraticMethod,
|
|
1183
1204
|
ts as StatusCode,
|
|
@@ -1196,46 +1217,46 @@ export {
|
|
|
1196
1217
|
ms as buildSeedGenerationPrompt,
|
|
1197
1218
|
hs as buildVisionPrompt,
|
|
1198
1219
|
gs as calculateStatistics,
|
|
1199
|
-
fs as
|
|
1200
|
-
bs as
|
|
1220
|
+
fs as calibrateInstructions,
|
|
1221
|
+
bs as calibrateItem,
|
|
1201
1222
|
ys as calibrateSpec,
|
|
1202
1223
|
ws as callAgent,
|
|
1203
1224
|
vs as categorySamples,
|
|
1204
|
-
|
|
1205
|
-
|
|
1225
|
+
Ss as causalFramePrompt,
|
|
1226
|
+
xs as centralTendency,
|
|
1206
1227
|
ks as centralTendencyLines,
|
|
1207
1228
|
Cs as chunk,
|
|
1208
1229
|
Is as chunkSentences,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1230
|
+
Ps as classify,
|
|
1231
|
+
As as cleanupPaths,
|
|
1232
|
+
Es as collectEventsWith,
|
|
1233
|
+
Rs as collectTerms,
|
|
1234
|
+
Ts as combinations,
|
|
1214
1235
|
Ds as commonalities,
|
|
1215
1236
|
Ls as compact,
|
|
1216
|
-
|
|
1237
|
+
$s as computeTagStatistics,
|
|
1217
1238
|
Ms as config,
|
|
1218
|
-
|
|
1219
|
-
|
|
1239
|
+
Fs as constants,
|
|
1240
|
+
Ns as conversationTurnReduce,
|
|
1220
1241
|
Bs as cosineSimilarity,
|
|
1221
|
-
|
|
1222
|
-
|
|
1242
|
+
Us as createBatches,
|
|
1243
|
+
zs as createContextBuilder,
|
|
1223
1244
|
z as createProgressEmitter,
|
|
1224
1245
|
me as createTempDir,
|
|
1225
|
-
|
|
1246
|
+
Os as createTraceCollector,
|
|
1226
1247
|
_s as date,
|
|
1227
1248
|
js as debug,
|
|
1228
|
-
|
|
1249
|
+
G as default,
|
|
1229
1250
|
qs as descriptorToSchema,
|
|
1230
1251
|
Vs as detectPatterns,
|
|
1231
1252
|
Ws as detectThreshold,
|
|
1232
1253
|
Gs as determineStyle,
|
|
1233
1254
|
Hs as disambiguate,
|
|
1234
1255
|
Js as dismantle,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1256
|
+
Xs as documentShrink,
|
|
1257
|
+
Ks as embed,
|
|
1258
|
+
Ys as embedAssembleSpan,
|
|
1259
|
+
Qs as embedBatch,
|
|
1239
1260
|
Zs as embedBuildIndex,
|
|
1240
1261
|
ea as embedChunked,
|
|
1241
1262
|
ta as embedImage,
|
|
@@ -1252,159 +1273,180 @@ export {
|
|
|
1252
1273
|
da as embedSubquestions,
|
|
1253
1274
|
ma as embedWarmup,
|
|
1254
1275
|
ha as entityInstructions,
|
|
1255
|
-
ga as
|
|
1256
|
-
fa as
|
|
1257
|
-
ba as
|
|
1258
|
-
ya as
|
|
1259
|
-
wa as
|
|
1260
|
-
va as
|
|
1276
|
+
ga as entityItem,
|
|
1277
|
+
fa as entitySpec,
|
|
1278
|
+
ba as evaluateTargetingClause,
|
|
1279
|
+
ya as evaluateTargetingRule,
|
|
1280
|
+
wa as eventToTrace,
|
|
1281
|
+
va as expect,
|
|
1282
|
+
Sa as extractBlocks,
|
|
1261
1283
|
Ce as extractButtons,
|
|
1262
|
-
xa as extractEntities,
|
|
1263
1284
|
ke as extractForms,
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
ka as extractRelations,
|
|
1285
|
+
xa as extractJson,
|
|
1286
|
+
xe as extractLinks,
|
|
1287
|
+
Pe as extractMeta,
|
|
1288
|
+
Ee as extractPage,
|
|
1269
1289
|
Ie as extractScripts,
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1290
|
+
Ae as extractStructure,
|
|
1291
|
+
ka as fillMissing,
|
|
1292
|
+
Ca as filter,
|
|
1293
|
+
Ia as filterAmbiguous,
|
|
1294
|
+
Pa as filterEach,
|
|
1295
|
+
Aa as filterItem,
|
|
1296
|
+
Ea as filterParallel,
|
|
1297
|
+
Ra as find,
|
|
1276
1298
|
Ta as findEach,
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1299
|
+
Da as findItem,
|
|
1300
|
+
La as findParallel,
|
|
1301
|
+
$a as generateList,
|
|
1302
|
+
Ma as getMeanings,
|
|
1303
|
+
Fa as getOption,
|
|
1304
|
+
Na as getOptionDetail,
|
|
1281
1305
|
se as getOptions,
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1306
|
+
Ba as glossary,
|
|
1307
|
+
Ua as group,
|
|
1308
|
+
za as groupEach,
|
|
1309
|
+
Oa as groupItem,
|
|
1310
|
+
_a as groupParallel,
|
|
1311
|
+
Rt as imageToBase64,
|
|
1312
|
+
ja as init,
|
|
1313
|
+
qa as intent,
|
|
1314
|
+
Va as intersections,
|
|
1315
|
+
Wa as join,
|
|
1290
1316
|
O as jsonSchema,
|
|
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
|
-
|
|
1317
|
+
Ga as last,
|
|
1318
|
+
Ha as list,
|
|
1319
|
+
Ja as listBatch,
|
|
1320
|
+
Xa as listExpand,
|
|
1321
|
+
G as llm,
|
|
1322
|
+
Ka as llmLogger,
|
|
1323
|
+
Ya as makePrompt,
|
|
1324
|
+
Qa as map,
|
|
1325
|
+
Za as mapCalibrate,
|
|
1326
|
+
er as mapCalibrateParallel,
|
|
1327
|
+
tr as mapEach,
|
|
1328
|
+
sr as mapEntities,
|
|
1329
|
+
ar as mapEntitiesParallel,
|
|
1330
|
+
Se as mapImageShrink,
|
|
1331
|
+
rr as mapItem,
|
|
1332
|
+
nr as mapParallel,
|
|
1333
|
+
or as mapPeopleSet,
|
|
1334
|
+
ir as mapPeopleSetParallel,
|
|
1335
|
+
cr as mapPopReference,
|
|
1336
|
+
lr as mapPopReferenceParallel,
|
|
1337
|
+
ur as mapRelations,
|
|
1338
|
+
pr as mapRelationsParallel,
|
|
1339
|
+
dr as mapScale,
|
|
1340
|
+
mr as mapScaleParallel,
|
|
1341
|
+
hr as mapTags,
|
|
1342
|
+
gr as name,
|
|
1343
|
+
fr as nameSimilarTo,
|
|
1344
|
+
U as nameStep,
|
|
1345
|
+
br as normalizeInstruction,
|
|
1346
|
+
yr as normalizeLlm,
|
|
1347
|
+
wr as normalizeRubric,
|
|
1348
|
+
vr as number,
|
|
1349
|
+
Sr as numberWithUnits,
|
|
1350
|
+
xr as observeApplication,
|
|
1351
|
+
kr as observeProviders,
|
|
1352
|
+
Cr as omit,
|
|
1353
|
+
Ir as pFilter,
|
|
1354
|
+
Pr as pFind,
|
|
1355
|
+
Ar as pGroup,
|
|
1356
|
+
Er as pMap,
|
|
1357
|
+
Rr as pReduce,
|
|
1318
1358
|
we as parallel,
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1359
|
+
Tr as parallelMap,
|
|
1360
|
+
Dr as parseLLMList,
|
|
1361
|
+
Lr as parseRDFLiteral,
|
|
1362
|
+
$r as parseRelations,
|
|
1363
|
+
Mr as peopleSet,
|
|
1364
|
+
Fr as phailForge,
|
|
1365
|
+
Nr as pick,
|
|
1366
|
+
Br as pipe,
|
|
1367
|
+
Ur as popReferenceItem,
|
|
1368
|
+
zr as promptCache,
|
|
1369
|
+
Or as promptPiece,
|
|
1370
|
+
_r as prompts,
|
|
1371
|
+
jr as questions,
|
|
1372
|
+
qr as rangeCombinations,
|
|
1333
1373
|
ge as reduce,
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1374
|
+
Vr as reduceEach,
|
|
1375
|
+
Wr as reduceItem,
|
|
1376
|
+
Gr as relationInstructions,
|
|
1377
|
+
Hr as relationItem,
|
|
1378
|
+
Jr as relationSpec,
|
|
1379
|
+
At as resizeImage,
|
|
1338
1380
|
fe as resolveArgs,
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1381
|
+
Xr as resolveEmbedding,
|
|
1382
|
+
Kr as resolveModel,
|
|
1383
|
+
Yr as resolveOutputDir,
|
|
1342
1384
|
be as resolveTexts,
|
|
1343
1385
|
ye as retry,
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1386
|
+
Qr as ringBuffer,
|
|
1387
|
+
Zr as scaleInstructions,
|
|
1388
|
+
en as scaleItem,
|
|
1389
|
+
tn as scaleSpec,
|
|
1348
1390
|
Dt as scanJS,
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1391
|
+
sn as schemaOrg,
|
|
1392
|
+
an as schemas,
|
|
1393
|
+
rn as scientificFramingPrompt,
|
|
1352
1394
|
ae as scopePhase,
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1395
|
+
nn as score,
|
|
1396
|
+
on as scoreChunksByProbes,
|
|
1397
|
+
cn as scoreInstructions,
|
|
1398
|
+
ln as scoreItem,
|
|
1399
|
+
un as scoreMatrix,
|
|
1400
|
+
pn as scoreMatrixInstructions,
|
|
1401
|
+
dn as scoreSpec,
|
|
1402
|
+
mn as sentiment,
|
|
1403
|
+
hn as setEmbedEnabled,
|
|
1404
|
+
gn as setImageProcessingEnabled,
|
|
1405
|
+
fn as setInterval,
|
|
1406
|
+
bn as shuffle,
|
|
1407
|
+
yn as simplifyTree,
|
|
1366
1408
|
We as siteCrawl,
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1409
|
+
wn as slot,
|
|
1410
|
+
vn as socratic,
|
|
1411
|
+
Sn as softCoverPrompt,
|
|
1412
|
+
xn as sort,
|
|
1413
|
+
kn as sortBy,
|
|
1414
|
+
Cn as split,
|
|
1415
|
+
In as stripNumeric,
|
|
1416
|
+
Pn as stripResponse,
|
|
1417
|
+
An as suggestTargetingRules,
|
|
1418
|
+
En as tagInstructions,
|
|
1419
|
+
Rn as tagItem,
|
|
1420
|
+
Tn as tagSpec,
|
|
1421
|
+
Dn as tagVocabulary,
|
|
1422
|
+
Ln as targetingClause,
|
|
1423
|
+
$n as targetingRule,
|
|
1424
|
+
Mn as targetingRuleOps,
|
|
1425
|
+
Fn as targetingRuleSchema,
|
|
1426
|
+
Nn as templateBuilder,
|
|
1427
|
+
Bn as templateReplace,
|
|
1386
1428
|
le as test,
|
|
1387
1429
|
vt as testAdvice,
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1430
|
+
Un as themes,
|
|
1431
|
+
Et as tileImages,
|
|
1432
|
+
zn as timeline,
|
|
1433
|
+
On as toBool,
|
|
1434
|
+
_n as toDate,
|
|
1435
|
+
jn as toEnum,
|
|
1436
|
+
qn as toNumber,
|
|
1437
|
+
Vn as toNumberWithUnits,
|
|
1438
|
+
Wn as toObject,
|
|
1439
|
+
Gn as truncate,
|
|
1440
|
+
Hn as unionBy,
|
|
1441
|
+
Jn as validateTargetingRules,
|
|
1442
|
+
Xn as valueArbitrate,
|
|
1443
|
+
Kn as vectorSearch,
|
|
1444
|
+
Yn as veiledVariantStrategies,
|
|
1445
|
+
Qn as veiledVariants,
|
|
1446
|
+
Zn as version,
|
|
1447
|
+
Tt as webScrape,
|
|
1448
|
+
eo as windowFor,
|
|
1449
|
+
to as withInactivityTimeout,
|
|
1450
|
+
W as withPolicy,
|
|
1451
|
+
so as zipWith
|
|
1410
1452
|
};
|