openclaw-quiubo 2.6.40 → 2.6.41

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/index.js CHANGED
@@ -13531,6 +13531,43 @@ var quiuboPlugin = {
13531
13531
  const accts = { ...channel.accounts };
13532
13532
  delete accts[id];
13533
13533
  return setChannelConfig(cfg, { ...channel, accounts: accts });
13534
+ },
13535
+ /**
13536
+ * Resolve a default delivery target for cron/announce when no --to is provided.
13537
+ * Scans the agent's session store for quiubo group sessions and returns the
13538
+ * group ID if there's exactly one. With multiple groups, returns undefined
13539
+ * (user must specify --to).
13540
+ */
13541
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13542
+ resolveDefaultTo({ cfg, accountId }) {
13543
+ try {
13544
+ const fs = __require("node:fs");
13545
+ const path = __require("node:path");
13546
+ const homeDir = process.env.HOME ?? process.env.USERPROFILE ?? "";
13547
+ const agentId = accountId ?? "main";
13548
+ const possiblePaths = [
13549
+ path.join(homeDir, ".openclaw", "agents", agentId, "sessions", "sessions.json"),
13550
+ path.join(homeDir, ".openclaw", "sessions", "sessions.json")
13551
+ ];
13552
+ for (const storePath of possiblePaths) {
13553
+ if (!fs.existsSync(storePath)) continue;
13554
+ const raw = fs.readFileSync(storePath, "utf-8");
13555
+ const store = JSON.parse(raw);
13556
+ const groupIds = /* @__PURE__ */ new Set();
13557
+ for (const key of Object.keys(store)) {
13558
+ const match = key.match(/quiubo:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i);
13559
+ if (match && !key.includes(":group:")) {
13560
+ groupIds.add(match[1]);
13561
+ }
13562
+ }
13563
+ if (groupIds.size === 1) {
13564
+ return [...groupIds][0];
13565
+ }
13566
+ if (groupIds.size > 1) return void 0;
13567
+ }
13568
+ } catch {
13569
+ }
13570
+ return void 0;
13534
13571
  }
13535
13572
  },
13536
13573
  // ── setup adapter (for `channels add` CLI) ──────────────────────