feat(config): add hot-reload config + listMode (human-list/agent-list)
This commit is contained in:
@@ -14,7 +14,9 @@ NO_REPLY_PROVIDER_ID="${NO_REPLY_PROVIDER_ID:-whisper-gateway}"
|
||||
NO_REPLY_MODEL_ID="${NO_REPLY_MODEL_ID:-no-reply}"
|
||||
NO_REPLY_BASE_URL="${NO_REPLY_BASE_URL:-http://127.0.0.1:8787/v1}"
|
||||
NO_REPLY_API_KEY="${NO_REPLY_API_KEY:-wg-local-test-token}"
|
||||
BYPASS_USER_IDS_JSON="${BYPASS_USER_IDS_JSON:-[\"561921120408698910\",\"1474088632750047324\"]}"
|
||||
LIST_MODE="${LIST_MODE:-human-list}"
|
||||
HUMAN_LIST_JSON="${HUMAN_LIST_JSON:-[\"561921120408698910\",\"1474088632750047324\"]}"
|
||||
AGENT_LIST_JSON="${AGENT_LIST_JSON:-[]}"
|
||||
END_SYMBOLS_JSON="${END_SYMBOLS_JSON:-[\"🔚\"]}"
|
||||
|
||||
STATE_DIR="${STATE_DIR:-$HOME/.openclaw/whispergate-install-records}"
|
||||
@@ -136,7 +138,7 @@ PY
|
||||
current_plugins_json='{}'
|
||||
fi
|
||||
|
||||
new_plugins_json="$(CURRENT_PLUGINS_JSON="$current_plugins_json" PLUGIN_PATH="$PLUGIN_PATH" BYPASS_USER_IDS_JSON="$BYPASS_USER_IDS_JSON" END_SYMBOLS_JSON="$END_SYMBOLS_JSON" NO_REPLY_PROVIDER_ID="$NO_REPLY_PROVIDER_ID" NO_REPLY_MODEL_ID="$NO_REPLY_MODEL_ID" python3 - <<'PY'
|
||||
new_plugins_json="$(CURRENT_PLUGINS_JSON="$current_plugins_json" PLUGIN_PATH="$PLUGIN_PATH" LIST_MODE="$LIST_MODE" HUMAN_LIST_JSON="$HUMAN_LIST_JSON" AGENT_LIST_JSON="$AGENT_LIST_JSON" END_SYMBOLS_JSON="$END_SYMBOLS_JSON" NO_REPLY_PROVIDER_ID="$NO_REPLY_PROVIDER_ID" NO_REPLY_MODEL_ID="$NO_REPLY_MODEL_ID" python3 - <<'PY'
|
||||
import json, os
|
||||
plugins=json.loads(os.environ['CURRENT_PLUGINS_JSON'])
|
||||
if not isinstance(plugins,dict):
|
||||
@@ -157,7 +159,9 @@ entries['whispergate']={
|
||||
'config': {
|
||||
'enabled': True,
|
||||
'discordOnly': True,
|
||||
'bypassUserIds': json.loads(os.environ['BYPASS_USER_IDS_JSON']),
|
||||
'listMode': os.environ['LIST_MODE'],
|
||||
'humanList': json.loads(os.environ['HUMAN_LIST_JSON']),
|
||||
'agentList': json.loads(os.environ['AGENT_LIST_JSON']),
|
||||
'endSymbols': json.loads(os.environ['END_SYMBOLS_JSON']),
|
||||
'noReplyProvider': os.environ['NO_REPLY_PROVIDER_ID'],
|
||||
'noReplyModel': os.environ['NO_REPLY_MODEL_ID'],
|
||||
|
||||
Reference in New Issue
Block a user