@dalmasonto/taskflow-mcp 1.0.33 → 2.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.
Files changed (99) hide show
  1. package/README.md +138 -193
  2. package/dist/attachment-download.d.ts +74 -0
  3. package/dist/attachment-download.js +193 -0
  4. package/dist/attachment-download.js.map +1 -0
  5. package/dist/attachments.d.ts +23 -0
  6. package/dist/attachments.js +66 -0
  7. package/dist/attachments.js.map +1 -0
  8. package/dist/client.d.ts +206 -0
  9. package/dist/client.js +279 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/config.d.ts +137 -18
  12. package/dist/config.js +187 -106
  13. package/dist/config.js.map +1 -0
  14. package/dist/connect.d.ts +89 -0
  15. package/dist/connect.js +269 -0
  16. package/dist/connect.js.map +1 -0
  17. package/dist/doctor.d.ts +24 -0
  18. package/dist/doctor.js +120 -0
  19. package/dist/doctor.js.map +1 -0
  20. package/dist/events.d.ts +186 -0
  21. package/dist/events.js +407 -0
  22. package/dist/events.js.map +1 -0
  23. package/dist/index.d.ts +7 -1
  24. package/dist/index.js +124 -184
  25. package/dist/index.js.map +1 -0
  26. package/dist/instructions.d.ts +12 -0
  27. package/dist/instructions.js +114 -0
  28. package/dist/instructions.js.map +1 -0
  29. package/dist/mint.d.ts +62 -0
  30. package/dist/mint.js +135 -0
  31. package/dist/mint.js.map +1 -0
  32. package/dist/mirror.d.ts +68 -0
  33. package/dist/mirror.js +103 -0
  34. package/dist/mirror.js.map +1 -0
  35. package/dist/pane-queue.d.ts +29 -0
  36. package/dist/pane-queue.js +35 -0
  37. package/dist/pane-queue.js.map +1 -0
  38. package/dist/prompts.d.ts +79 -0
  39. package/dist/prompts.js +211 -0
  40. package/dist/prompts.js.map +1 -0
  41. package/dist/resolve.d.ts +72 -0
  42. package/dist/resolve.js +89 -0
  43. package/dist/resolve.js.map +1 -0
  44. package/dist/runtime.d.ts +54 -0
  45. package/dist/runtime.js +321 -0
  46. package/dist/runtime.js.map +1 -0
  47. package/dist/server.d.ts +56 -0
  48. package/dist/server.js +793 -0
  49. package/dist/server.js.map +1 -0
  50. package/dist/session-identifier.d.ts +48 -0
  51. package/dist/session-identifier.js +44 -0
  52. package/dist/session-identifier.js.map +1 -0
  53. package/dist/sessions-store.d.ts +38 -0
  54. package/dist/sessions-store.js +88 -0
  55. package/dist/sessions-store.js.map +1 -0
  56. package/dist/tmux.d.ts +200 -0
  57. package/dist/tmux.js +580 -0
  58. package/dist/tmux.js.map +1 -0
  59. package/hooks/metadata.mjs +99 -0
  60. package/hooks/permission-prompt.mjs +100 -0
  61. package/hooks/taskflow-hook.mjs +499 -0
  62. package/hooks/tool-logging.mjs +63 -0
  63. package/package.json +38 -29
  64. package/dist/agent-registry.d.ts +0 -27
  65. package/dist/agent-registry.js +0 -153
  66. package/dist/db.d.ts +0 -5
  67. package/dist/db.js +0 -220
  68. package/dist/helpers.d.ts +0 -21
  69. package/dist/helpers.js +0 -27
  70. package/dist/resources.d.ts +0 -2
  71. package/dist/resources.js +0 -89
  72. package/dist/sse.d.ts +0 -10
  73. package/dist/sse.js +0 -766
  74. package/dist/tmux-bridge.d.ts +0 -12
  75. package/dist/tmux-bridge.js +0 -157
  76. package/dist/tools/activity.d.ts +0 -39
  77. package/dist/tools/activity.js +0 -152
  78. package/dist/tools/agent-inbox.d.ts +0 -12
  79. package/dist/tools/agent-inbox.js +0 -257
  80. package/dist/tools/agent.d.ts +0 -14
  81. package/dist/tools/agent.js +0 -168
  82. package/dist/tools/analytics.d.ts +0 -21
  83. package/dist/tools/analytics.js +0 -191
  84. package/dist/tools/checkpoint.d.ts +0 -27
  85. package/dist/tools/checkpoint.js +0 -105
  86. package/dist/tools/notifications.d.ts +0 -31
  87. package/dist/tools/notifications.js +0 -59
  88. package/dist/tools/projects.d.ts +0 -55
  89. package/dist/tools/projects.js +0 -112
  90. package/dist/tools/settings.d.ts +0 -19
  91. package/dist/tools/settings.js +0 -73
  92. package/dist/tools/tasks.d.ts +0 -105
  93. package/dist/tools/tasks.js +0 -403
  94. package/dist/tools/terminal.d.ts +0 -4
  95. package/dist/tools/terminal.js +0 -98
  96. package/dist/tools/timer.d.ts +0 -37
  97. package/dist/tools/timer.js +0 -154
  98. package/dist/types.d.ts +0 -82
  99. package/dist/types.js +0 -30
@@ -1,55 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function createProject(params: {
3
- name: string;
4
- color?: string;
5
- type?: string;
6
- description?: string;
7
- }): Promise<{
8
- content: {
9
- type: "text";
10
- text: string;
11
- }[];
12
- }>;
13
- export declare function listProjects(): Promise<{
14
- content: {
15
- type: "text";
16
- text: string;
17
- }[];
18
- }>;
19
- export declare function getProject(params: {
20
- id: number;
21
- }): Promise<{
22
- content: {
23
- type: "text";
24
- text: string;
25
- }[];
26
- }>;
27
- export declare function updateProject(params: {
28
- id: number;
29
- name?: string;
30
- color?: string;
31
- type?: string;
32
- description?: string;
33
- }): Promise<{
34
- content: {
35
- type: "text";
36
- text: string;
37
- }[];
38
- }>;
39
- export declare function deleteProject(params: {
40
- id: number;
41
- }): Promise<{
42
- content: {
43
- type: "text";
44
- text: string;
45
- }[];
46
- }>;
47
- export declare function searchProjects(params: {
48
- query: string;
49
- }): Promise<{
50
- content: {
51
- type: "text";
52
- text: string;
53
- }[];
54
- }>;
55
- export declare function registerProjectTools(server: McpServer): void;
@@ -1,112 +0,0 @@
1
- import { z } from 'zod';
2
- import { getDb } from '../db.js';
3
- import { logActivity, errorResponse, successResponse, now, broadcastChange } from '../helpers.js';
4
- import { ProjectType } from '../types.js';
5
- function parseTask(row) {
6
- return {
7
- ...row,
8
- dependencies: JSON.parse(row.dependencies),
9
- links: JSON.parse(row.links),
10
- tags: JSON.parse(row.tags),
11
- };
12
- }
13
- // ─── exported handler functions ───────────────────────────────────────
14
- export async function createProject(params) {
15
- const db = getDb();
16
- const { name, color = '#de8eff', type = 'active_project', description, } = params;
17
- const ts = now();
18
- const result = db.prepare(`INSERT INTO projects (name, color, type, description, created_at, updated_at)
19
- VALUES (?, ?, ?, ?, ?, ?)`).run(name, color, type, description ?? null, ts, ts);
20
- const project = db.prepare('SELECT * FROM projects WHERE id = ?').get(result.lastInsertRowid);
21
- logActivity('project_created', name, { entityType: 'project', entityId: project.id });
22
- const createdProject = project;
23
- broadcastChange('project', 'project_created', createdProject);
24
- return successResponse(createdProject);
25
- }
26
- export async function listProjects() {
27
- const db = getDb();
28
- const rows = db.prepare(`SELECT projects.*, COUNT(tasks.id) AS task_count
29
- FROM projects
30
- LEFT JOIN tasks ON tasks.project_id = projects.id
31
- GROUP BY projects.id`).all();
32
- return successResponse(rows);
33
- }
34
- export async function getProject(params) {
35
- const db = getDb();
36
- const project = db.prepare('SELECT * FROM projects WHERE id = ?').get(params.id);
37
- if (!project)
38
- return errorResponse('Project not found', 'NOT_FOUND');
39
- const tasks = db.prepare('SELECT * FROM tasks WHERE project_id = ?').all(params.id);
40
- return successResponse({
41
- ...project,
42
- tasks: tasks.map(parseTask),
43
- });
44
- }
45
- export async function updateProject(params) {
46
- const db = getDb();
47
- const existing = db.prepare('SELECT * FROM projects WHERE id = ?').get(params.id);
48
- if (!existing)
49
- return errorResponse('Project not found', 'NOT_FOUND');
50
- const updates = {};
51
- if (params.name !== undefined)
52
- updates.name = params.name;
53
- if (params.color !== undefined)
54
- updates.color = params.color;
55
- if (params.type !== undefined)
56
- updates.type = params.type;
57
- if (params.description !== undefined)
58
- updates.description = params.description;
59
- if (Object.keys(updates).length === 0) {
60
- return successResponse(existing);
61
- }
62
- updates.updated_at = now();
63
- const setClauses = Object.keys(updates).map(k => `${k} = ?`).join(', ');
64
- const vals = Object.values(updates);
65
- db.prepare(`UPDATE projects SET ${setClauses} WHERE id = ?`).run(...vals, params.id);
66
- logActivity('project_updated', params.name ?? existing.name, { entityType: 'project', entityId: params.id });
67
- const updated = db.prepare('SELECT * FROM projects WHERE id = ?').get(params.id);
68
- const updatedProject = updated;
69
- broadcastChange('project', 'project_updated', updatedProject);
70
- return successResponse(updatedProject);
71
- }
72
- export async function deleteProject(params) {
73
- const db = getDb();
74
- const project = db.prepare('SELECT * FROM projects WHERE id = ?').get(params.id);
75
- if (!project)
76
- return errorResponse('Project not found', 'NOT_FOUND');
77
- // FK ON DELETE SET NULL handles unlinking tasks automatically
78
- db.prepare('DELETE FROM projects WHERE id = ?').run(params.id);
79
- logActivity('project_deleted', project.name, { entityType: 'project', entityId: params.id });
80
- broadcastChange('project', 'project_deleted', { id: params.id });
81
- return successResponse({ deleted: true, id: params.id });
82
- }
83
- export async function searchProjects(params) {
84
- const db = getDb();
85
- const like = `%${params.query}%`;
86
- const rows = db.prepare(`SELECT projects.*, COUNT(tasks.id) AS task_count
87
- FROM projects
88
- LEFT JOIN tasks ON tasks.project_id = projects.id
89
- WHERE projects.name LIKE ? COLLATE NOCASE OR projects.description LIKE ? COLLATE NOCASE
90
- GROUP BY projects.id`).all(like, like);
91
- return successResponse(rows);
92
- }
93
- // ─── MCP registration ─────────────────────────────────────────────────
94
- export function registerProjectTools(server) {
95
- server.tool('create_project', 'Create a new project. Projects group related tasks and track time across them.', {
96
- name: z.string(),
97
- color: z.string().optional(),
98
- type: ProjectType.optional(),
99
- description: z.string().optional(),
100
- }, { readOnlyHint: false }, async (params) => createProject(params));
101
- server.tool('list_projects', 'List all projects with task count. Call this at conversation start to understand the workspace.', {}, { readOnlyHint: true }, async () => listProjects());
102
- server.tool('get_project', 'Get a project by ID with all its tasks. Use this to understand the full scope of a project before starting work.', { id: z.number() }, { readOnlyHint: true }, async (params) => getProject(params));
103
- server.tool('update_project', 'Update project fields such as name, color, type, or description.', {
104
- id: z.number(),
105
- name: z.string().optional(),
106
- color: z.string().optional(),
107
- type: ProjectType.optional(),
108
- description: z.string().optional(),
109
- }, { readOnlyHint: false }, async (params) => updateProject(params));
110
- server.tool('delete_project', 'Delete a project by ID. Tasks under this project will be unlinked (project_id set to NULL), not deleted.', { id: z.number() }, { destructiveHint: true }, async (params) => deleteProject(params));
111
- server.tool('search_projects', 'Search projects by name or description. Use this to find projects related to your current work.', { query: z.string() }, { readOnlyHint: true }, async (params) => searchProjects(params));
112
- }
@@ -1,19 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function getSetting(params: {
3
- key: string;
4
- }): Promise<{
5
- content: {
6
- type: "text";
7
- text: string;
8
- }[];
9
- }>;
10
- export declare function updateSetting(params: {
11
- key: string;
12
- value: unknown;
13
- }): Promise<{
14
- content: {
15
- type: "text";
16
- text: string;
17
- }[];
18
- }>;
19
- export declare function registerSettingsTools(server: McpServer): void;
@@ -1,73 +0,0 @@
1
- import { z } from 'zod';
2
- import { getDb } from '../db.js';
3
- import { logActivity, successResponse, broadcastChange } from '../helpers.js';
4
- import { getConfig, isServerConfigKey, writeConfigKey } from '../config.js';
5
- // ─── defaults ─────────────────────────────────────────────────────────
6
- const DEFAULT_SETTINGS = {
7
- timerBarDisplayMode: 'carousel',
8
- notificationInterval: 30,
9
- browserNotificationsEnabled: true,
10
- statusColors: {
11
- not_started: '#484847',
12
- in_progress: '#00fbfb',
13
- paused: '#de8eff',
14
- blocked: '#ff6e84',
15
- partial_done: '#ffeb3b',
16
- done: '#69fd5d',
17
- },
18
- glowIntensity: 50,
19
- backdropBlur: 8,
20
- shadowSpread: 4,
21
- operatorName: 'operator',
22
- systemName: 'SYSTEM',
23
- terminalHistory: [],
24
- };
25
- // ─── exported handler functions ───────────────────────────────────────
26
- export async function getSetting(params) {
27
- // Server-level settings come from the config file
28
- if (isServerConfigKey(params.key)) {
29
- const config = getConfig();
30
- const value = config[params.key] ?? null;
31
- return successResponse({ key: params.key, value, source: 'config_file' });
32
- }
33
- // UI settings come from SQLite
34
- const db = getDb();
35
- const row = db
36
- .prepare('SELECT value FROM settings WHERE key = ?')
37
- .get(params.key);
38
- if (row) {
39
- return successResponse({ key: params.key, value: JSON.parse(row.value) });
40
- }
41
- const defaultValue = Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, params.key)
42
- ? DEFAULT_SETTINGS[params.key]
43
- : null;
44
- return successResponse({ key: params.key, value: defaultValue });
45
- }
46
- export async function updateSetting(params) {
47
- // Server-level settings write back to ~/.taskflow_config.json
48
- if (isServerConfigKey(params.key)) {
49
- writeConfigKey(params.key, params.value);
50
- logActivity('settings_saved', params.key, { detail: `Server setting "${params.key}" updated in config file` });
51
- broadcastChange('setting', 'settings_saved', { key: params.key, value: params.value });
52
- return successResponse({
53
- key: params.key,
54
- value: params.value,
55
- source: 'config_file',
56
- note: 'Server setting saved to ~/.taskflow_config.json. Restart the MCP server for the change to take full effect.',
57
- });
58
- }
59
- // UI settings go to SQLite
60
- const db = getDb();
61
- db.prepare('INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)').run(params.key, JSON.stringify(params.value));
62
- logActivity('settings_saved', params.key, { detail: `Setting "${params.key}" updated` });
63
- broadcastChange('setting', 'settings_saved', { key: params.key, value: params.value });
64
- return successResponse({ key: params.key, value: params.value });
65
- }
66
- // ─── MCP registration ─────────────────────────────────────────────────
67
- export function registerSettingsTools(server) {
68
- server.tool('get_setting', 'Get a setting value by key. Server settings (port, host, databasePath, logLevel, agentLivenessInterval, maxPortAttempts) come from ~/.taskflow_config.json. UI settings (timerBarDisplayMode, notificationInterval, statusColors, operatorName, systemName, etc.) come from SQLite.', { key: z.string() }, { readOnlyHint: true }, async (params) => getSetting(params));
69
- server.tool('update_setting', 'Update a setting value. Server settings (port, host, databasePath, logLevel, agentLivenessInterval, maxPortAttempts) are written to ~/.taskflow_config.json and require a restart. UI settings are saved to the local SQLite database.', {
70
- key: z.string(),
71
- value: z.unknown(),
72
- }, { readOnlyHint: false }, async (params) => updateSetting(params));
73
- }
@@ -1,105 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- export declare function createTask(params: {
3
- title: string;
4
- description?: string;
5
- status?: string;
6
- priority?: string;
7
- project_id?: number;
8
- dependencies?: number[];
9
- tags?: string[];
10
- links?: Array<{
11
- label: string;
12
- url: string;
13
- }>;
14
- due_date?: string;
15
- estimated_time?: number;
16
- }): Promise<{
17
- content: {
18
- type: "text";
19
- text: string;
20
- }[];
21
- }>;
22
- export declare function listTasks(params: {
23
- status?: string;
24
- project_id?: number;
25
- priority?: string;
26
- tag?: string;
27
- }): Promise<{
28
- content: {
29
- type: "text";
30
- text: string;
31
- }[];
32
- }>;
33
- export declare function getTask(params: {
34
- id: number;
35
- }): Promise<{
36
- content: {
37
- type: "text";
38
- text: string;
39
- }[];
40
- }>;
41
- export declare function updateTask(params: {
42
- id: number;
43
- title?: string;
44
- description?: string;
45
- status?: string;
46
- priority?: string;
47
- project_id?: number;
48
- dependencies?: number[];
49
- tags?: string[];
50
- links?: Array<{
51
- label: string;
52
- url: string;
53
- }>;
54
- due_date?: string;
55
- estimated_time?: number;
56
- allowed_tools?: string[];
57
- denied_tools?: string[];
58
- }): Promise<{
59
- content: {
60
- type: "text";
61
- text: string;
62
- }[];
63
- }>;
64
- export declare function updateTaskStatus(params: {
65
- id: number;
66
- status: string;
67
- }): Promise<{
68
- content: {
69
- type: "text";
70
- text: string;
71
- }[];
72
- }>;
73
- export declare function deleteTask(params: {
74
- id: number;
75
- }): Promise<{
76
- content: {
77
- type: "text";
78
- text: string;
79
- }[];
80
- }>;
81
- export declare function bulkCreateTasks(params: {
82
- tasks: Array<{
83
- title: string;
84
- description?: string;
85
- priority?: string;
86
- project_id?: number;
87
- status?: string;
88
- dependencies?: number[];
89
- tags?: string[];
90
- }>;
91
- }): Promise<{
92
- content: {
93
- type: "text";
94
- text: string;
95
- }[];
96
- }>;
97
- export declare function searchTasks(params: {
98
- query: string;
99
- }): Promise<{
100
- content: {
101
- type: "text";
102
- text: string;
103
- }[];
104
- }>;
105
- export declare function registerTaskTools(server: McpServer): void;