From 1acaebf73ffdbe25d7886ba1dd3cf06eb0ee4b0a Mon Sep 17 00:00:00 2001 From: orion Date: Wed, 25 Feb 2026 13:47:00 +0000 Subject: [PATCH] feat(dev): add no-touch OpenClaw config renderer and integration guide --- Makefile | 8 ++++++- docs/INTEGRATION.md | 34 ++++++++++++++++++++++++++++++ scripts/render-openclaw-config.mjs | 25 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 docs/INTEGRATION.md create mode 100644 scripts/render-openclaw-config.mjs diff --git a/Makefile b/Makefile index 437f721..de263ab 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: check check-rules up down smoke +.PHONY: check check-rules test-api up down smoke render-config check: cd plugin && npm run check @@ -6,6 +6,9 @@ check: check-rules: node scripts/validate-rules.mjs +test-api: + node scripts/test-no-reply-api.mjs + up: ./scripts/dev-up.sh @@ -14,3 +17,6 @@ down: smoke: ./scripts/smoke-no-reply-api.sh + +render-config: + node scripts/render-openclaw-config.mjs diff --git a/docs/INTEGRATION.md b/docs/INTEGRATION.md new file mode 100644 index 0000000..8bc5a18 --- /dev/null +++ b/docs/INTEGRATION.md @@ -0,0 +1,34 @@ +# WhisperGate Integration (No-touch Template) + +This guide **does not** change your current OpenClaw config automatically. +It only generates a JSON snippet you can review. + +## Generate config snippet + +```bash +node scripts/render-openclaw-config.mjs \ + /absolute/path/to/WhisperGate/plugin \ + openai \ + whispergate-no-reply-v1 \ + 561921120408698910 +``` + +Arguments: +1. plugin path +2. provider alias +3. model name +4. bypass user ids (comma-separated, optional) + +## Output + +The script prints JSON for: +- `plugins.load.paths` +- `plugins.entries.whispergate.config` + +You can merge this snippet manually into your `openclaw.json`. + +## Notes + +- This repo does not run config mutation commands. +- Keep no-reply API bound to loopback/private network. +- If you use API auth, set `AUTH_TOKEN` and align provider apiKey usage. diff --git a/scripts/render-openclaw-config.mjs b/scripts/render-openclaw-config.mjs new file mode 100644 index 0000000..9a50eb5 --- /dev/null +++ b/scripts/render-openclaw-config.mjs @@ -0,0 +1,25 @@ +const pluginPath = process.argv[2] || "/opt/WhisperGate/plugin"; +const provider = process.argv[3] || "openai"; +const model = process.argv[4] || "whispergate-no-reply-v1"; +const bypass = (process.argv[5] || "").split(",").filter(Boolean); + +const payload = { + plugins: { + load: { paths: [pluginPath] }, + entries: { + whispergate: { + enabled: true, + config: { + enabled: true, + discordOnly: true, + bypassUserIds: bypass, + endSymbols: ["。", "!", "?", ".", "!", "?"], + noReplyProvider: provider, + noReplyModel: model, + }, + }, + }, + }, +}; + +console.log(JSON.stringify(payload, null, 2));