@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,88 @@
1
+ /**
2
+ * Menu (toolkit spec 2.8): a trigger and a list of items that opens in the layer root, so inside a Space it renders
3
+ * in the Space shadow root and picks up the adopted toolkit sheet.
4
+ *
5
+ * Keys while open: arrows, Home, End, Enter and Space move and choose; Right opens a submenu, Left closes it; an
6
+ * item's `keys` choose it; a letter jumps to the next item starting with it. Escape closes through the engine's
7
+ * escape chain (overlay layer). Focus sits in the menu, so the engine's typing rule keeps page keys silent.
8
+ *
9
+ * Keys while closed: an item's `keys` still choose it while the trigger shows (menu accelerators, registered with the
10
+ * engine and hidden from the help sheet). See `MenuProps.accelerators`.
11
+ */
12
+ import React, { type MouseEvent as ReactMouseEvent, type ReactElement, type ReactNode } from 'react';
13
+ import { type KeySpec, type Words } from '../../words';
14
+ import type { Align, Side } from './position';
15
+ export interface MenuProps {
16
+ /**
17
+ * The element that opens the menu (usually a button). Its own props and ref are kept. Leave it out and pass
18
+ * `anchor` with a controlled `open` to open the menu at an element the caller already draws.
19
+ */
20
+ trigger?: ReactElement;
21
+ /**
22
+ * Without a trigger: the element the menu opens at (and gives focus back to). The menu then focuses its first
23
+ * item when it opens, as after a keyboard open.
24
+ */
25
+ anchor?: HTMLElement | null | React.RefObject<HTMLElement | null>;
26
+ children: ReactNode;
27
+ align?: Align;
28
+ side?: Side;
29
+ /** Accessible name of the menu. */
30
+ label?: Words | string;
31
+ open?: boolean;
32
+ onOpenChange?: (open: boolean) => void;
33
+ className?: string;
34
+ /**
35
+ * Default true: while the menu is closed and its trigger (or anchor) shows and is enabled, an item's `keys` choose
36
+ * it, and its `onSelect` runs without an event. On the page they answer at route scope; inside a dialog at modal
37
+ * scope, while focus is in that dialog and no other menu is open. They come last: any other shortcut on the same
38
+ * key goes first, and so does a key sequence that starts with it. They are not listed in the help sheet: the menu
39
+ * shows them. Left out: sequence keys ('g i'), keys Notis keeps for itself in a Space, items of a disabled
40
+ * submenu and items your own component draws (only `Menu.Item` written in the menu's children, fragments and
41
+ * `Menu.Sub` included, is read). Pass false for a menu drawn once per row or card, or one whose keys a list or
42
+ * selection bar already handles.
43
+ */
44
+ accelerators?: boolean;
45
+ }
46
+ export interface MenuController {
47
+ close(): void;
48
+ isOpen: boolean;
49
+ }
50
+ /** Inside a menu: close it from a custom item. */
51
+ export declare function useMenu(): MenuController;
52
+ declare function MenuRoot({ trigger, anchor, children, align, side, label, open: controlledOpen, onOpenChange, className, accelerators }: MenuProps): React.JSX.Element;
53
+ export interface MenuItemProps {
54
+ children: ReactNode;
55
+ icon?: ReactNode | string;
56
+ /**
57
+ * Shown as a discreet keycap; chooses the item while the menu is open, and while it is closed and its trigger
58
+ * shows (see `MenuProps.accelerators`).
59
+ */
60
+ keys?: KeySpec | KeySpec[];
61
+ tone?: 'default' | 'danger';
62
+ /** The click, or no event when the item's key chose it while the menu was closed. */
63
+ onSelect?: (event?: ReactMouseEvent<HTMLButtonElement>) => void;
64
+ /** A check item: shows a check when true. */
65
+ checked?: boolean;
66
+ disabled?: boolean;
67
+ /** Default true. */
68
+ closeOnSelect?: boolean;
69
+ className?: string;
70
+ }
71
+ declare function MenuItem({ children, icon, keys, tone, onSelect, checked, disabled, closeOnSelect, className }: MenuItemProps): React.JSX.Element;
72
+ declare function MenuSeparator(): React.JSX.Element;
73
+ export interface MenuSubProps {
74
+ label: ReactNode;
75
+ icon?: ReactNode | string;
76
+ disabled?: boolean;
77
+ children: ReactNode;
78
+ /** Accessible name of the submenu; default its label when the label is text. */
79
+ menuLabel?: Words | string;
80
+ }
81
+ declare function MenuSub({ label, icon, disabled, children, menuLabel }: MenuSubProps): React.JSX.Element | null;
82
+ type MenuComponent = typeof MenuRoot & {
83
+ Item: typeof MenuItem;
84
+ Separator: typeof MenuSeparator;
85
+ Sub: typeof MenuSub;
86
+ };
87
+ export declare const Menu: MenuComponent;
88
+ export { MenuItem, MenuSeparator, MenuSub };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Popover (toolkit spec 2.8): a trigger and a floating panel in the layer root (inside the Space shadow root).
3
+ * Closes on a press outside and on Escape (the engine's escape chain). `modal` traps Tab and isolates page keys
4
+ * to the modal scope (aria-modal); a non-modal popover leaves page keys alone.
5
+ */
6
+ import React, { type ReactElement, type ReactNode } from 'react';
7
+ import type { Words } from '../../words';
8
+ import type { Align, Side } from './position';
9
+ export interface PopoverController {
10
+ close(): void;
11
+ }
12
+ export interface PopoverProps {
13
+ trigger: ReactElement;
14
+ /** The panel content, or a function that receives `close`. */
15
+ content: ReactNode | ((controller: PopoverController) => ReactNode);
16
+ side?: Side;
17
+ align?: Align;
18
+ /** Traps Tab and isolates page keys while open. Default false. */
19
+ modal?: boolean;
20
+ open?: boolean;
21
+ onOpenChange?: (open: boolean) => void;
22
+ /** Accessible name of the panel. */
23
+ label?: Words | string;
24
+ className?: string;
25
+ /** Focus the first focusable element on open (default true); else the panel itself. */
26
+ autoFocus?: boolean;
27
+ }
28
+ export declare function Popover({ trigger, content, side, align, modal, open: controlledOpen, onOpenChange, label, className, autoFocus }: PopoverProps): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Tooltip (toolkit spec 2.8): a label and an optional shortcut on a black pill, the Manager's tooltip. Shows after
3
+ * 500ms of hover or at once on keyboard focus; hides on leave, blur, a press or any key. Never takes focus.
4
+ */
5
+ import React, { type ReactElement } from 'react';
6
+ import type { KeySpec, Words } from '../../words';
7
+ import type { Align, Side } from './position';
8
+ export interface TooltipProps {
9
+ label: Words | string;
10
+ keys?: KeySpec | KeySpec[];
11
+ side?: Side;
12
+ align?: Align;
13
+ /** Hover delay in ms. Default 500. */
14
+ delay?: number;
15
+ /** One focusable element. */
16
+ children: ReactElement;
17
+ disabled?: boolean;
18
+ }
19
+ export declare function Tooltip({ label, keys, side, align, delay, children, disabled }: TooltipProps): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ export { Menu, MenuItem, MenuSeparator, MenuSub, useMenu } from './Menu';
2
+ export type { MenuController, MenuItemProps, MenuProps, MenuSubProps } from './Menu';
3
+ export { Popover } from './Popover';
4
+ export type { PopoverController, PopoverProps } from './Popover';
5
+ export { Tooltip } from './Tooltip';
6
+ export type { TooltipProps } from './Tooltip';
7
+ export { LAYER_ROOT_ATTRIBUTE, LayerRootProvider, findLayerRoot, useLayerRoot } from './layerRoot';
8
+ export { place } from './position';
9
+ export type { Align, Side } from './position';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Where overlays (Menu, Popover, Tooltip) render (toolkit spec 1.4.8): the nearest element with the layer-root
3
+ * attribute inside the current shadow root, so they open inside the Space and pick up its adopted toolkit sheet and
4
+ * theme; in the Portal document, the page body.
5
+ *
6
+ * A shadow root without a host layer root gets one, created inside the app root (which carries the theme and the
7
+ * Portal token snapshot) or, without it, at the end of the shadow root.
8
+ */
9
+ import React, { type ReactNode } from 'react';
10
+ export declare const LAYER_ROOT_ATTRIBUTE = "data-notis-layer-root";
11
+ /** Pins the layer root for a subtree (a host that renders its own overlay container). */
12
+ export declare function LayerRootProvider({ root, children }: {
13
+ root: HTMLElement | null;
14
+ children?: ReactNode;
15
+ }): React.JSX.Element;
16
+ /** The layer root for overlays opened from `from` (usually the trigger element). */
17
+ export declare function findLayerRoot(from: Node | null | undefined): HTMLElement | null;
18
+ /**
19
+ * The layer root: the pinned one from LayerRootProvider, else found from `anchor` (an element inside the view),
20
+ * else the page body.
21
+ */
22
+ export declare function useLayerRoot(anchor?: Element | null): HTMLElement | null;
23
+ /** The pinned layer root only (overlays fall back to findLayerRoot from their trigger). */
24
+ export declare function usePinnedLayerRoot(): HTMLElement | null;
@@ -0,0 +1,31 @@
1
+ /** Placement of a floating panel next to its anchor (pure). Flips to the other side when it does not fit. */
2
+ export type Side = 'bottom' | 'top' | 'right' | 'left';
3
+ export type Align = 'start' | 'center' | 'end';
4
+ export interface RectLike {
5
+ top: number;
6
+ left: number;
7
+ right: number;
8
+ bottom: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+ export interface PlaceOptions {
13
+ side?: Side;
14
+ align?: Align;
15
+ offset?: number;
16
+ /** Keeps this far from the viewport edges. */
17
+ margin?: number;
18
+ viewport: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ }
23
+ export interface Placement {
24
+ top: number;
25
+ left: number;
26
+ side: Side;
27
+ }
28
+ export declare function place(anchor: RectLike, size: {
29
+ width: number;
30
+ height: number;
31
+ }, options: PlaceOptions): Placement;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * PeriodPicker (toolkit spec 2.11, deck round 6 "period picker, like Stripe"): two triggers. The first picks a preset
3
+ * (Today ... This year) or a custom range on the DayPicker with Apply and Cancel; the second picks what to compare it
4
+ * with. Pair it with `usePeriod` so the period lives in the URL.
5
+ *
6
+ * Inside a menu the arrows move between options and days and Escape closes it (the engine's escape chain). The picker
7
+ * registers no page keys.
8
+ */
9
+ import * as React from 'react';
10
+ import { type Locale } from '../../words/types';
11
+ import { type Period, type PresetId } from './periods';
12
+ export interface PeriodPickerProps {
13
+ value: Period;
14
+ onChange: (period: Period) => void;
15
+ /** Shows the "Compare to" trigger. Default true. */
16
+ compare?: boolean;
17
+ /**
18
+ * Presets offered, in order. Default every preset. `custom` adds the custom range: its entry and the calendar to
19
+ * pick days in. Leave it out for presets only (no calendar).
20
+ */
21
+ presets?: readonly PresetId[];
22
+ locale?: Locale;
23
+ className?: string;
24
+ }
25
+ /** Below this width the range menu stacks the presets over one month (deck `data-one`). */
26
+ export declare const PERIOD_PICKER_TWO_MONTHS_MIN = 700;
27
+ export declare function PeriodPicker({ value, onChange, compare, presets, locale: localeProp, className }: PeriodPickerProps): React.JSX.Element;
28
+ export declare namespace PeriodPicker {
29
+ var displayName: string;
30
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Locale-aware dates and numbers for the period, calendar, timeline and chart pieces. Pure: Intl only.
3
+ * `en` formats as en-US (the Portal's English), `fr` as fr-FR.
4
+ */
5
+ import { type Locale } from '../../words/types';
6
+ import type { DateRange } from './periods';
7
+ /** The `Intl` locale tag for a toolkit locale (fr-FR or en-US), for Space code that formats with `Intl` itself. */
8
+ export declare function intlLocale(locale: Locale): string;
9
+ /** A cached `Intl.DateTimeFormat` for a toolkit locale and options. */
10
+ export declare function dateFormat(locale: Locale, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
11
+ /** The text with its first letter upper case ("lundi" reads "Lundi"). */
12
+ export declare function upFirst(text: string): string;
13
+ /**
14
+ * A date range in words, never a dash: "May 17 to Jun 15, 2026" / "17 mai au 15 juin 2026". A month or year both days
15
+ * share shows once ("Oct 1 to 15, 2026" / "1er au 15 oct. 2026"). One day reads as that day.
16
+ */
17
+ export declare function formatDateRange(range: DateRange, locale: Locale, options?: Intl.DateTimeFormatOptions): string;
18
+ /** One day, long: "Monday, January 5, 2026" / "Lundi 5 janvier 2026". */
19
+ export declare function formatLongDay(date: Date, locale: Locale): string;
20
+ /**
21
+ * A day heading (the agenda, meeting days): "Monday, October 19" / "Lundi 19 octobre", with the year when it is not
22
+ * `thisYear` ("Friday, January 1, 2027").
23
+ */
24
+ export declare function formatDayHeading(date: Date, locale: Locale, thisYear?: number): string;
25
+ /** One day, short: "Jan 5" / "5 janv.". */
26
+ export declare function formatShortDay(date: Date, locale: Locale): string;
27
+ /** "January 2026" / "Janvier 2026". */
28
+ export declare function formatMonthYear(date: Date, locale: Locale): string;
29
+ /** Seven weekday names starting Monday. `narrow` for the day picker, `short` for grids. */
30
+ export declare function weekdayNames(locale: Locale, width?: 'narrow' | 'short' | 'long'): string[];
31
+ /** The number in a month cell: the first of a month carries the month name ("Feb 1" / "1er févr."). */
32
+ export declare function dayNumberLabel(date: Date, locale: Locale, short?: boolean): string;
33
+ /** A number in the locale ("1,020" / "1 020"). */
34
+ export declare function formatNumber(value: number, locale: Locale, options?: Intl.NumberFormatOptions): string;
35
+ /** A plain value: one decimal under 10 when it has one, whole numbers above. */
36
+ export declare function formatValue(value: number, locale: Locale): string;
37
+ export type DeltaTone = 'good' | 'destructive';
38
+ export interface Delta {
39
+ /** "+12%" / "−3,4 %". */
40
+ text: string;
41
+ tone: DeltaTone;
42
+ up: boolean;
43
+ /** The change in percent, signed. */
44
+ percent: number;
45
+ }
46
+ /**
47
+ * The change from `previous` to `current`. Null when there is nothing to compare with (no previous value or zero).
48
+ * `higherIsBetter: false` turns a rise red (costs, errors).
49
+ */
50
+ export declare function formatDelta(current: number, previous: number | null | undefined, locale: Locale, higherIsBetter?: boolean): Delta | null;
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Words of the period picker, calendar, timeline and charts (toolkit spec 2.11), EN and FR.
3
+ * French uses tu, as everywhere in Notis. Pure: no React.
4
+ */
5
+ import { type Words } from '../../words/types';
6
+ import type { CompareId, PresetId } from './periods';
7
+ export declare const PRESET_WORDS: Readonly<Record<PresetId, Words>>;
8
+ export declare const COMPARE_WORDS: Readonly<Record<CompareId, Words>>;
9
+ /** "vs ..." after a delta. The stat row drops the leading "vs " under the previous value. */
10
+ export declare const VS_WORDS: Readonly<Record<'prev' | 'year', Words>>;
11
+ export declare const PERIOD_WORDS: Readonly<{
12
+ range: Words;
13
+ compare: Words;
14
+ apply: Words;
15
+ cancel: Words;
16
+ pickStart: Words;
17
+ pickEnd: Words;
18
+ prevMonth: Words;
19
+ nextMonth: Words;
20
+ thisPeriod: Words;
21
+ value: Words;
22
+ previous: Words;
23
+ }>;
24
+ export declare const CHART_WORDS: Readonly<{
25
+ tip: Words;
26
+ tipCompare: Words;
27
+ label: Words;
28
+ date: Words;
29
+ metric: Words;
30
+ trend: Words;
31
+ change: Words;
32
+ stats: Words;
33
+ noValue: Words;
34
+ }>;
35
+ export declare const CALENDAR_WORDS: Readonly<{
36
+ month: Words;
37
+ week: Words;
38
+ agenda: Words;
39
+ view: Words;
40
+ items: Words;
41
+ today: Words;
42
+ tomorrow: Words;
43
+ yesterday: Words;
44
+ prevMonth: Words;
45
+ nextMonth: Words;
46
+ prevWeek: Words;
47
+ nextWeek: Words;
48
+ prevAgenda: Words;
49
+ nextAgenda: Words;
50
+ agendaEmpty: Words;
51
+ agendaToday: Words;
52
+ more: Words;
53
+ less: Words;
54
+ /** The "+N" link of a narrow month cell, where the full words do not fit. */
55
+ moreShort: Words;
56
+ /** "Show less" in a narrow month cell. */
57
+ lessShort: Words;
58
+ noDate: Words;
59
+ trayShow: Words;
60
+ trayHide: Words;
61
+ keyToday: Words;
62
+ keyPrev: Words;
63
+ keyNext: Words;
64
+ keyNextItem: Words;
65
+ keyPrevItem: Words;
66
+ keyNextDay: Words;
67
+ keyPrevDay: Words;
68
+ keyOpen: Words;
69
+ }>;
70
+ export declare const TIMELINE_WORDS: Readonly<{
71
+ zoom: Words;
72
+ week: Words;
73
+ month: Words;
74
+ quarter: Words;
75
+ today: Words;
76
+ items: Words;
77
+ empty: Words;
78
+ earlier: Words;
79
+ later: Words;
80
+ bar: Words;
81
+ barPlain: Words;
82
+ keyToday: Words;
83
+ keyPrev: Words;
84
+ keyNext: Words;
85
+ keyNextItem: Words;
86
+ keyPrevItem: Words;
87
+ keyOpen: Words;
88
+ }>;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Periods for dashboards (toolkit spec 2.11). Pure: date-fns only, no React, no DOM.
3
+ *
4
+ * A period is a preset (or a custom day range) plus a comparison. Ranges are whole local days: `from` is the start of
5
+ * its first day and `to` the end of its last day, both inclusive. Custom days are ISO dates (`2026-01-31`).
6
+ *
7
+ * URL value (one text param, `period` by default):
8
+ * `last30` preset, default comparison
9
+ * `last30~year` preset with a comparison
10
+ * `2026-01-01..2026-01-31~none` custom range
11
+ * The comparison is left out when it equals the default, so links stay short.
12
+ */
13
+ export type PresetId = 'today' | 'yesterday' | 'last7' | 'last30' | 'last90' | 'thisMonth' | 'lastMonth' | 'thisQuarter' | 'thisYear' | 'custom';
14
+ export type CompareId = 'prev' | 'year' | 'none';
15
+ export interface Period {
16
+ preset: PresetId;
17
+ compare: CompareId;
18
+ /** ISO day, custom ranges only. */
19
+ from?: string;
20
+ /** ISO day, custom ranges only. */
21
+ to?: string;
22
+ }
23
+ export interface DateRange {
24
+ from: Date;
25
+ to: Date;
26
+ }
27
+ export declare const PRESETS: readonly PresetId[];
28
+ export declare const COMPARES: readonly CompareId[];
29
+ export declare const DEFAULT_PRESET: PresetId;
30
+ export declare const DEFAULT_COMPARE: CompareId;
31
+ export declare function isPresetId(value: unknown): value is PresetId;
32
+ export declare function isCompareId(value: unknown): value is CompareId;
33
+ /** `2026-01-31` for a local date. */
34
+ export declare function toIsoDay(date: Date): string;
35
+ /** A local date at the start of an ISO day, or null when the text is not a real day. */
36
+ export declare function fromIsoDay(value: string | undefined | null): Date | null;
37
+ /** Number of calendar days in a range, both ends included. */
38
+ export declare function dayCount(range: DateRange): number;
39
+ /**
40
+ * The days a preset covers, as of `now`.
41
+ * A custom range must end today or earlier with its first day first; anything else falls back to the last 30 days.
42
+ */
43
+ export declare function presetRange(preset: PresetId, now?: Date, custom?: {
44
+ from?: string;
45
+ to?: string;
46
+ }): DateRange;
47
+ /**
48
+ * The range a period is compared with.
49
+ * - prev: the same number of days just before (`[from - n, from - 1]`).
50
+ * - year: the same calendar days one year back (29 February lands on 28 February).
51
+ * - none: no comparison.
52
+ */
53
+ export declare function compareRange(range: DateRange, compare: CompareId): DateRange | null;
54
+ /** The range and comparison range of a period. */
55
+ export declare function periodRanges(period: Period, now?: Date): {
56
+ range: DateRange;
57
+ compareRange: DateRange | null;
58
+ };
59
+ /** A period whose custom days are dropped unless the preset is custom. */
60
+ export declare function normalizePeriod(period: Period): Period;
61
+ /** A custom period for two days, in any order. */
62
+ export declare function customPeriod(a: Date, b: Date, compare: CompareId): Period;
63
+ /** The URL value of a period. The comparison is left out when it equals `defaultCompare`. */
64
+ export declare function formatPeriodParam(period: Period, defaultCompare?: CompareId): string;
65
+ /** Reads a URL value; anything unreadable gives the defaults. */
66
+ export declare function parsePeriodParam(value: string | null | undefined, defaults?: {
67
+ preset?: PresetId;
68
+ compare?: CompareId;
69
+ }): Period;
70
+ export declare function samePeriod(a: Period, b: Period): boolean;
@@ -0,0 +1,23 @@
1
+ import { type CompareId, type DateRange, type Period, type PresetId } from './periods';
2
+ export interface UsePeriodOptions {
3
+ /** URL parameter holding the period. A Space declares it as a text param. Default `period`. */
4
+ param?: string;
5
+ /** Preset when the URL has none. Default `last30`. */
6
+ default?: PresetId;
7
+ /** Comparison when the URL has none. Default `prev`. */
8
+ compare?: CompareId;
9
+ }
10
+ export interface UsePeriodResult {
11
+ period: Period;
12
+ range: DateRange;
13
+ compareRange: DateRange | null;
14
+ set(period: Period): void;
15
+ }
16
+ /**
17
+ * The period of a dashboard, kept in the URL so links keep it (toolkit spec 2.11).
18
+ *
19
+ * In a Space the value lives in the Space's view params (declare `period` as a text param, or the host drops it) and
20
+ * changes go through `useViewParams().setParams`, replacing the history entry. On a Notis page outside a Space it lives in the page's query string.
21
+ * Ranges are computed for today and recomputed when the period changes.
22
+ */
23
+ export declare function usePeriod(options?: UsePeriodOptions): UsePeriodResult;
@@ -0,0 +1,3 @@
1
+ export * from './presentWords';
2
+ export * from './screens';
3
+ export * from './useAudienceScreen';
@@ -0,0 +1,27 @@
1
+ /** EN/FR words of the second-screen presenter: the audience window and what the presenter is told. */
2
+ export declare const PRESENT_WORDS: Readonly<{
3
+ audienceTitle: {
4
+ en: string;
5
+ fr: string;
6
+ };
7
+ fillScreen: {
8
+ en: string;
9
+ fr: string;
10
+ };
11
+ dragToScreen: {
12
+ en: string;
13
+ fr: string;
14
+ };
15
+ pressAgain: {
16
+ en: string;
17
+ fr: string;
18
+ };
19
+ blocked: {
20
+ en: string;
21
+ fr: string;
22
+ };
23
+ onOtherScreen: {
24
+ en: string;
25
+ fr: string;
26
+ };
27
+ }>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Pure helpers of the second-screen presenter: is a second screen there, which one shows the audience, where its
3
+ * window opens, which key does what and how the page's styles reach the audience window.
4
+ */
5
+ import type { NotisHtmlFramePresentAction } from '../../runtime';
6
+ export type PresentAction = NotisHtmlFramePresentAction;
7
+ /** The window name of the audience window. Electron recognises it and fills the other display. */
8
+ export declare const AUDIENCE_WINDOW_NAME = "notis-presenter-audience";
9
+ /** The part of a ScreenDetailed (Window Management API) the presenter reads. */
10
+ export type ScreenArea = {
11
+ availLeft: number;
12
+ availTop: number;
13
+ availWidth: number;
14
+ availHeight: number;
15
+ isInternal?: boolean;
16
+ isPrimary?: boolean;
17
+ label?: string;
18
+ };
19
+ /** True when the desktop spans more than one screen. Chrome and Electron tell without asking; others say no. */
20
+ export declare function hasSecondScreen(win: Window | undefined): boolean;
21
+ /** The screen for the audience: never the current one, an external screen first, then the largest. */
22
+ export declare function pickAudienceScreen(screens: readonly ScreenArea[], current: ScreenArea | null | undefined): ScreenArea | null;
23
+ /** `window.open` features placing the audience window over the whole of a screen, or a plain window without one. */
24
+ export declare function audienceFeatures(screen: ScreenArea | null): string;
25
+ /** The action of a key press in the audience window, or null when the key is not one or belongs to a field. */
26
+ export declare function keyAction(event: Pick<KeyboardEvent, 'key' | 'altKey' | 'ctrlKey' | 'metaKey' | 'defaultPrevented' | 'target'>): PresentAction | null;
27
+ /** True when a click lands on something of its own (a field, a button, a link) rather than on the slide. */
28
+ export declare function clickHasOwnTarget(target: EventTarget | null): boolean;
29
+ /** True when the audience window covers its whole screen, in full screen or as a borderless full-size window. */
30
+ export declare function fillsScreen(win: Window): boolean;
31
+ /**
32
+ * Copy the page's styles into the audience window: the document's links, style elements and constructed sheets, then
33
+ * those of the Space's shadow root (its bundle and the toolkit). Constructed sheets cannot move between documents, so
34
+ * they are copied as text. The `<html>` class and style (light or dark) come along.
35
+ */
36
+ export declare function copyStylesInto(target: Document, source: Document, shadowRoot?: ShadowRoot | null): void;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The second-screen presenter, like PowerPoint: with two screens, the audience sees the presentation full screen on
3
+ * the other one while this window stays the presenter's (notes, previews, timer). The Space renders the audience view
4
+ * with `portal(...)`, in its own React tree, so both windows show the same state and stay in sync.
5
+ *
6
+ * The browser asks once to place windows on screens (Window Management API); Electron never asks and fills the other
7
+ * display itself. One screen, or a browser without the API: `open` answers 'one-screen' and the Space presents as
8
+ * before.
9
+ */
10
+ import { type ReactNode, type ReactPortal } from 'react';
11
+ import type { Words } from '../../words';
12
+ import { type PresentAction } from './screens';
13
+ /**
14
+ * 'opened': the audience window is up. 'one-screen': present in this window. 'press-again': the browser just asked
15
+ * for permission and used up the press, so the window could not open; the same press works now. 'blocked': the
16
+ * browser blocked the window.
17
+ */
18
+ export type AudienceOpenResult = 'opened' | 'one-screen' | 'press-again' | 'blocked';
19
+ export type UseAudienceScreenOptions = {
20
+ /** A key, click or right click in the audience window. Escape is 'stop'. */
21
+ onAction: (action: PresentAction) => void;
22
+ /** The audience window closed (by the person, by Escape in the Space, or by `close`). */
23
+ onClose?: () => void;
24
+ /** The audience window's title. Default: "Presentation". */
25
+ title?: Words | string;
26
+ };
27
+ export type UseAudienceScreenResult = {
28
+ /** True when a second screen is connected (updates when one is plugged in or out). */
29
+ secondScreen: boolean;
30
+ isOpen: boolean;
31
+ /** Open the audience window on the other screen. Call from the press itself; `anchor` is an element of the Space. */
32
+ open: (anchor?: Element | null) => Promise<AudienceOpenResult>;
33
+ close: () => void;
34
+ /** Render the audience view into the audience window; null while it is closed. */
35
+ portal: (node: ReactNode) => ReactPortal | null;
36
+ };
37
+ /** The second-screen presenter. See the module comment. */
38
+ export declare function useAudienceScreen(options: UseAudienceScreenOptions): UseAudienceScreenResult;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * One toolkit stylesheet for the document and every Space shadow root (toolkit spec 1.4.7).
3
+ *
4
+ * The host registers the text of `@notis/sdk/toolkit.css` once (`registerToolkitStyles`), and `adoptToolkitStyles(root)`
5
+ * appends the same CSSStyleSheet to `adoptedStyleSheets` of each root. Nothing is adopted before the host registers:
6
+ * the SDK never looks for the sheet among the page's own stylesheets, because a host that bundles its CSS would hand
7
+ * over its whole merged stylesheet instead of the toolkit.
8
+ */
9
+ /** Registers the toolkit stylesheet: its CSS text, or an already built sheet. Later roots adopt this one. */
10
+ export declare function registerToolkitStyles(source: string | CSSStyleSheet): void;
11
+ /** The registered toolkit CSS text; null until the host registers it. */
12
+ export declare function getToolkitStyleText(): string | null;
13
+ /** The shared sheet; null without constructable stylesheets or until the host registers the CSS. */
14
+ export declare function getToolkitStyleSheet(): CSSStyleSheet | null;
15
+ /**
16
+ * Adds the registered toolkit sheet to a document or shadow root, once. Without constructable stylesheets the root
17
+ * gets one `<style>` element instead. Returns false, and adds nothing, while the host has not registered the CSS.
18
+ */
19
+ export declare function adoptToolkitStyles(root: Document | ShadowRoot): boolean;
20
+ /** Test hook: forget the registered sheet. */
21
+ export declare function resetToolkitStylesForTests(): void;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * TimelineView (toolkit spec 2.11, deck round 5 "timeline"): bars across days, one lane per group, zoomed by week,
3
+ * month or quarter. The roadmap scrolls sideways; lane labels and the date axis stay put.
4
+ *
5
+ * Keys (spec 3, settled in 6): `[` and `]` move the window earlier or later, T comes back to today and puts the
6
+ * cursor on the bar running today, J/K and the up and down arrows walk the bars lane by lane, Enter opens.
7
+ */
8
+ import * as React from 'react';
9
+ import { type Locale, type Words } from '../../words/types';
10
+ import type { DateInput } from '../calendar/calendarMath';
11
+ import { type TimelineLaneInfo, type TimelineZoom } from './timelineMath';
12
+ export interface TimelineViewProps<T> {
13
+ items: readonly T[];
14
+ getStart: (item: T) => DateInput;
15
+ getEnd: (item: T) => DateInput;
16
+ /** The lane an item sits in. */
17
+ lane: (item: T) => TimelineLaneInfo;
18
+ /** Lane order (and lanes that show even when empty). */
19
+ lanes?: readonly TimelineLaneInfo[];
20
+ /** Default `item.id`. */
21
+ getId?: (item: T) => string;
22
+ /** Default `item.title` (or `item.name`). */
23
+ getTitle?: (item: T) => string;
24
+ /** Status words for the bar's accessible name. */
25
+ getStatus?: (item: T) => string;
26
+ /** Colour group of a bar: `todo`, `active`, `waiting` or `done` (deck status groups). */
27
+ getGroup?: (item: T) => string | undefined;
28
+ /** Draws the inside of a bar; default its title. */
29
+ bar?: (item: T) => React.ReactNode;
30
+ zoom?: TimelineZoom;
31
+ defaultZoom?: TimelineZoom;
32
+ onZoomChange?: (zoom: TimelineZoom) => void;
33
+ onOpen?: (item: T) => void;
34
+ openId?: string | null;
35
+ label?: Words | string;
36
+ locale?: Locale;
37
+ className?: string;
38
+ /** Today, for tests and previews. */
39
+ today?: Date;
40
+ }
41
+ export declare function TimelineView<T>(props: TimelineViewProps<T>): React.JSX.Element;
42
+ export declare namespace TimelineView {
43
+ var displayName: string;
44
+ }