agenthub-multiagent-mcp 1.47.0 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/channel.js +65 -41
  2. package/dist/channel.js.map +1 -1
  3. package/dist/client.d.ts +80 -0
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +67 -0
  6. package/dist/client.js.map +1 -1
  7. package/dist/commands/setup-shell.js +11 -11
  8. package/dist/setup.js +1 -77
  9. package/dist/setup.js.map +1 -1
  10. package/dist/tools/index.d.ts.map +1 -1
  11. package/dist/tools/index.js +229 -0
  12. package/dist/tools/index.js.map +1 -1
  13. package/dist/tools/tools.test.js +71 -10
  14. package/dist/tools/tools.test.js.map +1 -1
  15. package/dist/worker.js +0 -4
  16. package/dist/worker.js.map +1 -1
  17. package/package.json +1 -1
  18. package/skills/catalog.json +8 -0
  19. package/skills/commands/start-session.md +77 -77
  20. package/skills/manifest.json +5 -0
  21. package/skills/skills/deploy-staging/SKILL.md +164 -164
  22. package/skills/skills/deploy-vps-openclaw/SKILL.md +97 -97
  23. package/skills/skills/karpathy-guidelines/SKILL.md +67 -67
  24. package/skills/skills/multiagent-brainstorm/SKILL.md +142 -0
  25. package/dist/.agenthub/activity +0 -1
  26. package/dist/channelLib.d.ts +0 -42
  27. package/dist/channelLib.d.ts.map +0 -1
  28. package/dist/channelLib.js +0 -74
  29. package/dist/channelLib.js.map +0 -1
  30. package/dist/channelLib.test.d.ts +0 -2
  31. package/dist/channelLib.test.d.ts.map +0 -1
  32. package/dist/channelLib.test.js +0 -67
  33. package/dist/channelLib.test.js.map +0 -1
  34. package/dist/channelSetup.d.ts +0 -44
  35. package/dist/channelSetup.d.ts.map +0 -1
  36. package/dist/channelSetup.js +0 -61
  37. package/dist/channelSetup.js.map +0 -1
  38. package/dist/channelSetup.test.d.ts +0 -2
  39. package/dist/channelSetup.test.d.ts.map +0 -1
  40. package/dist/channelSetup.test.js +0 -75
  41. package/dist/channelSetup.test.js.map +0 -1
@@ -1,164 +1,164 @@
1
- ---
2
- name: deploy-staging
3
- description: Deploy AgentHub to the Contabo staging environment (agenthub.contetial.com) — build the Go server + dashboard, ship them INTO the Dockerized staging container, restart, and verify. Use when asked to deploy/ship/release AgentHub to staging. DESTRUCTIVE — runs real deploy commands against the live staging server.
4
- license: MIT
5
- ---
6
-
7
- # Deploy AgentHub to Staging
8
-
9
- Deploys the AgentHub Go server and React dashboard to the Contabo staging host.
10
- This is a **destructive, outward-facing** operation: it restarts the live
11
- staging service. Run deliberately, verify each step, and stop if anything looks
12
- wrong.
13
-
14
- **Target:** `agenthub.contetial.com` · host `109.123.246.254` · user `root`
15
- **SSH key:** `~/.ssh/contabo_staging`
16
- **Runtime:** Dockerized. Container `krishiai-agenthub`, image
17
- `krishiai-agenthub:staging`. The systemd `agenthub.service` no longer applies.
18
-
19
- ## How this deployment actually works (read first)
20
-
21
- This setup is **not** a host-binary-swap. Verified mechanism:
22
-
23
- - The server binary lives **inside the container** at `/opt/agenthub/agenthub`
24
- (the host's `/opt/agenthub/agenthub` is a stale leftover and is *not* what
25
- runs). The container's filesystem persists across `docker restart`, so you
26
- deploy with `docker cp` into the container, then restart.
27
- - The dashboard is a **Docker named volume** `krishiai_agenthub_dashboard`
28
- mounted at `/opt/agenthub/dashboard` (host path
29
- `/var/lib/docker/volumes/krishiai_agenthub_dashboard/_data/`). You deploy by
30
- writing the SPA build into that volume.
31
- - The DB is the **`krishiai_agenthub_data`** volume mounted at
32
- `/var/lib/agenthub` (`staging.db`). The container runs migrations on boot.
33
-
34
- > ⚠️ **Do NOT overwrite KrishiAI-specific server state.** Specifically:
35
- > - The dashboard volume has a **`docs/` subdir** (platform/intel/org-brain
36
- > guides) and an `uploads/`/`assets/` layout — **never `rsync --delete`** the
37
- > volume or you will wipe them. Add/overwrite files only.
38
- > - **Never touch** the `krishiai_agenthub_data` volume / `staging.db`, the
39
- > container's env (the entrypoint passes Slack/OAuth/DB flags), or the host's
40
- > timestamped `agenthub.pre-*` backups.
41
- > - Don't `docker run`/recreate the container — that drops env + the in-container
42
- > binary. Use `docker restart` only.
43
-
44
- ## 0. Preconditions
45
-
46
- ```bash
47
- cd server && go test ./... && cd ..
48
- cd mcp-server && npm run typecheck && cd ..
49
-
50
- # SSH reachable + container present; confirm the binary is INSIDE the container.
51
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
52
- "docker ps --format '{{.Names}}' | grep krishiai-agenthub && \
53
- docker exec krishiai-agenthub ls -la /opt/agenthub/agenthub"
54
- ```
55
-
56
- If the container isn't named `krishiai-agenthub`, stop and reconcile.
57
-
58
- ## 1. Build the server (Linux binary)
59
-
60
- ```bash
61
- cd server
62
- GOOS=linux GOARCH=amd64 go build -o agenthub-linux ./cmd/agenthub
63
- cd ..
64
- ```
65
-
66
- ## 2. Ship + restart the server (docker cp, not host swap)
67
-
68
- ```bash
69
- TS=$(date +%Y%m%d-%H%M%S)
70
-
71
- # 2a. Snapshot the CURRENT in-container binary to the host (rollback point).
72
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
73
- "docker cp krishiai-agenthub:/opt/agenthub/agenthub /opt/agenthub/agenthub.pre-$TS && \
74
- ls -lh /opt/agenthub/agenthub.pre-$TS"
75
-
76
- # 2b. Upload the new binary to the host, then copy it INTO the container.
77
- scp -i ~/.ssh/contabo_staging server/agenthub-linux \
78
- root@109.123.246.254:/tmp/agenthub-new
79
-
80
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 '
81
- set -e
82
- docker cp /tmp/agenthub-new krishiai-agenthub:/opt/agenthub/agenthub
83
- # docker cp writes as root; the container runs as the agenthub user, so fix
84
- # ownership/perms with an explicit -u 0 exec.
85
- docker exec -u 0 krishiai-agenthub chown agenthub:agenthub /opt/agenthub/agenthub
86
- docker exec -u 0 krishiai-agenthub chmod 755 /opt/agenthub/agenthub
87
- docker restart krishiai-agenthub
88
- rm -f /tmp/agenthub-new
89
- '
90
- ```
91
-
92
- Watch migrations (the binary runs them on boot). `failed=` must be 0:
93
-
94
- ```bash
95
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
96
- "docker logs --tail 120 krishiai-agenthub 2>&1 | grep -E 'migrations complete|failed=|ERROR|panic'"
97
- ```
98
-
99
- `worker WebSocket read error ... close 1006` lines right after restart are just
100
- agents reconnecting — ignore them.
101
-
102
- ## 3. Build + deploy the dashboard (into the volume, preserving docs/)
103
-
104
- ```bash
105
- cd agenthub-dashboard
106
- npm run build
107
- cd ..
108
-
109
- VOL=/var/lib/docker/volumes/krishiai_agenthub_dashboard/_data
110
-
111
- # SPA: overwrite index.html + assets/ ONLY. Do not delete the volume — that
112
- # would remove the docs/ subdir served at /docs/.
113
- scp -i ~/.ssh/contabo_staging agenthub-dashboard/dist/index.html root@109.123.246.254:$VOL/index.html
114
- scp -i ~/.ssh/contabo_staging -r agenthub-dashboard/dist/assets root@109.123.246.254:$VOL/
115
-
116
- # Docs guides (only if you changed them): push into the docs/ subdir.
117
- scp -i ~/.ssh/contabo_staging docs/platform-guide.html docs/intel-layer-guide.html docs/org-brain-guide.html \
118
- root@109.123.246.254:$VOL/docs/ 2>/dev/null || true
119
- ```
120
-
121
- > The repo's `agenthub-dashboard/deploy.sh` rsyncs to the host path
122
- > `/opt/agenthub/dashboard` — that path is **not** what the container serves
123
- > (the volume is). Don't use it as-is; the volume scp above is the live path.
124
-
125
- ## 4. Verify (from the host — external curl may be blocked from your machine)
126
-
127
- ```bash
128
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 '
129
- echo "-- health --"; curl -s --max-time 10 http://127.0.0.1:8787/health; echo
130
- echo "-- config --"; curl -s --max-time 10 http://127.0.0.1:8787/api/config/public; echo
131
- echo "-- metrics --"; curl -s --max-time 10 http://127.0.0.1:8787/metrics | grep -E "^agenthub_capability_" | head
132
- echo "-- nginx https --"; curl -sk --max-time 10 https://localhost/health; echo
133
- '
134
- ```
135
-
136
- Optional DB smoke (catalog + new columns landed):
137
-
138
- ```bash
139
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
140
- "docker exec krishiai-agenthub sqlite3 /var/lib/agenthub/staging.db \
141
- 'SELECT count(*) FROM capabilities WHERE deprecated_at IS NULL;'"
142
- ```
143
-
144
- ## 5. Rollback (if needed)
145
-
146
- ```bash
147
- ssh -i ~/.ssh/contabo_staging root@109.123.246.254 '
148
- set -e
149
- BK=$(ls -t /opt/agenthub/agenthub.pre-* | head -1)
150
- docker cp "$BK" krishiai-agenthub:/opt/agenthub/agenthub
151
- docker exec -u 0 krishiai-agenthub chown agenthub:agenthub /opt/agenthub/agenthub
152
- docker exec -u 0 krishiai-agenthub chmod 755 /opt/agenthub/agenthub
153
- docker restart krishiai-agenthub
154
- '
155
- ```
156
-
157
- Then re-deploy the previous dashboard build (checkout the prior commit, rebuild,
158
- re-run step 3).
159
-
160
- ## Done
161
-
162
- Report: which commit shipped, migration outcome (`applied/failed`), and the
163
- verification results. If anything failed mid-way, say exactly which step and
164
- leave the system in a known state (rolled back or clearly flagged).
1
+ ---
2
+ name: deploy-staging
3
+ description: Deploy AgentHub to the Contabo staging environment (agenthub.contetial.com) — build the Go server + dashboard, ship them INTO the Dockerized staging container, restart, and verify. Use when asked to deploy/ship/release AgentHub to staging. DESTRUCTIVE — runs real deploy commands against the live staging server.
4
+ license: MIT
5
+ ---
6
+
7
+ # Deploy AgentHub to Staging
8
+
9
+ Deploys the AgentHub Go server and React dashboard to the Contabo staging host.
10
+ This is a **destructive, outward-facing** operation: it restarts the live
11
+ staging service. Run deliberately, verify each step, and stop if anything looks
12
+ wrong.
13
+
14
+ **Target:** `agenthub.contetial.com` · host `109.123.246.254` · user `root`
15
+ **SSH key:** `~/.ssh/contabo_staging`
16
+ **Runtime:** Dockerized. Container `krishiai-agenthub`, image
17
+ `krishiai-agenthub:staging`. The systemd `agenthub.service` no longer applies.
18
+
19
+ ## How this deployment actually works (read first)
20
+
21
+ This setup is **not** a host-binary-swap. Verified mechanism:
22
+
23
+ - The server binary lives **inside the container** at `/opt/agenthub/agenthub`
24
+ (the host's `/opt/agenthub/agenthub` is a stale leftover and is *not* what
25
+ runs). The container's filesystem persists across `docker restart`, so you
26
+ deploy with `docker cp` into the container, then restart.
27
+ - The dashboard is a **Docker named volume** `krishiai_agenthub_dashboard`
28
+ mounted at `/opt/agenthub/dashboard` (host path
29
+ `/var/lib/docker/volumes/krishiai_agenthub_dashboard/_data/`). You deploy by
30
+ writing the SPA build into that volume.
31
+ - The DB is the **`krishiai_agenthub_data`** volume mounted at
32
+ `/var/lib/agenthub` (`staging.db`). The container runs migrations on boot.
33
+
34
+ > ⚠️ **Do NOT overwrite KrishiAI-specific server state.** Specifically:
35
+ > - The dashboard volume has a **`docs/` subdir** (platform/intel/org-brain
36
+ > guides) and an `uploads/`/`assets/` layout — **never `rsync --delete`** the
37
+ > volume or you will wipe them. Add/overwrite files only.
38
+ > - **Never touch** the `krishiai_agenthub_data` volume / `staging.db`, the
39
+ > container's env (the entrypoint passes Slack/OAuth/DB flags), or the host's
40
+ > timestamped `agenthub.pre-*` backups.
41
+ > - Don't `docker run`/recreate the container — that drops env + the in-container
42
+ > binary. Use `docker restart` only.
43
+
44
+ ## 0. Preconditions
45
+
46
+ ```bash
47
+ cd server && go test ./... && cd ..
48
+ cd mcp-server && npm run typecheck && cd ..
49
+
50
+ # SSH reachable + container present; confirm the binary is INSIDE the container.
51
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
52
+ "docker ps --format '{{.Names}}' | grep krishiai-agenthub && \
53
+ docker exec krishiai-agenthub ls -la /opt/agenthub/agenthub"
54
+ ```
55
+
56
+ If the container isn't named `krishiai-agenthub`, stop and reconcile.
57
+
58
+ ## 1. Build the server (Linux binary)
59
+
60
+ ```bash
61
+ cd server
62
+ GOOS=linux GOARCH=amd64 go build -o agenthub-linux ./cmd/agenthub
63
+ cd ..
64
+ ```
65
+
66
+ ## 2. Ship + restart the server (docker cp, not host swap)
67
+
68
+ ```bash
69
+ TS=$(date +%Y%m%d-%H%M%S)
70
+
71
+ # 2a. Snapshot the CURRENT in-container binary to the host (rollback point).
72
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
73
+ "docker cp krishiai-agenthub:/opt/agenthub/agenthub /opt/agenthub/agenthub.pre-$TS && \
74
+ ls -lh /opt/agenthub/agenthub.pre-$TS"
75
+
76
+ # 2b. Upload the new binary to the host, then copy it INTO the container.
77
+ scp -i ~/.ssh/contabo_staging server/agenthub-linux \
78
+ root@109.123.246.254:/tmp/agenthub-new
79
+
80
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 '
81
+ set -e
82
+ docker cp /tmp/agenthub-new krishiai-agenthub:/opt/agenthub/agenthub
83
+ # docker cp writes as root; the container runs as the agenthub user, so fix
84
+ # ownership/perms with an explicit -u 0 exec.
85
+ docker exec -u 0 krishiai-agenthub chown agenthub:agenthub /opt/agenthub/agenthub
86
+ docker exec -u 0 krishiai-agenthub chmod 755 /opt/agenthub/agenthub
87
+ docker restart krishiai-agenthub
88
+ rm -f /tmp/agenthub-new
89
+ '
90
+ ```
91
+
92
+ Watch migrations (the binary runs them on boot). `failed=` must be 0:
93
+
94
+ ```bash
95
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
96
+ "docker logs --tail 120 krishiai-agenthub 2>&1 | grep -E 'migrations complete|failed=|ERROR|panic'"
97
+ ```
98
+
99
+ `worker WebSocket read error ... close 1006` lines right after restart are just
100
+ agents reconnecting — ignore them.
101
+
102
+ ## 3. Build + deploy the dashboard (into the volume, preserving docs/)
103
+
104
+ ```bash
105
+ cd agenthub-dashboard
106
+ npm run build
107
+ cd ..
108
+
109
+ VOL=/var/lib/docker/volumes/krishiai_agenthub_dashboard/_data
110
+
111
+ # SPA: overwrite index.html + assets/ ONLY. Do not delete the volume — that
112
+ # would remove the docs/ subdir served at /docs/.
113
+ scp -i ~/.ssh/contabo_staging agenthub-dashboard/dist/index.html root@109.123.246.254:$VOL/index.html
114
+ scp -i ~/.ssh/contabo_staging -r agenthub-dashboard/dist/assets root@109.123.246.254:$VOL/
115
+
116
+ # Docs guides (only if you changed them): push into the docs/ subdir.
117
+ scp -i ~/.ssh/contabo_staging docs/platform-guide.html docs/intel-layer-guide.html docs/org-brain-guide.html \
118
+ root@109.123.246.254:$VOL/docs/ 2>/dev/null || true
119
+ ```
120
+
121
+ > The repo's `agenthub-dashboard/deploy.sh` rsyncs to the host path
122
+ > `/opt/agenthub/dashboard` — that path is **not** what the container serves
123
+ > (the volume is). Don't use it as-is; the volume scp above is the live path.
124
+
125
+ ## 4. Verify (from the host — external curl may be blocked from your machine)
126
+
127
+ ```bash
128
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 '
129
+ echo "-- health --"; curl -s --max-time 10 http://127.0.0.1:8787/health; echo
130
+ echo "-- config --"; curl -s --max-time 10 http://127.0.0.1:8787/api/config/public; echo
131
+ echo "-- metrics --"; curl -s --max-time 10 http://127.0.0.1:8787/metrics | grep -E "^agenthub_capability_" | head
132
+ echo "-- nginx https --"; curl -sk --max-time 10 https://localhost/health; echo
133
+ '
134
+ ```
135
+
136
+ Optional DB smoke (catalog + new columns landed):
137
+
138
+ ```bash
139
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 \
140
+ "docker exec krishiai-agenthub sqlite3 /var/lib/agenthub/staging.db \
141
+ 'SELECT count(*) FROM capabilities WHERE deprecated_at IS NULL;'"
142
+ ```
143
+
144
+ ## 5. Rollback (if needed)
145
+
146
+ ```bash
147
+ ssh -i ~/.ssh/contabo_staging root@109.123.246.254 '
148
+ set -e
149
+ BK=$(ls -t /opt/agenthub/agenthub.pre-* | head -1)
150
+ docker cp "$BK" krishiai-agenthub:/opt/agenthub/agenthub
151
+ docker exec -u 0 krishiai-agenthub chown agenthub:agenthub /opt/agenthub/agenthub
152
+ docker exec -u 0 krishiai-agenthub chmod 755 /opt/agenthub/agenthub
153
+ docker restart krishiai-agenthub
154
+ '
155
+ ```
156
+
157
+ Then re-deploy the previous dashboard build (checkout the prior commit, rebuild,
158
+ re-run step 3).
159
+
160
+ ## Done
161
+
162
+ Report: which commit shipped, migration outcome (`applied/failed`), and the
163
+ verification results. If anything failed mid-way, say exactly which step and
164
+ leave the system in a known state (rolled back or clearly flagged).
@@ -1,97 +1,97 @@
1
- ---
2
- name: deploy-vps-openclaw
3
- description: Deploy the AgentHub meta-agent OpenClaw plugin to the Hetzner VPS — build the plugin, ship it to /root/.openclaw/extensions, restart the OpenClaw gateway, and verify. Use when asked to deploy/ship the meta-agent or OpenClaw plugin. DESTRUCTIVE — restarts the live gateway on the VPS.
4
- license: MIT
5
- ---
6
-
7
- # Deploy the OpenClaw Meta-Agent to the Hetzner VPS
8
-
9
- Deploys the AgentHub meta-agent plugin to the OpenClaw gateway on the Hetzner
10
- VPS. This is a **destructive, outward-facing** operation: it restarts the live
11
- gateway, which briefly drops the meta-agent's monitoring + Slack reporting. Run
12
- deliberately and verify.
13
-
14
- **Target:** Hetzner VPS `178.104.62.122` · user `root`
15
- **SSH key:** `~/.ssh/id_openclaw`
16
- **Plugin dir:** `/root/.openclaw/extensions/agenthub-meta-agent`
17
- **State file:** `/root/.openclaw/state/meta-agent.json` (persists the connect
18
- token; survives restarts so the gateway reconnects instead of 409-deadlocking).
19
-
20
- > Authoritative script this runbook drives: `meta-agent/scripts/deploy-meta-agent.sh`.
21
- > Prefer running that script directly; the manual steps below mirror it for when
22
- > you need to deploy step-by-step or the script is unavailable.
23
-
24
- ## 0. Ordering — server first, plugin second
25
-
26
- If this release also includes an AgentHub **server** change, deploy the server
27
- first (see the `deploy-staging` skill). The plugin's 409 fallback calls
28
- `POST /api/agents/{id}/replace_token`, which must exist server-side. A plugin
29
- against an older server degrades to manual recovery rather than failing hard,
30
- but the design assumes the endpoint is present.
31
-
32
- ## 1. Deploy via the maintained script (preferred)
33
-
34
- ```bash
35
- cd meta-agent
36
- ./scripts/deploy-meta-agent.sh
37
- ```
38
-
39
- That script builds the plugin (`npm run build`), uploads
40
- `openclaw.plugin.json`, `package.json`, and `dist/` to the plugin dir, restarts
41
- `openclaw-gateway`, and prints whether the service came back active.
42
-
43
- ## 2. Manual steps (if running step-by-step)
44
-
45
- ```bash
46
- cd meta-agent
47
- npm run build
48
-
49
- VPS=root@178.104.62.122
50
- KEY=~/.ssh/id_openclaw
51
- DIR=/root/.openclaw/extensions/agenthub-meta-agent
52
-
53
- ssh -i $KEY $VPS "mkdir -p $DIR/dist/src"
54
- scp -i $KEY openclaw.plugin.json package.json $VPS:$DIR/
55
- scp -i $KEY dist/index.js $VPS:$DIR/dist/
56
- scp -i $KEY dist/index.js.map $VPS:$DIR/dist/ 2>/dev/null || true
57
- scp -i $KEY -r dist/src/ $VPS:$DIR/dist/src/
58
-
59
- ssh -i $KEY $VPS "systemctl restart openclaw-gateway"
60
- ```
61
-
62
- ## 3. Verify
63
-
64
- ```bash
65
- KEY=~/.ssh/id_openclaw; VPS=root@178.104.62.122
66
- # Gateway is active.
67
- ssh -i $KEY $VPS "systemctl is-active openclaw-gateway"
68
- # Plugin reconnected (look for the lifecycle-path line).
69
- ssh -i $KEY $VPS "journalctl -u openclaw-gateway -n 60 --no-pager | grep -iE 'meta-agent|lifecycle-path|reconnect'"
70
- ```
71
-
72
- Expected lifecycle path on a healthy restart: `reconnect-from-disk` (it read the
73
- persisted connect token). `register-fresh` or `409-replace-token` are also
74
- valid; a stuck `409` deadlock means the state file was lost — see the recovery
75
- runbook in `docs/meta-agent.md`.
76
-
77
- Confirm in AgentHub that `meta-agent` is online (dashboard agents list) and
78
- that it resumes posting to `#agenthub-digest` / `#agenthub-alerts` on schedule.
79
-
80
- ## 4. Rollback (if needed)
81
-
82
- Redeploy the previous build:
83
-
84
- ```bash
85
- cd meta-agent && git checkout <previous-commit> -- . && npm run build && ./scripts/deploy-meta-agent.sh
86
- ```
87
-
88
- If the gateway won't come back, check `journalctl -u openclaw-gateway` for plugin
89
- load errors and, if needed, disable the plugin (`enabled: false` in
90
- `openclaw.json` under `plugins.entries.agenthub-meta-agent`) then restart to
91
- restore the gateway without the meta-agent.
92
-
93
- ## Done
94
-
95
- Report: which commit shipped, the lifecycle-path line from the logs, gateway
96
- active state, and whether the meta-agent re-appears online in AgentHub. If the
97
- restart failed, say so and leave the gateway in a known state.
1
+ ---
2
+ name: deploy-vps-openclaw
3
+ description: Deploy the AgentHub meta-agent OpenClaw plugin to the Hetzner VPS — build the plugin, ship it to /root/.openclaw/extensions, restart the OpenClaw gateway, and verify. Use when asked to deploy/ship the meta-agent or OpenClaw plugin. DESTRUCTIVE — restarts the live gateway on the VPS.
4
+ license: MIT
5
+ ---
6
+
7
+ # Deploy the OpenClaw Meta-Agent to the Hetzner VPS
8
+
9
+ Deploys the AgentHub meta-agent plugin to the OpenClaw gateway on the Hetzner
10
+ VPS. This is a **destructive, outward-facing** operation: it restarts the live
11
+ gateway, which briefly drops the meta-agent's monitoring + Slack reporting. Run
12
+ deliberately and verify.
13
+
14
+ **Target:** Hetzner VPS `178.104.62.122` · user `root`
15
+ **SSH key:** `~/.ssh/id_openclaw`
16
+ **Plugin dir:** `/root/.openclaw/extensions/agenthub-meta-agent`
17
+ **State file:** `/root/.openclaw/state/meta-agent.json` (persists the connect
18
+ token; survives restarts so the gateway reconnects instead of 409-deadlocking).
19
+
20
+ > Authoritative script this runbook drives: `meta-agent/scripts/deploy-meta-agent.sh`.
21
+ > Prefer running that script directly; the manual steps below mirror it for when
22
+ > you need to deploy step-by-step or the script is unavailable.
23
+
24
+ ## 0. Ordering — server first, plugin second
25
+
26
+ If this release also includes an AgentHub **server** change, deploy the server
27
+ first (see the `deploy-staging` skill). The plugin's 409 fallback calls
28
+ `POST /api/agents/{id}/replace_token`, which must exist server-side. A plugin
29
+ against an older server degrades to manual recovery rather than failing hard,
30
+ but the design assumes the endpoint is present.
31
+
32
+ ## 1. Deploy via the maintained script (preferred)
33
+
34
+ ```bash
35
+ cd meta-agent
36
+ ./scripts/deploy-meta-agent.sh
37
+ ```
38
+
39
+ That script builds the plugin (`npm run build`), uploads
40
+ `openclaw.plugin.json`, `package.json`, and `dist/` to the plugin dir, restarts
41
+ `openclaw-gateway`, and prints whether the service came back active.
42
+
43
+ ## 2. Manual steps (if running step-by-step)
44
+
45
+ ```bash
46
+ cd meta-agent
47
+ npm run build
48
+
49
+ VPS=root@178.104.62.122
50
+ KEY=~/.ssh/id_openclaw
51
+ DIR=/root/.openclaw/extensions/agenthub-meta-agent
52
+
53
+ ssh -i $KEY $VPS "mkdir -p $DIR/dist/src"
54
+ scp -i $KEY openclaw.plugin.json package.json $VPS:$DIR/
55
+ scp -i $KEY dist/index.js $VPS:$DIR/dist/
56
+ scp -i $KEY dist/index.js.map $VPS:$DIR/dist/ 2>/dev/null || true
57
+ scp -i $KEY -r dist/src/ $VPS:$DIR/dist/src/
58
+
59
+ ssh -i $KEY $VPS "systemctl restart openclaw-gateway"
60
+ ```
61
+
62
+ ## 3. Verify
63
+
64
+ ```bash
65
+ KEY=~/.ssh/id_openclaw; VPS=root@178.104.62.122
66
+ # Gateway is active.
67
+ ssh -i $KEY $VPS "systemctl is-active openclaw-gateway"
68
+ # Plugin reconnected (look for the lifecycle-path line).
69
+ ssh -i $KEY $VPS "journalctl -u openclaw-gateway -n 60 --no-pager | grep -iE 'meta-agent|lifecycle-path|reconnect'"
70
+ ```
71
+
72
+ Expected lifecycle path on a healthy restart: `reconnect-from-disk` (it read the
73
+ persisted connect token). `register-fresh` or `409-replace-token` are also
74
+ valid; a stuck `409` deadlock means the state file was lost — see the recovery
75
+ runbook in `docs/meta-agent.md`.
76
+
77
+ Confirm in AgentHub that `meta-agent` is online (dashboard agents list) and
78
+ that it resumes posting to `#agenthub-digest` / `#agenthub-alerts` on schedule.
79
+
80
+ ## 4. Rollback (if needed)
81
+
82
+ Redeploy the previous build:
83
+
84
+ ```bash
85
+ cd meta-agent && git checkout <previous-commit> -- . && npm run build && ./scripts/deploy-meta-agent.sh
86
+ ```
87
+
88
+ If the gateway won't come back, check `journalctl -u openclaw-gateway` for plugin
89
+ load errors and, if needed, disable the plugin (`enabled: false` in
90
+ `openclaw.json` under `plugins.entries.agenthub-meta-agent`) then restart to
91
+ restore the gateway without the meta-agent.
92
+
93
+ ## Done
94
+
95
+ Report: which commit shipped, the lifecycle-path line from the logs, gateway
96
+ active state, and whether the meta-agent re-appears online in AgentHub. If the
97
+ restart failed, say so and leave the gateway in a known state.
@@ -1,67 +1,67 @@
1
- ---
2
- name: karpathy-guidelines
3
- description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
4
- license: MIT
5
- ---
6
-
7
- # Karpathy Guidelines
8
-
9
- Behavioral guidelines to reduce common LLM coding mistakes, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls.
10
-
11
- **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
12
-
13
- ## 1. Think Before Coding
14
-
15
- **Don't assume. Don't hide confusion. Surface tradeoffs.**
16
-
17
- Before implementing:
18
- - State your assumptions explicitly. If uncertain, ask.
19
- - If multiple interpretations exist, present them - don't pick silently.
20
- - If a simpler approach exists, say so. Push back when warranted.
21
- - If something is unclear, stop. Name what's confusing. Ask.
22
-
23
- ## 2. Simplicity First
24
-
25
- **Minimum code that solves the problem. Nothing speculative.**
26
-
27
- - No features beyond what was asked.
28
- - No abstractions for single-use code.
29
- - No "flexibility" or "configurability" that wasn't requested.
30
- - No error handling for impossible scenarios.
31
- - If you write 200 lines and it could be 50, rewrite it.
32
-
33
- Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
34
-
35
- ## 3. Surgical Changes
36
-
37
- **Touch only what you must. Clean up only your own mess.**
38
-
39
- When editing existing code:
40
- - Don't "improve" adjacent code, comments, or formatting.
41
- - Don't refactor things that aren't broken.
42
- - Match existing style, even if you'd do it differently.
43
- - If you notice unrelated dead code, mention it - don't delete it.
44
-
45
- When your changes create orphans:
46
- - Remove imports/variables/functions that YOUR changes made unused.
47
- - Don't remove pre-existing dead code unless asked.
48
-
49
- The test: Every changed line should trace directly to the user's request.
50
-
51
- ## 4. Goal-Driven Execution
52
-
53
- **Define success criteria. Loop until verified.**
54
-
55
- Transform tasks into verifiable goals:
56
- - "Add validation" → "Write tests for invalid inputs, then make them pass"
57
- - "Fix the bug" → "Write a test that reproduces it, then make it pass"
58
- - "Refactor X" → "Ensure tests pass before and after"
59
-
60
- For multi-step tasks, state a brief plan:
61
- ```
62
- 1. [Step] → verify: [check]
63
- 2. [Step] → verify: [check]
64
- 3. [Step] → verify: [check]
65
- ```
66
-
67
- Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
1
+ ---
2
+ name: karpathy-guidelines
3
+ description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
4
+ license: MIT
5
+ ---
6
+
7
+ # Karpathy Guidelines
8
+
9
+ Behavioral guidelines to reduce common LLM coding mistakes, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls.
10
+
11
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
12
+
13
+ ## 1. Think Before Coding
14
+
15
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
16
+
17
+ Before implementing:
18
+ - State your assumptions explicitly. If uncertain, ask.
19
+ - If multiple interpretations exist, present them - don't pick silently.
20
+ - If a simpler approach exists, say so. Push back when warranted.
21
+ - If something is unclear, stop. Name what's confusing. Ask.
22
+
23
+ ## 2. Simplicity First
24
+
25
+ **Minimum code that solves the problem. Nothing speculative.**
26
+
27
+ - No features beyond what was asked.
28
+ - No abstractions for single-use code.
29
+ - No "flexibility" or "configurability" that wasn't requested.
30
+ - No error handling for impossible scenarios.
31
+ - If you write 200 lines and it could be 50, rewrite it.
32
+
33
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
34
+
35
+ ## 3. Surgical Changes
36
+
37
+ **Touch only what you must. Clean up only your own mess.**
38
+
39
+ When editing existing code:
40
+ - Don't "improve" adjacent code, comments, or formatting.
41
+ - Don't refactor things that aren't broken.
42
+ - Match existing style, even if you'd do it differently.
43
+ - If you notice unrelated dead code, mention it - don't delete it.
44
+
45
+ When your changes create orphans:
46
+ - Remove imports/variables/functions that YOUR changes made unused.
47
+ - Don't remove pre-existing dead code unless asked.
48
+
49
+ The test: Every changed line should trace directly to the user's request.
50
+
51
+ ## 4. Goal-Driven Execution
52
+
53
+ **Define success criteria. Loop until verified.**
54
+
55
+ Transform tasks into verifiable goals:
56
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
57
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
58
+ - "Refactor X" → "Ensure tests pass before and after"
59
+
60
+ For multi-step tasks, state a brief plan:
61
+ ```
62
+ 1. [Step] → verify: [check]
63
+ 2. [Step] → verify: [check]
64
+ 3. [Step] → verify: [check]
65
+ ```
66
+
67
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.