@larksuite/openclaw-lark 2026.3.18 → 2026.3.24
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/index.d.ts +1 -1
- package/index.js +34 -28
- package/package.json +3 -2
- package/src/card/builder.js +1 -1
- package/src/card/cardkit.js +4 -4
- package/src/card/flush-controller.js +1 -1
- package/src/card/image-resolver.js +2 -2
- package/src/card/reply-dispatcher.js +17 -15
- package/src/card/streaming-card-controller.d.ts +1 -1
- package/src/card/streaming-card-controller.js +14 -14
- package/src/card/unavailable-guard.js +3 -3
- package/src/channel/config-adapter.js +5 -5
- package/src/channel/directory.js +3 -3
- package/src/channel/event-handlers.js +8 -8
- package/src/channel/monitor.js +6 -6
- package/src/channel/onboarding-config.d.ts +2 -1
- package/src/channel/onboarding-config.js +2 -2
- package/src/channel/onboarding-migrate.js +1 -1
- package/src/channel/onboarding.d.ts +2 -2
- package/src/channel/onboarding.js +8 -7
- package/src/channel/plugin.js +18 -22
- package/src/channel/probe.js +1 -1
- package/src/channel/types.d.ts +2 -1
- package/src/commands/auth.js +9 -9
- package/src/commands/diagnose.js +5 -5
- package/src/commands/doctor.js +10 -10
- package/src/commands/index.js +4 -4
- package/src/core/accounts.js +10 -9
- package/src/core/api-error.js +2 -2
- package/src/core/app-owner-fallback.js +2 -2
- package/src/core/app-scope-checker.js +2 -2
- package/src/core/chat-info-cache.js +2 -2
- package/src/core/device-flow.js +2 -2
- package/src/core/feishu-fetch.js +1 -1
- package/src/core/lark-client.d.ts +13 -0
- package/src/core/lark-client.js +63 -6
- package/src/core/lark-logger.js +2 -2
- package/src/core/message-unavailable.js +3 -3
- package/src/core/owner-policy.js +1 -1
- package/src/core/raw-request.js +1 -1
- package/src/core/scope-manager.js +1 -1
- package/src/core/sdk-compat.d.ts +29 -0
- package/src/core/sdk-compat.js +32 -0
- package/src/core/security-check.js +1 -1
- package/src/core/token-store.js +1 -1
- package/src/core/tool-client.js +18 -14
- package/src/core/uat-client.js +5 -5
- package/src/messaging/converters/audio.js +2 -2
- package/src/messaging/converters/calendar.js +1 -1
- package/src/messaging/converters/content-converter.js +3 -3
- package/src/messaging/converters/file.js +1 -1
- package/src/messaging/converters/folder.js +2 -2
- package/src/messaging/converters/hongbao.js +1 -1
- package/src/messaging/converters/image.js +1 -1
- package/src/messaging/converters/index.js +19 -19
- package/src/messaging/converters/interactive/card-converter.js +3 -3
- package/src/messaging/converters/interactive/index.js +3 -3
- package/src/messaging/converters/location.js +1 -1
- package/src/messaging/converters/merge-forward.js +2 -2
- package/src/messaging/converters/post.js +2 -2
- package/src/messaging/converters/share.js +1 -1
- package/src/messaging/converters/sticker.js +1 -1
- package/src/messaging/converters/system.js +1 -1
- package/src/messaging/converters/text.js +2 -2
- package/src/messaging/converters/todo.js +1 -1
- package/src/messaging/converters/unknown.js +1 -1
- package/src/messaging/converters/video-chat.js +1 -1
- package/src/messaging/converters/video.js +2 -2
- package/src/messaging/converters/vote.js +1 -1
- package/src/messaging/inbound/dispatch-builders.d.ts +1 -1
- package/src/messaging/inbound/dispatch-builders.js +4 -4
- package/src/messaging/inbound/dispatch-commands.js +5 -5
- package/src/messaging/inbound/dispatch-context.js +5 -5
- package/src/messaging/inbound/dispatch.d.ts +2 -1
- package/src/messaging/inbound/dispatch.js +17 -17
- package/src/messaging/inbound/enrich.js +5 -5
- package/src/messaging/inbound/gate-effects.js +2 -2
- package/src/messaging/inbound/gate.d.ts +2 -1
- package/src/messaging/inbound/gate.js +4 -4
- package/src/messaging/inbound/handler.d.ts +1 -1
- package/src/messaging/inbound/handler.js +17 -15
- package/src/messaging/inbound/media-resolver.js +2 -2
- package/src/messaging/inbound/mention.js +1 -1
- package/src/messaging/inbound/parse-io.js +2 -2
- package/src/messaging/inbound/parse.js +6 -6
- package/src/messaging/inbound/permission.js +2 -2
- package/src/messaging/inbound/policy.d.ts +2 -1
- package/src/messaging/inbound/policy.js +1 -1
- package/src/messaging/inbound/reaction-handler.d.ts +2 -1
- package/src/messaging/inbound/reaction-handler.js +9 -9
- package/src/messaging/inbound/user-name-cache.js +2 -2
- package/src/messaging/outbound/actions.js +41 -36
- package/src/messaging/outbound/chat-manage.js +1 -1
- package/src/messaging/outbound/deliver.js +7 -7
- package/src/messaging/outbound/fetch.js +2 -2
- package/src/messaging/outbound/forward.js +2 -2
- package/src/messaging/outbound/media.js +4 -4
- package/src/messaging/outbound/outbound.d.ts +1 -11
- package/src/messaging/outbound/outbound.js +4 -4
- package/src/messaging/outbound/reactions.js +1 -1
- package/src/messaging/outbound/send.js +6 -6
- package/src/messaging/outbound/typing.js +4 -4
- package/src/messaging/shared/message-lookup.js +5 -5
- package/src/tools/auto-auth.js +17 -13
- package/src/tools/helpers.d.ts +1 -0
- package/src/tools/helpers.js +21 -9
- package/src/tools/mcp/doc/create.js +1 -1
- package/src/tools/mcp/doc/fetch.js +1 -1
- package/src/tools/mcp/doc/index.js +6 -6
- package/src/tools/mcp/doc/update.js +1 -1
- package/src/tools/mcp/shared.js +4 -4
- package/src/tools/oapi/bitable/app-table-field.js +1 -1
- package/src/tools/oapi/bitable/app-table-record.js +1 -1
- package/src/tools/oapi/bitable/app-table-view.js +1 -1
- package/src/tools/oapi/bitable/app-table.js +1 -1
- package/src/tools/oapi/bitable/app.js +1 -1
- package/src/tools/oapi/bitable/index.js +5 -5
- package/src/tools/oapi/calendar/calendar.js +1 -1
- package/src/tools/oapi/calendar/event-attendee.js +1 -1
- package/src/tools/oapi/calendar/event.js +1 -1
- package/src/tools/oapi/calendar/freebusy.js +1 -1
- package/src/tools/oapi/calendar/index.js +4 -4
- package/src/tools/oapi/chat/chat.js +1 -1
- package/src/tools/oapi/chat/index.js +2 -2
- package/src/tools/oapi/chat/members.js +1 -1
- package/src/tools/oapi/common/get-user.js +1 -1
- package/src/tools/oapi/common/index.js +2 -2
- package/src/tools/oapi/common/search-user.js +1 -1
- package/src/tools/oapi/drive/doc-comments.js +1 -1
- package/src/tools/oapi/drive/doc-media.js +2 -2
- package/src/tools/oapi/drive/file.js +1 -1
- package/src/tools/oapi/drive/index.js +5 -5
- package/src/tools/oapi/helpers.js +7 -7
- package/src/tools/oapi/im/format-messages.js +4 -4
- package/src/tools/oapi/im/index.js +3 -3
- package/src/tools/oapi/im/message-read.js +4 -4
- package/src/tools/oapi/im/message.js +3 -3
- package/src/tools/oapi/im/resource.js +3 -3
- package/src/tools/oapi/im/user-name-uat.js +1 -1
- package/src/tools/oapi/index.js +11 -11
- package/src/tools/oapi/search/doc-search.js +1 -1
- package/src/tools/oapi/search/index.js +3 -3
- package/src/tools/oapi/sheets/index.js +3 -3
- package/src/tools/oapi/sheets/sheet.js +2 -2
- package/src/tools/oapi/task/comment.js +1 -1
- package/src/tools/oapi/task/index.js +4 -4
- package/src/tools/oapi/task/subtask.js +1 -1
- package/src/tools/oapi/task/task.js +1 -1
- package/src/tools/oapi/task/tasklist.js +1 -1
- package/src/tools/oapi/wiki/index.js +4 -4
- package/src/tools/oapi/wiki/space-node.js +1 -1
- package/src/tools/oapi/wiki/space.js +1 -1
- package/src/tools/oauth-batch-auth.js +12 -12
- package/src/tools/oauth-cards.js +1 -1
- package/src/tools/oauth.js +15 -15
- package/src/tools/onboarding-auth.js +7 -7
- package/src/tools/tat/im/index.js +1 -1
- package/src/tools/tat/im/resource.js +3 -3
- package/tsdown.config.d.ts +15 -0
- package/tsdown.config.js +19 -0
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -10,59 +10,65 @@
|
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.isMessageExpired = exports.checkMessageGate = exports.parseMessageEvent = exports.handleFeishuReaction = exports.feishuPlugin = exports.buildMentionedCardContent = exports.buildMentionedMessage = exports.formatMentionAllForCard = exports.formatMentionAllForText = exports.formatMentionForCard = exports.formatMentionForText = exports.extractMessageBody = exports.nonBotMentions = exports.mentionedBot = exports.feishuMessageActions = exports.listChatMembersFeishu = exports.removeChatMembersFeishu = exports.addChatMembersFeishu = exports.updateChatFeishu = exports.forwardMessageFeishu = exports.VALID_FEISHU_EMOJI_TYPES = exports.FeishuEmoji = exports.listReactionsFeishu = exports.removeReactionFeishu = exports.addReactionFeishu = exports.probeFeishu = exports.sendMediaLark = exports.sendCardLark = exports.sendTextLark = exports.uploadAndSendMediaLark = exports.sendAudioLark = exports.sendFileLark = exports.sendImageLark = exports.uploadFileLark = exports.uploadImageLark = exports.getMessageFeishu = exports.editMessageFeishu = exports.updateCardFeishu = exports.sendCardFeishu = exports.sendMessageFeishu = exports.monitorFeishuProvider = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const security_check_1 = require("./src/core/security-check");
|
|
13
|
+
const plugin_1 = require("./src/channel/plugin.js");
|
|
14
|
+
const lark_client_1 = require("./src/core/lark-client.js");
|
|
15
|
+
const index_1 = require("./src/tools/oapi/index.js");
|
|
16
|
+
const index_2 = require("./src/tools/mcp/doc/index.js");
|
|
17
|
+
const oauth_1 = require("./src/tools/oauth.js");
|
|
18
|
+
const oauth_batch_auth_1 = require("./src/tools/oauth-batch-auth.js");
|
|
19
|
+
const diagnose_1 = require("./src/commands/diagnose.js");
|
|
20
|
+
const index_3 = require("./src/commands/index.js");
|
|
21
|
+
const lark_logger_1 = require("./src/core/lark-logger.js");
|
|
22
|
+
const security_check_1 = require("./src/core/security-check.js");
|
|
24
23
|
const log = (0, lark_logger_1.larkLogger)('plugin');
|
|
24
|
+
function emptyPluginConfigSchema() {
|
|
25
|
+
return {
|
|
26
|
+
type: 'object',
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
properties: {},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
25
31
|
// ---------------------------------------------------------------------------
|
|
26
32
|
// Re-exports for external consumers
|
|
27
33
|
// ---------------------------------------------------------------------------
|
|
28
|
-
var monitor_1 = require("./src/channel/monitor");
|
|
34
|
+
var monitor_1 = require("./src/channel/monitor.js");
|
|
29
35
|
Object.defineProperty(exports, "monitorFeishuProvider", { enumerable: true, get: function () { return monitor_1.monitorFeishuProvider; } });
|
|
30
|
-
var send_1 = require("./src/messaging/outbound/send");
|
|
36
|
+
var send_1 = require("./src/messaging/outbound/send.js");
|
|
31
37
|
Object.defineProperty(exports, "sendMessageFeishu", { enumerable: true, get: function () { return send_1.sendMessageFeishu; } });
|
|
32
38
|
Object.defineProperty(exports, "sendCardFeishu", { enumerable: true, get: function () { return send_1.sendCardFeishu; } });
|
|
33
39
|
Object.defineProperty(exports, "updateCardFeishu", { enumerable: true, get: function () { return send_1.updateCardFeishu; } });
|
|
34
40
|
Object.defineProperty(exports, "editMessageFeishu", { enumerable: true, get: function () { return send_1.editMessageFeishu; } });
|
|
35
|
-
var fetch_1 = require("./src/messaging/outbound/fetch");
|
|
41
|
+
var fetch_1 = require("./src/messaging/outbound/fetch.js");
|
|
36
42
|
Object.defineProperty(exports, "getMessageFeishu", { enumerable: true, get: function () { return fetch_1.getMessageFeishu; } });
|
|
37
|
-
var media_1 = require("./src/messaging/outbound/media");
|
|
43
|
+
var media_1 = require("./src/messaging/outbound/media.js");
|
|
38
44
|
Object.defineProperty(exports, "uploadImageLark", { enumerable: true, get: function () { return media_1.uploadImageLark; } });
|
|
39
45
|
Object.defineProperty(exports, "uploadFileLark", { enumerable: true, get: function () { return media_1.uploadFileLark; } });
|
|
40
46
|
Object.defineProperty(exports, "sendImageLark", { enumerable: true, get: function () { return media_1.sendImageLark; } });
|
|
41
47
|
Object.defineProperty(exports, "sendFileLark", { enumerable: true, get: function () { return media_1.sendFileLark; } });
|
|
42
48
|
Object.defineProperty(exports, "sendAudioLark", { enumerable: true, get: function () { return media_1.sendAudioLark; } });
|
|
43
49
|
Object.defineProperty(exports, "uploadAndSendMediaLark", { enumerable: true, get: function () { return media_1.uploadAndSendMediaLark; } });
|
|
44
|
-
var deliver_1 = require("./src/messaging/outbound/deliver");
|
|
50
|
+
var deliver_1 = require("./src/messaging/outbound/deliver.js");
|
|
45
51
|
Object.defineProperty(exports, "sendTextLark", { enumerable: true, get: function () { return deliver_1.sendTextLark; } });
|
|
46
52
|
Object.defineProperty(exports, "sendCardLark", { enumerable: true, get: function () { return deliver_1.sendCardLark; } });
|
|
47
53
|
Object.defineProperty(exports, "sendMediaLark", { enumerable: true, get: function () { return deliver_1.sendMediaLark; } });
|
|
48
|
-
var probe_1 = require("./src/channel/probe");
|
|
54
|
+
var probe_1 = require("./src/channel/probe.js");
|
|
49
55
|
Object.defineProperty(exports, "probeFeishu", { enumerable: true, get: function () { return probe_1.probeFeishu; } });
|
|
50
|
-
var reactions_1 = require("./src/messaging/outbound/reactions");
|
|
56
|
+
var reactions_1 = require("./src/messaging/outbound/reactions.js");
|
|
51
57
|
Object.defineProperty(exports, "addReactionFeishu", { enumerable: true, get: function () { return reactions_1.addReactionFeishu; } });
|
|
52
58
|
Object.defineProperty(exports, "removeReactionFeishu", { enumerable: true, get: function () { return reactions_1.removeReactionFeishu; } });
|
|
53
59
|
Object.defineProperty(exports, "listReactionsFeishu", { enumerable: true, get: function () { return reactions_1.listReactionsFeishu; } });
|
|
54
60
|
Object.defineProperty(exports, "FeishuEmoji", { enumerable: true, get: function () { return reactions_1.FeishuEmoji; } });
|
|
55
61
|
Object.defineProperty(exports, "VALID_FEISHU_EMOJI_TYPES", { enumerable: true, get: function () { return reactions_1.VALID_FEISHU_EMOJI_TYPES; } });
|
|
56
|
-
var forward_1 = require("./src/messaging/outbound/forward");
|
|
62
|
+
var forward_1 = require("./src/messaging/outbound/forward.js");
|
|
57
63
|
Object.defineProperty(exports, "forwardMessageFeishu", { enumerable: true, get: function () { return forward_1.forwardMessageFeishu; } });
|
|
58
|
-
var chat_manage_1 = require("./src/messaging/outbound/chat-manage");
|
|
64
|
+
var chat_manage_1 = require("./src/messaging/outbound/chat-manage.js");
|
|
59
65
|
Object.defineProperty(exports, "updateChatFeishu", { enumerable: true, get: function () { return chat_manage_1.updateChatFeishu; } });
|
|
60
66
|
Object.defineProperty(exports, "addChatMembersFeishu", { enumerable: true, get: function () { return chat_manage_1.addChatMembersFeishu; } });
|
|
61
67
|
Object.defineProperty(exports, "removeChatMembersFeishu", { enumerable: true, get: function () { return chat_manage_1.removeChatMembersFeishu; } });
|
|
62
68
|
Object.defineProperty(exports, "listChatMembersFeishu", { enumerable: true, get: function () { return chat_manage_1.listChatMembersFeishu; } });
|
|
63
|
-
var actions_1 = require("./src/messaging/outbound/actions");
|
|
69
|
+
var actions_1 = require("./src/messaging/outbound/actions.js");
|
|
64
70
|
Object.defineProperty(exports, "feishuMessageActions", { enumerable: true, get: function () { return actions_1.feishuMessageActions; } });
|
|
65
|
-
var mention_1 = require("./src/messaging/inbound/mention");
|
|
71
|
+
var mention_1 = require("./src/messaging/inbound/mention.js");
|
|
66
72
|
Object.defineProperty(exports, "mentionedBot", { enumerable: true, get: function () { return mention_1.mentionedBot; } });
|
|
67
73
|
Object.defineProperty(exports, "nonBotMentions", { enumerable: true, get: function () { return mention_1.nonBotMentions; } });
|
|
68
74
|
Object.defineProperty(exports, "extractMessageBody", { enumerable: true, get: function () { return mention_1.extractMessageBody; } });
|
|
@@ -72,15 +78,15 @@ Object.defineProperty(exports, "formatMentionAllForText", { enumerable: true, ge
|
|
|
72
78
|
Object.defineProperty(exports, "formatMentionAllForCard", { enumerable: true, get: function () { return mention_1.formatMentionAllForCard; } });
|
|
73
79
|
Object.defineProperty(exports, "buildMentionedMessage", { enumerable: true, get: function () { return mention_1.buildMentionedMessage; } });
|
|
74
80
|
Object.defineProperty(exports, "buildMentionedCardContent", { enumerable: true, get: function () { return mention_1.buildMentionedCardContent; } });
|
|
75
|
-
var plugin_2 = require("./src/channel/plugin");
|
|
81
|
+
var plugin_2 = require("./src/channel/plugin.js");
|
|
76
82
|
Object.defineProperty(exports, "feishuPlugin", { enumerable: true, get: function () { return plugin_2.feishuPlugin; } });
|
|
77
|
-
var reaction_handler_1 = require("./src/messaging/inbound/reaction-handler");
|
|
83
|
+
var reaction_handler_1 = require("./src/messaging/inbound/reaction-handler.js");
|
|
78
84
|
Object.defineProperty(exports, "handleFeishuReaction", { enumerable: true, get: function () { return reaction_handler_1.handleFeishuReaction; } });
|
|
79
|
-
var parse_1 = require("./src/messaging/inbound/parse");
|
|
85
|
+
var parse_1 = require("./src/messaging/inbound/parse.js");
|
|
80
86
|
Object.defineProperty(exports, "parseMessageEvent", { enumerable: true, get: function () { return parse_1.parseMessageEvent; } });
|
|
81
|
-
var gate_1 = require("./src/messaging/inbound/gate");
|
|
87
|
+
var gate_1 = require("./src/messaging/inbound/gate.js");
|
|
82
88
|
Object.defineProperty(exports, "checkMessageGate", { enumerable: true, get: function () { return gate_1.checkMessageGate; } });
|
|
83
|
-
var dedup_1 = require("./src/messaging/inbound/dedup");
|
|
89
|
+
var dedup_1 = require("./src/messaging/inbound/dedup.js");
|
|
84
90
|
Object.defineProperty(exports, "isMessageExpired", { enumerable: true, get: function () { return dedup_1.isMessageExpired; } });
|
|
85
91
|
// ---------------------------------------------------------------------------
|
|
86
92
|
// Plugin definition
|
|
@@ -89,7 +95,7 @@ const plugin = {
|
|
|
89
95
|
id: 'openclaw-lark',
|
|
90
96
|
name: 'Feishu',
|
|
91
97
|
description: 'Lark/Feishu channel plugin with im/doc/wiki/drive/task/calendar tools',
|
|
92
|
-
configSchema:
|
|
98
|
+
configSchema: emptyPluginConfigSchema(),
|
|
93
99
|
register(api) {
|
|
94
100
|
lark_client_1.LarkClient.setRuntime(api.runtime);
|
|
95
101
|
api.registerChannel({ plugin: plugin_1.feishuPlugin });
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@larksuite/openclaw-lark",
|
|
3
|
-
"version": "2026.3.
|
|
3
|
+
"version": "2026.3.24",
|
|
4
4
|
"description": "OpenClaw Lark/Feishu channel plugin",
|
|
5
5
|
"bin": {
|
|
6
6
|
"openclaw-lark": "bin/openclaw-lark.js"
|
|
7
7
|
},
|
|
8
|
+
"main": "index.js",
|
|
8
9
|
"files": [
|
|
9
10
|
"**/*"
|
|
10
11
|
],
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
13
14
|
"@sinclair/typebox": "0.34.48",
|
|
14
15
|
"image-size": "^2.0.2",
|
|
16
|
+
"openclaw": "^2026.3.13",
|
|
15
17
|
"zod": "^4.3.6"
|
|
16
18
|
},
|
|
17
19
|
"openclaw": {
|
|
@@ -37,7 +39,6 @@
|
|
|
37
39
|
"defaultChoice": "npm"
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
|
-
"main": "index.js",
|
|
41
42
|
"types": "index.d.ts",
|
|
42
43
|
"exports": {
|
|
43
44
|
".": {
|
package/src/card/builder.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.formatReasoningDuration = formatReasoningDuration;
|
|
|
16
16
|
exports.formatElapsed = formatElapsed;
|
|
17
17
|
exports.buildCardContent = buildCardContent;
|
|
18
18
|
exports.toCardKit2 = toCardKit2;
|
|
19
|
-
const markdown_style_1 = require("./markdown-style");
|
|
19
|
+
const markdown_style_1 = require("./markdown-style.js");
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Constants
|
|
22
22
|
// ---------------------------------------------------------------------------
|
package/src/card/cardkit.js
CHANGED
|
@@ -12,10 +12,10 @@ exports.updateCardKitCard = updateCardKitCard;
|
|
|
12
12
|
exports.updateCardKitCardForAuth = updateCardKitCardForAuth;
|
|
13
13
|
exports.sendCardByCardId = sendCardByCardId;
|
|
14
14
|
exports.setCardStreamingMode = setCardStreamingMode;
|
|
15
|
-
const lark_client_1 = require("../core/lark-client");
|
|
16
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
17
|
-
const targets_1 = require("../core/targets");
|
|
18
|
-
const message_unavailable_1 = require("../core/message-unavailable");
|
|
15
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
16
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
17
|
+
const targets_1 = require("../core/targets.js");
|
|
18
|
+
const message_unavailable_1 = require("../core/message-unavailable.js");
|
|
19
19
|
const log = (0, lark_logger_1.larkLogger)('card/cardkit');
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Helpers
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.FlushController = void 0;
|
|
14
|
-
const reply_dispatcher_types_1 = require("./reply-dispatcher-types");
|
|
14
|
+
const reply_dispatcher_types_1 = require("./reply-dispatcher-types.js");
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
16
|
// FlushController
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.ImageResolver = void 0;
|
|
14
|
-
const media_1 = require("../messaging/outbound/media");
|
|
15
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
14
|
+
const media_1 = require("../messaging/outbound/media.js");
|
|
15
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
16
16
|
const log = (0, lark_logger_1.larkLogger)('card/image-resolver');
|
|
17
17
|
/** Matches complete markdown image syntax: `` */
|
|
18
18
|
const IMAGE_RE = /!\[([^\]]*)\]\(([^)\s]+)\)/g;
|
|
@@ -13,17 +13,19 @@
|
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.createFeishuReplyDispatcher = createFeishuReplyDispatcher;
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
16
|
+
const channel_runtime_1 = require("openclaw/plugin-sdk/channel-runtime");
|
|
17
|
+
const channel_feedback_1 = require("openclaw/plugin-sdk/channel-feedback");
|
|
18
|
+
const channel_runtime_2 = require("openclaw/plugin-sdk/channel-runtime");
|
|
19
|
+
const accounts_1 = require("../core/accounts.js");
|
|
20
|
+
const footer_config_1 = require("../core/footer-config.js");
|
|
21
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
22
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
23
|
+
const send_1 = require("../messaging/outbound/send.js");
|
|
24
|
+
const typing_1 = require("../messaging/outbound/typing.js");
|
|
25
|
+
const reply_mode_1 = require("./reply-mode.js");
|
|
26
|
+
const streaming_card_controller_1 = require("./streaming-card-controller.js");
|
|
27
|
+
const unavailable_guard_1 = require("./unavailable-guard.js");
|
|
28
|
+
const deliver_1 = require("../messaging/outbound/deliver.js");
|
|
27
29
|
const log = (0, lark_logger_1.larkLogger)('card/reply-dispatcher');
|
|
28
30
|
// ---------------------------------------------------------------------------
|
|
29
31
|
// Public API
|
|
@@ -35,7 +37,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
35
37
|
const account = (0, accounts_1.getLarkAccount)(cfg, accountId);
|
|
36
38
|
const feishuCfg = account.config;
|
|
37
39
|
const accountScopedCfg = (0, accounts_1.createAccountScopedConfig)(cfg, account.accountId);
|
|
38
|
-
const prefixContext = (0,
|
|
40
|
+
const prefixContext = (0, channel_runtime_1.createReplyPrefixContext)({ cfg, agentId });
|
|
39
41
|
// ---- Reply mode resolution ----
|
|
40
42
|
const chatType = params.chatType;
|
|
41
43
|
const effectiveReplyMode = (0, reply_mode_1.resolveReplyMode)({ feishuCfg, chatType });
|
|
@@ -97,7 +99,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
97
99
|
// ---- Typing indicator (reaction-based) ----
|
|
98
100
|
let typingState = null;
|
|
99
101
|
let typingStopped = false;
|
|
100
|
-
const typingCallbacks = (0,
|
|
102
|
+
const typingCallbacks = (0, channel_runtime_2.createTypingCallbacks)({
|
|
101
103
|
keepaliveIntervalMs: 0,
|
|
102
104
|
start: async () => {
|
|
103
105
|
if (shouldSkip('typing.start.precheck'))
|
|
@@ -130,7 +132,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
130
132
|
log.info('removed typing indicator reaction');
|
|
131
133
|
},
|
|
132
134
|
onStartError: (err) => {
|
|
133
|
-
(0,
|
|
135
|
+
(0, channel_feedback_1.logTypingFailure)({
|
|
134
136
|
log: (message) => log.warn(message),
|
|
135
137
|
channel: 'feishu',
|
|
136
138
|
action: 'start',
|
|
@@ -138,7 +140,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
138
140
|
});
|
|
139
141
|
},
|
|
140
142
|
onStopError: (err) => {
|
|
141
|
-
(0,
|
|
143
|
+
(0, channel_feedback_1.logTypingFailure)({
|
|
142
144
|
log: (message) => log.warn(message),
|
|
143
145
|
channel: 'feishu',
|
|
144
146
|
action: 'stop',
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Delegates throttling to FlushController and message-unavailable
|
|
11
11
|
* detection to UnavailableGuard.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import type { ReplyPayload } from 'openclaw/plugin-sdk';
|
|
14
14
|
import type { CardPhase, TerminalReason, StreamingCardDeps } from './reply-dispatcher-types';
|
|
15
15
|
export declare class StreamingCardController {
|
|
16
16
|
private phase;
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.StreamingCardController = void 0;
|
|
16
|
-
const
|
|
17
|
-
const api_error_1 = require("../core/api-error");
|
|
18
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
19
|
-
const send_1 = require("../messaging/outbound/send");
|
|
20
|
-
const cardkit_1 = require("./cardkit");
|
|
21
|
-
const builder_1 = require("./builder");
|
|
22
|
-
const markdown_style_1 = require("./markdown-style");
|
|
23
|
-
const image_resolver_1 = require("./image-resolver");
|
|
24
|
-
const shutdown_hooks_1 = require("../core/shutdown-hooks");
|
|
25
|
-
const flush_controller_1 = require("./flush-controller");
|
|
26
|
-
const unavailable_guard_1 = require("./unavailable-guard");
|
|
27
|
-
const reply_dispatcher_types_1 = require("./reply-dispatcher-types");
|
|
16
|
+
const reply_runtime_1 = require("openclaw/plugin-sdk/reply-runtime");
|
|
17
|
+
const api_error_1 = require("../core/api-error.js");
|
|
18
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
19
|
+
const send_1 = require("../messaging/outbound/send.js");
|
|
20
|
+
const cardkit_1 = require("./cardkit.js");
|
|
21
|
+
const builder_1 = require("./builder.js");
|
|
22
|
+
const markdown_style_1 = require("./markdown-style.js");
|
|
23
|
+
const image_resolver_1 = require("./image-resolver.js");
|
|
24
|
+
const shutdown_hooks_1 = require("../core/shutdown-hooks.js");
|
|
25
|
+
const flush_controller_1 = require("./flush-controller.js");
|
|
26
|
+
const unavailable_guard_1 = require("./unavailable-guard.js");
|
|
27
|
+
const reply_dispatcher_types_1 = require("./reply-dispatcher-types.js");
|
|
28
28
|
const log = (0, lark_logger_1.larkLogger)('card/streaming');
|
|
29
29
|
// ---------------------------------------------------------------------------
|
|
30
30
|
// CardKit 2.0 initial streaming payload
|
|
@@ -295,7 +295,7 @@ class StreamingCardController {
|
|
|
295
295
|
this.text.lastPartialText = text;
|
|
296
296
|
this.text.accumulatedText = this.text.streamingPrefix ? this.text.streamingPrefix + '\n\n' + text : text;
|
|
297
297
|
// NO_REPLY 缓冲
|
|
298
|
-
if (!this.text.streamingPrefix &&
|
|
298
|
+
if (!this.text.streamingPrefix && reply_runtime_1.SILENT_REPLY_TOKEN.startsWith(this.text.accumulatedText.trim())) {
|
|
299
299
|
log.debug('onPartialReply: buffering NO_REPLY prefix');
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
@@ -378,7 +378,7 @@ class StreamingCardController {
|
|
|
378
378
|
accountId: this.deps.accountId,
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
const isNoReplyLeak = !this.text.completedText &&
|
|
381
|
+
const isNoReplyLeak = !this.text.completedText && reply_runtime_1.SILENT_REPLY_TOKEN.startsWith(this.text.accumulatedText.trim());
|
|
382
382
|
const displayText = this.text.completedText || (isNoReplyLeak ? '' : this.text.accumulatedText) || reply_dispatcher_types_1.EMPTY_REPLY_FALLBACK_TEXT;
|
|
383
383
|
if (!this.text.completedText && !this.text.accumulatedText) {
|
|
384
384
|
log.warn('reply completed without visible text, using empty-reply fallback');
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UnavailableGuard = void 0;
|
|
13
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
14
|
-
const api_error_1 = require("../core/api-error");
|
|
15
|
-
const message_unavailable_1 = require("../core/message-unavailable");
|
|
13
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
14
|
+
const api_error_1 = require("../core/api-error.js");
|
|
15
|
+
const message_unavailable_1 = require("../core/message-unavailable.js");
|
|
16
16
|
const log = (0, lark_logger_1.larkLogger)('card/unavailable-guard');
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
18
18
|
// UnavailableGuard
|
|
@@ -15,12 +15,12 @@ exports.setAccountEnabled = setAccountEnabled;
|
|
|
15
15
|
exports.applyAccountConfig = applyAccountConfig;
|
|
16
16
|
exports.deleteAccount = deleteAccount;
|
|
17
17
|
exports.collectFeishuSecurityWarnings = collectFeishuSecurityWarnings;
|
|
18
|
-
const
|
|
19
|
-
const accounts_1 = require("../core/accounts");
|
|
20
|
-
const security_check_1 = require("../core/security-check");
|
|
18
|
+
const account_id_1 = require("openclaw/plugin-sdk/account-id");
|
|
19
|
+
const accounts_1 = require("../core/accounts.js");
|
|
20
|
+
const security_check_1 = require("../core/security-check.js");
|
|
21
21
|
/** Generic Feishu account config merge. */
|
|
22
22
|
function mergeFeishuAccountConfig(cfg, accountId, patch) {
|
|
23
|
-
const isDefault = !accountId || accountId ===
|
|
23
|
+
const isDefault = !accountId || accountId === account_id_1.DEFAULT_ACCOUNT_ID;
|
|
24
24
|
if (isDefault) {
|
|
25
25
|
return {
|
|
26
26
|
...cfg,
|
|
@@ -55,7 +55,7 @@ function applyAccountConfig(cfg, accountId, patch) {
|
|
|
55
55
|
}
|
|
56
56
|
/** Delete a Feishu account entry from the config. */
|
|
57
57
|
function deleteAccount(cfg, accountId) {
|
|
58
|
-
const isDefault = !accountId || accountId ===
|
|
58
|
+
const isDefault = !accountId || accountId === account_id_1.DEFAULT_ACCOUNT_ID;
|
|
59
59
|
if (isDefault) {
|
|
60
60
|
// Delete entire feishu config
|
|
61
61
|
const next = { ...cfg };
|
package/src/channel/directory.js
CHANGED
|
@@ -13,9 +13,9 @@ exports.listFeishuDirectoryPeers = listFeishuDirectoryPeers;
|
|
|
13
13
|
exports.listFeishuDirectoryGroups = listFeishuDirectoryGroups;
|
|
14
14
|
exports.listFeishuDirectoryPeersLive = listFeishuDirectoryPeersLive;
|
|
15
15
|
exports.listFeishuDirectoryGroupsLive = listFeishuDirectoryGroupsLive;
|
|
16
|
-
const accounts_1 = require("../core/accounts");
|
|
17
|
-
const lark_client_1 = require("../core/lark-client");
|
|
18
|
-
const targets_1 = require("../core/targets");
|
|
16
|
+
const accounts_1 = require("../core/accounts.js");
|
|
17
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
18
|
+
const targets_1 = require("../core/targets.js");
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
// Shared helpers
|
|
21
21
|
// ---------------------------------------------------------------------------
|
|
@@ -14,14 +14,14 @@ exports.handleMessageEvent = handleMessageEvent;
|
|
|
14
14
|
exports.handleReactionEvent = handleReactionEvent;
|
|
15
15
|
exports.handleBotMembershipEvent = handleBotMembershipEvent;
|
|
16
16
|
exports.handleCardActionEvent = handleCardActionEvent;
|
|
17
|
-
const handler_1 = require("../messaging/inbound/handler");
|
|
18
|
-
const reaction_handler_1 = require("../messaging/inbound/reaction-handler");
|
|
19
|
-
const dedup_1 = require("../messaging/inbound/dedup");
|
|
20
|
-
const lark_ticket_1 = require("../core/lark-ticket");
|
|
21
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
22
|
-
const auto_auth_1 = require("../tools/auto-auth");
|
|
23
|
-
const chat_queue_1 = require("./chat-queue");
|
|
24
|
-
const abort_detect_1 = require("./abort-detect");
|
|
17
|
+
const handler_1 = require("../messaging/inbound/handler.js");
|
|
18
|
+
const reaction_handler_1 = require("../messaging/inbound/reaction-handler.js");
|
|
19
|
+
const dedup_1 = require("../messaging/inbound/dedup.js");
|
|
20
|
+
const lark_ticket_1 = require("../core/lark-ticket.js");
|
|
21
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
22
|
+
const auto_auth_1 = require("../tools/auto-auth.js");
|
|
23
|
+
const chat_queue_1 = require("./chat-queue.js");
|
|
24
|
+
const abort_detect_1 = require("./abort-detect.js");
|
|
25
25
|
const elog = (0, lark_logger_1.larkLogger)('channel/event-handlers');
|
|
26
26
|
// ---------------------------------------------------------------------------
|
|
27
27
|
// Event ownership validation
|
package/src/channel/monitor.js
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.monitorFeishuProvider = monitorFeishuProvider;
|
|
14
|
-
const accounts_1 = require("../core/accounts");
|
|
15
|
-
const lark_client_1 = require("../core/lark-client");
|
|
16
|
-
const dedup_1 = require("../messaging/inbound/dedup");
|
|
17
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
18
|
-
const shutdown_hooks_1 = require("../core/shutdown-hooks");
|
|
19
|
-
const event_handlers_1 = require("./event-handlers");
|
|
14
|
+
const accounts_1 = require("../core/accounts.js");
|
|
15
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
16
|
+
const dedup_1 = require("../messaging/inbound/dedup.js");
|
|
17
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
18
|
+
const shutdown_hooks_1 = require("../core/shutdown-hooks.js");
|
|
19
|
+
const event_handlers_1 = require("./event-handlers.js");
|
|
20
20
|
const mlog = (0, lark_logger_1.larkLogger)('channel/monitor');
|
|
21
21
|
// ---------------------------------------------------------------------------
|
|
22
22
|
// Single-account monitor
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* to a ClawdbotConfig. Extracted from onboarding.ts for reuse
|
|
9
9
|
* in CLI commands and other configuration flows.
|
|
10
10
|
*/
|
|
11
|
-
import type { ClawdbotConfig
|
|
11
|
+
import type { ClawdbotConfig } from 'openclaw/plugin-sdk';
|
|
12
|
+
import type { DmPolicy } from 'openclaw/plugin-sdk/setup';
|
|
12
13
|
export declare function setFeishuDmPolicy(cfg: ClawdbotConfig, dmPolicy: DmPolicy): ClawdbotConfig;
|
|
13
14
|
export declare function setFeishuAllowFrom(cfg: ClawdbotConfig, allowFrom: string[]): ClawdbotConfig;
|
|
14
15
|
export declare function setFeishuGroupPolicy(cfg: ClawdbotConfig, groupPolicy: 'open' | 'allowlist' | 'disabled'): ClawdbotConfig;
|
|
@@ -16,13 +16,13 @@ exports.setFeishuGroupPolicy = setFeishuGroupPolicy;
|
|
|
16
16
|
exports.setFeishuGroupAllowFrom = setFeishuGroupAllowFrom;
|
|
17
17
|
exports.setFeishuGroups = setFeishuGroups;
|
|
18
18
|
exports.parseAllowFromInput = parseAllowFromInput;
|
|
19
|
-
const
|
|
19
|
+
const setup_1 = require("openclaw/plugin-sdk/setup");
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
21
|
// Config mutation helpers
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
function setFeishuDmPolicy(cfg, dmPolicy) {
|
|
24
24
|
const allowFrom = dmPolicy === 'open'
|
|
25
|
-
? (0,
|
|
25
|
+
? (0, setup_1.addWildcardAllowFrom)(cfg.channels?.feishu?.allowFrom)?.map((entry) => String(entry))
|
|
26
26
|
: undefined;
|
|
27
27
|
return {
|
|
28
28
|
...cfg,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.migrateLegacyGroupAllowFrom = migrateLegacyGroupAllowFrom;
|
|
14
|
-
const onboarding_config_1 = require("./onboarding-config");
|
|
14
|
+
const onboarding_config_1 = require("./onboarding-config.js");
|
|
15
15
|
/**
|
|
16
16
|
* Detect and migrate legacy chat_id entries in groupAllowFrom.
|
|
17
17
|
*
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* setup` wizard can configure Feishu credentials, domain, group
|
|
9
9
|
* policies, and DM allowlists interactively.
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
12
|
-
export declare const feishuOnboardingAdapter:
|
|
11
|
+
import type { ChannelSetupWizardAdapter } from 'openclaw/plugin-sdk/setup';
|
|
12
|
+
export declare const feishuOnboardingAdapter: ChannelSetupWizardAdapter;
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.feishuOnboardingAdapter = void 0;
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
14
|
+
const account_id_1 = require("openclaw/plugin-sdk/account-id");
|
|
15
|
+
const setup_1 = require("openclaw/plugin-sdk/setup");
|
|
16
|
+
const accounts_1 = require("../core/accounts.js");
|
|
17
|
+
const probe_1 = require("./probe.js");
|
|
18
|
+
const onboarding_config_1 = require("./onboarding-config.js");
|
|
19
|
+
const onboarding_migrate_1 = require("./onboarding-migrate.js");
|
|
19
20
|
// ---------------------------------------------------------------------------
|
|
20
21
|
// Constants
|
|
21
22
|
// ---------------------------------------------------------------------------
|
|
@@ -31,7 +32,7 @@ async function noteFeishuCredentialHelp(prompter) {
|
|
|
31
32
|
'4) Enable required permissions: im:message, im:chat, contact:user.base:readonly',
|
|
32
33
|
'5) Publish the app or add it to a test group',
|
|
33
34
|
'Tip: you can also set FEISHU_APP_ID / FEISHU_APP_SECRET env vars.',
|
|
34
|
-
`Docs: ${(0,
|
|
35
|
+
`Docs: ${(0, setup_1.formatDocsLink)('/channels/feishu', 'feishu')}`,
|
|
35
36
|
].join('\n'), 'Feishu credentials');
|
|
36
37
|
}
|
|
37
38
|
async function promptFeishuAllowFrom(params) {
|
|
@@ -280,7 +281,7 @@ exports.feishuOnboardingAdapter = {
|
|
|
280
281
|
"Use groupPolicy 'open' if you want anyone in allowed groups to trigger.", 'Note');
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
|
-
return { cfg: next, accountId:
|
|
284
|
+
return { cfg: next, accountId: account_id_1.DEFAULT_ACCOUNT_ID };
|
|
284
285
|
},
|
|
285
286
|
// -----------------------------------------------------------------------
|
|
286
287
|
// dmPolicy
|
package/src/channel/plugin.js
CHANGED
|
@@ -44,20 +44,20 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
44
44
|
})();
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.feishuPlugin = void 0;
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const outbound_1 = require("../messaging/outbound/outbound");
|
|
52
|
-
const actions_1 = require("../messaging/outbound/actions");
|
|
53
|
-
const policy_1 = require("../messaging/inbound/policy");
|
|
54
|
-
const lark_client_1 = require("../core/lark-client");
|
|
55
|
-
const send_1 = require("../messaging/outbound/send");
|
|
56
|
-
const targets_1 = require("../core/targets");
|
|
57
|
-
const onboarding_auth_1 = require("../tools/onboarding-auth");
|
|
58
|
-
const config_adapter_1 = require("./config-adapter");
|
|
59
|
-
const lark_logger_1 = require("../core/lark-logger");
|
|
60
|
-
const config_schema_1 = require("../core/config-schema");
|
|
47
|
+
const account_id_1 = require("openclaw/plugin-sdk/account-id");
|
|
48
|
+
const channel_status_1 = require("openclaw/plugin-sdk/channel-status");
|
|
49
|
+
const accounts_1 = require("../core/accounts.js");
|
|
50
|
+
const directory_1 = require("./directory.js");
|
|
51
|
+
const outbound_1 = require("../messaging/outbound/outbound.js");
|
|
52
|
+
const actions_1 = require("../messaging/outbound/actions.js");
|
|
53
|
+
const policy_1 = require("../messaging/inbound/policy.js");
|
|
54
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
55
|
+
const send_1 = require("../messaging/outbound/send.js");
|
|
56
|
+
const targets_1 = require("../core/targets.js");
|
|
57
|
+
const onboarding_auth_1 = require("../tools/onboarding-auth.js");
|
|
58
|
+
const config_adapter_1 = require("./config-adapter.js");
|
|
59
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
60
|
+
const config_schema_1 = require("../core/config-schema.js");
|
|
61
61
|
const pluginLog = (0, lark_logger_1.larkLogger)('channel/plugin');
|
|
62
62
|
/** 状态轮询的探针结果缓存时长(10 分钟)。 */
|
|
63
63
|
const PROBE_CACHE_TTL_MS = 10 * 60 * 1000;
|
|
@@ -107,7 +107,7 @@ exports.feishuPlugin = {
|
|
|
107
107
|
await (0, send_1.sendMessageFeishu)({
|
|
108
108
|
cfg,
|
|
109
109
|
to: id,
|
|
110
|
-
text:
|
|
110
|
+
text: channel_status_1.PAIRING_APPROVED_MESSAGE,
|
|
111
111
|
accountId,
|
|
112
112
|
});
|
|
113
113
|
// 2. 触发 onboarding
|
|
@@ -194,22 +194,18 @@ exports.feishuPlugin = {
|
|
|
194
194
|
// Security
|
|
195
195
|
// -------------------------------------------------------------------------
|
|
196
196
|
security: {
|
|
197
|
-
collectWarnings: ({ cfg, accountId }) => (0, config_adapter_1.collectFeishuSecurityWarnings)({ cfg, accountId: accountId ??
|
|
197
|
+
collectWarnings: ({ cfg, accountId }) => (0, config_adapter_1.collectFeishuSecurityWarnings)({ cfg, accountId: accountId ?? account_id_1.DEFAULT_ACCOUNT_ID }),
|
|
198
198
|
},
|
|
199
199
|
// -------------------------------------------------------------------------
|
|
200
200
|
// Setup
|
|
201
201
|
// -------------------------------------------------------------------------
|
|
202
202
|
setup: {
|
|
203
|
-
resolveAccountId: () =>
|
|
203
|
+
resolveAccountId: () => account_id_1.DEFAULT_ACCOUNT_ID,
|
|
204
204
|
applyAccountConfig: ({ cfg, accountId }) => {
|
|
205
205
|
return (0, config_adapter_1.applyAccountConfig)(cfg, accountId, { enabled: true });
|
|
206
206
|
},
|
|
207
207
|
},
|
|
208
208
|
// -------------------------------------------------------------------------
|
|
209
|
-
// Onboarding
|
|
210
|
-
// -------------------------------------------------------------------------
|
|
211
|
-
onboarding: onboarding_1.feishuOnboardingAdapter,
|
|
212
|
-
// -------------------------------------------------------------------------
|
|
213
209
|
// Messaging
|
|
214
210
|
// -------------------------------------------------------------------------
|
|
215
211
|
messaging: {
|
|
@@ -253,7 +249,7 @@ exports.feishuPlugin = {
|
|
|
253
249
|
// -------------------------------------------------------------------------
|
|
254
250
|
status: {
|
|
255
251
|
defaultRuntime: {
|
|
256
|
-
accountId:
|
|
252
|
+
accountId: account_id_1.DEFAULT_ACCOUNT_ID,
|
|
257
253
|
running: false,
|
|
258
254
|
lastStartAt: null,
|
|
259
255
|
lastStopAt: null,
|
package/src/channel/probe.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.probeFeishu = probeFeishu;
|
|
8
|
-
const lark_client_1 = require("../core/lark-client");
|
|
8
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
9
9
|
/**
|
|
10
10
|
* Probe the Feishu bot connection by calling the bot/v3/info API.
|
|
11
11
|
*
|