diff --git a/README.md b/README.md index 415bfe30..c3b4462c 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ timmy-config/ ├── bin/ ← Live utility scripts (NOT deprecated loops) │ ├── hermes-startup.sh ← Hermes boot sequence │ ├── agent-dispatch.sh ← Manual agent dispatch +│ ├── deploy-allegro-house.sh← Bootstraps the remote Allegro wizard house │ ├── ops-panel.sh ← Ops dashboard panel │ ├── ops-gitea.sh ← Gitea ops helpers │ ├── pipeline-freshness.sh ← Session/export drift check @@ -25,6 +26,7 @@ timmy-config/ ├── skins/ ← UI skins (timmy skin) ├── playbooks/ ← Agent playbooks (YAML) ├── cron/ ← Cron job definitions +├── wizards/ ← Remote wizard-house templates + units └── training/ ← Transitional training recipes, not canonical lived data ``` diff --git a/bin/deploy-allegro-house.sh b/bin/deploy-allegro-house.sh new file mode 100755 index 00000000..93980818 --- /dev/null +++ b/bin/deploy-allegro-house.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +TARGET="${1:-root@167.99.126.228}" +HERMES_REPO_URL="${HERMES_REPO_URL:-https://github.com/NousResearch/hermes-agent.git}" +KIMI_API_KEY="${KIMI_API_KEY:-}" + +if [[ -z "$KIMI_API_KEY" && -f "$HOME/.config/kimi/api_key" ]]; then + KIMI_API_KEY="$(tr -d '\n' < "$HOME/.config/kimi/api_key")" +fi + +if [[ -z "$KIMI_API_KEY" ]]; then + echo "KIMI_API_KEY is required (env or ~/.config/kimi/api_key)" >&2 + exit 1 +fi + +ssh "$TARGET" 'apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y git python3 python3-venv python3-pip curl ca-certificates' +ssh "$TARGET" 'mkdir -p /root/wizards/allegro/home /root/wizards/allegro/hermes-agent' + +ssh "$TARGET" "if [ ! -d /root/wizards/allegro/hermes-agent/.git ]; then git clone '$HERMES_REPO_URL' /root/wizards/allegro/hermes-agent; fi" +ssh "$TARGET" 'cd /root/wizards/allegro/hermes-agent && python3 -m venv .venv && .venv/bin/pip install --upgrade pip setuptools wheel && .venv/bin/pip install -e .' + +ssh "$TARGET" "cat > /root/wizards/allegro/home/config.yaml" < "$REPO_DIR/wizards/allegro/config.yaml" +ssh "$TARGET" "cat > /root/wizards/allegro/home/SOUL.md" < "$REPO_DIR/SOUL.md" +ssh "$TARGET" "cat > /root/wizards/allegro/home/.env <<'EOF' +KIMI_API_KEY=$KIMI_API_KEY +EOF" +ssh "$TARGET" "cat > /etc/systemd/system/hermes-allegro.service" < "$REPO_DIR/wizards/allegro/hermes-allegro.service" + +ssh "$TARGET" 'chmod 600 /root/wizards/allegro/home/.env && systemctl daemon-reload && systemctl enable --now hermes-allegro.service && systemctl restart hermes-allegro.service && systemctl is-active hermes-allegro.service && curl -fsS http://127.0.0.1:8645/health' \ No newline at end of file diff --git a/docs/allegro-wizard-house.md b/docs/allegro-wizard-house.md new file mode 100644 index 00000000..e3143cf9 --- /dev/null +++ b/docs/allegro-wizard-house.md @@ -0,0 +1,44 @@ +# Allegro wizard house + +Purpose: +- stand up the third wizard house as a Kimi-backed coding worker +- keep Hermes as the durable harness +- treat OpenClaw as optional shell frontage, not the bones + +Local proof already achieved: + +```bash +HERMES_HOME=$HOME/.timmy/wizards/allegro/home \ + hermes doctor + +HERMES_HOME=$HOME/.timmy/wizards/allegro/home \ + hermes chat -Q --provider kimi-coding -m kimi-for-coding \ + -q "Reply with exactly: ALLEGRO KIMI ONLINE" +``` + +Observed proof: +- Kimi / Moonshot API check passed in `hermes doctor` +- chat returned exactly `ALLEGRO KIMI ONLINE` + +Repo assets: +- `wizards/allegro/config.yaml` +- `wizards/allegro/hermes-allegro.service` +- `bin/deploy-allegro-house.sh` + +Remote target: +- host: `167.99.126.228` +- house root: `/root/wizards/allegro` +- `HERMES_HOME`: `/root/wizards/allegro/home` +- api health: `http://127.0.0.1:8645/health` + +Deploy command: + +```bash +cd ~/.timmy/timmy-config +bin/deploy-allegro-house.sh root@167.99.126.228 +``` + +Important nuance: +- the Hermes/Kimi lane is the proven path +- direct embedded OpenClaw Kimi model routing was not yet reliable locally +- so the remote deployment keeps the minimal, proven architecture: Hermes house first \ No newline at end of file diff --git a/tests/test_allegro_wizard_assets.py b/tests/test_allegro_wizard_assets.py new file mode 100644 index 00000000..fc20980f --- /dev/null +++ b/tests/test_allegro_wizard_assets.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +from pathlib import Path + +import yaml + + +def test_allegro_config_targets_kimi_house() -> None: + config = yaml.safe_load(Path("wizards/allegro/config.yaml").read_text()) + + assert config["model"]["provider"] == "kimi-coding" + assert config["model"]["default"] == "kimi-for-coding" + assert config["platforms"]["api_server"]["extra"]["port"] == 8645 + + +def test_allegro_service_uses_isolated_home() -> None: + text = Path("wizards/allegro/hermes-allegro.service").read_text() + + assert "HERMES_HOME=/root/wizards/allegro/home" in text + assert "hermes gateway run --replace" in text + + +def test_deploy_script_requires_external_secret() -> None: + text = Path("bin/deploy-allegro-house.sh").read_text() + + assert "~/.config/kimi/api_key" in text + assert "sk-kimi-" not in text \ No newline at end of file diff --git a/wizards/allegro/README.md b/wizards/allegro/README.md new file mode 100644 index 00000000..d9b4a237 --- /dev/null +++ b/wizards/allegro/README.md @@ -0,0 +1,16 @@ +# Allegro wizard house + +Allegro is the third wizard house. + +Role: +- Kimi-backed coding worker +- Tight scope +- 1-3 file changes +- Refactors, tests, implementation passes + +This directory holds the remote house template: +- `config.yaml` — Hermes house config +- `hermes-allegro.service` — systemd unit + +Secrets do not live here. +`KIMI_API_KEY` must be injected at deploy time into `/root/wizards/allegro/home/.env`. diff --git a/wizards/allegro/config.yaml b/wizards/allegro/config.yaml new file mode 100644 index 00000000..8654865b --- /dev/null +++ b/wizards/allegro/config.yaml @@ -0,0 +1,61 @@ +model: + default: kimi-for-coding + provider: kimi-coding +toolsets: + - all +agent: + max_turns: 30 + reasoning_effort: xhigh + verbose: false +terminal: + backend: local + cwd: . + timeout: 180 + persistent_shell: true +browser: + inactivity_timeout: 120 + command_timeout: 30 + record_sessions: false +display: + compact: false + personality: '' + resume_display: full + busy_input_mode: interrupt + bell_on_complete: false + show_reasoning: false + streaming: false + show_cost: false + tool_progress: all +memory: + memory_enabled: true + user_profile_enabled: true + memory_char_limit: 2200 + user_char_limit: 1375 + nudge_interval: 10 + flush_min_turns: 6 +approvals: + mode: manual +security: + redact_secrets: true + tirith_enabled: false +platforms: + api_server: + enabled: true + extra: + host: 127.0.0.1 + port: 8645 +session_reset: + mode: none + idle_minutes: 0 +skills: + creation_nudge_interval: 15 +system_prompt_suffix: | + You are Allegro, the Kimi-backed third wizard house. + Your soul is defined in SOUL.md — read it, live it. + Hermes is your harness. + Kimi Code is your primary provider. + You speak plainly. You prefer short sentences. Brevity is a kindness. + + Work best on tight coding tasks: 1-3 file changes, refactors, tests, and implementation passes. + Refusal over fabrication. If you do not know, say so. + Sovereignty and service always. diff --git a/wizards/allegro/hermes-allegro.service b/wizards/allegro/hermes-allegro.service new file mode 100644 index 00000000..fda6f8ac --- /dev/null +++ b/wizards/allegro/hermes-allegro.service @@ -0,0 +1,16 @@ +[Unit] +Description=Hermes Allegro Wizard House +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +WorkingDirectory=/root/wizards/allegro/hermes-agent +Environment=HERMES_HOME=/root/wizards/allegro/home +EnvironmentFile=/root/wizards/allegro/home/.env +ExecStart=/root/wizards/allegro/hermes-agent/.venv/bin/hermes gateway run --replace +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target