| 1 | # The whale view |
| 2 | |
| 3 | > 阅读简体中文版:[zh_hans/PET_MODE.md](zh_hans/PET_MODE.md) |
| 4 | |
| 5 | `/whale` turns the terminal you already use into a glanceable status view. A |
| 6 | whale made of dots fills the main view and shows what the session is doing: |
| 7 | idle, working, waiting for you, done, or failed. The message box stays at the |
| 8 | bottom, so you can keep typing. Replies and agents are one key away. |
| 9 | |
| 10 | Each terminal draws the activity from its own session. The terminals and the |
| 11 | desktop app share the whale’s name and colour through your Engine settings. |
| 12 | With several terminals open, you can see which session needs you, which is |
| 13 | still working, and which has finished. |
| 14 | |
| 15 | ```text |
| 16 | Codewhale ● working |
| 17 | (the whale) |
| 18 | ● |
| 19 | F5 replies & agents · /whale standard view |
| 20 | ╭──────────────────────────────────────────────────────────╮ |
| 21 | │❯ Type a follow-up… │ |
| 22 | ╰──────────────────────────────────────────────────────────╯ |
| 23 | ● auto Shift+Tab to change work (Tab) 2 agents |
| 24 | ``` |
| 25 | |
| 26 | ## Commands |
| 27 | |
| 28 | | Command | Effect | |
| 29 | | --- | --- | |
| 30 | | `/whale` | Turn the whale view on or off for this terminal. `/whale on` and `/whale off` set it without toggling. | |
| 31 | | `/whale full` | The same as `/whale`. In the terminal the whale view is already the full view; the word exists so the command reads the same as in the desktop app. | |
| 32 | | `/whale still` | Hold the whale still, or let it move again. | |
| 33 | | `/whale name <text>` | Name the whale. The name replaces `Codewhale` in the view's first line. Up to 32 characters, with no control or invisible formatting characters. | |
| 34 | | `/whale color <name|#rrggbb>` | Colour the whale with one of the desktop app's colours (`scout`, `patch`, `harbor`, `echo`, `keel`, `lantern`, `violet`, `amber`) or a hex value. Each dot keeps its own brightness. `/whale color default` restores the whale's own colours. | |
| 35 | |
| 36 | The view being on or off is saved as the `pet_mode` setting (also in the |
| 37 | settings editor), so a new session starts the way you left it. The name and |
| 38 | colour are saved as `whale_name` and `whale_color` in the same `settings.toml`. |
| 39 | They are the one identity every terminal and the desktop app share: change them |
| 40 | in the desktop's About page, `/whale`, or `/config`, and an open terminal |
| 41 | showing the whale picks the change up within two seconds. Hold-still lasts until |
| 42 | this terminal closes. |
| 43 | |
| 44 | The whale view never starts a turn, calls a model, or changes your draft, mode, |
| 45 | or approvals. It only presents the session you are already running. |
| 46 | |
| 47 | ## What the whale tells you |
| 48 | |
| 49 | The first line of the view and the mark under the whale always carry the state |
| 50 | as a mark and a word, so it reads without colour or motion: |
| 51 | |
| 52 | | State | Mark and word | Meaning | |
| 53 | | --- | --- | --- | |
| 54 | | Ready | `○ idle` | Nothing running. | |
| 55 | | Working | `● working` | A turn is running, including tools and verification. | |
| 56 | | Needs you | waiting or approval phase | The session is waiting for an approval or an answer. Motion is reduced while it waits. | |
| 57 | | Done | `✓ Done` | The last turn completed. | |
| 58 | | Failed | `✕ failed` | The last turn ended in failure. | |
| 59 | |
| 60 | While a turn runs, the whale's dots leave it and become the thing the work is, |
| 61 | in motion, then return: a wrench for commands and tools, a pencil for edits, a |
| 62 | book for reading, a lens for searching, a flask for tests, a globe for |
| 63 | browsing, a pointer for computer use, stacked layers for memory, a bulb for |
| 64 | thinking, a speech bubble for replies, a pod of small whales for parallel |
| 65 | agents, a ringing bell when it needs you and a check mark when it is done. |
| 66 | Hold-still and reduced motion show one still pose of the form. |
| 67 | |
| 68 | The status bar underneath keeps its usual live readouts, such as the agent |
| 69 | count (`2 agents`) and the work bar. Transient notices, such as a retry |
| 70 | (`Retry attempt: transport 1/3; network error; waiting 0.94s`), show on the |
| 71 | second line. |
| 72 | |
| 73 | ## Replies and agents on demand |
| 74 | |
| 75 | The main view stays quiet. Press `F5` while the whale view is on, or click the |
| 76 | hint line, to open the inspector over it: |
| 77 | |
| 78 | - the whale and an **Agents** list on top, with each agent's state and usage; |
| 79 | - a **Reply** pane below, which streams the current answer and shows terminal |
| 80 | errors from the same session. |
| 81 | |
| 82 | | Key | Effect | |
| 83 | | --- | --- | |
| 84 | | `F5` | Open replies and agents. | |
| 85 | | `Esc` | Back to the message box. Your draft, the transcript, and any running turn are untouched. | |
| 86 | | `Tab` | Switch between the Reply and Agents panes. | |
| 87 | | `Up` / `Down`, `PgUp` / `PgDn`, `Home` / `End` | Scroll the focused pane. | |
| 88 | | `Enter` (Agents pane) | Open the selected agent's transcript. | |
| 89 | | `c` | Copy the last finished reply, through the same path as `/copy`. | |
| 90 | |
| 91 | On a Mac keyboard the top row sends media keys unless Fn is held, so F-key |
| 92 | hints throughout the TUI, including help, read `fn+F5`; press Fn with the key. |
| 93 | |
| 94 | ## Several terminals, one whale each |
| 95 | |
| 96 | Start Codewhale in two terminals and run `/whale` in each: each whale follows |
| 97 | its own session, so one can show `✓ Done` while the other shows `● working`. |
| 98 | Nothing is mixed between sessions, and the terminals do not talk to each other. |
| 99 | The desktop app draws the same whale from the same code, and shows its own |
| 100 | sessions. |
| 101 | |
| 102 | ## When the dots cannot draw |
| 103 | |
| 104 | - **`CODEWHALE_ASCII_SAFE=1`.** Marks, borders, and the pointer use ASCII |
| 105 | (`o idle`, `|`, `>`). The whale is replaced by the state mark and word, and |
| 106 | the line under the title says so. |
| 107 | - **Small terminals.** The dot whale needs an art area of at least 16x8 cells. |
| 108 | Below that the mark, word, hint line, and message box remain. |
| 109 | - **The dot whale could not start.** The view draws the half-block whale |
| 110 | instead, and the line under the title says so. The state mark and word keep |
| 111 | working, because they come from your session. |
| 112 | - **`NO_COLOR`.** Colour is left to your terminal; the marks and words still |
| 113 | carry the state. |
| 114 | - **Reduced motion.** Follows the shell's motion setting and shows a still pose. |
| 115 | |
| 116 | ## Privacy |
| 117 | |
| 118 | The whale is drawn inside the terminal process. What it reads from the session |
| 119 | is a short allowlist of event kinds, ids, and outcomes (for example "a read |
| 120 | started", "turn completed"). Prompt text, reasoning, tool names, arguments, |
| 121 | results, and paths are not read, nothing is written to disk or sent anywhere, |
| 122 | and nothing about the session's model context changes. |
| 123 | |
| 124 | ## What was removed in 0.10.5 |
| 125 | |
| 126 | Earlier versions ran a shared companion process (`codewhale pet serve`) on a |
| 127 | loopback port. It is gone, with everything only it provided: |
| 128 | |
| 129 | - sound (`/pet sound`, `F6`); |
| 130 | - replay recording and `/pet export`; |
| 131 | - the browser appearance studio (`/pet appearance`, `F8`) and `/pet style`; |
| 132 | - source selection (`/pet source`) and `/pet status`; |
| 133 | - the other views (`cove`, `braille`, `pixels`, `particles`, `whale-girl`), |
| 134 | view cycling, `/pet avatar`, `/pet action`, `/pet view`, and avatar packs in |
| 135 | the terminal; |
| 136 | - `/pet inspect`; use `F5`. |
| 137 | |
| 138 | `CODEWHALE_PET_HOME`, `CODEWHALE_PET_PORT` and `CODEWHALE_PET_GRAPHICS` are no |
| 139 | longer read. Files an older version left in `~/.codewhale/pet-shared` are not |
| 140 | read and are not deleted; you can remove that folder yourself. |
| 141 | |
| 142 | ## Known limitations |
| 143 | |
| 144 | - **No "reply ready" cue yet.** When a turn finishes, the whale shows `✓ Done` |
| 145 | and the footer hint stays the same static line. There is no separate |
| 146 | notification, badge, or sound that says a reply is waiting. Glance at the |
| 147 | state word, or press `F5` to read the reply. |
| 148 | - **Agent rows can lag.** While agents run, the Agents list in the inspector is |
| 149 | refreshed when the turn ends, not on every change. The agent count in the |
| 150 | status bar and the work bar are live; treat the inspector's rows as a |
| 151 | snapshot until the turn finishes. |
| 152 | - **The whale starts unobserved.** Events from before the first `/whale` in a |
| 153 | Codewhale process are not shown; the whale rests until the next one arrives. |
| 154 | - **Hold-still is not saved**, and is not shared with other terminals or the |
| 155 | desktop app. |
| 156 | - **A colour replaces the activity hues.** The shape, the mark and the word |
| 157 | still say what the session is doing. |
| 158 | - **The work bar is hidden while the whale view is showing.** Turn the view |
| 159 | off with `/whale` to use it. |
| 160 | |
| 161 | See also [Keybindings](KEYBINDINGS.md), [Modes](MODES.md), and the design notes |
| 162 | in [`design/DOT_WHALE_PET.md`](design/DOT_WHALE_PET.md). |
| 163 |