gewe-openclaw 2026.3.13 → 2026.3.23
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/README.md +455 -3
- package/index.ts +39 -1
- package/package.json +12 -1
- package/skills/gewe-agent-tools/SKILL.md +113 -0
- package/skills/gewe-channel-rules/SKILL.md +7 -0
- package/src/accounts.ts +51 -5
- package/src/api-tools.ts +1264 -0
- package/src/api.ts +37 -2
- package/src/binary-command.ts +65 -0
- package/src/channel-actions.ts +536 -0
- package/src/channel-allowlist.ts +150 -0
- package/src/channel-directory.ts +419 -0
- package/src/channel-status.ts +186 -0
- package/src/channel.ts +155 -58
- package/src/config-edit.ts +94 -0
- package/src/config-schema.ts +78 -3
- package/src/contacts-api.ts +113 -0
- package/src/delivery.ts +502 -62
- package/src/directory-cache.ts +164 -0
- package/src/gewe-account-api.ts +27 -0
- package/src/group-allowlist-tool.ts +242 -0
- package/src/group-binding-tool.ts +154 -0
- package/src/group-binding.ts +405 -0
- package/src/groups-api.ts +146 -0
- package/src/inbound-batch.ts +5 -2
- package/src/inbound.ts +248 -41
- package/src/media-server.ts +73 -93
- package/src/moments-api.ts +138 -0
- package/src/monitor.ts +81 -24
- package/src/onboarding.ts +9 -4
- package/src/openclaw-compat.ts +1070 -0
- package/src/pairing-store.ts +478 -0
- package/src/personal-api.ts +45 -0
- package/src/policy.ts +130 -22
- package/src/quote-context-cache.ts +97 -0
- package/src/reply-options.ts +101 -2
- package/src/s3.ts +1 -1
- package/src/send.ts +235 -16
- package/src/setup-wizard-types.ts +162 -0
- package/src/setup-wizard.ts +464 -0
- package/src/silk.ts +2 -1
- package/src/state-paths.ts +55 -14
- package/src/types.ts +66 -7
- package/src/xml.ts +158 -0
package/src/accounts.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
-
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw
|
|
3
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "./openclaw-compat.js";
|
|
4
4
|
|
|
5
5
|
import { CHANNEL_CONFIG_KEY } from "./constants.js";
|
|
6
6
|
import type { CoreConfig, GeweAccountConfig, GeweAppIdSource, GeweTokenSource } from "./types.js";
|
|
@@ -29,10 +29,47 @@ function listConfiguredAccountIds(cfg: CoreConfig): string[] {
|
|
|
29
29
|
return [...ids];
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export function mergeGeweGroups(
|
|
33
|
+
baseGroups?: GeweAccountConfig["groups"],
|
|
34
|
+
accountGroups?: GeweAccountConfig["groups"],
|
|
35
|
+
): GeweAccountConfig["groups"] | undefined {
|
|
36
|
+
const merged = { ...(baseGroups ?? {}) };
|
|
37
|
+
for (const [key, value] of Object.entries(accountGroups ?? {})) {
|
|
38
|
+
merged[key] = merged[key] ? { ...merged[key], ...value } : value;
|
|
39
|
+
}
|
|
40
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function mergeGeweDms(
|
|
44
|
+
baseDms?: GeweAccountConfig["dms"],
|
|
45
|
+
accountDms?: GeweAccountConfig["dms"],
|
|
46
|
+
): GeweAccountConfig["dms"] | undefined {
|
|
47
|
+
const merged = { ...(baseDms ?? {}) };
|
|
48
|
+
for (const [key, value] of Object.entries(accountDms ?? {})) {
|
|
49
|
+
merged[key] = merged[key] ? { ...merged[key], ...value } : value;
|
|
50
|
+
}
|
|
51
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function hasTopLevelDefaultAccount(cfg: CoreConfig): boolean {
|
|
55
|
+
const section = cfg.channels?.[CHANNEL_CONFIG_KEY];
|
|
56
|
+
const hasEnvCredentials = Boolean(
|
|
57
|
+
process.env.GEWE_TOKEN?.trim() || process.env.GEWE_APP_ID?.trim(),
|
|
58
|
+
);
|
|
59
|
+
if (!section || typeof section !== "object") return hasEnvCredentials;
|
|
60
|
+
return (
|
|
61
|
+
hasEnvCredentials ||
|
|
62
|
+
Object.keys(section).some((key) => key !== "accounts" && key !== "enabled")
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
32
66
|
export function listGeweAccountIds(cfg: CoreConfig): string[] {
|
|
33
|
-
const ids = listConfiguredAccountIds(cfg);
|
|
34
|
-
if (
|
|
35
|
-
|
|
67
|
+
const ids = new Set(listConfiguredAccountIds(cfg));
|
|
68
|
+
if (hasTopLevelDefaultAccount(cfg)) {
|
|
69
|
+
ids.add(DEFAULT_ACCOUNT_ID);
|
|
70
|
+
}
|
|
71
|
+
if (ids.size === 0) return [DEFAULT_ACCOUNT_ID];
|
|
72
|
+
return [...ids].sort((a, b) => a.localeCompare(b));
|
|
36
73
|
}
|
|
37
74
|
|
|
38
75
|
export function resolveDefaultGeweAccountId(cfg: CoreConfig): string {
|
|
@@ -56,7 +93,16 @@ function mergeGeweAccountConfig(cfg: CoreConfig, accountId: string): GeweAccount
|
|
|
56
93
|
accounts?: unknown;
|
|
57
94
|
};
|
|
58
95
|
const account = resolveAccountConfig(cfg, accountId) ?? {};
|
|
59
|
-
|
|
96
|
+
const merged = { ...base, ...account };
|
|
97
|
+
const groups = mergeGeweGroups(base.groups, account.groups);
|
|
98
|
+
if (groups) {
|
|
99
|
+
merged.groups = groups;
|
|
100
|
+
}
|
|
101
|
+
const dms = mergeGeweDms(base.dms, account.dms);
|
|
102
|
+
if (dms) {
|
|
103
|
+
merged.dms = dms;
|
|
104
|
+
}
|
|
105
|
+
return merged;
|
|
60
106
|
}
|
|
61
107
|
|
|
62
108
|
function resolveToken(
|