ff-automationv2 2.2.28 → 2.2.30
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/ai/llmcalls/llmAction.d.ts +9 -4
- package/dist/ai/llmcalls/llmAction.js +214 -42
- package/dist/ai/llmcalls/parseLlmOputput.js +21 -9
- package/dist/ai/llmprompts/promptRegistry.js +15 -0
- package/dist/ai/llmprompts/systemPrompts/actionExtractorPrompt.js +48 -11
- package/dist/ai/llmprompts/systemPrompts/combinedActionExtractorPrompt.js +7 -6
- package/dist/ai/llmprompts/systemPrompts/combinedActionExtractorPromptMob.js +14 -13
- package/dist/ai/llmprompts/systemPrompts/errorDescriptionPrompt.js +6 -4
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtactors.js +125 -67
- package/dist/ai/llmprompts/systemPrompts/fireflinkElementIndexExtractor_Mob.js +65 -28
- package/dist/ai/llmprompts/systemPrompts/getActionExtractorPrompt.js +18 -16
- package/dist/ai/llmprompts/systemPrompts/getActionExtractorPromptMob.js +13 -13
- package/dist/ai/llmprompts/systemPrompts/mobileKeywordExtractor.js +26 -15
- package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.d.ts +1 -0
- package/dist/ai/llmprompts/systemPrompts/otpExtractorPrompt.js +22 -0
- package/dist/ai/llmprompts/systemPrompts/userStoryToListPrompt.js +1 -1
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPrompt.js +23 -19
- package/dist/ai/llmprompts/systemPrompts/verifyActionExtractorPromptMob.js +9 -9
- package/dist/ai/llmprompts/systemPrompts/visionPrompt.js +18 -8
- package/dist/ai/llmprompts/systemPrompts/visionPromptMobile.js +4 -0
- package/dist/ai/llmprompts/systemPrompts/waitActionExtractorPrompt.js +10 -9
- package/dist/ai/llmprompts/systemPrompts/waitActionExtractorPromptMob.js +8 -7
- package/dist/ai/llmprompts/userPrompts/userPrompt.js +8 -8
- package/dist/automation/actions/executor.d.ts +42 -34
- package/dist/automation/actions/executor.js +300 -166
- package/dist/automation/actions/interaction/alert/clickCancelOnAlertPopup.js +4 -4
- package/dist/automation/actions/interaction/alert/clickOkOnAlertPopup.js +4 -4
- package/dist/automation/actions/interaction/alert/enterDataToAlert.js +4 -3
- package/dist/automation/actions/interaction/alert/getTextPresentOnAlertPopup.js +4 -4
- package/dist/automation/actions/interaction/alert/verifyAlertPopUpMessageContainsString.js +4 -3
- package/dist/automation/actions/interaction/alert/verifyAlertPopupIsDisplayed.js +10 -4
- package/dist/automation/actions/interaction/alert/verifyTextPresentOnAlertPopup.js +4 -3
- package/dist/automation/actions/interaction/alert/waitTillAlertIsPresent.js +5 -5
- package/dist/automation/actions/interaction/clear/clear.js +33 -26
- package/dist/automation/actions/interaction/clear/clearAndEnter.js +33 -26
- package/dist/automation/actions/interaction/click/MOB_DoubleTapAtSpecifiedLocation.js +5 -6
- package/dist/automation/actions/interaction/click/click.js +65 -26
- package/dist/automation/actions/interaction/click/clickNtimes.js +29 -24
- package/dist/automation/actions/interaction/click/clickUsingJs.js +12 -12
- package/dist/automation/actions/interaction/click/doubleClick.js +32 -25
- package/dist/automation/actions/interaction/click/rightClick.js +18 -13
- package/dist/automation/actions/interaction/click/tapOnSpecifiedLocation.js +7 -5
- package/dist/automation/actions/interaction/click/waitAndClick.js +29 -27
- package/dist/automation/actions/interaction/dragAndDrop/dragAndDrop.js +2 -2
- package/dist/automation/actions/interaction/elementLessAction/MobCheckIfAppIsClosed.js +14 -9
- package/dist/automation/actions/interaction/elementLessAction/MobRunAppInBackgroundInterface.js +9 -9
- package/dist/automation/actions/interaction/elementlessActions/activateAppUsingAppPackage.d.ts +0 -3
- package/dist/automation/actions/interaction/elementlessActions/activateAppUsingAppPackage.js +8 -9
- package/dist/automation/actions/interaction/elementlessActions/getOtp.d.ts +2 -0
- package/dist/automation/actions/interaction/elementlessActions/getOtp.js +101 -0
- package/dist/automation/actions/interaction/elementlessActions/installAPK.js +74 -33
- package/dist/automation/actions/interaction/elementlessActions/isAppInstalled.js +10 -8
- package/dist/automation/actions/interaction/elementlessActions/openAppWithApkFilePath.js +87 -68
- package/dist/automation/actions/interaction/elementlessActions/openMobileApplication.js +8 -6
- package/dist/automation/actions/interaction/elementlessActions/receiveMessageOnEmulator.js +4 -3
- package/dist/automation/actions/interaction/elementlessActions/terminateAppUsingAppPackage.js +8 -6
- package/dist/automation/actions/interaction/elementlessActions/uninstallAPK.js +76 -32
- package/dist/automation/actions/interaction/enterActions/EnterInputIntoElementFromClipBoardInterface_mob.js +17 -13
- package/dist/automation/actions/interaction/enterActions/enterInput.js +55 -30
- package/dist/automation/actions/interaction/enterActions/enterInputAndPress.js +32 -24
- package/dist/automation/actions/interaction/enterActions/enterUrl.js +22 -17
- package/dist/automation/actions/interaction/enterActions/enterusingJs.js +19 -13
- package/dist/automation/actions/interaction/enterActions/waitAndEnter.js +33 -26
- package/dist/automation/actions/interaction/find/MOB_FindElement.js +37 -21
- package/dist/automation/actions/interaction/find/findElements.js +49 -32
- package/dist/automation/actions/interaction/get/MOB_GetADBLogsForGivenAppPackage.js +5 -6
- package/dist/automation/actions/interaction/get/MOB_GetAllContexts.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetAllWindowHandles.js +8 -9
- package/dist/automation/actions/interaction/get/MOB_GetAltitude.js +20 -10
- package/dist/automation/actions/interaction/get/MOB_GetBatteryPercentage.js +7 -9
- package/dist/automation/actions/interaction/get/MOB_GetBatteryStatus.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetClipBoardText.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentActivity.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentAppPackage.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentContext.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceDate.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceSettings.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceStatus.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceSystemBars.js +5 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentOrientation.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetCurrentSessionId.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetDeviceLocation.js +20 -9
- package/dist/automation/actions/interaction/get/MOB_GetDeviceName.js +7 -8
- package/dist/automation/actions/interaction/get/MOB_GetDeviceOsVersion.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetDeviceUdid.js +7 -8
- package/dist/automation/actions/interaction/get/MOB_GetHeightOfElement.js +12 -11
- package/dist/automation/actions/interaction/get/MOB_GetHeightOfScreen.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetHourFromCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetLatitude.js +20 -12
- package/dist/automation/actions/interaction/get/MOB_GetLongitude.js +20 -12
- package/dist/automation/actions/interaction/get/MOB_GetMinuteFromCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetSecondFromCurrentDeviceTime.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetSizeOfScreen.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetSupportedPerformanceDataTypes.js +4 -6
- package/dist/automation/actions/interaction/get/MOB_GetTextFromElementAndSetToClipBoard.js +11 -8
- package/dist/automation/actions/interaction/get/MOB_GetWidthOfElement.js +12 -11
- package/dist/automation/actions/interaction/get/MOB_GetWidthOfScreen.js +4 -6
- package/dist/automation/actions/interaction/get/browserWindowGetPosition.js +4 -4
- package/dist/automation/actions/interaction/get/getAllBrokenImages.js +4 -4
- package/dist/automation/actions/interaction/get/getAllBrokenLinkCount.js +4 -4
- package/dist/automation/actions/interaction/get/getAllBrokenLinks.js +5 -5
- package/dist/automation/actions/interaction/get/getAllConsoleErrors.js +4 -4
- package/dist/automation/actions/interaction/get/getAllConsoleInformation.js +5 -5
- package/dist/automation/actions/interaction/get/getAllConsoleLogs.js +5 -5
- package/dist/automation/actions/interaction/get/getAllConsoleWarnings.js +5 -5
- package/dist/automation/actions/interaction/get/getAllCookieNames.js +5 -5
- package/dist/automation/actions/interaction/get/getAllCookieValues.js +5 -5
- package/dist/automation/actions/interaction/get/getAllSelectedOptions.js +12 -12
- package/dist/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsText.js +12 -12
- package/dist/automation/actions/interaction/get/getAllTheOptionsFromListBoxAsTextInSortedOrder.js +12 -12
- package/dist/automation/actions/interaction/get/getAllTheSelectedOptionsFromListBoxAsText.js +12 -12
- package/dist/automation/actions/interaction/get/getAllWindowHandles.js +5 -5
- package/dist/automation/actions/interaction/get/getAttribute.js +27 -25
- package/dist/automation/actions/interaction/get/getAudioCurrentPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioCurrentSeekTime.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioCurrentVolume.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioDecodedByte.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioDefaultPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioMediaLength.js +12 -12
- package/dist/automation/actions/interaction/get/getAudioMediaSource.js +12 -12
- package/dist/automation/actions/interaction/get/getBestPracticesScore.js +4 -3
- package/dist/automation/actions/interaction/get/getBrowserCount.js +4 -4
- package/dist/automation/actions/interaction/get/getBrowserVersion.js +4 -4
- package/dist/automation/actions/interaction/get/getCapabilityNames.js +4 -4
- package/dist/automation/actions/interaction/get/getClipBoardText.js +4 -4
- package/dist/automation/actions/interaction/get/getCollectiveApiResponseTime.js +5 -4
- package/dist/automation/actions/interaction/get/getCollectiveApiStatusCode.js +5 -4
- package/dist/automation/actions/interaction/get/getCssValue.js +12 -12
- package/dist/automation/actions/interaction/get/getCurrentDayOfTheWeek.js +4 -4
- package/dist/automation/actions/interaction/get/getCurrentSecondsFromCurrentSystemTime.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemDate.js +4 -4
- package/dist/automation/actions/interaction/get/getCurrentSystemDay.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemMonth.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemTime.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentSystemYear.js +5 -5
- package/dist/automation/actions/interaction/get/getCurrentWindowHandle.js +9 -10
- package/dist/automation/actions/interaction/get/getDataFromApiRequestHeaderForJsonPath.js +5 -4
- package/dist/automation/actions/interaction/get/getDataFromApiResponseForJsonPath.js +5 -4
- package/dist/automation/actions/interaction/get/getDateWithGivenFormat.js +5 -4
- package/dist/automation/actions/interaction/get/getDriverInstance.js +12 -11
- package/dist/automation/actions/interaction/get/getFirstContentfulPaint.js +5 -5
- package/dist/automation/actions/interaction/get/getFirstSelectedOption.js +12 -12
- package/dist/automation/actions/interaction/get/getFullPaintTime.js +5 -5
- package/dist/automation/actions/interaction/get/getHTMLCodeOfPage.js +4 -4
- package/dist/automation/actions/interaction/get/getHeightOfBrowserWindow.js +4 -4
- package/dist/automation/actions/interaction/get/getHeightOfWebElement.js +12 -12
- package/dist/automation/actions/interaction/get/getHourFromCurrentSystemTime.js +4 -4
- package/dist/automation/actions/interaction/get/getImplicitTimeOut.js +11 -10
- package/dist/automation/actions/interaction/get/getLargestContentfulPaint.js +4 -4
- package/dist/automation/actions/interaction/get/getListBoxSize.js +12 -12
- package/dist/automation/actions/interaction/get/getListOfElementsFromLocatorTypeLocatorValue.js +90 -44
- package/dist/automation/actions/interaction/get/getLocation.js +32 -31
- package/dist/automation/actions/interaction/get/getMinuteFromCurrentSystemTime.js +4 -4
- package/dist/automation/actions/interaction/get/getNetworkRouteTime.js +4 -4
- package/dist/automation/actions/interaction/get/getNumberOfBrokenImages.js +4 -4
- package/dist/automation/actions/interaction/get/getNumberOfLinksPresentInCurrentPage.js +4 -4
- package/dist/automation/actions/interaction/get/getNumberOfWorkingLinksFromCurrentPage.js +4 -4
- package/dist/automation/actions/interaction/get/getOptions.js +12 -12
- package/dist/automation/actions/interaction/get/getPageTitle.js +5 -5
- package/dist/automation/actions/interaction/get/getPerformanceMetrics.js +5 -5
- package/dist/automation/actions/interaction/get/getPwaScore.js +5 -4
- package/dist/automation/actions/interaction/get/getRect.js +26 -23
- package/dist/automation/actions/interaction/get/getScreenshot.js +12 -18
- package/dist/automation/actions/interaction/get/getScreenshotAs.js +27 -32
- package/dist/automation/actions/interaction/get/getSeoScore.js +5 -4
- package/dist/automation/actions/interaction/get/getSingleApiRequestPayload.js +7 -6
- package/dist/automation/actions/interaction/get/getSingleApiResponse.js +12 -14
- package/dist/automation/actions/interaction/get/getSingleApiResponseTime.js +13 -13
- package/dist/automation/actions/interaction/get/getSingleApiStatusCode.d.ts +1 -1
- package/dist/automation/actions/interaction/get/getSingleApiStatusCode.js +21 -17
- package/dist/automation/actions/interaction/get/getSize.js +26 -24
- package/dist/automation/actions/interaction/get/getSizeOfBrowserWindow.js +5 -5
- package/dist/automation/actions/interaction/get/getStringDataFromLocalFile.js +11 -13
- package/dist/automation/actions/interaction/get/getSystemProperty.js +7 -33
- package/dist/automation/actions/interaction/get/getTagName.js +26 -24
- package/dist/automation/actions/interaction/get/getText.js +28 -25
- package/dist/automation/actions/interaction/get/getTheFirstSelectedOptionFromListBoxAsText.js +12 -12
- package/dist/automation/actions/interaction/get/getTotalNumberOfCookies.js +5 -5
- package/dist/automation/actions/interaction/get/getTunnelIdentifier.js +5 -4
- package/dist/automation/actions/interaction/get/getURLPresentInAddressBar.js +5 -5
- package/dist/automation/actions/interaction/get/getUserHomeDirectory.js +5 -5
- package/dist/automation/actions/interaction/get/getValueByCookieName.js +7 -11
- package/dist/automation/actions/interaction/get/getValueFromLocalStorage.js +7 -10
- package/dist/automation/actions/interaction/get/getValueOfSystemVariable.js +8 -6
- package/dist/automation/actions/interaction/get/getVideoCurrentPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoCurrentSeekTime.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoCurrentVolume.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoDecodedByte.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoDefaultPlaybackRate.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoMediaLength.js +12 -12
- package/dist/automation/actions/interaction/get/getVideoMediaSource.js +12 -12
- package/dist/automation/actions/interaction/get/getWidthOfBrowser.js +5 -5
- package/dist/automation/actions/interaction/get/getWidthOfWebElement.js +12 -12
- package/dist/automation/actions/interaction/get/getWorkingLinksFromCurrentPage.js +5 -5
- package/dist/automation/actions/interaction/get/getWrappedElement.js +12 -12
- package/dist/automation/actions/interaction/get/getWrappedOptionFromListBoxAsText.js +14 -14
- package/dist/automation/actions/interaction/get/getXLocationOfBrowserWindow.js +5 -4
- package/dist/automation/actions/interaction/get/getXLocationOfWebElement.js +26 -24
- package/dist/automation/actions/interaction/get/getYLocationOfBrowserWindow.js +5 -5
- package/dist/automation/actions/interaction/get/getYLocationOfWebElement.js +26 -24
- package/dist/automation/actions/interaction/iframe/switchToDefaultContent.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/AirplaneModeSwitchOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/AirplaneModeSwitchOn.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/Break.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/Continue.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/GpsSwitchOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/GpsSwitchOn.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/HideKeyboard.js +13 -7
- package/dist/automation/actions/interaction/inputlessActions/LockDevice.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/OpenChromeBrowser.js +18 -6
- package/dist/automation/actions/interaction/inputlessActions/OpenNotification.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/ResetApp.js +14 -7
- package/dist/automation/actions/interaction/inputlessActions/RestartCurrentDevice.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetDeviceOrientationAsLandscape.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetDeviceOrientationAsPortrait.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetEmulatorPowerStateOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/SetEmulatorPowerStateOn.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/WifiSwitchOff.js +5 -5
- package/dist/automation/actions/interaction/inputlessActions/WifiSwitchOn.js +5 -5
- package/dist/automation/actions/interaction/maximize/maximize.js +5 -5
- package/dist/automation/actions/interaction/maximize/minimize.js +5 -5
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorNTImes.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorNTImes.js +31 -0
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorPoint.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseClickOnCurrentCursorPoint.js +27 -0
- package/dist/automation/actions/interaction/mouse/mouseDoubleClickAtCursorPoint.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseDoubleClickAtCursorPoint.js +31 -0
- package/dist/automation/actions/interaction/mouse/mouseHover.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseHover.js +36 -0
- package/dist/automation/actions/interaction/mouse/mouseReleaseLeftMouseButton.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/mouseReleaseLeftMouseButton.js +42 -0
- package/dist/automation/actions/interaction/mouse/pressAndHold.d.ts +2 -0
- package/dist/automation/actions/interaction/mouse/pressAndHold.js +47 -0
- package/dist/automation/actions/interaction/navigation/goBack.js +5 -5
- package/dist/automation/actions/interaction/navigation/navigate.js +5 -4
- package/dist/automation/actions/interaction/navigation/refresh.js +5 -5
- package/dist/automation/actions/interaction/pinch/PinchInByPercentMob.js +12 -13
- package/dist/automation/actions/interaction/pinch/PinchOutByPercentMob.js +12 -11
- package/dist/automation/actions/interaction/press/longPress.js +15 -11
- package/dist/automation/actions/interaction/press/mobPressBackKey.js +4 -6
- package/dist/automation/actions/interaction/press/mobPressBackSpaceKey.js +12 -8
- package/dist/automation/actions/interaction/press/mobPressSpaceKey.js +12 -8
- package/dist/automation/actions/interaction/press/pressAnyKey.js +25 -16
- package/dist/automation/actions/interaction/press/pressAnyKeyNTimes.js +23 -14
- package/dist/automation/actions/interaction/press/pressEnterKey.js +21 -14
- package/dist/automation/actions/interaction/press/pressHomeKey.js +16 -9
- package/dist/automation/actions/interaction/scroll/scrollHorizontallyTillElementIsVisible.js +20 -15
- package/dist/automation/actions/interaction/scroll/scrollPageToSpecificLocation.js +8 -7
- package/dist/automation/actions/interaction/scroll/scrollToElement.js +18 -13
- package/dist/automation/actions/interaction/scroll/scrollVerticallyTillElementIsVisible.js +20 -15
- package/dist/automation/actions/interaction/set/MOB_SetContext.js +5 -6
- package/dist/automation/actions/interaction/set/MOB_SetEmulatorPowerPercentage.js +5 -6
- package/dist/automation/actions/interaction/set/setClipBoardText.js +13 -13
- package/dist/automation/actions/interaction/shadowDom/shadowDomClick.js +5 -4
- package/dist/automation/actions/interaction/shadowDom/shadowDomEnter.js +5 -4
- package/dist/automation/actions/interaction/shadowDom/shadowDomGetText.js +6 -5
- package/dist/automation/actions/interaction/shadowDom/shadowDomUpload.js +13 -9
- package/dist/automation/actions/interaction/shadowDom/shadowDomVerifyPartialText.js +6 -5
- package/dist/automation/actions/interaction/shadowDom/shadowDomVerifyText.js +6 -5
- package/dist/automation/actions/interaction/swipe/swipeDirectionNTimes.js +12 -10
- package/dist/automation/actions/interaction/swipe/swipeDownToElement.js +13 -10
- package/dist/automation/actions/interaction/swipe/swipeIos.d.ts +2 -0
- package/dist/automation/actions/interaction/swipe/swipeIos.js +52 -0
- package/dist/automation/actions/interaction/swipe/swipeLeftToElement.js +16 -11
- package/dist/automation/actions/interaction/swipe/swipeRightToElement.js +15 -10
- package/dist/automation/actions/interaction/swipe/swipeUpToElement.js +12 -10
- package/dist/automation/actions/interaction/swipe/swipeUpToElementForMWeb.js +16 -13
- package/dist/automation/actions/interaction/swipe/swipeUsingReferenceElement.js +19 -16
- package/dist/automation/actions/interaction/switch/switchToNewTabBasedOnTitle.js +7 -6
- package/dist/automation/actions/interaction/switch/switchToNewWindowBasedOnTitle.js +6 -5
- package/dist/automation/actions/interaction/switch/switchToParentWindow.js +6 -6
- package/dist/automation/actions/interaction/switch/switchToTabBasedOnUrl.js +6 -5
- package/dist/automation/actions/interaction/switch/switchToWindowBasedOnURL.js +5 -4
- package/dist/automation/actions/interaction/switch/switchToWindowIfTitleContainsString.js +7 -6
- package/dist/automation/actions/interaction/switch/switchToWindowIfUrlContainsString.js +6 -5
- package/dist/automation/actions/interaction/upload/uploadfile.js +21 -18
- package/dist/automation/actions/interaction/verify/MOB_VerifyBatteryLevel.js +8 -8
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfAirplaneModeOff.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfAirplaneModeOn.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfAppIsClosed.js +19 -10
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfDeviceIsLocked.js +7 -6
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfDeviceIsUnlocked.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfGpsOff.js +12 -8
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfGpsOn.js +12 -8
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfKeyboardIsHidden.js +7 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfKeyboardIsShown.js +8 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfWifiOff.js +8 -7
- package/dist/automation/actions/interaction/verify/MOB_VerifyIfWifiOn.js +8 -7
- package/dist/automation/actions/interaction/verify/VerifyAccessibilityScore.js +8 -7
- package/dist/automation/actions/interaction/verify/VerifyAllBrokenImages.js +6 -6
- package/dist/automation/actions/interaction/verify/VerifyAllBrowserWindowsClosed.js +12 -10
- package/dist/automation/actions/interaction/verify/VerifyAllOptionsAreDeSelected.js +19 -19
- package/dist/automation/actions/interaction/verify/VerifyAllOptionsAreSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyAttributeValue.js +35 -53
- package/dist/automation/actions/interaction/verify/VerifyBestPracticesScore.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserHtmlCodeContainsString.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowHeight.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowTitleContainsString.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowTitleIsString.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowUrlContainsExpectedUrl.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowUrlIsString.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowWidth.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowXLocation.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyBrowserWindowYLocation.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyCheckBoxIsNotSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyCheckBoxIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyCssAttributeValue.js +20 -14
- package/dist/automation/actions/interaction/verify/VerifyElementIsClickable.js +28 -25
- package/dist/automation/actions/interaction/verify/VerifyElementIsDisabled.js +29 -27
- package/dist/automation/actions/interaction/verify/VerifyElementIsDisplayed.js +26 -24
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabled.js +26 -24
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabledInSpecifiedTime.d.ts +2 -0
- package/dist/automation/actions/interaction/verify/VerifyElementIsEnabledInSpecifiedTime.js +84 -0
- package/dist/automation/actions/interaction/verify/VerifyElementIsNotDisplayed.js +51 -28
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelected.js +39 -27
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelectedInSpecifiedTime.d.ts +2 -0
- package/dist/automation/actions/interaction/verify/VerifyElementIsSelectedInSpecifiedTime.js +83 -0
- package/dist/automation/actions/interaction/verify/VerifyElementNotContainsText.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyHeightOfWebElement.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyHexCodeForGivenXYCoordinates.js +44 -14
- package/dist/automation/actions/interaction/verify/VerifyIfAllCookiesAreDeleted.js +4 -4
- package/dist/automation/actions/interaction/verify/VerifyIfAudioEnded.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfAudioIsMuted.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfAudioIsPaused.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfAudioIsPlaying.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfBrowserWindowIsClosed.js +8 -9
- package/dist/automation/actions/interaction/verify/VerifyIfCookieNameIsAdded.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfCookieNameIsDeleted.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyIfCookieObjectIsPresent.js +5 -5
- package/dist/automation/actions/interaction/verify/VerifyIfGivenOptionIsDuplicate.js +14 -14
- package/dist/automation/actions/interaction/verify/VerifyIfImageIsBroken.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfLinkIsBroken.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfLinkIsWorking.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyIfLinksAreBroken.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyIfLinksAreWorking.js +5 -4
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsDeselectedInElement.js +13 -13
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithIndexIsSelectedInListBox.js +13 -13
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithTextIsDeselected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithValueIsDeselected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithValueIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfOptionWithVisibleTextIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfSpecifiedOptionIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfStatusCodeOfALinkIsStatusCode.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyIfStatusCodesOfLinks.js +30 -22
- package/dist/automation/actions/interaction/verify/VerifyIfVideoEnded.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoIsMuted.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoIsPaused.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoIsPlaying.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoPlayingInMute.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfVideoPlayingInUnmute.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyIfXAndYCoordinateOfElement.js +25 -23
- package/dist/automation/actions/interaction/verify/VerifyLinkNavigatesToTitle.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyListBoxOptionsAreSorted.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyNavigateURL.js +42 -14
- package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByTagName.js +7 -5
- package/dist/automation/actions/interaction/verify/VerifyNumberOfElementsByXpath.js +13 -7
- package/dist/automation/actions/interaction/verify/VerifyPartialAttributeValue.js +33 -42
- package/dist/automation/actions/interaction/verify/VerifyPartialTitleOfCurrentPage.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyPerformanceScore.js +7 -6
- package/dist/automation/actions/interaction/verify/VerifyPwaScore.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyRadioButtonIsNotSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyRadioButtonIsSelected.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifySeoScore.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyTagName.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyThatSpecifiedOptionIsNotSelected.js +20 -31
- package/dist/automation/actions/interaction/verify/VerifyTitleInAllPage.js +8 -7
- package/dist/automation/actions/interaction/verify/VerifyTitleOfCurrentPage.js +6 -5
- package/dist/automation/actions/interaction/verify/VerifyValueOfElementContainsString.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyValueOfElementIsCleared.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyValueOfElementIsString.js +12 -12
- package/dist/automation/actions/interaction/verify/VerifyWidthOfElement.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyXLocationOfElement.js +23 -23
- package/dist/automation/actions/interaction/verify/VerifyYLocationOfElement.js +26 -23
- package/dist/automation/actions/interaction/verify/checkIfElementIsDisplayed.js +26 -22
- package/dist/automation/actions/interaction/verify/verifyElementIsDisplayedWithinSpecifiedTime.d.ts +2 -0
- package/dist/automation/actions/interaction/verify/verifyElementIsDisplayedWithinSpecifiedTime.js +85 -0
- package/dist/automation/actions/interaction/verify/verifypartialtext.js +28 -25
- package/dist/automation/actions/interaction/verify/verifytext.js +30 -30
- package/dist/automation/actions/interaction/wait/MOB_WaitTillAllElementsAreInvisible.ts.js +5 -6
- package/dist/automation/actions/interaction/wait/MOB_WaitTillAttributeOfElementContainsString.js +17 -14
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsEnabled.js +12 -11
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsInvisible.js +14 -12
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsSelected.js +12 -11
- package/dist/automation/actions/interaction/wait/MOB_WaitTillElementIsVisible.js +15 -13
- package/dist/automation/actions/interaction/wait/MOB_WaitTillStalenessOfElement.js +12 -11
- package/dist/automation/actions/interaction/wait/wait.js +5 -4
- package/dist/automation/actions/interaction/wait/waitTillAttributeOfElementIsString.js +26 -24
- package/dist/automation/actions/interaction/wait/waitTillElementContainsText.js +26 -24
- package/dist/automation/actions/interaction/wait/waitTillElementHasText.js +26 -24
- package/dist/automation/actions/interaction/wait/waitTillElementIsClickable.js +28 -25
- package/dist/automation/actions/interaction/wait/waitTillPresenceOfAllElements.js +32 -22
- package/dist/automation/actions/interaction/wait/waitTillPresenceOfElement.js +26 -24
- package/dist/automation/actions/interface/FireFlinkResponseSchema.d.ts +160 -0
- package/dist/automation/actions/interface/FireFlinkResponseSchema.js +225 -0
- package/dist/automation/actions/interface/alertActionInterface.d.ts +1 -0
- package/dist/automation/actions/interface/findActionInterface.d.ts +3 -0
- package/dist/automation/actions/interface/getActionInterface.d.ts +76 -66
- package/dist/automation/actions/interface/getOtpInterface.d.ts +15 -0
- package/dist/automation/actions/interface/getOtpInterface.js +2 -0
- package/dist/automation/actions/interface/interactionActionInterface.d.ts +5 -0
- package/dist/automation/actions/interface/mouseActionsinterface.d.ts +51 -0
- package/dist/automation/actions/interface/mouseActionsinterface.js +2 -0
- package/dist/automation/actions/interface/pinchActionInterface.d.ts +7 -0
- package/dist/automation/actions/interface/pressActionInterface.d.ts +4 -0
- package/dist/automation/actions/interface/swipeActionInterface.d.ts +25 -10
- package/dist/automation/actions/interface/verifyActionInterface.d.ts +36 -0
- package/dist/automation/actions/interface/waitActionInterface.d.ts +19 -0
- package/dist/automation/browserSession/initiateBrowserSession.d.ts +1 -1
- package/dist/automation/browserSession/initiateBrowserSession.js +15 -7
- package/dist/automation/cloudSession/initiateCloudSession.js +3 -1
- package/dist/automation/driverState.d.ts +2 -0
- package/dist/automation/driverState.js +4 -0
- package/dist/automation/mobileSession/initiateMobileSession.d.ts +28 -5
- package/dist/automation/mobileSession/initiateMobileSession.js +100 -23
- package/dist/core/constants/allAction.js +6 -1
- package/dist/core/constants/supportedActions.d.ts +1 -0
- package/dist/core/constants/supportedActions.js +19 -8
- package/dist/core/interfaces/actionInterface.d.ts +38 -33
- package/dist/core/interfaces/browserConfigurationInterface.d.ts +0 -4
- package/dist/core/interfaces/browserConfigurationInterface.js +0 -1
- package/dist/core/interfaces/executionDetails.d.ts +6 -3
- package/dist/core/interfaces/fireflinkScriptPayloadInterface.d.ts +26 -17
- package/dist/core/interfaces/llmConfigurationInterface.d.ts +3 -2
- package/dist/core/interfaces/llmResponseInterface.d.ts +11 -10
- package/dist/core/interfaces/promptInterface.d.ts +1 -0
- package/dist/core/interfaces/scriptGenrationDataInterface.d.ts +14 -0
- package/dist/core/interfaces/simplifyAndFlattenInterface.d.ts +5 -0
- package/dist/core/main/SessionManager.d.ts +9 -0
- package/dist/core/main/SessionManager.js +23 -0
- package/dist/core/main/actionHandlerFactory.js +353 -86
- package/dist/core/main/executionContext.d.ts +8 -2
- package/dist/core/main/executionContext.js +94 -4
- package/dist/core/main/runAutomationScript.d.ts +2 -0
- package/dist/core/main/runAutomationScript.js +1003 -276
- package/dist/core/main/stepProcessor.d.ts +2 -1
- package/dist/core/main/stepProcessor.js +8 -3
- package/dist/core/types/browserType.d.ts +3 -3
- package/dist/core/types/browserType.js +2 -2
- package/dist/core/types/messageType.d.ts +13 -0
- package/dist/core/types/messageType.js +15 -0
- package/dist/core/types/promptType.d.ts +2 -1
- package/dist/core/types/promptType.js +1 -0
- package/dist/core/types/scriptTypesType.d.ts +1 -1
- package/dist/core/types/visionllmInputType.d.ts +4 -5
- package/dist/domAnalysis/getRelaventElements.d.ts +5 -1
- package/dist/domAnalysis/getRelaventElements.js +14 -5
- package/dist/domAnalysis/relativeElementsFromDom.d.ts +2 -1
- package/dist/domAnalysis/relativeElementsFromDom.js +66 -1
- package/dist/domAnalysis/searchBest.d.ts +5 -1
- package/dist/domAnalysis/searchBest.js +160 -58
- package/dist/domAnalysis/simplifyAndFlatten.d.ts +3 -2
- package/dist/domAnalysis/simplifyAndFlatten.js +114 -19
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.d.ts +3 -0
- package/dist/fireflinkData/fireflinkLocators/getListOfLocators.js +26 -12
- package/dist/fireflinkData/fireflinkLocators/{elementsFromHTML.d.ts → parser/getElementsFromHTML.d.ts} +5 -11
- package/dist/fireflinkData/fireflinkLocators/parser/getElementsFromHTML.js +573 -0
- package/dist/fireflinkData/fireflinkLocators/types/locator.d.ts +27 -0
- package/dist/fireflinkData/fireflinkLocators/types/locator.js +2 -0
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.d.ts +2 -0
- package/dist/fireflinkData/fireflinkLocators/utils/androidSelector.js +57 -0
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.d.ts +19 -0
- package/dist/fireflinkData/fireflinkLocators/utils/cssSelector.js +189 -0
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.d.ts +2 -0
- package/dist/fireflinkData/fireflinkLocators/utils/iosSelector.js +183 -0
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.d.ts +35 -0
- package/dist/fireflinkData/fireflinkLocators/utils/referenceXpath.js +513 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.d.ts +29 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpath.js +710 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.d.ts +135 -0
- package/dist/fireflinkData/fireflinkLocators/utils/xpathHelpers.js +1628 -0
- package/dist/fireflinkData/fireflinkScript/appendScriptData.d.ts +2 -0
- package/dist/fireflinkData/fireflinkScript/appendScriptData.js +48 -0
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.d.ts +2 -2
- package/dist/fireflinkData/fireflinkScript/scriptGenrationData.js +18 -24
- package/dist/imageAnalysisMobile/annotatedScreenshotMobile.d.ts +4 -0
- package/dist/imageAnalysisMobile/annotatedScreenshotMobile.js +115 -7
- package/dist/imageAnalysisWeb/annotateScreenshot.js +4 -4
- package/dist/imageAnalysisWeb/generateAnnotatedScreenshots.d.ts +4 -1
- package/dist/imageAnalysisWeb/generateAnnotatedScreenshots.js +15 -17
- package/dist/llmConfig/llmConfiguration.d.ts +4 -3
- package/dist/llmConfig/llmConfiguration.js +48 -18
- package/dist/service/api/fireflinkApi.service.d.ts +1 -1
- package/dist/service/api/fireflinkApi.service.js +1 -2
- package/dist/service/fireflink.service.d.ts +3 -3
- package/dist/service/fireflink.service.js +24 -22
- package/dist/service/kafka/fireflinkKafka.service.d.ts +1 -2
- package/dist/service/kafka/fireflinkKafka.service.js +6 -4
- package/dist/tests/poc.d.ts +0 -1
- package/dist/tests/poc.js +211 -226
- package/dist/tests/test.d.ts +1 -0
- package/dist/tests/test.js +26 -0
- package/dist/tests/test12.d.ts +0 -1
- package/dist/tests/test12.js +65 -467
- package/dist/tests/testkaf.d.ts +0 -1
- package/dist/tests/testkaf.js +51 -55
- package/dist/tests/testss.d.ts +1 -0
- package/dist/tests/testss.js +23 -0
- package/dist/utils/DomExtraction/jsForAttributeInjection.d.ts +2 -0
- package/dist/utils/DomExtraction/jsForAttributeInjection.js +220 -8
- package/dist/utils/InstancesDetails/getInstancesInfo.d.ts +26 -1
- package/dist/utils/InstancesDetails/getInstancesInfo.js +11 -5
- package/dist/utils/browserCap/capability.d.ts +14 -10
- package/dist/utils/browserCap/capability.js +97 -16
- package/dist/utils/frameWorkDetector/frameWorkDetector.d.ts +6 -0
- package/dist/utils/frameWorkDetector/frameWorkDetector.js +43 -0
- package/dist/utils/frameWorkDetector/frameWorkDetectorInterface.d.ts +10 -0
- package/dist/utils/frameWorkDetector/frameWorkDetectorInterface.js +2 -0
- package/dist/utils/helpers/domSanitizer.d.ts +1 -0
- package/dist/utils/helpers/domSanitizer.js +9 -0
- package/dist/utils/helpers/enterActionHelper.d.ts +1 -0
- package/dist/utils/helpers/enterActionHelper.js +25 -5
- package/dist/utils/helpers/platformContext.d.ts +3 -0
- package/dist/utils/helpers/platformContext.js +11 -0
- package/dist/utils/helpers/platformSyntax.d.ts +1 -0
- package/dist/utils/helpers/platformSyntax.js +17 -0
- package/dist/utils/helpers/sameActionsHelper.js +7 -2
- package/dist/utils/helpers/xpathcreation.d.ts +5 -1
- package/dist/utils/helpers/xpathcreation.js +44 -5
- package/dist/utils/iframesExtraction/findElementUsingFF.js +12 -9
- package/dist/utils/iframesExtraction/iframeInterface.d.ts +4 -0
- package/dist/utils/javascript/jsFindElement.d.ts +1 -1
- package/dist/utils/javascript/jsFindElement.js +2 -2
- package/dist/utils/javascript/jsForShadowRoot.d.ts +1 -1
- package/dist/utils/javascript/jsForShadowRoot.js +4 -0
- package/dist/utils/javascript/jsForVision.d.ts +2 -2
- package/dist/utils/javascript/jsForVision.js +17 -5
- package/dist/utils/logger/logData.d.ts +1 -0
- package/dist/utils/logger/logData.js +19 -0
- package/dist/utils/newTab/newTabTracker.js +18 -6
- package/dist/utils/sslConfig/apiCallPatch.d.ts +1 -0
- package/dist/utils/sslConfig/apiCallPatch.js +33 -0
- package/dist/utils/sslConfig/getSecureAgent.d.ts +2 -0
- package/dist/utils/sslConfig/getSecureAgent.js +30 -0
- package/dist/utils/swipe/domSearchHelper.d.ts +1 -1
- package/dist/utils/swipe/domSearchHelper.js +43 -42
- package/dist/utils/swipe/swipeMovement.js +28 -19
- package/dist/utils/workers/LocatorWorkerInterface.d.ts +22 -0
- package/dist/utils/workers/LocatorWorkerInterface.js +2 -0
- package/dist/utils/workers/LocatorWorkerPool.d.ts +13 -0
- package/dist/utils/workers/LocatorWorkerPool.js +89 -0
- package/dist/utils/workers/locatorWorker.d.ts +1 -0
- package/dist/utils/workers/locatorWorker.js +44 -0
- package/package.json +23 -6
- package/dist/automation/actions/interaction/get/getAudioDimension.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getAudioDimension.js +0 -34
- package/dist/automation/actions/interaction/get/getAudioHeight.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getAudioHeight.js +0 -30
- package/dist/automation/actions/interaction/get/getAudioWidth.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getAudioWidth.js +0 -30
- package/dist/automation/actions/interaction/get/getVideoDimension.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getVideoDimension.js +0 -31
- package/dist/automation/actions/interaction/get/getVideoHeight.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getVideoHeight.js +0 -28
- package/dist/automation/actions/interaction/get/getVideoWidth.d.ts +0 -2
- package/dist/automation/actions/interaction/get/getVideoWidth.js +0 -28
- package/dist/fireflinkData/fireflinkLocators/elementsFromHTML.js +0 -514
- package/dist/fireflinkData/fireflinkLocators/typeList.d.ts +0 -1
- package/dist/fireflinkData/fireflinkLocators/typeList.js +0 -33
|
@@ -2,15 +2,20 @@ import { FireFlinkLLMResponse } from "../../core/types/llmResponseType.js";
|
|
|
2
2
|
import { PromptArgsMap } from "../../core/interfaces/promptInterface.js";
|
|
3
3
|
import { platform } from "../../core/types/scriptTypesType.js";
|
|
4
4
|
export declare class llmAction {
|
|
5
|
-
private client;
|
|
6
|
-
private visionClient;
|
|
7
5
|
private model;
|
|
8
6
|
private visionApiKey;
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
private apiKey;
|
|
8
|
+
private provider;
|
|
9
|
+
private serviceProvider;
|
|
10
|
+
private visionProvider;
|
|
11
|
+
constructor(apiKey: string, provider: any, model: string, visionApiKey: string, accountType: string, enterpriseConfigFile: any, serviceProvider: string);
|
|
12
|
+
getLLMResponse<K extends keyof PromptArgsMap>(platform: platform, type: K, args: PromptArgsMap[K], userInput: Record<string, any>, isVision: boolean): Promise<FireFlinkLLMResponse>;
|
|
11
13
|
private getLLMResponseText;
|
|
14
|
+
private getProviderToUse;
|
|
12
15
|
private getLLMResponseWithVision;
|
|
13
16
|
private isInvalidLLMOutput;
|
|
14
17
|
private handleKnownErrors;
|
|
15
18
|
private buildRetryFailure;
|
|
19
|
+
private extractValidatedJson;
|
|
20
|
+
private getProviderOptions;
|
|
16
21
|
}
|
|
@@ -1,65 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.llmAction = void 0;
|
|
7
4
|
const promptRegistry_js_1 = require("../llmprompts/promptRegistry.js");
|
|
8
|
-
const openai_1 = __importDefault(require("openai"));
|
|
9
|
-
const decodeApiKey_js_1 = require("./decodeApiKey.js");
|
|
10
5
|
const userPrompt_js_1 = require("../../ai/llmprompts/userPrompts/userPrompt.js");
|
|
11
6
|
const promptType_js_1 = require("../../core/types/promptType.js");
|
|
12
7
|
const logData_js_1 = require("../../utils/logger/logData.js");
|
|
8
|
+
const ai_1 = require("ai");
|
|
9
|
+
const FireFlinkResponseSchema_js_1 = require("../../automation/actions/interface/FireFlinkResponseSchema.js");
|
|
10
|
+
const llmConfiguration_js_1 = require("../../llmConfig/llmConfiguration.js");
|
|
13
11
|
class llmAction {
|
|
14
|
-
constructor(apiKey,
|
|
15
|
-
this.
|
|
12
|
+
constructor(apiKey, provider, model, visionApiKey, accountType, enterpriseConfigFile, serviceProvider) {
|
|
13
|
+
this.apiKey = apiKey;
|
|
14
|
+
this.provider = provider;
|
|
15
|
+
this.serviceProvider = serviceProvider;
|
|
16
|
+
if (model.startsWith("publishers/google/models/")) {
|
|
17
|
+
this.model = `${model.split("/").pop()}`;
|
|
18
|
+
}
|
|
19
|
+
else if (model.startsWith("publishers/meta/models/")) {
|
|
20
|
+
this.model = `${model.split("/").pop()}`;
|
|
21
|
+
}
|
|
22
|
+
else if (model.startsWith("models/")) {
|
|
23
|
+
this.model = model.split("/").pop();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.model = model;
|
|
27
|
+
}
|
|
16
28
|
this.visionApiKey = visionApiKey;
|
|
17
|
-
this.client = new openai_1.default({
|
|
18
|
-
apiKey: (0, decodeApiKey_js_1.decodeApiKey)(apiKey),
|
|
19
|
-
baseURL: baseURL,
|
|
20
|
-
});
|
|
21
|
-
this.visionClient = new openai_1.default({
|
|
22
|
-
apiKey: (0, decodeApiKey_js_1.decodeApiKey)(this.visionApiKey ?? "c2stcHJvai1HVTVlZGt4UDJEQXVBa29IbzB0MXdsTWFrWjljNnlQQjEtdUdGLXloZmhIclhEYnZubHo0M0l4QUoyME5Pc0hGYUw2OUFkdG5kOVQzQmxia0ZKQzUxTFJZX09aQzNzRHBOYjN5XzM5SUY4UXpBZElSU2ZBQ21wZjRtZG1OUzBlWXRhUjhudGhWdUktb2djeVBSMW1PdVpEdU83UUE="),
|
|
23
|
-
});
|
|
24
29
|
}
|
|
25
|
-
async getLLMResponse(platform, type, args, userInput) {
|
|
30
|
+
async getLLMResponse(platform, type, args, userInput, isVision) {
|
|
26
31
|
const promptBuilder = promptRegistry_js_1.prompts[platform][type];
|
|
27
32
|
const systemPrompt = await promptBuilder(args);
|
|
28
33
|
const userPrompt = userPrompt_js_1.userInputFormatters[type](userInput);
|
|
29
34
|
if (type === promptType_js_1.PromptType.VISION_PROMPT && Array.isArray(userPrompt)) {
|
|
30
|
-
return this.getLLMResponseWithVision(systemPrompt, userPrompt);
|
|
35
|
+
return this.getLLMResponseWithVision(systemPrompt, userPrompt, isVision);
|
|
31
36
|
}
|
|
32
37
|
if (typeof userPrompt !== "string") {
|
|
33
38
|
throw new Error("Invalid non-vision user prompt format");
|
|
34
39
|
}
|
|
35
|
-
return this.getLLMResponseText(systemPrompt, userPrompt);
|
|
40
|
+
return this.getLLMResponseText(platform, systemPrompt, userPrompt, type, args);
|
|
36
41
|
}
|
|
37
|
-
async getLLMResponseText(system, user) {
|
|
42
|
+
async getLLMResponseText(platform, system, user, type, args) {
|
|
38
43
|
let attempt = 0;
|
|
39
44
|
const MAX_RETRIES = 5;
|
|
40
|
-
|
|
45
|
+
const startTime = new Date().getTime();
|
|
46
|
+
const schemaToUse = (0, FireFlinkResponseSchema_js_1.getSchemaForPrompt)(type, platform, args);
|
|
47
|
+
let modelInstance;
|
|
48
|
+
if (this.serviceProvider === "Groq" || this.serviceProvider === "DefaultFireFlink") {
|
|
49
|
+
modelInstance = this.provider.responses(this.model);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
modelInstance = this.provider(this.model);
|
|
53
|
+
}
|
|
41
54
|
while (attempt < MAX_RETRIES) {
|
|
42
55
|
attempt++;
|
|
43
56
|
try {
|
|
44
|
-
const response = await
|
|
45
|
-
model:
|
|
57
|
+
const response = await (0, ai_1.generateText)({
|
|
58
|
+
model: modelInstance,
|
|
46
59
|
messages: [
|
|
47
60
|
{ role: "system", content: system },
|
|
48
61
|
{ role: "user", content: user },
|
|
49
62
|
],
|
|
50
|
-
|
|
63
|
+
output: ai_1.Output.object({
|
|
64
|
+
schema: schemaToUse,
|
|
65
|
+
}),
|
|
66
|
+
providerOptions: this.getProviderOptions()
|
|
51
67
|
});
|
|
52
|
-
const
|
|
53
|
-
logData_js_1.logger.info(`LLM Attempt ${attempt} - Raw Response:`,
|
|
54
|
-
if (this.isInvalidLLMOutput(
|
|
68
|
+
const parsedContent = response.output;
|
|
69
|
+
logData_js_1.logger.info(`LLM Attempt ${attempt} - Raw Response:`, parsedContent);
|
|
70
|
+
if (this.isInvalidLLMOutput(parsedContent)) {
|
|
55
71
|
logData_js_1.logger.error(`Invalid LLM output. Retrying (${attempt})`);
|
|
56
72
|
continue;
|
|
57
73
|
}
|
|
58
|
-
|
|
59
|
-
return
|
|
74
|
+
await logData_js_1.logger.info("Time taken to get LLM response (Text):", Date.now() - startTime, "ms");
|
|
75
|
+
return {
|
|
76
|
+
...response,
|
|
77
|
+
output: parsedContent
|
|
78
|
+
};
|
|
60
79
|
}
|
|
61
80
|
catch (error) {
|
|
62
81
|
logData_js_1.logger.error(`LLM Error Attempt ${attempt}:`, error);
|
|
82
|
+
if (attempt < MAX_RETRIES) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
logData_js_1.logger.error(`Cause is ${error.cause}`, error.cause);
|
|
86
|
+
if (ai_1.NoObjectGeneratedError.isInstance(error) && error.text) {
|
|
87
|
+
try {
|
|
88
|
+
const recovered = this.extractValidatedJson(error.text, schemaToUse);
|
|
89
|
+
await logData_js_1.logger.info("Time taken to get LLM response (Text, recovered):", Date.now() - startTime, "ms");
|
|
90
|
+
return {
|
|
91
|
+
text: error.text,
|
|
92
|
+
output: recovered
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (recoveryError) {
|
|
96
|
+
logData_js_1.logger.error(`Regex recovery also failed on attempt ${attempt}:`, recoveryError);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
63
99
|
const structuredError = this.handleKnownErrors(error);
|
|
64
100
|
if (structuredError)
|
|
65
101
|
return structuredError;
|
|
@@ -67,32 +103,82 @@ class llmAction {
|
|
|
67
103
|
}
|
|
68
104
|
return this.buildRetryFailure();
|
|
69
105
|
}
|
|
70
|
-
async
|
|
106
|
+
async getProviderToUse(isVision) {
|
|
107
|
+
if (this.serviceProvider === "DefaultFireFlink" && isVision) {
|
|
108
|
+
if (!this.visionProvider) {
|
|
109
|
+
const configProvider = new llmConfiguration_js_1.ServiceProviderProviderConfiguration();
|
|
110
|
+
this.visionProvider = await configProvider.getProvider({
|
|
111
|
+
serviceProvider: "OpenAi",
|
|
112
|
+
apiKey: this.visionApiKey,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return this.visionProvider;
|
|
116
|
+
}
|
|
117
|
+
return this.provider;
|
|
118
|
+
}
|
|
119
|
+
async getLLMResponseWithVision(system, userPrompt, isVision = false) {
|
|
71
120
|
let attempt = 0;
|
|
72
121
|
const MAX_RETRIES = 5;
|
|
73
|
-
|
|
122
|
+
let content;
|
|
123
|
+
const startTime = new Date().getTime();
|
|
124
|
+
const providerToUse = await this.getProviderToUse(isVision);
|
|
125
|
+
const modelToUse = (this.serviceProvider === "DefaultFireFlink" && isVision) ? "gpt-4.1" : this.model;
|
|
74
126
|
while (attempt < MAX_RETRIES) {
|
|
75
127
|
attempt++;
|
|
76
128
|
try {
|
|
77
|
-
const
|
|
78
|
-
|
|
129
|
+
const parts = userPrompt.map((item) => {
|
|
130
|
+
if (item.type === "input_text") {
|
|
131
|
+
return {
|
|
132
|
+
type: "text",
|
|
133
|
+
text: item.text,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
let imageValue = item.image_url;
|
|
137
|
+
if (item.image_url.startsWith("http://") || item.image_url.startsWith("https://")) {
|
|
138
|
+
imageValue = new URL(item.image_url);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
type: "image",
|
|
142
|
+
image: imageValue,
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
const response = await (0, ai_1.generateText)({
|
|
146
|
+
model: providerToUse(modelToUse),
|
|
79
147
|
messages: [
|
|
80
148
|
{ role: "system", content: system },
|
|
81
|
-
{ role: "user", content:
|
|
149
|
+
{ role: "user", content: parts },
|
|
82
150
|
],
|
|
83
|
-
|
|
151
|
+
output: ai_1.Output.object({
|
|
152
|
+
schema: FireFlinkResponseSchema_js_1.VisionSchema,
|
|
153
|
+
}),
|
|
154
|
+
providerOptions: this.getProviderOptions()
|
|
84
155
|
});
|
|
85
|
-
|
|
86
|
-
|
|
156
|
+
content = response.output;
|
|
157
|
+
const parsedContent = content;
|
|
158
|
+
logData_js_1.logger.info(`Vision LLM Attempt ${attempt} - Raw Response:`, parsedContent);
|
|
87
159
|
if (this.isInvalidLLMOutput(content)) {
|
|
88
160
|
logData_js_1.logger.error(`Invalid Vision output. Retrying (${attempt})`);
|
|
89
161
|
continue;
|
|
90
162
|
}
|
|
91
|
-
|
|
163
|
+
await logData_js_1.logger.info("Time taken to get LLM response (vision):", Date.now() - startTime, "ms");
|
|
92
164
|
return response;
|
|
93
165
|
}
|
|
94
166
|
catch (error) {
|
|
95
|
-
logData_js_1.logger.error(`Vision LLM Error Attempt ${attempt}
|
|
167
|
+
logData_js_1.logger.error(`Vision LLM Error Attempt ${attempt}:`, error);
|
|
168
|
+
if (ai_1.NoObjectGeneratedError.isInstance(error) && error.text) {
|
|
169
|
+
try {
|
|
170
|
+
const recovered = this.extractValidatedJson(error.text, FireFlinkResponseSchema_js_1.VisionSchema);
|
|
171
|
+
logData_js_1.logger.info(`Vision LLM Attempt ${attempt} - Recovered via regex fallback:`, recovered);
|
|
172
|
+
await logData_js_1.logger.info("Time taken to get LLM response (vision, recovered):", Date.now() - startTime, "ms");
|
|
173
|
+
return {
|
|
174
|
+
text: error.text,
|
|
175
|
+
output: recovered
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
catch (recoveryError) {
|
|
179
|
+
logData_js_1.logger.error(`Regex recovery also failed on attempt ${attempt}:`, recoveryError);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
96
182
|
const structuredError = this.handleKnownErrors(error);
|
|
97
183
|
if (structuredError)
|
|
98
184
|
return structuredError;
|
|
@@ -124,29 +210,115 @@ class llmAction {
|
|
|
124
210
|
return false;
|
|
125
211
|
}
|
|
126
212
|
handleKnownErrors(error) {
|
|
127
|
-
if (error?.
|
|
213
|
+
if (error?.lastError?.statusCode === 429) {
|
|
128
214
|
return {
|
|
129
215
|
error: "Rate Limit Exceeded (429)",
|
|
130
|
-
errorDescription: "
|
|
216
|
+
errorDescription: "Service has exceeded the API quota or rate limit for the selected AI model. \n This is common with free or low-tier API plans \n Please wait a moment before retrying or check your API usage limits.",
|
|
131
217
|
rawError: "Rate limit reached for model. HTTP 429 returned by model"
|
|
132
218
|
};
|
|
133
219
|
}
|
|
134
|
-
if (error?.
|
|
220
|
+
else if (error?.statusCode === 400 &&
|
|
135
221
|
error?.error?.message?.toLowerCase().includes("context")) {
|
|
136
222
|
return {
|
|
137
223
|
error: "Context Length Exceeded (400)",
|
|
138
|
-
errorDescription: "
|
|
224
|
+
errorDescription: "Service could not process the request because the input exceeds the maximum context length supported by the selected AI model.\nThis typically happens when the input is very long",
|
|
139
225
|
rawError: "This model's maximum context length has been exceeded. HTTP 400 returned by model"
|
|
140
226
|
};
|
|
141
227
|
}
|
|
228
|
+
else if (error?.statusCode === 401 &&
|
|
229
|
+
error?.error?.message?.toLowerCase().includes("Incorrect api key")) {
|
|
230
|
+
return {
|
|
231
|
+
error: "Invalid API key",
|
|
232
|
+
errorDescription: "Service could not process the request because the API key is invalid. Please check your API key and try again.",
|
|
233
|
+
rawError: "Invalid API key"
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
else if (error?.statusCode !== 200) {
|
|
237
|
+
return {
|
|
238
|
+
error: error.message,
|
|
239
|
+
errorDescription: "Service has can't process the request. Because of service Provider internal error",
|
|
240
|
+
rawError: error,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
142
243
|
return null;
|
|
143
244
|
}
|
|
144
245
|
buildRetryFailure() {
|
|
145
246
|
return {
|
|
146
247
|
error: "LLM Empty Response After Retry",
|
|
147
|
-
errorDescription: "
|
|
248
|
+
errorDescription: "Service attempted multiple times but received empty or invalid responses.",
|
|
148
249
|
rawError: "Max retry limit reached",
|
|
149
250
|
};
|
|
150
251
|
}
|
|
252
|
+
extractValidatedJson(rawText, schemaToUse) {
|
|
253
|
+
const trimmed = rawText.trim();
|
|
254
|
+
const jsonMatch = trimmed.match(/\{[\s\S]*\}/);
|
|
255
|
+
if (!jsonMatch) {
|
|
256
|
+
throw new Error("No JSON object found in LLM response");
|
|
257
|
+
}
|
|
258
|
+
const parsedJson = JSON.parse(jsonMatch[0]);
|
|
259
|
+
return schemaToUse.parse(parsedJson);
|
|
260
|
+
}
|
|
261
|
+
getProviderOptions() {
|
|
262
|
+
switch (this.serviceProvider) {
|
|
263
|
+
case "OpenAI":
|
|
264
|
+
return {
|
|
265
|
+
openai: {
|
|
266
|
+
reasoningEffort: "low",
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
case "Anthropic":
|
|
270
|
+
if (this.model.startsWith("claude-haiku")) {
|
|
271
|
+
return {
|
|
272
|
+
anthropic: {
|
|
273
|
+
thinking: {
|
|
274
|
+
type: "enabled",
|
|
275
|
+
budgetTokens: 1024
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
return {
|
|
282
|
+
anthropic: {
|
|
283
|
+
effort: "low",
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
case "Gemini":
|
|
288
|
+
if (this.model.startsWith("gemini-2")) {
|
|
289
|
+
return {
|
|
290
|
+
google: {
|
|
291
|
+
thinkingConfig: {
|
|
292
|
+
thinkingBudget: 128,
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if (this.model.startsWith("gemini-3")) {
|
|
298
|
+
return {
|
|
299
|
+
google: {
|
|
300
|
+
thinkingConfig: {
|
|
301
|
+
thinkingLevel: "low",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
return {};
|
|
307
|
+
case "Groq":
|
|
308
|
+
return {
|
|
309
|
+
groq: {
|
|
310
|
+
reasoningEffort: "low",
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
case "Azure_AI":
|
|
314
|
+
return {
|
|
315
|
+
openai: {
|
|
316
|
+
reasoningEffort: "low",
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
default:
|
|
320
|
+
return {};
|
|
321
|
+
}
|
|
322
|
+
}
|
|
151
323
|
}
|
|
152
324
|
exports.llmAction = llmAction;
|
|
@@ -15,29 +15,41 @@ class LLMResultParser {
|
|
|
15
15
|
return JSON.parse(match[0]);
|
|
16
16
|
}
|
|
17
17
|
async fetchResult(llmOutput) {
|
|
18
|
-
if (
|
|
18
|
+
if (llmOutput?.error) {
|
|
19
19
|
throw llmOutput;
|
|
20
20
|
}
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
let content;
|
|
23
|
+
if (llmOutput?.output) {
|
|
24
|
+
content = llmOutput?.output;
|
|
25
|
+
}
|
|
26
|
+
else if (llmOutput?.output_text) {
|
|
27
|
+
content = llmOutput?.output_text;
|
|
28
|
+
}
|
|
23
29
|
if (!content) {
|
|
24
30
|
throw new Error("No content in LLM output");
|
|
25
31
|
}
|
|
32
|
+
// if (typeof content === "string") {
|
|
33
|
+
// content = content
|
|
34
|
+
// .replace(/^[\s\S]*?(?=\{)|(?<=\})[\s\S]*$/g, "")
|
|
35
|
+
// .trim();
|
|
36
|
+
// }
|
|
26
37
|
let parsedContent;
|
|
27
38
|
try {
|
|
28
39
|
parsedContent = JSON.parse(content);
|
|
29
40
|
}
|
|
30
41
|
catch {
|
|
31
|
-
const extracted = this.extractJsonObject(content);
|
|
32
|
-
if (!
|
|
42
|
+
// const extracted = this.extractJsonObject(content);
|
|
43
|
+
if (!content) {
|
|
33
44
|
throw new Error("Could not extract valid JSON from LLM response");
|
|
34
45
|
}
|
|
35
|
-
parsedContent =
|
|
46
|
+
parsedContent = content;
|
|
36
47
|
}
|
|
37
|
-
const usage = llmOutput?.
|
|
38
|
-
this.inputTokens += Number(usage.
|
|
39
|
-
this.outputTokens += Number(usage.
|
|
40
|
-
this.totalTokens += Number(usage.
|
|
48
|
+
const usage = llmOutput?.totalUsage ?? {};
|
|
49
|
+
this.inputTokens += Number(usage.inputTokens ?? 0);
|
|
50
|
+
this.outputTokens += Number(usage.outputTokens ?? 0);
|
|
51
|
+
this.totalTokens += Number(usage.totalTokens ?? 0);
|
|
52
|
+
// logger.info(`tokens : ${usage.output_tokens} + ${usage.input_tokens} = ${usage.total_tokens}`);
|
|
41
53
|
// logger.info(`Total tokens for this call is : ${usage.total_tokens}`);
|
|
42
54
|
return { response: parsedContent };
|
|
43
55
|
}
|
|
@@ -17,6 +17,7 @@ const combinedActionExtractorPromptMob_js_1 = require("./systemPrompts/combinedA
|
|
|
17
17
|
const waitActionExtractorPromptMob_js_1 = require("./systemPrompts/waitActionExtractorPromptMob.js");
|
|
18
18
|
const waitActionExtractorPrompt_js_1 = require("./systemPrompts/waitActionExtractorPrompt.js");
|
|
19
19
|
const combinedActionExtractorPrompt_js_1 = require("./systemPrompts/combinedActionExtractorPrompt.js");
|
|
20
|
+
const otpExtractorPrompt_js_1 = require("./systemPrompts/otpExtractorPrompt.js");
|
|
20
21
|
exports.prompts = {
|
|
21
22
|
web: {
|
|
22
23
|
userStoryToList: userStoryToListPrompt_js_1.buildStepExtractionPrompt,
|
|
@@ -28,6 +29,7 @@ exports.prompts = {
|
|
|
28
29
|
getActionExtractorPrompt: getActionExtractorPrompt_js_1.getActionExtractorPrompt,
|
|
29
30
|
combinedActionExtractorPrompt: combinedActionExtractorPrompt_js_1.combinedActionExtractorPrompt,
|
|
30
31
|
waitActionExtractorPrompt: waitActionExtractorPrompt_js_1.waitActionExtractorPrompt,
|
|
32
|
+
otpExtractorPrompt: otpExtractorPrompt_js_1.otpExtractorPrompt,
|
|
31
33
|
},
|
|
32
34
|
android: {
|
|
33
35
|
userStoryToList: userStoryToListPrompt_js_1.androidbuildStepExtractionPrompt,
|
|
@@ -39,5 +41,18 @@ exports.prompts = {
|
|
|
39
41
|
getActionExtractorPrompt: getActionExtractorPromptMob_js_1.getActionExtractorPromptMob,
|
|
40
42
|
combinedActionExtractorPrompt: combinedActionExtractorPromptMob_js_1.combinedActionExtractorPromptMob,
|
|
41
43
|
waitActionExtractorPrompt: waitActionExtractorPromptMob_js_1.waitActionExtractorPromptMob,
|
|
44
|
+
otpExtractorPrompt: otpExtractorPrompt_js_1.otpExtractorPrompt,
|
|
45
|
+
},
|
|
46
|
+
ios: {
|
|
47
|
+
userStoryToList: userStoryToListPrompt_js_1.androidbuildStepExtractionPrompt,
|
|
48
|
+
keywordExtractorPrompt: mobileKeywordExtractor_js_1.keywordExtractorMobile,
|
|
49
|
+
errorDescriptionPrompt: errorDescriptionPrompt_js_1.buildErrorDescriptionPrompt,
|
|
50
|
+
ffInspectorNumExtractor: fireflinkElementIndexExtractor_Mob_js_1.ffInspectorNumExtractorMob,
|
|
51
|
+
verifyActionExtractorPrompt: verifyActionExtractorPromptMob_js_1.verifyActionExtractorPromptMob,
|
|
52
|
+
visionPrompt: visionPromptMobile_js_1.visionPromptMobile,
|
|
53
|
+
getActionExtractorPrompt: getActionExtractorPromptMob_js_1.getActionExtractorPromptMob,
|
|
54
|
+
combinedActionExtractorPrompt: combinedActionExtractorPromptMob_js_1.combinedActionExtractorPromptMob,
|
|
55
|
+
waitActionExtractorPrompt: waitActionExtractorPromptMob_js_1.waitActionExtractorPromptMob,
|
|
56
|
+
otpExtractorPrompt: otpExtractorPrompt_js_1.otpExtractorPrompt,
|
|
42
57
|
}
|
|
43
58
|
};
|
|
@@ -2,40 +2,77 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keywordExtractor = keywordExtractor;
|
|
4
4
|
async function keywordExtractor({ priorAndNextSteps }) {
|
|
5
|
-
const allowedActions = ["enter", "wait", "verify", "scroll", "navigate", "navigateBack", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext"];
|
|
5
|
+
const allowedActions = ["enter", "refresh", "wait", "verify", "scroll", "navigate", "navigateBack", "click", "maximize", "minimize", "get", "upload", "close", "open", "drag_and_drop", "switch", "cleartext", "notwebopenaction", "mouseAction", "switchToAndroid", "getOtp", "enterOtp"];
|
|
6
6
|
const prompt = `
|
|
7
7
|
You are an expert in Web application testing.
|
|
8
8
|
From the step, extract ONLY the meaningful keywords so that i can search for the element in the dom.
|
|
9
9
|
Rules:
|
|
10
10
|
- Only give response for the current step.
|
|
11
11
|
- understand the step and context from the ${JSON.stringify(priorAndNextSteps)}.and keywords should be from step. it should not be related to other steps.
|
|
12
|
-
-
|
|
12
|
+
- Keywords must represent ONLY the element label or visible text, never add action or instruction words in keywords.
|
|
13
|
+
- Element name + type keywords: strip action words, leaving the core element name and any
|
|
14
|
+
type word(s) attached to it (icon, button, dropdown, filter, tab, field, etc., in the order
|
|
15
|
+
they appear in the step). Build keywords as a growing chain starting from the core name and
|
|
16
|
+
adding one more type word each time: [name], [name+type1], [name+type1+type2], ...
|
|
17
|
+
The core name alone is ALWAYS keyword 1 — never drop it, no matter how many type words follow.
|
|
18
|
+
Treat "input field", "text field", "search box", "check box", "drop down" as ONE type word,
|
|
19
|
+
not two.
|
|
20
|
+
No type word in the step → only [name] as the keyword.
|
|
21
|
+
Example: "click X filter dropdown" → ["X", "X filter", "X filter dropdown"]
|
|
22
|
+
- When a step contains two elements connected by a positional or relational phrase, keywords MUST contain at least one keyword from each element — TARGET element first, then the reference element. Never omit the reference element. Example: "Click on x above y" → x is the target, y is the reference → ["x", "y"].
|
|
23
|
+
- 3 to 5 keywords maximum. dont give more than 5 keywords. and no need for casesensitive.
|
|
24
|
+
- General ordering rule: whenever a step involves both a target element and a reference/context element, the TARGET element's keyword(s) must always come FIRST, followed by the reference/context element's keyword(s). This applies to positional/relational steps, selection steps, and any other multi-element step.
|
|
25
|
+
- For the open action if they are not provided anything like profile, capablities in the step in that case don't add them check whether the profile and the capablities are present in the step if not please don't add them.
|
|
26
|
+
- For the Open action, if a browser path and profile are provided, return keywords as ["path:<path_value>", "profile:<profile_value>"]. Should not remove backslach from path.
|
|
27
|
+
example: step open browser,x:\\x\\x\\x,default -> ["path:c:\\x\\x\\x","profile:default"]
|
|
28
|
+
- For the Open action, if the user requests specific browser capabilities/arguments, extract them into the keywords array using the "caps:" prefix followed by one of these exact allowed values:
|
|
29
|
+
- "headless" (for running in headless / no-gui mode)
|
|
30
|
+
- "incognito" (for private / incognito mode)
|
|
31
|
+
- "ignoreCertificates" (for ignoring SSL/certificate errors)
|
|
32
|
+
- "startMaximized" (for starting maximized)
|
|
33
|
+
- "disableGpu" (for disabling hardware/GPU acceleration)
|
|
34
|
+
- "disableNotifications" (for blocking push notifications)
|
|
35
|
+
- "disableExtensions" (for disabling browser extensions)
|
|
36
|
+
- "disablePopups" (for disabling popup blocking)
|
|
37
|
+
- "muteAudio" (for muting browser audio)
|
|
38
|
+
- "noSandbox" (for disabling sandbox)
|
|
39
|
+
- "disableWebSecurity" (for disabling web security, CORS, or same-origin policy checks)
|
|
40
|
+
- "disableLocalNetwork" (for disabling WebRTC local IP discovery or local network access constraints)
|
|
41
|
+
- "geolocation" (for blocking or allowing geolocation access)
|
|
42
|
+
- "camera" (for blocking or allowing camera access)
|
|
43
|
+
- "microphone" (for blocking or allowing microphone access)
|
|
44
|
+
- "passwordManager" (for disabling credentials and password manager prompts)
|
|
45
|
+
Do NOT extract or generate any capability strings outside of this list.
|
|
46
|
+
- Do NOT split the keyword into individual words or generate variations such as ["sign", "in"] or ["add", "to", "cart"] for ["Sign In","Add to Cart"]. Only include the original phrase should not add type for first keyword.
|
|
47
|
+
- If icon is metioned in step than 'svg' should add in keywords and for Upload action first keyword should be 'file'.
|
|
48
|
+
- If the step is about selecting, include keywords for both the target value and the source/reference, with the TARGET value FIRST and the source/reference SECOND (example: select 'x' in 'y' → "x", "y"), ensuring both are meaningful and action should set to 'click'.
|
|
13
49
|
- If the step is about entering text or Uploading file, Should NOT include input value from the step into keywords.
|
|
50
|
+
- If the step is about entering the OTP then give the action as the enterOtp, just only for the entering OTP only.
|
|
14
51
|
- If the step has words like tag name audio, video, image,svg, checkbox etc, include them in the keywords.
|
|
15
|
-
- If icon is metioned in step than 'svg' should add in keywords and for Upload action first keyword should be 'file'.
|
|
16
|
-
- First keywords should be from step next Keywords must be distinct and based on the element's label meaning only.
|
|
17
|
-
- If a keyword contains exactly two words, you MUST always include both the spaced and concatenated (no-space) versions; omission of either is invalid.
|
|
52
|
+
- **If icon is metioned in step than 'svg' should add in keywords ex: click on x icon -> [x, x icon,svg] and for Upload action first keyword should be 'file'. ex: upload file in x -> [file,x].**
|
|
18
53
|
- Do NOT split single-word keywords and do NOT include relation terms (above, below, next to, etc.) in keywords.
|
|
19
|
-
- Treat each keyword independently
|
|
20
|
-
- Example: Click on Sign In above Create Account button → ["Sign In", "SignIn", "Create Account", "CreateAccount"] never break kewword like ["create", "account"]
|
|
54
|
+
- Treat each keyword independently never merge different keywords.
|
|
21
55
|
- Keywords can be string or number if the step contains a number ,add it also as keyword.
|
|
22
56
|
- Do Not include any other unrelated keywords for step.
|
|
23
57
|
- Do NOT include generic UI words (button, field, etc) and action words (tap, click, press, etc).
|
|
24
58
|
- Do NOT include status/technical words (displayed, enabled, authenticate, visible).
|
|
25
|
-
- If
|
|
59
|
+
- If the step is for the switching to android then provide the action as the switchToAndroid
|
|
26
60
|
- element_name: extract name of the element that mentioned in the the step.(eg:tap on x -> element_name:x) keep element_name as short as possible and make the first letter of first word of the element_name as capital. beacuse element_name is also used to find element in the dom. and if element_name is not mentioned in step than return action of the step as element_name.
|
|
27
|
-
- action
|
|
61
|
+
- Set action to notwebopenaction only when the instruction is related to a mobile application, app, application, installed package, or bundle .
|
|
62
|
+
- action: click for taping, clicking or selecting, enter for entering input, wait for waiting or sleeping,scroll for scrolling and swiping, navigate for navigating to page using url, navigateBack for navigateing back to previous page, get for getting,fetching element,maximize for maximizing browser window, close for closing browser window,open for opening browser window, upload for uploading file using path, drag_and_drop for dragging and dropping element, switch is for switching to tab or window or frame,cleartext for clearing or removing text from element, mouseAction for the action related mouse actions even for mouse click , refresh is for .
|
|
63
|
+
- If mouse action related step is there select mouseAction from the allowed actions list check for the step and provide it.
|
|
28
64
|
- action must be one of from this list ${JSON.stringify(allowedActions)}.if not one of them, return '0'. if step about set or find action return '0'
|
|
29
65
|
- For navigate action, keywords should contain only one keyword which is full url from the step and should not include any other text. and if step has another actions, including navigate action, don't return navigate action return another action witch is in the step. and element_name should be "URL".
|
|
30
66
|
Navigate action is allowed only when the step intent is purely navigation (e.g., "Navigate to URL").
|
|
31
67
|
If the step includes verification intent (verify/check/confirm/etc), you MUST return "verify" and MUST NOT return "navigate".
|
|
32
68
|
only give navigate action if step has only navigate action.
|
|
33
|
-
|
|
69
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
34
70
|
Respond only with JSON using this format:
|
|
35
71
|
{
|
|
36
72
|
"keywords": [key1,key2,key3,key4,key5],
|
|
37
73
|
"elementName": "x",
|
|
38
|
-
"action": "x"
|
|
74
|
+
"action": "x",
|
|
75
|
+
"liveLog": "Should Generate a short, human-readable description of what the AI is about to do.",
|
|
39
76
|
}
|
|
40
77
|
|
|
41
78
|
No other text.
|
|
@@ -12,23 +12,24 @@ Select the perfect matching NLP name from the list that best fits the step's int
|
|
|
12
12
|
|
|
13
13
|
Return **only valid JSON** in the following format:
|
|
14
14
|
{
|
|
15
|
-
"
|
|
15
|
+
"attributeValue": "Fire-Flink-x",
|
|
16
16
|
"nlpName": "x",
|
|
17
|
-
"
|
|
17
|
+
"inputText":"x",
|
|
18
18
|
"keyword": "x",
|
|
19
|
-
"
|
|
19
|
+
"elementType": "x",
|
|
20
20
|
"keycode": "x"
|
|
21
21
|
}
|
|
22
22
|
Rules:
|
|
23
23
|
- nlpName must be exactly one from the provided list.
|
|
24
24
|
- Use context from the steps : ${priorAndNextSteps}, keyword and json to search for FF-inspecter.
|
|
25
25
|
- **Find the FF-inspecter attribute value of the element in the Simplified JSON whose text or attributes best match the step.**
|
|
26
|
-
- If step has mutipul inputs add all in
|
|
27
|
-
- Extract
|
|
26
|
+
- If step has mutipul inputs add all in inputText and all matched attributeValue also.
|
|
27
|
+
- Extract inputText from the step, if you can't find any input text in the step, return keyword as inputText.input can be number, app package, apk file path.dont include extra words.
|
|
28
28
|
- Extract keyword from the step, if the step contains any keyword.
|
|
29
29
|
- Extract keycode of keys if the step contains any key name like ENTER,SPACE,BACKSPACE etc and give keycode of the given key.
|
|
30
|
-
- Use the closest semantic match for the step; return
|
|
30
|
+
- Use the closest semantic match for the step; return attributeValue as Fire-Flink-0, only if nothing is found.
|
|
31
31
|
- Based on step give most relevant type of element. use this list to choose element_type: ${elementType} and Never change syntax of element_type, follow the syntax of element_type in list.if element_type is not there in list return 'link'.
|
|
32
|
+
- Return ONLY a valid JSON object; the response must start with '{' and end with '}', with no markdown, code fences, explanations, or extra text.
|
|
32
33
|
- Respond with valid JSON only.
|
|
33
34
|
`;
|
|
34
35
|
return prompt;
|