@openclaw/feishu 2026.6.8 → 2026.6.9
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/dist/api.js +79 -24
- package/dist/{channel-DwygSth-.js → channel-DF8jqwhL.js} +4 -4
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-CrqKcXaU.js → channel.runtime-C4eAoxAR.js} +5 -5
- package/dist/{client-BhMNZBJD.js → client-BwgAJuvo.js} +14 -9
- package/dist/{drive-8o3Omlnd.js → drive-djUl8IRC.js} +16 -3
- package/dist/{monitor-_1eNsUVp.js → monitor-UZJ1bdoG.js} +2 -2
- package/dist/{monitor.account-BhoLA1Y0.js → monitor.account-Bc_8o_b6.js} +95 -51
- package/dist/{monitor.state-QV66eUNA.js → monitor.state-CGL1occz.js} +1 -1
- package/dist/{probe-BjKRV7em.js → probe-EyeJQb3C.js} +1 -1
- package/dist/{send-B3kteMF8.js → send-CMyK8JGr.js} +33 -25
- package/dist/setup-api.js +1 -1
- package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
- package/node_modules/@protobufjs/aspromise/README.md +13 -0
- package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
- package/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
- package/node_modules/@protobufjs/aspromise/package.json +21 -0
- package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
- package/node_modules/@protobufjs/base64/LICENSE +26 -0
- package/node_modules/@protobufjs/base64/README.md +19 -0
- package/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
- package/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
- package/node_modules/@protobufjs/base64/package.json +21 -0
- package/node_modules/@protobufjs/base64/tests/index.js +46 -0
- package/node_modules/@protobufjs/codegen/LICENSE +26 -0
- package/node_modules/@protobufjs/codegen/README.md +49 -0
- package/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
- package/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -113
- package/node_modules/@protobufjs/codegen/package.json +13 -0
- package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
- package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
- package/node_modules/@protobufjs/eventemitter/README.md +22 -0
- package/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
- package/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
- package/node_modules/@protobufjs/eventemitter/package.json +21 -0
- package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
- package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/LICENSE +26 -0
- package/node_modules/@protobufjs/fetch/README.md +13 -0
- package/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
- package/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
- package/node_modules/@protobufjs/fetch/package.json +27 -0
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/float/LICENSE +26 -0
- package/node_modules/@protobufjs/float/README.md +102 -0
- package/node_modules/@protobufjs/float/bench/index.js +87 -0
- package/node_modules/@protobufjs/float/bench/suite.js +46 -0
- package/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
- package/node_modules/@protobufjs/float/package.json +26 -0
- package/node_modules/@protobufjs/float/tests/index.js +100 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/LICENSE +26 -0
- package/node_modules/@protobufjs/inquire/README.md +13 -0
- package/node_modules/{protobufjs/src/util/inquire.d.ts → @protobufjs/inquire/index.d.ts} +10 -10
- package/node_modules/{protobufjs/src/util/inquire.js → @protobufjs/inquire/index.js} +38 -38
- package/node_modules/@protobufjs/inquire/package.json +21 -0
- package/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
- package/node_modules/@protobufjs/inquire/tests/index.js +20 -0
- package/node_modules/@protobufjs/path/LICENSE +26 -0
- package/node_modules/@protobufjs/path/README.md +19 -0
- package/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
- package/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -72
- package/node_modules/@protobufjs/path/package.json +21 -0
- package/node_modules/@protobufjs/path/tests/index.js +60 -0
- package/node_modules/@protobufjs/pool/.npmignore +3 -0
- package/node_modules/@protobufjs/pool/LICENSE +26 -0
- package/node_modules/@protobufjs/pool/README.md +13 -0
- package/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
- package/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
- package/node_modules/@protobufjs/pool/package.json +21 -0
- package/node_modules/@protobufjs/pool/tests/index.js +33 -0
- package/node_modules/@protobufjs/utf8/LICENSE +26 -0
- package/node_modules/@protobufjs/utf8/README.md +20 -0
- package/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
- package/node_modules/{protobufjs/src/util/utf8.js → @protobufjs/utf8/index.js} +104 -130
- package/node_modules/@protobufjs/utf8/package.json +21 -0
- package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
- package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
- package/node_modules/@protobufjs/utf8/tests/index.js +74 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +59 -0
- package/node_modules/@types/node/assert.d.ts +950 -0
- package/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/node_modules/@types/node/buffer.d.ts +1765 -0
- package/node_modules/@types/node/child_process.d.ts +1366 -0
- package/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@types/node/crypto.d.ts +4058 -0
- package/node_modules/@types/node/dgram.d.ts +537 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
- package/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@types/node/fs/promises.d.ts +1468 -0
- package/node_modules/@types/node/fs.d.ts +4780 -0
- package/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@types/node/http.d.ts +2147 -0
- package/node_modules/@types/node/http2.d.ts +2485 -0
- package/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@types/node/index.d.ts +117 -0
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +264 -0
- package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@types/node/module.d.ts +755 -0
- package/node_modules/@types/node/net.d.ts +970 -0
- package/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@types/node/package.json +155 -0
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@types/node/perf_hooks.d.ts +612 -0
- package/node_modules/@types/node/process.d.ts +2204 -0
- package/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@types/node/quic.d.ts +897 -0
- package/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@types/node/readline.d.ts +507 -0
- package/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@types/node/sqlite.d.ts +1068 -0
- package/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@types/node/stream/iter.d.ts +301 -0
- package/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@types/node/stream/web.d.ts +300 -0
- package/node_modules/@types/node/stream.d.ts +1774 -0
- package/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +2279 -0
- package/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@types/node/tls.d.ts +1193 -0
- package/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +119 -0
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
- package/node_modules/@types/node/tty.d.ts +225 -0
- package/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/@types/node/v8.d.ts +980 -0
- package/node_modules/@types/node/vm.d.ts +1136 -0
- package/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +671 -0
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +589 -0
- package/node_modules/protobufjs/README.md +556 -263
- package/node_modules/protobufjs/dist/light/protobuf.js +1569 -1919
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +906 -1132
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +1576 -1993
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/ext/descriptor/README.md +70 -3
- package/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
- package/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
- package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
- package/node_modules/protobufjs/index.d.ts +720 -834
- package/node_modules/protobufjs/package.json +44 -20
- package/node_modules/protobufjs/src/converter.js +36 -60
- package/node_modules/protobufjs/src/decoder.js +53 -124
- package/node_modules/protobufjs/src/encoder.js +2 -10
- package/node_modules/protobufjs/src/enum.js +3 -8
- package/node_modules/protobufjs/src/field.js +11 -13
- package/node_modules/protobufjs/src/index-light.js +1 -1
- package/node_modules/protobufjs/src/mapfield.js +0 -1
- package/node_modules/protobufjs/src/message.js +11 -5
- package/node_modules/protobufjs/src/method.js +4 -5
- package/node_modules/protobufjs/src/namespace.js +3 -10
- package/node_modules/protobufjs/src/object.js +20 -20
- package/node_modules/protobufjs/src/oneof.js +0 -3
- package/node_modules/protobufjs/src/parse.js +16 -78
- package/node_modules/protobufjs/src/reader.js +31 -136
- package/node_modules/protobufjs/src/reader_buffer.js +3 -24
- package/node_modules/protobufjs/src/root.js +3 -7
- package/node_modules/protobufjs/src/roots.js +1 -1
- package/node_modules/protobufjs/src/service.js +6 -13
- package/node_modules/protobufjs/src/tokenize.js +1 -6
- package/node_modules/protobufjs/src/type.js +30 -44
- package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
- package/node_modules/protobufjs/src/util/minimal.js +12 -36
- package/node_modules/protobufjs/src/util.js +17 -6
- package/node_modules/protobufjs/src/verifier.js +6 -6
- package/node_modules/protobufjs/src/wrappers.js +1 -0
- package/node_modules/protobufjs/src/writer.js +16 -42
- package/node_modules/protobufjs/src/writer_buffer.js +1 -18
- package/node_modules/protobufjs/tsconfig.json +5 -3
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +32 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +123 -0
- package/node_modules/undici-types/connector.d.ts +36 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +30 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/node_modules/undici-types/dispatcher.d.ts +279 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/undici-types/errors.d.ts +177 -0
- package/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/undici-types/fetch.d.ts +211 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +15 -0
- package/node_modules/undici-types/header.d.ts +160 -0
- package/node_modules/undici-types/index.d.ts +91 -0
- package/node_modules/undici-types/interceptors.d.ts +80 -0
- package/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +27 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +29 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +41 -0
- package/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/node_modules/undici-types/readable.d.ts +68 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +347 -0
- package/node_modules/undici-types/websocket.d.ts +188 -0
- package/npm-shrinkwrap.json +95 -6
- package/package.json +4 -4
- package/skills/feishu-wiki/SKILL.md +10 -1
- package/node_modules/protobufjs/ext/README.md +0 -81
- package/node_modules/protobufjs/ext/descriptor.d.ts +0 -86
- package/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -409
- package/node_modules/protobufjs/ext/descriptor.js +0 -1266
- package/node_modules/protobufjs/ext/textformat.d.ts +0 -19
- package/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -11
- package/node_modules/protobufjs/ext/textformat.js +0 -1235
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
- package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
- package/node_modules/protobufjs/src/typescript.js +0 -25
- /package/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { _ as normalizeCommentFileType, c as encodeQuery, d as isRecord$1, f as normalizeString, g as buildFeishuCommentTarget, h as requestFeishuApi, l as extractReplyText, m as readString, o as resolveFeishuAccount, p as parseCommentContentElements, s as resolveFeishuRuntimeAccount } from "./accounts-Cfzht2Hc.js";
|
|
2
2
|
import { i as resolveReceiveIdType } from "./targets-BUjQ1TcA.js";
|
|
3
|
-
import { c as normalizeFeishuAllowEntry, d as resolveFeishuGroupConversationIngressAccess, f as resolveFeishuGroupSenderActivationIngressAccess, l as resolveFeishuDmIngressAccess, p as resolveFeishuReplyPolicy, s as hasExplicitFeishuGroupConfig, u as resolveFeishuGroupConfig } from "./channel-
|
|
3
|
+
import { c as normalizeFeishuAllowEntry, d as resolveFeishuGroupConversationIngressAccess, f as resolveFeishuGroupSenderActivationIngressAccess, l as resolveFeishuDmIngressAccess, p as resolveFeishuReplyPolicy, s as hasExplicitFeishuGroupConfig, u as resolveFeishuGroupConfig } from "./channel-DF8jqwhL.js";
|
|
4
4
|
import { c as decodeFeishuCardAction, o as buildFeishuCardActionTextFallback, s as createFeishuCardInteractionEnvelope } from "./send-result-DSsIa4-p.js";
|
|
5
5
|
import { t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
6
6
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
7
|
-
import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-
|
|
8
|
-
import { c as getChatInfo, i as createCommentTypingReactionLifecycle, t as deliverCommentThreadText } from "./drive-
|
|
7
|
+
import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
8
|
+
import { c as getChatInfo, i as createCommentTypingReactionLifecycle, t as deliverCommentThreadText } from "./drive-djUl8IRC.js";
|
|
9
9
|
import { t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
|
|
10
10
|
import { createReplyPrefixContext, evaluateSupplementalContextVisibility, loadSessionStore, normalizeAgentId as normalizeAgentId$2, resolveChannelContextVisibilityMode, resolveSessionStoreEntry } from "./runtime-api.js";
|
|
11
|
-
import { _ as normalizeFeishuExternalKey, a as sendCardFeishu, c as sendStructuredCardFeishu, d as isFeishuBroadcastMention, f as isMentionForwardRequest, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, l as parsePostContent, m as saveMessageResourceFeishu, n as getMessageFeishu, p as isFeishuGroupChatType, r as listFeishuThreadMessages, s as sendMessageFeishu, u as extractMentionTargets } from "./send-
|
|
12
|
-
import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-
|
|
13
|
-
import { a as clearFeishuBotIdentityState, c as httpServers, d as wsClients, f as fetchBotIdentityForMonitor, i as botOpenIds, l as recordWebhookStatus, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as closeTrackedFeishuHttpServer, r as botNames, s as feishuWebhookRateLimiter, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS, u as setFeishuBotIdentityState } from "./monitor.state-
|
|
11
|
+
import { _ as normalizeFeishuExternalKey, a as sendCardFeishu, c as sendStructuredCardFeishu, d as isFeishuBroadcastMention, f as isMentionForwardRequest, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, l as parsePostContent, m as saveMessageResourceFeishu, n as getMessageFeishu, p as isFeishuGroupChatType, r as listFeishuThreadMessages, s as sendMessageFeishu, u as extractMentionTargets } from "./send-CMyK8JGr.js";
|
|
12
|
+
import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-EyeJQb3C.js";
|
|
13
|
+
import { a as clearFeishuBotIdentityState, c as httpServers, d as wsClients, f as fetchBotIdentityForMonitor, i as botOpenIds, l as recordWebhookStatus, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as closeTrackedFeishuHttpServer, r as botNames, s as feishuWebhookRateLimiter, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS, u as setFeishuBotIdentityState } from "./monitor.state-CGL1occz.js";
|
|
14
14
|
import { createChannelMessageReplyPipeline, formatChannelProgressDraftLineForEntry, isChannelProgressDraftWorkToolName, resolveAgentOutboundIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
15
|
import { createChannelPairingController, createChannelPairingController as createChannelPairingController$1 } from "openclaw/plugin-sdk/channel-pairing";
|
|
16
16
|
import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
@@ -646,11 +646,32 @@ function resolveMessageMediaParts(messageType, content) {
|
|
|
646
646
|
default: return fileKey ? [`file_key:${fileKey}`] : imageKey ? [`image_key:${imageKey}`] : [];
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
+
function resolveSenderIdentity(event) {
|
|
650
|
+
const senderId = event.sender?.sender_id;
|
|
651
|
+
return senderId?.open_id?.trim() || senderId?.union_id?.trim() || senderId?.user_id?.trim() || void 0;
|
|
652
|
+
}
|
|
653
|
+
function resolveTextRetryDedupeKey(event) {
|
|
654
|
+
const createTime = event.message.create_time?.trim();
|
|
655
|
+
const chatId = event.message.chat_id?.trim();
|
|
656
|
+
const senderId = resolveSenderIdentity(event);
|
|
657
|
+
if (!createTime || parseStrictNonNegativeInteger(createTime) === void 0 || !chatId || !senderId) return;
|
|
658
|
+
const contentHash = createHash("sha256").update(event.message.content, "utf8").digest("hex").slice(0, 32);
|
|
659
|
+
return JSON.stringify([
|
|
660
|
+
"text-retry",
|
|
661
|
+
senderId,
|
|
662
|
+
chatId,
|
|
663
|
+
createTime,
|
|
664
|
+
contentHash
|
|
665
|
+
]);
|
|
666
|
+
}
|
|
649
667
|
function resolveFeishuMessageDedupeKey(event) {
|
|
650
668
|
const messageId = event.message.message_id?.trim();
|
|
651
669
|
if (!messageId) return;
|
|
652
|
-
const
|
|
653
|
-
|
|
670
|
+
const messageType = event.message.message_type.trim();
|
|
671
|
+
const mediaParts = resolveMessageMediaParts(messageType, event.message.content);
|
|
672
|
+
if (mediaParts.length > 0) return buildMediaDedupeKey(messageId, mediaParts);
|
|
673
|
+
if (messageType === "text") return resolveTextRetryDedupeKey(event) ?? messageId;
|
|
674
|
+
return messageId;
|
|
654
675
|
}
|
|
655
676
|
//#endregion
|
|
656
677
|
//#region extensions/feishu/src/dynamic-agent.ts
|
|
@@ -1395,6 +1416,12 @@ async function removeTypingIndicator(params) {
|
|
|
1395
1416
|
function shouldUseCard(text) {
|
|
1396
1417
|
return /```[\s\S]*?```/.test(text) || /\|.+\|[\r\n]+\|[-:| ]+\|/.test(text);
|
|
1397
1418
|
}
|
|
1419
|
+
function mergeStreamingFinalText(previousText, nextText, appendError) {
|
|
1420
|
+
if (!appendError || !previousText) return nextText;
|
|
1421
|
+
if (nextText.startsWith(previousText)) return nextText;
|
|
1422
|
+
if (previousText.endsWith(`\n\n${nextText}`)) return previousText;
|
|
1423
|
+
return `${previousText}\n\n${nextText}`;
|
|
1424
|
+
}
|
|
1398
1425
|
/** Maximum age (ms) for a message to receive a typing indicator reaction.
|
|
1399
1426
|
* Messages older than this are likely replays after context compaction (#30418). */
|
|
1400
1427
|
const TYPING_INDICATOR_MAX_AGE_MS = 2 * 6e4;
|
|
@@ -1445,7 +1472,7 @@ function resolveCardNote(agentId, identity, prefixCtx) {
|
|
|
1445
1472
|
}
|
|
1446
1473
|
function createFeishuReplyDispatcher(params) {
|
|
1447
1474
|
const core = getFeishuRuntime();
|
|
1448
|
-
const { cfg, agentId, chatId, replyToMessageId, typingTargetMessageId: explicitTypingTargetMessageId, skipReplyToInMessages, replyInThread, threadReply, rootId, accountId, identity } = params;
|
|
1475
|
+
const { cfg, agentId, chatId, replyToMessageId, typingTargetMessageId: explicitTypingTargetMessageId, skipReplyToInMessages, replyInThread, threadReply, rootId, accountId, identity, mentionTargets } = params;
|
|
1449
1476
|
const sendReplyToMessageId = skipReplyToInMessages ? void 0 : replyToMessageId;
|
|
1450
1477
|
const typingTargetMessageId = explicitTypingTargetMessageId?.trim() || replyToMessageId;
|
|
1451
1478
|
const threadReplyMode = threadReply === true;
|
|
@@ -1520,6 +1547,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1520
1547
|
let statusLine = "";
|
|
1521
1548
|
let snapshotBaseText = "";
|
|
1522
1549
|
let lastSnapshotTextLength = 0;
|
|
1550
|
+
let hasStreamingFinalText = false;
|
|
1523
1551
|
const deliveredFinalTexts = /* @__PURE__ */ new Set();
|
|
1524
1552
|
let partialUpdateQueue = Promise.resolve();
|
|
1525
1553
|
let streamingStartPromise = null;
|
|
@@ -1609,6 +1637,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1609
1637
|
statusLine = "";
|
|
1610
1638
|
snapshotBaseText = "";
|
|
1611
1639
|
lastSnapshotTextLength = 0;
|
|
1640
|
+
hasStreamingFinalText = false;
|
|
1612
1641
|
};
|
|
1613
1642
|
const closeStreaming = async (options) => {
|
|
1614
1643
|
try {
|
|
@@ -1775,7 +1804,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1775
1804
|
...payload,
|
|
1776
1805
|
text: payloadText
|
|
1777
1806
|
});
|
|
1778
|
-
const text = reply.text;
|
|
1807
|
+
const text = info?.kind === "final" ? mergeStreamingFinalText(streamText, reply.text, payload.isError === true && hasStreamingFinalText) : reply.text;
|
|
1779
1808
|
const hasText = reply.hasText;
|
|
1780
1809
|
const hasMedia = reply.hasMedia;
|
|
1781
1810
|
const hasVoiceMedia = hasMedia && reply.mediaUrls.some((mediaUrl) => shouldSuppressFeishuTextForVoiceMedia({
|
|
@@ -1811,6 +1840,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1811
1840
|
});
|
|
1812
1841
|
if (info?.kind === "final") {
|
|
1813
1842
|
streamText = text;
|
|
1843
|
+
hasStreamingFinalText = true;
|
|
1814
1844
|
snapshotBaseText = "";
|
|
1815
1845
|
lastSnapshotTextLength = text.length;
|
|
1816
1846
|
flushStreamingCardUpdate(buildCombinedStreamText(reasoningText, streamText));
|
|
@@ -1843,7 +1873,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1843
1873
|
text,
|
|
1844
1874
|
useCard: false,
|
|
1845
1875
|
infoKind: info?.kind,
|
|
1846
|
-
sendChunk: async ({ chunk }) => {
|
|
1876
|
+
sendChunk: async ({ chunk, isFirst }) => {
|
|
1847
1877
|
await sendMessageFeishu({
|
|
1848
1878
|
cfg,
|
|
1849
1879
|
to: chatId,
|
|
@@ -1851,7 +1881,8 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1851
1881
|
replyToMessageId: sendReplyToMessageId,
|
|
1852
1882
|
replyInThread: effectiveReplyInThread,
|
|
1853
1883
|
allowTopLevelReplyFallback,
|
|
1854
|
-
accountId
|
|
1884
|
+
accountId,
|
|
1885
|
+
...info?.kind === "final" && isFirst && mentionTargets?.length ? { mentions: mentionTargets } : {}
|
|
1855
1886
|
});
|
|
1856
1887
|
}
|
|
1857
1888
|
});
|
|
@@ -2124,7 +2155,7 @@ async function filterFetchedGroupContextMessages(messages, params) {
|
|
|
2124
2155
|
}) ? message : void 0))).filter((message) => message !== void 0);
|
|
2125
2156
|
}
|
|
2126
2157
|
async function handleFeishuMessage(params) {
|
|
2127
|
-
const { cfg, event, botOpenId, botName, runtime, channelRuntime, chatHistories, accountId, processingClaimHeld = false } = params;
|
|
2158
|
+
const { cfg, event, botOpenId, botName, runtime, channelRuntime, chatHistories, accountId, processingClaimHeld = false, messageDedupeKey: messageDedupeKeyOverride } = params;
|
|
2128
2159
|
const account = resolveFeishuRuntimeAccount({
|
|
2129
2160
|
cfg,
|
|
2130
2161
|
accountId
|
|
@@ -2133,7 +2164,7 @@ async function handleFeishuMessage(params) {
|
|
|
2133
2164
|
const log = runtime?.log ?? console.log;
|
|
2134
2165
|
const error = runtime?.error ?? console.error;
|
|
2135
2166
|
const messageId = event.message.message_id;
|
|
2136
|
-
const messageDedupeKey = resolveFeishuMessageDedupeKey(event);
|
|
2167
|
+
const messageDedupeKey = messageDedupeKeyOverride ?? resolveFeishuMessageDedupeKey(event);
|
|
2137
2168
|
if (!await finalizeFeishuMessageProcessing({
|
|
2138
2169
|
messageId: messageDedupeKey,
|
|
2139
2170
|
namespace: account.accountId,
|
|
@@ -2316,7 +2347,7 @@ async function handleFeishuMessage(params) {
|
|
|
2316
2347
|
}
|
|
2317
2348
|
}
|
|
2318
2349
|
try {
|
|
2319
|
-
const core = { channel: channelRuntime
|
|
2350
|
+
const core = { channel: channelRuntime?.inbound ? channelRuntime : getFeishuRuntime().channel };
|
|
2320
2351
|
const pairing = createChannelPairingController({
|
|
2321
2352
|
core,
|
|
2322
2353
|
channel: "feishu",
|
|
@@ -2525,8 +2556,33 @@ async function handleFeishuMessage(params) {
|
|
|
2525
2556
|
log,
|
|
2526
2557
|
accountId: account.accountId
|
|
2527
2558
|
});
|
|
2528
|
-
|
|
2529
|
-
|
|
2559
|
+
let quotedMessageInfo = null;
|
|
2560
|
+
let quotedContent;
|
|
2561
|
+
if (ctx.parentId) try {
|
|
2562
|
+
quotedMessageInfo = await getMessageFeishu({
|
|
2563
|
+
cfg,
|
|
2564
|
+
messageId: ctx.parentId,
|
|
2565
|
+
accountId: account.accountId
|
|
2566
|
+
});
|
|
2567
|
+
if (quotedMessageInfo && await shouldIncludeFetchedGroupContextMessage({
|
|
2568
|
+
cfg,
|
|
2569
|
+
accountId: account.accountId,
|
|
2570
|
+
chatId: ctx.chatId,
|
|
2571
|
+
isGroup,
|
|
2572
|
+
allowFrom: effectiveGroupSenderAllowFrom,
|
|
2573
|
+
mode: contextVisibilityMode,
|
|
2574
|
+
kind: "quote",
|
|
2575
|
+
senderId: quotedMessageInfo.senderId,
|
|
2576
|
+
senderType: quotedMessageInfo.senderType
|
|
2577
|
+
})) {
|
|
2578
|
+
quotedContent = quotedMessageInfo.content;
|
|
2579
|
+
log(`feishu[${account.accountId}]: fetched quoted message: ${quotedContent?.slice(0, 100)}`);
|
|
2580
|
+
} else if (quotedMessageInfo) log(`feishu[${account.accountId}]: skipped quoted message from sender ${quotedMessageInfo.senderId ?? "unknown"} (mode=${contextVisibilityMode})`);
|
|
2581
|
+
} catch (err) {
|
|
2582
|
+
log(`feishu[${account.accountId}]: failed to fetch quoted message: ${String(err)}`);
|
|
2583
|
+
}
|
|
2584
|
+
if (!ctx.content.trim() && mediaList.length === 0 && !quotedContent?.trim()) {
|
|
2585
|
+
log(`feishu[${account.accountId}]: skipping empty message (no text, no media, no quoted) from ${ctx.senderOpenId}`);
|
|
2530
2586
|
return;
|
|
2531
2587
|
}
|
|
2532
2588
|
const audioTranscript = await resolveFeishuAudioPreflightTranscript({
|
|
@@ -2566,31 +2622,6 @@ async function handleFeishuMessage(params) {
|
|
|
2566
2622
|
mayPair: false,
|
|
2567
2623
|
command: { hasControlCommand: true }
|
|
2568
2624
|
})).commandAccess.authorized : void 0;
|
|
2569
|
-
let quotedMessageInfo = null;
|
|
2570
|
-
let quotedContent;
|
|
2571
|
-
if (ctx.parentId) try {
|
|
2572
|
-
quotedMessageInfo = await getMessageFeishu({
|
|
2573
|
-
cfg,
|
|
2574
|
-
messageId: ctx.parentId,
|
|
2575
|
-
accountId: account.accountId
|
|
2576
|
-
});
|
|
2577
|
-
if (quotedMessageInfo && await shouldIncludeFetchedGroupContextMessage({
|
|
2578
|
-
cfg,
|
|
2579
|
-
accountId: account.accountId,
|
|
2580
|
-
chatId: ctx.chatId,
|
|
2581
|
-
isGroup,
|
|
2582
|
-
allowFrom: effectiveGroupSenderAllowFrom,
|
|
2583
|
-
mode: contextVisibilityMode,
|
|
2584
|
-
kind: "quote",
|
|
2585
|
-
senderId: quotedMessageInfo.senderId,
|
|
2586
|
-
senderType: quotedMessageInfo.senderType
|
|
2587
|
-
})) {
|
|
2588
|
-
quotedContent = quotedMessageInfo.content;
|
|
2589
|
-
log(`feishu[${account.accountId}]: fetched quoted message: ${quotedContent?.slice(0, 100)}`);
|
|
2590
|
-
} else if (quotedMessageInfo) log(`feishu[${account.accountId}]: skipped quoted message from sender ${quotedMessageInfo.senderId ?? "unknown"} (mode=${contextVisibilityMode})`);
|
|
2591
|
-
} catch (err) {
|
|
2592
|
-
log(`feishu[${account.accountId}]: failed to fetch quoted message: ${String(err)}`);
|
|
2593
|
-
}
|
|
2594
2625
|
const isTopicSessionForThread = isGroup && (groupSession?.groupSessionScope === "group_topic" || groupSession?.groupSessionScope === "group_topic_sender");
|
|
2595
2626
|
const envelopeOptions = core.channel.reply.resolveEnvelopeFormatOptions(cfg);
|
|
2596
2627
|
const messageBody = buildFeishuAgentBody({
|
|
@@ -2884,6 +2915,7 @@ async function handleFeishuMessage(params) {
|
|
|
2884
2915
|
threadReply,
|
|
2885
2916
|
accountId: account.accountId,
|
|
2886
2917
|
identity,
|
|
2918
|
+
mentionTargets: ctx.mentionTargets,
|
|
2887
2919
|
messageCreateTimeMs,
|
|
2888
2920
|
sessionKey: agentSessionKey
|
|
2889
2921
|
});
|
|
@@ -3026,6 +3058,7 @@ async function handleFeishuMessage(params) {
|
|
|
3026
3058
|
threadReply,
|
|
3027
3059
|
accountId: account.accountId,
|
|
3028
3060
|
identity,
|
|
3061
|
+
mentionTargets: ctx.mentionTargets,
|
|
3029
3062
|
messageCreateTimeMs,
|
|
3030
3063
|
sessionKey: route.sessionKey
|
|
3031
3064
|
});
|
|
@@ -3225,6 +3258,8 @@ function releaseFeishuCardActionToken(params) {
|
|
|
3225
3258
|
}
|
|
3226
3259
|
function buildSyntheticMessageEvent(event, content, chatType) {
|
|
3227
3260
|
const replyTargetMessageId = event.context.open_message_id ?? event.open_message_id;
|
|
3261
|
+
const isTemporaryCardActionId = replyTargetMessageId?.startsWith("card-action-c-");
|
|
3262
|
+
const validReplyTargetId = replyTargetMessageId && !isTemporaryCardActionId ? replyTargetMessageId : void 0;
|
|
3228
3263
|
return {
|
|
3229
3264
|
sender: { sender_id: {
|
|
3230
3265
|
open_id: event.operator.open_id,
|
|
@@ -3233,9 +3268,9 @@ function buildSyntheticMessageEvent(event, content, chatType) {
|
|
|
3233
3268
|
} },
|
|
3234
3269
|
message: {
|
|
3235
3270
|
message_id: `card-action-${event.token}`,
|
|
3236
|
-
...
|
|
3237
|
-
...
|
|
3238
|
-
...!
|
|
3271
|
+
...validReplyTargetId ? { reply_target_message_id: validReplyTargetId } : {},
|
|
3272
|
+
...validReplyTargetId ? { typing_target_message_id: validReplyTargetId } : {},
|
|
3273
|
+
...!validReplyTargetId ? { suppress_reply_target: true } : {},
|
|
3239
3274
|
chat_id: event.context.chat_id || event.operator.open_id,
|
|
3240
3275
|
chat_type: chatType,
|
|
3241
3276
|
message_type: "text",
|
|
@@ -4908,7 +4943,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
4908
4943
|
const enqueue = createSequentialQueue({ onTaskTimeout: (key, timeoutMs) => {
|
|
4909
4944
|
log(`feishu[${accountId}]: per-chat task exceeded ${timeoutMs}ms cap (key=${key}); evicting from queue so later same-key messages can proceed (#70133)`);
|
|
4910
4945
|
} });
|
|
4911
|
-
const dispatchFeishuMessage = async (event) => {
|
|
4946
|
+
const dispatchFeishuMessage = async (event, messageDedupeKey) => {
|
|
4912
4947
|
const sequentialKey = resolveSequentialKey({
|
|
4913
4948
|
accountId,
|
|
4914
4949
|
event,
|
|
@@ -4924,7 +4959,8 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
4924
4959
|
channelRuntime,
|
|
4925
4960
|
chatHistories,
|
|
4926
4961
|
accountId,
|
|
4927
|
-
processingClaimHeld: true
|
|
4962
|
+
processingClaimHeld: true,
|
|
4963
|
+
messageDedupeKey
|
|
4928
4964
|
});
|
|
4929
4965
|
await enqueue(sequentialKey, task);
|
|
4930
4966
|
};
|
|
@@ -4965,7 +5001,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
4965
5001
|
const last = entries.at(-1);
|
|
4966
5002
|
if (!last) return;
|
|
4967
5003
|
if (entries.length === 1) {
|
|
4968
|
-
await dispatchFeishuMessage(last);
|
|
5004
|
+
await dispatchFeishuMessage(last, resolveFeishuMessageDedupeKey(last));
|
|
4969
5005
|
return;
|
|
4970
5006
|
}
|
|
4971
5007
|
const dedupedEntries = dedupeFeishuDebounceEntriesByDedupeKey(entries);
|
|
@@ -4973,7 +5009,8 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
4973
5009
|
for (const entry of dedupedEntries) if (!await hasProcessedMessage(resolveFeishuMessageDedupeKey(entry), accountId, log)) freshEntries.push(entry);
|
|
4974
5010
|
const dispatchEntry = freshEntries.at(-1);
|
|
4975
5011
|
if (!dispatchEntry) return;
|
|
4976
|
-
|
|
5012
|
+
const dispatchDedupeKey = resolveFeishuMessageDedupeKey(dispatchEntry);
|
|
5013
|
+
await recordSuppressedMessageIds(dedupedEntries, dispatchDedupeKey);
|
|
4977
5014
|
const combinedText = freshEntries.map((entry) => resolveDebounceText(entry)).filter(Boolean).join("\n");
|
|
4978
5015
|
const mergedMentions = resolveFeishuDebounceMentions({
|
|
4979
5016
|
entries: freshEntries,
|
|
@@ -4989,7 +5026,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
4989
5026
|
} : {},
|
|
4990
5027
|
mentions: mergedMentions ?? dispatchEntry.message.mentions
|
|
4991
5028
|
}
|
|
4992
|
-
});
|
|
5029
|
+
}, dispatchDedupeKey);
|
|
4993
5030
|
},
|
|
4994
5031
|
onError: (err, entries) => {
|
|
4995
5032
|
for (const entry of entries) releaseFeishuMessageProcessing(resolveFeishuMessageDedupeKey(entry), accountId);
|
|
@@ -5003,6 +5040,12 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
5003
5040
|
return;
|
|
5004
5041
|
}
|
|
5005
5042
|
const messageId = event.message?.message_id?.trim();
|
|
5043
|
+
const botOpenId = getBotOpenId(accountId)?.trim();
|
|
5044
|
+
const senderOpenId = event.sender.sender_id.open_id?.trim();
|
|
5045
|
+
if (botOpenId && senderOpenId === botOpenId) {
|
|
5046
|
+
log(`feishu[${accountId}]: dropping self-authored message ${messageId ?? "unknown"}`);
|
|
5047
|
+
return;
|
|
5048
|
+
}
|
|
5006
5049
|
const messageDedupeKey = resolveFeishuMessageDedupeKey(event);
|
|
5007
5050
|
if (!tryBeginFeishuMessageProcessing(messageDedupeKey, accountId)) {
|
|
5008
5051
|
log(`feishu[${accountId}]: dropping duplicate event for message ${messageId}`);
|
|
@@ -5406,7 +5449,7 @@ function parseFeishuCardActionEventPayload(value) {
|
|
|
5406
5449
|
const unionId = firstString(operator.union_id, readFeishuIdentityField(operatorUserId, "union_id"));
|
|
5407
5450
|
const tag = readString(action.tag);
|
|
5408
5451
|
const actionValue = action.value;
|
|
5409
|
-
const openMessageId = firstString(
|
|
5452
|
+
const openMessageId = firstString(context.open_message_id, value.open_message_id);
|
|
5410
5453
|
const contextOpenId = firstString(context.open_id, openId);
|
|
5411
5454
|
const contextUserId = firstString(context.user_id, userId);
|
|
5412
5455
|
const chatId = firstString(context.chat_id, context.open_chat_id);
|
|
@@ -5465,6 +5508,7 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
5465
5508
|
resolveSequentialKey: getFeishuSequentialKey
|
|
5466
5509
|
}),
|
|
5467
5510
|
"im.message.message_read_v1": async () => {},
|
|
5511
|
+
"im.chat.access_event.bot_p2p_chat_entered_v1": async () => {},
|
|
5468
5512
|
"im.chat.member.bot.added_v1": async (data) => {
|
|
5469
5513
|
try {
|
|
5470
5514
|
const event = parseFeishuBotAddedEventPayload(data);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as probeFeishu } from "./probe-
|
|
1
|
+
import { t as probeFeishu } from "./probe-EyeJQb3C.js";
|
|
2
2
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, createFixedWindowRateLimiter, createWebhookAnomalyTracker } from "openclaw/plugin-sdk/webhook-ingress";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { r as createFeishuClient } from "./client-
|
|
2
|
+
import { r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
3
3
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
//#region extensions/feishu/src/async.ts
|
|
@@ -2,7 +2,7 @@ import { d as isRecord$1, h as requestFeishuApi, s as resolveFeishuRuntimeAccoun
|
|
|
2
2
|
import { i as resolveReceiveIdType, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
|
|
3
3
|
import { i as toFeishuSendResult, r as resolveFeishuReceiptKind, t as assertFeishuMessageApiSuccess } from "./send-result-DSsIa4-p.js";
|
|
4
4
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
5
|
-
import { r as createFeishuClient } from "./client-
|
|
5
|
+
import { r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
6
6
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
7
7
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { convertMarkdownTables } from "openclaw/plugin-sdk/text-chunking";
|
|
@@ -182,7 +182,7 @@ async function saveMessageResourceWithType(params) {
|
|
|
182
182
|
errorPrefix: "Feishu message resource download failed",
|
|
183
183
|
maxBytes: params.maxBytes,
|
|
184
184
|
contentType: meta.contentType,
|
|
185
|
-
fileName: meta.fileName ?? params.originalFilename
|
|
185
|
+
fileName: meta.fileName ?? (params.originalFilename ? recoverUtf8FileNameFromLatin1Header(params.originalFilename) : void 0)
|
|
186
186
|
}),
|
|
187
187
|
...meta
|
|
188
188
|
};
|
|
@@ -606,25 +606,12 @@ function isMentionForwardRequest(event, botOpenId) {
|
|
|
606
606
|
return userMentions.some((m) => m.id.open_id === botOpenId) && hasOtherMention;
|
|
607
607
|
}
|
|
608
608
|
/**
|
|
609
|
-
* Format @mention for text message
|
|
610
|
-
*/
|
|
611
|
-
function formatMentionForText(target) {
|
|
612
|
-
return `<at user_id="${target.openId}">${target.name}</at>`;
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
609
|
* Format @mention for card message (lark_md)
|
|
616
610
|
*/
|
|
617
611
|
function formatMentionForCard(target) {
|
|
618
612
|
return `<at id=${target.openId}></at>`;
|
|
619
613
|
}
|
|
620
614
|
/**
|
|
621
|
-
* Build complete message with @mentions (text format)
|
|
622
|
-
*/
|
|
623
|
-
function buildMentionedMessage(targets, message) {
|
|
624
|
-
if (targets.length === 0) return message;
|
|
625
|
-
return `${targets.map((t) => formatMentionForText(t)).join(" ")} ${message}`;
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
615
|
* Build card content with @mentions (Markdown format)
|
|
629
616
|
*/
|
|
630
617
|
function buildMentionedCardContent(targets, message) {
|
|
@@ -973,7 +960,10 @@ async function getMessageFeishu(params) {
|
|
|
973
960
|
if (!account.configured) throw new Error(`Feishu account "${account.accountId}" not configured`);
|
|
974
961
|
const client = createFeishuClient(account);
|
|
975
962
|
try {
|
|
976
|
-
const response = await client.im.message.get({
|
|
963
|
+
const response = await client.im.message.get({
|
|
964
|
+
params: { card_msg_content_type: "user_card_content" },
|
|
965
|
+
path: { message_id: messageId }
|
|
966
|
+
});
|
|
977
967
|
if (response.code !== 0) return null;
|
|
978
968
|
const rawItem = response.data?.items?.[0] ?? response.data;
|
|
979
969
|
const item = rawItem && (rawItem.body !== void 0 || rawItem.message_id !== void 0) ? rawItem : null;
|
|
@@ -999,7 +989,8 @@ async function listFeishuThreadMessages(params) {
|
|
|
999
989
|
container_id_type: "thread",
|
|
1000
990
|
container_id: threadId,
|
|
1001
991
|
sort_type: "ByCreateTimeDesc",
|
|
1002
|
-
page_size: Math.min(limit + 1, 50)
|
|
992
|
+
page_size: Math.min(limit + 1, 50),
|
|
993
|
+
card_msg_content_type: "user_card_content"
|
|
1003
994
|
} });
|
|
1004
995
|
if (response.code !== 0) throw new Error(`Feishu thread list failed: code=${response.code} msg=${response.msg ?? "unknown"}`);
|
|
1005
996
|
const items = response.data?.items ?? [];
|
|
@@ -1021,13 +1012,29 @@ async function listFeishuThreadMessages(params) {
|
|
|
1021
1012
|
results.reverse();
|
|
1022
1013
|
return results;
|
|
1023
1014
|
}
|
|
1015
|
+
function buildFeishuPostMentionElements(mentions) {
|
|
1016
|
+
if (!mentions?.length) return [];
|
|
1017
|
+
const elements = [];
|
|
1018
|
+
for (const mention of mentions) {
|
|
1019
|
+
const userId = mention.openId.trim();
|
|
1020
|
+
if (!userId) continue;
|
|
1021
|
+
const userName = mention.name.trim();
|
|
1022
|
+
elements.push({
|
|
1023
|
+
tag: "at",
|
|
1024
|
+
user_id: userId,
|
|
1025
|
+
...userName ? { user_name: userName } : {}
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
return elements;
|
|
1029
|
+
}
|
|
1024
1030
|
function buildFeishuPostMessagePayload(params) {
|
|
1025
|
-
const { messageText } = params;
|
|
1031
|
+
const { messageText, mentions } = params;
|
|
1032
|
+
const content = [...buildFeishuPostMentionElements(mentions), {
|
|
1033
|
+
tag: "md",
|
|
1034
|
+
text: messageText
|
|
1035
|
+
}];
|
|
1026
1036
|
return {
|
|
1027
|
-
content: JSON.stringify({ zh_cn: { content: [
|
|
1028
|
-
tag: "md",
|
|
1029
|
-
text: messageText
|
|
1030
|
-
}]] } }),
|
|
1037
|
+
content: JSON.stringify({ zh_cn: { content: [content] } }),
|
|
1031
1038
|
msgType: "post"
|
|
1032
1039
|
};
|
|
1033
1040
|
}
|
|
@@ -1042,9 +1049,10 @@ async function sendMessageFeishu(params) {
|
|
|
1042
1049
|
cfg,
|
|
1043
1050
|
channel: "feishu"
|
|
1044
1051
|
});
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1052
|
+
const { content, msgType } = buildFeishuPostMessagePayload({
|
|
1053
|
+
messageText: convertMarkdownTables(text ?? "", tableMode),
|
|
1054
|
+
mentions
|
|
1055
|
+
});
|
|
1048
1056
|
return sendReplyOrFallbackDirect(client, {
|
|
1049
1057
|
replyToMessageId,
|
|
1050
1058
|
replyInThread,
|
package/dist/setup-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-
|
|
1
|
+
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-DF8jqwhL.js";
|
|
2
2
|
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are
|
|
5
|
+
met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
* Neither the name of its author, nor the names of its contributors
|
|
13
|
+
may be used to endorse or promote products derived from this software
|
|
14
|
+
without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
20
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
21
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
22
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
23
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
24
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
25
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@protobufjs/aspromise
|
|
2
|
+
=====================
|
|
3
|
+
[](https://www.npmjs.com/package/@protobufjs/aspromise)
|
|
4
|
+
|
|
5
|
+
Returns a promise from a node-style callback function.
|
|
6
|
+
|
|
7
|
+
API
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**<br />
|
|
11
|
+
Returns a promise from a node-style callback function.
|
|
12
|
+
|
|
13
|
+
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export = asPromise;
|
|
2
|
-
|
|
3
|
-
type asPromiseCallback = (error: Error | null, ...params: any[]) => {};
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns a promise from a node-style callback function.
|
|
7
|
-
* @memberof util
|
|
8
|
-
* @param {asPromiseCallback} fn Function to call
|
|
9
|
-
* @param {*} ctx Function context
|
|
10
|
-
* @param {...*} params Function arguments
|
|
11
|
-
* @returns {Promise<*>} Promisified function
|
|
12
|
-
*/
|
|
13
|
-
declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise<any>;
|
|
1
|
+
export = asPromise;
|
|
2
|
+
|
|
3
|
+
type asPromiseCallback = (error: Error | null, ...params: any[]) => {};
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns a promise from a node-style callback function.
|
|
7
|
+
* @memberof util
|
|
8
|
+
* @param {asPromiseCallback} fn Function to call
|
|
9
|
+
* @param {*} ctx Function context
|
|
10
|
+
* @param {...*} params Function arguments
|
|
11
|
+
* @returns {Promise<*>} Promisified function
|
|
12
|
+
*/
|
|
13
|
+
declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise<any>;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = asPromise;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Callback as used by {@link util.asPromise}.
|
|
6
|
-
* @typedef asPromiseCallback
|
|
7
|
-
* @type {function}
|
|
8
|
-
* @param {Error|null} error Error, if any
|
|
9
|
-
* @param {...*} params Additional arguments
|
|
10
|
-
* @returns {undefined}
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Returns a promise from a node-style callback function.
|
|
15
|
-
* @memberof util
|
|
16
|
-
* @param {asPromiseCallback} fn Function to call
|
|
17
|
-
* @param {*} ctx Function context
|
|
18
|
-
* @param {...*} params Function arguments
|
|
19
|
-
* @returns {Promise<*>} Promisified function
|
|
20
|
-
*/
|
|
21
|
-
function asPromise(fn, ctx/*, varargs */) {
|
|
22
|
-
var params = new Array(arguments.length - 1),
|
|
23
|
-
offset = 0,
|
|
24
|
-
index = 2,
|
|
25
|
-
pending = true;
|
|
26
|
-
while (index < arguments.length)
|
|
27
|
-
params[offset++] = arguments[index++];
|
|
28
|
-
return new Promise(function executor(resolve, reject) {
|
|
29
|
-
params[offset] = function callback(err/*, varargs */) {
|
|
30
|
-
if (pending) {
|
|
31
|
-
pending = false;
|
|
32
|
-
if (err)
|
|
33
|
-
reject(err);
|
|
34
|
-
else {
|
|
35
|
-
var params = new Array(arguments.length - 1),
|
|
36
|
-
offset = 0;
|
|
37
|
-
while (offset < params.length)
|
|
38
|
-
params[offset++] = arguments[offset];
|
|
39
|
-
resolve.apply(null, params);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
try {
|
|
44
|
-
fn.apply(ctx || null, params);
|
|
45
|
-
} catch (err) {
|
|
46
|
-
if (pending) {
|
|
47
|
-
pending = false;
|
|
48
|
-
reject(err);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
module.exports = asPromise;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Callback as used by {@link util.asPromise}.
|
|
6
|
+
* @typedef asPromiseCallback
|
|
7
|
+
* @type {function}
|
|
8
|
+
* @param {Error|null} error Error, if any
|
|
9
|
+
* @param {...*} params Additional arguments
|
|
10
|
+
* @returns {undefined}
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns a promise from a node-style callback function.
|
|
15
|
+
* @memberof util
|
|
16
|
+
* @param {asPromiseCallback} fn Function to call
|
|
17
|
+
* @param {*} ctx Function context
|
|
18
|
+
* @param {...*} params Function arguments
|
|
19
|
+
* @returns {Promise<*>} Promisified function
|
|
20
|
+
*/
|
|
21
|
+
function asPromise(fn, ctx/*, varargs */) {
|
|
22
|
+
var params = new Array(arguments.length - 1),
|
|
23
|
+
offset = 0,
|
|
24
|
+
index = 2,
|
|
25
|
+
pending = true;
|
|
26
|
+
while (index < arguments.length)
|
|
27
|
+
params[offset++] = arguments[index++];
|
|
28
|
+
return new Promise(function executor(resolve, reject) {
|
|
29
|
+
params[offset] = function callback(err/*, varargs */) {
|
|
30
|
+
if (pending) {
|
|
31
|
+
pending = false;
|
|
32
|
+
if (err)
|
|
33
|
+
reject(err);
|
|
34
|
+
else {
|
|
35
|
+
var params = new Array(arguments.length - 1),
|
|
36
|
+
offset = 0;
|
|
37
|
+
while (offset < params.length)
|
|
38
|
+
params[offset++] = arguments[offset];
|
|
39
|
+
resolve.apply(null, params);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
try {
|
|
44
|
+
fn.apply(ctx || null, params);
|
|
45
|
+
} catch (err) {
|
|
46
|
+
if (pending) {
|
|
47
|
+
pending = false;
|
|
48
|
+
reject(err);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|