@mandujs/mcp 0.38.10 → 0.38.11
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/package.json +2 -2
- package/src/tools/hydration.ts +63 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mandujs/mcp",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.11",
|
|
4
4
|
"description": "Mandu MCP Server - Agent-native interface for Mandu framework operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mandujs/core": "^0.54.
|
|
37
|
+
"@mandujs/core": "^0.54.19",
|
|
38
38
|
"@mandujs/ate": "^0.26.1",
|
|
39
39
|
"@mandujs/skills": "^0.20.1",
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.25.3"
|
package/src/tools/hydration.ts
CHANGED
|
@@ -232,31 +232,39 @@ export function hydrationTools(projectRoot: string) {
|
|
|
232
232
|
};
|
|
233
233
|
},
|
|
234
234
|
|
|
235
|
-
"mandu.pageClientMount.list": async () => {
|
|
236
|
-
// Load manifest
|
|
237
|
-
const manifestResult = await loadManifest(paths.manifestPath);
|
|
238
|
-
if (!manifestResult.success || !manifestResult.data) {
|
|
239
|
-
return { error: manifestResult.errors };
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
235
|
+
"mandu.pageClientMount.list": async () => {
|
|
236
|
+
// Load manifest
|
|
237
|
+
const manifestResult = await loadManifest(paths.manifestPath);
|
|
238
|
+
if (!manifestResult.success || !manifestResult.data) {
|
|
239
|
+
return { error: manifestResult.errors };
|
|
240
|
+
}
|
|
241
|
+
const bundleManifest = await readJsonFile<BundleManifest>(
|
|
242
|
+
path.join(projectRoot, ".mandu", "manifest.json"),
|
|
243
|
+
);
|
|
244
|
+
const partialBoundaryCount = Object.keys(bundleManifest?.partials ?? {}).length;
|
|
245
|
+
|
|
246
|
+
const pageClientMounts = manifestResult.data.routes
|
|
247
|
+
.filter((route) => route.kind === "page")
|
|
248
|
+
.map((route) => {
|
|
249
|
+
const hydration = getRouteHydration(route);
|
|
250
|
+
const needsClientMount = needsHydration(route);
|
|
251
|
+
const clientBoundaryCount = route.boundaries?.length ?? 0;
|
|
252
|
+
const hasRouteLevelClientMount = needsClientMount && !!route.clientModule;
|
|
253
|
+
const warning = needsClientMount && !route.clientModule
|
|
254
|
+
? `Route has hydration strategy '${hydration.strategy}' but no clientModule; build would emit no route bundle.`
|
|
255
|
+
: null;
|
|
256
|
+
|
|
251
257
|
return {
|
|
252
258
|
routeId: route.id,
|
|
253
|
-
pattern: route.pattern,
|
|
254
|
-
hasClientModule: !!route.clientModule,
|
|
255
|
-
clientModule: route.clientModule || null,
|
|
256
|
-
needsClientMount,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
pattern: route.pattern,
|
|
260
|
+
hasClientModule: !!route.clientModule,
|
|
261
|
+
clientModule: route.clientModule || null,
|
|
262
|
+
needsClientMount,
|
|
263
|
+
hasRouteLevelClientMount,
|
|
264
|
+
clientBoundaryCount,
|
|
265
|
+
// Backward compatibility for older agents that read `isIsland`.
|
|
266
|
+
isIsland: needsClientMount,
|
|
267
|
+
status: needsClientMount ? (route.clientModule ? "ready" : "broken") : "static",
|
|
260
268
|
warning,
|
|
261
269
|
hydration: {
|
|
262
270
|
strategy: hydration.strategy,
|
|
@@ -266,23 +274,38 @@ export function hydrationTools(projectRoot: string) {
|
|
|
266
274
|
};
|
|
267
275
|
});
|
|
268
276
|
|
|
269
|
-
const pageClientMountCount = pageClientMounts.filter((i) => i.needsClientMount).length;
|
|
270
|
-
const staticCount = pageClientMounts.filter((i) => !i.needsClientMount).length;
|
|
271
|
-
const activeMounts = pageClientMounts.filter((i) => i.needsClientMount);
|
|
272
|
-
const staticPages = pageClientMounts.filter((i) => !i.needsClientMount);
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
277
|
+
const pageClientMountCount = pageClientMounts.filter((i) => i.needsClientMount).length;
|
|
278
|
+
const staticCount = pageClientMounts.filter((i) => !i.needsClientMount).length;
|
|
279
|
+
const activeMounts = pageClientMounts.filter((i) => i.needsClientMount);
|
|
280
|
+
const staticPages = pageClientMounts.filter((i) => !i.needsClientMount);
|
|
281
|
+
const clientBoundaryCount = pageClientMounts.reduce(
|
|
282
|
+
(count, route) => count + route.clientBoundaryCount,
|
|
283
|
+
0,
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
terminology: {
|
|
288
|
+
pageClientMount:
|
|
289
|
+
"A page route whose whole page is hydrated from a route-level clientModule and route bundle.",
|
|
290
|
+
clientBoundary:
|
|
291
|
+
"A compiler-discovered nested client component marker recorded on RouteSpec.boundaries.",
|
|
292
|
+
partialBoundary:
|
|
293
|
+
"A legacy/runtime partial bundle listed in .mandu/manifest.json partials.",
|
|
294
|
+
island:
|
|
295
|
+
"Legacy umbrella term. Prefer pageClientMount, clientBoundary, or partialBoundary for precise reports.",
|
|
296
|
+
},
|
|
297
|
+
boundarySummary: {
|
|
298
|
+
clientBoundaryCount,
|
|
299
|
+
partialBoundaryCount,
|
|
300
|
+
pageClientMountCount,
|
|
301
|
+
},
|
|
302
|
+
totalPages: pageClientMounts.length,
|
|
303
|
+
pageClientMountCount,
|
|
304
|
+
clientBoundaryCount,
|
|
305
|
+
partialBoundaryCount,
|
|
306
|
+
staticCount,
|
|
307
|
+
pageClientMounts: activeMounts,
|
|
308
|
+
staticPages,
|
|
286
309
|
// Backward compatibility for older clients.
|
|
287
310
|
islandCount: pageClientMountCount,
|
|
288
311
|
islands: activeMounts,
|