@delurio/cli 0.6.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  While the version is 0.x, a release that can judge the same graphs differently (a new check, a stricter schema) bumps the minor; a fix that judges nothing differently bumps the patch.
4
4
 
5
+ ## 0.6.1 (2026-11-11)
6
+
7
+ - `page`: in the flow's diagram, every state's group carries `data-state`, and every edge and its label `data-from` and `data-to`. One edge is drawn per pair of states, so a transition is found by its two states. A tool on top of the CLI can now find a state or a transition in the drawing, to move to it or link to it. The pages of the examples differ from 0.6.0's only by these attributes. Nothing is judged differently.
8
+ - `@delurio/cli/spine` exports `renderSpine`, which draws that diagram, with the states to draw as the story.
9
+ - SPEC.md §7: a tutorial may be told on the flow's diagram instead of its screens (`stage: diagram`), for a flow with no screens. `show` and `end` walk the flow to their state along its normal way, and every other event is given with `after`; an ending needs no card. The checker does not read tutorials, so nothing is judged differently.
10
+
5
11
  ## 0.6.0 (2026-11-10)
6
12
 
7
13
  - A graph file with an anchor (`&name`), an alias (`*name`), a tag (`!name`) or a key that is a list or a map cannot be loaded (SPEC.md §1): `check` gives `load` and `schema` errors at its line, "unsupported YAML", and exits 1; `page`, `diff` and the other commands stop the same way. The yaml library resolves these in time far beyond a file's size. On a 40 KB file, maps used as keys kept it busy for more than 30 seconds, and aliases of an anchor that holds only aliases of an empty list for more than two minutes. Its alias limit does not catch these cases. Every reader of a graph file now looks for them first, in one pass that resolves nothing: such a file is refused in under a second. A value is written where it is used, and a key is a string. Of the graphs of delurio, Medaris and QAuth, only QAuth's has them: seven flows use anchors for a `response` they repeat.
package/SPEC.md CHANGED
@@ -281,7 +281,9 @@ notModeled: [ "..." ]
281
281
 
282
282
  A **binding** ties a flow to a running app for replay and recording: `apps` (base addresses), `browser`, `data` (JSON or dotenv sources, secrets masked in reports), `signIn`, `accounts`, `scenarios` (each a `given` start, the account, the page to `open`, `setup` and `teardown`), `events` (the actions that cause an event no node on screen sends), `states` (a URL glob or a text a state must show) and `nodes` (a locator for a node that role and name cannot find, or `before` actions such as opening a menu, or `skip` with a reason). It may `extends` a shared binding. An action is one of `goto`, `reload`, `click`, `fill`, `key`, `waitUrl`, `waitText`, `waitResponse`, `run` (a command, with `expect`). A locator is `role`, `name`, `text`, `label`, `testId`, `css`, `hasText`, `within`, `nth`; a string between slashes is a regular expression. Replay over HTTP, with no browser, is an open issue; screenshots of every state on the real app are an open issue.
283
283
 
284
- A **tutorial** is written against a flow: `title`, `audience`, `locale`, `appName`, `voice`, the `scenario` (the starting context), and `steps`. A step is `intro`, `chapter`, `show <state>`, `cut <state>` (jump, through a scenario the binding names), `reveal`/`focus` (nodes), `press <node>`, `after`, `card { title, body }`, `end`, and `say`. Every step is replayed on the flow, so a tutorial that no longer matches the graph stops at that step. `{word}` in `say` is a sample value or a node's visible text.
284
+ A **tutorial** is written against a flow: `title`, `audience`, `locale`, `appName`, `voice`, `stage`, the `scenario` (the starting context), and `steps`. A step is `intro`, `chapter`, `show <state>`, `cut <state>` (jump, through a scenario the binding names), `reveal`/`focus` (nodes), `press <node>`, `after`, `card { title, body }`, `end`, and `say`. Every step is replayed on the flow, so a tutorial that no longer matches the graph stops at that step. `{word}` in `say` is a sample value or a node's visible text.
285
+
286
+ `stage` says what the video shows: the flow's screens (`screen`, the default), or its diagram (`diagram`), for a flow with no screens, such as two programs talking or a job in the background. On the diagram the camera goes from state to state, and the tutorial's own way is drawn as the story, whether or not it is the flow's `main` story; the diagram holds every transition, failures included. No state is passed on its own there: `show <state>` and `end <state>` walk the flow to their state along its normal way (a transition with no event, then `DONE`) and stop the tutorial when that way does not reach it, and every other event is given with `after`. `press`, `reveal` and `focus` point at nodes a diagram does not have, and stop it too. An `end` on the diagram needs no `card`; one it has is shown after the ending.
285
287
 
286
288
  A video is an MP4 file. Its captions are WebVTT (`tutorial.vtt`, what an HTML `<track>` plays, with `tutorial.srt` beside it), and its chapters a WebVTT chapters track (`chapters.vtt`). Every video delurio makes is marked as AI-made in three ways, none of which can be turned off: a first card that says the whole video is made with AI, an imperceptible watermark in the sound and the picture, and signed, time-stamped provenance metadata (C2PA is the candidate). The watermark and the metadata are the machine-readable marking that Art. 50(2) of the EU AI Act asks of a system that generates synthetic audio and video, and the Commission's Code of Practice of 10 June 2026 describes. The disclosure is there because every voice is made from real people's recordings and may resemble one of them, which Art. 50(4) treats as a deep fake to disclose; a catalogue voice is no different from a cloned one in that, and delurio cannot tell which listener would recognise which voice (Taha, 24 Oct 2026: "Klon olmayan sesler de gerçek insan sesinden"). It opens the video, since Art. 50(5) asks for it at the latest at the first exposure, and nothing is burnt into the picture after it (Taha, 25 Oct 2026: "en başta 'videonun tamamı' diye belirtip yazsak yetmez mi"); a clip cut from the middle loses the card but keeps the watermark and the metadata. A lawyer is to confirm this reading. The video tool does not add the watermark or the metadata yet; that is an open issue.
287
289
 
package/dist/spine.d.ts CHANGED
@@ -2,4 +2,9 @@ import type { Graph } from './graph.ts';
2
2
  import type { Exploration } from './model.ts';
3
3
  import type { PathStep } from './story.ts';
4
4
  export type View = 'main' | 'full';
5
+ /**
6
+ * The flow's diagram as an SVG. Every state's group carries `data-state`, and every edge and its label `data-from` and
7
+ * `data-to`: one edge is drawn per pair of states, its label holding every transition between them. `story`: the
8
+ * states to draw as the story (`on-main`), in order.
9
+ */
5
10
  export declare function renderSpine(g: Graph, ex: Exploration, view: View, story: PathStep[] | null): Promise<string>;
package/dist/spine.js CHANGED
@@ -13,6 +13,11 @@ const r1 = (n) => Math.round(n * 10) / 10;
13
13
  function labelLines(e, view) {
14
14
  return e.labels.flatMap((l) => wrap(l, LABEL_WRAP[view]));
15
15
  }
16
+ /**
17
+ * The flow's diagram as an SVG. Every state's group carries `data-state`, and every edge and its label `data-from` and
18
+ * `data-to`: one edge is drawn per pair of states, its label holding every transition between them. `story`: the
19
+ * states to draw as the story (`on-main`), in order.
20
+ */
16
21
  export async function renderSpine(g, ex, view, story) {
17
22
  const all = collectEdges(g, ex);
18
23
  // main view: the story without failure branches and without "the user closes the page"
@@ -82,6 +87,8 @@ export async function renderSpine(g, ex, view, story) {
82
87
  edges.forEach((e, i) => byId.set(`e${i}`, e));
83
88
  const drawn = (laid.edges ?? []).filter((e) => e.sections?.[0] !== undefined);
84
89
  const isMain = (e) => e !== undefined && mainEdges.has(`${e.from}>${e.to}`);
90
+ // which states an edge joins, so a tool can find the drawing of a transition: one edge per pair of states
91
+ const ends = (e) => `data-from="${esc(e.from)}" data-to="${esc(e.to)}"`;
85
92
  const path = (e) => {
86
93
  const section = e.sections?.[0];
87
94
  if (section === undefined)
@@ -99,7 +106,7 @@ export async function renderSpine(g, ex, view, story) {
99
106
  if (viz === undefined || isMain(viz) !== pass)
100
107
  continue;
101
108
  const kind = pass ? 'main' : viz.kind;
102
- out.push(`<path class="edge edge-${kind}${viz.unused ? ' edge-unused' : ''}" d="${path(e)}" marker-end="url(#arrow-${view}-${kind})"/>`);
109
+ out.push(`<path class="edge edge-${kind}${viz.unused ? ' edge-unused' : ''}" ${ends(viz)} d="${path(e)}" marker-end="url(#arrow-${view}-${kind})"/>`);
103
110
  }
104
111
  }
105
112
  for (const e of drawn) {
@@ -110,7 +117,7 @@ export async function renderSpine(g, ex, view, story) {
110
117
  const lines = labelLines(viz, view);
111
118
  const x = label.x ?? 0;
112
119
  const y = label.y ?? 0;
113
- out.push(`<g class="elabel${isMain(viz) ? ' elabel-main' : ''}${viz.kind === 'fail' ? ' elabel-fail' : ''}"><rect x="${r1(x)}" y="${r1(y)}" width="${label.width ?? 0}" height="${label.height ?? 0}" rx="4"/>`);
120
+ out.push(`<g class="elabel${isMain(viz) ? ' elabel-main' : ''}${viz.kind === 'fail' ? ' elabel-fail' : ''}" ${ends(viz)}><rect x="${r1(x)}" y="${r1(y)}" width="${label.width ?? 0}" height="${label.height ?? 0}" rx="4"/>`);
114
121
  lines.forEach((l, i) => out.push(`<text x="${r1(x + 7)}" y="${r1(y + 17 + i * 17)}">${esc(l)}</text>`));
115
122
  out.push('</g>');
116
123
  }
@@ -131,7 +138,7 @@ export async function renderSpine(g, ex, view, story) {
131
138
  const close = kind === 'screen' ? '</a>' : '';
132
139
  const by = st.by === undefined ? '' : ` by-${st.by}`;
133
140
  const tip = [st.description ?? n.id, ...(st.includes ?? []).map((s) => `+ ${s}`)].join('\n');
134
- out.push(`${open}<g class="node node-${kind}${by}${st.goal === true ? ' goal' : ''}${exitClass}${mainNodes.has(n.id) ? ' on-main' : ''}${unreachable ? ' node-unreachable' : ''}"><title>${esc(tip)}</title>`);
141
+ out.push(`${open}<g class="node node-${kind}${by}${st.goal === true ? ' goal' : ''}${exitClass}${mainNodes.has(n.id) ? ' on-main' : ''}${unreachable ? ' node-unreachable' : ''}" data-state="${esc(n.id)}"><title>${esc(tip)}</title>`);
135
142
  const rx = kind === 'exit' || st.by === 'ai' ? 28 : st.by === 'ci' ? 0 : 8;
136
143
  out.push(`<rect x="${x}" y="${y}" width="${w}" height="${h}" rx="${rx}"/>`);
137
144
  if (st.by === 'agent')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delurio/cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "The open checker and page of delurio-graph/0: check every graph in a project's own CI, offline, with GNU error lines and SARIF.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -15,6 +15,7 @@
15
15
  "./html": { "types": "./dist/html.d.ts", "default": "./dist/html.js" },
16
16
  "./nav": { "types": "./dist/nav.d.ts", "default": "./dist/nav.js" },
17
17
  "./expr": { "types": "./dist/expr.d.ts", "default": "./dist/expr.js" },
18
+ "./spine": { "types": "./dist/spine.d.ts", "default": "./dist/spine.js" },
18
19
  "./yaml": { "types": "./dist/yaml.d.ts", "default": "./dist/yaml.js" },
19
20
  "./package.json": "./package.json"
20
21
  },