@veolab/discoverylab 0.1.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 (47) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/.claude-plugin/plugin.json +12 -0
  3. package/.mcp.json +6 -0
  4. package/README.md +214 -0
  5. package/assets/applab-discovery.jpeg +0 -0
  6. package/assets/backgrounds/abstract-colorful-gradient-orange-background.jpg +0 -0
  7. package/assets/backgrounds/blurred-colorful-luxury-gradient-rainbow-abstract.jpg +0 -0
  8. package/assets/backgrounds/glowing-neon-moving-continuously-looking-bright.jpg +0 -0
  9. package/assets/backgrounds/glowing-neon-moving-continuously-looking-bright2.jpg +0 -0
  10. package/assets/backgrounds/macos-big-sur-apple-layers-fluidic-colorful-wwdc-stock-4096x2304-1455.jpg +0 -0
  11. package/assets/backgrounds/macos-sierra-mountain-peak-sunset-evening-stock-5k-5120x3684-3987.jpg +0 -0
  12. package/assets/backgrounds/macos-tahoe-26-5120x2880-22674.jpg +0 -0
  13. package/assets/backgrounds/macos-tahoe-26-5120x2880-22675.jpg +0 -0
  14. package/assets/backgrounds/view-of-the-sea-from-the-window-of-an-airplane-2024-10-21-11-25-30-utc.jpg +0 -0
  15. package/assets/cursor/cursor-blue.png +0 -0
  16. package/assets/icons/android-head_3D.png +0 -0
  17. package/assets/icons/apple-logo.png +0 -0
  18. package/assets/icons/apple-logo.svg +4 -0
  19. package/assets/icons/claude-ai-icon.svg +1 -0
  20. package/assets/icons/icons8-apple-intelligence-48.png +0 -0
  21. package/assets/icons/icons8-apple-intelligence-96.png +0 -0
  22. package/dist/chunk-7IDQLLBW.js +311 -0
  23. package/dist/chunk-MLKGABMK.js +9 -0
  24. package/dist/chunk-MN6LCZHZ.js +1320 -0
  25. package/dist/chunk-PBHUHSC3.js +6002 -0
  26. package/dist/chunk-QJXXHOV7.js +205 -0
  27. package/dist/chunk-SSRXIO2V.js +6822 -0
  28. package/dist/chunk-VY3BLXBW.js +329 -0
  29. package/dist/chunk-W3WJGYR6.js +354 -0
  30. package/dist/cli.d.ts +1 -0
  31. package/dist/cli.js +120 -0
  32. package/dist/db-IWIL65EX.js +33 -0
  33. package/dist/gridCompositor-ENKLFPWR.js +409 -0
  34. package/dist/index.d.ts +1648 -0
  35. package/dist/index.js +869 -0
  36. package/dist/ocr-UTWC7537.js +21 -0
  37. package/dist/server-3FBHBA7L.js +15 -0
  38. package/dist/server-NM5CKDUU.js +13 -0
  39. package/dist/setup-27CQAX6K.js +17 -0
  40. package/dist/tools-75BAPCUM.js +177 -0
  41. package/package.json +84 -0
  42. package/skills/generate-assets/SKILL.md +44 -0
  43. package/skills/mobile-test/SKILL.md +33 -0
  44. package/skills/open-ui/SKILL.md +24 -0
  45. package/skills/quick-capture/SKILL.md +28 -0
  46. package/skills/task-hub/SKILL.md +44 -0
  47. package/skills/web-test/SKILL.md +41 -0
@@ -0,0 +1,1648 @@
1
+ #!/usr/bin/env node
2
+ import { z } from 'zod';
3
+ import * as drizzle_orm_better_sqlite3 from 'drizzle-orm/better-sqlite3';
4
+ import Database from 'better-sqlite3';
5
+ import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
6
+
7
+ /**
8
+ * DiscoveryLab MCP Server
9
+ * Model Context Protocol server for Claude Code integration
10
+ */
11
+
12
+ interface MCPTool {
13
+ name: string;
14
+ description: string;
15
+ inputSchema: z.ZodType<any>;
16
+ handler: (params: any) => Promise<MCPToolResult>;
17
+ }
18
+ interface MCPToolResult {
19
+ content: Array<{
20
+ type: 'text' | 'image';
21
+ text?: string;
22
+ data?: string;
23
+ mimeType?: string;
24
+ }>;
25
+ isError?: boolean;
26
+ }
27
+ interface MCPRequest {
28
+ jsonrpc: '2.0';
29
+ id: string | number;
30
+ method: string;
31
+ params?: any;
32
+ }
33
+ interface MCPResponse {
34
+ jsonrpc: '2.0';
35
+ id: string | number;
36
+ result?: any;
37
+ error?: {
38
+ code: number;
39
+ message: string;
40
+ data?: any;
41
+ };
42
+ }
43
+ declare class MCPServer {
44
+ private tools;
45
+ private serverInfo;
46
+ registerTool(tool: MCPTool): void;
47
+ registerTools(tools: MCPTool[]): void;
48
+ handleRequest(request: MCPRequest): Promise<MCPResponse>;
49
+ private handleInitialize;
50
+ private handleToolsList;
51
+ private handleToolCall;
52
+ private zodToJsonSchema;
53
+ runStdio(): Promise<void>;
54
+ }
55
+ declare const mcpServer: MCPServer;
56
+
57
+ /**
58
+ * DiscoveryLab Database Schema
59
+ * Using Drizzle ORM with SQLite (better-sqlite3)
60
+ */
61
+ declare const projects: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
62
+ name: "projects";
63
+ schema: undefined;
64
+ columns: {
65
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
66
+ name: "id";
67
+ tableName: "projects";
68
+ dataType: "string";
69
+ columnType: "SQLiteText";
70
+ data: string;
71
+ driverParam: string;
72
+ notNull: true;
73
+ hasDefault: false;
74
+ isPrimaryKey: true;
75
+ isAutoincrement: false;
76
+ hasRuntimeDefault: false;
77
+ enumValues: [string, ...string[]];
78
+ baseColumn: never;
79
+ generated: undefined;
80
+ }, object>;
81
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
82
+ name: "name";
83
+ tableName: "projects";
84
+ dataType: "string";
85
+ columnType: "SQLiteText";
86
+ data: string;
87
+ driverParam: string;
88
+ notNull: true;
89
+ hasDefault: false;
90
+ isPrimaryKey: false;
91
+ isAutoincrement: false;
92
+ hasRuntimeDefault: false;
93
+ enumValues: [string, ...string[]];
94
+ baseColumn: never;
95
+ generated: undefined;
96
+ }, object>;
97
+ videoPath: drizzle_orm_sqlite_core.SQLiteColumn<{
98
+ name: "video_path";
99
+ tableName: "projects";
100
+ dataType: "string";
101
+ columnType: "SQLiteText";
102
+ data: string;
103
+ driverParam: string;
104
+ notNull: false;
105
+ hasDefault: false;
106
+ isPrimaryKey: false;
107
+ isAutoincrement: false;
108
+ hasRuntimeDefault: false;
109
+ enumValues: [string, ...string[]];
110
+ baseColumn: never;
111
+ generated: undefined;
112
+ }, object>;
113
+ thumbnailPath: drizzle_orm_sqlite_core.SQLiteColumn<{
114
+ name: "thumbnail_path";
115
+ tableName: "projects";
116
+ dataType: "string";
117
+ columnType: "SQLiteText";
118
+ data: string;
119
+ driverParam: string;
120
+ notNull: false;
121
+ hasDefault: false;
122
+ isPrimaryKey: false;
123
+ isAutoincrement: false;
124
+ hasRuntimeDefault: false;
125
+ enumValues: [string, ...string[]];
126
+ baseColumn: never;
127
+ generated: undefined;
128
+ }, object>;
129
+ platform: drizzle_orm_sqlite_core.SQLiteColumn<{
130
+ name: "platform";
131
+ tableName: "projects";
132
+ dataType: "string";
133
+ columnType: "SQLiteText";
134
+ data: string;
135
+ driverParam: string;
136
+ notNull: false;
137
+ hasDefault: false;
138
+ isPrimaryKey: false;
139
+ isAutoincrement: false;
140
+ hasRuntimeDefault: false;
141
+ enumValues: [string, ...string[]];
142
+ baseColumn: never;
143
+ generated: undefined;
144
+ }, object>;
145
+ aiSummary: drizzle_orm_sqlite_core.SQLiteColumn<{
146
+ name: "ai_summary";
147
+ tableName: "projects";
148
+ dataType: "string";
149
+ columnType: "SQLiteText";
150
+ data: string;
151
+ driverParam: string;
152
+ notNull: false;
153
+ hasDefault: false;
154
+ isPrimaryKey: false;
155
+ isAutoincrement: false;
156
+ hasRuntimeDefault: false;
157
+ enumValues: [string, ...string[]];
158
+ baseColumn: never;
159
+ generated: undefined;
160
+ }, object>;
161
+ ocrText: drizzle_orm_sqlite_core.SQLiteColumn<{
162
+ name: "ocr_text";
163
+ tableName: "projects";
164
+ dataType: "string";
165
+ columnType: "SQLiteText";
166
+ data: string;
167
+ driverParam: string;
168
+ notNull: false;
169
+ hasDefault: false;
170
+ isPrimaryKey: false;
171
+ isAutoincrement: false;
172
+ hasRuntimeDefault: false;
173
+ enumValues: [string, ...string[]];
174
+ baseColumn: never;
175
+ generated: undefined;
176
+ }, object>;
177
+ ocrEngine: drizzle_orm_sqlite_core.SQLiteColumn<{
178
+ name: "ocr_engine";
179
+ tableName: "projects";
180
+ dataType: "string";
181
+ columnType: "SQLiteText";
182
+ data: string;
183
+ driverParam: string;
184
+ notNull: false;
185
+ hasDefault: false;
186
+ isPrimaryKey: false;
187
+ isAutoincrement: false;
188
+ hasRuntimeDefault: false;
189
+ enumValues: [string, ...string[]];
190
+ baseColumn: never;
191
+ generated: undefined;
192
+ }, object>;
193
+ ocrConfidence: drizzle_orm_sqlite_core.SQLiteColumn<{
194
+ name: "ocr_confidence";
195
+ tableName: "projects";
196
+ dataType: "number";
197
+ columnType: "SQLiteReal";
198
+ data: number;
199
+ driverParam: number;
200
+ notNull: false;
201
+ hasDefault: false;
202
+ isPrimaryKey: false;
203
+ isAutoincrement: false;
204
+ hasRuntimeDefault: false;
205
+ enumValues: undefined;
206
+ baseColumn: never;
207
+ generated: undefined;
208
+ }, object>;
209
+ frameCount: drizzle_orm_sqlite_core.SQLiteColumn<{
210
+ name: "frame_count";
211
+ tableName: "projects";
212
+ dataType: "number";
213
+ columnType: "SQLiteInteger";
214
+ data: number;
215
+ driverParam: number;
216
+ notNull: false;
217
+ hasDefault: true;
218
+ isPrimaryKey: false;
219
+ isAutoincrement: false;
220
+ hasRuntimeDefault: false;
221
+ enumValues: undefined;
222
+ baseColumn: never;
223
+ generated: undefined;
224
+ }, object>;
225
+ duration: drizzle_orm_sqlite_core.SQLiteColumn<{
226
+ name: "duration";
227
+ tableName: "projects";
228
+ dataType: "number";
229
+ columnType: "SQLiteReal";
230
+ data: number;
231
+ driverParam: number;
232
+ notNull: false;
233
+ hasDefault: false;
234
+ isPrimaryKey: false;
235
+ isAutoincrement: false;
236
+ hasRuntimeDefault: false;
237
+ enumValues: undefined;
238
+ baseColumn: never;
239
+ generated: undefined;
240
+ }, object>;
241
+ manualNotes: drizzle_orm_sqlite_core.SQLiteColumn<{
242
+ name: "manual_notes";
243
+ tableName: "projects";
244
+ dataType: "string";
245
+ columnType: "SQLiteText";
246
+ data: string;
247
+ driverParam: string;
248
+ notNull: false;
249
+ hasDefault: false;
250
+ isPrimaryKey: false;
251
+ isAutoincrement: false;
252
+ hasRuntimeDefault: false;
253
+ enumValues: [string, ...string[]];
254
+ baseColumn: never;
255
+ generated: undefined;
256
+ }, object>;
257
+ tags: drizzle_orm_sqlite_core.SQLiteColumn<{
258
+ name: "tags";
259
+ tableName: "projects";
260
+ dataType: "string";
261
+ columnType: "SQLiteText";
262
+ data: string;
263
+ driverParam: string;
264
+ notNull: false;
265
+ hasDefault: false;
266
+ isPrimaryKey: false;
267
+ isAutoincrement: false;
268
+ hasRuntimeDefault: false;
269
+ enumValues: [string, ...string[]];
270
+ baseColumn: never;
271
+ generated: undefined;
272
+ }, object>;
273
+ linkedTicket: drizzle_orm_sqlite_core.SQLiteColumn<{
274
+ name: "linked_ticket";
275
+ tableName: "projects";
276
+ dataType: "string";
277
+ columnType: "SQLiteText";
278
+ data: string;
279
+ driverParam: string;
280
+ notNull: false;
281
+ hasDefault: false;
282
+ isPrimaryKey: false;
283
+ isAutoincrement: false;
284
+ hasRuntimeDefault: false;
285
+ enumValues: [string, ...string[]];
286
+ baseColumn: never;
287
+ generated: undefined;
288
+ }, object>;
289
+ linkedJiraUrl: drizzle_orm_sqlite_core.SQLiteColumn<{
290
+ name: "linked_jira_url";
291
+ tableName: "projects";
292
+ dataType: "string";
293
+ columnType: "SQLiteText";
294
+ data: string;
295
+ driverParam: string;
296
+ notNull: false;
297
+ hasDefault: false;
298
+ isPrimaryKey: false;
299
+ isAutoincrement: false;
300
+ hasRuntimeDefault: false;
301
+ enumValues: [string, ...string[]];
302
+ baseColumn: never;
303
+ generated: undefined;
304
+ }, object>;
305
+ linkedNotionUrl: drizzle_orm_sqlite_core.SQLiteColumn<{
306
+ name: "linked_notion_url";
307
+ tableName: "projects";
308
+ dataType: "string";
309
+ columnType: "SQLiteText";
310
+ data: string;
311
+ driverParam: string;
312
+ notNull: false;
313
+ hasDefault: false;
314
+ isPrimaryKey: false;
315
+ isAutoincrement: false;
316
+ hasRuntimeDefault: false;
317
+ enumValues: [string, ...string[]];
318
+ baseColumn: never;
319
+ generated: undefined;
320
+ }, object>;
321
+ linkedFigmaUrl: drizzle_orm_sqlite_core.SQLiteColumn<{
322
+ name: "linked_figma_url";
323
+ tableName: "projects";
324
+ dataType: "string";
325
+ columnType: "SQLiteText";
326
+ data: string;
327
+ driverParam: string;
328
+ notNull: false;
329
+ hasDefault: false;
330
+ isPrimaryKey: false;
331
+ isAutoincrement: false;
332
+ hasRuntimeDefault: false;
333
+ enumValues: [string, ...string[]];
334
+ baseColumn: never;
335
+ generated: undefined;
336
+ }, object>;
337
+ taskHubLinks: drizzle_orm_sqlite_core.SQLiteColumn<{
338
+ name: "task_hub_links";
339
+ tableName: "projects";
340
+ dataType: "string";
341
+ columnType: "SQLiteText";
342
+ data: string;
343
+ driverParam: string;
344
+ notNull: false;
345
+ hasDefault: false;
346
+ isPrimaryKey: false;
347
+ isAutoincrement: false;
348
+ hasRuntimeDefault: false;
349
+ enumValues: [string, ...string[]];
350
+ baseColumn: never;
351
+ generated: undefined;
352
+ }, object>;
353
+ taskRequirements: drizzle_orm_sqlite_core.SQLiteColumn<{
354
+ name: "task_requirements";
355
+ tableName: "projects";
356
+ dataType: "string";
357
+ columnType: "SQLiteText";
358
+ data: string;
359
+ driverParam: string;
360
+ notNull: false;
361
+ hasDefault: false;
362
+ isPrimaryKey: false;
363
+ isAutoincrement: false;
364
+ hasRuntimeDefault: false;
365
+ enumValues: [string, ...string[]];
366
+ baseColumn: never;
367
+ generated: undefined;
368
+ }, object>;
369
+ taskTestMap: drizzle_orm_sqlite_core.SQLiteColumn<{
370
+ name: "task_test_map";
371
+ tableName: "projects";
372
+ dataType: "string";
373
+ columnType: "SQLiteText";
374
+ data: string;
375
+ driverParam: string;
376
+ notNull: false;
377
+ hasDefault: false;
378
+ isPrimaryKey: false;
379
+ isAutoincrement: false;
380
+ hasRuntimeDefault: false;
381
+ enumValues: [string, ...string[]];
382
+ baseColumn: never;
383
+ generated: undefined;
384
+ }, object>;
385
+ status: drizzle_orm_sqlite_core.SQLiteColumn<{
386
+ name: "status";
387
+ tableName: "projects";
388
+ dataType: "string";
389
+ columnType: "SQLiteText";
390
+ data: string;
391
+ driverParam: string;
392
+ notNull: false;
393
+ hasDefault: true;
394
+ isPrimaryKey: false;
395
+ isAutoincrement: false;
396
+ hasRuntimeDefault: false;
397
+ enumValues: [string, ...string[]];
398
+ baseColumn: never;
399
+ generated: undefined;
400
+ }, object>;
401
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
402
+ name: "created_at";
403
+ tableName: "projects";
404
+ dataType: "date";
405
+ columnType: "SQLiteTimestamp";
406
+ data: Date;
407
+ driverParam: number;
408
+ notNull: true;
409
+ hasDefault: false;
410
+ isPrimaryKey: false;
411
+ isAutoincrement: false;
412
+ hasRuntimeDefault: false;
413
+ enumValues: undefined;
414
+ baseColumn: never;
415
+ generated: undefined;
416
+ }, object>;
417
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
418
+ name: "updated_at";
419
+ tableName: "projects";
420
+ dataType: "date";
421
+ columnType: "SQLiteTimestamp";
422
+ data: Date;
423
+ driverParam: number;
424
+ notNull: true;
425
+ hasDefault: false;
426
+ isPrimaryKey: false;
427
+ isAutoincrement: false;
428
+ hasRuntimeDefault: false;
429
+ enumValues: undefined;
430
+ baseColumn: never;
431
+ generated: undefined;
432
+ }, object>;
433
+ };
434
+ dialect: "sqlite";
435
+ }>;
436
+ declare const projectExports: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
437
+ name: "project_exports";
438
+ schema: undefined;
439
+ columns: {
440
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
441
+ name: "id";
442
+ tableName: "project_exports";
443
+ dataType: "string";
444
+ columnType: "SQLiteText";
445
+ data: string;
446
+ driverParam: string;
447
+ notNull: true;
448
+ hasDefault: false;
449
+ isPrimaryKey: true;
450
+ isAutoincrement: false;
451
+ hasRuntimeDefault: false;
452
+ enumValues: [string, ...string[]];
453
+ baseColumn: never;
454
+ generated: undefined;
455
+ }, object>;
456
+ projectId: drizzle_orm_sqlite_core.SQLiteColumn<{
457
+ name: "project_id";
458
+ tableName: "project_exports";
459
+ dataType: "string";
460
+ columnType: "SQLiteText";
461
+ data: string;
462
+ driverParam: string;
463
+ notNull: true;
464
+ hasDefault: false;
465
+ isPrimaryKey: false;
466
+ isAutoincrement: false;
467
+ hasRuntimeDefault: false;
468
+ enumValues: [string, ...string[]];
469
+ baseColumn: never;
470
+ generated: undefined;
471
+ }, object>;
472
+ destination: drizzle_orm_sqlite_core.SQLiteColumn<{
473
+ name: "destination";
474
+ tableName: "project_exports";
475
+ dataType: "string";
476
+ columnType: "SQLiteText";
477
+ data: string;
478
+ driverParam: string;
479
+ notNull: true;
480
+ hasDefault: false;
481
+ isPrimaryKey: false;
482
+ isAutoincrement: false;
483
+ hasRuntimeDefault: false;
484
+ enumValues: [string, ...string[]];
485
+ baseColumn: never;
486
+ generated: undefined;
487
+ }, object>;
488
+ destinationUrl: drizzle_orm_sqlite_core.SQLiteColumn<{
489
+ name: "destination_url";
490
+ tableName: "project_exports";
491
+ dataType: "string";
492
+ columnType: "SQLiteText";
493
+ data: string;
494
+ driverParam: string;
495
+ notNull: false;
496
+ hasDefault: false;
497
+ isPrimaryKey: false;
498
+ isAutoincrement: false;
499
+ hasRuntimeDefault: false;
500
+ enumValues: [string, ...string[]];
501
+ baseColumn: never;
502
+ generated: undefined;
503
+ }, object>;
504
+ destinationPath: drizzle_orm_sqlite_core.SQLiteColumn<{
505
+ name: "destination_path";
506
+ tableName: "project_exports";
507
+ dataType: "string";
508
+ columnType: "SQLiteText";
509
+ data: string;
510
+ driverParam: string;
511
+ notNull: false;
512
+ hasDefault: false;
513
+ isPrimaryKey: false;
514
+ isAutoincrement: false;
515
+ hasRuntimeDefault: false;
516
+ enumValues: [string, ...string[]];
517
+ baseColumn: never;
518
+ generated: undefined;
519
+ }, object>;
520
+ contentIncluded: drizzle_orm_sqlite_core.SQLiteColumn<{
521
+ name: "content_included";
522
+ tableName: "project_exports";
523
+ dataType: "string";
524
+ columnType: "SQLiteText";
525
+ data: string;
526
+ driverParam: string;
527
+ notNull: false;
528
+ hasDefault: false;
529
+ isPrimaryKey: false;
530
+ isAutoincrement: false;
531
+ hasRuntimeDefault: false;
532
+ enumValues: [string, ...string[]];
533
+ baseColumn: never;
534
+ generated: undefined;
535
+ }, object>;
536
+ status: drizzle_orm_sqlite_core.SQLiteColumn<{
537
+ name: "status";
538
+ tableName: "project_exports";
539
+ dataType: "string";
540
+ columnType: "SQLiteText";
541
+ data: string;
542
+ driverParam: string;
543
+ notNull: false;
544
+ hasDefault: true;
545
+ isPrimaryKey: false;
546
+ isAutoincrement: false;
547
+ hasRuntimeDefault: false;
548
+ enumValues: [string, ...string[]];
549
+ baseColumn: never;
550
+ generated: undefined;
551
+ }, object>;
552
+ errorMessage: drizzle_orm_sqlite_core.SQLiteColumn<{
553
+ name: "error_message";
554
+ tableName: "project_exports";
555
+ dataType: "string";
556
+ columnType: "SQLiteText";
557
+ data: string;
558
+ driverParam: string;
559
+ notNull: false;
560
+ hasDefault: false;
561
+ isPrimaryKey: false;
562
+ isAutoincrement: false;
563
+ hasRuntimeDefault: false;
564
+ enumValues: [string, ...string[]];
565
+ baseColumn: never;
566
+ generated: undefined;
567
+ }, object>;
568
+ exportedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
569
+ name: "exported_at";
570
+ tableName: "project_exports";
571
+ dataType: "date";
572
+ columnType: "SQLiteTimestamp";
573
+ data: Date;
574
+ driverParam: number;
575
+ notNull: false;
576
+ hasDefault: false;
577
+ isPrimaryKey: false;
578
+ isAutoincrement: false;
579
+ hasRuntimeDefault: false;
580
+ enumValues: undefined;
581
+ baseColumn: never;
582
+ generated: undefined;
583
+ }, object>;
584
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
585
+ name: "created_at";
586
+ tableName: "project_exports";
587
+ dataType: "date";
588
+ columnType: "SQLiteTimestamp";
589
+ data: Date;
590
+ driverParam: number;
591
+ notNull: true;
592
+ hasDefault: false;
593
+ isPrimaryKey: false;
594
+ isAutoincrement: false;
595
+ hasRuntimeDefault: false;
596
+ enumValues: undefined;
597
+ baseColumn: never;
598
+ generated: undefined;
599
+ }, object>;
600
+ };
601
+ dialect: "sqlite";
602
+ }>;
603
+ declare const frames: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
604
+ name: "frames";
605
+ schema: undefined;
606
+ columns: {
607
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
608
+ name: "id";
609
+ tableName: "frames";
610
+ dataType: "string";
611
+ columnType: "SQLiteText";
612
+ data: string;
613
+ driverParam: string;
614
+ notNull: true;
615
+ hasDefault: false;
616
+ isPrimaryKey: true;
617
+ isAutoincrement: false;
618
+ hasRuntimeDefault: false;
619
+ enumValues: [string, ...string[]];
620
+ baseColumn: never;
621
+ generated: undefined;
622
+ }, object>;
623
+ projectId: drizzle_orm_sqlite_core.SQLiteColumn<{
624
+ name: "project_id";
625
+ tableName: "frames";
626
+ dataType: "string";
627
+ columnType: "SQLiteText";
628
+ data: string;
629
+ driverParam: string;
630
+ notNull: true;
631
+ hasDefault: false;
632
+ isPrimaryKey: false;
633
+ isAutoincrement: false;
634
+ hasRuntimeDefault: false;
635
+ enumValues: [string, ...string[]];
636
+ baseColumn: never;
637
+ generated: undefined;
638
+ }, object>;
639
+ frameNumber: drizzle_orm_sqlite_core.SQLiteColumn<{
640
+ name: "frame_number";
641
+ tableName: "frames";
642
+ dataType: "number";
643
+ columnType: "SQLiteInteger";
644
+ data: number;
645
+ driverParam: number;
646
+ notNull: true;
647
+ hasDefault: false;
648
+ isPrimaryKey: false;
649
+ isAutoincrement: false;
650
+ hasRuntimeDefault: false;
651
+ enumValues: undefined;
652
+ baseColumn: never;
653
+ generated: undefined;
654
+ }, object>;
655
+ timestamp: drizzle_orm_sqlite_core.SQLiteColumn<{
656
+ name: "timestamp";
657
+ tableName: "frames";
658
+ dataType: "number";
659
+ columnType: "SQLiteReal";
660
+ data: number;
661
+ driverParam: number;
662
+ notNull: true;
663
+ hasDefault: false;
664
+ isPrimaryKey: false;
665
+ isAutoincrement: false;
666
+ hasRuntimeDefault: false;
667
+ enumValues: undefined;
668
+ baseColumn: never;
669
+ generated: undefined;
670
+ }, object>;
671
+ imagePath: drizzle_orm_sqlite_core.SQLiteColumn<{
672
+ name: "image_path";
673
+ tableName: "frames";
674
+ dataType: "string";
675
+ columnType: "SQLiteText";
676
+ data: string;
677
+ driverParam: string;
678
+ notNull: true;
679
+ hasDefault: false;
680
+ isPrimaryKey: false;
681
+ isAutoincrement: false;
682
+ hasRuntimeDefault: false;
683
+ enumValues: [string, ...string[]];
684
+ baseColumn: never;
685
+ generated: undefined;
686
+ }, object>;
687
+ ocrText: drizzle_orm_sqlite_core.SQLiteColumn<{
688
+ name: "ocr_text";
689
+ tableName: "frames";
690
+ dataType: "string";
691
+ columnType: "SQLiteText";
692
+ data: string;
693
+ driverParam: string;
694
+ notNull: false;
695
+ hasDefault: false;
696
+ isPrimaryKey: false;
697
+ isAutoincrement: false;
698
+ hasRuntimeDefault: false;
699
+ enumValues: [string, ...string[]];
700
+ baseColumn: never;
701
+ generated: undefined;
702
+ }, object>;
703
+ isKeyFrame: drizzle_orm_sqlite_core.SQLiteColumn<{
704
+ name: "is_key_frame";
705
+ tableName: "frames";
706
+ dataType: "boolean";
707
+ columnType: "SQLiteBoolean";
708
+ data: boolean;
709
+ driverParam: number;
710
+ notNull: false;
711
+ hasDefault: true;
712
+ isPrimaryKey: false;
713
+ isAutoincrement: false;
714
+ hasRuntimeDefault: false;
715
+ enumValues: undefined;
716
+ baseColumn: never;
717
+ generated: undefined;
718
+ }, object>;
719
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
720
+ name: "created_at";
721
+ tableName: "frames";
722
+ dataType: "date";
723
+ columnType: "SQLiteTimestamp";
724
+ data: Date;
725
+ driverParam: number;
726
+ notNull: true;
727
+ hasDefault: false;
728
+ isPrimaryKey: false;
729
+ isAutoincrement: false;
730
+ hasRuntimeDefault: false;
731
+ enumValues: undefined;
732
+ baseColumn: never;
733
+ generated: undefined;
734
+ }, object>;
735
+ };
736
+ dialect: "sqlite";
737
+ }>;
738
+ declare const settings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
739
+ name: "settings";
740
+ schema: undefined;
741
+ columns: {
742
+ key: drizzle_orm_sqlite_core.SQLiteColumn<{
743
+ name: "key";
744
+ tableName: "settings";
745
+ dataType: "string";
746
+ columnType: "SQLiteText";
747
+ data: string;
748
+ driverParam: string;
749
+ notNull: true;
750
+ hasDefault: false;
751
+ isPrimaryKey: true;
752
+ isAutoincrement: false;
753
+ hasRuntimeDefault: false;
754
+ enumValues: [string, ...string[]];
755
+ baseColumn: never;
756
+ generated: undefined;
757
+ }, object>;
758
+ value: drizzle_orm_sqlite_core.SQLiteColumn<{
759
+ name: "value";
760
+ tableName: "settings";
761
+ dataType: "string";
762
+ columnType: "SQLiteText";
763
+ data: string;
764
+ driverParam: string;
765
+ notNull: true;
766
+ hasDefault: false;
767
+ isPrimaryKey: false;
768
+ isAutoincrement: false;
769
+ hasRuntimeDefault: false;
770
+ enumValues: [string, ...string[]];
771
+ baseColumn: never;
772
+ generated: undefined;
773
+ }, object>;
774
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
775
+ name: "updated_at";
776
+ tableName: "settings";
777
+ dataType: "date";
778
+ columnType: "SQLiteTimestamp";
779
+ data: Date;
780
+ driverParam: number;
781
+ notNull: true;
782
+ hasDefault: false;
783
+ isPrimaryKey: false;
784
+ isAutoincrement: false;
785
+ hasRuntimeDefault: false;
786
+ enumValues: undefined;
787
+ baseColumn: never;
788
+ generated: undefined;
789
+ }, object>;
790
+ };
791
+ dialect: "sqlite";
792
+ }>;
793
+ declare const exportDestinations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
794
+ name: "export_destinations";
795
+ schema: undefined;
796
+ columns: {
797
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
798
+ name: "id";
799
+ tableName: "export_destinations";
800
+ dataType: "string";
801
+ columnType: "SQLiteText";
802
+ data: string;
803
+ driverParam: string;
804
+ notNull: true;
805
+ hasDefault: false;
806
+ isPrimaryKey: true;
807
+ isAutoincrement: false;
808
+ hasRuntimeDefault: false;
809
+ enumValues: [string, ...string[]];
810
+ baseColumn: never;
811
+ generated: undefined;
812
+ }, object>;
813
+ type: drizzle_orm_sqlite_core.SQLiteColumn<{
814
+ name: "type";
815
+ tableName: "export_destinations";
816
+ dataType: "string";
817
+ columnType: "SQLiteText";
818
+ data: string;
819
+ driverParam: string;
820
+ notNull: true;
821
+ hasDefault: false;
822
+ isPrimaryKey: false;
823
+ isAutoincrement: false;
824
+ hasRuntimeDefault: false;
825
+ enumValues: [string, ...string[]];
826
+ baseColumn: never;
827
+ generated: undefined;
828
+ }, object>;
829
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
830
+ name: "name";
831
+ tableName: "export_destinations";
832
+ dataType: "string";
833
+ columnType: "SQLiteText";
834
+ data: string;
835
+ driverParam: string;
836
+ notNull: true;
837
+ hasDefault: false;
838
+ isPrimaryKey: false;
839
+ isAutoincrement: false;
840
+ hasRuntimeDefault: false;
841
+ enumValues: [string, ...string[]];
842
+ baseColumn: never;
843
+ generated: undefined;
844
+ }, object>;
845
+ config: drizzle_orm_sqlite_core.SQLiteColumn<{
846
+ name: "config";
847
+ tableName: "export_destinations";
848
+ dataType: "string";
849
+ columnType: "SQLiteText";
850
+ data: string;
851
+ driverParam: string;
852
+ notNull: false;
853
+ hasDefault: false;
854
+ isPrimaryKey: false;
855
+ isAutoincrement: false;
856
+ hasRuntimeDefault: false;
857
+ enumValues: [string, ...string[]];
858
+ baseColumn: never;
859
+ generated: undefined;
860
+ }, object>;
861
+ isActive: drizzle_orm_sqlite_core.SQLiteColumn<{
862
+ name: "is_active";
863
+ tableName: "export_destinations";
864
+ dataType: "boolean";
865
+ columnType: "SQLiteBoolean";
866
+ data: boolean;
867
+ driverParam: number;
868
+ notNull: false;
869
+ hasDefault: true;
870
+ isPrimaryKey: false;
871
+ isAutoincrement: false;
872
+ hasRuntimeDefault: false;
873
+ enumValues: undefined;
874
+ baseColumn: never;
875
+ generated: undefined;
876
+ }, object>;
877
+ lastUsedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
878
+ name: "last_used_at";
879
+ tableName: "export_destinations";
880
+ dataType: "date";
881
+ columnType: "SQLiteTimestamp";
882
+ data: Date;
883
+ driverParam: number;
884
+ notNull: false;
885
+ hasDefault: false;
886
+ isPrimaryKey: false;
887
+ isAutoincrement: false;
888
+ hasRuntimeDefault: false;
889
+ enumValues: undefined;
890
+ baseColumn: never;
891
+ generated: undefined;
892
+ }, object>;
893
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
894
+ name: "created_at";
895
+ tableName: "export_destinations";
896
+ dataType: "date";
897
+ columnType: "SQLiteTimestamp";
898
+ data: Date;
899
+ driverParam: number;
900
+ notNull: true;
901
+ hasDefault: false;
902
+ isPrimaryKey: false;
903
+ isAutoincrement: false;
904
+ hasRuntimeDefault: false;
905
+ enumValues: undefined;
906
+ baseColumn: never;
907
+ generated: undefined;
908
+ }, object>;
909
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
910
+ name: "updated_at";
911
+ tableName: "export_destinations";
912
+ dataType: "date";
913
+ columnType: "SQLiteTimestamp";
914
+ data: Date;
915
+ driverParam: number;
916
+ notNull: true;
917
+ hasDefault: false;
918
+ isPrimaryKey: false;
919
+ isAutoincrement: false;
920
+ hasRuntimeDefault: false;
921
+ enumValues: undefined;
922
+ baseColumn: never;
923
+ generated: undefined;
924
+ }, object>;
925
+ };
926
+ dialect: "sqlite";
927
+ }>;
928
+ declare const exportRules: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
929
+ name: "export_rules";
930
+ schema: undefined;
931
+ columns: {
932
+ id: drizzle_orm_sqlite_core.SQLiteColumn<{
933
+ name: "id";
934
+ tableName: "export_rules";
935
+ dataType: "string";
936
+ columnType: "SQLiteText";
937
+ data: string;
938
+ driverParam: string;
939
+ notNull: true;
940
+ hasDefault: false;
941
+ isPrimaryKey: true;
942
+ isAutoincrement: false;
943
+ hasRuntimeDefault: false;
944
+ enumValues: [string, ...string[]];
945
+ baseColumn: never;
946
+ generated: undefined;
947
+ }, object>;
948
+ name: drizzle_orm_sqlite_core.SQLiteColumn<{
949
+ name: "name";
950
+ tableName: "export_rules";
951
+ dataType: "string";
952
+ columnType: "SQLiteText";
953
+ data: string;
954
+ driverParam: string;
955
+ notNull: true;
956
+ hasDefault: false;
957
+ isPrimaryKey: false;
958
+ isAutoincrement: false;
959
+ hasRuntimeDefault: false;
960
+ enumValues: [string, ...string[]];
961
+ baseColumn: never;
962
+ generated: undefined;
963
+ }, object>;
964
+ destinationId: drizzle_orm_sqlite_core.SQLiteColumn<{
965
+ name: "destination_id";
966
+ tableName: "export_rules";
967
+ dataType: "string";
968
+ columnType: "SQLiteText";
969
+ data: string;
970
+ driverParam: string;
971
+ notNull: true;
972
+ hasDefault: false;
973
+ isPrimaryKey: false;
974
+ isAutoincrement: false;
975
+ hasRuntimeDefault: false;
976
+ enumValues: [string, ...string[]];
977
+ baseColumn: never;
978
+ generated: undefined;
979
+ }, object>;
980
+ conditions: drizzle_orm_sqlite_core.SQLiteColumn<{
981
+ name: "conditions";
982
+ tableName: "export_rules";
983
+ dataType: "string";
984
+ columnType: "SQLiteText";
985
+ data: string;
986
+ driverParam: string;
987
+ notNull: false;
988
+ hasDefault: false;
989
+ isPrimaryKey: false;
990
+ isAutoincrement: false;
991
+ hasRuntimeDefault: false;
992
+ enumValues: [string, ...string[]];
993
+ baseColumn: never;
994
+ generated: undefined;
995
+ }, object>;
996
+ contentIncluded: drizzle_orm_sqlite_core.SQLiteColumn<{
997
+ name: "content_included";
998
+ tableName: "export_rules";
999
+ dataType: "string";
1000
+ columnType: "SQLiteText";
1001
+ data: string;
1002
+ driverParam: string;
1003
+ notNull: false;
1004
+ hasDefault: false;
1005
+ isPrimaryKey: false;
1006
+ isAutoincrement: false;
1007
+ hasRuntimeDefault: false;
1008
+ enumValues: [string, ...string[]];
1009
+ baseColumn: never;
1010
+ generated: undefined;
1011
+ }, object>;
1012
+ isActive: drizzle_orm_sqlite_core.SQLiteColumn<{
1013
+ name: "is_active";
1014
+ tableName: "export_rules";
1015
+ dataType: "boolean";
1016
+ columnType: "SQLiteBoolean";
1017
+ data: boolean;
1018
+ driverParam: number;
1019
+ notNull: false;
1020
+ hasDefault: true;
1021
+ isPrimaryKey: false;
1022
+ isAutoincrement: false;
1023
+ hasRuntimeDefault: false;
1024
+ enumValues: undefined;
1025
+ baseColumn: never;
1026
+ generated: undefined;
1027
+ }, object>;
1028
+ createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1029
+ name: "created_at";
1030
+ tableName: "export_rules";
1031
+ dataType: "date";
1032
+ columnType: "SQLiteTimestamp";
1033
+ data: Date;
1034
+ driverParam: number;
1035
+ notNull: true;
1036
+ hasDefault: false;
1037
+ isPrimaryKey: false;
1038
+ isAutoincrement: false;
1039
+ hasRuntimeDefault: false;
1040
+ enumValues: undefined;
1041
+ baseColumn: never;
1042
+ generated: undefined;
1043
+ }, object>;
1044
+ updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
1045
+ name: "updated_at";
1046
+ tableName: "export_rules";
1047
+ dataType: "date";
1048
+ columnType: "SQLiteTimestamp";
1049
+ data: Date;
1050
+ driverParam: number;
1051
+ notNull: true;
1052
+ hasDefault: false;
1053
+ isPrimaryKey: false;
1054
+ isAutoincrement: false;
1055
+ hasRuntimeDefault: false;
1056
+ enumValues: undefined;
1057
+ baseColumn: never;
1058
+ generated: undefined;
1059
+ }, object>;
1060
+ };
1061
+ dialect: "sqlite";
1062
+ }>;
1063
+ type Project = typeof projects.$inferSelect;
1064
+ type NewProject = typeof projects.$inferInsert;
1065
+ type ProjectExport = typeof projectExports.$inferSelect;
1066
+ type NewProjectExport = typeof projectExports.$inferInsert;
1067
+ type Frame = typeof frames.$inferSelect;
1068
+ type NewFrame = typeof frames.$inferInsert;
1069
+ type Setting = typeof settings.$inferSelect;
1070
+ type NewSetting = typeof settings.$inferInsert;
1071
+ type ExportDestination = typeof exportDestinations.$inferSelect;
1072
+ type NewExportDestination = typeof exportDestinations.$inferInsert;
1073
+ type ExportRule = typeof exportRules.$inferSelect;
1074
+ type NewExportRule = typeof exportRules.$inferInsert;
1075
+
1076
+ declare function getDatabase(): drizzle_orm_better_sqlite3.BetterSQLite3Database<Record<string, unknown>> & {
1077
+ $client: Database.Database;
1078
+ };
1079
+ declare function closeDatabase(): void;
1080
+
1081
+ declare function startServer(port?: number): Promise<void>;
1082
+ declare function stopServer(): void;
1083
+
1084
+ /**
1085
+ * DiscoveryLab WebSocket Protocol Types
1086
+ *
1087
+ * Inspired by Clawdbot's typed WebSocket protocol pattern.
1088
+ * Three message types:
1089
+ * - Request: client → server (expects response)
1090
+ * - Response: server → client (reply to request)
1091
+ * - Event: server → client (push notification)
1092
+ */
1093
+ /** Request message: client → server */
1094
+ interface WSRequest<T = unknown> {
1095
+ type: 'req';
1096
+ id: string;
1097
+ method: string;
1098
+ params: T;
1099
+ }
1100
+ /** Response message: server → client */
1101
+ interface WSResponse<T = unknown> {
1102
+ type: 'res';
1103
+ id: string;
1104
+ ok: boolean;
1105
+ payload?: T;
1106
+ error?: string;
1107
+ }
1108
+ /** Event message: server → client (push) */
1109
+ interface WSEvent<T = unknown> {
1110
+ type: 'event';
1111
+ event: string;
1112
+ payload: T;
1113
+ seq?: number;
1114
+ timestamp?: number;
1115
+ }
1116
+ /** Union of all message types */
1117
+ type WSMessage = WSRequest | WSResponse | WSEvent;
1118
+ /** Available request methods */
1119
+ type WSMethod = 'ping' | 'recorder.start' | 'recorder.stop' | 'recorder.status' | 'liveStream.start' | 'liveStream.stop' | 'liveStream.tap' | 'project.list' | 'project.get' | 'project.create' | 'project.delete';
1120
+ /** Available event types */
1121
+ type WSEventType = 'action' | 'screenshot' | 'status' | 'stopped' | 'session' | 'liveFrame' | 'error' | 'connected';
1122
+ interface PingParams {
1123
+ }
1124
+ interface RecorderStartParams {
1125
+ name: string;
1126
+ url: string;
1127
+ resolution?: {
1128
+ width: number;
1129
+ height: number;
1130
+ };
1131
+ }
1132
+ interface RecorderStopParams {
1133
+ }
1134
+ interface RecorderStatusParams {
1135
+ }
1136
+ interface LiveStreamStartParams {
1137
+ platform: 'ios' | 'android';
1138
+ deviceId?: string;
1139
+ interactive?: boolean;
1140
+ }
1141
+ interface LiveStreamStopParams {
1142
+ }
1143
+ interface LiveStreamTapParams {
1144
+ x: number;
1145
+ y: number;
1146
+ }
1147
+ interface ProjectListParams {
1148
+ }
1149
+ interface ProjectGetParams {
1150
+ id: string;
1151
+ }
1152
+ interface ProjectCreateParams {
1153
+ name: string;
1154
+ packageName?: string;
1155
+ }
1156
+ interface ProjectDeleteParams {
1157
+ id: string;
1158
+ }
1159
+ interface PingResponse {
1160
+ pong: true;
1161
+ }
1162
+ interface RecorderStartResponse {
1163
+ id: string;
1164
+ name: string;
1165
+ url: string;
1166
+ status: string;
1167
+ screenshotsDir: string;
1168
+ }
1169
+ interface RecorderStopResponse {
1170
+ id: string;
1171
+ name: string;
1172
+ actions: any[];
1173
+ screenshots: string[];
1174
+ }
1175
+ interface LiveStreamStartResponse {
1176
+ platform: 'ios' | 'android';
1177
+ deviceId?: string;
1178
+ interactive: boolean;
1179
+ }
1180
+ interface LiveStreamStopResponse {
1181
+ stopped: true;
1182
+ }
1183
+ interface ActionEventPayload {
1184
+ id: string;
1185
+ type: string;
1186
+ timestamp: number;
1187
+ selector?: string;
1188
+ text?: string;
1189
+ url?: string;
1190
+ screenshotPath?: string;
1191
+ }
1192
+ interface ScreenshotEventPayload {
1193
+ path: string;
1194
+ actionId: string;
1195
+ }
1196
+ interface StatusEventPayload {
1197
+ status: string;
1198
+ }
1199
+ interface SessionEventPayload {
1200
+ id: string;
1201
+ name: string;
1202
+ url: string;
1203
+ status: string;
1204
+ actions: any[];
1205
+ screenshotsDir: string;
1206
+ }
1207
+ interface LiveFrameEventPayload {
1208
+ image: string;
1209
+ platform: 'ios' | 'android';
1210
+ timestamp: number;
1211
+ }
1212
+ interface ErrorEventPayload {
1213
+ message: string;
1214
+ code?: string;
1215
+ }
1216
+ interface ConnectedEventPayload {
1217
+ timestamp: number;
1218
+ serverVersion: string;
1219
+ }
1220
+ interface WSMethodMap {
1221
+ 'ping': {
1222
+ params: PingParams;
1223
+ response: PingResponse;
1224
+ };
1225
+ 'recorder.start': {
1226
+ params: RecorderStartParams;
1227
+ response: RecorderStartResponse;
1228
+ };
1229
+ 'recorder.stop': {
1230
+ params: RecorderStopParams;
1231
+ response: RecorderStopResponse;
1232
+ };
1233
+ 'recorder.status': {
1234
+ params: RecorderStatusParams;
1235
+ response: SessionEventPayload | null;
1236
+ };
1237
+ 'liveStream.start': {
1238
+ params: LiveStreamStartParams;
1239
+ response: LiveStreamStartResponse;
1240
+ };
1241
+ 'liveStream.stop': {
1242
+ params: LiveStreamStopParams;
1243
+ response: LiveStreamStopResponse;
1244
+ };
1245
+ 'liveStream.tap': {
1246
+ params: LiveStreamTapParams;
1247
+ response: {
1248
+ success: boolean;
1249
+ };
1250
+ };
1251
+ 'project.list': {
1252
+ params: ProjectListParams;
1253
+ response: any[];
1254
+ };
1255
+ 'project.get': {
1256
+ params: ProjectGetParams;
1257
+ response: any;
1258
+ };
1259
+ 'project.create': {
1260
+ params: ProjectCreateParams;
1261
+ response: any;
1262
+ };
1263
+ 'project.delete': {
1264
+ params: ProjectDeleteParams;
1265
+ response: {
1266
+ deleted: boolean;
1267
+ };
1268
+ };
1269
+ }
1270
+ interface WSEventMap {
1271
+ 'action': ActionEventPayload;
1272
+ 'screenshot': ScreenshotEventPayload;
1273
+ 'status': StatusEventPayload;
1274
+ 'stopped': RecorderStopResponse;
1275
+ 'session': SessionEventPayload;
1276
+ 'liveFrame': LiveFrameEventPayload;
1277
+ 'error': ErrorEventPayload;
1278
+ 'connected': ConnectedEventPayload;
1279
+ }
1280
+ declare function isWSRequest(msg: unknown): msg is WSRequest;
1281
+ declare function isWSResponse(msg: unknown): msg is WSResponse;
1282
+ declare function isWSEvent(msg: unknown): msg is WSEvent;
1283
+ declare function isWSMessage(msg: unknown): msg is WSMessage;
1284
+
1285
+ /**
1286
+ * DiscoveryLab WebSocket Protocol Validator
1287
+ *
1288
+ * JSON Schema-based validation for WebSocket messages.
1289
+ * Inspired by Clawdbot's AJV validators pattern.
1290
+ */
1291
+
1292
+ declare const schemas: {
1293
+ readonly request: {
1294
+ readonly type: "object";
1295
+ readonly required: readonly ["type", "id", "method"];
1296
+ readonly properties: {
1297
+ readonly type: {
1298
+ readonly const: "req";
1299
+ };
1300
+ readonly id: {
1301
+ readonly type: "string";
1302
+ };
1303
+ readonly method: {
1304
+ readonly type: "string";
1305
+ };
1306
+ readonly params: {
1307
+ readonly type: "object";
1308
+ };
1309
+ };
1310
+ readonly additionalProperties: false;
1311
+ };
1312
+ readonly response: {
1313
+ readonly type: "object";
1314
+ readonly required: readonly ["type", "id", "ok"];
1315
+ readonly properties: {
1316
+ readonly type: {
1317
+ readonly const: "res";
1318
+ };
1319
+ readonly id: {
1320
+ readonly type: "string";
1321
+ };
1322
+ readonly ok: {
1323
+ readonly type: "boolean";
1324
+ };
1325
+ readonly payload: {};
1326
+ readonly error: {
1327
+ readonly type: "string";
1328
+ };
1329
+ };
1330
+ readonly additionalProperties: false;
1331
+ };
1332
+ readonly event: {
1333
+ readonly type: "object";
1334
+ readonly required: readonly ["type", "event", "payload"];
1335
+ readonly properties: {
1336
+ readonly type: {
1337
+ readonly const: "event";
1338
+ };
1339
+ readonly event: {
1340
+ readonly type: "string";
1341
+ };
1342
+ readonly payload: {};
1343
+ readonly seq: {
1344
+ readonly type: "number";
1345
+ };
1346
+ readonly timestamp: {
1347
+ readonly type: "number";
1348
+ };
1349
+ };
1350
+ readonly additionalProperties: false;
1351
+ };
1352
+ readonly methods: Record<string, object>;
1353
+ };
1354
+ interface ValidationError {
1355
+ path: string;
1356
+ message: string;
1357
+ expected?: string;
1358
+ received?: string;
1359
+ }
1360
+ interface ValidationResult {
1361
+ valid: boolean;
1362
+ errors: ValidationError[];
1363
+ }
1364
+ /**
1365
+ * Validate a WebSocket request message
1366
+ */
1367
+ declare function validateRequest(msg: unknown): ValidationResult;
1368
+ /**
1369
+ * Validate request params for a specific method
1370
+ */
1371
+ declare function validateMethodParams(method: string, params: unknown): ValidationResult;
1372
+ /**
1373
+ * Validate a WebSocket response message
1374
+ */
1375
+ declare function validateResponse(msg: unknown): ValidationResult;
1376
+ /**
1377
+ * Validate a WebSocket event message
1378
+ */
1379
+ declare function validateEvent(msg: unknown): ValidationResult;
1380
+ /**
1381
+ * Format validation errors for display
1382
+ */
1383
+ declare function formatValidationErrors(errors: ValidationError[]): string;
1384
+ declare const availableMethods: WSMethod[];
1385
+ declare const availableEvents: WSEventType[];
1386
+
1387
+ /**
1388
+ * DiscoveryLab WebSocket Protocol
1389
+ *
1390
+ * Typed WebSocket protocol inspired by Clawdbot's gateway pattern.
1391
+ *
1392
+ * Usage:
1393
+ * import { createRequest, createResponse, createEvent, validateRequest } from './protocol';
1394
+ *
1395
+ * // Create typed messages
1396
+ * const req = createRequest('recorder.start', { name: 'test', url: 'https://example.com' });
1397
+ * const res = createResponse(req.id, true, { id: '123', ... });
1398
+ * const evt = createEvent('action', { id: '1', type: 'click', ... });
1399
+ *
1400
+ * // Validate incoming messages
1401
+ * const result = validateRequest(incomingMsg);
1402
+ * if (!result.valid) console.error(formatValidationErrors(result.errors));
1403
+ */
1404
+
1405
+ /**
1406
+ * Create a typed request message
1407
+ */
1408
+ declare function createRequest<M extends keyof WSMethodMap>(method: M, params: WSMethodMap[M]['params']): WSRequest<WSMethodMap[M]['params']>;
1409
+ /**
1410
+ * Create a typed response message
1411
+ */
1412
+ declare function createResponse<T>(id: string, ok: true, payload: T): WSResponse<T>;
1413
+ declare function createResponse(id: string, ok: false, error: string): WSResponse<never>;
1414
+ /**
1415
+ * Create a typed event message
1416
+ */
1417
+ declare function createEvent<E extends keyof WSEventMap>(event: E, payload: WSEventMap[E], seq?: number): WSEvent<WSEventMap[E]>;
1418
+ /**
1419
+ * Get next event sequence number
1420
+ */
1421
+ declare function nextEventSeq(): number;
1422
+ /**
1423
+ * Reset event sequence (for testing)
1424
+ */
1425
+ declare function resetEventSeq(): void;
1426
+
1427
+ /**
1428
+ * DiscoveryLab Skills System - Types
1429
+ *
1430
+ * Inspired by Clawdbot's SKILL.md pattern.
1431
+ * Skills are self-describing tools with metadata and dependency gating.
1432
+ */
1433
+ interface SkillRequirements {
1434
+ /** Required binary executables (e.g., ['ffmpeg', 'maestro']) */
1435
+ bins?: string[];
1436
+ /** Required environment variables (e.g., ['ANTHROPIC_API_KEY']) */
1437
+ env?: string[];
1438
+ /** Required npm packages (for runtime checking) */
1439
+ packages?: string[];
1440
+ }
1441
+ interface SkillInstallInfo {
1442
+ /** Homebrew package name */
1443
+ brew?: string;
1444
+ /** APT package name */
1445
+ apt?: string;
1446
+ /** npm package name */
1447
+ npm?: string;
1448
+ /** Manual install instructions */
1449
+ manual?: string;
1450
+ }
1451
+ interface SkillMetadata {
1452
+ /** Unique skill name (e.g., 'maestro', 'playwright') */
1453
+ name: string;
1454
+ /** Short description for tool listing */
1455
+ description: string;
1456
+ /** Emoji icon for UI display */
1457
+ emoji?: string;
1458
+ /** Version string */
1459
+ version?: string;
1460
+ /** Author name */
1461
+ author?: string;
1462
+ /** Skill category */
1463
+ category?: SkillCategory;
1464
+ /** Dependency requirements */
1465
+ requires?: SkillRequirements;
1466
+ /** Supported operating systems */
1467
+ os?: SupportedOS[];
1468
+ /** Always load regardless of dependencies */
1469
+ always?: boolean;
1470
+ /** Installation instructions */
1471
+ install?: SkillInstallInfo;
1472
+ /** Related tools exported by this skill */
1473
+ tools?: string[];
1474
+ /** Tags for discovery */
1475
+ tags?: string[];
1476
+ }
1477
+ type SkillCategory = 'testing' | 'capture' | 'analyze' | 'export' | 'canvas' | 'integrations' | 'ui' | 'project' | 'setup';
1478
+ type SupportedOS = 'darwin' | 'linux' | 'win32';
1479
+ interface Skill {
1480
+ /** Parsed metadata from SKILL.md frontmatter */
1481
+ metadata: SkillMetadata;
1482
+ /** Full markdown content (instructions) */
1483
+ content: string;
1484
+ /** Path to SKILL.md file */
1485
+ path: string;
1486
+ /** Whether skill is currently available (deps satisfied) */
1487
+ available: boolean;
1488
+ /** Reasons why skill is unavailable */
1489
+ unavailableReasons?: string[];
1490
+ }
1491
+ interface SkillLoadResult {
1492
+ /** Successfully loaded skills */
1493
+ loaded: Skill[];
1494
+ /** Skills that failed to load */
1495
+ failed: Array<{
1496
+ path: string;
1497
+ error: string;
1498
+ }>;
1499
+ /** Skills unavailable due to missing dependencies */
1500
+ unavailable: Skill[];
1501
+ }
1502
+ interface GatingResult {
1503
+ /** Whether all requirements are met */
1504
+ satisfied: boolean;
1505
+ /** Missing binary executables */
1506
+ missingBins: string[];
1507
+ /** Missing environment variables */
1508
+ missingEnv: string[];
1509
+ /** OS mismatch */
1510
+ osUnsupported: boolean;
1511
+ /** Human-readable summary */
1512
+ summary: string;
1513
+ }
1514
+ interface SkillRegistry {
1515
+ /** All discovered skills */
1516
+ skills: Map<string, Skill>;
1517
+ /** Get available skills only */
1518
+ getAvailable(): Skill[];
1519
+ /** Get skill by name */
1520
+ get(name: string): Skill | undefined;
1521
+ /** Check if skill is available */
1522
+ isAvailable(name: string): boolean;
1523
+ /** Reload all skills */
1524
+ reload(): Promise<SkillLoadResult>;
1525
+ }
1526
+
1527
+ /**
1528
+ * DiscoveryLab Skills System - SKILL.md Parser
1529
+ *
1530
+ * Parses SKILL.md files with YAML frontmatter.
1531
+ *
1532
+ * Format:
1533
+ * ```
1534
+ * ---
1535
+ * name: skill-name
1536
+ * description: Brief description
1537
+ * emoji: "🎯"
1538
+ * requires:
1539
+ * bins: [ffmpeg]
1540
+ * env: [API_KEY]
1541
+ * os: [darwin, linux]
1542
+ * ---
1543
+ *
1544
+ * # Skill Instructions
1545
+ *
1546
+ * Markdown content...
1547
+ * ```
1548
+ */
1549
+
1550
+ interface ParsedSkillMd {
1551
+ metadata: SkillMetadata;
1552
+ content: string;
1553
+ }
1554
+ /**
1555
+ * Parse SKILL.md file content
1556
+ */
1557
+ declare function parseSkillMd(fileContent: string, filePath: string): ParsedSkillMd;
1558
+ /**
1559
+ * Read and parse SKILL.md file from disk
1560
+ */
1561
+ declare function readSkillMd(filePath: string): Promise<ParsedSkillMd>;
1562
+ /**
1563
+ * Generate SKILL.md content from metadata
1564
+ */
1565
+ declare function generateSkillMd(metadata: SkillMetadata, content: string): string;
1566
+
1567
+ /**
1568
+ * DiscoveryLab Skills System - Dependency Gating
1569
+ *
1570
+ * Checks if skill requirements are satisfied:
1571
+ * - Binary executables (bins)
1572
+ * - Environment variables (env)
1573
+ * - Operating system (os)
1574
+ *
1575
+ * Inspired by Clawdbot's dependency gating pattern.
1576
+ */
1577
+
1578
+ /**
1579
+ * Check if a binary exists in PATH
1580
+ */
1581
+ declare function checkBinary(name: string): boolean;
1582
+ /**
1583
+ * Check multiple binaries
1584
+ */
1585
+ declare function checkBinaries(bins: string[]): string[];
1586
+ /**
1587
+ * Check if an environment variable is set
1588
+ */
1589
+ declare function checkEnvVar(name: string): boolean;
1590
+ /**
1591
+ * Check multiple environment variables
1592
+ */
1593
+ declare function checkEnvVars(envs: string[]): string[];
1594
+ /**
1595
+ * Get current OS as SupportedOS type
1596
+ */
1597
+ declare function getCurrentOS(): SupportedOS;
1598
+ /**
1599
+ * Check if current OS is supported
1600
+ */
1601
+ declare function checkOS(supportedOS: SupportedOS[]): boolean;
1602
+ /**
1603
+ * Check all requirements for a skill
1604
+ */
1605
+ declare function checkSkillRequirements(metadata: SkillMetadata): GatingResult;
1606
+ /**
1607
+ * Get install instructions for missing dependencies
1608
+ */
1609
+ declare function getInstallInstructions(metadata: SkillMetadata, result: GatingResult): string[];
1610
+
1611
+ /**
1612
+ * DiscoveryLab Skills System - Loader
1613
+ *
1614
+ * Discovers and loads SKILL.md files from various locations:
1615
+ * 1. Bundled skills: src/mcp/tools/[name]/SKILL.md
1616
+ * 2. User skills: ~/.discoverylab/skills/[name]/SKILL.md
1617
+ * 3. Workspace skills: ./.discoverylab/skills/[name]/SKILL.md
1618
+ *
1619
+ * Inspired by Clawdbot's hierarchical skill loading.
1620
+ */
1621
+
1622
+ /**
1623
+ * Load all skills from discovered files
1624
+ * Later sources override earlier ones (workspace > user > bundled)
1625
+ */
1626
+ declare function loadSkills(): Promise<SkillLoadResult>;
1627
+ /**
1628
+ * Create a skill registry
1629
+ */
1630
+ declare function createSkillRegistry(): SkillRegistry;
1631
+ /**
1632
+ * Get the global skill registry (lazy initialization)
1633
+ */
1634
+ declare function getSkillRegistry(): Promise<SkillRegistry>;
1635
+ /**
1636
+ * Reload the global skill registry
1637
+ */
1638
+ declare function reloadSkillRegistry(): Promise<SkillLoadResult>;
1639
+ /**
1640
+ * Get skill info for display
1641
+ */
1642
+ declare function formatSkillInfo(skill: Skill): string;
1643
+ /**
1644
+ * List all skills with their status
1645
+ */
1646
+ declare function formatSkillList(skills: Skill[]): string;
1647
+
1648
+ export { type ActionEventPayload, type ConnectedEventPayload, type ErrorEventPayload, type ExportDestination, type ExportRule, type Frame, type GatingResult, type LiveFrameEventPayload, type LiveStreamStartParams, type LiveStreamStartResponse, type LiveStreamStopParams, type LiveStreamStopResponse, type LiveStreamTapParams, type NewExportDestination, type NewExportRule, type NewFrame, type NewProject, type NewProjectExport, type NewSetting, type ParsedSkillMd, type PingParams, type PingResponse, type Project, type ProjectCreateParams, type ProjectDeleteParams, type ProjectExport, type ProjectGetParams, type ProjectListParams, type RecorderStartParams, type RecorderStartResponse, type RecorderStatusParams, type RecorderStopParams, type RecorderStopResponse, type ScreenshotEventPayload, type SessionEventPayload, type Setting, type Skill, type SkillCategory, type SkillInstallInfo, type SkillLoadResult, type SkillMetadata, type SkillRegistry, type SkillRequirements, type StatusEventPayload, type SupportedOS, type ValidationError, type ValidationResult, type WSEvent, type WSEventMap, type WSEventType, type WSMessage, type WSMethod, type WSMethodMap, type WSRequest, type WSResponse, availableEvents, availableMethods, checkBinaries, checkBinary, checkEnvVar, checkEnvVars, checkOS, checkSkillRequirements, closeDatabase, createEvent, createRequest, createResponse, createSkillRegistry, exportDestinations, exportRules, formatSkillInfo, formatSkillList, formatValidationErrors, frames, generateSkillMd, getCurrentOS, getDatabase, getInstallInstructions, getSkillRegistry, isWSEvent, isWSMessage, isWSRequest, isWSResponse, loadSkills, mcpServer, nextEventSeq, parseSkillMd, projectExports, projects, readSkillMd, reloadSkillRegistry, resetEventSeq, schemas, settings, startServer, stopServer, validateEvent, validateMethodParams, validateRequest, validateResponse };