@far-world-labs/verblets 0.7.3 → 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.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import pe from "dotenv";
2
- import { i as de, n as B, c as z, g as se, E as q, a as me, O as L, r as W, j as O, b as he, w as V, D as P, d as C, e as R, s as ae, f as ge, h as fe, k as be, l as ye, p as we } from "./shared-CHG_x1Br.js";
3
- import { cP as Mt, L as Nt, I as $t, M as Bt, b$ as zt, aL as Ot, bZ as Ut, aH as _t, K as jt, J as qt, cN as Vt, c6 as Wt, c1 as Gt, c2 as Ht, an as Jt, cM as Kt, c4 as Xt, c5 as Qt, Q as Yt, c7 as Zt, b1 as es, c3 as ts, b4 as ss, c0 as as, bT as rs, bl as ns, bg as os, bh as is, bS as cs, a4 as ls, a3 as us, bj as ps, u as ds, aE as ms, bi as hs, aa as gs, F as fs, H as bs, G as ys, bP as ws, aD as vs, be as xs, a6 as Ss, a7 as ks, cu as Cs, bM as Is, x as As, m as Es, bY as Ps, aF as Ts, bK as Rs, aG as Ds, cv as Ls, b6 as Fs, cR as Ms, t as Ns, aI as $s, cw as Bs, bO as zs, N as Os, W as Us, v as _s, bN as js, U as qs, a8 as Vs, a9 as Ws, ao as Gs, aJ as Hs, aM as Js, aO as Ks, br as Xs, bI as Qs, bs as Ys, bG as Zs, bt as ea, bw as ta, bx as sa, bH as aa, bA as ra, bF as na, bE as oa, cK as ia, bz as ca, bD as la, bJ as ua, bB as pa, bC as da, bu as ma, ad as ha, ac as ga, a1 as fa, a2 as ba, X as ya, bk as wa, ae as va, ab as xa, cl as Sa, aX as ka, aP as Ca, af as Ia, aQ as Aa, ce as Ea, ag as Pa, cf as Ta, al as Ra, aK as Da, S as La, T as Fa, ah as Ma, ai as Na, ch as $a, cQ as Ba, bm as za, aj as Oa, aR as Ua, cx as _a, ak as ja, am as qa, ap as Va, bn as Wa, bo as Ga, aq as Ha, cd as Ja, aB as Ka, aS as Xa, aT as Qa, bV as Ya, bQ as Za, aw as er, y as tr, z as sr, P as ar, R as rr, cy as nr, c9 as or, ca as ir, cc as cr, c8 as lr, cb as ur, bR as pr, ct as dr, aZ as mr, a_ as hr, aU as gr, bo as fr, cz as br, cF as yr, aV as wr, cI as vr, cJ as xr, cG as Sr, aW as kr, bL as Cr, cg as Ir, a$ as Ar, aY as Er, cO as Pr, cL as Tr, o as Rr, b_ as Dr, C as Lr, A as Fr, B as Mr, b0 as Nr, cH as $r, bd as Br, ar as zr, by as Or, au as Ur, at as _r, av as jr, ax as qr, as as Vr, bp as Wr, bv as Gr, q as Hr, bq as Jr, cE as Kr, aN as Xr, bX as Qr, b2 as Yr, bf as Zr, ay as en, cA as tn, b3 as sn, cn as an, cm as rn, a5 as nn, aC as on, az as cn, aA as ln, b5 as un, Z as pn, _ as dn, Y as mn, a0 as hn, bW as gn, bU as fn, b7 as bn, b8 as yn, co as wn, cq as vn, cr as xn, cp as Sn, cs as kn, b9 as Cn, ba as In, cB as An, $ as En, V as Pn, cC as Tn, bc as Rn, bb as Dn, ci as Ln, cj as Fn, ck as Mn, cD as Nn } from "./shared-CHG_x1Br.js";
4
- import * as J from "playwright-core";
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 U = 60, xe = (t) => ({
10
- low: { width: 300, quality: U, format: "jpeg" },
11
- med: { width: 100, quality: U, format: "jpeg" },
12
- high: { width: 50, quality: U, format: "jpeg" }
13
- })[t], G = (t) => () => {
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
- }, Et = G("resizeImage"), Pt = G("tileImages"), Tt = G("imageToBase64"), Rt = () => {
15
+ }, At = H("resizeImage"), Et = H("tileImages"), Rt = H("imageToBase64"), Tt = () => {
16
16
  throw new Error("webScrape is not available in browser environment");
17
- }, Se = async (t, a) => (await t.evaluate(() => {
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
- }))), Ae = (t) => t.evaluate(() => {
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
- }), Ee = (t) => t.evaluate(() => {
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
- }), Pe = async (t) => {
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
- Se(t, e),
216
+ xe(t, e),
217
217
  ke(t),
218
218
  Ce(t),
219
219
  Ie(t),
220
- Ae(t),
221
- Ee(t)
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
- }, _ = (t) => {
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
- }, Te = (t, a = 2) => `/${new URL(t).pathname.split("/").filter(Boolean).slice(0, a).join("/")}`, Re = (t, a = {}) => {
232
- const e = new URL(t).origin, s = a.sameDomain !== !1, r = a.maxDepth ?? 10, i = [], o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = _(t);
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, x = _(v);
238
- if (c.has(x)) continue;
239
- if (c.add(x), s && !v.startsWith(e)) {
240
- n.set(x, "external");
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(x, "max-depth");
244
+ n.set(S, "max-depth");
245
245
  continue;
246
246
  }
247
- const E = new URL(v).pathname;
248
- if (/\.(png|jpg|jpeg|gif|svg|ico|css|js|woff2?|ttf|eot|pdf|zip|mp[34])$/i.test(E)) {
249
- n.set(x, "resource");
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(x, "scheme");
253
+ n.set(S, "scheme");
254
254
  continue;
255
255
  }
256
- i.push({ url: v, normalized: x, depth: w + 1, source: h }), y++;
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 x = _(v);
272
- n.set(x, w), h.add(x);
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 = Te(h.url, b), f = w.get(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
- }, Fe = (t, a) => {
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
- }, Ne = async (t, a, e, s, r, i, o) => {
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 = Fe(u, n);
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
- }, $e = (t, a, e) => {
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.", ze = (t, a) => {
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
- }, Oe = (t, a, e) => {
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
- }, Ue = O("crawl_gate", {
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 = ze(a, t), o = Oe(r, i, e), c = (await W(o, {
465
+ const i = Ue(a, t), o = ze(r, i, e), n = await G(o, {
466
466
  ...s,
467
- responseFormat: Ue,
467
+ responseFormat: Oe,
468
468
  temperature: 0.2
469
- }))?.decisions || [], u = [], d = [];
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 Pe(t);
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 = B(K, a), s = z(K, e.onProgress, 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: q.resilient,
533
- imageShrink: V(xe),
537
+ errorPosture: V.resilient,
538
+ imageShrink: W(Se),
534
539
  heartbeatInterval: 1e3
535
- }), i = { ...re, ...e.cooldown }, o = e.isBlocked || De, n = Re(t, {
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 ? J[e.browserEngine] : J.chromium).launch({
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 S = 0, A = t;
559
- const T = $e(s, r.heartbeatInterval, () => ({
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: A,
568
+ currentUrl: P,
564
569
  ...n.summary()
565
- })), F = s.batch(r.maxPages);
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
- S++, f.skip.length > 0 && n.skip(f.skip, "llm-gate"), s.emit({
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
- A = h.url, s.emit({
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 = (E, ue) => je(E, ue, p, c, r, s), { pageData: f, blocked: v } = await Ne(
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 x = v ? 0 : n.addLinks(
600
- f.links.filter((E) => E.isSameDomain && !E.isAnchor),
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: x,
614
+ newUrls: S,
610
615
  pending: n.size(),
611
616
  blocked: v
612
- }), F(1);
617
+ }), $(1);
613
618
  } catch (y) {
614
- if (s.emit({ event: "page:error", url: h.url, error: y.message }), r.errorPosture === q.strict) throw y;
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 H = qe(g), b = Ve(g), w = {
634
+ const J = qe(g), b = Ve(g), w = {
630
635
  pages: g,
631
- graph: H,
636
+ graph: J,
632
637
  apis: b,
633
638
  frontier: n.summary(),
634
639
  skipped: n.skippedUrls(),
635
- gateCallCount: S,
640
+ gateCallCount: x,
636
641
  cleanup: () => c.cleanup()
637
642
  };
638
643
  return s.complete({
639
- outcome: L.success,
644
+ outcome: R.success,
640
645
  pagesVisited: g.length,
641
646
  apisFound: b.length,
642
- gateCallCount: S,
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, M = 20, N = 5, Ge = 0.5, He = 5, X = 8e3, j = 5, $ = {
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 ? M : typeof t == "number" ? t : { small: 10, med: M, large: 40 }[t] ?? M, Ke = (t) => t === void 0 ? N : typeof t == "number" ? t : { low: 2, med: N, high: 10 }[t] ?? N;
656
- function Xe(t, a) {
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 Qe(t, a, e, s, r, i = {}) {
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 W(c, {
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 Ye(t, a, e, s) {
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 D(t, a, e, s) {
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
- D(s, t, void 0, {
716
+ L(s, t, void 0, {
712
717
  ...r,
713
- status: R.start
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.results || c;
725
+ }, c = await ge(t, o, n), u = Array.isArray(c) ? c : c?.results;
721
726
  let d = [];
722
- Array.isArray(u) ? d = u : d = t.map((p) => ({
723
- path: p,
724
- passed: !1,
725
- reason: "Invalid response format"
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 D(
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: R.complete,
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 D(s, t, o, {
755
+ return L(s, t, o, {
746
756
  ...r,
747
- status: R.error
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, j).map((i) => ` • ${i.item}: ${i.reason || "Failed"}`).join(`
767
- `), r = t.failures.length > j ? `
768
- ... and ${t.failures.length - j} more failures` : "";
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 ? $.INDIVIDUAL : $.BULK,
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) => Qe(
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 === $.INDIVIDUAL) {
816
- const { results: s, errors: r, failures: i, shouldStop: o } = Ye(
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 = Xe(t, e.batchSize), i = [];
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
- R.start,
870
+ D.start,
861
871
  s,
862
872
  e.mode
863
873
  );
864
- D(s.onChunkProcessed, n.items, void 0, c);
874
+ L(s.onChunkProcessed, n.items, void 0, c);
865
875
  let u;
866
- e.mode === $.INDIVIDUAL ? u = await ie(n, a, {
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, D(
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
- R.complete,
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 > X ? `${e.substring(0, X)}
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 || M, this.maxConcurrency = e.maxConcurrency || N, this.onChunkProcessed = void 0, this.description = void 0, this.threshold = void 0, this.isCoverageTest = !1;
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 = B("ai-arch-expect", this.options), e = z("ai-arch-expect", a.onProgress, a);
999
- e.start(), e.emit({ event: P.input, value: this.description });
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: V(Je),
1012
- maxConcurrency: V(Ke),
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((F) => F.passed).length, g = s.length > 0 ? p / s.length : 0, S = g >= this.threshold, A = `Coverage: ${p}/${s.length} (${(g * 100).toFixed(1)}%) - ${S ? "meets" : "below"} ${(this.threshold * 100).toFixed(1)}% threshold`;
1027
- if (!S)
1028
- throw new Error(A);
1029
- const T = { passed: S, coverage: g, message: A };
1030
- return e.emit({ event: P.output, value: T }), e.complete({ outcome: L.success, coverage: g, total: s.length }), T;
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: P.output, value: l }), e.complete({
1034
- outcome: L.success,
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 Y = {
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
- }, Z = "test";
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 = B(Z, e), o = z(Z, i.onProgress, 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: P.phase, phase: "file-read", path: t });
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: P.phase, phase: "analyzing" });
1111
+ o.emit({ event: E.phase, phase: "analyzing" });
1102
1112
  const d = await ye(
1103
- () => W(u, {
1113
+ () => G(u, {
1104
1114
  ...i,
1105
- responseFormat: O(Y.name, Y.schema)
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: P.phase,
1123
+ event: E.phase,
1114
1124
  phase: "analysis-complete",
1115
1125
  issueCount: m.length
1116
- }), o.complete({ outcome: L.success }), m;
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 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 = [
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
- const e = B(ee, a), s = z(ee, e.onProgress, e);
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(te.length), o = (await we(
1137
- te,
1138
- async (n) => {
1139
- const c = await le(t, n, {
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), c;
1157
+ return r(1), d;
1144
1158
  },
1145
1159
  {
1146
1160
  maxParallel: 3,
1147
- errorPosture: q.resilient,
1161
+ errorPosture: V.resilient,
1148
1162
  abortSignal: e.abortSignal,
1149
1163
  label: "test-advice:instructions"
1150
1164
  }
1151
- )).filter(Array.isArray).flat();
1152
- return s.complete({ outcome: L.success, totalIssues: o.length }), o;
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
- Nt as COMPLIANCE,
1162
- $t as CONTEXT_KINDS,
1182
+ Ft as COMPLIANCE,
1183
+ Nt as CONTEXT_KINDS,
1163
1184
  Bt as COST_POSTURE,
1164
- zt as ChainEvent,
1165
- Ot as ChainTree,
1166
- Ut as ContextBudget,
1185
+ Ut as ChainEvent,
1186
+ zt as ChainTree,
1187
+ Ot as ContextBudget,
1167
1188
  _t as Conversation,
1168
1189
  jt as DOMAIN,
1169
- P as DomainEvent,
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
- Kt as ModelService,
1177
- Xt as ModelSource,
1178
- R as OpEvent,
1179
- Qt as OptionSource,
1180
- Yt as QUALITY_INTENT,
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 calibrate,
1200
- bs as calibrateInstructions,
1220
+ fs as calibrateInstructions,
1221
+ bs as calibrateItem,
1201
1222
  ys as calibrateSpec,
1202
1223
  ws as callAgent,
1203
1224
  vs as categorySamples,
1204
- xs as causalFramePrompt,
1205
- Ss as centralTendency,
1225
+ Ss as causalFramePrompt,
1226
+ xs as centralTendency,
1206
1227
  ks as centralTendencyLines,
1207
1228
  Cs as chunk,
1208
1229
  Is as chunkSentences,
1209
- As as classify,
1210
- Es as cleanupPaths,
1211
- Ps as collectEventsWith,
1212
- Ts as collectTerms,
1213
- Rs as combinations,
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
- Fs as computeTagStatistics,
1237
+ $s as computeTagStatistics,
1217
1238
  Ms as config,
1218
- Ns as constants,
1219
- $s as conversationTurnReduce,
1239
+ Fs as constants,
1240
+ Ns as conversationTurnReduce,
1220
1241
  Bs as cosineSimilarity,
1221
- zs as createBatches,
1222
- Os as createContextBuilder,
1242
+ Us as createBatches,
1243
+ zs as createContextBuilder,
1223
1244
  z as createProgressEmitter,
1224
1245
  me as createTempDir,
1225
- Us as createTraceCollector,
1246
+ Os as createTraceCollector,
1226
1247
  _s as date,
1227
1248
  js as debug,
1228
- W as default,
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
- Ks as documentShrink,
1236
- Xs as embed,
1237
- Qs as embedAssembleSpan,
1238
- Ys as embedBatch,
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 entitySpec,
1256
- fa as evaluateTargetingClause,
1257
- ba as evaluateTargetingRule,
1258
- ya as eventToTrace,
1259
- wa as expect,
1260
- va as extractBlocks,
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
- Sa as extractJson,
1265
- Se as extractLinks,
1266
- Ae as extractMeta,
1267
- Pe as extractPage,
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
- Ee as extractStructure,
1271
- Ca as fillMissing,
1272
- Ia as filter,
1273
- Aa as filterAmbiguous,
1274
- Ea as filterEach,
1275
- Pa as find,
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
- Ra as generateList,
1278
- Da as getMeanings,
1279
- La as getOption,
1280
- Fa as getOptionDetail,
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
- Ma as glossary,
1283
- Na as group,
1284
- $a as groupEach,
1285
- Tt as imageToBase64,
1286
- Ba as init,
1287
- za as intent,
1288
- Oa as intersections,
1289
- Ua as join,
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
- _a as last,
1292
- ja as list,
1293
- qa as listBatch,
1294
- Va as listExpand,
1295
- W as llm,
1296
- Wa as llmLogger,
1297
- Ga as makePrompt,
1298
- Ha as map,
1299
- Ja as mapEach,
1300
- xe as mapImageShrink,
1301
- Ka as mapTags,
1302
- Xa as name,
1303
- Qa as nameSimilarTo,
1304
- B as nameStep,
1305
- Ya as normalizeInstruction,
1306
- Za as normalizeLlm,
1307
- er as normalizeRubric,
1308
- tr as number,
1309
- sr as numberWithUnits,
1310
- ar as observeApplication,
1311
- rr as observeProviders,
1312
- nr as omit,
1313
- or as pFilter,
1314
- ir as pFind,
1315
- cr as pGroup,
1316
- lr as pMap,
1317
- ur as pReduce,
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
- pr as parallelMap,
1320
- dr as parseLLMList,
1321
- mr as parseRDFLiteral,
1322
- hr as parseRelations,
1323
- gr as people,
1324
- fr as phailForge,
1325
- br as pick,
1326
- yr as pipe,
1327
- wr as popReference,
1328
- vr as promptCache,
1329
- xr as promptPiece,
1330
- Sr as prompts,
1331
- kr as questions,
1332
- Cr as rangeCombinations,
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
- Ir as reduceEach,
1335
- Ar as relationInstructions,
1336
- Er as relationSpec,
1337
- Et as resizeImage,
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
- Pr as resolveEmbedding,
1340
- Tr as resolveModel,
1341
- Rr as resolveOutputDir,
1381
+ Xr as resolveEmbedding,
1382
+ Kr as resolveModel,
1383
+ Yr as resolveOutputDir,
1342
1384
  be as resolveTexts,
1343
1385
  ye as retry,
1344
- Dr as ringBuffer,
1345
- Lr as scaleInstructions,
1346
- Fr as scaleItem,
1347
- Mr as scaleSpec,
1386
+ Qr as ringBuffer,
1387
+ Zr as scaleInstructions,
1388
+ en as scaleItem,
1389
+ tn as scaleSpec,
1348
1390
  Dt as scanJS,
1349
- Nr as schemaOrg,
1350
- $r as schemas,
1351
- Br as scientificFramingPrompt,
1391
+ sn as schemaOrg,
1392
+ an as schemas,
1393
+ rn as scientificFramingPrompt,
1352
1394
  ae as scopePhase,
1353
- zr as score,
1354
- Or as scoreChunksByProbes,
1355
- Ur as scoreInstructions,
1356
- _r as scoreItem,
1357
- jr as scoreMatrix,
1358
- qr as scoreMatrixInstructions,
1359
- Vr as scoreSpec,
1360
- Wr as sentiment,
1361
- Gr as setEmbedEnabled,
1362
- Hr as setImageProcessingEnabled,
1363
- Jr as setInterval,
1364
- Kr as shuffle,
1365
- Xr as simplifyTree,
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
- Qr as slot,
1368
- Yr as socratic,
1369
- Zr as softCoverPrompt,
1370
- en as sort,
1371
- tn as sortBy,
1372
- sn as split,
1373
- an as stripNumeric,
1374
- rn as stripResponse,
1375
- nn as suggestTargetingRules,
1376
- on as tagInstructions,
1377
- cn as tagItem,
1378
- ln as tagSpec,
1379
- un as tagVocabulary,
1380
- pn as targetingClause,
1381
- dn as targetingRule,
1382
- mn as targetingRuleOps,
1383
- hn as targetingRuleSchema,
1384
- gn as templateBuilder,
1385
- fn as templateReplace,
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
- bn as themes,
1389
- Pt as tileImages,
1390
- yn as timeline,
1391
- wn as toBool,
1392
- vn as toDate,
1393
- xn as toEnum,
1394
- Sn as toNumber,
1395
- kn as toNumberWithUnits,
1396
- Cn as toObject,
1397
- In as truncate,
1398
- An as unionBy,
1399
- En as validateTargetingRules,
1400
- Pn as valueArbitrate,
1401
- Tn as vectorSearch,
1402
- Rn as veiledVariantStrategies,
1403
- Dn as veiledVariants,
1404
- Ln as version,
1405
- Rt as webScrape,
1406
- Fn as windowFor,
1407
- Mn as withInactivityTimeout,
1408
- V as withPolicy,
1409
- Nn as zipWith
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
  };