openclaw-quiubo 2.6.41 → 2.6.42
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 +30 -4
- package/dist/index.js.map +2 -2
- package/dist/src/channel.d.ts.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13789,8 +13789,13 @@ var quiuboPlugin = {
|
|
|
13789
13789
|
}
|
|
13790
13790
|
log?.info?.(`[${accountId}] [outbound:sendText] groupId=${groupId}, text=${text?.length ?? 0} chars, ctx.to=${ctx.to}, ConversationLabel=${ctx.target?.raw?.ConversationLabel ?? ctx.ConversationLabel}, SessionKey=${ctx.target?.raw?.SessionKey ?? ctx.SessionKey}`);
|
|
13791
13791
|
if (!groupId) {
|
|
13792
|
-
|
|
13793
|
-
|
|
13792
|
+
const availableGroups = listAgentQuiuboGroups(accountId);
|
|
13793
|
+
if (availableGroups.length > 0) {
|
|
13794
|
+
log?.error?.(`[${accountId}] [outbound:sendText] no groupId resolved. Available groups for this agent: ${availableGroups.join(", ")}. Set --to <groupId> when creating crons.`);
|
|
13795
|
+
} else {
|
|
13796
|
+
log?.error?.(`[${accountId}] [outbound:sendText] no groupId \u2014 ctx keys=${Object.keys(ctx).join(",")}, target=${ctx.target ? JSON.stringify(Object.keys(ctx.target)) : "none"}, raw=${ctx.target?.raw ? JSON.stringify(Object.keys(ctx.target.raw)) : "none"}`);
|
|
13797
|
+
}
|
|
13798
|
+
return { ok: false, error: availableGroups.length > 0 ? `No groupId in outbound context. Available groups: ${availableGroups.join(", ")}. Use --to <groupId> when creating crons.` : "No groupId in outbound context" };
|
|
13794
13799
|
}
|
|
13795
13800
|
const senderId = account.botIdentityId;
|
|
13796
13801
|
if (!senderId) {
|
|
@@ -13842,7 +13847,8 @@ var quiuboPlugin = {
|
|
|
13842
13847
|
}
|
|
13843
13848
|
if (!groupId) {
|
|
13844
13849
|
log?.error?.(`[${accountId}] [outbound:sendMedia] no groupId \u2014 ctx keys=${Object.keys(ctx).join(",")}`);
|
|
13845
|
-
|
|
13850
|
+
const _groups = listAgentQuiuboGroups(accountId);
|
|
13851
|
+
return { ok: false, error: _groups.length > 0 ? `No groupId in outbound context. Available groups: ${_groups.join(", ")}. Use --to <groupId> when creating crons.` : "No groupId in outbound context" };
|
|
13846
13852
|
}
|
|
13847
13853
|
const outboundAttachments = await readOutboundAttachments(urls, "agent", client, groupId, log, accountId);
|
|
13848
13854
|
const imageAttachments = outboundAttachments.filter((a) => a.mimeType.startsWith("image/"));
|
|
@@ -13910,7 +13916,8 @@ var quiuboPlugin = {
|
|
|
13910
13916
|
}
|
|
13911
13917
|
if (!groupId) {
|
|
13912
13918
|
log?.error?.(`[${accountId}] [outbound:createPost] no groupId \u2014 ctx keys=${Object.keys(ctx).join(",")}`);
|
|
13913
|
-
|
|
13919
|
+
const _groups = listAgentQuiuboGroups(accountId);
|
|
13920
|
+
return { ok: false, error: _groups.length > 0 ? `No groupId in outbound context. Available groups: ${_groups.join(", ")}. Use --to <groupId> when creating crons.` : "No groupId in outbound context" };
|
|
13914
13921
|
}
|
|
13915
13922
|
const senderId = account.botIdentityId;
|
|
13916
13923
|
if (!senderId) {
|
|
@@ -14354,6 +14361,25 @@ var quiuboPlugin = {
|
|
|
14354
14361
|
}
|
|
14355
14362
|
}
|
|
14356
14363
|
};
|
|
14364
|
+
function listAgentQuiuboGroups(agentId) {
|
|
14365
|
+
try {
|
|
14366
|
+
const fs = __require("node:fs");
|
|
14367
|
+
const path = __require("node:path");
|
|
14368
|
+
const homeDir = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
14369
|
+
const storePath = path.join(homeDir, ".openclaw", "agents", agentId, "sessions", "sessions.json");
|
|
14370
|
+
if (!fs.existsSync(storePath)) return [];
|
|
14371
|
+
const raw = fs.readFileSync(storePath, "utf-8");
|
|
14372
|
+
const store = JSON.parse(raw);
|
|
14373
|
+
const groups = /* @__PURE__ */ new Set();
|
|
14374
|
+
for (const key of Object.keys(store)) {
|
|
14375
|
+
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);
|
|
14376
|
+
if (match && !key.includes(":group:")) groups.add(match[1]);
|
|
14377
|
+
}
|
|
14378
|
+
return [...groups];
|
|
14379
|
+
} catch {
|
|
14380
|
+
return [];
|
|
14381
|
+
}
|
|
14382
|
+
}
|
|
14357
14383
|
function resolveOutboundGroupId(ctx) {
|
|
14358
14384
|
const raw = ctx.target?.raw ?? ctx;
|
|
14359
14385
|
const label = raw.ConversationLabel ?? ctx.ConversationLabel;
|