mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-07-06 18:52:03 +08:00
8f2f788b6e
The prior commit moves `chat` to 4.29.0, but main's own install pins were left behind — and were inconsistent: the 8 /add-<channel> SKILL.md steps pinned @chat-adapter/*@4.27.0 while the 12 setup/*.sh scripts pinned @4.26.0. Unify all to @4.29.0 so `/add-<channel>` (and setup:auto) on a main install fetch an adapter whose ChatInstance matches the bridge. 20 files, version-string only. Shell scripts pass `bash -n`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
47 lines
1.5 KiB
Bash
Executable File
47 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Setup helper: install-whatsapp-cloud — bundles the preflight + install
|
|
# commands from the /add-whatsapp-cloud skill into one idempotent script so
|
|
# /new-setup can run them programmatically before continuing to credentials.
|
|
#
|
|
# Copies the WhatsApp Cloud adapter in from the `channels` branch; appends the
|
|
# self-registration import; installs the pinned @chat-adapter/whatsapp package;
|
|
# builds. All steps are safe to re-run.
|
|
set -euo pipefail
|
|
|
|
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$PROJECT_ROOT"
|
|
|
|
echo "=== NANOCLAW SETUP: INSTALL_WHATSAPP_CLOUD ==="
|
|
|
|
needs_install=false
|
|
[[ -f src/channels/whatsapp-cloud.ts ]] || needs_install=true
|
|
grep -q "import './whatsapp-cloud.js';" src/channels/index.ts || needs_install=true
|
|
grep -q '"@chat-adapter/whatsapp"' package.json || needs_install=true
|
|
[[ -d node_modules/@chat-adapter/whatsapp ]] || needs_install=true
|
|
|
|
if ! $needs_install; then
|
|
echo "STATUS: already-installed"
|
|
echo "=== END ==="
|
|
exit 0
|
|
fi
|
|
|
|
echo "STEP: fetch-channels-branch"
|
|
git fetch origin channels
|
|
|
|
echo "STEP: copy-files"
|
|
git show origin/channels:src/channels/whatsapp-cloud.ts > src/channels/whatsapp-cloud.ts
|
|
|
|
echo "STEP: register-import"
|
|
if ! grep -q "import './whatsapp-cloud.js';" src/channels/index.ts; then
|
|
printf "import './whatsapp-cloud.js';\n" >> src/channels/index.ts
|
|
fi
|
|
|
|
echo "STEP: pnpm-install"
|
|
pnpm install @chat-adapter/whatsapp@4.29.0
|
|
|
|
echo "STEP: pnpm-build"
|
|
pnpm run build
|
|
|
|
echo "STATUS: installed"
|
|
echo "=== END ==="
|