@rulvar/cli 1.112.0 → 1.113.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-eA5_NvlK.js";
2
+ import { r as runCli, t as processIo } from "./io-Ghdg-hbD.js";
3
3
  import { sanitizeTerminalText } from "@rulvar/core";
4
4
  import { inspect } from "node:util";
5
5
  //#region src/cli.ts
package/dist/index.d.ts CHANGED
@@ -171,6 +171,13 @@ interface AssembledCli {
171
171
  * same way the engine hashed the genesis args.
172
172
  */
173
173
  argsHashSalt?: string;
174
+ /**
175
+ * The configured price table's version (RV706), surfaced so the
176
+ * invoice and inspect surfaces can name the CURRENT table in a
177
+ * composed provenance instead of leaving the tail's rates anonymous.
178
+ * Absent when the config declares no table.
179
+ */
180
+ currentPricingVersion?: string;
174
181
  }
175
182
  declare function assembleEngine(options: {
176
183
  config: CliConfig;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as loadCliConfig, a as invoiceCommand, c as runCommand, d as reportOutcome, f as strictExitCode, g as assembleEngine, h as DEFAULT_STORE_DIR, i as inspectCommand, l as runsLsCommand, m as renderEventLine, n as HELP, o as preflightCommand, p as attachProgress, r as runCli, s as resumeCommand, t as processIo, u as driveRun, v as loadWorkflowModule, y as looksLikeFile } from "./io-eA5_NvlK.js";
1
+ import { _ as loadCliConfig, a as invoiceCommand, c as runCommand, d as reportOutcome, f as strictExitCode, g as assembleEngine, h as DEFAULT_STORE_DIR, i as inspectCommand, l as runsLsCommand, m as renderEventLine, n as HELP, o as preflightCommand, p as attachProgress, r as runCli, s as resumeCommand, t as processIo, u as driveRun, v as loadWorkflowModule, y as looksLikeFile } from "./io-Ghdg-hbD.js";
2
2
  import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, compileSecretMasker, costReportFromJournal, journalPricingSnapshot, maskSecrets, normalizeEntry, readRunMeta, scanJournalCompatibility, validateSchemaSpec } from "@rulvar/core";
3
3
  //#region src/server.ts
4
4
  /**
@@ -111,12 +111,14 @@ function assembleEngine(options) {
111
111
  return pricing === void 0 ? void 0 : priceUsdOf(pricing, usage);
112
112
  };
113
113
  const argsHashSalt = engineOptions.security?.argsHashSalt;
114
+ const currentPricingVersion = engineOptions.pricing?.pricingVersion;
114
115
  return {
115
116
  engine,
116
117
  store,
117
118
  workflows,
118
119
  priceUsd,
119
- ...argsHashSalt === void 0 ? {} : { argsHashSalt }
120
+ ...argsHashSalt === void 0 ? {} : { argsHashSalt },
121
+ ...currentPricingVersion === void 0 ? {} : { currentPricingVersion }
120
122
  };
121
123
  }
122
124
  /**
@@ -1103,7 +1105,7 @@ async function inspectCommand(argv, context) {
1103
1105
  const inspectSnapshot = journalPricingSnapshot(entries);
1104
1106
  const cost = costReportFromJournal(entries, inspectSnapshot === void 0 ? assembled.priceUsd : inspectSnapshot.composedPriceUsd(assembled.priceUsd));
1105
1107
  context.io.out(`cost: $${cost.totalUsd.toFixed(4)}`);
1106
- if (inspectSnapshot !== void 0) context.io.out(`pricing: run-settle pins composed with the current table${pinVersionsSuffix(inspectSnapshot)}`);
1108
+ if (inspectSnapshot !== void 0) context.io.out("pricing: run-settle pins composed with the current table" + pinVersionsSuffix(inspectSnapshot, assembled.currentPricingVersion));
1107
1109
  if (cost.abandoned.usd > 0) context.io.out(`gross: $${cost.grossUsd.toFixed(4)} (abandoned: $${cost.abandoned.usd.toFixed(4)}; see rulvar invoice)`);
1108
1110
  for (const [model, usd] of Object.entries(cost.byModel)) context.io.out(` ${model}: $${usd.toFixed(4)}`);
1109
1111
  for (const item of cost.unpriced) context.io.out(` unpriced: ${item.model} (${item.usage.inputTokens + item.usage.outputTokens} tok)`);
@@ -1144,9 +1146,14 @@ async function invoiceCommand(argv, context) {
1144
1146
  if (meta === void 0) throw new ConfigError(`run '${runId}' not found in the store`);
1145
1147
  const entries = await assembled.store.load(runId);
1146
1148
  const snapshot = journalPricingSnapshot(entries);
1147
- const invoice = invoiceFromJournal(entries, snapshot === void 0 ? assembled.priceUsd : snapshot.composedPriceUsd(assembled.priceUsd), { pricing: snapshot === void 0 ? { source: "current-table" } : {
1149
+ const currentVersion = assembled.currentPricingVersion === void 0 ? {} : { currentPricingVersion: assembled.currentPricingVersion };
1150
+ const invoice = invoiceFromJournal(entries, snapshot === void 0 ? assembled.priceUsd : snapshot.composedPriceUsd(assembled.priceUsd), { pricing: snapshot === void 0 ? {
1151
+ source: "current-table",
1152
+ ...currentVersion
1153
+ } : {
1148
1154
  source: "composed",
1149
1155
  ...snapshot.pricingVersion === void 0 ? {} : { pricingVersion: snapshot.pricingVersion },
1156
+ ...currentVersion,
1150
1157
  rows: snapshot.rows,
1151
1158
  segments: snapshot.segments,
1152
1159
  pinnedThroughSeq: snapshot.pinnedThroughSeq
@@ -1159,7 +1166,7 @@ async function invoiceCommand(argv, context) {
1159
1166
  context.io.out(`gross: $${invoice.totalUsd.toFixed(4)} | net: $${invoice.netUsd.toFixed(4)} | abandoned: $${invoice.abandonedUsd.toFixed(4)}${invoice.usageApprox === true ? " (approx)" : ""}`);
1160
1167
  context.io.out(`rows: ${invoice.rows.length} (reconciliation failures: ${invoice.reconciliationFailures}${invoice.usageUnknownRows === void 0 ? "" : `; usage unknown: ${invoice.usageUnknownRows}`})`);
1161
1168
  context.io.out(`pricing basis: ${invoice.pricingBasis} ` + (invoice.rowUsdNonAdditive ? "(row usd is non-additive: an aggregate-priced remainder or legacy entry is in the fold; allocatedUsd sums to gross)" : "(rows are additive: every provider call priced per request; allocatedUsd agrees and sums to gross)"));
1162
- context.io.out(snapshot === void 0 ? "pricing rates: current table (no snapshot in the journal)" : `pricing rates: run-settle pins composed with the current table${pinVersionsSuffix(snapshot)}`);
1169
+ context.io.out(snapshot === void 0 ? "pricing rates: current table (no snapshot in the journal)" : "pricing rates: run-settle pins composed with the current table" + pinVersionsSuffix(snapshot, assembled.currentPricingVersion));
1163
1170
  for (const row of invoice.rows) {
1164
1171
  const usd = row.usd === void 0 ? "unpriced" : `$${row.usd.toFixed(4)}`;
1165
1172
  const tokens = row.usage.inputTokens + row.usage.outputTokens;
@@ -1175,14 +1182,20 @@ function usdOf(value) {
1175
1182
  return value === void 0 ? "n/a" : `$${value.toFixed(4)}`;
1176
1183
  }
1177
1184
  /**
1178
- * ` (v-a, v-b)` across the pins in journal order, deduplicated (RV611):
1179
- * one version per rotation, so the inspect and invoice text forms name
1180
- * every table that priced the fold, not only the last. Empty when no
1181
- * pin carried a version.
1185
+ * ` (v-a, v-b; current v-live)` across the pins in journal order,
1186
+ * deduplicated (RV611), plus the CLI's own current table version
1187
+ * (RV706): the composed fold prices the tail past the last pin at the
1188
+ * current table, so the text form names BOTH halves of the
1189
+ * composition. Empty when no pin carried a version and the config
1190
+ * declares no table; the pre-RV706 forms are preserved byte for byte
1191
+ * in that case and when only the pins carry versions.
1182
1192
  */
1183
- function pinVersionsSuffix(snapshot) {
1193
+ function pinVersionsSuffix(snapshot, currentPricingVersion) {
1184
1194
  const versions = [...new Set(snapshot.segments.map((segment) => segment.pricingVersion).filter((version) => version !== void 0))];
1185
- return versions.length === 0 ? "" : ` (${versions.join(", ")})`;
1195
+ const parts = [];
1196
+ if (versions.length > 0) parts.push(versions.join(", "));
1197
+ if (currentPricingVersion !== void 0) parts.push(`current ${currentPricingVersion}`);
1198
+ return parts.length === 0 ? "" : ` (${parts.join("; ")})`;
1186
1199
  }
1187
1200
  function renderPreflight(report, io) {
1188
1201
  io.out("preflight: effective limits and admission projection (zero provider dispatches)");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.112.0",
3
+ "version": "1.113.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.112.0"
25
+ "@rulvar/core": "1.113.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/testing": "1.112.0",
32
- "@rulvar/store-sqlite": "1.112.0",
33
- "@rulvar/planner": "1.112.0",
34
- "@rulvar/plan": "1.112.0",
35
- "@rulvar/evals": "1.112.0"
31
+ "@rulvar/testing": "1.113.0",
32
+ "@rulvar/store-sqlite": "1.113.0",
33
+ "@rulvar/planner": "1.113.0",
34
+ "@rulvar/plan": "1.113.0",
35
+ "@rulvar/evals": "1.113.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"