@lowdefy/blocks-native 0.0.0-stage → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +9 -2
- package/dist/actions/AddCalendarEvent/AddCalendarEvent.js +31 -0
- package/dist/actions/AddCalendarEvent/schema.js +55 -0
- package/dist/actions/AddContact/AddContact.js +24 -0
- package/dist/actions/AddContact/schema.js +49 -0
- package/dist/actions/CancelNotification/CancelNotification.js +23 -0
- package/dist/actions/CancelNotification/schema.js +31 -0
- package/dist/actions/DiscardQueuedRequest/DiscardQueuedRequest.js +23 -0
- package/dist/actions/DiscardQueuedRequest/schema.js +31 -0
- package/dist/actions/GetCalendarEvents/GetCalendarEvents.js +32 -0
- package/dist/actions/GetCalendarEvents/schema.js +35 -0
- package/dist/actions/GetRequestQueue/GetRequestQueue.js +24 -0
- package/dist/actions/GetRequestQueue/schema.js +22 -0
- package/dist/actions/Haptic/Haptic.js +38 -0
- package/dist/actions/Haptic/schema.js +37 -0
- package/dist/actions/KeepAwake/KeepAwake.js +23 -0
- package/dist/actions/KeepAwake/schema.js +28 -0
- package/dist/actions/PickContact/PickContact.js +24 -0
- package/dist/actions/PickContact/schema.js +22 -0
- package/dist/actions/PickFile/PickFile.js +32 -0
- package/dist/actions/PickFile/schema.js +58 -0
- package/dist/actions/PickImage/PickImage.js +32 -0
- package/dist/actions/PickImage/schema.js +76 -0
- package/dist/actions/ReadNfc/ReadNfc.js +24 -0
- package/dist/actions/ReadNfc/schema.js +27 -0
- package/dist/actions/RefreshWidgets/RefreshWidgets.js +24 -0
- package/dist/actions/RefreshWidgets/schema.js +22 -0
- package/dist/actions/RequestNotificationPermission/RequestNotificationPermission.js +24 -0
- package/dist/actions/RequestNotificationPermission/schema.js +22 -0
- package/dist/actions/RetryRequestQueue/RetryRequestQueue.js +24 -0
- package/dist/actions/RetryRequestQueue/schema.js +27 -0
- package/dist/actions/ScanCode/ScanCode.js +24 -0
- package/dist/actions/ScanCode/schema.js +54 -0
- package/dist/actions/ScanDocument/ScanDocument.js +32 -0
- package/dist/actions/ScanDocument/schema.js +57 -0
- package/dist/actions/ScheduleNotification/ScheduleNotification.js +27 -0
- package/dist/actions/ScheduleNotification/schema.js +67 -0
- package/dist/actions/SetBadgeCount/SetBadgeCount.js +27 -0
- package/dist/actions/SetBadgeCount/schema.js +31 -0
- package/dist/actions/SetBrightness/SetBrightness.js +24 -0
- package/dist/actions/SetBrightness/schema.js +33 -0
- package/dist/actions/Share/Share.js +50 -0
- package/dist/actions/Share/schema.js +51 -0
- package/dist/actions/Speak/Speak.js +27 -0
- package/dist/actions/Speak/schema.js +44 -0
- package/dist/actions/StartGeofencing/StartGeofencing.js +29 -0
- package/dist/actions/StartGeofencing/schema.js +63 -0
- package/dist/actions/StartLocationTracking/StartLocationTracking.js +29 -0
- package/dist/actions/StartLocationTracking/schema.js +59 -0
- package/dist/actions/StartRecording/StartRecording.js +23 -0
- package/dist/actions/StartRecording/schema.js +32 -0
- package/dist/actions/StopGeofencing/StopGeofencing.js +23 -0
- package/dist/actions/StopGeofencing/schema.js +22 -0
- package/dist/actions/StopLocationTracking/StopLocationTracking.js +23 -0
- package/dist/actions/StopLocationTracking/schema.js +22 -0
- package/dist/actions/StopRecording/StopRecording.js +37 -0
- package/dist/actions/StopRecording/schema.js +46 -0
- package/dist/actions/StopSpeaking/StopSpeaking.js +23 -0
- package/dist/actions/StopSpeaking/schema.js +22 -0
- package/dist/actions/TakePhoto/TakePhoto.js +31 -0
- package/dist/actions/TakePhoto/schema.js +67 -0
- package/dist/actions/WriteNfc/WriteNfc.js +28 -0
- package/dist/actions/WriteNfc/schema.js +61 -0
- package/dist/actions/uploadFiles.js +51 -0
- package/dist/actions.js +47 -0
- package/dist/blocks/ActivityTimeline/ActivityTimeline.js +507 -0
- package/dist/blocks/ActivityTimeline/CommentBody.js +176 -0
- package/dist/blocks/ActivityTimeline/CommentItem.js +302 -0
- package/dist/blocks/ActivityTimeline/EditBox.js +143 -0
- package/dist/blocks/ActivityTimeline/LineText.js +71 -0
- package/dist/blocks/ActivityTimeline/RailIcon.js +41 -0
- package/dist/blocks/ActivityTimeline/RailRow.js +74 -0
- package/dist/blocks/ActivityTimeline/ReactionPicker.js +68 -0
- package/dist/blocks/ActivityTimeline/ReactionPills.js +112 -0
- package/dist/blocks/ActivityTimeline/ThreadCard.js +160 -0
- package/dist/blocks/ActivityTimeline/TimelineMarkdownRenderer.js +48 -0
- package/dist/blocks/ActivityTimeline/buildTimelineRows.js +194 -0
- package/dist/blocks/ActivityTimeline/describeEvent.js +61 -0
- package/dist/blocks/ActivityTimeline/describeGap.js +71 -0
- package/dist/blocks/ActivityTimeline/fillTemplate.js +84 -0
- package/dist/blocks/ActivityTimeline/fillText.js +38 -0
- package/dist/blocks/ActivityTimeline/formatRelativeTime.js +68 -0
- package/dist/blocks/ActivityTimeline/getActor.js +41 -0
- package/dist/blocks/ActivityTimeline/getCommentMenuActions.js +85 -0
- package/dist/blocks/ActivityTimeline/getCommentView.js +72 -0
- package/dist/blocks/ActivityTimeline/getTimelineColors.js +71 -0
- package/dist/blocks/ActivityTimeline/getToneColor.js +49 -0
- package/dist/blocks/ActivityTimeline/getVisibleReplies.js +36 -0
- package/dist/blocks/ActivityTimeline/isThreadShown.js +28 -0
- package/dist/blocks/ActivityTimeline/joinList.js +21 -0
- package/dist/blocks/ActivityTimeline/meta.js +320 -0
- package/dist/blocks/ActivityTimeline/parseTimelineHref.js +43 -0
- package/dist/blocks/ActivityTimeline/selectEventRule.js +69 -0
- package/dist/blocks/ActivityTimeline/summariseEvents.js +51 -0
- package/dist/blocks/ActivityTimeline/toPlainText.js +32 -0
- package/dist/blocks/ActivityTimeline/toTime.js +36 -0
- package/dist/blocks/ActivityTimeline/toTimelineMarkdown.js +57 -0
- package/dist/blocks/ActivityTimeline/toggleReaction.js +74 -0
- package/dist/blocks/ActivityTimeline/useNow.js +24 -0
- package/dist/blocks/AgentChat/AgentChat.js +726 -0
- package/dist/blocks/AgentChat/AssistantMessage.js +243 -0
- package/dist/blocks/AgentChat/ChatComposer.js +401 -0
- package/dist/blocks/AgentChat/ChatError.js +129 -0
- package/dist/blocks/AgentChat/ChatSkeleton.js +97 -0
- package/dist/blocks/AgentChat/ReasoningDisclosure.js +125 -0
- package/dist/blocks/AgentChat/ThinkingIndicator.js +103 -0
- package/dist/blocks/AgentChat/ThreadsSheet.js +347 -0
- package/dist/blocks/AgentChat/ToolApprovalCard.js +190 -0
- package/dist/blocks/AgentChat/ToolCallRow.js +187 -0
- package/dist/blocks/AgentChat/ToolDetail.js +137 -0
- package/dist/blocks/AgentChat/UserMessage.js +84 -0
- package/dist/blocks/AgentChat/WelcomeView.js +100 -0
- package/dist/blocks/AgentChat/createAgentTransport.js +74 -0
- package/dist/blocks/AgentChat/describeToolPart.js +133 -0
- package/dist/blocks/AgentChat/getChatSeed.js +44 -0
- package/dist/blocks/AgentChat/getFirstExchange.js +43 -0
- package/dist/blocks/AgentChat/getMessageSegments.js +73 -0
- package/dist/blocks/AgentChat/getMessageText.js +25 -0
- package/dist/blocks/AgentChat/getPageStateUpdates.js +47 -0
- package/dist/blocks/AgentChat/getProvisionalTitle.js +32 -0
- package/dist/blocks/AgentChat/getReadableRows.js +157 -0
- package/dist/blocks/AgentChat/getThreadEndpoints.js +54 -0
- package/dist/blocks/AgentChat/getToolIcon.js +110 -0
- package/dist/blocks/AgentChat/humanizeToolName.js +30 -0
- package/dist/blocks/AgentChat/messageParts.js +86 -0
- package/dist/blocks/AgentChat/meta.js +530 -0
- package/dist/blocks/AgentChat/mintConversationId.js +29 -0
- package/dist/blocks/AgentChat/replayableMessages.js +62 -0
- package/dist/blocks/AgentChat/showMessageMenu.js +49 -0
- package/dist/blocks/AgentChat/summarizeToolInput.js +36 -0
- package/dist/blocks/AgentChat/summarizeToolOutput.js +49 -0
- package/dist/blocks/AgentChat/useAgentEvents.js +218 -0
- package/dist/blocks/AgentChat/useChatDictation.js +151 -0
- package/dist/blocks/AgentChat/useChatThreads.js +450 -0
- package/dist/blocks/AgentChat/useFollowScroll.js +80 -0
- package/dist/blocks/AgentChat/useThinkingMessage.js +77 -0
- package/dist/blocks/Alert/Alert.js +167 -0
- package/dist/blocks/Alert/meta.js +200 -0
- package/dist/blocks/Avatar/Avatar.js +51 -0
- package/dist/blocks/Avatar/AvatarCircle.js +114 -0
- package/dist/blocks/Avatar/AvatarPhoto.js +68 -0
- package/dist/blocks/Avatar/AvatarStack.js +89 -0
- package/dist/blocks/Avatar/getAvatarColor.js +84 -0
- package/dist/blocks/Avatar/getAvatarImage.js +97 -0
- package/dist/blocks/Avatar/getInitials.js +51 -0
- package/dist/blocks/Avatar/meta.js +57 -0
- package/dist/blocks/Box/Box.js +118 -0
- package/dist/blocks/Box/getRubberBand.js +29 -0
- package/dist/blocks/Box/getSwipeDirection.js +45 -0
- package/dist/blocks/Box/isSwipeGesture.js +41 -0
- package/dist/blocks/Box/meta.js +46 -0
- package/dist/blocks/Box/useSwipeGesture.js +113 -0
- package/dist/blocks/Button/Button.js +136 -0
- package/dist/blocks/Button/getButtonColors.js +216 -0
- package/dist/blocks/Button/meta.js +137 -0
- package/dist/blocks/Card/Card.js +185 -0
- package/dist/blocks/Card/meta.js +203 -0
- package/dist/blocks/ChipSelector/Chip.js +178 -0
- package/dist/blocks/ChipSelector/ChipSelector.js +313 -0
- package/dist/blocks/ChipSelector/EdgeFade.js +68 -0
- package/dist/blocks/ChipSelector/getChipColors.js +88 -0
- package/dist/blocks/ChipSelector/getFadeRanges.js +55 -0
- package/dist/blocks/ChipSelector/getOverscrollSwipe.js +44 -0
- package/dist/blocks/ChipSelector/getScrollTarget.js +41 -0
- package/dist/blocks/ChipSelector/meta.js +156 -0
- package/dist/blocks/Composer/Composer.js +511 -0
- package/dist/blocks/Composer/MentionTextInput.js +91 -0
- package/dist/blocks/Composer/SuggestionList.js +165 -0
- package/dist/blocks/Composer/applyDisplayEdit.js +81 -0
- package/dist/blocks/Composer/convertSpokenMentions.js +234 -0
- package/dist/blocks/Composer/createMentionPattern.js +40 -0
- package/dist/blocks/Composer/findTrigger.js +51 -0
- package/dist/blocks/Composer/getSendState.js +38 -0
- package/dist/blocks/Composer/getSpokenMentionWords.js +35 -0
- package/dist/blocks/Composer/indexSpokenNames.js +50 -0
- package/dist/blocks/Composer/insertLink.js +36 -0
- package/dist/blocks/Composer/insertMention.js +43 -0
- package/dist/blocks/Composer/matchSpokenName.js +88 -0
- package/dist/blocks/Composer/meta.js +212 -0
- package/dist/blocks/Composer/parseMentionValue.js +55 -0
- package/dist/blocks/Composer/placeDictation.js +51 -0
- package/dist/blocks/Composer/rankMentions.js +51 -0
- package/dist/blocks/Composer/replaceRange.js +48 -0
- package/dist/blocks/Composer/segmentText.js +78 -0
- package/dist/blocks/Composer/shiftOffset.js +37 -0
- package/dist/blocks/Composer/snapSelection.js +37 -0
- package/dist/blocks/Composer/useMentionEditor.js +381 -0
- package/dist/blocks/Composer/withPartial.js +50 -0
- package/dist/blocks/DateSelector/DateSelector.js +250 -0
- package/dist/blocks/DateSelector/formatDateValue.js +34 -0
- package/dist/blocks/DateSelector/getDateMenuActions.js +96 -0
- package/dist/blocks/DateSelector/meta.js +109 -0
- package/dist/blocks/DateSelector/toBoundDate.js +40 -0
- package/dist/blocks/DateSelector/toPickerDate.js +31 -0
- package/dist/blocks/DateSelector/toUtcDay.js +25 -0
- package/dist/blocks/Divider/Divider.js +159 -0
- package/dist/blocks/Divider/meta.js +108 -0
- package/dist/blocks/Empty/Empty.js +107 -0
- package/dist/blocks/Empty/meta.js +61 -0
- package/dist/blocks/FileInput/FileInput.js +253 -0
- package/dist/blocks/FileInput/formatFileSize.js +28 -0
- package/dist/blocks/FileInput/getFileSources.js +48 -0
- package/dist/blocks/FileInput/meta.js +123 -0
- package/dist/blocks/Icon/Icon.js +41 -0
- package/dist/blocks/Icon/meta.js +80 -0
- package/dist/blocks/Illustration/Illustration.js +154 -0
- package/dist/blocks/Illustration/IllustrationLayer.js +105 -0
- package/dist/blocks/Illustration/colorNodes.js +72 -0
- package/dist/blocks/Illustration/createIllustrationMotion.js +172 -0
- package/dist/blocks/Illustration/getIllustrationBox.js +54 -0
- package/dist/blocks/Illustration/getIllustrationColors.js +48 -0
- package/dist/blocks/Illustration/getKeyframeRange.js +99 -0
- package/dist/blocks/Illustration/getLayerBounds.js +74 -0
- package/dist/blocks/Illustration/getLayers.js +113 -0
- package/dist/blocks/Illustration/getNodePoints.js +210 -0
- package/dist/blocks/Illustration/meta.js +196 -0
- package/dist/blocks/Illustration/parseIllustration.js +84 -0
- package/dist/blocks/Illustration/toBoundingBoxGradients.js +188 -0
- package/dist/blocks/Illustration/useIllustrationMotion.js +75 -0
- package/dist/blocks/Label/Label.js +111 -0
- package/dist/blocks/Label/getLabelProperties.js +38 -0
- package/dist/blocks/Label/getLabelState.js +59 -0
- package/dist/blocks/List/List.js +159 -0
- package/dist/blocks/List/ListRow.js +74 -0
- package/dist/blocks/List/ListRowContext.js +20 -0
- package/dist/blocks/List/SectionHeader.js +119 -0
- package/dist/blocks/List/getSections.js +161 -0
- package/dist/blocks/List/meta.js +190 -0
- package/dist/blocks/ListItem/ListItem.js +440 -0
- package/dist/blocks/ListItem/ListItemContextMenu.js +58 -0
- package/dist/blocks/ListItem/getListItemParts.js +101 -0
- package/dist/blocks/ListItem/getSfSymbol.js +33 -0
- package/dist/blocks/ListItem/meta.js +284 -0
- package/dist/blocks/Map/Map.js +78 -0
- package/dist/blocks/Map/meta.js +153 -0
- package/dist/blocks/Markdown/ChipWidthContext.js +20 -0
- package/dist/blocks/Markdown/ChipWidthView.js +40 -0
- package/dist/blocks/Markdown/LinkChip.js +151 -0
- package/dist/blocks/Markdown/Markdown.js +70 -0
- package/dist/blocks/Markdown/MarkdownCode.js +67 -0
- package/dist/blocks/Markdown/MarkdownContent.js +119 -0
- package/dist/blocks/Markdown/MarkdownImage.js +77 -0
- package/dist/blocks/Markdown/MarkdownList.js +97 -0
- package/dist/blocks/Markdown/MarkdownListContext.js +22 -0
- package/dist/blocks/Markdown/MarkdownRenderer.js +231 -0
- package/dist/blocks/Markdown/MarkdownTable.js +96 -0
- package/dist/blocks/Markdown/MarkdownTokenizer.js +43 -0
- package/dist/blocks/Markdown/TaskBox.js +58 -0
- package/dist/blocks/Markdown/TaskMark.js +37 -0
- package/dist/blocks/Markdown/getChipMaxWidth.js +33 -0
- package/dist/blocks/Markdown/getLinkChip.js +95 -0
- package/dist/blocks/Markdown/getLinkChipColors.js +51 -0
- package/dist/blocks/Markdown/getListMarker.js +116 -0
- package/dist/blocks/Markdown/getMarkdownStyles.js +206 -0
- package/dist/blocks/Markdown/getNodeText.js +37 -0
- package/dist/blocks/Markdown/layoutLinkChips.js +209 -0
- package/dist/blocks/Markdown/matchLinkChip.js +82 -0
- package/dist/blocks/Markdown/meta.js +56 -0
- package/dist/blocks/Markdown/restyleText.js +40 -0
- package/dist/blocks/Markdown/trimOuterSpace.js +42 -0
- package/dist/blocks/Menu/Menu.js +96 -0
- package/dist/blocks/Menu/getMenuActions.js +66 -0
- package/dist/blocks/Menu/meta.js +159 -0
- package/dist/blocks/MultipleSelector/MultipleSelector.js +290 -0
- package/dist/blocks/MultipleSelector/MultipleSelectorRow.js +71 -0
- package/dist/blocks/MultipleSelector/ValueSummary.js +130 -0
- package/dist/blocks/MultipleSelector/getOptionIndices.js +30 -0
- package/dist/blocks/MultipleSelector/getSessionOptions.js +38 -0
- package/dist/blocks/MultipleSelector/getSummaryCount.js +35 -0
- package/dist/blocks/MultipleSelector/meta.js +284 -0
- package/dist/blocks/MultipleSelector/toggleValue.js +50 -0
- package/dist/blocks/NumberInput/NumberInput.js +251 -0
- package/dist/blocks/NumberInput/StepButton.js +46 -0
- package/dist/blocks/NumberInput/formatNumber.js +35 -0
- package/dist/blocks/NumberInput/getNumberKeyboardType.js +32 -0
- package/dist/blocks/NumberInput/meta.js +123 -0
- package/dist/blocks/NumberInput/normalizeNumber.js +38 -0
- package/dist/blocks/NumberInput/parseNumberText.js +46 -0
- package/dist/blocks/PageDots/PageDots.js +131 -0
- package/dist/blocks/PageDots/meta.js +48 -0
- package/dist/blocks/Paragraph/Paragraph.js +52 -0
- package/dist/blocks/Paragraph/meta.js +295 -0
- package/dist/blocks/QRScanner/QRScanner.js +94 -0
- package/dist/blocks/QRScanner/createScanFilter.js +44 -0
- package/dist/blocks/QRScanner/meta.js +80 -0
- package/dist/blocks/Screen/meta.js +197 -0
- package/dist/blocks/SegmentedControl/SegmentedControl.js +77 -0
- package/dist/blocks/SegmentedControl/meta.js +78 -0
- package/dist/blocks/Selector/NoValueAvatar.js +42 -0
- package/dist/blocks/Selector/PickerOptionRow.js +130 -0
- package/dist/blocks/Selector/PickerRowLeading.js +57 -0
- package/dist/blocks/Selector/PickerSearchField.js +85 -0
- package/dist/blocks/Selector/PickerSheet.js +239 -0
- package/dist/blocks/Selector/Selector.js +122 -0
- package/dist/blocks/Selector/SelectorMenu.js +97 -0
- package/dist/blocks/Selector/SelectorRow.js +86 -0
- package/dist/blocks/Selector/SelectorSheet.js +131 -0
- package/dist/blocks/Selector/getOptionIndex.js +39 -0
- package/dist/blocks/Selector/getOptionLabel.js +32 -0
- package/dist/blocks/Selector/getOptionValue.js +20 -0
- package/dist/blocks/Selector/getPickerSheetDetents.js +45 -0
- package/dist/blocks/Selector/getPickerSheetRows.js +174 -0
- package/dist/blocks/Selector/getPickerSheetScrollIndex.js +35 -0
- package/dist/blocks/Selector/getSelectorMenuActions.js +61 -0
- package/dist/blocks/Selector/meta.js +195 -0
- package/dist/blocks/Selector/normalizeSearchText.js +27 -0
- package/dist/blocks/Selector/setSelectorValue.js +54 -0
- package/dist/blocks/Sheet/Sheet.js +174 -0
- package/dist/blocks/Sheet/getSheetDetents.js +56 -0
- package/dist/blocks/Sheet/meta.js +72 -0
- package/dist/blocks/SignaturePad/SignaturePad.js +182 -0
- package/dist/blocks/SignaturePad/meta.js +74 -0
- package/dist/blocks/SignaturePad/toSignatureValue.js +52 -0
- package/dist/blocks/Skeleton/Skeleton.js +131 -0
- package/dist/blocks/Skeleton/SkeletonCard.js +42 -0
- package/dist/blocks/Skeleton/SkeletonHero.js +72 -0
- package/dist/blocks/Skeleton/SkeletonInsetGroup.js +82 -0
- package/dist/blocks/Skeleton/SkeletonListRow.js +90 -0
- package/dist/blocks/Skeleton/SkeletonParagraph.js +36 -0
- package/dist/blocks/Skeleton/SkeletonRows.js +58 -0
- package/dist/blocks/Skeleton/SkeletonTimeline.js +88 -0
- package/dist/blocks/Skeleton/getBarWidth.js +45 -0
- package/dist/blocks/Skeleton/getParagraphWidths.js +56 -0
- package/dist/blocks/Skeleton/getSectionCounts.js +33 -0
- package/dist/blocks/Skeleton/getSkeletonVariant.js +27 -0
- package/dist/blocks/Skeleton/meta.js +98 -0
- package/dist/blocks/Spinner/Spinner.js +68 -0
- package/dist/blocks/Spinner/meta.js +35 -0
- package/dist/blocks/StatusIcon/StatusGlyph.js +247 -0
- package/dist/blocks/StatusIcon/StatusIcon.js +34 -0
- package/dist/blocks/StatusIcon/StatusMark.js +87 -0
- package/dist/blocks/StatusIcon/getPiePath.js +41 -0
- package/dist/blocks/StatusIcon/getStatusColor.js +61 -0
- package/dist/blocks/StatusIcon/meta.js +38 -0
- package/dist/blocks/StatusIcon/statusLabels.js +33 -0
- package/dist/blocks/Switch/Switch.js +85 -0
- package/dist/blocks/Switch/meta.js +78 -0
- package/dist/blocks/Tabs/Tabs.js +269 -0
- package/dist/blocks/Tabs/meta.js +305 -0
- package/dist/blocks/Tag/TONE_PALETTES.js +34 -0
- package/dist/blocks/Tag/Tag.js +173 -0
- package/dist/blocks/Tag/getTagColors.js +120 -0
- package/dist/blocks/Tag/getTagDotColor.js +32 -0
- package/dist/blocks/Tag/meta.js +131 -0
- package/dist/blocks/TextArea/ComposerSendButton.js +69 -0
- package/dist/blocks/TextArea/TextArea.js +167 -0
- package/dist/blocks/TextArea/meta.js +96 -0
- package/dist/blocks/TextInput/TextInput.js +253 -0
- package/dist/blocks/TextInput/applyReplaceInput.js +30 -0
- package/dist/blocks/TextInput/getKeyboardProps.js +64 -0
- package/dist/blocks/TextInput/getSearchBoxStyle.js +39 -0
- package/dist/blocks/TextInput/meta.js +113 -0
- package/dist/blocks/Title/Title.js +62 -0
- package/dist/blocks/Title/meta.js +355 -0
- package/dist/blocks.js +52 -0
- package/dist/device/getDeviceFeature.js +81 -0
- package/dist/device/playFeedback.js +32 -0
- package/dist/device.js +18 -0
- package/dist/dictation.js +17 -0
- package/dist/htmlToText.js +32 -0
- package/dist/metas.js +53 -0
- package/dist/schemas/avatar.js +40 -0
- package/dist/schemas/icon.js +65 -0
- package/dist/schemas/inputLabel.js +96 -0
- package/dist/schemas/inputProperties.js +92 -0
- package/dist/schemas/linkChips.js +85 -0
- package/dist/schemas/status.js +75 -0
- package/dist/schemas/textStyle.js +33 -0
- package/dist/schemas/tone.js +28 -0
- package/dist/schemas.js +47 -0
- package/dist/shared/ClearButton.js +53 -0
- package/dist/shared/CountText.js +38 -0
- package/dist/shared/MissingFeature.js +43 -0
- package/dist/shared/NativeMenu.js +69 -0
- package/dist/shared/OptionGlyph.js +59 -0
- package/dist/shared/PropertyRow.js +89 -0
- package/dist/shared/SheetCloseButton.js +51 -0
- package/dist/shared/SheetDoneButton.js +44 -0
- package/dist/shared/SwipeContext.js +20 -0
- package/dist/shared/SwipeableRow.js +294 -0
- package/dist/shared/SystemIcon.js +72 -0
- package/dist/shared/dictation/DictationButton.js +77 -0
- package/dist/shared/dictation/DictationWarning.js +89 -0
- package/dist/shared/dictation/LevelMeter.js +57 -0
- package/dist/shared/dictation/ListeningRow.js +100 -0
- package/dist/shared/dictation/PartialSpans.js +50 -0
- package/dist/shared/dictation/checkDictationAvailable.js +65 -0
- package/dist/shared/dictation/claimMic.js +68 -0
- package/dist/shared/dictation/createQueuedRecognizer.js +213 -0
- package/dist/shared/dictation/getDictationLevel.js +30 -0
- package/dist/shared/dictation/getDictationWarning.js +40 -0
- package/dist/shared/dictation/getLevelBars.js +38 -0
- package/dist/shared/dictation/getRecognizer.js +46 -0
- package/dist/shared/dictation/getStartOptions.js +42 -0
- package/dist/shared/dictation/insertAtSelection.js +48 -0
- package/dist/shared/dictation/pickRecognitionLocale.js +37 -0
- package/dist/shared/dictation/useDictation.js +299 -0
- package/dist/shared/getControlSize.js +50 -0
- package/dist/shared/getInputBoxStyle.js +93 -0
- package/dist/shared/getPropertyRowTextStyles.js +40 -0
- package/dist/shared/getSemanticColors.js +96 -0
- package/dist/shared/getToneColor.js +51 -0
- package/dist/shared/iosTextStyles.js +49 -0
- package/dist/shared/useBlockTokens.js +41 -0
- package/dist/skeleton/SkeletonFrameContext.js +21 -0
- package/dist/skeleton/SkeletonLine.js +46 -0
- package/dist/skeleton/SkeletonShape.js +140 -0
- package/dist/skeleton/createShimmerClock.js +57 -0
- package/dist/skeleton/shimmerClock.js +20 -0
- package/dist/skeleton/skeletonText.js +44 -0
- package/dist/skeleton/useShimmer.js +34 -0
- package/dist/types.js +23 -0
- package/dist/typography/TITLE_LEVEL_STYLES.js +24 -0
- package/dist/typography/TypographyText.js +78 -0
- package/dist/typography/getIosTextStyle.js +33 -0
- package/dist/typography/getTextStyle.js +94 -0
- package/dist/useComponentTokens.js +38 -0
- package/package.json +94 -3
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import linkChips from '../../schemas/linkChips.js';
|
|
16
|
+
const toolResultMode = {
|
|
17
|
+
type: 'string',
|
|
18
|
+
enum: [
|
|
19
|
+
'summary',
|
|
20
|
+
'full',
|
|
21
|
+
'none',
|
|
22
|
+
'readable'
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
const prompt = {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
key: {
|
|
29
|
+
type: 'string'
|
|
30
|
+
},
|
|
31
|
+
label: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'The text sent when the chip is pressed.'
|
|
34
|
+
},
|
|
35
|
+
description: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'A second line on the chip.'
|
|
38
|
+
},
|
|
39
|
+
icon: {
|
|
40
|
+
nativeIgnored: true,
|
|
41
|
+
description: 'Ignored on mobile.'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const endpointId = {
|
|
46
|
+
type: 'string'
|
|
47
|
+
};
|
|
48
|
+
const welcomeProperties = {
|
|
49
|
+
title: {
|
|
50
|
+
type: 'string'
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
type: 'string'
|
|
54
|
+
},
|
|
55
|
+
icon: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'Mobile: a Lucide icon name for the glyph where there are no SF Symbols. Defaults to Sparkles.'
|
|
58
|
+
},
|
|
59
|
+
symbol: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Mobile only: the SF Symbol drawn on iOS. Defaults to sparkles.'
|
|
62
|
+
},
|
|
63
|
+
prompts: {
|
|
64
|
+
type: 'array',
|
|
65
|
+
description: 'Starter prompts, shown as chips above the composer. Pressing one sends its label.',
|
|
66
|
+
items: prompt
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const welcome = {
|
|
70
|
+
type: 'object',
|
|
71
|
+
description: 'The empty conversation: a glyph, a title and a description, and prompt chips above the composer.',
|
|
72
|
+
properties: {
|
|
73
|
+
...welcomeProperties,
|
|
74
|
+
variant: {
|
|
75
|
+
nativeIgnored: true,
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'Ignored on mobile.'
|
|
78
|
+
},
|
|
79
|
+
tracks: {
|
|
80
|
+
nativeIgnored: true,
|
|
81
|
+
type: 'array',
|
|
82
|
+
description: 'Ignored on mobile.'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
export default {
|
|
87
|
+
category: 'display',
|
|
88
|
+
// The internal events the block registers: update-page-state's SetState, Copy, a link press,
|
|
89
|
+
// and the thread endpoints' CallAPI.
|
|
90
|
+
actions: [
|
|
91
|
+
'CallAPI',
|
|
92
|
+
'CopyToClipboard',
|
|
93
|
+
'Link',
|
|
94
|
+
'SetState'
|
|
95
|
+
],
|
|
96
|
+
operators: [
|
|
97
|
+
'_event'
|
|
98
|
+
],
|
|
99
|
+
icons: [
|
|
100
|
+
'ArrowDown',
|
|
101
|
+
'ArrowUp',
|
|
102
|
+
'Check',
|
|
103
|
+
'ChevronDown',
|
|
104
|
+
'ChevronRight',
|
|
105
|
+
'ChevronUp',
|
|
106
|
+
'CircleAlert',
|
|
107
|
+
'CircleCheck',
|
|
108
|
+
'CircleX',
|
|
109
|
+
'FileText',
|
|
110
|
+
'MessagesSquare',
|
|
111
|
+
'Mic',
|
|
112
|
+
'Paperclip',
|
|
113
|
+
'RotateCcw',
|
|
114
|
+
'Search',
|
|
115
|
+
'Send',
|
|
116
|
+
'SlidersHorizontal',
|
|
117
|
+
'Sparkles',
|
|
118
|
+
'SquarePen',
|
|
119
|
+
'Trash2',
|
|
120
|
+
'TriangleAlert',
|
|
121
|
+
'Wrench',
|
|
122
|
+
'X'
|
|
123
|
+
],
|
|
124
|
+
valueType: null,
|
|
125
|
+
cssKeys: {
|
|
126
|
+
element: 'The conversation, drawn as the page content.',
|
|
127
|
+
composer: 'The composer bar.'
|
|
128
|
+
},
|
|
129
|
+
events: {
|
|
130
|
+
onBeforeSend: 'Trigger before a typed message is sent. Return success: false (throw) to keep it unsent. Event contains text and messages.',
|
|
131
|
+
onConversationStart: 'Trigger once when a conversation starts, on its first user message. Event contains the conversationId.',
|
|
132
|
+
onDataPart: 'Trigger when the agent sends a custom data part. Event contains type, data and id.',
|
|
133
|
+
onError: 'Trigger on a stream error. Event contains message.',
|
|
134
|
+
onLinkClick: 'Trigger when a link in a message is pressed. Event contains href and text (empty on mobile). Wiring it replaces the default, which opens an app path (`/ACME/tasks/ACME-1`) as a page and any other link outside the app.',
|
|
135
|
+
onMessageComplete: 'Trigger when a reply finishes streaming. Event contains role, content, messageId, parts, finishReason, isAbort, isDisconnect and messages.',
|
|
136
|
+
onRegenerate: 'Trigger when the person regenerates a reply. Event contains messageId and messages.',
|
|
137
|
+
onStop: 'Trigger when the person stops a reply. Event contains messages.',
|
|
138
|
+
onSuggestionClick: 'Trigger when a follow-up suggestion chip is pressed. Event contains suggestion.',
|
|
139
|
+
onThreadChange: 'Mobile only. Trigger when the open conversation changes: a thread opened from the list, a new chat, or the open thread deleted. Event contains conversationId and title. Not fired for the thread resumed on mount.',
|
|
140
|
+
onTitleGenerated: 'Trigger when the agent sends a conversation title. Event contains title.',
|
|
141
|
+
onToolCall: 'Trigger when a tool is called. Event contains toolName, toolCallId and input.',
|
|
142
|
+
onToolResult: 'Trigger when a tool finishes. Event contains toolName, toolCallId, output and error.',
|
|
143
|
+
onUserMessage: 'Trigger when the person sends a message. Event contains role, messageId, content, parts and messages.',
|
|
144
|
+
onDeleteMessage: 'Never fires on mobile: messages are not deleted from the phone.',
|
|
145
|
+
onEditMessage: 'Never fires on mobile: sent messages are not edited.',
|
|
146
|
+
onFeedback: 'Never fires on mobile: there are no rating thumbs.',
|
|
147
|
+
onSwitchChange: 'Never fires on mobile: the composer has no switches.'
|
|
148
|
+
},
|
|
149
|
+
methods: {
|
|
150
|
+
clearError: 'Clear the current error.',
|
|
151
|
+
clearMessages: 'Clear all messages from the chat.',
|
|
152
|
+
deleteMessage: 'Delete a message. Accepts args.messageId.',
|
|
153
|
+
newChat: 'Mobile only. Start a new conversation, as the composer’s new-chat button does. With `threads` the block mints and keeps it; otherwise onThreadChange gives its conversationId. Accepts args `{ sharedState, welcome, input, tag, title }`, as the `seed` property, to start a chat about a record.',
|
|
154
|
+
openThreads: 'Mobile only. Open the sheet of recent conversations. Needs `threads` with a list endpoint. Wire it to a Screen header action.',
|
|
155
|
+
regenerate: 'Regenerate the last reply, or args.messageId.',
|
|
156
|
+
scrollToBottom: 'Scroll to the newest message and follow the conversation again.',
|
|
157
|
+
sendMessage: 'Send a message. Accepts args.text.',
|
|
158
|
+
setInput: 'Fill the composer without sending. Accepts args.text; anything else empties it.',
|
|
159
|
+
setMessages: 'Replace the messages. Accepts args.messages.',
|
|
160
|
+
stop: 'Stop the reply that is streaming.'
|
|
161
|
+
},
|
|
162
|
+
properties: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
additionalProperties: false,
|
|
165
|
+
required: [
|
|
166
|
+
'agentId'
|
|
167
|
+
],
|
|
168
|
+
properties: {
|
|
169
|
+
agentId: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
description: 'Id of the agent to chat with.'
|
|
172
|
+
},
|
|
173
|
+
conversationId: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
description: 'The conversation, when the app keeps its threads. Changing it starts a new chat; load its transcript through `messages`. Not read with `threads`, where the block keeps the conversation.'
|
|
176
|
+
},
|
|
177
|
+
messages: {
|
|
178
|
+
type: [
|
|
179
|
+
'array',
|
|
180
|
+
'null'
|
|
181
|
+
],
|
|
182
|
+
description: 'The transcript to show, when the app keeps its threads: an array loads it, null clears the chat. Not read with `threads`.'
|
|
183
|
+
},
|
|
184
|
+
linkChips,
|
|
185
|
+
dictation: {
|
|
186
|
+
type: 'boolean',
|
|
187
|
+
default: true,
|
|
188
|
+
description: 'Mobile only. Show a mic in the composer, before send, that turns speech into text on the phone. One tap starts listening and the next stops; the cross on the listening row throws away what was said. The words go in as said. The mic shows only where the phone recognises its language on the device.'
|
|
189
|
+
},
|
|
190
|
+
loading: {
|
|
191
|
+
type: 'boolean',
|
|
192
|
+
description: 'The app is still loading this conversation: shimmering rows stand in for the messages and nothing can be sent.'
|
|
193
|
+
},
|
|
194
|
+
urlQuery: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
description: 'URL query parameters sent with each agent request.'
|
|
197
|
+
},
|
|
198
|
+
sharedState: {
|
|
199
|
+
type: 'object',
|
|
200
|
+
description: 'When set to a non-empty object, it is sent to the agent each turn as read context, and the agent can write any of its top-level keys into the page state through the update-page-state tool, as on the web.'
|
|
201
|
+
},
|
|
202
|
+
sharedStateReadOnly: {
|
|
203
|
+
type: 'boolean',
|
|
204
|
+
default: false,
|
|
205
|
+
description: 'Send `sharedState` as read-only context: the agent is not offered update-page-state.'
|
|
206
|
+
},
|
|
207
|
+
welcome,
|
|
208
|
+
seed: {
|
|
209
|
+
type: 'object',
|
|
210
|
+
additionalProperties: false,
|
|
211
|
+
description: 'Mobile only. What the chat starts with when it mounts with no thread resumed (no `threads`, `threads.resume` false, or no thread to resume), so a page can open a chat about a record. The newChat method takes the same object as its args. The composer’s new-chat button starts an unseeded chat.',
|
|
212
|
+
properties: {
|
|
213
|
+
sharedState: {
|
|
214
|
+
type: 'object',
|
|
215
|
+
description: 'Merged under `sharedState` for this conversation: sent to the agent each turn, and writable through update-page-state as the page’s shared keys are. The page’s `sharedState` wins where both set a key.'
|
|
216
|
+
},
|
|
217
|
+
welcome: {
|
|
218
|
+
type: 'object',
|
|
219
|
+
description: 'Laid over the `welcome` property while this conversation is empty.',
|
|
220
|
+
properties: welcomeProperties
|
|
221
|
+
},
|
|
222
|
+
input: {
|
|
223
|
+
type: 'string',
|
|
224
|
+
description: 'Text put in the composer, unsent, for the person to edit or send.'
|
|
225
|
+
},
|
|
226
|
+
tag: {
|
|
227
|
+
type: 'string',
|
|
228
|
+
description: 'With `threads`, the tag saved onto this thread in place of `threads.tag`.'
|
|
229
|
+
},
|
|
230
|
+
title: {
|
|
231
|
+
type: 'string',
|
|
232
|
+
description: 'With `threads`, the thread’s name, kept rather than named from its first exchange. onThreadChange gives it as title.'
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
suggestions: {
|
|
237
|
+
type: 'array',
|
|
238
|
+
description: 'Follow-up chips shown above the composer after a reply. A `data-suggestions` part the agent sends replaces them.',
|
|
239
|
+
items: prompt
|
|
240
|
+
},
|
|
241
|
+
messageDisplay: {
|
|
242
|
+
type: 'object',
|
|
243
|
+
properties: {
|
|
244
|
+
actions: {
|
|
245
|
+
description: 'The actions a long press on a reply offers. Mobile supports `copy` and `regenerate` (both by default); `feedback` and `delete` are ignored.',
|
|
246
|
+
oneOf: [
|
|
247
|
+
{
|
|
248
|
+
type: 'array',
|
|
249
|
+
items: {
|
|
250
|
+
type: 'string'
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
type: 'object',
|
|
255
|
+
additionalProperties: {
|
|
256
|
+
type: 'boolean'
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
reasoningDisplay: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
enum: [
|
|
264
|
+
'interleaved',
|
|
265
|
+
'grouped'
|
|
266
|
+
],
|
|
267
|
+
default: 'interleaved',
|
|
268
|
+
description: 'Draw a reply’s parts in the order they came, or grouped by kind.'
|
|
269
|
+
},
|
|
270
|
+
showReasoning: {
|
|
271
|
+
type: 'boolean',
|
|
272
|
+
default: true,
|
|
273
|
+
description: 'Show the model’s reasoning behind a disclosure.'
|
|
274
|
+
},
|
|
275
|
+
showStatusUpdates: {
|
|
276
|
+
type: 'boolean',
|
|
277
|
+
default: true
|
|
278
|
+
},
|
|
279
|
+
showThoughtChain: {
|
|
280
|
+
type: 'boolean',
|
|
281
|
+
default: true,
|
|
282
|
+
description: 'Show tool calls as compact rows in the reply.'
|
|
283
|
+
},
|
|
284
|
+
showToolInputStreaming: {
|
|
285
|
+
type: 'boolean',
|
|
286
|
+
default: true,
|
|
287
|
+
description: 'Show what a running tool was called with as its summary.'
|
|
288
|
+
},
|
|
289
|
+
thinkingMessages: {
|
|
290
|
+
oneOf: [
|
|
291
|
+
{
|
|
292
|
+
type: 'string'
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: 'array',
|
|
296
|
+
items: {
|
|
297
|
+
type: 'string'
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
description: 'The label shown beside the thinking dots after a delay; an array rotates.'
|
|
302
|
+
},
|
|
303
|
+
thinkingMessageDelay: {
|
|
304
|
+
type: 'number',
|
|
305
|
+
default: 3000
|
|
306
|
+
},
|
|
307
|
+
thinkingMessageRotationInterval: {
|
|
308
|
+
type: 'number',
|
|
309
|
+
default: 8000
|
|
310
|
+
},
|
|
311
|
+
toolResultDisplay: {
|
|
312
|
+
description: 'What an opened tool row shows: `summary` and `readable` the output as readable rows, `full` as JSON, `none` nothing. An object sets it per tool name, with `default`.',
|
|
313
|
+
oneOf: [
|
|
314
|
+
toolResultMode,
|
|
315
|
+
{
|
|
316
|
+
type: 'object',
|
|
317
|
+
properties: {
|
|
318
|
+
default: toolResultMode
|
|
319
|
+
},
|
|
320
|
+
additionalProperties: toolResultMode
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
codeHighlighter: {
|
|
325
|
+
nativeIgnored: true,
|
|
326
|
+
type: 'boolean',
|
|
327
|
+
description: 'Ignored on mobile.'
|
|
328
|
+
},
|
|
329
|
+
editableMessages: {
|
|
330
|
+
nativeIgnored: true,
|
|
331
|
+
type: 'boolean',
|
|
332
|
+
description: 'Ignored on mobile.'
|
|
333
|
+
},
|
|
334
|
+
markdownRendering: {
|
|
335
|
+
nativeIgnored: true,
|
|
336
|
+
type: 'boolean',
|
|
337
|
+
description: 'Ignored on mobile.'
|
|
338
|
+
},
|
|
339
|
+
renderLatex: {
|
|
340
|
+
nativeIgnored: true,
|
|
341
|
+
type: 'boolean',
|
|
342
|
+
description: 'Ignored on mobile.'
|
|
343
|
+
},
|
|
344
|
+
renderMermaid: {
|
|
345
|
+
nativeIgnored: true,
|
|
346
|
+
type: 'boolean',
|
|
347
|
+
description: 'Ignored on mobile.'
|
|
348
|
+
},
|
|
349
|
+
roles: {
|
|
350
|
+
nativeIgnored: true,
|
|
351
|
+
type: 'object',
|
|
352
|
+
description: 'Ignored on mobile.'
|
|
353
|
+
},
|
|
354
|
+
showSources: {
|
|
355
|
+
nativeIgnored: true,
|
|
356
|
+
type: 'boolean',
|
|
357
|
+
description: 'Ignored on mobile.'
|
|
358
|
+
},
|
|
359
|
+
showStepSeparators: {
|
|
360
|
+
nativeIgnored: true,
|
|
361
|
+
type: 'boolean',
|
|
362
|
+
description: 'Ignored on mobile.'
|
|
363
|
+
},
|
|
364
|
+
sourcesDisplay: {
|
|
365
|
+
nativeIgnored: true,
|
|
366
|
+
type: 'object',
|
|
367
|
+
description: 'Ignored on mobile.'
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
sender: {
|
|
372
|
+
type: 'object',
|
|
373
|
+
properties: {
|
|
374
|
+
placeholder: {
|
|
375
|
+
type: 'string',
|
|
376
|
+
description: 'The empty composer’s placeholder.'
|
|
377
|
+
},
|
|
378
|
+
sticky: {
|
|
379
|
+
type: 'boolean',
|
|
380
|
+
default: true,
|
|
381
|
+
description: 'Mobile only. Draw the composer in the Screen’s footer, pinned above the tab bar and the keyboard, with the conversation as the page content. false draws it under the conversation, for a chat inside a Sheet or Card. Do not give the Screen a footer slot of its own.'
|
|
382
|
+
},
|
|
383
|
+
newChat: {
|
|
384
|
+
type: 'boolean',
|
|
385
|
+
default: true,
|
|
386
|
+
description: 'Mobile only. Show the new-chat button beside the composer.'
|
|
387
|
+
},
|
|
388
|
+
attachments: {
|
|
389
|
+
nativeIgnored: true,
|
|
390
|
+
type: 'object',
|
|
391
|
+
description: 'Ignored on mobile: the basic shell profile has no file or image picker.'
|
|
392
|
+
},
|
|
393
|
+
allowSpeech: {
|
|
394
|
+
nativeIgnored: true,
|
|
395
|
+
type: 'boolean',
|
|
396
|
+
description: 'Ignored on mobile.'
|
|
397
|
+
},
|
|
398
|
+
classNames: {
|
|
399
|
+
nativeIgnored: true,
|
|
400
|
+
type: 'object',
|
|
401
|
+
description: 'Ignored on mobile.'
|
|
402
|
+
},
|
|
403
|
+
header: {
|
|
404
|
+
nativeIgnored: true,
|
|
405
|
+
type: 'object',
|
|
406
|
+
description: 'Ignored on mobile.'
|
|
407
|
+
},
|
|
408
|
+
styles: {
|
|
409
|
+
nativeIgnored: true,
|
|
410
|
+
type: 'object',
|
|
411
|
+
description: 'Ignored on mobile.'
|
|
412
|
+
},
|
|
413
|
+
submitType: {
|
|
414
|
+
nativeIgnored: true,
|
|
415
|
+
type: 'string',
|
|
416
|
+
description: 'Ignored on mobile.'
|
|
417
|
+
},
|
|
418
|
+
switches: {
|
|
419
|
+
nativeIgnored: true,
|
|
420
|
+
type: 'array',
|
|
421
|
+
description: 'Ignored on mobile.'
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
threads: {
|
|
426
|
+
type: 'object',
|
|
427
|
+
additionalProperties: false,
|
|
428
|
+
description: 'Mobile only. Keep the conversations through the app’s thread endpoints (the ai-assistant module’s, or the app’s own of the same shape): resume the thread last opened, save each one as it goes, name it from its first exchange, and list recent ones in a sheet (the openThreads method) where a row opens a thread and a swipe deletes it. Without it the app keeps them, through `conversationId` and `messages`.',
|
|
429
|
+
properties: {
|
|
430
|
+
module: {
|
|
431
|
+
type: 'string',
|
|
432
|
+
description: 'The id of the app’s ai-assistant module entry. Its endpoints (`<module>/list-threads`, `get-thread`, `get-active-thread`, `save-thread`, `delete-thread`, `title-thread`) are used for any not named in `endpoints`.'
|
|
433
|
+
},
|
|
434
|
+
endpoints: {
|
|
435
|
+
type: 'object',
|
|
436
|
+
additionalProperties: false,
|
|
437
|
+
description: 'Endpoint ids by what they do, each taking the ai-assistant module endpoint’s payload.',
|
|
438
|
+
properties: {
|
|
439
|
+
listThreads: {
|
|
440
|
+
...endpointId,
|
|
441
|
+
description: '{ scope } → [{ key, label, tags }].'
|
|
442
|
+
},
|
|
443
|
+
getThread: {
|
|
444
|
+
...endpointId,
|
|
445
|
+
description: '{ conversationId } → { messages }.'
|
|
446
|
+
},
|
|
447
|
+
getActiveThread: {
|
|
448
|
+
...endpointId,
|
|
449
|
+
description: '{ scope } → { conversationId, title, messages }, conversationId null for none.'
|
|
450
|
+
},
|
|
451
|
+
saveThread: {
|
|
452
|
+
...endpointId,
|
|
453
|
+
description: '{ conversationId, messages, title?, scope?, tag }.'
|
|
454
|
+
},
|
|
455
|
+
deleteThread: {
|
|
456
|
+
...endpointId,
|
|
457
|
+
description: '{ conversationId }.'
|
|
458
|
+
},
|
|
459
|
+
titleThread: {
|
|
460
|
+
...endpointId,
|
|
461
|
+
description: '{ conversationId, prompt, reply, replaces, context } → { title }.'
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
scope: {
|
|
466
|
+
type: 'string',
|
|
467
|
+
description: 'Partitions the threads: listed, resumed and saved per scope and person.'
|
|
468
|
+
},
|
|
469
|
+
tag: {
|
|
470
|
+
type: [
|
|
471
|
+
'string',
|
|
472
|
+
'null'
|
|
473
|
+
],
|
|
474
|
+
description: 'A label saved onto the thread, shown under it in the list.'
|
|
475
|
+
},
|
|
476
|
+
titleContext: {
|
|
477
|
+
type: [
|
|
478
|
+
'string',
|
|
479
|
+
'null'
|
|
480
|
+
],
|
|
481
|
+
description: 'One line of grounding for the generated title.'
|
|
482
|
+
},
|
|
483
|
+
generateTitles: {
|
|
484
|
+
type: 'boolean',
|
|
485
|
+
default: true,
|
|
486
|
+
description: 'Name a thread from its first exchange (titleThread). false keeps the first message as its name.'
|
|
487
|
+
},
|
|
488
|
+
resume: {
|
|
489
|
+
type: 'boolean',
|
|
490
|
+
default: true,
|
|
491
|
+
description: 'Open the thread last opened in the scope when the chat mounts (getActiveThread).'
|
|
492
|
+
},
|
|
493
|
+
title: {
|
|
494
|
+
type: 'string',
|
|
495
|
+
description: 'The threads sheet’s title. Defaults to "Chats".'
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
theme: {
|
|
500
|
+
type: 'object',
|
|
501
|
+
description: 'Theme tokens over the app’s for this block.'
|
|
502
|
+
},
|
|
503
|
+
display: {
|
|
504
|
+
nativeIgnored: true,
|
|
505
|
+
type: 'string',
|
|
506
|
+
description: 'Ignored on mobile: the chat is the page.'
|
|
507
|
+
},
|
|
508
|
+
drawer: {
|
|
509
|
+
nativeIgnored: true,
|
|
510
|
+
type: 'object',
|
|
511
|
+
description: 'Ignored on mobile.'
|
|
512
|
+
},
|
|
513
|
+
feedbackValues: {
|
|
514
|
+
nativeIgnored: true,
|
|
515
|
+
type: 'object',
|
|
516
|
+
description: 'Ignored on mobile.'
|
|
517
|
+
},
|
|
518
|
+
height: {
|
|
519
|
+
nativeIgnored: true,
|
|
520
|
+
type: 'string',
|
|
521
|
+
description: 'Ignored on mobile.'
|
|
522
|
+
},
|
|
523
|
+
maxWidth: {
|
|
524
|
+
nativeIgnored: true,
|
|
525
|
+
type: 'number',
|
|
526
|
+
description: 'Ignored on mobile.'
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { generateId } from 'ai';
|
|
16
|
+
import { type } from '@lowdefy/helpers';
|
|
17
|
+
/**
|
|
18
|
+
* The id of a new conversation, minted on the phone as the web block and the ai-assistant module
|
|
19
|
+
* mint theirs: a thread has no stored row until its first message is saved. It starts with the
|
|
20
|
+
* threads' scope, so a stored thread can be traced to where it was started.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} params
|
|
23
|
+
* @param {string} [params.scope]
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/ function mintConversationId({ scope }) {
|
|
26
|
+
const prefix = type.isString(scope) && scope !== '' ? scope : 'chat';
|
|
27
|
+
return `${prefix}_${Date.now()}${generateId()}`;
|
|
28
|
+
}
|
|
29
|
+
export default mintConversationId;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // The web AgentChat's (blocks-antd-x), copied rather than imported, so a shell never installs a
|
|
16
|
+
// web block package.
|
|
17
|
+
import { type } from '@lowdefy/helpers';
|
|
18
|
+
// A reply cut off mid-stream leaves its tool call with no result, and UIMessage validation
|
|
19
|
+
// rejects the whole history for one such part: every later send fails, and a history stored
|
|
20
|
+
// that way fails on every load. Approval states stay; a pending approval is answerable on resume.
|
|
21
|
+
// A client-side tool the block is still running is in the same state, so its call id is in
|
|
22
|
+
// liveToolCallIds and the part is kept: its output is on the way.
|
|
23
|
+
const UNANSWERED = new Set([
|
|
24
|
+
'input-streaming',
|
|
25
|
+
'input-available'
|
|
26
|
+
]);
|
|
27
|
+
function isDeadToolPart({ part, liveToolCallIds }) {
|
|
28
|
+
const partType = part?.type;
|
|
29
|
+
const isTool = partType === 'dynamic-tool' || type.isString(partType) && partType.startsWith('tool-');
|
|
30
|
+
return isTool && UNANSWERED.has(part.state) && !liveToolCallIds.has(part.toolCallId);
|
|
31
|
+
}
|
|
32
|
+
function replayableMessages({ messages, liveToolCallIds = new Set() }) {
|
|
33
|
+
const list = messages ?? [];
|
|
34
|
+
let changed = false;
|
|
35
|
+
const result = [];
|
|
36
|
+
for (const message of list){
|
|
37
|
+
if (!type.isArray(message?.parts)) {
|
|
38
|
+
result.push(message);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const parts = message.parts.filter((part)=>!isDeadToolPart({
|
|
42
|
+
part,
|
|
43
|
+
liveToolCallIds
|
|
44
|
+
}));
|
|
45
|
+
// Only a step marker left is the empty shell onError already drops.
|
|
46
|
+
if (!parts.some((part)=>part?.type !== 'step-start')) {
|
|
47
|
+
changed = true;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (parts.length === message.parts.length) {
|
|
51
|
+
result.push(message);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
changed = true;
|
|
55
|
+
result.push({
|
|
56
|
+
...message,
|
|
57
|
+
parts
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return changed ? result : list;
|
|
61
|
+
}
|
|
62
|
+
export default replayableMessages;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { ActionSheetIOS, Alert, Platform } from 'react-native';
|
|
16
|
+
/**
|
|
17
|
+
* A message's actions on a long press (Copy, Regenerate): iOS's own action sheet, the platform
|
|
18
|
+
* alert elsewhere.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} params
|
|
21
|
+
* @param {{ id: string, title: string }[]} params.items
|
|
22
|
+
* @param {(item: Object) => void} params.onSelect
|
|
23
|
+
* @param {string} params.cancelTitle
|
|
24
|
+
*/ function showMessageMenu({ cancelTitle, items, onSelect }) {
|
|
25
|
+
if (items.length === 0) return;
|
|
26
|
+
if (Platform.OS === 'ios') {
|
|
27
|
+
ActionSheetIOS.showActionSheetWithOptions({
|
|
28
|
+
cancelButtonIndex: items.length,
|
|
29
|
+
options: [
|
|
30
|
+
...items.map((item)=>item.title),
|
|
31
|
+
cancelTitle
|
|
32
|
+
]
|
|
33
|
+
}, (index)=>{
|
|
34
|
+
if (index < items.length) onSelect(items[index]);
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
Alert.alert(undefined, undefined, [
|
|
39
|
+
...items.map((item)=>({
|
|
40
|
+
onPress: ()=>onSelect(item),
|
|
41
|
+
text: item.title
|
|
42
|
+
})),
|
|
43
|
+
{
|
|
44
|
+
style: 'cancel',
|
|
45
|
+
text: cancelTitle
|
|
46
|
+
}
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
export default showMessageMenu;
|