@openclaw/qqbot 2026.7.1 → 2026.7.2-beta.2

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.
Files changed (41) hide show
  1. package/dist/api.js +8 -7
  2. package/dist/{channel-entry-C5YdhX3Y.js → channel-entry-CA2T2sf8.js} +4 -4
  3. package/dist/channel-entry-api.js +1 -1
  4. package/dist/{channel-D1UztsnG.js → channel-nz3Mkify.js} +99 -54
  5. package/dist/channel-plugin-api.js +1 -1
  6. package/dist/{channel.setup-2ItDYKhz.js → channel.setup-CNoBtKXQ.js} +1 -1
  7. package/dist/{config-C1qZbh0K.js → config-CpOXnoEc.js} +2 -2
  8. package/dist/{config-schema-JZEf1dvB.js → config-schema-D7MaH5X5.js} +61 -76
  9. package/dist/doctor-contract-api.js +4 -10
  10. package/dist/{gateway-pJQppxe4.js → gateway-D8uYPtoy.js} +286 -174
  11. package/dist/{group-o0GmovSf.js → group-BVHG8qUZ.js} +40 -23
  12. package/dist/{handler-runtime-zQvT6SrI.js → handler-runtime-S1_XF8on.js} +8 -12
  13. package/dist/{log-DEtcoDWe.js → log-Da4jz75I.js} +4 -8
  14. package/dist/{outbound-BIrfvvFJ.js → outbound-FOG4zNLY.js} +8 -142
  15. package/dist/{runtime-DodcT_fQ.js → runtime-CyjBiGD2.js} +2 -2
  16. package/dist/runtime-api.js +1 -1
  17. package/dist/secret-contract-api.js +6 -22
  18. package/dist/{sender-CjDuU-uz.js → sender-BAUHZqDW.js} +225 -66
  19. package/dist/setup-plugin-api.js +1 -1
  20. package/dist/state-keys-jLJ2SmJA.js +225 -0
  21. package/dist/{tools-UJJ-tLHP.js → tools-CC5CKQig.js} +71 -26
  22. package/dist/tools-api.js +1 -1
  23. package/node_modules/p-map/index.d.ts +155 -0
  24. package/node_modules/p-map/index.js +284 -0
  25. package/node_modules/p-map/license +9 -0
  26. package/node_modules/p-map/package.json +57 -0
  27. package/node_modules/p-map/readme.md +190 -0
  28. package/node_modules/parse-ms/index.d.ts +30 -0
  29. package/node_modules/parse-ms/index.js +45 -0
  30. package/node_modules/parse-ms/license +9 -0
  31. package/node_modules/parse-ms/package.json +47 -0
  32. package/node_modules/parse-ms/readme.md +46 -0
  33. package/node_modules/pretty-ms/index.d.ts +157 -0
  34. package/node_modules/pretty-ms/index.js +149 -0
  35. package/node_modules/pretty-ms/license +9 -0
  36. package/node_modules/pretty-ms/package.json +55 -0
  37. package/node_modules/pretty-ms/readme.md +179 -0
  38. package/npm-shrinkwrap.json +44 -3
  39. package/openclaw.plugin.json +105 -133
  40. package/package.json +8 -4
  41. package/dist/state-keys-CQKlAFyo.js +0 -141
@@ -1,141 +0,0 @@
1
- import crypto from "node:crypto";
2
- import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor";
3
- //#region extensions/qqbot/src/doctor-contract.ts
4
- const RESTRICTED_GROUP_TOOLS = { deny: [
5
- "exec",
6
- "read",
7
- "write"
8
- ] };
9
- function hasLegacyGroupToolPolicy(value) {
10
- const groups = asObjectRecord(value);
11
- if (!groups) return false;
12
- return Object.values(groups).some((group) => asObjectRecord(group)?.toolPolicy !== void 0);
13
- }
14
- function hasLegacyAccountGroupToolPolicy(value) {
15
- const accounts = asObjectRecord(value);
16
- if (!accounts) return false;
17
- return Object.values(accounts).some((account) => hasLegacyGroupToolPolicy(asObjectRecord(account)?.groups));
18
- }
19
- function migrateToolPolicy(value) {
20
- if (value === "none") return { deny: ["*"] };
21
- if (value === "full") return { allow: [] };
22
- if (value === "restricted") return { ...RESTRICTED_GROUP_TOOLS };
23
- }
24
- function describeToolPolicy(value) {
25
- return typeof value === "string" ? value : String(value);
26
- }
27
- function migrateGroups(params) {
28
- let changed = false;
29
- const nextGroups = { ...params.groups };
30
- for (const [groupId, rawGroup] of Object.entries(params.groups)) {
31
- const group = asObjectRecord(rawGroup);
32
- if (!group || group.toolPolicy === void 0) continue;
33
- const { toolPolicy, ...rest } = group;
34
- const nextGroup = { ...rest };
35
- const policy = migrateToolPolicy(toolPolicy);
36
- const path = `${params.pathPrefix}.${groupId}`;
37
- if (nextGroup.tools !== void 0) params.changes.push(`Removed ${path}.toolPolicy (${path}.tools already exists).`);
38
- else if (policy) {
39
- nextGroup.tools = policy;
40
- params.changes.push(`Moved ${path}.toolPolicy=${describeToolPolicy(toolPolicy)} to ${path}.tools.`);
41
- } else params.changes.push(`Removed unsupported ${path}.toolPolicy=${describeToolPolicy(toolPolicy)}.`);
42
- nextGroups[groupId] = nextGroup;
43
- changed = true;
44
- }
45
- return {
46
- groups: nextGroups,
47
- changed
48
- };
49
- }
50
- const legacyConfigRules = [{
51
- path: [
52
- "channels",
53
- "qqbot",
54
- "groups"
55
- ],
56
- message: "channels.qqbot.groups.<id>.toolPolicy is legacy and was ignored by QQBot group tool enforcement; use channels.qqbot.groups.<id>.tools instead. Run \"openclaw doctor --fix\".",
57
- match: hasLegacyGroupToolPolicy
58
- }, {
59
- path: [
60
- "channels",
61
- "qqbot",
62
- "accounts"
63
- ],
64
- message: "channels.qqbot.accounts.<id>.groups.<groupId>.toolPolicy is legacy and was ignored by QQBot group tool enforcement; use channels.qqbot.accounts.<id>.groups.<groupId>.tools instead. Run \"openclaw doctor --fix\".",
65
- match: hasLegacyAccountGroupToolPolicy
66
- }];
67
- function normalizeCompatibilityConfig({ cfg }) {
68
- const rawEntry = asObjectRecord(cfg.channels?.qqbot);
69
- if (!rawEntry) return {
70
- config: cfg,
71
- changes: []
72
- };
73
- const changes = [];
74
- let updated = rawEntry;
75
- let changed = false;
76
- const groups = asObjectRecord(updated.groups);
77
- if (groups) {
78
- const migrated = migrateGroups({
79
- groups,
80
- pathPrefix: "channels.qqbot.groups",
81
- changes
82
- });
83
- if (migrated.changed) {
84
- updated = {
85
- ...updated,
86
- groups: migrated.groups
87
- };
88
- changed = true;
89
- }
90
- }
91
- const accounts = asObjectRecord(updated.accounts);
92
- if (accounts) {
93
- let accountsChanged = false;
94
- const nextAccounts = { ...accounts };
95
- for (const [accountId, rawAccount] of Object.entries(accounts)) {
96
- const account = asObjectRecord(rawAccount);
97
- const accountGroups = asObjectRecord(account?.groups);
98
- if (!account || !accountGroups) continue;
99
- const migrated = migrateGroups({
100
- groups: accountGroups,
101
- pathPrefix: `channels.qqbot.accounts.${accountId}.groups`,
102
- changes
103
- });
104
- if (migrated.changed) {
105
- nextAccounts[accountId] = {
106
- ...account,
107
- groups: migrated.groups
108
- };
109
- accountsChanged = true;
110
- }
111
- }
112
- if (accountsChanged) {
113
- updated = {
114
- ...updated,
115
- accounts: nextAccounts
116
- };
117
- changed = true;
118
- }
119
- }
120
- if (!changed) return {
121
- config: cfg,
122
- changes: []
123
- };
124
- return {
125
- config: {
126
- ...cfg,
127
- channels: {
128
- ...cfg.channels,
129
- qqbot: updated
130
- }
131
- },
132
- changes
133
- };
134
- }
135
- //#endregion
136
- //#region extensions/qqbot/src/engine/utils/state-keys.ts
137
- function buildQQBotStateKey(...parts) {
138
- return crypto.createHash("sha256").update(JSON.stringify(parts)).digest("hex");
139
- }
140
- //#endregion
141
- export { legacyConfigRules as n, normalizeCompatibilityConfig as r, buildQQBotStateKey as t };