@openclaw/buzz 2026.9.1 → 2026.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/api.js +1 -1
  2. package/dist/{channel-B50upNWy.js → channel-C6rro-f7.js} +30 -13
  3. package/dist/channel-plugin-api.js +1 -1
  4. package/node_modules/nostr-tools/README.md +23 -0
  5. package/node_modules/nostr-tools/lib/cjs/index.js +25 -15
  6. package/node_modules/nostr-tools/lib/cjs/index.js.map +2 -2
  7. package/node_modules/nostr-tools/lib/cjs/nip27.js +24 -14
  8. package/node_modules/nostr-tools/lib/cjs/nip27.js.map +2 -2
  9. package/node_modules/nostr-tools/lib/cjs/nipb7.js +1003 -98
  10. package/node_modules/nostr-tools/lib/cjs/nipb7.js.map +4 -4
  11. package/node_modules/nostr-tools/lib/cjs/relay.js +1 -1
  12. package/node_modules/nostr-tools/lib/cjs/relay.js.map +2 -2
  13. package/node_modules/nostr-tools/lib/esm/index.js +25 -15
  14. package/node_modules/nostr-tools/lib/esm/index.js.map +2 -2
  15. package/node_modules/nostr-tools/lib/esm/nip27.js +24 -14
  16. package/node_modules/nostr-tools/lib/esm/nip27.js.map +2 -2
  17. package/node_modules/nostr-tools/lib/esm/nipb7.js +1009 -98
  18. package/node_modules/nostr-tools/lib/esm/nipb7.js.map +4 -4
  19. package/node_modules/nostr-tools/lib/esm/relay.js +1 -1
  20. package/node_modules/nostr-tools/lib/esm/relay.js.map +2 -2
  21. package/node_modules/nostr-tools/lib/nostr.bundle.js +25 -15
  22. package/node_modules/nostr-tools/lib/nostr.bundle.js.map +2 -2
  23. package/node_modules/nostr-tools/lib/types/nip27.d.ts +18 -0
  24. package/node_modules/nostr-tools/lib/types/nipb7.d.ts +112 -5
  25. package/node_modules/nostr-tools/lib/types/relay.d.ts +1 -1
  26. package/node_modules/nostr-tools/package.json +1 -7
  27. package/package.json +5 -5
  28. package/node_modules/nostr-tools/lib/cjs/nipb0.js +0 -1087
  29. package/node_modules/nostr-tools/lib/cjs/nipb0.js.map +0 -7
  30. package/node_modules/nostr-tools/lib/esm/nipb0.js +0 -1072
  31. package/node_modules/nostr-tools/lib/esm/nipb0.js.map +0 -7
  32. package/node_modules/nostr-tools/lib/types/nipb0.d.ts +0 -128
  33. package/node_modules/nostr-tools/lib/types/nipb0.test.d.ts +0 -1
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { i as resolveBuzzAccount, r as listBuzzAccountIds, s as resolveDefaultBuzzAccountId } from "./types-CeupBG0P.js";
2
- import { n as getBuzzRuntime, r as setBuzzRuntime, t as buzzPlugin } from "./channel-B50upNWy.js";
2
+ import { n as getBuzzRuntime, r as setBuzzRuntime, t as buzzPlugin } from "./channel-C6rro-f7.js";
3
3
  export { buzzPlugin, getBuzzRuntime, listBuzzAccountIds, resolveBuzzAccount, resolveDefaultBuzzAccountId, setBuzzRuntime };
@@ -18,7 +18,7 @@ import { channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
18
18
  import { computeBackoff, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
19
19
  import { createChannelReplayGuard } from "openclaw/plugin-sdk/persistent-dedupe";
20
20
  import { normalizeURL } from "nostr-tools/utils";
21
- import { buildChannelInboundEventContext, recordDroppedChannelInboundHistory, resolveChannelInboundRouteEnvelope } from "openclaw/plugin-sdk/channel-inbound";
21
+ import { buildChannelInboundEventContext, logInboundDrop, recordDroppedChannelInboundHistory, resolveChannelInboundRouteEnvelope } from "openclaw/plugin-sdk/channel-inbound";
22
22
  import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
23
23
  import { createSubsystemLogger } from "openclaw/plugin-sdk/logging-core";
24
24
  import { buildHistoryContext, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
@@ -1580,14 +1580,25 @@ async function handleBuzzInbound(params) {
1580
1580
  const historyKey = JSON.stringify([channelId, message.threadId ?? null]);
1581
1581
  const historyLimit = account.config.historyLimit ?? 0;
1582
1582
  if (access.ingress.admission !== "dispatch") {
1583
- if (access.ingress.reasonCode === "activation_skipped") await recordBuzzPendingHistory({
1584
- historyMap: params.historyMap,
1585
- key: historyKey,
1586
- limit: historyLimit,
1587
- message,
1588
- text: textForAgent,
1589
- shouldRecord: () => !signal.aborted && bus.directory.isMember(channelId, message.senderPubkey)
1590
- });
1583
+ if (access.ingress.reasonCode === "activation_skipped") {
1584
+ const groupsPath = (cfg.channels?.buzz)?.accounts?.[account.accountId] ? `channels.buzz.accounts[${JSON.stringify(account.accountId)}].groups` : "channels.buzz.groups";
1585
+ logInboundDrop({
1586
+ log: log.info,
1587
+ channel: "buzz",
1588
+ reason: "no mention",
1589
+ target: channelId,
1590
+ onceKey: JSON.stringify([account.accountId, channelId]),
1591
+ hint: `Mention patterns can be derived from the agent identity name. Set ${groupsPath}[${JSON.stringify(channelId)}].requireMention=false to process messages without a mention.`
1592
+ });
1593
+ await recordBuzzPendingHistory({
1594
+ historyMap: params.historyMap,
1595
+ key: historyKey,
1596
+ limit: historyLimit,
1597
+ message,
1598
+ text: textForAgent,
1599
+ shouldRecord: () => !signal.aborted && bus.directory.isMember(channelId, message.senderPubkey)
1600
+ });
1601
+ }
1591
1602
  return;
1592
1603
  }
1593
1604
  const history = snapshotBuzzPendingHistory({
@@ -2066,10 +2077,16 @@ const buzzPlugin = createChatChannelPlugin({
2066
2077
  chatTypes: ["group"],
2067
2078
  threads: true
2068
2079
  },
2069
- threading: { resolveReplyTransport: ({ replyDelivery }) => replyDelivery?.replyToMode === "off" ? {
2070
- threadId: null,
2071
- replyToId: null
2072
- } : null },
2080
+ threading: { resolveReplyTransport: ({ replyDelivery, threadId, replyToId, replyToIsExplicit }) => {
2081
+ if (replyDelivery?.replyToMode === "off") return {
2082
+ threadId: null,
2083
+ replyToId: null
2084
+ };
2085
+ return threadId && replyToId && !replyToIsExplicit ? {
2086
+ threadId,
2087
+ replyToId: String(threadId)
2088
+ } : null;
2089
+ } },
2073
2090
  agentPrompt: { messageToolHints: () => ["- Buzz targets: use a configured room UUID, `buzz:<ROOM_UUID>`, or a unique current room name. Use the UUID when room names are ambiguous.", "- Buzz mentions: write a unique current room member as `@Display Name`. For an explicit identity, include `nostr:npub...`; the public key must belong to the target room. Any unresolved or ambiguous label needs an explicit identity for every intended member."] },
2074
2091
  reload: {
2075
2092
  configPrefixes: ["channels.buzz"],
@@ -1,2 +1,2 @@
1
- import { t as buzzPlugin } from "./channel-B50upNWy.js";
1
+ import { t as buzzPlugin } from "./channel-C6rro-f7.js";
2
2
  export { buzzPlugin };
@@ -459,6 +459,29 @@ summary for relay read message and verify event
459
459
  </script>
460
460
  ```
461
461
 
462
+ ### Using it with React Native
463
+
464
+ React Native requires polyfills:
465
+
466
+ ```sh
467
+ npm install react-native-get-random-values text-encoding-polyfill react-native-url-polyfill
468
+ ```
469
+
470
+ Import the polyfills at the very top of your entry file (`index.js`), **before** anything that imports `nostr-tools`:
471
+
472
+ ```js
473
+ import 'react-native-get-random-values'
474
+ import 'text-encoding-polyfill'
475
+ import 'react-native-url-polyfill/auto'
476
+
477
+ import { AppRegistry } from 'react-native'
478
+ // ...
479
+ ```
480
+
481
+ Future versions of React Native may implement these features natively, allowing the polyfills to be removed.
482
+
483
+ Note: `nostr-tools/wasm` will not work with React Native because it does not have WebAssembly support.
484
+
462
485
  ## Plumbing
463
486
 
464
487
  To develop `@nostr/tools`, install [`just`](https://just.systems/) and run `just -l` to see commands available.
@@ -1408,7 +1408,7 @@ var Relay = class extends AbstractRelay {
1408
1408
  }
1409
1409
  static async connect(url, options) {
1410
1410
  const relay = new Relay(url, options);
1411
- await relay.connect();
1411
+ await relay.connect(options);
1412
1412
  return relay;
1413
1413
  }
1414
1414
  };
@@ -2963,8 +2963,8 @@ function* parse4(content) {
2963
2963
  if (h === 0 || content[h - 1].match(noCharacter)) {
2964
2964
  const m = content.slice(h + 1, h + MAX_HASHTAG_LENGTH).match(noCharacter);
2965
2965
  const end = m ? h + 1 + m.index : max;
2966
- yield { type: "text", text: content.slice(prevIndex, h) };
2967
- yield { type: "hashtag", value: content.slice(h + 1, end) };
2966
+ yield { type: "text", text: content.slice(prevIndex, h), start: prevIndex, end: h };
2967
+ yield { type: "hashtag", value: content.slice(h + 1, end), start: h, end };
2968
2968
  index = end;
2969
2969
  prevIndex = index;
2970
2970
  continue mainloop;
@@ -2992,9 +2992,9 @@ function* parse4(content) {
2992
2992
  pointer = data;
2993
2993
  }
2994
2994
  if (prevIndex !== u - 5) {
2995
- yield { type: "text", text: content.slice(prevIndex, u - 5) };
2995
+ yield { type: "text", text: content.slice(prevIndex, u - 5), start: prevIndex, end: u - 5 };
2996
2996
  }
2997
- yield { type: "reference", pointer };
2997
+ yield { type: "reference", pointer, start: u - 5, end };
2998
2998
  index = end;
2999
2999
  prevIndex = index;
3000
3000
  continue mainloop;
@@ -3012,27 +3012,32 @@ function* parse4(content) {
3012
3012
  throw new Error("invalid url");
3013
3013
  }
3014
3014
  if (prevIndex !== u - prefixLen) {
3015
- yield { type: "text", text: content.slice(prevIndex, u - prefixLen) };
3015
+ yield {
3016
+ type: "text",
3017
+ text: content.slice(prevIndex, u - prefixLen),
3018
+ start: prevIndex,
3019
+ end: u - prefixLen
3020
+ };
3016
3021
  }
3017
3022
  if (/\.(png|jpe?g|gif|webp|heic|svg)$/i.test(url.pathname)) {
3018
- yield { type: "image", url: url.toString() };
3023
+ yield { type: "image", url: url.toString(), start: u - prefixLen, end };
3019
3024
  index = end;
3020
3025
  prevIndex = index;
3021
3026
  continue mainloop;
3022
3027
  }
3023
3028
  if (/\.(mp4|avi|webm|mkv|mov)$/i.test(url.pathname)) {
3024
- yield { type: "video", url: url.toString() };
3029
+ yield { type: "video", url: url.toString(), start: u - prefixLen, end };
3025
3030
  index = end;
3026
3031
  prevIndex = index;
3027
3032
  continue mainloop;
3028
3033
  }
3029
3034
  if (/\.(mp3|aac|ogg|opus|wav|flac)$/i.test(url.pathname)) {
3030
- yield { type: "audio", url: url.toString() };
3035
+ yield { type: "audio", url: url.toString(), start: u - prefixLen, end };
3031
3036
  index = end;
3032
3037
  prevIndex = index;
3033
3038
  continue mainloop;
3034
3039
  }
3035
- yield { type: "url", url: url.toString() };
3040
+ yield { type: "url", url: url.toString(), start: u - prefixLen, end };
3036
3041
  index = end;
3037
3042
  prevIndex = index;
3038
3043
  continue mainloop;
@@ -3050,9 +3055,14 @@ function* parse4(content) {
3050
3055
  throw new Error("invalid ws url");
3051
3056
  }
3052
3057
  if (prevIndex !== u - prefixLen) {
3053
- yield { type: "text", text: content.slice(prevIndex, u - prefixLen) };
3058
+ yield {
3059
+ type: "text",
3060
+ text: content.slice(prevIndex, u - prefixLen),
3061
+ start: prevIndex,
3062
+ end: u - prefixLen
3063
+ };
3054
3064
  }
3055
- yield { type: "relay", url: url.toString() };
3065
+ yield { type: "relay", url: url.toString(), start: u - prefixLen, end };
3056
3066
  index = end;
3057
3067
  prevIndex = index;
3058
3068
  continue mainloop;
@@ -3065,9 +3075,9 @@ function* parse4(content) {
3065
3075
  const emoji = emojis[e];
3066
3076
  if (content[u + emoji.shortcode.length + 1] === ":" && content.slice(u + 1, u + emoji.shortcode.length + 1) === emoji.shortcode) {
3067
3077
  if (prevIndex !== u) {
3068
- yield { type: "text", text: content.slice(prevIndex, u) };
3078
+ yield { type: "text", text: content.slice(prevIndex, u), start: prevIndex, end: u };
3069
3079
  }
3070
- yield emoji;
3080
+ yield { ...emoji, start: u, end: u + emoji.shortcode.length + 2 };
3071
3081
  index = u + emoji.shortcode.length + 2;
3072
3082
  prevIndex = index;
3073
3083
  continue mainloop;
@@ -3078,7 +3088,7 @@ function* parse4(content) {
3078
3088
  }
3079
3089
  }
3080
3090
  if (prevIndex !== max) {
3081
- yield { type: "text", text: content.slice(prevIndex) };
3091
+ yield { type: "text", text: content.slice(prevIndex), start: prevIndex, end: max };
3082
3092
  }
3083
3093
  }
3084
3094