@rulvar/cli 1.57.0 → 1.58.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-FzfY_HhN.js";
2
+ import { r as runCli, t as processIo } from "./io-DzlCfHd9.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
@@ -121,6 +121,12 @@ interface AssembledCli {
121
121
  workflows: WorkflowRegistry;
122
122
  /** The journal-fold price function (table wins over caps). */
123
123
  priceUsd: (servedBy: ModelRef, usage: Usage) => number | undefined;
124
+ /**
125
+ * The deployment's argsHash salt (engineOptions.security, RV-217),
126
+ * surfaced so the CLI resume args gate hashes supplied --args the
127
+ * same way the engine hashed the genesis args.
128
+ */
129
+ argsHashSalt?: string;
124
130
  }
125
131
  declare function assembleEngine(options: {
126
132
  config: CliConfig;
@@ -348,6 +354,13 @@ interface ToOtelOptions {
348
354
  contextApi?: OtelContextApi;
349
355
  /** trace.setSpan(context, span) equivalent; required with contextApi. */
350
356
  setSpan?: (context: unknown, span: SpanLike) => unknown;
357
+ /**
358
+ * Host redaction patterns applied to every exported string attribute
359
+ * ON TOP of the default credential set (RV-217). Feed the same list
360
+ * as `createEngine redaction.patterns` for event/trace parity; an
361
+ * invalid pattern is a typed ConfigError before anything exports.
362
+ */
363
+ patterns?: ReadonlyArray<RegExp | string>;
351
364
  }
352
365
  /**
353
366
  * Exports one settled run's event stream onto a tracer. The run's
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as looksLikeFile, a as resumeCommand, c as driveRun, d as attachProgress, f as renderEventLine, g as loadWorkflowModule, h as loadCliConfig, i as inspectCommand, l as reportOutcome, m as assembleEngine, n as HELP, o as runCommand, p as DEFAULT_STORE_DIR, r as runCli, s as runsLsCommand, t as processIo, u as strictExitCode } from "./io-FzfY_HhN.js";
2
- import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, costReportFromJournal, maskSecrets, normalizeEntry, readRunMeta, scanJournalCompatibility, validateSchemaSpec } from "@rulvar/core";
1
+ import { _ as looksLikeFile, a as resumeCommand, c as driveRun, d as attachProgress, f as renderEventLine, g as loadWorkflowModule, h as loadCliConfig, i as inspectCommand, l as reportOutcome, m as assembleEngine, n as HELP, o as runCommand, p as DEFAULT_STORE_DIR, r as runCli, s as runsLsCommand, t as processIo, u as strictExitCode } from "./io-DzlCfHd9.js";
2
+ import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, compileSecretMasker, costReportFromJournal, maskSecrets, normalizeEntry, readRunMeta, scanJournalCompatibility, validateSchemaSpec } from "@rulvar/core";
3
3
  //#region src/server.ts
4
4
  /**
5
5
  * createServer (M8-T01): the HTTP shell over the public engine API
@@ -827,7 +827,7 @@ function spanName(event) {
827
827
  default: return event.type;
828
828
  }
829
829
  }
830
- function openAttributes(event, runId) {
830
+ function openAttributes(event, runId, maskText) {
831
831
  const attrs = {
832
832
  "rulvar.run_id": runId,
833
833
  "rulvar.entry_seq": event.seq
@@ -847,7 +847,7 @@ function openAttributes(event, runId) {
847
847
  attrs["rulvar.invocation"] = event.invocation;
848
848
  }
849
849
  if (event.type === "tool:start") attrs["rulvar.tool_name"] = event.toolName;
850
- for (const [key, value] of Object.entries(attrs)) if (typeof value === "string") attrs[key] = maskSecrets(value);
850
+ for (const [key, value] of Object.entries(attrs)) if (typeof value === "string") attrs[key] = maskText(value);
851
851
  return attrs;
852
852
  }
853
853
  /**
@@ -862,6 +862,8 @@ async function toOtel(run, tracer, options = {}) {
862
862
  const stack = [];
863
863
  let created = 0;
864
864
  const { contextApi, setSpan } = options;
865
+ const masker = options.patterns === void 0 ? void 0 : compileSecretMasker(options.patterns, "toOtel patterns");
866
+ const maskText = (text) => masker === void 0 ? maskSecrets(text) : masker.maskText(text);
865
867
  const startSpan = (event, key = event.spanId, parentKey) => {
866
868
  const parentId = parentKey ?? event.parentSpanId;
867
869
  if (openBySpanId.has(key)) {
@@ -872,7 +874,7 @@ async function toOtel(run, tracer, options = {}) {
872
874
  const parentContext = parent !== void 0 && contextApi !== void 0 && setSpan !== void 0 ? setSpan(contextApi.active(), parent.span) : void 0;
873
875
  const span = tracer.startSpan(spanName(event), {
874
876
  startTime: msOf(event.ts),
875
- attributes: openAttributes(event, run.runId)
877
+ attributes: openAttributes(event, run.runId, maskText)
876
878
  }, parentContext);
877
879
  created += 1;
878
880
  const open = {
@@ -943,7 +945,7 @@ async function toOtel(run, tracer, options = {}) {
943
945
  "rulvar.entry_seq": event.seq,
944
946
  "rulvar.determinism.category": event.category,
945
947
  "rulvar.determinism.provenance": event.provenance,
946
- ...event.file === void 0 ? {} : { "code.filepath": maskSecrets(event.file) },
948
+ ...event.file === void 0 ? {} : { "code.filepath": maskText(event.file) },
947
949
  ...event.line === void 0 ? {} : { "code.lineno": event.line }
948
950
  });
949
951
  break;
@@ -108,11 +108,13 @@ function assembleEngine(options) {
108
108
  const pricing = resolvePricing(servedBy, engineOptions.pricing, byId.get(adapterId)?.caps(model).pricing);
109
109
  return pricing === void 0 ? void 0 : priceUsdOf(pricing, usage);
110
110
  };
111
+ const argsHashSalt = engineOptions.security?.argsHashSalt;
111
112
  return {
112
113
  engine,
113
114
  store,
114
115
  workflows,
115
- priceUsd
116
+ priceUsd,
117
+ ...argsHashSalt === void 0 ? {} : { argsHashSalt }
116
118
  };
117
119
  }
118
120
  /**
@@ -826,7 +828,7 @@ function enforceArgsBinding(input) {
826
828
  }
827
829
  let supplied;
828
830
  try {
829
- supplied = hashRunArgs(args);
831
+ supplied = hashRunArgs(args, input.salt === void 0 ? void 0 : { salt: input.salt });
830
832
  } catch {
831
833
  throw new ConfigError(`--args cannot be canonicalized to compare against run '${meta.runId}' (a numeric value overflows the finite range, or the value is otherwise not canonical JSON); supply finite JSON, or force the resume with --allow-args-change; ${usageOf(GRAMMAR.resume)}`);
832
834
  }
@@ -862,7 +864,8 @@ async function resumeCommand(argv, context) {
862
864
  argsGiven,
863
865
  args,
864
866
  allowChange,
865
- io: context.io
867
+ io: context.io,
868
+ ...assembled.argsHashSalt === void 0 ? {} : { salt: assembled.argsHashSalt }
866
869
  });
867
870
  const name = meta.workflowName;
868
871
  const workflow = name === void 0 ? void 0 : assembled.workflows[name];
@@ -919,7 +922,8 @@ async function replayCommand(argv, context) {
919
922
  argsGiven,
920
923
  args,
921
924
  allowChange: false,
922
- io: context.io
925
+ io: context.io,
926
+ ...assembled.argsHashSalt === void 0 ? {} : { salt: assembled.argsHashSalt }
923
927
  });
924
928
  const name = meta.workflowName;
925
929
  const workflow = name === void 0 ? void 0 : assembled.workflows[name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.57.0",
3
+ "version": "1.58.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.57.0"
25
+ "@rulvar/core": "1.58.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.20.0",
29
29
  "tsdown": "^0.22.3",
30
30
  "typescript": "~6.0.3",
31
- "@rulvar/testing": "1.57.0",
32
- "@rulvar/store-sqlite": "1.57.0",
33
- "@rulvar/plan": "1.57.0",
34
- "@rulvar/evals": "1.57.0",
35
- "@rulvar/planner": "1.57.0"
31
+ "@rulvar/testing": "1.58.0",
32
+ "@rulvar/store-sqlite": "1.58.0",
33
+ "@rulvar/planner": "1.58.0",
34
+ "@rulvar/evals": "1.58.0",
35
+ "@rulvar/plan": "1.58.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"