case "$CHANNEL" in
telegram | discord) ;;
*) echo"OPENCLAW_NPM_ONBOARD_CHANNEL must be telegram or discord, got: $CHANNEL" >&='color: green'>2
exit 1
;;
esac
prepare_package_tgz() { if [ -n "$PACKAGE_TGZ" ]; then if [ ! -f "$PACKAGE_TGZ" ]; then echo"OPENCLAW_NPM_ONBOARD_PACKAGE_TGZ does not exist: $PACKAGE_TGZ" >&2
exit 1 fi
PACKAGE_TGZ="$(cd "$(dirname "$PACKAGE_TGZ")" && pwd)/$(basename "$PACKAGE_TGZ")"
return 0 fi
if [ "$HOST_BUILD" != "0" ]; then echo"Building host package artifacts..."
run_logged npm-onboard-channel-agent-host-build pnpm build else echo"Skipping host build (OPENCLAW_NPM_ONBOARD_HOST_BUILD=0)" fi
command -v openclaw >/dev/null
package_root="$(npm root -g)/openclaw"
test -d "$package_root/dist/extensions/telegram"
test -d "$package_root/dist/extensions/discord"
assert_dep_absent() {
local sentinel="$1" if find "$package_root""$HOME/.openclaw" -path "*/node_modules/$sentinel/package.json" -print -quit 2>/dev/null | grep -q .; then echo"$sentinel should not be installed before channel activation repair" >&2
find "$package_root""$HOME/.openclaw" -path "*/node_modules/$sentinel/package.json"-print 2>/dev/null >&2 || true
exit 1 fi
}
assert_dep_present() {
local sentinel="$1" if ! find "$package_root""$HOME/.openclaw" -path "*/node_modules/$sentinel/package.json" -print -quit 2>/dev/null | grep -q .; then echo"$sentinel was not installed on demand" >&2
find "$package_root""$HOME/.openclaw" -maxdepth 6 -type d -name node_modules -print 2>/dev/null >&2 || true
exit 1 fi
}
MOCK_PORT="$MOCK_PORT" SUCCESS_MARKER="$SUCCESS_MARKER" MOCK_REQUEST_LOG="$MOCK_REQUEST_LOG" node scripts/e2e/mock-openai-server.mjs >/tmp/openclaw-mock-openai.log 2>&n style='color: green'>1 &
mock_pid="$!" for _ in $(seq 180); do if node -e "fetch('http://127.0.0.1:${MOCK_PORT}/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"; then
break fi
sleep 0.1 done
node -e "fetch('http://127.0.0.1:${MOCK_PORT}/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
if (!fs.existsSync(configPath)) {
throw new Error("onboard did not write openclaw.json");
} if (!fs.existsSync(agentDir)) {
throw new Error("onboard did not create main agent dir");
} if (!fs.existsSync(authPath)) {
throw new Error("onboard did not create auth-profiles.json");
}
const authRaw = fs.readFileSync(authPath, "utf8"); if (!authRaw.includes("OPENAI_API_KEY")) {
throw new Error("auth profile did not persist OPENAI_API_KEY env ref");
} if (authRaw.includes("sk-openclaw-npm-onboard-e2e")) {
throw new Error("auth profile persisted the raw OpenAI test key");
}
NODE
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.