@openclaw/nostr 2026.11.1 → 2026.11.3
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/.setup/{channel-CILcEtli.mjs → channel-DgBGsryg.mjs} +29 -16
- package/dist/.setup/{channel.setup-DeVyQy6t.mjs → channel.setup-B2tWt-Ro.mjs} +6 -4
- package/dist/.setup/secret-contract-api-DUmw8THQ.mjs +2 -0
- package/dist/.setup/{secret-contract-api-DhkjtAQ4.mjs → secret-contract-api-nVWula4c.mjs} +2 -1
- package/dist/.setup/{setup-adapter-CCRkU3LC.mjs → setup-adapter-DTqb2Hne.mjs} +8 -4
- package/dist/.setup/setup-plugin-api-DLSsirua.mjs +3 -0
- package/dist/.setup/{setup-surface-fC0kex9d.mjs → setup-surface-CadI9603.mjs} +9 -5
- package/dist/api.js +9 -6
- package/dist/channel-plugin-api.js +2 -1
- package/dist/doctor-contract-api.js +2 -1
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/setup-api.js +2 -1
- package/dist/setup-entry.js +4 -3
- package/dist/setup-plugin-api.js +2 -1
- package/package.json +4 -4
- package/dist/.setup/secret-contract-api-KACe-wY3.mjs +0 -1
- package/dist/.setup/setup-plugin-api-Cc2r8u0U.mjs +0 -2
- package/dist/.source-module-urls/434fb4e7afdaac23908221824ec325d8f61be72ba97af41567f2cb4ebe3ad38c.json +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as listNostrAccountIds, c as normalizePubkey, n as nostrSetupContract, o as resolveDefaultNostrAccountId, r as nostrSetupWizard, s as resolveNostrAccount } from "./setup-surface-
|
|
2
|
-
import { l as validatePrivateKey, u as DEFAULT_RELAYS } from "./setup-adapter-
|
|
3
|
-
import { n as NostrProfileSchema, t as nostrSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { a as listNostrAccountIds, c as normalizePubkey, n as nostrSetupContract, o as resolveDefaultNostrAccountId, r as nostrSetupWizard, s as resolveNostrAccount } from "./setup-surface-CadI9603.mjs";
|
|
2
|
+
import { l as validatePrivateKey, u as DEFAULT_RELAYS } from "./setup-adapter-DTqb2Hne.mjs";
|
|
3
|
+
import { n as NostrProfileSchema, t as nostrSetupPlugin } from "./channel.setup-B2tWt-Ro.mjs";
|
|
4
4
|
import { createScopedDmSecurityResolver, createTopLevelChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
5
5
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
6
6
|
import { missingTargetError } from "openclaw/plugin-sdk/channel-feedback";
|
|
@@ -25,7 +25,7 @@ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
|
25
25
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
26
26
|
import { withTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
27
27
|
import { buildChannelOutboundSessionRoute, stripChannelTargetPrefix } from "openclaw/plugin-sdk/core";
|
|
28
|
-
|
|
28
|
+
//#region extensions/nostr/src/metrics.ts
|
|
29
29
|
function createMetrics(onMetric) {
|
|
30
30
|
return { emit(name, value = 1, labels) {
|
|
31
31
|
onMetric?.({
|
|
@@ -36,7 +36,8 @@ function createMetrics(onMetric) {
|
|
|
36
36
|
});
|
|
37
37
|
} };
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region extensions/nostr/src/nostr-cursor.ts
|
|
40
41
|
const CURSOR_WRITE_RETRY_MS = [
|
|
41
42
|
0,
|
|
42
43
|
100,
|
|
@@ -197,12 +198,14 @@ async function migrateNostrLegacyRecentEventIds(params) {
|
|
|
197
198
|
}
|
|
198
199
|
return migrated;
|
|
199
200
|
}
|
|
200
|
-
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region extensions/nostr/src/runtime.ts
|
|
201
203
|
const { setRuntime: setNostrRuntime, getRuntime: getNostrRuntime } = createPluginRuntimeStore({
|
|
202
204
|
pluginId: "nostr",
|
|
203
205
|
errorMessage: "Nostr runtime not initialized"
|
|
204
206
|
});
|
|
205
|
-
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region extensions/nostr/src/nostr-ingress.ts
|
|
206
209
|
const NOSTR_INGRESS_POLL_INTERVAL_MS = 500;
|
|
207
210
|
const NOSTR_INGRESS_APPEND_RETRY_MS = [
|
|
208
211
|
0,
|
|
@@ -393,7 +396,8 @@ function createNostrIngress(options) {
|
|
|
393
396
|
}
|
|
394
397
|
};
|
|
395
398
|
}
|
|
396
|
-
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region extensions/nostr/src/nostr-profile-core.ts
|
|
397
401
|
const PROFILE_FIELDS = [
|
|
398
402
|
["name", "name"],
|
|
399
403
|
["displayName", "display_name"],
|
|
@@ -422,7 +426,8 @@ function contentToProfile(content) {
|
|
|
422
426
|
}
|
|
423
427
|
return profile;
|
|
424
428
|
}
|
|
425
|
-
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region extensions/nostr/src/nostr-profile.ts
|
|
426
431
|
const RELAY_PUBLISH_TIMEOUT_MS = 5e3;
|
|
427
432
|
/** Publish one signed kind:0 event, reporting each relay's result without retrying. */
|
|
428
433
|
async function publishProfile(pool, sk, relays, profile, lastPublishedAt) {
|
|
@@ -456,7 +461,8 @@ async function publishProfile(pool, sk, relays, profile, lastPublishedAt) {
|
|
|
456
461
|
createdAt: event.created_at
|
|
457
462
|
};
|
|
458
463
|
}
|
|
459
|
-
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region extensions/nostr/src/nostr-relay-subscription.ts
|
|
460
466
|
const DEFAULT_EOSE_CONFIRM_DEADLINE_MS = 1e4;
|
|
461
467
|
/** Separates real relay EOSE frames from nostr-tools timeout/close synthesis. */
|
|
462
468
|
function createNostrRelaySubscriptionGroup(options) {
|
|
@@ -517,13 +523,15 @@ function createNostrRelaySubscriptionGroup(options) {
|
|
|
517
523
|
}
|
|
518
524
|
};
|
|
519
525
|
}
|
|
520
|
-
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region extensions/nostr/src/state-account-id.ts
|
|
521
528
|
function normalizeNostrStateAccountId(accountId) {
|
|
522
529
|
const trimmed = accountId?.trim();
|
|
523
530
|
if (!trimmed) return "default";
|
|
524
531
|
return trimmed.replace(/[^a-z0-9._-]+/gi, "_");
|
|
525
532
|
}
|
|
526
|
-
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region extensions/nostr/src/nostr-state-store.ts
|
|
527
535
|
const STORE_VERSION = 2;
|
|
528
536
|
const PROFILE_STATE_VERSION = 1;
|
|
529
537
|
function openNostrBusStateStore(env) {
|
|
@@ -575,7 +583,8 @@ async function writeNostrProfileState(params) {
|
|
|
575
583
|
};
|
|
576
584
|
await openNostrProfileStateStore(params.env).register(normalizeNostrStateAccountId(params.accountId), payload);
|
|
577
585
|
}
|
|
578
|
-
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region extensions/nostr/src/nostr-bus.ts
|
|
579
588
|
const STARTUP_LOOKBACK_SEC = 120;
|
|
580
589
|
const STATE_PERSIST_DEBOUNCE_MS = 5e3;
|
|
581
590
|
const NOSTR_INGRESS_ENVELOPE_OVERHEAD_BYTES = 16384;
|
|
@@ -999,7 +1008,8 @@ async function startNostrBus(options) {
|
|
|
999
1008
|
getProfileState
|
|
1000
1009
|
};
|
|
1001
1010
|
}
|
|
1002
|
-
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region extensions/nostr/src/gateway.ts
|
|
1003
1013
|
const activeBuses = /* @__PURE__ */ new Map();
|
|
1004
1014
|
function normalizeRelayLifecycleKey(relay) {
|
|
1005
1015
|
return new URL(relay).toString();
|
|
@@ -1235,7 +1245,8 @@ const nostrOutboundAdapter = {
|
|
|
1235
1245
|
function getActiveNostrBuses() {
|
|
1236
1246
|
return new Map(activeBuses);
|
|
1237
1247
|
}
|
|
1238
|
-
|
|
1248
|
+
//#endregion
|
|
1249
|
+
//#region extensions/nostr/src/session-route.ts
|
|
1239
1250
|
function resolveNostrOutboundSessionRoute(params) {
|
|
1240
1251
|
const rawTarget = stripChannelTargetPrefix(params.target, "nostr");
|
|
1241
1252
|
let target;
|
|
@@ -1259,7 +1270,8 @@ function resolveNostrOutboundSessionRoute(params) {
|
|
|
1259
1270
|
to: `nostr:${target}`
|
|
1260
1271
|
});
|
|
1261
1272
|
}
|
|
1262
|
-
|
|
1273
|
+
//#endregion
|
|
1274
|
+
//#region extensions/nostr/src/channel.ts
|
|
1263
1275
|
const NOSTR_TARGET_HINT = "<npub|hex pubkey|nostr:npub...>";
|
|
1264
1276
|
function stripNostrTargetPrefix(target) {
|
|
1265
1277
|
return target.trim().replace(/^nostr:/i, "");
|
|
@@ -1388,4 +1400,5 @@ async function getNostrProfileState(accountId = DEFAULT_ACCOUNT_ID) {
|
|
|
1388
1400
|
if (!bus) return null;
|
|
1389
1401
|
return bus.getProfileState();
|
|
1390
1402
|
}
|
|
1403
|
+
//#endregion
|
|
1391
1404
|
export { getNostrRuntime as a, contentToProfile as i, nostrPlugin as n, setNostrRuntime as o, publishNostrProfile as r, getNostrProfileState as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as createNostrSetupStatus, n as createNostrSetupAdapter, o as getNostrConfig, r as createNostrSetupContract, s as resolveNostrAccountBase } from "./setup-adapter-
|
|
1
|
+
import { i as createNostrSetupStatus, n as createNostrSetupAdapter, o as getNostrConfig, r as createNostrSetupContract, s as resolveNostrAccountBase } from "./setup-adapter-DTqb2Hne.mjs";
|
|
2
2
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-plugin-common";
|
|
3
3
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
4
4
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -6,7 +6,7 @@ import { createDelegatedSetupWizardProxy } from "openclaw/plugin-sdk/setup-runti
|
|
|
6
6
|
import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
|
|
7
7
|
import { AllowFromListSchema, DmPolicySchema, MarkdownConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
8
8
|
import { z } from "zod";
|
|
9
|
-
|
|
9
|
+
//#region extensions/nostr/src/config-schema.ts
|
|
10
10
|
const safeUrlSchema = z.string().url().refine((url) => URL.parse(url)?.protocol === "https:", { message: "URL must use https:// protocol" });
|
|
11
11
|
/**
|
|
12
12
|
* NIP-01 profile metadata schema
|
|
@@ -43,7 +43,8 @@ const NostrConfigSchema = z.object({
|
|
|
43
43
|
/** Profile metadata (NIP-01 kind:0 content) */
|
|
44
44
|
profile: NostrProfileSchema.optional()
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region extensions/nostr/src/channel.setup.ts
|
|
47
48
|
const channel = "nostr";
|
|
48
49
|
function resolveDefaultSetupNostrAccountId(cfg) {
|
|
49
50
|
return normalizeAccountId(getNostrConfig(cfg)?.defaultAccount);
|
|
@@ -54,7 +55,7 @@ function resolveSetupNostrAccount(params) {
|
|
|
54
55
|
}
|
|
55
56
|
const nostrSetupWizard = createDelegatedSetupWizardProxy({
|
|
56
57
|
channel,
|
|
57
|
-
loadWizard: async () => (await import("./setup-surface-
|
|
58
|
+
loadWizard: async () => (await import("./setup-surface-CadI9603.mjs").then((n) => n.i)).nostrSetupWizard,
|
|
58
59
|
status: createNostrSetupStatus(resolveSetupNostrAccount),
|
|
59
60
|
resolveShouldPromptAccountIds: () => false,
|
|
60
61
|
delegatePrepare: true,
|
|
@@ -94,4 +95,5 @@ const nostrSetupPlugin = {
|
|
|
94
95
|
})
|
|
95
96
|
}
|
|
96
97
|
};
|
|
98
|
+
//#endregion
|
|
97
99
|
export { NostrProfileSchema as n, nostrSetupPlugin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
2
|
import { collectSecretInputAssignment, createChannelSecretTargetRegistryEntries, getChannelRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/nostr/src/secret-contract.ts
|
|
4
4
|
const secretTargetRegistryEntries = createChannelSecretTargetRegistryEntries({
|
|
5
5
|
channelKey: "nostr",
|
|
6
6
|
channel: ["privateKey"]
|
|
@@ -33,4 +33,5 @@ const channelSecrets = {
|
|
|
33
33
|
secretTargetRegistryEntries,
|
|
34
34
|
collectRuntimeConfigAssignments
|
|
35
35
|
};
|
|
36
|
+
//#endregion
|
|
36
37
|
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -4,9 +4,10 @@ import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/p
|
|
|
4
4
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { createSetupTranslator, createStandardChannelSetupStatus, patchTopLevelChannelConfigSection, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
7
|
-
|
|
7
|
+
//#region extensions/nostr/src/default-relays.ts
|
|
8
8
|
const DEFAULT_RELAYS = ["wss://relay.damus.io", "wss://nos.lol"];
|
|
9
|
-
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region extensions/nostr/src/private-key.ts
|
|
10
11
|
const NOSTR_PRIVATE_KEY_ENV_VAR = "NOSTR_PRIVATE_KEY";
|
|
11
12
|
const SECP256K1_ORDER = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
|
12
13
|
/** Validate and normalize a private key (hex or NIP-19 nsec). */
|
|
@@ -39,7 +40,8 @@ function resolveNostrPrivateKey(value) {
|
|
|
39
40
|
if (configured || hasConfiguredSecretInput(value)) return configured ?? "";
|
|
40
41
|
return process.env["NOSTR_PRIVATE_KEY"]?.trim() ?? "";
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region extensions/nostr/src/accounts.ts
|
|
43
45
|
function getNostrConfig(cfg) {
|
|
44
46
|
return cfg.channels?.nostr;
|
|
45
47
|
}
|
|
@@ -66,7 +68,8 @@ function resolveNostrAccountBase(cfg, accountId) {
|
|
|
66
68
|
}
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
|
-
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region extensions/nostr/src/setup-adapter.ts
|
|
70
73
|
const channel = "nostr";
|
|
71
74
|
function buildNostrSetupPatch(accountId, patch) {
|
|
72
75
|
return {
|
|
@@ -176,4 +179,5 @@ function createNostrSetupStatus(resolveAccount) {
|
|
|
176
179
|
}
|
|
177
180
|
});
|
|
178
181
|
}
|
|
182
|
+
//#endregion
|
|
179
183
|
export { parseRelayUrls as a, hasConfiguredNostrPrivateKey as c, createNostrSetupStatus as i, validatePrivateKey as l, createNostrSetupAdapter as n, getNostrConfig as o, createNostrSetupContract as r, resolveNostrAccountBase as s, buildNostrSetupPatch as t, DEFAULT_RELAYS as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as parseRelayUrls, c as hasConfiguredNostrPrivateKey, i as createNostrSetupStatus, l as validatePrivateKey, n as createNostrSetupAdapter, o as getNostrConfig, r as createNostrSetupContract, s as resolveNostrAccountBase, t as buildNostrSetupPatch, u as DEFAULT_RELAYS } from "./setup-adapter-
|
|
1
|
+
import { a as parseRelayUrls, c as hasConfiguredNostrPrivateKey, i as createNostrSetupStatus, l as validatePrivateKey, n as createNostrSetupAdapter, o as getNostrConfig, r as createNostrSetupContract, s as resolveNostrAccountBase, t as buildNostrSetupPatch, u as DEFAULT_RELAYS } from "./setup-adapter-DTqb2Hne.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -7,7 +7,7 @@ import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/p
|
|
|
7
7
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/routing";
|
|
8
8
|
import { createSetupTranslator, createTopLevelChannelDmPolicy, createTopLevelChannelParsedAllowFromPrompt, defineTokenCredential, formatDocsLink, mergeAllowFromEntries, parseSetupEntriesWithParser, patchTopLevelChannelConfigSection, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
9
9
|
import { getPublicKey } from "nostr-tools/pure";
|
|
10
|
-
|
|
10
|
+
//#region \0rolldown/runtime.js
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __exportAll = (all, no_symbols) => {
|
|
13
13
|
let target = {};
|
|
@@ -18,7 +18,8 @@ var __exportAll = (all, no_symbols) => {
|
|
|
18
18
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
19
|
return target;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region extensions/nostr/src/nostr-key-utils.ts
|
|
22
23
|
function getPublicKeyFromPrivate(privateKey) {
|
|
23
24
|
return getPublicKey(validatePrivateKey(privateKey));
|
|
24
25
|
}
|
|
@@ -32,7 +33,8 @@ function normalizePubkey(input) {
|
|
|
32
33
|
if (!/^[0-9a-fA-F]{64}$/.test(trimmed)) throw new Error("Pubkey must be 64 hex characters or npub format");
|
|
33
34
|
return trimmed.toLowerCase();
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region extensions/nostr/src/types.ts
|
|
36
38
|
const { listAccountIds: listNostrAccountIds, resolveDefaultAccountId: resolveDefaultNostrAccountId } = createAccountListHelpers("nostr", {
|
|
37
39
|
fallbackAccountIdWhenEmpty: false,
|
|
38
40
|
resolveImplicitAccountId: (cfg) => {
|
|
@@ -53,7 +55,8 @@ function resolveNostrAccount(opts) {
|
|
|
53
55
|
publicKey
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region extensions/nostr/src/setup-surface.ts
|
|
57
60
|
var setup_surface_exports = /* @__PURE__ */ __exportAll({
|
|
58
61
|
nostrSetupAdapter: () => nostrSetupAdapter,
|
|
59
62
|
nostrSetupContract: () => nostrSetupContract,
|
|
@@ -191,4 +194,5 @@ const nostrSetupWizard = {
|
|
|
191
194
|
dmPolicy: nostrDmPolicy,
|
|
192
195
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
193
196
|
};
|
|
197
|
+
//#endregion
|
|
194
198
|
export { listNostrAccountIds as a, normalizePubkey as c, setup_surface_exports as i, nostrSetupContract as n, resolveDefaultNostrAccountId as o, nostrSetupWizard as r, resolveNostrAccount as s, nostrSetupAdapter as t };
|
package/dist/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as resolveNostrAccount } from "./.setup/setup-surface-
|
|
1
|
+
import { s as resolveNostrAccount } from "./.setup/setup-surface-CadI9603.mjs";
|
|
2
2
|
import { getPluginRuntimeGatewayRequestScope } from "./runtime-api.js";
|
|
3
|
-
import { n as NostrProfileSchema } from "./.setup/channel.setup-
|
|
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/channel.setup-B2tWt-Ro.mjs";
|
|
4
|
+
import { a as getNostrRuntime, i as contentToProfile, n as nostrPlugin, o as setNostrRuntime, r as publishNostrProfile, t as getNostrProfileState } from "./.setup/channel-DgBGsryg.mjs";
|
|
5
5
|
import { getPluginRuntimeGatewayRequestScope as getPluginRuntimeGatewayRequestScope$1 } from "openclaw/plugin-sdk/plugin-runtime";
|
|
6
6
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -12,7 +12,7 @@ import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
|
12
12
|
import { isBlockedHostnameOrIp, isLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
13
13
|
import { readJsonBodyWithLimit, requestBodyErrorToText } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
14
14
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
15
|
-
|
|
15
|
+
//#region extensions/nostr/src/nostr-profile-url-safety.ts
|
|
16
16
|
function normalizeNostrProfileUrlForRuntime(urlStr) {
|
|
17
17
|
return urlStr.replace(/^([a-z][a-z\d+.-]*:\/\/\[[\da-f:]*:)(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})(\].*)$/iu, (original, prefix, a, b, c, d, suffix) => {
|
|
18
18
|
const octets = [
|
|
@@ -47,7 +47,8 @@ function validateUrlSafety(urlStr) {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region extensions/nostr/src/nostr-profile-import.ts
|
|
51
52
|
const DEFAULT_TIMEOUT_MS = 5e3;
|
|
52
53
|
function sanitizeProfileUrls(profile) {
|
|
53
54
|
const result = { ...profile };
|
|
@@ -169,7 +170,8 @@ function mergeProfiles(local, imported) {
|
|
|
169
170
|
lud16: local.lud16 ?? imported.lud16
|
|
170
171
|
};
|
|
171
172
|
}
|
|
172
|
-
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region extensions/nostr/src/nostr-profile-http.ts
|
|
173
175
|
const profileRateLimiter = createFixedWindowRateLimiter({
|
|
174
176
|
windowMs: 6e4,
|
|
175
177
|
maxRequests: 5,
|
|
@@ -464,4 +466,5 @@ async function handleImportProfile(accountId, ctx, req, res) {
|
|
|
464
466
|
});
|
|
465
467
|
return true;
|
|
466
468
|
}
|
|
469
|
+
//#endregion
|
|
467
470
|
export { createNostrProfileHttpHandler, getNostrRuntime, getPluginRuntimeGatewayRequestScope, nostrPlugin, resolveNostrAccount, setNostrRuntime };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as nostrPlugin } from "./.setup/channel-DgBGsryg.mjs";
|
|
2
|
+
export { nostrPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
|
|
4
|
+
//#region extensions/nostr/doctor-contract-api.ts
|
|
5
5
|
function retiredNostrStateMigration(namespace, label) {
|
|
6
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
7
|
const hasLegacyState = async (stateDir) => {
|
|
@@ -28,4 +28,5 @@ function retiredNostrStateMigration(namespace, label) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
const stateMigrations = [retiredNostrStateMigration("bus-state", "Nostr bus state"), retiredNostrStateMigration("profile-state", "Nostr profile state")];
|
|
31
|
+
//#endregion
|
|
31
32
|
export { stateMigrations };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineBundledChannelEntry, loadBundledEntryExportSync } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
-
|
|
2
|
+
//#region extensions/nostr/index.ts
|
|
3
3
|
var nostr_default = defineBundledChannelEntry({
|
|
4
4
|
id: "nostr",
|
|
5
5
|
name: "Nostr",
|
|
@@ -66,4 +66,5 @@ var nostr_default = defineBundledChannelEntry({
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
+
//#endregion
|
|
69
70
|
export { nostr_default as default };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { getPluginRuntimeGatewayRequestScope } from "openclaw/plugin-sdk/plugin-runtime";
|
|
2
|
+
export { getPluginRuntimeGatewayRequestScope };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-api-nVWula4c.mjs";
|
|
2
|
+
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { r as nostrSetupWizard, t as nostrSetupAdapter } from "./.setup/setup-surface-CadI9603.mjs";
|
|
2
|
+
export { nostrSetupAdapter, nostrSetupWizard };
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
|
|
3
|
+
//#region extensions/nostr/setup-entry.ts
|
|
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-DLSsirua.mjs", import.meta.url).href),
|
|
8
8
|
exportName: "nostrSetupPlugin"
|
|
9
9
|
},
|
|
10
10
|
secrets: {
|
|
11
|
-
specifier: fileURLToPath(new URL(".setup/secret-contract-api-
|
|
11
|
+
specifier: fileURLToPath(new URL(".setup/secret-contract-api-DUmw8THQ.mjs", import.meta.url).href),
|
|
12
12
|
exportName: "channelSecrets"
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
//#endregion
|
|
15
16
|
export { setup_entry_default as default };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as nostrSetupPlugin } from "./.setup/channel.setup-B2tWt-Ro.mjs";
|
|
2
|
+
export { nostrSetupPlugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/nostr",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.3",
|
|
4
4
|
"description": "OpenClaw Nostr channel plugin for NIP-04 encrypted direct messages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"zod": "4.6.5"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"openclaw": ">=2026.11.
|
|
15
|
+
"openclaw": ">=2026.11.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"minHostVersion": ">=2026.4.10"
|
|
81
81
|
},
|
|
82
82
|
"compat": {
|
|
83
|
-
"pluginApi": ">=2026.11.
|
|
83
|
+
"pluginApi": ">=2026.11.3"
|
|
84
84
|
},
|
|
85
85
|
"build": {
|
|
86
|
-
"openclawVersion": "2026.11.
|
|
86
|
+
"openclawVersion": "2026.11.3"
|
|
87
87
|
},
|
|
88
88
|
"release": {
|
|
89
89
|
"publishToClawHub": true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-api-DhkjtAQ4.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/nostr/api.ts"},{"output":"channel-plugin-api.js","source":"extensions/nostr/channel-plugin-api.ts"},{"output":"doctor-contract-api.js","source":"extensions/nostr/doctor-contract-api.ts"},{"output":"index.js","source":"extensions/nostr/index.ts"},{"output":"runtime-api.js","source":"extensions/nostr/runtime-api.ts"},{"output":"secret-contract-api.js","source":"extensions/nostr/secret-contract-api.ts"},{"output":"setup-api.js","source":"extensions/nostr/setup-api.ts"},{"output":"setup-entry.js","source":"extensions/nostr/setup-entry.ts"},{"output":"setup-plugin-api.js","source":"extensions/nostr/setup-plugin-api.ts"}],"chunks":[{"output":".setup/channel-CILcEtli.mjs","sha256":"70622bd313c0236d1c0e2ba81335156f3db1680ad500d579db2098957cdb796f","facadeSource":null,"sources":["extensions/nostr/src/channel.ts","extensions/nostr/src/gateway.ts","extensions/nostr/src/metrics.ts","extensions/nostr/src/nostr-bus.ts","extensions/nostr/src/nostr-cursor.ts","extensions/nostr/src/nostr-ingress-state.ts","extensions/nostr/src/nostr-ingress.ts","extensions/nostr/src/nostr-profile-core.ts","extensions/nostr/src/nostr-profile.ts","extensions/nostr/src/nostr-relay-subscription.ts","extensions/nostr/src/nostr-state-store.ts","extensions/nostr/src/runtime.ts","extensions/nostr/src/session-route.ts","extensions/nostr/src/state-account-id.ts"]},{"output":".setup/channel.setup-DeVyQy6t.mjs","sha256":"21198c1ca467148b2b38e3fbf33d391f8d88354010d4cb4964e7ee6397541687","facadeSource":null,"sources":["extensions/nostr/src/channel.setup.ts","extensions/nostr/src/config-schema.ts"]},{"output":".setup/secret-contract-api-DhkjtAQ4.mjs","sha256":"cc9bd97896c09a5b7011d5081c7b77f9d549c4a8e6d6851e45bd88db2b0e9175","facadeSource":null,"sources":["extensions/nostr/src/secret-contract.ts"]},{"output":".setup/secret-contract-api-KACe-wY3.mjs","sha256":"5b017c198ae7077b346a36f99804618262353b63b3cd0a33f5aa3d6506dbf63f","facadeSource":"extensions/nostr/secret-contract-api.ts","sources":[]},{"output":".setup/setup-adapter-CCRkU3LC.mjs","sha256":"50f8fd5436ae00373f8f9d07726071a143d1aee09e9e54b3376846eff1270ca8","facadeSource":null,"sources":["extensions/nostr/src/accounts.ts","extensions/nostr/src/default-relays.ts","extensions/nostr/src/private-key.ts","extensions/nostr/src/setup-adapter.ts"]},{"output":".setup/setup-plugin-api-Cc2r8u0U.mjs","sha256":"ad6188354ce98d71de2f396039ea7aa30caa4e780f8cf5cf6a05a04bda7bbbaf","facadeSource":"extensions/nostr/setup-plugin-api.ts","sources":[]},{"output":".setup/setup-surface-fC0kex9d.mjs","sha256":"0cc6e9cd504307f33810f714397ce209fbd113dd017fdbc47ff39a1538614e93","facadeSource":null,"sources":["extensions/nostr/src/nostr-key-utils.ts","extensions/nostr/src/setup-surface.ts","extensions/nostr/src/types.ts"]},{"output":"api.js","sha256":"d8c7ff711a0706bc360c35dd07c44bddd3fd6ccc125f8e9664aa3cd35fab20ba","facadeSource":"extensions/nostr/api.ts","sources":["extensions/nostr/src/nostr-profile-http.ts","extensions/nostr/src/nostr-profile-import.ts","extensions/nostr/src/nostr-profile-url-safety.ts"]},{"output":"channel-plugin-api.js","sha256":"2be50aa30aa26eb7b91574e12619edb059f38aecc6834183f342c8fb1c687606","facadeSource":"extensions/nostr/channel-plugin-api.ts","sources":[]},{"output":"doctor-contract-api.js","sha256":"fdfdc60708b4ee687d31f1dd5825611b8ae0b2d441015441166322c9605c7cd6","facadeSource":"extensions/nostr/doctor-contract-api.ts","sources":["extensions/nostr/doctor-contract-api.ts"]},{"output":"index.js","sha256":"ceca06a0f98117bb6121283a5e21b124d97db7b180f13a971bd44f3a1de255e6","facadeSource":"extensions/nostr/index.ts","sources":["extensions/nostr/index.ts"]},{"output":"runtime-api.js","sha256":"1bed0357f746cd96a7c503a5be63f8dfbac1f7a2ac9c97072b969bbdc479bea5","facadeSource":"extensions/nostr/runtime-api.ts","sources":[]},{"output":"secret-contract-api.js","sha256":"4d20da44e93e63dbf4d09ff7bc370df393a13690407e78710cc5ba3d3786453e","facadeSource":"extensions/nostr/secret-contract-api.ts","sources":[]},{"output":"setup-api.js","sha256":"a8cfafe955ed0621f96d0822c9817d8764aebe934240de0c5e416df732a11bac","facadeSource":"extensions/nostr/setup-api.ts","sources":[]},{"output":"setup-entry.js","sha256":"0e8a2a6e49b964a3e2ffdca8a72624f1213fa246be0578d139e4883b88b51951","facadeSource":"extensions/nostr/setup-entry.ts","sources":["extensions/nostr/setup-entry.ts"]},{"output":"setup-plugin-api.js","sha256":"8b1d448cc299cd115f9180af38c93c6e335922accbc318ffcda992f255e138df","facadeSource":"extensions/nostr/setup-plugin-api.ts","sources":[]}],"unrenderedSources":["extensions/nostr/api.ts","extensions/nostr/channel-plugin-api.ts","extensions/nostr/runtime-api.ts","extensions/nostr/secret-contract-api.ts","extensions/nostr/setup-api.ts","extensions/nostr/setup-plugin-api.ts"]}
|