@openclaw/nostr 2026.7.2-beta.5 → 2026.7.33
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/dist/{channel-DNeI-LB-.js → .setup/channel-B4SX7Iq6.mjs} +552 -886
- package/dist/{config-schema-CelPzg1N.js → .setup/config-schema-DIiXiBKr.mjs} +1 -1
- package/dist/.setup/inbound-direct-dm-runtime-EdLLVtkh.mjs +2 -0
- package/dist/{setup-adapter-BjKmSwdW.js → .setup/setup-adapter-DEU3o8MF.mjs} +1 -31
- package/dist/.setup/setup-plugin-api-DzlCumkz.mjs +2 -0
- package/dist/.setup/setup-plugin-api-csfJrRxD.mjs +111 -0
- package/dist/{setup-surface-BJCFpe02.js → .setup/setup-surface-DWa6-9ku.mjs} +70 -41
- package/dist/api.js +70 -56
- package/dist/channel-plugin-api.js +1 -1
- package/dist/doctor-contract-api.js +3 -2
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +2 -1
- package/dist/setup-plugin-api.js +1 -112
- package/node_modules/nostr-tools/lib/cjs/abstract-pool.js +3 -35
- package/node_modules/nostr-tools/lib/cjs/abstract-pool.js.map +2 -2
- package/node_modules/nostr-tools/lib/cjs/abstract-relay.js +2 -30
- package/node_modules/nostr-tools/lib/cjs/abstract-relay.js.map +2 -2
- package/node_modules/nostr-tools/lib/cjs/index.js +3 -35
- package/node_modules/nostr-tools/lib/cjs/index.js.map +2 -2
- package/node_modules/nostr-tools/lib/cjs/nip46.js +3 -35
- package/node_modules/nostr-tools/lib/cjs/nip46.js.map +2 -2
- package/node_modules/nostr-tools/lib/cjs/nipb0.js +1 -4
- package/node_modules/nostr-tools/lib/cjs/nipb0.js.map +2 -2
- package/node_modules/nostr-tools/lib/cjs/pool.js +3 -35
- package/node_modules/nostr-tools/lib/cjs/pool.js.map +2 -2
- package/node_modules/nostr-tools/lib/cjs/relay.js +2 -30
- package/node_modules/nostr-tools/lib/cjs/relay.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/abstract-pool.js +3 -35
- package/node_modules/nostr-tools/lib/esm/abstract-pool.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/abstract-relay.js +2 -30
- package/node_modules/nostr-tools/lib/esm/abstract-relay.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/index.js +3 -35
- package/node_modules/nostr-tools/lib/esm/index.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/nip46.js +3 -35
- package/node_modules/nostr-tools/lib/esm/nip46.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/nipb0.js +1 -4
- package/node_modules/nostr-tools/lib/esm/nipb0.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/pool.js +3 -35
- package/node_modules/nostr-tools/lib/esm/pool.js.map +2 -2
- package/node_modules/nostr-tools/lib/esm/relay.js +2 -30
- package/node_modules/nostr-tools/lib/esm/relay.js.map +2 -2
- package/node_modules/nostr-tools/lib/nostr.bundle.js +3 -35
- package/node_modules/nostr-tools/lib/nostr.bundle.js.map +2 -2
- package/node_modules/nostr-tools/lib/types/abstract-pool.d.ts +0 -1
- package/node_modules/nostr-tools/lib/types/abstract-relay.d.ts +0 -5
- package/node_modules/nostr-tools/lib/types/relay.d.ts +2 -2
- package/node_modules/nostr-tools/package.json +1 -1
- package/openclaw.plugin.json +5 -0
- package/package.json +15 -41
- package/dist/inbound-direct-dm-runtime-DHn9NoYN.js +0 -2
- /package/dist/{state-account-id-CvBZ9s6P.js → .setup/state-account-id-CvBZ9s6P.mjs} +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/LICENSE +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/README.md +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_arx.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_arx.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_arx.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_arx.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_poly1305.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_poly1305.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_poly1305.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_poly1305.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_polyval.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_polyval.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_polyval.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/_polyval.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/aes.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/aes.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/aes.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/aes.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/chacha.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/chacha.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/chacha.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/chacha.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/ff1.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/ff1.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/ff1.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/ff1.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/index.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/index.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/index.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/index.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/package.json +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/salsa.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/salsa.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/salsa.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/salsa.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/_arx.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/_poly1305.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/_polyval.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/aes.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/chacha.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/ff1.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/index.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/salsa.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/utils.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/src/webcrypto.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/utils.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/utils.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/utils.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/utils.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/webcrypto.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/webcrypto.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/webcrypto.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/ciphers/webcrypto.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/LICENSE +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/README.md +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/bls.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/bls.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/bls.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/bls.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/curve.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/curve.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/curve.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/curve.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/edwards.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/edwards.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/edwards.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/edwards.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/fft.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/fft.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/fft.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/fft.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/hash-to-curve.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/hash-to-curve.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/hash-to-curve.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/hash-to-curve.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/modular.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/modular.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/modular.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/modular.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/montgomery.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/montgomery.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/montgomery.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/montgomery.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/oprf.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/oprf.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/oprf.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/oprf.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/poseidon.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/poseidon.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/poseidon.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/poseidon.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/tower.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/tower.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/tower.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/tower.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/weierstrass.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/weierstrass.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/weierstrass.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/abstract/weierstrass.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bls12-381.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bls12-381.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bls12-381.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bls12-381.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bn254.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bn254.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bn254.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/bn254.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed25519.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed25519.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed25519.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed25519.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed448.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed448.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed448.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/ed448.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/index.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/index.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/index.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/index.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/misc.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/misc.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/misc.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/misc.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/nist.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/nist.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/nist.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/nist.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/package.json +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/secp256k1.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/secp256k1.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/secp256k1.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/secp256k1.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/bls.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/curve.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/edwards.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/fft.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/hash-to-curve.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/modular.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/montgomery.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/oprf.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/poseidon.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/tower.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/abstract/weierstrass.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/bls12-381.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/bn254.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/ed25519.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/ed448.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/index.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/misc.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/nist.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/secp256k1.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/utils.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/src/webcrypto.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/utils.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/utils.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/utils.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/utils.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/webcrypto.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/webcrypto.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/webcrypto.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/curves/webcrypto.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/LICENSE +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/README.md +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_blake.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_blake.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_blake.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_blake.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_md.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_md.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_md.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_md.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_u64.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_u64.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_u64.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/_u64.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/argon2.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/argon2.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/argon2.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/argon2.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake1.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake1.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake1.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake1.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake2.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake2.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake2.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake2.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake3.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake3.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake3.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/blake3.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/eskdf.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/eskdf.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/eskdf.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/eskdf.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hkdf.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hkdf.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hkdf.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hkdf.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hmac.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hmac.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hmac.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/hmac.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/index.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/index.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/index.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/index.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/legacy.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/legacy.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/legacy.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/legacy.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/package.json +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/pbkdf2.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/pbkdf2.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/pbkdf2.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/pbkdf2.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/scrypt.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/scrypt.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/scrypt.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/scrypt.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha2.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha2.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha2.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha2.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3-addons.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3-addons.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3-addons.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3-addons.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/sha3.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/_blake.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/_md.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/_u64.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/argon2.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/blake1.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/blake2.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/blake3.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/eskdf.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/hkdf.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/hmac.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/index.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/legacy.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/pbkdf2.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/scrypt.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/sha2.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/sha3-addons.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/sha3.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/utils.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/src/webcrypto.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/utils.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/utils.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/utils.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/utils.js.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/webcrypto.d.ts +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/webcrypto.d.ts.map +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/webcrypto.js +0 -0
- /package/node_modules/{@noble → nostr-tools/node_modules/@noble}/hashes/webcrypto.js.map +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/LICENSE +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/README.md +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/index.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/index.d.ts.map +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/index.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/index.js.map +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/index.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/base/package.json +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/LICENSE +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/README.md +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/index.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/index.d.ts.map +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/index.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/index.js.map +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/index.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip32/package.json +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/LICENSE +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/README.md +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/index.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/index.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/package.json +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/src/index.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/czech.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/czech.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/english.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/english.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/french.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/french.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/italian.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/italian.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/japanese.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/japanese.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/korean.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/korean.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/portuguese.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/portuguese.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/simplified-chinese.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/simplified-chinese.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/spanish.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/spanish.js +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/traditional-chinese.d.ts +0 -0
- /package/node_modules/{@scure → nostr-tools/node_modules/@scure}/bip39/wordlists/traditional-chinese.js +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/README.md +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/api/emsimp.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/api/nostr.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/api/secp256k1-types.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/api/secp256k1.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/api/types.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/api/wasm-env.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/gen/wasm.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/generate.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/gzipped.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/gzipped.js +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/headless.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/main.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/main.js +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/nostr.js +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/secp256k1.js +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/dist/types.d.ts +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/package.json +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/public/out/secp256k1.js +0 -0
- /package/node_modules/{nostr-wasm → nostr-tools/node_modules/nostr-wasm}/public/out/secp256k1.wasm +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { collectStatusIssuesFromLastError, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, formatPairingApproveHint } from "openclaw/plugin-sdk/channel-plugin-common";
|
|
3
|
-
import { AllowFromListSchema, DmPolicySchema, MarkdownConfigSchema } from "openclaw/plugin-sdk/channel-config-
|
|
3
|
+
import { AllowFromListSchema, DmPolicySchema, MarkdownConfigSchema } from "openclaw/plugin-sdk/channel-config-primitives";
|
|
4
4
|
import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region extensions/nostr/src/config-schema.ts
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
|
|
3
3
|
import { patchTopLevelChannelConfigSection, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
4
|
-
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
5
4
|
//#region extensions/nostr/src/default-relays.ts
|
|
6
5
|
const DEFAULT_RELAYS = ["wss://relay.damus.io", "wss://nos.lol"];
|
|
7
6
|
//#endregion
|
|
@@ -66,34 +65,5 @@ function createNostrSetupAdapter(params) {
|
|
|
66
65
|
}
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
|
-
function createNostrSetupContract(adapter) {
|
|
70
|
-
return defineChannelSetupContract({
|
|
71
|
-
fields: {
|
|
72
|
-
privateKey: {
|
|
73
|
-
kind: "string",
|
|
74
|
-
sensitive: true,
|
|
75
|
-
cli: {
|
|
76
|
-
flags: "--private-key <key>",
|
|
77
|
-
description: "Nostr private key"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
relayUrls: {
|
|
81
|
-
kind: "string",
|
|
82
|
-
cli: {
|
|
83
|
-
flags: "--relay-urls <urls>",
|
|
84
|
-
description: "Nostr relay URLs"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
useEnv: {
|
|
88
|
-
kind: "boolean",
|
|
89
|
-
cli: {
|
|
90
|
-
flags: "--use-env",
|
|
91
|
-
description: "Use NOSTR_PRIVATE_KEY"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
legacyAdapter: adapter
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
68
|
//#endregion
|
|
99
|
-
export { DEFAULT_RELAYS as
|
|
69
|
+
export { DEFAULT_RELAYS as i, createNostrSetupAdapter as n, parseRelayUrls as r, buildNostrSetupPatch as t };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { i as buildChannelConfigSchema, t as NostrConfigSchema } from "./config-schema-DIiXiBKr.mjs";
|
|
2
|
+
import { i as DEFAULT_RELAYS, n as createNostrSetupAdapter } from "./setup-adapter-DEU3o8MF.mjs";
|
|
3
|
+
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
4
|
+
import { DEFAULT_ACCOUNT_ID, createDelegatedSetupWizardProxy, createSetupTranslator, createStandardChannelSetupStatus } from "openclaw/plugin-sdk/setup-runtime";
|
|
5
|
+
//#region extensions/nostr/src/channel.setup.ts
|
|
6
|
+
const t = createSetupTranslator();
|
|
7
|
+
const channel = "nostr";
|
|
8
|
+
function getNostrConfig(cfg) {
|
|
9
|
+
return cfg.channels?.nostr;
|
|
10
|
+
}
|
|
11
|
+
function listSetupNostrAccountIds(cfg) {
|
|
12
|
+
const nostrCfg = getNostrConfig(cfg);
|
|
13
|
+
if (!(typeof nostrCfg?.privateKey === "string" ? nostrCfg.privateKey.trim() : "")) return [];
|
|
14
|
+
return [resolveDefaultSetupNostrAccountId(cfg)];
|
|
15
|
+
}
|
|
16
|
+
function resolveDefaultSetupNostrAccountId(cfg) {
|
|
17
|
+
const configured = getNostrConfig(cfg)?.defaultAccount;
|
|
18
|
+
return typeof configured === "string" && configured.trim() ? configured.trim() : DEFAULT_ACCOUNT_ID;
|
|
19
|
+
}
|
|
20
|
+
function resolveSetupNostrAccount(params) {
|
|
21
|
+
const nostrCfg = getNostrConfig(params.cfg);
|
|
22
|
+
const accountId = params.accountId?.trim() || resolveDefaultSetupNostrAccountId(params.cfg);
|
|
23
|
+
const privateKey = typeof nostrCfg?.privateKey === "string" ? nostrCfg.privateKey.trim() : "";
|
|
24
|
+
const configured = Boolean(privateKey);
|
|
25
|
+
return {
|
|
26
|
+
accountId,
|
|
27
|
+
name: typeof nostrCfg?.name === "string" ? nostrCfg.name : void 0,
|
|
28
|
+
enabled: nostrCfg?.enabled !== false,
|
|
29
|
+
configured,
|
|
30
|
+
privateKey,
|
|
31
|
+
publicKey: "",
|
|
32
|
+
relays: nostrCfg?.relays ?? DEFAULT_RELAYS,
|
|
33
|
+
profile: nostrCfg?.profile,
|
|
34
|
+
config: {
|
|
35
|
+
enabled: nostrCfg?.enabled,
|
|
36
|
+
name: nostrCfg?.name,
|
|
37
|
+
privateKey: nostrCfg?.privateKey,
|
|
38
|
+
relays: nostrCfg?.relays,
|
|
39
|
+
dmPolicy: nostrCfg?.dmPolicy,
|
|
40
|
+
allowFrom: nostrCfg?.allowFrom,
|
|
41
|
+
profile: nostrCfg?.profile
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function looksLikeNostrPrivateKey(privateKey) {
|
|
46
|
+
return privateKey.startsWith("nsec1") || /^[0-9a-fA-F]{64}$/.test(privateKey);
|
|
47
|
+
}
|
|
48
|
+
const nostrSetupAdapter = createNostrSetupAdapter({
|
|
49
|
+
resolveAccountId: (cfg, accountId) => accountId?.trim() || resolveDefaultSetupNostrAccountId(cfg),
|
|
50
|
+
validatePrivateKey: looksLikeNostrPrivateKey
|
|
51
|
+
});
|
|
52
|
+
const nostrSetupWizard = createDelegatedSetupWizardProxy({
|
|
53
|
+
channel,
|
|
54
|
+
loadWizard: async () => (await import("./setup-surface-DWa6-9ku.mjs").then((n) => n.r)).nostrSetupWizard,
|
|
55
|
+
status: { ...createStandardChannelSetupStatus({
|
|
56
|
+
channelLabel: "Nostr",
|
|
57
|
+
configuredLabel: t("wizard.channels.statusConfigured"),
|
|
58
|
+
unconfiguredLabel: t("wizard.channels.statusNeedsPrivateKey"),
|
|
59
|
+
configuredHint: t("wizard.channels.statusConfigured"),
|
|
60
|
+
unconfiguredHint: t("wizard.channels.statusNeedsPrivateKey"),
|
|
61
|
+
configuredScore: 1,
|
|
62
|
+
unconfiguredScore: 0,
|
|
63
|
+
includeStatusLine: true,
|
|
64
|
+
resolveConfigured: ({ cfg, accountId }) => resolveSetupNostrAccount({
|
|
65
|
+
cfg,
|
|
66
|
+
accountId
|
|
67
|
+
}).configured,
|
|
68
|
+
resolveExtraStatusLines: ({ cfg }) => {
|
|
69
|
+
return [`Relays: ${resolveSetupNostrAccount({ cfg }).relays.length || DEFAULT_RELAYS.length}`];
|
|
70
|
+
}
|
|
71
|
+
}) },
|
|
72
|
+
resolveShouldPromptAccountIds: () => false,
|
|
73
|
+
delegatePrepare: true,
|
|
74
|
+
delegateFinalize: true
|
|
75
|
+
});
|
|
76
|
+
const nostrSetupPlugin = {
|
|
77
|
+
id: channel,
|
|
78
|
+
meta: {
|
|
79
|
+
id: channel,
|
|
80
|
+
label: "Nostr",
|
|
81
|
+
selectionLabel: "Nostr",
|
|
82
|
+
docsPath: "/channels/nostr",
|
|
83
|
+
docsLabel: "nostr",
|
|
84
|
+
blurb: "Decentralized DMs via Nostr relays (NIP-04)",
|
|
85
|
+
order: 100
|
|
86
|
+
},
|
|
87
|
+
capabilities: {
|
|
88
|
+
chatTypes: ["direct"],
|
|
89
|
+
media: false
|
|
90
|
+
},
|
|
91
|
+
reload: { configPrefixes: ["channels.nostr"] },
|
|
92
|
+
configSchema: buildChannelConfigSchema(NostrConfigSchema),
|
|
93
|
+
setup: nostrSetupAdapter,
|
|
94
|
+
setupWizard: nostrSetupWizard,
|
|
95
|
+
config: {
|
|
96
|
+
listAccountIds: listSetupNostrAccountIds,
|
|
97
|
+
resolveAccount: (cfg, accountId) => resolveSetupNostrAccount({
|
|
98
|
+
cfg,
|
|
99
|
+
accountId
|
|
100
|
+
}),
|
|
101
|
+
defaultAccountId: resolveDefaultSetupNostrAccountId,
|
|
102
|
+
isConfigured: (account) => account.configured,
|
|
103
|
+
describeAccount: (account) => describeAccountSnapshot({
|
|
104
|
+
account,
|
|
105
|
+
configured: account.configured,
|
|
106
|
+
extra: { publicKey: account.publicKey }
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
111
|
+
export { nostrSetupPlugin as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
|
1
|
+
import { i as DEFAULT_RELAYS, n as createNostrSetupAdapter, r as parseRelayUrls, t as buildNostrSetupPatch } from "./setup-adapter-DEU3o8MF.mjs";
|
|
3
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
3
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
5
4
|
import { getPublicKey, nip19 } from "nostr-tools";
|
|
6
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
|
+
import { listCombinedAccountIds, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
7
7
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/routing";
|
|
8
|
-
import { createSetupTranslator, createStandardChannelSetupStatus, createTopLevelChannelDmPolicy, createTopLevelChannelParsedAllowFromPrompt,
|
|
8
|
+
import { createSetupTranslator, createStandardChannelSetupStatus, createTopLevelChannelDmPolicy, createTopLevelChannelParsedAllowFromPrompt, formatDocsLink, mergeAllowFromEntries, parseSetupEntriesWithParser, patchTopLevelChannelConfigSection } from "openclaw/plugin-sdk/setup";
|
|
9
9
|
//#region \0rolldown/runtime.js
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
11
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -24,7 +24,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
24
24
|
*/
|
|
25
25
|
function validatePrivateKey(key) {
|
|
26
26
|
const trimmed = key.trim();
|
|
27
|
-
if (trimmed.startsWith("nsec1")
|
|
27
|
+
if (trimmed.startsWith("nsec1")) {
|
|
28
28
|
const decoded = nip19.decode(trimmed);
|
|
29
29
|
if (decoded.type !== "nsec") throw new Error("Invalid nsec key: wrong type");
|
|
30
30
|
return decoded.data;
|
|
@@ -38,14 +38,15 @@ function validatePrivateKey(key) {
|
|
|
38
38
|
* Get public key from private key (hex or nsec format)
|
|
39
39
|
*/
|
|
40
40
|
function getPublicKeyFromPrivate(privateKey) {
|
|
41
|
-
|
|
41
|
+
const sk = validatePrivateKey(privateKey);
|
|
42
|
+
return getPublicKey(sk);
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* Normalize a pubkey to hex format (accepts npub or hex)
|
|
45
46
|
*/
|
|
46
47
|
function normalizePubkey(input) {
|
|
47
48
|
const trimmed = input.trim();
|
|
48
|
-
if (trimmed.startsWith("npub1")
|
|
49
|
+
if (trimmed.startsWith("npub1")) {
|
|
49
50
|
const decoded = nip19.decode(trimmed);
|
|
50
51
|
if (decoded.type !== "npub" || typeof decoded.data !== "string") throw new Error("Invalid npub key");
|
|
51
52
|
return decoded.data.toLowerCase();
|
|
@@ -55,13 +56,30 @@ function normalizePubkey(input) {
|
|
|
55
56
|
}
|
|
56
57
|
//#endregion
|
|
57
58
|
//#region extensions/nostr/src/types.ts
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
function resolveConfiguredDefaultNostrAccountId(cfg) {
|
|
60
|
+
const nostrCfg = cfg.channels?.nostr;
|
|
61
|
+
return normalizeOptionalAccountId(nostrCfg?.defaultAccount);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* List all configured Nostr account IDs
|
|
65
|
+
*/
|
|
66
|
+
function listNostrAccountIds(cfg) {
|
|
67
|
+
const nostrCfg = cfg.channels?.nostr;
|
|
68
|
+
const privateKey = normalizeSecretInputString(nostrCfg?.privateKey);
|
|
69
|
+
return listCombinedAccountIds({
|
|
70
|
+
configuredAccountIds: [],
|
|
71
|
+
implicitAccountId: privateKey ? resolveConfiguredDefaultNostrAccountId(cfg) ?? DEFAULT_ACCOUNT_ID : void 0
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get the default account ID
|
|
76
|
+
*/
|
|
77
|
+
function resolveDefaultNostrAccountId(cfg) {
|
|
78
|
+
return resolveListedDefaultAccountId({
|
|
79
|
+
accountIds: listNostrAccountIds(cfg),
|
|
80
|
+
configuredDefaultAccountId: resolveConfiguredDefaultNostrAccountId(cfg)
|
|
81
|
+
});
|
|
82
|
+
}
|
|
65
83
|
/**
|
|
66
84
|
* Resolve a Nostr account from config
|
|
67
85
|
*/
|
|
@@ -99,7 +117,6 @@ function resolveNostrAccount(opts) {
|
|
|
99
117
|
//#region extensions/nostr/src/setup-surface.ts
|
|
100
118
|
var setup_surface_exports = /* @__PURE__ */ __exportAll({
|
|
101
119
|
nostrSetupAdapter: () => nostrSetupAdapter,
|
|
102
|
-
nostrSetupContract: () => nostrSetupContract,
|
|
103
120
|
nostrSetupWizard: () => nostrSetupWizard
|
|
104
121
|
});
|
|
105
122
|
const t = createSetupTranslator();
|
|
@@ -129,22 +146,23 @@ function parseNostrAllowFrom(raw) {
|
|
|
129
146
|
}
|
|
130
147
|
});
|
|
131
148
|
}
|
|
149
|
+
const promptNostrAllowFrom = createTopLevelChannelParsedAllowFromPrompt({
|
|
150
|
+
channel,
|
|
151
|
+
defaultAccountId: resolveDefaultNostrAccountId,
|
|
152
|
+
noteTitle: t("wizard.nostr.allowlistTitle"),
|
|
153
|
+
noteLines: NOSTR_ALLOW_FROM_HELP_LINES,
|
|
154
|
+
message: t("wizard.nostr.allowFromPrompt"),
|
|
155
|
+
placeholder: "npub1..., 0123abcd...",
|
|
156
|
+
parseEntries: parseNostrAllowFrom,
|
|
157
|
+
mergeEntries: ({ existing, parsed }) => mergeAllowFromEntries(existing, parsed)
|
|
158
|
+
});
|
|
132
159
|
const nostrDmPolicy = createTopLevelChannelDmPolicy({
|
|
133
160
|
label: "Nostr",
|
|
134
161
|
channel,
|
|
135
162
|
policyKey: "channels.nostr.dmPolicy",
|
|
136
163
|
allowFromKey: "channels.nostr.allowFrom",
|
|
137
164
|
getCurrent: (cfg) => cfg.channels?.nostr?.dmPolicy ?? "pairing",
|
|
138
|
-
promptAllowFrom:
|
|
139
|
-
channel,
|
|
140
|
-
defaultAccountId: resolveDefaultNostrAccountId,
|
|
141
|
-
noteTitle: t("wizard.nostr.allowlistTitle"),
|
|
142
|
-
noteLines: NOSTR_ALLOW_FROM_HELP_LINES,
|
|
143
|
-
message: t("wizard.nostr.allowFromPrompt"),
|
|
144
|
-
placeholder: "npub1..., 0123abcd...",
|
|
145
|
-
parseEntries: parseNostrAllowFrom,
|
|
146
|
-
mergeEntries: ({ existing, parsed }) => mergeAllowFromEntries(existing, parsed)
|
|
147
|
-
})
|
|
165
|
+
promptAllowFrom: promptNostrAllowFrom
|
|
148
166
|
});
|
|
149
167
|
const nostrSetupAdapter = createNostrSetupAdapter({
|
|
150
168
|
resolveAccountId: (cfg, accountId) => accountId?.trim() || resolveDefaultNostrAccountId(cfg),
|
|
@@ -157,7 +175,6 @@ const nostrSetupAdapter = createNostrSetupAdapter({
|
|
|
157
175
|
}
|
|
158
176
|
}
|
|
159
177
|
});
|
|
160
|
-
const nostrSetupContract = createNostrSetupContract(nostrSetupAdapter);
|
|
161
178
|
const nostrSetupWizard = {
|
|
162
179
|
channel,
|
|
163
180
|
resolveAccountIdForConfigure: ({ accountOverride, defaultAccountId }) => accountOverride?.trim() || defaultAccountId,
|
|
@@ -195,9 +212,8 @@ const nostrSetupWizard = {
|
|
|
195
212
|
patch: buildNostrSetupPatch(accountId, {})
|
|
196
213
|
})
|
|
197
214
|
},
|
|
198
|
-
credentials: [
|
|
215
|
+
credentials: [{
|
|
199
216
|
inputKey: "privateKey",
|
|
200
|
-
configKey: "privateKey",
|
|
201
217
|
providerHint: channel,
|
|
202
218
|
credentialLabel: "private key",
|
|
203
219
|
preferredEnvVar: "NOSTR_PRIVATE_KEY",
|
|
@@ -207,23 +223,32 @@ const nostrSetupWizard = {
|
|
|
207
223
|
keepPrompt: t("wizard.nostr.privateKeyKeep"),
|
|
208
224
|
inputPrompt: t("wizard.nostr.privateKeyInput"),
|
|
209
225
|
allowEnv: ({ accountId }) => accountId === DEFAULT_ACCOUNT_ID$1,
|
|
210
|
-
|
|
226
|
+
inspect: ({ cfg, accountId }) => {
|
|
227
|
+
const account = resolveNostrAccount({
|
|
228
|
+
cfg,
|
|
229
|
+
accountId
|
|
230
|
+
});
|
|
231
|
+
return {
|
|
232
|
+
accountConfigured: account.configured,
|
|
233
|
+
hasConfiguredValue: hasConfiguredSecretInput(account.config.privateKey),
|
|
234
|
+
resolvedValue: normalizeSecretInputString(account.config.privateKey),
|
|
235
|
+
envValue: process.env.NOSTR_PRIVATE_KEY?.trim()
|
|
236
|
+
};
|
|
237
|
+
},
|
|
238
|
+
applyUseEnv: async ({ cfg, accountId }) => patchTopLevelChannelConfigSection({
|
|
211
239
|
cfg,
|
|
212
|
-
|
|
240
|
+
channel,
|
|
241
|
+
enabled: true,
|
|
242
|
+
clearFields: ["privateKey"],
|
|
243
|
+
patch: buildNostrSetupPatch(accountId, {})
|
|
213
244
|
}),
|
|
214
|
-
|
|
215
|
-
resolvedValue: (account) => normalizeSecretInputString(account.config.privateKey),
|
|
216
|
-
envValue: () => process.env.NOSTR_PRIVATE_KEY?.trim(),
|
|
217
|
-
patchAccount: ({ cfg, accountId, patch, clearFields }) => patchTopLevelChannelConfigSection({
|
|
245
|
+
applySet: async ({ cfg, accountId, resolvedValue }) => patchTopLevelChannelConfigSection({
|
|
218
246
|
cfg,
|
|
219
247
|
channel,
|
|
220
248
|
enabled: true,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
useEnv: { clearFields: ["privateKey"] },
|
|
225
|
-
set: { value: "resolved" }
|
|
226
|
-
})],
|
|
249
|
+
patch: buildNostrSetupPatch(accountId, { privateKey: resolvedValue })
|
|
250
|
+
})
|
|
251
|
+
}],
|
|
227
252
|
textInputs: [{
|
|
228
253
|
inputKey: "relayUrls",
|
|
229
254
|
message: t("wizard.nostr.relayUrlsPrompt"),
|
|
@@ -254,7 +279,11 @@ const nostrSetupWizard = {
|
|
|
254
279
|
}
|
|
255
280
|
}],
|
|
256
281
|
dmPolicy: nostrDmPolicy,
|
|
257
|
-
disable: (cfg) =>
|
|
282
|
+
disable: (cfg) => patchTopLevelChannelConfigSection({
|
|
283
|
+
cfg,
|
|
284
|
+
channel,
|
|
285
|
+
patch: { enabled: false }
|
|
286
|
+
})
|
|
258
287
|
};
|
|
259
288
|
//#endregion
|
|
260
|
-
export {
|
|
289
|
+
export { resolveDefaultNostrAccountId as a, validatePrivateKey as c, listNostrAccountIds as i, nostrSetupWizard as n, resolveNostrAccount as o, setup_surface_exports as r, normalizePubkey as s, nostrSetupAdapter as t };
|
package/dist/api.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as resolveNostrAccount } from "./.setup/setup-surface-DWa6-9ku.mjs";
|
|
2
2
|
import { getPluginRuntimeGatewayRequestScope } from "./runtime-api.js";
|
|
3
|
-
import { n as NostrProfileSchema } from "
|
|
4
|
-
import { a as
|
|
3
|
+
import { n as NostrProfileSchema } from "./.setup/config-schema-DIiXiBKr.mjs";
|
|
4
|
+
import { a as setNostrRuntime, i as getNostrRuntime, n as nostrPlugin, o as contentToProfile, r as publishNostrProfile, t as getNostrProfileState } from "./.setup/channel-B4SX7Iq6.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { SimplePool } from "nostr-tools";
|
|
7
|
+
import { SimplePool, verifyEvent } from "nostr-tools";
|
|
8
|
+
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
8
9
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
9
10
|
import { readJsonBodyWithLimit, requestBodyErrorToText } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
10
11
|
import { createFixedWindowRateLimiter } from "openclaw/plugin-sdk/webhook-ingress";
|
|
11
|
-
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
12
12
|
import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
13
13
|
//#region extensions/nostr/src/nostr-profile-url-safety.ts
|
|
14
14
|
function validateUrlSafety(urlStr) {
|
|
@@ -18,7 +18,8 @@ function validateUrlSafety(urlStr) {
|
|
|
18
18
|
ok: false,
|
|
19
19
|
error: "URL must use https:// protocol"
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const hostname = url.hostname.trim().toLowerCase();
|
|
22
|
+
if (isBlockedHostnameOrIp(hostname)) return {
|
|
22
23
|
ok: false,
|
|
23
24
|
error: "URL must not point to private/internal addresses"
|
|
24
25
|
};
|
|
@@ -79,45 +80,72 @@ async function importProfileFromRelays(opts) {
|
|
|
79
80
|
relaysQueried: []
|
|
80
81
|
};
|
|
81
82
|
const pool = new SimplePool();
|
|
82
|
-
const relaysQueried = [
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
const relaysQueried = [];
|
|
84
|
+
const timers = [];
|
|
85
|
+
const scheduleTimeout = (callback) => {
|
|
86
|
+
const timer = setTimeout(callback, timeoutMs);
|
|
87
|
+
timer.unref?.();
|
|
88
|
+
timers.push(timer);
|
|
89
|
+
return timer;
|
|
90
|
+
};
|
|
89
91
|
try {
|
|
90
92
|
const events = [];
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
94
|
+
scheduleTimeout(resolve);
|
|
95
|
+
});
|
|
96
|
+
const subscriptionPromise = new Promise((resolve) => {
|
|
97
|
+
let completed = 0;
|
|
98
|
+
for (const relay of relays) {
|
|
99
|
+
relaysQueried.push(relay);
|
|
100
|
+
const profileFilter = {
|
|
101
|
+
kinds: [0],
|
|
102
|
+
authors: [pubkey],
|
|
103
|
+
limit: 1
|
|
104
|
+
};
|
|
105
|
+
const sub = pool.subscribeMany([relay], profileFilter, {
|
|
106
|
+
onevent(event) {
|
|
107
|
+
events.push({
|
|
108
|
+
event,
|
|
109
|
+
relay
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
oneose() {
|
|
113
|
+
completed++;
|
|
114
|
+
if (completed >= relays.length) resolve();
|
|
115
|
+
},
|
|
116
|
+
onclose() {
|
|
117
|
+
completed++;
|
|
118
|
+
if (completed >= relays.length) resolve();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
scheduleTimeout(() => {
|
|
122
|
+
sub.close();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
await Promise.race([subscriptionPromise, timeoutPromise]);
|
|
127
|
+
for (const timer of timers.splice(0)) clearTimeout(timer);
|
|
112
128
|
if (events.length === 0) return {
|
|
113
129
|
ok: false,
|
|
114
130
|
error: "No profile found on any relay",
|
|
115
131
|
relaysQueried
|
|
116
132
|
};
|
|
117
|
-
|
|
118
|
-
|
|
133
|
+
let bestEvent = null;
|
|
134
|
+
for (const item of events) if (!bestEvent || item.event.created_at > bestEvent.event.created_at) bestEvent = item;
|
|
135
|
+
if (!bestEvent) return {
|
|
136
|
+
ok: false,
|
|
137
|
+
error: "No valid profile event found",
|
|
138
|
+
relaysQueried
|
|
139
|
+
};
|
|
140
|
+
if (!verifyEvent(bestEvent.event)) return {
|
|
141
|
+
ok: false,
|
|
142
|
+
error: "Profile event has invalid signature",
|
|
143
|
+
relaysQueried,
|
|
144
|
+
sourceRelay: bestEvent.relay
|
|
145
|
+
};
|
|
146
|
+
let content;
|
|
119
147
|
try {
|
|
120
|
-
|
|
148
|
+
content = JSON.parse(bestEvent.event.content);
|
|
121
149
|
} catch {
|
|
122
150
|
return {
|
|
123
151
|
ok: false,
|
|
@@ -126,23 +154,9 @@ async function importProfileFromRelays(opts) {
|
|
|
126
154
|
sourceRelay: bestEvent.relay
|
|
127
155
|
};
|
|
128
156
|
}
|
|
129
|
-
if (typeof parsedContent !== "object" || parsedContent === null || Array.isArray(parsedContent)) return {
|
|
130
|
-
ok: false,
|
|
131
|
-
error: "Profile event content must be a JSON object",
|
|
132
|
-
relaysQueried,
|
|
133
|
-
sourceRelay: bestEvent.relay
|
|
134
|
-
};
|
|
135
|
-
const sanitizedProfile = sanitizeProfileUrls(contentToProfile(parsedContent));
|
|
136
|
-
const validatedProfile = NostrProfileSchema.safeParse(sanitizedProfile);
|
|
137
|
-
if (!validatedProfile.success) return {
|
|
138
|
-
ok: false,
|
|
139
|
-
error: "Profile event content has invalid fields",
|
|
140
|
-
relaysQueried,
|
|
141
|
-
sourceRelay: bestEvent.relay
|
|
142
|
-
};
|
|
143
157
|
return {
|
|
144
158
|
ok: true,
|
|
145
|
-
profile:
|
|
159
|
+
profile: sanitizeProfileUrls(contentToProfile(content)),
|
|
146
160
|
event: {
|
|
147
161
|
id: bestEvent.event.id,
|
|
148
162
|
pubkey: bestEvent.event.pubkey,
|
|
@@ -152,8 +166,7 @@ async function importProfileFromRelays(opts) {
|
|
|
152
166
|
sourceRelay: bestEvent.relay
|
|
153
167
|
};
|
|
154
168
|
} finally {
|
|
155
|
-
|
|
156
|
-
for (const subscription of subscriptions) subscription.close();
|
|
169
|
+
for (const timer of timers) clearTimeout(timer);
|
|
157
170
|
pool.close(relays);
|
|
158
171
|
}
|
|
159
172
|
}
|
|
@@ -204,7 +217,7 @@ function sendJson(res, status, body) {
|
|
|
204
217
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
205
218
|
res.end(JSON.stringify(body));
|
|
206
219
|
}
|
|
207
|
-
async function readJsonBody(req, maxBytes =
|
|
220
|
+
async function readJsonBody(req, maxBytes = 65536, timeoutMs = 3e4) {
|
|
208
221
|
const result = await readJsonBodyWithLimit(req, {
|
|
209
222
|
maxBytes,
|
|
210
223
|
timeoutMs,
|
|
@@ -230,7 +243,8 @@ function isLoopbackRemoteAddress(remoteAddress) {
|
|
|
230
243
|
}
|
|
231
244
|
function isLoopbackOriginLike(value) {
|
|
232
245
|
try {
|
|
233
|
-
const
|
|
246
|
+
const url = new URL(value);
|
|
247
|
+
const hostname = normalizeLowercaseStringOrEmpty(url.hostname);
|
|
234
248
|
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1";
|
|
235
249
|
} catch {
|
|
236
250
|
return false;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as nostrPlugin } from "
|
|
1
|
+
import { n as nostrPlugin } from "./.setup/channel-B4SX7Iq6.mjs";
|
|
2
2
|
export { nostrPlugin };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as normalizeNostrStateAccountId } from "
|
|
1
|
+
import { t as normalizeNostrStateAccountId } from "./.setup/state-account-id-CvBZ9s6P.mjs";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { archiveLegacyStateSource } from "openclaw/plugin-sdk/runtime-doctor";
|
|
@@ -51,7 +51,8 @@ async function listLegacyFiles(params) {
|
|
|
51
51
|
const files = [];
|
|
52
52
|
for (const entry of entries) {
|
|
53
53
|
if (!entry.isFile() || !entry.name.startsWith(params.prefix) || !entry.name.endsWith(suffix)) continue;
|
|
54
|
-
const
|
|
54
|
+
const rawAccountId = entry.name.slice(params.prefix.length, -5);
|
|
55
|
+
const accountId = normalizeNostrStateAccountId(rawAccountId);
|
|
55
56
|
const filePath = path.join(dir, entry.name);
|
|
56
57
|
try {
|
|
57
58
|
const value = params.parse(await readJsonFile(filePath));
|
package/dist/setup-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as nostrSetupWizard, t as nostrSetupAdapter } from "./.setup/setup-surface-DWa6-9ku.mjs";
|
|
2
2
|
export { nostrSetupAdapter, nostrSetupWizard };
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
//#region extensions/nostr/setup-entry.ts
|
|
3
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
4
5
|
importMetaUrl: import.meta.url,
|
|
5
6
|
plugin: {
|
|
6
|
-
specifier: "
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/setup-plugin-api-DzlCumkz.mjs", import.meta.url).href),
|
|
7
8
|
exportName: "nostrSetupPlugin"
|
|
8
9
|
}
|
|
9
10
|
});
|