Add first version of dev sandbox

This commit is contained in:
Alex Selimov 2026-05-13 20:51:24 -04:00
parent 883b0df070
commit 7974e725d0
10 changed files with 989 additions and 0 deletions

30
entrypoint.sh Normal file
View file

@ -0,0 +1,30 @@
#!/bin/zsh
# Wire up Pi config from the workspace bind mount.
#
# Why: ~/.pi holds both config (settings, skills, themes, extensions) AND hot
# runtime state (sessions, logs). We want to persist/commit the config via the
# workspace, but keep sessions on the container's native FS so agent turns
# aren't bottlenecked by virtiofs.
#
# Strategy: keep /root/.pi on native FS, and symlink only the config entries
# out to /workspace/dev_sandbox/.pi/agent/*.
PI_SRC="/workspace/dev_sandbox/.pi/agent"
PI_DST="/root/.pi/agent"
if [[ -d "$PI_SRC" ]]; then
mkdir -p "$PI_DST" "$PI_DST/sessions"
# Entries to persist from the workspace (add more here as needed).
# Note: auth.json is intentionally omitted — credentials stay on the
# named volume only, not in the committed workspace.
for entry in settings.json bin extensions skills themes prompt-templates agents.toml config.toml; do
src="$PI_SRC/$entry"
dst="$PI_DST/$entry"
if [[ -e "$src" ]]; then
# Replace whatever is at dst with a symlink to the workspace copy.
rm -rf "$dst"
ln -sf "$src" "$dst"
fi
done
fi
exec "$@"