@openclaw/feishu 2026.9.8 → 2026.10.1-beta.1
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/.setup/{channel-DV4hM2Uf.mjs → channel-CX62T71S.mjs} +146 -245
- package/dist/.setup/{channel.runtime-CXQcH5zZ.mjs → channel.runtime-COiaq-Rv.mjs} +6 -12
- package/dist/.setup/{chat-D8MlFAZi.mjs → chat-BdyvImsY.mjs} +6 -9
- package/dist/.setup/{client-BYG-_IZl.mjs → client-BsBVWJzN.mjs} +1 -1
- package/dist/.setup/{doctor-contract-3XC0vbIw.mjs → doctor-contract-B1B9ogdd.mjs} +212 -27
- package/dist/.setup/{monitor-D_rsHBZ6.mjs → monitor-7DvwUs4Y.mjs} +5 -6
- package/dist/.setup/{monitor.account-DvvY7i6k.mjs → monitor.account-7xVu7XWY.mjs} +190 -393
- package/dist/.setup/{probe-_ViqSi0j.mjs → probe-B9o7iey6.mjs} +13 -39
- package/dist/.setup/{reply-delivery-result-COAjaukc.mjs → reply-delivery-result-Bt-BWBEA.mjs} +151 -297
- package/dist/.setup/{setup-api-C4S5I3ac.mjs → setup-api-DmzX9S01.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-BaFoMu8W.mjs → subagent-hooks-CUXg0pC-.mjs} +5 -11
- package/dist/.setup/{thread-bindings-EdLXPXzw.mjs → thread-bindings-jW2x5VuN.mjs} +23 -41
- package/dist/api.js +234 -297
- package/dist/channel-plugin-api.js +1 -1
- package/dist/doctor-contract-api.js +2 -2
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +95 -0
- package/node_modules/@openclaw/fs-safe/README.md +70 -379
- package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +35 -51
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-input.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +9 -10
- package/node_modules/@openclaw/fs-safe/dist/archive.js +2 -5
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.d.ts +51 -0
- package/node_modules/@openclaw/fs-safe/dist/atomic-io.js +242 -0
- package/node_modules/@openclaw/fs-safe/dist/config.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/config.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/copy-file-input.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/create.js +12 -5
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +4 -7
- package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.d.ts +55 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/entry-publication.js +262 -0
- package/node_modules/@openclaw/fs-safe/dist/exclusive-create.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/exclusive-create.js +22 -0
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.d.ts +1 -6
- package/node_modules/@openclaw/fs-safe/dist/file-cleanup.js +3 -6
- package/node_modules/@openclaw/fs-safe/dist/file-identity.js +3 -6
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.js +9 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.js +4 -6
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +8 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +20 -18
- package/node_modules/@openclaw/fs-safe/dist/file-store.js +4 -10
- package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +2 -10
- package/node_modules/@openclaw/fs-safe/dist/fs.js +2 -10
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +3 -4
- package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +6 -18
- package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +0 -2
- package/node_modules/@openclaw/fs-safe/dist/guest.js +3 -9
- package/node_modules/@openclaw/fs-safe/dist/index.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/index.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +1 -5
- package/node_modules/@openclaw/fs-safe/dist/json.js +19 -37
- package/node_modules/@openclaw/fs-safe/dist/move-path.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/mutation-authority.js +9 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +47 -2
- package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +1 -9
- package/node_modules/@openclaw/fs-safe/dist/native-config.js +6 -40
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.js +5 -2
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +11 -316
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.d.ts +7 -7
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.js +28 -175
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.d.ts +15 -0
- package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.js +418 -0
- package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.js +9 -4
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +17 -13
- package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.js +6 -24
- package/node_modules/@openclaw/fs-safe/dist/native.js +5 -1
- package/node_modules/@openclaw/fs-safe/dist/path-case.js +10 -9
- package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/path-segment-route.js +3 -0
- package/node_modules/@openclaw/fs-safe/dist/path.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +1 -3
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +9 -10
- package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.js +3 -6
- package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +4 -3
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.d.ts +3 -4
- package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.js +18 -32
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +5 -17
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +92 -230
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +4 -15
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +22 -63
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +9 -34
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +78 -83
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.d.ts +18 -20
- package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.js +64 -98
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +16 -33
- package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +61 -200
- package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +1 -6
- package/node_modules/@openclaw/fs-safe/dist/replace-file.js +76 -216
- package/node_modules/@openclaw/fs-safe/dist/root-boundary.js +14 -24
- package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +1 -4
- package/node_modules/@openclaw/fs-safe/dist/root-context.js +4 -19
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.d.ts +52 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-native.js +350 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.d.ts +35 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.js +1 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +2 -27
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +31 -28
- package/node_modules/@openclaw/fs-safe/dist/root-directory.js +1 -4
- package/node_modules/@openclaw/fs-safe/dist/root-errors.js +34 -0
- package/node_modules/@openclaw/fs-safe/dist/root-file.js +9 -21
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +105 -37
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +7 -2
- package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +67 -38
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +0 -2
- package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts +2 -3
- package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/root-path-stat.js +68 -85
- package/node_modules/@openclaw/fs-safe/dist/root-path.js +6 -1
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +4 -9
- package/node_modules/@openclaw/fs-safe/dist/root-remove-native.d.ts +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove-native.js +311 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts +11 -0
- package/node_modules/@openclaw/fs-safe/dist/root-remove.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +1 -3
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts +3 -3
- package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +8 -10
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +0 -4
- package/node_modules/@openclaw/fs-safe/dist/secret-file.js +12 -9
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +0 -2
- package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +7 -4
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +13 -6
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +0 -3
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +5 -23
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.d.ts +2 -1
- package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.js +11 -6
- package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.js +1 -8
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +2 -9
- package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +1 -6
- package/node_modules/@openclaw/fs-safe/dist/trash.js +6 -2
- package/node_modules/@openclaw/fs-safe/dist/walk.js +100 -46
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.d.ts +7 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +235 -19
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +21 -2
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +21 -3
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.d.ts +6 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +111 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/watch-scan.js +27 -4
- package/node_modules/@openclaw/fs-safe/dist/watch-stream.js +2 -0
- package/node_modules/@openclaw/fs-safe/dist/watch.js +131 -40
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts +8 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.js +24 -6
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.d.ts +13 -0
- package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.js +51 -0
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +4 -1
- package/node_modules/@openclaw/fs-safe/docs/config.md +6 -14
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +4 -14
- package/node_modules/@openclaw/fs-safe/docs/durability.md +6 -29
- package/node_modules/@openclaw/fs-safe/docs/entry-publication.md +146 -0
- package/node_modules/@openclaw/fs-safe/docs/errors.md +16 -0
- package/node_modules/@openclaw/fs-safe/docs/file-store.md +28 -5
- package/node_modules/@openclaw/fs-safe/docs/index.md +2 -31
- package/node_modules/@openclaw/fs-safe/docs/install.md +10 -31
- package/node_modules/@openclaw/fs-safe/docs/json.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/local-roots.md +0 -1
- package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +12 -12
- package/node_modules/@openclaw/fs-safe/docs/native-helper.md +35 -96
- package/node_modules/@openclaw/fs-safe/docs/native.md +22 -20
- package/node_modules/@openclaw/fs-safe/docs/path.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/permissions.md +1 -2
- package/node_modules/@openclaw/fs-safe/docs/public-api.md +1 -2
- package/node_modules/@openclaw/fs-safe/docs/reading.md +1 -2
- package/node_modules/@openclaw/fs-safe/docs/root.md +26 -184
- package/node_modules/@openclaw/fs-safe/docs/secret-file.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/security-model.md +115 -3
- package/node_modules/@openclaw/fs-safe/docs/store.md +2 -2
- package/node_modules/@openclaw/fs-safe/docs/temp.md +29 -65
- package/node_modules/@openclaw/fs-safe/docs/testing.md +90 -58
- package/node_modules/@openclaw/fs-safe/docs/types.md +3 -16
- package/node_modules/@openclaw/fs-safe/docs/walk.md +33 -5
- package/node_modules/@openclaw/fs-safe/docs/watch.md +96 -14
- package/node_modules/@openclaw/fs-safe/docs/writing.md +172 -16
- package/node_modules/@openclaw/fs-safe/package.json +10 -10
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/package.json +5 -5
- package/skills/feishu-wiki/SKILL.md +1 -1
- package/dist/.setup/accounts-wRqItHug.mjs +0 -206
- package/node_modules/@openclaw/fs-safe/dist/watch-alias.d.ts +0 -6
- package/node_modules/@openclaw/fs-safe/dist/watch-alias.js +0 -88
- package/node_modules/@openclaw/fs-safe/docs/mutation-policy-proof.md +0 -69
- package/node_modules/@openclaw/fs-safe/docs/private-file-store.md +0 -68
- package/node_modules/@openclaw/fs-safe/docs/test-hooks.md +0 -110
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as mergeFeishuAccountConfig, c as resolveFeishuRuntimeAccount, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveDefaultFeishuAccountId, r as listEnabledFeishuAccounts, s as resolveFeishuAccount } from "./accounts-wRqItHug.mjs";
|
|
1
|
+
import { _ as __reExport, a as DEFAULT_FEISHU_WEBHOOK_PATH, d as listFeishuAccountIds, f as mergeFeishuAccountConfig, g as __exportAll, h as resolveFeishuRuntimeAccount, i as FeishuChannelConfigSchema, l as inspectFeishuCredentials, m as resolveFeishuAccount, n as legacyConfigRules, o as normalizeFeishuWebhookPath, p as resolveDefaultFeishuAccountId, r as normalizeCompatibilityConfig, s as normalizeFeishuExternalKey, u as listEnabledFeishuAccounts } from "./doctor-contract-B1B9ogdd.mjs";
|
|
3
2
|
import { a as parseFeishuTargetId, c as looksLikeFeishuId, i as parseFeishuDirectConversationId, l as normalizeFeishuTarget, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-C1ofUfU8.mjs";
|
|
4
|
-
import { $ as cleanupAmbientCommentTypingReaction, A as sendMessageFeishu,
|
|
3
|
+
import { $ as cleanupAmbientCommentTypingReaction, A as sendMessageFeishu, Ct as readFeishuChatInfoWithAuthorization, G as deliverCommentThreadText, H as buildFeishuMediaFallbackText, M as toFeishuMessageSendResult, Nt as normalizeFeishuChatType, Ot as resolveFeishuGroupConfig, Pt as resolveFeishuChatType, S as sendMediaFeishu, St as isFeishuGroupReadEnabled, T as chunkFeishuCardMarkdown, W as resolveFeishuIdentityHeaderTitle, _ as renderFeishuPresentationPayload, _t as assertFeishuChatReadAllowed, b as withinCardTableLimit, bt as canEnumerateAllFeishuPeers, c as buildFeishuPayloadCard, ct as parseFeishuCommentTarget, d as consumeFeishuPresentationFallbackMarker, dt as chunkFeishuMarkdown, f as feishuCardWithinTableLimit, ft as chunkFeishuPostMarkdown, g as renderFeishuPresentationFallbackText, h as readNativeFeishuCard, ht as shouldUseFeishuCard, j as sendStructuredCardFeishu, jt as resolveFeishuGroupToolPolicy, k as sendCardFeishu, l as buildFeishuPresentationCard, lt as readNativeFeishuCardJson, m as markRenderedFeishuCard, n as createFeishuReplyDeliveryResult, o as FEISHU_PRESENTATION_CAPABILITIES, p as isFeishuCardWithinEnvelope, pt as materializeFeishuPostMarkdownSoftBreaks, s as assertFeishuCardWithinEnvelope, t as createFeishuPartialReplyDeliveryError, u as buildFeishuPresentationFallback, vt as authorizeFeishuChatMemberRead, w as shouldSuppressFeishuTextForVoiceMedia, wt as resolveFeishuChatReadPreliminaryAuthorization, xt as isFeishuGroupReadAllowed, y as resolveFeishuRichReply, yt as canEnumerateAllFeishuGroups } from "./reply-delivery-result-Bt-BWBEA.mjs";
|
|
5
4
|
import { t as messageActionTargetAliases } from "./message-action-contract-Bhxj8Zrf.mjs";
|
|
6
|
-
import { l as withFeishuRequestContext, r as createFeishuClient, u as withFeishuSendContext } from "./client-
|
|
5
|
+
import { l as withFeishuRequestContext, r as createFeishuClient, u as withFeishuSendContext } from "./client-BsBVWJzN.mjs";
|
|
7
6
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-CI1wCr9i.mjs";
|
|
8
7
|
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-b86aSgH2.mjs";
|
|
9
8
|
import { t as resolveFeishuSessionConversation } from "./session-conversation-C53IEUWt.mjs";
|
|
@@ -28,6 +27,7 @@ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createSetupTranslator, form
|
|
|
28
27
|
import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
29
28
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
30
29
|
import { convertMarkdownTables, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
30
|
+
import { textResult } from "openclaw/plugin-sdk/tool-results";
|
|
31
31
|
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
32
32
|
import fs from "node:fs";
|
|
33
33
|
import os from "node:os";
|
|
@@ -127,6 +127,20 @@ async function listAuthorizedFeishuDirectoryGroups(params) {
|
|
|
127
127
|
}));
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
|
+
//#region extensions/feishu/src/doctor-agent-roster.ts
|
|
131
|
+
function collectFeishuDoctorAgentIds(cfg) {
|
|
132
|
+
const agents = isRecord(cfg) && isRecord(cfg.agents) ? cfg.agents : void 0;
|
|
133
|
+
if (isRecord(agents?.entries)) {
|
|
134
|
+
const ids = Object.keys(agents.entries).map(normalizeAgentId);
|
|
135
|
+
return [...new Set(ids.length > 0 ? ids : ["main"])].toSorted();
|
|
136
|
+
}
|
|
137
|
+
const entries = Object.prototype.propertyIsEnumerable.call(agents ?? {}, "list") && Array.isArray(agents?.list) ? agents.list.filter(isRecord) : [];
|
|
138
|
+
const chosen = entries.find((entry) => entry.default === true) ?? entries[0];
|
|
139
|
+
const ids = /* @__PURE__ */ new Set([normalizeAgentId(typeof chosen?.id === "string" && chosen.id.trim() ? chosen.id : "main")]);
|
|
140
|
+
for (const entry of entries) if (typeof entry.id === "string" && entry.id.trim()) ids.add(normalizeAgentId(entry.id));
|
|
141
|
+
return [...ids].toSorted();
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
130
144
|
//#region src/gateway/gateway-http-route-contracts.ts
|
|
131
145
|
const GATEWAY_PROBE_ROUTES = /* @__PURE__ */ new Map([
|
|
132
146
|
["/health", "live"],
|
|
@@ -269,10 +283,10 @@ __reExport(gateway_config_runtime_exports, import_openclaw_plugin_sdk_gateway_co
|
|
|
269
283
|
//#region extensions/feishu/src/webhook-route.ts
|
|
270
284
|
function resolveFeishuLegacyWebhookListener(config) {
|
|
271
285
|
const listener = config.legacyWebhook;
|
|
272
|
-
return listener
|
|
273
|
-
port: listener
|
|
274
|
-
host: listener
|
|
275
|
-
};
|
|
286
|
+
return listener ? {
|
|
287
|
+
port: listener.port,
|
|
288
|
+
host: listener.host ?? "127.0.0.1"
|
|
289
|
+
} : void 0;
|
|
276
290
|
}
|
|
277
291
|
function describeFeishuWebhookPathConflict(path) {
|
|
278
292
|
const normalized = normalizeFeishuWebhookPath(path);
|
|
@@ -295,11 +309,11 @@ function collectFeishuWebhookNotes({ cfg, env }) {
|
|
|
295
309
|
const legacyListener = resolveFeishuLegacyWebhookListener(account);
|
|
296
310
|
const pathConflict = describeFeishuWebhookPathConflict(route);
|
|
297
311
|
if (pathConflict) {
|
|
298
|
-
warningNotes.push(`Feishu account "${accountId}" ${pathConflict} ${legacyListener ? "The legacyWebhook listener keeps the old path working. Move webhookPath and the callback or proxy before
|
|
312
|
+
warningNotes.push(`Feishu account "${accountId}" ${pathConflict} ${legacyListener ? "The legacyWebhook listener keeps the old path working. Move webhookPath and the callback or proxy before removing the legacyWebhook pin." : "Webhook startup is blocked until the path is changed."} Use Gateway port ${(0, gateway_config_runtime_exports.resolveGatewayPort)(cfg, env)}.`);
|
|
299
313
|
continue;
|
|
300
314
|
}
|
|
301
315
|
const upstream = `Gateway port ${(0, gateway_config_runtime_exports.resolveGatewayPort)(cfg, env)}, path ${route}`;
|
|
302
|
-
infoNotes.push(`Feishu account "${accountId}" uses ${upstream}. Point the Feishu callback URL or reverse-proxy upstream there; accounts sharing a path need distinct encrypt keys. ${legacyListener ? `The legacy listener on ${legacyListener.host}:${legacyListener.port} forwards into that same route. After verifying delivery through the Gateway,
|
|
316
|
+
infoNotes.push(`Feishu account "${accountId}" uses ${upstream}. Point the Feishu callback URL or reverse-proxy upstream there; accounts sharing a path need distinct encrypt keys. ${legacyListener ? `The legacy listener on ${legacyListener.host}:${legacyListener.port} forwards into that same route. After verifying delivery through the Gateway, remove the legacyWebhook pin; use legacyWebhook:false to override an inherited endpoint.` : "No legacy listener is configured; callbacks use the Gateway route."}`);
|
|
303
317
|
}
|
|
304
318
|
return {
|
|
305
319
|
infoNotes,
|
|
@@ -379,17 +393,6 @@ function isFeishuSessionEntry(key, value) {
|
|
|
379
393
|
const originFrom = normalizeLowercaseStringOrEmpty(origin?.from);
|
|
380
394
|
return originProvider === "feishu" || originSurface.startsWith("feishu") || originFrom.startsWith("feishu:");
|
|
381
395
|
}
|
|
382
|
-
function collectConfiguredAgentIds(cfg) {
|
|
383
|
-
const ids = /* @__PURE__ */ new Set();
|
|
384
|
-
ids.add(resolveConfiguredDefaultAgentId(cfg));
|
|
385
|
-
for (const agent of cfg.agents?.list ?? []) if (typeof agent.id === "string" && agent.id.trim()) ids.add(normalizeAgentId(agent.id));
|
|
386
|
-
return [...ids].toSorted();
|
|
387
|
-
}
|
|
388
|
-
function resolveConfiguredDefaultAgentId(cfg) {
|
|
389
|
-
const agents = cfg.agents?.list ?? [];
|
|
390
|
-
const chosen = agents.find((agent) => agent?.default) ?? agents[0];
|
|
391
|
-
return normalizeAgentId(typeof chosen?.id === "string" && chosen.id.trim() ? chosen.id : "main");
|
|
392
|
-
}
|
|
393
396
|
function collectFeishuSessionTargets(params) {
|
|
394
397
|
const byStorePath = /* @__PURE__ */ new Map();
|
|
395
398
|
const addTarget = (target) => {
|
|
@@ -400,7 +403,7 @@ function collectFeishuSessionTargets(params) {
|
|
|
400
403
|
storePath: resolvedStorePath
|
|
401
404
|
});
|
|
402
405
|
};
|
|
403
|
-
for (const agentId of
|
|
406
|
+
for (const agentId of collectFeishuDoctorAgentIds(params.cfg)) addTarget({
|
|
404
407
|
agentId,
|
|
405
408
|
storePath: resolveStorePath(params.cfg.session?.store, {
|
|
406
409
|
agentId,
|
|
@@ -476,30 +479,15 @@ function inspectTranscriptEntries(params) {
|
|
|
476
479
|
blankUserMessageRun += 1;
|
|
477
480
|
maxBlankUserMessageRun = Math.max(maxBlankUserMessageRun, blankUserMessageRun);
|
|
478
481
|
} else if (isUserMessage(entry)) blankUserMessageRun = 0;
|
|
479
|
-
if (params.entries.length === 0)
|
|
480
|
-
if (params.allowMissingSessionHeader) return null;
|
|
481
|
-
return {
|
|
482
|
-
kind: "invalid-session-transcript",
|
|
483
|
-
sessionKey: params.sessionKey,
|
|
484
|
-
storePath: params.storePath,
|
|
485
|
-
path: params.transcriptPath,
|
|
486
|
-
reason: "empty transcript"
|
|
487
|
-
};
|
|
488
|
-
}
|
|
482
|
+
if (params.entries.length === 0 && params.allowMissingSessionHeader) return null;
|
|
489
483
|
const firstEntry = params.entries[0];
|
|
490
|
-
|
|
484
|
+
const invalidReason = params.entries.length === 0 ? "empty transcript" : !isSessionHeader(firstEntry) && (!params.allowMissingSessionHeader || !isUserMessage(firstEntry)) ? "invalid session header" : (params.malformedLines ?? 0) > 0 ? `${params.malformedLines} malformed JSONL line(s)` : void 0;
|
|
485
|
+
if (invalidReason) return {
|
|
491
486
|
kind: "invalid-session-transcript",
|
|
492
487
|
sessionKey: params.sessionKey,
|
|
493
488
|
storePath: params.storePath,
|
|
494
489
|
path: params.transcriptPath,
|
|
495
|
-
reason:
|
|
496
|
-
};
|
|
497
|
-
if ((params.malformedLines ?? 0) > 0) return {
|
|
498
|
-
kind: "invalid-session-transcript",
|
|
499
|
-
sessionKey: params.sessionKey,
|
|
500
|
-
storePath: params.storePath,
|
|
501
|
-
path: params.transcriptPath,
|
|
502
|
-
reason: `${params.malformedLines} malformed JSONL line(s)`
|
|
490
|
+
reason: invalidReason
|
|
503
491
|
};
|
|
504
492
|
if (maxBlankUserMessageRun >= BLANK_USER_MESSAGE_REPAIR_THRESHOLD) return {
|
|
505
493
|
kind: "blank-user-message-run",
|
|
@@ -756,60 +744,53 @@ async function repairFeishuDoctorState(params) {
|
|
|
756
744
|
}
|
|
757
745
|
const entriesByStore = /* @__PURE__ */ new Map();
|
|
758
746
|
for (const entry of collectRepairSessionEntries(inspection)) {
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
entry: entry.entry
|
|
763
|
-
});
|
|
764
|
-
else entriesByStore.set(entry.storePath, {
|
|
765
|
-
agentId: entry.agentId,
|
|
766
|
-
entries: [{
|
|
767
|
-
key: entry.key,
|
|
768
|
-
entry: entry.entry
|
|
769
|
-
}]
|
|
770
|
-
});
|
|
747
|
+
const entries = entriesByStore.get(entry.storePath) ?? [];
|
|
748
|
+
entries.push(entry);
|
|
749
|
+
entriesByStore.set(entry.storePath, entries);
|
|
771
750
|
}
|
|
772
751
|
let removedSessionEntries = 0;
|
|
773
752
|
let touchedSessionStores = 0;
|
|
774
753
|
let archivedSessionArtifacts = 0;
|
|
775
|
-
for (const [storePath,
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
agentId: group.agentId
|
|
780
|
-
});
|
|
781
|
-
const keys = new Set(group.entries.map((entry) => entry.key));
|
|
782
|
-
const removedEntries = [];
|
|
783
|
-
for (const key of keys) {
|
|
784
|
-
const currentEntry = listSessionEntries({
|
|
785
|
-
agentId: group.agentId,
|
|
786
|
-
storePath
|
|
787
|
-
}).find((candidate) => candidate.sessionKey === key)?.entry;
|
|
788
|
-
if (!currentEntry || isValidAgentHarnessSessionStoreEntry(key, currentEntry)) continue;
|
|
789
|
-
if (!await deleteSessionEntry({
|
|
790
|
-
agentId: group.agentId,
|
|
791
|
-
archiveTranscript: true,
|
|
792
|
-
sessionKey: key,
|
|
793
|
-
storePath
|
|
794
|
-
})) continue;
|
|
795
|
-
const entry = group.entries.find((candidate) => candidate.key === key);
|
|
796
|
-
if (entry) removedEntries.push(entry);
|
|
797
|
-
}
|
|
798
|
-
const removed = removedEntries.length;
|
|
799
|
-
removedSessionEntries += removed;
|
|
800
|
-
if (removed > 0) {
|
|
801
|
-
touchedSessionStores += 1;
|
|
802
|
-
archivedSessionArtifacts += archiveSessionArtifacts({
|
|
754
|
+
for (const [storePath, entries] of [...entriesByStore.entries()].toSorted(([left], [right]) => left.localeCompare(right))) {
|
|
755
|
+
const agentId = entries[0].agentId;
|
|
756
|
+
try {
|
|
757
|
+
copyStoreBackup({
|
|
803
758
|
storePath,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
entry: entry.entry
|
|
807
|
-
})),
|
|
808
|
-
archiveTimestamp
|
|
759
|
+
backupDir,
|
|
760
|
+
agentId
|
|
809
761
|
});
|
|
762
|
+
const removedEntries = [];
|
|
763
|
+
for (const entry of entries) {
|
|
764
|
+
const { key } = entry;
|
|
765
|
+
const currentEntry = listSessionEntries({
|
|
766
|
+
agentId,
|
|
767
|
+
storePath
|
|
768
|
+
}).find((candidate) => candidate.sessionKey === key)?.entry;
|
|
769
|
+
if (!currentEntry || isValidAgentHarnessSessionStoreEntry(key, currentEntry)) continue;
|
|
770
|
+
if (!await deleteSessionEntry({
|
|
771
|
+
agentId,
|
|
772
|
+
archiveTranscript: true,
|
|
773
|
+
sessionKey: key,
|
|
774
|
+
storePath
|
|
775
|
+
})) continue;
|
|
776
|
+
removedEntries.push(entry);
|
|
777
|
+
}
|
|
778
|
+
const removed = removedEntries.length;
|
|
779
|
+
removedSessionEntries += removed;
|
|
780
|
+
if (removed > 0) {
|
|
781
|
+
touchedSessionStores += 1;
|
|
782
|
+
archivedSessionArtifacts += archiveSessionArtifacts({
|
|
783
|
+
storePath,
|
|
784
|
+
entries: removedEntries.map((entry) => ({
|
|
785
|
+
agentId,
|
|
786
|
+
entry: entry.entry
|
|
787
|
+
})),
|
|
788
|
+
archiveTimestamp
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
} catch (error) {
|
|
792
|
+
warnings.push(`- Failed to archive Feishu sessions in ${formatDisplayPath(storePath)}: ${String(error)}`);
|
|
810
793
|
}
|
|
811
|
-
} catch (error) {
|
|
812
|
-
warnings.push(`- Failed to archive Feishu sessions in ${formatDisplayPath(storePath)}: ${String(error)}`);
|
|
813
794
|
}
|
|
814
795
|
return {
|
|
815
796
|
backupDir,
|
|
@@ -879,7 +860,7 @@ const feishuDoctor = {
|
|
|
879
860
|
//#endregion
|
|
880
861
|
//#region extensions/feishu/src/gateway.ts
|
|
881
862
|
const feishuGatewayAdapter = { startAccount: async (ctx) => {
|
|
882
|
-
const { monitorFeishuProvider } = await import("./monitor-
|
|
863
|
+
const { monitorFeishuProvider } = await import("./monitor-7DvwUs4Y.mjs");
|
|
883
864
|
const account = resolveFeishuRuntimeAccount({
|
|
884
865
|
cfg: ctx.cfg,
|
|
885
866
|
accountId: ctx.accountId
|
|
@@ -1530,16 +1511,11 @@ function isFeishuConfigured(cfg) {
|
|
|
1530
1511
|
if (source === "env" && id) return Boolean(normalizeOptionalString(process.env[id]));
|
|
1531
1512
|
return hasConfiguredSecretInput(value);
|
|
1532
1513
|
};
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
const accountAppIdConfigured = hasOwnAppId ? isAppIdConfigured(account.appId) : isAppIdConfigured(feishuCfg?.appId);
|
|
1539
|
-
const accountSecretConfigured = hasOwnAppSecret ? hasConfiguredSecretInput(account.appSecret) : hasConfiguredSecretInput(feishuCfg?.appSecret);
|
|
1540
|
-
return accountAppIdConfigured && accountSecretConfigured;
|
|
1541
|
-
});
|
|
1542
|
-
return topLevelConfigured || accountConfigured;
|
|
1514
|
+
const isConfigured = (account) => isAppIdConfigured(account?.appId) && hasConfiguredSecretInput(account?.appSecret);
|
|
1515
|
+
return isConfigured(feishuCfg) || Object.values(feishuCfg?.accounts ?? {}).some((account) => account && typeof account === "object" && isConfigured({
|
|
1516
|
+
...feishuCfg,
|
|
1517
|
+
...account
|
|
1518
|
+
}));
|
|
1543
1519
|
}
|
|
1544
1520
|
function patchFeishuConfig(cfg, accountId, patch) {
|
|
1545
1521
|
return patchScopedAccountConfig({
|
|
@@ -1552,10 +1528,21 @@ function patchFeishuConfig(cfg, accountId, patch) {
|
|
|
1552
1528
|
}
|
|
1553
1529
|
});
|
|
1554
1530
|
}
|
|
1531
|
+
function resolveFeishuSetupAccount(cfg, requestedAccountId) {
|
|
1532
|
+
const accountId = requestedAccountId ?? resolveDefaultFeishuAccountId(cfg);
|
|
1533
|
+
const feishuCfg = cfg.channels?.feishu;
|
|
1534
|
+
const account = accountId === DEFAULT_ACCOUNT_ID$1 ? void 0 : feishuCfg?.accounts?.[accountId];
|
|
1535
|
+
return {
|
|
1536
|
+
accountId,
|
|
1537
|
+
config: {
|
|
1538
|
+
dmPolicy: account?.dmPolicy ?? feishuCfg?.dmPolicy,
|
|
1539
|
+
allowFrom: account?.allowFrom ?? feishuCfg?.allowFrom
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1555
1543
|
async function promptFeishuAllowFrom(params) {
|
|
1556
|
-
const
|
|
1557
|
-
const
|
|
1558
|
-
const existingAllowFrom = (resolvedAccountId !== DEFAULT_ACCOUNT_ID$1 ? feishuCfg?.accounts?.[resolvedAccountId] : void 0)?.allowFrom ?? feishuCfg?.allowFrom ?? [];
|
|
1544
|
+
const account = resolveFeishuSetupAccount(params.cfg, params.accountId);
|
|
1545
|
+
const existingAllowFrom = account.config.allowFrom ?? [];
|
|
1559
1546
|
await params.prompter.note([
|
|
1560
1547
|
t("wizard.feishu.allowlistIntro"),
|
|
1561
1548
|
t("wizard.feishu.allowlistFindUser"),
|
|
@@ -1569,7 +1556,7 @@ async function promptFeishuAllowFrom(params) {
|
|
|
1569
1556
|
initialValue: existingAllowFrom.length > 0 ? existingAllowFrom.map(String).join(", ") : void 0
|
|
1570
1557
|
});
|
|
1571
1558
|
const mergedAllowFrom = mergeAllowFromEntries(existingAllowFrom, splitSetupEntries(entry));
|
|
1572
|
-
return patchFeishuConfig(params.cfg,
|
|
1559
|
+
return patchFeishuConfig(params.cfg, account.accountId, { allowFrom: mergedAllowFrom });
|
|
1573
1560
|
}
|
|
1574
1561
|
async function noteFeishuCredentialHelp(prompter) {
|
|
1575
1562
|
await prompter.note([
|
|
@@ -1585,18 +1572,7 @@ async function noteFeishuCredentialHelp(prompter) {
|
|
|
1585
1572
|
const feishuDmPolicy = createChannelDmPolicy({
|
|
1586
1573
|
label: "Feishu",
|
|
1587
1574
|
channel,
|
|
1588
|
-
resolveAccount:
|
|
1589
|
-
const feishuCfg = cfg.channels?.feishu;
|
|
1590
|
-
const resolvedAccountId = accountId ?? resolveDefaultFeishuAccountId(cfg);
|
|
1591
|
-
const account = resolvedAccountId === DEFAULT_ACCOUNT_ID$1 ? void 0 : feishuCfg?.accounts?.[resolvedAccountId];
|
|
1592
|
-
return {
|
|
1593
|
-
accountId: resolvedAccountId,
|
|
1594
|
-
config: {
|
|
1595
|
-
dmPolicy: account?.dmPolicy ?? feishuCfg?.dmPolicy,
|
|
1596
|
-
allowFrom: account?.allowFrom ?? feishuCfg?.allowFrom
|
|
1597
|
-
}
|
|
1598
|
-
};
|
|
1599
|
-
},
|
|
1575
|
+
resolveAccount: resolveFeishuSetupAccount,
|
|
1600
1576
|
resolveAllowFrom: ({ policy }) => policy === "open" ? ["*"] : void 0,
|
|
1601
1577
|
applyPatch: ({ cfg, account, patch }) => patchFeishuConfig(cfg, account.accountId, patch),
|
|
1602
1578
|
promptAllowFrom: promptFeishuAllowFrom
|
|
@@ -1735,14 +1711,13 @@ async function runNewAppFlow(params) {
|
|
|
1735
1711
|
await new Promise((resolve) => {
|
|
1736
1712
|
setTimeout(resolve, 50);
|
|
1737
1713
|
});
|
|
1738
|
-
if (appId && appSecret) next = patchFeishuConfig(next, targetAccountId, {
|
|
1739
|
-
appId,
|
|
1740
|
-
appSecret,
|
|
1741
|
-
connectionMode: "websocket",
|
|
1742
|
-
...scanDomain ? { domain: scanDomain } : {}
|
|
1743
|
-
});
|
|
1744
|
-
else if (scanDomain) next = patchFeishuConfig(next, targetAccountId, { domain: scanDomain });
|
|
1745
1714
|
next = patchFeishuConfig(next, targetAccountId, {
|
|
1715
|
+
...appId && appSecret ? {
|
|
1716
|
+
appId,
|
|
1717
|
+
appSecret,
|
|
1718
|
+
connectionMode: "websocket"
|
|
1719
|
+
} : {},
|
|
1720
|
+
...scanDomain ? { domain: scanDomain } : {},
|
|
1746
1721
|
...scanOpenId ? {
|
|
1747
1722
|
dmPolicy: "allowlist",
|
|
1748
1723
|
allowFrom: [scanOpenId]
|
|
@@ -1754,9 +1729,8 @@ async function runNewAppFlow(params) {
|
|
|
1754
1729
|
return { cfg: next };
|
|
1755
1730
|
}
|
|
1756
1731
|
async function runEditFlow(params) {
|
|
1757
|
-
const { prompter, options } = params;
|
|
1758
|
-
const
|
|
1759
|
-
const feishuCfg = next.channels?.feishu;
|
|
1732
|
+
const { cfg, prompter, options } = params;
|
|
1733
|
+
const feishuCfg = cfg.channels?.feishu;
|
|
1760
1734
|
const resolveAppIdLabel = (value) => {
|
|
1761
1735
|
const asString = normalizeOptionalString(value);
|
|
1762
1736
|
if (asString) return asString;
|
|
@@ -1774,12 +1748,12 @@ async function runEditFlow(params) {
|
|
|
1774
1748
|
message: t("wizard.feishu.existingBotPrompt", { appId: existingAppId }),
|
|
1775
1749
|
initialValue: true
|
|
1776
1750
|
})) return runNewAppFlow({
|
|
1777
|
-
cfg
|
|
1751
|
+
cfg,
|
|
1778
1752
|
prompter,
|
|
1779
1753
|
options
|
|
1780
1754
|
});
|
|
1781
1755
|
await prompter.note(t("wizard.feishu.botConfigured"), "");
|
|
1782
|
-
return { cfg
|
|
1756
|
+
return { cfg };
|
|
1783
1757
|
}
|
|
1784
1758
|
async function runFeishuLogin(params) {
|
|
1785
1759
|
const { cfg, prompter } = params;
|
|
@@ -1808,7 +1782,7 @@ const feishuSetupWizard = {
|
|
|
1808
1782
|
});
|
|
1809
1783
|
let probeResult = null;
|
|
1810
1784
|
if (configured && account.configured) try {
|
|
1811
|
-
const { probeFeishu } = await import("./probe-
|
|
1785
|
+
const { probeFeishu } = await import("./probe-B9o7iey6.mjs").then((n) => n.n);
|
|
1812
1786
|
probeResult = await probeFeishu(account);
|
|
1813
1787
|
} catch {}
|
|
1814
1788
|
if (!configured) return [`Feishu: ${t("wizard.channels.statusNeedsAppCredentials")}`];
|
|
@@ -1961,7 +1935,7 @@ const meta = {
|
|
|
1961
1935
|
order: 70,
|
|
1962
1936
|
preferSessionLookupForAnnounceTarget: true
|
|
1963
1937
|
};
|
|
1964
|
-
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1938
|
+
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-COiaq-Rv.mjs"), "feishuChannelRuntime");
|
|
1965
1939
|
async function resolveFeishuMessageSender(params) {
|
|
1966
1940
|
try {
|
|
1967
1941
|
const sender = params.resolve(await loadFeishuChannelRuntime());
|
|
@@ -2016,7 +1990,7 @@ const feishuMessageAdapter = defineChannelMessageAdapter({
|
|
|
2016
1990
|
}
|
|
2017
1991
|
});
|
|
2018
1992
|
async function createFeishuActionClient(account) {
|
|
2019
|
-
const { createFeishuClient } = await import("./client-
|
|
1993
|
+
const { createFeishuClient } = await import("./client-BsBVWJzN.mjs").then((n) => n.t);
|
|
2020
1994
|
return createFeishuClient(account);
|
|
2021
1995
|
}
|
|
2022
1996
|
async function resolveFeishuChatTypeById(params) {
|
|
@@ -2205,20 +2179,14 @@ function resolveFeishuCommandConversation(params) {
|
|
|
2205
2179
|
return conversationId ? { conversationId } : null;
|
|
2206
2180
|
}
|
|
2207
2181
|
function jsonActionResult(details) {
|
|
2208
|
-
return
|
|
2209
|
-
content: [{
|
|
2210
|
-
type: "text",
|
|
2211
|
-
text: JSON.stringify(details)
|
|
2212
|
-
}],
|
|
2213
|
-
details
|
|
2214
|
-
};
|
|
2182
|
+
return textResult(JSON.stringify(details), details);
|
|
2215
2183
|
}
|
|
2216
2184
|
function readFirstString(params, keys, fallback) {
|
|
2217
2185
|
for (const key of keys) {
|
|
2218
|
-
const value = params[key];
|
|
2219
|
-
if (
|
|
2186
|
+
const value = normalizeOptionalString(params[key]);
|
|
2187
|
+
if (value) return value;
|
|
2220
2188
|
}
|
|
2221
|
-
|
|
2189
|
+
return normalizeOptionalString(fallback);
|
|
2222
2190
|
}
|
|
2223
2191
|
const UNRESOLVED_RESPONSE_PREFIX_VAR_PATTERN = /\{[a-zA-Z][a-zA-Z0-9.]*\}/;
|
|
2224
2192
|
function resolveFeishuMessageActionResponsePrefix(ctx) {
|
|
@@ -2372,9 +2340,6 @@ function resolveFeishuMemberId(params) {
|
|
|
2372
2340
|
"union_id"
|
|
2373
2341
|
]);
|
|
2374
2342
|
}
|
|
2375
|
-
function resolveFeishuMemberIdType(params) {
|
|
2376
|
-
return resolveRequestedFeishuMemberIdType(params) ?? "open_id";
|
|
2377
|
-
}
|
|
2378
2343
|
function resolveRequestedFeishuMemberIdType(params) {
|
|
2379
2344
|
const raw = readFirstString(params, [
|
|
2380
2345
|
"memberIdType",
|
|
@@ -2624,34 +2589,11 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2624
2589
|
message
|
|
2625
2590
|
});
|
|
2626
2591
|
}
|
|
2627
|
-
if (ctx.action === "edit") return withFeishuRequestContext(assertDirectAdapterHandoff, async () => {
|
|
2628
|
-
const messageId = resolveFeishuMessageId(ctx.params);
|
|
2629
|
-
if (!messageId) throw new Error("Feishu edit requires messageId.");
|
|
2630
|
-
const text = readFirstString(ctx.params, ["text", "message"]);
|
|
2631
|
-
const card = ctx.params.card && typeof ctx.params.card === "object" ? ctx.params.card : void 0;
|
|
2632
|
-
const runtime = await loadFeishuChannelRuntime();
|
|
2633
|
-
await requireAuthorizedFeishuMessage({
|
|
2634
|
-
ctx,
|
|
2635
|
-
account,
|
|
2636
|
-
runtime,
|
|
2637
|
-
messageId
|
|
2638
|
-
});
|
|
2639
|
-
return jsonActionResult({
|
|
2640
|
-
ok: true,
|
|
2641
|
-
channel: "feishu",
|
|
2642
|
-
action: "edit",
|
|
2643
|
-
...await runtime.editMessageFeishu({
|
|
2644
|
-
cfg: ctx.cfg,
|
|
2645
|
-
messageId,
|
|
2646
|
-
text,
|
|
2647
|
-
card,
|
|
2648
|
-
accountId: ctx.accountId ?? void 0
|
|
2649
|
-
})
|
|
2650
|
-
});
|
|
2651
|
-
});
|
|
2652
|
-
if (ctx.action === "pin" || ctx.action === "unpin") return withFeishuRequestContext(assertDirectAdapterHandoff, async () => {
|
|
2592
|
+
if (ctx.action === "edit" || ctx.action === "pin" || ctx.action === "unpin") return withFeishuRequestContext(assertDirectAdapterHandoff, async () => {
|
|
2653
2593
|
const messageId = resolveFeishuMessageId(ctx.params);
|
|
2654
2594
|
if (!messageId) throw new Error(`Feishu ${ctx.action} requires messageId.`);
|
|
2595
|
+
const text = ctx.action === "edit" ? readFirstString(ctx.params, ["text", "message"]) : void 0;
|
|
2596
|
+
const card = ctx.action === "edit" && ctx.params.card && typeof ctx.params.card === "object" ? ctx.params.card : void 0;
|
|
2655
2597
|
const runtime = await loadFeishuChannelRuntime();
|
|
2656
2598
|
await requireAuthorizedFeishuMessage({
|
|
2657
2599
|
ctx,
|
|
@@ -2659,26 +2601,27 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2659
2601
|
runtime,
|
|
2660
2602
|
messageId
|
|
2661
2603
|
});
|
|
2662
|
-
|
|
2663
|
-
ok: true,
|
|
2664
|
-
channel: "feishu",
|
|
2665
|
-
action: "pin",
|
|
2666
|
-
pin: await runtime.createPinFeishu({
|
|
2667
|
-
cfg: ctx.cfg,
|
|
2668
|
-
messageId,
|
|
2669
|
-
accountId: ctx.accountId ?? void 0
|
|
2670
|
-
})
|
|
2671
|
-
});
|
|
2672
|
-
await runtime.removePinFeishu({
|
|
2604
|
+
const messageParams = {
|
|
2673
2605
|
cfg: ctx.cfg,
|
|
2674
2606
|
messageId,
|
|
2675
2607
|
accountId: ctx.accountId ?? void 0
|
|
2608
|
+
};
|
|
2609
|
+
let result;
|
|
2610
|
+
if (ctx.action === "edit") result = await runtime.editMessageFeishu({
|
|
2611
|
+
...messageParams,
|
|
2612
|
+
text,
|
|
2613
|
+
card
|
|
2676
2614
|
});
|
|
2615
|
+
else if (ctx.action === "pin") result = { pin: await runtime.createPinFeishu(messageParams) };
|
|
2616
|
+
else {
|
|
2617
|
+
await runtime.removePinFeishu(messageParams);
|
|
2618
|
+
result = { messageId };
|
|
2619
|
+
}
|
|
2677
2620
|
return jsonActionResult({
|
|
2678
2621
|
ok: true,
|
|
2679
2622
|
channel: "feishu",
|
|
2680
|
-
action:
|
|
2681
|
-
|
|
2623
|
+
action: ctx.action,
|
|
2624
|
+
...result
|
|
2682
2625
|
});
|
|
2683
2626
|
});
|
|
2684
2627
|
if (ctx.action === "list-pins") {
|
|
@@ -2706,53 +2649,27 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2706
2649
|
})
|
|
2707
2650
|
});
|
|
2708
2651
|
}
|
|
2709
|
-
if (ctx.action === "channel-info") {
|
|
2652
|
+
if (ctx.action === "channel-info" || ctx.action === "member-info") {
|
|
2653
|
+
let runtime = ctx.action === "member-info" ? await loadFeishuChannelRuntime() : void 0;
|
|
2654
|
+
const memberId = ctx.action === "member-info" ? resolveFeishuMemberId(ctx.params) : void 0;
|
|
2710
2655
|
const chatId = resolveFeishuChatId(ctx);
|
|
2711
|
-
if (!chatId) throw new Error("Feishu channel-info requires chatId or channelId.");
|
|
2712
|
-
|
|
2713
|
-
const { chat
|
|
2656
|
+
if (!chatId) throw new Error(ctx.action === "channel-info" ? "Feishu channel-info requires chatId or channelId." : memberId ? "Feishu member-info requires chatId or channelId when memberId is provided." : "Feishu member-info requires memberId or chatId/channelId.");
|
|
2657
|
+
runtime ??= await loadFeishuChannelRuntime();
|
|
2658
|
+
const { chat, client } = await getAuthorizedFeishuChatInfo({
|
|
2714
2659
|
ctx,
|
|
2715
2660
|
account,
|
|
2716
2661
|
runtime,
|
|
2717
2662
|
chatId
|
|
2718
2663
|
});
|
|
2719
|
-
const
|
|
2720
|
-
if (!(ctx.params.includeMembers === true || ctx.params.members === true)) return jsonActionResult({
|
|
2721
|
-
ok: true,
|
|
2722
|
-
provider: "feishu",
|
|
2723
|
-
action: "channel-info",
|
|
2724
|
-
channel
|
|
2725
|
-
});
|
|
2726
|
-
const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
|
|
2727
|
-
const authorization = authorizeFeishuChatMemberRead({
|
|
2728
|
-
cfg: ctx.cfg,
|
|
2729
|
-
account,
|
|
2730
|
-
chatId,
|
|
2731
|
-
chatType,
|
|
2732
|
-
ctx,
|
|
2733
|
-
memberIdType: requestedMemberIdType
|
|
2734
|
-
});
|
|
2735
|
-
return jsonActionResult({
|
|
2664
|
+
const channelResult = {
|
|
2736
2665
|
ok: true,
|
|
2737
2666
|
provider: "feishu",
|
|
2738
2667
|
action: "channel-info",
|
|
2739
|
-
channel
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
}
|
|
2743
|
-
if (ctx.action === "member-info") {
|
|
2744
|
-
const runtime = await loadFeishuChannelRuntime();
|
|
2745
|
-
const memberId = resolveFeishuMemberId(ctx.params);
|
|
2746
|
-
const chatId = resolveFeishuChatId(ctx);
|
|
2747
|
-
if (!chatId) throw new Error(memberId ? "Feishu member-info requires chatId or channelId when memberId is provided." : "Feishu member-info requires memberId or chatId/channelId.");
|
|
2748
|
-
const { chat, client } = await getAuthorizedFeishuChatInfo({
|
|
2749
|
-
ctx,
|
|
2750
|
-
account,
|
|
2751
|
-
runtime,
|
|
2752
|
-
chatId
|
|
2753
|
-
});
|
|
2668
|
+
channel: chat
|
|
2669
|
+
};
|
|
2670
|
+
if (ctx.action === "channel-info" && ctx.params.includeMembers !== true && ctx.params.members !== true) return jsonActionResult(channelResult);
|
|
2754
2671
|
const requestedMemberIdType = resolveRequestedFeishuMemberIdType(ctx.params);
|
|
2755
|
-
const memberIdType =
|
|
2672
|
+
const memberIdType = requestedMemberIdType ?? "open_id";
|
|
2756
2673
|
const authorization = authorizeFeishuChatMemberRead({
|
|
2757
2674
|
cfg: ctx.cfg,
|
|
2758
2675
|
account,
|
|
@@ -2771,11 +2688,15 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2771
2688
|
member: await runtime.getFeishuMemberInfo(client, authorization.kind === "direct" ? authorization.memberId : memberId, authorization.kind === "direct" ? authorization.memberIdType : memberIdType)
|
|
2772
2689
|
});
|
|
2773
2690
|
}
|
|
2774
|
-
|
|
2691
|
+
const members = authorization.kind === "direct" ? runtime.buildFeishuDirectChatMembers(authorization) : await runtime.getChatMembers(client, chatId, readOptionalPositiveInteger(ctx.params, ["pageSize", "page_size"]), readFirstString(ctx.params, ["pageToken", "page_token"]), memberIdType);
|
|
2692
|
+
return jsonActionResult(ctx.action === "channel-info" ? {
|
|
2693
|
+
...channelResult,
|
|
2694
|
+
members
|
|
2695
|
+
} : {
|
|
2775
2696
|
ok: true,
|
|
2776
2697
|
channel: "feishu",
|
|
2777
2698
|
action: "member-info",
|
|
2778
|
-
...
|
|
2699
|
+
...members
|
|
2779
2700
|
});
|
|
2780
2701
|
}
|
|
2781
2702
|
if (ctx.action === "channel-list") {
|
|
@@ -2937,32 +2858,12 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2937
2858
|
}
|
|
2938
2859
|
},
|
|
2939
2860
|
directory: createChannelDirectoryAdapter({
|
|
2940
|
-
listPeers:
|
|
2941
|
-
|
|
2942
|
-
query: query ?? void 0,
|
|
2943
|
-
limit: limit ?? void 0,
|
|
2944
|
-
accountId: accountId ?? void 0
|
|
2945
|
-
}),
|
|
2946
|
-
listGroups: async ({ cfg, query, limit, accountId }) => listFeishuDirectoryGroups({
|
|
2947
|
-
cfg,
|
|
2948
|
-
query: query ?? void 0,
|
|
2949
|
-
limit: limit ?? void 0,
|
|
2950
|
-
accountId: accountId ?? void 0
|
|
2951
|
-
}),
|
|
2861
|
+
listPeers: listFeishuDirectoryPeers,
|
|
2862
|
+
listGroups: listFeishuDirectoryGroups,
|
|
2952
2863
|
...createRuntimeDirectoryLiveAdapter({
|
|
2953
2864
|
getRuntime: loadFeishuChannelRuntime,
|
|
2954
|
-
listPeersLive: (runtime) =>
|
|
2955
|
-
|
|
2956
|
-
query: query ?? void 0,
|
|
2957
|
-
limit: limit ?? void 0,
|
|
2958
|
-
accountId: accountId ?? void 0
|
|
2959
|
-
}),
|
|
2960
|
-
listGroupsLive: (runtime) => async ({ cfg, query, limit, accountId }) => await runtime.listFeishuDirectoryGroupsLive({
|
|
2961
|
-
cfg,
|
|
2962
|
-
query: query ?? void 0,
|
|
2963
|
-
limit: limit ?? void 0,
|
|
2964
|
-
accountId: accountId ?? void 0
|
|
2965
|
-
})
|
|
2865
|
+
listPeersLive: (runtime) => runtime.listFeishuDirectoryPeersLive,
|
|
2866
|
+
listGroupsLive: (runtime) => runtime.listFeishuDirectoryGroupsLive
|
|
2966
2867
|
})
|
|
2967
2868
|
}),
|
|
2968
2869
|
status: createComputedAccountStatusAdapter({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as listFeishuDirectoryPeers, o as feishuOutbound, u as listFeishuDirectoryGroups } from "./channel-
|
|
3
|
-
import { A as sendMessageFeishu, C as sendStickerFeishu, D as getMessageFeishu, E as editMessageFeishu, Q as assertFeishuApiSuccess, V as createConfiguredFeishuClient, k as sendCardFeishu } from "./reply-delivery-result-
|
|
4
|
-
import { r as createFeishuClient } from "./client-
|
|
5
|
-
import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-
|
|
6
|
-
import { t as probeFeishu } from "./probe-
|
|
1
|
+
import { m as resolveFeishuAccount } from "./doctor-contract-B1B9ogdd.mjs";
|
|
2
|
+
import { d as listFeishuDirectoryPeers, o as feishuOutbound, u as listFeishuDirectoryGroups } from "./channel-CX62T71S.mjs";
|
|
3
|
+
import { A as sendMessageFeishu, C as sendStickerFeishu, D as getMessageFeishu, E as editMessageFeishu, Q as assertFeishuApiSuccess, V as createConfiguredFeishuClient, k as sendCardFeishu } from "./reply-delivery-result-Bt-BWBEA.mjs";
|
|
4
|
+
import { r as createFeishuClient } from "./client-BsBVWJzN.mjs";
|
|
5
|
+
import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-BdyvImsY.mjs";
|
|
6
|
+
import { t as probeFeishu } from "./probe-B9o7iey6.mjs";
|
|
7
7
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
//#region extensions/feishu/src/directory.ts
|
|
9
9
|
const MAX_FEISHU_DIRECTORY_PAGES = 100;
|
|
@@ -153,9 +153,6 @@ async function addReactionFeishu(params) {
|
|
|
153
153
|
if (!reactionId) throw new Error("Feishu add reaction failed: no reaction_id returned");
|
|
154
154
|
return { reactionId };
|
|
155
155
|
}
|
|
156
|
-
/**
|
|
157
|
-
* Remove a reaction from a message.
|
|
158
|
-
*/
|
|
159
156
|
async function removeReactionFeishu(params) {
|
|
160
157
|
const { cfg, messageId, reactionId, accountId } = params;
|
|
161
158
|
const response = await createConfiguredFeishuClient({
|
|
@@ -167,9 +164,6 @@ async function removeReactionFeishu(params) {
|
|
|
167
164
|
} });
|
|
168
165
|
assertFeishuApiSuccess(response, "Feishu remove reaction failed");
|
|
169
166
|
}
|
|
170
|
-
/**
|
|
171
|
-
* List all reactions for a message.
|
|
172
|
-
*/
|
|
173
167
|
async function listReactionsFeishu(params) {
|
|
174
168
|
const { cfg, messageId, emojiType, accountId } = params;
|
|
175
169
|
const client = createConfiguredFeishuClient({
|