Skip to content

Add npm run panel: a local page to send Cue into a call, watch it, take it out - #39

Merged
a-Fig merged 4 commits into
mainfrom
local-panel-32
Nov 13, 2026
Merged

a-Fig merged 4 commits into
mainfrom
local-panel-32

Conversation

@a-Fig

@a-Fig a-Fig commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #32

Why

Running Cue meant a terminal (npm run cue, #30). Tyler asked for a local web app that makes this feel good for the person running Cue, and the demo (#9) will show that person as well as the call. It's also a step toward #16.

Change

  • npm run panel → scripts/panel.mjs, serving panel/ at http://127.0.0.1:3900 (PANEL_PORT). Paste a Meet link, press Send Cue in, and the page shows:
    • where Cue is, in plain words, as a stepper: Starting → Joining → Lobby ("Admit Cue from the meeting") → In call → Left, with the time of each;
    • how long it has been in, what that has cost (about $0.65/h), and when it leaves by itself (CUE_MAX_MINUTES, as npm run cue does);
    • Take Cue out;
    • a live feed of the transcript lines Cue hears and what it does about them ("Cue showed a slide: Launch plan", "stayed quiet 0.3 s");
    • what's on Cue's screen now (mode, title, URL, slide bullets), as reported by the bot's page on each think call;
    • plain errors: a missing RECALL_API_KEY disables the button and says why; a missing AGENT_TOKEN or Claude key is a warning; tunnel failures and Recall refusals show as "Cue couldn't get into the call" with Recall's reason in words.
  • Local only, its own process. It binds to 127.0.0.1 and isn't served by server.js, which is public over the tunnel; a public send button would let anyone spend the Recall credit. It also refuses any Host but its own (DNS rebinding) and any POST without its x-cue-panel header (a form post from another tab). npm run check now checks those guards.
  • How the panel sees what Cue hears, without touching server.js. The transcript lives in the bot's page, not the server, so the tunnel points at a small pass-through the panel runs on 127.0.0.1 in front of server.js. It forwards every request and response unchanged (status, headers, body) and keeps, in memory only, each think call's new transcript lines and returned actions. AGENT_TOKEN never reaches the panel page or its logs. If cloudflared fails and PUBLIC_URL serves Cue, the panel falls back to it and says the feed stays empty. eminent-stencil agreed to this over a server.js log line.
  • Shared start-up: scripts/launch.mjs now holds what cue.mjs did (server, tunnel, Recall status words, a status-watch loop). cue.mjs is a thin CLI over it and prints the same lines as before. cuddly-lobster, who wrote it, OK'd the split.
  • recall.mjs takes an optional RECALL_API base URL so the flow can run against a stand-in Recall without billing.
  • Fonts load from Google Fonts, like Style Cue's screen from Cara's brand kit, with the logo #45 does for Cue's screen; offline the panel falls back to system fonts.
  • No new dependencies, no framework, no build step. public/, server.js and agent.js are unchanged.

Borrowed, per steal-great-ui: the single centred composer before a call (Astryx's AI Chat Landing template); the phase stepper with per-step times and a header that holds the status and the one action (Astryx's Inline Wizard and Order Detail templates, Vercel's deployment steps); a timestamped feed that freezes with "Cue left at 1:27 PM. Nothing more is recorded." (Vercel's build logs); red and amber reserved for failures and the lobby so they stand out at a glance (Vercel logs). The look is Cara's brand kit (#43): paper and ink from brand/tokens.css, Cue Blue for status, the lime highlighter for what Cue did, Cal Sans / Lato / JetBrains Mono, and the logo from public/. The screen preview turns ink with the lime mark while Cue is listening, as its real screen does.

Screenshots

All taken with Playwright against a stand-in Recall and a stand-in server, through a real cloudflared tunnel. The transcript lines were posted through the tunnel the way the bot's page posts them.

Before a call:

brand-idle.png

Waiting in the lobby:

brand-lobby.png

In the call, with the live feed:

brand-in-call.png

After Take Cue out:

brand-left.png

Recall refusing the bot:

brand-refused.png

At phone width:

brand-phone.png

Verified

  • npm run check passes, including the new panel checks (page loads, foreign Host → 403, POST without the header → 403, a non-link → 400).
  • Full panel flow against a stand-in Recall (RECALL_API) through a real quick tunnel: send → joining → lobby → in call → take out → left; and Recall refusing the bot.
  • With the panel starting the real server.js itself: /app.js through the tunnel is byte-identical to direct (same SHA-1, same content-type and cache-control), and a think call without the token gets the server's own 401.
  • npm run cue after the refactor, against the stand-in with CUE_MAX_MINUTES=0.4: same output as before, leaves on time, exits 0; no argument still prints usage.
  • The panel page never contains the token.
  • A tokenless think call posted through the tunnel gets the server's 401 and leaves the feed and the screen card untouched (feed 8 entries before and after).
  • Not checked: a real Recall bot, a real Claude think, and Ctrl+C on the panel under Windows (it should take Cue out and stop the tunnel and the server it started).

Review

An Opus review covered e41c68b (strictly, the skip rule applies: server.js, agent.js and the API are unchanged, but the tap sits on the public path). It found no blockers and six gaps, all fixed in e276e6e:

  1. The tap recorded think calls server.js had refused, so anyone with the tunnel address could put fake lines and a fake screen in the panel. 401s are now dropped, kept fields are trimmed, and the body copy is capped by bytes.
  2. Ctrl+C (or Take Cue out) while Recall was still creating the bot left it joining with nobody to remove it. Both the panel and npm run cue now wait for the bot's id first; during start-up the panel's button reads Cancel and stops before anything is sent.
  3. After the refactor, a Ctrl+C during the server or tunnel wait no longer stopped them. launch.mjs now reports each child as it spawns.
  4. The panel could stick on "leaving" if Recall never confirmed. It now gives up after 90 s, says to check Recall's dashboard, and frees the send button.
  5. A page left open across a panel restart stopped showing the feed. It now refetches it.
  6. A tunnel dying mid-call went unannounced. It is now shown as an error.

8a75837 (brand kit styling) is page-only and wasn't reviewed.

🤖 Generated with Claude Code

…take it out

Running Cue meant a terminal (#30). Tyler asked for a local web app so the
person running Cue, and the demo video, get a nicer experience (#32).

The panel is its own process bound to 127.0.0.1, never part of server.js:
server.js is public over the tunnel, and a public send button would let
anyone spend the Recall credit. It also refuses foreign Host headers
(DNS rebinding) and POSTs without its x-cue-panel header (cross-site forms).

What Cue hears lives in the bot's page, not the server, so the tunnel
points at a small pass-through the panel runs in front of server.js. It
forwards every request and response unchanged and keeps each think call's
new transcript lines and actions in memory for the feed. No server.js
change, so Drew's area and the review rule stay untouched.

cue.mjs's start-up moves to scripts/launch.mjs so both share it; `npm run
cue` prints the same lines as before. recall.mjs takes RECALL_API to point
at a stand-in Recall, which is how the flow was tested without billing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
a-Fig pushed a commit that referenced this pull request Nov 13, 2026
smash and others added 3 commits November 13, 2026 13:32
- The tap ignored nothing: anyone with the tunnel address could post a
  tokenless think call and its transcript and screen showed up as Cue's.
  Calls server.js refuses (401) are now dropped, kept fields are trimmed,
  and the body copy is capped by bytes.
- Ctrl+C or Take Cue out while Recall was still creating the bot left it
  joining with nobody to remove it. Both now wait for the bot's id first,
  and the panel's button cancels during start-up.
- launch.mjs reports each child as soon as it spawns, so a Ctrl+C during
  the server or tunnel wait stops them (cue.mjs used to do this).
- The panel gives up on 'leaving' after 90 s without Recall confirming,
  says so, and frees the send button.
- The page refetches its feed when the panel process restarts.
- A tunnel that dies mid-call is shown as an error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Paper and ink from brand/tokens.css, Cue Blue for status, the lime
highlighter for what Cue did, Cal Sans / Lato / JetBrains Mono, and the
logo from public/ (served read-only by name). Cue's screen preview turns
ink with the lime mark while Cue is listening, as its real screen does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
a-Fig pushed a commit that referenced this pull request Nov 13, 2026
@a-Fig
a-Fig merged commit b794bb3 into main Nov 13, 2026
1 check passed
@a-Fig
a-Fig deleted the local-panel-32 branch November 13, 2026 21:36
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.

A local web page for whoever runs Cue: send it into a call, watch it, take it out

1 participant