@paca-ai/paca-mcp 0.1.0-rc.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.
Files changed (97) hide show
  1. package/api/client.d.ts +53 -0
  2. package/api/client.d.ts.map +1 -0
  3. package/api/client.js +267 -0
  4. package/api/client.js.map +1 -0
  5. package/api/doc-client.d.ts +26 -0
  6. package/api/doc-client.d.ts.map +1 -0
  7. package/api/doc-client.js +109 -0
  8. package/api/doc-client.js.map +1 -0
  9. package/api/extended-client.d.ts +44 -0
  10. package/api/extended-client.d.ts.map +1 -0
  11. package/api/extended-client.js +167 -0
  12. package/api/extended-client.js.map +1 -0
  13. package/api/github-client.d.ts +21 -0
  14. package/api/github-client.d.ts.map +1 -0
  15. package/api/github-client.js +87 -0
  16. package/api/github-client.js.map +1 -0
  17. package/api/index.d.ts +7 -0
  18. package/api/index.d.ts.map +1 -0
  19. package/api/index.js +7 -0
  20. package/api/index.js.map +1 -0
  21. package/api/task-extended-client.d.ts +28 -0
  22. package/api/task-extended-client.d.ts.map +1 -0
  23. package/api/task-extended-client.js +123 -0
  24. package/api/task-extended-client.js.map +1 -0
  25. package/api/views-client.d.ts +36 -0
  26. package/api/views-client.d.ts.map +1 -0
  27. package/api/views-client.js +157 -0
  28. package/api/views-client.js.map +1 -0
  29. package/index.d.ts +3 -0
  30. package/index.d.ts.map +1 -0
  31. package/index.js +41 -0
  32. package/index.js.map +1 -0
  33. package/package.json +40 -0
  34. package/server.d.ts +9 -0
  35. package/server.d.ts.map +1 -0
  36. package/server.js +46 -0
  37. package/server.js.map +1 -0
  38. package/tools/attachment-tools.d.ts +15 -0
  39. package/tools/attachment-tools.d.ts.map +1 -0
  40. package/tools/attachment-tools.js +402 -0
  41. package/tools/attachment-tools.js.map +1 -0
  42. package/tools/doc-github-tools.d.ts +15 -0
  43. package/tools/doc-github-tools.d.ts.map +1 -0
  44. package/tools/doc-github-tools.js +520 -0
  45. package/tools/doc-github-tools.js.map +1 -0
  46. package/tools/document-tools.d.ts +16 -0
  47. package/tools/document-tools.d.ts.map +1 -0
  48. package/tools/document-tools.js +224 -0
  49. package/tools/document-tools.js.map +1 -0
  50. package/tools/index.d.ts +19 -0
  51. package/tools/index.d.ts.map +1 -0
  52. package/tools/index.js +171 -0
  53. package/tools/index.js.map +1 -0
  54. package/tools/member-tools.d.ts +15 -0
  55. package/tools/member-tools.d.ts.map +1 -0
  56. package/tools/member-tools.js +391 -0
  57. package/tools/member-tools.js.map +1 -0
  58. package/tools/project-tools.d.ts +16 -0
  59. package/tools/project-tools.d.ts.map +1 -0
  60. package/tools/project-tools.js +178 -0
  61. package/tools/project-tools.js.map +1 -0
  62. package/tools/sprint-tools.d.ts +16 -0
  63. package/tools/sprint-tools.d.ts.map +1 -0
  64. package/tools/sprint-tools.js +258 -0
  65. package/tools/sprint-tools.js.map +1 -0
  66. package/tools/task-activity-tools.d.ts +15 -0
  67. package/tools/task-activity-tools.d.ts.map +1 -0
  68. package/tools/task-activity-tools.js +425 -0
  69. package/tools/task-activity-tools.js.map +1 -0
  70. package/tools/task-tools.d.ts +16 -0
  71. package/tools/task-tools.d.ts.map +1 -0
  72. package/tools/task-tools.js +344 -0
  73. package/tools/task-tools.js.map +1 -0
  74. package/tools/task-type-tools.d.ts +12 -0
  75. package/tools/task-type-tools.d.ts.map +1 -0
  76. package/tools/task-type-tools.js +459 -0
  77. package/tools/task-type-tools.js.map +1 -0
  78. package/tools/view-tools.d.ts +15 -0
  79. package/tools/view-tools.d.ts.map +1 -0
  80. package/tools/view-tools.js +660 -0
  81. package/tools/view-tools.js.map +1 -0
  82. package/types/index.d.ts +564 -0
  83. package/types/index.d.ts.map +1 -0
  84. package/types/index.js +2 -0
  85. package/types/index.js.map +1 -0
  86. package/utils/converters.d.ts +13 -0
  87. package/utils/converters.d.ts.map +1 -0
  88. package/utils/converters.js +50 -0
  89. package/utils/converters.js.map +1 -0
  90. package/utils/formatters.d.ts +34 -0
  91. package/utils/formatters.d.ts.map +1 -0
  92. package/utils/formatters.js +87 -0
  93. package/utils/formatters.js.map +1 -0
  94. package/utils/index.d.ts +3 -0
  95. package/utils/index.d.ts.map +1 -0
  96. package/utils/index.js +3 -0
  97. package/utils/index.js.map +1 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Extended API client for Views, Custom Fields, and Attachments.
3
+ */
4
+ export class PacaAPIViewsClient {
5
+ config;
6
+ constructor(config) {
7
+ this.config = config;
8
+ }
9
+ async request(method, path, body) {
10
+ const url = `${this.config.baseURL}${path}`;
11
+ const headers = {
12
+ "Content-Type": "application/json",
13
+ "X-API-Key": this.config.apiKey,
14
+ };
15
+ const options = {
16
+ method,
17
+ headers,
18
+ };
19
+ if (body) {
20
+ options.body = JSON.stringify(body);
21
+ }
22
+ const response = await fetch(url, options);
23
+ if (!response.ok) {
24
+ const errorText = await response.text();
25
+ throw new Error(`API request failed: ${response.status} ${response.statusText} - ${errorText}`);
26
+ }
27
+ const jsonResponse = await response.json();
28
+ // Handle SuccessEnvelope wrapper
29
+ if (jsonResponse &&
30
+ typeof jsonResponse === "object" &&
31
+ "success" in jsonResponse) {
32
+ const envelope = jsonResponse;
33
+ if (envelope.success) {
34
+ return envelope.data;
35
+ }
36
+ }
37
+ // Fallback for responses not wrapped in SuccessEnvelope
38
+ return jsonResponse;
39
+ }
40
+ async get(path) {
41
+ return this.request("GET", path);
42
+ }
43
+ async post(path, body) {
44
+ return this.request("POST", path, body);
45
+ }
46
+ async patch(path, body) {
47
+ return this.request("PATCH", path, body);
48
+ }
49
+ async delete(path) {
50
+ return this.request("DELETE", path);
51
+ }
52
+ async put(path, body) {
53
+ return this.request("PUT", path, body);
54
+ }
55
+ // ==================== Views ====================
56
+ async listViews(projectId, context, sprintId) {
57
+ const params = [];
58
+ if (context)
59
+ params.push(`context=${context}`);
60
+ if (sprintId !== undefined)
61
+ params.push(`sprint_id=${sprintId}`);
62
+ const queryString = params.length > 0 ? `?${params.join("&")}` : "";
63
+ const response = await this.get(`/api/v1/projects/${projectId}/views${queryString}`);
64
+ if (Array.isArray(response)) {
65
+ return response;
66
+ }
67
+ return response.items || response.views || response.data || [];
68
+ }
69
+ async createView(projectId, input, context, sprintId) {
70
+ const params = [];
71
+ if (context)
72
+ params.push(`context=${context}`);
73
+ if (sprintId !== undefined)
74
+ params.push(`sprint_id=${sprintId}`);
75
+ const queryString = params.length > 0 ? `?${params.join("&")}` : "";
76
+ return this.post(`/api/v1/projects/${projectId}/views${queryString}`, input);
77
+ }
78
+ async reorderViews(projectId, input, context, sprintId) {
79
+ const params = [];
80
+ if (context)
81
+ params.push(`context=${context}`);
82
+ if (sprintId !== undefined)
83
+ params.push(`sprint_id=${sprintId}`);
84
+ const queryString = params.length > 0 ? `?${params.join("&")}` : "";
85
+ await this.put(`/api/v1/projects/${projectId}/views/positions${queryString}`, { view_ids: input.view_ids });
86
+ }
87
+ async getView(projectId, viewId) {
88
+ return this.get(`/api/v1/projects/${projectId}/views/${viewId}`);
89
+ }
90
+ async updateView(projectId, viewId, input) {
91
+ return this.patch(`/api/v1/projects/${projectId}/views/${viewId}`, input);
92
+ }
93
+ async deleteView(projectId, viewId) {
94
+ await this.delete(`/api/v1/projects/${projectId}/views/${viewId}`);
95
+ }
96
+ async listTaskPositions(projectId, viewId) {
97
+ const response = await this.get(`/api/v1/projects/${projectId}/views/${viewId}/task-positions`);
98
+ if (Array.isArray(response)) {
99
+ return response;
100
+ }
101
+ return (response.items ||
102
+ response.taskPositions ||
103
+ response.positions ||
104
+ response.data ||
105
+ []);
106
+ }
107
+ async bulkMoveViewTaskPositions(projectId, viewId, items) {
108
+ await this.put(`/api/v1/projects/${projectId}/views/${viewId}/task-positions`, { items });
109
+ }
110
+ async bulkMoveTasks(projectId, viewId, input) {
111
+ await this.put(`/api/v1/projects/${projectId}/views/${viewId}/task-positions/${input.task_id}`, {
112
+ target_view_id: input.target_view_id,
113
+ target_status_id: input.target_status_id,
114
+ target_position: input.target_position,
115
+ });
116
+ }
117
+ // ==================== Custom Fields ====================
118
+ async listCustomFieldDefinitions(projectId) {
119
+ const response = await this.get(`/api/v1/projects/${projectId}/custom-fields`);
120
+ if (Array.isArray(response)) {
121
+ return response;
122
+ }
123
+ return (response.items ||
124
+ response.customFields ||
125
+ response.fields ||
126
+ response.data ||
127
+ []);
128
+ }
129
+ async getCustomFieldDefinition(projectId, fieldId) {
130
+ return this.get(`/api/v1/projects/${projectId}/custom-fields/${fieldId}`);
131
+ }
132
+ async createCustomFieldDefinition(projectId, input) {
133
+ return this.post(`/api/v1/projects/${projectId}/custom-fields`, input);
134
+ }
135
+ async updateCustomFieldDefinition(projectId, fieldId, input) {
136
+ return this.patch(`/api/v1/projects/${projectId}/custom-fields/${fieldId}`, input);
137
+ }
138
+ async deleteCustomFieldDefinition(projectId, fieldId) {
139
+ await this.delete(`/api/v1/projects/${projectId}/custom-fields/${fieldId}`);
140
+ }
141
+ // ==================== Attachments ====================
142
+ async listTaskAttachments(projectId, taskId) {
143
+ const response = await this.get(`/api/v1/projects/${projectId}/tasks/${taskId}/attachments`);
144
+ if (Array.isArray(response)) {
145
+ return response;
146
+ }
147
+ return response.items || response.attachments || response.data || [];
148
+ }
149
+ async getAttachmentDownloadURL(projectId, taskId, attachmentId) {
150
+ const response = await this.get(`/api/v1/projects/${projectId}/tasks/${taskId}/attachments/${attachmentId}/download-url`);
151
+ return response.url || response.downloadUrl || "";
152
+ }
153
+ async deleteTaskAttachment(projectId, taskId, attachmentId) {
154
+ await this.delete(`/api/v1/projects/${projectId}/tasks/${taskId}/attachments/${attachmentId}`);
155
+ }
156
+ }
157
+ //# sourceMappingURL=views-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views-client.js","sourceRoot":"","sources":["../../src/api/views-client.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACtB,MAAM,CAAa;IAE3B,YAAY,MAAkB;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAEO,KA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O,QAAQ,CAAC;QACjB,CAAC;QACD,OAAO,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,wBAAwB,CAC7B,SAAiB,EACjB,MAAc,EACd,YAAoB;QAEpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAC9B,oBAAoB,SAAS,UAAU,MAAM,gBAAgB,YAAY,eAAe,CACxF,CAAC;QACF,OAAO,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,oBAAoB,CACzB,SAAiB,EACjB,MAAc,EACd,YAAoB;QAEpB,MAAM,IAAI,CAAC,MAAM,CAChB,oBAAoB,SAAS,UAAU,MAAM,gBAAgB,YAAY,EAAE,CAC3E,CAAC;IACH,CAAC;CACD"}
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/index.js ADDED
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { createServer } from "./server.js";
5
+ const require = createRequire(import.meta.url);
6
+ /**
7
+ * Main entry point for the Paca MCP server.
8
+ * Initializes the API clients and starts the MCP server.
9
+ */
10
+ async function main() {
11
+ // Handle --version flag
12
+ if (process.argv.includes("--version") || process.argv.includes("-v")) {
13
+ const { version } = require("../package.json");
14
+ console.log(version);
15
+ process.exit(0);
16
+ }
17
+ // Get configuration from environment variables
18
+ const apiKey = process.env.PACA_API_KEY;
19
+ const baseURL = process.env.PACA_API_URL || "http://localhost:8080";
20
+ // Validate required configuration
21
+ if (!apiKey) {
22
+ console.error("PACA_API_KEY environment variable is required. Please set it to your Paca API key.");
23
+ console.error("\nExample:");
24
+ console.error(" export PACA_API_KEY='your-api-key-here'");
25
+ console.error(" export PACA_API_URL='http://localhost:8080'");
26
+ process.exit(1);
27
+ }
28
+ // Create configuration object
29
+ const config = { apiKey, baseURL };
30
+ // Create and configure MCP server
31
+ const server = createServer(config);
32
+ // Connect to stdio transport
33
+ const transport = new StdioServerTransport();
34
+ await server.connect(transport);
35
+ }
36
+ // Handle errors and exit gracefully
37
+ main().catch((error) => {
38
+ console.error("Server error:", error);
39
+ process.exit(1);
40
+ });
41
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C;;;GAGG;AACH,KAAK,UAAU,IAAI;IAClB,wBAAwB;IACxB,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACvE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,+CAA+C;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IACxC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,uBAAuB,CAAC;IAEpE,kCAAkC;IAClC,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CACZ,oFAAoF,CACpF,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC3D,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,8BAA8B;IAC9B,MAAM,MAAM,GAAe,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAE/C,kCAAkC;IAClC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,6BAA6B;IAC7B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAED,oCAAoC;AACpC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACtB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@paca-ai/paca-mcp",
3
+ "version": "0.1.0-rc.6",
4
+ "description": "Paca MCP server - Complete API access for AI-powered project management",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "registry": "https://registry.npmjs.org",
8
+ "access": "public"
9
+ },
10
+ "bin": {
11
+ "paca": "./index.js"
12
+ },
13
+ "dependencies": {
14
+ "@blocknote/core": "^0.48.1",
15
+ "@modelcontextprotocol/sdk": "0.6.0",
16
+ "jsdom": "^29.0.2",
17
+ "rehype-stringify": "^10.0.1",
18
+ "remark-parse": "^11.0.0",
19
+ "remark-rehype": "^11.1.2",
20
+ "unified": "^11.0.5"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/Paca-AI/paca.git",
25
+ "directory": "apps/mcp"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/Paca-AI/paca/issues"
29
+ },
30
+ "license": "Apache-2.0",
31
+ "keywords": [
32
+ "mcp",
33
+ "model-context-protocol",
34
+ "paca",
35
+ "project-management",
36
+ "ai",
37
+ "scrum",
38
+ "agile"
39
+ ]
40
+ }
package/server.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import type { PacaConfig } from "./types/index.js";
3
+ /**
4
+ * Creates and configures the Paca MCP server.
5
+ * @param config - Paca configuration
6
+ * @returns Configured MCP server
7
+ */
8
+ export declare function createServer(config: PacaConfig): Server;
9
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAcnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA2CvD"}
package/server.js ADDED
@@ -0,0 +1,46 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
3
+ import { PacaAPIClient, PacaAPIDocClient, PacaAPIExtendedClient, PacaAPIGitHubClient, PacaAPITaskExtendedClient, PacaAPIViewsClient, } from "./api/index.js";
4
+ import { getAllTools, handleToolCall } from "./tools/index.js";
5
+ /**
6
+ * Creates and configures the Paca MCP server.
7
+ * @param config - Paca configuration
8
+ * @returns Configured MCP server
9
+ */
10
+ export function createServer(config) {
11
+ // Initialize all API clients
12
+ const apiClient = new PacaAPIClient(config);
13
+ const extendedClient = new PacaAPIExtendedClient(config);
14
+ const viewsClient = new PacaAPIViewsClient(config);
15
+ const taskExtendedClient = new PacaAPITaskExtendedClient(config);
16
+ const docClient = new PacaAPIDocClient(config);
17
+ const githubClient = new PacaAPIGitHubClient(config);
18
+ const clients = {
19
+ apiClient,
20
+ extendedClient,
21
+ viewsClient,
22
+ taskExtendedClient,
23
+ docClient,
24
+ githubClient,
25
+ };
26
+ const server = new Server({
27
+ name: "paca",
28
+ version: "0.1.0",
29
+ }, {
30
+ capabilities: {
31
+ tools: {},
32
+ },
33
+ });
34
+ // Handler for listing available tools
35
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
36
+ return {
37
+ tools: getAllTools(),
38
+ };
39
+ });
40
+ // Handler for executing tool calls
41
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
42
+ return handleToolCall(request, clients);
43
+ });
44
+ return server;
45
+ }
46
+ //# sourceMappingURL=server.js.map
package/server.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACN,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG/D;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC9C,6BAA6B;IAC7B,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,cAAc,GAAG,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,kBAAkB,GAAG,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,YAAY,GAAG,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAErD,MAAM,OAAO,GAAG;QACf,SAAS;QACT,cAAc;QACd,WAAW;QACX,kBAAkB;QAClB,SAAS;QACT,YAAY;KACZ,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,MAAM,CACxB;QACC,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO;KAChB,EACD;QACC,YAAY,EAAE;YACb,KAAK,EAAE,EAAE;SACT;KACD,CACD,CAAC;IAEF,sCAAsC;IACtC,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QAC3D,OAAO;YACN,KAAK,EAAE,WAAW,EAAE;SACpB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,mCAAmC;IACnC,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACjE,OAAO,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ import type { PacaAPITaskExtendedClient, PacaAPIViewsClient } from "../api/index.js";
3
+ /**
4
+ * Returns all attachment-related MCP tools.
5
+ */
6
+ export declare function getAttachmentTools(): Tool[];
7
+ /**
8
+ * Returns all BDD scenario-related MCP tools.
9
+ */
10
+ export declare function getBDDScenarioTools(): Tool[];
11
+ /**
12
+ * Handles attachment and BDD scenario tool calls.
13
+ */
14
+ export declare function handleAttachmentTool(toolName: string, args: any, viewsClient: PacaAPIViewsClient, taskClient: PacaAPITaskExtendedClient): Promise<any>;
15
+ //# sourceMappingURL=attachment-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-tools.d.ts","sourceRoot":"","sources":["../../src/tools/attachment-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D,OAAO,KAAK,EACX,yBAAyB,EACzB,kBAAkB,EAClB,MAAM,iBAAiB,CAAC;AA0DzB;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,EAAE,CAiE3C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,EAAE,CA2I5C;AA2BD;;GAEG;AACH,wBAAsB,oBAAoB,CACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,kBAAkB,EAC/B,UAAU,EAAE,yBAAyB,GACnC,OAAO,CAAC,GAAG,CAAC,CA+Id"}