M1: script-first (v0.3.0) #4
Loading…
Reference in a new issue
No description provided.
Delete branch "akib/m1-script-first"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
M1 of the plan (docs/IMPLEMENTATION.md): make BlockFlow writable and repairable from scripts, for people and LLMs. Version 0.3.0.
What's in it
src/core/check.ts,suggest.ts): every import is checked first. Each problem gets a stable code, a JSON path into the file as written, and a did-you-mean hint. Errors refuse the file and are listed in a dialog with a Copy button; warnings import with a toast. Blocks can declarevalidaterules, which the editor shows too. The schemas reject unknown keys.src/core/script.ts,layout.ts): a workflow as a list of steps, with branches as nested lists, aliases and shorthands. Compiled scripts are auto-laid out and get the same strict check, with paths pointing at the author's steps (/steps/2/click/locater). The editor adds Tidy up and Export as script.script.schema.jsonis generated, and every guide example also ships as a script.page-snapshotblock return the accessibility tree with a ready-made locator per element, covering frames and shadow DOM. Open Tab gets a "📸 Snapshot page" button that copies the outline.src/core/errors.ts): failed steps recordcode,locator,url,matchesandsourceId(the author's step id). The JSON report is versioned and has a generatedreport.schema.json.locator(wasselector/next). Stored workflows are migrated on load and rewritten once, and old keys are still accepted on import.llms.txtlead with the script format, Repair and error-code tables. There is an eval set of ten authoring tasks (tests/evals), each with a reference solution that an e2e spec imports, runs and scores.Test plan
npm run check: 544 unit/DOM tests; guide, learning examples and wiki links in syncnpm run build,npm run build:firefoxnpm run e2ein Chromium: 14 specs, 154 checks, including the newimport-check,scripts,snapshot-codesandevalsspecs (10/10 reference solutions pass)npm run e2e:firefox: 14 checks pass (Firefox 159). "Read Element with a URL" failed once during development with a missing host permission, then passed on a rerun; it may be flaky.After merge:
npm run wiki:publish.🤖 Generated with Claude Code
src/core/script.ts compiles { format: blockflow-script, steps } into a graph (aliases, shorthands, If rejoin, each/onError branches, ids kept as origin, issues with JSON Pointers and nodePaths) and decompiles tree-shaped graphs back, verified by recompiling. src/core/layout.ts lays graphs out in layers. Import accepts scripts (one branch in parseImport) and lays out graph files without positions; the editor gets Tidy up and Export as script. docs/guide/script.schema.json is generated; every guide example also ships as a .script.json and round-trips. Wiki, guide and lesson 07 updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>