@contextvm/sdk 0.1.16 → 0.1.17
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/esm/relay/applesauce-relay-pool.d.ts +35 -0
- package/dist/esm/relay/applesauce-relay-pool.d.ts.map +1 -0
- package/dist/esm/relay/applesauce-relay-pool.js +172 -0
- package/dist/esm/relay/applesauce-relay-pool.js.map +1 -0
- package/dist/esm/relay/index.d.ts +1 -1
- package/dist/esm/relay/index.d.ts.map +1 -1
- package/dist/esm/relay/index.js +1 -1
- package/dist/esm/relay/index.js.map +1 -1
- package/dist/esm/relay/simple-relay-pool.d.ts.map +1 -1
- package/dist/esm/relay/simple-relay-pool.js +1 -2
- package/dist/esm/relay/simple-relay-pool.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/proxy/proxy-server.d.ts +0 -3
- package/dist/esm/proxy/proxy-server.d.ts.map +0 -1
- package/dist/esm/proxy/proxy-server.js +0 -55
- package/dist/esm/proxy/proxy-server.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NostrEvent, Filter } from 'nostr-tools';
|
|
2
|
+
import { RelayHandler } from '../core/interfaces.js';
|
|
3
|
+
/**
|
|
4
|
+
* A RelayHandler implementation that uses the applesauce-relay library's RelayPool to manage connections and subscriptions.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ApplesauceRelayPool implements RelayHandler {
|
|
7
|
+
private readonly pool;
|
|
8
|
+
private readonly relayUrls;
|
|
9
|
+
private readonly relayGroup;
|
|
10
|
+
private subscriptions;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new ApplesauceRelayPool instance.
|
|
13
|
+
* @param relayUrls - An array of relay URLs to connect to.
|
|
14
|
+
*/
|
|
15
|
+
constructor(relayUrls: string[]);
|
|
16
|
+
/**
|
|
17
|
+
* Sets up monitoring of relay connections and triggers resubscription when connections are lost
|
|
18
|
+
*/
|
|
19
|
+
private setupConnectionMonitoring;
|
|
20
|
+
connect(): Promise<void>;
|
|
21
|
+
disconnect(): Promise<void>;
|
|
22
|
+
publish(event: NostrEvent): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a simplified subscription wrapper around the RelayPool's subscription method.
|
|
25
|
+
* This provides a cleaner interface similar to other relay pool implementations.
|
|
26
|
+
*/
|
|
27
|
+
private createSubscription;
|
|
28
|
+
/**
|
|
29
|
+
* Resubscribes to all active subscriptions after relay reconnection
|
|
30
|
+
*/
|
|
31
|
+
private resubscribeAll;
|
|
32
|
+
subscribe(filters: Filter[], onEvent: (event: NostrEvent) => void, onEose?: () => void): Promise<void>;
|
|
33
|
+
unsubscribe(): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=applesauce-relay-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applesauce-relay-pool.d.ts","sourceRoot":"","sources":["../../../src/relay/applesauce-relay-pool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAerD;;GAEG;AACH,qBAAa,mBAAoB,YAAW,YAAY;IACtD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAGxC,OAAO,CAAC,aAAa,CAA+B;IAEpD;;;OAGG;gBACS,SAAS,EAAE,MAAM,EAAE;IAO/B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAY3B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC/C;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAuC1B;;OAEG;IACH,OAAO,CAAC,cAAc;IAiBhB,SAAS,CACb,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACpC,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,IAAI,CAAC;IAoBhB,WAAW,IAAI,IAAI;CAcpB"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { RelayPool } from 'applesauce-relay';
|
|
2
|
+
import { createLogger } from '../core/utils/logger.js';
|
|
3
|
+
const logger = createLogger('applesauce-relay');
|
|
4
|
+
/**
|
|
5
|
+
* A RelayHandler implementation that uses the applesauce-relay library's RelayPool to manage connections and subscriptions.
|
|
6
|
+
*/
|
|
7
|
+
export class ApplesauceRelayPool {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new ApplesauceRelayPool instance.
|
|
10
|
+
* @param relayUrls - An array of relay URLs to connect to.
|
|
11
|
+
*/
|
|
12
|
+
constructor(relayUrls) {
|
|
13
|
+
// Subscription management similar to other relay pools
|
|
14
|
+
this.subscriptions = [];
|
|
15
|
+
this.relayUrls = relayUrls;
|
|
16
|
+
this.pool = new RelayPool();
|
|
17
|
+
this.relayGroup = this.pool.group(relayUrls);
|
|
18
|
+
this.setupConnectionMonitoring();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sets up monitoring of relay connections and triggers resubscription when connections are lost
|
|
22
|
+
*/
|
|
23
|
+
setupConnectionMonitoring() {
|
|
24
|
+
this.pool.relays$.subscribe((relays) => {
|
|
25
|
+
relays.forEach((relay) => {
|
|
26
|
+
relay.connected$.subscribe((connected) => {
|
|
27
|
+
if (!connected) {
|
|
28
|
+
this.resubscribeAll();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async connect() {
|
|
35
|
+
logger.info('Connecting to relays', { relayUrls: this.relayUrls });
|
|
36
|
+
// Validate URL format
|
|
37
|
+
for (const url of this.relayUrls) {
|
|
38
|
+
try {
|
|
39
|
+
new URL(url);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
logger.error('Invalid relay URL', { url, error });
|
|
43
|
+
throw new Error(`Invalid relay URL: ${url}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// The RelayPool automatically connects to relays when needed
|
|
47
|
+
logger.info('Relay pool initialized', { relayUrls: this.relayUrls });
|
|
48
|
+
}
|
|
49
|
+
async disconnect() {
|
|
50
|
+
logger.info('Disconnecting from relays');
|
|
51
|
+
// Close all active subscriptions
|
|
52
|
+
this.unsubscribe();
|
|
53
|
+
// Close the relay pool
|
|
54
|
+
// Note: RelayPool doesn't have a close method, connections are managed automatically
|
|
55
|
+
// We just need to clear our subscriptions
|
|
56
|
+
logger.info('Disconnected from all relays');
|
|
57
|
+
}
|
|
58
|
+
async publish(event) {
|
|
59
|
+
logger.debug('Publishing event', { eventId: event.id, kind: event.kind });
|
|
60
|
+
// Use the publish method which handles retries automatically
|
|
61
|
+
const publishObservable = this.relayGroup.publish(event);
|
|
62
|
+
// Subscribe to the publish observable to handle responses
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
const subscription = publishObservable.subscribe({
|
|
65
|
+
next: (response) => {
|
|
66
|
+
if (!response.ok) {
|
|
67
|
+
logger.warn('Failed to publish event to relay', {
|
|
68
|
+
eventId: event.id,
|
|
69
|
+
relay: response.from,
|
|
70
|
+
message: response.message,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
error: (error) => {
|
|
75
|
+
logger.error('Failed to publish event', {
|
|
76
|
+
eventId: event.id,
|
|
77
|
+
error,
|
|
78
|
+
});
|
|
79
|
+
reject(error);
|
|
80
|
+
},
|
|
81
|
+
complete: () => {
|
|
82
|
+
logger.debug('Event publishing completed', { eventId: event.id });
|
|
83
|
+
subscription.unsubscribe();
|
|
84
|
+
resolve();
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates a simplified subscription wrapper around the RelayPool's subscription method.
|
|
91
|
+
* This provides a cleaner interface similar to other relay pool implementations.
|
|
92
|
+
*/
|
|
93
|
+
createSubscription(filters, onEvent, onEose) {
|
|
94
|
+
// Create a persistent subscription with automatic reconnection
|
|
95
|
+
const subscription = this.relayGroup.subscription(filters, {
|
|
96
|
+
retries: 3,
|
|
97
|
+
});
|
|
98
|
+
// Subscribe to the stream of events
|
|
99
|
+
const sub = subscription.subscribe({
|
|
100
|
+
next: (response) => {
|
|
101
|
+
if (response === 'EOSE') {
|
|
102
|
+
onEose === null || onEose === void 0 ? void 0 : onEose();
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
onEvent(response);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
error: (error) => {
|
|
109
|
+
logger.error('Subscription error', { error });
|
|
110
|
+
// Remove the subscription from the array if it fails
|
|
111
|
+
const index = this.subscriptions.findIndex((sub) => sub.onEvent === onEvent && sub.filters === filters);
|
|
112
|
+
if (index !== -1) {
|
|
113
|
+
this.subscriptions.splice(index, 1);
|
|
114
|
+
}
|
|
115
|
+
sub.unsubscribe();
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
unsubscribe: () => {
|
|
120
|
+
sub.unsubscribe();
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Resubscribes to all active subscriptions after relay reconnection
|
|
126
|
+
*/
|
|
127
|
+
resubscribeAll() {
|
|
128
|
+
logger.debug('Resubscribing to all subscriptions after relay reconnection');
|
|
129
|
+
try {
|
|
130
|
+
this.subscriptions.forEach((sub) => {
|
|
131
|
+
if (sub.closer)
|
|
132
|
+
sub.closer.unsubscribe();
|
|
133
|
+
sub.closer = this.createSubscription(sub.filters, sub.onEvent, sub.onEose);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
logger.error('Failed to resubscribe to subscriptions', { error });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async subscribe(filters, onEvent, onEose) {
|
|
141
|
+
logger.debug('Creating subscription', { filters });
|
|
142
|
+
try {
|
|
143
|
+
// Create a subscription using our simplified wrapper
|
|
144
|
+
const closer = this.createSubscription(filters, onEvent, onEose);
|
|
145
|
+
// Store the subscription for cleanup
|
|
146
|
+
this.subscriptions.push({
|
|
147
|
+
filters,
|
|
148
|
+
onEvent,
|
|
149
|
+
onEose,
|
|
150
|
+
closer,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
logger.error('Failed to create subscription', { filters, error });
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
unsubscribe() {
|
|
159
|
+
logger.debug('Unsubscribing from all subscriptions');
|
|
160
|
+
try {
|
|
161
|
+
// Close all active subscriptions
|
|
162
|
+
for (const subscription of this.subscriptions) {
|
|
163
|
+
subscription.closer.unsubscribe();
|
|
164
|
+
}
|
|
165
|
+
this.subscriptions = [];
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
logger.error('Error while unsubscribing from subscriptions', { error });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=applesauce-relay-pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applesauce-relay-pool.js","sourceRoot":"","sources":["../../../src/relay/applesauce-relay-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAYhD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAQ9B;;;OAGG;IACH,YAAY,SAAmB;QAP/B,uDA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CAAC;YACH,iCAAiC;YACjC,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBAC9C,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC;YAED,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QAC1B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,8CAA8C,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/relay/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/relay/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
|
package/dist/esm/relay/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/relay/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/relay/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-relay-pool.d.ts","sourceRoot":"","sources":["../../../src/relay/simple-relay-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMrD;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACr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11,6 @@ const logger = createLogger('relay');
|
|
|
11
11
|
export class SimpleRelayPool {
|
|
12
12
|
constructor(relayUrls) {
|
|
13
13
|
this.maxRetries = 5;
|
|
14
|
-
// Use Map for more efficient relay state management
|
|
15
14
|
this.relayStates = new Map();
|
|
16
15
|
this.subscriptions = [];
|
|
17
16
|
this.relayUrls = relayUrls;
|
|
@@ -40,7 +39,7 @@ export class SimpleRelayPool {
|
|
|
40
39
|
// Check all relays every 5 seconds
|
|
41
40
|
this.reconnectTimer = setTimeout(() => {
|
|
42
41
|
const connectionStatus = this.pool.listConnectionStatus();
|
|
43
|
-
this.relayStates.forEach((
|
|
42
|
+
this.relayStates.forEach((_, url) => {
|
|
44
43
|
if (!connectionStatus.get(url)) {
|
|
45
44
|
this.handleDisconnectedRelay(url);
|
|
46
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-relay-pool.js","sourceRoot":"","sources":["../../../src/relay/simple-relay-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;AAGvE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,eAAe;
|
|
1
|
+
{"version":3,"file":"simple-relay-pool.js","sourceRoot":"","sources":["../../../src/relay/simple-relay-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;AAGvE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAuB1B,YAAY,SAAmB;QAl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AG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,EAAE;YACxE,OAAO,EAAE,OAAO;YAChB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,WAAW;QACT,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,WAAC,OAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,KAAK,EAAE,CAAA,EAAA,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IAC1B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contextvm/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "CtxVM SDK for JavaScript/TypeScript",
|
|
5
5
|
"license": "LGPL-3.0-1",
|
|
6
6
|
"author": "ContextVM",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"build:esm": "mkdir -p dist/esm && echo '{\"type\": \"module\"}' > dist/esm/package.json && bun tsc -p tsconfig.prod.json",
|
|
43
43
|
"lint": "eslint src/",
|
|
44
44
|
"test": "bun tests",
|
|
45
|
-
"
|
|
45
|
+
"format": "bun prettier --write .",
|
|
46
46
|
"release": "bun run build && bun changeset publish"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@modelcontextprotocol/sdk": "^1.17.2",
|
|
62
|
-
"
|
|
62
|
+
"applesauce-relay": "^2.3.0",
|
|
63
63
|
"nostr-tools": "^2.16.2"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-server.d.ts","sourceRoot":"","sources":["../../../src/proxy/proxy-server.ts"],"names":[],"mappings":""}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
-
import { NostrMCPProxy } from './index.js';
|
|
4
|
-
import { PrivateKeySigner } from '../signer/private-key-signer.js';
|
|
5
|
-
import { SimpleRelayPool } from '../relay/simple-relay-pool.js';
|
|
6
|
-
/**
|
|
7
|
-
* Proxy server that exposes a remote Nostr MCP server via stdio.
|
|
8
|
-
* This allows MCP clients to connect to remote servers through the Nostr network.
|
|
9
|
-
*/
|
|
10
|
-
async function main() {
|
|
11
|
-
// Get configuration from environment variables
|
|
12
|
-
const relayUrl = process.env.RELAY_URL || 'ws://localhost:7777';
|
|
13
|
-
const clientPrivateKey = process.env.CLIENT_PRIVATE_KEY;
|
|
14
|
-
const serverPubkey = process.env.SERVER_PUBKEY;
|
|
15
|
-
if (!clientPrivateKey) {
|
|
16
|
-
console.error('CLIENT_PRIVATE_KEY environment variable is required');
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
if (!serverPubkey) {
|
|
20
|
-
console.error('SERVER_PUBKEY environment variable is required');
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
// Set up stdio transport for the server
|
|
24
|
-
const transport = new StdioServerTransport();
|
|
25
|
-
// Create Nostr components
|
|
26
|
-
const signer = new PrivateKeySigner(clientPrivateKey);
|
|
27
|
-
const relayPool = new SimpleRelayPool([relayUrl]);
|
|
28
|
-
// Create and start the proxy
|
|
29
|
-
const proxy = new NostrMCPProxy({
|
|
30
|
-
mcpHostTransport: transport,
|
|
31
|
-
nostrTransportOptions: {
|
|
32
|
-
signer,
|
|
33
|
-
relayHandler: relayPool,
|
|
34
|
-
serverPubkey,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
// Handle cleanup on process termination
|
|
38
|
-
process.on('SIGINT', async () => {
|
|
39
|
-
await proxy.stop();
|
|
40
|
-
process.exit(0);
|
|
41
|
-
});
|
|
42
|
-
process.on('SIGTERM', async () => {
|
|
43
|
-
await proxy.stop();
|
|
44
|
-
process.exit(0);
|
|
45
|
-
});
|
|
46
|
-
// Start the proxy
|
|
47
|
-
await proxy.start();
|
|
48
|
-
console.error('Proxy server started and connected to stdio');
|
|
49
|
-
}
|
|
50
|
-
// Run the server
|
|
51
|
-
main().catch((error) => {
|
|
52
|
-
console.error('Proxy server error:', error);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=proxy-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-server.js","sourceRoot":"","sources":["../../../src/proxy/proxy-server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;;GAGG;AACH,KAAK,UAAU,IAAI;IACjB,+CAA+C;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,qBAAqB,CAAC;IAChE,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IACxD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAE/C,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,gDAAgD,CA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