@cotal-ai/workspace 0.116.1 → 0.116.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.
@@ -3,7 +3,7 @@
3
3
  "platform": "darwin",
4
4
  "arch": "arm64",
5
5
  "nodeApi": 8,
6
- "source": "92a90b1aedcea6846a4a1c94a429ee51e992be90",
6
+ "source": "e25764695489ee0b791a919d544a2b87dd4d5b27",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -3,7 +3,7 @@
3
3
  "platform": "darwin",
4
4
  "arch": "x64",
5
5
  "nodeApi": 8,
6
- "source": "92a90b1aedcea6846a4a1c94a429ee51e992be90",
6
+ "source": "e25764695489ee0b791a919d544a2b87dd4d5b27",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -3,7 +3,7 @@
3
3
  "platform": "win32",
4
4
  "arch": "arm64",
5
5
  "nodeApi": 8,
6
- "source": "92a90b1aedcea6846a4a1c94a429ee51e992be90",
6
+ "source": "e25764695489ee0b791a919d544a2b87dd4d5b27",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -3,7 +3,7 @@
3
3
  "platform": "win32",
4
4
  "arch": "x64",
5
5
  "nodeApi": 8,
6
- "source": "92a90b1aedcea6846a4a1c94a429ee51e992be90",
6
+ "source": "e25764695489ee0b791a919d544a2b87dd4d5b27",
7
7
  "sourceHashes": {
8
8
  "native/win32-process.c": "889b215135b60dd3a45096737a3219ce114bc424e4b6cce42624f0913f8447dc",
9
9
  "native/win32-system-id.cpp": "2dd51f24425e8239aeac1aae01e67f43264f04f09cd9097a12d288be7a84e074",
@@ -8,7 +8,9 @@
8
8
  * One call is one line whatever its arguments hold. A path can carry a newline, and written raw it
9
9
  * would let one call announce a second act the command never made, or a carriage return overwrite
10
10
  * the act it did make. So every control character and Unicode line separator in the line is shown
11
- * as a `\uXXXX` escape instead.
11
+ * as a `\uXXXX` escape instead. On a terminal a long line wraps at spaces like the CLI's other
12
+ * notices, each continuation line under the text after the arrow, and a word wider than the rest of
13
+ * the line, such as a path, keeps a line of its own. To a pipe or a file it stays one line.
12
14
  *
13
15
  * Failure policy: a line reports an act that already happened, so a fault on stderr must neither
14
16
  * fail that act nor drop the line unsaid. When the stderr write throws or fails (EPIPE, ENOSPC,
@@ -1 +1 @@
1
- {"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,UAAU;IACrB,0FAA0F;eAC/E,MAAM,UAAU,MAAM,GAAG,IAAI;IAGxC,sFAAsF;gBAC1E,MAAM,QAAQ,MAAM,GAAG,IAAI;IAGvC;;yGAEqG;kBACvF,MAAM,QAAQ,MAAM,GAAG,IAAI;CAG1C,CAAC"}
1
+ {"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU;IACrB,0FAA0F;eAC/E,MAAM,UAAU,MAAM,GAAG,IAAI;IAGxC,sFAAsF;gBAC1E,MAAM,QAAQ,MAAM,GAAG,IAAI;IAGvC;;yGAEqG;kBACvF,MAAM,QAAQ,MAAM,GAAG,IAAI;CAG1C,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { oneLine } from "@cotal-ai/core";
2
+ import { terminalWidth, wrapWords } from "./text-wrap.js";
2
3
  /**
3
4
  * One consistent voice for CLI provenance, on stderr: which on-disk source a command RESOLVED
4
5
  * its configuration from, and what it WROTE where. Commands must never silently pick up state
@@ -9,7 +10,9 @@ import { oneLine } from "@cotal-ai/core";
9
10
  * One call is one line whatever its arguments hold. A path can carry a newline, and written raw it
10
11
  * would let one call announce a second act the command never made, or a carriage return overwrite
11
12
  * the act it did make. So every control character and Unicode line separator in the line is shown
12
- * as a `\uXXXX` escape instead.
13
+ * as a `\uXXXX` escape instead. On a terminal a long line wraps at spaces like the CLI's other
14
+ * notices, each continuation line under the text after the arrow, and a word wider than the rest of
15
+ * the line, such as a path, keeps a line of its own. To a pipe or a file it stays one line.
13
16
  *
14
17
  * Failure policy: a line reports an act that already happened, so a fault on stderr must neither
15
18
  * fail that act nor drop the line unsaid. When the stderr write throws or fails (EPIPE, ENOSPC,
@@ -28,17 +31,17 @@ import { oneLine } from "@cotal-ai/core";
28
31
  export const provenance = {
29
32
  /** `→ using <what>: <source>` — the source that WON resolution (say which layer/path). */
30
33
  read(what, source) {
31
- say(`→ using ${what}: ${source}`);
34
+ say(`using ${what}: ${source}`);
32
35
  },
33
36
  /** `→ wrote <what>: <dest>` — announce every file the command created or replaced. */
34
37
  wrote(what, dest) {
35
- say(`→ wrote ${what}: ${dest}`);
38
+ say(`wrote ${what}: ${dest}`);
36
39
  },
37
40
  /** `→ removed <what>: <dest>`: announce every file or directory the command DELETED. A silent
38
41
  * delete is worse than a silent write, because the write at least leaves the thing it made while
39
42
  * the delete leaves nothing to notice. Destructive steps get the one line the additive ones get. */
40
43
  removed(what, dest) {
41
- say(`→ removed ${what}: ${dest}`);
44
+ say(`removed ${what}: ${dest}`);
42
45
  },
43
46
  };
44
47
  let unsaid = false;
@@ -47,14 +50,20 @@ let watching = false;
47
50
  const waiting = new Set();
48
51
  /** Streams whose `error` event is absorbed: without a listener Node exits 1 on it. */
49
52
  const absorbed = new Set();
50
- /** Write one provenance line under the failure policy above: on stderr, else on stdout with the
51
- * stderr error named, else counted as unsaid. The failure name is escaped with the rest, since a
52
- * thrown value's message can carry a newline too. */
53
- function say(line) {
54
- send(process.stderr, `${oneLine(line)}\n`, (failure) => {
55
- send(process.stdout, `${oneLine(`${line} (stderr failed: ${nameOf(failure)})`)}\n`, lost);
53
+ /** Write one provenance line, the arrow and `text`, under the failure policy above: on stderr, else
54
+ * on stdout with the stderr error named, else counted as unsaid. The failure name is escaped with
55
+ * the rest, since a thrown value's message can carry a newline too. */
56
+ function say(text) {
57
+ send(process.stderr, shown(text, process.stderr), (failure) => {
58
+ send(process.stdout, shown(`${text} (stderr failed: ${nameOf(failure)})`, process.stdout), lost);
56
59
  });
57
60
  }
61
+ /** `text` after the arrow with its control characters escaped, wrapped to `stream`'s terminal and
62
+ * each continuation line under the text, as one write. */
63
+ function shown(text, stream) {
64
+ const lines = wrapWords(oneLine(text), terminalWidth(stream) - 2);
65
+ return `${lines.map((line, i) => `${i === 0 ? "→" : " "} ${line}`).join("\n")}\n`;
66
+ }
58
67
  /** A thrown value need not be an Error (`throw null`), and naming one must not throw, since that
59
68
  * would interrupt the command this policy keeps running. */
60
69
  function nameOf(failure) {
@@ -1 +1 @@
1
- {"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,0FAA0F;IAC1F,IAAI,CAAC,IAAY,EAAE,MAAc;QAC/B,GAAG,CAAC,WAAW,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;IACpC,CAAC;IACD,sFAAsF;IACtF,KAAK,CAAC,IAAY,EAAE,IAAY;QAC9B,GAAG,CAAC,WAAW,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IACD;;yGAEqG;IACr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SAAS,SAAS;IAChB,IAAI,QAAQ;QAAE,OAAO;IACrB,QAAQ,GAAG,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAC1B,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,GAAG,CAAC;gBAAE,MAAM,GAAG,IAAI,CAAC;QACxE,IAAI,MAAM,IAAI,IAAI,KAAK,CAAC;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/workspace",
3
3
  "description": "Cotal machine-local workstation layer: the ~/.cotal mesh registry, target resolution, preflight, on-disk auth-path I/O, and the command-copy renderer — operator concerns over a local checkout, kept separate from the wire protocol in @cotal-ai/core.",
4
- "version": "0.116.1",
4
+ "version": "0.116.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@cotal-ai/core": "0.116.1",
25
+ "@cotal-ai/core": "0.116.2",
26
26
  "ajv": "^8.20.0",
27
27
  "string-width": "^8.2.1",
28
28
  "yaml": "^2.9.0",