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