@minicor/mcp-server 2.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.
Files changed (134) hide show
  1. package/README.md +169 -0
  2. package/dist/__tests__/diff.test.d.ts +2 -0
  3. package/dist/__tests__/diff.test.d.ts.map +1 -0
  4. package/dist/__tests__/diff.test.js +23 -0
  5. package/dist/__tests__/diff.test.js.map +1 -0
  6. package/dist/__tests__/helpers.test.d.ts +2 -0
  7. package/dist/__tests__/helpers.test.d.ts.map +1 -0
  8. package/dist/__tests__/helpers.test.js +70 -0
  9. package/dist/__tests__/helpers.test.js.map +1 -0
  10. package/dist/__tests__/inspect-scripts.test.d.ts +2 -0
  11. package/dist/__tests__/inspect-scripts.test.d.ts.map +1 -0
  12. package/dist/__tests__/inspect-scripts.test.js +66 -0
  13. package/dist/__tests__/inspect-scripts.test.js.map +1 -0
  14. package/dist/browser-client.d.ts +42 -0
  15. package/dist/browser-client.d.ts.map +1 -0
  16. package/dist/browser-client.js +66 -0
  17. package/dist/browser-client.js.map +1 -0
  18. package/dist/cli.d.ts +14 -0
  19. package/dist/cli.d.ts.map +1 -0
  20. package/dist/cli.js +256 -0
  21. package/dist/cli.js.map +1 -0
  22. package/dist/config.d.ts +21 -0
  23. package/dist/config.d.ts.map +1 -0
  24. package/dist/config.js +57 -0
  25. package/dist/config.js.map +1 -0
  26. package/dist/diff.d.ts +7 -0
  27. package/dist/diff.d.ts.map +1 -0
  28. package/dist/diff.js +97 -0
  29. package/dist/diff.js.map +1 -0
  30. package/dist/helpers.d.ts +28 -0
  31. package/dist/helpers.d.ts.map +1 -0
  32. package/dist/helpers.js +91 -0
  33. package/dist/helpers.js.map +1 -0
  34. package/dist/index.d.ts +9 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +193 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/inspect-scripts.d.ts +18 -0
  39. package/dist/inspect-scripts.d.ts.map +1 -0
  40. package/dist/inspect-scripts.js +572 -0
  41. package/dist/inspect-scripts.js.map +1 -0
  42. package/dist/laminar-client.d.ts +160 -0
  43. package/dist/laminar-client.d.ts.map +1 -0
  44. package/dist/laminar-client.js +237 -0
  45. package/dist/laminar-client.js.map +1 -0
  46. package/dist/lds-client.d.ts +107 -0
  47. package/dist/lds-client.d.ts.map +1 -0
  48. package/dist/lds-client.js +81 -0
  49. package/dist/lds-client.js.map +1 -0
  50. package/dist/paths.d.ts +17 -0
  51. package/dist/paths.d.ts.map +1 -0
  52. package/dist/paths.js +46 -0
  53. package/dist/paths.js.map +1 -0
  54. package/dist/prompts/build-browser-rpa.d.ts +3 -0
  55. package/dist/prompts/build-browser-rpa.d.ts.map +1 -0
  56. package/dist/prompts/build-browser-rpa.js +90 -0
  57. package/dist/prompts/build-browser-rpa.js.map +1 -0
  58. package/dist/prompts/build-rpa.d.ts +3 -0
  59. package/dist/prompts/build-rpa.d.ts.map +1 -0
  60. package/dist/prompts/build-rpa.js +168 -0
  61. package/dist/prompts/build-rpa.js.map +1 -0
  62. package/dist/prompts/debug-execution.d.ts +3 -0
  63. package/dist/prompts/debug-execution.d.ts.map +1 -0
  64. package/dist/prompts/debug-execution.js +50 -0
  65. package/dist/prompts/debug-execution.js.map +1 -0
  66. package/dist/prompts/workflow-guide.d.ts +3 -0
  67. package/dist/prompts/workflow-guide.d.ts.map +1 -0
  68. package/dist/prompts/workflow-guide.js +175 -0
  69. package/dist/prompts/workflow-guide.js.map +1 -0
  70. package/dist/services.d.ts +61 -0
  71. package/dist/services.d.ts.map +1 -0
  72. package/dist/services.js +249 -0
  73. package/dist/services.js.map +1 -0
  74. package/dist/setup.d.ts +11 -0
  75. package/dist/setup.d.ts.map +1 -0
  76. package/dist/setup.js +790 -0
  77. package/dist/setup.js.map +1 -0
  78. package/dist/state.d.ts +23 -0
  79. package/dist/state.d.ts.map +1 -0
  80. package/dist/state.js +24 -0
  81. package/dist/state.js.map +1 -0
  82. package/dist/sync.d.ts +86 -0
  83. package/dist/sync.d.ts.map +1 -0
  84. package/dist/sync.js +394 -0
  85. package/dist/sync.js.map +1 -0
  86. package/dist/tools/browser.d.ts +3 -0
  87. package/dist/tools/browser.d.ts.map +1 -0
  88. package/dist/tools/browser.js +254 -0
  89. package/dist/tools/browser.js.map +1 -0
  90. package/dist/tools/config-stores.d.ts +3 -0
  91. package/dist/tools/config-stores.d.ts.map +1 -0
  92. package/dist/tools/config-stores.js +54 -0
  93. package/dist/tools/config-stores.js.map +1 -0
  94. package/dist/tools/core.d.ts +3 -0
  95. package/dist/tools/core.d.ts.map +1 -0
  96. package/dist/tools/core.js +202 -0
  97. package/dist/tools/core.js.map +1 -0
  98. package/dist/tools/cron.d.ts +3 -0
  99. package/dist/tools/cron.d.ts.map +1 -0
  100. package/dist/tools/cron.js +168 -0
  101. package/dist/tools/cron.js.map +1 -0
  102. package/dist/tools/elasticsearch.d.ts +3 -0
  103. package/dist/tools/elasticsearch.d.ts.map +1 -0
  104. package/dist/tools/elasticsearch.js +248 -0
  105. package/dist/tools/elasticsearch.js.map +1 -0
  106. package/dist/tools/issues.d.ts +3 -0
  107. package/dist/tools/issues.d.ts.map +1 -0
  108. package/dist/tools/issues.js +39 -0
  109. package/dist/tools/issues.js.map +1 -0
  110. package/dist/tools/stats.d.ts +3 -0
  111. package/dist/tools/stats.d.ts.map +1 -0
  112. package/dist/tools/stats.js +18 -0
  113. package/dist/tools/stats.js.map +1 -0
  114. package/dist/tools/sync-tools.d.ts +3 -0
  115. package/dist/tools/sync-tools.d.ts.map +1 -0
  116. package/dist/tools/sync-tools.js +121 -0
  117. package/dist/tools/sync-tools.js.map +1 -0
  118. package/dist/tools/vm-rpa.d.ts +3 -0
  119. package/dist/tools/vm-rpa.d.ts.map +1 -0
  120. package/dist/tools/vm-rpa.js +281 -0
  121. package/dist/tools/vm-rpa.js.map +1 -0
  122. package/dist/tools/vm.d.ts +3 -0
  123. package/dist/tools/vm.d.ts.map +1 -0
  124. package/dist/tools/vm.js +280 -0
  125. package/dist/tools/vm.js.map +1 -0
  126. package/dist/tools/workflow-ops.d.ts +3 -0
  127. package/dist/tools/workflow-ops.d.ts.map +1 -0
  128. package/dist/tools/workflow-ops.js +313 -0
  129. package/dist/tools/workflow-ops.js.map +1 -0
  130. package/dist/types.d.ts +14 -0
  131. package/dist/types.d.ts.map +1 -0
  132. package/dist/types.js +5 -0
  133. package/dist/types.js.map +1 -0
  134. package/package.json +58 -0
@@ -0,0 +1,280 @@
1
+ import { z } from "zod";
2
+ import { ok, text, json, NOT_CONNECTED_VM } from "../helpers.js";
3
+ import { ldsConnection, setLdsConnection, ldsAuth } from "../state.js";
4
+ import * as lds from "../lds-client.js";
5
+ import { generateInspectScript } from "../inspect-scripts.js";
6
+ function requireVM() {
7
+ if (!ldsConnection)
8
+ return text(NOT_CONNECTED_VM);
9
+ return null;
10
+ }
11
+ export function register(deps) {
12
+ const { server } = deps;
13
+ // ── Connection management ─────────────────────────────────
14
+ server.tool("vm_connect", "Connect to a Windows VM via Laminar Desktop Service (Cloudflare Tunnel URL). Must be called before any other vm_* tool.", {
15
+ url: z.string().describe("LDS base URL (Cloudflare Tunnel)"),
16
+ apiKey: z.string().optional().describe("LDS API key"),
17
+ serviceId: z.string().optional().describe("LDS service ID"),
18
+ }, async ({ url, apiKey, serviceId }) => {
19
+ try {
20
+ const health = await lds.health(url);
21
+ setLdsConnection({ url, apiKey, serviceId });
22
+ return ok({
23
+ connected: true,
24
+ url,
25
+ authenticated: !!(apiKey && serviceId),
26
+ service: health,
27
+ });
28
+ }
29
+ catch (e) {
30
+ return text(`Failed to connect to VM at ${url}: ${e.message}`);
31
+ }
32
+ });
33
+ server.tool("vm_disconnect", "Disconnect from the current VM", {}, async () => {
34
+ setLdsConnection(null);
35
+ return text("Disconnected from VM.");
36
+ });
37
+ server.tool("vm_status", "Check health/status of the connected VM", {}, async () => {
38
+ const err = requireVM();
39
+ if (err)
40
+ return err;
41
+ try {
42
+ const health = await lds.health(ldsConnection.url);
43
+ return ok({ connected: true, url: ldsConnection.url, ...health });
44
+ }
45
+ catch (e) {
46
+ return text(`VM unreachable: ${e.message}`);
47
+ }
48
+ });
49
+ // ── Screenshot ────────────────────────────────────────────
50
+ server.tool("vm_screenshot", "Take a full-screen screenshot of the connected VM", {}, async () => {
51
+ const err = requireVM();
52
+ if (err)
53
+ return err;
54
+ try {
55
+ const res = await lds.screenshot(ldsConnection.url, ldsAuth());
56
+ const { width, height, size_bytes, capture_duration_ms, timestamp } = res.metadata;
57
+ return {
58
+ content: [
59
+ {
60
+ type: "image",
61
+ data: res.image,
62
+ mimeType: "image/png",
63
+ },
64
+ {
65
+ type: "text",
66
+ text: json({
67
+ width,
68
+ height,
69
+ size_bytes,
70
+ capture_duration_ms,
71
+ timestamp,
72
+ }),
73
+ },
74
+ ],
75
+ };
76
+ }
77
+ catch (e) {
78
+ return text(`Screenshot failed: ${e.message}`);
79
+ }
80
+ });
81
+ server.tool("vm_screenshot_region", "Capture a specific rectangular region of the VM screen", {
82
+ x: z.number().describe("Left X coordinate"),
83
+ y: z.number().describe("Top Y coordinate"),
84
+ width: z.number().describe("Region width in pixels"),
85
+ height: z.number().describe("Region height in pixels"),
86
+ }, async ({ x, y, width, height }) => {
87
+ const err = requireVM();
88
+ if (err)
89
+ return err;
90
+ const x2 = x + width;
91
+ const y2 = y + height;
92
+ const script = `
93
+ import json, base64, io
94
+ from PIL import ImageGrab
95
+
96
+ img = ImageGrab.grab(bbox=(${x}, ${y}, ${x2}, ${y2}))
97
+ buf = io.BytesIO()
98
+ img.save(buf, format="PNG")
99
+ b64 = base64.b64encode(buf.getvalue()).decode("utf-8")
100
+ print(json.dumps({"image": b64, "width": img.width, "height": img.height}))
101
+ `.trim();
102
+ try {
103
+ const res = await lds.execute(ldsConnection.url, script, undefined, ldsAuth());
104
+ if (!res.success) {
105
+ return text(`Region screenshot failed: ${res.stderr || "unknown error"}`);
106
+ }
107
+ const parsed = JSON.parse(res.stdout);
108
+ return {
109
+ content: [
110
+ {
111
+ type: "image",
112
+ data: parsed.image,
113
+ mimeType: "image/png",
114
+ },
115
+ {
116
+ type: "text",
117
+ text: json({
118
+ width: parsed.width,
119
+ height: parsed.height,
120
+ region: { x, y, width, height },
121
+ }),
122
+ },
123
+ ],
124
+ };
125
+ }
126
+ catch (e) {
127
+ return text(`Region screenshot failed: ${e.message}`);
128
+ }
129
+ });
130
+ // ── Script execution ──────────────────────────────────────
131
+ server.tool("vm_execute_script", "Execute a Python script on the connected VM. Returns stdout, stderr, exit code, and timing.", {
132
+ script: z.string().describe("Python script to execute"),
133
+ executionId: z.string().optional().describe("Execution ID for tracking"),
134
+ flowId: z.string().optional().describe("Flow ID for tracking"),
135
+ }, async ({ script, executionId, flowId }) => {
136
+ const err = requireVM();
137
+ if (err)
138
+ return err;
139
+ try {
140
+ const res = await lds.execute(ldsConnection.url, script, { executionId, flowId }, ldsAuth());
141
+ return ok({
142
+ success: res.success,
143
+ exitCode: res.exitCode,
144
+ stdout: res.stdout,
145
+ stderr: res.stderr,
146
+ executionTimeMs: res.executionTimeMs,
147
+ skipped: res.skipped,
148
+ stopped: res.stopped,
149
+ resultData: res.resultData,
150
+ });
151
+ }
152
+ catch (e) {
153
+ return text(`Execution failed: ${e.message}`);
154
+ }
155
+ });
156
+ // ── Execution status / control ────────────────────────────
157
+ server.tool("vm_execution_status", "Get current execution status on the VM (active script, progress, queue)", {}, async () => {
158
+ const err = requireVM();
159
+ if (err)
160
+ return err;
161
+ try {
162
+ const status = await lds.executionStatus(ldsConnection.url, ldsAuth());
163
+ return ok(status);
164
+ }
165
+ catch (e) {
166
+ return text(`Failed to get execution status: ${e.message}`);
167
+ }
168
+ });
169
+ server.tool("vm_execution_control", "Control script execution on the VM (pause, resume, stop, skip)", {
170
+ command: z
171
+ .enum(["pause", "resume", "stop", "skip"])
172
+ .describe("Control command"),
173
+ }, async ({ command }) => {
174
+ const err = requireVM();
175
+ if (err)
176
+ return err;
177
+ try {
178
+ const result = await lds.executionControl(ldsConnection.url, command, ldsAuth());
179
+ return ok(result);
180
+ }
181
+ catch (e) {
182
+ return text(`Execution control failed: ${e.message}`);
183
+ }
184
+ });
185
+ // ── UI inspection ─────────────────────────────────────────
186
+ server.tool("vm_inspect_ui", "Inspect the Windows UI on the VM: list windows, get element trees, find elements at coordinates, get focused element, or query screen info.", {
187
+ mode: z
188
+ .enum([
189
+ "window_list",
190
+ "screen_info",
191
+ "element_at_point",
192
+ "element_tree",
193
+ "focused_element",
194
+ ])
195
+ .describe("Inspection mode"),
196
+ x: z.number().optional().describe("X coordinate (for element_at_point)"),
197
+ y: z.number().optional().describe("Y coordinate (for element_at_point)"),
198
+ windowTitle: z
199
+ .string()
200
+ .optional()
201
+ .describe("Window title filter (for element_tree)"),
202
+ framework: z
203
+ .enum(["auto", "uiautomation", "pywinauto", "jab"])
204
+ .optional()
205
+ .describe("Automation framework (default: auto → uiautomation)"),
206
+ depth: z
207
+ .number()
208
+ .optional()
209
+ .describe("Max tree depth (for element_tree, default 3)"),
210
+ }, async ({ mode, x, y, windowTitle, framework, depth }) => {
211
+ const err = requireVM();
212
+ if (err)
213
+ return err;
214
+ const script = generateInspectScript({
215
+ mode,
216
+ x,
217
+ y,
218
+ windowTitle,
219
+ framework,
220
+ depth,
221
+ });
222
+ try {
223
+ const res = await lds.execute(ldsConnection.url, script, undefined, ldsAuth());
224
+ if (!res.success) {
225
+ return text(`UI inspection failed (exit ${res.exitCode}): ${res.stderr || res.stdout}`);
226
+ }
227
+ try {
228
+ return ok(JSON.parse(res.stdout));
229
+ }
230
+ catch {
231
+ return text(res.stdout);
232
+ }
233
+ }
234
+ catch (e) {
235
+ return text(`UI inspection failed: ${e.message}`);
236
+ }
237
+ });
238
+ // ── Clipboard ─────────────────────────────────────────────
239
+ server.tool("vm_read_clipboard", "Read the current clipboard contents from the VM", {}, async () => {
240
+ const err = requireVM();
241
+ if (err)
242
+ return err;
243
+ const script = `
244
+ import json
245
+
246
+ clipboard_text = ""
247
+ try:
248
+ import win32clipboard
249
+ win32clipboard.OpenClipboard()
250
+ try:
251
+ clipboard_text = win32clipboard.GetClipboardData()
252
+ except TypeError:
253
+ clipboard_text = ""
254
+ finally:
255
+ win32clipboard.CloseClipboard()
256
+ except ImportError:
257
+ import subprocess
258
+ result = subprocess.run(["powershell", "-command", "Get-Clipboard"], capture_output=True, text=True)
259
+ clipboard_text = result.stdout.strip()
260
+
261
+ print(json.dumps({"clipboard": clipboard_text}))
262
+ `.trim();
263
+ try {
264
+ const res = await lds.execute(ldsConnection.url, script, undefined, ldsAuth());
265
+ if (!res.success) {
266
+ return text(`Clipboard read failed: ${res.stderr || "unknown error"}`);
267
+ }
268
+ try {
269
+ return ok(JSON.parse(res.stdout));
270
+ }
271
+ catch {
272
+ return text(res.stdout);
273
+ }
274
+ }
275
+ catch (e) {
276
+ return text(`Clipboard read failed: ${e.message}`);
277
+ }
278
+ });
279
+ }
280
+ //# sourceMappingURL=vm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vm.js","sourceRoot":"","sources":["../../src/tools/vm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,SAAS,SAAS;IAChB,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,6DAA6D;IAE7D,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,yHAAyH,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AAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;YACpC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC,0BAA0B,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToolDeps } from "../types.js";
2
+ export declare function register(deps: ToolDeps): void;
3
+ //# sourceMappingURL=workflow-ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-ops.d.ts","sourceRoot":"","sources":["../../src/tools/workflow-ops.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,QAmYtC"}
@@ -0,0 +1,313 @@
1
+ import { z } from "zod";
2
+ import { ok, text } from "../helpers.js";
3
+ import { computeDiff } from "../diff.js";
4
+ export function register(deps) {
5
+ const { server } = deps;
6
+ server.tool("preview_flow_changes", "Show a diff of the current flow code vs your proposed changes BEFORE updating. Use this to review changes before pushing them to Laminar.", {
7
+ flowId: z.number().describe("Flow ID to compare against"),
8
+ proposedProgram: z
9
+ .string()
10
+ .describe("The new program code you want to set"),
11
+ proposedName: z.string().optional().describe("New name (if changing)"),
12
+ proposedDescription: z
13
+ .string()
14
+ .optional()
15
+ .describe("New description (if changing)"),
16
+ }, async ({ flowId, proposedProgram, proposedName, proposedDescription }) => {
17
+ try {
18
+ const flow = await deps.client().getFlow(flowId);
19
+ const currentCode = await deps.client().readFlow(flowId);
20
+ const current = typeof currentCode === "string"
21
+ ? currentCode
22
+ : JSON.stringify(currentCode, null, 2);
23
+ const lines = [
24
+ `## Flow: ${flow.name} (ID: ${flowId})`,
25
+ `**Type:** ${flow.flowType} | **Language:** ${flow.language} | **Order:** ${flow.executionOrder}`,
26
+ "",
27
+ ];
28
+ if (proposedName && proposedName !== flow.name) {
29
+ lines.push(`### Name: ${flow.name} → ${proposedName}`);
30
+ lines.push("");
31
+ }
32
+ if (proposedDescription && proposedDescription !== flow.description) {
33
+ lines.push(`### Description: ${flow.description} → ${proposedDescription}`);
34
+ lines.push("");
35
+ }
36
+ lines.push("### Code Diff");
37
+ lines.push("```diff");
38
+ lines.push(computeDiff(current, proposedProgram));
39
+ lines.push("```");
40
+ return text(lines.join("\n"));
41
+ }
42
+ catch (e) {
43
+ return text(`Error: ${e.message}`);
44
+ }
45
+ });
46
+ server.tool("get_workflow_overview", "Get a complete overview of a workflow: all steps with their code, recent executions, and config. Useful as context before making changes.", {
47
+ workflowId: z.number().describe("Workflow ID"),
48
+ includeExecutions: z
49
+ .number()
50
+ .optional()
51
+ .describe("Number of recent executions to include (default 3)"),
52
+ }, async ({ workflowId, includeExecutions = 3 }) => {
53
+ try {
54
+ const [workflow, flows, executions] = await Promise.all([
55
+ deps.client().getWorkflow(workflowId),
56
+ deps.client().getWorkflowFlows(workflowId),
57
+ deps.client().listExecutions(workflowId, { size: includeExecutions }),
58
+ ]);
59
+ const flowList = Array.isArray(flows) ? flows : [];
60
+ const flowsWithCode = await Promise.all(flowList.map(async (f) => {
61
+ try {
62
+ const code = await deps.client().readFlow(f.id);
63
+ return {
64
+ ...f,
65
+ code: typeof code === "string" ? code : JSON.stringify(code),
66
+ };
67
+ }
68
+ catch {
69
+ return { ...f, code: "(could not read)" };
70
+ }
71
+ }));
72
+ return ok({
73
+ workflow,
74
+ steps: flowsWithCode.map((f) => ({
75
+ id: f.id,
76
+ name: f.name,
77
+ description: f.description,
78
+ executionOrder: f.executionOrder,
79
+ flowType: f.flowType,
80
+ language: f.language,
81
+ code: f.code,
82
+ })),
83
+ recentExecutions: executions,
84
+ });
85
+ }
86
+ catch (e) {
87
+ return text(`Error: ${e.message}`);
88
+ }
89
+ });
90
+ server.tool("get_execution_input", "Get the input data from a specific execution, so you can reuse it to test the workflow again. Returns data.input from the first step.", {
91
+ workflowId: z.number().describe("Workflow ID"),
92
+ executionId: z.number().describe("Execution ID to get input from"),
93
+ }, async ({ workflowId, executionId }) => {
94
+ try {
95
+ const exec = await deps.client().getExecution(workflowId, executionId);
96
+ const flowRuns = exec?.flowRuns || [];
97
+ if (flowRuns.length === 0)
98
+ return text("No flow runs found in this execution.");
99
+ const firstRun = flowRuns[0];
100
+ let input = null;
101
+ if (firstRun.transformation) {
102
+ try {
103
+ const t = typeof firstRun.transformation === "string"
104
+ ? JSON.parse(firstRun.transformation)
105
+ : firstRun.transformation;
106
+ input = t?.input || t;
107
+ }
108
+ catch {
109
+ input = firstRun.transformation;
110
+ }
111
+ }
112
+ if (!input && firstRun.payload) {
113
+ try {
114
+ input =
115
+ typeof firstRun.payload === "string"
116
+ ? JSON.parse(firstRun.payload)
117
+ : firstRun.payload;
118
+ }
119
+ catch {
120
+ input = firstRun.payload;
121
+ }
122
+ }
123
+ return ok({
124
+ executionId,
125
+ status: exec.status,
126
+ startedAt: exec.startedAt,
127
+ input,
128
+ hint: "Use this input with execute_workflow to re-test the workflow",
129
+ });
130
+ }
131
+ catch (e) {
132
+ return text(`Error: ${e.message}`);
133
+ }
134
+ });
135
+ server.tool("test_workflow_step", "Execute a workflow up to (or from) a specific step for testing. Useful for isolating and debugging individual steps.", {
136
+ workflowId: z.number().describe("Workflow ID"),
137
+ step: z.number().describe("Step number to test"),
138
+ mode: z
139
+ .enum(["up_to", "single", "from"])
140
+ .describe("up_to: run steps 1..N, single: run only step N, from: run steps N..end"),
141
+ body: z
142
+ .any()
143
+ .optional()
144
+ .describe("Input data (JSON). Use get_execution_input to grab from a previous run."),
145
+ configurationId: z
146
+ .union([z.number(), z.string()])
147
+ .optional()
148
+ .describe("Configuration store ID (number or string)"),
149
+ }, async ({ workflowId, step, mode, body, configurationId }) => {
150
+ try {
151
+ const params = { configuration_id: configurationId };
152
+ if (mode === "up_to") {
153
+ params.end_at_step = step;
154
+ }
155
+ else if (mode === "single") {
156
+ params.start_from_step = step;
157
+ params.end_at_step = step;
158
+ }
159
+ else if (mode === "from") {
160
+ params.start_from_step = step;
161
+ }
162
+ const result = await deps
163
+ .client()
164
+ .executeWorkflow(workflowId, body, params);
165
+ return ok(result);
166
+ }
167
+ catch (e) {
168
+ return text(`Error: ${e.message}`);
169
+ }
170
+ });
171
+ server.tool("compare_flow_versions", "Compare two versions of a flow side by side with a unified diff. Useful for reviewing what changed between versions.", {
172
+ flowId: z.number().describe("Flow ID"),
173
+ versionA: z
174
+ .number()
175
+ .optional()
176
+ .describe("First version ID (omit for current)"),
177
+ versionB: z.number().describe("Second version ID to compare against"),
178
+ }, async ({ flowId, versionA, versionB }) => {
179
+ try {
180
+ const [codeA, codeB] = await Promise.all([
181
+ versionA
182
+ ? deps.client().readFlowVersion(flowId, versionA)
183
+ : deps.client().readFlow(flowId),
184
+ deps.client().readFlowVersion(flowId, versionB),
185
+ ]);
186
+ const strA = typeof codeA === "string" ? codeA : JSON.stringify(codeA, null, 2);
187
+ const strB = typeof codeB === "string" ? codeB : JSON.stringify(codeB, null, 2);
188
+ const labelA = versionA ? `Version ${versionA}` : "Current";
189
+ const labelB = `Version ${versionB}`;
190
+ return text(`## Flow ${flowId}: ${labelA} vs ${labelB}\n\n\`\`\`diff\n${computeDiff(strA, strB, labelA, labelB)}\n\`\`\``);
191
+ }
192
+ catch (e) {
193
+ return text(`Error: ${e.message}`);
194
+ }
195
+ });
196
+ server.tool("diagnose_execution", "Analyze a workflow execution to find failures. Returns failed steps with errors, preceding step output, code, and for RPA flows: specific failure pattern analysis and fix suggestions.", {
197
+ workflowId: z.number().describe("Workflow ID"),
198
+ executionId: z.number().describe("Execution ID to diagnose"),
199
+ }, async ({ workflowId, executionId }) => {
200
+ try {
201
+ const exec = await deps
202
+ .client()
203
+ .getExecution(workflowId, executionId);
204
+ const flowRuns = exec?.flowRuns || [];
205
+ const failures = flowRuns.filter((r) => r.status === "FAILED");
206
+ if (failures.length === 0) {
207
+ const summary = flowRuns.map((r) => ({
208
+ step: r.executionOrder,
209
+ name: r.flowName,
210
+ status: r.status,
211
+ duration: r.durationMs,
212
+ }));
213
+ return ok({
214
+ executionId,
215
+ overallStatus: exec.status,
216
+ message: "No failed steps found.",
217
+ stepSummary: summary,
218
+ });
219
+ }
220
+ const details = failures.map((r) => {
221
+ const prevStep = flowRuns.find((p) => p.executionOrder === r.executionOrder - 1 &&
222
+ p.status === "SUCCESS");
223
+ const errorStr = JSON.stringify(r.executionLog || r.response || "");
224
+ const programStr = JSON.stringify(r.program || "");
225
+ const isRpa = programStr.includes("lam.rpa") ||
226
+ programStr.includes("lam.httpRequest") ||
227
+ programStr.includes("pyautogui") ||
228
+ programStr.includes("uiautomation");
229
+ let rpaAnalysis = null;
230
+ if (isRpa) {
231
+ if (errorStr.includes("ElementNotFound") ||
232
+ errorStr.includes("not found") ||
233
+ errorStr.includes("Exists") ||
234
+ errorStr.includes("WindowControl")) {
235
+ rpaAnalysis = {
236
+ pattern: "element_not_found",
237
+ suggestion: "The target UI element was not found. Possible causes: (1) the app hasn't fully loaded — add time.sleep() before the interaction, (2) the window title changed — use vm_inspect_ui window_list to check current titles, (3) the element's AutomationId or coordinates shifted — re-inspect with element_tree.",
238
+ };
239
+ }
240
+ else if (errorStr.includes("timeout") ||
241
+ errorStr.includes("Timeout") ||
242
+ errorStr.includes("timed out")) {
243
+ rpaAnalysis = {
244
+ pattern: "timeout",
245
+ suggestion: "The script timed out waiting for an element or action. Increase sleep/wait times, or add a retry loop that checks for the element before acting.",
246
+ };
247
+ }
248
+ else if (errorStr.includes("click") ||
249
+ errorStr.includes("position") ||
250
+ errorStr.includes("coordinate")) {
251
+ rpaAnalysis = {
252
+ pattern: "click_target_missed",
253
+ suggestion: 'A click may have hit the wrong location. Screen resolution or window position may have changed. Use vm_inspect_ui element_at_point to verify coordinates, or switch to element-based interaction (AutomationId) instead of pixel coordinates.',
254
+ };
255
+ }
256
+ else if (errorStr.includes("connection") ||
257
+ errorStr.includes("Connection") ||
258
+ errorStr.includes("ECONNREFUSED")) {
259
+ rpaAnalysis = {
260
+ pattern: "lds_connection_failed",
261
+ suggestion: "Could not reach the Laminar Desktop Service. Check that the Cloudflare Tunnel is still active and the LDS process is running on the VM. Try vm_status to verify connectivity.",
262
+ };
263
+ }
264
+ else if (errorStr.includes("resolution") ||
265
+ errorStr.includes("DPI") ||
266
+ errorStr.includes("scale")) {
267
+ rpaAnalysis = {
268
+ pattern: "resolution_mismatch",
269
+ suggestion: "Script may have been built at a different screen resolution than it's running at. Use vm_inspect_ui screen_info to check current resolution, and re-record coordinates if needed.",
270
+ };
271
+ }
272
+ else {
273
+ rpaAnalysis = {
274
+ pattern: "unknown_rpa_error",
275
+ suggestion: "Review the stderr/stdout for the root cause. Common RPA issues: wrong window focused (use vm_reset_state first), element not interactable (check IsEnabled), unexpected dialog/popup blocking the target.",
276
+ };
277
+ }
278
+ }
279
+ return {
280
+ stepName: r.flowName,
281
+ executionOrder: r.executionOrder,
282
+ status: r.status,
283
+ duration: r.durationMs,
284
+ error: r.executionLog || r.response,
285
+ transformation: r.transformation,
286
+ program: r.program,
287
+ precedingStepOutput: prevStep
288
+ ? {
289
+ name: prevStep.flowName,
290
+ response: prevStep.response,
291
+ }
292
+ : null,
293
+ ...(rpaAnalysis && { rpaFailureAnalysis: rpaAnalysis }),
294
+ };
295
+ });
296
+ const baseUrl = deps.getApiBase();
297
+ return ok({
298
+ executionId,
299
+ overallStatus: exec.status,
300
+ startedAt: exec.startedAt,
301
+ endedAt: exec.endedAt,
302
+ failedStepCount: failures.length,
303
+ totalSteps: flowRuns.length,
304
+ failures: details,
305
+ viewInPlatform: `${baseUrl.replace("/api.", "/app.")}/workflow/${workflowId}/execution/${executionId}`,
306
+ });
307
+ }
308
+ catch (e) {
309
+ return text(`Error: ${e.message}`);
310
+ }
311
+ });
312
+ }
313
+ //# sour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,CAAC,OAAO;oBAClB,mBAAmB,EAAE,QAAQ;wBAC3B,CAAC,CAAC;4BACE,IAAI,EAAE,QAAQ,CAAC,QAAQ;4BACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;yBAC5B;wBACH,CAAC,CAAC,IAAI;oBACR,GAAG,CAAC,WAAW,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC;iBACxD,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAElC,OAAO,EAAE,CAAC;gBACR,WAAW;gBACX,aAAa,EAAE,IAAI,CAAC,MAAM;gBAC1B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,eAAe,EAAE,QAAQ,CAAC,MAAM;gBAChC,UAAU,EAAE,QAAQ,CAAC,MAAM;gBAC3B,QAAQ,EAAE,OAAO;gBACjB,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,UAAU,cAAc,WAAW,EAAE;aACvG,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared types for tool module registration.
3
+ */
4
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
+ import type { LaminarClient } from "./laminar-client.js";
6
+ import type { ElasticsearchService, CronService } from "./services.js";
7
+ export interface ToolDeps {
8
+ server: McpServer;
9
+ client: () => LaminarClient;
10
+ getApiBase: () => string;
11
+ esService: () => ElasticsearchService | null;
12
+ cronService: () => CronService | null;
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,MAAM,aAAa,CAAC;IAC5B,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,oBAAoB,GAAG,IAAI,CAAC;IAC7C,WAAW,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CACvC"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared types for tool module registration.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map