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,153 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { runVariantComparison, writeAppComparisonResults } from './appEvalRunner';
|
|
3
|
-
import { BASELINE_VARIANT, STREAMLINED_VARIANT } from './variants';
|
|
4
|
-
import { loadAppFixtureForEval } from './appFixtureLoader';
|
|
5
|
-
// @ts-ignore - Node.js path
|
|
6
|
-
import { dirname, join } from 'path';
|
|
7
|
-
// @ts-ignore - Node.js url
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
// Get API keys from environment - tests will be skipped if none are set
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
|
|
14
|
-
const hasAnyKey = OPENAI_API_KEY || ANTHROPIC_API_KEY;
|
|
15
|
-
const describeWithApiKey = hasAnyKey ? describe : describe.skip;
|
|
16
|
-
// Get __dirname equivalent for ES modules
|
|
17
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
-
const __dirname = dirname(__filename);
|
|
19
|
-
const MODEL_VARIANTS = [
|
|
20
|
-
...(OPENAI_API_KEY
|
|
21
|
-
? [{ model: 'gpt-4o', provider: 'openai', apiKey: OPENAI_API_KEY }]
|
|
22
|
-
: []),
|
|
23
|
-
...(ANTHROPIC_API_KEY
|
|
24
|
-
? [
|
|
25
|
-
{
|
|
26
|
-
model: 'claude-haiku-4-5-20241022',
|
|
27
|
-
provider: 'anthropic',
|
|
28
|
-
apiKey: ANTHROPIC_API_KEY
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
: [])
|
|
32
|
-
];
|
|
33
|
-
const VARIANTS = [
|
|
34
|
-
...MODEL_VARIANTS.map((mv) => ({
|
|
35
|
-
...BASELINE_VARIANT,
|
|
36
|
-
model: mv.model,
|
|
37
|
-
name: `baseline-${mv.provider}-${mv.model}`,
|
|
38
|
-
_provider: mv.provider,
|
|
39
|
-
_apiKey: mv.apiKey
|
|
40
|
-
})),
|
|
41
|
-
...MODEL_VARIANTS.map((mv) => ({
|
|
42
|
-
...STREAMLINED_VARIANT,
|
|
43
|
-
model: mv.model,
|
|
44
|
-
name: `streamlined-${mv.provider}-${mv.model}`,
|
|
45
|
-
_provider: mv.provider,
|
|
46
|
-
_apiKey: mv.apiKey
|
|
47
|
-
}))
|
|
48
|
-
];
|
|
49
|
-
describeWithApiKey('App Chat LLM Evaluation', () => {
|
|
50
|
-
const TEST_TIMEOUT = 120_000;
|
|
51
|
-
if (!hasAnyKey) {
|
|
52
|
-
console.warn('No API keys set (OPENAI_API_KEY or ANTHROPIC_API_KEY), skipping tests');
|
|
53
|
-
}
|
|
54
|
-
it('test1: creates a simple counter app', async () => {
|
|
55
|
-
const USER_PROMPT = `Create a counter app with increment/decrement buttons`;
|
|
56
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, undefined, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
57
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
58
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
59
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
60
|
-
expect(true).toBe(true);
|
|
61
|
-
}, TEST_TIMEOUT);
|
|
62
|
-
it('test2: modifies existing counter app to add reset button', async () => {
|
|
63
|
-
const { initialFrontend, initialBackend } = await loadAppFixtureForEval(join(__dirname, 'initial', 'test1_counter_app'));
|
|
64
|
-
const USER_PROMPT = `Add a reset button that sets the counter back to 0`;
|
|
65
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
66
|
-
initialFrontend,
|
|
67
|
-
initialBackend
|
|
68
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
69
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
70
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
71
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
72
|
-
expect(true).toBe(true);
|
|
73
|
-
}, TEST_TIMEOUT);
|
|
74
|
-
// ==================== Shopping Cart Tests ====================
|
|
75
|
-
it('test3: shopping cart - add quantity selector', async () => {
|
|
76
|
-
const { initialFrontend, initialBackend } = await loadAppFixtureForEval(join(__dirname, 'initial', 'shopping_cart'));
|
|
77
|
-
const USER_PROMPT = `Add a quantity selector (+ and - buttons) to each cart item so users can adjust quantities without removing and re-adding items`;
|
|
78
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
79
|
-
initialFrontend,
|
|
80
|
-
initialBackend
|
|
81
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
82
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
83
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
84
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
85
|
-
expect(true).toBe(true);
|
|
86
|
-
}, TEST_TIMEOUT);
|
|
87
|
-
it('test4: shopping cart - add discount code', async () => {
|
|
88
|
-
const { initialFrontend, initialBackend } = await loadAppFixtureForEval(join(__dirname, 'initial', 'shopping_cart'));
|
|
89
|
-
const USER_PROMPT = `Add a discount code input field in the cart. When the code "SAVE10" is entered, apply a 10% discount to the total`;
|
|
90
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
91
|
-
initialFrontend,
|
|
92
|
-
initialBackend
|
|
93
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
94
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
95
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
96
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
97
|
-
expect(true).toBe(true);
|
|
98
|
-
}, TEST_TIMEOUT);
|
|
99
|
-
// ==================== File Manager Tests ====================
|
|
100
|
-
it('test5: file manager - add search bar', async () => {
|
|
101
|
-
const { initialFrontend, initialBackend } = await loadAppFixtureForEval(join(__dirname, 'initial', 'file_manager'));
|
|
102
|
-
const USER_PROMPT = `Add a search bar in the toolbar that filters files and folders by name as the user types`;
|
|
103
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
104
|
-
initialFrontend,
|
|
105
|
-
initialBackend
|
|
106
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
107
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
108
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
109
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
110
|
-
expect(true).toBe(true);
|
|
111
|
-
}, TEST_TIMEOUT);
|
|
112
|
-
it('test6: file manager - show file details', async () => {
|
|
113
|
-
const { initialFrontend, initialBackend } = await loadAppFixtureForEval(join(__dirname, 'initial', 'file_manager'));
|
|
114
|
-
const USER_PROMPT = `Show file size (formatted as KB/MB) and modified date in the file list for each item`;
|
|
115
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
116
|
-
initialFrontend,
|
|
117
|
-
initialBackend
|
|
118
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
119
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
120
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
121
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
122
|
-
expect(true).toBe(true);
|
|
123
|
-
}, TEST_TIMEOUT);
|
|
124
|
-
it('test7: file manager - add select all checkbox', async () => {
|
|
125
|
-
const { initialFrontend, initialBackend } = await loadAppFixtureForEval(join(__dirname, 'initial', 'file_manager'));
|
|
126
|
-
const USER_PROMPT = `Add a "Select All" checkbox in the file list header and individual checkboxes for each file. Add a "Delete Selected" button that appears when items are selected`;
|
|
127
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, {
|
|
128
|
-
initialFrontend,
|
|
129
|
-
initialBackend
|
|
130
|
-
}, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
131
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
132
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
133
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
134
|
-
expect(true).toBe(true);
|
|
135
|
-
}, TEST_TIMEOUT);
|
|
136
|
-
// ==================== From-Scratch Creation Tests ====================
|
|
137
|
-
it('test8: create quiz app from scratch', async () => {
|
|
138
|
-
const USER_PROMPT = `Create a multiple choice quiz app with 5 questions about general knowledge. Show one question at a time with 4 answer options. Track the score and show results at the end with percentage correct.`;
|
|
139
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, undefined, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
140
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
141
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
142
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
143
|
-
expect(true).toBe(true);
|
|
144
|
-
}, TEST_TIMEOUT);
|
|
145
|
-
it('test9: create recipe book from scratch', async () => {
|
|
146
|
-
const USER_PROMPT = `Create a recipe book app where users can add recipes with a name, ingredients list, and instructions. Include a search bar to filter recipes by name and the ability to delete recipes.`;
|
|
147
|
-
const results = await runVariantComparison(USER_PROMPT, VARIANTS, VARIANTS[0]._apiKey, undefined, VARIANTS.map((v) => ({ provider: v._provider, apiKey: v._apiKey })));
|
|
148
|
-
const { summaryPath, appPaths } = await writeAppComparisonResults(USER_PROMPT, results);
|
|
149
|
-
console.log(`\nResults written to: ${summaryPath}`);
|
|
150
|
-
console.log(`App files: ${appPaths.join(', ')}`);
|
|
151
|
-
expect(true).toBe(true);
|
|
152
|
-
}, TEST_TIMEOUT);
|
|
153
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { AppFiles, BackendRunnable } from '../../app/core';
|
|
2
|
-
import type { EvaluationResult } from '../shared';
|
|
3
|
-
/**
|
|
4
|
-
* Expected app structure for evaluation.
|
|
5
|
-
*/
|
|
6
|
-
export interface ExpectedApp {
|
|
7
|
-
frontend: Record<string, string>;
|
|
8
|
-
backend: Record<string, BackendRunnable>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Initial app state for evaluation context.
|
|
12
|
-
*/
|
|
13
|
-
export interface InitialApp {
|
|
14
|
-
frontend: Record<string, string>;
|
|
15
|
-
backend: Record<string, BackendRunnable>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Evaluates how well a generated app fulfills the user's request, considering any initial app state.
|
|
19
|
-
* Uses Anthropic API directly.
|
|
20
|
-
*/
|
|
21
|
-
export declare function evaluateAppGeneration(userPrompt: string, generatedApp: AppFiles, initialApp?: InitialApp): Promise<EvaluationResult>;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
2
|
-
import { BASE_EVALUATOR_RESPONSE_FORMAT } from '../shared';
|
|
3
|
-
/**
|
|
4
|
-
* System prompt for evaluating app generation without a reference expected app.
|
|
5
|
-
* Evaluates based on user request fulfillment and appropriate modifications to initial state.
|
|
6
|
-
*/
|
|
7
|
-
const APP_GENERATION_EVALUATOR_SYSTEM_PROMPT = `You are an expert evaluator for Windmill Raw App definitions. Your task is to evaluate a generated app based on:
|
|
8
|
-
1. The original user request/prompt
|
|
9
|
-
2. The initial app state (if any) - this is what the app looked like before the AI made changes
|
|
10
|
-
|
|
11
|
-
## Windmill Raw App Context
|
|
12
|
-
- Raw Apps consist of frontend files and backend runnables
|
|
13
|
-
- Frontend files are TypeScript/JavaScript files bundled with esbuild (entrypoint: index.tsx)
|
|
14
|
-
- Backend runnables can be: inline scripts (TypeScript/Python), workspace scripts, workspace flows, or hub scripts
|
|
15
|
-
- Frontend calls backend using \`await backend.<runnable_key>(args...)\`
|
|
16
|
-
- Each backend runnable has a key (identifier), name (description), type, and configuration
|
|
17
|
-
|
|
18
|
-
## Backend Runnable Types
|
|
19
|
-
- **inline**: Custom code with \`inlineScript.language\` and \`inlineScript.content\`
|
|
20
|
-
- **script**: Workspace script reference with \`path\`
|
|
21
|
-
- **flow**: Workspace flow reference with \`path\`
|
|
22
|
-
- **hubscript**: Hub script reference with \`path\`
|
|
23
|
-
|
|
24
|
-
## Evaluation Criteria
|
|
25
|
-
1. **User Request Fulfillment**: Does the generated app address ALL requirements from the user's original prompt?
|
|
26
|
-
- Are all requested features implemented?
|
|
27
|
-
- Does the frontend UI match the requirements?
|
|
28
|
-
- Are the correct backend runnables created?
|
|
29
|
-
2. **Appropriate Modifications** (if initial app was provided):
|
|
30
|
-
- Were the changes made relevant to the user's request?
|
|
31
|
-
- Was existing functionality preserved where appropriate?
|
|
32
|
-
- Were only necessary changes made (no unnecessary removals or additions)?
|
|
33
|
-
3. **Frontend Structure**: Are the frontend files correctly organized and implemented?
|
|
34
|
-
- Is the code valid TypeScript/JavaScript?
|
|
35
|
-
- Are components properly structured?
|
|
36
|
-
- Are backend calls correctly made?
|
|
37
|
-
4. **Backend Structure**: Are the backend runnables correctly configured?
|
|
38
|
-
- Do inline scripts have proper main functions?
|
|
39
|
-
- Are types and paths correct for non-inline runnables?
|
|
40
|
-
5. **Integration**: Does the frontend correctly call the backend?
|
|
41
|
-
- Are the runnable keys correctly referenced?
|
|
42
|
-
- Are arguments passed correctly?
|
|
43
|
-
6. **Code Quality**: Is the code functionally correct and well-structured?
|
|
44
|
-
|
|
45
|
-
## Important Notes
|
|
46
|
-
- Focus on whether the user's request was fulfilled, not on stylistic preferences
|
|
47
|
-
- If an initial app was provided, evaluate the appropriateness of the changes made
|
|
48
|
-
- For new apps (no initial state), evaluate completeness and correctness
|
|
49
|
-
- Extra helper functions or slightly different approaches can still score high if they accomplish the goal
|
|
50
|
-
|
|
51
|
-
${BASE_EVALUATOR_RESPONSE_FORMAT}`;
|
|
52
|
-
/**
|
|
53
|
-
* Evaluates how well a generated app fulfills the user's request, considering any initial app state.
|
|
54
|
-
* Uses Anthropic API directly.
|
|
55
|
-
*/
|
|
56
|
-
export async function evaluateAppGeneration(userPrompt, generatedApp, initialApp) {
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
59
|
-
if (!apiKey) {
|
|
60
|
-
return {
|
|
61
|
-
success: false,
|
|
62
|
-
resemblanceScore: 0,
|
|
63
|
-
statement: 'No API key available for evaluation',
|
|
64
|
-
error: 'ANTHROPIC_API_KEY not set'
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
const client = new Anthropic({ apiKey });
|
|
68
|
-
let userMessage = `## User's Original Request
|
|
69
|
-
${userPrompt}
|
|
70
|
-
|
|
71
|
-
`;
|
|
72
|
-
if (initialApp) {
|
|
73
|
-
userMessage += `## Initial App State (before AI modifications)
|
|
74
|
-
\`\`\`json
|
|
75
|
-
${JSON.stringify(initialApp, null, 2)}
|
|
76
|
-
\`\`\`
|
|
77
|
-
|
|
78
|
-
`;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
userMessage += `## Initial App State
|
|
82
|
-
No initial app was provided - this is a new app created from scratch.
|
|
83
|
-
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
userMessage += `## Generated App
|
|
87
|
-
\`\`\`json
|
|
88
|
-
${JSON.stringify(generatedApp, null, 2)}
|
|
89
|
-
\`\`\`
|
|
90
|
-
|
|
91
|
-
Please evaluate how well the generated app:
|
|
92
|
-
1. Fulfills ALL requirements from the user's original request
|
|
93
|
-
2. ${initialApp ? 'Makes appropriate modifications to the initial app state' : 'Implements a complete and correct new app'}`;
|
|
94
|
-
try {
|
|
95
|
-
const response = await client.messages.create({
|
|
96
|
-
model: 'claude-sonnet-4-5-20250514',
|
|
97
|
-
max_tokens: 2048,
|
|
98
|
-
system: APP_GENERATION_EVALUATOR_SYSTEM_PROMPT,
|
|
99
|
-
messages: [
|
|
100
|
-
{ role: 'user', content: userMessage }
|
|
101
|
-
],
|
|
102
|
-
temperature: 0
|
|
103
|
-
});
|
|
104
|
-
const textBlock = response.content.find((block) => block.type === 'text');
|
|
105
|
-
const content = textBlock?.text;
|
|
106
|
-
if (!content) {
|
|
107
|
-
return {
|
|
108
|
-
success: false,
|
|
109
|
-
resemblanceScore: 0,
|
|
110
|
-
statement: 'No response from evaluator',
|
|
111
|
-
error: 'Empty response from LLM'
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
// Parse JSON response - handle potential markdown code blocks
|
|
115
|
-
let jsonContent = content.trim();
|
|
116
|
-
if (jsonContent.startsWith('```')) {
|
|
117
|
-
jsonContent = jsonContent.replace(/^```(?:json)?\n?/, '').replace(/\n?```$/, '');
|
|
118
|
-
}
|
|
119
|
-
const parsed = JSON.parse(jsonContent);
|
|
120
|
-
return {
|
|
121
|
-
success: true,
|
|
122
|
-
resemblanceScore: Math.max(0, Math.min(100, Math.round(parsed.resemblanceScore))),
|
|
123
|
-
statement: parsed.statement,
|
|
124
|
-
missingRequirements: parsed.missingRequirements ?? []
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
catch (err) {
|
|
128
|
-
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
129
|
-
return {
|
|
130
|
-
success: false,
|
|
131
|
-
resemblanceScore: 0,
|
|
132
|
-
statement: 'Evaluation failed',
|
|
133
|
-
error: errorMessage
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AppAIChatHelpers, AppFiles, BackendRunnable } from '../../app/core';
|
|
2
|
-
/**
|
|
3
|
-
* Creates mock AppAIChatHelpers for eval testing.
|
|
4
|
-
* Tracks app files state in memory and allows tool functions to modify it.
|
|
5
|
-
*/
|
|
6
|
-
export declare function createAppEvalHelpers(initialFrontend?: Record<string, string>, initialBackend?: Record<string, BackendRunnable>): {
|
|
7
|
-
helpers: AppAIChatHelpers;
|
|
8
|
-
getFiles: () => AppFiles;
|
|
9
|
-
getFrontend: () => {
|
|
10
|
-
[x: string]: string;
|
|
11
|
-
};
|
|
12
|
-
getBackend: () => {
|
|
13
|
-
[x: string]: BackendRunnable;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an empty lint result (no errors or warnings).
|
|
3
|
-
*/
|
|
4
|
-
function createEmptyLintResult() {
|
|
5
|
-
return {
|
|
6
|
-
errorCount: 0,
|
|
7
|
-
warningCount: 0,
|
|
8
|
-
errors: { frontend: {}, backend: {} },
|
|
9
|
-
warnings: { frontend: {}, backend: {} }
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Creates mock AppAIChatHelpers for eval testing.
|
|
14
|
-
* Tracks app files state in memory and allows tool functions to modify it.
|
|
15
|
-
*/
|
|
16
|
-
export function createAppEvalHelpers(initialFrontend = {}, initialBackend = {}) {
|
|
17
|
-
// In-memory state
|
|
18
|
-
let frontend = { ...initialFrontend };
|
|
19
|
-
let backend = { ...initialBackend };
|
|
20
|
-
let snapshotId = 0;
|
|
21
|
-
const snapshots = new Map();
|
|
22
|
-
const helpers = {
|
|
23
|
-
// Frontend file operations
|
|
24
|
-
listFrontendFiles: () => Object.keys(frontend),
|
|
25
|
-
getFrontendFile: (path) => frontend[path],
|
|
26
|
-
getFrontendFiles: () => ({ ...frontend }),
|
|
27
|
-
setFrontendFile: (path, content) => {
|
|
28
|
-
frontend[path] = content;
|
|
29
|
-
// Return mock lint result - in real usage this would validate the file
|
|
30
|
-
return createEmptyLintResult();
|
|
31
|
-
},
|
|
32
|
-
deleteFrontendFile: (path) => {
|
|
33
|
-
delete frontend[path];
|
|
34
|
-
},
|
|
35
|
-
// Backend runnable operations
|
|
36
|
-
listBackendRunnables: () => {
|
|
37
|
-
return Object.entries(backend).map(([key, runnable]) => ({
|
|
38
|
-
key,
|
|
39
|
-
name: runnable.name
|
|
40
|
-
}));
|
|
41
|
-
},
|
|
42
|
-
getBackendRunnable: (key) => backend[key],
|
|
43
|
-
getBackendRunnables: () => ({ ...backend }),
|
|
44
|
-
setBackendRunnable: async (key, runnable) => {
|
|
45
|
-
backend[key] = runnable;
|
|
46
|
-
// Return mock lint result - in real usage this would validate the runnable
|
|
47
|
-
return createEmptyLintResult();
|
|
48
|
-
},
|
|
49
|
-
deleteBackendRunnable: (key) => {
|
|
50
|
-
delete backend[key];
|
|
51
|
-
},
|
|
52
|
-
// Combined view
|
|
53
|
-
getFiles: () => ({
|
|
54
|
-
frontend: { ...frontend },
|
|
55
|
-
backend: { ...backend }
|
|
56
|
-
}),
|
|
57
|
-
getSelectedContext: () => ({
|
|
58
|
-
type: 'none'
|
|
59
|
-
}),
|
|
60
|
-
// Snapshot management
|
|
61
|
-
snapshot: () => {
|
|
62
|
-
const id = ++snapshotId;
|
|
63
|
-
snapshots.set(id, {
|
|
64
|
-
frontend: { ...frontend },
|
|
65
|
-
backend: { ...backend }
|
|
66
|
-
});
|
|
67
|
-
return id;
|
|
68
|
-
},
|
|
69
|
-
revertToSnapshot: (id) => {
|
|
70
|
-
const snap = snapshots.get(id);
|
|
71
|
-
if (snap) {
|
|
72
|
-
frontend = { ...snap.frontend };
|
|
73
|
-
backend = { ...snap.backend };
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
// Linting
|
|
77
|
-
lint: () => {
|
|
78
|
-
// Return mock lint result - no actual linting in eval
|
|
79
|
-
return createEmptyLintResult();
|
|
80
|
-
},
|
|
81
|
-
// Data table operations (mock implementation for testing)
|
|
82
|
-
getDatatables: async () => {
|
|
83
|
-
// Return empty array for eval testing - no real datatables in test context
|
|
84
|
-
return [];
|
|
85
|
-
},
|
|
86
|
-
getAvailableDatatableNames: () => {
|
|
87
|
-
// Return empty array for eval testing - no real datatables in test context
|
|
88
|
-
return [];
|
|
89
|
-
},
|
|
90
|
-
execDatatableSql: async (_datatableName, _sql, _newTable) => {
|
|
91
|
-
// Return success with empty result for eval testing
|
|
92
|
-
return { success: true, result: [] };
|
|
93
|
-
},
|
|
94
|
-
addTableToWhitelist: (_datatableName, _schemaName, _tableName) => {
|
|
95
|
-
// No-op for eval testing - tables are not tracked in test context
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return {
|
|
99
|
-
helpers,
|
|
100
|
-
getFiles: () => ({
|
|
101
|
-
frontend: { ...frontend },
|
|
102
|
-
backend: { ...backend }
|
|
103
|
-
}),
|
|
104
|
-
getFrontend: () => ({ ...frontend }),
|
|
105
|
-
getBackend: () => ({ ...backend })
|
|
106
|
-
};
|
|
107
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { AppFiles, BackendRunnable } from '../../app/core';
|
|
2
|
-
import { type VariantConfig, type BaseEvalResult } from '../shared';
|
|
3
|
-
import type { AIProvider } from '../../../../../gen/types.gen';
|
|
4
|
-
export type { InitialApp } from './appEvalComparison';
|
|
5
|
-
/**
|
|
6
|
-
* App-specific evaluation result.
|
|
7
|
-
*/
|
|
8
|
-
export interface AppEvalResult extends BaseEvalResult<AppFiles> {
|
|
9
|
-
/** Alias for output to maintain API compatibility */
|
|
10
|
-
files: AppFiles;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Options for running an app evaluation.
|
|
14
|
-
*/
|
|
15
|
-
export interface AppEvalOptions {
|
|
16
|
-
initialFrontend?: Record<string, string>;
|
|
17
|
-
initialBackend?: Record<string, BackendRunnable>;
|
|
18
|
-
model?: string;
|
|
19
|
-
customSystemPrompt?: string;
|
|
20
|
-
maxIterations?: number;
|
|
21
|
-
variant?: VariantConfig;
|
|
22
|
-
/** Whether to evaluate the generated app with LLM. Default: true. Set to false to skip evaluation. */
|
|
23
|
-
evaluateWithLLM?: boolean;
|
|
24
|
-
/** AI provider (inferred from model name if omitted) */
|
|
25
|
-
provider?: AIProvider;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Runs an app chat evaluation using the shared chat loop (same code path as production).
|
|
29
|
-
*/
|
|
30
|
-
export declare function runAppEval(userPrompt: string, apiKey: string, options?: AppEvalOptions): Promise<AppEvalResult>;
|
|
31
|
-
/**
|
|
32
|
-
* Per-variant provider override.
|
|
33
|
-
*/
|
|
34
|
-
export interface VariantProviderOverride {
|
|
35
|
-
provider: AIProvider;
|
|
36
|
-
apiKey: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Runs the same prompt against multiple variants sequentially for comparison.
|
|
40
|
-
* Accepts optional per-variant provider/apiKey overrides.
|
|
41
|
-
*/
|
|
42
|
-
export declare function runVariantComparison(userPrompt: string, variants: VariantConfig[], defaultApiKey: string, baseOptions?: Omit<AppEvalOptions, 'variant'>, providerOverrides?: VariantProviderOverride[]): Promise<AppEvalResult[]>;
|
|
43
|
-
/**
|
|
44
|
-
* Writes app comparison results to a folder-based structure.
|
|
45
|
-
* Each variant gets its own folder with frontend/, backend/, and details.json.
|
|
46
|
-
*/
|
|
47
|
-
export declare function writeAppComparisonResults(userPrompt: string, results: AppEvalResult[], outputDir?: string): Promise<{
|
|
48
|
-
summaryPath: string;
|
|
49
|
-
appPaths: string[];
|
|
50
|
-
}>;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { getAppTools, prepareAppSystemMessage, prepareAppUserMessage } from '../../app/core';
|
|
2
|
-
import { createAppEvalHelpers } from './appEvalHelpers';
|
|
3
|
-
import { evaluateAppGeneration } from './appEvalComparison';
|
|
4
|
-
import { runEval, resolveSystemPrompt, resolveTools, resolveModel } from '../shared';
|
|
5
|
-
import { writeAppComparisonResultsToFolders } from './appResultsWriter';
|
|
6
|
-
/**
|
|
7
|
-
* App-specific variant defaults.
|
|
8
|
-
*/
|
|
9
|
-
const appDefaults = {
|
|
10
|
-
prepareSystemMessage: prepareAppSystemMessage,
|
|
11
|
-
tools: getAppTools()
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Runs an app chat evaluation using the shared chat loop (same code path as production).
|
|
15
|
-
*/
|
|
16
|
-
export async function runAppEval(userPrompt, apiKey, options) {
|
|
17
|
-
const { helpers, getFiles } = createAppEvalHelpers(options?.initialFrontend ?? {}, options?.initialBackend ?? {});
|
|
18
|
-
// Resolve variant configuration
|
|
19
|
-
const variantName = options?.variant?.name ?? 'baseline';
|
|
20
|
-
const systemMessage = resolveSystemPrompt(options?.variant, appDefaults, options?.customSystemPrompt);
|
|
21
|
-
const { tools } = resolveTools(options?.variant, appDefaults);
|
|
22
|
-
const model = resolveModel(options?.variant, options?.model);
|
|
23
|
-
// Build user message
|
|
24
|
-
const userMessage = prepareAppUserMessage(userPrompt, helpers.getSelectedContext());
|
|
25
|
-
// Run the base evaluation
|
|
26
|
-
const rawResult = await runEval({
|
|
27
|
-
userPrompt,
|
|
28
|
-
systemMessage,
|
|
29
|
-
userMessage,
|
|
30
|
-
tools,
|
|
31
|
-
helpers,
|
|
32
|
-
apiKey,
|
|
33
|
-
getOutput: getFiles,
|
|
34
|
-
options: {
|
|
35
|
-
maxIterations: options?.maxIterations,
|
|
36
|
-
model,
|
|
37
|
-
workspace: 'test-workspace',
|
|
38
|
-
provider: options?.provider
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
// Run LLM evaluation unless explicitly disabled
|
|
42
|
-
let evaluationResult;
|
|
43
|
-
if (options?.evaluateWithLLM !== false) {
|
|
44
|
-
const generatedApp = getFiles();
|
|
45
|
-
const initialApp = options?.initialFrontend || options?.initialBackend
|
|
46
|
-
? {
|
|
47
|
-
frontend: options.initialFrontend ?? {},
|
|
48
|
-
backend: options.initialBackend ?? {}
|
|
49
|
-
}
|
|
50
|
-
: undefined;
|
|
51
|
-
evaluationResult = await evaluateAppGeneration(userPrompt, generatedApp, initialApp);
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
...rawResult,
|
|
55
|
-
variantName,
|
|
56
|
-
files: rawResult.output,
|
|
57
|
-
evaluationResult
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Runs the same prompt against multiple variants sequentially for comparison.
|
|
62
|
-
* Accepts optional per-variant provider/apiKey overrides.
|
|
63
|
-
*/
|
|
64
|
-
export async function runVariantComparison(userPrompt, variants, defaultApiKey, baseOptions, providerOverrides) {
|
|
65
|
-
const results = await Promise.all(variants.map(async (variant, i) => {
|
|
66
|
-
const override = providerOverrides?.[i];
|
|
67
|
-
return await runAppEval(userPrompt, override?.apiKey ?? defaultApiKey, {
|
|
68
|
-
...baseOptions,
|
|
69
|
-
variant,
|
|
70
|
-
provider: override?.provider ?? baseOptions?.provider
|
|
71
|
-
});
|
|
72
|
-
}));
|
|
73
|
-
return results;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Writes app comparison results to a folder-based structure.
|
|
77
|
-
* Each variant gets its own folder with frontend/, backend/, and details.json.
|
|
78
|
-
*/
|
|
79
|
-
export async function writeAppComparisonResults(userPrompt, results, outputDir) {
|
|
80
|
-
// @ts-ignore
|
|
81
|
-
const { dirname, join } = await import('path');
|
|
82
|
-
// @ts-ignore
|
|
83
|
-
const { fileURLToPath } = await import('url');
|
|
84
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
85
|
-
const __dirname = dirname(__filename);
|
|
86
|
-
const resultsDir = outputDir ?? join(__dirname, 'results');
|
|
87
|
-
const result = await writeAppComparisonResultsToFolders({
|
|
88
|
-
userPrompt,
|
|
89
|
-
results,
|
|
90
|
-
outputDir: resultsDir
|
|
91
|
-
});
|
|
92
|
-
return { summaryPath: result.summaryPath, appPaths: result.variantPaths };
|
|
93
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AppFiles, BackendRunnable } from '../../app/core';
|
|
2
|
-
/**
|
|
3
|
-
* Loads an app fixture from a directory structure.
|
|
4
|
-
*
|
|
5
|
-
* Expected structure:
|
|
6
|
-
* ```
|
|
7
|
-
* fixturePath/
|
|
8
|
-
* ├── frontend/
|
|
9
|
-
* │ └── index.tsx # → frontend["/index.tsx"]
|
|
10
|
-
* │ └── components/
|
|
11
|
-
* │ └── Button.tsx # → frontend["/components/Button.tsx"]
|
|
12
|
-
* └── backend/
|
|
13
|
-
* └── incrementCounter/
|
|
14
|
-
* ├── main.ts # The code content
|
|
15
|
-
* └── meta.json # { "name": "...", "language": "bun" }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @param fixturePath - Path to the fixture directory
|
|
19
|
-
* @returns AppFiles object with frontend and backend
|
|
20
|
-
*/
|
|
21
|
-
export declare function loadAppFixture(fixturePath: string): Promise<AppFiles>;
|
|
22
|
-
/**
|
|
23
|
-
* Loads an app fixture and returns the separate frontend and backend objects.
|
|
24
|
-
* Convenience function for use with runAppEval options.
|
|
25
|
-
*/
|
|
26
|
-
export declare function loadAppFixtureForEval(fixturePath: string): Promise<{
|
|
27
|
-
initialFrontend: Record<string, string>;
|
|
28
|
-
initialBackend: Record<string, BackendRunnable>;
|
|
29
|
-
}>;
|