- Refactor monolithic index.js (2646 lines) into src/{webex,integrations,
cards,flows,commands,services} modules; replace node-fetch/form-data
with native fetch/FormData; move all secrets to .env via dotenv
- Add dockerized remote SIW agent (docker/remote-agent/) with cross-arch
buildx packaging (arm64 Mac -> linux/amd64), idempotent install.sh
deploy bundle, and docker-free ZIP inspector for arch verification
- Bot hosts a WebSocket server; agent proxies SIW requests with a
per-request insecure:true flag, replacing the process-wide
NODE_TLS_REJECT_UNAUTHORIZED bypass
- Add ESLint flat config + Prettier, rewrite Dockerfile as non-root
multi-stage node:22-alpine build, README covering setup / deploy /
remote agent workflow
- Fix parseStoreArg to read trigger.prompt correctly (was indexing past
the framework's post-match slice); register /help as regex (string
matcher only compares the first token); switch catch-all to /.+/
(previous /.*/gim was stateful due to the g flag); remove
/fixDisplayNames command and its flow/card
Co-authored-by: Cursor <cursoragent@cursor.com>
4.9 KiB
wbxStoreProvision Remote Agent — Deploy Bundle
This ZIP is a self-contained deployment bundle for the wbxStoreProvision
remote agent. Extract it, run install.sh, fill in your .env, and the
agent will start as a Docker container.
What's in the bundle
| File | Purpose |
|---|---|
wbxprov-remote-agent-<version>.tar.gz |
The Docker image, saved via docker save. |
docker-compose.yml |
Runtime-only compose file (no build step; references the loaded image). |
install.sh |
Verifies checksum, loads the image, seeds .env, starts the container. |
.env.example |
Template — copied to .env on first run for you to fill in. |
SHA256SUMS |
Integrity check for the image tarball. |
VERSION |
Plain-text version marker used by install.sh and docker-compose.yml. |
README.md |
This file. |
Prerequisites (on the remote host)
- Docker 20.10+ with the daemon running.
- Docker Compose — either the modern
docker composeplugin (v2) or the legacydocker-composebinary.install.shauto-detects. - Whichever user runs
install.shneeds permission to talk to the Docker daemon (member of thedockergroup, or run undersudo). - Outbound network access from the host to:
- The main wbxStoreProvision bot (
WS_URL). - Store Info Web (the internal API the agent proxies for).
- The main wbxStoreProvision bot (
Install / start
unzip wbxprov-remote-agent-<version>.zip
cd wbxprov-remote-agent-<version>
./install.sh
On the first run install.sh will:
- Verify the SHA-256 of the image tarball against
SHA256SUMS. - Load the image into Docker (a fast no-op on subsequent runs).
- Copy
.env.example→.envand stop, asking you to fill it in.
Fill in .env:
vi .env # set WS_URL and WS_TOKEN
Then re-run:
./install.sh
That last run will start the container (docker compose up -d) and print
the log-tail command.
Day-to-day operations
docker compose logs -f # tail the agent logs
docker compose ps # show container status
docker compose restart # cycle it
docker compose down # stop and remove the container
docker compose up -d # bring it back up
Healthy startup looks like:
Connecting to wss://.../ws...
Remote Agent connected to wbxStoreProvision
Upgrading
When you receive a newer ZIP:
# Optional: back up your existing config
cp -a <old-version-folder>/.env ./wbxprov-remote-agent-<new-version>-env.bak
# Stop the old container
cd <old-version-folder> && docker compose down && cd ..
# Extract and start the new one
unzip wbxprov-remote-agent-<new-version>.zip
cp <old-version-folder>/.env wbxprov-remote-agent-<new-version>/.env
cd wbxprov-remote-agent-<new-version>
./install.sh
The old image stays in Docker's local cache until you docker image prune
it — handy if you need to roll back quickly.
Coexistence with the netanalyzer agent
This bundle uses distinct image and container names
(wbxprov-remote-agent), so it can run on the same host as
sha-remote-agent (netanalyzer's agent) without any conflict. Keep the
two deploy folders separate — each has its own .env pointing at its own
server.
Troubleshooting
-
"Cannot talk to the Docker daemon" — either Docker isn't running or your user isn't in the
dockergroup. Trysudo ./install.shor add yourself to the group:sudo usermod -aG docker $USERand log back in. -
"Checksum verification FAILED" — the ZIP was corrupted in transit. Re-transfer.
-
"exec /sbin/tini: exec format error" or "Image architecture does not match this host" — the ZIP was built for the wrong CPU architecture (typically an Apple Silicon Mac produced an
arm64image for anx86_64Linux host).install.shcatches this and prints the exact rebuild command; ask your build operator to run:./docker/remote-agent/package.sh --platform linux/amd64(or
linux/arm64if this host is ARM — rununame -mto check:x86_64→linux/amd64,aarch64→linux/arm64.)Note that
install.shalways re-runsdocker loadon the bundled tarball, so a stale image left from an earlier wrong-arch attempt at the same version tag will be transparently replaced when you install a corrected bundle — no need todocker rmiby hand. -
Agent connects, then disconnects immediately —
WS_TOKENdoesn't match the bot'sWS_TOKEN. Fix in.env, thendocker compose restart. -
Agent never connects — check
WS_URL(correct hostname, correct schemews://vswss://) and that there's no firewall between this host and the bot. -
Requests to SIW fail from the agent's logs — the container needs direct network reachability to SIW. If SIW lives on the host's local network and the container can't reach it, uncomment
network_mode: hostindocker-compose.yml(Linux only) or attach the container to the right user-defined network.