openclaw-quiubo 2.6.51 → 2.6.53

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
@@ -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 === ".md") {
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: "text/markdown", content, source });
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
  }
@@ -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
- if (filename.endsWith(".md") && typeof m.content === "string" && !existingFilenames.has(filename)) {
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: "text/markdown",
14826
+ mimeType: TEXT_MIME_TYPES[inlineExt],
14822
14827
  content: m.content,
14823
14828
  source: agentSource
14824
14829
  });