@notis_ai/cli 0.2.0-beta.16.1 → 0.2.0-beta.161.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 (161) hide show
  1. package/README.md +435 -133
  2. package/bin/check-runtime.js +15 -0
  3. package/bin/notis.js +2 -0
  4. package/config/notis_app_boundary_rules.json +50 -0
  5. package/config/notis_app_design_rules.json +135 -0
  6. package/dist/agent-hooks/notis-agent-hook.mjs +19008 -0
  7. package/dist/base-skills/notis-apps/SKILL.md +70 -0
  8. package/dist/base-skills/notis-apps/references/architecture.md +164 -0
  9. package/dist/base-skills/notis-apps/references/context.md +81 -0
  10. package/dist/base-skills/notis-apps/references/design.md +165 -0
  11. package/dist/base-skills/notis-apps/references/reading.md +89 -0
  12. package/dist/base-skills/notis-apps/references/release.md +99 -0
  13. package/dist/base-skills/notis-apps/references/sdk.md +62 -0
  14. package/dist/base-skills/notis-apps/references/troubleshooting.md +23 -0
  15. package/dist/base-skills/notis-cli/SKILL.md +140 -0
  16. package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
  17. package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
  18. package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
  19. package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
  20. package/dist/base-skills/notis-query/SKILL.md +67 -0
  21. package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
  22. package/dist/base-skills/notis-query/references/documents.md +50 -0
  23. package/dist/base-skills/notis-query/references/query.md +543 -0
  24. package/dist/skill-sync/index.js +1626 -0
  25. package/dist/skill-sync/index.js.map +7 -0
  26. package/dist/skill-sync-worker.mjs +2990 -0
  27. package/package.json +18 -7
  28. package/skills/notis-apps/cli.md +313 -0
  29. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
  30. package/skills/notis-onboarding/BRIEF.md +129 -0
  31. package/skills/notis-query/cli.md +39 -0
  32. package/src/agent-hook-entry.js +5 -0
  33. package/src/cli.js +294 -25
  34. package/src/command-specs/agents.js +392 -0
  35. package/src/command-specs/apps.js +1470 -202
  36. package/src/command-specs/auth.js +114 -137
  37. package/src/command-specs/diagnostics.js +729 -0
  38. package/src/command-specs/handover.js +374 -0
  39. package/src/command-specs/helpers.js +84 -82
  40. package/src/command-specs/index.js +25 -6
  41. package/src/command-specs/meta.js +150 -18
  42. package/src/command-specs/onboarding.js +290 -0
  43. package/src/command-specs/profile.js +358 -0
  44. package/src/command-specs/reports.js +86 -0
  45. package/src/command-specs/skills.js +75 -0
  46. package/src/command-specs/smoke.js +386 -0
  47. package/src/command-specs/tools.js +455 -139
  48. package/src/runtime/agent-browser.js +632 -0
  49. package/src/runtime/agent-memory-state.js +126 -0
  50. package/src/runtime/agent-setup.js +383 -0
  51. package/src/runtime/app-boundary-validator.js +404 -0
  52. package/src/runtime/app-changelog.js +79 -0
  53. package/src/runtime/app-platform.js +2633 -210
  54. package/src/runtime/app-registry-scaffolds.js +367 -0
  55. package/src/runtime/app-test-server.js +292 -0
  56. package/src/runtime/assets/store-screenshot-dark.png +0 -0
  57. package/src/runtime/auth-recovery.js +110 -0
  58. package/src/runtime/base-skills.d.ts +20 -0
  59. package/src/runtime/base-skills.js +167 -0
  60. package/src/runtime/channel.js +133 -0
  61. package/src/runtime/delegated-context.js +68 -0
  62. package/src/runtime/errors.js +1 -0
  63. package/src/runtime/git.js +233 -0
  64. package/src/runtime/login-listener.js +15 -0
  65. package/src/runtime/oauth.js +2622 -0
  66. package/src/runtime/output.js +37 -5
  67. package/src/runtime/ports.js +31 -0
  68. package/src/runtime/profiles.js +906 -55
  69. package/src/runtime/skill-sync/cloud-client.ts +99 -0
  70. package/src/runtime/skill-sync/index.ts +697 -0
  71. package/src/runtime/skill-sync/local-scanner.ts +1046 -0
  72. package/src/runtime/skill-sync/symlink-manager.ts +433 -0
  73. package/src/runtime/skill-sync/sync-plan.ts +22 -0
  74. package/src/runtime/skill-sync/types.ts +110 -0
  75. package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
  76. package/src/runtime/skill-sync-service.js +109 -0
  77. package/src/runtime/store-screenshot.js +143 -0
  78. package/src/runtime/sync-skills.d.ts +37 -0
  79. package/src/runtime/sync-skills.js +231 -0
  80. package/src/runtime/telemetry.js +92 -0
  81. package/src/runtime/transport.js +324 -45
  82. package/src/skill-sync-worker-entry.js +2 -0
  83. package/src/skill-sync-worker.js +50 -0
  84. package/template/.harness/index.html.tmpl +430 -0
  85. package/template/CHANGELOG.md +5 -0
  86. package/template/app/globals.css +28 -3
  87. package/template/app/layout.tsx +6 -3
  88. package/template/app/page.tsx +49 -42
  89. package/template/components/page-heading.tsx +23 -0
  90. package/template/components/ui/badge.tsx +7 -4
  91. package/template/components/ui/button.tsx +1 -1
  92. package/template/components/ui/card.tsx +24 -11
  93. package/template/components/ui/native-select.tsx +24 -0
  94. package/template/notis.config.ts +24 -6
  95. package/template/package-lock.json +3642 -0
  96. package/template/package.json +19 -16
  97. package/template/packages/{notis-sdk → sdk}/package.json +14 -4
  98. package/template/packages/sdk/src/agentContext.ts +36 -0
  99. package/template/packages/sdk/src/components/DocumentEditor.tsx +103 -0
  100. package/template/packages/sdk/src/components/Markdown.tsx +60 -0
  101. package/template/packages/sdk/src/components/MarkdownEditor.tsx +121 -0
  102. package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +285 -0
  103. package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +97 -0
  104. package/template/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
  105. package/template/packages/sdk/src/components/NotisCommentBoundary.tsx +172 -0
  106. package/template/packages/sdk/src/components/NotisSelectionBoundary.tsx +59 -0
  107. package/template/packages/sdk/src/components/ShortcutHints.tsx +56 -0
  108. package/template/packages/sdk/src/components/Skeleton.tsx +24 -0
  109. package/template/packages/sdk/src/config.ts +257 -0
  110. package/template/packages/sdk/src/documents.ts +256 -0
  111. package/template/packages/sdk/src/hooks/useActiveResource.ts +19 -0
  112. package/template/packages/sdk/src/hooks/useAgentContext.ts +23 -0
  113. package/template/packages/sdk/src/hooks/useCloudComputer.ts +64 -0
  114. package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +836 -0
  115. package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +49 -0
  116. package/template/packages/sdk/src/hooks/useDatabaseSubscription.ts +76 -0
  117. package/template/packages/sdk/src/hooks/useDocument.ts +43 -0
  118. package/template/packages/sdk/src/hooks/useDocuments.ts +84 -0
  119. package/template/packages/sdk/src/hooks/useHandover.ts +78 -0
  120. package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
  121. package/template/packages/sdk/src/hooks/useMultiSelect.ts +95 -0
  122. package/template/packages/{notis-sdk → sdk}/src/hooks/useNotis.ts +10 -4
  123. package/template/packages/{notis-sdk → sdk}/src/hooks/useNotisNavigation.ts +11 -8
  124. package/template/packages/sdk/src/hooks/useQuery.ts +71 -0
  125. package/template/packages/sdk/src/hooks/useTool.ts +65 -0
  126. package/template/packages/sdk/src/hooks/useToolQuery.ts +12 -0
  127. package/template/packages/sdk/src/hooks/useTopBarSearch.ts +81 -0
  128. package/template/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
  129. package/template/packages/sdk/src/index.ts +161 -0
  130. package/template/packages/sdk/src/interactions/actions.ts +59 -0
  131. package/template/packages/sdk/src/interactions/shortcuts.tsx +694 -0
  132. package/template/packages/sdk/src/interactions/visibility.ts +13 -0
  133. package/template/packages/sdk/src/interactions.ts +45 -0
  134. package/template/packages/sdk/src/provider.tsx +44 -0
  135. package/template/packages/sdk/src/queryCache.ts +170 -0
  136. package/template/packages/sdk/src/runtime.ts +451 -0
  137. package/template/packages/sdk/src/styles.css +247 -0
  138. package/template/packages/sdk/src/tailwind.ts +66 -0
  139. package/template/packages/sdk/src/vite.ts +73 -0
  140. package/template/packages/{notis-sdk → sdk}/tsconfig.json +1 -0
  141. package/template/postcss.config.mjs +1 -1
  142. package/template/tailwind.config.ts +1 -6
  143. package/template/tsconfig.json +1 -0
  144. package/src/command-specs/db.js +0 -163
  145. package/src/runtime/app-preview-server.js +0 -312
  146. package/template/packages/notis-sdk/src/config.ts +0 -48
  147. package/template/packages/notis-sdk/src/helpers.ts +0 -131
  148. package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
  149. package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
  150. package/template/packages/notis-sdk/src/hooks/useDatabase.ts +0 -87
  151. package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
  152. package/template/packages/notis-sdk/src/hooks/useTool.ts +0 -49
  153. package/template/packages/notis-sdk/src/hooks/useUpsertDocument.ts +0 -57
  154. package/template/packages/notis-sdk/src/index.ts +0 -47
  155. package/template/packages/notis-sdk/src/provider.tsx +0 -44
  156. package/template/packages/notis-sdk/src/runtime.ts +0 -159
  157. package/template/packages/notis-sdk/src/styles.css +0 -123
  158. package/template/packages/notis-sdk/src/vite.ts +0 -54
  159. /package/template/packages/{notis-sdk → sdk}/src/hooks/useBackend.ts +0 -0
  160. /package/template/packages/{notis-sdk → sdk}/src/hooks/useTools.ts +0 -0
  161. /package/template/packages/{notis-sdk → sdk}/src/ui.ts +0 -0
@@ -1,159 +0,0 @@
1
- /**
2
- * NotisRuntime is the bridge between app code running in the browser and the
3
- * Notis platform. It is injected as `window.__NOTIS_RUNTIME__` into every app
4
- * page -- both in local preview (with mock implementations) and in the portal
5
- * (with real server-backed implementations).
6
- *
7
- * App code should never access `window.__NOTIS_RUNTIME__` directly. Instead,
8
- * use the hooks from `@notis/sdk` (useDatabase, useTool, etc.) which read
9
- * from the NotisProvider context.
10
- */
11
-
12
- // ---------------------------------------------------------------------------
13
- // Database types
14
- // ---------------------------------------------------------------------------
15
-
16
- export interface DatabaseProperty {
17
- name: string;
18
- type: 'title' | 'rich_text' | 'number' | 'checkbox' | 'date' | 'select' | 'multi_select' | 'status' | 'relation' | 'formula' | 'files';
19
- description?: string;
20
- options?: Array<{ name: string; id?: string }>;
21
- }
22
-
23
- export interface DatabaseDescriptor {
24
- slug: string;
25
- title: string;
26
- description?: string | null;
27
- icon?: string | null;
28
- properties: DatabaseProperty[];
29
- }
30
-
31
- export interface DocumentRecord {
32
- id: string;
33
- title: string;
34
- properties: Record<string, unknown>;
35
- icon?: string | null;
36
- databaseSlug?: string;
37
- }
38
-
39
- // ---------------------------------------------------------------------------
40
- // Tool types
41
- // ---------------------------------------------------------------------------
42
-
43
- export interface ToolDescriptor {
44
- name: string;
45
- description?: string;
46
- input_schema?: Record<string, unknown>;
47
- }
48
-
49
- // ---------------------------------------------------------------------------
50
- // Route types
51
- // ---------------------------------------------------------------------------
52
-
53
- export interface RouteDescriptor {
54
- slug: string;
55
- path: string;
56
- name: string;
57
- icon?: string | null;
58
- default?: boolean;
59
- collection?: {
60
- database: string;
61
- titleProperty: string;
62
- } | null;
63
- }
64
-
65
- export interface CollectionItem {
66
- id: string;
67
- title: string;
68
- icon?: string | null;
69
- }
70
-
71
- // ---------------------------------------------------------------------------
72
- // App descriptor
73
- // ---------------------------------------------------------------------------
74
-
75
- export interface AppDescriptor {
76
- id: string;
77
- name: string;
78
- icon?: string | null;
79
- description?: string | null;
80
- }
81
-
82
- // ---------------------------------------------------------------------------
83
- // Query types
84
- // ---------------------------------------------------------------------------
85
-
86
- export interface QueryFilter {
87
- filters?: Array<{
88
- property: string;
89
- operator: string;
90
- value: unknown;
91
- }>;
92
- sorts?: Array<{
93
- property: string;
94
- direction: 'asc' | 'desc';
95
- }>;
96
- page_size?: number;
97
- }
98
-
99
- // ---------------------------------------------------------------------------
100
- // NotisRuntime -- the window.__NOTIS_RUNTIME__ contract
101
- // ---------------------------------------------------------------------------
102
-
103
- export interface NotisRuntime {
104
- app: AppDescriptor;
105
- route: RouteDescriptor;
106
- databases: DatabaseDescriptor[];
107
-
108
- navigate?: (payload: { kind: string; [key: string]: unknown }) => void;
109
-
110
- listTools(): Promise<ToolDescriptor[]>;
111
- callTool(name: string, args?: Record<string, unknown>): Promise<unknown>;
112
-
113
- queryDatabase(args: {
114
- databaseSlug: string;
115
- query?: QueryFilter;
116
- offset?: number;
117
- }): Promise<{ documents: DocumentRecord[] }>;
118
-
119
- getDocument(args: {
120
- documentId: string;
121
- }): Promise<DocumentRecord>;
122
-
123
- upsertDocument(args: {
124
- databaseSlug: string;
125
- documentId?: string;
126
- title?: string;
127
- properties?: Record<string, unknown>;
128
- }): Promise<{ status: string; document: DocumentRecord }>;
129
-
130
- listCollectionItems(args?: {
131
- databaseSlug?: string;
132
- pageSize?: number;
133
- }): Promise<{ items: CollectionItem[] }>;
134
-
135
- request(path: string, options?: {
136
- method?: string;
137
- headers?: Record<string, string>;
138
- body?: unknown;
139
- }): Promise<unknown>;
140
- }
141
-
142
- // ---------------------------------------------------------------------------
143
- // Globals
144
- // ---------------------------------------------------------------------------
145
-
146
- declare global {
147
- interface Window {
148
- __NOTIS_RUNTIME__?: NotisRuntime;
149
- }
150
- }
151
-
152
- /**
153
- * Read the injected runtime from the window. Returns null during SSR or if the
154
- * runtime hasn't been injected yet (e.g. during `next dev` without preview).
155
- */
156
- export function getRuntime(): NotisRuntime | null {
157
- if (typeof window === 'undefined') return null;
158
- return window.__NOTIS_RUNTIME__ ?? null;
159
- }
@@ -1,123 +0,0 @@
1
- /**
2
- * Notis theme CSS variables.
3
- *
4
- * These match the portal's globals.css so that apps rendered inside the portal
5
- * iframe have identical styling. Import this in your root layout:
6
- *
7
- * import '@notis/sdk/styles.css';
8
- *
9
- * Then use Tailwind classes as normal -- shadcn components will pick up these
10
- * variables automatically.
11
- */
12
-
13
- @tailwind base;
14
- @tailwind components;
15
- @tailwind utilities;
16
-
17
- @layer base {
18
- :root {
19
- --background: 0 0% 100%;
20
- --foreground: 222.2 84% 4.9%;
21
- --card: 0 0% 100%;
22
- --card-foreground: 222.2 84% 4.9%;
23
- --popover: 0 0% 100%;
24
- --popover-foreground: 222.2 84% 4.9%;
25
- --primary: 222.2 47.4% 11.2%;
26
- --primary-foreground: 210 40% 98%;
27
- --secondary: 210 40% 96.1%;
28
- --secondary-foreground: 222.2 47.4% 11.2%;
29
- --muted: 210 40% 96.1%;
30
- --muted-foreground: 0 0% 46.9%;
31
- --accent: 210 40% 96.1%;
32
- --accent-foreground: 222.2 47.4% 11.2%;
33
- --destructive: 0 84.2% 60.2%;
34
- --destructive-foreground: 210 40% 98%;
35
- --border: 214.3 31.8% 91.4%;
36
- --input: 214.3 31.8% 91.4%;
37
- --ring: 222.2 84% 4.9%;
38
- --radius: 0.5rem;
39
- --sidebar-background: 0 0% 7.5%;
40
- --sidebar-foreground: 240 4.8% 95.9%;
41
- --sidebar-primary: 0 0% 7.5%;
42
- --sidebar-primary-foreground: 240 4.8% 95.9%;
43
- --sidebar-accent: 240 3.7% 15.9%;
44
- --sidebar-accent-foreground: 240 4.8% 95.9%;
45
- --sidebar-border: 0 0% 23.5%;
46
- --sidebar-ring: 217.2 91.2% 59.8%;
47
- --chart-1: 210 100% 49%;
48
- --chart-2: 173 58% 39%;
49
- --chart-3: 197 37% 24%;
50
- --chart-4: 43 74% 66%;
51
- --chart-5: 27 87% 67%;
52
- --code-block-background: #f6f6f6;
53
- --code-block-foreground: #27272a;
54
- --portal-page-max-width: 1100px;
55
- --portal-page-gutter-mobile: 1rem;
56
- --portal-page-gutter-desktop: 1rem;
57
- --portal-page-top-mobile: 1rem;
58
- --portal-page-top-desktop: 1.5rem;
59
- --portal-surface-pad-x-mobile: 1rem;
60
- --portal-surface-pad-x-desktop: 1.5rem;
61
- --portal-surface-pad-bottom: 1.5rem;
62
- }
63
-
64
- .dark {
65
- --background: 0 0% 13%;
66
- --foreground: 210 40% 98%;
67
- --card: 0 0% 13%;
68
- --card-foreground: 210 40% 98%;
69
- --popover: 0 0% 13%;
70
- --popover-foreground: 210 40% 98%;
71
- --primary: 210 40% 98%;
72
- --primary-foreground: 222.2 47.4% 11.2%;
73
- --secondary: 0 0% 18%;
74
- --secondary-foreground: 210 40% 98%;
75
- --muted: 0 0% 18%;
76
- --muted-foreground: 0 0% 65.1%;
77
- --accent: 0 0% 18%;
78
- --accent-foreground: 210 40% 98%;
79
- --destructive: 0 84.2% 60.2%;
80
- --destructive-foreground: 210 40% 98%;
81
- --border: 0 0% 23.5%;
82
- --input: 0 0% 23.5%;
83
- --ring: 212.7 26.8% 83.9%;
84
- --sidebar-background: 0 0% 7.5%;
85
- --sidebar-foreground: 240 4.8% 95.9%;
86
- --sidebar-primary: 224.3 76.3% 48%;
87
- --sidebar-primary-foreground: 0 0% 100%;
88
- --sidebar-accent: 240 3.7% 15.9%;
89
- --sidebar-accent-foreground: 240 4.8% 95.9%;
90
- --sidebar-border: 0 0% 23.5%;
91
- --sidebar-ring: 217.2 91.2% 59.8%;
92
- --chart-1: 210 100% 49%;
93
- --chart-2: 160 60% 45%;
94
- --chart-3: 30 80% 55%;
95
- --chart-4: 280 65% 60%;
96
- --chart-5: 340 75% 55%;
97
- --code-block-background: #1e1e1e;
98
- --code-block-foreground: #e4e4e7;
99
- }
100
- }
101
-
102
- @layer base {
103
- * {
104
- @apply border-border;
105
- }
106
- body {
107
- @apply bg-background text-foreground;
108
- }
109
- }
110
-
111
- @layer components {
112
- .notis-app-shell {
113
- @apply mx-auto w-full max-w-[var(--portal-page-max-width)] px-4 py-6 md:px-4 md:py-8;
114
- }
115
-
116
- .notis-app-surface {
117
- @apply rounded-2xl border border-border bg-card text-card-foreground shadow-sm;
118
- }
119
-
120
- .notis-app-section {
121
- @apply p-5 md:p-6;
122
- }
123
- }
@@ -1,54 +0,0 @@
1
- /**
2
- * Vite config builder for Notis apps.
3
- *
4
- * Usage:
5
- * ```ts
6
- * // vite.config.ts
7
- * import { notisViteConfig } from '@notis/sdk/vite';
8
- * import appConfig from './notis.config';
9
- * export default notisViteConfig(appConfig);
10
- * ```
11
- *
12
- * Produces a library-mode ES module bundle with React externalized.
13
- * Output: .notis/output/bundle/app.js + app.css
14
- */
15
-
16
- import type { NotisAppConfig } from './config';
17
-
18
- export function notisViteConfig(appConfig: NotisAppConfig) {
19
- return {
20
- plugins: [
21
- // @vitejs/plugin-react is added by the consumer's vite.config.ts
22
- // or auto-detected. We provide the config shape only.
23
- ],
24
- build: {
25
- lib: {
26
- entry: '.notis/_entry.tsx',
27
- formats: ['es'] as const,
28
- fileName: () => 'app.js',
29
- },
30
- rollupOptions: {
31
- external: ['react', 'react-dom', 'react/jsx-runtime'],
32
- output: {
33
- globals: {
34
- react: 'window.React',
35
- 'react-dom': 'window.ReactDOM',
36
- 'react/jsx-runtime': 'window.React',
37
- },
38
- assetFileNames: 'app[extname]',
39
- },
40
- },
41
- outDir: '.notis/output/bundle',
42
- emptyOutDir: true,
43
- cssCodeSplit: false,
44
- },
45
- resolve: {
46
- alias: {
47
- '@': process.cwd(),
48
- },
49
- },
50
- define: {
51
- 'process.env.NODE_ENV': JSON.stringify('production'),
52
- },
53
- };
54
- }
File without changes