@nextclaw/kernel 0.1.15-beta.4 → 0.1.15-beta.5

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
@@ -2472,7 +2472,7 @@ function getPanelAppBridgeScript() {
2472
2472
  function request(method, payload) {
2473
2473
  const requestId = createRequestId();
2474
2474
  return new Promise((resolve, reject) => {
2475
- pending.set(requestId, { resolve, reject });
2475
+ pending.set(requestId, { method, resolve, reject });
2476
2476
  window.parent.postMessage({ type: requestType, requestId, method, payload }, "*");
2477
2477
  });
2478
2478
  }
@@ -2488,7 +2488,7 @@ function getPanelAppBridgeScript() {
2488
2488
  }
2489
2489
  pending.delete(data.requestId);
2490
2490
  if (data.ok) {
2491
- entry.resolve(data.data);
2491
+ entry.resolve(entry.method === "invoke" ? data.data?.result : data.data);
2492
2492
  return;
2493
2493
  }
2494
2494
  const error = new Error(data.error?.message || "NextClaw panel bridge request failed.");