From 0fcdf4ed0d068d7556eb722ceb0861de1b6c17ad Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Mon, 2 Mar 2026 04:01:07 +0000 Subject: [PATCH] Don't require user to specify target directory. (#6) Reviewed-on: https://git.tiramisu.one/drew/skate/pulls/6 Co-authored-by: Drew Galbraith Co-committed-by: Drew Galbraith --- TODO.md | 18 ++++++++++++------ src/main.rs | 10 +++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/TODO.md b/TODO.md index 945cd7f..b1c9ab5 100644 --- a/TODO.md +++ b/TODO.md @@ -1,10 +1,16 @@ -# Cleanups +# UI Sync -- Parallelize tool-use execution in `run_turn` -- requires refactoring `Orchestrator` to use `&self` + interior mutability (`Arc>` around `event_tx`, `action_rx`, `history`) so multiple futures can borrow self simultaneously via `futures::future::join_all`. - -- Move keyboard/event reads in the TUI to a separate thread or async/io loop - Keep UI and orchestrator in sync (i.e. messages display out of order if you queue up many.) +- `:clear` clears TUI state immediately but sends `ClearHistory` to orchestrator async. A mid-stream response can ghost back in after clear. Need synchronization (e.g. clear on `TurnComplete`, or have orchestrator ack the clear). + +# Scroll + - `update_scroll` auto-follows in Insert mode, yanking viewport to bottom on mode switch. Only auto-follow when new content arrives (in `drain_ui_events`), not every frame. - `G` sets scroll to `u16::MAX` and relies on `update_scroll` clamping. Compute actual max_scroll inline, or document the contract that `update_scroll` must always run before render. -- `:clear` clears TUI state immediately but sends `ClearHistory` to orchestrator async. A mid-stream response can ghost back in after clear. Need synchronization (e.g. clear on `TurnComplete`, or have orchestrator ack the clear). -- Command overlay width: `(out.width / 2).max(80)` makes overlay full-bleed on 80-col terminals. Consider `.max(40)` or a different minimum. + +# Cleanups + +- Move keyboard/event reads in the TUI to a separate thread or async/io loop +- When a permission is denied, output a useful tools message to the agent (i.e. searching the internet is not enabled). +- Parallelize tool-use execution in `run_turn` -- requires refactoring `Orchestrator` to use `&self` + interior mutability (`Arc>` around `event_tx`, `action_rx`, `history`) so multiple futures can borrow self simultaneously via `futures::future::join_all`. + diff --git a/src/main.rs b/src/main.rs index 02ae8c3..19d470a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use anyhow::Context; /// Run skate against a project directory. /// /// ```text -/// Usage: skate --project-dir [--yolo] +/// Usage: skate [--project-dir ] [--yolo] /// ``` /// /// `ANTHROPIC_API_KEY` must be set in the environment. @@ -35,7 +35,8 @@ struct Cli { /// Parse `argv` into [`Cli`]. /// -/// Accepts `--project-dir ` (required) and `--yolo` (optional). +/// Accepts `--project-dir ` (optional, defaults to current directory) +/// and `--yolo` (optional). fn parse_cli() -> anyhow::Result { let mut project_dir: Option = None; let mut yolo = false; @@ -56,6 +57,9 @@ fn parse_cli() -> anyhow::Result { } } - let project_dir = project_dir.context("Usage: skate --project-dir [--yolo]")?; + let project_dir = match project_dir { + Some(p) => p, + None => std::env::current_dir().context("failed to determine current directory")?, + }; Ok(Cli { project_dir, yolo }) }