refactor: new design — sidecar services, moderator Gateway client, tool execute API

- Replace standalone no-reply-api Docker service with unified sidecar (services/main.mjs)
  that routes /no-reply/* and /moderator/* and starts/stops with openclaw-gateway
- Add moderator Discord Gateway client (services/moderator/index.mjs) for real-time
  MESSAGE_CREATE push instead of polling; notifies plugin via HTTP callback
- Add plugin HTTP routes (plugin/web/dirigent-api.ts) for moderator → plugin callbacks
  (wake-from-dormant, interrupt tail-match)
- Fix tool registration format: AgentTool requires execute: not handler:; factory form
  for tools needing ctx
- Rename no-reply-process.ts → sidecar-process.ts, startNoReplyApi → startSideCar
- Remove dead config fields from openclaw.plugin.json (humanList, agentList, listMode,
  channelPoliciesFile, endSymbols, waitIdentifier, multiMessage*, bypassUserIds, etc.)
- Rename noReplyPort → sideCarPort
- Remove docker-compose.yml, dev-up/down scripts, package-plugin.mjs, test-no-reply-api.mjs
- Update install.mjs: clean dist before build, copy services/, drop dead config writes
- Update README, Makefile, smoke script for new architecture

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
h z
2026-04-10 08:07:59 +01:00
parent d8ac9ee0f9
commit 32dc9a4233
28 changed files with 1310 additions and 900 deletions

View File

@@ -1,32 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${BASE_URL:-http://127.0.0.1:8787}"
AUTH_TOKEN="${AUTH_TOKEN:-}"
AUTH_HEADER=()
if [[ -n "$AUTH_TOKEN" ]]; then
AUTH_HEADER=(-H "Authorization: Bearer ${AUTH_TOKEN}")
fi
# Smoke-tests the no-reply API endpoint exposed by the sidecar service.
# The sidecar must already be running (it starts automatically with openclaw-gateway).
# Default base URL matches the sidecar's no-reply prefix.
BASE_URL="${BASE_URL:-http://127.0.0.1:8787/no-reply}"
echo "[1] health"
curl -sS "${BASE_URL}/health" | sed -n '1,3p'
curl -fsS "${BASE_URL}/health"
echo ""
echo "[2] models"
curl -sS "${BASE_URL}/v1/models" "${AUTH_HEADER[@]}" | sed -n '1,8p'
curl -fsS "${BASE_URL}/v1/models" | head -c 200
echo ""
echo "[3] chat/completions"
curl -sS -X POST "${BASE_URL}/v1/chat/completions" \
curl -fsS -X POST "${BASE_URL}/v1/chat/completions" \
-H 'Content-Type: application/json' \
"${AUTH_HEADER[@]}" \
-d '{"model":"dirigent-no-reply-v1","messages":[{"role":"user","content":"hello"}]}' \
| sed -n '1,20p'
-d '{"model":"no-reply","messages":[{"role":"user","content":"hello"}]}' \
| head -c 300
echo ""
echo "[4] responses"
curl -sS -X POST "${BASE_URL}/v1/responses" \
curl -fsS -X POST "${BASE_URL}/v1/responses" \
-H 'Content-Type: application/json' \
"${AUTH_HEADER[@]}" \
-d '{"model":"dirigent-no-reply-v1","input":"hello"}' \
| sed -n '1,20p'
-d '{"model":"no-reply","input":"hello"}' \
| head -c 300
echo ""
echo "smoke ok"