@notis_ai/cli 0.2.17 → 0.2.19

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 (395) hide show
  1. package/README.md +542 -146
  2. package/bin/check-runtime.js +15 -0
  3. package/bin/notis.js +2 -0
  4. package/config/notis_app_design_rules.json +320 -0
  5. package/config/portal-route-roots.json +45 -0
  6. package/dist/agent-hooks/notis-agent-hook.mjs +42323 -18258
  7. package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -0
  8. package/dist/base-skills/notis-cli/SKILL.md +51 -280
  9. package/dist/base-skills/notis-cli/references/app-delivery.md +17 -0
  10. package/dist/base-skills/notis-cli/references/intelligence.md +94 -0
  11. package/dist/base-skills/notis-cli/references/native-databases.md +21 -0
  12. package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
  13. package/dist/base-skills/notis-cli/references/troubleshooting.md +67 -0
  14. package/dist/base-skills/notis-query/.notis-base-skill.json +1 -0
  15. package/dist/base-skills/notis-query/SKILL.md +35 -699
  16. package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
  17. package/dist/base-skills/notis-query/references/documents.md +74 -0
  18. package/dist/base-skills/notis-query/references/query.md +76 -0
  19. package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -0
  20. package/dist/base-skills/notis-spaces/SKILL.md +218 -0
  21. package/dist/base-skills/notis-spaces/references/architecture.md +116 -0
  22. package/dist/base-skills/notis-spaces/references/context.md +81 -0
  23. package/dist/base-skills/notis-spaces/references/design.md +141 -0
  24. package/dist/base-skills/notis-spaces/references/fixtures.md +29 -0
  25. package/dist/base-skills/notis-spaces/references/memory.md +58 -0
  26. package/dist/base-skills/notis-spaces/references/reading.md +73 -0
  27. package/dist/base-skills/notis-spaces/references/release.md +120 -0
  28. package/dist/base-skills/notis-spaces/references/reports.md +77 -0
  29. package/dist/base-skills/notis-spaces/references/sdk.md +273 -0
  30. package/dist/base-skills/notis-spaces/references/store.md +118 -0
  31. package/dist/base-skills/notis-spaces/references/troubleshooting.md +28 -0
  32. package/dist/base-skills/notis-spaces/references/views.md +229 -0
  33. package/{template/packages → dist}/sdk/package.json +9 -10
  34. package/dist/sdk/src/agentContext.ts +36 -0
  35. package/dist/sdk/src/bundleModule.ts +175 -0
  36. package/dist/sdk/src/components/Dialog.tsx +103 -0
  37. package/dist/sdk/src/components/DocumentEditor.tsx +113 -0
  38. package/dist/sdk/src/components/DocumentPage.tsx +184 -0
  39. package/{template/packages → dist}/sdk/src/components/Markdown.tsx +9 -3
  40. package/{template/packages → dist}/sdk/src/components/MarkdownEditor.tsx +26 -5
  41. package/{template/packages → dist}/sdk/src/components/MultiSelectActionBar.tsx +95 -12
  42. package/{template/packages → dist}/sdk/src/components/MultiSelectCheckbox.tsx +4 -2
  43. package/dist/sdk/src/components/NotisCommentBoundary.tsx +172 -0
  44. package/{template/packages → dist}/sdk/src/components/NotisSelectionBoundary.tsx +9 -5
  45. package/dist/sdk/src/components/RecordComponents.tsx +111 -0
  46. package/dist/sdk/src/components/Skeleton.tsx +38 -0
  47. package/dist/sdk/src/config.ts +31 -0
  48. package/{template/packages → dist}/sdk/src/documents.ts +21 -6
  49. package/dist/sdk/src/hooks/useAction.ts +28 -0
  50. package/dist/sdk/src/hooks/useAgentContext.ts +23 -0
  51. package/{template/packages → dist}/sdk/src/hooks/useBackend.ts +3 -2
  52. package/dist/sdk/src/hooks/useCloudComputer.ts +94 -0
  53. package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
  54. package/{template/packages → dist}/sdk/src/hooks/useCollectionInteractions.ts +157 -147
  55. package/dist/sdk/src/hooks/useDatabaseSchema.ts +50 -0
  56. package/{template/packages → dist}/sdk/src/hooks/useDatabaseSubscription.ts +2 -2
  57. package/dist/sdk/src/hooks/useDocument.ts +51 -0
  58. package/{template/packages → dist}/sdk/src/hooks/useDocuments.ts +25 -59
  59. package/{template/packages → dist}/sdk/src/hooks/useHandover.ts +7 -7
  60. package/dist/sdk/src/hooks/useLongPressSelection.ts +79 -0
  61. package/dist/sdk/src/hooks/useMarqueeSelection.ts +194 -0
  62. package/{template/packages → dist}/sdk/src/hooks/useMultiSelect.ts +2 -8
  63. package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
  64. package/dist/sdk/src/hooks/useNativeDocuments.ts +143 -0
  65. package/{template/packages → dist}/sdk/src/hooks/useNotis.ts +6 -1
  66. package/dist/sdk/src/hooks/useNotisNavigation.ts +70 -0
  67. package/dist/sdk/src/hooks/useQuery.ts +81 -0
  68. package/dist/sdk/src/hooks/useToolQuery.ts +12 -0
  69. package/dist/sdk/src/hooks/useTopBarSearch.ts +102 -0
  70. package/dist/sdk/src/hooks/useTopBarTitleLeaf.ts +75 -0
  71. package/{template/packages → dist}/sdk/src/hooks/useUpsertDocument.ts +1 -1
  72. package/dist/sdk/src/hooks/useViewParams.ts +195 -0
  73. package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
  74. package/{template/packages → dist}/sdk/src/index.ts +64 -1
  75. package/{template/packages → dist}/sdk/src/interactions/actions.ts +14 -1
  76. package/{template/packages → dist}/sdk/src/interactions/shortcuts.tsx +129 -23
  77. package/dist/sdk/src/interactions/visibility.ts +13 -0
  78. package/{template/packages → dist}/sdk/src/interactions.ts +5 -1
  79. package/dist/sdk/src/nativeData.ts +39 -0
  80. package/{template/packages → dist}/sdk/src/provider.tsx +9 -4
  81. package/dist/sdk/src/queryCache.ts +292 -0
  82. package/dist/sdk/src/queryErrors.ts +51 -0
  83. package/dist/sdk/src/runtime.ts +675 -0
  84. package/dist/sdk/src/runtimeModules.ts +33 -0
  85. package/dist/sdk/src/space.ts +442 -0
  86. package/dist/sdk/src/standardViewParams.ts +36 -0
  87. package/{template/packages → dist}/sdk/src/styles.css +81 -16
  88. package/dist/sdk/src/tailwind.ts +66 -0
  89. package/dist/sdk/src/ui/charts/RenderChartData.tsx +25 -0
  90. package/dist/sdk/src/ui/engine/core.ts +392 -0
  91. package/dist/sdk/src/ui/engine/dom.ts +183 -0
  92. package/dist/sdk/src/ui/engine/hooks.ts +195 -0
  93. package/dist/sdk/src/ui/engine/instance.ts +63 -0
  94. package/dist/sdk/src/ui/engine/keycapContext.ts +2 -0
  95. package/dist/sdk/src/ui/engine/registry.ts +262 -0
  96. package/dist/sdk/src/ui/engine/types.ts +62 -0
  97. package/dist/sdk/src/ui/icons.tsx +91 -0
  98. package/dist/sdk/src/ui/util.ts +83 -0
  99. package/dist/sdk/src/viewPeriod.ts +26 -0
  100. package/dist/sdk/src/vite.ts +92 -0
  101. package/dist/sdk/src/words/actions.ts +295 -0
  102. package/dist/sdk/src/words/clashes.ts +158 -0
  103. package/dist/sdk/src/words/format.ts +136 -0
  104. package/dist/sdk/src/words/index.ts +13 -0
  105. package/dist/sdk/src/words/keymap.ts +72 -0
  106. package/dist/sdk/src/words/keys.ts +297 -0
  107. package/dist/sdk/src/words/shell.ts +46 -0
  108. package/dist/sdk/src/words/types.ts +65 -0
  109. package/dist/skill-sync/index.js +832 -151
  110. package/dist/skill-sync/index.js.map +4 -4
  111. package/dist/skill-sync-worker.mjs +3941 -0
  112. package/dist/space-harness/host.js +1460 -0
  113. package/dist/space-sdk/dist/chunk-ZSN57ATH.js +5 -0
  114. package/dist/space-sdk/dist/index.js +15 -0
  115. package/dist/space-sdk/dist/ui.js +18 -0
  116. package/dist/space-sdk/package.json +33 -0
  117. package/dist/space-sdk/src/agentContext.d.ts +36 -0
  118. package/dist/space-sdk/src/components/Dialog.d.ts +20 -0
  119. package/dist/space-sdk/src/components/DocumentEditor.d.ts +46 -0
  120. package/dist/space-sdk/src/components/DocumentPage.d.ts +53 -0
  121. package/dist/space-sdk/src/components/Markdown.d.ts +18 -0
  122. package/dist/space-sdk/src/components/MarkdownEditor.d.ts +11 -0
  123. package/dist/space-sdk/src/components/MultiSelectActionBar.d.ts +31 -0
  124. package/dist/space-sdk/src/components/MultiSelectCheckbox.d.ts +14 -0
  125. package/dist/space-sdk/src/components/MultiSelectDragOverlay.d.ts +8 -0
  126. package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +36 -0
  127. package/dist/space-sdk/src/components/NotisSelectionBoundary.d.ts +16 -0
  128. package/dist/space-sdk/src/components/RecordComponents.d.ts +64 -0
  129. package/dist/space-sdk/src/components/ShortcutHints.d.ts +12 -0
  130. package/dist/space-sdk/src/components/Skeleton.d.ts +23 -0
  131. package/dist/space-sdk/src/config.ts +31 -0
  132. package/dist/space-sdk/src/documents.d.ts +59 -0
  133. package/dist/space-sdk/src/hooks/useAction.d.ts +8 -0
  134. package/dist/space-sdk/src/hooks/useActiveResource.d.ts +3 -0
  135. package/dist/space-sdk/src/hooks/useAgentContext.d.ts +7 -0
  136. package/dist/space-sdk/src/hooks/useBackend.d.ts +23 -0
  137. package/dist/space-sdk/src/hooks/useCloudComputer.d.ts +45 -0
  138. package/dist/space-sdk/src/hooks/useCloudComputerShell.d.ts +49 -0
  139. package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +118 -0
  140. package/dist/space-sdk/src/hooks/useDatabaseSchema.d.ts +14 -0
  141. package/dist/space-sdk/src/hooks/useDatabaseSubscription.d.ts +26 -0
  142. package/dist/space-sdk/src/hooks/useDocument.d.ts +22 -0
  143. package/dist/space-sdk/src/hooks/useDocuments.d.ts +31 -0
  144. package/dist/space-sdk/src/hooks/useHandover.d.ts +43 -0
  145. package/dist/space-sdk/src/hooks/useLongPressSelection.d.ts +9 -0
  146. package/dist/space-sdk/src/hooks/useMarqueeSelection.d.ts +57 -0
  147. package/dist/space-sdk/src/hooks/useMultiSelect.d.ts +51 -0
  148. package/dist/space-sdk/src/hooks/useNativeDocumentBody.d.ts +24 -0
  149. package/dist/space-sdk/src/hooks/useNativeDocuments.d.ts +55 -0
  150. package/dist/space-sdk/src/hooks/useNotis.d.ts +25 -0
  151. package/dist/space-sdk/src/hooks/useNotisNavigation.d.ts +33 -0
  152. package/dist/space-sdk/src/hooks/useQuery.d.ts +22 -0
  153. package/dist/space-sdk/src/hooks/useTool.d.ts +20 -0
  154. package/dist/space-sdk/src/hooks/useToolQuery.d.ts +3 -0
  155. package/dist/space-sdk/src/hooks/useTools.d.ts +15 -0
  156. package/dist/space-sdk/src/hooks/useTopBarSearch.d.ts +48 -0
  157. package/dist/space-sdk/src/hooks/useTopBarTitleLeaf.d.ts +24 -0
  158. package/dist/space-sdk/src/hooks/useUpsertDocument.d.ts +27 -0
  159. package/dist/space-sdk/src/hooks/useViewParams.d.ts +76 -0
  160. package/dist/space-sdk/src/hooks/useViewerReads.d.ts +38 -0
  161. package/dist/space-sdk/src/index.d.ts +98 -0
  162. package/dist/space-sdk/src/interactions/actions.d.ts +33 -0
  163. package/dist/space-sdk/src/interactions/shortcuts.d.ts +42 -0
  164. package/dist/space-sdk/src/interactions/visibility.d.ts +2 -0
  165. package/dist/space-sdk/src/nativeData.d.ts +66 -0
  166. package/dist/space-sdk/src/provider.d.ts +17 -0
  167. package/dist/space-sdk/src/queryCache.d.ts +45 -0
  168. package/dist/space-sdk/src/queryErrors.ts +51 -0
  169. package/dist/space-sdk/src/runtime.d.ts +615 -0
  170. package/dist/space-sdk/src/runtimeModules.ts +33 -0
  171. package/dist/space-sdk/src/space.ts +442 -0
  172. package/dist/space-sdk/src/standardViewParams.d.ts +15 -0
  173. package/dist/space-sdk/src/tailwind-candidates.d.ts +3418 -0
  174. package/dist/space-sdk/src/tailwind.ts +66 -0
  175. package/dist/space-sdk/src/ui/actions/ActionToast.d.ts +15 -0
  176. package/dist/space-sdk/src/ui/actions/actionWords.d.ts +16 -0
  177. package/dist/space-sdk/src/ui/actions/index.d.ts +7 -0
  178. package/dist/space-sdk/src/ui/actions/useActions.d.ts +69 -0
  179. package/dist/space-sdk/src/ui/actions/useToast.d.ts +41 -0
  180. package/dist/space-sdk/src/ui/blocks/Tabs.d.ts +139 -0
  181. package/dist/space-sdk/src/ui/blocks/blocks.d.ts +217 -0
  182. package/dist/space-sdk/src/ui/blocks/index.d.ts +4 -0
  183. package/dist/space-sdk/src/ui/board/BoardView.d.ts +36 -0
  184. package/dist/space-sdk/src/ui/board/boardModel.d.ts +46 -0
  185. package/dist/space-sdk/src/ui/board/boardWords.d.ts +9 -0
  186. package/dist/space-sdk/src/ui/board/index.d.ts +5 -0
  187. package/dist/space-sdk/src/ui/calendar/CalendarView.d.ts +49 -0
  188. package/dist/space-sdk/src/ui/calendar/DayPicker.d.ts +23 -0
  189. package/dist/space-sdk/src/ui/calendar/calendarMath.d.ts +81 -0
  190. package/dist/space-sdk/src/ui/charts/Chart.d.ts +203 -0
  191. package/dist/space-sdk/src/ui/charts/ChartTable.d.ts +37 -0
  192. package/dist/space-sdk/src/ui/charts/RenderChartData.d.ts +16 -0
  193. package/dist/space-sdk/src/ui/charts/StatRow.d.ts +59 -0
  194. package/dist/space-sdk/src/ui/charts/chartData.d.ts +84 -0
  195. package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +58 -0
  196. package/dist/space-sdk/src/ui/comments/commentModel.d.ts +157 -0
  197. package/dist/space-sdk/src/ui/comments/commentWords.d.ts +60 -0
  198. package/dist/space-sdk/src/ui/comments/index.d.ts +4 -0
  199. package/dist/space-sdk/src/ui/comments/useComments.d.ts +146 -0
  200. package/dist/space-sdk/src/ui/engine/HelpSheet.d.ts +12 -0
  201. package/dist/space-sdk/src/ui/engine/KeyboardEngine.d.ts +27 -0
  202. package/dist/space-sdk/src/ui/engine/core.d.ts +73 -0
  203. package/dist/space-sdk/src/ui/engine/hooks.d.ts +64 -0
  204. package/dist/space-sdk/src/ui/engine/index.d.ts +14 -0
  205. package/dist/space-sdk/src/ui/engine/instance.d.ts +21 -0
  206. package/dist/space-sdk/src/ui/engine/keycapContext.d.ts +2 -0
  207. package/dist/space-sdk/src/ui/engine/registry.d.ts +77 -0
  208. package/dist/space-sdk/src/ui/engine/step.d.ts +11 -0
  209. package/dist/space-sdk/src/ui/engine/types.d.ts +54 -0
  210. package/dist/space-sdk/src/ui/fields/fieldWords.d.ts +56 -0
  211. package/dist/space-sdk/src/ui/fields/fields.d.ts +162 -0
  212. package/dist/space-sdk/src/ui/fields/index.d.ts +5 -0
  213. package/dist/space-sdk/src/ui/fields/useFieldDraft.d.ts +22 -0
  214. package/dist/space-sdk/src/ui/gallery/AttachmentGallery.d.ts +53 -0
  215. package/dist/space-sdk/src/ui/gallery/ImageViewer.d.ts +27 -0
  216. package/dist/space-sdk/src/ui/gallery/galleryWords.d.ts +95 -0
  217. package/dist/space-sdk/src/ui/gallery/index.d.ts +5 -0
  218. package/dist/space-sdk/src/ui/icons.d.ts +13 -0
  219. package/dist/space-sdk/src/ui/index.d.ts +54 -0
  220. package/dist/space-sdk/src/ui/keycap/Keycap.d.ts +22 -0
  221. package/dist/space-sdk/src/ui/keycap/index.d.ts +2 -0
  222. package/dist/space-sdk/src/ui/layout/Panels.d.ts +50 -0
  223. package/dist/space-sdk/src/ui/layout/chatPanelEdge.d.ts +77 -0
  224. package/dist/space-sdk/src/ui/layout/index.d.ts +5 -0
  225. package/dist/space-sdk/src/ui/layout/panelMath.d.ts +91 -0
  226. package/dist/space-sdk/src/ui/list/ListReader.d.ts +380 -0
  227. package/dist/space-sdk/src/ui/list/Row.d.ts +145 -0
  228. package/dist/space-sdk/src/ui/list/SelectionBar.d.ts +65 -0
  229. package/dist/space-sdk/src/ui/list/index.d.ts +14 -0
  230. package/dist/space-sdk/src/ui/list/rowState.d.ts +22 -0
  231. package/dist/space-sdk/src/ui/list/useListKeys.d.ts +89 -0
  232. package/dist/space-sdk/src/ui/list/useReorder.d.ts +86 -0
  233. package/dist/space-sdk/src/ui/list/useSelection.d.ts +90 -0
  234. package/dist/space-sdk/src/ui/open/OpenAsMenu.d.ts +15 -0
  235. package/dist/space-sdk/src/ui/open/index.d.ts +6 -0
  236. package/dist/space-sdk/src/ui/open/openModeStore.d.ts +39 -0
  237. package/dist/space-sdk/src/ui/open/useOpenMode.d.ts +17 -0
  238. package/dist/space-sdk/src/ui/overlay/Menu.d.ts +88 -0
  239. package/dist/space-sdk/src/ui/overlay/Popover.d.ts +28 -0
  240. package/dist/space-sdk/src/ui/overlay/Tooltip.d.ts +19 -0
  241. package/dist/space-sdk/src/ui/overlay/index.d.ts +9 -0
  242. package/dist/space-sdk/src/ui/overlay/layerRoot.d.ts +24 -0
  243. package/dist/space-sdk/src/ui/overlay/position.d.ts +31 -0
  244. package/dist/space-sdk/src/ui/period/PeriodPicker.d.ts +30 -0
  245. package/dist/space-sdk/src/ui/period/dateFormat.d.ts +50 -0
  246. package/dist/space-sdk/src/ui/period/dateWords.d.ts +88 -0
  247. package/dist/space-sdk/src/ui/period/periods.d.ts +70 -0
  248. package/dist/space-sdk/src/ui/period/usePeriod.d.ts +23 -0
  249. package/dist/space-sdk/src/ui/present/index.d.ts +3 -0
  250. package/dist/space-sdk/src/ui/present/presentWords.d.ts +27 -0
  251. package/dist/space-sdk/src/ui/present/screens.d.ts +36 -0
  252. package/dist/space-sdk/src/ui/present/useAudienceScreen.d.ts +38 -0
  253. package/dist/space-sdk/src/ui/styles.d.ts +21 -0
  254. package/dist/space-sdk/src/ui/timeline/TimelineView.d.ts +44 -0
  255. package/dist/space-sdk/src/ui/timeline/timelineMath.d.ts +123 -0
  256. package/dist/space-sdk/src/viewPeriod.d.ts +8 -0
  257. package/dist/space-sdk/src/vite.ts +92 -0
  258. package/dist/space-sdk/src/words/actions.ts +295 -0
  259. package/dist/space-sdk/src/words/clashes.ts +158 -0
  260. package/dist/space-sdk/src/words/format.ts +136 -0
  261. package/dist/space-sdk/src/words/index.ts +13 -0
  262. package/dist/space-sdk/src/words/keymap.ts +72 -0
  263. package/dist/space-sdk/src/words/keys.ts +297 -0
  264. package/dist/space-sdk/src/words/shell.ts +46 -0
  265. package/dist/space-sdk/src/words/types.ts +65 -0
  266. package/dist/view-renderer/dist/host.css +1 -0
  267. package/dist/view-renderer/dist/host.js +2374 -0
  268. package/dist/view-renderer/dist/theme.css +73 -0
  269. package/dist/view-renderer/src/dom.js +212 -0
  270. package/dist/view-renderer/src/errors.js +8 -0
  271. package/dist/view-renderer/src/host.tsx +250 -0
  272. package/dist/view-renderer/src/index.js +4 -0
  273. package/dist/view-renderer/src/png.js +213 -0
  274. package/dist/view-renderer/src/pool.js +110 -0
  275. package/dist/view-renderer/src/remote-broker.js +59 -0
  276. package/dist/view-renderer/src/renderer.js +271 -0
  277. package/package.json +21 -11
  278. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +63 -12
  279. package/skills/notis-onboarding/BRIEF.md +14 -9
  280. package/skills/notis-query/cli.md +1 -1
  281. package/skills/notis-spaces/cli.md +540 -0
  282. package/src/cli.js +8 -8
  283. package/src/command-specs/agents.js +121 -8
  284. package/src/command-specs/auth.js +3 -3
  285. package/src/command-specs/diagnostics.js +97 -20
  286. package/src/command-specs/documents.js +158 -0
  287. package/src/command-specs/files.js +29 -0
  288. package/src/command-specs/handover.js +331 -79
  289. package/src/command-specs/helpers.js +50 -40
  290. package/src/command-specs/index.js +14 -5
  291. package/src/command-specs/meta.js +38 -9
  292. package/src/command-specs/onboarding.js +1 -1
  293. package/src/command-specs/profile.js +42 -1
  294. package/src/command-specs/skills.js +314 -9
  295. package/src/command-specs/smoke.js +16 -4
  296. package/src/command-specs/spaces.js +783 -0
  297. package/src/command-specs/tools.js +118 -21
  298. package/src/command-specs/version-history.js +20 -0
  299. package/src/command-specs/views.js +69 -0
  300. package/src/runtime/agent-browser.js +178 -267
  301. package/src/runtime/agent-setup.js +172 -13
  302. package/src/runtime/app-boundary-validator.js +338 -2
  303. package/src/runtime/app-data-literals.js +82 -0
  304. package/src/runtime/app-platform.js +750 -1568
  305. package/src/runtime/auth-recovery.js +17 -0
  306. package/src/runtime/base-skills.d.ts +11 -0
  307. package/src/runtime/base-skills.js +100 -3
  308. package/src/runtime/computer-identity.d.ts +30 -0
  309. package/src/runtime/computer-identity.js +151 -0
  310. package/src/runtime/config-lock.js +135 -0
  311. package/src/runtime/confined-space-build.js +74 -0
  312. package/src/runtime/confined-space-verify.js +49 -0
  313. package/src/runtime/delegated-context.js +5 -21
  314. package/src/runtime/native-record-files.js +47 -0
  315. package/src/runtime/oauth.js +342 -31
  316. package/src/runtime/profiles.js +19 -112
  317. package/src/runtime/retired-sdk-files.js +24 -0
  318. package/src/runtime/retry.js +150 -0
  319. package/src/runtime/skill-sync/cloud-client.ts +33 -8
  320. package/src/runtime/skill-sync/index.ts +443 -106
  321. package/src/runtime/skill-sync/local-scanner.ts +248 -32
  322. package/src/runtime/skill-sync/native-identity.ts +102 -0
  323. package/src/runtime/skill-sync/native-plan.ts +70 -0
  324. package/src/runtime/skill-sync/symlink-manager.ts +66 -16
  325. package/src/runtime/skill-sync/sync-plan.ts +34 -2
  326. package/src/runtime/skill-sync/types.ts +54 -0
  327. package/src/runtime/skill-sync/write-cloud-skill.ts +4 -4
  328. package/src/runtime/skill-sync-service.js +109 -0
  329. package/src/runtime/source-root.js +32 -0
  330. package/src/runtime/space-collection-scaffold.js +107 -0
  331. package/src/runtime/space-database-structures.js +229 -0
  332. package/src/runtime/space-fixture-broker.js +68 -0
  333. package/src/runtime/space-lock.js +337 -0
  334. package/src/runtime/space-platform.js +133 -0
  335. package/src/runtime/space-source.js +290 -0
  336. package/src/runtime/space-test-server.js +354 -0
  337. package/src/runtime/space-verification.js +94 -0
  338. package/src/runtime/space-verify-browser-worker.js +51 -0
  339. package/src/runtime/space-view-manifest.js +368 -0
  340. package/src/runtime/sync-skills.d.ts +5 -1
  341. package/src/runtime/sync-skills.js +11 -2
  342. package/src/runtime/tool-confirmation.js +138 -0
  343. package/src/runtime/transport.js +118 -24
  344. package/src/runtime/upsell.js +219 -0
  345. package/src/runtime/view-render.js +49 -0
  346. package/src/skill-sync-worker-entry.js +2 -0
  347. package/src/skill-sync-worker.js +114 -0
  348. package/src/space-harness-host.ts +122 -0
  349. package/template/.harness/index.html.tmpl +9 -352
  350. package/template/app/globals.css +29 -3
  351. package/template/app/layout.tsx +2 -6
  352. package/template/components/ui/badge.tsx +7 -4
  353. package/template/components/ui/button.tsx +1 -1
  354. package/template/components/ui/native-select.tsx +24 -0
  355. package/template/notis.config.ts +4 -36
  356. package/template/package-lock.json +1800 -1867
  357. package/template/package.json +16 -14
  358. package/template/postcss.config.mjs +1 -1
  359. package/template/tailwind.config.ts +1 -6
  360. package/template/tsconfig.json +1 -0
  361. package/template/vite.config.ts +2 -2
  362. package/dist/base-skills/notis-apps/SKILL.md +0 -613
  363. package/skills/notis-apps/cli.md +0 -285
  364. package/src/command-specs/apps.js +0 -3000
  365. package/src/runtime/app-changelog.js +0 -79
  366. package/src/runtime/app-dev-consumers.js +0 -154
  367. package/src/runtime/app-dev-host-lock.js +0 -80
  368. package/src/runtime/app-dev-process-identity.js +0 -111
  369. package/src/runtime/app-dev-roots.js +0 -284
  370. package/src/runtime/app-dev-server.js +0 -1140
  371. package/src/runtime/app-dev-sessions.js +0 -185
  372. package/src/runtime/app-registry-scaffolds.js +0 -367
  373. package/src/runtime/assets/store-screenshot-dark.png +0 -0
  374. package/src/runtime/cli-mode.generated.js +0 -5
  375. package/src/runtime/cli-mode.js +0 -34
  376. package/src/runtime/store-screenshot.js +0 -143
  377. package/template/CHANGELOG.md +0 -5
  378. package/template/app/page.tsx +0 -60
  379. package/template/components/ui/card.tsx +0 -56
  380. package/template/packages/sdk/src/components/DocumentEditor.tsx +0 -103
  381. package/template/packages/sdk/src/config.ts +0 -259
  382. package/template/packages/sdk/src/hooks/useCloudComputer.ts +0 -97
  383. package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +0 -85
  384. package/template/packages/sdk/src/hooks/useDocument.ts +0 -78
  385. package/template/packages/sdk/src/hooks/useNotisNavigation.ts +0 -52
  386. package/template/packages/sdk/src/hooks/useTopBarSearch.ts +0 -73
  387. package/template/packages/sdk/src/runtime.ts +0 -439
  388. package/template/packages/sdk/src/vite.ts +0 -56
  389. package/template/packages/sdk/tsconfig.json +0 -15
  390. /package/{template/packages → dist}/sdk/src/components/MultiSelectDragOverlay.tsx +0 -0
  391. /package/{template/packages → dist}/sdk/src/components/ShortcutHints.tsx +0 -0
  392. /package/{template/packages → dist}/sdk/src/hooks/useActiveResource.ts +0 -0
  393. /package/{template/packages → dist}/sdk/src/hooks/useTool.ts +0 -0
  394. /package/{template/packages → dist}/sdk/src/hooks/useTools.ts +0 -0
  395. /package/{template/packages → dist}/sdk/src/ui.ts +0 -0
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Row (toolkit spec 2.5): the content of one list row. Inside a ListReader the list draws the row element (it
3
+ * carries the keys, pointer rules and states) and Row fills it; on its own Row draws a `nui-row` element with the
4
+ * looks of its `state` prop.
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import { type Locale, type Words } from '../../words';
8
+ import { type RowState } from './rowState';
9
+ export type Tone = 'default' | 'info' | 'success' | 'warning' | 'danger';
10
+ export type RowLabel = string | {
11
+ label: Words | string;
12
+ tone?: Tone;
13
+ };
14
+ /**
15
+ * One thing the row is linked to (a Space, an inbox), drawn as a chip after the title. With `onRemove` the chip ends
16
+ * in an x that unlinks it without opening the row.
17
+ */
18
+ export interface RowTag {
19
+ id: string;
20
+ label: string;
21
+ icon?: ReactNode;
22
+ onRemove?: () => void;
23
+ /** The x's accessible name. Default "Remove {label}". */
24
+ removeLabel?: string;
25
+ /** The removal is under way: the x is disabled. */
26
+ busy?: boolean;
27
+ /** The link is still being saved: a spinner stands where the x goes. */
28
+ pending?: boolean;
29
+ }
30
+ export interface RowOwner {
31
+ name: string;
32
+ avatarUrl?: string;
33
+ }
34
+ export interface RowProps {
35
+ /** Lead, 20px. `{ status }` draws the status icon of that status (see `statusGroup`). */
36
+ icon?: ReactNode | {
37
+ status: string;
38
+ };
39
+ title: ReactNode;
40
+ /** The start of the muted line under the title (12/16); `labels` follow it after a " · ". */
41
+ meta?: ReactNode;
42
+ /** One clamped line (13/18). */
43
+ snippet?: ReactNode;
44
+ /**
45
+ * Words on the meta line, as text joined by ", " (never chips). A warning or danger label comes first and keeps
46
+ * its tone.
47
+ */
48
+ labels?: readonly RowLabel[];
49
+ /** Links as chips between the title and the trail; they shrink, then clip, before the title does. */
50
+ tags?: readonly RowTag[];
51
+ /** A 24px avatar after the time. */
52
+ owner?: RowOwner;
53
+ /**
54
+ * A compact relative time ("12m", "2h", "1d"; French "12 min", "2 h", "1 j") up to 30 days back, else the day and
55
+ * month this year and the full date before it. A date-only value (a 'YYYY-MM-DD' string, or any value with
56
+ * `dateOnly`) reads as that local day: "Today", or its day and month.
57
+ */
58
+ time?: Date | string | number;
59
+ /** `time` is a day, not a moment: no relative time, and no shift across time zones. */
60
+ dateOnly?: boolean;
61
+ /** The clock `time` is read against. Default the current time; pass it for a stable render (a test, a specimen). */
62
+ now?: Date;
63
+ /** First in the trail, before the time (a star). */
64
+ trailing?: ReactNode;
65
+ /** The row-more button (28px). Default true when the list has actions. */
66
+ more?: boolean;
67
+ /** Injected by ListReader; pass it when drawing a Row on its own. */
68
+ state?: RowState;
69
+ /**
70
+ * 2: a long title (a memory, a note) wraps onto a second line before it ends in an ellipsis; the row then aligns to
71
+ * its top, with the trail on the first title line. Default 1.
72
+ */
73
+ wrap?: 1 | 2;
74
+ /** Only on a Row drawn on its own; inside a list the list's row element carries the classes. */
75
+ className?: string;
76
+ }
77
+ /**
78
+ * Work moves backlog to done (`review`: the work is ready and a person checks it next); `up` and `down` are a service or
79
+ * a monitor (a health page, an integration).
80
+ */
81
+ export type StatusGroup = 'backlog' | 'todo' | 'active' | 'review' | 'waiting' | 'done' | 'cancelled' | 'failed' | 'up' | 'down';
82
+ export declare const STATUS_WORDS: Readonly<Record<StatusGroup, Words>>;
83
+ /** The status group of a Space status ('In progress', 'in_progress', 'doing' are all active). Unknown: todo. */
84
+ export declare function statusGroup(status: string): StatusGroup;
85
+ /**
86
+ * The status icon of one status, labelled for screen readers. `decorative`: hidden from screen readers (the status
87
+ * is already said in text next to it).
88
+ */
89
+ export declare function StatusIcon({ status, label, decorative }: {
90
+ status: string;
91
+ label?: Words | string;
92
+ decorative?: boolean;
93
+ }): import("react").JSX.Element;
94
+ /** The words of the star mark. */
95
+ export declare const STAR_WORDS: Readonly<{
96
+ starred: {
97
+ en: string;
98
+ fr: string;
99
+ };
100
+ }>;
101
+ /** A starred item's filled amber star (14px, labelled "Starred"), for a row's trailing slot or a reader head. */
102
+ export declare function StarMark({ decorative }: {
103
+ decorative?: boolean;
104
+ }): import("react").JSX.Element;
105
+ /**
106
+ * The row-more button and its action menu for the current row, for content that is not a Row (a tile, a table
107
+ * cell). Draws nothing outside a ListReader or when the list has no actions for the item.
108
+ */
109
+ export declare function RowMore(): import("react").JSX.Element | null;
110
+ /** The words of row and reader times. `{t}` in `ago` is a compact time from `formatRowAgo`. */
111
+ export declare const ROW_TIME_WORDS: Readonly<{
112
+ today: {
113
+ en: string;
114
+ fr: string;
115
+ };
116
+ ago: {
117
+ en: string;
118
+ fr: string;
119
+ };
120
+ }>;
121
+ /**
122
+ * A row time as a Date. A 'YYYY-MM-DD' string (or any value when `dateOnly`) maps to local noon of that day, so a
123
+ * day never shows as the day before west of UTC.
124
+ */
125
+ export declare function parseRowDate(value: Date | string | number, dateOnly?: boolean): {
126
+ date: Date;
127
+ dateOnly: boolean;
128
+ };
129
+ /**
130
+ * A compact time since `value`, the deck's: minutes under an hour, hours under a day, else days. English "12m",
131
+ * "2h", "4d"; French "12 min", "2 h", "4 j". Null for an invalid value or a time ahead of `now`.
132
+ */
133
+ export declare function formatRowAgo(value: Date | string | number, locale: Locale, now?: Date): string | null;
134
+ /** The long time a reader shows: "45m ago" / "il y a 45 min". Empty for an invalid value or a time ahead of `now`. */
135
+ export declare function formatReaderAgo(value: Date | string | number, locale: Locale, now?: Date): string;
136
+ /**
137
+ * The compact row time: a relative time up to 30 days back ("12m", "2h", "1d"), else the day and month this year
138
+ * and the full date before it ("Oct 3", "Oct 3, 2025"; French "3 oct.", "3 oct. 2025"). A date-only value shows
139
+ * "Today" / "Aujourd’hui" or its day and month; a time ahead of `now` shows its date.
140
+ */
141
+ export declare function formatRowTime(value: Date | string | number, locale: Locale, now?: Date, timeOptions?: {
142
+ dateOnly?: boolean;
143
+ }): string;
144
+ /** One list row: lead icon, a title over a meta line, then the trail (trailing, time, avatar, More). */
145
+ export declare function Row({ icon, title, meta, snippet, labels, tags, owner, time, dateOnly, now, trailing, more, state, wrap, className, }: RowProps): import("react").JSX.Element;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * SelectionBar (toolkit spec 2.6): the locked "today" pill at the bottom of a list while rows are selected.
3
+ *
4
+ * "{n} selected", then one button per action (label, then a pill keycap), overflow in a More menu, and X to clear
5
+ * (its tooltip shows Esc). Where it does not fit the pill drops the keys, then the words (`data-fit`), and every
6
+ * button then carries a tooltip with both, as in the deck.
7
+ *
8
+ * `useSelectionBar` registers the action keys once per key at `collection` with boost 25, so they win over row keys.
9
+ * With nothing selected the keys act on a fallback (the open item or the cursor row), as in the Manager.
10
+ */
11
+ import type { ActionOutcome, ActionsController, ResolvedAction } from '../actions/useActions';
12
+ import type { Selection } from './useSelection';
13
+ /** Buttons shown in the pill before the rest go into More. */
14
+ export declare const SELECTION_BAR_MAX_INLINE = 5;
15
+ /** The boost of the bar's keys over row keys (toolkit spec 2.1). */
16
+ export declare const SELECTION_BAR_BOOST = 25;
17
+ export type SelectionBarFit = '' | 'nokeys' | 'icons';
18
+ export interface SelectionBarProps {
19
+ /** The actions that apply to the selected items, in order. */
20
+ actions: readonly ResolvedAction<any>[];
21
+ count: number;
22
+ onClear(): void;
23
+ /** `anchor` is the pressed button (a picker action opens its menu there). */
24
+ onRun(action: ResolvedAction<any>, anchor?: HTMLElement | null): void;
25
+ /** Ids of the actions running now: their buttons show busy and ignore presses. */
26
+ busy?: ReadonlySet<string>;
27
+ /** 'list' (default): the pill centres on its list. 'page': on the whole page. */
28
+ anchor?: 'list' | 'page';
29
+ className?: string;
30
+ }
31
+ /** The first fit that leaves `room` px, trying keys and words, then words only, then icons. */
32
+ export declare function chooseFit(measure: (fit: SelectionBarFit) => number, room: number): SelectionBarFit;
33
+ export declare function SelectionBar({ actions, count, onClear, onRun, busy, anchor, className }: SelectionBarProps): import("react").JSX.Element;
34
+ export interface UseSelectionBarOptions<T> {
35
+ controller: ActionsController<T>;
36
+ selection: Selection;
37
+ /** Items by id (the list's items). */
38
+ getItem(id: string): T | undefined;
39
+ /** What the keys act on while nothing is selected (the open item, else the cursor row). */
40
+ fallback?: () => T[];
41
+ /** Keys off while false (the list is hidden). */
42
+ when?: () => boolean;
43
+ /** Owner override (default the nearest ShortcutScope). */
44
+ owner?: string;
45
+ /** Called after an action ran on the selection (ListReader moves the cursor off removed rows). */
46
+ onRan?: (action: ResolvedAction<T>, items: T[], outcome: ActionOutcome<T>) => void;
47
+ /**
48
+ * A picker action (one with `options`) was chosen: open its menu at `anchor` (the bar button, null from a key or
49
+ * the More menu). Without it the action runs at once with no choice.
50
+ */
51
+ onPick?: (action: ResolvedAction<T>, items: T[], anchor: HTMLElement | null) => void;
52
+ }
53
+ export interface SelectionBarState<T> {
54
+ /** Something is selected and the list has bulk actions: draw the bar. */
55
+ visible: boolean;
56
+ selectedItems: T[];
57
+ /** Spread on `<SelectionBar />`. */
58
+ barProps: SelectionBarProps;
59
+ /**
60
+ * Runs an action on the selection (or the fallback when nothing is selected). A picker action goes to `onPick`
61
+ * instead and resolves null.
62
+ */
63
+ runAction(action: ResolvedAction<T>, anchor?: HTMLElement | null): Promise<ActionOutcome<T> | null>;
64
+ }
65
+ export declare function useSelectionBar<T>(options: UseSelectionBarOptions<T>): SelectionBarState<T>;
@@ -0,0 +1,14 @@
1
+ export { LIST_DRAG_TYPE, LIST_READER_WORDS, ListReader, ListSkeleton, rankActions, successorOf } from './ListReader';
2
+ export type { ListGroup, ListReaderApi, ListReaderProps, ListReorder, ListSearchProps, ListSkeletonProps, OpenChangeReason, OpenChangeVerdict, ReaderAction, ReaderCtx, TileParts, ViewMenuItem, ViewMenuProps, } from './ListReader';
3
+ export { ROW_TIME_WORDS, Row, RowMore, STAR_WORDS, STATUS_WORDS, StarMark, StatusIcon, formatReaderAgo, formatRowAgo, formatRowTime, parseRowDate, statusGroup, } from './Row';
4
+ export type { RowLabel, RowOwner, RowProps, RowTag, StatusGroup, Tone } from './Row';
5
+ export { IDLE_ROW_STATE, RowIdContext, RowStateContext, useRowState } from './rowState';
6
+ export type { RowState, RowStateSource } from './rowState';
7
+ export { ROW_ID_ATTRIBUTE, ROW_INTERACTIVE_SELECTOR, boardStep, findRow, gridColumns, useListKeys } from './useListKeys';
8
+ export type { RowDomProps, UseListKeysOptions } from './useListKeys';
9
+ export { EMPTY_SELECTION, rangeBetween, selectionReducer, useSelection } from './useSelection';
10
+ export type { Selection, SelectionAction, SelectionState, UseSelectionOptions } from './useSelection';
11
+ export { SELECTION_BAR_BOOST, SELECTION_BAR_MAX_INLINE, SelectionBar, chooseFit, useSelectionBar, } from './SelectionBar';
12
+ export type { SelectionBarFit, SelectionBarProps, SelectionBarState, UseSelectionBarOptions } from './SelectionBar';
13
+ export { REORDER_DRAG_TYPE, REORDER_WORDS, chainReorderProps, dropIndex, useReorder } from './useReorder';
14
+ export type { Reorder, ReorderChange, ReorderItemProps, ReorderOrientation, UseReorderOptions } from './useReorder';
@@ -0,0 +1,22 @@
1
+ /** Row state (toolkit spec 2.3, 2.5): what a row needs to draw its cursor, open and selected looks. */
2
+ import { type ReactNode } from 'react';
3
+ export interface RowState {
4
+ cursor: boolean;
5
+ open: boolean;
6
+ selected: boolean;
7
+ /** Something in the list is selected (rows show their checkbox). */
8
+ anySelected: boolean;
9
+ index: number;
10
+ }
11
+ export declare const IDLE_ROW_STATE: RowState;
12
+ export interface RowStateSource {
13
+ stateOf(id: string): RowState;
14
+ /** Toggle the row in the selection (the lead checkbox); null when the list is not selectable. */
15
+ toggle: ((id: string) => void) | null;
16
+ /** The row-more button content; null when the list has no actions. */
17
+ more: ((id: string) => ReactNode) | null;
18
+ }
19
+ export declare const RowStateContext: import("react").Context<RowStateSource | null>;
20
+ export declare const RowIdContext: import("react").Context<string | null>;
21
+ /** The state of row `id` inside a ListReader (or a list that provides RowStateContext). */
22
+ export declare function useRowState(id?: string): RowState;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * `useListKeys` (toolkit spec 2.4): J/K, Enter, X, Shift+J/K and Mod+A on a list, plus the row pointer rules,
3
+ * registered with the keyboard engine (no own keydown listener).
4
+ *
5
+ * Behaviour follows the Portal Manager list (`useCollectionInteractions`):
6
+ * - J/K wrap on a fresh press and stop at the edge while held (`stepCursor`, `repeat: true`).
7
+ * - With an item open, J/K open the item under the new cursor.
8
+ * - Only visible rows count (hidden, inert or display none rows are skipped).
9
+ * - The row under the cursor is focused without scrolling, then scrolled to the nearest edge (scroll padding keeps
10
+ * it clear of the selection bar). Focus stays put only inside another toolkit pane or layer, such as the open
11
+ * item's reader (`focusStaysOnMove`); from a filter or a tab it goes to the row, so Enter opens the row.
12
+ * - Mod+press toggles on pointer down and swallows the click; Shift+click selects a range; a plain click clears
13
+ * the selection and opens; Space on the row toggles; press and hold on touch toggles (500 ms, 10 px).
14
+ * - Clicks on a control inside the row (button, link, field) are left to the control.
15
+ *
16
+ * Put `data-notis-engine-list` on the list container (role listbox): the engine then keeps its keys working while
17
+ * a row has focus.
18
+ */
19
+ import { type RefObject } from 'react';
20
+ import type { FocusEvent as ReactFocusEvent, KeyboardEvent as ReactKeyboardEvent, MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent } from 'react';
21
+ import { type Scope } from '../../words';
22
+ import type { Selection } from './useSelection';
23
+ /** Clicks on these inside a row belong to them (Manager `INTERACTIVE_SELECTOR`). */
24
+ export declare const ROW_INTERACTIVE_SELECTOR = "button, a, input, textarea, select, [role=\"button\"], [contenteditable]:not([contenteditable=\"false\"])";
25
+ export declare const ROW_ID_ATTRIBUTE = "data-nui-item";
26
+ export interface UseListKeysOptions {
27
+ ids: readonly string[];
28
+ cursor: string | null;
29
+ setCursor(id: string): void;
30
+ onOpen(id: string): void;
31
+ /** J on the last row goes to the first (fresh press only). Default true. */
32
+ wrap?: boolean;
33
+ /** Default 'collection'. */
34
+ scope?: Scope;
35
+ /** The list element (scroll container or the listbox). Keys are live while it is visible. */
36
+ containerRef: RefObject<HTMLElement | null>;
37
+ /** Multi-select: X, Shift+J/K, Mod+A, Mod/Shift-click, Space and press and hold. */
38
+ selection?: Selection | null;
39
+ /** The open item: J/K then open the next item too. */
40
+ openId?: string | null;
41
+ /** Keys off (a background view). Default true. */
42
+ enabled?: boolean;
43
+ /** Owner override for the defs (default the nearest ShortcutScope). */
44
+ owner?: string;
45
+ /** J on the last row without wrapping (the list has more to load): ListReader loads the next page. */
46
+ onReachEnd?: () => void;
47
+ /**
48
+ * A tile grid: the arrow keys move left, right and by one row up and down (no wrap) while a tile has focus.
49
+ * J/K still step one tile.
50
+ */
51
+ grid?: boolean;
52
+ /**
53
+ * A board: the ids of each column, in order (implies `grid`). Up and Down move inside the column (no wrap), Left and
54
+ * Right go to the nearest column that has tiles, at the same height or its last tile.
55
+ */
56
+ board?: readonly (readonly string[])[];
57
+ }
58
+ export interface RowDomProps {
59
+ role: 'option';
60
+ 'aria-selected': boolean;
61
+ tabIndex: number;
62
+ 'data-nui-item': string;
63
+ 'data-cursor'?: '';
64
+ 'data-open'?: '';
65
+ 'data-selected'?: '';
66
+ onMouseDown(event: ReactMouseEvent<HTMLElement>): void;
67
+ onClick(event: ReactMouseEvent<HTMLElement>): void;
68
+ onClickCapture(event: ReactMouseEvent<HTMLElement>): void;
69
+ onKeyDown(event: ReactKeyboardEvent<HTMLElement>): void;
70
+ onFocus(event: ReactFocusEvent<HTMLElement>): void;
71
+ onPointerDown(event: ReactPointerEvent<HTMLElement>): void;
72
+ onPointerMove(event: ReactPointerEvent<HTMLElement>): void;
73
+ onPointerUp(event: ReactPointerEvent<HTMLElement>): void;
74
+ onPointerCancel(event: ReactPointerEvent<HTMLElement>): void;
75
+ }
76
+ /** The row element of `id` inside `container`. */
77
+ export declare function findRow(container: HTMLElement | null, id: string): HTMLElement | null;
78
+ /**
79
+ * The next tile on a board from `current` (`lanes` = the ids of each column, in order). Up and Down stay in the column
80
+ * and hold at its edge; Left and Right skip empty columns and land at the same index or the column's last tile. Null
81
+ * when the key has nowhere to go.
82
+ */
83
+ export declare function boardStep(lanes: readonly (readonly string[])[], current: string | null, dir: 'left' | 'right' | 'up' | 'down'): string | null;
84
+ /** Tiles in the first row of a grid (same top edge as the first tile); 1 when it cannot tell. */
85
+ export declare function gridColumns(container: HTMLElement | null, ids: readonly string[]): number;
86
+ export declare function useListKeys(options: UseListKeysOptions): {
87
+ getRowProps(id: string): RowDomProps;
88
+ visibleIds(): string[];
89
+ };
@@ -0,0 +1,86 @@
1
+ /**
2
+ * useReorder: drag to reorder, plus Alt and an arrow key, for any ordered list (rows, tiles, a slide rail).
3
+ *
4
+ * - Off unless the list asks for it: rows only get reorder props from `getItemProps`, and `enabled: false` returns none.
5
+ * - Pointer: a row drags with the browser's own drag (so touch scrolling stays the browser's), the row under the
6
+ * pointer shows where it lands (`data-drop="before" | "after"`) and the dragged row shows `data-dragging`.
7
+ * - Keyboard: Alt and an arrow key move the focused item one place (Up and Down for a vertical list, Left and Right
8
+ * for a horizontal one, all four for a grid); Alt+Home and Alt+End move it to the start or the end. Focus stays on it.
9
+ * - Every move is said in the polite live region (`announcer`): "Moved to position 3 of 8.".
10
+ * - Optimistic: the new order shows at once. `onReorder` may return a promise; when it rejects, the order goes back
11
+ * to the list the page passes and `onError` runs (without one, the live region says it could not save). Once a move
12
+ * settles, the page's own order wins as soon as it changes.
13
+ */
14
+ import { type DragEvent as ReactDragEvent, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react';
15
+ import { type Words } from '../../words';
16
+ /** The drag data type a reorder drag carries (the moved id). */
17
+ export declare const REORDER_DRAG_TYPE = "application/x-notis-reorder";
18
+ /** Every word a reorderable list says, in English and French. */
19
+ export declare const REORDER_WORDS: Readonly<{
20
+ hint: Words;
21
+ moved: Words;
22
+ failed: Words;
23
+ }>;
24
+ /** One move, as `onReorder` gets it. Indexes count the whole list, before (`from`) and after (`to`) the move. */
25
+ export interface ReorderChange<T> {
26
+ item: T;
27
+ id: string;
28
+ from: number;
29
+ to: number;
30
+ /** Every id in the new order. */
31
+ ids: string[];
32
+ }
33
+ export type ReorderOrientation = 'vertical' | 'horizontal' | 'both';
34
+ export interface UseReorderOptions<T> {
35
+ items: readonly T[];
36
+ getId: (item: T) => string;
37
+ /** Save the move. Return a promise to keep the new order until it settles; a rejection puts the old order back. */
38
+ onReorder: (change: ReorderChange<T>) => void | Promise<unknown>;
39
+ /** Only these items move (all by default). Any item is still a place to drop. */
40
+ canReorder?: (item: T) => boolean;
41
+ /** Which arrow keys move an item. Default 'vertical'. */
42
+ orientation?: ReorderOrientation;
43
+ /** Default true. False gives no reorder props, so the list renders as it would without the hook. */
44
+ enabled?: boolean;
45
+ /** Called after a rejected move put the old order back. Without it the live region says it could not save. */
46
+ onError?: (error: unknown) => void;
47
+ }
48
+ /** The props one item spreads (with its own handlers chained, see `chainReorderProps`). */
49
+ export interface ReorderItemProps {
50
+ draggable?: true;
51
+ 'aria-describedby'?: string;
52
+ /** Marks a reorderable item (the toolkit fades `[data-reorder][data-dragging]`). */
53
+ 'data-reorder'?: '';
54
+ 'data-drop'?: 'before' | 'after';
55
+ 'data-dragging'?: '';
56
+ ref?: (element: HTMLElement | null) => void;
57
+ onDragStart?: (event: ReactDragEvent<HTMLElement>) => void;
58
+ onDragOver?: (event: ReactDragEvent<HTMLElement>) => void;
59
+ onDragLeave?: (event: ReactDragEvent<HTMLElement>) => void;
60
+ onDrop?: (event: ReactDragEvent<HTMLElement>) => void;
61
+ onDragEnd?: (event: ReactDragEvent<HTMLElement>) => void;
62
+ onKeyDown?: (event: ReactKeyboardEvent<HTMLElement>) => void;
63
+ }
64
+ export interface Reorder<T> {
65
+ /** The items in the order to show (the optimistic one while a move saves). */
66
+ items: T[];
67
+ ids: string[];
68
+ /** Props for one item. `movable` overrides `canReorder` for it (false: a drop place only). */
69
+ getItemProps(id: string, options?: {
70
+ movable?: boolean;
71
+ }): ReorderItemProps;
72
+ /** The hint and the live region; render it once, anywhere inside the page. */
73
+ announcer: ReactNode;
74
+ /** Moves an item to an index of the whole list, as a drop or a key would. */
75
+ move(id: string, to: number): void;
76
+ /** A move is saving. */
77
+ pending: boolean;
78
+ }
79
+ /** The new index of an item dropped before or after another. */
80
+ export declare function dropIndex(from: number, over: number, side: 'before' | 'after'): number;
81
+ export declare function useReorder<T>(options: UseReorderOptions<T>): Reorder<T>;
82
+ /**
83
+ * Spreads reorder props over an item's own: both handlers run (the item's first), and both refs get the element.
84
+ * `own` holds the item's handlers for the same events (onDragStart, onKeyDown and so on).
85
+ */
86
+ export declare function chainReorderProps<P extends object>(own: P, reorder: ReorderItemProps): P & ReorderItemProps;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * `useSelection` (toolkit spec 2.4): the multi-select state of one list.
3
+ *
4
+ * The reducer mirrors the Portal Manager (`useCollectionInteractions`): an anchor where a range starts, and a base
5
+ * (the selection outside the range being extended) so Shift+J then Shift+K shrinks the range instead of keeping
6
+ * every row it ever passed. Pure and exported for tests.
7
+ */
8
+ export interface SelectionState {
9
+ selected: ReadonlySet<string>;
10
+ /** Where the next range starts. */
11
+ anchor: string | null;
12
+ /** The selection kept outside the range being extended; null when no range is in progress. */
13
+ base: ReadonlySet<string> | null;
14
+ }
15
+ export type SelectionAction = {
16
+ type: 'toggle';
17
+ id: string;
18
+ } | {
19
+ type: 'set';
20
+ ids: readonly string[];
21
+ } | {
22
+ type: 'clear';
23
+ } | {
24
+ type: 'selectAll';
25
+ ids: readonly string[];
26
+ }
27
+ /** A plain click: the clicked row becomes the anchor. */
28
+ | {
29
+ type: 'activate';
30
+ id: string;
31
+ }
32
+ /** The cursor moved without Shift: the next extension starts fresh from it. */
33
+ | {
34
+ type: 'navigate';
35
+ id: string;
36
+ }
37
+ /** Shift+J/K from `cursor` to `next`. */
38
+ | {
39
+ type: 'extendStep';
40
+ ids: readonly string[];
41
+ cursor: string | null;
42
+ next: string;
43
+ }
44
+ /** Shift+click on `id`. */
45
+ | {
46
+ type: 'range';
47
+ ids: readonly string[];
48
+ cursor: string | null;
49
+ id: string;
50
+ }
51
+ /** The list changed: drop ids that left it. */
52
+ | {
53
+ type: 'prune';
54
+ ids: readonly string[];
55
+ };
56
+ export declare const EMPTY_SELECTION: SelectionState;
57
+ /** The ids from `a` to `b` inclusive, in list order; just `b` when either is not in the list. */
58
+ export declare function rangeBetween(ids: readonly string[], a: string, b: string): string[];
59
+ export declare function selectionReducer(state: SelectionState, action: SelectionAction): SelectionState;
60
+ export interface UseSelectionOptions {
61
+ ids: readonly string[];
62
+ cursor: string | null;
63
+ /**
64
+ * Controlled selection: the ids selected now. With it the hook keeps only the anchor and the range base and
65
+ * reports every change through `onChange`; leave it out for the hook to own the selection.
66
+ */
67
+ selected?: readonly string[] | ReadonlySet<string>;
68
+ /** Every change of the selection, in list order where the list knows the ids. */
69
+ onChange?: (ids: string[]) => void;
70
+ }
71
+ export interface Selection {
72
+ selected: ReadonlySet<string>;
73
+ isSelected(id: string): boolean;
74
+ toggle(id: string): void;
75
+ /** Shift+click: select from the anchor (else the cursor) to `id`. */
76
+ extendTo(id: string): void;
77
+ selectAll(): void;
78
+ clear(): void;
79
+ count: number;
80
+ /** Replace the selection. */
81
+ set(ids: readonly string[]): void;
82
+ /** Shift+J/K: grow or shrink the range from the anchor to `next`. */
83
+ extendStep(next: string): void;
84
+ /** A cursor move without Shift (J/K): the next range starts from `id`. */
85
+ navigate(id: string): void;
86
+ /** A plain click on `id`: it becomes the anchor. */
87
+ activate(id: string): void;
88
+ anchor: string | null;
89
+ }
90
+ export declare function useSelection({ ids, cursor, selected: controlledSelected, onChange }: UseSelectionOptions): Selection;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * OpenAsMenu (toolkit spec 2.9, round decision alt a): the Notion-style button at the reader's top left. Its menu
3
+ * offers Side peek, Center peek and Full page with a check on the current mode. Hidden when only one mode is allowed.
4
+ */
5
+ import { type Words } from '../../words';
6
+ import type { OpenMode } from './openModeStore';
7
+ export declare const OPEN_MODE_WORDS: Readonly<Record<OpenMode, Words>>;
8
+ export declare const OPEN_MODE_ICONS: Readonly<Record<OpenMode, string>>;
9
+ export interface OpenAsMenuProps {
10
+ allowed?: OpenMode | readonly OpenMode[];
11
+ mode: OpenMode;
12
+ onChange(mode: OpenMode): void;
13
+ className?: string;
14
+ }
15
+ export declare function OpenAsMenu({ allowed, mode, onChange, className }: OpenAsMenuProps): import("react").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ export { OPEN_MODES, OPEN_MODE_CACHE_PREFIX, OpenModeStoreProvider, getOpenModeStore, isOpenMode, localStorageOpenModeStore, readOpenModeCache, setOpenModeStore, useOpenModeStore, userSettingsOpenModeStore, writeOpenModeCache, } from './openModeStore';
2
+ export type { OpenMode, OpenModeStore } from './openModeStore';
3
+ export { normalizeAllowed, useOpenMode, useOpenModeKey } from './useOpenMode';
4
+ export type { UseOpenModeOptions } from './useOpenMode';
5
+ export { OPEN_MODE_ICONS, OPEN_MODE_WORDS, OpenAsMenu } from './OpenAsMenu';
6
+ export type { OpenAsMenuProps } from './OpenAsMenu';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Where the chosen open mode lives (toolkit spec 2.9). The mode belongs in Notis user settings, keyed by Space and
3
+ * list. No user-settings call reaches Space code yet, so this is an adapter: a host (or a test) installs a store with
4
+ * `setOpenModeStore` or `<OpenModeStoreProvider>`, and the default keeps the choice in this browser's localStorage.
5
+ * localStorage also stays a cache in front of any remote store, so the mode shows at once on the next visit.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ export type OpenMode = 'side' | 'center' | 'full';
9
+ export declare const OPEN_MODES: readonly OpenMode[];
10
+ export declare function isOpenMode(value: unknown): value is OpenMode;
11
+ /** A user-settings backend for open modes. `read` may be async (a settings call); `write` is fire and forget. */
12
+ export interface OpenModeStore {
13
+ read(key: string): OpenMode | null | Promise<OpenMode | null>;
14
+ write(key: string, mode: OpenMode): void | Promise<void>;
15
+ /** Changes made elsewhere (another tab, another device through settings). Returns an unsubscribe. */
16
+ subscribe?(key: string, onChange: (mode: OpenMode | null) => void): () => void;
17
+ }
18
+ export declare const OPEN_MODE_CACHE_PREFIX = "notis:open-mode:";
19
+ /** The localStorage cache: read synchronously before the store answers. */
20
+ export declare function readOpenModeCache(key: string): OpenMode | null;
21
+ export declare function writeOpenModeCache(key: string, mode: OpenMode): void;
22
+ /** The default store: this browser only, until a Notis user-settings adapter is installed. */
23
+ export declare const localStorageOpenModeStore: OpenModeStore;
24
+ /**
25
+ * A store over a generic user-settings API (get and set by key), for a host that has one. Values are kept under
26
+ * `openMode:<key>`.
27
+ */
28
+ export declare function userSettingsOpenModeStore(settings: {
29
+ get(key: string): unknown | Promise<unknown>;
30
+ set(key: string, value: unknown): void | Promise<void>;
31
+ }): OpenModeStore;
32
+ /** Installs the store every `useOpenMode` uses outside an `OpenModeStoreProvider`. Returns the previous one. */
33
+ export declare function setOpenModeStore(store: OpenModeStore | null): OpenModeStore;
34
+ export declare function getOpenModeStore(): OpenModeStore;
35
+ export declare function OpenModeStoreProvider({ store, children }: {
36
+ store: OpenModeStore;
37
+ children?: ReactNode;
38
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<OpenModeStore | null>>;
39
+ export declare function useOpenModeStore(): OpenModeStore;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `useOpenMode` (toolkit spec 2.9): the open mode of one list (side, center or full), persisted per Space and list.
3
+ * The cached mode shows at once; the store's answer (user settings) replaces it when it differs.
4
+ */
5
+ import { type OpenMode } from './openModeStore';
6
+ export interface UseOpenModeOptions {
7
+ /** The modes this list offers; the first is the default. Default all three, side first. */
8
+ allowed?: OpenMode | readonly OpenMode[];
9
+ /** Default `${spaceId}:${listId}` (list id 'list'). Leave out with no Space and nothing persists. */
10
+ storageKey?: string;
11
+ /** The list id inside the Space, for the default storage key. Default 'list'. */
12
+ listId?: string;
13
+ }
14
+ export declare function normalizeAllowed(allowed: OpenMode | readonly OpenMode[] | undefined): OpenMode[];
15
+ /** The storage key: given, else `${spaceId}:${listId}`, else null (nothing persists). */
16
+ export declare function useOpenModeKey(storageKey: string | undefined, listId?: string): string | null;
17
+ export declare function useOpenMode(options?: UseOpenModeOptions): [OpenMode, (mode: OpenMode) => void];