aem-eds-kit 0.4.58 → 0.4.60

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
@@ -29,6 +29,11 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
29
29
  Version links point at npm; the GitHub release links never existed.
30
30
 
31
31
  ### Fixed
32
+ - **`eds draft preview|accept|refine --version` printed the CLI version**
33
+ (EDS-089) instead of picking a draft version: the program's own `--version`
34
+ flag won. The version is now an argument (`eds draft preview hero 2`,
35
+ `eds draft accept hero 1 --branch feature/hero`) and `refine` takes
36
+ `--from <n>`.
32
37
  - **The site has a menu on phones** (EDS-079). Below 720px the nav links were
33
38
  hidden with nothing to bring them back; a menu button (with `aria-expanded`,
34
39
  closing on Esc, a link tap or widening the window) now opens them as a
@@ -55,6 +60,13 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55
60
  where the Universal Editor boilerplate actually lives.
56
61
 
57
62
  ### Added
63
+ - **`--json` event stream** (EDS-087) for `block from-design` and the `draft`
64
+ commands: one JSON object per line on stdout (`v`, `type`), the usual output
65
+ on stderr, ending with a `result`. Events: `start`, `log`, `agent` (each tool
66
+ call), `agent-result` (duration and cost), `draft`, `drafts`, `preview`,
67
+ `accepted`, `discarded`, `prompt`, `result`. With `--json` nothing prompts,
68
+ no browser opens, and an agent's own stdout goes to stderr. This is the
69
+ interface aem-eds-studio uses.
58
70
  - **Drafts: review rounds before a block reaches the repository** (EDS-085).
59
71
  `block from-design --draft` keeps the result as a version under
60
72
  `tmp/eds-cli/drafts/<name>/` and leaves `blocks/` untouched; `eds draft
package/README.md CHANGED
@@ -469,7 +469,32 @@ eds draft list # drafts and their v
469
469
  eds draft discard hero # drop it; blocks/ untouched
470
470
  ```
471
471
 
472
- `accept --commit` (or `--branch <name>`, created if missing) commits only `blocks/<name>/`, with the review rounds in the message (`v1: first version`, `v2: "bigger headline, orange buttons"`). `refine` reuses the agent and model that made the draft unless you pass `--agent` / `--model`; `preview` and `accept` take `--version <n>`.
472
+ `accept --commit` (or `--branch <name>`, created if missing) commits only `blocks/<name>/`, with the review rounds in the message (`v1: first version`, `v2: "bigger headline, orange buttons"`). `preview` and `accept` take a version (`eds draft preview hero 2`, `eds draft accept hero 1 --branch feature/hero`; default: the latest). `refine` starts from the latest version, or `--from <n>`, and reuses the agent and model that made the draft unless you pass `--agent` / `--model`.
473
+
474
+ **For tools: `--json`.** `block from-design` and the `draft` commands take the global `--json` flag and print **one JSON event per line on stdout** (the usual output stays on stderr). It never prompts, so pass the design, the name and `--draft`. Every event has `v` (the schema version, currently `1`) and `type`, and the stream ends with one `result`. [aem-eds-studio](https://github.com/piotrgodycki/aem-eds-studio) reads it.
475
+
476
+ ```bash
477
+ eds --json block from-design "<design link>" --name hero --draft
478
+ ```
479
+ ```jsonl
480
+ {"v":1,"type":"start","command":"block from-design","cli":"0.4.59"}
481
+ {"v":1,"type":"agent","tool":"Write","label":"✎ blocks/hero/hero.css","durationMs":18}
482
+ {"v":1,"type":"agent-result","durationMs":152455,"costUsd":0.031}
483
+ {"v":1,"type":"draft","name":"hero","version":1,"ok":true,"dir":"tmp/eds-cli/drafts/hero/v1","files":["hero.css","hero.js"]}
484
+ {"v":1,"type":"result","ok":true,"exitCode":0}
485
+ ```
486
+
487
+ | Event | When |
488
+ |---|---|
489
+ | `start` | first line: the command and the CLI version |
490
+ | `log` | every message the command prints (`level`: debug, info, success, warn, error), as plain text |
491
+ | `agent` / `agent-result` | each tool call the agent made, then its duration and cost (Claude Code) |
492
+ | `draft` | a version was stored: `name`, `version`, `ok` (checks passed), `dir`, `files`, `feedback` |
493
+ | `drafts` | `draft list`: every draft with its versions |
494
+ | `preview` | `draft preview`: the server is up at `url` (no browser is opened) |
495
+ | `accepted` / `discarded` | `draft accept` (with `commit`, `branch`) / `draft discard` |
496
+ | `prompt` | `--dry-run`: where the prompt was saved |
497
+ | `result` | last line: `ok` and `exitCode` |
473
498
 
474
499
  ### `eds block list`
475
500
 
@@ -750,7 +775,7 @@ Priority: CLI flags → env vars → `.edsrc.json` (project) → `~/.eds/config.
750
775
  |---|---|
751
776
  | `--verbose` | Debug-level output |
752
777
  | `--quiet` | Errors only |
753
- | `--json` | Machine-readable JSON output (`doctor`, `audit loading`, `audit security`, `block list`) |
778
+ | `--json` | Machine-readable output: one JSON document (`doctor`, `audit loading`, `audit security`, `block list`), or JSON-lines events (`block from-design`, `draft`; see [`eds draft`](#eds-draft)) |
754
779
  | `--no-color` | Disable colors (also respects `NO_COLOR` env) |
755
780
 
756
781
  ## Development