chore: add sproutclaw git workflow and track local extensions
Some checks failed
CI / build-check-test (push) Has been cancelled

Document main/upstream-sync/feature branch strategy, add sync/push
scripts, track .pi/agent extensions and webui in git, and disable
startup changelog via showChangelogOnStartup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root
2026-05-22 20:38:20 +08:00
parent a8daa1d8ff
commit 0a91cc99d0
80 changed files with 15061 additions and 64 deletions

21
scripts/new-feature.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Create a feature branch from latest main.
set -euo pipefail
if [[ $# -lt 1 ]]; then
echo "Usage: $0 <feature-name>" >&2
echo "Example: $0 webui-avatar-fix" >&2
exit 1
fi
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
NAME="$1"
BRANCH="feature/$NAME"
git checkout main
git pull --ff-only origin main 2>/dev/null || true
git checkout -b "$BRANCH"
echo "Created and switched to $BRANCH"

32
scripts/push-sproutclaw.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Push main (and upstream-sync if present) to GitHub and Gitea.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
export GIT_HTTP_VERSION="${GIT_HTTP_VERSION:-1.1}"
BRANCH="$(git branch --show-current)"
if [[ "$BRANCH" != "main" ]]; then
echo "Checkout main before pushing (current: $BRANCH)" >&2
exit 1
fi
echo "==> Push main -> origin (GitHub)"
git push origin main
if git show-ref --verify --quiet refs/heads/upstream-sync; then
echo "==> Push upstream-sync -> origin"
git push origin upstream-sync
fi
if git remote get-url gitea &>/dev/null; then
echo "==> Push main -> gitea"
git push gitea main
if git show-ref --verify --quiet refs/heads/upstream-sync; then
git push gitea upstream-sync
fi
fi
echo "Done."

46
scripts/sync-upstream.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Merge upstream pi-mono into upstream-sync, then into main.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
export GIT_HTTP_VERSION="${GIT_HTTP_VERSION:-1.1}"
echo "==> Fetch upstream (badlogic/pi-mono)"
git fetch upstream
CURRENT="$(git branch --show-current)"
if [[ "$CURRENT" != "main" && "$CURRENT" != "upstream-sync" ]]; then
echo "Switch to main or upstream-sync first (current: $CURRENT)" >&2
exit 1
fi
echo "==> Update upstream-sync from main"
git checkout upstream-sync 2>/dev/null || git checkout -b upstream-sync main
git merge main --ff-only
echo "==> Merge upstream/main into upstream-sync"
if ! git merge upstream/main -m "merge: sync upstream pi-mono main"; then
echo
echo "Conflicts detected. Resolve them, then:"
echo " git add <resolved-files>"
echo " git commit"
echo " git checkout main && git merge upstream-sync"
echo " ./scripts/push-sproutclaw.sh"
exit 1
fi
echo "==> Merge upstream-sync into main"
git checkout main
git merge upstream-sync --ff-only
echo "==> Install deps and build"
npm install --ignore-scripts
npm run build
echo
echo "Done. Push with: ./scripts/push-sproutclaw.sh"
echo "Conflict hints:"
echo " README.md, sproutclaw patches -> keep ours"
echo " package-lock.json, *.generated.ts -> take upstream, then npm install"