@notis_ai/cli 0.2.18 → 0.2.20

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 +42325 -18273
  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 +279 -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 -1570
  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 -3011
  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,49 @@
1
+ import type { SpaceCloudComputerLevel, SpaceCloudComputerRunResult, SpaceCloudComputerStatus, SpaceCloudComputerUploadInput, SpaceCloudComputerUploadResult } from '../space';
2
+ export interface UseCloudComputerShellResult {
3
+ /**
4
+ * The level this Space declares (`'read'` or `'shell'`) when this host offers the cloud computer,
5
+ * else null (Sites, links, verification harnesses, older hosts): keep the page's own fallback.
6
+ */
7
+ level: SpaceCloudComputerLevel | null;
8
+ /** True when `run` and `upload` are offered: the host offers the cloud computer and the Space declares `'shell'`. */
9
+ available: boolean;
10
+ /** The viewer's approval for this Space's current code (either level), or null while it is read. */
11
+ status: SpaceCloudComputerStatus | null;
12
+ approved: boolean;
13
+ loading: boolean;
14
+ /**
15
+ * Run one non-interactive command on the viewer's own cloud computer. Same result as the shell tool.
16
+ * Pass the same `requestId` when the page retries this run itself: a run is never repeated for one key.
17
+ */
18
+ run(command: string, options?: RunOptions): Promise<SpaceCloudComputerRunResult>;
19
+ /** Write one file (at most 1 MiB) straight to the cloud computer; it never travels by URL or chat. */
20
+ upload(file: SpaceCloudComputerUploadInput): Promise<SpaceCloudComputerUploadResult>;
21
+ /**
22
+ * Ask the host to show its approval prompt, for either declared level. Only the person's click in
23
+ * that prompt approves; once allowed, every `useCloudComputer()` reads the facts again.
24
+ */
25
+ requestApproval(): Promise<SpaceCloudComputerStatus | null>;
26
+ refresh(): Promise<void>;
27
+ }
28
+ type RunOptions = {
29
+ cwd?: string;
30
+ timeoutMs?: number;
31
+ maxOutputLength?: number;
32
+ requestId?: string;
33
+ };
34
+ /**
35
+ * The viewer's approval and, for `cloudComputer: 'shell'`, commands and file writes on the signed-in
36
+ * viewer's own cloud computer, from a Space page.
37
+ *
38
+ * ```tsx
39
+ * const shell = useCloudComputerShell();
40
+ * if (!shell.level) return <AskNotisFallback />;
41
+ * if (!shell.approved) return <Button onClick={() => shell.requestApproval()}>Allow</Button>;
42
+ * const result = await shell.run(`bash ${SCRIPTS}/workspace.sh sync ${quote(repo)} ${quote(name)}`);
43
+ * ```
44
+ *
45
+ * Requires `cloudComputer` in `defineSpace` and the viewer's approval, which the Portal asks for in
46
+ * its own prompt and which covers only the exact code the viewer allowed: any new release asks again.
47
+ */
48
+ export declare function useCloudComputerShell(): UseCloudComputerShellResult;
49
+ export {};
@@ -0,0 +1,118 @@
1
+ import { type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent } from 'react';
2
+ import { type CollectionAction, type ResolvedCollectionAction } from '../interactions/actions';
3
+ import { type ShortcutScope } from '../interactions/shortcuts';
4
+ import type { MultiSelectActionBarProps } from '../components/MultiSelectActionBar';
5
+ import { useLongPressSelection } from './useLongPressSelection';
6
+ import { type SelectionMarqueeRect } from './useMarqueeSelection';
7
+ export declare const COLLECTION_ITEM_ATTRIBUTE = "data-notis-collection-item-id";
8
+ declare const LEGACY_ROW_ATTRIBUTE = "data-notis-row-id";
9
+ export type { SelectionMarqueeRect };
10
+ export type CollectionInteractionReason = 'activate' | 'clear' | 'drag' | 'items-changed' | 'navigate' | 'range' | 'select-all' | 'toggle';
11
+ export interface CollectionSelectionChange<T> {
12
+ reason: CollectionInteractionReason;
13
+ selectedIds: ReadonlySet<string>;
14
+ selectedItems: T[];
15
+ anchorId: string | null;
16
+ }
17
+ export type CollectionNavigationDirection = 'next' | 'previous' | 'up' | 'down' | 'left' | 'right';
18
+ export interface CollectionNavigationContext<T> {
19
+ direction: CollectionNavigationDirection;
20
+ currentId: string | null;
21
+ items: T[];
22
+ orderedIds: string[];
23
+ }
24
+ export interface CollectionKeyboardShortcuts {
25
+ clear: string | false;
26
+ selectAll: string | false;
27
+ toggle: string | false;
28
+ extendNext: string | string[] | false;
29
+ extendPrevious: string | string[] | false;
30
+ next: string | string[] | false;
31
+ previous: string | string[] | false;
32
+ up: string | false;
33
+ down: string | false;
34
+ left: string | false;
35
+ right: string | false;
36
+ activate: string | false;
37
+ }
38
+ export interface UseCollectionInteractionsOptions<T> {
39
+ items: T[];
40
+ getId: (item: T) => string;
41
+ selectionMode?: 'multiple' | 'single' | 'none';
42
+ selectedIds?: ReadonlySet<string>;
43
+ defaultSelectedIds?: Iterable<string>;
44
+ onSelectionChange?: (change: CollectionSelectionChange<T>) => void;
45
+ activeId?: string | null;
46
+ defaultActiveId?: string | null;
47
+ onActiveIdChange?: (id: string | null, reason: CollectionInteractionReason) => void;
48
+ anchorId?: string | null;
49
+ defaultAnchorId?: string | null;
50
+ onAnchorIdChange?: (id: string | null, reason: CollectionInteractionReason) => void;
51
+ onActivate?: (item: T, id: string) => void;
52
+ isItemDisabled?: (item: T) => boolean;
53
+ enabled?: boolean;
54
+ bindKeyboardShortcuts?: boolean;
55
+ enableDragSelect?: boolean;
56
+ /** Touch-only long press; optional per view. */
57
+ enableLongPressSelection?: boolean;
58
+ /** Plain item clicks activate the item and clear checkbox selection by default. */
59
+ clearSelectionOnPlainClick?: boolean;
60
+ dragThreshold?: number;
61
+ shortcuts?: Partial<CollectionKeyboardShortcuts>;
62
+ shortcutScope?: ShortcutScope;
63
+ shortcutPriority?: number;
64
+ resolveNextId?: (context: CollectionNavigationContext<T>) => string | null;
65
+ onActiveItemChange?: (id: string | null) => void;
66
+ actions?: CollectionAction<T>[];
67
+ }
68
+ export interface CollectionInteractionController<T> {
69
+ selectedIds: ReadonlySet<string>;
70
+ selectedCount: number;
71
+ activeId: string | null;
72
+ anchorId: string | null;
73
+ /** Compatibility aliases used by the original multi-select API. */
74
+ headId: string | null;
75
+ lastClickedId: string | null;
76
+ dragRect: SelectionMarqueeRect | null;
77
+ actions: ResolvedCollectionAction[];
78
+ getActionBarProps: () => Pick<MultiSelectActionBarProps, 'selectedCount' | 'actions' | 'collectionOwnerId' | 'isAvailable' | 'shortcutsEnabled' | 'onClearSelection'>;
79
+ isSelected: (id: string) => boolean;
80
+ getSelectedItems: () => T[];
81
+ setActive: (id: string | null, reason?: CollectionInteractionReason) => void;
82
+ activate: (id: string) => void;
83
+ toggle: (id: string) => void;
84
+ select: (ids: string[]) => void;
85
+ clear: () => void;
86
+ selectAll: () => void;
87
+ selectRange: (anchorId: string, targetId: string) => void;
88
+ onCheckboxClick: (id: string) => (event: ReactMouseEvent) => void;
89
+ onRowMouseDown: (id: string) => (event: ReactMouseEvent) => void;
90
+ getRowProps: (id: string) => Record<string, string>;
91
+ getItemProps: (id: string) => Partial<ReturnType<ReturnType<typeof useLongPressSelection>>> & {
92
+ [COLLECTION_ITEM_ATTRIBUTE]: string;
93
+ [LEGACY_ROW_ATTRIBUTE]: string;
94
+ tabIndex: number;
95
+ 'aria-selected': boolean;
96
+ 'aria-disabled': boolean;
97
+ 'data-notis-active': 'true' | 'false';
98
+ onFocus: () => void;
99
+ onMouseDown: (event: ReactMouseEvent) => void;
100
+ onClick: (event: ReactMouseEvent) => void;
101
+ onKeyDown: (event: ReactKeyboardEvent) => void;
102
+ };
103
+ getCheckboxProps: (id: string) => {
104
+ isSelected: boolean;
105
+ disabled: boolean;
106
+ onClick: (event: ReactMouseEvent) => void;
107
+ };
108
+ getContainerProps: () => {
109
+ ref: (node: HTMLElement | null) => void;
110
+ onMouseDown: (event: ReactMouseEvent) => void;
111
+ onFocusCapture: () => void;
112
+ onClickCapture: (event: ReactMouseEvent) => void;
113
+ style: {
114
+ userSelect: 'none';
115
+ };
116
+ };
117
+ }
118
+ export declare function useCollectionInteractions<T>(options: UseCollectionInteractionsOptions<T>): CollectionInteractionController<T>;
@@ -0,0 +1,14 @@
1
+ import type { DatabaseProperty } from '../runtime';
2
+ export interface UseDatabaseSchemaResult {
3
+ name: string | null;
4
+ description: string | null;
5
+ properties: DatabaseProperty[];
6
+ loading: boolean;
7
+ isFetching: boolean;
8
+ hasData: boolean;
9
+ error: Error | null;
10
+ /** Reads again; resolves to the read's error, or null when it succeeded. */
11
+ refetch: () => Promise<Error | null>;
12
+ }
13
+ /** Fetch a database's schema (normalized properties + metadata). */
14
+ export declare function useDatabaseSchema(databaseSlug: string): UseDatabaseSchemaResult;
@@ -0,0 +1,26 @@
1
+ import { type UseDocumentsOptions, type UseDocumentsResult } from './useDocuments';
2
+ import type { DocumentRecord } from '../runtime';
3
+ export interface UseDatabaseSubscriptionOptions extends UseDocumentsOptions {
4
+ /** Set to false to keep the query but skip the change feed. */
5
+ subscribe?: boolean;
6
+ }
7
+ export interface UseDatabaseSubscriptionResult extends UseDocumentsResult {
8
+ /** Alias of `documents`, for views that think in rows. */
9
+ rows: DocumentRecord[];
10
+ /** True while a live change feed is attached to this database. */
11
+ live: boolean;
12
+ }
13
+ /**
14
+ * Query a Notis database and keep it fresh without polling.
15
+ *
16
+ * ```tsx
17
+ * const { rows, live, refetch } = useDatabaseSubscription('workspaces');
18
+ * ```
19
+ *
20
+ * A change on the database wakes the hook, which then refetches through the
21
+ * usual `LOCAL_NOTIS_DATABASE_QUERY` path — the change feed is a signal only
22
+ * and never carries row data. Hosts without a change feed (the dev harness,
23
+ * the screenshot stub, the vite preview) still return rows; `live` is false
24
+ * there and the app should keep offering its manual refresh.
25
+ */
26
+ export declare function useDatabaseSubscription(databaseSlug: string, options?: UseDatabaseSubscriptionOptions): UseDatabaseSubscriptionResult;
@@ -0,0 +1,22 @@
1
+ import type { DocumentRecord } from '../runtime';
2
+ /** The words of the document hook's own failures, in English and French (C8). */
3
+ export declare const DOCUMENT_HOOK_WORDS: Readonly<{
4
+ notFound: {
5
+ en: string;
6
+ fr: string;
7
+ };
8
+ }>;
9
+ export interface UseDocumentOptions {
10
+ enabled?: boolean;
11
+ }
12
+ export interface UseDocumentResult {
13
+ document: DocumentRecord | null;
14
+ loading: boolean;
15
+ isFetching: boolean;
16
+ hasData: boolean;
17
+ error: Error | null;
18
+ /** Reads again; resolves to the read's error, or null when it succeeded. */
19
+ refetch: () => Promise<Error | null>;
20
+ }
21
+ /** Fetch a single document (with content) by id, normalized. */
22
+ export declare function useDocument(documentId: string | null | undefined, options?: UseDocumentOptions): UseDocumentResult;
@@ -0,0 +1,31 @@
1
+ import type { DocumentRecord, QueryFilter } from '../runtime';
2
+ export interface UseDocumentsOptions {
3
+ filter?: QueryFilter;
4
+ pageSize?: number;
5
+ offset?: number;
6
+ /** Fetch every page, starting at offset, instead of returning only one page. */
7
+ fetchAll?: boolean;
8
+ /** App-view lists can omit bodies until opening/searching a document. Default: true. */
9
+ includeContent?: boolean;
10
+ enabled?: boolean;
11
+ }
12
+ export interface UseDocumentsResult {
13
+ documents: DocumentRecord[];
14
+ loading: boolean;
15
+ isFetching: boolean;
16
+ hasData: boolean;
17
+ error: Error | null;
18
+ /** Reads again; resolves to the read's error, or null when it succeeded. */
19
+ refetch: () => Promise<Error | null>;
20
+ }
21
+ /**
22
+ * Query a Notis database and get normalized `DocumentRecord`s.
23
+ *
24
+ * ```tsx
25
+ * const { documents, loading, refetch } = useDocuments('notes', {
26
+ * filter: { filters: [{ property: 'Folder', operator: 'contains', type: 'relation', value: folderId }] },
27
+ * pageSize: 250,
28
+ * });
29
+ * ```
30
+ */
31
+ export declare function useDocuments(databaseSlug: string, options?: UseDocumentsOptions): UseDocumentsResult;
@@ -0,0 +1,43 @@
1
+ import type { HandoverPayload, HandoverResult } from '../runtime';
2
+ export interface UseHandoverResult {
3
+ /** Hand the work over. Rejects when the host has no manager chat. */
4
+ handover: (payload: HandoverPayload) => Promise<HandoverResult>;
5
+ /** True while the manager chat is being prepared. */
6
+ pending: boolean;
7
+ error: Error | null;
8
+ /**
9
+ * False when the host cannot hand work over (dev harness, vite preview).
10
+ * Render the app's own fallback — a copyable prompt, say — when it is false.
11
+ */
12
+ available: boolean;
13
+ }
14
+ /**
15
+ * Hand a piece of work from app code to the Notis manager chat.
16
+ *
17
+ * An app displays work; the manager runs it. `handover` puts the message in
18
+ * the chat surface that already owns streaming progress, billing, cancellation
19
+ * and the transcript, and the app watches its own databases for the result.
20
+ *
21
+ * ```tsx
22
+ * const { handover, pending, available } = useHandover();
23
+ *
24
+ * return available ? (
25
+ * <Button
26
+ * disabled={pending}
27
+ * onClick={() => { void handover({ prompt: 'Create a workspace on notis to ...' }); }}
28
+ * >
29
+ * Send to Notis
30
+ * </Button>
31
+ * ) : (
32
+ * <CopyablePrompt prompt="Create a workspace on notis to ..." />
33
+ * );
34
+ * ```
35
+ *
36
+ * Omit `prompt` to open a context-only composer, for example when a visible
37
+ * feedback button should let the user write in their own words.
38
+ *
39
+ * Pass `skill` to bind the work to a skill declared in `notis.config.ts`; the
40
+ * host rejects a key the app does not declare. `autoSend` submits the prepared
41
+ * message on an active user gesture; background calls still open a draft.
42
+ */
43
+ export declare function useHandover(): UseHandoverResult;
@@ -0,0 +1,9 @@
1
+ import type { MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent } from 'react';
2
+ /** Adds a touch-only long-press entry point without rendering idle checkboxes. */
3
+ export declare function useLongPressSelection(onSelect: (id: string) => void): (id: string) => {
4
+ onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;
5
+ onPointerMove: (event: ReactPointerEvent<HTMLElement>) => void;
6
+ onPointerUp: () => void;
7
+ onPointerCancel: () => void;
8
+ onClickCapture: (event: ReactMouseEvent<HTMLElement>) => boolean;
9
+ };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * `useMarqueeSelection`: drag from empty space to select (the rubber band), shared by the Manager
3
+ * (`useCollectionInteractions`) and the toolkit list (`ListReader`), so both run the same code.
4
+ *
5
+ * - A press starts a marquee only on empty space inside the container: not on an item, not on a control
6
+ * (button, link, field). A press on a control does nothing here; a press on an item is left to the item.
7
+ * - The marquee shows once the pointer moved past `threshold` px; the text selection is cleared then.
8
+ * - While dragging, every selectable item the rectangle intersects is selected, live (`onSelect`, in DOM order;
9
+ * the last one is the anchor).
10
+ * - Releasing after a drag swallows the click that follows; a plain click on empty space clears (`onClear`).
11
+ * - Mouse events only: a touch drag scrolls and never draws a marquee.
12
+ */
13
+ import { type MouseEvent as ReactMouseEvent } from 'react';
14
+ export interface SelectionMarqueeRect {
15
+ left: number;
16
+ top: number;
17
+ width: number;
18
+ height: number;
19
+ }
20
+ /** Clicks on these belong to the control (Manager `INTERACTIVE_SELECTOR`). */
21
+ export declare const MARQUEE_INTERACTIVE_SELECTOR = "button, a, input, textarea, select, [role=\"button\"], [contenteditable]:not([contenteditable=\"false\"])";
22
+ export interface UseMarqueeSelectionOptions {
23
+ /** The marquee is on: the collection allows multiple selection and the surface did not opt out. */
24
+ enabled: boolean;
25
+ /** The attribute every item element carries, holding its id. */
26
+ itemAttribute: string;
27
+ /** Items that may join the selection (pending and disabled ones may not). */
28
+ isSelectable: (id: string) => boolean;
29
+ /** The items under the rectangle, in DOM order, on every move of a drag. Replaces the selection. */
30
+ onSelect: (ids: string[]) => void;
31
+ /** A plain click (no drag) on empty space. */
32
+ onClear: () => void;
33
+ /** Distance in px before a press becomes a drag. Default 5. */
34
+ threshold?: number;
35
+ interactiveSelector?: string;
36
+ /** A part of an item a drag may also start from (a row's leading strip), so a list with no empty space left still
37
+ * has a place to start one. A plain click there still reaches the item. Default: empty space only. */
38
+ startSelector?: string;
39
+ }
40
+ export interface MarqueeSelection {
41
+ /** The marquee in viewport coordinates while dragging, else null (draw it with `SelectionMarquee`). */
42
+ rect: SelectionMarqueeRect | null;
43
+ /** Put on the container. */
44
+ onMouseDown: (event: ReactMouseEvent) => void;
45
+ /** Put on the container: swallows the click that ends a drag (or any gesture that armed it). */
46
+ onClickCapture: (event: ReactMouseEvent) => void;
47
+ /** Swallow the next click inside the container (Mod-press toggles use it too). */
48
+ armSuppressNextClick: () => void;
49
+ }
50
+ /** The ids of the selectable items under `rect` inside `container`, in DOM order. */
51
+ export declare function itemsInMarquee(container: ParentNode | null, rect: {
52
+ left: number;
53
+ top: number;
54
+ right: number;
55
+ bottom: number;
56
+ }, itemAttribute: string, isSelectable: (id: string) => boolean): string[];
57
+ export declare function useMarqueeSelection(options: UseMarqueeSelectionOptions): MarqueeSelection;
@@ -0,0 +1,51 @@
1
+ import { type MouseEvent as ReactMouseEvent } from 'react';
2
+ import { type CollectionInteractionController, type SelectionMarqueeRect } from './useCollectionInteractions';
3
+ declare const ROW_ATTR = "data-notis-row-id";
4
+ export type DragRect = SelectionMarqueeRect;
5
+ export interface UseMultiSelectOptions<T> {
6
+ items: T[];
7
+ getId: (item: T) => string;
8
+ /** When false, suppresses the global Esc / Cmd+A / X / Shift+Arrow listeners. Default true. */
9
+ bindKeyboardShortcuts?: boolean;
10
+ /** When false, disables the rubber-band drag-select rectangle. Default true. */
11
+ enableDragSelect?: boolean;
12
+ /** Distance (px) the cursor must move past mousedown before a drag begins. Default 5. */
13
+ dragThreshold?: number;
14
+ /** Initial head id (the row that Shift+Arrow extends from). */
15
+ initialHeadId?: string | null;
16
+ /** Fires when the head moves via Shift+Arrow so the consumer can scroll the row into view. */
17
+ onHeadChange?: (id: string | null) => void;
18
+ }
19
+ export interface MultiSelectController<T> {
20
+ selectedIds: ReadonlySet<string>;
21
+ selectedCount: number;
22
+ lastClickedId: string | null;
23
+ headId: string | null;
24
+ dragRect: DragRect | null;
25
+ isSelected: (id: string) => boolean;
26
+ getSelectedItems: () => T[];
27
+ toggle: (id: string) => void;
28
+ select: (ids: string[]) => void;
29
+ clear: () => void;
30
+ selectAll: () => void;
31
+ selectRange: (anchorId: string, targetId: string) => void;
32
+ setHead: (id: string | null) => void;
33
+ onCheckboxClick: (id: string) => (event: ReactMouseEvent) => void;
34
+ onRowMouseDown: (id: string) => (event: ReactMouseEvent) => void;
35
+ getRowProps: (id: string) => {
36
+ [ROW_ATTR]: string;
37
+ };
38
+ getItemProps: CollectionInteractionController<T>['getItemProps'];
39
+ getCheckboxProps: (id: string) => {
40
+ isSelected: boolean;
41
+ onClick: (event: ReactMouseEvent) => void;
42
+ };
43
+ getContainerProps: CollectionInteractionController<T>['getContainerProps'];
44
+ }
45
+ /**
46
+ * @deprecated Use `useCollectionInteractions` for controlled selection,
47
+ * active-item navigation, scoped shortcuts, and semantic actions. This bridge
48
+ * is retained for the 0.2 minor and scheduled for removal in 0.3.
49
+ */
50
+ export declare function useMultiSelect<T>(options: UseMultiSelectOptions<T>): MultiSelectController<T>;
51
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type SpaceDocumentBodyRead, type SpaceDocumentBodySave } from '../space';
2
+ /** Explicit textarea Save. The source owns the draft and retains its request ID
3
+ * until a receipt or unchanged result; background reads never replace that draft. */
4
+ export declare function useNativeDocumentBody(binding: string, recordKey: string | null, options: {
5
+ readAction: string;
6
+ writeAction?: string;
7
+ enabled?: boolean;
8
+ }): {
9
+ data: SpaceDocumentBodyRead | undefined;
10
+ hasData: boolean;
11
+ loading: boolean;
12
+ isFetching: boolean;
13
+ error: Error | null;
14
+ refetch: () => Promise<Error | null>;
15
+ body: SpaceDocumentBodyRead | undefined;
16
+ save: (draft: {
17
+ contentMarkdown: string;
18
+ expectedRevision: number;
19
+ schemaRevision: number;
20
+ requestId: string;
21
+ }) => Promise<SpaceDocumentBodySave>;
22
+ saving: boolean;
23
+ saveError: Error | null;
24
+ };
@@ -0,0 +1,55 @@
1
+ import type { DocumentRecord } from '../runtime';
2
+ import type { NativeDelete, NativeInsert, NativeMutationReceipt, NativeQuery, NativeUpdate } from '../nativeData';
3
+ import { type UseQueryResult } from './useQuery';
4
+ /**
5
+ * A declared query adapter, never an account-wide slug or owner lookup.
6
+ *
7
+ * `subscribe: true` follows the binding's live change feed where the host has one (a
8
+ * signed-in Editor of the Space, owner or teammate): `live` is then true and changes made
9
+ * elsewhere (another device, a teammate, an agent, an automation) re-read the rows on their
10
+ * own. Where `live` is false, keep offering a manual reload.
11
+ */
12
+ export declare function useNativeDocuments(binding: string, options?: {
13
+ query?: NativeQuery;
14
+ fetchAll?: boolean;
15
+ enabled?: boolean;
16
+ staleTimeMs?: number;
17
+ subscribe?: boolean;
18
+ }): UseQueryResult<{
19
+ documents: DocumentRecord[];
20
+ schemaRevision: number;
21
+ }> & {
22
+ documents: DocumentRecord[];
23
+ schemaRevision?: number;
24
+ live: boolean;
25
+ };
26
+ /** Explicit insert/update/trash; update never silently creates a missing row. */
27
+ export declare function useNativeMutation<TOperation extends 'insert' | 'update' | 'delete'>(binding: string, operation: TOperation): {
28
+ mutate: (input: TOperation extends 'insert' ? NativeInsert : TOperation extends 'update' ? NativeUpdate : NativeDelete, options: {
29
+ schemaRevision: number;
30
+ requestId: string;
31
+ }) => Promise<NativeMutationReceipt>;
32
+ loading: boolean;
33
+ error: Error | null;
34
+ };
35
+ export interface NativeDeleteManyResult {
36
+ done: NativeDelete[];
37
+ failed: Array<{
38
+ input: NativeDelete;
39
+ error: Error;
40
+ }>;
41
+ }
42
+ /**
43
+ * Trashes many rows of one database binding: every row leaves the cached reads at once, the writes run a few at
44
+ * a time (each with its own request ID, `${requestId}:${record_key}`, so a retry with the same `requestId` replays
45
+ * instead of trashing twice), the reads refresh once at the end, and a row whose write failed comes back. It never
46
+ * throws for a failed row: `failed` lists them.
47
+ */
48
+ export declare function useNativeDelete(binding: string): {
49
+ deleteMany: (inputs: readonly NativeDelete[], options: {
50
+ schemaRevision: number;
51
+ requestId: string;
52
+ }) => Promise<NativeDeleteManyResult>;
53
+ loading: boolean;
54
+ error: Error | null;
55
+ };
@@ -0,0 +1,25 @@
1
+ import type { RuntimeResource, AppDescriptor, CollectionItemDetail, DatabaseDescriptor, RouteDescriptor } from '../runtime';
2
+ interface NotisContext {
3
+ /** UI selection only; it grants no access and is never a record scope. */
4
+ selection: string | null;
5
+ resource: RuntimeResource | null;
6
+ /** App metadata (id, name, icon, description). Null before runtime loads. */
7
+ app: AppDescriptor | null;
8
+ /** Current route descriptor. Null before runtime loads. */
9
+ route: RouteDescriptor | null;
10
+ /** Databases declared by this app. Empty before runtime loads. */
11
+ databases: DatabaseDescriptor[];
12
+ /** Selected collection item for the current route, when applicable. */
13
+ collectionItem: CollectionItemDetail | null;
14
+ /** Resource requested through this route's canonical deep link. */
15
+ resourceId: string | null;
16
+ /** Whether the runtime is loaded and available. */
17
+ ready: boolean;
18
+ }
19
+ /**
20
+ * Access app-level metadata, the current route, declared databases, and the
21
+ * selected collection item. Returns safe defaults when the portal runtime is
22
+ * not available.
23
+ */
24
+ export declare function useNotis(): NotisContext;
25
+ export {};
@@ -0,0 +1,33 @@
1
+ export interface SpaceNavigationOptions {
2
+ recordKey?: string | null;
3
+ /** Declared view parameters. The destination authorizes records and drops unknown names. */
4
+ params?: Record<string, string | number | boolean | null | undefined>;
5
+ selection?: string | null;
6
+ }
7
+ interface NavigationActions {
8
+ /** Resolve a declared portable destination under the current viewer's access. */
9
+ toNamedSpace: (alias: string, options?: SpaceNavigationOptions) => Promise<void>;
10
+ /**
11
+ * Open an exact Space, optionally at a native record's stable record_key. Resolves once the host has taken the
12
+ * navigation; rejects when the host refuses it (the Space closed, or the view it came from is no longer active).
13
+ */
14
+ toSpace: (spaceId: string, options?: SpaceNavigationOptions) => Promise<void>;
15
+ /** Navigate to a route within the app by its path. */
16
+ toRoute: (path: string, options?: {
17
+ resourceId?: string | null;
18
+ }) => void;
19
+ /** Navigate to the app's default route. */
20
+ toApp: () => void;
21
+ }
22
+ /**
23
+ * Navigation helpers for Spaces and app routes.
24
+ * When rendered inside the portal, uses the runtime.navigate() bridge.
25
+ * Without a portal runtime, falls back to window.location for route navigation.
26
+ *
27
+ * ```tsx
28
+ * const nav = useNotisNavigation();
29
+ * nav.toSpace(spaceId, { recordKey });
30
+ * ```
31
+ */
32
+ export declare function useNotisNavigation(): NavigationActions;
33
+ export {};
@@ -0,0 +1,22 @@
1
+ export interface UseQueryOptions {
2
+ /** Required acknowledgement: only idempotent reads may run on mount or prefetch. */
3
+ readOnly: true;
4
+ enabled?: boolean;
5
+ staleTimeMs?: number;
6
+ }
7
+ export interface UseQueryResult<T> {
8
+ data: T | undefined;
9
+ hasData: boolean;
10
+ loading: boolean;
11
+ isFetching: boolean;
12
+ error: Error | null;
13
+ /** Reads again; resolves to the read's localized error, or null when it succeeded (never rejects). */
14
+ refetch: () => Promise<Error | null>;
15
+ }
16
+ /** Cached read callback; scope and lifetime are provided by the host, never by app globals. */
17
+ export declare function useQuery<T>(key: readonly unknown[], read: () => Promise<T>, options: UseQueryOptions): UseQueryResult<T>;
18
+ /** Opt-in preparation for small, known read queries. Never use for writes or full-database crawls. */
19
+ export declare function useQueryClient(): {
20
+ invalidate(key?: readonly unknown[]): void;
21
+ prefetch<T>(key: readonly unknown[], read: () => Promise<T>, options: UseQueryOptions): Promise<T | undefined>;
22
+ };
@@ -0,0 +1,20 @@
1
+ import type { ToolCallOptions } from '../runtime';
2
+ type ToolArguments = Record<string, unknown>;
3
+ type ToolCall<TArgs extends ToolArguments | undefined, TResult> = undefined extends TArgs ? (args?: Exclude<TArgs, undefined>, options?: ToolCallOptions) => Promise<TResult> : (args: TArgs, options?: ToolCallOptions) => Promise<TResult>;
4
+ export interface ToolCallState {
5
+ loading: boolean;
6
+ error: Error | null;
7
+ }
8
+ export interface UseToolResult<TArgs extends ToolArguments | undefined = ToolArguments | undefined, TResult = unknown> extends ToolCallState {
9
+ call: ToolCall<TArgs, TResult>;
10
+ }
11
+ /**
12
+ * Call a specific Notis tool by name.
13
+ *
14
+ * ```tsx
15
+ * const { call, loading } = useTool('LOCAL_NOTIS_WEB_SEARCH');
16
+ * const result = await call({ query: 'latest news' });
17
+ * ```
18
+ */
19
+ export declare function useTool<TArgs extends ToolArguments | undefined = ToolArguments | undefined, TResult = unknown>(toolName: string): UseToolResult<TArgs, TResult>;
20
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type UseQueryOptions } from './useQuery';
2
+ /** An explicitly identified read-only tool, cached by tool name and exact arguments. */
3
+ export declare function useToolQuery<T = unknown>(name: string, args: Record<string, unknown> | undefined, options: UseQueryOptions): import("./useQuery").UseQueryResult<T>;
@@ -0,0 +1,15 @@
1
+ import type { ToolDescriptor } from '../runtime';
2
+ interface UseToolsResult {
3
+ tools: ToolDescriptor[];
4
+ loading: boolean;
5
+ error: Error | null;
6
+ }
7
+ /**
8
+ * List all tools available to this app.
9
+ *
10
+ * ```tsx
11
+ * const { tools, loading } = useTools();
12
+ * ```
13
+ */
14
+ export declare function useTools(): UseToolsResult;
15
+ export {};