@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
@@ -1,143 +0,0 @@
1
- import { fileURLToPath } from 'node:url';
2
-
3
- const STORE_SCREENSHOT_ASPECT = 16 / 10;
4
- const SHARED_BACKDROP_PATH = fileURLToPath(
5
- new URL('./assets/store-screenshot-dark.png', import.meta.url),
6
- );
7
-
8
- const ACCENT_PALETTES = {
9
- blue: { glow: '#4f7cff', glow2: '#274690' },
10
- violet: { glow: '#9b87f5', glow2: '#5038a1' },
11
- emerald: { glow: '#34d399', glow2: '#176b55' },
12
- amber: { glow: '#f2a94a', glow2: '#8b4f20' },
13
- rose: { glow: '#fb7185', glow2: '#8f3048' },
14
- sky: { glow: '#38bdf8', glow2: '#176887' },
15
- fuchsia: { glow: '#d946ef', glow2: '#772786' },
16
- teal: { glow: '#2dd4bf', glow2: '#176e68' },
17
- };
18
-
19
- const ACCENT_NAMES = Object.keys(ACCENT_PALETTES);
20
-
21
- async function loadSharp() {
22
- return (await import('sharp')).default;
23
- }
24
-
25
- function stableHash(value) {
26
- let hash = 2166136261;
27
- for (const character of String(value || 'notis-app')) {
28
- hash ^= character.codePointAt(0);
29
- hash = Math.imul(hash, 16777619);
30
- }
31
- return hash >>> 0;
32
- }
33
-
34
- export function resolveStoreScreenshotAccent(accent, seed = 'notis-app') {
35
- if (accent && ACCENT_PALETTES[accent]) {
36
- return accent;
37
- }
38
- return ACCENT_NAMES[stableHash(seed) % ACCENT_NAMES.length];
39
- }
40
-
41
- export function storeScreenshotLayout(width = 2000, height = 1250) {
42
- const horizontalInset = Math.max(48, Math.round(width * 0.06));
43
- const verticalInset = Math.max(40, Math.round(height * 0.06));
44
- let cardWidth = width - horizontalInset * 2;
45
- let cardHeight = Math.round(cardWidth / STORE_SCREENSHOT_ASPECT);
46
- const maximumCardHeight = height - verticalInset * 2;
47
- if (cardHeight > maximumCardHeight) {
48
- cardHeight = maximumCardHeight;
49
- cardWidth = Math.round(cardHeight * STORE_SCREENSHOT_ASPECT);
50
- }
51
- const cardLeft = Math.round((width - cardWidth) / 2);
52
- const cardTop = Math.round((height - cardHeight) / 2) - Math.round(height * 0.008);
53
- return {
54
- width,
55
- height,
56
- cardWidth,
57
- cardHeight,
58
- cardLeft,
59
- cardTop,
60
- radius: Math.max(18, Math.round(width * 0.016)),
61
- };
62
- }
63
-
64
- async function backdropImage(layout) {
65
- const sharp = await loadSharp();
66
- return sharp(SHARED_BACKDROP_PATH)
67
- .resize(layout.width, layout.height, { fit: 'cover', position: 'centre' })
68
- .png()
69
- .toBuffer();
70
- }
71
-
72
- function roundedRectSvg(width, height, radius, { fill = '#ffffff', stroke = null } = {}) {
73
- const strokeAttribute = stroke
74
- ? ` fill="none" stroke="${stroke}" stroke-width="2"`
75
- : ` fill="${fill}"`;
76
- return Buffer.from(
77
- `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"><rect x="1" y="1" width="${width - 2}" height="${height - 2}" rx="${radius}" ry="${radius}"${strokeAttribute}/></svg>`,
78
- );
79
- }
80
-
81
- /**
82
- * Composite a truthful browser capture into the deterministic Store frame.
83
- * The source pixels are only resized/cropped; the app UI is never redrawn.
84
- */
85
- export async function composeStoreScreenshot({
86
- inputPath,
87
- outputPath,
88
- width = 2000,
89
- height = 1250,
90
- accent = null,
91
- seed = 'notis-app',
92
- focused = false,
93
- theme = 'light',
94
- }) {
95
- const sharp = await loadSharp();
96
- const resolvedTheme = theme === 'dark' ? 'dark' : 'light';
97
- const layout = storeScreenshotLayout(width, height);
98
- const resolvedAccent = resolveStoreScreenshotAccent(accent, seed);
99
-
100
- const roundedCapture = await sharp(inputPath)
101
- .resize(layout.cardWidth, layout.cardHeight, {
102
- fit: 'cover',
103
- position: focused ? 'top' : 'centre',
104
- })
105
- .composite([{
106
- input: roundedRectSvg(layout.cardWidth, layout.cardHeight, layout.radius),
107
- blend: 'dest-in',
108
- }])
109
- .png()
110
- .toBuffer();
111
-
112
- const border = roundedRectSvg(
113
- layout.cardWidth,
114
- layout.cardHeight,
115
- layout.radius,
116
- { stroke: resolvedTheme === 'dark' ? '#FFFFFF2A' : '#0F172A22' },
117
- );
118
-
119
- await sharp(await backdropImage(layout))
120
- .composite([
121
- { input: roundedCapture, left: layout.cardLeft, top: layout.cardTop },
122
- { input: border, left: layout.cardLeft, top: layout.cardTop },
123
- ])
124
- .png({
125
- compressionLevel: 9,
126
- adaptiveFiltering: true,
127
- })
128
- .toFile(outputPath);
129
-
130
- return {
131
- mode: 'framed',
132
- accent: resolvedAccent,
133
- focused: Boolean(focused),
134
- theme: resolvedTheme,
135
- card: {
136
- left: layout.cardLeft,
137
- top: layout.cardTop,
138
- width: layout.cardWidth,
139
- height: layout.cardHeight,
140
- radius: layout.radius,
141
- },
142
- };
143
- }
@@ -1,5 +0,0 @@
1
- # App Changelog
2
-
3
- ## [Initial Release] - {PR_MERGE_DATE}
4
-
5
- - First Store release.
@@ -1,60 +0,0 @@
1
- 'use client';
2
-
3
- import { getDocumentPreview, useDocuments, useNotis } from '@notis/sdk';
4
- import { Badge } from '@/components/ui/badge';
5
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
6
-
7
- export default function HomePage() {
8
- const { app, ready } = useNotis();
9
- // Documents come back normalized: plain property values, camelCase fields,
10
- // and typed content (contentMarkdown / contentBlocknote / plainText).
11
- const { documents, loading } = useDocuments('items', { pageSize: 25 });
12
-
13
- return (
14
- <main className="notis-app-shell space-y-6">
15
- <Card>
16
- <CardHeader className="space-y-3">
17
- <Badge variant="secondary" className="w-fit">Installed app</Badge>
18
- <div className="space-y-2">
19
- <CardTitle>{ready ? app?.name : 'Loading...'}</CardTitle>
20
- <CardDescription>
21
- {ready ? app?.description : 'Loading app metadata...'}
22
- </CardDescription>
23
- </div>
24
- </CardHeader>
25
- </Card>
26
-
27
- <Card>
28
- <CardHeader>
29
- <CardTitle>Items</CardTitle>
30
- <CardDescription>Use shadcn surfaces and portal tokens so the app feels native inside Notis.</CardDescription>
31
- </CardHeader>
32
- <CardContent>
33
- {loading ? (
34
- <p className="text-sm text-muted-foreground">Loading...</p>
35
- ) : documents.length === 0 ? (
36
- <div className="rounded-xl border border-dashed border-border px-4 py-10 text-center text-sm text-muted-foreground">
37
- No items yet. Deploy the app and create some.
38
- </div>
39
- ) : (
40
- <div className="space-y-3">
41
- {documents.map((doc) => (
42
- <div key={doc.id} className="rounded-xl border border-border bg-background px-4 py-3">
43
- <div className="flex items-center justify-between gap-3">
44
- <p className="font-medium">{doc.title || 'Untitled'}</p>
45
- {typeof doc.properties.status === 'string' ? (
46
- <Badge variant="outline">{doc.properties.status}</Badge>
47
- ) : null}
48
- </div>
49
- <p className="mt-1 line-clamp-1 text-xs text-muted-foreground">
50
- {getDocumentPreview(doc)}
51
- </p>
52
- </div>
53
- ))}
54
- </div>
55
- )}
56
- </CardContent>
57
- </Card>
58
- </main>
59
- );
60
- }
@@ -1,56 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { cn } from '@/lib/utils';
4
-
5
- const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
6
- ({ className, ...props }, ref) => (
7
- <div
8
- ref={ref}
9
- className={cn('rounded-2xl border bg-card text-card-foreground shadow-sm', className)}
10
- {...props}
11
- />
12
- ),
13
- );
14
- Card.displayName = 'Card';
15
-
16
- const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
17
- ({ className, ...props }, ref) => (
18
- <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
19
- ),
20
- );
21
- CardHeader.displayName = 'CardHeader';
22
-
23
- const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
24
- ({ className, ...props }, ref) => (
25
- <h3
26
- ref={ref}
27
- className={cn('text-xl font-semibold leading-none tracking-tight', className)}
28
- {...props}
29
- />
30
- ),
31
- );
32
- CardTitle.displayName = 'CardTitle';
33
-
34
- const CardDescription = React.forwardRef<
35
- HTMLParagraphElement,
36
- React.HTMLAttributes<HTMLParagraphElement>
37
- >(({ className, ...props }, ref) => (
38
- <p ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
39
- ));
40
- CardDescription.displayName = 'CardDescription';
41
-
42
- const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
43
- ({ className, ...props }, ref) => (
44
- <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
45
- ),
46
- );
47
- CardContent.displayName = 'CardContent';
48
-
49
- const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
50
- ({ className, ...props }, ref) => (
51
- <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
52
- ),
53
- );
54
- CardFooter.displayName = 'CardFooter';
55
-
56
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
@@ -1,103 +0,0 @@
1
- 'use client';
2
-
3
- import type { CSSProperties, ReactElement } from 'react';
4
- import { useNotisRuntime } from '../provider';
5
- import { useDocument } from '../hooks/useDocument';
6
- import { Markdown } from './Markdown';
7
- import type { NotisDocumentEditorProps } from '../runtime';
8
-
9
- const fallbackNoticeStyle: CSSProperties = {
10
- marginTop: '0.75rem',
11
- fontSize: '12px',
12
- color: 'hsl(var(--muted-foreground))',
13
- };
14
-
15
- const fallbackFrameStyle: CSSProperties = {
16
- borderRadius: '0.5rem',
17
- border: '1px dashed hsl(var(--border))',
18
- padding: '1rem',
19
- fontSize: '13px',
20
- color: 'hsl(var(--muted-foreground))',
21
- };
22
-
23
- const fallbackTitleStyle: CSSProperties = {
24
- margin: '0 0 0.75rem',
25
- fontSize: '1.5rem',
26
- fontWeight: 700,
27
- letterSpacing: '-0.01em',
28
- color: 'hsl(var(--foreground))',
29
- };
30
-
31
- /**
32
- * Read-only stand-in used when no host editor is available (standalone dev
33
- * harness, snapshots). Markdown content renders via `Markdown`; other content
34
- * types get a typed placeholder.
35
- */
36
- function DocumentEditorFallback({ documentId, variant = 'full', className }: NotisDocumentEditorProps) {
37
- const runtime = useNotisRuntime();
38
- const { document, loading, error } = useDocument(documentId);
39
- // Listing screenshots should show the app as it looks in the portal, so the
40
- // harness-only editing notice stays out of scenario captures.
41
- const isScreenshot = Boolean(runtime?.context?.screenshotScenario);
42
-
43
- if (loading) {
44
- return <div className={className} style={fallbackFrameStyle}>Loading document…</div>;
45
- }
46
- if (error || !document) {
47
- return (
48
- <div className={className} style={fallbackFrameStyle}>
49
- {error?.message ?? 'Document not found.'}
50
- </div>
51
- );
52
- }
53
-
54
- const isMarkdown = document.contentType === 'markdown' || !document.contentType;
55
- return (
56
- <div className={className}>
57
- {variant === 'full' ? <h1 style={fallbackTitleStyle}>{document.title}</h1> : null}
58
- {isMarkdown ? (
59
- <>
60
- <Markdown value={document.contentMarkdown ?? ''} />
61
- {isScreenshot ? null : (
62
- <p style={fallbackNoticeStyle}>Read-only preview — editing is available inside the Notis portal.</p>
63
- )}
64
- </>
65
- ) : document.contentType === 'view' ? (
66
- <div style={fallbackFrameStyle}>
67
- {document.viewType === 'report'
68
- ? 'Interactive report'
69
- : document.viewType === 'html'
70
- ? 'Interactive HTML document'
71
- : 'View document'} — open it in Notis Documents for
72
- the full native experience.
73
- </div>
74
- ) : (
75
- <div style={fallbackFrameStyle}>
76
- {document.fileType ? `${document.fileType.toUpperCase()} document` : 'File document'} — open it in
77
- the Notis portal to view.
78
- </div>
79
- )}
80
- </div>
81
- );
82
- }
83
-
84
- /**
85
- * Embeds the document editor for a document anywhere in an app view. The host
86
- * (portal) provides the implementation through `runtime.ui.DocumentEditor` and
87
- * dispatches on the document's content type (markdown -> rich text editor,
88
- * files -> matching viewer, views -> their trusted native Documents surface).
89
- * Outside the portal this falls back to a read-only preview or an explicit
90
- * open-in-Documents notice for native views.
91
- *
92
- * ```tsx
93
- * <DocumentEditor documentId={entry.id} variant="body" className="min-h-[320px]" />
94
- * ```
95
- */
96
- export function DocumentEditor(props: NotisDocumentEditorProps): ReactElement {
97
- const runtime = useNotisRuntime();
98
- const HostEditor = runtime?.ui?.DocumentEditor;
99
- if (HostEditor) {
100
- return <HostEditor {...props} />;
101
- }
102
- return <DocumentEditorFallback {...props} />;
103
- }
@@ -1,259 +0,0 @@
1
- /**
2
- * Configuration utilities for notis.config.ts.
3
- *
4
- * Usage:
5
- * ```ts
6
- * // notis.config.ts
7
- * import { defineNotisApp } from '@notis/sdk/config';
8
- *
9
- * export default defineNotisApp({
10
- * name: 'My App',
11
- * description: 'Does things',
12
- * icon: 'phosphor:squares-four',
13
- * databases: ['tasks'],
14
- * routes: [
15
- * {
16
- * path: '/',
17
- * slug: 'notes',
18
- * name: 'Notes',
19
- * default: true,
20
- * collection: {
21
- * database: 'notes',
22
- * titleProperty: 'Name',
23
- * parentProperty: 'Parent',
24
- * sidebar: {
25
- * mode: 'tree',
26
- * allowCreate: true,
27
- * },
28
- * },
29
- * },
30
- * ],
31
- * tools: [...],
32
- * });
33
- * ```
34
- */
35
-
36
- export interface NotisRouteConfig {
37
- path: string;
38
- slug: string;
39
- name: string;
40
- icon?: string;
41
- parentSlug?: string | null;
42
- default?: boolean;
43
- /**
44
- * Allow the host to address an app-owned resource on this route through the
45
- * canonical `?resource=<id>` deep link. Read the incoming id with
46
- * `useNotis().resourceId`.
47
- */
48
- resourceDeepLinks?: boolean;
49
- exportName?: string;
50
- collection?: {
51
- database: string;
52
- titleProperty: string;
53
- parentProperty?: string | null;
54
- sidebar?: {
55
- mode: 'flat-list' | 'tree';
56
- allowCreate: boolean;
57
- };
58
- };
59
- }
60
-
61
- export const NOTIS_APP_CATEGORIES = [
62
- 'Productivity',
63
- 'Sales & Marketing',
64
- 'Operations',
65
- 'Product & Engineering',
66
- 'Personal',
67
- ] as const;
68
-
69
- export type NotisAppCategory = typeof NOTIS_APP_CATEGORIES[number];
70
-
71
- export interface NotisAppDatabaseConfig {
72
- /** Database slug, as declared by the app. */
73
- slug: string;
74
- /**
75
- * Ship this database's rows to everyone who installs the app.
76
- *
77
- * Off by default: declaring a database publishes its STRUCTURE, never its
78
- * content. Turn it on only for starter content that every installer should
79
- * receive - a default folder tree, a set of templates - and never for a
80
- * database that accumulates the author's own data.
81
- */
82
- seedDocuments?: boolean;
83
- }
84
-
85
- export interface NotisAppAuthor {
86
- name: string;
87
- handle?: string;
88
- url?: string;
89
- }
90
-
91
- export interface NotisAppSkillConfig {
92
- /** Stable source-owned key used by other app declarations. */
93
- key: string;
94
- /**
95
- * Path to the skill, relative to notis.config.ts. Either a Markdown file
96
- * (`./skills/onboarding.md`) or a directory holding SKILL.md plus its
97
- * supporting files (`./skills/onboarding/`), which are packaged on deploy
98
- * and materialized next to SKILL.md in the sandbox.
99
- */
100
- path: string;
101
- /** User-facing name used for the installed skill. */
102
- name: string;
103
- description?: string;
104
- }
105
-
106
- export interface NotisAppOnboardingConfig {
107
- /** Key of a skill declared in `skills`. */
108
- skill: string;
109
- /** Editable message placed in Notis when onboarding is opened. */
110
- prompt: string;
111
- }
112
-
113
- export interface NotisAppScreenshotConfig {
114
- /** Conventional metadata/screenshot-N.png source path. */
115
- path: string;
116
- /** Meaningful description used by the Store gallery and assistive technology. */
117
- alt: string;
118
- /** Route slug captured by `notis apps screenshot`. */
119
- route?: string;
120
- /**
121
- * Named scenario from metadata/screenshot-fixtures.json. Its `tools` and
122
- * `requests` override the file-level ones key by key for this capture, and
123
- * its `actions` run once the route has mounted -- so one route can be shown
124
- * in several states (populated, empty, a panel opened) without the states
125
- * leaking into each other.
126
- */
127
- scenario?: string;
128
- /** Optional CSS selector captured as the truthful focal region for this Store image. */
129
- focus?: string;
130
- /** Portal color scheme used while rendering this screenshot. Defaults to light. */
131
- theme?: 'light' | 'dark';
132
- }
133
-
134
- /**
135
- * Named accent tokens for an app's avatar. Keep in sync with the portal
136
- * `ACCENT_NAMES` and the server `ACCENT_TOKENS`.
137
- */
138
- export const NOTIS_APP_ACCENTS = [
139
- 'blue',
140
- 'violet',
141
- 'emerald',
142
- 'amber',
143
- 'rose',
144
- 'sky',
145
- 'fuchsia',
146
- 'teal',
147
- ] as const;
148
-
149
- export type NotisAppAccent = typeof NOTIS_APP_ACCENTS[number];
150
-
151
- export interface NotisAppCapabilities {
152
- /**
153
- * Read every database in the workspace, not only the ones this app declares
154
- * in `databases` or created itself.
155
- *
156
- * An app runtime is otherwise sandboxed to its own databases, so a catalog or
157
- * explorer app sees an empty list without this. `'read'` is the only accepted
158
- * value and it never grants writes: `LOCAL_NOTIS_DATABASE_UPSERT_*` stays
159
- * bound to the app's own databases.
160
- */
161
- workspaceDatabases?: 'read';
162
-
163
- /**
164
- * Read a few facts about the user's cloud computer: whether a sandbox exists
165
- * and is running, and whether the GitHub CLI is signed in there.
166
- *
167
- * Without this an app has to infer them — the Workspaces app treated a
168
- * configured repository as proof that `gh auth login` had happened, which
169
- * cannot show an account name and cannot notice a revoked credential.
170
- * `'read'` never creates, resumes or commands a sandbox. Read it with
171
- * `useCloudComputer()`.
172
- *
173
- * `'shell'` additionally asks to command the cloud computer: it unlocks
174
- * `LOCAL_NOTIS_RUN_SANDBOX_SHELL` and the sandbox file tools from this app's
175
- * views (they are denied to every view otherwise), and implies the read
176
- * facts. This is the same authority the user's own agent has on the sandbox,
177
- * so the user is asked for it explicitly at install or in the Store grant
178
- * step; declare it only when the app's core actions genuinely run there.
179
- */
180
- cloudComputer?: 'read' | 'shell';
181
- }
182
-
183
- /**
184
- * Execution hint for a tool whose public name is generated by a provider.
185
- *
186
- * MCP public names may be truncated or deduplicated, so the upstream action
187
- * cannot always be reconstructed from the final `LOCAL_MCP_*` name. Binding
188
- * the two lets the host skip provider schema discovery on direct calls while
189
- * the public name remains the user-approved permission boundary.
190
- */
191
- export interface NotisAppToolBinding {
192
- /** Exact final name also present in `tools`. */
193
- name: string;
194
- /** Exact upstream MCP action name, for example `execute_sql`. */
195
- providerToolName: string;
196
- }
197
-
198
- export interface NotisAppConfig {
199
- /** URL-safe app slug. Existing apps may still use a display name here. */
200
- name: string;
201
- /** Stable local-development slug. Defaults to a slug derived from `name`. */
202
- devSlug?: string;
203
- /** Human display title, Raycast-style. Falls back to `name`. */
204
- title?: string;
205
- description?: string;
206
- /**
207
- * App icon. A `phosphor:<name>` value (e.g. `phosphor:dice-five`) or
208
- * `metadata/icon.png`. When unset, the app shows its two-letter initials.
209
- */
210
- icon?: string;
211
- /**
212
- * Optional accent color for the app avatar. One of {@link NOTIS_APP_ACCENTS}.
213
- * When unset, a stable accent is derived automatically from the app id.
214
- */
215
- accent?: NotisAppAccent;
216
- author?: NotisAppAuthor;
217
- categories?: NotisAppCategory[];
218
- tagline?: string;
219
- /** @deprecated Add release entries to the root CHANGELOG.md instead. */
220
- versionNotes?: string;
221
- /** Editorial screenshot order and capture scenarios for the Store listing. */
222
- screenshots?: NotisAppScreenshotConfig[];
223
- /**
224
- * Databases this app owns. A bare string publishes structure only; use the
225
- * object form to opt a database into shipping its rows to installers.
226
- */
227
- databases?: (string | NotisAppDatabaseConfig)[];
228
- /**
229
- * Extra permissions the app asks for at install time. Everything here widens
230
- * what the app can reach beyond its own data, so each one is surfaced to the
231
- * user before they install.
232
- */
233
- capabilities?: NotisAppCapabilities;
234
- routes?: NotisRouteConfig[];
235
- /**
236
- * Final tool names this app can call at runtime, enforced server-side. Use
237
- * names returned by shared discovery, including native `LOCAL_NOTIS_*`,
238
- * connected-service names such as `GMAIL_SEND_EMAIL`,
239
- * `LOCAL_POSTFORME_*`, and `LOCAL_MCP_<SERVER>_<TOOL>`. App code calls
240
- * each declared name directly with `useTool`; metered calls use the shared
241
- * credit-cap and usage-billing path.
242
- */
243
- tools?: string[];
244
- /** Optional execution bindings for provider-generated tool names. */
245
- toolBindings?: NotisAppToolBinding[];
246
- /** Skills shipped from this app's source tree. */
247
- skills?: NotisAppSkillConfig[];
248
- /** Optional onboarding entrypoint exposed from the app sidebar. */
249
- onboarding?: NotisAppOnboardingConfig;
250
- }
251
-
252
- /**
253
- * Identity function that provides type checking and autocomplete for the
254
- * Notis app configuration. The returned object is read at build time by
255
- * `notis apps build` to generate the manifest.
256
- */
257
- export function defineNotisApp(config: NotisAppConfig): NotisAppConfig {
258
- return config;
259
- }