@brxce/mcp-server 1.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 (106) hide show
  1. package/README.md +220 -0
  2. package/dist/config/environment.d.ts +8 -0
  3. package/dist/config/environment.d.ts.map +1 -0
  4. package/dist/config/environment.js +16 -0
  5. package/dist/config/environment.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +167 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/prompts/worknode-prompts.d.ts +7 -0
  11. package/dist/prompts/worknode-prompts.d.ts.map +1 -0
  12. package/dist/prompts/worknode-prompts.js +369 -0
  13. package/dist/prompts/worknode-prompts.js.map +1 -0
  14. package/dist/prompts/workspace-context-prompt.d.ts +4 -0
  15. package/dist/prompts/workspace-context-prompt.d.ts.map +1 -0
  16. package/dist/prompts/workspace-context-prompt.js +101 -0
  17. package/dist/prompts/workspace-context-prompt.js.map +1 -0
  18. package/dist/resources/user-resource.d.ts +4 -0
  19. package/dist/resources/user-resource.d.ts.map +1 -0
  20. package/dist/resources/user-resource.js +40 -0
  21. package/dist/resources/user-resource.js.map +1 -0
  22. package/dist/resources/workspace-members-resource.d.ts +4 -0
  23. package/dist/resources/workspace-members-resource.d.ts.map +1 -0
  24. package/dist/resources/workspace-members-resource.js +39 -0
  25. package/dist/resources/workspace-members-resource.js.map +1 -0
  26. package/dist/resources/workspace-resource.d.ts +4 -0
  27. package/dist/resources/workspace-resource.d.ts.map +1 -0
  28. package/dist/resources/workspace-resource.js +27 -0
  29. package/dist/resources/workspace-resource.js.map +1 -0
  30. package/dist/services/api-client.d.ts +17 -0
  31. package/dist/services/api-client.d.ts.map +1 -0
  32. package/dist/services/api-client.js +118 -0
  33. package/dist/services/api-client.js.map +1 -0
  34. package/dist/tools/meeting-agenda-tool.d.ts +7 -0
  35. package/dist/tools/meeting-agenda-tool.d.ts.map +1 -0
  36. package/dist/tools/meeting-agenda-tool.js +452 -0
  37. package/dist/tools/meeting-agenda-tool.js.map +1 -0
  38. package/dist/tools/meeting-create-tool.d.ts +8 -0
  39. package/dist/tools/meeting-create-tool.d.ts.map +1 -0
  40. package/dist/tools/meeting-create-tool.js +309 -0
  41. package/dist/tools/meeting-create-tool.js.map +1 -0
  42. package/dist/tools/meeting-decisions-tool.d.ts +7 -0
  43. package/dist/tools/meeting-decisions-tool.d.ts.map +1 -0
  44. package/dist/tools/meeting-decisions-tool.js +431 -0
  45. package/dist/tools/meeting-decisions-tool.js.map +1 -0
  46. package/dist/tools/meeting-list-tool.d.ts +7 -0
  47. package/dist/tools/meeting-list-tool.d.ts.map +1 -0
  48. package/dist/tools/meeting-list-tool.js +305 -0
  49. package/dist/tools/meeting-list-tool.js.map +1 -0
  50. package/dist/tools/meeting-notes-tool.d.ts +7 -0
  51. package/dist/tools/meeting-notes-tool.d.ts.map +1 -0
  52. package/dist/tools/meeting-notes-tool.js +318 -0
  53. package/dist/tools/meeting-notes-tool.js.map +1 -0
  54. package/dist/tools/meeting-update-tool.d.ts +7 -0
  55. package/dist/tools/meeting-update-tool.d.ts.map +1 -0
  56. package/dist/tools/meeting-update-tool.js +310 -0
  57. package/dist/tools/meeting-update-tool.js.map +1 -0
  58. package/dist/tools/tag-category-tool.d.ts +4 -0
  59. package/dist/tools/tag-category-tool.d.ts.map +1 -0
  60. package/dist/tools/tag-category-tool.js +293 -0
  61. package/dist/tools/tag-category-tool.js.map +1 -0
  62. package/dist/tools/tag-search-tool.d.ts +4 -0
  63. package/dist/tools/tag-search-tool.d.ts.map +1 -0
  64. package/dist/tools/tag-search-tool.js +358 -0
  65. package/dist/tools/tag-search-tool.js.map +1 -0
  66. package/dist/tools/tag-tool.d.ts +4 -0
  67. package/dist/tools/tag-tool.d.ts.map +1 -0
  68. package/dist/tools/tag-tool.js +450 -0
  69. package/dist/tools/tag-tool.js.map +1 -0
  70. package/dist/tools/worknode-archive-tool.d.ts +7 -0
  71. package/dist/tools/worknode-archive-tool.d.ts.map +1 -0
  72. package/dist/tools/worknode-archive-tool.js +163 -0
  73. package/dist/tools/worknode-archive-tool.js.map +1 -0
  74. package/dist/tools/worknode-create-tool.d.ts +4 -0
  75. package/dist/tools/worknode-create-tool.d.ts.map +1 -0
  76. package/dist/tools/worknode-create-tool.js +382 -0
  77. package/dist/tools/worknode-create-tool.js.map +1 -0
  78. package/dist/tools/worknode-my-work-tool.d.ts +8 -0
  79. package/dist/tools/worknode-my-work-tool.d.ts.map +1 -0
  80. package/dist/tools/worknode-my-work-tool.js +302 -0
  81. package/dist/tools/worknode-my-work-tool.js.map +1 -0
  82. package/dist/tools/worknode-search-tool.d.ts +4 -0
  83. package/dist/tools/worknode-search-tool.d.ts.map +1 -0
  84. package/dist/tools/worknode-search-tool.js +289 -0
  85. package/dist/tools/worknode-search-tool.js.map +1 -0
  86. package/dist/tools/worknode-subtree-tool.d.ts +4 -0
  87. package/dist/tools/worknode-subtree-tool.d.ts.map +1 -0
  88. package/dist/tools/worknode-subtree-tool.js +175 -0
  89. package/dist/tools/worknode-subtree-tool.js.map +1 -0
  90. package/dist/tools/worknode-tag-tool.d.ts +4 -0
  91. package/dist/tools/worknode-tag-tool.d.ts.map +1 -0
  92. package/dist/tools/worknode-tag-tool.js +353 -0
  93. package/dist/tools/worknode-tag-tool.js.map +1 -0
  94. package/dist/tools/worknode-update-tool.d.ts +4 -0
  95. package/dist/tools/worknode-update-tool.d.ts.map +1 -0
  96. package/dist/tools/worknode-update-tool.js +409 -0
  97. package/dist/tools/worknode-update-tool.js.map +1 -0
  98. package/dist/tools/workspace-inbox-tool.d.ts +8 -0
  99. package/dist/tools/workspace-inbox-tool.d.ts.map +1 -0
  100. package/dist/tools/workspace-inbox-tool.js +210 -0
  101. package/dist/tools/workspace-inbox-tool.js.map +1 -0
  102. package/dist/tools/workspace-tree-tool.d.ts +4 -0
  103. package/dist/tools/workspace-tree-tool.d.ts.map +1 -0
  104. package/dist/tools/workspace-tree-tool.js +419 -0
  105. package/dist/tools/workspace-tree-tool.js.map +1 -0
  106. package/package.json +61 -0
@@ -0,0 +1,409 @@
1
+ import { z } from 'zod';
2
+ const WorknodeTypeSchema = z.enum(['goal', 'project', 'subproject', 'task', 'subtask']);
3
+ const WorkNodeStatusSchema = z.enum(['backlog', 'not_started', 'in_progress', 'in_review', 'completed', 'cancelled']);
4
+ const WorkNodePrioritySchema = z.enum(['critical', 'urgent', 'high', 'medium', 'low']);
5
+ const UpdateWorknodeChangesSchema = z.object({
6
+ title: z.string().min(1).optional().describe('New title'),
7
+ description: z.string().nullable().optional().describe('New description (null to clear)'),
8
+ status: WorkNodeStatusSchema.optional().describe('New status'),
9
+ priority: WorkNodePrioritySchema.optional().describe('New priority'),
10
+ parentNodeId: z.number().nullable().optional().describe('New parent ID (null to remove parent)'),
11
+ nodeType: WorknodeTypeSchema.optional().describe('New node type'),
12
+ startDate: z.string().nullable().optional().describe('New start date ISO 8601 (null to clear)'),
13
+ dueDate: z.string().nullable().optional().describe('New due date ISO 8601 (null to clear)'),
14
+ tags: z.array(z.string()).optional().describe('New tags array'),
15
+ assignee: z.array(z.string()).optional().describe('New assignee list'),
16
+ progress: z.number().min(0).max(100).optional().describe('New progress (0-100)')
17
+ });
18
+ const UpdateWorknodeSchema = z.object({
19
+ nodeId: z.number().describe('ID of WorkNode to update'),
20
+ changes: UpdateWorknodeChangesSchema.describe('Changes to apply'),
21
+ cascade: z.boolean().optional().describe('If true, complete all descendants when status changes to completed')
22
+ });
23
+ const BatchUpdateRequestSchema = z.object({
24
+ updates: z.array(UpdateWorknodeSchema).min(1).describe('Array of update operations'),
25
+ preview: z.boolean().optional().default(true).describe('If true, validate but do not update (dry run). ALWAYS use preview: true first!')
26
+ });
27
+ export function registerWorknodeUpdateTool(server, apiClient) {
28
+ server.registerTool('brxce_update_worknodes', {
29
+ description: `Update one or more WorkNodes in BRXCE with **MANDATORY preview-confirm workflow**.
30
+
31
+ ⚠️ **CRITICAL: WorkNode Verification Required**
32
+ Before calling this tool, you MUST:
33
+ 1. Use \`brxce_workspace_overview\` or \`brxce_my_work\` to find the node ID
34
+ 2. NEVER use arbitrary or guessed nodeId values
35
+ 3. Verify the node exists and user has permission to modify it
36
+ 4. For batch updates, verify ALL nodeIds before proceeding
37
+
38
+ **Example Workflow:**
39
+ \`\`\`
40
+ User: "Mark the Backend Development task as completed"
41
+ LLM:
42
+ 1. Calls brxce_workspace_overview to find "Backend Development"
43
+ 2. Finds task with ID 3536
44
+ 3. Calls brxce_update_worknodes with preview: true
45
+ 4. Shows preview to user
46
+ 5. If confirmed, calls again with preview: false
47
+ \`\`\`
48
+
49
+ 🔒 **CRITICAL: Preview-First Policy**
50
+ This tool REQUIRES a two-step workflow to prevent accidental changes:
51
+
52
+ 1️⃣ **PREVIEW** (preview: true) - ALWAYS call this first
53
+ - Validates all proposed changes
54
+ - Shows current vs. proposed values
55
+ - Identifies potential issues (hierarchy violations, circular references, etc.)
56
+ - Calculates impact on descendant nodes
57
+ - Returns warnings and errors
58
+
59
+ 2️⃣ **CONFIRM** (preview: false) - Only after user confirms preview
60
+ - Actually applies the changes
61
+ - Returns updated WorkNodes
62
+ - Triggers notifications and realtime updates
63
+
64
+ **Supported Changes:**
65
+ - \`title\`: Change node title
66
+ - \`description\`: Add/modify/clear description
67
+ - \`status\`: Change status (backlog, not_started, in_progress, in_review, completed, cancelled)
68
+ - \`priority\`: Change priority (critical, urgent, high, medium, low)
69
+ - \`parentNodeId\`: Move to different parent (null to remove parent)
70
+ - \`nodeType\`: Change node type (validates hierarchy)
71
+ - \`startDate\`, \`dueDate\`: Update dates (null to clear)
72
+ - \`tags\`: Update tags array
73
+ - \`assignee\`: Update assignee list
74
+ - \`progress\`: Update progress (0-100)
75
+ - \`cascade\`: If true, complete all descendants when status changes to completed
76
+
77
+ **Cascading Completion:**
78
+ When completing a parent node with incomplete children, you can:
79
+ 1. **Without cascade**: Complete only the parent (children remain incomplete) - shows warning
80
+ 2. **With cascade=true**: Complete parent AND all descendants automatically
81
+
82
+ Example:
83
+ \`\`\`json
84
+ {
85
+ "updates": [{
86
+ "nodeId": 100,
87
+ "changes": { "status": "completed" },
88
+ "cascade": true // Complete entire subtree
89
+ }],
90
+ "preview": true
91
+ }
92
+ \`\`\`
93
+
94
+ **Preview Mode Validation:**
95
+ - Permission to modify node
96
+ - Hierarchy rules when changing parent/type
97
+ - Circular reference detection
98
+ - Date validity (start < due)
99
+ - Progress bounds (0-100)
100
+ - Impact on descendant nodes
101
+
102
+ **Example Workflow:**
103
+
104
+ User: "Change WorkNode #852 status to completed"
105
+
106
+ Step 1 - Preview:
107
+ \`\`\`json
108
+ {
109
+ "updates": [{
110
+ "nodeId": 852,
111
+ "changes": {
112
+ "status": "completed"
113
+ }
114
+ }],
115
+ "preview": true
116
+ }
117
+ \`\`\`
118
+
119
+ LLM: "I'll preview the changes first:
120
+ - Current status: in_progress
121
+ - Proposed status: completed
122
+ - No warnings or errors
123
+ - 0 descendant nodes affected
124
+
125
+ Would you like me to proceed with this update?"
126
+
127
+ User: "Yes"
128
+
129
+ Step 2 - Confirm:
130
+ \`\`\`json
131
+ {
132
+ "updates": [{
133
+ "nodeId": 852,
134
+ "changes": {
135
+ "status": "completed"
136
+ }
137
+ }],
138
+ "preview": false
139
+ }
140
+ \`\`\`
141
+
142
+ **Complex Example - Moving to Different Parent:**
143
+
144
+ \`\`\`json
145
+ {
146
+ "updates": [{
147
+ "nodeId": 100,
148
+ "changes": {
149
+ "parentNodeId": 200,
150
+ "priority": "high"
151
+ }
152
+ }],
153
+ "preview": true
154
+ }
155
+ \`\`\`
156
+
157
+ Preview might show:
158
+ - Hierarchy validation: ✅ Task can be placed under Project
159
+ - 15 descendant nodes will be affected
160
+ - Warning: Parent is in a different space
161
+
162
+ **Batch Updates:**
163
+
164
+ \`\`\`json
165
+ {
166
+ "updates": [
167
+ {
168
+ "nodeId": 100,
169
+ "changes": { "status": "in_progress", "priority": "high" }
170
+ },
171
+ {
172
+ "nodeId": 101,
173
+ "changes": { "status": "in_progress", "priority": "high" }
174
+ },
175
+ {
176
+ "nodeId": 102,
177
+ "changes": { "status": "in_progress", "priority": "high" }
178
+ }
179
+ ],
180
+ "preview": true
181
+ }
182
+ \`\`\`
183
+
184
+ **Best Practices:**
185
+
186
+ 1. **ALWAYS preview first** - Never skip preview mode
187
+ 2. **Show preview results** - Present current vs. proposed changes to user
188
+ 3. **Wait for confirmation** - Don't auto-proceed even if preview is valid
189
+ 4. **Check warnings** - Inform user of any warnings from preview
190
+ 5. **Handle errors gracefully** - If preview fails, explain why and suggest fixes
191
+ 6. **Batch wisely** - Group related changes but don't mix unrelated updates
192
+
193
+ **Common Use Cases:**
194
+
195
+ - Update status: "Mark task #123 as completed"
196
+ - Change priority: "Set project #456 priority to urgent"
197
+ - Move to different parent: "Move task #789 under project #100"
198
+ - Update description: "Add description to goal #50"
199
+ - Assign to user: "Assign task #200 to john@company.com"
200
+ - Update dates: "Set due date for task #300 to 2025-12-31"
201
+ - Clear fields: Use \`null\` to clear description, dates, or parent
202
+
203
+ ⏰ **TIMEZONE HANDLING:**
204
+ When updating dates (dueDate, startDate), provide them in ISO 8601 format with timezone information.
205
+ The API will store dates in UTC, but the LLM should help users specify dates in their local timezone.
206
+
207
+ Example for Korea Time (UTC+9):
208
+ - User says: "Set due date to October 20" → LLM converts to: "2025-10-20T14:59:59.999Z" (end of day in KST)
209
+ - User says: "Start on October 15 at 2pm" → LLM converts to: "2025-10-15T05:00:00.000Z" (2pm KST)
210
+
211
+ When updating WorkNodes with dates:
212
+ 1. Check the current date/time from the <env> tag in the system prompt
213
+ 2. Identify the user's timezone (e.g., Asia/Seoul = UTC+9)
214
+ 3. Convert user's local dates to UTC for the API
215
+ 4. For date-only input (dueDate without time), use end of day (23:59:59) in user's timezone
216
+
217
+ ⚠️ **NEVER**:
218
+ - Skip preview mode
219
+ - Proceed without user confirmation
220
+ - Make changes that fail validation
221
+ - Ignore warnings about descendant impact`,
222
+ inputSchema: {
223
+ updates: z.array(UpdateWorknodeSchema).min(1).describe('Array of update operations'),
224
+ preview: z.boolean().optional().describe('If true, validate but do not update (dry run). ALWAYS use preview: true first!')
225
+ }
226
+ }, async (args) => {
227
+ const request = args;
228
+ // Default to preview mode for safety
229
+ const isPreview = request.preview !== false;
230
+ try {
231
+ const response = await apiClient.post('/mcp/worknodes/update', request);
232
+ if (!response.success) {
233
+ return {
234
+ content: [
235
+ {
236
+ type: 'text',
237
+ text: `Failed to update WorkNodes: ${response.message || 'Unknown error'}`,
238
+ },
239
+ ],
240
+ };
241
+ }
242
+ const { data } = response;
243
+ if (data.preview) {
244
+ // Preview mode response
245
+ let resultText = '## WorkNode Update Preview\n\n';
246
+ if (!data.previews || data.previews.length === 0) {
247
+ resultText += '⚠️ No preview data available.\n';
248
+ return {
249
+ content: [{ type: 'text', text: resultText }]
250
+ };
251
+ }
252
+ resultText += `**Summary**: ${data.summary.valid}/${data.summary.total} valid, ${data.summary.invalid}/${data.summary.total} invalid\n\n`;
253
+ for (let i = 0; i < data.previews.length; i++) {
254
+ const preview = data.previews[i];
255
+ if (!preview)
256
+ continue;
257
+ const status = preview.valid ? '✅ VALID' : '❌ INVALID';
258
+ const nodeTitle = preview.currentNode?.title || `Node #${preview.nodeId}`;
259
+ resultText += `### ${i + 1}. ${nodeTitle} (ID: ${preview.nodeId}) - ${status}\n\n`;
260
+ // Show current state
261
+ if (preview.currentNode) {
262
+ resultText += `**Current State:**\n`;
263
+ resultText += `- Type: ${preview.currentNode.nodeType}\n`;
264
+ resultText += `- Status: ${preview.currentNode.status}\n`;
265
+ resultText += `- Priority: ${preview.currentNode.priority}\n`;
266
+ if (preview.currentNode.parentNodeId) {
267
+ resultText += `- Parent ID: ${preview.currentNode.parentNodeId}\n`;
268
+ }
269
+ resultText += '\n';
270
+ }
271
+ // Show proposed changes
272
+ resultText += `**Proposed Changes:**\n`;
273
+ const changes = preview.proposedChanges;
274
+ for (const [key, value] of Object.entries(changes)) {
275
+ if (value === null) {
276
+ resultText += `- ${key}: (will be cleared)\n`;
277
+ }
278
+ else {
279
+ resultText += `- ${key}: ${value}\n`;
280
+ }
281
+ }
282
+ resultText += '\n';
283
+ // Show hierarchy validation if present
284
+ if (preview.hierarchyValidation) {
285
+ resultText += `**Hierarchy Validation:**\n`;
286
+ if (preview.hierarchyValidation.valid) {
287
+ resultText += `- ✅ Valid hierarchy\n`;
288
+ }
289
+ else {
290
+ resultText += `- ❌ Invalid hierarchy\n`;
291
+ }
292
+ if (preview.hierarchyValidation.warning) {
293
+ resultText += `- ⚠️ ${preview.hierarchyValidation.warning}\n`;
294
+ }
295
+ if (preview.hierarchyValidation.suggestion) {
296
+ resultText += `- 💡 ${preview.hierarchyValidation.suggestion}\n`;
297
+ }
298
+ resultText += '\n';
299
+ }
300
+ // Show impact
301
+ if (preview.affectedDescendants !== undefined) {
302
+ resultText += `**Impact:**\n`;
303
+ resultText += `- ${preview.affectedDescendants} descendant node(s) will be affected\n\n`;
304
+ }
305
+ // Show cascade preview if present
306
+ if (preview.cascadePreview) {
307
+ const cascadeInfo = preview.cascadePreview;
308
+ resultText += `**Cascade Preview:**\n`;
309
+ resultText += `- Will complete ${cascadeInfo.totalToComplete} node(s)\n`;
310
+ if (cascadeInfo.descendants && cascadeInfo.descendants.length > 0) {
311
+ resultText += `- Descendants to be completed:\n`;
312
+ cascadeInfo.descendants.forEach((desc) => {
313
+ resultText += ` - ${desc.title} (${desc.nodeType}, ID: ${desc.id})\n`;
314
+ });
315
+ }
316
+ resultText += '\n';
317
+ }
318
+ // Show warnings
319
+ if (preview.warnings && preview.warnings.length > 0) {
320
+ resultText += `**Warnings:**\n`;
321
+ preview.warnings.forEach(w => resultText += `- ⚠️ ${w}\n`);
322
+ resultText += '\n';
323
+ }
324
+ // Show errors
325
+ if (preview.errors && preview.errors.length > 0) {
326
+ resultText += `**Errors:**\n`;
327
+ preview.errors.forEach(e => resultText += `- ❌ ${e}\n`);
328
+ resultText += '\n';
329
+ }
330
+ }
331
+ if (data.summary.valid === data.summary.total) {
332
+ resultText += '\n✅ **All updates are valid and ready to apply!**\n';
333
+ resultText += '🔒 **To proceed, call this tool again with `preview: false`**\n';
334
+ }
335
+ else {
336
+ resultText += '\n⚠️ **Some updates have validation errors.**\n';
337
+ resultText += 'Please fix the errors before proceeding.\n';
338
+ }
339
+ return {
340
+ content: [
341
+ {
342
+ type: 'text',
343
+ text: resultText,
344
+ },
345
+ ],
346
+ };
347
+ }
348
+ else {
349
+ // Update mode response
350
+ let resultText = '## WorkNode Update Result\n\n';
351
+ resultText += `**Updated**: ${data.summary.updated}/${data.summary.total}\n`;
352
+ if (data.summary.failed && data.summary.failed > 0) {
353
+ resultText += `**Failed**: ${data.summary.failed}/${data.summary.total}\n`;
354
+ }
355
+ resultText += '\n';
356
+ if (data.updated && data.updated.length > 0) {
357
+ resultText += '### ✅ Successfully Updated:\n\n';
358
+ data.updated.forEach((node, i) => {
359
+ resultText += `${i + 1}. **${node.title}** (${node.nodeType}, ID: ${node.id})\n`;
360
+ resultText += ` - Status: ${node.status}\n`;
361
+ resultText += ` - Priority: ${node.priority}\n`;
362
+ if (node.parentNodeId) {
363
+ resultText += ` - Parent ID: ${node.parentNodeId}\n`;
364
+ }
365
+ if (node.description) {
366
+ resultText += ` - Description: ${node.description.substring(0, 100)}${node.description.length > 100 ? '...' : ''}\n`;
367
+ }
368
+ // Show cascade completion info if present
369
+ if (node.cascadeCompleted) {
370
+ resultText += ` - 🌊 Cascade: Completed ${node.cascadeCompleted.completedCount} node(s)\n`;
371
+ resultText += ` - Completed IDs: ${node.cascadeCompleted.completedNodeIds.slice(0, 10).join(', ')}${node.cascadeCompleted.completedNodeIds.length > 10 ? '...' : ''}\n`;
372
+ }
373
+ // Show warnings if present
374
+ if (node.warnings && node.warnings.length > 0) {
375
+ resultText += ` - ⚠️ Warnings: ${node.warnings.join(', ')}\n`;
376
+ }
377
+ resultText += '\n';
378
+ });
379
+ }
380
+ if (data.failed && data.failed.length > 0) {
381
+ resultText += '### ❌ Failed to Update:\n\n';
382
+ data.failed.forEach((failure) => {
383
+ resultText += `- Node #${failure.nodeId}: ${failure.error}\n`;
384
+ });
385
+ resultText += '\n';
386
+ }
387
+ return {
388
+ content: [
389
+ {
390
+ type: 'text',
391
+ text: resultText,
392
+ },
393
+ ],
394
+ };
395
+ }
396
+ }
397
+ catch (error) {
398
+ return {
399
+ content: [
400
+ {
401
+ type: 'text',
402
+ text: `Error updating WorkNodes: ${error.message || 'Unknown error'}`,
403
+ },
404
+ ],
405
+ };
406
+ }
407
+ });
408
+ }
409
+ //# sourceMappingURL=worknode-update-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worknode-update-tool.js","sourceRoot":"","sources":["../../src/tools/worknode-update-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AACxF,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AACtH,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvF,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IACzD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACzF,MAAM,EAAE,oBAAoB,CAAC,Q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C,CAAC,EAAE,IAAI,CAAC;wBAC5K,CAAC;wBAED,2BAA2B;wBAC3B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BAC9C,UAAU,IAAI,qBAAqB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;wBAClE,CAAC;wBAED,UAAU,IAAI,IAAI,CAAC;oBACrB,CAAC,CAAC,CAAC;gBACL,CAAC;gBAED,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1C,UAAU,IAAI,6BAA6B,CAAC;oBAC5C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAY,EAAE,EAAE;wBACnC,UAAU,IAAI,WAAW,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,KAAK,IAAI,CAAC;oBAChE,CAAC,CAAC,CAAC;oBACH,UAAU,IAAI,IAAI,CAAC;gBACrB,CAAC;gBAED,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,UAAU;yBACjB;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,6BAA6B,KAAK,CAAC,OAAO,IAAI,eAAe,EAAE;qBACtE;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { ApiClient } from '../services/api-client.js';
3
+ /**
4
+ * Register workspace inbox tool for LLM-invoked inbox queries
5
+ * Separates inbox items into My Inbox and Shared Inbox
6
+ */
7
+ export declare function registerWorkspaceInboxTool(server: McpServer, apiClient: ApiClient): void;
8
+ //# sourceMappingURL=workspace-inbox-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-inbox-tool.d.ts","sourceRoot":"","sources":["../../src/tools/workspace-inbox-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAsD3D;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,QAgNjF"}
@@ -0,0 +1,210 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Convert full WorkNode to minimal version for LLM consumption
4
+ */
5
+ function toMinimalWorkNode(node) {
6
+ return {
7
+ id: node.id,
8
+ title: node.title,
9
+ nodeType: node.nodeType,
10
+ status: node.status,
11
+ priority: node.priority || undefined,
12
+ assignee: node.assignee || [],
13
+ createdBy: node.createdBy,
14
+ workspaceId: node.workspaceId,
15
+ parentNodeId: node.parentNodeId,
16
+ dueDate: node.dueDate || null,
17
+ createdAt: node.createdAt,
18
+ };
19
+ }
20
+ /**
21
+ * Register workspace inbox tool for LLM-invoked inbox queries
22
+ * Separates inbox items into My Inbox and Shared Inbox
23
+ */
24
+ export function registerWorkspaceInboxTool(server, apiClient) {
25
+ server.registerTool('brxce_workspace_inbox', {
26
+ description: `Get workspace inbox items separated into My Inbox and Shared Inbox.
27
+
28
+ ⚠️ **CRITICAL: Workspace Verification Required**
29
+ Before calling this tool, you MUST:
30
+ 1. Read the \`user://me\` resource to get available workspaces
31
+ 2. Identify the correct workspaceId from the resource data
32
+ 3. If user doesn't specify workspace, use their default workspace from user://me
33
+ 4. If ambiguous, ask user to clarify which workspace to use
34
+ 5. NEVER assume or guess workspaceId values
35
+
36
+ **Example Workflow:**
37
+ \`\`\`
38
+ User: "Show me my inbox"
39
+ LLM:
40
+ 1. Reads user://me resource
41
+ 2. Finds default workspace: {id: 138, name: "BRXCE Development"}
42
+ 3. Calls brxce_workspace_inbox with workspaceId: 138
43
+ \`\`\`
44
+
45
+ **Inbox Categories:**
46
+
47
+ 1️⃣ **My Inbox** (Personal backlog items):
48
+ - Items I created with no assignees
49
+ - Items I created and assigned only to myself
50
+ - Quick captures waiting to be organized
51
+ - Personal todos not yet distributed
52
+
53
+ 2️⃣ **Shared Inbox** (Collaborative backlog items):
54
+ - Items created by others and assigned to me
55
+ - Items I created with multiple assignees
56
+ - Items I created and assigned only to others
57
+ - Delegated or collaborative work in backlog
58
+
59
+ **When to use this tool:**
60
+ The LLM should call this tool when the user asks:
61
+ - "What's in my inbox?" or "Show me my inbox"
62
+ - "What needs organizing?" or "Show backlog items"
63
+ - "What's in workspace [X] inbox?"
64
+ - "Show me shared inbox" or "What's assigned to me in backlog?"
65
+
66
+ **Key Features:**
67
+ - All items have status='backlog' (inbox state)
68
+ - Workspace-based filtering (uses default workspace if not specified)
69
+ - Separate counts for My vs Shared inbox
70
+ - Limited to most recent items (default 50 per category)
71
+
72
+ **Best Practices:**
73
+ 1. Call this when user mentions "inbox" or "backlog" items
74
+ 2. Use workspaceId if user specifies a workspace, otherwise use default
75
+ 3. Present My Inbox and Shared Inbox separately to user
76
+ 4. Help user understand difference between personal vs collaborative backlog
77
+
78
+ **Output Format:**
79
+ Returns JSON with:
80
+ - myInbox: Array of personal backlog items
81
+ - sharedInbox: Array of collaborative backlog items
82
+ - meta: Counts and workspace info
83
+
84
+ ⏰ **TIMEZONE HANDLING:**
85
+ ALL date/time fields in the response are in UTC (ISO 8601 format):
86
+ - completedAt, createdAt, updatedAt, dueDate, startDate
87
+
88
+ When presenting results to the user, you MUST convert UTC timestamps to the user's local timezone:
89
+ 1. Check the current date/time from the <env> tag in the system prompt
90
+ 2. Identify the user's timezone (e.g., Asia/Seoul = UTC+9)
91
+ 3. Convert ALL displayed timestamps from UTC to local time
92
+ 4. Format dates in a user-friendly way (e.g., "오후 5:16" not "08:16 UTC")
93
+
94
+ Example conversion (Korea Time, UTC+9):
95
+ - API returns: "completedAt": "2025-10-20T08:16:25.556Z" (UTC)
96
+ - Display to user: "완료: 2025-10-20 오후 5:16" (KST)
97
+
98
+ The LLM should format this into a clear summary showing both categories.`,
99
+ inputSchema: {
100
+ workspaceId: z
101
+ .number()
102
+ .optional()
103
+ .describe('Workspace ID to filter inbox items (uses default workspace if omitted)'),
104
+ limit: z
105
+ .number()
106
+ .optional()
107
+ .describe('Max items per inbox category (default: 50, max: 200)'),
108
+ },
109
+ }, async (args) => {
110
+ const { workspaceId, limit = 50 } = args;
111
+ try {
112
+ // Build query string
113
+ const params = new URLSearchParams();
114
+ if (workspaceId) {
115
+ params.append('workspaceId', workspaceId.toString());
116
+ }
117
+ if (limit) {
118
+ params.append('limit', limit.toString());
119
+ }
120
+ const queryString = params.toString();
121
+ const url = `/mcp/worknodes/inbox${queryString ? `?${queryString}` : ''}`;
122
+ const response = await apiClient.get(url);
123
+ if (!response.success || !response.data) {
124
+ return {
125
+ content: [
126
+ {
127
+ type: 'text',
128
+ text: JSON.stringify({
129
+ error: 'Failed to fetch inbox',
130
+ workspaceId,
131
+ }),
132
+ },
133
+ ],
134
+ isError: true,
135
+ };
136
+ }
137
+ const { data, meta } = response;
138
+ // Convert to minimal data for token efficiency
139
+ const minimalMyInbox = data.myInbox.map(toMinimalWorkNode);
140
+ const minimalSharedInbox = data.sharedInbox.map(toMinimalWorkNode);
141
+ // Return structured JSON for LLM to format
142
+ return {
143
+ content: [
144
+ {
145
+ type: 'text',
146
+ text: JSON.stringify({
147
+ summary: {
148
+ workspaceId: meta.workspaceId,
149
+ myInboxCount: meta.myInboxCount,
150
+ sharedInboxCount: meta.sharedInboxCount,
151
+ totalInbox: meta.total,
152
+ userId: meta.userId,
153
+ },
154
+ myInbox: minimalMyInbox,
155
+ sharedInbox: minimalSharedInbox,
156
+ }, null, 2),
157
+ },
158
+ ],
159
+ };
160
+ }
161
+ catch (error) {
162
+ // Enhanced error handling with workspace suggestions
163
+ let errorText = `❌ **Failed to fetch inbox**\n\n`;
164
+ // Check if it's a workspace-related error (403 or workspace not found)
165
+ const isWorkspaceError = error.message && (error.message.includes('403') ||
166
+ error.message.includes('workspace') ||
167
+ error.message.includes('not a member'));
168
+ if (isWorkspaceError && workspaceId) {
169
+ errorText += `**Issue**: Workspace ${workspaceId} is not accessible.\n\n`;
170
+ try {
171
+ // Fetch available workspaces from user://me resource
172
+ const userResponse = await apiClient.get('/mcp/user/me');
173
+ if (userResponse.success && userResponse.data?.workspaces) {
174
+ const { workspaces, user } = userResponse.data;
175
+ errorText += `**Your Available Workspaces:**\n\n`;
176
+ workspaces.forEach((ws, i) => {
177
+ const isDefault = ws.id === user?.defaultWorkspaceId;
178
+ errorText += `${i + 1}. **${ws.name}** (ID: ${ws.id})${isDefault ? ' 🌟 DEFAULT' : ''}\n`;
179
+ });
180
+ errorText += `\n💡 **Tip:** Use one of the workspace IDs above, or read the \`user://me\` resource to see all your workspaces.\n`;
181
+ }
182
+ else {
183
+ errorText += `💡 **Tip:** Read the \`user://me\` resource to see your available workspaces.\n`;
184
+ }
185
+ }
186
+ catch (fetchError) {
187
+ // Failed to fetch workspaces, provide basic tip
188
+ errorText += `💡 **Tip:** Read the \`user://me\` resource to see your available workspaces.\n`;
189
+ }
190
+ }
191
+ else {
192
+ // Generic error
193
+ errorText += `**Error**: ${error.message || 'Unknown error'}\n`;
194
+ if (!workspaceId) {
195
+ errorText += `\n💡 **Tip:** Specify a workspaceId or ensure you have a default workspace set.\n`;
196
+ }
197
+ }
198
+ return {
199
+ content: [
200
+ {
201
+ type: 'text',
202
+ text: errorText,
203
+ },
204
+ ],
205
+ isError: true,
206
+ };
207
+ }
208
+ });
209
+ }
210
+ //# sourceMappingURL=workspace-inbox-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-inbox-tool.js","sourceRoot":"","sources":["../../src/tools/workspace-inbox-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,E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AC5F,CAAC,CAAC,CAAC;wBAEH,SAAS,IAAI,oHAAoH,CAAC;oBACpI,CAAC;yBAAM,CAAC;wBACN,SAAS,IAAI,iFAAiF,CAAC;oBACjG,CAAC;gBACH,CAAC;gBAAC,OAAO,UAAU,EAAE,CAAC;oBACpB,gDAAgD;oBAChD,SAAS,IAAI,iFAAiF,CAAC;gBACjG,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,gBAAgB;gBAChB,SAAS,IAAI,cAAc,KAAK,CAAC,OAAO,IAAI,eAAe,IAAI,CAAC;gBAEhE,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,SAAS,IAAI,mFAAmF,CAAC;gBACnG,CAAC;YACH,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,SAAS;qBAChB;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { ApiClient } from '../services/api-client.js';
3
+ export declare function registerWorkspaceTreeTool(server: McpServer, apiClient: ApiClient): void;
4
+ //# sourceMappingURL=workspace-tree-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-tree-tool.d.ts","sourceRoot":"","sources":["../../src/tools/workspace-tree-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAiCtD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,QAwbhF"}