@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 CHANGED
@@ -24,7 +24,7 @@ openclaw plugins install @zbruceli/openclaw-dchat
24
24
  After installing, add the D-Chat channel:
25
25
 
26
26
  ```bash
27
- openclaw channels add dchat
27
+ openclaw channels add --channel dchat
28
28
  ```
29
29
 
30
30
  The onboarding wizard will prompt you for:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zbruceli/openclaw-dchat",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "OpenClaw D-Chat/nMobile channel plugin — decentralized E2E encrypted messaging over the NKN relay network",
5
5
  "type": "module",
6
6
  "main": "index.ts",
package/src/channel.ts CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  } from "openclaw/plugin-sdk";
13
13
  import {
14
14
  type CoreConfig,
15
- DchatConfigSchema,
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(DchatConfigSchema),
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: string | number) => String(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, "")),
@@ -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.union([z.string(), z.number()])).optional(),
31
+ allowFrom: z.array(z.string()).optional(),
32
32
  })
33
33
  .optional(),
34
34
  });
package/src/types.ts CHANGED
@@ -119,7 +119,7 @@ export interface DchatAccountConfig {
119
119
  enabled?: boolean;
120
120
  name?: string;
121
121
  dm?: {
122
- allowFrom?: Array<string | number>;
122
+ allowFrom?: string[];
123
123
  policy?: string;
124
124
  };
125
125
  }