@openclaw/nostr 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/{channel-ByGdjtr3.mjs → channel-D2d-FP8G.mjs} +116 -279
- package/dist/.setup/{config-schema-CkYd8ACn.mjs → config-schema-B3uU2qBS.mjs} +1 -3
- package/dist/.setup/setup-plugin-api-BhRAS2I1.mjs +2 -0
- package/dist/.setup/{setup-plugin-api-B7qtJE84.mjs → setup-plugin-api-Ci0XxWqb.mjs} +2 -1
- package/dist/api.js +34 -93
- package/dist/channel-plugin-api.js +1 -1
- package/dist/doctor-contract-api.js +18 -130
- package/dist/setup-entry.js +1 -1
- 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/package.json +5 -5
- package/dist/.setup/inbound-direct-dm-runtime-DHn9NoYN.mjs +0 -2
- package/dist/.setup/setup-plugin-api-B7i5rR6T.mjs +0 -2
- package/dist/.setup/state-account-id-CvBZ9s6P.mjs +0 -8
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { collectStatusIssuesFromLastError, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
2
|
-
import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, formatPairingApproveHint } from "openclaw/plugin-sdk/channel-plugin-common";
|
|
3
1
|
import { AllowFromListSchema, DmPolicySchema, MarkdownConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
2
|
import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
|
|
5
3
|
import { z } from "zod";
|
|
@@ -61,4 +59,4 @@ const NostrConfigSchema = z.object({
|
|
|
61
59
|
profile: NostrProfileSchema.optional()
|
|
62
60
|
});
|
|
63
61
|
//#endregion
|
|
64
|
-
export {
|
|
62
|
+
export { NostrProfileSchema as n, NostrConfigSchema as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as NostrConfigSchema } from "./config-schema-B3uU2qBS.mjs";
|
|
2
2
|
import { i as createNostrSetupStatus, l as DEFAULT_RELAYS, n as createNostrSetupAdapter, o as hasConfiguredNostrPrivateKey, r as createNostrSetupContract, s as resolveNostrPrivateKey } from "./setup-adapter-KJ_iGKiG.mjs";
|
|
3
3
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
4
|
+
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-plugin-common";
|
|
4
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
6
|
import { createDelegatedSetupWizardProxy } from "openclaw/plugin-sdk/setup-runtime";
|
|
6
7
|
//#region extensions/nostr/src/channel.setup.ts
|
package/dist/api.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { s as resolveNostrAccount } from "./.setup/setup-surface-Dx8QxWSP.mjs";
|
|
2
2
|
import { getPluginRuntimeGatewayRequestScope } from "./runtime-api.js";
|
|
3
|
-
import { n as NostrProfileSchema } from "./.setup/config-schema-
|
|
4
|
-
import { a as getNostrRuntime, i as contentToProfile, n as nostrPlugin, o as setNostrRuntime, r as publishNostrProfile, t as getNostrProfileState } from "./.setup/channel-
|
|
3
|
+
import { n as NostrProfileSchema } from "./.setup/config-schema-B3uU2qBS.mjs";
|
|
4
|
+
import { a as getNostrRuntime, i as contentToProfile, n as nostrPlugin, o as setNostrRuntime, r as publishNostrProfile, t as getNostrProfileState } from "./.setup/channel-D2d-FP8G.mjs";
|
|
5
|
+
import { getPluginRuntimeGatewayRequestScope as getPluginRuntimeGatewayRequestScope$1 } from "openclaw/plugin-sdk/plugin-runtime";
|
|
5
6
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
import { SimplePool } from "nostr-tools";
|
|
8
|
-
import { createFixedWindowRateLimiter
|
|
9
|
+
import { createFixedWindowRateLimiter } from "openclaw/plugin-sdk/webhook-ingress";
|
|
9
10
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
10
11
|
import { isBlockedHostnameOrIp, isLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
11
12
|
import { readJsonBodyWithLimit, requestBodyErrorToText } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
@@ -50,17 +51,7 @@ function validateUrlSafety(urlStr) {
|
|
|
50
51
|
}
|
|
51
52
|
//#endregion
|
|
52
53
|
//#region extensions/nostr/src/nostr-profile-import.ts
|
|
53
|
-
/**
|
|
54
|
-
* Nostr Profile Import
|
|
55
|
-
*
|
|
56
|
-
* Fetches and verifies kind:0 profile events from relays.
|
|
57
|
-
* Used to import existing profiles before editing.
|
|
58
|
-
*/
|
|
59
54
|
const DEFAULT_TIMEOUT_MS = 5e3;
|
|
60
|
-
/**
|
|
61
|
-
* Sanitize URLs in an imported profile to prevent SSRF attacks.
|
|
62
|
-
* Removes any URLs that don't pass SSRF validation.
|
|
63
|
-
*/
|
|
64
55
|
function sanitizeProfileUrls(profile) {
|
|
65
56
|
const result = { ...profile };
|
|
66
57
|
for (const field of [
|
|
@@ -75,14 +66,7 @@ function sanitizeProfileUrls(profile) {
|
|
|
75
66
|
}
|
|
76
67
|
return result;
|
|
77
68
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Fetch the latest kind:0 profile event for a pubkey from relays.
|
|
80
|
-
*
|
|
81
|
-
* - Queries all relays in parallel
|
|
82
|
-
* - Takes the event with the highest created_at
|
|
83
|
-
* - Verifies the event signature
|
|
84
|
-
* - Parses and returns the profile
|
|
85
|
-
*/
|
|
69
|
+
/** Import the latest verified kind:0 profile across the configured relays. */
|
|
86
70
|
async function importProfileFromRelays(opts) {
|
|
87
71
|
const { pubkey, relays } = opts;
|
|
88
72
|
const timeoutMs = resolveTimerTimeoutMs(opts.timeoutMs, DEFAULT_TIMEOUT_MS);
|
|
@@ -179,13 +163,7 @@ async function importProfileFromRelays(opts) {
|
|
|
179
163
|
pool.close(relays);
|
|
180
164
|
}
|
|
181
165
|
}
|
|
182
|
-
/**
|
|
183
|
-
* Merge imported profile with local profile.
|
|
184
|
-
*
|
|
185
|
-
* Strategy:
|
|
186
|
-
* - For each field, prefer local if set, otherwise use imported
|
|
187
|
-
* - This preserves user customizations while filling in missing data
|
|
188
|
-
*/
|
|
166
|
+
/** Preserve local customizations while filling missing fields from the imported profile. */
|
|
189
167
|
function mergeProfiles(local, imported) {
|
|
190
168
|
if (!imported) return local ?? {};
|
|
191
169
|
if (!local) return imported;
|
|
@@ -202,18 +180,12 @@ function mergeProfiles(local, imported) {
|
|
|
202
180
|
}
|
|
203
181
|
//#endregion
|
|
204
182
|
//#region extensions/nostr/src/nostr-profile-http.ts
|
|
205
|
-
const profileRateLimiter = createFixedWindowRateLimiter
|
|
183
|
+
const profileRateLimiter = createFixedWindowRateLimiter({
|
|
206
184
|
windowMs: 6e4,
|
|
207
185
|
maxRequests: 5,
|
|
208
186
|
maxTrackedKeys: 2048
|
|
209
187
|
});
|
|
210
|
-
function checkRateLimit(accountId) {
|
|
211
|
-
return !profileRateLimiter.isRateLimited(accountId);
|
|
212
|
-
}
|
|
213
188
|
const publishLocks = new KeyedAsyncQueue();
|
|
214
|
-
async function withPublishLock(accountId, fn) {
|
|
215
|
-
return await publishLocks.enqueue(accountId, fn);
|
|
216
|
-
}
|
|
217
189
|
const nip05FormatSchema = z.string().regex(/^[a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,}$/i, "Invalid NIP-05 format (user@domain.com)").optional();
|
|
218
190
|
const lud16FormatSchema = z.string().regex(/^[a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,}$/i, "Invalid Lightning address format").optional();
|
|
219
191
|
const ProfileUpdateSchema = NostrProfileSchema.extend({
|
|
@@ -228,14 +200,13 @@ const PROFILE_URL_FIELDS = [
|
|
|
228
200
|
];
|
|
229
201
|
function normalizeProfileUpdateUrlInputs(value) {
|
|
230
202
|
if (!isRecord(value)) return value;
|
|
231
|
-
const record = value;
|
|
232
203
|
let normalized;
|
|
233
204
|
for (const field of PROFILE_URL_FIELDS) {
|
|
234
|
-
const input =
|
|
205
|
+
const input = value[field];
|
|
235
206
|
if (typeof input !== "string") continue;
|
|
236
207
|
const next = normalizeNostrProfileUrlForRuntime(input);
|
|
237
208
|
if (next !== input) {
|
|
238
|
-
normalized ??= { ...
|
|
209
|
+
normalized ??= { ...value };
|
|
239
210
|
normalized[field] = next;
|
|
240
211
|
}
|
|
241
212
|
}
|
|
@@ -243,12 +214,11 @@ function normalizeProfileUpdateUrlInputs(value) {
|
|
|
243
214
|
}
|
|
244
215
|
function restoreProfileUpdateUrlInputs(profile, value) {
|
|
245
216
|
if (!isRecord(value)) return profile;
|
|
246
|
-
const record = value;
|
|
247
217
|
return {
|
|
248
218
|
...profile,
|
|
249
|
-
...typeof
|
|
250
|
-
...typeof
|
|
251
|
-
...typeof
|
|
219
|
+
...typeof value.picture === "string" ? { picture: value.picture } : {},
|
|
220
|
+
...typeof value.banner === "string" ? { banner: value.banner } : {},
|
|
221
|
+
...typeof value.website === "string" ? { website: value.website } : {}
|
|
252
222
|
};
|
|
253
223
|
}
|
|
254
224
|
function sendJson(res, status, body) {
|
|
@@ -264,8 +234,7 @@ async function readJsonBody(req, maxBytes = 65536, timeoutMs = 3e4) {
|
|
|
264
234
|
});
|
|
265
235
|
if (result.ok) return result.value;
|
|
266
236
|
if (result.code === "PAYLOAD_TOO_LARGE") throw new Error("Request body too large");
|
|
267
|
-
if (result.code === "REQUEST_BODY_TIMEOUT") throw new Error(requestBodyErrorToText(
|
|
268
|
-
if (result.code === "CONNECTION_CLOSED") throw new Error(requestBodyErrorToText("CONNECTION_CLOSED"));
|
|
237
|
+
if (result.code === "REQUEST_BODY_TIMEOUT" || result.code === "CONNECTION_CLOSED") throw new Error(requestBodyErrorToText(result.code));
|
|
269
238
|
throw new Error(result.code === "INVALID_JSON" ? "Invalid JSON" : result.error);
|
|
270
239
|
}
|
|
271
240
|
function parseAccountIdFromPath(pathname) {
|
|
@@ -361,7 +330,7 @@ function enforceLoopbackMutationGuards(ctx, req, res) {
|
|
|
361
330
|
return true;
|
|
362
331
|
}
|
|
363
332
|
function enforceGatewayMutationScope(ctx, accountId, res) {
|
|
364
|
-
const runtimeScopes = getPluginRuntimeGatewayRequestScope()?.client?.connect?.scopes;
|
|
333
|
+
const runtimeScopes = getPluginRuntimeGatewayRequestScope$1()?.client?.connect?.scopes;
|
|
365
334
|
if ((Array.isArray(runtimeScopes) ? runtimeScopes : []).includes(PROFILE_MUTATION_SCOPE)) return true;
|
|
366
335
|
ctx.log?.warn?.(`[${accountId}] Rejected profile mutation missing ${PROFILE_MUTATION_SCOPE}`);
|
|
367
336
|
sendJson(res, 403, {
|
|
@@ -380,8 +349,10 @@ function createNostrProfileHttpHandler(ctx) {
|
|
|
380
349
|
if (!(url.pathname.endsWith("/profile") || isImport)) return false;
|
|
381
350
|
try {
|
|
382
351
|
if (req.method === "GET" && !isImport) return await handleGetProfile(accountId, ctx, res);
|
|
383
|
-
if (req.method === "PUT" && !isImport
|
|
384
|
-
|
|
352
|
+
if (req.method === "PUT" && !isImport || req.method === "POST" && isImport) {
|
|
353
|
+
if (!enforceGatewayMutationScope(ctx, accountId, res) || !enforceLoopbackMutationGuards(ctx, req, res)) return true;
|
|
354
|
+
return await (isImport ? handleImportProfile : handleUpdateProfile)(accountId, ctx, req, res);
|
|
355
|
+
}
|
|
385
356
|
sendJson(res, 405, {
|
|
386
357
|
ok: false,
|
|
387
358
|
error: "Method not allowed"
|
|
@@ -409,9 +380,7 @@ async function handleGetProfile(accountId, ctx, res) {
|
|
|
409
380
|
return true;
|
|
410
381
|
}
|
|
411
382
|
async function handleUpdateProfile(accountId, ctx, req, res) {
|
|
412
|
-
if (
|
|
413
|
-
if (!enforceLoopbackMutationGuards(ctx, req, res)) return true;
|
|
414
|
-
if (!checkRateLimit(accountId)) {
|
|
383
|
+
if (profileRateLimiter.isRateLimited(accountId)) {
|
|
415
384
|
sendJson(res, 429, {
|
|
416
385
|
ok: false,
|
|
417
386
|
error: "Rate limit exceeded (5 requests/minute)"
|
|
@@ -438,32 +407,14 @@ async function handleUpdateProfile(accountId, ctx, req, res) {
|
|
|
438
407
|
return true;
|
|
439
408
|
}
|
|
440
409
|
const profile = restoreProfileUpdateUrlInputs(parseResult.data, body);
|
|
441
|
-
|
|
442
|
-
const
|
|
443
|
-
if (!
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
error: `picture: ${pictureCheck.error}`
|
|
447
|
-
});
|
|
448
|
-
return true;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
if (profile.banner) {
|
|
452
|
-
const bannerCheck = validateUrlSafety(profile.banner);
|
|
453
|
-
if (!bannerCheck.ok) {
|
|
454
|
-
sendJson(res, 400, {
|
|
455
|
-
ok: false,
|
|
456
|
-
error: `banner: ${bannerCheck.error}`
|
|
457
|
-
});
|
|
458
|
-
return true;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if (profile.website) {
|
|
462
|
-
const websiteCheck = validateUrlSafety(profile.website);
|
|
463
|
-
if (!websiteCheck.ok) {
|
|
410
|
+
for (const field of PROFILE_URL_FIELDS) {
|
|
411
|
+
const url = profile[field];
|
|
412
|
+
if (!url) continue;
|
|
413
|
+
const check = validateUrlSafety(url);
|
|
414
|
+
if (!check.ok) {
|
|
464
415
|
sendJson(res, 400, {
|
|
465
416
|
ok: false,
|
|
466
|
-
error:
|
|
417
|
+
error: `${field}: ${check.error}`
|
|
467
418
|
});
|
|
468
419
|
return true;
|
|
469
420
|
}
|
|
@@ -473,12 +424,12 @@ async function handleUpdateProfile(accountId, ctx, req, res) {
|
|
|
473
424
|
...profile
|
|
474
425
|
};
|
|
475
426
|
try {
|
|
476
|
-
const result = await
|
|
477
|
-
await getPluginRuntimeGatewayRequestScope()?.revalidate?.();
|
|
427
|
+
const result = await publishLocks.enqueue(accountId, async () => {
|
|
428
|
+
await getPluginRuntimeGatewayRequestScope$1()?.revalidate?.();
|
|
478
429
|
return await publishNostrProfile(accountId, mergedProfile);
|
|
479
430
|
});
|
|
480
431
|
if (result.successes.length > 0) {
|
|
481
|
-
await getPluginRuntimeGatewayRequestScope()?.revalidate?.();
|
|
432
|
+
await getPluginRuntimeGatewayRequestScope$1()?.revalidate?.();
|
|
482
433
|
await ctx.updateConfigProfile(accountId, mergedProfile);
|
|
483
434
|
ctx.log?.info(`[${accountId}] Profile published to ${result.successes.length} relay(s)`);
|
|
484
435
|
} else ctx.log?.warn(`[${accountId}] Profile publish failed on all relays`);
|
|
@@ -501,8 +452,6 @@ async function handleUpdateProfile(accountId, ctx, req, res) {
|
|
|
501
452
|
return true;
|
|
502
453
|
}
|
|
503
454
|
async function handleImportProfile(accountId, ctx, req, res) {
|
|
504
|
-
if (!enforceGatewayMutationScope(ctx, accountId, res)) return true;
|
|
505
|
-
if (!enforceLoopbackMutationGuards(ctx, req, res)) return true;
|
|
506
455
|
const accountInfo = ctx.getAccountInfo(accountId);
|
|
507
456
|
if (!accountInfo) {
|
|
508
457
|
sendJson(res, 404, {
|
|
@@ -524,7 +473,7 @@ async function handleImportProfile(accountId, ctx, req, res) {
|
|
|
524
473
|
const body = await readJsonBody(req);
|
|
525
474
|
if (typeof body === "object" && body !== null) autoMerge = body.autoMerge === true;
|
|
526
475
|
} catch {}
|
|
527
|
-
await getPluginRuntimeGatewayRequestScope()?.revalidate?.();
|
|
476
|
+
await getPluginRuntimeGatewayRequestScope$1()?.revalidate?.();
|
|
528
477
|
ctx.log?.info(`[${accountId}] Importing profile for ${pubkey.slice(0, 8)}...`);
|
|
529
478
|
const result = await importProfileFromRelays({
|
|
530
479
|
pubkey,
|
|
@@ -539,26 +488,18 @@ async function handleImportProfile(accountId, ctx, req, res) {
|
|
|
539
488
|
});
|
|
540
489
|
return true;
|
|
541
490
|
}
|
|
491
|
+
let merged;
|
|
542
492
|
if (autoMerge && result.profile) {
|
|
543
|
-
await getPluginRuntimeGatewayRequestScope()?.revalidate?.();
|
|
544
|
-
|
|
493
|
+
await getPluginRuntimeGatewayRequestScope$1()?.revalidate?.();
|
|
494
|
+
merged = mergeProfiles(ctx.getConfigProfile(accountId), result.profile);
|
|
545
495
|
await ctx.updateConfigProfile(accountId, merged);
|
|
546
496
|
ctx.log?.info(`[${accountId}] Profile imported and merged`);
|
|
547
|
-
sendJson(res, 200, {
|
|
548
|
-
ok: true,
|
|
549
|
-
imported: result.profile,
|
|
550
|
-
merged,
|
|
551
|
-
saved: true,
|
|
552
|
-
event: result.event,
|
|
553
|
-
sourceRelay: result.sourceRelay,
|
|
554
|
-
relaysQueried: result.relaysQueried
|
|
555
|
-
});
|
|
556
|
-
return true;
|
|
557
497
|
}
|
|
558
498
|
sendJson(res, 200, {
|
|
559
499
|
ok: true,
|
|
560
500
|
imported: result.profile,
|
|
561
|
-
|
|
501
|
+
...merged ? { merged } : {},
|
|
502
|
+
saved: merged !== void 0,
|
|
562
503
|
event: result.event,
|
|
563
504
|
sourceRelay: result.sourceRelay,
|
|
564
505
|
relaysQueried: result.relaysQueried
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as nostrPlugin } from "./.setup/channel-
|
|
1
|
+
import { n as nostrPlugin } from "./.setup/channel-D2d-FP8G.mjs";
|
|
2
2
|
export { nostrPlugin };
|
|
@@ -1,143 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { asFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
|
|
3
2
|
import fs from "node:fs/promises";
|
|
4
3
|
import path from "node:path";
|
|
5
|
-
import { archiveLegacyStateSource } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
6
4
|
//#region extensions/nostr/doctor-contract-api.ts
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
function parseBusState(value) {
|
|
11
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
12
|
-
const parsed = value;
|
|
13
|
-
if (parsed.version !== 1 && parsed.version !== 2) return null;
|
|
14
|
-
return {
|
|
15
|
-
version: 2,
|
|
16
|
-
lastProcessedAt: asFiniteNumber(parsed.lastProcessedAt) ?? null,
|
|
17
|
-
gatewayStartedAt: asFiniteNumber(parsed.gatewayStartedAt) ?? null,
|
|
18
|
-
recentEventIds: parsed.version === 2 && Array.isArray(parsed.recentEventIds) ? parsed.recentEventIds.filter((entry) => typeof entry === "string") : []
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function parseProfileState(value) {
|
|
22
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
23
|
-
const parsed = value;
|
|
24
|
-
if (parsed.version !== 1) return null;
|
|
25
|
-
const rawResults = parsed.lastPublishResults;
|
|
26
|
-
const lastPublishResults = {};
|
|
27
|
-
if (rawResults && typeof rawResults === "object" && !Array.isArray(rawResults)) {
|
|
28
|
-
for (const [relay, result] of Object.entries(rawResults)) if (result === "ok" || result === "failed" || result === "timeout") lastPublishResults[relay] = result;
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
version: 1,
|
|
32
|
-
lastPublishedAt: asFiniteNumber(parsed.lastPublishedAt) ?? null,
|
|
33
|
-
lastPublishedEventId: typeof parsed.lastPublishedEventId === "string" ? parsed.lastPublishedEventId : null,
|
|
34
|
-
lastPublishResults: rawResults === null || Object.keys(lastPublishResults).length === 0 ? null : lastPublishResults
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
async function readJsonFile(filePath) {
|
|
38
|
-
return JSON.parse(await fs.readFile(filePath, "utf8"));
|
|
39
|
-
}
|
|
40
|
-
async function listLegacyFiles(params) {
|
|
41
|
-
const dir = path.join(params.stateDir, "nostr");
|
|
42
|
-
let entries;
|
|
43
|
-
try {
|
|
44
|
-
entries = await fs.readdir(dir, { withFileTypes: true });
|
|
45
|
-
} catch {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
const suffix = ".json";
|
|
49
|
-
const files = [];
|
|
50
|
-
for (const entry of entries) {
|
|
51
|
-
if (!entry.isFile() || !entry.name.startsWith(params.prefix) || !entry.name.endsWith(suffix)) continue;
|
|
52
|
-
const rawAccountId = entry.name.slice(params.prefix.length, -5);
|
|
53
|
-
const accountId = normalizeNostrStateAccountId(rawAccountId);
|
|
54
|
-
const filePath = path.join(dir, entry.name);
|
|
5
|
+
function retiredNostrStateMigration(namespace, label) {
|
|
6
|
+
const warning = `${label} JSON imports were retired. Upgrade to OpenClaw 2026.9.5 and run openclaw doctor --fix before upgrading to the latest version. Legacy files were left untouched.`;
|
|
7
|
+
const hasLegacyState = async (stateDir) => {
|
|
55
8
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} catch {}
|
|
63
|
-
}
|
|
64
|
-
return files;
|
|
65
|
-
}
|
|
66
|
-
async function ensureStoreCapacity(params) {
|
|
67
|
-
const existingKeys = new Set((await params.store.entries()).map((entry) => entry.key));
|
|
68
|
-
const missingKeys = new Set(params.files.map((file) => file.accountId).filter((key) => !existingKeys.has(key)));
|
|
69
|
-
if (missingKeys.size > params.maxEntries - existingKeys.size) {
|
|
70
|
-
params.warnings.push(`Skipped migrating ${params.label} because plugin state has room for ${params.maxEntries - existingKeys.size} of ${missingKeys.size} missing entries; left legacy sources in place`);
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
return existingKeys;
|
|
74
|
-
}
|
|
75
|
-
function createNostrStateMigration(options) {
|
|
9
|
+
return (await fs.readdir(path.join(stateDir, "nostr"))).some((name) => name.startsWith(`${namespace}-`) && name.endsWith(".json"));
|
|
10
|
+
} catch (error) {
|
|
11
|
+
if (extractErrorCode(error) === "ENOENT") return false;
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
76
15
|
return {
|
|
77
|
-
id: `nostr-${
|
|
78
|
-
label
|
|
79
|
-
async detectLegacyState(
|
|
80
|
-
|
|
81
|
-
stateDir: params.stateDir,
|
|
82
|
-
prefix: `${options.namespace}-`,
|
|
83
|
-
parse: options.parse
|
|
84
|
-
});
|
|
85
|
-
if (files.length === 0) return null;
|
|
86
|
-
return { preview: [`- ${options.label}: ${files.length} ${files.length === 1 ? "account" : "accounts"} -> plugin state (${options.namespace})`] };
|
|
16
|
+
id: `nostr-${namespace}-json-to-plugin-state`,
|
|
17
|
+
label,
|
|
18
|
+
async detectLegacyState({ stateDir }) {
|
|
19
|
+
return await hasLegacyState(stateDir) ? { preview: [warning] } : null;
|
|
87
20
|
},
|
|
88
|
-
async migrateLegacyState(
|
|
89
|
-
const changes = [];
|
|
90
|
-
const warnings = [];
|
|
91
|
-
const files = await listLegacyFiles({
|
|
92
|
-
stateDir: params.stateDir,
|
|
93
|
-
prefix: `${options.namespace}-`,
|
|
94
|
-
parse: options.parse
|
|
95
|
-
});
|
|
96
|
-
const store = params.context.openPluginStateKeyedStore({
|
|
97
|
-
namespace: options.namespace,
|
|
98
|
-
maxEntries: MAX_NOSTR_STATE_ENTRIES
|
|
99
|
-
});
|
|
100
|
-
const existingKeys = await ensureStoreCapacity({
|
|
101
|
-
files,
|
|
102
|
-
store,
|
|
103
|
-
maxEntries: MAX_NOSTR_STATE_ENTRIES,
|
|
104
|
-
label: options.label,
|
|
105
|
-
warnings
|
|
106
|
-
});
|
|
107
|
-
if (!existingKeys) return {
|
|
108
|
-
changes,
|
|
109
|
-
warnings
|
|
110
|
-
};
|
|
111
|
-
let imported = 0;
|
|
112
|
-
for (const file of files) {
|
|
113
|
-
if (!existingKeys.has(file.accountId)) {
|
|
114
|
-
await store.register(file.accountId, file.value);
|
|
115
|
-
existingKeys.add(file.accountId);
|
|
116
|
-
imported++;
|
|
117
|
-
}
|
|
118
|
-
await archiveLegacyStateSource({
|
|
119
|
-
filePath: file.filePath,
|
|
120
|
-
label: options.label,
|
|
121
|
-
changes,
|
|
122
|
-
warnings
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
if (imported > 0) changes.unshift(`Migrated ${imported} Nostr ${options.namespace} ${imported === 1 ? "entry" : "entries"} -> plugin state`);
|
|
21
|
+
async migrateLegacyState({ stateDir }) {
|
|
126
22
|
return {
|
|
127
|
-
changes,
|
|
128
|
-
warnings
|
|
23
|
+
changes: [],
|
|
24
|
+
warnings: await hasLegacyState(stateDir) ? [warning] : []
|
|
129
25
|
};
|
|
130
26
|
}
|
|
131
27
|
};
|
|
132
28
|
}
|
|
133
|
-
const stateMigrations = [
|
|
134
|
-
namespace: BUS_STATE_NAMESPACE,
|
|
135
|
-
label: "Nostr bus state",
|
|
136
|
-
parse: parseBusState
|
|
137
|
-
}), createNostrStateMigration({
|
|
138
|
-
namespace: PROFILE_STATE_NAMESPACE,
|
|
139
|
-
label: "Nostr profile state",
|
|
140
|
-
parse: parseProfileState
|
|
141
|
-
})];
|
|
29
|
+
const stateMigrations = [retiredNostrStateMigration("bus-state", "Nostr bus state"), retiredNostrStateMigration("profile-state", "Nostr profile state")];
|
|
142
30
|
//#endregion
|
|
143
31
|
export { stateMigrations };
|
package/dist/setup-entry.js
CHANGED
|
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
5
5
|
importMetaUrl: import.meta.url,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: fileURLToPath(new URL(".setup/setup-plugin-api-
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/setup-plugin-api-BhRAS2I1.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "nostrSetupPlugin"
|
|
9
9
|
},
|
|
10
10
|
secrets: {
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as nostrSetupPlugin } from "./.setup/setup-plugin-api-
|
|
1
|
+
import { t as nostrSetupPlugin } from "./.setup/setup-plugin-api-Ci0XxWqb.mjs";
|
|
2
2
|
export { nostrSetupPlugin };
|
|
@@ -155,13 +155,13 @@ try {
|
|
|
155
155
|
expected: 'string',
|
|
156
156
|
code: 'invalid_type',
|
|
157
157
|
path: [ 'username' ],
|
|
158
|
-
message: 'Invalid input: expected string'
|
|
158
|
+
message: 'Invalid input: expected string, received number'
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
161
|
expected: 'number',
|
|
162
162
|
code: 'invalid_type',
|
|
163
163
|
path: [ 'xp' ],
|
|
164
|
-
message: 'Invalid input: expected number'
|
|
164
|
+
message: 'Invalid input: expected number, received string'
|
|
165
165
|
}
|
|
166
166
|
] */
|
|
167
167
|
}
|
|
@@ -75,3 +75,22 @@ core.globalConfig.postProcessor = (inst) => {
|
|
|
75
75
|
shim.__originalRun = originalRun;
|
|
76
76
|
inst._zod.run = shim;
|
|
77
77
|
};
|
|
78
|
+
|
|
79
|
+
// seal-cjs-exports
|
|
80
|
+
(function () {
|
|
81
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
82
|
+
for (var i = 0; i < keys.length; i++) {
|
|
83
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
84
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
85
|
+
var value;
|
|
86
|
+
try {
|
|
87
|
+
value = desc.get();
|
|
88
|
+
} catch (e) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
92
|
+
if (value === undefined) continue;
|
|
93
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
94
|
+
}
|
|
95
|
+
Object.freeze(exports);
|
|
96
|
+
})();
|
|
@@ -31,3 +31,22 @@ const z = __importStar(require("./v4/classic/external.cjs"));
|
|
|
31
31
|
exports.z = z;
|
|
32
32
|
exports.default = z;
|
|
33
33
|
__exportStar(require("./v4/classic/external.cjs"), exports);
|
|
34
|
+
|
|
35
|
+
// seal-cjs-exports
|
|
36
|
+
(function () {
|
|
37
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
38
|
+
for (var i = 0; i < keys.length; i++) {
|
|
39
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
40
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
41
|
+
var value;
|
|
42
|
+
try {
|
|
43
|
+
value = desc.get();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
48
|
+
if (value === undefined) continue;
|
|
49
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
50
|
+
}
|
|
51
|
+
Object.freeze(exports);
|
|
52
|
+
})();
|
|
@@ -15,3 +15,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("../v4/locales/index.cjs"), exports);
|
|
18
|
+
|
|
19
|
+
// seal-cjs-exports
|
|
20
|
+
(function () {
|
|
21
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
22
|
+
for (var i = 0; i < keys.length; i++) {
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
24
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
25
|
+
var value;
|
|
26
|
+
try {
|
|
27
|
+
value = desc.get();
|
|
28
|
+
} catch (e) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
32
|
+
if (value === undefined) continue;
|
|
33
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
34
|
+
}
|
|
35
|
+
Object.freeze(exports);
|
|
36
|
+
})();
|
|
@@ -30,3 +30,22 @@ exports.z = void 0;
|
|
|
30
30
|
const z = __importStar(require("../v4/mini/external.cjs"));
|
|
31
31
|
exports.z = z;
|
|
32
32
|
__exportStar(require("../v4/mini/external.cjs"), exports);
|
|
33
|
+
|
|
34
|
+
// seal-cjs-exports
|
|
35
|
+
(function () {
|
|
36
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
37
|
+
for (var i = 0; i < keys.length; i++) {
|
|
38
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
39
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
40
|
+
var value;
|
|
41
|
+
try {
|
|
42
|
+
value = desc.get();
|
|
43
|
+
} catch (e) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
47
|
+
if (value === undefined) continue;
|
|
48
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
49
|
+
}
|
|
50
|
+
Object.freeze(exports);
|
|
51
|
+
})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod",
|
|
3
|
-
"version": "4.5
|
|
3
|
+
"version": "4.6.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colin McDonnell <zod@colinhacks.com>",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
"conditions": {
|
|
54
54
|
"@zod/source": "src"
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"sealCjsExports": true
|
|
56
57
|
},
|
|
57
58
|
"exports": {
|
|
58
59
|
"./package.json": "./package.json",
|
|
@@ -137,10 +138,10 @@
|
|
|
137
138
|
},
|
|
138
139
|
"scripts": {
|
|
139
140
|
"clean": "git clean -xdf . -e node_modules",
|
|
140
|
-
"build": "zshy --project tsconfig.build.json",
|
|
141
|
-
"postbuild": "
|
|
142
|
-
"test:watch": "
|
|
143
|
-
"test": "
|
|
144
|
-
"prepublishOnly": "
|
|
141
|
+
"build": "nub exec --node zshy --project tsconfig.build.json",
|
|
142
|
+
"postbuild": "nub ../../scripts/write-stub-package-jsons.ts && nub exec --node biome check --write .",
|
|
143
|
+
"test:watch": "nub exec --node vitest",
|
|
144
|
+
"test": "nub exec --node vitest run",
|
|
145
|
+
"prepublishOnly": "nub ../../scripts/check-versions.ts"
|
|
145
146
|
}
|
|
146
147
|
}
|
|
@@ -2,7 +2,7 @@ export namespace errorUtil {
|
|
|
2
2
|
export type ErrMessage = string | { message?: string | undefined };
|
|
3
3
|
export const errToObj = (message?: ErrMessage): { message?: string | undefined } =>
|
|
4
4
|
typeof message === "string" ? { message } : message || {};
|
|
5
|
-
// biome-ignore lint:
|
|
5
|
+
// biome-ignore lint/suspicious/noShadowRestrictedNames: renaming churns 31 v3 call sites
|
|
6
6
|
export const toString = (message?: ErrMessage): string | undefined =>
|
|
7
7
|
typeof message === "string" ? message : message?.message;
|
|
8
8
|
}
|