@notis_ai/cli 0.2.0-beta.175.1 → 0.2.0-beta.177.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 (53) hide show
  1. package/dist/agent-hooks/notis-agent-hook.mjs +10 -13
  2. package/{template/packages → dist}/sdk/src/styles.css +72 -74
  3. package/package.json +1 -1
  4. package/src/command-specs/diagnostics.js +15 -14
  5. package/src/runtime/app-platform.js +2 -2
  6. package/src/runtime/app-test-server.js +1 -1
  7. package/template/packages/sdk/tsconfig.json +0 -16
  8. /package/{template/packages → dist}/sdk/package.json +0 -0
  9. /package/{template/packages → dist}/sdk/src/agentContext.ts +0 -0
  10. /package/{template/packages → dist}/sdk/src/components/Dialog.tsx +0 -0
  11. /package/{template/packages → dist}/sdk/src/components/DocumentEditor.tsx +0 -0
  12. /package/{template/packages → dist}/sdk/src/components/Markdown.tsx +0 -0
  13. /package/{template/packages → dist}/sdk/src/components/MarkdownEditor.tsx +0 -0
  14. /package/{template/packages → dist}/sdk/src/components/MultiSelectActionBar.tsx +0 -0
  15. /package/{template/packages → dist}/sdk/src/components/MultiSelectCheckbox.tsx +0 -0
  16. /package/{template/packages → dist}/sdk/src/components/MultiSelectDragOverlay.tsx +0 -0
  17. /package/{template/packages → dist}/sdk/src/components/NotisCommentBoundary.tsx +0 -0
  18. /package/{template/packages → dist}/sdk/src/components/NotisSelectionBoundary.tsx +0 -0
  19. /package/{template/packages → dist}/sdk/src/components/ShortcutHints.tsx +0 -0
  20. /package/{template/packages → dist}/sdk/src/components/Skeleton.tsx +0 -0
  21. /package/{template/packages → dist}/sdk/src/config.ts +0 -0
  22. /package/{template/packages → dist}/sdk/src/documents.ts +0 -0
  23. /package/{template/packages → dist}/sdk/src/hooks/useActiveResource.ts +0 -0
  24. /package/{template/packages → dist}/sdk/src/hooks/useAgentContext.ts +0 -0
  25. /package/{template/packages → dist}/sdk/src/hooks/useBackend.ts +0 -0
  26. /package/{template/packages → dist}/sdk/src/hooks/useCloudComputer.ts +0 -0
  27. /package/{template/packages → dist}/sdk/src/hooks/useCollectionInteractions.ts +0 -0
  28. /package/{template/packages → dist}/sdk/src/hooks/useDatabaseSchema.ts +0 -0
  29. /package/{template/packages → dist}/sdk/src/hooks/useDatabaseSubscription.ts +0 -0
  30. /package/{template/packages → dist}/sdk/src/hooks/useDocument.ts +0 -0
  31. /package/{template/packages → dist}/sdk/src/hooks/useDocuments.ts +0 -0
  32. /package/{template/packages → dist}/sdk/src/hooks/useHandover.ts +0 -0
  33. /package/{template/packages → dist}/sdk/src/hooks/useLongPressSelection.ts +0 -0
  34. /package/{template/packages → dist}/sdk/src/hooks/useMultiSelect.ts +0 -0
  35. /package/{template/packages → dist}/sdk/src/hooks/useNotis.ts +0 -0
  36. /package/{template/packages → dist}/sdk/src/hooks/useNotisNavigation.ts +0 -0
  37. /package/{template/packages → dist}/sdk/src/hooks/useQuery.ts +0 -0
  38. /package/{template/packages → dist}/sdk/src/hooks/useTool.ts +0 -0
  39. /package/{template/packages → dist}/sdk/src/hooks/useToolQuery.ts +0 -0
  40. /package/{template/packages → dist}/sdk/src/hooks/useTools.ts +0 -0
  41. /package/{template/packages → dist}/sdk/src/hooks/useTopBarSearch.ts +0 -0
  42. /package/{template/packages → dist}/sdk/src/hooks/useUpsertDocument.ts +0 -0
  43. /package/{template/packages → dist}/sdk/src/index.ts +0 -0
  44. /package/{template/packages → dist}/sdk/src/interactions/actions.ts +0 -0
  45. /package/{template/packages → dist}/sdk/src/interactions/shortcuts.tsx +0 -0
  46. /package/{template/packages → dist}/sdk/src/interactions/visibility.ts +0 -0
  47. /package/{template/packages → dist}/sdk/src/interactions.ts +0 -0
  48. /package/{template/packages → dist}/sdk/src/provider.tsx +0 -0
  49. /package/{template/packages → dist}/sdk/src/queryCache.ts +0 -0
  50. /package/{template/packages → dist}/sdk/src/runtime.ts +0 -0
  51. /package/{template/packages → dist}/sdk/src/tailwind.ts +0 -0
  52. /package/{template/packages → dist}/sdk/src/ui.ts +0 -0
  53. /package/{template/packages → dist}/sdk/src/vite.ts +0 -0
@@ -9050,7 +9050,7 @@ var BUNDLE_DIR = join4(OUTPUT_DIR, "bundle");
9050
9050
  var MANIFEST_FILE = join4(OUTPUT_DIR, "manifest.json");
9051
9051
  var METADATA_DIR = "metadata";
9052
9052
  var CLI_ROOT = resolve3(dirname3(fileURLToPath2(import.meta.url)), "../..");
9053
- var TEMPLATE_SDK_DIR = join4(CLI_ROOT, "template", "packages", "sdk");
9053
+ var TEMPLATE_SDK_DIR = join4(CLI_ROOT, "dist", "sdk");
9054
9054
  var NOTIS_APP_CATEGORIES = [
9055
9055
  "Productivity",
9056
9056
  "Sales & Marketing",
@@ -11533,7 +11533,7 @@ function resolveHarnessReactVersion(projectDir) {
11533
11533
  const candidates = [
11534
11534
  join5(projectDir, "node_modules", "@notis", "sdk", "package.json"),
11535
11535
  join5(REPO_ROOT, "packages", "sdk", "package.json"),
11536
- join5(CLI_ROOT2, "template", "packages", "sdk", "package.json")
11536
+ join5(CLI_ROOT2, "dist", "sdk", "package.json")
11537
11537
  ];
11538
11538
  for (const candidate of candidates) {
11539
11539
  const pkg = readJsonFile(candidate);
@@ -16633,7 +16633,7 @@ async function discoverSupabaseSqlTool(runtime) {
16633
16633
  return match;
16634
16634
  }
16635
16635
  function unwrapToolExecutionPayload(payload) {
16636
- return payload?.data?.results?.[0]?.response?.data ?? payload?.results?.[0]?.response?.data ?? payload?.data?.result ?? payload?.result ?? payload?.data ?? payload;
16636
+ return payload?.data?.data?.results?.[0]?.response?.data ?? payload?.data?.results?.[0]?.response?.data ?? payload?.results?.[0]?.response?.data ?? payload?.data?.result ?? payload?.result ?? payload?.data ?? payload;
16637
16637
  }
16638
16638
  function parseJsonCandidate(value) {
16639
16639
  if (typeof value !== "string") return null;
@@ -16642,20 +16642,17 @@ function parseJsonCandidate(value) {
16642
16642
  return JSON.parse(trimmed);
16643
16643
  } catch {
16644
16644
  const boundaryEnd = trimmed.lastIndexOf("</untrusted-data");
16645
- const boundaryStart = boundaryEnd >= 0 ? trimmed.lastIndexOf("<untrusted-data", boundaryEnd) : -1;
16646
- const contentStart = boundaryStart >= 0 ? trimmed.indexOf(">", boundaryStart) + 1 : -1;
16647
- if (contentStart > 0 && boundaryEnd > contentStart) {
16648
- const inner = trimmed.slice(contentStart, boundaryEnd).trim().replace(/^(?:\\r?\\n)+/, "").replace(/(?:\\r?\\n)+$/, "").trim();
16645
+ const boundaryName = boundaryEnd >= 0 ? trimmed.slice(boundaryEnd + 2, trimmed.indexOf(">", boundaryEnd)) : null;
16646
+ const opening = boundaryName ? `<${boundaryName}>` : null;
16647
+ for (let boundaryStart = opening ? trimmed.indexOf(opening) : -1; boundaryStart >= 0 && boundaryStart < boundaryEnd; boundaryStart = trimmed.indexOf(opening, boundaryStart + opening.length)) {
16648
+ const contentStart = boundaryStart + opening.length;
16649
+ const inner = trimmed.slice(contentStart, boundaryEnd).trim().replace(/^(?:(?:\\r)?\\n)+/, "").replace(/(?:(?:\\r)?\\n)+$/, "").trim();
16649
16650
  try {
16650
16651
  return JSON.parse(inner);
16651
- } catch (error) {
16652
- const nested = parseJsonCandidate(inner);
16653
- if (nested !== null) return nested;
16654
- throw usageError(
16655
- `Supabase diagnostic rows were not valid JSON: ${error instanceof Error ? error.message : String(error)}; prefix=${JSON.stringify(inner.slice(0, 100))}`
16656
- );
16652
+ } catch {
16657
16653
  }
16658
16654
  }
16655
+ if (boundaryEnd >= 0) throw usageError("Supabase diagnostic rows were not valid JSON.");
16659
16656
  const arrayMatch = trimmed.match(/(\[[\s\S]*\])/);
16660
16657
  if (arrayMatch) {
16661
16658
  try {
@@ -30,93 +30,91 @@ dialog.notis-dialog::backdrop { background: rgb(0 0 0 / 0.45); }
30
30
  .notis-dialog-description { margin: 0.5rem 0 0; color: hsl(var(--muted-foreground)); font-size: 0.875rem; line-height: 1.5; }
31
31
 
32
32
  /* Framework-neutral styles: the app owns its Tailwind entry point. This file
33
- * is also consumed in shadow roots and by apps on older Tailwind versions. */
34
- @layer base {
35
- * {
36
- border-color: hsl(var(--border));
37
- }
38
- [data-notis-app-root] {
39
- color: hsl(var(--foreground));
40
- display: block;
41
- min-height: 100%;
42
- }
33
+ * is also consumed in shadow roots and by apps on older Tailwind versions.
34
+ * Keep rules outside Tailwind-owned @layer blocks: Vite processes this import
35
+ * separately from the app stylesheet, so Tailwind 3 has no matching directives. */
36
+ * {
37
+ border-color: hsl(var(--border));
38
+ }
39
+ [data-notis-app-root] {
40
+ color: hsl(var(--foreground));
41
+ display: block;
42
+ min-height: 100%;
43
43
  }
44
44
 
45
- @layer components {
46
- .notis-app-shell {
47
- margin-inline: auto;
48
- width: 100%;
49
- max-width: var(--portal-page-max-width);
50
- padding: 1.5rem 1rem;
51
- }
45
+ .notis-app-shell {
46
+ margin-inline: auto;
47
+ width: 100%;
48
+ max-width: var(--portal-page-max-width);
49
+ padding: 1.5rem 1rem;
50
+ }
52
51
 
53
- /* Flat panel: no border or shadow around items. */
54
- .notis-app-surface {
55
- border-radius: 1rem;
56
- background-color: hsl(var(--muted));
57
- color: hsl(var(--card-foreground));
58
- }
52
+ /* Flat panel: no border or shadow around items. */
53
+ .notis-app-surface {
54
+ border-radius: 1rem;
55
+ background-color: hsl(var(--muted));
56
+ color: hsl(var(--card-foreground));
57
+ }
59
58
 
60
- .list-row {
61
- border-radius: 0.75rem;
62
- background-color: hsl(var(--muted));
63
- padding: 0.75rem 1rem;
64
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
65
- transition-duration: 150ms;
66
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
67
- }
59
+ .list-row {
60
+ border-radius: 0.75rem;
61
+ background-color: hsl(var(--muted));
62
+ padding: 0.75rem 1rem;
63
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
64
+ transition-duration: 150ms;
65
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
66
+ }
68
67
 
69
- .list-row-selected {
70
- background-color: hsl(var(--primary) / 0.06);
71
- }
68
+ .list-row-selected {
69
+ background-color: hsl(var(--primary) / 0.06);
70
+ }
72
71
 
73
- /* Split pages are full-bleed; only the list pane carries a hairline. */
74
- .notis-app-split {
75
- display: flex;
76
- height: 100%;
77
- min-height: 0;
78
- width: 100%;
79
- max-width: none;
80
- flex-direction: column;
81
- }
72
+ /* Split pages are full-bleed; only the list pane carries a hairline. */
73
+ .notis-app-split {
74
+ display: flex;
75
+ height: 100%;
76
+ min-height: 0;
77
+ width: 100%;
78
+ max-width: none;
79
+ flex-direction: column;
80
+ }
82
81
 
83
- .notis-app-pane-list {
84
- width: 100%;
85
- flex-shrink: 0;
86
- background-color: hsl(var(--muted) / 0.4);
87
- }
82
+ .notis-app-pane-list {
83
+ width: 100%;
84
+ flex-shrink: 0;
85
+ background-color: hsl(var(--muted) / 0.4);
86
+ }
88
87
 
89
- .notis-app-pane-detail {
90
- min-width: 0;
91
- flex: 1 1 0%;
92
- background-color: hsl(var(--background));
93
- }
88
+ .notis-app-pane-detail {
89
+ min-width: 0;
90
+ flex: 1 1 0%;
91
+ background-color: hsl(var(--background));
92
+ }
94
93
 
95
- .notis-app-section {
96
- padding: 1.25rem;
97
- }
94
+ .notis-app-section {
95
+ padding: 1.25rem;
96
+ }
98
97
 
99
- @media (min-width: 768px) {
100
- .notis-app-shell { padding-block: 2rem; }
101
- .notis-app-section { padding: 1.5rem; }
102
- }
98
+ @media (min-width: 768px) {
99
+ .notis-app-shell { padding-block: 2rem; }
100
+ .notis-app-section { padding: 1.5rem; }
101
+ }
103
102
 
104
- @media (min-width: 1024px) {
105
- .list-row { background-color: transparent; }
106
- .list-row:hover { background-color: hsl(var(--muted) / 0.6); }
107
- .list-row-selected,
108
- .list-row-selected:hover { background-color: hsl(var(--primary) / 0.06); }
109
- .notis-app-split { flex-direction: row; }
110
- .notis-app-pane-list {
111
- width: 20rem;
112
- border-right-width: 1px;
113
- border-right-color: hsl(var(--border));
114
- }
103
+ @media (min-width: 1024px) {
104
+ .list-row { background-color: transparent; }
105
+ .list-row:hover { background-color: hsl(var(--muted) / 0.6); }
106
+ .list-row-selected,
107
+ .list-row-selected:hover { background-color: hsl(var(--primary) / 0.06); }
108
+ .notis-app-split { flex-direction: row; }
109
+ .notis-app-pane-list {
110
+ width: 20rem;
111
+ border-right-width: 1px;
112
+ border-right-color: hsl(var(--border));
115
113
  }
114
+ }
116
115
 
117
- @media (min-width: 1280px) {
118
- .notis-app-pane-list { width: 24rem; }
119
- }
116
+ @media (min-width: 1280px) {
117
+ .notis-app-pane-list { width: 24rem; }
120
118
  }
121
119
 
122
120
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notis_ai/cli",
3
- "version": "0.2.0-beta.175.1",
3
+ "version": "0.2.0-beta.177.1",
4
4
  "description": "Agent-first Notis CLI for apps and generic tool execution",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,8 @@ async function discoverSupabaseSqlTool(runtime) {
58
58
 
59
59
  export function unwrapToolExecutionPayload(payload) {
60
60
  return (
61
- payload?.data?.results?.[0]?.response?.data
61
+ payload?.data?.data?.results?.[0]?.response?.data
62
+ ?? payload?.data?.results?.[0]?.response?.data
62
63
  ?? payload?.results?.[0]?.response?.data
63
64
  ?? payload?.data?.result
64
65
  ?? payload?.result
@@ -74,30 +75,30 @@ function parseJsonCandidate(value) {
74
75
  return JSON.parse(trimmed);
75
76
  } catch {
76
77
  const boundaryEnd = trimmed.lastIndexOf('</untrusted-data');
77
- const boundaryStart = boundaryEnd >= 0
78
- ? trimmed.lastIndexOf('<untrusted-data', boundaryEnd)
79
- : -1;
80
- const contentStart = boundaryStart >= 0 ? trimmed.indexOf('>', boundaryStart) + 1 : -1;
81
- if (contentStart > 0 && boundaryEnd > contentStart) {
78
+ const boundaryName = boundaryEnd >= 0
79
+ ? trimmed.slice(boundaryEnd + 2, trimmed.indexOf('>', boundaryEnd)) : null;
80
+ const opening = boundaryName ? `<${boundaryName}>` : null;
81
+ for (let boundaryStart = opening ? trimmed.indexOf(opening) : -1;
82
+ boundaryStart >= 0 && boundaryStart < boundaryEnd;
83
+ boundaryStart = trimmed.indexOf(opening, boundaryStart + opening.length)) {
84
+ const contentStart = boundaryStart + opening.length;
82
85
  // Supabase MCP sometimes returns the prose envelope with literal "\\n"
83
86
  // separators. Strip those only at the boundary: globally replacing them
84
87
  // corrupts valid escaped newlines inside JSON string values.
85
88
  const inner = trimmed
86
89
  .slice(contentStart, boundaryEnd)
87
90
  .trim()
88
- .replace(/^(?:\\r?\\n)+/, '')
89
- .replace(/(?:\\r?\\n)+$/, '')
91
+ .replace(/^(?:(?:\\r)?\\n)+/, '')
92
+ .replace(/(?:(?:\\r)?\\n)+$/, '')
90
93
  .trim();
91
94
  try {
92
95
  return JSON.parse(inner);
93
- } catch (error) {
94
- const nested = parseJsonCandidate(inner);
95
- if (nested !== null) return nested;
96
- throw usageError(
97
- `Supabase diagnostic rows were not valid JSON: ${error instanceof Error ? error.message : String(error)}; prefix=${JSON.stringify(inner.slice(0, 100))}`,
98
- );
96
+ } catch {
97
+ // The provider also mentions this marker in its introductory prose.
98
+ // Try its actual opening, never a nested tool result's different marker.
99
99
  }
100
100
  }
101
+ if (boundaryEnd >= 0) throw usageError('Supabase diagnostic rows were not valid JSON.');
101
102
  const arrayMatch = trimmed.match(/(\[[\s\S]*\])/);
102
103
  if (arrayMatch) {
103
104
  try {
@@ -27,7 +27,7 @@ const BUNDLE_DIR = join(OUTPUT_DIR, 'bundle');
27
27
  const MANIFEST_FILE = join(OUTPUT_DIR, 'manifest.json');
28
28
  const METADATA_DIR = 'metadata';
29
29
  const CLI_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
30
- const TEMPLATE_SDK_DIR = join(CLI_ROOT, 'template', 'packages', 'sdk');
30
+ const TEMPLATE_SDK_DIR = join(CLI_ROOT, 'dist', 'sdk');
31
31
  export const NOTIS_APP_CATEGORIES = [
32
32
  'Productivity',
33
33
  'Sales & Marketing',
@@ -1847,7 +1847,7 @@ function listFilesRecursive(dir, base = dir, results = []) {
1847
1847
  /**
1848
1848
  * Keep an app's embedded `packages/sdk` copy identical to the SDK this CLI
1849
1849
  * ships. The copy is a mirror by contract (the parity test in the CLI keeps
1850
- * the template in step with packages/sdk), so an app never edits it; before
1850
+ * the bundled artifact generated from packages/sdk), so an app never edits it; before
1851
1851
  * this sync existed every app silently ran whatever SDK snapshot it was
1852
1852
  * scaffolded with and never received hook or style updates.
1853
1853
  *
@@ -80,7 +80,7 @@ function resolveHarnessReactVersion(projectDir) {
80
80
  const candidates = [
81
81
  join(projectDir, 'node_modules', '@notis', 'sdk', 'package.json'),
82
82
  join(REPO_ROOT, 'packages', 'sdk', 'package.json'),
83
- join(CLI_ROOT, 'template', 'packages', 'sdk', 'package.json'),
83
+ join(CLI_ROOT, 'dist', 'sdk', 'package.json'),
84
84
  ];
85
85
  for (const candidate of candidates) {
86
86
  const pkg = readJsonFile(candidate);
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "types": ["node", "react", "react-dom"],
4
- "target": "ES2022",
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "jsx": "react-jsx",
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "declaration": true,
12
- "outDir": "dist",
13
- "rootDir": "src"
14
- },
15
- "include": ["src"]
16
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes