@colinlu50/openclaw-lark-stream 2026.3.17
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 +141 -0
- package/README.zh.md +70 -0
- package/bin/openclaw-lark.js +48 -0
- package/index.d.ts +36 -0
- package/index.js +118 -0
- package/openclaw.plugin.json +10 -0
- package/package.json +66 -0
- package/skills/feishu-bitable/SKILL.md +248 -0
- package/skills/feishu-bitable/references/examples.md +813 -0
- package/skills/feishu-bitable/references/field-properties.md +763 -0
- package/skills/feishu-bitable/references/record-values.md +911 -0
- package/skills/feishu-calendar/SKILL.md +244 -0
- package/skills/feishu-channel-rules/SKILL.md +24 -0
- package/skills/feishu-channel-rules/references/markdown-syntax.md +138 -0
- package/skills/feishu-create-doc/SKILL.md +719 -0
- package/skills/feishu-fetch-doc/SKILL.md +93 -0
- package/skills/feishu-im-read/SKILL.md +163 -0
- package/skills/feishu-task/SKILL.md +293 -0
- package/skills/feishu-troubleshoot/SKILL.md +70 -0
- package/skills/feishu-update-doc/SKILL.md +285 -0
- package/src/card/builder.d.ts +106 -0
- package/src/card/builder.js +443 -0
- package/src/card/cardkit.d.ts +90 -0
- package/src/card/cardkit.js +181 -0
- package/src/card/flush-controller.d.ts +45 -0
- package/src/card/flush-controller.js +134 -0
- package/src/card/image-resolver.d.ts +45 -0
- package/src/card/image-resolver.js +112 -0
- package/src/card/markdown-style.d.ts +16 -0
- package/src/card/markdown-style.js +97 -0
- package/src/card/reply-dispatcher-types.d.ts +120 -0
- package/src/card/reply-dispatcher-types.js +57 -0
- package/src/card/reply-dispatcher.d.ts +15 -0
- package/src/card/reply-dispatcher.js +299 -0
- package/src/card/reply-mode.d.ts +38 -0
- package/src/card/reply-mode.js +65 -0
- package/src/card/streaming-card-controller.d.ts +101 -0
- package/src/card/streaming-card-controller.js +810 -0
- package/src/card/unavailable-guard.d.ts +35 -0
- package/src/card/unavailable-guard.js +83 -0
- package/src/channel/abort-detect.d.ts +34 -0
- package/src/channel/abort-detect.js +124 -0
- package/src/channel/chat-queue.d.ts +41 -0
- package/src/channel/chat-queue.js +58 -0
- package/src/channel/config-adapter.d.ts +23 -0
- package/src/channel/config-adapter.js +101 -0
- package/src/channel/directory.d.ts +57 -0
- package/src/channel/directory.js +191 -0
- package/src/channel/event-handlers.d.ts +15 -0
- package/src/channel/event-handlers.js +221 -0
- package/src/channel/monitor.d.ts +17 -0
- package/src/channel/monitor.js +129 -0
- package/src/channel/onboarding-config.d.ts +17 -0
- package/src/channel/onboarding-config.js +88 -0
- package/src/channel/onboarding-migrate.d.ts +25 -0
- package/src/channel/onboarding-migrate.js +67 -0
- package/src/channel/onboarding.d.ts +12 -0
- package/src/channel/onboarding.js +296 -0
- package/src/channel/plugin.d.ts +13 -0
- package/src/channel/plugin.js +278 -0
- package/src/channel/probe.d.ts +14 -0
- package/src/channel/probe.js +21 -0
- package/src/channel/types.d.ts +36 -0
- package/src/channel/types.js +7 -0
- package/src/commands/auth.d.ts +21 -0
- package/src/commands/auth.js +161 -0
- package/src/commands/diagnose.d.ts +69 -0
- package/src/commands/diagnose.js +807 -0
- package/src/commands/doctor.d.ts +26 -0
- package/src/commands/doctor.js +584 -0
- package/src/commands/index.d.ts +25 -0
- package/src/commands/index.js +212 -0
- package/src/commands/locale.d.ts +7 -0
- package/src/commands/locale.js +7 -0
- package/src/core/accounts.d.ts +37 -0
- package/src/core/accounts.js +163 -0
- package/src/core/agent-config.d.ts +100 -0
- package/src/core/agent-config.js +139 -0
- package/src/core/api-error.d.ts +48 -0
- package/src/core/api-error.js +112 -0
- package/src/core/app-owner-fallback.d.ts +21 -0
- package/src/core/app-owner-fallback.js +38 -0
- package/src/core/app-scope-checker.d.ts +87 -0
- package/src/core/app-scope-checker.js +190 -0
- package/src/core/auth-errors.d.ts +144 -0
- package/src/core/auth-errors.js +154 -0
- package/src/core/chat-info-cache.d.ts +57 -0
- package/src/core/chat-info-cache.js +152 -0
- package/src/core/config-schema.d.ts +448 -0
- package/src/core/config-schema.js +200 -0
- package/src/core/device-flow.d.ts +77 -0
- package/src/core/device-flow.js +212 -0
- package/src/core/domains.d.ts +18 -0
- package/src/core/domains.js +28 -0
- package/src/core/feishu-fetch.d.ts +18 -0
- package/src/core/feishu-fetch.js +25 -0
- package/src/core/footer-config.d.ts +24 -0
- package/src/core/footer-config.js +39 -0
- package/src/core/lark-client.d.ts +108 -0
- package/src/core/lark-client.js +353 -0
- package/src/core/lark-logger.d.ts +23 -0
- package/src/core/lark-logger.js +154 -0
- package/src/core/lark-ticket.d.ts +29 -0
- package/src/core/lark-ticket.js +35 -0
- package/src/core/message-unavailable.d.ts +53 -0
- package/src/core/message-unavailable.js +130 -0
- package/src/core/owner-policy.d.ts +31 -0
- package/src/core/owner-policy.js +52 -0
- package/src/core/permission-url.d.ts +22 -0
- package/src/core/permission-url.js +72 -0
- package/src/core/raw-request.d.ts +27 -0
- package/src/core/raw-request.js +62 -0
- package/src/core/scope-manager.d.ts +168 -0
- package/src/core/scope-manager.js +213 -0
- package/src/core/security-check.d.ts +72 -0
- package/src/core/security-check.js +174 -0
- package/src/core/shutdown-hooks.d.ts +22 -0
- package/src/core/shutdown-hooks.js +56 -0
- package/src/core/targets.d.ts +60 -0
- package/src/core/targets.js +164 -0
- package/src/core/token-store.d.ts +54 -0
- package/src/core/token-store.js +314 -0
- package/src/core/tool-client.d.ts +176 -0
- package/src/core/tool-client.js +380 -0
- package/src/core/tool-scopes.d.ts +153 -0
- package/src/core/tool-scopes.js +326 -0
- package/src/core/tools-config.d.ts +55 -0
- package/src/core/tools-config.js +137 -0
- package/src/core/types.d.ts +87 -0
- package/src/core/types.js +11 -0
- package/src/core/uat-client.d.ts +46 -0
- package/src/core/uat-client.js +187 -0
- package/src/core/version.d.ts +25 -0
- package/src/core/version.js +49 -0
- package/src/messaging/converters/audio.d.ts +8 -0
- package/src/messaging/converters/audio.js +21 -0
- package/src/messaging/converters/calendar.d.ts +13 -0
- package/src/messaging/converters/calendar.js +50 -0
- package/src/messaging/converters/content-converter.d.ts +41 -0
- package/src/messaging/converters/content-converter.js +106 -0
- package/src/messaging/converters/file.d.ts +8 -0
- package/src/messaging/converters/file.js +20 -0
- package/src/messaging/converters/folder.d.ts +8 -0
- package/src/messaging/converters/folder.js +20 -0
- package/src/messaging/converters/hongbao.d.ts +8 -0
- package/src/messaging/converters/hongbao.js +16 -0
- package/src/messaging/converters/image.d.ts +8 -0
- package/src/messaging/converters/image.js +18 -0
- package/src/messaging/converters/index.d.ts +8 -0
- package/src/messaging/converters/index.js +50 -0
- package/src/messaging/converters/interactive/card-converter.d.ts +76 -0
- package/src/messaging/converters/interactive/card-converter.js +1173 -0
- package/src/messaging/converters/interactive/card-utils.d.ts +9 -0
- package/src/messaging/converters/interactive/card-utils.js +42 -0
- package/src/messaging/converters/interactive/index.d.ts +8 -0
- package/src/messaging/converters/interactive/index.js +21 -0
- package/src/messaging/converters/interactive/legacy.d.ts +11 -0
- package/src/messaging/converters/interactive/legacy.js +57 -0
- package/src/messaging/converters/interactive/types.d.ts +23 -0
- package/src/messaging/converters/interactive/types.js +24 -0
- package/src/messaging/converters/location.d.ts +8 -0
- package/src/messaging/converters/location.js +19 -0
- package/src/messaging/converters/merge-forward.d.ts +32 -0
- package/src/messaging/converters/merge-forward.js +225 -0
- package/src/messaging/converters/post.d.ts +11 -0
- package/src/messaging/converters/post.js +135 -0
- package/src/messaging/converters/share.d.ts +9 -0
- package/src/messaging/converters/share.js +23 -0
- package/src/messaging/converters/sticker.d.ts +8 -0
- package/src/messaging/converters/sticker.js +18 -0
- package/src/messaging/converters/system.d.ts +12 -0
- package/src/messaging/converters/system.js +32 -0
- package/src/messaging/converters/text.d.ts +8 -0
- package/src/messaging/converters/text.js +14 -0
- package/src/messaging/converters/todo.d.ts +8 -0
- package/src/messaging/converters/todo.js +41 -0
- package/src/messaging/converters/types.d.ts +107 -0
- package/src/messaging/converters/types.js +7 -0
- package/src/messaging/converters/unknown.d.ts +8 -0
- package/src/messaging/converters/unknown.js +16 -0
- package/src/messaging/converters/utils.d.ts +22 -0
- package/src/messaging/converters/utils.js +51 -0
- package/src/messaging/converters/video-chat.d.ts +8 -0
- package/src/messaging/converters/video-chat.js +23 -0
- package/src/messaging/converters/video.d.ts +8 -0
- package/src/messaging/converters/video.js +32 -0
- package/src/messaging/converters/vote.d.ts +8 -0
- package/src/messaging/converters/vote.js +24 -0
- package/src/messaging/inbound/dedup.d.ts +59 -0
- package/src/messaging/inbound/dedup.js +116 -0
- package/src/messaging/inbound/dispatch-builders.d.ts +84 -0
- package/src/messaging/inbound/dispatch-builders.js +152 -0
- package/src/messaging/inbound/dispatch-commands.d.ts +27 -0
- package/src/messaging/inbound/dispatch-commands.js +112 -0
- package/src/messaging/inbound/dispatch-context.d.ts +67 -0
- package/src/messaging/inbound/dispatch-context.js +136 -0
- package/src/messaging/inbound/dispatch.d.ts +47 -0
- package/src/messaging/inbound/dispatch.js +264 -0
- package/src/messaging/inbound/enrich.d.ts +102 -0
- package/src/messaging/inbound/enrich.js +227 -0
- package/src/messaging/inbound/gate-effects.d.ts +23 -0
- package/src/messaging/inbound/gate-effects.js +43 -0
- package/src/messaging/inbound/gate.d.ts +60 -0
- package/src/messaging/inbound/gate.js +233 -0
- package/src/messaging/inbound/handler.d.ts +35 -0
- package/src/messaging/inbound/handler.js +173 -0
- package/src/messaging/inbound/media-resolver.d.ts +32 -0
- package/src/messaging/inbound/media-resolver.js +87 -0
- package/src/messaging/inbound/mention.d.ts +39 -0
- package/src/messaging/inbound/mention.js +81 -0
- package/src/messaging/inbound/parse-io.d.ts +50 -0
- package/src/messaging/inbound/parse-io.js +81 -0
- package/src/messaging/inbound/parse.d.ts +28 -0
- package/src/messaging/inbound/parse.js +106 -0
- package/src/messaging/inbound/permission.d.ts +17 -0
- package/src/messaging/inbound/permission.js +40 -0
- package/src/messaging/inbound/policy.d.ts +94 -0
- package/src/messaging/inbound/policy.js +160 -0
- package/src/messaging/inbound/reaction-handler.d.ts +61 -0
- package/src/messaging/inbound/reaction-handler.js +221 -0
- package/src/messaging/inbound/user-name-cache.d.ts +82 -0
- package/src/messaging/inbound/user-name-cache.js +241 -0
- package/src/messaging/outbound/actions.d.ts +16 -0
- package/src/messaging/outbound/actions.js +309 -0
- package/src/messaging/outbound/chat-manage.d.ts +64 -0
- package/src/messaging/outbound/chat-manage.js +111 -0
- package/src/messaging/outbound/deliver.d.ts +155 -0
- package/src/messaging/outbound/deliver.js +298 -0
- package/src/messaging/outbound/fetch.d.ts +12 -0
- package/src/messaging/outbound/fetch.js +12 -0
- package/src/messaging/outbound/forward.d.ts +26 -0
- package/src/messaging/outbound/forward.js +48 -0
- package/src/messaging/outbound/media-url-utils.d.ts +29 -0
- package/src/messaging/outbound/media-url-utils.js +130 -0
- package/src/messaging/outbound/media.d.ts +260 -0
- package/src/messaging/outbound/media.js +758 -0
- package/src/messaging/outbound/outbound.d.ts +89 -0
- package/src/messaging/outbound/outbound.js +121 -0
- package/src/messaging/outbound/reactions.d.ts +124 -0
- package/src/messaging/outbound/reactions.js +378 -0
- package/src/messaging/outbound/send.d.ts +152 -0
- package/src/messaging/outbound/send.js +355 -0
- package/src/messaging/outbound/typing.d.ts +71 -0
- package/src/messaging/outbound/typing.js +179 -0
- package/src/messaging/shared/message-lookup.d.ts +54 -0
- package/src/messaging/shared/message-lookup.js +117 -0
- package/src/messaging/types.d.ts +176 -0
- package/src/messaging/types.js +10 -0
- package/src/tools/auto-auth.d.ts +56 -0
- package/src/tools/auto-auth.js +919 -0
- package/src/tools/helpers.d.ts +260 -0
- package/src/tools/helpers.js +364 -0
- package/src/tools/mcp/doc/create.d.ts +12 -0
- package/src/tools/mcp/doc/create.js +44 -0
- package/src/tools/mcp/doc/fetch.d.ts +12 -0
- package/src/tools/mcp/doc/fetch.js +36 -0
- package/src/tools/mcp/doc/index.d.ts +12 -0
- package/src/tools/mcp/doc/index.js +41 -0
- package/src/tools/mcp/doc/update.d.ts +12 -0
- package/src/tools/mcp/doc/update.js +61 -0
- package/src/tools/mcp/shared.d.ts +59 -0
- package/src/tools/mcp/shared.js +226 -0
- package/src/tools/oapi/bitable/app-table-field.d.ts +16 -0
- package/src/tools/oapi/bitable/app-table-field.js +222 -0
- package/src/tools/oapi/bitable/app-table-record.d.ts +20 -0
- package/src/tools/oapi/bitable/app-table-record.js +436 -0
- package/src/tools/oapi/bitable/app-table-view.d.ts +17 -0
- package/src/tools/oapi/bitable/app-table-view.js +195 -0
- package/src/tools/oapi/bitable/app-table.d.ts +19 -0
- package/src/tools/oapi/bitable/app-table.js +247 -0
- package/src/tools/oapi/bitable/app.d.ts +18 -0
- package/src/tools/oapi/bitable/app.js +186 -0
- package/src/tools/oapi/bitable/index.d.ts +9 -0
- package/src/tools/oapi/bitable/index.js +9 -0
- package/src/tools/oapi/calendar/calendar.d.ts +15 -0
- package/src/tools/oapi/calendar/calendar.js +122 -0
- package/src/tools/oapi/calendar/event-attendee.d.ts +16 -0
- package/src/tools/oapi/calendar/event-attendee.js +263 -0
- package/src/tools/oapi/calendar/event.d.ts +16 -0
- package/src/tools/oapi/calendar/event.js +709 -0
- package/src/tools/oapi/calendar/freebusy.d.ts +13 -0
- package/src/tools/oapi/calendar/freebusy.js +111 -0
- package/src/tools/oapi/calendar/index.d.ts +8 -0
- package/src/tools/oapi/calendar/index.js +8 -0
- package/src/tools/oapi/chat/chat.d.ts +16 -0
- package/src/tools/oapi/chat/chat.js +124 -0
- package/src/tools/oapi/chat/index.d.ts +10 -0
- package/src/tools/oapi/chat/index.js +15 -0
- package/src/tools/oapi/chat/members.d.ts +11 -0
- package/src/tools/oapi/chat/members.js +81 -0
- package/src/tools/oapi/common/get-user.d.ts +12 -0
- package/src/tools/oapi/common/get-user.js +106 -0
- package/src/tools/oapi/common/index.d.ts +6 -0
- package/src/tools/oapi/common/index.js +6 -0
- package/src/tools/oapi/common/search-user.d.ts +11 -0
- package/src/tools/oapi/common/search-user.js +73 -0
- package/src/tools/oapi/drive/doc-comments.d.ts +15 -0
- package/src/tools/oapi/drive/doc-comments.js +279 -0
- package/src/tools/oapi/drive/doc-media.d.ts +19 -0
- package/src/tools/oapi/drive/doc-media.js +335 -0
- package/src/tools/oapi/drive/file.d.ts +19 -0
- package/src/tools/oapi/drive/file.js +483 -0
- package/src/tools/oapi/drive/index.d.ts +12 -0
- package/src/tools/oapi/drive/index.js +36 -0
- package/src/tools/oapi/helpers.d.ts +182 -0
- package/src/tools/oapi/helpers.js +354 -0
- package/src/tools/oapi/im/format-messages.d.ts +50 -0
- package/src/tools/oapi/im/format-messages.js +165 -0
- package/src/tools/oapi/im/index.d.ts +10 -0
- package/src/tools/oapi/im/index.js +17 -0
- package/src/tools/oapi/im/message-read.d.ts +13 -0
- package/src/tools/oapi/im/message-read.js +411 -0
- package/src/tools/oapi/im/message.d.ts +16 -0
- package/src/tools/oapi/im/message.js +149 -0
- package/src/tools/oapi/im/resource.d.ts +13 -0
- package/src/tools/oapi/im/resource.js +150 -0
- package/src/tools/oapi/im/time-utils.d.ts +46 -0
- package/src/tools/oapi/im/time-utils.js +201 -0
- package/src/tools/oapi/im/user-name-uat.d.ts +26 -0
- package/src/tools/oapi/im/user-name-uat.js +140 -0
- package/src/tools/oapi/index.d.ts +11 -0
- package/src/tools/oapi/index.js +58 -0
- package/src/tools/oapi/sdk-types.d.ts +96 -0
- package/src/tools/oapi/sdk-types.js +12 -0
- package/src/tools/oapi/search/doc-search.d.ts +13 -0
- package/src/tools/oapi/search/doc-search.js +191 -0
- package/src/tools/oapi/search/index.d.ts +12 -0
- package/src/tools/oapi/search/index.js +33 -0
- package/src/tools/oapi/sheets/index.d.ts +12 -0
- package/src/tools/oapi/sheets/index.js +31 -0
- package/src/tools/oapi/sheets/sheet.d.ts +16 -0
- package/src/tools/oapi/sheets/sheet.js +652 -0
- package/src/tools/oapi/task/comment.d.ts +15 -0
- package/src/tools/oapi/task/comment.js +140 -0
- package/src/tools/oapi/task/index.d.ts +8 -0
- package/src/tools/oapi/task/index.js +8 -0
- package/src/tools/oapi/task/subtask.d.ts +14 -0
- package/src/tools/oapi/task/subtask.js +162 -0
- package/src/tools/oapi/task/task.d.ts +16 -0
- package/src/tools/oapi/task/task.js +344 -0
- package/src/tools/oapi/task/tasklist.d.ts +21 -0
- package/src/tools/oapi/task/tasklist.js +321 -0
- package/src/tools/oapi/wiki/index.d.ts +12 -0
- package/src/tools/oapi/wiki/index.js +34 -0
- package/src/tools/oapi/wiki/space-node.d.ts +17 -0
- package/src/tools/oapi/wiki/space-node.js +230 -0
- package/src/tools/oapi/wiki/space.d.ts +15 -0
- package/src/tools/oapi/wiki/space.js +130 -0
- package/src/tools/oauth-batch-auth.d.ts +11 -0
- package/src/tools/oauth-batch-auth.js +142 -0
- package/src/tools/oauth-cards.d.ts +39 -0
- package/src/tools/oauth-cards.js +315 -0
- package/src/tools/oauth.d.ts +47 -0
- package/src/tools/oauth.js +620 -0
- package/src/tools/onboarding-auth.d.ts +27 -0
- package/src/tools/onboarding-auth.js +130 -0
- package/src/tools/tat/im/index.d.ts +15 -0
- package/src/tools/tat/im/index.js +18 -0
- package/src/tools/tat/im/resource.d.ts +15 -0
- package/src/tools/tat/im/resource.js +157 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
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,141 @@
|
|
|
1
|
+
[English](#english) | [中文](#中文)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<a id="english"></a>
|
|
6
|
+
|
|
7
|
+
# OpenClaw Lark/Feishu Plugin — Stream Card Fork
|
|
8
|
+
|
|
9
|
+
Fork of the official [openclaw-larksuite](https://github.com/larksuite/openclaw-larksuite) plugin with **streaming block output** and **tool call indicators**.
|
|
10
|
+
|
|
11
|
+
## What's Changed
|
|
12
|
+
|
|
13
|
+
The official plugin delivers LLM block results all at once after completion. This fork enables:
|
|
14
|
+
|
|
15
|
+
- **Real-time block streaming** — each block's content is progressively appended to the streaming card as it's generated
|
|
16
|
+
- **Tool call indicators** — when the agent calls a tool, the card shows tool call status in real-time
|
|
17
|
+
|
|
18
|
+
### Modified Files
|
|
19
|
+
|
|
20
|
+
- `src/card/reply-dispatcher.ts` — enable block streaming in streaming card mode; wire `onToolStart` callback
|
|
21
|
+
- `src/card/streaming-card-controller.ts` — append each delivered block to the card in real-time; add `onToolStart()` to display tool call status
|
|
22
|
+
- `src/card/builder.ts` — collapsible panel for tool call summary in completed cards
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Requires [OpenClaw](https://openclaw.ai) (>= 2026.2.26) and Node.js (>= v22).
|
|
27
|
+
|
|
28
|
+
### Option A: npm install (recommended)
|
|
29
|
+
|
|
30
|
+
If you've never installed the official Feishu plugin, install the official one first to complete the guided setup:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx -y @larksuite/openclaw-lark install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then replace with the stream fork:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx -y @colinlu50/openclaw-lark-stream install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If you already have the official plugin installed, just run the second command directly.
|
|
43
|
+
|
|
44
|
+
### Option B: From source (for development)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd ~/.openclaw/extensions
|
|
48
|
+
rm -rf openclaw-lark
|
|
49
|
+
git clone git@github.com:ColinLu50/openclaw-lark-stream.git openclaw-lark
|
|
50
|
+
cd openclaw-lark && npm install
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Restart OpenClaw.
|
|
54
|
+
|
|
55
|
+
## Configuration
|
|
56
|
+
|
|
57
|
+
Enable optional card footer metadata:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
openclaw config set channels.feishu.footer.elapsed true # show elapsed time
|
|
61
|
+
openclaw config set channels.feishu.footer.status true # show completion status
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- **elapsed** — displays total response time (e.g. `Elapsed 3.2s`) in the card footer
|
|
65
|
+
- **status** — displays completion state (`Completed` / `Error` / `Stopped`) in the card footer
|
|
66
|
+
|
|
67
|
+
Both default to `false` (hidden).
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT — same as the upstream project.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
<a id="中文"></a>
|
|
76
|
+
|
|
77
|
+
# OpenClaw 飞书插件 — 流式卡片 Fork
|
|
78
|
+
|
|
79
|
+
基于官方 [openclaw-larksuite](https://github.com/larksuite/openclaw-larksuite) 插件的 Fork,支持**流式分块输出**和**工具调用状态展示**。
|
|
80
|
+
|
|
81
|
+
## 改动说明
|
|
82
|
+
|
|
83
|
+
官方插件在 LLM 生成完一个 block 后才一次性推送结果。本 Fork 实现了:
|
|
84
|
+
|
|
85
|
+
- **实时流式追加** — 每个 block 的内容在生成过程中逐步追加到流式卡片,让用户获得即时的视觉反馈
|
|
86
|
+
- **工具调用状态** — 当 agent 调用工具时,卡片实时显示工具调用状态
|
|
87
|
+
|
|
88
|
+
### 改动文件
|
|
89
|
+
|
|
90
|
+
- `src/card/reply-dispatcher.ts` — 在流式卡片模式下启用 block 流式输出;接入 `onToolStart` 回调
|
|
91
|
+
- `src/card/streaming-card-controller.ts` — 将每个已交付的 block 实时追加到卡片;添加 `onToolStart()` 显示工具调用状态
|
|
92
|
+
- `src/card/builder.ts` — 完成卡片中工具调用摘要的折叠面板
|
|
93
|
+
|
|
94
|
+
## 安装
|
|
95
|
+
|
|
96
|
+
需要 [OpenClaw](https://openclaw.ai)(>= 2026.2.26)和 Node.js(>= v22)。
|
|
97
|
+
|
|
98
|
+
### 方式 A:npm 安装(推荐)
|
|
99
|
+
|
|
100
|
+
如果从未安装过官方飞书插件,先安装官方版本完成引导配置:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx -y @larksuite/openclaw-lark install
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
然后用流式 Fork 替换:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npx -y @colinlu50/openclaw-lark-stream install
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
如果已安装过官方插件,直接运行第二条命令即可。
|
|
113
|
+
|
|
114
|
+
### 方式 B:从源码安装(用于开发)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cd ~/.openclaw/extensions
|
|
118
|
+
rm -rf openclaw-lark
|
|
119
|
+
git clone git@github.com:ColinLu50/openclaw-lark-stream.git openclaw-lark
|
|
120
|
+
cd openclaw-lark && npm install
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
重启 OpenClaw。
|
|
124
|
+
|
|
125
|
+
## 配置
|
|
126
|
+
|
|
127
|
+
开启可选的卡片底栏元信息:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
openclaw config set channels.feishu.footer.elapsed true # 开启耗时
|
|
131
|
+
openclaw config set channels.feishu.footer.status true # 开启状态展示
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- **elapsed** — 在卡片底栏显示总响应耗时(如 `耗时 3.2s`)
|
|
135
|
+
- **status** — 在卡片底栏显示完成状态(`已完成` / `出错` / `已停止`)
|
|
136
|
+
|
|
137
|
+
两者默认为 `false`(不显示)。
|
|
138
|
+
|
|
139
|
+
## 许可证
|
|
140
|
+
|
|
141
|
+
MIT — 与上游项目相同。
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# OpenClaw Lark/飞书 插件
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.npmjs.com/package/@larksuite/openclaw-lark)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
[English](./README.md) | 中文版
|
|
8
|
+
|
|
9
|
+
这是 OpenClaw 的官方 Lark/飞书 插件,由 Lark/飞书开放平台团队开发和维护。它将你的 OpenClaw Agent 无缝对接到 Lark/飞书 工作区,赋予其直接读写消息、文档、多维表格、日历、任务等应用的能力。
|
|
10
|
+
|
|
11
|
+
## 特性
|
|
12
|
+
|
|
13
|
+
本插件为 OpenClaw 提供了全面的 Lark/飞书集成能力,主要包括:
|
|
14
|
+
|
|
15
|
+
| 类别 | 能力 |
|
|
16
|
+
|------|------|
|
|
17
|
+
| 💬 消息 | 消息读取(群聊/单聊历史、话题回复)、消息发送、消息回复、消息搜索、图片/文件下载 |
|
|
18
|
+
| 📄 文档 | 创建云文档、更新云文档、读取云文档内容 |
|
|
19
|
+
| 📊 多维表格 | 创建/管理多维表格、数据表、字段、记录(增删改查、批量操作、高级筛选)、视图 |
|
|
20
|
+
| 📈 电子表格 | 创建、编辑、查看电子表格 |
|
|
21
|
+
| 📅 日历日程 | 日历管理、日程管理(创建/查询/修改/删除/搜索)、参会人管理、忙闲查询 |
|
|
22
|
+
| ✅ 任务 | 任务管理(创建/查询/更新/完成)、清单管理、子任务、评论 |
|
|
23
|
+
|
|
24
|
+
此外,插件还支持:
|
|
25
|
+
- **📱 交互式卡片**:实时状态更新(思考中/生成中/完成状态),提供敏感操作的确认按钮
|
|
26
|
+
- **🌊 流式回复**:在消息卡片中提供实时的流式响应
|
|
27
|
+
- **🔒 权限策略**:为私聊和群聊提供灵活的访问控制策略
|
|
28
|
+
- **⚙️ 高级群组配置**:每个群聊的独立设置,包括白名单、技能绑定和自定义系统提示词
|
|
29
|
+
|
|
30
|
+
## 安全与风险提示(使用前必读)
|
|
31
|
+
本插件对接 OpenClaw AI 自动化能力,存在模型幻觉、执行不可控、提示词注入等固有风险;授权飞书权限后,OpenClaw 将以您的用户身份在授权范围内执行操作,可能导致敏感数据泄露、越权操作等高风险后果,请您谨慎操作和使用。
|
|
32
|
+
为降低上述风险,插件已在多个层面启用默认安全保护以降低上述风险,但上述风险仍然存在。我们强烈建议不要主动修改任何默认安全配置;一旦放开相关限制,上述风险将显著提高,由此产生的后果需由您自行承担。
|
|
33
|
+
我们建议您将接入 OpenClaw 的飞书机器人作为私人对话助手使用,请勿将其拉入群聊或允许其他用户与其交互,以避免权限被滥用或数据泄露。
|
|
34
|
+
请您充分知悉全部使用风险,使用本插件即视为您自愿承担相关所有责任。
|
|
35
|
+
|
|
36
|
+
**免责声明:**
|
|
37
|
+
|
|
38
|
+
本软件的代码采用MIT许可证。
|
|
39
|
+
该软件运行时会调用Lark/飞书开放平台的API,使用这些API需要遵守如下协议和隐私政策:
|
|
40
|
+
|
|
41
|
+
- [飞书用户服务协议](https://www.feishu.cn/terms)
|
|
42
|
+
- [飞书隐私政策](https://www.feishu.cn/privacy)
|
|
43
|
+
- [飞书开放平台独立软件服务商安全管理运营规范](https://open.larkoffice.com/document/uAjLw4CM/uMzNwEjLzcDMx4yM3ATM/management-practice/app-service-provider-security-management-specifications)
|
|
44
|
+
- [Lark用户服务协议](https://www.larksuite.com/user-terms-of-service)
|
|
45
|
+
- [Lark隐私政策](https://www.larksuite.com/privacy-policy)
|
|
46
|
+
|
|
47
|
+
## 安装与要求
|
|
48
|
+
|
|
49
|
+
在开始之前,请确保你已准备好以下各项:
|
|
50
|
+
|
|
51
|
+
- **Node.js**: `v22` 或更高版本。
|
|
52
|
+
- **OpenClaw**: OpenClaw 已成功安装并可运行。详情请访问 [OpenClaw 官方网站](https://openclaw.ai)。
|
|
53
|
+
|
|
54
|
+
> **注意**:OpenClaw 版本需在 **2026.2.26** 及以上,可通过 `openclaw -v` 命令查看。如果低于该版本可能出现异常,执行以下命令升级:
|
|
55
|
+
> ```bash
|
|
56
|
+
> npm install -g openclaw
|
|
57
|
+
> ```
|
|
58
|
+
|
|
59
|
+
## 使用说明
|
|
60
|
+
[OpenClaw Lark/飞书官方插件使用指南](https://bytedance.larkoffice.com/docx/MFK7dDFLFoVlOGxWCv5cTXKmnMh)
|
|
61
|
+
|
|
62
|
+
## 贡献
|
|
63
|
+
|
|
64
|
+
我们欢迎社区的贡献!如果你发现 Bug 或有功能建议,请随时提交 [Issue](https://github.com/larksuite/openclaw-larksuite/issues) 或 [Pull Request](https://github.com/larksuite/openclaw-larksuite/pulls)。
|
|
65
|
+
|
|
66
|
+
对于较大的改动,我们建议你先通过 Issue 与我们讨论。
|
|
67
|
+
|
|
68
|
+
## 许可证
|
|
69
|
+
|
|
70
|
+
本项目基于 **MIT 许可证**。详情请参阅 [LICENSE](./LICENSE.md) 文件。
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
|
|
6
|
+
// --tools-version <ver> lets the user pin a specific version
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
let version = "latest";
|
|
9
|
+
|
|
10
|
+
const vIdx = args.indexOf("--tools-version");
|
|
11
|
+
if (vIdx !== -1) {
|
|
12
|
+
version = args[vIdx + 1];
|
|
13
|
+
// Remove --tools-version <ver> from forwarded args
|
|
14
|
+
args.splice(vIdx, 2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const allArgs = ["--yes", `@larksuite/openclaw-lark-tools@${version}`, ...args];
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
if (process.platform === "win32") {
|
|
21
|
+
// On Windows, npx is a .cmd shim that can be broken or trigger
|
|
22
|
+
// DEP0190. Bypass it entirely: run node with the npx-cli.js
|
|
23
|
+
// script located next to the running node binary.
|
|
24
|
+
const npxCli = join(
|
|
25
|
+
dirname(process.execPath),
|
|
26
|
+
"node_modules",
|
|
27
|
+
"npm",
|
|
28
|
+
"bin",
|
|
29
|
+
"npx-cli.js",
|
|
30
|
+
);
|
|
31
|
+
execFileSync(process.execPath, [npxCli, ...allArgs], {
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
env: {
|
|
34
|
+
...process.env,
|
|
35
|
+
NODE_OPTIONS: [
|
|
36
|
+
process.env.NODE_OPTIONS,
|
|
37
|
+
"--disable-warning=DEP0190",
|
|
38
|
+
]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join(" "),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
} else {
|
|
44
|
+
execFileSync("npx", allArgs, { stdio: "inherit" });
|
|
45
|
+
}
|
|
46
|
+
} catch (error) {
|
|
47
|
+
process.exit(error.status ?? 1);
|
|
48
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* OpenClaw Lark/Feishu plugin entry point.
|
|
6
|
+
*
|
|
7
|
+
* Registers the Feishu channel and all tool families:
|
|
8
|
+
* doc, wiki, drive, perm, bitable, task, calendar.
|
|
9
|
+
*/
|
|
10
|
+
import type { OpenClawPluginApi } from 'openclaw/plugin-sdk';
|
|
11
|
+
export { monitorFeishuProvider } from './src/channel/monitor';
|
|
12
|
+
export { sendMessageFeishu, sendCardFeishu, updateCardFeishu, editMessageFeishu } from './src/messaging/outbound/send';
|
|
13
|
+
export { getMessageFeishu } from './src/messaging/outbound/fetch';
|
|
14
|
+
export { uploadImageLark, uploadFileLark, sendImageLark, sendFileLark, sendAudioLark, uploadAndSendMediaLark, } from './src/messaging/outbound/media';
|
|
15
|
+
export { sendTextLark, sendCardLark, sendMediaLark, type SendTextLarkParams, type SendCardLarkParams, type SendMediaLarkParams, } from './src/messaging/outbound/deliver';
|
|
16
|
+
export { type FeishuChannelData } from './src/messaging/outbound/outbound';
|
|
17
|
+
export { probeFeishu } from './src/channel/probe';
|
|
18
|
+
export { addReactionFeishu, removeReactionFeishu, listReactionsFeishu, FeishuEmoji, VALID_FEISHU_EMOJI_TYPES, } from './src/messaging/outbound/reactions';
|
|
19
|
+
export { forwardMessageFeishu } from './src/messaging/outbound/forward';
|
|
20
|
+
export { updateChatFeishu, addChatMembersFeishu, removeChatMembersFeishu, listChatMembersFeishu, } from './src/messaging/outbound/chat-manage';
|
|
21
|
+
export { feishuMessageActions } from './src/messaging/outbound/actions';
|
|
22
|
+
export { mentionedBot, nonBotMentions, extractMessageBody, formatMentionForText, formatMentionForCard, formatMentionAllForText, formatMentionAllForCard, buildMentionedMessage, buildMentionedCardContent, type MentionInfo, } from './src/messaging/inbound/mention';
|
|
23
|
+
export { feishuPlugin } from './src/channel/plugin';
|
|
24
|
+
export type { MessageContext, RawMessage, RawSender, FeishuMessageContext, FeishuReactionCreatedEvent, } from './src/messaging/types';
|
|
25
|
+
export { handleFeishuReaction } from './src/messaging/inbound/reaction-handler';
|
|
26
|
+
export { parseMessageEvent } from './src/messaging/inbound/parse';
|
|
27
|
+
export { checkMessageGate } from './src/messaging/inbound/gate';
|
|
28
|
+
export { isMessageExpired } from './src/messaging/inbound/dedup';
|
|
29
|
+
declare const plugin: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
configSchema: import("openclaw/plugin-sdk").OpenClawPluginConfigSchema;
|
|
34
|
+
register(api: OpenClawPluginApi): void;
|
|
35
|
+
};
|
|
36
|
+
export default plugin;
|
package/index.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* OpenClaw Lark/Feishu plugin entry point.
|
|
6
|
+
*
|
|
7
|
+
* Registers the Feishu channel and all tool families:
|
|
8
|
+
* doc, wiki, drive, perm, bitable, task, calendar.
|
|
9
|
+
*/
|
|
10
|
+
import { emptyPluginConfigSchema } from 'openclaw/plugin-sdk';
|
|
11
|
+
import { feishuPlugin } from './src/channel/plugin';
|
|
12
|
+
import { LarkClient } from './src/core/lark-client';
|
|
13
|
+
import { registerOapiTools } from './src/tools/oapi/index';
|
|
14
|
+
import { registerFeishuMcpDocTools } from './src/tools/mcp/doc/index';
|
|
15
|
+
import { registerFeishuOAuthTool } from './src/tools/oauth';
|
|
16
|
+
import { registerFeishuOAuthBatchAuthTool } from './src/tools/oauth-batch-auth';
|
|
17
|
+
import { runDiagnosis, formatDiagReportCli, traceByMessageId, formatTraceOutput, analyzeTrace, } from './src/commands/diagnose';
|
|
18
|
+
import { registerCommands } from './src/commands/index';
|
|
19
|
+
import { larkLogger } from './src/core/lark-logger';
|
|
20
|
+
import { emitSecurityWarnings } from './src/core/security-check';
|
|
21
|
+
const log = larkLogger('plugin');
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Re-exports for external consumers
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
export { monitorFeishuProvider } from './src/channel/monitor';
|
|
26
|
+
export { sendMessageFeishu, sendCardFeishu, updateCardFeishu, editMessageFeishu } from './src/messaging/outbound/send';
|
|
27
|
+
export { getMessageFeishu } from './src/messaging/outbound/fetch';
|
|
28
|
+
export { uploadImageLark, uploadFileLark, sendImageLark, sendFileLark, sendAudioLark, uploadAndSendMediaLark, } from './src/messaging/outbound/media';
|
|
29
|
+
export { sendTextLark, sendCardLark, sendMediaLark, } from './src/messaging/outbound/deliver';
|
|
30
|
+
export { probeFeishu } from './src/channel/probe';
|
|
31
|
+
export { addReactionFeishu, removeReactionFeishu, listReactionsFeishu, FeishuEmoji, VALID_FEISHU_EMOJI_TYPES, } from './src/messaging/outbound/reactions';
|
|
32
|
+
export { forwardMessageFeishu } from './src/messaging/outbound/forward';
|
|
33
|
+
export { updateChatFeishu, addChatMembersFeishu, removeChatMembersFeishu, listChatMembersFeishu, } from './src/messaging/outbound/chat-manage';
|
|
34
|
+
export { feishuMessageActions } from './src/messaging/outbound/actions';
|
|
35
|
+
export { mentionedBot, nonBotMentions, extractMessageBody, formatMentionForText, formatMentionForCard, formatMentionAllForText, formatMentionAllForCard, buildMentionedMessage, buildMentionedCardContent, } from './src/messaging/inbound/mention';
|
|
36
|
+
export { feishuPlugin } from './src/channel/plugin';
|
|
37
|
+
export { handleFeishuReaction } from './src/messaging/inbound/reaction-handler';
|
|
38
|
+
export { parseMessageEvent } from './src/messaging/inbound/parse';
|
|
39
|
+
export { checkMessageGate } from './src/messaging/inbound/gate';
|
|
40
|
+
export { isMessageExpired } from './src/messaging/inbound/dedup';
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// Plugin definition
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
const plugin = {
|
|
45
|
+
id: 'openclaw-lark',
|
|
46
|
+
name: 'Feishu',
|
|
47
|
+
description: 'Lark/Feishu channel plugin with im/doc/wiki/drive/task/calendar tools',
|
|
48
|
+
configSchema: emptyPluginConfigSchema(),
|
|
49
|
+
register(api) {
|
|
50
|
+
LarkClient.setRuntime(api.runtime);
|
|
51
|
+
api.registerChannel({ plugin: feishuPlugin });
|
|
52
|
+
// ========================================
|
|
53
|
+
// Register OAPI tools (calendar, task - using Feishu Open API directly)
|
|
54
|
+
registerOapiTools(api);
|
|
55
|
+
// Register MCP doc tools (using Model Context Protocol)
|
|
56
|
+
registerFeishuMcpDocTools(api);
|
|
57
|
+
// Register OAuth tool (UAT device flow authorization)
|
|
58
|
+
registerFeishuOAuthTool(api);
|
|
59
|
+
// Register OAuth batch auth tool (batch authorization for all app scopes)
|
|
60
|
+
registerFeishuOAuthBatchAuthTool(api);
|
|
61
|
+
// ---- Tool call hooks (auto-trace AI tool invocations) ----
|
|
62
|
+
api.on('before_tool_call', (event) => {
|
|
63
|
+
log.info(`tool call: ${event.toolName} params=${JSON.stringify(event.params)}`);
|
|
64
|
+
});
|
|
65
|
+
api.on('after_tool_call', (event) => {
|
|
66
|
+
if (event.error) {
|
|
67
|
+
log.error(`tool fail: ${event.toolName} ${event.error} (${event.durationMs ?? 0}ms)`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
log.info(`tool done: ${event.toolName} ok (${event.durationMs ?? 0}ms)`);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
// ---- Diagnostic commands ----
|
|
74
|
+
// CLI: openclaw feishu-diagnose [--trace <messageId>]
|
|
75
|
+
api.registerCli((ctx) => {
|
|
76
|
+
ctx.program
|
|
77
|
+
.command('feishu-diagnose')
|
|
78
|
+
.description('运行飞书插件诊断,检查配置、连通性和权限状态')
|
|
79
|
+
.option('--trace <messageId>', '按 message_id 追踪完整处理链路')
|
|
80
|
+
.option('--analyze', '分析追踪日志(需配合 --trace 使用)')
|
|
81
|
+
.action(async (opts) => {
|
|
82
|
+
try {
|
|
83
|
+
if (opts.trace) {
|
|
84
|
+
const lines = await traceByMessageId(opts.trace);
|
|
85
|
+
// eslint-disable-next-line no-console -- CLI 命令直接输出到终端
|
|
86
|
+
console.log(formatTraceOutput(lines, opts.trace));
|
|
87
|
+
if (opts.analyze && lines.length > 0) {
|
|
88
|
+
// eslint-disable-next-line no-console -- CLI 命令直接输出到终端
|
|
89
|
+
console.log(analyzeTrace(lines, opts.trace));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
const report = await runDiagnosis({
|
|
94
|
+
config: ctx.config,
|
|
95
|
+
logger: ctx.logger,
|
|
96
|
+
});
|
|
97
|
+
// eslint-disable-next-line no-console -- CLI 命令直接输出到终端
|
|
98
|
+
console.log(formatDiagReportCli(report));
|
|
99
|
+
if (report.overallStatus === 'unhealthy') {
|
|
100
|
+
process.exitCode = 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
ctx.logger.error(`诊断命令执行失败: ${err}`);
|
|
106
|
+
process.exitCode = 1;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}, { commands: ['feishu-diagnose'] });
|
|
110
|
+
// Chat commands: /feishu_diagnose, /feishu_doctor, /feishu_auth, /feishu
|
|
111
|
+
registerCommands(api);
|
|
112
|
+
// ---- Multi-account security checks ----
|
|
113
|
+
if (api.config) {
|
|
114
|
+
emitSecurityWarnings(api.config, api.logger);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
export default plugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@colinlu50/openclaw-lark-stream",
|
|
3
|
+
"version": "2026.3.17",
|
|
4
|
+
"description": "OpenClaw Lark/Feishu channel plugin",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"openclaw-lark": "bin/openclaw-lark.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.js",
|
|
11
|
+
"index.d.ts",
|
|
12
|
+
"src/**/*.js",
|
|
13
|
+
"src/**/*.d.ts",
|
|
14
|
+
"bin/",
|
|
15
|
+
"skills/",
|
|
16
|
+
"openclaw.plugin.json",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "node scripts/build.mjs",
|
|
22
|
+
"release": "node scripts/release.mjs",
|
|
23
|
+
"lint": "eslint src/ index.ts",
|
|
24
|
+
"lint:fix": "eslint src/ index.ts --fix",
|
|
25
|
+
"format": "prettier --write src/**/*.ts",
|
|
26
|
+
"format:check": "prettier --check src/**/*.ts"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
30
|
+
"@sinclair/typebox": "0.34.48",
|
|
31
|
+
"image-size": "^2.0.2",
|
|
32
|
+
"zod": "^4.3.6"
|
|
33
|
+
},
|
|
34
|
+
"openclaw": {
|
|
35
|
+
"extensions": [
|
|
36
|
+
"./index.js"
|
|
37
|
+
],
|
|
38
|
+
"channel": {
|
|
39
|
+
"id": "openclaw-lark",
|
|
40
|
+
"label": "Feishu",
|
|
41
|
+
"selectionLabel": "Lark/Feishu (飞书)",
|
|
42
|
+
"docsPath": "/channels/feishu",
|
|
43
|
+
"docsLabel": "feishu",
|
|
44
|
+
"blurb": "飞书/Lark enterprise messaging with doc/wiki/drive/task/calendar tools.",
|
|
45
|
+
"aliases": [
|
|
46
|
+
"lark"
|
|
47
|
+
],
|
|
48
|
+
"order": 35,
|
|
49
|
+
"quickstartAllowFrom": true
|
|
50
|
+
},
|
|
51
|
+
"install": {
|
|
52
|
+
"npmSpec": "@colinlu50/openclaw-lark-stream",
|
|
53
|
+
"localPath": "extensions/feishu",
|
|
54
|
+
"defaultChoice": "npm"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"main": "index.js",
|
|
58
|
+
"types": "index.d.ts",
|
|
59
|
+
"exports": {
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./index.d.ts",
|
|
62
|
+
"import": "./index.js",
|
|
63
|
+
"default": "./index.js"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|