mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 09:01:14 +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.
|
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
|
## First-Time Contributors
|
||||||
|
|
||||||
|
|
@ -35,7 +35,7 @@ If you're adding a new provider to `packages/ai`, see `AGENTS.md` for required t
|
||||||
|
|
||||||
## Philosophy
|
## 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?
|
## 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>
|
<a href="https://exe.dev"><img src="packages/coding-agent/docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# Co-Mono
|
# pi
|
||||||
|
|
||||||
> **Looking for the pi coding agent?** See **[packages/coding-agent](packages/coding-agent)** for installation and usage.
|
> **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:
|
This installer:
|
||||||
- Downloads the latest release (or falls back to source when needed),
|
- Downloads the latest release (or falls back to source when needed),
|
||||||
- writes `~/.local/bin/co-mono` launcher,
|
- writes `~/.local/bin/pi` launcher,
|
||||||
- populates `~/.co-mono/agent/settings.json` with package list,
|
- populates `~/.pi/agent/settings.json` with package list,
|
||||||
- installs packages (if `npm` is available),
|
- 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:
|
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.
|
If no release asset is found, the installer falls back to source.
|
||||||
|
|
||||||
```bash
|
```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
|
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:
|
Run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./co-mono
|
./pi
|
||||||
```
|
```
|
||||||
|
|
||||||
Run in background with extensions active:
|
Run in background with extensions active:
|
||||||
|
|
||||||
```bash
|
```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
|
```ini
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=co-mono
|
Description=pi gateway
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Environment=PI_CODING_AGENT_DIR=%h/.co-mono/agent
|
Environment=PI_CODING_AGENT_DIR=%h/.pi/agent
|
||||||
Environment=CO_MONO_AGENT_DIR=%h/.co-mono/agent
|
ExecStart=/absolute/path/to/repo/pi gateway
|
||||||
ExecStart=/absolute/path/to/repo/co-mono daemon
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
|
|
@ -126,7 +125,7 @@ Then enable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
systemctl --user enable --now co-mono
|
systemctl --user enable --now pi
|
||||||
```
|
```
|
||||||
|
|
||||||
Optional:
|
Optional:
|
||||||
|
|
|
||||||
10
install.sh
10
install.sh
|
|
@ -24,12 +24,12 @@ need npm
|
||||||
|
|
||||||
cd "$ROOT_DIR"
|
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"
|
log "Installing workspace dependencies"
|
||||||
npm install
|
npm install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${CO_MONO_SKIP_BUILD:-0}" != "1" ]]; then
|
if [[ "${PI_SKIP_BUILD:-${CO_MONO_SKIP_BUILD:-0}}" != "1" ]]; then
|
||||||
log "Building core packages"
|
log "Building core packages"
|
||||||
BUILD_FAILED=0
|
BUILD_FAILED=0
|
||||||
for pkg in packages/tui packages/ai packages/agent packages/coding-agent; do
|
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."
|
fail "No usable coding-agent CLI source found for source launch fallback."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LAUNCHER="$ROOT_DIR/co-mono"
|
LAUNCHER="$ROOT_DIR/pi"
|
||||||
cat > "$LAUNCHER" <<'EOF'
|
cat > "$LAUNCHER" <<'EOF'
|
||||||
#!/usr/bin/env bash
|
#!/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" "$@"
|
exec "$ROOT_DIR/node_modules/.bin/tsx" "$ROOT_DIR/packages/coding-agent/src/cli.ts" "$@"
|
||||||
fi
|
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
|
exit 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x "$LAUNCHER"
|
chmod +x "$LAUNCHER"
|
||||||
log "Created launcher: $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",
|
"version": "0.0.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "co-mono",
|
"name": "pi",
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*",
|
"packages/*",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "co-mono",
|
"name": "pi",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"homepage": "https://github.com/getcompanion-ai/co-mono#readme",
|
"homepage": "https://github.com/getcompanion-ai/co-mono#readme",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"name": "co-mono",
|
"name": "pi",
|
||||||
"path": "."
|
"path": "."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
REPO="${CO_MONO_REPO:-getcompanion-ai/co-mono}"
|
REPO="${PI_REPO:-${CO_MONO_REPO:-getcompanion-ai/co-mono}}"
|
||||||
VERSION="${CO_MONO_VERSION:-latest}"
|
VERSION="${PI_VERSION:-${CO_MONO_VERSION:-latest}}"
|
||||||
INSTALL_DIR="${CO_MONO_INSTALL_DIR:-$HOME/.co-mono}"
|
INSTALL_DIR="${PI_INSTALL_DIR:-${CO_MONO_INSTALL_DIR:-$HOME/.pi}}"
|
||||||
BIN_DIR="${CO_MONO_BIN_DIR:-$HOME/.local/bin}"
|
BIN_DIR="${PI_BIN_DIR:-${CO_MONO_BIN_DIR:-$HOME/.local/bin}}"
|
||||||
AGENT_DIR="${CO_MONO_AGENT_DIR:-$INSTALL_DIR/agent}"
|
AGENT_DIR="${PI_AGENT_DIR:-${CO_MONO_AGENT_DIR:-$INSTALL_DIR/agent}}"
|
||||||
SERVICE_NAME="${CO_MONO_SERVICE_NAME:-co-mono}"
|
SERVICE_NAME="${PI_SERVICE_NAME:-${CO_MONO_SERVICE_NAME:-pi}}"
|
||||||
FALLBACK_TO_SOURCE="${CO_MONO_FALLBACK_TO_SOURCE:-1}"
|
FALLBACK_TO_SOURCE="${PI_FALLBACK_TO_SOURCE:-${CO_MONO_FALLBACK_TO_SOURCE:-1}}"
|
||||||
SKIP_REINSTALL="${CO_MONO_SKIP_REINSTALL:-0}"
|
SKIP_REINSTALL="${PI_SKIP_REINSTALL:-${CO_MONO_SKIP_REINSTALL:-0}}"
|
||||||
RUN_INSTALL_PACKAGES="${CO_MONO_INSTALL_PACKAGES:-1}"
|
RUN_INSTALL_PACKAGES="${PI_INSTALL_PACKAGES:-${CO_MONO_INSTALL_PACKAGES:-1}}"
|
||||||
SETUP_DAEMON="${CO_MONO_SETUP_DAEMON:-0}"
|
SETUP_DAEMON="${PI_SETUP_DAEMON:-${CO_MONO_SETUP_DAEMON:-0}}"
|
||||||
START_DAEMON="${CO_MONO_START_DAEMON:-0}"
|
START_DAEMON="${PI_START_DAEMON:-${CO_MONO_START_DAEMON:-0}}"
|
||||||
SKIP_SERVICE="${CO_MONO_SKIP_SERVICE:-0}"
|
SKIP_SERVICE="${PI_SKIP_SERVICE:-${CO_MONO_SKIP_SERVICE:-0}}"
|
||||||
|
|
||||||
DEFAULT_PACKAGES=(
|
DEFAULT_PACKAGES=(
|
||||||
"npm:@e9n/pi-channels"
|
"npm:@e9n/pi-channels"
|
||||||
|
|
@ -47,8 +47,8 @@ Usage:
|
||||||
Options:
|
Options:
|
||||||
--repo <owner/repo> Override GitHub repo for install (default: getcompanion-ai/co-mono)
|
--repo <owner/repo> Override GitHub repo for install (default: getcompanion-ai/co-mono)
|
||||||
--version <tag>|latest Release tag to install (default: latest)
|
--version <tag>|latest Release tag to install (default: latest)
|
||||||
--install-dir <path> Target directory for release contents (default: ~/.co-mono)
|
--install-dir <path> Target directory for release contents (default: ~/.pi)
|
||||||
--bin-dir <path> Directory for co-mono launcher (default: ~/.local/bin)
|
--bin-dir <path> Directory for pi launcher (default: ~/.local/bin)
|
||||||
--agent-dir <path> Agent config directory (default: <install-dir>/agent)
|
--agent-dir <path> Agent config directory (default: <install-dir>/agent)
|
||||||
--package <pkg> Add package to installation list (repeatable)
|
--package <pkg> Add package to installation list (repeatable)
|
||||||
--no-default-packages Skip default packages list
|
--no-default-packages Skip default packages list
|
||||||
|
|
@ -61,11 +61,11 @@ Options:
|
||||||
--help
|
--help
|
||||||
|
|
||||||
Env vars:
|
Env vars:
|
||||||
CO_MONO_INSTALL_PACKAGES=0/1
|
PI_INSTALL_PACKAGES=0/1
|
||||||
CO_MONO_SETUP_DAEMON=0/1
|
PI_SETUP_DAEMON=0/1
|
||||||
CO_MONO_START_DAEMON=0/1
|
PI_START_DAEMON=0/1
|
||||||
CO_MONO_FALLBACK_TO_SOURCE=0/1
|
PI_FALLBACK_TO_SOURCE=0/1
|
||||||
CO_MONO_SKIP_REINSTALL=1
|
PI_SKIP_REINSTALL=1
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,7 +149,7 @@ while [[ $# -gt 0 ]]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ "$FALLBACK_TO_SOURCE" != "0" && "$FALLBACK_TO_SOURCE" != "1" ]]; then
|
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
|
fi
|
||||||
|
|
||||||
if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
|
if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
|
||||||
|
|
@ -157,7 +157,7 @@ if [[ -d "$INSTALL_DIR" && "$SKIP_REINSTALL" != "1" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${SERVICE_NAME:-}" ]]; then
|
if [[ -z "${SERVICE_NAME:-}" ]]; then
|
||||||
SERVICE_NAME="co-mono"
|
SERVICE_NAME="pi"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
download_file() {
|
download_file() {
|
||||||
|
|
@ -272,8 +272,8 @@ write_launcher() {
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
export CO_MONO_AGENT_DIR="${AGENT_DIR}"
|
|
||||||
export PI_CODING_AGENT_DIR="${AGENT_DIR}"
|
export PI_CODING_AGENT_DIR="${AGENT_DIR}"
|
||||||
|
export CO_MONO_AGENT_DIR="${AGENT_DIR}"
|
||||||
|
|
||||||
exec "${runtime_dir}" "\$@"
|
exec "${runtime_dir}" "\$@"
|
||||||
EOF
|
EOF
|
||||||
|
|
@ -330,7 +330,7 @@ install_packages() {
|
||||||
|
|
||||||
while IFS= read -r package; do
|
while IFS= read -r package; do
|
||||||
[[ -z "$package" ]] && continue
|
[[ -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"
|
log "Installed package: $package"
|
||||||
else
|
else
|
||||||
log "Could not install ${package} now. It will install on first run when available."
|
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"
|
local service_path="$HOME/.config/systemd/user/${SERVICE_NAME}.service"
|
||||||
cat > "$service_path" <<EOF
|
cat > "$service_path" <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=co-mono background agent
|
Description=pi gateway
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Environment=CO_MONO_AGENT_DIR=${AGENT_DIR}
|
Environment=CO_MONO_AGENT_DIR=${AGENT_DIR}
|
||||||
Environment=PI_CODING_AGENT_DIR=${AGENT_DIR}
|
Environment=PI_CODING_AGENT_DIR=${AGENT_DIR}
|
||||||
ExecStart=${BIN_DIR}/co-mono daemon
|
ExecStart=${BIN_DIR}/pi gateway
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
|
|
@ -375,13 +375,13 @@ start_daemon_service() {
|
||||||
print_next_steps() {
|
print_next_steps() {
|
||||||
echo
|
echo
|
||||||
log "Installed to: $INSTALL_DIR"
|
log "Installed to: $INSTALL_DIR"
|
||||||
log "Launcher: $BIN_DIR/co-mono"
|
log "Launcher: $BIN_DIR/pi"
|
||||||
echo
|
echo
|
||||||
echo "Run in terminal:"
|
echo "Run in terminal:"
|
||||||
echo " co-mono"
|
echo " pi"
|
||||||
echo
|
echo
|
||||||
echo "Run always-on:"
|
echo "Run always-on:"
|
||||||
echo " co-mono daemon"
|
echo " pi gateway"
|
||||||
echo
|
echo
|
||||||
if [[ "$SETUP_DAEMON" == "1" ]] && [[ "$SKIP_SERVICE" == "0" ]]; then
|
if [[ "$SETUP_DAEMON" == "1" ]] && [[ "$SKIP_SERVICE" == "0" ]]; then
|
||||||
echo "Service:"
|
echo "Service:"
|
||||||
|
|
@ -419,16 +419,16 @@ bootstrap_from_source() {
|
||||||
log "Running source install"
|
log "Running source install"
|
||||||
(
|
(
|
||||||
cd "$source_dir"
|
cd "$source_dir"
|
||||||
CO_MONO_AGENT_DIR="$AGENT_DIR" \
|
PI_AGENT_DIR="$AGENT_DIR" \
|
||||||
PI_CODING_AGENT_DIR="$AGENT_DIR" \
|
PI_CODING_AGENT_DIR="$AGENT_DIR" \
|
||||||
./install.sh
|
./install.sh
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ ! -x "$source_dir/co-mono" ]]; then
|
if [[ ! -x "$source_dir/pi" ]]; then
|
||||||
fail "co-mono executable not found in source checkout."
|
fail "pi executable not found in source checkout."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
write_launcher "$BIN_DIR/co-mono" "$source_dir/co-mono"
|
write_launcher "$BIN_DIR/pi" "$source_dir/pi"
|
||||||
ensure_agent_settings
|
ensure_agent_settings
|
||||||
install_packages
|
install_packages
|
||||||
}
|
}
|
||||||
|
|
@ -487,8 +487,12 @@ install_from_release() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Runtime launcher with fixed agent dir env.
|
# Runtime launcher with fixed agent dir env.
|
||||||
write_launcher "$INSTALL_DIR/co-mono" "$install_binary"
|
local launcher_target="$install_binary"
|
||||||
write_launcher "$BIN_DIR/co-mono" "$INSTALL_DIR/co-mono"
|
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
|
ensure_agent_settings
|
||||||
install_packages
|
install_packages
|
||||||
rm -rf "$workdir"
|
rm -rf "$workdir"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* Release script for co-mono
|
* Release script for pi
|
||||||
*
|
*
|
||||||
* Usage: node scripts/release.mjs <major|minor|patch>
|
* Usage: node scripts/release.mjs <major|minor|patch>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue