@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
@@ -0,0 +1,15 @@
1
+ // Keep this dependency-free: npm engines are advisory unless engine-strict is set.
2
+ // Both installation and the public entry point check before loading dependencies.
3
+ import { readFileSync } from 'node:fs';
4
+
5
+ const { engines } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
6
+ // This package declares one inclusive minimum, not a compound semver range.
7
+ const minimum = engines.node.match(/^>=(\d+)\.(\d+)\.(\d+)$/);
8
+ if (!minimum) throw new Error('CLI engines.node must declare one inclusive minimum version.');
9
+ const required = minimum.slice(1).map(Number);
10
+ const current = process.versions.node.split('.').map(Number);
11
+ const difference = current.map((part, index) => part - required[index]).find((part) => part !== 0);
12
+ if (difference < 0) {
13
+ process.stderr.write(`Notis CLI requires Node.js ${engines.node}; found ${process.versions.node}. Upgrade Node.js before running or installing the CLI.\n`);
14
+ process.exit(1);
15
+ }
package/bin/notis.js CHANGED
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+ import './check-runtime.js';
3
+
2
4
  import('../src/cli.js').then(({ run }) => run());
@@ -0,0 +1,50 @@
1
+ {
2
+ "javascript": [
3
+ {
4
+ "pattern": "window\\.__NOTIS_RUNTIME__",
5
+ "message": "window.__NOTIS_RUNTIME__ is forbidden; rely on the portal-injected NotisProvider runtime."
6
+ },
7
+ {
8
+ "pattern": "document\\.(?:body|head|documentElement)\\b",
9
+ "message": "document.body, document.head, and document.documentElement are forbidden; apps must stay inside the app surface."
10
+ },
11
+ {
12
+ "pattern": "document\\.(?:querySelector|querySelectorAll|getElementById|getElementsByClassName|getElementsByTagName)\\s*\\(\\s*(['\"`])[^\\n]*\\[data-notis-",
13
+ "message": "querying portal-owned [data-notis-*] hooks is forbidden."
14
+ },
15
+ {
16
+ "pattern": "createPortal\\s*\\(",
17
+ "message": "React portals are unsupported in Notis apps until a shadow-safe overlay contract exists."
18
+ },
19
+ {
20
+ "pattern": "@radix-ui/react-portal",
21
+ "message": "@radix-ui/react-portal is unsupported in Notis apps until a shadow-safe overlay contract exists."
22
+ },
23
+ {
24
+ "pattern": "PortalPrimitive",
25
+ "message": "Radix portal primitives are unsupported in Notis apps until a shadow-safe overlay contract exists."
26
+ }
27
+ ],
28
+ "css": [
29
+ {
30
+ "pattern": ":root\\b",
31
+ "message": ":root selectors are forbidden; styles must stay inside the app surface."
32
+ },
33
+ {
34
+ "pattern": "(^|[\\s,>+~])html(?=[\\s.#[:{>+~,]|$)",
35
+ "message": "html selectors are forbidden; styles must stay inside the app surface."
36
+ },
37
+ {
38
+ "pattern": "(^|[\\s,>+~])body(?=[\\s.#[:{>+~,]|$)",
39
+ "message": "body selectors are forbidden; styles must stay inside the app surface."
40
+ },
41
+ {
42
+ "pattern": "\\[data-notis-(?!app-root\\b)[^\\]]*\\]",
43
+ "message": "portal-owned [data-notis-*] selectors are forbidden. Use [data-notis-app-root] only for the app surface itself."
44
+ },
45
+ {
46
+ "pattern": "\\[data-sidebar(?:=[^\\]]+)?\\]",
47
+ "message": "portal sidebar selectors are forbidden."
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,135 @@
1
+ {
2
+ "version": 1,
3
+ "include": ["app/**", "components/**"],
4
+ "exclude": [
5
+ "components/ui/input.tsx",
6
+ "components/ui/textarea.tsx",
7
+ "components/ui/checkbox.tsx",
8
+ "components/ui/switch.tsx",
9
+ "components/ui/button.tsx"
10
+ ],
11
+ "extensions": [".js", ".jsx", ".ts", ".tsx", ".css"],
12
+ "allow_directive": "notis-design-allow",
13
+ "allow_reason_min_length": 12,
14
+ "rules": [
15
+ {
16
+ "id": "no-border-box",
17
+ "severity": "error",
18
+ "pattern": "(?<![\\w-])border(?![\\w-])|(?<![\\w-])border-(?:[xy]|\\d+)(?![\\w-])",
19
+ "message": "Four-side borders are banned. Use a flat Card (bg-muted / bg-background) or a single border-t / border-b hairline between sections.",
20
+ "exclude": ["components/ui/badge.tsx", "components/ui/card.tsx", "components/ui/native-select.tsx"]
21
+ },
22
+ {
23
+ "id": "no-side-bar",
24
+ "severity": "error",
25
+ "pattern": "\\bborder-[lr]-[248]\\b",
26
+ "message": "Thick left or right border bars are banned. Indicate selection with a background tint (bg-muted)."
27
+ },
28
+ {
29
+ "id": "no-dashed-box",
30
+ "severity": "error",
31
+ "pattern": "\\bborder-dashed\\b",
32
+ "message": "Dashed boxes are banned. Empty states are centered muted text with an optional primary button."
33
+ },
34
+ {
35
+ "id": "no-divide",
36
+ "severity": "error",
37
+ "pattern": "\\bdivide-[xy]\\b|<hr\\b",
38
+ "message": "Row dividers are banned. Use spacing, .list-row hover tint, or one hairline between sections."
39
+ },
40
+ {
41
+ "id": "no-ring-box",
42
+ "severity": "error",
43
+ "pattern": "(?<![\\w:-])ring-(?:1|2|4|inset)\\b",
44
+ "message": "Rings as a box or selection indicator are banned. Keep focus-visible:ring-2 on controls; use bg-muted for selection."
45
+ },
46
+ {
47
+ "id": "no-shadow",
48
+ "severity": "error",
49
+ "pattern": "\\bshadow-(?:sm|md|xl|2xl)\\b",
50
+ "message": "Shadows are banned on panels, cards, tiles, and bubbles. Only a floating popover or menu may use shadow-lg with bg-popover.",
51
+ "exclude": ["components/ui/popover.tsx", "components/ui/dropdown-menu.tsx", "components/ui/tooltip.tsx", "components/ui/select.tsx", "components/ui/dialog.tsx", "components/ui/sheet.tsx"]
52
+ },
53
+ {
54
+ "id": "no-floating-shadow-without-popover",
55
+ "severity": "error",
56
+ "pattern": "^(?!.*bg-popover).*\\bshadow-lg\\b",
57
+ "message": "shadow-lg is only allowed on a floating layer that also uses bg-popover.",
58
+ "exclude": ["components/ui/popover.tsx", "components/ui/dropdown-menu.tsx", "components/ui/tooltip.tsx", "components/ui/select.tsx", "components/ui/dialog.tsx", "components/ui/sheet.tsx"]
59
+ },
60
+ {
61
+ "id": "no-palette-hue",
62
+ "severity": "error",
63
+ "pattern": "\\b(?:bg|text|border|ring|from|via|to|fill|stroke|outline|decoration|accent|caret|divide|shadow|placeholder)-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone)-\\d{2,3}\\b",
64
+ "message": "Hardcoded Tailwind palette colors are banned. Use tokens: text-foreground, text-muted-foreground, text-primary, bg-muted, bg-primary/10, text-destructive, bg-destructive/10."
65
+ },
66
+ {
67
+ "id": "no-hex-color",
68
+ "severity": "error",
69
+ "pattern": "#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3}(?:[0-9a-fA-F]{2})?)?(?![\\w-])",
70
+ "message": "Hex colors are banned. Use theme tokens (hsl(var(--primary)) with opacity steps for charts)."
71
+ },
72
+ {
73
+ "id": "no-gradient",
74
+ "severity": "error",
75
+ "pattern": "\\bbg-gradient-|linear-gradient\\(|radial-gradient\\(|conic-gradient\\(",
76
+ "message": "Gradients are banned."
77
+ },
78
+ {
79
+ "id": "no-backdrop-blur",
80
+ "severity": "error",
81
+ "pattern": "\\bbackdrop-blur",
82
+ "message": "Glassmorphism is banned."
83
+ },
84
+ {
85
+ "id": "no-eyebrow",
86
+ "severity": "error",
87
+ "pattern": "\\buppercase\\b[^\\n]{0,80}\\btracking-(?:wide|wider|widest|\\[)|\\btracking-(?:wide|wider|widest|\\[)[^\\n]{0,80}\\buppercase\\b",
88
+ "message": "Uppercase tracking eyebrows are banned. Use a plain noun page title and text-xs text-muted-foreground labels."
89
+ },
90
+ {
91
+ "id": "no-tiny-text",
92
+ "severity": "error",
93
+ "pattern": "\\btext-\\[(?:[0-9]|1[01])(?:\\.\\d+)?px\\]",
94
+ "message": "Text below 12px is banned. Use text-xs (12px) at minimum."
95
+ },
96
+ {
97
+ "id": "no-badge-outline",
98
+ "severity": "error",
99
+ "pattern": "<Badge\\b[^>]*variant=[\"']outline[\"']",
100
+ "message": "Badge variant=\"outline\" is banned. Use default, secondary, or destructive."
101
+ },
102
+ {
103
+ "id": "no-raw-select",
104
+ "severity": "error",
105
+ "pattern": "<select\\b",
106
+ "message": "Raw <select> is banned. Use NativeSelect from @/components/ui/native-select.",
107
+ "exclude": ["components/ui/native-select.tsx"]
108
+ },
109
+ {
110
+ "id": "no-search-input",
111
+ "severity": "error",
112
+ "pattern": "<input\\b[^>]*type=[\"']search[\"']|<[Ii]nput\\b[^>]*placeholder=[\"'][^\"']*\\b[Ss]earch",
113
+ "message": "In-app search inputs are banned. The portal owns search: wire useTopBarSearch from @notis/sdk."
114
+ },
115
+ {
116
+ "id": "no-font-serif",
117
+ "severity": "error",
118
+ "pattern": "\\bfont-serif\\b",
119
+ "message": "font-serif is banned. Apps use the portal font."
120
+ },
121
+ {
122
+ "id": "no-loading-placeholder",
123
+ "severity": "error",
124
+ "pattern": ">\\s*Loading(?:\\.{3}|…)?(?:\\s[^<]{0,40})?<|[\"'`]Loading(?:\\.{3}|…)",
125
+ "message": "Loading text is banned. Keep headings visible and render Skeleton / ViewSkeleton from @notis/sdk in the missing region only."
126
+ },
127
+ {
128
+ "id": "no-app-shell-split",
129
+ "severity": "error",
130
+ "scope": "file",
131
+ "pattern": "notis-app-shell[\\s\\S]*<aside\\b|<aside\\b[\\s\\S]*notis-app-shell",
132
+ "message": "A list-plus-detail page must be full-bleed. Replace notis-app-shell with notis-app-split and the notis-app-pane-list / notis-app-pane-detail panes."
133
+ }
134
+ ]
135
+ }