@trazum/cli 1.77.0 → 1.77.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trazum/cli",
3
- "version": "1.77.0",
3
+ "version": "1.77.1",
4
4
  "description": "Trazum CLI: find where your LLM bill goes, price every finding per month, and enforce token budgets in CI.",
5
5
  "license": "MIT",
6
6
  "author": "David Mu\u00f1oz Rey",
@@ -37,7 +37,7 @@
37
37
  "prepublishOnly": "npm run build && npm test"
38
38
  },
39
39
  "dependencies": {
40
- "@trazum/core": "1.77.0"
40
+ "@trazum/core": "1.77.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^26.2.0",
package/src/index.ts CHANGED
@@ -699,7 +699,10 @@ const COMMAND_FLAGS: Record<string, string[]> = {
699
699
  function rejectUnknownFlags(args: Args, t: CliMessages): void {
700
700
  const known = COMMAND_FLAGS[args.command];
701
701
  if (!known) return;
702
- const allowed = [...known, ...GLOBAL_FLAGS];
702
+ // Deduplicated: a command that declares a flag the globals also carry
703
+ // (`--json`, `--pricing`, `--pricing-live`) listed it twice in the error,
704
+ // and a refusal that stutters reads like the tool is unsure what it takes.
705
+ const allowed = [...new Set([...known, ...GLOBAL_FLAGS])];
703
706
 
704
707
  for (const name of args.flags.keys()) {
705
708
  // `out` is stored under its long name even when given as `-o`, and a
@@ -2574,18 +2577,27 @@ async function commandWrite(args: Args, t: CliMessages): Promise<void> {
2574
2577
  /**
2575
2578
  * The workload name inside a Claude Code project folder.
2576
2579
  *
2577
- * Claude Code names those folders by encoding the project's absolute path,
2578
- * `/` becoming `-`: `~/.claude/projects/-Users-mac-Trazum`. The last
2579
- * segment of that encoding is the project's own directory name, which is
2580
- * the word a person would have chosen. A documented decoding, not a guess
2581
- * — and when decoding would leave nothing, the raw folder name stands,
2582
- * because a label somebody can trace beats a tidy one they cannot.
2580
+ * Claude Code names those folders by encoding the project's absolute path
2581
+ * with `/` replaced by `-`: `~/.claude/projects/-Users-mac-Trazum`. **That
2582
+ * encoding cannot be undone.** Both `/` and `-` map to `-`, so nothing in
2583
+ * the folder name says which dashes were separators, and 1.77.0 shipped a
2584
+ * decoder that guessed the last segment and was wrong on every project
2585
+ * whose own name contains a hyphen — real examples from the run that found
2586
+ * it: `-Users-mac-ai-job-search-ai-job-search` labelled `search`, and
2587
+ * `-Users-mac-Desktop-Pulse-Coffee-pulse-coffee` labelled `coffee`. Two
2588
+ * different projects, both renamed to a word that was never their name.
2589
+ *
2590
+ * So the folder name stands as it is, minus the leading separator. It is
2591
+ * longer than a tidy guess and it is the one thing here that is certainly
2592
+ * true: a reader can find the folder it names. Presenting a decoding as a
2593
+ * fact when the encoding cannot support one is the failure this product
2594
+ * exists to refuse, and it does not get an exception for being convenient.
2583
2595
  */
2584
2596
  function projectLabelFor(file: string): string | undefined {
2585
2597
  const folder = dirname(resolvePath(file)).split('/').pop();
2586
2598
  if (folder === undefined || folder === '') return undefined;
2587
- const decoded = folder.split('-').filter((part) => part !== '').pop();
2588
- return decoded !== undefined && decoded !== '' ? decoded : folder;
2599
+ const trimmed = folder.replace(/^-+/, '');
2600
+ return trimmed !== '' ? trimmed : folder;
2589
2601
  }
2590
2602
 
2591
2603
  async function commandFromClaudeCode(args: Args, t: CliMessages): Promise<void> {
@@ -2730,7 +2742,10 @@ async function commandSwitch(args: Args, pricing: PricingCatalogue, t: CliMessag
2730
2742
  savingUsd >= 0
2731
2743
  ? t.switchCmd.saves(formatUsd(reprice.currentUsd), formatUsd(reprice.targetUsd), formatUsd(savingUsd))
2732
2744
  : t.switchCmd.costs(formatUsd(reprice.currentUsd), formatUsd(reprice.targetUsd), formatUsd(-savingUsd));
2733
- console.log(` ${savingUsd >= 0 ? c.green('->') : c.red('->')} ${wrap(line, 72, ' ')}`);
2745
+ // The same arrow the levers use. `switch` shipped with an ASCII `->`
2746
+ // in 1.74 and the 1.75 arc gave every report one visual vocabulary;
2747
+ // two glyphs for one meaning is the reader doing translation work.
2748
+ console.log(` ${savingUsd >= 0 ? c.green('\u2192') : c.red('\u2192')} ${wrap(line, 72, ' ')}`);
2734
2749
  const movableCalls = reprice.slices.reduce((sum, slice) => sum + slice.calls, 0);
2735
2750
  console.log(` ${wrap(t.switchCmd.movable(movableCalls, reprice.slices.length), 74, ' ')}`);
2736
2751
  }