agentready-design-cli 0.2.0 → 0.2.1
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/cli.js +42 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -288,7 +288,49 @@ async function gatherSample(ctx) {
|
|
|
288
288
|
}
|
|
289
289
|
return sample;
|
|
290
290
|
}
|
|
291
|
+
var PENDING_PER_CHUNK = 6;
|
|
291
292
|
async function callRemote(opts) {
|
|
293
|
+
const pending = opts.report.criteria.filter((c) => c.status === "pending");
|
|
294
|
+
if (pending.length === 0) return { deltas: [] };
|
|
295
|
+
const scored = opts.report.criteria.filter((c) => c.status === "scored");
|
|
296
|
+
const chunks = [];
|
|
297
|
+
for (let i = 0; i < pending.length; i += PENDING_PER_CHUNK) {
|
|
298
|
+
chunks.push(pending.slice(i, i + PENDING_PER_CHUNK));
|
|
299
|
+
}
|
|
300
|
+
const results = await Promise.all(
|
|
301
|
+
chunks.map(
|
|
302
|
+
(chunk) => callRemoteOnce({
|
|
303
|
+
apiUrl: opts.apiUrl,
|
|
304
|
+
sample: opts.sample,
|
|
305
|
+
signal: opts.signal,
|
|
306
|
+
// Each chunk gets its own pending subset plus the full scored context.
|
|
307
|
+
report: {
|
|
308
|
+
...opts.report,
|
|
309
|
+
criteria: [...chunk, ...scored]
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
)
|
|
313
|
+
);
|
|
314
|
+
const deltas = results.flatMap((r) => r.deltas ?? []);
|
|
315
|
+
const totalInput = results.reduce(
|
|
316
|
+
(n, r) => n + (r.meta?.inputTokens ?? 0),
|
|
317
|
+
0
|
|
318
|
+
);
|
|
319
|
+
const totalOutput = results.reduce(
|
|
320
|
+
(n, r) => n + (r.meta?.outputTokens ?? 0),
|
|
321
|
+
0
|
|
322
|
+
);
|
|
323
|
+
return {
|
|
324
|
+
deltas,
|
|
325
|
+
meta: {
|
|
326
|
+
model: results[0]?.meta?.model,
|
|
327
|
+
pendingScored: deltas.length,
|
|
328
|
+
inputTokens: totalInput,
|
|
329
|
+
outputTokens: totalOutput
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
async function callRemoteOnce(opts) {
|
|
292
334
|
const url = opts.apiUrl ?? process.env.AGENT_READY_API_URL ?? DEFAULT_API_URL;
|
|
293
335
|
const res = await fetch(url, {
|
|
294
336
|
method: "POST",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentready-design-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Deterministic checks for the Agent-Ready Design rubric. Run against a design-system repo to score what can be scored without an LLM.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hunter Gillispie <hunter@builder.io>",
|