moltbot-feishu 0.1.0
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/LICENSE +21 -0
- package/README.md +99 -0
- package/clawdbot.plugin.json +33 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/src/accounts.d.ts +17 -0
- package/dist/src/accounts.d.ts.map +1 -0
- package/dist/src/accounts.js +81 -0
- package/dist/src/accounts.js.map +1 -0
- package/dist/src/channel.d.ts +8 -0
- package/dist/src/channel.d.ts.map +1 -0
- package/dist/src/channel.js +373 -0
- package/dist/src/channel.js.map +1 -0
- package/dist/src/config-schema.d.ts +157 -0
- package/dist/src/config-schema.d.ts.map +1 -0
- package/dist/src/config-schema.js +21 -0
- package/dist/src/config-schema.js.map +1 -0
- package/dist/src/dedup.d.ts +8 -0
- package/dist/src/dedup.d.ts.map +1 -0
- package/dist/src/dedup.js +25 -0
- package/dist/src/dedup.js.map +1 -0
- package/dist/src/group-filter.d.ts +15 -0
- package/dist/src/group-filter.d.ts.map +1 -0
- package/dist/src/group-filter.js +44 -0
- package/dist/src/group-filter.js.map +1 -0
- package/dist/src/media.d.ts +21 -0
- package/dist/src/media.d.ts.map +1 -0
- package/dist/src/media.js +133 -0
- package/dist/src/media.js.map +1 -0
- package/dist/src/onboarding.d.ts +51 -0
- package/dist/src/onboarding.d.ts.map +1 -0
- package/dist/src/onboarding.js +213 -0
- package/dist/src/onboarding.js.map +1 -0
- package/dist/src/probe.d.ts +10 -0
- package/dist/src/probe.d.ts.map +1 -0
- package/dist/src/probe.js +48 -0
- package/dist/src/probe.js.map +1 -0
- package/dist/src/receive.d.ts +25 -0
- package/dist/src/receive.d.ts.map +1 -0
- package/dist/src/receive.js +217 -0
- package/dist/src/receive.js.map +1 -0
- package/dist/src/runtime.d.ts +7 -0
- package/dist/src/runtime.d.ts.map +1 -0
- package/dist/src/runtime.js +14 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/send.d.ts +23 -0
- package/dist/src/send.d.ts.map +1 -0
- package/dist/src/send.js +158 -0
- package/dist/src/send.js.map +1 -0
- package/dist/src/status-issues.d.ts +7 -0
- package/dist/src/status-issues.d.ts.map +1 -0
- package/dist/src/status-issues.js +48 -0
- package/dist/src/status-issues.js.map +1 -0
- package/dist/src/types.d.ts +62 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +5 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +93 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alex Yang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# moltbot-feishu
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/moltbot-feishu)
|
|
4
|
+
|
|
5
|
+
让你的 AI 助手接入飞书,一行命令搞定。
|
|
6
|
+
|
|
7
|
+
## 特点
|
|
8
|
+
|
|
9
|
+
- **无需服务器** — 基于 WebSocket,本地运行即可
|
|
10
|
+
- **私聊+群聊** — 都支持,群里@机器人或直接提问
|
|
11
|
+
- **图片文件** — 收发都行
|
|
12
|
+
- **多账号** — 可以同时接多个飞书机器人
|
|
13
|
+
|
|
14
|
+
## 快速开始
|
|
15
|
+
|
|
16
|
+
### 1. 创建飞书机器人
|
|
17
|
+
|
|
18
|
+
1. 打开 [飞书开放平台](https://open.feishu.cn/app) → 创建企业自建应用
|
|
19
|
+
2. 添加「机器人」能力
|
|
20
|
+
3. 权限配置,开启:
|
|
21
|
+
- `im:message`(发消息)
|
|
22
|
+
- `im:message.group_at_msg`(群聊@消息)
|
|
23
|
+
- `im:message.p2p_msg`(私聊消息)
|
|
24
|
+
4. 事件订阅 → 添加 `im.message.receive_v1` → 选择「**使用长连接接收事件**」
|
|
25
|
+
5. 版本管理 → 创建版本 → 申请上线
|
|
26
|
+
6. 记下 **App ID**(cli_xxx)和 **App Secret**
|
|
27
|
+
|
|
28
|
+
### 2. 安装插件
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
clawdbot plugins install moltbot-feishu
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. 配置
|
|
35
|
+
|
|
36
|
+
运行向导:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
clawdbot setup feishu
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
或者直接编辑 `clawdbot.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"channels": {
|
|
47
|
+
"feishu": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"appId": "cli_你的AppID",
|
|
50
|
+
"appSecret": "你的AppSecret"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4. 启动
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
clawdbot gateway restart
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
去飞书找你的机器人聊天吧 🎉
|
|
63
|
+
|
|
64
|
+
## 群聊说明
|
|
65
|
+
|
|
66
|
+
在群里,机器人不会回复每条消息(避免刷屏)。它只在以下情况回复:
|
|
67
|
+
|
|
68
|
+
- 被 @
|
|
69
|
+
- 消息以问号结尾
|
|
70
|
+
- 消息包含"帮"、"请"、"怎么"等求助词
|
|
71
|
+
|
|
72
|
+
## 常见问题
|
|
73
|
+
|
|
74
|
+
**Q: 机器人收不到消息?**
|
|
75
|
+
|
|
76
|
+
检查:
|
|
77
|
+
1. 应用已发布上线(不是草稿状态)
|
|
78
|
+
2. 事件订阅选的是「长连接」不是「webhook」
|
|
79
|
+
3. 权限都开了
|
|
80
|
+
|
|
81
|
+
**Q: 群聊不回复?**
|
|
82
|
+
|
|
83
|
+
试试 @机器人,或者在消息末尾加个问号。
|
|
84
|
+
|
|
85
|
+
**Q: 怎么查看状态?**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
clawdbot channels status feishu
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 链接
|
|
92
|
+
|
|
93
|
+
- [Moltbot 文档](https://docs.molt.bot)
|
|
94
|
+
- [飞书开放平台文档](https://open.feishu.cn/document/home/index)
|
|
95
|
+
- [问题反馈](https://github.com/AlexAnys/moltbot-feishu/issues)
|
|
96
|
+
|
|
97
|
+
## 协议
|
|
98
|
+
|
|
99
|
+
MIT
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "feishu",
|
|
3
|
+
"name": "Feishu",
|
|
4
|
+
"description": "Feishu (飞书/Lark) channel plugin — WebSocket long-connection bot",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"channels": ["feishu"],
|
|
7
|
+
"configSchema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"appId": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Feishu App ID (cli_xxx)"
|
|
13
|
+
},
|
|
14
|
+
"appSecret": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Feishu App Secret"
|
|
17
|
+
},
|
|
18
|
+
"dmPolicy": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["pairing", "allowlist", "open", "disabled"],
|
|
21
|
+
"default": "pairing",
|
|
22
|
+
"description": "Direct message access policy"
|
|
23
|
+
},
|
|
24
|
+
"thinkingThresholdMs": {
|
|
25
|
+
"type": "number",
|
|
26
|
+
"default": 2500,
|
|
27
|
+
"description": "Delay in ms before showing 'Thinking...' placeholder"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": ["appId", "appSecret"],
|
|
31
|
+
"additionalProperties": true
|
|
32
|
+
}
|
|
33
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feishu (Lark) channel plugin for Clawdbot/Moltbot.
|
|
3
|
+
*
|
|
4
|
+
* Connects Feishu bots via WebSocket long-connection (no public server required).
|
|
5
|
+
*/
|
|
6
|
+
import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk";
|
|
7
|
+
declare const plugin: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
configSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
appId: {
|
|
15
|
+
type: "string";
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
appSecret: {
|
|
19
|
+
type: "string";
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: readonly ["appId", "appSecret"];
|
|
24
|
+
additionalProperties: false;
|
|
25
|
+
};
|
|
26
|
+
register(api: ClawdbotPluginApi): void;
|
|
27
|
+
};
|
|
28
|
+
export default plugin;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;kBAaI,iBAAiB;CAahC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feishu (Lark) channel plugin for Clawdbot/Moltbot.
|
|
3
|
+
*
|
|
4
|
+
* Connects Feishu bots via WebSocket long-connection (no public server required).
|
|
5
|
+
*/
|
|
6
|
+
import { feishuDock, feishuPlugin } from "./src/channel.js";
|
|
7
|
+
import { setFeishuRuntime } from "./src/runtime.js";
|
|
8
|
+
const plugin = {
|
|
9
|
+
id: "feishu",
|
|
10
|
+
name: "Feishu",
|
|
11
|
+
description: "Feishu (Lark) channel plugin — WebSocket long-connection bot",
|
|
12
|
+
configSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
appId: { type: "string", description: "Feishu App ID" },
|
|
16
|
+
appSecret: { type: "string", description: "Feishu App Secret" },
|
|
17
|
+
},
|
|
18
|
+
required: ["appId", "appSecret"],
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
},
|
|
21
|
+
register(api) {
|
|
22
|
+
setFeishuRuntime(api.runtime);
|
|
23
|
+
// If plugin-level config has appId/appSecret, start the client eagerly
|
|
24
|
+
const pluginCfg = api.pluginConfig;
|
|
25
|
+
if (pluginCfg?.appId && pluginCfg?.appSecret) {
|
|
26
|
+
api.runtime.log?.info?.(`[feishu] Plugin config detected (appId=${pluginCfg.appId.slice(0, 8)}...)`);
|
|
27
|
+
}
|
|
28
|
+
api.registerChannel({ plugin: feishuPlugin, dock: feishuDock });
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export default plugin;
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,GAAG;IACb,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,8DAA8D;IAC3E,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,eAAe,EAAE;YAChE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,mBAAmB,EAAE;SACzE;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAU;QACzC,oBAAoB,EAAE,KAAc;KACrC;IACD,QAAQ,CAAC,GAAsB;QAC7B,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE9B,uEAAuE;QACvE,MAAM,SAAS,GAAG,GAAG,CAAC,YAAkE,CAAC;QACzF,IAAI,SAAS,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,EAAE,CAAC;YAC7C,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,CACrB,0CAA0C,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAC5E,CAAC;QACJ,CAAC;QAED,GAAG,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAClE,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feishu account resolution — multi-account support.
|
|
3
|
+
*/
|
|
4
|
+
import type { ClawdbotConfig } from "clawdbot/plugin-sdk";
|
|
5
|
+
import type { ResolvedFeishuAccount } from "./types.js";
|
|
6
|
+
/** List all configured Feishu account IDs (falls back to ["default"]). */
|
|
7
|
+
export declare function listFeishuAccountIds(cfg: ClawdbotConfig): string[];
|
|
8
|
+
/** Resolve the default account ID. */
|
|
9
|
+
export declare function resolveDefaultFeishuAccountId(cfg: ClawdbotConfig): string;
|
|
10
|
+
/** Fully resolve a Feishu account. */
|
|
11
|
+
export declare function resolveFeishuAccount(params: {
|
|
12
|
+
cfg: ClawdbotConfig;
|
|
13
|
+
accountId?: string | null;
|
|
14
|
+
}): ResolvedFeishuAccount;
|
|
15
|
+
/** List all enabled Feishu accounts. */
|
|
16
|
+
export declare function listEnabledFeishuAccounts(cfg: ClawdbotConfig): ResolvedFeishuAccount[];
|
|
17
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAQpB,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,EAAE,CAIlE;AAED,sCAAsC;AACtC,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAMzE;AA2CD,sCAAsC;AACtC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,GAAG,EAAE,cAAc,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,qBAAqB,CAiBxB;AAED,wCAAwC;AACxC,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,cAAc,GAAG,qBAAqB,EAAE,CAItF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feishu account resolution — multi-account support.
|
|
3
|
+
*/
|
|
4
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "clawdbot/plugin-sdk";
|
|
5
|
+
function listConfiguredAccountIds(cfg) {
|
|
6
|
+
const accounts = cfg.channels?.feishu?.accounts;
|
|
7
|
+
if (!accounts || typeof accounts !== "object")
|
|
8
|
+
return [];
|
|
9
|
+
return Object.keys(accounts).filter(Boolean);
|
|
10
|
+
}
|
|
11
|
+
/** List all configured Feishu account IDs (falls back to ["default"]). */
|
|
12
|
+
export function listFeishuAccountIds(cfg) {
|
|
13
|
+
const ids = listConfiguredAccountIds(cfg);
|
|
14
|
+
if (ids.length === 0)
|
|
15
|
+
return [DEFAULT_ACCOUNT_ID];
|
|
16
|
+
return ids.sort((a, b) => a.localeCompare(b));
|
|
17
|
+
}
|
|
18
|
+
/** Resolve the default account ID. */
|
|
19
|
+
export function resolveDefaultFeishuAccountId(cfg) {
|
|
20
|
+
const feishuConfig = cfg.channels?.feishu;
|
|
21
|
+
if (feishuConfig?.defaultAccount?.trim())
|
|
22
|
+
return feishuConfig.defaultAccount.trim();
|
|
23
|
+
const ids = listFeishuAccountIds(cfg);
|
|
24
|
+
if (ids.includes(DEFAULT_ACCOUNT_ID))
|
|
25
|
+
return DEFAULT_ACCOUNT_ID;
|
|
26
|
+
return ids[0] ?? DEFAULT_ACCOUNT_ID;
|
|
27
|
+
}
|
|
28
|
+
function resolveAccountConfig(cfg, accountId) {
|
|
29
|
+
const accounts = cfg.channels?.feishu?.accounts;
|
|
30
|
+
if (!accounts || typeof accounts !== "object")
|
|
31
|
+
return undefined;
|
|
32
|
+
return accounts[accountId];
|
|
33
|
+
}
|
|
34
|
+
function mergeFeishuAccountConfig(cfg, accountId) {
|
|
35
|
+
const raw = (cfg.channels?.feishu ?? {});
|
|
36
|
+
const { accounts: _ignored, defaultAccount: _ignored2, ...base } = raw;
|
|
37
|
+
const account = resolveAccountConfig(cfg, accountId) ?? {};
|
|
38
|
+
return { ...base, ...account };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve appId + appSecret for an account.
|
|
42
|
+
* Checks: account config → base config → plugin config.
|
|
43
|
+
*/
|
|
44
|
+
function resolveCredentials(cfg, merged) {
|
|
45
|
+
// From channel config
|
|
46
|
+
if (merged.appId?.trim() && merged.appSecret?.trim()) {
|
|
47
|
+
return { appId: merged.appId.trim(), appSecret: merged.appSecret.trim(), source: "config" };
|
|
48
|
+
}
|
|
49
|
+
// From plugin config (plugins.entries.feishu.config)
|
|
50
|
+
const pluginCfg = cfg.plugins;
|
|
51
|
+
const feishuPluginCfg = pluginCfg?.entries?.feishu?.config;
|
|
52
|
+
if (feishuPluginCfg?.appId?.trim() && feishuPluginCfg?.appSecret?.trim()) {
|
|
53
|
+
return { appId: feishuPluginCfg.appId.trim(), appSecret: feishuPluginCfg.appSecret.trim(), source: "plugin" };
|
|
54
|
+
}
|
|
55
|
+
return { appId: "", appSecret: "", source: "none" };
|
|
56
|
+
}
|
|
57
|
+
/** Fully resolve a Feishu account. */
|
|
58
|
+
export function resolveFeishuAccount(params) {
|
|
59
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
60
|
+
const baseEnabled = params.cfg.channels?.feishu?.enabled !== false;
|
|
61
|
+
const merged = mergeFeishuAccountConfig(params.cfg, accountId);
|
|
62
|
+
const accountEnabled = merged.enabled !== false;
|
|
63
|
+
const enabled = baseEnabled && accountEnabled;
|
|
64
|
+
const creds = resolveCredentials(params.cfg, merged);
|
|
65
|
+
return {
|
|
66
|
+
accountId,
|
|
67
|
+
name: merged.name?.trim() || undefined,
|
|
68
|
+
enabled,
|
|
69
|
+
appId: creds.appId,
|
|
70
|
+
appSecret: creds.appSecret,
|
|
71
|
+
tokenSource: creds.source,
|
|
72
|
+
config: merged,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** List all enabled Feishu accounts. */
|
|
76
|
+
export function listEnabledFeishuAccounts(cfg) {
|
|
77
|
+
return listFeishuAccountIds(cfg)
|
|
78
|
+
.map((accountId) => resolveFeishuAccount({ cfg, accountId }))
|
|
79
|
+
.filter((account) => account.enabled);
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQ7E,SAAS,wBAAwB,CAAC,GAAmB;IACnD,MAAM,QAAQ,GAAI,GAAG,CAAC,QAAQ,EAAE,MAAmC,EAAE,QAAQ,CAAC;IAC9E,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,oBAAoB,CAAC,GAAmB;IACtD,MAAM,GAAG,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAClD,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,sCAAsC;AACtC,MAAM,UAAU,6BAA6B,CAAC,GAA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SAAS;QACtC,OAAO;QACP,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,WAAW,EAAE,KAAK,CAAC,MAAM;QACzB,MAAM,EAAE,MAAM;KACf,CAAC;AACJ,CAAC;AAED,wCAAwC;AACxC,MAAM,UAAU,yBAAyB,CAAC,GAAmB;IAC3D,OAAO,oBAAoB,CAAC,GAAG,CAAC;SAC7B,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,oBAAoB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;SAC5D,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feishu ChannelPlugin + ChannelDock — core channel integration.
|
|
3
|
+
*/
|
|
4
|
+
import type { ChannelDock, ChannelPlugin } from "clawdbot/plugin-sdk";
|
|
5
|
+
import type { ResolvedFeishuAccount } from "./types.js";
|
|
6
|
+
export declare const feishuDock: ChannelDock;
|
|
7
|
+
export declare const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount>;
|
|
8
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/channel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAEV,WAAW,EACX,aAAa,EAEd,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAsCxD,eAAO,MAAM,UAAU,EAAE,WA0BxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,qBAAqB,CAsU7D,CAAC"}
|