@lovelybunch/mcp 1.0.75-alpha.9 → 1.0.75
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/architecture-context-tool.d.ts +1 -1
- package/dist/architecture-context-tool.d.ts.map +1 -1
- package/dist/events-tool.d.ts +1 -1
- package/dist/events-tool.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge-tool.d.ts +1 -1
- package/dist/knowledge-tool.d.ts.map +1 -1
- package/dist/knowledge-tool.js +1 -1
- package/dist/knowledge-tool.js.map +1 -1
- package/dist/project-context-tool.d.ts +1 -1
- package/dist/project-context-tool.d.ts.map +1 -1
- package/dist/resources-tool.d.ts +1 -1
- package/dist/resources-tool.d.ts.map +1 -1
- package/dist/role-context-tool.d.ts +1 -1
- package/dist/role-context-tool.d.ts.map +1 -1
- package/dist/tasks-tool.d.ts +31 -0
- package/dist/tasks-tool.d.ts.map +1 -0
- package/dist/tasks-tool.js +153 -0
- package/dist/tasks-tool.js.map +1 -0
- package/package.json +3 -3
- package/src/architecture-context-tool.ts +1 -1
- package/src/events-tool.ts +1 -1
- package/src/index.ts +2 -2
- package/src/knowledge-tool.ts +2 -2
- package/src/project-context-tool.ts +1 -1
- package/src/resources-tool.ts +1 -1
- package/src/role-context-tool.ts +1 -1
- package/src/tasks-tool.test.ts +139 -0
- package/src/tasks-tool.ts +170 -0
- package/src/proposals-tool.test.ts +0 -109
- package/src/proposals-tool.ts +0 -175
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Architecture Context tool for MCP - READ + WRITE
|
|
3
3
|
* Allows the AI assistant to read and update the architecture document (.nut/context/architecture.md)
|
|
4
4
|
*/
|
|
5
|
-
import type { MCPTool } from './
|
|
5
|
+
import type { MCPTool } from './tasks-tool.js';
|
|
6
6
|
/**
|
|
7
7
|
* Architecture context tool for AI assistant.
|
|
8
8
|
* Read and update the core architecture document.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture-context-tool.d.ts","sourceRoot":"","sources":["../src/architecture-context-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"architecture-context-tool.d.ts","sourceRoot":"","sources":["../src/architecture-context-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,OA0BrC,CAAA"}
|
package/dist/events-tool.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Events tool for MCP - READ ONLY
|
|
3
3
|
* Allows the AI assistant to read recent activity/events from the Coconut instance
|
|
4
4
|
*/
|
|
5
|
-
import type { MCPTool } from './
|
|
5
|
+
import type { MCPTool } from './tasks-tool.js';
|
|
6
6
|
/**
|
|
7
7
|
* Read-only events tool for AI assistant.
|
|
8
8
|
* Returns recent activity events, most recent first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-tool.d.ts","sourceRoot":"","sources":["../src/events-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"events-tool.d.ts","sourceRoot":"","sources":["../src/events-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,OAuBxB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { tasksTool, tasksReadOnlyTool, tasksFullTool, listTasksTool, validateTaskData, createToolCall } from './tasks-tool.js';
|
|
2
2
|
export { eventsTool } from './events-tool.js';
|
|
3
3
|
export { projectContextTool } from './project-context-tool.js';
|
|
4
4
|
export { architectureContextTool } from './architecture-context-tool.js';
|
|
@@ -6,5 +6,5 @@ export { roleContextTool } from './role-context-tool.js';
|
|
|
6
6
|
export { knowledgeTool, createKnowledgeToolCall, normalizeKnowledgeMetadata, buildKnowledgeActionPayload } from './knowledge-tool.js';
|
|
7
7
|
export type { KnowledgeActionPayload, KnowledgeActionType, KnowledgeDocument, KnowledgeDocumentMetadata } from './knowledge-tool.js';
|
|
8
8
|
export { resourcesTool } from './resources-tool.js';
|
|
9
|
-
export type { MCPTool, MCPToolCall } from './
|
|
9
|
+
export type { MCPTool, MCPToolCall } from './tasks-tool.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC9H,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { tasksTool, tasksReadOnlyTool, tasksFullTool, listTasksTool, validateTaskData, createToolCall } from './tasks-tool.js';
|
|
2
2
|
export { eventsTool } from './events-tool.js';
|
|
3
3
|
export { projectContextTool } from './project-context-tool.js';
|
|
4
4
|
export { architectureContextTool } from './architecture-context-tool.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC9H,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAO5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/knowledge-tool.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-tool.d.ts","sourceRoot":"","sources":["../src/knowledge-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+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;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,CAQrG;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,CAAC,EAAE,yBAAyB,GAAG,IAAI,GAAG,yBAAyB,CAWjH;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,sBAAsB,GAAG,sBAAsB,CAMjG"}
|
package/dist/knowledge-tool.js
CHANGED
|
@@ -8,7 +8,7 @@ const metadataSchema = {
|
|
|
8
8
|
category: { type: 'string', description: 'High-level category for grouping documents' },
|
|
9
9
|
tags: { type: 'array', items: { type: 'string' }, description: 'Keyword tags to aid discovery' },
|
|
10
10
|
sources: { type: 'array', items: { type: 'string' }, description: 'URLs or references that informed this knowledge' },
|
|
11
|
-
related: { type: 'array', items: { type: 'string' }, description: 'Paths to related docs (e.g.
|
|
11
|
+
related: { type: 'array', items: { type: 'string' }, description: 'Paths to related docs (e.g. tasks, specs)' },
|
|
12
12
|
owner: {
|
|
13
13
|
type: 'object',
|
|
14
14
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-tool.js","sourceRoot":"","sources":["../src/knowledge-tool.ts"],"names":[],"mappings":"AAuCA,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,kEAAkE;IAC/E,UAAU,EAAE;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE;QACtF,wFAAwF;QACxF,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;QAC7E,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE;QACvF,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,W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ED,MAAM,UAAU,0BAA0B,CAAC,QAA2C;IACpF,4EAA4E;IAC5E,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,EAAE,EAAE,iEAAiE;QAC9E,GAAG,QAAQ;QACX,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9C,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;QACvD,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;QACvD,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;KAC3D,CAAA;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,KAA6B;IACvE,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACxF,OAAO;QACL,GAAG,KAAK;QACR,QAAQ;KACT,CAAA;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Project Context tool for MCP - READ + WRITE
|
|
3
3
|
* Allows the AI assistant to read and update the project definition document (.nut/context/project.md)
|
|
4
4
|
*/
|
|
5
|
-
import type { MCPTool } from './
|
|
5
|
+
import type { MCPTool } from './tasks-tool.js';
|
|
6
6
|
/**
|
|
7
7
|
* Project context tool for AI assistant.
|
|
8
8
|
* Read and update the core project definition document.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context-tool.d.ts","sourceRoot":"","sources":["../src/project-context-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"project-context-tool.d.ts","sourceRoot":"","sources":["../src/project-context-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,OA0BhC,CAAA"}
|
package/dist/resources-tool.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources-tool.d.ts","sourceRoot":"","sources":["../src/resources-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"resources-tool.d.ts","sourceRoot":"","sources":["../src/resources-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C,eAAO,MAAM,aAAa,EAAE,OA0E3B,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Role Context tool for MCP - READ + WRITE
|
|
3
3
|
* Allows the AI assistant to read and update the role definition document (.nut/context/role.md)
|
|
4
4
|
*/
|
|
5
|
-
import type { MCPTool } from './
|
|
5
|
+
import type { MCPTool } from './tasks-tool.js';
|
|
6
6
|
/**
|
|
7
7
|
* Role context tool for AI assistant.
|
|
8
8
|
* Read and update the role definition document.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-context-tool.d.ts","sourceRoot":"","sources":["../src/role-context-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"role-context-tool.d.ts","sourceRoot":"","sources":["../src/role-context-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,OA0B7B,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Task } from '@lovelybunch/types';
|
|
2
|
+
export interface MCPTool {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
type: 'object';
|
|
7
|
+
properties: Record<string, any>;
|
|
8
|
+
required?: string[];
|
|
9
|
+
additionalProperties?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface MCPToolCall {
|
|
13
|
+
name: string;
|
|
14
|
+
arguments: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
export declare const listTasksTool: MCPTool;
|
|
17
|
+
export declare const tasksTool: MCPTool;
|
|
18
|
+
/**
|
|
19
|
+
* Read-only version of the tasks tool for AI assistant.
|
|
20
|
+
* Only exposes list and get operations - no create/update/delete.
|
|
21
|
+
* Creating tasks should be done by coding agents (Claude Code, Cursor, etc.) or via the UI.
|
|
22
|
+
*/
|
|
23
|
+
export declare const tasksReadOnlyTool: MCPTool;
|
|
24
|
+
/**
|
|
25
|
+
* Full CRUD tasks tool that includes create and update operations.
|
|
26
|
+
* Uses Zod schemas for validation.
|
|
27
|
+
*/
|
|
28
|
+
export declare const tasksFullTool: MCPTool;
|
|
29
|
+
export declare function validateTaskData(data: any): Partial<Task>;
|
|
30
|
+
export declare function createToolCall(operation: string, args: any): MCPToolCall;
|
|
31
|
+
//# sourceMappingURL=tasks-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-tool.d.ts","sourceRoot":"","sources":["../src/tasks-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAG9C,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ,CAAA;QACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC/B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,oBAAoB,CAAC,EAAE,OAAO,CAAA;KAC/B,CAAA;CACF;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B;AAQD,eAAO,MAAM,aAAa,EAAE,OAa3B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,OA+BvB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAwB/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,OAoC3B,CAAA;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAazD;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,WAAW,CAQxE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { taskJsonSchemas } from '@lovelybunch/core';
|
|
2
|
+
// Use pre-computed JSON schemas from core
|
|
3
|
+
const filtersProperties = taskJsonSchemas.filters;
|
|
4
|
+
const createProperties = taskJsonSchemas.create;
|
|
5
|
+
const updateProperties = taskJsonSchemas.update;
|
|
6
|
+
const createRequired = taskJsonSchemas.createRequired;
|
|
7
|
+
export const listTasksTool = {
|
|
8
|
+
name: "list_tasks",
|
|
9
|
+
description: "List all tasks with metadata only (title, ID, status, priority, tags)",
|
|
10
|
+
parameters: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
filters: {
|
|
14
|
+
type: "object",
|
|
15
|
+
description: "Optional filters for the task list",
|
|
16
|
+
properties: filtersProperties
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const tasksTool = {
|
|
22
|
+
name: "tasks",
|
|
23
|
+
description: "Manage tasks - create, read, update, delete tasks. IMPORTANT: When searching for tasks by topic or keyword, always use filters.search to filter results server-side. The 'list' operation returns lightweight summaries — use 'get' with a task ID for full details.",
|
|
24
|
+
parameters: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
operation: {
|
|
28
|
+
type: "string",
|
|
29
|
+
enum: ["list", "get", "create", "update", "delete"],
|
|
30
|
+
description: "The operation to perform on tasks"
|
|
31
|
+
},
|
|
32
|
+
id: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Task ID (required for get, update, delete operations)"
|
|
35
|
+
},
|
|
36
|
+
// Filters for list operation - auto-generated from Zod schema
|
|
37
|
+
filters: {
|
|
38
|
+
type: "object",
|
|
39
|
+
description: "Filters for list operation. Defaults to limit=20. Use search to find tasks by keyword — results are filtered server-side for accuracy.",
|
|
40
|
+
properties: filtersProperties
|
|
41
|
+
},
|
|
42
|
+
// Task data for create operation - auto-generated from Zod schema
|
|
43
|
+
task: {
|
|
44
|
+
type: "object",
|
|
45
|
+
description: "Task data for create/update operations. For create: intent and content are required. For update: at least one field is required.",
|
|
46
|
+
properties: createProperties,
|
|
47
|
+
required: [...createRequired]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
required: ["operation"]
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Read-only version of the tasks tool for AI assistant.
|
|
55
|
+
* Only exposes list and get operations - no create/update/delete.
|
|
56
|
+
* Creating tasks should be done by coding agents (Claude Code, Cursor, etc.) or via the UI.
|
|
57
|
+
*/
|
|
58
|
+
export const tasksReadOnlyTool = {
|
|
59
|
+
name: "tasks",
|
|
60
|
+
description: "READ-ONLY: Search and read tasks. You can ONLY use 'list' and 'get' operations. You CANNOT create, update, or delete tasks — that should be done by coding agents (Claude Code, Cursor, etc.) which have broader codebase context, or via the Tasks UI. The 'list' operation returns lightweight summaries — use 'get' with a task ID for full details.",
|
|
61
|
+
parameters: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
operation: {
|
|
65
|
+
type: "string",
|
|
66
|
+
enum: ["list", "get"],
|
|
67
|
+
description: "ONLY 'list' or 'get' are allowed. 'list' to search/browse tasks (returns summaries), 'get' to retrieve a specific task by ID (returns full details)"
|
|
68
|
+
},
|
|
69
|
+
id: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Task ID (required for get operation)"
|
|
72
|
+
},
|
|
73
|
+
// Filters auto-generated from Zod schema
|
|
74
|
+
filters: {
|
|
75
|
+
type: "object",
|
|
76
|
+
description: "Filters for list operation. Defaults to limit=20. Use search to find tasks by keyword.",
|
|
77
|
+
properties: filtersProperties
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
required: ["operation"]
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Full CRUD tasks tool that includes create and update operations.
|
|
85
|
+
* Uses Zod schemas for validation.
|
|
86
|
+
*/
|
|
87
|
+
export const tasksFullTool = {
|
|
88
|
+
name: "tasks",
|
|
89
|
+
description: "Full CRUD for tasks - create, read, update, delete. Use this when you need to create or modify tasks via MCP. The 'list' operation returns lightweight summaries (id, title, status, priority, tags, author, dates) — use 'get' with a specific task ID to retrieve full task details including content and plan steps.",
|
|
90
|
+
parameters: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
operation: {
|
|
94
|
+
type: "string",
|
|
95
|
+
enum: ["list", "get", "create", "update", "delete"],
|
|
96
|
+
description: "The operation to perform"
|
|
97
|
+
},
|
|
98
|
+
id: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: "Task ID (required for get, update, delete operations)"
|
|
101
|
+
},
|
|
102
|
+
filters: {
|
|
103
|
+
type: "object",
|
|
104
|
+
description: "Filters for list operation. Defaults to limit=20. Use status, priority, tags, search, or author to narrow results.",
|
|
105
|
+
properties: filtersProperties
|
|
106
|
+
},
|
|
107
|
+
// For create - all fields from CreateTaskInputSchema
|
|
108
|
+
task: {
|
|
109
|
+
type: "object",
|
|
110
|
+
description: "Task data for create operation",
|
|
111
|
+
properties: createProperties,
|
|
112
|
+
required: [...createRequired]
|
|
113
|
+
},
|
|
114
|
+
// For update - partial fields from UpdateTaskInputSchema
|
|
115
|
+
updates: {
|
|
116
|
+
type: "object",
|
|
117
|
+
description: "Fields to update (for update operation). At least one field required.",
|
|
118
|
+
properties: updateProperties
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
required: ["operation"]
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
export function validateTaskData(data) {
|
|
125
|
+
const task = {};
|
|
126
|
+
if (data.title)
|
|
127
|
+
task.title = data.title;
|
|
128
|
+
if (data.intent)
|
|
129
|
+
task.intent = data.intent;
|
|
130
|
+
if (data.content)
|
|
131
|
+
task.content = data.content;
|
|
132
|
+
if (data.author)
|
|
133
|
+
task.author = data.author;
|
|
134
|
+
if (data.planSteps)
|
|
135
|
+
task.planSteps = data.planSteps;
|
|
136
|
+
if (data.status)
|
|
137
|
+
task.status = data.status;
|
|
138
|
+
if (data.metadata)
|
|
139
|
+
task.metadata = data.metadata;
|
|
140
|
+
if (data.productSpecRef)
|
|
141
|
+
task.productSpecRef = data.productSpecRef;
|
|
142
|
+
return task;
|
|
143
|
+
}
|
|
144
|
+
export function createToolCall(operation, args) {
|
|
145
|
+
return {
|
|
146
|
+
name: "tasks",
|
|
147
|
+
arguments: {
|
|
148
|
+
operation,
|
|
149
|
+
...args
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=tasks-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-tool.js","sourceRoot":"","sources":["../src/tasks-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAkBnD,0CAA0C;AAC1C,MAAM,i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ist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"test:ui": "vitest --ui"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lovelybunch/core": "^1.0.75
|
|
18
|
-
"@lovelybunch/types": "^1.0.75
|
|
17
|
+
"@lovelybunch/core": "^1.0.75",
|
|
18
|
+
"@lovelybunch/types": "^1.0.75",
|
|
19
19
|
"hono": "^4.0.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Allows the AI assistant to read and update the architecture document (.nut/context/architecture.md)
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { MCPTool } from './
|
|
6
|
+
import type { MCPTool } from './tasks-tool.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Architecture context tool for AI assistant.
|
package/src/events-tool.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { tasksTool, tasksReadOnlyTool, tasksFullTool, listTasksTool, validateTaskData, createToolCall } from './tasks-tool.js'
|
|
2
2
|
export { eventsTool } from './events-tool.js'
|
|
3
3
|
export { projectContextTool } from './project-context-tool.js'
|
|
4
4
|
export { architectureContextTool } from './architecture-context-tool.js'
|
|
@@ -16,4 +16,4 @@ export type {
|
|
|
16
16
|
KnowledgeDocumentMetadata
|
|
17
17
|
} from './knowledge-tool.js'
|
|
18
18
|
export { resourcesTool } from './resources-tool.js'
|
|
19
|
-
export type { MCPTool, MCPToolCall } from './
|
|
19
|
+
export type { MCPTool, MCPToolCall } from './tasks-tool.js'
|
package/src/knowledge-tool.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MCPTool, MCPToolCall } from './
|
|
1
|
+
import type { MCPTool, MCPToolCall } from './tasks-tool.js'
|
|
2
2
|
|
|
3
3
|
export interface KnowledgeDocumentMetadata {
|
|
4
4
|
version?: string
|
|
@@ -47,7 +47,7 @@ const metadataSchema = {
|
|
|
47
47
|
category: { type: 'string', description: 'High-level category for grouping documents' },
|
|
48
48
|
tags: { type: 'array', items: { type: 'string' }, description: 'Keyword tags to aid discovery' },
|
|
49
49
|
sources: { type: 'array', items: { type: 'string' }, description: 'URLs or references that informed this knowledge' },
|
|
50
|
-
related: { type: 'array', items: { type: 'string' }, description: 'Paths to related docs (e.g.
|
|
50
|
+
related: { type: 'array', items: { type: 'string' }, description: 'Paths to related docs (e.g. tasks, specs)' },
|
|
51
51
|
owner: {
|
|
52
52
|
type: 'object',
|
|
53
53
|
properties: {
|
package/src/resources-tool.ts
CHANGED
package/src/role-context-tool.ts
CHANGED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for tasks tool utilities
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect } from 'vitest';
|
|
6
|
+
import {
|
|
7
|
+
validateTaskData,
|
|
8
|
+
createToolCall,
|
|
9
|
+
listTasksTool,
|
|
10
|
+
tasksTool,
|
|
11
|
+
tasksReadOnlyTool,
|
|
12
|
+
tasksFullTool,
|
|
13
|
+
} from './tasks-tool.js';
|
|
14
|
+
|
|
15
|
+
describe('validateTaskData', () => {
|
|
16
|
+
it('should extract intent and content', () => {
|
|
17
|
+
const result = validateTaskData({
|
|
18
|
+
intent: 'Add dark mode',
|
|
19
|
+
content: 'Implement dark mode toggle',
|
|
20
|
+
});
|
|
21
|
+
expect(result.intent).toBe('Add dark mode');
|
|
22
|
+
expect(result.content).toBe('Implement dark mode toggle');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should extract all supported fields', () => {
|
|
26
|
+
const result = validateTaskData({
|
|
27
|
+
intent: 'Test',
|
|
28
|
+
content: 'Body',
|
|
29
|
+
author: 'engineer',
|
|
30
|
+
planSteps: ['step1'],
|
|
31
|
+
status: 'draft',
|
|
32
|
+
metadata: { foo: 'bar' },
|
|
33
|
+
});
|
|
34
|
+
expect(result.intent).toBe('Test');
|
|
35
|
+
expect(result.content).toBe('Body');
|
|
36
|
+
expect(result.author).toBe('engineer');
|
|
37
|
+
expect(result.planSteps).toEqual(['step1']);
|
|
38
|
+
expect(result.status).toBe('draft');
|
|
39
|
+
expect(result.metadata).toEqual({ foo: 'bar' });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should return empty object for empty input', () => {
|
|
43
|
+
const result = validateTaskData({});
|
|
44
|
+
expect(result).toEqual({});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should ignore unknown fields', () => {
|
|
48
|
+
const result = validateTaskData({
|
|
49
|
+
intent: 'Test',
|
|
50
|
+
unknownField: 'ignored',
|
|
51
|
+
});
|
|
52
|
+
expect(result.intent).toBe('Test');
|
|
53
|
+
expect((result as any).unknownField).toBeUndefined();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('createToolCall', () => {
|
|
58
|
+
it('should create tool call with operation and args', () => {
|
|
59
|
+
const call = createToolCall('list', { filters: { status: 'draft' } });
|
|
60
|
+
expect(call.name).toBe('tasks');
|
|
61
|
+
expect(call.arguments).toEqual({
|
|
62
|
+
operation: 'list',
|
|
63
|
+
filters: { status: 'draft' },
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should create tool call for get operation', () => {
|
|
68
|
+
const call = createToolCall('get', { id: 'cp-123' });
|
|
69
|
+
expect(call.name).toBe('tasks');
|
|
70
|
+
expect(call.arguments).toEqual({
|
|
71
|
+
operation: 'get',
|
|
72
|
+
id: 'cp-123',
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should merge operation with spread args', () => {
|
|
77
|
+
const call = createToolCall('create', { task: { intent: 'Test' } });
|
|
78
|
+
expect(call.arguments.operation).toBe('create');
|
|
79
|
+
expect(call.arguments.task).toEqual({ intent: 'Test' });
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe('tasks tools', () => {
|
|
84
|
+
it('should have listTasksTool with correct structure', () => {
|
|
85
|
+
expect(listTasksTool.name).toBe('list_tasks');
|
|
86
|
+
expect(listTasksTool.parameters.type).toBe('object');
|
|
87
|
+
expect(listTasksTool.parameters.properties.filters).toBeDefined();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('should have tasksTool with list, get, create, update, delete operations', () => {
|
|
91
|
+
expect(tasksTool.name).toBe('tasks');
|
|
92
|
+
const ops = tasksTool.parameters.properties.operation.enum;
|
|
93
|
+
expect(ops).toContain('list');
|
|
94
|
+
expect(ops).toContain('get');
|
|
95
|
+
expect(ops).toContain('create');
|
|
96
|
+
expect(ops).toContain('update');
|
|
97
|
+
expect(ops).toContain('delete');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should have tasksReadOnlyTool with only list and get', () => {
|
|
101
|
+
const ops = tasksReadOnlyTool.parameters.properties.operation.enum;
|
|
102
|
+
expect(ops).toEqual(['list', 'get']);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('should have tasksFullTool with task and updates', () => {
|
|
106
|
+
expect(tasksFullTool.parameters.properties.task).toBeDefined();
|
|
107
|
+
expect(tasksFullTool.parameters.properties.updates).toBeDefined();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should mention summaries in tool descriptions to clarify list returns lightweight data', () => {
|
|
111
|
+
expect(tasksFullTool.description).toContain('summaries');
|
|
112
|
+
expect(tasksTool.description).toContain('summaries');
|
|
113
|
+
expect(tasksReadOnlyTool.description).toContain('summaries');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('should mention using get for full details in tool descriptions', () => {
|
|
117
|
+
expect(tasksFullTool.description).toContain('get');
|
|
118
|
+
expect(tasksTool.description).toContain('get');
|
|
119
|
+
expect(tasksReadOnlyTool.description).toContain('get');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should mention default limit in filters description', () => {
|
|
123
|
+
expect(tasksFullTool.parameters.properties.filters.description).toContain('limit=20');
|
|
124
|
+
expect(tasksTool.parameters.properties.filters.description).toContain('limit=20');
|
|
125
|
+
expect(tasksReadOnlyTool.parameters.properties.filters.description).toContain('limit=20');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should expose limit in the filters properties via JSON schema', () => {
|
|
129
|
+
// Verify that the auto-generated filter properties include a limit field
|
|
130
|
+
const fullFilters = tasksFullTool.parameters.properties.filters.properties;
|
|
131
|
+
expect(fullFilters).toHaveProperty('limit');
|
|
132
|
+
|
|
133
|
+
const readOnlyFilters = tasksReadOnlyTool.parameters.properties.filters.properties;
|
|
134
|
+
expect(readOnlyFilters).toHaveProperty('limit');
|
|
135
|
+
|
|
136
|
+
const standardFilters = tasksTool.parameters.properties.filters.properties;
|
|
137
|
+
expect(standardFilters).toHaveProperty('limit');
|
|
138
|
+
});
|
|
139
|
+
});
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { Task } from '@lovelybunch/types'
|
|
2
|
+
import { taskJsonSchemas } from '@lovelybunch/core'
|
|
3
|
+
|
|
4
|
+
export interface MCPTool {
|
|
5
|
+
name: string
|
|
6
|
+
description: string
|
|
7
|
+
parameters: {
|
|
8
|
+
type: 'object'
|
|
9
|
+
properties: Record<string, any>
|
|
10
|
+
required?: string[]
|
|
11
|
+
additionalProperties?: boolean
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface MCPToolCall {
|
|
16
|
+
name: string
|
|
17
|
+
arguments: Record<string, any>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Use pre-computed JSON schemas from core
|
|
21
|
+
const filtersProperties = taskJsonSchemas.filters
|
|
22
|
+
const createProperties = taskJsonSchemas.create
|
|
23
|
+
const updateProperties = taskJsonSchemas.update
|
|
24
|
+
const createRequired = taskJsonSchemas.createRequired
|
|
25
|
+
|
|
26
|
+
export const listTasksTool: MCPTool = {
|
|
27
|
+
name: "list_tasks",
|
|
28
|
+
description: "List all tasks with metadata only (title, ID, status, priority, tags)",
|
|
29
|
+
parameters: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
filters: {
|
|
33
|
+
type: "object",
|
|
34
|
+
description: "Optional filters for the task list",
|
|
35
|
+
properties: filtersProperties
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const tasksTool: MCPTool = {
|
|
42
|
+
name: "tasks",
|
|
43
|
+
description: "Manage tasks - create, read, update, delete tasks. IMPORTANT: When searching for tasks by topic or keyword, always use filters.search to filter results server-side. The 'list' operation returns lightweight summaries — use 'get' with a task ID for full details.",
|
|
44
|
+
parameters: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
operation: {
|
|
48
|
+
type: "string",
|
|
49
|
+
enum: ["list", "get", "create", "update", "delete"],
|
|
50
|
+
description: "The operation to perform on tasks"
|
|
51
|
+
},
|
|
52
|
+
id: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Task ID (required for get, update, delete operations)"
|
|
55
|
+
},
|
|
56
|
+
// Filters for list operation - auto-generated from Zod schema
|
|
57
|
+
filters: {
|
|
58
|
+
type: "object",
|
|
59
|
+
description: "Filters for list operation. Defaults to limit=20. Use search to find tasks by keyword — results are filtered server-side for accuracy.",
|
|
60
|
+
properties: filtersProperties
|
|
61
|
+
},
|
|
62
|
+
// Task data for create operation - auto-generated from Zod schema
|
|
63
|
+
task: {
|
|
64
|
+
type: "object",
|
|
65
|
+
description: "Task data for create/update operations. For create: intent and content are required. For update: at least one field is required.",
|
|
66
|
+
properties: createProperties,
|
|
67
|
+
required: [...createRequired]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
required: ["operation"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Read-only version of the tasks tool for AI assistant.
|
|
76
|
+
* Only exposes list and get operations - no create/update/delete.
|
|
77
|
+
* Creating tasks should be done by coding agents (Claude Code, Cursor, etc.) or via the UI.
|
|
78
|
+
*/
|
|
79
|
+
export const tasksReadOnlyTool: MCPTool = {
|
|
80
|
+
name: "tasks",
|
|
81
|
+
description: "READ-ONLY: Search and read tasks. You can ONLY use 'list' and 'get' operations. You CANNOT create, update, or delete tasks — that should be done by coding agents (Claude Code, Cursor, etc.) which have broader codebase context, or via the Tasks UI. The 'list' operation returns lightweight summaries — use 'get' with a task ID for full details.",
|
|
82
|
+
parameters: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
operation: {
|
|
86
|
+
type: "string",
|
|
87
|
+
enum: ["list", "get"],
|
|
88
|
+
description: "ONLY 'list' or 'get' are allowed. 'list' to search/browse tasks (returns summaries), 'get' to retrieve a specific task by ID (returns full details)"
|
|
89
|
+
},
|
|
90
|
+
id: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Task ID (required for get operation)"
|
|
93
|
+
},
|
|
94
|
+
// Filters auto-generated from Zod schema
|
|
95
|
+
filters: {
|
|
96
|
+
type: "object",
|
|
97
|
+
description: "Filters for list operation. Defaults to limit=20. Use search to find tasks by keyword.",
|
|
98
|
+
properties: filtersProperties
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
required: ["operation"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Full CRUD tasks tool that includes create and update operations.
|
|
107
|
+
* Uses Zod schemas for validation.
|
|
108
|
+
*/
|
|
109
|
+
export const tasksFullTool: MCPTool = {
|
|
110
|
+
name: "tasks",
|
|
111
|
+
description: "Full CRUD for tasks - create, read, update, delete. Use this when you need to create or modify tasks via MCP. The 'list' operation returns lightweight summaries (id, title, status, priority, tags, author, dates) — use 'get' with a specific task ID to retrieve full task details including content and plan steps.",
|
|
112
|
+
parameters: {
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: {
|
|
115
|
+
operation: {
|
|
116
|
+
type: "string",
|
|
117
|
+
enum: ["list", "get", "create", "update", "delete"],
|
|
118
|
+
description: "The operation to perform"
|
|
119
|
+
},
|
|
120
|
+
id: {
|
|
121
|
+
type: "string",
|
|
122
|
+
description: "Task ID (required for get, update, delete operations)"
|
|
123
|
+
},
|
|
124
|
+
filters: {
|
|
125
|
+
type: "object",
|
|
126
|
+
description: "Filters for list operation. Defaults to limit=20. Use status, priority, tags, search, or author to narrow results.",
|
|
127
|
+
properties: filtersProperties
|
|
128
|
+
},
|
|
129
|
+
// For create - all fields from CreateTaskInputSchema
|
|
130
|
+
task: {
|
|
131
|
+
type: "object",
|
|
132
|
+
description: "Task data for create operation",
|
|
133
|
+
properties: createProperties,
|
|
134
|
+
required: [...createRequired]
|
|
135
|
+
},
|
|
136
|
+
// For update - partial fields from UpdateTaskInputSchema
|
|
137
|
+
updates: {
|
|
138
|
+
type: "object",
|
|
139
|
+
description: "Fields to update (for update operation). At least one field required.",
|
|
140
|
+
properties: updateProperties
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
required: ["operation"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function validateTaskData(data: any): Partial<Task> {
|
|
148
|
+
const task: Partial<Task> = {}
|
|
149
|
+
|
|
150
|
+
if (data.title) task.title = data.title
|
|
151
|
+
if (data.intent) task.intent = data.intent
|
|
152
|
+
if (data.content) task.content = data.content
|
|
153
|
+
if (data.author) task.author = data.author
|
|
154
|
+
if (data.planSteps) task.planSteps = data.planSteps
|
|
155
|
+
if (data.status) task.status = data.status
|
|
156
|
+
if (data.metadata) task.metadata = data.metadata
|
|
157
|
+
if (data.productSpecRef) task.productSpecRef = data.productSpecRef
|
|
158
|
+
|
|
159
|
+
return task
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function createToolCall(operation: string, args: any): MCPToolCall {
|
|
163
|
+
return {
|
|
164
|
+
name: "tasks",
|
|
165
|
+
arguments: {
|
|
166
|
+
operation,
|
|
167
|
+
...args
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for proposals tool utilities
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { describe, it, expect } from 'vitest';
|
|
6
|
-
import {
|
|
7
|
-
validateProposalData,
|
|
8
|
-
createToolCall,
|
|
9
|
-
listProposalsTool,
|
|
10
|
-
proposalsTool,
|
|
11
|
-
proposalsReadOnlyTool,
|
|
12
|
-
proposalsFullTool,
|
|
13
|
-
} from './proposals-tool.js';
|
|
14
|
-
|
|
15
|
-
describe('validateProposalData', () => {
|
|
16
|
-
it('should extract intent and content', () => {
|
|
17
|
-
const result = validateProposalData({
|
|
18
|
-
intent: 'Add dark mode',
|
|
19
|
-
content: 'Implement dark mode toggle',
|
|
20
|
-
});
|
|
21
|
-
expect(result.intent).toBe('Add dark mode');
|
|
22
|
-
expect(result.content).toBe('Implement dark mode toggle');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should extract all supported fields', () => {
|
|
26
|
-
const result = validateProposalData({
|
|
27
|
-
intent: 'Test',
|
|
28
|
-
content: 'Body',
|
|
29
|
-
author: 'engineer',
|
|
30
|
-
planSteps: ['step1'],
|
|
31
|
-
status: 'draft',
|
|
32
|
-
metadata: { foo: 'bar' },
|
|
33
|
-
});
|
|
34
|
-
expect(result.intent).toBe('Test');
|
|
35
|
-
expect(result.content).toBe('Body');
|
|
36
|
-
expect(result.author).toBe('engineer');
|
|
37
|
-
expect(result.planSteps).toEqual(['step1']);
|
|
38
|
-
expect(result.status).toBe('draft');
|
|
39
|
-
expect(result.metadata).toEqual({ foo: 'bar' });
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('should return empty object for empty input', () => {
|
|
43
|
-
const result = validateProposalData({});
|
|
44
|
-
expect(result).toEqual({});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should ignore unknown fields', () => {
|
|
48
|
-
const result = validateProposalData({
|
|
49
|
-
intent: 'Test',
|
|
50
|
-
unknownField: 'ignored',
|
|
51
|
-
});
|
|
52
|
-
expect(result.intent).toBe('Test');
|
|
53
|
-
expect((result as any).unknownField).toBeUndefined();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe('createToolCall', () => {
|
|
58
|
-
it('should create tool call with operation and args', () => {
|
|
59
|
-
const call = createToolCall('list', { filters: { status: 'draft' } });
|
|
60
|
-
expect(call.name).toBe('change_proposals');
|
|
61
|
-
expect(call.arguments).toEqual({
|
|
62
|
-
operation: 'list',
|
|
63
|
-
filters: { status: 'draft' },
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should create tool call for get operation', () => {
|
|
68
|
-
const call = createToolCall('get', { id: 'cp-123' });
|
|
69
|
-
expect(call.name).toBe('change_proposals');
|
|
70
|
-
expect(call.arguments).toEqual({
|
|
71
|
-
operation: 'get',
|
|
72
|
-
id: 'cp-123',
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should merge operation with spread args', () => {
|
|
77
|
-
const call = createToolCall('create', { proposal: { intent: 'Test' } });
|
|
78
|
-
expect(call.arguments.operation).toBe('create');
|
|
79
|
-
expect(call.arguments.proposal).toEqual({ intent: 'Test' });
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
describe('proposals tools', () => {
|
|
84
|
-
it('should have listProposalsTool with correct structure', () => {
|
|
85
|
-
expect(listProposalsTool.name).toBe('list_proposals');
|
|
86
|
-
expect(listProposalsTool.parameters.type).toBe('object');
|
|
87
|
-
expect(listProposalsTool.parameters.properties.filters).toBeDefined();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should have proposalsTool with list, get, create, update, delete operations', () => {
|
|
91
|
-
expect(proposalsTool.name).toBe('change_proposals');
|
|
92
|
-
const ops = proposalsTool.parameters.properties.operation.enum;
|
|
93
|
-
expect(ops).toContain('list');
|
|
94
|
-
expect(ops).toContain('get');
|
|
95
|
-
expect(ops).toContain('create');
|
|
96
|
-
expect(ops).toContain('update');
|
|
97
|
-
expect(ops).toContain('delete');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should have proposalsReadOnlyTool with only list and get', () => {
|
|
101
|
-
const ops = proposalsReadOnlyTool.parameters.properties.operation.enum;
|
|
102
|
-
expect(ops).toEqual(['list', 'get']);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('should have proposalsFullTool with create and updates', () => {
|
|
106
|
-
expect(proposalsFullTool.parameters.properties.proposal).toBeDefined();
|
|
107
|
-
expect(proposalsFullTool.parameters.properties.updates).toBeDefined();
|
|
108
|
-
});
|
|
109
|
-
});
|
package/src/proposals-tool.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import type { ChangeProposal } from '@lovelybunch/types'
|
|
2
|
-
import { proposalJsonSchemas } from '@lovelybunch/core'
|
|
3
|
-
|
|
4
|
-
export interface MCPTool {
|
|
5
|
-
name: string
|
|
6
|
-
description: string
|
|
7
|
-
parameters: {
|
|
8
|
-
type: 'object'
|
|
9
|
-
properties: Record<string, any>
|
|
10
|
-
required?: string[]
|
|
11
|
-
additionalProperties?: boolean
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface MCPToolCall {
|
|
16
|
-
name: string
|
|
17
|
-
arguments: Record<string, any>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Use pre-computed JSON schemas from core
|
|
21
|
-
const filtersProperties = proposalJsonSchemas.filters
|
|
22
|
-
const createProperties = proposalJsonSchemas.create
|
|
23
|
-
const updateProperties = proposalJsonSchemas.update
|
|
24
|
-
const createRequired = proposalJsonSchemas.createRequired
|
|
25
|
-
|
|
26
|
-
export const listProposalsTool: MCPTool = {
|
|
27
|
-
name: "list_proposals",
|
|
28
|
-
description: "List all change proposals with metadata only (title, ID, status, priority, tags)",
|
|
29
|
-
parameters: {
|
|
30
|
-
type: "object",
|
|
31
|
-
properties: {
|
|
32
|
-
filters: {
|
|
33
|
-
type: "object",
|
|
34
|
-
description: "Optional filters for the proposal list",
|
|
35
|
-
properties: filtersProperties
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const proposalsTool: MCPTool = {
|
|
42
|
-
name: "change_proposals",
|
|
43
|
-
description: "Manage change proposals - create, read, update, delete proposals. IMPORTANT: When searching for proposals by topic or keyword, always use filters.search to filter results server-side. The returned count reflects filtered results.",
|
|
44
|
-
parameters: {
|
|
45
|
-
type: "object",
|
|
46
|
-
properties: {
|
|
47
|
-
operation: {
|
|
48
|
-
type: "string",
|
|
49
|
-
enum: ["list", "get", "create", "update", "delete"],
|
|
50
|
-
description: "The operation to perform on proposals"
|
|
51
|
-
},
|
|
52
|
-
id: {
|
|
53
|
-
type: "string",
|
|
54
|
-
description: "Proposal ID (required for get, update, delete operations)"
|
|
55
|
-
},
|
|
56
|
-
// Filters for list operation - auto-generated from Zod schema
|
|
57
|
-
filters: {
|
|
58
|
-
type: "object",
|
|
59
|
-
description: "Filters for list operation. Use search to find proposals by keyword - results are filtered server-side for accuracy.",
|
|
60
|
-
properties: filtersProperties
|
|
61
|
-
},
|
|
62
|
-
// Proposal data for create operation - auto-generated from Zod schema
|
|
63
|
-
proposal: {
|
|
64
|
-
type: "object",
|
|
65
|
-
description: "Proposal data for create/update operations. For create: intent and content are required. For update: at least one field is required.",
|
|
66
|
-
properties: createProperties,
|
|
67
|
-
required: [...createRequired]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
required: ["operation"]
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Read-only version of the proposals tool for AI assistant.
|
|
76
|
-
* Only exposes list and get operations - no create/update/delete.
|
|
77
|
-
* Creating proposals should be done by coding agents (Claude Code, Cursor, etc.) or via the UI.
|
|
78
|
-
*/
|
|
79
|
-
export const proposalsReadOnlyTool: MCPTool = {
|
|
80
|
-
name: "change_proposals",
|
|
81
|
-
description: "READ-ONLY: Search and read change proposals. You can ONLY use 'list' and 'get' operations. You CANNOT create, update, or delete proposals — that should be done by coding agents (Claude Code, Cursor, etc.) which have broader codebase context, or via the Proposals UI.",
|
|
82
|
-
parameters: {
|
|
83
|
-
type: "object",
|
|
84
|
-
properties: {
|
|
85
|
-
operation: {
|
|
86
|
-
type: "string",
|
|
87
|
-
enum: ["list", "get"],
|
|
88
|
-
description: "ONLY 'list' or 'get' are allowed. 'list' to search/browse proposals, 'get' to retrieve a specific proposal by ID"
|
|
89
|
-
},
|
|
90
|
-
id: {
|
|
91
|
-
type: "string",
|
|
92
|
-
description: "Proposal ID (required for get operation)"
|
|
93
|
-
},
|
|
94
|
-
// Filters auto-generated from Zod schema
|
|
95
|
-
filters: {
|
|
96
|
-
type: "object",
|
|
97
|
-
description: "Filters for list operation. Use search to find proposals by keyword.",
|
|
98
|
-
properties: filtersProperties
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
required: ["operation"]
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Full CRUD proposals tool that includes create and update operations.
|
|
107
|
-
* Uses Zod schemas for validation.
|
|
108
|
-
*/
|
|
109
|
-
export const proposalsFullTool: MCPTool = {
|
|
110
|
-
name: "change_proposals",
|
|
111
|
-
description: "Full CRUD for change proposals - create, read, update, delete. Use this when you need to create or modify proposals via MCP.",
|
|
112
|
-
parameters: {
|
|
113
|
-
type: "object",
|
|
114
|
-
properties: {
|
|
115
|
-
operation: {
|
|
116
|
-
type: "string",
|
|
117
|
-
enum: ["list", "get", "create", "update", "delete"],
|
|
118
|
-
description: "The operation to perform"
|
|
119
|
-
},
|
|
120
|
-
id: {
|
|
121
|
-
type: "string",
|
|
122
|
-
description: "Proposal ID (required for get, update, delete operations)"
|
|
123
|
-
},
|
|
124
|
-
filters: {
|
|
125
|
-
type: "object",
|
|
126
|
-
description: "Filters for list operation",
|
|
127
|
-
properties: filtersProperties
|
|
128
|
-
},
|
|
129
|
-
// For create - all fields from CreateProposalInputSchema
|
|
130
|
-
proposal: {
|
|
131
|
-
type: "object",
|
|
132
|
-
description: "Proposal data for create operation",
|
|
133
|
-
properties: createProperties,
|
|
134
|
-
required: [...createRequired]
|
|
135
|
-
},
|
|
136
|
-
// For update - partial fields from UpdateProposalInputSchema
|
|
137
|
-
updates: {
|
|
138
|
-
type: "object",
|
|
139
|
-
description: "Fields to update (for update operation). At least one field required.",
|
|
140
|
-
properties: updateProperties
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
required: ["operation"]
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export function validateProposalData(data: any): Partial<ChangeProposal> {
|
|
148
|
-
const proposal: Partial<ChangeProposal> = {}
|
|
149
|
-
|
|
150
|
-
if (data.intent) proposal.intent = data.intent
|
|
151
|
-
if (data.content) proposal.content = data.content
|
|
152
|
-
if (data.author) proposal.author = data.author
|
|
153
|
-
if (data.planSteps) proposal.planSteps = data.planSteps
|
|
154
|
-
if (data.evidence) proposal.evidence = data.evidence
|
|
155
|
-
if (data.policies) proposal.policies = data.policies
|
|
156
|
-
if (data.featureFlags) proposal.featureFlags = data.featureFlags
|
|
157
|
-
if (data.experiments) proposal.experiments = data.experiments
|
|
158
|
-
if (data.telemetryContracts) proposal.telemetryContracts = data.telemetryContracts
|
|
159
|
-
if (data.releasePlan) proposal.releasePlan = data.releasePlan
|
|
160
|
-
if (data.status) proposal.status = data.status
|
|
161
|
-
if (data.metadata) proposal.metadata = data.metadata
|
|
162
|
-
if (data.productSpecRef) proposal.productSpecRef = data.productSpecRef
|
|
163
|
-
|
|
164
|
-
return proposal
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export function createToolCall(operation: string, args: any): MCPToolCall {
|
|
168
|
-
return {
|
|
169
|
-
name: "change_proposals",
|
|
170
|
-
arguments: {
|
|
171
|
-
operation,
|
|
172
|
-
...args
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|