@covibes/zeroshot 5.4.0 → 5.4.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 (136) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -465
  3. package/cli/index.js +101 -5231
  4. package/package.json +16 -130
  5. package/CHANGELOG.md +0 -537
  6. package/cli/commands/providers.js +0 -149
  7. package/cli/lib/first-run.js +0 -211
  8. package/cli/lib/update-checker.js +0 -281
  9. package/cli/message-formatter-utils.js +0 -75
  10. package/cli/message-formatters-normal.js +0 -275
  11. package/cli/message-formatters-watch.js +0 -181
  12. package/cluster-templates/base-templates/debug-workflow.json +0 -375
  13. package/cluster-templates/base-templates/full-workflow.json +0 -581
  14. package/cluster-templates/base-templates/single-worker.json +0 -63
  15. package/cluster-templates/base-templates/worker-validator.json +0 -208
  16. package/cluster-templates/conductor-bootstrap.json +0 -124
  17. package/docker/zeroshot-cluster/Dockerfile +0 -152
  18. package/docker/zeroshot-cluster/pre-baked-deps.json +0 -28
  19. package/lib/completion.js +0 -174
  20. package/lib/docker-config.js +0 -220
  21. package/lib/git-remote-utils.js +0 -165
  22. package/lib/id-detector.js +0 -56
  23. package/lib/provider-defaults.js +0 -62
  24. package/lib/provider-detection.js +0 -59
  25. package/lib/provider-names.js +0 -57
  26. package/lib/settings/claude-auth.js +0 -78
  27. package/lib/settings.js +0 -503
  28. package/lib/stream-json-parser.js +0 -10
  29. package/scripts/fix-node-pty-permissions.js +0 -75
  30. package/scripts/record-demo.sh +0 -279
  31. package/scripts/setup-merge-queue.sh +0 -170
  32. package/scripts/test-install.sh +0 -40
  33. package/scripts/validate-templates.js +0 -100
  34. package/src/agent/agent-config.js +0 -246
  35. package/src/agent/agent-context-builder.js +0 -444
  36. package/src/agent/agent-hook-executor.js +0 -599
  37. package/src/agent/agent-lifecycle.js +0 -743
  38. package/src/agent/agent-stuck-detector.js +0 -256
  39. package/src/agent/agent-task-executor.js +0 -1690
  40. package/src/agent/agent-trigger-evaluator.js +0 -67
  41. package/src/agent/output-extraction.js +0 -217
  42. package/src/agent/output-reformatter.js +0 -175
  43. package/src/agent/schema-utils.js +0 -146
  44. package/src/agent-wrapper.js +0 -579
  45. package/src/agents/git-pusher-template.js +0 -285
  46. package/src/attach/attach-client.js +0 -438
  47. package/src/attach/attach-server.js +0 -543
  48. package/src/attach/index.js +0 -35
  49. package/src/attach/protocol.js +0 -220
  50. package/src/attach/ring-buffer.js +0 -121
  51. package/src/attach/socket-discovery.js +0 -267
  52. package/src/claude-task-runner.js +0 -574
  53. package/src/config-router.js +0 -80
  54. package/src/config-validator.js +0 -1925
  55. package/src/copy-worker.js +0 -43
  56. package/src/input-helpers.js +0 -65
  57. package/src/isolation-manager.js +0 -1471
  58. package/src/issue-providers/README.md +0 -305
  59. package/src/issue-providers/azure-devops-provider.js +0 -273
  60. package/src/issue-providers/base-provider.js +0 -232
  61. package/src/issue-providers/github-provider.js +0 -179
  62. package/src/issue-providers/gitlab-provider.js +0 -241
  63. package/src/issue-providers/index.js +0 -196
  64. package/src/issue-providers/jira-provider.js +0 -239
  65. package/src/ledger.js +0 -631
  66. package/src/lib/safe-exec.js +0 -88
  67. package/src/logic-engine.js +0 -223
  68. package/src/message-bus-bridge.js +0 -139
  69. package/src/message-bus.js +0 -249
  70. package/src/name-generator.js +0 -232
  71. package/src/orchestrator.js +0 -2815
  72. package/src/preflight.js +0 -639
  73. package/src/process-metrics.js +0 -608
  74. package/src/providers/anthropic/cli-builder.js +0 -73
  75. package/src/providers/anthropic/index.js +0 -204
  76. package/src/providers/anthropic/models.js +0 -23
  77. package/src/providers/anthropic/output-parser.js +0 -177
  78. package/src/providers/base-provider.js +0 -251
  79. package/src/providers/capabilities.js +0 -60
  80. package/src/providers/google/cli-builder.js +0 -55
  81. package/src/providers/google/index.js +0 -116
  82. package/src/providers/google/models.js +0 -24
  83. package/src/providers/google/output-parser.js +0 -101
  84. package/src/providers/index.js +0 -91
  85. package/src/providers/openai/cli-builder.js +0 -133
  86. package/src/providers/openai/index.js +0 -136
  87. package/src/providers/openai/models.js +0 -21
  88. package/src/providers/openai/output-parser.js +0 -143
  89. package/src/providers/opencode/cli-builder.js +0 -42
  90. package/src/providers/opencode/index.js +0 -103
  91. package/src/providers/opencode/models.js +0 -55
  92. package/src/providers/opencode/output-parser.js +0 -122
  93. package/src/schemas/sub-cluster.js +0 -185
  94. package/src/status-footer.js +0 -1026
  95. package/src/sub-cluster-wrapper.js +0 -601
  96. package/src/task-runner.js +0 -30
  97. package/src/template-resolver.js +0 -372
  98. package/src/tui/CHANGES.txt +0 -133
  99. package/src/tui/LAYOUT.md +0 -261
  100. package/src/tui/README.txt +0 -192
  101. package/src/tui/TWO-LEVEL-NAVIGATION.md +0 -186
  102. package/src/tui/data-poller.js +0 -349
  103. package/src/tui/demo.js +0 -208
  104. package/src/tui/formatters.js +0 -129
  105. package/src/tui/index.js +0 -193
  106. package/src/tui/keybindings.js +0 -324
  107. package/src/tui/layout.js +0 -334
  108. package/src/tui/renderer.js +0 -184
  109. package/task-lib/attachable-watcher.js +0 -309
  110. package/task-lib/claude-recovery.js +0 -156
  111. package/task-lib/commands/clean.js +0 -50
  112. package/task-lib/commands/episodes.js +0 -105
  113. package/task-lib/commands/get-log-path.js +0 -23
  114. package/task-lib/commands/kill.js +0 -32
  115. package/task-lib/commands/list.js +0 -105
  116. package/task-lib/commands/logs.js +0 -453
  117. package/task-lib/commands/resume.js +0 -42
  118. package/task-lib/commands/run.js +0 -57
  119. package/task-lib/commands/schedule.js +0 -105
  120. package/task-lib/commands/scheduler-cmd.js +0 -96
  121. package/task-lib/commands/schedules.js +0 -148
  122. package/task-lib/commands/status.js +0 -44
  123. package/task-lib/commands/unschedule.js +0 -16
  124. package/task-lib/completion.js +0 -9
  125. package/task-lib/config.js +0 -8
  126. package/task-lib/name-generator.js +0 -230
  127. package/task-lib/package.json +0 -3
  128. package/task-lib/runner.js +0 -201
  129. package/task-lib/scheduler.js +0 -252
  130. package/task-lib/store.js +0 -529
  131. package/task-lib/tui/formatters.js +0 -215
  132. package/task-lib/tui/index.js +0 -197
  133. package/task-lib/tui/layout.js +0 -111
  134. package/task-lib/tui/renderer.js +0 -129
  135. package/task-lib/tui.js +0 -425
  136. package/task-lib/watcher.js +0 -226
package/task-lib/store.js DELETED
@@ -1,529 +0,0 @@
1
- /**
2
- * Task Store - SQLite-backed storage for tasks and schedules
3
- *
4
- * Uses WAL mode for concurrent access - no file locks needed.
5
- * Multiple processes can read/write simultaneously without contention.
6
- */
7
-
8
- import { existsSync, mkdirSync } from 'fs';
9
- import { join } from 'path';
10
- import Database from 'better-sqlite3';
11
- import { TASKS_DIR, LOGS_DIR } from './config.js';
12
- import { generateName } from './name-generator.js';
13
-
14
- const DB_FILE = join(TASKS_DIR, 'store.db');
15
-
16
- /** @type {Database.Database | null} */
17
- let db = null;
18
-
19
- /**
20
- * Get or create the database connection
21
- * @returns {Database.Database}
22
- */
23
- function getDb() {
24
- if (db) return db;
25
-
26
- ensureDirs();
27
-
28
- db = new Database(DB_FILE, { timeout: 5000 });
29
-
30
- // WAL mode for concurrent access - this is the key fix
31
- db.pragma('journal_mode = WAL');
32
- db.pragma('synchronous = NORMAL');
33
-
34
- // Create tables
35
- db.exec(`
36
- CREATE TABLE IF NOT EXISTS tasks (
37
- id TEXT PRIMARY KEY,
38
- prompt TEXT,
39
- full_prompt TEXT,
40
- cwd TEXT,
41
- status TEXT NOT NULL DEFAULT 'pending',
42
- pid INTEGER,
43
- session_id TEXT,
44
- log_file TEXT,
45
- created_at TEXT NOT NULL,
46
- updated_at TEXT NOT NULL,
47
- exit_code INTEGER,
48
- error TEXT,
49
- provider TEXT,
50
- model TEXT,
51
- schedule_id TEXT,
52
- socket_path TEXT,
53
- attachable INTEGER DEFAULT 0
54
- );
55
-
56
- CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);
57
- CREATE INDEX IF NOT EXISTS idx_tasks_created_at ON tasks(created_at);
58
-
59
- CREATE TABLE IF NOT EXISTS schedules (
60
- id TEXT PRIMARY KEY,
61
- cron TEXT NOT NULL,
62
- prompt TEXT NOT NULL,
63
- cwd TEXT,
64
- model TEXT,
65
- model_level TEXT,
66
- reasoning_effort TEXT,
67
- provider TEXT,
68
- enabled INTEGER DEFAULT 1,
69
- last_run TEXT,
70
- next_run TEXT,
71
- created_at TEXT NOT NULL,
72
- updated_at TEXT NOT NULL
73
- );
74
-
75
- CREATE INDEX IF NOT EXISTS idx_schedules_enabled ON schedules(enabled);
76
- `);
77
-
78
- return db;
79
- }
80
-
81
- export function ensureDirs() {
82
- if (!existsSync(TASKS_DIR)) mkdirSync(TASKS_DIR, { recursive: true });
83
- if (!existsSync(LOGS_DIR)) mkdirSync(LOGS_DIR, { recursive: true });
84
- }
85
-
86
- // ============================================================================
87
- // Tasks
88
- // ============================================================================
89
-
90
- /**
91
- * Convert DB row to task object (camelCase)
92
- */
93
- function rowToTask(row) {
94
- if (!row) return null;
95
- return {
96
- id: row.id,
97
- prompt: row.prompt,
98
- fullPrompt: row.full_prompt,
99
- cwd: row.cwd,
100
- status: row.status,
101
- pid: row.pid,
102
- sessionId: row.session_id,
103
- logFile: row.log_file,
104
- createdAt: row.created_at,
105
- updatedAt: row.updated_at,
106
- exitCode: row.exit_code,
107
- error: row.error,
108
- provider: row.provider,
109
- model: row.model,
110
- scheduleId: row.schedule_id,
111
- socketPath: row.socket_path,
112
- attachable: Boolean(row.attachable),
113
- };
114
- }
115
-
116
- /**
117
- * Load all tasks as object keyed by id
118
- * @returns {Object.<string, Object>}
119
- */
120
- export function loadTasks() {
121
- const rows = getDb().prepare('SELECT * FROM tasks ORDER BY created_at DESC').all();
122
- const tasks = {};
123
- for (const row of rows) {
124
- const task = rowToTask(row);
125
- tasks[task.id] = task;
126
- }
127
- return tasks;
128
- }
129
-
130
- /**
131
- * Save all tasks (replaces entire store - for migration compatibility)
132
- * @param {Object.<string, Object>} tasks
133
- */
134
- export function saveTasks(tasks) {
135
- const database = getDb();
136
- const insert = database.prepare(`
137
- INSERT OR REPLACE INTO tasks (
138
- id, prompt, full_prompt, cwd, status, pid, session_id, log_file,
139
- created_at, updated_at, exit_code, error, provider, model,
140
- schedule_id, socket_path, attachable
141
- ) VALUES (
142
- @id, @prompt, @fullPrompt, @cwd, @status, @pid, @sessionId, @logFile,
143
- @createdAt, @updatedAt, @exitCode, @error, @provider, @model,
144
- @scheduleId, @socketPath, @attachable
145
- )
146
- `);
147
-
148
- const insertMany = database.transaction((tasksObj) => {
149
- // Clear existing
150
- database.prepare('DELETE FROM tasks').run();
151
- // Insert all
152
- for (const task of Object.values(tasksObj)) {
153
- insert.run({
154
- id: task.id,
155
- prompt: task.prompt || null,
156
- fullPrompt: task.fullPrompt || null,
157
- cwd: task.cwd || null,
158
- status: task.status || 'pending',
159
- pid: task.pid || null,
160
- sessionId: task.sessionId || null,
161
- logFile: task.logFile || null,
162
- createdAt: task.createdAt || new Date().toISOString(),
163
- updatedAt: task.updatedAt || new Date().toISOString(),
164
- exitCode: task.exitCode ?? null,
165
- error: task.error || null,
166
- provider: task.provider || null,
167
- model: task.model || null,
168
- scheduleId: task.scheduleId || null,
169
- socketPath: task.socketPath || null,
170
- attachable: task.attachable ? 1 : 0,
171
- });
172
- }
173
- });
174
-
175
- insertMany(tasks);
176
- }
177
-
178
- /**
179
- * For API compatibility - just runs the modifier synchronously
180
- * SQLite WAL handles concurrency, no lock needed
181
- * @param {Function} modifier
182
- * @returns {any}
183
- */
184
- export function withTasksLock(modifier) {
185
- const tasks = loadTasks();
186
- const result = modifier(tasks);
187
- saveTasks(tasks);
188
- return result;
189
- }
190
-
191
- /**
192
- * Get a single task by id
193
- * @param {string} id
194
- * @returns {Object|null}
195
- */
196
- export function getTask(id) {
197
- const row = getDb().prepare('SELECT * FROM tasks WHERE id = ?').get(id);
198
- return rowToTask(row);
199
- }
200
-
201
- /**
202
- * Update a task
203
- * @param {string} id
204
- * @param {Object} updates
205
- * @returns {Object|null}
206
- */
207
- export function updateTask(id, updates) {
208
- const existing = getTask(id);
209
- if (!existing) return null;
210
-
211
- const updated = {
212
- ...existing,
213
- ...updates,
214
- updatedAt: new Date().toISOString(),
215
- };
216
-
217
- getDb()
218
- .prepare(
219
- `
220
- UPDATE tasks SET
221
- prompt = @prompt,
222
- full_prompt = @fullPrompt,
223
- cwd = @cwd,
224
- status = @status,
225
- pid = @pid,
226
- session_id = @sessionId,
227
- log_file = @logFile,
228
- updated_at = @updatedAt,
229
- exit_code = @exitCode,
230
- error = @error,
231
- provider = @provider,
232
- model = @model,
233
- schedule_id = @scheduleId,
234
- socket_path = @socketPath,
235
- attachable = @attachable
236
- WHERE id = @id
237
- `
238
- )
239
- .run({
240
- id: updated.id,
241
- prompt: updated.prompt || null,
242
- fullPrompt: updated.fullPrompt || null,
243
- cwd: updated.cwd || null,
244
- status: updated.status || 'pending',
245
- pid: updated.pid || null,
246
- sessionId: updated.sessionId || null,
247
- logFile: updated.logFile || null,
248
- updatedAt: updated.updatedAt,
249
- exitCode: updated.exitCode ?? null,
250
- error: updated.error || null,
251
- provider: updated.provider || null,
252
- model: updated.model || null,
253
- scheduleId: updated.scheduleId || null,
254
- socketPath: updated.socketPath || null,
255
- attachable: updated.attachable ? 1 : 0,
256
- });
257
-
258
- return updated;
259
- }
260
-
261
- /**
262
- * Add a new task
263
- * @param {Object} task
264
- * @returns {Object}
265
- */
266
- export function addTask(task) {
267
- const now = new Date().toISOString();
268
- const fullTask = {
269
- ...task,
270
- createdAt: task.createdAt || now,
271
- updatedAt: task.updatedAt || now,
272
- };
273
-
274
- getDb()
275
- .prepare(
276
- `
277
- INSERT INTO tasks (
278
- id, prompt, full_prompt, cwd, status, pid, session_id, log_file,
279
- created_at, updated_at, exit_code, error, provider, model,
280
- schedule_id, socket_path, attachable
281
- ) VALUES (
282
- @id, @prompt, @fullPrompt, @cwd, @status, @pid, @sessionId, @logFile,
283
- @createdAt, @updatedAt, @exitCode, @error, @provider, @model,
284
- @scheduleId, @socketPath, @attachable
285
- )
286
- `
287
- )
288
- .run({
289
- id: fullTask.id,
290
- prompt: fullTask.prompt || null,
291
- fullPrompt: fullTask.fullPrompt || null,
292
- cwd: fullTask.cwd || null,
293
- status: fullTask.status || 'pending',
294
- pid: fullTask.pid || null,
295
- sessionId: fullTask.sessionId || null,
296
- logFile: fullTask.logFile || null,
297
- createdAt: fullTask.createdAt,
298
- updatedAt: fullTask.updatedAt,
299
- exitCode: fullTask.exitCode ?? null,
300
- error: fullTask.error || null,
301
- provider: fullTask.provider || null,
302
- model: fullTask.model || null,
303
- scheduleId: fullTask.scheduleId || null,
304
- socketPath: fullTask.socketPath || null,
305
- attachable: fullTask.attachable ? 1 : 0,
306
- });
307
-
308
- return fullTask;
309
- }
310
-
311
- /**
312
- * Remove a task
313
- * @param {string} id
314
- */
315
- export function removeTask(id) {
316
- getDb().prepare('DELETE FROM tasks WHERE id = ?').run(id);
317
- }
318
-
319
- export function generateId() {
320
- return generateName('task');
321
- }
322
-
323
- export function generateScheduleId() {
324
- return generateName('sched');
325
- }
326
-
327
- // ============================================================================
328
- // Schedules
329
- // ============================================================================
330
-
331
- /**
332
- * Convert DB row to schedule object (camelCase)
333
- */
334
- function rowToSchedule(row) {
335
- if (!row) return null;
336
- return {
337
- id: row.id,
338
- cron: row.cron,
339
- prompt: row.prompt,
340
- cwd: row.cwd,
341
- model: row.model,
342
- modelLevel: row.model_level,
343
- reasoningEffort: row.reasoning_effort,
344
- provider: row.provider,
345
- enabled: Boolean(row.enabled),
346
- lastRun: row.last_run,
347
- nextRun: row.next_run,
348
- createdAt: row.created_at,
349
- updatedAt: row.updated_at,
350
- };
351
- }
352
-
353
- /**
354
- * Load all schedules as object keyed by id
355
- * @returns {Object.<string, Object>}
356
- */
357
- export function loadSchedules() {
358
- const rows = getDb().prepare('SELECT * FROM schedules ORDER BY created_at DESC').all();
359
- const schedules = {};
360
- for (const row of rows) {
361
- const schedule = rowToSchedule(row);
362
- schedules[schedule.id] = schedule;
363
- }
364
- return schedules;
365
- }
366
-
367
- /**
368
- * Save all schedules (replaces entire store)
369
- * @param {Object.<string, Object>} schedules
370
- */
371
- export function saveSchedules(schedules) {
372
- const database = getDb();
373
- const insert = database.prepare(`
374
- INSERT OR REPLACE INTO schedules (
375
- id, cron, prompt, cwd, model, model_level, reasoning_effort,
376
- provider, enabled, last_run, next_run, created_at, updated_at
377
- ) VALUES (
378
- @id, @cron, @prompt, @cwd, @model, @modelLevel, @reasoningEffort,
379
- @provider, @enabled, @lastRun, @nextRun, @createdAt, @updatedAt
380
- )
381
- `);
382
-
383
- const insertMany = database.transaction((schedulesObj) => {
384
- database.prepare('DELETE FROM schedules').run();
385
- for (const schedule of Object.values(schedulesObj)) {
386
- insert.run({
387
- id: schedule.id,
388
- cron: schedule.cron,
389
- prompt: schedule.prompt,
390
- cwd: schedule.cwd || null,
391
- model: schedule.model || null,
392
- modelLevel: schedule.modelLevel || null,
393
- reasoningEffort: schedule.reasoningEffort || null,
394
- provider: schedule.provider || null,
395
- enabled: schedule.enabled ? 1 : 0,
396
- lastRun: schedule.lastRun || null,
397
- nextRun: schedule.nextRun || null,
398
- createdAt: schedule.createdAt || new Date().toISOString(),
399
- updatedAt: schedule.updatedAt || new Date().toISOString(),
400
- });
401
- }
402
- });
403
-
404
- insertMany(schedules);
405
- }
406
-
407
- /**
408
- * Get a single schedule by id
409
- * @param {string} id
410
- * @returns {Object|null}
411
- */
412
- export function getSchedule(id) {
413
- const row = getDb().prepare('SELECT * FROM schedules WHERE id = ?').get(id);
414
- return rowToSchedule(row);
415
- }
416
-
417
- /**
418
- * Add a new schedule
419
- * @param {Object} schedule
420
- * @returns {Object}
421
- */
422
- export function addSchedule(schedule) {
423
- const now = new Date().toISOString();
424
- const fullSchedule = {
425
- ...schedule,
426
- createdAt: schedule.createdAt || now,
427
- updatedAt: schedule.updatedAt || now,
428
- };
429
-
430
- getDb()
431
- .prepare(
432
- `
433
- INSERT INTO schedules (
434
- id, cron, prompt, cwd, model, model_level, reasoning_effort,
435
- provider, enabled, last_run, next_run, created_at, updated_at
436
- ) VALUES (
437
- @id, @cron, @prompt, @cwd, @model, @modelLevel, @reasoningEffort,
438
- @provider, @enabled, @lastRun, @nextRun, @createdAt, @updatedAt
439
- )
440
- `
441
- )
442
- .run({
443
- id: fullSchedule.id,
444
- cron: fullSchedule.cron,
445
- prompt: fullSchedule.prompt,
446
- cwd: fullSchedule.cwd || null,
447
- model: fullSchedule.model || null,
448
- modelLevel: fullSchedule.modelLevel || null,
449
- reasoningEffort: fullSchedule.reasoningEffort || null,
450
- provider: fullSchedule.provider || null,
451
- enabled: fullSchedule.enabled !== false ? 1 : 0,
452
- lastRun: fullSchedule.lastRun || null,
453
- nextRun: fullSchedule.nextRun || null,
454
- createdAt: fullSchedule.createdAt,
455
- updatedAt: fullSchedule.updatedAt,
456
- });
457
-
458
- return fullSchedule;
459
- }
460
-
461
- /**
462
- * Update a schedule
463
- * @param {string} id
464
- * @param {Object} updates
465
- * @returns {Object|null}
466
- */
467
- export function updateSchedule(id, updates) {
468
- const existing = getSchedule(id);
469
- if (!existing) return null;
470
-
471
- const updated = {
472
- ...existing,
473
- ...updates,
474
- updatedAt: new Date().toISOString(),
475
- };
476
-
477
- getDb()
478
- .prepare(
479
- `
480
- UPDATE schedules SET
481
- cron = @cron,
482
- prompt = @prompt,
483
- cwd = @cwd,
484
- model = @model,
485
- model_level = @modelLevel,
486
- reasoning_effort = @reasoningEffort,
487
- provider = @provider,
488
- enabled = @enabled,
489
- last_run = @lastRun,
490
- next_run = @nextRun,
491
- updated_at = @updatedAt
492
- WHERE id = @id
493
- `
494
- )
495
- .run({
496
- id: updated.id,
497
- cron: updated.cron,
498
- prompt: updated.prompt,
499
- cwd: updated.cwd || null,
500
- model: updated.model || null,
501
- modelLevel: updated.modelLevel || null,
502
- reasoningEffort: updated.reasoningEffort || null,
503
- provider: updated.provider || null,
504
- enabled: updated.enabled ? 1 : 0,
505
- lastRun: updated.lastRun || null,
506
- nextRun: updated.nextRun || null,
507
- updatedAt: updated.updatedAt,
508
- });
509
-
510
- return updated;
511
- }
512
-
513
- /**
514
- * Remove a schedule
515
- * @param {string} id
516
- */
517
- export function removeSchedule(id) {
518
- getDb().prepare('DELETE FROM schedules WHERE id = ?').run(id);
519
- }
520
-
521
- /**
522
- * Close the database connection (for cleanup)
523
- */
524
- export function closeDb() {
525
- if (db) {
526
- db.close();
527
- db = null;
528
- }
529
- }