@notis_ai/cli 0.2.0-beta.16.1 → 0.2.0-beta.160.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 (154) hide show
  1. package/README.md +433 -133
  2. package/config/notis_app_boundary_rules.json +50 -0
  3. package/config/notis_app_design_rules.json +135 -0
  4. package/dist/agent-hooks/notis-agent-hook.mjs +18672 -0
  5. package/dist/base-skills/notis-apps/SKILL.md +70 -0
  6. package/dist/base-skills/notis-apps/references/architecture.md +164 -0
  7. package/dist/base-skills/notis-apps/references/context.md +81 -0
  8. package/dist/base-skills/notis-apps/references/design.md +165 -0
  9. package/dist/base-skills/notis-apps/references/reading.md +89 -0
  10. package/dist/base-skills/notis-apps/references/release.md +99 -0
  11. package/dist/base-skills/notis-apps/references/sdk.md +62 -0
  12. package/dist/base-skills/notis-apps/references/troubleshooting.md +23 -0
  13. package/dist/base-skills/notis-cli/SKILL.md +140 -0
  14. package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
  15. package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
  16. package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
  17. package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
  18. package/dist/base-skills/notis-query/SKILL.md +67 -0
  19. package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
  20. package/dist/base-skills/notis-query/references/documents.md +50 -0
  21. package/dist/base-skills/notis-query/references/query.md +543 -0
  22. package/dist/skill-sync/index.js +1626 -0
  23. package/dist/skill-sync/index.js.map +7 -0
  24. package/dist/skill-sync-worker.mjs +2990 -0
  25. package/package.json +16 -6
  26. package/skills/notis-apps/cli.md +313 -0
  27. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
  28. package/skills/notis-onboarding/BRIEF.md +129 -0
  29. package/skills/notis-query/cli.md +39 -0
  30. package/src/agent-hook-entry.js +5 -0
  31. package/src/cli.js +294 -25
  32. package/src/command-specs/agents.js +392 -0
  33. package/src/command-specs/apps.js +1470 -202
  34. package/src/command-specs/auth.js +114 -137
  35. package/src/command-specs/diagnostics.js +716 -0
  36. package/src/command-specs/handover.js +374 -0
  37. package/src/command-specs/helpers.js +84 -82
  38. package/src/command-specs/index.js +25 -6
  39. package/src/command-specs/meta.js +150 -18
  40. package/src/command-specs/onboarding.js +290 -0
  41. package/src/command-specs/profile.js +358 -0
  42. package/src/command-specs/reports.js +86 -0
  43. package/src/command-specs/skills.js +75 -0
  44. package/src/command-specs/smoke.js +386 -0
  45. package/src/command-specs/tools.js +455 -139
  46. package/src/runtime/agent-browser.js +632 -0
  47. package/src/runtime/agent-memory-state.js +126 -0
  48. package/src/runtime/agent-setup.js +383 -0
  49. package/src/runtime/app-boundary-validator.js +404 -0
  50. package/src/runtime/app-changelog.js +79 -0
  51. package/src/runtime/app-platform.js +2633 -210
  52. package/src/runtime/app-registry-scaffolds.js +367 -0
  53. package/src/runtime/app-test-server.js +292 -0
  54. package/src/runtime/assets/store-screenshot-dark.png +0 -0
  55. package/src/runtime/auth-recovery.js +110 -0
  56. package/src/runtime/base-skills.d.ts +20 -0
  57. package/src/runtime/base-skills.js +167 -0
  58. package/src/runtime/channel.js +133 -0
  59. package/src/runtime/delegated-context.js +68 -0
  60. package/src/runtime/errors.js +1 -0
  61. package/src/runtime/git.js +233 -0
  62. package/src/runtime/login-listener.js +15 -0
  63. package/src/runtime/oauth.js +2622 -0
  64. package/src/runtime/output.js +37 -5
  65. package/src/runtime/ports.js +31 -0
  66. package/src/runtime/profiles.js +906 -55
  67. package/src/runtime/skill-sync/cloud-client.ts +99 -0
  68. package/src/runtime/skill-sync/index.ts +697 -0
  69. package/src/runtime/skill-sync/local-scanner.ts +1046 -0
  70. package/src/runtime/skill-sync/symlink-manager.ts +433 -0
  71. package/src/runtime/skill-sync/sync-plan.ts +22 -0
  72. package/src/runtime/skill-sync/types.ts +110 -0
  73. package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
  74. package/src/runtime/skill-sync-service.js +109 -0
  75. package/src/runtime/store-screenshot.js +143 -0
  76. package/src/runtime/sync-skills.d.ts +37 -0
  77. package/src/runtime/sync-skills.js +231 -0
  78. package/src/runtime/telemetry.js +92 -0
  79. package/src/runtime/transport.js +324 -45
  80. package/src/skill-sync-worker-entry.js +2 -0
  81. package/src/skill-sync-worker.js +50 -0
  82. package/template/.harness/index.html.tmpl +430 -0
  83. package/template/CHANGELOG.md +5 -0
  84. package/template/app/layout.tsx +5 -2
  85. package/template/app/page.tsx +49 -42
  86. package/template/components/page-heading.tsx +23 -0
  87. package/template/components/ui/badge.tsx +7 -4
  88. package/template/components/ui/card.tsx +24 -11
  89. package/template/components/ui/native-select.tsx +24 -0
  90. package/template/notis.config.ts +24 -6
  91. package/template/package-lock.json +4137 -0
  92. package/template/package.json +5 -5
  93. package/template/packages/{notis-sdk → sdk}/package.json +13 -3
  94. package/template/packages/sdk/src/agentContext.ts +36 -0
  95. package/template/packages/sdk/src/components/DocumentEditor.tsx +103 -0
  96. package/template/packages/sdk/src/components/Markdown.tsx +60 -0
  97. package/template/packages/sdk/src/components/MarkdownEditor.tsx +121 -0
  98. package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +285 -0
  99. package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +97 -0
  100. package/template/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
  101. package/template/packages/sdk/src/components/NotisCommentBoundary.tsx +172 -0
  102. package/template/packages/sdk/src/components/NotisSelectionBoundary.tsx +59 -0
  103. package/template/packages/sdk/src/components/ShortcutHints.tsx +56 -0
  104. package/template/packages/sdk/src/components/Skeleton.tsx +24 -0
  105. package/template/packages/sdk/src/config.ts +257 -0
  106. package/template/packages/sdk/src/documents.ts +256 -0
  107. package/template/packages/sdk/src/hooks/useActiveResource.ts +19 -0
  108. package/template/packages/sdk/src/hooks/useAgentContext.ts +23 -0
  109. package/template/packages/sdk/src/hooks/useCloudComputer.ts +64 -0
  110. package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +836 -0
  111. package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +49 -0
  112. package/template/packages/sdk/src/hooks/useDatabaseSubscription.ts +76 -0
  113. package/template/packages/sdk/src/hooks/useDocument.ts +43 -0
  114. package/template/packages/sdk/src/hooks/useDocuments.ts +84 -0
  115. package/template/packages/sdk/src/hooks/useHandover.ts +78 -0
  116. package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
  117. package/template/packages/sdk/src/hooks/useMultiSelect.ts +95 -0
  118. package/template/packages/{notis-sdk → sdk}/src/hooks/useNotis.ts +10 -4
  119. package/template/packages/{notis-sdk → sdk}/src/hooks/useNotisNavigation.ts +11 -8
  120. package/template/packages/sdk/src/hooks/useQuery.ts +71 -0
  121. package/template/packages/sdk/src/hooks/useTool.ts +65 -0
  122. package/template/packages/sdk/src/hooks/useToolQuery.ts +12 -0
  123. package/template/packages/sdk/src/hooks/useTopBarSearch.ts +81 -0
  124. package/template/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
  125. package/template/packages/sdk/src/index.ts +161 -0
  126. package/template/packages/sdk/src/interactions/actions.ts +59 -0
  127. package/template/packages/sdk/src/interactions/shortcuts.tsx +694 -0
  128. package/template/packages/sdk/src/interactions/visibility.ts +13 -0
  129. package/template/packages/sdk/src/interactions.ts +45 -0
  130. package/template/packages/sdk/src/provider.tsx +44 -0
  131. package/template/packages/sdk/src/queryCache.ts +170 -0
  132. package/template/packages/sdk/src/runtime.ts +451 -0
  133. package/template/packages/sdk/src/styles.css +213 -0
  134. package/template/packages/sdk/src/tailwind.ts +56 -0
  135. package/template/packages/{notis-sdk → sdk}/src/vite.ts +5 -1
  136. package/template/tailwind.config.ts +1 -0
  137. package/src/command-specs/db.js +0 -163
  138. package/src/runtime/app-preview-server.js +0 -312
  139. package/template/packages/notis-sdk/src/config.ts +0 -48
  140. package/template/packages/notis-sdk/src/helpers.ts +0 -131
  141. package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
  142. package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
  143. package/template/packages/notis-sdk/src/hooks/useDatabase.ts +0 -87
  144. package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
  145. package/template/packages/notis-sdk/src/hooks/useTool.ts +0 -49
  146. package/template/packages/notis-sdk/src/hooks/useUpsertDocument.ts +0 -57
  147. package/template/packages/notis-sdk/src/index.ts +0 -47
  148. package/template/packages/notis-sdk/src/provider.tsx +0 -44
  149. package/template/packages/notis-sdk/src/runtime.ts +0 -159
  150. package/template/packages/notis-sdk/src/styles.css +0 -123
  151. /package/template/packages/{notis-sdk → sdk}/src/hooks/useBackend.ts +0 -0
  152. /package/template/packages/{notis-sdk → sdk}/src/hooks/useTools.ts +0 -0
  153. /package/template/packages/{notis-sdk → sdk}/src/ui.ts +0 -0
  154. /package/template/packages/{notis-sdk → sdk}/tsconfig.json +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
- }
File without changes