





















@@ -590,8 +590,10 @@ export OPENCLAW_NO_ONBOARD=1
590590export OPENCLAW_PLUGIN_STAGE_DIR="$HOME/.openclaw/plugin-runtime-deps"
591591mkdir -p "$OPENCLAW_PLUGIN_STAGE_DIR"
592592593-CHANNEL="feishu"
594-DEP_SENTINEL="@larksuiteoapi/node-sdk"
593+declare -A SETUP_ENTRY_DEP_SENTINELS=(
594+ [feishu]="@larksuiteoapi/node-sdk"
595+ [whatsapp]="@whiskeysockets/baileys"
596+)
595597596598package_root() {
597599 printf "%s/openclaw" "$(npm root -g)"
@@ -602,18 +604,21 @@ package_tgz="${OPENCLAW_CURRENT_PACKAGE_TGZ:?missing OPENCLAW_CURRENT_PACKAGE_TG
602604npm install -g "$package_tgz" --no-fund --no-audit >/tmp/openclaw-setup-entry-install.log 2>&1
603605604606root="$(package_root)"
605-test -d "$root/dist/extensions/$CHANNEL"
606-if [ -d "$root/dist/extensions/$CHANNEL/node_modules" ]; then
607- echo "$CHANNEL runtime deps should not be preinstalled in package" >&2
608- find "$root/dist/extensions/$CHANNEL/node_modules" -maxdepth 3 -type f | head -40 >&2 || true
609- exit 1
610-fi
611-if [ -f "$root/node_modules/$DEP_SENTINEL/package.json" ]; then
612- echo "$DEP_SENTINEL should not be installed at package root before setup-entry load" >&2
613- exit 1
614-fi
607+for channel in "${!SETUP_ENTRY_DEP_SENTINELS[@]}"; do
608+ dep_sentinel="${SETUP_ENTRY_DEP_SENTINELS[$channel]}"
609+ test -d "$root/dist/extensions/$channel"
610+ if [ -d "$root/dist/extensions/$channel/node_modules" ]; then
611+ echo "$channel runtime deps should not be preinstalled in package" >&2
612+ find "$root/dist/extensions/$channel/node_modules" -maxdepth 3 -type f | head -40 >&2 || true
613+ exit 1
614+ fi
615+ if [ -f "$root/node_modules/$dep_sentinel/package.json" ]; then
616+ echo "$dep_sentinel should not be installed at package root before setup-entry load" >&2
617+ exit 1
618+ fi
619+done
615620616-echo "Probing real Feishu bundled setup entry before channel configuration..."
621+echo "Probing real bundled setup entries before channel configuration..."
617622(
618623 cd "$root"
619624 node --input-type=module - <<'NODE'
@@ -638,22 +643,33 @@ const setupPluginLoader = Object.values(bundled).find(
638643if (!setupPluginLoader) {
639644 throw new Error("missing packaged getBundledChannelSetupPlugin export");
640645}
641-const plugin = setupPluginLoader("feishu");
642-console.log(plugin ? "Feishu setup plugin loaded pre-config" : "Feishu setup plugin deferred pre-config");
646+for (const channel of ["feishu", "whatsapp"]) {
647+ const plugin = setupPluginLoader(channel);
648+ if (!plugin) {
649+ throw new Error(`${channel} setup plugin did not load pre-config`);
650+ }
651+ if (plugin.id !== channel) {
652+ throw new Error(`${channel} setup plugin id mismatch: ${plugin.id}`);
653+ }
654+ console.log(`${channel} setup plugin loaded pre-config`);
655+}
643656NODE
644657)
645658646-if [ -e "$root/dist/extensions/$CHANNEL/node_modules/$DEP_SENTINEL/package.json" ]; then
647- echo "setup-entry discovery installed deps into bundled plugin tree before channel configuration" >&2
648- exit 1
649-fi
650-if find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -path "*/node_modules/$DEP_SENTINEL/package.json" -type f | grep -q .; then
651- echo "setup-entry discovery installed external staged deps before channel configuration" >&2
652- find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -type f | sort | head -160 >&2 || true
653- exit 1
654-fi
659+for channel in "${!SETUP_ENTRY_DEP_SENTINELS[@]}"; do
660+ dep_sentinel="${SETUP_ENTRY_DEP_SENTINELS[$channel]}"
661+ if [ -e "$root/dist/extensions/$channel/node_modules/$dep_sentinel/package.json" ]; then
662+ echo "setup-entry discovery installed $channel deps into bundled plugin tree before channel configuration" >&2
663+ exit 1
664+ fi
665+ if find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -path "*/node_modules/$dep_sentinel/package.json" -type f | grep -q .; then
666+ echo "setup-entry discovery installed $channel external staged deps before channel configuration" >&2
667+ find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -type f | sort | head -160 >&2 || true
668+ exit 1
669+ fi
670+done
655671656-echo "Configuring Feishu; doctor should now install bundled runtime deps externally..."
672+echo "Configuring setup-entry channels; doctor should now install bundled runtime deps externally..."
657673node - <<'NODE'
658674const fs = require("node:fs");
659675const path = require("node:path");
@@ -674,23 +690,30 @@ config.channels = {
674690 ...(config.channels?.feishu || {}),
675691 enabled: true,
676692 },
693+ whatsapp: {
694+ ...(config.channels?.whatsapp || {}),
695+ enabled: true,
696+ },
677697};
678698679699fs.writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`, "utf8");
680700NODE
681701682702openclaw doctor --non-interactive >/tmp/openclaw-setup-entry-doctor.log 2>&1
683703684-if [ -e "$root/dist/extensions/$CHANNEL/node_modules/$DEP_SENTINEL/package.json" ]; then
685- echo "expected configured Feishu deps to be installed externally, not into bundled plugin tree" >&2
686- exit 1
687-fi
688-if ! find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -path "*/node_modules/$DEP_SENTINEL/package.json" -type f | grep -q .; then
689- echo "missing external staged dependency sentinel for configured $CHANNEL: $DEP_SENTINEL" >&2
690- cat /tmp/openclaw-setup-entry-doctor.log >&2
691- find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -type f | sort | head -160 >&2 || true
692- exit 1
693-fi
704+for channel in "${!SETUP_ENTRY_DEP_SENTINELS[@]}"; do
705+ dep_sentinel="${SETUP_ENTRY_DEP_SENTINELS[$channel]}"
706+ if [ -e "$root/dist/extensions/$channel/node_modules/$dep_sentinel/package.json" ]; then
707+ echo "expected configured $channel deps to be installed externally, not into bundled plugin tree" >&2
708+ exit 1
709+ fi
710+ if ! find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -path "*/node_modules/$dep_sentinel/package.json" -type f | grep -q .; then
711+ echo "missing external staged dependency sentinel for configured $channel: $dep_sentinel" >&2
712+ cat /tmp/openclaw-setup-entry-doctor.log >&2
713+ find "$OPENCLAW_PLUGIN_STAGE_DIR" -maxdepth 12 -type f | sort | head -160 >&2 || true
714+ exit 1
715+ fi
716+done
694717695718echo "bundled channel setup-entry runtime deps Docker E2E passed"
696719EOF
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。