@notis_ai/cli 0.2.2 → 0.2.4

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 (81) hide show
  1. package/README.md +19 -18
  2. package/config/notis_app_boundary_rules.json +50 -0
  3. package/dist/scaffolds/notis-database/app/globals.css +44 -0
  4. package/dist/scaffolds/notis-database/app/page.tsx +1091 -0
  5. package/dist/scaffolds/notis-database/components/ui/table.tsx +120 -0
  6. package/dist/scaffolds/notis-database/index.html +12 -0
  7. package/dist/scaffolds/notis-database/lib/types.ts +134 -0
  8. package/dist/scaffolds/notis-database/metadata/cover.png +0 -0
  9. package/dist/scaffolds/notis-database/metadata/screenshot-1.png +0 -0
  10. package/dist/scaffolds/notis-database/metadata/screenshot-2.png +0 -0
  11. package/dist/scaffolds/notis-database/metadata/screenshot-3.png +0 -0
  12. package/dist/scaffolds/notis-database/notis.config.ts +27 -0
  13. package/dist/scaffolds/notis-database/package.json +31 -0
  14. package/dist/scaffolds/notis-database/src/dev-main.tsx +23 -0
  15. package/dist/scaffolds/notis-database/src/mock-runtime.ts +557 -0
  16. package/dist/scaffolds/notis-database/tailwind.config.ts +59 -0
  17. package/dist/scaffolds/{notes → notis-database}/tsconfig.json +2 -1
  18. package/dist/scaffolds/notis-database/vite.config.ts +22 -0
  19. package/dist/scaffolds/notis-notes/app/layout.tsx +6 -0
  20. package/dist/scaffolds/{notes → notis-notes}/app/page.tsx +783 -80
  21. package/dist/scaffolds/notis-notes/components/ui/badge.tsx +28 -0
  22. package/dist/scaffolds/notis-notes/components/ui/button.tsx +53 -0
  23. package/dist/scaffolds/notis-notes/components/ui/card.tsx +56 -0
  24. package/dist/scaffolds/notis-notes/components.json +20 -0
  25. package/dist/scaffolds/notis-notes/lib/utils.ts +6 -0
  26. package/dist/scaffolds/notis-notes/metadata/cover.png +0 -0
  27. package/dist/scaffolds/notis-notes/metadata/screenshot-1.png +0 -0
  28. package/dist/scaffolds/notis-notes/metadata/screenshot-2.png +0 -0
  29. package/dist/scaffolds/notis-notes/metadata/screenshot-3.png +0 -0
  30. package/dist/scaffolds/{notes → notis-notes}/notis.config.ts +12 -7
  31. package/dist/scaffolds/{notes → notis-notes}/package.json +2 -2
  32. package/dist/scaffolds/notis-notes/postcss.config.mjs +8 -0
  33. package/dist/scaffolds/notis-notes/tsconfig.json +23 -0
  34. package/dist/scaffolds/notis-random/README.md +33 -0
  35. package/dist/scaffolds/notis-random/app/globals.css +11 -0
  36. package/dist/scaffolds/notis-random/app/history/page.tsx +66 -0
  37. package/dist/scaffolds/notis-random/app/layout.tsx +7 -0
  38. package/dist/scaffolds/notis-random/app/page.tsx +222 -0
  39. package/dist/scaffolds/notis-random/index.html +12 -0
  40. package/dist/scaffolds/notis-random/lib/notis-tools.ts +109 -0
  41. package/dist/scaffolds/notis-random/lib/rng.ts +42 -0
  42. package/dist/scaffolds/notis-random/lib/roll-record.ts +102 -0
  43. package/dist/scaffolds/notis-random/lib/utils.ts +25 -0
  44. package/dist/scaffolds/notis-random/metadata/cover.png +0 -0
  45. package/dist/scaffolds/notis-random/metadata/screenshot-1.png +0 -0
  46. package/dist/scaffolds/notis-random/metadata/screenshot-2.png +0 -0
  47. package/dist/scaffolds/notis-random/metadata/screenshot-3.png +0 -0
  48. package/dist/scaffolds/notis-random/notis.config.ts +43 -0
  49. package/dist/scaffolds/notis-random/package.json +32 -0
  50. package/dist/scaffolds/notis-random/postcss.config.mjs +6 -0
  51. package/dist/scaffolds/notis-random/src/dev-main.tsx +70 -0
  52. package/dist/scaffolds/notis-random/src/mock-runtime.ts +128 -0
  53. package/dist/scaffolds/notis-random/tailwind.config.ts +43 -0
  54. package/dist/scaffolds/notis-random/tsconfig.json +23 -0
  55. package/dist/scaffolds/notis-random/vite.config.ts +11 -0
  56. package/dist/scaffolds.json +27 -4
  57. package/package.json +3 -1
  58. package/skills/notis-apps/SKILL.md +2 -2
  59. package/skills/notis-cli/SKILL.md +18 -16
  60. package/skills/notis-query/cli.md +9 -10
  61. package/src/cli.js +30 -2
  62. package/src/command-specs/apps.js +42 -15
  63. package/src/command-specs/helpers.js +73 -45
  64. package/src/command-specs/meta.js +7 -7
  65. package/src/command-specs/tools.js +196 -83
  66. package/src/runtime/app-boundary-validator.js +65 -14
  67. package/src/runtime/profiles.js +10 -4
  68. package/src/runtime/transport.js +122 -37
  69. package/template/app/page.tsx +1 -1
  70. package/template/notis.config.ts +1 -1
  71. package/template/packages/sdk/src/hooks/useTool.ts +1 -1
  72. /package/dist/scaffolds/{notes → notis-database}/app/layout.tsx +0 -0
  73. /package/dist/scaffolds/{notes → notis-database}/components/ui/badge.tsx +0 -0
  74. /package/dist/scaffolds/{notes → notis-database}/components/ui/button.tsx +0 -0
  75. /package/dist/scaffolds/{notes → notis-database}/components/ui/card.tsx +0 -0
  76. /package/dist/scaffolds/{notes → notis-database}/components.json +0 -0
  77. /package/dist/scaffolds/{notes → notis-database}/lib/utils.ts +0 -0
  78. /package/dist/scaffolds/{notes → notis-database}/postcss.config.mjs +0 -0
  79. /package/dist/scaffolds/{notes → notis-notes}/app/globals.css +0 -0
  80. /package/dist/scaffolds/{notes → notis-notes}/tailwind.config.ts +0 -0
  81. /package/dist/scaffolds/{notes → notis-notes}/vite.config.ts +0 -0
@@ -0,0 +1,120 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ const Table = React.forwardRef<
6
+ HTMLTableElement,
7
+ React.HTMLAttributes<HTMLTableElement>
8
+ >(({ className, ...props }, ref) => (
9
+ <div className="relative w-full overflow-auto">
10
+ <table
11
+ ref={ref}
12
+ className={cn("w-full caption-bottom text-sm", className)}
13
+ {...props}
14
+ />
15
+ </div>
16
+ ))
17
+ Table.displayName = "Table"
18
+
19
+ const TableHeader = React.forwardRef<
20
+ HTMLTableSectionElement,
21
+ React.HTMLAttributes<HTMLTableSectionElement>
22
+ >(({ className, ...props }, ref) => (
23
+ <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
24
+ ))
25
+ TableHeader.displayName = "TableHeader"
26
+
27
+ const TableBody = React.forwardRef<
28
+ HTMLTableSectionElement,
29
+ React.HTMLAttributes<HTMLTableSectionElement>
30
+ >(({ className, ...props }, ref) => (
31
+ <tbody
32
+ ref={ref}
33
+ className={cn("[&_tr:last-child]:border-0", className)}
34
+ {...props}
35
+ />
36
+ ))
37
+ TableBody.displayName = "TableBody"
38
+
39
+ const TableFooter = React.forwardRef<
40
+ HTMLTableSectionElement,
41
+ React.HTMLAttributes<HTMLTableSectionElement>
42
+ >(({ className, ...props }, ref) => (
43
+ <tfoot
44
+ ref={ref}
45
+ className={cn(
46
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
47
+ className
48
+ )}
49
+ {...props}
50
+ />
51
+ ))
52
+ TableFooter.displayName = "TableFooter"
53
+
54
+ const TableRow = React.forwardRef<
55
+ HTMLTableRowElement,
56
+ React.HTMLAttributes<HTMLTableRowElement>
57
+ >(({ className, ...props }, ref) => (
58
+ <tr
59
+ ref={ref}
60
+ className={cn(
61
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
62
+ className
63
+ )}
64
+ {...props}
65
+ />
66
+ ))
67
+ TableRow.displayName = "TableRow"
68
+
69
+ const TableHead = React.forwardRef<
70
+ HTMLTableCellElement,
71
+ React.ThHTMLAttributes<HTMLTableCellElement>
72
+ >(({ className, ...props }, ref) => (
73
+ <th
74
+ ref={ref}
75
+ className={cn(
76
+ "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ ))
82
+ TableHead.displayName = "TableHead"
83
+
84
+ const TableCell = React.forwardRef<
85
+ HTMLTableCellElement,
86
+ React.TdHTMLAttributes<HTMLTableCellElement>
87
+ >(({ className, ...props }, ref) => (
88
+ <td
89
+ ref={ref}
90
+ className={cn(
91
+ "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
92
+ className
93
+ )}
94
+ {...props}
95
+ />
96
+ ))
97
+ TableCell.displayName = "TableCell"
98
+
99
+ const TableCaption = React.forwardRef<
100
+ HTMLTableCaptionElement,
101
+ React.HTMLAttributes<HTMLTableCaptionElement>
102
+ >(({ className, ...props }, ref) => (
103
+ <caption
104
+ ref={ref}
105
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
106
+ {...props}
107
+ />
108
+ ))
109
+ TableCaption.displayName = "TableCaption"
110
+
111
+ export {
112
+ Table,
113
+ TableHeader,
114
+ TableBody,
115
+ TableFooter,
116
+ TableHead,
117
+ TableRow,
118
+ TableCell,
119
+ TableCaption,
120
+ }
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Notis Database (dev preview)</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/dev-main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,134 @@
1
+ export type DatabaseCatalogRow = {
2
+ id: string;
3
+ slug: string | null;
4
+ name: string | null;
5
+ description: string | null;
6
+ icon: string | null;
7
+ owner_app_id: string | null;
8
+ owner_app_name: string | null;
9
+ documents_count?: number | null;
10
+ total_documents: number | null;
11
+ successful_documents: number | null;
12
+ updated_at: string | null;
13
+ };
14
+
15
+ export type ListDatabasesArgs = Record<string, never>;
16
+
17
+ export type ListDatabasesResult = {
18
+ databases: DatabaseCatalogRow[];
19
+ total_count: number;
20
+ };
21
+
22
+ export type GetDatabaseArgs = {
23
+ database_id?: string;
24
+ database_slug?: string;
25
+ };
26
+
27
+ export type QueryDatabaseArgs = {
28
+ database_slug: string;
29
+ query: {
30
+ page_size?: number;
31
+ };
32
+ offset?: number;
33
+ };
34
+
35
+ export type DatabasePropertyKind =
36
+ | 'title'
37
+ | 'rich_text'
38
+ | 'number'
39
+ | 'select'
40
+ | 'multi_select'
41
+ | 'status'
42
+ | 'checkbox'
43
+ | 'url'
44
+ | 'email'
45
+ | 'phone_number'
46
+ | 'date'
47
+ | 'files'
48
+ | 'relation'
49
+ | 'formula'
50
+ | 'people'
51
+ | string;
52
+
53
+ export type PropertyOption = {
54
+ id: string | null;
55
+ name: string | null;
56
+ color: string | null;
57
+ order: number | null;
58
+ };
59
+
60
+ export type RelationTarget = {
61
+ database_id: string | null;
62
+ database_slug: string | null;
63
+ database_name: string | null;
64
+ };
65
+
66
+ export type DatabaseProperty = {
67
+ id: string;
68
+ name: string | null;
69
+ type: DatabasePropertyKind;
70
+ description: string | null;
71
+ order: number | null;
72
+ storage_family: string | null;
73
+ options?: PropertyOption[];
74
+ format?: string | null;
75
+ expression?: string | null;
76
+ relation_target?: RelationTarget;
77
+ };
78
+
79
+ export type DatabaseDetail = {
80
+ id: string;
81
+ slug: string | null;
82
+ name: string | null;
83
+ description: string | null;
84
+ icon: string | null;
85
+ cover: string | null;
86
+ owner_app_id: string | null;
87
+ owner_app_name: string | null;
88
+ content_type: string | null;
89
+ view_config: unknown;
90
+ documents_count?: number | null;
91
+ total_documents: number | null;
92
+ successful_documents: number | null;
93
+ created_at: string | null;
94
+ updated_at: string | null;
95
+ schema?: {
96
+ schema_version?: unknown;
97
+ value_encoding_version?: unknown;
98
+ coercion_version?: unknown;
99
+ title_property_id?: string | null;
100
+ properties: DatabaseProperty[];
101
+ };
102
+ };
103
+
104
+ export type GetDatabaseResult =
105
+ | { database: DatabaseDetail }
106
+ | { status: 'error'; message: string };
107
+
108
+ export type DocumentPropertyValue = {
109
+ type?: string;
110
+ [key: string]: unknown;
111
+ };
112
+
113
+ export type DatabaseDocument = {
114
+ id: string;
115
+ title?: string | null;
116
+ properties?: Record<string, DocumentPropertyValue>;
117
+ property_states?: Record<string, string>;
118
+ url?: string | null;
119
+ created_time?: string | null;
120
+ last_edited_time?: string | null;
121
+ icon?: string | null;
122
+ cover?: string | null;
123
+ };
124
+
125
+ export type QueryDatabaseResult =
126
+ | {
127
+ status: 'success';
128
+ documents: DatabaseDocument[];
129
+ results_count: number;
130
+ total_matching?: number;
131
+ has_more: boolean;
132
+ next_offset: number | null;
133
+ }
134
+ | { status: 'error'; message: string };
@@ -0,0 +1,27 @@
1
+ import { defineNotisApp } from '@notis/sdk/config';
2
+
3
+ export default defineNotisApp({
4
+ name: 'notis-database',
5
+ title: 'Databases',
6
+ description: 'Read-only catalog and schema explorer for every database in your Notis workspace.',
7
+ icon: 'phosphor:database',
8
+ author: { name: 'Notis' },
9
+ categories: ['Product & Engineering', 'Operations'],
10
+ tagline: 'Explore every database and schema in your Notis workspace.',
11
+ versionNotes: 'Initial scaffold release.',
12
+ databases: [],
13
+ routes: [
14
+ {
15
+ path: '/',
16
+ slug: 'catalog',
17
+ name: 'Databases',
18
+ icon: 'phosphor:database',
19
+ default: true,
20
+ },
21
+ ],
22
+ tools: [
23
+ 'LOCAL_NOTIS_DATABASE_LIST_DATABASES',
24
+ 'LOCAL_NOTIS_DATABASE_GET_DATABASE',
25
+ 'LOCAL_NOTIS_DATABASE_QUERY',
26
+ ],
27
+ });
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@notis-apps/notis-database",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build"
9
+ },
10
+ "dependencies": {
11
+ "@notis/sdk": "file:../../packages/sdk",
12
+ "@phosphor-icons/react": "^2.1.10",
13
+ "@radix-ui/react-slot": "^1.1.0",
14
+ "class-variance-authority": "^0.7.0",
15
+ "clsx": "^2.1.1",
16
+ "react": "^19.0.0",
17
+ "react-dom": "^19.0.0",
18
+ "tailwind-merge": "^2.6.0",
19
+ "tailwindcss-animate": "^1.0.7"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^22.0.0",
23
+ "@types/react": "^19.0.0",
24
+ "@types/react-dom": "^19.0.0",
25
+ "@vitejs/plugin-react": "^4.0.0",
26
+ "postcss": "^8.0.0",
27
+ "tailwindcss": "^3.4.0",
28
+ "typescript": "^5.0.0",
29
+ "vite": "^6.0.0"
30
+ }
31
+ }
@@ -0,0 +1,23 @@
1
+ import { StrictMode } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import { NotisProvider } from '@notis/sdk';
4
+ import AppShell from '../app/layout';
5
+ import CatalogPage from '../app/page';
6
+ import { installMockRuntime } from './mock-runtime';
7
+
8
+ const runtime = installMockRuntime();
9
+
10
+ const root = document.getElementById('root');
11
+ if (!root) throw new Error('#root element missing from index.html');
12
+
13
+ createRoot(root).render(
14
+ <StrictMode>
15
+ <NotisProvider runtime={runtime}>
16
+ <AppShell>
17
+ <div data-dev-preview className="h-screen w-screen bg-background text-foreground">
18
+ <CatalogPage />
19
+ </div>
20
+ </AppShell>
21
+ </NotisProvider>
22
+ </StrictMode>,
23
+ );