@elizaos/capacitor-gateway 1.0.0

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/plugin.js ADDED
@@ -0,0 +1,438 @@
1
+ var capacitorGateway = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const loadWeb = () => Promise.resolve().then(function () { return web; }).then((m) => new m.GatewayWeb());
5
+ const Gateway = core.registerPlugin("Gateway", {
6
+ web: loadWeb,
7
+ });
8
+
9
+ /**
10
+ * Generate a UUID v4
11
+ */
12
+ function generateUUID() {
13
+ if (typeof crypto !== "undefined" && crypto.randomUUID) {
14
+ return crypto.randomUUID();
15
+ }
16
+ if (typeof crypto !== "undefined" &&
17
+ typeof crypto.getRandomValues === "function") {
18
+ const bytes = new Uint8Array(16);
19
+ crypto.getRandomValues(bytes);
20
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
21
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
22
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
23
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
24
+ }
25
+ throw new Error("No secure random source available for UUID generation");
26
+ }
27
+ const isJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
28
+ const getString = (value) => typeof value === "string" ? value : undefined;
29
+ const getNumber = (value) => typeof value === "number" ? value : undefined;
30
+ const getBoolean = (value) => typeof value === "boolean" ? value : undefined;
31
+ const toStringArray = (value) => Array.isArray(value)
32
+ ? value.filter((item) => typeof item === "string")
33
+ : [];
34
+ const parseGatewayError = (value) => {
35
+ if (!value || !isJsonObject(value))
36
+ return undefined;
37
+ const code = getString(value.code);
38
+ const message = getString(value.message);
39
+ if (!code || !message)
40
+ return undefined;
41
+ return {
42
+ code,
43
+ message,
44
+ details: value.details,
45
+ };
46
+ };
47
+ /**
48
+ * Web implementation of the Gateway Plugin
49
+ *
50
+ * Uses browser WebSocket API for connectivity.
51
+ * Note: Web platform cannot perform Bonjour/mDNS discovery.
52
+ */
53
+ class GatewayWeb extends core.WebPlugin {
54
+ constructor() {
55
+ super(...arguments);
56
+ this.ws = null;
57
+ this.pending = new Map();
58
+ this.options = null;
59
+ this.sessionId = null;
60
+ this.protocol = null;
61
+ this.role = null;
62
+ this.scopes = [];
63
+ this.methods = [];
64
+ this.events = [];
65
+ this.lastSeq = null;
66
+ this.reconnectTimer = null;
67
+ this.backoffMs = 800;
68
+ this.closed = false;
69
+ this.connectResolve = null;
70
+ this.connectReject = null;
71
+ }
72
+ /**
73
+ * Start gateway discovery (not supported on web)
74
+ *
75
+ * On web platforms, Bonjour/mDNS discovery is not available.
76
+ * Returns an empty list of gateways.
77
+ */
78
+ async startDiscovery() {
79
+ return {
80
+ gateways: [],
81
+ status: "Discovery not supported on web platform",
82
+ };
83
+ }
84
+ /**
85
+ * Stop gateway discovery (no-op on web)
86
+ */
87
+ async stopDiscovery() {
88
+ // No-op on web
89
+ }
90
+ /**
91
+ * Get discovered gateways (always empty on web)
92
+ */
93
+ async getDiscoveredGateways() {
94
+ return {
95
+ gateways: [],
96
+ status: "Discovery not supported on web platform",
97
+ };
98
+ }
99
+ /**
100
+ * Connect to a Gateway server
101
+ */
102
+ async connect(options) {
103
+ // Close existing connection if any
104
+ if (this.ws) {
105
+ this.closed = true;
106
+ this.ws.close();
107
+ this.ws = null;
108
+ }
109
+ this.options = options;
110
+ this.closed = false;
111
+ this.backoffMs = 800;
112
+ return new Promise((resolve, reject) => {
113
+ this.connectResolve = resolve;
114
+ this.connectReject = reject;
115
+ this.establishConnection();
116
+ });
117
+ }
118
+ /**
119
+ * Establish WebSocket connection
120
+ */
121
+ establishConnection() {
122
+ if (this.closed || !this.options) {
123
+ return;
124
+ }
125
+ this.notifyStateChange("connecting");
126
+ this.ws = new WebSocket(this.options.url);
127
+ this.ws.addEventListener("open", () => {
128
+ this.sendConnectFrame();
129
+ });
130
+ this.ws.addEventListener("message", (event) => {
131
+ this.handleMessage(String(event.data));
132
+ });
133
+ this.ws.addEventListener("close", (event) => {
134
+ const reason = event.reason || "Connection closed";
135
+ this.handleClose(event.code, reason);
136
+ });
137
+ this.ws.addEventListener("error", (event) => {
138
+ console.warn("[Gateway] WebSocket error:", event);
139
+ });
140
+ }
141
+ /**
142
+ * Send the connect frame to authenticate
143
+ */
144
+ sendConnectFrame() {
145
+ if (!this.ws || !this.options || this.ws.readyState !== WebSocket.OPEN) {
146
+ return;
147
+ }
148
+ const auth = {};
149
+ if (this.options.token) {
150
+ auth.token = this.options.token;
151
+ }
152
+ if (this.options.password) {
153
+ auth.password = this.options.password;
154
+ }
155
+ const params = {
156
+ minProtocol: 3,
157
+ maxProtocol: 3,
158
+ client: {
159
+ id: this.options.clientName || "eliza-capacitor",
160
+ version: this.options.clientVersion || "1.0.0",
161
+ platform: this.getPlatform(),
162
+ mode: "ui",
163
+ },
164
+ role: this.options.role || "operator",
165
+ scopes: this.options.scopes || ["operator.admin"],
166
+ caps: [],
167
+ auth,
168
+ };
169
+ const frame = {
170
+ type: "req",
171
+ id: generateUUID(),
172
+ method: "connect",
173
+ params,
174
+ };
175
+ this.ws.send(JSON.stringify(frame));
176
+ // Set up timeout for connect response
177
+ const timeout = setTimeout(() => {
178
+ if (this.connectReject) {
179
+ this.connectReject(new Error("Connection timeout"));
180
+ this.connectReject = null;
181
+ this.connectResolve = null;
182
+ }
183
+ }, 30000);
184
+ this.pending.set(frame.id, {
185
+ resolve: (result) => {
186
+ clearTimeout(timeout);
187
+ if (result.ok && result.payload && isJsonObject(result.payload)) {
188
+ this.handleHelloOk(result.payload);
189
+ }
190
+ else {
191
+ if (this.connectReject) {
192
+ this.connectReject(new Error(result.error?.message || "Connection failed"));
193
+ }
194
+ }
195
+ this.connectReject = null;
196
+ this.connectResolve = null;
197
+ },
198
+ reject: (error) => {
199
+ clearTimeout(timeout);
200
+ if (this.connectReject) {
201
+ this.connectReject(error);
202
+ }
203
+ this.connectReject = null;
204
+ this.connectResolve = null;
205
+ },
206
+ timeout,
207
+ });
208
+ }
209
+ /**
210
+ * Handle successful hello response
211
+ */
212
+ handleHelloOk(hello) {
213
+ const protocol = getNumber(hello.protocol);
214
+ const auth = isJsonObject(hello.auth) ? hello.auth : null;
215
+ const features = isJsonObject(hello.features) ? hello.features : null;
216
+ this.sessionId = generateUUID();
217
+ this.protocol = protocol ?? null;
218
+ this.role = getString(auth?.role) || this.options?.role || "operator";
219
+ this.scopes = toStringArray(auth?.scopes);
220
+ this.methods = toStringArray(features?.methods);
221
+ this.events = toStringArray(features?.events);
222
+ this.backoffMs = 800;
223
+ this.notifyStateChange("connected");
224
+ if (this.connectResolve) {
225
+ this.connectResolve({
226
+ connected: true,
227
+ sessionId: this.sessionId,
228
+ protocol: this.protocol ?? undefined,
229
+ methods: this.methods,
230
+ events: this.events,
231
+ role: this.role,
232
+ scopes: this.scopes,
233
+ });
234
+ }
235
+ }
236
+ /**
237
+ * Handle incoming WebSocket message
238
+ */
239
+ handleMessage(raw) {
240
+ let parsedValue;
241
+ try {
242
+ parsedValue = JSON.parse(raw);
243
+ }
244
+ catch {
245
+ return;
246
+ }
247
+ if (!isJsonObject(parsedValue)) {
248
+ return;
249
+ }
250
+ const frameType = getString(parsedValue.type);
251
+ if (!frameType) {
252
+ return;
253
+ }
254
+ // Handle response frames
255
+ if (frameType === "res") {
256
+ const id = getString(parsedValue.id);
257
+ if (!id)
258
+ return;
259
+ const pending = this.pending.get(id);
260
+ if (pending) {
261
+ this.pending.delete(id);
262
+ clearTimeout(pending.timeout);
263
+ pending.resolve({
264
+ ok: getBoolean(parsedValue.ok) ?? false,
265
+ payload: parsedValue.payload,
266
+ error: parseGatewayError(parsedValue.error),
267
+ });
268
+ }
269
+ return;
270
+ }
271
+ // Handle event frames
272
+ if (frameType === "event") {
273
+ const event = getString(parsedValue.event);
274
+ if (!event)
275
+ return;
276
+ const payload = parsedValue.payload;
277
+ const seq = getNumber(parsedValue.seq);
278
+ // Check for sequence gap
279
+ if (seq !== undefined &&
280
+ this.lastSeq !== null &&
281
+ seq > this.lastSeq + 1) {
282
+ console.warn(`[Gateway] Event sequence gap: expected ${this.lastSeq + 1}, got ${seq}`);
283
+ }
284
+ if (seq !== undefined) {
285
+ this.lastSeq = seq;
286
+ }
287
+ // Emit the event
288
+ this.notifyListeners("gatewayEvent", {
289
+ event,
290
+ payload,
291
+ seq,
292
+ });
293
+ return;
294
+ }
295
+ }
296
+ /**
297
+ * Handle WebSocket close
298
+ */
299
+ handleClose(code, reason) {
300
+ this.ws = null;
301
+ // Reject all pending requests
302
+ for (const [id, pending] of this.pending) {
303
+ clearTimeout(pending.timeout);
304
+ pending.reject(new Error(`Connection closed: ${reason}`));
305
+ this.pending.delete(id);
306
+ }
307
+ if (this.closed) {
308
+ this.notifyStateChange("disconnected", reason);
309
+ return;
310
+ }
311
+ // Attempt reconnection
312
+ this.notifyStateChange("reconnecting", reason);
313
+ this.notifyListeners("error", {
314
+ message: `Connection lost: ${reason}`,
315
+ code: String(code),
316
+ willRetry: true,
317
+ });
318
+ this.scheduleReconnect();
319
+ }
320
+ /**
321
+ * Schedule a reconnection attempt
322
+ */
323
+ scheduleReconnect() {
324
+ if (this.closed || this.reconnectTimer) {
325
+ return;
326
+ }
327
+ this.reconnectTimer = setTimeout(() => {
328
+ this.reconnectTimer = null;
329
+ this.backoffMs = Math.min(this.backoffMs * 1.7, 15000);
330
+ this.establishConnection();
331
+ }, this.backoffMs);
332
+ }
333
+ /**
334
+ * Notify state change listeners
335
+ */
336
+ notifyStateChange(state, reason) {
337
+ this.notifyListeners("stateChange", {
338
+ state,
339
+ reason,
340
+ });
341
+ }
342
+ /**
343
+ * Get platform identifier
344
+ */
345
+ getPlatform() {
346
+ if (typeof navigator !== "undefined") {
347
+ return navigator.platform || "web";
348
+ }
349
+ return "web";
350
+ }
351
+ /**
352
+ * Disconnect from the Gateway
353
+ */
354
+ async disconnect() {
355
+ this.closed = true;
356
+ if (this.reconnectTimer) {
357
+ clearTimeout(this.reconnectTimer);
358
+ this.reconnectTimer = null;
359
+ }
360
+ if (this.ws) {
361
+ this.ws.close(1000, "Client disconnect");
362
+ this.ws = null;
363
+ }
364
+ this.sessionId = null;
365
+ this.protocol = null;
366
+ this.notifyStateChange("disconnected", "Client disconnect");
367
+ }
368
+ /**
369
+ * Check if connected
370
+ */
371
+ async isConnected() {
372
+ return {
373
+ connected: this.ws !== null && this.ws.readyState === WebSocket.OPEN,
374
+ };
375
+ }
376
+ /**
377
+ * Send an RPC request
378
+ */
379
+ async send(options) {
380
+ if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
381
+ return {
382
+ ok: false,
383
+ error: {
384
+ code: "NOT_CONNECTED",
385
+ message: "Not connected to gateway",
386
+ },
387
+ };
388
+ }
389
+ const id = generateUUID();
390
+ const frame = {
391
+ type: "req",
392
+ id,
393
+ method: options.method,
394
+ params: options.params || {},
395
+ };
396
+ return new Promise((resolve, reject) => {
397
+ const timeout = setTimeout(() => {
398
+ this.pending.delete(id);
399
+ resolve({
400
+ ok: false,
401
+ error: {
402
+ code: "TIMEOUT",
403
+ message: "Request timed out",
404
+ },
405
+ });
406
+ }, 60000); // 60 second timeout
407
+ this.pending.set(id, {
408
+ resolve,
409
+ reject,
410
+ timeout,
411
+ });
412
+ this.ws?.send(JSON.stringify(frame));
413
+ });
414
+ }
415
+ /**
416
+ * Get connection info
417
+ */
418
+ async getConnectionInfo() {
419
+ return {
420
+ url: this.options?.url || null,
421
+ sessionId: this.sessionId,
422
+ protocol: this.protocol,
423
+ role: this.role,
424
+ };
425
+ }
426
+ }
427
+
428
+ var web = /*#__PURE__*/Object.freeze({
429
+ __proto__: null,
430
+ GatewayWeb: GatewayWeb
431
+ });
432
+
433
+ exports.Gateway = Gateway;
434
+
435
+ return exports;
436
+
437
+ })({}, capacitorExports);
438
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.GatewayWeb());\nexport const Gateway = registerPlugin(\"Gateway\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\n/**\n * Generate a UUID v4\n */\nfunction generateUUID() {\n if (typeof crypto !== \"undefined\" && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n if (typeof crypto !== \"undefined\" &&\n typeof crypto.getRandomValues === \"function\") {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n }\n throw new Error(\"No secure random source available for UUID generation\");\n}\nconst isJsonObject = (value) => typeof value === \"object\" && value !== null && !Array.isArray(value);\nconst getString = (value) => typeof value === \"string\" ? value : undefined;\nconst getNumber = (value) => typeof value === \"number\" ? value : undefined;\nconst getBoolean = (value) => typeof value === \"boolean\" ? value : undefined;\nconst toStringArray = (value) => Array.isArray(value)\n ? value.filter((item) => typeof item === \"string\")\n : [];\nconst parseGatewayError = (value) => {\n if (!value || !isJsonObject(value))\n return undefined;\n const code = getString(value.code);\n const message = getString(value.message);\n if (!code || !message)\n return undefined;\n return {\n code,\n message,\n details: value.details,\n };\n};\n/**\n * Web implementation of the Gateway Plugin\n *\n * Uses browser WebSocket API for connectivity.\n * Note: Web platform cannot perform Bonjour/mDNS discovery.\n */\nexport class GatewayWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.ws = null;\n this.pending = new Map();\n this.options = null;\n this.sessionId = null;\n this.protocol = null;\n this.role = null;\n this.scopes = [];\n this.methods = [];\n this.events = [];\n this.lastSeq = null;\n this.reconnectTimer = null;\n this.backoffMs = 800;\n this.closed = false;\n this.connectResolve = null;\n this.connectReject = null;\n }\n /**\n * Start gateway discovery (not supported on web)\n *\n * On web platforms, Bonjour/mDNS discovery is not available.\n * Returns an empty list of gateways.\n */\n async startDiscovery() {\n return {\n gateways: [],\n status: \"Discovery not supported on web platform\",\n };\n }\n /**\n * Stop gateway discovery (no-op on web)\n */\n async stopDiscovery() {\n // No-op on web\n }\n /**\n * Get discovered gateways (always empty on web)\n */\n async getDiscoveredGateways() {\n return {\n gateways: [],\n status: \"Discovery not supported on web platform\",\n };\n }\n /**\n * Connect to a Gateway server\n */\n async connect(options) {\n // Close existing connection if any\n if (this.ws) {\n this.closed = true;\n this.ws.close();\n this.ws = null;\n }\n this.options = options;\n this.closed = false;\n this.backoffMs = 800;\n return new Promise((resolve, reject) => {\n this.connectResolve = resolve;\n this.connectReject = reject;\n this.establishConnection();\n });\n }\n /**\n * Establish WebSocket connection\n */\n establishConnection() {\n if (this.closed || !this.options) {\n return;\n }\n this.notifyStateChange(\"connecting\");\n this.ws = new WebSocket(this.options.url);\n this.ws.addEventListener(\"open\", () => {\n this.sendConnectFrame();\n });\n this.ws.addEventListener(\"message\", (event) => {\n this.handleMessage(String(event.data));\n });\n this.ws.addEventListener(\"close\", (event) => {\n const reason = event.reason || \"Connection closed\";\n this.handleClose(event.code, reason);\n });\n this.ws.addEventListener(\"error\", (event) => {\n console.warn(\"[Gateway] WebSocket error:\", event);\n });\n }\n /**\n * Send the connect frame to authenticate\n */\n sendConnectFrame() {\n if (!this.ws || !this.options || this.ws.readyState !== WebSocket.OPEN) {\n return;\n }\n const auth = {};\n if (this.options.token) {\n auth.token = this.options.token;\n }\n if (this.options.password) {\n auth.password = this.options.password;\n }\n const params = {\n minProtocol: 3,\n maxProtocol: 3,\n client: {\n id: this.options.clientName || \"eliza-capacitor\",\n version: this.options.clientVersion || \"1.0.0\",\n platform: this.getPlatform(),\n mode: \"ui\",\n },\n role: this.options.role || \"operator\",\n scopes: this.options.scopes || [\"operator.admin\"],\n caps: [],\n auth,\n };\n const frame = {\n type: \"req\",\n id: generateUUID(),\n method: \"connect\",\n params,\n };\n this.ws.send(JSON.stringify(frame));\n // Set up timeout for connect response\n const timeout = setTimeout(() => {\n if (this.connectReject) {\n this.connectReject(new Error(\"Connection timeout\"));\n this.connectReject = null;\n this.connectResolve = null;\n }\n }, 30000);\n this.pending.set(frame.id, {\n resolve: (result) => {\n clearTimeout(timeout);\n if (result.ok && result.payload && isJsonObject(result.payload)) {\n this.handleHelloOk(result.payload);\n }\n else {\n if (this.connectReject) {\n this.connectReject(new Error(result.error?.message || \"Connection failed\"));\n }\n }\n this.connectReject = null;\n this.connectResolve = null;\n },\n reject: (error) => {\n clearTimeout(timeout);\n if (this.connectReject) {\n this.connectReject(error);\n }\n this.connectReject = null;\n this.connectResolve = null;\n },\n timeout,\n });\n }\n /**\n * Handle successful hello response\n */\n handleHelloOk(hello) {\n const protocol = getNumber(hello.protocol);\n const auth = isJsonObject(hello.auth) ? hello.auth : null;\n const features = isJsonObject(hello.features) ? hello.features : null;\n this.sessionId = generateUUID();\n this.protocol = protocol ?? null;\n this.role = getString(auth?.role) || this.options?.role || \"operator\";\n this.scopes = toStringArray(auth?.scopes);\n this.methods = toStringArray(features?.methods);\n this.events = toStringArray(features?.events);\n this.backoffMs = 800;\n this.notifyStateChange(\"connected\");\n if (this.connectResolve) {\n this.connectResolve({\n connected: true,\n sessionId: this.sessionId,\n protocol: this.protocol ?? undefined,\n methods: this.methods,\n events: this.events,\n role: this.role,\n scopes: this.scopes,\n });\n }\n }\n /**\n * Handle incoming WebSocket message\n */\n handleMessage(raw) {\n let parsedValue;\n try {\n parsedValue = JSON.parse(raw);\n }\n catch {\n return;\n }\n if (!isJsonObject(parsedValue)) {\n return;\n }\n const frameType = getString(parsedValue.type);\n if (!frameType) {\n return;\n }\n // Handle response frames\n if (frameType === \"res\") {\n const id = getString(parsedValue.id);\n if (!id)\n return;\n const pending = this.pending.get(id);\n if (pending) {\n this.pending.delete(id);\n clearTimeout(pending.timeout);\n pending.resolve({\n ok: getBoolean(parsedValue.ok) ?? false,\n payload: parsedValue.payload,\n error: parseGatewayError(parsedValue.error),\n });\n }\n return;\n }\n // Handle event frames\n if (frameType === \"event\") {\n const event = getString(parsedValue.event);\n if (!event)\n return;\n const payload = parsedValue.payload;\n const seq = getNumber(parsedValue.seq);\n // Check for sequence gap\n if (seq !== undefined &&\n this.lastSeq !== null &&\n seq > this.lastSeq + 1) {\n console.warn(`[Gateway] Event sequence gap: expected ${this.lastSeq + 1}, got ${seq}`);\n }\n if (seq !== undefined) {\n this.lastSeq = seq;\n }\n // Emit the event\n this.notifyListeners(\"gatewayEvent\", {\n event,\n payload,\n seq,\n });\n return;\n }\n }\n /**\n * Handle WebSocket close\n */\n handleClose(code, reason) {\n this.ws = null;\n // Reject all pending requests\n for (const [id, pending] of this.pending) {\n clearTimeout(pending.timeout);\n pending.reject(new Error(`Connection closed: ${reason}`));\n this.pending.delete(id);\n }\n if (this.closed) {\n this.notifyStateChange(\"disconnected\", reason);\n return;\n }\n // Attempt reconnection\n this.notifyStateChange(\"reconnecting\", reason);\n this.notifyListeners(\"error\", {\n message: `Connection lost: ${reason}`,\n code: String(code),\n willRetry: true,\n });\n this.scheduleReconnect();\n }\n /**\n * Schedule a reconnection attempt\n */\n scheduleReconnect() {\n if (this.closed || this.reconnectTimer) {\n return;\n }\n this.reconnectTimer = setTimeout(() => {\n this.reconnectTimer = null;\n this.backoffMs = Math.min(this.backoffMs * 1.7, 15000);\n this.establishConnection();\n }, this.backoffMs);\n }\n /**\n * Notify state change listeners\n */\n notifyStateChange(state, reason) {\n this.notifyListeners(\"stateChange\", {\n state,\n reason,\n });\n }\n /**\n * Get platform identifier\n */\n getPlatform() {\n if (typeof navigator !== \"undefined\") {\n return navigator.platform || \"web\";\n }\n return \"web\";\n }\n /**\n * Disconnect from the Gateway\n */\n async disconnect() {\n this.closed = true;\n if (this.reconnectTimer) {\n clearTimeout(this.reconnectTimer);\n this.reconnectTimer = null;\n }\n if (this.ws) {\n this.ws.close(1000, \"Client disconnect\");\n this.ws = null;\n }\n this.sessionId = null;\n this.protocol = null;\n this.notifyStateChange(\"disconnected\", \"Client disconnect\");\n }\n /**\n * Check if connected\n */\n async isConnected() {\n return {\n connected: this.ws !== null && this.ws.readyState === WebSocket.OPEN,\n };\n }\n /**\n * Send an RPC request\n */\n async send(options) {\n if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {\n return {\n ok: false,\n error: {\n code: \"NOT_CONNECTED\",\n message: \"Not connected to gateway\",\n },\n };\n }\n const id = generateUUID();\n const frame = {\n type: \"req\",\n id,\n method: options.method,\n params: options.params || {},\n };\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n this.pending.delete(id);\n resolve({\n ok: false,\n error: {\n code: \"TIMEOUT\",\n message: \"Request timed out\",\n },\n });\n }, 60000); // 60 second timeout\n this.pending.set(id, {\n resolve,\n reject,\n timeout,\n });\n this.ws?.send(JSON.stringify(frame));\n });\n }\n /**\n * Get connection info\n */\n async getConnectionInfo() {\n return {\n url: this.options?.url || null,\n sessionId: this.sessionId,\n protocol: this.protocol,\n role: this.role,\n };\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AACzD,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IACjD,IAAI,GAAG,EAAE,OAAO;IAChB,CAAC;;ICJD;IACA;IACA;IACA,SAAS,YAAY,GAAG;IACxB,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE;IAC5D,QAAQ,OAAO,MAAM,CAAC,UAAU,EAAE;IAClC,IAAI;IACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW;IACrC,QAAQ,OAAO,MAAM,CAAC,eAAe,KAAK,UAAU,EA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