mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 01:00:25 +00:00
rename
This commit is contained in:
parent
ef3ea5ec79
commit
09d5fc3ab4
8 changed files with 62 additions and 59 deletions
|
|
@ -8,7 +8,7 @@ Thanks for wanting to contribute! This guide exists to save both of us time.
|
|||
|
||||
Using AI to write code is fine. You can gain understanding by interrogating an agent with access to the codebase until you grasp all edge cases and effects of your changes. What's not fine is submitting agent-generated slop without that understanding.
|
||||
|
||||
If you use an agent, run it from the `co-mono` root directory so it picks up `AGENTS.md` automatically. Your agent must follow the rules and guidelines in that file.
|
||||
If you use an agent, run it from the `pi` root directory so it picks up `AGENTS.md` automatically. Your agent must follow the rules and guidelines in that file.
|
||||
|
||||
## First-Time Contributors
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ If you're adding a new provider to `packages/ai`, see `AGENTS.md` for required t
|
|||
|
||||
## Philosophy
|
||||
|
||||
co-mono's core is minimal. If your feature doesn't belong in the core, it should be an extension. PRs that bloat the core will likely be rejected.
|
||||
pi's core is minimal. If your feature doesn't belong in the core, it should be an extension. PRs that bloat the core will likely be rejected.
|
||||
|
||||
## Questions?
|
||||
|
||||
|
|
|
|||
25
README.md
25
README.md
|
|
@ -13,7 +13,7 @@
|
|||
<a href="https://exe.dev"><img src="packages/coding-agent/docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
|
||||
</p>
|
||||
|
||||
# Co-Mono
|
||||
# pi
|
||||
|
||||
> **Looking for the pi coding agent?** See **[packages/coding-agent](packages/coding-agent)** for installation and usage.
|
||||
|
||||
|
|
@ -53,10 +53,10 @@ curl -fsSL https://raw.githubusercontent.com/getcompanion-ai/co-mono/main/public
|
|||
|
||||
This installer:
|
||||
- Downloads the latest release (or falls back to source when needed),
|
||||
- writes `~/.local/bin/co-mono` launcher,
|
||||
- populates `~/.co-mono/agent/settings.json` with package list,
|
||||
- writes `~/.local/bin/pi` launcher,
|
||||
- populates `~/.pi/agent/settings.json` with package list,
|
||||
- installs packages (if `npm` is available),
|
||||
- and can install a user systemd service for `co-mono daemon` so it stays alive.
|
||||
- and can install a user systemd service for `pi gateway` so it stays alive.
|
||||
|
||||
Preinstalled package sources are:
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ If `npm` is available, it also installs these packages during install.
|
|||
If no release asset is found, the installer falls back to source.
|
||||
|
||||
```bash
|
||||
CO_MONO_FALLBACK_TO_SOURCE=0 \
|
||||
PI_FALLBACK_TO_SOURCE=0 \
|
||||
curl -fsSL https://raw.githubusercontent.com/getcompanion-ai/co-mono/main/public-install.sh | bash -s -- --daemon --start
|
||||
```
|
||||
|
||||
|
|
@ -94,27 +94,26 @@ cd co-mono
|
|||
Run:
|
||||
|
||||
```bash
|
||||
./co-mono
|
||||
./pi
|
||||
```
|
||||
|
||||
Run in background with extensions active:
|
||||
|
||||
```bash
|
||||
./co-mono daemon
|
||||
./pi gateway
|
||||
```
|
||||
|
||||
For a user systemd setup, create `~/.config/systemd/user/co-mono.service` with:
|
||||
For a user systemd setup, create `~/.config/systemd/user/pi.service` with:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=co-mono
|
||||
Description=pi gateway
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=PI_CODING_AGENT_DIR=%h/.co-mono/agent
|
||||
Environment=CO_MONO_AGENT_DIR=%h/.co-mono/agent
|
||||
ExecStart=/absolute/path/to/repo/co-mono daemon
|
||||
Environment=PI_CODING_AGENT_DIR=%h/.pi/agent
|
||||
ExecStart=/absolute/path/to/repo/pi gateway
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
|
|
@ -126,7 +125,7 @@ Then enable:
|
|||
|
||||
```bash
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now co-mono
|
||||
systemctl --user enable --now pi
|
||||
```
|
||||
|
||||
Optional:
|
||||
|
|
|
|||
10
install.sh
10
install.sh
|
|
@ -24,12 +24,12 @@ need npm
|
|||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if [[ "${CO_MONO_SKIP_INSTALL:-0}" != "1" ]]; then
|
||||
if [[ "${PI_SKIP_INSTALL:-${CO_MONO_SKIP_INSTALL:-0}}" != "1" ]]; then
|
||||
log "Installing workspace dependencies"
|
||||
npm install
|
||||
fi
|
||||
|
||||
if [[ "${CO_MONO_SKIP_BUILD:-0}" != "1" ]]; then
|
||||
if [[ "${PI_SKIP_BUILD:-${CO_MONO_SKIP_BUILD:-0}}" != "1" ]]; then
|
||||
log "Building core packages"
|
||||
BUILD_FAILED=0
|
||||
for pkg in packages/tui packages/ai packages/agent packages/coding-agent; do
|
||||
|
|
@ -46,7 +46,7 @@ if [[ "$BUILD_FAILED" == "1" ]] && [[ ! -f "$ROOT_DIR/packages/coding-agent/src/
|
|||
fail "No usable coding-agent CLI source found for source launch fallback."
|
||||
fi
|
||||
|
||||
LAUNCHER="$ROOT_DIR/co-mono"
|
||||
LAUNCHER="$ROOT_DIR/pi"
|
||||
cat > "$LAUNCHER" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
|
@ -66,10 +66,10 @@ if [[ -x "$ROOT_DIR/node_modules/.bin/tsx" ]] && [[ -f "$ROOT_DIR/packages/codin
|
|||
exec "$ROOT_DIR/node_modules/.bin/tsx" "$ROOT_DIR/packages/coding-agent/src/cli.ts" "$@"
|
||||
fi
|
||||
|
||||
echo "ERROR: no runnable co-mono binary found and tsx fallback is unavailable." >&2
|
||||
echo "ERROR: no runnable pi binary found and tsx fallback is unavailable." >&2
|
||||
exit 1
|
||||
EOF
|
||||
|
||||
chmod +x "$LAUNCHER"
|
||||
log "Created launcher: $LAUNCHER"
|
||||
log "Run with: ./co-mono"
|
||||
log "Run with: ./pi"
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "co-mono",
|
||||
"name": "pi",
|
||||
"version": "0.0.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "co-mono",
|
||||
"name": "pi",
|
||||
"version": "0.0.3",
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "co-mono",
|
||||
"name": "pi",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"homepage": "https://github.com/getcompanion-ai/co-mono#readme",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"folders": [
|
||||
{
|
||||
"name": "co-mono",
|
||||
"name": "pi",
|
||||
"path": "."
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,18 +3,18 @@
|
|||
set -euo pipefail
|
||||
|
||||
# Defaults
|
||||
REPO="${CO_MONO_REPO:-getcompanion-ai/co-mono}"
|
||||
VERSION="${CO_MONO_VERSION:-latest}"
|
||||
INSTALL_DIR="${CO_MONO_INSTALL_DIR:-$HOME/.co-mono}"
|
||||
BIN_DIR="${CO_MONO_BIN_DIR:-$HOME/.local/bin}"
|
||||
AGENT_DIR="${CO_MONO_AGENT_DIR:-$INSTALL_DIR/agent}"
|
||||
SERVICE_NAME="${CO_MONO_SERVICE_NAME:-co-mono}"
|
||||
FALLBACK_TO_SOURCE="${CO_MONO_FALLBACK_TO_SOURCE:-1}"
|
||||
SKIP_REINSTALL="${CO_MONO_SKIP_REINSTALL:-0}"
|
||||
RUN_INSTALL_PACKAGES="${CO_MONO_INSTALL_PACKAGES:-1}"
|
||||
SETUP_DAEMON="${CO_MONO_SETUP_DAEMON:-0}"
|
||||
START_DAEMON="${CO_MONO_START_DAEMON:-0}"
|
||||
SKIP_SERVICE="${CO_MONO_SKIP_SERVICE:-0}"
|
||||
REPO="${PI_REPO:-${CO_MONO_REPO:-getcompanion-ai/co-mono}}"
|
||||
VERSION="${PI_VERSION:-${CO_MONO_VERSION:-latest}}"
|
||||
INSTALL_DIR="${PI_INSTALL_DIR:-${CO_MONO_INSTALL_DIR:-$HOME/.pi}}"
|
||||
BIN_DIR="${PI_BIN_DIR:-${CO_MONO_BIN_DIR:-$HOME/.local/bin}}"
|
||||
AGENT_DIR="${PI_AGENT_DIR:-${CO_MONO_AGENT_DIR:-$INSTALL_DIR/agent}}"
|
||||
SERVICE_NAME="${PI_SERVICE_NAME:-${CO_MONO_SERVICE_NAME:-pi}}"
|
||||
FALLBACK_TO_SOURCE="${PI_FALLBACK_TO_SOURCE:-${CO_MONO_FALLBACK_TO_SOURCE:-1}}"
|
||||
SKIP_REINSTALL="${PI_SKIP_REINSTALL:-${CO_MONO_SKIP_REINSTALL:-0}}"
|
||||
RUN_INSTALL_PACKAGES="${PI_INSTALL_PACKAGES:-${CO_MONO_INSTALL_PACKAGES:-1}}"
|
||||
SETUP_DAEMON="${PI_SETUP_DAEMON:-${CO_MONO_SETUP_DAEMON:-0}}"
|
||||
START_DAEMON="${PI_START_DAEMON:-${CO_MONO_START_DAEMON:-0}}"
|
||||
SKIP_SERVICE="${PI_SKIP_SERVICE:-${CO_MONO_SKIP_SERVICE:-0}}"
|
||||
|
||||
DEFAULT_PACKAGES=(
|
||||
"npm:@e9n/pi-channels"
|
||||
|
|
@ -47,8 +47,8 @@ Usage:
|
|||
Options:
|
||||
--repo <owner/repo> Override GitHub repo for install (default: getcompanion-ai/co-mono)
|
||||
--version <tag>|latest Release tag to install (default: latest)
|
||||
--install-dir <path> Target directory for release contents (default: ~/.co-mono)
|
||||
--bin-dir <path> Directory for co-mono launcher (default: ~/.local/bin)
|
||||
--install-dir <path> Target directory for release contents (default: ~/.pi)
|
||||
--bin-dir <path> Directory for pi launcher (default: ~/.local/bin)
|
||||
--agent-dir <path> Agent config directory (default: <install-dir>/agent)
|
||||
--package <pkg> Add package to installation list (repeatable)
|
||||
--no-default-packages Skip default packages list
|
||||
|
|
@ -61,11 +61,11 @@ Options:
|
|||
--help
|
||||
|
||||
Env vars:
|
||||
CO_MONO_INSTALL_PACKAGES=0/1
|
||||
CO_MONO_SETUP_DAEMON=0/1
|
||||
CO_MONO_START_DAEMON=0/1
|
||||
CO_MONO_FALLBACK_TO_SOURCE=0/1
|
||||
CO_MONO_SKIP_REINSTALL=1
|
||||
PI_INSTALL_PACKAGES=0/1
|
||||
PI_SETUP_DAEMON=0/1
|
||||
PI_START_DAEMON=0/1
|
||||
PI_FALLBACK_TO_SOURCE=0/1
|
||||
PI_SKIP_REINSTALL=1
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ while [[ $# -gt 0 ]]; do
|
|||
done
|
||||
|
||||
if [[ "$FALLBACK_TO_SOURCE" != "0" && "$FALLBACK_TO_SOURCE" != "1" ]]; then
|
||||
fail "CO_MONO_FALLBACK_TO_SOURCE must be 0 or 1"
|
||||
fail "PI_FALLBACK_TO_SOURCE must be 0 or 1"
|
||||
fi
|
||||
|
||||
if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
|
||||
|
|
@ -157,7 +157,7 @@ if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
|
|||
fi
|
||||
|
||||
if [[ -z "${SERVICE_NAME:-}" ]]; then
|
||||
SERVICE_NAME="co-mono"
|
||||
SERVICE_NAME="pi"
|
||||
fi
|
||||
|
||||
download_file() {
|
||||
|
|
@ -272,8 +272,8 @@ write_launcher() {
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
export CO_MONO_AGENT_DIR="${AGENT_DIR}"
|
||||
export PI_CODING_AGENT_DIR="${AGENT_DIR}"
|
||||
export CO_MONO_AGENT_DIR="${AGENT_DIR}"
|
||||
|
||||
exec "${runtime_dir}" "\$@"
|
||||
EOF
|
||||
|
|
@ -330,7 +330,7 @@ install_packages() {
|
|||
|
||||
while IFS= read -r package; do
|
||||
[[ -z "$package" ]] && continue
|
||||
if "$BIN_DIR/co-mono" install "$package" >/dev/null 2>&1; then
|
||||
if "$BIN_DIR/pi" install "$package" >/dev/null 2>&1; then
|
||||
log "Installed package: $package"
|
||||
else
|
||||
log "Could not install ${package} now. It will install on first run when available."
|
||||
|
|
@ -347,14 +347,14 @@ write_service_file() {
|
|||
local service_path="$HOME/.config/systemd/user/${SERVICE_NAME}.service"
|
||||
cat > "$service_path" <<EOF
|
||||
[Unit]
|
||||
Description=co-mono background agent
|
||||
Description=pi gateway
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=CO_MONO_AGENT_DIR=${AGENT_DIR}
|
||||
Environment=PI_CODING_AGENT_DIR=${AGENT_DIR}
|
||||
ExecStart=${BIN_DIR}/co-mono daemon
|
||||
ExecStart=${BIN_DIR}/pi gateway
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
|
|
@ -375,13 +375,13 @@ start_daemon_service() {
|
|||
print_next_steps() {
|
||||
echo
|
||||
log "Installed to: $INSTALL_DIR"
|
||||
log "Launcher: $BIN_DIR/co-mono"
|
||||
log "Launcher: $BIN_DIR/pi"
|
||||
echo
|
||||
echo "Run in terminal:"
|
||||
echo " co-mono"
|
||||
echo " pi"
|
||||
echo
|
||||
echo "Run always-on:"
|
||||
echo " co-mono daemon"
|
||||
echo " pi gateway"
|
||||
echo
|
||||
if [[ "$SETUP_DAEMON" == "1" ]] && [[ "$SKIP_SERVICE" == "0" ]]; then
|
||||
echo "Service:"
|
||||
|
|
@ -419,16 +419,16 @@ bootstrap_from_source() {
|
|||
log "Running source install"
|
||||
(
|
||||
cd "$source_dir"
|
||||
CO_MONO_AGENT_DIR="$AGENT_DIR" \
|
||||
PI_AGENT_DIR="$AGENT_DIR" \
|
||||
PI_CODING_AGENT_DIR="$AGENT_DIR" \
|
||||
./install.sh
|
||||
)
|
||||
|
||||
if [[ ! -x "$source_dir/co-mono" ]]; then
|
||||
fail "co-mono executable not found in source checkout."
|
||||
if [[ ! -x "$source_dir/pi" ]]; then
|
||||
fail "pi executable not found in source checkout."
|
||||
fi
|
||||
|
||||
write_launcher "$BIN_DIR/co-mono" "$source_dir/co-mono"
|
||||
write_launcher "$BIN_DIR/pi" "$source_dir/pi"
|
||||
ensure_agent_settings
|
||||
install_packages
|
||||
}
|
||||
|
|
@ -487,8 +487,12 @@ install_from_release() {
|
|||
fi
|
||||
|
||||
# Runtime launcher with fixed agent dir env.
|
||||
write_launcher "$INSTALL_DIR/co-mono" "$install_binary"
|
||||
write_launcher "$BIN_DIR/co-mono" "$INSTALL_DIR/co-mono"
|
||||
local launcher_target="$install_binary"
|
||||
if [[ "$install_binary" != "$INSTALL_DIR/pi" ]]; then
|
||||
write_launcher "$INSTALL_DIR/pi" "$install_binary"
|
||||
launcher_target="$INSTALL_DIR/pi"
|
||||
fi
|
||||
write_launcher "$BIN_DIR/pi" "$launcher_target"
|
||||
ensure_agent_settings
|
||||
install_packages
|
||||
rm -rf "$workdir"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
/**
|
||||
* Release script for co-mono
|
||||
* Release script for pi
|
||||
*
|
||||
* Usage: node scripts/release.mjs <major|minor|patch>
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue