@veolab/discoverylab 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/chunk-2OGZX6C4.js +588 -0
  2. package/dist/chunk-43U6UYV7.js +590 -0
  3. package/dist/chunk-4H2E3K2G.js +7638 -0
  4. package/dist/chunk-4KLG6DDE.js +334 -0
  5. package/dist/chunk-4NNTRJOI.js +7791 -0
  6. package/dist/chunk-5F76VWME.js +6397 -0
  7. package/dist/chunk-5NEFN42O.js +7791 -0
  8. package/dist/chunk-63MEQ6UH.js +7673 -0
  9. package/dist/chunk-C7QUR7XX.js +6397 -0
  10. package/dist/chunk-GGJJUCFK.js +7160 -0
  11. package/dist/chunk-GLHOY3NN.js +7805 -0
  12. package/dist/chunk-GSWHWEYC.js +1346 -0
  13. package/dist/chunk-HDKEQOF5.js +7788 -0
  14. package/dist/chunk-HZGSWVVS.js +7111 -0
  15. package/dist/chunk-I6YD3QFM.js +500 -0
  16. package/dist/chunk-IRKQG33A.js +7054 -0
  17. package/dist/chunk-KV7KDJ43.js +7639 -0
  18. package/dist/chunk-L4SA5F5W.js +6397 -0
  19. package/dist/chunk-MFFPQLU4.js +7102 -0
  20. package/dist/chunk-MJS2YKNR.js +6397 -0
  21. package/dist/chunk-NDBW6ELQ.js +7638 -0
  22. package/dist/chunk-P4S7ZY6G.js +7638 -0
  23. package/dist/chunk-PMTGGZ7R.js +6397 -0
  24. package/dist/chunk-PYUCY3U6.js +1340 -0
  25. package/dist/chunk-RDZDSOAL.js +7750 -0
  26. package/dist/chunk-SLNJEF32.js +91 -0
  27. package/dist/chunk-SR67SRIT.js +1336 -0
  28. package/dist/chunk-TAODYZ52.js +1393 -0
  29. package/dist/chunk-TBG76CYG.js +6395 -0
  30. package/dist/chunk-TJ3H23LL.js +362 -0
  31. package/dist/chunk-XIBF5LBD.js +6395 -0
  32. package/dist/chunk-XUKWS2CE.js +7805 -0
  33. package/dist/cli.js +6 -6
  34. package/dist/db-ADBEBNH6.js +35 -0
  35. package/dist/index.d.ts +170 -1
  36. package/dist/index.html +1168 -106
  37. package/dist/index.js +9 -7
  38. package/dist/playwright-ATDC4NYW.js +38 -0
  39. package/dist/playwright-E6EUFIJG.js +38 -0
  40. package/dist/playwright-R7Y5HREH.js +39 -0
  41. package/dist/server-2VKO76UK.js +14 -0
  42. package/dist/server-3BK2VFU7.js +13 -0
  43. package/dist/server-6IPHVUYT.js +14 -0
  44. package/dist/server-73P7M3QB.js +14 -0
  45. package/dist/server-BPVRW5LJ.js +14 -0
  46. package/dist/server-F3YPX6ET.js +13 -0
  47. package/dist/server-IOOZK4NP.js +14 -0
  48. package/dist/server-J52LMTBT.js +13 -0
  49. package/dist/server-NPZN3FWO.js +14 -0
  50. package/dist/server-O5FIAHSY.js +14 -0
  51. package/dist/server-P27BZXBL.js +14 -0
  52. package/dist/server-S6B5WUBT.js +14 -0
  53. package/dist/server-SRYNSGSP.js +14 -0
  54. package/dist/server-X3TLP6DX.js +14 -0
  55. package/dist/server-ZBPQ33V6.js +14 -0
  56. package/dist/setup-AQX4JQVR.js +17 -0
  57. package/dist/tools-2KPB37GK.js +178 -0
  58. package/dist/tools-3H6IOWXV.js +178 -0
  59. package/dist/tools-BUVCUCRL.js +178 -0
  60. package/dist/tools-HDNODRS6.js +178 -0
  61. package/dist/tools-L6PKKQPY.js +179 -0
  62. package/dist/tools-N5N2IO7V.js +178 -0
  63. package/dist/tools-TLCKABUW.js +178 -0
  64. package/package.json +1 -1
@@ -0,0 +1,362 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // src/db/index.ts
6
+ import Database from "better-sqlite3";
7
+ import { drizzle } from "drizzle-orm/better-sqlite3";
8
+ import { mkdirSync, existsSync } from "fs";
9
+ import { join } from "path";
10
+ import { homedir } from "os";
11
+
12
+ // src/db/schema.ts
13
+ var schema_exports = {};
14
+ __export(schema_exports, {
15
+ exportDestinations: () => exportDestinations,
16
+ exportRules: () => exportRules,
17
+ frames: () => frames,
18
+ projectExports: () => projectExports,
19
+ projects: () => projects,
20
+ settings: () => settings,
21
+ testVariables: () => testVariables
22
+ });
23
+ import { sqliteTable, text, integer, real } from "drizzle-orm/sqlite-core";
24
+ var projects = sqliteTable("projects", {
25
+ id: text("id").primaryKey(),
26
+ name: text("name").notNull(),
27
+ // Source
28
+ videoPath: text("video_path"),
29
+ thumbnailPath: text("thumbnail_path"),
30
+ // Best frame or image for project cover
31
+ platform: text("platform"),
32
+ // 'ios' | 'android' | 'web'
33
+ // Analysis
34
+ aiSummary: text("ai_summary"),
35
+ ocrText: text("ocr_text"),
36
+ ocrEngine: text("ocr_engine"),
37
+ ocrConfidence: real("ocr_confidence"),
38
+ frameCount: integer("frame_count").default(0),
39
+ duration: real("duration"),
40
+ // seconds
41
+ // Annotations
42
+ manualNotes: text("manual_notes"),
43
+ tags: text("tags"),
44
+ // JSON array
45
+ linkedTicket: text("linked_ticket"),
46
+ // e.g., "ABC-123"
47
+ // External integrations (legacy single URLs - maintained for backwards compatibility)
48
+ linkedJiraUrl: text("linked_jira_url"),
49
+ // Full Jira issue URL
50
+ linkedNotionUrl: text("linked_notion_url"),
51
+ // Notion page URL
52
+ linkedFigmaUrl: text("linked_figma_url"),
53
+ // Figma design URL (auto-detected from Jira or manual)
54
+ // Task Hub - Multiple links with metadata (JSON array)
55
+ taskHubLinks: text("task_hub_links"),
56
+ // JSON: [{ id, type, url, title, status, metadata }]
57
+ taskRequirements: text("task_requirements"),
58
+ // AI-generated requirements from linked content
59
+ taskTestMap: text("task_test_map"),
60
+ // AI-generated test map from linked content
61
+ // Status
62
+ status: text("status").default("draft"),
63
+ // 'draft' | 'analyzed' | 'exported' | 'archived'
64
+ // Timestamps
65
+ createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
66
+ updatedAt: integer("updated_at", { mode: "timestamp" }).notNull()
67
+ });
68
+ var projectExports = sqliteTable("project_exports", {
69
+ id: text("id").primaryKey(),
70
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
71
+ // Destination
72
+ destination: text("destination").notNull(),
73
+ // 'notion' | 'drive' | 'jira' | 'slack' | 'local'
74
+ destinationUrl: text("destination_url"),
75
+ destinationPath: text("destination_path"),
76
+ // Content included
77
+ contentIncluded: text("content_included"),
78
+ // JSON: { video, keyFrames, aiSummary, manualNotes }
79
+ // Status
80
+ status: text("status").default("pending"),
81
+ // 'pending' | 'in_progress' | 'completed' | 'failed'
82
+ errorMessage: text("error_message"),
83
+ // Timestamps
84
+ exportedAt: integer("exported_at", { mode: "timestamp" }),
85
+ createdAt: integer("created_at", { mode: "timestamp" }).notNull()
86
+ });
87
+ var frames = sqliteTable("frames", {
88
+ id: text("id").primaryKey(),
89
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
90
+ // Frame data
91
+ frameNumber: integer("frame_number").notNull(),
92
+ timestamp: real("timestamp").notNull(),
93
+ // seconds
94
+ imagePath: text("image_path").notNull(),
95
+ // Analysis
96
+ ocrText: text("ocr_text"),
97
+ isKeyFrame: integer("is_key_frame", { mode: "boolean" }).default(false),
98
+ // Timestamps
99
+ createdAt: integer("created_at", { mode: "timestamp" }).notNull()
100
+ });
101
+ var settings = sqliteTable("settings", {
102
+ key: text("key").primaryKey(),
103
+ value: text("value").notNull(),
104
+ updatedAt: integer("updated_at", { mode: "timestamp" }).notNull()
105
+ });
106
+ var testVariables = sqliteTable("test_variables", {
107
+ id: text("id").primaryKey(),
108
+ ownerId: text("owner_id").notNull(),
109
+ // recording ID, project ID, etc.
110
+ ownerType: text("owner_type").notNull(),
111
+ // 'mobile-recording' | 'web-recording' | 'project'
112
+ key: text("key").notNull(),
113
+ valueEncrypted: text("value_encrypted").notNull(),
114
+ isSecret: integer("is_secret", { mode: "boolean" }).default(true),
115
+ platform: text("platform").default("both"),
116
+ // 'mobile' | 'web' | 'both'
117
+ notes: text("notes"),
118
+ createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
119
+ updatedAt: integer("updated_at", { mode: "timestamp" }).notNull()
120
+ });
121
+ var exportDestinations = sqliteTable("export_destinations", {
122
+ id: text("id").primaryKey(),
123
+ // Destination config
124
+ type: text("type").notNull(),
125
+ // 'notion' | 'drive' | 'jira' | 'slack'
126
+ name: text("name").notNull(),
127
+ // User-friendly name
128
+ // Configuration (JSON)
129
+ config: text("config"),
130
+ // { workspaceUrl, folderId, projectKey, channelId, etc. }
131
+ // Status
132
+ isActive: integer("is_active", { mode: "boolean" }).default(true),
133
+ lastUsedAt: integer("last_used_at", { mode: "timestamp" }),
134
+ // Timestamps
135
+ createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
136
+ updatedAt: integer("updated_at", { mode: "timestamp" }).notNull()
137
+ });
138
+ var exportRules = sqliteTable("export_rules", {
139
+ id: text("id").primaryKey(),
140
+ // Rule definition
141
+ name: text("name").notNull(),
142
+ destinationId: text("destination_id").notNull().references(() => exportDestinations.id, { onDelete: "cascade" }),
143
+ // Trigger conditions (JSON)
144
+ conditions: text("conditions"),
145
+ // { tags: ['feature'], status: 'analyzed', platform: 'ios' }
146
+ // Content to include (JSON)
147
+ contentIncluded: text("content_included"),
148
+ // { video: true, keyFrames: true, aiSummary: true }
149
+ // Status
150
+ isActive: integer("is_active", { mode: "boolean" }).default(true),
151
+ // Timestamps
152
+ createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
153
+ updatedAt: integer("updated_at", { mode: "timestamp" }).notNull()
154
+ });
155
+
156
+ // src/db/index.ts
157
+ var DATA_DIR = join(homedir(), ".discoverylab");
158
+ var DB_PATH = join(DATA_DIR, "data.db");
159
+ var PROJECTS_DIR = join(DATA_DIR, "projects");
160
+ var EXPORTS_DIR = join(DATA_DIR, "exports");
161
+ var FRAMES_DIR = join(DATA_DIR, "frames");
162
+ function ensureDirectories() {
163
+ const dirs = [DATA_DIR, PROJECTS_DIR, EXPORTS_DIR, FRAMES_DIR];
164
+ for (const dir of dirs) {
165
+ if (!existsSync(dir)) {
166
+ mkdirSync(dir, { recursive: true });
167
+ }
168
+ }
169
+ }
170
+ function createTables(sqlite) {
171
+ sqlite.exec(`
172
+ CREATE TABLE IF NOT EXISTS projects (
173
+ id TEXT PRIMARY KEY,
174
+ name TEXT NOT NULL,
175
+ video_path TEXT,
176
+ thumbnail_path TEXT,
177
+ platform TEXT,
178
+ ai_summary TEXT,
179
+ ocr_text TEXT,
180
+ ocr_engine TEXT,
181
+ ocr_confidence REAL,
182
+ frame_count INTEGER DEFAULT 0,
183
+ duration REAL,
184
+ manual_notes TEXT,
185
+ tags TEXT,
186
+ linked_ticket TEXT,
187
+ linked_jira_url TEXT,
188
+ linked_notion_url TEXT,
189
+ linked_figma_url TEXT,
190
+ task_hub_links TEXT,
191
+ task_requirements TEXT,
192
+ task_test_map TEXT,
193
+ status TEXT DEFAULT 'draft',
194
+ created_at INTEGER NOT NULL,
195
+ updated_at INTEGER NOT NULL
196
+ )
197
+ `);
198
+ try {
199
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN thumbnail_path TEXT`);
200
+ } catch (e) {
201
+ }
202
+ try {
203
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN linked_jira_url TEXT`);
204
+ } catch (e) {
205
+ }
206
+ try {
207
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN linked_notion_url TEXT`);
208
+ } catch (e) {
209
+ }
210
+ try {
211
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN linked_figma_url TEXT`);
212
+ } catch (e) {
213
+ }
214
+ try {
215
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN task_hub_links TEXT`);
216
+ } catch (e) {
217
+ }
218
+ try {
219
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN task_requirements TEXT`);
220
+ } catch (e) {
221
+ }
222
+ try {
223
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN task_test_map TEXT`);
224
+ } catch (e) {
225
+ }
226
+ try {
227
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN ocr_engine TEXT`);
228
+ } catch (e) {
229
+ }
230
+ try {
231
+ sqlite.exec(`ALTER TABLE projects ADD COLUMN ocr_confidence REAL`);
232
+ } catch (e) {
233
+ }
234
+ sqlite.exec(`
235
+ CREATE TABLE IF NOT EXISTS project_exports (
236
+ id TEXT PRIMARY KEY,
237
+ project_id TEXT NOT NULL,
238
+ destination TEXT NOT NULL,
239
+ destination_url TEXT,
240
+ destination_path TEXT,
241
+ content_included TEXT,
242
+ status TEXT DEFAULT 'pending',
243
+ error_message TEXT,
244
+ exported_at INTEGER,
245
+ created_at INTEGER NOT NULL,
246
+ FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
247
+ )
248
+ `);
249
+ sqlite.exec(`
250
+ CREATE TABLE IF NOT EXISTS frames (
251
+ id TEXT PRIMARY KEY,
252
+ project_id TEXT NOT NULL,
253
+ frame_number INTEGER NOT NULL,
254
+ timestamp REAL NOT NULL,
255
+ image_path TEXT NOT NULL,
256
+ ocr_text TEXT,
257
+ is_key_frame INTEGER DEFAULT 0,
258
+ created_at INTEGER NOT NULL,
259
+ FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
260
+ )
261
+ `);
262
+ sqlite.exec(`
263
+ CREATE TABLE IF NOT EXISTS settings (
264
+ key TEXT PRIMARY KEY,
265
+ value TEXT NOT NULL,
266
+ updated_at INTEGER NOT NULL
267
+ )
268
+ `);
269
+ sqlite.exec(`
270
+ CREATE TABLE IF NOT EXISTS test_variables (
271
+ id TEXT PRIMARY KEY,
272
+ owner_id TEXT NOT NULL,
273
+ owner_type TEXT NOT NULL,
274
+ key TEXT NOT NULL,
275
+ value_encrypted TEXT NOT NULL,
276
+ is_secret INTEGER DEFAULT 1,
277
+ platform TEXT DEFAULT 'both',
278
+ notes TEXT,
279
+ created_at INTEGER NOT NULL,
280
+ updated_at INTEGER NOT NULL,
281
+ UNIQUE(owner_id, owner_type, key)
282
+ )
283
+ `);
284
+ sqlite.exec(`
285
+ CREATE TABLE IF NOT EXISTS export_destinations (
286
+ id TEXT PRIMARY KEY,
287
+ type TEXT NOT NULL,
288
+ name TEXT NOT NULL,
289
+ config TEXT,
290
+ is_active INTEGER DEFAULT 1,
291
+ last_used_at INTEGER,
292
+ created_at INTEGER NOT NULL,
293
+ updated_at INTEGER NOT NULL
294
+ )
295
+ `);
296
+ sqlite.exec(`
297
+ CREATE TABLE IF NOT EXISTS export_rules (
298
+ id TEXT PRIMARY KEY,
299
+ name TEXT NOT NULL,
300
+ destination_id TEXT NOT NULL,
301
+ conditions TEXT,
302
+ content_included TEXT,
303
+ is_active INTEGER DEFAULT 1,
304
+ created_at INTEGER NOT NULL,
305
+ updated_at INTEGER NOT NULL,
306
+ FOREIGN KEY (destination_id) REFERENCES export_destinations(id) ON DELETE CASCADE
307
+ )
308
+ `);
309
+ sqlite.exec(`
310
+ CREATE INDEX IF NOT EXISTS idx_projects_status ON projects(status);
311
+ CREATE INDEX IF NOT EXISTS idx_projects_platform ON projects(platform);
312
+ CREATE INDEX IF NOT EXISTS idx_project_exports_project_id ON project_exports(project_id);
313
+ CREATE INDEX IF NOT EXISTS idx_project_exports_destination ON project_exports(destination);
314
+ CREATE INDEX IF NOT EXISTS idx_frames_project_id ON frames(project_id);
315
+ CREATE INDEX IF NOT EXISTS idx_frames_is_key_frame ON frames(is_key_frame);
316
+ CREATE INDEX IF NOT EXISTS idx_test_variables_owner ON test_variables(owner_id, owner_type);
317
+ `);
318
+ }
319
+ var _db = null;
320
+ var _sqlite = null;
321
+ function getDatabase() {
322
+ if (!_db) {
323
+ ensureDirectories();
324
+ _sqlite = new Database(DB_PATH);
325
+ _sqlite.pragma("journal_mode = WAL");
326
+ _sqlite.pragma("foreign_keys = ON");
327
+ createTables(_sqlite);
328
+ _db = drizzle(_sqlite, { schema: schema_exports });
329
+ }
330
+ return _db;
331
+ }
332
+ function getSqlite() {
333
+ if (!_sqlite) {
334
+ getDatabase();
335
+ }
336
+ return _sqlite;
337
+ }
338
+ function closeDatabase() {
339
+ if (_sqlite) {
340
+ _sqlite.close();
341
+ _sqlite = null;
342
+ _db = null;
343
+ }
344
+ }
345
+
346
+ export {
347
+ projects,
348
+ projectExports,
349
+ frames,
350
+ settings,
351
+ testVariables,
352
+ exportDestinations,
353
+ exportRules,
354
+ DATA_DIR,
355
+ DB_PATH,
356
+ PROJECTS_DIR,
357
+ EXPORTS_DIR,
358
+ FRAMES_DIR,
359
+ getDatabase,
360
+ getSqlite,
361
+ closeDatabase
362
+ };