omkit 0.8.8 → 0.8.9

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.
@@ -39,9 +39,9 @@ const legend = [
39
39
  "#",
40
40
  "# ── legend ──────────────────────────────────────────────────────────",
41
41
  "# [n] global sequence — the merge/order key across every .log",
42
- "# indented rows a child action's milestones, bubbled up here",
42
+ "# launch ACTION_RUN(id) · → · ….log a child started — open that file for its full output",
43
+ "# indented rows a child action's milestones, bubbled up here (one level under launches)",
43
44
  "# name [tags] the action and its tags · defined … where its code lives",
44
- "# launch · → ….log a child started — open that file for its full output",
45
45
  "# ⚡ event ✓ done ok ⊘ cancelled ✗ failed ⊨/⊭ assert pass/fail 📸 snapshot ▪ output",
46
46
  ];
47
47
  const stamp = (ms) => (ms ? new Date(ms).toISOString() : "-");
@@ -6,10 +6,20 @@ import { label } from "../../foundation/ActionRef.js";
6
6
  * the child by its {@link label} (name + tags) via `refOf`; everything else keeps its
7
7
  * `source` (proc name, `console`, …).
8
8
  */
9
- export const entryLine = (e, refOf) => {
10
- // Bubbled child rows are nested a level in — the whole row, `[seq]` included.
11
- const indent = e.level === "child" ? " " : "";
12
- return `${indent}[${e.sequence}] ${bodyOf(e, refOf)}`;
9
+ export const entryLine = (e, refOf) => `${indentOf(e)}[${e.sequence}] ${bodyOf(e, refOf)}`;
10
+ /**
11
+ * Bubbled child rows are nested in — the whole row, `[seq]` included. The launch pointer
12
+ * sits one level in; the child's own milestones sit one level deeper, under their launch.
13
+ */
14
+ const indentOf = (e) => {
15
+ if (e.level !== "child")
16
+ return "";
17
+ return e.source === "launch" ? " " : " ";
18
+ };
19
+ /** `→ <id> · <logfile> · …` → `ACTION_RUN(<id>) · → · <logfile> · …`, so a launch stands out. */
20
+ const launchBody = (message) => {
21
+ const [head = "", ...rest] = message.replace(/^→\s*/, "").split(" · ");
22
+ return [`ACTION_RUN(${head})`, "→", ...rest].join(" · ");
13
23
  };
14
24
  const bodyOf = (e, refOf) => {
15
25
  switch (e.level) {
@@ -28,11 +38,11 @@ const bodyOf = (e, refOf) => {
28
38
  // output. (Cancellation no longer logs at this level — it's a clean stop.)
29
39
  return e.source === "error" ? `✗ ${e.message}` : `▪ ${e.message}`;
30
40
  case "child": {
31
- // A bubbled child line (indented at the row level by `entryLine`). The launch pointer
32
- // (`source === "launch"`) keeps its `→ id · logfile` message; a milestone names the
33
- // child by its label (name + tags) via `refOf`.
41
+ // A bubbled child line (indented at the row level by `indentOf`). The launch pointer
42
+ // (`source === "launch"`) reads `launch ACTION_RUN(id) · → · logfile`; a milestone
43
+ // names the child by its label (name + tags) via `refOf`.
34
44
  if (e.source === "launch")
35
- return `${e.source} · ${e.message}`;
45
+ return `${e.source} ${launchBody(e.message)}`;
36
46
  const ref = refOf?.(e.source);
37
47
  return `${ref ? label(ref) : e.source} · ${e.message}`;
38
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omkit",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "description": "A tiny runtime for developer workflows: typed actions that pass runtime capabilities and emit typed events, under one run and one shared log. The operational/runtime layer to tskb's knowledge layer.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",