@azure-devops/mcp 2.11.0-nightly.20261123 → 2.11.1-nightly.20261124
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/tools/work-items.js +20 -9
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/tools/work-items.js
CHANGED
|
@@ -879,7 +879,10 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
879
879
|
if (!response.ok) {
|
|
880
880
|
throw new Error(`Failed to add a work item comment: ${response.statusText}`);
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
const added = JSON.parse(await response.text());
|
|
883
|
+
return {
|
|
884
|
+
content: [{ type: "text", text: JSON.stringify({ workItemId: added.workItemId, commentId: added.id, version: added.version, createdDate: added.createdDate, url: added.url }, null, 2) }],
|
|
885
|
+
};
|
|
883
886
|
}
|
|
884
887
|
if (action === "update") {
|
|
885
888
|
if (!commentId)
|
|
@@ -896,7 +899,12 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
896
899
|
if (!response.ok) {
|
|
897
900
|
throw new Error(`Failed to update work item comment: ${response.statusText}`);
|
|
898
901
|
}
|
|
899
|
-
|
|
902
|
+
const updated = JSON.parse(await response.text());
|
|
903
|
+
return {
|
|
904
|
+
content: [
|
|
905
|
+
{ type: "text", text: JSON.stringify({ workItemId: updated.workItemId, commentId: updated.id, version: updated.version, createdDate: updated.createdDate, url: updated.url }, null, 2) },
|
|
906
|
+
],
|
|
907
|
+
};
|
|
900
908
|
}
|
|
901
909
|
return { content: [{ type: "text", text: `Unknown action: ${action}` }], isError: true };
|
|
902
910
|
}
|
|
@@ -1023,7 +1031,13 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
1023
1031
|
throw new Error(`Failed to update work items in batch: ${response.statusText}`);
|
|
1024
1032
|
}
|
|
1025
1033
|
const result = await response.json();
|
|
1026
|
-
|
|
1034
|
+
const linked = result.value.map(({ code, body: entryBody }, index) => {
|
|
1035
|
+
if (code < 200 || code >= 300)
|
|
1036
|
+
return { id: uniqueIds[index], error: entryBody };
|
|
1037
|
+
const workItem = JSON.parse(entryBody);
|
|
1038
|
+
return { id: workItem.id, rev: workItem.rev, url: workItem.url, added: body[index].body.map(({ value }) => ({ rel: value.rel, target: value.url })) };
|
|
1039
|
+
});
|
|
1040
|
+
return { content: [{ type: "text", text: JSON.stringify(linked, null, 2) }] };
|
|
1027
1041
|
}
|
|
1028
1042
|
if (action === "unlink") {
|
|
1029
1043
|
if (!id)
|
|
@@ -1061,10 +1075,7 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
1061
1075
|
content: [
|
|
1062
1076
|
{
|
|
1063
1077
|
type: "text",
|
|
1064
|
-
text:
|
|
1065
|
-
JSON.stringify(removedRelations, null, 2) +
|
|
1066
|
-
`\n\nUpdated work item result:\n` +
|
|
1067
|
-
JSON.stringify(updatedWorkItem, null, 2),
|
|
1078
|
+
text: JSON.stringify({ id: updatedWorkItem.id, rev: updatedWorkItem.rev, url: updatedWorkItem.url, removed: removedRelations.map((relation) => ({ rel: relation.rel, target: relation.url })) }, null, 2),
|
|
1068
1079
|
},
|
|
1069
1080
|
],
|
|
1070
1081
|
isError: false,
|
|
@@ -1099,7 +1110,7 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
1099
1110
|
return { content: [{ type: "text", text: "Work item update failed" }], isError: true };
|
|
1100
1111
|
}
|
|
1101
1112
|
return {
|
|
1102
|
-
content: [{ type: "text", text: JSON.stringify({
|
|
1113
|
+
content: [{ type: "text", text: JSON.stringify({ id: workItem.id, rev: workItem.rev, url: workItem.url, added: [{ rel: "ArtifactLink", target: vstfsUrl }] }, null, 2) }],
|
|
1103
1114
|
};
|
|
1104
1115
|
}
|
|
1105
1116
|
if (action === "add_artifact_link") {
|
|
@@ -1202,7 +1213,7 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
1202
1213
|
content: [
|
|
1203
1214
|
{
|
|
1204
1215
|
type: "text",
|
|
1205
|
-
text: JSON.stringify({
|
|
1216
|
+
text: JSON.stringify({ id: workItem.id, rev: workItem.rev, url: workItem.url, added: [{ rel: "ArtifactLink", target: finalArtifactUri }] }, null, 2),
|
|
1206
1217
|
},
|
|
1207
1218
|
],
|
|
1208
1219
|
};
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.11.
|
|
1
|
+
export const packageVersion = "2.11.1-nightly.20261124";
|
package/package.json
CHANGED