Skip to main content

csd/commands/
mod.rs

1//! Command implementations — the orchestration layer between the CLI ([`crate::cli`]) and the
2//! primitives ([`crate::tmux`], [`crate::session`], [`crate::backend`], [`crate::detect`]).
3//!
4//! Each command returns a `Serialize` result; `main` renders it as JSON.
5
6pub mod approve;
7pub mod kill;
8pub mod ps;
9pub mod send;
10pub mod spawn;
11pub mod state;
12
13use std::time::Duration;
14
15/// Default detached-pane size — generous so the TUI renders and capture-pane has room (PoC §2.1).
16pub const DEFAULT_WIDTH: u16 = 220;
17pub const DEFAULT_HEIGHT: u16 = 50;
18
19/// How long to wait for injected keystrokes to settle before checking the echo (PoC gotcha #1).
20pub const SEND_SETTLE: Duration = Duration::from_millis(800);
21/// Pause between a confirmed prompt echo and pressing Enter (PoC §2.2).
22pub const SUBMIT_DELAY: Duration = Duration::from_millis(1000);
23/// Pause between sending a menu digit and pressing Enter (PoC §2.3).
24pub const APPROVE_DELAY: Duration = Duration::from_millis(1000);
25/// Default number of send→verify-echo attempts before giving up.
26pub const DEFAULT_SEND_RETRIES: u32 = 5;
27
28/// How long to watch for the one-time folder-trust gate after spawning with `--trust`.
29pub const TRUST_POLL_ATTEMPTS: u32 = 12;
30pub const TRUST_POLL_INTERVAL: Duration = Duration::from_millis(600);