/** * CleoOS CAAMP hooks bridge — Pi event → CLEO hook translation. * * CANONICAL LOCATION: `packages/cleo-os/extensions/cleo-hooks-bridge.ts` * * Installed to: $XDG_DATA_HOME/cleo/extensions/cleo-hooks-bridge.js * Loaded by: Pi via `--extension ` injected by CleoOS cli.ts * * Bridges Pi runtime events to CLEO's CAAMP hook vocabulary so that * CLEO's existing hook handlers (session-hooks, task-hooks, conduit-hooks) * are informed of Pi activity without requiring any changes to the hook * substrate. * * Event → CAAMP mapping: * Pi `tool_call` → `cleo memory observe` (PreToolUse) * Pi `tool_result` → `cleo memory observe` (PostToolUse) * Pi `before_agent_start` → `cleo memory observe` (SubagentStart) * * All observations are stored with `--type discovery` and `--sourceType auto` * so they are distinguished from manual observations. * * Design constraints: * - Best-effort: never crash Pi — all CLI calls wrapped in try/catch * - NO top-level await; all work inside event handlers * - Rate-limited: at most 1 observation per event type per 500 ms to * avoid flooding brain.db with high-frequency tool calls * - Tool names are sanitised before storage (no shell injection risk * because we use execFileAsync, not shell) * * @packageDocumentation */ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; /** * Pi extension factory for the CAAMP hooks bridge. * * Registers: * - `tool_call` → PreToolUse observation * - `tool_result` → PostToolUse observation * - `before_agent_start` → SubagentStart observation * * @param pi - The Pi extension API instance. */ export default function (pi: ExtensionAPI): void; //# sourceMappingURL=cleo-hooks-bridge.d.ts.map