rename: adopt yoi identity
This commit is contained in:
@@ -221,14 +221,14 @@ pub async fn launch() -> ExitCode {
|
||||
let data_dir = match manifest::paths::data_dir() {
|
||||
Some(path) => path,
|
||||
None => {
|
||||
eprintln!("insomnia keys: could not determine insomnia data directory");
|
||||
eprintln!("yoi keys: could not determine yoi data directory");
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
};
|
||||
match run(SecretStore::new(data_dir)) {
|
||||
Ok(()) => ExitCode::SUCCESS,
|
||||
Err(err) => {
|
||||
eprintln!("insomnia keys: {err}");
|
||||
eprintln!("yoi keys: {err}");
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,7 @@ fn draw(frame: &mut Frame<'_>, app: &KeysApp) {
|
||||
fn title_line(app: &KeysApp) -> Line<'_> {
|
||||
Line::from(vec![
|
||||
Span::styled(
|
||||
"insomnia keys local secrets",
|
||||
"yoi keys local secrets",
|
||||
Style::default().add_modifier(Modifier::BOLD),
|
||||
),
|
||||
Span::raw(" "),
|
||||
|
||||
@@ -38,20 +38,20 @@ pub enum LaunchMode {
|
||||
Spawn {
|
||||
profile: Option<String>,
|
||||
},
|
||||
/// `insomnia <name>` / `insomnia --pod <name>`: attach to a live Pod by name if
|
||||
/// `yoi <name>` / `yoi --pod <name>`: attach to a live Pod by name if
|
||||
/// possible; otherwise launch the Pod runtime command with `--pod <name>` so it
|
||||
/// resumes from name-keyed state or creates a fresh same-name Pod.
|
||||
PodName {
|
||||
pod_name: String,
|
||||
socket_override: Option<PathBuf>,
|
||||
},
|
||||
/// `insomnia -r` / `insomnia --resume`: open the Pod picker, then attach to the
|
||||
/// `yoi -r` / `yoi --resume`: open the Pod picker, then attach to the
|
||||
/// selected live Pod or restore the selected stopped Pod by name.
|
||||
Resume,
|
||||
/// `insomnia --session <UUID>`: skip the picker, go straight to the
|
||||
/// `yoi --session <UUID>`: skip the picker, go straight to the
|
||||
/// resume name dialog with `id` baked in.
|
||||
ResumeWithSession(SegmentId),
|
||||
/// `insomnia --multi`: open the multi-Pod dashboard. This is intentionally
|
||||
/// `yoi --multi`: open the multi-Pod dashboard. This is intentionally
|
||||
/// separate from `-r`/`--resume`, which keeps its single-Pod picker
|
||||
/// meaning.
|
||||
Multi,
|
||||
@@ -64,12 +64,12 @@ pub async fn launch(options: LaunchOptions) -> ExitCode {
|
||||
} = options;
|
||||
|
||||
if let Err(e) = enable_raw_mode() {
|
||||
eprintln!("insomnia: failed to enter raw mode: {e}");
|
||||
eprintln!("yoi: failed to enter raw mode: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
if let Err(e) = execute!(io::stdout(), EnableBracketedPaste) {
|
||||
let _ = disable_raw_mode();
|
||||
eprintln!("insomnia: {e}");
|
||||
eprintln!("yoi: {e}");
|
||||
return ExitCode::FAILURE;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ pub async fn launch(options: LaunchOptions) -> ExitCode {
|
||||
// duplicate. Other errors (pod-name failures, terminal setup
|
||||
// hiccups, etc.) need surfacing here.
|
||||
if e.downcast_ref::<spawn::SpawnError>().is_none() {
|
||||
eprintln!("insomnia: {e}");
|
||||
eprintln!("yoi: {e}");
|
||||
}
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ impl std::fmt::Display for MultiPodError {
|
||||
Self::Store(e) => write!(f, "session store error: {e}"),
|
||||
Self::NoPods => write!(
|
||||
f,
|
||||
"no pods found — start a fresh pod with `insomnia` or restore one with `insomnia -r`"
|
||||
"no pods found — start a fresh pod with `yoi` or restore one with `yoi -r`"
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ impl std::fmt::Display for PickerError {
|
||||
Self::Store(e) => write!(f, "session store error: {e}"),
|
||||
Self::NoPods => write!(
|
||||
f,
|
||||
"no pods found — start a fresh pod with `insomnia` and try again"
|
||||
"no pods found — start a fresh pod with `yoi` and try again"
|
||||
),
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ fn default_store_dir() -> Result<PathBuf, PickerError> {
|
||||
PickerError::Io(io::Error::new(
|
||||
io::ErrorKind::NotFound,
|
||||
"could not resolve sessions directory \
|
||||
(set INSOMNIA_HOME, INSOMNIA_DATA_DIR, or HOME)",
|
||||
(set YOI_HOME, YOI_DATA_DIR, or HOME)",
|
||||
))
|
||||
})
|
||||
}
|
||||
@@ -181,7 +181,7 @@ fn default_pod_store_dir() -> Result<PathBuf, PickerError> {
|
||||
PickerError::Io(io::Error::new(
|
||||
io::ErrorKind::NotFound,
|
||||
"could not resolve pod state directory \
|
||||
(set INSOMNIA_HOME, INSOMNIA_DATA_DIR, or HOME)",
|
||||
(set YOI_HOME, YOI_DATA_DIR, or HOME)",
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ fn resolve_socket(pod_name: &str, override_path: Option<PathBuf>) -> PathBuf {
|
||||
}
|
||||
manifest::paths::pod_socket_path(pod_name).unwrap_or_else(|| {
|
||||
PathBuf::from("/tmp")
|
||||
.join("insomnia")
|
||||
.join("yoi")
|
||||
.join(pod_name)
|
||||
.join("sock")
|
||||
})
|
||||
@@ -307,7 +307,7 @@ impl TerminalEventReader {
|
||||
let stop = Arc::new(AtomicBool::new(false));
|
||||
let thread_stop = Arc::clone(&stop);
|
||||
let thread = thread::Builder::new()
|
||||
.name("insomnia-tui-terminal-reader".to_string())
|
||||
.name("yoi-tui-terminal-reader".to_string())
|
||||
.spawn(move || read_terminal_events(thread_stop, tx))?;
|
||||
|
||||
Ok((
|
||||
|
||||
+10
-10
@@ -1,11 +1,11 @@
|
||||
//! Inline-viewport "spawn Pod and attach" UX.
|
||||
//!
|
||||
//! Rendered at the user's current cursor position when `insomnia` is invoked
|
||||
//! with no positional argument. Discovers `.insomnia/profiles.toml` profile
|
||||
//! Rendered at the user's current cursor position when `yoi` is invoked
|
||||
//! with no positional argument. Discovers `.yoi/profiles.toml` profile
|
||||
//! choices plus bundled profiles, defaults to the builtin profile, prompts for
|
||||
//! the Pod's name, and on confirmation launches the Pod runtime command as an
|
||||
//! independent process. Once the process reports its socket via the
|
||||
//! `INSOMNIA-READY` stderr line, the dialog hands control back so main can
|
||||
//! `YOI-READY` stderr line, the dialog hands control back so main can
|
||||
//! switch the terminal to alternate-screen mode.
|
||||
//!
|
||||
//! The viewport's last frame stays in the terminal's scrollback so the
|
||||
@@ -654,10 +654,10 @@ mod tests {
|
||||
fn profile_choices_use_project_registry_default() {
|
||||
let temp = tempfile::tempdir().unwrap();
|
||||
let project = temp.path().join("project");
|
||||
let insomnia = project.join(".insomnia");
|
||||
std::fs::create_dir_all(&insomnia).unwrap();
|
||||
let yoi = project.join(".yoi");
|
||||
std::fs::create_dir_all(&yoi).unwrap();
|
||||
std::fs::write(
|
||||
insomnia.join("profiles.toml"),
|
||||
yoi.join("profiles.toml"),
|
||||
r#"
|
||||
default = "coder"
|
||||
[profile]
|
||||
@@ -678,10 +678,10 @@ coder = "profiles/coder.lua"
|
||||
fn profile_choices_include_builtin_and_project_default_marker() {
|
||||
let temp = tempfile::tempdir().unwrap();
|
||||
let project = temp.path().join("project");
|
||||
let insomnia = project.join(".insomnia");
|
||||
std::fs::create_dir_all(&insomnia).unwrap();
|
||||
let yoi = project.join(".yoi");
|
||||
std::fs::create_dir_all(&yoi).unwrap();
|
||||
std::fs::write(
|
||||
insomnia.join("profiles.toml"),
|
||||
yoi.join("profiles.toml"),
|
||||
r#"
|
||||
default = "coder"
|
||||
[profile.coder]
|
||||
@@ -695,7 +695,7 @@ description = "Project coder"
|
||||
assert_eq!(choices[0].selector.as_deref(), Some("builtin:default"));
|
||||
assert_eq!(
|
||||
choices[0].label,
|
||||
"builtin:default — Bundled default Insomnia coding profile"
|
||||
"builtin:default — Bundled default Yoi coding profile"
|
||||
);
|
||||
assert_eq!(default_index, 1);
|
||||
assert_eq!(choices[1].selector.as_deref(), Some("project:coder"));
|
||||
|
||||
Reference in New Issue
Block a user