@aixnn/aixautots 0.6.20 → 0.6.21

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.
@@ -25,6 +25,32 @@ function isSessionActive(session) {
25
25
  function helperPhaseKey(phase) {
26
26
  return `sdkSettings.helperPhase${phase.charAt(0).toUpperCase()}${phase.slice(1)}`;
27
27
  }
28
+ function hostSetTimeout(fn, ms) {
29
+ if (typeof window !== "undefined" && typeof window.setTimeout === "function") {
30
+ return window.setTimeout(fn, ms);
31
+ }
32
+ return setTimeout(fn, ms);
33
+ }
34
+ function hostClearTimeout(id) {
35
+ if (typeof window !== "undefined" && typeof window.clearTimeout === "function") {
36
+ window.clearTimeout(id);
37
+ return;
38
+ }
39
+ clearTimeout(id);
40
+ }
41
+ function hostSetInterval(fn, ms) {
42
+ if (typeof window !== "undefined" && typeof window.setInterval === "function") {
43
+ return window.setInterval(fn, ms);
44
+ }
45
+ return setInterval(fn, ms);
46
+ }
47
+ function hostClearInterval(id) {
48
+ if (typeof window !== "undefined" && typeof window.clearInterval === "function") {
49
+ window.clearInterval(id);
50
+ return;
51
+ }
52
+ clearInterval(id);
53
+ }
28
54
  function SdkLocalNodeSection({
29
55
  runtime,
30
56
  session,
@@ -100,10 +126,10 @@ function SdkLocalNodeSection({
100
126
  if (!view.pending) void refreshStatus(view);
101
127
  };
102
128
  const unsub = runtimeRef.current.subscribeStatus?.(onStatus);
103
- const timer = setInterval(onStatus, 3e3);
129
+ const timer = hostSetInterval(onStatus, 3e3);
104
130
  return () => {
105
131
  view.active = false;
106
- clearInterval(timer);
132
+ hostClearInterval(timer);
107
133
  unsub?.();
108
134
  };
109
135
  }, [runtime.available, sessionKey]);
@@ -711,7 +737,7 @@ function useLocalNodeList(client, runtime, session, nodeId, nodeName) {
711
737
  const current = () => active && isSessionActive(capturedSession);
712
738
  const clearRetry = () => {
713
739
  if (timer !== null) {
714
- clearTimeout(timer);
740
+ hostClearTimeout(timer);
715
741
  timer = null;
716
742
  }
717
743
  };
@@ -736,7 +762,7 @@ function useLocalNodeList(client, runtime, session, nodeId, nodeName) {
736
762
  } finally {
737
763
  pending = null;
738
764
  if (current() && !found && attempts < 6) {
739
- timer = setTimeout(() => {
765
+ timer = hostSetTimeout(() => {
740
766
  timer = null;
741
767
  void load();
742
768
  }, Math.min(8e3, 500 * 2 ** (attempts - 1)));
@@ -830,10 +856,10 @@ function DesktopNodeDetailsView({
830
856
  };
831
857
  refreshIdentity();
832
858
  const unsub = runtimeRef.current.subscribeStatus?.(refreshIdentity);
833
- const timer = setInterval(refreshIdentity, 3e3);
859
+ const timer = hostSetInterval(refreshIdentity, 3e3);
834
860
  return () => {
835
861
  view.active = false;
836
- clearInterval(timer);
862
+ hostClearInterval(timer);
837
863
  unsub?.();
838
864
  };
839
865
  }, [runtime.available, sessionKey, authenticated]);
@@ -872,7 +898,9 @@ function DesktopNodeDetailsView({
872
898
  rt.notifyStatusChanged?.();
873
899
  return;
874
900
  }
875
- await new Promise((resolve) => setTimeout(resolve, 500));
901
+ await new Promise((resolve) => {
902
+ hostSetTimeout(resolve, 500);
903
+ });
876
904
  check();
877
905
  } while (Date.now() < deadline);
878
906
  throw new Error(t("sdkSettings.nodeConnectTimeout"));
@@ -1178,12 +1206,12 @@ function SdkVersionSection({
1178
1206
  return actual;
1179
1207
  };
1180
1208
  const delay = (view, ms) => new Promise((resolve) => {
1181
- const timer = setTimeout(() => {
1209
+ const timer = hostSetTimeout(() => {
1182
1210
  view.cancelDelay = void 0;
1183
1211
  resolve();
1184
1212
  }, ms);
1185
1213
  view.cancelDelay = () => {
1186
- clearTimeout(timer);
1214
+ hostClearTimeout(timer);
1187
1215
  view.cancelDelay = void 0;
1188
1216
  resolve();
1189
1217
  };
@@ -1202,12 +1230,12 @@ function SdkVersionSection({
1202
1230
  const finish = (value) => {
1203
1231
  if (settled) return;
1204
1232
  settled = true;
1205
- clearTimeout(timer);
1233
+ hostClearTimeout(timer);
1206
1234
  if (view.cancelDelay === cancel) view.cancelDelay = void 0;
1207
1235
  resolve(value);
1208
1236
  };
1209
1237
  const cancel = () => finish(null);
1210
- const timer = setTimeout(cancel, Math.min(healthReadMs, Math.max(0, deadline - Date.now())));
1238
+ const timer = hostSetTimeout(cancel, Math.min(healthReadMs, Math.max(0, deadline - Date.now())));
1211
1239
  view.cancelDelay = cancel;
1212
1240
  if (!readHealth) {
1213
1241
  finish(null);
package/dist/ui/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import '../chunk-ZCTAYVPK.js';
2
- export { EnvInitDialog, NodeCapabilityPanel, SdkLocalNodeSection, SdkNodeDetailsSection, SdkSettingsPage, SdkVersionSection, SdkWalletSection, parseSdkUpdate, sdkVersion, verifySdkCompletion, vmPlan } from '../chunk-QISBQ532.js';
2
+ export { EnvInitDialog, NodeCapabilityPanel, SdkLocalNodeSection, SdkNodeDetailsSection, SdkSettingsPage, SdkVersionSection, SdkWalletSection, parseSdkUpdate, sdkVersion, verifySdkCompletion, vmPlan } from '../chunk-6IH74UX6.js';
3
3
  import '../chunk-DTXXQPOU.js';
4
4
  export { ControlBar, MirrorView } from '../chunk-MBBVYSPD.js';
5
5
  export { IpCommercePanel } from '../chunk-JQBSGFAR.js';
@@ -1,4 +1,4 @@
1
- export { SdkLocalNodeSection, SdkNodeDetailsSection, SdkSettingsPage, SdkVersionSection, SdkWalletSection, parseSdkUpdate, sdkVersion, verifySdkCompletion } from '../chunk-QISBQ532.js';
1
+ export { SdkLocalNodeSection, SdkNodeDetailsSection, SdkSettingsPage, SdkVersionSection, SdkWalletSection, parseSdkUpdate, sdkVersion, verifySdkCompletion } from '../chunk-6IH74UX6.js';
2
2
  import '../chunk-DTXXQPOU.js';
3
3
  import '../chunk-RFOJSDYI.js';
4
4
  import '../chunk-ZB5ET67B.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aixnn/aixautots",
3
- "version": "0.6.20",
3
+ "version": "0.6.21",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {