@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/dist/index.js CHANGED
@@ -404,7 +404,10 @@ function rejectUnknownFlags(args, t) {
404
404
  const known = COMMAND_FLAGS[args.command];
405
405
  if (!known)
406
406
  return;
407
- const allowed = [...known, ...GLOBAL_FLAGS];
407
+ // Deduplicated: a command that declares a flag the globals also carry
408
+ // (`--json`, `--pricing`, `--pricing-live`) listed it twice in the error,
409
+ // and a refusal that stutters reads like the tool is unsure what it takes.
410
+ const allowed = [...new Set([...known, ...GLOBAL_FLAGS])];
408
411
  for (const name of args.flags.keys()) {
409
412
  // `out` is stored under its long name even when given as `-o`, and a
410
413
  // negated boolean under its base name, so both validate against the list.
@@ -1999,19 +2002,28 @@ async function commandWrite(args, t) {
1999
2002
  /**
2000
2003
  * The workload name inside a Claude Code project folder.
2001
2004
  *
2002
- * Claude Code names those folders by encoding the project's absolute path,
2003
- * `/` becoming `-`: `~/.claude/projects/-Users-mac-Trazum`. The last
2004
- * segment of that encoding is the project's own directory name, which is
2005
- * the word a person would have chosen. A documented decoding, not a guess
2006
- * — and when decoding would leave nothing, the raw folder name stands,
2007
- * because a label somebody can trace beats a tidy one they cannot.
2005
+ * Claude Code names those folders by encoding the project's absolute path
2006
+ * with `/` replaced by `-`: `~/.claude/projects/-Users-mac-Trazum`. **That
2007
+ * encoding cannot be undone.** Both `/` and `-` map to `-`, so nothing in
2008
+ * the folder name says which dashes were separators, and 1.77.0 shipped a
2009
+ * decoder that guessed the last segment and was wrong on every project
2010
+ * whose own name contains a hyphen — real examples from the run that found
2011
+ * it: `-Users-mac-ai-job-search-ai-job-search` labelled `search`, and
2012
+ * `-Users-mac-Desktop-Pulse-Coffee-pulse-coffee` labelled `coffee`. Two
2013
+ * different projects, both renamed to a word that was never their name.
2014
+ *
2015
+ * So the folder name stands as it is, minus the leading separator. It is
2016
+ * longer than a tidy guess and it is the one thing here that is certainly
2017
+ * true: a reader can find the folder it names. Presenting a decoding as a
2018
+ * fact when the encoding cannot support one is the failure this product
2019
+ * exists to refuse, and it does not get an exception for being convenient.
2008
2020
  */
2009
2021
  function projectLabelFor(file) {
2010
2022
  const folder = dirname(resolvePath(file)).split('/').pop();
2011
2023
  if (folder === undefined || folder === '')
2012
2024
  return undefined;
2013
- const decoded = folder.split('-').filter((part) => part !== '').pop();
2014
- return decoded !== undefined && decoded !== '' ? decoded : folder;
2025
+ const trimmed = folder.replace(/^-+/, '');
2026
+ return trimmed !== '' ? trimmed : folder;
2015
2027
  }
2016
2028
  async function commandFromClaudeCode(args, t) {
2017
2029
  const target = args.positional[0];
@@ -2166,7 +2178,10 @@ async function commandSwitch(args, pricing, t) {
2166
2178
  const line = savingUsd >= 0
2167
2179
  ? t.switchCmd.saves(formatUsd(reprice.currentUsd), formatUsd(reprice.targetUsd), formatUsd(savingUsd))
2168
2180
  : t.switchCmd.costs(formatUsd(reprice.currentUsd), formatUsd(reprice.targetUsd), formatUsd(-savingUsd));
2169
- console.log(` ${savingUsd >= 0 ? c.green('->') : c.red('->')} ${wrap(line, 72, ' ')}`);
2181
+ // The same arrow the levers use. `switch` shipped with an ASCII `->`
2182
+ // in 1.74 and the 1.75 arc gave every report one visual vocabulary;
2183
+ // two glyphs for one meaning is the reader doing translation work.
2184
+ console.log(` ${savingUsd >= 0 ? c.green('\u2192') : c.red('\u2192')} ${wrap(line, 72, ' ')}`);
2170
2185
  const movableCalls = reprice.slices.reduce((sum, slice) => sum + slice.calls, 0);
2171
2186
  console.log(` ${wrap(t.switchCmd.movable(movableCalls, reprice.slices.length), 74, ' ')}`);
2172
2187
  }