windmill-components 1.677.0 → 1.687.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/package/components/AppConnectInner.svelte +6 -0
- package/package/components/CiTestResults.svelte +64 -0
- package/package/components/CiTestResults.svelte.d.ts +7 -0
- package/package/components/CompareWorkspaces.svelte +626 -418
- package/package/components/DBManager.svelte +35 -4
- package/package/components/DBManager.svelte.d.ts +2 -0
- package/package/components/DBManagerContent.svelte +3 -1
- package/package/components/DBManagerContent.svelte.d.ts +3 -0
- package/package/components/DBManagerDrawer.svelte +145 -3
- package/package/components/DBTableEditor.svelte +14 -4
- package/package/components/DatatablePicker.svelte +2 -5
- package/package/components/DatatableSchemaDiff.svelte +531 -0
- package/package/components/DatatableSchemaDiff.svelte.d.ts +29 -0
- package/package/components/DedicatedWorkersSelector.svelte +4 -2
- package/package/components/DefaultTagsInner.svelte +42 -2
- package/package/components/DeployWorkspaceDrawer.svelte +1 -1
- package/package/components/Dev.svelte +20 -3
- package/package/components/Editor.svelte +1 -1
- package/package/components/EditorBar.svelte +1 -1
- package/package/components/EditorBar.svelte.d.ts +1 -1
- package/package/components/FlowStatusViewerInner.svelte +269 -220
- package/package/components/FlowTimeline.svelte +1 -1
- package/package/components/FolderEditor.svelte +189 -4
- package/package/components/ForkWorkspaceBanner.svelte +82 -11
- package/package/components/GlobalUserOffboardingModal.svelte +293 -0
- package/package/components/GlobalUserOffboardingModal.svelte.d.ts +10 -0
- package/package/components/InstanceSettings.svelte +22 -3
- package/package/components/Login.svelte +22 -10
- package/package/components/ModuleTest.svelte +2 -1
- package/package/components/NoMainFuncBadge.svelte +1 -1
- package/package/components/OffboardItemsBox.svelte +56 -0
- package/package/components/OffboardItemsBox.svelte.d.ts +12 -0
- package/package/components/OffboardReassignControls.svelte +47 -0
- package/package/components/OffboardReassignControls.svelte.d.ts +20 -0
- package/package/components/OffboardWorkspaceSection.svelte +110 -0
- package/package/components/OffboardWorkspaceSection.svelte.d.ts +24 -0
- package/package/components/OnBehalfOfSelector.svelte +21 -3
- package/package/components/OnBehalfOfSelector.svelte.d.ts +7 -0
- package/package/components/QueueAlerts.svelte +10 -10
- package/package/components/ResourcePicker.svelte +2 -2
- package/package/components/ScriptBuilder.svelte +52 -11
- package/package/components/ScriptEditor.svelte +1 -3
- package/package/components/ScriptEditor.svelte.d.ts +1 -1
- package/package/components/ShareModal.svelte +236 -98
- package/package/components/SuperadminSettingsInner.svelte +362 -315
- package/package/components/UserOffboardingModal.svelte +238 -0
- package/package/components/UserOffboardingModal.svelte.d.ts +10 -0
- package/package/components/WorkspaceDeployLayout.svelte +3 -3
- package/package/components/WorkspaceDeployLayout.svelte.d.ts +1 -0
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte +4 -2
- package/package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +12 -0
- package/package/components/assets/AssetsDropdownButton.svelte +1 -1
- package/package/components/common/confirmationModal/ConfirmationModal.svelte +1 -1
- package/package/components/common/table/AppRow.svelte +3 -3
- package/package/components/common/table/FlowRow.svelte +3 -3
- package/package/components/common/table/RawAppRow.svelte +4 -4
- package/package/components/common/table/Row.svelte +6 -2
- package/package/components/common/table/ScriptRow.svelte +11 -3
- package/package/components/copilot/chat/AIChatManager.svelte.js +2 -2
- package/package/components/copilot/chat/anthropic.d.ts +7 -1
- package/package/components/copilot/chat/anthropic.js +5 -2
- package/package/components/copilot/chat/app/core.js +129 -1
- package/package/components/copilot/chat/app/core.test.js +192 -0
- package/package/components/copilot/chat/chatLoop.d.ts +3 -0
- package/package/components/copilot/chat/chatLoop.js +13 -5
- package/package/components/copilot/chat/flow/FlowAIChat.svelte +55 -76
- package/package/components/copilot/chat/flow/core.d.ts +13 -3
- package/package/components/copilot/chat/flow/core.js +467 -116
- package/package/components/copilot/chat/flow/helperUtils.d.ts +19 -0
- package/package/components/copilot/chat/flow/helperUtils.js +68 -0
- package/package/components/copilot/chat/flow/helperUtils.test.js +116 -0
- package/package/components/copilot/chat/flow/inlineScriptsUtils.d.ts +5 -24
- package/package/components/copilot/chat/flow/inlineScriptsUtils.js +30 -55
- package/package/components/copilot/chat/flow/utils.test.js +59 -0
- package/package/components/copilot/chat/openai-responses.d.ts +7 -1
- package/package/components/copilot/chat/openai-responses.js +5 -2
- package/package/components/copilot/chat/shared.d.ts +1 -2
- package/package/components/copilot/chat/shared.js +94 -52
- package/package/components/copilot/chat/tokenUsage.d.ts +23 -0
- package/package/components/copilot/chat/tokenUsage.js +42 -0
- package/package/components/copilot/lib.d.ts +5 -1
- package/package/components/copilot/lib.js +21 -5
- package/package/components/deploymentRequest/DeploymentRequestPanel.svelte +337 -0
- package/package/components/deploymentRequest/DeploymentRequestPanel.svelte.d.ts +15 -0
- package/package/components/details/CopyableCodeBlock.svelte +18 -8
- package/package/components/details/CopyableCodeBlock.svelte.d.ts +1 -0
- package/package/components/flows/FlowAssetsHandler.svelte +19 -21
- package/package/components/flows/agentToolTree.d.ts +17 -0
- package/package/components/flows/agentToolTree.js +114 -0
- package/package/components/flows/agentToolTree.test.d.ts +1 -0
- package/package/components/flows/agentToolTree.test.js +86 -0
- package/package/components/flows/agentToolUtils.d.ts +0 -5
- package/package/components/flows/agentToolUtils.js +0 -49
- package/package/components/flows/content/FlowLoop.svelte +7 -4
- package/package/components/flows/content/FlowModuleDeleteAfterUse.svelte +15 -7
- package/package/components/flows/content/FlowSettings.svelte +29 -0
- package/package/components/flows/dfs.d.ts +6 -2
- package/package/components/flows/dfs.js +19 -11
- package/package/components/flows/flowDeleteController.d.ts +32 -0
- package/package/components/flows/flowDeleteController.js +54 -0
- package/package/components/flows/flowDeleteController.test.d.ts +1 -0
- package/package/components/flows/flowDeleteController.test.js +121 -0
- package/package/components/flows/flowDeleteUtils.d.ts +48 -0
- package/package/components/flows/flowDeleteUtils.js +150 -0
- package/package/components/flows/flowDeleteUtils.test.d.ts +1 -0
- package/package/components/flows/flowDeleteUtils.test.js +131 -0
- package/package/components/flows/flowDiff.d.ts +2 -47
- package/package/components/flows/flowDiff.js +16 -293
- package/package/components/flows/flowDiff.testUtils.d.ts +8 -0
- package/package/components/flows/flowDiff.testUtils.js +26 -0
- package/package/components/flows/flowDiffManager.svelte.js +20 -75
- package/package/components/flows/flowDiffManager.svelte.test.js +103 -2
- package/package/components/flows/flowExplorer.d.ts +4 -0
- package/package/components/flows/flowExplorer.js +7 -30
- package/package/components/flows/flowState.d.ts +1 -0
- package/package/components/flows/flowStateUtils.svelte.js +6 -1
- package/package/components/flows/flowStore.svelte.d.ts +1 -1
- package/package/components/flows/flowTree.d.ts +91 -0
- package/package/components/flows/flowTree.js +326 -0
- package/package/components/flows/flowTree.test.d.ts +1 -0
- package/package/components/flows/flowTree.test.js +236 -0
- package/package/components/flows/map/FlowJobsMenu.svelte +36 -30
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +1 -1
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +70 -227
- package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +0 -2
- package/package/components/flows/pickers/PickHubScriptQuick.svelte +2 -2
- package/package/components/flows/pickers/PickHubScriptQuick.svelte.d.ts +1 -1
- package/package/components/flows/previousResults.js +13 -41
- package/package/components/flows/previousResults.test.d.ts +1 -0
- package/package/components/flows/previousResults.test.js +65 -0
- package/package/components/flows/propPicker/OutputPicker.svelte +2 -1
- package/package/components/flows/propPicker/OutputPickerInner.svelte +41 -4
- package/package/components/flows/propPicker/StepHistory.svelte +9 -1
- package/package/components/git_sync/GitSyncContext.svelte.js +11 -5
- package/package/components/git_sync/GitSyncRepositoryCard.svelte +2 -29
- package/package/components/git_sync/PullWorkspaceModal.svelte +6 -7
- package/package/components/graph/FlowGraphV2.svelte +2 -2
- package/package/components/graph/FlowGraphV2.svelte.d.ts +1 -0
- package/package/components/graph/groupedModulesProxy.svelte.d.ts +10 -0
- package/package/components/graph/groupedModulesProxy.svelte.js +17 -1
- package/package/components/graph/renderers/triggers/TriggersBadge.svelte +5 -2
- package/package/components/home/HomeConnectDrawer.svelte +125 -0
- package/package/components/home/HomeConnectDrawer.svelte.d.ts +5 -0
- package/package/components/icons/GithubIcon.svelte +4 -4
- package/package/components/icons/GithubIcon.svelte.d.ts +5 -2
- package/package/components/instanceSettings/ExternalJwtTokens.svelte +85 -0
- package/package/components/instanceSettings/ExternalJwtTokens.svelte.d.ts +12 -0
- package/package/components/instanceSettings/GhesAppSettings.svelte +17 -0
- package/package/components/instanceSettings/IndexerMemorySettings.svelte +56 -29
- package/package/components/instanceSettings/SecretBackendConfig.svelte +9 -2
- package/package/components/instanceSettings.d.ts +1 -0
- package/package/components/instanceSettings.js +42 -8
- package/package/components/offboarding-utils.d.ts +11 -0
- package/package/components/offboarding-utils.js +100 -0
- package/package/components/raw_apps/RawAppDataTableDrawer.svelte +1 -1
- package/package/components/raw_apps/RawAppEditor.svelte +27 -0
- package/package/components/raw_apps/RawAppEditorHeader.svelte +6 -1
- package/package/components/raw_apps/RawAppEditorHeader.svelte.d.ts +1 -0
- package/package/components/raw_apps/RawAppYamlEditor.svelte +81 -0
- package/package/components/raw_apps/RawAppYamlEditor.svelte.d.ts +20 -0
- package/package/components/raw_apps/datatableUtils.svelte.js +1 -1
- package/package/components/runs/runsFilter.d.ts +1 -1
- package/package/components/script_builder.d.ts +1 -1
- package/package/components/select/Select.svelte +2 -1
- package/package/components/select/Select.svelte.d.ts +1 -0
- package/package/components/settings/CreateToken.svelte +113 -64
- package/package/components/settings/CreateToken.svelte.d.ts +3 -0
- package/package/components/settings/WorkspaceUserSettings.svelte +34 -28
- package/package/components/sidebar/SidebarContent.svelte +58 -2
- package/package/components/sidebar/WorkspaceMenu.svelte +8 -4
- package/package/components/triggers/AddTriggersButton.svelte +11 -0
- package/package/components/triggers/PermissionedAsLine.svelte +37 -3
- package/package/components/triggers/PermissionedAsLine.svelte.d.ts +6 -0
- package/package/components/triggers/TriggersEditor.svelte +5 -1
- package/package/components/triggers/TriggersWrapper.svelte +10 -0
- package/package/components/triggers/email/EmailTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/http/RouteEditorConfigSection.svelte +15 -7
- package/package/components/triggers/http/RouteEditorInner.svelte +14 -14
- package/package/components/triggers/http/RoutesGenerator.svelte +6 -1
- package/package/components/triggers/http/RoutesPanel.svelte +1 -1
- package/package/components/triggers/http/utils.d.ts +1 -1
- package/package/components/triggers/http/utils.js +2 -2
- package/package/components/triggers/kafka/KafkaTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/mqtt/MqttEditorConfigSection.svelte.d.ts +1 -1
- package/package/components/triggers/mqtt/MqttTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/native/NativeTriggerEditor.svelte +3 -0
- package/package/components/triggers/native/services/github/GitHubTriggerForm.svelte +118 -0
- package/package/components/triggers/native/services/github/GitHubTriggerForm.svelte.d.ts +17 -0
- package/package/components/triggers/native/utils.js +14 -0
- package/package/components/triggers/nats/NatsTriggerEditor.svelte.d.ts +4 -3
- package/package/components/triggers/nats/NatsTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/postgres/PostgresTriggerEditor.svelte.d.ts +4 -3
- package/package/components/triggers/postgres/PostgresTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/schedules/ScheduleEditorInner.svelte +13 -11
- package/package/components/triggers/sqs/SqsTriggerEditor.svelte.d.ts +4 -3
- package/package/components/triggers/sqs/SqsTriggerEditorInner.svelte +13 -11
- package/package/components/triggers/triggers.svelte.js +1 -0
- package/package/components/triggers/utils.js +27 -6
- package/package/components/triggers/websocket/WebsocketTriggerEditorInner.svelte +13 -11
- package/package/components/triggers.d.ts +1 -1
- package/package/components/useFolderDefaultPermissionedAs.svelte.d.ts +13 -0
- package/package/components/useFolderDefaultPermissionedAs.svelte.js +63 -0
- package/package/components/workspaceSettings/CreateWorkspace.svelte +16 -677
- package/package/components/workspaceSettings/CreateWorkspaceInner.svelte +604 -0
- package/package/components/workspaceSettings/CreateWorkspaceInner.svelte.d.ts +7 -0
- package/package/components/workspaceSettings/CustomInstanceDbSelect.svelte +27 -25
- package/package/components/workspaceSettings/CustomInstanceDbWizardModal.svelte +46 -8
- package/package/components/workspaceSettings/DataTableSettings.svelte +27 -22
- package/package/components/workspaceSettings/DucklakeSettings.svelte +1 -1
- package/package/components/workspaceSettings/ForkDatatableSection.svelte +228 -0
- package/package/components/workspaceSettings/ForkDatatableSection.svelte.d.ts +28 -0
- package/package/components/workspaceSettings/GitSyncFilterSettings.svelte +8 -2
- package/package/components/workspaceSettings/RulesetEditor.svelte +27 -2
- package/package/components/workspaceSettings/VolumeStorageSettings.svelte +1 -1
- package/package/components/workspaceSettings/WorkspaceIntegrations.svelte +17 -1
- package/package/consts.d.ts +3 -0
- package/package/consts.js +10 -0
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +1172 -164
- package/package/gen/schemas.gen.js +1168 -157
- package/package/gen/services.gen.d.ts +511 -6
- package/package/gen/services.gen.js +1023 -23
- package/package/gen/types.gen.d.ts +2278 -151
- package/package/githubApp.js +5 -1
- package/package/hubPaths.json +1 -4
- package/package/infer.js +13 -1
- package/package/infer.svelte.js +10 -1
- package/package/monaco_workers/sqlTypePlugin.worker.d.ts +10 -0
- package/package/monaco_workers/sqlTypePlugin.worker.js +39 -0
- package/package/script_helpers.d.ts +8 -2
- package/package/script_helpers.js +14 -0
- package/package/stores.d.ts +4 -0
- package/package/stores.js +1 -0
- package/package/system_prompts/prompts.d.ts +4 -3
- package/package/system_prompts/prompts.js +270 -20
- package/package/templates/ci_test_bun.ts.template +19 -0
- package/package/templates/ci_test_python.py.template +18 -0
- package/package/utils_deployable.d.ts +11 -7
- package/package/utils_workspace_deploy.d.ts +8 -8
- package/package/utils_workspace_deploy.js +86 -420
- package/package.json +4 -4
- package/package/components/copilot/chat/__tests__/app/appChat.eval.test.js +0 -153
- package/package/components/copilot/chat/__tests__/app/appEvalComparison.d.ts +0 -21
- package/package/components/copilot/chat/__tests__/app/appEvalComparison.js +0 -136
- package/package/components/copilot/chat/__tests__/app/appEvalHelpers.d.ts +0 -15
- package/package/components/copilot/chat/__tests__/app/appEvalHelpers.js +0 -107
- package/package/components/copilot/chat/__tests__/app/appEvalRunner.d.ts +0 -50
- package/package/components/copilot/chat/__tests__/app/appEvalRunner.js +0 -93
- package/package/components/copilot/chat/__tests__/app/appFixtureLoader.d.ts +0 -29
- package/package/components/copilot/chat/__tests__/app/appFixtureLoader.js +0 -134
- package/package/components/copilot/chat/__tests__/app/appResultsWriter.d.ts +0 -30
- package/package/components/copilot/chat/__tests__/app/appResultsWriter.js +0 -197
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/createFolder/main.d.ts +0 -10
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/createFolder/main.js +0 -9
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/createFolder/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/deleteItem/main.d.ts +0 -6
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/deleteItem/main.js +0 -5
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/deleteItem/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/listFiles/main.d.ts +0 -12
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/listFiles/main.js +0 -14
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/listFiles/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/listFolders/main.d.ts +0 -8
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/listFolders/main.js +0 -25
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/listFolders/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/moveItem/main.d.ts +0 -7
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/moveItem/main.js +0 -5
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/moveItem/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/renameItem/main.d.ts +0 -8
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/renameItem/main.js +0 -5
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/backend/renameItem/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/Breadcrumb.d.ts +0 -10
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/Breadcrumb.tsx +0 -26
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/FileItem.d.ts +0 -10
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/FileItem.tsx +0 -79
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/FileList.d.ts +0 -10
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/FileList.tsx +0 -46
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/FolderTree.d.ts +0 -10
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/FolderTree.tsx +0 -56
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/Toolbar.d.ts +0 -6
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/components/Toolbar.tsx +0 -59
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/index.d.ts +0 -16
- package/package/components/copilot/chat/__tests__/app/initial/file_manager/frontend/index.tsx +0 -119
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/addToCart/main.d.ts +0 -15
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/addToCart/main.js +0 -14
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/addToCart/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/calculateTotal/main.d.ts +0 -14
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/calculateTotal/main.js +0 -5
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/calculateTotal/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/getProducts/main.d.ts +0 -6
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/getProducts/main.js +0 -41
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/getProducts/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/removeFromCart/main.d.ts +0 -15
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/removeFromCart/main.js +0 -3
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/backend/removeFromCart/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/components/Cart.d.ts +0 -9
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/components/Cart.tsx +0 -51
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/components/ProductCard.d.ts +0 -8
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/components/ProductCard.tsx +0 -27
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/components/ProductList.d.ts +0 -8
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/components/ProductList.tsx +0 -18
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/index.d.ts +0 -12
- package/package/components/copilot/chat/__tests__/app/initial/shopping_cart/frontend/index.tsx +0 -81
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/backend/decrementCounter/main.d.ts +0 -3
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/backend/decrementCounter/main.js +0 -3
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/backend/decrementCounter/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/backend/incrementCounter/main.d.ts +0 -3
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/backend/incrementCounter/main.js +0 -3
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/backend/incrementCounter/meta.json +0 -4
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/frontend/index.d.ts +0 -2
- package/package/components/copilot/chat/__tests__/app/initial/test1_counter_app/frontend/index.tsx +0 -38
- package/package/components/copilot/chat/__tests__/app/variants/baseline.d.ts +0 -6
- package/package/components/copilot/chat/__tests__/app/variants/baseline.js +0 -10
- package/package/components/copilot/chat/__tests__/app/variants/index.d.ts +0 -3
- package/package/components/copilot/chat/__tests__/app/variants/index.js +0 -3
- package/package/components/copilot/chat/__tests__/app/variants/streamlined.d.ts +0 -6
- package/package/components/copilot/chat/__tests__/app/variants/streamlined.js +0 -137
- package/package/components/copilot/chat/__tests__/flow/expected/test1.json +0 -134
- package/package/components/copilot/chat/__tests__/flow/expected/test2.json +0 -183
- package/package/components/copilot/chat/__tests__/flow/expected/test3.json +0 -204
- package/package/components/copilot/chat/__tests__/flow/expected/test4.json +0 -175
- package/package/components/copilot/chat/__tests__/flow/expected/test5_modify_simple.json +0 -68
- package/package/components/copilot/chat/__tests__/flow/expected/test6_modify_medium.json +0 -142
- package/package/components/copilot/chat/__tests__/flow/expected/test7_modify_complex.json +0 -136
- package/package/components/copilot/chat/__tests__/flow/flowChat.eval.test.js +0 -294
- package/package/components/copilot/chat/__tests__/flow/flowEvalComparison.d.ts +0 -17
- package/package/components/copilot/chat/__tests__/flow/flowEvalComparison.js +0 -49
- package/package/components/copilot/chat/__tests__/flow/flowEvalHelpers.d.ts +0 -12
- package/package/components/copilot/chat/__tests__/flow/flowEvalHelpers.js +0 -79
- package/package/components/copilot/chat/__tests__/flow/flowEvalRunner.d.ts +0 -50
- package/package/components/copilot/chat/__tests__/flow/flowEvalRunner.js +0 -102
- package/package/components/copilot/chat/__tests__/flow/initial/test5_initial.json +0 -53
- package/package/components/copilot/chat/__tests__/flow/initial/test6_initial.json +0 -68
- package/package/components/copilot/chat/__tests__/flow/initial/test7_initial.json +0 -120
- package/package/components/copilot/chat/__tests__/flow/variants/baseline.d.ts +0 -6
- package/package/components/copilot/chat/__tests__/flow/variants/baseline.js +0 -10
- package/package/components/copilot/chat/__tests__/flow/variants/index.d.ts +0 -3
- package/package/components/copilot/chat/__tests__/flow/variants/index.js +0 -3
- package/package/components/copilot/chat/__tests__/flow/variants/minimal-single-tool.d.ts +0 -15
- package/package/components/copilot/chat/__tests__/flow/variants/minimal-single-tool.js +0 -388
- package/package/components/copilot/chat/__tests__/shared/baseEvalRunner.d.ts +0 -45
- package/package/components/copilot/chat/__tests__/shared/baseEvalRunner.js +0 -121
- package/package/components/copilot/chat/__tests__/shared/baseLLMEvaluator.d.ts +0 -28
- package/package/components/copilot/chat/__tests__/shared/baseLLMEvaluator.js +0 -96
- package/package/components/copilot/chat/__tests__/shared/baseResultsWriter.d.ts +0 -32
- package/package/components/copilot/chat/__tests__/shared/baseResultsWriter.js +0 -130
- package/package/components/copilot/chat/__tests__/shared/baseVariants.d.ts +0 -45
- package/package/components/copilot/chat/__tests__/shared/baseVariants.js +0 -57
- package/package/components/copilot/chat/__tests__/shared/index.d.ts +0 -10
- package/package/components/copilot/chat/__tests__/shared/index.js +0 -5
- package/package/components/copilot/chat/__tests__/shared/types.d.ts +0 -105
- package/package/components/copilot/chat/__tests__/shared/types.js +0 -9
- package/package/components/copilot/chat/flow/utils.d.ts +0 -14
- package/package/components/copilot/chat/flow/utils.js +0 -108
- package/package/components/flows/agentToolUtils.test.js +0 -55
- /package/package/components/copilot/chat/{__tests__/app/appChat.eval.test.d.ts → app/core.test.d.ts} +0 -0
- /package/package/components/copilot/chat/{__tests__/flow/flowChat.eval.test.d.ts → flow/helperUtils.test.d.ts} +0 -0
- /package/package/components/{flows/agentToolUtils.test.d.ts → copilot/chat/flow/utils.test.d.ts} +0 -0
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"summary": "Data enrichment flow with parallel processing",
|
|
3
|
-
"value": {
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"id": "get_item",
|
|
7
|
-
"summary": "Get item from input",
|
|
8
|
-
"value": {
|
|
9
|
-
"type": "rawscript",
|
|
10
|
-
"language": "bun",
|
|
11
|
-
"content": "export async function main(item_id: string) {\n // Mock item lookup\n return {\n id: item_id,\n name: \"Product \" + item_id,\n sku: \"SKU-\" + item_id\n };\n}",
|
|
12
|
-
"input_transforms": {
|
|
13
|
-
"item_id": {
|
|
14
|
-
"type": "javascript",
|
|
15
|
-
"expr": "flow_input.item_id"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": "parallel_enrichment",
|
|
22
|
-
"summary": "Enrich data in parallel",
|
|
23
|
-
"value": {
|
|
24
|
-
"type": "branchall",
|
|
25
|
-
"branches": [
|
|
26
|
-
{
|
|
27
|
-
"summary": "Price enrichment",
|
|
28
|
-
"modules": [
|
|
29
|
-
{
|
|
30
|
-
"id": "enrich_price",
|
|
31
|
-
"summary": "Call pricing API",
|
|
32
|
-
"value": {
|
|
33
|
-
"type": "rawscript",
|
|
34
|
-
"language": "bun",
|
|
35
|
-
"content": "export async function main(item: any) {\n // Mock pricing API call with timeout handling\n try {\n return {\n itemId: item.id,\n price: 99.99,\n currency: \"USD\",\n discount: 10\n };\n } catch (e) {\n return { itemId: item.id, price: 0, currency: \"USD\", fallback: true };\n }\n}",
|
|
36
|
-
"input_transforms": {
|
|
37
|
-
"item": {
|
|
38
|
-
"type": "javascript",
|
|
39
|
-
"expr": "results.get_item"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"summary": "Inventory enrichment",
|
|
48
|
-
"modules": [
|
|
49
|
-
{
|
|
50
|
-
"id": "enrich_inventory",
|
|
51
|
-
"summary": "Call inventory API",
|
|
52
|
-
"value": {
|
|
53
|
-
"type": "rawscript",
|
|
54
|
-
"language": "bun",
|
|
55
|
-
"content": "export async function main(item: any) {\n // Mock inventory API call with timeout handling\n try {\n return {\n itemId: item.id,\n inStock: true,\n quantity: 150,\n warehouse: \"WH-001\"\n };\n } catch (e) {\n return { itemId: item.id, inStock: false, quantity: 0, fallback: true };\n }\n}",
|
|
56
|
-
"input_transforms": {
|
|
57
|
-
"item": {
|
|
58
|
-
"type": "javascript",
|
|
59
|
-
"expr": "results.get_item"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"summary": "Reviews enrichment",
|
|
68
|
-
"modules": [
|
|
69
|
-
{
|
|
70
|
-
"id": "enrich_reviews",
|
|
71
|
-
"summary": "Call reviews API",
|
|
72
|
-
"value": {
|
|
73
|
-
"type": "rawscript",
|
|
74
|
-
"language": "bun",
|
|
75
|
-
"content": "export async function main(item: any) {\n // Mock reviews API call with timeout handling\n try {\n return {\n itemId: item.id,\n averageRating: 4.5,\n reviewCount: 127,\n topReview: \"Great product!\"\n };\n } catch (e) {\n return { itemId: item.id, averageRating: 0, reviewCount: 0, fallback: true };\n }\n}",
|
|
76
|
-
"input_transforms": {
|
|
77
|
-
"item": {
|
|
78
|
-
"type": "javascript",
|
|
79
|
-
"expr": "results.get_item"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"id": "combine_data",
|
|
91
|
-
"summary": "Combine all enrichment data",
|
|
92
|
-
"value": {
|
|
93
|
-
"type": "rawscript",
|
|
94
|
-
"language": "bun",
|
|
95
|
-
"content": "export async function main(item: any, parallel_results: any) {\n // Extract results from parallel branches\n const [priceResult, inventoryResult, reviewsResult] = parallel_results;\n return {\n ...item,\n pricing: priceResult,\n inventory: inventoryResult,\n reviews: reviewsResult,\n hasFallbacks: priceResult?.fallback || inventoryResult?.fallback || reviewsResult?.fallback\n };\n}",
|
|
96
|
-
"input_transforms": {
|
|
97
|
-
"item": {
|
|
98
|
-
"type": "javascript",
|
|
99
|
-
"expr": "results.get_item"
|
|
100
|
-
},
|
|
101
|
-
"parallel_results": {
|
|
102
|
-
"type": "javascript",
|
|
103
|
-
"expr": "results.parallel_enrichment"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"id": "return_result",
|
|
110
|
-
"summary": "Return final result",
|
|
111
|
-
"value": {
|
|
112
|
-
"type": "rawscript",
|
|
113
|
-
"language": "bun",
|
|
114
|
-
"content": "export async function main(enriched_item: any) {\n return {\n success: true,\n data: enriched_item,\n enrichedAt: new Date().toISOString()\n };\n}",
|
|
115
|
-
"input_transforms": {
|
|
116
|
-
"enriched_item": {
|
|
117
|
-
"type": "javascript",
|
|
118
|
-
"expr": "results.combine_data"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
"schema": {
|
|
126
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
127
|
-
"properties": {
|
|
128
|
-
"item_id": {
|
|
129
|
-
"type": "string",
|
|
130
|
-
"description": "The ID of the item to enrich"
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"required": ["item_id"],
|
|
134
|
-
"type": "object"
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { runVariantComparison, writeFlowComparisonResults } from './flowEvalRunner';
|
|
3
|
-
import { BASELINE_VARIANT, MINIMAL_SINGLE_TOOL_VARIANT } from './variants';
|
|
4
|
-
// @ts-ignore - JSON import
|
|
5
|
-
import expectedTest1 from './expected/test1.json';
|
|
6
|
-
// @ts-ignore - JSON import
|
|
7
|
-
import expectedTest2 from './expected/test2.json';
|
|
8
|
-
// @ts-ignore - JSON import
|
|
9
|
-
import expectedTest3 from './expected/test3.json';
|
|
10
|
-
// @ts-ignore - JSON import
|
|
11
|
-
import expectedTest4 from './expected/test4.json';
|
|
12
|
-
// @ts-ignore - JSON import
|
|
13
|
-
import expectedTest5 from './expected/test5_modify_simple.json';
|
|
14
|
-
// @ts-ignore - JSON import
|
|
15
|
-
import expectedTest6 from './expected/test6_modify_medium.json';
|
|
16
|
-
// @ts-ignore - JSON import
|
|
17
|
-
import expectedTest7 from './expected/test7_modify_complex.json';
|
|
18
|
-
// @ts-ignore - JSON import
|
|
19
|
-
import initialTest5 from './initial/test5_initial.json';
|
|
20
|
-
// @ts-ignore - JSON import
|
|
21
|
-
import initialTest6 from './initial/test6_initial.json';
|
|
22
|
-
// @ts-ignore - JSON import
|
|
23
|
-
import initialTest7 from './initial/test7_initial.json';
|
|
24
|
-
// Get API keys from environment - tests will be skipped if none are set
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
|
|
29
|
-
const hasAnyKey = OPENAI_API_KEY || ANTHROPIC_API_KEY;
|
|
30
|
-
const describeWithApiKey = hasAnyKey ? describe : describe.skip;
|
|
31
|
-
const MODEL_VARIANTS = [
|
|
32
|
-
...(OPENAI_API_KEY
|
|
33
|
-
? [{ model: 'gpt-4o', provider: 'openai', apiKey: OPENAI_API_KEY }]
|
|
34
|
-
: []),
|
|
35
|
-
...(ANTHROPIC_API_KEY
|
|
36
|
-
? [
|
|
37
|
-
{
|
|
38
|
-
model: 'claude-haiku-4-5-20241022',
|
|
39
|
-
provider: 'anthropic',
|
|
40
|
-
apiKey: ANTHROPIC_API_KEY
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
: [])
|
|
44
|
-
];
|
|
45
|
-
const VARIANTS = [
|
|
46
|
-
...MODEL_VARIANTS.map((mv) => ({
|
|
47
|
-
...BASELINE_VARIANT,
|
|
48
|
-
model: mv.model,
|
|
49
|
-
name: `baseline-${mv.provider}-${mv.model}`,
|
|
50
|
-
_provider: mv.provider,
|
|
51
|
-
_apiKey: mv.apiKey
|
|
52
|
-
})),
|
|
53
|
-
...MODEL_VARIANTS.map((mv) => ({
|
|
54
|
-
...MINIMAL_SINGLE_TOOL_VARIANT,
|
|
55
|
-
model: mv.model,
|
|
56
|
-
name: `minimal-single-tool-${mv.provider}-${mv.model}`,
|
|
57
|
-
_provider: mv.provider,
|
|
58
|
-
_apiKey: mv.apiKey
|
|
59
|
-
}))
|
|
60
|
-
];
|
|
61
|
-
describeWithApiKey('Flow Chat LLM Evaluation', () => {
|
|
62
|
-
const TEST_TIMEOUT = 120_000;
|
|
63
|
-
if (!hasAnyKey) {
|
|
64
|
-
console.warn('No API keys set (OPENAI_API_KEY or ANTHROPIC_API_KEY), skipping tests');
|
|
65
|
-
}
|
|
66
|
-
it('test1: user role-based actions with loop and branches', async () => {
|
|
67
|
-
const USER_PROMPT = `
|
|
68
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
69
|
-
|
|
70
|
-
STEP 1: Fetch mock users from api
|
|
71
|
-
STEP 2: Filter only active users:
|
|
72
|
-
STEP 3: Loop on all users
|
|
73
|
-
STEP 4: Do branches based on user's role, do different action based on that. Roles are admin, user, moderator
|
|
74
|
-
STEP 5: Return action taken for each user
|
|
75
|
-
`;
|
|
76
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
77
|
-
expectedFlow: expectedTest1
|
|
78
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
79
|
-
// Write results to files
|
|
80
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
81
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
82
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
83
|
-
// Assert all variants succeeded
|
|
84
|
-
for (const result of results) {
|
|
85
|
-
expect(true).toBe(true);
|
|
86
|
-
// Log evaluation results
|
|
87
|
-
if (result.evaluationResult) {
|
|
88
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
89
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
90
|
-
if (result.evaluationResult.missingRequirements &&
|
|
91
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
92
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}, TEST_TIMEOUT);
|
|
97
|
-
it('test2: e-commerce order processing with inventory check and branching', async () => {
|
|
98
|
-
const USER_PROMPT = `
|
|
99
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
100
|
-
|
|
101
|
-
STEP 1: Receive order data from input (order has items array with name/price/quantity, customer_email, shipping_address)
|
|
102
|
-
STEP 2: Validate order - check all items have valid price > 0 and quantity > 0, return validation result
|
|
103
|
-
STEP 3: Calculate order total with 8% tax rate
|
|
104
|
-
STEP 4: Check inventory for each item (loop through items, return mock availability)
|
|
105
|
-
STEP 5: Branch based on inventory - if all items available, create shipment record; otherwise create backorder record
|
|
106
|
-
STEP 6: Send confirmation (mock email to customer_email)
|
|
107
|
-
STEP 7: Return final order summary with status
|
|
108
|
-
`;
|
|
109
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
110
|
-
expectedFlow: expectedTest2
|
|
111
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
112
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
113
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
114
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
115
|
-
for (const result of results) {
|
|
116
|
-
expect(true).toBe(true);
|
|
117
|
-
if (result.evaluationResult) {
|
|
118
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
119
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
120
|
-
if (result.evaluationResult.missingRequirements &&
|
|
121
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
122
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, TEST_TIMEOUT);
|
|
127
|
-
it('test3: data pipeline with parallel processing and quality-based routing', async () => {
|
|
128
|
-
const USER_PROMPT = `
|
|
129
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
130
|
-
|
|
131
|
-
STEP 1: Fetch list of data sources from configuration (return mock array of 3 source objects with id and url)
|
|
132
|
-
STEP 2: For each data source in parallel:
|
|
133
|
-
- Fetch raw data from the source (mock fetch returning sample records)
|
|
134
|
-
- Transform/clean the data (filter out invalid entries)
|
|
135
|
-
- Validate the transformed data (return validation score 0-100)
|
|
136
|
-
STEP 3: Aggregate all validated data into single dataset with combined records
|
|
137
|
-
STEP 4: Calculate overall data quality score (average of all validation scores)
|
|
138
|
-
STEP 5: Branch based on quality score:
|
|
139
|
-
- If score >= 90: Store in primary database and return success
|
|
140
|
-
- If score >= 70 and < 90: Store in secondary database with warning flag
|
|
141
|
-
- If score < 70: Store in quarantine and send alert
|
|
142
|
-
STEP 6: Return processing report with statistics (total records, quality score, destination)
|
|
143
|
-
`;
|
|
144
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
145
|
-
expectedFlow: expectedTest3
|
|
146
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
147
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
148
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
149
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
150
|
-
for (const result of results) {
|
|
151
|
-
expect(true).toBe(true);
|
|
152
|
-
if (result.evaluationResult) {
|
|
153
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
154
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
155
|
-
if (result.evaluationResult.missingRequirements &&
|
|
156
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
157
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}, TEST_TIMEOUT);
|
|
162
|
-
it('test4: AI agent with tools for customer support', async () => {
|
|
163
|
-
const USER_PROMPT = `
|
|
164
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
165
|
-
|
|
166
|
-
Create a customer support flow with an AI agent:
|
|
167
|
-
|
|
168
|
-
STEP 1: Receive customer query from input (customer_id string, query_text string)
|
|
169
|
-
STEP 2: Fetch customer profile and order history (mock data based on customer_id)
|
|
170
|
-
STEP 3: Use an AI agent to handle the customer query. The agent should have access to these tools:
|
|
171
|
-
- lookup_order: Takes order_id, returns order details (mock data)
|
|
172
|
-
- check_refund_eligibility: Takes order_id, returns eligibility status and reason
|
|
173
|
-
- create_support_ticket: Takes description and priority (low/medium/high), returns ticket_id
|
|
174
|
-
- search_faq: Takes search_query, returns relevant FAQ answers
|
|
175
|
-
The agent should use the customer profile context and respond helpfully.
|
|
176
|
-
STEP 4: Log the interaction to audit trail (customer_id, query, response summary)
|
|
177
|
-
STEP 5: Return the agent's response and any actions taken
|
|
178
|
-
`;
|
|
179
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
180
|
-
expectedFlow: expectedTest4
|
|
181
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
182
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
183
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
184
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
185
|
-
for (const result of results) {
|
|
186
|
-
expect(true).toBe(true);
|
|
187
|
-
if (result.evaluationResult) {
|
|
188
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
189
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
190
|
-
if (result.evaluationResult.missingRequirements &&
|
|
191
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
192
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}, TEST_TIMEOUT);
|
|
197
|
-
// ==================== MODIFICATION TESTS ====================
|
|
198
|
-
// These tests evaluate the LLM's ability to modify existing flows
|
|
199
|
-
it('test5: simple modification - add validation step to existing flow', async () => {
|
|
200
|
-
const USER_PROMPT = `
|
|
201
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
202
|
-
|
|
203
|
-
Modify this existing flow to add error handling:
|
|
204
|
-
- Add a new step after process_data called "validate_data" to validate the processed data
|
|
205
|
-
- The validation step should check if the data array is not empty
|
|
206
|
-
- If validation fails (empty array), it should return an error object with message "No data to save"
|
|
207
|
-
- If validation passes, return the data for the next step
|
|
208
|
-
- Update save_results to handle the validation result appropriately
|
|
209
|
-
`;
|
|
210
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
211
|
-
initialModules: initialTest5.value.modules,
|
|
212
|
-
initialSchema: initialTest5.schema,
|
|
213
|
-
expectedFlow: expectedTest5
|
|
214
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
215
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
216
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
217
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
218
|
-
for (const result of results) {
|
|
219
|
-
expect(true).toBe(true);
|
|
220
|
-
if (result.evaluationResult) {
|
|
221
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
222
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
223
|
-
if (result.evaluationResult.missingRequirements &&
|
|
224
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
225
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}, TEST_TIMEOUT);
|
|
230
|
-
it('test6: medium modification - add branching inside existing loop', async () => {
|
|
231
|
-
const USER_PROMPT = `
|
|
232
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
233
|
-
|
|
234
|
-
Modify the order processing loop to handle different order types:
|
|
235
|
-
- Inside the loop_orders, replace the simple process_order step with branching based on order.type
|
|
236
|
-
- For type "express": add a step called handle_express that marks as priority and calculates express shipping cost ($15.99)
|
|
237
|
-
- For type "standard": add a step called handle_standard that calculates standard shipping cost ($5.99)
|
|
238
|
-
- For type "pickup": add a step called handle_pickup that marks as no shipping required (cost $0)
|
|
239
|
-
- Move the original process_order step to the default branch for unknown order types
|
|
240
|
-
- Each branch step should return the orderId, shipping cost, and shipping type
|
|
241
|
-
`;
|
|
242
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
243
|
-
initialModules: initialTest6.value.modules,
|
|
244
|
-
initialSchema: initialTest6.schema,
|
|
245
|
-
expectedFlow: expectedTest6
|
|
246
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
247
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
248
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
249
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
250
|
-
for (const result of results) {
|
|
251
|
-
expect(true).toBe(true);
|
|
252
|
-
if (result.evaluationResult) {
|
|
253
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
254
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
255
|
-
if (result.evaluationResult.missingRequirements &&
|
|
256
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
257
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}, TEST_TIMEOUT);
|
|
262
|
-
it('test7: complex modification - refactor sequential to parallel execution', async () => {
|
|
263
|
-
const USER_PROMPT = `
|
|
264
|
-
THIS IS A TEST, CODE SHOULD BE MINIMAL FUNCTIONING CODE, IF WE NEED RETURN VALUES RETURN EXAMPLE VALUES
|
|
265
|
-
|
|
266
|
-
Refactor this flow for better performance by parallelizing the enrichment steps:
|
|
267
|
-
- The three enrichment steps (enrich_price, enrich_inventory, enrich_reviews) currently run sequentially
|
|
268
|
-
- Wrap them in a parallel branch (branchall) called "parallel_enrichment" so they run concurrently
|
|
269
|
-
- Each enrichment step should include basic error handling with try/catch that returns a fallback value if it fails
|
|
270
|
-
- Update the combine_data step to receive results from the parallel branch (results.parallel_enrichment returns an array of branch results)
|
|
271
|
-
- The combine_data step should check if any enrichment used a fallback value and set a hasFallbacks flag
|
|
272
|
-
- Keep get_item as the first step and return_result as the last step unchanged
|
|
273
|
-
`;
|
|
274
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
275
|
-
initialModules: initialTest7.value.modules,
|
|
276
|
-
initialSchema: initialTest7.schema,
|
|
277
|
-
expectedFlow: expectedTest7
|
|
278
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
279
|
-
const { summaryPath, flowPaths } = await writeFlowComparisonResults(USER_PROMPT, results);
|
|
280
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
281
|
-
console.log(`Flow files: ${flowPaths.join(', ')}`);
|
|
282
|
-
for (const result of results) {
|
|
283
|
-
expect(true).toBe(true);
|
|
284
|
-
if (result.evaluationResult) {
|
|
285
|
-
console.log(`[${result.variantName}] Resemblance Score: ${result.evaluationResult.resemblanceScore}/100`);
|
|
286
|
-
console.log(`[${result.variantName}] Statement: ${result.evaluationResult.statement}`);
|
|
287
|
-
if (result.evaluationResult.missingRequirements &&
|
|
288
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
289
|
-
console.log(`[${result.variantName}] Missing: ${result.evaluationResult.missingRequirements.join(', ')}`);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}, TEST_TIMEOUT);
|
|
294
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { FlowModule } from '../../../../../gen';
|
|
2
|
-
import type { EvaluationResult } from '../shared';
|
|
3
|
-
/**
|
|
4
|
-
* Expected flow structure for evaluation.
|
|
5
|
-
*/
|
|
6
|
-
export interface ExpectedFlow {
|
|
7
|
-
summary?: string;
|
|
8
|
-
value: {
|
|
9
|
-
modules: FlowModule[];
|
|
10
|
-
};
|
|
11
|
-
schema?: Record<string, any>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Evaluates how well a generated flow matches an expected flow and user request using an LLM.
|
|
15
|
-
* Returns a resemblance score (0-100), a qualitative statement, and any missing requirements.
|
|
16
|
-
*/
|
|
17
|
-
export declare function evaluateFlowComparison(generatedFlow: ExpectedFlow, expectedFlow: ExpectedFlow, userPrompt: string): Promise<EvaluationResult>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { evaluateWithLLM, BASE_EVALUATOR_RESPONSE_FORMAT } from '../shared';
|
|
2
|
-
/**
|
|
3
|
-
* Flow-specific evaluator system prompt.
|
|
4
|
-
*/
|
|
5
|
-
const FLOW_EVALUATOR_SYSTEM_PROMPT = `You are an expert evaluator for Windmill flow definitions. Your task is to evaluate a generated flow against:
|
|
6
|
-
1. The original user request/prompt
|
|
7
|
-
2. An expected reference flow
|
|
8
|
-
|
|
9
|
-
## Windmill Flow Context
|
|
10
|
-
- Flows consist of modules (steps) that execute sequentially
|
|
11
|
-
- Module types include: rawscript, forloopflow, branchone, branchall, script, flow, aiagent
|
|
12
|
-
- Each module has an id, value (containing type and config), and may have input_transforms
|
|
13
|
-
- input_transforms connect modules using expressions like "results.previous_step". Valid input_transforms are: static, javascript. Valid variables in javascript expressions are: results, flow_input, flow_input.iter.value (for forloopflow), flow_input.iter.index (for forloopflow).
|
|
14
|
-
- forloopflow contains nested modules that execute per iteration with access to flow_input.iter.value
|
|
15
|
-
- branchone executes first matching branch, branchall executes all matching branches
|
|
16
|
-
- Branches have conditional expressions (expr) that determine execution
|
|
17
|
-
- aiagent modules contain tools array with tool definitions
|
|
18
|
-
|
|
19
|
-
## Evaluation Criteria
|
|
20
|
-
1. **User Request Fulfillment**: Does the generated flow address ALL requirements from the user's original prompt?
|
|
21
|
-
- Are all requested steps present?
|
|
22
|
-
- Are the requested features implemented (loops, branches, specific logic)?
|
|
23
|
-
- Does the schema match what the user requested for inputs?
|
|
24
|
-
2. **Structure**: Are the module types and nesting structure appropriate for the task?
|
|
25
|
-
3. **Logic**: Does the flow accomplish the intended logical task?
|
|
26
|
-
4. **Connections**: Are input_transforms connecting data correctly between steps?
|
|
27
|
-
5. **Completeness**: Are all required steps present with no major omissions?
|
|
28
|
-
6. **Code Quality**: Is the code functionally correct (exact syntax doesn't need to match)?
|
|
29
|
-
|
|
30
|
-
## Important Notes
|
|
31
|
-
- Minor differences in variable names, code formatting, or exact wording are acceptable
|
|
32
|
-
- Focus on functional equivalence, not character-by-character matching
|
|
33
|
-
- The generated flow should achieve the same outcome as described in the user request
|
|
34
|
-
- Extra helper steps or slightly different approaches can still score high if they accomplish the goal
|
|
35
|
-
- If the user requested specific module types (like aiagent), verify they are used correctly
|
|
36
|
-
|
|
37
|
-
${BASE_EVALUATOR_RESPONSE_FORMAT}`;
|
|
38
|
-
/**
|
|
39
|
-
* Evaluates how well a generated flow matches an expected flow and user request using an LLM.
|
|
40
|
-
* Returns a resemblance score (0-100), a qualitative statement, and any missing requirements.
|
|
41
|
-
*/
|
|
42
|
-
export async function evaluateFlowComparison(generatedFlow, expectedFlow, userPrompt) {
|
|
43
|
-
return evaluateWithLLM({
|
|
44
|
-
userPrompt,
|
|
45
|
-
generatedOutput: generatedFlow,
|
|
46
|
-
expectedOutput: expectedFlow,
|
|
47
|
-
evaluatorSystemPrompt: FLOW_EVALUATOR_SYSTEM_PROMPT
|
|
48
|
-
});
|
|
49
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FlowAIChatHelpers } from '../../flow/core';
|
|
2
|
-
import type { FlowModule } from '../../../../../gen';
|
|
3
|
-
import type { ExtendedOpenFlow } from '../../../../flows/types';
|
|
4
|
-
/**
|
|
5
|
-
* Creates mock FlowAIChatHelpers for eval testing.
|
|
6
|
-
* Tracks flow state in memory and allows tool functions to modify it.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createFlowEvalHelpers(initialModules?: FlowModule[], initialSchema?: Record<string, any>): {
|
|
9
|
-
helpers: FlowAIChatHelpers;
|
|
10
|
-
getFlow: () => ExtendedOpenFlow;
|
|
11
|
-
getModules: () => FlowModule[];
|
|
12
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { findModuleById } from '../../shared';
|
|
2
|
-
import { inlineScriptStore, restoreInlineScriptReferences } from '../../flow/inlineScriptsUtils';
|
|
3
|
-
/**
|
|
4
|
-
* Creates mock FlowAIChatHelpers for eval testing.
|
|
5
|
-
* Tracks flow state in memory and allows tool functions to modify it.
|
|
6
|
-
*/
|
|
7
|
-
export function createFlowEvalHelpers(initialModules = [], initialSchema) {
|
|
8
|
-
let flow = {
|
|
9
|
-
value: { modules: structuredClone(initialModules) },
|
|
10
|
-
summary: '',
|
|
11
|
-
schema: initialSchema ?? {
|
|
12
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
13
|
-
properties: {},
|
|
14
|
-
required: [],
|
|
15
|
-
type: 'object'
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const helpers = {
|
|
19
|
-
getFlowAndSelectedId: () => ({ flow, selectedId: '' }),
|
|
20
|
-
getModules: (id) => {
|
|
21
|
-
if (!id)
|
|
22
|
-
return flow.value.modules;
|
|
23
|
-
const module = findModuleById(flow.value.modules, id);
|
|
24
|
-
return module ? [module] : [];
|
|
25
|
-
},
|
|
26
|
-
setSnapshot: () => {
|
|
27
|
-
// No-op for eval - we don't need snapshot tracking
|
|
28
|
-
},
|
|
29
|
-
revertToSnapshot: () => {
|
|
30
|
-
// No-op for eval
|
|
31
|
-
},
|
|
32
|
-
setCode: async (id, code) => {
|
|
33
|
-
const module = findModuleById(flow.value.modules, id);
|
|
34
|
-
if (module && module.value.type === 'rawscript') {
|
|
35
|
-
module.value.content = code;
|
|
36
|
-
}
|
|
37
|
-
// Keep store coherent for subsequent set_flow_json calls with references
|
|
38
|
-
inlineScriptStore.set(id, code);
|
|
39
|
-
},
|
|
40
|
-
setFlowJson: async (modules, schema) => {
|
|
41
|
-
if (modules) {
|
|
42
|
-
// Restore inline script references back to full content
|
|
43
|
-
const restoredModules = restoreInlineScriptReferences(modules);
|
|
44
|
-
flow.value.modules = restoredModules;
|
|
45
|
-
}
|
|
46
|
-
// Update schema if provided
|
|
47
|
-
if (schema !== undefined) {
|
|
48
|
-
flow.schema = schema;
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
getFlowInputsSchema: async () => flow.schema ?? {},
|
|
52
|
-
updateExprsToSet: (_id, _inputTransforms) => {
|
|
53
|
-
// No-op for eval - UI-only functionality
|
|
54
|
-
},
|
|
55
|
-
acceptAllModuleActions: () => {
|
|
56
|
-
// No-op for eval
|
|
57
|
-
},
|
|
58
|
-
rejectAllModuleActions: () => {
|
|
59
|
-
// No-op for eval
|
|
60
|
-
},
|
|
61
|
-
hasPendingChanges: () => false,
|
|
62
|
-
selectStep: (_id) => {
|
|
63
|
-
// No-op for eval
|
|
64
|
-
},
|
|
65
|
-
testFlow: async () => {
|
|
66
|
-
// Return mock job ID - we don't actually run flows in eval
|
|
67
|
-
return 'mock-job-id-' + Date.now();
|
|
68
|
-
},
|
|
69
|
-
getLintErrors: async () => {
|
|
70
|
-
// Return empty lint result for eval
|
|
71
|
-
return { errorCount: 0, warningCount: 0, errors: [], warnings: [] };
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return {
|
|
75
|
-
helpers,
|
|
76
|
-
getFlow: () => flow,
|
|
77
|
-
getModules: () => flow.value.modules
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { FlowModule } from '../../../../../gen';
|
|
2
|
-
import type { AIProvider } from '../../../../../gen/types.gen';
|
|
3
|
-
import type { ExtendedOpenFlow } from '../../../../flows/types';
|
|
4
|
-
import { type ExpectedFlow } from './flowEvalComparison';
|
|
5
|
-
import { type VariantConfig, type BaseEvalResult } from '../shared';
|
|
6
|
-
export type { ExpectedFlow } from './flowEvalComparison';
|
|
7
|
-
/**
|
|
8
|
-
* Flow-specific evaluation result.
|
|
9
|
-
*/
|
|
10
|
-
export interface FlowEvalResult extends BaseEvalResult<ExtendedOpenFlow> {
|
|
11
|
-
/** Alias for output to maintain API compatibility */
|
|
12
|
-
flow: ExtendedOpenFlow;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Options for running a flow evaluation.
|
|
16
|
-
*/
|
|
17
|
-
export interface FlowEvalOptions {
|
|
18
|
-
initialModules?: FlowModule[];
|
|
19
|
-
initialSchema?: Record<string, any>;
|
|
20
|
-
model?: string;
|
|
21
|
-
customSystemPrompt?: string;
|
|
22
|
-
maxIterations?: number;
|
|
23
|
-
variant?: VariantConfig;
|
|
24
|
-
expectedFlow?: ExpectedFlow;
|
|
25
|
-
/** AI provider (inferred from model name if omitted) */
|
|
26
|
-
provider?: AIProvider;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Runs a flow chat evaluation using the shared chat loop (same code path as production).
|
|
30
|
-
*/
|
|
31
|
-
export declare function runFlowEval(userPrompt: string, apiKey: string, options?: FlowEvalOptions): Promise<FlowEvalResult>;
|
|
32
|
-
/**
|
|
33
|
-
* Per-variant provider override.
|
|
34
|
-
*/
|
|
35
|
-
export interface VariantProviderOverride {
|
|
36
|
-
provider: AIProvider;
|
|
37
|
-
apiKey: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Runs the same prompt against multiple variants sequentially for comparison.
|
|
41
|
-
* Accepts optional per-variant provider/apiKey overrides.
|
|
42
|
-
*/
|
|
43
|
-
export declare function runVariantComparison(userPrompt: string, variants: VariantConfig[], defaultApiKey: string, baseOptions?: Omit<FlowEvalOptions, 'variant'>, providerOverrides?: VariantProviderOverride[]): Promise<FlowEvalResult[]>;
|
|
44
|
-
/**
|
|
45
|
-
* Writes flow comparison results to files.
|
|
46
|
-
*/
|
|
47
|
-
export declare function writeFlowComparisonResults(userPrompt: string, results: FlowEvalResult[], outputDir?: string): Promise<{
|
|
48
|
-
summaryPath: string;
|
|
49
|
-
flowPaths: string[];
|
|
50
|
-
}>;
|