@openclaw/buzz 2026.9.5 → 2026.9.7
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.
- package/assets/icon.png +0 -0
- package/dist/.setup/{adapter.runtime-FIC9NMFI.mjs → adapter.runtime-Bpx9a0g6.mjs} +2 -2
- package/dist/.setup/{channel-BVHkrP3Z.mjs → channel-B7r1381j.mjs} +88 -245
- package/dist/.setup/directory-config-M9KSexdh.mjs +24 -0
- package/dist/.setup/directory-query-D1BNu8nO.mjs +22 -0
- package/dist/.setup/room-membership-7of91SyC.mjs +537 -0
- package/dist/.setup/{secret-contract-DjibkTDL.mjs → secret-contract-B2-Mrm4v.mjs} +1 -1
- package/dist/.setup/{secret-contract-api-DcFDI-eR.mjs → secret-contract-api-CfJYRXZf.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-CtM1M1Oa.mjs +2 -0
- package/dist/.setup/{setup-plugin-api-DI8WfvKQ.mjs → setup-plugin-api-m1pk2Cow.mjs} +2 -2
- package/dist/.setup/{setup-surface-DOHxdPor.mjs → setup-surface-CVXY6_50.mjs} +10 -24
- package/dist/.setup/{types-CeupBG0P.mjs → types-DRUZMyTx.mjs} +10 -2
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/qa-runner-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-entry.js +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +44 -28
- package/node_modules/zod/src/v4/core/checks.ts +62 -102
- package/node_modules/zod/src/v4/core/compile.ts +218 -93
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
- package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +14 -4
- package/node_modules/zod/src/v4/core/schemas.ts +296 -132
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
- package/node_modules/zod/src/v4/core/util.ts +218 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/ar.ts +2 -0
- package/node_modules/zod/src/v4/locales/az.ts +2 -0
- package/node_modules/zod/src/v4/locales/be.ts +2 -0
- package/node_modules/zod/src/v4/locales/bg.ts +2 -0
- package/node_modules/zod/src/v4/locales/bn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ca.ts +2 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
- package/node_modules/zod/src/v4/locales/cs.ts +2 -0
- package/node_modules/zod/src/v4/locales/da.ts +2 -0
- package/node_modules/zod/src/v4/locales/de.ts +2 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +2 -0
- package/node_modules/zod/src/v4/locales/eo.ts +2 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +2 -0
- package/node_modules/zod/src/v4/locales/fi.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr.ts +2 -0
- package/node_modules/zod/src/v4/locales/gu.ts +2 -0
- package/node_modules/zod/src/v4/locales/he.ts +2 -0
- package/node_modules/zod/src/v4/locales/hi.ts +2 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +2 -0
- package/node_modules/zod/src/v4/locales/hy.ts +2 -0
- package/node_modules/zod/src/v4/locales/id.ts +2 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +2 -0
- package/node_modules/zod/src/v4/locales/it.ts +2 -0
- package/node_modules/zod/src/v4/locales/ja.ts +2 -0
- package/node_modules/zod/src/v4/locales/ka.ts +2 -0
- package/node_modules/zod/src/v4/locales/km.ts +2 -0
- package/node_modules/zod/src/v4/locales/kn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ko.ts +2 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ms.ts +2 -0
- package/node_modules/zod/src/v4/locales/ne.ts +2 -0
- package/node_modules/zod/src/v4/locales/nl.ts +2 -0
- package/node_modules/zod/src/v4/locales/nn.ts +2 -0
- package/node_modules/zod/src/v4/locales/no.ts +2 -0
- package/node_modules/zod/src/v4/locales/ota.ts +2 -0
- package/node_modules/zod/src/v4/locales/pl.ts +2 -0
- package/node_modules/zod/src/v4/locales/ps.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt.ts +2 -0
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +2 -0
- package/node_modules/zod/src/v4/locales/sk.ts +2 -0
- package/node_modules/zod/src/v4/locales/sl.ts +2 -0
- package/node_modules/zod/src/v4/locales/sv.ts +2 -0
- package/node_modules/zod/src/v4/locales/ta.ts +2 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +2 -0
- package/node_modules/zod/src/v4/locales/tk.ts +2 -0
- package/node_modules/zod/src/v4/locales/tr.ts +2 -0
- package/node_modules/zod/src/v4/locales/uk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ur.ts +2 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +2 -0
- package/node_modules/zod/src/v4/locales/yo.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.d.cts +12 -6
- package/node_modules/zod/v4/core/api.d.ts +12 -6
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.d.cts +17 -1
- package/node_modules/zod/v4/core/checks.d.ts +17 -1
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +111 -23
- package/node_modules/zod/v4/core/memoizer.js +69 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.d.cts +3 -0
- package/node_modules/zod/v4/core/regexes.d.ts +3 -0
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.d.cts +28 -8
- package/node_modules/zod/v4/core/schemas.d.ts +28 -8
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +156 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +19 -3
- package/package.json +5 -5
- package/dist/.setup/directory-config-CzHz6fzo.mjs +0 -43
- package/dist/.setup/room-membership-tqLQznFE.mjs +0 -276
- package/dist/.setup/setup-plugin-api-H-XWBzaF.mjs +0 -2
- package/dist/runtime-api.js +0 -1
package/assets/icon.png
CHANGED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as parseBuzzTarget, n as decodeBuzzPrivateKey, o as resolveBuzzPublicKey, u as buildBuzzTarget } from "./types-
|
|
2
|
-
import { c as openBuzzRelaySubscription, i as parseBuzzRoomMembershipEvent, o as connectAuthenticatedBuzzRelaySession, s as parseBuzzAuthTag, t as BUZZ_ROOM_MEMBERSHIP_KIND
|
|
1
|
+
import { m as parseBuzzTarget, n as decodeBuzzPrivateKey, o as resolveBuzzPublicKey, u as buildBuzzTarget } from "./types-DRUZMyTx.mjs";
|
|
2
|
+
import { c as openBuzzRelaySubscription, i as parseBuzzRoomMembershipEvent, m as isNewerBuzzRevision, o as connectAuthenticatedBuzzRelaySession, s as parseBuzzAuthTag, t as BUZZ_ROOM_MEMBERSHIP_KIND } from "./room-membership-7of91SyC.mjs";
|
|
3
3
|
import { i as buildBuzzMessageTags, s as parseBuzzMessageEvent } from "./message-event-X_aBiM1X.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { finalizeEvent } from "nostr-tools";
|
|
@@ -1,241 +1,28 @@
|
|
|
1
|
-
import { a as resolveBuzzAccountConfig, c as BuzzConfigSchema, d as isConfiguredBuzzChannel, f as looksLikeBuzzTarget, i as resolveBuzzAccount, m as parseBuzzTarget, n as decodeBuzzPrivateKey, o as resolveBuzzPublicKey, p as normalizeBuzzTarget, r as listBuzzAccountIds, s as resolveDefaultBuzzAccountId, t as assertBuzzAccountAvailable, u as buildBuzzTarget } from "./types-
|
|
2
|
-
import { n as listBuzzDirectoryPeersFromConfig,
|
|
3
|
-
import { a as connectAuthenticatedBuzzRelay, c as openBuzzRelaySubscription, i as parseBuzzRoomMembershipEvent, l as queryBuzzRelaySnapshot, n as BUZZ_ROOM_SYSTEM_KIND, o as connectAuthenticatedBuzzRelaySession, r as parseBuzzRoomMembershipChangeEvent, s as parseBuzzAuthTag, t as BUZZ_ROOM_MEMBERSHIP_KIND, u as
|
|
1
|
+
import { a as resolveBuzzAccountConfig, c as BuzzConfigSchema, d as isConfiguredBuzzChannel, f as looksLikeBuzzTarget, i as resolveBuzzAccount, m as parseBuzzTarget, n as decodeBuzzPrivateKey, o as resolveBuzzPublicKey, p as normalizeBuzzTarget, r as listBuzzAccountIds, s as resolveDefaultBuzzAccountId, t as assertBuzzAccountAvailable, u as buildBuzzTarget } from "./types-DRUZMyTx.mjs";
|
|
2
|
+
import { n as listBuzzDirectoryPeersFromConfig, t as listBuzzDirectoryGroupsFromConfig } from "./directory-config-M9KSexdh.mjs";
|
|
3
|
+
import { a as connectAuthenticatedBuzzRelay, c as openBuzzRelaySubscription, d as resolveBuzzSubscriptionBudget, f as BUZZ_ROOM_METADATA_KIND, i as parseBuzzRoomMembershipEvent, l as queryBuzzRelaySnapshot, m as isNewerBuzzRevision, n as BUZZ_ROOM_SYSTEM_KIND, o as connectAuthenticatedBuzzRelaySession, p as BuzzDirectoryState, r as parseBuzzRoomMembershipChangeEvent, s as parseBuzzAuthTag, t as BUZZ_ROOM_MEMBERSHIP_KIND, u as BUZZ_MAX_CONFIGURED_ROOMS } from "./room-membership-7of91SyC.mjs";
|
|
4
4
|
import { a as formatBuzzMessageForAgent, c as inspectBuzzMentionSyntax, i as buildBuzzMessageTags, l as resolveBuzzMessageMentions, n as BUZZ_INBOUND_MESSAGE_KINDS, o as isBuzzInboundMessageKind, r as BUZZ_TYPING_INDICATOR_KIND, s as parseBuzzMessageEvent, t as BUZZ_DIFF_MESSAGE_KIND } from "./message-event-X_aBiM1X.mjs";
|
|
5
|
-
import { i as startBuzzRoomMembershipNotifications, n as buzzSetupContract, r as discoverBuzzRooms, t as buzzSetupWizard } from "./setup-surface-
|
|
6
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
5
|
+
import { i as startBuzzRoomMembershipNotifications, n as buzzSetupContract, r as discoverBuzzRooms, t as buzzSetupWizard } from "./setup-surface-CVXY6_50.mjs";
|
|
6
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-B2-Mrm4v.mjs";
|
|
7
7
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
8
8
|
import { buildChannelOutboundSessionRoute, buildThreadAwareOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
9
9
|
import { createChannelMessageAdapterFromOutbound, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
10
|
import { createChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
11
11
|
import { parseThreadSessionSuffix } from "openclaw/plugin-sdk/routing";
|
|
12
12
|
import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
13
|
-
import { compareEvents, finalizeEvent } from "nostr-tools";
|
|
13
|
+
import { compareEvents, finalizeEvent, verifyEvent } from "nostr-tools";
|
|
14
14
|
import { chunkItems } from "openclaw/plugin-sdk/text-chunking";
|
|
15
|
-
import {
|
|
15
|
+
import { truncateUtf8Prefix } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
16
16
|
import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
17
17
|
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
21
|
import { buildChannelInboundEventContext, logInboundDrop, recordDroppedChannelInboundHistory, resolveChannelInboundRouteEnvelope } from "openclaw/plugin-sdk/channel-inbound";
|
|
22
|
-
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
23
22
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/logging-core";
|
|
24
23
|
import { buildHistoryContext, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
25
24
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
26
25
|
import { createHash } from "node:crypto";
|
|
27
|
-
const BUZZ_ROOM_METADATA_KIND = 39e3;
|
|
28
|
-
const DEFAULT_BUZZ_DIRECTORY_PROFILE_LIMIT = 2e3;
|
|
29
|
-
const HEX_PUBLIC_KEY_PATTERN = /^[0-9a-f]{64}$/u;
|
|
30
|
-
const MAX_DIRECTORY_NAME_CHARS = 512;
|
|
31
|
-
const MAX_DIRECTORY_HANDLE_CHARS = 320;
|
|
32
|
-
const MAX_DIRECTORY_URL_CHARS = 4096;
|
|
33
|
-
function normalizeBoundedString(value, maxChars) {
|
|
34
|
-
if (typeof value !== "string") return;
|
|
35
|
-
const trimmed = value.trim();
|
|
36
|
-
if (!trimmed) return;
|
|
37
|
-
return truncateUtf16Safe(trimmed, maxChars);
|
|
38
|
-
}
|
|
39
|
-
function readPreferredString(params) {
|
|
40
|
-
if (Object.hasOwn(params.content, params.primary)) return normalizeBoundedString(params.content[params.primary], params.maxChars);
|
|
41
|
-
return normalizeBoundedString(params.content[params.fallback], params.maxChars);
|
|
42
|
-
}
|
|
43
|
-
function fallbackPublicKeyLabel(publicKey) {
|
|
44
|
-
return `${publicKey.slice(0, 8)}...${publicKey.slice(-6)}`;
|
|
45
|
-
}
|
|
46
|
-
function parseBuzzDirectoryProfileEvent(event) {
|
|
47
|
-
const publicKey = event.pubkey.trim().toLowerCase();
|
|
48
|
-
if (event.kind !== 0 || !HEX_PUBLIC_KEY_PATTERN.test(publicKey)) return;
|
|
49
|
-
let content;
|
|
50
|
-
try {
|
|
51
|
-
const parsed = JSON.parse(event.content);
|
|
52
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return;
|
|
53
|
-
content = parsed;
|
|
54
|
-
} catch {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
publicKey,
|
|
59
|
-
displayName: readPreferredString({
|
|
60
|
-
content,
|
|
61
|
-
primary: "display_name",
|
|
62
|
-
fallback: "name",
|
|
63
|
-
maxChars: MAX_DIRECTORY_NAME_CHARS
|
|
64
|
-
}),
|
|
65
|
-
handle: normalizeBoundedString(content.nip05, MAX_DIRECTORY_HANDLE_CHARS),
|
|
66
|
-
avatarUrl: readPreferredString({
|
|
67
|
-
content,
|
|
68
|
-
primary: "picture",
|
|
69
|
-
fallback: "image",
|
|
70
|
-
maxChars: MAX_DIRECTORY_URL_CHARS
|
|
71
|
-
}),
|
|
72
|
-
createdAt: event.created_at,
|
|
73
|
-
eventId: event.id
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function parseBuzzDirectoryRoomEvent(event) {
|
|
77
|
-
if (event.kind !== 39e3) return;
|
|
78
|
-
const roomId = event.tags.find((tag) => tag[0] === "d")?.[1]?.trim().toLowerCase();
|
|
79
|
-
if (!roomId) return;
|
|
80
|
-
try {
|
|
81
|
-
parseBuzzTarget(roomId);
|
|
82
|
-
} catch {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
roomId,
|
|
87
|
-
name: normalizeBoundedString(event.tags.find((tag) => tag[0] === "name")?.[1], MAX_DIRECTORY_NAME_CHARS),
|
|
88
|
-
archived: event.tags.some((tag) => tag[0] === "archived" && tag[1] === "true"),
|
|
89
|
-
createdAt: event.created_at,
|
|
90
|
-
eventId: event.id
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
var BuzzDirectoryState = class {
|
|
94
|
-
#publicKey;
|
|
95
|
-
#fallbackProfileName;
|
|
96
|
-
#configuredRoomIds;
|
|
97
|
-
#profileLimit;
|
|
98
|
-
#memberships = /* @__PURE__ */ new Map();
|
|
99
|
-
#profilePublicKeys = /* @__PURE__ */ new Set();
|
|
100
|
-
#profiles = /* @__PURE__ */ new Map();
|
|
101
|
-
#rooms = /* @__PURE__ */ new Map();
|
|
102
|
-
constructor(params) {
|
|
103
|
-
this.#publicKey = params.publicKey.trim().toLowerCase();
|
|
104
|
-
this.#fallbackProfileName = params.fallbackProfileName.trim() || "OpenClaw";
|
|
105
|
-
this.#configuredRoomIds = new Set(params.channelIds.map(parseBuzzTarget));
|
|
106
|
-
const requestedProfileLimit = params.profileLimit ?? DEFAULT_BUZZ_DIRECTORY_PROFILE_LIMIT;
|
|
107
|
-
this.#profileLimit = Number.isFinite(requestedProfileLimit) && requestedProfileLimit >= 0 ? Math.floor(requestedProfileLimit) : DEFAULT_BUZZ_DIRECTORY_PROFILE_LIMIT;
|
|
108
|
-
if (this.#profileLimit > 0) this.#profilePublicKeys.add(this.#publicKey);
|
|
109
|
-
}
|
|
110
|
-
replaceMemberships(memberships) {
|
|
111
|
-
const nextMemberships = /* @__PURE__ */ new Map();
|
|
112
|
-
const memberPublicKeys = /* @__PURE__ */ new Set();
|
|
113
|
-
for (const roomId of this.#configuredRoomIds) {
|
|
114
|
-
const membership = memberships.get(roomId);
|
|
115
|
-
if (!membership) continue;
|
|
116
|
-
nextMemberships.set(roomId, membership);
|
|
117
|
-
for (const publicKey of membership.members) memberPublicKeys.add(publicKey);
|
|
118
|
-
}
|
|
119
|
-
memberPublicKeys.delete(this.#publicKey);
|
|
120
|
-
const nextProfilePublicKeys = this.#profileLimit === 0 ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([this.#publicKey, ...[...memberPublicKeys].toSorted().slice(0, this.#profileLimit - 1)]);
|
|
121
|
-
const profileSelectionChanged = nextProfilePublicKeys.size !== this.#profilePublicKeys.size || [...nextProfilePublicKeys].some((publicKey) => !this.#profilePublicKeys.has(publicKey));
|
|
122
|
-
this.#memberships = nextMemberships;
|
|
123
|
-
this.#profilePublicKeys = nextProfilePublicKeys;
|
|
124
|
-
for (const publicKey of this.#profiles.keys()) if (!nextProfilePublicKeys.has(publicKey)) this.#profiles.delete(publicKey);
|
|
125
|
-
return profileSelectionChanged;
|
|
126
|
-
}
|
|
127
|
-
profilePublicKeys() {
|
|
128
|
-
return [...this.#profilePublicKeys];
|
|
129
|
-
}
|
|
130
|
-
activeRoomIds() {
|
|
131
|
-
return [...this.#configuredRoomIds].filter((roomId) => !this.#rooms.get(roomId)?.archived);
|
|
132
|
-
}
|
|
133
|
-
isRoomArchived(roomId) {
|
|
134
|
-
return this.#rooms.get(parseBuzzTarget(roomId))?.archived === true;
|
|
135
|
-
}
|
|
136
|
-
isBotMember(roomId, publicKey) {
|
|
137
|
-
return this.isMember(roomId, publicKey) && this.#memberships.get(parseBuzzTarget(roomId))?.roles.get(publicKey) === "bot";
|
|
138
|
-
}
|
|
139
|
-
isMember(roomId, publicKey) {
|
|
140
|
-
const normalizedRoomId = parseBuzzTarget(roomId);
|
|
141
|
-
return !this.#rooms.get(normalizedRoomId)?.archived && this.#memberships.get(normalizedRoomId)?.members.has(publicKey) === true;
|
|
142
|
-
}
|
|
143
|
-
applyProfileEvent(event) {
|
|
144
|
-
const profile = parseBuzzDirectoryProfileEvent(event);
|
|
145
|
-
if (!profile || !this.#profilePublicKeys.has(profile.publicKey) || !isNewerBuzzRevision(profile, this.#profiles.get(profile.publicKey))) return false;
|
|
146
|
-
this.#profiles.set(profile.publicKey, profile);
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
applyRoomEvent(event) {
|
|
150
|
-
const room = parseBuzzDirectoryRoomEvent(event);
|
|
151
|
-
if (!room || !this.#configuredRoomIds.has(room.roomId) || !isNewerBuzzRevision(room, this.#rooms.get(room.roomId))) return false;
|
|
152
|
-
this.#rooms.set(room.roomId, room);
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
resolveSenderName(publicKey) {
|
|
156
|
-
const normalized = publicKey.trim().toLowerCase();
|
|
157
|
-
return this.#profiles.get(normalized)?.displayName ?? fallbackPublicKeyLabel(normalized);
|
|
158
|
-
}
|
|
159
|
-
resolveRoomName(roomId) {
|
|
160
|
-
const normalized = parseBuzzTarget(roomId);
|
|
161
|
-
return this.#rooms.get(normalized)?.name ?? normalized;
|
|
162
|
-
}
|
|
163
|
-
self() {
|
|
164
|
-
return this.#buildUserEntry(this.#publicKey);
|
|
165
|
-
}
|
|
166
|
-
listPeers(params) {
|
|
167
|
-
const peers = /* @__PURE__ */ new Set();
|
|
168
|
-
for (const roomId of this.activeRoomIds()) {
|
|
169
|
-
const membership = this.#memberships.get(roomId);
|
|
170
|
-
if (!membership) continue;
|
|
171
|
-
for (const publicKey of membership.members) if (publicKey !== this.#publicKey) peers.add(publicKey);
|
|
172
|
-
}
|
|
173
|
-
const entries = [...peers].map((publicKey) => this.#buildUserEntry(publicKey)).toSorted(compareDirectoryEntries);
|
|
174
|
-
return applyBuzzDirectoryQueryAndLimit(entries, params);
|
|
175
|
-
}
|
|
176
|
-
listGroups(params) {
|
|
177
|
-
const entries = this.activeRoomIds().map((roomId) => this.#buildRoomEntry(roomId)).toSorted(compareDirectoryEntries);
|
|
178
|
-
return applyBuzzDirectoryQueryAndLimit(entries, params);
|
|
179
|
-
}
|
|
180
|
-
listGroupMembers(params) {
|
|
181
|
-
let roomId;
|
|
182
|
-
try {
|
|
183
|
-
roomId = parseBuzzTarget(params.groupId);
|
|
184
|
-
} catch {
|
|
185
|
-
return [];
|
|
186
|
-
}
|
|
187
|
-
if (this.#rooms.get(roomId)?.archived) return [];
|
|
188
|
-
const membership = this.#memberships.get(roomId);
|
|
189
|
-
if (!membership) return [];
|
|
190
|
-
const entries = [...membership.members].map((publicKey) => {
|
|
191
|
-
const entry = this.#buildUserEntry(publicKey);
|
|
192
|
-
entry.raw = {
|
|
193
|
-
publicKey,
|
|
194
|
-
role: membership.roles.get(publicKey),
|
|
195
|
-
roomId
|
|
196
|
-
};
|
|
197
|
-
return entry;
|
|
198
|
-
}).toSorted(compareDirectoryEntries);
|
|
199
|
-
return applyBuzzDirectoryQueryAndLimit(entries, { limit: params.limit });
|
|
200
|
-
}
|
|
201
|
-
mentionMembers(roomId) {
|
|
202
|
-
const normalized = parseBuzzTarget(roomId);
|
|
203
|
-
if (this.#rooms.get(normalized)?.archived) return;
|
|
204
|
-
const membership = this.#memberships.get(normalized);
|
|
205
|
-
if (!membership) return;
|
|
206
|
-
return [...membership.members].map((publicKey) => ({
|
|
207
|
-
publicKey,
|
|
208
|
-
displayName: this.#profiles.get(publicKey)?.displayName
|
|
209
|
-
})).toSorted((left, right) => left.publicKey.localeCompare(right.publicKey));
|
|
210
|
-
}
|
|
211
|
-
#buildUserEntry(publicKey) {
|
|
212
|
-
const profile = this.#profiles.get(publicKey);
|
|
213
|
-
return {
|
|
214
|
-
kind: "user",
|
|
215
|
-
id: publicKey,
|
|
216
|
-
name: profile?.displayName ?? (publicKey === this.#publicKey ? this.#fallbackProfileName : fallbackPublicKeyLabel(publicKey)),
|
|
217
|
-
handle: profile?.handle,
|
|
218
|
-
avatarUrl: profile?.avatarUrl,
|
|
219
|
-
raw: { publicKey }
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
#buildRoomEntry(roomId) {
|
|
223
|
-
const room = this.#rooms.get(roomId);
|
|
224
|
-
return {
|
|
225
|
-
kind: "group",
|
|
226
|
-
id: buildBuzzTarget(roomId),
|
|
227
|
-
name: room?.name ?? roomId,
|
|
228
|
-
handle: room?.name ? `#${room.name}` : void 0,
|
|
229
|
-
raw: { roomId }
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
function compareDirectoryEntries(a, b) {
|
|
234
|
-
const aLabel = a.name ?? a.handle ?? a.id;
|
|
235
|
-
const bLabel = b.name ?? b.handle ?? b.id;
|
|
236
|
-
return aLabel.localeCompare(bLabel) || a.id.localeCompare(b.id);
|
|
237
|
-
}
|
|
238
|
-
//#endregion
|
|
239
26
|
//#region extensions/buzz/src/directory-relay.ts
|
|
240
27
|
const BUZZ_ROOM_QUERY_CHUNK_SIZE = 1e3;
|
|
241
28
|
const PROFILE_SUBSCRIPTION_REPLACED_REASON = "directory profile subscription replaced";
|
|
@@ -753,7 +540,7 @@ async function drainBuzzRoomHistoryRange(params) {
|
|
|
753
540
|
skipEventIds: params.skipEventIds,
|
|
754
541
|
signal: params.signal
|
|
755
542
|
});
|
|
756
|
-
if (!page.overLimit) {
|
|
543
|
+
if (!page.overLimit || params.since === params.until) {
|
|
757
544
|
if (page.events.length === 0) return "complete";
|
|
758
545
|
const reservation = await params.reserveCapacity(page.events.length);
|
|
759
546
|
if (!reservation) return "aborted";
|
|
@@ -762,17 +549,7 @@ async function drainBuzzRoomHistoryRange(params) {
|
|
|
762
549
|
} finally {
|
|
763
550
|
reservation.release();
|
|
764
551
|
}
|
|
765
|
-
return "complete";
|
|
766
|
-
}
|
|
767
|
-
if (params.since === params.until) {
|
|
768
|
-
const reservation = await params.reserveCapacity(page.events.length);
|
|
769
|
-
if (!reservation) return "aborted";
|
|
770
|
-
try {
|
|
771
|
-
for (const event of page.events) params.onEvent(event, reservation);
|
|
772
|
-
} finally {
|
|
773
|
-
reservation.release();
|
|
774
|
-
}
|
|
775
|
-
return "timestamp-over-limit";
|
|
552
|
+
return page.overLimit ? "timestamp-over-limit" : "complete";
|
|
776
553
|
}
|
|
777
554
|
const midpoint = Math.floor((params.since + params.until) / 2);
|
|
778
555
|
const newer = await drainBuzzRoomHistoryRange({
|
|
@@ -1217,16 +994,6 @@ async function createBuzzRoomMembershipTracker(params) {
|
|
|
1217
994
|
};
|
|
1218
995
|
}
|
|
1219
996
|
//#endregion
|
|
1220
|
-
//#region extensions/buzz/src/subscription-budget.ts
|
|
1221
|
-
const BUZZ_DIRECTORY_MAX_PROFILE_SUBSCRIPTIONS = 10;
|
|
1222
|
-
const BUZZ_MAX_CONFIGURED_ROOMS = 1020;
|
|
1223
|
-
function resolveBuzzSubscriptionBudget(roomCount) {
|
|
1224
|
-
if (!Number.isSafeInteger(roomCount) || roomCount < 0) throw new Error("Buzz configured room count must be a non-negative integer");
|
|
1225
|
-
const availableProfileSubscriptions = 1020 - roomCount;
|
|
1226
|
-
if (availableProfileSubscriptions < 0) throw new Error(`Buzz supports at most ${BUZZ_MAX_CONFIGURED_ROOMS} configured rooms per account`);
|
|
1227
|
-
return { profileLimit: Math.min(BUZZ_DIRECTORY_MAX_PROFILE_SUBSCRIPTIONS, availableProfileSubscriptions) * 200 };
|
|
1228
|
-
}
|
|
1229
|
-
//#endregion
|
|
1230
997
|
//#region extensions/buzz/src/buzz-bus.ts
|
|
1231
998
|
const PRESENCE_KIND = 20001;
|
|
1232
999
|
const PRESENCE_HEARTBEAT_INTERVAL_MS = 3e4;
|
|
@@ -1234,6 +1001,7 @@ const REPLAY_TTL_MS = 2592e6;
|
|
|
1234
1001
|
const REPLAY_MAX_ENTRIES = 1e4;
|
|
1235
1002
|
const REPLAY_STATE_MAX_ENTRIES = 5e4;
|
|
1236
1003
|
const REPLAY_NAMESPACE_PREFIX = "buzz.inbound-dedupe";
|
|
1004
|
+
const THREAD_ROOT_CACHE_MAX_ENTRIES = 1024;
|
|
1237
1005
|
function buildBuzzTextEvent(params) {
|
|
1238
1006
|
return finalizeEvent({
|
|
1239
1007
|
kind: 9,
|
|
@@ -1397,10 +1165,55 @@ async function startBuzzBus(options) {
|
|
|
1397
1165
|
let stopPresenceHeartbeat = () => {};
|
|
1398
1166
|
let profileTask;
|
|
1399
1167
|
let membershipTracker;
|
|
1168
|
+
const threadRoots = /* @__PURE__ */ new Map();
|
|
1169
|
+
const rememberThreadRoot = (event) => {
|
|
1170
|
+
const root = parseBuzzMessageEvent(event);
|
|
1171
|
+
if (!root || root.threadId || !verifyEvent(event)) return;
|
|
1172
|
+
threadRoots.set(event.id, {
|
|
1173
|
+
channelId: root.channelId.toLowerCase(),
|
|
1174
|
+
isBotOwned: event.pubkey === publicKey
|
|
1175
|
+
});
|
|
1176
|
+
if (threadRoots.size > THREAD_ROOT_CACHE_MAX_ENTRIES) {
|
|
1177
|
+
const oldest = threadRoots.keys().next().value;
|
|
1178
|
+
if (oldest) threadRoots.delete(oldest);
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1400
1181
|
const bus = {
|
|
1401
1182
|
publicKey,
|
|
1402
1183
|
directory,
|
|
1403
1184
|
refreshDirectory: async () => await directoryRelay?.refreshRooms(options.channelIds),
|
|
1185
|
+
isBotOwnedThread: async ({ channelId, threadId }) => {
|
|
1186
|
+
signal.throwIfAborted();
|
|
1187
|
+
if (!threadRoots.has(threadId)) try {
|
|
1188
|
+
await queryBuzzRelaySnapshot({
|
|
1189
|
+
relay,
|
|
1190
|
+
filters: [{
|
|
1191
|
+
ids: [threadId],
|
|
1192
|
+
kinds: [...BUZZ_INBOUND_MESSAGE_KINDS],
|
|
1193
|
+
limit: 1
|
|
1194
|
+
}],
|
|
1195
|
+
signal,
|
|
1196
|
+
timeoutMessage: "Timed out loading Buzz thread root",
|
|
1197
|
+
abortMessage: "Buzz thread root query aborted",
|
|
1198
|
+
failureMessage: "Buzz thread root query failed",
|
|
1199
|
+
closeReason: "thread root loaded",
|
|
1200
|
+
closeMessage: (reason) => `Buzz thread root query closed: ${reason}`,
|
|
1201
|
+
onEvent: (event) => {
|
|
1202
|
+
if (event.id === threadId) rememberThreadRoot(event);
|
|
1203
|
+
},
|
|
1204
|
+
result: () => {},
|
|
1205
|
+
onTimeout: reportFatalError,
|
|
1206
|
+
checkAbortAfterSubscribe: true
|
|
1207
|
+
});
|
|
1208
|
+
} catch (error) {
|
|
1209
|
+
signal.throwIfAborted();
|
|
1210
|
+
options.onMessageError?.(error instanceof Error ? error : new Error("Buzz thread root query failed", { cause: error }));
|
|
1211
|
+
return false;
|
|
1212
|
+
}
|
|
1213
|
+
signal.throwIfAborted();
|
|
1214
|
+
const root = threadRoots.get(threadId);
|
|
1215
|
+
return root?.channelId === channelId && root.isBotOwned;
|
|
1216
|
+
},
|
|
1404
1217
|
sendText: async ({ channelId, text, threadId, replyToId }) => {
|
|
1405
1218
|
signal.throwIfAborted();
|
|
1406
1219
|
const mentionSyntax = inspectBuzzMentionSyntax(text);
|
|
@@ -1418,6 +1231,7 @@ async function startBuzzBus(options) {
|
|
|
1418
1231
|
mentionedPubkeys
|
|
1419
1232
|
});
|
|
1420
1233
|
await relay.publish(event);
|
|
1234
|
+
rememberThreadRoot(event);
|
|
1421
1235
|
return event.id;
|
|
1422
1236
|
},
|
|
1423
1237
|
sendTyping: async ({ channelId, threadId, replyToId }) => {
|
|
@@ -1436,6 +1250,7 @@ async function startBuzzBus(options) {
|
|
|
1436
1250
|
stopPresenceHeartbeat();
|
|
1437
1251
|
directoryRelay?.close();
|
|
1438
1252
|
replayGuard.clearMemory();
|
|
1253
|
+
threadRoots.clear();
|
|
1439
1254
|
relay.close();
|
|
1440
1255
|
await membershipTracker?.close();
|
|
1441
1256
|
await profileTask;
|
|
@@ -1482,7 +1297,11 @@ async function startBuzzBus(options) {
|
|
|
1482
1297
|
onHistoryError: options.onHistoryError,
|
|
1483
1298
|
onRoomUnavailable: options.onRoomUnavailable,
|
|
1484
1299
|
onMessageEvent: (event, isMember, reservation) => {
|
|
1485
|
-
if (signal.aborted
|
|
1300
|
+
if (signal.aborted) return;
|
|
1301
|
+
if (event.pubkey === publicKey) {
|
|
1302
|
+
rememberThreadRoot(event);
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1486
1305
|
const message = parseBuzzMessageEvent(event);
|
|
1487
1306
|
if (!message || !isMember(message.channelId, event.pubkey)) return;
|
|
1488
1307
|
if ((reservation ?? dispatchQueue).enqueue(async () => {
|
|
@@ -1546,6 +1365,18 @@ async function startBuzzBus(options) {
|
|
|
1546
1365
|
}
|
|
1547
1366
|
}
|
|
1548
1367
|
//#endregion
|
|
1368
|
+
//#region src/channels/mention-gating.ts
|
|
1369
|
+
function resolveBotThreadMentionPolicy(params) {
|
|
1370
|
+
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
1371
|
+
requireMention: params.requireMention,
|
|
1372
|
+
implicitMentionKinds: params.implicitMentionKinds
|
|
1373
|
+
};
|
|
1374
|
+
return {
|
|
1375
|
+
requireMention: params.requireMentionInBotThreads,
|
|
1376
|
+
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
//#endregion
|
|
1549
1380
|
//#region extensions/buzz/src/pending-history.ts
|
|
1550
1381
|
const ENTRY_BYTES = 512;
|
|
1551
1382
|
const CONTEXT_BYTES = 1024;
|
|
@@ -1635,7 +1466,18 @@ async function handleBuzzInbound(params) {
|
|
|
1635
1466
|
const shouldComputeCommandAuthorized = supportsTextInterpretation && runtime.channel.commands.shouldComputeCommandAuthorized(message.text, cfg);
|
|
1636
1467
|
const hasControlCommand = shouldComputeCommandAuthorized && runtime.channel.text.hasControlCommand(message.text, cfg);
|
|
1637
1468
|
const groupConfig = account.config.groups?.[channelId];
|
|
1638
|
-
const
|
|
1469
|
+
const requireMention = groupConfig?.requireMention ?? true;
|
|
1470
|
+
const isBotOwnedThread = message.threadId && !wasMentioned && groupConfig?.requireMentionInBotThreads !== void 0 && groupConfig.requireMentionInBotThreads !== requireMention ? await bus.isBotOwnedThread({
|
|
1471
|
+
channelId,
|
|
1472
|
+
threadId: message.threadId
|
|
1473
|
+
}) : false;
|
|
1474
|
+
params.assertCurrent();
|
|
1475
|
+
const mentionPolicy = resolveBotThreadMentionPolicy({
|
|
1476
|
+
isBotOwnedThread,
|
|
1477
|
+
requireMentionInBotThreads: groupConfig?.requireMentionInBotThreads,
|
|
1478
|
+
requireMention
|
|
1479
|
+
});
|
|
1480
|
+
const access = await runtime.channel.inbound.ingress.resolveStable({
|
|
1639
1481
|
channelId: "buzz",
|
|
1640
1482
|
accountId: account.accountId,
|
|
1641
1483
|
identity: {
|
|
@@ -1651,6 +1493,7 @@ async function handleBuzzInbound(params) {
|
|
|
1651
1493
|
contextBinding: {
|
|
1652
1494
|
agentId: route.agentId,
|
|
1653
1495
|
sessionKey: route.sessionKey,
|
|
1496
|
+
nativeChannelId: channelId,
|
|
1654
1497
|
messageId: message.id,
|
|
1655
1498
|
inboundEventKind: "user_request"
|
|
1656
1499
|
},
|
|
@@ -1661,7 +1504,7 @@ async function handleBuzzInbound(params) {
|
|
|
1661
1504
|
groupPolicy: groupConfig?.groupPolicy ?? account.config.groupPolicy,
|
|
1662
1505
|
groupAllowFrom: groupConfig?.groupAllowFrom ?? account.config.groupAllowFrom,
|
|
1663
1506
|
policy: { activation: {
|
|
1664
|
-
requireMention:
|
|
1507
|
+
requireMention: mentionPolicy.requireMention,
|
|
1665
1508
|
allowTextCommands: true
|
|
1666
1509
|
} },
|
|
1667
1510
|
command: shouldComputeCommandAuthorized ? {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { i as resolveBuzzAccount, m as parseBuzzTarget, u as buildBuzzTarget } from "./types-DRUZMyTx.mjs";
|
|
2
|
+
import { t as applyBuzzDirectoryQueryAndLimit } from "./directory-query-D1BNu8nO.mjs";
|
|
3
|
+
//#region extensions/buzz/src/directory-config.ts
|
|
4
|
+
async function listBuzzDirectoryPeersFromConfig(_params) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
async function listBuzzDirectoryGroupsFromConfig(params) {
|
|
8
|
+
const account = resolveBuzzAccount({
|
|
9
|
+
cfg: params.cfg,
|
|
10
|
+
accountId: params.accountId
|
|
11
|
+
});
|
|
12
|
+
const entries = Object.entries(account.config.groups ?? {}).filter(([, config]) => config.enabled !== false).map(([roomId]) => {
|
|
13
|
+
const id = parseBuzzTarget(roomId);
|
|
14
|
+
return {
|
|
15
|
+
kind: "group",
|
|
16
|
+
id: buildBuzzTarget(id),
|
|
17
|
+
name: id,
|
|
18
|
+
raw: { roomId: id }
|
|
19
|
+
};
|
|
20
|
+
}).toSorted((a, b) => a.id.localeCompare(b.id));
|
|
21
|
+
return applyBuzzDirectoryQueryAndLimit(entries, params);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { listBuzzDirectoryPeersFromConfig as n, listBuzzDirectoryGroupsFromConfig as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region extensions/buzz/src/directory-query.ts
|
|
2
|
+
function matchesDirectoryQuery(entry, query) {
|
|
3
|
+
if (!query) return true;
|
|
4
|
+
return [
|
|
5
|
+
entry.id,
|
|
6
|
+
entry.name,
|
|
7
|
+
entry.handle
|
|
8
|
+
].some((value) => value?.toLowerCase().includes(query));
|
|
9
|
+
}
|
|
10
|
+
function applyBuzzDirectoryQueryAndLimit(entries, params) {
|
|
11
|
+
const query = params.query?.trim().toLowerCase() ?? "";
|
|
12
|
+
const limit = typeof params.limit === "number" && params.limit > 0 ? Math.floor(params.limit) : void 0;
|
|
13
|
+
const result = [];
|
|
14
|
+
for (const entry of entries) {
|
|
15
|
+
if (!matchesDirectoryQuery(entry, query)) continue;
|
|
16
|
+
result.push(entry);
|
|
17
|
+
if (limit !== void 0 && result.length >= limit) break;
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { applyBuzzDirectoryQueryAndLimit as t };
|