appium-mcp 1.98.0 → 1.99.1
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/CHANGELOG.md +12 -0
- package/README.md +30 -0
- package/dist/locators/element-filter.d.ts +3 -1
- package/dist/locators/element-filter.d.ts.map +1 -1
- package/dist/locators/element-filter.js +44 -14
- package/dist/locators/element-filter.js.map +1 -1
- package/dist/locators/generate-all-locators.d.ts +6 -1
- package/dist/locators/generate-all-locators.d.ts.map +1 -1
- package/dist/locators/generate-all-locators.js +1 -1
- package/dist/locators/generate-all-locators.js.map +1 -1
- package/dist/locators/locator-generation.d.ts +4 -3
- package/dist/locators/locator-generation.d.ts.map +1 -1
- package/dist/locators/locator-generation.js +31 -10
- package/dist/locators/locator-generation.js.map +1 -1
- package/dist/locators/types.d.ts +3 -0
- package/dist/locators/types.d.ts.map +1 -0
- package/dist/locators/types.js +2 -0
- package/dist/locators/types.js.map +1 -0
- package/dist/tools/gestures/schema.d.ts.map +1 -1
- package/dist/tools/gestures/schema.js +7 -15
- package/dist/tools/gestures/schema.js.map +1 -1
- package/dist/tools/interactions/screen-recording.d.ts.map +1 -1
- package/dist/tools/interactions/screen-recording.js +4 -1
- package/dist/tools/interactions/screen-recording.js.map +1 -1
- package/dist/tools/test-generation/locators.d.ts.map +1 -1
- package/dist/tools/test-generation/locators.js +19 -5
- package/dist/tools/test-generation/locators.js.map +1 -1
- package/dist/ui/inspector-screenshot-script.d.ts +3 -0
- package/dist/ui/inspector-screenshot-script.d.ts.map +1 -0
- package/dist/ui/inspector-screenshot-script.js +164 -0
- package/dist/ui/inspector-screenshot-script.js.map +1 -0
- package/dist/ui/mcp-ui-utils.d.ts.map +1 -1
- package/dist/ui/mcp-ui-utils.js +14 -73
- package/dist/ui/mcp-ui-utils.js.map +1 -1
- package/dist/ui/page-source-inspector-app.d.ts.map +1 -1
- package/dist/ui/page-source-inspector-app.js +79 -75
- package/dist/ui/page-source-inspector-app.js.map +1 -1
- package/dist/ui/xml-inspector-scripts.d.ts +4 -0
- package/dist/ui/xml-inspector-scripts.d.ts.map +1 -0
- package/dist/ui/xml-inspector-scripts.js +91 -0
- package/dist/ui/xml-inspector-scripts.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/locators/element-filter.ts +50 -16
- package/src/locators/generate-all-locators.ts +13 -7
- package/src/locators/locator-generation.ts +43 -10
- package/src/locators/types.ts +2 -0
- package/src/tools/gestures/schema.ts +7 -17
- package/src/tools/interactions/screen-recording.ts +4 -1
- package/src/tools/test-generation/locators.ts +31 -7
- package/src/ui/inspector-screenshot-script.ts +163 -0
- package/src/ui/mcp-ui-utils.ts +15 -73
- package/src/ui/page-source-inspector-app.ts +80 -75
- package/src/ui/xml-inspector-scripts.ts +91 -0
|
@@ -10,9 +10,21 @@ export default function generateLocators(server) {
|
|
|
10
10
|
const mcpAppsEnabled = isMcpAppsEnabled();
|
|
11
11
|
server.addTool({
|
|
12
12
|
name: 'generate_locators',
|
|
13
|
-
description: `Generate
|
|
13
|
+
description: `Generate current-page locator candidates for inspection. Defaults: controls for UiAutomator2/XCUITest/Web; all elements except hierarchy for other native drivers.`,
|
|
14
14
|
_meta: mcpAppsEnabled ? { ui: { resourceUri: LOCATOR_GENERATOR_URI } } : undefined,
|
|
15
15
|
parameters: z.object({
|
|
16
|
+
query: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Case-insensitive literal substring of an element tag or attribute value (name, label, text, ID, etc.). Searches all element types, including hidden elements. Blank or omitted keeps the default driver-specific filter.'),
|
|
20
|
+
xpathAttributes: z
|
|
21
|
+
.array(z
|
|
22
|
+
.string()
|
|
23
|
+
.trim()
|
|
24
|
+
.regex(/^[A-Za-z_][A-Za-z0-9_.-]*$/))
|
|
25
|
+
.max(20)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Additional XPath attribute names in priority order, e.g. AutomationId or data-testid. Tried before built-in attributes; defaults remain as fallback. No namespace prefixes or XPath expressions.'),
|
|
16
28
|
sessionId: z.string().optional().describe('Session ID; defaults to the active session.'),
|
|
17
29
|
}),
|
|
18
30
|
annotations: {
|
|
@@ -41,11 +53,13 @@ export default function generateLocators(server) {
|
|
|
41
53
|
const isNative = ['uiautomator2', 'xcuitest'].includes(driverName)
|
|
42
54
|
? (await getCurrentContext(driver)) === 'NATIVE_APP'
|
|
43
55
|
: !capabilities.browserName;
|
|
44
|
-
const
|
|
45
|
-
|
|
56
|
+
const query = args.query?.trim();
|
|
57
|
+
const elementsWithLocators = generateAllElementLocators(pageSource, isNative, driverName, {
|
|
58
|
+
...(query ? { query, fetchableOnly: false } : { fetchableOnly: true }),
|
|
59
|
+
...(args.xpathAttributes?.length ? { xpathAttributes: [...new Set(args.xpathAttributes)] } : {}),
|
|
46
60
|
});
|
|
47
61
|
const textResponse = textResult(JSON.stringify({
|
|
48
|
-
interactableElements,
|
|
62
|
+
interactableElements: elementsWithLocators,
|
|
49
63
|
message: 'Page source retrieved successfully',
|
|
50
64
|
instruction: `These are the locators for the current page. Use this to generate code for the current page.
|
|
51
65
|
Using the template provided by generate://code-with-locators resource.`,
|
|
@@ -55,7 +69,7 @@ export default function generateLocators(server) {
|
|
|
55
69
|
if (mcpAppsEnabled && clientSupportsMcpApps(server, context)) {
|
|
56
70
|
return textResponse;
|
|
57
71
|
}
|
|
58
|
-
return addUIResourceToResponse(textResponse, () => createUIResource(`ui://appium-mcp/locator-generator/${Date.now()}`, createLocatorGeneratorUI(
|
|
72
|
+
return addUIResourceToResponse(textResponse, () => createUIResource(`ui://appium-mcp/locator-generator/${Date.now()}`, createLocatorGeneratorUI(elementsWithLocators)));
|
|
59
73
|
}
|
|
60
74
|
catch (err) {
|
|
61
75
|
log.error('Error getting page source:', err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locators.js","sourceRoot":"","sources":["../../../src/tools/test-generation/locators.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,CAAC,EAAC,MAAM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,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;gBAC7C,OAAO,WAAW,CAAC,8BAA8B,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector-screenshot-script.d.ts","sourceRoot":"","sources":["../../src/ui/inspector-screenshot-script.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,QAiKvC,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/** Browser controller for the optional screenshot and XML bounds overlay. */
|
|
2
|
+
export const INSPECTOR_SCREENSHOT_SCRIPT = String.raw `
|
|
3
|
+
function createScreenshotInspector(callTool, setSource, readSourceResult) {
|
|
4
|
+
const button = document.getElementById('takeScreenshotButton');
|
|
5
|
+
const panel = document.getElementById('screenshotPanel');
|
|
6
|
+
const image = document.getElementById('inspectorScreenshot');
|
|
7
|
+
const overlay = document.getElementById('elementOverlay');
|
|
8
|
+
const select = document.getElementById('screenshotElement');
|
|
9
|
+
const status = document.getElementById('screenshotStatus');
|
|
10
|
+
const details = document.getElementById('selectedXmlElement');
|
|
11
|
+
let elements = [];
|
|
12
|
+
let screen;
|
|
13
|
+
let query = '';
|
|
14
|
+
|
|
15
|
+
function readBounds(element) {
|
|
16
|
+
// Drivers differ in attribute casing. Prefer the exact lowercase spelling if both exist.
|
|
17
|
+
function attribute(name) {
|
|
18
|
+
if (element.hasAttribute(name)) return element.getAttribute(name);
|
|
19
|
+
return Array.from(element.attributes).find(attr => attr.name.toLowerCase() === name)?.value;
|
|
20
|
+
}
|
|
21
|
+
const android = (attribute('bounds') || '').match(/^\[(-?\d+),(-?\d+)\]\[(-?\d+),(-?\d+)\]$/);
|
|
22
|
+
if (android) {
|
|
23
|
+
const [, x, y, right, bottom] = android.map(Number);
|
|
24
|
+
return {x, y, width: right - x, height: bottom - y};
|
|
25
|
+
}
|
|
26
|
+
const coordinates = ['x', 'y', 'width', 'height'].map(attribute);
|
|
27
|
+
if (!coordinates.every(value => value !== undefined && value.trim() !== '')) return;
|
|
28
|
+
const values = coordinates.map(Number);
|
|
29
|
+
if (!values.every(Number.isFinite)) return;
|
|
30
|
+
const [x, y, width, height] = values;
|
|
31
|
+
return {x, y, width, height};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function showSelection() {
|
|
35
|
+
overlay.hidden = true;
|
|
36
|
+
details.textContent = '';
|
|
37
|
+
if (!select.value) return;
|
|
38
|
+
const element = elements[Number(select.value) - 1];
|
|
39
|
+
if (!element) return;
|
|
40
|
+
// Display only the selected opening tag, not its entire subtree.
|
|
41
|
+
const clone = element.cloneNode(false);
|
|
42
|
+
details.textContent = new XMLSerializer().serializeToString(clone);
|
|
43
|
+
if (!screen) {
|
|
44
|
+
status.textContent = 'Take a screenshot to highlight this element.';
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const rect = readBounds(element);
|
|
48
|
+
if (!rect || rect.width <= 0 || rect.height <= 0) {
|
|
49
|
+
status.textContent = 'This element has no usable screen bounds.';
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (element.getAttribute('visible') === 'false' || element.getAttribute('displayed') === 'false') {
|
|
53
|
+
status.textContent = 'This element is marked hidden in the XML.';
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const left = Math.max(0, rect.x);
|
|
57
|
+
const top = Math.max(0, rect.y);
|
|
58
|
+
const right = Math.min(screen.width, rect.x + rect.width);
|
|
59
|
+
const bottom = Math.min(screen.height, rect.y + rect.height);
|
|
60
|
+
if (right <= left || bottom <= top) {
|
|
61
|
+
status.textContent = 'This element is outside the captured screen.';
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
overlay.style.left = (left / screen.width * 100) + '%';
|
|
65
|
+
overlay.style.top = (top / screen.height * 100) + '%';
|
|
66
|
+
overlay.style.width = ((right - left) / screen.width * 100) + '%';
|
|
67
|
+
overlay.style.height = ((bottom - top) / screen.height * 100) + '%';
|
|
68
|
+
overlay.hidden = false;
|
|
69
|
+
status.textContent = 'XML bounds: x=' + rect.x + ', y=' + rect.y + ', width=' + rect.width + ', height=' + rect.height;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function filter(nextQuery) {
|
|
73
|
+
query = nextQuery.trim().toLowerCase();
|
|
74
|
+
const previous = select.value;
|
|
75
|
+
select.textContent = '';
|
|
76
|
+
const placeholder = document.createElement('option');
|
|
77
|
+
placeholder.value = '';
|
|
78
|
+
placeholder.textContent = 'Select an XML element to highlight';
|
|
79
|
+
select.appendChild(placeholder);
|
|
80
|
+
let retained = false;
|
|
81
|
+
elements.forEach((element, index) => {
|
|
82
|
+
const attributes = Array.from(element.attributes).map(attr => attr.value);
|
|
83
|
+
if (query && ![element.tagName, ...attributes].some(value => value.toLowerCase().includes(query))) return;
|
|
84
|
+
const option = document.createElement('option');
|
|
85
|
+
option.value = String(index + 1);
|
|
86
|
+
const name = element.getAttribute('name') || element.getAttribute('label') || element.getAttribute('text') || element.getAttribute('resource-id') || element.getAttribute('id');
|
|
87
|
+
option.textContent = (index + 1) + '. ' + element.tagName + (name ? ' — ' + name : '');
|
|
88
|
+
select.appendChild(option);
|
|
89
|
+
if (option.value === previous) retained = true;
|
|
90
|
+
});
|
|
91
|
+
select.value = retained ? previous : '';
|
|
92
|
+
showSelection();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function updateSource(source) {
|
|
96
|
+
screen = undefined;
|
|
97
|
+
image.hidden = true;
|
|
98
|
+
overlay.hidden = true;
|
|
99
|
+
elements = [];
|
|
100
|
+
select.value = '';
|
|
101
|
+
if (source.trim().startsWith('<')) {
|
|
102
|
+
const doc = new DOMParser().parseFromString(source, 'text/xml');
|
|
103
|
+
if (!doc.getElementsByTagName('parsererror').length) elements = Array.from(doc.getElementsByTagName('*'));
|
|
104
|
+
}
|
|
105
|
+
filter(query);
|
|
106
|
+
status.textContent = 'XML updated. Take a screenshot to refresh the preview.';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function assertSuccess(result) {
|
|
110
|
+
if (result?.isError) throw new Error((result.content || []).filter(item => item.type === 'text').map(item => item.text).join('\n') || 'Tool failed');
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async function capture() {
|
|
115
|
+
if (button.disabled) return;
|
|
116
|
+
button.disabled = true;
|
|
117
|
+
panel.hidden = false;
|
|
118
|
+
screen = undefined;
|
|
119
|
+
image.hidden = true;
|
|
120
|
+
overlay.hidden = true;
|
|
121
|
+
status.textContent = 'Capturing screenshot and refreshing XML…';
|
|
122
|
+
try {
|
|
123
|
+
const sourceResult = assertSuccess(await callTool('appium_get_page_source', {saveToFile: false}));
|
|
124
|
+
const sizeResult = assertSuccess(await callTool('appium_get_window_size', {}));
|
|
125
|
+
const result = assertSuccess(await callTool('appium_screenshot', {returnRawBase64: true}));
|
|
126
|
+
const sizeText = (sizeResult.content || []).filter(item => item.type === 'text').map(item => item.text).join(' ');
|
|
127
|
+
const size = sizeText.match(/Width:\s*([\d.]+),\s*Height:\s*([\d.]+)/);
|
|
128
|
+
if (!size || !(Number(size[1]) > 0 && Number(size[2]) > 0)) throw new Error('Screen size is unavailable');
|
|
129
|
+
const picture = result.structuredContent?.screenshot || (result.content || []).find(item => item.type === 'image');
|
|
130
|
+
if (!picture?.data || !['image/png', 'image/jpeg'].includes(picture.mimeType)) throw new Error('No supported screenshot returned');
|
|
131
|
+
setSource(readSourceResult(sourceResult));
|
|
132
|
+
screen = {width: Number(size[1]), height: Number(size[2])};
|
|
133
|
+
image.src = 'data:' + picture.mimeType + ';base64,' + picture.data;
|
|
134
|
+
image.hidden = false;
|
|
135
|
+
status.textContent = 'Select an XML element below. Search filters the list.';
|
|
136
|
+
} catch (error) {
|
|
137
|
+
status.textContent = 'Screenshot failed: ' + error.message;
|
|
138
|
+
} finally {
|
|
139
|
+
button.disabled = false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
image.addEventListener('load', () => {
|
|
144
|
+
if (!screen) return;
|
|
145
|
+
// Pixel density is handled by percentages; orientation changes are not.
|
|
146
|
+
const ratio = image.naturalWidth / image.naturalHeight;
|
|
147
|
+
if (Math.abs(ratio / (screen.width / screen.height) - 1) > 0.03) {
|
|
148
|
+
screen = undefined;
|
|
149
|
+
overlay.hidden = true;
|
|
150
|
+
status.textContent = 'Screenshot and screen dimensions differ. Capture again before highlighting.';
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
image.addEventListener('error', () => {
|
|
154
|
+
screen = undefined;
|
|
155
|
+
image.hidden = true;
|
|
156
|
+
overlay.hidden = true;
|
|
157
|
+
status.textContent = 'Unable to display screenshot.';
|
|
158
|
+
});
|
|
159
|
+
button.addEventListener('click', capture);
|
|
160
|
+
select.addEventListener('change', showSelection);
|
|
161
|
+
return {updateSource, filter};
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
164
|
+
//# sourceMappingURL=inspector-screenshot-script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector-screenshot-script.js","sourceRoot":"","sources":["../../src/ui/inspector-screenshot-script.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiKpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-ui-utils.d.ts","sourceRoot":"","sources":["../../src/ui/mcp-ui-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"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function createPageSourceInspectorUI(pageSource) {
|
|
|
959
960
|
outline: none;
|
|
960
961
|
border-color: #007AFF;
|
|
961
962
|
}
|
|
963
|
+
mark { background: #ffd700; color: #000; }
|
|
964
|
+
mark[data-active] { outline: 2px solid #91baff; background: #ff963c; }
|
|
965
|
+
.search-status { padding: 6px 16px; font-size: 12px; color: #bbb; }
|
|
966
|
+
.search-status:empty { display: none; }
|
|
962
967
|
</style>
|
|
963
968
|
</head>
|
|
964
969
|
<body>
|
|
@@ -975,11 +980,14 @@ export function createPageSourceInspectorUI(pageSource) {
|
|
|
975
980
|
<button class="btn" onclick="generateLocators()">Generate Locators</button>
|
|
976
981
|
</div>
|
|
977
982
|
</div>
|
|
983
|
+
<div id="searchStatus" class="search-status" role="status" aria-live="polite"></div>
|
|
978
984
|
<div class="viewer" title="Drag the bottom-right corner to resize vertically">
|
|
979
985
|
<pre class="xml-content" id="xmlContent">${escapedSource}</pre>
|
|
980
986
|
</div>
|
|
981
987
|
</details>
|
|
982
988
|
<script>
|
|
989
|
+
${XML_FORMAT_SCRIPT}
|
|
990
|
+
${XML_SEARCH_SCRIPT}
|
|
983
991
|
function copyToClipboard() {
|
|
984
992
|
const text = document.getElementById('xmlContent').textContent;
|
|
985
993
|
navigator.clipboard.writeText(text).then(() => {
|
|
@@ -989,44 +997,7 @@ export function createPageSourceInspectorUI(pageSource) {
|
|
|
989
997
|
|
|
990
998
|
function formatXML() {
|
|
991
999
|
try {
|
|
992
|
-
|
|
993
|
-
const xmlDoc = parser.parseFromString(originalSource, 'text/xml');
|
|
994
|
-
if (!xmlDoc.documentElement || xmlDoc.getElementsByTagName('parsererror').length) {
|
|
995
|
-
throw new Error('Invalid XML');
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
function indentElement(element, depth) {
|
|
999
|
-
// Do not introduce whitespace into mixed content or preserved subtrees.
|
|
1000
|
-
if (element.getAttribute('xml:space') === 'preserve') return;
|
|
1001
|
-
const children = Array.from(element.childNodes);
|
|
1002
|
-
if (children.some(child =>
|
|
1003
|
-
child.nodeType === 4 || (child.nodeType === 3 && child.nodeValue.trim())
|
|
1004
|
-
)) return;
|
|
1005
|
-
if (!children.some(child => child.nodeType === 1)) return;
|
|
1006
|
-
|
|
1007
|
-
for (const child of children) {
|
|
1008
|
-
if (child.nodeType === 3) {
|
|
1009
|
-
element.removeChild(child);
|
|
1010
|
-
continue;
|
|
1011
|
-
}
|
|
1012
|
-
if (child.nodeType === 1) indentElement(child, depth + 1);
|
|
1013
|
-
element.insertBefore(xmlDoc.createTextNode('\\n' + ' '.repeat(depth + 1)), child);
|
|
1014
|
-
}
|
|
1015
|
-
element.appendChild(xmlDoc.createTextNode('\\n' + ' '.repeat(depth)));
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
indentElement(xmlDoc.documentElement, 0);
|
|
1019
|
-
const serializer = new XMLSerializer();
|
|
1020
|
-
let formatted = Array.from(xmlDoc.childNodes)
|
|
1021
|
-
.filter(node => node.nodeType !== 3)
|
|
1022
|
-
.map(node => serializer.serializeToString(node))
|
|
1023
|
-
.join('\\n');
|
|
1024
|
-
// Browser DOMParser does not retain the XML declaration.
|
|
1025
|
-
const declaration = originalSource.match(/^\\s*(<\\?xml\\s[^?]*\\?>)/);
|
|
1026
|
-
if (declaration && !formatted.startsWith('<?xml ')) {
|
|
1027
|
-
formatted = declaration[1] + '\\n' + formatted;
|
|
1028
|
-
}
|
|
1029
|
-
displayedSource = formatted;
|
|
1000
|
+
displayedSource = formatXml(originalSource);
|
|
1030
1001
|
renderSource(document.getElementById('searchBox').value);
|
|
1031
1002
|
} catch (e) {
|
|
1032
1003
|
alert('Failed to format XML');
|
|
@@ -1038,7 +1009,7 @@ export function createPageSourceInspectorUI(pageSource) {
|
|
|
1038
1009
|
type: 'tool',
|
|
1039
1010
|
payload: {
|
|
1040
1011
|
toolName: 'generate_locators',
|
|
1041
|
-
params: {}
|
|
1012
|
+
params: {query: document.getElementById('searchBox').value.trim()}
|
|
1042
1013
|
}
|
|
1043
1014
|
}, '*');
|
|
1044
1015
|
}
|
|
@@ -1047,42 +1018,12 @@ export function createPageSourceInspectorUI(pageSource) {
|
|
|
1047
1018
|
const originalSource = xmlContent.textContent;
|
|
1048
1019
|
let displayedSource = originalSource;
|
|
1049
1020
|
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
const textLower = text.toLowerCase();
|
|
1053
|
-
let position = 0;
|
|
1054
|
-
|
|
1055
|
-
while (position < text.length) {
|
|
1056
|
-
const matchIndex = textLower.indexOf(searchLower, position);
|
|
1057
|
-
if (matchIndex === -1) {
|
|
1058
|
-
container.appendChild(document.createTextNode(text.slice(position)));
|
|
1059
|
-
return;
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
if (matchIndex > position) {
|
|
1063
|
-
container.appendChild(
|
|
1064
|
-
document.createTextNode(text.slice(position, matchIndex))
|
|
1065
|
-
);
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
const mark = document.createElement('mark');
|
|
1069
|
-
mark.style.background = '#ffd700';
|
|
1070
|
-
mark.style.color = '#000';
|
|
1071
|
-
mark.textContent = text.slice(matchIndex, matchIndex + searchTerm.length);
|
|
1072
|
-
container.appendChild(mark);
|
|
1073
|
-
position = matchIndex + searchTerm.length;
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1021
|
+
const searchBox = document.getElementById('searchBox');
|
|
1022
|
+
const xmlSearch = createXmlSearch(xmlContent, document.getElementById('searchStatus'));
|
|
1077
1023
|
function renderSource(searchTerm = '') {
|
|
1078
|
-
|
|
1079
|
-
if (!searchTerm) {
|
|
1080
|
-
xmlContent.textContent = displayedSource;
|
|
1081
|
-
return;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
appendTextWithHighlights(xmlContent, displayedSource, searchTerm);
|
|
1024
|
+
xmlSearch.render(displayedSource, searchTerm);
|
|
1085
1025
|
}
|
|
1026
|
+
searchBox.addEventListener('keydown', xmlSearch.handleKeyDown);
|
|
1086
1027
|
|
|
1087
1028
|
// Search functionality
|
|
1088
1029
|
document.getElementById('searchBox').addEventListener('input', (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-ui-utils.js","sourceRoot":"","sources":["../../src/ui/mcp-ui-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,WAAmB;IASnB,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,GAAG;YACH,QAAQ,EAAE,WAAW;YACrB,IAAI,EAAE,WAAW;SAClB;KACF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAKE,EACF,QAA2B,EAC3B,UAAiC;IAEjC,MAAM,eAAe,GACnB,QAAQ,KAAK,KAAK,IAAI,UAAU;QAC9B,CAAC,CAAC,UAAU,KAAK,WAAW;YAC1B,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,aAAa;QACjB,CAAC,CAAC,iBAAiB,CAAC;IAExB,MAAM,WAAW,GAAG,OAAO;SACxB,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC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AC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACjC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,UAAU,CACf,MAAM,CAAC,KAAK,CAAC;SACV,WAAW,EAAE;SACb,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-source-inspector-app.d.ts","sourceRoot":"","sources":["../../src/ui/page-source-inspector-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-source-inspector-app.d.ts","sourceRoot":"","sources":["../../src/ui/page-source-inspector-app.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAwVvD"}
|