@decentnetwork/beagle 0.1.119 → 0.1.120

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.
@@ -1,4 +1,4 @@
1
- window.__DK_UI_VERSION="0.1.119";
1
+ window.__DK_UI_VERSION="0.1.120";
2
2
  "use strict";
3
3
  (() => {
4
4
  // packages/beagle-ui/dist/beagle-ui.js
@@ -617,6 +617,20 @@ export class EmbeddedHost {
617
617
  });
618
618
  return {};
619
619
  }
620
+ case "chat-retry": {
621
+ // Drain oldest-first (the named message among them) rather than sending
622
+ // that one message alone: a retry must not let a newer message overtake
623
+ // an older one in the same thread. The daemon path behaves the same.
624
+ if (!this.#sessionUsable(uid))
625
+ throw new Error("Peer is not online yet");
626
+ await this.#chainFlush(uid);
627
+ const still = this.#messages.queuedOutgoing(uid);
628
+ const id = typeof req.id === "string" ? req.id : undefined;
629
+ if (id && still.some((m) => m.id === id)) {
630
+ throw new Error("Still could not deliver it — it stays queued and will be retried");
631
+ }
632
+ return { queued: still.length };
633
+ }
620
634
  case "chat-log-local":
621
635
  this.#messages.append(uid, req.dir ?? "in", String(req.text ?? ""), Date.now());
622
636
  this.#meta.ensure(uid);
package/dist/ipc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /** Ops the daemon answers. Every one is peer-level — none of them needs the
2
2
  * TUN — which is what makes the beagle/decentlan split possible at all. */
3
- export type IpcOp = "ping" | "diag" | "friend-request" | "friends-pending" | "friends-accept" | "friends-reject" | "friends-list" | "friend-remove" | "friend-set-alias" | "friends-autoaccept" | "set-profile" | "sign" | "chat-send" | "chat-history" | "chat-log-local" | "chat-mark-read" | "file-send" | "file-delete" | "file-cancel" | "file-retry" | "file-log-local" | "call-signal" | "call-poll";
3
+ export type IpcOp = "ping" | "diag" | "friend-request" | "friends-pending" | "friends-accept" | "friends-reject" | "friends-list" | "friend-remove" | "friend-set-alias" | "friends-autoaccept" | "set-profile" | "sign" | "chat-send" | "chat-history" | "chat-log-local" | "chat-mark-read" | "chat-retry" | "file-send" | "file-delete" | "file-cancel" | "file-retry" | "file-log-local" | "call-signal" | "call-poll";
4
4
  export interface IpcRequest {
5
5
  op: IpcOp;
6
6
  address?: string;
package/dist/server.js CHANGED
@@ -2448,6 +2448,17 @@ export function startBeagleServer(opts) {
2448
2448
  sendJson(res, r.ok ? 200 : 400, r);
2449
2449
  return;
2450
2450
  }
2451
+ // The UI has posted this since 0.1.119, but there was no route and no
2452
+ // daemon op behind it: the retry button on a queued message 404'd, so a
2453
+ // message that failed while the friend stayed connected had no way out
2454
+ // at all (mac-dev, 2026-10-31). Needs @decentnetwork/lan >= 0.1.308 in
2455
+ // daemon mode; embedded mode handles it in-process.
2456
+ if (req.method === "POST" && url === "/api/chat-retry") {
2457
+ const { userid, id } = await readBody(req);
2458
+ const r = await opts.call({ op: "chat-retry", userid, id });
2459
+ sendJson(res, r.ok ? 200 : 400, r);
2460
+ return;
2461
+ }
2451
2462
  if (req.method === "POST" && url === "/api/chat-log-local") {
2452
2463
  const { userid, dir, text } = await readBody(req);
2453
2464
  const r = await opts.call({ op: "chat-log-local", userid, dir: dir === "out" ? "out" : "in", text });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/beagle",
3
- "version": "0.1.119",
3
+ "version": "0.1.120",
4
4
  "description": "Beagle — P2P chat, file transfer and calls for regular users, on the Decent Network. No admin privilege required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",