@coolclaw/coolclaw 0.2.8 → 0.2.10

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.
@@ -0,0 +1,27 @@
1
+ type CoolclawDmPolicy = "allowlist" | "pairing" | "open";
2
+ type CoolclawAccountConfig = {
3
+ gatewayUrl: string;
4
+ agentId: string;
5
+ tokenSecretRef?: string;
6
+ allowFrom?: string[];
7
+ dmPolicy?: CoolclawDmPolicy;
8
+ };
9
+
10
+ /**
11
+ * CoolClaw 插件类型定义
12
+ *
13
+ * 仅保留 SDK 未覆盖的本地类型。SDK 导出的类型(OpenClawConfig、
14
+ * ChannelGatewayContext、PluginRuntime、OpenClawPluginApi 等)直接从
15
+ * openclaw/plugin-sdk/channel-core 导入使用。
16
+ */
17
+
18
+ /** 已解析的 CoolClaw 账户类型,包含运行时补充字段 */
19
+ type CoolclawAccount = Partial<CoolclawAccountConfig> & {
20
+ enabled?: boolean;
21
+ name?: string;
22
+ tokenSecret?: string;
23
+ /** ChannelPlugin 要求 TResolvedAccount 有 accountId 字段 */
24
+ accountId?: string | null;
25
+ };
26
+
27
+ export type { CoolclawAccount as C };
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "id": "coolclaw",
3
+ "name": "CoolClaw",
4
+ "description": "CoolClaw/Riddle messaging channel for OpenClaw",
3
5
  "channels": [
4
6
  "coolclaw"
5
7
  ],
@@ -16,6 +18,38 @@
16
18
  "configSchema": {
17
19
  "type": "object",
18
20
  "additionalProperties": false,
19
- "properties": {}
21
+ "properties": {
22
+ "gatewayUrl": {
23
+ "type": "string",
24
+ "format": "uri",
25
+ "description": "Riddle gateway URL"
26
+ },
27
+ "agentId": {
28
+ "type": "string",
29
+ "description": "Riddle agent ID"
30
+ },
31
+ "tokenSecretRef": {
32
+ "type": "string",
33
+ "description": "Token secret reference (file:// or env:)"
34
+ },
35
+ "allowFrom": {
36
+ "type": "array",
37
+ "items": { "type": "string" },
38
+ "description": "Allowed sender IDs"
39
+ },
40
+ "dmPolicy": {
41
+ "type": "string",
42
+ "enum": ["allowlist", "pairing", "open"],
43
+ "description": "DM access policy"
44
+ },
45
+ "enabled": {
46
+ "type": "boolean",
47
+ "description": "Whether the account is enabled"
48
+ },
49
+ "name": {
50
+ "type": "string",
51
+ "description": "Account display name"
52
+ }
53
+ }
20
54
  }
21
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolclaw/coolclaw",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "OpenClaw native channel plugin for Riddle/CoolClaw chat.",
5
5
  "type": "module",
6
6
  "files": [
@@ -35,12 +35,13 @@
35
35
  "devDependencies": {
36
36
  "@types/node": "latest",
37
37
  "@types/ws": "latest",
38
+ "openclaw": "^2026.4.20",
38
39
  "tsup": "latest",
39
40
  "typescript": "latest",
40
41
  "vitest": "latest"
41
42
  },
42
43
  "peerDependencies": {
43
- "openclaw": ">=2026.3.13"
44
+ "openclaw": ">=2026.3.22"
44
45
  },
45
46
  "peerDependenciesMeta": {
46
47
  "openclaw": {
@@ -49,32 +50,38 @@
49
50
  },
50
51
  "openclaw": {
51
52
  "extensions": [
52
- "./dist/index.js"
53
+ "./index.ts"
53
54
  ],
54
55
  "runtimeExtensions": [
55
56
  "./dist/index.js"
56
57
  ],
57
- "setupEntry": "./dist/setup-entry.js",
58
+ "setupEntry": "./setup-entry.ts",
58
59
  "runtimeSetupEntry": "./dist/setup-entry.js",
59
60
  "install": {
60
61
  "npmSpec": "@coolclaw/coolclaw",
61
- "expectedIntegrity": "sha512-1zkD5jn6OHxKt75Aa9OnsK8R1oRn2FEbAcqwANHRfs+DgC0cF5ZjagaRWHqXZR+z7GTYANs+rHSnUYB6LqmECg==",
62
+ "expectedIntegrity": "sha512-hM6T+tp47hQIsrM6MU4xBtN8KBmCEyCZ+OsPlxTiHgrFqNTtg46amuBHsDJhG/2m9xEg/PbVFRGX89Wi3yp69Q==",
62
63
  "defaultChoice": "npm",
63
- "minHostVersion": ">=2026.3.13"
64
+ "minHostVersion": ">=2026.3.22"
64
65
  },
65
66
  "channel": {
66
67
  "id": "coolclaw",
67
68
  "label": "CoolClaw",
68
69
  "docsPath": "/plugins/coolclaw",
69
- "blurb": "Connect OpenClaw to the CoolClaw/Riddle chat platform."
70
+ "blurb": "Connect OpenClaw to the CoolClaw/Riddle chat platform.",
71
+ "markdownCapable": true,
72
+ "exposure": {
73
+ "configured": true,
74
+ "setup": true,
75
+ "docs": true
76
+ }
70
77
  },
71
78
  "compat": {
72
- "pluginApi": ">=2026.3.13",
73
- "minGatewayVersion": "2026.3.13"
79
+ "pluginApi": ">=2026.3.22",
80
+ "minGatewayVersion": "2026.3.22"
74
81
  },
75
82
  "build": {
76
83
  "openclawVersion": "2026.4.20",
77
84
  "pluginSdkVersion": "2026.4.29"
78
85
  }
79
86
  }
80
- }
87
+ }
@@ -1,115 +0,0 @@
1
- type CoolclawDmPolicy = "allowlist" | "pairing" | "open";
2
- type CoolclawAccountConfig = {
3
- gatewayUrl: string;
4
- agentId: string;
5
- tokenSecretRef?: string;
6
- allowFrom?: string[];
7
- dmPolicy?: CoolclawDmPolicy;
8
- };
9
-
10
- type CoolclawStatus = {
11
- configured: boolean;
12
- connected: false;
13
- message: string;
14
- diagnostics: string;
15
- };
16
-
17
- type CoolclawOpenClawTargetKind = "user" | "group" | "channel";
18
-
19
- type OpenClawConfigLike = {
20
- channels?: {
21
- coolclaw?: {
22
- accounts?: Record<string, Partial<CoolclawAccountConfig> & {
23
- enabled?: boolean;
24
- name?: string;
25
- tokenSecret?: string;
26
- }>;
27
- };
28
- };
29
- };
30
- type CoolclawAccount = Partial<CoolclawAccountConfig> & {
31
- enabled?: boolean;
32
- name?: string;
33
- tokenSecret?: string;
34
- };
35
- type CoolclawChannelPlugin = {
36
- id: "coolclaw";
37
- meta: {
38
- id: "coolclaw";
39
- label: "CoolClaw";
40
- selectionLabel: string;
41
- docsPath: string;
42
- blurb: string;
43
- };
44
- channels: ["coolclaw"];
45
- channel: {
46
- id: "coolclaw";
47
- label: "CoolClaw";
48
- docsPath: "/plugins/coolclaw";
49
- blurb: string;
50
- };
51
- capabilities: {
52
- chatTypes: string[];
53
- };
54
- config: {
55
- listAccountIds: (cfg: OpenClawConfigLike) => string[];
56
- resolveAccount: (cfg: OpenClawConfigLike, accountId?: string | null) => CoolclawAccount;
57
- defaultAccountId: () => string;
58
- isConfigured: (account: CoolclawAccount) => boolean;
59
- isEnabled: (account: CoolclawAccount | undefined) => boolean;
60
- describeAccount: (account: CoolclawAccount) => Record<string, unknown>;
61
- };
62
- resolver: {
63
- resolveTargets: (params: {
64
- inputs: string[];
65
- kind: "user" | "group";
66
- }) => Promise<Array<Record<string, unknown>>>;
67
- };
68
- messaging: {
69
- normalizeTarget: (raw: string) => string | undefined;
70
- inferTargetChatType: (params: {
71
- to: string;
72
- }) => "direct" | "group" | undefined;
73
- targetResolver: {
74
- looksLikeId: (raw: string, normalized?: string) => boolean;
75
- hint: string;
76
- resolveTarget: (params: {
77
- cfg?: OpenClawConfigLike;
78
- accountId?: string | null;
79
- input: string;
80
- normalized: string;
81
- preferredKind?: CoolclawOpenClawTargetKind;
82
- }) => Promise<{
83
- to: string;
84
- kind: CoolclawOpenClawTargetKind;
85
- display?: string;
86
- source?: "normalized" | "directory";
87
- } | null>;
88
- };
89
- };
90
- outbound: {
91
- deliveryMode: "direct";
92
- resolveTarget: (params: {
93
- to?: string;
94
- }) => {
95
- ok: true;
96
- to: string;
97
- } | {
98
- ok: false;
99
- error: Error;
100
- };
101
- sendText: (ctx: {
102
- cfg: OpenClawConfigLike;
103
- accountId?: string | null;
104
- to: string;
105
- text: string;
106
- }) => Promise<Record<string, unknown>>;
107
- };
108
- status: (source?: unknown) => CoolclawStatus;
109
- gateway: {
110
- startAccount: (ctx: any) => Promise<unknown>;
111
- };
112
- };
113
- declare const coolclawChannelPlugin: CoolclawChannelPlugin;
114
-
115
- export { coolclawChannelPlugin as c };