@far-world-labs/verblets 0.6.1 → 0.6.4

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