@far-world-labs/verblets 0.3.2 → 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,149 +1,147 @@
1
- import { r as P, a as C, b as x, c as v, d as R } from "./shared-C6kPWghF.js";
2
- import { E as me, a3 as fe, f as ye, F as ge, l as Se, G as be, H as Ce, e as Ie, I as we, k as $e, g as Ee, m as Pe, o as xe, J as ve, K as Re, L as Fe, p as Ae, i as Te, a4 as _e, a5 as De, q as Oe, M as ke, t as Le, N as Ne, u as je, v as Me, w as Ue, a6 as Be, x as ze, O as Je, y as Ge, z as Ve, a7 as qe, a8 as He, A as Xe, P as We, Q as Ke, n as Ye, h as Ze, R as Qe, a8 as es, S as ss, ab as ts, ae as as, T as ns, U as rs, ac as is, ad as os, j as cs, V as ls, af as us, B as ds, a9 as ps, s as hs, aa as ms, W as fs, C as ys, X as gs, Y as Ss, Z as bs, D as Cs, _ as Is, $ as ws, a0 as $s, a1 as Es, a2 as Ps } from "./shared-C6kPWghF.js";
3
- import p from "node:fs";
4
- import "node:path";
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-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";
5
6
  import "glob";
6
- import F from "node:fs/promises";
7
- const I = 1, A = 20, T = 5, _ = 0.5, D = 5, S = 8e3, g = 5, f = {
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
10
  INDIVIDUAL: "individual",
9
11
  BULK: "bulk"
10
- }, h = {
12
+ }, m = {
11
13
  PROCESSING: "processing",
12
14
  COMPLETED: "completed",
13
15
  ERROR: "error"
14
16
  };
15
- function O(e, s) {
16
- const a = [];
17
- for (let t = 0; t < e.length; t += s)
18
- a.push({
19
- items: e.slice(t, t + s),
20
- index: Math.floor(t / s) + 1,
21
- 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
22
24
  });
23
- return a;
25
+ return t;
24
26
  }
25
- function b(e, s, a, t, n, r) {
27
+ function S(e, s, t, a, r, i) {
26
28
  return {
27
29
  chunkIndex: e.index,
28
30
  totalChunks: s,
29
31
  itemsInChunk: e.items.length,
30
- totalItems: a,
31
- status: t,
32
- bulkSize: n.bulkSize,
33
- maxConcurrency: n.maxConcurrency,
34
- processingMode: r,
32
+ totalItems: t,
33
+ status: a,
34
+ bulkSize: r.bulkSize,
35
+ maxConcurrency: r.maxConcurrency,
36
+ processingMode: i,
35
37
  parallelMode: !0
36
38
  };
37
39
  }
38
- async function k(e, s, a, t, n) {
40
+ async function G(e, s, t, a, r) {
39
41
  try {
40
- const r = a.map((l) => E(l(e))).filter(Boolean).join(`
42
+ const i = t.map((l) => v(l(e))).filter(Boolean).join(`
41
43
 
42
- `), o = [s, r].filter(Boolean).join(`
44
+ `), o = [s, i].filter(Boolean).join(`
43
45
 
44
- `), i = q(o, e, t, n === "files"), c = await C(i, {
45
- modelOptions: {
46
- response_format: {
47
- type: "json_schema",
48
- json_schema: {
49
- name: "arch_result",
50
- schema: J
51
- }
46
+ `), n = ee(o, e, a, r === "files"), c = await E(n, {
47
+ response_format: {
48
+ type: "json_schema",
49
+ json_schema: {
50
+ name: "arch_result",
51
+ schema: Y
52
52
  }
53
53
  }
54
54
  });
55
55
  return { item: e, ...c, error: void 0 };
56
- } catch (r) {
57
- return { item: e, passed: !1, reason: `Analysis failed: ${r.message}`, error: r };
56
+ } catch (i) {
57
+ return { item: e, passed: !1, reason: `Analysis failed: ${i.message}`, error: i };
58
58
  }
59
59
  }
60
- function L(e, s, a, t) {
61
- const n = [], r = [];
62
- let o = t;
63
- for (const i of e)
64
- if (n.push(i), i.passed || (o++, r.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
- results: n,
68
- errors: r,
67
+ results: r,
68
+ errors: i,
69
69
  failures: o,
70
- shouldStop: !s && o >= a
70
+ shouldStop: !s && o >= t
71
71
  };
72
72
  }
73
- function m(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 w(e, s, a, t, n) {
77
- m(t, e, void 0, {
78
- ...n,
79
- status: h.PROCESSING
76
+ async function R(e, s, t, a, r) {
77
+ h(a, e, void 0, {
78
+ ...r,
79
+ status: m.PROCESSING
80
80
  });
81
81
  try {
82
- const r = H(s, e, a), o = await P(e, r, {
83
- llm: {
84
- response_format: {
85
- type: "json_schema",
86
- json_schema: {
87
- name: "arch_bulk_result",
88
- schema: G
89
- }
82
+ const i = se(s, e, t), o = await A(e, i, {
83
+ responseFormat: {
84
+ type: "json_schema",
85
+ json_schema: {
86
+ name: "arch_bulk_result",
87
+ schema: Q
90
88
  }
91
89
  }
92
- }), i = o.results || o;
90
+ }), n = o.results || o;
93
91
  let c = [];
94
- Array.isArray(i) ? c = i : c = e.map((y) => ({
95
- path: y,
92
+ Array.isArray(n) ? c = n : c = e.map((b) => ({
93
+ path: b,
96
94
  passed: !1,
97
95
  reason: "Invalid response format"
98
96
  }));
99
- const l = c.filter((y) => !y.passed).length, u = c.length - l;
100
- return m(
101
- t,
97
+ const l = c.filter((b) => !b.passed).length, u = c.length - l;
98
+ return h(
99
+ a,
102
100
  e,
103
101
  l > 0 ? new Error(`${l} items failed`) : void 0,
104
102
  {
105
- ...n,
106
- status: h.COMPLETED,
103
+ ...r,
104
+ status: m.COMPLETED,
107
105
  passed: u,
108
106
  failed: l
109
107
  }
110
108
  ), c;
111
- } catch (r) {
112
- const o = e.map((i) => ({
113
- path: i,
109
+ } catch (i) {
110
+ const o = e.map((n) => ({
111
+ path: n,
114
112
  passed: !1,
115
- reason: `Processing error: ${r.message}`
113
+ reason: `Processing error: ${i.message}`
116
114
  }));
117
- return m(t, e, r, {
118
- ...n,
119
- status: h.ERROR
115
+ return h(a, e, i, {
116
+ ...r,
117
+ status: m.ERROR
120
118
  }), o;
121
119
  }
122
120
  }
123
- function N(e, s) {
124
- const a = s.filter((i) => i.passed).length, t = s.length - a, n = t === 0, r = 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);
125
123
  return {
126
- passed: a,
127
- failed: t,
128
- allPassed: n,
129
- stoppedEarly: r,
124
+ passed: t,
125
+ failed: a,
126
+ allPassed: r,
127
+ stoppedEarly: i,
130
128
  failures: o,
131
129
  total: e.length,
132
130
  processed: s.length
133
131
  };
134
132
  }
135
- function j(e, s, a) {
133
+ function q(e, s, t) {
136
134
  if (e.allPassed)
137
135
  return `All ${e.processed}/${e.total} items satisfy: ${s}`;
138
- const t = e.failures.slice(0, g).map((r) => ` • ${r.item}: ${r.reason || "Failed"}`).join(`
139
- `), n = e.failures.length > g ? `
136
+ const a = e.failures.slice(0, g).map((i) => ` • ${i.item}: ${i.reason || "Failed"}`).join(`
137
+ `), r = e.failures.length > g ? `
140
138
  ... and ${e.failures.length - g} more failures` : "";
141
- return `${e.failed}/${e.processed} items failed: ${s}${e.stoppedEarly && a !== I ? ` (stopped after ${a} failures)` : ""}
139
+ return `${e.failed}/${e.processed} items failed: ${s}${e.stoppedEarly && t !== T ? ` (stopped after ${t} failures)` : ""}
142
140
 
143
141
  Failures:
144
- ${t}${n}`;
142
+ ${a}${r}`;
145
143
  }
146
- function M(e, s) {
144
+ function W(e, s) {
147
145
  return {
148
146
  passed: e.allPassed,
149
147
  message: s,
@@ -156,127 +154,127 @@ function M(e, s) {
156
154
  }
157
155
  };
158
156
  }
159
- function U(e, s, a, t) {
160
- const n = s || a.length > 0 || t <= D;
157
+ function H(e, s, t, a) {
158
+ const r = s || t.length > 0 || a <= U;
161
159
  return {
162
- mode: n ? f.INDIVIDUAL : f.BULK,
163
- batchSize: n ? e.maxConcurrency : e.bulkSize,
164
- processor: n ? (r, o, i) => $(r, o, i) : (r, o, i) => w(
165
- r.items,
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,
166
164
  o,
167
- i.description,
168
- i.onProgress,
169
- i.metadata
165
+ n.description,
166
+ n.onProgress,
167
+ n.metadata
170
168
  )
171
169
  };
172
170
  }
173
- async function $(e, s, a) {
174
- const t = e.items.map(
175
- (n) => k(
176
- n,
171
+ async function w(e, s, t) {
172
+ const a = e.items.map(
173
+ (r) => G(
174
+ r,
177
175
  s,
178
- a.itemContextFns,
179
- a.description,
180
- a.targetType
176
+ t.itemContextFns,
177
+ t.description,
178
+ t.targetType
181
179
  )
182
180
  );
183
- return await Promise.all(t);
181
+ return await Promise.all(a);
184
182
  }
185
- function B(e, s, a) {
183
+ function X(e, s, t) {
186
184
  if (s === f.INDIVIDUAL) {
187
- const { results: t, errors: n, failures: r, shouldStop: o } = L(
185
+ const { results: a, errors: r, failures: i, shouldStop: o } = J(
188
186
  e,
189
- a.isCoverageTest,
190
- a.maxFailures,
191
- a.currentFailures || 0
187
+ t.isCoverageTest,
188
+ t.maxFailures,
189
+ t.currentFailures || 0
192
190
  );
193
191
  return {
194
- results: t,
195
- errors: n,
196
- failures: r,
192
+ results: a,
193
+ errors: r,
194
+ failures: i,
197
195
  shouldStop: o,
198
196
  progressData: {
199
- passed: t.filter((i) => i.passed).length,
200
- failed: n.length
197
+ passed: a.filter((n) => n.passed).length,
198
+ failed: r.length
201
199
  }
202
200
  };
203
201
  } else {
204
- const t = e.map((n) => ({
205
- item: n.path,
206
- passed: n.passed,
207
- reason: n.reason
202
+ const a = e.map((r) => ({
203
+ item: r.path,
204
+ passed: r.passed,
205
+ reason: r.reason
208
206
  }));
209
207
  return {
210
- results: t,
208
+ results: a,
211
209
  errors: [],
212
- failures: a.currentFailures || 0,
210
+ failures: t.currentFailures || 0,
213
211
  shouldStop: !1,
214
212
  progressData: {
215
- passed: t.filter((n) => n.passed).length,
216
- failed: t.filter((n) => !n.passed).length
213
+ passed: a.filter((r) => r.passed).length,
214
+ failed: a.filter((r) => !r.passed).length
217
215
  }
218
216
  };
219
217
  }
220
218
  }
221
- async function z(e, s, a, t) {
222
- const n = O(e, a.batchSize), r = [];
219
+ async function K(e, s, t, a) {
220
+ const r = z(e, t.batchSize), i = [];
223
221
  let o = 0;
224
- for (const i of n) {
225
- if (!t.isCoverageTest && o >= t.maxFailures)
222
+ for (const n of r) {
223
+ if (!a.isCoverageTest && o >= a.maxFailures)
226
224
  break;
227
- const c = b(
228
- i,
229
- n.length,
225
+ const c = S(
226
+ n,
227
+ r.length,
230
228
  e.length,
231
- h.PROCESSING,
232
- t,
233
- a.mode
229
+ m.PROCESSING,
230
+ a,
231
+ t.mode
234
232
  );
235
- m(t.onChunkProcessed, i.items, void 0, c);
233
+ h(a.onChunkProcessed, n.items, void 0, c);
236
234
  let l;
237
- a.mode === f.INDIVIDUAL ? l = await $(i, s, {
238
- itemContextFns: t.itemContextFns,
239
- description: t.description,
240
- targetType: t.targetType
241
- }) : l = await w(
242
- 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,
243
241
  s,
244
- t.description,
245
- t.onChunkProcessed,
242
+ a.description,
243
+ a.onChunkProcessed,
246
244
  c
247
245
  );
248
- const u = B(l, a.mode, {
249
- ...t,
246
+ const u = X(l, t.mode, {
247
+ ...a,
250
248
  currentFailures: o
251
249
  });
252
- if (r.push(...u.results), o = u.failures, m(
253
- t.onChunkProcessed,
254
- i.items,
250
+ if (i.push(...u.results), o = u.failures, h(
251
+ a.onChunkProcessed,
252
+ n.items,
255
253
  u.errors.length > 0 ? u.errors[0] : void 0,
256
254
  {
257
- ...b(
258
- i,
259
- n.length,
255
+ ...S(
256
+ n,
257
+ r.length,
260
258
  e.length,
261
- h.COMPLETED,
262
- t,
263
- a.mode
259
+ m.COMPLETED,
260
+ a,
261
+ t.mode
264
262
  ),
265
263
  ...u.progressData
266
264
  }
267
265
  ), u.shouldStop)
268
266
  break;
269
267
  }
270
- return r;
268
+ return i;
271
269
  }
272
- const J = {
270
+ const Y = {
273
271
  type: "object",
274
272
  properties: {
275
273
  passed: { type: "boolean" },
276
274
  reason: { type: "string" }
277
275
  },
278
276
  required: ["passed", "reason"]
279
- }, G = {
277
+ }, Q = {
280
278
  type: "object",
281
279
  properties: {
282
280
  results: {
@@ -294,7 +292,7 @@ const J = {
294
292
  },
295
293
  required: ["results"]
296
294
  };
297
- function E(e) {
295
+ function v(e) {
298
296
  switch (e.type) {
299
297
  case "file":
300
298
  return p.existsSync(e.filePath) ? `<${e.name}>
@@ -317,38 +315,38 @@ ${s}
317
315
  return "";
318
316
  }
319
317
  }
320
- function V(e) {
318
+ function Z(e) {
321
319
  if (!p.existsSync(e)) return "Item does not exist";
322
320
  if (p.statSync(e).isDirectory())
323
321
  return p.readdirSync(e).join(", ");
324
322
  {
325
- const a = p.readFileSync(e, "utf8");
326
- return a.length > S ? `${a.substring(0, S)}
327
- ... (truncated)` : a;
323
+ const t = p.readFileSync(e, "utf8");
324
+ return t.length > y ? `${t.substring(0, y)}
325
+ ... (truncated)` : t;
328
326
  }
329
327
  }
330
- function q(e, s, a, t) {
331
- const n = V(s);
328
+ function ee(e, s, t, a) {
329
+ const r = Z(s);
332
330
  return `${e}
333
- Analyze this ${t ? "file" : "directory"}: ${s}
331
+ Analyze this ${a ? "file" : "directory"}: ${s}
334
332
 
335
333
  Content:
336
- ${n}
334
+ ${r}
337
335
 
338
- Does it satisfy: "${a}"?
336
+ Does it satisfy: "${t}"?
339
337
 
340
338
  Return JSON with "passed" (boolean) and "reason" (string).`;
341
339
  }
342
- function H(e, s, a) {
340
+ function se(e, s, t) {
343
341
  return `${e}
344
- Analyze each item and determine if it satisfies: "${a}"
342
+ Analyze each item and determine if it satisfies: "${t}"
345
343
  Items: ${s.join(", ")}
346
344
 
347
345
  Return JSON with "results" array containing objects with "path", "passed" (boolean), and "reason" (string).`;
348
346
  }
349
- class X {
350
- constructor(s, a = {}) {
351
- this.target = s, this.contexts = [], this.itemContextFns = [], this.maxFailures = a.maxFailures || I, this.bulkSize = a.bulkSize || A, this.maxConcurrency = a.maxConcurrency || T, 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;
352
350
  }
353
351
  withContext(s) {
354
352
  return this.contexts.push(s), this;
@@ -361,21 +359,21 @@ class X {
361
359
  return this.description = s, this;
362
360
  }
363
361
  // Set up for a coverage test
364
- coverage(s = _) {
362
+ coverage(s = j) {
365
363
  return this.threshold = s, this.isCoverageTest = !0, this;
366
364
  }
367
365
  // Start processing - this is the fluent terminator
368
366
  async start() {
369
367
  if (!this.description)
370
368
  throw new Error("Must call satisfies() before start()");
371
- const s = await this.target.resolve(), a = this.contexts.map(E).filter(Boolean).join(`
369
+ const s = await this.target.resolve(), t = this.contexts.map(v).filter(Boolean).join(`
372
370
 
373
- `), t = U(
371
+ `), a = H(
374
372
  this,
375
373
  this.onChunkProcessed,
376
374
  this.itemContextFns,
377
375
  s.length
378
- ), n = {
376
+ ), r = {
379
377
  bulkSize: this.bulkSize,
380
378
  maxConcurrency: this.maxConcurrency,
381
379
  description: this.description,
@@ -384,29 +382,29 @@ class X {
384
382
  targetType: this.target.type,
385
383
  maxFailures: this.maxFailures,
386
384
  isCoverageTest: this.isCoverageTest
387
- }, r = await z(s, a, t, n);
385
+ }, i = await K(s, t, a, r);
388
386
  if (this.isCoverageTest) {
389
- const o = r.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`;
390
388
  if (!c)
391
389
  throw new Error(l);
392
- return { passed: c, coverage: i, message: l };
390
+ return { passed: c, coverage: n, message: l };
393
391
  }
394
- return this.summarize(s, r);
392
+ return this.summarize(s, i);
395
393
  }
396
- summarize(s, a) {
397
- const t = N(s, a), n = j(t, this.description, this.maxFailures);
398
- if (!t.allPassed)
399
- throw new Error(n);
400
- return M(t, n);
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);
401
399
  }
402
400
  }
403
- function le(e, s = {}) {
404
- return new X(e, s);
401
+ function ge(e, s = {}) {
402
+ return new ae(e, s);
405
403
  }
406
- function ue() {
404
+ function ye() {
407
405
  return console.warn("scanJS is not available in browser environment"), Promise.resolve({});
408
406
  }
409
- const W = {
407
+ const I = {
410
408
  name: "test_analysis_result",
411
409
  schema: {
412
410
  type: "object",
@@ -427,12 +425,14 @@ const W = {
427
425
  required: ["hasIssues", "issues"],
428
426
  additionalProperties: !1
429
427
  }
430
- };
431
- async function d(e, s, 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();
432
432
  try {
433
- const t = await F.readFile(e, "utf-8"), n = `Analyze this code and ${s}:
433
+ const i = await M.readFile(e, "utf-8"), o = `Analyze this code and ${s}:
434
434
 
435
- ${x(t, { tag: "code-to-analyze" })}
435
+ ${D(i, { tag: "code-to-analyze" })}
436
436
 
437
437
  Return a JSON object with:
438
438
  - "hasIssues": boolean indicating if any issues were found
@@ -443,106 +443,259 @@ GUIDELINES:
443
443
  - Provide specific line numbers or code references when possible
444
444
  - Suggest concrete fixes for each issue identified
445
445
  - Be concise but clear in your feedback
446
- - If no issues are found, return {"hasIssues": false, "issues": []}
447
-
448
- ${v}`, r = await C(n, {
449
- ...a,
450
- modelOptions: {
451
- ...a.modelOptions,
452
- response_format: {
453
- type: "json_schema",
454
- json_schema: W
455
- }
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)
450
+ }),
451
+ {
452
+ label: "test chain",
453
+ config: a
456
454
  }
457
- });
458
- return r.hasIssues ? r.issues : [];
459
- } catch (t) {
460
- 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}`];
461
459
  }
462
460
  }
463
- const K = "Run the code with 5 boundary value test cases and report any that fail", Y = "Identify 5 passing scenarios and significant boundary conditions in this code. Provide minimal input examples for each scenario to demonstrate correctness.", Z = "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.", Q = "Identify 5 defects in this code. Provide minimal input examples to demonstrate each defect.", ee = "Suggest 5 best practices improvements for this code.", se = 'Suggest 5 "clean code" improvements for this code.', te = "Identify 5 specific issues related to code quality, readability, and maintainability.", ae = "Suggest 5 refactors that would most improve the composibility of this code.", de = async (e) => [
464
- ...await d(e, K),
465
- ...await d(e, Y),
466
- ...await d(e, Z),
467
- ...await d(e, Q),
468
- ...await d(e, ee),
469
- ...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) => [
470
462
  ...await d(e, te),
471
- ...await d(e, ae)
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)
472
470
  ];
473
- R.isNode && (await import("dotenv")).config();
471
+ P.config();
472
+ try {
473
+ k(JSON.parse(F(x(process.cwd(), ".verblets.json"), "utf8")));
474
+ } catch {
475
+ }
474
476
  export {
475
- le as aiArchExpect,
476
- me as anonymize,
477
- fe as auto,
478
- ye as bool,
479
- ge as categorySamples,
480
- Se as centralTendency,
481
- C as chatGPT,
482
- be as collectTerms,
483
- Ce as commonalities,
484
- Ie as constants,
485
- we as conversation,
486
- $e as createScale,
487
- Ee as date,
488
- C as default,
489
- Pe as detectPatterns,
490
- xe as detectThreshold,
491
- ve as disambiguate,
492
- Re as dismantle,
493
- Fe as documentShrink,
494
- Ae as entities,
495
- Te as enums,
496
- _e as expect,
497
- De as expectChain,
498
- Oe as extractBlocks,
499
- ke as fillMissing,
500
- Le as filter,
501
- Ne as filterAmbiguous,
502
- je as find,
503
- Me as glossary,
504
- Ue as group,
505
- Be as intent,
506
- ze as intersections,
507
- Je as join,
508
- Ge as list,
509
- Ve as listExpand,
510
- qe as llmLogger,
511
- He as makePrompt,
512
- Xe as map,
513
- We as name,
514
- Ke as nameSimilarTo,
515
- Ye as number,
516
- Ze as numberWithUnits,
517
- Qe as people,
518
- es as phailForge,
519
- ss as popReference,
520
- ts as promptCache,
521
- as as prompts,
522
- ns as questions,
523
- P as reduce,
524
- rs as relations,
525
- is as retry,
526
- os as ringBuffer,
527
- cs as scale,
528
- ue as scanJS,
529
- ls as schemaOrg,
530
- us as schemas,
531
- ds as score,
532
- ps as sentiment,
533
- hs as services,
534
- ms as setInterval,
535
- fs as socratic,
536
- ys as sort,
537
- gs as split,
538
- Ss as summaryMap,
539
- bs as tagVocabulary,
540
- Cs as tags,
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,
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,
541
679
  d as test,
542
- de as testAdvice,
543
- Is as themes,
544
- ws as timeline,
545
- $s as toObject,
546
- Es as truncate,
547
- Ps as veiledVariants
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
548
701
  };