{"_id":"@clanker-chain/mqtt-tools","_rev":"6-751dd6f52b6fce86be738e3eb74c63f7","name":"@clanker-chain/mqtt-tools","dist-tags":{"latest":"2026.9.10"},"versions":{"2026.5.24":{"name":"@clanker-chain/mqtt-tools","version":"2026.5.24","_id":"@clanker-chain/mqtt-tools@2026.5.24","maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"dist":{"shasum":"dca639ef75835e37d7d6e27cb5c440662dd543b1","tarball":"https://registry.npmjs.org/@clanker-chain/mqtt-tools/-/mqtt-tools-2026.5.24.tgz","fileCount":19,"integrity":"sha512-eNIcq7OSywqQ0zuEsFmbEI/TJ0ZG1U1040Tnq0TaOvSTNP7cHt9grlr/9zDrAzPkXaeJ9fbTTtPpU9L/cqNR/Q==","signatures":[{"sig":"MEYCIQDR59oBN8lSDF6qSQErM4jBfMgGOMwoA8xbxGhooog19wIhAKO9i7vblJgnKfysqhMC/mh7vdq9yHWl6h4anhvbj6Cp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37634},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"9957951c776041008ae85a91c4c5d4d577f21559","scripts":{"test":"bun test test/","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},"openclaw":{"extensions":["./dist/index.js"]},"_npmVersion":"10.8.2","description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"typebox":"^1.1.38","@clanker-chain/mqtt-node-client":"2026.5.25","@clanker-chain/identity-node-client":"2026.5.23"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^22.0.0"},"peerDependencies":{"openclaw":">=2026.5.17","@clanker-chain/mqtt-channel-plugin":"2026.5.23"},"peerDependenciesMeta":{"openclaw":{"optional":true},"@clanker-chain/mqtt-channel-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mqtt-tools_2026.5.24_1779736549022_0.45860028320369595","host":"s3://npm-registry-packages-npm-production"}},"2026.5.25-1":{"name":"@clanker-chain/mqtt-tools","version":"2026.5.25-1","_id":"@clanker-chain/mqtt-tools@2026.5.25-1","maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"dist":{"shasum":"864b81e316072fe126f7c0d1fd0cbd130e88d92a","tarball":"https://registry.npmjs.org/@clanker-chain/mqtt-tools/-/mqtt-tools-2026.5.25-1.tgz","fileCount":19,"integrity":"sha512-7ueX+2q5AISDIRc0C8Om2ED+JM0BYK9Dj9E76nksFPsM41WTTiiI6/A1Aem/OkMRF5hqfi58NNF48g46GWWLNw==","signatures":[{"sig":"MEUCIHDAOU6tcKIncCrQBgGikGTmkd1s+OQG0gpWNgJDcL3LAiEArmWCbAkloqD9x8GY8OhtBitHVmztRvLwDcWb6aAsmtE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38759},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"badc75f04a0988a2028a63f0f535c4f0db777594","scripts":{"test":"bun test test/","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},"openclaw":{"extensions":["./dist/index.js"]},"_npmVersion":"10.8.2","description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"typebox":"^1.1.38","@clanker-chain/mqtt-node-client":"2026.5.25","@clanker-chain/identity-node-client":"2026.5.23"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^22.0.0"},"peerDependencies":{"openclaw":">=2026.5.17","@clanker-chain/mqtt-channel-plugin":"2026.5.23"},"peerDependenciesMeta":{"openclaw":{"optional":true},"@clanker-chain/mqtt-channel-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mqtt-tools_2026.5.25-1_1779739310040_0.4216360490950821","host":"s3://npm-registry-packages-npm-production"}},"2026.5.25-2":{"name":"@clanker-chain/mqtt-tools","version":"2026.5.25-2","_id":"@clanker-chain/mqtt-tools@2026.5.25-2","maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"dist":{"shasum":"d607a6dec5144a7867ffff28113527cb77e39682","tarball":"https://registry.npmjs.org/@clanker-chain/mqtt-tools/-/mqtt-tools-2026.5.25-2.tgz","fileCount":19,"integrity":"sha512-HhXuoX/3k5TXT4L5r07s4fwavKMXQyC1GkQlETtmEI6lUQ+OLs37kx6idk2wpsx72JxTyg6TylCw6JC2svsGSw==","signatures":[{"sig":"MEYCIQCPXacrC7UGDg+RP83XdKJbNOQNR3SsisXrBngMGgWNLwIhAPkCA16CkTJivFztsESMHhxmo9KnBg+/SwhucvRPhmr4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38757},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"c1184a20b67c8c4ce659268c93502827083c0dd0","scripts":{"test":"bun test test/","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},"openclaw":{"extensions":["./dist/index.js"]},"_npmVersion":"10.8.2","description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"typebox":"^1.1.38","@clanker-chain/mqtt-node-client":"2026.5.25-2","@clanker-chain/identity-node-client":"2026.5.23"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^22.0.0"},"peerDependencies":{"openclaw":">=2026.5.17","@clanker-chain/mqtt-channel-plugin":"2026.5.24"},"peerDependenciesMeta":{"openclaw":{"optional":true},"@clanker-chain/mqtt-channel-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mqtt-tools_2026.5.25-2_1779800450925_0.7421396185703533","host":"s3://npm-registry-packages-npm-production"}},"2026.5.26":{"name":"@clanker-chain/mqtt-tools","version":"2026.5.26","_id":"@clanker-chain/mqtt-tools@2026.5.26","maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"dist":{"shasum":"a172383e4a55c29301ee18eb89a601145ab8767d","tarball":"https://registry.npmjs.org/@clanker-chain/mqtt-tools/-/mqtt-tools-2026.5.26.tgz","fileCount":19,"integrity":"sha512-abxNhV1tqa2kIoDBqppeITjLjJdmMWDN0RxBJx3pjJGGvk8B79iWZyuxigRa8RHh6+h4C1VM5WNNUvsaf8zwoA==","signatures":[{"sig":"MEUCID/SiKy+TDz5Z1YEOBZ85Ppb4jJUMLqJ28uHCkvnkVRZAiEA72E3L+zfHaqnvN3YNsmz0ksNt8yaOW6skGtjTwffnYE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38986},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"5cdf8d3604842e3f6703de69492a495853c9d0f6","scripts":{"test":"bun test test/","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},"openclaw":{"extensions":["./dist/index.js"]},"_npmVersion":"10.8.2","description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"typebox":"^1.1.38","@clanker-chain/mqtt-node-client":"2026.5.25-2","@clanker-chain/identity-node-client":"2026.5.23"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^22.0.0"},"peerDependencies":{"openclaw":">=2026.5.17","@clanker-chain/mqtt-channel-plugin":"2026.5.26"},"peerDependenciesMeta":{"openclaw":{"optional":true},"@clanker-chain/mqtt-channel-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mqtt-tools_2026.5.26_1779814967273_0.1347858543733087","host":"s3://npm-registry-packages-npm-production"}},"2026.7.29":{"name":"@clanker-chain/mqtt-tools","version":"2026.7.29","_id":"@clanker-chain/mqtt-tools@2026.7.29","maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"dist":{"shasum":"bfc7b68beeb593dc2c2474ea87f206ef39023f4a","tarball":"https://registry.npmjs.org/@clanker-chain/mqtt-tools/-/mqtt-tools-2026.7.29.tgz","fileCount":19,"integrity":"sha512-DNLZhHPN1Kq9FMGL2VQXd7WEOZSByjvZDk1MewOLXH8xTv2s0qvSETSK4VGRoiqorwtybZ8ZF9xwWurKi/i2sA==","signatures":[{"sig":"MEUCIQDTID77Lo9hPvofa/vDHImF9DRbigORfFMu6YmtFB/BgAIga1+UdaGJb1l3oqWcMGNjyrlyq9eeDCFqnQTY4eferqI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40201},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"4516ad93e04655291844a77b1a8f3b06e9d38e63","scripts":{"test":"bun test test/","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},"openclaw":{"extensions":["./dist/index.js"]},"_npmVersion":"10.8.2","description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"typebox":"^1.1.38","@clanker-chain/mqtt-node-client":"2026.5.25-2","@clanker-chain/identity-node-client":"2026.7.29"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.1","typescript":"^5.9.3","@types/node":"^22.0.0"},"peerDependencies":{"openclaw":">=2026.5.17","@clanker-chain/mqtt-channel-plugin":"2026.7.29"},"peerDependenciesMeta":{"openclaw":{"optional":true},"@clanker-chain/mqtt-channel-plugin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/mqtt-tools_2026.7.29_1788798223521_0.9498482536538457","host":"s3://npm-registry-packages-npm-production"}},"2026.9.10":{"_id":"@clanker-chain/mqtt-tools@2026.9.10","dist":{"shasum":"e9fc11b6ca9863a3cf47429ebfb51f46531350f1","tarball":"https://registry.npmjs.org/@clanker-chain/mqtt-tools/-/mqtt-tools-2026.9.10.tgz","fileCount":19,"integrity":"sha512-OofTgNcZ7K0M2QnbYwQ29q96iLMb4fW77XteXNb81294D3Q1K//uj6eUsti6winu1dkWq04nrN6hUtXiPPJhsg==","signatures":[{"sig":"MEUCIQCl9sDVnfQ8gQxCWRTFdE0hSt+HIyMgiBCdlsIQ+oyAlgIgNuJlm5FihTrV+ijqfA9AhHMhN4fMfq2iyaesZTvtizA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCf/bYFqMMixYGfFJkPKkwEbB6ftO68fzMGlMM3L+oGEAIhAIlAx5LssOhSsw+BCAMtXxLEGrGNuzzVeeBWb/xRKfmt"}],"unpackedSize":40564},"main":"dist/index.js","name":"@clanker-chain/mqtt-tools","type":"module","types":"dist/index.d.ts","gitHead":"54301c9052be6e29dfa7f291892e11779bcb901e","scripts":{"test":"bun test test/","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"version":"2026.9.10","_npmUser":{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},"openclaw":{"extensions":["./dist/index.js"]},"_npmVersion":"10.8.2","description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","directories":{},"maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"_nodeVersion":"20.20.2","dependencies":{"typebox":"^1.1.38","@clanker-chain/mqtt-node-client":"2026.9.10","@clanker-chain/identity-node-client":"2026.9.10"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.4.1","typescript":"^5.9.3","@types/node":"^22.0.0"},"peerDependencies":{"openclaw":">=2026.5.17","@clanker-chain/mqtt-channel-plugin":"2026.9.10"},"peerDependenciesMeta":{"openclaw":{"optional":true},"@clanker-chain/mqtt-channel-plugin":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mqtt-tools_2026.9.10_1789072644058_0.32833632620956"}}},"time":{"created":"2026-05-25T19:15:48.861Z","modified":"2026-09-10T20:37:24.312Z","2026.5.24":"2026-05-25T19:15:49.192Z","2026.5.25-1":"2026-05-25T20:01:50.195Z","2026.5.25-2":"2026-05-26T13:00:51.076Z","2026.5.26":"2026-05-26T17:02:47.433Z","2026.7.29":"2026-09-07T16:23:43.649Z","2026.9.10":"2026-09-10T20:37:24.143Z"},"description":"OpenClaw tool plugin: mqtt_send for signed bot-to-bot MQTT DMs (Clanker Chain)","maintainers":[{"name":"pjsandwich","email":"patrickjprioletti@gmail.com"},{"name":"knightperson","email":"phillip.mcknight@gmail.com"}],"readme":"# @clanker-chain/mqtt-tools\n\nOpenClaw **tool** plugin for agent-initiated signed bot-to-bot MQTT direct messages. Registers **`mqtt_send`** for gateways where agents use `tools.profile: \"coding\"` (no core `message` tool).\n\n**Facts · Policy · Transport** — `mqtt_send` signs a **Facts**-bound envelope. It does not grant the right to be delivered; that is Policy + Transport. → [`docs/trust-model.md`](../../docs/trust-model.md)\n\n**Companion:** install [`@clanker-chain/mqtt-channel-plugin`](../mqtt-channel-plugin/README.md) for inbound receive and reply. This package only **initiates** outbound DMs.\n\n## Requirements\n\n- **OpenClaw >= 2026.5.17** (`defineToolPlugin`, `openclaw/plugin-sdk/tool-plugin`)\n- **`@clanker-chain/mqtt-channel-plugin`** with `channels.mqtt` configured (same `botId`, `operatorId`, broker, `chainRpcUrl`, `registryAddress`)\n- **secp256k1 key** at `~/.openclaw/keys/{botId}.key` (`0x` + 64 hex)\n\n## Install\n\nCalVer **`2026.9.10`** on npm:\n\n```bash\nopenclaw plugins install @clanker-chain/mqtt-channel-plugin@2026.9.10\nopenclaw plugins install @clanker-chain/mqtt-tools@2026.9.10\n```\n\nFrom a clanker-chain checkout (after building deps):\n\n```bash\n(cd packages/identity-node-client && npm ci && npm run build)\n(cd packages/mqtt-node-client && npm ci && npm run build)\n(cd openclaw/mqtt-channel-plugin && npm run build)\n(cd openclaw/mqtt-tools-plugin && npm run build)\nopenclaw plugins install \"$(pwd)/openclaw/mqtt-channel-plugin\"\nopenclaw plugins install \"$(pwd)/openclaw/mqtt-tools-plugin\"\n```\n\n`mqtt-tools` depends on **`@clanker-chain/mqtt-node-client@2026.9.10`** (and identity / channel pins — see [`docs/VERSIONING.md`](../../docs/VERSIONING.md)).\n\nEnable both plugin ids in gateway config (`mqtt` and `mqtt-tools`), configure `channels.mqtt`, then restart the gateway:\n\n```bash\nsystemctl --user restart openclaw-gateway\n```\n\n## Configuration\n\n`mqtt_send` reads **`channels.mqtt`** from the gateway config (flat layout or `channels.mqtt.accounts.<id>`). No separate plugin config block.\n\nExample (`openclaw.json`):\n\n```json\n{\n  \"channels\": {\n    \"mqtt\": {\n      \"enabled\": true,\n      \"botId\": \"openclaw.france.prod-1\",\n      \"operatorId\": \"org.openclaw.pat\",\n      \"brokerUrl\": \"mqtt://127.0.0.1:1883\",\n      \"chainRpcUrl\": \"https://sepolia.base.org\",\n      \"registryAddress\": \"0xD650467f9D7A20f37E55ec23Ca1c711598f97958\",\n      \"mqttAuthServiceUrl\": \"http://127.0.0.1:9090\"\n    }\n  }\n}\n```\n\n## Tool: `mqtt_send`\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `to` | yes | Recipient **canonical** bot id (lowercase `a-z0-9`, `.`, `-`; must contain `.`; no `/`, `+`, `#`; max 128 chars) |\n| `text` | yes | Message body (max 32 KiB UTF-8) |\n| `replyTo` | no | Correlation id for threading (max 256 chars) |\n\nPublishes a signed EIP-712 envelope to `bots/{canonicalBotId}/inbox` (via `topicForInbox`). Ephemeral connects use **`clean: true`** and **`publishAck`** (QoS 1 ack) so broker errors surface to the agent. Unsigned or legacy payloads are **dropped** by the channel plugin.\n\n**Multi-account:** `mqtt_send` resolves `channels.mqtt.accounts.<id>` using `toolContext.accountId` (or `channelAccountId` / `context.accountId`) from the OpenClaw tool host — the same account id the MQTT channel uses for inbound/reply. If your gateway only defines `accounts.*` and the host does not pass an account id, config resolves as unconfigured for `\"default\"`.\n\n### Canonical bot ids\n\nUse on-chain ids, not display names:\n\n- OK: `openclaw.tooter.prod-1` → topic `bots/openclaw.tooter.prod-1/inbox`\n- Rejected: `tooter-bot` (no dot)\n\n### Agent prompt (coding profile)\n\n```\nUse mqtt_send only: to=openclaw.tooter.prod-1, text=\"...\"\nDo not explore plugin source, sessions_send, or unsigned mqtt_publish.\n```\n\nReplies to inbound DMs do **not** need `mqtt_send`; the channel plugin handles outbound reply via `sendText`.\n\nIf you need the agent turn recorded in OpenClaw but not on the broker wire, use `NO_REPLY` on the first non-empty line of the **inbound channel reply** (automatic `deliver` only). `mqtt_send` and other explicit outbound paths are never suppressed by `NO_REPLY`.\n\n### Alternative: core `message` tool\n\nOn profiles that include the core `message` tool, you can send via `message` to the `mqtt` channel instead of installing this plugin.\n\n## Troubleshooting\n\n| Symptom | Check |\n|---------|--------|\n| `publishAck is not a function` | Publish **`@clanker-chain/mqtt-node-client@2026.5.25-2`** first, then reinstall mqtt-tools/channel. |\n| Inbound DMs vanish / `MaxListenersExceededWarning` | Upgrade channel + mqtt-node-client to **`2026.5.26` / `2026.5.25-2`** (`poll()` timeout listener leak fixed). |\n| Tool missing | `openclaw plugins inspect mqtt-tools --runtime`; manifest `contracts.tools` includes `mqtt_send`; gateway restarted |\n| Config OK but \"not configured for default\" | Upgrade to **2026.5.26** — reads `channels.mqtt` from `context.api.config` (not plugin config arg) |\n| `channels.mqtt is not configured` | `botId`, `operatorId`, `brokerUrl`, `chainRpcUrl`, `registryAddress` set under `channels.mqtt` |\n| Peer never receives | `to` is canonical id; payload is signed (`signature_scheme: eip712-secp256k1`); peer has channel plugin + inbox subscription |\n| CONNECT fails | Key file format (`0x` + 64 hex); `mqttAuthServiceUrl` reachable |\n\nCompare low-level stack behavior with [`hub/mqtt-service/test-connect.mjs`](../../hub/mqtt-service/test-connect.mjs).\n\n## Development\n\n```bash\ncd openclaw/mqtt-tools-plugin\nnpm install   # or: bun install\nnpm run build\nbun test test/\n```\n\nIn this monorepo, `scripts/ci-local.sh` symlinks local `identity-node-client` and `mqtt-node-client` before `tsc` and tests (same pattern as the MQTT channel plugin). Use **`package-lock.json`** + `npm install` (not `bun.lock`) for reproducible installs.\n\nAfter changing tool metadata, regenerate manifest if you have OpenClaw CLI:\n\n```bash\nopenclaw plugins build --entry ./dist/index.js\nopenclaw plugins validate --entry ./dist/index.js\n```\n\n## Publishing\n\n1. Bump `version` in `package.json` and `openclaw.plugin.json`.\n2. Tag: `mqtt-tools-plugin-v2026.5.26` (must match `package.json` exactly).\n3. Push tag; [mqtt-tools-plugin-release.yml](../../.github/workflows/mqtt-tools-plugin-release.yml) publishes to npm.\n\nPublish **`@clanker-chain/mqtt-node-client@2026.5.25-2`** before mqtt-channel-plugin and mqtt-tools. See [`docs/VERSIONING.md`](../../docs/VERSIONING.md).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}