@datalayer/core 1.1.59 → 1.1.66
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 +2 -2
- package/lib/api/DatalayerApi.d.ts +42 -1
- package/lib/api/DatalayerApi.js +90 -3
- package/lib/api/constants.d.ts +18 -0
- package/lib/api/constants.js +18 -0
- package/lib/api/contents/attachments.d.ts +9 -0
- package/lib/api/contents/attachments.js +43 -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 +15 -0
- package/lib/api/contents/datasets.js +45 -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 +53 -0
- package/lib/api/contents/sandboxUid.js +78 -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/iam/connectedAgents.d.ts +39 -0
- package/lib/api/iam/connectedAgents.js +52 -0
- package/lib/api/iam/index.d.ts +2 -1
- package/lib/api/iam/index.js +2 -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 +80 -0
- package/lib/api/iam/mcpPolicy.js +132 -0
- package/lib/api/iam/organizationTeams.d.ts +13 -0
- package/lib/api/iam/organizationTeams.js +43 -0
- package/lib/api/iam/serviceAgents.d.ts +68 -0
- package/lib/api/iam/serviceAgents.js +119 -0
- package/lib/api/index.d.ts +4 -1
- package/lib/api/index.js +3 -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 +125 -0
- package/lib/api/mcp/observability.js +254 -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/utils/validation.d.ts +1 -1
- package/lib/api/utils/validation.js +1 -1
- 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/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 +1 -0
- package/lib/components/animation/AnimatedText.js +0 -4
- 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 +18 -1
- package/lib/components/avatars/UserAvatar.js +14 -14
- 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 +10 -0
- package/lib/components/billing/BillingEntitySelect.js +0 -17
- package/lib/components/billing/index.js +0 -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 +31 -0
- package/lib/components/collaboration/LiveEditorCollaborators.js +98 -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 -2
- package/lib/components/display/DatalayerBox.js +6 -6
- 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/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 +10 -0
- package/lib/components/labels/StatusLabels.js +30 -1
- 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 +1 -0
- package/lib/components/principal/PrincipalAppearance.js +0 -8
- package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
- package/lib/components/principal/PrincipalAvatar.js +25 -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 +31 -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 +7 -15
- 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/ScreencaptureButton.d.ts +1 -1
- package/lib/components/sharing/ShareAccessComponent.d.ts +15 -1
- package/lib/components/sharing/ShareAccessComponent.js +36 -23
- package/lib/components/sharing/SharingEditor.d.ts +17 -0
- package/lib/components/sharing/SharingEditor.js +0 -24
- 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/index.d.ts +2 -0
- package/lib/hooks/index.js +2 -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/useCache.d.ts +310 -105
- package/lib/hooks/useCache.js +142 -355
- package/lib/hooks/useContainsFocus.d.ts +1 -1
- package/lib/hooks/useContents.d.ts +313 -0
- package/lib/hooks/useContents.js +964 -0
- package/lib/hooks/useFocusTrap.d.ts +4 -4
- package/lib/hooks/useFocusTrap.js +1 -1
- package/lib/hooks/useMcp.d.ts +229 -0
- package/lib/hooks/useMcp.js +656 -0
- package/lib/hooks/useMobile.js +0 -5
- 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/useToast.js +0 -4
- package/lib/hooks/useUser.js +42 -0
- 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/McpAuditEvent.d.ts +52 -0
- package/lib/models/McpAuditEvent.js +5 -0
- package/lib/models/McpBinding.d.ts +51 -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/StartedBy.d.ts +57 -0
- package/lib/models/StartedBy.js +81 -0
- package/lib/models/UserDTO.js +4 -2
- package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
- package/lib/models/contents/__fixtures__/v1-contracts.json +66 -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/state/substates/CoreState.d.ts +15 -7
- package/lib/state/substates/CoreState.js +18 -14
- package/lib/state/substates/IAMState.d.ts +1 -1
- package/lib/state/substates/IAMState.js +5 -5
- package/lib/state/substates/ProfileState.js +0 -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/WithSuspense.d.ts +1 -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/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/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 +100 -0
- package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
- package/lib/views/mcp/EnterpriseConsole.js +173 -0
- package/lib/views/mcp/McpDashboard.d.ts +50 -0
- package/lib/views/mcp/McpDashboard.js +347 -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 +50 -0
- package/lib/views/mcp/McpObservability.js +150 -0
- package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
- package/lib/views/mcp/OrganizationPolicy.js +107 -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 +125 -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 +67 -0
- package/lib/views/mcp/PolicyForm.js +91 -0
- package/lib/views/mcp/PolicyHistory.d.ts +45 -0
- package/lib/views/mcp/PolicyHistory.js +62 -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 +98 -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 +29 -0
- package/lib/views/mcp/index.js +37 -0
- package/lib/views/mcp/types.d.ts +66 -0
- package/lib/views/mcp/types.js +5 -0
- package/lib/views/secrets/SecretEdit.d.ts +5 -1
- package/lib/views/secrets/SecretEdit.js +2 -2
- package/lib/views/secrets/SecretNew.d.ts +11 -1
- package/lib/views/secrets/SecretNew.js +2 -2
- package/lib/views/secrets/Secrets.d.ts +12 -1
- package/lib/views/secrets/Secrets.js +2 -2
- package/package.json +28 -24
- package/scripts/generate-contents-types.py +169 -0
- package/scripts/generate-mcp-types.py +233 -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
|
@@ -34,19 +34,19 @@ export const useProjectStore = create()((set, get) => ({
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
})),
|
|
37
|
-
setAgent: (projectId,
|
|
37
|
+
setAgent: (projectId, agentRuntimeName, agentName, agentStatus, agentSpecId) => set(state => ({
|
|
38
38
|
projects: {
|
|
39
39
|
...state.projects,
|
|
40
40
|
[projectId]: {
|
|
41
41
|
...state.projects[projectId],
|
|
42
|
-
|
|
42
|
+
agentRuntimeName,
|
|
43
43
|
agentName,
|
|
44
44
|
// When removing the agent, also clear the status.
|
|
45
45
|
// When setting, use provided status or preserve existing.
|
|
46
|
-
agentStatus:
|
|
46
|
+
agentStatus: agentRuntimeName !== undefined
|
|
47
47
|
? (agentStatus ?? state.projects[projectId]?.agentStatus)
|
|
48
48
|
: undefined,
|
|
49
|
-
agentSpecId:
|
|
49
|
+
agentSpecId: agentRuntimeName !== undefined
|
|
50
50
|
? (agentSpecId ?? state.projects[projectId]?.agentSpecId)
|
|
51
51
|
: undefined,
|
|
52
52
|
},
|
package/lib/hooks/useRef.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ import React from 'react';
|
|
|
7
7
|
* @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
|
|
8
8
|
* @type TRef The type of the RefObject which should be created.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef>): React.RefObject<TRef>;
|
|
10
|
+
export declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef | null>): React.RefObject<TRef | null>;
|
package/lib/hooks/useRef.js
CHANGED
|
@@ -11,6 +11,9 @@ import { useRef } from 'react';
|
|
|
11
11
|
* @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
|
|
12
12
|
* @type TRef The type of the RefObject which should be created.
|
|
13
13
|
*/
|
|
14
|
+
// React 19 types `useRef<T>(null)` as `RefObject<T | null>`, so both the
|
|
15
|
+
// accepted and returned ref are nullable here. Primer 37 still declares the
|
|
16
|
+
// React 18 shape, so its call sites cast at the boundary.
|
|
14
17
|
export function useProvidedRefOrCreate(providedRef) {
|
|
15
18
|
const createdRef = useRef(null);
|
|
16
19
|
return providedRef ?? createdRef;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
export type ScreencaptureContextType = {
|
|
3
4
|
closeScreencapture: () => void;
|
|
@@ -15,4 +16,4 @@ export type IScreencaptureProviderProps = {
|
|
|
15
16
|
disableDarken?: boolean;
|
|
16
17
|
screenshotSurface?: (qfds: any) => JSX.Element;
|
|
17
18
|
};
|
|
18
|
-
export declare function ScreencaptureProvider({ children, zIndex, disableDarken, screenshotSurface, }: IScreencaptureProviderProps):
|
|
19
|
+
export declare function ScreencaptureProvider({ children, zIndex, disableDarken, screenshotSurface, }: IScreencaptureProviderProps): JSX.Element;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
-
* Distributed under the terms of the Modified BSD License.
|
|
5
|
-
*/
|
|
6
2
|
import { createContext, useState, useContext } from 'react';
|
|
7
3
|
import { LayoutScreencapture } from './layouts/index.js';
|
|
8
4
|
export const ScreencaptureContext = createContext({
|
package/lib/hooks/useToast.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
-
* Distributed under the terms of the Modified BSD License.
|
|
5
|
-
*/
|
|
6
2
|
import React from 'react';
|
|
7
3
|
import { toast } from 'react-toastify';
|
|
8
4
|
import { Button } from '@primer/react';
|
package/lib/hooks/useUser.js
CHANGED
|
@@ -15,6 +15,28 @@ const isOnPublicPath = () => {
|
|
|
15
15
|
}
|
|
16
16
|
return isPublicPath(window.location?.pathname || '');
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Whether these views are running inside JupyterLab.
|
|
20
|
+
*
|
|
21
|
+
* Read from the configuration JupyterLab writes into its own page, so nothing
|
|
22
|
+
* has to be imported from it: this module is used by the web application as
|
|
23
|
+
* well, which has no such configuration.
|
|
24
|
+
*/
|
|
25
|
+
const isInsideJupyterLab = () => {
|
|
26
|
+
if (typeof document === 'undefined') {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const config = document.getElementById('jupyter-config-data');
|
|
30
|
+
if (!config) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(config.textContent || '{}').appName === 'JupyterLab';
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
18
40
|
export const useUser = (role) => {
|
|
19
41
|
const { user } = useIAMStore();
|
|
20
42
|
if (role) {
|
|
@@ -22,6 +44,10 @@ export const useUser = (role) => {
|
|
|
22
44
|
if (isOnPublicPath()) {
|
|
23
45
|
return user;
|
|
24
46
|
}
|
|
47
|
+
if (isInsideJupyterLab()) {
|
|
48
|
+
// Same reason as below: the router of these views answers this.
|
|
49
|
+
return user;
|
|
50
|
+
}
|
|
25
51
|
console.warn(`User should have role ${role.handle} - Forcing navigation to login page...`);
|
|
26
52
|
window.location.href = LOGIN_HREF;
|
|
27
53
|
throw new Error(`User should have role ${role.handle}`);
|
|
@@ -31,6 +57,22 @@ export const useUser = (role) => {
|
|
|
31
57
|
if (isOnPublicPath()) {
|
|
32
58
|
return user;
|
|
33
59
|
}
|
|
60
|
+
/*
|
|
61
|
+
* Inside JupyterLab, nobody leaves the page.
|
|
62
|
+
*
|
|
63
|
+
* `/login` is a page of the web application, at the root of the origin —
|
|
64
|
+
* and the origin of a JupyterLab is the Jupyter Server, which serves
|
|
65
|
+
* something else entirely there. Signing out of a view thus threw the user
|
|
66
|
+
* out of JupyterLab and onto a page of the server, which is not even a
|
|
67
|
+
* sign-in form.
|
|
68
|
+
*
|
|
69
|
+
* The views of Datalayer carry their own sign-in route under the base of
|
|
70
|
+
* JupyterLab, and their router shows it as soon as there is no user — so
|
|
71
|
+
* the way to reach it is to let that render, not to navigate away from it.
|
|
72
|
+
*/
|
|
73
|
+
if (isInsideJupyterLab()) {
|
|
74
|
+
return user;
|
|
75
|
+
}
|
|
34
76
|
console.warn('No user found... Forcing navigation to /login');
|
|
35
77
|
window.location.href = LOGIN_HREF;
|
|
36
78
|
}
|
|
@@ -2,4 +2,4 @@ import { RefObject } from 'react';
|
|
|
2
2
|
export type VisibilityMap = {
|
|
3
3
|
[key: string]: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare function useVisibilityObserver(navigationRef: RefObject<HTMLUListElement>, children: any): VisibilityMap[];
|
|
5
|
+
export declare function useVisibilityObserver(navigationRef: RefObject<HTMLUListElement | null>, children: any): VisibilityMap[];
|
package/lib/index.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ export * from './utils';
|
|
|
3
3
|
export * from './state';
|
|
4
4
|
export * from './navigation';
|
|
5
5
|
export * from './hooks';
|
|
6
|
-
export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi';
|
|
6
|
+
export { requestDatalayerAPI, requestDatalayerAPIWithResponse, RunResponseError, NetworkError, } from './api/DatalayerApi';
|
|
7
7
|
export type { IRequestDatalayerAPIOptions } from './api/DatalayerApi';
|
|
8
|
+
export type { IDatalayerAPIResponse } from './api/DatalayerApi';
|
|
8
9
|
export { API_BASE_PATHS } from './api/constants';
|
|
9
10
|
export * as iamApi from './api/iam';
|
|
11
|
+
export * as contentsApi from './api/contents';
|
|
10
12
|
export * from './client';
|
|
13
|
+
export * from './models/contents';
|
|
11
14
|
export * from './otel';
|
|
12
15
|
export * from './views';
|
package/lib/index.js
CHANGED
|
@@ -10,10 +10,12 @@ export * from './state/index.js';
|
|
|
10
10
|
export * from './navigation/index.js';
|
|
11
11
|
export * from './hooks/index.js';
|
|
12
12
|
// Export APIs.
|
|
13
|
-
export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi.js';
|
|
13
|
+
export { requestDatalayerAPI, requestDatalayerAPIWithResponse, RunResponseError, NetworkError, } from './api/DatalayerApi.js';
|
|
14
14
|
export { API_BASE_PATHS } from './api/constants.js';
|
|
15
15
|
export * as iamApi from './api/iam/index.js';
|
|
16
|
+
export * as contentsApi from './api/contents/index.js';
|
|
16
17
|
export * from './client/index.js';
|
|
18
|
+
export * from './models/contents/index.js';
|
|
17
19
|
// OTEL observability components, hooks, and types
|
|
18
20
|
export * from './otel/index.js';
|
|
19
21
|
// Reusable views (sign-in pages, etc.)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const FlashMock: () => import("react
|
|
1
|
+
export declare const FlashMock: () => import("react").JSX.Element;
|
|
2
2
|
export default FlashMock;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DashboardMock: () => import("react
|
|
1
|
+
export declare const DashboardMock: () => import("react").JSX.Element;
|
|
2
2
|
export default DashboardMock;
|
package/lib/models/Credits.d.ts
CHANGED
|
@@ -25,6 +25,22 @@ export interface ICredits {
|
|
|
25
25
|
*/
|
|
26
26
|
last_update: string;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The credits an account can still spend.
|
|
30
|
+
*
|
|
31
|
+
* `credits` means one of two things depending on whether a quota is set: what
|
|
32
|
+
* is left, or what has been consumed against the quota. IAM omits `quota`
|
|
33
|
+
* entirely for an account without one, so an absent quota is read the same as
|
|
34
|
+
* an explicit `null` — testing only against `null` let `undefined` take the
|
|
35
|
+
* quota branch and produced `NaN`, which then travelled silently into every
|
|
36
|
+
* reader of this number.
|
|
37
|
+
*
|
|
38
|
+
* Outstanding reservations are already committed, so they are subtracted:
|
|
39
|
+
* what is returned is what a new reservation may still claim.
|
|
40
|
+
*/
|
|
41
|
+
export declare const availableCredits: (credits: Pick<ICredits, "credits" | "quota">, reservations?: readonly {
|
|
42
|
+
credits: number;
|
|
43
|
+
}[]) => number;
|
|
28
44
|
export interface ICheckoutPortal {
|
|
29
45
|
/**
|
|
30
46
|
* External checkout portal URL to open in a new tab.
|
package/lib/models/Credits.js
CHANGED
|
@@ -9,3 +9,25 @@
|
|
|
9
9
|
* TODO what is a good LOW_CREDITS bar? - A better way would be to set it from a server settings or a cloud config.
|
|
10
10
|
*/
|
|
11
11
|
export const LOW_CREDITS = 3;
|
|
12
|
+
/**
|
|
13
|
+
* The credits an account can still spend.
|
|
14
|
+
*
|
|
15
|
+
* `credits` means one of two things depending on whether a quota is set: what
|
|
16
|
+
* is left, or what has been consumed against the quota. IAM omits `quota`
|
|
17
|
+
* entirely for an account without one, so an absent quota is read the same as
|
|
18
|
+
* an explicit `null` — testing only against `null` let `undefined` take the
|
|
19
|
+
* quota branch and produced `NaN`, which then travelled silently into every
|
|
20
|
+
* reader of this number.
|
|
21
|
+
*
|
|
22
|
+
* Outstanding reservations are already committed, so they are subtracted:
|
|
23
|
+
* what is returned is what a new reservation may still claim.
|
|
24
|
+
*/
|
|
25
|
+
export const availableCredits = (credits, reservations = []) => {
|
|
26
|
+
const quota = credits.quota;
|
|
27
|
+
const balance = typeof quota === 'number' ? quota - credits.credits : credits.credits;
|
|
28
|
+
if (!Number.isFinite(balance)) {
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
const reserved = reservations.reduce((consumed, reservation) => consumed + (Number.isFinite(reservation.credits) ? reservation.credits : 0), 0);
|
|
32
|
+
return Math.max(0, balance - reserved);
|
|
33
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An audit row of the Jupyter MCP Server: one call or one decision, written
|
|
3
|
+
* by the gateway for every request, append-only in `mcp-audit`.
|
|
4
|
+
*
|
|
5
|
+
* Audit answers *who did what, and was it allowed*. It is not telemetry: a
|
|
6
|
+
* row carries the trace id so one trace joins both trails, and never an
|
|
7
|
+
* argument in clear — arguments are hashed and redacted with the Contents
|
|
8
|
+
* rules before they reach the row.
|
|
9
|
+
*
|
|
10
|
+
* @module models/McpAuditEvent
|
|
11
|
+
*/
|
|
12
|
+
export type McpAuditDecision = 'allowed' | 'refused';
|
|
13
|
+
export type McpAuditOutcome = 'ok' | 'error' | 'is_error';
|
|
14
|
+
export interface McpClientInfo {
|
|
15
|
+
name?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface McpAuditEvent {
|
|
20
|
+
uid: string;
|
|
21
|
+
at: string;
|
|
22
|
+
orgUid?: string | null;
|
|
23
|
+
teamUid?: string | null;
|
|
24
|
+
userUid: string;
|
|
25
|
+
clientId?: string | null;
|
|
26
|
+
agentUid?: string | null;
|
|
27
|
+
/** The delegation chain (RFC 8693 `act`), outermost first. */
|
|
28
|
+
act?: string[];
|
|
29
|
+
/** The JSON-RPC method, or the REST route for a gateway API call. */
|
|
30
|
+
method: string;
|
|
31
|
+
tool?: string | null;
|
|
32
|
+
itemUid?: string | null;
|
|
33
|
+
sourceUid?: string | null;
|
|
34
|
+
cellId?: string | null;
|
|
35
|
+
argumentsHash?: string | null;
|
|
36
|
+
redactedArguments?: Record<string, unknown> | null;
|
|
37
|
+
decision: McpAuditDecision;
|
|
38
|
+
/** Names the rule and, once policy has layers, the layer that decided. */
|
|
39
|
+
refusalReason?: string | null;
|
|
40
|
+
outcome?: McpAuditOutcome | null;
|
|
41
|
+
durationMs?: number | null;
|
|
42
|
+
taskId?: string | null;
|
|
43
|
+
traceId?: string | null;
|
|
44
|
+
replica?: string | null;
|
|
45
|
+
protocolVersion?: string | null;
|
|
46
|
+
clientInfo?: McpClientInfo | null;
|
|
47
|
+
}
|
|
48
|
+
export interface McpAuditEventList {
|
|
49
|
+
items: McpAuditEvent[];
|
|
50
|
+
nextCursor?: string | null;
|
|
51
|
+
}
|
|
52
|
+
export type McpAuditExportFormat = 'jsonl' | 'csv';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A binding of the Jupyter MCP Server: a handle an agent holds on a
|
|
3
|
+
* notebook (`nb_…`), a toolset (`ts_…`) or a sandbox (`sb_…`).
|
|
4
|
+
*
|
|
5
|
+
* The sandbox binding *is* the session: one per (user, client) unless a
|
|
6
|
+
* client holds several on purpose. A notebook binding names the sandbox its
|
|
7
|
+
* cells execute on. Bindings live in `mcp-gateway`, expire with the item or
|
|
8
|
+
* the reservation they follow, and are refreshed on use.
|
|
9
|
+
*
|
|
10
|
+
* @module models/McpBinding
|
|
11
|
+
*/
|
|
12
|
+
export type McpBindingKind = 'notebook' | 'toolset' | 'sandbox';
|
|
13
|
+
/** What the gateway does when the sandbox behind a binding is gone. */
|
|
14
|
+
export type McpBindingOnLost = 'fail' | 'relaunch';
|
|
15
|
+
/** Where a sandbox binding is; `lost` is what `SANDBOX_LOST` reports. */
|
|
16
|
+
export type McpBindingState = 'active' | 'lost' | 'closed' | 'expired';
|
|
17
|
+
export interface McpBinding {
|
|
18
|
+
/** The handle: `nb_…`, `ts_…` or `sb_…`. */
|
|
19
|
+
uid: string;
|
|
20
|
+
kind: McpBindingKind;
|
|
21
|
+
userUid: string;
|
|
22
|
+
clientId?: string | null;
|
|
23
|
+
agentUid?: string | null;
|
|
24
|
+
orgUid?: string | null;
|
|
25
|
+
alias?: string | null;
|
|
26
|
+
/** The Spacer notebook, for a `notebook` binding. */
|
|
27
|
+
itemUid?: string | null;
|
|
28
|
+
/** The Contents source and session, for a `toolset` binding. */
|
|
29
|
+
sourceUid?: string | null;
|
|
30
|
+
sessionUid?: string | null;
|
|
31
|
+
/** The runtime, for a `sandbox` binding. */
|
|
32
|
+
sandboxUid?: string | null;
|
|
33
|
+
sandboxProvider?: string | null;
|
|
34
|
+
/** What the runtime reported it can do. */
|
|
35
|
+
capabilities?: string[];
|
|
36
|
+
onLost?: McpBindingOnLost;
|
|
37
|
+
/** The gateway replica whose worker holds the connection. */
|
|
38
|
+
workerReplica?: string | null;
|
|
39
|
+
/** The owner's uid when the sandbox is shared with the caller through its ACL. */
|
|
40
|
+
sharedFrom?: string | null;
|
|
41
|
+
/** For a notebook binding: the sandbox its cells execute on. */
|
|
42
|
+
sandboxBindingUid?: string | null;
|
|
43
|
+
state?: McpBindingState;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
lastUsedAt?: string | null;
|
|
46
|
+
expiresAt?: string | null;
|
|
47
|
+
}
|
|
48
|
+
export interface McpBindingList {
|
|
49
|
+
items: McpBinding[];
|
|
50
|
+
nextCursor?: string | null;
|
|
51
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP policy: what an agent *may do*.
|
|
3
|
+
*
|
|
4
|
+
* Policy is layered and each layer only narrows: platform ∩ organization ∩
|
|
5
|
+
* team for an organization-scope token, platform ∩ personal for a
|
|
6
|
+
* personal-scope one. The organization's and the person's layers are IAM
|
|
7
|
+
* settings; the gateway answers the **effective** policy for a token with,
|
|
8
|
+
* per rule, which layer decided — what the Policies page renders as
|
|
9
|
+
* "Datalayer default", "required by your organization" or "you asked".
|
|
10
|
+
*
|
|
11
|
+
* Until milestone 3 adds the layers, `GET /api/mcp/v1/policy` answers the
|
|
12
|
+
* platform defaults from `tool_policy.py` and the token's scopes.
|
|
13
|
+
*
|
|
14
|
+
* @module models/McpPolicy
|
|
15
|
+
*/
|
|
16
|
+
export type McpPolicyLayer = 'platform' | 'organization' | 'team' | 'personal';
|
|
17
|
+
/** The Contents approval vocabulary. */
|
|
18
|
+
export type McpApprovalPolicy = 'explicit' | 'auto-allowlisted' | 'never';
|
|
19
|
+
export type McpPolicyScope = 'personal' | 'organization';
|
|
20
|
+
/** One rule of the effective policy, and the layer that decided it. */
|
|
21
|
+
export interface McpPolicyRule {
|
|
22
|
+
/** The rule's name in the organization policy vocabulary, e.g. `tool_denylist`. */
|
|
23
|
+
name: string;
|
|
24
|
+
value: unknown;
|
|
25
|
+
decidedBy: McpPolicyLayer;
|
|
26
|
+
/** Why, when the gateway has a sentence for it. */
|
|
27
|
+
reason?: string | null;
|
|
28
|
+
}
|
|
29
|
+
/** What one tool needs, and what happens before it runs. */
|
|
30
|
+
export interface McpToolRule {
|
|
31
|
+
tool: string;
|
|
32
|
+
scope: string;
|
|
33
|
+
access?: 'read' | 'write' | 'execute';
|
|
34
|
+
approval?: McpApprovalPolicy;
|
|
35
|
+
allowed: boolean;
|
|
36
|
+
decidedBy: McpPolicyLayer;
|
|
37
|
+
}
|
|
38
|
+
/** The effective policy for one token, redacted to what its holder may see. */
|
|
39
|
+
export interface McpEffectivePolicy {
|
|
40
|
+
scope: McpPolicyScope;
|
|
41
|
+
orgUid?: string | null;
|
|
42
|
+
teamUid?: string | null;
|
|
43
|
+
/** The agent the policy was evaluated for, when previewing as one. */
|
|
44
|
+
clientId?: string | null;
|
|
45
|
+
/** The scopes the token carries; the ceiling over every tool rule. */
|
|
46
|
+
scopes: string[];
|
|
47
|
+
rules: McpPolicyRule[];
|
|
48
|
+
tools: McpToolRule[];
|
|
49
|
+
evaluatedAt?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The organization (or team) MCP policy as IAM keeps it, versioned and
|
|
53
|
+
* audited. Every field is optional: an absent rule narrows nothing.
|
|
54
|
+
*/
|
|
55
|
+
export interface McpOrganizationPolicy {
|
|
56
|
+
version?: number;
|
|
57
|
+
/** CIMD URLs, client ids or software ids; fails closed. */
|
|
58
|
+
allowedClients?: string[];
|
|
59
|
+
requireDpop?: boolean;
|
|
60
|
+
requireOrgSso?: boolean;
|
|
61
|
+
maxScopes?: string[];
|
|
62
|
+
toolAllowlist?: string[];
|
|
63
|
+
toolDenylist?: string[];
|
|
64
|
+
/** Per tool, or per annotation (`destructiveHint`, `readOnlyHint`). */
|
|
65
|
+
approvalPolicy?: Record<string, McpApprovalPolicy>;
|
|
66
|
+
allowedEnvironments?: string[];
|
|
67
|
+
allowedProviders?: string[];
|
|
68
|
+
maxGpu?: number;
|
|
69
|
+
maxReservationMinutes?: number;
|
|
70
|
+
creditsPerDay?: number;
|
|
71
|
+
callsPerMinute?: number;
|
|
72
|
+
sessionMaxHours?: number;
|
|
73
|
+
updatedAt?: string;
|
|
74
|
+
updatedBy?: string;
|
|
75
|
+
}
|
|
76
|
+
/** A person's rules for the agents acting for them outside any organization. */
|
|
77
|
+
export type McpPersonalPolicy = Pick<McpOrganizationPolicy, 'version' | 'approvalPolicy' | 'creditsPerDay' | 'toolDenylist' | 'allowedEnvironments' | 'sessionMaxHours' | 'updatedAt'>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A task of the Jupyter MCP Server: one tool call that outlives the request
|
|
3
|
+
* that started it.
|
|
4
|
+
*
|
|
5
|
+
* The `uid` is the MCP `taskId`. A task is submitted by an agent, runs in
|
|
6
|
+
* the sandbox its session is bound to, and is reachable by anyone allowed to
|
|
7
|
+
* see the notebook it touched — from another device, forty minutes later.
|
|
8
|
+
* The gateway keeps the portable projection in `mcp-tasks`; the workflow
|
|
9
|
+
* engine owns claims and recovery, which is why there are no lease fields.
|
|
10
|
+
*
|
|
11
|
+
* Snake case on the wire, camel case here, exactly as Contents does.
|
|
12
|
+
*
|
|
13
|
+
* @module models/McpTask
|
|
14
|
+
*/
|
|
15
|
+
/** Where a task has got to; the MCP task status vocabulary. */
|
|
16
|
+
export type McpTaskStatus = 'working' | 'input_required' | 'completed' | 'failed' | 'cancelled';
|
|
17
|
+
/** The engine a task's workflow runs on. */
|
|
18
|
+
export type McpWorkflowEngine = 'temporal' | 'dbos';
|
|
19
|
+
/** A tool result small enough to travel with the task. */
|
|
20
|
+
export interface McpCallToolResult {
|
|
21
|
+
content?: Array<Record<string, unknown>>;
|
|
22
|
+
structuredContent?: Record<string, unknown>;
|
|
23
|
+
isError?: boolean;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** One output of a task, in order; large outputs are references. */
|
|
27
|
+
export interface McpTaskOutput {
|
|
28
|
+
index: number;
|
|
29
|
+
outputType: string;
|
|
30
|
+
mimeType?: string | null;
|
|
31
|
+
/** Inline text under the size limit. */
|
|
32
|
+
text?: string | null;
|
|
33
|
+
/** An object reference for anything larger. */
|
|
34
|
+
reference?: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface McpTask {
|
|
37
|
+
uid: string;
|
|
38
|
+
status: McpTaskStatus;
|
|
39
|
+
statusMessage?: string | null;
|
|
40
|
+
tool: string;
|
|
41
|
+
notebookUid?: string | null;
|
|
42
|
+
cellId?: string | null;
|
|
43
|
+
sandboxUid?: string | null;
|
|
44
|
+
/** A Contents operation, when the task wraps one. */
|
|
45
|
+
operationUid?: string | null;
|
|
46
|
+
/** An attachment, when the task follows its lifecycle without an operation. */
|
|
47
|
+
attachmentUid?: string | null;
|
|
48
|
+
/** A Contents `mcp_approval` or an ai-agents tool approval. */
|
|
49
|
+
approvalUid?: string | null;
|
|
50
|
+
/** The session the task executes in; never empty for an execution task. */
|
|
51
|
+
sandboxBindingUid?: string | null;
|
|
52
|
+
initiatingUser: string;
|
|
53
|
+
initiatingClient?: string | null;
|
|
54
|
+
orgUid?: string | null;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
lastUpdatedAt: string;
|
|
57
|
+
ttlMs?: number | null;
|
|
58
|
+
pollIntervalMs?: number | null;
|
|
59
|
+
/** The `CallToolResult` for small results; a resource URI otherwise. */
|
|
60
|
+
result?: McpCallToolResult | string | null;
|
|
61
|
+
error?: string | null;
|
|
62
|
+
traceId?: string | null;
|
|
63
|
+
workflowEngine?: McpWorkflowEngine | null;
|
|
64
|
+
/** Always the task uid, so a retried start cannot create a second execution. */
|
|
65
|
+
workflowId?: string | null;
|
|
66
|
+
/** The Temporal run id; empty for DBOS. */
|
|
67
|
+
workflowRunId?: string | null;
|
|
68
|
+
queue?: string | null;
|
|
69
|
+
sandboxProvider?: string | null;
|
|
70
|
+
workerReplica?: string | null;
|
|
71
|
+
outputs?: McpTaskOutput[];
|
|
72
|
+
}
|
|
73
|
+
export interface McpTaskList {
|
|
74
|
+
items: McpTask[];
|
|
75
|
+
nextCursor?: string | null;
|
|
76
|
+
}
|
|
77
|
+
/** What `POST /tasks/{uid}/input` carries: the REST face of `tasks/update`. */
|
|
78
|
+
export interface McpTaskInput {
|
|
79
|
+
input: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
/** A `notifications/tasks` payload, as the SSE stream and the socket carry it. */
|
|
82
|
+
export interface McpTaskEvent {
|
|
83
|
+
/** `status`, `output`, `input_required`, `completed`, `failed`, `cancelled`. */
|
|
84
|
+
event: string;
|
|
85
|
+
taskId: string;
|
|
86
|
+
status?: McpTaskStatus;
|
|
87
|
+
statusMessage?: string | null;
|
|
88
|
+
output?: McpTaskOutput;
|
|
89
|
+
task?: McpTask;
|
|
90
|
+
at?: string;
|
|
91
|
+
}
|
|
92
|
+
/** The statuses from which nothing more happens. */
|
|
93
|
+
export declare const MCP_TERMINAL_TASK_STATUSES: ReadonlySet<McpTaskStatus>;
|
|
94
|
+
export declare const isMcpTaskTerminal: (status: McpTaskStatus) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/** The statuses from which nothing more happens. */
|
|
6
|
+
export const MCP_TERMINAL_TASK_STATUSES = new Set(['completed', 'failed', 'cancelled']);
|
|
7
|
+
export const isMcpTaskTerminal = (status) => MCP_TERMINAL_TASK_STATUSES.has(status);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who started a runtime: a person, one of their agents, or a service agent.
|
|
3
|
+
*
|
|
4
|
+
* The reservation has carried this since agents could make one — IAM writes
|
|
5
|
+
* `client_id_s` and `agent_uid_s` onto the usage record's metadata, and
|
|
6
|
+
* `useUsages` already hands the whole map to the views. Nothing displayed
|
|
7
|
+
* it, so a person looking at their running runtimes could not tell which of
|
|
8
|
+
* them they had started and which an agent had, on a platform whose premise
|
|
9
|
+
* is that agents start things on your behalf.
|
|
10
|
+
*
|
|
11
|
+
* The distinction that matters is **agent versus service agent**, not
|
|
12
|
+
* "automated versus not". A delegated agent runs as you, spends your
|
|
13
|
+
* credits, and stops when you disconnect it. A service agent is the
|
|
14
|
+
* organization's own principal with its own key: it keeps running when the
|
|
15
|
+
* person who set it up leaves, and it is the row somebody has to go and turn
|
|
16
|
+
* off. Told apart, one is "I did that yesterday" and the other is "who owns
|
|
17
|
+
* this".
|
|
18
|
+
*
|
|
19
|
+
* @module models/StartedBy
|
|
20
|
+
*/
|
|
21
|
+
/** The Solr field names IAM writes the dimensions on. */
|
|
22
|
+
export declare const CLIENT_ID_KEY = "client_id_s";
|
|
23
|
+
export declare const AGENT_UID_KEY = "agent_uid_s";
|
|
24
|
+
export type StartedByKind = 'person' | 'agent' | 'service-agent';
|
|
25
|
+
export interface StartedBy {
|
|
26
|
+
kind: StartedByKind;
|
|
27
|
+
/** What to show in a cell: a client id, an agent uid, or "You". */
|
|
28
|
+
label: string;
|
|
29
|
+
/** The MCP client it connected as, where there is one. */
|
|
30
|
+
clientId: string;
|
|
31
|
+
/** The service agent's uid, where it is one. */
|
|
32
|
+
agentUid: string;
|
|
33
|
+
}
|
|
34
|
+
/** Metadata as `useUsages` builds it, or as a plain object. */
|
|
35
|
+
export type UsageMetadata = Map<string, unknown> | Record<string, unknown> | null | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Who started this reservation.
|
|
38
|
+
*
|
|
39
|
+
* `agent_uid_s` decides before `client_id_s`, because a service agent
|
|
40
|
+
* reaching Runtimes through the MCP gateway carries **the gateway's** client
|
|
41
|
+
* id: read the other way round, every one of an organization's pipelines
|
|
42
|
+
* would show as the same agent.
|
|
43
|
+
*
|
|
44
|
+
* A record with neither dimension is a person's own work. It is *not* an
|
|
45
|
+
* agent whose name we failed to read, and saying "unknown" would suggest it
|
|
46
|
+
* was — so the answer is the reader themselves.
|
|
47
|
+
*/
|
|
48
|
+
export declare const startedBy: (metadata: UsageMetadata) => StartedBy;
|
|
49
|
+
/**
|
|
50
|
+
* The words a search box matches on for this row.
|
|
51
|
+
*
|
|
52
|
+
* "agent" matches every agent-started runtime, the client id matches one
|
|
53
|
+
* client, and "you" matches your own — so the filter the plan asks for is the
|
|
54
|
+
* search box that is already there rather than a second control beside it.
|
|
55
|
+
*/
|
|
56
|
+
export declare const startedBySearchTerms: (metadata: UsageMetadata) => string;
|
|
57
|
+
export default startedBy;
|