forkit-connect 0.1.4 → 0.1.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/cli.js CHANGED
@@ -677,9 +677,17 @@ function shellLine(label, value) {
677
677
  function shellListLine(value) {
678
678
  return `• ${value}`;
679
679
  }
680
+ function resolveInteractiveSessionState(service, sessionState) {
681
+ const overview = service.getConnectStatusOverview({ includeInbox: false });
682
+ if (sessionState === 'unavailable' && Boolean(service.readSessionRef()) && overview.device_paired) {
683
+ return 'authorized';
684
+ }
685
+ return sessionState;
686
+ }
680
687
  function buildInteractiveOverviewSections(service, sessionState, accountLimits) {
681
- const accountTrusted = sessionState === 'authorized';
682
688
  const overview = service.getConnectStatusOverview({ includeInbox: false });
689
+ const effectiveSessionState = resolveInteractiveSessionState(service, sessionState);
690
+ const accountTrusted = effectiveSessionState === 'authorized';
683
691
  const preparedWorkspace = accountTrusted ? String(overview.workspace_id || '').trim() : '';
684
692
  const preparedProject = accountTrusted ? String(overview.project_id || '').trim() : '';
685
693
  // Base section: always visible
@@ -687,7 +695,7 @@ function buildInteractiveOverviewSections(service, sessionState, accountLimits)
687
695
  {
688
696
  title: 'Overview',
689
697
  lines: [
690
- shellLine('Session', sessionState),
698
+ shellLine('Session', accountTrusted && sessionState === 'unavailable' ? 'connected' : effectiveSessionState),
691
699
  shellLine('Device paired', overview.device_paired),
692
700
  shellLine('Daemon', overview.daemon_status),
693
701
  shellLine('Privacy mode', overview.privacy_mode),
@@ -2794,7 +2802,7 @@ async function run() {
2794
2802
  }
2795
2803
  while (true) {
2796
2804
  process.exitCode = 0;
2797
- const sessionState = await checkBackendSessionState(service);
2805
+ const sessionState = resolveInteractiveSessionState(service, await checkBackendSessionState(service));
2798
2806
  const authenticated = sessionState === 'authorized';
2799
2807
  if (!authenticated) {
2800
2808
  await renderInteractiveStatusScreen(sessionState);
@@ -215,7 +215,7 @@ function defaultNotificationSender(title, message, candidate) {
215
215
  '$title = [System.Security.SecurityElement]::Escape($env:FORKIT_CONNECT_NOTIFICATION_TITLE)',
216
216
  '$body = [System.Security.SecurityElement]::Escape($env:FORKIT_CONNECT_NOTIFICATION_MESSAGE)',
217
217
  '$xml = New-Object Windows.Data.Xml.Dom.XmlDocument',
218
- '$xml.LoadXml("<toast><visual><binding template=\\"ToastGeneric\\"><text>$title</text><text>$body</text></binding></visual></toast>")',
218
+ '$xml.LoadXml("<toast><visual><binding template=\'ToastGeneric\'><text>$title</text><text>$body</text></binding></visual></toast>")',
219
219
  "$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)",
220
220
  "$notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier('Forkit Connect')",
221
221
  '$notifier.Show($toast)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forkit-connect",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Forkit Connect Local Engine - The Global AI Governance Fabric",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",