@thinkingos/vsl-mcp-server 1.2.11 → 1.2.12
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/dist/index.js +29 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -185,16 +185,23 @@ function toBase36(n) {
|
|
|
185
185
|
function buildIdMap(objects) {
|
|
186
186
|
const map = /* @__PURE__ */ new Map();
|
|
187
187
|
const counters = /* @__PURE__ */ new Map();
|
|
188
|
-
function visit(obj) {
|
|
188
|
+
function visit(obj, framePrefix) {
|
|
189
189
|
const tag = extractTag(obj.id);
|
|
190
190
|
const prefix = tagPrefix(tag);
|
|
191
191
|
const counter = counters.get(prefix) ?? 0;
|
|
192
192
|
counters.set(prefix, counter + 1);
|
|
193
|
-
const shortId = `${prefix}_${toBase36(counter)}`;
|
|
193
|
+
const shortId = framePrefix ? `${framePrefix}:${prefix}_${toBase36(counter)}` : `${prefix}_${toBase36(counter)}`;
|
|
194
194
|
map.set(shortId, obj.id);
|
|
195
195
|
if (obj.ch) {
|
|
196
196
|
for (const child of obj.ch) {
|
|
197
|
-
visit(child);
|
|
197
|
+
visit(child, framePrefix);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (obj.iframe?.vsl?.objects) {
|
|
201
|
+
const frameIndex = obj.iframe.frameId;
|
|
202
|
+
const iframeFramePrefix = `iframe_${frameIndex}`;
|
|
203
|
+
for (const iframeObj of obj.iframe.vsl.objects) {
|
|
204
|
+
visit(iframeObj, iframeFramePrefix);
|
|
198
205
|
}
|
|
199
206
|
}
|
|
200
207
|
}
|
|
@@ -219,6 +226,15 @@ function replaceIdsInDocument(document2, longToShort) {
|
|
|
219
226
|
if (obj.ch) {
|
|
220
227
|
result.ch = obj.ch.map(replaceObj);
|
|
221
228
|
}
|
|
229
|
+
if (obj.iframe?.vsl?.objects) {
|
|
230
|
+
result.iframe = {
|
|
231
|
+
...obj.iframe,
|
|
232
|
+
vsl: {
|
|
233
|
+
...obj.iframe.vsl,
|
|
234
|
+
objects: obj.iframe.vsl.objects.map(replaceObj)
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
222
238
|
return result;
|
|
223
239
|
}
|
|
224
240
|
return { ...document2, objects: document2.objects.map(replaceObj) };
|
|
@@ -266,6 +282,15 @@ function replaceIdsInVslObject(obj, reverseIdMap) {
|
|
|
266
282
|
if (obj.ch && obj.ch.length > 0) {
|
|
267
283
|
result.ch = obj.ch.map((child) => replaceIdsInVslObject(child, reverseIdMap));
|
|
268
284
|
}
|
|
285
|
+
if (obj.iframe?.vsl?.objects) {
|
|
286
|
+
result.iframe = {
|
|
287
|
+
...obj.iframe,
|
|
288
|
+
vsl: {
|
|
289
|
+
...obj.iframe.vsl,
|
|
290
|
+
objects: obj.iframe.vsl.objects.map((child) => replaceIdsInVslObject(child, reverseIdMap))
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
269
294
|
return result;
|
|
270
295
|
}
|
|
271
296
|
|
|
@@ -3119,7 +3144,7 @@ var SessionManager = class {
|
|
|
3119
3144
|
};
|
|
3120
3145
|
|
|
3121
3146
|
// src/version.ts
|
|
3122
|
-
var VSL_MCP_SERVER_VERSION = "1.2.
|
|
3147
|
+
var VSL_MCP_SERVER_VERSION = "1.2.12";
|
|
3123
3148
|
|
|
3124
3149
|
// src/index.ts
|
|
3125
3150
|
async function main() {
|