pub mod claude_code;
pub mod cline;
pub mod codex_cli;
pub mod cursor;
pub mod opencode;
use crate::core::envelope::alias::AliasTable;
use crate::hooks::binding::EnvCommand;
#[derive(Debug)]
#[cfg_attr(not(windows), allow(dead_code))] pub(crate) struct EnvFileDelivery {
pub agent: &'static str,
pub commands: &'static [EnvCommand],
pub defaults: &'static [(&'static str, &'static str)],
}
pub(crate) const ENV_FILE_DELIVERIES: &[EnvFileDelivery] = &[
EnvFileDelivery {
agent: cursor::CursorBinding::AGENT_TYPE,
commands: cursor::CURSOR_COMMANDS,
defaults: &[],
},
EnvFileDelivery {
agent: opencode::OpencodeBinding::AGENT_TYPE,
commands: opencode::OPENCODE_COMMANDS,
defaults: opencode::OPENCODE_DEFAULTS,
},
EnvFileDelivery {
agent: cline::ClineBinding::AGENT_TYPE,
commands: cline::CLINE_COMMANDS,
defaults: cline::CLI_ENV_DEFAULTS,
},
];
fn tables() -> [&'static AliasTable; 5] {
[
&claude_code::ALIASES,
&codex_cli::ALIASES,
&cursor::ALIASES,
&opencode::ALIASES,
&cline::ALIASES,
]
}
pub fn aliases_for(source: &str) -> Option<&'static AliasTable> {
tables().into_iter().find(|table| table.agent == source)
}
pub fn binding_id(source: &str, renders: bool) -> String {
match aliases_for(source) {
Some(table) => table.binding_id(renders).to_string(),
None => format!("{}_hook", source.replace('-', "_")),
}
}