@veolab/discoverylab 1.1.1 → 1.2.1

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 (62) hide show
  1. package/dist/chunk-24VARQVO.js +7818 -0
  2. package/dist/chunk-2OGZX6C4.js +588 -0
  3. package/dist/chunk-43U6UYV7.js +590 -0
  4. package/dist/chunk-4H2E3K2G.js +7638 -0
  5. package/dist/chunk-4KLG6DDE.js +334 -0
  6. package/dist/chunk-4NNTRJOI.js +7791 -0
  7. package/dist/chunk-5F76VWME.js +6397 -0
  8. package/dist/chunk-5NEFN42O.js +7791 -0
  9. package/dist/chunk-63MEQ6UH.js +7673 -0
  10. package/dist/chunk-C7QUR7XX.js +6397 -0
  11. package/dist/chunk-GGJJUCFK.js +7160 -0
  12. package/dist/chunk-GLHOY3NN.js +7805 -0
  13. package/dist/chunk-GSWHWEYC.js +1346 -0
  14. package/dist/chunk-HDKEQOF5.js +7788 -0
  15. package/dist/chunk-HZGSWVVS.js +7111 -0
  16. package/dist/chunk-I6YD3QFM.js +500 -0
  17. package/dist/chunk-KV7KDJ43.js +7639 -0
  18. package/dist/chunk-L4SA5F5W.js +6397 -0
  19. package/dist/chunk-MJS2YKNR.js +6397 -0
  20. package/dist/chunk-NDBW6ELQ.js +7638 -0
  21. package/dist/chunk-P4S7ZY6G.js +7638 -0
  22. package/dist/chunk-PMTGGZ7R.js +6397 -0
  23. package/dist/chunk-PYUCY3U6.js +1340 -0
  24. package/dist/chunk-RDZDSOAL.js +7750 -0
  25. package/dist/chunk-SLNJEF32.js +91 -0
  26. package/dist/chunk-SR67SRIT.js +1336 -0
  27. package/dist/chunk-TAODYZ52.js +1393 -0
  28. package/dist/chunk-TBG76CYG.js +6395 -0
  29. package/dist/chunk-TJ3H23LL.js +362 -0
  30. package/dist/chunk-XIBF5LBD.js +6395 -0
  31. package/dist/chunk-XUKWS2CE.js +7805 -0
  32. package/dist/cli.js +6 -6
  33. package/dist/db-ADBEBNH6.js +35 -0
  34. package/dist/index.d.ts +170 -1
  35. package/dist/index.html +1019 -84
  36. package/dist/index.js +9 -7
  37. package/dist/playwright-ATDC4NYW.js +38 -0
  38. package/dist/playwright-E6EUFIJG.js +38 -0
  39. package/dist/playwright-R7Y5HREH.js +39 -0
  40. package/dist/server-2VKO76UK.js +14 -0
  41. package/dist/server-3BK2VFU7.js +13 -0
  42. package/dist/server-6IPHVUYT.js +14 -0
  43. package/dist/server-73P7M3QB.js +14 -0
  44. package/dist/server-BPVRW5LJ.js +14 -0
  45. package/dist/server-IOOZK4NP.js +14 -0
  46. package/dist/server-JG7UKFGK.js +14 -0
  47. package/dist/server-NPZN3FWO.js +14 -0
  48. package/dist/server-O5FIAHSY.js +14 -0
  49. package/dist/server-P27BZXBL.js +14 -0
  50. package/dist/server-S6B5WUBT.js +14 -0
  51. package/dist/server-SRYNSGSP.js +14 -0
  52. package/dist/server-X3TLP6DX.js +14 -0
  53. package/dist/server-ZBPQ33V6.js +14 -0
  54. package/dist/setup-AQX4JQVR.js +17 -0
  55. package/dist/tools-2KPB37GK.js +178 -0
  56. package/dist/tools-3H6IOWXV.js +178 -0
  57. package/dist/tools-BUVCUCRL.js +178 -0
  58. package/dist/tools-HDNODRS6.js +178 -0
  59. package/dist/tools-L6PKKQPY.js +179 -0
  60. package/dist/tools-N5N2IO7V.js +178 -0
  61. package/dist/tools-TLCKABUW.js +178 -0
  62. package/package.json +1 -1
@@ -0,0 +1,334 @@
1
+ import {
2
+ DATA_DIR,
3
+ DB_PATH
4
+ } from "./chunk-TJ3H23LL.js";
5
+ import {
6
+ createJsonResult,
7
+ createTextResult
8
+ } from "./chunk-QJXXHOV7.js";
9
+
10
+ // src/mcp/tools/setup.ts
11
+ import { z } from "zod";
12
+ import { execSync } from "child_process";
13
+ import { existsSync, readFileSync } from "fs";
14
+ import { createRequire } from "module";
15
+ import { platform, homedir } from "os";
16
+ var requireFromHere = createRequire(import.meta.url);
17
+ var dependencies = [
18
+ {
19
+ name: "FFmpeg",
20
+ command: "ffmpeg -version",
21
+ versionPattern: /ffmpeg version (\d+\.\d+(?:\.\d+)?)/,
22
+ required: true,
23
+ description: "Video processing and export",
24
+ installHint: "brew install ffmpeg (macOS) or apt install ffmpeg (Linux)"
25
+ },
26
+ {
27
+ name: "Maestro CLI",
28
+ command: "",
29
+ // Special handling - check multiple paths
30
+ versionPattern: /(\d+\.\d+\.\d+)/,
31
+ required: false,
32
+ description: "Mobile app testing automation",
33
+ installHint: 'curl -Ls "https://get.maestro.mobile.dev" | bash'
34
+ },
35
+ {
36
+ name: "Playwright",
37
+ command: "",
38
+ // Special handling - avoid npx auto-install false positives
39
+ versionPattern: /(\d+\.\d+\.\d+)/,
40
+ required: false,
41
+ description: "Web app testing and browser automation",
42
+ installHint: "npm install -g playwright"
43
+ },
44
+ {
45
+ name: "Xcode CLI Tools",
46
+ command: "xcode-select -p",
47
+ versionPattern: /.*/,
48
+ required: false,
49
+ description: "iOS Simulator access (macOS only)",
50
+ installHint: "xcode-select --install"
51
+ },
52
+ {
53
+ name: "ADB",
54
+ command: "adb version",
55
+ versionPattern: /Android Debug Bridge version (\d+\.\d+\.\d+)/,
56
+ required: false,
57
+ description: "Android Emulator access",
58
+ installHint: "Install Android Studio or: brew install android-platform-tools"
59
+ }
60
+ ];
61
+ function checkDependency(dep) {
62
+ if (dep.name === "Maestro CLI") {
63
+ return checkMaestro(dep);
64
+ }
65
+ if (dep.name === "Playwright") {
66
+ return checkPlaywright(dep);
67
+ }
68
+ try {
69
+ const output = execSync(dep.command, { encoding: "utf-8", timeout: 5e3 }).trim();
70
+ const match = output.match(dep.versionPattern);
71
+ return {
72
+ installed: true,
73
+ version: match ? match[1] || "installed" : "installed"
74
+ };
75
+ } catch (error) {
76
+ return {
77
+ installed: false,
78
+ version: null,
79
+ error: error instanceof Error ? error.message : "Command failed"
80
+ };
81
+ }
82
+ }
83
+ function checkPlaywright(dep) {
84
+ try {
85
+ const pkgPath = requireFromHere.resolve("playwright/package.json");
86
+ const raw = readFileSync(pkgPath, "utf-8");
87
+ const pkg = JSON.parse(raw);
88
+ return {
89
+ installed: true,
90
+ version: typeof pkg.version === "string" && pkg.version.trim() ? pkg.version.trim() : "installed"
91
+ };
92
+ } catch (error) {
93
+ return {
94
+ installed: false,
95
+ version: null,
96
+ error: error instanceof Error ? error.message : "Playwright package not found"
97
+ };
98
+ }
99
+ }
100
+ function checkMaestro(dep) {
101
+ const homeDir = homedir();
102
+ const maestroPaths = [
103
+ `${homeDir}/.maestro/bin/maestro`,
104
+ "/usr/local/bin/maestro",
105
+ "/opt/homebrew/bin/maestro"
106
+ ];
107
+ try {
108
+ const output = execSync("maestro --version 2>/dev/null || maestro version 2>/dev/null", {
109
+ encoding: "utf-8",
110
+ timeout: 5e3,
111
+ shell: "/bin/bash"
112
+ }).trim();
113
+ const match = output.match(dep.versionPattern);
114
+ return {
115
+ installed: true,
116
+ version: match ? match[1] : "installed"
117
+ };
118
+ } catch {
119
+ }
120
+ for (const maestroPath of maestroPaths) {
121
+ if (existsSync(maestroPath)) {
122
+ try {
123
+ const output = execSync(`"${maestroPath}" --version 2>/dev/null || "${maestroPath}" version 2>/dev/null`, {
124
+ encoding: "utf-8",
125
+ timeout: 5e3,
126
+ shell: "/bin/bash"
127
+ }).trim();
128
+ const match = output.match(dep.versionPattern);
129
+ return {
130
+ installed: true,
131
+ version: match ? match[1] : "installed"
132
+ };
133
+ } catch {
134
+ return {
135
+ installed: true,
136
+ version: "installed"
137
+ };
138
+ }
139
+ }
140
+ }
141
+ return {
142
+ installed: false,
143
+ version: null,
144
+ error: "Maestro not found in PATH or common installation directories"
145
+ };
146
+ }
147
+ var setupStatusTool = {
148
+ name: "dlab.setup.status",
149
+ description: "Check the status of DiscoveryLab setup and all dependencies.",
150
+ inputSchema: z.object({}),
151
+ handler: async () => {
152
+ const results = [];
153
+ let allRequiredInstalled = true;
154
+ for (const dep of dependencies) {
155
+ if (dep.name === "Xcode CLI Tools" && platform() !== "darwin") {
156
+ continue;
157
+ }
158
+ const status = checkDependency(dep);
159
+ results.push({
160
+ name: dep.name,
161
+ installed: status.installed,
162
+ version: status.version,
163
+ required: dep.required,
164
+ description: dep.description,
165
+ installHint: status.installed ? null : dep.installHint
166
+ });
167
+ if (dep.required && !status.installed) {
168
+ allRequiredInstalled = false;
169
+ }
170
+ }
171
+ const dataReady = existsSync(DATA_DIR);
172
+ const dbReady = existsSync(DB_PATH);
173
+ return createJsonResult({
174
+ ready: allRequiredInstalled && dataReady,
175
+ platform: platform(),
176
+ dataDirectory: {
177
+ path: DATA_DIR,
178
+ exists: dataReady
179
+ },
180
+ database: {
181
+ path: DB_PATH,
182
+ exists: dbReady
183
+ },
184
+ dependencies: results,
185
+ summary: {
186
+ total: results.length,
187
+ installed: results.filter((r) => r.installed).length,
188
+ missing: results.filter((r) => !r.installed).length,
189
+ requiredMissing: results.filter((r) => r.required && !r.installed).map((r) => r.name)
190
+ }
191
+ });
192
+ }
193
+ };
194
+ var setupCheckTool = {
195
+ name: "dlab.setup.check",
196
+ description: "Quick check if a specific tool is installed.",
197
+ inputSchema: z.object({
198
+ tool: z.enum(["ffmpeg", "maestro", "playwright", "xcode", "adb"]).describe("Tool to check")
199
+ }),
200
+ handler: async (params) => {
201
+ const toolMap = {
202
+ ffmpeg: dependencies[0],
203
+ maestro: dependencies[1],
204
+ playwright: dependencies[2],
205
+ xcode: dependencies[3],
206
+ adb: dependencies[4]
207
+ };
208
+ const dep = toolMap[params.tool];
209
+ if (!dep) {
210
+ return createTextResult(`Unknown tool: ${params.tool}`);
211
+ }
212
+ const status = checkDependency(dep);
213
+ if (status.installed) {
214
+ return createTextResult(`${dep.name} is installed (version: ${status.version})`);
215
+ } else {
216
+ return createTextResult(`${dep.name} is NOT installed.
217
+ Install with: ${dep.installHint}`);
218
+ }
219
+ }
220
+ };
221
+ var setupInitTool = {
222
+ name: "dlab.setup.init",
223
+ description: "Initialize DiscoveryLab data directories and database.",
224
+ inputSchema: z.object({}),
225
+ handler: async () => {
226
+ try {
227
+ const { getDatabase, DATA_DIR: DATA_DIR2, PROJECTS_DIR, EXPORTS_DIR, FRAMES_DIR } = await import("./db-ADBEBNH6.js");
228
+ getDatabase();
229
+ return createJsonResult({
230
+ message: "DiscoveryLab initialized successfully",
231
+ directories: {
232
+ data: DATA_DIR2,
233
+ projects: PROJECTS_DIR,
234
+ exports: EXPORTS_DIR,
235
+ frames: FRAMES_DIR
236
+ }
237
+ });
238
+ } catch (error) {
239
+ const message = error instanceof Error ? error.message : "Initialization failed";
240
+ return createTextResult(`Error: ${message}`);
241
+ }
242
+ }
243
+ };
244
+ var setupInstallTool = {
245
+ name: "dlab.setup.install",
246
+ description: "Get installation commands for missing DiscoveryLab dependencies. Claude should run these commands after user approval.",
247
+ inputSchema: z.object({
248
+ tool: z.enum(["all", "ffmpeg", "maestro", "playwright", "xcode", "adb"]).optional().describe("Specific tool to install (default: all missing)")
249
+ }),
250
+ handler: async (params) => {
251
+ const toolToInstall = params.tool || "all";
252
+ const installCommands = [];
253
+ const isMac = platform() === "darwin";
254
+ if (toolToInstall === "all" || toolToInstall === "ffmpeg") {
255
+ const status = checkDependency(dependencies[0]);
256
+ if (!status.installed) {
257
+ installCommands.push({
258
+ name: "FFmpeg",
259
+ command: isMac ? "brew install ffmpeg" : "sudo apt install -y ffmpeg",
260
+ description: "Required for video processing and export"
261
+ });
262
+ }
263
+ }
264
+ if (toolToInstall === "all" || toolToInstall === "maestro") {
265
+ const status = checkDependency(dependencies[1]);
266
+ if (!status.installed) {
267
+ installCommands.push({
268
+ name: "Maestro CLI",
269
+ command: 'curl -Ls "https://get.maestro.mobile.dev" | bash',
270
+ description: "Mobile app testing automation"
271
+ });
272
+ }
273
+ }
274
+ if (toolToInstall === "all" || toolToInstall === "playwright") {
275
+ const status = checkDependency(dependencies[2]);
276
+ if (!status.installed) {
277
+ installCommands.push({
278
+ name: "Playwright",
279
+ command: "npm install -g playwright && npx playwright install",
280
+ description: "Web app testing and browser automation"
281
+ });
282
+ }
283
+ }
284
+ if (isMac && (toolToInstall === "all" || toolToInstall === "xcode")) {
285
+ const status = checkDependency(dependencies[3]);
286
+ if (!status.installed) {
287
+ installCommands.push({
288
+ name: "Xcode CLI Tools",
289
+ command: "xcode-select --install",
290
+ description: "Required for iOS Simulator access"
291
+ });
292
+ }
293
+ }
294
+ if (toolToInstall === "all" || toolToInstall === "adb") {
295
+ const status = checkDependency(dependencies[4]);
296
+ if (!status.installed) {
297
+ installCommands.push({
298
+ name: "ADB (Android Debug Bridge)",
299
+ command: isMac ? "brew install android-platform-tools" : "sudo apt install -y adb",
300
+ description: "Required for Android Emulator access"
301
+ });
302
+ }
303
+ }
304
+ if (installCommands.length === 0) {
305
+ return createTextResult(
306
+ toolToInstall === "all" ? "\u2705 All dependencies are already installed!" : `\u2705 ${toolToInstall} is already installed!`
307
+ );
308
+ }
309
+ const instructions = installCommands.map(
310
+ (cmd, i) => `${i + 1}. **${cmd.name}** (${cmd.description})
311
+ \`\`\`bash
312
+ ${cmd.command}
313
+ \`\`\``
314
+ ).join("\n\n");
315
+ return createTextResult(
316
+ `## Missing Dependencies
317
+
318
+ Please run the following commands to install missing dependencies:
319
+
320
+ ` + instructions + `
321
+
322
+ *Run these commands one at a time and verify each installation before proceeding.*`
323
+ );
324
+ }
325
+ };
326
+ var setupTools = [setupStatusTool, setupCheckTool, setupInitTool, setupInstallTool];
327
+
328
+ export {
329
+ setupStatusTool,
330
+ setupCheckTool,
331
+ setupInitTool,
332
+ setupInstallTool,
333
+ setupTools
334
+ };