Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ or `parse`.

### The wire format

Steps join with `^`. A `***`-prefixed fragment is an inline comment: it becomes
the **label** of the preceding command/raw step, or a standalone comment step if
there's nothing to attach to. `;t<ms>` is a delay. Anything `match` doesn't
recognize survives as a `raw` step (lossless). The core invariant, exercised by
tests against `test/fixtures/commands.sample.json`:
`buildWCBValue(parseWCBValue(v)) === v` (byte-identical, except the documented
rseries leading-zero canonicalization).
Steps join with `^`. A `***`-prefixed fragment is a comment. Directly after a
command/raw step (`^***`) it is that step's **label**. After an empty segment
(`^^***`) it is a note on its own line. After a delay, a labelled step or a note
it is a note marked `inline: true`, written back with a single `^`. First in the
value it is a plain note. `;t<ms>` is a delay. Anything `match` doesn't
recognize survives as a `raw` step (lossless). Any other empty segment (a stray,
doubled or trailing `^`) becomes no step; the WCB skips it too. The core
invariant, exercised by tests against `test/fixtures/commands.sample.json`:
`buildWCBValue(parseWCBValue(v)) === v` (byte-identical, except that the engine
writes a firmware-lossy spelling in its canonical form, such as RSeries and
`leadingZeros` params dropping leading zeros, and drops those empty segments).

## Working in this repo

Expand Down
20 changes: 16 additions & 4 deletions docs/INTEGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,19 @@ DroidNetCommandLibrary.match('A0055'); // { commandId: 'flthy.led.solid', param
`buildWCBValue` / `parseWCBValue` use a compact, line-free format:

- Steps are joined by `^`.
- A `***text` fragment is a **comment**. Immediately after a command/raw step it
becomes that step's inline **label**; otherwise it's a standalone note.
- A `***text` fragment is a **comment**. Directly after a command/raw step
(`^***`) it becomes that step's inline **label**. After an empty segment
(`^^***`) it is a standalone **note** on its own line. After a delay, a
labelled step or another note (a single `^`) it is a standalone note marked
`inline: true`, written back with a single `^`. First in the value it is a
plain note. `buildWCBValue` writes any other note that follows a step as
`^^***text`.
- `;t<ms>` is a **delay** step.
- Anything `match()` doesn't recognize is preserved verbatim as a **raw** step,
so unknown tokens round-trip without loss.
- An empty fragment (a stray, doubled or trailing `^`) becomes no step. The WCB
skips empty segments too, so rebuilding drops them.
skips empty segments too, so rebuilding drops them, except the one in `^^***`,
which keeps a note on its own line.

```text
A006^*** Flthy rainbow^;t500^T52
Expand All @@ -100,7 +106,7 @@ A006^*** Flthy rainbow^;t500^T52
Round-trips are byte-identical except where a board's firmware is itself lossy
(e.g. RSeriesLogic drops leading zeros, and PSIPro reads `4T03` as `4T3` — the
engine normalizes to the firmware-equivalent canonical form) and for empty
fragments, which are dropped.
fragments, which are dropped (except the one before a note on its own line).

## The visual composer (UI)

Expand Down Expand Up @@ -144,6 +150,12 @@ engine being loaded first.
wire string. This is your source of truth; store it.
- **callbacks.onTest()** — optional; called if you add a test affordance.

`renderComposer` returns a handle, `{ setValue(value) }`, for a host that also
lets the user edit the wire value as text. `setValue` does nothing when `value`
equals the composer's compiled value; otherwise it re-parses the steps, cancels a
step being edited in the add bar, and re-renders the step list, length and
safety note, keeping a half-filled add bar. It never calls `onChange`.

The composer handles add/edit/remove, drag-reorder, inline delays and notes, a
length counter, and a safety warning when any non-`cosmetic` command is present.
If you build your own UI instead of using the composer, show any `safety` value
Expand Down
2 changes: 1 addition & 1 deletion libraries/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "droidnet-command-library/catalog/v1",
"libraryVersion": "4.5.0",
"libraryVersion": "4.6.0",
"schemaVersion": "v1",
"generatedFrom": "C2B5 firmware + WIPDocs (2026-06); R2UppitySpinnerV3 ALT fw 3.5.3 (2026-07); Printed Droid Magic Panel 32 Wireless KB (2026-07); WCB 6.1.5_290119RJUN2026 (2026-07); WCB 6.2.1_021242RSEP2026 + WcbCmd 0.8.0 (2026-09); DroidNet forks (2026-09)",
"boards": [
Expand Down
Loading
Loading