Skip to main content

klasp_agents_codex/
lib.rs

1//! `klasp-agents-codex` — Codex `AgentSurface` impl.
2//!
3//! v0.2 W1 shipped the AGENTS.md managed-block writer. W2 (#28, this
4//! module set) layers the git `pre-commit` / `pre-push` hook writer on
5//! top, with conflict detection for husky / lefthook / pre-commit
6//! framework. W3 (#29) wires `klasp install --agent codex` through the
7//! CLI and surfaces the [`git_hooks::HookWarning`]s in the install
8//! output.
9
10pub mod agents_md;
11pub mod git_hooks;
12pub mod surface;
13
14// Crate-root re-exports below mirror the W1 shape: AGENTS.md helpers
15// keep their unprefixed names (the v0.2 W1 PR exported them at the
16// crate root, and downstream callers — including W3 — depend on that).
17// The git-hook helpers, which name-clash on `MANAGED_START` /
18// `MANAGED_END` / `install_block` / `uninstall_block`, are exposed via
19// the `git_hooks` submodule path only — `git_hooks::install_block(…)`,
20// not a root-level `install_hook_block`. Keeping the file-format choice
21// in the import path makes mis-routing (e.g. shell helpers applied to
22// markdown) impossible at the type level.
23pub use agents_md::{
24    contains_block, install_block, render_managed_block, uninstall_block, AgentsMdError,
25    DEFAULT_BLOCK_BODY, MANAGED_END, MANAGED_START,
26};
27// `HookError` stays accessible via the `git_hooks` submodule path for the
28// few callers that need it (it's the return type of the pure block-writer
29// helpers `install_block` / `uninstall_block` / `contains_block`); we
30// don't surface it at the crate root because the public install / uninstall
31// API on `CodexSurface` returns `InstallError`, not `HookError`.
32pub use git_hooks::{HookConflict, HookKind, HookWarning};
33pub use surface::{CodexInstallReport, CodexSurface};