@qontinui/ui-bridge 0.21.0 → 0.21.1

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.
@@ -1,6 +1,6 @@
1
1
  import '../types-DHctEsDy.mjs';
2
2
  import '../sse-handler-Dit9fk0r.mjs';
3
- export { N as NextJSAdapterConfig, c as NextRouteHandler, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-DZf4_LXo.mjs';
3
+ export { N as NextJSAdapterConfig, c as NextRouteHandler, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-DCLP7WgI.mjs';
4
4
  import '../types-CDn2gSl_.mjs';
5
5
  import '../codes.generated-CXeSH-M4.mjs';
6
6
  import '../types-dIjjX5Mf.mjs';
@@ -1,6 +1,6 @@
1
1
  import '../types-DRCeaV6_.js';
2
2
  import '../sse-handler-gyM74VPz.js';
3
- export { N as NextJSAdapterConfig, c as NextRouteHandler, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-NxTdtHhA.js';
3
+ export { N as NextJSAdapterConfig, c as NextRouteHandler, j as createControlHandlers, k as createDebugHandlers, l as createNextRouteHandlers, n as createRenderLogHandlers, o as createUIBridgeHandler } from '../nextjs-Bu7ZGwGe.js';
4
4
  import '../types-DJO1izBV.js';
5
5
  import '../codes.generated-CXeSH-M4.js';
6
6
  import '../types-D7e9AWwl.js';
@@ -25471,7 +25471,12 @@ function handleRelayRoute(method, path, request, relay, config) {
25471
25471
  400
25472
25472
  );
25473
25473
  }
25474
- relay.recordRegistration(heartbeatTabId, { userId, sessionId });
25474
+ const callerUserId = request.headers.get("x-caller-user-id") ?? request.headers.get("X-Caller-User-Id") ?? void 0;
25475
+ const registration = relay.recordRegistration(
25476
+ heartbeatTabId,
25477
+ { userId, sessionId },
25478
+ { callerUserId }
25479
+ );
25475
25480
  relay.receiveHeartbeat(heartbeatTabId, {
25476
25481
  url: typeof body?.url === "string" ? body.url : void 0,
25477
25482
  title: typeof body?.title === "string" ? body.title : void 0,
@@ -25481,7 +25486,15 @@ function handleRelayRoute(method, path, request, relay, config) {
25481
25486
  const tabRegistered = diag.connectedTabs.includes(heartbeatTabId);
25482
25487
  return jsonResponse({
25483
25488
  success: true,
25484
- data: { received: true, tabRegistered },
25489
+ data: {
25490
+ received: true,
25491
+ tabRegistered,
25492
+ // Observability: signals an ownership claim/transfer was refused
25493
+ // because the claimed userId was not auth-proven. Not a fatal
25494
+ // heartbeat error — the loop continues; the tab simply keeps its
25495
+ // prior (or no) owner. Absent when ownership was assigned.
25496
+ ...registration.ownershipAssigned ? {} : { ownershipAssigned: false, ownerChangeRejected: registration.rejectedReason }
25497
+ },
25485
25498
  timestamp: Date.now()
25486
25499
  });
25487
25500
  })();