@rulvar/cli 1.27.0 → 1.28.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-C3T5nbNg.js";
2
+ import { r as runCli, t as processIo } from "./io-Dubf-yvE.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 { 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-C3T5nbNg.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-Dubf-yvE.js";
2
2
  import { ConfigError, InvalidResolutionError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, costReportFromJournal, maskSecrets, normalizeEntry, readRunMeta, scanJournalCompatibility, validateSchemaSpec } from "@rulvar/core";
3
3
  //#region src/server.ts
4
4
  /**
@@ -556,11 +556,26 @@ function isParseArgsError(error) {
556
556
  return typeof code === "string" && code.startsWith("ERR_PARSE_ARGS");
557
557
  }
558
558
  /**
559
+ * A strictly numeric negative token, e.g. -1, -0.5, -.5, or -1e400.
560
+ * Anything else that starts with a dash (another flag, -Infinity, -NaN)
561
+ * stays option shaped for parseArgs, so unknown option and missing
562
+ * value diagnostics are unchanged.
563
+ */
564
+ const NEGATIVE_NUMBER = /^-(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;
565
+ /**
559
566
  * Parses argv against one grammar entry. Everything the grammar does
560
567
  * not name is an error: unknown options (raised by parseArgs), value
561
568
  * flags given twice, both members of an exclusive group, and any
562
569
  * positional beyond the exact arity. Every rejection names the
563
570
  * canonical usage and happens before configs, stores, or adapters load.
571
+ *
572
+ * For numeric flags (placeholder 'N'), a spaced negative value such as
573
+ * `--budget-usd -1` is folded to the equals form before parseArgs, which
574
+ * would otherwise classify the bare `-1` as an option like token and
575
+ * raise its generic ambiguity error. The fold keeps the documented
576
+ * spaced syntax on the canonical parseBudgetValue diagnostic
577
+ * (v1.27.0 review P3); it applies only when the next token is a strictly
578
+ * numeric negative, so every other rejection is untouched.
564
579
  */
565
580
  function parseCommand(grammar, argv) {
566
581
  const options = {};
@@ -568,10 +583,22 @@ function parseCommand(grammar, argv) {
568
583
  type: flag.placeholder === void 0 ? "boolean" : "string",
569
584
  multiple: true
570
585
  };
586
+ const numericFlags = new Set(grammar.flags.filter((flag) => flag.placeholder === "N").map((flag) => `--${flag.name}`));
587
+ const args = [];
588
+ for (let index = 0; index < argv.length; index += 1) {
589
+ const token = argv[index];
590
+ const next = argv[index + 1];
591
+ if (numericFlags.has(token) && next !== void 0 && NEGATIVE_NUMBER.test(next)) {
592
+ args.push(`${token}=${next}`);
593
+ index += 1;
594
+ continue;
595
+ }
596
+ args.push(token);
597
+ }
571
598
  let raw;
572
599
  try {
573
600
  raw = parseArgs({
574
- args: argv,
601
+ args,
575
602
  allowPositionals: true,
576
603
  options
577
604
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/cli",
3
- "version": "1.27.0",
3
+ "version": "1.28.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.27.0"
25
+ "@rulvar/core": "1.28.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/store-sqlite": "1.27.0",
32
- "@rulvar/planner": "1.27.0",
33
- "@rulvar/testing": "1.27.0",
34
- "@rulvar/plan": "1.27.0",
35
- "@rulvar/evals": "1.27.0"
31
+ "@rulvar/testing": "1.28.0",
32
+ "@rulvar/planner": "1.28.0",
33
+ "@rulvar/plan": "1.28.0",
34
+ "@rulvar/store-sqlite": "1.28.0",
35
+ "@rulvar/evals": "1.28.0"
36
36
  },
37
37
  "bin": {
38
38
  "rulvar": "./dist/cli.js"