@dyno181cm.nexsoft/zentao_mcp 1.2.14 → 1.2.15
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/build/tools.js +15 -8
- package/package.json +1 -1
package/build/tools.js
CHANGED
|
@@ -80,8 +80,8 @@ async function localizeImages(html) {
|
|
|
80
80
|
await client.downloadImageToLocal(remoteUrl, localPath);
|
|
81
81
|
}
|
|
82
82
|
const fileUrl = toFileUrl(localPath);
|
|
83
|
-
// Replace img tag with a standard hyperlink (no inline rendering, saves tokens)
|
|
84
|
-
const linkTag = `<a href="${fileUrl}"
|
|
83
|
+
// Replace img tag with a standard hyperlink (no inline rendering, saves tokens) using image icon
|
|
84
|
+
const linkTag = `<a href="${fileUrl}">🖼️ ${linkText}</a>`;
|
|
85
85
|
result = result.split(fullTag).join(linkTag);
|
|
86
86
|
}
|
|
87
87
|
catch {
|
|
@@ -139,7 +139,12 @@ async function renderAttachments(files) {
|
|
|
139
139
|
if (!f.localPath)
|
|
140
140
|
return `- 📎 ${f.title} — *(download failed, Size: ${formatSize(f.size)})*`;
|
|
141
141
|
const fileUrl = toFileUrl(f.localPath);
|
|
142
|
-
|
|
142
|
+
let icon = '📎';
|
|
143
|
+
if (IMAGE_EXTS.has(f.ext))
|
|
144
|
+
icon = '🖼️';
|
|
145
|
+
else if (VIDEO_EXTS.has(f.ext))
|
|
146
|
+
icon = '🎬';
|
|
147
|
+
return `- ${icon} [${f.title}](${fileUrl}) *(Size: ${formatSize(f.size)})*`;
|
|
143
148
|
});
|
|
144
149
|
return `\n## Files 📎${headerHint}\n${lines.join('\n')}\n`;
|
|
145
150
|
}
|
|
@@ -197,24 +202,26 @@ export async function bugToMarkdown(rawBug) {
|
|
|
197
202
|
`**Priority:** ${rawBug.pri || 'N/A'}`,
|
|
198
203
|
`**Type:** ${rawBug.type || 'N/A'}`,
|
|
199
204
|
];
|
|
200
|
-
if (rawBug.openedBy)
|
|
205
|
+
if (rawBug.openedBy) {
|
|
201
206
|
meta.push(`**Opened by:** ${formatUser(rawBug.openedBy)}`);
|
|
202
|
-
|
|
207
|
+
}
|
|
208
|
+
if (rawBug.assignedTo) {
|
|
203
209
|
meta.push(`**Assigned to:** ${formatUser(rawBug.assignedTo)}`);
|
|
210
|
+
}
|
|
204
211
|
if (rawBug.resolvedBy) {
|
|
205
212
|
const resolution = rawBug.resolution ? ` (${rawBug.resolution})` : '';
|
|
206
213
|
meta.push(`**Resolved by:** ${formatUser(rawBug.resolvedBy)}${resolution}`);
|
|
207
214
|
}
|
|
208
|
-
if (rawBug.closedBy)
|
|
215
|
+
if (rawBug.closedBy) {
|
|
209
216
|
meta.push(`**Closed by:** ${formatUser(rawBug.closedBy)}`);
|
|
217
|
+
}
|
|
210
218
|
const localizedSteps = await localizeImages(rawBug.steps);
|
|
211
219
|
const steps = htmlToMarkdown(localizedSteps);
|
|
212
220
|
const attachments = await renderAttachments(parseFiles(rawBug.files));
|
|
213
|
-
const metaList = meta.map(m => `- ${m}`).join('\n');
|
|
214
221
|
return [
|
|
215
222
|
`# Bug #${rawBug.id}: ${rawBug.title}`,
|
|
216
223
|
'',
|
|
217
|
-
|
|
224
|
+
...meta.map(m => `- ${m}`),
|
|
218
225
|
'',
|
|
219
226
|
'## Repro Steps',
|
|
220
227
|
steps || '*No steps provided.*',
|