@jini-ai/ui 0.7.1 → 0.7.3-next.1

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 (968) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +15 -22
  3. package/dist/browser/index.d.ts +1 -0
  4. package/dist/browser/index.js +2 -1
  5. package/dist/browser/useDismissOnOutsideOrEscape.d.ts +4 -1
  6. package/dist/browser/useDismissOnOutsideOrEscape.js +5 -5
  7. package/dist/browser/useFileDropTarget.js +21 -18
  8. package/dist/browser/useGlobalKeydown.js +1 -1
  9. package/dist/browser/useMenuKeyboard.d.ts +34 -0
  10. package/dist/browser/useMenuKeyboard.js +55 -0
  11. package/dist/browser/useModalWindowDragGuard.d.ts +4 -1
  12. package/dist/browser/useModalWindowDragGuard.js +2 -2
  13. package/dist/core/theme/css-name.d.ts +3 -1
  14. package/dist/core/theme/css-name.js +1 -1
  15. package/dist/core/theme/stylesheet.js +1 -1
  16. package/dist/core.d.ts +2 -0
  17. package/dist/core.js +2 -0
  18. package/dist/features/a2ui/catalog-from-registry.d.ts +10 -4
  19. package/dist/features/a2ui/catalog-from-registry.js +1 -1
  20. package/dist/features/a2ui/index.d.ts +1 -2
  21. package/dist/features/a2ui/index.js +0 -1
  22. package/dist/features/a2ui/renderer.d.ts +13 -2
  23. package/dist/features/a2ui/renderer.hooks.d.ts +19 -0
  24. package/dist/features/a2ui/renderer.hooks.js +26 -0
  25. package/dist/features/a2ui/renderer.js +5 -19
  26. package/dist/features/a2ui/use-a2ui-surface.d.ts +1 -1
  27. package/dist/features/about/react/components/AboutTab.d.ts +16 -1
  28. package/dist/features/about/react/components/AboutTab.js +6 -6
  29. package/dist/features/about/react/hooks/useSilentUpdatesToggle.js +3 -3
  30. package/dist/features/about/rules.d.ts +19 -5
  31. package/dist/features/about/rules.js +5 -5
  32. package/dist/features/admin-widgets/components/ComingSoonNotice.js +2 -2
  33. package/dist/features/admin-widgets/components/ComingSoonPanel.js +1 -1
  34. package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +4 -1
  35. package/dist/features/admin-widgets/components/ImagePreviewModal.js +4 -4
  36. package/dist/features/admin-widgets/components/InfoTip.d.ts +4 -1
  37. package/dist/features/admin-widgets/components/InfoTip.hooks.js +67 -54
  38. package/dist/features/admin-widgets/components/InfoTip.js +12 -4
  39. package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +2 -9
  40. package/dist/features/admin-widgets/components/InfoTip.rules.js +3 -3
  41. package/dist/features/admin-widgets/components/Lightbox/Lightbox.d.ts +1 -1
  42. package/dist/features/admin-widgets/components/Lightbox/Lightbox.hooks.js +4 -6
  43. package/dist/features/admin-widgets/components/Lightbox/Lightbox.js +2 -2
  44. package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +4 -1
  45. package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +4 -4
  46. package/dist/features/admin-widgets/components/Select/Select.d.ts +13 -3
  47. package/dist/features/admin-widgets/components/Select/Select.hooks.d.ts +4 -0
  48. package/dist/features/admin-widgets/components/Select/Select.hooks.js +14 -3
  49. package/dist/features/admin-widgets/components/Select/Select.js +29 -19
  50. package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.d.ts +12 -2
  51. package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.hooks.d.ts +5 -0
  52. package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.hooks.js +7 -1
  53. package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.js +9 -8
  54. package/dist/features/appearance/react/components/AppearanceTab.d.ts +3 -1
  55. package/dist/features/appearance/react/components/AppearanceTab.js +8 -4
  56. package/dist/features/appearance/types.d.ts +1 -1
  57. package/dist/features/appearance/types.js +1 -1
  58. package/dist/features/asset-grid/dependencies.js +6 -6
  59. package/dist/features/asset-grid/react/components/AssetCard.d.ts +13 -2
  60. package/dist/features/asset-grid/react/components/AssetCard.hooks.d.ts +9 -0
  61. package/dist/features/asset-grid/react/components/AssetCard.hooks.js +23 -0
  62. package/dist/features/asset-grid/react/components/AssetCard.js +12 -24
  63. package/dist/features/asset-grid/react/components/AssetGrid.d.ts +16 -3
  64. package/dist/features/asset-grid/react/components/AssetGrid.hooks.d.ts +56 -0
  65. package/dist/features/asset-grid/react/components/AssetGrid.hooks.js +143 -0
  66. package/dist/features/asset-grid/react/components/AssetGrid.js +14 -143
  67. package/dist/features/asset-grid/react/components/AssetGridBody.d.ts +4 -1
  68. package/dist/features/asset-grid/react/components/AssetGridBody.js +7 -7
  69. package/dist/features/asset-grid/react/components/AssetGridToolbar.d.ts +3 -1
  70. package/dist/features/asset-grid/react/components/AssetGridToolbar.js +14 -3
  71. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +6 -2
  72. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +7 -7
  73. package/dist/features/asset-grid/react/components/SelectionActionBar.d.ts +3 -1
  74. package/dist/features/asset-grid/react/components/SelectionActionBar.js +3 -3
  75. package/dist/features/asset-grid/react/components/SelectionBand.js +1 -1
  76. package/dist/features/asset-grid/react/components/useAssetGridFilters.js +2 -2
  77. package/dist/features/asset-grid/react/hooks/useAssetGridData.js +4 -4
  78. package/dist/features/asset-grid/react/hooks/useAssetGridKeyboardShortcuts.js +1 -1
  79. package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.d.ts +3 -1
  80. package/dist/features/asset-grid/react/hooks/useAssetGridLiveUpdates.js +129 -128
  81. package/dist/features/asset-grid/react/hooks/useAssetGridSelection.js +4 -4
  82. package/dist/features/asset-grid/react/hooks/useRubberBandDrag.js +79 -70
  83. package/dist/features/asset-grid/rules.d.ts +83 -22
  84. package/dist/features/asset-grid/rules.js +23 -23
  85. package/dist/features/asset-tree-browser/dependencies.js +10 -10
  86. package/dist/features/asset-tree-browser/index.d.ts +1 -1
  87. package/dist/features/asset-tree-browser/index.js +1 -1
  88. package/dist/features/asset-tree-browser/react/components/AssetTreeBreadcrumbs.d.ts +3 -1
  89. package/dist/features/asset-tree-browser/react/components/AssetTreeBreadcrumbs.js +4 -4
  90. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +8 -3
  91. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +4 -4
  92. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowserParts.d.ts +6 -2
  93. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowserParts.js +16 -16
  94. package/dist/features/asset-tree-browser/react/components/AssetTreeEmptyState.d.ts +3 -1
  95. package/dist/features/asset-tree-browser/react/components/AssetTreeEmptyState.js +3 -3
  96. package/dist/features/asset-tree-browser/react/components/AssetTreeFileRow.d.ts +5 -1
  97. package/dist/features/asset-tree-browser/react/components/AssetTreeFileRow.hooks.d.ts +8 -0
  98. package/dist/features/asset-tree-browser/react/components/AssetTreeFileRow.hooks.js +26 -0
  99. package/dist/features/asset-tree-browser/react/components/AssetTreeFileRow.js +53 -52
  100. package/dist/features/asset-tree-browser/react/components/AssetTreeFolderRow.d.ts +3 -1
  101. package/dist/features/asset-tree-browser/react/components/AssetTreeFolderRow.js +3 -3
  102. package/dist/features/asset-tree-browser/react/components/AssetTreeRowMenu.d.ts +3 -1
  103. package/dist/features/asset-tree-browser/react/components/AssetTreeRowMenu.js +3 -3
  104. package/dist/features/asset-tree-browser/react/components/AssetTreeSelectionBar.d.ts +3 -1
  105. package/dist/features/asset-tree-browser/react/components/AssetTreeSelectionBar.js +3 -3
  106. package/dist/features/asset-tree-browser/react/components/AssetTreeToolbar.d.ts +3 -1
  107. package/dist/features/asset-tree-browser/react/components/AssetTreeToolbar.js +3 -3
  108. package/dist/features/asset-tree-browser/react/components/AssetTreeUploadErrorBanner.d.ts +3 -1
  109. package/dist/features/asset-tree-browser/react/components/AssetTreeUploadErrorBanner.js +3 -3
  110. package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +5 -2
  111. package/dist/features/asset-tree-browser/react/components/FilePreviewPane.js +5 -5
  112. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeBatchActions.d.ts +4 -1
  113. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeBatchActions.js +2 -2
  114. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeNavigation.js +3 -3
  115. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeRename.js +2 -2
  116. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeRowMenu.js +1 -1
  117. package/dist/features/asset-tree-browser/react/hooks/useAssetTreeSelection.js +2 -2
  118. package/dist/features/asset-tree-browser/rules.d.ts +70 -17
  119. package/dist/features/asset-tree-browser/rules.js +17 -17
  120. package/dist/features/browser-chrome/dependencies.js +3 -3
  121. package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +6 -2
  122. package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +4 -4
  123. package/dist/features/browser-chrome/react/hooks/useBrowserBridgeRegistration.d.ts +4 -1
  124. package/dist/features/browser-chrome/react/hooks/useBrowserBridgeRegistration.js +1 -1
  125. package/dist/features/browser-chrome/react/hooks/useBrowserHistory.d.ts +4 -1
  126. package/dist/features/browser-chrome/react/hooks/useBrowserHistory.js +2 -3
  127. package/dist/features/browser-chrome/react/hooks/useBrowserNavigationStack.js +5 -5
  128. package/dist/features/browser-chrome/rules.d.ts +76 -16
  129. package/dist/features/browser-chrome/rules.js +32 -32
  130. package/dist/features/browser-chrome/types.js +1 -1
  131. package/dist/features/charts/browser.d.ts +2 -2
  132. package/dist/features/charts/browser.js +64 -32
  133. package/dist/features/charts/catalog-manifests.d.ts +1 -1
  134. package/dist/features/charts/catalog-manifests.js +1 -0
  135. package/dist/features/charts/contract.d.ts +2 -43
  136. package/dist/features/charts/contract.js +1 -2
  137. package/dist/features/charts/default-theme.d.ts +3 -0
  138. package/dist/features/charts/default-theme.js +2 -0
  139. package/dist/features/charts/react.d.ts +1 -1
  140. package/dist/features/charts/react.js +3 -1
  141. package/dist/features/charts/registry.d.ts +3 -3
  142. package/dist/features/charts/table.d.ts +1 -1
  143. package/dist/features/charts/wire.d.ts +16 -16
  144. package/dist/features/charts/wire.js +1 -0
  145. package/dist/features/command-palette/dependencies.js +2 -2
  146. package/dist/features/command-palette/ports.js +1 -1
  147. package/dist/features/command-palette/react/components/CommandPalette.d.ts +6 -2
  148. package/dist/features/command-palette/react/components/CommandPalette.hooks.d.ts +8 -0
  149. package/dist/features/command-palette/react/components/CommandPalette.hooks.js +14 -0
  150. package/dist/features/command-palette/react/components/CommandPalette.js +5 -12
  151. package/dist/features/command-palette/react/hooks/useCommandPalette.js +2 -2
  152. package/dist/features/command-palette/rules.d.ts +22 -5
  153. package/dist/features/command-palette/rules.js +6 -6
  154. package/dist/features/connectors/ConnectorsBrowser.d.ts +13 -2
  155. package/dist/features/connectors/ConnectorsBrowser.hooks.d.ts +41 -0
  156. package/dist/features/connectors/ConnectorsBrowser.hooks.js +50 -0
  157. package/dist/features/connectors/ConnectorsBrowser.js +7 -45
  158. package/dist/features/connectors/components/ConnectorAlertList.d.ts +3 -1
  159. package/dist/features/connectors/components/ConnectorAlertList.js +3 -3
  160. package/dist/features/connectors/components/ConnectorCard.d.ts +5 -1
  161. package/dist/features/connectors/components/ConnectorCard.hooks.d.ts +15 -0
  162. package/dist/features/connectors/components/ConnectorCard.hooks.js +39 -0
  163. package/dist/features/connectors/components/ConnectorCard.js +29 -50
  164. package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +17 -2
  165. package/dist/features/connectors/components/ConnectorDetailDrawer.js +34 -38
  166. package/dist/features/connectors/components/ConnectorGate.js +1 -1
  167. package/dist/features/connectors/components/ConnectorGrid.js +4 -4
  168. package/dist/features/connectors/components/ConnectorLogo.js +3 -3
  169. package/dist/features/connectors/components/ConnectorSearchBar.d.ts +5 -1
  170. package/dist/features/connectors/components/ConnectorSearchBar.hooks.d.ts +9 -0
  171. package/dist/features/connectors/components/ConnectorSearchBar.hooks.js +15 -0
  172. package/dist/features/connectors/components/ConnectorSearchBar.js +5 -13
  173. package/dist/features/connectors/components/ProviderTabBar.d.ts +3 -1
  174. package/dist/features/connectors/components/ProviderTabBar.js +4 -4
  175. package/dist/features/connectors/dependencies.js +15 -15
  176. package/dist/features/connectors/hooks/useConnectorAuthorization.d.ts +10 -8
  177. package/dist/features/connectors/hooks/useConnectorAuthorization.js +76 -95
  178. package/dist/features/connectors/hooks/useConnectorCatalog.d.ts +2 -0
  179. package/dist/features/connectors/hooks/useConnectorCatalog.js +11 -8
  180. package/dist/features/connectors/hooks/useConnectorDetail.js +5 -18
  181. package/dist/features/connectors/hooks/useWiredConnectorsBrowser.d.ts +2 -0
  182. package/dist/features/connectors/hooks/useWiredConnectorsBrowser.js +12 -7
  183. package/dist/features/connectors/rules.d.ts +123 -30
  184. package/dist/features/connectors/rules.js +51 -43
  185. package/dist/features/execution/claude/env-fields.d.ts +3 -0
  186. package/dist/features/execution/claude/env-fields.js +22 -0
  187. package/dist/features/execution/codex/env-fields.d.ts +3 -0
  188. package/dist/features/execution/codex/env-fields.js +36 -0
  189. package/dist/features/execution/constants.js +4 -52
  190. package/dist/features/execution/dependencies.js +15 -10
  191. package/dist/features/execution/http-adapter.d.ts +1 -1
  192. package/dist/features/execution/http-adapter.js +43 -38
  193. package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +3 -1
  194. package/dist/features/execution/react/components/AgentCliEnvFields.js +4 -4
  195. package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +3 -1
  196. package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -3
  197. package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -1
  198. package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +26 -0
  199. package/dist/features/execution/react/components/ByokProviderForm.hooks.js +29 -0
  200. package/dist/features/execution/react/components/ByokProviderForm.js +35 -52
  201. package/dist/features/execution/react/components/ExecutionTab.d.ts +6 -2
  202. package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +30 -0
  203. package/dist/features/execution/react/components/ExecutionTab.hooks.js +68 -0
  204. package/dist/features/execution/react/components/ExecutionTab.js +13 -69
  205. package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +10 -1
  206. package/dist/features/execution/react/components/LocalCliAgentCard.js +19 -14
  207. package/dist/features/execution/react/components/LocalCliAgentList.d.ts +5 -1
  208. package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +12 -0
  209. package/dist/features/execution/react/components/LocalCliAgentList.hooks.js +15 -0
  210. package/dist/features/execution/react/components/LocalCliAgentList.js +8 -14
  211. package/dist/features/execution/react/components/LocalCliAgentSettings.js +15 -6
  212. package/dist/features/execution/react/components/ProviderChipGroup.js +1 -1
  213. package/dist/features/execution/react/components/SearchableModelSelect.d.ts +5 -2
  214. package/dist/features/execution/react/components/SearchableModelSelect.hooks.d.ts +14 -0
  215. package/dist/features/execution/react/components/SearchableModelSelect.hooks.js +33 -0
  216. package/dist/features/execution/react/components/SearchableModelSelect.js +5 -31
  217. package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.js +1 -1
  218. package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
  219. package/dist/features/execution/react/hooks/use-execution-credential.hooks.js +34 -9
  220. package/dist/features/execution/react/hooks/useExecutionTab.js +65 -39
  221. package/dist/features/execution/react/hooks/useLocalCliAgentCard.js +2 -2
  222. package/dist/features/execution/react/hooks/useLocalCliAgentList.js +1 -1
  223. package/dist/features/execution/react/hooks/useReasoningControl.js +8 -8
  224. package/dist/features/execution/rules.d.ts +145 -35
  225. package/dist/features/execution/rules.js +45 -45
  226. package/dist/features/external-mcp/react/components/ExternalMcpTab.d.ts +12 -1
  227. package/dist/features/external-mcp/react/components/ExternalMcpTab.js +9 -8
  228. package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +11 -2
  229. package/dist/features/file-dropzone/react/components/FileDropzone.js +18 -7
  230. package/dist/features/file-dropzone/react/components/FileDropzoneLightbox.d.ts +3 -1
  231. package/dist/features/file-dropzone/react/components/FileDropzoneLightbox.js +4 -4
  232. package/dist/features/file-dropzone/react/components/FileDropzoneNameList.d.ts +3 -1
  233. package/dist/features/file-dropzone/react/components/FileDropzoneNameList.js +2 -2
  234. package/dist/features/file-dropzone/react/components/FileDropzoneThumbnailGrid.d.ts +3 -1
  235. package/dist/features/file-dropzone/react/components/FileDropzoneThumbnailGrid.js +2 -2
  236. package/dist/features/file-dropzone/react/components/FileDropzoneZone.d.ts +5 -1
  237. package/dist/features/file-dropzone/react/components/FileDropzoneZone.hooks.d.ts +12 -0
  238. package/dist/features/file-dropzone/react/components/FileDropzoneZone.hooks.js +21 -0
  239. package/dist/features/file-dropzone/react/components/FileDropzoneZone.js +5 -18
  240. package/dist/features/file-dropzone/react/hooks/useFileDialogTracking.js +20 -22
  241. package/dist/features/file-dropzone/react/hooks/useFileDropzone.d.ts +1 -1
  242. package/dist/features/file-dropzone/react/hooks/useFileDropzone.js +74 -57
  243. package/dist/features/file-dropzone/react/hooks/useFileDropzonePreviews.js +2 -2
  244. package/dist/features/file-dropzone/rules.d.ts +15 -4
  245. package/dist/features/file-dropzone/rules.js +5 -5
  246. package/dist/features/file-dropzone/types.d.ts +1 -1
  247. package/dist/features/file-dropzone/types.js +1 -1
  248. package/dist/features/find/find-query-scheduler.d.ts +22 -0
  249. package/dist/features/find/find-query-scheduler.js +28 -0
  250. package/dist/features/folder-path-drop/rules.d.ts +4 -1
  251. package/dist/features/folder-path-drop/rules.js +2 -2
  252. package/dist/features/html-editor/canvas-content-wrapper.d.ts +4 -1
  253. package/dist/features/html-editor/canvas-content-wrapper.js +2 -2
  254. package/dist/features/html-editor/canvas-embed-placeholders.d.ts +4 -1
  255. package/dist/features/html-editor/canvas-embed-placeholders.js +1 -1
  256. package/dist/features/html-editor/css.d.ts +3 -1
  257. package/dist/features/html-editor/css.js +107 -120
  258. package/dist/features/html-editor/dom.d.ts +0 -14
  259. package/dist/features/html-editor/dom.js +0 -19
  260. package/dist/features/html-editor/editor-serialization.d.ts +4 -2
  261. package/dist/features/html-editor/editor-serialization.js +18 -15
  262. package/dist/features/html-editor/index.d.ts +0 -1
  263. package/dist/features/html-editor/index.js +0 -1
  264. package/dist/features/html-editor/protected-elements.js +24 -21
  265. package/dist/features/html-editor/react/components/InteractiveHtmlEditor.d.ts +4 -2
  266. package/dist/features/html-editor/react/components/InteractiveHtmlEditor.js +2 -2
  267. package/dist/features/html-editor/react/hooks/useInteractiveHtmlEditor.d.ts +2 -0
  268. package/dist/features/html-editor/react/hooks/useInteractiveHtmlEditor.js +4 -4
  269. package/dist/features/html-editor/source-splice.d.ts +14 -5
  270. package/dist/features/html-editor/source-splice.js +7 -7
  271. package/dist/features/html-viewer/constants.d.ts +1 -1
  272. package/dist/features/html-viewer/constants.js +1 -1
  273. package/dist/features/html-viewer/dependencies.js +1 -1
  274. package/dist/features/html-viewer/react/components/DeckNavigationControls.d.ts +3 -1
  275. package/dist/features/html-viewer/react/components/DeckNavigationControls.js +2 -2
  276. package/dist/features/html-viewer/react/components/PresentMenu.d.ts +5 -1
  277. package/dist/features/html-viewer/react/components/PresentMenu.hooks.d.ts +8 -0
  278. package/dist/features/html-viewer/react/components/PresentMenu.hooks.js +14 -0
  279. package/dist/features/html-viewer/react/components/PresentMenu.js +4 -11
  280. package/dist/features/html-viewer/react/components/ZoomMenu.d.ts +5 -1
  281. package/dist/features/html-viewer/react/components/ZoomMenu.js +3 -3
  282. package/dist/features/html-viewer/react/hooks/useDeckNavigation.js +4 -4
  283. package/dist/features/html-viewer/react/hooks/useZoomControl.js +1 -1
  284. package/dist/features/html-viewer/rules.d.ts +23 -7
  285. package/dist/features/html-viewer/rules.js +7 -7
  286. package/dist/features/html-viewer/types.d.ts +1 -1
  287. package/dist/features/html-viewer/types.js +1 -1
  288. package/dist/features/i18n/context.d.ts +5 -2
  289. package/dist/features/i18n/context.hooks.d.ts +19 -0
  290. package/dist/features/i18n/context.hooks.js +43 -0
  291. package/dist/features/i18n/context.js +6 -39
  292. package/dist/features/i18n/dictionaries/settings-dialog.en.d.ts +1 -1
  293. package/dist/features/i18n/index.d.ts +0 -3
  294. package/dist/features/i18n/index.js +0 -2
  295. package/dist/features/i18n/locale.d.ts +5 -2
  296. package/dist/features/i18n/locale.js +2 -2
  297. package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.d.ts +5 -2
  298. package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.hooks.d.ts +9 -0
  299. package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.hooks.js +80 -0
  300. package/dist/features/iframe-pool/react/components/IframeKeepAliveProvider.js +4 -73
  301. package/dist/features/iframe-pool/react/components/PooledIframe.d.ts +4 -0
  302. package/dist/features/iframe-pool/react/components/PooledIframe.js +5 -5
  303. package/dist/features/iframe-pool/react/hooks/useIframeKeepAlivePool.js +1 -1
  304. package/dist/features/iframe-pool/rules.d.ts +11 -2
  305. package/dist/features/iframe-pool/rules.js +2 -2
  306. package/dist/features/instructions/react/components/InstructionsTab.d.ts +3 -1
  307. package/dist/features/instructions/react/components/InstructionsTab.js +3 -3
  308. package/dist/features/integrations/dependencies.js +6 -6
  309. package/dist/features/integrations/react/components/ClientPicker.d.ts +10 -1
  310. package/dist/features/integrations/react/components/ClientPicker.js +5 -4
  311. package/dist/features/integrations/react/components/CodexInstallToggleButton.d.ts +5 -1
  312. package/dist/features/integrations/react/components/CodexInstallToggleButton.js +8 -8
  313. package/dist/features/integrations/react/components/IntegrationsTab.d.ts +10 -1
  314. package/dist/features/integrations/react/components/IntegrationsTab.js +23 -18
  315. package/dist/features/integrations/react/components/SnippetBlock.d.ts +5 -1
  316. package/dist/features/integrations/react/components/SnippetBlock.hooks.d.ts +8 -0
  317. package/dist/features/integrations/react/components/SnippetBlock.hooks.js +42 -0
  318. package/dist/features/integrations/react/components/SnippetBlock.js +4 -39
  319. package/dist/features/integrations/react/hooks/useCodexInstallToggle.js +2 -2
  320. package/dist/features/integrations/react/hooks/useMcpInstallInfo.js +3 -3
  321. package/dist/features/integrations/rules.d.ts +50 -13
  322. package/dist/features/integrations/rules.js +34 -30
  323. package/dist/features/integrations/types.d.ts +1 -1
  324. package/dist/features/integrations/types.js +1 -1
  325. package/dist/features/interactive-ui/providers/native/data-table.d.ts +2 -1
  326. package/dist/features/interactive-ui/providers/native/data-table.js +2 -6
  327. package/dist/features/interactive-ui/providers/native/data-table.manifest.d.ts +6 -6
  328. package/dist/features/interactive-ui/providers/shadcn/button.js +1 -1
  329. package/dist/features/interactive-ui/providers/shadcn/card.js +5 -5
  330. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.d.ts +3 -2
  331. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +3 -3
  332. package/dist/features/interactive-ui/providers/shadcn/checkbox.js +4 -1
  333. package/dist/features/interactive-ui/providers/shadcn/data-table.d.ts +2 -1
  334. package/dist/features/interactive-ui/providers/shadcn/data-table.js +2 -6
  335. package/dist/features/interactive-ui/providers/shadcn/data-table.manifest.d.ts +6 -6
  336. package/dist/features/interactive-ui/providers/shadcn/input.js +4 -1
  337. package/dist/features/interactive-ui/providers/shadcn/label.js +1 -1
  338. package/dist/features/interactive-ui/providers/shadcn/lib/utils.d.ts +3 -1
  339. package/dist/features/interactive-ui/providers/shadcn/lib/utils.js +1 -1
  340. package/dist/features/interactive-ui/providers/shadcn/radio-group.js +5 -2
  341. package/dist/features/interactive-ui/providers/shadcn/select-field.d.ts +3 -2
  342. package/dist/features/interactive-ui/providers/shadcn/select-field.js +3 -3
  343. package/dist/features/interactive-ui/providers/shadcn/select.d.ts +2 -0
  344. package/dist/features/interactive-ui/providers/shadcn/select.js +22 -9
  345. package/dist/features/interactive-ui/providers/shadcn/table.d.ts +1 -1
  346. package/dist/features/interactive-ui/providers/shadcn/table.js +13 -7
  347. package/dist/features/interactive-ui/table-row-activation.d.ts +15 -0
  348. package/dist/features/interactive-ui/table-row-activation.js +13 -0
  349. package/dist/features/language/react/components/LanguageTab.d.ts +3 -1
  350. package/dist/features/language/react/components/LanguageTab.js +3 -3
  351. package/dist/features/list-detail-panel/react/components/ListDetailPanel.js +14 -9
  352. package/dist/features/list-detail-panel/react/hooks/useListDetailSelection.js +2 -2
  353. package/dist/features/list-detail-panel/rules.d.ts +8 -2
  354. package/dist/features/list-detail-panel/rules.js +2 -2
  355. package/dist/features/list-detail-panel/types.d.ts +1 -1
  356. package/dist/features/list-detail-panel/types.js +1 -1
  357. package/dist/features/live-views/live-views.d.ts +88 -0
  358. package/dist/features/live-views/live-views.js +116 -0
  359. package/dist/features/mcp-ui/confirmation-store.js +1 -1
  360. package/dist/features/mcp-ui/early-message-buffer.d.ts +3 -1
  361. package/dist/features/mcp-ui/early-message-buffer.js +1 -1
  362. package/dist/features/mcp-ui/escape.d.ts +8 -6
  363. package/dist/features/mcp-ui/escape.js +11 -4
  364. package/dist/features/mcp-ui/index.d.ts +0 -1
  365. package/dist/features/mcp-ui/index.js +0 -1
  366. package/dist/features/mcp-ui/protocol.d.ts +7 -11
  367. package/dist/features/mcp-ui/protocol.js +7 -10
  368. package/dist/features/mcp-ui/sandbox-proxy.d.ts +7 -3
  369. package/dist/features/mcp-ui/sandbox-proxy.js +4 -4
  370. package/dist/features/mcp-ui/secret-card.d.ts +2 -16
  371. package/dist/features/mcp-ui/sign-in-card.d.ts +3 -8
  372. package/dist/features/mcp-ui/surfaces/bridge.js +4 -4
  373. package/dist/features/mcp-ui/surfaces/checkbox.js +3 -3
  374. package/dist/features/mcp-ui/surfaces/choice-group.js +6 -6
  375. package/dist/features/mcp-ui/surfaces/confirmation.d.ts +1 -1
  376. package/dist/features/mcp-ui/surfaces/confirmation.js +12 -12
  377. package/dist/features/mcp-ui/surfaces/document.d.ts +9 -3
  378. package/dist/features/mcp-ui/surfaces/document.js +17 -17
  379. package/dist/features/mcp-ui/surfaces/fields.d.ts +9 -2
  380. package/dist/features/mcp-ui/surfaces/fields.js +3 -3
  381. package/dist/features/mcp-ui/surfaces/form.d.ts +1 -1
  382. package/dist/features/mcp-ui/surfaces/form.js +12 -12
  383. package/dist/features/mcp-ui/surfaces/host-theme.d.ts +4 -1
  384. package/dist/features/mcp-ui/surfaces/host-theme.js +1 -1
  385. package/dist/features/mcp-ui/surfaces/outcome.d.ts +1 -1
  386. package/dist/features/mcp-ui/surfaces/outcome.js +9 -9
  387. package/dist/features/mcp-ui/surfaces/select.js +4 -4
  388. package/dist/features/mcp-ui/surfaces/structured-details.js +5 -5
  389. package/dist/features/mcp-ui/surfaces/text-input.js +5 -5
  390. package/dist/features/media-providers/dependencies.js +5 -4
  391. package/dist/features/media-providers/react/components/MediaProviderCard.js +7 -7
  392. package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +7 -1
  393. package/dist/features/media-providers/react/components/MediaProvidersTab.hooks.d.ts +6 -0
  394. package/dist/features/media-providers/react/components/MediaProvidersTab.hooks.js +21 -0
  395. package/dist/features/media-providers/react/components/MediaProvidersTab.js +8 -22
  396. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +4 -4
  397. package/dist/features/media-providers/rules.d.ts +42 -12
  398. package/dist/features/media-providers/rules.js +28 -25
  399. package/dist/features/memory/async-commit-guard.d.ts +1 -1
  400. package/dist/features/memory/constants.d.ts +3 -1
  401. package/dist/features/memory/constants.js +1 -1
  402. package/dist/features/memory/dependencies.js +29 -32
  403. package/dist/features/memory/formatters.d.ts +46 -13
  404. package/dist/features/memory/formatters.js +26 -26
  405. package/dist/features/memory/react/components/MemoryAdvancedModal.d.ts +5 -2
  406. package/dist/features/memory/react/components/MemoryAdvancedModal.js +51 -31
  407. package/dist/features/memory/react/components/MemoryConnectedPanel.d.ts +5 -2
  408. package/dist/features/memory/react/components/MemoryConnectedPanel.js +39 -44
  409. package/dist/features/memory/react/components/MemoryEntryCard.d.ts +3 -1
  410. package/dist/features/memory/react/components/MemoryEntryCard.js +4 -4
  411. package/dist/features/memory/react/components/MemoryExtractionCard.d.ts +3 -1
  412. package/dist/features/memory/react/components/MemoryExtractionCard.js +6 -6
  413. package/dist/features/memory/react/components/MemoryHooksPanel.d.ts +3 -1
  414. package/dist/features/memory/react/components/MemoryHooksPanel.js +4 -4
  415. package/dist/features/memory/react/components/MemoryHowPanel.d.ts +3 -1
  416. package/dist/features/memory/react/components/MemoryHowPanel.js +3 -3
  417. package/dist/features/memory/react/components/MemoryList.d.ts +3 -1
  418. package/dist/features/memory/react/components/MemoryList.js +22 -18
  419. package/dist/features/memory/react/components/MemoryManualEditor.d.ts +5 -2
  420. package/dist/features/memory/react/components/MemoryManualEditor.js +75 -51
  421. package/dist/features/memory/react/components/MemorySettingsPanel.d.ts +3 -1
  422. package/dist/features/memory/react/components/MemorySettingsPanel.js +8 -4
  423. package/dist/features/memory/react/components/MemorySuggestionPanel.d.ts +13 -0
  424. package/dist/features/memory/react/components/MemorySuggestionPanel.js +18 -0
  425. package/dist/features/memory/react/hooks/useMemoryConfig.hooks.js +116 -100
  426. package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.d.ts +2 -13
  427. package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +45 -391
  428. package/dist/features/memory/react/hooks/useMemoryConnectors.parts.hooks.d.ts +77 -0
  429. package/dist/features/memory/react/hooks/useMemoryConnectors.parts.hooks.js +483 -0
  430. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +3 -6
  431. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +4 -12
  432. package/dist/features/memory/react/hooks/useMemoryEntries.hooks.js +159 -137
  433. package/dist/features/memory/react/hooks/useMemoryExtractions.hooks.js +36 -24
  434. package/dist/features/memory/react/hooks/useMemoryExtractions.store.js +194 -183
  435. package/dist/features/memory/react/render-markdown.js +2 -2
  436. package/dist/features/memory/rules.d.ts +19 -5
  437. package/dist/features/memory/rules.js +8 -8
  438. package/dist/features/memory/types.d.ts +1 -1
  439. package/dist/features/mention-autocomplete/react/components/MentionAutocomplete.d.ts +4 -1
  440. package/dist/features/mention-autocomplete/react/components/MentionAutocomplete.js +2 -2
  441. package/dist/features/mention-autocomplete/react/components/MentionCategoryTabs.d.ts +3 -1
  442. package/dist/features/mention-autocomplete/react/components/MentionCategoryTabs.js +2 -2
  443. package/dist/features/mention-autocomplete/react/components/MentionResultsList.d.ts +4 -1
  444. package/dist/features/mention-autocomplete/react/components/MentionResultsList.js +3 -3
  445. package/dist/features/mention-autocomplete/react/components/SelectedMentionChips.d.ts +4 -1
  446. package/dist/features/mention-autocomplete/react/components/SelectedMentionChips.js +3 -3
  447. package/dist/features/mention-autocomplete/react/hooks/useMentionAutocomplete.js +68 -49
  448. package/dist/features/mention-autocomplete/rules.d.ts +41 -8
  449. package/dist/features/mention-autocomplete/rules.js +9 -9
  450. package/dist/features/notifications/react/components/NotificationsTab.d.ts +10 -1
  451. package/dist/features/notifications/react/components/NotificationsTab.hooks.d.ts +33 -0
  452. package/dist/features/notifications/react/components/NotificationsTab.hooks.js +51 -0
  453. package/dist/features/notifications/react/components/NotificationsTab.js +16 -54
  454. package/dist/features/notifications/rules.d.ts +7 -4
  455. package/dist/features/notifications/rules.js +1 -1
  456. package/dist/features/notifications/types.d.ts +1 -1
  457. package/dist/features/observability/boot-timing.js +2 -2
  458. package/dist/features/observability/index.d.ts +0 -2
  459. package/dist/features/observability/index.js +0 -1
  460. package/dist/features/observability/install.d.ts +2 -4
  461. package/dist/features/observability/install.js +2 -4
  462. package/dist/features/observability/white-screen.js +4 -4
  463. package/dist/features/panel-kit/ErrorNotice.d.ts +7 -3
  464. package/dist/features/panel-kit/ErrorNotice.hooks.d.ts +14 -0
  465. package/dist/features/panel-kit/ErrorNotice.hooks.js +12 -0
  466. package/dist/features/panel-kit/ErrorNotice.js +5 -9
  467. package/dist/features/panel-kit/fetch-query/adapter.react.d.ts +11 -5
  468. package/dist/features/panel-kit/fetch-query/adapter.react.js +8 -6
  469. package/dist/features/panel-kit/fetch-query/adapter.tanstack.js +7 -5
  470. package/dist/features/panel-kit/fetch-query/browser-timing.d.ts +7 -0
  471. package/dist/features/panel-kit/fetch-query/browser-timing.js +8 -0
  472. package/dist/features/panel-kit/fetch-query/index.d.ts +3 -1
  473. package/dist/features/panel-kit/fetch-query/index.js +1 -0
  474. package/dist/features/panel-kit/fetch-query/use-cursor-pages.hooks.d.ts +45 -0
  475. package/dist/features/panel-kit/fetch-query/use-cursor-pages.hooks.js +56 -0
  476. package/dist/features/panel-kit/helpers/permissions.js +2 -2
  477. package/dist/features/panel-kit/helpers/retry-unreachable.d.ts +0 -4
  478. package/dist/features/panel-kit/helpers/retry-unreachable.js +0 -4
  479. package/dist/features/panel-kit/helpers/standing-draft-local-backup.js +3 -2
  480. package/dist/features/panel-kit/helpers/standing-draft-recovery-message.js +4 -2
  481. package/dist/features/panel-kit/hooks/settings-slice.helpers.d.ts +150 -0
  482. package/dist/features/panel-kit/hooks/settings-slice.helpers.js +79 -0
  483. package/dist/features/panel-kit/hooks/use-async-action.hooks.js +1 -1
  484. package/dist/features/panel-kit/hooks/use-bounded-status-poll.hooks.d.ts +29 -0
  485. package/dist/features/panel-kit/hooks/use-bounded-status-poll.hooks.js +46 -0
  486. package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.d.ts +1 -1
  487. package/dist/features/panel-kit/hooks/use-dirty-guard.hooks.js +1 -0
  488. package/dist/features/panel-kit/hooks/use-optimistic-stored-value.hooks.d.ts +39 -0
  489. package/dist/features/panel-kit/hooks/use-optimistic-stored-value.hooks.js +38 -0
  490. package/dist/features/panel-kit/hooks/use-settings-slice-refresh.hooks.d.ts +5 -0
  491. package/dist/features/panel-kit/hooks/use-settings-slice-refresh.hooks.js +81 -0
  492. package/dist/features/panel-kit/hooks/use-settings-slice-save.hooks.d.ts +4 -0
  493. package/dist/features/panel-kit/hooks/use-settings-slice-save.hooks.js +94 -0
  494. package/dist/features/panel-kit/hooks/use-settings-slice-state.hooks.d.ts +27 -0
  495. package/dist/features/panel-kit/hooks/use-settings-slice-state.hooks.js +124 -0
  496. package/dist/features/panel-kit/hooks/use-settings-slice.hooks.d.ts +12 -150
  497. package/dist/features/panel-kit/hooks/use-settings-slice.hooks.js +31 -345
  498. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +26 -2
  499. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.js +29 -295
  500. package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +13 -0
  501. package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.js +106 -0
  502. package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +23 -0
  503. package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.js +58 -0
  504. package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +29 -0
  505. package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.js +193 -0
  506. package/dist/features/panel-kit/index.d.ts +8 -8
  507. package/dist/features/panel-kit/index.js +5 -6
  508. package/dist/features/privacy/react/components/PrivacyTab.d.ts +5 -2
  509. package/dist/features/privacy/react/components/PrivacyTab.js +5 -5
  510. package/dist/features/privacy/rules.d.ts +23 -4
  511. package/dist/features/privacy/rules.js +4 -4
  512. package/dist/features/privacy/types.d.ts +1 -1
  513. package/dist/features/privacy/types.js +1 -1
  514. package/dist/features/progress-card/components/ProgressCard.d.ts +5 -2
  515. package/dist/features/progress-card/components/ProgressCard.js +8 -8
  516. package/dist/features/progress-card/reference-adapters.d.ts +22 -8
  517. package/dist/features/progress-card/reference-adapters.js +17 -17
  518. package/dist/features/progress-card/rules.d.ts +19 -7
  519. package/dist/features/progress-card/rules.js +9 -9
  520. package/dist/features/progress-card/types.d.ts +1 -1
  521. package/dist/features/progress-card/types.js +1 -1
  522. package/dist/features/project-locations/dependencies.js +16 -13
  523. package/dist/features/project-locations/react/components/ProjectLocationsTab.d.ts +6 -1
  524. package/dist/features/project-locations/react/components/ProjectLocationsTab.hooks.d.ts +6 -0
  525. package/dist/features/project-locations/react/components/ProjectLocationsTab.hooks.js +5 -0
  526. package/dist/features/project-locations/react/components/ProjectLocationsTab.js +37 -26
  527. package/dist/features/project-locations/react/hooks/useProjectLocationsTab.js +84 -48
  528. package/dist/features/project-locations/rules.d.ts +13 -3
  529. package/dist/features/project-locations/rules.js +4 -4
  530. package/dist/features/project-locations/types.d.ts +5 -0
  531. package/dist/features/resource-dashboard/dependencies.d.ts +0 -13
  532. package/dist/features/resource-dashboard/dependencies.js +25 -13
  533. package/dist/features/resource-dashboard/index.js +4 -8
  534. package/dist/features/resource-dashboard/ports.d.ts +1 -1
  535. package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +5 -2
  536. package/dist/features/resource-dashboard/react/components/ResourceBoard.js +36 -3
  537. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +2 -2
  538. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +15 -6
  539. package/dist/features/resource-dashboard/react/components/ResourceBoardView.d.ts +3 -26
  540. package/dist/features/resource-dashboard/react/components/ResourceBoardViewParts.js +4 -4
  541. package/dist/features/resource-dashboard/react/components/ResourceCard.d.ts +4 -1
  542. package/dist/features/resource-dashboard/react/components/ResourceCard.hooks.d.ts +7 -0
  543. package/dist/features/resource-dashboard/react/components/ResourceCard.hooks.js +12 -0
  544. package/dist/features/resource-dashboard/react/components/ResourceCard.js +3 -8
  545. package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
  546. package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +14 -4
  547. package/dist/features/resource-dashboard/react/components/ResourceMetrics.js +1 -1
  548. package/dist/features/resource-dashboard/react/components/ResourceRowList.d.ts +6 -1
  549. package/dist/features/resource-dashboard/react/components/ResourceRowList.js +5 -5
  550. package/dist/features/resource-dashboard/react/components/ResourceRowListItem.js +1 -1
  551. package/dist/features/resource-dashboard/react/components/ResourceRowListItemParts.js +2 -2
  552. package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
  553. package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +2 -2
  554. package/dist/features/resource-dashboard/react/components/ResourceRowListViewParts.js +3 -3
  555. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
  556. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
  557. package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
  558. package/dist/features/resource-dashboard/react/components/StatusPill.js +2 -2
  559. package/dist/features/resource-dashboard/react/components/resourceRowListProps.d.ts +6 -0
  560. package/dist/features/resource-dashboard/react/components/resourceRowListProps.js +4 -0
  561. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.d.ts +0 -11
  562. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +82 -85
  563. package/dist/features/resource-dashboard/react/hooks/useResourceRowList.js +42 -29
  564. package/dist/features/resource-dashboard/rules.d.ts +24 -11
  565. package/dist/features/resource-dashboard/rules.js +8 -27
  566. package/dist/features/revision-review/react/components/RevisionDiffCard.d.ts +4 -1
  567. package/dist/features/revision-review/react/components/RevisionDiffCard.js +4 -4
  568. package/dist/features/revision-review/react/components/RevisionHistoryList.d.ts +4 -1
  569. package/dist/features/revision-review/react/components/RevisionHistoryList.js +3 -3
  570. package/dist/features/revision-review/rules.d.ts +7 -2
  571. package/dist/features/revision-review/rules.js +2 -2
  572. package/dist/features/schedule-picker/react/components/RecurringSchedulePicker.d.ts +3 -1
  573. package/dist/features/schedule-picker/react/components/RecurringSchedulePicker.js +3 -3
  574. package/dist/features/schedule-picker/react/components/ScheduleFields.d.ts +3 -1
  575. package/dist/features/schedule-picker/react/components/ScheduleFields.js +4 -4
  576. package/dist/features/schedule-picker/react/components/ScheduleKindTabs.d.ts +3 -1
  577. package/dist/features/schedule-picker/react/components/ScheduleKindTabs.js +2 -2
  578. package/dist/features/schedule-picker/react/components/ScheduleSummary.d.ts +3 -1
  579. package/dist/features/schedule-picker/react/components/ScheduleSummary.js +4 -4
  580. package/dist/features/schedule-picker/react/components/WeekdayGrid.d.ts +3 -1
  581. package/dist/features/schedule-picker/react/components/WeekdayGrid.js +2 -2
  582. package/dist/features/schedule-picker/react/hooks/useRecurringSchedulePicker.js +3 -3
  583. package/dist/features/schedule-picker/rules.d.ts +29 -8
  584. package/dist/features/schedule-picker/rules.js +10 -10
  585. package/dist/features/settings/dialog/react/components/SettingsDialogShell.d.ts +4 -1
  586. package/dist/features/settings/dialog/react/components/SettingsDialogShell.js +2 -2
  587. package/dist/features/settings/dialog/styles/settings-dialog.css +155 -155
  588. package/dist/features/site-card/index.d.ts +2 -0
  589. package/dist/features/site-card/index.js +2 -0
  590. package/dist/features/site-card/rules.d.ts +79 -0
  591. package/dist/features/site-card/rules.js +84 -0
  592. package/dist/features/site-card/site-card.css +30 -31
  593. package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +36 -0
  594. package/dist/features/site-card/use-site-list-prefs.hooks.js +37 -0
  595. package/dist/features/sketch-editor/constants.d.ts +1 -1
  596. package/dist/features/sketch-editor/constants.js +1 -1
  597. package/dist/features/sketch-editor/dom.d.ts +49 -11
  598. package/dist/features/sketch-editor/dom.js +29 -29
  599. package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +13 -3
  600. package/dist/features/sketch-editor/react/components/SketchEditor.js +35 -26
  601. package/dist/features/sketch-editor/react/components/SketchSaveStateBadge.js +1 -1
  602. package/dist/features/sketch-editor/react/dependencies-fake.d.ts +36 -0
  603. package/dist/features/sketch-editor/react/dependencies-fake.hooks.d.ts +10 -0
  604. package/dist/features/sketch-editor/react/dependencies-fake.hooks.js +33 -0
  605. package/dist/features/sketch-editor/react/dependencies-fake.js +3 -43
  606. package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.d.ts +1 -1
  607. package/dist/features/sketch-editor/react/hooks/useSketchDomEnhancements.js +9 -9
  608. package/dist/features/sketch-editor/react/hooks/useSketchSaveWorkflow.d.ts +2 -0
  609. package/dist/features/sketch-editor/react/hooks/useSketchSaveWorkflow.js +71 -59
  610. package/dist/features/sketch-editor/react/hooks/useSketchScene.js +7 -5
  611. package/dist/features/sketch-editor/rules.d.ts +60 -15
  612. package/dist/features/sketch-editor/rules.js +20 -20
  613. package/dist/features/sketch-editor/types.d.ts +1 -1
  614. package/dist/features/sketch-editor/types.js +1 -1
  615. package/dist/features/skills/dependencies.js +30 -23
  616. package/dist/features/skills/react/components/SkillDraftForm.d.ts +3 -1
  617. package/dist/features/skills/react/components/SkillDraftForm.hooks.d.ts +12 -0
  618. package/dist/features/skills/react/components/SkillDraftForm.hooks.js +5 -0
  619. package/dist/features/skills/react/components/SkillDraftForm.js +5 -4
  620. package/dist/features/skills/react/components/SkillRow.d.ts +3 -1
  621. package/dist/features/skills/react/components/SkillRow.js +11 -7
  622. package/dist/features/skills/react/components/SkillsTab.d.ts +10 -1
  623. package/dist/features/skills/react/components/SkillsTab.js +15 -6
  624. package/dist/features/skills/react/hooks/useSkillsTab.js +6 -6
  625. package/dist/features/skills/rules.d.ts +50 -12
  626. package/dist/features/skills/rules.js +21 -18
  627. package/dist/features/source-config-list/agent-handles.d.ts +19 -46
  628. package/dist/features/source-config-list/agent-handles.js +10 -10
  629. package/dist/features/source-config-list/dependencies.d.ts +0 -13
  630. package/dist/features/source-config-list/dependencies.js +22 -11
  631. package/dist/features/source-config-list/react/components/SourceConfigAddForm.d.ts +4 -1
  632. package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +16 -16
  633. package/dist/features/source-config-list/react/components/SourceConfigField.d.ts +19 -1
  634. package/dist/features/source-config-list/react/components/SourceConfigField.js +18 -18
  635. package/dist/features/source-config-list/react/components/SourceConfigItemCard.d.ts +18 -2
  636. package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +32 -32
  637. package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
  638. package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
  639. package/dist/features/source-config-list/react/components/SourceConfigListView.js +12 -12
  640. package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +4 -2
  641. package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +9 -9
  642. package/dist/features/source-config-list/react/components/SourceConfigTrustOptions.d.ts +3 -1
  643. package/dist/features/source-config-list/react/components/SourceConfigTrustOptions.js +2 -2
  644. package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.d.ts +1 -1
  645. package/dist/features/source-config-list/react/hooks/useSourceConfigAddForm.js +5 -5
  646. package/dist/features/source-config-list/react/hooks/useSourceConfigList.js +91 -81
  647. package/dist/features/source-config-list/rules.d.ts +51 -12
  648. package/dist/features/source-config-list/rules.js +19 -24
  649. package/dist/features/source-config-list/types.d.ts +1 -1
  650. package/dist/features/source-config-list/types.js +1 -1
  651. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +5 -2
  652. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +32 -22
  653. package/dist/features/tab-launcher-menu/react/hooks/useTabLauncherMenu.js +81 -57
  654. package/dist/features/tab-launcher-menu/rules.d.ts +33 -6
  655. package/dist/features/tab-launcher-menu/rules.js +6 -6
  656. package/dist/features/tab-strip/index.d.ts +2 -0
  657. package/dist/features/tab-strip/index.js +2 -0
  658. package/dist/features/tab-strip/react/components/TabBar.d.ts +4 -1
  659. package/dist/features/tab-strip/react/components/TabBar.hooks.js +1 -1
  660. package/dist/features/tab-strip/react/components/TabBar.js +4 -4
  661. package/dist/features/tab-strip/react/components/TabStrip.d.ts +4 -3
  662. package/dist/features/tab-strip/react/components/TabStrip.js +4 -4
  663. package/dist/features/tab-strip/react/components/TabStripItem.d.ts +7 -2
  664. package/dist/features/tab-strip/react/components/TabStripItem.hooks.d.ts +11 -0
  665. package/dist/features/tab-strip/react/components/TabStripItem.hooks.js +30 -0
  666. package/dist/features/tab-strip/react/components/TabStripItem.js +6 -31
  667. package/dist/features/tab-strip/react/hooks/useScrollableTabStrip.d.ts +27 -0
  668. package/dist/features/tab-strip/react/hooks/useScrollableTabStrip.js +30 -0
  669. package/dist/features/tab-strip/react/hooks/useTabStripDragReorder.js +93 -68
  670. package/dist/features/tab-strip/rules.d.ts +34 -10
  671. package/dist/features/tab-strip/rules.js +8 -8
  672. package/dist/features/tab-strip/scrollable.d.ts +32 -0
  673. package/dist/features/tab-strip/scrollable.js +45 -0
  674. package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +7 -2
  675. package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +5 -5
  676. package/dist/features/tabbed-dialog/react/hooks/useTabbedDialog.js +1 -1
  677. package/dist/features/tabbed-dialog/rules.d.ts +9 -2
  678. package/dist/features/tabbed-dialog/rules.js +2 -2
  679. package/dist/features/tabbed-dialog/types.d.ts +1 -1
  680. package/dist/features/tabbed-dialog/types.js +1 -1
  681. package/dist/features/version-manager/ports.d.ts +1 -1
  682. package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +9 -3
  683. package/dist/features/version-manager/react/components/VersionManagerModal.hooks.d.ts +5 -0
  684. package/dist/features/version-manager/react/components/VersionManagerModal.hooks.js +32 -0
  685. package/dist/features/version-manager/react/components/VersionManagerModal.js +40 -42
  686. package/dist/features/version-manager/react/components/VersionPreviewFrame.d.ts +10 -1
  687. package/dist/features/version-manager/react/components/VersionPreviewFrame.js +15 -8
  688. package/dist/features/version-manager/react/components/VersionPromptPopover.d.ts +5 -1
  689. package/dist/features/version-manager/react/components/VersionPromptPopover.js +3 -3
  690. package/dist/features/version-manager/react/components/VersionRestoreControl.d.ts +5 -1
  691. package/dist/features/version-manager/react/components/VersionRestoreControl.js +3 -3
  692. package/dist/features/version-manager/react/components/VersionSidebar.d.ts +4 -1
  693. package/dist/features/version-manager/react/components/VersionSidebar.js +17 -8
  694. package/dist/features/version-manager/react/hooks/useVersionManager.d.ts +3 -5
  695. package/dist/features/version-manager/react/hooks/useVersionManager.js +24 -233
  696. package/dist/features/version-manager/react/hooks/useVersionManager.state.d.ts +133 -0
  697. package/dist/features/version-manager/react/hooks/useVersionManager.state.js +257 -0
  698. package/dist/features/version-manager/rules.d.ts +52 -12
  699. package/dist/features/version-manager/rules.js +12 -12
  700. package/dist/features/version-manager/types.d.ts +1 -1
  701. package/dist/features/version-manager/types.js +1 -1
  702. package/dist/features/viewer-shell/index.d.ts +4 -0
  703. package/dist/features/viewer-shell/index.js +2 -0
  704. package/dist/features/viewer-shell/ports.d.ts +1 -1
  705. package/dist/features/viewer-shell/react/components/AudioViewerBody.js +1 -1
  706. package/dist/features/viewer-shell/react/components/CodeWithLines.d.ts +4 -3
  707. package/dist/features/viewer-shell/react/components/CodeWithLines.js +17 -3
  708. package/dist/features/viewer-shell/react/components/CodeWrapToggle.d.ts +12 -0
  709. package/dist/features/viewer-shell/react/components/CodeWrapToggle.js +8 -0
  710. package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +21 -4
  711. package/dist/features/viewer-shell/react/components/CommentSidePanel.hooks.d.ts +7 -0
  712. package/dist/features/viewer-shell/react/components/CommentSidePanel.hooks.js +11 -0
  713. package/dist/features/viewer-shell/react/components/CommentSidePanel.js +42 -64
  714. package/dist/features/viewer-shell/react/components/CommentSideParts.d.ts +30 -0
  715. package/dist/features/viewer-shell/react/components/CommentSideParts.js +43 -0
  716. package/dist/features/viewer-shell/react/components/JsonPanel.js +1 -1
  717. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +12 -3
  718. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.hooks.d.ts +6 -0
  719. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.hooks.js +5 -0
  720. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +22 -21
  721. package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
  722. package/dist/features/viewer-shell/react/components/SegmentedToggle.js +2 -2
  723. package/dist/features/viewer-shell/react/components/SvgSourcePane.js +1 -1
  724. package/dist/features/viewer-shell/react/components/ViewerFileActions.d.ts +3 -1
  725. package/dist/features/viewer-shell/react/components/ViewerFileActions.js +3 -3
  726. package/dist/features/viewer-shell/react/components/ViewerShell.js +1 -1
  727. package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +4 -2
  728. package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +3 -3
  729. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
  730. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +2 -2
  731. package/dist/features/viewer-shell/react/hooks/useCodeWrap.d.ts +16 -0
  732. package/dist/features/viewer-shell/react/hooks/useCodeWrap.js +10 -0
  733. package/dist/features/viewer-shell/react/hooks/useCommentReorder.js +2 -2
  734. package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.d.ts +1 -1
  735. package/dist/features/viewer-shell/react/hooks/useMarkdownScrollSync.js +102 -73
  736. package/dist/features/viewer-shell/rules.d.ts +44 -15
  737. package/dist/features/viewer-shell/rules.js +14 -14
  738. package/dist/features/viewer-shell/types.d.ts +1 -1
  739. package/dist/features/viewer-shell/types.js +1 -1
  740. package/dist/icon-name.d.ts +1 -1
  741. package/dist/icon-name.js +18 -0
  742. package/dist/index.d.ts +6 -3
  743. package/dist/index.js +5 -3
  744. package/dist/react/components/AppChromeHeader.js +2 -2
  745. package/dist/react/components/BrandLogo.d.ts +8 -13
  746. package/dist/react/components/BrandLogo.js +2 -2
  747. package/dist/react/components/CompactToggle.js +1 -1
  748. package/dist/react/components/ComponentKitPreview.d.ts +4 -2
  749. package/dist/react/components/ComponentKitPreview.js +3 -3
  750. package/dist/react/components/CustomSelect.d.ts +13 -4
  751. package/dist/react/components/CustomSelect.hooks.d.ts +12 -0
  752. package/dist/react/components/CustomSelect.hooks.js +7 -0
  753. package/dist/react/components/CustomSelect.js +13 -12
  754. package/dist/react/components/CustomSelect.types.d.ts +76 -0
  755. package/dist/react/components/CustomSelect.types.js +2 -0
  756. package/dist/react/components/CustomSelectMarkup.d.ts +27 -0
  757. package/dist/react/components/CustomSelectMarkup.js +35 -0
  758. package/dist/react/components/EditorIcon.js +2 -2
  759. package/dist/react/components/ExportDiagnosticsButton.d.ts +2 -1
  760. package/dist/react/components/ExportDiagnosticsButton.js +3 -3
  761. package/dist/react/components/FileImportPanel.d.ts +3 -1
  762. package/dist/react/components/FileImportPanel.js +4 -4
  763. package/dist/react/components/HeaderActionsMenu.d.ts +4 -1
  764. package/dist/react/components/HeaderActionsMenu.js +2 -2
  765. package/dist/react/components/Icon.d.ts +3 -10
  766. package/dist/react/components/Icon.js +8 -138
  767. package/dist/react/components/ImportChoice.js +2 -2
  768. package/dist/react/components/LanguageMenu.d.ts +13 -3
  769. package/dist/react/components/LanguageMenu.js +6 -6
  770. package/dist/react/components/Loading.js +4 -4
  771. package/dist/react/components/Notice.d.ts +3 -1
  772. package/dist/react/components/Notice.js +6 -6
  773. package/dist/react/components/OnboardingDropdown.d.ts +1 -1
  774. package/dist/react/components/OnboardingDropdown.js +32 -23
  775. package/dist/react/components/OptionCards.js +1 -1
  776. package/dist/react/components/PaletteTweaks.d.ts +11 -3
  777. package/dist/react/components/PaletteTweaks.js +8 -8
  778. package/dist/react/components/PillButton.d.ts +3 -2
  779. package/dist/react/components/PillButton.js +4 -4
  780. package/dist/react/components/PopoverItem.d.ts +3 -2
  781. package/dist/react/components/PopoverItem.js +3 -3
  782. package/dist/react/components/PopoverMenu.js +2 -2
  783. package/dist/react/components/RemixIcon.d.ts +3 -1
  784. package/dist/react/components/RemixIcon.js +3 -3
  785. package/dist/react/components/RemixIcon.stylesheet.d.ts +4 -1
  786. package/dist/react/components/RemixIcon.stylesheet.js +7 -5
  787. package/dist/react/components/SecretInput.d.ts +16 -1
  788. package/dist/react/components/SecretInput.js +6 -7
  789. package/dist/react/components/StatCard.js +1 -1
  790. package/dist/react/components/Toast.d.ts +4 -1
  791. package/dist/react/components/Toast.js +3 -3
  792. package/dist/react/components/ToggleRow.js +1 -1
  793. package/dist/react/components/TooltipLayer.js +168 -139
  794. package/dist/react/components/WorkingDirPicker.d.ts +11 -1
  795. package/dist/react/components/WorkingDirPicker.hooks.d.ts +8 -0
  796. package/dist/react/components/WorkingDirPicker.hooks.js +59 -0
  797. package/dist/react/components/WorkingDirPicker.js +5 -57
  798. package/dist/react/components/icon-action-renderers.d.ts +31 -0
  799. package/dist/react/components/icon-action-renderers.js +40 -0
  800. package/dist/react/components/icon-control-renderers.d.ts +33 -0
  801. package/dist/react/components/icon-control-renderers.js +47 -0
  802. package/dist/react/components/icon-line-glyphs.d.ts +9 -0
  803. package/dist/react/components/icon-line-glyphs.js +30 -0
  804. package/dist/react/components/icon-path-data.d.ts +7 -0
  805. package/dist/react/components/icon-path-data.js +7 -0
  806. package/dist/react/components/icon-renderer-types.d.ts +4 -0
  807. package/dist/react/components/icon-renderer-types.js +2 -0
  808. package/dist/react/components/icon-workspace-renderers.d.ts +42 -0
  809. package/dist/react/components/icon-workspace-renderers.js +56 -0
  810. package/dist/react/components/select-popover.js +2 -2
  811. package/dist/react/hooks/useAgentHandle.js +1 -1
  812. package/dist/react/hooks/usePersistedDisclosure.d.ts +15 -0
  813. package/dist/react/hooks/usePersistedDisclosure.js +41 -0
  814. package/dist/react/hooks/useResizableSplitPane.d.ts +12 -2
  815. package/dist/react/hooks/useResizableSplitPane.js +193 -128
  816. package/dist/react/kit.d.ts +61 -0
  817. package/dist/react/kit.js +27 -0
  818. package/dist/react/mcp-ui/McpUiHost.d.ts +11 -2
  819. package/dist/react/mcp-ui/McpUiHost.js +5 -3
  820. package/dist/react/mcp-ui/host-message-source.js +1 -1
  821. package/dist/react/mcp-ui/mcp-ui-host-frame.js +1 -1
  822. package/dist/react/mcp-ui/useMcpUiHost.d.ts +1 -11
  823. package/dist/react/mcp-ui/useMcpUiHost.js +39 -15
  824. package/dist/react/testing.d.ts +6 -0
  825. package/dist/react/testing.js +18 -0
  826. package/dist/renderers/annotation-canvas/drawing.d.ts +35 -14
  827. package/dist/renderers/annotation-canvas/drawing.js +20 -21
  828. package/dist/renderers/annotation-canvas/react/components/AnnotationCanvas.d.ts +3 -1
  829. package/dist/renderers/annotation-canvas/react/components/AnnotationCanvas.js +30 -18
  830. package/dist/renderers/annotation-canvas/react/hooks/useAnnotationCanvas.js +21 -10
  831. package/dist/renderers/annotation-canvas/rules.d.ts +15 -5
  832. package/dist/renderers/annotation-canvas/rules.js +6 -6
  833. package/dist/renderers/annotation-canvas/types.d.ts +1 -1
  834. package/dist/renderers/html-utils.d.ts +15 -4
  835. package/dist/renderers/html-utils.js +4 -4
  836. package/dist/renderers/index.d.ts +2 -2
  837. package/dist/renderers/index.js +2 -2
  838. package/dist/renderers/new-tab-preview.d.ts +8 -2
  839. package/dist/renderers/new-tab-preview.js +6 -6
  840. package/dist/renderers/preview-modal-shell/react/components/PreviewModalShell.d.ts +6 -2
  841. package/dist/renderers/preview-modal-shell/react/components/PreviewModalShell.js +14 -14
  842. package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.d.ts +1 -1
  843. package/dist/renderers/preview-modal-shell/react/hooks/usePreviewModalShell.js +65 -56
  844. package/dist/renderers/preview-modal-shell/rules.d.ts +24 -9
  845. package/dist/renderers/preview-modal-shell/rules.js +5 -5
  846. package/dist/renderers/preview-modal-shell/types.d.ts +3 -3
  847. package/dist/renderers/preview-modal-shell/types.js +2 -2
  848. package/dist/renderers/react/components/ArtifactView.d.ts +12 -2
  849. package/dist/renderers/react/components/ArtifactView.hooks.d.ts +8 -0
  850. package/dist/renderers/react/components/ArtifactView.hooks.js +10 -0
  851. package/dist/renderers/react/components/ArtifactView.js +6 -6
  852. package/dist/renderers/react/components/SrcDocSandbox.d.ts +5 -2
  853. package/dist/renderers/react/components/SrcDocSandbox.js +3 -3
  854. package/dist/renderers/renderers/markdown.js +1 -1
  855. package/dist/renderers/sandbox-bridge.js +0 -1
  856. package/dist/renderers/sandbox-scripts.js +7 -1
  857. package/dist/renderers/sandboxed-document.d.ts +13 -4
  858. package/dist/renderers/sandboxed-document.js +11 -11
  859. package/dist/renderers/shiki.d.ts +4 -1
  860. package/dist/renderers/shiki.js +1 -1
  861. package/dist/renderers/srcdoc/bridge.d.ts +4 -1
  862. package/dist/renderers/srcdoc/bridge.js +1 -1
  863. package/dist/renderers/srcdoc/build.d.ts +22 -7
  864. package/dist/renderers/srcdoc/build.js +15 -16
  865. package/dist/renderers/url-load-decision.d.ts +9 -3
  866. package/dist/renderers/url-load-decision.js +3 -3
  867. package/dist/styles/admin.css +5 -5
  868. package/dist/styles/lightbox.css +1 -1
  869. package/dist/theme/apply.js +1 -1
  870. package/dist/utils/auto-open-file.d.ts +7 -2
  871. package/dist/utils/auto-open-file.js +2 -2
  872. package/dist/utils/class-names.d.ts +4 -1
  873. package/dist/utils/class-names.js +1 -1
  874. package/dist/utils/copy-to-clipboard.js +2 -2
  875. package/dist/utils/design-md.d.ts +26 -6
  876. package/dist/utils/design-md.js +16 -13
  877. package/dist/utils/dom-subscriptions.d.ts +28 -9
  878. package/dist/utils/dom-subscriptions.js +18 -11
  879. package/dist/utils/endpoint-policy.d.ts +1 -1
  880. package/dist/utils/endpoint-policy.js +1 -1
  881. package/dist/utils/fake-latency.d.ts +9 -0
  882. package/dist/utils/fake-latency.js +5 -0
  883. package/dist/utils/file-system-errors.d.ts +4 -1
  884. package/dist/utils/file-system-errors.js +1 -1
  885. package/dist/utils/file-transfer.d.ts +6 -3
  886. package/dist/utils/file-transfer.js +6 -24
  887. package/dist/utils/ime-composing.d.ts +4 -1
  888. package/dist/utils/ime-composing.js +1 -1
  889. package/dist/utils/localized-url.d.ts +3 -1
  890. package/dist/utils/localized-url.js +2 -2
  891. package/dist/utils/markdown-scroll-sync.d.ts +23 -5
  892. package/dist/utils/markdown-scroll-sync.js +8 -8
  893. package/dist/utils/notifications.d.ts +10 -4
  894. package/dist/utils/notifications.js +6 -6
  895. package/dist/utils/pending-actions.d.ts +24 -0
  896. package/dist/utils/pending-actions.js +23 -0
  897. package/dist/utils/polygon-selection.d.ts +12 -3
  898. package/dist/utils/polygon-selection.js +4 -4
  899. package/dist/utils/smooth-scroll-to-top.js +1 -1
  900. package/dist/utils/timezone.d.ts +3 -1
  901. package/dist/utils/timezone.js +1 -1
  902. package/dist/utils/trim-chars.d.ts +16 -4
  903. package/dist/utils/trim-chars.js +5 -5
  904. package/dist/utils/unhandled-case.d.ts +4 -2
  905. package/dist/utils/unhandled-case.js +2 -2
  906. package/dist/utils/unit-bezier.d.ts +6 -1
  907. package/dist/utils/unit-bezier.js +1 -1
  908. package/dist/utils/visible-interval.d.ts +41 -0
  909. package/dist/utils/visible-interval.js +51 -0
  910. package/dist/utils/visual-stability.d.ts +3 -1
  911. package/dist/utils/visual-stability.js +1 -1
  912. package/dist/utils/zip.d.ts +3 -1
  913. package/dist/utils/zip.js +1 -1
  914. package/package.json +43 -49
  915. package/dist/features/a2ui/protocol.d.ts +0 -7
  916. package/dist/features/a2ui/protocol.js +0 -7
  917. package/dist/features/i18n/dictionary-translator.d.ts +0 -19
  918. package/dist/features/i18n/dictionary-translator.js +0 -14
  919. package/dist/features/i18n/template-i18n.d.ts +0 -37
  920. package/dist/features/i18n/template-i18n.js +0 -48
  921. package/dist/features/i18n/universal.d.ts +0 -3
  922. package/dist/features/i18n/universal.js +0 -3
  923. package/dist/features/lexical-rich-text-editor/constants.d.ts +0 -16
  924. package/dist/features/lexical-rich-text-editor/constants.js +0 -18
  925. package/dist/features/lexical-rich-text-editor/deserialize.d.ts +0 -4
  926. package/dist/features/lexical-rich-text-editor/deserialize.js +0 -50
  927. package/dist/features/lexical-rich-text-editor/index.d.ts +0 -12
  928. package/dist/features/lexical-rich-text-editor/index.js +0 -11
  929. package/dist/features/lexical-rich-text-editor/mention-node.d.ts +0 -44
  930. package/dist/features/lexical-rich-text-editor/mention-node.js +0 -130
  931. package/dist/features/lexical-rich-text-editor/mention-parser.d.ts +0 -45
  932. package/dist/features/lexical-rich-text-editor/mention-parser.js +0 -242
  933. package/dist/features/lexical-rich-text-editor/react/components/CaretFloatingLayer.d.ts +0 -20
  934. package/dist/features/lexical-rich-text-editor/react/components/CaretFloatingLayer.js +0 -33
  935. package/dist/features/lexical-rich-text-editor/react/components/RichTextInput.d.ts +0 -61
  936. package/dist/features/lexical-rich-text-editor/react/components/RichTextInput.js +0 -156
  937. package/dist/features/lexical-rich-text-editor/react/hooks/useCaretFloatingLayerPosition.d.ts +0 -15
  938. package/dist/features/lexical-rich-text-editor/react/hooks/useCaretFloatingLayerPosition.js +0 -54
  939. package/dist/features/lexical-rich-text-editor/react/hooks/useKeyboardCommands.d.ts +0 -11
  940. package/dist/features/lexical-rich-text-editor/react/hooks/useKeyboardCommands.js +0 -65
  941. package/dist/features/lexical-rich-text-editor/react/hooks/useMentionAtomicNavigation.d.ts +0 -8
  942. package/dist/features/lexical-rich-text-editor/react/hooks/useMentionAtomicNavigation.js +0 -63
  943. package/dist/features/lexical-rich-text-editor/react/hooks/useMentionColorStamping.d.ts +0 -18
  944. package/dist/features/lexical-rich-text-editor/react/hooks/useMentionColorStamping.js +0 -64
  945. package/dist/features/lexical-rich-text-editor/react/hooks/usePasteFiles.d.ts +0 -5
  946. package/dist/features/lexical-rich-text-editor/react/hooks/usePasteFiles.js +0 -24
  947. package/dist/features/lexical-rich-text-editor/react/hooks/useSeededValue.d.ts +0 -21
  948. package/dist/features/lexical-rich-text-editor/react/hooks/useSeededValue.js +0 -35
  949. package/dist/features/lexical-rich-text-editor/react/hooks/useSyncedOnChange.d.ts +0 -10
  950. package/dist/features/lexical-rich-text-editor/react/hooks/useSyncedOnChange.js +0 -29
  951. package/dist/features/lexical-rich-text-editor/react/hooks/useTriggerDetection.d.ts +0 -6
  952. package/dist/features/lexical-rich-text-editor/react/hooks/useTriggerDetection.js +0 -39
  953. package/dist/features/lexical-rich-text-editor/rules.d.ts +0 -83
  954. package/dist/features/lexical-rich-text-editor/rules.js +0 -330
  955. package/dist/features/lexical-rich-text-editor/serialize.d.ts +0 -4
  956. package/dist/features/lexical-rich-text-editor/serialize.js +0 -45
  957. package/dist/features/lexical-rich-text-editor/types.d.ts +0 -73
  958. package/dist/features/lexical-rich-text-editor/types.js +0 -5
  959. package/dist/features/mcp-ui/resource.d.ts +0 -252
  960. package/dist/features/mcp-ui/resource.js +0 -248
  961. package/dist/features/observability/stuck-run.d.ts +0 -41
  962. package/dist/features/observability/stuck-run.js +0 -117
  963. package/dist/features/panel-kit/helpers/format-timestamp.d.ts +0 -20
  964. package/dist/features/panel-kit/helpers/format-timestamp.js +0 -29
  965. package/dist/features/panel-kit/helpers/resolve-active-tab-id.d.ts +0 -13
  966. package/dist/features/panel-kit/helpers/resolve-active-tab-id.js +0 -15
  967. package/dist/react/components/SecretInput.hooks.d.ts +0 -3
  968. package/dist/react/components/SecretInput.hooks.js +0 -3
@@ -1,300 +1,34 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
- import { useSerialWrites } from "./use-serial-writes.hooks.js";
3
- /** Idle debounce: fires this long after the LAST `scheduleAutosave` call with no further calls. */
4
- const IDLE_DEBOUNCE_MS = 3000;
5
- /** Hard ceiling while continuously typing: once this much time has passed since the first
6
- * unflushed edit, the next tick fires immediately instead of resetting the idle window again. */
7
- const MAX_WAIT_MS = 15000;
8
- export function useStandingDraftAutosave(deps, _options = {}) {
1
+ import { useMemo } from "react";
2
+ import { useStandingDraftState as useStandingDraftStateDefault, useStandingDraftTimer as useStandingDraftTimerDefault, useStandingDraftQueue as useStandingDraftQueueDefault } from "./use-standing-draft-state.hooks.js";
3
+ import { useStandingDraftStaleBasis as useStandingDraftStaleBasisDefault, useStandingDraftRecovery as useStandingDraftRecoveryDefault, useStandingDraftFailedSave as useStandingDraftFailedSaveDefault } from "./use-standing-draft-recovery.hooks.js";
4
+ import { useStandingDraftWriter as useStandingDraftWriterDefault, useStandingDraftSchedule as useStandingDraftScheduleDefault, useStandingDraftExitFlush as useStandingDraftExitFlushDefault, useStandingDraftDiscard as useStandingDraftDiscardDefault } from "./use-standing-draft-writes.hooks.js";
5
+ export function useStandingDraftAutosave(deps, _options = {}, hooks = {
6
+ useStandingDraftState: useStandingDraftStateDefault,
7
+ useStandingDraftTimer: useStandingDraftTimerDefault,
8
+ useStandingDraftStaleBasis: useStandingDraftStaleBasisDefault,
9
+ useStandingDraftRecovery: useStandingDraftRecoveryDefault,
10
+ useStandingDraftQueue: useStandingDraftQueueDefault,
11
+ useStandingDraftFailedSave: useStandingDraftFailedSaveDefault,
12
+ useStandingDraftWriter: useStandingDraftWriterDefault,
13
+ useStandingDraftSchedule: useStandingDraftScheduleDefault,
14
+ useStandingDraftExitFlush: useStandingDraftExitFlushDefault,
15
+ useStandingDraftDiscard: useStandingDraftDiscardDefault,
16
+ }) {
17
+ const { useStandingDraftState, useStandingDraftTimer, useStandingDraftStaleBasis, useStandingDraftRecovery, useStandingDraftQueue, useStandingDraftFailedSave, useStandingDraftWriter, useStandingDraftSchedule, useStandingDraftExitFlush, useStandingDraftDiscard, } = hooks;
9
18
  const { port, backup, entryId, enabled, serverUpdatedAt } = deps;
10
- const [backupPrincipalId] = useState(() => port.getBackupPrincipalId?.({}, {}));
11
- const latestDraftRef = useRef(null);
12
- const backupGenerationRef = useRef(0);
13
- const [recoverableDraft, setRecoverableDraft] = useState(null);
14
- const [staleBasis, setStaleBasis] = useState(null);
15
- // Mirrors `staleBasis` for the SYNCHRONOUS gate in `scheduleAutosave`: the refusal is discovered
16
- // inside the request chain, and a React state read there would be a render behind — the window in
17
- // which the very ticks this gate exists to stop would still be scheduled.
18
- const staleBasisRef = useRef(null);
19
- // Which entry's refused text is currently mirrored in browser storage, or `null`. Deliberately
20
- // NOT the same lifetime as the gate above (see this file's header), and deliberately an entry id
21
- // rather than a boolean: it is the proof that a mirror this hook may drop belongs to the entry
22
- // being edited right now, so switching entries can never delete another entry's surviving copy.
23
- const backupEntryIdRef = useRef(null);
24
- // Every network op (each autosave PUT, and the eventual discard) is appended here, never fired
25
- // standalone — this IS the ordering guarantee `clearStandingDraft`'s own doc describes. Caught
26
- // internally (see `enqueue`) so one failed request can never permanently wedge the lane.
27
- const writes = useSerialWrites();
28
- const idleTimerRef = useRef(null);
29
- const firstPendingAtRef = useRef(null);
30
- // The newest draft handed to `scheduleAutosave` that has NOT yet been written — what a flush
31
- // sends. A ref, not the timer's own closure, precisely so an exit event can reach it: the
32
- // closure is unreachable from outside the `setTimeout` callback, which is why cancelling the
33
- // timer used to be indistinguishable from losing the edit.
34
- const pendingDraftRef = useRef(null);
35
- // The lowest `baseVersion` a write may still carry for the current entry — see `supersedeBasis`.
36
- // `null` until the caller supersedes a basis; reset on an entry change, because another entry's
37
- // version numbers are unrelated.
38
- const minBaseVersionRef = useRef(null);
39
- const clearPendingTimer = useCallback(() => {
40
- if (idleTimerRef.current !== null)
41
- clearTimeout(idleTimerRef.current);
42
- idleTimerRef.current = null;
43
- firstPendingAtRef.current = null;
44
- pendingDraftRef.current = null;
45
- }, []);
46
- /** The server refused this draft. Records the basis, and mirrors the text locally — the ONLY
47
- * place it can survive a tab close while the server keeps refusing it. @complexity O(1). */
48
- const markStaleBasis = useCallback((id, draft) => {
49
- const next = { baseVersion: draft.baseVersion, draft };
50
- staleBasisRef.current = next;
51
- setStaleBasis(next);
52
- backup.write({ entryId: id, draft, savedAt: new Date().toISOString() }, { principalId: backupPrincipalId });
53
- backupEntryIdRef.current = id;
54
- }, [backupPrincipalId, backup]);
55
- /** Lifts the gate so scheduling resumes. Does NOT touch the mirror — see this file's header for
56
- * why those two are separate. No-op when nothing is stale, so the common path never re-renders.
57
- * @complexity O(1). */
58
- const liftStaleGate = useCallback(() => {
59
- if (staleBasisRef.current === null)
60
- return;
61
- staleBasisRef.current = null;
62
- setStaleBasis(null);
63
- }, []);
64
- /** Drops the browser-storage mirror for the entry being edited, if it has one. Called only where
65
- * the operator's text provably survives somewhere else — the server just accepted a write (so it
66
- * is parked server-side), or a real Save/discard superseded it. @complexity O(1). */
67
- const dropLocalBackup = useCallback(() => {
68
- const id = backupEntryIdRef.current;
69
- if (id === null)
70
- return;
71
- backupEntryIdRef.current = null;
72
- backup.clear({ entryId: id }, { principalId: backupPrincipalId });
73
- }, [backupPrincipalId, backup]);
74
- // Mount-time (and entry-change) recovery check — one read, never repeated while this entryId
75
- // stays mounted. A stale in-flight response from a PREVIOUS entryId is dropped via `cancelled`.
76
- useEffect(() => {
77
- setRecoverableDraft(null);
78
- // A different entry is a different basis. A gate recorded for the PREVIOUS entryId must never
79
- // silence autosave for this one — their `version` numbers are very often both 1, so leaving it
80
- // set would silently stop autosaving an entry nobody has a conflict on. In-memory only: the
81
- // previous entry's local mirror is keyed under ITS id and stays recoverable there.
82
- staleBasisRef.current = null;
83
- setStaleBasis(null);
84
- // Same reasoning for the mirror pointer, one step further: the previous entry's mirror stays in
85
- // storage under ITS OWN key and stays recoverable there — only this hook's permission to drop a
86
- // mirror is reset, so a later accepted write for THIS entry cannot delete that other copy.
87
- backupEntryIdRef.current = null;
88
- minBaseVersionRef.current = null;
89
- latestDraftRef.current = null;
90
- if (!enabled || !entryId)
91
- return undefined;
92
- let cancelled = false;
93
- port
94
- .getAutosave({ id: entryId }, {})
95
- .then((result) => {
96
- if (cancelled)
97
- return;
98
- const localBackup = backup.read({ entryId }, { principalId: backupPrincipalId });
99
- // Recorded whether or not it is the copy shown below: it exists, so a real Save or an
100
- // explicit discard on this entry has to be able to drop it. Without this the mirror written
101
- // before a reload would outlive every discard and re-offer itself on every later mount.
102
- if (localBackup !== null)
103
- backupEntryIdRef.current = entryId;
104
- // Historically server first — a parked draft is shared across tabs. For expiry recovery,
105
- // compare capture times instead: a 401 mirror may contain edits newer than that parked copy. The local
106
- // mirror is the fallback for exactly the case that produced it: the other tab's real save
107
- // cleared the server-side draft, so this tab reloads into "nothing to recover" while its
108
- // own refused text is the thing the operator actually wants back.
109
- const server = result.autosave;
110
- // A 401 mirror can be newer than the last accepted server autosave. Keep the newest copy.
111
- const newest = localBackup && (!server || localBackup.savedAt > server.savedAt) ? localBackup : server;
112
- setRecoverableDraft(newest);
113
- })
114
- .catch(() => {
115
- // A failed server recovery read must not hide the local copy rescued from an expired session.
116
- if (cancelled)
117
- return;
118
- const localBackup = backup.read({ entryId }, { principalId: backupPrincipalId });
119
- if (localBackup !== null)
120
- backupEntryIdRef.current = entryId;
121
- setRecoverableDraft(localBackup);
122
- });
123
- return () => {
124
- cancelled = true;
125
- };
126
- }, [enabled, entryId, port, backupPrincipalId, backup]);
127
- const enqueue = useCallback((op) => writes.run({ task: op }).catch(() => {
128
- // eslint-disable-next-line no-console -- best-effort background persistence; surfaced to
129
- // the console rather than the operator, who has nothing actionable to do about one dropped
130
- // autosave tick, and rather than thrown, which would wedge every later tick on this chain.
131
- console.error("standing-draft autosave: request failed");
132
- }), [writes]);
133
- const preserveFailedSave = useCallback(({ error, draft }, _options = {}) => {
134
- if (!entryId || !isUnauthorizedDraftWrite(error))
135
- return;
136
- backup.write({ entryId, draft, savedAt: new Date().toISOString() }, { principalId: backupPrincipalId });
137
- backupEntryIdRef.current = entryId;
138
- }, [entryId, backupPrincipalId, backup]);
139
- /** The one place `putAutosave` is called. Its `{ applied }` answer is acted on here rather than
140
- * discarded — see this file's STALE BASIS note. @complexity Time/space: O(1) plus the request. */
141
- const writeAutosave = useCallback((id, draft, keepalive) => {
142
- const generation = backupGenerationRef.current;
143
- return enqueue(async () => {
144
- let result;
145
- try {
146
- result = await port.putAutosave({ id, draft }, { keepalive });
147
- }
148
- catch (error) {
149
- // A 401 can unmount the editor before this settles; the captured identity still owns it.
150
- // Use the newest scheduled text, since an older request may fail while typing continues.
151
- if (generation === backupGenerationRef.current)
152
- preserveFailedSave({ error, draft: latestDraftRef.current ?? draft });
153
- throw error;
154
- }
155
- if (generation !== backupGenerationRef.current)
156
- return;
157
- if (!result.applied) {
158
- // Refused because the caller already moved past this basis — nothing to pause or mirror.
159
- if (isSupersededBasis(draft.baseVersion, minBaseVersionRef.current))
160
- return;
161
- markStaleBasis(id, draft);
162
- return;
163
- }
164
- // Accepted — the text is parked server-side now, which is the ONLY point at which the
165
- // mirror is redundant and may go.
166
- liftStaleGate();
167
- dropLocalBackup();
168
- });
169
- }, [dropLocalBackup, enqueue, liftStaleGate, markStaleBasis, port, preserveFailedSave]);
170
- const scheduleAutosave = useCallback((draft) => {
171
- if (!enabled || !entryId)
172
- return;
173
- latestDraftRef.current = draft;
174
- if (isSupersededBasis(draft.baseVersion, minBaseVersionRef.current))
175
- return;
176
- // The gate. Same basis as the one the server already refused => this write would be refused
177
- // too, so it is not scheduled at all; a DIFFERENT basis means the editor reloaded the row, so
178
- // the gate lifts by itself and no caller has to remember to reset anything.
179
- const stale = staleBasisRef.current;
180
- if (stale !== null && stale.baseVersion === draft.baseVersion)
181
- return;
182
- // The mirror is deliberately left in place here: nothing has been written yet, so until the
183
- // server accepts, that mirror is still the only copy of the refused text that outlives the tab.
184
- liftStaleGate();
185
- const now = Date.now();
186
- if (firstPendingAtRef.current === null)
187
- firstPendingAtRef.current = now;
188
- const waitedSoFar = now - firstPendingAtRef.current;
189
- // Clamped, not a plain "already past the ceiling?" check: without the clamp, a call arriving
190
- // just before the ceiling would still schedule a FULL fresh `IDLE_DEBOUNCE_MS`, pushing the
191
- // actual fire time past `MAX_WAIT_MS` under continuous typing (verified by the ceiling test —
192
- // an unclamped version never fires within the window it claims to bound).
193
- const delay = Math.max(0, Math.min(IDLE_DEBOUNCE_MS, MAX_WAIT_MS - waitedSoFar));
194
- pendingDraftRef.current = draft;
195
- if (idleTimerRef.current !== null)
196
- clearTimeout(idleTimerRef.current);
197
- idleTimerRef.current = setTimeout(() => {
198
- idleTimerRef.current = null;
199
- firstPendingAtRef.current = null;
200
- pendingDraftRef.current = null;
201
- // Not an exit: the page is still here, so an ordinary fetch (no 64 KiB ceiling) is right.
202
- writeAutosave(entryId, draft, false);
203
- }, delay);
204
- }, [enabled, entryId, liftStaleGate, writeAutosave]);
205
- /**
206
- * Writes a pending (not yet fired) autosave immediately instead of waiting the debounce out —
207
- * the half of the cadence that makes the owner's actual requirement true ("what if they reload
208
- * the page on accident or exit out of the page? I don't want them to lose their work"). The
209
- * debounce always leaves a window of up to {@link IDLE_DEBOUNCE_MS} in which the newest edit
210
- * exists only in React state; without this, every exit inside that window discards it.
211
- *
212
- * Goes onto the same serial chain every other write uses, so it can never overtake an in-flight
213
- * PUT or a discard already queued by {@link clearStandingDraft} — and because that function
214
- * nulls `pendingDraftRef`, a flush after a real Save is a no-op rather than a resurrection.
215
- *
216
- * @complexity Time/space: O(1) — one ref read and at most one enqueued request.
217
- */
218
- const flushPendingAutosave = useCallback((keepalive) => {
219
- const draft = pendingDraftRef.current;
220
- if (draft === null || !entryId)
221
- return;
222
- clearPendingTimer();
223
- writeAutosave(entryId, draft, keepalive);
224
- }, [clearPendingTimer, entryId, writeAutosave]);
225
- // Flush, do not cancel, when this editor goes away. An in-app navigation (the "Posts"/"Pages"
226
- // back link, or any router move) unmounts the hook while a debounced tick is still pending, and
227
- // the previous cancel-on-unmount is exactly how the last seconds of typing were lost — verified
228
- // in a real browser on 2026-09-06: typed into the Pages editor, followed the in-app link one
229
- // second later, and no PUT was ever issued. The SPA outlives the unmount, so the request started
230
- // here completes normally. Re-running on an `entryId` change is correct too: the cleanup closes
231
- // over the OUTGOING entry, so switching entries parks the one being left behind.
232
- // `keepalive: false` — an unmount is an in-app navigation, not a page teardown. The SPA outlives
233
- // it, so the request started here completes normally and must not pay keepalive's body ceiling.
234
- useEffect(() => () => flushPendingAutosave(false), [flushPendingAutosave]);
235
- // The exits React never sees. `pagehide` covers a tab close, a reload and a same-tab navigation;
236
- // `visibilitychange` covers a tab switch or the OS backgrounding the browser, where `pagehide`
237
- // may never fire; `blur` covers switching to another desktop app with the tab still visible.
238
- // `beforeunload` is deliberately NOT one of them — `use-dirty-guard.hooks.ts` already registers
239
- // it, and it is a PROMPT, not a persistence hook: answering "Leave" still discards whatever the
240
- // debounce had not written. Each handler is a no-op when nothing is pending, so overlapping
241
- // events (a close fires blur AND pagehide) cost one write, not three.
242
- useEffect(() => {
243
- if (!enabled || !entryId)
244
- return undefined;
245
- // Wrapped rather than passed straight to `addEventListener`: a listener is called WITH the
246
- // Event, which would arrive as `flushPendingAutosave`'s `keepalive` argument — a truthy object,
247
- // so every flush would silently request keepalive whether or not it is an exit.
248
- const onExit = () => flushPendingAutosave(true);
249
- const onVisibilityChange = () => {
250
- if (document.visibilityState === "hidden")
251
- flushPendingAutosave(true);
252
- };
253
- window.addEventListener("pagehide", onExit);
254
- window.addEventListener("blur", onExit);
255
- document.addEventListener("visibilitychange", onVisibilityChange);
256
- return () => {
257
- window.removeEventListener("pagehide", onExit);
258
- window.removeEventListener("blur", onExit);
259
- document.removeEventListener("visibilitychange", onVisibilityChange);
260
- };
261
- }, [enabled, entryId, flushPendingAutosave]);
262
- const clearStandingDraft = useCallback(async () => {
263
- // A late 401/refusal must not resurrect a draft a successful Save or Discard superseded.
264
- backupGenerationRef.current++;
265
- clearPendingTimer();
266
- setRecoverableDraft(null);
267
- // A real Save landed (or the operator discarded): whatever was refused is superseded, so the
268
- // gate lifts and the mirror goes with it — otherwise the next mount would offer a ghost. This
269
- // is also the ONLY thing that clears a mirror the operator has already been shown and chose to
270
- // discard, since by then the gate that wrote it belongs to a previous mount.
271
- liftStaleGate();
272
- dropLocalBackup();
273
- if (!entryId)
274
- return;
275
- await enqueue(async () => {
276
- await port.discardAutosave({ id: entryId }, {});
277
- });
278
- }, [clearPendingTimer, dropLocalBackup, enqueue, entryId, liftStaleGate, port]);
279
- const dismissRecoverable = useCallback(() => setRecoverableDraft(null), []);
280
- const supersedeBasis = useCallback((baseVersion) => {
281
- minBaseVersionRef.current = baseVersion;
282
- const pending = pendingDraftRef.current;
283
- if (pending !== null && isSupersededBasis(pending.baseVersion, baseVersion))
284
- clearPendingTimer();
285
- const stale = staleBasisRef.current;
286
- if (stale !== null && isSupersededBasis(stale.baseVersion, baseVersion))
287
- liftStaleGate();
288
- }, [clearPendingTimer, liftStaleGate]);
19
+ const dependencies = { port, backup, entryId, enabled, serverUpdatedAt };
20
+ const state = useStandingDraftState(dependencies);
21
+ const { recoverableDraft, staleBasis } = state;
22
+ const clearPendingTimer = useStandingDraftTimer(state);
23
+ const stale = useStandingDraftStaleBasis(state, dependencies);
24
+ useStandingDraftRecovery(state, dependencies);
25
+ const enqueue = useStandingDraftQueue(state);
26
+ const preserveFailedSave = useStandingDraftFailedSave(state, dependencies);
27
+ const writeAutosave = useStandingDraftWriter(state, dependencies, { ...stale, enqueue, preserveFailedSave });
28
+ const { scheduleAutosave, flushPendingAutosave } = useStandingDraftSchedule(state, dependencies, { ...stale, clearPendingTimer, writeAutosave });
29
+ useStandingDraftExitFlush(dependencies, flushPendingAutosave);
30
+ const { clearStandingDraft, dismissRecoverable, supersedeBasis } = useStandingDraftDiscard(state, dependencies, { ...stale, enqueue, clearPendingTimer });
289
31
  const comparedDraft = useMemo(() => recoverableDraft ? { ...recoverableDraft, serverUpdatedAt } : null, [recoverableDraft, serverUpdatedAt]);
290
32
  return { recoverableDraft: comparedDraft, staleBasis, dismissRecoverable, scheduleAutosave, clearStandingDraft, supersedeBasis, preserveFailedSave };
291
33
  }
292
- /** Whether a write built on `baseVersion` belongs to a basis the caller has left (see
293
- * `supersedeBasis`). @complexity O(1). */
294
- function isSupersededBasis(baseVersion, minBaseVersion) {
295
- return minBaseVersion !== null && baseVersion < minBaseVersion;
296
- }
297
- function isUnauthorizedDraftWrite(error) {
298
- return typeof error === "object" && error !== null && "status" in error && error.status === 401;
299
- }
300
34
  //# sourceMappingURL=use-standing-draft-autosave.hooks.js.map
@@ -0,0 +1,13 @@
1
+ import type { StandingDraftAutosaveOptions, StandingDraftAutosaveInput } from "./use-standing-draft-autosave.hooks.js";
2
+ import type { useStandingDraftState } from "./use-standing-draft-state.hooks.js";
3
+ export declare function useStandingDraftStaleBasis(state: ReturnType<typeof useStandingDraftState>, deps: StandingDraftAutosaveOptions): {
4
+ markStaleBasis: (id: string, draft: StandingDraftAutosaveInput) => void;
5
+ liftStaleGate: () => void;
6
+ dropLocalBackup: () => void;
7
+ };
8
+ export declare function useStandingDraftRecovery(state: ReturnType<typeof useStandingDraftState>, deps: StandingDraftAutosaveOptions): void;
9
+ export declare function useStandingDraftFailedSave(state: ReturnType<typeof useStandingDraftState>, deps: StandingDraftAutosaveOptions): ({ error, draft }: {
10
+ error: unknown;
11
+ draft: StandingDraftAutosaveInput;
12
+ }, _options?: Record<string, never>) => void;
13
+ //# sourceMappingURL=use-standing-draft-recovery.hooks.d.ts.map
@@ -0,0 +1,106 @@
1
+ import { useCallback, useEffect } from "react";
2
+ export function useStandingDraftStaleBasis(state, deps) {
3
+ const { staleBasisRef, setStaleBasis, backupPrincipalId, backupEntryIdRef } = state;
4
+ const { backup } = deps;
5
+ /** The server refused this draft. Records the basis, and mirrors the text locally — the ONLY
6
+ * place it can survive a tab close while the server keeps refusing it. @complexity O(1). */
7
+ const markStaleBasis = useCallback((id, draft) => {
8
+ const next = { baseVersion: draft.baseVersion, draft };
9
+ staleBasisRef.current = next;
10
+ setStaleBasis(next);
11
+ backup.write({ entryId: id, draft, savedAt: new Date().toISOString() }, { principalId: backupPrincipalId });
12
+ backupEntryIdRef.current = id;
13
+ }, [backupPrincipalId, backup]);
14
+ /** Lifts the gate so scheduling resumes. Does NOT touch the mirror — see this file's header for
15
+ * why those two are separate. No-op when nothing is stale, so the common path never re-renders.
16
+ * @complexity O(1). */
17
+ const liftStaleGate = useCallback(() => {
18
+ if (staleBasisRef.current === null)
19
+ return;
20
+ staleBasisRef.current = null;
21
+ setStaleBasis(null);
22
+ }, []);
23
+ /** Drops the browser-storage mirror for the entry being edited, if it has one. Called only where
24
+ * the operator's text provably survives somewhere else — the server just accepted a write (so it
25
+ * is parked server-side), or a real Save/discard superseded it. @complexity O(1). */
26
+ const dropLocalBackup = useCallback(() => {
27
+ const id = backupEntryIdRef.current;
28
+ if (id === null)
29
+ return;
30
+ backupEntryIdRef.current = null;
31
+ backup.clear({ entryId: id }, { principalId: backupPrincipalId });
32
+ }, [backupPrincipalId, backup]);
33
+ return { markStaleBasis, liftStaleGate, dropLocalBackup };
34
+ }
35
+ export function useStandingDraftRecovery(state, deps) {
36
+ const { setRecoverableDraft, staleBasisRef, setStaleBasis, backupEntryIdRef, minBaseVersionRef, latestDraftRef, backupPrincipalId } = state;
37
+ const { enabled, entryId, port, backup } = deps;
38
+ // Mount-time (and entry-change) recovery check — one read, never repeated while this entryId
39
+ // stays mounted. A stale in-flight response from a PREVIOUS entryId is dropped via `cancelled`.
40
+ useEffect(() => {
41
+ setRecoverableDraft(null);
42
+ // A different entry is a different basis. A gate recorded for the PREVIOUS entryId must never
43
+ // silence autosave for this one — their `version` numbers are very often both 1, so leaving it
44
+ // set would silently stop autosaving an entry nobody has a conflict on. In-memory only: the
45
+ // previous entry's local mirror is keyed under ITS id and stays recoverable there.
46
+ staleBasisRef.current = null;
47
+ setStaleBasis(null);
48
+ // Same reasoning for the mirror pointer, one step further: the previous entry's mirror stays in
49
+ // storage under ITS OWN key and stays recoverable there — only this hook's permission to drop a
50
+ // mirror is reset, so a later accepted write for THIS entry cannot delete that other copy.
51
+ backupEntryIdRef.current = null;
52
+ minBaseVersionRef.current = null;
53
+ latestDraftRef.current = null;
54
+ if (!enabled || !entryId)
55
+ return undefined;
56
+ let cancelled = false;
57
+ port
58
+ .getAutosave({ id: entryId }, {})
59
+ .then((result) => {
60
+ if (cancelled)
61
+ return;
62
+ const localBackup = backup.read({ entryId }, { principalId: backupPrincipalId });
63
+ // Recorded whether or not it is the copy shown below: it exists, so a real Save or an
64
+ // explicit discard on this entry has to be able to drop it. Without this the mirror written
65
+ // before a reload would outlive every discard and re-offer itself on every later mount.
66
+ if (localBackup !== null)
67
+ backupEntryIdRef.current = entryId;
68
+ // Historically server first — a parked draft is shared across tabs. For expiry recovery,
69
+ // compare capture times instead: a 401 mirror may contain edits newer than that parked copy. The local
70
+ // mirror is the fallback for exactly the case that produced it: the other tab's real save
71
+ // cleared the server-side draft, so this tab reloads into "nothing to recover" while its
72
+ // own refused text is the thing the operator actually wants back.
73
+ const server = result.autosave;
74
+ // A 401 mirror can be newer than the last accepted server autosave. Keep the newest copy.
75
+ const newest = localBackup && (!server || localBackup.savedAt > server.savedAt) ? localBackup : server;
76
+ setRecoverableDraft(newest);
77
+ })
78
+ .catch(() => {
79
+ // A failed server recovery read must not hide the local copy rescued from an expired session.
80
+ if (cancelled)
81
+ return;
82
+ const localBackup = backup.read({ entryId }, { principalId: backupPrincipalId });
83
+ if (localBackup !== null)
84
+ backupEntryIdRef.current = entryId;
85
+ setRecoverableDraft(localBackup);
86
+ });
87
+ return () => {
88
+ cancelled = true;
89
+ };
90
+ }, [enabled, entryId, port, backupPrincipalId, backup]);
91
+ }
92
+ export function useStandingDraftFailedSave(state, deps) {
93
+ const { backupPrincipalId, backupEntryIdRef } = state;
94
+ const { entryId, backup } = deps;
95
+ const preserveFailedSave = useCallback(({ error, draft }, _options = {}) => {
96
+ if (!entryId || !isUnauthorizedDraftWrite(error))
97
+ return;
98
+ backup.write({ entryId, draft, savedAt: new Date().toISOString() }, { principalId: backupPrincipalId });
99
+ backupEntryIdRef.current = entryId;
100
+ }, [entryId, backupPrincipalId, backup]);
101
+ return preserveFailedSave;
102
+ }
103
+ function isUnauthorizedDraftWrite(error) {
104
+ return typeof error === "object" && error !== null && "status" in error && error.status === 401;
105
+ }
106
+ //# sourceMappingURL=use-standing-draft-recovery.hooks.js.map
@@ -0,0 +1,23 @@
1
+ import type { StandingDraftAutosaveOptions, StandingDraftAutosaveInput, StandingDraftAutosaveSnapshot, StandingDraftStaleBasis } from "./use-standing-draft-autosave.hooks.js";
2
+ import { useSerialWrites as useSerialWritesDefault } from "./use-serial-writes.hooks.js";
3
+ export declare function useStandingDraftState(deps: StandingDraftAutosaveOptions, { useSerialWrites }?: {
4
+ useSerialWrites?: typeof useSerialWritesDefault;
5
+ }): {
6
+ backupPrincipalId: string | null | undefined;
7
+ latestDraftRef: import("react").RefObject<StandingDraftAutosaveInput | null>;
8
+ backupGenerationRef: import("react").RefObject<number>;
9
+ recoverableDraft: StandingDraftAutosaveSnapshot | null;
10
+ setRecoverableDraft: import("react").Dispatch<import("react").SetStateAction<StandingDraftAutosaveSnapshot | null>>;
11
+ staleBasis: StandingDraftStaleBasis | null;
12
+ setStaleBasis: import("react").Dispatch<import("react").SetStateAction<StandingDraftStaleBasis | null>>;
13
+ staleBasisRef: import("react").RefObject<StandingDraftStaleBasis | null>;
14
+ backupEntryIdRef: import("react").RefObject<string | null>;
15
+ writes: import("./use-serial-writes.hooks.js").SerialWrites;
16
+ idleTimerRef: import("react").RefObject<NodeJS.Timeout | null>;
17
+ firstPendingAtRef: import("react").RefObject<number | null>;
18
+ pendingDraftRef: import("react").RefObject<StandingDraftAutosaveInput | null>;
19
+ minBaseVersionRef: import("react").RefObject<number | null>;
20
+ };
21
+ export declare function useStandingDraftTimer(state: ReturnType<typeof useStandingDraftState>): () => void;
22
+ export declare function useStandingDraftQueue(state: ReturnType<typeof useStandingDraftState>): (op: () => Promise<void>) => Promise<void>;
23
+ //# sourceMappingURL=use-standing-draft-state.hooks.d.ts.map
@@ -0,0 +1,58 @@
1
+ import { createConsoleLogger } from "@jini-ai/core/primitives";
2
+ import { useCallback, useRef, useState } from "react";
3
+ import { useSerialWrites as useSerialWritesDefault } from "./use-serial-writes.hooks.js";
4
+ export function useStandingDraftState(deps, { useSerialWrites = useSerialWritesDefault } = {}) {
5
+ const { port } = deps;
6
+ const [backupPrincipalId] = useState(() => port.getBackupPrincipalId?.({}, {}));
7
+ const latestDraftRef = useRef(null);
8
+ const backupGenerationRef = useRef(0);
9
+ const [recoverableDraft, setRecoverableDraft] = useState(null);
10
+ const [staleBasis, setStaleBasis] = useState(null);
11
+ // Mirrors `staleBasis` for the SYNCHRONOUS gate in `scheduleAutosave`: the refusal is discovered
12
+ // inside the request chain, and a React state read there would be a render behind — the window in
13
+ // which the very ticks this gate exists to stop would still be scheduled.
14
+ const staleBasisRef = useRef(null);
15
+ // Which entry's refused text is currently mirrored in browser storage, or `null`. Deliberately
16
+ // NOT the same lifetime as the gate above (see this file's header), and deliberately an entry id
17
+ // rather than a boolean: it is the proof that a mirror this hook may drop belongs to the entry
18
+ // being edited right now, so switching entries can never delete another entry's surviving copy.
19
+ const backupEntryIdRef = useRef(null);
20
+ // Every network op (each autosave PUT, and the eventual discard) is appended here, never fired
21
+ // standalone — this IS the ordering guarantee `clearStandingDraft`'s own doc describes. Caught
22
+ // internally (see `enqueue`) so one failed request can never permanently wedge the lane.
23
+ const writes = useSerialWrites();
24
+ const idleTimerRef = useRef(null);
25
+ const firstPendingAtRef = useRef(null);
26
+ // The newest draft handed to `scheduleAutosave` that has NOT yet been written — what a flush
27
+ // sends. A ref, not the timer's own closure, precisely so an exit event can reach it: the
28
+ // closure is unreachable from outside the `setTimeout` callback, which is why cancelling the
29
+ // timer used to be indistinguishable from losing the edit.
30
+ const pendingDraftRef = useRef(null);
31
+ // The lowest `baseVersion` a write may still carry for the current entry — see `supersedeBasis`.
32
+ // `null` until the caller supersedes a basis; reset on an entry change, because another entry's
33
+ // version numbers are unrelated.
34
+ const minBaseVersionRef = useRef(null);
35
+ return { backupPrincipalId, latestDraftRef, backupGenerationRef, recoverableDraft, setRecoverableDraft, staleBasis, setStaleBasis, staleBasisRef, backupEntryIdRef, writes, idleTimerRef, firstPendingAtRef, pendingDraftRef, minBaseVersionRef };
36
+ }
37
+ export function useStandingDraftTimer(state) {
38
+ const { idleTimerRef, firstPendingAtRef, pendingDraftRef } = state;
39
+ const clearPendingTimer = useCallback(() => {
40
+ if (idleTimerRef.current !== null)
41
+ clearTimeout(idleTimerRef.current);
42
+ idleTimerRef.current = null;
43
+ firstPendingAtRef.current = null;
44
+ pendingDraftRef.current = null;
45
+ }, []);
46
+ return clearPendingTimer;
47
+ }
48
+ export function useStandingDraftQueue(state) {
49
+ const { writes } = state;
50
+ const enqueue = useCallback((op) => writes.run({ task: op }).catch(() => {
51
+ // best-effort background persistence; surfaced to
52
+ // the console rather than the operator, who has nothing actionable to do about one dropped
53
+ // autosave tick, and rather than thrown, which would wedge every later tick on this chain.
54
+ createConsoleLogger({ prefix: '' }).error({ message: "standing-draft autosave: request failed" });
55
+ }), [writes]);
56
+ return enqueue;
57
+ }
58
+ //# sourceMappingURL=use-standing-draft-state.hooks.js.map
@@ -0,0 +1,29 @@
1
+ import type { StandingDraftAutosaveOptions, StandingDraftAutosaveInput } from "./use-standing-draft-autosave.hooks.js";
2
+ import type { useStandingDraftState, useStandingDraftTimer, useStandingDraftQueue } from "./use-standing-draft-state.hooks.js";
3
+ import type { useStandingDraftStaleBasis, useStandingDraftFailedSave } from "./use-standing-draft-recovery.hooks.js";
4
+ export declare function useStandingDraftWriter(state: ReturnType<typeof useStandingDraftState>, deps: StandingDraftAutosaveOptions, actions: ReturnType<typeof useStandingDraftStaleBasis> & {
5
+ enqueue: ReturnType<typeof useStandingDraftQueue>;
6
+ preserveFailedSave: ReturnType<typeof useStandingDraftFailedSave>;
7
+ }): (id: string, draft: StandingDraftAutosaveInput, keepalive: boolean) => Promise<void>;
8
+ export declare function useStandingDraftSchedule(state: ReturnType<typeof useStandingDraftState>, deps: StandingDraftAutosaveOptions, actions: {
9
+ liftStaleGate: ReturnType<typeof useStandingDraftStaleBasis>["liftStaleGate"];
10
+ clearPendingTimer: ReturnType<typeof useStandingDraftTimer>;
11
+ writeAutosave: ReturnType<typeof useStandingDraftWriter>;
12
+ }): {
13
+ scheduleAutosave: (draft: StandingDraftAutosaveInput) => void;
14
+ flushPendingAutosave: (keepalive: boolean) => void;
15
+ };
16
+ export declare function useStandingDraftExitFlush(deps: StandingDraftAutosaveOptions, flushPendingAutosave: ReturnType<typeof useStandingDraftSchedule>["flushPendingAutosave"]): void;
17
+ export declare function useStandingDraftDiscard(state: ReturnType<typeof useStandingDraftState>, deps: StandingDraftAutosaveOptions, actions: ReturnType<typeof useStandingDraftStaleBasis> & {
18
+ enqueue: ReturnType<typeof useStandingDraftQueue>;
19
+ clearPendingTimer: ReturnType<typeof useStandingDraftTimer>;
20
+ }): {
21
+ clearStandingDraft: (_required?: Record<string, never>, { keepOnFailure }?: {
22
+ keepOnFailure?: boolean;
23
+ }) => Promise<{
24
+ discarded: boolean;
25
+ }>;
26
+ dismissRecoverable: () => void;
27
+ supersedeBasis: (baseVersion: number) => void;
28
+ };
29
+ //# sourceMappingURL=use-standing-draft-writes.hooks.d.ts.map