项目文件夹

文件
Rohit C Prasad bcd0deda98 docs: one-command dev bootstrap for fresh checkouts
A clean clone had no runnable backend and no instructions to create one —
the GUI README assumed platform/.venv existed and still described the
desktop shell as future work. Add setup_dev_env.sh (venv + editable
coworker install + the aisuite .pth this checkout's import wiring needs,
verified by booting the server to a 200 health check) and rewrite the
README's from-source flows: browser two-terminal dev and tauri dev, which
already falls back to the venv server when no packaged sidecar exists.
2026-07-15 14:10:16 -07:00

26 行
1.1 KiB
Bash

#!/usr/bin/env bash
# One-time dev bootstrap for a fresh checkout: creates the Python venv every
# from-source flow expects at platform/.venv — the browser dev flow runs its
# coworker-server directly, and the Tauri desktop shell falls back to it when
# no packaged sidecar binary is present (src-tauri/src/lib.rs, resolution step 3).
#
# Usage: bash platform/packaging/setup_dev_env.sh
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
VENV="$ROOT/platform/.venv"
python3 -m venv "$VENV"
# The coworker package (server, engine, connectors) + inbound-messaging extras.
"$VENV/bin/pip" install --quiet --upgrade pip
"$VENV/bin/pip" install --quiet -e "$ROOT/platform[messaging,dev]"
# `import aisuite` resolves from THIS checkout, not PyPI — a .pth puts the repo
# root on the venv's path (the packaged app freezes it the same way).
SITE="$("$VENV/bin/python" -c 'import site; print(site.getsitepackages()[0])')"
echo "$ROOT" > "$SITE/aisuite_src.pth"
"$VENV/bin/python" -c 'import aisuite, coworker' # fail loudly if the wiring broke
echo "Ready: $VENV"
echo " server: $VENV/bin/coworker-server --cwd /path/to/your/project --port 8765"