@jini-ai/ui 0.7.3-next.2 → 0.7.3-next.3

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 (281) hide show
  1. package/README.md +3 -3
  2. package/dist/browser/index.d.ts +2 -0
  3. package/dist/browser/index.js +2 -0
  4. package/dist/browser/mount-renderer.d.ts +33 -0
  5. package/dist/browser/mount-renderer.js +14 -0
  6. package/dist/browser/useDismissibleDropdown.d.ts +50 -0
  7. package/dist/browser/useDismissibleDropdown.js +49 -0
  8. package/dist/core.d.ts +4 -4
  9. package/dist/core.js +4 -1
  10. package/dist/features/admin-widgets/components/InfoTip.js +5 -5
  11. package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +1 -1
  12. package/dist/features/admin-widgets/components/InfoTip.rules.js +1 -1
  13. package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -3
  14. package/dist/features/admin-widgets/components/Select/Select.js +7 -7
  15. package/dist/features/app-shell/SiteToast.d.ts +24 -0
  16. package/dist/features/app-shell/SiteToast.js +9 -0
  17. package/dist/features/app-shell/copyable-details.d.ts +12 -0
  18. package/dist/features/app-shell/copyable-details.js +17 -0
  19. package/dist/features/app-shell/expanded-mode.d.ts +76 -0
  20. package/dist/features/app-shell/expanded-mode.js +70 -0
  21. package/dist/features/app-shell/index.d.ts +8 -0
  22. package/dist/features/app-shell/index.js +8 -0
  23. package/dist/features/app-shell/use-delete-confirmation.hooks.d.ts +48 -0
  24. package/dist/features/app-shell/use-delete-confirmation.hooks.js +57 -0
  25. package/dist/features/app-shell/use-expanded-mode.hooks.d.ts +19 -0
  26. package/dist/features/app-shell/use-expanded-mode.hooks.js +39 -0
  27. package/dist/features/app-shell/use-site-toast.hooks.d.ts +56 -0
  28. package/dist/features/app-shell/use-site-toast.hooks.js +44 -0
  29. package/dist/features/app-shell/use-theme-preference.hooks.d.ts +30 -0
  30. package/dist/features/app-shell/use-theme-preference.hooks.js +42 -0
  31. package/dist/features/app-version/use-app-version.d.ts +53 -0
  32. package/dist/features/app-version/use-app-version.js +42 -0
  33. package/dist/features/asset-grid/react/components/AssetGrid.d.ts +1 -1
  34. package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
  35. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +1 -1
  36. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
  37. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +2 -2
  38. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +1 -1
  39. package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +1 -1
  40. package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +1 -1
  41. package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
  42. package/dist/features/charts/table.js +4 -4
  43. package/dist/features/command-palette/index.d.ts +1 -0
  44. package/dist/features/command-palette/index.js +1 -0
  45. package/dist/features/command-palette/react/components/CommandPalette.d.ts +9 -9
  46. package/dist/features/command-palette/react/components/CommandPalette.hooks.js +28 -1
  47. package/dist/features/command-palette/react/components/CommandPalette.js +3 -5
  48. package/dist/features/connectors/ConnectorsBrowser.d.ts +1 -1
  49. package/dist/features/connectors/ConnectorsBrowser.js +2 -2
  50. package/dist/features/connectors/components/ConnectorCard.hooks.js +2 -2
  51. package/dist/features/connectors/components/ConnectorCard.js +4 -4
  52. package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +1 -1
  53. package/dist/features/connectors/components/ConnectorDetailDrawer.js +7 -7
  54. package/dist/features/connectors/components/ConnectorGrid.js +1 -1
  55. package/dist/features/connectors/components/ConnectorLogo.js +1 -1
  56. package/dist/features/connectors/components/ConnectorSearchBar.js +1 -1
  57. package/dist/features/connectors/components/ProviderTabBar.js +1 -1
  58. package/dist/features/execution/claude/env-fields.d.ts +1 -1
  59. package/dist/features/execution/codex/env-fields.d.ts +1 -1
  60. package/dist/features/execution/constants.d.ts +2 -2
  61. package/dist/features/execution/constants.js +1 -1
  62. package/dist/features/execution/dependencies.d.ts +2 -3
  63. package/dist/features/execution/http-adapter.d.ts +2 -3
  64. package/dist/features/execution/index.d.ts +0 -2
  65. package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +1 -1
  66. package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +1 -1
  67. package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -1
  68. package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -2
  69. package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +2 -2
  70. package/dist/features/execution/react/components/ByokProviderForm.js +15 -4
  71. package/dist/features/execution/react/components/ExecutionTab.d.ts +2 -3
  72. package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +14 -4
  73. package/dist/features/execution/react/components/ExecutionTab.hooks.js +66 -9
  74. package/dist/features/execution/react/components/ExecutionTab.js +27 -10
  75. package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -4
  76. package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -4
  77. package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +3 -3
  78. package/dist/features/execution/react/components/LocalCliAgentSettings.d.ts +2 -2
  79. package/dist/features/execution/react/components/ProviderChipGroup.d.ts +1 -1
  80. package/dist/features/execution/react/components/SearchableModelSelect.d.ts +1 -1
  81. package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.d.ts +2 -2
  82. package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
  83. package/dist/features/execution/react/hooks/useExecutionTab.d.ts +2 -3
  84. package/dist/features/execution/react/hooks/useLocalCliAgentCard.d.ts +4 -4
  85. package/dist/features/execution/react/hooks/useLocalCliAgentList.d.ts +4 -4
  86. package/dist/features/execution/react/hooks/useReasoningControl.d.ts +3 -3
  87. package/dist/features/execution/rules.d.ts +6 -6
  88. package/dist/features/execution/rules.js +1 -1
  89. package/dist/features/external-mcp/react/components/ExternalMcpTab.js +4 -4
  90. package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +1 -1
  91. package/dist/features/file-dropzone/react/components/FileDropzone.js +1 -1
  92. package/dist/features/find/find-bar-state.d.ts +58 -0
  93. package/dist/features/find/find-bar-state.js +45 -0
  94. package/dist/features/find/find-focus-clock.d.ts +19 -0
  95. package/dist/features/find/find-focus-clock.js +9 -0
  96. package/dist/features/find/find-input-focus.d.ts +88 -0
  97. package/dist/features/find/find-input-focus.js +88 -0
  98. package/dist/features/find/find-target.d.ts +141 -0
  99. package/dist/features/find/find-target.js +160 -0
  100. package/dist/features/find/index.d.ts +10 -0
  101. package/dist/features/find/index.js +10 -0
  102. package/dist/features/find/use-find-bar-effects.hooks.d.ts +14 -0
  103. package/dist/features/find/use-find-bar-effects.hooks.js +92 -0
  104. package/dist/features/find/use-find-bar-state.hooks.d.ts +43 -0
  105. package/dist/features/find/use-find-bar-state.hooks.js +49 -0
  106. package/dist/features/find/use-find-focus-reclaim.hooks.d.ts +21 -0
  107. package/dist/features/find/use-find-focus-reclaim.hooks.js +64 -0
  108. package/dist/features/find/use-find-input-binding.hooks.d.ts +18 -0
  109. package/dist/features/find/use-find-input-binding.hooks.js +76 -0
  110. package/dist/features/find-bar/FindBar.d.ts +41 -0
  111. package/dist/features/find-bar/FindBar.js +31 -0
  112. package/dist/features/find-bar/index.d.ts +2 -0
  113. package/dist/features/find-bar/index.js +2 -0
  114. package/dist/features/folder-path-drop/index.d.ts +3 -1
  115. package/dist/features/folder-path-drop/index.js +1 -0
  116. package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.d.ts +50 -0
  117. package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.js +50 -0
  118. package/dist/features/folder-path-drop/types.d.ts +14 -0
  119. package/dist/features/i18n/context.d.ts +1 -1
  120. package/dist/features/i18n/context.js +1 -1
  121. package/dist/features/iframe-pool/react/dom-sync.d.ts +13 -3
  122. package/dist/features/iframe-pool/react/dom-sync.js +7 -7
  123. package/dist/features/import-handoff/use-import-handoff.d.ts +38 -0
  124. package/dist/features/import-handoff/use-import-handoff.js +40 -0
  125. package/dist/features/integrations/rules.js +39 -41
  126. package/dist/features/interactive-ui/interactive-ui.css +1 -1
  127. package/dist/features/interactive-ui/providers/native/data-table.js +1 -1
  128. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +1 -1
  129. package/dist/features/interactive-ui/providers/shadcn/data-table.js +3 -3
  130. package/dist/features/interactive-ui/providers/shadcn/radio-group-field.js +1 -1
  131. package/dist/features/live-views/index.d.ts +6 -0
  132. package/dist/features/live-views/index.js +6 -0
  133. package/dist/features/live-views/use-live-views.d.ts +31 -0
  134. package/dist/features/live-views/use-live-views.js +88 -0
  135. package/dist/features/live-views/use-site-view-preference.d.ts +33 -0
  136. package/dist/features/live-views/use-site-view-preference.js +32 -0
  137. package/dist/features/live-views/use-webview-load-failure.d.ts +90 -0
  138. package/dist/features/live-views/use-webview-load-failure.js +122 -0
  139. package/dist/features/mcp-ui/credential-card.d.ts +1 -0
  140. package/dist/features/mcp-ui/credential-card.js +1 -1
  141. package/dist/features/mcp-ui/surfaces/tool-approval.d.ts +10 -0
  142. package/dist/features/mcp-ui/surfaces/tool-approval.js +15 -0
  143. package/dist/features/media-providers/dependencies.d.ts +7 -1
  144. package/dist/features/media-providers/dependencies.js +43 -0
  145. package/dist/features/media-providers/index.d.ts +2 -2
  146. package/dist/features/media-providers/index.js +1 -1
  147. package/dist/features/media-providers/ports.d.ts +39 -5
  148. package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -3
  149. package/dist/features/media-providers/react/components/MediaProvidersTab.js +1 -1
  150. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.d.ts +3 -2
  151. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +41 -3
  152. package/dist/features/memory/react/components/MemoryConnectedPanel.js +2 -2
  153. package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
  154. package/dist/features/memory/react/components/MemoryHooksPanel.js +2 -2
  155. package/dist/features/memory/react/components/MemoryList.js +2 -2
  156. package/dist/features/memory/react/components/MemorySettingsPanel.js +2 -2
  157. package/dist/features/memory/react/components/MemorySuggestionPanel.js +1 -1
  158. package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +3 -3
  159. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +4 -1
  160. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +1 -1
  161. package/dist/features/memory/react/render-markdown.js +1 -1
  162. package/dist/features/nav-availability/nav-availability.d.ts +18 -0
  163. package/dist/features/nav-availability/nav-availability.js +12 -0
  164. package/dist/features/number-stepper/NumberStepper.d.ts +39 -0
  165. package/dist/features/number-stepper/NumberStepper.js +16 -0
  166. package/dist/features/number-stepper/index.d.ts +5 -0
  167. package/dist/features/number-stepper/index.js +5 -0
  168. package/dist/features/number-stepper/number-stepper.d.ts +34 -0
  169. package/dist/features/number-stepper/number-stepper.js +32 -0
  170. package/dist/features/number-stepper/use-number-stepper.hooks.d.ts +20 -0
  171. package/dist/features/number-stepper/use-number-stepper.hooks.js +29 -0
  172. package/dist/features/number-stepper/use-optimistic-number-setting.hooks.d.ts +36 -0
  173. package/dist/features/number-stepper/use-optimistic-number-setting.hooks.js +25 -0
  174. package/dist/features/panel-kit/ErrorNotice.js +8 -1
  175. package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +1 -1
  176. package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +1 -1
  177. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +1 -37
  178. package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +2 -1
  179. package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +2 -1
  180. package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +2 -1
  181. package/dist/features/panel-kit/index.d.ts +2 -1
  182. package/dist/features/privacy/react/components/PrivacyTab.d.ts +1 -1
  183. package/dist/features/privacy/react/components/PrivacyTab.js +1 -1
  184. package/dist/features/progress-card/components/ProgressCard.d.ts +1 -1
  185. package/dist/features/progress-card/components/ProgressCard.js +1 -1
  186. package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +1 -1
  187. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +1 -1
  188. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +1 -1
  189. package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
  190. package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +7 -2
  191. package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
  192. package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +1 -1
  193. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
  194. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
  195. package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
  196. package/dist/features/resource-dashboard/react/components/StatusPill.js +1 -1
  197. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +6 -1
  198. package/dist/features/resource-monitor/ResourceTable.d.ts +67 -0
  199. package/dist/features/resource-monitor/ResourceTable.js +25 -0
  200. package/dist/features/resource-monitor/index.d.ts +4 -0
  201. package/dist/features/resource-monitor/index.js +4 -0
  202. package/dist/features/resource-monitor/resource-stop.d.ts +16 -0
  203. package/dist/features/resource-monitor/resource-stop.js +11 -0
  204. package/dist/features/resource-monitor/use-resource-readings.hooks.d.ts +44 -0
  205. package/dist/features/resource-monitor/use-resource-readings.hooks.js +91 -0
  206. package/dist/features/settings/dialog/styles/settings-dialog.css +251 -251
  207. package/dist/features/site-card/index.d.ts +4 -1
  208. package/dist/features/site-card/index.js +3 -0
  209. package/dist/features/site-card/use-created-site-return.hooks.d.ts +36 -0
  210. package/dist/features/site-card/use-created-site-return.hooks.js +43 -0
  211. package/dist/features/site-card/use-site-card-preview.hooks.d.ts +39 -0
  212. package/dist/features/site-card/use-site-card-preview.hooks.js +31 -0
  213. package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +29 -8
  214. package/dist/features/site-card/use-site-list-prefs.hooks.js +56 -9
  215. package/dist/features/site-card/use-site-preview.hooks.d.ts +67 -0
  216. package/dist/features/site-card/use-site-preview.hooks.js +94 -0
  217. package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +2 -2
  218. package/dist/features/sketch-editor/react/components/SketchEditor.js +1 -1
  219. package/dist/features/skills/react/components/SkillRow.js +1 -1
  220. package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +2 -2
  221. package/dist/features/source-config-list/react/components/SourceConfigField.js +1 -1
  222. package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +5 -5
  223. package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
  224. package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
  225. package/dist/features/source-config-list/react/components/SourceConfigListView.js +3 -3
  226. package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +1 -1
  227. package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +1 -1
  228. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +1 -1
  229. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +1 -1
  230. package/dist/features/tab-strip/react/components/TabBar.js +2 -2
  231. package/dist/features/tab-strip/react/components/TabStrip.d.ts +1 -1
  232. package/dist/features/tab-strip/react/components/TabStrip.js +1 -1
  233. package/dist/features/tab-strip/scrollable.js +0 -2
  234. package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
  235. package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
  236. package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +1 -1
  237. package/dist/features/version-manager/react/components/VersionManagerModal.js +1 -1
  238. package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +2 -2
  239. package/dist/features/viewer-shell/react/components/CommentSidePanel.js +1 -1
  240. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +1 -1
  241. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +1 -1
  242. package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
  243. package/dist/features/viewer-shell/react/components/SegmentedToggle.js +1 -1
  244. package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +1 -1
  245. package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
  246. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
  247. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +1 -1
  248. package/dist/features/zoom/use-zoom.d.ts +141 -0
  249. package/dist/features/zoom/use-zoom.js +204 -0
  250. package/dist/index.d.ts +1 -0
  251. package/dist/index.js +1 -0
  252. package/dist/react/components/ComponentKitPreview.d.ts +1 -1
  253. package/dist/react/components/ComponentKitPreview.js +1 -1
  254. package/dist/react/components/CustomSelect.js +1 -1
  255. package/dist/react/components/ExportDiagnosticsButton.d.ts +6 -2
  256. package/dist/react/components/ExportDiagnosticsButton.js +3 -3
  257. package/dist/react/components/FileImportPanel.js +1 -1
  258. package/dist/react/components/IconFrame.d.ts +15 -0
  259. package/dist/react/components/IconFrame.js +11 -0
  260. package/dist/react/components/ImportChoice.js +1 -1
  261. package/dist/react/components/Notice.js +1 -1
  262. package/dist/react/components/OnboardingDropdown.js +1 -1
  263. package/dist/react/components/PaletteTweaks.js +1 -1
  264. package/dist/react/components/TooltipLayer.d.ts +13 -3
  265. package/dist/react/components/TooltipLayer.js +12 -12
  266. package/dist/react/mcp-ui/host-message-source.d.ts +3 -1
  267. package/dist/react/mcp-ui/host-message-source.js +1 -1
  268. package/dist/react/testing.js +3 -1
  269. package/dist/renderers/annotation-canvas/rules.js +30 -27
  270. package/dist/renderers/react/components/ArtifactView.js +1 -1
  271. package/dist/renderers/renderers/markdown.d.ts +3 -1
  272. package/dist/renderers/renderers/markdown.js +2 -2
  273. package/dist/styles/admin.css +54 -54
  274. package/dist/utils/zip.js +43 -36
  275. package/package.json +66 -9
  276. package/dist/features/execution/ports.d.ts +0 -71
  277. package/dist/features/execution/ports.js +0 -2
  278. package/dist/features/execution/types.d.ts +0 -472
  279. package/dist/features/execution/types.js +0 -2
  280. package/dist/react/components/CustomSelectMarkup.d.ts +0 -27
  281. package/dist/react/components/CustomSelectMarkup.js +0 -35
@@ -18,7 +18,7 @@ function ResourceBoardViewPill({ viewMode, onViewModeChange, viewToggleAriaLabel
18
18
  * DesignsTab's toolbar: sub-tab sort pills + a create button + search +
19
19
  * select-mode/bulk-delete bar (grid view only) + the grid/kanban view
20
20
  * toggle. The origin's manual-refresh button and 15s auto-refresh polling
21
- * are deliberately NOT ported — see `archived UI source map`'s "Dropped"
21
+ * are deliberately NOT ported — see `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/"), its "Dropped"
22
22
  * list; a host wanting that composes its own refresh affordance around the
23
23
  * hook's `reload()`.
24
24
  */
@@ -1,4 +1,4 @@
1
- import type { KeyboardEvent, RefObject } from 'react';
1
+ import { type KeyboardEvent, type RefObject } from 'react';
2
2
  import type { ResourceBoardItem, ResourceMenuActionSpec, ResourceStatusToneMap } from '../../types.js';
3
3
  /** The card's own class list: `is-selected` and `select-mode` modifiers on top of the base class. */
4
4
  export declare function resourceCardClassName({ selected, selectMode }: {
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
2
3
  import { StatusPill } from './StatusPill.js';
3
4
  import { menuFocusIndex } from '../../../../browser/useMenuKeyboard.js';
4
5
  /** The card's own class list: `is-selected` and `select-mode` modifiers on top of the base class. */
@@ -11,10 +12,14 @@ export function isCardActivationKey(event) {
11
12
  }
12
13
  /** The open kebab menu's items: arrow keys move between them, Escape reaches the board's dismiss listener, and other clicks and keydowns never bubble to the card. */
13
14
  export function ResourceCardMenuItems({ menuActions, busy, menuActionLabel, onAction, }) {
14
- return (_jsx("div", { className: "jini-resource-board-card-menu", role: "menu", onClick: (event) => event.stopPropagation(), onKeyDown: (event) => {
15
+ const menuRef = useRef(null);
16
+ useEffect(() => {
17
+ menuRef.current?.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
18
+ }, []);
19
+ return (_jsx("div", { className: "jini-resource-board-card-menu", role: "menu", ref: menuRef, onClick: (event) => event.stopPropagation(), onKeyDown: (event) => {
15
20
  if (event.key !== 'Escape')
16
21
  event.stopPropagation();
17
- const entries = [...event.currentTarget.querySelectorAll('[role="menuitem"]')];
22
+ const entries = [...event.currentTarget.querySelectorAll('[role="menuitem"]:not(:disabled)')];
18
23
  const next = menuFocusIndex({ key: event.key, current: entries.findIndex((entry) => entry === event.target), count: entries.length });
19
24
  if (next === null)
20
25
  return;
@@ -40,7 +40,7 @@ export interface ResourceRowListViewProps {
40
40
  * "your automations" row-list section — loading, a clickable empty state
41
41
  * (TasksView's own empty state is itself the create button), or the rows.
42
42
  * The template-gallery and proposals-review sections are deliberately NOT
43
- * part of this primitive — see `archived UI source map`'s "Dropped"
43
+ * part of this primitive — see `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/"), its "Dropped"
44
44
  * list (create-flow and automation-evolution-specific concerns, no
45
45
  * DesignsTab analog at all).
46
46
  */
@@ -6,7 +6,7 @@ import { ResourceRowListAlerts, ResourceRowListEmpty, ResourceRowListHero, Resou
6
6
  * "your automations" row-list section — loading, a clickable empty state
7
7
  * (TasksView's own empty state is itself the create button), or the rows.
8
8
  * The template-gallery and proposals-review sections are deliberately NOT
9
- * part of this primitive — see `archived UI source map`'s "Dropped"
9
+ * part of this primitive — see `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/"), its "Dropped"
10
10
  * list (create-flow and automation-evolution-specific concerns, no
11
11
  * DesignsTab analog at all).
12
12
  */
@@ -15,7 +15,7 @@ export interface ResourceRunHistoryListProps {
15
15
  * `AutomationRunHistory`: a small header, a loading/empty state, or a flat
16
16
  * list of past runs each showing a `StatusPill` + timing + an optional
17
17
  * error/summary message + host-defined actions (the origin's "crystallize"/
18
- * "view progress" buttons, generalized — see `archived UI source map`
18
+ * "view progress" buttons, generalized — see `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/")
19
19
  * for what crystallize's own OD-specific workflow dropped).
20
20
  */
21
21
  export declare function ResourceRunHistoryList({ items, loading, titleLabel, loadingLabel, emptyLabel, statusLabel, toneMap, onAction, }: ResourceRunHistoryListProps): import("react").JSX.Element;
@@ -5,7 +5,7 @@ import { StatusPill } from './StatusPill.js';
5
5
  * `AutomationRunHistory`: a small header, a loading/empty state, or a flat
6
6
  * list of past runs each showing a `StatusPill` + timing + an optional
7
7
  * error/summary message + host-defined actions (the origin's "crystallize"/
8
- * "view progress" buttons, generalized — see `archived UI source map`
8
+ * "view progress" buttons, generalized — see `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/")
9
9
  * for what crystallize's own OD-specific workflow dropped).
10
10
  */
11
11
  export function ResourceRunHistoryList({ items, loading, titleLabel, loadingLabel, emptyLabel, statusLabel, toneMap, onAction, }) {
@@ -11,7 +11,7 @@ export interface StatusPillProps {
11
11
  * card badge and TasksView's `StatusPill` (`automation-status is-${status}`)
12
12
  * — both origins render "a status value as a small colored label," just at
13
13
  * different nesting depths (DesignsTab: top-level item; TasksView: a run
14
- * nested inside a row). See `archived UI source map` for the full
14
+ * nested inside a row). See `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/") for the full
15
15
  * shared-vs-separate verdict this component is the "shared" half of.
16
16
  */
17
17
  export declare function StatusPill({ status, label, toneMap }: StatusPillProps): import("react").JSX.Element;
@@ -6,7 +6,7 @@ import { statusToneFor } from '../../rules.js';
6
6
  * card badge and TasksView's `StatusPill` (`automation-status is-${status}`)
7
7
  * — both origins render "a status value as a small colored label," just at
8
8
  * different nesting depths (DesignsTab: top-level item; TasksView: a run
9
- * nested inside a row). See `archived UI source map` for the full
9
+ * nested inside a row). See `070311a07^:packages/ui/source-map.md` (section "features/resource-dashboard/") for the full
10
10
  * shared-vs-separate verdict this component is the "shared" half of.
11
11
  */
12
12
  export function StatusPill({ status, label, toneMap }) {
@@ -82,8 +82,13 @@ function useBoardMenu() {
82
82
  if (!openMenuId)
83
83
  return undefined;
84
84
  const onKey = (event) => {
85
- if (event.key === 'Escape')
85
+ if (event.key === 'Escape') {
86
+ // Only Escape hands focus back to the trigger: a keyboard user dismissing the menu would
87
+ // otherwise land on <body>. An outside click already moved focus to whatever was clicked,
88
+ // so stealing it back there would fight the user. Focus first, then unmount the menu.
89
+ menuContainerRef.current?.querySelector("button.jini-resource-board-card-more")?.focus();
86
90
  setOpenMenuId(null);
91
+ }
87
92
  };
88
93
  const onPointerDown = (event) => {
89
94
  const container = menuContainerRef.current;
@@ -0,0 +1,67 @@
1
+ /** One reading; `null`/absent is an unmeasured value, never a zero. `memoryMetric` names the source of `rssBytes`. */
2
+ export interface ResourceReading<K extends string = string> {
3
+ rssBytes?: number | null;
4
+ cpuPercent?: number | null;
5
+ memoryMetric?: K;
6
+ }
7
+ /** One process row. `name` is an executable basename, never command arguments. */
8
+ export interface ResourceProcessRow<K extends string = string, R extends string = string> extends ResourceReading<K> {
9
+ pid: number;
10
+ name: string;
11
+ role: R;
12
+ }
13
+ /** One table section: an owner (the host app itself, or one of the things it runs), its subtotal and its processes. */
14
+ export interface ResourceTableGroup<M extends ResourceReading = ResourceReading, P extends ResourceProcessRow = ResourceProcessRow> {
15
+ id: string;
16
+ title: string;
17
+ metrics?: M;
18
+ processes: readonly P[];
19
+ /** Only groups the host can stop carry a Stop; `null` (e.g. the host app itself) has none. */
20
+ stop: {
21
+ label: string;
22
+ disabled: boolean;
23
+ } | null;
24
+ }
25
+ /** Column headings and spoken words; product copy comes from the host. */
26
+ export interface ResourceTableLabels {
27
+ caption: string;
28
+ process: string;
29
+ pid: string;
30
+ memory: string;
31
+ cpu: string;
32
+ actions: string;
33
+ unavailable: string;
34
+ }
35
+ /** Host formatting policy for figures, warnings and role tags (an empty role tag renders nothing). */
36
+ export interface ResourceTableFormat<M extends ResourceReading, P extends ResourceProcessRow> {
37
+ /** `reading` is the group subtotal or process row the figure came from (its `memoryMetric` names the source). */
38
+ memory: (required: {
39
+ bytes: number;
40
+ reading: M | P;
41
+ }) => string;
42
+ cpu: (required: {
43
+ percent: number;
44
+ }) => string;
45
+ warning: (required: {
46
+ metrics: M | undefined;
47
+ }) => string;
48
+ role: (required: {
49
+ role: P['role'];
50
+ }) => string;
51
+ }
52
+ /** Host class added for text kept for screen readers only (the host's visually-hidden utility). */
53
+ export interface ResourceTableClassNames {
54
+ visuallyHidden?: string;
55
+ }
56
+ export interface ResourceTableProps<M extends ResourceReading, P extends ResourceProcessRow> {
57
+ groups: readonly ResourceTableGroup<M, P>[];
58
+ onStop: (required: {
59
+ id: string;
60
+ }, options?: {}) => void;
61
+ labels: ResourceTableLabels;
62
+ format: ResourceTableFormat<M, P>;
63
+ classNames?: ResourceTableClassNames;
64
+ }
65
+ /** Process | PID | Memory | CPU, grouped by owner; stateless, so the host owns polling and Stop. O(s+p). */
66
+ export declare function ResourceTable<M extends ResourceReading, P extends ResourceProcessRow>({ groups, onStop, labels, format, classNames }: ResourceTableProps<M, P>): import("react").JSX.Element;
67
+ //# sourceMappingURL=ResourceTable.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const hiddenClass = (host) => (host ? `jini-resources-table__hidden ${host}` : 'jini-resources-table__hidden');
3
+ /** A dash for an unknown reading, spoken as "unavailable", never a zero. O(1). */
4
+ function Unknown({ label, hidden }) {
5
+ return _jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: hidden, children: label })] });
6
+ }
7
+ /** Memory and CPU cells; CPU is whatever the host's `format.cpu` says (a note under the table can explain it). O(1). */
8
+ function MetricCells({ reading, labels, format, hidden }) {
9
+ const cpuPercent = reading?.cpuPercent;
10
+ return _jsxs(_Fragment, { children: [_jsx("td", { className: "jini-resources-table__num", children: reading?.rssBytes == null ? _jsx(Unknown, { label: labels.unavailable, hidden: hidden }) : format.memory({ bytes: reading.rssBytes, reading }) }), _jsx("td", { className: "jini-resources-table__num", children: cpuPercent == null ? _jsx(Unknown, { label: labels.unavailable, hidden: hidden }) : format.cpu({ percent: cpuPercent }) })] });
11
+ }
12
+ /** One `<tbody>` per group: a heading row with the subtotal (and Stop), then its processes. O(p) for the group's p processes. */
13
+ function ResourceGroupRows({ group, onStop, ...shared }) {
14
+ const warning = shared.format.warning({ metrics: group.metrics });
15
+ return _jsxs("tbody", { children: [_jsxs("tr", { className: "jini-resources-table__group", children: [_jsxs("th", { scope: "rowgroup", colSpan: 2, children: [group.title, warning && _jsxs("span", { className: "jini-resources-table__warning", children: [" \u00B7 ", warning] })] }), _jsx(MetricCells, { reading: group.metrics, ...shared }), _jsx("td", { className: "jini-resources-table__action", children: group.stop && _jsx("button", { type: "button", disabled: group.stop.disabled, onClick: () => onStop({ id: group.id }), children: group.stop.label }) })] }), group.processes.map((row) => {
16
+ const role = shared.format.role({ role: row.role });
17
+ return _jsxs("tr", { children: [_jsxs("td", { className: "jini-resources-table__process", children: [row.name, role && _jsx("span", { className: "jini-resources-table__role", children: role })] }), _jsx("td", { className: "jini-resources-table__num", children: row.pid }), _jsx(MetricCells, { reading: row, ...shared }), _jsx("td", {})] }, row.pid);
18
+ })] });
19
+ }
20
+ /** Process | PID | Memory | CPU, grouped by owner; stateless, so the host owns polling and Stop. O(s+p). */
21
+ export function ResourceTable({ groups, onStop, labels, format, classNames = {} }) {
22
+ const hidden = hiddenClass(classNames.visuallyHidden);
23
+ return _jsxs("table", { className: "jini-resources-table", children: [_jsx("caption", { className: hidden, children: labels.caption }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: labels.process }), _jsx("th", { scope: "col", className: "jini-resources-table__num", children: labels.pid }), _jsx("th", { scope: "col", className: "jini-resources-table__num", children: labels.memory }), _jsx("th", { scope: "col", className: "jini-resources-table__num", children: labels.cpu }), _jsx("th", { scope: "col", children: _jsx("span", { className: hidden, children: labels.actions }) })] }) }), groups.map((group) => _jsx(ResourceGroupRows, { group: group, onStop: onStop, labels: labels, format: format, hidden: hidden }, group.id))] });
24
+ }
25
+ //# sourceMappingURL=ResourceTable.js.map
@@ -0,0 +1,4 @@
1
+ export { useResourceReadings, type ResourceReadingsPorts, type ResourceReadingsRequest, type ResourceReadingsSnapshot, } from "./use-resource-readings.hooks.js";
2
+ export { createResourceStop, type StoppableSite } from "./resource-stop.js";
3
+ export { ResourceTable, type ResourceProcessRow, type ResourceReading, type ResourceTableClassNames, type ResourceTableFormat, type ResourceTableGroup, type ResourceTableLabels, type ResourceTableProps, } from './ResourceTable.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { useResourceReadings, } from "./use-resource-readings.hooks.js";
2
+ export { createResourceStop } from "./resource-stop.js";
3
+ export { ResourceTable, } from './ResourceTable.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,16 @@
1
+ /** The minimal site fields the stop policy reads. */
2
+ export interface StoppableSite {
3
+ readonly id: string;
4
+ readonly externalUrl?: string | null;
5
+ readonly status: string;
6
+ }
7
+ /** Stop only locally managed sites which are currently running. */
8
+ export declare function createResourceStop<TSite extends StoppableSite>({ projects, power }: {
9
+ projects: readonly TSite[];
10
+ power: {
11
+ toggle: (site: TSite) => unknown;
12
+ };
13
+ }, _options?: {}): ({ id }: {
14
+ id: string;
15
+ }, _options?: {}) => void;
16
+ //# sourceMappingURL=resource-stop.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** Stop only locally managed sites which are currently running. */
2
+ export function createResourceStop({ projects, power }, _options = {}) {
3
+ const byId = new Map(projects.map((site) => [site.id, site]));
4
+ const onStop = ({ id }, _options = {}) => {
5
+ const site = byId.get(id);
6
+ if (site && !site.externalUrl && site.status === "running")
7
+ void power.toggle(site);
8
+ };
9
+ return onStop;
10
+ }
11
+ //# sourceMappingURL=resource-stop.js.map
@@ -0,0 +1,44 @@
1
+ /** The one request field the sampler receives: an open panel asks for the faster cadence. */
2
+ export interface ResourceReadingsRequest {
3
+ panelOpen: boolean;
4
+ }
5
+ /** The only snapshot field this hook reads: the sampler's cadence for the next visible poll. */
6
+ export interface ResourceReadingsSnapshot {
7
+ readonly pollIntervalMs: number;
8
+ }
9
+ /** Effects at the renderer boundary; fakes need neither a desktop shell nor real timers. */
10
+ export interface ResourceReadingsPorts<TSnapshot extends ResourceReadingsSnapshot> {
11
+ /** The host's sampler bridge lookup. `undefined` (or no `getResources`) means a stale preload: no polling. */
12
+ getBridge: () => {
13
+ getResources?: (input: ResourceReadingsRequest) => Promise<TSnapshot>;
14
+ } | undefined;
15
+ /** The visibility source: polling stops while it is hidden. */
16
+ document: {
17
+ readonly hidden: boolean;
18
+ addEventListener: (event: "visibilitychange", listener: () => void) => void;
19
+ removeEventListener: (event: "visibilitychange", listener: () => void) => void;
20
+ };
21
+ setTimer: (input: {
22
+ run: () => void;
23
+ delay: number;
24
+ }) => number;
25
+ clearTimer: (input: {
26
+ id: number;
27
+ }) => void;
28
+ }
29
+ /**
30
+ * Read one shared snapshot while the host document is visible. Returns null on IPC failure or
31
+ * stale preload; native errors never enter the UI. Cleanup removes the listener and timer.
32
+ * A shared promise serializes reads even when opening the panel replaces the effect mid-request.
33
+ * A changed refreshKey requests a reading after a site lifecycle change, retaining the normal cadence.
34
+ * Keep `ports` stable: it is an effect dependency.
35
+ * @example const snapshot = useResourceReadings({ panelOpen, ports });
36
+ * @complexity O(1) work/state per poll beyond the existing main-process IPC.
37
+ */
38
+ export declare function useResourceReadings<TSnapshot extends ResourceReadingsSnapshot>({ panelOpen, ports }: ResourceReadingsRequest & {
39
+ ports: ResourceReadingsPorts<TSnapshot>;
40
+ }, { refreshKey, retryDelayMs }?: {
41
+ refreshKey?: string;
42
+ retryDelayMs?: number;
43
+ }): TSnapshot | null;
44
+ //# sourceMappingURL=use-resource-readings.hooks.d.ts.map
@@ -0,0 +1,91 @@
1
+ /** Pull-only resource readings. The host's sampler owns sampling policy and process attribution. */
2
+ import { describeErrorForLog } from "@jini-ai/core/model-facing-tool-errors";
3
+ import { useEffect, useRef, useState } from "react";
4
+ /** A visibility change invalidates a pending reading; retry it before the next normal cadence. */
5
+ function pollDelay({ currentVisibility, snapshot, retryDelayMs }, _options = {}) {
6
+ if (!currentVisibility)
7
+ return 0;
8
+ // A failed IPC read has no main-process cadence; retry promptly instead of waiting a minute.
9
+ return snapshot?.pollIntervalMs ?? retryDelayMs;
10
+ }
11
+ /**
12
+ * Read one shared snapshot while the host document is visible. Returns null on IPC failure or
13
+ * stale preload; native errors never enter the UI. Cleanup removes the listener and timer.
14
+ * A shared promise serializes reads even when opening the panel replaces the effect mid-request.
15
+ * A changed refreshKey requests a reading after a site lifecycle change, retaining the normal cadence.
16
+ * Keep `ports` stable: it is an effect dependency.
17
+ * @example const snapshot = useResourceReadings({ panelOpen, ports });
18
+ * @complexity O(1) work/state per poll beyond the existing main-process IPC.
19
+ */
20
+ export function useResourceReadings({ panelOpen, ports }, { refreshKey, retryDelayMs = 5_000 } = {}) {
21
+ const [snapshot, setSnapshot] = useState(null);
22
+ const inFlight = useRef(null);
23
+ const failing = useRef(false);
24
+ useEffect(() => {
25
+ const bridge = ports.getBridge();
26
+ if (!bridge?.getResources)
27
+ return undefined;
28
+ const getResources = bridge.getResources.bind(bridge);
29
+ let active = true;
30
+ let pending = false;
31
+ let visibilityVersion = 0;
32
+ let timer;
33
+ /** Clear the scheduled read before hiding, refreshing or disposing this effect. */
34
+ function clearTimer() {
35
+ if (timer !== undefined)
36
+ ports.clearTimer({ id: timer });
37
+ timer = undefined;
38
+ }
39
+ /** Resolve failures locally: raw native/IPC messages may contain sensitive process details. */
40
+ function readOnce() {
41
+ return Promise.resolve().then(() => getResources({ panelOpen })).then((result) => {
42
+ failing.current = false;
43
+ return result;
44
+ }).catch((error) => {
45
+ if (!failing.current)
46
+ console.error("[resources] Could not read resource usage", describeErrorForLog({ err: error }));
47
+ failing.current = true;
48
+ return null;
49
+ });
50
+ }
51
+ /** Re-check visibility after awaiting another effect's read; never overlap IPC requests. */
52
+ async function poll() {
53
+ if (pending)
54
+ return;
55
+ pending = true;
56
+ await inFlight.current;
57
+ if (!active || ports.document.hidden) {
58
+ pending = false;
59
+ return;
60
+ }
61
+ const version = visibilityVersion;
62
+ const request = readOnce();
63
+ inFlight.current = request;
64
+ const next = await request;
65
+ inFlight.current = null;
66
+ pending = false;
67
+ if (!active || ports.document.hidden)
68
+ return;
69
+ const currentVisibility = version === visibilityVersion;
70
+ if (currentVisibility)
71
+ setSnapshot(next);
72
+ timer = ports.setTimer({ run: () => { void poll(); }, delay: pollDelay({ currentVisibility, snapshot: next, retryDelayMs }) });
73
+ }
74
+ /** A hidden document owns no timer. Returning to it asks main for a fresh/cached snapshot. */
75
+ function visibilityChanged() {
76
+ visibilityVersion++;
77
+ clearTimer();
78
+ if (!ports.document.hidden)
79
+ void poll();
80
+ }
81
+ ports.document.addEventListener("visibilitychange", visibilityChanged);
82
+ void poll();
83
+ return () => {
84
+ active = false;
85
+ clearTimer();
86
+ ports.document.removeEventListener("visibilitychange", visibilityChanged);
87
+ };
88
+ }, [panelOpen, ports, refreshKey, retryDelayMs]);
89
+ return snapshot;
90
+ }
91
+ //# sourceMappingURL=use-resource-readings.hooks.js.map