refactor: trim nostr helper exports · openclaw/openclaw@ac515b5
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -204,5 +204,3 @@ export async function getNostrProfileState(accountId: string = DEFAULT_ACCOUNT_I
|
204 | 204 | } |
205 | 205 | return bus.getProfileState(); |
206 | 206 | } |
207 | | - |
208 | | -export { getActiveNostrBuses } from "./gateway.js"; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@
|
7 | 7 | // Metric Types |
8 | 8 | // ============================================================================ |
9 | 9 | |
10 | | -export type EventMetricName = |
| 10 | +type EventMetricName = |
11 | 11 | | "event.received" |
12 | 12 | | "event.processed" |
13 | 13 | | "event.duplicate" |
@@ -22,7 +22,7 @@ export type EventMetricName =
|
22 | 22 | | "event.rejected.decrypt_failed" |
23 | 23 | | "event.rejected.self_message"; |
24 | 24 | |
25 | | -export type RelayMetricName = |
| 25 | +type RelayMetricName = |
26 | 26 | | "relay.connect" |
27 | 27 | | "relay.disconnect" |
28 | 28 | | "relay.reconnect" |
@@ -37,11 +37,11 @@ export type RelayMetricName =
|
37 | 37 | | "relay.circuit_breaker.close" |
38 | 38 | | "relay.circuit_breaker.half_open"; |
39 | 39 | |
40 | | -export type RateLimitMetricName = "rate_limit.per_sender" | "rate_limit.global"; |
| 40 | +type RateLimitMetricName = "rate_limit.per_sender" | "rate_limit.global"; |
41 | 41 | |
42 | | -export type DecryptMetricName = "decrypt.success" | "decrypt.failure"; |
| 42 | +type DecryptMetricName = "decrypt.success" | "decrypt.failure"; |
43 | 43 | |
44 | | -export type MemoryMetricName = "memory.seen_tracker_size" | "memory.rate_limiter_entries"; |
| 44 | +type MemoryMetricName = "memory.seen_tracker_size" | "memory.rate_limiter_entries"; |
45 | 45 | |
46 | 46 | export type MetricName = |
47 | 47 | | EventMetricName |
@@ -83,7 +83,7 @@ export interface MetricEvent {
|
83 | 83 | labels?: Record<string, string | number>; |
84 | 84 | } |
85 | 85 | |
86 | | -export type OnMetricCallback = (event: MetricEvent) => void; |
| 86 | +type OnMetricCallback = (event: MetricEvent) => void; |
87 | 87 | |
88 | 88 | // ============================================================================ |
89 | 89 | // Metrics Snapshot (for getMetrics()) |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -44,7 +44,7 @@ const HEALTH_WINDOW_MS = 60000; // 1 minute window for health stats
|
44 | 44 | // Types |
45 | 45 | // ============================================================================ |
46 | 46 | |
47 | | -export interface NostrBusOptions { |
| 47 | +interface NostrBusOptions { |
48 | 48 | /** Private key in hex or nsec format */ |
49 | 49 | privateKey: string; |
50 | 50 | /** WebSocket relay URLs (defaults to damus + nos.lol) */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -115,9 +115,6 @@ async function withPublishLock<T>(accountId: string, fn: () => Promise<T>): Prom
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | | -// Export for use in import validation |
119 | | -export { validateUrlSafety }; |
120 | | - |
121 | 118 | // ============================================================================ |
122 | 119 | // Validation Schemas |
123 | 120 | // ============================================================================ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ import { contentToProfile, type ProfileContent } from "./nostr-profile.js";
|
14 | 14 | // Types |
15 | 15 | // ============================================================================ |
16 | 16 | |
17 | | -export interface ProfileImportResult { |
| 17 | +interface ProfileImportResult { |
18 | 18 | /** Whether the import was successful */ |
19 | 19 | ok: boolean; |
20 | 20 | /** The imported profile (if found and valid) */ |
@@ -33,7 +33,7 @@ export interface ProfileImportResult {
|
33 | 33 | sourceRelay?: string; |
34 | 34 | } |
35 | 35 | |
36 | | -export interface ProfileImportOptions { |
| 36 | +interface ProfileImportOptions { |
37 | 37 | /** The public key to fetch profile for */ |
38 | 38 | pubkey: string; |
39 | 39 | /** Relay URLs to query */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,7 +88,7 @@ const RELAY_PUBLISH_TIMEOUT_MS = 5000;
|
88 | 88 | * @param event - Signed profile event (kind:0) |
89 | 89 | * @returns Publish results with successes and failures |
90 | 90 | */ |
91 | | -export async function publishProfileEvent( |
| 91 | +async function publishProfileEvent( |
92 | 92 | pool: SimplePool, |
93 | 93 | relays: string[], |
94 | 94 | event: Event, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -28,7 +28,7 @@ type NostrBusState = {
|
28 | 28 | }; |
29 | 29 | |
30 | 30 | /** Profile publish state (separate from bus state) */ |
31 | | -export type NostrProfileState = { |
| 31 | +type NostrProfileState = { |
32 | 32 | version: 1; |
33 | 33 | /** Unix timestamp (seconds) of last successful profile publish */ |
34 | 34 | lastPublishedAt: number | null; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@
|
3 | 3 | * Prevents unbounded memory growth under high load or abuse. |
4 | 4 | */ |
5 | 5 | |
6 | | -export interface SeenTrackerOptions { |
| 6 | +interface SeenTrackerOptions { |
7 | 7 | /** Maximum number of entries to track (default: 100,000) */ |
8 | 8 | maxEntries?: number; |
9 | 9 | /** TTL in milliseconds (default: 1 hour) */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ import type { NostrProfile } from "./config-schema.js";
|
14 | 14 | import { DEFAULT_RELAYS } from "./default-relays.js"; |
15 | 15 | import { getPublicKeyFromPrivate } from "./nostr-key-utils.js"; |
16 | 16 | |
17 | | -export interface NostrAccountConfig { |
| 17 | +interface NostrAccountConfig { |
18 | 18 | enabled?: boolean; |
19 | 19 | name?: string; |
20 | 20 | defaultAccount?: string; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。