@vibetasks/mcp-server 0.6.5 → 0.6.6

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.
@@ -0,0 +1,90 @@
1
+ // src/hooks/session-start.ts
2
+ import { AuthManager, TaskOperations } from "@vibetasks/core";
3
+ async function handleSessionStart() {
4
+ try {
5
+ const authManager = new AuthManager();
6
+ const isAuth = await authManager.isAuthenticated();
7
+ if (!isAuth) {
8
+ console.log(JSON.stringify({ additionalContext: "" }));
9
+ return;
10
+ }
11
+ const taskOps = await TaskOperations.fromAuthManager(authManager);
12
+ const todayTasks = await taskOps.getTasks("today");
13
+ const upcomingTasks = await taskOps.getTasks("upcoming");
14
+ const today = /* @__PURE__ */ new Date();
15
+ today.setHours(0, 0, 0, 0);
16
+ const weekFromNow = new Date(today);
17
+ weekFromNow.setDate(today.getDate() + 7);
18
+ const upcomingThisWeek = upcomingTasks.filter((t) => {
19
+ if (!t.due_date) return false;
20
+ const dueDate = new Date(t.due_date);
21
+ return dueDate >= today && dueDate <= weekFromNow;
22
+ });
23
+ const activeTasks = await taskOps.getTasks("kanban");
24
+ const getAssigneeIcon = (task) => {
25
+ const assignedTo = task.assigned_to || "ai";
26
+ if (assignedTo === "human") return "\u{1F464}";
27
+ if (assignedTo === "ai") return "\u{1F916}";
28
+ return "\u{1F91D}";
29
+ };
30
+ let greeting = "";
31
+ if (todayTasks.length > 0) {
32
+ const humanTasks = todayTasks.filter((t) => t.assigned_to === "human").length;
33
+ const aiTasks = todayTasks.filter((t) => t.assigned_to === "ai").length;
34
+ greeting += `\u{1F4C5} **You have ${todayTasks.length} task${todayTasks.length > 1 ? "s" : ""} due today**`;
35
+ if (humanTasks > 0 && aiTasks > 0) {
36
+ greeting += ` (${aiTasks} for me \u{1F916}, ${humanTasks} for you \u{1F464})`;
37
+ } else if (humanTasks > 0) {
38
+ greeting += ` (all require your action \u{1F464})`;
39
+ } else if (aiTasks > 0) {
40
+ greeting += ` (I can help with these \u{1F916})`;
41
+ }
42
+ greeting += "\n\n";
43
+ }
44
+ const context = `# TaskFlow - Your Tasks
45
+
46
+ ${greeting}## Today's Tasks (${todayTasks.length})
47
+ ${todayTasks.length === 0 ? "No tasks due today." : todayTasks.map((t) => {
48
+ const icon = getAssigneeIcon(t);
49
+ const priority = t.priority && t.priority !== "none" ? ` [${t.priority.toUpperCase()}]` : "";
50
+ const tags = t.tags && t.tags.length > 0 ? ` #${t.tags.map((tag) => tag.name).join(" #")}` : "";
51
+ return `${icon} ${t.title}${priority}${tags}`;
52
+ }).join("\n")}
53
+
54
+ ## Upcoming This Week (${upcomingThisWeek.length})
55
+ ${upcomingThisWeek.length === 0 ? "No tasks scheduled for this week." : upcomingThisWeek.slice(0, 5).map((t) => {
56
+ const icon = getAssigneeIcon(t);
57
+ const dueDate = t.due_date ? new Date(t.due_date).toLocaleDateString("en-US", { month: "short", day: "numeric" }) : "";
58
+ const priority = t.priority && t.priority !== "none" ? ` [${t.priority}]` : "";
59
+ return `${icon} ${dueDate} - ${t.title}${priority}`;
60
+ }).join("\n")}${upcomingThisWeek.length > 5 ? `
61
+ ...and ${upcomingThisWeek.length - 5} more` : ""}
62
+
63
+ ## All Active Tasks (${activeTasks.length})
64
+ ${activeTasks.length === 0 ? "No active tasks." : activeTasks.slice(0, 10).map((t) => {
65
+ const icon = getAssigneeIcon(t);
66
+ const priority = t.priority && t.priority !== "none" ? ` [${t.priority.toUpperCase()}]` : "";
67
+ const dueDate = t.due_date ? ` (Due: ${t.due_date.split("T")[0]})` : "";
68
+ return `${icon} ${t.title}${priority}${dueDate}`;
69
+ }).join("\n")}${activeTasks.length > 10 ? `
70
+ ...and ${activeTasks.length - 10} more` : ""}
71
+
72
+ ---
73
+ You can manage tasks using these MCP tools:
74
+ - create_task: Add new tasks
75
+ - get_tasks: View tasks by filter
76
+ - complete_task: Mark tasks done
77
+ - search_tasks: Find tasks
78
+ - update_task: Modify tasks
79
+ - delete_task: Remove tasks
80
+ - log_ai_session: Log what we accomplish together
81
+ `.trim();
82
+ console.log(JSON.stringify({ additionalContext: context }));
83
+ } catch (error) {
84
+ console.error("TaskFlow SessionStart hook error:", error.message);
85
+ console.log(JSON.stringify({ additionalContext: "" }));
86
+ }
87
+ }
88
+ export {
89
+ handleSessionStart
90
+ };
package/package.json CHANGED
@@ -1,59 +1,60 @@
1
- {
2
- "name": "@vibetasks/mcp-server",
3
- "version": "0.6.5",
4
- "description": "VibeTasks MCP Server for Claude Code, Cursor, and AI coding tools. Status-based task management: todo → vibing → done.",
5
- "author": "Vyas",
6
- "license": "MIT",
7
- "type": "module",
8
- "main": "./dist/index.js",
9
- "bin": {
10
- "vibetasks-mcp": "./dist/index.js"
11
- },
12
- "files": [
13
- "dist"
14
- ],
15
- "keywords": [
16
- "vibetasks",
17
- "vibe",
18
- "vibecoding",
19
- "mcp",
20
- "mcp-server",
21
- "model-context-protocol",
22
- "claude-code",
23
- "cursor",
24
- "ai-tools",
25
- "task-management",
26
- "productivity"
27
- ],
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/vyassathya/vibetasks.git",
31
- "directory": "apps/mcp-server"
32
- },
33
- "homepage": "https://vibetasks.dev",
34
- "bugs": {
35
- "url": "https://github.com/vyassathya/vibetasks/issues"
36
- },
37
- "scripts": {
38
- "dev": "tsx src/index.ts",
39
- "build": "tsup src/index.ts --format esm --clean --outDir dist --shims",
40
- "start": "node dist/index.js",
41
- "typecheck": "tsc --noEmit"
42
- },
43
- "publishConfig": {
44
- "access": "public"
45
- },
46
- "dependencies": {
47
- "@modelcontextprotocol/sdk": "^0.5.0",
48
- "@vibetasks/core": "^0.5.9",
49
- "@vibetasks/shared": "^1.4.12",
50
- "zod": "^3.22.0",
51
- "zod-to-json-schema": "^3.25.1"
52
- },
53
- "devDependencies": {
54
- "@types/node": "^20.0.0",
55
- "tsup": "^8.0.0",
56
- "tsx": "^4.7.0",
57
- "typescript": "^5.3.3"
58
- }
59
- }
1
+ {
2
+ "name": "@vibetasks/mcp-server",
3
+ "version": "0.6.6",
4
+ "description": "VibeTasks MCP Server for Claude Code, Cursor, and AI coding tools. Status-based task management: todo → vibing → done.",
5
+ "author": "Vyas",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "bin": {
10
+ "vibetasks-mcp": "./dist/index.js"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "keywords": [
16
+ "vibetasks",
17
+ "vibe",
18
+ "vibecoding",
19
+ "mcp",
20
+ "mcp-server",
21
+ "model-context-protocol",
22
+ "claude-code",
23
+ "cursor",
24
+ "ai-tools",
25
+ "task-management",
26
+ "productivity"
27
+ ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/vyassathya/vibetasks.git",
31
+ "directory": "apps/mcp-server"
32
+ },
33
+ "homepage": "https://vibetasks.dev",
34
+ "bugs": {
35
+ "url": "https://github.com/vyassathya/vibetasks/issues"
36
+ },
37
+ "scripts": {
38
+ "dev": "tsx src/index.ts",
39
+ "build": "tsup src/index.ts --format esm --clean --outDir dist --shims",
40
+ "start": "node dist/index.js",
41
+ "typecheck": "tsc --noEmit"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "dependencies": {
47
+ "@modelcontextprotocol/sdk": "^0.5.0",
48
+ "@vibetasks/core": "^0.5.9",
49
+ "@vibetasks/ralph-engine": "workspace:*",
50
+ "@vibetasks/shared": "^1.4.12",
51
+ "zod": "^3.22.0",
52
+ "zod-to-json-schema": "^3.25.1"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^20.0.0",
56
+ "tsup": "^8.0.0",
57
+ "tsx": "^4.7.0",
58
+ "typescript": "^5.3.3"
59
+ }
60
+ }
@@ -1,49 +0,0 @@
1
- // src/hooks/session-start.ts
2
- import { AuthManager, TaskOperations } from "@vibetasks/core";
3
- async function handleSessionStart() {
4
- try {
5
- const authManager = new AuthManager();
6
- const isAuth = await authManager.isAuthenticated();
7
- if (!isAuth) {
8
- console.log(JSON.stringify({ additionalContext: "" }));
9
- return;
10
- }
11
- const taskOps = await TaskOperations.fromAuthManager(authManager);
12
- const todayTasks = await taskOps.getTasks("today");
13
- const activeTasks = await taskOps.getTasks("all");
14
- const context = `# TaskFlow - Your Tasks
15
-
16
- ## Today's Tasks (${todayTasks.length})
17
- ${todayTasks.length === 0 ? "No tasks due today." : todayTasks.map((t) => {
18
- const priority = t.priority && t.priority !== "none" ? ` [${t.priority.toUpperCase()}]` : "";
19
- const tags = t.tags && t.tags.length > 0 ? ` #${t.tags.map((tag) => tag.name).join(" #")}` : "";
20
- return `- [ ] ${t.title}${priority}${tags}`;
21
- }).join("\n")}
22
-
23
- ## All Active Tasks (${activeTasks.length})
24
- ${activeTasks.length === 0 ? "No active tasks." : activeTasks.slice(0, 10).map((t) => {
25
- const priority = t.priority && t.priority !== "none" ? ` [${t.priority.toUpperCase()}]` : "";
26
- const dueDate = t.due_date ? ` (Due: ${t.due_date.split("T")[0]})` : "";
27
- return `- [ ] ${t.title}${priority}${dueDate}`;
28
- }).join("\n")}${activeTasks.length > 10 ? `
29
- ...and ${activeTasks.length - 10} more` : ""}
30
-
31
- ---
32
- You can manage tasks using these MCP tools:
33
- - create_task: Add new tasks
34
- - get_tasks: View tasks by filter
35
- - complete_task: Mark tasks done
36
- - search_tasks: Find tasks
37
- - update_task: Modify tasks
38
- - delete_task: Remove tasks
39
- - log_ai_session: Log what we accomplish together
40
- `.trim();
41
- console.log(JSON.stringify({ additionalContext: context }));
42
- } catch (error) {
43
- console.error("TaskFlow SessionStart hook error:", error.message);
44
- console.log(JSON.stringify({ additionalContext: "" }));
45
- }
46
- }
47
- export {
48
- handleSessionStart
49
- };