@openclaw/nostr 2026.6.9 → 2026.6.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { o as resolveNostrAccount } from "./setup-surface-BqBa2C0K.js";
2
2
  import { getPluginRuntimeGatewayRequestScope } from "./runtime-api.js";
3
3
  import { n as NostrProfileSchema } from "./config-schema-DIiXiBKr.js";
4
- import { a as setNostrRuntime, i as getNostrRuntime, n as nostrPlugin, o as contentToProfile, r as publishNostrProfile, t as getNostrProfileState } from "./channel-Dz31pjch.js";
4
+ import { a as setNostrRuntime, i as getNostrRuntime, n as nostrPlugin, o as contentToProfile, r as publishNostrProfile, t as getNostrProfileState } from "./channel-CFiNISWq.js";
5
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { z } from "zod";
7
7
  import { SimplePool, verifyEvent } from "nostr-tools";
@@ -1,6 +1,7 @@
1
1
  import { a as resolveDefaultNostrAccountId, c as validatePrivateKey, i as listNostrAccountIds, n as nostrSetupWizard, o as resolveNostrAccount, s as normalizePubkey, t as nostrSetupAdapter } from "./setup-surface-BqBa2C0K.js";
2
2
  import { a as collectStatusIssuesFromLastError, i as buildChannelConfigSchema, n as NostrProfileSchema, o as createDefaultChannelRuntimeState, r as DEFAULT_ACCOUNT_ID, s as formatPairingApproveHint, t as NostrConfigSchema } from "./config-schema-DIiXiBKr.js";
3
3
  import { i as DEFAULT_RELAYS } from "./setup-adapter-DEU3o8MF.js";
4
+ import { t as normalizeNostrStateAccountId } from "./state-account-id-CvBZ9s6P.js";
4
5
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
6
  import { createScopedDmSecurityResolver, createTopLevelChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
6
7
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
@@ -407,11 +408,6 @@ const { setRuntime: setNostrRuntime, getRuntime: getNostrRuntime } = createPlugi
407
408
  //#region extensions/nostr/src/nostr-state-store.ts
408
409
  const STORE_VERSION = 2;
409
410
  const PROFILE_STATE_VERSION = 1;
410
- function normalizeAccountId(accountId) {
411
- const trimmed = accountId?.trim();
412
- if (!trimmed) return "default";
413
- return trimmed.replace(/[^a-z0-9._-]+/gi, "_");
414
- }
415
411
  function openNostrBusStateStore(env) {
416
412
  return getNostrRuntime().state.openKeyedStore({
417
413
  namespace: "bus-state",
@@ -427,7 +423,7 @@ function openNostrProfileStateStore(env) {
427
423
  });
428
424
  }
429
425
  async function readNostrBusState(params) {
430
- return await openNostrBusStateStore(params.env).lookup(normalizeAccountId(params.accountId)) ?? null;
426
+ return await openNostrBusStateStore(params.env).lookup(normalizeNostrStateAccountId(params.accountId)) ?? null;
431
427
  }
432
428
  async function writeNostrBusState(params) {
433
429
  const payload = {
@@ -436,7 +432,7 @@ async function writeNostrBusState(params) {
436
432
  gatewayStartedAt: params.gatewayStartedAt,
437
433
  recentEventIds: (params.recentEventIds ?? []).filter((x) => typeof x === "string")
438
434
  };
439
- await openNostrBusStateStore(params.env).register(normalizeAccountId(params.accountId), payload);
435
+ await openNostrBusStateStore(params.env).register(normalizeNostrStateAccountId(params.accountId), payload);
440
436
  }
441
437
  /**
442
438
  * Determine the `since` timestamp for subscription.
@@ -450,7 +446,7 @@ function computeSinceTimestamp(state, nowSec = Math.floor(Date.now() / 1e3)) {
450
446
  return Math.max(...candidates);
451
447
  }
452
448
  async function readNostrProfileState(params) {
453
- return await openNostrProfileStateStore(params.env).lookup(normalizeAccountId(params.accountId)) ?? null;
449
+ return await openNostrProfileStateStore(params.env).lookup(normalizeNostrStateAccountId(params.accountId)) ?? null;
454
450
  }
455
451
  async function writeNostrProfileState(params) {
456
452
  const payload = {
@@ -459,7 +455,7 @@ async function writeNostrProfileState(params) {
459
455
  lastPublishedEventId: params.lastPublishedEventId,
460
456
  lastPublishResults: params.lastPublishResults
461
457
  };
462
- await openNostrProfileStateStore(params.env).register(normalizeAccountId(params.accountId), payload);
458
+ await openNostrProfileStateStore(params.env).register(normalizeNostrStateAccountId(params.accountId), payload);
463
459
  }
464
460
  //#endregion
465
461
  //#region extensions/nostr/src/seen-tracker.ts
@@ -1,2 +1,2 @@
1
- import { n as nostrPlugin } from "./channel-Dz31pjch.js";
1
+ import { n as nostrPlugin } from "./channel-CFiNISWq.js";
2
2
  export { nostrPlugin };
@@ -1,14 +1,10 @@
1
+ import { t as normalizeNostrStateAccountId } from "./state-account-id-CvBZ9s6P.js";
1
2
  import fs from "node:fs/promises";
2
3
  import path from "node:path";
3
4
  //#region extensions/nostr/doctor-contract-api.ts
4
5
  const BUS_STATE_NAMESPACE = "bus-state";
5
6
  const PROFILE_STATE_NAMESPACE = "profile-state";
6
7
  const MAX_NOSTR_STATE_ENTRIES = 256;
7
- function normalizeAccountId(accountId) {
8
- const trimmed = accountId?.trim();
9
- if (!trimmed) return "default";
10
- return trimmed.replace(/[^a-z0-9._-]+/gi, "_");
11
- }
12
8
  function finiteNumberOrNull(value) {
13
9
  return typeof value === "number" && Number.isFinite(value) ? value : null;
14
10
  }
@@ -61,7 +57,7 @@ async function listLegacyFiles(params) {
61
57
  const files = [];
62
58
  for (const entry of entries) {
63
59
  if (!entry.isFile() || !entry.name.startsWith(params.prefix) || !entry.name.endsWith(suffix)) continue;
64
- const accountId = normalizeAccountId(entry.name.slice(params.prefix.length, -5));
60
+ const accountId = normalizeNostrStateAccountId(entry.name.slice(params.prefix.length, -5));
65
61
  const filePath = path.join(dir, entry.name);
66
62
  try {
67
63
  const value = params.parse(await readJsonFile(filePath));
@@ -0,0 +1,8 @@
1
+ //#region extensions/nostr/src/state-account-id.ts
2
+ function normalizeNostrStateAccountId(accountId) {
3
+ const trimmed = accountId?.trim();
4
+ if (!trimmed) return "default";
5
+ return trimmed.replace(/[^a-z0-9._-]+/gi, "_");
6
+ }
7
+ //#endregion
8
+ export { normalizeNostrStateAccountId as t };
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@openclaw/nostr",
3
- "version": "2026.6.9",
3
+ "version": "2026.6.10-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/nostr",
9
- "version": "2026.6.9",
9
+ "version": "2026.6.10-beta.2",
10
10
  "dependencies": {
11
11
  "nostr-tools": "2.23.5",
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.6.9"
15
+ "openclaw": ">=2026.6.10-beta.2"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/nostr",
3
- "version": "2026.6.9",
3
+ "version": "2026.6.10-beta.2",
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.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.6.9"
15
+ "openclaw": ">=2026.6.10-beta.2"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -50,10 +50,10 @@
50
50
  "minHostVersion": ">=2026.4.10"
51
51
  },
52
52
  "compat": {
53
- "pluginApi": ">=2026.6.9"
53
+ "pluginApi": ">=2026.6.10-beta.2"
54
54
  },
55
55
  "build": {
56
- "openclawVersion": "2026.6.9"
56
+ "openclawVersion": "2026.6.10-beta.2"
57
57
  },
58
58
  "release": {
59
59
  "publishToClawHub": true,