openclaw-quiubo 2.6.52 → 2.6.55
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 +11 -6
- 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
|
@@ -13478,6 +13478,10 @@ async function persistSeed(seedFile, seedB64) {
|
|
|
13478
13478
|
} catch {
|
|
13479
13479
|
}
|
|
13480
13480
|
}
|
|
13481
|
+
var TEXT_MIME_TYPES = {
|
|
13482
|
+
".md": "text/markdown",
|
|
13483
|
+
".csv": "text/csv"
|
|
13484
|
+
};
|
|
13481
13485
|
var IMAGE_MIME_TYPES = {
|
|
13482
13486
|
".jpg": "image/jpeg",
|
|
13483
13487
|
".jpeg": "image/jpeg",
|
|
@@ -13493,14 +13497,14 @@ async function readOutboundAttachments(mediaUrls, source, client, groupId, log,
|
|
|
13493
13497
|
seen.add(url);
|
|
13494
13498
|
const filename = basename(url);
|
|
13495
13499
|
const ext = filename.substring(filename.lastIndexOf(".")).toLowerCase();
|
|
13496
|
-
if (ext
|
|
13500
|
+
if (ext in TEXT_MIME_TYPES) {
|
|
13497
13501
|
try {
|
|
13498
13502
|
const content = await readFile2(url, "utf-8");
|
|
13499
13503
|
if (content.length > 1024 * 1024) {
|
|
13500
13504
|
log?.warn?.(`[${accountId}] Quiubo: skipping ${filename} \u2014 exceeds 1MB`);
|
|
13501
13505
|
continue;
|
|
13502
13506
|
}
|
|
13503
|
-
attachments.push({ filename, mimeType:
|
|
13507
|
+
attachments.push({ filename, mimeType: TEXT_MIME_TYPES[ext], content, source });
|
|
13504
13508
|
} catch (err) {
|
|
13505
13509
|
log?.warn?.(`[${accountId}] Quiubo: failed to read ${url}: ${err}`);
|
|
13506
13510
|
}
|
|
@@ -14765,14 +14769,14 @@ async function routeInboundMessage(opts) {
|
|
|
14765
14769
|
const typingInterval = setInterval(sendTyping, 4e3);
|
|
14766
14770
|
const agentId = resolveAgentId(cfg, accountId);
|
|
14767
14771
|
const sessionKey = buildSessionKey(agentId, groupId);
|
|
14768
|
-
log?.info?.(`[${accountId}] [delivery:inbound] agentId=${agentId}, sessionKey=${sessionKey}, To=quiubo:${
|
|
14772
|
+
log?.info?.(`[${accountId}] [delivery:inbound] agentId=${agentId}, sessionKey=${sessionKey}, To=quiubo:${groupId}, ConversationLabel=quiubo:${groupId}`);
|
|
14769
14773
|
const ctxPayload = runtime2.channel.reply.finalizeInboundContext({
|
|
14770
14774
|
Body: text,
|
|
14771
14775
|
RawBody: text,
|
|
14772
14776
|
CommandBody: text,
|
|
14773
14777
|
CommandAuthorized: true,
|
|
14774
14778
|
From: `quiubo:${senderId}`,
|
|
14775
|
-
To: `quiubo:${
|
|
14779
|
+
To: `quiubo:${groupId}`,
|
|
14776
14780
|
SessionKey: sessionKey,
|
|
14777
14781
|
AccountId: accountId,
|
|
14778
14782
|
ChatType: "group",
|
|
@@ -14815,10 +14819,11 @@ async function routeInboundMessage(opts) {
|
|
|
14815
14819
|
const existingFilenames = new Set(outboundAttachments.map((a) => a.filename));
|
|
14816
14820
|
for (const m of payload.media) {
|
|
14817
14821
|
const filename = m.filename || m.name || "";
|
|
14818
|
-
|
|
14822
|
+
const inlineExt = filename.substring(filename.lastIndexOf(".")).toLowerCase();
|
|
14823
|
+
if (inlineExt in TEXT_MIME_TYPES && typeof m.content === "string" && !existingFilenames.has(filename)) {
|
|
14819
14824
|
outboundAttachments.push({
|
|
14820
14825
|
filename,
|
|
14821
|
-
mimeType:
|
|
14826
|
+
mimeType: TEXT_MIME_TYPES[inlineExt],
|
|
14822
14827
|
content: m.content,
|
|
14823
14828
|
source: agentSource
|
|
14824
14829
|
});
|