@mcpjam/widget-react 0.1.10 → 0.1.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/dist/index.js CHANGED
@@ -2580,7 +2580,8 @@ function MCPAppsRendererSurface({
2580
2580
  appToolsListRefreshPendingBridgeIdsRef.current.delete(bridgeId);
2581
2581
  const tools = [];
2582
2582
  let cursor;
2583
- for (let page = 0; page < 8; page += 1) {
2583
+ const APP_TOOLS_PAGE_CAP = 8;
2584
+ for (let page = 0; page < APP_TOOLS_PAGE_CAP; page += 1) {
2584
2585
  const result = await bridge.listTools(
2585
2586
  cursor === void 0 ? {} : { cursor }
2586
2587
  );
@@ -2589,8 +2590,13 @@ function MCPAppsRendererSurface({
2589
2590
  (t) => Boolean(t && typeof t.name === "string" && t.name.length > 0)
2590
2591
  )
2591
2592
  );
2592
- cursor = result.nextCursor;
2593
- if (!cursor) break;
2593
+ cursor = typeof result.nextCursor === "string" ? result.nextCursor : void 0;
2594
+ if (cursor === void 0) break;
2595
+ if (page === APP_TOOLS_PAGE_CAP - 1) {
2596
+ console.warn(
2597
+ `[MCP Apps] tools/list still had more pages after ${APP_TOOLS_PAGE_CAP}; registering a partial tool set for bridge ${bridgeId}.`
2598
+ );
2599
+ }
2594
2600
  }
2595
2601
  appToolsListedBridgeIdsRef.current.add(bridgeId);
2596
2602
  if (!isLive()) return;