fraim 2.0.190 → 2.0.192

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/bin/fraim.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * FRAIM Framework CLI Entry Point
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim",
3
- "version": "2.0.190",
3
+ "version": "2.0.192",
4
4
  "description": "FRAIM CLI - Framework for Rigor-based AI Management (alias for fraim-framework)",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9400,22 +9400,32 @@ function tfCloseConnectedSurface() {
9400
9400
  tfShowArea(returnArea);
9401
9401
  }
9402
9402
 
9403
- async function tfHandleConnectedAuthMessage(event) {
9404
- const frame = document.getElementById('connected-frame');
9405
- if (frame && frame.contentWindow && event.source !== frame.contentWindow) return;
9406
- let remoteOrigin = '';
9407
- try { remoteOrigin = new URL(tfConnectedRemoteBase()).origin; }
9403
+ async function tfHandleConnectedAuthMessage(event) {
9404
+ const frame = document.getElementById('connected-frame');
9405
+ if (frame && frame.contentWindow && event.source !== frame.contentWindow) return;
9406
+ let remoteOrigin = '';
9407
+ try { remoteOrigin = new URL(tfConnectedRemoteBase()).origin; }
9408
9408
  catch { return; }
9409
9409
  if (event.origin !== remoteOrigin) return;
9410
- const msg = event.data || {};
9411
- if (!msg || msg.type !== 'fraim-auth-api-key' || typeof msg.apiKey !== 'string' || !msg.apiKey) return;
9412
- await tfRememberConnectedApiKey(msg.apiKey);
9413
- if (state.connectedSurface) {
9414
- const nextUrl = tfConnectedSurfaceUrl(state.connectedSurface);
9415
- const frameEl = document.getElementById('connected-frame');
9416
- if (frameEl) frameEl.src = nextUrl;
9417
- }
9418
- }
9410
+ const msg = event.data || {};
9411
+ if (!msg || msg.type !== 'fraim-auth-api-key' || typeof msg.apiKey !== 'string' || !msg.apiKey) return;
9412
+ const previousKey = tfConnectedApiKey();
9413
+ await tfRememberConnectedApiKey(msg.apiKey);
9414
+ if (state.connectedSurface) {
9415
+ const nextUrl = tfConnectedSurfaceUrl(state.connectedSurface);
9416
+ const frameEl = document.getElementById('connected-frame');
9417
+ if (frameEl) {
9418
+ try {
9419
+ const current = new URL(frameEl.src || '', window.location.href);
9420
+ const next = new URL(nextUrl, window.location.href);
9421
+ if (previousKey === msg.apiKey && current.origin === next.origin && current.pathname === next.pathname) {
9422
+ return;
9423
+ }
9424
+ } catch {}
9425
+ frameEl.src = nextUrl;
9426
+ }
9427
+ }
9428
+ }
9419
9429
 
9420
9430
  async function tfRememberConnectedApiKey(apiKey) {
9421
9431
  const changed = apiKey !== state.storedApiKey;