@far-world-labs/verblets 0.6.0 → 0.6.3

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,280 +1,903 @@
1
- import P from "dotenv";
2
- import p, { readFileSync as F } from "node:fs";
3
- import { resolve as x } from "node:path";
4
- import { r as A, a as E, n as $, c as O, b as D, d as N, j as L } from "./shared-CX9VHytb.js";
5
- import { cz as Ee, F as Te, C as Re, G as we, aQ as ve, D as Pe, E as Fe, ao as xe, Q as Ae, bg as $e, bj as Oe, c1 as De, bx as Ne, c0 as Le, $ as Me, A as ke, a8 as _e, _ as Be, b6 as je, o as Ue, au as ze, aE as Ge, bv as Je, f as Ve, aN as qe, a5 as We, y as He, z as Xe, aM as Ke, bt as Ye, a1 as Qe, a2 as Ze, ch as es, bW as ss, i as as, aO as ts, bU as rs, aP as ns, ci as is, bl as os, cB as cs, e as ls, aR as us, cj as ds, bY as ps, B as ms, H as hs, a9 as fs, b7 as bs, p as gs, aF as ys, aG as Ss, R as Is, g as Cs, bX as Es, O as Ts, a3 as Rs, a4 as ws, ap as vs, aS as Ps, aU as Fs, aW as xs, aX as As, bD as $s, bS as Os, bE as Ds, bQ as Ns, bF as Ls, bR as Ms, bK as ks, bP as _s, bO as Bs, bJ as js, bN as Us, bI as zs, bT as Gs, bL as Js, bM as Vs, bG as qs, a6 as Ws, ab as Hs, ad as Xs, ae as Ks, aa as Ys, ac as Qs, a7 as Zs, Y as ea, Z as sa, S as aa, bw as ta, af as ra, c8 as na, aY as ia, ag as oa, aZ as ca, ah as la, am as ua, cy as da, aT as pa, K as ma, L as ha, M as fa, ai as ba, aj as ga, cA as ya, by as Sa, ak as Ia, a_ as Ca, ck as Ea, al as Ta, an as Ra, aq as wa, bz as va, bA as Pa, ar as Fa, a$ as xa, b0 as Aa, bZ as $a, h as Oa, k as Da, I as Na, J as La, cl as Ma, b_ as ka, b$ as _a, cg as Ba, b8 as ja, b9 as Ua, b1 as za, bA as Ga, cm as Ja, cs as Va, b2 as qa, x as Wa, cv as Ha, cw as Xa, ct as Ka, b3 as Ya, bV as Qa, b5 as Za, b4 as et, bb as st, bd as at, be as tt, ba as rt, bc as nt, cx as it, c3 as ot, l as ct, t as lt, v as ut, w as dt, q as pt, u as mt, m as ht, bf as ft, cu as bt, bs as gt, c4 as yt, as as St, ax as It, az as Ct, aA as Et, av as Tt, aw as Rt, ay as wt, at as vt, bB as Pt, s as Ft, bH as xt, bC as At, cr as $t, aV as Ot, bh as Dt, bu as Nt, aB as Lt, cn as Mt, bi as kt, ca as _t, c9 as Bt, a0 as jt, aD as Ut, bk as zt, aC as Gt, aI as Jt, aK as Vt, aL as qt, aH as Wt, aJ as Ht, U as Xt, V as Kt, T as Yt, X as Qt, c2 as Zt, bm as er, bn as sr, cb as ar, cd as tr, ce as rr, cc as nr, cf as ir, bo as or, bp as cr, co as lr, W as ur, P as dr, cp as pr, br as mr, bq as hr, c5 as fr, c6 as br, c7 as gr, N as yr, cq as Sr } from "./shared-CX9VHytb.js";
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";
6
7
  import "glob";
7
- import M from "node:fs/promises";
8
- const k = (e) => {
9
- }, T = 1, _ = 20, B = 5, j = 0.5, U = 5, y = 8e3, g = 5, f = {
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) => () => {
15
+ throw new Error(`${t} is not available in browser environment`);
16
+ }, wt = O("resizeImage"), St = O("tileImages"), xt = O("imageToBase64"), vt = () => {
17
+ throw new Error("webScrape is not available in browser environment");
18
+ }, fe = async (t, a) => (await t.evaluate(() => {
19
+ const s = /* @__PURE__ */ new Set();
20
+ 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();
25
+ return {
26
+ href: i,
27
+ text: n.textContent?.trim()?.slice(0, 120) || "",
28
+ ariaLabel: n.getAttribute("aria-label") || "",
29
+ rel: n.getAttribute("rel") || "",
30
+ target: n.getAttribute("target") || "",
31
+ isVisible: o.width > 0 && o.height > 0,
32
+ classes: n.className?.slice?.(0, 120) || "",
33
+ dataAttrs: Object.fromEntries(
34
+ [...n.attributes].filter((r) => r.name.startsWith("data-")).map((r) => [r.name, r.value?.slice(0, 80)])
35
+ ),
36
+ inNav: !!n.closest('nav, [role="navigation"], header'),
37
+ inFooter: !!n.closest("footer"),
38
+ inMain: !!n.closest('main, [role="main"], #main, .main-content')
39
+ };
40
+ }).filter(Boolean);
41
+ })).map((s) => ({
42
+ ...s,
43
+ isExternal: !s.href.startsWith(a),
44
+ isSameDomain: s.href.startsWith(a),
45
+ isAnchor: s.href.includes("#") && new URL(s.href).pathname === new URL(t.url()).pathname
46
+ })), be = (t) => t.evaluate(
47
+ () => [...document.querySelectorAll("form")].map((a) => ({
48
+ action: a.action || "",
49
+ method: (a.method || "GET").toUpperCase(),
50
+ id: a.id || "",
51
+ name: a.name || "",
52
+ classes: a.className?.slice?.(0, 120) || "",
53
+ enctype: a.enctype || "",
54
+ dataAttrs: Object.fromEntries(
55
+ [...a.attributes].filter((e) => e.name.startsWith("data-")).map((e) => [e.name, e.value?.slice(0, 80)])
56
+ ),
57
+ fields: [...a.querySelectorAll("input, select, textarea, button")].map((e) => ({
58
+ tag: e.tagName.toLowerCase(),
59
+ type: e.type || "",
60
+ name: e.name || "",
61
+ id: e.id || "",
62
+ label: (e.labels?.[0]?.textContent?.trim() || e.getAttribute("aria-label") || e.placeholder || "")?.slice(0, 80),
63
+ required: e.required || e.getAttribute("aria-required") === "true",
64
+ value: e.type === "hidden" ? e.value?.slice(0, 80) : "",
65
+ options: e.tagName === "SELECT" ? [...e.options].slice(0, 20).map((s) => ({
66
+ value: s.value,
67
+ text: s.textContent?.trim()?.slice(0, 60)
68
+ })) : void 0
69
+ }))
70
+ }))
71
+ ), ye = (t) => t.evaluate(() => {
72
+ const a = [
73
+ ...document.querySelectorAll(
74
+ 'button, [role="button"], input[type="button"], input[type="submit"]'
75
+ )
76
+ ], e = [
77
+ ...document.querySelectorAll("[onclick], [data-action], [data-toggle], [data-target]")
78
+ ];
79
+ return [.../* @__PURE__ */ new Set([...a, ...e])].map((n) => {
80
+ const i = n.getBoundingClientRect();
81
+ return {
82
+ tag: n.tagName.toLowerCase(),
83
+ type: n.type || "",
84
+ text: n.textContent?.trim()?.slice(0, 80) || "",
85
+ id: n.id || "",
86
+ classes: (typeof n.className == "string" ? n.className : n.className?.baseVal || "").slice(0, 120),
87
+ ariaLabel: n.getAttribute("aria-label") || "",
88
+ isVisible: i.width > 0 && i.height > 0,
89
+ disabled: n.disabled || n.getAttribute("aria-disabled") === "true",
90
+ hasOnclick: !!n.getAttribute("onclick"),
91
+ onclick: n.getAttribute("onclick")?.slice(0, 120) || "",
92
+ dataAttrs: Object.fromEntries(
93
+ [...n.attributes].filter((o) => o.name.startsWith("data-")).map((o) => [o.name, o.value?.slice(0, 80)])
94
+ )
95
+ };
96
+ });
97
+ }), we = (t) => t.evaluate(() => [...document.querySelectorAll("script")].map((e) => ({
98
+ src: e.src || "",
99
+ type: e.type || "",
100
+ isModule: e.type === "module",
101
+ isInline: !e.src,
102
+ size: e.textContent?.length || 0,
103
+ // First 200 chars of inline scripts to identify patterns
104
+ preview: e.src ? "" : e.textContent?.trim()?.slice(0, 200)
105
+ }))), Se = (t) => t.evaluate(() => {
106
+ const a = (e) => document.querySelector(`meta[name="${e}"], meta[property="${e}"]`)?.content || "";
107
+ return {
108
+ title: document.title || "",
109
+ description: a("description"),
110
+ viewport: a("viewport"),
111
+ charset: document.characterSet || "",
112
+ generator: a("generator"),
113
+ ogTitle: a("og:title"),
114
+ ogType: a("og:type"),
115
+ ogImage: a("og:image"),
116
+ csrfToken: document.querySelector('meta[name="csrf-token"], meta[name="_token"]')?.content ? "(present)" : "",
117
+ customMeta: [...document.querySelectorAll("meta[name], meta[property]")].filter(
118
+ (e) => ![
119
+ "description",
120
+ "viewport",
121
+ "generator",
122
+ "og:title",
123
+ "og:type",
124
+ "og:image",
125
+ "csrf-token"
126
+ ].includes(e.getAttribute("name") || e.getAttribute("property"))
127
+ ).slice(0, 20).map((e) => ({
128
+ name: e.getAttribute("name") || e.getAttribute("property"),
129
+ content: e.content?.slice(0, 120)
130
+ }))
131
+ };
132
+ }), xe = (t) => t.evaluate(() => {
133
+ const a = [...document.querySelectorAll("h1, h2, h3, h4, h5, h6")].slice(0, 30).map((l) => ({
134
+ level: parseInt(l.tagName[1], 10),
135
+ text: l.textContent?.trim()?.slice(0, 100)
136
+ })), e = [
137
+ ...document.querySelectorAll(
138
+ '[role="banner"], [role="navigation"], [role="main"], [role="complementary"], [role="contentinfo"], nav, main, aside, header, footer'
139
+ )
140
+ ].map((l) => ({
141
+ tag: l.tagName.toLowerCase(),
142
+ role: l.getAttribute("role") || "",
143
+ id: l.id || "",
144
+ classes: (typeof l.className == "string" ? l.className : l.className?.baseVal || "").slice(0, 80)
145
+ })), s = /* @__PURE__ */ new Set();
146
+ document.querySelectorAll("*").forEach((l) => {
147
+ [...l.attributes].filter((d) => d.name.startsWith("data-")).forEach((d) => s.add(d.name));
148
+ });
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 || "";
152
+ };
153
+ document.querySelectorAll("[class]").forEach((l) => {
154
+ o(l).split(/\s+/).slice(0, 5).forEach((d) => {
155
+ d && i.add(d);
156
+ });
157
+ });
158
+ const r = [...i].slice(0, 200), c = {}, u = [
159
+ "jQuery",
160
+ "$",
161
+ "React",
162
+ "ReactDOM",
163
+ "Vue",
164
+ "angular",
165
+ "ng",
166
+ "Ember",
167
+ "Backbone",
168
+ "Handlebars",
169
+ "Mustache",
170
+ "_",
171
+ "Lodash",
172
+ "moment",
173
+ "require",
174
+ "define",
175
+ "webpack",
176
+ "__NEXT_DATA__",
177
+ "__NUXT__",
178
+ "Turbolinks",
179
+ "Turbo",
180
+ "htmx",
181
+ "Alpine"
182
+ ];
183
+ for (const l of u)
184
+ try {
185
+ 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);
188
+ }
189
+ } catch {
190
+ }
191
+ const m = /* @__PURE__ */ new Set(), h = [
192
+ "onclick",
193
+ "onsubmit",
194
+ "onchange",
195
+ "onload",
196
+ "oninput",
197
+ "onfocus",
198
+ "onblur",
199
+ "onkeyup",
200
+ "onkeydown"
201
+ ];
202
+ for (const l of h)
203
+ document.querySelectorAll(`[${l}]`).length > 0 && m.add(l);
204
+ return {
205
+ headings: a,
206
+ landmarks: e,
207
+ dataAttributes: [...s].sort().slice(0, 100),
208
+ stylesheets: n.slice(0, 20),
209
+ sampleClasses: r,
210
+ globals: c,
211
+ inlineHandlers: [...m],
212
+ iframeCount: document.querySelectorAll("iframe").length,
213
+ shadowRootCount: [...document.querySelectorAll("*")].filter((l) => l.shadowRoot).length
214
+ };
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)
223
+ ]);
224
+ return { url: a, links: s, forms: n, buttons: i, scripts: o, meta: r, structure: c };
225
+ }, R = (t) => {
226
+ const a = new URL(t);
227
+ a.hash = "";
228
+ const e = [...a.searchParams.entries()].sort(([n], [i]) => n.localeCompare(i));
229
+ a.search = new URLSearchParams(e).toString();
230
+ const s = a.toString();
231
+ 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");
242
+ continue;
243
+ }
244
+ if (p + 1 > n) {
245
+ r.set(w, "max-depth");
246
+ continue;
247
+ }
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");
251
+ continue;
252
+ }
253
+ if (/^(mailto|tel|javascript):/i.test(x)) {
254
+ r.set(w, "scheme");
255
+ continue;
256
+ }
257
+ i.push({ url: x, normalized: w, depth: p + 1, source: y }), f++;
258
+ }
259
+ return f;
260
+ },
261
+ next: () => {
262
+ const b = i.shift();
263
+ return b && o.set(b.normalized, {
264
+ url: b.url,
265
+ depth: b.depth,
266
+ source: b.source
267
+ }), b;
268
+ },
269
+ skip: (b, p) => {
270
+ for (const x of b) {
271
+ const w = R(x);
272
+ r.set(w, p);
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;
276
+ },
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);
282
+ }
283
+ return p;
284
+ },
285
+ size: () => i.length,
286
+ visitedCount: () => o.size,
287
+ isEmpty: () => i.length === 0,
288
+ summary: () => ({
289
+ pending: i.length,
290
+ visited: o.size,
291
+ skipped: r.size,
292
+ seen: c.size
293
+ }),
294
+ visitedUrls: () => [...o.entries()].map(([b, p]) => ({
295
+ normalized: b,
296
+ ...p
297
+ })),
298
+ skippedUrls: () => [...r.entries()].map(([b, p]) => ({
299
+ url: b,
300
+ reason: p
301
+ })),
302
+ origin: e
303
+ };
304
+ }, Z = {
305
+ baseDelay: 5e3,
306
+ // 5s initial wait
307
+ maxDelay: 3e5,
308
+ // 5 min ceiling
309
+ backoffFactor: 2,
310
+ // double each retry
311
+ maxRetries: 6,
312
+ // up to 6 retries (~5m20s total at 2x backoff from 5s)
313
+ jitter: 0.2
314
+ // ±20% randomization to avoid thundering herd
315
+ }, ke = async (t) => {
316
+ const a = t.url(), e = await t.evaluate(() => document.body?.innerText?.slice(0, 500)).catch(() => "");
317
+ if (e.includes("Access Denied")) return "access-denied";
318
+ if (e.includes("Rate limit") || e.includes("Too many requests")) return "rate-limit";
319
+ if (e.includes("Please verify you are a human")) return "captcha";
320
+ if (e.includes("Checking your browser")) return "challenge";
321
+ if (a.includes("errors.edgesuite.net")) return "akamai-block";
322
+ }, Ae = (t, a) => {
323
+ const e = t * a;
324
+ return t + (Math.random() * 2 - 1) * e;
325
+ }, Pe = (t, a) => {
326
+ 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()),
337
+ totalMs: t,
338
+ ...s
339
+ });
340
+ }
341
+ }, Te = async (t, a, e, s, n, i, o) => {
342
+ const r = { ...Z, ...n };
343
+ let c = 0;
344
+ 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 };
348
+ if (u >= r.maxRetries)
349
+ return s.emit({
350
+ event: "cooldown:exhausted",
351
+ url: e,
352
+ reason: h,
353
+ attempts: u + 1,
354
+ totalCooldownMs: c
355
+ }), { pageData: m, retries: u, totalCooldownMs: c, blocked: h };
356
+ const l = Pe(u, r);
357
+ c += l, s.emit({
358
+ event: "cooldown:start",
359
+ url: e,
360
+ reason: h,
361
+ attempt: u + 1,
362
+ maxRetries: r.maxRetries,
363
+ delayMs: l,
364
+ totalCooldownMs: c
365
+ }), await Re(l, s, o, {
366
+ url: e,
367
+ reason: h,
368
+ attempt: u + 1
369
+ }), s.emit({
370
+ event: "cooldown:retry",
371
+ url: e,
372
+ attempt: u + 1
373
+ });
374
+ }
375
+ }, Ee = (t, a, e) => {
376
+ const s = setInterval(() => {
377
+ t.emit({
378
+ event: "heartbeat",
379
+ ...e()
380
+ });
381
+ }, a);
382
+ return {
383
+ stop: () => clearInterval(s)
384
+ };
385
+ }, q = "site-crawl", De = "Browser support is disabled. Call init({ browser: true }) to enable.", $e = (t, a) => {
386
+ 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
+ return [
388
+ `Crawled ${e.visited} pages, ${e.pending} pending, ${e.skipped} skipped.`,
389
+ "",
390
+ "Pages visited:",
391
+ ...s.map((n) => ` ${n}`)
392
+ ].join(`
393
+ `);
394
+ }, Le = (t, a, e) => {
395
+ 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);
399
+ }
400
+ return [
401
+ "You are a site crawler deciding which URL branches to explore next.",
402
+ `Budget remaining: ${e} pages.`,
403
+ "",
404
+ "Discovery so far:",
405
+ a,
406
+ "",
407
+ "Candidate URL groups (grouped by path prefix):",
408
+ ...s,
409
+ "",
410
+ 'For each group, decide: "explore" (visit URLs from this group) or "skip" (diminishing returns).',
411
+ "Prefer to explore groups that reveal different parts of the application: new features, forms, settings, distinct page types.",
412
+ "Skip groups that are likely repetitive (e.g. many similar detail pages when we already visited one).",
413
+ "Skip groups that are clearly non-functional (help/support, legal, marketing pages)."
414
+ ].join(`
415
+ `);
416
+ }, Fe = Y("crawl_gate", {
417
+ type: "object",
418
+ properties: {
419
+ decisions: {
420
+ type: "array",
421
+ items: {
422
+ type: "object",
423
+ properties: {
424
+ prefix: { type: "string", description: "The path prefix group" },
425
+ action: {
426
+ type: "string",
427
+ enum: ["explore", "skip"],
428
+ description: "Whether to explore or skip this group"
429
+ },
430
+ reason: { type: "string", description: "Brief reason for the decision" },
431
+ maxFromGroup: {
432
+ type: "integer",
433
+ description: "If exploring, how many URLs from this group to visit (1-5)"
434
+ }
435
+ },
436
+ required: ["prefix", "action", "reason"],
437
+ additionalProperties: !1
438
+ }
439
+ }
440
+ },
441
+ required: ["decisions"],
442
+ additionalProperties: !1
443
+ }), Ne = async (t, a, e, s) => {
444
+ const n = t.pendingByPrefix(2);
445
+ if (n.size === 0) return { explore: [], skip: [], decisions: [] };
446
+ const i = $e(a, t), o = Le(n, i, e), c = (await U(o, {
447
+ ...s,
448
+ response_format: Fe,
449
+ temperature: 0.2
450
+ }))?.decisions || [], u = [], m = [];
451
+ for (const h of c) {
452
+ const l = n.get(h.prefix);
453
+ if (l)
454
+ if (h.action === "skip")
455
+ m.push(...l.map((d) => d.url));
456
+ 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));
459
+ }
460
+ }
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) => {
465
+ await t.goto(a, { waitUntil: "domcontentloaded", timeout: 3e4 }), await t.waitForTimeout(1500);
466
+ const o = await ve(t);
467
+ if (n.screenshots) {
468
+ const c = `${s.dir}/crawl-${Date.now()}.png`;
469
+ if (await t.screenshot({ path: c, fullPage: !1 }), s.track(c), n.imageShrink) {
470
+ const u = await le(c, {
471
+ ...n.imageShrink,
472
+ outputDir: s.dir
473
+ });
474
+ s.track(u.path), o.screenshot = u.path;
475
+ } else
476
+ o.screenshot = c;
477
+ }
478
+ const r = e.responses();
479
+ return o.apis = r.filter((c) => {
480
+ const u = c.url();
481
+ return u.includes("/api/") || u.includes("/v1/") || u.includes("/v2/") || u.includes("/graphql");
482
+ }).map((c) => ({
483
+ url: c.url(),
484
+ status: c.status(),
485
+ method: c.request().method()
486
+ })), e.clear(), o;
487
+ }, _e = (t) => {
488
+ const a = {};
489
+ for (const e of t) {
490
+ const s = e.links.filter((n) => n.isSameDomain && !n.isAnchor).map((n) => n.href);
491
+ a[e.url] = [...new Set(s)];
492
+ }
493
+ return a;
494
+ }, Be = (t) => {
495
+ const a = /* @__PURE__ */ new Map();
496
+ for (const e of t)
497
+ for (const s of e.apis || []) {
498
+ const n = `${s.method} ${new URL(s.url).pathname}`;
499
+ a.has(n) ? a.get(n).seenOn.push(e.url) : a.set(n, { ...s, seenOn: [e.url] });
500
+ }
501
+ 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);
505
+ s.start();
506
+ const n = await K(e, {
507
+ maxPages: 20,
508
+ maxDepth: 5,
509
+ sameDomain: !0,
510
+ gateInterval: 5,
511
+ headless: !0,
512
+ screenshots: !1,
513
+ errorPosture: "resilient",
514
+ imageShrink: B(ge),
515
+ heartbeatInterval: 1e3
516
+ }), i = { ...Z, ...e.cooldown }, o = e.isBlocked || ke, r = Ce(t, {
517
+ sameDomain: n.sameDomain,
518
+ maxDepth: n.maxDepth
519
+ }), c = await ce("site-crawl", e.outputDir), m = await (e.browserEngine ? z[e.browserEngine] : z.chromium).launch({
520
+ headless: n.headless,
521
+ ...e.launchOptions
522
+ });
523
+ s.emit({ event: "browser", headless: n.headless });
524
+ try {
525
+ const h = await m.newContext(e.contextOptions);
526
+ if (e.setup) {
527
+ const p = await h.newPage();
528
+ await e.setup(p), await p.close(), s.emit({ event: "setup" });
529
+ }
530
+ const l = await h.newPage(), d = (() => {
531
+ const p = [];
532
+ return l.on("response", (y) => p.push(y)), {
533
+ responses: () => [...p],
534
+ clear: () => {
535
+ p.length = 0;
536
+ }
537
+ };
538
+ })(), g = [];
539
+ let v = 0, C = t;
540
+ const P = Ee(s, n.heartbeatInterval, () => ({
541
+ pagesVisited: g.length,
542
+ maxPages: n.maxPages,
543
+ pending: r.size(),
544
+ currentUrl: C,
545
+ ...r.summary()
546
+ }));
547
+ try {
548
+ for (; !r.isEmpty() && g.length < n.maxPages; ) {
549
+ if (g.length > 0 && g.length % n.gateInterval === 0 && r.size() > 0) {
550
+ const y = n.maxPages - g.length;
551
+ 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({
554
+ event: "gate:complete",
555
+ explored: f.explore.length,
556
+ skipped: f.skip.length,
557
+ decisions: f.decisions.length
558
+ });
559
+ }
560
+ const p = r.next();
561
+ if (!p) break;
562
+ C = p.url, s.emit({
563
+ event: "page:start",
564
+ url: p.url,
565
+ depth: p.depth,
566
+ pageNumber: g.length + 1,
567
+ maxPages: n.maxPages
568
+ });
569
+ try {
570
+ const y = (w, N) => Me(w, N, d, c, n, s), { pageData: f, blocked: S } = await Te(
571
+ y,
572
+ l,
573
+ p.url,
574
+ s,
575
+ i,
576
+ o,
577
+ n.heartbeatInterval
578
+ );
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
584
+ );
585
+ s.emit({
586
+ event: "page:complete",
587
+ url: p.url,
588
+ links: f.links.length,
589
+ forms: f.forms.length,
590
+ newUrls: x,
591
+ pending: r.size(),
592
+ blocked: S
593
+ });
594
+ } catch (y) {
595
+ if (s.emit({ event: "page:error", url: p.url, error: y.message }), n.errorPosture === "strict") throw y;
596
+ }
597
+ }
598
+ } finally {
599
+ P.stop();
600
+ }
601
+ if (await l.close(), e.teardown) {
602
+ try {
603
+ const p = await h.newPage();
604
+ await e.teardown(p), await p.close();
605
+ } catch {
606
+ }
607
+ s.emit({ event: "teardown" });
608
+ }
609
+ await h.close();
610
+ const j = _e(g), F = Be(g), b = {
611
+ pages: g,
612
+ graph: j,
613
+ apis: F,
614
+ frontier: r.summary(),
615
+ skipped: r.skippedUrls(),
616
+ gateCallCount: v,
617
+ cleanup: () => c.cleanup()
618
+ };
619
+ return s.complete({
620
+ outcome: "success",
621
+ pagesVisited: g.length,
622
+ apisFound: F.length,
623
+ gateCallCount: v,
624
+ ...r.summary()
625
+ }), b;
626
+ } catch (h) {
627
+ throw s.error(h, { pagesVisited: 0 }), h;
628
+ } finally {
629
+ await m.close();
630
+ }
631
+ }, ee = 1, T = 20, E = 5, Ue = 0.5, Oe = 5, V = 8e3, _ = 5, D = {
10
632
  INDIVIDUAL: "individual",
11
633
  BULK: "bulk"
12
- }, m = {
13
- PROCESSING: "processing",
14
- COMPLETED: "completed",
15
- ERROR: "error"
16
- };
17
- function z(e, s) {
18
- const t = [];
19
- for (let a = 0; a < e.length; a += s)
20
- t.push({
21
- items: e.slice(a, a + s),
22
- index: Math.floor(a / s) + 1,
23
- startIndex: a
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) {
636
+ const e = [];
637
+ for (let s = 0; s < t.length; s += a)
638
+ e.push({
639
+ items: t.slice(s, s + a),
640
+ index: Math.floor(s / a) + 1,
641
+ startIndex: s
24
642
  });
25
- return t;
643
+ return e;
26
644
  }
27
- function S(e, s, t, a, r, i) {
645
+ function W(t, a, e, s, n, i) {
28
646
  return {
29
- chunkIndex: e.index,
30
- totalChunks: s,
31
- itemsInChunk: e.items.length,
32
- totalItems: t,
33
- status: a,
34
- bulkSize: r.bulkSize,
35
- maxConcurrency: r.maxConcurrency,
647
+ chunkIndex: t.index,
648
+ totalChunks: a,
649
+ itemsInChunk: t.items.length,
650
+ totalItems: e,
651
+ status: s,
652
+ bulkSize: n.bulkSize,
653
+ maxConcurrency: n.maxConcurrency,
36
654
  processingMode: i,
37
655
  parallelMode: !0
38
656
  };
39
657
  }
40
- async function G(e, s, t, a, r) {
658
+ async function Ve(t, a, e, s, n, i = {}) {
41
659
  try {
42
- const i = t.map((l) => v(l(e))).filter(Boolean).join(`
660
+ const o = e.map((m) => ae(m(t))).filter(Boolean).join(`
43
661
 
44
- `), o = [s, i].filter(Boolean).join(`
662
+ `), r = [a, o].filter(Boolean).join(`
45
663
 
46
- `), n = ee(o, e, a, r === "files"), c = await E(n, {
664
+ `), c = tt(r, t, s, n === "files"), u = await U(c, {
665
+ ...i,
47
666
  response_format: {
48
667
  type: "json_schema",
49
668
  json_schema: {
50
669
  name: "arch_result",
51
- schema: Y
670
+ schema: Qe
52
671
  }
53
672
  }
54
673
  });
55
- return { item: e, ...c, error: void 0 };
56
- } catch (i) {
57
- return { item: e, passed: !1, reason: `Analysis failed: ${i.message}`, error: i };
674
+ return { item: t, ...u, error: void 0 };
675
+ } catch (o) {
676
+ return { item: t, passed: !1, reason: `Analysis failed: ${o.message}`, error: o };
58
677
  }
59
678
  }
60
- function J(e, s, t, a) {
61
- const r = [], i = [];
62
- let o = a;
63
- for (const n of e)
64
- if (r.push(n), n.passed || (o++, i.push(n.error || new Error(n.reason))), !s && o >= t)
679
+ function We(t, a, e, s) {
680
+ const n = [], i = [];
681
+ let o = s;
682
+ for (const r of t)
683
+ if (n.push(r), r.passed || (o++, i.push(r.error || new Error(r.reason))), !a && o >= e)
65
684
  break;
66
685
  return {
67
- results: r,
686
+ results: n,
68
687
  errors: i,
69
688
  failures: o,
70
- shouldStop: !s && o >= t
689
+ shouldStop: !a && o >= e
71
690
  };
72
691
  }
73
- function h(e, s, t, a) {
74
- e && e(s, t, a);
692
+ function A(t, a, e, s) {
693
+ t && t(a, e, s);
75
694
  }
76
- async function R(e, s, t, a, r) {
77
- h(a, e, void 0, {
78
- ...r,
79
- status: m.PROCESSING
695
+ async function te(t, a, e, s, n, i = {}) {
696
+ A(s, t, void 0, {
697
+ ...n,
698
+ status: k.start
80
699
  });
81
700
  try {
82
- const i = se(s, e, t), o = await A(e, i, {
701
+ const o = st(a, t, e), r = {
702
+ ...i,
83
703
  responseFormat: {
84
704
  type: "json_schema",
85
705
  json_schema: {
86
706
  name: "arch_bulk_result",
87
- schema: Q
707
+ schema: Ze
88
708
  }
89
- }
90
- }), n = o.results || o;
91
- let c = [];
92
- Array.isArray(n) ? c = n : c = e.map((b) => ({
93
- path: b,
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,
94
715
  passed: !1,
95
716
  reason: "Invalid response format"
96
717
  }));
97
- const l = c.filter((b) => !b.passed).length, u = c.length - l;
98
- return h(
99
- a,
100
- e,
101
- l > 0 ? new Error(`${l} items failed`) : void 0,
718
+ const h = m.filter((d) => !d.passed).length, l = m.length - h;
719
+ return A(
720
+ s,
721
+ t,
722
+ h > 0 ? new Error(`${h} items failed`) : void 0,
102
723
  {
103
- ...r,
104
- status: m.COMPLETED,
105
- passed: u,
106
- failed: l
724
+ ...n,
725
+ status: k.complete,
726
+ passed: l,
727
+ failed: h
107
728
  }
108
- ), c;
109
- } catch (i) {
110
- const o = e.map((n) => ({
111
- path: n,
729
+ ), m;
730
+ } catch (o) {
731
+ const r = t.map((c) => ({
732
+ path: c,
112
733
  passed: !1,
113
- reason: `Processing error: ${i.message}`
734
+ reason: `Processing error: ${o.message}`
114
735
  }));
115
- return h(a, e, i, {
116
- ...r,
117
- status: m.ERROR
118
- }), o;
736
+ return A(s, t, o, {
737
+ ...n,
738
+ status: k.error
739
+ }), r;
119
740
  }
120
741
  }
121
- function V(e, s) {
122
- const t = s.filter((n) => n.passed).length, a = s.length - t, r = a === 0, i = s.length < e.length, o = s.filter((n) => !n.passed);
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);
123
744
  return {
124
- passed: t,
125
- failed: a,
126
- allPassed: r,
745
+ passed: e,
746
+ failed: s,
747
+ allPassed: n,
127
748
  stoppedEarly: i,
128
749
  failures: o,
129
- total: e.length,
130
- processed: s.length
750
+ total: t.length,
751
+ processed: a.length
131
752
  };
132
753
  }
133
- function q(e, s, t) {
134
- if (e.allPassed)
135
- return `All ${e.processed}/${e.total} items satisfy: ${s}`;
136
- const a = e.failures.slice(0, g).map((i) => ` • ${i.item}: ${i.reason || "Failed"}`).join(`
137
- `), r = e.failures.length > g ? `
138
- ... and ${e.failures.length - g} more failures` : "";
139
- return `${e.failed}/${e.processed} items failed: ${s}${e.stoppedEarly && t !== T ? ` (stopped after ${t} failures)` : ""}
754
+ function He(t, a, e) {
755
+ if (t.allPassed)
756
+ 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)` : ""}
140
761
 
141
762
  Failures:
142
- ${a}${r}`;
763
+ ${s}${n}`;
143
764
  }
144
- function W(e, s) {
765
+ function Je(t, a) {
145
766
  return {
146
- passed: e.allPassed,
147
- message: s,
767
+ passed: t.allPassed,
768
+ message: a,
148
769
  details: {
149
- total: e.total,
150
- processed: e.processed,
151
- passed: e.passed,
152
- failed: e.failed,
153
- failures: e.failures
770
+ total: t.total,
771
+ processed: t.processed,
772
+ passed: t.passed,
773
+ failed: t.failed,
774
+ failures: t.failures
154
775
  }
155
776
  };
156
777
  }
157
- function H(e, s, t, a) {
158
- const r = s || t.length > 0 || a <= U;
778
+ function Xe(t, a, e, s) {
779
+ const n = a || e.length > 0 || s <= Oe;
159
780
  return {
160
- mode: r ? f.INDIVIDUAL : f.BULK,
161
- batchSize: r ? e.maxConcurrency : e.bulkSize,
162
- processor: r ? (i, o, n) => w(i, o, n) : (i, o, n) => R(
781
+ mode: n ? D.INDIVIDUAL : D.BULK,
782
+ batchSize: n ? t.maxConcurrency : t.bulkSize,
783
+ processor: n ? (i, o, r) => se(i, o, r) : (i, o, r) => te(
163
784
  i.items,
164
785
  o,
165
- n.description,
166
- n.onProgress,
167
- n.metadata
786
+ r.description,
787
+ r.onProgress,
788
+ r.metadata
168
789
  )
169
790
  };
170
791
  }
171
- async function w(e, s, t) {
172
- const a = e.items.map(
173
- (r) => G(
174
- r,
175
- s,
176
- t.itemContextFns,
177
- t.description,
178
- t.targetType
792
+ async function se(t, a, e) {
793
+ const s = t.items.map(
794
+ (n) => Ve(
795
+ n,
796
+ a,
797
+ e.itemContextFns,
798
+ e.description,
799
+ e.targetType,
800
+ e.runConfig
179
801
  )
180
802
  );
181
- return await Promise.all(a);
803
+ return await Promise.all(s);
182
804
  }
183
- function X(e, s, t) {
184
- if (s === f.INDIVIDUAL) {
185
- const { results: a, errors: r, failures: i, shouldStop: o } = J(
186
- e,
187
- t.isCoverageTest,
188
- t.maxFailures,
189
- t.currentFailures || 0
805
+ function Ke(t, a, e) {
806
+ if (a === D.INDIVIDUAL) {
807
+ const { results: s, errors: n, failures: i, shouldStop: o } = We(
808
+ t,
809
+ e.isCoverageTest,
810
+ e.maxFailures,
811
+ e.currentFailures || 0
190
812
  );
191
813
  return {
192
- results: a,
193
- errors: r,
814
+ results: s,
815
+ errors: n,
194
816
  failures: i,
195
817
  shouldStop: o,
196
818
  progressData: {
197
- passed: a.filter((n) => n.passed).length,
198
- failed: r.length
819
+ passed: s.filter((r) => r.passed).length,
820
+ failed: n.length
199
821
  }
200
822
  };
201
823
  } else {
202
- const a = e.map((r) => ({
203
- item: r.path,
204
- passed: r.passed,
205
- reason: r.reason
824
+ const s = t.map((n) => ({
825
+ item: n.path,
826
+ passed: n.passed,
827
+ reason: n.reason
206
828
  }));
207
829
  return {
208
- results: a,
830
+ results: s,
209
831
  errors: [],
210
- failures: t.currentFailures || 0,
832
+ failures: e.currentFailures || 0,
211
833
  shouldStop: !1,
212
834
  progressData: {
213
- passed: a.filter((r) => r.passed).length,
214
- failed: a.filter((r) => !r.passed).length
835
+ passed: s.filter((n) => n.passed).length,
836
+ failed: s.filter((n) => !n.passed).length
215
837
  }
216
838
  };
217
839
  }
218
840
  }
219
- async function K(e, s, t, a) {
220
- const r = z(e, t.batchSize), i = [];
841
+ async function Ye(t, a, e, s) {
842
+ const n = qe(t, e.batchSize), i = [];
221
843
  let o = 0;
222
- for (const n of r) {
223
- if (!a.isCoverageTest && o >= a.maxFailures)
844
+ for (const r of n) {
845
+ if (!s.isCoverageTest && o >= s.maxFailures)
224
846
  break;
225
- const c = S(
226
- n,
227
- r.length,
228
- e.length,
229
- m.PROCESSING,
230
- a,
231
- t.mode
232
- );
233
- h(a.onChunkProcessed, n.items, void 0, c);
234
- let l;
235
- t.mode === f.INDIVIDUAL ? l = await w(n, s, {
236
- itemContextFns: a.itemContextFns,
237
- description: a.description,
238
- targetType: a.targetType
239
- }) : l = await R(
240
- n.items,
847
+ const c = W(
848
+ r,
849
+ n.length,
850
+ t.length,
851
+ k.start,
241
852
  s,
242
- a.description,
243
- a.onChunkProcessed,
244
- c
853
+ e.mode
854
+ );
855
+ A(s.onChunkProcessed, r.items, void 0, c);
856
+ let u;
857
+ e.mode === D.INDIVIDUAL ? u = await se(r, a, {
858
+ itemContextFns: s.itemContextFns,
859
+ description: s.description,
860
+ targetType: s.targetType
861
+ }) : u = await te(
862
+ r.items,
863
+ a,
864
+ s.description,
865
+ s.onChunkProcessed,
866
+ c,
867
+ s.runConfig
245
868
  );
246
- const u = X(l, t.mode, {
247
- ...a,
869
+ const m = Ke(u, e.mode, {
870
+ ...s,
248
871
  currentFailures: o
249
872
  });
250
- if (i.push(...u.results), o = u.failures, h(
251
- a.onChunkProcessed,
252
- n.items,
253
- u.errors.length > 0 ? u.errors[0] : void 0,
873
+ if (i.push(...m.results), o = m.failures, A(
874
+ s.onChunkProcessed,
875
+ r.items,
876
+ m.errors.length > 0 ? m.errors[0] : void 0,
254
877
  {
255
- ...S(
256
- n,
257
- r.length,
258
- e.length,
259
- m.COMPLETED,
260
- a,
261
- t.mode
878
+ ...W(
879
+ r,
880
+ n.length,
881
+ t.length,
882
+ k.complete,
883
+ s,
884
+ e.mode
262
885
  ),
263
- ...u.progressData
886
+ ...m.progressData
264
887
  }
265
- ), u.shouldStop)
888
+ ), m.shouldStop)
266
889
  break;
267
890
  }
268
891
  return i;
269
892
  }
270
- const Y = {
893
+ const Qe = {
271
894
  type: "object",
272
895
  properties: {
273
896
  passed: { type: "boolean" },
274
897
  reason: { type: "string" }
275
898
  },
276
899
  required: ["passed", "reason"]
277
- }, Q = {
900
+ }, Ze = {
278
901
  type: "object",
279
902
  properties: {
280
903
  results: {
@@ -292,119 +915,131 @@ const Y = {
292
915
  },
293
916
  required: ["results"]
294
917
  };
295
- function v(e) {
296
- switch (e.type) {
918
+ function ae(t) {
919
+ switch (t.type) {
297
920
  case "file":
298
- return p.existsSync(e.filePath) ? `<${e.name}>
299
- ${p.readFileSync(e.filePath, "utf8")}
300
- </${e.name}>` : "";
921
+ return I.existsSync(t.filePath) ? `<${t.name}>
922
+ ${I.readFileSync(t.filePath, "utf8")}
923
+ </${t.name}>` : "";
301
924
  case "json": {
302
- if (!p.existsSync(e.filePath)) return "";
303
- const s = JSON.parse(p.readFileSync(e.filePath, "utf8"));
304
- return `<${e.name}>
305
- ${JSON.stringify(s, void 0, 2)}
306
- </${e.name}>`;
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}>`;
307
930
  }
308
931
  case "data": {
309
- const s = typeof e.data == "string" ? e.data : JSON.stringify(e.data, void 0, 2);
310
- return `<${e.name}>
311
- ${s}
312
- </${e.name}>`;
932
+ const a = typeof t.data == "string" ? t.data : JSON.stringify(t.data, void 0, 2);
933
+ return `<${t.name}>
934
+ ${a}
935
+ </${t.name}>`;
313
936
  }
314
937
  default:
315
938
  return "";
316
939
  }
317
940
  }
318
- function Z(e) {
319
- if (!p.existsSync(e)) return "Item does not exist";
320
- if (p.statSync(e).isDirectory())
321
- return p.readdirSync(e).join(", ");
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(", ");
322
945
  {
323
- const t = p.readFileSync(e, "utf8");
324
- return t.length > y ? `${t.substring(0, y)}
325
- ... (truncated)` : t;
946
+ const e = I.readFileSync(t, "utf8");
947
+ return e.length > V ? `${e.substring(0, V)}
948
+ ... (truncated)` : e;
326
949
  }
327
950
  }
328
- function ee(e, s, t, a) {
329
- const r = Z(s);
330
- return `${e}
331
- Analyze this ${a ? "file" : "directory"}: ${s}
951
+ function tt(t, a, e, s) {
952
+ const n = et(a);
953
+ return `${t}
954
+ Analyze this ${s ? "file" : "directory"}: ${a}
332
955
 
333
956
  Content:
334
- ${r}
957
+ ${n}
335
958
 
336
- Does it satisfy: "${t}"?
959
+ Does it satisfy: "${e}"?
337
960
 
338
961
  Return JSON with "passed" (boolean) and "reason" (string).`;
339
962
  }
340
- function se(e, s, t) {
341
- return `${e}
342
- Analyze each item and determine if it satisfies: "${t}"
343
- Items: ${s.join(", ")}
963
+ function st(t, a, e) {
964
+ return `${t}
965
+ Analyze each item and determine if it satisfies: "${e}"
966
+ Items: ${a.join(", ")}
344
967
 
345
968
  Return JSON with "results" array containing objects with "path", "passed" (boolean), and "reason" (string).`;
346
969
  }
347
- class ae {
348
- constructor(s, t = {}) {
349
- this.target = s, this.contexts = [], this.itemContextFns = [], this.maxFailures = t.maxFailures || T, this.bulkSize = t.bulkSize || _, this.maxConcurrency = t.maxConcurrency || B, this.onChunkProcessed = void 0, this.description = void 0, this.threshold = void 0, this.isCoverageTest = !1;
970
+ class at {
971
+ 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;
350
973
  }
351
- withContext(s) {
352
- return this.contexts.push(s), this;
974
+ withContext(a) {
975
+ return this.contexts.push(a), this;
353
976
  }
354
- withItemContext(s) {
355
- return this.itemContextFns.push(s), this;
977
+ withItemContext(a) {
978
+ return this.itemContextFns.push(a), this;
356
979
  }
357
980
  // Set up for a satisfies test
358
- satisfies(s) {
359
- return this.description = s, this;
981
+ satisfies(a) {
982
+ return this.description = a, this;
360
983
  }
361
984
  // Set up for a coverage test
362
- coverage(s = j) {
363
- return this.threshold = s, this.isCoverageTest = !0, this;
985
+ coverage(a = Ue) {
986
+ return this.threshold = a, this.isCoverageTest = !0, this;
364
987
  }
365
988
  // Start processing - this is the fluent terminator
366
989
  async start() {
367
- if (!this.description)
368
- throw new Error("Must call satisfies() before start()");
369
- const s = await this.target.resolve(), t = this.contexts.map(v).filter(Boolean).join(`
990
+ const a = $("ai-arch-expect", this.options), e = L("ai-arch-expect", a.onProgress, a);
991
+ e.start();
992
+ try {
993
+ if (!this.description)
994
+ throw new Error("Must call satisfies() before start()");
995
+ const s = await this.target.resolve(), n = this.contexts.map(ae).filter(Boolean).join(`
370
996
 
371
- `), a = H(
372
- this,
373
- this.onChunkProcessed,
374
- this.itemContextFns,
375
- s.length
376
- ), r = {
377
- bulkSize: this.bulkSize,
378
- maxConcurrency: this.maxConcurrency,
379
- description: this.description,
380
- onChunkProcessed: this.onChunkProcessed,
381
- itemContextFns: this.itemContextFns,
382
- targetType: this.target.type,
383
- maxFailures: this.maxFailures,
384
- isCoverageTest: this.isCoverageTest
385
- }, i = await K(s, t, a, r);
386
- if (this.isCoverageTest) {
387
- const o = i.filter((u) => u.passed).length, n = s.length > 0 ? o / s.length : 0, c = n >= this.threshold, l = `Coverage: ${o}/${s.length} (${(n * 100).toFixed(1)}%) - ${c ? "meets" : "below"} ${(this.threshold * 100).toFixed(1)}% threshold`;
388
- if (!c)
389
- throw new Error(l);
390
- return { passed: c, coverage: n, message: l };
997
+ `), i = Xe(
998
+ this,
999
+ this.onChunkProcessed,
1000
+ this.itemContextFns,
1001
+ s.length
1002
+ ), { bulkSize: o, maxConcurrency: r, maxFailures: c } = await K(a, {
1003
+ bulkSize: B(je),
1004
+ maxConcurrency: B(ze),
1005
+ maxFailures: this.maxFailures
1006
+ }), u = {
1007
+ bulkSize: o,
1008
+ maxConcurrency: r,
1009
+ description: this.description,
1010
+ onChunkProcessed: this.onChunkProcessed,
1011
+ itemContextFns: this.itemContextFns,
1012
+ targetType: this.target.type,
1013
+ maxFailures: c,
1014
+ isCoverageTest: this.isCoverageTest,
1015
+ 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 };
1022
+ }
1023
+ const l = this.summarize(s, h);
1024
+ return e.complete({ outcome: "success", total: s.length, passed: l.details.passed }), l;
1025
+ } catch (s) {
1026
+ throw e.error(s), s;
391
1027
  }
392
- return this.summarize(s, i);
393
1028
  }
394
- summarize(s, t) {
395
- const a = V(s, t), r = q(a, this.description, this.maxFailures);
396
- if (!a.allPassed)
397
- throw new Error(r);
398
- return W(a, r);
1029
+ summarize(a, e) {
1030
+ const s = Ge(a, e), n = He(s, this.description, this.maxFailures);
1031
+ if (!s.allPassed)
1032
+ throw new Error(n);
1033
+ return Je(s, n);
399
1034
  }
400
1035
  }
401
- function ge(e, s = {}) {
402
- return new ae(e, s);
1036
+ function Ct(t, a = {}) {
1037
+ return new at(t, a);
403
1038
  }
404
- function ye() {
1039
+ function kt() {
405
1040
  return console.warn("scanJS is not available in browser environment"), Promise.resolve({});
406
1041
  }
407
- const I = {
1042
+ const G = {
408
1043
  name: "test_analysis_result",
409
1044
  schema: {
410
1045
  type: "object",
@@ -425,14 +1060,14 @@ const I = {
425
1060
  required: ["hasIssues", "issues"],
426
1061
  additionalProperties: !1
427
1062
  }
428
- }, C = "test";
429
- async function d(e, s, t = {}) {
430
- const a = $(C, t), r = O(C, a.onProgress, a);
431
- r.start();
1063
+ }, H = "test";
1064
+ async function nt(t, a, e = {}) {
1065
+ const s = $(H, e), n = L(H, s.onProgress, s);
1066
+ n.start();
432
1067
  try {
433
- const i = await M.readFile(e, "utf-8"), o = `Analyze this code and ${s}:
1068
+ const i = await me.readFile(t, "utf-8"), o = `Analyze this code and ${a}:
434
1069
 
435
- ${D(i, { tag: "code-to-analyze" })}
1070
+ ${pe(i, { tag: "code-to-analyze" })}
436
1071
 
437
1072
  Return a JSON object with:
438
1073
  - "hasIssues": boolean indicating if any issues were found
@@ -443,259 +1078,296 @@ GUIDELINES:
443
1078
  - Provide specific line numbers or code references when possible
444
1079
  - Suggest concrete fixes for each issue identified
445
1080
  - Be concise but clear in your feedback
446
- - If no issues are found, return {"hasIssues": false, "issues": []}`, n = await N(
447
- () => E(o, {
448
- ...a,
449
- response_format: L(I.name, I.schema)
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)
450
1085
  }),
451
1086
  {
452
1087
  label: "test chain",
453
- config: a
1088
+ config: s
454
1089
  }
455
- ), c = n.hasIssues ? n.issues : [];
456
- return r.complete(), c;
1090
+ ), c = r.hasIssues ? r.issues : [];
1091
+ return n.complete({ outcome: "success" }), c;
457
1092
  } catch (i) {
458
- return [`Error analyzing ${e}: ${i.message}`];
1093
+ throw n.error(i), i;
459
1094
  }
460
1095
  }
461
- const te = "Run the code with 5 boundary value test cases and report any that fail", re = "Identify 5 passing scenarios and significant boundary conditions in this code. Provide minimal input examples for each scenario to demonstrate correctness.", ne = "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.", ie = "Identify 5 defects in this code. Provide minimal input examples to demonstrate each defect.", oe = "Suggest 5 best practices improvements for this code.", ce = 'Suggest 5 "clean code" improvements for this code.', le = "Identify 5 specific issues related to code quality, readability, and maintainability.", ue = "Suggest 5 refactors that would most improve the composibility of this code.", Se = async (e) => [
462
- ...await d(e, te),
463
- ...await d(e, re),
464
- ...await d(e, ne),
465
- ...await d(e, ie),
466
- ...await d(e, oe),
467
- ...await d(e, ce),
468
- ...await d(e, le),
469
- ...await d(e, ue)
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
470
1105
  ];
471
- P.config();
1106
+ async function At(t, a = {}) {
1107
+ const e = $(J, a), s = L(J, e.onProgress, e);
1108
+ s.start();
1109
+ 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;
1119
+ } catch (n) {
1120
+ throw s.error(n), n;
1121
+ }
1122
+ }
1123
+ ne.config();
472
1124
  try {
473
- k(JSON.parse(F(x(process.cwd(), ".verblets.json"), "utf8")));
1125
+ he(JSON.parse(re(ie(process.cwd(), ".verblets.json"), "utf8")));
474
1126
  } catch {
475
1127
  }
476
1128
  export {
477
- Ee as CAPABILITY_KEYS,
478
- Te as COMPLIANCE,
479
- Re as CONTEXT_KINDS,
480
- we as COST_POSTURE,
481
- ve as Conversation,
482
- Pe as DOMAIN,
483
- Fe as ENVIRONMENT,
484
- xe as ListStyle,
485
- Ae as QUALITY_INTENT,
486
- $e as SocraticMethod,
487
- Oe as SummaryMap,
488
- De as TimedAbortController,
489
- ge as aiArchExpect,
490
- Ne as aiExpect,
491
- Le as anySignal,
492
- Me as applyAllTargetingRules,
493
- ke as applyCalibrate,
494
- _e as applyEntities,
495
- Be as applyFirstTargetingRule,
496
- je as applyRelations,
497
- Ue as applyScale,
498
- ze as applyScore,
499
- Ge as applyTags,
500
- Je as auto,
501
- Ve as bool,
502
- qe as buildSeedGenerationPrompt,
503
- We as calculateStatistics,
504
- He as calibrate,
505
- Xe as calibrateSpec,
506
- Ke as categorySamples,
507
- Ye as causalFramePrompt,
508
- Qe as centralTendency,
509
- Ze as centralTendencyLines,
510
- es as chunk,
511
- ss as chunkSentences,
512
- as as classify,
513
- ts as collectTerms,
514
- rs as combinations,
515
- ns as commonalities,
516
- is as compact,
517
- os as computeTagStatistics,
518
- cs as config,
519
- ls as constants,
520
- us as conversationTurnReduce,
521
- ds as cosineSimilarity,
522
- ps as createBatches,
523
- ms as createCalibratedClassifier,
524
- hs as createContextBuilder,
525
- fs as createEntityExtractor,
526
- O as createProgressEmitter,
527
- bs as createRelationExtractor,
528
- gs as createScale,
529
- ys as createTagExtractor,
530
- Ss as createTagger,
531
- Is as createTraceCollector,
532
- Cs as date,
533
- Es as debug,
534
- E as default,
535
- Ts as descriptorToSchema,
536
- Rs as detectPatterns,
537
- ws as detectThreshold,
538
- vs as determineStyle,
539
- Ps as disambiguate,
540
- Fs as dismantle,
541
- xs as dismantleFactory,
542
- As as documentShrink,
543
- $s as embed,
544
- Os as embedAssembleSpan,
545
- Ds as embedBatch,
546
- Ns as embedBuildIndex,
547
- Ls as embedChunked,
548
- Ms as embedMergeRanges,
549
- ks as embedMultiQuery,
550
- _s as embedNeighborChunks,
551
- Bs as embedNormalizeText,
552
- js as embedRewriteQuery,
553
- Us as embedRewriteToOutputDoc,
554
- zs as embedScore,
555
- Gs as embedStandaloneSpan,
556
- Js as embedStepBack,
557
- Vs as embedSubquestions,
558
- qs as embedWarmup,
559
- Ws as entities,
560
- Hs as entitiesFilterInstructions,
561
- Xs as entitiesFindInstructions,
562
- Ks as entitiesGroupInstructions,
563
- Ys as entitiesMapInstructions,
564
- Qs as entitiesReduceInstructions,
565
- Zs as entitySpec,
566
- ea as evaluateTargetingClause,
567
- sa as evaluateTargetingRule,
568
- aa as eventToTrace,
569
- ta as expect,
570
- ra as extractBlocks,
571
- na as extractJson,
572
- ia as fillMissing,
573
- oa as filter,
574
- ca as filterAmbiguous,
575
- la as find,
576
- ua as generateList,
577
- da as getCapabilities,
578
- pa as getMeanings,
579
- ma as getOption,
580
- ha as getOptionDetail,
581
- fa as getOptions,
582
- ba as glossary,
583
- ga as group,
584
- ya as init,
585
- Sa as intent,
586
- Ia as intersections,
587
- Ca as join,
588
- Ea as last,
589
- Ta as list,
590
- Ra as listBatch,
591
- wa as listExpand,
592
- E as llm,
593
- va as llmLogger,
594
- Pa as makePrompt,
595
- Fa as map,
596
- xa as name,
597
- Aa as nameSimilarTo,
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,
598
1264
  $ as nameStep,
599
- $a as normalizeLlm,
600
- Oa as number,
601
- Da as numberWithUnits,
602
- Na as observeApplication,
603
- La as observeProviders,
604
- Ma as omit,
605
- ka as parallel,
606
- _a as parallelMap,
607
- Ba as parseLLMList,
608
- ja as parseRDFLiteral,
609
- Ua as parseRelations,
610
- za as people,
611
- Ga as phailForge,
612
- Ja as pick,
613
- Va as pipe,
614
- qa as popReference,
615
- Wa as probeScan,
616
- Ha as promptCache,
617
- Xa as promptPiece,
618
- Ka as prompts,
619
- Ya as questions,
620
- Qa as rangeCombinations,
621
- A as reduce,
622
- Za as relationSpec,
623
- et as relations,
624
- st as relationsFilterInstructions,
625
- at as relationsFindInstructions,
626
- tt as relationsGroupInstructions,
627
- rt as relationsMapInstructions,
628
- nt as relationsReduceInstructions,
629
- it as resolveModel,
630
- N as retry,
631
- ot as ringBuffer,
632
- ct as scale,
633
- lt as scaleFilterInstructions,
634
- ut as scaleFindInstructions,
635
- dt as scaleGroupInstructions,
636
- pt as scaleMapInstructions,
637
- mt as scaleReduceInstructions,
638
- ht as scaleSpec,
639
- ye as scanJS,
640
- ft as schemaOrg,
641
- bt as schemas,
642
- gt as scientificFramingPrompt,
643
- yt as scopePhase,
644
- St as score,
645
- It as scoreFilterInstructions,
646
- Ct as scoreFindInstructions,
647
- Et as scoreGroupInstructions,
648
- Tt as scoreItem,
649
- Rt as scoreMapInstructions,
650
- wt as scoreReduceInstructions,
651
- vt as scoreSpec,
652
- Pt as sentiment,
653
- Ft as services,
654
- xt as setEmbedEnabled,
655
- At as setInterval,
656
- $t as shuffle,
657
- Ot as simplifyTree,
658
- Dt as socratic,
659
- Nt as softCoverPrompt,
660
- Lt as sort,
661
- Mt as sortBy,
662
- kt as split,
663
- _t as stripNumeric,
664
- Bt as stripResponse,
665
- jt as suggestTargetingRules,
666
- Ut as tagSpec,
667
- zt as tagVocabulary,
668
- Gt as tags,
669
- Jt as tagsFilterInstructions,
670
- Vt as tagsFindInstructions,
671
- qt as tagsGroupInstructions,
672
- Wt as tagsMapInstructions,
673
- Ht as tagsReduceInstructions,
674
- Xt as targetingClause,
675
- Kt as targetingRule,
676
- Yt as targetingRuleOps,
677
- Qt as targetingRuleSchema,
678
- Zt as templateReplace,
679
- d as test,
680
- Se as testAdvice,
681
- er as themes,
682
- sr as timeline,
683
- ar as toBool,
684
- tr as toDate,
685
- rr as toEnum,
686
- nr as toNumber,
687
- ir as toNumberWithUnits,
688
- or as toObject,
689
- cr as truncate,
690
- lr as unionBy,
691
- ur as validateTargetingRules,
692
- dr as valueArbitrate,
693
- pr as vectorSearch,
694
- mr as veiledVariantStrategies,
695
- hr as veiledVariants,
696
- fr as version,
697
- br as windowFor,
698
- gr as withInactivityTimeout,
699
- yr as withPolicy,
700
- Sr as zipWith
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,
1323
+ 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
701
1373
  };