-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
86 lines (73 loc) · 5.6 KB
/
Copy pathjustfile
File metadata and controls
86 lines (73 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
default:
@just --list
# Run the nation for the BLACKBOX workspace on http://localhost:4242 with hot reload
dev:
-lsof -ti :4242 | xargs kill -9 2>/dev/null
@echo "Agentopolis Nation on http://localhost:4242 (nation: ..)"
@sleep 1 && open http://localhost:4242 &
exec env AGENTOPOLIS_ROOT=.. .venv/bin/uvicorn agentopolis.server:app --reload --reload-dir agentopolis --port 4242 --log-level warning --timeout-graceful-shutdown 1
# Run the hosted landing interface locally on http://localhost:4245 — baked showcase fixtures, no live git.
# Mirrors the Dockerfile. Run `just bake` first if agentopolis/showcase/ is missing.
landing demo="methodproof":
-lsof -ti :4245 | xargs kill -9 2>/dev/null
@echo "Agentopolis Landing on http://localhost:4245 (showcase: {{demo}})"
@sleep 1 && open http://localhost:4245 &
exec env AGENTOPOLIS_SHOWCASE=agentopolis/showcase AGENTOPOLIS_DEMO_CITY={{demo}} .venv/bin/uvicorn agentopolis.server:app --reload --reload-dir agentopolis --port 4245 --log-level warning --timeout-graceful-shutdown 1
# Serve one repo as a city on http://localhost:4243 (small/simple repos render as a village). e.g. `just town ../AURA`
town repo=".":
-lsof -ti :4243 | xargs kill -9 2>/dev/null
@echo "Agentopolis Town on http://localhost:4243 (repo: {{repo}})"
@sleep 1 && open http://localhost:4243 &
exec env AGENTOPOLIS_REPO={{repo}} .venv/bin/uvicorn agentopolis.server:app --reload --reload-dir agentopolis --port 4243 --log-level warning --timeout-graceful-shutdown 1
# Time-lapse a repo's git history as a growing city (QA). Local path or GitHub URL.
# e.g. `just movie ../PROVE` or `just movie https://github.com/chalk/ansi-styles`
movie repo=".":
-lsof -ti :4244 | xargs kill -9 2>/dev/null
@echo "Agentopolis Movie on http://localhost:4244 ({{repo}})"
@sleep 1 && case "{{repo}}" in http*) open "http://localhost:4244/?forge={{repo}}&timelapse";; *) open "http://localhost:4244/?timelapse";; esac &
@case "{{repo}}" in http*) R="." ;; *) R="{{repo}}" ;; esac; exec env AGENTOPOLIS_REPO="$R" .venv/bin/uvicorn agentopolis.server:app --reload --reload-dir agentopolis --port 4244 --log-level warning --timeout-graceful-shutdown 1
# Run the test suite (backend functional + Playwright UI). First time: `uv run --extra test playwright install chromium`.
test *args:
uv run --extra test pytest tests/ {{args}}
# Re-bake the BLACKBOX showcase fixtures (run before deploy when repos change).
# DEMO_CITY matches the Dockerfile so the landing city also gets its grow-from-start movie timeline.
bake demo="methodproof":
AGENTOPOLIS_DEMO_CITY={{demo}} .venv/bin/python -m agentopolis.bake
# Deploy the hosted demo. Fixtures (private project data) never touch public git —
# they rsync straight to the host between the pull and the rebuild.
# Set the host out-of-band: `export AGENTOPOLIS_DEPLOY_HOST=user@host`.
deploy:
@test -n "${AGENTOPOLIS_DEPLOY_HOST:-}" || { echo "set AGENTOPOLIS_DEPLOY_HOST=user@host first"; exit 1; }
git push origin master
ssh "$AGENTOPOLIS_DEPLOY_HOST" 'cd /opt/agentopolis && git pull'
rsync -az --delete agentopolis/showcase/ "$AGENTOPOLIS_DEPLOY_HOST":/opt/agentopolis/agentopolis/showcase/
ssh "$AGENTOPOLIS_DEPLOY_HOST" 'cd /opt/agentopolis && docker compose up -d --build'
-just prewarm # best-effort: needs a local chromium (playwright install chromium)
# Pre-warm the demo landing's og:video (headless-record the build, upload it) so the shared link plays inline
prewarm:
AGENTOPOLIS_PUBLIC_URL="${AGENTOPOLIS_PUBLIC_URL:-https://agentopolis.codeblackwell.ai}" .venv/bin/python -m agentopolis.prewarm
# Install hooks into ~/.claude/settings.json (new sessions report in)
attach:
uv run agentopolis attach
# Remove the city's hooks
detach:
uv run agentopolis detach
# Cut a release: bump version, commit, tag, push -> the release workflow does PyPI + brew + deploy.
release version:
@grep -q "## \[{{version}}\]" CHANGELOG.md || { echo "add a CHANGELOG.md entry for {{version}} first"; exit 1; }
sed -i '' -E 's/^version = ".*"/version = "{{version}}"/' pyproject.toml
git commit -am "chore(release): {{version}}"
git tag v{{version}}
git push origin master --tags
# Recent PyPI download counts (acquisition metric; pairs with the /stats web funnel)
pypi-stats:
@curl -s https://pypistats.org/api/packages/agentopolis/recent | python3 -c "import sys,json; d=json.load(sys.stdin)['data']; print('agentopolis downloads — day:', d['last_day'], 'week:', d['last_week'], 'month:', d['last_month'])"
# Regenerate the Homebrew formula from the published PyPI release (run after `uv publish`)
brew-formula version=`grep '^version' pyproject.toml | cut -d'"' -f2`:
@url=$(curl -s https://pypi.org/pypi/agentopolis/{{version}}/json | python3 -c "import sys,json;print(next(u['url'] for u in json.load(sys.stdin)['urls'] if u['packagetype']=='sdist'))"); \
sha=$(curl -s https://pypi.org/pypi/agentopolis/{{version}}/json | python3 -c "import sys,json;print(next(u['digests']['sha256'] for u in json.load(sys.stdin)['urls'] if u['packagetype']=='sdist'))"); \
sed -i '' -E "s|^ url .*| url \"$url\"|; s|^ sha256 .*| sha256 \"$sha\"|" packaging/homebrew/agentopolis.rb && \
cp packaging/homebrew/agentopolis.rb "$(brew --repository)/Library/Taps/codeblackwell/homebrew-tap/Formula/agentopolis.rb" && \
brew update-python-resources agentopolis && \
cp "$(brew --repository)/Library/Taps/codeblackwell/homebrew-tap/Formula/agentopolis.rb" packaging/homebrew/agentopolis.rb && \
echo "formula updated to {{version}} — commit packaging/homebrew/agentopolis.rb and push the tap"