@hasna/todos 0.9.30 → 0.9.31
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 +22 -6
- package/dist/index.js +16 -2
- package/dist/mcp/index.js +19 -4
- package/dist/server/index.js +16 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2254,6 +2254,8 @@ function ensureSchema(db) {
|
|
|
2254
2254
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
2255
2255
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
2256
2256
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
2257
|
+
ensureColumn("agents", "title", "TEXT");
|
|
2258
|
+
ensureColumn("agents", "level", "TEXT");
|
|
2257
2259
|
ensureColumn("plans", "task_list_id", "TEXT");
|
|
2258
2260
|
ensureColumn("plans", "agent_id", "TEXT");
|
|
2259
2261
|
ensureIndex("CREATE INDEX IF NOT EXISTS idx_tasks_plan ON tasks(plan_id)");
|
|
@@ -2548,6 +2550,8 @@ var init_database = __esm(() => {
|
|
|
2548
2550
|
`,
|
|
2549
2551
|
`
|
|
2550
2552
|
ALTER TABLE agents ADD COLUMN reports_to TEXT;
|
|
2553
|
+
ALTER TABLE agents ADD COLUMN title TEXT;
|
|
2554
|
+
ALTER TABLE agents ADD COLUMN level TEXT;
|
|
2551
2555
|
INSERT OR IGNORE INTO _migrations (id) VALUES (11);
|
|
2552
2556
|
`
|
|
2553
2557
|
];
|
|
@@ -3393,12 +3397,14 @@ function registerAgent(input, db) {
|
|
|
3393
3397
|
}
|
|
3394
3398
|
const id = shortUuid();
|
|
3395
3399
|
const timestamp = now();
|
|
3396
|
-
d.run(`INSERT INTO agents (id, name, description, role, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
3397
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
3400
|
+
d.run(`INSERT INTO agents (id, name, description, role, title, level, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
3401
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
3398
3402
|
id,
|
|
3399
3403
|
input.name,
|
|
3400
3404
|
input.description || null,
|
|
3401
3405
|
input.role || "agent",
|
|
3406
|
+
input.title || null,
|
|
3407
|
+
input.level || null,
|
|
3402
3408
|
JSON.stringify(input.permissions || ["*"]),
|
|
3403
3409
|
input.reports_to || null,
|
|
3404
3410
|
JSON.stringify(input.metadata || {}),
|
|
@@ -3448,6 +3454,14 @@ function updateAgent(id, input, db) {
|
|
|
3448
3454
|
sets.push("permissions = ?");
|
|
3449
3455
|
params.push(JSON.stringify(input.permissions));
|
|
3450
3456
|
}
|
|
3457
|
+
if (input.title !== undefined) {
|
|
3458
|
+
sets.push("title = ?");
|
|
3459
|
+
params.push(input.title);
|
|
3460
|
+
}
|
|
3461
|
+
if (input.level !== undefined) {
|
|
3462
|
+
sets.push("level = ?");
|
|
3463
|
+
params.push(input.level);
|
|
3464
|
+
}
|
|
3451
3465
|
if (input.reports_to !== undefined) {
|
|
3452
3466
|
sets.push("reports_to = ?");
|
|
3453
3467
|
params.push(input.reports_to);
|
|
@@ -9241,8 +9255,9 @@ In Progress:`);
|
|
|
9241
9255
|
let render = function(nodes, indent = 0) {
|
|
9242
9256
|
return nodes.map((n) => {
|
|
9243
9257
|
const prefix = " ".repeat(indent);
|
|
9244
|
-
const
|
|
9245
|
-
const
|
|
9258
|
+
const title = n.agent.title ? ` \u2014 ${n.agent.title}` : "";
|
|
9259
|
+
const level = n.agent.level ? ` (${n.agent.level})` : "";
|
|
9260
|
+
const line = `${prefix}${n.agent.name}${title}${level}`;
|
|
9246
9261
|
const children = n.reports.length > 0 ? `
|
|
9247
9262
|
` + render(n.reports, indent + 1) : "";
|
|
9248
9263
|
return line + children;
|
|
@@ -12318,8 +12333,9 @@ program2.command("org").description("Show agent org chart \u2014 who reports to
|
|
|
12318
12333
|
function render2(nodes, indent = 0) {
|
|
12319
12334
|
for (const n of nodes) {
|
|
12320
12335
|
const prefix = " ".repeat(indent);
|
|
12321
|
-
const
|
|
12322
|
-
|
|
12336
|
+
const title = n.agent.title ? chalk.cyan(` \u2014 ${n.agent.title}`) : "";
|
|
12337
|
+
const level = n.agent.level ? chalk.dim(` (${n.agent.level})`) : "";
|
|
12338
|
+
console.log(`${prefix}${indent > 0 ? "\u251C\u2500\u2500 " : ""}${chalk.bold(n.agent.name)}${title}${level}`);
|
|
12323
12339
|
render2(n.reports, indent + 1);
|
|
12324
12340
|
}
|
|
12325
12341
|
}
|
package/dist/index.js
CHANGED
|
@@ -267,6 +267,8 @@ var MIGRATIONS = [
|
|
|
267
267
|
`,
|
|
268
268
|
`
|
|
269
269
|
ALTER TABLE agents ADD COLUMN reports_to TEXT;
|
|
270
|
+
ALTER TABLE agents ADD COLUMN title TEXT;
|
|
271
|
+
ALTER TABLE agents ADD COLUMN level TEXT;
|
|
270
272
|
INSERT OR IGNORE INTO _migrations (id) VALUES (11);
|
|
271
273
|
`
|
|
272
274
|
];
|
|
@@ -390,6 +392,8 @@ function ensureSchema(db) {
|
|
|
390
392
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
391
393
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
392
394
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
395
|
+
ensureColumn("agents", "title", "TEXT");
|
|
396
|
+
ensureColumn("agents", "level", "TEXT");
|
|
393
397
|
ensureColumn("plans", "task_list_id", "TEXT");
|
|
394
398
|
ensureColumn("plans", "agent_id", "TEXT");
|
|
395
399
|
ensureIndex("CREATE INDEX IF NOT EXISTS idx_tasks_plan ON tasks(plan_id)");
|
|
@@ -1393,12 +1397,14 @@ function registerAgent(input, db) {
|
|
|
1393
1397
|
}
|
|
1394
1398
|
const id = shortUuid();
|
|
1395
1399
|
const timestamp = now();
|
|
1396
|
-
d.run(`INSERT INTO agents (id, name, description, role, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
1397
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1400
|
+
d.run(`INSERT INTO agents (id, name, description, role, title, level, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
1401
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1398
1402
|
id,
|
|
1399
1403
|
input.name,
|
|
1400
1404
|
input.description || null,
|
|
1401
1405
|
input.role || "agent",
|
|
1406
|
+
input.title || null,
|
|
1407
|
+
input.level || null,
|
|
1402
1408
|
JSON.stringify(input.permissions || ["*"]),
|
|
1403
1409
|
input.reports_to || null,
|
|
1404
1410
|
JSON.stringify(input.metadata || {}),
|
|
@@ -1448,6 +1454,14 @@ function updateAgent(id, input, db) {
|
|
|
1448
1454
|
sets.push("permissions = ?");
|
|
1449
1455
|
params.push(JSON.stringify(input.permissions));
|
|
1450
1456
|
}
|
|
1457
|
+
if (input.title !== undefined) {
|
|
1458
|
+
sets.push("title = ?");
|
|
1459
|
+
params.push(input.title);
|
|
1460
|
+
}
|
|
1461
|
+
if (input.level !== undefined) {
|
|
1462
|
+
sets.push("level = ?");
|
|
1463
|
+
params.push(input.level);
|
|
1464
|
+
}
|
|
1451
1465
|
if (input.reports_to !== undefined) {
|
|
1452
1466
|
sets.push("reports_to = ?");
|
|
1453
1467
|
params.push(input.reports_to);
|
package/dist/mcp/index.js
CHANGED
|
@@ -188,6 +188,8 @@ function ensureSchema(db) {
|
|
|
188
188
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
189
189
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
190
190
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
191
|
+
ensureColumn("agents", "title", "TEXT");
|
|
192
|
+
ensureColumn("agents", "level", "TEXT");
|
|
191
193
|
ensureColumn("plans", "task_list_id", "TEXT");
|
|
192
194
|
ensureColumn("plans", "agent_id", "TEXT");
|
|
193
195
|
ensureIndex("CREATE INDEX IF NOT EXISTS idx_tasks_plan ON tasks(plan_id)");
|
|
@@ -482,6 +484,8 @@ var init_database = __esm(() => {
|
|
|
482
484
|
`,
|
|
483
485
|
`
|
|
484
486
|
ALTER TABLE agents ADD COLUMN reports_to TEXT;
|
|
487
|
+
ALTER TABLE agents ADD COLUMN title TEXT;
|
|
488
|
+
ALTER TABLE agents ADD COLUMN level TEXT;
|
|
485
489
|
INSERT OR IGNORE INTO _migrations (id) VALUES (11);
|
|
486
490
|
`
|
|
487
491
|
];
|
|
@@ -546,12 +550,14 @@ function registerAgent(input, db) {
|
|
|
546
550
|
}
|
|
547
551
|
const id = shortUuid();
|
|
548
552
|
const timestamp = now();
|
|
549
|
-
d.run(`INSERT INTO agents (id, name, description, role, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
550
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
553
|
+
d.run(`INSERT INTO agents (id, name, description, role, title, level, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
554
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
551
555
|
id,
|
|
552
556
|
input.name,
|
|
553
557
|
input.description || null,
|
|
554
558
|
input.role || "agent",
|
|
559
|
+
input.title || null,
|
|
560
|
+
input.level || null,
|
|
555
561
|
JSON.stringify(input.permissions || ["*"]),
|
|
556
562
|
input.reports_to || null,
|
|
557
563
|
JSON.stringify(input.metadata || {}),
|
|
@@ -601,6 +607,14 @@ function updateAgent(id, input, db) {
|
|
|
601
607
|
sets.push("permissions = ?");
|
|
602
608
|
params.push(JSON.stringify(input.permissions));
|
|
603
609
|
}
|
|
610
|
+
if (input.title !== undefined) {
|
|
611
|
+
sets.push("title = ?");
|
|
612
|
+
params.push(input.title);
|
|
613
|
+
}
|
|
614
|
+
if (input.level !== undefined) {
|
|
615
|
+
sets.push("level = ?");
|
|
616
|
+
params.push(input.level);
|
|
617
|
+
}
|
|
604
618
|
if (input.reports_to !== undefined) {
|
|
605
619
|
sets.push("reports_to = ?");
|
|
606
620
|
params.push(input.reports_to);
|
|
@@ -7061,8 +7075,9 @@ server.tool("get_org_chart", "Get agent org chart \u2014 who reports to who.", {
|
|
|
7061
7075
|
let render = function(nodes, indent = 0) {
|
|
7062
7076
|
return nodes.map((n) => {
|
|
7063
7077
|
const prefix = " ".repeat(indent);
|
|
7064
|
-
const
|
|
7065
|
-
const
|
|
7078
|
+
const title = n.agent.title ? ` \u2014 ${n.agent.title}` : "";
|
|
7079
|
+
const level = n.agent.level ? ` (${n.agent.level})` : "";
|
|
7080
|
+
const line = `${prefix}${n.agent.name}${title}${level}`;
|
|
7066
7081
|
const children = n.reports.length > 0 ? `
|
|
7067
7082
|
` + render(n.reports, indent + 1) : "";
|
|
7068
7083
|
return line + children;
|
package/dist/server/index.js
CHANGED
|
@@ -250,6 +250,8 @@ function ensureSchema(db) {
|
|
|
250
250
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
251
251
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
252
252
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
253
|
+
ensureColumn("agents", "title", "TEXT");
|
|
254
|
+
ensureColumn("agents", "level", "TEXT");
|
|
253
255
|
ensureColumn("plans", "task_list_id", "TEXT");
|
|
254
256
|
ensureColumn("plans", "agent_id", "TEXT");
|
|
255
257
|
ensureIndex("CREATE INDEX IF NOT EXISTS idx_tasks_plan ON tasks(plan_id)");
|
|
@@ -530,6 +532,8 @@ var init_database = __esm(() => {
|
|
|
530
532
|
`,
|
|
531
533
|
`
|
|
532
534
|
ALTER TABLE agents ADD COLUMN reports_to TEXT;
|
|
535
|
+
ALTER TABLE agents ADD COLUMN title TEXT;
|
|
536
|
+
ALTER TABLE agents ADD COLUMN level TEXT;
|
|
533
537
|
INSERT OR IGNORE INTO _migrations (id) VALUES (11);
|
|
534
538
|
`
|
|
535
539
|
];
|
|
@@ -710,12 +714,14 @@ function registerAgent(input, db) {
|
|
|
710
714
|
}
|
|
711
715
|
const id = shortUuid();
|
|
712
716
|
const timestamp = now();
|
|
713
|
-
d.run(`INSERT INTO agents (id, name, description, role, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
714
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
717
|
+
d.run(`INSERT INTO agents (id, name, description, role, title, level, permissions, reports_to, metadata, created_at, last_seen_at)
|
|
718
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
715
719
|
id,
|
|
716
720
|
input.name,
|
|
717
721
|
input.description || null,
|
|
718
722
|
input.role || "agent",
|
|
723
|
+
input.title || null,
|
|
724
|
+
input.level || null,
|
|
719
725
|
JSON.stringify(input.permissions || ["*"]),
|
|
720
726
|
input.reports_to || null,
|
|
721
727
|
JSON.stringify(input.metadata || {}),
|
|
@@ -765,6 +771,14 @@ function updateAgent(id, input, db) {
|
|
|
765
771
|
sets.push("permissions = ?");
|
|
766
772
|
params.push(JSON.stringify(input.permissions));
|
|
767
773
|
}
|
|
774
|
+
if (input.title !== undefined) {
|
|
775
|
+
sets.push("title = ?");
|
|
776
|
+
params.push(input.title);
|
|
777
|
+
}
|
|
778
|
+
if (input.level !== undefined) {
|
|
779
|
+
sets.push("level = ?");
|
|
780
|
+
params.push(input.level);
|
|
781
|
+
}
|
|
768
782
|
if (input.reports_to !== undefined) {
|
|
769
783
|
sets.push("reports_to = ?");
|
|
770
784
|
params.push(input.reports_to);
|