@delurio/cli 0.10.0 → 0.12.0
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 +15 -0
- package/NOTICE +7 -0
- package/README.md +38 -22
- package/SPEC.md +8 -1
- package/js/changes.d.ts +17 -0
- package/js/cli.js +6 -0
- package/{dist → js}/edges.d.ts +2 -2
- package/js/edges.js +40 -0
- package/js/expr.js +25 -0
- package/{dist → js}/graph.d.ts +3 -0
- package/js/graph.js +73 -0
- package/{dist → js}/html.d.ts +6 -6
- package/js/html.js +13 -0
- package/js/internal.js +408 -0
- package/js/kit.js +54 -0
- package/{dist → js}/model.d.ts +2 -2
- package/js/model.js +136 -0
- package/js/native.cjs +46 -0
- package/js/native.d.cts +328 -0
- package/{dist → js}/nav.d.ts +1 -1
- package/js/nav.js +70 -0
- package/js/needs.js +30 -0
- package/{dist → js}/spine.d.ts +3 -3
- package/js/spine.js +22 -0
- package/{dist → js}/starts.d.ts +1 -3
- package/{dist → js}/story.d.ts +2 -2
- package/js/story.js +22 -0
- package/{dist → js}/wireframe.d.ts +2 -2
- package/js/wireframe.js +29 -0
- package/js/yaml.d.ts +20 -0
- package/js/yaml.js +40 -0
- package/package.json +40 -24
- package/schemas/binding.schema.json +2211 -0
- package/schemas/ui.schema.json +6 -0
- package/dist/anchors.d.ts +0 -29
- package/dist/anchors.js +0 -160
- package/dist/changes.d.ts +0 -25
- package/dist/changes.js +0 -101
- package/dist/check.d.ts +0 -23
- package/dist/check.js +0 -649
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -194
- package/dist/compare.d.ts +0 -34
- package/dist/compare.js +0 -143
- package/dist/diff-flow.d.ts +0 -33
- package/dist/diff-flow.js +0 -547
- package/dist/diff-nav.d.ts +0 -20
- package/dist/diff-nav.js +0 -401
- package/dist/diff.d.ts +0 -25
- package/dist/diff.js +0 -331
- package/dist/domain-names.d.ts +0 -18
- package/dist/domain-names.js +0 -124
- package/dist/domain.d.ts +0 -25
- package/dist/domain.js +0 -110
- package/dist/edges.js +0 -120
- package/dist/expr.js +0 -157
- package/dist/graph.js +0 -236
- package/dist/html.js +0 -311
- package/dist/index-page.d.ts +0 -12
- package/dist/index-page.js +0 -50
- package/dist/invokes.d.ts +0 -10
- package/dist/invokes.js +0 -67
- package/dist/kit.js +0 -711
- package/dist/mermaid.d.ts +0 -3
- package/dist/mermaid.js +0 -50
- package/dist/model.js +0 -608
- package/dist/nav-page.d.ts +0 -15
- package/dist/nav-page.js +0 -283
- package/dist/nav.js +0 -578
- package/dist/needs.js +0 -335
- package/dist/pan.d.ts +0 -2
- package/dist/pan.js +0 -252
- package/dist/schemas.d.ts +0 -15
- package/dist/schemas.js +0 -316
- package/dist/spine.js +0 -156
- package/dist/starts.js +0 -88
- package/dist/story.js +0 -109
- package/dist/tutorial-check.d.ts +0 -9
- package/dist/tutorial-check.js +0 -297
- package/dist/ui-check.d.ts +0 -8
- package/dist/ui-check.js +0 -142
- package/dist/watch.d.ts +0 -5
- package/dist/watch.js +0 -114
- package/dist/wireframe.js +0 -276
- package/dist/yaml.d.ts +0 -19
- package/dist/yaml.js +0 -134
- /package/{dist → js}/expr.d.ts +0 -0
- /package/{dist → js}/kit.d.ts +0 -0
- /package/{dist → js}/needs.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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.12.0 (2026-11-21)
|
|
6
|
+
|
|
7
|
+
- A node of a flow's screens may say which field of the flow's domain it holds: `holds: <Entity>.<field>`, the value a text shows or a field takes (SPEC.md §4). New rule of `check`, which fails `--strict`: `holds-unknown`, at a `holds` that names an entity the domain does not have, a field the entity does not have, or a domain that is not found beside the flow; an entity that gives no `fields` yet is not held to them. A `holds` that is not `<Entity>.<field>` is the `schema` rule's. Graphs without `holds` are judged as before.
|
|
8
|
+
- What a recording masks (SPEC.md §7): a recording, a video made from it and a replay's screenshots blur every element of a node that holds a field whose `sensitivity` the binding's `mask` names, in every frame of a state that shows it. What is masked is the binding's to say: `mask` lists the sensitivities, `[credential]` when it is left out; `mask: [credential, personal]` also keeps people's names and addresses out of a recording made on real data, and `mask: []` masks nothing, for a tutorial filmed with a password made up for it. `maskedNodes(g, mask)` in `@delurio/cli/graph` names those nodes, in the order of `nodes`, the domain looked up beside the graph as `check` finds it; `UiNode` gives `holds`.
|
|
9
|
+
- A schema for bindings (SPEC.md §7): `schemas/binding.schema.json`, every key a replay reads of a flow's binding and of a navigation graph's. `check` holds `binding.yaml` and a shared `<name>.binding.yaml` to it, under the rule `schema`, which fails `--strict`: a key that is not one (a misspelt `scenarios`, or `exact` on a locator, which a replay passed over in silence), a value of the wrong kind, an action with two verbs or none, `expect` without `run`, a state's `fail` without its `call`, a `setup` that does more than run commands. A binding is YAML without anchors, aliases or tags, as every graph file is (SPEC.md §1). Before, a mistake in a binding showed only when a replay ran it, which needs a browser and the app (the Omnitron pilot, 21 Nov 2026). What a binding names in the graph is still held by the replay, which loads it with no browser under `replay --check`. A project whose bindings give a key the schema does not know can record the findings with `--baseline`.
|
|
10
|
+
|
|
11
|
+
## 0.11.0 (2026-11-16)
|
|
12
|
+
|
|
13
|
+
- The checker is written in Rust: `check`, `page` and `diff`, and every module the package exports, are the TypeScript checker's ported one module at a time (crates/delurio-core, crates/delurio-page, the `delurio` binary in crates/delurio, and the addon in crates/delurio-node). It judges every graph as 0.10.0 does: on the examples, on delurio's, QAuth's and Medaris's own graphs, and in the 35 behaviour cases of the CI, every finding (its rule, level, file, line, words and fingerprint), the SARIF, the exit codes, every page, diagram and Mermaid file, and every diff are those 0.10.0 gives. Where 0.10.0 stopped with a JavaScript TypeError on a value of the wrong type, 0.11.0 reads the value as absent (the `schema` rule already reports it), and a baseline or a file it cannot read is an `error:` line, not a stack trace.
|
|
14
|
+
- It reads YAML as 0.10.0 did: the yaml library 2.9.1's lexer, parser and composer are ported, so a refusal (SPEC.md §1), a YAML error and a key are found at the same place and in the same words. The `schema` rule gives Ajv 8.20's findings: Ajv's evaluation of the keywords the schemas use is reproduced. A flow's diagram is still laid out by elkjs 0.12.1 itself, now run inside the binary (QuickJS-NG), so its places are the same to the last digit as before and as the dashboard's.
|
|
15
|
+
- Faster and smaller: on Medaris's 179 graphs, `check --strict --baseline` takes 34 s and 299 MB, where 0.10.0 took 87 s and 1 GB; `page` takes 96 s, where 0.10.0 took 15 minutes. On delurio's own graphs `check` takes 56 s and 0.56 GB, where 0.10.0 took 228 s and 4.2 GB (more than Node's default heap): the explorer keeps each (state, context) pair as packed words, 16 bytes a pair, so delurio's billing.plan (16.76 million pairs) explores in 21 s and 0.54 GB.
|
|
16
|
+
- One new limit: a context variable may hold up to 65,536 values.
|
|
17
|
+
- For installers: `delurio` is one static binary, from the GitHub release of each tag (Linux x64 and arm64, glibc and musl, macOS arm64, Windows x64, with SHA256SUMS), from `cargo install --locked --git https://github.com/delurio-labs/delurio --tag v0.11.0 delurio`, and in the image `ghcr.io/delurio-labs/delurio`, which is now the binary alone `FROM scratch`. `npm install @delurio/cli` installs the same command (`npx delurio`) and the same entry points with their types, on a prebuilt addon of the platform: npm picks one of six packages `@delurio/cli-<platform>` (no install script). The package needs Node 26 or later and depends only on elkjs. A process that loads the library under Node's permission model needs `--allow-addons`, and a bundler must leave `@delurio/cli` external.
|
|
18
|
+
- The library: `renderPage` and `callLine` (`@delurio/cli/html`) are gone; `delurio page` writes a flow's page. An `Exploration` must come from `explore`, and a graph, a navigation graph or a kit is read once per object (a copy is read again).
|
|
19
|
+
|
|
5
20
|
## 0.10.0 (2026-11-16)
|
|
6
21
|
|
|
7
22
|
- New warning of `check`, which fails nothing: `role-missing`, a node of type `field` or `action` that gives no `role` (SPEC.md §4). A screen reader, a replay and `kit check` find a control by its WAI-ARIA role; before, `kit check` expected such a node's type (`field`, `action`) as its role, which no drawn element can have, so every such node was a mismatch. `@delurio/cli/wireframe`'s `Expectation` says so with `roleGiven`, so a kit check holds that node's name and state only.
|
package/NOTICE
CHANGED
|
@@ -3,3 +3,10 @@ Copyright 2026 delurio Labs
|
|
|
3
3
|
|
|
4
4
|
This product includes software developed by delurio Labs
|
|
5
5
|
and its contributors.
|
|
6
|
+
|
|
7
|
+
The delurio binary and the npm package's addons include:
|
|
8
|
+
- elkjs 0.12.1 (https://github.com/kieler/elkjs), the Eclipse Layout Kernel compiled to JavaScript, under the
|
|
9
|
+
Eclipse Public License 2.0: crates/delurio-page/vendor/elkjs/ holds it unchanged with its LICENSE.md and SOURCE;
|
|
10
|
+
- QuickJS-NG (https://github.com/quickjs-ng/quickjs), through the rquickjs crate, under the MIT License, which runs it.
|
|
11
|
+
Each Rust crate they are built from keeps its own licence (cargo metadata lists them; all are MIT, Apache-2.0 or both,
|
|
12
|
+
or similarly permissive).
|
package/README.md
CHANGED
|
@@ -2,30 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
The open checker and page of **delurio-graph/0**, a format for writing a product's flows, screens and API as one graph that people review in words, that is checked against the code, replayed on the real app and turned into tutorials. The format is [SPEC.md](SPEC.md).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`delurio` is the part a project's own CI runs. It reads graph files and nothing else: there is no network, no account and no model. It is written in Rust and ships as a binary, a container image and an npm package, all built from the same tag. [CHANGELOG.md](CHANGELOG.md) says what each release changed.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
`delurio` is one program with no runtime of its own to install. Pin an exact version in a project, in whichever way it
|
|
10
|
+
already installs its tools:
|
|
10
11
|
|
|
11
12
|
```sh
|
|
12
|
-
|
|
13
|
+
npm install --save-dev --save-exact @delurio/cli # then: npx delurio check graphs --strict
|
|
14
|
+
cargo install --locked --git https://github.com/delurio-labs/delurio --tag v<x.y.z> delurio # then: delurio check graphs --strict
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
or
|
|
17
|
+
or download the binary of your platform from the [releases](https://github.com/delurio-labs/delurio/releases) (Linux
|
|
18
|
+
x64 and arm64, glibc and musl; macOS arm64; Windows x64; each release lists their SHA-256 in `SHA256SUMS`), or
|
|
19
|
+
run the container image, pinned by its digest (the binary alone, `FROM scratch`):
|
|
16
20
|
|
|
17
21
|
```sh
|
|
18
|
-
|
|
19
|
-
npx delurio check graphs --strict
|
|
22
|
+
docker run --rm -v "$PWD:/work" -w /work ghcr.io/delurio-labs/delurio@sha256:<digest> check graphs --strict
|
|
20
23
|
```
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
The npm package installs a prebuilt addon of your platform (one of the `@delurio/cli-<platform>` packages, chosen by
|
|
26
|
+
npm, with no install script) and needs Node 26 or later. Running it once without installing works too:
|
|
27
|
+
`npx @delurio/cli@<x.y.z> check graphs --strict`.
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
docker run --rm -v "$PWD:/work" -w /work ghcr.io/delurio-labs/delurio@sha256:<digest> check graphs --strict
|
|
26
|
-
```
|
|
29
|
+
Each of them can be checked against the release that built it:
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
- a binary: `sha256sum --check --ignore-missing SHA256SUMS`, with the release's `SHA256SUMS` beside it;
|
|
32
|
+
- the npm packages carry npm provenance from the release workflow: `npm audit signatures` in the project that
|
|
33
|
+
installed them;
|
|
34
|
+
- the image is signed with cosign by the repository's workflows:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
cosign verify ghcr.io/delurio-labs/delurio@sha256:<digest> \
|
|
38
|
+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
|
39
|
+
--certificate-identity-regexp '^https://github.com/delurio-labs/delurio/\.github/workflows/(release|image-sign)\.yml@'
|
|
40
|
+
```
|
|
29
41
|
|
|
30
42
|
## Check every graph
|
|
31
43
|
|
|
@@ -97,25 +109,27 @@ A kit (SPEC.md §8) says how the components of `ui.yaml` look in one product, so
|
|
|
97
109
|
|
|
98
110
|
## Write a graph in an editor
|
|
99
111
|
|
|
100
|
-
The package ships a JSON Schema (2020-12) for each kind of graph file in `schemas/`: `flow`, `ui`, `nav` (also `nav.extracted.yaml`), `domain`, `catalog`, `needs
|
|
112
|
+
The npm package ships a JSON Schema (2020-12) for each kind of graph file in `schemas/`: `flow`, `ui`, `nav` (also `nav.extracted.yaml`), `domain`, `catalog`, `needs`, `gaps` (`needs.gaps.yaml`) and `binding` (`binding.yaml` and a shared `<name>.binding.yaml`). With them an editor completes keys, explains each one from SPEC.md on hover, and marks a typo, a value of the wrong kind, or a title cut short by a comma inside `{ }`. In VS Code, with the YAML extension, put this in `.vscode/settings.json`, with the version your project pins in
|
|
113
|
+
place of 0.12.0 (a schema from an older release does not know the keys added since):
|
|
101
114
|
|
|
102
115
|
```json
|
|
103
116
|
{
|
|
104
117
|
"yaml.schemas": {
|
|
105
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
106
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
107
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
108
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
109
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
110
|
-
"https://unpkg.com/@delurio/cli@0.
|
|
118
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/flow.schema.json": "**/flow.yaml",
|
|
119
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/ui.schema.json": "**/ui.yaml",
|
|
120
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/nav.schema.json": ["**/nav.yaml", "**/nav.extracted.yaml"],
|
|
121
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/domain.schema.json": ["**/domain.yaml", "**/domain/*.yaml"],
|
|
122
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/needs.schema.json": "**/needs.yaml",
|
|
123
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/gaps.schema.json": "**/needs.gaps.yaml",
|
|
124
|
+
"https://unpkg.com/@delurio/cli@0.12.0/schemas/binding.schema.json": ["**/binding.yaml", "**/*.binding.yaml"]
|
|
111
125
|
},
|
|
112
126
|
"json.schemas": [
|
|
113
|
-
{ "fileMatch": ["**/catalog/*.json"], "url": "https://unpkg.com/@delurio/cli@0.
|
|
127
|
+
{ "fileMatch": ["**/catalog/*.json"], "url": "https://unpkg.com/@delurio/cli@0.12.0/schemas/catalog.schema.json" }
|
|
114
128
|
]
|
|
115
129
|
}
|
|
116
130
|
```
|
|
117
131
|
|
|
118
|
-
A domain may be split across the files of its directory (SPEC.md §5); `**/domain/*.yaml` covers them in a directory named `domain`, and a file elsewhere names its schema on its first line: `# yaml-language-server: $schema=<the domain schema's URL>`. With the package installed, `./node_modules/@delurio/cli/schemas/<kind>.schema.json` works the same, offline. `check` reports the same as the editor, as errors of the rule `schema` that fail `--strict`, and finds what a schema cannot see, such as a state that does not exist or a catalog key that is missing.
|
|
132
|
+
The binding schema is in 0.12.0 and later. A domain may be split across the files of its directory (SPEC.md §5); `**/domain/*.yaml` covers them in a directory named `domain`, and a file elsewhere names its schema on its first line: `# yaml-language-server: $schema=<the domain schema's URL>`. With the package installed, `./node_modules/@delurio/cli/schemas/<kind>.schema.json` works the same, offline. `check` reports the same as the editor, as errors of the rule `schema` that fail `--strict`, and finds what a schema cannot see, such as a state that does not exist or a catalog key that is missing.
|
|
119
133
|
|
|
120
134
|
Next to the editor, keep the pages open and current:
|
|
121
135
|
|
|
@@ -135,7 +149,7 @@ This prints Markdown for a pull request. It covers what the flow does differentl
|
|
|
135
149
|
|
|
136
150
|
## As a library
|
|
137
151
|
|
|
138
|
-
A tool built on the format can use the same loader and checker the CLI uses:
|
|
152
|
+
A tool built on the format can use the same loader and checker the CLI uses, from Node:
|
|
139
153
|
|
|
140
154
|
```ts
|
|
141
155
|
import { load } from '@delurio/cli/graph';
|
|
@@ -145,7 +159,9 @@ const g = load('graphs/billing/billing.payment');
|
|
|
145
159
|
const configurations = explore(new Model(g.flow)).configs.length;
|
|
146
160
|
```
|
|
147
161
|
|
|
148
|
-
The entry points are `graph`, `model`, `story`, `wireframe`, `kit`, `edges`, `html`, `nav`, `expr`, `yaml` and `needs`, each with its types. `yaml` reads a graph file's text as the CLI does (`readYaml`), refusing what SPEC.md §1 rules out before the text is resolved; a server that reads graphs it was sent should read them with it. `needs` reads a flow's needs (`readNeeds`) and gives the states and nodes that only missing needs are drawn as (`planned`), which a tool that walks the flow on the app leaves out. While the version is 0.x their API may change in any minor release: pin an exact version.
|
|
162
|
+
The entry points are `graph`, `model`, `story`, `wireframe`, `kit`, `edges`, `html`, `nav`, `expr`, `spine`, `yaml` and `needs`, each with its types. They run the checker's Rust code in a native addon: values go in and come out as plain JavaScript objects, callbacks (`load`'s readers, `explore`'s `keep`, `evaluate`'s lookup, the warnings) are called as the code reaches them, and errors are real `GraphError`, `ModelError` and `KitError` instances. `renderSpine` lays the diagram out with the package's own elkjs. Under Node's permission model a process that imports them needs `--allow-addons`, and a bundler must leave `@delurio/cli` (and `@delurio/cli-*`) external. `yaml` reads a graph file's text as the CLI does (`readYaml`), refusing what SPEC.md §1 rules out before the text is resolved; a server that reads graphs it was sent should read them with it. `needs` reads a flow's needs (`readNeeds`) and gives the states and nodes that only missing needs are drawn as (`planned`), which a tool that walks the flow on the app leaves out. While the version is 0.x their API may change in any minor release: pin an exact version.
|
|
163
|
+
|
|
164
|
+
The Rust crates are the same code for a Rust program: `delurio-core` (the graph, the model, every rule of `check`, `diff`), `delurio-page` (the page) and `delurio` (the command line).
|
|
149
165
|
|
|
150
166
|
## Licence
|
|
151
167
|
|
package/SPEC.md
CHANGED
|
@@ -181,6 +181,7 @@ rules: [ { id, rule } ]
|
|
|
181
181
|
| `repeat` | the node is drawn once per item of this data (`request.scopes`) |
|
|
182
182
|
| `frame` | for a page: whether it may be framed (`never`) |
|
|
183
183
|
| `value` | on a field: what it holds when it is shown, until someone types in it: `{ key, params }`, `{ literal }` or `{ oneOf }`; `{ literal: "" }` is an empty field |
|
|
184
|
+
| `holds` | the field of the flow's domain whose value the node shows, or a control takes: `<Entity>.<field>`. A node that holds a field whose `sensitivity` the binding's `mask` names, `credential` unless it says, is masked wherever the flow's screens are recorded (§7) |
|
|
184
185
|
| `checked` | on a node whose role is `checkbox`, `menuitemcheckbox`, `menuitemradio`, `option`, `radio` or `switch`: whether it is checked (an `option`: selected) when it is shown, as an expression over the context (§3), or `true` or `false` |
|
|
185
186
|
| `script` | on a page: how much of it works without JavaScript. `optional`: the page and its actions; `actions`: the page is drawn and read without it, and only its actions need it. Without `script`, the page needs JavaScript |
|
|
186
187
|
| `source` | the code that draws it |
|
|
@@ -221,6 +222,8 @@ A state that `focus` names that is not a state of the flow keeps the graph from
|
|
|
221
222
|
|
|
222
223
|
While scripts do not run, an action of a page marked `actions` is not there, or it is there disabled and says why. A control that looks ready and does nothing when pressed, a dead button, does not meet this. The app may leave the control out of the page it draws on the server and add it when its script runs, or draw it disabled (`disabled`, or `aria-disabled="true"`) with an accessible description that gives the reason, such as that it needs JavaScript (a `<noscript>` note that `aria-describedby` points at). So in such a state the `--no-js` walk checks each action node the state shows (`type: action`): it is not visible, or it is disabled and its accessible description (Accessible Name and Description Computation 1.2) is not empty. One that is visible and enabled, or disabled with no description, is a mismatch.
|
|
223
224
|
|
|
225
|
+
`holds` says which field of the flow's domain (§5) a node holds: the value a text shows, such as a client's name in a heading, or the value a field takes, such as a password or an API key typed into it. It names an entity of the domain and one of its fields, `<Entity>.<field>`, as `references` names an entity. So the screens say where a value the domain marks with `sensitivity` is shown or typed, and a tool that records them knows what to keep out: a recording masks every node that holds a field whose `sensitivity` the binding's `mask` names, `credential` unless it says (§7). `check` holds each `holds` to the domain the flow names, found as for `invoke` (§5): an entity the domain does not have, a field the entity does not have, or a domain that is not found beside the flow, is an error (`holds-unknown`) at the `holds`; an entity none of whose files gives `fields` yet is not held to them. `maskedNodes(g, mask)` in `@delurio/cli/graph` names the nodes of a graph that a recording masks, in the order of `nodes`, for the binding's `mask` (`[credential]` when it is left out).
|
|
226
|
+
|
|
224
227
|
The `schema` rule refuses `value` on a node that is not a field, `checked` on a node of another role, `script` on a node that is not a page, and a node called `opener`. A `checked` or a `disabledWhen` expression that names neither a variable, a guard nor `state` keeps the graph from loading. A `value` from the catalog is held as a node's text is (`catalog-key-missing`, `sample-missing`).
|
|
225
228
|
|
|
226
229
|
### Catalog
|
|
@@ -366,6 +369,10 @@ notModeled: [ "..." ]
|
|
|
366
369
|
|
|
367
370
|
A **binding** ties a flow to a running app for replay and recording: `apps` (base addresses), `browser`, `data` (JSON or dotenv sources, read again after each command, secrets masked in reports), `signIn`, `accounts`, `scenarios` (each a `given` start, the account, the page to `open`, `setup` and `teardown`, `javaScript: false` for a walk with JavaScript off, and `enter`, the way the walk comes in), `events` (the actions that cause an event no node on screen sends), `effects` (the checks of what a step changes outside the screen), `states` (a URL glob or a text a state must show, the server `call` a step makes, the account `as` whose screen it is, and `before` actions) and `nodes` (a locator for a node that role and name cannot find, or `before` actions such as opening a menu, `count` for how many elements it finds, or `skip` with a reason). It may `extends` a shared binding. An action is one of `goto`, `reload`, `click`, `fill`, `attach`, `key`, `waitUrl`, `waitText`, `waitResponse`, `run` (a command, with `expect`), and any action may carry `as`. A locator is `frame`, `role`, `name`, `text`, `label`, `testId`, `css`, `hasText`, `within`, `nth`; `frame` is the CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form, and is looked in first; a string between slashes is a regular expression.
|
|
368
371
|
|
|
372
|
+
`schemas/binding.schema.json` gives every key a replay reads, of a flow's binding and of a navigation graph's (one with `nav`, `setup`, `personas`, `frames`, `pages` or `entries`). `check` holds `binding.yaml`, and a shared binding named `<name>.binding.yaml`, to it, as it holds every graph file to its kind's schema (rule `schema`): a key that is not one, such as a misspelt `scenarios` that a replay would pass over, a value of the wrong kind, an action with two verbs or none, `expect` without `run`, a state's `fail` without its `call`, and a `setup` that does more than run commands. A file that `extends` another may leave out what that one gives, so the schema asks only for `kind`. What the binding names in the graph, a state, an event, a node, a context variable, an account, is held to it when a replay loads the binding: `replay --check` loads it and plans its walks with no browser and no app.
|
|
373
|
+
|
|
374
|
+
**What a recording masks.** A recording, a video made from it, and a replay's screenshots never show the value of a node that holds a field whose `sensitivity` the binding's `mask` names (§4, `holds`; §5). `mask` is a list of the sensitivities `credential`, `personal` and `internal`; left out, it is `[credential]`. `mask: [credential, personal]` also keeps people's names and addresses out, for a recording made on an app whose data is real; `mask: []` masks nothing, for a tutorial filmed with an account and a password made up for it, whose fields it shows being filled. In every frame and every screenshot of a state that shows such a node, each element its locator finds is blurred, so that what it shows or what is typed into it cannot be read, whether or not the value came from the binding's `data`. A node that is not shown in a state is not looked for there. A recorder that cannot find such a node's element where its state shows it does not leave it unmasked: the step fails, as a node not found does.
|
|
375
|
+
|
|
369
376
|
`fill` types its value into a field. A native `<select>` cannot be typed in, so on one `fill` chooses the option whose visible text is the value; a value that no option shows fails the step, and the failure lists the options there are. `attach` gives a file input its files, in one of two forms. `attach: { <locator>, file: <path> | [<path>, ..] }` gives it fixtures, each a path relative to the binding's file and inside its folder: a path that is absolute, that climbs above the folder with `..`, that does so once its `{placeholders}` are filled in, or that is a link to a file outside the folder is refused. `attach: { <locator>, run: [<command>, <argument>, ..], fileName: <name>, mimeType: <media type> }` gives it what a helper writes to its standard output, as a file of that name: `run` is the command and its arguments, as a list, run with no shell, and the file's media type is `mimeType`, or else follows from the name's extension. Where the locator finds something other than an `<input type="file">`, such as a button drawn over a hidden input, the replay presses it and gives the files to the file chooser it opens.
|
|
370
377
|
|
|
371
378
|
`as: <account>` on an action does it in that account's own browser, with its own cookies, opened and signed in the first time it is used: a step another person takes, such as a second member who approves or an invitee who accepts, is bound to actions `as` that person, and the walk goes on in the first browser after them. A state may carry `as` too: its screen is that person's, so it is checked, and its nodes are pressed, in their browser, while a state without `as` is the scenario's own account's. A state's `before: [actions]` runs when the walk reaches the state, before it is checked, such as that person opening the link an e-mail brought them. So a step another person takes after arriving by a mailed link is bound to its state: `as` the invitee, `before` opening the link. `effects: { <id>: [actions] }` checks what a step leaves outside the screen, such as an e-mail sent or a row written. `<id>` is an effect of the flow (§2) or an action of its domain (§5): the actions run after the walk takes a transition that applies that effect, or after a state that invokes that action ends with `DONE`. They are checks, typically a `run` with `expect` that reads a mail catcher's API or queries the database, and one that fails is a mismatch at that step.
|
|
@@ -422,7 +429,7 @@ A kit says how the components of `ui.yaml` look in one product: `tokens` and `da
|
|
|
422
429
|
|---|---|
|
|
423
430
|
| 0 | the graph loads and, under `--strict`, nothing is wrong |
|
|
424
431
|
| 1 | the graph cannot be loaded: a YAML error, unsupported YAML (§1), an unknown state, an unknown name in an expression or one that does not parse, a non-exhaustive `always`, an unsupported construct, a `ui.yaml` that names no catalog or a catalog that is not there or not JSON (§4) |
|
|
425
|
-
| 2 | under `--strict`: an assertion is violated, a state no situation reaches or a state that is no exit and has no way out (§2), a catalog key is missing from a locale's catalog or a sample value from the samples, a component has no renderer, the kit does not cover a component, the main story cannot be walked, the focus goes to a node that is not shown or a `returnsFocus` does not start at a dialog (§4), a domain's files clash, a server function has what only a route has, a domain names an entity or a field it does not have, a policy names an action or an entity its domain does not have, or a flow invokes an action its domain does not have, names a domain that is not found, or lists a failure code that is neither a refusal of its action nor a transport code, or a planned entity or action names its code (§5), a tutorial no longer matches its flow (§7), a state of a captured flow names no code or an anchor does not resolve (§9), or a need's evidence does not resolve, a need that is not missing names none, or a product's gaps and its needs disagree (§13) |
|
|
432
|
+
| 2 | under `--strict`: an assertion is violated, a state no situation reaches or a state that is no exit and has no way out (§2), a catalog key is missing from a locale's catalog or a sample value from the samples, a component has no renderer, the kit does not cover a component, the main story cannot be walked, the focus goes to a node that is not shown or a `returnsFocus` does not start at a dialog (§4), a domain's files clash, a server function has what only a route has, a domain names an entity or a field it does not have, a policy names an action or an entity its domain does not have, or a flow invokes an action its domain does not have, names a domain that is not found, or lists a failure code that is neither a refusal of its action nor a transport code, or a node holds a field its flow's domain does not have (§4), or a planned entity or action names its code (§5), a tutorial no longer matches its flow (§7), a state of a captured flow names no code or an anchor does not resolve (§9), or a need's evidence does not resolve, a need that is not missing names none, or a product's gaps and its needs disagree (§13) |
|
|
426
433
|
|
|
427
434
|
**Where the code is.** What a graph names of the application is read from the application's repository root: the folder `check --app <dir>` names, or else the folder `check` runs in, as a CI runs it at the root of the repository it checked out. That is every `source:` anchor and every citation in words (§9), and a need's `source`, `test` and `setting`, and a `scenario` whose binding is named by its path (§13). A check that has a project's graphs without its code, such as the panel's check of a graphs folder alone, says `--no-app`: none of these is looked for, and rather than a finding for each, the output says once how many were not, on a line before the summary in text and as a notification of the run (`toolExecutionNotifications`, at the level `note`) in SARIF, as `check examples --no-app` gives it:
|
|
428
435
|
|
package/js/changes.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// types only, for html.d.ts: the domain a flow names (the module is internal to the checker)
|
|
2
|
+
export interface DomainAction {
|
|
3
|
+
route?: string;
|
|
4
|
+
serverFn?: string;
|
|
5
|
+
result?: {
|
|
6
|
+
returns?: string;
|
|
7
|
+
};
|
|
8
|
+
sideEffects?: unknown[];
|
|
9
|
+
}
|
|
10
|
+
export interface Domain {
|
|
11
|
+
id?: string;
|
|
12
|
+
actions?: Record<string, DomainAction | null>;
|
|
13
|
+
policies?: Array<{
|
|
14
|
+
do?: string[];
|
|
15
|
+
write?: string[];
|
|
16
|
+
}>;
|
|
17
|
+
}
|
package/js/cli.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// delurio: the open checker and page of delurio-graph/0 (SPEC.md). The command line is the Rust one, run in this
|
|
3
|
+
// process by the addon; it writes to this process's stdout and stderr and gives the exit code.
|
|
4
|
+
import native from './native.cjs';
|
|
5
|
+
|
|
6
|
+
process.exitCode = native.runCli(process.argv.slice(2));
|
package/{dist → js}/edges.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Graph, State } from './graph.
|
|
2
|
-
import type { Exploration } from './model.
|
|
1
|
+
import type { Graph, State } from './graph.js';
|
|
2
|
+
import type { Exploration } from './model.js';
|
|
3
3
|
export type EdgeKind = 'user' | 'system' | 'route' | 'fail';
|
|
4
4
|
export interface VizEdge {
|
|
5
5
|
from: string;
|
package/js/edges.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// The edges a flow's diagrams draw, merged by their ends, and the words of their nodes: what a person presses, where
|
|
2
|
+
// an exit leaves them, a step's response in one line. The checker is the Rust one (crates/delurio-core/src/edges.rs).
|
|
3
|
+
import { json, native, nativeExploration, nativeGraph } from './internal.js';
|
|
4
|
+
|
|
5
|
+
export const BY = JSON.parse(native.edgesConstants());
|
|
6
|
+
|
|
7
|
+
export function kindOf(g, name) {
|
|
8
|
+
return native.kindOf(nativeGraph(g), String(name));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function exitLine(st) {
|
|
12
|
+
return native.exitLine(st === undefined ? undefined : json(st));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// a step's `response` in one line: the status, the code and the redirect first, then the other fields
|
|
16
|
+
export function responseLine(r) {
|
|
17
|
+
return native.responseLine(json(r ?? {}));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function nodeLine(g, name) {
|
|
21
|
+
return native.nodeLine(nativeGraph(g), String(name));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// visible text for a catalog key, with {placeholders} filled from the samples
|
|
25
|
+
export function plain(g, key) {
|
|
26
|
+
return native.plain(nativeGraph(g), String(key));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// the button or link text a person presses to send `event` while in `state`, if there is one
|
|
30
|
+
export function pressLabel(g, state, event) {
|
|
31
|
+
return native.pressLabel(nativeGraph(g), String(state), String(event)) ?? null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function wrap(text, max) {
|
|
35
|
+
return native.wrap(String(text), Number(max));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function collectEdges(g, ex) {
|
|
39
|
+
return JSON.parse(native.collectEdges(nativeGraph(g), nativeExploration(ex)));
|
|
40
|
+
}
|
package/js/expr.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// The guard and assertion language: a small, fixed subset, interpreted without eval.
|
|
2
|
+
// or / and / not, == / != / in / not in, parentheses, [lists], 'strings', numbers, true / false / null, names.
|
|
3
|
+
// The checker is the Rust one (crates/delurio-core/src/expr.rs).
|
|
4
|
+
import { Trap, call, native } from './internal.js';
|
|
5
|
+
|
|
6
|
+
const cache = new Map();
|
|
7
|
+
|
|
8
|
+
export function parseExpr(src) {
|
|
9
|
+
const hit = cache.get(src);
|
|
10
|
+
if (hit !== undefined) return hit;
|
|
11
|
+
const e = JSON.parse(call(null, () => native.parseExpr(String(src))));
|
|
12
|
+
cache.set(src, e);
|
|
13
|
+
return e;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// `lookup` is called for each name the expression reads, as it reads them; what it throws reaches the caller
|
|
17
|
+
export function evaluate(e, lookup) {
|
|
18
|
+
const t = new Trap();
|
|
19
|
+
return JSON.parse(call(t, () => native.evaluate(JSON.stringify(e), t.lookup(lookup))));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function identifiers(e, out = new Set()) {
|
|
23
|
+
for (const name of native.identifiers(JSON.stringify(e))) out.add(name);
|
|
24
|
+
return out;
|
|
25
|
+
}
|
package/{dist → js}/graph.d.ts
RENAMED
|
@@ -98,6 +98,7 @@ export interface UiNode {
|
|
|
98
98
|
repeat?: string;
|
|
99
99
|
frame?: string;
|
|
100
100
|
value?: Label;
|
|
101
|
+
holds?: string;
|
|
101
102
|
checked?: boolean | string;
|
|
102
103
|
script?: 'optional' | 'actions';
|
|
103
104
|
source?: string;
|
|
@@ -152,6 +153,8 @@ export declare function transitionPath(state: string, st: State, event: string |
|
|
|
152
153
|
export declare function humanize(id: string): string;
|
|
153
154
|
export declare function titleOf(flow: Flow, state: string): string;
|
|
154
155
|
export declare function shownIn(n: UiNode, state: string): boolean;
|
|
156
|
+
export type Sensitivity = 'credential' | 'personal' | 'internal';
|
|
157
|
+
export declare function maskedNodes(g: Graph, mask?: readonly Sensitivity[]): string[];
|
|
155
158
|
export interface FocusAfter {
|
|
156
159
|
node: string;
|
|
157
160
|
by: 'returnsFocus' | 'initialFocus' | 'focus';
|
package/js/graph.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// A graph as `load` reads it from its folder: flow.yaml, ui.yaml and the catalog ui.yaml names (SPEC.md §2-§4), and
|
|
2
|
+
// the readers of its parts. The checker is the Rust one (crates/delurio-core/src/graph.rs), run in the addon.
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { GraphError, Trap, call, json, native, nativeGraph, nativeValue, placed, rememberGraph, warnings } from './internal.js';
|
|
6
|
+
|
|
7
|
+
export { GraphError, placed };
|
|
8
|
+
|
|
9
|
+
const constants = JSON.parse(native.graphConstants());
|
|
10
|
+
|
|
11
|
+
// in a returnsFocus, the node that was pressed to open the dialog (SPEC.md §4)
|
|
12
|
+
export const OPENER = constants.OPENER;
|
|
13
|
+
|
|
14
|
+
// the roles whose node may say whether it is `checked`
|
|
15
|
+
export const CHECKABLE = constants.CHECKABLE;
|
|
16
|
+
|
|
17
|
+
export const isDialog = (n) => native.isDialogNode(n === undefined ? undefined : JSON.stringify(n));
|
|
18
|
+
|
|
19
|
+
// the place of a transition in flow.yaml: `on.<event>`, the item of a list of alternatives, or an item of `always`
|
|
20
|
+
export function transitionPath(state, st, event, i) {
|
|
21
|
+
return native.transitionPathOf(String(state), json(st ?? {}), event === null || event === undefined ? undefined : String(event), i);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 'silentRedirect' -> 'Silent redirect'; used only when the graph gives no title
|
|
25
|
+
export function humanize(id) {
|
|
26
|
+
return native.humanize(String(id));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function titleOf(flow, state) {
|
|
30
|
+
return native.titleOfState(nativeValue(flow), String(state));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// a node is shown in a state when the state is in its `in` and not in its `unless`
|
|
34
|
+
export function shownIn(n, state) {
|
|
35
|
+
return native.shownInState(json(n ?? {}), String(state));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// The node that has focus once the flow has moved from the state `from` (null when it starts) into another state `to`
|
|
39
|
+
// (SPEC.md §4, Focus). `ui` is read as it is at the call.
|
|
40
|
+
// the sensitivities a field may have (SPEC.md §5), which a binding's `mask` names
|
|
41
|
+
const SENSITIVITIES = ['credential', 'personal', 'internal'];
|
|
42
|
+
|
|
43
|
+
// the nodes a recording masks: each node that holds a field of the flow's domain whose sensitivity `mask` names, the
|
|
44
|
+
// binding's (SPEC.md §4, §7): `credential` unless it says, and nothing for []. In the order of the ui's nodes; none
|
|
45
|
+
// when the domain is not found beside the graph.
|
|
46
|
+
export function maskedNodes(g, mask = ['credential']) {
|
|
47
|
+
if (!Array.isArray(mask)) throw new TypeError('maskedNodes: mask is a list of sensitivities');
|
|
48
|
+
for (const s of mask)
|
|
49
|
+
if (!SENSITIVITIES.includes(s))
|
|
50
|
+
throw new TypeError(`maskedNodes: ${String(s)} is not a sensitivity (${SENSITIVITIES.join(', ')})`);
|
|
51
|
+
return native.maskedNodesOf(nativeGraph(g), [...mask]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function focusAfter(ui, from, to, pressed) {
|
|
55
|
+
return JSON.parse(native.focusAfterStep(json(ui), from ?? undefined, String(to), pressed ?? undefined));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function alternatives(spec) {
|
|
59
|
+
if (spec === undefined) return [undefined];
|
|
60
|
+
return JSON.parse(native.alternativesOf(json(spec)));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// `read` and `exists` take a path relative to `dir`; the revision diff passes ones that read a git revision instead of the disk
|
|
64
|
+
export function load(dir, read = (file) => readFileSync(join(dir, file), 'utf8'), exists = (file) => existsSync(join(dir, file))) {
|
|
65
|
+
const t = new Trap();
|
|
66
|
+
try {
|
|
67
|
+
const n = call(t, () => native.load(String(dir), t.reader(read), t.exister(exists)));
|
|
68
|
+
return rememberGraph(JSON.parse(n.json()), n);
|
|
69
|
+
} finally {
|
|
70
|
+
warnings();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
package/{dist → js}/html.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Graph } from './graph.
|
|
2
|
-
import type { AssertionResult, Exploration, FinalPath, Model } from './model.
|
|
3
|
-
import type { Story } from './story.
|
|
4
|
-
import type { Kit } from './kit.
|
|
5
|
-
import type { HandOver } from './starts.
|
|
6
|
-
import type { Domain, DomainAction } from './changes.
|
|
1
|
+
import type { Graph } from './graph.js';
|
|
2
|
+
import type { AssertionResult, Exploration, FinalPath, Model } from './model.js';
|
|
3
|
+
import type { Story } from './story.js';
|
|
4
|
+
import type { Kit } from './kit.js';
|
|
5
|
+
import type { HandOver } from './starts.js';
|
|
6
|
+
import type { Domain, DomainAction } from './changes.js';
|
|
7
7
|
export declare const CSS = "\n:root { --bg:#fafaf9; --surface:#ffffff; --ink:#1c1917; --muted:#6b6560; --line:#d6d3d1; --accent:#1d4ed8; --accent-bg:#eef3ff; --ok:#15803d; --bad:#b91c1c; --server:#eeeeec; --focus:#1d4ed8; --ai:#7e22ce; --ai-bg:#f5edff; --agent:#c2410c; --agent-bg:#fff1e8; --ci:#0f766e; --ci-bg:#e6f6f3; --ok-bg:#eaf7ee; }\n@media (prefers-color-scheme: dark) { :root { --bg:#161513; --surface:#1f1d1b; --ink:#f2efec; --muted:#a8a29e; --line:#44403c; --accent:#8fb0ff; --accent-bg:#1c2438; --ok:#5fcf85; --bad:#f08080; --server:#2a2826; --focus:#8fb0ff; --ai:#c99bff; --ai-bg:#2a2135; --agent:#ff9a66; --agent-bg:#33241b; --ci:#5fd4c4; --ci-bg:#1a2e2b; --ok-bg:#16291d; } }\n* { box-sizing: border-box; }\nbody { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, \"Segoe UI\", sans-serif; }\nmain { max-width: 1000px; margin: 0 auto; padding: 28px 16px 80px; }\nh1 { font-size: 30px; line-height: 1.2; margin: 6px 0 8px; } h2 { font-size: 21px; margin: 44px 0 12px; } h3 { font-size: 16px; margin: 0; }\ncode, pre, .mono { font-family: ui-monospace, \"SF Mono\", Menlo, Consolas, monospace; font-size: 13px; }\n.muted { color: var(--muted); } .label { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }\n.eyebrow { margin: 0; color: var(--muted); } .lede { font-size: 18px; max-width: 46em; margin: 0; }\n.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 99px; font-size: 12px; color: var(--muted); vertical-align: middle; }\n.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }\ntable { border-collapse: collapse; width: 100%; } th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); } th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); } tr:last-child td { border-bottom: 0; }\ntd ol { margin: 0; padding-left: 20px; }\n.ok { color: var(--ok); font-weight: 600; } .bad { color: var(--bad); font-weight: 600; }\n.story { margin-top: 28px; padding: 18px 22px; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 10px; background: var(--surface); }\n.story h2 { margin: 0 0 6px; } .story .given { margin: 0 0 8px; } .story ol { margin: 0; padding-left: 26px; } .story li { margin: 5px 0; padding-left: 4px; } .story .result { margin: 10px 0 0; font-weight: 600; }\n.views input { margin-right: 8px; accent-color: var(--accent); } .views label { display: inline-block; margin: 0 0 10px; cursor: pointer; }\n.views .panel-full { display: none; } .views input:checked ~ .panel-main { display: none; } .views input:checked ~ .panel-full { display: block; }\nsvg.spine { display: block; width: 100%; height: auto; padding: 8px; background: var(--surface); margin: 0 auto; }\n.spine .edge { fill: none; stroke-width: 1.5; } .spine .edge-user { stroke: var(--muted); } .spine .edge-system { stroke: var(--muted); } .spine .edge-route { stroke: var(--muted); stroke-dasharray: 2 4; } .spine .edge-fail { stroke: var(--bad); stroke-dasharray: 7 4; } .spine .edge-unused { stroke: var(--line); }\n.spine .edge-main { stroke: var(--accent); stroke-width: 3.5; stroke-dasharray: none; }\n.spine .arrow { fill: var(--muted); } .spine .arrow-fail { fill: var(--bad); } .spine .arrow-main { fill: var(--accent); }\n.spine .elabel rect { fill: var(--surface); stroke: var(--line); } .spine .elabel text { fill: var(--ink); font: 13px system-ui, sans-serif; } .spine .elabel-fail text { fill: var(--bad); } .spine .elabel-main rect { stroke: var(--accent); }\n.spine .node rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; } .spine .node-server rect { fill: var(--server); stroke: var(--muted); stroke-dasharray: 5 3; }\n.spine .node-subflow rect { stroke: var(--accent); } .spine .node-subflow rect.inner { fill: none; stroke-width: 1; }\n.spine .on-main rect { stroke-width: 3; } .spine .node-server.on-main rect { stroke: var(--accent); }\n.spine .exit-never rect { stroke: var(--bad); stroke-width: 3; } .spine .exit-error rect { stroke-dasharray: 6 3; } .spine .exit-left rect { stroke-dasharray: 2 3; stroke: var(--muted); } .spine .exit-success rect { stroke: var(--ok); stroke-width: 3; }\n.spine .node.by-human rect { fill: var(--surface); stroke: var(--ink); stroke-dasharray: none; }\n.spine .node.by-ai rect { fill: var(--ai-bg); stroke: var(--ai); stroke-dasharray: none; }\n.spine .node.by-agent rect { fill: var(--agent-bg); stroke: var(--agent); stroke-dasharray: none; } .spine .node.by-agent rect.inner { fill: none; stroke-width: 1; }\n.spine .node.by-ci rect { fill: var(--ci-bg); stroke: var(--ci); stroke-dasharray: none; }\n.spine .node.goal rect { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 3.5; stroke-dasharray: none; }\n.spine .node.on-main rect { stroke-width: 3.5; }\n.spine .nmore { fill: var(--muted); font: 600 11px system-ui, sans-serif; }\n.legend .sw { display: inline-flex; align-items: center; gap: 6px; } .legend svg { flex: none; }\n.legend .sw-node rect { stroke-width: 1.6; }\n.legend .sw-human rect { fill: var(--surface); stroke: var(--ink); } .legend .sw-ai rect { fill: var(--ai-bg); stroke: var(--ai); } .legend .sw-agent rect { fill: var(--agent-bg); stroke: var(--agent); } .legend .sw-agent rect.inner { fill: none; stroke-width: 1; }\n.legend .sw-ci rect { fill: var(--ci-bg); stroke: var(--ci); } .legend .sw-goal rect { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 3; } .legend .sw-server rect { fill: var(--server); stroke: var(--muted); stroke-dasharray: 4 2; }\n.legend .sw-screen rect { fill: var(--surface); stroke: var(--ink); } .legend .sw-subflow rect { fill: var(--surface); stroke: var(--accent); }\n.legend .sw-node.sw-fail rect { fill: var(--surface); stroke: var(--bad); stroke-width: 3; }\n.legend .sw-line path { fill: none; stroke-width: 3; } .legend .sw-main path { stroke: var(--accent); stroke-width: 3.5; } .legend .sw-fail path { stroke: var(--bad); stroke-dasharray: 6 3; } .legend .sw-route path { stroke: var(--muted); stroke-dasharray: 2 3; }\n.covers { display: grid; gap: 10px; } .covers .cv { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 14px; } .covers ul { margin: 4px 0 0; padding-left: 20px; }\n.spine .node-unreachable rect { stroke: var(--bad); fill: none; }\n.spine .nname { fill: var(--ink); font: 600 14.5px system-ui, sans-serif; } .spine .nline { fill: var(--muted); font: 11.5px ui-monospace, Menlo, Consolas, monospace; } .spine .start { fill: var(--ink); }\n.spine a:focus-visible .node rect, .spine a:hover .node rect { stroke: var(--focus); stroke-width: 3; }\n.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }\n.screens { display: grid; gap: 18px; }\n.screen { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px 16px 16px; scroll-margin-top: 16px; }\n.screen:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }\n.screen header { display: flex; align-items: center; gap: 10px; } .screen > p { margin: 4px 0 10px; }\n.wf { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 10px; background: var(--bg); max-width: 560px; }\n.wf-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px; border-radius: 4px; }\n.wf-cond { outline: 1.5px dashed var(--muted); outline-offset: 2px; } .wf-focus { outline: 2.5px solid var(--focus); outline-offset: 2px; }\n.wf-h { margin: 0; font-size: 17px; } .wf-t { margin: 0; color: var(--muted); }\n.wf-row { display: flex; flex-wrap: wrap; gap: 10px; }\n.wf-btn, .wf-link { font: inherit; border-radius: 6px; padding: 6px 14px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); }\n.wf-confirm { background: var(--ink); color: var(--bg); } .wf-link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; }\n.wf button:disabled { opacity: .45; }\n.wf-list { margin: 0; padding-left: 20px; display: grid; gap: 2px; }\n.wf-status { color: var(--muted); font-style: italic; } .wf-alert { border: 1.5px solid var(--bad); border-radius: 6px; padding: 6px 10px; }\n.wf-check { display: flex; gap: 8px; align-items: center; } .wf-field { display: grid; gap: 4px; } .wf-input { font: inherit; border: 1px solid var(--muted); border-radius: 6px; padding: 6px 10px; background: var(--surface); color: var(--ink); }\n.wf-unmapped { border: 1.5px solid var(--bad); padding: 6px 10px; }\n.chip { font: 11px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }\ndetails { margin-top: 12px; } summary { cursor: pointer; color: var(--muted); }\ndetails.ax-wrap { margin-top: 10px; } pre.ax { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); line-height: 1.55; }\ndl.guards { margin: 10px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; } dl.guards dt { font-weight: 600; } dl.guards dd { margin: 0; }\nul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } ul.checks li { padding-left: 26px; position: relative; } ul.checks li::before { content: \"\u2713\"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; } ul.checks li.fail::before { content: \"\u2717\"; color: var(--bad); }\nfooter { margin-top: 56px; color: var(--muted); font-size: 13px; }\n";
|
|
8
8
|
export interface PageInput {
|
|
9
9
|
g: Graph;
|
package/js/html.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The page of a flow: its styles, shared with the index and the navigation pages, and the page itself
|
|
2
|
+
// (crates/delurio-page). renderPage and callLine answer with an error until the port of html.ts is in this build.
|
|
3
|
+
import { call, native } from './internal.js';
|
|
4
|
+
|
|
5
|
+
export const CSS = native.pageCss();
|
|
6
|
+
|
|
7
|
+
export function callLine(_a) {
|
|
8
|
+
return call(null, () => native.pageNotPorted('callLine'));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function renderPage(_p) {
|
|
12
|
+
return call(null, () => native.pageNotPorted('renderPage'));
|
|
13
|
+
}
|