@notis_ai/cli 0.2.0-beta.102.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +334 -0
  2. package/bin/notis.js +2 -0
  3. package/config/notis_app_boundary_rules.json +50 -0
  4. package/dist/scaffolds/notis-database/CHANGELOG.md +5 -0
  5. package/dist/scaffolds/notis-database/app/globals.css +44 -0
  6. package/dist/scaffolds/notis-database/app/layout.tsx +6 -0
  7. package/dist/scaffolds/notis-database/app/page.tsx +1091 -0
  8. package/dist/scaffolds/notis-database/components/ui/badge.tsx +28 -0
  9. package/dist/scaffolds/notis-database/components/ui/button.tsx +53 -0
  10. package/dist/scaffolds/notis-database/components/ui/card.tsx +56 -0
  11. package/dist/scaffolds/notis-database/components/ui/table.tsx +120 -0
  12. package/dist/scaffolds/notis-database/components.json +20 -0
  13. package/dist/scaffolds/notis-database/index.html +12 -0
  14. package/dist/scaffolds/notis-database/lib/types.ts +134 -0
  15. package/dist/scaffolds/notis-database/lib/utils.ts +6 -0
  16. package/dist/scaffolds/notis-database/metadata/screenshot-1.png +0 -0
  17. package/dist/scaffolds/notis-database/notis.config.ts +26 -0
  18. package/dist/scaffolds/notis-database/package.json +31 -0
  19. package/dist/scaffolds/notis-database/postcss.config.mjs +8 -0
  20. package/dist/scaffolds/notis-database/src/dev-main.tsx +23 -0
  21. package/dist/scaffolds/notis-database/src/mock-runtime.ts +558 -0
  22. package/dist/scaffolds/notis-database/tailwind.config.ts +59 -0
  23. package/dist/scaffolds/notis-database/tsconfig.json +23 -0
  24. package/dist/scaffolds/notis-database/vite.config.ts +22 -0
  25. package/dist/scaffolds/notis-journal/CHANGELOG.md +25 -0
  26. package/dist/scaffolds/notis-journal/app/globals.css +37 -0
  27. package/dist/scaffolds/notis-journal/app/insights/page.tsx +513 -0
  28. package/dist/scaffolds/notis-journal/app/journal-core.tsx +362 -0
  29. package/dist/scaffolds/notis-journal/app/journal-ui.tsx +337 -0
  30. package/dist/scaffolds/notis-journal/app/layout.tsx +6 -0
  31. package/dist/scaffolds/notis-journal/app/page.tsx +485 -0
  32. package/dist/scaffolds/notis-journal/components/ui/badge.tsx +28 -0
  33. package/dist/scaffolds/notis-journal/components/ui/button.tsx +53 -0
  34. package/dist/scaffolds/notis-journal/components/ui/card.tsx +56 -0
  35. package/dist/scaffolds/notis-journal/components.json +20 -0
  36. package/dist/scaffolds/notis-journal/index.html +12 -0
  37. package/dist/scaffolds/notis-journal/lib/utils.ts +6 -0
  38. package/dist/scaffolds/notis-journal/metadata/screenshot-1.png +0 -0
  39. package/dist/scaffolds/notis-journal/metadata/screenshot-2.png +0 -0
  40. package/dist/scaffolds/notis-journal/metadata/screenshot-3.png +0 -0
  41. package/dist/scaffolds/notis-journal/metadata/screenshot-4.png +0 -0
  42. package/dist/scaffolds/notis-journal/metadata/screenshot-5.png +0 -0
  43. package/dist/scaffolds/notis-journal/metadata/screenshot-6.png +0 -0
  44. package/dist/scaffolds/notis-journal/metadata/screenshot-fixtures.json +132 -0
  45. package/dist/scaffolds/notis-journal/notis.config.ts +93 -0
  46. package/dist/scaffolds/notis-journal/package.json +34 -0
  47. package/dist/scaffolds/notis-journal/packages/sdk/package.json +36 -0
  48. package/dist/scaffolds/notis-journal/packages/sdk/src/components/DocumentEditor.tsx +93 -0
  49. package/dist/scaffolds/notis-journal/packages/sdk/src/components/Markdown.tsx +60 -0
  50. package/dist/scaffolds/notis-journal/packages/sdk/src/components/MultiSelectActionBar.tsx +278 -0
  51. package/dist/scaffolds/notis-journal/packages/sdk/src/components/MultiSelectCheckbox.tsx +91 -0
  52. package/dist/scaffolds/notis-journal/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
  53. package/dist/scaffolds/notis-journal/packages/sdk/src/config.ts +145 -0
  54. package/dist/scaffolds/notis-journal/packages/sdk/src/documents.ts +229 -0
  55. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useBackend.ts +41 -0
  56. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useDatabaseSchema.ts +85 -0
  57. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useDocument.ts +78 -0
  58. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useDocuments.ts +121 -0
  59. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useMultiSelect.ts +539 -0
  60. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useNotis.ts +34 -0
  61. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useNotisNavigation.ts +49 -0
  62. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useTool.ts +64 -0
  63. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useTools.ts +56 -0
  64. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useTopBarSearch.ts +73 -0
  65. package/dist/scaffolds/notis-journal/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
  66. package/dist/scaffolds/notis-journal/packages/sdk/src/index.ts +83 -0
  67. package/dist/scaffolds/notis-journal/packages/sdk/src/provider.tsx +43 -0
  68. package/dist/scaffolds/notis-journal/packages/sdk/src/runtime.ts +220 -0
  69. package/dist/scaffolds/notis-journal/packages/sdk/src/styles.css +186 -0
  70. package/dist/scaffolds/notis-journal/packages/sdk/src/ui.ts +15 -0
  71. package/dist/scaffolds/notis-journal/packages/sdk/src/vite.ts +56 -0
  72. package/dist/scaffolds/notis-journal/packages/sdk/tsconfig.json +15 -0
  73. package/dist/scaffolds/notis-journal/postcss.config.mjs +8 -0
  74. package/dist/scaffolds/notis-journal/skills/journal-onboarding/SKILL.md +120 -0
  75. package/dist/scaffolds/notis-journal/src/dev-main.tsx +58 -0
  76. package/dist/scaffolds/notis-journal/src/mock-runtime.ts +197 -0
  77. package/dist/scaffolds/notis-journal/tailwind.config.ts +58 -0
  78. package/dist/scaffolds/notis-journal/tsconfig.json +23 -0
  79. package/dist/scaffolds/notis-journal/vite.config.ts +10 -0
  80. package/dist/scaffolds/notis-notes/CHANGELOG.md +5 -0
  81. package/dist/scaffolds/notis-notes/app/globals.css +3 -0
  82. package/dist/scaffolds/notis-notes/app/layout.tsx +6 -0
  83. package/dist/scaffolds/notis-notes/app/page.tsx +1950 -0
  84. package/dist/scaffolds/notis-notes/components/ui/badge.tsx +28 -0
  85. package/dist/scaffolds/notis-notes/components/ui/button.tsx +53 -0
  86. package/dist/scaffolds/notis-notes/components/ui/card.tsx +56 -0
  87. package/dist/scaffolds/notis-notes/components.json +20 -0
  88. package/dist/scaffolds/notis-notes/lib/utils.ts +6 -0
  89. package/dist/scaffolds/notis-notes/metadata/screenshot-1.png +0 -0
  90. package/dist/scaffolds/notis-notes/notis.config.ts +35 -0
  91. package/dist/scaffolds/notis-notes/package.json +31 -0
  92. package/dist/scaffolds/notis-notes/postcss.config.mjs +8 -0
  93. package/dist/scaffolds/notis-notes/tailwind.config.ts +58 -0
  94. package/dist/scaffolds/notis-notes/tsconfig.json +23 -0
  95. package/dist/scaffolds/notis-notes/vite.config.ts +10 -0
  96. package/dist/scaffolds/notis-random/CHANGELOG.md +5 -0
  97. package/dist/scaffolds/notis-random/README.md +33 -0
  98. package/dist/scaffolds/notis-random/app/globals.css +11 -0
  99. package/dist/scaffolds/notis-random/app/history/page.tsx +66 -0
  100. package/dist/scaffolds/notis-random/app/layout.tsx +7 -0
  101. package/dist/scaffolds/notis-random/app/page.tsx +222 -0
  102. package/dist/scaffolds/notis-random/index.html +12 -0
  103. package/dist/scaffolds/notis-random/lib/notis-tools.ts +109 -0
  104. package/dist/scaffolds/notis-random/lib/rng.ts +42 -0
  105. package/dist/scaffolds/notis-random/lib/roll-record.ts +102 -0
  106. package/dist/scaffolds/notis-random/lib/utils.ts +25 -0
  107. package/dist/scaffolds/notis-random/metadata/screenshot-1.png +0 -0
  108. package/dist/scaffolds/notis-random/metadata/screenshot-2.png +0 -0
  109. package/dist/scaffolds/notis-random/notis.config.ts +42 -0
  110. package/dist/scaffolds/notis-random/package.json +32 -0
  111. package/dist/scaffolds/notis-random/postcss.config.mjs +6 -0
  112. package/dist/scaffolds/notis-random/src/dev-main.tsx +70 -0
  113. package/dist/scaffolds/notis-random/src/mock-runtime.ts +129 -0
  114. package/dist/scaffolds/notis-random/tailwind.config.ts +43 -0
  115. package/dist/scaffolds/notis-random/tsconfig.json +23 -0
  116. package/dist/scaffolds/notis-random/vite.config.ts +11 -0
  117. package/dist/scaffolds.json +47 -0
  118. package/package.json +45 -0
  119. package/skills/notis-apps/SKILL.md +219 -0
  120. package/skills/notis-apps/cli.md +244 -0
  121. package/skills/notis-cli/SKILL.md +269 -0
  122. package/skills/notis-query/cli.md +39 -0
  123. package/src/cli.js +175 -0
  124. package/src/command-specs/apps.js +1939 -0
  125. package/src/command-specs/helpers.js +186 -0
  126. package/src/command-specs/index.js +14 -0
  127. package/src/command-specs/meta.js +161 -0
  128. package/src/command-specs/tools.js +499 -0
  129. package/src/runtime/agent-browser.js +464 -0
  130. package/src/runtime/app-boundary-validator.js +183 -0
  131. package/src/runtime/app-changelog.js +79 -0
  132. package/src/runtime/app-dev-server.js +712 -0
  133. package/src/runtime/app-dev-sessions.js +251 -0
  134. package/src/runtime/app-platform.js +1500 -0
  135. package/src/runtime/assets/store-screenshot-dark.png +0 -0
  136. package/src/runtime/cli-mode.generated.js +4 -0
  137. package/src/runtime/cli-mode.js +29 -0
  138. package/src/runtime/desktop-auth.js +93 -0
  139. package/src/runtime/errors.js +55 -0
  140. package/src/runtime/help.js +60 -0
  141. package/src/runtime/output.js +180 -0
  142. package/src/runtime/ports.js +15 -0
  143. package/src/runtime/profiles.js +261 -0
  144. package/src/runtime/store-screenshot.js +138 -0
  145. package/src/runtime/transport.js +347 -0
  146. package/template/.harness/index.html.tmpl +333 -0
  147. package/template/CHANGELOG.md +5 -0
  148. package/template/app/globals.css +3 -0
  149. package/template/app/layout.tsx +6 -0
  150. package/template/app/page.tsx +60 -0
  151. package/template/components/ui/badge.tsx +28 -0
  152. package/template/components/ui/button.tsx +53 -0
  153. package/template/components/ui/card.tsx +56 -0
  154. package/template/components.json +20 -0
  155. package/template/lib/utils.ts +6 -0
  156. package/template/metadata/screenshot-1.png +0 -0
  157. package/template/metadata/screenshot-2.png +0 -0
  158. package/template/metadata/screenshot-3.png +0 -0
  159. package/template/notis.config.ts +36 -0
  160. package/template/package-lock.json +4137 -0
  161. package/template/package.json +32 -0
  162. package/template/packages/sdk/package.json +36 -0
  163. package/template/packages/sdk/src/components/DocumentEditor.tsx +93 -0
  164. package/template/packages/sdk/src/components/Markdown.tsx +60 -0
  165. package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +278 -0
  166. package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +91 -0
  167. package/template/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
  168. package/template/packages/sdk/src/config.ts +145 -0
  169. package/template/packages/sdk/src/documents.ts +229 -0
  170. package/template/packages/sdk/src/hooks/useBackend.ts +41 -0
  171. package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +85 -0
  172. package/template/packages/sdk/src/hooks/useDocument.ts +78 -0
  173. package/template/packages/sdk/src/hooks/useDocuments.ts +121 -0
  174. package/template/packages/sdk/src/hooks/useMultiSelect.ts +539 -0
  175. package/template/packages/sdk/src/hooks/useNotis.ts +34 -0
  176. package/template/packages/sdk/src/hooks/useNotisNavigation.ts +49 -0
  177. package/template/packages/sdk/src/hooks/useTool.ts +64 -0
  178. package/template/packages/sdk/src/hooks/useTools.ts +56 -0
  179. package/template/packages/sdk/src/hooks/useTopBarSearch.ts +73 -0
  180. package/template/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
  181. package/template/packages/sdk/src/index.ts +83 -0
  182. package/template/packages/sdk/src/provider.tsx +43 -0
  183. package/template/packages/sdk/src/runtime.ts +220 -0
  184. package/template/packages/sdk/src/styles.css +186 -0
  185. package/template/packages/sdk/src/ui.ts +15 -0
  186. package/template/packages/sdk/src/vite.ts +56 -0
  187. package/template/packages/sdk/tsconfig.json +15 -0
  188. package/template/postcss.config.mjs +8 -0
  189. package/template/tailwind.config.ts +58 -0
  190. package/template/tsconfig.json +22 -0
  191. package/template/vite.config.ts +10 -0
@@ -0,0 +1,129 @@
1
+ import type { NotisRuntime } from '@notis/sdk';
2
+
3
+ interface MockDoc {
4
+ id: string;
5
+ title: string;
6
+ properties: Record<string, unknown>;
7
+ icon?: string | null;
8
+ databaseSlug?: string;
9
+ createdAt?: string | null;
10
+ lastEditedTime?: string | null;
11
+ contentBlocknote?: Array<Record<string, unknown>> | null;
12
+ contentMarkdown?: string | null;
13
+ plainText?: string | null;
14
+ }
15
+
16
+ const STATE: Record<string, MockDoc[]> = { rolls: [] };
17
+
18
+ declare global {
19
+ interface Window {
20
+ __NOTIS_RANDOM_RUNTIME__?: NotisRuntime;
21
+ }
22
+ }
23
+
24
+ export function installMockRuntime(initialRoute: 'home' | 'history' = 'home'): NotisRuntime {
25
+ const runtime: NotisRuntime = {
26
+ app: {
27
+ id: 'dev-notis-random',
28
+ name: 'Random Number Generator',
29
+ icon: 'phosphor:dice-five',
30
+ description: 'Dev preview — data is in-memory only.',
31
+ },
32
+ route: currentRoute(initialRoute),
33
+ databases: [],
34
+ context: {},
35
+
36
+ listTools: async () => [
37
+ {
38
+ name: 'LOCAL_NOTIS_DATABASE_QUERY',
39
+ inputSchema: { type: 'object', properties: { database_slug: { type: 'string' } } },
40
+ },
41
+ {
42
+ name: 'LOCAL_NOTIS_DATABASE_UPSERT_ROLLS',
43
+ inputSchema: { type: 'object', properties: {} },
44
+ },
45
+ ],
46
+ callTool: async <TResult = unknown>(name: string, args?: Record<string, unknown>): Promise<TResult> => {
47
+ if (name === 'LOCAL_NOTIS_DATABASE_QUERY') {
48
+ const request = args ?? {};
49
+ const databaseSlug = typeof request.database_slug === 'string' ? request.database_slug : 'rolls';
50
+ const query = request.query && typeof request.query === 'object'
51
+ ? request.query as Record<string, unknown>
52
+ : {};
53
+ const offset = typeof request.offset === 'number' ? request.offset : 0;
54
+ const all = STATE[databaseSlug] ?? [];
55
+ const sliced = all.slice(offset);
56
+ const pageSize = typeof query.page_size === 'number' ? query.page_size : undefined;
57
+ return { documents: typeof pageSize === 'number' ? sliced.slice(0, pageSize) : sliced } as TResult;
58
+ }
59
+
60
+ if (name === 'LOCAL_NOTIS_DATABASE_UPSERT_ROLLS') {
61
+ const request = args ?? {};
62
+ const docs = STATE.rolls ?? [];
63
+ const now = new Date().toISOString();
64
+ const documentId = typeof request.document_id === 'string' ? request.document_id : undefined;
65
+ const existing = documentId ? docs.find((d) => d.id === documentId) : undefined;
66
+ const controlKeys = new Set(['document_id', 'title']);
67
+ const properties = Object.fromEntries(
68
+ Object.entries(request).filter(([key]) => !controlKeys.has(key)),
69
+ );
70
+ const doc: MockDoc = {
71
+ id: existing?.id ?? `dev-rolls-${Date.now()}`,
72
+ title: typeof request.title === 'string' ? request.title : existing?.title ?? 'Untitled',
73
+ properties: { ...(existing?.properties ?? {}), ...properties },
74
+ databaseSlug: 'rolls',
75
+ icon: null,
76
+ createdAt: existing?.createdAt ?? now,
77
+ lastEditedTime: now,
78
+ };
79
+ if (existing) docs[docs.indexOf(existing)] = doc;
80
+ else docs.unshift(doc);
81
+ STATE.rolls = docs;
82
+ return { status: 'success', document: doc } as TResult;
83
+ }
84
+
85
+ throw new Error(`Tool calls unavailable in dev preview (${name}).`);
86
+ },
87
+
88
+ request: async () => {
89
+ throw new Error('Backend requests unavailable in dev preview.');
90
+ },
91
+ };
92
+
93
+ window.__NOTIS_RANDOM_RUNTIME__ = runtime;
94
+ return runtime;
95
+ }
96
+
97
+ export function setMockRoute(route: 'home' | 'history') {
98
+ if (window.__NOTIS_RANDOM_RUNTIME__) {
99
+ window.__NOTIS_RANDOM_RUNTIME__.route = currentRoute(route);
100
+ }
101
+ }
102
+
103
+ function currentRoute(route: 'home' | 'history') {
104
+ if (route === 'history') {
105
+ return {
106
+ slug: 'history',
107
+ path: '/history',
108
+ name: 'History',
109
+ icon: null,
110
+ parentSlug: null,
111
+ default: false,
112
+ collection: {
113
+ database: 'rolls',
114
+ titleProperty: 'Value',
115
+ parentProperty: null,
116
+ sidebar: { mode: 'flat-list' as const, allowCreate: false },
117
+ },
118
+ };
119
+ }
120
+ return {
121
+ slug: 'home',
122
+ path: '/',
123
+ name: 'Generator',
124
+ icon: 'phosphor:sparkle',
125
+ parentSlug: null,
126
+ default: true,
127
+ collection: null,
128
+ };
129
+ }
@@ -0,0 +1,43 @@
1
+ import type { Config } from 'tailwindcss';
2
+ import tailwindAnimate from 'tailwindcss-animate';
3
+
4
+ const config: Config = {
5
+ darkMode: ['class'],
6
+ content: ['./app/**/*.{ts,tsx}', './lib/**/*.{ts,tsx}'],
7
+ theme: {
8
+ extend: {
9
+ colors: {
10
+ border: 'hsl(var(--border))',
11
+ background: 'hsl(var(--background))',
12
+ foreground: 'hsl(var(--foreground))',
13
+ muted: {
14
+ DEFAULT: 'hsl(var(--muted))',
15
+ foreground: 'hsl(var(--muted-foreground))',
16
+ },
17
+ primary: {
18
+ DEFAULT: 'hsl(var(--primary))',
19
+ foreground: 'hsl(var(--primary-foreground))',
20
+ },
21
+ accent: {
22
+ DEFAULT: 'hsl(var(--accent))',
23
+ foreground: 'hsl(var(--accent-foreground))',
24
+ },
25
+ card: {
26
+ DEFAULT: 'hsl(var(--card))',
27
+ foreground: 'hsl(var(--card-foreground))',
28
+ },
29
+ },
30
+ borderRadius: {
31
+ lg: 'var(--radius)',
32
+ md: 'calc(var(--radius) - 2px)',
33
+ sm: 'calc(var(--radius) - 4px)',
34
+ },
35
+ fontFamily: {
36
+ mono: ['ui-monospace', 'SFMono-Regular', 'Menlo', 'monospace'],
37
+ },
38
+ },
39
+ },
40
+ plugins: [tailwindAnimate],
41
+ };
42
+
43
+ export default config;
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "preserveSymlinks": true,
13
+ "resolveJsonModule": true,
14
+ "isolatedModules": true,
15
+ "jsx": "react-jsx",
16
+ "types": ["vite/client", "node"],
17
+ "paths": {
18
+ "@/*": ["./*"]
19
+ }
20
+ },
21
+ "include": ["**/*.ts", "**/*.tsx"],
22
+ "exclude": ["node_modules", "dist"]
23
+ }
@@ -0,0 +1,11 @@
1
+ import { notisViteConfig } from '@notis/sdk/vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import { defineConfig, type UserConfig } from 'vite';
4
+ import appConfig from './notis.config';
5
+
6
+ const libConfig = notisViteConfig(appConfig) as unknown as UserConfig;
7
+
8
+ export default defineConfig({
9
+ ...libConfig,
10
+ plugins: [react(), ...((libConfig.plugins as UserConfig['plugins']) ?? [])],
11
+ });
@@ -0,0 +1,47 @@
1
+ {
2
+ "source": "apps/*/notis.config.ts",
3
+ "scaffolds": [
4
+ {
5
+ "slug": "notis-database",
6
+ "name": "Databases",
7
+ "description": "Read-only catalog and schema explorer for every database in your Notis workspace.",
8
+ "icon": "phosphor:database",
9
+ "categories": [
10
+ "Product & Engineering",
11
+ "Operations"
12
+ ],
13
+ "tagline": "Explore every database and schema in your Notis workspace."
14
+ },
15
+ {
16
+ "slug": "notis-journal",
17
+ "name": "5 Minutes Journal",
18
+ "description": "A display-only five-minute journal built from your morning and evening check-ins with Notis. Browse daily mood, energy, motivation, gratitude, intentions, affirmations, highlights, lessons, and free-form reflections, then use Stats to see trends and ritual consistency over time.",
19
+ "icon": "phosphor:notebook",
20
+ "categories": [
21
+ "Personal",
22
+ "Productivity"
23
+ ],
24
+ "tagline": "Five intentional minutes with Notis, split between morning and evening."
25
+ },
26
+ {
27
+ "slug": "notis-notes",
28
+ "name": "Notis Notes",
29
+ "description": "Browse notes by documents, table, or calendar with folders in the sidebar.",
30
+ "icon": "phosphor:note-pencil",
31
+ "categories": [
32
+ "Productivity"
33
+ ],
34
+ "tagline": "Folder-based notes with gallery, table, and calendar views."
35
+ },
36
+ {
37
+ "slug": "notis-random",
38
+ "name": "Random Number Generator",
39
+ "description": "Generate random numbers with configurable bounds, and keep a history of everything you rolled.",
40
+ "icon": "phosphor:dice-five",
41
+ "categories": [
42
+ "Personal"
43
+ ],
44
+ "tagline": "Roll dice, keep history."
45
+ }
46
+ ]
47
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@notis_ai/cli",
3
+ "version": "0.2.0-beta.102.1",
4
+ "description": "Agent-first Notis CLI for apps and generic tool execution",
5
+ "type": "module",
6
+ "bin": {
7
+ "notis": "bin/notis.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "config/",
12
+ "dist/",
13
+ "src/",
14
+ "skills/",
15
+ "template/",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "node ./scripts/build-scaffolds.js",
20
+ "docs:generate": "node ./scripts/generate-docs.js",
21
+ "docs:check": "node ./scripts/generate-docs.js --check",
22
+ "prepack": "npm run build",
23
+ "release:prepare": "npm run build && node ./scripts/prepare-publish.js --apply",
24
+ "cli:set-mode": "node ./scripts/set-cli-mode.js",
25
+ "smoke": "node ./scripts/smoke-package.js",
26
+ "test": "node --test"
27
+ },
28
+ "engines": {
29
+ "node": ">=18.0.0"
30
+ },
31
+ "dependencies": {
32
+ "commander": "^12.0.0",
33
+ "sharp": "^0.34.5"
34
+ },
35
+ "keywords": [
36
+ "notis",
37
+ "cli",
38
+ "ai",
39
+ "agent-skills"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "license": "MIT"
45
+ }
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: notis-apps
3
+ description: Design and package Notis apps. Use when users want an app that groups databases, routes, documents, automations, and skills into one installable Notis product.
4
+ ---
5
+
6
+ # Notis Apps Skill
7
+
8
+ Use this skill when the user wants to create, edit, debug, or package a Notis app. Notis apps are Vite + React projects that deploy into the Notis Portal as installed apps for the current user or team.
9
+
10
+ Run the Notis CLI through NPX, for example `npx --package @notis_ai/cli@latest -- notis apps list`. Notis Desktop keeps the CLI auth profile current. This `notis-apps` skill is delivered through normal Notis skill sync for the signed-in user, alongside other curated skills.
11
+
12
+ ## Platform Model
13
+
14
+ A Notis app is:
15
+
16
+ - a Vite + React project
17
+ - built with `@notis/sdk`
18
+ - configured through `notis.config.ts`
19
+ - packaged as an ES module bundle with `app.js`, `app.css`, and `manifest.json`
20
+ - rendered by the Notis Portal as a React component, not an iframe
21
+ - connected to Notis data and tools through the Portal-provided runtime and SDK hooks
22
+
23
+ Use the Notis CLI for the app lifecycle:
24
+
25
+ ```bash
26
+ npx --package @notis_ai/cli@latest -- notis apps init
27
+ npx --package @notis_ai/cli@latest -- notis apps dev
28
+ npx --package @notis_ai/cli@latest -- notis apps build
29
+ npx --package @notis_ai/cli@latest -- notis apps screenshot
30
+ npx --package @notis_ai/cli@latest -- notis apps verify
31
+ npx --package @notis_ai/cli@latest -- notis apps create
32
+ npx --package @notis_ai/cli@latest -- notis apps link
33
+ npx --package @notis_ai/cli@latest -- notis apps pull
34
+ npx --package @notis_ai/cli@latest -- notis apps deploy
35
+ npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
36
+ npx --package @notis_ai/cli@latest -- notis apps doctor
37
+ ```
38
+
39
+ Use this command form everywhere:
40
+
41
+ ```bash
42
+ npx --package @notis_ai/cli@latest -- notis apps ...
43
+ ```
44
+
45
+ ## Hard Rules
46
+
47
+ - Use React + Vite only. Do not use Next.js or a custom server for app projects.
48
+ - Build standard pages in `app/`. Do not write raw `views/<slug>/index.js` files.
49
+ - Keep navigation in `notis.config.ts` `routes`; each route needs a stable `slug`.
50
+ - Reference existing databases by slug in `notis.config.ts`; do not assume deploy creates databases automatically.
51
+ - Declare runtime tool access in `notis.config.ts` `tools`.
52
+ - Use `@notis/sdk` hooks instead of direct runtime access.
53
+ - Do not rely on `window.__NOTIS_RUNTIME__` or portal-owned DOM hooks.
54
+ - `npx --package @notis_ai/cli@latest -- notis apps deploy` updates an installed app. It does not publish to the public App Store.
55
+ - **Local development first; deploy is user-gated.** Iterate with `apps dev` and hand off for the **user** to test in the desktop **Local development** sidebar group. Do not run `apps create` / `apps deploy` on your own — a clean build/verify is not permission to deploy. Deploy only when the user has tested the local build and explicitly asks. Finishing a build without deploying is the expected outcome.
56
+ - **Installed app links are explicit.** A mounted dev session updates an installed app only when the checkout is linked by app id in `.notis/state.json` and the active dev-session registry mirrors that id. Name or slug matches may be suggestions, never update targets.
57
+ - **Store submission is separately user-gated.** Run `apps publish --confirm-ready` only after the user explicitly confirms the current App Details page is ready. Deploy that exact approved state first; never infer Store approval from a deploy request.
58
+ - **Bump `notisAppVersion` for every Store update.** `package.json` must contain a semver `notisAppVersion`; increment it beyond the currently published registry version before deploying an update.
59
+ - **Keep release history in one root `CHANGELOG.md`.** Put the newest entry first and use `## [Release title] - YYYY-MM-DD`, or `{PR_MERGE_DATE}` before publication. Do not add new `versionNotes` fields to `notis.config.ts`. App Details reads **What’s New** and **Version History** from the deployed package manifest; the Store reads the latest published snapshot, so unpublished workspace edits never change it. The manifest exposes `package.json` `notisAppVersion` as the package version shown in App Details.
60
+ - Public submissions still use the registry review flow; the CLI invokes the same authenticated submission endpoint as App Details.
61
+ - Use Phosphor icon names with the `phosphor:` prefix. Do not use emoji icons.
62
+ - Prefer scaffolded shadcn components and portal theme tokens over custom visual systems.
63
+
64
+ ## App Workflow
65
+
66
+ 1. Discover existing apps if needed:
67
+
68
+ ```bash
69
+ npx --package @notis_ai/cli@latest -- notis apps list
70
+ ```
71
+
72
+ 2. Start from a scaffold or pull an existing app:
73
+
74
+ ```bash
75
+ npx --package @notis_ai/cli@latest -- notis apps scaffolds list
76
+ npx --package @notis_ai/cli@latest -- notis apps init "My App"
77
+ npx --package @notis_ai/cli@latest -- notis apps pull <app-id> ./my-app
78
+ ```
79
+
80
+ 3. Install dependencies and develop. Keep `apps dev` running and **hand off to the user** — it is what surfaces the app in the desktop **Local development** sidebar group, and letting the user test there is the finish line for a build request:
81
+
82
+ ```bash
83
+ npm install
84
+ npx --package @notis_ai/cli@latest -- notis apps dev
85
+ ```
86
+
87
+ The desktop lists a dev app only if its session is in the per-workspace registry it polls: `<workspace>/.context/app-dev-sessions.json`. A current CLI auto-resolves the nearest `.context` registry; on older CLIs (or when launched outside the workspace), pass `NOTIS_APP_DEV_SESSIONS_FILE="$CONDUCTOR_WORKSPACE_PATH/.context/app-dev-sessions.json"`. After starting, confirm your app's `devSlug` is in that file with a fresh `lastHeartbeatAt` — if it isn't, the session landed in the global `~/.notis` registry and the app won't appear in the sidebar.
88
+
89
+ 4. Build, capture listing screenshots, and verify (still local — this does not deploy):
90
+
91
+ ```bash
92
+ npx --package @notis_ai/cli@latest -- notis apps build
93
+ npx --package @notis_ai/cli@latest -- notis apps screenshot
94
+ npx --package @notis_ai/cli@latest -- notis apps verify
95
+ ```
96
+
97
+ Declare 3–6 screenshots in `notis.config.ts`, each with a `path`, descriptive
98
+ `alt`, and optional `route`/`scenario`/`focus`/`theme`. Use `focus` to crop to a
99
+ real app root instead of empty browser canvas, and use `theme: 'light'` or
100
+ `theme: 'dark'` for a matching Portal render and Store frame. Paired light/dark
101
+ entries may reuse the same route and scenario. `notis apps screenshot` renders
102
+ those configured states in a headless harness and writes exact 2000x1250 PNGs
103
+ under `metadata/`, using the deterministic Store presentation by default. Use
104
+ `--raw` only for an unframed diagnostic capture. Apps are icon-led like Raycast:
105
+ the app icon represents the app everywhere, so there is no cover image — only
106
+ these screenshots. Re-run after changing routes or UI; it overwrites the set and
107
+ drops stale files. Use `--routes home,history` to capture a subset.
108
+
109
+ 5. **Only after the user has tested the local build and explicitly asks to deploy**, create or link the remote app, then deploy (this installs or updates the app on the user's account, where it appears under **Workspace** rather than Local development). After first install, keep `.notis/state.json` linked to that installed app id so future dev-session actions become **Update** instead of another **Install**:
110
+
111
+ ```bash
112
+ npx --package @notis_ai/cli@latest -- notis apps create "My App" .
113
+ npx --package @notis_ai/cli@latest -- notis apps deploy
114
+ ```
115
+
116
+ 6. **Only after the user explicitly confirms App Details is ready for Store review**, submit the deployed version:
117
+
118
+ ```bash
119
+ npx --package @notis_ai/cli@latest -- notis apps publish --confirm-ready
120
+ ```
121
+
122
+ or:
123
+
124
+ ```bash
125
+ npx --package @notis_ai/cli@latest -- notis apps link <app-id>
126
+ npx --package @notis_ai/cli@latest -- notis apps deploy
127
+ ```
128
+
129
+ ## App Structure
130
+
131
+ Expected project shape:
132
+
133
+ ```text
134
+ notis.config.ts
135
+ CHANGELOG.md # complete Store release history, newest entry first
136
+ vite.config.ts
137
+ app/
138
+ components/
139
+ metadata/ # screenshot-N.png only — generated by `notis apps screenshot`
140
+ .notis/output/
141
+ ```
142
+
143
+ `metadata/` holds 3–6 listing screenshots (`screenshot-1.png`, `screenshot-2.png`,
144
+ …). Each must be an exact 2000x1250 PNG no larger than 2 MB, with descriptive
145
+ alt text declared in `notis.config.ts`. There is no `cover.png`: apps are icon-led like Raycast and the icon set in
146
+ `notis.config.ts` represents the app in the Store. Generate screenshots with
147
+ `notis apps screenshot` rather than authoring PNGs by hand.
148
+
149
+ `notis.config.ts` owns:
150
+
151
+ - app metadata: name, title, description, icon, accent, categories, tagline
152
+ - listing screenshots: stable path, alt text, and optional capture route/scenario/focus/theme
153
+ - database slug references
154
+ - route definitions
155
+ - tool access
156
+
157
+ `CHANGELOG.md` owns Store release copy. Keep all releases in that single file:
158
+
159
+ ```markdown
160
+ # My App Changelog
161
+
162
+ ## [A Better Workflow] - {PR_MERGE_DATE}
163
+
164
+ - Added a faster daily workflow.
165
+
166
+ ## [Initial Release] - 2026-07-01
167
+
168
+ - Published the first version.
169
+ ```
170
+
171
+ Store publication is blocked until the deployed manifest contains at least one
172
+ valid entry. Ordinary local development and deployment still work when an app
173
+ is not being prepared for the Store.
174
+
175
+ **Icon & accent.** Set `icon` to a `phosphor:<name>` value (e.g. `phosphor:dice-five`) or `metadata/icon.png`. When `icon` is unset, the app shows its **two-letter initials** everywhere (store, sidebar, app details). `accent` optionally pins the avatar color to one of `blue | violet | emerald | amber | rose | sky | fuchsia | teal`; when unset a stable color is derived automatically from the app id. Both flow from `notis.config.ts` through deploy onto the app row and listing, and can also be changed later with the `update_app` tool (`{ "icon": "phosphor:...", "accent": "emerald" }`).
176
+
177
+ Example:
178
+
179
+ ```ts
180
+ import { defineNotisApp } from '@notis/sdk/config';
181
+
182
+ export default defineNotisApp({
183
+ name: 'my-app',
184
+ title: 'My App',
185
+ description: 'A focused Notis app.',
186
+ icon: 'phosphor:squares-four',
187
+ accent: 'blue',
188
+ databases: ['tasks'],
189
+ routes: [
190
+ {
191
+ path: '/',
192
+ slug: 'tasks',
193
+ name: 'Tasks',
194
+ icon: 'phosphor:check-square',
195
+ default: true,
196
+ },
197
+ ],
198
+ tools: ['LOCAL_NOTIS_DATABASE_QUERY', 'LOCAL_NOTIS_DATABASE_UPSERT_TASKS'],
199
+ });
200
+ ```
201
+
202
+ ## Runtime Usage
203
+
204
+ Use SDK hooks for data and tool access:
205
+
206
+ ```tsx
207
+ import { useTool } from '@notis/sdk';
208
+
209
+ const query = useTool('LOCAL_NOTIS_DATABASE_QUERY');
210
+ ```
211
+
212
+ Do not fetch Notis backend endpoints directly from app code unless the SDK explicitly requires it. The Portal provides authentication, runtime context, and route rendering.
213
+
214
+ ## Troubleshooting
215
+
216
+ - If deploy fails with backend connectivity errors, run `npx --package @notis_ai/cli@latest -- notis apps doctor` and check the configured API base.
217
+ - If editing an existing app, use `npx --package @notis_ai/cli@latest -- notis apps pull <app-id>` when source snapshots are available.
218
+ - If the Portal shows a stale bundle, hard refresh the Portal or deploy a new version.
219
+ - If an app route fails to load, run `npx --package @notis_ai/cli@latest -- notis apps verify` and inspect `.notis/output/manifest.json`.