@larksuite/openclaw-lark 2025.7.15-beta.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 +76 -0
- package/bin/openclaw-lark.js +39 -0
- package/index.d.ts +36 -0
- package/index.js +188 -0
- package/openclaw.plugin.json +64 -0
- package/package.json +63 -0
- package/secret-contract-api.d.ts +15 -0
- package/secret-contract-api.js +78 -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 +242 -0
- package/skills/feishu-channel-rules/SKILL.md +18 -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 +340 -0
- package/skills/feishu-troubleshoot/SKILL.md +70 -0
- package/skills/feishu-update-doc/SKILL.md +285 -0
- package/src/card/builder.d.ts +152 -0
- package/src/card/builder.js +794 -0
- package/src/card/card-error.d.ts +91 -0
- package/src/card/card-error.js +206 -0
- package/src/card/cardkit.d.ts +90 -0
- package/src/card/cardkit.js +203 -0
- package/src/card/flush-controller.d.ts +45 -0
- package/src/card/flush-controller.js +138 -0
- package/src/card/image-resolver.d.ts +45 -0
- package/src/card/image-resolver.js +116 -0
- package/src/card/markdown-style.d.ts +16 -0
- package/src/card/markdown-style.js +106 -0
- package/src/card/reasoning-utils.d.ts +14 -0
- package/src/card/reasoning-utils.js +64 -0
- package/src/card/reply-dispatcher-types.d.ts +132 -0
- package/src/card/reply-dispatcher-types.js +61 -0
- package/src/card/reply-dispatcher.d.ts +15 -0
- package/src/card/reply-dispatcher.js +447 -0
- package/src/card/reply-mode.d.ts +41 -0
- package/src/card/reply-mode.js +70 -0
- package/src/card/streaming-card-controller.d.ts +118 -0
- package/src/card/streaming-card-controller.js +1045 -0
- package/src/card/tool-use-config.d.ts +26 -0
- package/src/card/tool-use-config.js +76 -0
- package/src/card/tool-use-display.d.ts +37 -0
- package/src/card/tool-use-display.js +476 -0
- package/src/card/tool-use-trace-store.d.ts +51 -0
- package/src/card/tool-use-trace-store.js +271 -0
- package/src/card/unavailable-guard.d.ts +35 -0
- package/src/card/unavailable-guard.js +87 -0
- package/src/channel/abort-detect.d.ts +47 -0
- package/src/channel/abort-detect.js +219 -0
- package/src/channel/chat-queue.d.ts +41 -0
- package/src/channel/chat-queue.js +68 -0
- package/src/channel/config-adapter.d.ts +23 -0
- package/src/channel/config-adapter.js +107 -0
- package/src/channel/directory.d.ts +57 -0
- package/src/channel/directory.js +197 -0
- package/src/channel/event-handlers.d.ts +17 -0
- package/src/channel/event-handlers.js +380 -0
- package/src/channel/interactive-dispatch.d.ts +59 -0
- package/src/channel/interactive-dispatch.js +195 -0
- package/src/channel/monitor.d.ts +17 -0
- package/src/channel/monitor.js +140 -0
- package/src/channel/onboarding-config.d.ts +18 -0
- package/src/channel/onboarding-config.js +96 -0
- package/src/channel/onboarding-migrate.d.ts +25 -0
- package/src/channel/onboarding-migrate.js +70 -0
- package/src/channel/onboarding.d.ts +12 -0
- package/src/channel/onboarding.js +300 -0
- package/src/channel/plugin.d.ts +13 -0
- package/src/channel/plugin.js +310 -0
- package/src/channel/probe.d.ts +14 -0
- package/src/channel/probe.js +24 -0
- package/src/channel/types.d.ts +37 -0
- package/src/channel/types.js +8 -0
- package/src/commands/auth.d.ts +21 -0
- package/src/commands/auth.js +165 -0
- package/src/commands/diagnose.d.ts +69 -0
- package/src/commands/diagnose.js +848 -0
- package/src/commands/doctor.d.ts +27 -0
- package/src/commands/doctor.js +588 -0
- package/src/commands/index.d.ts +25 -0
- package/src/commands/index.js +219 -0
- package/src/commands/locale.d.ts +7 -0
- package/src/commands/locale.js +8 -0
- package/src/core/accounts.d.ts +51 -0
- package/src/core/accounts.js +219 -0
- package/src/core/agent-config.d.ts +100 -0
- package/src/core/agent-config.js +148 -0
- package/src/core/api-error.d.ts +48 -0
- package/src/core/api-error.js +117 -0
- package/src/core/app-owner-fallback.d.ts +22 -0
- package/src/core/app-owner-fallback.js +39 -0
- package/src/core/app-scope-checker.d.ts +87 -0
- package/src/core/app-scope-checker.js +198 -0
- package/src/core/auth-errors.d.ts +144 -0
- package/src/core/auth-errors.js +160 -0
- package/src/core/card-action-operator.d.ts +33 -0
- package/src/core/card-action-operator.js +30 -0
- package/src/core/chat-info-cache.d.ts +67 -0
- package/src/core/chat-info-cache.js +165 -0
- package/src/core/comment-target.d.ts +65 -0
- package/src/core/comment-target.js +100 -0
- package/src/core/config-schema.d.ts +490 -0
- package/src/core/config-schema.js +223 -0
- package/src/core/device-flow.d.ts +77 -0
- package/src/core/device-flow.js +217 -0
- package/src/core/domains.d.ts +18 -0
- package/src/core/domains.js +34 -0
- package/src/core/feishu-fetch.d.ts +18 -0
- package/src/core/feishu-fetch.js +28 -0
- package/src/core/footer-config.d.ts +24 -0
- package/src/core/footer-config.js +51 -0
- package/src/core/lark-client.d.ts +125 -0
- package/src/core/lark-client.js +468 -0
- package/src/core/lark-logger.d.ts +23 -0
- package/src/core/lark-logger.js +160 -0
- package/src/core/lark-ticket.d.ts +29 -0
- package/src/core/lark-ticket.js +40 -0
- package/src/core/message-unavailable.d.ts +53 -0
- package/src/core/message-unavailable.js +142 -0
- package/src/core/owner-policy.d.ts +32 -0
- package/src/core/owner-policy.js +55 -0
- package/src/core/permission-url.d.ts +22 -0
- package/src/core/permission-url.js +76 -0
- package/src/core/raw-request.d.ts +27 -0
- package/src/core/raw-request.js +90 -0
- package/src/core/runtime-store.d.ts +13 -0
- package/src/core/runtime-store.js +29 -0
- package/src/core/scope-manager.d.ts +168 -0
- package/src/core/scope-manager.js +224 -0
- package/src/core/sdk-compat.d.ts +20 -0
- package/src/core/sdk-compat.js +28 -0
- package/src/core/security-check.d.ts +72 -0
- package/src/core/security-check.js +184 -0
- package/src/core/shutdown-hooks.d.ts +22 -0
- package/src/core/shutdown-hooks.js +61 -0
- package/src/core/synthetic-target.d.ts +33 -0
- package/src/core/synthetic-target.js +40 -0
- package/src/core/targets.d.ts +60 -0
- package/src/core/targets.js +173 -0
- package/src/core/token-store.d.ts +54 -0
- package/src/core/token-store.js +326 -0
- package/src/core/tool-client.d.ts +176 -0
- package/src/core/tool-client.js +426 -0
- package/src/core/tool-scopes.d.ts +156 -0
- package/src/core/tool-scopes.js +344 -0
- package/src/core/tools-config.d.ts +55 -0
- package/src/core/tools-config.js +143 -0
- package/src/core/types.d.ts +91 -0
- package/src/core/types.js +12 -0
- package/src/core/uat-client.d.ts +46 -0
- package/src/core/uat-client.js +192 -0
- package/src/core/version.d.ts +31 -0
- package/src/core/version.js +69 -0
- package/src/messaging/converters/audio.d.ts +8 -0
- package/src/messaging/converters/audio.js +24 -0
- package/src/messaging/converters/calendar.d.ts +13 -0
- package/src/messaging/converters/calendar.js +56 -0
- package/src/messaging/converters/content-converter-helpers.d.ts +30 -0
- package/src/messaging/converters/content-converter-helpers.js +82 -0
- package/src/messaging/converters/content-converter.d.ts +24 -0
- package/src/messaging/converters/content-converter.js +40 -0
- package/src/messaging/converters/file.d.ts +8 -0
- package/src/messaging/converters/file.js +24 -0
- package/src/messaging/converters/folder.d.ts +8 -0
- package/src/messaging/converters/folder.js +24 -0
- package/src/messaging/converters/hongbao.d.ts +8 -0
- package/src/messaging/converters/hongbao.js +20 -0
- package/src/messaging/converters/image.d.ts +8 -0
- package/src/messaging/converters/image.js +22 -0
- package/src/messaging/converters/index.d.ts +8 -0
- package/src/messaging/converters/index.js +53 -0
- package/src/messaging/converters/interactive/card-converter.d.ts +76 -0
- package/src/messaging/converters/interactive/card-converter.js +1177 -0
- package/src/messaging/converters/interactive/card-utils.d.ts +9 -0
- package/src/messaging/converters/interactive/card-utils.js +47 -0
- package/src/messaging/converters/interactive/index.d.ts +8 -0
- package/src/messaging/converters/interactive/index.js +25 -0
- package/src/messaging/converters/interactive/legacy.d.ts +11 -0
- package/src/messaging/converters/interactive/legacy.js +60 -0
- package/src/messaging/converters/interactive/types.d.ts +23 -0
- package/src/messaging/converters/interactive/types.js +27 -0
- package/src/messaging/converters/location.d.ts +8 -0
- package/src/messaging/converters/location.js +23 -0
- package/src/messaging/converters/merge-forward.d.ts +32 -0
- package/src/messaging/converters/merge-forward.js +235 -0
- package/src/messaging/converters/post.d.ts +11 -0
- package/src/messaging/converters/post.js +235 -0
- package/src/messaging/converters/share.d.ts +9 -0
- package/src/messaging/converters/share.js +28 -0
- package/src/messaging/converters/sticker.d.ts +8 -0
- package/src/messaging/converters/sticker.js +22 -0
- package/src/messaging/converters/system.d.ts +12 -0
- package/src/messaging/converters/system.js +36 -0
- package/src/messaging/converters/text.d.ts +8 -0
- package/src/messaging/converters/text.js +18 -0
- package/src/messaging/converters/todo.d.ts +8 -0
- package/src/messaging/converters/todo.js +45 -0
- package/src/messaging/converters/types.d.ts +114 -0
- package/src/messaging/converters/types.js +8 -0
- package/src/messaging/converters/unknown.d.ts +8 -0
- package/src/messaging/converters/unknown.js +20 -0
- package/src/messaging/converters/utils.d.ts +22 -0
- package/src/messaging/converters/utils.js +57 -0
- package/src/messaging/converters/video-chat.d.ts +8 -0
- package/src/messaging/converters/video-chat.js +31 -0
- package/src/messaging/converters/video.d.ts +8 -0
- package/src/messaging/converters/video.js +35 -0
- package/src/messaging/converters/vote.d.ts +8 -0
- package/src/messaging/converters/vote.js +28 -0
- package/src/messaging/inbound/bot-content.d.ts +84 -0
- package/src/messaging/inbound/bot-content.js +117 -0
- package/src/messaging/inbound/bot-loop-guard.d.ts +48 -0
- package/src/messaging/inbound/bot-loop-guard.js +89 -0
- package/src/messaging/inbound/comment-context.d.ts +82 -0
- package/src/messaging/inbound/comment-context.js +353 -0
- package/src/messaging/inbound/comment-handler.d.ts +30 -0
- package/src/messaging/inbound/comment-handler.js +269 -0
- package/src/messaging/inbound/dedup.d.ts +59 -0
- package/src/messaging/inbound/dedup.js +121 -0
- package/src/messaging/inbound/dispatch-builders.d.ts +104 -0
- package/src/messaging/inbound/dispatch-builders.js +241 -0
- package/src/messaging/inbound/dispatch-commands.d.ts +22 -0
- package/src/messaging/inbound/dispatch-commands.js +131 -0
- package/src/messaging/inbound/dispatch-context.d.ts +67 -0
- package/src/messaging/inbound/dispatch-context.js +153 -0
- package/src/messaging/inbound/dispatch.d.ts +50 -0
- package/src/messaging/inbound/dispatch.js +477 -0
- package/src/messaging/inbound/enrich.d.ts +102 -0
- package/src/messaging/inbound/enrich.js +236 -0
- package/src/messaging/inbound/gate-effects.d.ts +23 -0
- package/src/messaging/inbound/gate-effects.js +46 -0
- package/src/messaging/inbound/gate.d.ts +91 -0
- package/src/messaging/inbound/gate.js +342 -0
- package/src/messaging/inbound/handler-registry.d.ts +25 -0
- package/src/messaging/inbound/handler-registry.js +23 -0
- package/src/messaging/inbound/handler.d.ts +37 -0
- package/src/messaging/inbound/handler.js +286 -0
- package/src/messaging/inbound/media-resolver.d.ts +32 -0
- package/src/messaging/inbound/media-resolver.js +91 -0
- package/src/messaging/inbound/mention-registry.d.ts +59 -0
- package/src/messaging/inbound/mention-registry.js +115 -0
- package/src/messaging/inbound/mention.d.ts +48 -0
- package/src/messaging/inbound/mention.js +102 -0
- package/src/messaging/inbound/parse-io.d.ts +50 -0
- package/src/messaging/inbound/parse-io.js +86 -0
- package/src/messaging/inbound/parse.d.ts +28 -0
- package/src/messaging/inbound/parse.js +128 -0
- package/src/messaging/inbound/permission.d.ts +17 -0
- package/src/messaging/inbound/permission.js +44 -0
- package/src/messaging/inbound/policy.d.ts +95 -0
- package/src/messaging/inbound/policy.js +168 -0
- package/src/messaging/inbound/reaction-handler.d.ts +62 -0
- package/src/messaging/inbound/reaction-handler.js +259 -0
- package/src/messaging/inbound/sentinel-store.d.ts +37 -0
- package/src/messaging/inbound/sentinel-store.js +98 -0
- package/src/messaging/inbound/synthetic-message.d.ts +26 -0
- package/src/messaging/inbound/synthetic-message.js +59 -0
- package/src/messaging/inbound/user-name-cache-store.d.ts +62 -0
- package/src/messaging/inbound/user-name-cache-store.js +236 -0
- package/src/messaging/inbound/user-name-cache.d.ts +78 -0
- package/src/messaging/inbound/user-name-cache.js +306 -0
- package/src/messaging/inbound/vc-meeting-invited-handler.d.ts +20 -0
- package/src/messaging/inbound/vc-meeting-invited-handler.js +236 -0
- package/src/messaging/inbound/vc-sender.d.ts +41 -0
- package/src/messaging/inbound/vc-sender.js +53 -0
- package/src/messaging/outbound/actions.d.ts +16 -0
- package/src/messaging/outbound/actions.js +329 -0
- package/src/messaging/outbound/bot-peer-context.d.ts +42 -0
- package/src/messaging/outbound/bot-peer-context.js +40 -0
- package/src/messaging/outbound/chat-manage.d.ts +64 -0
- package/src/messaging/outbound/chat-manage.js +117 -0
- package/src/messaging/outbound/deliver.d.ts +186 -0
- package/src/messaging/outbound/deliver.js +410 -0
- package/src/messaging/outbound/fetch.d.ts +12 -0
- package/src/messaging/outbound/fetch.js +17 -0
- package/src/messaging/outbound/forward.d.ts +26 -0
- package/src/messaging/outbound/forward.js +51 -0
- package/src/messaging/outbound/media-url-utils.d.ts +29 -0
- package/src/messaging/outbound/media-url-utils.js +172 -0
- package/src/messaging/outbound/media.d.ts +260 -0
- package/src/messaging/outbound/media.js +865 -0
- package/src/messaging/outbound/normalize-mentions.d.ts +50 -0
- package/src/messaging/outbound/normalize-mentions.js +166 -0
- package/src/messaging/outbound/outbound-mention.d.ts +41 -0
- package/src/messaging/outbound/outbound-mention.js +112 -0
- package/src/messaging/outbound/outbound.d.ts +79 -0
- package/src/messaging/outbound/outbound.js +195 -0
- package/src/messaging/outbound/reactions.d.ts +124 -0
- package/src/messaging/outbound/reactions.js +384 -0
- package/src/messaging/outbound/send.d.ts +153 -0
- package/src/messaging/outbound/send.js +417 -0
- package/src/messaging/outbound/typing.d.ts +60 -0
- package/src/messaging/outbound/typing.js +139 -0
- package/src/messaging/shared/message-lookup.d.ts +54 -0
- package/src/messaging/shared/message-lookup.js +120 -0
- package/src/messaging/types.d.ts +316 -0
- package/src/messaging/types.js +11 -0
- package/src/tools/ask-user-question.d.ts +32 -0
- package/src/tools/ask-user-question.js +922 -0
- package/src/tools/auto-auth.d.ts +57 -0
- package/src/tools/auto-auth.js +904 -0
- package/src/tools/helpers.d.ts +264 -0
- package/src/tools/helpers.js +389 -0
- package/src/tools/mcp/doc/create.d.ts +12 -0
- package/src/tools/mcp/doc/create.js +47 -0
- package/src/tools/mcp/doc/fetch.d.ts +12 -0
- package/src/tools/mcp/doc/fetch.js +39 -0
- package/src/tools/mcp/doc/index.d.ts +12 -0
- package/src/tools/mcp/doc/index.js +50 -0
- package/src/tools/mcp/doc/update.d.ts +12 -0
- package/src/tools/mcp/doc/update.js +64 -0
- package/src/tools/mcp/shared.d.ts +59 -0
- package/src/tools/mcp/shared.js +239 -0
- package/src/tools/oapi/bitable/app-table-field.d.ts +16 -0
- package/src/tools/oapi/bitable/app-table-field.js +225 -0
- package/src/tools/oapi/bitable/app-table-record.d.ts +20 -0
- package/src/tools/oapi/bitable/app-table-record.js +439 -0
- package/src/tools/oapi/bitable/app-table-view.d.ts +16 -0
- package/src/tools/oapi/bitable/app-table-view.js +172 -0
- package/src/tools/oapi/bitable/app-table.d.ts +17 -0
- package/src/tools/oapi/bitable/app-table.js +195 -0
- package/src/tools/oapi/bitable/app.d.ts +18 -0
- package/src/tools/oapi/bitable/app.js +189 -0
- package/src/tools/oapi/bitable/index.d.ts +9 -0
- package/src/tools/oapi/bitable/index.js +17 -0
- package/src/tools/oapi/calendar/calendar.d.ts +15 -0
- package/src/tools/oapi/calendar/calendar.js +125 -0
- package/src/tools/oapi/calendar/event-attendee.d.ts +14 -0
- package/src/tools/oapi/calendar/event-attendee.js +161 -0
- package/src/tools/oapi/calendar/event.d.ts +16 -0
- package/src/tools/oapi/calendar/event.js +712 -0
- package/src/tools/oapi/calendar/freebusy.d.ts +13 -0
- package/src/tools/oapi/calendar/freebusy.js +114 -0
- package/src/tools/oapi/calendar/index.d.ts +8 -0
- package/src/tools/oapi/calendar/index.js +15 -0
- package/src/tools/oapi/chat/chat.d.ts +16 -0
- package/src/tools/oapi/chat/chat.js +127 -0
- package/src/tools/oapi/chat/index.d.ts +10 -0
- package/src/tools/oapi/chat/index.js +23 -0
- package/src/tools/oapi/chat/members.d.ts +11 -0
- package/src/tools/oapi/chat/members.js +84 -0
- package/src/tools/oapi/common/get-user.d.ts +12 -0
- package/src/tools/oapi/common/get-user.js +109 -0
- package/src/tools/oapi/common/index.d.ts +6 -0
- package/src/tools/oapi/common/index.js +11 -0
- package/src/tools/oapi/common/search-user.d.ts +11 -0
- package/src/tools/oapi/common/search-user.js +76 -0
- package/src/tools/oapi/drive/doc-comments.d.ts +15 -0
- package/src/tools/oapi/drive/doc-comments.js +351 -0
- package/src/tools/oapi/drive/doc-media.d.ts +19 -0
- package/src/tools/oapi/drive/doc-media.js +371 -0
- package/src/tools/oapi/drive/file.d.ts +19 -0
- package/src/tools/oapi/drive/file.js +519 -0
- package/src/tools/oapi/drive/index.d.ts +12 -0
- package/src/tools/oapi/drive/index.js +45 -0
- package/src/tools/oapi/helpers.d.ts +183 -0
- package/src/tools/oapi/helpers.js +385 -0
- package/src/tools/oapi/im/format-messages.d.ts +50 -0
- package/src/tools/oapi/im/format-messages.js +169 -0
- package/src/tools/oapi/im/index.d.ts +10 -0
- package/src/tools/oapi/im/index.js +25 -0
- package/src/tools/oapi/im/message-read.d.ts +13 -0
- package/src/tools/oapi/im/message-read.js +419 -0
- package/src/tools/oapi/im/message.d.ts +16 -0
- package/src/tools/oapi/im/message.js +152 -0
- package/src/tools/oapi/im/resource.d.ts +13 -0
- package/src/tools/oapi/im/resource.js +186 -0
- package/src/tools/oapi/im/time-utils.d.ts +46 -0
- package/src/tools/oapi/im/time-utils.js +212 -0
- package/src/tools/oapi/im/user-name-uat.d.ts +26 -0
- package/src/tools/oapi/im/user-name-uat.js +143 -0
- package/src/tools/oapi/index.d.ts +11 -0
- package/src/tools/oapi/index.js +64 -0
- package/src/tools/oapi/sdk-types.d.ts +96 -0
- package/src/tools/oapi/sdk-types.js +13 -0
- package/src/tools/oapi/search/doc-search.d.ts +13 -0
- package/src/tools/oapi/search/doc-search.js +194 -0
- package/src/tools/oapi/search/index.d.ts +12 -0
- package/src/tools/oapi/search/index.js +37 -0
- package/src/tools/oapi/sheets/index.d.ts +12 -0
- package/src/tools/oapi/sheets/index.js +35 -0
- package/src/tools/oapi/sheets/sheet.d.ts +16 -0
- package/src/tools/oapi/sheets/sheet.js +688 -0
- package/src/tools/oapi/task/attachment.d.ts +18 -0
- package/src/tools/oapi/task/attachment.js +107 -0
- package/src/tools/oapi/task/comment.d.ts +15 -0
- package/src/tools/oapi/task/comment.js +149 -0
- package/src/tools/oapi/task/index.d.ts +11 -0
- package/src/tools/oapi/task/index.js +21 -0
- package/src/tools/oapi/task/section.d.ts +17 -0
- package/src/tools/oapi/task/section.js +293 -0
- package/src/tools/oapi/task/subtask.d.ts +14 -0
- package/src/tools/oapi/task/subtask.js +171 -0
- package/src/tools/oapi/task/task.d.ts +19 -0
- package/src/tools/oapi/task/task.js +512 -0
- package/src/tools/oapi/task/task_agent.d.ts +14 -0
- package/src/tools/oapi/task/task_agent.js +108 -0
- package/src/tools/oapi/task/tasklist.d.ts +19 -0
- package/src/tools/oapi/task/tasklist.js +276 -0
- package/src/tools/oapi/wiki/index.d.ts +12 -0
- package/src/tools/oapi/wiki/index.js +42 -0
- package/src/tools/oapi/wiki/space-node.d.ts +17 -0
- package/src/tools/oapi/wiki/space-node.js +233 -0
- package/src/tools/oapi/wiki/space.d.ts +15 -0
- package/src/tools/oapi/wiki/space.js +133 -0
- package/src/tools/oauth-batch-auth.d.ts +11 -0
- package/src/tools/oauth-batch-auth.js +150 -0
- package/src/tools/oauth-cards.d.ts +39 -0
- package/src/tools/oauth-cards.js +324 -0
- package/src/tools/oauth.d.ts +47 -0
- package/src/tools/oauth.js +592 -0
- package/src/tools/onboarding-auth.d.ts +27 -0
- package/src/tools/onboarding-auth.js +133 -0
- package/src/tools/tat/im/index.d.ts +15 -0
- package/src/tools/tat/im/index.js +22 -0
- package/src/tools/tat/im/resource.d.ts +15 -0
- package/src/tools/tat/im/resource.js +192 -0
- package/tsdown.config.d.ts +2 -0
- package/tsdown.config.js +25 -0
- package/vitest.config.d.ts +2 -0
- package/vitest.config.js +12 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*
|
|
6
|
+
* Onboarding 预授权模块。
|
|
7
|
+
*
|
|
8
|
+
* 配对后自动发起 OAuth Device Flow,引导应用 owner 完成用户授权。
|
|
9
|
+
* 仅当配对用户 === 应用 owner 时触发。
|
|
10
|
+
*
|
|
11
|
+
* 飞书限制:单次 OAuth 最多 50 个 scope。
|
|
12
|
+
* 超过 50 个时自动分批处理,每批授权完成后自动发起下一批(链式触发)。
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.triggerOnboarding = triggerOnboarding;
|
|
16
|
+
const accounts_1 = require("../core/accounts.js");
|
|
17
|
+
const lark_client_1 = require("../core/lark-client.js");
|
|
18
|
+
const app_scope_checker_1 = require("../core/app-scope-checker.js");
|
|
19
|
+
const app_owner_fallback_1 = require("../core/app-owner-fallback.js");
|
|
20
|
+
const lark_logger_1 = require("../core/lark-logger.js");
|
|
21
|
+
const tool_scopes_1 = require("../core/tool-scopes.js");
|
|
22
|
+
const oauth_1 = require("./oauth.js");
|
|
23
|
+
const log = (0, lark_logger_1.larkLogger)('tools/onboarding-auth');
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Constants
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
const MAX_SCOPES_PER_BATCH = 100;
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Trigger onboarding
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
/**
|
|
32
|
+
* 配对后触发 onboarding OAuth 授权。
|
|
33
|
+
*
|
|
34
|
+
* 流程:
|
|
35
|
+
* 1. 检查 userOpenId === 应用 owner,不匹配则静默跳过
|
|
36
|
+
* 2. 读取 onboarding-scopes.json 中的 user scope 列表
|
|
37
|
+
* 3. 分批处理(每批最多 50 个),第一批直接发起 OAuth Device Flow
|
|
38
|
+
* 4. 每批授权完成后通过 onAuthComplete 回调自动发起下一批
|
|
39
|
+
*/
|
|
40
|
+
async function triggerOnboarding(params) {
|
|
41
|
+
const { cfg, userOpenId, accountId } = params;
|
|
42
|
+
const acct = (0, accounts_1.getLarkAccount)(cfg, accountId);
|
|
43
|
+
if (!acct.configured) {
|
|
44
|
+
log.warn(`account ${accountId} not configured, skipping`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const sdk = lark_client_1.LarkClient.fromAccount(acct).sdk;
|
|
48
|
+
const { appId } = acct;
|
|
49
|
+
// 1. 检查 userOpenId === 应用 owner(统一走 getAppOwnerFallback)
|
|
50
|
+
const ownerOpenId = await (0, app_owner_fallback_1.getAppOwnerFallback)(acct, sdk);
|
|
51
|
+
if (!ownerOpenId) {
|
|
52
|
+
log.info(`app ${appId} has no owner info, skipping`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (userOpenId !== ownerOpenId) {
|
|
56
|
+
log.info(`user ${userOpenId} is not app owner (${ownerOpenId}), skipping`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
log.info(`user ${userOpenId} is app owner, starting OAuth`);
|
|
60
|
+
// 3. 动态获取应用已开通的 user scope 列表
|
|
61
|
+
let allUserScopes;
|
|
62
|
+
try {
|
|
63
|
+
allUserScopes = await (0, app_scope_checker_1.getAppGrantedScopes)(sdk, appId, 'user');
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
log.warn(`failed to get app granted scopes: ${err}`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// 过滤掉敏感 scope
|
|
70
|
+
allUserScopes = (0, tool_scopes_1.filterSensitiveScopes)(allUserScopes);
|
|
71
|
+
if (allUserScopes.length === 0) {
|
|
72
|
+
log.info('no user scopes configured, skipping');
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// 4. 分批
|
|
76
|
+
const batches = [];
|
|
77
|
+
for (let i = 0; i < allUserScopes.length; i += MAX_SCOPES_PER_BATCH) {
|
|
78
|
+
batches.push(allUserScopes.slice(i, i + MAX_SCOPES_PER_BATCH));
|
|
79
|
+
}
|
|
80
|
+
log.info(`${allUserScopes.length} user scopes, ${batches.length} batch(es)`);
|
|
81
|
+
// 5. 链式发起授权(第一批同步发起,后续批次由 onAuthComplete 回调触发)
|
|
82
|
+
const startBatch = async (batchIndex) => {
|
|
83
|
+
if (batchIndex >= batches.length) {
|
|
84
|
+
log.info('all batches completed');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const batch = batches[batchIndex];
|
|
88
|
+
const scope = batch.join(' ');
|
|
89
|
+
let batchInfo = '';
|
|
90
|
+
if (batches.length > 1) {
|
|
91
|
+
batchInfo =
|
|
92
|
+
`\n\n📋 授权进度:第 ${batchIndex + 1}/${batches.length} 批` +
|
|
93
|
+
`(本批 ${batch.length} 个权限,共 ${allUserScopes.length} 个)`;
|
|
94
|
+
if (batchIndex < batches.length - 1) {
|
|
95
|
+
batchInfo += `\n授权完成后将自动发起下一批。`;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
batchInfo += `\n这是最后一批,授权完成后即可使用所有功能。`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const ticket = {
|
|
102
|
+
messageId: `onboarding:${Date.now()}`,
|
|
103
|
+
chatId: userOpenId,
|
|
104
|
+
accountId,
|
|
105
|
+
startTime: Date.now(),
|
|
106
|
+
senderOpenId: userOpenId,
|
|
107
|
+
chatType: 'p2p',
|
|
108
|
+
};
|
|
109
|
+
log.info(`starting batch ${batchIndex + 1}/${batches.length}, scopes=${batch.length}`);
|
|
110
|
+
try {
|
|
111
|
+
await (0, oauth_1.executeAuthorize)({
|
|
112
|
+
account: acct,
|
|
113
|
+
senderOpenId: userOpenId,
|
|
114
|
+
scope,
|
|
115
|
+
isBatchAuth: true,
|
|
116
|
+
totalAppScopes: allUserScopes.length,
|
|
117
|
+
alreadyGranted: batchIndex * MAX_SCOPES_PER_BATCH,
|
|
118
|
+
batchInfo,
|
|
119
|
+
skipSyntheticMessage: true,
|
|
120
|
+
cfg,
|
|
121
|
+
ticket,
|
|
122
|
+
onAuthComplete: async () => {
|
|
123
|
+
log.info(`batch ${batchIndex + 1}/${batches.length} auth completed`);
|
|
124
|
+
await startBatch(batchIndex + 1);
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
log.error(`batch ${batchIndex + 1} failed: ${err}`);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
await startBatch(0);
|
|
133
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* IM 工具集
|
|
6
|
+
* 统一导出所有即时通讯相关工具的注册函数
|
|
7
|
+
*/
|
|
8
|
+
import type { OpenClawPluginApi } from 'openclaw/plugin-sdk';
|
|
9
|
+
/**
|
|
10
|
+
* 注册所有 IM 工具
|
|
11
|
+
*
|
|
12
|
+
* Note: feishu_im_message_reaction 和 feishu_im_message_recall 已移除,
|
|
13
|
+
* 其功能由 ChannelMessageActionAdapter (actions.ts) 的 react/delete action 统一覆盖。
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerFeishuImTools(api: OpenClawPluginApi): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*
|
|
6
|
+
* IM 工具集
|
|
7
|
+
* 统一导出所有即时通讯相关工具的注册函数
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.registerFeishuImTools = registerFeishuImTools;
|
|
11
|
+
const resource_1 = require("./resource.js");
|
|
12
|
+
/**
|
|
13
|
+
* 注册所有 IM 工具
|
|
14
|
+
*
|
|
15
|
+
* Note: feishu_im_message_reaction 和 feishu_im_message_recall 已移除,
|
|
16
|
+
* 其功能由 ChannelMessageActionAdapter (actions.ts) 的 react/delete action 统一覆盖。
|
|
17
|
+
*/
|
|
18
|
+
function registerFeishuImTools(api) {
|
|
19
|
+
if ((0, resource_1.registerFeishuImBotImageTool)(api)) {
|
|
20
|
+
api.logger.debug?.('feishu_im: Registered feishu_im_bot_image');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*
|
|
5
|
+
* feishu_im_bot_image 工具
|
|
6
|
+
*
|
|
7
|
+
* 以机器人身份下载飞书 IM 消息中的图片/文件资源到本地。
|
|
8
|
+
*
|
|
9
|
+
* 飞书 API:
|
|
10
|
+
* - 下载资源: GET /open-apis/im/v1/messages/:message_id/resources/:file_key
|
|
11
|
+
* 权限: im:resource
|
|
12
|
+
* 凭证: tenant_access_token
|
|
13
|
+
*/
|
|
14
|
+
import type { OpenClawPluginApi } from 'openclaw/plugin-sdk';
|
|
15
|
+
export declare function registerFeishuImBotImageTool(api: OpenClawPluginApi): boolean;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026 ByteDance Ltd. and/or its affiliates
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*
|
|
6
|
+
* feishu_im_bot_image 工具
|
|
7
|
+
*
|
|
8
|
+
* 以机器人身份下载飞书 IM 消息中的图片/文件资源到本地。
|
|
9
|
+
*
|
|
10
|
+
* 飞书 API:
|
|
11
|
+
* - 下载资源: GET /open-apis/im/v1/messages/:message_id/resources/:file_key
|
|
12
|
+
* 权限: im:resource
|
|
13
|
+
* 凭证: tenant_access_token
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.registerFeishuImBotImageTool = registerFeishuImBotImageTool;
|
|
50
|
+
const fsPromises = __importStar(require("node:fs/promises"));
|
|
51
|
+
const path = __importStar(require("node:path"));
|
|
52
|
+
const temp_path_1 = require("openclaw/plugin-sdk/temp-path");
|
|
53
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
54
|
+
const helpers_1 = require("../../oapi/helpers.js");
|
|
55
|
+
// ===========================================================================
|
|
56
|
+
// Shared constants
|
|
57
|
+
// ===========================================================================
|
|
58
|
+
/** MIME type → 文件扩展名(下载时使用) */
|
|
59
|
+
const MIME_TO_EXT = {
|
|
60
|
+
'image/png': '.png',
|
|
61
|
+
'image/jpeg': '.jpg',
|
|
62
|
+
'image/jpg': '.jpg',
|
|
63
|
+
'image/gif': '.gif',
|
|
64
|
+
'image/webp': '.webp',
|
|
65
|
+
'image/svg+xml': '.svg',
|
|
66
|
+
'image/bmp': '.bmp',
|
|
67
|
+
'image/tiff': '.tiff',
|
|
68
|
+
'video/mp4': '.mp4',
|
|
69
|
+
'video/mpeg': '.mpeg',
|
|
70
|
+
'video/quicktime': '.mov',
|
|
71
|
+
'video/x-msvideo': '.avi',
|
|
72
|
+
'video/webm': '.webm',
|
|
73
|
+
'audio/mpeg': '.mp3',
|
|
74
|
+
'audio/wav': '.wav',
|
|
75
|
+
'audio/ogg': '.ogg',
|
|
76
|
+
'audio/mp4': '.m4a',
|
|
77
|
+
'application/pdf': '.pdf',
|
|
78
|
+
'application/msword': '.doc',
|
|
79
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': '.docx',
|
|
80
|
+
'application/vnd.ms-excel': '.xls',
|
|
81
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': '.xlsx',
|
|
82
|
+
'application/vnd.ms-powerpoint': '.ppt',
|
|
83
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation': '.pptx',
|
|
84
|
+
'application/zip': '.zip',
|
|
85
|
+
'application/x-rar-compressed': '.rar',
|
|
86
|
+
'text/plain': '.txt',
|
|
87
|
+
'application/json': '.json',
|
|
88
|
+
};
|
|
89
|
+
// ===========================================================================
|
|
90
|
+
// Shared helpers
|
|
91
|
+
// ===========================================================================
|
|
92
|
+
/**
|
|
93
|
+
* 从二进制响应中提取 Buffer、Content-Type。
|
|
94
|
+
* SDK 的二进制响应可能有 getReadableStream(),也可能直接是 Buffer 等格式。
|
|
95
|
+
*/
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
|
+
async function extractBuffer(res) {
|
|
98
|
+
let chunks;
|
|
99
|
+
if (typeof res.getReadableStream === 'function') {
|
|
100
|
+
const stream = res.getReadableStream();
|
|
101
|
+
chunks = [];
|
|
102
|
+
for await (const chunk of stream) {
|
|
103
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (Buffer.isBuffer(res)) {
|
|
107
|
+
chunks = [res];
|
|
108
|
+
}
|
|
109
|
+
else if (Buffer.isBuffer(res?.data)) {
|
|
110
|
+
chunks = [res.data];
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
throw new Error('无法从响应中提取二进制数据');
|
|
114
|
+
}
|
|
115
|
+
const buffer = Buffer.concat(chunks);
|
|
116
|
+
const contentType = res.headers?.['content-type'] ?? '';
|
|
117
|
+
return { buffer, contentType };
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* 将 buffer 保存到临时文件,返回路径。
|
|
121
|
+
*/
|
|
122
|
+
async function saveToTempFile(buffer, contentType, prefix) {
|
|
123
|
+
const mimeType = contentType ? contentType.split(';')[0].trim() : '';
|
|
124
|
+
const mimeExt = mimeType ? MIME_TO_EXT[mimeType] : undefined;
|
|
125
|
+
const filePath = (0, temp_path_1.buildRandomTempFilePath)({
|
|
126
|
+
prefix,
|
|
127
|
+
extension: mimeExt,
|
|
128
|
+
});
|
|
129
|
+
await fsPromises.mkdir(path.dirname(filePath), { recursive: true });
|
|
130
|
+
await fsPromises.writeFile(filePath, buffer);
|
|
131
|
+
return filePath;
|
|
132
|
+
}
|
|
133
|
+
// ===========================================================================
|
|
134
|
+
// Download tool — feishu_im_bot_image
|
|
135
|
+
// ===========================================================================
|
|
136
|
+
const FeishuImBotImageSchema = typebox_1.Type.Object({
|
|
137
|
+
message_id: typebox_1.Type.String({
|
|
138
|
+
description: '消息 ID(om_xxx 格式),引用消息可从上下文中的 [message_id=om_xxx] 提取',
|
|
139
|
+
}),
|
|
140
|
+
file_key: typebox_1.Type.String({
|
|
141
|
+
description: '资源 Key,图片消息的 image_key(img_xxx)或文件消息的 file_key(file_xxx)',
|
|
142
|
+
}),
|
|
143
|
+
type: (0, helpers_1.StringEnum)(['image', 'file'], {
|
|
144
|
+
description: '资源类型:image(图片消息中的图片)、file(文件/音频/视频消息中的文件)',
|
|
145
|
+
}),
|
|
146
|
+
});
|
|
147
|
+
function registerFeishuImBotImageTool(api) {
|
|
148
|
+
if (!api.config)
|
|
149
|
+
return false;
|
|
150
|
+
const { getClient, log } = (0, helpers_1.createToolContext)(api, 'feishu_im_bot_image');
|
|
151
|
+
return (0, helpers_1.registerTool)(api, {
|
|
152
|
+
name: 'feishu_im_bot_image',
|
|
153
|
+
label: 'Feishu: IM Bot Image Download',
|
|
154
|
+
description: '【以机器人身份】下载飞书 IM 消息中的图片或文件资源到本地。' +
|
|
155
|
+
'\n\n适用场景:用户直接发送给机器人的消息、用户引用的消息、机器人收到的群聊消息中的图片/文件。' +
|
|
156
|
+
'即当前对话上下文中出现的 message_id 和 image_key/file_key,应使用本工具下载。' +
|
|
157
|
+
'\n引用消息的 message_id 可从上下文中的 [message_id=om_xxx] 提取,无需向用户询问。' +
|
|
158
|
+
'\n\n文件自动保存到 /tmp/openclaw/ 下,返回值中的 saved_path 为实际保存路径。',
|
|
159
|
+
parameters: FeishuImBotImageSchema,
|
|
160
|
+
async execute(_toolCallId, params) {
|
|
161
|
+
const p = params;
|
|
162
|
+
try {
|
|
163
|
+
const client = getClient();
|
|
164
|
+
log.info(`download: message_id="${p.message_id}", file_key="${p.file_key}", type="${p.type}"`);
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
+
const res = await client.im.messageResource.get({
|
|
167
|
+
path: {
|
|
168
|
+
message_id: p.message_id,
|
|
169
|
+
file_key: p.file_key,
|
|
170
|
+
},
|
|
171
|
+
params: { type: p.type },
|
|
172
|
+
});
|
|
173
|
+
const { buffer, contentType } = await extractBuffer(res);
|
|
174
|
+
log.info(`download: ${buffer.length} bytes, content-type=${contentType}`);
|
|
175
|
+
const savedPath = await saveToTempFile(buffer, contentType, 'bot-resource');
|
|
176
|
+
log.info(`download: saved to ${savedPath}`);
|
|
177
|
+
return (0, helpers_1.json)({
|
|
178
|
+
message_id: p.message_id,
|
|
179
|
+
file_key: p.file_key,
|
|
180
|
+
type: p.type,
|
|
181
|
+
size_bytes: buffer.length,
|
|
182
|
+
content_type: contentType,
|
|
183
|
+
saved_path: savedPath,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
log.error(`Error: ${(0, helpers_1.formatLarkError)(err)}`);
|
|
188
|
+
return (0, helpers_1.json)({ error: (0, helpers_1.formatLarkError)(err) });
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
}, { name: 'feishu_im_bot_image' });
|
|
192
|
+
}
|
package/tsdown.config.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tsdown_1 = require("tsdown");
|
|
4
|
+
exports.default = (0, tsdown_1.defineConfig)({
|
|
5
|
+
entry: {
|
|
6
|
+
index: 'index.ts',
|
|
7
|
+
'secret-contract-api': 'secret-contract-api.ts',
|
|
8
|
+
},
|
|
9
|
+
format: 'esm',
|
|
10
|
+
target: 'node22',
|
|
11
|
+
platform: 'node',
|
|
12
|
+
clean: true,
|
|
13
|
+
outDir: 'dist',
|
|
14
|
+
dts: true,
|
|
15
|
+
deps: {
|
|
16
|
+
neverBundle: [
|
|
17
|
+
/^openclaw(\/.*)?$/,
|
|
18
|
+
/^@larksuiteoapi\//,
|
|
19
|
+
/^@sinclair\//,
|
|
20
|
+
'image-size',
|
|
21
|
+
'zod',
|
|
22
|
+
/^node:/,
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
});
|
package/vitest.config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_1 = require("vitest/config");
|
|
4
|
+
exports.default = (0, config_1.defineConfig)({
|
|
5
|
+
test: {
|
|
6
|
+
include: ['tests/**/*.test.ts'],
|
|
7
|
+
exclude: [
|
|
8
|
+
'**/node_modules/**',
|
|
9
|
+
'**/dist/**',
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
});
|