@le-space/ui 0.3.30 → 0.3.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/ui",
3
- "version": "0.3.30",
3
+ "version": "0.3.31",
4
4
  "description": "Floating Aleph sponsor relay UI components for Svelte and React.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,8 +36,8 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@le-space/browser": "0.3.30",
40
- "@le-space/core": "0.3.30",
39
+ "@le-space/browser": "0.3.31",
40
+ "@le-space/core": "0.3.31",
41
41
  "viem": "^2.38.5"
42
42
  },
43
43
  "peerDependencies": {
package/react/index.js CHANGED
@@ -28,7 +28,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
28
28
  var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
29
29
 
30
30
  // src/shared/package-version.ts
31
- var UI_PACKAGE_VERSION = "0.3.30";
31
+ var UI_PACKAGE_VERSION = "0.3.31";
32
32
 
33
33
  // src/shared/format.ts
34
34
  function shortHash(value, head = 8, tail = 6) {
@@ -2869,7 +2869,14 @@ function normalizeVmBootstrapConfigSignalRecord(value) {
2869
2869
  instanceItemHash,
2870
2870
  updatedAt,
2871
2871
  publisherAddress: typeof candidate.publisherAddress === "string" && candidate.publisherAddress.trim() ? candidate.publisherAddress.trim() : null,
2872
- authorization: candidate.authorization
2872
+ authorization: candidate.authorization,
2873
+ peerId: typeof candidate.peerId === "string" && candidate.peerId.trim() ? candidate.peerId.trim() : null,
2874
+ probeMultiaddrs: Array.isArray(candidate.probeMultiaddrs) ? candidate.probeMultiaddrs.filter(
2875
+ (entry) => typeof entry === "string" && entry.trim().length > 0
2876
+ ) : [],
2877
+ browserBootstrapMultiaddrs: Array.isArray(candidate.browserBootstrapMultiaddrs) ? candidate.browserBootstrapMultiaddrs.filter(
2878
+ (entry) => typeof entry === "string" && entry.trim().length > 0
2879
+ ) : []
2873
2880
  };
2874
2881
  }
2875
2882
  async function fetchVmBootstrapConfigSignals(args) {
@@ -3401,6 +3408,7 @@ var SponsorRelayController = class {
3401
3408
  if (!setupPort) {
3402
3409
  throw new Error("Relay runtime did not expose the temporary setup endpoint.");
3403
3410
  }
3411
+ let bootstrapSignalRelayMetadata = null;
3404
3412
  if (profile === "orbitdb-relay-pinner") {
3405
3413
  this.emitProgress({
3406
3414
  stage: "deployment-confirmed",
@@ -3501,11 +3509,6 @@ var SponsorRelayController = class {
3501
3509
  }
3502
3510
  runtime = latestRuntime;
3503
3511
  mappedPorts2 = runtime.mappedPorts ?? mappedPorts2;
3504
- if (runtime.proxyUrl && runtime.webAccess?.active !== true) {
3505
- throw new Error(
3506
- "Aleph reserved a 2n6 proxy URL, but it never became active in time. Aborting guest HTTPS configuration to avoid a broken Caddy setup."
3507
- );
3508
- }
3509
3512
  }
3510
3513
  if (!runtime.hostIpv4) {
3511
3514
  throw new Error("Relay runtime lost its host IPv4 address while waiting for HTTPS activation.");
@@ -3587,46 +3590,85 @@ var SponsorRelayController = class {
3587
3590
  "The relay VM did not confirm that it applied the Aleph bootstrap config in time."
3588
3591
  );
3589
3592
  }
3590
- }
3591
- this.emitProgress({
3592
- stage: "publishing-bootstrap",
3593
- label: "Reading relay multiaddrs",
3594
- progress: 95,
3595
- status: "info",
3596
- itemHash: args.itemHash,
3597
- detail: "Waiting for the relay to report its final public multiaddrs."
3598
- });
3599
- const relayMetadata = await fetchRelayMetadataForRuntime({
3600
- runtime,
3601
- fetch: (url, init) => fetch(url, init),
3602
- preferSecureMetadata: profile === "uc-go-peer",
3603
- attempts: 80,
3604
- delayMs: 3e3,
3605
- timeoutMs: 24e4,
3606
- onAttempt: (result) => {
3607
- const payload = result.payload && typeof result.payload === "object" ? result.payload : null;
3608
- const metadata = payload?.metadata && typeof payload.metadata === "object" ? payload.metadata : null;
3609
- this.trace("deploy:relay-metadata-attempt", {
3593
+ bootstrapSignalRelayMetadata = typeof bootstrapConfigSignal.peerId === "string" && bootstrapConfigSignal.peerId.length > 0 && Array.isArray(bootstrapConfigSignal.probeMultiaddrs) && bootstrapConfigSignal.probeMultiaddrs.length > 0 ? {
3594
+ peerId: bootstrapConfigSignal.peerId,
3595
+ probeMultiaddrs: bootstrapConfigSignal.probeMultiaddrs,
3596
+ browserBootstrapMultiaddrs: bootstrapConfigSignal.browserBootstrapMultiaddrs ?? []
3597
+ } : null;
3598
+ if (runtime.proxyUrl && runtime.webAccess?.active !== true) {
3599
+ this.trace("deploy:bootstrap-proxy-fallback", {
3610
3600
  itemHash: args.itemHash,
3611
- attempt: result.attempt,
3612
- attempts: result.attempts,
3613
- requestUrl: result.requestUrl,
3614
- metadataUrl: result.metadataUrl,
3615
- hostIpv4: result.hostIpv4,
3616
- setupPort: result.setupPort,
3617
- ok: result.ok,
3618
- status: result.status,
3619
- ready: result.ready,
3620
- error: result.error ?? null,
3621
- payloadStatus: payload && typeof payload.status === "string" ? payload.status : null,
3622
- peerId: metadata && typeof metadata.peer_id === "string" ? metadata.peer_id : null,
3623
- probeMultiaddrCount: Array.isArray(metadata?.probe_multiaddrs) ? metadata.probe_multiaddrs.length : 0,
3624
- browserBootstrapMultiaddrCount: Array.isArray(
3625
- metadata?.browser_bootstrap_multiaddrs
3626
- ) ? metadata.browser_bootstrap_multiaddrs.length : 0
3601
+ deploymentToken: args.deploymentToken,
3602
+ proxyUrl: runtime.proxyUrl,
3603
+ bootstrapSignalRelayMetadata
3627
3604
  });
3605
+ this.emitProgress({
3606
+ stage: "deployment-confirmed",
3607
+ label: "Continuing without HTTPS route",
3608
+ progress: 94,
3609
+ status: "warning",
3610
+ itemHash: args.itemHash,
3611
+ detail: "The 2n6 HTTPS route stayed inactive, so guest setup continued without Caddy. Secure browser routing can be enabled later when the proxy becomes available."
3612
+ });
3613
+ runtime = {
3614
+ ...runtime,
3615
+ proxyUrl: null,
3616
+ webAccess: runtime.webAccess ? {
3617
+ ...runtime.webAccess,
3618
+ active: false
3619
+ } : runtime.webAccess
3620
+ };
3628
3621
  }
3629
- });
3622
+ }
3623
+ let relayMetadata = bootstrapSignalRelayMetadata;
3624
+ if (relayMetadata) {
3625
+ this.trace("deploy:relay-metadata-from-bootstrap-signal", {
3626
+ itemHash: args.itemHash,
3627
+ peerId: relayMetadata.peerId,
3628
+ probeMultiaddrCount: relayMetadata.probeMultiaddrs.length,
3629
+ browserBootstrapMultiaddrCount: relayMetadata.browserBootstrapMultiaddrs.length
3630
+ });
3631
+ } else {
3632
+ this.emitProgress({
3633
+ stage: "publishing-bootstrap",
3634
+ label: "Reading relay multiaddrs",
3635
+ progress: 95,
3636
+ status: "info",
3637
+ itemHash: args.itemHash,
3638
+ detail: "Waiting for the relay to report its final public multiaddrs."
3639
+ });
3640
+ relayMetadata = await fetchRelayMetadataForRuntime({
3641
+ runtime,
3642
+ fetch: (url, init) => fetch(url, init),
3643
+ preferSecureMetadata: profile === "uc-go-peer" && Boolean(runtime.proxyUrl),
3644
+ attempts: 80,
3645
+ delayMs: 3e3,
3646
+ timeoutMs: 24e4,
3647
+ onAttempt: (result) => {
3648
+ const payload = result.payload && typeof result.payload === "object" ? result.payload : null;
3649
+ const metadata = payload?.metadata && typeof payload.metadata === "object" ? payload.metadata : null;
3650
+ this.trace("deploy:relay-metadata-attempt", {
3651
+ itemHash: args.itemHash,
3652
+ attempt: result.attempt,
3653
+ attempts: result.attempts,
3654
+ requestUrl: result.requestUrl,
3655
+ metadataUrl: result.metadataUrl,
3656
+ hostIpv4: result.hostIpv4,
3657
+ setupPort: result.setupPort,
3658
+ ok: result.ok,
3659
+ status: result.status,
3660
+ ready: result.ready,
3661
+ error: result.error ?? null,
3662
+ payloadStatus: payload && typeof payload.status === "string" ? payload.status : null,
3663
+ peerId: metadata && typeof metadata.peer_id === "string" ? metadata.peer_id : null,
3664
+ probeMultiaddrCount: Array.isArray(metadata?.probe_multiaddrs) ? metadata.probe_multiaddrs.length : 0,
3665
+ browserBootstrapMultiaddrCount: Array.isArray(
3666
+ metadata?.browser_bootstrap_multiaddrs
3667
+ ) ? metadata.browser_bootstrap_multiaddrs.length : 0
3668
+ });
3669
+ }
3670
+ });
3671
+ }
3630
3672
  if (!relayMetadata) {
3631
3673
  throw new Error("Relay metadata did not include a peer ID and public multiaddrs.");
3632
3674
  }
package/shared/index.d.ts CHANGED
@@ -290,7 +290,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
290
290
  declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
291
291
  declare const DEPLOYMENT_PENDING_WARNING_MS: number;
292
292
 
293
- declare const UI_PACKAGE_VERSION = "0.3.30";
293
+ declare const UI_PACKAGE_VERSION = "0.3.31";
294
294
 
295
295
  interface RootfsRequiredPortForward {
296
296
  port: number;
package/shared/index.js CHANGED
@@ -27,7 +27,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
27
27
  var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
28
28
 
29
29
  // src/shared/package-version.ts
30
- var UI_PACKAGE_VERSION = "0.3.30";
30
+ var UI_PACKAGE_VERSION = "0.3.31";
31
31
 
32
32
  // src/shared/format.ts
33
33
  function shortHash(value, head = 8, tail = 6) {
@@ -2868,7 +2868,14 @@ function normalizeVmBootstrapConfigSignalRecord(value) {
2868
2868
  instanceItemHash,
2869
2869
  updatedAt,
2870
2870
  publisherAddress: typeof candidate.publisherAddress === "string" && candidate.publisherAddress.trim() ? candidate.publisherAddress.trim() : null,
2871
- authorization: candidate.authorization
2871
+ authorization: candidate.authorization,
2872
+ peerId: typeof candidate.peerId === "string" && candidate.peerId.trim() ? candidate.peerId.trim() : null,
2873
+ probeMultiaddrs: Array.isArray(candidate.probeMultiaddrs) ? candidate.probeMultiaddrs.filter(
2874
+ (entry) => typeof entry === "string" && entry.trim().length > 0
2875
+ ) : [],
2876
+ browserBootstrapMultiaddrs: Array.isArray(candidate.browserBootstrapMultiaddrs) ? candidate.browserBootstrapMultiaddrs.filter(
2877
+ (entry) => typeof entry === "string" && entry.trim().length > 0
2878
+ ) : []
2872
2879
  };
2873
2880
  }
2874
2881
  async function fetchVmBootstrapConfigSignals(args) {
@@ -3400,6 +3407,7 @@ var SponsorRelayController = class {
3400
3407
  if (!setupPort) {
3401
3408
  throw new Error("Relay runtime did not expose the temporary setup endpoint.");
3402
3409
  }
3410
+ let bootstrapSignalRelayMetadata = null;
3403
3411
  if (profile === "orbitdb-relay-pinner") {
3404
3412
  this.emitProgress({
3405
3413
  stage: "deployment-confirmed",
@@ -3500,11 +3508,6 @@ var SponsorRelayController = class {
3500
3508
  }
3501
3509
  runtime = latestRuntime;
3502
3510
  mappedPorts2 = runtime.mappedPorts ?? mappedPorts2;
3503
- if (runtime.proxyUrl && runtime.webAccess?.active !== true) {
3504
- throw new Error(
3505
- "Aleph reserved a 2n6 proxy URL, but it never became active in time. Aborting guest HTTPS configuration to avoid a broken Caddy setup."
3506
- );
3507
- }
3508
3511
  }
3509
3512
  if (!runtime.hostIpv4) {
3510
3513
  throw new Error("Relay runtime lost its host IPv4 address while waiting for HTTPS activation.");
@@ -3586,46 +3589,85 @@ var SponsorRelayController = class {
3586
3589
  "The relay VM did not confirm that it applied the Aleph bootstrap config in time."
3587
3590
  );
3588
3591
  }
3589
- }
3590
- this.emitProgress({
3591
- stage: "publishing-bootstrap",
3592
- label: "Reading relay multiaddrs",
3593
- progress: 95,
3594
- status: "info",
3595
- itemHash: args.itemHash,
3596
- detail: "Waiting for the relay to report its final public multiaddrs."
3597
- });
3598
- const relayMetadata = await fetchRelayMetadataForRuntime({
3599
- runtime,
3600
- fetch: (url, init) => fetch(url, init),
3601
- preferSecureMetadata: profile === "uc-go-peer",
3602
- attempts: 80,
3603
- delayMs: 3e3,
3604
- timeoutMs: 24e4,
3605
- onAttempt: (result) => {
3606
- const payload = result.payload && typeof result.payload === "object" ? result.payload : null;
3607
- const metadata = payload?.metadata && typeof payload.metadata === "object" ? payload.metadata : null;
3608
- this.trace("deploy:relay-metadata-attempt", {
3592
+ bootstrapSignalRelayMetadata = typeof bootstrapConfigSignal.peerId === "string" && bootstrapConfigSignal.peerId.length > 0 && Array.isArray(bootstrapConfigSignal.probeMultiaddrs) && bootstrapConfigSignal.probeMultiaddrs.length > 0 ? {
3593
+ peerId: bootstrapConfigSignal.peerId,
3594
+ probeMultiaddrs: bootstrapConfigSignal.probeMultiaddrs,
3595
+ browserBootstrapMultiaddrs: bootstrapConfigSignal.browserBootstrapMultiaddrs ?? []
3596
+ } : null;
3597
+ if (runtime.proxyUrl && runtime.webAccess?.active !== true) {
3598
+ this.trace("deploy:bootstrap-proxy-fallback", {
3609
3599
  itemHash: args.itemHash,
3610
- attempt: result.attempt,
3611
- attempts: result.attempts,
3612
- requestUrl: result.requestUrl,
3613
- metadataUrl: result.metadataUrl,
3614
- hostIpv4: result.hostIpv4,
3615
- setupPort: result.setupPort,
3616
- ok: result.ok,
3617
- status: result.status,
3618
- ready: result.ready,
3619
- error: result.error ?? null,
3620
- payloadStatus: payload && typeof payload.status === "string" ? payload.status : null,
3621
- peerId: metadata && typeof metadata.peer_id === "string" ? metadata.peer_id : null,
3622
- probeMultiaddrCount: Array.isArray(metadata?.probe_multiaddrs) ? metadata.probe_multiaddrs.length : 0,
3623
- browserBootstrapMultiaddrCount: Array.isArray(
3624
- metadata?.browser_bootstrap_multiaddrs
3625
- ) ? metadata.browser_bootstrap_multiaddrs.length : 0
3600
+ deploymentToken: args.deploymentToken,
3601
+ proxyUrl: runtime.proxyUrl,
3602
+ bootstrapSignalRelayMetadata
3626
3603
  });
3604
+ this.emitProgress({
3605
+ stage: "deployment-confirmed",
3606
+ label: "Continuing without HTTPS route",
3607
+ progress: 94,
3608
+ status: "warning",
3609
+ itemHash: args.itemHash,
3610
+ detail: "The 2n6 HTTPS route stayed inactive, so guest setup continued without Caddy. Secure browser routing can be enabled later when the proxy becomes available."
3611
+ });
3612
+ runtime = {
3613
+ ...runtime,
3614
+ proxyUrl: null,
3615
+ webAccess: runtime.webAccess ? {
3616
+ ...runtime.webAccess,
3617
+ active: false
3618
+ } : runtime.webAccess
3619
+ };
3627
3620
  }
3628
- });
3621
+ }
3622
+ let relayMetadata = bootstrapSignalRelayMetadata;
3623
+ if (relayMetadata) {
3624
+ this.trace("deploy:relay-metadata-from-bootstrap-signal", {
3625
+ itemHash: args.itemHash,
3626
+ peerId: relayMetadata.peerId,
3627
+ probeMultiaddrCount: relayMetadata.probeMultiaddrs.length,
3628
+ browserBootstrapMultiaddrCount: relayMetadata.browserBootstrapMultiaddrs.length
3629
+ });
3630
+ } else {
3631
+ this.emitProgress({
3632
+ stage: "publishing-bootstrap",
3633
+ label: "Reading relay multiaddrs",
3634
+ progress: 95,
3635
+ status: "info",
3636
+ itemHash: args.itemHash,
3637
+ detail: "Waiting for the relay to report its final public multiaddrs."
3638
+ });
3639
+ relayMetadata = await fetchRelayMetadataForRuntime({
3640
+ runtime,
3641
+ fetch: (url, init) => fetch(url, init),
3642
+ preferSecureMetadata: profile === "uc-go-peer" && Boolean(runtime.proxyUrl),
3643
+ attempts: 80,
3644
+ delayMs: 3e3,
3645
+ timeoutMs: 24e4,
3646
+ onAttempt: (result) => {
3647
+ const payload = result.payload && typeof result.payload === "object" ? result.payload : null;
3648
+ const metadata = payload?.metadata && typeof payload.metadata === "object" ? payload.metadata : null;
3649
+ this.trace("deploy:relay-metadata-attempt", {
3650
+ itemHash: args.itemHash,
3651
+ attempt: result.attempt,
3652
+ attempts: result.attempts,
3653
+ requestUrl: result.requestUrl,
3654
+ metadataUrl: result.metadataUrl,
3655
+ hostIpv4: result.hostIpv4,
3656
+ setupPort: result.setupPort,
3657
+ ok: result.ok,
3658
+ status: result.status,
3659
+ ready: result.ready,
3660
+ error: result.error ?? null,
3661
+ payloadStatus: payload && typeof payload.status === "string" ? payload.status : null,
3662
+ peerId: metadata && typeof metadata.peer_id === "string" ? metadata.peer_id : null,
3663
+ probeMultiaddrCount: Array.isArray(metadata?.probe_multiaddrs) ? metadata.probe_multiaddrs.length : 0,
3664
+ browserBootstrapMultiaddrCount: Array.isArray(
3665
+ metadata?.browser_bootstrap_multiaddrs
3666
+ ) ? metadata.browser_bootstrap_multiaddrs.length : 0
3667
+ });
3668
+ }
3669
+ });
3670
+ }
3629
3671
  if (!relayMetadata) {
3630
3672
  throw new Error("Relay metadata did not include a peer ID and public multiaddrs.");
3631
3673
  }