Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1683650240 | |||
| 9d7c3e5ad8 | |||
| 23bae2ab7d |
@@ -9,8 +9,7 @@ Docker image packaging [opencode](https://opencode.ai) into a production-ready d
|
|||||||
- `Dockerfile` — single multi-stage build for both variants. OMOS variant is controlled by `INSTALL_OMOS=true` build arg; mempalace is controlled by `INSTALL_MEMPALACE` (default `true`). All GitHub-sourced binaries are pinned with version ARGs.
|
- `Dockerfile` — single multi-stage build for both variants. OMOS variant is controlled by `INSTALL_OMOS=true` build arg; mempalace is controlled by `INSTALL_MEMPALACE` (default `true`). All GitHub-sourced binaries are pinned with version ARGs.
|
||||||
- `entrypoint.sh` — runs as root: UID/GID adjustment, SSH permissions, volume ownership fixes (skipped via `.devbox-owner` sentinel when ownership is already correct). Then drops to developer via gosu.
|
- `entrypoint.sh` — runs as root: UID/GID adjustment, SSH permissions, volume ownership fixes (skipped via `.devbox-owner` sentinel when ownership is already correct). Then drops to developer via gosu.
|
||||||
- `entrypoint-user.sh` — runs as developer: git config, opencode.json generation (delegated to `generate-config.py`), OMOS setup.
|
- `entrypoint-user.sh` — runs as developer: git config, opencode.json generation (delegated to `generate-config.py`), OMOS setup.
|
||||||
- `rootfs/usr/local/lib/opencode-devbox/generate-config.py` — generates `~/.config/opencode/opencode.json` from env vars. Never overwrites an existing config. Auto-registers MCP servers for detected tools (mempalace via the wrapper, gitea-mcp).
|
- `rootfs/usr/local/lib/opencode-devbox/generate-config.py` — generates `~/.config/opencode/opencode.json` from env vars. Never overwrites an existing config. Auto-registers MCP servers for detected tools (mempalace via the `mempalace-mcp` entry point, gitea-mcp).
|
||||||
- `rootfs/usr/local/bin/mempalace-mcp-server` — wrapper that exec's the mempalace uv-tool venv's python with `-m mempalace.mcp_server`. Needed because system `python3` can't import from the isolated venv created by `uv tool install`.
|
|
||||||
- `scripts/smoke-test.sh` — post-build image verification. Asserts binary presence, opencode startup, entrypoint correctness, config generation idempotency, and image size thresholds. Used by both CI workflows.
|
- `scripts/smoke-test.sh` — post-build image verification. Asserts binary presence, opencode startup, entrypoint correctness, config generation idempotency, and image size thresholds. Used by both CI workflows.
|
||||||
- `scripts/generate-dockerhub-md.py` — generates `DOCKER_HUB.md` from `README.md` using explicit section rules. `--check` fails if the committed file is out of sync (enforced by the `validate` workflow).
|
- `scripts/generate-dockerhub-md.py` — generates `DOCKER_HUB.md` from `README.md` using explicit section rules. `--check` fails if the committed file is out of sync (enforced by the `validate` workflow).
|
||||||
- `DOCKER_HUB.md` — **auto-generated** from README. Do not edit directly. Pushed to Docker Hub description via CI API call. Must stay under 25 kB. Short description field must be ≤100 bytes.
|
- `DOCKER_HUB.md` — **auto-generated** from README. Do not edit directly. Pushed to Docker Hub description via CI API call. Must stay under 25 kB. Short description field must be ≤100 bytes.
|
||||||
@@ -38,7 +37,7 @@ When bumping the opencode version, also bump `OPENCODE_VERSION` in `Dockerfile`
|
|||||||
- **GitHub/Gitea-sourced binaries float by default** — gosu, fzf, git-lfs, nvim, bat, eza, zoxide, uv, gitea-mcp, Go, oh-my-opencode-slim all default to `latest`. Each build-time install step reads the `/releases/latest` Location redirect (or the go.dev JSON feed for Go) and derives the concrete version. Use the same `ARCH` case-switch pattern for multi-arch support (amd64/arm64). Intentional pins: `OPENCODE_VERSION` (drives the image tag), `NODE_VERSION=22` (major pin), `DEBIAN_VERSION=trixie-slim` (OS base). Adding a new upstream tool: follow the existing floated-version pattern, don't hardcode a specific tag.
|
- **GitHub/Gitea-sourced binaries float by default** — gosu, fzf, git-lfs, nvim, bat, eza, zoxide, uv, gitea-mcp, Go, oh-my-opencode-slim all default to `latest`. Each build-time install step reads the `/releases/latest` Location redirect (or the go.dev JSON feed for Go) and derives the concrete version. Use the same `ARCH` case-switch pattern for multi-arch support (amd64/arm64). Intentional pins: `OPENCODE_VERSION` (drives the image tag), `NODE_VERSION=22` (major pin), `DEBIAN_VERSION=trixie-slim` (OS base). Adding a new upstream tool: follow the existing floated-version pattern, don't hardcode a specific tag.
|
||||||
- **Resolved versions are logged by the smoke test** — `scripts/smoke-test.sh` prints a "Resolved component versions" table as its first step. CI logs always capture what got baked into a given image even when ARGs default to `latest`.
|
- **Resolved versions are logged by the smoke test** — `scripts/smoke-test.sh` prints a "Resolved component versions" table as its first step. CI logs always capture what got baked into a given image even when ARGs default to `latest`.
|
||||||
- **Shell scripts use `set -euo pipefail`** — both entrypoints are strict. Errors in volume chown or SSH permission operations are intentionally suppressed with `|| true`.
|
- **Shell scripts use `set -euo pipefail`** — both entrypoints are strict. Errors in volume chown or SSH permission operations are intentionally suppressed with `|| true`.
|
||||||
- **MemPalace install path** — installed via `uv tool install` into `/opt/uv-tools/mempalace/`. The `mempalace` CLI is symlinked onto `PATH` by uv; the MCP server is reached via the `mempalace-mcp-server` wrapper. Do not use `pip install --break-system-packages` — that was the previous approach and has been removed.
|
- **MemPalace install path** — installed via `uv tool install` into `/opt/uv-tools/mempalace/`. Both the `mempalace` CLI and the `mempalace-mcp` MCP server binary are shipped as entry points by the mempalace package itself and placed on PATH by uv as shims whose shebangs point at the venv's Python. No hand-rolled wrapper is needed. Do not use `pip install --break-system-packages` — that was the previous approach and has been removed. Do not use `["python3", "-m", "mempalace.mcp_server"]` in `opencode.json` — system Python can't import from the uv venv.
|
||||||
- **generate-config.py idempotency** — the script MUST never overwrite an existing `opencode.json`. Users bind-mount their config directory or persist it across container recreations; accidentally clobbering that file would destroy hand-edits. The smoke test asserts this.
|
- **generate-config.py idempotency** — the script MUST never overwrite an existing `opencode.json`. Users bind-mount their config directory or persist it across container recreations; accidentally clobbering that file would destroy hand-edits. The smoke test asserts this.
|
||||||
- **Docker Hub description update** — uses `/v2/auth/token` endpoint (not the deprecated `/v2/users/login`). Auth uses `identifier`/`secret` fields, returns `access_token`, sent as `Bearer`. Short description must be ≤100 bytes.
|
- **Docker Hub description update** — uses `/v2/auth/token` endpoint (not the deprecated `/v2/users/login`). Auth uses `identifier`/`secret` fields, returns `access_token`, sent as `Bearer`. Short description must be ≤100 bytes.
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,30 @@ Tags follow `v{opencode_version}[letter]` — bare tag for the first build on a
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## v1.14.30b — 2026-04-30
|
||||||
|
|
||||||
|
**Bake mempalace-toolkit wrappers into the image.**
|
||||||
|
|
||||||
|
- **Fix:** The scheduler templates in [mempalace-toolkit's `contrib/`](https://gitea.jordbo.se/joakimp/mempalace-toolkit/src/branch/main/contrib) assume `mempalace-session` is available inside the container, but the image never actually installed it. Users following the `*-devbox` scheduler docs would silently lose the wrappers on every `docker compose up --force-recreate`, because the only way to get them was a post-hoc `./install.sh --yes` inside the container — which lives in the ephemeral layer. The host-side systemd timer would then fire, `docker exec` in, and hit `mempalace-session: command not found`. Caught during runtime validation on 2026-04-30.
|
||||||
|
- New Dockerfile block clones `mempalace-toolkit` at build time (depth-1) to `/opt/mempalace-toolkit/`, symlinks `bin/mempalace-session` and `bin/mempalace-docs` into `/usr/local/bin/`, and asserts both respond to `--help` before the layer succeeds.
|
||||||
|
- Gated by `ARG INSTALL_MEMPALACE_TOOLKIT=true` (defaults on, depends on `INSTALL_MEMPALACE=true`).
|
||||||
|
- Floated ref via `ARG MEMPALACE_TOOLKIT_REF=main` — override for reproducible builds once the toolkit starts tagging releases.
|
||||||
|
- **Tests:** Smoke test gains three toolkit assertions (`mempalace-session --help`, `mempalace-docs --help`, symlink target check). The resolved-versions preamble now logs the toolkit git short-SHA alongside the other floated components.
|
||||||
|
- **Docs:** README's MemPalace section gains a `Scheduled mining (mempalace-toolkit)` subsection covering the new wrappers and pointing at `contrib/` for scheduling. New build-args table entry for `INSTALL_MEMPALACE_TOOLKIT`.
|
||||||
|
|
||||||
|
## v1.14.30 — 2026-04-30
|
||||||
|
|
||||||
|
Bump opencode to 1.14.30.
|
||||||
|
|
||||||
|
## v1.14.29c — 2026-04-29
|
||||||
|
|
||||||
|
**Drop redundant mempalace-mcp-server wrapper, use the entry point mempalace ships.**
|
||||||
|
|
||||||
|
- **Fix:** MCP integration with mempalace was still broken for users with custom `opencode.json` files because they typically had `["python3", "-m", "mempalace.mcp_server"]` from v1.14.28b and earlier. With the uv-tool install path, system python3 can't import mempalace and the MCP server subprocess exits immediately — opencode surfaced this as `MCP error -32000: connection closed`. Users should migrate to `["mempalace-mcp"]`. The auto-generated config in new containers already emits the new form.
|
||||||
|
- **Cleanup:** Remove the hand-rolled `/usr/local/bin/mempalace-mcp-server` wrapper. The mempalace Python package ships a `mempalace-mcp` console entry point; `uv tool install` places it on PATH as a shim whose shebang points at the isolated venv's Python. The wrapper was duplicating what uv installs for free. Removed `rootfs/usr/local/bin/` and its COPY + chmod lines from the Dockerfile.
|
||||||
|
- **Docs:** README's MemPalace section now shows `["mempalace-mcp"]` and explicitly warns against `["python3", "-m", "mempalace.mcp_server"]` with the observed failure mode.
|
||||||
|
- **Tests:** Smoke test asserts `/usr/local/bin/mempalace-mcp` is executable and prints its symlink target, replacing the previous wrapper-present check.
|
||||||
|
|
||||||
## v1.14.29b — 2026-04-29
|
## v1.14.29b — 2026-04-29
|
||||||
|
|
||||||
**Fix OMOS `bunx` detection + CI build reliability.**
|
**Fix OMOS `bunx` detection + CI build reliability.**
|
||||||
|
|||||||
+20
-2
@@ -421,13 +421,13 @@ Add mempalace as an MCP server in your `opencode.json` (inside `~/.config/openco
|
|||||||
"mcp": {
|
"mcp": {
|
||||||
"mempalace": {
|
"mempalace": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"command": ["mempalace-mcp-server"]
|
"command": ["mempalace-mcp"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> The image installs mempalace into an isolated `uv tool` venv at `/opt/uv-tools/mempalace`. The `mempalace-mcp-server` wrapper on `PATH` exec's the venv's Python with the `mempalace.mcp_server` module — you don't need to know about the venv to use it.
|
> The image installs mempalace into an isolated `uv tool` venv at `/opt/uv-tools/mempalace/`. `uv tool install` places `mempalace-mcp` on `PATH` as a shim whose shebang points at the venv's Python, so MCP clients can invoke it as a normal binary without worrying about the venv. Do **not** use `["python3", "-m", "mempalace.mcp_server"]` — the system Python cannot import from the uv-managed venv and you'll get `ModuleNotFoundError` / `MCP error -32000: connection closed`.
|
||||||
|
|
||||||
This gives opencode access to 29 MCP tools for searching memory, querying the knowledge graph, managing wings/rooms/drawers, and agent diaries.
|
This gives opencode access to 29 MCP tools for searching memory, querying the knowledge graph, managing wings/rooms/drawers, and agent diaries.
|
||||||
|
|
||||||
@@ -449,6 +449,24 @@ mempalace wake-up
|
|||||||
|
|
||||||
Each workspace gets its own isolated "wing" — memories never leak between projects.
|
Each workspace gets its own isolated "wing" — memories never leak between projects.
|
||||||
|
|
||||||
|
### Scheduled mining (mempalace-toolkit)
|
||||||
|
|
||||||
|
The image bakes in [mempalace-toolkit](https://gitea.jordbo.se/joakimp/mempalace-toolkit), a small set of bash wrappers that pair with mempalace for two common routines:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Mine opencode session history (reads ~/.local/share/opencode/opencode.db, stages JSONL, mines into wing_conversations)
|
||||||
|
mempalace-session
|
||||||
|
|
||||||
|
# Mine a project's docs into a dedicated wing
|
||||||
|
mempalace-docs /workspace/my-project
|
||||||
|
```
|
||||||
|
|
||||||
|
Both wrappers are idempotent and dedup-aware — re-running them on unchanged input is a cheap no-op.
|
||||||
|
|
||||||
|
For weekly automated runs, the toolkit ships ready-to-use scheduler templates (systemd user timer, launchd user agent, cron) in its [`contrib/`](https://gitea.jordbo.se/joakimp/mempalace-toolkit/src/branch/main/contrib) directory. The `*-devbox` variants are designed for this container: host-side schedulers that `docker exec` into the running opencode-devbox.
|
||||||
|
|
||||||
|
Disable the toolkit (keeps mempalace itself) with `--build-arg INSTALL_MEMPALACE_TOOLKIT=false`. Pin to a specific ref with `--build-arg MEMPALACE_TOOLKIT_REF=v0.3.0` once tagged releases exist.
|
||||||
|
|
||||||
### Storage
|
### Storage
|
||||||
|
|
||||||
Two separate named volumes keep different data classes apart:
|
Two separate named volumes keep different data classes apart:
|
||||||
|
|||||||
+26
-3
@@ -5,7 +5,7 @@ ARG DEBIAN_VERSION=trixie-slim
|
|||||||
FROM debian:${DEBIAN_VERSION} AS base
|
FROM debian:${DEBIAN_VERSION} AS base
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG OPENCODE_VERSION=1.14.29
|
ARG OPENCODE_VERSION=1.14.30
|
||||||
|
|
||||||
LABEL maintainer="joakimp"
|
LABEL maintainer="joakimp"
|
||||||
LABEL description="Portable opencode developer container"
|
LABEL description="Portable opencode developer container"
|
||||||
@@ -207,6 +207,31 @@ RUN if [ "${INSTALL_MEMPALACE}" = "true" ]; then \
|
|||||||
/opt/uv-tools/mempalace/bin/python -c "import mempalace; print('mempalace', mempalace.__version__ if hasattr(mempalace, '__version__') else 'installed')" ; \
|
/opt/uv-tools/mempalace/bin/python -c "import mempalace; print('mempalace', mempalace.__version__ if hasattr(mempalace, '__version__') else 'installed')" ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ── mempalace-toolkit — bash wrappers for session/docs mining ────────
|
||||||
|
# Thin wrappers (`mempalace-session`, `mempalace-docs`) that delegate to
|
||||||
|
# the mempalace Python CLI for two common scheduled tasks:
|
||||||
|
# - mempalace-session: mines opencode's SQLite session history into
|
||||||
|
# the palace (wing_conversations). Referenced by contrib/ scheduler
|
||||||
|
# templates (systemd user timer, cron) in the toolkit repo.
|
||||||
|
# - mempalace-docs: mines project docs into a per-project wing.
|
||||||
|
# Repo source of truth: https://gitea.jordbo.se/joakimp/mempalace-toolkit
|
||||||
|
#
|
||||||
|
# Requires INSTALL_MEMPALACE=true (wrappers shell out to `mempalace`).
|
||||||
|
# Disable with --build-arg INSTALL_MEMPALACE_TOOLKIT=false if you don't
|
||||||
|
# use the scheduled-mining workflow.
|
||||||
|
ARG INSTALL_MEMPALACE_TOOLKIT=true
|
||||||
|
ARG MEMPALACE_TOOLKIT_REF=main
|
||||||
|
RUN if [ "${INSTALL_MEMPALACE}" = "true" ] && [ "${INSTALL_MEMPALACE_TOOLKIT}" = "true" ]; then \
|
||||||
|
git clone --depth 1 --branch "${MEMPALACE_TOOLKIT_REF}" \
|
||||||
|
https://gitea.jordbo.se/joakimp/mempalace-toolkit.git /opt/mempalace-toolkit && \
|
||||||
|
ln -sf /opt/mempalace-toolkit/bin/mempalace-session /usr/local/bin/mempalace-session && \
|
||||||
|
ln -sf /opt/mempalace-toolkit/bin/mempalace-docs /usr/local/bin/mempalace-docs && \
|
||||||
|
chmod +x /opt/mempalace-toolkit/bin/mempalace-session /opt/mempalace-toolkit/bin/mempalace-docs && \
|
||||||
|
mempalace-session --help >/dev/null && \
|
||||||
|
mempalace-docs --help >/dev/null && \
|
||||||
|
echo "mempalace-toolkit installed at $(cd /opt/mempalace-toolkit && git rev-parse --short HEAD)" ; \
|
||||||
|
fi
|
||||||
|
|
||||||
# rustup — Rust toolchain manager
|
# rustup — Rust toolchain manager
|
||||||
# Installs the rustup-init binary only. Users bootstrap Rust with:
|
# Installs the rustup-init binary only. Users bootstrap Rust with:
|
||||||
# rustup-init -y && source ~/.cargo/env
|
# rustup-init -y && source ~/.cargo/env
|
||||||
@@ -340,11 +365,9 @@ COPY rootfs/home/developer/.inputrc /etc/skel-devbox/.inputrc
|
|||||||
|
|
||||||
# ── Entrypoint ────────────────────────────────────────────────────────
|
# ── Entrypoint ────────────────────────────────────────────────────────
|
||||||
COPY rootfs/usr/local/lib/opencode-devbox/ /usr/local/lib/opencode-devbox/
|
COPY rootfs/usr/local/lib/opencode-devbox/ /usr/local/lib/opencode-devbox/
|
||||||
COPY rootfs/usr/local/bin/ /usr/local/bin/
|
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
COPY entrypoint-user.sh /usr/local/bin/entrypoint-user.sh
|
COPY entrypoint-user.sh /usr/local/bin/entrypoint-user.sh
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/entrypoint-user.sh \
|
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/entrypoint-user.sh \
|
||||||
/usr/local/bin/mempalace-mcp-server \
|
|
||||||
/usr/local/lib/opencode-devbox/*.py
|
/usr/local/lib/opencode-devbox/*.py
|
||||||
|
|
||||||
# Start as root — entrypoint adjusts UID/GID then drops to developer
|
# Start as root — entrypoint adjusts UID/GID then drops to developer
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ docker compose build --build-arg NVIM_VERSION=0.12.1 # pin to a specific versi
|
|||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `INSTALL_GO` | `false` | Go toolchain (resolves latest stable from go.dev when `GO_VERSION=latest`) |
|
| `INSTALL_GO` | `false` | Go toolchain (resolves latest stable from go.dev when `GO_VERSION=latest`) |
|
||||||
| `INSTALL_MEMPALACE` | `true` | [MemPalace](https://github.com/MemPalace/mempalace) local AI memory system (~300 MB — disable to shrink image if you don't need MCP memory) |
|
| `INSTALL_MEMPALACE` | `true` | [MemPalace](https://github.com/MemPalace/mempalace) local AI memory system (~300 MB — disable to shrink image if you don't need MCP memory) |
|
||||||
|
| `INSTALL_MEMPALACE_TOOLKIT` | `true` | [mempalace-toolkit](https://gitea.jordbo.se/joakimp/mempalace-toolkit) bash wrappers (`mempalace-session`, `mempalace-docs`). Cloned at build time from `MEMPALACE_TOOLKIT_REF` (default `main`). Requires `INSTALL_MEMPALACE=true`. |
|
||||||
| `INSTALL_OMOS` | `false` | [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) multi-agent orchestration (installs Bun and plugin) |
|
| `INSTALL_OMOS` | `false` | [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) multi-agent orchestration (installs Bun and plugin) |
|
||||||
| `OPENCODE_VERSION` | *(pinned per release)* | opencode npm version. Drives the image tag and is intentionally not floated. |
|
| `OPENCODE_VERSION` | *(pinned per release)* | opencode npm version. Drives the image tag and is intentionally not floated. |
|
||||||
| `NODE_VERSION` | `22` | Node.js major version. Pinned to protect against upstream breaking changes across majors. |
|
| `NODE_VERSION` | `22` | Node.js major version. Pinned to protect against upstream breaking changes across majors. |
|
||||||
@@ -474,13 +475,13 @@ Add mempalace as an MCP server in your `opencode.json` (inside `~/.config/openco
|
|||||||
"mcp": {
|
"mcp": {
|
||||||
"mempalace": {
|
"mempalace": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"command": ["mempalace-mcp-server"]
|
"command": ["mempalace-mcp"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> The image installs mempalace into an isolated `uv tool` venv at `/opt/uv-tools/mempalace`. The `mempalace-mcp-server` wrapper on `PATH` exec's the venv's Python with the `mempalace.mcp_server` module — you don't need to know about the venv to use it.
|
> The image installs mempalace into an isolated `uv tool` venv at `/opt/uv-tools/mempalace/`. `uv tool install` places `mempalace-mcp` on `PATH` as a shim whose shebang points at the venv's Python, so MCP clients can invoke it as a normal binary without worrying about the venv. Do **not** use `["python3", "-m", "mempalace.mcp_server"]` — the system Python cannot import from the uv-managed venv and you'll get `ModuleNotFoundError` / `MCP error -32000: connection closed`.
|
||||||
|
|
||||||
This gives opencode access to 29 MCP tools for searching memory, querying the knowledge graph, managing wings/rooms/drawers, and agent diaries.
|
This gives opencode access to 29 MCP tools for searching memory, querying the knowledge graph, managing wings/rooms/drawers, and agent diaries.
|
||||||
|
|
||||||
@@ -502,6 +503,24 @@ mempalace wake-up
|
|||||||
|
|
||||||
Each workspace gets its own isolated "wing" — memories never leak between projects.
|
Each workspace gets its own isolated "wing" — memories never leak between projects.
|
||||||
|
|
||||||
|
### Scheduled mining (mempalace-toolkit)
|
||||||
|
|
||||||
|
The image bakes in [mempalace-toolkit](https://gitea.jordbo.se/joakimp/mempalace-toolkit), a small set of bash wrappers that pair with mempalace for two common routines:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Mine opencode session history (reads ~/.local/share/opencode/opencode.db, stages JSONL, mines into wing_conversations)
|
||||||
|
mempalace-session
|
||||||
|
|
||||||
|
# Mine a project's docs into a dedicated wing
|
||||||
|
mempalace-docs /workspace/my-project
|
||||||
|
```
|
||||||
|
|
||||||
|
Both wrappers are idempotent and dedup-aware — re-running them on unchanged input is a cheap no-op.
|
||||||
|
|
||||||
|
For weekly automated runs, the toolkit ships ready-to-use scheduler templates (systemd user timer, launchd user agent, cron) in its [`contrib/`](https://gitea.jordbo.se/joakimp/mempalace-toolkit/src/branch/main/contrib) directory. The `*-devbox` variants are designed for this container: host-side schedulers that `docker exec` into the running opencode-devbox.
|
||||||
|
|
||||||
|
Disable the toolkit (keeps mempalace itself) with `--build-arg INSTALL_MEMPALACE_TOOLKIT=false`. Pin to a specific ref with `--build-arg MEMPALACE_TOOLKIT_REF=v0.3.0` once tagged releases exist.
|
||||||
|
|
||||||
### Storage
|
### Storage
|
||||||
|
|
||||||
Two separate named volumes keep different data classes apart:
|
Two separate named volumes keep different data classes apart:
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Launcher for the MemPalace MCP server.
|
|
||||||
#
|
|
||||||
# MemPalace is installed via `uv tool install` into an isolated venv
|
|
||||||
# under /opt/uv-tools/. System python3 cannot import mempalace directly,
|
|
||||||
# so this wrapper exec's the venv's python with the mcp_server module.
|
|
||||||
#
|
|
||||||
# Used by opencode.json:
|
|
||||||
# "command": ["mempalace-mcp-server"]
|
|
||||||
exec /opt/uv-tools/mempalace/bin/python -m mempalace.mcp_server "$@"
|
|
||||||
@@ -75,14 +75,15 @@ def register_mcp_servers(config: dict) -> list[str]:
|
|||||||
servers: dict[str, dict] = {}
|
servers: dict[str, dict] = {}
|
||||||
|
|
||||||
# MemPalace — local-first AI memory (if installed).
|
# MemPalace — local-first AI memory (if installed).
|
||||||
# Uses the mempalace-mcp-server wrapper rather than invoking
|
# `mempalace-mcp` is the entry-point binary shipped by the mempalace
|
||||||
# `python3 -m mempalace.mcp_server` directly, because mempalace
|
# Python package. `uv tool install mempalace` places it on PATH as a
|
||||||
# lives in an isolated uv tool venv that system python3 cannot
|
# shim whose shebang points at the isolated venv's Python, so system
|
||||||
# import from. The wrapper exec's the right interpreter.
|
# `python3 -m mempalace.mcp_server` (which would fail — system
|
||||||
if shutil.which("mempalace") and shutil.which("mempalace-mcp-server"):
|
# python3 can't import from the uv venv) is unnecessary here.
|
||||||
|
if shutil.which("mempalace-mcp"):
|
||||||
servers["mempalace"] = {
|
servers["mempalace"] = {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"command": ["mempalace-mcp-server"],
|
"command": ["mempalace-mcp"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Gitea — self-hosted Git forge API (if installed).
|
# Gitea — self-hosted Git forge API (if installed).
|
||||||
|
|||||||
+14
-1
@@ -71,6 +71,9 @@ docker run --rm --entrypoint="" "$IMAGE" sh -c '
|
|||||||
if command -v mempalace >/dev/null 2>&1; then
|
if command -v mempalace >/dev/null 2>&1; then
|
||||||
printf " %-15s %s\n" "mempalace" "$(mempalace --version 2>&1 | head -1 || echo installed)"
|
printf " %-15s %s\n" "mempalace" "$(mempalace --version 2>&1 | head -1 || echo installed)"
|
||||||
fi
|
fi
|
||||||
|
if command -v mempalace-session >/dev/null 2>&1 && [ -d /opt/mempalace-toolkit ]; then
|
||||||
|
printf " %-15s %s\n" "toolkit" "$(git -C /opt/mempalace-toolkit rev-parse --short HEAD 2>/dev/null || echo installed)"
|
||||||
|
fi
|
||||||
'
|
'
|
||||||
echo
|
echo
|
||||||
echo "-- Core binaries --"
|
echo "-- Core binaries --"
|
||||||
@@ -99,11 +102,21 @@ echo "-- Optional / variant-gated --"
|
|||||||
# mempalace: present unless built with INSTALL_MEMPALACE=false
|
# mempalace: present unless built with INSTALL_MEMPALACE=false
|
||||||
if docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v mempalace" >/dev/null 2>&1; then
|
if docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v mempalace" >/dev/null 2>&1; then
|
||||||
run "mempalace" "mempalace --help | head -1"
|
run "mempalace" "mempalace --help | head -1"
|
||||||
run "mempalace-mcp-server" "test -x /usr/local/bin/mempalace-mcp-server && echo wrapper-present"
|
run "mempalace-mcp" "test -x /usr/local/bin/mempalace-mcp && readlink /usr/local/bin/mempalace-mcp"
|
||||||
else
|
else
|
||||||
echo " - mempalace not installed (INSTALL_MEMPALACE=false)"
|
echo " - mempalace not installed (INSTALL_MEMPALACE=false)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# mempalace-toolkit wrappers: present unless built with INSTALL_MEMPALACE_TOOLKIT=false
|
||||||
|
# Gated on mempalace presence — wrappers are useless without the CLI.
|
||||||
|
if docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v mempalace && command -v mempalace-session" >/dev/null 2>&1; then
|
||||||
|
run "mempalace-session (toolkit)" "mempalace-session --help | head -1"
|
||||||
|
run "mempalace-docs (toolkit)" "mempalace-docs --help | head -1"
|
||||||
|
run "toolkit symlink target" "test -L /usr/local/bin/mempalace-session && readlink /usr/local/bin/mempalace-session"
|
||||||
|
elif docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v mempalace" >/dev/null 2>&1; then
|
||||||
|
echo " - mempalace-toolkit not installed (INSTALL_MEMPALACE_TOOLKIT=false)"
|
||||||
|
fi
|
||||||
|
|
||||||
# bun: only in the omos variant
|
# bun: only in the omos variant
|
||||||
if [ "$VARIANT" = "omos" ]; then
|
if [ "$VARIANT" = "omos" ]; then
|
||||||
run "bun (omos)" "bun --version"
|
run "bun (omos)" "bun --version"
|
||||||
|
|||||||
Reference in New Issue
Block a user