@brxce/mcp-server 1.1.4 → 1.1.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.
- package/dist/config/bot-tool-scope.d.ts +15 -0
- package/dist/config/bot-tool-scope.d.ts.map +1 -0
- package/dist/config/bot-tool-scope.js +74 -0
- package/dist/config/bot-tool-scope.js.map +1 -0
- package/dist/config/environment.d.ts +2 -0
- package/dist/config/environment.d.ts.map +1 -1
- package/dist/config/environment.js +3 -1
- package/dist/config/environment.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -63
- package/dist/index.js.map +1 -1
- package/dist/tools/bot-tool.d.ts +8 -0
- package/dist/tools/bot-tool.d.ts.map +1 -0
- package/dist/tools/bot-tool.js +191 -0
- package/dist/tools/bot-tool.js.map +1 -0
- package/dist/tools/worknode-detail-tool.d.ts +8 -0
- package/dist/tools/worknode-detail-tool.d.ts.map +1 -0
- package/dist/tools/worknode-detail-tool.js +227 -0
- package/dist/tools/worknode-detail-tool.js.map +1 -0
- package/dist/tools/worknode-subtree-tool.d.ts.map +1 -1
- package/dist/tools/worknode-subtree-tool.js +34 -12
- package/dist/tools/worknode-subtree-tool.js.map +1 -1
- package/dist/utils/bot-scoped-server.d.ts +13 -0
- package/dist/utils/bot-scoped-server.d.ts.map +1 -0
- package/dist/utils/bot-scoped-server.js +30 -0
- package/dist/utils/bot-scoped-server.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/param-parser.d.ts +47 -0
- package/dist/utils/param-parser.d.ts.map +1 -0
- package/dist/utils/param-parser.js +124 -0
- package/dist/utils/param-parser.js.map +1 -0
- package/package.json +12 -11
- package/dist/prompts/worknode-prompts.d.ts +0 -7
- package/dist/prompts/worknode-prompts.d.ts.map +0 -1
- package/dist/prompts/worknode-prompts.js +0 -398
- package/dist/prompts/worknode-prompts.js.map +0 -1
- package/dist/prompts/workspace-context-prompt.d.ts +0 -4
- package/dist/prompts/workspace-context-prompt.d.ts.map +0 -1
- package/dist/prompts/workspace-context-prompt.js +0 -102
- package/dist/prompts/workspace-context-prompt.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brxce/mcp-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for BRXCE workspace management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,6 +12,16 @@
|
|
|
12
12
|
"README.md",
|
|
13
13
|
"package.json"
|
|
14
14
|
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "tsx watch src/index.ts",
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"test": "vitest",
|
|
20
|
+
"test:coverage": "vitest run --coverage",
|
|
21
|
+
"lint": "eslint src/**/*.ts --fix",
|
|
22
|
+
"check-types": "tsc --noEmit",
|
|
23
|
+
"prepublishOnly": "pnpm build"
|
|
24
|
+
},
|
|
15
25
|
"keywords": [
|
|
16
26
|
"mcp",
|
|
17
27
|
"model-context-protocol",
|
|
@@ -49,14 +59,5 @@
|
|
|
49
59
|
"extends": [
|
|
50
60
|
"@repo/eslint-config/node"
|
|
51
61
|
]
|
|
52
|
-
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"dev": "tsx watch src/index.ts",
|
|
55
|
-
"build": "tsc",
|
|
56
|
-
"start": "node dist/index.js",
|
|
57
|
-
"test": "vitest",
|
|
58
|
-
"test:coverage": "vitest run --coverage",
|
|
59
|
-
"lint": "eslint src/**/*.ts --fix",
|
|
60
|
-
"check-types": "tsc --noEmit"
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { ApiClient } from '../services/api-client.js';
|
|
3
|
-
/**
|
|
4
|
-
* Register WorkNode-related prompts for common user workflows
|
|
5
|
-
*/
|
|
6
|
-
export declare function registerWorknodePrompts(server: McpServer, apiClient: ApiClient): void;
|
|
7
|
-
//# sourceMappingURL=worknode-prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worknode-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/worknode-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA0BtD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,QA0b9E"}
|
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { getErrorMessage } from '../utils/error-utils.js';
|
|
3
|
-
const normalizeWorkspaceId = (value) => {
|
|
4
|
-
if (typeof value === 'string') {
|
|
5
|
-
const trimmed = value.trim();
|
|
6
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
7
|
-
}
|
|
8
|
-
if (typeof value === 'number') {
|
|
9
|
-
return value.toString();
|
|
10
|
-
}
|
|
11
|
-
return undefined;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Register WorkNode-related prompts for common user workflows
|
|
15
|
-
*/
|
|
16
|
-
export function registerWorknodePrompts(server, apiClient) {
|
|
17
|
-
/**
|
|
18
|
-
* /my-active-work - Show work currently in progress
|
|
19
|
-
*/
|
|
20
|
-
server.registerPrompt('my-active-work', {
|
|
21
|
-
description: '현재 진행 중인 나의 작업 목록 (in_progress)',
|
|
22
|
-
argsSchema: {
|
|
23
|
-
workspaceId: z
|
|
24
|
-
.string()
|
|
25
|
-
.optional()
|
|
26
|
-
.describe('Workspace UUID to filter (optional - shows all workspaces if omitted)'),
|
|
27
|
-
},
|
|
28
|
-
}, async (args) => {
|
|
29
|
-
const workspaceId = normalizeWorkspaceId(args.workspaceId);
|
|
30
|
-
try {
|
|
31
|
-
// Build query string
|
|
32
|
-
const params = new URLSearchParams({
|
|
33
|
-
mode: 'active',
|
|
34
|
-
scope: 'both',
|
|
35
|
-
});
|
|
36
|
-
if (workspaceId) {
|
|
37
|
-
params.append('workspaceId', workspaceId);
|
|
38
|
-
}
|
|
39
|
-
const response = await apiClient.get(`/mcp/worknodes/my-work?${params.toString()}`);
|
|
40
|
-
if (!response.success || !response.data) {
|
|
41
|
-
return {
|
|
42
|
-
messages: [
|
|
43
|
-
{
|
|
44
|
-
role: 'user',
|
|
45
|
-
content: {
|
|
46
|
-
type: 'text',
|
|
47
|
-
text: '현재 진행 중인 작업을 가져오는 데 실패했습니다.',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const { data, meta } = response;
|
|
54
|
-
// Format WorkNodes into readable text
|
|
55
|
-
let workSummary = `# 🚀 현재 진행 중인 작업 (${meta.total}개)\n\n`;
|
|
56
|
-
if (meta.workspace) {
|
|
57
|
-
workSummary += `**Workspace UUID**: ${meta.workspace}\n\n`;
|
|
58
|
-
}
|
|
59
|
-
if (data.length === 0) {
|
|
60
|
-
workSummary += '진행 중인 작업이 없습니다. 새로운 작업을 시작하시겠습니까?\n';
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// Group by status
|
|
64
|
-
const byStatus = {};
|
|
65
|
-
data.forEach((node) => {
|
|
66
|
-
if (!byStatus[node.status]) {
|
|
67
|
-
byStatus[node.status] = [];
|
|
68
|
-
}
|
|
69
|
-
byStatus[node.status].push(node);
|
|
70
|
-
});
|
|
71
|
-
// Display by status
|
|
72
|
-
for (const [status, nodes] of Object.entries(byStatus)) {
|
|
73
|
-
const statusEmoji = status === 'in_progress' ? '⏳' : '👀';
|
|
74
|
-
workSummary += `## ${statusEmoji} ${status.toUpperCase()} (${nodes.length})\n\n`;
|
|
75
|
-
nodes.forEach(node => {
|
|
76
|
-
const priority = node.priority ? ` [${node.priority}]` : '';
|
|
77
|
-
const dueDate = node.dueDate ? ` 📅 ${new Date(node.dueDate).toLocaleDateString()}` : '';
|
|
78
|
-
const assignees = node.assignee && node.assignee.length > 0 ? ` 👤 ${node.assignee.length} assignee(s)` : '';
|
|
79
|
-
workSummary += `- **${node.title}**${priority}${dueDate}${assignees}\n`;
|
|
80
|
-
workSummary += ` - ID: #${node.id} | Type: ${node.nodeType} | Progress: ${node.progress}%\n`;
|
|
81
|
-
if (node.description) {
|
|
82
|
-
workSummary += ` - ${node.description}\n`;
|
|
83
|
-
}
|
|
84
|
-
workSummary += '\n';
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
messages: [
|
|
90
|
-
{
|
|
91
|
-
role: 'user',
|
|
92
|
-
content: {
|
|
93
|
-
type: 'text',
|
|
94
|
-
text: workSummary,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
return {
|
|
102
|
-
messages: [
|
|
103
|
-
{
|
|
104
|
-
role: 'user',
|
|
105
|
-
content: {
|
|
106
|
-
type: 'text',
|
|
107
|
-
text: `Error fetching active work: ${getErrorMessage(error)}`,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
/**
|
|
115
|
-
* /my-completed-work - Show completed work with time filter
|
|
116
|
-
*/
|
|
117
|
-
server.registerPrompt('my-completed-work', {
|
|
118
|
-
description: '완료한 나의 작업 목록 (시간 범위 필터 가능)',
|
|
119
|
-
argsSchema: {
|
|
120
|
-
since: z
|
|
121
|
-
.string()
|
|
122
|
-
.optional()
|
|
123
|
-
.describe('Time filter: today, yesterday, this-week, last-week, this-month, last-month (default: today)'),
|
|
124
|
-
workspaceId: z
|
|
125
|
-
.string()
|
|
126
|
-
.optional()
|
|
127
|
-
.describe('Workspace UUID to filter (optional)'),
|
|
128
|
-
},
|
|
129
|
-
}, async (args) => {
|
|
130
|
-
const since = args.since || 'today';
|
|
131
|
-
const workspaceId = normalizeWorkspaceId(args.workspaceId);
|
|
132
|
-
try {
|
|
133
|
-
const params = new URLSearchParams({
|
|
134
|
-
mode: 'completed',
|
|
135
|
-
scope: 'both',
|
|
136
|
-
completedSince: since,
|
|
137
|
-
});
|
|
138
|
-
if (workspaceId) {
|
|
139
|
-
params.append('workspaceId', workspaceId);
|
|
140
|
-
}
|
|
141
|
-
const response = await apiClient.get(`/mcp/worknodes/my-work?${params.toString()}`);
|
|
142
|
-
if (!response.success || !response.data) {
|
|
143
|
-
return {
|
|
144
|
-
messages: [
|
|
145
|
-
{
|
|
146
|
-
role: 'user',
|
|
147
|
-
content: {
|
|
148
|
-
type: 'text',
|
|
149
|
-
text: '완료한 작업을 가져오는 데 실패했습니다.',
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
const { data, meta } = response;
|
|
156
|
-
const timeLabel = {
|
|
157
|
-
'today': '오늘',
|
|
158
|
-
'yesterday': '어제',
|
|
159
|
-
'this-week': '이번 주',
|
|
160
|
-
'last-week': '지난 주',
|
|
161
|
-
'this-month': '이번 달',
|
|
162
|
-
'last-month': '지난 달',
|
|
163
|
-
}[since] || since;
|
|
164
|
-
let workSummary = `# ✅ ${timeLabel} 완료한 작업 (${meta.total}개)\n\n`;
|
|
165
|
-
if (data.length === 0) {
|
|
166
|
-
workSummary += `${timeLabel}에 완료한 작업이 없습니다.\n`;
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
data.forEach(node => {
|
|
170
|
-
const completedAt = node.completedAt ? new Date(node.completedAt).toLocaleString() : 'N/A';
|
|
171
|
-
const priority = node.priority ? ` [${node.priority}]` : '';
|
|
172
|
-
workSummary += `- **${node.title}**${priority}\n`;
|
|
173
|
-
workSummary += ` - ID: #${node.id} | Type: ${node.nodeType} | Completed: ${completedAt}\n`;
|
|
174
|
-
if (node.description) {
|
|
175
|
-
workSummary += ` - ${node.description}\n`;
|
|
176
|
-
}
|
|
177
|
-
workSummary += '\n';
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
messages: [
|
|
182
|
-
{
|
|
183
|
-
role: 'user',
|
|
184
|
-
content: {
|
|
185
|
-
type: 'text',
|
|
186
|
-
text: workSummary,
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
return {
|
|
194
|
-
messages: [
|
|
195
|
-
{
|
|
196
|
-
role: 'user',
|
|
197
|
-
content: {
|
|
198
|
-
type: 'text',
|
|
199
|
-
text: `Error fetching completed work: ${getErrorMessage(error)}`,
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
/**
|
|
207
|
-
* /my-urgent-tasks - Show urgent/due-soon tasks
|
|
208
|
-
*/
|
|
209
|
-
server.registerPrompt('my-urgent-tasks', {
|
|
210
|
-
description: '긴급하거나 곧 마감인 작업 목록 (critical/urgent 우선순위 또는 마감임박)',
|
|
211
|
-
argsSchema: {
|
|
212
|
-
dueWithin: z
|
|
213
|
-
.string()
|
|
214
|
-
.optional()
|
|
215
|
-
.describe('Due date filter: today, tomorrow, this-week, next-week (default: today)'),
|
|
216
|
-
workspaceId: z
|
|
217
|
-
.string()
|
|
218
|
-
.optional()
|
|
219
|
-
.describe('Workspace UUID to filter (optional)'),
|
|
220
|
-
},
|
|
221
|
-
}, async (args) => {
|
|
222
|
-
const dueWithin = args.dueWithin || 'today';
|
|
223
|
-
const workspaceId = normalizeWorkspaceId(args.workspaceId);
|
|
224
|
-
try {
|
|
225
|
-
const params = new URLSearchParams({
|
|
226
|
-
mode: 'urgent',
|
|
227
|
-
scope: 'both',
|
|
228
|
-
dueWithin,
|
|
229
|
-
});
|
|
230
|
-
if (workspaceId) {
|
|
231
|
-
params.append('workspaceId', workspaceId);
|
|
232
|
-
}
|
|
233
|
-
const response = await apiClient.get(`/mcp/worknodes/my-work?${params.toString()}`);
|
|
234
|
-
if (!response.success || !response.data) {
|
|
235
|
-
return {
|
|
236
|
-
messages: [
|
|
237
|
-
{
|
|
238
|
-
role: 'user',
|
|
239
|
-
content: {
|
|
240
|
-
type: 'text',
|
|
241
|
-
text: '긴급 작업을 가져오는 데 실패했습니다.',
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
],
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
const { data, meta } = response;
|
|
248
|
-
const dueLabel = {
|
|
249
|
-
'today': '오늘',
|
|
250
|
-
'tomorrow': '내일',
|
|
251
|
-
'this-week': '이번 주',
|
|
252
|
-
'next-week': '다음 주',
|
|
253
|
-
}[dueWithin] || dueWithin;
|
|
254
|
-
let workSummary = `# 🚨 긴급 작업 (${dueLabel} 마감 또는 high priority) - ${meta.total}개\n\n`;
|
|
255
|
-
if (data.length === 0) {
|
|
256
|
-
workSummary += `긴급한 작업이 없습니다. 잘하고 계시네요! 👍\n`;
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
// Sort by priority and due date
|
|
260
|
-
const sortedData = data.sort((a, b) => {
|
|
261
|
-
const priorityOrder = { critical: 0, urgent: 1, high: 2, medium: 3, low: 4 };
|
|
262
|
-
const aPriority = priorityOrder[a.priority] ?? 5;
|
|
263
|
-
const bPriority = priorityOrder[b.priority] ?? 5;
|
|
264
|
-
if (aPriority !== bPriority)
|
|
265
|
-
return aPriority - bPriority;
|
|
266
|
-
if (a.dueDate && b.dueDate) {
|
|
267
|
-
return new Date(a.dueDate).getTime() - new Date(b.dueDate).getTime();
|
|
268
|
-
}
|
|
269
|
-
return 0;
|
|
270
|
-
});
|
|
271
|
-
sortedData.forEach((node, index) => {
|
|
272
|
-
const priorityEmoji = {
|
|
273
|
-
critical: '🔥',
|
|
274
|
-
urgent: '⚡',
|
|
275
|
-
high: '🔴',
|
|
276
|
-
medium: '🟡',
|
|
277
|
-
low: '🟢',
|
|
278
|
-
};
|
|
279
|
-
const emoji = node.priority ? (priorityEmoji[node.priority] || '') : '';
|
|
280
|
-
const priority = node.priority ? `${emoji} [${node.priority}]` : '';
|
|
281
|
-
const dueDate = node.dueDate ? ` 📅 ${new Date(node.dueDate).toLocaleString()}` : '';
|
|
282
|
-
const status = node.status ? ` (${node.status})` : '';
|
|
283
|
-
workSummary += `${index + 1}. **${node.title}**${priority}${dueDate}${status}\n`;
|
|
284
|
-
workSummary += ` - ID: #${node.id} | Type: ${node.nodeType} | Progress: ${node.progress}%\n`;
|
|
285
|
-
if (node.description) {
|
|
286
|
-
workSummary += ` - ${node.description}\n`;
|
|
287
|
-
}
|
|
288
|
-
workSummary += '\n';
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
return {
|
|
292
|
-
messages: [
|
|
293
|
-
{
|
|
294
|
-
role: 'user',
|
|
295
|
-
content: {
|
|
296
|
-
type: 'text',
|
|
297
|
-
text: workSummary,
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
],
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
catch (error) {
|
|
304
|
-
return {
|
|
305
|
-
messages: [
|
|
306
|
-
{
|
|
307
|
-
role: 'user',
|
|
308
|
-
content: {
|
|
309
|
-
type: 'text',
|
|
310
|
-
text: `Error fetching urgent tasks: ${getErrorMessage(error)}`,
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
/**
|
|
318
|
-
* /my-inbox - Show inbox (backlog) items
|
|
319
|
-
*/
|
|
320
|
-
server.registerPrompt('my-inbox', {
|
|
321
|
-
description: '인박스(backlog) 항목 목록 - 아직 정리되지 않은 작업들',
|
|
322
|
-
argsSchema: {
|
|
323
|
-
workspaceId: z
|
|
324
|
-
.string()
|
|
325
|
-
.optional()
|
|
326
|
-
.describe('Workspace UUID to filter (optional)'),
|
|
327
|
-
},
|
|
328
|
-
}, async (args) => {
|
|
329
|
-
const workspaceId = normalizeWorkspaceId(args.workspaceId);
|
|
330
|
-
try {
|
|
331
|
-
const params = new URLSearchParams({
|
|
332
|
-
mode: 'inbox',
|
|
333
|
-
scope: 'both',
|
|
334
|
-
});
|
|
335
|
-
if (workspaceId) {
|
|
336
|
-
params.append('workspaceId', workspaceId);
|
|
337
|
-
}
|
|
338
|
-
const response = await apiClient.get(`/mcp/worknodes/my-work?${params.toString()}`);
|
|
339
|
-
if (!response.success || !response.data) {
|
|
340
|
-
return {
|
|
341
|
-
messages: [
|
|
342
|
-
{
|
|
343
|
-
role: 'user',
|
|
344
|
-
content: {
|
|
345
|
-
type: 'text',
|
|
346
|
-
text: '인박스 항목을 가져오는 데 실패했습니다.',
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
],
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
const { data, meta } = response;
|
|
353
|
-
let workSummary = `# 📥 인박스 (Backlog) - ${meta.total}개\n\n`;
|
|
354
|
-
workSummary += '*아직 정리되지 않은 작업들입니다. 적절한 프로젝트/목표에 할당하거나 시작 상태로 변경하세요.*\n\n';
|
|
355
|
-
if (data.length === 0) {
|
|
356
|
-
workSummary += `인박스가 비어있습니다. Inbox Zero 달성! 🎉\n`;
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
data.forEach((node, index) => {
|
|
360
|
-
const priority = node.priority ? ` [${node.priority}]` : '';
|
|
361
|
-
const createdAt = new Date(node.createdAt).toLocaleDateString();
|
|
362
|
-
workSummary += `${index + 1}. **${node.title}**${priority}\n`;
|
|
363
|
-
workSummary += ` - ID: #${node.id} | Type: ${node.nodeType} | Created: ${createdAt}\n`;
|
|
364
|
-
if (node.description) {
|
|
365
|
-
workSummary += ` - ${node.description}\n`;
|
|
366
|
-
}
|
|
367
|
-
workSummary += '\n';
|
|
368
|
-
});
|
|
369
|
-
workSummary += `\n💡 **제안**: 이 항목들을 적절한 프로젝트나 목표에 할당하거나, 불필요한 항목은 삭제하는 것이 좋습니다.\n`;
|
|
370
|
-
}
|
|
371
|
-
return {
|
|
372
|
-
messages: [
|
|
373
|
-
{
|
|
374
|
-
role: 'user',
|
|
375
|
-
content: {
|
|
376
|
-
type: 'text',
|
|
377
|
-
text: workSummary,
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
],
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
catch (error) {
|
|
384
|
-
return {
|
|
385
|
-
messages: [
|
|
386
|
-
{
|
|
387
|
-
role: 'user',
|
|
388
|
-
content: {
|
|
389
|
-
type: 'text',
|
|
390
|
-
text: `Error fetching inbox: ${getErrorMessage(error)}`,
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
],
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
//# sourceMappingURL=worknode-prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worknode-prompts.js","sourceRoot":"","sources":["../../src/prompts/worknode-prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAc1D,MAAM,oBAAoB,GAAG,CAAC,KAAc,EAAsB,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,C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AyB,eAAe,CAAC,KAAK,CAAC,EAAE;yBACxD;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { ApiClient } from '../services/api-client.js';
|
|
3
|
-
export declare function registerWorkspaceContextPrompt(server: McpServer, apiClient: ApiClient): void;
|
|
4
|
-
//# sourceMappingURL=workspace-context-prompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-context-prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/workspace-context-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,QA+GrF"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { getErrorMessage } from '../utils/error-utils.js';
|
|
3
|
-
export function registerWorkspaceContextPrompt(server, apiClient) {
|
|
4
|
-
server.registerPrompt('workspace-context', {
|
|
5
|
-
description: `Establish workspace context before performing workspace-specific operations.
|
|
6
|
-
|
|
7
|
-
**When to use this prompt:**
|
|
8
|
-
- At the start of any workspace-related task
|
|
9
|
-
- When user mentions workspace-specific operations without specifying workspace
|
|
10
|
-
- Before calling any tool that requires a workspace UUID
|
|
11
|
-
|
|
12
|
-
**This prompt will:**
|
|
13
|
-
1. Fetch all available workspaces for the authenticated user
|
|
14
|
-
2. Present them in a clear, selectable format
|
|
15
|
-
3. Return the selected workspace UUID and workspace details
|
|
16
|
-
4. Set up context for subsequent tool calls
|
|
17
|
-
|
|
18
|
-
**Output Format:**
|
|
19
|
-
Returns formatted workspace list with:
|
|
20
|
-
- Workspace UUID (for tool calls)
|
|
21
|
-
- Workspace name
|
|
22
|
-
- Member count
|
|
23
|
-
- User's role in each workspace
|
|
24
|
-
- Default workspace indicator`,
|
|
25
|
-
argsSchema: {
|
|
26
|
-
userIntent: z.string().optional().describe('User\'s original request to help with workspace selection')
|
|
27
|
-
}
|
|
28
|
-
}, async (args) => {
|
|
29
|
-
try {
|
|
30
|
-
// Fetch user with all workspaces
|
|
31
|
-
const response = await apiClient.get('/mcp/user/me');
|
|
32
|
-
if (!response.success || !response.data) {
|
|
33
|
-
return {
|
|
34
|
-
messages: [{
|
|
35
|
-
role: 'assistant',
|
|
36
|
-
content: {
|
|
37
|
-
type: 'text',
|
|
38
|
-
text: 'Failed to fetch workspace information. Please check your authentication.'
|
|
39
|
-
}
|
|
40
|
-
}]
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const { user, workspaces } = response.data;
|
|
44
|
-
if (!workspaces || workspaces.length === 0) {
|
|
45
|
-
return {
|
|
46
|
-
messages: [{
|
|
47
|
-
role: 'assistant',
|
|
48
|
-
content: {
|
|
49
|
-
type: 'text',
|
|
50
|
-
text: '⚠️ No workspaces found. You need to be a member of at least one workspace to continue.'
|
|
51
|
-
}
|
|
52
|
-
}]
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
// Format workspace list
|
|
56
|
-
let prompt = `# Available Workspaces for ${user.name || user.username}\n\n`;
|
|
57
|
-
prompt += `You have access to ${workspaces.length} workspace(s):\n\n`;
|
|
58
|
-
workspaces.forEach((ws, index) => {
|
|
59
|
-
const isDefault = ws.id === user.defaultWorkspaceId;
|
|
60
|
-
const role = ws.members.find((m) => m.user.id === user.id)?.role || 'member';
|
|
61
|
-
prompt += `${index + 1}. **${ws.name}** (UUID: ${ws.id})${isDefault ? ' 🌟 DEFAULT' : ''}\n`;
|
|
62
|
-
prompt += ` - Your role: ${role}\n`;
|
|
63
|
-
prompt += ` - Members: ${ws.members.length}\n`;
|
|
64
|
-
if (ws.description) {
|
|
65
|
-
prompt += ` - Description: ${ws.description}\n`;
|
|
66
|
-
}
|
|
67
|
-
prompt += `\n`;
|
|
68
|
-
});
|
|
69
|
-
prompt += `\n---\n\n`;
|
|
70
|
-
prompt += `**Next Steps:**\n`;
|
|
71
|
-
prompt += `1. Identify which workspace the user's request relates to\n`;
|
|
72
|
-
prompt += `2. If unclear, ask the user to select from the list above\n`;
|
|
73
|
-
prompt += `3. Use the selected workspace UUID in subsequent tool calls\n`;
|
|
74
|
-
prompt += `4. NEVER use arbitrary or guessed workspace UUIDs\n\n`;
|
|
75
|
-
if (args.userIntent) {
|
|
76
|
-
prompt += `**User's Original Request:** "${args.userIntent}"\n\n`;
|
|
77
|
-
prompt += `Based on this request, determine which workspace is most appropriate or ask the user to clarify.\n`;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
messages: [{
|
|
81
|
-
role: 'assistant',
|
|
82
|
-
content: {
|
|
83
|
-
type: 'text',
|
|
84
|
-
text: prompt
|
|
85
|
-
}
|
|
86
|
-
}]
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
return {
|
|
91
|
-
messages: [{
|
|
92
|
-
role: 'assistant',
|
|
93
|
-
content: {
|
|
94
|
-
type: 'text',
|
|
95
|
-
text: `Error fetching workspace context: ${getErrorMessage(error)}`
|
|
96
|
-
}
|
|
97
|
-
}]
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=workspace-context-prompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-context-prompt.js","sourceRoot":"","sources":["../../src/prompts/workspace-context-prompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,UAAU,8BAA8B,CAAC,MAAiB,EAAE,SA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