zenarc-mcp 1.0.0
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/README.md +142 -0
- package/dist/core/bin/migrate.d.ts +3 -0
- package/dist/core/bin/migrate.d.ts.map +1 -0
- package/dist/core/bin/migrate.js +24 -0
- package/dist/core/bin/migrate.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/migrate.d.ts +13 -0
- package/dist/core/migrate.d.ts.map +1 -0
- package/dist/core/migrate.js +154 -0
- package/dist/core/migrate.js.map +1 -0
- package/dist/core/schema.d.ts +89 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +49 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/store/index.d.ts +68 -0
- package/dist/core/store/index.d.ts.map +1 -0
- package/dist/core/store/index.js +23 -0
- package/dist/core/store/index.js.map +1 -0
- package/dist/core/store/types.d.ts +30 -0
- package/dist/core/store/types.d.ts.map +1 -0
- package/dist/core/store/types.js +2 -0
- package/dist/core/store/types.js.map +1 -0
- package/dist/core/store/yaml-store.d.ts +26 -0
- package/dist/core/store/yaml-store.d.ts.map +1 -0
- package/dist/core/store/yaml-store.js +482 -0
- package/dist/core/store/yaml-store.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +456 -0
- package/dist/server.js.map +1 -0
- package/dist/store-init.d.ts +2 -0
- package/dist/store-init.d.ts.map +1 -0
- package/dist/store-init.js +39 -0
- package/dist/store-init.js.map +1 -0
- package/dist/sync/firestore-store.d.ts +28 -0
- package/dist/sync/firestore-store.d.ts.map +1 -0
- package/dist/sync/firestore-store.js +251 -0
- package/dist/sync/firestore-store.js.map +1 -0
- package/dist/sync/hybrid-store.d.ts +33 -0
- package/dist/sync/hybrid-store.d.ts.map +1 -0
- package/dist/sync/hybrid-store.js +86 -0
- package/dist/sync/hybrid-store.js.map +1 -0
- package/dist/sync/index.d.ts +4 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +4 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/sync-bridge.d.ts +21 -0
- package/dist/sync/sync-bridge.d.ts.map +1 -0
- package/dist/sync/sync-bridge.js +157 -0
- package/dist/sync/sync-bridge.js.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# ZenArc MCP
|
|
2
|
+
|
|
3
|
+
> AI-native task management for Claude Code via the Model Context Protocol.
|
|
4
|
+
|
|
5
|
+
ZenArc replaces scattered `TODO.md` files with structured, agent-friendly YAML task files. This package provides the **MCP server** that lets Claude Code create, update, search, and manage tasks across all your projects — directly from the terminal.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g zenarc-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node.js ≥ 20.
|
|
14
|
+
|
|
15
|
+
## Claude Code Setup
|
|
16
|
+
|
|
17
|
+
Add to your Claude Code settings (`~/.claude/settings.json` or a project's `.claude/settings.local.json`):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"zenarc": {
|
|
23
|
+
"command": "zenarc-mcp"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Restart Claude Code. That's it — no API keys, no ports, no server to run. `zenarc-mcp` auto-initializes on first use.
|
|
30
|
+
|
|
31
|
+
## First Run
|
|
32
|
+
|
|
33
|
+
Ask Claude to scan your projects:
|
|
34
|
+
|
|
35
|
+
> *"Scan my projects in ~/dev"*
|
|
36
|
+
|
|
37
|
+
Then use natural language for everything:
|
|
38
|
+
|
|
39
|
+
> *"List my critical tasks for loa-web"*
|
|
40
|
+
>
|
|
41
|
+
> *"Mark the GA4 tracking task as done"*
|
|
42
|
+
>
|
|
43
|
+
> *"Create a new high-priority task in codeyourreality to update the hero copy"*
|
|
44
|
+
>
|
|
45
|
+
> *"Search for anything related to SEO across all projects"*
|
|
46
|
+
|
|
47
|
+
## MCP Tools
|
|
48
|
+
|
|
49
|
+
| Tool | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| `zenarc_scan` | Discover projects and add them to the registry |
|
|
52
|
+
| `zenarc_list` | List tasks with filters (status, priority, project, tag, assignee) |
|
|
53
|
+
| `zenarc_get` | Get full task details by ID |
|
|
54
|
+
| `zenarc_create` | Create a new task with structured metadata |
|
|
55
|
+
| `zenarc_update` | Update task fields (status, priority, assignee, notes) |
|
|
56
|
+
| `zenarc_search` | Keyword search across titles, tags, and notes |
|
|
57
|
+
| `zenarc_context_add` | Link file paths or URLs to an existing task |
|
|
58
|
+
|
|
59
|
+
## Task File Format
|
|
60
|
+
|
|
61
|
+
Each task is a standalone YAML file in `{project}/.zenarc/tasks/`:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
id: tm-20260602-a1b2c3d4
|
|
65
|
+
title: Fix GA4 '(not set)' page tracking
|
|
66
|
+
status: in_progress
|
|
67
|
+
priority: critical
|
|
68
|
+
project: loa-web
|
|
69
|
+
tags: [analytics, seo, bugfix]
|
|
70
|
+
created_at: "2026-05-10T09:00:00Z"
|
|
71
|
+
updated_at: "2026-05-18T14:30:00Z"
|
|
72
|
+
created_by: human
|
|
73
|
+
assigned_to: claude
|
|
74
|
+
context:
|
|
75
|
+
files:
|
|
76
|
+
- app/components/PageViewTracker.jsx
|
|
77
|
+
- app/ClientLayout.js
|
|
78
|
+
urls:
|
|
79
|
+
- https://analytics.google.com/analytics/web/
|
|
80
|
+
notes: >
|
|
81
|
+
Fires manual page_view on App Router client-side navigations
|
|
82
|
+
with 100ms delay for document.title to settle.
|
|
83
|
+
dependencies: []
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Project Registry
|
|
87
|
+
|
|
88
|
+
Projects are tracked in `~/.zenarc/projects.json`:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
[
|
|
92
|
+
{ "name": "loa-web", "path": "/Users/.../loa/loa-web", "format": "yaml" }
|
|
93
|
+
]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The registry is auto-populated during `zenarc_scan`.
|
|
97
|
+
|
|
98
|
+
## Optional: Firebase Cloud Sync
|
|
99
|
+
|
|
100
|
+
Set `FIREBASE_SYNC_ENABLED=true` and `GOOGLE_APPLICATION_CREDENTIALS` to enable bidirectional sync with Firestore for multi-device access. Without these, ZenArc works fully offline with local YAML files.
|
|
101
|
+
|
|
102
|
+
## Migration from TODO.md
|
|
103
|
+
|
|
104
|
+
Convert a project's `TODO.md` into structured YAML tasks:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
zenarc-migrate my-project /path/to/my-project
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Architecture
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
zenarc-mcp/
|
|
114
|
+
├── src/
|
|
115
|
+
│ ├── server.ts # MCP server (stdio transport)
|
|
116
|
+
│ ├── store-init.ts # Store initialization (local + optional Firebase)
|
|
117
|
+
│ ├── core/ # Task schema, YAML store, registry
|
|
118
|
+
│ └── sync/ # Optional Firebase Firestore sync layer
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- **Local-first**: Tasks are YAML files in each project's `.zenarc/tasks/` directory.
|
|
122
|
+
- **Git-native**: Tasks version alongside code. Review task changes in PRs.
|
|
123
|
+
- **MCP is local-only**: Uses stdio transport. No HTTP/SSE/remote endpoint.
|
|
124
|
+
|
|
125
|
+
## Development
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm install
|
|
129
|
+
npm run build # Compile TypeScript to dist/
|
|
130
|
+
npm run dev # Watch mode
|
|
131
|
+
npm start # Run the MCP server
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Tech Stack
|
|
135
|
+
|
|
136
|
+
- TypeScript, Zod (schema validation), YAML (serialization)
|
|
137
|
+
- `@modelcontextprotocol/sdk` (stdio transport)
|
|
138
|
+
- `firebase-admin` (optional sync layer)
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/core/bin/migrate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { migrateProject } from "../migrate.js";
|
|
3
|
+
async function main() {
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
if (args.length < 2) {
|
|
6
|
+
console.error("Usage: zenarc-migrate <project-name> <project-path> [todo-filename]");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
const [projectName, projectPath, todoFilename] = args;
|
|
10
|
+
console.log(`Migrating ${projectName} at ${projectPath}...`);
|
|
11
|
+
const result = await migrateProject(projectName, projectPath, todoFilename || "TODO.md");
|
|
12
|
+
if (result.tasks > 0) {
|
|
13
|
+
console.log(`✅ Migrated ${result.tasks} tasks`);
|
|
14
|
+
console.log(`📦 Archived original to TODO.md.archive`);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
console.log("⚠️ No TODO.md found or no tasks extracted");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
main().catch((err) => {
|
|
21
|
+
console.error(err);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/core/bin/migrate.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC;IAEtD,OAAO,CAAC,GAAG,CAAC,aAAa,WAAW,OAAO,WAAW,KAAK,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,IAAI,SAAS,CAAC,CAAC;IAEzF,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { TaskSchema, TaskStatus, TaskPriority, TaskContext, generateTaskId, validateTask, safeValidateTask, } from "./schema.js";
|
|
2
|
+
export type { Task } from "./schema.js";
|
|
3
|
+
export { YamlTaskStore, setDefaultStore, getDefaultStore, getRegistry, saveRegistry, addProject, removeProject, listProjectTasks, readTask, writeTask, deleteTask, searchTasks, scanForProjects, getRecentParents, addRecentParent, } from "./store/index.js";
|
|
4
|
+
export type { TaskStore, ProjectConfig } from "./store/index.js";
|
|
5
|
+
export { parseTodoMarkdown, migrateProject } from "./migrate.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { TaskSchema, TaskStatus, TaskPriority, TaskContext, generateTaskId, validateTask, safeValidateTask, } from "./schema.js";
|
|
2
|
+
export { YamlTaskStore, setDefaultStore, getDefaultStore, getRegistry, saveRegistry, addProject, removeProject, listProjectTasks, readTask, writeTask, deleteTask, searchTasks, scanForProjects, getRecentParents, addRecentParent, } from "./store/index.js";
|
|
3
|
+
export { parseTodoMarkdown, migrateProject } from "./migrate.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Task } from "./schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a single TODO.md file into structured tasks.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseTodoMarkdown(content: string, projectName: string): Promise<Task[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Migrate a single project's TODO.md into structured task files.
|
|
8
|
+
*/
|
|
9
|
+
export declare function migrateProject(projectName: string, projectPath: string, todoFilename?: string): Promise<{
|
|
10
|
+
tasks: number;
|
|
11
|
+
archived: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/core/migrate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,EAAE,CAAC,CA0IjB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,SAAY,GACvB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,CA0B/C"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { readFile, rename } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { generateTaskId } from "./schema.js";
|
|
4
|
+
import { writeTask, addProject, getRegistry } from "./store/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Parse a single TODO.md file into structured tasks.
|
|
7
|
+
*/
|
|
8
|
+
export async function parseTodoMarkdown(content, projectName) {
|
|
9
|
+
const tasks = [];
|
|
10
|
+
const lines = content.split("\n");
|
|
11
|
+
let currentSection = "backlog";
|
|
12
|
+
let i = 0;
|
|
13
|
+
const sectionToStatus = {
|
|
14
|
+
active: "in_progress",
|
|
15
|
+
critical: "in_progress",
|
|
16
|
+
"do next": "in_progress",
|
|
17
|
+
backlog: "todo",
|
|
18
|
+
todo: "todo",
|
|
19
|
+
done: "done",
|
|
20
|
+
archive: "done",
|
|
21
|
+
"quick wins": "todo",
|
|
22
|
+
};
|
|
23
|
+
const priorityMap = {
|
|
24
|
+
critical: "critical",
|
|
25
|
+
active: "high",
|
|
26
|
+
"do next": "high",
|
|
27
|
+
backlog: "medium",
|
|
28
|
+
todo: "medium",
|
|
29
|
+
done: "low",
|
|
30
|
+
archive: "low",
|
|
31
|
+
"quick wins": "low",
|
|
32
|
+
};
|
|
33
|
+
while (i < lines.length) {
|
|
34
|
+
const line = lines[i];
|
|
35
|
+
// Detect sections via headings
|
|
36
|
+
const headingMatch = line.match(/^##\s+([🔴🟡🟢⚪🔵🟣🟠⚫\s]*)(.+)/i);
|
|
37
|
+
if (headingMatch) {
|
|
38
|
+
const sectionName = headingMatch[2].toLowerCase().trim();
|
|
39
|
+
for (const key of Object.keys(sectionToStatus)) {
|
|
40
|
+
if (sectionName.includes(key)) {
|
|
41
|
+
currentSection = key;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
i++;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
// Detect checklist items
|
|
49
|
+
const checkMatch = line.match(/^\s*-\s*\[([xX\s])\]\s*(.+)/);
|
|
50
|
+
if (checkMatch) {
|
|
51
|
+
const isDone = checkMatch[1].toLowerCase() === "x";
|
|
52
|
+
let title = checkMatch[2].trim();
|
|
53
|
+
// Extract bold title if present: **Fix something** — description
|
|
54
|
+
const boldMatch = title.match(/^\*\*(.+?)\*\*\s*[—\-:]?\s*(.*)/);
|
|
55
|
+
let description = "";
|
|
56
|
+
if (boldMatch) {
|
|
57
|
+
title = boldMatch[1].trim();
|
|
58
|
+
description = boldMatch[2].trim();
|
|
59
|
+
}
|
|
60
|
+
// Collect indented description lines that follow
|
|
61
|
+
const notesLines = description ? [description] : [];
|
|
62
|
+
let j = i + 1;
|
|
63
|
+
while (j < lines.length) {
|
|
64
|
+
const nextLine = lines[j];
|
|
65
|
+
// Stop at next checklist, heading, or horizontal rule
|
|
66
|
+
if (nextLine.match(/^\s*-\s*\[/) ||
|
|
67
|
+
nextLine.match(/^#{1,3}\s/) ||
|
|
68
|
+
nextLine.match(/^\s*---\s*$/)) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
// Include indented lines or continuation paragraphs
|
|
72
|
+
if (nextLine.match(/^\s{2,}/) || nextLine.match(/^\s*\>/)) {
|
|
73
|
+
notesLines.push(nextLine.trim());
|
|
74
|
+
j++;
|
|
75
|
+
}
|
|
76
|
+
else if (nextLine.trim() === "") {
|
|
77
|
+
notesLines.push("");
|
|
78
|
+
j++;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Extract file paths from backticks and code blocks in notes
|
|
85
|
+
const files = [];
|
|
86
|
+
const urls = [];
|
|
87
|
+
const allText = [title, ...notesLines].join(" ");
|
|
88
|
+
// Match backtick file paths
|
|
89
|
+
const backtickMatches = allText.matchAll(/`([^`]+\.(?:js|ts|tsx|jsx|py|java|kt|swift|go|rs|yaml|json|md|css|html))`/g);
|
|
90
|
+
for (const m of backtickMatches) {
|
|
91
|
+
files.push(m[1]);
|
|
92
|
+
}
|
|
93
|
+
// Match URLs
|
|
94
|
+
const urlMatches = allText.matchAll(/https?:\/\/[^\s\)\]\>]+/g);
|
|
95
|
+
for (const m of urlMatches) {
|
|
96
|
+
urls.push(m[0]);
|
|
97
|
+
}
|
|
98
|
+
const status = isDone
|
|
99
|
+
? "done"
|
|
100
|
+
: sectionToStatus[currentSection] || "todo";
|
|
101
|
+
const priority = priorityMap[currentSection] || "medium";
|
|
102
|
+
const now = new Date().toISOString();
|
|
103
|
+
const task = {
|
|
104
|
+
id: generateTaskId(),
|
|
105
|
+
title,
|
|
106
|
+
status: status,
|
|
107
|
+
priority: priority,
|
|
108
|
+
project: projectName,
|
|
109
|
+
tags: [],
|
|
110
|
+
created_at: now,
|
|
111
|
+
updated_at: now,
|
|
112
|
+
created_by: "human",
|
|
113
|
+
assigned_to: undefined,
|
|
114
|
+
context: {
|
|
115
|
+
files: [...new Set(files)],
|
|
116
|
+
urls: [...new Set(urls)],
|
|
117
|
+
notes: notesLines.join("\n").trim(),
|
|
118
|
+
},
|
|
119
|
+
dependencies: [],
|
|
120
|
+
};
|
|
121
|
+
tasks.push(task);
|
|
122
|
+
i = j;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
i++;
|
|
126
|
+
}
|
|
127
|
+
return tasks;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Migrate a single project's TODO.md into structured task files.
|
|
131
|
+
*/
|
|
132
|
+
export async function migrateProject(projectName, projectPath, todoFilename = "TODO.md") {
|
|
133
|
+
const todoPath = join(projectPath, todoFilename);
|
|
134
|
+
let content;
|
|
135
|
+
try {
|
|
136
|
+
content = await readFile(todoPath, "utf-8");
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return { tasks: 0, archived: false };
|
|
140
|
+
}
|
|
141
|
+
// Add to registry if not present
|
|
142
|
+
const registry = await getRegistry();
|
|
143
|
+
if (!registry.find((p) => p.name === projectName)) {
|
|
144
|
+
await addProject({ name: projectName, path: projectPath, format: "yaml" });
|
|
145
|
+
}
|
|
146
|
+
const tasks = await parseTodoMarkdown(content, projectName);
|
|
147
|
+
for (const task of tasks) {
|
|
148
|
+
await writeTask(projectPath, task);
|
|
149
|
+
}
|
|
150
|
+
// Archive original
|
|
151
|
+
await rename(todoPath, `${todoPath}.archive`);
|
|
152
|
+
return { tasks: tasks.length, archived: true };
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/core/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAa,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAe,EACf,WAAmB;IAEnB,MAAM,KAAK,GAAW,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,IAAI,cAAc,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,MAAM,eAAe,GAA2B;QAC9C,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,aAAa;QACvB,SAAS,EAAE,aAAa;QACxB,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,MAAM;KACrB,CAAC;IAEF,MAAM,WAAW,GAA2B;QAC1C,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,Q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,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAmB,EACnB,WAAmB,EACnB,YAAY,GAAG,SAAS;IAExB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAEjD,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACvC,CAAC;IAED,iCAAiC;IACjC,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,EAAE,CAAC;QAClD,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAE5D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,mBAAmB;IACnB,MAAM,MAAM,CAAC,QAAQ,EAAE,GAAG,QAAQ,UAAU,CAAC,CAAC;IAE9C,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TaskStatus: z.ZodEnum<["todo", "in_progress", "done", "blocked", "deferred"]>;
|
|
3
|
+
export declare const TaskPriority: z.ZodEnum<["critical", "high", "medium", "low"]>;
|
|
4
|
+
export declare const TaskContext: z.ZodObject<{
|
|
5
|
+
files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
urls: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
notes: z.ZodDefault<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
files: string[];
|
|
10
|
+
urls: string[];
|
|
11
|
+
notes: string;
|
|
12
|
+
}, {
|
|
13
|
+
files?: string[] | undefined;
|
|
14
|
+
urls?: string[] | undefined;
|
|
15
|
+
notes?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const TaskSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
title: z.ZodString;
|
|
20
|
+
status: z.ZodEnum<["todo", "in_progress", "done", "blocked", "deferred"]>;
|
|
21
|
+
priority: z.ZodEnum<["critical", "high", "medium", "low"]>;
|
|
22
|
+
project: z.ZodString;
|
|
23
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
created_at: z.ZodString;
|
|
25
|
+
updated_at: z.ZodString;
|
|
26
|
+
created_by: z.ZodDefault<z.ZodEnum<["human", "claude", "other-agent"]>>;
|
|
27
|
+
assigned_to: z.ZodOptional<z.ZodString>;
|
|
28
|
+
context: z.ZodDefault<z.ZodObject<{
|
|
29
|
+
files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
urls: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
notes: z.ZodDefault<z.ZodString>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
files: string[];
|
|
34
|
+
urls: string[];
|
|
35
|
+
notes: string;
|
|
36
|
+
}, {
|
|
37
|
+
files?: string[] | undefined;
|
|
38
|
+
urls?: string[] | undefined;
|
|
39
|
+
notes?: string | undefined;
|
|
40
|
+
}>>;
|
|
41
|
+
dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
status: "todo" | "in_progress" | "done" | "blocked" | "deferred";
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
47
|
+
project: string;
|
|
48
|
+
tags: string[];
|
|
49
|
+
created_at: string;
|
|
50
|
+
updated_at: string;
|
|
51
|
+
created_by: "human" | "claude" | "other-agent";
|
|
52
|
+
context: {
|
|
53
|
+
files: string[];
|
|
54
|
+
urls: string[];
|
|
55
|
+
notes: string;
|
|
56
|
+
};
|
|
57
|
+
dependencies: string[];
|
|
58
|
+
assigned_to?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
status: "todo" | "in_progress" | "done" | "blocked" | "deferred";
|
|
61
|
+
id: string;
|
|
62
|
+
title: string;
|
|
63
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
64
|
+
project: string;
|
|
65
|
+
created_at: string;
|
|
66
|
+
updated_at: string;
|
|
67
|
+
tags?: string[] | undefined;
|
|
68
|
+
created_by?: "human" | "claude" | "other-agent" | undefined;
|
|
69
|
+
assigned_to?: string | undefined;
|
|
70
|
+
context?: {
|
|
71
|
+
files?: string[] | undefined;
|
|
72
|
+
urls?: string[] | undefined;
|
|
73
|
+
notes?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
dependencies?: string[] | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
export type Task = z.infer<typeof TaskSchema>;
|
|
78
|
+
export type TaskStatus = z.infer<typeof TaskStatus>;
|
|
79
|
+
export type TaskPriority = z.infer<typeof TaskPriority>;
|
|
80
|
+
export declare function generateTaskId(): string;
|
|
81
|
+
export declare function validateTask(data: unknown): Task;
|
|
82
|
+
export declare function safeValidateTask(data: unknown): {
|
|
83
|
+
success: true;
|
|
84
|
+
data: Task;
|
|
85
|
+
} | {
|
|
86
|
+
success: false;
|
|
87
|
+
error: z.ZodError;
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,UAAU,mEAMrB,CAAC;AAEH,eAAO,MAAM,YAAY,kDAKvB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;EAItB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAEhD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAC1C;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAC7B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAA;CAAE,CAMxC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const TaskStatus = z.enum([
|
|
3
|
+
"todo",
|
|
4
|
+
"in_progress",
|
|
5
|
+
"done",
|
|
6
|
+
"blocked",
|
|
7
|
+
"deferred",
|
|
8
|
+
]);
|
|
9
|
+
export const TaskPriority = z.enum([
|
|
10
|
+
"critical",
|
|
11
|
+
"high",
|
|
12
|
+
"medium",
|
|
13
|
+
"low",
|
|
14
|
+
]);
|
|
15
|
+
export const TaskContext = z.object({
|
|
16
|
+
files: z.array(z.string()).default([]),
|
|
17
|
+
urls: z.array(z.string().url()).default([]),
|
|
18
|
+
notes: z.string().default(""),
|
|
19
|
+
});
|
|
20
|
+
export const TaskSchema = z.object({
|
|
21
|
+
id: z.string().regex(/^tm-\d{8}-[a-z0-9]{8}$/),
|
|
22
|
+
title: z.string().min(1),
|
|
23
|
+
status: TaskStatus,
|
|
24
|
+
priority: TaskPriority,
|
|
25
|
+
project: z.string().min(1),
|
|
26
|
+
tags: z.array(z.string()).default([]),
|
|
27
|
+
created_at: z.string().datetime(),
|
|
28
|
+
updated_at: z.string().datetime(),
|
|
29
|
+
created_by: z.enum(["human", "claude", "other-agent"]).default("human"),
|
|
30
|
+
assigned_to: z.string().optional(),
|
|
31
|
+
context: TaskContext.default({ files: [], urls: [], notes: "" }),
|
|
32
|
+
dependencies: z.array(z.string()).default([]),
|
|
33
|
+
});
|
|
34
|
+
export function generateTaskId() {
|
|
35
|
+
const date = new Date().toISOString().slice(0, 10).replace(/-/g, "");
|
|
36
|
+
const rand = Math.random().toString(36).slice(2, 10);
|
|
37
|
+
return `tm-${date}-${rand}`;
|
|
38
|
+
}
|
|
39
|
+
export function validateTask(data) {
|
|
40
|
+
return TaskSchema.parse(data);
|
|
41
|
+
}
|
|
42
|
+
export function safeValidateTask(data) {
|
|
43
|
+
const result = TaskSchema.safeParse(data);
|
|
44
|
+
if (result.success) {
|
|
45
|
+
return { success: true, data: result.data };
|
|
46
|
+
}
|
|
47
|
+
return { success: false, error: result.error };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEx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{ TaskStore, ProjectConfig } from "./types.js";
|
|
2
|
+
export { YamlTaskStore, getRecentParents, addRecentParent } from "./yaml-store.js";
|
|
3
|
+
import type { TaskStore } from "./types.js";
|
|
4
|
+
export declare function setDefaultStore(store: TaskStore): void;
|
|
5
|
+
export declare function getDefaultStore(): TaskStore;
|
|
6
|
+
export declare const getRegistry: () => Promise<import("./types.js").ProjectConfig[]>;
|
|
7
|
+
export declare const saveRegistry: (projects: Parameters<TaskStore["saveRegistry"]>[0]) => Promise<void>;
|
|
8
|
+
export declare const addProject: (config: Parameters<TaskStore["addProject"]>[0]) => Promise<void>;
|
|
9
|
+
export declare const removeProject: (name: string) => Promise<void>;
|
|
10
|
+
export declare const listProjectTasks: (path: string) => Promise<{
|
|
11
|
+
status: "todo" | "in_progress" | "done" | "blocked" | "deferred";
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
15
|
+
project: string;
|
|
16
|
+
tags: string[];
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
created_by: "human" | "claude" | "other-agent";
|
|
20
|
+
context: {
|
|
21
|
+
files: string[];
|
|
22
|
+
urls: string[];
|
|
23
|
+
notes: string;
|
|
24
|
+
};
|
|
25
|
+
dependencies: string[];
|
|
26
|
+
assigned_to?: string | undefined;
|
|
27
|
+
}[]>;
|
|
28
|
+
export declare const readTask: (path: string, id: string) => Promise<{
|
|
29
|
+
status: "todo" | "in_progress" | "done" | "blocked" | "deferred";
|
|
30
|
+
id: string;
|
|
31
|
+
title: string;
|
|
32
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
33
|
+
project: string;
|
|
34
|
+
tags: string[];
|
|
35
|
+
created_at: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
created_by: "human" | "claude" | "other-agent";
|
|
38
|
+
context: {
|
|
39
|
+
files: string[];
|
|
40
|
+
urls: string[];
|
|
41
|
+
notes: string;
|
|
42
|
+
};
|
|
43
|
+
dependencies: string[];
|
|
44
|
+
assigned_to?: string | undefined;
|
|
45
|
+
} | null>;
|
|
46
|
+
export declare const writeTask: (path: string, task: Parameters<TaskStore["writeTask"]>[1]) => Promise<void>;
|
|
47
|
+
export declare const deleteTask: (path: string, id: string) => Promise<boolean>;
|
|
48
|
+
export declare const searchTasks: (query: string, options?: Parameters<TaskStore["searchTasks"]>[1]) => Promise<{
|
|
49
|
+
status: "todo" | "in_progress" | "done" | "blocked" | "deferred";
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
53
|
+
project: string;
|
|
54
|
+
tags: string[];
|
|
55
|
+
created_at: string;
|
|
56
|
+
updated_at: string;
|
|
57
|
+
created_by: "human" | "claude" | "other-agent";
|
|
58
|
+
context: {
|
|
59
|
+
files: string[];
|
|
60
|
+
urls: string[];
|
|
61
|
+
notes: string;
|
|
62
|
+
};
|
|
63
|
+
dependencies: string[];
|
|
64
|
+
assigned_to?: string | undefined;
|
|
65
|
+
}[]>;
|
|
66
|
+
export declare const scanForProjects: (paths: string[]) => Promise<import("./types.js").ProjectConfig[]>;
|
|
67
|
+
export declare const getProjectTasksDir: (path: string) => string;
|
|
68
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/store/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAK5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAEtD;AAED,wBAAgB,eAAe,IAAI,SAAS,CAE3C;AAGD,eAAO,MAAM,WAAW,qDAAmC,CAAC;AAC5D,eAAO,MAAM,YAAY,GAAI,UAAU,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,kBAC1C,CAAC;AACtC,eAAO,MAAM,UAAU,GAAI,QAAQ,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,kBACxC,CAAC;AAClC,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,kBAAqC,CAAC;AAChF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM;;;;;;;;;;;;;;;;;IAAwC,CAAC;AACtF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM;;;;;;;;;;;;;;;;;SAAoC,CAAC;AACtF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,kBAC/C,CAAC;AACrC,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,qBAAsC,CAAC;AAC1F,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,UAAU,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;IAClD,CAAC;AAC3C,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,kDAAwC,CAAC;AACxF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,WAA0C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { YamlTaskStore, getRecentParents, addRecentParent } from "./yaml-store.js";
|
|
2
|
+
import { YamlTaskStore } from "./yaml-store.js";
|
|
3
|
+
// Global default store instance for backward-compatible function exports
|
|
4
|
+
let defaultStore = new YamlTaskStore();
|
|
5
|
+
export function setDefaultStore(store) {
|
|
6
|
+
defaultStore = store;
|
|
7
|
+
}
|
|
8
|
+
export function getDefaultStore() {
|
|
9
|
+
return defaultStore;
|
|
10
|
+
}
|
|
11
|
+
// Backward-compatible function exports that delegate to defaultStore
|
|
12
|
+
export const getRegistry = () => defaultStore.getRegistry();
|
|
13
|
+
export const saveRegistry = (projects) => defaultStore.saveRegistry(projects);
|
|
14
|
+
export const addProject = (config) => defaultStore.addProject(config);
|
|
15
|
+
export const removeProject = (name) => defaultStore.removeProject(name);
|
|
16
|
+
export const listProjectTasks = (path) => defaultStore.listProjectTasks(path);
|
|
17
|
+
export const readTask = (path, id) => defaultStore.readTask(path, id);
|
|
18
|
+
export const writeTask = (path, task) => defaultStore.writeTask(path, task);
|
|
19
|
+
export const deleteTask = (path, id) => defaultStore.deleteTask(path, id);
|
|
20
|
+
export const searchTasks = (query, options) => defaultStore.searchTasks(query, options);
|
|
21
|
+
export const scanForProjects = (paths) => defaultStore.scanForProjects(paths);
|
|
22
|
+
export const getProjectTasksDir = (path) => defaultStore.getProjectTasksDir(path);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/store/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,yEAAyE;AACzE,IAAI,YAAY,GAAc,IAAI,aAAa,EAAE,CAAC;AAElD,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAkD,EAAE,EAAE,CACjF,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,CA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