@openclaw/buzz 2026.8.1-beta.2 → 2026.9.1-beta.1

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 (137) hide show
  1. package/dist/{adapter.runtime-D0uEmTwf.js → adapter.runtime-DA6guOQ_.js} +5 -5
  2. package/dist/api.js +2 -2
  3. package/dist/{channel-CCmyE6Yq.js → channel-BulZqShF.js} +234 -270
  4. package/dist/channel-plugin-api.js +1 -1
  5. package/dist/{directory-config-BXa3Vqzu.js → directory-config-BesCse0q.js} +1 -1
  6. package/dist/directory-contract-api.js +1 -1
  7. package/dist/qa-runner-api.js +2 -2
  8. package/dist/{room-membership-CNBlHjTj.js → room-membership-DSAkyE0a.js} +55 -5
  9. package/dist/setup-plugin-api.js +2 -2
  10. package/dist/{setup-surface-DCxlD2oY.js → setup-surface-BvQgEJ7O.js} +20 -42
  11. package/dist/{types-CPFsIZ5Z.js → types-BN_HOsnq.js} +18 -5
  12. package/node_modules/nostr-tools/lib/cjs/abstract-pool.js +7 -5
  13. package/node_modules/nostr-tools/lib/cjs/abstract-pool.js.map +2 -2
  14. package/node_modules/nostr-tools/lib/cjs/abstract-relay.js +6 -4
  15. package/node_modules/nostr-tools/lib/cjs/abstract-relay.js.map +2 -2
  16. package/node_modules/nostr-tools/lib/cjs/core.js +10 -6
  17. package/node_modules/nostr-tools/lib/cjs/core.js.map +2 -2
  18. package/node_modules/nostr-tools/lib/cjs/index.js +17 -11
  19. package/node_modules/nostr-tools/lib/cjs/index.js.map +2 -2
  20. package/node_modules/nostr-tools/lib/cjs/kinds.js +2 -0
  21. package/node_modules/nostr-tools/lib/cjs/kinds.js.map +2 -2
  22. package/node_modules/nostr-tools/lib/cjs/nip04.js.map +1 -1
  23. package/node_modules/nostr-tools/lib/cjs/nip10.js +2 -0
  24. package/node_modules/nostr-tools/lib/cjs/nip10.js.map +2 -2
  25. package/node_modules/nostr-tools/lib/cjs/nip13.js.map +1 -1
  26. package/node_modules/nostr-tools/lib/cjs/nip17.js +2 -0
  27. package/node_modules/nostr-tools/lib/cjs/nip17.js.map +2 -2
  28. package/node_modules/nostr-tools/lib/cjs/nip18.js +2 -0
  29. package/node_modules/nostr-tools/lib/cjs/nip18.js.map +2 -2
  30. package/node_modules/nostr-tools/lib/cjs/nip19.js.map +1 -1
  31. package/node_modules/nostr-tools/lib/cjs/nip21.js.map +1 -1
  32. package/node_modules/nostr-tools/lib/cjs/nip22.js +2 -0
  33. package/node_modules/nostr-tools/lib/cjs/nip22.js.map +2 -2
  34. package/node_modules/nostr-tools/lib/cjs/nip25.js +2 -0
  35. package/node_modules/nostr-tools/lib/cjs/nip25.js.map +2 -2
  36. package/node_modules/nostr-tools/lib/cjs/nip27.js.map +1 -1
  37. package/node_modules/nostr-tools/lib/cjs/nip28.js +2 -0
  38. package/node_modules/nostr-tools/lib/cjs/nip28.js.map +2 -2
  39. package/node_modules/nostr-tools/lib/cjs/nip29.js +288 -12
  40. package/node_modules/nostr-tools/lib/cjs/nip29.js.map +2 -2
  41. package/node_modules/nostr-tools/lib/cjs/nip44.js.map +1 -1
  42. package/node_modules/nostr-tools/lib/cjs/nip45.js +2 -0
  43. package/node_modules/nostr-tools/lib/cjs/nip45.js.map +2 -2
  44. package/node_modules/nostr-tools/lib/cjs/nip46.js +9 -5
  45. package/node_modules/nostr-tools/lib/cjs/nip46.js.map +2 -2
  46. package/node_modules/nostr-tools/lib/cjs/nip47.js +2 -0
  47. package/node_modules/nostr-tools/lib/cjs/nip47.js.map +2 -2
  48. package/node_modules/nostr-tools/lib/cjs/nip57.js +2 -0
  49. package/node_modules/nostr-tools/lib/cjs/nip57.js.map +2 -2
  50. package/node_modules/nostr-tools/lib/cjs/nip59.js +2 -0
  51. package/node_modules/nostr-tools/lib/cjs/nip59.js.map +2 -2
  52. package/node_modules/nostr-tools/lib/cjs/nip98.js +2 -0
  53. package/node_modules/nostr-tools/lib/cjs/nip98.js.map +2 -2
  54. package/node_modules/nostr-tools/lib/cjs/nipb0.js +2 -0
  55. package/node_modules/nostr-tools/lib/cjs/nipb0.js.map +2 -2
  56. package/node_modules/nostr-tools/lib/cjs/nipb7.js +2 -0
  57. package/node_modules/nostr-tools/lib/cjs/nipb7.js.map +2 -2
  58. package/node_modules/nostr-tools/lib/cjs/pool.js +9 -5
  59. package/node_modules/nostr-tools/lib/cjs/pool.js.map +2 -2
  60. package/node_modules/nostr-tools/lib/cjs/pure.js +10 -6
  61. package/node_modules/nostr-tools/lib/cjs/pure.js.map +2 -2
  62. package/node_modules/nostr-tools/lib/cjs/references.js.map +1 -1
  63. package/node_modules/nostr-tools/lib/cjs/relay.js +8 -4
  64. package/node_modules/nostr-tools/lib/cjs/relay.js.map +2 -2
  65. package/node_modules/nostr-tools/lib/cjs/signer.js +2 -0
  66. package/node_modules/nostr-tools/lib/cjs/signer.js.map +2 -2
  67. package/node_modules/nostr-tools/lib/cjs/utils.js +2 -0
  68. package/node_modules/nostr-tools/lib/cjs/utils.js.map +2 -2
  69. package/node_modules/nostr-tools/lib/cjs/wasm.js +10 -6
  70. package/node_modules/nostr-tools/lib/cjs/wasm.js.map +2 -2
  71. package/node_modules/nostr-tools/lib/esm/abstract-pool.js +7 -5
  72. package/node_modules/nostr-tools/lib/esm/abstract-pool.js.map +2 -2
  73. package/node_modules/nostr-tools/lib/esm/abstract-relay.js +6 -4
  74. package/node_modules/nostr-tools/lib/esm/abstract-relay.js.map +2 -2
  75. package/node_modules/nostr-tools/lib/esm/core.js +10 -6
  76. package/node_modules/nostr-tools/lib/esm/core.js.map +2 -2
  77. package/node_modules/nostr-tools/lib/esm/index.js +17 -11
  78. package/node_modules/nostr-tools/lib/esm/index.js.map +2 -2
  79. package/node_modules/nostr-tools/lib/esm/kinds.js +2 -0
  80. package/node_modules/nostr-tools/lib/esm/kinds.js.map +2 -2
  81. package/node_modules/nostr-tools/lib/esm/nip04.js.map +1 -1
  82. package/node_modules/nostr-tools/lib/esm/nip10.js +2 -0
  83. package/node_modules/nostr-tools/lib/esm/nip10.js.map +2 -2
  84. package/node_modules/nostr-tools/lib/esm/nip13.js.map +1 -1
  85. package/node_modules/nostr-tools/lib/esm/nip17.js +2 -0
  86. package/node_modules/nostr-tools/lib/esm/nip17.js.map +2 -2
  87. package/node_modules/nostr-tools/lib/esm/nip18.js +2 -0
  88. package/node_modules/nostr-tools/lib/esm/nip18.js.map +2 -2
  89. package/node_modules/nostr-tools/lib/esm/nip19.js.map +1 -1
  90. package/node_modules/nostr-tools/lib/esm/nip21.js.map +1 -1
  91. package/node_modules/nostr-tools/lib/esm/nip22.js +2 -0
  92. package/node_modules/nostr-tools/lib/esm/nip22.js.map +2 -2
  93. package/node_modules/nostr-tools/lib/esm/nip25.js +2 -0
  94. package/node_modules/nostr-tools/lib/esm/nip25.js.map +2 -2
  95. package/node_modules/nostr-tools/lib/esm/nip27.js.map +1 -1
  96. package/node_modules/nostr-tools/lib/esm/nip28.js +2 -0
  97. package/node_modules/nostr-tools/lib/esm/nip28.js.map +2 -2
  98. package/node_modules/nostr-tools/lib/esm/nip29.js +288 -12
  99. package/node_modules/nostr-tools/lib/esm/nip29.js.map +2 -2
  100. package/node_modules/nostr-tools/lib/esm/nip44.js.map +1 -1
  101. package/node_modules/nostr-tools/lib/esm/nip45.js +2 -0
  102. package/node_modules/nostr-tools/lib/esm/nip45.js.map +2 -2
  103. package/node_modules/nostr-tools/lib/esm/nip46.js +9 -5
  104. package/node_modules/nostr-tools/lib/esm/nip46.js.map +2 -2
  105. package/node_modules/nostr-tools/lib/esm/nip47.js +2 -0
  106. package/node_modules/nostr-tools/lib/esm/nip47.js.map +2 -2
  107. package/node_modules/nostr-tools/lib/esm/nip57.js +2 -0
  108. package/node_modules/nostr-tools/lib/esm/nip57.js.map +2 -2
  109. package/node_modules/nostr-tools/lib/esm/nip59.js +2 -0
  110. package/node_modules/nostr-tools/lib/esm/nip59.js.map +2 -2
  111. package/node_modules/nostr-tools/lib/esm/nip98.js +2 -0
  112. package/node_modules/nostr-tools/lib/esm/nip98.js.map +2 -2
  113. package/node_modules/nostr-tools/lib/esm/nipb0.js +2 -0
  114. package/node_modules/nostr-tools/lib/esm/nipb0.js.map +2 -2
  115. package/node_modules/nostr-tools/lib/esm/nipb7.js +2 -0
  116. package/node_modules/nostr-tools/lib/esm/nipb7.js.map +2 -2
  117. package/node_modules/nostr-tools/lib/esm/pool.js +9 -5
  118. package/node_modules/nostr-tools/lib/esm/pool.js.map +2 -2
  119. package/node_modules/nostr-tools/lib/esm/pure.js +10 -6
  120. package/node_modules/nostr-tools/lib/esm/pure.js.map +2 -2
  121. package/node_modules/nostr-tools/lib/esm/references.js.map +1 -1
  122. package/node_modules/nostr-tools/lib/esm/relay.js +8 -4
  123. package/node_modules/nostr-tools/lib/esm/relay.js.map +2 -2
  124. package/node_modules/nostr-tools/lib/esm/signer.js +2 -0
  125. package/node_modules/nostr-tools/lib/esm/signer.js.map +2 -2
  126. package/node_modules/nostr-tools/lib/esm/utils.js +2 -0
  127. package/node_modules/nostr-tools/lib/esm/utils.js.map +2 -2
  128. package/node_modules/nostr-tools/lib/esm/wasm.js +10 -6
  129. package/node_modules/nostr-tools/lib/esm/wasm.js.map +2 -2
  130. package/node_modules/nostr-tools/lib/nostr.bundle.js +17 -11
  131. package/node_modules/nostr-tools/lib/nostr.bundle.js.map +2 -2
  132. package/node_modules/nostr-tools/lib/types/core.d.ts +5 -0
  133. package/node_modules/nostr-tools/lib/types/nip29.d.ts +243 -3
  134. package/node_modules/nostr-tools/lib/types/nip29.test.d.ts +1 -0
  135. package/node_modules/nostr-tools/package.json +1 -1
  136. package/openclaw.plugin.json +24 -0
  137. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- import { t as buzzPlugin } from "./channel-CCmyE6Yq.js";
1
+ import { t as buzzPlugin } from "./channel-BulZqShF.js";
2
2
  export { buzzPlugin };
@@ -1,4 +1,4 @@
1
- import { d as parseBuzzTarget, r as resolveBuzzAccount, s as buildBuzzTarget } from "./types-CPFsIZ5Z.js";
1
+ import { c as buildBuzzTarget, f as parseBuzzTarget, i as resolveBuzzAccount } from "./types-BN_HOsnq.js";
2
2
  //#region extensions/buzz/src/directory-config.ts
3
3
  function applyQueryAndLimit(entries, params) {
4
4
  const query = params.query?.trim().toLowerCase() ?? "";
@@ -1,4 +1,4 @@
1
- import { n as listBuzzDirectoryPeersFromConfig, t as listBuzzDirectoryGroupsFromConfig } from "./directory-config-BXa3Vqzu.js";
1
+ import { n as listBuzzDirectoryPeersFromConfig, t as listBuzzDirectoryGroupsFromConfig } from "./directory-config-BesCse0q.js";
2
2
  //#region extensions/buzz/directory-contract-api.ts
3
3
  const buzzDirectoryContractPlugin = {
4
4
  id: "buzz",
@@ -1,7 +1,7 @@
1
1
  import { createLazyCliRuntimeLoader, createLiveTransportQaCliRegistration, runLiveTransportQaSuiteCommand } from "openclaw/plugin-sdk/qa-runner-runtime";
2
2
  //#region extensions/buzz/src/qa/cli.ts
3
3
  const DEFAULT_BUZZ_QA_SCENARIOS = ["channel-canary", "channel-mention-gating"];
4
- const loadBuzzQaAdapterRuntime = createLazyCliRuntimeLoader(() => import("./adapter.runtime-D0uEmTwf.js"));
4
+ const loadBuzzQaAdapterRuntime = createLazyCliRuntimeLoader(() => import("./adapter.runtime-DA6guOQ_.js"));
5
5
  async function runQaBuzz(options) {
6
6
  await runLiveTransportQaSuiteCommand({
7
7
  channelId: "buzz",
@@ -23,7 +23,7 @@ const qaRunnerCliRegistrations = [createLiveTransportQaCliRegistration({
23
23
  }
24
24
  },
25
25
  credentialOptions: {
26
- sourceDescription: "Credential source for Buzz QA: file or convex (default: file)",
26
+ sourceDescription: "Credential source for Buzz QA: file or convex (default: file with --credential-file; otherwise shared environment)",
27
27
  roleDescription: "Credential role for convex auth: maintainer or ci (default: ci in CI, maintainer otherwise)"
28
28
  },
29
29
  defaultProviderMode: "mock-openai",
@@ -1,8 +1,9 @@
1
- import { o as BUZZ_CHANNEL_ID_PATTERN } from "./types-CPFsIZ5Z.js";
1
+ import { s as BUZZ_CHANNEL_ID_PATTERN } from "./types-BN_HOsnq.js";
2
2
  import { Relay, finalizeEvent } from "nostr-tools";
3
+ import { readProviderJsonObjectResponse } from "openclaw/plugin-sdk/provider-http";
3
4
  import { fetchWithSsrFGuard, ssrfPolicyFromHttpBaseUrlAllowedOrigin } from "openclaw/plugin-sdk/ssrf-runtime";
4
5
  //#region extensions/buzz/src/relay-subscription.ts
5
- function openBuzzRelaySubscription(relay, filters, params) {
6
+ function openBuzzRelaySubscription(relay, filters, params, requestFilters = filters) {
6
7
  relay.idleSince = void 0;
7
8
  relay.ongoingOperations += 1;
8
9
  let subscription;
@@ -19,7 +20,7 @@ function openBuzzRelaySubscription(relay, filters, params) {
19
20
  const frame = JSON.stringify([
20
21
  "REQ",
21
22
  subscription.id,
22
- ...filters
23
+ ...requestFilters
23
24
  ]);
24
25
  relay.send(frame).catch((error) => {
25
26
  if (subscription.closed || relay.openSubs.get(subscription.id) !== subscription) return;
@@ -28,6 +29,55 @@ function openBuzzRelaySubscription(relay, filters, params) {
28
29
  });
29
30
  return subscription;
30
31
  }
32
+ async function queryBuzzRelaySnapshot(params) {
33
+ return await new Promise((resolve, reject) => {
34
+ let settled = false;
35
+ let receivedEose = false;
36
+ let subscriptionClosed = false;
37
+ let subscription;
38
+ const timeout = setTimeout(() => {
39
+ const error = new Error(params.timeoutMessage);
40
+ finish(error);
41
+ params.onTimeout?.(error);
42
+ if (params.closeRelayOnTimeout !== false) params.relay.close();
43
+ }, params.timeoutMs ?? 1e4);
44
+ const closeAfterRealEose = () => {
45
+ if (receivedEose && subscription && !subscriptionClosed) {
46
+ subscriptionClosed = true;
47
+ subscription.close(params.closeReason);
48
+ }
49
+ };
50
+ const finish = (error) => {
51
+ if (settled) return;
52
+ settled = true;
53
+ clearTimeout(timeout);
54
+ params.signal?.removeEventListener("abort", onAbort);
55
+ closeAfterRealEose();
56
+ if (error === void 0) resolve(params.result());
57
+ else reject(error instanceof Error ? error : new Error(params.failureMessage, { cause: error }));
58
+ };
59
+ const onAbort = () => finish(params.signal?.reason ?? new Error(params.abortMessage));
60
+ params.signal?.addEventListener("abort", onAbort, { once: true });
61
+ try {
62
+ subscription = openBuzzRelaySubscription(params.relay, params.filters, {
63
+ onevent: params.onEvent,
64
+ oneose: () => {
65
+ receivedEose = true;
66
+ if (settled) closeAfterRealEose();
67
+ else finish();
68
+ },
69
+ onclose: (reason) => {
70
+ if (reason !== params.closeReason) finish(new Error(params.closeMessage(reason)));
71
+ }
72
+ });
73
+ } catch (error) {
74
+ finish(error);
75
+ return;
76
+ }
77
+ closeAfterRealEose();
78
+ if (params.checkAbortAfterSubscribe && params.signal?.aborted) onAbort();
79
+ });
80
+ }
31
81
  //#endregion
32
82
  //#region extensions/buzz/src/relay-auth.ts
33
83
  const AUTH_CHALLENGE_TIMEOUT_MS = 2e4;
@@ -79,7 +129,7 @@ async function resolveBuzzRelayPublicKey(params) {
79
129
  await response.body?.cancel().catch(() => void 0);
80
130
  throw new Error(`Buzz relay information request failed with HTTP ${response.status}`);
81
131
  }
82
- const document = await response.json();
132
+ const document = await readProviderJsonObjectResponse(response, "Buzz relay information");
83
133
  const relayPublicKey = typeof document.self === "string" ? document.self.trim().toLowerCase() : "";
84
134
  if (HEX_PUBLIC_KEY_PATTERN$1.test(relayPublicKey)) return relayPublicKey;
85
135
  if (document.software === BUZZ_RELAY_SOFTWARE && isLoopbackRelayUrl(params.relayUrl)) return BUZZ_LOCAL_DEV_RELAY_PUBLIC_KEY;
@@ -221,4 +271,4 @@ function parseBuzzRoomMembershipChangeEvent(event, membership) {
221
271
  }
222
272
  }
223
273
  //#endregion
224
- export { parseBuzzRoomMembershipEvent as a, parseBuzzAuthTag as c, parseBuzzRoomMembershipChangeEvent as i, openBuzzRelaySubscription as l, BUZZ_ROOM_SYSTEM_KIND as n, connectAuthenticatedBuzzRelay as o, isNewerBuzzRoomMembership as r, connectAuthenticatedBuzzRelaySession as s, BUZZ_ROOM_MEMBERSHIP_KIND as t };
274
+ export { parseBuzzRoomMembershipEvent as a, parseBuzzAuthTag as c, parseBuzzRoomMembershipChangeEvent as i, openBuzzRelaySubscription as l, BUZZ_ROOM_SYSTEM_KIND as n, connectAuthenticatedBuzzRelay as o, isNewerBuzzRoomMembership as r, connectAuthenticatedBuzzRelaySession as s, BUZZ_ROOM_MEMBERSHIP_KIND as t, queryBuzzRelaySnapshot as u };
@@ -1,5 +1,5 @@
1
- import { a as resolveDefaultBuzzAccountId, n as listBuzzAccountIds, r as resolveBuzzAccount } from "./types-CPFsIZ5Z.js";
2
- import { a as BuzzConfigSchema, n as buzzSetupContract, t as buzzSetupWizard } from "./setup-surface-DCxlD2oY.js";
1
+ import { i as resolveBuzzAccount, o as resolveDefaultBuzzAccountId, r as listBuzzAccountIds } from "./types-BN_HOsnq.js";
2
+ import { a as BuzzConfigSchema, n as buzzSetupContract, t as buzzSetupWizard } from "./setup-surface-BvQgEJ7O.js";
3
3
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
4
4
  //#region extensions/buzz/src/channel.setup.ts
5
5
  const buzzSetupPlugin = {
@@ -1,5 +1,5 @@
1
- import { d as parseBuzzTarget, i as resolveBuzzPublicKey, o as BUZZ_CHANNEL_ID_PATTERN, r as resolveBuzzAccount, t as decodeBuzzPrivateKey } from "./types-CPFsIZ5Z.js";
2
- import { a as parseBuzzRoomMembershipEvent, c as parseBuzzAuthTag, l as openBuzzRelaySubscription, s as connectAuthenticatedBuzzRelaySession, t as BUZZ_ROOM_MEMBERSHIP_KIND } from "./room-membership-CNBlHjTj.js";
1
+ import { a as resolveBuzzPublicKey, f as parseBuzzTarget, i as resolveBuzzAccount, n as decodeBuzzPrivateKey, s as BUZZ_CHANNEL_ID_PATTERN } from "./types-BN_HOsnq.js";
2
+ import { a as parseBuzzRoomMembershipEvent, c as parseBuzzAuthTag, l as openBuzzRelaySubscription, s as connectAuthenticatedBuzzRelaySession, t as BUZZ_ROOM_MEMBERSHIP_KIND, u as queryBuzzRelaySnapshot } from "./room-membership-DSAkyE0a.js";
3
3
  import { GroupPolicySchema, MarkdownConfigSchema, buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
4
4
  import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
5
5
  import { z } from "zod";
@@ -12,12 +12,15 @@ import { isIP } from "node:net";
12
12
  //#region extensions/buzz/src/config-schema.ts
13
13
  const BuzzGroupConfigSchema = z.object({
14
14
  enabled: z.boolean().optional(),
15
- requireMention: z.boolean().optional()
15
+ requireMention: z.boolean().optional(),
16
+ groupPolicy: GroupPolicySchema.optional(),
17
+ groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional()
16
18
  }).strict();
17
19
  const BuzzConfigSchema = buildChannelConfigSchema(z.object({
18
20
  name: z.string().optional(),
19
21
  enabled: z.boolean().optional(),
20
22
  configWrites: z.boolean().optional(),
23
+ responsePrefix: z.string().optional(),
21
24
  markdown: MarkdownConfigSchema,
22
25
  relayUrl: z.string().url().and(z.string().regex(/^[wW][sS][sS]?:\/\//, "Buzz relay URL must use ws:// or wss://")).optional(),
23
26
  privateKey: buildSecretInputSchema().optional(),
@@ -78,44 +81,19 @@ function tagValue(event, name) {
78
81
  }
79
82
  async function queryRelay(params) {
80
83
  params.signal?.throwIfAborted();
81
- return await new Promise((resolve, reject) => {
82
- const events = [];
83
- const state = {
84
- settled: false,
85
- receivedEose: false
86
- };
87
- const finish = (error) => {
88
- if (state.settled) return;
89
- state.settled = true;
90
- if (state.timeout) clearTimeout(state.timeout);
91
- params.signal?.removeEventListener("abort", onAbort);
92
- if (state.receivedEose) state.subscription?.close("query complete");
93
- if (error !== void 0) reject(error instanceof Error ? error : new Error("Buzz room query failed", { cause: error }));
94
- else resolve(events);
95
- };
96
- const onAbort = () => finish(params.signal?.reason ?? /* @__PURE__ */ new Error("Buzz room query aborted"));
97
- params.signal?.addEventListener("abort", onAbort, { once: true });
98
- state.timeout = setTimeout(() => {
99
- finish(/* @__PURE__ */ new Error("Timed out querying Buzz room membership"));
100
- params.relay.close();
101
- }, params.timeoutMs);
102
- try {
103
- state.subscription = openBuzzRelaySubscription(params.relay, [params.filter], {
104
- onevent: (event) => events.push(event),
105
- oneose: () => {
106
- state.receivedEose = true;
107
- if (state.settled) state.subscription?.close("query complete");
108
- else finish();
109
- },
110
- onclose: (reason) => {
111
- if (reason !== "query complete") finish(/* @__PURE__ */ new Error(`Buzz room query closed: ${reason}`));
112
- }
113
- });
114
- } catch (error) {
115
- finish(error);
116
- return;
117
- }
118
- if (state.settled && state.receivedEose) state.subscription.close("query complete");
84
+ const events = [];
85
+ return await queryBuzzRelaySnapshot({
86
+ relay: params.relay,
87
+ filters: [params.filter],
88
+ signal: params.signal,
89
+ timeoutMs: params.timeoutMs,
90
+ timeoutMessage: "Timed out querying Buzz room membership",
91
+ abortMessage: "Buzz room query aborted",
92
+ failureMessage: "Buzz room query failed",
93
+ closeReason: "query complete",
94
+ closeMessage: (reason) => `Buzz room query closed: ${reason}`,
95
+ onEvent: (event) => events.push(event),
96
+ result: () => events
119
97
  });
120
98
  }
121
99
  async function discoverBuzzRoomsOnRelay(params) {
@@ -238,7 +216,6 @@ const buzzSetupContract = defineChannelSetupContract({
238
216
  }
239
217
  },
240
218
  adapter: {
241
- resolveAccountId: () => DEFAULT_ACCOUNT_ID$1,
242
219
  applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
243
220
  cfg,
244
221
  channelKey: "buzz",
@@ -776,6 +753,7 @@ function createBuzzSetupWizard(dependencies = {}) {
776
753
  groupAllowFrom: void 0
777
754
  } : {},
778
755
  groups: Object.fromEntries(roomIds.map((roomId) => [roomId, {
756
+ ...configuredGroups[roomId],
779
757
  enabled: configuredGroups[roomId]?.enabled ?? true,
780
758
  requireMention: configuredGroups[roomId]?.requireMention ?? !useFreshAccessDefaults
781
759
  }])),
@@ -1,6 +1,7 @@
1
- import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
1
+ import { hasConfiguredSecretInput, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
2
2
  import { getPublicKey, nip19 } from "nostr-tools";
3
3
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
4
+ import { assertSecretOwnerAvailable } from "openclaw/plugin-sdk/channel-secret-owner-runtime";
4
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
6
  //#region extensions/buzz/src/target.ts
6
7
  const BUZZ_CHANNEL_ID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/u;
@@ -66,8 +67,15 @@ function resolveBuzzAccount(params) {
66
67
  groups: normalizeBuzzGroups(rawConfig.groups)
67
68
  };
68
69
  const relayUrl = config.relayUrl?.trim() || process.env.BUZZ_RELAY_URL?.trim() || "";
69
- const privateKey = normalizeSecretInputString(config.privateKey) || process.env.BUZZ_PRIVATE_KEY?.trim() || "";
70
- const authTag = normalizeSecretInputString(config.authTag) || process.env.BUZZ_AUTH_TAG?.trim() || "";
70
+ const resolveCredential = (field) => resolveSecretInputString({
71
+ value: config[field],
72
+ path: `channels.buzz.${field}`,
73
+ mode: "inspect"
74
+ });
75
+ const privateKeyResolution = resolveCredential("privateKey");
76
+ const authTagResolution = resolveCredential("authTag");
77
+ const privateKey = privateKeyResolution.value ?? (privateKeyResolution.status === "missing" ? process.env.BUZZ_PRIVATE_KEY?.trim() || "" : "");
78
+ const authTag = authTagResolution.value ?? (authTagResolution.status === "missing" ? process.env.BUZZ_AUTH_TAG?.trim() || "" : "");
71
79
  let publicKey = "";
72
80
  if (privateKey) try {
73
81
  publicKey = resolveBuzzPublicKey(privateKey);
@@ -76,13 +84,18 @@ function resolveBuzzAccount(params) {
76
84
  accountId: DEFAULT_ACCOUNT_ID,
77
85
  name: normalizeOptionalString(config.name) ?? "OpenClaw",
78
86
  enabled: config.enabled !== false,
79
- configured: Boolean(relayUrl && privateKey),
87
+ configured: Boolean(relayUrl && (privateKey || privateKeyResolution.ref)),
80
88
  relayUrl,
81
89
  privateKey,
82
90
  authTag,
83
91
  publicKey,
92
+ tokenStatus: privateKeyResolution.ref || authTagResolution.ref ? "configured_unavailable" : privateKey ? "available" : "missing",
84
93
  config
85
94
  };
86
95
  }
96
+ function assertBuzzAccountAvailable(account) {
97
+ assertSecretOwnerAvailable("account", `buzz:${account.accountId}`);
98
+ if (account.tokenStatus === "configured_unavailable") throw new Error(`Buzz credentials for account "${account.accountId}" are configured but unavailable.`);
99
+ }
87
100
  //#endregion
88
- export { resolveDefaultBuzzAccountId as a, isConfiguredBuzzChannel as c, parseBuzzTarget as d, resolveBuzzPublicKey as i, looksLikeBuzzTarget as l, listBuzzAccountIds as n, BUZZ_CHANNEL_ID_PATTERN as o, resolveBuzzAccount as r, buildBuzzTarget as s, decodeBuzzPrivateKey as t, normalizeBuzzTarget as u };
101
+ export { resolveBuzzPublicKey as a, buildBuzzTarget as c, normalizeBuzzTarget as d, parseBuzzTarget as f, resolveBuzzAccount as i, isConfiguredBuzzChannel as l, decodeBuzzPrivateKey as n, resolveDefaultBuzzAccountId as o, listBuzzAccountIds as r, BUZZ_CHANNEL_ID_PATTERN as s, assertBuzzAccountAvailable as t, looksLikeBuzzTarget as u };
@@ -650,10 +650,12 @@ var Subscription = class {
650
650
  this.closed = true;
651
651
  }
652
652
  this.relay.openSubs.delete(this.id);
653
- this.relay.ongoingOperations--;
654
- if (this.relay.ongoingOperations === 0) {
655
- this.relay.idleSince = Date.now();
656
- this.relay.scheduleIdleClose();
653
+ if (!this.id.startsWith("<forced-ping>")) {
654
+ this.relay.ongoingOperations--;
655
+ if (this.relay.ongoingOperations === 0) {
656
+ this.relay.idleSince = Date.now();
657
+ this.relay.scheduleIdleClose();
658
+ }
657
659
  }
658
660
  this.onclose?.(reason);
659
661
  }
@@ -1004,7 +1006,7 @@ var AbstractSimplePool = class {
1004
1006
  });
1005
1007
  } catch (err) {
1006
1008
  this.onRelayConnectionFailure?.(url);
1007
- return String("connection failure: " + String(err));
1009
+ return Promise.reject("connection failure: " + String(err));
1008
1010
  }
1009
1011
  return r.publish(event).catch(async (err) => {
1010
1012
  if (err instanceof Error && err.message.startsWith("auth-required: ") && params?.onauth) {