@nbakka/mcp-appium 2.0.39 → 2.0.40
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/lib/server.js +39 -9
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -374,8 +374,8 @@ const createMcpServer = () => {
|
|
|
374
374
|
extractTextFromADF(issue.fields.description) :
|
|
375
375
|
'No description available';
|
|
376
376
|
|
|
377
|
-
// Extract Figma links from
|
|
378
|
-
const figmaLinks =
|
|
377
|
+
// Extract Figma links directly from ADF structure
|
|
378
|
+
const figmaLinks = extractFigmaLinksFromADF(issue.fields.description);
|
|
379
379
|
|
|
380
380
|
// Format response
|
|
381
381
|
const result = {
|
|
@@ -431,17 +431,47 @@ const createMcpServer = () => {
|
|
|
431
431
|
return text.trim();
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
// Helper function to extract Figma links from
|
|
435
|
-
function
|
|
436
|
-
if (!
|
|
434
|
+
// Helper function to extract Figma links directly from ADF structure
|
|
435
|
+
function extractFigmaLinksFromADF(adfContent) {
|
|
436
|
+
if (!adfContent || typeof adfContent !== 'object') {
|
|
437
437
|
return [];
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
const figmaLinks = [];
|
|
441
|
+
|
|
442
|
+
function traverse(node) {
|
|
443
|
+
// Check for inlineCard nodes with Figma URLs
|
|
444
|
+
if (node.type === 'inlineCard' && node.attrs && node.attrs.url) {
|
|
445
|
+
const url = node.attrs.url;
|
|
446
|
+
if (url.includes('figma.com')) {
|
|
447
|
+
figmaLinks.push(url);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// Check for link marks with Figma URLs
|
|
452
|
+
if (node.marks && Array.isArray(node.marks)) {
|
|
453
|
+
node.marks.forEach(mark => {
|
|
454
|
+
if (mark.type === 'link' && mark.attrs && mark.attrs.href) {
|
|
455
|
+
const href = mark.attrs.href;
|
|
456
|
+
if (href.includes('figma.com')) {
|
|
457
|
+
figmaLinks.push(href);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// Traverse child content
|
|
464
|
+
if (node.content && Array.isArray(node.content)) {
|
|
465
|
+
node.content.forEach(traverse);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (adfContent.content) {
|
|
470
|
+
adfContent.content.forEach(traverse);
|
|
471
|
+
}
|
|
443
472
|
|
|
444
|
-
|
|
473
|
+
// Remove duplicates and return
|
|
474
|
+
return [...new Set(figmaLinks)];
|
|
445
475
|
}
|
|
446
476
|
|
|
447
477
|
return server;
|