wolfpack-mcp 1.0.97 → 1.0.98
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/client.js +7 -0
- package/dist/index.js +127 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -240,6 +240,13 @@ export class WolfpackClient {
|
|
|
240
240
|
throw error;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
+
// Dependency methods (#2331)
|
|
244
|
+
async setWorkItemDependencies(workItemId, dependsOnRefIds, teamSlug) {
|
|
245
|
+
return this.api.put(this.withTeamSlug(`/work-items/${workItemId}/dependencies`, teamSlug), { dependsOnRefIds });
|
|
246
|
+
}
|
|
247
|
+
async getWorkItemDependencyGraph(workItemId, teamSlug) {
|
|
248
|
+
return this.api.get(this.withTeamSlug(`/work-items/${workItemId}/dependency-graph`, teamSlug));
|
|
249
|
+
}
|
|
243
250
|
// Review check methods
|
|
244
251
|
async listWorkItemChecks(filter, teamSlug) {
|
|
245
252
|
const params = new URLSearchParams();
|
package/dist/index.js
CHANGED
|
@@ -216,6 +216,29 @@ const SubmitWorkItemFormSchema = z.object({
|
|
|
216
216
|
.optional()
|
|
217
217
|
.describe('Project slug (required for multi-project users, use list_projects to get slugs)'),
|
|
218
218
|
});
|
|
219
|
+
// #2331 — reference numbers, accepted as numbers or as "#2322" the way agents
|
|
220
|
+
// write them, so an ordered plan can be transcribed without reformatting.
|
|
221
|
+
const dependsOnRefIds = () => z
|
|
222
|
+
.array(z.union([z.number(), z.string()]))
|
|
223
|
+
.transform((refs) => refs.map((ref) => Number(String(ref).replace(/^#/, ''))))
|
|
224
|
+
.refine((refs) => refs.every(Number.isInteger), {
|
|
225
|
+
message: 'depends_on must be work item reference numbers, e.g. [2322] or ["#2322"]',
|
|
226
|
+
});
|
|
227
|
+
const SetWorkItemDependenciesSchema = z.object({
|
|
228
|
+
work_item_id: refIdString().describe('The refId of the work item that follows the others'),
|
|
229
|
+
depends_on: dependsOnRefIds().describe('Reference numbers of the prerequisites. Replaces the whole set; pass [] to clear.'),
|
|
230
|
+
project_slug: z
|
|
231
|
+
.string()
|
|
232
|
+
.optional()
|
|
233
|
+
.describe('Project slug (required for multi-project users, use list_projects to get slugs)'),
|
|
234
|
+
});
|
|
235
|
+
const GetWorkItemDependencyGraphSchema = z.object({
|
|
236
|
+
work_item_id: refIdString().describe('The refId of the work item'),
|
|
237
|
+
project_slug: z
|
|
238
|
+
.string()
|
|
239
|
+
.optional()
|
|
240
|
+
.describe('Project slug (required for multi-project users, use list_projects to get slugs)'),
|
|
241
|
+
});
|
|
219
242
|
const WorkPoolMemberSchema = z.object({
|
|
220
243
|
work_pool: z.string().describe('Work pool id or name'),
|
|
221
244
|
user_id: z.string().describe('The user id to add or remove'),
|
|
@@ -369,6 +392,9 @@ const CreateWorkItemSchema = z.object({
|
|
|
369
392
|
.string()
|
|
370
393
|
.optional()
|
|
371
394
|
.describe('Link to a radar/initiative item. Accepts refId ("5" or "#r5") or UUID.'),
|
|
395
|
+
depends_on: dependsOnRefIds()
|
|
396
|
+
.optional()
|
|
397
|
+
.describe('Reference numbers of work items that must finish before this one starts'),
|
|
372
398
|
});
|
|
373
399
|
const CreateIssueSchema = z.object({
|
|
374
400
|
project_slug: z
|
|
@@ -1269,6 +1295,56 @@ class WolfpackMCPServer {
|
|
|
1269
1295
|
required: ['work_item_id', 'check_id', 'status'],
|
|
1270
1296
|
},
|
|
1271
1297
|
},
|
|
1298
|
+
{
|
|
1299
|
+
name: 'set_work_item_dependencies',
|
|
1300
|
+
description: 'Record which work items must finish before this one can start, so the board knows the order ' +
|
|
1301
|
+
'and the pickup gate enforces it. Use this when you file or plan a set of ordered items, instead ' +
|
|
1302
|
+
'of writing "Follows #2322" into a description — a description is prose nothing enforces. ' +
|
|
1303
|
+
'A bare #N is a WORK ITEM refId, and depends_on takes those reference numbers. ' +
|
|
1304
|
+
'REPLACES the whole set: pass every prerequisite you want the item to have, and [] to clear it. ' +
|
|
1305
|
+
'An item may not depend on itself, nor on anything that already depends on it — either would leave ' +
|
|
1306
|
+
'it permanently blocked, and both are refused with 400 naming the item. ' +
|
|
1307
|
+
'Requires the mcp:work_items:manage_dependencies permission, which is separate from ' +
|
|
1308
|
+
"mcp:work_items:update: updating your own item does not let you order other people's work. " +
|
|
1309
|
+
'Returns what the item now depends on, what follows it, and which prerequisites are still unfinished.',
|
|
1310
|
+
inputSchema: {
|
|
1311
|
+
type: 'object',
|
|
1312
|
+
properties: {
|
|
1313
|
+
work_item_id: {
|
|
1314
|
+
type: 'string',
|
|
1315
|
+
description: 'The refId of the work item that follows the others',
|
|
1316
|
+
},
|
|
1317
|
+
depends_on: {
|
|
1318
|
+
type: 'array',
|
|
1319
|
+
items: { type: ['number', 'string'] },
|
|
1320
|
+
description: 'Reference numbers of the prerequisites, as 2322 or "#2322". Replaces the whole set; pass [] to clear.',
|
|
1321
|
+
},
|
|
1322
|
+
project_slug: {
|
|
1323
|
+
type: 'string',
|
|
1324
|
+
description: 'Project slug (required for multi-project users, use list_projects to get slugs)',
|
|
1325
|
+
},
|
|
1326
|
+
},
|
|
1327
|
+
required: ['work_item_id', 'depends_on'],
|
|
1328
|
+
},
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
name: 'get_work_item_dependency_graph',
|
|
1332
|
+
description: 'The whole chain of ordered work around one work item — the prerequisites above it and the work ' +
|
|
1333
|
+
'that follows below — as nodes and edges, each item appearing exactly once. An edge runs from the ' +
|
|
1334
|
+
"item that must finish to the item that waits on it. Use it to see a plan's shape; " +
|
|
1335
|
+
"get_work_item already gives one item's own dependsOn, nextItems and blockedBy.",
|
|
1336
|
+
inputSchema: {
|
|
1337
|
+
type: 'object',
|
|
1338
|
+
properties: {
|
|
1339
|
+
work_item_id: { type: 'string', description: 'The refId of the work item' },
|
|
1340
|
+
project_slug: {
|
|
1341
|
+
type: 'string',
|
|
1342
|
+
description: 'Project slug (required for multi-project users, use list_projects to get slugs)',
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
required: ['work_item_id'],
|
|
1346
|
+
},
|
|
1347
|
+
},
|
|
1272
1348
|
// Radar Item (Initiative/Roadmap) tools
|
|
1273
1349
|
{
|
|
1274
1350
|
name: 'list_radar_items',
|
|
@@ -1459,6 +1535,9 @@ class WolfpackMCPServer {
|
|
|
1459
1535
|
name: 'create_work_item',
|
|
1460
1536
|
description: 'Create a new work item in your current project (auto-selected for single-project users, or use list_projects first for multi-project). Requires mcp:work_items:create permission. ' +
|
|
1461
1537
|
'Agents: work you file lands unassigned in the backlog, whatever status you ask for, and waits there for the Delivery Lead to approve and assign it. ' +
|
|
1538
|
+
'ORDERED WORK: when you file a set of items that must happen in order, give each one depends_on ' +
|
|
1539
|
+
'naming the reference numbers it follows, rather than writing "Follows #2322" into the description — ' +
|
|
1540
|
+
'that way the board knows the order and the pickup gate enforces it. ' +
|
|
1462
1541
|
CONTENT_LINKING_HELP,
|
|
1463
1542
|
inputSchema: {
|
|
1464
1543
|
type: 'object',
|
|
@@ -1508,6 +1587,11 @@ class WolfpackMCPServer {
|
|
|
1508
1587
|
type: 'string',
|
|
1509
1588
|
description: 'Link to a radar/initiative item. Accepts refId (e.g. "5" or "#r5") or UUID.',
|
|
1510
1589
|
},
|
|
1590
|
+
depends_on: {
|
|
1591
|
+
type: 'array',
|
|
1592
|
+
items: { type: ['number', 'string'] },
|
|
1593
|
+
description: 'Reference numbers of work items that must finish before this one starts, as 2322 or "#2322". Filing an ordered set one call each needs mcp:work_items:manage_dependencies.',
|
|
1594
|
+
},
|
|
1511
1595
|
},
|
|
1512
1596
|
required: ['title'],
|
|
1513
1597
|
},
|
|
@@ -2787,6 +2871,48 @@ class WolfpackMCPServer {
|
|
|
2787
2871
|
],
|
|
2788
2872
|
};
|
|
2789
2873
|
}
|
|
2874
|
+
case 'set_work_item_dependencies': {
|
|
2875
|
+
const parsed = SetWorkItemDependenciesSchema.parse(args);
|
|
2876
|
+
const teamSlug = parsed.project_slug || this.client.getProjectSlug() || undefined;
|
|
2877
|
+
const dependencies = await this.client.setWorkItemDependencies(parsed.work_item_id, parsed.depends_on, teamSlug);
|
|
2878
|
+
const name = (items) => items.map((item) => `#${item.refId} "${item.title}"`).join(', ');
|
|
2879
|
+
const summary = dependencies.dependsOn.length === 0
|
|
2880
|
+
? `#${parsed.work_item_id} now depends on nothing`
|
|
2881
|
+
: `#${parsed.work_item_id} now depends on ${name(dependencies.dependsOn)}` +
|
|
2882
|
+
(dependencies.blockedBy.length > 0
|
|
2883
|
+
? `, and cannot start until ${name(dependencies.blockedBy)} finishes`
|
|
2884
|
+
: ', all of which have finished');
|
|
2885
|
+
return {
|
|
2886
|
+
content: [
|
|
2887
|
+
{
|
|
2888
|
+
type: 'text',
|
|
2889
|
+
text: `${summary}\n\n${JSON.stringify(stripUuids(dependencies), null, 2)}`,
|
|
2890
|
+
},
|
|
2891
|
+
],
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
case 'get_work_item_dependency_graph': {
|
|
2895
|
+
const parsed = GetWorkItemDependencyGraphSchema.parse(args);
|
|
2896
|
+
const teamSlug = parsed.project_slug || this.client.getProjectSlug() || undefined;
|
|
2897
|
+
const graph = await this.client.getWorkItemDependencyGraph(parsed.work_item_id, teamSlug);
|
|
2898
|
+
// Edges name nodes by UUID, which agents never see, so they are
|
|
2899
|
+
// rewritten as reference numbers before the UUIDs are stripped —
|
|
2900
|
+
// dropping them would leave a list of items and no order at all
|
|
2901
|
+
const byId = new Map(graph.nodes.map((node) => [node.id, node.refId]));
|
|
2902
|
+
return {
|
|
2903
|
+
content: [
|
|
2904
|
+
{
|
|
2905
|
+
type: 'text',
|
|
2906
|
+
text: JSON.stringify({
|
|
2907
|
+
root: `#${byId.get(graph.rootId)}`,
|
|
2908
|
+
items: stripUuids(graph.nodes),
|
|
2909
|
+
// Each entry reads "A must finish before B can start"
|
|
2910
|
+
mustFinishBefore: graph.edges.map((edge) => `#${byId.get(edge.from)} → #${byId.get(edge.to)}`),
|
|
2911
|
+
}, null, 2),
|
|
2912
|
+
},
|
|
2913
|
+
],
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2790
2916
|
// Radar Item handlers
|
|
2791
2917
|
case 'list_radar_items': {
|
|
2792
2918
|
const parsed = ListRadarItemsSchema.parse(args);
|
|
@@ -2906,6 +3032,7 @@ class WolfpackMCPServer {
|
|
|
2906
3032
|
leadingUserId: parsed.leading_user_id,
|
|
2907
3033
|
categoryId: parsed.category_id,
|
|
2908
3034
|
radarItemId,
|
|
3035
|
+
dependsOnRefIds: parsed.depends_on,
|
|
2909
3036
|
teamSlug,
|
|
2910
3037
|
});
|
|
2911
3038
|
return {
|