@searchfe/openclaw-baiduapp 0.1.0-beta.6 → 0.1.0-beta.8

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
@@ -53,12 +53,12 @@ openclaw plugins install @searchfe/openclaw-baiduapp
53
53
  ### 使用命令行配置
54
54
 
55
55
  ```bash
56
- openclaw config set channels.baidu-app.enabled true
57
- openclaw config set channels.baidu-app.webhookPath /baidu-app
58
- openclaw config set channels.baidu-app.token your-token
59
- openclaw config set channels.baidu-app.encodingAESKey your-43-char-encoding-aes-key
60
- openclaw config set channels.baidu-app.appKey your-app-key
61
- openclaw config set channels.baidu-app.appSecret your-app-secret
56
+ openclaw config set channels.openclaw-baiduapp.enabled true
57
+ openclaw config set channels.openclaw-baiduapp.webhookPath /openclaw-baiduapp
58
+ openclaw config set channels.openclaw-baiduapp.token your-token
59
+ openclaw config set channels.openclaw-baiduapp.encodingAESKey your-43-char-encoding-aes-key
60
+ openclaw config set channels.openclaw-baiduapp.appKey your-app-key
61
+ openclaw config set channels.openclaw-baiduapp.appSecret your-app-secret
62
62
  ```
63
63
 
64
64
  ### 或直接编辑配置文件
@@ -68,9 +68,9 @@ openclaw config set channels.baidu-app.appSecret your-app-secret
68
68
  ```json
69
69
  {
70
70
  "channels": {
71
- "baidu-app": {
71
+ "openclaw-baiduapp": {
72
72
  "enabled": true,
73
- "webhookPath": "/baidu-app",
73
+ "webhookPath": "/openclaw-baiduapp",
74
74
  "token": "your-token",
75
75
  "encodingAESKey": "your-43-char-encoding-aes-key",
76
76
  "appKey": "your-app-key",
@@ -130,7 +130,7 @@ openclaw gateway restart
130
130
  ```json
131
131
  {
132
132
  "channels": {
133
- "baidu-app": {
133
+ "openclaw-baiduapp": {
134
134
  "enabled": true,
135
135
  "dmPolicy": "open",
136
136
  "allowFrom": []
@@ -149,18 +149,18 @@ openclaw gateway restart
149
149
  ```json
150
150
  {
151
151
  "channels": {
152
- "baidu-app": {
152
+ "openclaw-baiduapp": {
153
153
  "enabled": true,
154
154
  "accounts": {
155
155
  "bot1": {
156
- "webhookPath": "/baidu-app-1",
156
+ "webhookPath": "/openclaw-baiduapp-1",
157
157
  "token": "token-1",
158
158
  "encodingAESKey": "key-1",
159
159
  "appKey": "app-key-1",
160
160
  "appSecret": "secret-1"
161
161
  },
162
162
  "bot2": {
163
- "webhookPath": "/baidu-app-2",
163
+ "webhookPath": "/openclaw-baiduapp-2",
164
164
  "token": "token-2",
165
165
  "encodingAESKey": "key-2",
166
166
  "appKey": "app-key-2",
@@ -196,8 +196,8 @@ openclaw gateway restart
196
196
  # 使用 user: 前缀
197
197
  send user:userId123 你好
198
198
 
199
- # 使用 baidu-app: 完整前缀
200
- send baidu-app:user:userId123 你好
199
+ # 使用 openclaw-baiduapp: 完整前缀
200
+ send openclaw-baiduapp:user:userId123 你好
201
201
 
202
202
  # 指定账户
203
203
  send user:userId123@bot1 你好
package/dist/index.d.ts CHANGED
@@ -34,10 +34,6 @@ interface ResolvedBaiduAppAccount {
34
34
  interface BaiduAppSendTarget {
35
35
  userId: string;
36
36
  }
37
- interface AccessTokenCacheEntry {
38
- token: string;
39
- expiresAt: number;
40
- }
41
37
  interface BaiduAppInboundBase {
42
38
  MsgId?: string;
43
39
  msgid?: string;
@@ -82,18 +78,18 @@ interface PluginConfig {
82
78
  store?: unknown;
83
79
  };
84
80
  channels?: {
85
- 'baidu-app'?: BaiduAppConfig;
81
+ 'openclaw-baiduapp'?: BaiduAppConfig;
86
82
  };
87
83
  }
88
84
 
89
85
  declare const baiduAppPlugin: {
90
86
  id: string;
91
87
  meta: {
92
- id: "baidu-app";
88
+ id: "openclaw-baiduapp";
93
89
  label: "Baidu App";
94
90
  selectionLabel: "Baidu Search AI (百度搜索对话式AI)";
95
- docsPath: "/channels/baidu-app";
96
- docsLabel: "baidu-app";
91
+ docsPath: "/channels/openclaw-baiduapp";
92
+ docsLabel: "openclaw-baiduapp";
97
93
  blurb: "百度搜索对话式AI,支持主动发送消息";
98
94
  aliases: readonly ["baidu-ai", "百度搜索AI"];
99
95
  order: 85;
@@ -273,6 +269,18 @@ declare const baiduAppPlugin: {
273
269
  messageId: string;
274
270
  error?: Error;
275
271
  }>;
272
+ sendMedia: (params: {
273
+ cfg: PluginConfig;
274
+ accountId?: string | null;
275
+ to: string;
276
+ text: string;
277
+ mediaUrl?: string;
278
+ }) => Promise<{
279
+ channel: string;
280
+ ok: boolean;
281
+ messageId: string;
282
+ error?: Error;
283
+ }>;
276
284
  };
277
285
  gateway: {
278
286
  startAccount: (ctx: {
@@ -385,9 +393,6 @@ interface PluginRuntime {
385
393
  declare function setBaiduAppRuntime(next: PluginRuntime): void;
386
394
  declare function getBaiduAppRuntime(): PluginRuntime;
387
395
 
388
- declare function getAccessToken(account: ResolvedBaiduAppAccount): Promise<string>;
389
- declare function clearAccessTokenCache(account: ResolvedBaiduAppAccount): void;
390
- declare function clearAllAccessTokenCache(): void;
391
396
  interface SendMessageResult {
392
397
  ok: boolean;
393
398
  errcode?: number;
@@ -431,4 +436,4 @@ declare const plugin: {
431
436
  register(api: MoltbotPluginApi): void;
432
437
  };
433
438
 
434
- export { type AccessTokenCacheEntry, type BaiduAppConfig, type BaiduAppDmPolicy, type BaiduAppInboundMessage, type BaiduAppSendTarget, DEFAULT_ACCOUNT_ID, type MoltbotPluginApi, type ResolvedBaiduAppAccount, type SendMessageOptions, type SendResult, baiduAppPlugin, clearAccessTokenCache, clearAllAccessTokenCache, plugin as default, getAccessToken, getBaiduAppRuntime, normalizeTarget, parseTarget, sendBaidu, sendBaiduAppMessage, sendBaiduDM, setBaiduAppRuntime };
439
+ export { type BaiduAppConfig, type BaiduAppDmPolicy, type BaiduAppInboundMessage, type BaiduAppSendTarget, DEFAULT_ACCOUNT_ID, type MoltbotPluginApi, type ResolvedBaiduAppAccount, type SendMessageOptions, type SendResult, baiduAppPlugin, plugin as default, getBaiduAppRuntime, normalizeTarget, parseTarget, sendBaidu, sendBaiduAppMessage, sendBaiduDM, setBaiduAppRuntime };