Skip to content

feat: external-monitor support for the desktop CLI (status-all, chat state, focus) - #6

Draft
hydrant25 wants to merge 3 commits into
aws-samples:mainfrom
hydrant25:feat/stream-deck-control
Draft

hydrant25 wants to merge 3 commits into
aws-samples:mainfrom
hydrant25:feat/stream-deck-control

Conversation

@hydrant25

Copy link
Copy Markdown

Description

Adds machine-readable chat-state reporting and chat navigation to the desktop CLI (quick_ctl.py) so an external monitor/controller can poll the CLI and branch on its JSON. The CLI contract is backward compatible — existing commands, exit codes, and JSON keys are unchanged; all changes are new keys or new commands.

Added:

  • status-all [--chats A B ...] — one CDP connection reports every sidebar chat's state as JSON (thinking | needs_input | attention | done | idle); the active chat (identified from the page URL) gets a full state, background chats are flagged attention when the sidebar approval-dot is present. Names matched exactly, order preserved, unknown names return found:false.
  • status gains additive generating, needs_input, and state keys for the active chat (existing connected/port/url/model untouched).
  • open-chat --next / --prev — cycle the sidebar list with wrap-around.
  • focus — foreground the macOS app window via open -a (no CDP, no Automation-permission prompt).

Fixed:

  • open-chat (and --next/--prev) crashed with a Playwright strict-mode violation from combining locators via .or_(); now resolves the [role=option] row independently (exact → substring → JS fallback) and never raises.
  • new-chat focused the first folder instead of starting a chat; now clicks the primary "Chat" nav item (data-testid=nav-home).

Version bumped to 2.1.0 with a matching CHANGELOG entry (CI enforces pyproject == top CHANGELOG version).

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Other (please describe)

Checklist

  • I have read the CONTRIBUTING guide.
  • My changes follow the code style of this project. (Compact one-liner style; in-code comments remain Simplified Chinese per repo convention. This PR's prose and the CHANGELOG entry are in English.)
  • I have tested my changes. (ruff check . clean; pytest -m "not realmachine" = 97 passed, 0 failures; the realmachine layer auto-skips without a live app; status-all, open-chat cycling, new-chat, and focus verified live against a running Amazon Quick Desktop.)
  • I have updated the documentation where relevant. (CHANGELOG 2.1.0 entry added.)

Related issues

N/A — happy to open a tracking issue first if the maintainers prefer.


By submitting this pull request, I confirm that my contribution is made under the terms of the project license.

…x open-chat/new-chat selectors

Add machine-readable chat-state reporting for external monitors/controllers:
- status-all [--chats ...]: per-chat state (thinking/needs_input/attention/done/idle) in one CDP read
- status: additive generating/needs_input/state keys for the active chat
- open-chat --next/--prev: sidebar cycling with wrap-around, URL-slug active detection
- focus: foreground the macOS app window via open -a (no CDP, no permission prompt)

Fixes:
- open-chat and open-chat --next/--prev: drop .or_() strict-mode crash; resolve the
  [role=option] row independently (exact -> substring -> JS fallback)
- new-chat: click the primary Chat nav item (data-testid=nav-home) instead of a
  per-folder button

CLI contract unchanged: existing commands, exit codes, and JSON keys are preserved;
all changes are new keys or new commands.
Bump pyproject version to 2.1.0 to match the new top CHANGELOG entry (CI enforces this).
Ignore .agents/, .kiro/, and .worktrees/ so local agent tooling never gets committed.
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.

2 participants