@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
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  ## Overview
20
20
 
21
- Datalayer Core is the foundational package that powers the [Datalayer AI Platform](https://datalayer.ai). It provides a TypesScript and Python packages as a Command Line Interface (CLI) for AI engineers, data scientists, and researchers to seamlessly integrate scalable compute runtimes into their workflows.
21
+ Datalayer Core is the foundational package that powers the [Datalayer AI Platform](https://datalayer.app/). It provides a TypesScript and Python packages as a Command Line Interface (CLI) for AI engineers, data scientists, and researchers to seamlessly integrate scalable compute runtimes into their workflows.
22
22
 
23
23
  This package serves as the base foundation used by many other Datalayer packages, containing core application classes, configuration, and unified APIs for authentication, runtime management, and code execution in cloud-based environments.
24
24
 
@@ -66,6 +66,8 @@ npm install
66
66
 
67
67
  ## Quick Start with Python
68
68
 
69
+ ### 1. Authentication
70
+
69
71
  Set your Datalayer token as an environment variable:
70
72
 
71
73
  ```bash
@@ -87,19 +89,31 @@ if client.authenticate():
87
89
  print("Successfully authenticated!")
88
90
  ```
89
91
 
90
- ## Architecture
92
+ ### 2. Runtime, Snapshots, and Evals
91
93
 
92
- Datalayer Core serves as the foundation for the entire Datalayer ecosystem:
94
+ Runtime execution, snapshot workflows, and evals CLI are now documented and maintained in:
93
95
 
94
- - **Base Classes**: Core application classes inherited by other Datalayer packages
95
- - **Configuration Management**: Centralized configuration system for all Datalayer components
96
- - **Authentication Layer**: Unified authentication across all Datalayer services
97
- - **Runtime Abstraction**: Common interface for different types of compute runtimes
98
- - **Resource Management**: Automatic cleanup and lifecycle management
96
+ - [agent-runtimes README](https://github.com/datalayer/agent-runtimes/blob/main/README.md)
97
+ - [agent-runtimes CLI docs](https://agent-runtimes.datalayer.tech/cli)
98
+
99
+ Use `agent-runtimes` for runtime workloads (`RuntimeClient`, `@datalayer`, snapshots, and evals), and use `datalayer-core` for account/platform operations (authentication, secrets, API keys, usage, profile).
99
100
 
100
101
  ## Examples
101
102
 
102
- - [OTEL example README](./examples/otel/README.md)
103
+ Examples have moved to Agent Runtimes:
104
+
105
+ - [Agent Runtimes examples README](https://github.com/datalayer/agent-runtimes/blob/main/examples/README.md)
106
+ - [Agent Runtimes examples directory](https://github.com/datalayer/agent-runtimes/tree/main/examples)
107
+
108
+ ## Platform Integration
109
+
110
+ Datalayer adds AI capabilities and scalable compute runtimes to your development workflows. The platform is designed to seamlessly integrate into your existing processes and supercharge your computations with the processing power you need.
111
+
112
+ Key platform features accessible through this Client and CLI:
113
+
114
+ - **Remote Runtimes**: Execute code on powerful remote machines with CPU, RAM, and GPU resources
115
+ - **Multiple Interfaces**: Access and consume runtimes through Python Client, CLI, or other integrated tools
116
+ - **Scalable Compute**: Dynamically scale your computational resources based on workload requirements
103
117
 
104
118
  ## Documentation
105
119
 
@@ -179,6 +193,16 @@ This Client is designed to be simple and extensible. We welcome contributions! P
179
193
 
180
194
  For issues and enhancement requests, please use the [GitHub issue tracker](https://github.com/datalayer/core/issues).
181
195
 
196
+ ## Architecture
197
+
198
+ Datalayer Core serves as the foundation for the entire Datalayer ecosystem:
199
+
200
+ - **Base Classes**: Core application classes inherited by other Datalayer packages
201
+ - **Configuration Management**: Centralized configuration system for all Datalayer components
202
+ - **Authentication Layer**: Unified authentication across all Datalayer services
203
+ - **Runtime Abstraction**: Common interface for different types of compute runtimes
204
+ - **Resource Management**: Automatic cleanup and lifecycle management
205
+
182
206
  ## Use Cases
183
207
 
184
208
  - **AI/ML Development**: Scale your machine learning workflows with cloud compute using Client or CLI
@@ -195,16 +219,15 @@ This project is licensed under the [BSD 3-Clause License](https://github.com/dat
195
219
 
196
220
  - **Documentation**: [Datalayer Platform Documentation](https://datalayer.ai/docs/)
197
221
  - **Issues**: [GitHub Issues](https://github.com/datalayer/core/issues)
198
- - **Community**: [Datalayer Platform](https://datalayer.ai)
222
+ - **Community**: [Datalayer Platform](https://datalayer.app/)
199
223
 
200
224
  ---
201
225
 
202
- <div align="center">
203
-
204
- **If this project is helpful to you, please give us a ⭐️**
205
-
206
- Made with ❤️ by [Datalayer](https://datalayer.ai)
207
-
208
- <img src="https://assets.datalayer.tech/datalayer-25.svg" alt="Datalayer Logo" width="200"></img>
226
+ <p align="center">
227
+ <img src="https://assets.datalayer.tech/datalayer-25.svg" alt="Datalayer Logo" width="200"></img>
228
+ </p>
209
229
 
210
- </div>
230
+ <p align="center">
231
+ <strong>🚀 AI Agents for Data Analysis</strong><br></br>
232
+ <a href="https://datalayer.app/">Get started with Datalayer today!</a>
233
+ </p>
@@ -1,3 +1,4 @@
1
+ import { AxiosRequestConfig } from 'axios';
1
2
  /**
2
3
  * Error wrapper for failed HTTP responses.
3
4
  * Includes response details, warnings, errors, and tracebacks.
@@ -53,6 +54,37 @@ export declare class NetworkError extends TypeError {
53
54
  */
54
55
  constructor(original: TypeError);
55
56
  }
57
+ /**
58
+ * Thrown when a request is made with a JWT that has already expired.
59
+ *
60
+ * Raised in place of the `RunResponseError` a 401 would otherwise produce,
61
+ * and only when the token we sent says it has expired. That distinction is
62
+ * the point of the class: a 401 can mean a dozen things — a revoked token, a
63
+ * wrong audience, a permission the account never had — and none of them are
64
+ * fixed by the same action. An expired token has exactly one remedy, and a
65
+ * caller that can recognise it can offer that remedy instead of an error.
66
+ *
67
+ * Callers are expected to catch this by name:
68
+ *
69
+ * ```typescript
70
+ * try {
71
+ * await requestDatalayerAPI({ url, token });
72
+ * } catch (error) {
73
+ * if (error instanceof TokenExpiredError) {
74
+ * showSignIn();
75
+ * return;
76
+ * }
77
+ * throw error;
78
+ * }
79
+ * ```
80
+ */
81
+ export declare class TokenExpiredError extends Error {
82
+ /** When the token expired, in milliseconds since the epoch. */
83
+ readonly expiredAt: number;
84
+ /** The URL the request was going to, for context in logs. */
85
+ readonly url: string;
86
+ constructor(url: string, expiredAt: number);
87
+ }
56
88
  /**
57
89
  * Options for Datalayer API requests.
58
90
  */
@@ -69,6 +101,14 @@ export interface IRequestDatalayerAPIOptions {
69
101
  token?: string;
70
102
  /** AbortSignal for request cancellation */
71
103
  signal?: AbortSignal;
104
+ /** Axios response representation for binary or streaming transports. */
105
+ responseType?: AxiosRequestConfig['responseType'];
106
+ }
107
+ export interface IDatalayerAPIResponse<T> {
108
+ data: T;
109
+ status: number;
110
+ statusText: string;
111
+ headers: Record<string, string>;
72
112
  }
73
113
  /**
74
114
  * Makes authenticated HTTP requests to Datalayer APIs.
@@ -88,4 +128,5 @@ export interface IRequestDatalayerAPIOptions {
88
128
  * });
89
129
  * ```
90
130
  */
91
- export declare function requestDatalayerAPI<T = any>({ url, method, body, token, signal, headers, }: IRequestDatalayerAPIOptions): Promise<T>;
131
+ export declare function requestDatalayerAPIWithResponse<T = any>({ url, method, body, token, signal, responseType, headers, }: IRequestDatalayerAPIOptions): Promise<IDatalayerAPIResponse<T>>;
132
+ export declare function requestDatalayerAPI<T = any>(options: IRequestDatalayerAPIOptions): Promise<T>;
@@ -11,6 +11,7 @@
11
11
  import { URLExt } from '@jupyterlab/coreutils';
12
12
  import axios from 'axios';
13
13
  import { sleep } from '../utils/Sleep.js';
14
+ import { getJwtExpiryMs, isJwtExpired } from '../utils/Jwt.js';
14
15
  function isFormDataBody(body) {
15
16
  if (!body || typeof body !== 'object') {
16
17
  return false;
@@ -119,6 +120,75 @@ export class NetworkError extends TypeError {
119
120
  this.stack = original.stack;
120
121
  }
121
122
  }
123
+ /**
124
+ * Thrown when a request is made with a JWT that has already expired.
125
+ *
126
+ * Raised in place of the `RunResponseError` a 401 would otherwise produce,
127
+ * and only when the token we sent says it has expired. That distinction is
128
+ * the point of the class: a 401 can mean a dozen things — a revoked token, a
129
+ * wrong audience, a permission the account never had — and none of them are
130
+ * fixed by the same action. An expired token has exactly one remedy, and a
131
+ * caller that can recognise it can offer that remedy instead of an error.
132
+ *
133
+ * Callers are expected to catch this by name:
134
+ *
135
+ * ```typescript
136
+ * try {
137
+ * await requestDatalayerAPI({ url, token });
138
+ * } catch (error) {
139
+ * if (error instanceof TokenExpiredError) {
140
+ * showSignIn();
141
+ * return;
142
+ * }
143
+ * throw error;
144
+ * }
145
+ * ```
146
+ */
147
+ export class TokenExpiredError extends Error {
148
+ /** When the token expired, in milliseconds since the epoch. */
149
+ expiredAt;
150
+ /** The URL the request was going to, for context in logs. */
151
+ url;
152
+ constructor(url, expiredAt) {
153
+ super(`The Datalayer token expired at ${new Date(expiredAt).toISOString()}; ` +
154
+ `not sending the request to ${url}.`);
155
+ // `name` rather than only the prototype, because a bundler that downlevels
156
+ // this class can break `instanceof` across package boundaries and a name
157
+ // check is the fallback every caller can still make.
158
+ this.name = 'TokenExpiredError';
159
+ this.expiredAt = expiredAt;
160
+ this.url = url;
161
+ // Restores the prototype chain when compiled down to ES5, without which
162
+ // `instanceof TokenExpiredError` is false — see TypeScript #13965.
163
+ Object.setPrototypeOf(this, TokenExpiredError.prototype);
164
+ }
165
+ }
166
+ /**
167
+ * Turn a 401 into a `TokenExpiredError` when the token is the reason for it.
168
+ *
169
+ * After the fact rather than before it. Checking the token up front would
170
+ * have meant deciding, at the door, which endpoints require one — and plenty
171
+ * here accept anonymous callers, so a pre-flight refusal would reject
172
+ * requests that were going to succeed. The server is the only thing that
173
+ * knows whether a given endpoint wanted credentials, and a 401 is it saying
174
+ * so.
175
+ *
176
+ * Asked only on a 401, and only when we actually hold a token that says it
177
+ * has expired. Every other 401 — a revoked token, a wrong audience, a
178
+ * permission the account never had, an anonymous call to a protected route —
179
+ * stays a `RunResponseError`, because those are not fixed by signing in
180
+ * again and should not be dressed up as though they were.
181
+ *
182
+ * Reading `exp` after the response has come back is also the more reliable
183
+ * moment: time has only moved forward, so a token the server judged expired
184
+ * reads as expired here too, with no clock-skew allowance to tune.
185
+ */
186
+ function throwIfTokenExpired(status, token, url) {
187
+ if (status !== 401 || !token || !isJwtExpired(token)) {
188
+ return;
189
+ }
190
+ throw new TokenExpiredError(url, getJwtExpiryMs(token) ?? Date.now());
191
+ }
122
192
  /**
123
193
  * Makes authenticated HTTP requests to Datalayer APIs.
124
194
  * Handles JSON and FormData, includes auth headers, and manages redirects.
@@ -137,7 +207,7 @@ export class NetworkError extends TypeError {
137
207
  * });
138
208
  * ```
139
209
  */
140
- export async function requestDatalayerAPI({ url, method, body, token, signal, headers = {}, }) {
210
+ export async function requestDatalayerAPIWithResponse({ url, method, body, token, signal, responseType, headers = {}, }) {
141
211
  // Handle FormData differently from JSON
142
212
  const isFormData = isFormDataBody(body);
143
213
  // Prepare axios config
@@ -147,6 +217,7 @@ export async function requestDatalayerAPI({ url, method, body, token, signal, he
147
217
  headers: { ...headers },
148
218
  withCredentials: true, // equivalent to credentials: 'include'
149
219
  signal,
220
+ responseType,
150
221
  // CORS mode is handled automatically by axios
151
222
  // Cache control headers
152
223
  };
@@ -191,10 +262,17 @@ export async function requestDatalayerAPI({ url, method, body, token, signal, he
191
262
  if (response.status < 300) {
192
263
  // Handle redirections if needed.
193
264
  if (response.status === 202 && response.headers.location) {
194
- return await handleAxiosRedirection(response, axiosConfig);
265
+ const data = await handleAxiosRedirection(response, axiosConfig);
266
+ return {
267
+ data: data,
268
+ status: response.status,
269
+ statusText: response.statusText,
270
+ headers: { ...response.headers },
271
+ };
195
272
  }
196
273
  }
197
274
  else {
275
+ throwIfTokenExpired(response.status, token, url);
198
276
  const adaptedResponse = {
199
277
  ok: false,
200
278
  status: response.status,
@@ -204,11 +282,17 @@ export async function requestDatalayerAPI({ url, method, body, token, signal, he
204
282
  };
205
283
  throw await RunResponseError.create(adaptedResponse);
206
284
  }
207
- return response.data;
285
+ return {
286
+ data: response.data,
287
+ status: response.status,
288
+ statusText: response.statusText,
289
+ headers: { ...response.headers },
290
+ };
208
291
  }
209
292
  catch (error) {
210
293
  if (axios.isAxiosError(error)) {
211
294
  if (error.response) {
295
+ throwIfTokenExpired(error.response.status, token, url);
212
296
  // Convert axios error to our RunResponseError format
213
297
  const adaptedResponse = {
214
298
  ok: false,
@@ -224,6 +308,9 @@ export async function requestDatalayerAPI({ url, method, body, token, signal, he
224
308
  throw error;
225
309
  }
226
310
  }
311
+ export async function requestDatalayerAPI(options) {
312
+ return (await requestDatalayerAPIWithResponse(options)).data;
313
+ }
227
314
  async function handleAxiosRedirection(response, originalConfig) {
228
315
  let redirect = response.headers.location;
229
316
  if (redirect) {
@@ -3,7 +3,9 @@
3
3
  */
4
4
  export declare const API_BASE_PATHS: {
5
5
  readonly AI_AGENTS: "/api/ai-agents/v1";
6
+ readonly CONTENTS: "/api/contents/v1";
6
7
  readonly IAM: "/api/iam/v1";
8
+ readonly MCP: "/api/mcp/v1";
7
9
  readonly OTEL: "/api/otel/v1";
8
10
  readonly RUNTIMES: "/api/runtimes/v1";
9
11
  readonly SCHEDULER: "/api/scheduler/v1";
@@ -14,9 +16,25 @@ export declare const API_BASE_PATHS: {
14
16
  */
15
17
  export declare const DEFAULT_SERVICE_URLS: {
16
18
  /** Default URL for AI Agents (durable agent management) service */
17
- readonly AI_AGENTS: "https://prod1.datalayer.run";
19
+ readonly AI_AGENTS: "https://r1.datalayer.run";
20
+ /**
21
+ * Default URL for the Contents service.
22
+ *
23
+ * The same host as RUNTIMES: Contents runs on the runtimes plane, where the NFS that backs the Home Folder and Volumes lives,
24
+ * so the service sits beside the storage it serves rather than a network
25
+ * away from it.
26
+ */
27
+ readonly CONTENTS: "https://r1.datalayer.run";
18
28
  /** Default URL for IAM (Identity and Access Management) service */
19
29
  readonly IAM: "https://prod1.datalayer.run";
30
+ /**
31
+ * Default URL of the Jupyter MCP Server, the hosted MCP endpoint.
32
+ *
33
+ * This is the MCP resource itself — the URL an agent connects to and the
34
+ * audience a token names — so it ends in `/mcp`. The gateway's REST
35
+ * routes (`/api/mcp/v1/...`) live on the same host, one path segment up.
36
+ */
37
+ readonly JUPYTER_MCP_SERVER: "https://mcp.datalayer.run/mcp";
20
38
  /** Default URL for OTEL (OpenTelemetry observability) service */
21
39
  readonly OTEL: "https://prod1.datalayer.run";
22
40
  /** Default URL for Runtimes service */
@@ -7,7 +7,9 @@
7
7
  */
8
8
  export const API_BASE_PATHS = {
9
9
  AI_AGENTS: '/api/ai-agents/v1',
10
+ CONTENTS: '/api/contents/v1',
10
11
  IAM: '/api/iam/v1',
12
+ MCP: '/api/mcp/v1',
11
13
  OTEL: '/api/otel/v1',
12
14
  RUNTIMES: '/api/runtimes/v1',
13
15
  SCHEDULER: '/api/scheduler/v1',
@@ -18,9 +20,25 @@ export const API_BASE_PATHS = {
18
20
  */
19
21
  export const DEFAULT_SERVICE_URLS = {
20
22
  /** Default URL for AI Agents (durable agent management) service */
21
- AI_AGENTS: 'https://prod1.datalayer.run',
23
+ AI_AGENTS: 'https://r1.datalayer.run',
24
+ /**
25
+ * Default URL for the Contents service.
26
+ *
27
+ * The same host as RUNTIMES: Contents runs on the runtimes plane, where the NFS that backs the Home Folder and Volumes lives,
28
+ * so the service sits beside the storage it serves rather than a network
29
+ * away from it.
30
+ */
31
+ CONTENTS: 'https://r1.datalayer.run',
22
32
  /** Default URL for IAM (Identity and Access Management) service */
23
33
  IAM: 'https://prod1.datalayer.run',
34
+ /**
35
+ * Default URL of the Jupyter MCP Server, the hosted MCP endpoint.
36
+ *
37
+ * This is the MCP resource itself — the URL an agent connects to and the
38
+ * audience a token names — so it ends in `/mcp`. The gateway's REST
39
+ * routes (`/api/mcp/v1/...`) live on the same host, one path segment up.
40
+ */
41
+ JUPYTER_MCP_SERVER: 'https://mcp.datalayer.run/mcp',
24
42
  /** Default URL for OTEL (OpenTelemetry observability) service */
25
43
  OTEL: 'https://prod1.datalayer.run',
26
44
  /** Default URL for Runtimes service */
@@ -0,0 +1,9 @@
1
+ import type { AttachmentCreate, AttachmentList, ContentAttachment, ContentAttachmentManifest } from './generated';
2
+ export declare const createAttachment: (token: string, request: AttachmentCreate, idempotencyKey: string, baseUrl?: string) => Promise<ContentAttachment>;
3
+ export declare const listAttachments: (token: string, options?: {
4
+ sandboxUid?: string;
5
+ sourceUid?: string;
6
+ active?: boolean;
7
+ }, baseUrl?: string) => Promise<AttachmentList>;
8
+ export declare const getAttachmentManifest: (token: string, sandboxUid: string, baseUrl?: string) => Promise<ContentAttachmentManifest>;
9
+ export declare const revokeAttachment: (token: string, attachmentUid: string, baseUrl?: string) => Promise<ContentAttachment>;
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ import { requestDatalayerAPI } from '../DatalayerApi.js';
6
+ import { API_BASE_PATHS, DEFAULT_SERVICE_URLS } from '../constants.js';
7
+ import { contentsToCamelCase, contentsToSnakeCase, } from '../../models/contents/index.js';
8
+ const convert = (value) => contentsToCamelCase(value);
9
+ const url = (baseUrl, suffix = '') => `${baseUrl}${API_BASE_PATHS.CONTENTS}/attachments${suffix}`;
10
+ export const createAttachment = async (token, request, idempotencyKey, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
11
+ url: url(baseUrl),
12
+ method: 'POST',
13
+ token,
14
+ headers: { 'Idempotency-Key': idempotencyKey },
15
+ body: contentsToSnakeCase(request),
16
+ }));
17
+ export const listAttachments = async (token, options = {}, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => {
18
+ const parameters = new URLSearchParams();
19
+ if (options.sandboxUid)
20
+ parameters.set('sandbox_uid', options.sandboxUid);
21
+ if (options.sourceUid)
22
+ parameters.set('source_uid', options.sourceUid);
23
+ parameters.set('active', String(options.active ?? false));
24
+ return convert(await requestDatalayerAPI({
25
+ url: `${url(baseUrl)}?${parameters.toString()}`,
26
+ method: 'GET',
27
+ token,
28
+ }));
29
+ };
30
+ export const getAttachmentManifest = async (token, sandboxUid, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
31
+ url: url(baseUrl, `/manifest/${encodeURIComponent(sandboxUid)}`),
32
+ method: 'GET',
33
+ token,
34
+ }));
35
+ export const revokeAttachment = async (token, attachmentUid, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
36
+ url: url(baseUrl, `/${encodeURIComponent(attachmentUid)}`),
37
+ method: 'DELETE',
38
+ token,
39
+ }));
@@ -0,0 +1,22 @@
1
+ import type { BridgeCreate, BridgeHeartbeat, BridgeList, BridgeOpened, BridgeSession } from './generated';
2
+ export type BridgeState = BridgeSession['state'];
3
+ /** The states a bridge does not leave on its own; polling stops on them. */
4
+ export declare const ENDED_BRIDGE_STATES: ReadonlySet<BridgeState>;
5
+ export declare const isBridgeEnded: (bridge: Pick<BridgeSession, "state">) => boolean;
6
+ /** Open the session of a `local-bridge` attachment, or find it open. */
7
+ export declare const openBridge: (token: string, attachmentUid: string, request: BridgeCreate, baseUrl?: string) => Promise<BridgeOpened>;
8
+ /**
9
+ * The live session of one attachment, or `null` when none has been opened:
10
+ * an attachment asked for and not yet dialled has no session, which is an
11
+ * answer rather than a failure.
12
+ */
13
+ export declare const getBridgeSession: (token: string, attachmentUid: string, baseUrl?: string) => Promise<BridgeSession | null>;
14
+ /** The caller's sessions, newest first; `active` leaves out the ended ones. */
15
+ export declare const listBridges: (token: string, options?: {
16
+ active?: boolean;
17
+ }, baseUrl?: string) => Promise<BridgeList>;
18
+ export declare const getBridge: (token: string, bridgeUid: string, baseUrl?: string) => Promise<BridgeSession>;
19
+ /** Still here: the session stays alive and the answer carries a fresh client token. */
20
+ export declare const heartbeatBridge: (token: string, bridgeUid: string, baseUrl?: string) => Promise<BridgeHeartbeat>;
21
+ /** End a session: its tokens stop working before the sandbox side unmounts. */
22
+ export declare const revokeBridge: (token: string, bridgeUid: string, baseUrl?: string) => Promise<BridgeSession>;
@@ -0,0 +1,79 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * The bridge session behind a `local-bridge` attachment.
7
+ *
8
+ * A session is what the attachment holds while a person's computer serves a
9
+ * folder to the sandbox through the relay. A browser never serves one — the
10
+ * CLI does — so what it does here is look: the session of an attachment,
11
+ * the caller's sessions, and the one thing it may do to them, revoke.
12
+ * Opening and heartbeating are here for completeness and for a desktop
13
+ * client that embeds this library; a page has no folder to bind.
14
+ */
15
+ import { RunResponseError, requestDatalayerAPI } from '../DatalayerApi.js';
16
+ import { API_BASE_PATHS, DEFAULT_SERVICE_URLS } from '../constants.js';
17
+ import { contentsToCamelCase, contentsToSnakeCase } from '../../models/contents/index.js';
18
+ /** The states a bridge does not leave on its own; polling stops on them. */
19
+ export const ENDED_BRIDGE_STATES = new Set([
20
+ 'revoked',
21
+ 'expired',
22
+ ]);
23
+ export const isBridgeEnded = (bridge) => ENDED_BRIDGE_STATES.has(bridge.state);
24
+ const convert = (value) => contentsToCamelCase(value);
25
+ const contentsUrl = (baseUrl, suffix) => `${baseUrl}${API_BASE_PATHS.CONTENTS}${suffix}`;
26
+ /** Open the session of a `local-bridge` attachment, or find it open. */
27
+ export const openBridge = async (token, attachmentUid, request, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
28
+ url: contentsUrl(baseUrl, `/attachments/${encodeURIComponent(attachmentUid)}/bridge`),
29
+ method: 'POST',
30
+ token,
31
+ body: contentsToSnakeCase(request),
32
+ }));
33
+ /**
34
+ * The live session of one attachment, or `null` when none has been opened:
35
+ * an attachment asked for and not yet dialled has no session, which is an
36
+ * answer rather than a failure.
37
+ */
38
+ export const getBridgeSession = async (token, attachmentUid, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => {
39
+ try {
40
+ return convert(await requestDatalayerAPI({
41
+ url: contentsUrl(baseUrl, `/attachments/${encodeURIComponent(attachmentUid)}/bridge`),
42
+ method: 'GET',
43
+ token,
44
+ }));
45
+ }
46
+ catch (error) {
47
+ if (error instanceof RunResponseError && error.response.status === 404) {
48
+ return null;
49
+ }
50
+ throw error;
51
+ }
52
+ };
53
+ /** The caller's sessions, newest first; `active` leaves out the ended ones. */
54
+ export const listBridges = async (token, options = {}, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => {
55
+ const parameters = new URLSearchParams();
56
+ parameters.set('active', String(options.active ?? false));
57
+ return convert(await requestDatalayerAPI({
58
+ url: `${contentsUrl(baseUrl, '/bridges')}?${parameters.toString()}`,
59
+ method: 'GET',
60
+ token,
61
+ }));
62
+ };
63
+ export const getBridge = async (token, bridgeUid, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
64
+ url: contentsUrl(baseUrl, `/bridges/${encodeURIComponent(bridgeUid)}`),
65
+ method: 'GET',
66
+ token,
67
+ }));
68
+ /** Still here: the session stays alive and the answer carries a fresh client token. */
69
+ export const heartbeatBridge = async (token, bridgeUid, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
70
+ url: contentsUrl(baseUrl, `/bridges/${encodeURIComponent(bridgeUid)}/heartbeat`),
71
+ method: 'POST',
72
+ token,
73
+ }));
74
+ /** End a session: its tokens stop working before the sandbox side unmounts. */
75
+ export const revokeBridge = async (token, bridgeUid, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => convert(await requestDatalayerAPI({
76
+ url: contentsUrl(baseUrl, `/bridges/${encodeURIComponent(bridgeUid)}`),
77
+ method: 'DELETE',
78
+ token,
79
+ }));
@@ -0,0 +1,11 @@
1
+ import type { ContentsCapabilities, OperationCapability, SourceKindCapability } from './generated';
2
+ export type ContentsSourceKindCapability = SourceKindCapability;
3
+ export type ContentsOperationCapability = OperationCapability;
4
+ export type { ContentsCapabilities };
5
+ /**
6
+ * Ask the service what this caller can reach, create and count.
7
+ *
8
+ * A client cannot answer either question on its own: it does not know which
9
+ * parts of Contents are deployed here, nor what this principal may use.
10
+ */
11
+ export declare const getCapabilities: (token: string, baseUrl?: string) => Promise<ContentsCapabilities>;
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ import { requestDatalayerAPI } from '../DatalayerApi.js';
6
+ import { API_BASE_PATHS, DEFAULT_SERVICE_URLS } from '../constants.js';
7
+ import { contentsToCamelCase } from '../../models/contents/index.js';
8
+ /**
9
+ * Ask the service what this caller can reach, create and count.
10
+ *
11
+ * A client cannot answer either question on its own: it does not know which
12
+ * parts of Contents are deployed here, nor what this principal may use.
13
+ */
14
+ export const getCapabilities = async (token, baseUrl = DEFAULT_SERVICE_URLS.CONTENTS) => {
15
+ const value = await requestDatalayerAPI({
16
+ url: `${baseUrl}${API_BASE_PATHS.CONTENTS}/capabilities`,
17
+ method: 'GET',
18
+ token,
19
+ });
20
+ return contentsToCamelCase(value);
21
+ };
@@ -0,0 +1,31 @@
1
+ import type { CloudObjectList, CloudObjectView, ConnectionTest, CredentialDiagnostics, CatalogSource } from './generated';
2
+ export interface PresignedObjectUrl {
3
+ url: string;
4
+ operation: 'get' | 'put';
5
+ expiresIn: number;
6
+ }
7
+ /** One page of a bucket under a prefix; `nextCursor` continues it. */
8
+ export declare const listCloudObjects: (token: string, sourceUid: string, options?: {
9
+ prefix?: string;
10
+ cursor?: string;
11
+ }, baseUrl?: string) => Promise<CloudObjectList>;
12
+ export declare const statCloudObject: (token: string, sourceUid: string, path: string, baseUrl?: string) => Promise<CloudObjectView>;
13
+ /** The bytes of one object, or a range of them. */
14
+ export declare const downloadCloudObject: (token: string, sourceUid: string, path: string, options?: {
15
+ range?: string;
16
+ }, baseUrl?: string) => Promise<{
17
+ body: ArrayBuffer;
18
+ status: number;
19
+ headers: Record<string, string>;
20
+ }>;
21
+ /** Can the bucket be reached with the credential attached: a verdict, not a stack trace. */
22
+ export declare const testCloudConnection: (token: string, sourceUid: string, baseUrl?: string) => Promise<ConnectionTest>;
23
+ /** A URL good for one path, one operation, a bounded time. A `put` needs the right to update. */
24
+ export declare const presignCloudObject: (token: string, sourceUid: string, path: string, options?: {
25
+ operation?: "get" | "put";
26
+ expiresIn?: number;
27
+ }, baseUrl?: string) => Promise<PresignedObjectUrl>;
28
+ /** Whether the source's credential is referenced and resolvable — never its value. */
29
+ export declare const getCredentialDiagnostics: (token: string, sourceUid: string, baseUrl?: string) => Promise<CredentialDiagnostics>;
30
+ /** Point the source at another credential. Owner only, conditional on the ETag. */
31
+ export declare const rotateSourceCredential: (token: string, sourceUid: string, credentialUid: string, etag: string, baseUrl?: string) => Promise<CatalogSource>;