zcw-shared 2.23.3 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/api.d.ts +4 -0
- package/dist/constants/api.js +5 -0
- package/dist/constants/api.js.map +1 -0
- package/dist/functions/ai/applyLlmExtraBody.d.ts +3 -0
- package/dist/functions/ai/applyLlmExtraBody.js +34 -0
- package/dist/functions/ai/applyLlmExtraBody.js.map +1 -0
- package/dist/functions/ai/buildOpenAiChatCompletionsRequestBody.d.ts +9 -0
- package/dist/functions/ai/buildOpenAiChatCompletionsRequestBody.js +32 -0
- package/dist/functions/ai/buildOpenAiChatCompletionsRequestBody.js.map +1 -0
- package/dist/functions/ai/buildResolvedLlmToolsList.d.ts +14 -0
- package/dist/functions/ai/buildResolvedLlmToolsList.js +29 -0
- package/dist/functions/ai/buildResolvedLlmToolsList.js.map +1 -0
- package/dist/functions/ai/catalogLinkMode.d.ts +3 -0
- package/dist/functions/ai/catalogLinkMode.js +9 -0
- package/dist/functions/ai/catalogLinkMode.js.map +1 -0
- package/dist/functions/ai/createSyntheticAgentEmail.d.ts +4 -0
- package/dist/functions/ai/createSyntheticAgentEmail.js +4 -0
- package/dist/functions/ai/createSyntheticAgentEmail.js.map +1 -0
- package/dist/functions/ai/isValidMcpToolWirePayload.d.ts +2 -0
- package/dist/functions/ai/isValidMcpToolWirePayload.js +16 -0
- package/dist/functions/ai/isValidMcpToolWirePayload.js.map +1 -0
- package/dist/functions/ai/mcpUpstreamAuthHeaders.d.ts +4 -0
- package/dist/functions/ai/mcpUpstreamAuthHeaders.js +28 -0
- package/dist/functions/ai/mcpUpstreamAuthHeaders.js.map +1 -0
- package/dist/functions/ai/normalizeAiAgentReplyFormat.d.ts +3 -0
- package/dist/functions/ai/normalizeAiAgentReplyFormat.js +13 -0
- package/dist/functions/ai/normalizeAiAgentReplyFormat.js.map +1 -0
- package/dist/functions/ai/normalizeAiAttachmentPayloadFormat.d.ts +2 -0
- package/dist/functions/ai/normalizeAiAttachmentPayloadFormat.js +11 -0
- package/dist/functions/ai/normalizeAiAttachmentPayloadFormat.js.map +1 -0
- package/dist/functions/ai/normalizeMcpToolsWireFormat.d.ts +4 -0
- package/dist/functions/ai/normalizeMcpToolsWireFormat.js +13 -0
- package/dist/functions/ai/normalizeMcpToolsWireFormat.js.map +1 -0
- package/dist/functions/ai/normalizeToolProcessEnv.d.ts +4 -0
- package/dist/functions/ai/normalizeToolProcessEnv.js +25 -0
- package/dist/functions/ai/normalizeToolProcessEnv.js.map +1 -0
- package/dist/functions/ai/pickToolChoiceFromAgentToolsConfig.d.ts +1 -0
- package/dist/functions/ai/pickToolChoiceFromAgentToolsConfig.js +12 -0
- package/dist/functions/ai/pickToolChoiceFromAgentToolsConfig.js.map +1 -0
- package/dist/functions/ai/toolCatalogInlineEnv.d.ts +10 -0
- package/dist/functions/ai/toolCatalogInlineEnv.js +37 -0
- package/dist/functions/ai/toolCatalogInlineEnv.js.map +1 -0
- package/dist/functions/android/integrateFacebookLogin.js +1 -1
- package/dist/functions/android/integrateGoogleLogin.js +1 -1
- package/dist/functions/android/integrateMiuiLogin.js +1 -1
- package/dist/functions/android/integrateQQLogin.js +1 -1
- package/dist/functions/android/integrateShareTrace.js +1 -1
- package/dist/functions/android/integrateSinaLogin.js +1 -1
- package/dist/functions/android/integrateThirdPartyModule.js +1 -1
- package/dist/functions/android/integrateUniAppNativePlugin.js +1 -1
- package/dist/functions/android/integrateUniPushAndroid.js +1 -1
- package/dist/functions/android/integrateUniverifyLogin.js +1 -1
- package/dist/functions/android/integrateWechatLogin.js +1 -1
- package/dist/functions/android/integrateWechatShare.js +1 -1
- package/dist/functions/android/permission.js +1 -1
- package/dist/functions/api/apiErrorMessageFrom.d.ts +1 -0
- package/dist/functions/api/apiErrorMessageFrom.js +8 -0
- package/dist/functions/api/apiErrorMessageFrom.js.map +1 -0
- package/dist/functions/api/buildApiUrl.d.ts +2 -0
- package/dist/functions/api/buildApiUrl.js +11 -0
- package/dist/functions/api/buildApiUrl.js.map +1 -0
- package/dist/functions/api/createApiClient.d.ts +25 -0
- package/dist/functions/api/createApiClient.js +100 -0
- package/dist/functions/api/createApiClient.js.map +1 -0
- package/dist/functions/api/createApiErrorHandler.d.ts +18 -0
- package/dist/functions/api/createApiErrorHandler.js +39 -0
- package/dist/functions/api/createApiErrorHandler.js.map +1 -0
- package/dist/functions/api/createDefaultApiErrorHandler.d.ts +2 -0
- package/dist/functions/api/createDefaultApiErrorHandler.js +9 -0
- package/dist/functions/api/createDefaultApiErrorHandler.js.map +1 -0
- package/dist/functions/api/createFormDataApiUpload.d.ts +26 -0
- package/dist/functions/api/createFormDataApiUpload.js +107 -0
- package/dist/functions/api/createFormDataApiUpload.js.map +1 -0
- package/dist/functions/api/createInFlightFetchCoalescer.d.ts +4 -0
- package/dist/functions/api/createInFlightFetchCoalescer.js +22 -0
- package/dist/functions/api/createInFlightFetchCoalescer.js.map +1 -0
- package/dist/functions/api/createPublicAuthRequest.d.ts +14 -0
- package/dist/functions/api/createPublicAuthRequest.js +26 -0
- package/dist/functions/api/createPublicAuthRequest.js.map +1 -0
- package/dist/functions/api/createSpaBuildApiUrl.d.ts +2 -0
- package/dist/functions/api/createSpaBuildApiUrl.js +15 -0
- package/dist/functions/api/createSpaBuildApiUrl.js.map +1 -0
- package/dist/functions/api/estimateFormDataMultipartBodyBytes.d.ts +6 -0
- package/dist/functions/api/estimateFormDataMultipartBodyBytes.js +20 -0
- package/dist/functions/api/estimateFormDataMultipartBodyBytes.js.map +1 -0
- package/dist/functions/api/getUseMockFromSearch.d.ts +6 -0
- package/dist/functions/api/getUseMockFromSearch.js +9 -0
- package/dist/functions/api/getUseMockFromSearch.js.map +1 -0
- package/dist/functions/api/putSignedUploadWithProgress.d.ts +16 -0
- package/dist/functions/api/putSignedUploadWithProgress.js +41 -0
- package/dist/functions/api/putSignedUploadWithProgress.js.map +1 -0
- package/dist/functions/api/putXhrUploadWithProgress.d.ts +15 -0
- package/dist/functions/api/putXhrUploadWithProgress.js +28 -0
- package/dist/functions/api/putXhrUploadWithProgress.js.map +1 -0
- package/dist/functions/api/responseFromXhr.d.ts +12 -0
- package/dist/functions/api/responseFromXhr.js +9 -0
- package/dist/functions/api/responseFromXhr.js.map +1 -0
- package/dist/functions/api/unwrapApiJsonBody.d.ts +3 -0
- package/dist/functions/api/unwrapApiJsonBody.js +7 -0
- package/dist/functions/api/unwrapApiJsonBody.js.map +1 -0
- package/dist/functions/async/cachedAsync.js +1 -1
- package/dist/functions/auth/createAuthRecovery.d.ts +13 -0
- package/dist/functions/auth/createAuthRecovery.js +49 -0
- package/dist/functions/auth/createAuthRecovery.js.map +1 -0
- package/dist/functions/auth/createAuthStorageEnvironment.d.ts +17 -0
- package/dist/functions/auth/createAuthStorageEnvironment.js +29 -0
- package/dist/functions/auth/createAuthStorageEnvironment.js.map +1 -0
- package/dist/functions/auth/createAuthTokenStorage.d.ts +33 -0
- package/dist/functions/auth/createAuthTokenStorage.js +112 -0
- package/dist/functions/auth/createAuthTokenStorage.js.map +1 -0
- package/dist/functions/auth/createLoginRedirectAuthRecovery.d.ts +6 -0
- package/dist/functions/auth/createLoginRedirectAuthRecovery.js +14 -0
- package/dist/functions/auth/createLoginRedirectAuthRecovery.js.map +1 -0
- package/dist/functions/auth/createTokenManagerAuthStorageAdapter.d.ts +3 -0
- package/dist/functions/auth/createTokenManagerAuthStorageAdapter.js +59 -0
- package/dist/functions/auth/createTokenManagerAuthStorageAdapter.js.map +1 -0
- package/dist/functions/auth/createTokenManagerRuntime.d.ts +22 -0
- package/dist/functions/auth/createTokenManagerRuntime.js +61 -0
- package/dist/functions/auth/createTokenManagerRuntime.js.map +1 -0
- package/dist/functions/auth/createTokenRefreshGate.d.ts +4 -0
- package/dist/functions/auth/createTokenRefreshGate.js +13 -0
- package/dist/functions/auth/createTokenRefreshGate.js.map +1 -0
- package/dist/functions/auth/permissionSatisfies.js +1 -1
- package/dist/functions/auth/permissionSatisfies.js.map +1 -1
- package/dist/functions/browser/detectAppSafeAreaProfile.d.ts +16 -0
- package/dist/functions/browser/detectAppSafeAreaProfile.js +22 -0
- package/dist/functions/browser/detectAppSafeAreaProfile.js.map +1 -0
- package/dist/functions/browser/shortcutModKeyHint.js +1 -1
- package/dist/functions/cloudDisk/cloudDiskFileCategories.d.ts +6 -0
- package/dist/functions/cloudDisk/cloudDiskFileCategories.js +8 -0
- package/dist/functions/cloudDisk/cloudDiskFileCategories.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskFilePreviewUi.d.ts +4 -0
- package/dist/functions/cloudDisk/cloudDiskFilePreviewUi.js +23 -0
- package/dist/functions/cloudDisk/cloudDiskFilePreviewUi.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskIconConstants.d.ts +6 -0
- package/dist/functions/cloudDisk/cloudDiskIconConstants.js +7 -0
- package/dist/functions/cloudDisk/cloudDiskIconConstants.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskListContextMenuSpecs.d.ts +6 -0
- package/dist/functions/cloudDisk/cloudDiskListContextMenuSpecs.js +54 -0
- package/dist/functions/cloudDisk/cloudDiskListContextMenuSpecs.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskNodeDragPayload.d.ts +5 -0
- package/dist/functions/cloudDisk/cloudDiskNodeDragPayload.js +20 -0
- package/dist/functions/cloudDisk/cloudDiskNodeDragPayload.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskNodeUi.d.ts +19 -0
- package/dist/functions/cloudDisk/cloudDiskNodeUi.js +170 -0
- package/dist/functions/cloudDisk/cloudDiskNodeUi.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskPrivacyCrypto.d.ts +5 -0
- package/dist/functions/cloudDisk/cloudDiskPrivacyCrypto.js +39 -0
- package/dist/functions/cloudDisk/cloudDiskPrivacyCrypto.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskPrivateFolderTree.d.ts +4 -0
- package/dist/functions/cloudDisk/cloudDiskPrivateFolderTree.js +28 -0
- package/dist/functions/cloudDisk/cloudDiskPrivateFolderTree.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskUniappFileIcon.d.ts +2 -0
- package/dist/functions/cloudDisk/cloudDiskUniappFileIcon.js +27 -0
- package/dist/functions/cloudDisk/cloudDiskUniappFileIcon.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskUploadTaskUi.d.ts +3 -0
- package/dist/functions/cloudDisk/cloudDiskUploadTaskUi.js +26 -0
- package/dist/functions/cloudDisk/cloudDiskUploadTaskUi.js.map +1 -0
- package/dist/functions/cloudDisk/mapCloudDiskFileToNode.d.ts +2 -0
- package/dist/functions/cloudDisk/mapCloudDiskFileToNode.js +21 -0
- package/dist/functions/cloudDisk/mapCloudDiskFileToNode.js.map +1 -0
- package/dist/functions/code/index.js +1 -1
- package/dist/functions/color/convertColor.js +4 -4
- package/dist/functions/color/detectColorFormat.js +3 -3
- package/dist/functions/color/extractColors.js +2 -2
- package/dist/functions/design-tokens/buildTokens.js +3 -3
- package/dist/functions/dom/computePosition.js +2 -2
- package/dist/functions/dom/copyHtmlAndPlainToClipboard.js +1 -1
- package/dist/functions/dom/createSharedKeyboardCenter.js +1 -1
- package/dist/functions/dom/detectOverflow.js +1 -1
- package/dist/functions/dom/getCrossAxisFlip.js +2 -2
- package/dist/functions/dom/getFlipPlacements.js +2 -2
- package/dist/functions/dom/getMainAxisFlip.js +2 -2
- package/dist/functions/download/createDownloadDispatcher.d.ts +16 -0
- package/dist/functions/download/createDownloadDispatcher.js +31 -0
- package/dist/functions/download/createDownloadDispatcher.js.map +1 -0
- package/dist/functions/download/downloadInBrowser.d.ts +14 -0
- package/dist/functions/download/downloadInBrowser.js +56 -0
- package/dist/functions/download/downloadInBrowser.js.map +1 -0
- package/dist/functions/download/downloadInBrowserResolved.d.ts +12 -0
- package/dist/functions/download/downloadInBrowserResolved.js +47 -0
- package/dist/functions/download/downloadInBrowserResolved.js.map +1 -0
- package/dist/functions/fake/generateFakeDrivingLicense.js +1 -1
- package/dist/functions/fake/generateFakeIdCard.js +1 -1
- package/dist/functions/file/getIconfontNameByExtension.js +6 -1
- package/dist/functions/file/getIconfontNameByExtension.js.map +1 -1
- package/dist/functions/file/guessMimeTypeFromFileName.d.ts +1 -0
- package/dist/functions/file/guessMimeTypeFromFileName.js +9 -0
- package/dist/functions/file/guessMimeTypeFromFileName.js.map +1 -0
- package/dist/functions/file/index.d.ts +4 -0
- package/dist/functions/file/index.js +8 -4
- package/dist/functions/file/index.js.map +1 -1
- package/dist/functions/file/isJpegImageFile.d.ts +4 -0
- package/dist/functions/file/isJpegImageFile.js +12 -0
- package/dist/functions/file/isJpegImageFile.js.map +1 -0
- package/dist/functions/file/isRasterImageFile.d.ts +3 -0
- package/dist/functions/file/isRasterImageFile.js +26 -0
- package/dist/functions/file/isRasterImageFile.js.map +1 -0
- package/dist/functions/file/mediaProbePathFromUrl.d.ts +1 -0
- package/dist/functions/file/mediaProbePathFromUrl.js +17 -0
- package/dist/functions/file/mediaProbePathFromUrl.js.map +1 -0
- package/dist/functions/file/resolveFileMimeType.d.ts +5 -0
- package/dist/functions/file/resolveFileMimeType.js +8 -0
- package/dist/functions/file/resolveFileMimeType.js.map +1 -0
- package/dist/functions/file/sanitizeDownloadFilename.d.ts +6 -0
- package/dist/functions/file/sanitizeDownloadFilename.js +20 -0
- package/dist/functions/file/sanitizeDownloadFilename.js.map +1 -0
- package/dist/functions/file/suggestFilenameFromUrl.d.ts +1 -0
- package/dist/functions/file/suggestFilenameFromUrl.js +23 -0
- package/dist/functions/file/suggestFilenameFromUrl.js.map +1 -0
- package/dist/functions/hybrid/createBridgeMessage.js +1 -1
- package/dist/functions/im/chatMessageList.d.ts +15 -0
- package/dist/functions/im/chatMessageList.js +201 -0
- package/dist/functions/im/chatMessageList.js.map +1 -0
- package/dist/functions/im/chatMessageSocialActions.d.ts +3 -0
- package/dist/functions/im/chatMessageSocialActions.js +23 -0
- package/dist/functions/im/chatMessageSocialActions.js.map +1 -0
- package/dist/functions/im/classifyAgentProxyRetryable.d.ts +4 -0
- package/dist/functions/im/classifyAgentProxyRetryable.js +18 -0
- package/dist/functions/im/classifyAgentProxyRetryable.js.map +1 -0
- package/dist/functions/im/forwardBundleItemToChatMessage.d.ts +3 -0
- package/dist/functions/im/forwardBundleItemToChatMessage.js +129 -0
- package/dist/functions/im/forwardBundleItemToChatMessage.js.map +1 -0
- package/dist/functions/im/imAccountKind.d.ts +3 -0
- package/dist/functions/im/imAccountKind.js +7 -0
- package/dist/functions/im/imAccountKind.js.map +1 -0
- package/dist/functions/im/imAiChatSessionTitle.d.ts +2 -0
- package/dist/functions/im/imAiChatSessionTitle.js +16 -0
- package/dist/functions/im/imAiChatSessionTitle.js.map +1 -0
- package/dist/functions/im/imApiMessageMerge.d.ts +2 -0
- package/dist/functions/im/imApiMessageMerge.js +71 -0
- package/dist/functions/im/imApiMessageMerge.js.map +1 -0
- package/dist/functions/im/imApiResponseParse.d.ts +2 -0
- package/dist/functions/im/imApiResponseParse.js +35 -0
- package/dist/functions/im/imApiResponseParse.js.map +1 -0
- package/dist/functions/im/imBubbleSelectionClipboard.js +2 -2
- package/dist/functions/im/imChatContextMenuSpecs.d.ts +10 -0
- package/dist/functions/im/imChatContextMenuSpecs.js +45 -0
- package/dist/functions/im/imChatContextMenuSpecs.js.map +1 -0
- package/dist/functions/im/imChatInlineAttachmentDisplay.d.ts +16 -0
- package/dist/functions/im/imChatInlineAttachmentDisplay.js +53 -0
- package/dist/functions/im/imChatInlineAttachmentDisplay.js.map +1 -0
- package/dist/functions/im/imChatInlineAttachmentKind.d.ts +5 -0
- package/dist/functions/im/imChatInlineAttachmentKind.js +24 -0
- package/dist/functions/im/imChatInlineAttachmentKind.js.map +1 -0
- package/dist/functions/im/imChatMessageContextMenuCopy.d.ts +3 -0
- package/dist/functions/im/imChatMessageContextMenuCopy.js +34 -0
- package/dist/functions/im/imChatMessageContextMenuCopy.js.map +1 -0
- package/dist/functions/im/imChatMessageCopyPlain.d.ts +5 -0
- package/dist/functions/im/imChatMessageCopyPlain.js +71 -0
- package/dist/functions/im/imChatMessageCopyPlain.js.map +1 -0
- package/dist/functions/im/imChatMessageInbound.d.ts +9 -0
- package/dist/functions/im/imChatMessageInbound.js +94 -0
- package/dist/functions/im/imChatMessageInbound.js.map +1 -0
- package/dist/functions/im/imChatMessageLayout.d.ts +3 -0
- package/dist/functions/im/imChatMessageLayout.js +4 -0
- package/dist/functions/im/imChatMessageLayout.js.map +1 -0
- package/dist/functions/im/imChatMessageMap.d.ts +13 -0
- package/dist/functions/im/imChatMessageMap.js +62 -0
- package/dist/functions/im/imChatMessageMap.js.map +1 -0
- package/dist/functions/im/imChatMessageMediaAsset.d.ts +5 -0
- package/dist/functions/im/imChatMessageMediaAsset.js +32 -0
- package/dist/functions/im/imChatMessageMediaAsset.js.map +1 -0
- package/dist/functions/im/imChatMessagePagination.d.ts +18 -0
- package/dist/functions/im/imChatMessagePagination.js +153 -0
- package/dist/functions/im/imChatMessagePagination.js.map +1 -0
- package/dist/functions/im/imChatMessageTime.d.ts +2 -0
- package/dist/functions/im/imChatMessageTime.js +24 -0
- package/dist/functions/im/imChatMessageTime.js.map +1 -0
- package/dist/functions/im/imChatViewContextMenu.d.ts +12 -0
- package/dist/functions/im/imChatViewContextMenu.js +91 -0
- package/dist/functions/im/imChatViewContextMenu.js.map +1 -0
- package/dist/functions/im/imClientMessageId.d.ts +1 -0
- package/dist/functions/im/imClientMessageId.js +4 -0
- package/dist/functions/im/imClientMessageId.js.map +1 -0
- package/dist/functions/im/imCodeProjectPath.d.ts +6 -0
- package/dist/functions/im/imCodeProjectPath.js +29 -0
- package/dist/functions/im/imCodeProjectPath.js.map +1 -0
- package/dist/functions/im/imComposerDraft.d.ts +3 -0
- package/dist/functions/im/imComposerDraft.js +30 -0
- package/dist/functions/im/imComposerDraft.js.map +1 -0
- package/dist/functions/im/imComposerToolbar.d.ts +5 -0
- package/dist/functions/im/imComposerToolbar.js +80 -0
- package/dist/functions/im/imComposerToolbar.js.map +1 -0
- package/dist/functions/im/imContactDisplay.d.ts +5 -0
- package/dist/functions/im/imContactDisplay.js +30 -0
- package/dist/functions/im/imContactDisplay.js.map +1 -0
- package/dist/functions/im/imContactIndexLetter.d.ts +7 -0
- package/dist/functions/im/imContactIndexLetter.js +62 -0
- package/dist/functions/im/imContactIndexLetter.js.map +1 -0
- package/dist/functions/im/imConversationAdminIds.d.ts +2 -0
- package/dist/functions/im/imConversationAdminIds.js +11 -0
- package/dist/functions/im/imConversationAdminIds.js.map +1 -0
- package/dist/functions/im/imConversationDisplay.d.ts +9 -0
- package/dist/functions/im/imConversationDisplay.js +50 -0
- package/dist/functions/im/imConversationDisplay.js.map +1 -0
- package/dist/functions/im/imConversationDraftHighlight.d.ts +1 -0
- package/dist/functions/im/imConversationDraftHighlight.js +10 -0
- package/dist/functions/im/imConversationDraftHighlight.js.map +1 -0
- package/dist/functions/im/imConversationHistoryFilter.d.ts +18 -0
- package/dist/functions/im/imConversationHistoryFilter.js +144 -0
- package/dist/functions/im/imConversationHistoryFilter.js.map +1 -0
- package/dist/functions/im/imConversationId.d.ts +7 -0
- package/dist/functions/im/imConversationId.js +28 -0
- package/dist/functions/im/imConversationId.js.map +1 -0
- package/dist/functions/im/imConversationLastMessageMerge.d.ts +2 -0
- package/dist/functions/im/imConversationLastMessageMerge.js +29 -0
- package/dist/functions/im/imConversationLastMessageMerge.js.map +1 -0
- package/dist/functions/im/imConversationListHighlights.d.ts +21 -0
- package/dist/functions/im/imConversationListHighlights.js +144 -0
- package/dist/functions/im/imConversationListHighlights.js.map +1 -0
- package/dist/functions/im/imConversationListOnlinePresence.d.ts +4 -0
- package/dist/functions/im/imConversationListOnlinePresence.js +23 -0
- package/dist/functions/im/imConversationListOnlinePresence.js.map +1 -0
- package/dist/functions/im/imConversationListOutboundContext.d.ts +6 -0
- package/dist/functions/im/imConversationListOutboundContext.js +70 -0
- package/dist/functions/im/imConversationListOutboundContext.js.map +1 -0
- package/dist/functions/im/imConversationListSummary.d.ts +21 -0
- package/dist/functions/im/imConversationListSummary.js +87 -0
- package/dist/functions/im/imConversationListSummary.js.map +1 -0
- package/dist/functions/im/imConversationParty.d.ts +4 -0
- package/dist/functions/im/imConversationParty.js +10 -0
- package/dist/functions/im/imConversationParty.js.map +1 -0
- package/dist/functions/im/imConversationRowFields.d.ts +3 -0
- package/dist/functions/im/imConversationRowFields.js +23 -0
- package/dist/functions/im/imConversationRowFields.js.map +1 -0
- package/dist/functions/im/imConversationServerTime.d.ts +8 -0
- package/dist/functions/im/imConversationServerTime.js +59 -0
- package/dist/functions/im/imConversationServerTime.js.map +1 -0
- package/dist/functions/im/imConversationToChatViewUi.d.ts +21 -0
- package/dist/functions/im/imConversationToChatViewUi.js +69 -0
- package/dist/functions/im/imConversationToChatViewUi.js.map +1 -0
- package/dist/functions/im/imDesktopMachineExtra.d.ts +5 -0
- package/dist/functions/im/imDesktopMachineExtra.js +32 -0
- package/dist/functions/im/imDesktopMachineExtra.js.map +1 -0
- package/dist/functions/im/imDesktopNotificationContent.d.ts +29 -0
- package/dist/functions/im/imDesktopNotificationContent.js +65 -0
- package/dist/functions/im/imDesktopNotificationContent.js.map +1 -0
- package/dist/functions/im/imDexieMessageId.d.ts +2 -0
- package/dist/functions/im/imDexieMessageId.js +30 -0
- package/dist/functions/im/imDexieMessageId.js.map +1 -0
- package/dist/functions/im/imDisplayExtra.d.ts +11 -0
- package/dist/functions/im/imDisplayExtra.js +130 -0
- package/dist/functions/im/imDisplayExtra.js.map +1 -0
- package/dist/functions/im/imForwardBundlePreviewText.d.ts +1 -0
- package/dist/functions/im/imForwardBundlePreviewText.js +10 -0
- package/dist/functions/im/imForwardBundlePreviewText.js.map +1 -0
- package/dist/functions/im/imForwardBundleTitle.d.ts +5 -0
- package/dist/functions/im/imForwardBundleTitle.js +32 -0
- package/dist/functions/im/imForwardBundleTitle.js.map +1 -0
- package/dist/functions/im/imForwardSnapshot.d.ts +18 -0
- package/dist/functions/im/imForwardSnapshot.js +264 -0
- package/dist/functions/im/imForwardSnapshot.js.map +1 -0
- package/dist/functions/im/imForwardSnapshotMentions.d.ts +7 -0
- package/dist/functions/im/imForwardSnapshotMentions.js +76 -0
- package/dist/functions/im/imForwardSnapshotMentions.js.map +1 -0
- package/dist/functions/im/imImagePixelExtra.d.ts +24 -0
- package/dist/functions/im/imImagePixelExtra.js +52 -0
- package/dist/functions/im/imImagePixelExtra.js.map +1 -0
- package/dist/functions/im/imInlineContentTokens.js +1 -1
- package/dist/functions/im/imInlineMediaUrlVideo.d.ts +4 -0
- package/dist/functions/im/imInlineMediaUrlVideo.js +14 -0
- package/dist/functions/im/imInlineMediaUrlVideo.js.map +1 -0
- package/dist/functions/im/imLlmContextExtra.d.ts +2 -0
- package/dist/functions/im/imLlmContextExtra.js +37 -0
- package/dist/functions/im/imLlmContextExtra.js.map +1 -0
- package/dist/functions/im/imLlmContextLabel.d.ts +2 -0
- package/dist/functions/im/imLlmContextLabel.js +32 -0
- package/dist/functions/im/imLlmContextLabel.js.map +1 -0
- package/dist/functions/im/imLocalMessageId.d.ts +4 -0
- package/dist/functions/im/imLocalMessageId.js +18 -0
- package/dist/functions/im/imLocalMessageId.js.map +1 -0
- package/dist/functions/im/imLooseMessageRow.d.ts +3 -0
- package/dist/functions/im/imLooseMessageRow.js +88 -0
- package/dist/functions/im/imLooseMessageRow.js.map +1 -0
- package/dist/functions/im/imMediaExtra.d.ts +11 -0
- package/dist/functions/im/imMediaExtra.js +71 -0
- package/dist/functions/im/imMediaExtra.js.map +1 -0
- package/dist/functions/im/imMemberIdsInput.d.ts +1 -0
- package/dist/functions/im/imMemberIdsInput.js +9 -0
- package/dist/functions/im/imMemberIdsInput.js.map +1 -0
- package/dist/functions/im/imMentionAllowedUserIds.d.ts +15 -0
- package/dist/functions/im/imMentionAllowedUserIds.js +47 -0
- package/dist/functions/im/imMentionAllowedUserIds.js.map +1 -0
- package/dist/functions/im/imMessageExtraRecord.d.ts +7 -0
- package/dist/functions/im/imMessageExtraRecord.js +13 -0
- package/dist/functions/im/imMessageExtraRecord.js.map +1 -0
- package/dist/functions/im/imMessageHistoryWindow.d.ts +17 -0
- package/dist/functions/im/imMessageHistoryWindow.js +117 -0
- package/dist/functions/im/imMessageHistoryWindow.js.map +1 -0
- package/dist/functions/im/imMessageId.d.ts +8 -0
- package/dist/functions/im/imMessageId.js +35 -0
- package/dist/functions/im/imMessageId.js.map +1 -0
- package/dist/functions/im/imMessageIdForApiDelete.d.ts +2 -0
- package/dist/functions/im/imMessageIdForApiDelete.js +14 -0
- package/dist/functions/im/imMessageIdForApiDelete.js.map +1 -0
- package/dist/functions/im/imMessageListActivity.d.ts +5 -0
- package/dist/functions/im/imMessageListActivity.js +52 -0
- package/dist/functions/im/imMessageListActivity.js.map +1 -0
- package/dist/functions/im/imMessageListOps.d.ts +5 -0
- package/dist/functions/im/imMessageListOps.js +51 -0
- package/dist/functions/im/imMessageListOps.js.map +1 -0
- package/dist/functions/im/imMessageListSummaryBody.d.ts +16 -0
- package/dist/functions/im/imMessageListSummaryBody.js +174 -0
- package/dist/functions/im/imMessageListSummaryBody.js.map +1 -0
- package/dist/functions/im/imMessageNormalize.d.ts +14 -0
- package/dist/functions/im/imMessageNormalize.js +220 -0
- package/dist/functions/im/imMessageNormalize.js.map +1 -0
- package/dist/functions/im/imMessageToChatMessage.d.ts +9 -0
- package/dist/functions/im/imMessageToChatMessage.js +190 -0
- package/dist/functions/im/imMessageToChatMessage.js.map +1 -0
- package/dist/functions/im/imOutboundListSummary.d.ts +12 -0
- package/dist/functions/im/imOutboundListSummary.js +106 -0
- package/dist/functions/im/imOutboundListSummary.js.map +1 -0
- package/dist/functions/im/imOutboundMediaHelpers.d.ts +4 -0
- package/dist/functions/im/imOutboundMediaHelpers.js +22 -0
- package/dist/functions/im/imOutboundMediaHelpers.js.map +1 -0
- package/dist/functions/im/imOutboundPatch.d.ts +5 -0
- package/dist/functions/im/imOutboundPatch.js +61 -0
- package/dist/functions/im/imOutboundPatch.js.map +1 -0
- package/dist/functions/im/imOutboundStatus.d.ts +4 -0
- package/dist/functions/im/imOutboundStatus.js +15 -0
- package/dist/functions/im/imOutboundStatus.js.map +1 -0
- package/dist/functions/im/imPendingOpenConversation.d.ts +3 -0
- package/dist/functions/im/imPendingOpenConversation.js +14 -0
- package/dist/functions/im/imPendingOpenConversation.js.map +1 -0
- package/dist/functions/im/imPlaceholderSnippet.d.ts +2 -0
- package/dist/functions/im/imPlaceholderSnippet.js +13 -0
- package/dist/functions/im/imPlaceholderSnippet.js.map +1 -0
- package/dist/functions/im/imProxyAgentContent.d.ts +8 -0
- package/dist/functions/im/imProxyAgentContent.js +56 -0
- package/dist/functions/im/imProxyAgentContent.js.map +1 -0
- package/dist/functions/im/imProxyAgentDiagnostics.d.ts +16 -0
- package/dist/functions/im/imProxyAgentDiagnostics.js +70 -0
- package/dist/functions/im/imProxyAgentDiagnostics.js.map +1 -0
- package/dist/functions/im/imProxyAgentMessage.d.ts +23 -0
- package/dist/functions/im/imProxyAgentMessage.js +146 -0
- package/dist/functions/im/imProxyAgentMessage.js.map +1 -0
- package/dist/functions/im/imProxySelfIdentityTemplate.d.ts +13 -0
- package/dist/functions/im/imProxySelfIdentityTemplate.js +34 -0
- package/dist/functions/im/imProxySelfIdentityTemplate.js.map +1 -0
- package/dist/functions/im/imQuotePreview.d.ts +13 -0
- package/dist/functions/im/imQuotePreview.js +156 -0
- package/dist/functions/im/imQuotePreview.js.map +1 -0
- package/dist/functions/im/imReplyExtra.d.ts +3 -0
- package/dist/functions/im/imReplyExtra.js +26 -0
- package/dist/functions/im/imReplyExtra.js.map +1 -0
- package/dist/functions/im/imRichClipboardPlain.js +1 -1
- package/dist/functions/im/imRichContentPlain.d.ts +3 -0
- package/dist/functions/im/imRichContentPlain.js +18 -0
- package/dist/functions/im/imRichContentPlain.js.map +1 -0
- package/dist/functions/im/imSendPayloadValidation.d.ts +6 -0
- package/dist/functions/im/imSendPayloadValidation.js +136 -0
- package/dist/functions/im/imSendPayloadValidation.js.map +1 -0
- package/dist/functions/im/imSnakeChatMessage.d.ts +5 -0
- package/dist/functions/im/imSnakeChatMessage.js +62 -0
- package/dist/functions/im/imSnakeChatMessage.js.map +1 -0
- package/dist/functions/im/imWalletExtra.d.ts +3 -0
- package/dist/functions/im/imWalletExtra.js +114 -0
- package/dist/functions/im/imWalletExtra.js.map +1 -0
- package/dist/functions/im/index.d.ts +81 -0
- package/dist/functions/im/index.js +85 -4
- package/dist/functions/im/index.js.map +1 -1
- package/dist/functions/im/mapAgentToImProxyItem.d.ts +21 -0
- package/dist/functions/im/mapAgentToImProxyItem.js +23 -0
- package/dist/functions/im/mapAgentToImProxyItem.js.map +1 -0
- package/dist/functions/im/validateImPeerInput.d.ts +8 -0
- package/dist/functions/im/validateImPeerInput.js +14 -0
- package/dist/functions/im/validateImPeerInput.js.map +1 -0
- package/dist/functions/image/compressImageToWidth.js +1 -1
- package/dist/functions/image/compressImageToWidthJpgOrWebp.js +2 -2
- package/dist/functions/image/compressJpgToTargetSize.js +1 -1
- package/dist/functions/image/compressToTargetSizeJpg.js +1 -1
- package/dist/functions/image/compressToTargetSizeJpgOrWebp.js +2 -2
- package/dist/functions/image/generateMacIcons.js +2 -2
- package/dist/functions/image/generatePwaIcons.js +2 -2
- package/dist/functions/image/scaleDimensionsToMaxSide.d.ts +4 -0
- package/dist/functions/image/scaleDimensionsToMaxSide.js +14 -0
- package/dist/functions/image/scaleDimensionsToMaxSide.js.map +1 -0
- package/dist/functions/ios/configurePermissions.js +1 -1
- package/dist/functions/ios/integrateCameraGallery.js +1 -1
- package/dist/functions/ios/integrateNativePlugin.js +1 -1
- package/dist/functions/ios/integrateQQShare.js +1 -1
- package/dist/functions/ios/integrateSinaShare.js +1 -1
- package/dist/functions/ios/integrateThirdPartyModule.js +1 -1
- package/dist/functions/ios/integrateUniPushIOS.js +1 -1
- package/dist/functions/ios/integrateWechatOauth.js +1 -1
- package/dist/functions/ios/integrateWechatShare.js +1 -1
- package/dist/functions/llm/backfillReasoningInMessages.d.ts +3 -0
- package/dist/functions/llm/backfillReasoningInMessages.js +28 -0
- package/dist/functions/llm/backfillReasoningInMessages.js.map +1 -0
- package/dist/functions/llm/createLlmReasoningStore.d.ts +16 -0
- package/dist/functions/llm/createLlmReasoningStore.js +167 -0
- package/dist/functions/llm/createLlmReasoningStore.js.map +1 -0
- package/dist/functions/markdown/cwMarkdownAst.d.ts +68 -0
- package/dist/functions/markdown/cwMarkdownAst.js +2 -0
- package/dist/functions/markdown/cwMarkdownAst.js.map +1 -0
- package/dist/functions/markdown/markdownToSpeechPlainText.d.ts +5 -0
- package/dist/functions/markdown/markdownToSpeechPlainText.js +123 -0
- package/dist/functions/markdown/markdownToSpeechPlainText.js.map +1 -0
- package/dist/functions/markdown/parseGfmTable.d.ts +6 -0
- package/dist/functions/markdown/parseGfmTable.js +87 -0
- package/dist/functions/markdown/parseGfmTable.js.map +1 -0
- package/dist/functions/markdown/parseInline.d.ts +2 -0
- package/dist/functions/markdown/parseInline.js +227 -0
- package/dist/functions/markdown/parseInline.js.map +1 -0
- package/dist/functions/markdown/parseMarkdownBlocks.d.ts +2 -0
- package/dist/functions/markdown/parseMarkdownBlocks.js +197 -0
- package/dist/functions/markdown/parseMarkdownBlocks.js.map +1 -0
- package/dist/functions/observability/createObservabilityReporter.d.ts +29 -0
- package/dist/functions/observability/createObservabilityReporter.js +77 -0
- package/dist/functions/observability/createObservabilityReporter.js.map +1 -0
- package/dist/functions/observability/createObservabilityRingBuffer.d.ts +5 -0
- package/dist/functions/observability/createObservabilityRingBuffer.js +14 -0
- package/dist/functions/observability/createObservabilityRingBuffer.js.map +1 -0
- package/dist/functions/observability/isBenignObservabilityError.d.ts +2 -0
- package/dist/functions/observability/isBenignObservabilityError.js +17 -0
- package/dist/functions/observability/isBenignObservabilityError.js.map +1 -0
- package/dist/functions/observability/sanitizeApiPath.d.ts +1 -0
- package/dist/functions/observability/sanitizeApiPath.js +5 -0
- package/dist/functions/observability/sanitizeApiPath.js.map +1 -0
- package/dist/functions/oss/buildCosObjectKey.d.ts +1 -0
- package/dist/functions/oss/buildCosObjectKey.js +6 -0
- package/dist/functions/oss/buildCosObjectKey.js.map +1 -0
- package/dist/functions/oss/buildCosUnsignedObjectUrl.d.ts +7 -0
- package/dist/functions/oss/buildCosUnsignedObjectUrl.js +10 -0
- package/dist/functions/oss/buildCosUnsignedObjectUrl.js.map +1 -0
- package/dist/functions/oss/buildOssVideoPosterPath.d.ts +1 -0
- package/dist/functions/oss/buildOssVideoPosterPath.js +7 -0
- package/dist/functions/oss/buildOssVideoPosterPath.js.map +1 -0
- package/dist/functions/oss/buildTimestampedOssObjectPath.d.ts +1 -0
- package/dist/functions/oss/buildTimestampedOssObjectPath.js +10 -0
- package/dist/functions/oss/buildTimestampedOssObjectPath.js.map +1 -0
- package/dist/functions/oss/cosSliceUploadWithSts.d.ts +7 -0
- package/dist/functions/oss/cosSliceUploadWithSts.js +30 -0
- package/dist/functions/oss/cosSliceUploadWithSts.js.map +1 -0
- package/dist/functions/oss/createOssBrowserUploadClient.d.ts +5 -0
- package/dist/functions/oss/createOssBrowserUploadClient.js +5 -0
- package/dist/functions/oss/createOssBrowserUploadClient.js.map +1 -0
- package/dist/functions/oss/createOssSignedUploadApi.d.ts +20 -0
- package/dist/functions/oss/createOssSignedUploadApi.js +71 -0
- package/dist/functions/oss/createOssSignedUploadApi.js.map +1 -0
- package/dist/functions/oss/parseOssDownloadRequest.d.ts +9 -0
- package/dist/functions/oss/parseOssDownloadRequest.js +42 -0
- package/dist/functions/oss/parseOssDownloadRequest.js.map +1 -0
- package/dist/functions/oss/resolveOssUploadContentType.d.ts +2 -0
- package/dist/functions/oss/resolveOssUploadContentType.js +12 -0
- package/dist/functions/oss/resolveOssUploadContentType.js.map +1 -0
- package/dist/functions/oss/sanitizeOssObjectName.d.ts +1 -0
- package/dist/functions/oss/sanitizeOssObjectName.js +7 -0
- package/dist/functions/oss/sanitizeOssObjectName.js.map +1 -0
- package/dist/functions/oss/uploadBlobViaSignedPut.d.ts +21 -0
- package/dist/functions/oss/uploadBlobViaSignedPut.js +17 -0
- package/dist/functions/oss/uploadBlobViaSignedPut.js.map +1 -0
- package/dist/functions/oss/uploadOssFileFromBrowser.d.ts +11 -0
- package/dist/functions/oss/uploadOssFileFromBrowser.js +38 -0
- package/dist/functions/oss/uploadOssFileFromBrowser.js.map +1 -0
- package/dist/functions/path/index.js +4 -4
- package/dist/functions/performance/debounceWithCancel.d.ts +9 -0
- package/dist/functions/performance/debounceWithCancel.js +18 -0
- package/dist/functions/performance/debounceWithCancel.js.map +1 -0
- package/dist/functions/router/readRouteQuery.d.ts +4 -0
- package/dist/functions/router/readRouteQuery.js +14 -0
- package/dist/functions/router/readRouteQuery.js.map +1 -0
- package/dist/functions/software/findSoftware.js +1 -1
- package/dist/functions/string/caseConverter.js +1 -1
- package/dist/functions/string/similarity.js +1 -1
- package/dist/functions/tree/index.js +1 -1
- package/dist/functions/ui/materializeImUiContextMenuItems.d.ts +2 -0
- package/dist/functions/ui/materializeImUiContextMenuItems.js +17 -0
- package/dist/functions/ui/materializeImUiContextMenuItems.js.map +1 -0
- package/dist/functions/ui/resolveGalleryPreviewContextMenuEvent.d.ts +6 -0
- package/dist/functions/ui/resolveGalleryPreviewContextMenuEvent.js +9 -0
- package/dist/functions/ui/resolveGalleryPreviewContextMenuEvent.js.map +1 -0
- package/dist/functions/uniapp/api/index.js +10 -10
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +21 -21
- package/dist/functions/uniapp/app-plus/buildIOSApp.js +13 -13
- package/dist/functions/uniapp/camera/showCamera.js +3 -3
- package/dist/functions/uniapp/customer-service/showWxCustomerService.js +1 -1
- package/dist/functions/uniapp/file/showFile.js +3 -3
- package/dist/functions/uniapp/image/showImage.js +3 -3
- package/dist/functions/uniapp/login/showLogin.js +2 -2
- package/dist/functions/uniapp/parseManifest.js +1 -1
- package/dist/functions/uniapp/pay/showPay.js +3 -3
- package/dist/functions/uniapp/phone/showWxPhone.js +1 -1
- package/dist/functions/uniapp/platform.js +1 -1
- package/dist/functions/uniapp/record/showRecord.js +3 -3
- package/dist/functions/uniapp/scan-code/showScanCode.js +2 -2
- package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js +1 -1
- package/dist/functions/uniapp/video/showVideo.js +3 -3
- package/dist/functions/url/assetUrlGuards.d.ts +3 -0
- package/dist/functions/url/assetUrlGuards.js +19 -0
- package/dist/functions/url/assetUrlGuards.js.map +1 -0
- package/dist/functions/utils/generateExports.d.ts +2 -0
- package/dist/functions/utils/generateExports.js +9 -1
- package/dist/functions/utils/generateExports.js.map +1 -1
- package/dist/functions/utils/parseJsonObjectFromText.d.ts +1 -0
- package/dist/functions/utils/parseJsonObjectFromText.js +18 -0
- package/dist/functions/utils/parseJsonObjectFromText.js.map +1 -0
- package/dist/functions/validation/normalizeExternalId.d.ts +4 -0
- package/dist/functions/validation/normalizeExternalId.js +19 -0
- package/dist/functions/validation/normalizeExternalId.js.map +1 -0
- package/dist/functions/version/incrementVersion.js +1 -1
- package/dist/functions/vue/extractColorsFromVueFile.js +5 -5
- package/dist/functions/vue/extractColorsFromVueSection.js +1 -1
- package/dist/permissions/allPermissionCode.js.map +1 -1
- package/dist/permissions/catalog.d.ts +78 -4
- package/dist/permissions/catalog.js +283 -5
- package/dist/permissions/catalog.js.map +1 -1
- package/dist/permissions/definePermissionGroup.js.map +1 -1
- package/dist/permissions/groups.js.map +1 -1
- package/dist/reactive/useReactiveCookie.js +1 -1
- package/dist/schemas/auth.schema.d.ts +32 -32
- package/dist/schemas/video.schema.d.ts +80 -80
- package/dist/vue-hooks/browser/useBridgeMessage.js +2 -2
- package/dist/vue-hooks/browser/useWechatJSSDK.js +1 -1
- package/dist/vue-hooks/dom/useAutoUpdate.js +1 -1
- package/dist/vue-hooks/history/useDebouncedRefHistory.js +1 -1
- package/dist/vue-hooks/history/useRefHistory.js +1 -1
- package/dist/vue-hooks/worker/useWorkerPool.js +1 -1
- package/package.json +235 -18
- package/references/cos-js-sdk-v5.d.ts +36 -0
- package/references/crypto.d.ts +10 -0
- package/references/dom.d.ts +2 -0
- package/references/xhr.d.ts +11 -0
- package/types/agent-input-content.d.ts +12 -0
- package/types/ai-agent.d.ts +5 -0
- package/types/ai-mcp.d.ts +18 -0
- package/types/api-client.d.ts +35 -0
- package/types/app-safe-area.d.ts +9 -0
- package/types/cloud-disk.d.ts +82 -0
- package/types/download.d.ts +54 -0
- package/types/im-account-kind.d.ts +2 -0
- package/types/im-api.d.ts +3 -0
- package/types/im-chat.d.ts +14 -0
- package/types/im-code-project.d.ts +32 -0
- package/types/im-composer.d.ts +23 -0
- package/types/im-contact.d.ts +22 -0
- package/types/im-snake-chat.d.ts +33 -0
- package/types/llm-openai-wire.d.ts +1 -0
- package/types/observability.d.ts +39 -0
- package/types/oss-signed-upload.d.ts +68 -0
- package/dist/permissions/allPermissionCode.d.ts +0 -3
- package/dist/permissions/allPermissionCode.js +0 -14
- package/dist/permissions/definePermissionGroup.d.ts +0 -26
- package/dist/permissions/definePermissionGroup.js +0 -22
- package/dist/permissions/groups.d.ts +0 -50
- package/dist/permissions/groups.js +0 -251
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { getImMessageExtraRecord, isLocalMediaPendingExtra } from './imMessageExtraRecord.js';
|
|
2
|
+
import { isMandatoryImLocalOutboundInWindow } from './imMessageHistoryWindow.js';
|
|
3
|
+
export function isMediaUploadActivelyInFlightExtra(ex) {
|
|
4
|
+
const st = ex?.media_upload_status;
|
|
5
|
+
return st === 'pending_register' || st === 'uploading';
|
|
6
|
+
}
|
|
7
|
+
export function countHistoryMessagesInRows(rows, myUserId) {
|
|
8
|
+
const uid = myUserId?.trim();
|
|
9
|
+
if (!uid)
|
|
10
|
+
return rows.length;
|
|
11
|
+
return rows.filter((m) => !isMandatoryImLocalOutboundInWindow(m, uid, rows)).length;
|
|
12
|
+
}
|
|
13
|
+
export function buildImOutboundFailurePatch(msg) {
|
|
14
|
+
const ex = getImMessageExtraRecord(msg) ?? {};
|
|
15
|
+
const mus = ex.media_upload_status;
|
|
16
|
+
const mediaNeedsFail = mus === 'pending_register' ||
|
|
17
|
+
mus === 'uploading' ||
|
|
18
|
+
(isLocalMediaPendingExtra(ex) && isMediaUploadActivelyInFlightExtra(ex));
|
|
19
|
+
const inlineNeedsClear = ex.inline_uploading === true || ex.inline_image_uploading === true;
|
|
20
|
+
const ob = msg.outbound_status;
|
|
21
|
+
const outboundNeedsFail = ob === 'queued' ||
|
|
22
|
+
ob === 'sending' ||
|
|
23
|
+
ob === 'failed' ||
|
|
24
|
+
mediaNeedsFail ||
|
|
25
|
+
inlineNeedsClear;
|
|
26
|
+
const patch = {};
|
|
27
|
+
if (outboundNeedsFail) {
|
|
28
|
+
patch.outbound_status = 'failed';
|
|
29
|
+
}
|
|
30
|
+
if (mediaNeedsFail || inlineNeedsClear) {
|
|
31
|
+
const nextEx = { ...ex };
|
|
32
|
+
if (mediaNeedsFail) {
|
|
33
|
+
nextEx.local_media_pending = true;
|
|
34
|
+
nextEx.media_upload_status = 'failed';
|
|
35
|
+
}
|
|
36
|
+
if (inlineNeedsClear) {
|
|
37
|
+
delete nextEx.inline_uploading;
|
|
38
|
+
delete nextEx.inline_image_uploading;
|
|
39
|
+
delete nextEx.inline_upload_uploaded_count;
|
|
40
|
+
delete nextEx.inline_upload_total_count;
|
|
41
|
+
}
|
|
42
|
+
patch.extra_data = nextEx;
|
|
43
|
+
}
|
|
44
|
+
return patch;
|
|
45
|
+
}
|
|
46
|
+
export function normalizeOutboundAckMessageId(raw) {
|
|
47
|
+
if (raw == null)
|
|
48
|
+
return null;
|
|
49
|
+
if (typeof raw === 'number') {
|
|
50
|
+
return Number.isFinite(raw) && raw > 0 ? raw : null;
|
|
51
|
+
}
|
|
52
|
+
const t = String(raw).trim();
|
|
53
|
+
if (!t || t === '0')
|
|
54
|
+
return null;
|
|
55
|
+
if (/^-?[0-9]+$/.test(t)) {
|
|
56
|
+
const n = Number(t);
|
|
57
|
+
return Number.isFinite(n) && n > 0 ? n : null;
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=imOutboundPatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imOutboundPatch.js","sourceRoot":"","sources":["../../../src/functions/im/imOutboundPatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAC1F,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAA;AAG7E,MAAM,UAAU,kCAAkC,CAChD,EAAuC;IAEvC,MAAM,EAAE,GAAG,EAAE,EAAE,mBAAmB,CAAA;IAClC,OAAO,EAAE,KAAK,kBAAkB,IAAI,EAAE,KAAK,WAAW,CAAA;AACxD,CAAC;AAGD,MAAM,UAAU,0BAA0B,CACxC,IAA0B,EAC1B,QAAmC;IAEnC,MAAM,GAAG,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC5B,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC,MAAM,CAAA;IAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,kCAAkC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAA;AACrF,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,GAAc;IACxD,MAAM,EAAE,GAAG,uBAAuB,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;IAC7C,MAAM,GAAG,GAAG,EAAE,CAAC,mBAAmB,CAAA;IAClC,MAAM,cAAc,GAClB,GAAG,KAAK,kBAAkB;QAC1B,GAAG,KAAK,WAAW;QACnB,CAAC,wBAAwB,CAAC,EAAE,CAAC,IAAI,kCAAkC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC1E,MAAM,gBAAgB,GACpB,EAAE,CAAC,gBAAgB,KAAK,IAAI,IAAI,EAAE,CAAC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,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAA;IAChC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QACnB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC/C,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ImMessage } from '../../../types/im-api';
|
|
2
|
+
export declare function isLocalOutboundDraft(msg: Pick<ImMessage, 'outbound_status'>): boolean;
|
|
3
|
+
export declare function isOutboundFailedForListSummary(m: Pick<ImMessage, 'outbound_status' | 'extra_data'>): boolean;
|
|
4
|
+
export declare function isOutboundSendSuccess(m: Pick<ImMessage, 'outbound_status'>): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getImMessageExtraRecord } from './imMessageExtraRecord.js';
|
|
2
|
+
export function isLocalOutboundDraft(msg) {
|
|
3
|
+
const st = msg.outbound_status;
|
|
4
|
+
return st === 'queued' || st === 'sending' || st === 'failed';
|
|
5
|
+
}
|
|
6
|
+
export function isOutboundFailedForListSummary(m) {
|
|
7
|
+
if (m.outbound_status === 'failed')
|
|
8
|
+
return true;
|
|
9
|
+
const ex = getImMessageExtraRecord(m);
|
|
10
|
+
return ex?.media_upload_status === 'failed';
|
|
11
|
+
}
|
|
12
|
+
export function isOutboundSendSuccess(m) {
|
|
13
|
+
return m.outbound_status === 'success';
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=imOutboundStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imOutboundStatus.js","sourceRoot":"","sources":["../../../src/functions/im/imOutboundStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAGhE,MAAM,UAAU,oBAAoB,CAClC,GAAuC;IAEvC,MAAM,EAAE,GAAG,GAAG,CAAC,eAAe,CAAA;IAC9B,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,QAAQ,CAAA;AAC/D,CAAC;AAGD,MAAM,UAAU,8BAA8B,CAC5C,CAAoD;IAEpD,IAAI,CAAC,CAAC,eAAe,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAC/C,MAAM,EAAE,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAA;IACrC,OAAO,EAAE,EAAE,mBAAmB,KAAK,QAAQ,CAAA;AAC7C,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,CAAqC;IAErC,OAAO,CAAC,CAAC,eAAe,KAAK,SAAS,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let pendingOpenConversationId = null;
|
|
2
|
+
export function setPendingChatConversation(id) {
|
|
3
|
+
const t = id.trim();
|
|
4
|
+
pendingOpenConversationId = t || null;
|
|
5
|
+
}
|
|
6
|
+
export function getPendingChatConversation() {
|
|
7
|
+
return pendingOpenConversationId;
|
|
8
|
+
}
|
|
9
|
+
export function takePendingChatConversation() {
|
|
10
|
+
const v = pendingOpenConversationId;
|
|
11
|
+
pendingOpenConversationId = null;
|
|
12
|
+
return v;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=imPendingOpenConversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imPendingOpenConversation.js","sourceRoot":"","sources":["../../../src/functions/im/imPendingOpenConversation.ts"],"names":[],"mappings":"AAAA,IAAI,yBAAyB,GAAkB,IAAI,CAAA;AAGnD,MAAM,UAAU,0BAA0B,CAAC,EAAU;IACnD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAA;IACnB,yBAAyB,GAAG,CAAC,IAAI,IAAI,CAAA;AACvC,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,yBAAyB,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,MAAM,CAAC,GAAG,yBAAyB,CAAA;IACnC,yBAAyB,GAAG,IAAI,CAAA;IAChC,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function inferImMediaTypeFromPlaceholderSnippet(snippet) {
|
|
2
|
+
const s = snippet.trim();
|
|
3
|
+
if (s === '[图片]' || s.includes('图片'))
|
|
4
|
+
return 'image';
|
|
5
|
+
if (s === '[视频]' || s.includes('视频'))
|
|
6
|
+
return 'video';
|
|
7
|
+
if (s === '[文件]' || s.includes('文件'))
|
|
8
|
+
return 'file';
|
|
9
|
+
if (s === '[语音]' || s.includes('语音'))
|
|
10
|
+
return 'voice';
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=imPlaceholderSnippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imPlaceholderSnippet.js","sourceRoot":"","sources":["../../../src/functions/im/imPlaceholderSnippet.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,sCAAsC,CACpD,OAAe;IAEf,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAA;IACxB,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAA;IACnD,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,OAAO,CAAA;IACpD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AiAgentReplyFormat, AiAttachmentPayloadFormat } from '../../../types/ai-agent';
|
|
2
|
+
import type { AgentInputContentPart } from '../../../types/agent-input-content';
|
|
3
|
+
import type { ImMessage } from '../../../types/im-api';
|
|
4
|
+
import { imPersistedMessageTypeForReplyFormat } from '../ai/normalizeAiAgentReplyFormat';
|
|
5
|
+
export { imPersistedMessageTypeForReplyFormat };
|
|
6
|
+
export declare function imMessageToAgentUserContent(m: ImMessage, format: AiAttachmentPayloadFormat, recipientUserId: string): string | AgentInputContentPart[];
|
|
7
|
+
export declare function agentUserContentCharEstimate(c: string | AgentInputContentPart[]): number;
|
|
8
|
+
export type { AiAgentReplyFormat, AiAttachmentPayloadFormat, AgentInputContentPart };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { imPersistedMessageTypeForReplyFormat } from '../ai/normalizeAiAgentReplyFormat.js';
|
|
2
|
+
import { imInlineAttachmentsForAgent, imMessageUserTextPlainForAgent, } from './imProxyAgentMessage.js';
|
|
3
|
+
export { imPersistedMessageTypeForReplyFormat };
|
|
4
|
+
function attachmentBinToOpenAiPart(b) {
|
|
5
|
+
const mime = b.mimeType.trim().toLowerCase();
|
|
6
|
+
if (mime.startsWith('image/')) {
|
|
7
|
+
return { type: 'image_url', image_url: { url: b.url } };
|
|
8
|
+
}
|
|
9
|
+
if (mime.startsWith('video/')) {
|
|
10
|
+
return { type: 'video_url', video_url: { url: b.url } };
|
|
11
|
+
}
|
|
12
|
+
return { type: 'file_url', file_url: { url: b.url } };
|
|
13
|
+
}
|
|
14
|
+
export function imMessageToAgentUserContent(m, format, recipientUserId) {
|
|
15
|
+
const text = imMessageUserTextPlainForAgent(m, recipientUserId);
|
|
16
|
+
const bins = imInlineAttachmentsForAgent(m);
|
|
17
|
+
if (bins.length === 0)
|
|
18
|
+
return text;
|
|
19
|
+
const parts = [];
|
|
20
|
+
if (text.length > 0)
|
|
21
|
+
parts.push({ type: 'text', text });
|
|
22
|
+
for (const b of bins) {
|
|
23
|
+
if (format === 'openai') {
|
|
24
|
+
parts.push(attachmentBinToOpenAiPart(b));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
parts.push({
|
|
28
|
+
type: 'binary',
|
|
29
|
+
mimeType: b.mimeType,
|
|
30
|
+
url: b.url,
|
|
31
|
+
...(b.filename ? { filename: b.filename } : {}),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (parts.length === 1 && parts[0].type === 'text')
|
|
36
|
+
return parts[0].text;
|
|
37
|
+
return parts;
|
|
38
|
+
}
|
|
39
|
+
export function agentUserContentCharEstimate(c) {
|
|
40
|
+
if (typeof c === 'string')
|
|
41
|
+
return c.length;
|
|
42
|
+
return c.reduce((n, p) => {
|
|
43
|
+
if (p.type === 'text')
|
|
44
|
+
return n + p.text.length;
|
|
45
|
+
if (p.type === 'binary')
|
|
46
|
+
return n + p.url.length;
|
|
47
|
+
if (p.type === 'image_url')
|
|
48
|
+
return n + p.image_url.url.length;
|
|
49
|
+
if (p.type === 'video_url')
|
|
50
|
+
return n + p.video_url.url.length;
|
|
51
|
+
if (p.type === 'file_url')
|
|
52
|
+
return n + p.file_url.url.length;
|
|
53
|
+
return n;
|
|
54
|
+
}, 0);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=imProxyAgentContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imProxyAgentContent.js","sourceRoot":"","sources":["../../../src/functions/im/imProxyAgentContent.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oCAAoC,EAAE,MAAM,mCAAmC,CAAA;AACxF,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,oCAAoC,EAAE,CAAA;AAE/C,SAAS,yBAAyB,CAAC,CAIlC;IACC,MAAM,IAAI,GAAG,CAA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 +1,16 @@
|
|
|
1
|
+
import type { ImMessage } from '../../../types/im-api';
|
|
2
|
+
export declare function imMessageDiagPayload(m: ImMessage | null | undefined): {
|
|
3
|
+
present: false;
|
|
4
|
+
id?: undefined;
|
|
5
|
+
sender_id?: undefined;
|
|
6
|
+
conversation_id?: undefined;
|
|
7
|
+
server_sent_at?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
present: true;
|
|
10
|
+
id: string | null;
|
|
11
|
+
sender_id: string;
|
|
12
|
+
conversation_id: string;
|
|
13
|
+
server_sent_at: string | null;
|
|
14
|
+
};
|
|
15
|
+
export declare function functionToolNamesFromResolvedTools(resolved: unknown[]): Set<string>;
|
|
16
|
+
export declare function summarizeAgentRunError(chunk: unknown): string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export function imMessageDiagPayload(m) {
|
|
2
|
+
if (!m)
|
|
3
|
+
return { present: false };
|
|
4
|
+
return {
|
|
5
|
+
present: true,
|
|
6
|
+
id: m.id != null ? String(m.id) : null,
|
|
7
|
+
sender_id: m.sender_id,
|
|
8
|
+
conversation_id: m.conversation_id,
|
|
9
|
+
server_sent_at: m.server_sent_at ?? null,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function functionToolNamesFromResolvedTools(resolved) {
|
|
13
|
+
const names = new Set();
|
|
14
|
+
for (const t of resolved) {
|
|
15
|
+
if (!t || typeof t !== 'object' || Array.isArray(t))
|
|
16
|
+
continue;
|
|
17
|
+
const o = t;
|
|
18
|
+
if (o['type'] !== 'function')
|
|
19
|
+
continue;
|
|
20
|
+
const fn = o['function'];
|
|
21
|
+
if (!fn || typeof fn !== 'object' || Array.isArray(fn))
|
|
22
|
+
continue;
|
|
23
|
+
const n = String(fn['name'] ?? '').trim();
|
|
24
|
+
if (n)
|
|
25
|
+
names.add(n);
|
|
26
|
+
}
|
|
27
|
+
return names;
|
|
28
|
+
}
|
|
29
|
+
export function summarizeAgentRunError(chunk) {
|
|
30
|
+
if (chunk == null)
|
|
31
|
+
return '';
|
|
32
|
+
if (typeof chunk === 'string')
|
|
33
|
+
return chunk.slice(0, 2000);
|
|
34
|
+
if (typeof chunk !== 'object' || Array.isArray(chunk)) {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.stringify(chunk).slice(0, 2000);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return String(chunk);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const o = chunk;
|
|
43
|
+
const err = o.error ?? o.err ?? o.reason;
|
|
44
|
+
const msg = o.message ?? o.msg ?? o.errorMessage;
|
|
45
|
+
const parts = [];
|
|
46
|
+
if (typeof msg === 'string' && msg.trim())
|
|
47
|
+
parts.push(msg.trim());
|
|
48
|
+
if (typeof err === 'string' && err.trim())
|
|
49
|
+
parts.push(err.trim());
|
|
50
|
+
else if (err != null && typeof err === 'object') {
|
|
51
|
+
try {
|
|
52
|
+
parts.push(JSON.stringify(err).slice(0, 1500));
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
parts.push(String(err));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (typeof o.code === 'string' || typeof o.code === 'number') {
|
|
59
|
+
parts.push(`code=${String(o.code)}`);
|
|
60
|
+
}
|
|
61
|
+
if (parts.length > 0)
|
|
62
|
+
return parts.join(' | ');
|
|
63
|
+
try {
|
|
64
|
+
return JSON.stringify(o).slice(0, 2000);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return String(chunk);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=imProxyAgentDiagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imProxyAgentDiagnostics.js","sourceRoot":"","sources":["../../../src/functions/im/imProxyAgentDiagnostics.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAAC,CAA+B;IAClE,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAc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AAO,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC9C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ImMessage } from '../../../types/im-api';
|
|
2
|
+
export declare function imPersistedIdsEqual(a: unknown, b: unknown): boolean;
|
|
3
|
+
export declare function imMessageTypeTriggersProxy(t: ImMessage['type']): t is 'text' | 'markdown';
|
|
4
|
+
export declare function extractAtUidMentions(content: string): string[];
|
|
5
|
+
export type ImProxyConversationSnap = {
|
|
6
|
+
mode: 'direct' | 'multi';
|
|
7
|
+
members: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function collectUserIdsForProxyAccountLookup(message: Pick<ImMessage, 'sender_id' | 'content'>, snap: ImProxyConversationSnap, projectLeadUserId?: string | null): string[];
|
|
10
|
+
export declare function pickLlmProxyRecipientUserId(message: Pick<ImMessage, 'sender_id' | 'content'>, snap: ImProxyConversationSnap, kinds: Map<string, 'person' | 'ai_agent'>, options?: {
|
|
11
|
+
projectLeadUserId?: string | null;
|
|
12
|
+
}): string | null;
|
|
13
|
+
export declare function normalizeImMessagePlainContent(content: string): string;
|
|
14
|
+
export declare function imMessageUserTextPlain(m: ImMessage): string;
|
|
15
|
+
export declare function imMessageUserTextPlainForAgent(m: ImMessage, _recipientUserId: string): string;
|
|
16
|
+
export declare function imInlineAttachmentsForAgent(m: ImMessage): Array<{
|
|
17
|
+
url: string;
|
|
18
|
+
mimeType: string;
|
|
19
|
+
filename?: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function imMessageHasAgentPayload(m: ImMessage): boolean;
|
|
22
|
+
export declare function isAbortedModelAgentReplyForTrigger(message: ImMessage, triggerMessageId: string | number, triggerSenderId: string): boolean;
|
|
23
|
+
export declare function findAbortedModelAgentRepliesForTrigger(sortedAsc: ImMessage[], triggerMessageId: string | number, triggerSenderId: string): ImMessage[];
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { extractImRichMentionUserIds } from './imRichContentHtml.js';
|
|
2
|
+
export function imPersistedIdsEqual(a, b) {
|
|
3
|
+
if (Object.is(a, b))
|
|
4
|
+
return true;
|
|
5
|
+
if (a == null || b == null)
|
|
6
|
+
return false;
|
|
7
|
+
return String(a) === String(b);
|
|
8
|
+
}
|
|
9
|
+
export function imMessageTypeTriggersProxy(t) {
|
|
10
|
+
return t === 'text' || t === 'markdown';
|
|
11
|
+
}
|
|
12
|
+
export function extractAtUidMentions(content) {
|
|
13
|
+
return extractImRichMentionUserIds(content);
|
|
14
|
+
}
|
|
15
|
+
export function collectUserIdsForProxyAccountLookup(message, snap, projectLeadUserId) {
|
|
16
|
+
const out = new Set();
|
|
17
|
+
const sid = String(message.sender_id ?? '').trim();
|
|
18
|
+
if (sid)
|
|
19
|
+
out.add(sid);
|
|
20
|
+
if (snap.mode === 'direct') {
|
|
21
|
+
for (const m of snap.members) {
|
|
22
|
+
const x = String(m ?? '').trim();
|
|
23
|
+
if (x)
|
|
24
|
+
out.add(x);
|
|
25
|
+
}
|
|
26
|
+
return [...out];
|
|
27
|
+
}
|
|
28
|
+
if (snap.mode === 'multi') {
|
|
29
|
+
const memberSet = new Set(snap.members.map((m) => String(m ?? '').trim()).filter(Boolean));
|
|
30
|
+
for (const uid of extractAtUidMentions(message.content)) {
|
|
31
|
+
const u = String(uid ?? '').trim();
|
|
32
|
+
if (u && memberSet.has(u))
|
|
33
|
+
out.add(u);
|
|
34
|
+
}
|
|
35
|
+
const lead = String(projectLeadUserId ?? '').trim();
|
|
36
|
+
if (lead && memberSet.has(lead))
|
|
37
|
+
out.add(lead);
|
|
38
|
+
return [...out];
|
|
39
|
+
}
|
|
40
|
+
return [...out];
|
|
41
|
+
}
|
|
42
|
+
export function pickLlmProxyRecipientUserId(message, snap, kinds, options) {
|
|
43
|
+
if (snap.mode === 'direct') {
|
|
44
|
+
const others = snap.members.filter((m) => m !== message.sender_id);
|
|
45
|
+
if (others.length !== 1)
|
|
46
|
+
return null;
|
|
47
|
+
const u = String(others[0] ?? '').trim();
|
|
48
|
+
if (!u)
|
|
49
|
+
return null;
|
|
50
|
+
return kinds.get(u) === 'ai_agent' ? u : null;
|
|
51
|
+
}
|
|
52
|
+
if (snap.mode === 'multi') {
|
|
53
|
+
const memberSet = new Set(snap.members);
|
|
54
|
+
for (const uid of extractAtUidMentions(message.content)) {
|
|
55
|
+
if (!memberSet.has(uid))
|
|
56
|
+
continue;
|
|
57
|
+
if (kinds.get(uid) === 'ai_agent')
|
|
58
|
+
return uid;
|
|
59
|
+
}
|
|
60
|
+
const lead = String(options?.projectLeadUserId ?? '').trim();
|
|
61
|
+
if (lead && memberSet.has(lead) && kinds.get(lead) === 'ai_agent') {
|
|
62
|
+
return lead;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
export function normalizeImMessagePlainContent(content) {
|
|
69
|
+
return String(content ?? '')
|
|
70
|
+
.replace(/\u200b/g, '')
|
|
71
|
+
.trim();
|
|
72
|
+
}
|
|
73
|
+
export function imMessageUserTextPlain(m) {
|
|
74
|
+
return normalizeImMessagePlainContent(String(m.content ?? ''));
|
|
75
|
+
}
|
|
76
|
+
export function imMessageUserTextPlainForAgent(m, _recipientUserId) {
|
|
77
|
+
void _recipientUserId;
|
|
78
|
+
return normalizeImMessagePlainContent(String(m.content ?? ''));
|
|
79
|
+
}
|
|
80
|
+
export function imInlineAttachmentsForAgent(m) {
|
|
81
|
+
const ex = m.extra_data;
|
|
82
|
+
if (!ex || typeof ex !== 'object' || Array.isArray(ex))
|
|
83
|
+
return [];
|
|
84
|
+
const raw = ex.attachments;
|
|
85
|
+
if (!Array.isArray(raw))
|
|
86
|
+
return [];
|
|
87
|
+
const out = [];
|
|
88
|
+
for (const item of raw) {
|
|
89
|
+
if (!item || typeof item !== 'object')
|
|
90
|
+
continue;
|
|
91
|
+
const rec = item;
|
|
92
|
+
const url = typeof rec.url === 'string' ? rec.url.trim() : '';
|
|
93
|
+
if (!url)
|
|
94
|
+
continue;
|
|
95
|
+
const mime = typeof rec.mimeType === 'string' && rec.mimeType.trim()
|
|
96
|
+
? rec.mimeType.trim()
|
|
97
|
+
: typeof rec.type === 'string' && rec.type.trim()
|
|
98
|
+
? rec.type.trim()
|
|
99
|
+
: 'application/octet-stream';
|
|
100
|
+
const name = typeof rec.name === 'string' ? rec.name.trim() : '';
|
|
101
|
+
out.push({ url, mimeType: mime, ...(name ? { filename: name } : {}) });
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
export function imMessageHasAgentPayload(m) {
|
|
106
|
+
if (imInlineAttachmentsForAgent(m).length > 0)
|
|
107
|
+
return true;
|
|
108
|
+
const raw = String(m.content ?? '');
|
|
109
|
+
if (extractImRichMentionUserIds(raw).length > 0)
|
|
110
|
+
return true;
|
|
111
|
+
if (imMessageUserTextPlain(m).length > 0)
|
|
112
|
+
return true;
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
export function isAbortedModelAgentReplyForTrigger(message, triggerMessageId, triggerSenderId) {
|
|
116
|
+
if (message.sender_id === triggerSenderId)
|
|
117
|
+
return false;
|
|
118
|
+
const ex = message.extra_data;
|
|
119
|
+
const ar = ex?.ai_reply;
|
|
120
|
+
if (ar?.state !== 'aborted' || ar?.abort_source !== 'model')
|
|
121
|
+
return false;
|
|
122
|
+
return imPersistedIdsEqual(ar.reply_to_message_id, triggerMessageId);
|
|
123
|
+
}
|
|
124
|
+
export function findAbortedModelAgentRepliesForTrigger(sortedAsc, triggerMessageId, triggerSenderId) {
|
|
125
|
+
const n = sortedAsc.length;
|
|
126
|
+
let triggerIdx = -1;
|
|
127
|
+
for (let i = 0; i < n; i++) {
|
|
128
|
+
if (imPersistedIdsEqual(sortedAsc[i].id, triggerMessageId)) {
|
|
129
|
+
triggerIdx = i;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (triggerIdx < 0)
|
|
134
|
+
return [];
|
|
135
|
+
const out = [];
|
|
136
|
+
for (let j = triggerIdx + 1; j < n; j++) {
|
|
137
|
+
const m = sortedAsc[j];
|
|
138
|
+
if (m.sender_id === triggerSenderId)
|
|
139
|
+
break;
|
|
140
|
+
if (isAbortedModelAgentReplyForTrigger(m, triggerMessageId, triggerSenderId)) {
|
|
141
|
+
out.push(m);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=imProxyAgentMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imProxyAgentMessage.js","sourceRoot":"","sources":["../../../src/functions/im/imProxyAgentMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AAEjE,MAAM,UAAU,mBAAmB,CAAC,CAAU,EAAE,CAAU;IACxD,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAChC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,KAAK,CAAA;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAChC,CAAC;AAGD,MAAM,UAAU,0BAA0B,CACxC,CAAoB;IAEpB,OAAO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AA;IAE7B,MAAM,GAAG,GAAgB,EAAE,CAAA;IAC3B,KAAK,IAAI,CAAC,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAE,CAAA;QACvB,IAAI,CAAC,CAAC,SAAS,KAAK,eAAe;YAAE,MAAK;QAC1C,IAAI,kCAAkC,CAAC,CAAC,EAAE,gBAAgB,EAAE,eAAe,CAAC,EAAE,CAAC;YAC7E,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACb,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const IM_PROXY_SELF_IDENTITY_PLACEHOLDER = "{{IM_USER_ID}}";
|
|
2
|
+
export declare const IM_PROXY_SELF_IDENTITY_CONVERSATION_ID_PLACEHOLDER = "{{IM_CONVERSATION_ID}}";
|
|
3
|
+
export declare const IM_PROXY_SELF_IDENTITY_CODE_PROJECT_ID_PLACEHOLDER = "{{IM_CODE_PROJECT_ID}}";
|
|
4
|
+
export declare const IM_PROXY_SELF_IDENTITY_CODE_PROJECT_LOCAL_ROOT_PLACEHOLDER = "{{IM_CODE_PROJECT_LOCAL_ROOT}}";
|
|
5
|
+
export type ImSessionPresetLlmContext = {
|
|
6
|
+
recipientUserId: string;
|
|
7
|
+
conversationId: string;
|
|
8
|
+
};
|
|
9
|
+
export interface ImProxySelfIdentityTemplateContext extends ImSessionPresetLlmContext {
|
|
10
|
+
codeProjectId?: string;
|
|
11
|
+
codeProjectLocalRoot?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildImProxySelfIdentityFromTemplate(template: string, ctx: ImProxySelfIdentityTemplateContext): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const IM_PROXY_SELF_IDENTITY_PLACEHOLDER = '{{IM_USER_ID}}';
|
|
2
|
+
export const IM_PROXY_SELF_IDENTITY_CONVERSATION_ID_PLACEHOLDER = '{{IM_CONVERSATION_ID}}';
|
|
3
|
+
export const IM_PROXY_SELF_IDENTITY_CODE_PROJECT_ID_PLACEHOLDER = '{{IM_CODE_PROJECT_ID}}';
|
|
4
|
+
export const IM_PROXY_SELF_IDENTITY_CODE_PROJECT_LOCAL_ROOT_PLACEHOLDER = '{{IM_CODE_PROJECT_LOCAL_ROOT}}';
|
|
5
|
+
export function buildImProxySelfIdentityFromTemplate(template, ctx) {
|
|
6
|
+
const t = String(template ?? '').trim();
|
|
7
|
+
if (!t)
|
|
8
|
+
return '';
|
|
9
|
+
const id = String(ctx.recipientUserId ?? '').trim();
|
|
10
|
+
const conv = String(ctx.conversationId ?? '').trim();
|
|
11
|
+
const proj = String(ctx.codeProjectId ?? '').trim();
|
|
12
|
+
const root = String(ctx.codeProjectLocalRoot ?? '').trim();
|
|
13
|
+
const needsUser = t.includes(IM_PROXY_SELF_IDENTITY_PLACEHOLDER);
|
|
14
|
+
const needsConv = t.includes(IM_PROXY_SELF_IDENTITY_CONVERSATION_ID_PLACEHOLDER);
|
|
15
|
+
const needsProj = t.includes(IM_PROXY_SELF_IDENTITY_CODE_PROJECT_ID_PLACEHOLDER);
|
|
16
|
+
const needsProjRoot = t.includes(IM_PROXY_SELF_IDENTITY_CODE_PROJECT_LOCAL_ROOT_PLACEHOLDER);
|
|
17
|
+
if (needsUser && !id)
|
|
18
|
+
return '';
|
|
19
|
+
if (needsConv && !conv)
|
|
20
|
+
return '';
|
|
21
|
+
if (needsProj && !proj)
|
|
22
|
+
return '';
|
|
23
|
+
if (needsProjRoot && !root)
|
|
24
|
+
return '';
|
|
25
|
+
let out = t.split(IM_PROXY_SELF_IDENTITY_PLACEHOLDER).join(id);
|
|
26
|
+
out = out.split(IM_PROXY_SELF_IDENTITY_CONVERSATION_ID_PLACEHOLDER).join(conv);
|
|
27
|
+
out = out.split(IM_PROXY_SELF_IDENTITY_CODE_PROJECT_ID_PLACEHOLDER).join(proj);
|
|
28
|
+
out = out
|
|
29
|
+
.split(IM_PROXY_SELF_IDENTITY_CODE_PROJECT_LOCAL_ROOT_PLACEHOLDER)
|
|
30
|
+
.join(root);
|
|
31
|
+
out = out.trim();
|
|
32
|
+
return out || '';
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=imProxySelfIdentityTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imProxySelfIdentityTemplate.js","sourceRoot":"","sources":["../../../src/functions/im/imProxySelfIdentityTemplate.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,kCAAkC,GAAG,gBAAgB,CAAA;AAGlE,MAAM,CAAC,MAAM,kDAAkD,GAC7D,wBAAwB,CAAA;AAG1B,MAAM,CAAC,MAAM,kDAAkD,GAC7D,wBAAwB,CAAA;AAG1B,MAAM,CAAC,MAAM,0DAA0D,GACrE,gCAAgC,CAAA;AAiBlC,MAAM,UAAU,oCAAoC,CAClD,QAAgB,EAChB,GAAuC;IAEvC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACvC,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACjB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACnD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACnD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1D,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAA;IAChE,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC,CAAA;IAChF,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC,CAAA;IAChF,MAAM,aAAa,GAAG,CAAC,CAAC,QAAQ,CAC9B,0DAA0D,CAC3D,CAAA;IACD,IAAI,SAAS,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAA;IAC/B,IAAI,SAAS,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IACjC,IAAI,SAAS,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IACjC,IAAI,aAAa,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IACrC,IAAI,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC9D,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9E,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9E,GAAG,GAAG,GAAG;SACN,KAAK,CAAC,0DAA0D,CAAC;SACjE,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAChB,OAAO,GAAG,IAAI,EAAE,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChatMessage, ChatMessageQuotePreview } from '../../../types/im-chat';
|
|
2
|
+
export type ImMentionLabelResolver = (userId: string) => string;
|
|
3
|
+
export declare function materializeImQuotePreviewText(content: string, resolveLabel?: ImMentionLabelResolver): string;
|
|
4
|
+
export declare const FORWARD_BUNDLE_QUOTE_PREVIEW_EXTRA_KEY = "quote_preview";
|
|
5
|
+
export declare function materializeQuotePreview(preview: ChatMessageQuotePreview, resolveMentionLabel?: ImMentionLabelResolver): ChatMessageQuotePreview;
|
|
6
|
+
export declare function parseQuotePreviewFromExtra(extra: Record<string, unknown> | undefined, resolveMentionLabel?: ImMentionLabelResolver): ChatMessageQuotePreview | undefined;
|
|
7
|
+
export declare function quotePreviewToExtraRecord(preview: ChatMessageQuotePreview): Record<string, unknown>;
|
|
8
|
+
export declare function mergeReplyFieldsIntoForwardExtra(extra: Record<string, unknown> | undefined, m: ChatMessage, resolveMentionLabel?: ImMentionLabelResolver): Record<string, unknown> | undefined;
|
|
9
|
+
export declare function buildReplyToExtraData(messageId: string | number): Record<string, unknown>;
|
|
10
|
+
export declare function buildQuoteSnippetFromChatMessage(m: ChatMessage, resolveMentionLabel?: ImMentionLabelResolver): string;
|
|
11
|
+
export declare function buildQuotePreviewFromChatMessage(m: ChatMessage, resolveMentionLabel?: ImMentionLabelResolver): ChatMessageQuotePreview;
|
|
12
|
+
export declare function resolveQuotePreviewForMessage(replyToMessageId: string, thread: readonly ChatMessage[], resolveMentionLabel?: ImMentionLabelResolver): ChatMessageQuotePreview;
|
|
13
|
+
export declare function attachQuotePreviewsToMessages(messages: readonly ChatMessage[], resolveMentionLabel?: ImMentionLabelResolver): ChatMessage[];
|