pub struct CodexSurface;Expand description
Codex agent surface. Stateless; the registry stores it as
Box<dyn AgentSurface>.
Implementations§
Source§impl CodexSurface
impl CodexSurface
pub const AGENT_ID: &'static str = "codex"
Sourcepub const AGENTS_MD: &'static str = "AGENTS.md"
pub const AGENTS_MD: &'static str = "AGENTS.md"
Filename of the markdown file Codex reads from the repo root.
Sourcepub const PRE_COMMIT_RELPATH: &'static [&'static str]
pub const PRE_COMMIT_RELPATH: &'static [&'static str]
Repo-relative path of the git pre-commit hook.
Sourcepub const PRE_PUSH_RELPATH: &'static [&'static str]
pub const PRE_PUSH_RELPATH: &'static [&'static str]
Repo-relative path of the git pre-push hook.
Sourcepub const HOOK_RELPATH: &'static [&'static str] = Self::PRE_COMMIT_RELPATH
pub const HOOK_RELPATH: &'static [&'static str] = Self::PRE_COMMIT_RELPATH
Repo-relative path of the primary hook reported via the trait’s
hook_path method. Kept as pre-commit for parity with the W1
API; consumers needing both paths should use
Self::all_hook_paths.
Sourcepub fn all_hook_paths(repo_root: &Path) -> [(HookKind, PathBuf); 2]
pub fn all_hook_paths(repo_root: &Path) -> [(HookKind, PathBuf); 2]
Both managed hook paths, in install order. W3 callers that want
to render the full install report (e.g. for klasp install --dry-run)
should iterate this rather than relying on the trait’s single
hook_path.
Sourcepub fn install_detailed(
&self,
ctx: &InstallContext,
) -> Result<CodexInstallReport, InstallError>
pub fn install_detailed( &self, ctx: &InstallContext, ) -> Result<CodexInstallReport, InstallError>
Detailed install entry-point. Returns the standard
InstallReport and the list of HookWarnings collected
from the hook writer. The trait’s AgentSurface::install
method calls this and discards the warnings to keep the
cross-crate trait surface unchanged; W3’s CLI plumbing calls this
method directly so it can render warnings to the user.
Trait Implementations§
Source§impl AgentSurface for CodexSurface
impl AgentSurface for CodexSurface
Source§fn detect(&self, repo_root: &Path) -> bool
fn detect(&self, repo_root: &Path) -> bool
.claude/ for Claude Code, AGENTS.md for Codex).
klasp install --force overrides a false here.Source§fn hook_path(&self, repo_root: &Path) -> PathBuf
fn hook_path(&self, repo_root: &Path) -> PathBuf
Source§fn settings_path(&self, repo_root: &Path) -> PathBuf
fn settings_path(&self, repo_root: &Path) -> PathBuf
Source§fn render_hook_script(&self, ctx: &InstallContext) -> String
fn render_hook_script(&self, ctx: &InstallContext) -> String
install and by --dry-run.Source§fn install(&self, ctx: &InstallContext) -> Result<InstallReport, InstallError>
fn install(&self, ctx: &InstallContext) -> Result<InstallReport, InstallError>
already_installed = true on the second run.