@rulvar/cli 1.20.0 → 1.22.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-74cSn0r8.js";
2
+ import { r as runCli, t as processIo } from "./io-RtHEIn0r.js";
3
3
  import { inspect } from "node:util";
4
4
  //#region src/cli.ts
5
5
  /**
package/dist/index.d.ts CHANGED
@@ -227,7 +227,12 @@ interface Worker {
227
227
  declare function createWorker(engine: Engine, options: CreateWorkerOptions): Worker;
228
228
  //#endregion
229
229
  //#region src/tui.d.ts
230
- /** Renders one event to a line, or undefined for silent event types. */
230
+ /**
231
+ * Renders one event to a line, or undefined for silent event types. The
232
+ * composed line is sanitized so an untrusted provider/tool/log string
233
+ * cannot inject a control sequence or a second physical line (v1.21.0
234
+ * review P2-1).
235
+ */
231
236
  declare function renderEventLine(event: WorkflowEvent): string | undefined;
232
237
  /** Attaches the renderer to a handle's event stream; returns a detach. */
233
238
  declare function attachProgress(handle: RunHandle<unknown>, io: CliIo): () => void;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as resumeCommand, c as driveRun, d as renderEventLine, f as DEFAULT_STORE_DIR, g as looksLikeFile, h as loadWorkflowModule, i as inspectCommand, l as reportOutcome, m as loadCliConfig, n as HELP, o as runCommand, p as assembleEngine, r as runCli, s as runsLsCommand, t as processIo, u as attachProgress } from "./io-74cSn0r8.js";
1
+ import { a as resumeCommand, c as driveRun, d as renderEventLine, f as DEFAULT_STORE_DIR, g as looksLikeFile, h as loadWorkflowModule, i as inspectCommand, l as reportOutcome, m as loadCliConfig, n as HELP, o as runCommand, p as assembleEngine, r as runCli, s as runsLsCommand, t as processIo, u as attachProgress } from "./io-RtHEIn0r.js";
2
2
  import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, costReportFromJournal, maskSecrets, normalizeEntry, scanJournalCompatibility, validateSchemaSpec } from "@rulvar/core";
3
3
  //#region src/server.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ConfigError, FileModelKnowledgeStore, INBOX_PROPOSAL_TTL_DAYS, JsonlFileStore, claimExpired, claimExpiry, compilePermissionPreset, costReportFromJournal, createEngine, parseModelRef, priceUsdOf, proposalStatement, remeasureQueue, resolvePricing, runProfile } from "@rulvar/core";
1
+ import { ConfigError, FileModelKnowledgeStore, INBOX_PROPOSAL_TTL_DAYS, JsonlFileStore, claimExpired, claimExpiry, compilePermissionPreset, costReportFromJournal, createEngine, parseModelRef, priceUsdOf, proposalStatement, remeasureQueue, resolvePricing, runProfile, sanitizeTerminalText } from "@rulvar/core";
2
2
  import { join, resolve } from "node:path";
3
3
  import { existsSync, statSync } from "node:fs";
4
4
  import { pathToFileURL } from "node:url";
@@ -168,11 +168,27 @@ function applyRunProfile(profile, host) {
168
168
  }
169
169
  //#endregion
170
170
  //#region src/tui.ts
171
+ /**
172
+ * TUI progress renderer over the WorkflowEvent stream. Line-oriented: one compact line per
173
+ * lifecycle event, replay-marked events dimmed with a prefix, a cost
174
+ * and usage summary at run:end. TTY gets no special screen handling in
175
+ * v1 beyond being the default sink; piped output stays byte-stable for
176
+ * tests and logs.
177
+ */
171
178
  function money(usd) {
172
179
  return `$${usd.toFixed(4)}`;
173
180
  }
174
- /** Renders one event to a line, or undefined for silent event types. */
181
+ /**
182
+ * Renders one event to a line, or undefined for silent event types. The
183
+ * composed line is sanitized so an untrusted provider/tool/log string
184
+ * cannot inject a control sequence or a second physical line (v1.21.0
185
+ * review P2-1).
186
+ */
175
187
  function renderEventLine(event) {
188
+ const line = rawEventLine(event);
189
+ return line === void 0 ? void 0 : sanitizeTerminalText(line);
190
+ }
191
+ function rawEventLine(event) {
176
192
  const replayMark = event.replayed === true ? "replay " : "";
177
193
  switch (event.type) {
178
194
  case "run:start": return `run ${event.runId} ${event.resumed ? "resumed" : "started"} (workflow ${event.workflow})`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.20.0",
3
+ "version": "1.22.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.20.0"
25
+ "@rulvar/core": "1.22.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/planner": "1.20.0",
32
- "@rulvar/testing": "1.20.0",
33
- "@rulvar/store-sqlite": "1.20.0",
34
- "@rulvar/plan": "1.20.0",
35
- "@rulvar/evals": "1.20.0"
31
+ "@rulvar/planner": "1.22.0",
32
+ "@rulvar/plan": "1.22.0",
33
+ "@rulvar/store-sqlite": "1.22.0",
34
+ "@rulvar/evals": "1.22.0",
35
+ "@rulvar/testing": "1.22.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"