Skip to content

feat(mods): Replace the arcade with the orchestrator agents pane - #83

Merged
4ndreello merged 8 commits into
mainfrom
feat/arcade-mod-port
Sep 20, 2026
Merged

4ndreello merged 8 commits into
mainfrom
feat/arcade-mod-port

Conversation

@4ndreello

@4ndreello 4ndreello commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Replace the arcade mod with an ASCII version of the codedeck web canvas, drawn in a docked pane on the right of the terminal.

The arcade put a game above the prompt. What an orchestrator actually wants in that space is the canvas it already has in the browser: one card per agent of the current run, harness glyph, status and age, ordered by last touch, with a header counting sessions and a footer legend. The pane opens at session start when CODEDECK_RUN_ID is set, so a plain claude --plugin-dir session gets nothing rather than a permanently empty dock that eats most of the screen. It refreshes on turn.complete and on tool.call behind a 1.5s gap, and redraws only when the snapshot actually changed.

A button above the prompt is the way back in after the pane is closed. It only ever opens, never toggles, because the pane can be closed by the engine's own close box and that fires no hook at all, so the module cannot track whether the pane is open. With nothing to desync there is nothing to get wrong. /band still toggles from the keyboard, and the button re-syncs the flag it reads.

Removal and replacement land in one commit on purpose: the previous register.tsx imports the arcade modules, so a commit that only deletes them leaves a tree that cannot build.

Where the risk is, for review

plugin/mods/agents/pane.ts is pure and must never throw, because a throw inside a render hook drops the entire drawing. It sizes itself from what the pane reports (bodyColumns, scroll.bodyRows) rather than from an assumed width, since a width requested on $.ui.open is ignored.

plugin/hooks/register.tsx is the only file that touches the engine. The ui.press hook, not the button's onPress, does the work: onPress is handed the press event rather than the engine handle.

Engine contract

docs/mods.md gains the rules this feature had to learn, each one after a wrong conclusion that a live probe corrected: Box lays children out in a row; a docked pane reports its own size and ignores the one you ask for; onPress receives the press event, though a handle captured from the render hook does work; a hotkey is swallowed by the prompt; a pane closed by its own close box is invisible to the module.

scripts/pane-probe.sh grades a live drawing under tmux with four named assertions. It exists because grepping a PTY byte stream cannot read a dock, which repaints in place, and that instrument produced a confident false negative before it was replaced.

@4ndreello
4ndreello marked this pull request as ready for review September 15, 2026 12:40
4ndreello and others added 7 commits September 19, 2026 23:03
Port the cc-arcade pattern into the codedeck plugin as an arcade mod: matcher-based /arcade command, AbovePrompt picker plus 2048 Client board, turn-complete pause banner, counter-only pet feeding from tool calls, and persisted best scores. Manifest declares the hooks module, open defaults CLAUDE_CODE_ENABLE_FUNCTION_HOOKS to 1 with user opt-out preserved, and docs describe enablement plus constraints.

Co-Authored-By: Claude <noreply@anthropic.com>
Math.random draws flagged Sonar rule S2245 as vulnerabilities on new code and sank the Security Rating gate. Tile spawns and game picks now draw from a shared randomInt helper over getRandomValues, with a bounds test covering it.

Co-Authored-By: Claude <noreply@anthropic.com>
Function hooks events only exist from 2.1.269 on, so the 2.1.258 pin rejects the modules declaration outright. Move the pin to the version this feature was probed against.

Co-Authored-By: Claude <noreply@anthropic.com>
The arcade drew a game above the prompt. What the run actually needs there is
the `codedeck web` canvas, so this deletes the arcade slice and puts an ASCII
version of that canvas in a docked pane on the right: one card per agent of
the current run, harness glyph, status and age, ordered by last touch, with a
header counting sessions and a footer legend.

The pane opens at session start when CODEDECK_RUN_ID is set, so a plain
`claude --plugin-dir` session gets nothing rather than a permanently empty
dock. It refreshes on turn.complete and on tool.call behind a 1.5s gap, and
redraws only when the snapshot actually changed.

A button above the prompt is the way back in. The pane can be closed by the
engine's own close box, which fires no hook at all, so the module cannot track
whether the pane is open; the button therefore only ever opens, never toggles,
and there is no state to desync. It also re-syncs the flag /band reads.
Removal and replacement land together because the previous register.tsx
imports the arcade modules, so deleting them alone leaves a tree that cannot
build.

The pure layer never throws, because a throw inside a render hook drops the
whole drawing, and it sizes itself from what the pane reports rather than from
an assumed width.

Co-Authored-By: Claude <noreply@anthropic.com>
Every rule here cost a live probe, and each one had already produced a wrong
conclusion before it was pinned down. Box lays children out in a row, so a
column of lines comes out shredded. A docked pane ignores the width you ask
for and reports its own size back on every render. A Button's onPress is
handed the press event, not the engine handle, though a handle captured from
the render hook does work. A hotkey is swallowed by the prompt. A pane closed
by its own close box fires no hook, so a module cannot track its open state.

Also written down: how to click a button from a test, since the client turns
on SGR mouse tracking and tmux can deliver a synthetic press and release.

Co-Authored-By: Claude <noreply@anthropic.com>
The spec and run record for the arcade mod describe a feature the previous
commit deletes. Leaving them beside the pane's own spec, which already records
what replaced the arcade and why, gives the next reader two specs and only one
implementation.

Co-Authored-By: Claude <noreply@anthropic.com>
@4ndreello 4ndreello changed the title feat(mods): Add arcade function-hooks mod above the prompt feat(mods): Replace the arcade with the orchestrator agents pane Sep 20, 2026
The mock existed to settle the pane's shape before any engine work, and the
pane it was drawing is now implemented, tested and verified on screen. It also
resolved the codedeck binary through PATH, which the security gate flags, and
hardening a script with no remaining purpose is the wrong trade.

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@4ndreello
4ndreello merged commit 3178473 into main Sep 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant