@datalayer/core 1.1.60 → 1.2.10
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/README.md +41 -18
- package/lib/api/DatalayerApi.d.ts +42 -1
- package/lib/api/DatalayerApi.js +90 -3
- package/lib/api/constants.d.ts +19 -1
- package/lib/api/constants.js +19 -1
- package/lib/api/contents/attachments.d.ts +9 -0
- package/lib/api/contents/attachments.js +39 -0
- package/lib/api/contents/bridges.d.ts +22 -0
- package/lib/api/contents/bridges.js +79 -0
- package/lib/api/contents/capabilities.d.ts +11 -0
- package/lib/api/contents/capabilities.js +21 -0
- package/lib/api/contents/cloudStorage.d.ts +31 -0
- package/lib/api/contents/cloudStorage.js +89 -0
- package/lib/api/contents/dataservers.d.ts +37 -0
- package/lib/api/contents/dataservers.js +121 -0
- package/lib/api/contents/datasets.d.ts +63 -0
- package/lib/api/contents/datasets.js +82 -0
- package/lib/api/contents/datasources.d.ts +70 -0
- package/lib/api/contents/datasources.js +149 -0
- package/lib/api/contents/generated.d.ts +1070 -0
- package/lib/api/contents/index.d.ts +16 -0
- package/lib/api/contents/index.js +20 -0
- package/lib/api/contents/mcp.d.ts +46 -0
- package/lib/api/contents/mcp.js +157 -0
- package/lib/api/contents/objects.d.ts +31 -0
- package/lib/api/contents/objects.js +88 -0
- package/lib/api/contents/operations.d.ts +3 -0
- package/lib/api/contents/operations.js +19 -0
- package/lib/api/contents/runtimeMounts.d.ts +40 -0
- package/lib/api/contents/runtimeMounts.js +59 -0
- package/lib/api/contents/sandboxUid.d.ts +21 -0
- package/lib/api/contents/sandboxUid.js +27 -0
- package/lib/api/contents/sources.d.ts +19 -0
- package/lib/api/contents/sources.js +119 -0
- package/lib/api/contents/sync.d.ts +18 -0
- package/lib/api/contents/sync.js +69 -0
- package/lib/api/contents/transfers.d.ts +38 -0
- package/lib/api/contents/transfers.js +123 -0
- package/lib/api/evals/client.d.ts +402 -0
- package/lib/api/evals/client.js +359 -0
- package/lib/api/evals/index.d.ts +10 -0
- package/lib/api/evals/index.js +18 -0
- package/lib/api/evals/request.d.ts +43 -0
- package/lib/api/evals/request.js +67 -0
- package/lib/api/evals/status.d.ts +27 -0
- package/lib/api/evals/status.js +122 -0
- package/lib/api/evals/types.d.ts +1335 -0
- package/lib/api/evals/types.js +5 -0
- package/lib/api/iam/connectedAgents.d.ts +68 -0
- package/lib/api/iam/connectedAgents.js +87 -0
- package/lib/api/iam/identityProviders.d.ts +76 -0
- package/lib/api/iam/identityProviders.js +187 -0
- package/lib/api/iam/index.d.ts +3 -1
- package/lib/api/iam/index.js +3 -1
- package/lib/api/iam/mcpAlertRules.d.ts +51 -0
- package/lib/api/iam/mcpAlertRules.js +198 -0
- package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
- package/lib/api/iam/mcpAuditSettings.js +120 -0
- package/lib/api/iam/mcpPolicy.d.ts +181 -0
- package/lib/api/iam/mcpPolicy.js +168 -0
- package/lib/api/iam/organizationTeams.d.ts +13 -0
- package/lib/api/iam/organizationTeams.js +43 -0
- package/lib/api/iam/profile.d.ts +17 -1
- package/lib/api/iam/profile.js +27 -0
- package/lib/api/iam/scimTokens.d.ts +79 -0
- package/lib/api/iam/scimTokens.js +141 -0
- package/lib/api/iam/secrets.js +9 -21
- package/lib/api/iam/serviceAgents.d.ts +68 -0
- package/lib/api/iam/serviceAgents.js +119 -0
- package/lib/api/iam/trials.d.ts +38 -0
- package/lib/api/iam/trials.js +66 -0
- package/lib/api/index.d.ts +8 -1
- package/lib/api/index.js +7 -1
- package/lib/api/mcp/activity.d.ts +37 -0
- package/lib/api/mcp/activity.js +26 -0
- package/lib/api/mcp/alerts.d.ts +25 -0
- package/lib/api/mcp/alerts.js +51 -0
- package/lib/api/mcp/audit.d.ts +29 -0
- package/lib/api/mcp/audit.js +55 -0
- package/lib/api/mcp/bindings.d.ts +18 -0
- package/lib/api/mcp/bindings.js +42 -0
- package/lib/api/mcp/forwarding.d.ts +25 -0
- package/lib/api/mcp/forwarding.js +46 -0
- package/lib/api/mcp/gateway.d.ts +16 -0
- package/lib/api/mcp/gateway.js +70 -0
- package/lib/api/mcp/generated.d.ts +22 -0
- package/lib/api/mcp/generated.js +213 -0
- package/lib/api/mcp/index.d.ts +17 -0
- package/lib/api/mcp/index.js +25 -0
- package/lib/api/mcp/observability.d.ts +141 -0
- package/lib/api/mcp/observability.js +267 -0
- package/lib/api/mcp/operations.d.ts +83 -0
- package/lib/api/mcp/operations.js +50 -0
- package/lib/api/mcp/organizations.d.ts +102 -0
- package/lib/api/mcp/organizations.js +46 -0
- package/lib/api/mcp/policy.d.ts +9 -0
- package/lib/api/mcp/policy.js +23 -0
- package/lib/api/mcp/tasks.d.ts +49 -0
- package/lib/api/mcp/tasks.js +147 -0
- package/lib/api/orchestration/client.d.ts +53 -0
- package/lib/api/orchestration/client.js +105 -0
- package/lib/api/orchestration/events.d.ts +88 -0
- package/lib/api/orchestration/events.js +245 -0
- package/lib/api/orchestration/generated.d.ts +693 -0
- package/lib/api/orchestration/generated.js +687 -0
- package/lib/api/orchestration/index.d.ts +30 -0
- package/lib/api/orchestration/index.js +34 -0
- package/lib/api/orchestration/lifecycle.d.ts +39 -0
- package/lib/api/orchestration/lifecycle.js +57 -0
- package/lib/api/orchestration/measures.d.ts +55 -0
- package/lib/api/orchestration/measures.js +99 -0
- package/lib/api/otel/dashboards.d.ts +56 -0
- package/lib/api/otel/dashboards.js +50 -0
- package/lib/api/otel/index.d.ts +1 -0
- package/lib/api/otel/index.js +1 -0
- package/lib/api/otel/metrics.d.ts +16 -0
- package/lib/api/otel/metrics.js +15 -0
- package/lib/api/scheduler/client.d.ts +32 -0
- package/lib/api/scheduler/client.js +42 -0
- package/lib/api/scheduler/index.d.ts +8 -0
- package/lib/api/scheduler/index.js +16 -0
- package/lib/api/scheduler/request.d.ts +28 -0
- package/lib/api/scheduler/request.js +50 -0
- package/lib/api/scheduler/types.d.ts +88 -0
- package/lib/api/scheduler/types.js +5 -0
- package/lib/api/spacer/comments.d.ts +97 -0
- package/lib/api/spacer/comments.js +45 -0
- package/lib/api/spacer/index.d.ts +9 -0
- package/lib/api/spacer/index.js +17 -0
- package/lib/api/spacer/notebooks.d.ts +33 -0
- package/lib/api/spacer/notebooks.js +39 -0
- package/lib/api/spacer/request.d.ts +25 -0
- package/lib/api/spacer/request.js +46 -0
- package/lib/api/spacer/spaces.d.ts +68 -0
- package/lib/api/spacer/spaces.js +45 -0
- package/lib/api/utils/validation.d.ts +4 -4
- package/lib/api/utils/validation.js +10 -7
- package/lib/client/auth/index.js +0 -5
- package/lib/client/auth/storage.js +0 -5
- package/lib/client/auth/strategies.js +0 -5
- package/lib/client/base.d.ts +6 -0
- package/lib/client/base.js +8 -0
- package/lib/client/constants.d.ts +1 -0
- package/lib/client/constants.js +1 -0
- package/lib/client/index.d.ts +0 -10
- package/lib/client/index.js +2 -2
- package/lib/client/mixins/ContentsMixin.d.ts +71 -0
- package/lib/client/mixins/ContentsMixin.js +157 -0
- package/lib/client/mixins/IAMMixin.d.ts +0 -31
- package/lib/client/mixins/IAMMixin.js +0 -58
- package/lib/components/animation/AnimatedText.d.ts +2 -44
- package/lib/components/animation/AnimatedText.js +6 -126
- package/lib/components/anonymous/AnonymousKeyExpired.d.ts +56 -0
- package/lib/components/anonymous/AnonymousKeyExpired.js +96 -0
- package/lib/components/anonymous/AnonymousKeyTimer.d.ts +63 -0
- package/lib/components/anonymous/AnonymousKeyTimer.js +140 -0
- package/lib/components/anonymous/index.d.ts +7 -0
- package/lib/components/anonymous/index.js +15 -0
- package/lib/components/auth/SigInAPIKey.d.ts +1 -0
- package/lib/components/auth/SigInAPIKey.js +0 -6
- package/lib/components/auth/SignIn.d.ts +1 -0
- package/lib/components/auth/SignIn.js +0 -4
- package/lib/components/auth/SignIn.stories.d.ts +2 -2
- package/lib/components/avatars/BoringAvatar.d.ts +1 -1
- package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
- package/lib/components/avatars/DLAvatar.d.ts +1 -1
- package/lib/components/avatars/DLAvatar.js +0 -4
- package/lib/components/avatars/UserAvatar.d.ts +16 -1
- package/lib/components/avatars/UserAvatar.js +15 -13
- package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
- package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
- package/lib/components/billing/BillingEntitySelect.d.ts +16 -0
- package/lib/components/billing/BillingEntitySelect.js +49 -27
- package/lib/components/billing/eligibility.d.ts +22 -0
- package/lib/components/billing/eligibility.js +27 -0
- package/lib/components/billing/index.d.ts +1 -0
- package/lib/components/billing/index.js +1 -4
- package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
- package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
- package/lib/components/buttons/LongActionButton.d.ts +1 -0
- package/lib/components/buttons/LongActionButton.js +0 -4
- package/lib/components/buttons/UploadButton.d.ts +1 -0
- package/lib/components/buttons/UploadButton.js +0 -4
- package/lib/components/checkout/StripeCheckout.d.ts +1 -1
- package/lib/components/collaboration/LiveEditorCollaborators.d.ts +36 -0
- package/lib/components/collaboration/LiveEditorCollaborators.js +88 -53
- package/lib/components/collaboration/index.js +0 -4
- package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
- package/lib/components/contents/ContentSourceCard.d.ts +8 -0
- package/lib/components/contents/ContentSourceCard.js +23 -0
- package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
- package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
- package/lib/components/contents/index.d.ts +2 -0
- package/lib/components/contents/index.js +6 -0
- package/lib/components/context/OrganizationSelect.d.ts +1 -1
- package/lib/components/display/AvatarSkeleton.d.ts +1 -1
- package/lib/components/display/BusyDots.d.ts +1 -1
- package/lib/components/display/CenteredSpinner.d.ts +1 -1
- package/lib/components/display/CodePreview.d.ts +1 -1
- package/lib/components/display/DatalayerBox.d.ts +7 -3
- package/lib/components/display/DatalayerBox.js +7 -7
- package/lib/components/display/HorizontalCenter.d.ts +1 -1
- package/lib/components/display/JupyterDialog.d.ts +1 -0
- package/lib/components/display/JupyterDialog.js +1 -7
- package/lib/components/display/Markdown.d.ts +1 -0
- package/lib/components/display/NavLink.js +3 -2
- package/lib/components/display/NotebookSkeleton.d.ts +1 -1
- package/lib/components/display/Placeholder.d.ts +1 -1
- package/lib/components/display/ToTopBranded.d.ts +1 -1
- package/lib/components/echarts/EChartsReact.d.ts +1 -1
- package/lib/components/flashes/FlashClosable.d.ts +1 -0
- package/lib/components/flashes/FlashClosable.js +0 -4
- package/lib/components/flashes/FlashGuest.d.ts +1 -1
- package/lib/components/flashes/FlashSurveys.d.ts +1 -1
- package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
- package/lib/components/flashes/FlashUnauthorized.js +0 -6
- package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
- package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/labels/StatusLabels.d.ts +2 -9
- package/lib/components/labels/StatusLabels.js +2 -26
- package/lib/components/labels/VisibilityLabel.d.ts +1 -1
- package/lib/components/landings/StepBlock.d.ts +1 -1
- package/lib/components/mcp/ClientBadge.d.ts +41 -0
- package/lib/components/mcp/ClientBadge.js +33 -0
- package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
- package/lib/components/mcp/McpErrorBlankslate.js +17 -0
- package/lib/components/mcp/ScopeList.d.ts +28 -0
- package/lib/components/mcp/ScopeList.js +14 -0
- package/lib/components/mcp/index.d.ts +10 -0
- package/lib/components/mcp/index.js +18 -0
- package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
- package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
- package/lib/components/navbar/SubdomainNavBar.js +2 -1
- package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
- package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
- package/lib/components/principal/PrincipalAppearance.d.ts +22 -42
- package/lib/components/principal/PrincipalAppearance.js +232 -182
- package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
- package/lib/components/principal/PrincipalAvatar.js +18 -10
- package/lib/components/principal/PrincipalBadge.d.ts +1 -1
- package/lib/components/principal/PrincipalBanner.d.ts +1 -1
- package/lib/components/principal/PrincipalDetailsOverlay.d.ts +38 -1
- package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
- package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
- package/lib/components/principal/PrincipalHoverCard.js +52 -0
- package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
- package/lib/components/principal/PrincipalSwitcherMenu.js +5 -14
- package/lib/components/principal/index.d.ts +2 -1
- package/lib/components/principal/index.js +2 -1
- package/lib/components/progress/ConsumptionBar.d.ts +1 -0
- package/lib/components/progress/ConsumptionBar.js +0 -4
- package/lib/components/progress/ProgressRing.d.ts +1 -0
- package/lib/components/progress/SpinnerBar.d.ts +1 -1
- package/lib/components/progress/Timer.d.ts +1 -0
- package/lib/components/progress/Timer.js +0 -4
- package/lib/components/screencapture/Screencapture.js +46 -3
- package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
- package/lib/components/sharing/ShareAccessComponent.d.ts +58 -3
- package/lib/components/sharing/ShareAccessComponent.js +143 -98
- package/lib/components/sharing/SharingEditor.d.ts +21 -0
- package/lib/components/sharing/SharingEditor.js +9 -28
- package/lib/components/sharing/index.d.ts +1 -0
- package/lib/components/sharing/index.js +1 -0
- package/lib/components/sharing/sandboxSharing.d.ts +26 -0
- package/lib/components/sharing/sandboxSharing.js +41 -0
- package/lib/components/spaces/SpaceDetailsOverlay.d.ts +39 -0
- package/lib/components/spaces/SpaceDetailsOverlay.js +80 -0
- package/lib/components/spaces/SpaceDisplay.d.ts +38 -0
- package/lib/components/spaces/SpaceDisplay.js +92 -0
- package/lib/components/spaces/index.d.ts +4 -0
- package/lib/components/spaces/index.js +7 -0
- package/lib/components/spaces/spaceDisplayModel.d.ts +93 -0
- package/lib/components/spaces/spaceDisplayModel.js +170 -0
- package/lib/components/sparklines/Sparklines.js +3 -4
- package/lib/components/sparklines/index.js +0 -4
- package/lib/components/storage/ContentsBrowser.d.ts +25 -1
- package/lib/components/storage/ContentsBrowser.js +145 -52
- package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
- package/lib/components/storage/ContentsBrowserMock.js +75 -0
- package/lib/components/storage/ContentsItems.d.ts +2 -1
- package/lib/components/storage/ContentsItems.js +0 -4
- package/lib/components/storage/ContentsTable.d.ts +50 -0
- package/lib/components/storage/ContentsTable.js +134 -0
- package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
- package/lib/components/storage/HomeFolderDrive.js +248 -0
- package/lib/components/storage/index.d.ts +2 -0
- package/lib/components/storage/index.js +2 -0
- package/lib/components/students/StudentItemStatus.d.ts +1 -1
- package/lib/components/students/StudentResultCircle.d.ts +1 -1
- package/lib/components/subnav/SubNav.d.ts +5 -5
- package/lib/components/subnav/SubNav.js +11 -9
- package/lib/components/tables/DataTable.d.ts +1 -1
- package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
- package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
- package/lib/components/time/LiveRelativeTime.d.ts +1 -0
- package/lib/components/time/LiveRelativeTime.js +0 -8
- package/lib/components/time/index.js +0 -4
- package/lib/components/timeline/Timeline.d.ts +1 -1
- package/lib/components/timeline/index.js +0 -4
- package/lib/components/users/PeerIndicator.d.ts +1 -0
- package/lib/components/users/PeerIndicator.js +0 -4
- package/lib/config/Configuration.d.ts +15 -17
- package/lib/config/Configuration.js +7 -0
- package/lib/hooks/cacheConverters.d.ts +0 -7
- package/lib/hooks/cacheConverters.js +0 -25
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
- package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
- package/lib/hooks/useBackdrop.d.ts +1 -1
- package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
- package/lib/hooks/useBackdropJupyterLab.js +0 -4
- package/lib/hooks/useBillingEntityStore.js +3 -0
- package/lib/hooks/useCache.d.ts +478 -130
- package/lib/hooks/useCache.js +1580 -676
- package/lib/hooks/useContainsFocus.d.ts +1 -1
- package/lib/hooks/useContents.d.ts +334 -0
- package/lib/hooks/useContents.js +1033 -0
- package/lib/hooks/useFocusTrap.d.ts +4 -4
- package/lib/hooks/useFocusTrap.js +1 -1
- package/lib/hooks/useMcp.d.ts +315 -0
- package/lib/hooks/useMcp.js +891 -0
- package/lib/hooks/useMobile.js +0 -5
- package/lib/hooks/useNavigate.d.ts +41 -3
- package/lib/hooks/useNavigate.js +106 -52
- package/lib/hooks/usePrincipalCacheStore.js +3 -0
- package/lib/hooks/usePrincipalStore.js +3 -0
- package/lib/hooks/useProjectStore.d.ts +3 -3
- package/lib/hooks/useProjectStore.js +4 -4
- package/lib/hooks/useRef.d.ts +1 -1
- package/lib/hooks/useRef.js +3 -0
- package/lib/hooks/useScreencapture.d.ts +2 -1
- package/lib/hooks/useScreencapture.js +0 -4
- package/lib/hooks/useSpaceCacheStore.d.ts +50 -0
- package/lib/hooks/useSpaceCacheStore.js +85 -0
- package/lib/hooks/useToast.js +0 -4
- package/lib/hooks/useVisibilityObserver.d.ts +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +3 -1
- package/lib/mocks/components/FlashMock.d.ts +1 -1
- package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
- package/lib/mocks/views/ChartMock.d.ts +1 -1
- package/lib/mocks/views/DashboardMock.d.ts +1 -1
- package/lib/mocks/views/FormMock.d.ts +1 -1
- package/lib/mocks/views/TableMock.d.ts +1 -1
- package/lib/mocks/views/WipMock.d.ts +1 -1
- package/lib/models/Credits.d.ts +16 -0
- package/lib/models/Credits.js +22 -0
- package/lib/models/CreditsDTO.d.ts +6 -5
- package/lib/models/CreditsDTO.js +7 -5
- package/lib/models/McpAuditEvent.d.ts +52 -0
- package/lib/models/McpAuditEvent.js +5 -0
- package/lib/models/McpBinding.d.ts +57 -0
- package/lib/models/McpBinding.js +5 -0
- package/lib/models/McpPolicy.d.ts +77 -0
- package/lib/models/McpPolicy.js +5 -0
- package/lib/models/McpTask.d.ts +94 -0
- package/lib/models/McpTask.js +7 -0
- package/lib/models/Organization.d.ts +69 -0
- package/lib/models/Organization.js +96 -0
- package/lib/models/Secret.d.ts +1 -2
- package/lib/models/Secret.js +2 -18
- package/lib/models/StartedBy.d.ts +91 -0
- package/lib/models/StartedBy.js +117 -0
- package/lib/models/Team.d.ts +2 -0
- package/lib/models/Team.js +2 -0
- package/lib/models/User.d.ts +4 -0
- package/lib/models/User.js +3 -0
- package/lib/models/UserDTO.js +4 -2
- package/lib/models/UserSettings.d.ts +13 -0
- package/lib/models/UserSettings.js +9 -0
- package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
- package/lib/models/contents/__fixtures__/v1-contracts.json +194 -0
- package/lib/models/contents/fieldCase.d.ts +8 -0
- package/lib/models/contents/fieldCase.js +37 -0
- package/lib/models/contents/index.d.ts +2 -0
- package/lib/models/contents/index.js +6 -0
- package/lib/models/contents/permissions.d.ts +16 -0
- package/lib/models/contents/permissions.js +34 -0
- package/lib/models/index.d.ts +5 -1
- package/lib/models/index.js +5 -1
- package/lib/navigation/components.js +2 -3
- package/lib/routes/publicPaths.js +4 -0
- package/lib/state/index.d.ts +1 -0
- package/lib/state/index.js +1 -0
- package/lib/state/sessionEnd.d.ts +55 -0
- package/lib/state/sessionEnd.js +162 -0
- package/lib/state/substates/CoreState.d.ts +15 -7
- package/lib/state/substates/CoreState.js +21 -17
- package/lib/state/substates/IAMState.d.ts +1 -1
- package/lib/state/substates/IAMState.js +12 -5
- package/lib/state/substates/LayoutState.js +12 -0
- package/lib/state/substates/ProfileState.d.ts +1 -0
- package/lib/state/substates/ProfileState.js +1 -4
- package/lib/state/substates/index.d.ts +0 -1
- package/lib/state/substates/index.js +0 -1
- package/lib/utils/Jwt.d.ts +26 -0
- package/lib/utils/Jwt.js +37 -0
- package/lib/utils/Lazy.d.ts +20 -0
- package/lib/utils/Lazy.js +32 -6
- package/lib/utils/Screencapture.js +3 -0
- package/lib/utils/WithSuspense.d.ts +11 -1
- package/lib/utils/WithSuspense.js +11 -1
- package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
- package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
- package/lib/views/api-keys/APIKeys.d.ts +1 -1
- package/lib/views/api-keys/APIKeys.js +30 -4
- package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
- package/lib/views/api-keys/APIKeysStandalone.js +2 -2
- package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
- package/lib/views/datasources/DatasourceDetail.js +80 -110
- package/lib/views/datasources/DatasourceNew.d.ts +14 -8
- package/lib/views/datasources/DatasourceNew.js +129 -118
- package/lib/views/datasources/Datasources.d.ts +39 -7
- package/lib/views/datasources/Datasources.js +95 -40
- package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
- package/lib/views/datasources/DatasourcesMock.js +57 -0
- package/lib/views/iam/SignInSimple.d.ts +12 -0
- package/lib/views/iam/SignInSimple.js +4 -4
- package/lib/views/index.d.ts +1 -0
- package/lib/views/index.js +1 -0
- package/lib/views/mcp/AdmittedClients.d.ts +44 -0
- package/lib/views/mcp/AdmittedClients.js +59 -0
- package/lib/views/mcp/AlertDestinations.d.ts +34 -0
- package/lib/views/mcp/AlertDestinations.js +75 -0
- package/lib/views/mcp/AlertRules.d.ts +32 -0
- package/lib/views/mcp/AlertRules.js +245 -0
- package/lib/views/mcp/ApprovalQueue.d.ts +66 -0
- package/lib/views/mcp/ApprovalQueue.js +95 -0
- package/lib/views/mcp/AuditLog.d.ts +42 -0
- package/lib/views/mcp/AuditLog.js +144 -0
- package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
- package/lib/views/mcp/ConnectedAgents.js +135 -0
- package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
- package/lib/views/mcp/EnterpriseConsole.js +195 -0
- package/lib/views/mcp/IdentityProviders.d.ts +33 -0
- package/lib/views/mcp/IdentityProviders.js +299 -0
- package/lib/views/mcp/McpDashboard.d.ts +50 -0
- package/lib/views/mcp/McpDashboard.js +430 -0
- package/lib/views/mcp/McpHome.d.ts +92 -0
- package/lib/views/mcp/McpHome.js +153 -0
- package/lib/views/mcp/McpObservability.d.ts +79 -0
- package/lib/views/mcp/McpObservability.js +236 -0
- package/lib/views/mcp/NotebookRuns.d.ts +39 -0
- package/lib/views/mcp/NotebookRuns.js +44 -0
- package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
- package/lib/views/mcp/OrganizationPolicy.js +108 -0
- package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
- package/lib/views/mcp/OrganizationUsage.js +113 -0
- package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
- package/lib/views/mcp/PersonalPolicy.js +126 -0
- package/lib/views/mcp/Policies.d.ts +53 -0
- package/lib/views/mcp/Policies.js +210 -0
- package/lib/views/mcp/PolicyForm.d.ts +83 -0
- package/lib/views/mcp/PolicyForm.js +113 -0
- package/lib/views/mcp/PolicyHistory.d.ts +58 -0
- package/lib/views/mcp/PolicyHistory.js +75 -0
- package/lib/views/mcp/RunDetail.d.ts +87 -0
- package/lib/views/mcp/RunDetail.js +186 -0
- package/lib/views/mcp/ScimProvisioning.d.ts +54 -0
- package/lib/views/mcp/ScimProvisioning.js +173 -0
- package/lib/views/mcp/ServiceAgents.d.ts +46 -0
- package/lib/views/mcp/ServiceAgents.js +194 -0
- package/lib/views/mcp/TeamPolicies.d.ts +33 -0
- package/lib/views/mcp/TeamPolicies.js +159 -0
- package/lib/views/mcp/ToolAccess.d.ts +60 -0
- package/lib/views/mcp/ToolAccess.js +101 -0
- package/lib/views/mcp/TraceTimeline.d.ts +81 -0
- package/lib/views/mcp/TraceTimeline.js +132 -0
- package/lib/views/mcp/format.d.ts +25 -0
- package/lib/views/mcp/format.js +77 -0
- package/lib/views/mcp/index.d.ts +34 -0
- package/lib/views/mcp/index.js +42 -0
- package/lib/views/mcp/types.d.ts +66 -0
- package/lib/views/mcp/types.js +5 -0
- package/lib/views/otel/simpleAuthStore.js +3 -0
- package/lib/views/secrets/SecretEdit.d.ts +5 -1
- package/lib/views/secrets/SecretEdit.js +5 -4
- package/lib/views/secrets/SecretNew.d.ts +11 -1
- package/lib/views/secrets/SecretNew.js +7 -3
- package/lib/views/secrets/Secrets.d.ts +12 -1
- package/lib/views/secrets/Secrets.js +2 -2
- package/package.json +269 -260
- package/scripts/generate-contents-types.py +169 -0
- package/scripts/generate-mcp-types.py +233 -0
- package/scripts/generate-orchestration-types.py +920 -0
- package/lib/api/iam/datasources.d.ts +0 -86
- package/lib/api/iam/datasources.js +0 -185
- package/lib/components/toolbars/index.d.ts +0 -1
- package/lib/models/Datasource.d.ts +0 -181
- package/lib/models/Datasource.js +0 -154
- package/lib/state/substates/DatasourceState.d.ts +0 -11
- package/lib/state/substates/DatasourceState.js +0 -16
- /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
7
|
+
* Distributed under the terms of the Modified BSD License.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The evals API, one function per endpoint.
|
|
11
|
+
*
|
|
12
|
+
* Paths mirror `tests/test_evals_api_contract.py` in the AI Agents service
|
|
13
|
+
* and `evalsApiContract.spec.ts` in the landings UI. Downloads (export and
|
|
14
|
+
* report) are URLs rather than requests: the browser opens them and the
|
|
15
|
+
* service answers with an attachment.
|
|
16
|
+
*
|
|
17
|
+
* @module api/evals/client
|
|
18
|
+
*/
|
|
19
|
+
import { evalsRequest, evalsUrl, segment, } from './request.js';
|
|
20
|
+
export const listEvalsets = (options, query = {}) => evalsRequest(options, '/evalsets', { query });
|
|
21
|
+
export const getEvalset = (options, evalsetId) => evalsRequest(options, `/evalsets/${segment(evalsetId)}`);
|
|
22
|
+
export const createEvalset = (options, body) => evalsRequest(options, '/evalsets', { method: 'POST', body });
|
|
23
|
+
export const updateEvalset = (options, evalsetId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}`, {
|
|
24
|
+
method: 'PATCH',
|
|
25
|
+
body,
|
|
26
|
+
});
|
|
27
|
+
export const setEvalsetPublic = (options, evalsetId, isPublic) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/public`, {
|
|
28
|
+
method: 'PATCH',
|
|
29
|
+
body: { is_public: isPublic },
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Take a benchmark into the account the options name (B5-03): a private copy
|
|
33
|
+
* of its definition that says what it was taken from. A published benchmark
|
|
34
|
+
* is anybody's to take; an unpublished one, a Viewer's. `derivation` says why:
|
|
35
|
+
* `fork` to change it, `compare` to run it against one's own agent (B5-05).
|
|
36
|
+
*/
|
|
37
|
+
export const cloneEvalset = (options, evalsetId, body = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/clone`, {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
body,
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Propose the next version of a benchmark's definition, from an investigation
|
|
43
|
+
* (B5-07): a task added or corrected, a corrected evaluator, a threshold
|
|
44
|
+
* moved. The version records the investigation that asked for it.
|
|
45
|
+
*/
|
|
46
|
+
export const reviseEvalset = (options, evalsetId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/revisions`, {
|
|
47
|
+
method: 'POST',
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* What publishing this benchmark would put in the library (B5-02): the
|
|
52
|
+
* contents of the package, the enumeration the publication review shows, what
|
|
53
|
+
* is left out and why, and everything that would refuse it — before anybody
|
|
54
|
+
* presses the button, because a publication cannot be taken back from whoever
|
|
55
|
+
* already read it.
|
|
56
|
+
*/
|
|
57
|
+
export const previewEvalsetPublication = (options, evalsetId, query = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/publication/preview`, { query });
|
|
58
|
+
/**
|
|
59
|
+
* Publish the package: the immutable snapshot of the definition, the data, the
|
|
60
|
+
* subjects, the environment, the results, the report, the evidence and the
|
|
61
|
+
* evaluators (section 14.3). Refused with `detail.problems` where section 14.5
|
|
62
|
+
* says it cannot be published.
|
|
63
|
+
*/
|
|
64
|
+
export const publishEvalsetPackage = (options, evalsetId, body = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/publications`, {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
body,
|
|
67
|
+
});
|
|
68
|
+
/** Every package published of this benchmark, withdrawn ones included. */
|
|
69
|
+
export const listEvalsetPublications = (options, evalsetId, query = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/publications`, { query });
|
|
70
|
+
/**
|
|
71
|
+
* Take a package out of the library. What it holds stays as it was written:
|
|
72
|
+
* withdrawing a snapshot does not make it editable.
|
|
73
|
+
*/
|
|
74
|
+
export const withdrawEvalsetPublication = (options, evalsetId, publicationId) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/publications/${segment(publicationId)}`, { method: 'DELETE' });
|
|
75
|
+
/** The package a published benchmark stands for, to anybody (B5-02). */
|
|
76
|
+
export const getPublicEvalsetPublication = (options, evalsetId) => evalsRequest(options, `/public/evalsets/${segment(evalsetId)}/publication`);
|
|
77
|
+
/**
|
|
78
|
+
* Launches of one benchmark side by side (B5-08): what each scored, what each
|
|
79
|
+
* subject scored in each, and which tasks went from passing to failing or
|
|
80
|
+
* back. Launch ids are compared in the order given, oldest first; the two
|
|
81
|
+
* newest launches where none is named.
|
|
82
|
+
*/
|
|
83
|
+
export const compareEvalsetLaunches = (options, evalsetId, query = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/comparison`, { query });
|
|
84
|
+
/**
|
|
85
|
+
* The subjects that ran a published benchmark, best first. Only runs a package
|
|
86
|
+
* published are counted (B5-02), and each row names the package its best run
|
|
87
|
+
* came from.
|
|
88
|
+
*/
|
|
89
|
+
export const getPublicEvalsetLeaderboard = (options, evalsetId) => evalsRequest(options, `/public/evalsets/${segment(evalsetId)}/leaderboard`);
|
|
90
|
+
/**
|
|
91
|
+
* What an agent or a model has actually run (B5-12): the benchmarks that ran
|
|
92
|
+
* it, what its runs scored, what they cost, how long they took, and the
|
|
93
|
+
* launches still going. Empty where it has never been run.
|
|
94
|
+
*
|
|
95
|
+
* The ref keeps its slashes — an agentspec id has one — so each segment is
|
|
96
|
+
* encoded rather than the whole string.
|
|
97
|
+
*/
|
|
98
|
+
export const getSubjectUsage = (options, subjectRef) => evalsRequest(options, `/subjects/${subjectRef.split('/').map(encodeURIComponent).join('/')}/usage`);
|
|
99
|
+
/**
|
|
100
|
+
* Whether anything will run the account's benchmarks (B5-12, section 15.2):
|
|
101
|
+
* the executor, whether a worker polls the benchmark queue, and the account's
|
|
102
|
+
* own queued and running launches.
|
|
103
|
+
*/
|
|
104
|
+
export const getBenchmarkCompute = (options) => evalsRequest(options, '/compute/operations');
|
|
105
|
+
/**
|
|
106
|
+
* What benchmark work a sandbox is doing (B5-12, section 15.4).
|
|
107
|
+
*
|
|
108
|
+
* The ref is a pool slot's name (`benchmark-<run>-slot-<n>`) or the snapshot
|
|
109
|
+
* a sandbox was restored from. A sandbox of nobody's benchmark answers
|
|
110
|
+
* `found: false`, so a page asks without knowing in advance.
|
|
111
|
+
*/
|
|
112
|
+
export const getSandboxProvenance = (options, sandboxRef) => evalsRequest(options, `/sandboxes/${sandboxRef.split('/').map(encodeURIComponent).join('/')}/provenance`);
|
|
113
|
+
/**
|
|
114
|
+
* Find things across the caller's benchmarks (B5-11, section 19): benchmarks,
|
|
115
|
+
* launches, tasks, reports and investigations, each row keeping its kind and
|
|
116
|
+
* what it belongs to.
|
|
117
|
+
*
|
|
118
|
+
* Nobody types a field name, so the service reads the words first: a status
|
|
119
|
+
* word becomes a status, `run 128` becomes a launch number, and what is left
|
|
120
|
+
* is the text. An empty query finds nothing rather than everything.
|
|
121
|
+
*/
|
|
122
|
+
export const searchEvals = (options, query = {}) => evalsRequest(options, '/search', { query });
|
|
123
|
+
export const renameEvalset = (options, evalsetId, name) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/rename`, {
|
|
124
|
+
method: 'PATCH',
|
|
125
|
+
body: { name },
|
|
126
|
+
});
|
|
127
|
+
export const deleteEvalset = (options, evalsetId) => evalsRequest(options, `/evalsets/${segment(evalsetId)}`, {
|
|
128
|
+
method: 'DELETE',
|
|
129
|
+
});
|
|
130
|
+
// --- Cases ------------------------------------------------------------------
|
|
131
|
+
export const listCases = (options, evalsetId) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/cases`);
|
|
132
|
+
export const createCase = (options, evalsetId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/cases`, {
|
|
133
|
+
method: 'POST',
|
|
134
|
+
body,
|
|
135
|
+
});
|
|
136
|
+
export const updateCase = (options, evalsetId, caseId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/cases/${segment(caseId)}`, {
|
|
137
|
+
method: 'PATCH',
|
|
138
|
+
body,
|
|
139
|
+
});
|
|
140
|
+
export const deleteCase = (options, evalsetId, caseId) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/cases/${segment(caseId)}`, {
|
|
141
|
+
method: 'DELETE',
|
|
142
|
+
});
|
|
143
|
+
/** The URL the browser opens to download an evalset definition. */
|
|
144
|
+
export const evalsetExportUrl = (options, evalsetId, format = 'json') => evalsUrl(options, `/evalsets/${segment(evalsetId)}/export`, { format });
|
|
145
|
+
/** The URL the browser opens to download a generated report. */
|
|
146
|
+
export const evalsetReportUrl = (options, evalsetId, format = 'markdown', runLimit) => evalsUrl(options, `/evalsets/${segment(evalsetId)}/report`, {
|
|
147
|
+
format,
|
|
148
|
+
run_limit: runLimit,
|
|
149
|
+
});
|
|
150
|
+
// --- Public reads -----------------------------------------------------------
|
|
151
|
+
export const getPublicEvalset = (options, evalsetId) => evalsRequest(options, `/public/evalsets/${segment(evalsetId)}`);
|
|
152
|
+
export const getPublicEvalsetDetails = (options, evalsetId, runsLimit) => evalsRequest(options, `/public/evalsets/${segment(evalsetId)}/details`, {
|
|
153
|
+
query: { runs_limit: runsLimit },
|
|
154
|
+
});
|
|
155
|
+
export const listPublicRuns = (options, evalsetId, experimentId, query = {}) => evalsRequest(options, `/public/evalsets/${segment(evalsetId)}/experiments/${segment(experimentId)}/runs`, { query });
|
|
156
|
+
export const createExperiment = (options, body) => evalsRequest(options, '/experiments', {
|
|
157
|
+
method: 'POST',
|
|
158
|
+
body,
|
|
159
|
+
});
|
|
160
|
+
export const listExperiments = (options, query = {}) => evalsRequest(options, '/experiments', { query });
|
|
161
|
+
export const getExperiment = (options, experimentId) => evalsRequest(options, `/experiments/${segment(experimentId)}`);
|
|
162
|
+
export const updateExperiment = (options, experimentId, body) => evalsRequest(options, `/experiments/${segment(experimentId)}`, {
|
|
163
|
+
method: 'PATCH',
|
|
164
|
+
body,
|
|
165
|
+
});
|
|
166
|
+
export const deleteExperiment = (options, experimentId) => evalsRequest(options, `/experiments/${segment(experimentId)}`, {
|
|
167
|
+
method: 'DELETE',
|
|
168
|
+
});
|
|
169
|
+
// --- Runs -------------------------------------------------------------------
|
|
170
|
+
export const createRun = (options, experimentId, body) => evalsRequest(options, `/experiments/${segment(experimentId)}/runs`, {
|
|
171
|
+
method: 'POST',
|
|
172
|
+
body,
|
|
173
|
+
});
|
|
174
|
+
export const listRuns = (options, experimentId, query = {}) => evalsRequest(options, `/experiments/${segment(experimentId)}/runs`, { query });
|
|
175
|
+
export const getRun = (options, runId) => evalsRequest(options, `/runs/${segment(runId)}`);
|
|
176
|
+
export const deleteRun = (options, runId) => evalsRequest(options, `/runs/${segment(runId)}`, {
|
|
177
|
+
method: 'DELETE',
|
|
178
|
+
});
|
|
179
|
+
export const compareRuns = (options, runIds) => evalsRequest(options, '/runs/compare', {
|
|
180
|
+
method: 'POST',
|
|
181
|
+
body: { run_ids: runIds },
|
|
182
|
+
});
|
|
183
|
+
export const createLiveEvent = (options, body) => evalsRequest(options, '/live/events', {
|
|
184
|
+
method: 'POST',
|
|
185
|
+
body,
|
|
186
|
+
});
|
|
187
|
+
export const listLiveTargets = (options, query = {}) => evalsRequest(options, '/live/targets', { query });
|
|
188
|
+
export const listLiveEvents = (options, query) => evalsRequest(options, '/live/events', { query });
|
|
189
|
+
/** The alerts the rolling windows raised: failure spikes and drifts (B2-13). */
|
|
190
|
+
export const listLiveAlerts = (options, query = {}) => evalsRequest(options, '/live/alerts', { query });
|
|
191
|
+
export const deleteLiveTarget = (options, targetId, targetType = 'agent') => evalsRequest(options, '/live/targets', {
|
|
192
|
+
method: 'DELETE',
|
|
193
|
+
query: { target_id: targetId, target_type: targetType },
|
|
194
|
+
});
|
|
195
|
+
export const listRunsAcross = (options, query = {}) => evalsRequest(options, '/runs', { query });
|
|
196
|
+
export const cancelRun = (options, runId) => evalsRequest(options, `/runs/${segment(runId)}/cancel`, {
|
|
197
|
+
method: 'POST',
|
|
198
|
+
});
|
|
199
|
+
/** The task grid of a run, filtered and paged by the service. */
|
|
200
|
+
export const listCaseResults = (options, runId, query = {}) => evalsRequest(options, `/runs/${segment(runId)}/cases`, { query });
|
|
201
|
+
export const getCaseResult = (options, runId, caseId) => evalsRequest(options, `/runs/${segment(runId)}/cases/${segment(caseId)}`);
|
|
202
|
+
/**
|
|
203
|
+
* The run as the network of agents that worked on it. `budget` is how many
|
|
204
|
+
* tasks' messages to answer: every task that did not pass, then passed ones
|
|
205
|
+
* while there is room.
|
|
206
|
+
*/
|
|
207
|
+
export const getRunNetwork = (options, runId, query = {}) => evalsRequest(options, `/runs/${segment(runId)}/network`, {
|
|
208
|
+
query,
|
|
209
|
+
});
|
|
210
|
+
/**
|
|
211
|
+
* One message of a run's network, in full. The id is the service's own and
|
|
212
|
+
* holds colons, which the route reads as a path: each segment is encoded, the
|
|
213
|
+
* separators are kept.
|
|
214
|
+
*/
|
|
215
|
+
export const getRunNetworkMessage = (options, runId, messageId) => evalsRequest(options, `/runs/${segment(runId)}/network/messages/${messageId.split('/').map(segment).join('/')}`);
|
|
216
|
+
/** A launch's runs, each as one line of its own network. */
|
|
217
|
+
export const getLaunchNetwork = (options, launchId) => evalsRequest(options, `/launches/${segment(launchId)}/network`);
|
|
218
|
+
export const reviewCaseResult = (options, runId, caseId, body) => evalsRequest(options, `/runs/${segment(runId)}/cases/${segment(caseId)}/review`, {
|
|
219
|
+
method: 'PATCH',
|
|
220
|
+
body,
|
|
221
|
+
});
|
|
222
|
+
/**
|
|
223
|
+
* Give an anonymous trial's work to the person who just signed in (B2-14):
|
|
224
|
+
* the benchmark, the launch, its runs and everything under them, moved
|
|
225
|
+
* rather than copied so a link the visitor kept still opens.
|
|
226
|
+
*
|
|
227
|
+
* Takes two credentials: the person's, in the client's options, and the
|
|
228
|
+
* trial's own key, which travels in its header.
|
|
229
|
+
*/
|
|
230
|
+
export const claimTrial = (options, trialUid, trialToken) => evalsRequest(options, '/trials/claim', {
|
|
231
|
+
method: 'POST',
|
|
232
|
+
body: { trial_uid: trialUid },
|
|
233
|
+
headers: { 'X-Datalayer-Trial-Token': trialToken },
|
|
234
|
+
});
|
|
235
|
+
/** The subjects an experiment can have, and the models offered (B2-11). */
|
|
236
|
+
export const listSubjects = (options) => evalsRequest(options, '/subjects');
|
|
237
|
+
/**
|
|
238
|
+
* Count one of those.
|
|
239
|
+
*
|
|
240
|
+
* Nothing is stored, and the answer says only that it was counted. Never worth
|
|
241
|
+
* failing a page for: a measure that breaks what somebody was doing is worse
|
|
242
|
+
* than a measure nobody has.
|
|
243
|
+
*/
|
|
244
|
+
export const recordProductEvent = (options, event) => evalsRequest(options, '/measures', {
|
|
245
|
+
method: 'POST',
|
|
246
|
+
body: { event },
|
|
247
|
+
});
|
|
248
|
+
/**
|
|
249
|
+
* The plan of a launch before it is made (B2-07): estimated duration and
|
|
250
|
+
* cost, the compute, and the problems that would stop it. Same body as the
|
|
251
|
+
* launch; nothing is created.
|
|
252
|
+
*/
|
|
253
|
+
export const validateLaunch = (options, evalsetId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/launches/validate`, {
|
|
254
|
+
method: 'POST',
|
|
255
|
+
body,
|
|
256
|
+
});
|
|
257
|
+
/** One submission of a benchmark across its experiments. */
|
|
258
|
+
export const createLaunch = (options, evalsetId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/launches`, {
|
|
259
|
+
method: 'POST',
|
|
260
|
+
body,
|
|
261
|
+
});
|
|
262
|
+
export const listLaunches = (options, query = {}) => evalsRequest(options, '/launches', { query });
|
|
263
|
+
export const getLaunch = (options, launchId) => evalsRequest(options, `/launches/${segment(launchId)}`);
|
|
264
|
+
export const cancelLaunch = (options, launchId) => evalsRequest(options, `/launches/${segment(launchId)}/cancel`, { method: 'POST' });
|
|
265
|
+
export const archiveLaunch = (options, launchId) => evalsRequest(options, `/launches/${segment(launchId)}/archive`, { method: 'POST' });
|
|
266
|
+
// --- Spec import and definition versions (B2-08, B2-09) --------------------
|
|
267
|
+
/** An evalset from a spec file, the same body the CLI and the action send. */
|
|
268
|
+
export const importEvalset = (options, body) => evalsRequest(options, '/evalsets/import', {
|
|
269
|
+
method: 'POST',
|
|
270
|
+
body,
|
|
271
|
+
});
|
|
272
|
+
export const listEvalsetVersions = (options, evalsetId, query = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/versions`, { query });
|
|
273
|
+
export const getEvalsetVersion = (options, evalsetId, version) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/versions/${segment(String(version))}`);
|
|
274
|
+
// --- Reports of a launch and a run, and the report document (B3-03) --------
|
|
275
|
+
/** The benchmark's whole report (every launch) as a serialized Lexical editor state. */
|
|
276
|
+
export const getEvalsetReportDocument = (options, evalsetId, query = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/report`, { query: { ...query, format: 'lexical' } });
|
|
277
|
+
/** The launch's report as a serialized Lexical editor state. */
|
|
278
|
+
export const getLaunchReportDocument = (options, launchId, query = {}) => evalsRequest(options, `/launches/${segment(launchId)}/report`, { query: { ...query, format: 'lexical' } });
|
|
279
|
+
/** Where a launch's Markdown or CSV report is downloaded from. */
|
|
280
|
+
export const launchReportUrl = (options, launchId, format) => evalsUrl(options, `/launches/${segment(launchId)}/report`, { format });
|
|
281
|
+
/** One run's report as a serialized Lexical editor state, with its task documents. */
|
|
282
|
+
export const getRunReportDocument = (options, runId) => evalsRequest(options, `/runs/${segment(runId)}/report`, { query: { format: 'lexical' } });
|
|
283
|
+
export const runReportUrl = (options, runId, format) => evalsUrl(options, `/runs/${segment(runId)}/report`, { format });
|
|
284
|
+
/** Write the launch's report into the account's benchmarks space. */
|
|
285
|
+
export const writeLaunchReportDocument = (options, launchId, body = {}) => evalsRequest(options, `/launches/${segment(launchId)}/report-document`, { method: 'POST', body });
|
|
286
|
+
// --- Investigations and the task sandbox (B3-02, B3-05) --------------------
|
|
287
|
+
/** Open the investigation of one task, or get the one already open. */
|
|
288
|
+
export const openTaskInvestigation = (options, runId, caseId) => evalsRequest(options, `/runs/${segment(runId)}/tasks/${segment(caseId)}/investigation`, { method: 'POST' });
|
|
289
|
+
export const openLaunchInvestigation = (options, launchId) => evalsRequest(options, `/launches/${segment(launchId)}/investigation`, { method: 'POST' });
|
|
290
|
+
export const listInvestigations = (options, query = {}) => evalsRequest(options, '/investigations', {
|
|
291
|
+
query,
|
|
292
|
+
});
|
|
293
|
+
export const getInvestigation = (options, investigationId) => evalsRequest(options, `/investigations/${segment(investigationId)}`);
|
|
294
|
+
export const updateInvestigation = (options, investigationId, body) => evalsRequest(options, `/investigations/${segment(investigationId)}`, { method: 'PATCH', body });
|
|
295
|
+
/**
|
|
296
|
+
* Publish an investigation to the library, or take it back: its owner's alone.
|
|
297
|
+
* The document and the notebooks it is written in go public and private with
|
|
298
|
+
* it.
|
|
299
|
+
*/
|
|
300
|
+
export const setInvestigationPublic = (options, investigationId, isPublic) => evalsRequest(options, `/investigations/${segment(investigationId)}/public`, { method: 'PATCH', body: { is_public: isPublic } });
|
|
301
|
+
/**
|
|
302
|
+
* Keep the investigation's page as it is shown, under a name everybody on
|
|
303
|
+
* the investigation sees; a view of that name is replaced (B4-11).
|
|
304
|
+
*/
|
|
305
|
+
export const saveInvestigationView = (options, investigationId, body) => evalsRequest(options, `/investigations/${segment(investigationId)}/views`, { method: 'POST', body });
|
|
306
|
+
/** Forget a saved view of the investigation's page. */
|
|
307
|
+
export const forgetInvestigationView = (options, investigationId, name) => evalsRequest(options, `/investigations/${segment(investigationId)}/views`, { method: 'DELETE', query: { name } });
|
|
308
|
+
/** Bring the task's sandbox back from its snapshot, bound to its investigation. */
|
|
309
|
+
export const resumeTaskSandbox = (options, runId, caseId, body = {}) => evalsRequest(options, `/runs/${segment(runId)}/tasks/${segment(caseId)}/sandbox/resume`, { method: 'POST', body });
|
|
310
|
+
// --- Sharing and permissions (B4-05) ----------------------------------------
|
|
311
|
+
/** Who a benchmark, one of its runs or an investigation is shared with; its owner's to read. */
|
|
312
|
+
export const getEvalsSharing = (options, record, uid) => evalsRequest(options, `/${record}/${segment(uid)}/sharing`);
|
|
313
|
+
/** Replace the grants at the levels named; the others are kept. Its owner's to do. */
|
|
314
|
+
export const updateEvalsSharing = (options, record, uid, access) => evalsRequest(options, `/${record}/${segment(uid)}/sharing`, { method: 'PUT', body: { access } });
|
|
315
|
+
/** The caller's role on the record, and what it allows. */
|
|
316
|
+
export const getEvalsPermissions = (options, record, uid) => evalsRequest(options, `/${record}/${segment(uid)}/permissions`);
|
|
317
|
+
// --- Reports (B4-04) ----------------------------------------------------------
|
|
318
|
+
/** A report over runs of a benchmark, written as a draft. */
|
|
319
|
+
export const createReport = (options, body) => evalsRequest(options, '/reports', { method: 'POST', body });
|
|
320
|
+
export const listReports = (options, query = {}) => evalsRequest(options, '/reports', { query });
|
|
321
|
+
export const getReport = (options, reportId) => evalsRequest(options, `/reports/${segment(reportId)}`);
|
|
322
|
+
/** Send a report for review, send it back, approve it or publish it. */
|
|
323
|
+
export const moveReport = (options, reportId, body) => evalsRequest(options, `/reports/${segment(reportId)}/state`, {
|
|
324
|
+
method: 'POST',
|
|
325
|
+
body,
|
|
326
|
+
});
|
|
327
|
+
/** A new version over newer runs, or the same ones; the old report is superseded by it. */
|
|
328
|
+
export const regenerateReport = (options, reportId, launchIds) => evalsRequest(options, `/reports/${segment(reportId)}/regenerate`, {
|
|
329
|
+
method: 'POST',
|
|
330
|
+
body: launchIds?.length ? { launch_ids: launchIds } : {},
|
|
331
|
+
});
|
|
332
|
+
// --- Review decisions (B4-03) -------------------------------------------------
|
|
333
|
+
/** What a reviewer decided about part of a result, recorded on a report or in an investigation. */
|
|
334
|
+
export const recordDecision = (options, subject, uid, body) => evalsRequest(options, `/${subject}/${segment(uid)}/decisions`, { method: 'POST', body });
|
|
335
|
+
/** The decisions made on a report or in an investigation, in the order they were made. */
|
|
336
|
+
export const listDecisions = (options, subject, uid) => evalsRequest(options, `/${subject}/${segment(uid)}/decisions`);
|
|
337
|
+
/**
|
|
338
|
+
* What was decided about a benchmark, or about one of its launches (B6-04).
|
|
339
|
+
*
|
|
340
|
+
* `listDecisions` answers what was decided *in* one report or investigation;
|
|
341
|
+
* this answers what was decided about the benchmark, which is what something
|
|
342
|
+
* outside the product has to ask — CI knows the benchmark it ran and nothing
|
|
343
|
+
* else. Naming neither answers nothing rather than everything.
|
|
344
|
+
*/
|
|
345
|
+
export const listDecisionsAbout = (options, query = {}) => evalsRequest(options, '/decisions', { query });
|
|
346
|
+
/** Where a report is downloaded as it was written, with its decisions (B4-08). */
|
|
347
|
+
export const reportExportUrl = (options, reportId, format = 'markdown') => evalsUrl(options, `/reports/${segment(reportId)}/export`, { format });
|
|
348
|
+
// --- Shared with the caller (B4-07) -------------------------------------------
|
|
349
|
+
/** The reports and investigations other people shared with the caller. */
|
|
350
|
+
export const listSharedWithMe = (options) => evalsRequest(options, '/shared');
|
|
351
|
+
// --- CI reports imported as snapshots (B4-09) ---------------------------------
|
|
352
|
+
/** Keep a report file CI produced on its benchmark, as its text. */
|
|
353
|
+
export const importReport = (options, evalsetId, body) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/reports/import`, { method: 'POST', body });
|
|
354
|
+
/** The reports imported on a benchmark, newest first, without their text. */
|
|
355
|
+
export const listReportImports = (options, evalsetId) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/reports/imports`);
|
|
356
|
+
/** One imported report, with its text as it was. */
|
|
357
|
+
export const getReportImport = (options, importId) => evalsRequest(options, `/report-imports/${segment(importId)}`);
|
|
358
|
+
/** Continue investigation: a live report and an investigation over its runs. */
|
|
359
|
+
export const continueReportImport = (options, importId) => evalsRequest(options, `/report-imports/${segment(importId)}/continue`, { method: 'POST' });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The evals API of the AI Agents service: evalsets (benchmarks), their
|
|
3
|
+
* cases, experiments, runs, comparisons and live targets.
|
|
4
|
+
*
|
|
5
|
+
* @module api/evals
|
|
6
|
+
*/
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './request';
|
|
9
|
+
export * from './client';
|
|
10
|
+
export * from './status';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
7
|
+
* Distributed under the terms of the Modified BSD License.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The evals API of the AI Agents service: evalsets (benchmarks), their
|
|
11
|
+
* cases, experiments, runs, comparisons and live targets.
|
|
12
|
+
*
|
|
13
|
+
* @module api/evals
|
|
14
|
+
*/
|
|
15
|
+
export * from './types.js';
|
|
16
|
+
export * from './request.js';
|
|
17
|
+
export * from './client.js';
|
|
18
|
+
export * from './status.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** What every evals call needs to know. */
|
|
2
|
+
export interface EvalsClientOptions {
|
|
3
|
+
/** The AI Agents service origin, e.g. `https://prod1.datalayer.run`. */
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
/** The caller's IAM token; a public read may go without one. */
|
|
6
|
+
token?: string;
|
|
7
|
+
/** An organization or team uid to act for; the caller's own when absent. */
|
|
8
|
+
accountUid?: string;
|
|
9
|
+
}
|
|
10
|
+
export type EvalsQuery = Record<string, string | number | boolean | undefined | null>;
|
|
11
|
+
export type EvalsMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
12
|
+
/** The AI Agents origin, with no trailing slash. */
|
|
13
|
+
export declare const aiAgentsOrigin: (baseUrl?: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* A full URL under `/api/ai-agents/v1`, with the account scope and any
|
|
16
|
+
* query merged in. Empty, null and undefined values are left out.
|
|
17
|
+
*/
|
|
18
|
+
export declare const aiAgentsUrl: (options: EvalsClientOptions, path: string, query?: EvalsQuery) => string;
|
|
19
|
+
/** A URL under `/api/ai-agents/v1/evals`. */
|
|
20
|
+
export declare const evalsUrl: (options: EvalsClientOptions, suffix: string, query?: EvalsQuery) => string;
|
|
21
|
+
export interface AiAgentsRequestInit {
|
|
22
|
+
method?: EvalsMethod;
|
|
23
|
+
body?: unknown;
|
|
24
|
+
query?: EvalsQuery;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
/**
|
|
27
|
+
* Headers beyond the caller's own credential. One call needs this: a
|
|
28
|
+
* trial's claim carries the trial's key beside the person's (B2-14).
|
|
29
|
+
*/
|
|
30
|
+
headers?: Record<string, string>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* One request to the AI Agents service, `path` relative to `/api/ai-agents/v1`.
|
|
34
|
+
*
|
|
35
|
+
* The typed functions in `client.ts` are built on this; a view that needs a
|
|
36
|
+
* path the client does not name yet may call it directly, and the contract
|
|
37
|
+
* spec still sees the path.
|
|
38
|
+
*/
|
|
39
|
+
export declare const aiAgentsRequest: <T>(options: EvalsClientOptions, path: string, init?: AiAgentsRequestInit) => Promise<T>;
|
|
40
|
+
/** One request under `/evals`. */
|
|
41
|
+
export declare const evalsRequest: <T>(options: EvalsClientOptions, suffix: string, init?: AiAgentsRequestInit) => Promise<T>;
|
|
42
|
+
/** A path segment, encoded once. */
|
|
43
|
+
export declare const segment: (value: string) => string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
7
|
+
* Distributed under the terms of the Modified BSD License.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* How the evals API is reached.
|
|
11
|
+
*
|
|
12
|
+
* One place builds the AI Agents origin, the `/api/ai-agents/v1` prefix and
|
|
13
|
+
* the account scope. The landings UI used to assemble those in three views;
|
|
14
|
+
* a service origin that moves then broke three places, silently. Here it
|
|
15
|
+
* is one, and the contract tests on both sides read this module's paths.
|
|
16
|
+
*
|
|
17
|
+
* Account scope: the service answers for the caller unless `account_uid`
|
|
18
|
+
* names an organization or a team the caller belongs to, in which case the
|
|
19
|
+
* evalsets are that account's. The option rides on every request.
|
|
20
|
+
*
|
|
21
|
+
* @module api/evals/request
|
|
22
|
+
*/
|
|
23
|
+
import { requestDatalayerAPI } from '../DatalayerApi.js';
|
|
24
|
+
import { API_BASE_PATHS, DEFAULT_SERVICE_URLS } from '../constants.js';
|
|
25
|
+
/** The AI Agents origin, with no trailing slash. */
|
|
26
|
+
export const aiAgentsOrigin = (baseUrl) => String(baseUrl || DEFAULT_SERVICE_URLS.AI_AGENTS)
|
|
27
|
+
.trim()
|
|
28
|
+
.replace(/\/+$/, '');
|
|
29
|
+
/**
|
|
30
|
+
* A full URL under `/api/ai-agents/v1`, with the account scope and any
|
|
31
|
+
* query merged in. Empty, null and undefined values are left out.
|
|
32
|
+
*/
|
|
33
|
+
export const aiAgentsUrl = (options, path, query = {}) => {
|
|
34
|
+
const [pathname, inlineSearch = ''] = path.split('?');
|
|
35
|
+
const parameters = new URLSearchParams(inlineSearch);
|
|
36
|
+
for (const [key, value] of Object.entries(query)) {
|
|
37
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
38
|
+
parameters.set(key, String(value));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (options.accountUid && !parameters.has('account_uid')) {
|
|
42
|
+
parameters.set('account_uid', options.accountUid);
|
|
43
|
+
}
|
|
44
|
+
const search = parameters.toString();
|
|
45
|
+
return `${aiAgentsOrigin(options.baseUrl)}${API_BASE_PATHS.AI_AGENTS}${pathname}${search ? `?${search}` : ''}`;
|
|
46
|
+
};
|
|
47
|
+
/** A URL under `/api/ai-agents/v1/evals`. */
|
|
48
|
+
export const evalsUrl = (options, suffix, query = {}) => aiAgentsUrl(options, `/evals${suffix}`, query);
|
|
49
|
+
/**
|
|
50
|
+
* One request to the AI Agents service, `path` relative to `/api/ai-agents/v1`.
|
|
51
|
+
*
|
|
52
|
+
* The typed functions in `client.ts` are built on this; a view that needs a
|
|
53
|
+
* path the client does not name yet may call it directly, and the contract
|
|
54
|
+
* spec still sees the path.
|
|
55
|
+
*/
|
|
56
|
+
export const aiAgentsRequest = (options, path, init = {}) => requestDatalayerAPI({
|
|
57
|
+
url: aiAgentsUrl(options, path, init.query),
|
|
58
|
+
method: init.method ?? 'GET',
|
|
59
|
+
body: init.body,
|
|
60
|
+
token: options.token,
|
|
61
|
+
signal: init.signal,
|
|
62
|
+
...(init.headers ? { headers: init.headers } : {}),
|
|
63
|
+
});
|
|
64
|
+
/** One request under `/evals`. */
|
|
65
|
+
export const evalsRequest = (options, suffix, init = {}) => aiAgentsRequest(options, `/evals${suffix}`, init);
|
|
66
|
+
/** A path segment, encoded once. */
|
|
67
|
+
export const segment = (value) => encodeURIComponent(String(value ?? '').trim());
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one vocabulary for what a run and a case are doing.
|
|
3
|
+
*
|
|
4
|
+
* The service stores `status` as free text and its writers disagreed over
|
|
5
|
+
* time (`queued`, `init`, `pending`, `running`, `completed`, `failed`,
|
|
6
|
+
* `error`, `success`, `done`, …). This is the same mapping as
|
|
7
|
+
* `agent_runtimes.evals.status` in Python: every word a writer has used maps
|
|
8
|
+
* onto the product vocabulary of BENCHMARK.md section 11.4, and "finished" is
|
|
9
|
+
* answered once. A word nobody has used maps to itself, lower-cased, so it is
|
|
10
|
+
* visible rather than misread.
|
|
11
|
+
*
|
|
12
|
+
* @module api/evals/status
|
|
13
|
+
*/
|
|
14
|
+
export declare const RUN_STATUSES: readonly ["queued", "provisioning", "running", "scoring", "completed", "failed", "review", "blocked", "cancelled"];
|
|
15
|
+
export type RunStatus = (typeof RUN_STATUSES)[number];
|
|
16
|
+
export declare const CASE_STATUSES: readonly ["waiting", "provisioning", "running", "scoring", "passed", "failed", "review", "blocked", "cancelled"];
|
|
17
|
+
export type CaseStatus = (typeof CASE_STATUSES)[number];
|
|
18
|
+
export declare const TERMINAL_RUN_STATUSES: ReadonlySet<string>;
|
|
19
|
+
export declare const TERMINAL_CASE_STATUSES: ReadonlySet<string>;
|
|
20
|
+
/** The section 11.4 word for a run status, whatever a writer wrote. */
|
|
21
|
+
export declare const normalizeRunStatus: (value: unknown) => RunStatus | string;
|
|
22
|
+
/** The section 11.4 word for a case status. */
|
|
23
|
+
export declare const normalizeCaseStatus: (value: unknown) => CaseStatus | string;
|
|
24
|
+
/** Whether a run with this status is over. */
|
|
25
|
+
export declare const isTerminalRunStatus: (value: unknown) => boolean;
|
|
26
|
+
/** Whether a case with this status is over. */
|
|
27
|
+
export declare const isTerminalCaseStatus: (value: unknown) => boolean;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) 2023-2026 Datalayer, Inc.
|
|
7
|
+
* Distributed under the terms of the Modified BSD License.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The one vocabulary for what a run and a case are doing.
|
|
11
|
+
*
|
|
12
|
+
* The service stores `status` as free text and its writers disagreed over
|
|
13
|
+
* time (`queued`, `init`, `pending`, `running`, `completed`, `failed`,
|
|
14
|
+
* `error`, `success`, `done`, …). This is the same mapping as
|
|
15
|
+
* `agent_runtimes.evals.status` in Python: every word a writer has used maps
|
|
16
|
+
* onto the product vocabulary of BENCHMARK.md section 11.4, and "finished" is
|
|
17
|
+
* answered once. A word nobody has used maps to itself, lower-cased, so it is
|
|
18
|
+
* visible rather than misread.
|
|
19
|
+
*
|
|
20
|
+
* @module api/evals/status
|
|
21
|
+
*/
|
|
22
|
+
export const RUN_STATUSES = [
|
|
23
|
+
'queued',
|
|
24
|
+
'provisioning',
|
|
25
|
+
'running',
|
|
26
|
+
'scoring',
|
|
27
|
+
'completed',
|
|
28
|
+
'failed',
|
|
29
|
+
'review',
|
|
30
|
+
'blocked',
|
|
31
|
+
'cancelled',
|
|
32
|
+
];
|
|
33
|
+
export const CASE_STATUSES = [
|
|
34
|
+
'waiting',
|
|
35
|
+
'provisioning',
|
|
36
|
+
'running',
|
|
37
|
+
'scoring',
|
|
38
|
+
'passed',
|
|
39
|
+
'failed',
|
|
40
|
+
'review',
|
|
41
|
+
'blocked',
|
|
42
|
+
'cancelled',
|
|
43
|
+
];
|
|
44
|
+
export const TERMINAL_RUN_STATUSES = new Set([
|
|
45
|
+
'completed',
|
|
46
|
+
'failed',
|
|
47
|
+
'cancelled',
|
|
48
|
+
]);
|
|
49
|
+
export const TERMINAL_CASE_STATUSES = new Set([
|
|
50
|
+
'passed',
|
|
51
|
+
'failed',
|
|
52
|
+
'cancelled',
|
|
53
|
+
]);
|
|
54
|
+
const LEGACY_RUN_STATUS = {
|
|
55
|
+
'': 'queued',
|
|
56
|
+
init: 'queued',
|
|
57
|
+
pending: 'queued',
|
|
58
|
+
queued: 'queued',
|
|
59
|
+
provisioning: 'provisioning',
|
|
60
|
+
starting: 'provisioning',
|
|
61
|
+
running: 'running',
|
|
62
|
+
in_progress: 'running',
|
|
63
|
+
scoring: 'scoring',
|
|
64
|
+
evaluating: 'scoring',
|
|
65
|
+
completed: 'completed',
|
|
66
|
+
complete: 'completed',
|
|
67
|
+
success: 'completed',
|
|
68
|
+
succeeded: 'completed',
|
|
69
|
+
passed: 'completed',
|
|
70
|
+
done: 'completed',
|
|
71
|
+
finished: 'completed',
|
|
72
|
+
failed: 'failed',
|
|
73
|
+
failure: 'failed',
|
|
74
|
+
error: 'failed',
|
|
75
|
+
errored: 'failed',
|
|
76
|
+
review: 'review',
|
|
77
|
+
needs_review: 'review',
|
|
78
|
+
blocked: 'blocked',
|
|
79
|
+
cancelled: 'cancelled',
|
|
80
|
+
canceled: 'cancelled',
|
|
81
|
+
aborted: 'cancelled',
|
|
82
|
+
};
|
|
83
|
+
const LEGACY_CASE_STATUS = {
|
|
84
|
+
'': 'waiting',
|
|
85
|
+
waiting: 'waiting',
|
|
86
|
+
queued: 'waiting',
|
|
87
|
+
pending: 'waiting',
|
|
88
|
+
provisioning: 'provisioning',
|
|
89
|
+
running: 'running',
|
|
90
|
+
scoring: 'scoring',
|
|
91
|
+
passed: 'passed',
|
|
92
|
+
pass: 'passed',
|
|
93
|
+
success: 'passed',
|
|
94
|
+
completed: 'passed',
|
|
95
|
+
failed: 'failed',
|
|
96
|
+
fail: 'failed',
|
|
97
|
+
error: 'failed',
|
|
98
|
+
review: 'review',
|
|
99
|
+
needs_review: 'review',
|
|
100
|
+
blocked: 'blocked',
|
|
101
|
+
cancelled: 'cancelled',
|
|
102
|
+
canceled: 'cancelled',
|
|
103
|
+
skipped: 'cancelled',
|
|
104
|
+
};
|
|
105
|
+
const word = (value) => String(value ?? '')
|
|
106
|
+
.trim()
|
|
107
|
+
.toLowerCase()
|
|
108
|
+
.replace(/[-\s]/g, '_');
|
|
109
|
+
/** The section 11.4 word for a run status, whatever a writer wrote. */
|
|
110
|
+
export const normalizeRunStatus = (value) => {
|
|
111
|
+
const key = word(value);
|
|
112
|
+
return LEGACY_RUN_STATUS[key] ?? key;
|
|
113
|
+
};
|
|
114
|
+
/** The section 11.4 word for a case status. */
|
|
115
|
+
export const normalizeCaseStatus = (value) => {
|
|
116
|
+
const key = word(value);
|
|
117
|
+
return LEGACY_CASE_STATUS[key] ?? key;
|
|
118
|
+
};
|
|
119
|
+
/** Whether a run with this status is over. */
|
|
120
|
+
export const isTerminalRunStatus = (value) => TERMINAL_RUN_STATUSES.has(normalizeRunStatus(value));
|
|
121
|
+
/** Whether a case with this status is over. */
|
|
122
|
+
export const isTerminalCaseStatus = (value) => TERMINAL_CASE_STATUSES.has(normalizeCaseStatus(value));
|