@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.
Files changed (496) hide show
  1. package/README.md +41 -18
  2. package/lib/api/DatalayerApi.d.ts +42 -1
  3. package/lib/api/DatalayerApi.js +90 -3
  4. package/lib/api/constants.d.ts +19 -1
  5. package/lib/api/constants.js +19 -1
  6. package/lib/api/contents/attachments.d.ts +9 -0
  7. package/lib/api/contents/attachments.js +39 -0
  8. package/lib/api/contents/bridges.d.ts +22 -0
  9. package/lib/api/contents/bridges.js +79 -0
  10. package/lib/api/contents/capabilities.d.ts +11 -0
  11. package/lib/api/contents/capabilities.js +21 -0
  12. package/lib/api/contents/cloudStorage.d.ts +31 -0
  13. package/lib/api/contents/cloudStorage.js +89 -0
  14. package/lib/api/contents/dataservers.d.ts +37 -0
  15. package/lib/api/contents/dataservers.js +121 -0
  16. package/lib/api/contents/datasets.d.ts +63 -0
  17. package/lib/api/contents/datasets.js +82 -0
  18. package/lib/api/contents/datasources.d.ts +70 -0
  19. package/lib/api/contents/datasources.js +149 -0
  20. package/lib/api/contents/generated.d.ts +1070 -0
  21. package/lib/api/contents/index.d.ts +16 -0
  22. package/lib/api/contents/index.js +20 -0
  23. package/lib/api/contents/mcp.d.ts +46 -0
  24. package/lib/api/contents/mcp.js +157 -0
  25. package/lib/api/contents/objects.d.ts +31 -0
  26. package/lib/api/contents/objects.js +88 -0
  27. package/lib/api/contents/operations.d.ts +3 -0
  28. package/lib/api/contents/operations.js +19 -0
  29. package/lib/api/contents/runtimeMounts.d.ts +40 -0
  30. package/lib/api/contents/runtimeMounts.js +59 -0
  31. package/lib/api/contents/sandboxUid.d.ts +21 -0
  32. package/lib/api/contents/sandboxUid.js +27 -0
  33. package/lib/api/contents/sources.d.ts +19 -0
  34. package/lib/api/contents/sources.js +119 -0
  35. package/lib/api/contents/sync.d.ts +18 -0
  36. package/lib/api/contents/sync.js +69 -0
  37. package/lib/api/contents/transfers.d.ts +38 -0
  38. package/lib/api/contents/transfers.js +123 -0
  39. package/lib/api/evals/client.d.ts +402 -0
  40. package/lib/api/evals/client.js +359 -0
  41. package/lib/api/evals/index.d.ts +10 -0
  42. package/lib/api/evals/index.js +18 -0
  43. package/lib/api/evals/request.d.ts +43 -0
  44. package/lib/api/evals/request.js +67 -0
  45. package/lib/api/evals/status.d.ts +27 -0
  46. package/lib/api/evals/status.js +122 -0
  47. package/lib/api/evals/types.d.ts +1335 -0
  48. package/lib/api/evals/types.js +5 -0
  49. package/lib/api/iam/connectedAgents.d.ts +68 -0
  50. package/lib/api/iam/connectedAgents.js +87 -0
  51. package/lib/api/iam/identityProviders.d.ts +76 -0
  52. package/lib/api/iam/identityProviders.js +187 -0
  53. package/lib/api/iam/index.d.ts +3 -1
  54. package/lib/api/iam/index.js +3 -1
  55. package/lib/api/iam/mcpAlertRules.d.ts +51 -0
  56. package/lib/api/iam/mcpAlertRules.js +198 -0
  57. package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
  58. package/lib/api/iam/mcpAuditSettings.js +120 -0
  59. package/lib/api/iam/mcpPolicy.d.ts +181 -0
  60. package/lib/api/iam/mcpPolicy.js +168 -0
  61. package/lib/api/iam/organizationTeams.d.ts +13 -0
  62. package/lib/api/iam/organizationTeams.js +43 -0
  63. package/lib/api/iam/profile.d.ts +17 -1
  64. package/lib/api/iam/profile.js +27 -0
  65. package/lib/api/iam/scimTokens.d.ts +79 -0
  66. package/lib/api/iam/scimTokens.js +141 -0
  67. package/lib/api/iam/secrets.js +9 -21
  68. package/lib/api/iam/serviceAgents.d.ts +68 -0
  69. package/lib/api/iam/serviceAgents.js +119 -0
  70. package/lib/api/iam/trials.d.ts +38 -0
  71. package/lib/api/iam/trials.js +66 -0
  72. package/lib/api/index.d.ts +8 -1
  73. package/lib/api/index.js +7 -1
  74. package/lib/api/mcp/activity.d.ts +37 -0
  75. package/lib/api/mcp/activity.js +26 -0
  76. package/lib/api/mcp/alerts.d.ts +25 -0
  77. package/lib/api/mcp/alerts.js +51 -0
  78. package/lib/api/mcp/audit.d.ts +29 -0
  79. package/lib/api/mcp/audit.js +55 -0
  80. package/lib/api/mcp/bindings.d.ts +18 -0
  81. package/lib/api/mcp/bindings.js +42 -0
  82. package/lib/api/mcp/forwarding.d.ts +25 -0
  83. package/lib/api/mcp/forwarding.js +46 -0
  84. package/lib/api/mcp/gateway.d.ts +16 -0
  85. package/lib/api/mcp/gateway.js +70 -0
  86. package/lib/api/mcp/generated.d.ts +22 -0
  87. package/lib/api/mcp/generated.js +213 -0
  88. package/lib/api/mcp/index.d.ts +17 -0
  89. package/lib/api/mcp/index.js +25 -0
  90. package/lib/api/mcp/observability.d.ts +141 -0
  91. package/lib/api/mcp/observability.js +267 -0
  92. package/lib/api/mcp/operations.d.ts +83 -0
  93. package/lib/api/mcp/operations.js +50 -0
  94. package/lib/api/mcp/organizations.d.ts +102 -0
  95. package/lib/api/mcp/organizations.js +46 -0
  96. package/lib/api/mcp/policy.d.ts +9 -0
  97. package/lib/api/mcp/policy.js +23 -0
  98. package/lib/api/mcp/tasks.d.ts +49 -0
  99. package/lib/api/mcp/tasks.js +147 -0
  100. package/lib/api/orchestration/client.d.ts +53 -0
  101. package/lib/api/orchestration/client.js +105 -0
  102. package/lib/api/orchestration/events.d.ts +88 -0
  103. package/lib/api/orchestration/events.js +245 -0
  104. package/lib/api/orchestration/generated.d.ts +693 -0
  105. package/lib/api/orchestration/generated.js +687 -0
  106. package/lib/api/orchestration/index.d.ts +30 -0
  107. package/lib/api/orchestration/index.js +34 -0
  108. package/lib/api/orchestration/lifecycle.d.ts +39 -0
  109. package/lib/api/orchestration/lifecycle.js +57 -0
  110. package/lib/api/orchestration/measures.d.ts +55 -0
  111. package/lib/api/orchestration/measures.js +99 -0
  112. package/lib/api/otel/dashboards.d.ts +56 -0
  113. package/lib/api/otel/dashboards.js +50 -0
  114. package/lib/api/otel/index.d.ts +1 -0
  115. package/lib/api/otel/index.js +1 -0
  116. package/lib/api/otel/metrics.d.ts +16 -0
  117. package/lib/api/otel/metrics.js +15 -0
  118. package/lib/api/scheduler/client.d.ts +32 -0
  119. package/lib/api/scheduler/client.js +42 -0
  120. package/lib/api/scheduler/index.d.ts +8 -0
  121. package/lib/api/scheduler/index.js +16 -0
  122. package/lib/api/scheduler/request.d.ts +28 -0
  123. package/lib/api/scheduler/request.js +50 -0
  124. package/lib/api/scheduler/types.d.ts +88 -0
  125. package/lib/api/scheduler/types.js +5 -0
  126. package/lib/api/spacer/comments.d.ts +97 -0
  127. package/lib/api/spacer/comments.js +45 -0
  128. package/lib/api/spacer/index.d.ts +9 -0
  129. package/lib/api/spacer/index.js +17 -0
  130. package/lib/api/spacer/notebooks.d.ts +33 -0
  131. package/lib/api/spacer/notebooks.js +39 -0
  132. package/lib/api/spacer/request.d.ts +25 -0
  133. package/lib/api/spacer/request.js +46 -0
  134. package/lib/api/spacer/spaces.d.ts +68 -0
  135. package/lib/api/spacer/spaces.js +45 -0
  136. package/lib/api/utils/validation.d.ts +4 -4
  137. package/lib/api/utils/validation.js +10 -7
  138. package/lib/client/auth/index.js +0 -5
  139. package/lib/client/auth/storage.js +0 -5
  140. package/lib/client/auth/strategies.js +0 -5
  141. package/lib/client/base.d.ts +6 -0
  142. package/lib/client/base.js +8 -0
  143. package/lib/client/constants.d.ts +1 -0
  144. package/lib/client/constants.js +1 -0
  145. package/lib/client/index.d.ts +0 -10
  146. package/lib/client/index.js +2 -2
  147. package/lib/client/mixins/ContentsMixin.d.ts +71 -0
  148. package/lib/client/mixins/ContentsMixin.js +157 -0
  149. package/lib/client/mixins/IAMMixin.d.ts +0 -31
  150. package/lib/client/mixins/IAMMixin.js +0 -58
  151. package/lib/components/animation/AnimatedText.d.ts +2 -44
  152. package/lib/components/animation/AnimatedText.js +6 -126
  153. package/lib/components/anonymous/AnonymousKeyExpired.d.ts +56 -0
  154. package/lib/components/anonymous/AnonymousKeyExpired.js +96 -0
  155. package/lib/components/anonymous/AnonymousKeyTimer.d.ts +63 -0
  156. package/lib/components/anonymous/AnonymousKeyTimer.js +140 -0
  157. package/lib/components/anonymous/index.d.ts +7 -0
  158. package/lib/components/anonymous/index.js +15 -0
  159. package/lib/components/auth/SigInAPIKey.d.ts +1 -0
  160. package/lib/components/auth/SigInAPIKey.js +0 -6
  161. package/lib/components/auth/SignIn.d.ts +1 -0
  162. package/lib/components/auth/SignIn.js +0 -4
  163. package/lib/components/auth/SignIn.stories.d.ts +2 -2
  164. package/lib/components/avatars/BoringAvatar.d.ts +1 -1
  165. package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
  166. package/lib/components/avatars/DLAvatar.d.ts +1 -1
  167. package/lib/components/avatars/DLAvatar.js +0 -4
  168. package/lib/components/avatars/UserAvatar.d.ts +16 -1
  169. package/lib/components/avatars/UserAvatar.js +15 -13
  170. package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
  171. package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
  172. package/lib/components/billing/BillingEntitySelect.d.ts +16 -0
  173. package/lib/components/billing/BillingEntitySelect.js +49 -27
  174. package/lib/components/billing/eligibility.d.ts +22 -0
  175. package/lib/components/billing/eligibility.js +27 -0
  176. package/lib/components/billing/index.d.ts +1 -0
  177. package/lib/components/billing/index.js +1 -4
  178. package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
  179. package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
  180. package/lib/components/buttons/LongActionButton.d.ts +1 -0
  181. package/lib/components/buttons/LongActionButton.js +0 -4
  182. package/lib/components/buttons/UploadButton.d.ts +1 -0
  183. package/lib/components/buttons/UploadButton.js +0 -4
  184. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  185. package/lib/components/collaboration/LiveEditorCollaborators.d.ts +36 -0
  186. package/lib/components/collaboration/LiveEditorCollaborators.js +88 -53
  187. package/lib/components/collaboration/index.js +0 -4
  188. package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
  189. package/lib/components/contents/ContentSourceCard.d.ts +8 -0
  190. package/lib/components/contents/ContentSourceCard.js +23 -0
  191. package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
  192. package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
  193. package/lib/components/contents/index.d.ts +2 -0
  194. package/lib/components/contents/index.js +6 -0
  195. package/lib/components/context/OrganizationSelect.d.ts +1 -1
  196. package/lib/components/display/AvatarSkeleton.d.ts +1 -1
  197. package/lib/components/display/BusyDots.d.ts +1 -1
  198. package/lib/components/display/CenteredSpinner.d.ts +1 -1
  199. package/lib/components/display/CodePreview.d.ts +1 -1
  200. package/lib/components/display/DatalayerBox.d.ts +7 -3
  201. package/lib/components/display/DatalayerBox.js +7 -7
  202. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  203. package/lib/components/display/JupyterDialog.d.ts +1 -0
  204. package/lib/components/display/JupyterDialog.js +1 -7
  205. package/lib/components/display/Markdown.d.ts +1 -0
  206. package/lib/components/display/NavLink.js +3 -2
  207. package/lib/components/display/NotebookSkeleton.d.ts +1 -1
  208. package/lib/components/display/Placeholder.d.ts +1 -1
  209. package/lib/components/display/ToTopBranded.d.ts +1 -1
  210. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  211. package/lib/components/flashes/FlashClosable.d.ts +1 -0
  212. package/lib/components/flashes/FlashClosable.js +0 -4
  213. package/lib/components/flashes/FlashGuest.d.ts +1 -1
  214. package/lib/components/flashes/FlashSurveys.d.ts +1 -1
  215. package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
  216. package/lib/components/flashes/FlashUnauthorized.js +0 -6
  217. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  218. package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
  219. package/lib/components/index.d.ts +2 -0
  220. package/lib/components/index.js +2 -0
  221. package/lib/components/labels/StatusLabels.d.ts +2 -9
  222. package/lib/components/labels/StatusLabels.js +2 -26
  223. package/lib/components/labels/VisibilityLabel.d.ts +1 -1
  224. package/lib/components/landings/StepBlock.d.ts +1 -1
  225. package/lib/components/mcp/ClientBadge.d.ts +41 -0
  226. package/lib/components/mcp/ClientBadge.js +33 -0
  227. package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
  228. package/lib/components/mcp/McpErrorBlankslate.js +17 -0
  229. package/lib/components/mcp/ScopeList.d.ts +28 -0
  230. package/lib/components/mcp/ScopeList.js +14 -0
  231. package/lib/components/mcp/index.d.ts +10 -0
  232. package/lib/components/mcp/index.js +18 -0
  233. package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
  234. package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
  235. package/lib/components/navbar/SubdomainNavBar.js +2 -1
  236. package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
  237. package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
  238. package/lib/components/principal/PrincipalAppearance.d.ts +22 -42
  239. package/lib/components/principal/PrincipalAppearance.js +232 -182
  240. package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
  241. package/lib/components/principal/PrincipalAvatar.js +18 -10
  242. package/lib/components/principal/PrincipalBadge.d.ts +1 -1
  243. package/lib/components/principal/PrincipalBanner.d.ts +1 -1
  244. package/lib/components/principal/PrincipalDetailsOverlay.d.ts +38 -1
  245. package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
  246. package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
  247. package/lib/components/principal/PrincipalHoverCard.js +52 -0
  248. package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
  249. package/lib/components/principal/PrincipalSwitcherMenu.js +5 -14
  250. package/lib/components/principal/index.d.ts +2 -1
  251. package/lib/components/principal/index.js +2 -1
  252. package/lib/components/progress/ConsumptionBar.d.ts +1 -0
  253. package/lib/components/progress/ConsumptionBar.js +0 -4
  254. package/lib/components/progress/ProgressRing.d.ts +1 -0
  255. package/lib/components/progress/SpinnerBar.d.ts +1 -1
  256. package/lib/components/progress/Timer.d.ts +1 -0
  257. package/lib/components/progress/Timer.js +0 -4
  258. package/lib/components/screencapture/Screencapture.js +46 -3
  259. package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
  260. package/lib/components/sharing/ShareAccessComponent.d.ts +58 -3
  261. package/lib/components/sharing/ShareAccessComponent.js +143 -98
  262. package/lib/components/sharing/SharingEditor.d.ts +21 -0
  263. package/lib/components/sharing/SharingEditor.js +9 -28
  264. package/lib/components/sharing/index.d.ts +1 -0
  265. package/lib/components/sharing/index.js +1 -0
  266. package/lib/components/sharing/sandboxSharing.d.ts +26 -0
  267. package/lib/components/sharing/sandboxSharing.js +41 -0
  268. package/lib/components/spaces/SpaceDetailsOverlay.d.ts +39 -0
  269. package/lib/components/spaces/SpaceDetailsOverlay.js +80 -0
  270. package/lib/components/spaces/SpaceDisplay.d.ts +38 -0
  271. package/lib/components/spaces/SpaceDisplay.js +92 -0
  272. package/lib/components/spaces/index.d.ts +4 -0
  273. package/lib/components/spaces/index.js +7 -0
  274. package/lib/components/spaces/spaceDisplayModel.d.ts +93 -0
  275. package/lib/components/spaces/spaceDisplayModel.js +170 -0
  276. package/lib/components/sparklines/Sparklines.js +3 -4
  277. package/lib/components/sparklines/index.js +0 -4
  278. package/lib/components/storage/ContentsBrowser.d.ts +25 -1
  279. package/lib/components/storage/ContentsBrowser.js +145 -52
  280. package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
  281. package/lib/components/storage/ContentsBrowserMock.js +75 -0
  282. package/lib/components/storage/ContentsItems.d.ts +2 -1
  283. package/lib/components/storage/ContentsItems.js +0 -4
  284. package/lib/components/storage/ContentsTable.d.ts +50 -0
  285. package/lib/components/storage/ContentsTable.js +134 -0
  286. package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
  287. package/lib/components/storage/HomeFolderDrive.js +248 -0
  288. package/lib/components/storage/index.d.ts +2 -0
  289. package/lib/components/storage/index.js +2 -0
  290. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  291. package/lib/components/students/StudentResultCircle.d.ts +1 -1
  292. package/lib/components/subnav/SubNav.d.ts +5 -5
  293. package/lib/components/subnav/SubNav.js +11 -9
  294. package/lib/components/tables/DataTable.d.ts +1 -1
  295. package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
  296. package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
  297. package/lib/components/time/LiveRelativeTime.d.ts +1 -0
  298. package/lib/components/time/LiveRelativeTime.js +0 -8
  299. package/lib/components/time/index.js +0 -4
  300. package/lib/components/timeline/Timeline.d.ts +1 -1
  301. package/lib/components/timeline/index.js +0 -4
  302. package/lib/components/users/PeerIndicator.d.ts +1 -0
  303. package/lib/components/users/PeerIndicator.js +0 -4
  304. package/lib/config/Configuration.d.ts +15 -17
  305. package/lib/config/Configuration.js +7 -0
  306. package/lib/hooks/cacheConverters.d.ts +0 -7
  307. package/lib/hooks/cacheConverters.js +0 -25
  308. package/lib/hooks/index.d.ts +3 -0
  309. package/lib/hooks/index.js +3 -0
  310. package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
  311. package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
  312. package/lib/hooks/useBackdrop.d.ts +1 -1
  313. package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
  314. package/lib/hooks/useBackdropJupyterLab.js +0 -4
  315. package/lib/hooks/useBillingEntityStore.js +3 -0
  316. package/lib/hooks/useCache.d.ts +478 -130
  317. package/lib/hooks/useCache.js +1580 -676
  318. package/lib/hooks/useContainsFocus.d.ts +1 -1
  319. package/lib/hooks/useContents.d.ts +334 -0
  320. package/lib/hooks/useContents.js +1033 -0
  321. package/lib/hooks/useFocusTrap.d.ts +4 -4
  322. package/lib/hooks/useFocusTrap.js +1 -1
  323. package/lib/hooks/useMcp.d.ts +315 -0
  324. package/lib/hooks/useMcp.js +891 -0
  325. package/lib/hooks/useMobile.js +0 -5
  326. package/lib/hooks/useNavigate.d.ts +41 -3
  327. package/lib/hooks/useNavigate.js +106 -52
  328. package/lib/hooks/usePrincipalCacheStore.js +3 -0
  329. package/lib/hooks/usePrincipalStore.js +3 -0
  330. package/lib/hooks/useProjectStore.d.ts +3 -3
  331. package/lib/hooks/useProjectStore.js +4 -4
  332. package/lib/hooks/useRef.d.ts +1 -1
  333. package/lib/hooks/useRef.js +3 -0
  334. package/lib/hooks/useScreencapture.d.ts +2 -1
  335. package/lib/hooks/useScreencapture.js +0 -4
  336. package/lib/hooks/useSpaceCacheStore.d.ts +50 -0
  337. package/lib/hooks/useSpaceCacheStore.js +85 -0
  338. package/lib/hooks/useToast.js +0 -4
  339. package/lib/hooks/useVisibilityObserver.d.ts +1 -1
  340. package/lib/index.d.ts +4 -1
  341. package/lib/index.js +3 -1
  342. package/lib/mocks/components/FlashMock.d.ts +1 -1
  343. package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
  344. package/lib/mocks/views/ChartMock.d.ts +1 -1
  345. package/lib/mocks/views/DashboardMock.d.ts +1 -1
  346. package/lib/mocks/views/FormMock.d.ts +1 -1
  347. package/lib/mocks/views/TableMock.d.ts +1 -1
  348. package/lib/mocks/views/WipMock.d.ts +1 -1
  349. package/lib/models/Credits.d.ts +16 -0
  350. package/lib/models/Credits.js +22 -0
  351. package/lib/models/CreditsDTO.d.ts +6 -5
  352. package/lib/models/CreditsDTO.js +7 -5
  353. package/lib/models/McpAuditEvent.d.ts +52 -0
  354. package/lib/models/McpAuditEvent.js +5 -0
  355. package/lib/models/McpBinding.d.ts +57 -0
  356. package/lib/models/McpBinding.js +5 -0
  357. package/lib/models/McpPolicy.d.ts +77 -0
  358. package/lib/models/McpPolicy.js +5 -0
  359. package/lib/models/McpTask.d.ts +94 -0
  360. package/lib/models/McpTask.js +7 -0
  361. package/lib/models/Organization.d.ts +69 -0
  362. package/lib/models/Organization.js +96 -0
  363. package/lib/models/Secret.d.ts +1 -2
  364. package/lib/models/Secret.js +2 -18
  365. package/lib/models/StartedBy.d.ts +91 -0
  366. package/lib/models/StartedBy.js +117 -0
  367. package/lib/models/Team.d.ts +2 -0
  368. package/lib/models/Team.js +2 -0
  369. package/lib/models/User.d.ts +4 -0
  370. package/lib/models/User.js +3 -0
  371. package/lib/models/UserDTO.js +4 -2
  372. package/lib/models/UserSettings.d.ts +13 -0
  373. package/lib/models/UserSettings.js +9 -0
  374. package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
  375. package/lib/models/contents/__fixtures__/v1-contracts.json +194 -0
  376. package/lib/models/contents/fieldCase.d.ts +8 -0
  377. package/lib/models/contents/fieldCase.js +37 -0
  378. package/lib/models/contents/index.d.ts +2 -0
  379. package/lib/models/contents/index.js +6 -0
  380. package/lib/models/contents/permissions.d.ts +16 -0
  381. package/lib/models/contents/permissions.js +34 -0
  382. package/lib/models/index.d.ts +5 -1
  383. package/lib/models/index.js +5 -1
  384. package/lib/navigation/components.js +2 -3
  385. package/lib/routes/publicPaths.js +4 -0
  386. package/lib/state/index.d.ts +1 -0
  387. package/lib/state/index.js +1 -0
  388. package/lib/state/sessionEnd.d.ts +55 -0
  389. package/lib/state/sessionEnd.js +162 -0
  390. package/lib/state/substates/CoreState.d.ts +15 -7
  391. package/lib/state/substates/CoreState.js +21 -17
  392. package/lib/state/substates/IAMState.d.ts +1 -1
  393. package/lib/state/substates/IAMState.js +12 -5
  394. package/lib/state/substates/LayoutState.js +12 -0
  395. package/lib/state/substates/ProfileState.d.ts +1 -0
  396. package/lib/state/substates/ProfileState.js +1 -4
  397. package/lib/state/substates/index.d.ts +0 -1
  398. package/lib/state/substates/index.js +0 -1
  399. package/lib/utils/Jwt.d.ts +26 -0
  400. package/lib/utils/Jwt.js +37 -0
  401. package/lib/utils/Lazy.d.ts +20 -0
  402. package/lib/utils/Lazy.js +32 -6
  403. package/lib/utils/Screencapture.js +3 -0
  404. package/lib/utils/WithSuspense.d.ts +11 -1
  405. package/lib/utils/WithSuspense.js +11 -1
  406. package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
  407. package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
  408. package/lib/views/api-keys/APIKeys.d.ts +1 -1
  409. package/lib/views/api-keys/APIKeys.js +30 -4
  410. package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
  411. package/lib/views/api-keys/APIKeysStandalone.js +2 -2
  412. package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
  413. package/lib/views/datasources/DatasourceDetail.js +80 -110
  414. package/lib/views/datasources/DatasourceNew.d.ts +14 -8
  415. package/lib/views/datasources/DatasourceNew.js +129 -118
  416. package/lib/views/datasources/Datasources.d.ts +39 -7
  417. package/lib/views/datasources/Datasources.js +95 -40
  418. package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
  419. package/lib/views/datasources/DatasourcesMock.js +57 -0
  420. package/lib/views/iam/SignInSimple.d.ts +12 -0
  421. package/lib/views/iam/SignInSimple.js +4 -4
  422. package/lib/views/index.d.ts +1 -0
  423. package/lib/views/index.js +1 -0
  424. package/lib/views/mcp/AdmittedClients.d.ts +44 -0
  425. package/lib/views/mcp/AdmittedClients.js +59 -0
  426. package/lib/views/mcp/AlertDestinations.d.ts +34 -0
  427. package/lib/views/mcp/AlertDestinations.js +75 -0
  428. package/lib/views/mcp/AlertRules.d.ts +32 -0
  429. package/lib/views/mcp/AlertRules.js +245 -0
  430. package/lib/views/mcp/ApprovalQueue.d.ts +66 -0
  431. package/lib/views/mcp/ApprovalQueue.js +95 -0
  432. package/lib/views/mcp/AuditLog.d.ts +42 -0
  433. package/lib/views/mcp/AuditLog.js +144 -0
  434. package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
  435. package/lib/views/mcp/ConnectedAgents.js +135 -0
  436. package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
  437. package/lib/views/mcp/EnterpriseConsole.js +195 -0
  438. package/lib/views/mcp/IdentityProviders.d.ts +33 -0
  439. package/lib/views/mcp/IdentityProviders.js +299 -0
  440. package/lib/views/mcp/McpDashboard.d.ts +50 -0
  441. package/lib/views/mcp/McpDashboard.js +430 -0
  442. package/lib/views/mcp/McpHome.d.ts +92 -0
  443. package/lib/views/mcp/McpHome.js +153 -0
  444. package/lib/views/mcp/McpObservability.d.ts +79 -0
  445. package/lib/views/mcp/McpObservability.js +236 -0
  446. package/lib/views/mcp/NotebookRuns.d.ts +39 -0
  447. package/lib/views/mcp/NotebookRuns.js +44 -0
  448. package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
  449. package/lib/views/mcp/OrganizationPolicy.js +108 -0
  450. package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
  451. package/lib/views/mcp/OrganizationUsage.js +113 -0
  452. package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
  453. package/lib/views/mcp/PersonalPolicy.js +126 -0
  454. package/lib/views/mcp/Policies.d.ts +53 -0
  455. package/lib/views/mcp/Policies.js +210 -0
  456. package/lib/views/mcp/PolicyForm.d.ts +83 -0
  457. package/lib/views/mcp/PolicyForm.js +113 -0
  458. package/lib/views/mcp/PolicyHistory.d.ts +58 -0
  459. package/lib/views/mcp/PolicyHistory.js +75 -0
  460. package/lib/views/mcp/RunDetail.d.ts +87 -0
  461. package/lib/views/mcp/RunDetail.js +186 -0
  462. package/lib/views/mcp/ScimProvisioning.d.ts +54 -0
  463. package/lib/views/mcp/ScimProvisioning.js +173 -0
  464. package/lib/views/mcp/ServiceAgents.d.ts +46 -0
  465. package/lib/views/mcp/ServiceAgents.js +194 -0
  466. package/lib/views/mcp/TeamPolicies.d.ts +33 -0
  467. package/lib/views/mcp/TeamPolicies.js +159 -0
  468. package/lib/views/mcp/ToolAccess.d.ts +60 -0
  469. package/lib/views/mcp/ToolAccess.js +101 -0
  470. package/lib/views/mcp/TraceTimeline.d.ts +81 -0
  471. package/lib/views/mcp/TraceTimeline.js +132 -0
  472. package/lib/views/mcp/format.d.ts +25 -0
  473. package/lib/views/mcp/format.js +77 -0
  474. package/lib/views/mcp/index.d.ts +34 -0
  475. package/lib/views/mcp/index.js +42 -0
  476. package/lib/views/mcp/types.d.ts +66 -0
  477. package/lib/views/mcp/types.js +5 -0
  478. package/lib/views/otel/simpleAuthStore.js +3 -0
  479. package/lib/views/secrets/SecretEdit.d.ts +5 -1
  480. package/lib/views/secrets/SecretEdit.js +5 -4
  481. package/lib/views/secrets/SecretNew.d.ts +11 -1
  482. package/lib/views/secrets/SecretNew.js +7 -3
  483. package/lib/views/secrets/Secrets.d.ts +12 -1
  484. package/lib/views/secrets/Secrets.js +2 -2
  485. package/package.json +269 -260
  486. package/scripts/generate-contents-types.py +169 -0
  487. package/scripts/generate-mcp-types.py +233 -0
  488. package/scripts/generate-orchestration-types.py +920 -0
  489. package/lib/api/iam/datasources.d.ts +0 -86
  490. package/lib/api/iam/datasources.js +0 -185
  491. package/lib/components/toolbars/index.d.ts +0 -1
  492. package/lib/models/Datasource.d.ts +0 -181
  493. package/lib/models/Datasource.js +0 -154
  494. package/lib/state/substates/DatasourceState.d.ts +0 -11
  495. package/lib/state/substates/DatasourceState.js +0 -16
  496. /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
@@ -0,0 +1,267 @@
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 observability of the Jupyter MCP Server, read from the Datalayer OTEL
11
+ * service — never from the gateway, which adds no telemetry route.
12
+ *
13
+ * Audit answers *who did what, and was it allowed*; this answers *how did
14
+ * it run*. A task carries its `trace_id`, so "show me this run" is the
15
+ * task's spans; its logs are the log records of that trace; and the four
16
+ * SLIs are read from the OTEL service's service levels dashboard, which
17
+ * computes them from the metrics as they were exported — a counter's
18
+ * increase, a percentile from a histogram's buckets. Nothing here adds
19
+ * metric points up: the gateway reports running totals, and adding those
20
+ * counts every earlier report again. Metrics carry no user, agent or
21
+ * organization label by design, so a per-agent reading is computed from the
22
+ * `mcp.request` spans, which do carry `client.id` and `org.uid`.
23
+ *
24
+ * @module api/mcp/observability
25
+ */
26
+ import { DEFAULT_SERVICE_URLS } from '../constants.js';
27
+ import { getTrace, listTraces } from '../otel/traces.js';
28
+ import { listMetricNames } from '../otel/metrics.js';
29
+ import { queryLogs } from '../otel/logs.js';
30
+ import { getDashboardData } from '../otel/dashboards.js';
31
+ /**
32
+ * The `service.name` the gateway exports under, and the one its workers use.
33
+ *
34
+ * The bare service name, like every other Datalayer service (`contents`,
35
+ * `iam`, `runtimes`): `instrument(app, name)` is what sets it. A worker is a
36
+ * process of its own and is filed separately, so a worker's last lines stay
37
+ * queryable after the process is gone.
38
+ */
39
+ export const MCP_GATEWAY_SERVICE_NAME = 'jupyter-mcp-server';
40
+ /** The `service.name` a worker's relayed output is filed under. */
41
+ export const MCP_WORKER_SERVICE_NAME = 'jupyter-mcp-worker';
42
+ /**
43
+ * The `service.name` the durable execution service exports under.
44
+ *
45
+ * The `durable.*` metrics come from there, not from the gateway. Querying
46
+ * them against the gateway would be well formed, would be answered
47
+ * truthfully with nothing, and would render a legitimate-looking zero — the
48
+ * same failure that had three panels querying `mcp.forwarded` and
49
+ * `mcp.sandbox_lost`. `serviceNameFor` exists so the question is answered
50
+ * once rather than at each call site.
51
+ */
52
+ export const MCP_DURABLE_SERVICE_NAME = 'datalayer-durable';
53
+ /**
54
+ * Which service emits a metric.
55
+ *
56
+ * A metric's service is a property of the metric, not of the caller. Reading
57
+ * it from here is what keeps a new panel from inheriting whichever constant
58
+ * happened to be in scope where it was written.
59
+ */
60
+ export const serviceNameFor = (metric) => metric.startsWith('durable.')
61
+ ? MCP_DURABLE_SERVICE_NAME
62
+ : MCP_GATEWAY_SERVICE_NAME;
63
+ /** The metric catalog `telemetry.py` owns; no ad-hoc counters. */
64
+ export const MCP_METRIC_CATALOG = [
65
+ 'mcp.calls',
66
+ 'mcp.call.duration',
67
+ 'mcp.refusals',
68
+ // A limit *not* applied because the figure it compares against could not
69
+ // be read. Distinct from a refusal, which is the limit working: an
70
+ // organization whose budget stopped being enforced otherwise looks exactly
71
+ // like one that never set a budget.
72
+ 'mcp.limit.unenforced',
73
+ 'mcp.forwards',
74
+ 'mcp.workers',
75
+ 'mcp.worker_start_seconds',
76
+ 'mcp.bindings',
77
+ 'mcp.sandbox.lost',
78
+ 'mcp.tasks',
79
+ 'mcp.task.duration',
80
+ 'durable.step.duration',
81
+ 'durable.queue.wait',
82
+ 'durable.recoveries',
83
+ 'sandbox.launch_seconds',
84
+ 'mcp.audit.writes',
85
+ 'mcp.audit.write_failures',
86
+ 'mcp.dependency.duration',
87
+ 'mcp.dependency.timeouts',
88
+ 'mcp.dependency.ready',
89
+ 'mcp.readiness.failures',
90
+ 'mcp.audit.deleted',
91
+ 'mcp.jobs',
92
+ 'mcp.job.duration',
93
+ ];
94
+ /** The four SLIs, and the catalog metric each is read from. */
95
+ export const MCP_SLI_METRICS = {
96
+ availability: 'mcp.calls',
97
+ latency: 'mcp.call.duration',
98
+ taskSuccess: 'mcp.tasks',
99
+ sandboxLaunch: 'sandbox.launch_seconds',
100
+ };
101
+ /** The OTEL service's built-in dashboard the four SLIs are read from. */
102
+ export const MCP_SERVICE_LEVELS_DASHBOARD = 'mcp-service-levels';
103
+ /**
104
+ * Its panels, by the ids the OTEL service gives them. A contract test there
105
+ * holds them, so a panel renamed on the service fails a test rather than
106
+ * reading here as nothing measured.
107
+ */
108
+ export const MCP_SERVICE_LEVEL_PANELS = {
109
+ callsByOutcome: 'mcp-calls-by-outcome',
110
+ callDurationP95: 'mcp-call-duration-p95',
111
+ tasksByStatus: 'mcp-tasks-by-status',
112
+ sandboxLaunchP95: 'sandbox-launch_seconds-by-provider-p95',
113
+ sandboxLaunches: 'sandbox-launch_seconds-by-provider-count',
114
+ };
115
+ const TERMINAL_STATUSES = ['completed', 'failed', 'cancelled'];
116
+ /** The nearest-rank percentile of a sample; `null` for an empty one. */
117
+ export const percentile = (values, fraction) => {
118
+ if (values.length === 0) {
119
+ return null;
120
+ }
121
+ const sorted = [...values].sort((a, b) => a - b);
122
+ const rank = Math.min(sorted.length - 1, Math.max(0, Math.ceil(fraction * sorted.length) - 1));
123
+ return sorted[rank];
124
+ };
125
+ const attribute = (holder, name) => String(holder.attributes?.[name] ?? '');
126
+ const notBefore = (timestamp, since) => !since || !timestamp || timestamp >= since;
127
+ /** Whether an `mcp.request` span is a failed call in the availability sense. */
128
+ const isUnavailable = (span) => {
129
+ const status = attribute(span, 'http.response.status_code') || attribute(span, 'http.status_code');
130
+ const rpc = attribute(span, 'rpc.jsonrpc.error_code') || attribute(span, 'mcp.error.code');
131
+ return status.startsWith('5') || rpc === '-32001';
132
+ };
133
+ /**
134
+ * The SLIs from the service levels dashboard — the platform-wide reading.
135
+ *
136
+ * Its panels arrive summarised: calls and tasks as how much each counter grew
137
+ * over the window, the two p95s from their histograms' buckets. The call
138
+ * duration is recorded in seconds and shown in milliseconds. A panel with
139
+ * nothing in it reads as not measured, never as a zero.
140
+ */
141
+ export const summarizeServiceLevels = (data) => {
142
+ const panels = new Map(data.panels.map(panel => [panel.id, panel]));
143
+ const byLabel = (id) => Object.fromEntries((panels.get(id)?.series ?? [])
144
+ .filter(entry => entry.summary !== null)
145
+ .map(entry => [entry.label, entry.summary]));
146
+ const total = (values) => Object.values(values).reduce((sum, value) => sum + value, 0);
147
+ const calls = byLabel(MCP_SERVICE_LEVEL_PANELS.callsByOutcome);
148
+ const totalCalls = total(calls);
149
+ const failedCalls = (calls.error ?? 0) + (calls.unavailable ?? 0);
150
+ const tasks = byLabel(MCP_SERVICE_LEVEL_PANELS.tasksByStatus);
151
+ const terminal = TERMINAL_STATUSES.reduce((sum, status) => sum + (tasks[status] ?? 0), 0);
152
+ const p95Seconds = byLabel(MCP_SERVICE_LEVEL_PANELS.callDurationP95)[''];
153
+ const p95SandboxLaunchSeconds = Object.fromEntries(Object.entries(byLabel(MCP_SERVICE_LEVEL_PANELS.sandboxLaunchP95)).map(([provider, seconds]) => [
154
+ provider || 'unknown',
155
+ seconds,
156
+ ]));
157
+ return {
158
+ availability: totalCalls > 0 ? (totalCalls - failedCalls) / totalCalls : null,
159
+ p95CallDurationMs: p95Seconds === undefined ? null : p95Seconds * 1000,
160
+ taskSuccessRate: terminal > 0 ? (tasks.completed ?? 0) / terminal : null,
161
+ p95SandboxLaunchSeconds,
162
+ samples: {
163
+ calls: totalCalls,
164
+ tasks: terminal,
165
+ launches: total(byLabel(MCP_SERVICE_LEVEL_PANELS.sandboxLaunches)),
166
+ },
167
+ };
168
+ };
169
+ /**
170
+ * The SLIs over `mcp.request` spans — the per-agent or per-organization
171
+ * reading, since metrics carry neither label.
172
+ */
173
+ export const summarizeRequestSpans = (spans, filters = {}) => {
174
+ const selected = spans.filter(span => span.span_name === 'mcp.request' &&
175
+ notBefore(span.start_time, filters.since) &&
176
+ (!filters.agent || attribute(span, 'client.id') === filters.agent) &&
177
+ (!filters.org || attribute(span, 'org.uid') === filters.org));
178
+ const unavailable = selected.filter(isUnavailable).length;
179
+ const tasks = new Map();
180
+ for (const span of selected) {
181
+ const taskId = attribute(span, 'mcp.task.id');
182
+ if (taskId) {
183
+ tasks.set(taskId, attribute(span, 'mcp.task.status') || span.status_code || '');
184
+ }
185
+ }
186
+ const terminal = [...tasks.values()].filter(status => ['completed', 'failed', 'cancelled'].includes(status));
187
+ const completed = terminal.filter(status => status === 'completed').length;
188
+ return {
189
+ availability: selected.length > 0 ? (selected.length - unavailable) / selected.length : null,
190
+ p95CallDurationMs: percentile(selected.filter(span => !attribute(span, 'mcp.task.id')).map(span => span.duration_ms), 0.95),
191
+ taskSuccessRate: terminal.length > 0 ? completed / terminal.length : null,
192
+ p95SandboxLaunchSeconds: {},
193
+ samples: { calls: selected.length, tasks: terminal.length, launches: 0 },
194
+ };
195
+ };
196
+ /** The four SLIs and the catalog, for everyone or for one agent or organization. */
197
+ export const fetchMcpMetrics = async (token, filters = {}, otelUrl = DEFAULT_SERVICE_URLS.OTEL) => {
198
+ const limit = filters.limit ?? 500;
199
+ const scoped = Boolean(filters.agent || filters.org);
200
+ const [levels, names, traces] = await Promise.all([
201
+ scoped
202
+ ? undefined
203
+ : getDashboardData(token, MCP_SERVICE_LEVELS_DASHBOARD, { since: filters.since ? new Date(filters.since) : undefined }, otelUrl),
204
+ listMetricNames(token, otelUrl),
205
+ scoped ? listTraces(token, { serviceName: MCP_GATEWAY_SERVICE_NAME, limit }, otelUrl) : undefined,
206
+ ]);
207
+ const reported = new Set((names.data ?? []).map(row => row.metric_name));
208
+ const spans = traces?.data ?? [];
209
+ return {
210
+ filters,
211
+ reporting: MCP_METRIC_CATALOG.filter(name => reported.has(name)),
212
+ spans,
213
+ slis: levels ? summarizeServiceLevels(levels) : summarizeRequestSpans(spans, filters),
214
+ readAt: new Date().toISOString(),
215
+ };
216
+ };
217
+ /** The spans of a trace as a tree, roots first, siblings by start time. */
218
+ export const spanTree = (spans) => {
219
+ const nodes = new Map();
220
+ for (const span of spans) {
221
+ nodes.set(span.span_id, { span, children: [] });
222
+ }
223
+ const roots = [];
224
+ for (const node of nodes.values()) {
225
+ const parent = node.span.parent_span_id ? nodes.get(node.span.parent_span_id) : undefined;
226
+ (parent ? parent.children : roots).push(node);
227
+ }
228
+ const byStart = (a, b) => a.span.start_time.localeCompare(b.span.start_time);
229
+ const sort = (list) => {
230
+ list.sort(byStart);
231
+ list.forEach(node => sort(node.children));
232
+ };
233
+ sort(roots);
234
+ return roots;
235
+ };
236
+ /** "Show me this run": the spans of the task's trace. A task without one has none yet. */
237
+ export const fetchRunTrace = async (token, task, otelUrl = DEFAULT_SERVICE_URLS.OTEL) => {
238
+ if (!task.traceId) {
239
+ return { taskUid: task.uid, traceId: '', spans: [], tree: [] };
240
+ }
241
+ const trace = await getTrace(token, task.traceId, otelUrl);
242
+ const spans = trace.data ?? [];
243
+ return { taskUid: task.uid, traceId: task.traceId, spans, tree: spanTree(spans) };
244
+ };
245
+ /**
246
+ * The spans of one trace, named directly.
247
+ *
248
+ * A synchronous call has no task — it finished inside its own request — but
249
+ * it does carry a trace, which is what the audit row records and what
250
+ * "show me this call" means before durable execution exists.
251
+ */
252
+ export const fetchTraceSpans = async (token, traceId, otelUrl = DEFAULT_SERVICE_URLS.OTEL) => {
253
+ if (!traceId) {
254
+ return { taskUid: '', traceId: '', spans: [], tree: [] };
255
+ }
256
+ const trace = await getTrace(token, traceId, otelUrl);
257
+ const spans = trace.data ?? [];
258
+ return { taskUid: '', traceId, spans, tree: spanTree(spans) };
259
+ };
260
+ /** The log lines of a run, gateway and worker alike, by the trace they carry. */
261
+ export const fetchMcpLogs = async (token, task, options = {}, otelUrl = DEFAULT_SERVICE_URLS.OTEL) => {
262
+ if (!task.traceId) {
263
+ return { taskUid: task.uid, traceId: '', records: [] };
264
+ }
265
+ const page = await queryLogs(token, { traceId: task.traceId, limit: options.limit ?? 200, severity: options.severity }, otelUrl);
266
+ return { taskUid: task.uid, traceId: task.traceId, records: page.data ?? [] };
267
+ };
@@ -0,0 +1,83 @@
1
+ export interface McpGatewayVersion {
2
+ version: string;
3
+ /** The MCP resource this gateway serves; what a token's `aud` must name. */
4
+ resource: string;
5
+ }
6
+ export interface McpGatewayHealth {
7
+ status: string;
8
+ version: string;
9
+ }
10
+ export type McpWorkerState = 'starting' | 'running' | 'idle' | 'draining' | 'stopped';
11
+ /** One worker process of the directory, keyed by user and by sandbox binding. */
12
+ export interface McpWorker {
13
+ uid: string;
14
+ userUid: string;
15
+ /** The `sb_…` binding whose sandbox this worker holds, when it holds one. */
16
+ sandboxBindingUid?: string | null;
17
+ replica: string;
18
+ state: McpWorkerState;
19
+ /** Tasks in `working`; a worker with one is never reaped. */
20
+ workingTasks: number;
21
+ startedAt: string;
22
+ lastUsedAt?: string | null;
23
+ version?: string | null;
24
+ }
25
+ export interface McpWorkerList {
26
+ items: McpWorker[];
27
+ /** The replica that answered. */
28
+ replica?: string;
29
+ }
30
+ export interface McpWorkflowQueue {
31
+ name: string;
32
+ backlog: number;
33
+ /** Seconds the oldest waiting workflow has waited. */
34
+ oldestWaitSeconds?: number | null;
35
+ }
36
+ /** One periodic job on the replica that answered. */
37
+ export interface McpJob {
38
+ job: string;
39
+ /** Ticks this replica actually ran. */
40
+ ran: number;
41
+ /**
42
+ * Ticks this replica skipped because another held the lease. The ordinary
43
+ * outcome on every replica but one — read it per replica, never summed.
44
+ * Rising on *all* of them at once is the lease store refusing everybody.
45
+ */
46
+ skipped: number;
47
+ failed: number;
48
+ lastRanAt?: number | null;
49
+ lastError?: string;
50
+ lastDurationSeconds?: number;
51
+ healthy: boolean;
52
+ }
53
+ export interface McpJobSchedule {
54
+ /** Whether this replica's scheduler loops are running. */
55
+ running: boolean;
56
+ /** The replica that answered; the counts below are only about it. */
57
+ holder: string;
58
+ jobs: McpJob[];
59
+ }
60
+ /** Engine health, queue backlog and worker versions. */
61
+ export interface McpWorkflowsHealth {
62
+ engine: 'temporal' | 'dbos' | string;
63
+ healthy: boolean;
64
+ detail?: string | null;
65
+ queues: McpWorkflowQueue[];
66
+ workerVersions: Record<string, number>;
67
+ checkedAt: string;
68
+ }
69
+ export declare const getGatewayVersion: (baseUrl?: string) => Promise<McpGatewayVersion>;
70
+ export declare const getGatewayHealth: (baseUrl?: string) => Promise<McpGatewayHealth>;
71
+ /** The worker directory across replicas; platform administrators only. */
72
+ export declare const listWorkers: (token: string, baseUrl?: string) => Promise<McpWorkerList>;
73
+ export declare const getWorkflowsHealth: (token: string, baseUrl?: string) => Promise<McpWorkflowsHealth>;
74
+ /**
75
+ * The periodic work on the replica that answers, and what it has done.
76
+ *
77
+ * Per replica by construction: only one replica holds each job's lease at a
78
+ * time, so `ran` on one and `skipped` on the others is the scheduler working.
79
+ * A caller that wants the platform's view has to ask every replica — there is
80
+ * no aggregate here, because an aggregate would hide the case worth seeing,
81
+ * which is every replica skipping at once.
82
+ */
83
+ export declare const getJobSchedule: (token: string, baseUrl?: string) => Promise<McpJobSchedule>;
@@ -0,0 +1,50 @@
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 gateway seen by a platform administrator: its version and liveness,
11
+ * the worker directory, the engine's health. No raw history, no secrets.
12
+ *
13
+ * @module api/mcp/operations
14
+ */
15
+ import { requestDatalayerAPI } from '../DatalayerApi.js';
16
+ import { DEFAULT_SERVICE_URLS } from '../constants.js';
17
+ import { fromWire, mcpServiceUrl, mcpUrl } from './gateway.js';
18
+ export const getGatewayVersion = async (baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => requestDatalayerAPI({
19
+ url: mcpServiceUrl(baseUrl, '/version'),
20
+ method: 'GET',
21
+ });
22
+ export const getGatewayHealth = async (baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => requestDatalayerAPI({
23
+ url: mcpServiceUrl(baseUrl, '/healthz'),
24
+ method: 'GET',
25
+ });
26
+ /** The worker directory across replicas; platform administrators only. */
27
+ export const listWorkers = async (token, baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => fromWire(await requestDatalayerAPI({
28
+ url: mcpUrl(baseUrl, '/operations/workers'),
29
+ method: 'GET',
30
+ token,
31
+ }));
32
+ export const getWorkflowsHealth = async (token, baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => fromWire(await requestDatalayerAPI({
33
+ url: mcpUrl(baseUrl, '/operations/workflows'),
34
+ method: 'GET',
35
+ token,
36
+ }));
37
+ /**
38
+ * The periodic work on the replica that answers, and what it has done.
39
+ *
40
+ * Per replica by construction: only one replica holds each job's lease at a
41
+ * time, so `ran` on one and `skipped` on the others is the scheduler working.
42
+ * A caller that wants the platform's view has to ask every replica — there is
43
+ * no aggregate here, because an aggregate would hide the case worth seeing,
44
+ * which is every replica skipping at once.
45
+ */
46
+ export const getJobSchedule = async (token, baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => fromWire(await requestDatalayerAPI({
47
+ url: mcpUrl(baseUrl, '/operations/jobs'),
48
+ method: 'GET',
49
+ token,
50
+ }));
@@ -0,0 +1,102 @@
1
+ /** One line of the compliance strip: green, or naming what is missing. */
2
+ export interface McpComplianceCheck {
3
+ /** The rule's name, e.g. `sso_required`, `admitted_clients_only`. */
4
+ name: string;
5
+ ok: boolean;
6
+ /** What is missing, when it is not `ok`. */
7
+ detail?: string | null;
8
+ }
9
+ /** How many principals act through MCP for the organization. */
10
+ export interface McpOverviewAgents {
11
+ delegated: number;
12
+ service: number;
13
+ activeToday: number;
14
+ }
15
+ export interface McpOverviewRuns {
16
+ today: number;
17
+ succeeded: number;
18
+ failed: number;
19
+ /** `completed` over terminal tasks; `null` when nothing ran. */
20
+ successRate?: number | null;
21
+ }
22
+ /** Milestone 3 fills the quota; until then only what was spent is known. */
23
+ export interface McpOverviewSpend {
24
+ creditsToday: number;
25
+ creditsMonth: number;
26
+ quotaMonth?: number | null;
27
+ }
28
+ export interface McpRefusalCount {
29
+ reason: string;
30
+ count: number;
31
+ }
32
+ export interface McpOrganizationOverview {
33
+ orgUid: string;
34
+ teamUid?: string | null;
35
+ /** The moment the answer was assembled. */
36
+ at: string;
37
+ agents: McpOverviewAgents;
38
+ runs: McpOverviewRuns;
39
+ spend?: McpOverviewSpend | null;
40
+ refusals: McpRefusalCount[];
41
+ approvalsWaiting?: number | null;
42
+ alertsFiring?: number | null;
43
+ compliance: McpComplianceCheck[];
44
+ }
45
+ export interface McpOrganizationOverviewFilters {
46
+ /** One team of the organization, rather than all of them. */
47
+ team?: string;
48
+ }
49
+ export declare const getOrganizationMcpOverview: (token: string, orgUid: string, filters?: McpOrganizationOverviewFilters, baseUrl?: string) => Promise<McpOrganizationOverview>;
50
+ /** One quota: what may be used, what is, and the share of the two.
51
+ *
52
+ * `used` is `null` where the figure could not be read, with `unknown` saying
53
+ * why. Absent and unreadable look identical in a dashboard — no number
54
+ * beside a heading — and mean opposite things: one is "no limit set", the
55
+ * other is "we cannot tell you what your limit is".
56
+ */
57
+ export interface McpQuota {
58
+ limit?: number | null;
59
+ used?: number | null;
60
+ /** `used / limit`, computed by the gateway so a page and an alert cannot
61
+ * divide differently. */
62
+ fraction?: number | null;
63
+ /** Why the figure could not be read. Present only when it could not. */
64
+ unknown?: string;
65
+ }
66
+ /** What one agent spent of the day's credits. */
67
+ export interface McpAgentSpend {
68
+ /** The MCP client it connected as, e.g. `claude`. Empty for a service
69
+ * agent reaching Runtimes through the gateway. */
70
+ clientId: string;
71
+ /** The service agent's uid, where it is one. */
72
+ agentUid: string;
73
+ credits: number;
74
+ /** Usage records behind the figure. */
75
+ records: number;
76
+ }
77
+ export interface McpOrganizationUsage {
78
+ orgUid: string;
79
+ teamUid?: string | null;
80
+ window: {
81
+ seconds: number;
82
+ };
83
+ quotas: {
84
+ creditsPerDay?: McpQuota;
85
+ concurrentSandboxes?: McpQuota;
86
+ callsPerMinute?: McpQuota;
87
+ };
88
+ /** Which agents the day's credits went to, biggest spender first. Empty
89
+ * where the total could not be read — the parts under an unreadable whole
90
+ * make every agent look cheap. */
91
+ byAgent: McpAgentSpend[];
92
+ /** Where a limit is changed, which is not here. */
93
+ setAt: string;
94
+ }
95
+ /**
96
+ * One organization's use against its quotas, and who spent it.
97
+ *
98
+ * Never throws for a figure it could not read: this is a page somebody opens
99
+ * when something is wrong, and the half of it that works is worth more than
100
+ * an error saying one number was unavailable.
101
+ */
102
+ export declare const getOrganizationMcpUsage: (token: string, orgUid: string, filters?: McpOrganizationOverviewFilters, baseUrl?: string) => Promise<McpOrganizationUsage>;
@@ -0,0 +1,46 @@
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
+ * What an administrator sees first: the organization's MCP overview.
11
+ *
12
+ * One answer for the Enterprise console's Overview page — the agents that
13
+ * acted today, the runs and their success rate, the refusals by reason, the
14
+ * approvals waiting and the compliance strip over what IAM knows. Spend,
15
+ * quota and alerts join the same answer in milestone 3; a field the gateway
16
+ * does not fill yet is absent rather than zero, so the page can say "not
17
+ * measured yet" instead of "none".
18
+ *
19
+ * `?team=` narrows every part of it to one team.
20
+ *
21
+ * @module api/mcp/organizations
22
+ */
23
+ import { requestDatalayerAPI } from '../DatalayerApi.js';
24
+ import { DEFAULT_SERVICE_URLS } from '../constants.js';
25
+ import { fromWire, mcpUrl } from './gateway.js';
26
+ export const getOrganizationMcpOverview = async (token, orgUid, filters = {}, baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => fromWire(await requestDatalayerAPI({
27
+ url: mcpUrl(baseUrl, `/organizations/${encodeURIComponent(orgUid)}/overview`, {
28
+ team: filters.team,
29
+ }),
30
+ method: 'GET',
31
+ token,
32
+ }));
33
+ /**
34
+ * One organization's use against its quotas, and who spent it.
35
+ *
36
+ * Never throws for a figure it could not read: this is a page somebody opens
37
+ * when something is wrong, and the half of it that works is worth more than
38
+ * an error saying one number was unavailable.
39
+ */
40
+ export const getOrganizationMcpUsage = async (token, orgUid, filters = {}, baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => fromWire(await requestDatalayerAPI({
41
+ url: mcpUrl(baseUrl, `/organizations/${encodeURIComponent(orgUid)}/usage`, {
42
+ team: filters.team,
43
+ }),
44
+ method: 'GET',
45
+ token,
46
+ }));
@@ -0,0 +1,9 @@
1
+ import type { McpEffectivePolicy } from '../../models/McpPolicy';
2
+ export type { McpApprovalPolicy, McpEffectivePolicy, McpOrganizationPolicy, McpPersonalPolicy, McpPolicyLayer, McpPolicyRule, McpPolicyScope, McpToolRule, } from '../../models/McpPolicy';
3
+ export interface McpPolicyFilters {
4
+ /** Preview as: the `client_id` of an agent. */
5
+ agent?: string;
6
+ org?: string;
7
+ team?: string;
8
+ }
9
+ export declare const getEffectivePolicy: (token: string, filters?: McpPolicyFilters, baseUrl?: string) => Promise<McpEffectivePolicy>;
@@ -0,0 +1,23 @@
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 effective policy for the caller's token, redacted, each rule naming
11
+ * the layer that decided it. `?agent=` previews the policy as one agent
12
+ * would see it.
13
+ *
14
+ * @module api/mcp/policy
15
+ */
16
+ import { requestDatalayerAPI } from '../DatalayerApi.js';
17
+ import { DEFAULT_SERVICE_URLS } from '../constants.js';
18
+ import { fromWire, mcpUrl } from './gateway.js';
19
+ export const getEffectivePolicy = async (token, filters = {}, baseUrl = DEFAULT_SERVICE_URLS.JUPYTER_MCP_SERVER) => fromWire(await requestDatalayerAPI({
20
+ url: mcpUrl(baseUrl, '/policy', { ...filters }),
21
+ method: 'GET',
22
+ token,
23
+ }));
@@ -0,0 +1,49 @@
1
+ import type { McpTask, McpTaskEvent, McpTaskInput, McpTaskList, McpTaskStatus } from '../../models/McpTask';
2
+ export { MCP_TERMINAL_TASK_STATUSES, isMcpTaskTerminal, } from '../../models/McpTask';
3
+ export type { McpCallToolResult, McpTask, McpTaskEvent, McpTaskInput, McpTaskList, McpTaskOutput, McpTaskStatus, McpWorkflowEngine, } from '../../models/McpTask';
4
+ export interface McpTaskListFilters {
5
+ notebook?: string;
6
+ sandbox?: string;
7
+ /** The `client_id` of the agent, or a service agent's uid. */
8
+ agent?: string;
9
+ status?: McpTaskStatus;
10
+ /** An owner's view of an organization. */
11
+ org?: string;
12
+ cursor?: string;
13
+ limit?: number;
14
+ }
15
+ /** The caller's tasks, newest first; an owner narrows to an organization. */
16
+ export declare const listTasks: (token: string, filters?: McpTaskListFilters, baseUrl?: string) => Promise<McpTaskList>;
17
+ export declare const getTask: (token: string, taskUid: string, baseUrl?: string) => Promise<McpTask>;
18
+ /** Stop a task that is still going. Idempotent: a finished task is answered as it is. */
19
+ export declare const cancelTask: (token: string, taskUid: string, baseUrl?: string) => Promise<McpTask>;
20
+ /**
21
+ * Answer a task that is `input_required`.
22
+ *
23
+ * The input is the tool's own and goes over as typed; only the envelope is
24
+ * converted. The idempotency key makes a retried answer one answer.
25
+ */
26
+ export declare const answerTask: (token: string, taskUid: string, request: McpTaskInput, idempotencyKey: string, baseUrl?: string) => Promise<McpTask>;
27
+ /** The tasks of one notebook; empty until milestone 2 fills it. */
28
+ export declare const listNotebookTasks: (token: string, notebookUid: string, filters?: Pick<McpTaskListFilters, "status" | "cursor" | "limit">, baseUrl?: string) => Promise<McpTaskList>;
29
+ /** Where a task's server-sent events are. */
30
+ export declare const taskEventsUrl: (taskUid: string, baseUrl?: string) => string;
31
+ export interface McpTaskEventHandlers {
32
+ onEvent: (event: McpTaskEvent) => void;
33
+ onError?: (error: Error) => void;
34
+ /** The stream ended: the task reached a terminal status or the server closed. */
35
+ onClose?: () => void;
36
+ }
37
+ /**
38
+ * One SSE frame as the gateway writes it: `event:` then `data:` lines, a
39
+ * blank line between frames.
40
+ */
41
+ export declare const parseTaskEventFrame: (frame: string) => McpTaskEvent | undefined;
42
+ /**
43
+ * Subscribe to a task's events.
44
+ *
45
+ * `EventSource` cannot carry a bearer token, so this reads the stream with
46
+ * `fetch`. The returned function closes the subscription; the stream also
47
+ * ends by itself when the task is terminal.
48
+ */
49
+ export declare const subscribeTaskEvents: (token: string, taskUid: string, handlers: McpTaskEventHandlers, baseUrl?: string) => (() => void);