TUI hosts sessions: new-session form, named worktrees, resume, faster permissions
- Use the terminal's own colors and background; the key bar and the Needs-you panel wrap, fixed-width panels shrink on narrow terminals. - Sessions run on threads of the TUI (tui/host.rs), capped by the profile's `workers`; quitting asks for `yes` and suspends them. New `suspend` command keeps the state so a session can be resumed. - `N` opens a new-session form: machine, name, --after, a named branch or worktree (place.rs; never deleted by orch), and a "keep for a PR" option. - `u` resumes suspended sessions and ones whose process died. - `A` allows identical permission requests across sessions, `P` saves an allow rule to the profile with toml_edit (comments kept). - Fix clippy lint in report.rs so tests/all.sh passes; add GLOSSARY.md. Includes the already staged `orch init` work (init.rs, example profile). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a80bc9fe1
commit
cfb735cdb3
22 files changed
+1623
-115
No files matched your search
+28
-3
@@ -106,13 +106,38 @@ impl Machine {
|
||||
Self::parse(&text).with_context(|| format!("machine {}", path.display()))
|
||||
}
|
||||
|
||||
/// `<name>.toml` in `<repo>/.hx/machines/`, then `~/.hx/machines/`.
|
||||
pub fn find(name: &str, repo: &Path) -> Result<Self> {
|
||||
let file = format!("{name}.toml");
|
||||
fn dirs(repo: &Path) -> Vec<PathBuf> {
|
||||
let mut dirs = vec![repo.join(".hx/machines")];
|
||||
if let Some(h) = std::env::var_os("HOME") {
|
||||
dirs.push(PathBuf::from(h).join(".hx/machines"));
|
||||
}
|
||||
dirs
|
||||
}
|
||||
|
||||
/// Names of the machine files in `<repo>/.hx/machines/` and `~/.hx/machines/`, sorted, without duplicates.
|
||||
pub fn names(repo: &Path) -> Vec<String> {
|
||||
let mut v: Vec<String> = Self::dirs(repo)
|
||||
.iter()
|
||||
.filter_map(|d| std::fs::read_dir(d).ok())
|
||||
.flatten()
|
||||
.flatten()
|
||||
.filter_map(|e| {
|
||||
let p = e.path();
|
||||
if p.extension()? != "toml" {
|
||||
return None;
|
||||
}
|
||||
p.file_stem()?.to_str().map(String::from)
|
||||
})
|
||||
.collect();
|
||||
v.sort();
|
||||
v.dedup();
|
||||
v
|
||||
}
|
||||
|
||||
/// `<name>.toml` in `<repo>/.hx/machines/`, then `~/.hx/machines/`.
|
||||
pub fn find(name: &str, repo: &Path) -> Result<Self> {
|
||||
let file = format!("{name}.toml");
|
||||
let dirs = Self::dirs(repo);
|
||||
for d in &dirs {
|
||||
if d.join(&file).is_file() {
|
||||
return Self::load(&d.join(&file));
|
||||
|
||||
Reference in new issue
Block a user