docs: update AGENTS.md structure + ARCHITECTURE.md see-also for pi bring-up

AGENTS.md Structure block was stale (listed only 2 bin/ wrappers, no
extensions/, no contrib/). Added full tree + a new 'What install.sh does'
section enumerating all steps, gates, and probes so maintainers see at a
glance what the installer touches.

ARCHITECTURE.md is scoped to the producer side (feeding the palace);
pi extension is consumer side, so out of scope for the main body. Added
a pointer in the See also section so readers can find extensions/pi/README.md.
This commit is contained in:
2026-05-05 14:47:06 +02:00
parent 75876e5c41
commit 79e0692dac
2 changed files with 34 additions and 2 deletions
+33 -2
View File
@@ -9,16 +9,47 @@ Read [`ARCHITECTURE.md`](ARCHITECTURE.md) first — it's the canonical spec for
## Structure ## Structure
``` ```
install.sh # Idempotent installer — symlinks bin/* into ~/.local/bin install.sh # Idempotent installer — see "What install.sh does" below
# and SKILL.md into ~/.agents/skills/opencode-mempalace-bridge/
ARCHITECTURE.md # Canonical spec: diagrams, setup recipe, ops notes, upstream roadmap ARCHITECTURE.md # Canonical spec: diagrams, setup recipe, ops notes, upstream roadmap
README.md # Human-facing quickstart + per-tool usage reference README.md # Human-facing quickstart + per-tool usage reference
SKILL.md # Agent skill (symlinked into ~/.agents/skills/ on install) SKILL.md # Agent skill (symlinked into ~/.agents/skills/ on install)
bin/ bin/
mempalace-docs # Docs-only MemPalace miner (bash wrapper) mempalace-docs # Docs-only MemPalace miner (bash wrapper)
mempalace-session # Opencode session → MemPalace bridge (bash + inline Python) 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 ## 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). - **Standalone executables** in `bin/` with `#!/usr/bin/env bash` shebang, no extension, `chmod +x`. Must work in non-interactive contexts (agent processes, cron, CI).
+1
View File
@@ -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. - [`README.md`](README.md) — human-facing quickstart + per-tool usage reference.
- [`AGENTS.md`](AGENTS.md) — repo conventions for AI agents modifying this codebase. - [`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`. - [`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. - `~/.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. - [`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.