@openclaw/buzz 2026.9.1-beta.1 → 2026.9.2

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 (63) hide show
  1. package/dist/{adapter.runtime-DA6guOQ_.js → adapter.runtime-CaDdxQ2C.js} +4 -4
  2. package/dist/api.js +2 -2
  3. package/dist/{channel-BulZqShF.js → channel-Czma0_CC.js} +200 -66
  4. package/dist/channel-plugin-api.js +1 -1
  5. package/dist/{directory-config-BesCse0q.js → directory-config-B0shiBa4.js} +1 -1
  6. package/dist/directory-contract-api.js +1 -1
  7. package/dist/{message-event-CFw7gGLi.js → message-event-X_aBiM1X.js} +5 -8
  8. package/dist/qa-runner-api.js +1 -1
  9. package/dist/{room-membership-DSAkyE0a.js → room-membership-a8IHfdgL.js} +7 -5
  10. package/dist/secret-contract-DNuqbK64.js +50 -0
  11. package/dist/secret-contract-api.js +1 -1
  12. package/dist/setup-plugin-api.js +6 -3
  13. package/dist/{setup-surface-BvQgEJ7O.js → setup-surface-DDUmAluL.js} +197 -170
  14. package/dist/types-CeupBG0P.js +160 -0
  15. package/node_modules/nostr-tools/lib/cjs/index.js +21 -5
  16. package/node_modules/nostr-tools/lib/cjs/index.js.map +2 -2
  17. package/node_modules/nostr-tools/lib/cjs/nip17.js +19 -3
  18. package/node_modules/nostr-tools/lib/cjs/nip17.js.map +2 -2
  19. package/node_modules/nostr-tools/lib/cjs/nip46.js +7 -3
  20. package/node_modules/nostr-tools/lib/cjs/nip46.js.map +2 -2
  21. package/node_modules/nostr-tools/lib/cjs/nip59.js +19 -3
  22. package/node_modules/nostr-tools/lib/cjs/nip59.js.map +2 -2
  23. package/node_modules/nostr-tools/lib/cjs/nip98.js +1 -1
  24. package/node_modules/nostr-tools/lib/cjs/nip98.js.map +2 -2
  25. package/node_modules/nostr-tools/lib/cjs/nipad.js +55 -0
  26. package/node_modules/nostr-tools/lib/cjs/nipad.js.map +7 -0
  27. package/node_modules/nostr-tools/lib/cjs/nipb7.js +1003 -98
  28. package/node_modules/nostr-tools/lib/cjs/nipb7.js.map +4 -4
  29. package/node_modules/nostr-tools/lib/cjs/relay.js +1 -1
  30. package/node_modules/nostr-tools/lib/cjs/relay.js.map +2 -2
  31. package/node_modules/nostr-tools/lib/esm/index.js +21 -5
  32. package/node_modules/nostr-tools/lib/esm/index.js.map +2 -2
  33. package/node_modules/nostr-tools/lib/esm/nip17.js +19 -3
  34. package/node_modules/nostr-tools/lib/esm/nip17.js.map +2 -2
  35. package/node_modules/nostr-tools/lib/esm/nip46.js +7 -3
  36. package/node_modules/nostr-tools/lib/esm/nip46.js.map +2 -2
  37. package/node_modules/nostr-tools/lib/esm/nip59.js +19 -3
  38. package/node_modules/nostr-tools/lib/esm/nip59.js.map +2 -2
  39. package/node_modules/nostr-tools/lib/esm/nip98.js +1 -1
  40. package/node_modules/nostr-tools/lib/esm/nip98.js.map +2 -2
  41. package/node_modules/nostr-tools/lib/esm/nipad.js +34 -0
  42. package/node_modules/nostr-tools/lib/esm/nipad.js.map +7 -0
  43. package/node_modules/nostr-tools/lib/esm/nipb7.js +1009 -98
  44. package/node_modules/nostr-tools/lib/esm/nipb7.js.map +4 -4
  45. package/node_modules/nostr-tools/lib/esm/relay.js +1 -1
  46. package/node_modules/nostr-tools/lib/esm/relay.js.map +2 -2
  47. package/node_modules/nostr-tools/lib/nostr.bundle.js +21 -5
  48. package/node_modules/nostr-tools/lib/nostr.bundle.js.map +2 -2
  49. package/node_modules/nostr-tools/lib/types/nip98.d.ts +1 -1
  50. package/node_modules/nostr-tools/lib/types/nipad.d.ts +16 -0
  51. package/node_modules/nostr-tools/lib/types/nipb7.d.ts +112 -5
  52. package/node_modules/nostr-tools/lib/types/relay.d.ts +1 -1
  53. package/node_modules/nostr-tools/package.json +7 -7
  54. package/openclaw.plugin.json +346 -0
  55. package/package.json +8 -5
  56. package/dist/secret-contract-D19RiJv_.js +0 -12
  57. package/dist/types-BN_HOsnq.js +0 -101
  58. package/node_modules/nostr-tools/lib/cjs/nipb0.js +0 -1087
  59. package/node_modules/nostr-tools/lib/cjs/nipb0.js.map +0 -7
  60. package/node_modules/nostr-tools/lib/esm/nipb0.js +0 -1072
  61. package/node_modules/nostr-tools/lib/esm/nipb0.js.map +0 -7
  62. package/node_modules/nostr-tools/lib/types/nipb0.d.ts +0 -128
  63. /package/node_modules/nostr-tools/lib/types/{nipb0.test.d.ts → nip46.test.d.ts} +0 -0
@@ -1,101 +0,0 @@
1
- import { hasConfiguredSecretInput, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
2
- import { getPublicKey, nip19 } from "nostr-tools";
3
- import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
4
- import { assertSecretOwnerAvailable } from "openclaw/plugin-sdk/channel-secret-owner-runtime";
5
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
- //#region extensions/buzz/src/target.ts
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;
8
- function normalizeBuzzTarget(target) {
9
- return target.trim().replace(/^buzz:/iu, "").replace(/^channel:/iu, "");
10
- }
11
- function parseBuzzTarget(target) {
12
- const channelId = normalizeBuzzTarget(target);
13
- if (!BUZZ_CHANNEL_ID_PATTERN.test(channelId)) throw new Error("Buzz target must be a channel UUID");
14
- return channelId.toLowerCase();
15
- }
16
- function isConfiguredBuzzChannel(configuredChannelIds, channelId) {
17
- try {
18
- return configuredChannelIds.has(parseBuzzTarget(channelId));
19
- } catch {
20
- return false;
21
- }
22
- }
23
- function buildBuzzTarget(channelId) {
24
- return `buzz:${parseBuzzTarget(channelId)}`;
25
- }
26
- function looksLikeBuzzTarget(target) {
27
- try {
28
- parseBuzzTarget(target);
29
- return true;
30
- } catch {
31
- return false;
32
- }
33
- }
34
- //#endregion
35
- //#region extensions/buzz/src/types.ts
36
- function resolveChannelConfig(cfg) {
37
- return cfg.channels?.buzz;
38
- }
39
- function normalizeBuzzGroups(groups) {
40
- if (!groups) return;
41
- return Object.fromEntries(Object.entries(groups).map(([channelId, group]) => [parseBuzzTarget(channelId), group]));
42
- }
43
- function decodeBuzzPrivateKey(value) {
44
- const trimmed = value.trim();
45
- if (/^[0-9a-f]{64}$/iu.test(trimmed)) return Uint8Array.from(Buffer.from(trimmed, "hex"));
46
- const decoded = nip19.decode(trimmed);
47
- if (decoded.type !== "nsec") throw new Error("Buzz private key must be nsec or 64-character hex");
48
- return decoded.data;
49
- }
50
- function resolveBuzzPublicKey(privateKey) {
51
- return getPublicKey(decodeBuzzPrivateKey(privateKey));
52
- }
53
- function listBuzzAccountIds(cfg) {
54
- const config = resolveChannelConfig(cfg);
55
- const relayUrl = config?.relayUrl?.trim() || process.env.BUZZ_RELAY_URL?.trim();
56
- const privateKeyConfigured = hasConfiguredSecretInput(config?.privateKey, cfg.secrets?.defaults) || Boolean(process.env.BUZZ_PRIVATE_KEY?.trim());
57
- return relayUrl || privateKeyConfigured ? [DEFAULT_ACCOUNT_ID] : [];
58
- }
59
- function resolveDefaultBuzzAccountId(_cfg) {
60
- return DEFAULT_ACCOUNT_ID;
61
- }
62
- function resolveBuzzAccount(params) {
63
- const rawConfig = resolveChannelConfig(params.cfg) ?? {};
64
- const config = {
65
- ...rawConfig,
66
- groupPolicy: rawConfig.groupPolicy ?? "allowlist",
67
- groups: normalizeBuzzGroups(rawConfig.groups)
68
- };
69
- const relayUrl = config.relayUrl?.trim() || process.env.BUZZ_RELAY_URL?.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() || "" : "");
79
- let publicKey = "";
80
- if (privateKey) try {
81
- publicKey = resolveBuzzPublicKey(privateKey);
82
- } catch {}
83
- return {
84
- accountId: DEFAULT_ACCOUNT_ID,
85
- name: normalizeOptionalString(config.name) ?? "OpenClaw",
86
- enabled: config.enabled !== false,
87
- configured: Boolean(relayUrl && (privateKey || privateKeyResolution.ref)),
88
- relayUrl,
89
- privateKey,
90
- authTag,
91
- publicKey,
92
- tokenStatus: privateKeyResolution.ref || authTagResolution.ref ? "configured_unavailable" : privateKey ? "available" : "missing",
93
- config
94
- };
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
- }
100
- //#endregion
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 };