@zbruceli/openclaw-dchat 0.1.1 → 0.1.3
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 +1 -1
- package/package.json +1 -1
- package/src/channel.ts +3 -3
- package/src/config-schema.ts +2 -2
- package/src/types.ts +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "openclaw/plugin-sdk";
|
|
13
13
|
import {
|
|
14
14
|
type CoreConfig,
|
|
15
|
-
|
|
15
|
+
dchatAccountSchema,
|
|
16
16
|
listDchatAccountIds,
|
|
17
17
|
resolveDchatAccount,
|
|
18
18
|
resolveDchatAccountConfig,
|
|
@@ -66,7 +66,7 @@ export const dchatPlugin: ChannelPlugin<ResolvedDchatAccount> = {
|
|
|
66
66
|
polls: false,
|
|
67
67
|
},
|
|
68
68
|
reload: { configPrefixes: ["channels.dchat"] },
|
|
69
|
-
configSchema: buildChannelConfigSchema(
|
|
69
|
+
configSchema: buildChannelConfigSchema(dchatAccountSchema),
|
|
70
70
|
pairing: {
|
|
71
71
|
idLabel: "nknAddress",
|
|
72
72
|
normalizeAllowEntry: (entry) => entry.replace(/^dchat:/i, ""),
|
|
@@ -106,7 +106,7 @@ export const dchatPlugin: ChannelPlugin<ResolvedDchatAccount> = {
|
|
|
106
106
|
}),
|
|
107
107
|
resolveAllowFrom: ({ cfg, accountId }) => {
|
|
108
108
|
const dchatConfig = resolveDchatAccountConfig({ cfg: cfg as CoreConfig, accountId });
|
|
109
|
-
return (dchatConfig.dm?.allowFrom ?? []).map((entry
|
|
109
|
+
return (dchatConfig.dm?.allowFrom ?? []).map((entry) => String(entry));
|
|
110
110
|
},
|
|
111
111
|
formatAllowFrom: ({ allowFrom }) =>
|
|
112
112
|
allowFrom.map((entry) => String(entry).replace(/^dchat:/i, "")),
|
package/src/config-schema.ts
CHANGED
|
@@ -17,7 +17,7 @@ const DEFAULT_ACCOUNT_ID = "default";
|
|
|
17
17
|
|
|
18
18
|
/* ── Zod config schema (powers web UI form via buildChannelConfigSchema) ── */
|
|
19
19
|
|
|
20
|
-
const dchatAccountSchema = z.object({
|
|
20
|
+
export const dchatAccountSchema = z.object({
|
|
21
21
|
name: z.string().optional(),
|
|
22
22
|
enabled: z.boolean().optional(),
|
|
23
23
|
seed: z.string().optional(),
|
|
@@ -28,7 +28,7 @@ const dchatAccountSchema = z.object({
|
|
|
28
28
|
dm: z
|
|
29
29
|
.object({
|
|
30
30
|
policy: z.enum(["pairing", "allowlist", "open", "disabled"]).optional(),
|
|
31
|
-
allowFrom: z.array(z.
|
|
31
|
+
allowFrom: z.array(z.string()).optional(),
|
|
32
32
|
})
|
|
33
33
|
.optional(),
|
|
34
34
|
});
|