@jini-ai/ui 0.7.3-next.1 → 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 (305) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +3 -3
  3. package/dist/browser/index.d.ts +2 -0
  4. package/dist/browser/index.js +2 -0
  5. package/dist/browser/mount-renderer.d.ts +33 -0
  6. package/dist/browser/mount-renderer.js +14 -0
  7. package/dist/browser/useDismissibleDropdown.d.ts +50 -0
  8. package/dist/browser/useDismissibleDropdown.js +49 -0
  9. package/dist/core.d.ts +4 -4
  10. package/dist/core.js +4 -1
  11. package/dist/features/admin-widgets/components/InfoTip.js +5 -5
  12. package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +1 -1
  13. package/dist/features/admin-widgets/components/InfoTip.rules.js +1 -1
  14. package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -3
  15. package/dist/features/admin-widgets/components/Select/Select.js +7 -7
  16. package/dist/features/app-shell/SiteToast.d.ts +24 -0
  17. package/dist/features/app-shell/SiteToast.js +9 -0
  18. package/dist/features/app-shell/copyable-details.d.ts +12 -0
  19. package/dist/features/app-shell/copyable-details.js +17 -0
  20. package/dist/features/app-shell/expanded-mode.d.ts +76 -0
  21. package/dist/features/app-shell/expanded-mode.js +70 -0
  22. package/dist/features/app-shell/index.d.ts +8 -0
  23. package/dist/features/app-shell/index.js +8 -0
  24. package/dist/features/app-shell/use-delete-confirmation.hooks.d.ts +48 -0
  25. package/dist/features/app-shell/use-delete-confirmation.hooks.js +57 -0
  26. package/dist/features/app-shell/use-expanded-mode.hooks.d.ts +19 -0
  27. package/dist/features/app-shell/use-expanded-mode.hooks.js +39 -0
  28. package/dist/features/app-shell/use-site-toast.hooks.d.ts +56 -0
  29. package/dist/features/app-shell/use-site-toast.hooks.js +44 -0
  30. package/dist/features/app-shell/use-theme-preference.hooks.d.ts +30 -0
  31. package/dist/features/app-shell/use-theme-preference.hooks.js +42 -0
  32. package/dist/features/app-version/use-app-version.d.ts +53 -0
  33. package/dist/features/app-version/use-app-version.js +42 -0
  34. package/dist/features/asset-grid/react/components/AssetGrid.d.ts +1 -1
  35. package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
  36. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +1 -1
  37. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
  38. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +2 -2
  39. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +1 -1
  40. package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +1 -1
  41. package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +1 -1
  42. package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
  43. package/dist/features/charts/catalog-manifests.js +1 -1
  44. package/dist/features/charts/contract.d.ts +1 -1
  45. package/dist/features/charts/contract.js +1 -1
  46. package/dist/features/charts/registry.js +1 -1
  47. package/dist/features/charts/table.js +4 -4
  48. package/dist/features/charts/wire.d.ts +1 -1
  49. package/dist/features/charts/wire.js +1 -1
  50. package/dist/features/command-palette/index.d.ts +1 -0
  51. package/dist/features/command-palette/index.js +1 -0
  52. package/dist/features/command-palette/react/components/CommandPalette.d.ts +9 -9
  53. package/dist/features/command-palette/react/components/CommandPalette.hooks.js +28 -1
  54. package/dist/features/command-palette/react/components/CommandPalette.js +3 -5
  55. package/dist/features/connectors/ConnectorsBrowser.d.ts +1 -1
  56. package/dist/features/connectors/ConnectorsBrowser.js +2 -2
  57. package/dist/features/connectors/components/ConnectorCard.hooks.js +2 -2
  58. package/dist/features/connectors/components/ConnectorCard.js +4 -4
  59. package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +1 -1
  60. package/dist/features/connectors/components/ConnectorDetailDrawer.js +7 -7
  61. package/dist/features/connectors/components/ConnectorGrid.js +1 -1
  62. package/dist/features/connectors/components/ConnectorLogo.js +1 -1
  63. package/dist/features/connectors/components/ConnectorSearchBar.js +1 -1
  64. package/dist/features/connectors/components/ProviderTabBar.js +1 -1
  65. package/dist/features/execution/claude/env-fields.d.ts +1 -1
  66. package/dist/features/execution/codex/env-fields.d.ts +1 -1
  67. package/dist/features/execution/constants.d.ts +2 -2
  68. package/dist/features/execution/constants.js +1 -1
  69. package/dist/features/execution/dependencies.d.ts +2 -3
  70. package/dist/features/execution/http-adapter.d.ts +2 -3
  71. package/dist/features/execution/index.d.ts +0 -2
  72. package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +1 -1
  73. package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +1 -1
  74. package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -1
  75. package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -2
  76. package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +2 -2
  77. package/dist/features/execution/react/components/ByokProviderForm.js +15 -4
  78. package/dist/features/execution/react/components/ExecutionTab.d.ts +2 -3
  79. package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +14 -4
  80. package/dist/features/execution/react/components/ExecutionTab.hooks.js +66 -9
  81. package/dist/features/execution/react/components/ExecutionTab.js +27 -10
  82. package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -4
  83. package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -4
  84. package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +3 -3
  85. package/dist/features/execution/react/components/LocalCliAgentSettings.d.ts +2 -2
  86. package/dist/features/execution/react/components/ProviderChipGroup.d.ts +1 -1
  87. package/dist/features/execution/react/components/SearchableModelSelect.d.ts +1 -1
  88. package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.d.ts +2 -2
  89. package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
  90. package/dist/features/execution/react/hooks/useExecutionTab.d.ts +2 -3
  91. package/dist/features/execution/react/hooks/useLocalCliAgentCard.d.ts +4 -4
  92. package/dist/features/execution/react/hooks/useLocalCliAgentList.d.ts +4 -4
  93. package/dist/features/execution/react/hooks/useReasoningControl.d.ts +3 -3
  94. package/dist/features/execution/rules.d.ts +6 -6
  95. package/dist/features/execution/rules.js +1 -1
  96. package/dist/features/external-mcp/react/components/ExternalMcpTab.js +4 -4
  97. package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +1 -1
  98. package/dist/features/file-dropzone/react/components/FileDropzone.js +1 -1
  99. package/dist/features/find/find-bar-state.d.ts +58 -0
  100. package/dist/features/find/find-bar-state.js +45 -0
  101. package/dist/features/find/find-focus-clock.d.ts +19 -0
  102. package/dist/features/find/find-focus-clock.js +9 -0
  103. package/dist/features/find/find-input-focus.d.ts +88 -0
  104. package/dist/features/find/find-input-focus.js +88 -0
  105. package/dist/features/find/find-target.d.ts +141 -0
  106. package/dist/features/find/find-target.js +160 -0
  107. package/dist/features/find/index.d.ts +10 -0
  108. package/dist/features/find/index.js +10 -0
  109. package/dist/features/find/use-find-bar-effects.hooks.d.ts +14 -0
  110. package/dist/features/find/use-find-bar-effects.hooks.js +92 -0
  111. package/dist/features/find/use-find-bar-state.hooks.d.ts +43 -0
  112. package/dist/features/find/use-find-bar-state.hooks.js +49 -0
  113. package/dist/features/find/use-find-focus-reclaim.hooks.d.ts +21 -0
  114. package/dist/features/find/use-find-focus-reclaim.hooks.js +64 -0
  115. package/dist/features/find/use-find-input-binding.hooks.d.ts +18 -0
  116. package/dist/features/find/use-find-input-binding.hooks.js +76 -0
  117. package/dist/features/find-bar/FindBar.d.ts +41 -0
  118. package/dist/features/find-bar/FindBar.js +31 -0
  119. package/dist/features/find-bar/index.d.ts +2 -0
  120. package/dist/features/find-bar/index.js +2 -0
  121. package/dist/features/folder-path-drop/index.d.ts +3 -1
  122. package/dist/features/folder-path-drop/index.js +1 -0
  123. package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.d.ts +50 -0
  124. package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.js +50 -0
  125. package/dist/features/folder-path-drop/types.d.ts +14 -0
  126. package/dist/features/i18n/context.d.ts +1 -1
  127. package/dist/features/i18n/context.js +1 -1
  128. package/dist/features/iframe-pool/react/dom-sync.d.ts +13 -3
  129. package/dist/features/iframe-pool/react/dom-sync.js +7 -7
  130. package/dist/features/import-handoff/use-import-handoff.d.ts +38 -0
  131. package/dist/features/import-handoff/use-import-handoff.js +40 -0
  132. package/dist/features/integrations/rules.js +39 -41
  133. package/dist/features/interactive-ui/interactive-ui.css +1 -1
  134. package/dist/features/interactive-ui/providers/native/data-table.js +1 -1
  135. package/dist/features/interactive-ui/providers/native/data-table.manifest.d.ts +1 -1
  136. package/dist/features/interactive-ui/providers/native/data-table.manifest.js +1 -1
  137. package/dist/features/interactive-ui/providers/shadcn/action-button.manifest.d.ts +1 -1
  138. package/dist/features/interactive-ui/providers/shadcn/action-button.manifest.js +1 -1
  139. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +1 -1
  140. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.manifest.d.ts +1 -1
  141. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.manifest.js +1 -1
  142. package/dist/features/interactive-ui/providers/shadcn/content-card.manifest.d.ts +1 -1
  143. package/dist/features/interactive-ui/providers/shadcn/content-card.manifest.js +1 -1
  144. package/dist/features/interactive-ui/providers/shadcn/data-table.js +3 -3
  145. package/dist/features/interactive-ui/providers/shadcn/data-table.manifest.d.ts +1 -1
  146. package/dist/features/interactive-ui/providers/shadcn/data-table.manifest.js +1 -1
  147. package/dist/features/interactive-ui/providers/shadcn/radio-group-field.js +1 -1
  148. package/dist/features/interactive-ui/providers/shadcn/radio-group-field.manifest.d.ts +1 -1
  149. package/dist/features/interactive-ui/providers/shadcn/radio-group-field.manifest.js +1 -1
  150. package/dist/features/interactive-ui/providers/shadcn/select-field.manifest.d.ts +1 -1
  151. package/dist/features/interactive-ui/providers/shadcn/select-field.manifest.js +1 -1
  152. package/dist/features/interactive-ui/providers/shadcn/text-input-field.manifest.d.ts +1 -1
  153. package/dist/features/interactive-ui/providers/shadcn/text-input-field.manifest.js +1 -1
  154. package/dist/features/interactive-ui/types.d.ts +1 -1
  155. package/dist/features/live-views/index.d.ts +6 -0
  156. package/dist/features/live-views/index.js +6 -0
  157. package/dist/features/live-views/use-live-views.d.ts +31 -0
  158. package/dist/features/live-views/use-live-views.js +88 -0
  159. package/dist/features/live-views/use-site-view-preference.d.ts +33 -0
  160. package/dist/features/live-views/use-site-view-preference.js +32 -0
  161. package/dist/features/live-views/use-webview-load-failure.d.ts +90 -0
  162. package/dist/features/live-views/use-webview-load-failure.js +122 -0
  163. package/dist/features/mcp-ui/credential-card.d.ts +1 -0
  164. package/dist/features/mcp-ui/credential-card.js +1 -1
  165. package/dist/features/mcp-ui/surfaces/tool-approval.d.ts +10 -0
  166. package/dist/features/mcp-ui/surfaces/tool-approval.js +15 -0
  167. package/dist/features/media-providers/dependencies.d.ts +7 -1
  168. package/dist/features/media-providers/dependencies.js +43 -0
  169. package/dist/features/media-providers/index.d.ts +2 -2
  170. package/dist/features/media-providers/index.js +1 -1
  171. package/dist/features/media-providers/ports.d.ts +39 -5
  172. package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -3
  173. package/dist/features/media-providers/react/components/MediaProvidersTab.js +1 -1
  174. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.d.ts +3 -2
  175. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +41 -3
  176. package/dist/features/memory/react/components/MemoryConnectedPanel.js +2 -2
  177. package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
  178. package/dist/features/memory/react/components/MemoryHooksPanel.js +2 -2
  179. package/dist/features/memory/react/components/MemoryList.js +2 -2
  180. package/dist/features/memory/react/components/MemorySettingsPanel.js +2 -2
  181. package/dist/features/memory/react/components/MemorySuggestionPanel.js +1 -1
  182. package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +3 -3
  183. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +4 -1
  184. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +1 -1
  185. package/dist/features/memory/react/render-markdown.js +1 -1
  186. package/dist/features/nav-availability/nav-availability.d.ts +18 -0
  187. package/dist/features/nav-availability/nav-availability.js +12 -0
  188. package/dist/features/number-stepper/NumberStepper.d.ts +39 -0
  189. package/dist/features/number-stepper/NumberStepper.js +16 -0
  190. package/dist/features/number-stepper/index.d.ts +5 -0
  191. package/dist/features/number-stepper/index.js +5 -0
  192. package/dist/features/number-stepper/number-stepper.d.ts +34 -0
  193. package/dist/features/number-stepper/number-stepper.js +32 -0
  194. package/dist/features/number-stepper/use-number-stepper.hooks.d.ts +20 -0
  195. package/dist/features/number-stepper/use-number-stepper.hooks.js +29 -0
  196. package/dist/features/number-stepper/use-optimistic-number-setting.hooks.d.ts +36 -0
  197. package/dist/features/number-stepper/use-optimistic-number-setting.hooks.js +25 -0
  198. package/dist/features/panel-kit/ErrorNotice.js +8 -1
  199. package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +1 -1
  200. package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +1 -1
  201. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +1 -37
  202. package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +2 -1
  203. package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +2 -1
  204. package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +2 -1
  205. package/dist/features/panel-kit/index.d.ts +2 -1
  206. package/dist/features/privacy/react/components/PrivacyTab.d.ts +1 -1
  207. package/dist/features/privacy/react/components/PrivacyTab.js +1 -1
  208. package/dist/features/progress-card/components/ProgressCard.d.ts +1 -1
  209. package/dist/features/progress-card/components/ProgressCard.js +1 -1
  210. package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +1 -1
  211. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +1 -1
  212. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +1 -1
  213. package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
  214. package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +7 -2
  215. package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
  216. package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +1 -1
  217. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
  218. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
  219. package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
  220. package/dist/features/resource-dashboard/react/components/StatusPill.js +1 -1
  221. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +6 -1
  222. package/dist/features/resource-monitor/ResourceTable.d.ts +67 -0
  223. package/dist/features/resource-monitor/ResourceTable.js +25 -0
  224. package/dist/features/resource-monitor/index.d.ts +4 -0
  225. package/dist/features/resource-monitor/index.js +4 -0
  226. package/dist/features/resource-monitor/resource-stop.d.ts +16 -0
  227. package/dist/features/resource-monitor/resource-stop.js +11 -0
  228. package/dist/features/resource-monitor/use-resource-readings.hooks.d.ts +44 -0
  229. package/dist/features/resource-monitor/use-resource-readings.hooks.js +91 -0
  230. package/dist/features/settings/dialog/styles/settings-dialog.css +251 -251
  231. package/dist/features/site-card/index.d.ts +4 -1
  232. package/dist/features/site-card/index.js +3 -0
  233. package/dist/features/site-card/use-created-site-return.hooks.d.ts +36 -0
  234. package/dist/features/site-card/use-created-site-return.hooks.js +43 -0
  235. package/dist/features/site-card/use-site-card-preview.hooks.d.ts +39 -0
  236. package/dist/features/site-card/use-site-card-preview.hooks.js +31 -0
  237. package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +29 -8
  238. package/dist/features/site-card/use-site-list-prefs.hooks.js +56 -9
  239. package/dist/features/site-card/use-site-preview.hooks.d.ts +67 -0
  240. package/dist/features/site-card/use-site-preview.hooks.js +94 -0
  241. package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +2 -2
  242. package/dist/features/sketch-editor/react/components/SketchEditor.js +1 -1
  243. package/dist/features/skills/react/components/SkillRow.js +1 -1
  244. package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +2 -2
  245. package/dist/features/source-config-list/react/components/SourceConfigField.js +1 -1
  246. package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +5 -5
  247. package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
  248. package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
  249. package/dist/features/source-config-list/react/components/SourceConfigListView.js +3 -3
  250. package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +1 -1
  251. package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +1 -1
  252. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +1 -1
  253. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +1 -1
  254. package/dist/features/tab-strip/react/components/TabBar.js +2 -2
  255. package/dist/features/tab-strip/react/components/TabStrip.d.ts +1 -1
  256. package/dist/features/tab-strip/react/components/TabStrip.js +1 -1
  257. package/dist/features/tab-strip/scrollable.js +0 -2
  258. package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
  259. package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
  260. package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +1 -1
  261. package/dist/features/version-manager/react/components/VersionManagerModal.js +1 -1
  262. package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +2 -2
  263. package/dist/features/viewer-shell/react/components/CommentSidePanel.js +1 -1
  264. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +1 -1
  265. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +1 -1
  266. package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
  267. package/dist/features/viewer-shell/react/components/SegmentedToggle.js +1 -1
  268. package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +1 -1
  269. package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
  270. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
  271. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +1 -1
  272. package/dist/features/zoom/use-zoom.d.ts +141 -0
  273. package/dist/features/zoom/use-zoom.js +204 -0
  274. package/dist/index.d.ts +1 -0
  275. package/dist/index.js +1 -0
  276. package/dist/react/components/ComponentKitPreview.d.ts +1 -1
  277. package/dist/react/components/ComponentKitPreview.js +1 -1
  278. package/dist/react/components/CustomSelect.js +1 -1
  279. package/dist/react/components/ExportDiagnosticsButton.d.ts +6 -2
  280. package/dist/react/components/ExportDiagnosticsButton.js +3 -3
  281. package/dist/react/components/FileImportPanel.js +1 -1
  282. package/dist/react/components/IconFrame.d.ts +15 -0
  283. package/dist/react/components/IconFrame.js +11 -0
  284. package/dist/react/components/ImportChoice.js +1 -1
  285. package/dist/react/components/Notice.js +1 -1
  286. package/dist/react/components/OnboardingDropdown.js +1 -1
  287. package/dist/react/components/PaletteTweaks.js +1 -1
  288. package/dist/react/components/TooltipLayer.d.ts +13 -3
  289. package/dist/react/components/TooltipLayer.js +12 -12
  290. package/dist/react/mcp-ui/host-message-source.d.ts +3 -1
  291. package/dist/react/mcp-ui/host-message-source.js +1 -1
  292. package/dist/react/testing.js +3 -1
  293. package/dist/renderers/annotation-canvas/rules.js +30 -27
  294. package/dist/renderers/react/components/ArtifactView.js +1 -1
  295. package/dist/renderers/renderers/markdown.d.ts +3 -1
  296. package/dist/renderers/renderers/markdown.js +2 -2
  297. package/dist/styles/admin.css +54 -54
  298. package/dist/utils/zip.js +43 -36
  299. package/package.json +70 -13
  300. package/dist/features/execution/ports.d.ts +0 -71
  301. package/dist/features/execution/ports.js +0 -2
  302. package/dist/features/execution/types.d.ts +0 -472
  303. package/dist/features/execution/types.js +0 -2
  304. package/dist/react/components/CustomSelectMarkup.d.ts +0 -27
  305. package/dist/react/components/CustomSelectMarkup.js +0 -35
@@ -16,7 +16,7 @@ import { resolveMediaProvidersTabLabels } from './media-providers-tab-labels.js'
16
16
  * decorations outside this package's boundary; see `MediaProviderOption`'s
17
17
  * doc and this tab's `ports.ts` header for the full provenance note.
18
18
  */
19
- export function MediaProvidersTab({ port, catalog, catalogPolicy, initialProviders, pinnedProviderIds, labels, agentHandle, useTHook = useT, useMediaProvidersTabHook = useMediaProvidersTab, useMediaProviderKeyVisibilityHook = useMediaProviderKeyVisibility, }) {
19
+ export function MediaProvidersTab({ port, catalog, catalogPolicy, initialProviders, pinnedProviderIds, labels, agentHandle, useTHook = useT, useMediaProvidersTabHook, useMediaProviderKeyVisibilityHook = useMediaProviderKeyVisibility, }) {
20
20
  const t = useTHook();
21
21
  const { providers, load, save, hasAnyConfigured, pendingProviderIds, updateProvider, clearProvider, saveChanges, reload } = useMediaProvidersTabHook({ port, catalogPolicy, initialProviders });
22
22
  const { canonicalMediaProviderId } = catalogPolicy;
@@ -1,4 +1,4 @@
1
- import type { MediaProviderCatalogPolicy, MediaProvidersPort } from '../../ports.js';
1
+ import type { AnyMediaProvidersPort, MediaProviderCatalogPolicy } from '../../ports.js';
2
2
  import type { MediaProviderCredentials, MediaProviderMap, MediaProvidersLoadState, MediaProvidersSaveState } from '../../types.js';
3
3
  /** The operator-editable fields of a provider entry. Server markers
4
4
  * (`apiKeyConfigured`/`apiKeyTail`) are deliberately excluded — they only
@@ -7,7 +7,8 @@ import type { MediaProviderCredentials, MediaProviderMap, MediaProvidersLoadStat
7
7
  * distinction this narrows around. */
8
8
  export type MediaProviderEditPatch = Pick<MediaProviderCredentials, 'apiKey' | 'baseUrl' | 'model'>;
9
9
  export interface UseMediaProvidersTabOptions {
10
- port: MediaProvidersPort;
10
+ /** A whole-map `MediaProvidersPort`, or a per-provider `MediaProviderRowsPort` (see `sendProviders`). */
11
+ port: AnyMediaProvidersPort;
11
12
  /** Identity rules shared by catalog rows, local edits and daemon responses. Stable while mounted. */
12
13
  catalogPolicy: MediaProviderCatalogPolicy;
13
14
  /** Host-persisted local edits from before this tab mounted (e.g. the
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
- import { hasAnyConfiguredProvider, isEntryEmpty, mergeDaemonProviders, shouldSyncLocalProvidersToDaemon, } from '../../rules.js';
2
+ import { hasAnyConfiguredProvider, hasRecoverableFields, isEntryEmpty, mergeDaemonProviders, shouldSyncLocalProvidersToDaemon, } from '../../rules.js';
3
3
  /**
4
4
  * Releases the tombstones a successful write carried. The server has now accepted a map without
5
5
  * these, so the local absence is no longer a claim waiting to be defended — the daemon agrees.
@@ -24,6 +24,38 @@ function overlayTouchedProviders({ saved, local, touched, }) {
24
24
  }
25
25
  return saved;
26
26
  }
27
+ /** The operator-editable fields of one entry, without server markers; an absent field is left out, so the host keeps it. */
28
+ function editableFields({ entry }) {
29
+ return {
30
+ ...(entry.apiKey === undefined ? {} : { apiKey: entry.apiKey }),
31
+ ...(entry.baseUrl === undefined ? {} : { baseUrl: entry.baseUrl }),
32
+ ...(entry.model === undefined ? {} : { model: entry.model }),
33
+ };
34
+ }
35
+ /**
36
+ * Sends one write's worth of changes and resolves the server's resulting map. A whole-map port gets
37
+ * the send-time map, as it always has. A per-provider port gets one batch of explicit changes:
38
+ * a removal for each clear this write carries, and a patch for each pending provider that still
39
+ * has an entry.
40
+ *
41
+ * A provider missing from the local map is NOT removed unless the operator cleared it. Map omission
42
+ * is not evidence of intent to delete: an edit can empty an entry that was never saved, and a map
43
+ * read before another window's save simply never contained that provider. Only an explicit Clear
44
+ * says "delete this one", so only a clear becomes a removal.
45
+ */
46
+ async function sendProviders({ port, sent, clears, pending }) {
47
+ // A whole-map port has no `patchProvider`; `in` narrows the union to the per-provider shape.
48
+ if (!('patchProvider' in port))
49
+ return port.saveMediaProviders(sent);
50
+ const patches = pending.flatMap(providerId => {
51
+ const entry = sent[providerId];
52
+ return entry === undefined ? [] : [{ providerId, fields: editableFields({ entry }) }];
53
+ });
54
+ // Nothing changed: the local map is already what the server holds for this write.
55
+ if (clears.length === 0 && patches.length === 0)
56
+ return sent;
57
+ return port.applyProviderChanges({ removes: clears, patches });
58
+ }
27
59
  /** A save rejection as display text; a non-`Error` rejection is stringified rather than read as `.message`. */
28
60
  function saveErrorMessage({ error }) {
29
61
  return error instanceof Error ? error.message : String(error);
@@ -131,7 +163,7 @@ export function useMediaProvidersTab({ port, catalogPolicy, initialProviders })
131
163
  // request never told the server about it.
132
164
  const clearsInFlight = [...clearedProviderIds.current].filter((providerId) => sent[providerId] === undefined);
133
165
  try {
134
- const saved = await portRef.current.saveMediaProviders(sent);
166
+ const saved = await sendProviders({ port: portRef.current, sent, clears: clearsInFlight, pending: [...pendingRef.current] });
135
167
  if (!alive.current)
136
168
  return { status: 'abandoned' };
137
169
  const touched = mutatedSinceSend.current;
@@ -228,10 +260,16 @@ export function useMediaProvidersTab({ port, catalogPolicy, initialProviders })
228
260
  applyProviders(merged);
229
261
  setLoad({ status: 'ok' });
230
262
  if (migrateOnFirstUpload && shouldSyncLocalProvidersToDaemon({ localProviders: localBeforeMerge, daemonProviders: daemonResult })) {
263
+ // A per-provider port uploads only pending providers, so the migration marks the ones with
264
+ // something to upload; a whole-map port sends the entire map regardless.
265
+ if ('patchProvider' in portRef.current) {
266
+ const uploadable = Object.keys(merged).filter((providerId) => hasRecoverableFields({ entry: merged[providerId] }));
267
+ applyPending(new Set([...pendingRef.current, ...uploadable]));
268
+ }
231
269
  void persist();
232
270
  }
233
271
  });
234
- }, [persist, applyProviders, normalizeMediaProviderMap]);
272
+ }, [persist, applyProviders, applyPending, normalizeMediaProviderMap]);
235
273
  useEffect(() => {
236
274
  // Mount (or host-supplied port swap): migration is a one-time boot
237
275
  // check, matching the origin's App.tsx boot sequence — a manual
@@ -65,7 +65,7 @@ function MemoryConnectorRow({ connector, context, toggleConnectorSelection, onCo
65
65
  }
66
66
  function MemoryConnectedSummary({ connectorsLoading, connectedCount, onOpenConnectors, useTHook = useT, }) {
67
67
  const t = useTHook();
68
- return (_jsxs("div", { className: "jini-memory-source-summary jini-memory-connected-summary", children: [_jsx("span", { className: "jini-memory-block-icon", children: _jsx(Icon, { name: "link", size: 15 }) }), _jsxs("div", { children: [_jsx("h4", { children: t('Import from apps') }), _jsx("p", { className: "hint", children: t('Choose apps to scan for design preferences, project context, and visual references. Nothing is scanned until you select an app.') })] }), _jsx("span", { className: "memory-source-badge", children: connectorsLoading ? t('Loading') : `${connectedCount} ${t('connected')}` }), _jsx("button", { type: "button", className: "ghost memory-source-action", onClick: onOpenConnectors, disabled: !onOpenConnectors, children: t('Manage') })] }));
68
+ return (_jsxs("div", { className: "jini-memory-source-summary jini-memory-connected-summary", children: [_jsx("span", { className: "jini-memory-block-icon", children: _jsx(Icon, { name: "link", size: 15 }) }), _jsxs("div", { children: [_jsx("h4", { children: t('Import from apps') }), _jsx("p", { className: "hint", children: t('Choose apps to scan for design preferences, project context, and visual references. Nothing is scanned until you select an app.') })] }), _jsx("span", { className: "jini-ui-memory-source-badge", children: connectorsLoading ? t('Loading') : `${connectedCount} ${t('connected')}` }), _jsx("button", { type: "button", className: "ghost memory-source-action", onClick: onOpenConnectors, disabled: !onOpenConnectors, children: t('Manage') })] }));
69
69
  }
70
70
  function MemoryConnectorRunBar({ enabled, connectorExtracting, connectorSaving, connectedCount, selectedCount, connectorScanLabel, onSuggestConnectorMemory, useTHook = useT, }) {
71
71
  const t = useTHook();
@@ -81,7 +81,7 @@ function MemoryScanHistory({ connectorExtractions, nowClock, onOpenPreview, onDe
81
81
  }
82
82
  function MemoryConnectorPickerHead({ selectedCount, useTHook = useT }) {
83
83
  const t = useTHook();
84
- return (_jsxs("div", { className: "jini-memory-connector-picker-head", children: [_jsxs("div", { children: [_jsx("h4", { children: t('Choose sources') }), _jsx("p", { className: "hint", children: t('Select connected apps first. Only the apps you choose are scanned.') })] }), _jsxs("span", { className: "memory-source-badge", children: [selectedCount, " ", t('selected')] })] }));
84
+ return (_jsxs("div", { className: "jini-memory-connector-picker-head", children: [_jsxs("div", { children: [_jsx("h4", { children: t('Choose sources') }), _jsx("p", { className: "hint", children: t('Select connected apps first. Only the apps you choose are scanned.') })] }), _jsxs("span", { className: "jini-ui-memory-source-badge", children: [selectedCount, " ", t('selected')] })] }));
85
85
  }
86
86
  function MemoryConnectorWorkbench({ useTHook = useT, ...props }) {
87
87
  const t = useTHook();
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  // scoped-down local reimplementation of OD's `runtime/markdown.tsx` (2,881
6
6
  // lines, chat/artifact-rendering territory, explicitly deferred to
7
7
  // `@jini-ai/chat`'s `./react` subpath (formerly this package's own `./chat` export, extracted
8
- // 2026-08-03)/this package's own `./renderers` subpath — see `archived UI source map`)
8
+ // 2026-08-03)/this package's own `./renderers` subpath — see `070311a07^:packages/ui/source-map.md` (section "features/memory/"))
9
9
  // — just enough to render a saved memory's plain-text/Markdown body safely.
10
10
  import { agentHandleProps } from '@jini-ai/core/agent-handles';
11
11
  import { Icon } from '../../../../react/components/Icon.js';
@@ -12,7 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  // the reload()/SSE wiring; this panel is presentational and calls the passed
13
13
  // toggle callbacks. Folded into this slice from OD's separate
14
14
  // `components/MemoryHooksPanel.tsx` (single consumer, `MemoryHowPanel`) — see
15
- // `archived UI source map`.
15
+ // `070311a07^:packages/ui/source-map.md` (section "features/memory/").
16
16
  import { agentHandleProps } from '@jini-ai/core/agent-handles';
17
17
  import { Icon } from '../../../../react/components/Icon.js';
18
18
  import { useT } from '../../../i18n/index.js';
@@ -48,6 +48,6 @@ const HOOKS = [
48
48
  ];
49
49
  export function MemoryHooksPanel({ enabled, flags, onToggle, agentHandle, useTHook = useT, }) {
50
50
  const t = useTHook();
51
- return (_jsxs("div", { className: "memory-hooks-panel", "data-testid": "memory-hooks-panel", children: [_jsxs("div", { className: "memory-hooks-panel-head", children: [_jsx("span", { className: "memory-hooks-panel-head-icon", "aria-hidden": "true", children: _jsx(Icon, { name: "sliders", size: 15 }) }), _jsxs("div", { children: [_jsx("h4", { className: "memory-hooks-panel-title", children: t('Memory hooks') }), _jsx("p", { className: "memory-hooks-panel-hint", children: t('Fine-tune how memory is captured and used, without turning it off entirely.') })] })] }), _jsx("ul", { className: "memory-hooks-panel-list", children: HOOKS.map((hook) => (_jsxs("li", { className: "memory-hooks-panel-row", children: [_jsx("span", { className: "memory-hooks-panel-row-icon", "aria-hidden": "true", children: _jsx(Icon, { name: hook.icon, size: 14 }) }), _jsxs("span", { className: "memory-hooks-panel-row-copy", children: [_jsx("span", { className: "memory-hooks-panel-row-label", children: t(hook.label) }), _jsx("small", { className: "memory-hooks-panel-row-desc", children: t(hook.description) })] }), _jsx("label", { className: "memory-hooks-panel-toggle", title: t(hook.label), children: _jsxs("span", { className: "toggle-switch toggle-switch-sm", children: [_jsx("input", { type: "checkbox", "aria-label": t(hook.label), checked: flags[hook.key], disabled: !enabled, onChange: (e) => onToggle(hook.key, e.target.checked), ...agentHandleProps({}, { base: agentHandle, ...({ action: `hook-${hook.action}`, role: 'checkbox', label: t(hook.label) }) }) }), _jsx("span", { className: "toggle-slider" })] }) })] }, hook.key))) })] }));
51
+ return (_jsxs("div", { className: "jini-ui-memory-hooks-panel", "data-testid": "memory-hooks-panel", children: [_jsxs("div", { className: "jini-ui-memory-hooks-panel-head", children: [_jsx("span", { className: "jini-ui-memory-hooks-panel-head-icon", "aria-hidden": "true", children: _jsx(Icon, { name: "sliders", size: 15 }) }), _jsxs("div", { children: [_jsx("h4", { className: "jini-ui-memory-hooks-panel-title", children: t('Memory hooks') }), _jsx("p", { className: "jini-ui-memory-hooks-panel-hint", children: t('Fine-tune how memory is captured and used, without turning it off entirely.') })] })] }), _jsx("ul", { className: "jini-ui-memory-hooks-panel-list", children: HOOKS.map((hook) => (_jsxs("li", { className: "jini-ui-memory-hooks-panel-row", children: [_jsx("span", { className: "jini-ui-memory-hooks-panel-row-icon", "aria-hidden": "true", children: _jsx(Icon, { name: hook.icon, size: 14 }) }), _jsxs("span", { className: "jini-ui-memory-hooks-panel-row-copy", children: [_jsx("span", { className: "jini-ui-memory-hooks-panel-row-label", children: t(hook.label) }), _jsx("small", { className: "jini-ui-memory-hooks-panel-row-desc", children: t(hook.description) })] }), _jsx("label", { className: "jini-ui-memory-hooks-panel-toggle", title: t(hook.label), children: _jsxs("span", { className: "jini-ui-toggle-switch jini-ui-toggle-switch-sm", children: [_jsx("input", { type: "checkbox", "aria-label": t(hook.label), checked: flags[hook.key], disabled: !enabled, onChange: (e) => onToggle(hook.key, e.target.checked), ...agentHandleProps({}, { base: agentHandle, ...({ action: `hook-${hook.action}`, role: 'checkbox', label: t(hook.label) }) }) }), _jsx("span", { className: "jini-ui-toggle-slider" })] }) })] }, hook.key))) })] }));
52
52
  }
53
53
  //# sourceMappingURL=MemoryHooksPanel.js.map
@@ -17,7 +17,7 @@ function rowHandles({ agentHandle, action, ids }) {
17
17
  }
18
18
  function MemoryListCounts({ savedCount, extractionCount, useTHook = useT }) {
19
19
  const t = useTHook();
20
- return (_jsxs("div", { className: "jini-memory-management-counts", children: [_jsxs("span", { className: "memory-source-badge", children: [savedCount, " ", t('saved')] }), extractionCount > 0 ? (_jsxs("span", { className: "memory-source-badge", children: [extractionCount, " ", extractionCount === 1 ? t('extraction') : t('extractions')] })) : null] }));
20
+ return (_jsxs("div", { className: "jini-memory-management-counts", children: [_jsxs("span", { className: "jini-ui-memory-source-badge", children: [savedCount, " ", t('saved')] }), extractionCount > 0 ? (_jsxs("span", { className: "jini-ui-memory-source-badge", children: [extractionCount, " ", extractionCount === 1 ? t('extraction') : t('extractions')] })) : null] }));
21
21
  }
22
22
  function MemoryFilterPills({ entries, extractionCount, filter, onFilterChange, agentHandle, useTHook = useT, }) {
23
23
  const t = useTHook();
@@ -52,6 +52,6 @@ function MemoryListToolbar({ entries, extractionCount, filter, onFilterChange, o
52
52
  }
53
53
  export function MemoryList({ sectionRef, entries, filtered, visibleExtractions, filter, onFilterChange, unifiedMemoryCount, onClearExtractions, onRefreshExtractions, isRefreshing, previewId, previewBody, nowClock, onOpenPreview, onStartEdit, onDeleteEntry, onDeleteExtraction, agentHandle, useTHook = useT, }) {
54
54
  const t = useTHook();
55
- return (_jsx("section", { ref: sectionRef, className: "settings-section settings-section-card memory-records-section", children: _jsxs("div", { className: "memory-management-panel", children: [_jsxs("div", { className: "memory-subsection-head", children: [_jsxs("div", { children: [_jsx("h4", { children: t('Saved memory') }), _jsx("p", { className: "hint", children: t('Saved facts, preferences, and project context available to future chats.') })] }), _jsx(MemoryListCounts, { savedCount: entries.length, extractionCount: visibleExtractions.length })] }), _jsx(MemoryListToolbar, { entries: entries, extractionCount: visibleExtractions.length, filter: filter, onFilterChange: onFilterChange, onClearExtractions: onClearExtractions, onRefreshExtractions: onRefreshExtractions, isRefreshing: isRefreshing, agentHandle: agentHandle }), _jsx("div", { className: "library-content memory-unified-list", children: unifiedMemoryCount === 0 ? (_jsx(MemoryListEmpty, {})) : (_jsx(MemoryListRows, { filtered: filtered, visibleExtractions: visibleExtractions, previewId: previewId, previewBody: previewBody, nowClock: nowClock, onOpenPreview: onOpenPreview, onStartEdit: onStartEdit, onDeleteEntry: onDeleteEntry, onDeleteExtraction: onDeleteExtraction, agentHandle: agentHandle })) })] }) }));
55
+ return (_jsx("section", { ref: sectionRef, className: "settings-section jini-ui-settings-section-card jini-ui-memory-records-section", children: _jsxs("div", { className: "jini-ui-memory-management-panel", children: [_jsxs("div", { className: "jini-ui-memory-subsection-head", children: [_jsxs("div", { children: [_jsx("h4", { children: t('Saved memory') }), _jsx("p", { className: "hint", children: t('Saved facts, preferences, and project context available to future chats.') })] }), _jsx(MemoryListCounts, { savedCount: entries.length, extractionCount: visibleExtractions.length })] }), _jsx(MemoryListToolbar, { entries: entries, extractionCount: visibleExtractions.length, filter: filter, onFilterChange: onFilterChange, onClearExtractions: onClearExtractions, onRefreshExtractions: onRefreshExtractions, isRefreshing: isRefreshing, agentHandle: agentHandle }), _jsx("div", { className: "jini-ui-library-content memory-unified-list", children: unifiedMemoryCount === 0 ? (_jsx(MemoryListEmpty, {})) : (_jsx(MemoryListRows, { filtered: filtered, visibleExtractions: visibleExtractions, previewId: previewId, previewBody: previewBody, nowClock: nowClock, onOpenPreview: onOpenPreview, onStartEdit: onStartEdit, onDeleteEntry: onDeleteEntry, onDeleteExtraction: onDeleteExtraction, agentHandle: agentHandle })) })] }) }));
56
56
  }
57
57
  //# sourceMappingURL=MemoryList.js.map
@@ -23,7 +23,7 @@ import { MemoryHowPanel } from './MemoryHowPanel.js';
23
23
  import { MemoryList } from './MemoryList.js';
24
24
  /** The "Memories" / "How it works" segmented view switch. */
25
25
  function MemoryViewSwitch({ topTab, onTopTabChange, agentHandle, t }) {
26
- return (_jsxs("div", { className: "jini-seg-control memory-panel-seg", role: "tablist", "aria-label": t('Memory view'), style: { '--seg-cols': 2 }, children: [_jsx("button", { type: "button", role: "tab", "aria-selected": topTab === 'memories', className: 'jini-seg-btn' + (topTab === 'memories' ? ' active' : ''), onClick: () => onTopTabChange('memories'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'view-memories', role: 'button', label: t('Memories') }) }), children: _jsx("span", { className: "jini-seg-title", children: t('Memories') }) }), _jsx("button", { type: "button", role: "tab", "aria-selected": topTab === 'how', className: 'jini-seg-btn' + (topTab === 'how' ? ' active' : ''), onClick: () => onTopTabChange('how'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'view-how', role: 'button', label: t('How it works') }) }), children: _jsx("span", { className: "jini-seg-title", children: t('How it works') }) })] }));
26
+ return (_jsxs("div", { className: "jini-seg-control jini-ui-memory-panel-seg", role: "tablist", "aria-label": t('Memory view'), style: { '--seg-cols': 2 }, children: [_jsx("button", { type: "button", role: "tab", "aria-selected": topTab === 'memories', className: 'jini-seg-btn' + (topTab === 'memories' ? ' active' : ''), onClick: () => onTopTabChange('memories'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'view-memories', role: 'button', label: t('Memories') }) }), children: _jsx("span", { className: "jini-seg-title", children: t('Memories') }) }), _jsx("button", { type: "button", role: "tab", "aria-selected": topTab === 'how', className: 'jini-seg-btn' + (topTab === 'how' ? ' active' : ''), onClick: () => onTopTabChange('how'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'view-how', role: 'button', label: t('How it works') }) }), children: _jsx("span", { className: "jini-seg-title", children: t('How it works') }) })] }));
27
27
  }
28
28
  export function MemorySettingsPanel({ enabled, onToggleEnabled, topTab, onTopTabChange, onAdd, onOpenAdvanced, savedMemory, howItWorks, agentHandle, useTHook = useT, }) {
29
29
  const t = useTHook();
@@ -32,6 +32,6 @@ export function MemorySettingsPanel({ enabled, onToggleEnabled, topTab, onTopTab
32
32
  const sectionRef = useRef(null);
33
33
  const savedHandleProps = agentHandle ? { agentHandle: agentSubHandle({ base: agentHandle, action: 'saved' }) } : {};
34
34
  const howHandleProps = agentHandle ? { agentHandle: agentSubHandle({ base: agentHandle, action: 'how' }) } : {};
35
- return (_jsxs("div", { className: "memory-settings-panel", children: [_jsxs("section", { className: "memory-panel-head-card", children: [_jsxs("div", { className: "memory-panel-head-copy", children: [_jsx("h4", { children: t('Memory') }), _jsx("p", { className: "hint", children: t('Control whether saved facts, preferences, and project context are reused in future chats.') })] }), _jsxs("div", { className: "memory-panel-head-controls", children: [_jsx(MemoryViewSwitch, { topTab: topTab, onTopTabChange: onTopTabChange, agentHandle: agentHandle, t: t }), _jsx("button", { type: "button", className: "memory-icon-btn", onClick: onAdd, disabled: !onAdd, "aria-label": t('Add memory'), title: t('Add memory'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'add', role: 'button', label: t('Add memory') }) }), children: _jsx(Icon, { name: "plus", size: 14 }) }), _jsx("button", { type: "button", className: "memory-icon-btn", onClick: onOpenAdvanced, disabled: !onOpenAdvanced, "aria-label": t('Advanced'), title: t('Advanced'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'advanced', role: 'button', label: t('Advanced') }) }), children: _jsx(Icon, { name: "settings", size: 14 }) }), _jsxs("label", { className: "toggle-switch memory-panel-master-toggle", title: enabled ? t('On') : t('Off'), children: [_jsx("input", { type: "checkbox", "aria-label": t('Enable memory'), checked: enabled, onChange: (event) => onToggleEnabled(event.target.checked), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'enabled', role: 'checkbox', label: t('Enable memory') }) }) }), _jsx("span", { className: "toggle-slider" })] })] })] }), topTab === 'memories' ? (_jsx(MemoryList, { sectionRef: sectionRef, ...savedMemory, ...savedHandleProps })) : (_jsx(MemoryHowPanel, { ...howItWorks, ...howHandleProps }))] }));
35
+ return (_jsxs("div", { className: "jini-ui-memory-settings-panel", children: [_jsxs("section", { className: "jini-ui-memory-panel-head-card", children: [_jsxs("div", { className: "jini-ui-memory-panel-head-copy", children: [_jsx("h4", { children: t('Memory') }), _jsx("p", { className: "hint", children: t('Control whether saved facts, preferences, and project context are reused in future chats.') })] }), _jsxs("div", { className: "jini-ui-memory-panel-head-controls", children: [_jsx(MemoryViewSwitch, { topTab: topTab, onTopTabChange: onTopTabChange, agentHandle: agentHandle, t: t }), _jsx("button", { type: "button", className: "jini-ui-memory-icon-btn", onClick: onAdd, disabled: !onAdd, "aria-label": t('Add memory'), title: t('Add memory'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'add', role: 'button', label: t('Add memory') }) }), children: _jsx(Icon, { name: "plus", size: 14 }) }), _jsx("button", { type: "button", className: "jini-ui-memory-icon-btn", onClick: onOpenAdvanced, disabled: !onOpenAdvanced, "aria-label": t('Advanced'), title: t('Advanced'), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'advanced', role: 'button', label: t('Advanced') }) }), children: _jsx(Icon, { name: "settings", size: 14 }) }), _jsxs("label", { className: "jini-ui-toggle-switch memory-panel-master-toggle", title: enabled ? t('On') : t('Off'), children: [_jsx("input", { type: "checkbox", "aria-label": t('Enable memory'), checked: enabled, onChange: (event) => onToggleEnabled(event.target.checked), ...agentHandleProps({}, { base: agentHandle, ...({ action: 'enabled', role: 'checkbox', label: t('Enable memory') }) }) }), _jsx("span", { className: "jini-ui-toggle-slider" })] })] })] }), topTab === 'memories' ? (_jsx(MemoryList, { sectionRef: sectionRef, ...savedMemory, ...savedHandleProps })) : (_jsx(MemoryHowPanel, { ...howItWorks, ...howHandleProps }))] }));
36
36
  }
37
37
  //# sourceMappingURL=MemorySettingsPanel.js.map
@@ -13,6 +13,6 @@ function MemorySuggestionCard({ suggestion, selected, typeLabel, toggleConnector
13
13
  export function MemorySuggestionPanel({ connectorSuggestions, selectedSuggestionIds, selectedConnectorSuggestions, connectorSaving, toggleConnectorSuggestion, onSaveConnectorSuggestions, onDiscardConnectorSuggestions, useTHook = useT, }) {
14
14
  const t = useTHook();
15
15
  const typeLabel = useMemo(() => memoryTypeLabels({ t }), [t]);
16
- return (_jsxs("div", { className: "memory-suggestion-panel", children: [_jsxs("div", { className: "memory-subsection-head", children: [_jsxs("div", { children: [_jsx("h4", { children: t('Suggested memories') }), _jsx("p", { className: "hint", children: t('Review design-related memories before saving them.') })] }), _jsxs("span", { className: "memory-source-badge", children: [selectedConnectorSuggestions.length, " ", t('selected')] })] }), _jsx("div", { className: "memory-suggestion-list", children: connectorSuggestions.map((suggestion) => (_jsx(MemorySuggestionCard, { suggestion: suggestion, selected: selectedSuggestionIds.has(suggestion.id), typeLabel: typeLabel[suggestion.type], toggleConnectorSuggestion: toggleConnectorSuggestion }, suggestion.id))) }), _jsxs("div", { className: "memory-connector-actions", children: [_jsxs("button", { type: "button", className: "primary memory-source-action", onClick: () => void onSaveConnectorSuggestions(), disabled: connectorSaving || selectedConnectorSuggestions.length === 0, children: [_jsx(Icon, { name: connectorSaving ? 'refresh' : 'check', size: 14, className: connectorSaving ? 'icon-spin' : '' }), _jsx("span", { children: connectorSaving ? t('Saving') : t('Save selected') })] }), _jsx("button", { type: "button", className: "ghost memory-source-action", onClick: onDiscardConnectorSuggestions, disabled: connectorSaving, children: t('Discard') })] })] }));
16
+ return (_jsxs("div", { className: "memory-suggestion-panel", children: [_jsxs("div", { className: "jini-ui-memory-subsection-head", children: [_jsxs("div", { children: [_jsx("h4", { children: t('Suggested memories') }), _jsx("p", { className: "hint", children: t('Review design-related memories before saving them.') })] }), _jsxs("span", { className: "jini-ui-memory-source-badge", children: [selectedConnectorSuggestions.length, " ", t('selected')] })] }), _jsx("div", { className: "memory-suggestion-list", children: connectorSuggestions.map((suggestion) => (_jsx(MemorySuggestionCard, { suggestion: suggestion, selected: selectedSuggestionIds.has(suggestion.id), typeLabel: typeLabel[suggestion.type], toggleConnectorSuggestion: toggleConnectorSuggestion }, suggestion.id))) }), _jsxs("div", { className: "memory-connector-actions", children: [_jsxs("button", { type: "button", className: "primary memory-source-action", onClick: () => void onSaveConnectorSuggestions(), disabled: connectorSaving || selectedConnectorSuggestions.length === 0, children: [_jsx(Icon, { name: connectorSaving ? 'refresh' : 'check', size: 14, className: connectorSaving ? 'icon-spin' : '' }), _jsx("span", { children: connectorSaving ? t('Saving') : t('Save selected') })] }), _jsx("button", { type: "button", className: "ghost memory-source-action", onClick: onDiscardConnectorSuggestions, disabled: connectorSaving, children: t('Discard') })] })] }));
17
17
  }
18
18
  //# sourceMappingURL=MemorySuggestionPanel.js.map
@@ -50,7 +50,7 @@ export { saveSelectedConnectorSuggestions };
50
50
  * barrel. */
51
51
  export function applyMemoryConnectorConnectThrown({ connectorId, err }, { setConnectorConnectErrors, setPendingConnectorAuthIds, }) {
52
52
  setConnectorConnectErrors((prev) => ({ ...prev, [connectorId]: err instanceof Error ? err.message : String(err) }));
53
- setPendingConnectorAuthIds((prev) => withoutSetMember(prev, connectorId));
53
+ setPendingConnectorAuthIds((prev) => withoutSetMember({ set: prev, value: connectorId }));
54
54
  }
55
55
  /** `onConnectMemoryConnector`'s "the port call resolved" path: decides and
56
56
  * applies the connector upsert, pending-auth membership, and connect-error
@@ -71,10 +71,10 @@ export function applyMemoryConnectorConnectResult({ connectorId, result, port, }
71
71
  invalidateCatalogueGuard();
72
72
  if (result.error) {
73
73
  setConnectorConnectErrors((prev) => ({ ...prev, [connectorId]: result.error }));
74
- setPendingConnectorAuthIds((prev) => withoutSetMember(prev, connectorId));
74
+ setPendingConnectorAuthIds((prev) => withoutSetMember({ set: prev, value: connectorId }));
75
75
  return false;
76
76
  }
77
- setPendingConnectorAuthIds((prev) => requiresAuthorizationCompletion ? new Set(prev).add(connectorId) : withoutSetMember(prev, connectorId));
77
+ setPendingConnectorAuthIds((prev) => requiresAuthorizationCompletion ? new Set(prev).add(connectorId) : withoutSetMember({ set: prev, value: connectorId }));
78
78
  return true;
79
79
  }
80
80
  /** The per-connector connect flow (OAuth start), guarded against re-entrancy per connector id. */
@@ -5,7 +5,10 @@ import type { ConnectorMemorySuggestionResponse, FriendlyExtractionFailure, Memo
5
5
  export { withoutKey } from '../../../connectors/rules.js';
6
6
  /** `Set` counterpart to {@link withoutKey}: removes `value`, preserving
7
7
  * referential identity when it was already absent. */
8
- export declare function withoutSetMember<T>(set: Set<T>, value: T): Set<T>;
8
+ export declare function withoutSetMember<T>({ set, value }: {
9
+ set: Set<T>;
10
+ value: T;
11
+ }, _optional?: Record<string, never>): Set<T>;
9
12
  /** What `onSuggestConnectorMemory` should show once a scan attempt resolves:
10
13
  * a friendly extraction failure wins over any suggestions found, followed by
11
14
  * suggestions, a read-issue error, and finally a benign "nothing new" status. */
@@ -10,7 +10,7 @@ import { withoutKey } from '../../../connectors/rules.js';
10
10
  export { withoutKey } from '../../../connectors/rules.js';
11
11
  /** `Set` counterpart to {@link withoutKey}: removes `value`, preserving
12
12
  * referential identity when it was already absent. */
13
- export function withoutSetMember(set, value) {
13
+ export function withoutSetMember({ set, value }, _optional = {}) {
14
14
  if (!set.has(value))
15
15
  return set;
16
16
  const next = new Set(set);
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // body. OD's real `runtime/markdown.tsx` (2,881 lines) is chat/artifact
4
4
  // rendering territory, explicitly deferred to `@jini-ai/chat`'s `./react` subpath (formerly
5
5
  // this package's own `./chat` export, extracted 2026-08-03)/this package's own `./renderers`
6
- // subpath (see `archived UI source map`) — this is a
6
+ // subpath (see `070311a07^:packages/ui/source-map.md` (section "features/memory/")) — this is a
7
7
  // scoped-down local reimplementation covering just this slice's one need:
8
8
  // render a memory body's GFM Markdown as read-only preview text. Built on
9
9
  // `micromark`, already a real dependency of this package (see
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Hover and accessible attributes for a navigation button that may be unavailable. Keep hover
3
+ * explanations on aria-disabled buttons: native disabled suppresses their tooltips.
4
+ * @param required.labels.unavailable the host's copy for an unavailable destination.
5
+ * @complexity O(1).
6
+ */
7
+ export declare function navAvailability({ label, disabled, labels }: {
8
+ label: string;
9
+ disabled?: boolean;
10
+ labels: {
11
+ readonly unavailable: string;
12
+ };
13
+ }, _optional?: {}): {
14
+ 'data-tip': string;
15
+ title?: string;
16
+ 'aria-description'?: string;
17
+ };
18
+ //# sourceMappingURL=nav-availability.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Hover and accessible attributes for a navigation button that may be unavailable. Keep hover
3
+ * explanations on aria-disabled buttons: native disabled suppresses their tooltips.
4
+ * @param required.labels.unavailable the host's copy for an unavailable destination.
5
+ * @complexity O(1).
6
+ */
7
+ export function navAvailability({ label, disabled, labels }, _optional = {}) {
8
+ if (!disabled)
9
+ return { 'data-tip': label };
10
+ return { 'data-tip': `${label} — ${labels.unavailable}`, title: labels.unavailable, 'aria-description': labels.unavailable };
11
+ }
12
+ //# sourceMappingURL=nav-availability.js.map
@@ -0,0 +1,39 @@
1
+ import type { StepperBounds } from "./number-stepper.js";
2
+ import type { useNumberStepper } from "./use-number-stepper.hooks.js";
3
+ import type { NumberSetting } from "./use-optimistic-number-setting.hooks.js";
4
+ /** Every visible or spoken string the stepper shows; product copy comes from the host. */
5
+ export interface NumberStepperLabels {
6
+ decrease: string;
7
+ increase: string;
8
+ field: string;
9
+ tip: string;
10
+ }
11
+ /** Host classes added beside the stepper's own `jini-number-stepper*` classes. */
12
+ export interface NumberStepperClassNames {
13
+ group?: string;
14
+ step?: string;
15
+ value?: string;
16
+ tip?: string;
17
+ }
18
+ export interface NumberStepperProps {
19
+ setting: NumberSetting;
20
+ bounds: StepperBounds;
21
+ labels: NumberStepperLabels;
22
+ /** Id of the element that names the control (the row's visible label). */
23
+ labelledBy: string;
24
+ /** The host passes `useNumberStepper` (or a stand-in); the component never picks one itself. */
25
+ /** REQUIRED host-supplied hooks (owner rule: hooks reach a Jini component as props). */
26
+ hooks: {
27
+ useNumberStepper: typeof useNumberStepper;
28
+ };
29
+ classNames?: NumberStepperClassNames;
30
+ }
31
+ /**
32
+ * − / number / +, saving every step and every typed digit at once. The field is the one tab stop (a
33
+ * spinbutton); − and + are pointer and touch targets, as in the WAI spinbutton pattern. The tip hangs
34
+ * on the whole control for hover and keyboard focus, and on the field itself because a tapped text
35
+ * field is `:focus-visible`, which is what the `jini-tooltip` layer needs to show a tip after a touch
36
+ * (a tapped button is not).
37
+ */
38
+ export declare function NumberStepper({ setting, bounds, labels, labelledBy, hooks, classNames }: NumberStepperProps): import("react").JSX.Element;
39
+ //# sourceMappingURL=NumberStepper.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const join = (own, host) => (host ? `${own} ${host}` : own);
3
+ /**
4
+ * − / number / +, saving every step and every typed digit at once. The field is the one tab stop (a
5
+ * spinbutton); − and + are pointer and touch targets, as in the WAI spinbutton pattern. The tip hangs
6
+ * on the whole control for hover and keyboard focus, and on the field itself because a tapped text
7
+ * field is `:focus-visible`, which is what the `jini-tooltip` layer needs to show a tip after a touch
8
+ * (a tapped button is not).
9
+ */
10
+ export function NumberStepper({ setting, bounds, labels, labelledBy, hooks, classNames = {} }) {
11
+ const { draft, setDraft, value, save, onChange, onKeyDown } = hooks.useNumberStepper({ setting, bounds });
12
+ const tipId = `${labelledBy}-tip`;
13
+ const stepClass = join("jini-number-stepper__step", classNames.step);
14
+ return (_jsxs("div", { className: `${join("jini-number-stepper", classNames.group)} jini-tooltip`, role: "group", "aria-labelledby": labelledBy, "data-tooltip": labels.tip, "data-tooltip-placement": "bottom", children: [_jsx("button", { type: "button", className: stepClass, tabIndex: -1, "aria-label": labels.decrease, disabled: value <= bounds.min, onClick: () => save({ next: value - 1 }), children: _jsx("svg", { viewBox: "0 0 12 12", "aria-hidden": "true", children: _jsx("path", { d: "M2.5 6h7" }) }) }), _jsx("input", { className: `${join("jini-number-stepper__value", classNames.value)} jini-tooltip`, "data-tooltip": labels.tip, "data-tooltip-placement": "bottom", type: "text", inputMode: "numeric", role: "spinbutton", "aria-label": labels.field, "aria-describedby": tipId, "aria-valuemin": bounds.min, "aria-valuemax": bounds.max, "aria-valuenow": value, value: draft ?? String(value), onFocus: (event) => event.currentTarget.select(), onChange: (event) => onChange({ text: event.currentTarget.value }), onBlur: () => setDraft(null), onKeyDown: onKeyDown }), _jsx("button", { type: "button", className: stepClass, tabIndex: -1, "aria-label": labels.increase, disabled: value >= bounds.max, onClick: () => save({ next: value + 1 }), children: _jsx("svg", { viewBox: "0 0 12 12", "aria-hidden": "true", children: _jsx("path", { d: "M2.5 6h7M6 2.5v7" }) }) }), _jsx("span", { id: tipId, className: join("jini-number-stepper__tip", classNames.tip), children: labels.tip })] }));
15
+ }
16
+ //# sourceMappingURL=NumberStepper.js.map
@@ -0,0 +1,5 @@
1
+ export { NumberStepper, type NumberStepperClassNames, type NumberStepperLabels, type NumberStepperProps } from "./NumberStepper.js";
2
+ export { useNumberStepper, type NumberStepperController } from "./use-number-stepper.hooks.js";
3
+ export { useOptimisticNumberSetting, type NumberSetting, type NumberSettingWrite } from "./use-optimistic-number-setting.hooks.js";
4
+ export { acceptedSavedValue, clampToBounds, numberFromTypedDigit, stepperKeyTarget, type StepperBounds } from "./number-stepper.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ export { NumberStepper } from "./NumberStepper.js";
2
+ export { useNumberStepper } from "./use-number-stepper.hooks.js";
3
+ export { useOptimisticNumberSetting } from "./use-optimistic-number-setting.hooks.js";
4
+ export { acceptedSavedValue, clampToBounds, numberFromTypedDigit, stepperKeyTarget } from "./number-stepper.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file Pure rules for a small whole-number stepper (− / field / +) over host-injected bounds.
3
+ * The typed-field rule reads one digit, so it is meant for ranges whose upper limit is a single digit.
4
+ */
5
+ /** The inclusive range a stepper allows. The host owns the numbers (they are product policy). */
6
+ export interface StepperBounds {
7
+ readonly min: number;
8
+ readonly max: number;
9
+ }
10
+ /** `value` pulled into `bounds`. O(1). */
11
+ export declare function clampToBounds({ value, bounds }: {
12
+ value: number;
13
+ bounds: StepperBounds;
14
+ }, _options?: {}): number;
15
+ /** The spinbutton keys and where each one goes from `value`; `null` for any other key. O(1). */
16
+ export declare function stepperKeyTarget({ key, value, bounds }: {
17
+ key: string;
18
+ value: number;
19
+ bounds: StepperBounds;
20
+ }, _options?: {}): number | null;
21
+ /** A typed field's number: its last digit, clamped (the range is single digits, so typing after the
22
+ * digit already there means the new one). `null` while the field holds no digit. O(text). */
23
+ export declare function numberFromTypedDigit({ text, bounds }: {
24
+ text: string;
25
+ bounds: StepperBounds;
26
+ }, _options?: {}): number | null;
27
+ /** The store's answer to a save as a whole number at or above the lower limit, clamped to the upper
28
+ * one; anything else keeps what is shown (`current`). O(1). */
29
+ export declare function acceptedSavedValue({ value, current, bounds }: {
30
+ value: unknown;
31
+ current: number;
32
+ bounds: StepperBounds;
33
+ }, _options?: {}): number;
34
+ //# sourceMappingURL=number-stepper.d.ts.map
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @file Pure rules for a small whole-number stepper (− / field / +) over host-injected bounds.
3
+ * The typed-field rule reads one digit, so it is meant for ranges whose upper limit is a single digit.
4
+ */
5
+ /** `value` pulled into `bounds`. O(1). */
6
+ export function clampToBounds({ value, bounds }, _options = {}) {
7
+ return Math.min(bounds.max, Math.max(bounds.min, value));
8
+ }
9
+ /** The spinbutton keys and where each one goes from `value`; `null` for any other key. O(1). */
10
+ export function stepperKeyTarget({ key, value, bounds }, _options = {}) {
11
+ if (key === "ArrowUp")
12
+ return Math.min(bounds.max, value + 1);
13
+ if (key === "ArrowDown")
14
+ return Math.max(bounds.min, value - 1);
15
+ if (key === "Home")
16
+ return bounds.min;
17
+ if (key === "End")
18
+ return bounds.max;
19
+ return null;
20
+ }
21
+ /** A typed field's number: its last digit, clamped (the range is single digits, so typing after the
22
+ * digit already there means the new one). `null` while the field holds no digit. O(text). */
23
+ export function numberFromTypedDigit({ text, bounds }, _options = {}) {
24
+ const digit = text.replace(/\D/g, "").slice(-1);
25
+ return digit === "" ? null : clampToBounds({ value: Number(digit), bounds });
26
+ }
27
+ /** The store's answer to a save as a whole number at or above the lower limit, clamped to the upper
28
+ * one; anything else keeps what is shown (`current`). O(1). */
29
+ export function acceptedSavedValue({ value, current, bounds }, _options = {}) {
30
+ return typeof value === "number" && Number.isInteger(value) && value >= bounds.min ? clampToBounds({ value, bounds }) : current;
31
+ }
32
+ //# sourceMappingURL=number-stepper.js.map
@@ -0,0 +1,20 @@
1
+ import { type KeyboardEvent } from "react";
2
+ import { type StepperBounds } from "./number-stepper.js";
3
+ import type { NumberSetting } from "./use-optimistic-number-setting.hooks.js";
4
+ /** What {@link useNumberStepper} hands the stepper: the field's draft and its handlers. */
5
+ export interface NumberStepperController {
6
+ draft: string | null;
7
+ setDraft: (draft: string | null) => void;
8
+ value: number;
9
+ save: NumberSetting["save"];
10
+ onChange: (input: {
11
+ text: string;
12
+ }) => void;
13
+ onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
14
+ }
15
+ /** Manage the editable value and spinbutton keys of a {@link NumberSetting} within `bounds`. */
16
+ export declare function useNumberStepper({ setting, bounds }: {
17
+ setting: NumberSetting;
18
+ bounds: StepperBounds;
19
+ }, _options?: {}): NumberStepperController;
20
+ //# sourceMappingURL=use-number-stepper.hooks.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { useState } from "react";
2
+ import { numberFromTypedDigit, stepperKeyTarget } from "./number-stepper.js";
3
+ /** Manage the editable value and spinbutton keys of a {@link NumberSetting} within `bounds`. */
4
+ export function useNumberStepper({ setting, bounds }, _options = {}) {
5
+ // `null` shows the saved value; a string is the field mid-edit (cleared, or a non-digit typed).
6
+ const [draft, setDraft] = useState(null);
7
+ const { value, save } = setting;
8
+ const onChange = ({ text }, _options = {}) => {
9
+ const next = numberFromTypedDigit({ text, bounds });
10
+ if (next === null) {
11
+ setDraft("");
12
+ return;
13
+ }
14
+ setDraft(null);
15
+ save({ next });
16
+ };
17
+ const onKeyDown = (event) => {
18
+ const next = stepperKeyTarget({ key: event.key, value, bounds });
19
+ if (next === null)
20
+ return;
21
+ // A surrounding menu's own Up/Down/Home/End would move focus to another row; here they change the number.
22
+ event.preventDefault();
23
+ event.stopPropagation();
24
+ setDraft(null);
25
+ save({ next });
26
+ };
27
+ return { draft, setDraft, value, save, onChange, onKeyDown };
28
+ }
29
+ //# sourceMappingURL=use-number-stepper.hooks.js.map
@@ -0,0 +1,36 @@
1
+ import { type StepperBounds } from "./number-stepper.js";
2
+ /** A persisted whole-number setting as a stepper consumes it. */
3
+ export interface NumberSetting {
4
+ /** False when the host has no way to persist the value: the host leaves the control out. */
5
+ available: boolean;
6
+ value: number;
7
+ /** Set after a failed save, cleared by the next one. */
8
+ error: string | null;
9
+ save: (input: {
10
+ next: number;
11
+ }) => void;
12
+ }
13
+ /** Persists a value and resolves with the store's own answer (which may differ, e.g. clamped). */
14
+ export type NumberSettingWrite = (input: {
15
+ next: number;
16
+ }) => Promise<unknown>;
17
+ /**
18
+ * The shown value moves at once on a save; a failed save puts the last value back and shows the
19
+ * host's `saveError` copy. `value`/`setValue` are the host's live view of the stored value (it may
20
+ * also change from elsewhere); `write` is undefined when the host cannot persist at all.
21
+ * @complexity O(1) per save, one write.
22
+ */
23
+ export declare function useOptimisticNumberSetting({ value, setValue, write, bounds, saveError }: {
24
+ value: number;
25
+ setValue: (input: {
26
+ next: number;
27
+ }) => void;
28
+ write: NumberSettingWrite | undefined;
29
+ bounds: StepperBounds;
30
+ saveError: string;
31
+ }, { onSaveFailure }?: {
32
+ onSaveFailure?: (input: {
33
+ failure: unknown;
34
+ }) => void;
35
+ }): NumberSetting;
36
+ //# sourceMappingURL=use-optimistic-number-setting.hooks.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { useState } from "react";
2
+ import { acceptedSavedValue } from "./number-stepper.js";
3
+ /**
4
+ * The shown value moves at once on a save; a failed save puts the last value back and shows the
5
+ * host's `saveError` copy. `value`/`setValue` are the host's live view of the stored value (it may
6
+ * also change from elsewhere); `write` is undefined when the host cannot persist at all.
7
+ * @complexity O(1) per save, one write.
8
+ */
9
+ export function useOptimisticNumberSetting({ value, setValue, write, bounds, saveError }, { onSaveFailure } = {}) {
10
+ const [error, setError] = useState(null);
11
+ const save = ({ next }, _options = {}) => {
12
+ if (!write || next === value)
13
+ return;
14
+ const previous = value;
15
+ setValue({ next });
16
+ setError(null);
17
+ void write({ next }).then((saved) => setValue({ next: acceptedSavedValue({ value: saved, current: next, bounds }) }), (failure) => {
18
+ onSaveFailure?.({ failure });
19
+ setValue({ next: previous });
20
+ setError(saveError);
21
+ });
22
+ };
23
+ return { available: write !== undefined, value, error, save };
24
+ }
25
+ //# sourceMappingURL=use-optimistic-number-setting.hooks.js.map
@@ -8,6 +8,13 @@ import {} from '@jini-ai/core/text';
8
8
  */
9
9
  export function ErrorNotice({ failure, disclosure = 'full', t = text => text, className = 'notice error', role = 'alert', useErrorNoticeHook = useErrorNotice, ...ports }) {
10
10
  const { feedback, copy } = useErrorNoticeHook({ failure, ports });
11
- return (_jsxs("div", { className: className, role: role, children: [_jsx("p", { children: failure.message }), _jsx("p", { children: failure.action }), disclosure === 'id-only' ? (failure.errorId ? _jsxs("p", { children: [failure.errorId, " \u2014 ", t('Report this error ID.')] }) : null) : _jsxs("details", { children: [_jsx("summary", { children: t('Show details') }), _jsx("pre", { style: { whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', userSelect: 'text' }, children: failure.copyText }), _jsx("button", { type: "button", onClick: () => void copy(), children: t('Copy details') }), feedback && feedback.text === failure.copyText ? _jsx("p", { role: "status", children: t(feedback.copied ? 'Copied' : 'Copy failed. Select the details and copy them manually.') }) : null] })] }));
11
+ const feedbackText = copyFeedbackText({ feedback, copyText: failure.copyText });
12
+ return (_jsxs("div", { className: className, role: role, children: [_jsx("p", { children: failure.message }), _jsx("p", { children: failure.action }), disclosure === 'id-only' ? (failure.errorId ? _jsxs("p", { children: [failure.errorId, " \u2014 ", t('Report this error ID.')] }) : null) : _jsxs("details", { children: [_jsx("summary", { children: t('Show details') }), _jsx("pre", { style: { whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', userSelect: 'text' }, children: failure.copyText }), _jsx("button", { type: "button", onClick: () => void copy(), children: t('Copy details') }), feedbackText !== null ? _jsx("p", { role: "status", children: t(feedbackText) }) : null] })] }));
13
+ }
14
+ /** Feedback only describes the incident it copied; a stale result from an earlier incident shows nothing. */
15
+ function copyFeedbackText({ feedback, copyText }, _optional = {}) {
16
+ if (!feedback || feedback.text !== copyText)
17
+ return null;
18
+ return feedback.copied ? 'Copied' : 'Copy failed. Select the details and copy them manually.';
12
19
  }
13
20
  //# sourceMappingURL=ErrorNotice.js.map
@@ -1,4 +1,4 @@
1
- import type { StandingDraftAutosaveInput, StandingDraftAutosaveSnapshot } from "../hooks/use-standing-draft-autosave.hooks.js";
1
+ import type { StandingDraftAutosaveInput, StandingDraftAutosaveSnapshot } from "@jini-ai/core/contracts/standing-draft";
2
2
  /**
3
3
  * @file Last-resort per-tab mirror for a standing draft the SERVER REFUSED (2026-09-06 stale-basis
4
4
  * fix). Deliberately NOT a general autosave backend — browser storage was explicitly rejected for
@@ -1,4 +1,4 @@
1
- import type { StandingDraftAutosaveSnapshot } from "../hooks/use-standing-draft-autosave.hooks.js";
1
+ import type { StandingDraftAutosaveSnapshot } from "@jini-ai/core/contracts/standing-draft";
2
2
  /** Compare timestamps explicitly; restoration only changes the working copy, never the server. */
3
3
  export declare function standingDraftRecoveryMessage({ draft, t, serverUpdatedAt }: {
4
4
  draft: StandingDraftAutosaveSnapshot;