@hasna/todos 0.9.69 → 0.9.70
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.
- package/dashboard/dist/assets/index-DWpVlvWb.css +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/cli/index.js +311 -115
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/tasks.d.ts.map +1 -1
- package/dist/index.js +194 -82
- package/dist/lib/search.d.ts.map +1 -1
- package/dist/mcp/index.js +311 -115
- package/dist/server/index.js +159 -89
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/index-BXQ39iMX.css +0 -1
- /package/dashboard/dist/assets/{index-B-w1tUlm.js → index-DVzieYOj.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,eAAO,MAAM,mBAAmB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAoXtC,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAkBrD;AAkND,wBAAgB,aAAa,IAAI,IAAI,CAKpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,GAAG,IAAI,MAAM,CAE5B;AAED,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAK9D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,SAAa,GAAG,MAAM,CAG3D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAGpD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0B9F"}
|
package/dist/db/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/db/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EAEZ,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/db/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EAEZ,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAuC3B,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAoDtE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAK9D;AAED,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,EACV,EAAE,CAAC,EAAE,QAAQ,GACZ,iBAAiB,GAAG,IAAI,CAiD1B;AAED,wBAAgB,SAAS,CAAC,MAAM,GAAE,UAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE,CAiHxE;AAED,wBAAgB,U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,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CA+B/F;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EACxG,EAAE,CAAC,EAAE,QAAQ,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAuB9D"}
|
package/dist/index.js
CHANGED
|
@@ -510,6 +510,58 @@ var MIGRATIONS = [
|
|
|
510
510
|
ALTER TABLE task_comments ADD COLUMN type TEXT DEFAULT 'comment' CHECK(type IN ('comment', 'progress', 'note'));
|
|
511
511
|
ALTER TABLE task_comments ADD COLUMN progress_pct INTEGER CHECK(progress_pct IS NULL OR (progress_pct >= 0 AND progress_pct <= 100));
|
|
512
512
|
INSERT OR IGNORE INTO _migrations (id) VALUES (14);
|
|
513
|
+
`,
|
|
514
|
+
`
|
|
515
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS tasks_fts USING fts5(
|
|
516
|
+
task_id UNINDEXED,
|
|
517
|
+
title,
|
|
518
|
+
description,
|
|
519
|
+
tags,
|
|
520
|
+
tokenize='unicode61 remove_diacritics 2'
|
|
521
|
+
);
|
|
522
|
+
|
|
523
|
+
INSERT INTO tasks_fts(rowid, task_id, title, description, tags)
|
|
524
|
+
SELECT t.rowid, t.id, t.title, COALESCE(t.description, ''),
|
|
525
|
+
COALESCE((SELECT GROUP_CONCAT(tag, ' ') FROM task_tags WHERE task_id = t.id), '')
|
|
526
|
+
FROM tasks t;
|
|
527
|
+
|
|
528
|
+
CREATE TRIGGER IF NOT EXISTS tasks_fts_ai AFTER INSERT ON tasks BEGIN
|
|
529
|
+
INSERT INTO tasks_fts(rowid, task_id, title, description, tags)
|
|
530
|
+
VALUES (new.rowid, new.id, new.title, COALESCE(new.description, ''), '');
|
|
531
|
+
END;
|
|
532
|
+
|
|
533
|
+
CREATE TRIGGER IF NOT EXISTS tasks_fts_ad AFTER DELETE ON tasks BEGIN
|
|
534
|
+
DELETE FROM tasks_fts WHERE rowid = old.rowid;
|
|
535
|
+
END;
|
|
536
|
+
|
|
537
|
+
CREATE TRIGGER IF NOT EXISTS tasks_fts_au AFTER UPDATE OF title, description ON tasks BEGIN
|
|
538
|
+
DELETE FROM tasks_fts WHERE rowid = old.rowid;
|
|
539
|
+
INSERT INTO tasks_fts(rowid, task_id, title, description, tags)
|
|
540
|
+
SELECT new.rowid, new.id, new.title, COALESCE(new.description, ''),
|
|
541
|
+
COALESCE((SELECT GROUP_CONCAT(tag, ' ') FROM task_tags WHERE task_id = new.id), '');
|
|
542
|
+
END;
|
|
543
|
+
|
|
544
|
+
CREATE TRIGGER IF NOT EXISTS task_tags_fts_ai AFTER INSERT ON task_tags BEGIN
|
|
545
|
+
DELETE FROM tasks_fts WHERE rowid = (SELECT rowid FROM tasks WHERE id = new.task_id);
|
|
546
|
+
INSERT INTO tasks_fts(rowid, task_id, title, description, tags)
|
|
547
|
+
SELECT t.rowid, t.id, t.title, COALESCE(t.description, ''),
|
|
548
|
+
COALESCE((SELECT GROUP_CONCAT(tag, ' ') FROM task_tags WHERE task_id = t.id), '')
|
|
549
|
+
FROM tasks t WHERE t.id = new.task_id;
|
|
550
|
+
END;
|
|
551
|
+
|
|
552
|
+
CREATE TRIGGER IF NOT EXISTS task_tags_fts_ad AFTER DELETE ON task_tags BEGIN
|
|
553
|
+
DELETE FROM tasks_fts WHERE rowid = (SELECT rowid FROM tasks WHERE id = old.task_id);
|
|
554
|
+
INSERT INTO tasks_fts(rowid, task_id, title, description, tags)
|
|
555
|
+
SELECT t.rowid, t.id, t.title, COALESCE(t.description, ''),
|
|
556
|
+
COALESCE((SELECT GROUP_CONCAT(tag, ' ') FROM task_tags WHERE task_id = t.id), '')
|
|
557
|
+
FROM tasks t WHERE t.id = old.task_id;
|
|
558
|
+
END;
|
|
559
|
+
|
|
560
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (15);
|
|
561
|
+
`,
|
|
562
|
+
`
|
|
563
|
+
ALTER TABLE tasks ADD COLUMN spawns_template_id TEXT REFERENCES task_templates(id) ON DELETE SET NULL;
|
|
564
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (16);
|
|
513
565
|
`
|
|
514
566
|
];
|
|
515
567
|
var _db = null;
|
|
@@ -1279,6 +1331,62 @@ async function dispatchWebhook(event, payload, db) {
|
|
|
1279
1331
|
}
|
|
1280
1332
|
}
|
|
1281
1333
|
|
|
1334
|
+
// src/db/templates.ts
|
|
1335
|
+
function rowToTemplate(row) {
|
|
1336
|
+
return {
|
|
1337
|
+
...row,
|
|
1338
|
+
tags: JSON.parse(row.tags || "[]"),
|
|
1339
|
+
metadata: JSON.parse(row.metadata || "{}"),
|
|
1340
|
+
priority: row.priority || "medium"
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
function createTemplate(input, db) {
|
|
1344
|
+
const d = db || getDatabase();
|
|
1345
|
+
const id = uuid();
|
|
1346
|
+
d.run(`INSERT INTO task_templates (id, name, title_pattern, description, priority, tags, project_id, plan_id, metadata, created_at)
|
|
1347
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1348
|
+
id,
|
|
1349
|
+
input.name,
|
|
1350
|
+
input.title_pattern,
|
|
1351
|
+
input.description || null,
|
|
1352
|
+
input.priority || "medium",
|
|
1353
|
+
JSON.stringify(input.tags || []),
|
|
1354
|
+
input.project_id || null,
|
|
1355
|
+
input.plan_id || null,
|
|
1356
|
+
JSON.stringify(input.metadata || {}),
|
|
1357
|
+
now()
|
|
1358
|
+
]);
|
|
1359
|
+
return getTemplate(id, d);
|
|
1360
|
+
}
|
|
1361
|
+
function getTemplate(id, db) {
|
|
1362
|
+
const d = db || getDatabase();
|
|
1363
|
+
const row = d.query("SELECT * FROM task_templates WHERE id = ?").get(id);
|
|
1364
|
+
return row ? rowToTemplate(row) : null;
|
|
1365
|
+
}
|
|
1366
|
+
function listTemplates(db) {
|
|
1367
|
+
const d = db || getDatabase();
|
|
1368
|
+
return d.query("SELECT * FROM task_templates ORDER BY name").all().map(rowToTemplate);
|
|
1369
|
+
}
|
|
1370
|
+
function deleteTemplate(id, db) {
|
|
1371
|
+
const d = db || getDatabase();
|
|
1372
|
+
return d.run("DELETE FROM task_templates WHERE id = ?", [id]).changes > 0;
|
|
1373
|
+
}
|
|
1374
|
+
function taskFromTemplate(templateId, overrides = {}, db) {
|
|
1375
|
+
const t = getTemplate(templateId, db);
|
|
1376
|
+
if (!t)
|
|
1377
|
+
throw new Error(`Template not found: ${templateId}`);
|
|
1378
|
+
return {
|
|
1379
|
+
title: overrides.title || t.title_pattern,
|
|
1380
|
+
description: overrides.description ?? t.description ?? undefined,
|
|
1381
|
+
priority: overrides.priority ?? t.priority,
|
|
1382
|
+
tags: overrides.tags ?? t.tags,
|
|
1383
|
+
project_id: overrides.project_id ?? t.project_id ?? undefined,
|
|
1384
|
+
plan_id: overrides.plan_id ?? t.plan_id ?? undefined,
|
|
1385
|
+
metadata: overrides.metadata ?? t.metadata,
|
|
1386
|
+
...overrides
|
|
1387
|
+
};
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1282
1390
|
// src/db/tasks.ts
|
|
1283
1391
|
function rowToTask(row) {
|
|
1284
1392
|
return {
|
|
@@ -1310,8 +1418,8 @@ function createTask(input, db) {
|
|
|
1310
1418
|
const tags = input.tags || [];
|
|
1311
1419
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
1312
1420
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
1313
|
-
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id)
|
|
1314
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1421
|
+
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id)
|
|
1422
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1315
1423
|
id,
|
|
1316
1424
|
shortId,
|
|
1317
1425
|
input.project_id || null,
|
|
@@ -1336,7 +1444,8 @@ function createTask(input, db) {
|
|
|
1336
1444
|
null,
|
|
1337
1445
|
null,
|
|
1338
1446
|
input.recurrence_rule || null,
|
|
1339
|
-
input.recurrence_parent_id || null
|
|
1447
|
+
input.recurrence_parent_id || null,
|
|
1448
|
+
input.spawns_template_id || null
|
|
1340
1449
|
]);
|
|
1341
1450
|
if (tags.length > 0) {
|
|
1342
1451
|
insertTaskTags(id, tags, d);
|
|
@@ -1443,19 +1552,25 @@ function listTasks(filter = {}, db) {
|
|
|
1443
1552
|
} else if (filter.has_recurrence === false) {
|
|
1444
1553
|
conditions.push("recurrence_rule IS NULL");
|
|
1445
1554
|
}
|
|
1555
|
+
const PRIORITY_RANK = `CASE priority WHEN 'critical' THEN 0 WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END`;
|
|
1556
|
+
if (filter.cursor) {
|
|
1557
|
+
try {
|
|
1558
|
+
const decoded = JSON.parse(Buffer.from(filter.cursor, "base64").toString("utf8"));
|
|
1559
|
+
conditions.push(`(${PRIORITY_RANK} > ? OR (${PRIORITY_RANK} = ? AND created_at < ?) OR (${PRIORITY_RANK} = ? AND created_at = ? AND id > ?))`);
|
|
1560
|
+
params.push(decoded.p, decoded.p, decoded.c, decoded.p, decoded.c, decoded.i);
|
|
1561
|
+
} catch {}
|
|
1562
|
+
}
|
|
1446
1563
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
1447
1564
|
let limitClause = "";
|
|
1448
1565
|
if (filter.limit) {
|
|
1449
1566
|
limitClause = " LIMIT ?";
|
|
1450
1567
|
params.push(filter.limit);
|
|
1451
|
-
if (filter.offset) {
|
|
1568
|
+
if (!filter.cursor && filter.offset) {
|
|
1452
1569
|
limitClause += " OFFSET ?";
|
|
1453
1570
|
params.push(filter.offset);
|
|
1454
1571
|
}
|
|
1455
1572
|
}
|
|
1456
|
-
const rows = d.query(`SELECT * FROM tasks ${where} ORDER BY
|
|
1457
|
-
CASE priority WHEN 'critical' THEN 0 WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END,
|
|
1458
|
-
created_at DESC${limitClause}`).all(...params);
|
|
1573
|
+
const rows = d.query(`SELECT * FROM tasks ${where} ORDER BY ${PRIORITY_RANK}, created_at DESC${limitClause}`).all(...params);
|
|
1459
1574
|
return rows.map(rowToTask);
|
|
1460
1575
|
}
|
|
1461
1576
|
function countTasks(filter = {}, db) {
|
|
@@ -1700,10 +1815,25 @@ function completeTask(id, agentId, db, options) {
|
|
|
1700
1815
|
if (task.recurrence_rule && !options?.skip_recurrence) {
|
|
1701
1816
|
spawnedTask = spawnNextRecurrence(task, d);
|
|
1702
1817
|
}
|
|
1818
|
+
let spawnedFromTemplate = null;
|
|
1819
|
+
if (task.spawns_template_id) {
|
|
1820
|
+
try {
|
|
1821
|
+
const input = taskFromTemplate(task.spawns_template_id, {
|
|
1822
|
+
project_id: task.project_id ?? undefined,
|
|
1823
|
+
plan_id: task.plan_id ?? undefined,
|
|
1824
|
+
task_list_id: task.task_list_id ?? undefined,
|
|
1825
|
+
assigned_to: task.assigned_to ?? undefined
|
|
1826
|
+
}, d);
|
|
1827
|
+
spawnedFromTemplate = createTask(input, d);
|
|
1828
|
+
} catch {}
|
|
1829
|
+
}
|
|
1703
1830
|
const meta = hasEvidence ? { ...task.metadata, _evidence: evidence } : task.metadata;
|
|
1704
1831
|
if (spawnedTask) {
|
|
1705
1832
|
meta._next_recurrence = { id: spawnedTask.id, short_id: spawnedTask.short_id, due_at: spawnedTask.due_at };
|
|
1706
1833
|
}
|
|
1834
|
+
if (spawnedFromTemplate) {
|
|
1835
|
+
meta._spawned_task = { id: spawnedFromTemplate.id, short_id: spawnedFromTemplate.short_id, title: spawnedFromTemplate.title };
|
|
1836
|
+
}
|
|
1707
1837
|
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
1708
1838
|
}
|
|
1709
1839
|
function lockTask(id, agentId, db) {
|
|
@@ -1915,11 +2045,21 @@ function getNextTask(agentId, filters, db) {
|
|
|
1915
2045
|
}
|
|
1916
2046
|
conditions.push("id NOT IN (SELECT td.task_id FROM task_dependencies td JOIN tasks dep ON dep.id = td.depends_on WHERE dep.status != 'completed')");
|
|
1917
2047
|
const where = conditions.join(" AND ");
|
|
2048
|
+
let recentProjectIds = [];
|
|
2049
|
+
if (agentId) {
|
|
2050
|
+
const recentRows = d.query(`SELECT DISTINCT project_id FROM tasks WHERE assigned_to = ? AND status = 'completed' AND project_id IS NOT NULL ORDER BY completed_at DESC LIMIT 3`).all(agentId);
|
|
2051
|
+
recentProjectIds = recentRows.map((r) => r.project_id);
|
|
2052
|
+
}
|
|
1918
2053
|
let sql = `SELECT * FROM tasks WHERE ${where} ORDER BY `;
|
|
1919
2054
|
if (agentId) {
|
|
1920
2055
|
sql += `CASE WHEN assigned_to = ? THEN 0 WHEN assigned_to IS NULL THEN 1 ELSE 2 END, `;
|
|
1921
2056
|
params.push(agentId);
|
|
1922
2057
|
}
|
|
2058
|
+
if (recentProjectIds.length > 0) {
|
|
2059
|
+
const placeholders = recentProjectIds.map(() => "?").join(",");
|
|
2060
|
+
sql += `CASE WHEN project_id IN (${placeholders}) THEN 0 ELSE 1 END, `;
|
|
2061
|
+
params.push(...recentProjectIds);
|
|
2062
|
+
}
|
|
1923
2063
|
sql += `CASE priority WHEN 'critical' THEN 0 WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END, created_at ASC LIMIT 1`;
|
|
1924
2064
|
const row = d.query(sql).get(...params);
|
|
1925
2065
|
return row ? rowToTask(row) : null;
|
|
@@ -2600,61 +2740,6 @@ function deleteSession(id, db) {
|
|
|
2600
2740
|
const result = d.run("DELETE FROM sessions WHERE id = ?", [id]);
|
|
2601
2741
|
return result.changes > 0;
|
|
2602
2742
|
}
|
|
2603
|
-
// src/db/templates.ts
|
|
2604
|
-
function rowToTemplate(row) {
|
|
2605
|
-
return {
|
|
2606
|
-
...row,
|
|
2607
|
-
tags: JSON.parse(row.tags || "[]"),
|
|
2608
|
-
metadata: JSON.parse(row.metadata || "{}"),
|
|
2609
|
-
priority: row.priority || "medium"
|
|
2610
|
-
};
|
|
2611
|
-
}
|
|
2612
|
-
function createTemplate(input, db) {
|
|
2613
|
-
const d = db || getDatabase();
|
|
2614
|
-
const id = uuid();
|
|
2615
|
-
d.run(`INSERT INTO task_templates (id, name, title_pattern, description, priority, tags, project_id, plan_id, metadata, created_at)
|
|
2616
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
2617
|
-
id,
|
|
2618
|
-
input.name,
|
|
2619
|
-
input.title_pattern,
|
|
2620
|
-
input.description || null,
|
|
2621
|
-
input.priority || "medium",
|
|
2622
|
-
JSON.stringify(input.tags || []),
|
|
2623
|
-
input.project_id || null,
|
|
2624
|
-
input.plan_id || null,
|
|
2625
|
-
JSON.stringify(input.metadata || {}),
|
|
2626
|
-
now()
|
|
2627
|
-
]);
|
|
2628
|
-
return getTemplate(id, d);
|
|
2629
|
-
}
|
|
2630
|
-
function getTemplate(id, db) {
|
|
2631
|
-
const d = db || getDatabase();
|
|
2632
|
-
const row = d.query("SELECT * FROM task_templates WHERE id = ?").get(id);
|
|
2633
|
-
return row ? rowToTemplate(row) : null;
|
|
2634
|
-
}
|
|
2635
|
-
function listTemplates(db) {
|
|
2636
|
-
const d = db || getDatabase();
|
|
2637
|
-
return d.query("SELECT * FROM task_templates ORDER BY name").all().map(rowToTemplate);
|
|
2638
|
-
}
|
|
2639
|
-
function deleteTemplate(id, db) {
|
|
2640
|
-
const d = db || getDatabase();
|
|
2641
|
-
return d.run("DELETE FROM task_templates WHERE id = ?", [id]).changes > 0;
|
|
2642
|
-
}
|
|
2643
|
-
function taskFromTemplate(templateId, overrides = {}, db) {
|
|
2644
|
-
const t = getTemplate(templateId, db);
|
|
2645
|
-
if (!t)
|
|
2646
|
-
throw new Error(`Template not found: ${templateId}`);
|
|
2647
|
-
return {
|
|
2648
|
-
title: overrides.title || t.title_pattern,
|
|
2649
|
-
description: overrides.description ?? t.description ?? undefined,
|
|
2650
|
-
priority: overrides.priority ?? t.priority,
|
|
2651
|
-
tags: overrides.tags ?? t.tags,
|
|
2652
|
-
project_id: overrides.project_id ?? t.project_id ?? undefined,
|
|
2653
|
-
plan_id: overrides.plan_id ?? t.plan_id ?? undefined,
|
|
2654
|
-
metadata: overrides.metadata ?? t.metadata,
|
|
2655
|
-
...overrides
|
|
2656
|
-
};
|
|
2657
|
-
}
|
|
2658
2743
|
// src/db/orgs.ts
|
|
2659
2744
|
function rowToOrg(row) {
|
|
2660
2745
|
return { ...row, metadata: JSON.parse(row.metadata || "{}") };
|
|
@@ -2718,68 +2803,95 @@ function rowToTask2(row) {
|
|
|
2718
2803
|
requires_approval: Boolean(row.requires_approval)
|
|
2719
2804
|
};
|
|
2720
2805
|
}
|
|
2806
|
+
function hasFts(db) {
|
|
2807
|
+
try {
|
|
2808
|
+
const result = db.query("SELECT 1 FROM sqlite_master WHERE type='table' AND name='tasks_fts'").get();
|
|
2809
|
+
return result !== null;
|
|
2810
|
+
} catch {
|
|
2811
|
+
return false;
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
function escapeFtsQuery(q) {
|
|
2815
|
+
return q.replace(/["*^()]/g, " ").trim().split(/\s+/).filter(Boolean).map((token) => `"${token}"*`).join(" ");
|
|
2816
|
+
}
|
|
2721
2817
|
function searchTasks(options, projectId, taskListId, db) {
|
|
2722
2818
|
const opts = typeof options === "string" ? { query: options, project_id: projectId, task_list_id: taskListId } : options;
|
|
2723
2819
|
const d = db || getDatabase();
|
|
2724
2820
|
clearExpiredLocks(d);
|
|
2725
|
-
const
|
|
2726
|
-
let sql
|
|
2727
|
-
|
|
2821
|
+
const params = [];
|
|
2822
|
+
let sql;
|
|
2823
|
+
if (hasFts(d) && opts.query.trim()) {
|
|
2824
|
+
const ftsQuery = escapeFtsQuery(opts.query);
|
|
2825
|
+
sql = `SELECT t.* FROM tasks t
|
|
2826
|
+
INNER JOIN tasks_fts fts ON fts.rowid = t.rowid
|
|
2827
|
+
WHERE tasks_fts MATCH ?`;
|
|
2828
|
+
params.push(ftsQuery);
|
|
2829
|
+
} else {
|
|
2830
|
+
const pattern = `%${opts.query}%`;
|
|
2831
|
+
sql = `SELECT * FROM tasks t WHERE (t.title LIKE ? OR t.description LIKE ? OR EXISTS (SELECT 1 FROM task_tags WHERE task_tags.task_id = t.id AND tag LIKE ?))`;
|
|
2832
|
+
params.push(pattern, pattern, pattern);
|
|
2833
|
+
}
|
|
2728
2834
|
if (opts.project_id) {
|
|
2729
|
-
sql += " AND project_id = ?";
|
|
2835
|
+
sql += " AND t.project_id = ?";
|
|
2730
2836
|
params.push(opts.project_id);
|
|
2731
2837
|
}
|
|
2732
2838
|
if (opts.task_list_id) {
|
|
2733
|
-
sql += " AND task_list_id = ?";
|
|
2839
|
+
sql += " AND t.task_list_id = ?";
|
|
2734
2840
|
params.push(opts.task_list_id);
|
|
2735
2841
|
}
|
|
2736
2842
|
if (opts.status) {
|
|
2737
2843
|
if (Array.isArray(opts.status)) {
|
|
2738
|
-
sql += ` AND status IN (${opts.status.map(() => "?").join(",")})`;
|
|
2844
|
+
sql += ` AND t.status IN (${opts.status.map(() => "?").join(",")})`;
|
|
2739
2845
|
params.push(...opts.status);
|
|
2740
2846
|
} else {
|
|
2741
|
-
sql += " AND status = ?";
|
|
2847
|
+
sql += " AND t.status = ?";
|
|
2742
2848
|
params.push(opts.status);
|
|
2743
2849
|
}
|
|
2744
2850
|
}
|
|
2745
2851
|
if (opts.priority) {
|
|
2746
2852
|
if (Array.isArray(opts.priority)) {
|
|
2747
|
-
sql += ` AND priority IN (${opts.priority.map(() => "?").join(",")})`;
|
|
2853
|
+
sql += ` AND t.priority IN (${opts.priority.map(() => "?").join(",")})`;
|
|
2748
2854
|
params.push(...opts.priority);
|
|
2749
2855
|
} else {
|
|
2750
|
-
sql += " AND priority = ?";
|
|
2856
|
+
sql += " AND t.priority = ?";
|
|
2751
2857
|
params.push(opts.priority);
|
|
2752
2858
|
}
|
|
2753
2859
|
}
|
|
2754
2860
|
if (opts.assigned_to) {
|
|
2755
|
-
sql += " AND assigned_to = ?";
|
|
2861
|
+
sql += " AND t.assigned_to = ?";
|
|
2756
2862
|
params.push(opts.assigned_to);
|
|
2757
2863
|
}
|
|
2758
2864
|
if (opts.agent_id) {
|
|
2759
|
-
sql += " AND agent_id = ?";
|
|
2865
|
+
sql += " AND t.agent_id = ?";
|
|
2760
2866
|
params.push(opts.agent_id);
|
|
2761
2867
|
}
|
|
2762
2868
|
if (opts.created_after) {
|
|
2763
|
-
sql += " AND created_at > ?";
|
|
2869
|
+
sql += " AND t.created_at > ?";
|
|
2764
2870
|
params.push(opts.created_after);
|
|
2765
2871
|
}
|
|
2766
2872
|
if (opts.updated_after) {
|
|
2767
|
-
sql += " AND updated_at > ?";
|
|
2873
|
+
sql += " AND t.updated_at > ?";
|
|
2768
2874
|
params.push(opts.updated_after);
|
|
2769
2875
|
}
|
|
2770
2876
|
if (opts.has_dependencies === true) {
|
|
2771
|
-
sql += " AND id IN (SELECT task_id FROM task_dependencies)";
|
|
2877
|
+
sql += " AND t.id IN (SELECT task_id FROM task_dependencies)";
|
|
2772
2878
|
} else if (opts.has_dependencies === false) {
|
|
2773
|
-
sql += " AND id NOT IN (SELECT task_id FROM task_dependencies)";
|
|
2879
|
+
sql += " AND t.id NOT IN (SELECT task_id FROM task_dependencies)";
|
|
2774
2880
|
}
|
|
2775
2881
|
if (opts.is_blocked === true) {
|
|
2776
|
-
sql += " AND id IN (SELECT td.task_id FROM task_dependencies td JOIN tasks dep ON dep.id = td.depends_on WHERE dep.status != 'completed')";
|
|
2882
|
+
sql += " AND t.id IN (SELECT td.task_id FROM task_dependencies td JOIN tasks dep ON dep.id = td.depends_on WHERE dep.status != 'completed')";
|
|
2777
2883
|
} else if (opts.is_blocked === false) {
|
|
2778
|
-
sql += " AND id NOT IN (SELECT td.task_id FROM task_dependencies td JOIN tasks dep ON dep.id = td.depends_on WHERE dep.status != 'completed')";
|
|
2884
|
+
sql += " AND t.id NOT IN (SELECT td.task_id FROM task_dependencies td JOIN tasks dep ON dep.id = td.depends_on WHERE dep.status != 'completed')";
|
|
2885
|
+
}
|
|
2886
|
+
if (hasFts(d) && opts.query.trim()) {
|
|
2887
|
+
sql += ` ORDER BY bm25(tasks_fts),
|
|
2888
|
+
CASE t.priority WHEN 'critical' THEN 0 WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END,
|
|
2889
|
+
t.created_at DESC`;
|
|
2890
|
+
} else {
|
|
2891
|
+
sql += ` ORDER BY
|
|
2892
|
+
CASE t.priority WHEN 'critical' THEN 0 WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END,
|
|
2893
|
+
t.created_at DESC`;
|
|
2779
2894
|
}
|
|
2780
|
-
sql += ` ORDER BY
|
|
2781
|
-
CASE priority WHEN 'critical' THEN 0 WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END,
|
|
2782
|
-
created_at DESC`;
|
|
2783
2895
|
const rows = d.query(sql).all(...params);
|
|
2784
2896
|
return rows.map(rowToTask2);
|
|
2785
2897
|
}
|
package/dist/lib/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,mBAAmB,CAAC;AAcvD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,mBAAmB,CAAC;AAcvD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAA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