@isomorph.ai/cli 0.5.1 → 0.5.2

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.
@@ -26,7 +26,13 @@ export function safeError(error) {
26
26
  const paths = error instanceof CliError && error.paths?.length ? error.paths : undefined;
27
27
  // Structured, so it is neither bounded nor redacted: a command's choices are its commands, and a refusal's blockers are what the reader acts on.
28
28
  const details = error instanceof CliError && error.details && Object.keys(error.details).length ? error.details : undefined;
29
- return { code, layer, message: redact(raw) || NO_DETAIL, ...(hint ? { remediationHint: hint } : {}), ...(paths ? { paths } : {}), ...(details ? { details } : {}) };
29
+ // A refusal another layer authored — the gate, governance, the pipeline — is
30
+ // the whole answer and is already bounded where it was written; cutting it
31
+ // here deleted the table name from a pipeline refusal on 2026-09-16 (the cut
32
+ // fell exactly on "No journey was generated for `notes`"). Only this CLI's
33
+ // own prose keeps the cap.
34
+ const message = (layer === "cli" ? redact(raw) : scrub(raw)) || NO_DETAIL;
35
+ return { code, layer, message, ...(hint ? { remediationHint: hint } : {}), ...(paths ? { paths } : {}), ...(details ? { details } : {}) };
30
36
  }
31
37
  /** Anything that must never reach a terminal, a log or an envelope. */
32
38
  const SECRETS = /https?:\/\/\S+|Bearer\s+\S+|(?:x-harbour|authorization|content-type)[^\n]*/gi;
@@ -70,8 +76,12 @@ const ELISION = " \u2026 ";
70
76
  * phrasings, it deletes words the server actually said, and it is the kind of
71
77
  * meaning-guessing the classifier deleted above was deleted for.
72
78
  */
79
+ /** Redacted and whitespace-folded, never bounded: what a server-authored refusal reaches the reader as. */
80
+ function scrub(value) {
81
+ return value.replace(SECRETS, "").replace(/\s+/g, " ").trim();
82
+ }
73
83
  function redact(value) {
74
- const said = value.replace(SECRETS, "").replace(/\s+/g, " ").trim();
84
+ const said = scrub(value);
75
85
  if (said.length <= DETAIL_BOUND)
76
86
  return said;
77
87
  const keep = DETAIL_BOUND - ELISION.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isomorph.ai/cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Isomorph development kit CLI",
5
5
  "type": "module",
6
6
  "bin": {