@decentnetwork/lan 0.1.140 → 0.1.141

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.
Binary file
Binary file
Binary file
Binary file
@@ -30,6 +30,8 @@ export interface ChatMessage {
30
30
  size: number;
31
31
  status?: "queued" | "sending" | "sent" | "failed";
32
32
  sent?: number;
33
+ durationMs?: number;
34
+ avgKbps?: number;
33
35
  };
34
36
  }
35
37
  export declare class MessageStore {
@@ -65,6 +67,8 @@ export declare class MessageStore {
65
67
  patchFile(peer: string, id: string, patch: {
66
68
  status?: "queued" | "sending" | "sent" | "failed";
67
69
  sent?: number;
70
+ durationMs?: number;
71
+ avgKbps?: number;
68
72
  }): boolean;
69
73
  private push;
70
74
  /**
@@ -814,7 +814,10 @@ export class DaemonServer {
814
814
  this.logger.info(`File "${p.name}" (${mb} MB) delivered to ${p.friendId.slice(0, 8)} in ${secs}s (${rate} MB/s)`);
815
815
  const t = p.fileId ? this.activeSends.get(p.fileId) : undefined;
816
816
  if (t) {
817
- this.messageStore?.patchFile(t.peer, t.msgId, { status: "sent", sent: p.size });
817
+ // Persist the delivery stats so total time + average speed survive
818
+ // (previously they were only logged and lost when the log scrolled).
819
+ const avgKbps = p.durationMs && p.durationMs > 0 ? p.size / 1024 / (p.durationMs / 1000) : undefined;
820
+ this.messageStore?.patchFile(t.peer, t.msgId, { status: "sent", sent: p.size, durationMs: p.durationMs, avgKbps });
818
821
  this.activeSends.delete(p.fileId);
819
822
  // If this was a queued (offline) send, its bytes lived in the
820
823
  // outbox — now delivered, drop the copy.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/lan",
3
- "version": "0.1.140",
3
+ "version": "0.1.141",
4
4
  "description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -79,7 +79,7 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@decentnetwork/dora": "^0.1.11",
82
- "@decentnetwork/peer": "^0.1.73",
82
+ "@decentnetwork/peer": "^0.1.74",
83
83
  "ink": "^5.2.1",
84
84
  "js-yaml": "^4.1.0",
85
85
  "node-forge": "^1.4.0",