@openclaw/qqbot 2026.7.1-beta.1 → 2026.7.1-beta.4

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,10 +1,11 @@
1
1
  import { t as asOptionalObjectRecord } from "./string-normalize-R_0cKO7Q.js";
2
2
  import { d as resolveAccountBase } from "./config-C1qZbh0K.js";
3
- import { n as debugLog } from "./log-SDfMMBWe.js";
4
- import { A as getHomeDir, I as isWindows, N as getQQBotMediaPath, j as getQQBotDataDir } from "./outbound-Dfa2uOEp.js";
3
+ import { n as debugLog } from "./log-DEtcoDWe.js";
4
+ import { I as getQQBotMediaPath, N as getHomeDir, P as getQQBotDataDir, z as isWindows } from "./outbound-BIrfvvFJ.js";
5
5
  import { asBoolean, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
8
+ import { formatByteSize } from "openclaw/plugin-sdk/number-runtime";
8
9
  import { clearRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
9
10
  import { loadJsonFile } from "openclaw/plugin-sdk/json-store";
10
11
  //#region extensions/qqbot/src/engine/commands/builtin/state.ts
@@ -321,10 +322,12 @@ function scanDirectoryFiles(dirPath) {
321
322
  return files;
322
323
  }
323
324
  function formatBytes(bytes) {
324
- if (bytes < 1024) return `${bytes} B`;
325
- if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
326
- if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
327
- return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
325
+ return formatByteSize(bytes, {
326
+ style: "legacy-binary",
327
+ maxUnit: "giga",
328
+ separator: " ",
329
+ fractionDigits: (_value, unit) => unit === "byte" ? null : 1
330
+ });
328
331
  }
329
332
  function removeEmptyDirs(dirPath) {
330
333
  if (!fs.existsSync(dirPath)) return;
@@ -549,7 +552,7 @@ function collectCandidateLogDirs() {
549
552
  pushDir(path.join(homeDir, name));
550
553
  pushDir(path.join(homeDir, name, "logs"));
551
554
  }
552
- const searchRoots = new Set([
555
+ const searchRoots = /* @__PURE__ */ new Set([
553
556
  homeDir,
554
557
  process.cwd(),
555
558
  path.dirname(process.cwd())
@@ -880,14 +883,14 @@ function registerBuiltinSlashCommands(registry) {
880
883
  //#endregion
881
884
  //#region extensions/qqbot/src/engine/commands/command-visibility.ts
882
885
  const PRIVATE_CHAT_ONLY_TEXT = "该命令仅限私聊使用,请在私聊中发送。";
883
- const GROUP_VISIBLE_CORE_COMMANDS = new Set([
886
+ const GROUP_VISIBLE_CORE_COMMANDS = /* @__PURE__ */ new Set([
884
887
  "help",
885
888
  "btw",
886
889
  "side",
887
890
  "stop"
888
891
  ]);
889
- const STRICT_CORE_COMMANDS = new Set(["new", "reset"]);
890
- const GROUP_HIDDEN_CORE_COMMANDS = new Set([
892
+ const STRICT_CORE_COMMANDS = /* @__PURE__ */ new Set(["new", "reset"]);
893
+ const GROUP_HIDDEN_CORE_COMMANDS = /* @__PURE__ */ new Set([
891
894
  "goal",
892
895
  "usage",
893
896
  "activation",
@@ -904,7 +907,7 @@ const GROUP_HIDDEN_CORE_COMMANDS = new Set([
904
907
  "reason",
905
908
  "queue"
906
909
  ]);
907
- const PRIVATE_ONLY_CORE_COMMANDS = new Set([
910
+ const PRIVATE_ONLY_CORE_COMMANDS = /* @__PURE__ */ new Set([
908
911
  "commands",
909
912
  "tools",
910
913
  "skill",
@@ -1,6 +1,6 @@
1
- import { c as getMessageApi, t as accountToCreds } from "./sender-BHWpE_yH.js";
2
- import { o as ensurePlatformAdapter, s as getBridgeLogger } from "./config-schema-gMW9zKvQ.js";
3
- import { c as resolveQQBotExecApprovalConfig, d as buildExecApprovalText, f as buildPluginApprovalText, l as shouldHandleQQBotExecApprovalRequest, m as resolveApprovalTarget, o as isQQBotExecApprovalClientEnabled, s as matchesQQBotApprovalAccount, u as buildApprovalKeyboard } from "./channel-Bh0MrYvU.js";
1
+ import { c as getMessageApi, t as accountToCreds } from "./sender-CjDuU-uz.js";
2
+ import { o as ensurePlatformAdapter, s as getBridgeLogger } from "./config-schema-JZEf1dvB.js";
3
+ import { c as resolveQQBotExecApprovalConfig, d as buildExecApprovalText, f as buildPluginApprovalText, l as shouldHandleQQBotExecApprovalRequest, m as resolveApprovalTarget, o as isQQBotExecApprovalClientEnabled, s as matchesQQBotApprovalAccount, u as buildApprovalKeyboard } from "./channel-D1UztsnG.js";
4
4
  import { a as resolveQQBotAccount } from "./config-C1qZbh0K.js";
5
5
  import { resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
6
6
  import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
@@ -1,3 +1,4 @@
1
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
1
2
  //#region extensions/qqbot/src/engine/utils/format.ts
2
3
  /**
3
4
  * General formatting and string utilities.
@@ -22,7 +23,7 @@ function formatErrorMessage(err) {
22
23
  if (err instanceof Error) {
23
24
  let formatted = err.message || err.name || "Error";
24
25
  let cause = err.cause;
25
- const seen = new Set([err]);
26
+ const seen = /* @__PURE__ */ new Set([err]);
26
27
  while (cause && !seen.has(cause)) {
27
28
  seen.add(cause);
28
29
  if (cause instanceof Error) {
@@ -59,8 +60,6 @@ function formatDuration(durationMs) {
59
60
  *
60
61
  * Only outputs when the QQBOT_DEBUG environment variable is set,
61
62
  * preventing user message content from leaking in production logs.
62
- *
63
- * Self-contained within engine/ — no framework SDK dependency.
64
63
  */
65
64
  function isQqbotDebugEnabled() {
66
65
  const value = process.env.QQBOT_DEBUG;
@@ -86,7 +85,7 @@ function sanitizeDebugLogValue(value) {
86
85
  }
87
86
  const sanitized = text.replace(/\p{Cc}/gu, " ").replace(/\s+/g, " ").trim();
88
87
  if (sanitized.length <= MAX_LOG_VALUE_CHARS) return sanitized;
89
- return `${sanitized.slice(0, MAX_LOG_VALUE_CHARS)}...`;
88
+ return `${truncateUtf16Safe(sanitized, MAX_LOG_VALUE_CHARS)}...`;
90
89
  }
91
90
  function formatDebugLogArgs(args) {
92
91
  return args.map(sanitizeDebugLogValue).join(" ");