@hasna/todos 0.11.1 → 0.11.2
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/brains.d.ts +3 -0
- package/dist/cli/brains.d.ts.map +1 -0
- package/dist/cli/index.js +887 -546
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +149 -27
- package/dist/lib/gatherer.d.ts +16 -0
- package/dist/lib/gatherer.d.ts.map +1 -0
- package/dist/lib/model-config.d.ts +14 -0
- package/dist/lib/model-config.d.ts.map +1 -0
- package/dist/mcp/index.js +35 -9
- package/dist/server/index.js +5 -16
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export { createTaskList, getTaskList, getTaskListBySlug, listTaskLists, updateTa
|
|
|
12
12
|
export { createSession, getSession, listSessions, updateSessionActivity, deleteSession, } from "./db/sessions.js";
|
|
13
13
|
export { logTaskChange, getTaskHistory, getRecentActivity, getRecap } from "./db/audit.js";
|
|
14
14
|
export type { RecapSummary } from "./db/audit.js";
|
|
15
|
+
export { gatherTrainingData } from "./lib/gatherer.js";
|
|
16
|
+
export { getActiveModel, setActiveModel, clearActiveModel, DEFAULT_MODEL, } from "./lib/model-config.js";
|
|
15
17
|
export { createWebhook, getWebhook, listWebhooks, deleteWebhook, dispatchWebhook } from "./db/webhooks.js";
|
|
16
18
|
export { createTemplate, getTemplate, listTemplates, deleteTemplate, taskFromTemplate } from "./db/templates.js";
|
|
17
19
|
export { getChecklist, addChecklistItem, checkChecklistItem, updateChecklistItemText, removeChecklistItem, clearChecklist, getChecklistStats, } from "./db/checklists.js";
|
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,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,kBA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B,EAClB,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,IAAI,EACJ,eAAe,EACf,eAAe,EACf,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,KAAK,EACL,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,UAAU,EACV,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,GAAG,EACH,cAAc,GACf,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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,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,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,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kB,EAClB,YAAY,EACZ,mBAAmB,EACnB,GAAG,EACH,cAAc,GACf,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
|
@@ -3451,6 +3451,123 @@ function deleteSession(id, db) {
|
|
|
3451
3451
|
const result = d.run("DELETE FROM sessions WHERE id = ?", [id]);
|
|
3452
3452
|
return result.changes > 0;
|
|
3453
3453
|
}
|
|
3454
|
+
// src/lib/gatherer.ts
|
|
3455
|
+
var SYSTEM_PROMPT = "You are a task management assistant that creates, updates, and tracks tasks and projects.";
|
|
3456
|
+
function taskToCreateExample(task) {
|
|
3457
|
+
const userMsg = `Create a task: ${task.title}${task.description ? `
|
|
3458
|
+
|
|
3459
|
+
Description: ${task.description}` : ""}`;
|
|
3460
|
+
const taskDetails = {
|
|
3461
|
+
id: task.short_id ?? task.id,
|
|
3462
|
+
title: task.title,
|
|
3463
|
+
description: task.description ?? "",
|
|
3464
|
+
status: task.status,
|
|
3465
|
+
priority: task.priority,
|
|
3466
|
+
tags: task.tags,
|
|
3467
|
+
created_at: task.created_at
|
|
3468
|
+
};
|
|
3469
|
+
return {
|
|
3470
|
+
messages: [
|
|
3471
|
+
{ role: "system", content: SYSTEM_PROMPT },
|
|
3472
|
+
{ role: "user", content: userMsg },
|
|
3473
|
+
{
|
|
3474
|
+
role: "assistant",
|
|
3475
|
+
content: `Created task: ${JSON.stringify(taskDetails, null, 2)}`
|
|
3476
|
+
}
|
|
3477
|
+
]
|
|
3478
|
+
};
|
|
3479
|
+
}
|
|
3480
|
+
function taskToStatusUpdateExample(task) {
|
|
3481
|
+
if (!task.completed_at && task.status === "pending")
|
|
3482
|
+
return null;
|
|
3483
|
+
const id = task.short_id ?? task.id;
|
|
3484
|
+
return {
|
|
3485
|
+
messages: [
|
|
3486
|
+
{ role: "system", content: SYSTEM_PROMPT },
|
|
3487
|
+
{ role: "user", content: `Mark task ${id} as ${task.status}` },
|
|
3488
|
+
{
|
|
3489
|
+
role: "assistant",
|
|
3490
|
+
content: `Task ${id} has been updated to status: ${task.status}. ${task.completed_at ? `Completed at: ${task.completed_at}` : ""}`.trim()
|
|
3491
|
+
}
|
|
3492
|
+
]
|
|
3493
|
+
};
|
|
3494
|
+
}
|
|
3495
|
+
function taskToSearchExample(tasks, query) {
|
|
3496
|
+
const matched = tasks.filter((t) => t.title.toLowerCase().includes(query.toLowerCase())).slice(0, 5);
|
|
3497
|
+
return {
|
|
3498
|
+
messages: [
|
|
3499
|
+
{ role: "system", content: SYSTEM_PROMPT },
|
|
3500
|
+
{ role: "user", content: `Search tasks for: "${query}"` },
|
|
3501
|
+
{
|
|
3502
|
+
role: "assistant",
|
|
3503
|
+
content: matched.length > 0 ? `Found ${matched.length} task(s):
|
|
3504
|
+
${matched.map((t) => `- [${t.short_id ?? t.id}] ${t.title} (${t.status})`).join(`
|
|
3505
|
+
`)}` : `No tasks found matching "${query}".`
|
|
3506
|
+
}
|
|
3507
|
+
]
|
|
3508
|
+
};
|
|
3509
|
+
}
|
|
3510
|
+
var gatherTrainingData = async (options = {}) => {
|
|
3511
|
+
const allTasks = listTasks({});
|
|
3512
|
+
const filtered = options.since ? allTasks.filter((t) => new Date(t.created_at) >= options.since) : allTasks;
|
|
3513
|
+
const sorted = filtered.slice().sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
|
|
3514
|
+
const fetchSet = options.limit ? sorted.slice(0, options.limit * 2) : sorted;
|
|
3515
|
+
const examples = [];
|
|
3516
|
+
for (const task of fetchSet) {
|
|
3517
|
+
examples.push(taskToCreateExample(task));
|
|
3518
|
+
const statusEx = taskToStatusUpdateExample(task);
|
|
3519
|
+
if (statusEx)
|
|
3520
|
+
examples.push(statusEx);
|
|
3521
|
+
}
|
|
3522
|
+
const searchTerms = ["urgent", "fix", "implement", "create", "update", "review"];
|
|
3523
|
+
for (const term of searchTerms) {
|
|
3524
|
+
examples.push(taskToSearchExample(sorted, term));
|
|
3525
|
+
}
|
|
3526
|
+
const finalExamples = options.limit ? examples.slice(0, options.limit) : examples;
|
|
3527
|
+
return {
|
|
3528
|
+
source: "todos",
|
|
3529
|
+
examples: finalExamples,
|
|
3530
|
+
count: finalExamples.length
|
|
3531
|
+
};
|
|
3532
|
+
};
|
|
3533
|
+
// src/lib/model-config.ts
|
|
3534
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
3535
|
+
import { homedir } from "os";
|
|
3536
|
+
import { join as join4 } from "path";
|
|
3537
|
+
var DEFAULT_MODEL = "gpt-4o-mini";
|
|
3538
|
+
var CONFIG_DIR = join4(homedir(), ".todos");
|
|
3539
|
+
var CONFIG_PATH = join4(CONFIG_DIR, "config.json");
|
|
3540
|
+
function readConfig() {
|
|
3541
|
+
if (!existsSync4(CONFIG_PATH))
|
|
3542
|
+
return {};
|
|
3543
|
+
try {
|
|
3544
|
+
const raw = readFileSync2(CONFIG_PATH, "utf-8");
|
|
3545
|
+
return JSON.parse(raw);
|
|
3546
|
+
} catch {
|
|
3547
|
+
return {};
|
|
3548
|
+
}
|
|
3549
|
+
}
|
|
3550
|
+
function writeConfig(config) {
|
|
3551
|
+
if (!existsSync4(CONFIG_DIR)) {
|
|
3552
|
+
mkdirSync3(CONFIG_DIR, { recursive: true });
|
|
3553
|
+
}
|
|
3554
|
+
writeFileSync2(CONFIG_PATH, JSON.stringify(config, null, 2) + `
|
|
3555
|
+
`, "utf-8");
|
|
3556
|
+
}
|
|
3557
|
+
function getActiveModel() {
|
|
3558
|
+
const config = readConfig();
|
|
3559
|
+
return config.activeModel ?? DEFAULT_MODEL;
|
|
3560
|
+
}
|
|
3561
|
+
function setActiveModel(modelId) {
|
|
3562
|
+
const config = readConfig();
|
|
3563
|
+
config.activeModel = modelId;
|
|
3564
|
+
writeConfig(config);
|
|
3565
|
+
}
|
|
3566
|
+
function clearActiveModel() {
|
|
3567
|
+
const config = readConfig();
|
|
3568
|
+
delete config.activeModel;
|
|
3569
|
+
writeConfig(config);
|
|
3570
|
+
}
|
|
3454
3571
|
// src/db/handoffs.ts
|
|
3455
3572
|
function createHandoff(input, db) {
|
|
3456
3573
|
const d = db || getDatabase();
|
|
@@ -4282,16 +4399,16 @@ function searchTasks(options, projectId, taskListId, db) {
|
|
|
4282
4399
|
return rows.map(rowToTask3);
|
|
4283
4400
|
}
|
|
4284
4401
|
// src/lib/claude-tasks.ts
|
|
4285
|
-
import { existsSync as
|
|
4286
|
-
import { join as
|
|
4402
|
+
import { existsSync as existsSync5, readFileSync as readFileSync3, readdirSync as readdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
4403
|
+
import { join as join5 } from "path";
|
|
4287
4404
|
function getTaskListDir(taskListId) {
|
|
4288
|
-
return
|
|
4405
|
+
return join5(HOME, ".claude", "tasks", taskListId);
|
|
4289
4406
|
}
|
|
4290
4407
|
function readClaudeTask(dir, filename) {
|
|
4291
|
-
return readJsonFile(
|
|
4408
|
+
return readJsonFile(join5(dir, filename));
|
|
4292
4409
|
}
|
|
4293
4410
|
function writeClaudeTask(dir, task) {
|
|
4294
|
-
writeJsonFile(
|
|
4411
|
+
writeJsonFile(join5(dir, `${task.id}.json`), task);
|
|
4295
4412
|
}
|
|
4296
4413
|
function toClaudeStatus(status) {
|
|
4297
4414
|
if (status === "pending" || status === "in_progress" || status === "completed") {
|
|
@@ -4303,14 +4420,14 @@ function toSqliteStatus(status) {
|
|
|
4303
4420
|
return status;
|
|
4304
4421
|
}
|
|
4305
4422
|
function readPrefixCounter(dir) {
|
|
4306
|
-
const path =
|
|
4307
|
-
if (!
|
|
4423
|
+
const path = join5(dir, ".prefix-counter");
|
|
4424
|
+
if (!existsSync5(path))
|
|
4308
4425
|
return 0;
|
|
4309
|
-
const val = parseInt(
|
|
4426
|
+
const val = parseInt(readFileSync3(path, "utf-8").trim(), 10);
|
|
4310
4427
|
return isNaN(val) ? 0 : val;
|
|
4311
4428
|
}
|
|
4312
4429
|
function writePrefixCounter(dir, value) {
|
|
4313
|
-
|
|
4430
|
+
writeFileSync3(join5(dir, ".prefix-counter"), String(value));
|
|
4314
4431
|
}
|
|
4315
4432
|
function formatPrefixedSubject(title, prefix, counter) {
|
|
4316
4433
|
const padded = String(counter).padStart(5, "0");
|
|
@@ -4337,7 +4454,7 @@ function taskToClaudeTask(task, claudeTaskId, existingMeta) {
|
|
|
4337
4454
|
}
|
|
4338
4455
|
function pushToClaudeTaskList(taskListId, projectId, options = {}) {
|
|
4339
4456
|
const dir = getTaskListDir(taskListId);
|
|
4340
|
-
if (!
|
|
4457
|
+
if (!existsSync5(dir))
|
|
4341
4458
|
ensureDir2(dir);
|
|
4342
4459
|
const filter = {};
|
|
4343
4460
|
if (projectId)
|
|
@@ -4346,7 +4463,7 @@ function pushToClaudeTaskList(taskListId, projectId, options = {}) {
|
|
|
4346
4463
|
const existingByTodosId = new Map;
|
|
4347
4464
|
const files = listJsonFiles(dir);
|
|
4348
4465
|
for (const f of files) {
|
|
4349
|
-
const path =
|
|
4466
|
+
const path = join5(dir, f);
|
|
4350
4467
|
const ct = readClaudeTask(dir, f);
|
|
4351
4468
|
if (ct?.metadata?.["todos_id"]) {
|
|
4352
4469
|
existingByTodosId.set(ct.metadata["todos_id"], { task: ct, mtimeMs: getFileMtimeMs(path) });
|
|
@@ -4433,7 +4550,7 @@ function pushToClaudeTaskList(taskListId, projectId, options = {}) {
|
|
|
4433
4550
|
}
|
|
4434
4551
|
function pullFromClaudeTaskList(taskListId, projectId, options = {}) {
|
|
4435
4552
|
const dir = getTaskListDir(taskListId);
|
|
4436
|
-
if (!
|
|
4553
|
+
if (!existsSync5(dir)) {
|
|
4437
4554
|
return { pushed: 0, pulled: 0, errors: [`Task list directory not found: ${dir}`] };
|
|
4438
4555
|
}
|
|
4439
4556
|
const files = readdirSync2(dir).filter((f) => f.endsWith(".json"));
|
|
@@ -4453,7 +4570,7 @@ function pullFromClaudeTaskList(taskListId, projectId, options = {}) {
|
|
|
4453
4570
|
}
|
|
4454
4571
|
for (const f of files) {
|
|
4455
4572
|
try {
|
|
4456
|
-
const filePath =
|
|
4573
|
+
const filePath = join5(dir, f);
|
|
4457
4574
|
const ct = readClaudeTask(dir, f);
|
|
4458
4575
|
if (!ct)
|
|
4459
4576
|
continue;
|
|
@@ -4521,20 +4638,20 @@ function syncClaudeTaskList(taskListId, projectId, options = {}) {
|
|
|
4521
4638
|
}
|
|
4522
4639
|
|
|
4523
4640
|
// src/lib/agent-tasks.ts
|
|
4524
|
-
import { existsSync as
|
|
4525
|
-
import { join as
|
|
4641
|
+
import { existsSync as existsSync6 } from "fs";
|
|
4642
|
+
import { join as join6 } from "path";
|
|
4526
4643
|
function agentBaseDir(agent) {
|
|
4527
4644
|
const key = `TODOS_${agent.toUpperCase()}_TASKS_DIR`;
|
|
4528
|
-
return process.env[key] || getAgentTasksDir(agent) || process.env["TODOS_AGENT_TASKS_DIR"] ||
|
|
4645
|
+
return process.env[key] || getAgentTasksDir(agent) || process.env["TODOS_AGENT_TASKS_DIR"] || join6(HOME, ".todos", "agents");
|
|
4529
4646
|
}
|
|
4530
4647
|
function getTaskListDir2(agent, taskListId) {
|
|
4531
|
-
return
|
|
4648
|
+
return join6(agentBaseDir(agent), agent, taskListId);
|
|
4532
4649
|
}
|
|
4533
4650
|
function readAgentTask(dir, filename) {
|
|
4534
|
-
return readJsonFile(
|
|
4651
|
+
return readJsonFile(join6(dir, filename));
|
|
4535
4652
|
}
|
|
4536
4653
|
function writeAgentTask(dir, task) {
|
|
4537
|
-
writeJsonFile(
|
|
4654
|
+
writeJsonFile(join6(dir, `${task.id}.json`), task);
|
|
4538
4655
|
}
|
|
4539
4656
|
function taskToAgentTask(task, externalId, existingMeta) {
|
|
4540
4657
|
return {
|
|
@@ -4559,7 +4676,7 @@ function metadataKey(agent) {
|
|
|
4559
4676
|
}
|
|
4560
4677
|
function pushToAgentTaskList(agent, taskListId, projectId, options = {}) {
|
|
4561
4678
|
const dir = getTaskListDir2(agent, taskListId);
|
|
4562
|
-
if (!
|
|
4679
|
+
if (!existsSync6(dir))
|
|
4563
4680
|
ensureDir2(dir);
|
|
4564
4681
|
const filter = {};
|
|
4565
4682
|
if (projectId)
|
|
@@ -4568,7 +4685,7 @@ function pushToAgentTaskList(agent, taskListId, projectId, options = {}) {
|
|
|
4568
4685
|
const existingByTodosId = new Map;
|
|
4569
4686
|
const files = listJsonFiles(dir);
|
|
4570
4687
|
for (const f of files) {
|
|
4571
|
-
const path =
|
|
4688
|
+
const path = join6(dir, f);
|
|
4572
4689
|
const at = readAgentTask(dir, f);
|
|
4573
4690
|
if (at?.metadata?.["todos_id"]) {
|
|
4574
4691
|
existingByTodosId.set(at.metadata["todos_id"], { task: at, mtimeMs: getFileMtimeMs(path) });
|
|
@@ -4642,7 +4759,7 @@ function pushToAgentTaskList(agent, taskListId, projectId, options = {}) {
|
|
|
4642
4759
|
}
|
|
4643
4760
|
function pullFromAgentTaskList(agent, taskListId, projectId, options = {}) {
|
|
4644
4761
|
const dir = getTaskListDir2(agent, taskListId);
|
|
4645
|
-
if (!
|
|
4762
|
+
if (!existsSync6(dir)) {
|
|
4646
4763
|
return { pushed: 0, pulled: 0, errors: [`Task list directory not found: ${dir}`] };
|
|
4647
4764
|
}
|
|
4648
4765
|
const files = listJsonFiles(dir);
|
|
@@ -4661,7 +4778,7 @@ function pullFromAgentTaskList(agent, taskListId, projectId, options = {}) {
|
|
|
4661
4778
|
}
|
|
4662
4779
|
for (const f of files) {
|
|
4663
4780
|
try {
|
|
4664
|
-
const filePath =
|
|
4781
|
+
const filePath = join6(dir, f);
|
|
4665
4782
|
const at = readAgentTask(dir, f);
|
|
4666
4783
|
if (!at)
|
|
4667
4784
|
continue;
|
|
@@ -4798,8 +4915,8 @@ function syncWithAgents(agents, taskListIdByAgent, projectId, direction = "both"
|
|
|
4798
4915
|
return { pushed, pulled, errors };
|
|
4799
4916
|
}
|
|
4800
4917
|
// src/lib/extract.ts
|
|
4801
|
-
import { readFileSync as
|
|
4802
|
-
import { relative, resolve as resolve2, join as
|
|
4918
|
+
import { readFileSync as readFileSync4, statSync as statSync2 } from "fs";
|
|
4919
|
+
import { relative, resolve as resolve2, join as join7 } from "path";
|
|
4803
4920
|
var EXTRACT_TAGS = ["TODO", "FIXME", "HACK", "XXX", "BUG", "NOTE"];
|
|
4804
4921
|
var DEFAULT_EXTENSIONS = new Set([
|
|
4805
4922
|
".ts",
|
|
@@ -4933,9 +5050,9 @@ function extractTodos(options, db) {
|
|
|
4933
5050
|
const files = collectFiles(basePath, extensions);
|
|
4934
5051
|
const allComments = [];
|
|
4935
5052
|
for (const file of files) {
|
|
4936
|
-
const fullPath = statSync2(basePath).isFile() ? basePath :
|
|
5053
|
+
const fullPath = statSync2(basePath).isFile() ? basePath : join7(basePath, file);
|
|
4937
5054
|
try {
|
|
4938
|
-
const source =
|
|
5055
|
+
const source = readFileSync4(fullPath, "utf-8");
|
|
4939
5056
|
const relPath = statSync2(basePath).isFile() ? relative(resolve2(basePath, ".."), fullPath) : file;
|
|
4940
5057
|
const comments = extractFromSource(source, relPath, tags);
|
|
4941
5058
|
allComments.push(...comments);
|
|
@@ -5326,6 +5443,7 @@ export {
|
|
|
5326
5443
|
setTaskStatus,
|
|
5327
5444
|
setTaskPriority,
|
|
5328
5445
|
setBudget,
|
|
5446
|
+
setActiveModel,
|
|
5329
5447
|
searchTasks,
|
|
5330
5448
|
scoreTask,
|
|
5331
5449
|
saveSnapshot,
|
|
@@ -5425,6 +5543,8 @@ export {
|
|
|
5425
5543
|
getAgentByName,
|
|
5426
5544
|
getAgent,
|
|
5427
5545
|
getActiveWork,
|
|
5546
|
+
getActiveModel,
|
|
5547
|
+
gatherTrainingData,
|
|
5428
5548
|
findTasksByFile,
|
|
5429
5549
|
findRelatedTaskIds,
|
|
5430
5550
|
findPath,
|
|
@@ -5462,6 +5582,7 @@ export {
|
|
|
5462
5582
|
closeDatabase,
|
|
5463
5583
|
cloneTask,
|
|
5464
5584
|
clearChecklist,
|
|
5585
|
+
clearActiveModel,
|
|
5465
5586
|
cleanExpiredLocks,
|
|
5466
5587
|
claimOrSteal,
|
|
5467
5588
|
claimNextTask,
|
|
@@ -5496,6 +5617,7 @@ export {
|
|
|
5496
5617
|
LockError,
|
|
5497
5618
|
EXTRACT_TAGS,
|
|
5498
5619
|
DependencyCycleError,
|
|
5620
|
+
DEFAULT_MODEL,
|
|
5499
5621
|
CompletionGuardError,
|
|
5500
5622
|
AgentNotFoundError
|
|
5501
5623
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type GatherTrainingDataFn = (options?: {
|
|
2
|
+
limit?: number;
|
|
3
|
+
since?: Date;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
source: string;
|
|
6
|
+
examples: Array<{
|
|
7
|
+
messages: Array<{
|
|
8
|
+
role: "system" | "user" | "assistant";
|
|
9
|
+
content: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
count: number;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const gatherTrainingData: GatherTrainingDataFn;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=gatherer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gatherer.d.ts","sourceRoot":"","sources":["../../src/lib/gatherer.ts"],"names":[],"mappings":"AAMA,KAAK,oBAAoB,GAAG,CAAC,OAAO,CAAC,EAAE;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,KAAK,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC;QACd,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC7E,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AA8EH,eAAO,MAAM,kBAAkB,EAAE,oBAoDhC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const DEFAULT_MODEL = "gpt-4o-mini";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the currently active fine-tuned model ID, or the default model.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getActiveModel(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Sets the active fine-tuned model ID in ~/.todos/config.json.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setActiveModel(modelId: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Clears the active fine-tuned model, reverting to the default.
|
|
12
|
+
*/
|
|
13
|
+
export declare function clearActiveModel(): void;
|
|
14
|
+
//# sourceMappingURL=model-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/lib/model-config.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,gBAAgB,CAAC;AA2B3C;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAGvC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAIpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -4,27 +4,37 @@ var __defProp = Object.defineProperty;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
8
10
|
var __toCommonJS = (from) => {
|
|
9
|
-
var entry = __moduleCache.get(from), desc;
|
|
11
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
10
12
|
if (entry)
|
|
11
13
|
return entry;
|
|
12
14
|
entry = __defProp({}, "__esModule", { value: true });
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (var key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(entry, key))
|
|
18
|
+
__defProp(entry, key, {
|
|
19
|
+
get: __accessProp.bind(from, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
18
23
|
__moduleCache.set(from, entry);
|
|
19
24
|
return entry;
|
|
20
25
|
};
|
|
26
|
+
var __moduleCache;
|
|
27
|
+
var __returnValue = (v) => v;
|
|
28
|
+
function __exportSetter(name, newValue) {
|
|
29
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
30
|
+
}
|
|
21
31
|
var __export = (target, all) => {
|
|
22
32
|
for (var name in all)
|
|
23
33
|
__defProp(target, name, {
|
|
24
34
|
get: all[name],
|
|
25
35
|
enumerable: true,
|
|
26
36
|
configurable: true,
|
|
27
|
-
set: (
|
|
37
|
+
set: __exportSetter.bind(all, name)
|
|
28
38
|
});
|
|
29
39
|
};
|
|
30
40
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -9725,7 +9735,23 @@ function formatError(error) {
|
|
|
9725
9735
|
return JSON.stringify({ code: CompletionGuardError.code, message: error.reason, suggestion: CompletionGuardError.suggestion, ...retry });
|
|
9726
9736
|
}
|
|
9727
9737
|
if (error instanceof Error) {
|
|
9728
|
-
|
|
9738
|
+
const msg = error.message;
|
|
9739
|
+
if (msg.includes("UNIQUE constraint failed: projects.path")) {
|
|
9740
|
+
const db = getDatabase();
|
|
9741
|
+
const existing = db.prepare("SELECT id, name FROM projects WHERE path = ?").get(msg.match(/'([^']+)'$/)?.[1] ?? "");
|
|
9742
|
+
return JSON.stringify({ code: "DUPLICATE_PROJECT", message: `Project already exists at this path${existing ? ` (id: ${existing.id}, name: ${existing.name})` : ""}. Use list_projects to find it.`, suggestion: "Use list_projects or get_project to retrieve the existing project." });
|
|
9743
|
+
}
|
|
9744
|
+
if (msg.includes("UNIQUE constraint failed: projects.name")) {
|
|
9745
|
+
return JSON.stringify({ code: "DUPLICATE_PROJECT", message: "A project with this name already exists. Use a different name or list_projects to find the existing one.", suggestion: "Use list_projects to see existing projects." });
|
|
9746
|
+
}
|
|
9747
|
+
if (msg.includes("UNIQUE constraint failed")) {
|
|
9748
|
+
const table = msg.match(/UNIQUE constraint failed: (\w+)\./)?.[1] ?? "unknown";
|
|
9749
|
+
return JSON.stringify({ code: "DUPLICATE_ENTRY", message: `Duplicate entry in ${table}. The record already exists.`, suggestion: `Use the list or get endpoint for ${table} to find the existing record.` });
|
|
9750
|
+
}
|
|
9751
|
+
if (msg.includes("FOREIGN KEY constraint failed")) {
|
|
9752
|
+
return JSON.stringify({ code: "REFERENCE_ERROR", message: "Referenced record does not exist. Check that the ID is correct.", suggestion: "Verify the referenced ID exists before creating this record." });
|
|
9753
|
+
}
|
|
9754
|
+
return JSON.stringify({ code: "UNKNOWN_ERROR", message: msg });
|
|
9729
9755
|
}
|
|
9730
9756
|
return JSON.stringify({ code: "UNKNOWN_ERROR", message: String(error) });
|
|
9731
9757
|
}
|
package/dist/server/index.js
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
5
3
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: () => mod[key],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
4
|
+
var __returnValue = (v) => v;
|
|
5
|
+
function __exportSetter(name, newValue) {
|
|
6
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
7
|
+
}
|
|
19
8
|
var __export = (target, all) => {
|
|
20
9
|
for (var name in all)
|
|
21
10
|
__defProp(target, name, {
|
|
22
11
|
get: all[name],
|
|
23
12
|
enumerable: true,
|
|
24
13
|
configurable: true,
|
|
25
|
-
set: (
|
|
14
|
+
set: __exportSetter.bind(all, name)
|
|
26
15
|
});
|
|
27
16
|
};
|
|
28
17
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/todos",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"dashboard"
|
|
47
47
|
],
|
|
48
48
|
"publishConfig": {
|
|
49
|
+
"registry": "https://registry.npmjs.org",
|
|
49
50
|
"access": "public"
|
|
50
51
|
},
|
|
51
52
|
"repository": {
|