viewgate-wrapper 1.10.20 → 1.10.21

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.
@@ -68,8 +68,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
68
68
  if (!response.ok) {
69
69
  throw new Error(`Backend responded with ${response.status}`);
70
70
  }
71
- const annotations = await response.json();
72
- const annotationsWithTips = annotations.map((ann) => ({
71
+ const data = await response.json();
72
+ // Handle both direct array (legacy) and { data: [...] } (paginated) format
73
+ const rawAnnotations = Array.isArray(data) ? data : (data.data || []);
74
+ if (!Array.isArray(rawAnnotations)) {
75
+ throw new Error('Backend returned invalid annotations format');
76
+ }
77
+ const annotationsWithTips = rawAnnotations.map((ann) => ({
73
78
  ...ann,
74
79
  _ia_hint: ann.reference?.source && ann.reference.source !== 'unknown:0'
75
80
  ? `ACTION: Go to ${ann.reference.source.split(':')[0]} around line ${ann.reference.source.split(':')[1]} to apply the fix.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-wrapper",
3
- "version": "1.10.20",
3
+ "version": "1.10.21",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",