viewgate-wrapper 1.10.23 → 1.10.24
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/mcp-server/dist/index.js +18 -8
- package/package.json +1 -1
package/mcp-server/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
22
22
|
tools: [
|
|
23
23
|
{
|
|
24
24
|
name: "get_annotations",
|
|
25
|
-
description: "Retrieves all feedback annotations
|
|
25
|
+
description: "Retrieves all feedback annotations. For each annotation, follow the '_ia_fix_instruction' to perform a FAST, SURGICAL fix. Use 'outerHtml' and 'source' (file:line) to locate the exact code block without manual searching.",
|
|
26
26
|
inputSchema: {
|
|
27
27
|
type: "object",
|
|
28
28
|
properties: {},
|
|
@@ -60,7 +60,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
60
60
|
switch (request.params.name) {
|
|
61
61
|
case "get_annotations": {
|
|
62
62
|
try {
|
|
63
|
-
const response = await fetch(`${BACKEND_URL}/api/annotations?full=true`, {
|
|
63
|
+
const response = await fetch(`${BACKEND_URL}/api/annotations?full=true&status=pending`, {
|
|
64
64
|
headers: {
|
|
65
65
|
'x-api-key': process.env.API_KEY || ''
|
|
66
66
|
}
|
|
@@ -82,12 +82,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
82
82
|
isError: true,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
const annotationsWithTips = rawAnnotations.map((ann) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const annotationsWithTips = rawAnnotations.map((ann) => {
|
|
86
|
+
const source = ann.reference?.source;
|
|
87
|
+
const hasSource = source && source !== 'unknown:0';
|
|
88
|
+
const [file, line] = hasSource ? source.split(':') : [null, null];
|
|
89
|
+
let hint = "";
|
|
90
|
+
if (hasSource) {
|
|
91
|
+
hint = `SURGICAL FIX: Open \`${file}\` at line ${line}. The element is \`${ann.reference.tag}\`.`;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
hint = `MANUAL FIND: Search for the element using selector \`${ann.reference?.selector}\`. Reference HTML: \`${ann.reference?.outerHtml?.slice(0, 100)}...\``;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
...ann,
|
|
98
|
+
_ia_fix_instruction: hint
|
|
99
|
+
};
|
|
100
|
+
});
|
|
91
101
|
return {
|
|
92
102
|
content: [
|
|
93
103
|
{
|