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.
@@ -22,7 +22,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
22
22
  tools: [
23
23
  {
24
24
  name: "get_annotations",
25
- description: "Retrieves all feedback annotations (comments). IMPORTANT: Use the 'reference' object (selector, outerHtml, source) to perform INSTANT EDITS in the code. If 'source' exists, go directly to that file/line. Avoid unnecessary browser validation for simple UI changes.",
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
- ...ann,
87
- _ia_hint: ann.reference?.source && ann.reference.source !== 'unknown:0'
88
- ? `ACTION: Go to ${ann.reference.source.split(':')[0]} around line ${ann.reference.source.split(':')[1]} to apply the fix.`
89
- : `ACTION: Use selector "${ann.reference?.selector}" and check outerHtml to identify the element in the code.`
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
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-wrapper",
3
- "version": "1.10.23",
3
+ "version": "1.10.24",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",