feat(phase5): polish + deployment

- skill/SKILL.md: rewritten to 9 lines — 'status is automatic'
- deploy-to-agents.sh: no AGENTS.md injection; deploys hook + npm install
- install.sh: clean install flow; prints required env vars
- deploy/status-watcher.service: systemd unit file
- deploy/Dockerfile: containerized deployment (node:22-alpine)
- src/live-status.js: deprecation warning + start-watcher/stop-watcher pass-through
- README.md: full docs (architecture, install, config, upgrade guide, troubleshooting)
- make check: 0 errors, 0 format issues
- npm test: 59 unit + 36 integration = 95 tests passing
This commit is contained in:
sol
2026-03-07 17:45:22 +00:00
parent 5bb36150c4
commit 835faa0eab
7 changed files with 476 additions and 160 deletions

53
deploy-to-agents.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
# deploy-to-agents.sh — Deploy Live Status v4 to OpenClaw workspace
#
# Deploys the gateway:startup hook and installs npm dependencies.
# Does NOT inject anything into AGENTS.md.
# The watcher daemon auto-starts on next gateway restart.
#
# Usage: bash deploy-to-agents.sh [--workspace DIR]
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE="${WORKSPACE:-/home/node/.openclaw/workspace}"
# Parse flags
while [[ "$#" -gt 0 ]]; do
case "$1" in
--workspace) WORKSPACE="$2"; shift 2 ;;
*) shift ;;
esac
done
echo "==================================="
echo " Live Status v4 Deploy"
echo "==================================="
echo "Workspace: $WORKSPACE"
echo ""
# 1. npm install
echo "[1/2] Installing npm dependencies..."
cd "$SCRIPT_DIR"
npm install --production
echo " Done."
# 2. Deploy hook
echo "[2/2] Deploying gateway:startup hook..."
HOOKS_DIR="$WORKSPACE/hooks"
mkdir -p "$HOOKS_DIR/status-watcher-hook"
cp -r "$SCRIPT_DIR/hooks/status-watcher-hook/." "$HOOKS_DIR/status-watcher-hook/"
echo " Hook deployed to: $HOOKS_DIR/status-watcher-hook/"
echo ""
echo "==================================="
echo " Deployment Complete"
echo "==================================="
echo ""
echo "The watcher will auto-start on next gateway startup."
echo ""
echo "To activate immediately, ensure these env vars are set, then run:"
echo " node $SCRIPT_DIR/src/watcher-manager.js start"
echo ""
echo "Required env vars: MM_TOKEN, MM_URL, TRANSCRIPT_DIR, SESSIONS_JSON"
echo "See install.sh for full config reference."