@paca-ai/paca-mcp 0.2.0 → 0.3.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 (50) hide show
  1. package/README.md +177 -1
  2. package/build/api/client.d.ts.map +1 -1
  3. package/build/api/client.js +3 -0
  4. package/build/api/client.js.map +1 -1
  5. package/build/api/doc-client.d.ts.map +1 -1
  6. package/build/api/doc-client.js +3 -0
  7. package/build/api/doc-client.js.map +1 -1
  8. package/build/api/extended-client.d.ts.map +1 -1
  9. package/build/api/extended-client.js +3 -0
  10. package/build/api/extended-client.js.map +1 -1
  11. package/build/api/task-extended-client.d.ts.map +1 -1
  12. package/build/api/task-extended-client.js +3 -0
  13. package/build/api/task-extended-client.js.map +1 -1
  14. package/build/api/views-client.d.ts.map +1 -1
  15. package/build/api/views-client.js +3 -0
  16. package/build/api/views-client.js.map +1 -1
  17. package/build/index.js +14 -1
  18. package/build/index.js.map +1 -1
  19. package/build/package.json +1 -1
  20. package/build/permissions.d.ts +15 -0
  21. package/build/permissions.d.ts.map +1 -0
  22. package/build/permissions.js +213 -0
  23. package/build/permissions.js.map +1 -0
  24. package/build/plugin-loader.d.ts.map +1 -1
  25. package/build/plugin-loader.js +21 -7
  26. package/build/plugin-loader.js.map +1 -1
  27. package/build/server.d.ts.map +1 -1
  28. package/build/server.js +50 -2
  29. package/build/server.js.map +1 -1
  30. package/build/tools/filesystem-doc-tools.d.ts +5 -0
  31. package/build/tools/filesystem-doc-tools.d.ts.map +1 -0
  32. package/build/tools/filesystem-doc-tools.js +417 -0
  33. package/build/tools/filesystem-doc-tools.js.map +1 -0
  34. package/build/tools/index.d.ts.map +1 -1
  35. package/build/tools/index.js +9 -20
  36. package/build/tools/index.js.map +1 -1
  37. package/build/tools/view-tools.d.ts.map +1 -1
  38. package/build/tools/view-tools.js +15 -3
  39. package/build/tools/view-tools.js.map +1 -1
  40. package/build/types/index.d.ts +18 -1
  41. package/build/types/index.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/build/tools/doc-github-tools.d.ts +0 -11
  44. package/build/tools/doc-github-tools.d.ts.map +0 -1
  45. package/build/tools/doc-github-tools.js +0 -267
  46. package/build/tools/doc-github-tools.js.map +0 -1
  47. package/build/tools/document-tools.d.ts +0 -16
  48. package/build/tools/document-tools.d.ts.map +0 -1
  49. package/build/tools/document-tools.js +0 -224
  50. package/build/tools/document-tools.js.map +0 -1
@@ -1,224 +0,0 @@
1
- import { z } from "zod";
2
- import { formatDocument, formatList } from "../utils/index.js";
3
- const ListDocumentsSchema = z.object({
4
- projectId: z.string(),
5
- });
6
- const GetDocumentSchema = z.object({
7
- projectId: z.string(),
8
- docId: z.string(),
9
- });
10
- const CreateDocumentSchema = z.object({
11
- projectId: z.string(),
12
- title: z.string(),
13
- content: z.string().optional(),
14
- folderId: z.string().optional(),
15
- });
16
- const UpdateDocumentSchema = z.object({
17
- projectId: z.string(),
18
- docId: z.string(),
19
- title: z.string().optional(),
20
- content: z.string().optional(),
21
- folderId: z.string().optional(),
22
- });
23
- const DeleteDocumentSchema = z.object({
24
- projectId: z.string(),
25
- docId: z.string(),
26
- });
27
- /**
28
- * Returns all document-related MCP tools.
29
- * @returns Array of document tools
30
- */
31
- export function getDocumentTools() {
32
- return [
33
- {
34
- name: "list_documents",
35
- description: "List all documents in a project",
36
- inputSchema: {
37
- type: "object",
38
- properties: {
39
- projectId: {
40
- type: "string",
41
- description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
42
- },
43
- },
44
- required: ["projectId"],
45
- },
46
- },
47
- {
48
- name: "get_document",
49
- description: "Get details of a specific document",
50
- inputSchema: {
51
- type: "object",
52
- properties: {
53
- projectId: {
54
- type: "string",
55
- description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
56
- },
57
- docId: {
58
- type: "string",
59
- description: "The technical UUID of the document (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_documents to get the document ID.",
60
- },
61
- },
62
- required: ["projectId", "docId"],
63
- },
64
- },
65
- {
66
- name: "create_document",
67
- description: "Create a new document",
68
- inputSchema: {
69
- type: "object",
70
- properties: {
71
- projectId: {
72
- type: "string",
73
- description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
74
- },
75
- title: {
76
- type: "string",
77
- description: "The title of the document",
78
- },
79
- content: {
80
- type: "string",
81
- description: "The content of the document in markdown format (will be converted to BlockNote format)",
82
- },
83
- folderId: {
84
- type: "string",
85
- description: "The technical UUID of the folder (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_doc_folders to get the folder ID.",
86
- },
87
- },
88
- required: ["projectId", "title"],
89
- },
90
- },
91
- {
92
- name: "update_document",
93
- description: "Update an existing document",
94
- inputSchema: {
95
- type: "object",
96
- properties: {
97
- projectId: {
98
- type: "string",
99
- description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
100
- },
101
- docId: {
102
- type: "string",
103
- description: "The technical UUID of the document (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_documents to get the document ID.",
104
- },
105
- title: {
106
- type: "string",
107
- description: "The new title of the document",
108
- },
109
- content: {
110
- type: "string",
111
- description: "The new content of the document in markdown format (will be converted to BlockNote format)",
112
- },
113
- folderId: {
114
- type: "string",
115
- description: "The technical UUID of the folder (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_doc_folders to get the folder ID.",
116
- },
117
- },
118
- required: ["projectId", "docId"],
119
- },
120
- },
121
- {
122
- name: "delete_document",
123
- description: "Delete a document",
124
- inputSchema: {
125
- type: "object",
126
- properties: {
127
- projectId: {
128
- type: "string",
129
- description: "The technical UUID of the project (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_projects to get the project ID. Do NOT use the project name.",
130
- },
131
- docId: {
132
- type: "string",
133
- description: "The technical UUID of the document (e.g., '550e8400-e29b-41d4-a716-446655440000'). Use list_documents to get the document ID.",
134
- },
135
- },
136
- required: ["projectId", "docId"],
137
- },
138
- },
139
- ];
140
- }
141
- /**
142
- * Handles document-related tool calls.
143
- * @param toolName - Name of the tool being called
144
- * @param args - Tool arguments
145
- * @param client - Paca API client instance
146
- * @returns Tool response
147
- */
148
- export async function handleDocumentTool(toolName, args, client) {
149
- switch (toolName) {
150
- case "list_documents": {
151
- const { projectId } = ListDocumentsSchema.parse(args);
152
- const documents = await client.listDocuments(projectId);
153
- const formatted = formatList(documents, formatDocument);
154
- return {
155
- content: [
156
- {
157
- type: "text",
158
- text: `Documents:\n\n${formatted}`,
159
- },
160
- ],
161
- };
162
- }
163
- case "get_document": {
164
- const { projectId, docId } = GetDocumentSchema.parse(args);
165
- const document = await client.getDocument(projectId, docId);
166
- return {
167
- content: [
168
- {
169
- type: "text",
170
- text: formatDocument(document),
171
- },
172
- ],
173
- };
174
- }
175
- case "create_document": {
176
- const { projectId, title, content, folderId } = CreateDocumentSchema.parse(args);
177
- const document = await client.createDocument({
178
- project_id: projectId,
179
- title,
180
- content,
181
- folder_id: folderId,
182
- });
183
- return {
184
- content: [
185
- {
186
- type: "text",
187
- text: `Document created successfully:\n\n${formatDocument(document)}`,
188
- },
189
- ],
190
- };
191
- }
192
- case "update_document": {
193
- const { projectId, docId, title, content, folderId } = UpdateDocumentSchema.parse(args);
194
- const document = await client.updateDocument(projectId, docId, {
195
- title,
196
- content,
197
- folder_id: folderId,
198
- });
199
- return {
200
- content: [
201
- {
202
- type: "text",
203
- text: `Document updated successfully:\n\n${formatDocument(document)}`,
204
- },
205
- ],
206
- };
207
- }
208
- case "delete_document": {
209
- const { projectId, docId } = DeleteDocumentSchema.parse(args);
210
- await client.deleteDocument(projectId, docId);
211
- return {
212
- content: [
213
- {
214
- type: "text",
215
- text: `Document ${docId} deleted successfully`,
216
- },
217
- ],
218
- };
219
- }
220
- default:
221
- throw new Error(`Unknown document tool: ${toolName}`);
222
- }
223
- }
224
- //# sourceMappingURL=document-tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-tools.js","sourceRoot":"","sources":["../../src/tools/document-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EA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