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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- run: npm run lint
- run: npm run format:check
- run: npm run check
- run: npm test
- run: npm run build
- run: npm run build:seed
# Opens a real window; GitHub's macOS runners have a desktop session.
Expand All @@ -52,6 +53,7 @@ jobs:
- run: npm run lint
- run: npm run format:check
- run: npm run check
- run: npm test
- run: npm run build
- run: npm run build:seed
- run: npm run smoke
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# git commit -am "Release v0.2.0"
# git tag -a v0.2.0 -m "Planchette 0.2.0" # annotated: --follow-tags skips
# git push --follow-tags # lightweight tags and pushes nothing
#
# A beta is the same with a version like 0.2.0-beta.1 and a matching changelog
# heading. Any tag containing a dash is published as a pre-release.
name: release

on:
Expand Down Expand Up @@ -107,6 +110,10 @@ jobs:
name: Planchette ${{ env.TAG }}
body_path: release/RELEASE_BODY.md
draft: true
# A tag with a dash (v0.2.0-beta.1) is a pre-release. Without this,
# publishing the draft would make a beta the Latest release, which is
# what designers download.
prerelease: ${{ contains(env.TAG, '-') }}
files: |
release/*.dmg
release/planchette-web-*.zip
Expand Down Expand Up @@ -166,6 +173,10 @@ jobs:
name: Planchette ${{ env.TAG }}
body_path: release/RELEASE_BODY.md
draft: true
# A tag with a dash (v0.2.0-beta.1) is a pre-release. Without this,
# publishing the draft would make a beta the Latest release, which is
# what designers download.
prerelease: ${{ contains(env.TAG, '-') }}
files: release/*.exe
fail_on_unmatched_files: true

Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ public/favicon.svg
site/_build
site/.cache
site/reel/guests

# Byte-for-byte records of what released versions shipped. Workspace upgrades
# compare hashes against these, so reformatting either one would break them.
scripts/seed-history.json
test/fixtures
42 changes: 39 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,41 @@ from one version to the next.
contained a short (8.3) folder name, such as `C:\Users\RUNNER~1\...`. The
watcher now follows the folder's full path.

## [0.2.0-beta.1] - 2026-11-13

A beta of 0.2.0, for testing on a real table. Published as a pre-release.

### Added

- **Run interfaces on a real table.** The desktop app listens for TUIO 1.1 from
a table's tracker (pucks and fingers) and feeds it to interfaces exactly as
the simulator does, so they need no changes. Off unless switched on in
**Settings > Table input**; a designer's machine never opens a socket. See
`docs/TABLE.md`.
- **Present mode** for the table's own computer: fullscreen on the table's
display at one table pixel per screen pixel whatever the display scaling, no
authoring chrome, native touch ignored. **Table > Enter Present Mode**, or
`"present": true` in `table.json` to boot into it.
- **A control puck** that opens an interface picker on the table: put it down,
turn it, touch an interface to open it.
- **Table > Assign Pucks** maps the tags printed on a table's pucks to the
marker numbers interfaces use, and **Table > Calibrate** lines the tracker up
with the screen. Both apply live. Stored per computer in `table.json`.
- `scripts/tuio-send.mjs`, a stand-in tracker for working without a table.
- `npm test`: unit tests for OSC decoding, TUIO frames, `table.json` and
workspace upgrades, gating CI on both runners.

### Changed

- **Workspaces are now kept up to date.** Opening a workspace refreshes its
reference docs, SDK types and agent guidance when the app has newer ones. A
file you edited is kept, with the new version written beside it
(`API.new.md`); anything you deleted stays deleted; interfaces and examples
are never overwritten. A notice says what changed. Works for workspaces
created by 0.1.0 and 0.1.1.
- `table.version` and the SDK's `hello` now report the app's version. They said
0.1.0 in every release so far.

## [0.1.1] - 2026-08-26

### Fixed
Expand Down Expand Up @@ -90,6 +125,7 @@ First release.
- Four surface presets, an inspector showing raw wire values, and puck
arrangements that survive a reload.

[Unreleased]: https://github.com/Potion/planchette/compare/v0.1.1...HEAD
[0.1.1]: https://github.com/Potion/planchette/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/Potion/planchette/releases/tag/v0.1.0
[Unreleased]: https://github.com/hyperquake/planchette/compare/v0.2.0-beta.1...HEAD
[0.2.0-beta.1]: https://github.com/hyperquake/planchette/compare/v0.1.1...v0.2.0-beta.1
[0.1.1]: https://github.com/hyperquake/planchette/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/hyperquake/planchette/releases/tag/v0.1.0
25 changes: 23 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and [`docs/API.md`](docs/API.md) instead; almost nothing here applies to that.
npm run check # TypeScript
npm run lint # oxlint, and the only static checking electron/ gets
npm run format # prettier, code only: prose, html and css are hand-formatted
npm test # unit tests for the pure parts: OSC, TUIO, table.json, upgrades
npm run smoke # launches the real desktop shell and drives it over CDP

## Shape of the thing
Expand All @@ -22,11 +23,12 @@ Four parts, and the boundaries between them are load-bearing:
the other way round.
- **`examples/<id>/`** are example interfaces, served as static files.
- **`electron/`** is a shell: a custom `planchette://` protocol, a workspace folder on
disk, and a file watcher. It adds distribution, not behaviour.
disk, a file watcher, and the TUIO listener for a real table (`tuio.js`,
configured per machine by `table.json`; see [`docs/TABLE.md`](docs/TABLE.md)).

Host and interface communicate **only** over `postMessage`. That is the seam that
lets the same interface code run against the simulator, standalone in a browser,
and eventually against real hardware over a socket.
and on a real table, where the host is fed by TUIO instead of the mouse.

## Invariants worth not breaking

Expand Down Expand Up @@ -62,6 +64,17 @@ is wrong.
a `requestAnimationFrame` loop, and Chromium throttles rAF hard once it decides
a window is occluded. A designer watching the simulator while typing in another
app would otherwise see it freeze.
8. **A real table's input arrives already meaning something.** Tag-to-`markerId`
mapping, calibration and the control puck are all applied in
`electron/tuio.js`, so the renderer and interfaces only ever see logical
marker ids. Changing the mapping re-announces everything from the raw data
held there, because trackers send positions only for things that move; a
puck sitting still would otherwise vanish until touched. For the same reason
TUIO pucks are never persisted to `sessionStorage` (6): the tracker replays them.
9. **The app only overwrites workspace files it wrote and nobody edited.** That
is what `.planchette/seed.json` is for. Never write into a designer's
workspace any other way, and never edit `scripts/seed-history.json`: it is
the record of what 0.1.x shipped, and legacy upgrades are judged against it.

## Bare specifiers

Expand Down Expand Up @@ -124,6 +137,14 @@ rather than a bug. Taking a screenshot forces frames to run.
in `scripts/build-seed.mjs` to ship it to designers.
- **Change the event API**: `src/sdk/types.ts` first, then the host, then
`docs/PROTOCOL.md` and `docs/API.md`. Keep TUIO alignment in mind.
- **Change what a workspace gets**: edit `scripts/build-seed.mjs` or the docs it
copies. Existing workspaces pick the change up on their next open, through
the upgrade (invariant 9); there is nothing else to do.
- **Change `table.json`'s shape**: bump `TABLE_CONFIG_VERSION` in
`electron/table-config.js` and add a step to `MIGRATIONS`, so a table's
enrollment survives the upgrade.
- **Work on the TUIO path without a table**: `node scripts/tuio-send.mjs`, with
table input on in Settings.
- **Anything a user would notice**: add it under `## [Unreleased]` in
`CHANGELOG.md`. At release time that section is retitled to the version, and
`scripts/release-body.mjs` publishes it above the durable install guidance in
Expand Down
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ interface SurfaceInfo {

interface Puck {
id: number // session id, stable only while continuously tracked
markerId: number // physical marker. Key your own state by THIS.
markerId: number // which puck this is (1, 2, 3...). Key your own state by THIS.
x: number; y: number // normalized 0..1, y axis down
mmX: number; mmY: number
angle: number // radians, 0 = up, clockwise positive, range [0, 2*PI)
Expand Down
4 changes: 3 additions & 1 deletion docs/DESIGN-RULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ decide whether an interface survives contact with the real table.
rather than destroying state immediately.
- **Key by `markerId`, not by `id`.** `id` is a tracking session and changes
whenever the tracker re-acquires a marker. `markerId` is the physical identity
of the object. The tradeoff is that two pucks carrying the same marker collapse
of the object: puck 1, puck 2, and so on. Each real table maps its printed tags
onto those same small numbers, so puck 1 in the simulator is puck 1 on the
table. The tradeoff is that two pucks carrying the same marker collapse
onto one thing; if you hand out duplicate markers, key by `id` and use
`markerId` plus last-known position to re-associate after a dropout.
- **Never let an event handler depend on your render loop.** This bites in two
Expand Down
15 changes: 14 additions & 1 deletion docs/DISTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ run the app seeds it with two example apps, SDK type declarations, a
`jsconfig.json`, and a `CLAUDE.md` carrying the design rules. A coworker can open
that folder in any editor or coding agent and start working.

**Existing workspaces are upgraded, carefully.** Seeding happens once, so
without help a workspace's reference docs, SDK types and agent guidance would
stay at whatever version created it. `build-seed.mjs` records the hash of every
file the app owns in `.planchette/seed.json`, and each time a workspace is
opened `electron/workspace-upgrade.js` brings it up to date: a file still as the
app wrote it is replaced; a file the designer edited is kept, with the new one
written beside it (`API.new.md`); anything they deleted stays deleted; examples
and interfaces are never overwritten. Workspaces from 0.1.x, which have no
manifest, are matched against `scripts/seed-history.json`, the hashes of what
those releases shipped. A folder the app never seeded is left alone.

The app watches the workspace. Saving a file reloads just the app iframe, and the
puck arrangement survives, so the loop is: arrange pucks once, then edit freely.

Expand All @@ -22,7 +33,9 @@ puck arrangement survives, so the loop is: arrange pucks once, then edit freely.
| `electron/main.js` | Serves everything over `planchette://`, owns the workspace and watcher. |
| `electron/preload.cjs` | The whole renderer-to-disk surface. Nothing else crosses. |
| `src/host/appsource.ts` | Hides whether interfaces come from Vite or the workspace. |
| `scripts/build-seed.mjs` | Assembles `workspace-seed/`, what a fresh workspace gets. |
| `scripts/build-seed.mjs` | Assembles `workspace-seed/`, what a fresh workspace gets, and its manifest. |
| `electron/workspace-upgrade.js` | Brings an older workspace up to the current seed without touching edits. |
| `electron/tuio.js` | TUIO from a real table; see `TABLE.md`. |
| `scripts/adhoc-sign.cjs` | Ad-hoc signs the macOS app so it will launch. |

The host UI and the interfaces share one origin, `planchette://host`: the UI from
Expand Down
33 changes: 21 additions & 12 deletions docs/PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,29 @@ millimetre sizing stays honest and you are simply working on a smaller table.

## Mapping to real hardware

Not built (see the non-goals in the plan), but the schema is shaped for it.
MultiTaction's stack can emit TUIO: add a `TuioSender` block to `config.txt`, or
point the on-screen display at a TUIO listener, then run `MTServer`, which
forwards display events to your application.

The bridge is then UDP to WebSocket, and drops in behind `src/sdk/transport.ts`
with no change to any app:
The desktop app takes TUIO 1.1 from a real table and feeds it into the same
model the mouse drives, so an interface cannot tell the difference and needs no
changes. Setting a table up is in [`TABLE.md`](TABLE.md); this is the mapping.

| TUIO | This API |
| ---- | -------- |
| `/tuio/2Dobj set s i x y a X Y A m r` | `Puck`: `s`=`id`, `i`=`markerId`, `x`/`y`, `a`=`angle`, `X`/`Y`=`vx`/`vy`, `A`=`vAngle` |
| `/tuio/2Dcur set s x y X Y m` | `Touch`: `s`=`id`, `x`/`y`, `X`/`Y` |
| `alive` / `fseq` | Presence and frame sequencing, which become add/remove events |
| `/tuio/2Dobj set s i x y a X Y A m r` | `Puck`: `x`/`y` and `a`=`angle`, after the table's calibration. `i`, the printed tag, becomes `markerId` through the table's assignments. |
| `/tuio/2Dcur set s x y X Y m` | `Touch`: `x`/`y`. 2Dcur carries no size, so `radiusMm` is a fixed 9mm. |
| `alive` / `fseq` | Presence and frame order, which become add and remove events. Late frames are dropped by TUIO's own rule. |

**`markerId` is logical.** Pucks carry whatever tag ids were printed on them.
Each table assigns its tags to the small numbers interfaces use (1, 2, 3...), so
an interface written against puck 1 in the simulator gets puck 1 on any table,
whatever is printed on it. Until a table has any assignments, raw tag ids pass
through unchanged.

`id` is assigned by the host, as it is for a simulated puck. It changes whenever
the tracker re-acquires a marker, exactly as TUIO's own session id does.

A table may reserve one tag as a **control puck**, which opens the host's
interface picker. It never reaches an interface.

Existing JavaScript TUIO clients worth borrowing from rather than reimplementing:
[`InteractiveScapeGmbH/tuio_client_js`](https://github.com/InteractiveScapeGmbH/tuio_client_js)
Not read yet: `/tuio/2Dblb` (contact size, which palm rejection would want) and
TUIO 2.0. Existing JavaScript TUIO clients, if those are ever wanted in the
browser: [`InteractiveScapeGmbH/tuio_client_js`](https://github.com/InteractiveScapeGmbH/tuio_client_js)
(TUIO 1.1 and 2.0) and [`Tuio.js`](https://github.com/fe9lix/Tuio.js).
Loading
Loading