Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/tui-lock-v2/120x40/undo-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/media/tui-lock-v2/40x12/undo-sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions docs/media/tui-lock-v2/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ categorised rows + tip/nav footer, slash autocomplete above the composer, effort
radios under `/model`, token counter top-right, footer shortcut strip) and
re-skinned to the Cortex chrome. **No runtime code changes ship with this pack.**

- Boards: [`index.md`](index.md) — 84 boards at 120×40, 38 of them also at 40×12 (122 PNGs).
- Boards: [`index.md`](index.md) — 87 boards at 120×40, 41 of them also at 40×12 (128 PNGs).
- Grids: `txt/<size>/<board>.txt` — the exact character grid of every board (diff a
`MockTerminal` capture against these).
- Renderer: `tools/render_lock_v2.py` + `tools/boards.py` (Python 3 + Pillow, IBM Plex Mono
Expand Down Expand Up @@ -419,13 +419,15 @@ Narrow: no bars, `used / total pct%`.
| login / first-run | `login`, `login-waiting`, `login-success`, `login-error`, `first-run-tips` |
| compact chat (ref 5) | `compact-chat` |
| other product surfaces (not in the brief, kept complete) | `shortcuts-overlay`, `resume-picker`, `clear-confirm`, `plan-confirm`, `queue`, `files-picker`, `jobs`, `skills`, `todos`, `question`, `sudo`, `config-tree`, `btw` |
| local-tools consent · @file chip · undo/redo/rewind | `consent-local-tools`, `composer-file-chip`, `undo-sheet` |

Narrow (40×12) set: `welcome-cortex`, `welcome-agent`, `first-run-tips`, `session-empty`, `session-user-bars`,
`session-thinking-live`, `session-assistant`, `session-optin`, `composer-empty`, `composer-typing`, `composer-hover`,
`tokens-topright`, `compact-chat`, `slash-palette`, `goal-chip-active`, `goal-chip-paused`, `goal-chip-done`,
`goal-chip-budget`, `goal-chip-blocked`, `slash-model-typed`, `model-list`, `model-effort-high`,
`settings-appearance`, `settings-mouse`, `settings-row-hover`, `settings-theme-submenu`, `mode-plan`, `mode-ask`,
`permission-prompt`, `mcp-servers`, `usage`, `diagnostics`, `interrupt-stopped`, `offline`, `rate-limit`, `diff-hunk`, `login`, `shortcuts-overlay`.
`permission-prompt`, `mcp-servers`, `usage`, `diagnostics`, `interrupt-stopped`, `offline`, `rate-limit`, `diff-hunk`, `login`, `shortcuts-overlay`,
`consent-local-tools`, `composer-file-chip`, `undo-sheet`.

---

Expand Down
5 changes: 4 additions & 1 deletion docs/media/tui-lock-v2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,8 @@ Regenerate: `python3 tools/render_lock_v2.py --index` (fetches IBM Plex Mono on
| `sudo` | Elevated Shell — password row on gray | [120x40](120x40/sudo.png) | — |
| `config-tree` | `/config` read-only key tree | [120x40](120x40/config-tree.png) | — |
| `btw` | `/btw` side note during a running turn | [120x40](120x40/btw.png) | — |
| `consent-local-tools` | Consent card — run tools locally in CWD / This PC | [120x40](120x40/consent-local-tools.png) | [40x12](40x12/consent-local-tools.png) |
| `composer-file-chip` | Composer with attached @file chip in prompt | [120x40](120x40/composer-file-chip.png) | [40x12](40x12/composer-file-chip.png) |
| `undo-sheet` | /undo /redo /rewind sheet | [120x40](120x40/undo-sheet.png) | [40x12](40x12/undo-sheet.png) |

**84** boards at 120x40 · **38** at 40x12 · 122 PNGs.
**87** boards at 120x40 · **41** at 40x12 · 128 PNGs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions docs/media/tui-lock-v2/runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ is banner green `#1F4945`; historical violet `#A78BFA` is not the lock.
Designer boards (pixel target) live in `docs/media/tui-lock-v2/{40x12,120x40}/`.
These runtime frames are what Designer cli signs off against.

SPEC §7: **84** boards at 120×40 and **38** at 40×12. Each filename is one
SPEC §7: **87** boards at 120×40 and **41** at 40×12. Each filename is one
distinct live state — no two PNGs share a sha256. Includes `/goal` composer
chips (`goal-chip-*`) plus distinct `offline` and `rate-limit` diagnostics.
chips (`goal-chip-*`), distinct `offline` and `rate-limit` diagnostics,
local-tools consent, composer `@file` chip, and `/undo` `/redo` `/rewind` sheet.
73 changes: 73 additions & 0 deletions docs/media/tui-lock-v2/tools/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,76 @@ def board_btw(s, c):
footer(s, c, [("Esc", "interrupt"), ("Enter", "queue follow-up"), ("Ctrl+x", "shortcuts")])


def board_consent_local_tools(s, c):
"""COR-222 — consent card to run tools locally in the CWD / This PC.

Distinct from ``permission-prompt`` (no ``$`` command block) and
``session-optin`` (no retain-coding-data privacy copy).
"""
header(s, c)
top = composer(s, c, focused=False, caret=False, placeholder="Choose an option above")
f = Flow(s, c, y=1 if c.narrow else 2, limit=top if c.narrow else top - 1)
if not c.narrow:
f.user("fix the failing test in this repo", "10:18 AM")
f.thought("Thought for 0.6s")
f.line([("●", S_DIM), (" Run tools locally?", S)])
if c.narrow:
f.dim("This PC · current directory · Cloud is default")
else:
f.dim("Tools run on This PC against the current working directory. Cloud is the default when unset.")
yes = "Yes — run tools here" if c.narrow else "Yes — run tools in this directory"
always = "Always allow project" if c.narrow else "Always allow for this project"
no = "No — keep using Cloud"
f.options([yes, always, no], focused=0)
footer(
s,
c,
[("↑↓", "select"), ("Enter", "confirm"), ("Esc", "cancel")]
if not c.narrow
else [("Enter", "confirm"), ("Esc", "cancel")],
)


def board_composer_file_chip(s, c):
"""COR-223 — post-attach composer with an ``@file`` chip (picker closed)."""
header(s, c)
path = "@src/composer.rs" if c.narrow else "@src/cortex-tui/src/composer.rs"
top = composer(s, c, content=[("explain ", S), (path, S_ACC), (" ", S)])
if not c.narrow:
s.put(c.x0 + 2, top - 2, clip("@ attaches files · ! enters Bash", c.inner_w - 4), S_DIM)
footer(
s,
c,
[("Enter", "send"), ("@", "files"), ("!", "bash")]
if not c.narrow
else [("Enter", "send"), ("@", "files")],
)


def board_undo_sheet(s, c):
"""COR-224 — ``/undo`` ``/redo`` ``/rewind`` sheet (not clear / resume)."""
header(s, c)
top = composer(s, c, content=[("/undo", S_ACC), (" ", S)])
if c.narrow:
f = Flow(s, c, y=1, limit=top)
f.line([("Undo", S)])
f.options(["Undo last turn", "Redo", "Rewind…"], focused=0)
else:
y = top - 6
backdrop_tail(s, c, y)
f = Flow(s, c, y=y, limit=top - 1)
f.line([("Undo", S)])
f.dim("Undo the last turn, redo it, or rewind this Cortex session to a checkpoint.")
f.options(["Undo last turn", "Redo", "Rewind to checkpoint"], focused=0)
footer(
s,
c,
[("↑↓", "select"), ("Enter", "confirm"), ("Esc", "close")]
if not c.narrow
else [("Enter", "confirm"), ("Esc", "close")],
)


# --------------------------------------------------------------------------- #
# Registry — (id, painter, meta). ``narrow`` = also rendered at 40×12.
# --------------------------------------------------------------------------- #
Expand Down Expand Up @@ -1914,6 +1984,9 @@ def board_btw(s, c):
("sudo", board_sudo, False, "E", "Elevated Shell — password row on gray"),
("config-tree", board_config_tree, False, "E", "`/config` read-only key tree"),
("btw", board_btw, False, "E", "`/btw` side note during a running turn"),
("consent-local-tools", board_consent_local_tools, True, "E", "Consent card — run tools locally in CWD / This PC"),
("composer-file-chip", board_composer_file_chip, True, "E", "Composer with attached @file chip in prompt"),
("undo-sheet", board_undo_sheet, True, "E", "/undo /redo /rewind sheet"),
]

BOARDS = [(bid, fn, {"narrow": narrow, "section": sec, "desc": desc}) for bid, fn, narrow, sec, desc in BOARDS_META]
40 changes: 40 additions & 0 deletions docs/media/tui-lock-v2/txt/120x40/composer-file-chip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
14K / 500K
































@ attaches files · ! enters Bash

╭─ Agent ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > explain @src/cortex-tui/src/composer.rs │
╰─────────────────────────────────────────────────────────────────────────────────────────── Cortex Mini 1 (medium) ─╯

Enter:send | @:files | !:bash
40 changes: 40 additions & 0 deletions docs/media/tui-lock-v2/txt/120x40/consent-local-tools.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
14K / 500K

> fix the failing test in this repo 10:18 AM

♦ Thought for 0.6s

● Run tools locally?
Tools run on This PC against the current working directory. Cloud is the default when unset.
> 1 Yes — run tools in this directory
2 Always allow for this project
3 No — keep using Cloud
























╭─ Agent ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Choose an option above │
╰─────────────────────────────────────────────────────────────────────────────────────────── Cortex Mini 1 (medium) ─╯

↑↓:select | Enter:confirm | Esc:cancel
40 changes: 40 additions & 0 deletions docs/media/tui-lock-v2/txt/120x40/undo-sheet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
14K / 500K


> hey 12:49 AM

♦ Thought for 0.4s

Hey — what do you want to work on? 12:49 AM

Worked for 1.8s

> tell me about yourself 12:49 AM

♦ Thought for 0.4s

I'm Cortex, a coding agent that runs in your terminal. 12:49 AM

I mostly help you build and debug software: code, architecture, debugging, reviews, docs, and a bit of research.
Here I run in an interactive terminal, so I can read your files, run commands, and change the project.

In practice:
• I get straight to the point
• I prefer concrete work over long explanations
• I can also discuss, explain, or help you plan

Tell me what you'd like to do.

Worked for 4.6s

Undo
Undo the last turn, redo it, or rewind this Cortex session to a checkpoint.
> 1 Undo last turn
2 Redo
3 Rewind to checkpoint

╭─ Agent ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > /undo │
╰─────────────────────────────────────────────────────────────────────────────────────────── Cortex Mini 1 (medium) ─╯

↑↓:select | Enter:confirm | Esc:close
12 changes: 12 additions & 0 deletions docs/media/tui-lock-v2/txt/40x12/composer-file-chip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
14K / 500K






╭─ Agent ────────────────────────────╮
│ > explain @src/composer.rs │
╰─────────── Cortex Mini 1 (medium) ─╯

Enter:send | @:files
12 changes: 12 additions & 0 deletions docs/media/tui-lock-v2/txt/40x12/consent-local-tools.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
14K / 500K
● Run tools locally?
This PC · current directory · Clou…
> 1 Yes — run tools here
2 Always allow project
3 No — keep using Cloud

╭─ Agent ────────────────────────────╮
│ > Choose an option above │
╰─────────── Cortex Mini 1 (medium) ─╯

Enter:confirm | Esc:cancel
12 changes: 12 additions & 0 deletions docs/media/tui-lock-v2/txt/40x12/undo-sheet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
14K / 500K
Undo
> 1 Undo last turn
2 Redo
3 Rewind…


╭─ Agent ────────────────────────────╮
│ > /undo │
╰─────────── Cortex Mini 1 (medium) ─╯

Enter:confirm | Esc:close
9 changes: 5 additions & 4 deletions scripts/render-tui-lock-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ for spec in 40x12 120x40; do
python3 scripts/ansi-frames-to-gif.py --frames "$frames" --png-only "$pngs"
done

unique_pngs "$output_dir/40x12" 38
unique_pngs "$output_dir/120x40" 84
unique_pngs "$output_dir/40x12" 41
unique_pngs "$output_dir/120x40" 87

python3 - "$output_dir" <<'PY'
from pathlib import Path
Expand Down Expand Up @@ -100,9 +100,10 @@ is banner green `#1F4945`; historical violet `#A78BFA` is not the lock.
Designer boards (pixel target) live in `docs/media/tui-lock-v2/{40x12,120x40}/`.
These runtime frames are what Designer cli signs off against.

SPEC §7: **84** boards at 120×40 and **38** at 40×12. Each filename is one
SPEC §7: **87** boards at 120×40 and **41** at 40×12. Each filename is one
distinct live state — no two PNGs share a sha256. Includes `/goal` composer
chips (`goal-chip-*`) plus distinct `offline` and `rate-limit` diagnostics.
chips (`goal-chip-*`), distinct `offline` and `rate-limit` diagnostics,
local-tools consent, composer `@file` chip, and `/undo` `/redo` `/rewind` sheet.
EOF

echo "Wrote runtime captures to $output_dir"
35 changes: 33 additions & 2 deletions src/cortex-tui/src/bin/generate_tui_lock_screenshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::path::PathBuf;
use std::process;

use cortex_tui::lock_proof::write_lock_frames;
use cortex_tui::lock_v2::write_lock_v2_frames;
use cortex_tui::lock_v2::{validate_lock_v2_only_ids, write_lock_v2_frames};

fn print_help() {
println!(
Expand All @@ -25,6 +25,7 @@ OPTIONS:
-w, --width <WIDTH> Terminal width (default: 120)
-h, --height <HEIGHT> Terminal height (default: 40)
--v2 Capture lock v2 scenes (real session chrome)
--only <IDS> Comma-separated lock v2 scene ids (with --v2)
--help Show this help
"
);
Expand All @@ -36,6 +37,8 @@ fn main() {
let mut width: u16 = 120;
let mut height: u16 = 40;
let mut v2 = false;
let mut only_flag = false;
let mut only: Vec<String> = Vec::new();

let mut i = 1;
while i < args.len() {
Expand Down Expand Up @@ -68,6 +71,20 @@ fn main() {
"--v2" => {
v2 = true;
}
"--only" => {
only_flag = true;
i += 1;
let raw = args.get(i).cloned().unwrap_or_else(|| {
eprintln!("Missing value for --only");
process::exit(1);
});
only = raw
.split(',')
.map(str::trim)
.filter(|s| !s.is_empty())
.map(str::to_string)
.collect();
}
Comment thread
cursor[bot] marked this conversation as resolved.
other => {
eprintln!("Unknown argument: {other}");
print_help();
Expand All @@ -77,8 +94,22 @@ fn main() {
i += 1;
}

if only_flag && !v2 {
eprintln!("--only requires --v2");
process::exit(1);
}

let result = if v2 {
write_lock_v2_frames(width, height, &output)
if only_flag {
let ids: Vec<&str> = only.iter().map(String::as_str).collect();
if let Err(err) = validate_lock_v2_only_ids(&ids, width) {
eprintln!("{err:#}");
process::exit(1);
}
cortex_tui::lock_v2::write_lock_v2_id_frames(&ids, width, height, &output)
} else {
write_lock_v2_frames(width, height, &output)
}
} else {
write_lock_frames(width, height, &output)
};
Expand Down
1 change: 1 addition & 0 deletions src/cortex-tui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ mod lock_v2_boards;
mod lock_v2_goal;
mod lock_v2_ids;
mod lock_v2_network;
mod lock_v2_parity;
mod lock_v2_scenes;
pub mod readme_hero;
pub mod readme_hero_boards;
Expand Down
Loading