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,32 +0,0 @@
|
|
|
1
|
-
import type { BaseEvalResult } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Generates a timestamp string suitable for filenames.
|
|
4
|
-
* Format: 2024-01-15T10-30-45-123Z (ISO but with dashes instead of colons)
|
|
5
|
-
*/
|
|
6
|
-
export declare function generateTimestamp(): string;
|
|
7
|
-
/**
|
|
8
|
-
* Parameters for writing comparison results.
|
|
9
|
-
*/
|
|
10
|
-
export interface WriteResultsParams<TOutput> {
|
|
11
|
-
/** User prompt that was tested */
|
|
12
|
-
userPrompt: string;
|
|
13
|
-
/** Results from all variants */
|
|
14
|
-
results: BaseEvalResult<TOutput>[];
|
|
15
|
-
/** Directory to write results to */
|
|
16
|
-
outputDir: string;
|
|
17
|
-
/** Function to format domain-specific output for JSON files */
|
|
18
|
-
formatOutput: (output: TOutput) => unknown;
|
|
19
|
-
/** Label for the output type (e.g., 'flow', 'app') */
|
|
20
|
-
outputLabel?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Writes comparison results to files in the results folder.
|
|
24
|
-
* Creates:
|
|
25
|
-
* - summary.md - Summary with prompt and results table
|
|
26
|
-
* - {variant_name}.json - Full result with metadata for each variant
|
|
27
|
-
* - {variant_name}_{outputLabel}.json - Clean output for each variant
|
|
28
|
-
*/
|
|
29
|
-
export declare function writeComparisonResults<TOutput>(params: WriteResultsParams<TOutput>): Promise<{
|
|
30
|
-
summaryPath: string;
|
|
31
|
-
outputPaths: string[];
|
|
32
|
-
}>;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { writeFile, mkdir } from 'fs/promises';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import { join, dirname } from 'path';
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
/**
|
|
8
|
-
* Generates a timestamp string suitable for filenames.
|
|
9
|
-
* Format: 2024-01-15T10-30-45-123Z (ISO but with dashes instead of colons)
|
|
10
|
-
*/
|
|
11
|
-
export function generateTimestamp() {
|
|
12
|
-
return new Date().toISOString().replace(/:/g, '-');
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Writes comparison results to files in the results folder.
|
|
16
|
-
* Creates:
|
|
17
|
-
* - summary.md - Summary with prompt and results table
|
|
18
|
-
* - {variant_name}.json - Full result with metadata for each variant
|
|
19
|
-
* - {variant_name}_{outputLabel}.json - Clean output for each variant
|
|
20
|
-
*/
|
|
21
|
-
export async function writeComparisonResults(params) {
|
|
22
|
-
const { userPrompt, results, outputDir, formatOutput, outputLabel = 'output' } = params;
|
|
23
|
-
const timestamp = generateTimestamp();
|
|
24
|
-
// Ensure results directory exists
|
|
25
|
-
await mkdir(outputDir, { recursive: true });
|
|
26
|
-
const resultFolder = join(outputDir, timestamp);
|
|
27
|
-
await mkdir(resultFolder, { recursive: true });
|
|
28
|
-
// Check if any results have evaluation data
|
|
29
|
-
const hasEvaluation = results.some((r) => r.evaluationResult);
|
|
30
|
-
// Build summary markdown
|
|
31
|
-
const summaryLines = [
|
|
32
|
-
`# Eval Results - ${timestamp}`,
|
|
33
|
-
'',
|
|
34
|
-
'## User Prompt',
|
|
35
|
-
'```',
|
|
36
|
-
userPrompt.trim(),
|
|
37
|
-
'```',
|
|
38
|
-
'',
|
|
39
|
-
'## Results',
|
|
40
|
-
''
|
|
41
|
-
];
|
|
42
|
-
// Add results table header based on whether evaluation data exists
|
|
43
|
-
if (hasEvaluation) {
|
|
44
|
-
summaryLines.push('| Variant | Success | Total Tokens | Tool Calls | Iterations | Resemblance Score |');
|
|
45
|
-
summaryLines.push('|---------|---------|--------------|------------|------------|-------------------|');
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
summaryLines.push('| Variant | Success | Total Tokens | Tool Calls | Iterations |');
|
|
49
|
-
summaryLines.push('|---------|---------|--------------|------------|------------|');
|
|
50
|
-
}
|
|
51
|
-
for (const result of results) {
|
|
52
|
-
const baseRow = `| ${result.variantName} | ${result.success} | ${result.tokenUsage.total} | ${result.toolsCalled.length} | ${result.iterations}`;
|
|
53
|
-
if (hasEvaluation) {
|
|
54
|
-
const score = result.evaluationResult?.resemblanceScore ?? 'N/A';
|
|
55
|
-
summaryLines.push(`${baseRow} | ${score} |`);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
summaryLines.push(`${baseRow} |`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// Add evaluation details section if available
|
|
62
|
-
if (hasEvaluation) {
|
|
63
|
-
summaryLines.push('');
|
|
64
|
-
summaryLines.push('## Evaluation Details');
|
|
65
|
-
summaryLines.push('');
|
|
66
|
-
for (const result of results) {
|
|
67
|
-
if (result.evaluationResult) {
|
|
68
|
-
summaryLines.push(`### ${result.variantName}`);
|
|
69
|
-
summaryLines.push('');
|
|
70
|
-
summaryLines.push(`**Score:** ${result.evaluationResult.resemblanceScore}/100`);
|
|
71
|
-
summaryLines.push('');
|
|
72
|
-
summaryLines.push(`**Statement:** ${result.evaluationResult.statement}`);
|
|
73
|
-
summaryLines.push('');
|
|
74
|
-
if (result.evaluationResult.missingRequirements &&
|
|
75
|
-
result.evaluationResult.missingRequirements.length > 0) {
|
|
76
|
-
summaryLines.push('**Missing Requirements:**');
|
|
77
|
-
for (const req of result.evaluationResult.missingRequirements) {
|
|
78
|
-
summaryLines.push(`- ${req}`);
|
|
79
|
-
}
|
|
80
|
-
summaryLines.push('');
|
|
81
|
-
}
|
|
82
|
-
if (result.evaluationResult.error) {
|
|
83
|
-
summaryLines.push(`**Error:** ${result.evaluationResult.error}`);
|
|
84
|
-
summaryLines.push('');
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Add errors section for failed variants
|
|
90
|
-
const failedResults = results.filter((r) => !r.success && r.error);
|
|
91
|
-
if (failedResults.length > 0) {
|
|
92
|
-
summaryLines.push('');
|
|
93
|
-
summaryLines.push('## Errors');
|
|
94
|
-
summaryLines.push('');
|
|
95
|
-
for (const result of failedResults) {
|
|
96
|
-
summaryLines.push(`### ${result.variantName}`);
|
|
97
|
-
summaryLines.push('');
|
|
98
|
-
summaryLines.push('```');
|
|
99
|
-
summaryLines.push(result.error);
|
|
100
|
-
summaryLines.push('```');
|
|
101
|
-
summaryLines.push('');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const outputPaths = [];
|
|
105
|
-
for (const result of results) {
|
|
106
|
-
const resultFilename = `${result.variantName}.json`;
|
|
107
|
-
const resultPath = join(resultFolder, resultFilename);
|
|
108
|
-
outputPaths.push(resultPath);
|
|
109
|
-
const outputFilename = `${result.variantName}_${outputLabel}.json`;
|
|
110
|
-
const outputPath = join(resultFolder, outputFilename);
|
|
111
|
-
// Write result JSON file (with metadata)
|
|
112
|
-
const resultData = {
|
|
113
|
-
variantName: result.variantName,
|
|
114
|
-
success: result.success,
|
|
115
|
-
error: result.error,
|
|
116
|
-
evaluationResult: result.evaluationResult,
|
|
117
|
-
toolsCalled: result.toolsCalled,
|
|
118
|
-
toolCallDetails: result.toolCallDetails,
|
|
119
|
-
messages: result.messages
|
|
120
|
-
};
|
|
121
|
-
await writeFile(resultPath, JSON.stringify(resultData, null, 2));
|
|
122
|
-
// Write clean output JSON file (domain-specific format)
|
|
123
|
-
const outputData = formatOutput(result.output);
|
|
124
|
-
await writeFile(outputPath, JSON.stringify(outputData, null, 2));
|
|
125
|
-
}
|
|
126
|
-
// Write summary markdown file
|
|
127
|
-
const summaryPath = join(resultFolder, `summary.md`);
|
|
128
|
-
await writeFile(summaryPath, summaryLines.join('\n'));
|
|
129
|
-
return { summaryPath, outputPaths };
|
|
130
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionFunctionTool, ChatCompletionSystemMessageParam } from 'openai/resources/chat/completions.mjs';
|
|
2
|
-
import type { ChatCompletionTool } from 'openai/resources/chat/completions.mjs';
|
|
3
|
-
import type { VariantConfig } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Generic tool interface that matches the structure used across chat modules.
|
|
6
|
-
*/
|
|
7
|
-
export interface Tool<THelpers> {
|
|
8
|
-
def: ChatCompletionFunctionTool;
|
|
9
|
-
fn: (params: {
|
|
10
|
-
args: Record<string, unknown>;
|
|
11
|
-
workspace: string;
|
|
12
|
-
helpers: THelpers;
|
|
13
|
-
toolCallbacks: {
|
|
14
|
-
setToolStatus: (...args: unknown[]) => void;
|
|
15
|
-
removeToolStatus: (...args: unknown[]) => void;
|
|
16
|
-
};
|
|
17
|
-
toolId: string;
|
|
18
|
-
}) => Promise<string>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Domain-specific defaults for variant resolution.
|
|
22
|
-
*/
|
|
23
|
-
export interface VariantDefaults<THelpers> {
|
|
24
|
-
/** Function to prepare system message, optionally with custom prompt */
|
|
25
|
-
prepareSystemMessage: (customPrompt?: string) => ChatCompletionSystemMessageParam;
|
|
26
|
-
/** Available tools for the domain */
|
|
27
|
-
tools: Tool<THelpers>[];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Resolves system prompt from variant config.
|
|
31
|
-
* Returns the appropriate ChatCompletionSystemMessageParam based on config.
|
|
32
|
-
*/
|
|
33
|
-
export declare function resolveSystemPrompt<THelpers>(variant: VariantConfig | undefined, defaults: VariantDefaults<THelpers>, fallbackCustomPrompt?: string): ChatCompletionSystemMessageParam;
|
|
34
|
-
/**
|
|
35
|
-
* Resolves tools from variant config.
|
|
36
|
-
* Returns both the tool definitions (for API) and full tools (for execution).
|
|
37
|
-
*/
|
|
38
|
-
export declare function resolveTools<THelpers>(variant: VariantConfig | undefined, defaults: VariantDefaults<THelpers>): {
|
|
39
|
-
toolDefs: ChatCompletionTool[];
|
|
40
|
-
tools: Tool<THelpers>[];
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Resolves model from variant config with fallback.
|
|
44
|
-
*/
|
|
45
|
-
export declare function resolveModel(variant?: VariantConfig, fallback?: string): string;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves system prompt from variant config.
|
|
3
|
-
* Returns the appropriate ChatCompletionSystemMessageParam based on config.
|
|
4
|
-
*/
|
|
5
|
-
export function resolveSystemPrompt(variant, defaults, fallbackCustomPrompt) {
|
|
6
|
-
if (!variant?.systemPrompt || variant.systemPrompt.type === 'default') {
|
|
7
|
-
return defaults.prepareSystemMessage(fallbackCustomPrompt);
|
|
8
|
-
}
|
|
9
|
-
if (variant.systemPrompt.type === 'default-with-custom') {
|
|
10
|
-
return defaults.prepareSystemMessage(variant.systemPrompt.custom);
|
|
11
|
-
}
|
|
12
|
-
// type === 'custom'
|
|
13
|
-
return {
|
|
14
|
-
role: 'system',
|
|
15
|
-
content: variant.systemPrompt.content
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Resolves tools from variant config.
|
|
20
|
-
* Returns both the tool definitions (for API) and full tools (for execution).
|
|
21
|
-
*/
|
|
22
|
-
export function resolveTools(variant, defaults) {
|
|
23
|
-
if (!variant?.tools || variant.tools.type === 'default') {
|
|
24
|
-
return {
|
|
25
|
-
toolDefs: defaults.tools.map((t) => t.def),
|
|
26
|
-
tools: defaults.tools
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
if (variant.tools.type === 'subset') {
|
|
30
|
-
const includeList = variant.tools.include;
|
|
31
|
-
const subset = defaults.tools.filter((t) => includeList.includes(t.def.function.name));
|
|
32
|
-
return {
|
|
33
|
-
toolDefs: subset.map((t) => t.def),
|
|
34
|
-
tools: subset
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (variant.tools.type === 'custom') {
|
|
38
|
-
// Custom tools are typed as unknown[] in base VariantConfig but domain-specific
|
|
39
|
-
// code should ensure they are the correct Tool<THelpers> type
|
|
40
|
-
const customTools = variant.tools.tools;
|
|
41
|
-
return {
|
|
42
|
-
toolDefs: customTools.map((t) => t.def),
|
|
43
|
-
tools: customTools
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
// Default fallback
|
|
47
|
-
return {
|
|
48
|
-
toolDefs: defaults.tools.map((t) => t.def),
|
|
49
|
-
tools: defaults.tools
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Resolves model from variant config with fallback.
|
|
54
|
-
*/
|
|
55
|
-
export function resolveModel(variant, fallback) {
|
|
56
|
-
return variant?.model ?? fallback ?? 'gpt-4o';
|
|
57
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type { TokenUsage, ToolCallDetail, EvaluationResult, BaseEvalResult, VariantConfig, EvalRunnerOptions, ToolCallbacks } from './types';
|
|
2
|
-
export { createNoOpToolCallbacks } from './types';
|
|
3
|
-
export type { Tool, VariantDefaults } from './baseVariants';
|
|
4
|
-
export { resolveSystemPrompt, resolveTools, resolveModel } from './baseVariants';
|
|
5
|
-
export type { RawEvalResult, RunEvalParams } from './baseEvalRunner';
|
|
6
|
-
export { runEval } from './baseEvalRunner';
|
|
7
|
-
export type { EvaluateParams } from './baseLLMEvaluator';
|
|
8
|
-
export { evaluateWithLLM, BASE_EVALUATOR_RESPONSE_FORMAT } from './baseLLMEvaluator';
|
|
9
|
-
export type { WriteResultsParams } from './baseResultsWriter';
|
|
10
|
-
export { writeComparisonResults, generateTimestamp } from './baseResultsWriter';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { createNoOpToolCallbacks } from './types';
|
|
2
|
-
export { resolveSystemPrompt, resolveTools, resolveModel } from './baseVariants';
|
|
3
|
-
export { runEval } from './baseEvalRunner';
|
|
4
|
-
export { evaluateWithLLM, BASE_EVALUATOR_RESPONSE_FORMAT } from './baseLLMEvaluator';
|
|
5
|
-
export { writeComparisonResults, generateTimestamp } from './baseResultsWriter';
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { ChatCompletionMessageParam } from 'openai/resources/chat/completions.mjs';
|
|
2
|
-
import type { AIProvider } from '../../../../../gen/types.gen';
|
|
3
|
-
/**
|
|
4
|
-
* Token usage tracking for LLM calls.
|
|
5
|
-
*/
|
|
6
|
-
export interface TokenUsage {
|
|
7
|
-
prompt: number;
|
|
8
|
-
completion: number;
|
|
9
|
-
total: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Details of a single tool call made during evaluation.
|
|
13
|
-
*/
|
|
14
|
-
export interface ToolCallDetail {
|
|
15
|
-
name: string;
|
|
16
|
-
arguments: Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Result of LLM-based comparison/evaluation.
|
|
20
|
-
*/
|
|
21
|
-
export interface EvaluationResult {
|
|
22
|
-
success: boolean;
|
|
23
|
-
resemblanceScore: number;
|
|
24
|
-
statement: string;
|
|
25
|
-
missingRequirements?: string[];
|
|
26
|
-
error?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Base evaluation result that can be extended for domain-specific outputs.
|
|
30
|
-
* @template TOutput The domain-specific output type (e.g., flow definition, app files)
|
|
31
|
-
*/
|
|
32
|
-
export interface BaseEvalResult<TOutput> {
|
|
33
|
-
success: boolean;
|
|
34
|
-
output: TOutput;
|
|
35
|
-
error?: string;
|
|
36
|
-
tokenUsage: TokenUsage;
|
|
37
|
-
toolCallsCount: number;
|
|
38
|
-
toolsCalled: string[];
|
|
39
|
-
toolCallDetails: ToolCallDetail[];
|
|
40
|
-
iterations: number;
|
|
41
|
-
variantName: string;
|
|
42
|
-
evaluationResult?: EvaluationResult;
|
|
43
|
-
messages: ChatCompletionMessageParam[];
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Base configuration for a variant in eval testing.
|
|
47
|
-
* Allows customizing system prompt, tools, and model for comparison.
|
|
48
|
-
*
|
|
49
|
-
* Note: Domain-specific variants may extend this with custom tool configurations.
|
|
50
|
-
* See flow/flowEvalVariants.ts for an example with custom tools.
|
|
51
|
-
*/
|
|
52
|
-
export interface VariantConfig {
|
|
53
|
-
name: string;
|
|
54
|
-
description?: string;
|
|
55
|
-
/** System prompt configuration */
|
|
56
|
-
systemPrompt?: {
|
|
57
|
-
type: 'default';
|
|
58
|
-
} | {
|
|
59
|
-
type: 'default-with-custom';
|
|
60
|
-
custom: string;
|
|
61
|
-
} | {
|
|
62
|
-
type: 'custom';
|
|
63
|
-
content: string;
|
|
64
|
-
};
|
|
65
|
-
/** Tools configuration - basic types supported by shared code */
|
|
66
|
-
tools?: {
|
|
67
|
-
type: 'default';
|
|
68
|
-
} | {
|
|
69
|
-
type: 'subset';
|
|
70
|
-
include: string[];
|
|
71
|
-
} | {
|
|
72
|
-
type: 'custom';
|
|
73
|
-
tools: unknown[];
|
|
74
|
-
};
|
|
75
|
-
/** Model to use (default: 'gpt-4o') */
|
|
76
|
-
model?: string;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Options for running an evaluation.
|
|
80
|
-
*/
|
|
81
|
-
export interface EvalRunnerOptions {
|
|
82
|
-
/** Maximum iterations for tool call loop (default: 20) */
|
|
83
|
-
maxIterations?: number;
|
|
84
|
-
/** Model to use for LLM calls */
|
|
85
|
-
model?: string;
|
|
86
|
-
/** Workspace ID for tool calls */
|
|
87
|
-
workspace?: string;
|
|
88
|
-
/** AI provider (inferred from model name if omitted) */
|
|
89
|
-
provider?: AIProvider;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* No-op tool callbacks for eval testing.
|
|
93
|
-
*/
|
|
94
|
-
export interface ToolCallbacks {
|
|
95
|
-
setToolStatus: (id: string, status: {
|
|
96
|
-
content?: string;
|
|
97
|
-
result?: string;
|
|
98
|
-
error?: string;
|
|
99
|
-
}) => void;
|
|
100
|
-
removeToolStatus: (id: string) => void;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Creates no-op tool callbacks for eval testing.
|
|
104
|
-
*/
|
|
105
|
-
export declare function createNoOpToolCallbacks(): ToolCallbacks;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FlowModule, OpenFlow } from '../../../../gen';
|
|
2
|
-
export declare function getModuleById(flow: OpenFlow, moduleId: string): FlowModule | undefined;
|
|
3
|
-
export declare function getIndexInNestedModules(flow: OpenFlow, id: string): {
|
|
4
|
-
index: number;
|
|
5
|
-
modules: FlowModule[];
|
|
6
|
-
} | null;
|
|
7
|
-
/**
|
|
8
|
-
* Collects all module IDs from an array of modules and their nested structures
|
|
9
|
-
*/
|
|
10
|
-
export declare function collectAllModuleIdsFromArray(modules: FlowModule[]): string[];
|
|
11
|
-
/**
|
|
12
|
-
* Recursively collects all module IDs from a module and its nested structures
|
|
13
|
-
*/
|
|
14
|
-
export declare function collectAllModuleIds(module: FlowModule): string[];
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { dfs } from '../../../flows/previousResults';
|
|
2
|
-
// Helper to find module by ID in a flow
|
|
3
|
-
export function getModuleById(flow, moduleId) {
|
|
4
|
-
const allModules = dfs(moduleId, flow, false);
|
|
5
|
-
return allModules[0];
|
|
6
|
-
}
|
|
7
|
-
export function getIndexInNestedModules(flow, id) {
|
|
8
|
-
const accessingModules = dfs(id, flow, true).reverse();
|
|
9
|
-
if (accessingModules.length === 0) {
|
|
10
|
-
// Module not found in flow
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
let parent = flow.value.modules;
|
|
14
|
-
let lastIndex = -1;
|
|
15
|
-
for (const [ai, am] of accessingModules.entries()) {
|
|
16
|
-
const index = parent.findIndex((m) => m.id === am.id);
|
|
17
|
-
if (index === -1) {
|
|
18
|
-
// Module no longer exists in expected location (may have been deleted with parent)
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
lastIndex = index;
|
|
22
|
-
if (ai === accessingModules.length - 1) {
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
if (parent[index].value.type === 'forloopflow' ||
|
|
26
|
-
parent[index].value.type === 'whileloopflow') {
|
|
27
|
-
parent = parent[index].value.modules;
|
|
28
|
-
}
|
|
29
|
-
else if (parent[index].value.type === 'branchall' ||
|
|
30
|
-
parent[index].value.type === 'branchone') {
|
|
31
|
-
const branchIdx = parent[index].value.branches.findIndex((b) => b.modules.some((m) => m.id === accessingModules[ai + 1].id));
|
|
32
|
-
if (branchIdx === -1) {
|
|
33
|
-
// Module no longer exists in branch (may have been deleted)
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
parent = parent[index].value.branches[branchIdx].modules;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// Unexpected module type in path
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (lastIndex === -1) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
index: lastIndex,
|
|
48
|
-
modules: parent
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Collects all module IDs from an array of modules and their nested structures
|
|
53
|
-
*/
|
|
54
|
-
export function collectAllModuleIdsFromArray(modules) {
|
|
55
|
-
const ids = [];
|
|
56
|
-
for (const module of modules) {
|
|
57
|
-
ids.push(...collectAllModuleIds(module));
|
|
58
|
-
}
|
|
59
|
-
return ids;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Recursively collects all module IDs from a module and its nested structures
|
|
63
|
-
*/
|
|
64
|
-
export function collectAllModuleIds(module) {
|
|
65
|
-
const ids = [module.id];
|
|
66
|
-
if (module.value.type === 'forloopflow' || module.value.type === 'whileloopflow') {
|
|
67
|
-
if (module.value.modules) {
|
|
68
|
-
for (const nested of module.value.modules) {
|
|
69
|
-
ids.push(...collectAllModuleIds(nested));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else if (module.value.type === 'branchone') {
|
|
74
|
-
if (module.value.branches) {
|
|
75
|
-
for (const branch of module.value.branches) {
|
|
76
|
-
if (branch.modules) {
|
|
77
|
-
for (const nested of branch.modules) {
|
|
78
|
-
ids.push(...collectAllModuleIds(nested));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (module.value.default) {
|
|
84
|
-
for (const nested of module.value.default) {
|
|
85
|
-
ids.push(...collectAllModuleIds(nested));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else if (module.value.type === 'branchall') {
|
|
90
|
-
if (module.value.branches) {
|
|
91
|
-
for (const branch of module.value.branches) {
|
|
92
|
-
if (branch.modules) {
|
|
93
|
-
for (const nested of branch.modules) {
|
|
94
|
-
ids.push(...collectAllModuleIds(nested));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
else if (module.value.type === 'aiagent') {
|
|
101
|
-
if (module.value.tools) {
|
|
102
|
-
for (const tool of module.value.tools) {
|
|
103
|
-
ids.push(tool.id);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return ids;
|
|
108
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
vi.mock('../aiProviderStorage', () => ({
|
|
3
|
-
loadStoredConfig: () => undefined
|
|
4
|
-
}));
|
|
5
|
-
vi.mock('./flowInfers', () => ({
|
|
6
|
-
AI_AGENT_SCHEMA: { properties: {} }
|
|
7
|
-
}));
|
|
8
|
-
import { removeAgentToolByIdDeep } from './agentToolUtils';
|
|
9
|
-
function makeRawModule(id) {
|
|
10
|
-
return {
|
|
11
|
-
id,
|
|
12
|
-
summary: id,
|
|
13
|
-
value: { type: 'rawscript', content: '', language: 'python3' }
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function makeAiAgent(id, tools) {
|
|
17
|
-
return {
|
|
18
|
-
id,
|
|
19
|
-
summary: id,
|
|
20
|
-
value: {
|
|
21
|
-
type: 'aiagent',
|
|
22
|
-
tools,
|
|
23
|
-
input_transforms: {}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function makeFlowModuleTool(module) {
|
|
28
|
-
return {
|
|
29
|
-
id: module.id,
|
|
30
|
-
summary: module.summary,
|
|
31
|
-
value: {
|
|
32
|
-
tool_type: 'flowmodule',
|
|
33
|
-
...module.value
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
describe('removeAgentToolByIdDeep', () => {
|
|
38
|
-
it('removes a direct tool from an ai agent', () => {
|
|
39
|
-
const tool = makeFlowModuleTool(makeRawModule('lookup_user'));
|
|
40
|
-
const agent = makeAiAgent('agent', [tool]);
|
|
41
|
-
const removed = [];
|
|
42
|
-
expect(removeAgentToolByIdDeep([agent], 'lookup_user', (x) => removed.push(x.id))).toBe(true);
|
|
43
|
-
expect(agent.value.tools).toEqual([]);
|
|
44
|
-
expect(removed).toEqual(['lookup_user']);
|
|
45
|
-
});
|
|
46
|
-
it('removes a nested tool from a nested ai agent tool', () => {
|
|
47
|
-
const nestedTool = makeFlowModuleTool(makeRawModule('create_ticket'));
|
|
48
|
-
const nestedAgent = makeAiAgent('support_agent', [nestedTool]);
|
|
49
|
-
const rootAgent = makeAiAgent('root_agent', [makeFlowModuleTool(nestedAgent)]);
|
|
50
|
-
const removed = [];
|
|
51
|
-
expect(removeAgentToolByIdDeep([rootAgent], 'create_ticket', (x) => removed.push(x.id))).toBe(true);
|
|
52
|
-
expect(rootAgent.value.tools[0].value.tools).toEqual([]);
|
|
53
|
-
expect(removed).toEqual(['create_ticket']);
|
|
54
|
-
});
|
|
55
|
-
});
|
/package/package/components/copilot/chat/{__tests__/app/appChat.eval.test.d.ts → app/core.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
/package/package/components/{flows/agentToolUtils.test.d.ts → copilot/chat/flow/utils.test.d.ts}
RENAMED
|
File without changes
|