@arvoretech/runtime-lens-mcp 1.0.0 → 1.2.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.
@@ -0,0 +1,433 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // extension/extension.ts
31
+ var extension_exports = {};
32
+ __export(extension_exports, {
33
+ activate: () => activate,
34
+ deactivate: () => deactivate
35
+ });
36
+ module.exports = __toCommonJS(extension_exports);
37
+ var import_node_path = require("node:path");
38
+ var vscode3 = __toESM(require("vscode"));
39
+
40
+ // extension/decorator.ts
41
+ var vscode = __toESM(require("vscode"));
42
+ var TYPE_COLORS = {
43
+ log: "#6A9955",
44
+ info: "#569CD6",
45
+ warn: "#CE9178",
46
+ error: "#F44747",
47
+ debug: "#9CDCFE",
48
+ result: "#DCDCAA"
49
+ };
50
+ var MAX_HISTORY_PER_LINE = 10;
51
+ var InlineDecorator = class {
52
+ decorationTypes = /* @__PURE__ */ new Map();
53
+ values = /* @__PURE__ */ new Map();
54
+ disposables = [];
55
+ activate(context) {
56
+ this.disposables.push(
57
+ vscode.window.onDidChangeActiveTextEditor(() => this.refresh()),
58
+ vscode.workspace.onDidChangeTextDocument((e) => {
59
+ if (e.document === vscode.window.activeTextEditor?.document) {
60
+ this.refresh();
61
+ }
62
+ })
63
+ );
64
+ context.subscriptions.push(...this.disposables);
65
+ }
66
+ addValue(value) {
67
+ const key = value.file;
68
+ if (!this.values.has(key)) {
69
+ this.values.set(key, /* @__PURE__ */ new Map());
70
+ }
71
+ const lineMap = this.values.get(key);
72
+ if (!lineMap.has(value.line)) {
73
+ lineMap.set(value.line, []);
74
+ }
75
+ const history = lineMap.get(value.line);
76
+ history.push(value);
77
+ if (history.length > MAX_HISTORY_PER_LINE) {
78
+ history.splice(0, history.length - MAX_HISTORY_PER_LINE);
79
+ }
80
+ this.refresh();
81
+ }
82
+ clearFile(file) {
83
+ this.values.delete(file);
84
+ this.refresh();
85
+ }
86
+ clearAll() {
87
+ this.values.clear();
88
+ this.clearDecorations();
89
+ }
90
+ refresh() {
91
+ const editor = vscode.window.activeTextEditor;
92
+ if (!editor) return;
93
+ this.clearDecorations();
94
+ const filePath = editor.document.uri.fsPath;
95
+ const lineMap = this.values.get(filePath);
96
+ if (!lineMap || lineMap.size === 0) return;
97
+ const decorationsByType = /* @__PURE__ */ new Map();
98
+ for (const [lineNum, history] of lineMap) {
99
+ if (history.length === 0) continue;
100
+ const lineIndex = lineNum - 1;
101
+ if (lineIndex < 0 || lineIndex >= editor.document.lineCount) continue;
102
+ const lineText = editor.document.lineAt(lineIndex).text;
103
+ const range = new vscode.Range(
104
+ new vscode.Position(lineIndex, lineText.length),
105
+ new vscode.Position(lineIndex, lineText.length)
106
+ );
107
+ const latest = history[history.length - 1];
108
+ const maxLen = vscode.workspace.getConfiguration("runtimeLens").get("maxInlineLength", 80);
109
+ let inlineText = latest.text;
110
+ if (inlineText.length > maxLen) {
111
+ inlineText = inlineText.slice(0, maxLen) + "\u2026";
112
+ }
113
+ if (history.length > 1) {
114
+ inlineText = `${inlineText} (\xD7${history.length})`;
115
+ }
116
+ const hoverLines = history.slice().reverse().map((v, i) => {
117
+ const time = new Date(v.timestamp).toLocaleTimeString();
118
+ const prefix = i === 0 ? "\u25B6" : " ";
119
+ return `${prefix} \`[${time}]\` ${v.type}: \`${v.text}\``;
120
+ }).join("\n\n");
121
+ const hover = new vscode.MarkdownString(
122
+ `**Runtime Lens** \u2014 ${history.length} log(s)
123
+
124
+ ${hoverLines}`
125
+ );
126
+ hover.isTrusted = true;
127
+ const decoration = {
128
+ range,
129
+ hoverMessage: hover,
130
+ renderOptions: {
131
+ after: {
132
+ contentText: ` // \u2192 ${inlineText}`,
133
+ color: TYPE_COLORS[latest.type] || "#6A9955",
134
+ fontStyle: "italic",
135
+ margin: "0 0 0 1em"
136
+ }
137
+ }
138
+ };
139
+ const typeKey = latest.type;
140
+ if (!decorationsByType.has(typeKey)) {
141
+ decorationsByType.set(typeKey, []);
142
+ }
143
+ decorationsByType.get(typeKey).push(decoration);
144
+ }
145
+ for (const [typeKey, decorations] of decorationsByType) {
146
+ const decorationType = vscode.window.createTextEditorDecorationType({
147
+ after: {
148
+ color: TYPE_COLORS[typeKey] || "#6A9955",
149
+ fontStyle: "italic"
150
+ },
151
+ isWholeLine: false
152
+ });
153
+ this.decorationTypes.set(typeKey, decorationType);
154
+ editor.setDecorations(decorationType, decorations);
155
+ }
156
+ }
157
+ clearDecorations() {
158
+ for (const decorationType of this.decorationTypes.values()) {
159
+ decorationType.dispose();
160
+ }
161
+ this.decorationTypes.clear();
162
+ }
163
+ dispose() {
164
+ this.clearDecorations();
165
+ for (const d of this.disposables) {
166
+ d.dispose();
167
+ }
168
+ }
169
+ };
170
+
171
+ // extension/runtime-bridge.ts
172
+ var vscode2 = __toESM(require("vscode"));
173
+ var import_node_http = require("node:http");
174
+ var import_node_crypto = require("node:crypto");
175
+ var RuntimeBridge = class {
176
+ socket = null;
177
+ reconnectTimer = null;
178
+ decorator;
179
+ port;
180
+ connected = false;
181
+ outputChannel;
182
+ dataBuffer = Buffer.alloc(0);
183
+ constructor(decorator2, outputChannel) {
184
+ this.decorator = decorator2;
185
+ this.port = vscode2.workspace.getConfiguration("runtimeLens").get("port", 9500);
186
+ this.outputChannel = outputChannel;
187
+ }
188
+ connect() {
189
+ if (this.socket) return;
190
+ const key = (0, import_node_crypto.randomBytes)(16).toString("base64");
191
+ const req = (0, import_node_http.request)({
192
+ hostname: "localhost",
193
+ port: this.port,
194
+ path: "/",
195
+ method: "GET",
196
+ headers: {
197
+ Upgrade: "websocket",
198
+ Connection: "Upgrade",
199
+ "Sec-WebSocket-Key": key,
200
+ "Sec-WebSocket-Version": "13"
201
+ }
202
+ });
203
+ req.on("upgrade", (_res, socket) => {
204
+ this.socket = socket;
205
+ this.connected = true;
206
+ this.dataBuffer = Buffer.alloc(0);
207
+ this.outputChannel.appendLine(`[runtime-lens] Connected to agent on port ${this.port}`);
208
+ vscode2.window.setStatusBarMessage("$(eye) Runtime Lens: Connected", 3e3);
209
+ socket.on("data", (data) => {
210
+ this.dataBuffer = Buffer.concat([this.dataBuffer, data]);
211
+ this.processFrames();
212
+ });
213
+ socket.on("close", () => {
214
+ this.connected = false;
215
+ this.socket = null;
216
+ this.scheduleReconnect();
217
+ });
218
+ socket.on("error", () => {
219
+ this.connected = false;
220
+ this.socket = null;
221
+ });
222
+ });
223
+ req.on("error", () => {
224
+ this.scheduleReconnect();
225
+ });
226
+ req.end();
227
+ }
228
+ disconnect() {
229
+ if (this.reconnectTimer) {
230
+ clearTimeout(this.reconnectTimer);
231
+ this.reconnectTimer = null;
232
+ }
233
+ if (this.socket) {
234
+ this.socket.end();
235
+ this.socket = null;
236
+ }
237
+ this.connected = false;
238
+ }
239
+ isConnected() {
240
+ return this.connected;
241
+ }
242
+ evaluate(expression, file, line) {
243
+ if (!this.socket || !this.connected) return;
244
+ const payload = JSON.stringify({ type: "eval", expression, file, line });
245
+ this.sendFrame(payload);
246
+ }
247
+ processFrames() {
248
+ while (this.dataBuffer.length >= 2) {
249
+ const firstByte = this.dataBuffer[0];
250
+ const secondByte = this.dataBuffer[1];
251
+ const isFin = (firstByte & 128) !== 0;
252
+ const opcode = firstByte & 15;
253
+ if (opcode === 8) {
254
+ this.socket?.end();
255
+ return;
256
+ }
257
+ let payloadLen = secondByte & 127;
258
+ let headerLen = 2;
259
+ if (payloadLen === 126) {
260
+ if (this.dataBuffer.length < 4) return;
261
+ payloadLen = this.dataBuffer.readUInt16BE(2);
262
+ headerLen = 4;
263
+ } else if (payloadLen === 127) {
264
+ if (this.dataBuffer.length < 10) return;
265
+ payloadLen = Number(this.dataBuffer.readBigUInt64BE(2));
266
+ headerLen = 10;
267
+ }
268
+ const totalLen = headerLen + payloadLen;
269
+ if (this.dataBuffer.length < totalLen) return;
270
+ const payload = this.dataBuffer.subarray(headerLen, totalLen);
271
+ this.dataBuffer = this.dataBuffer.subarray(totalLen);
272
+ if (isFin && (opcode === 1 || opcode === 2)) {
273
+ const text = payload.toString("utf-8");
274
+ try {
275
+ const msg = JSON.parse(text);
276
+ this.handleMessage(msg);
277
+ } catch {
278
+ }
279
+ }
280
+ }
281
+ }
282
+ sendFrame(text) {
283
+ if (!this.socket) return;
284
+ const data = Buffer.from(text, "utf-8");
285
+ const len = data.length;
286
+ let header;
287
+ if (len < 126) {
288
+ header = Buffer.alloc(2);
289
+ header[0] = 129;
290
+ header[1] = len;
291
+ } else if (len < 65536) {
292
+ header = Buffer.alloc(4);
293
+ header[0] = 129;
294
+ header[1] = 126;
295
+ header.writeUInt16BE(len, 2);
296
+ } else {
297
+ header = Buffer.alloc(10);
298
+ header[0] = 129;
299
+ header[1] = 127;
300
+ header.writeBigUInt64BE(BigInt(len), 2);
301
+ }
302
+ this.socket.write(Buffer.concat([header, data]));
303
+ }
304
+ handleMessage(msg) {
305
+ const workspaceFolders = vscode2.workspace.workspaceFolders;
306
+ if (!workspaceFolders) return;
307
+ let resolvedFile = msg.file;
308
+ for (const folder of workspaceFolders) {
309
+ if (msg.file.startsWith(folder.uri.fsPath)) {
310
+ resolvedFile = msg.file;
311
+ break;
312
+ }
313
+ }
314
+ const text = msg.values.join(", ");
315
+ this.decorator.addValue({
316
+ file: resolvedFile,
317
+ line: msg.line,
318
+ column: msg.column,
319
+ text,
320
+ type: msg.type,
321
+ timestamp: msg.timestamp
322
+ });
323
+ this.outputChannel.appendLine(
324
+ `[${msg.type}] ${resolvedFile}:${msg.line} \u2192 ${text}`
325
+ );
326
+ }
327
+ scheduleReconnect() {
328
+ if (this.reconnectTimer) return;
329
+ this.reconnectTimer = setTimeout(() => {
330
+ this.reconnectTimer = null;
331
+ this.connect();
332
+ }, 3e3);
333
+ }
334
+ };
335
+
336
+ // extension/extension.ts
337
+ var decorator;
338
+ var bridge;
339
+ var statusBarItem;
340
+ function activate(context) {
341
+ const outputChannel = vscode3.window.createOutputChannel("Runtime Lens");
342
+ const agentPath = (0, import_node_path.join)(context.extensionPath, "dist", "agent", "index.js");
343
+ decorator = new InlineDecorator();
344
+ decorator.activate(context);
345
+ bridge = new RuntimeBridge(decorator, outputChannel);
346
+ statusBarItem = vscode3.window.createStatusBarItem(
347
+ vscode3.StatusBarAlignment.Right,
348
+ 100
349
+ );
350
+ statusBarItem.text = "$(eye) Lens";
351
+ statusBarItem.tooltip = "Runtime Lens - Click to toggle";
352
+ statusBarItem.command = "runtimeLens.toggle";
353
+ statusBarItem.show();
354
+ context.subscriptions.push(statusBarItem);
355
+ const port = vscode3.workspace.getConfiguration("runtimeLens").get("port", 9500);
356
+ context.subscriptions.push(
357
+ vscode3.commands.registerCommand("runtimeLens.start", () => {
358
+ bridge.connect();
359
+ updateStatusBar(true);
360
+ vscode3.window.showInformationMessage(
361
+ "Runtime Lens: Listening for logs..."
362
+ );
363
+ }),
364
+ vscode3.commands.registerCommand("runtimeLens.stop", () => {
365
+ bridge.disconnect();
366
+ decorator.clearAll();
367
+ updateStatusBar(false);
368
+ vscode3.window.showInformationMessage("Runtime Lens: Stopped");
369
+ }),
370
+ vscode3.commands.registerCommand("runtimeLens.toggle", () => {
371
+ if (bridge.isConnected()) {
372
+ vscode3.commands.executeCommand("runtimeLens.stop");
373
+ } else {
374
+ vscode3.commands.executeCommand("runtimeLens.start");
375
+ }
376
+ }),
377
+ vscode3.commands.registerCommand("runtimeLens.clear", () => {
378
+ decorator.clearAll();
379
+ vscode3.window.showInformationMessage("Runtime Lens: Cleared");
380
+ }),
381
+ vscode3.commands.registerCommand("runtimeLens.connect", () => {
382
+ bridge.connect();
383
+ updateStatusBar(true);
384
+ }),
385
+ vscode3.commands.registerCommand("runtimeLens.showOutput", () => {
386
+ outputChannel.show();
387
+ }),
388
+ vscode3.commands.registerCommand("runtimeLens.injectEnv", () => {
389
+ const terminal = vscode3.window.activeTerminal;
390
+ if (!terminal) {
391
+ vscode3.window.showWarningMessage("Runtime Lens: No active terminal");
392
+ return;
393
+ }
394
+ terminal.sendText(`export NODE_OPTIONS="--require ${agentPath}"`, true);
395
+ terminal.sendText(`export RUNTIME_LENS_PORT="${port}"`, true);
396
+ vscode3.window.showInformationMessage(
397
+ "Runtime Lens: Environment injected. Run your app now."
398
+ );
399
+ })
400
+ );
401
+ context.subscriptions.push(
402
+ vscode3.workspace.onDidSaveTextDocument((doc) => {
403
+ decorator.clearFile(doc.uri.fsPath);
404
+ })
405
+ );
406
+ const autoStart = vscode3.workspace.getConfiguration("runtimeLens").get("autoStart", false);
407
+ if (autoStart) {
408
+ vscode3.commands.executeCommand("runtimeLens.start");
409
+ }
410
+ outputChannel.appendLine("[runtime-lens] Extension activated");
411
+ outputChannel.appendLine(`[runtime-lens] Agent path: ${agentPath}`);
412
+ }
413
+ function updateStatusBar(active) {
414
+ if (active) {
415
+ statusBarItem.text = "$(eye) Lens \u25CF";
416
+ statusBarItem.backgroundColor = new vscode3.ThemeColor(
417
+ "statusBarItem.warningBackground"
418
+ );
419
+ } else {
420
+ statusBarItem.text = "$(eye) Lens";
421
+ statusBarItem.backgroundColor = void 0;
422
+ }
423
+ }
424
+ function deactivate() {
425
+ bridge?.disconnect();
426
+ decorator?.dispose();
427
+ }
428
+ // Annotate the CommonJS export names for ESM import in node:
429
+ 0 && (module.exports = {
430
+ activate,
431
+ deactivate
432
+ });
433
+ //# sourceMappingURL=extension.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../extension/extension.ts", "../../extension/decorator.ts", "../../extension/runtime-bridge.ts"],
4
+ "sourcesContent": ["import { join } from \"node:path\";\nimport * as vscode from \"vscode\";\nimport { InlineDecorator } from \"./decorator.js\";\nimport { RuntimeBridge } from \"./runtime-bridge.js\";\n\nlet decorator: InlineDecorator;\nlet bridge: RuntimeBridge;\nlet statusBarItem: vscode.StatusBarItem;\n\nexport function activate(context: vscode.ExtensionContext): void {\n\tconst outputChannel = vscode.window.createOutputChannel(\"Runtime Lens\");\n\tconst agentPath = join(context.extensionPath, \"dist\", \"agent\", \"index.js\");\n\n\tdecorator = new InlineDecorator();\n\tdecorator.activate(context);\n\n\tbridge = new RuntimeBridge(decorator, outputChannel);\n\n\tstatusBarItem = vscode.window.createStatusBarItem(\n\t\tvscode.StatusBarAlignment.Right,\n\t\t100,\n\t);\n\tstatusBarItem.text = \"$(eye) Lens\";\n\tstatusBarItem.tooltip = \"Runtime Lens - Click to toggle\";\n\tstatusBarItem.command = \"runtimeLens.toggle\";\n\tstatusBarItem.show();\n\tcontext.subscriptions.push(statusBarItem);\n\n\tconst port = vscode.workspace\n\t\t.getConfiguration(\"runtimeLens\")\n\t\t.get(\"port\", 9500);\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand(\"runtimeLens.start\", () => {\n\t\t\tbridge.connect();\n\t\t\tupdateStatusBar(true);\n\t\t\tvscode.window.showInformationMessage(\n\t\t\t\t\"Runtime Lens: Listening for logs...\",\n\t\t\t);\n\t\t}),\n\n\t\tvscode.commands.registerCommand(\"runtimeLens.stop\", () => {\n\t\t\tbridge.disconnect();\n\t\t\tdecorator.clearAll();\n\t\t\tupdateStatusBar(false);\n\t\t\tvscode.window.showInformationMessage(\"Runtime Lens: Stopped\");\n\t\t}),\n\n\t\tvscode.commands.registerCommand(\"runtimeLens.toggle\", () => {\n\t\t\tif (bridge.isConnected()) {\n\t\t\t\tvscode.commands.executeCommand(\"runtimeLens.stop\");\n\t\t\t} else {\n\t\t\t\tvscode.commands.executeCommand(\"runtimeLens.start\");\n\t\t\t}\n\t\t}),\n\n\t\tvscode.commands.registerCommand(\"runtimeLens.clear\", () => {\n\t\t\tdecorator.clearAll();\n\t\t\tvscode.window.showInformationMessage(\"Runtime Lens: Cleared\");\n\t\t}),\n\n\t\tvscode.commands.registerCommand(\"runtimeLens.connect\", () => {\n\t\t\tbridge.connect();\n\t\t\tupdateStatusBar(true);\n\t\t}),\n\n\t\tvscode.commands.registerCommand(\"runtimeLens.showOutput\", () => {\n\t\t\toutputChannel.show();\n\t\t}),\n\n\t\tvscode.commands.registerCommand(\"runtimeLens.injectEnv\", () => {\n\t\t\tconst terminal = vscode.window.activeTerminal;\n\t\t\tif (!terminal) {\n\t\t\t\tvscode.window.showWarningMessage(\"Runtime Lens: No active terminal\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tterminal.sendText(`export NODE_OPTIONS=\"--require ${agentPath}\"`, true);\n\t\t\tterminal.sendText(`export RUNTIME_LENS_PORT=\"${port}\"`, true);\n\t\t\tvscode.window.showInformationMessage(\n\t\t\t\t\"Runtime Lens: Environment injected. Run your app now.\",\n\t\t\t);\n\t\t}),\n\t);\n\n\tcontext.subscriptions.push(\n\t\tvscode.workspace.onDidSaveTextDocument((doc) => {\n\t\t\tdecorator.clearFile(doc.uri.fsPath);\n\t\t}),\n\t);\n\n\tconst autoStart = vscode.workspace\n\t\t.getConfiguration(\"runtimeLens\")\n\t\t.get(\"autoStart\", false);\n\tif (autoStart) {\n\t\tvscode.commands.executeCommand(\"runtimeLens.start\");\n\t}\n\n\toutputChannel.appendLine(\"[runtime-lens] Extension activated\");\n\toutputChannel.appendLine(`[runtime-lens] Agent path: ${agentPath}`);\n}\n\nfunction updateStatusBar(active: boolean): void {\n\tif (active) {\n\t\tstatusBarItem.text = \"$(eye) Lens \u25CF\";\n\t\tstatusBarItem.backgroundColor = new vscode.ThemeColor(\n\t\t\t\"statusBarItem.warningBackground\",\n\t\t);\n\t} else {\n\t\tstatusBarItem.text = \"$(eye) Lens\";\n\t\tstatusBarItem.backgroundColor = undefined;\n\t}\n}\n\nexport function deactivate(): void {\n\tbridge?.disconnect();\n\tdecorator?.dispose();\n}\n", "import * as vscode from \"vscode\";\n\ninterface InlineValue {\n\tfile: string;\n\tline: number;\n\tcolumn: number;\n\ttext: string;\n\ttype: \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\" | \"result\";\n\ttimestamp: number;\n}\n\nconst TYPE_COLORS: Record<string, string> = {\n\tlog: \"#6A9955\",\n\tinfo: \"#569CD6\",\n\twarn: \"#CE9178\",\n\terror: \"#F44747\",\n\tdebug: \"#9CDCFE\",\n\tresult: \"#DCDCAA\",\n};\n\nconst MAX_HISTORY_PER_LINE = 10;\n\nexport class InlineDecorator {\n\tprivate decorationTypes: Map<string, vscode.TextEditorDecorationType> =\n\t\tnew Map();\n\tprivate values: Map<string, Map<number, InlineValue[]>> = new Map();\n\tprivate disposables: vscode.Disposable[] = [];\n\n\tactivate(context: vscode.ExtensionContext): void {\n\t\tthis.disposables.push(\n\t\t\tvscode.window.onDidChangeActiveTextEditor(() => this.refresh()),\n\t\t\tvscode.workspace.onDidChangeTextDocument((e) => {\n\t\t\t\tif (e.document === vscode.window.activeTextEditor?.document) {\n\t\t\t\t\tthis.refresh();\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t\tcontext.subscriptions.push(...this.disposables);\n\t}\n\n\taddValue(value: InlineValue): void {\n\t\tconst key = value.file;\n\t\tif (!this.values.has(key)) {\n\t\t\tthis.values.set(key, new Map());\n\t\t}\n\t\tconst lineMap = this.values.get(key)!;\n\t\tif (!lineMap.has(value.line)) {\n\t\t\tlineMap.set(value.line, []);\n\t\t}\n\n\t\tconst history = lineMap.get(value.line)!;\n\t\thistory.push(value);\n\n\t\tif (history.length > MAX_HISTORY_PER_LINE) {\n\t\t\thistory.splice(0, history.length - MAX_HISTORY_PER_LINE);\n\t\t}\n\n\t\tthis.refresh();\n\t}\n\n\tclearFile(file: string): void {\n\t\tthis.values.delete(file);\n\t\tthis.refresh();\n\t}\n\n\tclearAll(): void {\n\t\tthis.values.clear();\n\t\tthis.clearDecorations();\n\t}\n\n\trefresh(): void {\n\t\tconst editor = vscode.window.activeTextEditor;\n\t\tif (!editor) return;\n\n\t\tthis.clearDecorations();\n\n\t\tconst filePath = editor.document.uri.fsPath;\n\t\tconst lineMap = this.values.get(filePath);\n\t\tif (!lineMap || lineMap.size === 0) return;\n\n\t\tconst decorationsByType = new Map<string, vscode.DecorationOptions[]>();\n\n\t\tfor (const [lineNum, history] of lineMap) {\n\t\t\tif (history.length === 0) continue;\n\n\t\t\tconst lineIndex = lineNum - 1;\n\t\t\tif (lineIndex < 0 || lineIndex >= editor.document.lineCount) continue;\n\n\t\t\tconst lineText = editor.document.lineAt(lineIndex).text;\n\t\t\tconst range = new vscode.Range(\n\t\t\t\tnew vscode.Position(lineIndex, lineText.length),\n\t\t\t\tnew vscode.Position(lineIndex, lineText.length),\n\t\t\t);\n\n\t\t\tconst latest = history[history.length - 1];\n\t\t\tconst maxLen = vscode.workspace\n\t\t\t\t.getConfiguration(\"runtimeLens\")\n\t\t\t\t.get(\"maxInlineLength\", 80);\n\n\t\t\tlet inlineText = latest.text;\n\t\t\tif (inlineText.length > maxLen) {\n\t\t\t\tinlineText = inlineText.slice(0, maxLen) + \"\u2026\";\n\t\t\t}\n\t\t\tif (history.length > 1) {\n\t\t\t\tinlineText = `${inlineText} (\u00D7${history.length})`;\n\t\t\t}\n\n\t\t\tconst hoverLines = history\n\t\t\t\t.slice()\n\t\t\t\t.reverse()\n\t\t\t\t.map((v, i) => {\n\t\t\t\t\tconst time = new Date(v.timestamp).toLocaleTimeString();\n\t\t\t\t\tconst prefix = i === 0 ? \"\u25B6\" : \" \";\n\t\t\t\t\treturn `${prefix} \\`[${time}]\\` ${v.type}: \\`${v.text}\\``;\n\t\t\t\t})\n\t\t\t\t.join(\"\\n\\n\");\n\n\t\t\tconst hover = new vscode.MarkdownString(\n\t\t\t\t`**Runtime Lens** \u2014 ${history.length} log(s)\\n\\n${hoverLines}`,\n\t\t\t);\n\t\t\thover.isTrusted = true;\n\n\t\t\tconst decoration: vscode.DecorationOptions = {\n\t\t\t\trange,\n\t\t\t\thoverMessage: hover,\n\t\t\t\trenderOptions: {\n\t\t\t\t\tafter: {\n\t\t\t\t\t\tcontentText: ` // \u2192 ${inlineText}`,\n\t\t\t\t\t\tcolor: TYPE_COLORS[latest.type] || \"#6A9955\",\n\t\t\t\t\t\tfontStyle: \"italic\",\n\t\t\t\t\t\tmargin: \"0 0 0 1em\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tconst typeKey = latest.type;\n\t\t\tif (!decorationsByType.has(typeKey)) {\n\t\t\t\tdecorationsByType.set(typeKey, []);\n\t\t\t}\n\t\t\tdecorationsByType.get(typeKey)!.push(decoration);\n\t\t}\n\n\t\tfor (const [typeKey, decorations] of decorationsByType) {\n\t\t\tconst decorationType = vscode.window.createTextEditorDecorationType({\n\t\t\t\tafter: {\n\t\t\t\t\tcolor: TYPE_COLORS[typeKey] || \"#6A9955\",\n\t\t\t\t\tfontStyle: \"italic\",\n\t\t\t\t},\n\t\t\t\tisWholeLine: false,\n\t\t\t});\n\t\t\tthis.decorationTypes.set(typeKey, decorationType);\n\t\t\teditor.setDecorations(decorationType, decorations);\n\t\t}\n\t}\n\n\tprivate clearDecorations(): void {\n\t\tfor (const decorationType of this.decorationTypes.values()) {\n\t\t\tdecorationType.dispose();\n\t\t}\n\t\tthis.decorationTypes.clear();\n\t}\n\n\tdispose(): void {\n\t\tthis.clearDecorations();\n\t\tfor (const d of this.disposables) {\n\t\t\td.dispose();\n\t\t}\n\t}\n}\n", "import * as vscode from \"vscode\";\nimport { request } from \"node:http\";\nimport { randomBytes } from \"node:crypto\";\nimport type { Socket } from \"node:net\";\nimport { InlineDecorator } from \"./decorator.js\";\n\ninterface AgentMessage {\n type: \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\" | \"result\";\n file: string;\n line: number;\n column: number;\n values: string[];\n timestamp: number;\n expression?: string;\n}\n\nexport class RuntimeBridge {\n private socket: Socket | null = null;\n private reconnectTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly decorator: InlineDecorator;\n private readonly port: number;\n private connected = false;\n private readonly outputChannel: vscode.OutputChannel;\n private dataBuffer: Buffer = Buffer.alloc(0);\n\n constructor(decorator: InlineDecorator, outputChannel: vscode.OutputChannel) {\n this.decorator = decorator;\n this.port = vscode.workspace.getConfiguration(\"runtimeLens\").get(\"port\", 9500);\n this.outputChannel = outputChannel;\n }\n\n connect(): void {\n if (this.socket) return;\n\n const key = randomBytes(16).toString(\"base64\");\n\n const req = request({\n hostname: \"localhost\",\n port: this.port,\n path: \"/\",\n method: \"GET\",\n headers: {\n Upgrade: \"websocket\",\n Connection: \"Upgrade\",\n \"Sec-WebSocket-Key\": key,\n \"Sec-WebSocket-Version\": \"13\",\n },\n });\n\n req.on(\"upgrade\", (_res, socket) => {\n this.socket = socket;\n this.connected = true;\n this.dataBuffer = Buffer.alloc(0);\n this.outputChannel.appendLine(`[runtime-lens] Connected to agent on port ${this.port}`);\n vscode.window.setStatusBarMessage(\"$(eye) Runtime Lens: Connected\", 3000);\n\n socket.on(\"data\", (data: Buffer) => {\n this.dataBuffer = Buffer.concat([this.dataBuffer, data]);\n this.processFrames();\n });\n\n socket.on(\"close\", () => {\n this.connected = false;\n this.socket = null;\n this.scheduleReconnect();\n });\n\n socket.on(\"error\", () => {\n this.connected = false;\n this.socket = null;\n });\n });\n\n req.on(\"error\", () => {\n this.scheduleReconnect();\n });\n\n req.end();\n }\n\n disconnect(): void {\n if (this.reconnectTimer) {\n clearTimeout(this.reconnectTimer);\n this.reconnectTimer = null;\n }\n if (this.socket) {\n this.socket.end();\n this.socket = null;\n }\n this.connected = false;\n }\n\n isConnected(): boolean {\n return this.connected;\n }\n\n evaluate(expression: string, file: string, line: number): void {\n if (!this.socket || !this.connected) return;\n const payload = JSON.stringify({ type: \"eval\", expression, file, line });\n this.sendFrame(payload);\n }\n\n private processFrames(): void {\n while (this.dataBuffer.length >= 2) {\n const firstByte = this.dataBuffer[0];\n const secondByte = this.dataBuffer[1];\n const isFin = (firstByte & 0x80) !== 0;\n const opcode = firstByte & 0x0f;\n\n if (opcode === 0x08) {\n this.socket?.end();\n return;\n }\n\n let payloadLen = secondByte & 0x7f;\n let headerLen = 2;\n\n if (payloadLen === 126) {\n if (this.dataBuffer.length < 4) return;\n payloadLen = this.dataBuffer.readUInt16BE(2);\n headerLen = 4;\n } else if (payloadLen === 127) {\n if (this.dataBuffer.length < 10) return;\n payloadLen = Number(this.dataBuffer.readBigUInt64BE(2));\n headerLen = 10;\n }\n\n const totalLen = headerLen + payloadLen;\n if (this.dataBuffer.length < totalLen) return;\n\n const payload = this.dataBuffer.subarray(headerLen, totalLen);\n this.dataBuffer = this.dataBuffer.subarray(totalLen);\n\n if (isFin && (opcode === 0x01 || opcode === 0x02)) {\n const text = payload.toString(\"utf-8\");\n try {\n const msg: AgentMessage = JSON.parse(text);\n this.handleMessage(msg);\n } catch {\n // invalid JSON\n }\n }\n }\n }\n\n private sendFrame(text: string): void {\n if (!this.socket) return;\n const data = Buffer.from(text, \"utf-8\");\n const len = data.length;\n let header: Buffer;\n\n if (len < 126) {\n header = Buffer.alloc(2);\n header[0] = 0x81;\n header[1] = len;\n } else if (len < 65536) {\n header = Buffer.alloc(4);\n header[0] = 0x81;\n header[1] = 126;\n header.writeUInt16BE(len, 2);\n } else {\n header = Buffer.alloc(10);\n header[0] = 0x81;\n header[1] = 127;\n header.writeBigUInt64BE(BigInt(len), 2);\n }\n\n this.socket.write(Buffer.concat([header, data]));\n }\n\n private handleMessage(msg: AgentMessage): void {\n const workspaceFolders = vscode.workspace.workspaceFolders;\n if (!workspaceFolders) return;\n\n let resolvedFile = msg.file;\n for (const folder of workspaceFolders) {\n if (msg.file.startsWith(folder.uri.fsPath)) {\n resolvedFile = msg.file;\n break;\n }\n }\n\n const text = msg.values.join(\", \");\n\n this.decorator.addValue({\n file: resolvedFile,\n line: msg.line,\n column: msg.column,\n text,\n type: msg.type,\n timestamp: msg.timestamp,\n });\n\n this.outputChannel.appendLine(\n `[${msg.type}] ${resolvedFile}:${msg.line} \u2192 ${text}`\n );\n }\n\n private scheduleReconnect(): void {\n if (this.reconnectTimer) return;\n this.reconnectTimer = setTimeout(() => {\n this.reconnectTimer = null;\n this.connect();\n }, 3000);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqB;AACrB,IAAAA,UAAwB;;;ACDxB,aAAwB;AAWxB,IAAM,cAAsC;AAAA,EAC3C,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AACT;AAEA,IAAM,uBAAuB;AAEtB,IAAM,kBAAN,MAAsB;AAAA,EACpB,kBACP,oBAAI,IAAI;AAAA,EACD,SAAkD,oBAAI,IAAI;AAAA,EAC1D,cAAmC,CAAC;AAAA,EAE5C,SAAS,SAAwC;AAChD,SAAK,YAAY;AAAA,MACT,cAAO,4BAA4B,MAAM,KAAK,QAAQ,CAAC;AAAA,MACvD,iBAAU,wBAAwB,CAAC,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D;AAAA,IACD,CAAC;AAAA,EACF;AAEA,UAAQ,cAAc;AAAA,IACd,kBAAU,sBAAsB,CAAC,QAAQ;AAC/C,gBAAU,UAAU,IAAI,IAAI,MAAM;AAAA,IACnC,CAAC;AAAA,EACF;AAEA,QAAM,YAAmB,kBACvB,iBAAiB,aAAa,EAC9B,IAAI,aAAa,KAAK;AACxB,MAAI,WAAW;AACd,IAAO,iBAAS,eAAe,mBAAmB;AAAA,EACnD;AAEA,gBAAc,WAAW,oCAAoC;AAC7D,gBAAc,WAAW,8BAA8B,SAAS,EAAE;AACnE;AAEA,SAAS,gBAAgB,QAAuB;AAC/C,MAAI,QAAQ;AACX,kBAAc,OAAO;AACrB,kBAAc,kBAAkB,IAAW;AAAA,MAC1C;AAAA,IACD;AAAA,EACD,OAAO;AACN,kBAAc,OAAO;AACrB,kBAAc,kBAAkB;AAAA,EACjC;AACD;AAEO,SAAS,aAAmB;AAClC,UAAQ,WAAW;AACnB,aAAW,QAAQ;AACpB;",
6
+ "names": ["vscode", "vscode", "decorator"]
7
+ }
package/dist/server.d.ts CHANGED
@@ -3,6 +3,7 @@ export declare class RuntimeLensMCPServer {
3
3
  private readonly collector;
4
4
  private readonly inspector;
5
5
  private readonly interceptor;
6
+ private readonly agentBridge;
6
7
  constructor(projectRoot?: string, logPaths?: string[]);
7
8
  static fromEnvironment(): RuntimeLensMCPServer;
8
9
  private setupTools;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAaA,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;gBAErC,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAarD,MAAM,CAAC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