rivet-design 0.5.7 → 0.5.9
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/index.d.ts.map +1 -1
- package/dist/index.js +219 -18
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -5
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +20 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +12 -1
- package/dist/server.js.map +1 -1
- package/dist/utils/skillWriter.d.ts +10 -7
- package/dist/utils/skillWriter.d.ts.map +1 -1
- package/dist/utils/skillWriter.js +51 -53
- package/dist/utils/skillWriter.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +6 -0
- package/dist/utils/skills/claude-skill.d.ts.map +1 -0
- package/dist/utils/skills/claude-skill.js +49 -0
- package/dist/utils/skills/claude-skill.js.map +1 -0
- package/dist/utils/skills/cursor-rules.d.ts +5 -0
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -0
- package/dist/utils/skills/cursor-rules.js +49 -0
- package/dist/utils/skills/cursor-rules.js.map +1 -0
- package/package.json +1 -1
- package/src/ui/dist/assets/{main-DAIpACRO.js → main-BOpG2zGa.js} +62 -62
- package/src/ui/dist/index.html +1 -1
- package/dist/routes/electron.d.ts +0 -8
- package/dist/routes/electron.d.ts.map +0 -1
- package/dist/routes/electron.js +0 -127
- package/dist/routes/electron.js.map +0 -1
- package/dist/services/ElectronBridgeService.d.ts +0 -149
- package/dist/services/ElectronBridgeService.d.ts.map +0 -1
- package/dist/services/ElectronBridgeService.js +0 -332
- package/dist/services/ElectronBridgeService.js.map +0 -1
- package/dist/services/FileModificationService.d.ts +0 -33
- package/dist/services/FileModificationService.d.ts.map +0 -1
- package/dist/services/FileModificationService.js +0 -111
- package/dist/services/FileModificationService.js.map +0 -1
- package/dist/services/LLMService.d.ts +0 -92
- package/dist/services/LLMService.d.ts.map +0 -1
- package/dist/services/LLMService.js +0 -371
- package/dist/services/LLMService.js.map +0 -1
- package/dist/services/ScriptInjectionService.d.ts +0 -8
- package/dist/services/ScriptInjectionService.d.ts.map +0 -1
- package/dist/services/ScriptInjectionService.js +0 -172
- package/dist/services/ScriptInjectionService.js.map +0 -1
- package/dist/types/proxy-types.d.ts +0 -39
- package/dist/types/proxy-types.d.ts.map +0 -1
- package/dist/types/proxy-types.js +0 -3
- package/dist/types/proxy-types.js.map +0 -1
package/src/ui/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/x-icon" href="/rivet/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Rivet - The visual editor for design</title>
|
|
8
|
-
<script type="module" crossorigin src="/rivet/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/rivet/assets/main-BOpG2zGa.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/rivet/assets/main-Bbs1ywL7.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Router } from 'express';
|
|
2
|
-
import { ElectronBridgeService } from '../services/ElectronBridgeService';
|
|
3
|
-
/**
|
|
4
|
-
* Create Electron routes
|
|
5
|
-
* WebSocket connection is handled directly in server.ts via upgrade event
|
|
6
|
-
*/
|
|
7
|
-
export declare const createElectronRouter: (bridgeService: ElectronBridgeService) => Router;
|
|
8
|
-
//# sourceMappingURL=electron.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"electron.d.ts","sourceRoot":"","sources":["../../src/routes/electron.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAK1E;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,eAAe,qBAAqB,KACnC,MAuIF,CAAC"}
|
package/dist/routes/electron.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createElectronRouter = void 0;
|
|
4
|
-
const express_1 = require("express");
|
|
5
|
-
const logger_1 = require("../utils/logger");
|
|
6
|
-
const log = (0, logger_1.createLogger)('ElectronRoutes');
|
|
7
|
-
/**
|
|
8
|
-
* Create Electron routes
|
|
9
|
-
* WebSocket connection is handled directly in server.ts via upgrade event
|
|
10
|
-
*/
|
|
11
|
-
const createElectronRouter = (bridgeService) => {
|
|
12
|
-
const router = (0, express_1.Router)();
|
|
13
|
-
// REST endpoint to check connection status
|
|
14
|
-
router.get('/status', (_req, res) => {
|
|
15
|
-
res.json({
|
|
16
|
-
connected: bridgeService.getIsConnected(),
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
// Get list of connected windows
|
|
20
|
-
router.get('/windows', (_req, res) => {
|
|
21
|
-
const windows = bridgeService.getConnectedWindows();
|
|
22
|
-
res.json({ windows });
|
|
23
|
-
});
|
|
24
|
-
// Set target window for selection commands
|
|
25
|
-
router.post('/set-target-window', (req, res) => {
|
|
26
|
-
const { windowId } = req.body;
|
|
27
|
-
if (!windowId || typeof windowId !== 'string') {
|
|
28
|
-
return res.status(400).json({ error: 'windowId required' });
|
|
29
|
-
}
|
|
30
|
-
bridgeService.setTargetWindow(windowId);
|
|
31
|
-
log.info(`Target window set to: ${windowId}`);
|
|
32
|
-
res.json({ success: true, targetWindow: windowId });
|
|
33
|
-
});
|
|
34
|
-
// Enable element selection in Electron app
|
|
35
|
-
router.post('/enable-selection', (req, res) => {
|
|
36
|
-
// Optional: allow specifying target window in request body
|
|
37
|
-
const { windowId } = req.body || {};
|
|
38
|
-
if (windowId) {
|
|
39
|
-
bridgeService.setTargetWindow(windowId);
|
|
40
|
-
log.info(`Target window set to: ${windowId} (from enable-selection request)`);
|
|
41
|
-
}
|
|
42
|
-
if (!bridgeService.getIsConnected()) {
|
|
43
|
-
return res.status(400).json({ error: 'Electron app not connected' });
|
|
44
|
-
}
|
|
45
|
-
bridgeService.enableSelection();
|
|
46
|
-
log.info('Enabled element selection in Electron app');
|
|
47
|
-
res.json({ success: true });
|
|
48
|
-
});
|
|
49
|
-
// Disable element selection in Electron app
|
|
50
|
-
router.post('/disable-selection', (_req, res) => {
|
|
51
|
-
if (!bridgeService.getIsConnected()) {
|
|
52
|
-
return res.status(400).json({ error: 'Electron app not connected' });
|
|
53
|
-
}
|
|
54
|
-
bridgeService.disableSelection();
|
|
55
|
-
log.info('Disabled element selection in Electron app');
|
|
56
|
-
res.json({ success: true });
|
|
57
|
-
});
|
|
58
|
-
// Get the currently selected element from Electron app
|
|
59
|
-
router.get('/selected-element', (_req, res) => {
|
|
60
|
-
const selectedElement = bridgeService.getSelectedElement();
|
|
61
|
-
res.json({ element: selectedElement });
|
|
62
|
-
});
|
|
63
|
-
// SSE endpoint for real-time element updates
|
|
64
|
-
router.get('/element-stream', (req, res) => {
|
|
65
|
-
if (!bridgeService.getIsConnected()) {
|
|
66
|
-
return res.status(400).json({ error: 'Electron app not connected' });
|
|
67
|
-
}
|
|
68
|
-
// Setup SSE headers
|
|
69
|
-
res.setHeader('Content-Type', 'text/event-stream');
|
|
70
|
-
res.setHeader('Cache-Control', 'no-cache');
|
|
71
|
-
res.setHeader('Connection', 'keep-alive');
|
|
72
|
-
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
73
|
-
res.flushHeaders();
|
|
74
|
-
// Register this client
|
|
75
|
-
bridgeService.setSSEClient(res);
|
|
76
|
-
log.info('SSE client connected for element updates');
|
|
77
|
-
// Keep connection alive
|
|
78
|
-
req.on('close', () => {
|
|
79
|
-
log.info('SSE client request closed');
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
// Apply a style to an element in the Electron app
|
|
83
|
-
router.post('/apply-style', async (req, res) => {
|
|
84
|
-
const { id, property, value } = req.body;
|
|
85
|
-
if (!id || !property || value === undefined) {
|
|
86
|
-
return res
|
|
87
|
-
.status(400)
|
|
88
|
-
.json({ error: 'id, property, and value are required' });
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
if (!bridgeService.getIsConnected()) {
|
|
92
|
-
return res.status(400).json({ error: 'Electron app not connected' });
|
|
93
|
-
}
|
|
94
|
-
await bridgeService.applyStyle(id, property, value);
|
|
95
|
-
res.json({ success: true });
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
log.error('Failed to apply style remotely:', error);
|
|
99
|
-
res.status(500).json({
|
|
100
|
-
error: error instanceof Error ? error.message : 'Internal server error',
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
// Get computed styles for an element in the Electron app
|
|
105
|
-
router.post('/computed-styles', async (req, res) => {
|
|
106
|
-
const { id } = req.body;
|
|
107
|
-
if (!id) {
|
|
108
|
-
return res.status(400).json({ error: 'id is required' });
|
|
109
|
-
}
|
|
110
|
-
try {
|
|
111
|
-
if (!bridgeService.getIsConnected()) {
|
|
112
|
-
return res.status(400).json({ error: 'Electron app not connected' });
|
|
113
|
-
}
|
|
114
|
-
const styles = await bridgeService.getComputedStyles(id);
|
|
115
|
-
res.json(styles);
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
log.error('Failed to get remote computed styles:', error);
|
|
119
|
-
res.status(500).json({
|
|
120
|
-
error: error instanceof Error ? error.message : 'Internal server error',
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
return router;
|
|
125
|
-
};
|
|
126
|
-
exports.createElectronRouter = createElectronRouter;
|
|
127
|
-
//# sourceMappingURL=electron.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"electron.js","sourceRoot":"","sources":["../../src/routes/electron.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAEjC,4CAA+C;AAE/C,MAAM,GAAG,GAAG,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AAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;YACvE,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;YACzD,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;YAC1D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACnB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB;aACxE,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAzIW,QAAA,oBAAoB,wBAyI/B"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import type { Response } from 'express';
|
|
2
|
-
import { WebSocket } from 'ws';
|
|
3
|
-
import { ElementContext } from '../types/change-types';
|
|
4
|
-
/**
|
|
5
|
-
* Message types sent from Rivet server to Electron plugin
|
|
6
|
-
*/
|
|
7
|
-
export type ServerMessage = {
|
|
8
|
-
type: 'enable_selection';
|
|
9
|
-
} | {
|
|
10
|
-
type: 'disable_selection';
|
|
11
|
-
} | {
|
|
12
|
-
type: 'files_modified';
|
|
13
|
-
files: string[];
|
|
14
|
-
} | {
|
|
15
|
-
type: 'apply_style';
|
|
16
|
-
id: unknown;
|
|
17
|
-
property: string;
|
|
18
|
-
value: string;
|
|
19
|
-
requestId: string;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'get_computed_styles';
|
|
22
|
-
id: unknown;
|
|
23
|
-
requestId: string;
|
|
24
|
-
} | {
|
|
25
|
-
type: 'ping';
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Message types received from Electron plugin
|
|
29
|
-
*/
|
|
30
|
-
export type ClientMessage = {
|
|
31
|
-
type: 'connected';
|
|
32
|
-
appInfo: {
|
|
33
|
-
name: string;
|
|
34
|
-
version: string;
|
|
35
|
-
framework?: string;
|
|
36
|
-
windowId?: string;
|
|
37
|
-
};
|
|
38
|
-
} | {
|
|
39
|
-
type: 'element_selected';
|
|
40
|
-
element: ElementContext;
|
|
41
|
-
} | {
|
|
42
|
-
type: 'element_hovered';
|
|
43
|
-
element: ElementContext;
|
|
44
|
-
} | {
|
|
45
|
-
type: 'style_applied';
|
|
46
|
-
requestId: string;
|
|
47
|
-
success: boolean;
|
|
48
|
-
error?: string;
|
|
49
|
-
} | {
|
|
50
|
-
type: 'computed_styles_result';
|
|
51
|
-
requestId: string;
|
|
52
|
-
styles: Record<string, string>;
|
|
53
|
-
} | {
|
|
54
|
-
type: 'pong';
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Handles WebSocket communication with Electron plugin
|
|
58
|
-
*/
|
|
59
|
-
export declare class ElectronBridgeService {
|
|
60
|
-
private connections;
|
|
61
|
-
private messageHandlers;
|
|
62
|
-
private pingInterval;
|
|
63
|
-
private lastSelectedElement;
|
|
64
|
-
private sseClient;
|
|
65
|
-
private targetWindowId;
|
|
66
|
-
private pendingRequests;
|
|
67
|
-
constructor();
|
|
68
|
-
/**
|
|
69
|
-
* Attach WebSocket connection from Electron plugin
|
|
70
|
-
*/
|
|
71
|
-
attachWebSocket(ws: WebSocket): void;
|
|
72
|
-
/**
|
|
73
|
-
* Check if Electron app is connected
|
|
74
|
-
*/
|
|
75
|
-
getIsConnected(): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Set which window should receive selection commands
|
|
78
|
-
*/
|
|
79
|
-
setTargetWindow(windowId: string): void;
|
|
80
|
-
/**
|
|
81
|
-
* Get list of connected windows
|
|
82
|
-
*/
|
|
83
|
-
getConnectedWindows(): string[];
|
|
84
|
-
/**
|
|
85
|
-
* Get the last selected element from Electron app
|
|
86
|
-
*/
|
|
87
|
-
getSelectedElement(): ElementContext | null;
|
|
88
|
-
/**
|
|
89
|
-
* Clear the selected element
|
|
90
|
-
*/
|
|
91
|
-
clearSelectedElement(): void;
|
|
92
|
-
/**
|
|
93
|
-
* Send message to Electron plugin (sends to target window only)
|
|
94
|
-
*/
|
|
95
|
-
send(message: ServerMessage): void;
|
|
96
|
-
/**
|
|
97
|
-
* Register handler for specific message type
|
|
98
|
-
*/
|
|
99
|
-
on<T extends ClientMessage['type']>(type: T, handler: (message: Extract<ClientMessage, {
|
|
100
|
-
type: T;
|
|
101
|
-
}>) => void): void;
|
|
102
|
-
/**
|
|
103
|
-
* Remove handler for message type
|
|
104
|
-
*/
|
|
105
|
-
off<T extends ClientMessage['type']>(type: T, handler: (message: Extract<ClientMessage, {
|
|
106
|
-
type: T;
|
|
107
|
-
}>) => void): void;
|
|
108
|
-
/**
|
|
109
|
-
* Enable element selection mode in Electron app
|
|
110
|
-
*/
|
|
111
|
-
enableSelection(): void;
|
|
112
|
-
/**
|
|
113
|
-
* Disable element selection mode in Electron app
|
|
114
|
-
*/
|
|
115
|
-
disableSelection(): void;
|
|
116
|
-
/**
|
|
117
|
-
* Notify Electron app that files have been modified
|
|
118
|
-
*/
|
|
119
|
-
notifyFilesModified(files: string[]): void;
|
|
120
|
-
/**
|
|
121
|
-
* Apply a CSS style to an element in the Electron app
|
|
122
|
-
*/
|
|
123
|
-
applyStyle(id: unknown, property: string, value: string): Promise<void>;
|
|
124
|
-
/**
|
|
125
|
-
* Get computed styles for an element in the Electron app
|
|
126
|
-
*/
|
|
127
|
-
getComputedStyles(id: unknown): Promise<Record<string, string>>;
|
|
128
|
-
/**
|
|
129
|
-
* Register SSE client for element updates
|
|
130
|
-
*/
|
|
131
|
-
setSSEClient(res: Response): void;
|
|
132
|
-
/**
|
|
133
|
-
* Send SSE message to client
|
|
134
|
-
*/
|
|
135
|
-
private sendSSEMessage;
|
|
136
|
-
/**
|
|
137
|
-
* Handle incoming message from Electron
|
|
138
|
-
*/
|
|
139
|
-
private handleMessage;
|
|
140
|
-
/**
|
|
141
|
-
* Start heartbeat ping/pong
|
|
142
|
-
*/
|
|
143
|
-
private startHeartbeat;
|
|
144
|
-
/**
|
|
145
|
-
* Cleanup resources
|
|
146
|
-
*/
|
|
147
|
-
cleanup(): void;
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=ElectronBridgeService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronBridgeService.d.ts","sourceRoot":"","sources":["../../src/services/ElectronBridgeService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3C;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,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,CAAC,EACP,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,KAAK,IAAI,GAC9D,IAAI;IASP;;OAEG;IACH,GAAG,CAAC,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,EACjC,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,KAAK,IAAI,GAC9D,IAAI;IAYP;;OAEG;IACH,eAAe,IAAI,IAAI;IAIvB;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAIxB;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAI1C;;OAEG;IACG,UAAU,CACd,EAAE,EAAE,OAAO,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;IAahB;;OAEG;IACG,iBAAiB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAarE;;OAEG;IACH,YAAY,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAiBjC;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAetB;;OAEG;IACH,OAAO,IAAI,IAAI;CAkBhB"}
|
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ElectronBridgeService = void 0;
|
|
4
|
-
const logger_1 = require("../utils/logger");
|
|
5
|
-
const log = (0, logger_1.createLogger)('ElectronBridgeService');
|
|
6
|
-
/**
|
|
7
|
-
* Handles WebSocket communication with Electron plugin
|
|
8
|
-
*/
|
|
9
|
-
class ElectronBridgeService {
|
|
10
|
-
connections = new Map();
|
|
11
|
-
messageHandlers = new Map();
|
|
12
|
-
pingInterval = null;
|
|
13
|
-
lastSelectedElement = null;
|
|
14
|
-
sseClient = null;
|
|
15
|
-
targetWindowId = null; // Which window to send selection commands to
|
|
16
|
-
pendingRequests = new Map();
|
|
17
|
-
constructor() {
|
|
18
|
-
log.info('ElectronBridgeService initialized');
|
|
19
|
-
// Set up handler for element selection
|
|
20
|
-
this.on('element_selected', (message) => {
|
|
21
|
-
this.lastSelectedElement = message.element;
|
|
22
|
-
log.info('Element selected in Electron app:', message.element.tagName);
|
|
23
|
-
// Send to SSE client if connected
|
|
24
|
-
if (this.sseClient) {
|
|
25
|
-
this.sendSSEMessage('element_selected', message.element);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
// Handle responses for pending requests
|
|
29
|
-
this.on('style_applied', (message) => {
|
|
30
|
-
const pending = this.pendingRequests.get(message.requestId);
|
|
31
|
-
if (pending) {
|
|
32
|
-
clearTimeout(pending.timer);
|
|
33
|
-
this.pendingRequests.delete(message.requestId);
|
|
34
|
-
if (message.success) {
|
|
35
|
-
pending.resolve(undefined);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
pending.reject(new Error(message.error || 'Failed to apply style'));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
this.on('computed_styles_result', (message) => {
|
|
43
|
-
const pending = this.pendingRequests.get(message.requestId);
|
|
44
|
-
if (pending) {
|
|
45
|
-
clearTimeout(pending.timer);
|
|
46
|
-
this.pendingRequests.delete(message.requestId);
|
|
47
|
-
pending.resolve(message.styles);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Attach WebSocket connection from Electron plugin
|
|
53
|
-
*/
|
|
54
|
-
attachWebSocket(ws) {
|
|
55
|
-
const connectionId = Math.random().toString(36).substring(7);
|
|
56
|
-
log.debug(`Attaching Electron WebSocket connection [${connectionId}]`);
|
|
57
|
-
// Store connection temporarily with connectionId until we get windowId
|
|
58
|
-
this.connections.set(connectionId, { ws, windowId: null });
|
|
59
|
-
// Handle incoming messages
|
|
60
|
-
ws.on('message', (data) => {
|
|
61
|
-
try {
|
|
62
|
-
const message = JSON.parse(data.toString());
|
|
63
|
-
log.debug('Received message from Electron:', message.type);
|
|
64
|
-
// If this is a connection message, extract windowId and rekey the connection
|
|
65
|
-
if (message.type === 'connected' && message.appInfo.windowId) {
|
|
66
|
-
const windowId = message.appInfo.windowId;
|
|
67
|
-
log.info(`Window identified: ${windowId} (connection ${connectionId})`);
|
|
68
|
-
// Check if there's already a connection for this windowId
|
|
69
|
-
const existingEntry = Array.from(this.connections.entries()).find(([_, conn]) => conn.windowId === windowId);
|
|
70
|
-
if (existingEntry) {
|
|
71
|
-
const [existingConnId, existingConn] = existingEntry;
|
|
72
|
-
log.debug(`Replacing existing connection for window ${windowId} (old connection ${existingConnId})`);
|
|
73
|
-
// Close old connection
|
|
74
|
-
existingConn.ws.removeAllListeners();
|
|
75
|
-
setImmediate(() => {
|
|
76
|
-
try {
|
|
77
|
-
existingConn.ws.close();
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
log.error('Error closing old connection:', error);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
this.connections.delete(existingConnId);
|
|
84
|
-
}
|
|
85
|
-
// Update this connection with windowId
|
|
86
|
-
this.connections.set(connectionId, { ws, windowId });
|
|
87
|
-
}
|
|
88
|
-
this.handleMessage(message);
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
log.error('Failed to parse message from Electron:', error);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
// Handle connection close
|
|
95
|
-
ws.on('close', () => {
|
|
96
|
-
const conn = this.connections.get(connectionId);
|
|
97
|
-
log.info(`Electron WebSocket connection closed [${connectionId}]${conn?.windowId ? ` (window: ${conn.windowId})` : ''}`);
|
|
98
|
-
this.connections.delete(connectionId);
|
|
99
|
-
// If the closed connection was the target, clear target
|
|
100
|
-
if (conn?.windowId === this.targetWindowId) {
|
|
101
|
-
this.targetWindowId = null;
|
|
102
|
-
log.info('Target window closed, cleared target');
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
// Handle errors
|
|
106
|
-
ws.on('error', (error) => {
|
|
107
|
-
log.error('Electron WebSocket error:', error);
|
|
108
|
-
});
|
|
109
|
-
// Start ping/pong heartbeat if not already running
|
|
110
|
-
if (!this.pingInterval) {
|
|
111
|
-
this.startHeartbeat();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Check if Electron app is connected
|
|
116
|
-
*/
|
|
117
|
-
getIsConnected() {
|
|
118
|
-
return this.connections.size > 0;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Set which window should receive selection commands
|
|
122
|
-
*/
|
|
123
|
-
setTargetWindow(windowId) {
|
|
124
|
-
const hasWindow = Array.from(this.connections.values()).some((conn) => conn.windowId === windowId);
|
|
125
|
-
if (hasWindow) {
|
|
126
|
-
this.targetWindowId = windowId;
|
|
127
|
-
log.info(`Target window set to: ${windowId}`);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
log.warn(`Cannot set target to ${windowId} - window not connected`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Get list of connected windows
|
|
135
|
-
*/
|
|
136
|
-
getConnectedWindows() {
|
|
137
|
-
return Array.from(this.connections.values())
|
|
138
|
-
.map((conn) => conn.windowId)
|
|
139
|
-
.filter((id) => id !== null);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Get the last selected element from Electron app
|
|
143
|
-
*/
|
|
144
|
-
getSelectedElement() {
|
|
145
|
-
return this.lastSelectedElement;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Clear the selected element
|
|
149
|
-
*/
|
|
150
|
-
clearSelectedElement() {
|
|
151
|
-
this.lastSelectedElement = null;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Send message to Electron plugin (sends to target window only)
|
|
155
|
-
*/
|
|
156
|
-
send(message) {
|
|
157
|
-
if (!this.targetWindowId) {
|
|
158
|
-
log.warn('Cannot send message - No target window set');
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
// Find the connection for the target window
|
|
162
|
-
const targetConn = Array.from(this.connections.values()).find((conn) => conn.windowId === this.targetWindowId);
|
|
163
|
-
log.debug(`Found target connection: ${!!targetConn}, readyState: ${targetConn?.ws.readyState}`);
|
|
164
|
-
if (!targetConn) {
|
|
165
|
-
log.warn(`Cannot send message - Target window ${this.targetWindowId} not connected`);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const ws = targetConn.ws;
|
|
169
|
-
// Check actual WebSocket readyState
|
|
170
|
-
// 0 = CONNECTING, 1 = OPEN, 2 = CLOSING, 3 = CLOSED
|
|
171
|
-
if (ws.readyState !== 1) {
|
|
172
|
-
log.warn(`Cannot send message - WebSocket not ready (state: ${ws.readyState}, message: ${message.type})`);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
try {
|
|
176
|
-
ws.send(JSON.stringify(message));
|
|
177
|
-
log.debug(`Successfully sent ${message.type} to window ${this.targetWindowId}`);
|
|
178
|
-
}
|
|
179
|
-
catch (error) {
|
|
180
|
-
log.error('Failed to send message to Electron:', error);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Register handler for specific message type
|
|
185
|
-
*/
|
|
186
|
-
on(type, handler) {
|
|
187
|
-
if (!this.messageHandlers.has(type)) {
|
|
188
|
-
this.messageHandlers.set(type, []);
|
|
189
|
-
}
|
|
190
|
-
this.messageHandlers
|
|
191
|
-
.get(type)
|
|
192
|
-
.push(handler);
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Remove handler for message type
|
|
196
|
-
*/
|
|
197
|
-
off(type, handler) {
|
|
198
|
-
const handlers = this.messageHandlers.get(type);
|
|
199
|
-
if (handlers) {
|
|
200
|
-
const index = handlers.indexOf(handler);
|
|
201
|
-
if (index !== -1) {
|
|
202
|
-
handlers.splice(index, 1);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Enable element selection mode in Electron app
|
|
208
|
-
*/
|
|
209
|
-
enableSelection() {
|
|
210
|
-
this.send({ type: 'enable_selection' });
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Disable element selection mode in Electron app
|
|
214
|
-
*/
|
|
215
|
-
disableSelection() {
|
|
216
|
-
this.send({ type: 'disable_selection' });
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Notify Electron app that files have been modified
|
|
220
|
-
*/
|
|
221
|
-
notifyFilesModified(files) {
|
|
222
|
-
this.send({ type: 'files_modified', files });
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Apply a CSS style to an element in the Electron app
|
|
226
|
-
*/
|
|
227
|
-
async applyStyle(id, property, value) {
|
|
228
|
-
const requestId = Math.random().toString(36).substring(7);
|
|
229
|
-
return new Promise((resolve, reject) => {
|
|
230
|
-
const timer = setTimeout(() => {
|
|
231
|
-
this.pendingRequests.delete(requestId);
|
|
232
|
-
reject(new Error('Timeout waiting for apply_style response'));
|
|
233
|
-
}, 5000);
|
|
234
|
-
this.pendingRequests.set(requestId, { resolve, reject, timer });
|
|
235
|
-
this.send({ type: 'apply_style', id, property, value, requestId });
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Get computed styles for an element in the Electron app
|
|
240
|
-
*/
|
|
241
|
-
async getComputedStyles(id) {
|
|
242
|
-
const requestId = Math.random().toString(36).substring(7);
|
|
243
|
-
return new Promise((resolve, reject) => {
|
|
244
|
-
const timer = setTimeout(() => {
|
|
245
|
-
this.pendingRequests.delete(requestId);
|
|
246
|
-
reject(new Error('Timeout waiting for get_computed_styles response'));
|
|
247
|
-
}, 5000);
|
|
248
|
-
this.pendingRequests.set(requestId, { resolve, reject, timer });
|
|
249
|
-
this.send({ type: 'get_computed_styles', id, requestId });
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Register SSE client for element updates
|
|
254
|
-
*/
|
|
255
|
-
setSSEClient(res) {
|
|
256
|
-
log.info('Setting SSE client for element updates');
|
|
257
|
-
// Close previous client if exists
|
|
258
|
-
if (this.sseClient) {
|
|
259
|
-
this.sseClient.end();
|
|
260
|
-
}
|
|
261
|
-
this.sseClient = res;
|
|
262
|
-
// Clear on close
|
|
263
|
-
res.on('close', () => {
|
|
264
|
-
log.info('SSE client disconnected');
|
|
265
|
-
this.sseClient = null;
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Send SSE message to client
|
|
270
|
-
*/
|
|
271
|
-
sendSSEMessage(event, data) {
|
|
272
|
-
if (!this.sseClient)
|
|
273
|
-
return;
|
|
274
|
-
try {
|
|
275
|
-
this.sseClient.write(`event: ${event}\n`);
|
|
276
|
-
this.sseClient.write(`data: ${JSON.stringify(data)}\n\n`);
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
log.error('Failed to send SSE message:', error);
|
|
280
|
-
this.sseClient = null;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Handle incoming message from Electron
|
|
285
|
-
*/
|
|
286
|
-
handleMessage(message) {
|
|
287
|
-
const handlers = this.messageHandlers.get(message.type);
|
|
288
|
-
if (handlers) {
|
|
289
|
-
handlers.forEach((handler) => handler(message));
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Start heartbeat ping/pong
|
|
294
|
-
*/
|
|
295
|
-
startHeartbeat() {
|
|
296
|
-
this.pingInterval = setInterval(() => {
|
|
297
|
-
// Ping all connected windows
|
|
298
|
-
for (const [connId, conn] of this.connections.entries()) {
|
|
299
|
-
if (conn.ws.readyState === 1) {
|
|
300
|
-
try {
|
|
301
|
-
conn.ws.send(JSON.stringify({ type: 'ping' }));
|
|
302
|
-
}
|
|
303
|
-
catch (error) {
|
|
304
|
-
log.error(`Failed to ping connection ${connId}:`, error);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}, 30000); // Ping every 30 seconds
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Cleanup resources
|
|
312
|
-
*/
|
|
313
|
-
cleanup() {
|
|
314
|
-
if (this.pingInterval) {
|
|
315
|
-
clearInterval(this.pingInterval);
|
|
316
|
-
this.pingInterval = null;
|
|
317
|
-
}
|
|
318
|
-
for (const [connId, conn] of this.connections.entries()) {
|
|
319
|
-
try {
|
|
320
|
-
conn.ws.close();
|
|
321
|
-
}
|
|
322
|
-
catch (error) {
|
|
323
|
-
log.error(`Error closing connection ${connId}:`, error);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
this.connections.clear();
|
|
327
|
-
this.messageHandlers.clear();
|
|
328
|
-
this.targetWindowId = null;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
exports.ElectronBridgeService = ElectronBridgeService;
|
|
332
|
-
//# sourceMappingURL=ElectronBridgeService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronBridgeService.js","sourceRoot":"","sources":["../../src/services/ElectronBridgeService.ts"],"names":[],"mappings":";;;AAGA,4CAA+C;AAE/C,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,uBAAuB,CAAC,CAAC;AA+ClD;;GAEG;AACH,MAAa,qBAAqB;IACxB,WAAW,GACjB,IAAI,GAAG,EAAE,CAAC;IACJ,eAAe,GAGnB,IAAI,GAAG,EAAE,CAAC;IACN,YAAY,GAA0C,IAAI,CAAC;IAC3D,mBAAmB,GAA0B,IAAI,CAAC;IAClD,SAAS,GAAoB,IAAI,CAAC;IAClC,cAAc,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