@hasna/todos 0.9.17 → 0.9.18
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/dist/cli/index.js +102 -6
- package/dist/db/agents.d.ts +6 -0
- package/dist/db/agents.d.ts.map +1 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/plans.d.ts.map +1 -1
- package/dist/db/projects.d.ts +1 -0
- package/dist/db/projects.d.ts.map +1 -1
- package/dist/db/tasks.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +226 -6
- package/dist/lib/completion-guard.d.ts +17 -0
- package/dist/lib/completion-guard.d.ts.map +1 -0
- package/dist/lib/config.d.ts +13 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/mcp/index.js +98 -6
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +102 -6
- package/dist/server/serve.d.ts +9 -0
- package/dist/server/serve.d.ts.map +1 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2161,6 +2161,24 @@ function ensureTableMigrations(db) {
|
|
|
2161
2161
|
db.exec(MIGRATIONS[5]);
|
|
2162
2162
|
} catch {}
|
|
2163
2163
|
}
|
|
2164
|
+
const ensureColumn = (table, column, type) => {
|
|
2165
|
+
try {
|
|
2166
|
+
db.query(`SELECT ${column} FROM ${table} LIMIT 0`).get();
|
|
2167
|
+
} catch {
|
|
2168
|
+
try {
|
|
2169
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${type}`);
|
|
2170
|
+
} catch {}
|
|
2171
|
+
}
|
|
2172
|
+
};
|
|
2173
|
+
ensureColumn("tasks", "due_at", "TEXT");
|
|
2174
|
+
ensureColumn("tasks", "estimated_minutes", "INTEGER");
|
|
2175
|
+
ensureColumn("tasks", "requires_approval", "INTEGER NOT NULL DEFAULT 0");
|
|
2176
|
+
ensureColumn("tasks", "approved_by", "TEXT");
|
|
2177
|
+
ensureColumn("tasks", "approved_at", "TEXT");
|
|
2178
|
+
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
2179
|
+
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
2180
|
+
ensureColumn("plans", "task_list_id", "TEXT");
|
|
2181
|
+
ensureColumn("plans", "agent_id", "TEXT");
|
|
2164
2182
|
}
|
|
2165
2183
|
function backfillTaskTags(db) {
|
|
2166
2184
|
try {
|
|
@@ -2390,6 +2408,51 @@ var init_database = __esm(() => {
|
|
|
2390
2408
|
CREATE INDEX IF NOT EXISTS idx_plans_task_list ON plans(task_list_id);
|
|
2391
2409
|
CREATE INDEX IF NOT EXISTS idx_plans_agent ON plans(agent_id);
|
|
2392
2410
|
INSERT OR IGNORE INTO _migrations (id) VALUES (9);
|
|
2411
|
+
`,
|
|
2412
|
+
`
|
|
2413
|
+
CREATE TABLE IF NOT EXISTS task_history (
|
|
2414
|
+
id TEXT PRIMARY KEY,
|
|
2415
|
+
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
|
2416
|
+
action TEXT NOT NULL,
|
|
2417
|
+
field TEXT,
|
|
2418
|
+
old_value TEXT,
|
|
2419
|
+
new_value TEXT,
|
|
2420
|
+
agent_id TEXT,
|
|
2421
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
2422
|
+
);
|
|
2423
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_task ON task_history(task_id);
|
|
2424
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_agent ON task_history(agent_id);
|
|
2425
|
+
|
|
2426
|
+
CREATE TABLE IF NOT EXISTS webhooks (
|
|
2427
|
+
id TEXT PRIMARY KEY,
|
|
2428
|
+
url TEXT NOT NULL,
|
|
2429
|
+
events TEXT NOT NULL DEFAULT '[]',
|
|
2430
|
+
secret TEXT,
|
|
2431
|
+
active INTEGER NOT NULL DEFAULT 1,
|
|
2432
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
2433
|
+
);
|
|
2434
|
+
|
|
2435
|
+
CREATE TABLE IF NOT EXISTS task_templates (
|
|
2436
|
+
id TEXT PRIMARY KEY,
|
|
2437
|
+
name TEXT NOT NULL,
|
|
2438
|
+
title_pattern TEXT NOT NULL,
|
|
2439
|
+
description TEXT,
|
|
2440
|
+
priority TEXT DEFAULT 'medium',
|
|
2441
|
+
tags TEXT DEFAULT '[]',
|
|
2442
|
+
project_id TEXT REFERENCES projects(id) ON DELETE SET NULL,
|
|
2443
|
+
plan_id TEXT REFERENCES plans(id) ON DELETE SET NULL,
|
|
2444
|
+
metadata TEXT DEFAULT '{}',
|
|
2445
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
2446
|
+
);
|
|
2447
|
+
|
|
2448
|
+
ALTER TABLE tasks ADD COLUMN estimated_minutes INTEGER;
|
|
2449
|
+
ALTER TABLE tasks ADD COLUMN requires_approval INTEGER NOT NULL DEFAULT 0;
|
|
2450
|
+
ALTER TABLE tasks ADD COLUMN approved_by TEXT;
|
|
2451
|
+
ALTER TABLE tasks ADD COLUMN approved_at TEXT;
|
|
2452
|
+
|
|
2453
|
+
ALTER TABLE agents ADD COLUMN permissions TEXT DEFAULT '["*"]';
|
|
2454
|
+
|
|
2455
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (10);
|
|
2393
2456
|
`
|
|
2394
2457
|
];
|
|
2395
2458
|
});
|
|
@@ -2763,7 +2826,8 @@ function rowToTask(row) {
|
|
|
2763
2826
|
tags: JSON.parse(row.tags || "[]"),
|
|
2764
2827
|
metadata: JSON.parse(row.metadata || "{}"),
|
|
2765
2828
|
status: row.status,
|
|
2766
|
-
priority: row.priority
|
|
2829
|
+
priority: row.priority,
|
|
2830
|
+
requires_approval: !!row.requires_approval
|
|
2767
2831
|
};
|
|
2768
2832
|
}
|
|
2769
2833
|
function insertTaskTags(taskId, tags, db) {
|
|
@@ -2786,8 +2850,8 @@ function createTask(input, db) {
|
|
|
2786
2850
|
const tags = input.tags || [];
|
|
2787
2851
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
2788
2852
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
2789
|
-
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)
|
|
2790
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?)`, [
|
|
2853
|
+
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)
|
|
2854
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
2791
2855
|
id,
|
|
2792
2856
|
shortId,
|
|
2793
2857
|
input.project_id || null,
|
|
@@ -2806,7 +2870,11 @@ function createTask(input, db) {
|
|
|
2806
2870
|
JSON.stringify(input.metadata || {}),
|
|
2807
2871
|
timestamp,
|
|
2808
2872
|
timestamp,
|
|
2809
|
-
input.due_at || null
|
|
2873
|
+
input.due_at || null,
|
|
2874
|
+
input.estimated_minutes || null,
|
|
2875
|
+
input.requires_approval ? 1 : 0,
|
|
2876
|
+
null,
|
|
2877
|
+
null
|
|
2810
2878
|
]);
|
|
2811
2879
|
if (tags.length > 0) {
|
|
2812
2880
|
insertTaskTags(id, tags, d);
|
|
@@ -2978,6 +3046,20 @@ function updateTask(id, input, db) {
|
|
|
2978
3046
|
sets.push("due_at = ?");
|
|
2979
3047
|
params.push(input.due_at);
|
|
2980
3048
|
}
|
|
3049
|
+
if (input.estimated_minutes !== undefined) {
|
|
3050
|
+
sets.push("estimated_minutes = ?");
|
|
3051
|
+
params.push(input.estimated_minutes);
|
|
3052
|
+
}
|
|
3053
|
+
if (input.requires_approval !== undefined) {
|
|
3054
|
+
sets.push("requires_approval = ?");
|
|
3055
|
+
params.push(input.requires_approval ? 1 : 0);
|
|
3056
|
+
}
|
|
3057
|
+
if (input.approved_by !== undefined) {
|
|
3058
|
+
sets.push("approved_by = ?");
|
|
3059
|
+
params.push(input.approved_by);
|
|
3060
|
+
sets.push("approved_at = ?");
|
|
3061
|
+
params.push(now());
|
|
3062
|
+
}
|
|
2981
3063
|
params.push(id, input.version);
|
|
2982
3064
|
const result = d.run(`UPDATE tasks SET ${sets.join(", ")} WHERE id = ? AND version = ?`, params);
|
|
2983
3065
|
if (result.changes === 0) {
|
|
@@ -3121,6 +3203,7 @@ function shortUuid() {
|
|
|
3121
3203
|
function rowToAgent(row) {
|
|
3122
3204
|
return {
|
|
3123
3205
|
...row,
|
|
3206
|
+
permissions: JSON.parse(row.permissions || '["*"]'),
|
|
3124
3207
|
metadata: JSON.parse(row.metadata || "{}")
|
|
3125
3208
|
};
|
|
3126
3209
|
}
|
|
@@ -3133,8 +3216,17 @@ function registerAgent(input, db) {
|
|
|
3133
3216
|
}
|
|
3134
3217
|
const id = shortUuid();
|
|
3135
3218
|
const timestamp = now();
|
|
3136
|
-
d.run(`INSERT INTO agents (id, name, description, role, metadata, created_at, last_seen_at)
|
|
3137
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`, [
|
|
3219
|
+
d.run(`INSERT INTO agents (id, name, description, role, permissions, metadata, created_at, last_seen_at)
|
|
3220
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
3221
|
+
id,
|
|
3222
|
+
input.name,
|
|
3223
|
+
input.description || null,
|
|
3224
|
+
input.role || "agent",
|
|
3225
|
+
JSON.stringify(input.permissions || ["*"]),
|
|
3226
|
+
JSON.stringify(input.metadata || {}),
|
|
3227
|
+
timestamp,
|
|
3228
|
+
timestamp
|
|
3229
|
+
]);
|
|
3138
3230
|
return getAgent(id, d);
|
|
3139
3231
|
}
|
|
3140
3232
|
function getAgent(id, db) {
|
|
@@ -3174,6 +3266,10 @@ function updateAgent(id, input, db) {
|
|
|
3174
3266
|
sets.push("role = ?");
|
|
3175
3267
|
params.push(input.role);
|
|
3176
3268
|
}
|
|
3269
|
+
if (input.permissions !== undefined) {
|
|
3270
|
+
sets.push("permissions = ?");
|
|
3271
|
+
params.push(JSON.stringify(input.permissions));
|
|
3272
|
+
}
|
|
3177
3273
|
if (input.metadata !== undefined) {
|
|
3178
3274
|
sets.push("metadata = ?");
|
|
3179
3275
|
params.push(JSON.stringify(input.metadata));
|
package/dist/db/agents.d.ts
CHANGED
|
@@ -9,5 +9,11 @@ export declare function getAgent(id: string, db?: Database): Agent | null;
|
|
|
9
9
|
export declare function getAgentByName(name: string, db?: Database): Agent | null;
|
|
10
10
|
export declare function listAgents(db?: Database): Agent[];
|
|
11
11
|
export declare function updateAgentActivity(id: string, db?: Database): void;
|
|
12
|
+
export declare function updateAgent(id: string, input: {
|
|
13
|
+
name?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
role?: string;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}, db?: Database): Agent;
|
|
12
18
|
export declare function deleteAgent(id: string, db?: Database): boolean;
|
|
13
19
|
//# sourceMappingURL=agents.d.ts.map
|
package/dist/db/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/db/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAY,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAc7E;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,KAAK,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AAM,EACV,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EACjG,EAAE,CAAC,EAAE,QAAQ,GACZ,KAAK,CA4BP;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAG9D"}
|
|
@@ -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;AA2RtC,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAkBrD;AA6ED,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,CAiB9F"}
|
package/dist/db/plans.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/db/plans.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIhF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/db/plans.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIhF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAsBtE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAI9D;AAED,wBAAgB,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE,CAUnE;AAED,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,eAAe,EACtB,EAAE,CAAC,EAAE,QAAQ,GACZ,IAAI,CAiCN;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAI7D"}
|
package/dist/db/projects.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export declare function getProjectByPath(path: string, db?: Database): Project |
|
|
|
7
7
|
export declare function listProjects(db?: Database): Project[];
|
|
8
8
|
export declare function updateProject(id: string, input: Partial<Pick<Project, "name" | "description" | "task_list_id">>, db?: Database): Project;
|
|
9
9
|
export declare function deleteProject(id: string, db?: Database): boolean;
|
|
10
|
+
export declare function nextTaskShortId(projectId: string, db?: Database): string | null;
|
|
10
11
|
export declare function ensureProject(name: string, path: string, db?: Database): Project;
|
|
11
12
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/db/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIrE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/db/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIrE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAyBD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,kBAAkB,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAcT;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAIpE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAM5E;AAED,wBAAgB,YAAY,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,EAAE,CAKrD;AAED,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,CAAC,CAAC,EACtE,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAyBT;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAIhE;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAS/E;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAaT"}
|
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,EAEV,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,EAEV,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAkC3B,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CA2CtE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CA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,EACd,EAAE,CAAC,EAAE,QAAQ,GACZ,cAAc,EAAE,CAKlB;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,QAAQ,GACZ,cAAc,EAAE,CAKlB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export { getDatabase, closeDatabase, resetDatabase, resolvePartialId, now, uuid } from "./db/database.js";
|
|
2
2
|
export { createTask, getTask, getTaskWithRelations, listTasks, updateTask, deleteTask, startTask, completeTask, lockTask, unlockTask, addDependency, removeDependency, getTaskDependencies, getTaskDependents, } from "./db/tasks.js";
|
|
3
|
-
export { createProject, getProject, getProjectByPath, listProjects, updateProject, deleteProject, ensureProject, slugify, } from "./db/projects.js";
|
|
3
|
+
export { createProject, getProject, getProjectByPath, listProjects, updateProject, deleteProject, ensureProject, nextTaskShortId, slugify, } from "./db/projects.js";
|
|
4
4
|
export { createPlan, getPlan, listPlans, updatePlan, deletePlan, } from "./db/plans.js";
|
|
5
5
|
export { addComment, getComment, listComments, deleteComment, } from "./db/comments.js";
|
|
6
|
-
export { registerAgent, getAgent, getAgentByName, listAgents, updateAgentActivity, deleteAgent, } from "./db/agents.js";
|
|
6
|
+
export { registerAgent, getAgent, getAgentByName, listAgents, updateAgent, updateAgentActivity, deleteAgent, } from "./db/agents.js";
|
|
7
7
|
export { createTaskList, getTaskList, getTaskListBySlug, listTaskLists, updateTaskList, deleteTaskList, ensureTaskList, } from "./db/task-lists.js";
|
|
8
8
|
export { createSession, getSession, listSessions, updateSessionActivity, deleteSession, } from "./db/sessions.js";
|
|
9
9
|
export { searchTasks } from "./lib/search.js";
|
|
10
10
|
export { defaultSyncAgents, syncWithAgent, syncWithAgents } from "./lib/sync.js";
|
|
11
11
|
export type { SyncResult } from "./lib/sync-types.js";
|
|
12
|
-
export { loadConfig } from "./lib/config.js";
|
|
13
|
-
export type { TodosConfig, AgentConfig } from "./lib/config.js";
|
|
12
|
+
export { loadConfig, getCompletionGuardConfig } from "./lib/config.js";
|
|
13
|
+
export type { TodosConfig, AgentConfig, CompletionGuardConfig } from "./lib/config.js";
|
|
14
|
+
export { checkCompletionGuard } from "./lib/completion-guard.js";
|
|
14
15
|
export type { Task, TaskWithRelations, CreateTaskInput, UpdateTaskInput, TaskFilter, TaskStatus, TaskPriority, TaskDependency, TaskComment, CreateCommentInput, Project, CreateProjectInput, Plan, CreatePlanInput, UpdatePlanInput, PlanStatus, Session, CreateSessionInput, Agent, AgentRow, RegisterAgentInput, TaskList, TaskListRow, CreateTaskListInput, UpdateTaskListInput, LockResult, TaskRow, SessionRow, } from "./types/index.js";
|
|
15
|
-
export { TASK_STATUSES, TASK_PRIORITIES, PLAN_STATUSES, VersionConflictError, TaskNotFoundError, ProjectNotFoundError, PlanNotFoundError, LockError, DependencyCycleError, AgentNotFoundError, TaskListNotFoundError, } from "./types/index.js";
|
|
16
|
+
export { TASK_STATUSES, TASK_PRIORITIES, PLAN_STATUSES, VersionConflictError, TaskNotFoundError, ProjectNotFoundError, PlanNotFoundError, LockError, DependencyCycleError, AgentNotFoundError, TaskListNotFoundError, CompletionGuardError, } from "./types/index.js";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EACL,UAAU,EACV,OAAO,EACP,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,aAAa,EACb,UAAU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EAClB,KAAK,EACL,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,UAAU,GACX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -219,6 +219,51 @@ var MIGRATIONS = [
|
|
|
219
219
|
CREATE INDEX IF NOT EXISTS idx_plans_task_list ON plans(task_list_id);
|
|
220
220
|
CREATE INDEX IF NOT EXISTS idx_plans_agent ON plans(agent_id);
|
|
221
221
|
INSERT OR IGNORE INTO _migrations (id) VALUES (9);
|
|
222
|
+
`,
|
|
223
|
+
`
|
|
224
|
+
CREATE TABLE IF NOT EXISTS task_history (
|
|
225
|
+
id TEXT PRIMARY KEY,
|
|
226
|
+
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
|
227
|
+
action TEXT NOT NULL,
|
|
228
|
+
field TEXT,
|
|
229
|
+
old_value TEXT,
|
|
230
|
+
new_value TEXT,
|
|
231
|
+
agent_id TEXT,
|
|
232
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
233
|
+
);
|
|
234
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_task ON task_history(task_id);
|
|
235
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_agent ON task_history(agent_id);
|
|
236
|
+
|
|
237
|
+
CREATE TABLE IF NOT EXISTS webhooks (
|
|
238
|
+
id TEXT PRIMARY KEY,
|
|
239
|
+
url TEXT NOT NULL,
|
|
240
|
+
events TEXT NOT NULL DEFAULT '[]',
|
|
241
|
+
secret TEXT,
|
|
242
|
+
active INTEGER NOT NULL DEFAULT 1,
|
|
243
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
CREATE TABLE IF NOT EXISTS task_templates (
|
|
247
|
+
id TEXT PRIMARY KEY,
|
|
248
|
+
name TEXT NOT NULL,
|
|
249
|
+
title_pattern TEXT NOT NULL,
|
|
250
|
+
description TEXT,
|
|
251
|
+
priority TEXT DEFAULT 'medium',
|
|
252
|
+
tags TEXT DEFAULT '[]',
|
|
253
|
+
project_id TEXT REFERENCES projects(id) ON DELETE SET NULL,
|
|
254
|
+
plan_id TEXT REFERENCES plans(id) ON DELETE SET NULL,
|
|
255
|
+
metadata TEXT DEFAULT '{}',
|
|
256
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
ALTER TABLE tasks ADD COLUMN estimated_minutes INTEGER;
|
|
260
|
+
ALTER TABLE tasks ADD COLUMN requires_approval INTEGER NOT NULL DEFAULT 0;
|
|
261
|
+
ALTER TABLE tasks ADD COLUMN approved_by TEXT;
|
|
262
|
+
ALTER TABLE tasks ADD COLUMN approved_at TEXT;
|
|
263
|
+
|
|
264
|
+
ALTER TABLE agents ADD COLUMN permissions TEXT DEFAULT '["*"]';
|
|
265
|
+
|
|
266
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (10);
|
|
222
267
|
`
|
|
223
268
|
];
|
|
224
269
|
var _db = null;
|
|
@@ -263,6 +308,24 @@ function ensureTableMigrations(db) {
|
|
|
263
308
|
db.exec(MIGRATIONS[5]);
|
|
264
309
|
} catch {}
|
|
265
310
|
}
|
|
311
|
+
const ensureColumn = (table, column, type) => {
|
|
312
|
+
try {
|
|
313
|
+
db.query(`SELECT ${column} FROM ${table} LIMIT 0`).get();
|
|
314
|
+
} catch {
|
|
315
|
+
try {
|
|
316
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${type}`);
|
|
317
|
+
} catch {}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
ensureColumn("tasks", "due_at", "TEXT");
|
|
321
|
+
ensureColumn("tasks", "estimated_minutes", "INTEGER");
|
|
322
|
+
ensureColumn("tasks", "requires_approval", "INTEGER NOT NULL DEFAULT 0");
|
|
323
|
+
ensureColumn("tasks", "approved_by", "TEXT");
|
|
324
|
+
ensureColumn("tasks", "approved_at", "TEXT");
|
|
325
|
+
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
326
|
+
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
327
|
+
ensureColumn("plans", "task_list_id", "TEXT");
|
|
328
|
+
ensureColumn("plans", "agent_id", "TEXT");
|
|
266
329
|
}
|
|
267
330
|
function backfillTaskTags(db) {
|
|
268
331
|
try {
|
|
@@ -704,7 +767,8 @@ function rowToTask(row) {
|
|
|
704
767
|
tags: JSON.parse(row.tags || "[]"),
|
|
705
768
|
metadata: JSON.parse(row.metadata || "{}"),
|
|
706
769
|
status: row.status,
|
|
707
|
-
priority: row.priority
|
|
770
|
+
priority: row.priority,
|
|
771
|
+
requires_approval: !!row.requires_approval
|
|
708
772
|
};
|
|
709
773
|
}
|
|
710
774
|
function insertTaskTags(taskId, tags, db) {
|
|
@@ -727,8 +791,8 @@ function createTask(input, db) {
|
|
|
727
791
|
const tags = input.tags || [];
|
|
728
792
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
729
793
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
730
|
-
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)
|
|
731
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?)`, [
|
|
794
|
+
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)
|
|
795
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
732
796
|
id,
|
|
733
797
|
shortId,
|
|
734
798
|
input.project_id || null,
|
|
@@ -747,7 +811,11 @@ function createTask(input, db) {
|
|
|
747
811
|
JSON.stringify(input.metadata || {}),
|
|
748
812
|
timestamp,
|
|
749
813
|
timestamp,
|
|
750
|
-
input.due_at || null
|
|
814
|
+
input.due_at || null,
|
|
815
|
+
input.estimated_minutes || null,
|
|
816
|
+
input.requires_approval ? 1 : 0,
|
|
817
|
+
null,
|
|
818
|
+
null
|
|
751
819
|
]);
|
|
752
820
|
if (tags.length > 0) {
|
|
753
821
|
insertTaskTags(id, tags, d);
|
|
@@ -919,6 +987,20 @@ function updateTask(id, input, db) {
|
|
|
919
987
|
sets.push("due_at = ?");
|
|
920
988
|
params.push(input.due_at);
|
|
921
989
|
}
|
|
990
|
+
if (input.estimated_minutes !== undefined) {
|
|
991
|
+
sets.push("estimated_minutes = ?");
|
|
992
|
+
params.push(input.estimated_minutes);
|
|
993
|
+
}
|
|
994
|
+
if (input.requires_approval !== undefined) {
|
|
995
|
+
sets.push("requires_approval = ?");
|
|
996
|
+
params.push(input.requires_approval ? 1 : 0);
|
|
997
|
+
}
|
|
998
|
+
if (input.approved_by !== undefined) {
|
|
999
|
+
sets.push("approved_by = ?");
|
|
1000
|
+
params.push(input.approved_by);
|
|
1001
|
+
sets.push("approved_at = ?");
|
|
1002
|
+
params.push(now());
|
|
1003
|
+
}
|
|
922
1004
|
params.push(id, input.version);
|
|
923
1005
|
const result = d.run(`UPDATE tasks SET ${sets.join(", ")} WHERE id = ? AND version = ?`, params);
|
|
924
1006
|
if (result.changes === 0) {
|
|
@@ -1152,6 +1234,7 @@ function shortUuid() {
|
|
|
1152
1234
|
function rowToAgent(row) {
|
|
1153
1235
|
return {
|
|
1154
1236
|
...row,
|
|
1237
|
+
permissions: JSON.parse(row.permissions || '["*"]'),
|
|
1155
1238
|
metadata: JSON.parse(row.metadata || "{}")
|
|
1156
1239
|
};
|
|
1157
1240
|
}
|
|
@@ -1164,8 +1247,17 @@ function registerAgent(input, db) {
|
|
|
1164
1247
|
}
|
|
1165
1248
|
const id = shortUuid();
|
|
1166
1249
|
const timestamp = now();
|
|
1167
|
-
d.run(`INSERT INTO agents (id, name, description, role, metadata, created_at, last_seen_at)
|
|
1168
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`, [
|
|
1250
|
+
d.run(`INSERT INTO agents (id, name, description, role, permissions, metadata, created_at, last_seen_at)
|
|
1251
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1252
|
+
id,
|
|
1253
|
+
input.name,
|
|
1254
|
+
input.description || null,
|
|
1255
|
+
input.role || "agent",
|
|
1256
|
+
JSON.stringify(input.permissions || ["*"]),
|
|
1257
|
+
JSON.stringify(input.metadata || {}),
|
|
1258
|
+
timestamp,
|
|
1259
|
+
timestamp
|
|
1260
|
+
]);
|
|
1169
1261
|
return getAgent(id, d);
|
|
1170
1262
|
}
|
|
1171
1263
|
function getAgent(id, db) {
|
|
@@ -1205,6 +1297,10 @@ function updateAgent(id, input, db) {
|
|
|
1205
1297
|
sets.push("role = ?");
|
|
1206
1298
|
params.push(input.role);
|
|
1207
1299
|
}
|
|
1300
|
+
if (input.permissions !== undefined) {
|
|
1301
|
+
sets.push("permissions = ?");
|
|
1302
|
+
params.push(JSON.stringify(input.permissions));
|
|
1303
|
+
}
|
|
1208
1304
|
if (input.metadata !== undefined) {
|
|
1209
1305
|
sets.push("metadata = ?");
|
|
1210
1306
|
params.push(JSON.stringify(input.metadata));
|
|
@@ -1339,6 +1435,117 @@ function deleteSession(id, db) {
|
|
|
1339
1435
|
const result = d.run("DELETE FROM sessions WHERE id = ?", [id]);
|
|
1340
1436
|
return result.changes > 0;
|
|
1341
1437
|
}
|
|
1438
|
+
// src/db/audit.ts
|
|
1439
|
+
function logTaskChange(taskId, action, field, oldValue, newValue, agentId, db) {
|
|
1440
|
+
const d = db || getDatabase();
|
|
1441
|
+
const id = uuid();
|
|
1442
|
+
const timestamp = now();
|
|
1443
|
+
d.run(`INSERT INTO task_history (id, task_id, action, field, old_value, new_value, agent_id, created_at)
|
|
1444
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, [id, taskId, action, field || null, oldValue ?? null, newValue ?? null, agentId || null, timestamp]);
|
|
1445
|
+
return { id, task_id: taskId, action, field: field || null, old_value: oldValue ?? null, new_value: newValue ?? null, agent_id: agentId || null, created_at: timestamp };
|
|
1446
|
+
}
|
|
1447
|
+
function getTaskHistory(taskId, db) {
|
|
1448
|
+
const d = db || getDatabase();
|
|
1449
|
+
return d.query("SELECT * FROM task_history WHERE task_id = ? ORDER BY created_at DESC").all(taskId);
|
|
1450
|
+
}
|
|
1451
|
+
function getRecentActivity(limit = 50, db) {
|
|
1452
|
+
const d = db || getDatabase();
|
|
1453
|
+
return d.query("SELECT * FROM task_history ORDER BY created_at DESC LIMIT ?").all(limit);
|
|
1454
|
+
}
|
|
1455
|
+
// src/db/webhooks.ts
|
|
1456
|
+
function rowToWebhook(row) {
|
|
1457
|
+
return { ...row, events: JSON.parse(row.events || "[]"), active: !!row.active };
|
|
1458
|
+
}
|
|
1459
|
+
function createWebhook(input, db) {
|
|
1460
|
+
const d = db || getDatabase();
|
|
1461
|
+
const id = uuid();
|
|
1462
|
+
d.run(`INSERT INTO webhooks (id, url, events, secret, created_at) VALUES (?, ?, ?, ?, ?)`, [id, input.url, JSON.stringify(input.events || []), input.secret || null, now()]);
|
|
1463
|
+
return getWebhook(id, d);
|
|
1464
|
+
}
|
|
1465
|
+
function getWebhook(id, db) {
|
|
1466
|
+
const d = db || getDatabase();
|
|
1467
|
+
const row = d.query("SELECT * FROM webhooks WHERE id = ?").get(id);
|
|
1468
|
+
return row ? rowToWebhook(row) : null;
|
|
1469
|
+
}
|
|
1470
|
+
function listWebhooks(db) {
|
|
1471
|
+
const d = db || getDatabase();
|
|
1472
|
+
return d.query("SELECT * FROM webhooks ORDER BY created_at DESC").all().map(rowToWebhook);
|
|
1473
|
+
}
|
|
1474
|
+
function deleteWebhook(id, db) {
|
|
1475
|
+
const d = db || getDatabase();
|
|
1476
|
+
return d.run("DELETE FROM webhooks WHERE id = ?", [id]).changes > 0;
|
|
1477
|
+
}
|
|
1478
|
+
async function dispatchWebhook(event, payload, db) {
|
|
1479
|
+
const webhooks = listWebhooks(db).filter((w) => w.active && (w.events.length === 0 || w.events.includes(event)));
|
|
1480
|
+
for (const wh of webhooks) {
|
|
1481
|
+
try {
|
|
1482
|
+
const body = JSON.stringify({ event, payload, timestamp: now() });
|
|
1483
|
+
const headers = { "Content-Type": "application/json" };
|
|
1484
|
+
if (wh.secret) {
|
|
1485
|
+
const encoder = new TextEncoder;
|
|
1486
|
+
const key = await crypto.subtle.importKey("raw", encoder.encode(wh.secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
1487
|
+
const sig = await crypto.subtle.sign("HMAC", key, encoder.encode(body));
|
|
1488
|
+
headers["X-Webhook-Signature"] = Array.from(new Uint8Array(sig)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1489
|
+
}
|
|
1490
|
+
fetch(wh.url, { method: "POST", headers, body }).catch(() => {});
|
|
1491
|
+
} catch {}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
// src/db/templates.ts
|
|
1495
|
+
function rowToTemplate(row) {
|
|
1496
|
+
return {
|
|
1497
|
+
...row,
|
|
1498
|
+
tags: JSON.parse(row.tags || "[]"),
|
|
1499
|
+
metadata: JSON.parse(row.metadata || "{}"),
|
|
1500
|
+
priority: row.priority || "medium"
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
function createTemplate(input, db) {
|
|
1504
|
+
const d = db || getDatabase();
|
|
1505
|
+
const id = uuid();
|
|
1506
|
+
d.run(`INSERT INTO task_templates (id, name, title_pattern, description, priority, tags, project_id, plan_id, metadata, created_at)
|
|
1507
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1508
|
+
id,
|
|
1509
|
+
input.name,
|
|
1510
|
+
input.title_pattern,
|
|
1511
|
+
input.description || null,
|
|
1512
|
+
input.priority || "medium",
|
|
1513
|
+
JSON.stringify(input.tags || []),
|
|
1514
|
+
input.project_id || null,
|
|
1515
|
+
input.plan_id || null,
|
|
1516
|
+
JSON.stringify(input.metadata || {}),
|
|
1517
|
+
now()
|
|
1518
|
+
]);
|
|
1519
|
+
return getTemplate(id, d);
|
|
1520
|
+
}
|
|
1521
|
+
function getTemplate(id, db) {
|
|
1522
|
+
const d = db || getDatabase();
|
|
1523
|
+
const row = d.query("SELECT * FROM task_templates WHERE id = ?").get(id);
|
|
1524
|
+
return row ? rowToTemplate(row) : null;
|
|
1525
|
+
}
|
|
1526
|
+
function listTemplates(db) {
|
|
1527
|
+
const d = db || getDatabase();
|
|
1528
|
+
return d.query("SELECT * FROM task_templates ORDER BY name").all().map(rowToTemplate);
|
|
1529
|
+
}
|
|
1530
|
+
function deleteTemplate(id, db) {
|
|
1531
|
+
const d = db || getDatabase();
|
|
1532
|
+
return d.run("DELETE FROM task_templates WHERE id = ?", [id]).changes > 0;
|
|
1533
|
+
}
|
|
1534
|
+
function taskFromTemplate(templateId, overrides = {}, db) {
|
|
1535
|
+
const t = getTemplate(templateId, db);
|
|
1536
|
+
if (!t)
|
|
1537
|
+
throw new Error(`Template not found: ${templateId}`);
|
|
1538
|
+
return {
|
|
1539
|
+
title: overrides.title || t.title_pattern,
|
|
1540
|
+
description: overrides.description ?? t.description ?? undefined,
|
|
1541
|
+
priority: overrides.priority ?? t.priority,
|
|
1542
|
+
tags: overrides.tags ?? t.tags,
|
|
1543
|
+
project_id: overrides.project_id ?? t.project_id ?? undefined,
|
|
1544
|
+
plan_id: overrides.plan_id ?? t.plan_id ?? undefined,
|
|
1545
|
+
metadata: overrides.metadata ?? t.metadata,
|
|
1546
|
+
...overrides
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1342
1549
|
// src/lib/search.ts
|
|
1343
1550
|
function rowToTask2(row) {
|
|
1344
1551
|
return {
|
|
@@ -1895,6 +2102,7 @@ export {
|
|
|
1895
2102
|
updateAgentActivity,
|
|
1896
2103
|
updateAgent,
|
|
1897
2104
|
unlockTask,
|
|
2105
|
+
taskFromTemplate,
|
|
1898
2106
|
syncWithAgents,
|
|
1899
2107
|
syncWithAgent,
|
|
1900
2108
|
startTask,
|
|
@@ -1906,8 +2114,11 @@ export {
|
|
|
1906
2114
|
registerAgent,
|
|
1907
2115
|
now,
|
|
1908
2116
|
nextTaskShortId,
|
|
2117
|
+
logTaskChange,
|
|
1909
2118
|
lockTask,
|
|
1910
2119
|
loadConfig,
|
|
2120
|
+
listWebhooks,
|
|
2121
|
+
listTemplates,
|
|
1911
2122
|
listTasks,
|
|
1912
2123
|
listTaskLists,
|
|
1913
2124
|
listSessions,
|
|
@@ -1915,13 +2126,17 @@ export {
|
|
|
1915
2126
|
listPlans,
|
|
1916
2127
|
listComments,
|
|
1917
2128
|
listAgents,
|
|
2129
|
+
getWebhook,
|
|
2130
|
+
getTemplate,
|
|
1918
2131
|
getTaskWithRelations,
|
|
1919
2132
|
getTaskListBySlug,
|
|
1920
2133
|
getTaskList,
|
|
2134
|
+
getTaskHistory,
|
|
1921
2135
|
getTaskDependents,
|
|
1922
2136
|
getTaskDependencies,
|
|
1923
2137
|
getTask,
|
|
1924
2138
|
getSession,
|
|
2139
|
+
getRecentActivity,
|
|
1925
2140
|
getProjectByPath,
|
|
1926
2141
|
getProject,
|
|
1927
2142
|
getPlan,
|
|
@@ -1932,6 +2147,9 @@ export {
|
|
|
1932
2147
|
getAgent,
|
|
1933
2148
|
ensureTaskList,
|
|
1934
2149
|
ensureProject,
|
|
2150
|
+
dispatchWebhook,
|
|
2151
|
+
deleteWebhook,
|
|
2152
|
+
deleteTemplate,
|
|
1935
2153
|
deleteTaskList,
|
|
1936
2154
|
deleteTask,
|
|
1937
2155
|
deleteSession,
|
|
@@ -1940,6 +2158,8 @@ export {
|
|
|
1940
2158
|
deleteComment,
|
|
1941
2159
|
deleteAgent,
|
|
1942
2160
|
defaultSyncAgents,
|
|
2161
|
+
createWebhook,
|
|
2162
|
+
createTemplate,
|
|
1943
2163
|
createTaskList,
|
|
1944
2164
|
createTask,
|
|
1945
2165
|
createSession,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { Task } from "../types/index.js";
|
|
3
|
+
import { type CompletionGuardConfig } from "./config.js";
|
|
4
|
+
/**
|
|
5
|
+
* Checks completion guards before allowing a task to be marked as completed.
|
|
6
|
+
* Throws CompletionGuardError if any guard condition is violated.
|
|
7
|
+
*
|
|
8
|
+
* Guards:
|
|
9
|
+
* 1. Status check — task must be in_progress
|
|
10
|
+
* 2. Minimum work duration — must have spent enough time since startTask()
|
|
11
|
+
* 3. Rate limit — max completions per agent per time window
|
|
12
|
+
* 4. Cooldown — minimum gap between consecutive completions
|
|
13
|
+
*
|
|
14
|
+
* @param configOverride - Optional config override (used in tests)
|
|
15
|
+
*/
|
|
16
|
+
export declare function checkCompletionGuard(task: Task, agentId: string | null, db: Database, configOverride?: Required<CompletionGuardConfig>): void;
|
|
17
|
+
//# sourceMappingURL=completion-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-guard.d.ts","sourceRoot":"","sources":["../../src/lib/completion-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGnF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,EAAE,EAAE,QAAQ,EACZ,cAAc,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,GAC/C,IAAI,CAyEN"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -6,16 +6,29 @@ export interface TaskPrefixConfig {
|
|
|
6
6
|
prefix: string;
|
|
7
7
|
start_from?: number;
|
|
8
8
|
}
|
|
9
|
+
export interface CompletionGuardConfig {
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
min_work_seconds?: number;
|
|
12
|
+
max_completions_per_window?: number;
|
|
13
|
+
window_minutes?: number;
|
|
14
|
+
cooldown_seconds?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ProjectOverrideConfig {
|
|
17
|
+
completion_guard?: CompletionGuardConfig;
|
|
18
|
+
}
|
|
9
19
|
export interface TodosConfig {
|
|
10
20
|
sync_agents?: string[] | string;
|
|
11
21
|
task_list_id?: string;
|
|
12
22
|
agent_tasks_dir?: string;
|
|
13
23
|
agents?: Record<string, AgentConfig>;
|
|
14
24
|
task_prefix?: TaskPrefixConfig;
|
|
25
|
+
completion_guard?: CompletionGuardConfig;
|
|
26
|
+
project_overrides?: Record<string, ProjectOverrideConfig>;
|
|
15
27
|
}
|
|
16
28
|
export declare function loadConfig(): TodosConfig;
|
|
17
29
|
export declare function getSyncAgentsFromConfig(): string[] | null;
|
|
18
30
|
export declare function getAgentTaskListId(agent: string): string | null;
|
|
19
31
|
export declare function getAgentTasksDir(agent: string): string | null;
|
|
20
32
|
export declare function getTaskPrefixConfig(): TaskPrefixConfig | null;
|
|
33
|
+
export declare function getCompletionGuardConfig(projectPath?: string | null): Required<CompletionGuardConfig>;
|
|
21
34
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":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EAAE,WAAW,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAC3D;AASD,wBAAgB,UAAU,IAAI,WAAW,CAYxC;AAED,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,GAAG,IAAI,CAKzD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM/D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM7D;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAG7D;AAUD,wBAAgB,wBAAwB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CASrG"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -4280,6 +4280,51 @@ var MIGRATIONS = [
|
|
|
4280
4280
|
CREATE INDEX IF NOT EXISTS idx_plans_task_list ON plans(task_list_id);
|
|
4281
4281
|
CREATE INDEX IF NOT EXISTS idx_plans_agent ON plans(agent_id);
|
|
4282
4282
|
INSERT OR IGNORE INTO _migrations (id) VALUES (9);
|
|
4283
|
+
`,
|
|
4284
|
+
`
|
|
4285
|
+
CREATE TABLE IF NOT EXISTS task_history (
|
|
4286
|
+
id TEXT PRIMARY KEY,
|
|
4287
|
+
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
|
4288
|
+
action TEXT NOT NULL,
|
|
4289
|
+
field TEXT,
|
|
4290
|
+
old_value TEXT,
|
|
4291
|
+
new_value TEXT,
|
|
4292
|
+
agent_id TEXT,
|
|
4293
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
4294
|
+
);
|
|
4295
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_task ON task_history(task_id);
|
|
4296
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_agent ON task_history(agent_id);
|
|
4297
|
+
|
|
4298
|
+
CREATE TABLE IF NOT EXISTS webhooks (
|
|
4299
|
+
id TEXT PRIMARY KEY,
|
|
4300
|
+
url TEXT NOT NULL,
|
|
4301
|
+
events TEXT NOT NULL DEFAULT '[]',
|
|
4302
|
+
secret TEXT,
|
|
4303
|
+
active INTEGER NOT NULL DEFAULT 1,
|
|
4304
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
4305
|
+
);
|
|
4306
|
+
|
|
4307
|
+
CREATE TABLE IF NOT EXISTS task_templates (
|
|
4308
|
+
id TEXT PRIMARY KEY,
|
|
4309
|
+
name TEXT NOT NULL,
|
|
4310
|
+
title_pattern TEXT NOT NULL,
|
|
4311
|
+
description TEXT,
|
|
4312
|
+
priority TEXT DEFAULT 'medium',
|
|
4313
|
+
tags TEXT DEFAULT '[]',
|
|
4314
|
+
project_id TEXT REFERENCES projects(id) ON DELETE SET NULL,
|
|
4315
|
+
plan_id TEXT REFERENCES plans(id) ON DELETE SET NULL,
|
|
4316
|
+
metadata TEXT DEFAULT '{}',
|
|
4317
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
4318
|
+
);
|
|
4319
|
+
|
|
4320
|
+
ALTER TABLE tasks ADD COLUMN estimated_minutes INTEGER;
|
|
4321
|
+
ALTER TABLE tasks ADD COLUMN requires_approval INTEGER NOT NULL DEFAULT 0;
|
|
4322
|
+
ALTER TABLE tasks ADD COLUMN approved_by TEXT;
|
|
4323
|
+
ALTER TABLE tasks ADD COLUMN approved_at TEXT;
|
|
4324
|
+
|
|
4325
|
+
ALTER TABLE agents ADD COLUMN permissions TEXT DEFAULT '["*"]';
|
|
4326
|
+
|
|
4327
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (10);
|
|
4283
4328
|
`
|
|
4284
4329
|
];
|
|
4285
4330
|
var _db = null;
|
|
@@ -4324,6 +4369,24 @@ function ensureTableMigrations(db) {
|
|
|
4324
4369
|
db.exec(MIGRATIONS[5]);
|
|
4325
4370
|
} catch {}
|
|
4326
4371
|
}
|
|
4372
|
+
const ensureColumn = (table, column, type) => {
|
|
4373
|
+
try {
|
|
4374
|
+
db.query(`SELECT ${column} FROM ${table} LIMIT 0`).get();
|
|
4375
|
+
} catch {
|
|
4376
|
+
try {
|
|
4377
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${type}`);
|
|
4378
|
+
} catch {}
|
|
4379
|
+
}
|
|
4380
|
+
};
|
|
4381
|
+
ensureColumn("tasks", "due_at", "TEXT");
|
|
4382
|
+
ensureColumn("tasks", "estimated_minutes", "INTEGER");
|
|
4383
|
+
ensureColumn("tasks", "requires_approval", "INTEGER NOT NULL DEFAULT 0");
|
|
4384
|
+
ensureColumn("tasks", "approved_by", "TEXT");
|
|
4385
|
+
ensureColumn("tasks", "approved_at", "TEXT");
|
|
4386
|
+
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
4387
|
+
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
4388
|
+
ensureColumn("plans", "task_list_id", "TEXT");
|
|
4389
|
+
ensureColumn("plans", "agent_id", "TEXT");
|
|
4327
4390
|
}
|
|
4328
4391
|
function backfillTaskTags(db) {
|
|
4329
4392
|
try {
|
|
@@ -4609,7 +4672,8 @@ function rowToTask(row) {
|
|
|
4609
4672
|
tags: JSON.parse(row.tags || "[]"),
|
|
4610
4673
|
metadata: JSON.parse(row.metadata || "{}"),
|
|
4611
4674
|
status: row.status,
|
|
4612
|
-
priority: row.priority
|
|
4675
|
+
priority: row.priority,
|
|
4676
|
+
requires_approval: !!row.requires_approval
|
|
4613
4677
|
};
|
|
4614
4678
|
}
|
|
4615
4679
|
function insertTaskTags(taskId, tags, db) {
|
|
@@ -4632,8 +4696,8 @@ function createTask(input, db) {
|
|
|
4632
4696
|
const tags = input.tags || [];
|
|
4633
4697
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
4634
4698
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
4635
|
-
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)
|
|
4636
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?)`, [
|
|
4699
|
+
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)
|
|
4700
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
4637
4701
|
id,
|
|
4638
4702
|
shortId,
|
|
4639
4703
|
input.project_id || null,
|
|
@@ -4652,7 +4716,11 @@ function createTask(input, db) {
|
|
|
4652
4716
|
JSON.stringify(input.metadata || {}),
|
|
4653
4717
|
timestamp,
|
|
4654
4718
|
timestamp,
|
|
4655
|
-
input.due_at || null
|
|
4719
|
+
input.due_at || null,
|
|
4720
|
+
input.estimated_minutes || null,
|
|
4721
|
+
input.requires_approval ? 1 : 0,
|
|
4722
|
+
null,
|
|
4723
|
+
null
|
|
4656
4724
|
]);
|
|
4657
4725
|
if (tags.length > 0) {
|
|
4658
4726
|
insertTaskTags(id, tags, d);
|
|
@@ -4824,6 +4892,20 @@ function updateTask(id, input, db) {
|
|
|
4824
4892
|
sets.push("due_at = ?");
|
|
4825
4893
|
params.push(input.due_at);
|
|
4826
4894
|
}
|
|
4895
|
+
if (input.estimated_minutes !== undefined) {
|
|
4896
|
+
sets.push("estimated_minutes = ?");
|
|
4897
|
+
params.push(input.estimated_minutes);
|
|
4898
|
+
}
|
|
4899
|
+
if (input.requires_approval !== undefined) {
|
|
4900
|
+
sets.push("requires_approval = ?");
|
|
4901
|
+
params.push(input.requires_approval ? 1 : 0);
|
|
4902
|
+
}
|
|
4903
|
+
if (input.approved_by !== undefined) {
|
|
4904
|
+
sets.push("approved_by = ?");
|
|
4905
|
+
params.push(input.approved_by);
|
|
4906
|
+
sets.push("approved_at = ?");
|
|
4907
|
+
params.push(now());
|
|
4908
|
+
}
|
|
4827
4909
|
params.push(id, input.version);
|
|
4828
4910
|
const result = d.run(`UPDATE tasks SET ${sets.join(", ")} WHERE id = ? AND version = ?`, params);
|
|
4829
4911
|
if (result.changes === 0) {
|
|
@@ -5043,6 +5125,7 @@ function shortUuid() {
|
|
|
5043
5125
|
function rowToAgent(row) {
|
|
5044
5126
|
return {
|
|
5045
5127
|
...row,
|
|
5128
|
+
permissions: JSON.parse(row.permissions || '["*"]'),
|
|
5046
5129
|
metadata: JSON.parse(row.metadata || "{}")
|
|
5047
5130
|
};
|
|
5048
5131
|
}
|
|
@@ -5055,8 +5138,17 @@ function registerAgent(input, db) {
|
|
|
5055
5138
|
}
|
|
5056
5139
|
const id = shortUuid();
|
|
5057
5140
|
const timestamp = now();
|
|
5058
|
-
d.run(`INSERT INTO agents (id, name, description, role, metadata, created_at, last_seen_at)
|
|
5059
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`, [
|
|
5141
|
+
d.run(`INSERT INTO agents (id, name, description, role, permissions, metadata, created_at, last_seen_at)
|
|
5142
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
5143
|
+
id,
|
|
5144
|
+
input.name,
|
|
5145
|
+
input.description || null,
|
|
5146
|
+
input.role || "agent",
|
|
5147
|
+
JSON.stringify(input.permissions || ["*"]),
|
|
5148
|
+
JSON.stringify(input.metadata || {}),
|
|
5149
|
+
timestamp,
|
|
5150
|
+
timestamp
|
|
5151
|
+
]);
|
|
5060
5152
|
return getAgent(id, d);
|
|
5061
5153
|
}
|
|
5062
5154
|
function getAgent(id, db) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
|
package/dist/server/index.js
CHANGED
|
@@ -172,6 +172,24 @@ function ensureTableMigrations(db) {
|
|
|
172
172
|
db.exec(MIGRATIONS[5]);
|
|
173
173
|
} catch {}
|
|
174
174
|
}
|
|
175
|
+
const ensureColumn = (table, column, type) => {
|
|
176
|
+
try {
|
|
177
|
+
db.query(`SELECT ${column} FROM ${table} LIMIT 0`).get();
|
|
178
|
+
} catch {
|
|
179
|
+
try {
|
|
180
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${type}`);
|
|
181
|
+
} catch {}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
ensureColumn("tasks", "due_at", "TEXT");
|
|
185
|
+
ensureColumn("tasks", "estimated_minutes", "INTEGER");
|
|
186
|
+
ensureColumn("tasks", "requires_approval", "INTEGER NOT NULL DEFAULT 0");
|
|
187
|
+
ensureColumn("tasks", "approved_by", "TEXT");
|
|
188
|
+
ensureColumn("tasks", "approved_at", "TEXT");
|
|
189
|
+
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
190
|
+
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
191
|
+
ensureColumn("plans", "task_list_id", "TEXT");
|
|
192
|
+
ensureColumn("plans", "agent_id", "TEXT");
|
|
175
193
|
}
|
|
176
194
|
function backfillTaskTags(db) {
|
|
177
195
|
try {
|
|
@@ -387,6 +405,51 @@ var init_database = __esm(() => {
|
|
|
387
405
|
CREATE INDEX IF NOT EXISTS idx_plans_task_list ON plans(task_list_id);
|
|
388
406
|
CREATE INDEX IF NOT EXISTS idx_plans_agent ON plans(agent_id);
|
|
389
407
|
INSERT OR IGNORE INTO _migrations (id) VALUES (9);
|
|
408
|
+
`,
|
|
409
|
+
`
|
|
410
|
+
CREATE TABLE IF NOT EXISTS task_history (
|
|
411
|
+
id TEXT PRIMARY KEY,
|
|
412
|
+
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
|
413
|
+
action TEXT NOT NULL,
|
|
414
|
+
field TEXT,
|
|
415
|
+
old_value TEXT,
|
|
416
|
+
new_value TEXT,
|
|
417
|
+
agent_id TEXT,
|
|
418
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
419
|
+
);
|
|
420
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_task ON task_history(task_id);
|
|
421
|
+
CREATE INDEX IF NOT EXISTS idx_task_history_agent ON task_history(agent_id);
|
|
422
|
+
|
|
423
|
+
CREATE TABLE IF NOT EXISTS webhooks (
|
|
424
|
+
id TEXT PRIMARY KEY,
|
|
425
|
+
url TEXT NOT NULL,
|
|
426
|
+
events TEXT NOT NULL DEFAULT '[]',
|
|
427
|
+
secret TEXT,
|
|
428
|
+
active INTEGER NOT NULL DEFAULT 1,
|
|
429
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
430
|
+
);
|
|
431
|
+
|
|
432
|
+
CREATE TABLE IF NOT EXISTS task_templates (
|
|
433
|
+
id TEXT PRIMARY KEY,
|
|
434
|
+
name TEXT NOT NULL,
|
|
435
|
+
title_pattern TEXT NOT NULL,
|
|
436
|
+
description TEXT,
|
|
437
|
+
priority TEXT DEFAULT 'medium',
|
|
438
|
+
tags TEXT DEFAULT '[]',
|
|
439
|
+
project_id TEXT REFERENCES projects(id) ON DELETE SET NULL,
|
|
440
|
+
plan_id TEXT REFERENCES plans(id) ON DELETE SET NULL,
|
|
441
|
+
metadata TEXT DEFAULT '{}',
|
|
442
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
443
|
+
);
|
|
444
|
+
|
|
445
|
+
ALTER TABLE tasks ADD COLUMN estimated_minutes INTEGER;
|
|
446
|
+
ALTER TABLE tasks ADD COLUMN requires_approval INTEGER NOT NULL DEFAULT 0;
|
|
447
|
+
ALTER TABLE tasks ADD COLUMN approved_by TEXT;
|
|
448
|
+
ALTER TABLE tasks ADD COLUMN approved_at TEXT;
|
|
449
|
+
|
|
450
|
+
ALTER TABLE agents ADD COLUMN permissions TEXT DEFAULT '["*"]';
|
|
451
|
+
|
|
452
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (10);
|
|
390
453
|
`
|
|
391
454
|
];
|
|
392
455
|
});
|
|
@@ -524,6 +587,7 @@ function shortUuid() {
|
|
|
524
587
|
function rowToAgent(row) {
|
|
525
588
|
return {
|
|
526
589
|
...row,
|
|
590
|
+
permissions: JSON.parse(row.permissions || '["*"]'),
|
|
527
591
|
metadata: JSON.parse(row.metadata || "{}")
|
|
528
592
|
};
|
|
529
593
|
}
|
|
@@ -536,8 +600,17 @@ function registerAgent(input, db) {
|
|
|
536
600
|
}
|
|
537
601
|
const id = shortUuid();
|
|
538
602
|
const timestamp = now();
|
|
539
|
-
d.run(`INSERT INTO agents (id, name, description, role, metadata, created_at, last_seen_at)
|
|
540
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)`, [
|
|
603
|
+
d.run(`INSERT INTO agents (id, name, description, role, permissions, metadata, created_at, last_seen_at)
|
|
604
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
605
|
+
id,
|
|
606
|
+
input.name,
|
|
607
|
+
input.description || null,
|
|
608
|
+
input.role || "agent",
|
|
609
|
+
JSON.stringify(input.permissions || ["*"]),
|
|
610
|
+
JSON.stringify(input.metadata || {}),
|
|
611
|
+
timestamp,
|
|
612
|
+
timestamp
|
|
613
|
+
]);
|
|
541
614
|
return getAgent(id, d);
|
|
542
615
|
}
|
|
543
616
|
function getAgent(id, db) {
|
|
@@ -577,6 +650,10 @@ function updateAgent(id, input, db) {
|
|
|
577
650
|
sets.push("role = ?");
|
|
578
651
|
params.push(input.role);
|
|
579
652
|
}
|
|
653
|
+
if (input.permissions !== undefined) {
|
|
654
|
+
sets.push("permissions = ?");
|
|
655
|
+
params.push(JSON.stringify(input.permissions));
|
|
656
|
+
}
|
|
580
657
|
if (input.metadata !== undefined) {
|
|
581
658
|
sets.push("metadata = ?");
|
|
582
659
|
params.push(JSON.stringify(input.metadata));
|
|
@@ -706,7 +783,8 @@ function rowToTask(row) {
|
|
|
706
783
|
tags: JSON.parse(row.tags || "[]"),
|
|
707
784
|
metadata: JSON.parse(row.metadata || "{}"),
|
|
708
785
|
status: row.status,
|
|
709
|
-
priority: row.priority
|
|
786
|
+
priority: row.priority,
|
|
787
|
+
requires_approval: !!row.requires_approval
|
|
710
788
|
};
|
|
711
789
|
}
|
|
712
790
|
function insertTaskTags(taskId, tags, db) {
|
|
@@ -729,8 +807,8 @@ function createTask(input, db) {
|
|
|
729
807
|
const tags = input.tags || [];
|
|
730
808
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
731
809
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
732
|
-
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)
|
|
733
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?)`, [
|
|
810
|
+
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)
|
|
811
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
734
812
|
id,
|
|
735
813
|
shortId,
|
|
736
814
|
input.project_id || null,
|
|
@@ -749,7 +827,11 @@ function createTask(input, db) {
|
|
|
749
827
|
JSON.stringify(input.metadata || {}),
|
|
750
828
|
timestamp,
|
|
751
829
|
timestamp,
|
|
752
|
-
input.due_at || null
|
|
830
|
+
input.due_at || null,
|
|
831
|
+
input.estimated_minutes || null,
|
|
832
|
+
input.requires_approval ? 1 : 0,
|
|
833
|
+
null,
|
|
834
|
+
null
|
|
753
835
|
]);
|
|
754
836
|
if (tags.length > 0) {
|
|
755
837
|
insertTaskTags(id, tags, d);
|
|
@@ -895,6 +977,20 @@ function updateTask(id, input, db) {
|
|
|
895
977
|
sets.push("due_at = ?");
|
|
896
978
|
params.push(input.due_at);
|
|
897
979
|
}
|
|
980
|
+
if (input.estimated_minutes !== undefined) {
|
|
981
|
+
sets.push("estimated_minutes = ?");
|
|
982
|
+
params.push(input.estimated_minutes);
|
|
983
|
+
}
|
|
984
|
+
if (input.requires_approval !== undefined) {
|
|
985
|
+
sets.push("requires_approval = ?");
|
|
986
|
+
params.push(input.requires_approval ? 1 : 0);
|
|
987
|
+
}
|
|
988
|
+
if (input.approved_by !== undefined) {
|
|
989
|
+
sets.push("approved_by = ?");
|
|
990
|
+
params.push(input.approved_by);
|
|
991
|
+
sets.push("approved_at = ?");
|
|
992
|
+
params.push(now());
|
|
993
|
+
}
|
|
898
994
|
params.push(id, input.version);
|
|
899
995
|
const result = d.run(`UPDATE tasks SET ${sets.join(", ")} WHERE id = ? AND version = ?`, params);
|
|
900
996
|
if (result.changes === 0) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP server for the Todos dashboard.
|
|
3
|
+
* Serves the Vite-built React/shadcn dashboard from dashboard/dist/.
|
|
4
|
+
* Provides REST API endpoints for task management.
|
|
5
|
+
*/
|
|
6
|
+
export declare function startServer(port: number, options?: {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=serve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/server/serve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8GH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwZ3F"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface Project {
|
|
|
10
10
|
path: string;
|
|
11
11
|
description: string | null;
|
|
12
12
|
task_list_id: string | null;
|
|
13
|
+
task_prefix: string | null;
|
|
14
|
+
task_counter: number;
|
|
13
15
|
created_at: string;
|
|
14
16
|
updated_at: string;
|
|
15
17
|
}
|
|
@@ -18,10 +20,13 @@ export interface CreateProjectInput {
|
|
|
18
20
|
path: string;
|
|
19
21
|
description?: string;
|
|
20
22
|
task_list_id?: string;
|
|
23
|
+
task_prefix?: string;
|
|
21
24
|
}
|
|
22
25
|
export interface Plan {
|
|
23
26
|
id: string;
|
|
24
27
|
project_id: string | null;
|
|
28
|
+
task_list_id: string | null;
|
|
29
|
+
agent_id: string | null;
|
|
25
30
|
name: string;
|
|
26
31
|
description: string | null;
|
|
27
32
|
status: PlanStatus;
|
|
@@ -31,6 +36,8 @@ export interface Plan {
|
|
|
31
36
|
export interface CreatePlanInput {
|
|
32
37
|
name: string;
|
|
33
38
|
project_id?: string;
|
|
39
|
+
task_list_id?: string;
|
|
40
|
+
agent_id?: string;
|
|
34
41
|
description?: string;
|
|
35
42
|
status?: PlanStatus;
|
|
36
43
|
}
|
|
@@ -38,11 +45,15 @@ export interface UpdatePlanInput {
|
|
|
38
45
|
name?: string;
|
|
39
46
|
description?: string;
|
|
40
47
|
status?: PlanStatus;
|
|
48
|
+
task_list_id?: string;
|
|
49
|
+
agent_id?: string;
|
|
41
50
|
}
|
|
42
51
|
export interface Agent {
|
|
43
52
|
id: string;
|
|
44
53
|
name: string;
|
|
45
54
|
description: string | null;
|
|
55
|
+
role: string | null;
|
|
56
|
+
permissions: string[];
|
|
46
57
|
metadata: Record<string, unknown>;
|
|
47
58
|
created_at: string;
|
|
48
59
|
last_seen_at: string;
|
|
@@ -51,6 +62,8 @@ export interface AgentRow {
|
|
|
51
62
|
id: string;
|
|
52
63
|
name: string;
|
|
53
64
|
description: string | null;
|
|
65
|
+
role: string | null;
|
|
66
|
+
permissions: string | null;
|
|
54
67
|
metadata: string | null;
|
|
55
68
|
created_at: string;
|
|
56
69
|
last_seen_at: string;
|
|
@@ -58,6 +71,8 @@ export interface AgentRow {
|
|
|
58
71
|
export interface RegisterAgentInput {
|
|
59
72
|
name: string;
|
|
60
73
|
description?: string;
|
|
74
|
+
role?: string;
|
|
75
|
+
permissions?: string[];
|
|
61
76
|
metadata?: Record<string, unknown>;
|
|
62
77
|
}
|
|
63
78
|
export interface TaskList {
|
|
@@ -94,6 +109,7 @@ export interface UpdateTaskListInput {
|
|
|
94
109
|
}
|
|
95
110
|
export interface Task {
|
|
96
111
|
id: string;
|
|
112
|
+
short_id: string | null;
|
|
97
113
|
project_id: string | null;
|
|
98
114
|
parent_id: string | null;
|
|
99
115
|
plan_id: string | null;
|
|
@@ -114,6 +130,11 @@ export interface Task {
|
|
|
114
130
|
created_at: string;
|
|
115
131
|
updated_at: string;
|
|
116
132
|
completed_at: string | null;
|
|
133
|
+
due_at: string | null;
|
|
134
|
+
estimated_minutes: number | null;
|
|
135
|
+
requires_approval: boolean;
|
|
136
|
+
approved_by: string | null;
|
|
137
|
+
approved_at: string | null;
|
|
117
138
|
}
|
|
118
139
|
export interface TaskWithRelations extends Task {
|
|
119
140
|
subtasks: Task[];
|
|
@@ -137,6 +158,9 @@ export interface CreateTaskInput {
|
|
|
137
158
|
working_dir?: string;
|
|
138
159
|
tags?: string[];
|
|
139
160
|
metadata?: Record<string, unknown>;
|
|
161
|
+
due_at?: string;
|
|
162
|
+
estimated_minutes?: number;
|
|
163
|
+
requires_approval?: boolean;
|
|
140
164
|
}
|
|
141
165
|
export interface UpdateTaskInput {
|
|
142
166
|
title?: string;
|
|
@@ -148,6 +172,10 @@ export interface UpdateTaskInput {
|
|
|
148
172
|
task_list_id?: string;
|
|
149
173
|
tags?: string[];
|
|
150
174
|
metadata?: Record<string, unknown>;
|
|
175
|
+
due_at?: string;
|
|
176
|
+
estimated_minutes?: number;
|
|
177
|
+
requires_approval?: boolean;
|
|
178
|
+
approved_by?: string;
|
|
151
179
|
version: number;
|
|
152
180
|
}
|
|
153
181
|
export interface TaskFilter {
|
|
@@ -200,6 +228,7 @@ export interface CreateSessionInput {
|
|
|
200
228
|
}
|
|
201
229
|
export interface TaskRow {
|
|
202
230
|
id: string;
|
|
231
|
+
short_id: string | null;
|
|
203
232
|
project_id: string | null;
|
|
204
233
|
parent_id: string | null;
|
|
205
234
|
plan_id: string | null;
|
|
@@ -220,6 +249,11 @@ export interface TaskRow {
|
|
|
220
249
|
created_at: string;
|
|
221
250
|
updated_at: string;
|
|
222
251
|
completed_at: string | null;
|
|
252
|
+
due_at: string | null;
|
|
253
|
+
estimated_minutes: number | null;
|
|
254
|
+
requires_approval: number;
|
|
255
|
+
approved_by: string | null;
|
|
256
|
+
approved_at: string | null;
|
|
223
257
|
}
|
|
224
258
|
export interface SessionRow {
|
|
225
259
|
id: string;
|
|
@@ -236,6 +270,51 @@ export interface LockResult {
|
|
|
236
270
|
locked_at?: string;
|
|
237
271
|
error?: string;
|
|
238
272
|
}
|
|
273
|
+
export interface TaskHistory {
|
|
274
|
+
id: string;
|
|
275
|
+
task_id: string;
|
|
276
|
+
action: string;
|
|
277
|
+
field: string | null;
|
|
278
|
+
old_value: string | null;
|
|
279
|
+
new_value: string | null;
|
|
280
|
+
agent_id: string | null;
|
|
281
|
+
created_at: string;
|
|
282
|
+
}
|
|
283
|
+
export interface Webhook {
|
|
284
|
+
id: string;
|
|
285
|
+
url: string;
|
|
286
|
+
events: string[];
|
|
287
|
+
secret: string | null;
|
|
288
|
+
active: boolean;
|
|
289
|
+
created_at: string;
|
|
290
|
+
}
|
|
291
|
+
export interface CreateWebhookInput {
|
|
292
|
+
url: string;
|
|
293
|
+
events?: string[];
|
|
294
|
+
secret?: string;
|
|
295
|
+
}
|
|
296
|
+
export interface TaskTemplate {
|
|
297
|
+
id: string;
|
|
298
|
+
name: string;
|
|
299
|
+
title_pattern: string;
|
|
300
|
+
description: string | null;
|
|
301
|
+
priority: TaskPriority;
|
|
302
|
+
tags: string[];
|
|
303
|
+
project_id: string | null;
|
|
304
|
+
plan_id: string | null;
|
|
305
|
+
metadata: Record<string, unknown>;
|
|
306
|
+
created_at: string;
|
|
307
|
+
}
|
|
308
|
+
export interface CreateTemplateInput {
|
|
309
|
+
name: string;
|
|
310
|
+
title_pattern: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
priority?: TaskPriority;
|
|
313
|
+
tags?: string[];
|
|
314
|
+
project_id?: string;
|
|
315
|
+
plan_id?: string;
|
|
316
|
+
metadata?: Record<string, unknown>;
|
|
317
|
+
}
|
|
239
318
|
export declare class VersionConflictError extends Error {
|
|
240
319
|
taskId: string;
|
|
241
320
|
expectedVersion: number;
|
|
@@ -272,4 +351,9 @@ export declare class DependencyCycleError extends Error {
|
|
|
272
351
|
dependsOn: string;
|
|
273
352
|
constructor(taskId: string, dependsOn: string);
|
|
274
353
|
}
|
|
354
|
+
export declare class CompletionGuardError extends Error {
|
|
355
|
+
reason: string;
|
|
356
|
+
retryAfterSeconds?: number | undefined;
|
|
357
|
+
constructor(reason: string, retryAfterSeconds?: number | undefined);
|
|
358
|
+
}
|
|
275
359
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,yEAMhB,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAGxD,eAAO,MAAM,eAAe,gDAKlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAG5D,eAAO,MAAM,aAAa,8C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