@rulvar/cli 1.242.0 → 1.244.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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { r as runCli, t as processIo } from "./io-CMAEYzZR.js";
2
+ import { r as runCli, t as processIo } from "./io-9PusbCS1.js";
3
3
  import { sanitizeTerminalText } from "@rulvar/core";
4
4
  import { inspect } from "node:util";
5
5
  //#region src/cli.ts
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as assembleEngine, a as inspectCommand, b as looksLikeFile, c as resumeCommand, d as driveRun, f as reportOutcome, g as DEFAULT_STORE_DIR, h as renderEventLine, i as costAuditCommand, l as runCommand, m as attachProgress, n as HELP, o as invoiceCommand, p as strictExitCode, r as runCli, s as preflightCommand, t as processIo, u as runsLsCommand, v as loadCliConfig, y as loadWorkflowModule } from "./io-CMAEYzZR.js";
1
+ import { _ as assembleEngine, a as inspectCommand, b as looksLikeFile, c as resumeCommand, d as driveRun, f as reportOutcome, g as DEFAULT_STORE_DIR, h as renderEventLine, i as costAuditCommand, l as runCommand, m as attachProgress, n as HELP, o as invoiceCommand, p as strictExitCode, r as runCli, s as preflightCommand, t as processIo, u as runsLsCommand, v as loadCliConfig, y as loadWorkflowModule } from "./io-9PusbCS1.js";
2
2
  import { ConfigError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, compileSecretMasker, costReportFromJournal, journalPricingSnapshot, maskSecrets, normalizeEntry, persistedTerminalEnvelope, readRunMeta, scanJournalCompatibility, validateDetachedResolution } from "@rulvar/core";
3
3
  //#region src/server.ts
4
4
  /**
@@ -1481,8 +1481,31 @@ function auditJournalEntries(entries, basePriceUsd) {
1481
1481
  failed: checks.filter((check) => !check.pass)
1482
1482
  };
1483
1483
  }
1484
+ /**
1485
+ * The per-agentType cut of the invoice rows (RV3906): in dynamic runs
1486
+ * byScope nests every orchestrator spawn under one `agent:<seq>`
1487
+ * bucket, so this is the per-child money surface. Rows journaled
1488
+ * before the field ride the 'unknown' bucket, the fold vocabulary.
1489
+ * Returns undefined when NO row names a type, so pre-RV3906 journals
1490
+ * render byte for byte in both output forms.
1491
+ */
1492
+ function invoiceByAgentType(rows) {
1493
+ if (!rows.some((row) => row.agentType !== void 0)) return;
1494
+ const cut = {};
1495
+ for (const row of rows) {
1496
+ const key = row.agentType ?? "unknown";
1497
+ const bucket = cut[key] ??= {
1498
+ usd: 0,
1499
+ rows: 0
1500
+ };
1501
+ bucket.usd += row.usd ?? 0;
1502
+ bucket.rows += 1;
1503
+ }
1504
+ return cut;
1505
+ }
1484
1506
  /** The one JSON shape of a run's audit, shared by both command forms. */
1485
1507
  function costAuditRunJson(runId, audit) {
1508
+ const byAgentType = invoiceByAgentType(audit.invoice.rows);
1486
1509
  return {
1487
1510
  runId,
1488
1511
  verdict: audit.failed.length === 0 ? "one-denominator" : "divergent",
@@ -1495,6 +1518,7 @@ function costAuditRunJson(runId, audit) {
1495
1518
  totalUsd: audit.invoice.totalUsd,
1496
1519
  rows: audit.invoice.rows.length,
1497
1520
  wireRequests: audit.invoice.cardinality.wireRequests,
1521
+ ...byAgentType === void 0 ? {} : { byAgentType },
1498
1522
  ...audit.invoice.orphanedReceipts === void 0 ? {} : { orphanedReceipts: audit.invoice.orphanedReceipts }
1499
1523
  },
1500
1524
  checks: audit.checks
@@ -1551,6 +1575,11 @@ async function costAuditCommand(argv, context) {
1551
1575
  context.io.out(`run ${runId}: cost audit (${audit.failed.length === 0 ? "one denominator" : "DIVERGENT"})`);
1552
1576
  context.io.out(`settled: gross $${audit.report.grossUsd.toFixed(4)} | net $${audit.report.totalUsd.toFixed(4)} | wires ${String(audit.report.wireRequests ?? "absent")}`);
1553
1577
  context.io.out(`invoice: total $${audit.invoice.totalUsd.toFixed(4)} | rows ${String(audit.invoice.rows.length)} | wires ${String(audit.invoice.cardinality.wireRequests)}`);
1578
+ const byAgentType = invoiceByAgentType(audit.invoice.rows);
1579
+ if (byAgentType !== void 0) {
1580
+ const cutLine = Object.entries(byAgentType).sort(([, a], [, b]) => b.usd - a.usd).map(([type, bucket]) => `${type} $${bucket.usd.toFixed(4)} (${String(bucket.rows)} rows)`).join(" | ");
1581
+ context.io.out(`by agentType: ${cutLine}`);
1582
+ }
1554
1583
  const orphaned = audit.invoice.orphanedReceipts;
1555
1584
  if (orphaned !== void 0) {
1556
1585
  context.io.out(`orphaned receipts: $${orphaned.usd.toFixed(4)} | wires ${String(orphaned.wireRequests)} | paid wires the settled terminal does not cover (RV3405), outside the settled totals`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.242.0",
3
+ "version": "1.244.0",
4
4
  "description": "Rulvar shell: run/resume/runs/inspect/plan/kb commands, TUI progress, createServer, createWorker, OTel exporter.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,17 +22,17 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.242.0"
25
+ "@rulvar/core": "1.244.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.1",
29
29
  "tsdown": "^0.22.14",
30
30
  "typescript": "~6.0.3",
31
- "@rulvar/store-sqlite": "1.242.0",
32
- "@rulvar/testing": "1.242.0",
33
- "@rulvar/plan": "1.242.0",
34
- "@rulvar/evals": "1.242.0",
35
- "@rulvar/planner": "1.242.0"
31
+ "@rulvar/testing": "1.244.0",
32
+ "@rulvar/store-sqlite": "1.244.0",
33
+ "@rulvar/planner": "1.244.0",
34
+ "@rulvar/plan": "1.244.0",
35
+ "@rulvar/evals": "1.244.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"