polyhook-core 0.1.2

Core types and utilities for polyhook — write AI coding agent hooks once, run them everywhere
Documentation
1
2
3
4
5
6
7
8
9
use crate::{read_from, respond_to, HookEvent, HookResponse};

pub fn read() -> Result<HookEvent, String> {
    read_from(&mut std::io::stdin())
}

pub fn respond(response: &HookResponse) -> Result<(), String> {
    respond_to(&mut std::io::stdout(), response)
}