@far-world-labs/verblets 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import R from "dotenv";
2
- import p, { readFileSync as T } from "node:fs";
1
+ import P from "dotenv";
2
+ import p, { readFileSync as F } from "node:fs";
3
3
  import { resolve as x } from "node:path";
4
- import { r as v, a as C, s as $, b as A, c as O, j as N } from "./shared-CMgpfDG4.js";
5
- import { cv as Ie, B as Ce, C as Ee, F as Pe, D as we, E as Fe, a8 as Re, Q as Te, bN as xe, bM as ve, z as $e, U as Ae, aT as Oe, m as Ne, ae as ke, ao as De, bf as Le, b_ as Me, f as Be, ay as _e, R as je, x as Ue, y as ze, ax as Ge, bd as Je, M as Ve, N as qe, cd as We, bG as He, az as Xe, bE as Ke, aA as Ye, ce as Qe, b5 as Ze, cx as es, d as ss, aB as ts, aC as as, cf as rs, bZ as ns, bY as is, bI as os, A as cs, G as ls, V as us, aU as ds, o as ps, ap as ms, aq as hs, g as bs, bH as fs, O as ys, P as gs, a9 as Ss, aD as Is, aF as Cs, aH as Es, aI as Ps, bn as ws, bC as Fs, bo as Rs, bA as Ts, bp as xs, bB as vs, bu as $s, bz as As, by as Os, bt as Ns, bx as ks, bs as Ds, bD as Ls, bv as Ms, bw as Bs, bq as _s, bV as js, bW as Us, bU as zs, bS as Gs, bX as Js, bQ as Vs, bR as qs, bT as Ws, S as Hs, X as Xs, Z as Ks, _ as Ys, W as Qs, Y as Zs, T as et, i as st, bg as tt, bh as at, $ as rt, aw as nt, c4 as it, aJ as ot, a0 as ct, aK as lt, c0 as ut, a1 as dt, a6 as pt, cu as mt, aE as ht, J as bt, K as ft, a2 as yt, a3 as gt, cw as St, bi as It, a4 as Ct, aL as Et, cg as Pt, a5 as wt, a7 as Ft, aa as Rt, bj as Tt, bk as xt, ab as vt, aM as $t, aN as At, bJ as Ot, n as Nt, h as kt, H as Dt, I as Lt, ch as Mt, bK as Bt, bL as _t, cc as jt, aV as Ut, aW as zt, aO as Gt, bk as Jt, ci as Vt, co as qt, aP as Wt, w as Ht, cr as Xt, cs as Kt, cp as Yt, aQ as Qt, bF as Zt, aS as ea, aR as sa, aY as ta, a_ as aa, a$ as ra, aX as na, aZ as ia, ct as oa, bP as ca, k as la, q as ua, u as da, v as pa, p as ma, t as ha, l as ba, b0 as fa, cq as ya, bc as ga, b$ as Sa, ac as Ia, ah as Ca, aj as Ea, ak as Pa, af as wa, ag as Fa, ai as Ra, ad as Ta, bl as xa, e as va, br as $a, bm as Aa, cn as Oa, aG as Na, b1 as ka, be as Da, al as La, cj as Ma, b2 as Ba, c6 as _a, c5 as ja, b3 as Ua, an as za, b4 as Ga, am as Ja, as as Va, au as qa, av as Wa, ar as Ha, at as Xa, bO as Ka, b6 as Ya, b7 as Qa, c7 as Za, c9 as er, ca as sr, c8 as tr, cb as ar, b8 as rr, b9 as nr, ck as ir, cl as or, bb as cr, ba as lr, c1 as ur, c2 as dr, c3 as pr, L as mr, cm as hr } from "./shared-CMgpfDG4.js";
4
+ import { r as A, a as E, n as $, c as O, b as D, d as N, j as L } from "./shared-C2_d1bKV.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-C2_d1bKV.js";
6
6
  import "glob";
7
- import k from "node:fs/promises";
8
- const D = (e) => {
9
- }, E = 1, L = 20, M = 5, B = 0.5, _ = 5, g = 8e3, y = 5, b = {
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 = {
10
10
  INDIVIDUAL: "individual",
11
11
  BULK: "bulk"
12
12
  }, m = {
@@ -14,89 +14,89 @@ const D = (e) => {
14
14
  COMPLETED: "completed",
15
15
  ERROR: "error"
16
16
  };
17
- function j(e, s) {
18
- const a = [];
19
- for (let t = 0; t < e.length; t += s)
20
- a.push({
21
- items: e.slice(t, t + s),
22
- index: Math.floor(t / s) + 1,
23
- startIndex: t
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
24
24
  });
25
- return a;
25
+ return t;
26
26
  }
27
- function S(e, s, a, t, r, n) {
27
+ function S(e, s, t, a, r, i) {
28
28
  return {
29
29
  chunkIndex: e.index,
30
30
  totalChunks: s,
31
31
  itemsInChunk: e.items.length,
32
- totalItems: a,
33
- status: t,
32
+ totalItems: t,
33
+ status: a,
34
34
  bulkSize: r.bulkSize,
35
35
  maxConcurrency: r.maxConcurrency,
36
- processingMode: n,
36
+ processingMode: i,
37
37
  parallelMode: !0
38
38
  };
39
39
  }
40
- async function U(e, s, a, t, r) {
40
+ async function G(e, s, t, a, r) {
41
41
  try {
42
- const n = a.map((l) => F(l(e))).filter(Boolean).join(`
42
+ const i = t.map((l) => v(l(e))).filter(Boolean).join(`
43
43
 
44
- `), o = [s, n].filter(Boolean).join(`
44
+ `), o = [s, i].filter(Boolean).join(`
45
45
 
46
- `), i = Q(o, e, t, r === "files"), c = await C(i, {
46
+ `), n = ee(o, e, a, r === "files"), c = await E(n, {
47
47
  response_format: {
48
48
  type: "json_schema",
49
49
  json_schema: {
50
50
  name: "arch_result",
51
- schema: X
51
+ schema: Y
52
52
  }
53
53
  }
54
54
  });
55
55
  return { item: e, ...c, error: void 0 };
56
- } catch (n) {
57
- return { item: e, passed: !1, reason: `Analysis failed: ${n.message}`, error: n };
56
+ } catch (i) {
57
+ return { item: e, passed: !1, reason: `Analysis failed: ${i.message}`, error: i };
58
58
  }
59
59
  }
60
- function z(e, s, a, t) {
61
- const r = [], n = [];
62
- let o = t;
63
- for (const i of e)
64
- if (r.push(i), i.passed || (o++, n.push(i.error || new Error(i.reason))), !s && o >= a)
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)
65
65
  break;
66
66
  return {
67
67
  results: r,
68
- errors: n,
68
+ errors: i,
69
69
  failures: o,
70
- shouldStop: !s && o >= a
70
+ shouldStop: !s && o >= t
71
71
  };
72
72
  }
73
- function h(e, s, a, t) {
74
- e && e(s, a, t);
73
+ function h(e, s, t, a) {
74
+ e && e(s, t, a);
75
75
  }
76
- async function P(e, s, a, t, r) {
77
- h(t, e, void 0, {
76
+ async function R(e, s, t, a, r) {
77
+ h(a, e, void 0, {
78
78
  ...r,
79
79
  status: m.PROCESSING
80
80
  });
81
81
  try {
82
- const n = Z(s, e, a), o = await v(e, n, {
82
+ const i = se(s, e, t), o = await A(e, i, {
83
83
  responseFormat: {
84
84
  type: "json_schema",
85
85
  json_schema: {
86
86
  name: "arch_bulk_result",
87
- schema: K
87
+ schema: Q
88
88
  }
89
89
  }
90
- }), i = o.results || o;
90
+ }), n = o.results || o;
91
91
  let c = [];
92
- Array.isArray(i) ? c = i : c = e.map((f) => ({
93
- path: f,
92
+ Array.isArray(n) ? c = n : c = e.map((b) => ({
93
+ path: b,
94
94
  passed: !1,
95
95
  reason: "Invalid response format"
96
96
  }));
97
- const l = c.filter((f) => !f.passed).length, u = c.length - l;
97
+ const l = c.filter((b) => !b.passed).length, u = c.length - l;
98
98
  return h(
99
- t,
99
+ a,
100
100
  e,
101
101
  l > 0 ? new Error(`${l} items failed`) : void 0,
102
102
  {
@@ -106,42 +106,42 @@ async function P(e, s, a, t, r) {
106
106
  failed: l
107
107
  }
108
108
  ), c;
109
- } catch (n) {
110
- const o = e.map((i) => ({
111
- path: i,
109
+ } catch (i) {
110
+ const o = e.map((n) => ({
111
+ path: n,
112
112
  passed: !1,
113
- reason: `Processing error: ${n.message}`
113
+ reason: `Processing error: ${i.message}`
114
114
  }));
115
- return h(t, e, n, {
115
+ return h(a, e, i, {
116
116
  ...r,
117
117
  status: m.ERROR
118
118
  }), o;
119
119
  }
120
120
  }
121
- function G(e, s) {
122
- const a = s.filter((i) => i.passed).length, t = s.length - a, r = t === 0, n = s.length < e.length, o = s.filter((i) => !i.passed);
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);
123
123
  return {
124
- passed: a,
125
- failed: t,
124
+ passed: t,
125
+ failed: a,
126
126
  allPassed: r,
127
- stoppedEarly: n,
127
+ stoppedEarly: i,
128
128
  failures: o,
129
129
  total: e.length,
130
130
  processed: s.length
131
131
  };
132
132
  }
133
- function J(e, s, a) {
133
+ function q(e, s, t) {
134
134
  if (e.allPassed)
135
135
  return `All ${e.processed}/${e.total} items satisfy: ${s}`;
136
- const t = e.failures.slice(0, y).map((n) => ` • ${n.item}: ${n.reason || "Failed"}`).join(`
137
- `), r = e.failures.length > y ? `
138
- ... and ${e.failures.length - y} more failures` : "";
139
- return `${e.failed}/${e.processed} items failed: ${s}${e.stoppedEarly && a !== E ? ` (stopped after ${a} failures)` : ""}
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)` : ""}
140
140
 
141
141
  Failures:
142
- ${t}${r}`;
142
+ ${a}${r}`;
143
143
  }
144
- function V(e, s) {
144
+ function W(e, s) {
145
145
  return {
146
146
  passed: e.allPassed,
147
147
  message: s,
@@ -154,127 +154,127 @@ function V(e, s) {
154
154
  }
155
155
  };
156
156
  }
157
- function q(e, s, a, t) {
158
- const r = s || a.length > 0 || t <= _;
157
+ function H(e, s, t, a) {
158
+ const r = s || t.length > 0 || a <= U;
159
159
  return {
160
- mode: r ? b.INDIVIDUAL : b.BULK,
160
+ mode: r ? f.INDIVIDUAL : f.BULK,
161
161
  batchSize: r ? e.maxConcurrency : e.bulkSize,
162
- processor: r ? (n, o, i) => w(n, o, i) : (n, o, i) => P(
163
- n.items,
162
+ processor: r ? (i, o, n) => w(i, o, n) : (i, o, n) => R(
163
+ i.items,
164
164
  o,
165
- i.description,
166
- i.onProgress,
167
- i.metadata
165
+ n.description,
166
+ n.onProgress,
167
+ n.metadata
168
168
  )
169
169
  };
170
170
  }
171
- async function w(e, s, a) {
172
- const t = e.items.map(
173
- (r) => U(
171
+ async function w(e, s, t) {
172
+ const a = e.items.map(
173
+ (r) => G(
174
174
  r,
175
175
  s,
176
- a.itemContextFns,
177
- a.description,
178
- a.targetType
176
+ t.itemContextFns,
177
+ t.description,
178
+ t.targetType
179
179
  )
180
180
  );
181
- return await Promise.all(t);
181
+ return await Promise.all(a);
182
182
  }
183
- function W(e, s, a) {
184
- if (s === b.INDIVIDUAL) {
185
- const { results: t, errors: r, failures: n, shouldStop: o } = z(
183
+ function X(e, s, t) {
184
+ if (s === f.INDIVIDUAL) {
185
+ const { results: a, errors: r, failures: i, shouldStop: o } = J(
186
186
  e,
187
- a.isCoverageTest,
188
- a.maxFailures,
189
- a.currentFailures || 0
187
+ t.isCoverageTest,
188
+ t.maxFailures,
189
+ t.currentFailures || 0
190
190
  );
191
191
  return {
192
- results: t,
192
+ results: a,
193
193
  errors: r,
194
- failures: n,
194
+ failures: i,
195
195
  shouldStop: o,
196
196
  progressData: {
197
- passed: t.filter((i) => i.passed).length,
197
+ passed: a.filter((n) => n.passed).length,
198
198
  failed: r.length
199
199
  }
200
200
  };
201
201
  } else {
202
- const t = e.map((r) => ({
202
+ const a = e.map((r) => ({
203
203
  item: r.path,
204
204
  passed: r.passed,
205
205
  reason: r.reason
206
206
  }));
207
207
  return {
208
- results: t,
208
+ results: a,
209
209
  errors: [],
210
- failures: a.currentFailures || 0,
210
+ failures: t.currentFailures || 0,
211
211
  shouldStop: !1,
212
212
  progressData: {
213
- passed: t.filter((r) => r.passed).length,
214
- failed: t.filter((r) => !r.passed).length
213
+ passed: a.filter((r) => r.passed).length,
214
+ failed: a.filter((r) => !r.passed).length
215
215
  }
216
216
  };
217
217
  }
218
218
  }
219
- async function H(e, s, a, t) {
220
- const r = j(e, a.batchSize), n = [];
219
+ async function K(e, s, t, a) {
220
+ const r = z(e, t.batchSize), i = [];
221
221
  let o = 0;
222
- for (const i of r) {
223
- if (!t.isCoverageTest && o >= t.maxFailures)
222
+ for (const n of r) {
223
+ if (!a.isCoverageTest && o >= a.maxFailures)
224
224
  break;
225
225
  const c = S(
226
- i,
226
+ n,
227
227
  r.length,
228
228
  e.length,
229
229
  m.PROCESSING,
230
- t,
231
- a.mode
230
+ a,
231
+ t.mode
232
232
  );
233
- h(t.onChunkProcessed, i.items, void 0, c);
233
+ h(a.onChunkProcessed, n.items, void 0, c);
234
234
  let l;
235
- a.mode === b.INDIVIDUAL ? l = await w(i, s, {
236
- itemContextFns: t.itemContextFns,
237
- description: t.description,
238
- targetType: t.targetType
239
- }) : l = await P(
240
- i.items,
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,
241
241
  s,
242
- t.description,
243
- t.onChunkProcessed,
242
+ a.description,
243
+ a.onChunkProcessed,
244
244
  c
245
245
  );
246
- const u = W(l, a.mode, {
247
- ...t,
246
+ const u = X(l, t.mode, {
247
+ ...a,
248
248
  currentFailures: o
249
249
  });
250
- if (n.push(...u.results), o = u.failures, h(
251
- t.onChunkProcessed,
252
- i.items,
250
+ if (i.push(...u.results), o = u.failures, h(
251
+ a.onChunkProcessed,
252
+ n.items,
253
253
  u.errors.length > 0 ? u.errors[0] : void 0,
254
254
  {
255
255
  ...S(
256
- i,
256
+ n,
257
257
  r.length,
258
258
  e.length,
259
259
  m.COMPLETED,
260
- t,
261
- a.mode
260
+ a,
261
+ t.mode
262
262
  ),
263
263
  ...u.progressData
264
264
  }
265
265
  ), u.shouldStop)
266
266
  break;
267
267
  }
268
- return n;
268
+ return i;
269
269
  }
270
- const X = {
270
+ const Y = {
271
271
  type: "object",
272
272
  properties: {
273
273
  passed: { type: "boolean" },
274
274
  reason: { type: "string" }
275
275
  },
276
276
  required: ["passed", "reason"]
277
- }, K = {
277
+ }, Q = {
278
278
  type: "object",
279
279
  properties: {
280
280
  results: {
@@ -292,7 +292,7 @@ const X = {
292
292
  },
293
293
  required: ["results"]
294
294
  };
295
- function F(e) {
295
+ function v(e) {
296
296
  switch (e.type) {
297
297
  case "file":
298
298
  return p.existsSync(e.filePath) ? `<${e.name}>
@@ -315,38 +315,38 @@ ${s}
315
315
  return "";
316
316
  }
317
317
  }
318
- function Y(e) {
318
+ function Z(e) {
319
319
  if (!p.existsSync(e)) return "Item does not exist";
320
320
  if (p.statSync(e).isDirectory())
321
321
  return p.readdirSync(e).join(", ");
322
322
  {
323
- const a = p.readFileSync(e, "utf8");
324
- return a.length > g ? `${a.substring(0, g)}
325
- ... (truncated)` : a;
323
+ const t = p.readFileSync(e, "utf8");
324
+ return t.length > y ? `${t.substring(0, y)}
325
+ ... (truncated)` : t;
326
326
  }
327
327
  }
328
- function Q(e, s, a, t) {
329
- const r = Y(s);
328
+ function ee(e, s, t, a) {
329
+ const r = Z(s);
330
330
  return `${e}
331
- Analyze this ${t ? "file" : "directory"}: ${s}
331
+ Analyze this ${a ? "file" : "directory"}: ${s}
332
332
 
333
333
  Content:
334
334
  ${r}
335
335
 
336
- Does it satisfy: "${a}"?
336
+ Does it satisfy: "${t}"?
337
337
 
338
338
  Return JSON with "passed" (boolean) and "reason" (string).`;
339
339
  }
340
- function Z(e, s, a) {
340
+ function se(e, s, t) {
341
341
  return `${e}
342
- Analyze each item and determine if it satisfies: "${a}"
342
+ Analyze each item and determine if it satisfies: "${t}"
343
343
  Items: ${s.join(", ")}
344
344
 
345
345
  Return JSON with "results" array containing objects with "path", "passed" (boolean), and "reason" (string).`;
346
346
  }
347
- class ee {
348
- constructor(s, a = {}) {
349
- this.target = s, this.contexts = [], this.itemContextFns = [], this.maxFailures = a.maxFailures || E, this.bulkSize = a.bulkSize || L, this.maxConcurrency = a.maxConcurrency || M, this.onChunkProcessed = void 0, this.description = void 0, this.threshold = void 0, this.isCoverageTest = !1;
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;
350
350
  }
351
351
  withContext(s) {
352
352
  return this.contexts.push(s), this;
@@ -359,16 +359,16 @@ class ee {
359
359
  return this.description = s, this;
360
360
  }
361
361
  // Set up for a coverage test
362
- coverage(s = B) {
362
+ coverage(s = j) {
363
363
  return this.threshold = s, this.isCoverageTest = !0, this;
364
364
  }
365
365
  // Start processing - this is the fluent terminator
366
366
  async start() {
367
367
  if (!this.description)
368
368
  throw new Error("Must call satisfies() before start()");
369
- const s = await this.target.resolve(), a = this.contexts.map(F).filter(Boolean).join(`
369
+ const s = await this.target.resolve(), t = this.contexts.map(v).filter(Boolean).join(`
370
370
 
371
- `), t = q(
371
+ `), a = H(
372
372
  this,
373
373
  this.onChunkProcessed,
374
374
  this.itemContextFns,
@@ -382,26 +382,26 @@ class ee {
382
382
  targetType: this.target.type,
383
383
  maxFailures: this.maxFailures,
384
384
  isCoverageTest: this.isCoverageTest
385
- }, n = await H(s, a, t, r);
385
+ }, i = await K(s, t, a, r);
386
386
  if (this.isCoverageTest) {
387
- const o = n.filter((u) => u.passed).length, i = s.length > 0 ? o / s.length : 0, c = i >= this.threshold, l = `Coverage: ${o}/${s.length} (${(i * 100).toFixed(1)}%) - ${c ? "meets" : "below"} ${(this.threshold * 100).toFixed(1)}% threshold`;
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
388
  if (!c)
389
389
  throw new Error(l);
390
- return { passed: c, coverage: i, message: l };
390
+ return { passed: c, coverage: n, message: l };
391
391
  }
392
- return this.summarize(s, n);
392
+ return this.summarize(s, i);
393
393
  }
394
- summarize(s, a) {
395
- const t = G(s, a), r = J(t, this.description, this.maxFailures);
396
- if (!t.allPassed)
394
+ summarize(s, t) {
395
+ const a = V(s, t), r = q(a, this.description, this.maxFailures);
396
+ if (!a.allPassed)
397
397
  throw new Error(r);
398
- return V(t, r);
398
+ return W(a, r);
399
399
  }
400
400
  }
401
- function be(e, s = {}) {
402
- return new ee(e, s);
401
+ function ge(e, s = {}) {
402
+ return new ae(e, s);
403
403
  }
404
- function fe() {
404
+ function ye() {
405
405
  return console.warn("scanJS is not available in browser environment"), Promise.resolve({});
406
406
  }
407
407
  const I = {
@@ -425,13 +425,14 @@ const I = {
425
425
  required: ["hasIssues", "issues"],
426
426
  additionalProperties: !1
427
427
  }
428
- };
429
- async function d(e, s, a = {}) {
430
- a = $("test", a);
428
+ }, C = "test";
429
+ async function d(e, s, t = {}) {
430
+ const a = $(C, t), r = O(C, a.onProgress, a);
431
+ r.start();
431
432
  try {
432
- const t = await k.readFile(e, "utf-8"), r = `Analyze this code and ${s}:
433
+ const i = await M.readFile(e, "utf-8"), o = `Analyze this code and ${s}:
433
434
 
434
- ${A(t, { tag: "code-to-analyze" })}
435
+ ${D(i, { tag: "code-to-analyze" })}
435
436
 
436
437
  Return a JSON object with:
437
438
  - "hasIssues": boolean indicating if any issues were found
@@ -442,255 +443,259 @@ GUIDELINES:
442
443
  - Provide specific line numbers or code references when possible
443
444
  - Suggest concrete fixes for each issue identified
444
445
  - Be concise but clear in your feedback
445
- - If no issues are found, return {"hasIssues": false, "issues": []}`, n = await O(
446
- () => C(r, {
446
+ - If no issues are found, return {"hasIssues": false, "issues": []}`, n = await N(
447
+ () => E(o, {
447
448
  ...a,
448
- response_format: N(I.name, I.schema)
449
+ response_format: L(I.name, I.schema)
449
450
  }),
450
451
  {
451
452
  label: "test chain",
452
453
  config: a
453
454
  }
454
- );
455
- return n.hasIssues ? n.issues : [];
456
- } catch (t) {
457
- return [`Error analyzing ${e}: ${t.message}`];
455
+ ), c = n.hasIssues ? n.issues : [];
456
+ return r.complete(), c;
457
+ } catch (i) {
458
+ return [`Error analyzing ${e}: ${i.message}`];
458
459
  }
459
460
  }
460
- const se = "Run the code with 5 boundary value test cases and report any that fail", te = "Identify 5 passing scenarios and significant boundary conditions in this code. Provide minimal input examples for each scenario to demonstrate correctness.", ae = "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.", re = "Identify 5 defects in this code. Provide minimal input examples to demonstrate each defect.", ne = "Suggest 5 best practices improvements for this code.", ie = 'Suggest 5 "clean code" improvements for this code.', oe = "Identify 5 specific issues related to code quality, readability, and maintainability.", ce = "Suggest 5 refactors that would most improve the composibility of this code.", ye = async (e) => [
461
- ...await d(e, se),
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
462
  ...await d(e, te),
463
- ...await d(e, ae),
464
463
  ...await d(e, re),
465
464
  ...await d(e, ne),
466
465
  ...await d(e, ie),
467
466
  ...await d(e, oe),
468
- ...await d(e, ce)
467
+ ...await d(e, ce),
468
+ ...await d(e, le),
469
+ ...await d(e, ue)
469
470
  ];
470
- R.config();
471
+ P.config();
471
472
  try {
472
- D(JSON.parse(T(x(process.cwd(), ".verblets.json"), "utf8")));
473
+ k(JSON.parse(F(x(process.cwd(), ".verblets.json"), "utf8")));
473
474
  } catch {
474
475
  }
475
476
  export {
476
- Ie as CAPABILITY_KEYS,
477
- Ce as COMPLIANCE,
478
- Ee as CONTEXT_KINDS,
479
- Pe as COST_POSTURE,
480
- we as DOMAIN,
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,
481
483
  Fe as ENVIRONMENT,
482
- Re as ListStyle,
483
- Te as QUALITY_INTENT,
484
- xe as TimedAbortController,
485
- be as aiArchExpect,
486
- ve as anySignal,
487
- $e as applyCalibrate,
488
- Ae as applyEntities,
489
- Oe as applyRelations,
490
- Ne as applyScale,
491
- ke as applyScore,
492
- De as applyTags,
493
- Le as auto,
494
- Me as batchTracker,
495
- Be as bool,
496
- _e as buildSeedGenerationPrompt,
497
- je as calculateStatistics,
498
- Ue as calibrate,
499
- ze as calibrateSpec,
500
- Ge as categorySamples,
501
- Je as causalFramePrompt,
502
- Ve as centralTendency,
503
- qe as centralTendencyLines,
504
- We as chunk,
505
- He as chunkSentences,
506
- Xe as collectTerms,
507
- Ke as combinations,
508
- Ye as commonalities,
509
- Qe as compact,
510
- Ze as computeTagStatistics,
511
- es as config,
512
- ss as constants,
513
- ts as conversation,
514
- as as conversationTurnReduce,
515
- rs as cosineSimilarity,
516
- ns as createBatchContext,
517
- is as createBatchProgressCallback,
518
- os as createBatches,
519
- cs as createCalibratedClassifier,
520
- ls as createContextBuilder,
521
- us as createEntityExtractor,
522
- ds as createRelationExtractor,
523
- ps as createScale,
524
- ms as createTagExtractor,
525
- hs as createTagger,
526
- bs as date,
527
- fs as debug,
528
- C as default,
529
- ys as detectPatterns,
530
- gs as detectThreshold,
531
- Ss as determineStyle,
532
- Is as disambiguate,
533
- Cs as dismantle,
534
- Es as dismantleFactory,
535
- Ps as documentShrink,
536
- ws as embed,
537
- Fs as embedAssembleSpan,
538
- Rs as embedBatch,
539
- Ts as embedBuildIndex,
540
- xs as embedChunked,
541
- vs as embedMergeRanges,
542
- $s as embedMultiQuery,
543
- As as embedNeighborChunks,
544
- Os as embedNormalizeText,
545
- Ns as embedRewriteQuery,
546
- ks as embedRewriteToOutputDoc,
547
- Ds as embedScore,
548
- Ls as embedStandaloneSpan,
549
- Ms as embedStepBack,
550
- Bs as embedSubquestions,
551
- _s as embedWarmup,
552
- js as emitBatchComplete,
553
- Us as emitBatchProcessed,
554
- zs as emitBatchStart,
555
- Gs as emitComplete,
556
- Js as emitPhaseProgress,
557
- Vs as emitProgress,
558
- qs as emitStart,
559
- Ws as emitStepProgress,
560
- Hs as entities,
561
- Xs as entitiesFilterInstructions,
562
- Ks as entitiesFindInstructions,
563
- Ys as entitiesGroupInstructions,
564
- Qs as entitiesMapInstructions,
565
- Zs as entitiesReduceInstructions,
566
- et as entitySpec,
567
- st as enums,
568
- tt as expect,
569
- at as expectChain,
570
- rt as extractBlocks,
571
- nt as extractFeatures,
572
- it as extractJson,
573
- ot as fillMissing,
574
- ct as filter,
575
- lt as filterAmbiguous,
576
- ut as filterProgress,
577
- dt as find,
578
- pt as generateList,
579
- mt as getCapabilities,
580
- ht as getMeanings,
581
- bt as getOption,
582
- ft as getOptions,
583
- yt as glossary,
584
- gt as group,
585
- St as init,
586
- It as intent,
587
- Ct as intersections,
588
- Et as join,
589
- Pt as last,
590
- wt as list,
591
- Ft as listBatch,
592
- Rt as listExpand,
593
- C as llm,
594
- Tt as llmLogger,
595
- xt as makePrompt,
596
- vt as map,
597
- $t as name,
598
- At as nameSimilarTo,
599
- Ot as normalizeLlm,
600
- Nt as number,
601
- kt as numberWithUnits,
602
- Dt as observeApplication,
603
- Lt as observeProviders,
604
- Mt as omit,
605
- Bt as parallel,
606
- _t as parallelMap,
607
- jt as parseLLMList,
608
- Ut as parseRDFLiteral,
609
- zt as parseRelations,
610
- Gt as people,
611
- Jt as phailForge,
612
- Vt as pick,
613
- qt as pipe,
614
- Wt as popReference,
615
- Ht as probeScan,
616
- Xt as promptCache,
617
- Kt as promptPiece,
618
- Yt as prompts,
619
- Qt as questions,
620
- Zt as rangeCombinations,
621
- v as reduce,
622
- ea as relationSpec,
623
- sa as relations,
624
- ta as relationsFilterInstructions,
625
- aa as relationsFindInstructions,
626
- ra as relationsGroupInstructions,
627
- na as relationsMapInstructions,
628
- ia as relationsReduceInstructions,
629
- oa as resolveModel,
630
- O as retry,
631
- ca as ringBuffer,
632
- la as scale,
633
- ua as scaleFilterInstructions,
634
- da as scaleFindInstructions,
635
- pa as scaleGroupInstructions,
636
- ma as scaleMapInstructions,
637
- ha as scaleReduceInstructions,
638
- ba as scaleSpec,
639
- fe as scanJS,
640
- fa as schemaOrg,
641
- ya as schemas,
642
- ga as scientificFramingPrompt,
643
- $ as scopeOperation,
644
- Sa as scopeProgress,
645
- Ia as score,
646
- Ca as scoreFilterInstructions,
647
- Ea as scoreFindInstructions,
648
- Pa as scoreGroupInstructions,
649
- wa as scoreItem,
650
- Fa as scoreMapInstructions,
651
- Ra as scoreReduceInstructions,
652
- Ta as scoreSpec,
653
- xa as sentiment,
654
- va as services,
655
- $a as setEmbedEnabled,
656
- Aa as setInterval,
657
- Oa as shuffle,
658
- Na as simplifyTree,
659
- ka as socratic,
660
- Da as softCoverPrompt,
661
- La as sort,
662
- Ma as sortBy,
663
- Ba as split,
664
- _a as stripNumeric,
665
- ja as stripResponse,
666
- Ua as summaryMap,
667
- za as tagSpec,
668
- Ga as tagVocabulary,
669
- Ja as tags,
670
- Va as tagsFilterInstructions,
671
- qa as tagsFindInstructions,
672
- Wa as tagsGroupInstructions,
673
- Ha as tagsMapInstructions,
674
- Xa as tagsReduceInstructions,
675
- Ka as templateReplace,
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,
598
+ $ 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,
676
679
  d as test,
677
- ye as testAdvice,
678
- Ya as themes,
679
- Qa as timeline,
680
- Za as toBool,
681
- er as toDate,
682
- sr as toEnum,
683
- tr as toNumber,
684
- ar as toNumberWithUnits,
685
- rr as toObject,
686
- nr as truncate,
687
- ir as unionBy,
688
- or as vectorSearch,
689
- cr as veiledVariantStrategies,
690
- lr as veiledVariants,
691
- ur as version,
692
- dr as windowFor,
693
- pr as withInactivityTimeout,
694
- mr as withPolicy,
695
- hr as zipWith
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
696
701
  };