diff --git a/AGENTS.md b/AGENTS.md index f527dc5..73a3bed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,16 +9,47 @@ Read [`ARCHITECTURE.md`](ARCHITECTURE.md) first — it's the canonical spec for ## Structure ``` -install.sh # Idempotent installer — symlinks bin/* into ~/.local/bin - # and SKILL.md into ~/.agents/skills/opencode-mempalace-bridge/ +install.sh # Idempotent installer — see "What install.sh does" below ARCHITECTURE.md # Canonical spec: diagrams, setup recipe, ops notes, upstream roadmap README.md # Human-facing quickstart + per-tool usage reference SKILL.md # Agent skill (symlinked into ~/.agents/skills/ on install) bin/ mempalace-docs # Docs-only MemPalace miner (bash wrapper) mempalace-session # Opencode session → MemPalace bridge (bash + inline Python) + mempalace-pi-session # pi session → MemPalace bridge (bash + inline Python) +contrib/ # systemd / launchd / cron templates for scheduling feeders +extensions/ + pi/ # pi coding-agent bring-up: MCP bridge, keybindings, settings template + mempalace.ts # Symlinked into ~/.pi/agent/extensions/ (MCP <→ pi glue) + keybindings.json # Symlinked into ~/.pi/agent/ (mosh/tmux newline fix) + settings.example.json # Template; user copies + edits (pi rewrites settings.json at runtime) + README.md # Extension internals, schema-passthrough gotcha, env setup ``` +## What `install.sh` does + +Idempotent, safe to re-run. Always: + +- Symlinks `bin/*` into `~/.local/bin/`. +- Creates `~/.agents/skills/opencode-mempalace-bridge/` with a `SKILL.md` symlink and a `.skill-source` marker. + +Gated on pi being installed (`~/.pi/agent/extensions/` exists): + +- Symlinks `extensions/pi/mempalace.ts` into `~/.pi/agent/extensions/`. Backs up any real file in the way. +- Symlinks `extensions/pi/keybindings.json` into `~/.pi/agent/`. Backs up any real file in the way. +- `settings.example.json` is **not** symlinked — pi rewrites `settings.json` at runtime, so we'd dirty the repo. Installer warns if `settings.json` is missing and prints the `cp` command. + +Probes (never halt, `warn` + `return 0`): + +- `~/.local/bin` is on `$PATH`. +- `~/.config/opencode/instructions/mempalace.md` exists (opencode wake-up protocol). +- `mempalace` is registered as an MCP server in `~/.config/opencode/opencode.json`. +- `~/.pi/agent/settings.json` exists (if pi is installed). +- `AWS_PROFILE`/`AWS_REGION` set, but only if `settings.json` exists *and* selects `amazon-bedrock`. Silent otherwise. + +All non-destructive: if something is already in place and points into this repo, prints "already linked" and moves on. If a non-symlink real file is in the way, backs it up with a timestamp. + + ## Conventions - **Standalone executables** in `bin/` with `#!/usr/bin/env bash` shebang, no extension, `chmod +x`. Must work in non-interactive contexts (agent processes, cron, CI). diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b5c415e..86bda02 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -364,5 +364,6 @@ When #1 merges, retire `mempalace-docs` to a thin shim. When #2 + #3 land togeth - [`README.md`](README.md) — human-facing quickstart + per-tool usage reference. - [`AGENTS.md`](AGENTS.md) — repo conventions for AI agents modifying this codebase. - [`SKILL.md`](SKILL.md) — agent skill (producer side), symlinked into `~/.agents/skills/opencode-mempalace-bridge/` by `install.sh`. +- [`extensions/pi/README.md`](extensions/pi/README.md) — pi coding-agent bring-up: the MemPalace MCP bridge extension, mosh-friendly keybindings, settings template for starting pi without `--model`, and the `~/.config/pi/.env` + zsh loader pattern for AWS env vars. Out of scope for this document (which is producer-side feeding), but linked from `install.sh` which handles both. - `~/.agents/skills/mempalace/SKILL.md` — agent skill for the **consumer** side (searching, diary, KG). Pair with `SKILL.md` in this repo. - [`cli_utils`](https://gitea.jordbo.se/joakimp/cli_utils) — sibling repo: shell quality-of-life tools. Origin of these wrappers before the 2026-04-30 split.