@burdenoff/ui-engine 2026.1127.1 → 2026.1127.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.
- package/README.md +35 -0
- package/dist/index-tqffkt91.js +1986 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +174 -2
- package/dist/replay.js +2 -2
- package/dist/script/adapters/browser-action-contract.d.ts +22 -0
- package/dist/script/adapters/from-browser-action.d.ts +7 -0
- package/dist/script/adapters/from-remote-browser.d.ts +7 -0
- package/dist/script/adapters/recording.d.ts +25 -0
- package/dist/script/adapters/to-browser-action.d.ts +8 -0
- package/dist/script/canonical.d.ts +6 -0
- package/dist/script/capabilities.d.ts +29 -0
- package/dist/script/describe.d.ts +83 -0
- package/dist/script/fingerprint.d.ts +9 -0
- package/dist/script/hash.d.ts +3 -0
- package/dist/script/index.d.ts +22 -0
- package/dist/script/json-schema.d.ts +4 -0
- package/dist/script/limits.d.ts +61 -0
- package/dist/script/parse.d.ts +31 -0
- package/dist/script/schema.d.ts +87 -0
- package/dist/script/types.d.ts +489 -0
- package/dist/script/walk.d.ts +29 -0
- package/dist/script.d.ts +2 -0
- package/dist/script.js +175 -0
- package/package.json +11 -4
- package/schema/ui-script-v1.schema.json +8199 -0
- /package/dist/{index-05zgh18g.js → index-n5amgh31.js} +0 -0
package/README.md
CHANGED
|
@@ -22,6 +22,41 @@ Each module is a subpath export, and the root entry re-exports all of them.
|
|
|
22
22
|
| `@burdenoff/ui-engine/capture` | `captureRecording` (turns recorder events into a masked recording), `maskUrl`, `redactCredentials`, `REDACTED` |
|
|
23
23
|
| `@burdenoff/ui-engine/resolve` | `readSnapshotNodes` (array, `{ nodes }` or `{ elements }` snapshots), `resolveTarget` (exact role and label match, `nth` among equals) |
|
|
24
24
|
| `@burdenoff/ui-engine/replay` | The pure replay planner: `replayStateFrom`, `planReplay`, `afterReplayCall`, `finishFallback`, `markFallbackAsked`, `replayReasons`, `readReplayState` |
|
|
25
|
+
| `@burdenoff/ui-engine/script` | UI script v1: types, `uiScriptSchema`, `parseUiScript`, `UI_SCRIPT_SCHEMA_HASH`, `requiredCapabilities`, the adapters and `describeStep` (see below) |
|
|
26
|
+
| `@burdenoff/ui-engine/schema/ui-script-v1.schema.json` | The JSON Schema (draft 2020-12) of UI script v1 |
|
|
27
|
+
|
|
28
|
+
## UI script v1
|
|
29
|
+
|
|
30
|
+
A UI script is the portable form of a UI sequence that a desk runs: a paired browser (the FluidGrids extension), a remote browser driven over CDP by the workers, and later a robot. It is the contract FluidGrids RPA builds on (spec `fluidgrids-specs/product/specs/rpa/03-ARCHITECTURE.md` section 5 and `05-UI_AUTOMATION.md`; plan package P0-04, BOFF-17115).
|
|
31
|
+
|
|
32
|
+
**Shape.** `{ scriptVersion: 1, name?, application?, settings?, inputs?, outputs?, variables?, elements?, steps, cleanup? }`.
|
|
33
|
+
|
|
34
|
+
- A **target** is an ordered list of methods: `role` (accessible role and name, the n-th match; a superset of the Stewards saved-step target), `css`, `testId`, `xpath`, `fuzzy`, `anchor` and `text`, each with an on or off switch, plus an optional frame and shadow-root chain. A step names an inline target or a pinned library element (`{ element: key }`).
|
|
35
|
+
- **Steps** carry an `id` (unique across the script), an action and its fields, and the common options: `intent`, `note`, `saveAs`, `disabled`, `breakpoint`, `timeoutMs`, `retry`, `onError`, `verify`, `screenshot`, `inputMethod`, `safeToRepeat`, `screenshotRef` and `fingerprint`.
|
|
36
|
+
- **Actions.** Web: `navigate`, `goBack`, `reload`, `closeTab`, `click`, `doubleClick`, `hover`, `type`, `typeSecret`, `clear`, `select`, `check`, `pressKey`, `scroll`, `waitFor`, `extract`, `extractList`, `getText`, `getValue`, `getAttribute`, `elementExists`, `getPageText`, `getPageHtml`, `screenshot`, `login`. Desktop (from Stewards recordings): `focusWindow`. Flow: `if`, `forEach`, `while` (a limit is mandatory), `retryScope`, `set`, `log`, `call` (a shared sequence pinned by version; inlined when the worker compiles the script).
|
|
37
|
+
- **Expressions** are JSON trees, never text to evaluate: literals, `{ input }`, `{ var }` (each with an optional `path`), `{ list }`, `{ object }` and `{ op, args }` over a fixed operator list (`UI_EXPRESSION_OPS`, arities in `UI_EXPRESSION_ARITY`).
|
|
38
|
+
- **Secrets** never appear in a script: `typeSecret` holds a reference, and `parseUiScript` refuses credential-shaped text in values, intents, notes, URLs, target texts and selectors, window names, element names and script descriptions.
|
|
39
|
+
- **Fingerprints** cover every target a step holds. A step a Stewards saved step can express is fingerprinted exactly as Stewards does.
|
|
40
|
+
- Optional fields have no zod defaults, so a parsed script is exactly the stored one; each type documents the default an interpreter applies.
|
|
41
|
+
|
|
42
|
+
**Limits** (`limits.ts`): 500 steps including nested and clean-up steps, 1 MiB serialised, flow blocks 8 deep, expressions 16 deep, 8 methods per target, 500 pinned elements, 100 inputs, outputs and variables each.
|
|
43
|
+
|
|
44
|
+
**Parsing.** `parseUiScript(value, { resolved? })` accepts an object or its JSON text and throws `UiScriptError` with a `code` (`INVALID_SCRIPT`, `SCRIPT_TOO_LARGE`, `TOO_MANY_STEPS`, `DUPLICATE_STEP_ID`, `UNKNOWN_ELEMENT`, `UNKNOWN_INPUT`, `FINGERPRINT_MISMATCH`, `CREDENTIAL_IN_SCRIPT`, `UNRESOLVED`) and a `path`. `resolved: true` also requires every pinned element to carry its target and every `call` to be inlined. `safeParseUiScript` returns the result instead of throwing.
|
|
45
|
+
|
|
46
|
+
**Schema hash.** `UI_SCRIPT_SCHEMA_HASH` is the SHA-256 of the canonical JSON of `schema/ui-script-v1.schema.json`. The service returns the hashes it accepts, and a worker refuses to park a script whose hash the service does not accept. After changing `src/script/schema.ts`, run `bun run schema:write` and copy the printed hash into `src/script/hash.ts`; a test fails until both match.
|
|
47
|
+
|
|
48
|
+
**Capabilities.** `requiredCapabilities(script)` returns the sorted ids a desk must support (`script:1`, `action:<action>`, `target:<kind>`, `target:frame`, `step:verify`, `step:retry`, `step:breakpoint`, `input:direct`, `input:hardware`); `CAPABILITY_IDS` lists them all and `missingCapabilities(script, supported)` reports the gap.
|
|
49
|
+
|
|
50
|
+
**Adapters.**
|
|
51
|
+
|
|
52
|
+
| Function | From and to | Notes |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `fromRecording`, `toRecording` | Stewards saved-step recording v1 | Lossless both ways, fingerprints included; `toRecording` returns null for a script a recording cannot express |
|
|
55
|
+
| `fromBrowserActionSteps` | Run in Browser steps (`internal:browser-action`) | Keeps every field a 0.3.0 extension reads |
|
|
56
|
+
| `toBrowserActionSteps` | Lowering to Run in Browser steps | Null unless the script fits the legacy contract: at most 100 steps and 256 KB, only the 14 legacy actions, one CSS selector per target (or one text for click and wait), literal or supplied input values, no script wait or screenshot settings beyond the defaults, and no flow steps, verification, retries or breakpoints |
|
|
57
|
+
| `fromRemoteBrowserSteps` | Remote Browser `runSteps` (`store/remotebrowser` 1.0.0) | Playwright `css=`, `text=`, `xpath=`, `id=` and `data-testid=` selectors; other engines are refused |
|
|
58
|
+
|
|
59
|
+
**Descriptions.** `describeStep(step, elements)` returns `{ key, vars, fallback }`, with keys under `fluidgrids.uiScript.step.*` for `tr(key, vars)` and an English fallback; `UI_SCRIPT_STEP_MESSAGES` holds every English template.
|
|
25
60
|
|
|
26
61
|
## Compatibility with Stewards
|
|
27
62
|
|