Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
feat: add omp integration
AkitaOnRails14762fcc0f70
diff --git a/README.md b/README.mdindex 4a592d69..3067e564 100644--- a/README.md+++ b/README.md@@ -49,8 +49,8 @@ priors are at the [bottom](#influences-and-prior-art).mode. Mounted on the same axum server as MCP.- **Multi-agent + multi-machine ready.** Supported clients: ClaudeCode, Codex, OpenCode, Cursor, Claude Desktop (via `mcp-remote`),- Gemini CLI, OpenClaw. Server runs local (loopback) OR on a homelab- box (LAN/VPN/cloud) with bearer-token auth.+ Gemini CLI, OpenClaw, Oh My Pi / OMP. Server runs local (loopback)+ OR on a homelab box (LAN/VPN/cloud) with bearer-token auth.- **Thin-client CLI.** `ai-memory bootstrap`, `purge-project`,`rename-project`, `lint`, `embed`, `forget-sweep`, `backup` areall HTTP clients of the running server - never touch SQLite or@@ -90,7 +90,7 @@ priors are at the [bottom](#influences-and-prior-art).## Quick start-You need: Docker + an agent CLI (Claude Code, Codex, OpenCode, Cursor,+You need: Docker + an agent CLI (Claude Code, Codex, OpenCode, OMP, Cursor,or anything else that speaks MCP).The default quick-start has **no authentication** - the server binds@@ -129,7 +129,8 @@ docker run -d --name ai-memory \# 3. Wire your agent CLI in two commands. The wrapper takes care of# mounts + auto-detecting ~/.claude/settings.json. Re-run with-# `--agent codex`, `--agent opencode`, `--client cursor`, etc.+# `--agent codex`, `--agent opencode`, `--agent omp`,+# `--client cursor`, etc.# for additional agents; full list in docs/install.md.ai-memory install-mcp --client claude-code --applyai-memory install-hooks --agent claude-code --apply@@ -199,7 +200,7 @@ source (e.g. a fork or a tagged release).> read-only); daily use from inside the sandbox needs no binary at> all (agents reach ai-memory over MCP).-**For everything else** - Codex, OpenCode, Cursor, Claude Desktop,+**For everything else** - Codex, OpenCode, OMP, Cursor, Claude Desktop,Gemini CLI, OpenClaw, the curl-based hook installer (no dockerneeded), running ai-memory without docker, the full subcommandreference, the homelab deploy pattern, security hardening - see@@ -693,7 +694,7 @@ data-flow diagram + crate breakdown + cross-cutting invariants.| File | What it is ||---|---|| [`docs/install.md`](docs/install.md) | **Installation cookbook.** Every agent CLI, every alternative (curl, source build, no-docker, no-auth), and the server-on-a-different-machine (homelab/LAN) walkthrough. Read after the Quick start if your setup doesn't match the happy path. |-| [`docs/mcp-install.md`](docs/mcp-install.md) | Per-client MCP config snippets (Cursor, Claude Desktop, Gemini CLI, OpenClaw, pi). |+| [`docs/mcp-install.md`](docs/mcp-install.md) | Per-client MCP config snippets (Cursor, Claude Desktop, Gemini CLI, OpenClaw, OMP). || [`docs/deploy.md`](docs/deploy.md) | Homelab deploy: bin/deploy, bearer-token auth, TLS via cloudflared. || [`docs/lifecycle-ops.md`](docs/lifecycle-ops.md) | **Read before running purge / rename / backup / restore / reset.** Safety matrix for the state-touching commands, per-project disk layout (how isolation actually works), and operator workflows for "fresh start", "snapshot before risky op", "drop one project". || [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) | Operational summary: data flow, crate layout, cross-cutting invariants, schema. |diff --git a/crates/ai-memory-cli/src/cli.rs b/crates/ai-memory-cli/src/cli.rsindex eac6872b..6dc21aba 100644--- a/crates/ai-memory-cli/src/cli.rs+++ b/crates/ai-memory-cli/src/cli.rs@@ -328,9 +328,8 @@ pub struct RestoreArgs {pub force: bool,}-/// Agent CLI to install hooks for. Only the three with lifecycle-/// hooks are listed; for MCP-only clients (Cursor, Claude Desktop,-/// Gemini CLI, OpenClaw), use `install-mcp --client <name>` instead.+/// Agent CLI to install hooks/extensions for. For MCP-only clients+/// (Claude Desktop, OpenClaw), use `install-mcp --client <name>` instead.#[derive(Debug, Clone, Copy, clap::ValueEnum)]pub enum AgentChoice {/// Anthropic Claude Code.@@ -352,6 +351,11 @@ pub enum AgentChoice {/// them straight to `--agent`, which used to fail on this one.#[value(alias = "opencode")]OpenCode,+ /// Oh My Pi (`omp`) / Pi coding agent fork — TypeScript extension+ /// under `~/.omp/agent/extensions/`. `--apply` writes the extension+ /// file directly; restart `omp` for it to load.+ #[value(alias = "pi", alias = "oh-my-pi")]+ Omp,/// OpenClaw personal AI gateway — **no lifecycle hooks**;/// `install-hooks --apply --agent openclaw` prints an/// explanation and exits without mutating anything.@@ -383,8 +387,8 @@ pub enum McpClient {GeminiCli,/// OpenClaw personal AI gateway — `~/.openclaw/config.json`.Openclaw,- /// Mario Zechner's `pi` coding agent. NOT supported via MCP- /// upstream; this prints the explanation + alternatives.+ /// Oh My Pi (`omp`) / Pi-compatible coding agent — `~/.omp/agent/mcp.json`.+ #[value(alias = "omp", alias = "oh-my-pi")]Pi,}@@ -510,8 +514,7 @@ pub struct InstallHooksArgs {/// written next to the original before each modifying write.#[arg(long)]pub apply: bool,- /// Override the settings.json path (auto-detected as- /// `~/.claude/settings.json`).+ /// Override the settings/plugin/extension file path for the selected agent.#[arg(long)]pub config_file: Option<PathBuf>,}diff --git a/crates/ai-memory-cli/src/commands/install_hooks.rs b/crates/ai-memory-cli/src/commands/install_hooks.rsindex 84a789f3..b379c465 100644--- a/crates/ai-memory-cli/src/commands/install_hooks.rs+++ b/crates/ai-memory-cli/src/commands/install_hooks.rs@@ -40,6 +40,7 @@ pub fn run(config: &Config, args: InstallHooksArgs) -> Result<()> {if args.apply {return match args.agent {AgentChoice::OpenCode => apply_to_opencode_plugin(&args.server_url, auth, &args),+ AgentChoice::Omp => apply_to_omp_extension(&args.server_url, auth, &args),AgentChoice::ClaudeCode => {let hooks_dir = resolve_hooks_dir(args.hooks_dir.as_deref(), args.agent)?;apply_to_claude_code_settings(&hooks_dir, &args.server_url, auth, &args)@@ -74,6 +75,7 @@ pub fn run(config: &Config, args: InstallHooksArgs) -> Result<()> {}match args.agent {AgentChoice::OpenCode => render_opencode_plugin(&args.server_url, auth),+ AgentChoice::Omp => render_omp_extension(&args.server_url, auth),AgentChoice::ClaudeCode => {let hooks_dir = resolve_hooks_dir(args.hooks_dir.as_deref(), args.agent)?;render_claude_code(&hooks_dir, &args.server_url, auth)@@ -644,6 +646,257 @@ export default AiMemoryHooks;)}+/// Generate an Oh My Pi extension at `~/.omp/agent/extensions/ai-memory.ts`.+///+/// OMP discovers direct `*.ts` / `*.js` files under `~/.omp/agent/extensions/`+/// at startup, so no separate settings merge is needed. The extension uses OMP's+/// lifecycle API for capture and `before_agent_start` for handoff injection.+fn apply_to_omp_extension(+ server_url: &str,+ auth_token: Option<&str>,+ args: &InstallHooksArgs,+) -> Result<()> {+ let path = resolve_omp_extension_path(args)?;+ let body = build_omp_extension(server_url, auth_token);++ let outcome = apply_atomic(&path, move |_existing| Ok(body.clone()))?;+ println!(+ "✓ {} {} ({})",+ outcome.verb(),+ path.display(),+ match outcome {+ ApplyOutcome::Created => "new extension file",+ ApplyOutcome::Updated => "backup written next to it",+ ApplyOutcome::NoOp => "already up to date",+ }+ );+ if !matches!(outcome, ApplyOutcome::NoOp) {+ println!();+ println!(+ "OMP auto-loads direct TypeScript extensions from ~/.omp/agent/extensions/ on next start."+ );+ println!("If you're already inside an `omp` session, restart it for the");+ println!("new extension to take effect.");+ }+ Ok(())+}++fn render_omp_extension(server_url: &str, auth_token: Option<&str>) -> Result<()> {+ println!("// Oh My Pi / OMP extension — write to ~/.omp/agent/extensions/ai-memory.ts");+ println!("// Or re-run with `--apply` to install it automatically.");+ println!("// Restart OMP after changing extensions; config is loaded at startup.");+ println!();+ println!("{}", build_omp_extension(server_url, auth_token));+ Ok(())+}++fn resolve_omp_extension_path(args: &InstallHooksArgs) -> Result<PathBuf> {+ if let Some(p) = &args.config_file {+ return Ok(p.clone());+ }+ Ok(dirs::home_dir()+ .context("could not locate $HOME for ~/.omp/agent/extensions")?+ .join(".omp")+ .join("agent")+ .join("extensions")+ .join("ai-memory.ts"))+}++fn build_omp_extension(server_url: &str, auth_token: Option<&str>) -> String {+ let token_line = auth_token+ .map(|t| format!("const TOKEN: string | null = {};\n", ts_string_literal(t)))+ .unwrap_or_else(|| "const TOKEN: string | null = null;\n".to_string());+ format!(+ r#"// Auto-generated by `ai-memory install-hooks --agent omp --apply`.+// Edit by re-running the command, not by hand — install-hooks+// will overwrite this file (with a `.bak-<ts>` backup) on each+// re-run.++const SERVER = {server_literal}.replace(/\/+$/, "");+const AGENT = "omp";+{token_line}++function timeoutSignal(ms: number): AbortSignal | undefined {{+ if (typeof AbortSignal === "undefined") return undefined;+ const factory = (AbortSignal as unknown as {{ timeout?: (ms: number) => AbortSignal }}).timeout;+ return factory ? factory(ms) : undefined;+}}++function authHeaders(): Record<string, string> {{+ return TOKEN ? {{ Authorization: `Bearer ${{TOKEN}}` }} : {{}};+}}++function sessionID(ctx: any): string | undefined {{+ const id = ctx?.sessionManager?.getSessionId?.();+ return typeof id === "string" && id.length > 0 ? id : undefined;+}}++function modelName(model: any): string | undefined {{+ const name = model?.id ?? model?.name ?? model?.model;+ return typeof name === "string" && name.length > 0 ? name : undefined;+}}++function sessionPayload(ctx: any): Record<string, unknown> {{+ return {{+ sessionID: sessionID(ctx),+ cwd: ctx?.cwd,+ model: modelName(ctx?.model),+ }};+}}++function stringify(value: unknown): string {{+ if (value === null || value === undefined) return "";+ if (typeof value === "string") return value;+ try {{+ return JSON.stringify(value);+ }} catch (_e) {{+ return String(value);+ }}+}}++function contentToText(content: unknown): string {{+ if (content === null || content === undefined) return "";+ if (!Array.isArray(content)) return stringify(content);+ return content+ .map((part: any) => {{+ if (typeof part?.text === "string") return part.text;+ if (typeof part?.content === "string") return part.content;+ if (typeof part?.type === "string") return `[${{part.type}}]`;+ return stringify(part);+ }})+ .filter(Boolean)+ .join("\n\n")+ .trim();+}}++const startedSessions = new Set<string>();+const handoffChecked = new Set<string>();+const preCompactLast = new Map<string, number>();++function startSession(ctx: any, extra: Record<string, unknown> = {{}}): void {{+ const id = sessionID(ctx);+ if (!id || startedSessions.has(id)) return;+ startedSessions.add(id);+ postHook("session-start", {{ ...sessionPayload(ctx), ...extra }});+}}++function postPreCompact(ctx: any): void {{+ startSession(ctx);+ const key = sessionID(ctx) || "unknown";+ const now = Date.now();+ const last = preCompactLast.get(key) ?? 0;+ if (now - last < 1000) return;+ preCompactLast.set(key, now);+ postHook("pre-compact", sessionPayload(ctx));+}}++function postHook(event: string, payload: Record<string, unknown>): void {{+ const url = new URL(`${{SERVER}}/hook`);+ url.searchParams.set("event", event);+ url.searchParams.set("agent", AGENT);+ try {{+ void fetch(url, {{+ method: "POST",+ headers: {{ "Content-Type": "application/json", ...authHeaders() }},+ body: JSON.stringify(payload),+ signal: timeoutSignal(500),+ }}).catch(() => undefined);+ }} catch (_e) {{+ // Fire-and-forget. Hooks must never block the agent.+ }}+}}++async function fetchHandoff(cwd: string): Promise<string | undefined> {{+ const url = new URL(`${{SERVER}}/handoff`);+ url.searchParams.set("agent", AGENT);+ url.searchParams.set("cwd", cwd);+ try {{+ const response = await fetch(url, {{+ headers: authHeaders(),+ signal: timeoutSignal(1000),+ }});+ const text = (await response.text()).trim();+ return text.length > 0 ? text : undefined;+ }} catch (_e) {{+ return undefined;+ }}+}}++export default function AiMemoryExtension(api: any): void {{+ api.on("session_start", (_event: any, ctx: any) => {{+ startSession(ctx);+ }});++ api.on("before_agent_start", async (event: any, ctx: any) => {{+ startSession(ctx);+ postHook("user-prompt", {{+ ...sessionPayload(ctx),+ prompt: event?.prompt,+ imageCount: Array.isArray(event?.images) ? event.images.length : undefined,+ }});++ const id = sessionID(ctx);+ if (!id || handoffChecked.has(id)) return;+ handoffChecked.add(id);+ const handoff = await fetchHandoff(ctx?.cwd ?? "");+ if (!handoff) return;+ return {{+ message: {{+ customType: "ai-memory-handoff",+ content: handoff,+ display: false,+ attribution: "agent",+ }},+ }};+ }});++ api.on("tool_call", (event: any, ctx: any) => {{+ startSession(ctx);+ postHook("pre-tool-use", {{+ ...sessionPayload(ctx),+ tool: event?.toolName,+ callID: event?.toolCallId,+ args: event?.input,+ }});+ }});++ api.on("tool_result", (event: any, ctx: any) => {{+ startSession(ctx);+ postHook("post-tool-use", {{+ ...sessionPayload(ctx),+ tool: event?.toolName,+ callID: event?.toolCallId,+ args: event?.input,+ output: contentToText(event?.content),+ details: event?.details,+ isError: event?.isError,+ }});+ }});++ api.on("session_before_compact", (_event: any, ctx: any) => {{+ postPreCompact(ctx);+ }});++ api.on("session.compacting", (_event: any, ctx: any) => {{+ postPreCompact(ctx);+ }});++ api.on("agent_end", (_event: any, ctx: any) => {{+ startSession(ctx);+ postHook("stop", sessionPayload(ctx));+ }});++ api.on("session_shutdown", (_event: any, ctx: any) => {{+ startSession(ctx);+ postHook("session-end", sessionPayload(ctx));+ }});+}}+"#,+ server_literal = ts_string_literal(server_url),+ token_line = token_line,+ )+}+/// Emit a TypeScript string literal containing `s`. Escapes/// backslashes, double quotes, and newlines. Sufficient for the/// URL + auth-token + path strings we embed; the generated file is@@ -779,9 +1032,10 @@ fn resolve_hooks_dir(explicit: Option<&Path>, agent: AgentChoice) -> Result<PathAgentChoice::Cursor => "cursor",AgentChoice::GeminiCli => "gemini-cli",AgentChoice::OpenCode => "opencode",- // OpenClaw has no hooks → no script dir needed. Return a+ // OMP/OpenClaw have no shell hook scripts → no script dir needed. Return a// sentinel that's never touched; the caller's apply path// short-circuits before any filesystem use.+ AgentChoice::Omp => return Ok(PathBuf::from("/dev/null")),AgentChoice::Openclaw => return Ok(PathBuf::from("/dev/null")),};if let Some(p) = explicit {@@ -921,6 +1175,53 @@ mod tests {);}+ // ----------------------------------------------------------------+ // OMP tests+ // ----------------------------------------------------------------++ #[test]+ fn omp_extension_uses_native_lifecycle_events() {+ let extension = build_omp_extension("http://127.0.0.1:49374", Some("tok"));++ assert!(extension.contains("export default function AiMemoryExtension"));+ assert!(extension.contains("const AGENT = \"omp\";"));+ assert!(extension.contains("api.on(\"session_start\""));+ assert!(extension.contains("api.on(\"before_agent_start\""));+ assert!(extension.contains("api.on(\"tool_call\""));+ assert!(extension.contains("api.on(\"tool_result\""));+ assert!(extension.contains("api.on(\"session_shutdown\""));+ assert!(extension.contains("postHook(\"session-start\""));+ assert!(extension.contains("postHook(\"user-prompt\""));+ assert!(extension.contains("fetchHandoff"));+ assert!(extension.contains("Bearer ${TOKEN}"));+ assert!(extension.contains("tok"));+ }++ #[test]+ fn omp_extension_is_directly_discoverable_by_omp() {+ let tmp = TempDir::new().unwrap();+ let args = InstallHooksArgs {+ agent: AgentChoice::Omp,+ hooks_dir: None,+ server_url: "http://127.0.0.1:49374".into(),+ auth_token: None,+ apply: true,+ config_file: Some(tmp.path().join("extensions").join("ai-memory.ts")),+ };++ let path = resolve_omp_extension_path(&args).unwrap();+ assert_eq!(+ path.file_name().and_then(|s| s.to_str()),+ Some("ai-memory.ts")+ );+ assert_eq!(+ path.parent()+ .and_then(|p| p.file_name())+ .and_then(|s| s.to_str()),+ Some("extensions")+ );+ }+// ----------------------------------------------------------------// Cursor tests// ----------------------------------------------------------------diff --git a/crates/ai-memory-cli/src/commands/install_mcp.rs b/crates/ai-memory-cli/src/commands/install_mcp.rsindex 20246fc2..16f949d2 100644--- a/crates/ai-memory-cli/src/commands/install_mcp.rs+++ b/crates/ai-memory-cli/src/commands/install_mcp.rs@@ -11,9 +11,8 @@//! community-standard `npx mcp-remote` stdio shim so the same HTTP//! endpoint still works.//!-//! For clients that don't support MCP at all (`pi` per the upstream-//! author's stated position), we print an explanation + pointers-//! instead of fabricating a config.+//! OMP/Pi uses a native `~/.omp/agent/mcp.json` file with the same+//! `mcpServers` root as several other clients.use std::path::PathBuf;@@ -36,12 +35,6 @@ pub fn run(config: &Config, args: InstallMcpArgs) -> Result<()> {..args};if args.apply {- if matches!(args.client, McpClient::Pi) {- bail!(- "--apply is not supported for `pi` — pi has no MCP config to mutate. \- Run without --apply to print the non-support explanation."- );- }return apply_to_config_file(&args);}let snippet = match args.client {@@ -52,7 +45,7 @@ pub fn run(config: &Config, args: InstallMcpArgs) -> Result<()> {McpClient::ClaudeDesktop => render_claude_desktop(&args)?,McpClient::GeminiCli => render_gemini_cli(&args)?,McpClient::Openclaw => render_openclaw(&args)?,- McpClient::Pi => render_pi_explanation(&args),+ McpClient::Pi => render_pi(&args)?,};println!("{snippet}");Ok(())@@ -105,7 +98,7 @@ fn resolve_config_file(args: &InstallMcpArgs) -> Result<PathBuf> {}McpClient::GeminiCli => home.join(".gemini").join("settings.json"),McpClient::Openclaw => home.join(".openclaw").join("config.json"),- McpClient::Pi => bail!("pi has no MCP config file (MCP not supported)"),+ McpClient::Pi => home.join(".omp").join("agent").join("mcp.json"),})}@@ -117,7 +110,8 @@ fn apply_to_config_file(args: &InstallMcpArgs) -> Result<()> {McpClient::ClaudeCode| McpClient::ClaudeDesktop| McpClient::Cursor- | McpClient::GeminiCli => apply_atomic(&path, |existing| {+ | McpClient::GeminiCli+ | McpClient::Pi => apply_atomic(&path, |existing| {mutate_json(existing, |root| {let entry = build_mcp_entry(args)?;let servers = root@@ -161,7 +155,6 @@ fn apply_to_config_file(args: &InstallMcpArgs) -> Result<()> {McpClient::Codex => apply_atomic(&path, |existing| {mutate_toml(existing, |doc| codex_upsert_mcp_server(doc, args))})?,- McpClient::Pi => unreachable!("pi guarded above"),};println!("✓ {} {} ({})",@@ -214,6 +207,14 @@ fn build_mcp_entry(args: &InstallMcpArgs) -> Result<serde_json::Value> {entry.insert("headers".into(), json!({"Authorization": b}));}}+ McpClient::Pi => {+ entry.insert("type".into(), json!("http"));+ entry.insert("url".into(), json!(args.server_url));+ entry.insert("enabled".into(), json!(true));+ if let Some(b) = &bearer {+ entry.insert("headers".into(), json!({"Authorization": b}));+ }+ }_ => bail!("internal: build_mcp_entry called for unsupported client"),}Ok(serde_json::Value::Object(entry))@@ -520,26 +521,25 @@ fn render_openclaw(args: &InstallMcpArgs) -> Result<String> {))}-fn render_pi_explanation(_args: &InstallMcpArgs) -> String {- // No JSON to print. Plain-text explanation + pointers; mirrors- // the docs/mcp-install.md#pi section so the help is self-contained.- "# pi (@mariozechner/pi-coding-agent) — NOT supported via MCP\n\- #\n\- # pi's author has stated MCP support is not on the roadmap; see\n\- # https://mariozechner.at/posts/2025-11-30-pi-coding-agent/ for the\n\- # design rationale (token-budget concerns). agentmemory itself uses\n\- # pi's native extension surface instead of MCP.\n\- #\n\- # Options if you want ai-memory + pi:\n\- # 1. Run ai-memory and use it from another client (Claude Code,\n\- # Codex, Cursor, Gemini CLI) for the cross-agent handoff;\n\- # keep pi for code-edit sessions you don't need to persist.\n\- # 2. Use the third-party `pi-mcp-adapter` shim\n\- # (https://github.com/nicobailon/pi-mcp-adapter) — unofficial,\n\- # community-maintained, may break on pi updates.\n\- #\n\- # See docs/mcp-install.md#pi-not-supported for the full discussion.\n"- .to_string()+fn render_pi(args: &InstallMcpArgs) -> Result<String> {+ let mut entry = serde_json::Map::new();+ entry.insert("type".into(), json!("http"));+ entry.insert("url".into(), json!(args.server_url));+ entry.insert("enabled".into(), json!(true));+ if let Some(b) = bearer_header_value(args.auth_token.as_deref()) {+ entry.insert("headers".into(), json!({"Authorization": b}));+ }+ Ok(format!(+ "# Oh My Pi / OMP — merge into ~/.omp/agent/mcp.json:\n\+ #\n\+ # The current Oh My Pi package exposes the `omp` binary and native\n\+ # `.omp` config directories; `pi` is accepted here as the compatible\n\+ # client name. Restart `omp` after changing MCP config.\n\+ {snippet}\n",+ snippet = serde_json::to_string_pretty(&json!({+ "mcpServers": { args.name.as_str(): entry }+ }))?,+ ))}#[cfg(test)]@@ -578,13 +578,12 @@ mod tests {McpClient::ClaudeDesktop => render_claude_desktop(&args).unwrap(),McpClient::GeminiCli => render_gemini_cli(&args).unwrap(),McpClient::Openclaw => render_openclaw(&args).unwrap(),- McpClient::Pi => render_pi_explanation(&args),+ McpClient::Pi => render_pi(&args).unwrap(),}}- /// With `--auth-token` set, every non-pi renderer must embed the- /// Bearer header in its output. pi prints the same non-support- /// message regardless.+ /// With `--auth-token` set, every renderer must embed the Bearer+ /// header in its output.#[test]fn auth_token_threaded_into_every_client() {for client in [@@ -595,6 +594,7 @@ mod tests {McpClient::ClaudeDesktop,McpClient::GeminiCli,McpClient::Openclaw,+ McpClient::Pi,] {let out = render_with_token(client);// Every client embeds the token as `Authorization:@@ -613,8 +613,7 @@ mod tests {}/// Sanity: every supported client renders without error and the- /// output mentions the configured server URL (or, for pi, the- /// "not supported" verbiage).+ /// output mentions the configured server URL.#[test]fn every_client_renders() {for client in [@@ -628,17 +627,10 @@ mod tests {McpClient::Pi,] {let out = render_for_test(client);- if matches!(client, McpClient::Pi) {- assert!(- out.contains("NOT supported"),- "pi must explain non-support: {out}"- );- } else {- assert!(- out.contains("http://127.0.0.1:49374/mcp"),- "client {client:?} did not include the server URL in output:\n{out}"- );- }+ assert!(+ out.contains("http://127.0.0.1:49374/mcp"),+ "client {client:?} did not include the server URL in output:\n{out}"+ );}}@@ -652,7 +644,7 @@ mod tests {McpClient::ClaudeDesktop => render_claude_desktop(&args).unwrap(),McpClient::GeminiCli => render_gemini_cli(&args).unwrap(),McpClient::Openclaw => render_openclaw(&args).unwrap(),- McpClient::Pi => render_pi_explanation(&args),+ McpClient::Pi => render_pi(&args).unwrap(),}}@@ -667,6 +659,7 @@ mod tests {assert!(render_for_test(McpClient::ClaudeDesktop).contains("mcp-remote"));assert!(render_for_test(McpClient::Openclaw).contains("\"streamable-http\""));assert!(render_for_test(McpClient::Codex).contains("[mcp_servers.ai-memory]"));+ assert!(render_for_test(McpClient::Pi).contains("~/.omp/agent/mcp.json"));}/// The Codex apply path must emit block-form `[mcp_servers.<name>]`diff --git a/crates/ai-memory-cli/src/commands/setup_agent.rs b/crates/ai-memory-cli/src/commands/setup_agent.rsindex daad3915..48fcea4d 100644--- a/crates/ai-memory-cli/src/commands/setup_agent.rs+++ b/crates/ai-memory-cli/src/commands/setup_agent.rs@@ -49,8 +49,8 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {auth_token: args.auth_token.or_else(|| config.auth.bearer_token.clone()),..args};- if matches!(args.agent, AgentChoice::OpenCode) {- emit_opencode_setup_hint(&args);+ if matches!(args.agent, AgentChoice::OpenCode | AgentChoice::Omp) {+ emit_extension_setup_hint(&args);return Ok(());}let agent_sub = match args.agent {@@ -59,6 +59,7 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {AgentChoice::Cursor => "cursor",AgentChoice::GeminiCli => "gemini-cli",AgentChoice::OpenCode => unreachable!("opencode handled above"),+ AgentChoice::Omp => unreachable!("omp handled above"),AgentChoice::Openclaw => {anyhow::bail!("OpenClaw has no lifecycle hooks (only HTTP webhooks); \@@ -123,6 +124,7 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {emit_other(&emit_root, agent_sub, &args);}AgentChoice::OpenCode => unreachable!("opencode handled above"),+ AgentChoice::Omp => unreachable!("omp handled above"),AgentChoice::Openclaw => {// Unreachable — the early bail at the top of run()// catches openclaw before we get here. Defensive@@ -134,10 +136,25 @@ pub fn run(config: &Config, args: SetupAgentArgs) -> Result<()> {Ok(())}-fn emit_opencode_setup_hint(args: &SetupAgentArgs) {- println!("# OpenCode uses a TypeScript plugin, not extracted shell scripts.");+fn emit_extension_setup_hint(args: &SetupAgentArgs) {+ let (label, agent, restart_note, mcp_client) = match args.agent {+ AgentChoice::OpenCode => (+ "OpenCode",+ "opencode",+ "Then restart OpenCode so it loads ~/.config/opencode/plugins/ai-memory.ts.",+ "opencode",+ ),+ AgentChoice::Omp => (+ "OMP",+ "omp",+ "Then restart OMP so it loads ~/.omp/agent/extensions/ai-memory.ts.",+ "pi",+ ),+ _ => unreachable!("only extension-based agents reach this hint"),+ };+ println!("# {label} uses a TypeScript extension/plugin, not extracted shell scripts.");println!("# Install it directly instead:");- println!("ai-memory install-hooks --agent opencode --apply \\");+ println!("ai-memory install-hooks --agent {agent} --apply \\");if args.auth_token.is_some() {println!(" --server-url {} \\", args.server_url);println!(" --auth-token <token>");@@ -146,7 +163,8 @@ fn emit_opencode_setup_hint(args: &SetupAgentArgs) {println!(" # add --auth-token <token> if the server requires bearer auth");}println!();- println!("Also run `ai-memory install-mcp --client opencode` to wire MCP separately.");+ println!("{restart_note}");+ println!("Also run `ai-memory install-mcp --client {mcp_client}` to wire MCP separately.");}fn emit_claude_code(emit_root: &Path, args: &SetupAgentArgs) -> Result<()> {diff --git a/crates/ai-memory-core/src/ids.rs b/crates/ai-memory-core/src/ids.rsindex 98ec361c..853cf19e 100644--- a/crates/ai-memory-core/src/ids.rs+++ b/crates/ai-memory-core/src/ids.rs@@ -169,6 +169,8 @@ pub enum AgentKind {Codex,/// OpenCode (open-source coding agent).OpenCode,+ /// Oh My Pi (`omp`) / Pi-compatible coding agent.+ Omp,/// Anything else (manual capture, future agents).Other,}@@ -181,6 +183,7 @@ impl AgentKind {Self::ClaudeCode => "claude-code",Self::Codex => "codex",Self::OpenCode => "open-code",+ Self::Omp => "omp",Self::Other => "other",}}@@ -251,5 +254,8 @@ mod tests {assert_eq!(s, "\"claude-code\"");let back: AgentKind = serde_json::from_str(&s).unwrap();assert_eq!(back, k);++ let omp = serde_json::to_string(&AgentKind::Omp).unwrap();+ assert_eq!(omp, "\"omp\"");}}diff --git a/crates/ai-memory-hooks/src/payload.rs b/crates/ai-memory-hooks/src/payload.rsindex 44137dbb..7181ee71 100644--- a/crates/ai-memory-hooks/src/payload.rs+++ b/crates/ai-memory-hooks/src/payload.rs@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};pub struct HookQuery {/// Lifecycle event identifier (kebab-case or snake_case).pub event: String,- /// Agent CLI identifier (`claude-code`, `codex`, `open-code`).+ /// Agent CLI identifier (`claude-code`, `codex`, `open-code`, `omp`).pub agent: Option<String>,}@@ -100,6 +100,7 @@ pub fn parse_agent(s: &str) -> AgentKind {"claude-code" | "claude_code" | "claude" => AgentKind::ClaudeCode,"codex" => AgentKind::Codex,"open-code" | "opencode" => AgentKind::OpenCode,+ "omp" | "pi" | "oh-my-pi" => AgentKind::Omp,_ => AgentKind::Other,}}@@ -415,6 +416,9 @@ mod tests {assert_eq!(parse_agent("codex"), AgentKind::Codex);assert_eq!(parse_agent("opencode"), AgentKind::OpenCode);assert_eq!(parse_agent("open-code"), AgentKind::OpenCode);+ assert_eq!(parse_agent("omp"), AgentKind::Omp);+ assert_eq!(parse_agent("pi"), AgentKind::Omp);+ assert_eq!(parse_agent("oh-my-pi"), AgentKind::Omp);// Anything else is `Other`. Critical for the hook router:// a typo in the query string must not crash, it just gets// attributed to the catch-all bucket.diff --git a/crates/ai-memory-store/src/ops.rs b/crates/ai-memory-store/src/ops.rsindex 5475dffd..20468ccb 100644--- a/crates/ai-memory-store/src/ops.rs+++ b/crates/ai-memory-store/src/ops.rs@@ -473,6 +473,7 @@ fn agent_kind_as_str(kind: AgentKind) -> &'static str {AgentKind::ClaudeCode => "claude-code",AgentKind::Codex => "codex",AgentKind::OpenCode => "open-code",+ AgentKind::Omp => "omp",AgentKind::Other => "other",}}diff --git a/crates/ai-memory-store/src/reader.rs b/crates/ai-memory-store/src/reader.rsindex f90cbd85..823738f9 100644--- a/crates/ai-memory-store/src/reader.rs+++ b/crates/ai-memory-store/src/reader.rs@@ -1623,6 +1623,7 @@ fn parse_agent(s: &str) -> AgentKind {"claude-code" => AgentKind::ClaudeCode,"codex" => AgentKind::Codex,"open-code" => AgentKind::OpenCode,+ "omp" => AgentKind::Omp,_ => AgentKind::Other,}}diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 835e255e..2ce99121 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -7,7 +7,8 @@## Purposeai-memory is a single Rust binary that gives AI coding agents (Claude-Code, OpenAI Codex, OpenCode) long-term memory shared across CLIs.+Code, OpenAI Codex, OpenCode, OMP, and MCP-capable clients) long-term+memory shared across CLIs.Quit one mid-task; open another in the same directory; continue. Nomanual `write_note` ceremony, no copy-pasting summaries betweensessions.@@ -24,7 +25,7 @@ markdown stays the source of truth.```┌──────────────────────┐│ Claude Code / Codex │- │ / OpenCode CLI │+ │ / OpenCode / OMP │└──────────┬───────────┘lifecycle hooks │ stdio(fire-and-forget HTTP) ▼diff --git a/docs/design-decisions.md b/docs/design-decisions.mdindex 39513299..4a926eb7 100644--- a/docs/design-decisions.md+++ b/docs/design-decisions.md@@ -95,7 +95,7 @@ Why not LanceDB/Qdrant/Kuzu/CozoDB/SurrealDB?Three capture surfaces, in priority order:-1. **Lifecycle hooks** (Claude Code, Codex, OpenCode). These are fast, reliable, structured. We ship hook scripts the user installs once. Lessons from agentmemory:+1. **Lifecycle hooks/extensions** (Claude Code, Codex, OpenCode, OMP). These are fast, reliable, structured. We ship hook scripts or generated TypeScript integrations the user installs once. Lessons from agentmemory:- Hooks must be **fire-and-forget** (#221). No `await fetch()` blocking session start.- Sub-second hard timeouts on the writer side (`tokio::time::timeout`).- All hooks → single HTTP/Unix-socket POST → server queues → returns 202 immediately.diff --git a/docs/install.md b/docs/install.mdindex b44d764f..d942638b 100644--- a/docs/install.md+++ b/docs/install.md@@ -6,7 +6,7 @@ path (docker + Claude Code). This page covers everything else:- [Server on a different machine](#server-on-a-different-machine)(homelab, LAN box, remote server)- [Configuring other agent CLIs](#configuring-other-agent-clis)- (Codex, OpenCode, Cursor, Claude Desktop, Gemini CLI, OpenClaw, pi)+ (Codex, OpenCode, OMP, Cursor, Claude Desktop, Gemini CLI, OpenClaw)- [Installing hooks without docker](#installing-hooks-without-docker)(curl-based installer)- [Running ai-memory without docker](#running-ai-memory-without-docker)@@ -81,17 +81,16 @@ Each agent CLI needs two things:Without this, the agent can still query memory but capturebecomes manual.-The five clients on the [MCP install page](mcp-install.md) (Cursor,-Claude Desktop, Gemini CLI, OpenClaw, pi) get MCP only - no-lifecycle hooks ship for them today. For the three flagship CLIs-(Claude Code, Codex, OpenCode), both are wired up.+Claude Desktop and OpenClaw are MCP-only today. Claude Code, Codex,+OpenCode, OMP, Cursor, and Gemini CLI have lifecycle capture paths+through `install-hooks`.> **Two-step hook install pattern.** Claude Code and Codex use shell> hook scripts: (1) `docker cp` the bundled scripts to your home dir,> (2) `docker run --rm install-hooks` to render the config snippet.-> OpenCode is different: it uses a TypeScript plugin generated by-> `install-hooks --agent opencode`, so no shell-script extraction is-> needed for that client.+> OpenCode and OMP are different: they use generated TypeScript+> plugin/extension files, so no shell-script extraction is needed for+> those clients.### OpenAI Codex@@ -135,6 +134,25 @@ docker run --rm akitaonrails/ai-memory:latest \Restart OpenCode after installing or changing the plugin; plugins areloaded at startup.+### Oh My Pi / OMP++```bash+docker run --rm akitaonrails/ai-memory:latest \+ install-mcp --client pi \+ --server-url "http://homelab:49374/mcp" \+ --auth-token "$TOKEN"++# Extension — write to ~/.omp/agent/extensions/ai-memory.ts.+# If you have the local wrapper installed, prefer `--apply`:+ai-memory install-hooks --agent omp --apply \+ --server-url "http://homelab:49374" \+ --auth-token "$TOKEN"+```++Restart OMP after installing or changing the extension; extensions are+loaded at startup. The `pi` MCP client name and `omp` hook agent name+target the same current Oh My Pi integration surface.+### Bind mounts vs docker cpThe `setup-agent` subcommand does the extract + render in one shot@@ -160,11 +178,10 @@ files owned by the user running the command. Prefer it as thedefault; reach for `setup-agent` only when your docker setup isknown not to remap UIDs.-### Cursor, Claude Desktop, Gemini CLI, OpenClaw, pi+### Cursor, Claude Desktop, Gemini CLI, OpenClaw-These are MCP-only - no lifecycle-hook bundles ship for them. See-[**`docs/mcp-install.md`**](mcp-install.md) for the per-client config-file path and snippet, or one-shot it via:+See [**`docs/mcp-install.md`**](mcp-install.md) for the per-client MCP+config file path and snippet, or one-shot it via:```bashdocker run --rm akitaonrails/ai-memory:latest \@@ -182,15 +199,12 @@ docker run --rm akitaonrails/ai-memory:latest \docker run --rm akitaonrails/ai-memory:latest \install-mcp --client openclaw --auth-token "$TOKEN" \--server-url "http://homelab:49374/mcp"--# pi: prints the "not supported via MCP" explanation-docker run --rm akitaonrails/ai-memory:latest install-mcp --client pi```-For these MCP-only clients you'll need to nudge the model to call-`memory_query` / `memory_handoff_accept` itself (see the-[CLAUDE.md snippet](../README.md#nudge-the-agent-to-use-memory-proactively)-in the README).+For MCP-only clients you'll need to nudge the model to call+`memory_query` / `memory_handoff_accept` itself. For clients with+`install-hooks` support, the capture path handles handoff injection at+session start.---@@ -213,10 +227,10 @@ docker run --rm akitaonrails/ai-memory:latest \--auth-token "$TOKEN"```-The curl script installer supports `--agent codex|claude-code` and-`--to <dir>`; `--help` prints the full flag list. OpenCode does not-need this script installer because `install-hooks --agent opencode`-generates a TypeScript plugin instead.+The curl script installer supports `--agent claude-code|codex|opencode|omp`+and `--to <dir>`; `--help` prints the full flag list. OpenCode and OMP do+not need this script installer because `install-hooks --agent opencode`+and `install-hooks --agent omp` generate TypeScript files instead.This path is friction-free when:- You have curl + bash but not docker@@ -457,6 +471,6 @@ ai-memory install-hooks --agent claude-code --apply- [`docs/deploy.md`](deploy.md) - homelab deploy walkthrough(`bin/deploy`, cloudflared TLS, env-file management)- [`docs/mcp-install.md`](mcp-install.md) - per-client MCP config- reference for Cursor, Claude Desktop, Gemini CLI, OpenClaw, pi+ reference for Cursor, Claude Desktop, Gemini CLI, OpenClaw, OMP- [`docs/ARCHITECTURE.md`](ARCHITECTURE.md) - what's actuallyrunning inside ai-memorydiff --git a/docs/mcp-install.md b/docs/mcp-install.mdindex fa0bd852..4fcfeaaa 100644--- a/docs/mcp-install.md+++ b/docs/mcp-install.md@@ -19,38 +19,37 @@This page documents how to register ai-memory as an MCP server withthe agent CLIs **that are not covered inline in the README**.-The three flagship clients - Claude Code, OpenAI Codex, OpenCode --have automatic capture integrations (shell hooks for Claude Code /-Codex, a TypeScript plugin for OpenCode) and are covered in the+Claude Code, OpenAI Codex, OpenCode, and OMP have automatic capture+integrations (shell hooks for Claude Code / Codex, TypeScript+plugin/extension files for OpenCode / OMP) and are covered in the[main README](../README.md#configure-your-agent-cli).-The clients on this page are **MCP-only**: they expose long-term+Some clients on this page are **MCP-only**: they expose long-termmemory to their LLM via ai-memory's MCP tools (`memory_query`,-`memory_recent`, `memory_handoff_accept`, etc.), but they cannot-auto-capture session events into ai-memory's `/hook` endpoint-without a per-client plugin written upstream. The trade-off:+`memory_recent`, `memory_handoff_accept`, etc.), but they do not+auto-capture session events into ai-memory's `/hook` endpoint. The+trade-off:| | What you get | What you don't get ||---|---|---|| **MCP only** | LLM can query the wiki, accept handoffs, run memory_consolidate | No automatic session-end summaries; no auto-handoff at session boundaries || **MCP + hooks** | All of the above *plus* every prompt/tool-call captured automatically; handoffs surface at SessionStart with no human prompting | - |-Most of these clients will land hook integration upstream eventually-(Gemini CLI is the closest); for now, you can still cover the-session-boundary gap by asking the LLM to call `memory_handoff_begin`-manually before quitting.+For MCP-only clients, you can still cover the session-boundary gap by+asking the LLM to call `memory_handoff_begin` manually before quitting.> **One-shot tip:** every snippet below is also reachable from the> CLI:> ```bash-> ai-memory install-mcp --client cursor # or claude-desktop / gemini-cli / openclaw / pi+> ai-memory install-mcp --client cursor # or claude-desktop / gemini-cli / openclaw / pi|omp> ```---## Cursor-**Status:** ✅ MCP supported. ❌ No lifecycle hooks.+**Status:** ✅ MCP supported. ✅ Lifecycle hooks supported via+`ai-memory install-hooks --agent cursor --apply`.**Config file:**- Per-project: `.cursor/mcp.json` in the workspace root.@@ -114,10 +113,8 @@ stdio shim. Requires Node.js installed on the same machine.## Gemini CLI-**Status:** ✅ MCP supported. ⚠️ Hooks exist in the source but are-not yet stable enough to recommend (the user-facing docs are sparse-and event names have shifted between versions). Treat this as-MCP-only for now.+**Status:** ✅ MCP supported. ✅ Lifecycle hooks supported via+`ai-memory install-hooks --agent gemini-cli --apply`.**Config file:**- User: `~/.gemini/settings.json`@@ -140,9 +137,6 @@ endpoints. The `timeout` is in milliseconds.**Gotchas:**- Gemini supports stdio too via `command`/`args`, plus SSE via `url`.Only `httpUrl` covers streamable HTTP. Don't mix them in one entry.-- If hooks are surfaced and stabilised upstream, ai-memory will ship- a Gemini hook bundle in `hooks/gemini-cli/`. Track:- <https://github.com/google-gemini/gemini-cli>.- Source: <https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md>---@@ -183,37 +177,46 @@ OpenClaw distinguishes transports explicitly. Use----## pi (not supported via MCP) {#pi-not-supported}+## Oh My Pi / OMP-**Status:** ❌ MCP not supported upstream. Author Mario Zechner has-[explicitly stated](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/)-that MCP is not on pi's roadmap, citing the token-budget overhead of-typical MCP servers.+**Status:** ✅ MCP supported. ✅ Lifecycle capture supported via+`ai-memory install-hooks --agent omp --apply`.-The upstream [agentmemory](https://github.com/rohitg00/agentmemory)-project wires pi via pi's own extension surface-(`~/.pi/agent/extensions/agentmemory/`), not MCP. Implementing that-for ai-memory is feasible but would require a separate pi-specific-plugin and is out of scope for ai-memory v0.2.+**Config file:**+- User: `~/.omp/agent/mcp.json`+- Project: `.omp/mcp.json`-**What you can do today:**+The current Oh My Pi package exposes the `omp` binary and native+`.omp` config directories. The ai-memory CLI accepts `--client pi` and+`--client omp` as aliases for this same MCP surface.-1. **Best:** run ai-memory and use it from one of the MCP-capable- clients listed above (Cursor, Claude Desktop, Gemini CLI,- OpenClaw, or any of the flagship three in the README). Keep pi- for the code-edit sessions that don't need cross-agent- continuity. ai-memory's wiki dir is plain markdown; you can open- it in any editor pi has access to.+```json+{+ "mcpServers": {+ "ai-memory": {+ "type": "http",+ "url": "http://127.0.0.1:49374/mcp",+ "enabled": true+ }+ }+}+```++**Lifecycle extension:**-2. **Unofficial:** there's a community [pi-mcp-adapter](https://github.com/nicobailon/pi-mcp-adapter)- shim that bridges MCP into pi. Not endorsed by pi's author, may- break on pi updates. If you try it, point it at ai-memory's- `http://127.0.0.1:49374/mcp` endpoint.+```bash+ai-memory install-hooks --agent omp --apply+```++This writes `~/.omp/agent/extensions/ai-memory.ts`, which OMP discovers+as a direct TypeScript extension on startup. Restart `omp` after+installing or changing the file.-3. **Future:** open an issue on- <https://github.com/akitaonrails/ai-memory> requesting a native pi- extension if there's enough demand. The work is straightforward- (pi extensions are plain JS); just not prioritised today.+**Gotchas:**+- OMP extensions are TypeScript modules, not shell hooks; stdout is not+ used for context injection.+- The extension uses OMP lifecycle events for prompt/tool capture and+ `before_agent_start` to inject pending ai-memory handoffs.---@@ -240,9 +243,9 @@ isn't being picked up. Check:return a JSON-RPC error (not a connection refused). If refused,start ai-memory: `docker start ai-memory` or`ai-memory serve --transport http`.-2. **Did the client reload the config?** Cursor and Claude Desktop- need a restart. Gemini CLI and OpenClaw usually pick it up on next- session-start.+2. **Did the client reload the config?** Cursor, Claude Desktop, and+ OMP need a restart. Gemini CLI and OpenClaw usually pick it up on+ next session-start.3. **Are you on the right port?** ai-memory's default is **49374**(`0xC0DE` in hex). If you remapped, update the URL in everyclient's config.@@ -262,8 +265,8 @@ that *starts* the next one - to play nicely with ai-memory:| Side | What's needed | Covered by ||---|---|---|-| **Ending side** | The agent must create a handoff, either through a true session-end hook or by calling `memory_handoff_begin`. | Built-in for Claude Code; Codex uses its stop/session hooks. OpenCode has no true session-end event, so ask it to call `memory_handoff_begin` before quitting when you need a handoff. |-| **Starting side** | Either (a) the session-start/plugin path injects the handoff via `/handoff`, OR (b) the model proactively calls `memory_handoff_accept` on first turn. | (a) is built-in for Claude Code / Codex / OpenCode. (b) works for any MCP-capable client if you nudge the model - see [the CLAUDE.md snippet](../README.md#nudging-the-agent-to-use-memory-proactively). |+| **Ending side** | The agent must create a handoff, either through a true session-end hook or by calling `memory_handoff_begin`. | Built-in for Claude Code, Codex, and OMP. OpenCode has no true session-end event, so ask it to call `memory_handoff_begin` before quitting when you need a handoff. |+| **Starting side** | Either (a) the session-start/plugin path injects the handoff via `/handoff`, OR (b) the model proactively calls `memory_handoff_accept` on first turn. | (a) is built-in for Claude Code / Codex / OpenCode / OMP. (b) works for any MCP-capable client if you nudge the model - see [the CLAUDE.md snippet](../README.md#nudging-the-agent-to-use-memory-proactively). |So a typical mixed workflow looks like:diff --git a/scripts/install-hooks.sh b/scripts/install-hooks.shindex fd5ffcfc..a9d5ded9 100755--- a/scripts/install-hooks.sh+++ b/scripts/install-hooks.sh@@ -10,8 +10,8 @@# | bash -s -- --agent claude-code## Options:-# --agent <claude-code|codex|opencode> which agent (default: claude-code;-# opencode prints a plugin hint)+# --agent <claude-code|codex|opencode|omp> which agent (default: claude-code;+# opencode/omp print extension hints)# --to <dir> install root (default: $HOME/.ai-memory/hooks)# --ref <git-ref> repo ref to pull from (default: main)#@@ -45,9 +45,9 @@ while [[ $# -gt 0 ]]; dodonecase "$AGENT" in- claude-code|codex|opencode) ;;+ claude-code|codex|opencode|omp) ;;*)- echo "unsupported agent: $AGENT (expected claude-code | codex | opencode)" >&2+ echo "unsupported agent: $AGENT (expected claude-code | codex | opencode | omp)" >&2exit 64 ;;esac@@ -58,6 +58,13 @@ if [[ "$AGENT" == "opencode" ]]; thenexit 0fi+if [[ "$AGENT" == "omp" ]]; then+ echo "OMP uses a generated TypeScript extension, not shell hook scripts."+ echo "Run: ai-memory install-hooks --agent omp --apply"+ echo "Then restart OMP so it loads ~/.omp/agent/extensions/ai-memory.ts."+ exit 0+fi+SCRIPTS=("session-start""user-prompt-submit"