@datalayer/core 1.1.60 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. package/README.md +41 -18
  2. package/lib/api/DatalayerApi.d.ts +42 -1
  3. package/lib/api/DatalayerApi.js +90 -3
  4. package/lib/api/constants.d.ts +19 -1
  5. package/lib/api/constants.js +19 -1
  6. package/lib/api/contents/attachments.d.ts +9 -0
  7. package/lib/api/contents/attachments.js +39 -0
  8. package/lib/api/contents/bridges.d.ts +22 -0
  9. package/lib/api/contents/bridges.js +79 -0
  10. package/lib/api/contents/capabilities.d.ts +11 -0
  11. package/lib/api/contents/capabilities.js +21 -0
  12. package/lib/api/contents/cloudStorage.d.ts +31 -0
  13. package/lib/api/contents/cloudStorage.js +89 -0
  14. package/lib/api/contents/dataservers.d.ts +37 -0
  15. package/lib/api/contents/dataservers.js +121 -0
  16. package/lib/api/contents/datasets.d.ts +63 -0
  17. package/lib/api/contents/datasets.js +82 -0
  18. package/lib/api/contents/datasources.d.ts +70 -0
  19. package/lib/api/contents/datasources.js +149 -0
  20. package/lib/api/contents/generated.d.ts +1070 -0
  21. package/lib/api/contents/index.d.ts +16 -0
  22. package/lib/api/contents/index.js +20 -0
  23. package/lib/api/contents/mcp.d.ts +46 -0
  24. package/lib/api/contents/mcp.js +157 -0
  25. package/lib/api/contents/objects.d.ts +31 -0
  26. package/lib/api/contents/objects.js +88 -0
  27. package/lib/api/contents/operations.d.ts +3 -0
  28. package/lib/api/contents/operations.js +19 -0
  29. package/lib/api/contents/runtimeMounts.d.ts +40 -0
  30. package/lib/api/contents/runtimeMounts.js +59 -0
  31. package/lib/api/contents/sandboxUid.d.ts +21 -0
  32. package/lib/api/contents/sandboxUid.js +27 -0
  33. package/lib/api/contents/sources.d.ts +19 -0
  34. package/lib/api/contents/sources.js +119 -0
  35. package/lib/api/contents/sync.d.ts +18 -0
  36. package/lib/api/contents/sync.js +69 -0
  37. package/lib/api/contents/transfers.d.ts +38 -0
  38. package/lib/api/contents/transfers.js +123 -0
  39. package/lib/api/evals/client.d.ts +402 -0
  40. package/lib/api/evals/client.js +359 -0
  41. package/lib/api/evals/index.d.ts +10 -0
  42. package/lib/api/evals/index.js +18 -0
  43. package/lib/api/evals/request.d.ts +43 -0
  44. package/lib/api/evals/request.js +67 -0
  45. package/lib/api/evals/status.d.ts +27 -0
  46. package/lib/api/evals/status.js +122 -0
  47. package/lib/api/evals/types.d.ts +1335 -0
  48. package/lib/api/evals/types.js +5 -0
  49. package/lib/api/iam/connectedAgents.d.ts +68 -0
  50. package/lib/api/iam/connectedAgents.js +87 -0
  51. package/lib/api/iam/identityProviders.d.ts +76 -0
  52. package/lib/api/iam/identityProviders.js +187 -0
  53. package/lib/api/iam/index.d.ts +3 -1
  54. package/lib/api/iam/index.js +3 -1
  55. package/lib/api/iam/mcpAlertRules.d.ts +51 -0
  56. package/lib/api/iam/mcpAlertRules.js +198 -0
  57. package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
  58. package/lib/api/iam/mcpAuditSettings.js +120 -0
  59. package/lib/api/iam/mcpPolicy.d.ts +181 -0
  60. package/lib/api/iam/mcpPolicy.js +168 -0
  61. package/lib/api/iam/organizationTeams.d.ts +13 -0
  62. package/lib/api/iam/organizationTeams.js +43 -0
  63. package/lib/api/iam/profile.d.ts +17 -1
  64. package/lib/api/iam/profile.js +27 -0
  65. package/lib/api/iam/scimTokens.d.ts +79 -0
  66. package/lib/api/iam/scimTokens.js +141 -0
  67. package/lib/api/iam/secrets.js +9 -21
  68. package/lib/api/iam/serviceAgents.d.ts +68 -0
  69. package/lib/api/iam/serviceAgents.js +119 -0
  70. package/lib/api/iam/trials.d.ts +38 -0
  71. package/lib/api/iam/trials.js +66 -0
  72. package/lib/api/index.d.ts +8 -1
  73. package/lib/api/index.js +7 -1
  74. package/lib/api/mcp/activity.d.ts +37 -0
  75. package/lib/api/mcp/activity.js +26 -0
  76. package/lib/api/mcp/alerts.d.ts +25 -0
  77. package/lib/api/mcp/alerts.js +51 -0
  78. package/lib/api/mcp/audit.d.ts +29 -0
  79. package/lib/api/mcp/audit.js +55 -0
  80. package/lib/api/mcp/bindings.d.ts +18 -0
  81. package/lib/api/mcp/bindings.js +42 -0
  82. package/lib/api/mcp/forwarding.d.ts +25 -0
  83. package/lib/api/mcp/forwarding.js +46 -0
  84. package/lib/api/mcp/gateway.d.ts +16 -0
  85. package/lib/api/mcp/gateway.js +70 -0
  86. package/lib/api/mcp/generated.d.ts +22 -0
  87. package/lib/api/mcp/generated.js +213 -0
  88. package/lib/api/mcp/index.d.ts +17 -0
  89. package/lib/api/mcp/index.js +25 -0
  90. package/lib/api/mcp/observability.d.ts +141 -0
  91. package/lib/api/mcp/observability.js +267 -0
  92. package/lib/api/mcp/operations.d.ts +83 -0
  93. package/lib/api/mcp/operations.js +50 -0
  94. package/lib/api/mcp/organizations.d.ts +102 -0
  95. package/lib/api/mcp/organizations.js +46 -0
  96. package/lib/api/mcp/policy.d.ts +9 -0
  97. package/lib/api/mcp/policy.js +23 -0
  98. package/lib/api/mcp/tasks.d.ts +49 -0
  99. package/lib/api/mcp/tasks.js +147 -0
  100. package/lib/api/orchestration/client.d.ts +53 -0
  101. package/lib/api/orchestration/client.js +105 -0
  102. package/lib/api/orchestration/events.d.ts +88 -0
  103. package/lib/api/orchestration/events.js +245 -0
  104. package/lib/api/orchestration/generated.d.ts +693 -0
  105. package/lib/api/orchestration/generated.js +687 -0
  106. package/lib/api/orchestration/index.d.ts +30 -0
  107. package/lib/api/orchestration/index.js +34 -0
  108. package/lib/api/orchestration/lifecycle.d.ts +39 -0
  109. package/lib/api/orchestration/lifecycle.js +57 -0
  110. package/lib/api/orchestration/measures.d.ts +55 -0
  111. package/lib/api/orchestration/measures.js +99 -0
  112. package/lib/api/otel/dashboards.d.ts +56 -0
  113. package/lib/api/otel/dashboards.js +50 -0
  114. package/lib/api/otel/index.d.ts +1 -0
  115. package/lib/api/otel/index.js +1 -0
  116. package/lib/api/otel/metrics.d.ts +16 -0
  117. package/lib/api/otel/metrics.js +15 -0
  118. package/lib/api/scheduler/client.d.ts +32 -0
  119. package/lib/api/scheduler/client.js +42 -0
  120. package/lib/api/scheduler/index.d.ts +8 -0
  121. package/lib/api/scheduler/index.js +16 -0
  122. package/lib/api/scheduler/request.d.ts +28 -0
  123. package/lib/api/scheduler/request.js +50 -0
  124. package/lib/api/scheduler/types.d.ts +88 -0
  125. package/lib/api/scheduler/types.js +5 -0
  126. package/lib/api/spacer/comments.d.ts +97 -0
  127. package/lib/api/spacer/comments.js +45 -0
  128. package/lib/api/spacer/index.d.ts +9 -0
  129. package/lib/api/spacer/index.js +17 -0
  130. package/lib/api/spacer/notebooks.d.ts +33 -0
  131. package/lib/api/spacer/notebooks.js +39 -0
  132. package/lib/api/spacer/request.d.ts +25 -0
  133. package/lib/api/spacer/request.js +46 -0
  134. package/lib/api/spacer/spaces.d.ts +68 -0
  135. package/lib/api/spacer/spaces.js +45 -0
  136. package/lib/api/utils/validation.d.ts +4 -4
  137. package/lib/api/utils/validation.js +10 -7
  138. package/lib/client/auth/index.js +0 -5
  139. package/lib/client/auth/storage.js +0 -5
  140. package/lib/client/auth/strategies.js +0 -5
  141. package/lib/client/base.d.ts +6 -0
  142. package/lib/client/base.js +8 -0
  143. package/lib/client/constants.d.ts +1 -0
  144. package/lib/client/constants.js +1 -0
  145. package/lib/client/index.d.ts +0 -10
  146. package/lib/client/index.js +2 -2
  147. package/lib/client/mixins/ContentsMixin.d.ts +71 -0
  148. package/lib/client/mixins/ContentsMixin.js +157 -0
  149. package/lib/client/mixins/IAMMixin.d.ts +0 -31
  150. package/lib/client/mixins/IAMMixin.js +0 -58
  151. package/lib/components/animation/AnimatedText.d.ts +2 -44
  152. package/lib/components/animation/AnimatedText.js +6 -126
  153. package/lib/components/anonymous/AnonymousKeyExpired.d.ts +56 -0
  154. package/lib/components/anonymous/AnonymousKeyExpired.js +96 -0
  155. package/lib/components/anonymous/AnonymousKeyTimer.d.ts +63 -0
  156. package/lib/components/anonymous/AnonymousKeyTimer.js +140 -0
  157. package/lib/components/anonymous/index.d.ts +7 -0
  158. package/lib/components/anonymous/index.js +15 -0
  159. package/lib/components/auth/SigInAPIKey.d.ts +1 -0
  160. package/lib/components/auth/SigInAPIKey.js +0 -6
  161. package/lib/components/auth/SignIn.d.ts +1 -0
  162. package/lib/components/auth/SignIn.js +0 -4
  163. package/lib/components/auth/SignIn.stories.d.ts +2 -2
  164. package/lib/components/avatars/BoringAvatar.d.ts +1 -1
  165. package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
  166. package/lib/components/avatars/DLAvatar.d.ts +1 -1
  167. package/lib/components/avatars/DLAvatar.js +0 -4
  168. package/lib/components/avatars/UserAvatar.d.ts +16 -1
  169. package/lib/components/avatars/UserAvatar.js +15 -13
  170. package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
  171. package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
  172. package/lib/components/billing/BillingEntitySelect.d.ts +16 -0
  173. package/lib/components/billing/BillingEntitySelect.js +49 -27
  174. package/lib/components/billing/eligibility.d.ts +22 -0
  175. package/lib/components/billing/eligibility.js +27 -0
  176. package/lib/components/billing/index.d.ts +1 -0
  177. package/lib/components/billing/index.js +1 -4
  178. package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
  179. package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
  180. package/lib/components/buttons/LongActionButton.d.ts +1 -0
  181. package/lib/components/buttons/LongActionButton.js +0 -4
  182. package/lib/components/buttons/UploadButton.d.ts +1 -0
  183. package/lib/components/buttons/UploadButton.js +0 -4
  184. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  185. package/lib/components/collaboration/LiveEditorCollaborators.d.ts +36 -0
  186. package/lib/components/collaboration/LiveEditorCollaborators.js +88 -53
  187. package/lib/components/collaboration/index.js +0 -4
  188. package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
  189. package/lib/components/contents/ContentSourceCard.d.ts +8 -0
  190. package/lib/components/contents/ContentSourceCard.js +23 -0
  191. package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
  192. package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
  193. package/lib/components/contents/index.d.ts +2 -0
  194. package/lib/components/contents/index.js +6 -0
  195. package/lib/components/context/OrganizationSelect.d.ts +1 -1
  196. package/lib/components/display/AvatarSkeleton.d.ts +1 -1
  197. package/lib/components/display/BusyDots.d.ts +1 -1
  198. package/lib/components/display/CenteredSpinner.d.ts +1 -1
  199. package/lib/components/display/CodePreview.d.ts +1 -1
  200. package/lib/components/display/DatalayerBox.d.ts +7 -3
  201. package/lib/components/display/DatalayerBox.js +7 -7
  202. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  203. package/lib/components/display/JupyterDialog.d.ts +1 -0
  204. package/lib/components/display/JupyterDialog.js +1 -7
  205. package/lib/components/display/Markdown.d.ts +1 -0
  206. package/lib/components/display/NavLink.js +3 -2
  207. package/lib/components/display/NotebookSkeleton.d.ts +1 -1
  208. package/lib/components/display/Placeholder.d.ts +1 -1
  209. package/lib/components/display/ToTopBranded.d.ts +1 -1
  210. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  211. package/lib/components/flashes/FlashClosable.d.ts +1 -0
  212. package/lib/components/flashes/FlashClosable.js +0 -4
  213. package/lib/components/flashes/FlashGuest.d.ts +1 -1
  214. package/lib/components/flashes/FlashSurveys.d.ts +1 -1
  215. package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
  216. package/lib/components/flashes/FlashUnauthorized.js +0 -6
  217. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  218. package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
  219. package/lib/components/index.d.ts +2 -0
  220. package/lib/components/index.js +2 -0
  221. package/lib/components/labels/StatusLabels.d.ts +2 -9
  222. package/lib/components/labels/StatusLabels.js +2 -26
  223. package/lib/components/labels/VisibilityLabel.d.ts +1 -1
  224. package/lib/components/landings/StepBlock.d.ts +1 -1
  225. package/lib/components/mcp/ClientBadge.d.ts +41 -0
  226. package/lib/components/mcp/ClientBadge.js +33 -0
  227. package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
  228. package/lib/components/mcp/McpErrorBlankslate.js +17 -0
  229. package/lib/components/mcp/ScopeList.d.ts +28 -0
  230. package/lib/components/mcp/ScopeList.js +14 -0
  231. package/lib/components/mcp/index.d.ts +10 -0
  232. package/lib/components/mcp/index.js +18 -0
  233. package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
  234. package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
  235. package/lib/components/navbar/SubdomainNavBar.js +2 -1
  236. package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
  237. package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
  238. package/lib/components/principal/PrincipalAppearance.d.ts +22 -42
  239. package/lib/components/principal/PrincipalAppearance.js +232 -182
  240. package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
  241. package/lib/components/principal/PrincipalAvatar.js +18 -10
  242. package/lib/components/principal/PrincipalBadge.d.ts +1 -1
  243. package/lib/components/principal/PrincipalBanner.d.ts +1 -1
  244. package/lib/components/principal/PrincipalDetailsOverlay.d.ts +38 -1
  245. package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
  246. package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
  247. package/lib/components/principal/PrincipalHoverCard.js +52 -0
  248. package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
  249. package/lib/components/principal/PrincipalSwitcherMenu.js +5 -14
  250. package/lib/components/principal/index.d.ts +2 -1
  251. package/lib/components/principal/index.js +2 -1
  252. package/lib/components/progress/ConsumptionBar.d.ts +1 -0
  253. package/lib/components/progress/ConsumptionBar.js +0 -4
  254. package/lib/components/progress/ProgressRing.d.ts +1 -0
  255. package/lib/components/progress/SpinnerBar.d.ts +1 -1
  256. package/lib/components/progress/Timer.d.ts +1 -0
  257. package/lib/components/progress/Timer.js +0 -4
  258. package/lib/components/screencapture/Screencapture.js +46 -3
  259. package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
  260. package/lib/components/sharing/ShareAccessComponent.d.ts +58 -3
  261. package/lib/components/sharing/ShareAccessComponent.js +143 -98
  262. package/lib/components/sharing/SharingEditor.d.ts +21 -0
  263. package/lib/components/sharing/SharingEditor.js +9 -28
  264. package/lib/components/sharing/index.d.ts +1 -0
  265. package/lib/components/sharing/index.js +1 -0
  266. package/lib/components/sharing/sandboxSharing.d.ts +26 -0
  267. package/lib/components/sharing/sandboxSharing.js +41 -0
  268. package/lib/components/spaces/SpaceDetailsOverlay.d.ts +39 -0
  269. package/lib/components/spaces/SpaceDetailsOverlay.js +80 -0
  270. package/lib/components/spaces/SpaceDisplay.d.ts +38 -0
  271. package/lib/components/spaces/SpaceDisplay.js +92 -0
  272. package/lib/components/spaces/index.d.ts +4 -0
  273. package/lib/components/spaces/index.js +7 -0
  274. package/lib/components/spaces/spaceDisplayModel.d.ts +93 -0
  275. package/lib/components/spaces/spaceDisplayModel.js +170 -0
  276. package/lib/components/sparklines/Sparklines.js +3 -4
  277. package/lib/components/sparklines/index.js +0 -4
  278. package/lib/components/storage/ContentsBrowser.d.ts +25 -1
  279. package/lib/components/storage/ContentsBrowser.js +145 -52
  280. package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
  281. package/lib/components/storage/ContentsBrowserMock.js +75 -0
  282. package/lib/components/storage/ContentsItems.d.ts +2 -1
  283. package/lib/components/storage/ContentsItems.js +0 -4
  284. package/lib/components/storage/ContentsTable.d.ts +50 -0
  285. package/lib/components/storage/ContentsTable.js +134 -0
  286. package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
  287. package/lib/components/storage/HomeFolderDrive.js +248 -0
  288. package/lib/components/storage/index.d.ts +2 -0
  289. package/lib/components/storage/index.js +2 -0
  290. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  291. package/lib/components/students/StudentResultCircle.d.ts +1 -1
  292. package/lib/components/subnav/SubNav.d.ts +5 -5
  293. package/lib/components/subnav/SubNav.js +11 -9
  294. package/lib/components/tables/DataTable.d.ts +1 -1
  295. package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
  296. package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
  297. package/lib/components/time/LiveRelativeTime.d.ts +1 -0
  298. package/lib/components/time/LiveRelativeTime.js +0 -8
  299. package/lib/components/time/index.js +0 -4
  300. package/lib/components/timeline/Timeline.d.ts +1 -1
  301. package/lib/components/timeline/index.js +0 -4
  302. package/lib/components/users/PeerIndicator.d.ts +1 -0
  303. package/lib/components/users/PeerIndicator.js +0 -4
  304. package/lib/config/Configuration.d.ts +15 -17
  305. package/lib/config/Configuration.js +7 -0
  306. package/lib/hooks/cacheConverters.d.ts +0 -7
  307. package/lib/hooks/cacheConverters.js +0 -25
  308. package/lib/hooks/index.d.ts +3 -0
  309. package/lib/hooks/index.js +3 -0
  310. package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
  311. package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
  312. package/lib/hooks/useBackdrop.d.ts +1 -1
  313. package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
  314. package/lib/hooks/useBackdropJupyterLab.js +0 -4
  315. package/lib/hooks/useBillingEntityStore.js +3 -0
  316. package/lib/hooks/useCache.d.ts +478 -130
  317. package/lib/hooks/useCache.js +1580 -676
  318. package/lib/hooks/useContainsFocus.d.ts +1 -1
  319. package/lib/hooks/useContents.d.ts +334 -0
  320. package/lib/hooks/useContents.js +1033 -0
  321. package/lib/hooks/useFocusTrap.d.ts +4 -4
  322. package/lib/hooks/useFocusTrap.js +1 -1
  323. package/lib/hooks/useMcp.d.ts +315 -0
  324. package/lib/hooks/useMcp.js +891 -0
  325. package/lib/hooks/useMobile.js +0 -5
  326. package/lib/hooks/useNavigate.d.ts +41 -3
  327. package/lib/hooks/useNavigate.js +106 -52
  328. package/lib/hooks/usePrincipalCacheStore.js +3 -0
  329. package/lib/hooks/usePrincipalStore.js +3 -0
  330. package/lib/hooks/useProjectStore.d.ts +3 -3
  331. package/lib/hooks/useProjectStore.js +4 -4
  332. package/lib/hooks/useRef.d.ts +1 -1
  333. package/lib/hooks/useRef.js +3 -0
  334. package/lib/hooks/useScreencapture.d.ts +2 -1
  335. package/lib/hooks/useScreencapture.js +0 -4
  336. package/lib/hooks/useSpaceCacheStore.d.ts +50 -0
  337. package/lib/hooks/useSpaceCacheStore.js +85 -0
  338. package/lib/hooks/useToast.js +0 -4
  339. package/lib/hooks/useVisibilityObserver.d.ts +1 -1
  340. package/lib/index.d.ts +4 -1
  341. package/lib/index.js +3 -1
  342. package/lib/mocks/components/FlashMock.d.ts +1 -1
  343. package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
  344. package/lib/mocks/views/ChartMock.d.ts +1 -1
  345. package/lib/mocks/views/DashboardMock.d.ts +1 -1
  346. package/lib/mocks/views/FormMock.d.ts +1 -1
  347. package/lib/mocks/views/TableMock.d.ts +1 -1
  348. package/lib/mocks/views/WipMock.d.ts +1 -1
  349. package/lib/models/Credits.d.ts +16 -0
  350. package/lib/models/Credits.js +22 -0
  351. package/lib/models/CreditsDTO.d.ts +6 -5
  352. package/lib/models/CreditsDTO.js +7 -5
  353. package/lib/models/McpAuditEvent.d.ts +52 -0
  354. package/lib/models/McpAuditEvent.js +5 -0
  355. package/lib/models/McpBinding.d.ts +57 -0
  356. package/lib/models/McpBinding.js +5 -0
  357. package/lib/models/McpPolicy.d.ts +77 -0
  358. package/lib/models/McpPolicy.js +5 -0
  359. package/lib/models/McpTask.d.ts +94 -0
  360. package/lib/models/McpTask.js +7 -0
  361. package/lib/models/Organization.d.ts +69 -0
  362. package/lib/models/Organization.js +96 -0
  363. package/lib/models/Secret.d.ts +1 -2
  364. package/lib/models/Secret.js +2 -18
  365. package/lib/models/StartedBy.d.ts +91 -0
  366. package/lib/models/StartedBy.js +117 -0
  367. package/lib/models/Team.d.ts +2 -0
  368. package/lib/models/Team.js +2 -0
  369. package/lib/models/User.d.ts +4 -0
  370. package/lib/models/User.js +3 -0
  371. package/lib/models/UserDTO.js +4 -2
  372. package/lib/models/UserSettings.d.ts +13 -0
  373. package/lib/models/UserSettings.js +9 -0
  374. package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
  375. package/lib/models/contents/__fixtures__/v1-contracts.json +194 -0
  376. package/lib/models/contents/fieldCase.d.ts +8 -0
  377. package/lib/models/contents/fieldCase.js +37 -0
  378. package/lib/models/contents/index.d.ts +2 -0
  379. package/lib/models/contents/index.js +6 -0
  380. package/lib/models/contents/permissions.d.ts +16 -0
  381. package/lib/models/contents/permissions.js +34 -0
  382. package/lib/models/index.d.ts +5 -1
  383. package/lib/models/index.js +5 -1
  384. package/lib/navigation/components.js +2 -3
  385. package/lib/routes/publicPaths.js +4 -0
  386. package/lib/state/index.d.ts +1 -0
  387. package/lib/state/index.js +1 -0
  388. package/lib/state/sessionEnd.d.ts +55 -0
  389. package/lib/state/sessionEnd.js +162 -0
  390. package/lib/state/substates/CoreState.d.ts +15 -7
  391. package/lib/state/substates/CoreState.js +21 -17
  392. package/lib/state/substates/IAMState.d.ts +1 -1
  393. package/lib/state/substates/IAMState.js +12 -5
  394. package/lib/state/substates/LayoutState.js +12 -0
  395. package/lib/state/substates/ProfileState.d.ts +1 -0
  396. package/lib/state/substates/ProfileState.js +1 -4
  397. package/lib/state/substates/index.d.ts +0 -1
  398. package/lib/state/substates/index.js +0 -1
  399. package/lib/utils/Jwt.d.ts +26 -0
  400. package/lib/utils/Jwt.js +37 -0
  401. package/lib/utils/Lazy.d.ts +20 -0
  402. package/lib/utils/Lazy.js +32 -6
  403. package/lib/utils/Screencapture.js +3 -0
  404. package/lib/utils/WithSuspense.d.ts +11 -1
  405. package/lib/utils/WithSuspense.js +11 -1
  406. package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
  407. package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
  408. package/lib/views/api-keys/APIKeys.d.ts +1 -1
  409. package/lib/views/api-keys/APIKeys.js +30 -4
  410. package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
  411. package/lib/views/api-keys/APIKeysStandalone.js +2 -2
  412. package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
  413. package/lib/views/datasources/DatasourceDetail.js +80 -110
  414. package/lib/views/datasources/DatasourceNew.d.ts +14 -8
  415. package/lib/views/datasources/DatasourceNew.js +129 -118
  416. package/lib/views/datasources/Datasources.d.ts +39 -7
  417. package/lib/views/datasources/Datasources.js +95 -40
  418. package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
  419. package/lib/views/datasources/DatasourcesMock.js +57 -0
  420. package/lib/views/iam/SignInSimple.d.ts +12 -0
  421. package/lib/views/iam/SignInSimple.js +4 -4
  422. package/lib/views/index.d.ts +1 -0
  423. package/lib/views/index.js +1 -0
  424. package/lib/views/mcp/AdmittedClients.d.ts +44 -0
  425. package/lib/views/mcp/AdmittedClients.js +59 -0
  426. package/lib/views/mcp/AlertDestinations.d.ts +34 -0
  427. package/lib/views/mcp/AlertDestinations.js +75 -0
  428. package/lib/views/mcp/AlertRules.d.ts +32 -0
  429. package/lib/views/mcp/AlertRules.js +245 -0
  430. package/lib/views/mcp/ApprovalQueue.d.ts +66 -0
  431. package/lib/views/mcp/ApprovalQueue.js +95 -0
  432. package/lib/views/mcp/AuditLog.d.ts +42 -0
  433. package/lib/views/mcp/AuditLog.js +144 -0
  434. package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
  435. package/lib/views/mcp/ConnectedAgents.js +135 -0
  436. package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
  437. package/lib/views/mcp/EnterpriseConsole.js +195 -0
  438. package/lib/views/mcp/IdentityProviders.d.ts +33 -0
  439. package/lib/views/mcp/IdentityProviders.js +299 -0
  440. package/lib/views/mcp/McpDashboard.d.ts +50 -0
  441. package/lib/views/mcp/McpDashboard.js +430 -0
  442. package/lib/views/mcp/McpHome.d.ts +92 -0
  443. package/lib/views/mcp/McpHome.js +153 -0
  444. package/lib/views/mcp/McpObservability.d.ts +79 -0
  445. package/lib/views/mcp/McpObservability.js +236 -0
  446. package/lib/views/mcp/NotebookRuns.d.ts +39 -0
  447. package/lib/views/mcp/NotebookRuns.js +44 -0
  448. package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
  449. package/lib/views/mcp/OrganizationPolicy.js +108 -0
  450. package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
  451. package/lib/views/mcp/OrganizationUsage.js +113 -0
  452. package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
  453. package/lib/views/mcp/PersonalPolicy.js +126 -0
  454. package/lib/views/mcp/Policies.d.ts +53 -0
  455. package/lib/views/mcp/Policies.js +210 -0
  456. package/lib/views/mcp/PolicyForm.d.ts +83 -0
  457. package/lib/views/mcp/PolicyForm.js +113 -0
  458. package/lib/views/mcp/PolicyHistory.d.ts +58 -0
  459. package/lib/views/mcp/PolicyHistory.js +75 -0
  460. package/lib/views/mcp/RunDetail.d.ts +87 -0
  461. package/lib/views/mcp/RunDetail.js +186 -0
  462. package/lib/views/mcp/ScimProvisioning.d.ts +54 -0
  463. package/lib/views/mcp/ScimProvisioning.js +173 -0
  464. package/lib/views/mcp/ServiceAgents.d.ts +46 -0
  465. package/lib/views/mcp/ServiceAgents.js +194 -0
  466. package/lib/views/mcp/TeamPolicies.d.ts +33 -0
  467. package/lib/views/mcp/TeamPolicies.js +159 -0
  468. package/lib/views/mcp/ToolAccess.d.ts +60 -0
  469. package/lib/views/mcp/ToolAccess.js +101 -0
  470. package/lib/views/mcp/TraceTimeline.d.ts +81 -0
  471. package/lib/views/mcp/TraceTimeline.js +132 -0
  472. package/lib/views/mcp/format.d.ts +25 -0
  473. package/lib/views/mcp/format.js +77 -0
  474. package/lib/views/mcp/index.d.ts +34 -0
  475. package/lib/views/mcp/index.js +42 -0
  476. package/lib/views/mcp/types.d.ts +66 -0
  477. package/lib/views/mcp/types.js +5 -0
  478. package/lib/views/otel/simpleAuthStore.js +3 -0
  479. package/lib/views/secrets/SecretEdit.d.ts +5 -1
  480. package/lib/views/secrets/SecretEdit.js +5 -4
  481. package/lib/views/secrets/SecretNew.d.ts +11 -1
  482. package/lib/views/secrets/SecretNew.js +7 -3
  483. package/lib/views/secrets/Secrets.d.ts +12 -1
  484. package/lib/views/secrets/Secrets.js +2 -2
  485. package/package.json +269 -260
  486. package/scripts/generate-contents-types.py +169 -0
  487. package/scripts/generate-mcp-types.py +233 -0
  488. package/scripts/generate-orchestration-types.py +920 -0
  489. package/lib/api/iam/datasources.d.ts +0 -86
  490. package/lib/api/iam/datasources.js +0 -185
  491. package/lib/components/toolbars/index.d.ts +0 -1
  492. package/lib/models/Datasource.d.ts +0 -181
  493. package/lib/models/Datasource.js +0 -154
  494. package/lib/state/substates/DatasourceState.d.ts +0 -11
  495. package/lib/state/substates/DatasourceState.js +0 -16
  496. /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
@@ -0,0 +1,95 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Button, Heading, Label, RelativeTime, SegmentedControl, Spinner, Text, Textarea, } from '@primer/react';
4
+ import { Box } from '@datalayer/primer-addons';
5
+ import { McpErrorBlankslate } from '../../components/mcp/index.js';
6
+ import { useDecideMcpApproval, useMcpApprovals, } from '../../hooks/useContents.js';
7
+ /** How each state of an approval is drawn. */
8
+ export const APPROVAL_LOOK = {
9
+ pending: { label: 'Waiting on you', variant: 'attention' },
10
+ approved: { label: 'Approved', variant: 'success' },
11
+ rejected: { label: 'Rejected', variant: 'danger' },
12
+ expired: { label: 'Expired', variant: 'secondary' },
13
+ consumed: { label: 'Used', variant: 'secondary' },
14
+ };
15
+ /**
16
+ * Whether this approval can still be decided.
17
+ *
18
+ * Two conditions, and the second is the one that matters: the record says
19
+ * `pending`, *and* its deadline has not passed. Contents expires an approval
20
+ * when something next reads it rather than on a timer, so a row fetched a
21
+ * minute ago can be `pending` and over. Trusting the status alone would draw
22
+ * buttons whose only outcome is an error.
23
+ *
24
+ * An unparseable deadline is treated as passed. That is the safe direction:
25
+ * the worst case is somebody has to ask the agent to try again, where the
26
+ * other way round is a decision taken on a record nobody can date.
27
+ */
28
+ export const isDecidable = (approval, now = Date.now()) => {
29
+ if (approval.status !== 'pending') {
30
+ return false;
31
+ }
32
+ const deadline = Date.parse(approval.expiresAt);
33
+ return Number.isFinite(deadline) && deadline > now;
34
+ };
35
+ /**
36
+ * What a row says about its own deadline.
37
+ *
38
+ * A pending approval that has run out is drawn as expired even though the
39
+ * record still says pending — the reader's question is "can I still act on
40
+ * this", and the record's answer to that is stale by construction.
41
+ */
42
+ export const approvalLook = (approval, now = Date.now()) => approval.status === 'pending' && !isDecidable(approval, now)
43
+ ? APPROVAL_LOOK.expired
44
+ : APPROVAL_LOOK[approval.status];
45
+ /** The states this page can be filtered to. `pending` is what it opens on. */
46
+ export const APPROVAL_FILTERS = [
47
+ 'pending',
48
+ 'approved',
49
+ 'rejected',
50
+ ];
51
+ export const ApprovalQueue = ({ errorState, sourceUid, }) => {
52
+ const [status, setStatus] = useState('pending');
53
+ const [noteFor, setNoteFor] = useState({});
54
+ const approvals = useMcpApprovals(status, sourceUid ? { sourceUid } : {});
55
+ const decide = useDecideMcpApproval();
56
+ const items = approvals.data?.items ?? [];
57
+ return (_jsxs(Box, { sx: { display: 'grid', gap: 3, minWidth: 0 }, children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h3", sx: { fontSize: 2, mb: 1 }, children: "Approvals" }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', m: 0 }, children: "A source set to require approval stops each call until you allow it. An approval covers the exact arguments below and nothing else, so a second call with different arguments asks again." })] }), _jsx(SegmentedControl, { "aria-label": "Which approvals", size: "small", children: APPROVAL_FILTERS.map(state => (_jsx(SegmentedControl.Button, { selected: status === state, onClick: () => setStatus(state), children: APPROVAL_LOOK[state].label }, state))) }), approvals.isError ? (_jsx(McpErrorBlankslate, { state: errorState(approvals.error, 'The approvals'), onRetry: () => approvals.refetch() })) : approvals.isPending ? (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', py: 5 }, children: _jsx(Spinner, {}) })) : items.length === 0 ? (_jsx(Text, { sx: { fontSize: 1, color: 'fg.muted' }, children: status === 'pending'
58
+ ? 'Nothing is waiting on you.'
59
+ : `No ${APPROVAL_LOOK[status].label.toLowerCase()} approvals.` })) : (items.map(approval => {
60
+ const look = approvalLook(approval);
61
+ const decidable = isDecidable(approval);
62
+ return (_jsxs(Box, { sx: {
63
+ border: '1px solid',
64
+ borderColor: decidable ? 'attention.emphasis' : 'border.default',
65
+ borderRadius: 2,
66
+ p: 3,
67
+ display: 'grid',
68
+ gap: 2,
69
+ minWidth: 0,
70
+ }, children: [_jsxs(Box, { sx: { display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }, children: [_jsx(Label, { size: "small", variant: look.variant, children: look.label }), _jsx(Text, { sx: { fontSize: 1, fontWeight: 'semibold' }, children: approval.tool }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', fontFamily: 'mono' }, children: approval.actorUid }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["asked ", _jsx(RelativeTime, { datetime: approval.createdAt })] }), decidable && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["expires ", _jsx(RelativeTime, { datetime: approval.expiresAt })] }))] }), _jsx(Box, { as: "pre", sx: {
71
+ fontFamily: 'mono',
72
+ fontSize: 0,
73
+ whiteSpace: 'pre-wrap',
74
+ overflowX: 'auto',
75
+ bg: 'canvas.subtle',
76
+ borderRadius: 2,
77
+ p: 2,
78
+ m: 0,
79
+ }, children: JSON.stringify(approval.argumentsRedacted, null, 2) }), approval.destinationUri && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["Writes to", ' ', _jsx(Text, { as: "span", sx: { fontFamily: 'mono' }, children: approval.destinationUri })] })), decidable ? (_jsxs(_Fragment, { children: [_jsx(Textarea, { "aria-label": `Why, for ${approval.tool}`, rows: 2, placeholder: "Why (optional; kept with the decision)", value: noteFor[approval.uid] ?? '', onChange: event => setNoteFor(current => ({
80
+ ...current,
81
+ [approval.uid]: event.target.value,
82
+ })) }), _jsxs(Box, { sx: { display: 'flex', gap: 2 }, children: [_jsx(Button, { variant: "primary", disabled: decide.isPending, onClick: () => decide.mutate({
83
+ approvalUid: approval.uid,
84
+ decision: 'approve',
85
+ note: noteFor[approval.uid] || undefined,
86
+ }), children: "Allow this call" }), _jsx(Button, { variant: "danger", disabled: decide.isPending, onClick: () => decide.mutate({
87
+ approvalUid: approval.uid,
88
+ decision: 'reject',
89
+ note: noteFor[approval.uid] || undefined,
90
+ }), children: "Refuse" })] })] })) : (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [approval.decidedBy
91
+ ? `Decided by ${approval.decidedBy}`
92
+ : 'This request ran out before anybody decided it. The agent has to ask again.', approval.note ? ` — ${approval.note}` : ''] }))] }, approval.uid));
93
+ }))] }));
94
+ };
95
+ export default ApprovalQueue;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Who did what, and was it allowed.
3
+ *
4
+ * The audit log is the trail an auditor reads, so it is drawn as the
5
+ * activity timeline is — newest first, one mark per row, the decision on
6
+ * the mark — rather than as a grid of identifiers. The filters live in the
7
+ * address, which is what makes a row's page shareable, and the page is
8
+ * cursor-paged: an audit query is bounded at the service, and a page number
9
+ * over an append-only collection would be a different set of rows every
10
+ * time it was asked for.
11
+ *
12
+ * Rows are immutable. This view never offers to edit or delete one, and it
13
+ * never shows an argument in clear — arguments are hashed and redacted with
14
+ * the Contents rules before they reach the row.
15
+ *
16
+ * Audit is not telemetry: a row carries the trace id so one call can be
17
+ * followed into the traces, and the traces say so about themselves on the
18
+ * observability page.
19
+ *
20
+ * @module views/mcp/AuditLog
21
+ */
22
+ import type { JSX } from 'react';
23
+ import type { McpAuditFilters } from '../../api/mcp';
24
+ import { type McpErrorStateFn, type McpRoutes } from './types';
25
+ export interface AuditLogProps {
26
+ /** The application's words for a failed request. */
27
+ errorState: McpErrorStateFn;
28
+ /** Where this application puts the surfaces this view links to. */
29
+ routes: McpRoutes;
30
+ /** The filters, exactly as the address holds them. */
31
+ filters: McpAuditFilters;
32
+ /** Asked to write a new set of filters into the address. */
33
+ onFiltersChange: (filters: McpAuditFilters) => void;
34
+ /** How long rows are kept on this account's plan, when it is known. */
35
+ retentionDays?: number;
36
+ /** Drawn without its heading, when the page around it carries one. */
37
+ showTitle?: boolean;
38
+ /** What this log is of: "your agents", "acme". */
39
+ subject?: string;
40
+ }
41
+ export declare const AuditLog: ({ errorState, routes, filters, onFiltersChange, retentionDays, showTitle, subject, }: AuditLogProps) => JSX.Element;
42
+ export default AuditLog;
@@ -0,0 +1,144 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState } from 'react';
3
+ import { ActionList, ActionMenu, Button, Heading, Label, Link, Flash, RelativeTime, Select, Spinner, Text, TextInput, } from '@primer/react';
4
+ import { Blankslate, Dialog } from '@primer/react/experimental';
5
+ import { Box } from '@datalayer/primer-addons';
6
+ import { CheckCircleIcon, ChevronLeftIcon, ChevronRightIcon, DownloadIcon, HistoryIcon, ShieldLockIcon, XCircleIcon, } from '@primer/octicons-react';
7
+ import { McpErrorBlankslate } from '../../components/mcp/index.js';
8
+ import { useAuditEvents, useAuditExport, useMcpForwarding, } from '../../hooks/useMcp.js';
9
+ import { useNavigate, useToast } from '../../hooks/index.js';
10
+ import { durationLabel } from './format.js';
11
+ /** How many rows a page holds. */
12
+ const PAGE_SIZE = 50;
13
+ const decisionLook = (event) => {
14
+ if (event.decision === 'refused') {
15
+ return { fg: 'danger.fg', bg: 'danger.subtle', Icon: ShieldLockIcon };
16
+ }
17
+ if (event.outcome && event.outcome !== 'ok') {
18
+ return { fg: 'attention.fg', bg: 'attention.subtle', Icon: XCircleIcon };
19
+ }
20
+ return { fg: 'success.fg', bg: 'success.subtle', Icon: CheckCircleIcon };
21
+ };
22
+ /** Save a document the browser never navigated to. */
23
+ const download = (content, filename, mime) => {
24
+ const url = URL.createObjectURL(new Blob([content], { type: mime }));
25
+ const anchor = document.createElement('a');
26
+ anchor.href = url;
27
+ anchor.download = filename;
28
+ anchor.click();
29
+ URL.revokeObjectURL(url);
30
+ };
31
+ export const AuditLog = ({ errorState, routes, filters, onFiltersChange, retentionDays, showTitle = true, subject = 'your agents', }) => {
32
+ const navigate = useNavigate();
33
+ const { enqueueToast } = useToast();
34
+ const page = useAuditEvents({ limit: PAGE_SIZE, ...filters });
35
+ const exporting = useAuditExport();
36
+ // Only an organization forwards; a personal audit has nowhere to go.
37
+ const forwarding = useMcpForwarding(filters.org ?? '', {
38
+ enabled: Boolean(filters.org),
39
+ });
40
+ const [open, setOpen] = useState(null);
41
+ // Primer 37 types Dialog's focus refs with React 18's non-nullable
42
+ // `RefObject<HTMLElement>`. React 19's `useRef(null)` is nullable, and this
43
+ // ref is only handed to Dialog, so narrow it once here.
44
+ const returnFocusRef = useRef(null);
45
+ /** The cursors already walked, so "Newer" is a step back rather than a guess. */
46
+ const [walked, setWalked] = useState([]);
47
+ const rows = page.data?.items ?? [];
48
+ const nextCursor = page.data?.nextCursor ?? null;
49
+ const set = (patch) => {
50
+ // Any change to what is selected starts the walk again: a cursor is a
51
+ // position in one query's answer, and means nothing in another's.
52
+ setWalked([]);
53
+ onFiltersChange({ ...filters, ...patch, cursor: undefined });
54
+ };
55
+ const older = () => {
56
+ if (!nextCursor) {
57
+ return;
58
+ }
59
+ setWalked(current => [...current, filters.cursor ?? '']);
60
+ onFiltersChange({ ...filters, cursor: nextCursor });
61
+ };
62
+ const newer = () => {
63
+ const previous = walked[walked.length - 1];
64
+ setWalked(current => current.slice(0, -1));
65
+ onFiltersChange({ ...filters, cursor: previous || undefined });
66
+ };
67
+ const exportAs = (format) => {
68
+ const { cursor: _cursor, limit: _limit, ...selection } = filters;
69
+ exporting.mutate({ filters: selection, format }, {
70
+ onSuccess: content => {
71
+ download(content, `mcp-audit-${new Date().toISOString().slice(0, 10)}.${format}`, format === 'csv' ? 'text/csv' : 'application/x-ndjson');
72
+ },
73
+ onError: reason => enqueueToast(`Could not export: ${reason.message}`, {
74
+ variant: 'error',
75
+ }),
76
+ });
77
+ };
78
+ const retention = useMemo(() => retentionDays
79
+ ? `Rows are kept for ${retentionDays} days on this plan, then deleted.`
80
+ : 'Rows are kept for the retention period of this plan, then deleted.', [retentionDays]);
81
+ if (page.isError) {
82
+ return (_jsx(McpErrorBlankslate, { state: errorState(page.error, 'Audit'), onRetry: () => page.refetch() }));
83
+ }
84
+ return (_jsxs(Box, { sx: { display: 'grid', gap: 3, minWidth: 0 }, children: [showTitle && (_jsxs(Box, { children: [_jsx(Heading, { as: "h2", sx: { fontSize: 3, mb: 1 }, children: "Audit" }), _jsxs(Text, { as: "p", sx: { color: 'fg.muted', fontSize: 1, m: 0 }, children: ["Every call ", subject, " made through MCP, what was decided, and why."] })] })), forwarding.data?.configured && forwarding.data.state && (_jsx(Flash, { variant: forwarding.data.state.healthy ? 'default' : 'danger', children: _jsx(Text, { sx: { fontSize: 1 }, children: forwarding.data.state.healthy ? (_jsxs(_Fragment, { children: ["Forwarded to your own system of record \u2014", ' ', forwarding.data.state.delivered, " batches", forwarding.data.state.lastDeliveredAt && (_jsxs(_Fragment, { children: [", last", ' ', _jsx(RelativeTime, { datetime: forwarding.data.state.lastDeliveredAt })] })), "."] })) : (_jsxs(_Fragment, { children: [_jsx("strong", { children: "Forwarding is failing." }), " These rows are kept here and are not reaching your own system of record:", ' ', forwarding.data.state.lastError, forwarding.data.state.lastErrorAt && (_jsxs(_Fragment, { children: [' ', "(", _jsx(RelativeTime, { datetime: forwarding.data.state.lastErrorAt }), ")"] })), ". ", forwarding.data.state.failed, " batches have failed."] })) }) })), _jsxs(Box, { sx: {
85
+ display: 'grid',
86
+ gap: 2,
87
+ gridTemplateColumns: ['1fr', 'repeat(2, 1fr)', 'repeat(5, 1fr)'],
88
+ alignItems: 'end',
89
+ }, children: [_jsx(TextInput, { size: "small", "aria-label": "Agent", placeholder: "Agent", value: filters.agent ?? '', onChange: event => set({ agent: event.currentTarget.value || undefined }) }), _jsx(TextInput, { size: "small", "aria-label": "Tool", placeholder: "Tool", value: filters.tool ?? '', onChange: event => set({ tool: event.currentTarget.value || undefined }) }), _jsxs(Select, { size: "small", "aria-label": "Decision", value: filters.decision ?? '', onChange: event => set({
90
+ decision: (event.currentTarget.value ||
91
+ undefined),
92
+ }), children: [_jsx(Select.Option, { value: "", children: "Every decision" }), _jsx(Select.Option, { value: "allowed", children: "Allowed" }), _jsx(Select.Option, { value: "refused", children: "Refused" })] }), _jsxs(Select, { size: "small", "aria-label": "Outcome", value: filters.outcome ?? '', onChange: event => set({
93
+ outcome: (event.currentTarget.value ||
94
+ undefined),
95
+ }), children: [_jsx(Select.Option, { value: "", children: "Every outcome" }), _jsx(Select.Option, { value: "ok", children: "Succeeded" }), _jsx(Select.Option, { value: "error", children: "Failed" }), _jsx(Select.Option, { value: "is_error", children: "Tool error" })] }), _jsx(Box, { sx: { display: 'flex', gap: 2, justifyContent: 'flex-end' }, children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { size: "small", leadingVisual: DownloadIcon, disabled: exporting.isPending, children: "Export" }), _jsx(ActionMenu.Overlay, { align: "end", children: _jsxs(ActionList, { children: [_jsxs(ActionList.Item, { onSelect: () => exportAs('jsonl'), children: ["JSONL", _jsx(ActionList.Description, { variant: "block", children: "One row per line, as a SIEM reads it." })] }), _jsxs(ActionList.Item, { onSelect: () => exportAs('csv'), children: ["CSV", _jsx(ActionList.Description, { variant: "block", children: "The same rows for a spreadsheet." })] })] }) })] }) })] }), _jsxs(Text, { sx: { fontSize: 0, color: 'fg.subtle' }, children: ["Audit rows are written once and never changed or deleted by anyone, here or elsewhere. Arguments are redacted before they are written.", ' ', retention] }), page.isPending && !page.data ? (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', py: 6 }, children: _jsx(Spinner, {}) })) : rows.length === 0 ? (_jsxs(Blankslate, { border: true, spacious: true, children: [_jsx(Blankslate.Visual, { children: _jsx(HistoryIcon, { size: "medium" }) }), _jsx(Blankslate.Heading, { children: "Nothing to audit yet" }), _jsx(Blankslate.Description, { children: _jsx(Text, { sx: { textAlign: 'center' }, children: "Every call an agent makes is written down here with its decision and its outcome. Connect a client and ask it to list your notebooks." }) }), _jsx(Button, { size: "small", onClick: () => navigate(routes.access), children: "Connect an agent" })] })) : (
96
+ /* The rail of the activity view: each mark on a tinted disc, the discs
97
+ linked by a line, so the rows carry no border of their own. */
98
+ _jsx(Box, { sx: { display: 'grid' }, children: rows.map((event, index) => {
99
+ const look = decisionLook(event);
100
+ const isLast = index === rows.length - 1;
101
+ return (_jsxs(Box, { sx: { display: 'flex', gap: 3 }, children: [_jsxs(Box, { sx: {
102
+ display: 'flex',
103
+ flexDirection: 'column',
104
+ alignItems: 'center',
105
+ }, children: [_jsx(Box, { sx: {
106
+ width: 26,
107
+ height: 26,
108
+ borderRadius: '50%',
109
+ display: 'inline-flex',
110
+ alignItems: 'center',
111
+ justifyContent: 'center',
112
+ color: look.fg,
113
+ bg: look.bg,
114
+ flexShrink: 0,
115
+ }, children: _jsx(look.Icon, { size: 13 }) }), !isLast && (_jsx(Box, { sx: { width: '2px', flex: 1, bg: 'border.muted', my: 1 } }))] }), _jsxs(Box, { sx: {
116
+ flexGrow: 1,
117
+ minWidth: 0,
118
+ pb: isLast ? 0 : 3,
119
+ pt: '3px',
120
+ }, children: [_jsx(Link, { as: "button", sx: {
121
+ fontSize: 1,
122
+ display: 'block',
123
+ textAlign: 'left',
124
+ cursor: 'pointer',
125
+ }, onClick: () => setOpen(event), children: event.tool || event.method }), _jsxs(Box, { sx: {
126
+ display: 'flex',
127
+ gap: 2,
128
+ alignItems: 'center',
129
+ mt: 1,
130
+ flexWrap: 'wrap',
131
+ }, children: [_jsx(Label, { size: "small", variant: event.decision === 'refused' ? 'danger' : 'success', children: event.decision }), event.clientId && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: event.clientId })), event.itemUid && (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: ["on ", event.itemUid] })), event.durationMs !== null &&
132
+ event.durationMs !== undefined && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: durationLabel(event.durationMs) })), event.refusalReason && (_jsx(Text, { sx: { fontSize: 0, color: 'danger.fg' }, children: event.refusalReason }))] })] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', flexShrink: 0 }, children: _jsx(RelativeTime, { datetime: event.at }) })] }, event.uid));
133
+ }) })), (walked.length > 0 || nextCursor) && (_jsxs(Box, { sx: { display: 'flex', gap: 2, justifyContent: 'center' }, children: [_jsx(Button, { size: "small", leadingVisual: ChevronLeftIcon, disabled: walked.length === 0, onClick: newer, children: "Newer" }), _jsx(Button, { size: "small", trailingVisual: ChevronRightIcon, disabled: !nextCursor, onClick: older, children: "Older" })] })), open && (_jsx(Dialog, { title: open.tool || open.method, subtitle: `${open.decision} · ${open.outcome ?? 'no outcome recorded'}`, onClose: () => setOpen(null), returnFocusRef: returnFocusRef, width: "large", children: _jsxs(Box, { sx: { display: 'grid', gap: 3 }, children: [_jsxs(Box, { sx: { display: 'grid', gap: 1 }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "When" }), _jsxs(Text, { sx: { fontSize: 1 }, children: [_jsx(RelativeTime, { datetime: open.at }), " \u2014 ", open.at] })] }), _jsxs(Box, { sx: { display: 'grid', gap: 1 }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Who" }), _jsxs(Text, { sx: { fontSize: 1 }, children: [open.clientId || 'unknown client', open.act &&
134
+ open.act.length > 0 &&
135
+ ` acting for ${open.act.join(' → ')}`] })] }), open.refusalReason && (_jsxs(Box, { sx: { display: 'grid', gap: 1 }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Why it was refused" }), _jsx(Text, { sx: { fontSize: 1, color: 'danger.fg' }, children: open.refusalReason })] })), _jsxs(Box, { sx: { display: 'grid', gap: 1 }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Arguments, redacted before they were written" }), _jsx(Box, { as: "pre", sx: {
136
+ m: 0,
137
+ p: 2,
138
+ fontSize: 0,
139
+ bg: 'canvas.inset',
140
+ borderRadius: 2,
141
+ overflowX: 'auto',
142
+ }, children: JSON.stringify(open.redactedArguments ?? {}, null, 2) }), open.argumentsHash && (_jsx(Text, { sx: { fontSize: 0, color: 'fg.subtle', fontFamily: 'mono' }, children: open.argumentsHash }))] }), _jsxs(Box, { sx: { display: 'flex', gap: 2, flexWrap: 'wrap' }, children: [open.taskId && (_jsx(Button, { size: "small", onClick: () => navigate(`${routes.runs}/${encodeURIComponent(open.taskId)}`), children: "The run" })), open.traceId && (_jsx(Button, { size: "small", onClick: () => navigate(`${routes.observability}?trace=${encodeURIComponent(open.traceId)}`), children: "The trace" }))] })] }) }))] }));
143
+ };
144
+ export default AuditLog;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The agents a person has connected, and the one action that matters:
3
+ * disconnecting one.
4
+ *
5
+ * A grant is not a setting — it is authority a person handed to a piece of
6
+ * software — so the table says which client holds it, what it was allowed
7
+ * to do, when it last used it, and how its identity was established. A
8
+ * client registered by Client ID Metadata Document *is* its URL, and the
9
+ * URL is what is shown as its id: the host is the part nobody can invent.
10
+ *
11
+ * Disconnecting revokes the grant. The refresh token stops working at once
12
+ * and the next call is refused; an access token the agent still holds dies
13
+ * with its own short expiry, which is why they are short. The dialog says
14
+ * so rather than implying an instantaneous kill.
15
+ *
16
+ * @module views/mcp/ConnectedAgents
17
+ */
18
+ import type { JSX } from 'react';
19
+ import { type McpErrorStateFn, type McpRoutes } from './types';
20
+ export interface ConnectedAgentsProps {
21
+ /** The application's words for a failed request. */
22
+ errorState: McpErrorStateFn;
23
+ /** Where this application puts the surfaces this view links to. */
24
+ routes: McpRoutes;
25
+ /** Drawn without its heading, when the page around it carries one. */
26
+ showTitle?: boolean;
27
+ /**
28
+ * Read-only: an owner looking at the delegated grants of an
29
+ * organization's members may see them, and asks the member to revoke.
30
+ */
31
+ readOnly?: boolean;
32
+ }
33
+ export declare const ConnectedAgents: ({ errorState, routes, showTitle, readOnly, }: ConnectedAgentsProps) => JSX.Element;
34
+ export default ConnectedAgents;
@@ -0,0 +1,135 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState } from 'react';
3
+ import { ActionList, ActionMenu, Button, Heading, Label, RelativeTime, Spinner, Text, } from '@primer/react';
4
+ import { Blankslate, DataTable, Dialog, Table, } from '@primer/react/experimental';
5
+ import { Box } from '@datalayer/primer-addons';
6
+ import { KebabHorizontalIcon, PlugIcon } from '@primer/octicons-react';
7
+ import { ClientBadge, McpErrorBlankslate, ScopeList, } from '../../components/mcp/index.js';
8
+ import { useConnectedAgents, useDisconnectAgent, useDisconnectEveryAgent, } from '../../hooks/useMcp.js';
9
+ import { useNavigate, useToast } from '../../hooks/index.js';
10
+ export const ConnectedAgents = ({ errorState, routes, showTitle = true, readOnly = false, }) => {
11
+ const navigate = useNavigate();
12
+ const { enqueueToast } = useToast();
13
+ const agents = useConnectedAgents();
14
+ const disconnect = useDisconnectAgent();
15
+ const disconnectEvery = useDisconnectEveryAgent();
16
+ const [disconnecting, setDisconnecting] = useState(null);
17
+ const [disconnectingEvery, setDisconnectingEvery] = useState(false);
18
+ // Primer 37 types Dialog's focus refs with React 18's non-nullable
19
+ // `RefObject<HTMLElement>`. React 19's `useRef(null)` is nullable, and this
20
+ // ref is only handed to Dialog, so narrow it once here.
21
+ const returnFocusRef = useRef(null);
22
+ const rows = useMemo(() => (agents.data ?? []).map(agent => ({ ...agent, id: agent.uid })), [agents.data]);
23
+ const confirmDisconnectEvery = () => {
24
+ disconnectEvery.mutate(undefined, {
25
+ onSuccess: answer => {
26
+ enqueueToast(answer.revoked === 1
27
+ ? '1 agent disconnected.'
28
+ : `${answer.revoked} agents disconnected.`, { variant: 'success' });
29
+ setDisconnectingEvery(false);
30
+ },
31
+ onError: error => {
32
+ setDisconnectingEvery(false);
33
+ enqueueToast(`Could not disconnect: ${error.message}`, {
34
+ variant: 'error',
35
+ });
36
+ },
37
+ });
38
+ };
39
+ const confirmDisconnect = () => {
40
+ const agent = disconnecting;
41
+ if (!agent) {
42
+ return;
43
+ }
44
+ disconnect.mutate(agent.uid, {
45
+ onSuccess: () => {
46
+ enqueueToast(`${agent.clientName || agent.clientId} is disconnected.`, {
47
+ variant: 'success',
48
+ });
49
+ setDisconnecting(null);
50
+ },
51
+ onError: reason => {
52
+ enqueueToast(`Could not disconnect: ${reason.message}`, {
53
+ variant: 'error',
54
+ });
55
+ setDisconnecting(null);
56
+ },
57
+ });
58
+ };
59
+ const columns = [
60
+ {
61
+ header: 'Client',
62
+ field: 'clientId',
63
+ rowHeader: true,
64
+ renderCell: row => (_jsx(ClientBadge, { clientId: row.clientId, clientName: row.clientName, registration: row.registration, clientHostname: row.clientHostname })),
65
+ },
66
+ {
67
+ header: 'Kind',
68
+ id: 'kind',
69
+ width: '110px',
70
+ // Every grant IAM answers here is a delegation of the signed-in
71
+ // person; an organization's service agents are its own principals and
72
+ // are listed on the organization's page from milestone 3.
73
+ renderCell: () => (_jsx(Label, { size: "small", variant: "secondary", children: "Delegated" })),
74
+ },
75
+ {
76
+ header: 'Allowed to',
77
+ id: 'scopes',
78
+ width: 'growCollapse',
79
+ renderCell: row => _jsx(ScopeList, { scopes: row.scopes }),
80
+ },
81
+ {
82
+ header: 'Connected',
83
+ id: 'created',
84
+ width: '130px',
85
+ renderCell: row => row.createdAt ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: _jsx(RelativeTime, { datetime: row.createdAt }) })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "\u2014" })),
86
+ },
87
+ {
88
+ header: 'Last used',
89
+ id: 'last-used',
90
+ width: '130px',
91
+ renderCell: row => row.lastUsedAt ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: _jsx(RelativeTime, { datetime: row.lastUsedAt }) })) : (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Never" })),
92
+ },
93
+ {
94
+ header: '',
95
+ id: 'actions',
96
+ width: '48px',
97
+ align: 'end',
98
+ renderCell: row => (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Button, { variant: "invisible", size: "small", "aria-label": `Actions for ${row.clientName || row.clientId}`, icon: KebabHorizontalIcon }) }), _jsx(ActionMenu.Overlay, { align: "end", children: _jsxs(ActionList, { children: [_jsx(ActionList.Item, { onSelect: () => navigate(`${routes.runs}?agent=${encodeURIComponent(row.clientId)}`), children: "Runs" }), _jsx(ActionList.Item, { onSelect: () => navigate(`${routes.audit}?agent=${encodeURIComponent(row.clientId)}`), children: "Audit" }), !readOnly && (_jsxs(_Fragment, { children: [_jsx(ActionList.Divider, {}), _jsx(ActionList.Item, { variant: "danger", onSelect: () => setDisconnecting(row), children: "Disconnect" })] }))] }) })] })),
99
+ },
100
+ ];
101
+ if (agents.isError) {
102
+ return (_jsx(McpErrorBlankslate, { state: errorState(agents.error, 'Connected agents'), onRetry: () => agents.refetch() }));
103
+ }
104
+ return (_jsxs(Box, { sx: { display: 'grid', gap: 3, minWidth: 0 }, children: [showTitle && (_jsxs(Box, { sx: {
105
+ display: 'flex',
106
+ alignItems: 'start',
107
+ justifyContent: 'space-between',
108
+ gap: 3,
109
+ }, children: [_jsxs(Box, { children: [_jsx(Heading, { as: "h2", sx: { fontSize: 3, mb: 1 }, children: "Connected Agents" }), _jsx(Text, { as: "p", sx: { color: 'fg.muted', fontSize: 1, m: 0 }, children: "Every agent you have authorized, what it may do, and when it last did it." })] }), !readOnly && rows.length > 0 && (_jsx(Button, { variant: "danger", onClick: () => setDisconnectingEvery(true), disabled: disconnectEvery.isPending, children: "Disconnect all" }))] })), agents.isPending && !agents.data ? (_jsx(Box, { sx: { display: 'flex', justifyContent: 'center', py: 5 }, children: _jsx(Spinner, {}) })) : rows.length > 0 ? (_jsxs(Table.Container, { children: [_jsx(Table.Title, { as: "h3", id: "connected-agents", children: "Agents" }), _jsx(Table.Subtitle, { as: "p", id: "connected-agents-subtitle", children: "An agent acts with exactly the access of the person who authorized it, and no more." }), _jsx(DataTable, { "aria-labelledby": "connected-agents", "aria-describedby": "connected-agents-subtitle", data: rows, columns: columns })] })) : (_jsxs(Blankslate, { border: true, spacious: true, children: [_jsx(Blankslate.Visual, { children: _jsx(PlugIcon, { size: "medium" }) }), _jsx(Blankslate.Heading, { children: "No agent connected" }), _jsx(Blankslate.Description, { children: _jsx(Text, { sx: { textAlign: 'center' }, children: "Connect an MCP client and approve the scopes it asks for; the grant appears here and can be revoked from here." }) }), _jsx(Button, { size: "small", onClick: () => navigate(routes.access), children: "Connect an agent" })] })), _jsx(Text, { sx: { fontSize: 0, color: 'fg.subtle' }, children: "Narrowing a grant to fewer scopes without disconnecting arrives with the organization policy." }), disconnecting && (_jsx(Dialog, { title: "Disconnect this agent?", onClose: () => setDisconnecting(null), returnFocusRef: returnFocusRef, footerButtons: [
110
+ {
111
+ buttonType: 'default',
112
+ content: 'Keep it',
113
+ onClick: () => setDisconnecting(null),
114
+ },
115
+ {
116
+ buttonType: 'danger',
117
+ content: 'Disconnect',
118
+ onClick: confirmDisconnect,
119
+ disabled: disconnect.isPending,
120
+ },
121
+ ], children: _jsxs(Text, { sx: { fontSize: 1 }, children: [disconnecting.clientName || disconnecting.clientId, " loses its grant at once and its next call is refused. An access token it still holds dies with its own short expiry. The other agents are untouched, and nothing this one already did is undone."] }) })), disconnectingEvery && (_jsxs(Dialog, { title: "Disconnect every agent?", onClose: () => setDisconnectingEvery(false), returnFocusRef: returnFocusRef, footerButtons: [
122
+ {
123
+ buttonType: 'default',
124
+ content: 'Keep them',
125
+ onClick: () => setDisconnectingEvery(false),
126
+ },
127
+ {
128
+ buttonType: 'danger',
129
+ content: 'Disconnect all',
130
+ onClick: confirmDisconnectEvery,
131
+ disabled: disconnectEvery.isPending,
132
+ },
133
+ ], children: [_jsx(Text, { sx: { fontSize: 1 }, children: "Every agent you have authorized loses its grant at once \u2014 signing out everywhere. Each will ask again the next time you connect it, and this time it goes through the approval screen rather than being answered from what you agreed before, so this is also how you force a fresh approval." }), _jsx(Text, { as: "p", sx: { fontSize: 1, color: 'fg.muted', mt: 2, mb: 0 }, children: "Yours only. Nobody else\u2019s sessions end, in this organization or any other, and nothing any agent already did is undone." })] }))] }));
134
+ };
135
+ export default ConnectedAgents;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * One console for an administrator of an organization, rather than four
3
+ * unrelated settings tabs.
4
+ *
5
+ * Every page here is the person's own view of the same Core pieces with the
6
+ * organization as the scope: the audit page *is* the audit view, the
7
+ * observability page *is* the observability view. There is one component to
8
+ * test per surface, and an administrator who has learned the personal page
9
+ * has learned this one.
10
+ *
11
+ * Milestone 1 carried Overview, Agents, Audit and Observability, read-only
12
+ * over what exists. **Service Agents** joins them in milestone 3, and is the
13
+ * one page here that *writes*: an organization's own principals, created,
14
+ * rotated and revoked from it. Teams, Policies, Quotas, Alerts, Approvals
15
+ * and Runs join as the layers behind them ship; the sub-navigation says so
16
+ * rather than hiding what is coming.
17
+ *
18
+ * Roles: an `organization_owner` sees everything; an
19
+ * `organization_security_auditor` sees the Overview, the Service Agents,
20
+ * the Audit and the Observability, which is the directory an auditor asks
21
+ * for — the service agents because an audit row naming `agent_uid` needs
22
+ * somewhere to say what that agent is, and the list carries no key; an
23
+ * `organization_usage_reviewer` sees the Overview. Anyone else is told
24
+ * plainly that this is not theirs to read.
25
+ *
26
+ * The auditor's view of Service Agents is read-only, and the page is told
27
+ * so rather than working it out: IAM refuses their writes either way, and a
28
+ * button that exists to be refused is worse than no button.
29
+ *
30
+ * @module views/mcp/EnterpriseConsole
31
+ */
32
+ import type { JSX } from 'react';
33
+ import type { McpAuditFilters } from '../../api/mcp';
34
+ import { type McpObservabilityPane } from './McpObservability';
35
+ import { type McpErrorStateFn, type McpRoutes } from './types';
36
+ /** The pages milestone 1 carries. */
37
+ export type EnterpriseConsolePage = 'overview' | 'usage' | 'agents' | 'service-agents' | 'policy' | 'teams' | 'identity-providers' | 'alerts' | 'approvals' | 'audit' | 'observability';
38
+ export declare const ENTERPRISE_CONSOLE_PAGES: {
39
+ id: EnterpriseConsolePage;
40
+ label: string;
41
+ }[];
42
+ /** Which pages each organization role may read. */
43
+ export declare const pagesForRoles: (roles: string[]) => EnterpriseConsolePage[];
44
+ export interface EnterpriseConsoleProps {
45
+ /** The application's words for a failed request. */
46
+ errorState: McpErrorStateFn;
47
+ /** Where this application puts the surfaces this view links to. */
48
+ routes: McpRoutes;
49
+ /** The organization this console is of. */
50
+ organization: {
51
+ uid: string;
52
+ handle: string;
53
+ name?: string;
54
+ };
55
+ /** The roles the signed-in person holds in this organization. */
56
+ roles: string[];
57
+ /** The page open; the address owns it. */
58
+ page: EnterpriseConsolePage;
59
+ onPageChange: (page: EnterpriseConsolePage) => void;
60
+ /** The audit page's filters, as the address holds them. */
61
+ auditFilters: McpAuditFilters;
62
+ onAuditFiltersChange: (filters: McpAuditFilters) => void;
63
+ /** The observability page's selection, likewise. */
64
+ observabilityPane: McpObservabilityPane;
65
+ onObservabilityPaneChange: (pane: McpObservabilityPane) => void;
66
+ observabilityTask?: string;
67
+ observabilityTrace?: string;
68
+ onObservabilitySelect: (selection: {
69
+ task?: string;
70
+ trace?: string;
71
+ }) => void;
72
+ }
73
+ export declare const EnterpriseConsole: ({ errorState, routes, organization, roles, page, onPageChange, auditFilters, onAuditFiltersChange, observabilityPane, onObservabilityPaneChange, observabilityTask, observabilityTrace, onObservabilitySelect, }: EnterpriseConsoleProps) => JSX.Element;
74
+ export default EnterpriseConsole;