@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
@@ -2,11 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2024-2025 Datalayer, Inc.
7
- *
8
- * BSD 3-Clause License
9
- */
10
5
  import * as React from 'react';
11
6
  const MOBILE_BREAKPOINT = 768;
12
7
  export function useIsMobile() {
@@ -1,6 +1,44 @@
1
+ export interface NavigateOptions {
2
+ /** Replace the current history entry instead of pushing one. */
3
+ replace?: boolean;
4
+ /** History state to carry to the destination. */
5
+ state?: unknown;
6
+ /** Open the destination in a new tab and leave this one where it is. */
7
+ newTab?: boolean;
8
+ /** Scroll to the top on arrival; on by default. */
9
+ scroll?: boolean;
10
+ /**
11
+ * Close the layout's side portals on the way; on by default. Only the
12
+ * history API host has them.
13
+ */
14
+ resetPortals?: boolean;
15
+ }
1
16
  /**
2
- * Main navigation hook that provides a universal navigate function
3
- * Works with React Router, Next.js, or native browser navigation
17
+ * The part of a click (or a key press, from a menu) the hook looks at. A
18
+ * structural type, so React's synthetic events and DOM events both fit.
4
19
  */
5
- export declare const useNavigate: () => (location: string | number, optionsOrEvent?: any, resetPortals?: boolean, extraOptions?: any) => void;
20
+ export interface NavigateEvent {
21
+ preventDefault: () => void;
22
+ metaKey?: boolean;
23
+ ctrlKey?: boolean;
24
+ shiftKey?: boolean;
25
+ altKey?: boolean;
26
+ button?: number;
27
+ currentTarget?: unknown;
28
+ target?: unknown;
29
+ }
30
+ export type NavigateTarget = string | number;
31
+ /**
32
+ * The call shapes accepted, old and new:
33
+ * - `navigate(to, options?)`
34
+ * - `navigate(to, event, options?)`
35
+ * - `navigate(to, event, resetPortals, options?)` (legacy)
36
+ * - `navigate(to, resetPortals, options?)` (legacy)
37
+ */
38
+ export type Navigate = (to: NavigateTarget, optionsOrEvent?: NavigateOptions | NavigateEvent | boolean, third?: boolean | NavigateOptions, fourth?: NavigateOptions) => void;
39
+ /** Whether `event` is a click meant to open a new tab or window. */
40
+ export declare function isNewTabClick(event: NavigateEvent): boolean;
41
+ /** Open `to` in a new tab, without handing it this window. */
42
+ export declare function openInNewTab(to: string): void;
43
+ export declare const useNavigate: () => Navigate;
6
44
  export default useNavigate;
@@ -2,88 +2,142 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { useCallback } from 'react';
5
+ /**
6
+ * Navigation for any host: React Router when the app runs under one, the
7
+ * history API otherwise.
8
+ *
9
+ * One function, `navigate(to, …)`, with the click event as an optional second
10
+ * argument. Pass it and a click behaves the way a browser link does: a plain
11
+ * click navigates in place and stops the anchor's own navigation; a modifier
12
+ * click (⌘, Ctrl, Shift, Alt) or a middle click opens the target in a new tab
13
+ * — through the browser when the click was on a link to that target, through
14
+ * `window.open` otherwise, so a button gets it too. `newTab` in the options
15
+ * opens a new tab outright.
16
+ *
17
+ * @module hooks/useNavigate
18
+ */
19
+ import { useCallback, useMemo } from 'react';
6
20
  import { useLayoutStore } from '../state/index.js';
7
21
  import { createNativeNavigate } from '../navigation/adapters/native.js';
8
22
  // Import React Router hooks from our wrapper
9
23
  import { useNavigateRR } from '../navigation/adapters/react-router.js';
10
- // Import Next.js hooks from our wrapper
11
- // Currently not used but kept for future Next.js support
12
- // import { useRouterNext } from '../navigation/adapters/nextjs.js';
24
+ /** Whether `event` is a click meant to open a new tab or window. */
25
+ export function isNewTabClick(event) {
26
+ return (!!event.metaKey ||
27
+ !!event.ctrlKey ||
28
+ !!event.shiftKey ||
29
+ !!event.altKey ||
30
+ event.button === 1);
31
+ }
32
+ /** The absolute URL `to` names from the current page. */
33
+ const resolveUrl = (to) => new URL(to, window.location.href).href;
34
+ /** Open `to` in a new tab, without handing it this window. */
35
+ export function openInNewTab(to) {
36
+ window.open(resolveUrl(to), '_blank', 'noopener,noreferrer');
37
+ }
13
38
  /**
14
- * Main navigation hook that provides a universal navigate function
15
- * Works with React Router, Next.js, or native browser navigation
39
+ * Whether `event` happened on a link whose `href` already is `to`: then the
40
+ * browser opens the new tab itself, and nothing needs doing.
16
41
  */
42
+ function isLinkTo(event, to) {
43
+ const origin = (event.currentTarget ?? event.target);
44
+ const anchor = origin && typeof origin.closest === 'function'
45
+ ? origin.closest('a[href]')
46
+ : null;
47
+ if (!anchor) {
48
+ return false;
49
+ }
50
+ try {
51
+ return resolveUrl(anchor.getAttribute('href') ?? '') === resolveUrl(to);
52
+ }
53
+ catch {
54
+ return false;
55
+ }
56
+ }
57
+ const isEvent = (value) => !!value && typeof value.preventDefault === 'function';
58
+ function parseCall(optionsOrEvent, third, fourth) {
59
+ if (isEvent(optionsOrEvent)) {
60
+ const options = typeof third === 'boolean'
61
+ ? { resetPortals: third, ...(fourth ?? {}) }
62
+ : { ...(third ?? {}), ...(fourth ?? {}) };
63
+ return { event: optionsOrEvent, options };
64
+ }
65
+ if (typeof optionsOrEvent === 'boolean') {
66
+ return {
67
+ options: {
68
+ resetPortals: optionsOrEvent,
69
+ ...(typeof third === 'object' ? third : {}),
70
+ ...(fourth ?? {}),
71
+ },
72
+ };
73
+ }
74
+ return { options: { ...(optionsOrEvent ?? {}) } };
75
+ }
17
76
  export const useNavigate = () => {
18
77
  const layoutStore = useLayoutStore();
19
78
  // Detect environment
20
79
  const isNextJs = typeof window !== 'undefined' && !!window.__NEXT_DATA__;
21
80
  const isClient = typeof window !== 'undefined';
22
- // Try to use React Router's useNavigate if available
81
+ // React Router's navigate when the app runs under a Router, else nothing.
23
82
  let rrNavigate = null;
24
- let isReactRouter = false;
25
83
  if (!isNextJs && useNavigateRR && isClient) {
26
84
  try {
27
85
  // eslint-disable-next-line react-hooks/rules-of-hooks
28
86
  rrNavigate = useNavigateRR();
29
- isReactRouter = !!rrNavigate;
30
87
  }
31
88
  catch {
32
89
  // Not in a Router context
33
90
  }
34
91
  }
35
- // If React Router is available, return it directly (wrapped for consistency)
36
- if (isReactRouter && rrNavigate) {
37
- // eslint-disable-next-line react-hooks/rules-of-hooks
38
- return useCallback((to, options) => {
39
- // Scroll to top when navigating (except for history navigation)
40
- if (typeof to === 'string') {
41
- window.scrollTo(0, 0);
42
- document.body.scrollTop = 0;
92
+ const nativeNavigate = useMemo(() => createNativeNavigate(), []);
93
+ return useCallback((to, optionsOrEvent, third, fourth) => {
94
+ if (typeof window === 'undefined') {
95
+ return;
96
+ }
97
+ const { event, options } = parseCall(optionsOrEvent, third, fourth);
98
+ // History navigation (e.g. -1 to go back).
99
+ if (typeof to === 'number') {
100
+ event?.preventDefault();
101
+ if (rrNavigate) {
102
+ rrNavigate(to);
103
+ }
104
+ else {
105
+ window.history.go(to);
43
106
  }
44
- // For React Router, pass through directly
45
- return rrNavigate(to, options);
46
- }, [rrNavigate]);
47
- }
48
- // Otherwise use native navigation with our custom behavior
49
- const baseNavigate = createNativeNavigate();
50
- // Wrap with our custom behavior for native navigation
51
- // eslint-disable-next-line react-hooks/rules-of-hooks
52
- const navigate = useCallback((location, optionsOrEvent, resetPortals = true, extraOptions) => {
53
- // Handle number for history navigation (e.g., -1 to go back)
54
- if (typeof location === 'number') {
55
- window.history.go(location);
56
107
  return;
57
108
  }
58
- // Handle different call signatures for native navigation
59
- let options = undefined;
60
- let event = undefined;
61
- if (optionsOrEvent && optionsOrEvent.preventDefault) {
62
- // Legacy signature with event as second parameter
63
- event = optionsOrEvent;
64
- options = extraOptions;
109
+ // A new tab was asked for with the click. A link to that very place
110
+ // gets it from the browser; a button, or a link elsewhere, from us.
111
+ if (event && isNewTabClick(event)) {
112
+ if (!isLinkTo(event, to)) {
113
+ event.preventDefault();
114
+ openInNewTab(to);
115
+ }
116
+ return;
65
117
  }
66
- else if (typeof optionsOrEvent === 'boolean') {
67
- // Legacy signature with resetPortals as second parameter
68
- resetPortals = optionsOrEvent;
69
- options = extraOptions;
118
+ if (options.newTab) {
119
+ event?.preventDefault();
120
+ openInNewTab(to);
121
+ return;
70
122
  }
71
- else {
72
- // Standard signature with options as second parameter
73
- options = optionsOrEvent;
123
+ event?.preventDefault();
124
+ if (options.scroll !== false) {
125
+ window.scrollTo(0, 0);
126
+ document.body.scrollTop = 0;
74
127
  }
75
- if (event) {
76
- event.preventDefault();
128
+ if (rrNavigate) {
129
+ rrNavigate(to, { replace: options.replace, state: options.state });
130
+ return;
77
131
  }
78
- if (resetPortals) {
132
+ if (options.resetPortals !== false) {
79
133
  layoutStore.resetLeftPortal();
80
134
  layoutStore.resetRightPortal();
81
135
  }
82
- window.scrollTo(0, 0);
83
- document.body.scrollTop = 0;
84
- // Use native navigation
85
- baseNavigate(location, options);
86
- }, [baseNavigate, layoutStore]);
87
- return navigate;
136
+ nativeNavigate(to, {
137
+ replace: options.replace,
138
+ state: options.state,
139
+ scroll: options.scroll,
140
+ });
141
+ }, [rrNavigate, nativeNavigate, layoutStore]);
88
142
  };
89
143
  export default useNavigate;
@@ -3,6 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { create } from 'zustand';
6
+ import { registerSessionState } from '../state/sessionEnd.js';
6
7
  /** Build the cache key for a principal. */
7
8
  export function principalCacheKey(kind, uid) {
8
9
  return `${kind}:${String(uid || '').trim()}`;
@@ -94,3 +95,5 @@ export const usePrincipalCacheStore = create((set, get) => ({
94
95
  reset: () => set({ principals: {} }),
95
96
  }));
96
97
  export default usePrincipalCacheStore;
98
+ // What one session resolved is not the next one's to paint.
99
+ registerSessionState({ forget: () => usePrincipalCacheStore.getState().reset() });
@@ -5,6 +5,7 @@
5
5
  import { create } from 'zustand';
6
6
  import { createJSONStorage, persist } from 'zustand/middleware';
7
7
  import { useUsageRefreshStore } from './useUsageRefreshStore.js';
8
+ import { registerSessionState } from '../state/sessionEnd.js';
8
9
  const PRINCIPAL_CONTEXT_COOKIE = 'datalayer-principal-context';
9
10
  const PRINCIPAL_CONTEXT_COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
10
11
  const readPrincipalContextCookie = () => {
@@ -182,3 +183,5 @@ export const usePrincipalStore = create()(persist(set => ({
182
183
  },
183
184
  }));
184
185
  export default usePrincipalStore;
186
+ // The principal selected is the signed-in person's: forgotten when the session ends.
187
+ registerSessionState({ forget: () => usePrincipalStore.getState().resetPrincipal() });
@@ -10,8 +10,8 @@ import type { IKernelConnection } from '@jupyterlab/services/lib/kernel/kernel';
10
10
  export type ProjectRuntimeEntry = {
11
11
  /** The Jupyter session connection (notebook ↔ kernel bridge). */
12
12
  sessionConnection?: Session.ISessionConnection;
13
- /** The assigned agent pod name (mirrors project.attachedAgentPodName). */
14
- agentPodName?: string;
13
+ /** The assigned agent pod name (mirrors project.attachedAgentRuntimeName). */
14
+ agentRuntimeName?: string;
15
15
  /** Display name of the assigned agent. */
16
16
  agentName?: string;
17
17
  /** Agent runtime status (running, starting, terminated, etc.). */
@@ -29,7 +29,7 @@ export type ProjectStoreState = {
29
29
  /** Set or update the session connection for a project. */
30
30
  setSessionConnection: (projectId: string, sessionConnection: Session.ISessionConnection | undefined) => void;
31
31
  /** Set the assigned agent info for a project. */
32
- setAgent: (projectId: string, agentPodName: string | undefined, agentName?: string, agentStatus?: string, agentSpecId?: string) => void;
32
+ setAgent: (projectId: string, agentRuntimeName: string | undefined, agentName?: string, agentStatus?: string, agentSpecId?: string) => void;
33
33
  /** Remove all runtime state for a project (e.g. on unmount). */
34
34
  clearProject: (projectId: string) => void;
35
35
  /** Get the kernel connection for a project, or undefined. */
@@ -34,19 +34,19 @@ export const useProjectStore = create()((set, get) => ({
34
34
  },
35
35
  },
36
36
  })),
37
- setAgent: (projectId, agentPodName, agentName, agentStatus, agentSpecId) => set(state => ({
37
+ setAgent: (projectId, agentRuntimeName, agentName, agentStatus, agentSpecId) => set(state => ({
38
38
  projects: {
39
39
  ...state.projects,
40
40
  [projectId]: {
41
41
  ...state.projects[projectId],
42
- agentPodName,
42
+ agentRuntimeName,
43
43
  agentName,
44
44
  // When removing the agent, also clear the status.
45
45
  // When setting, use provided status or preserve existing.
46
- agentStatus: agentPodName !== undefined
46
+ agentStatus: agentRuntimeName !== undefined
47
47
  ? (agentStatus ?? state.projects[projectId]?.agentStatus)
48
48
  : undefined,
49
- agentSpecId: agentPodName !== undefined
49
+ agentSpecId: agentRuntimeName !== undefined
50
50
  ? (agentSpecId ?? state.projects[projectId]?.agentSpecId)
51
51
  : undefined,
52
52
  },
@@ -7,4 +7,4 @@ import React from 'react';
7
7
  * @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
8
8
  * @type TRef The type of the RefObject which should be created.
9
9
  */
10
- export declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef>): React.RefObject<TRef>;
10
+ export declare function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef | null>): React.RefObject<TRef | null>;
@@ -11,6 +11,9 @@ import { useRef } from 'react';
11
11
  * @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
12
12
  * @type TRef The type of the RefObject which should be created.
13
13
  */
14
+ // React 19 types `useRef<T>(null)` as `RefObject<T | null>`, so both the
15
+ // accepted and returned ref are nullable here. Primer 37 still declares the
16
+ // React 18 shape, so its call sites cast at the boundary.
14
17
  export function useProvidedRefOrCreate(providedRef) {
15
18
  const createdRef = useRef(null);
16
19
  return providedRef ?? createdRef;
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'react';
1
2
  import { ReactNode } from 'react';
2
3
  export type ScreencaptureContextType = {
3
4
  closeScreencapture: () => void;
@@ -15,4 +16,4 @@ export type IScreencaptureProviderProps = {
15
16
  disableDarken?: boolean;
16
17
  screenshotSurface?: (qfds: any) => JSX.Element;
17
18
  };
18
- export declare function ScreencaptureProvider({ children, zIndex, disableDarken, screenshotSurface, }: IScreencaptureProviderProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function ScreencaptureProvider({ children, zIndex, disableDarken, screenshotSurface, }: IScreencaptureProviderProps): JSX.Element;
@@ -1,8 +1,4 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /*
3
- * Copyright (c) 2023-2025 Datalayer, Inc.
4
- * Distributed under the terms of the Modified BSD License.
5
- */
6
2
  import { createContext, useState, useContext } from 'react';
7
3
  import { LayoutScreencapture } from './layouts/index.js';
8
4
  export const ScreencaptureContext = createContext({
@@ -0,0 +1,50 @@
1
+ /**
2
+ * A resolved space, kept in memory.
3
+ *
4
+ * The companion of {@link usePrincipalCacheStore}, for the same reason: a
5
+ * table of a hundred notebooks sitting in three spaces should resolve the
6
+ * three names once, and the next view that shows one of those spaces should
7
+ * paint it before any request has returned. Partial snapshots merge — a blank
8
+ * never overwrites a value already known — so what is known of a space
9
+ * accumulates across the views that saw it.
10
+ */
11
+ export type CachedSpace = {
12
+ /** The space uid: what the spacer API names a space by. */
13
+ uid: string;
14
+ /**
15
+ * The space's internal Solr id. An item is a nested child of its space and
16
+ * names it only by this (`_root_`), so a row that knows nothing else can
17
+ * still be matched to its space.
18
+ */
19
+ rootId?: string;
20
+ handle?: string;
21
+ displayName?: string;
22
+ description?: string;
23
+ variant?: string;
24
+ isPublic?: boolean;
25
+ /** The account the space is addressed under: its organization, else its owner. */
26
+ accountHandle?: string;
27
+ /** Timestamp (ms) of the last time this entry changed. */
28
+ updatedAt?: number;
29
+ };
30
+ type SpaceCacheState = {
31
+ /** Cached spaces keyed by uid. */
32
+ spaces: Record<string, CachedSpace>;
33
+ /** Space uids keyed by the Solr id items carry as `_root_`. */
34
+ uidByRootId: Record<string, string>;
35
+ /** Read a cached space by uid, if present. */
36
+ getSpace: (uid: string) => CachedSpace | undefined;
37
+ /** Read a cached space by the Solr id an item names it by, if present. */
38
+ getSpaceByRootId: (rootId: string) => CachedSpace | undefined;
39
+ /**
40
+ * Merge a (possibly partial) space snapshot into the cache. Existing
41
+ * meaningful values are kept when the incoming snapshot omits them.
42
+ */
43
+ upsertSpace: (entry: CachedSpace) => void;
44
+ /** Remove a single cached space (e.g. after it was renamed or deleted). */
45
+ clearSpace: (uid: string) => void;
46
+ /** Clear the entire cache. */
47
+ reset: () => void;
48
+ };
49
+ export declare const useSpaceCacheStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SpaceCacheState>>;
50
+ export default useSpaceCacheStore;
@@ -0,0 +1,85 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ import { create } from 'zustand';
6
+ import { registerSessionState } from '../state/sessionEnd.js';
7
+ const MERGEABLE_KEYS = [
8
+ 'rootId',
9
+ 'handle',
10
+ 'displayName',
11
+ 'description',
12
+ 'variant',
13
+ 'isPublic',
14
+ 'accountHandle',
15
+ ];
16
+ function hasMeaningfulValue(value) {
17
+ if (value === undefined || value === null) {
18
+ return false;
19
+ }
20
+ if (typeof value === 'string') {
21
+ return value.trim().length > 0;
22
+ }
23
+ return true;
24
+ }
25
+ export const useSpaceCacheStore = create((set, get) => ({
26
+ spaces: {},
27
+ uidByRootId: {},
28
+ getSpace: uid => {
29
+ const key = String(uid || '').trim();
30
+ return key ? get().spaces[key] : undefined;
31
+ },
32
+ getSpaceByRootId: rootId => {
33
+ const key = String(rootId || '').trim();
34
+ const uid = key ? get().uidByRootId[key] : undefined;
35
+ return uid ? get().spaces[uid] : undefined;
36
+ },
37
+ upsertSpace: entry => {
38
+ const uid = String(entry.uid || '').trim();
39
+ if (!uid) {
40
+ return;
41
+ }
42
+ const existing = get().spaces[uid];
43
+ const merged = { ...existing, uid };
44
+ for (const field of MERGEABLE_KEYS) {
45
+ const incoming = entry[field];
46
+ if (hasMeaningfulValue(incoming)) {
47
+ merged[field] = incoming;
48
+ }
49
+ }
50
+ // Nothing new: skip the update, so every mounted SpaceDisplay does not
51
+ // re-render for a snapshot it already has.
52
+ if (existing &&
53
+ MERGEABLE_KEYS.every(field => merged[field] === existing[field])) {
54
+ return;
55
+ }
56
+ merged.updatedAt = Date.now();
57
+ const rootId = String(merged.rootId || '').trim();
58
+ set(state => ({
59
+ spaces: { ...state.spaces, [uid]: merged },
60
+ uidByRootId: rootId && state.uidByRootId[rootId] !== uid
61
+ ? { ...state.uidByRootId, [rootId]: uid }
62
+ : state.uidByRootId,
63
+ }));
64
+ },
65
+ clearSpace: uid => {
66
+ const key = String(uid || '').trim();
67
+ set(state => {
68
+ const existing = state.spaces[key];
69
+ if (!existing) {
70
+ return state;
71
+ }
72
+ const spaces = { ...state.spaces };
73
+ delete spaces[key];
74
+ const uidByRootId = { ...state.uidByRootId };
75
+ if (existing.rootId && uidByRootId[existing.rootId] === key) {
76
+ delete uidByRootId[existing.rootId];
77
+ }
78
+ return { spaces, uidByRootId };
79
+ });
80
+ },
81
+ reset: () => set({ spaces: {}, uidByRootId: {} }),
82
+ }));
83
+ export default useSpaceCacheStore;
84
+ // What one session resolved is not the next one's to paint.
85
+ registerSessionState({ forget: () => useSpaceCacheStore.getState().reset() });
@@ -1,8 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright (c) 2023-2025 Datalayer, Inc.
4
- * Distributed under the terms of the Modified BSD License.
5
- */
6
2
  import React from 'react';
7
3
  import { toast } from 'react-toastify';
8
4
  import { Button } from '@primer/react';
@@ -2,4 +2,4 @@ import { RefObject } from 'react';
2
2
  export type VisibilityMap = {
3
3
  [key: string]: boolean;
4
4
  };
5
- export declare function useVisibilityObserver(navigationRef: RefObject<HTMLUListElement>, children: any): VisibilityMap[];
5
+ export declare function useVisibilityObserver(navigationRef: RefObject<HTMLUListElement | null>, children: any): VisibilityMap[];
package/lib/index.d.ts CHANGED
@@ -3,10 +3,13 @@ export * from './utils';
3
3
  export * from './state';
4
4
  export * from './navigation';
5
5
  export * from './hooks';
6
- export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi';
6
+ export { requestDatalayerAPI, requestDatalayerAPIWithResponse, RunResponseError, NetworkError, } from './api/DatalayerApi';
7
7
  export type { IRequestDatalayerAPIOptions } from './api/DatalayerApi';
8
+ export type { IDatalayerAPIResponse } from './api/DatalayerApi';
8
9
  export { API_BASE_PATHS } from './api/constants';
9
10
  export * as iamApi from './api/iam';
11
+ export * as contentsApi from './api/contents';
10
12
  export * from './client';
13
+ export * from './models/contents';
11
14
  export * from './otel';
12
15
  export * from './views';
package/lib/index.js CHANGED
@@ -10,10 +10,12 @@ export * from './state/index.js';
10
10
  export * from './navigation/index.js';
11
11
  export * from './hooks/index.js';
12
12
  // Export APIs.
13
- export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi.js';
13
+ export { requestDatalayerAPI, requestDatalayerAPIWithResponse, RunResponseError, NetworkError, } from './api/DatalayerApi.js';
14
14
  export { API_BASE_PATHS } from './api/constants.js';
15
15
  export * as iamApi from './api/iam/index.js';
16
+ export * as contentsApi from './api/contents/index.js';
16
17
  export * from './client/index.js';
18
+ export * from './models/contents/index.js';
17
19
  // OTEL observability components, hooks, and types
18
20
  export * from './otel/index.js';
19
21
  // Reusable views (sign-in pages, etc.)
@@ -1,2 +1,2 @@
1
- export declare const FlashMock: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const FlashMock: () => import("react").JSX.Element;
2
2
  export default FlashMock;
@@ -1,5 +1,5 @@
1
1
  type Props = {
2
2
  title: string;
3
3
  };
4
- export declare const ActionMenuMock: (props: Props) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const ActionMenuMock: (props: Props) => import("react").JSX.Element;
5
5
  export default ActionMenuMock;
@@ -1,5 +1,5 @@
1
1
  type Props = {
2
2
  title: string;
3
3
  };
4
- export declare const ChartMock: (props: Props) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const ChartMock: (props: Props) => import("react").JSX.Element;
5
5
  export default ChartMock;
@@ -1,2 +1,2 @@
1
- export declare const DashboardMock: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const DashboardMock: () => import("react").JSX.Element;
2
2
  export default DashboardMock;
@@ -1,5 +1,5 @@
1
1
  type Props = {
2
2
  title: string;
3
3
  };
4
- export declare const FormMock: (props: Props) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const FormMock: (props: Props) => import("react").JSX.Element;
5
5
  export default FormMock;
@@ -1,5 +1,5 @@
1
1
  type Props = {
2
2
  title: string;
3
3
  };
4
- export declare const TableMock: (props: Props) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const TableMock: (props: Props) => import("react").JSX.Element;
5
5
  export default TableMock;
@@ -1,5 +1,5 @@
1
1
  type Props = {
2
2
  title: string;
3
3
  };
4
- export declare const WipMock: (props: Props) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const WipMock: (props: Props) => import("react").JSX.Element;
5
5
  export default WipMock;
@@ -25,6 +25,22 @@ export interface ICredits {
25
25
  */
26
26
  last_update: string;
27
27
  }
28
+ /**
29
+ * The credits an account can still spend.
30
+ *
31
+ * `credits` means one of two things depending on whether a quota is set: what
32
+ * is left, or what has been consumed against the quota. IAM omits `quota`
33
+ * entirely for an account without one, so an absent quota is read the same as
34
+ * an explicit `null` — testing only against `null` let `undefined` take the
35
+ * quota branch and produced `NaN`, which then travelled silently into every
36
+ * reader of this number.
37
+ *
38
+ * Outstanding reservations are already committed, so they are subtracted:
39
+ * what is returned is what a new reservation may still claim.
40
+ */
41
+ export declare const availableCredits: (credits: Pick<ICredits, "credits" | "quota">, reservations?: readonly {
42
+ credits: number;
43
+ }[]) => number;
28
44
  export interface ICheckoutPortal {
29
45
  /**
30
46
  * External checkout portal URL to open in a new tab.