Metadata-Version: 2.1
Name: quoin-cockpit
Version: 0.3.1
Summary: Cockpit add-on for quoin: Stream Deck integration, Agent Desk, workflow dashboard and the context-tracker Claude Code mod
Author: IvGor
License: PolyForm Noncommercial 1.0.0
Requires-Python: >=3.10
Requires-Dist: quoin>=0.104
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: hatchling<1.19,>=1.18; extra == 'dev'
Requires-Dist: pytest-timeout; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# quoin-cockpit

Cockpit tools for working with coding agents, as an add-on for
[quoin](https://github.com/FourthWiz/quoin). They were split out of quoin at the
`legacy` tag (v0.94.3) with their git history, and now install on top of the
current quoin (0.104 or newer) as their own package, `quoin_cockpit`. Nothing is
written into the `quoin` package.

## What is here

| Component | What it is | Where `install` puts it |
|---|---|---|
| `context-tracker` | the context-tracker Claude Code mod (`/ctx` pane) | `$CLAUDE_CONFIG_DIR/skills/context-tracker/` (default `~/.claude`) |
| `dashboard` | the local workflow dashboard (read-only HTTP server on 127.0.0.1) | `~/.claude/scripts/` and `~/.claude/core/scripts/` |
| `agentdesk` | the Agent Desk zellij launcher, its setup script and a hotkey cheatsheet | `~/.config/agentdesk/` |
| `streamdeck` | the Stream Deck integration (macOS only) | see [the Stream Deck guide](quoin/docs/streamdeck/README.md) |

The VS Code extension in `vscode-extension/` is built and published on its own.

## Install

Requires Python 3.10 or newer. Once it is on PyPI:

```bash
pip install quoin-cockpit
```

Until then, install it from git:

```bash
pip install 'quoin-cockpit @ git+https://github.com/FourthWiz/quoin-cockpit'
```

Then deploy the components:

```bash
quoin-cockpit install                                  # everything (streamdeck on macOS only)
quoin-cockpit install --component context-tracker,dashboard
quoin-cockpit install --component agentdesk --setup-agentdesk   # also run the Homebrew/zellij/~/.zshrc setup
quoin-cockpit status
quoin-cockpit remove --component dashboard            # or no --component for everything
```

### Agent Desk hotkeys

The agentdesk component installs a hotkey cheatsheet next to the launcher.
Inside an Agent Desk session press `Alt /` to open it in a floating pane (`q`
closes it). From any shell run `agentdesk-keys` or `agentdesk --keys`. The Alt
keys need Ghostty's `macos-option-as-alt = left`, which the setup offers to add.
If you set up Agent Desk before the `Alt /` key existed, run
`bash ~/.config/agentdesk/setup-agentdesk.sh --refresh` to add it.

`quoin install` discovers the add-on through the `quoin.addons` entry point and
offers it. Accepting installs the context-tracker mod, the dashboard and the
Agent Desk files (without the Homebrew setup), and the Stream Deck component
only on macOS when its prerequisites are already met; otherwise it prints a
note.

`remove` deletes only what the cockpit installed: the context-tracker folder
only when its `plugin.json` names the mod (never a symlink or a folder someone
else made), and dashboard and Agent Desk files only while they still hold the
bytes the cockpit wrote. What it wrote is recorded in
`~/.config/quoin-cockpit/installed.json`.

## Commands

| Command | What it does |
|---|---|
| `quoin-cockpit install [--component NAME ...]` | install components (default: all) |
| `quoin-cockpit remove [--component NAME ...]` | remove components (default: all) |
| `quoin-cockpit status` | show what is installed |
| `quoin-cockpit streamdeck install\|upgrade\|status\|uninstall` | manage the Stream Deck component |
| `quoin-cockpit dashboard [--port N] [--no-browser] [--project-root DIR]` | run the dashboard |
| `quoin-cockpit sessions [--all] [kill NAME\|prune]` | list, kill or prune Agent Desk sessions |
| `quoin-cockpit attach [NAME]` | attach to an Agent Desk session |

## How it relates to quoin

The dashboard loads shared quoin scripts (`status_graph`, `path_resolve`,
`cost_event`, `memory_select`, `spend_monitor`, `cost_from_jsonl`). quoin now
installs as a Claude Code plugin and no longer copies them into `~/.claude`, so
the `dashboard` and `agentdesk` components copy them from the installed quoin
package next to the dashboard. `quoin-cockpit dashboard` runs the packaged
dashboard and reads them from the quoin package directly.

The Stream Deck manifest still records the quoin version (`quoin.__about__`)
it was installed with.

## Development

```bash
python3 -m venv .venv
.venv/bin/pip install quoin==0.104.0
.venv/bin/pip install -e '.[dev]'
.venv/bin/python -m pytest
```

Every test runs against a temporary HOME. The live zellij tests
(`test_agentdesk_layout_live.py`, `test_agentdesk_keybinds_live.py`,
`test_agentdesk_sessions_live.py`) need zellij and a session they can drive.

The VS Code extension builds and tests on its own:

```bash
cd vscode-extension && npm ci && npm test
```
