@intelligo-dev/cli 1.0.0-beta.1 → 1.0.0-beta.13

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 (103) hide show
  1. package/NOTICE +6 -0
  2. package/README.md +63 -0
  3. package/dist/bin.js +85 -37
  4. package/dist/bin.js.map +1 -1
  5. package/dist/commands/add.d.ts +22 -1
  6. package/dist/commands/add.d.ts.map +1 -1
  7. package/dist/commands/add.js +61 -4
  8. package/dist/commands/add.js.map +1 -1
  9. package/dist/commands/create-flow.d.ts +34 -0
  10. package/dist/commands/create-flow.d.ts.map +1 -0
  11. package/dist/commands/create-flow.js +180 -0
  12. package/dist/commands/create-flow.js.map +1 -0
  13. package/dist/commands/create.d.ts +23 -6
  14. package/dist/commands/create.d.ts.map +1 -1
  15. package/dist/commands/create.js +45 -13
  16. package/dist/commands/create.js.map +1 -1
  17. package/dist/commands/doctor.d.ts +14 -3
  18. package/dist/commands/doctor.d.ts.map +1 -1
  19. package/dist/commands/doctor.js +293 -37
  20. package/dist/commands/doctor.js.map +1 -1
  21. package/dist/commands/migrate-check.d.ts +54 -1
  22. package/dist/commands/migrate-check.d.ts.map +1 -1
  23. package/dist/commands/migrate-check.js +101 -5
  24. package/dist/commands/migrate-check.js.map +1 -1
  25. package/dist/commands/migrate.d.ts +97 -0
  26. package/dist/commands/migrate.d.ts.map +1 -0
  27. package/dist/commands/migrate.js +147 -0
  28. package/dist/commands/migrate.js.map +1 -0
  29. package/dist/commands/upgrade-check.d.ts +5 -5
  30. package/dist/commands/upgrade-check.d.ts.map +1 -1
  31. package/dist/commands/upgrade-check.js +19 -6
  32. package/dist/commands/upgrade-check.js.map +1 -1
  33. package/dist/env-files.d.ts +12 -0
  34. package/dist/env-files.d.ts.map +1 -0
  35. package/dist/env-files.js +29 -0
  36. package/dist/env-files.js.map +1 -0
  37. package/dist/index.d.ts +9 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +9 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/manifest.d.ts +9 -15
  42. package/dist/manifest.d.ts.map +1 -1
  43. package/dist/manifest.js +5 -16
  44. package/dist/manifest.js.map +1 -1
  45. package/dist/migrations.d.ts +3 -6
  46. package/dist/migrations.d.ts.map +1 -1
  47. package/dist/migrations.js +3 -6
  48. package/dist/migrations.js.map +1 -1
  49. package/dist/model-catalogue.d.ts +14 -0
  50. package/dist/model-catalogue.d.ts.map +1 -0
  51. package/dist/model-catalogue.js +34 -0
  52. package/dist/model-catalogue.js.map +1 -0
  53. package/dist/registry-items.d.ts +56 -0
  54. package/dist/registry-items.d.ts.map +1 -0
  55. package/dist/registry-items.js +103 -0
  56. package/dist/registry-items.js.map +1 -0
  57. package/package.json +36 -10
  58. package/src/bin.ts +264 -0
  59. package/src/commands/add.ts +244 -0
  60. package/src/commands/create-flow.ts +228 -0
  61. package/src/commands/create.ts +139 -0
  62. package/src/commands/doctor.ts +487 -0
  63. package/src/commands/migrate-check.ts +257 -0
  64. package/src/commands/migrate.ts +234 -0
  65. package/src/commands/upgrade-check.ts +157 -0
  66. package/src/env-files.ts +31 -0
  67. package/src/index.ts +39 -0
  68. package/src/manifest.ts +93 -0
  69. package/src/migrations-dir.ts +25 -0
  70. package/src/migrations.ts +133 -0
  71. package/src/model-catalogue.ts +35 -0
  72. package/src/registry-items.ts +132 -0
  73. package/templates/admin-page/admin-page.tsx.tpl +2 -3
  74. package/templates/app-scaffold/assistant-route.ts.tpl +2 -2
  75. package/templates/app-scaffold/auth-route.ts.tpl +10 -0
  76. package/templates/app-scaffold/components.json.tpl +6 -2
  77. package/templates/app-scaffold/db-schema.ts.tpl +29 -0
  78. package/templates/app-scaffold/drizzle-journal.json.tpl +5 -0
  79. package/templates/app-scaffold/drizzle.config.ts.tpl +45 -0
  80. package/templates/app-scaffold/env.example.tpl +65 -1
  81. package/templates/app-scaffold/globals.css.tpl +172 -281
  82. package/templates/app-scaffold/i18n-request.ts.tpl +25 -0
  83. package/templates/app-scaffold/instrumentation.ts.tpl +21 -0
  84. package/templates/app-scaffold/intelligo.ts.tpl +104 -9
  85. package/templates/app-scaffold/layout.tsx.tpl +18 -1
  86. package/templates/app-scaffold/lib-utils.ts.tpl +1 -6
  87. package/templates/app-scaffold/next.config.mjs.tpl +2 -0
  88. package/templates/app-scaffold/package.json.tpl +31 -17
  89. package/templates/app-scaffold/page.tsx.tpl +16 -0
  90. package/templates/app-scaffold/plans.ts.tpl +32 -13
  91. package/templates/app-scaffold/{middleware.ts.tpl → proxy.ts.tpl} +6 -0
  92. package/templates/app-scaffold/sonner.tsx.tpl +42 -20
  93. package/templates/app-scaffold/stripe-webhook-route.ts.tpl +24 -0
  94. package/templates/app-scaffold/theme-provider.tsx.tpl +6 -4
  95. package/templates/app-scaffold/tsconfig.json.tpl +20 -4
  96. package/templates/app-scaffold/use-mobile.ts.tpl +19 -0
  97. package/templates/app-scaffold/workspace-bootstrap.ts.tpl +30 -0
  98. package/templates/maintenance/maintenance-route.ts.tpl +119 -0
  99. package/templates/manifest.json +57 -18
  100. package/templates/registry-items.json +116 -0
  101. package/templates/registry-requires.json +156 -0
  102. package/templates/usage-page/usage-page.tsx.tpl +23 -8
  103. package/templates/billing-page/billing-page.tsx.tpl +0 -72
@@ -1,263 +1,42 @@
1
+ /*
2
+ * Design tokens: shadcn base-nova plus status, layers and motion — what
3
+ * `shadcn add https://intelligo.dev/r/intelligo.json` writes. Re-value
4
+ * the tokens to re-theme every installed page; keep the names, registry
5
+ * items depend on them.
6
+ */
1
7
  @import "tailwindcss";
2
8
  @import "tw-animate-css";
9
+ @import "shadcn/tailwind.css";
3
10
 
4
- /* custom variant for setting dark mode programmatically */
5
- @custom-variant dark (&:is(.dark, .dark *));
6
-
7
- /* ============================================================
8
- Design tokens.
9
- This file is yours — Intelligo generated it once and will not
10
- overwrite it. These tokens are a starting point, not a dependency:
11
- nothing in your app imports them from an Intelligo package, so
12
- edit them freely. Registry items you install with `shadcn add`
13
- assume the shadcn new-york theme below; the ones under "Design
14
- tokens" are optional extras used by some Intelligo-authored
15
- registry items (status colors, agent identity colors) — delete
16
- what you don't use.
17
- ============================================================ */
18
-
19
- /* ---- Light mode tokens ---- */
20
- :root {
21
- /* Status: success */
22
- --status-success: hsl(142 76% 36%);
23
- --status-success-light: hsl(143 85% 96%);
24
- --status-success-dark: hsl(144 61% 20%);
25
-
26
- /* Status: error */
27
- --status-error: hsl(0 84% 60%);
28
- --status-error-light: hsl(0 86% 97%);
29
- --status-error-dark: hsl(0 63% 31%);
30
-
31
- /* Status: warning */
32
- --status-warning: hsl(38 92% 50%);
33
- --status-warning-light: hsl(48 96% 89%);
34
- --status-warning-dark: hsl(32 95% 44%);
35
-
36
- /* Status: info */
37
- --status-info: hsl(217 91% 60%);
38
- --status-info-light: hsl(214 95% 93%);
39
- --status-info-dark: hsl(224 76% 48%);
40
-
41
- /* Brand — Monochrome */
42
- --brand-primary: #18181B;
43
- --brand-primary-foreground: #ffffff;
44
- --brand-accent: #27272A;
45
- --brand-accent-end: #3F3F46;
46
-
47
- /* Spacing (semantic aliases) */
48
- --space-xs: 0.25rem;
49
- --space-sm: 0.5rem;
50
- --space-md: 1rem;
51
- --space-lg: 1.5rem;
52
- --space-xl: 2rem;
53
- --space-2xl: 3rem;
54
-
55
- /* Shadows */
56
- --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
57
- --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
58
- --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
59
- --shadow-glow-primary: 0 0 40px rgba(255, 255, 255, 0.1);
60
-
61
- /* Z-index scale */
62
- --z-dropdown: 50;
63
- --z-sticky: 100;
64
- --z-modal: 200;
65
- --z-popover: 250;
66
- --z-toast: 300;
67
-
68
- /* Typography */
69
- --font-size-xs: 0.75rem; /* 12px */
70
- --font-size-sm: 0.875rem; /* 14px */
71
- --font-size-base: 1rem; /* 16px */
72
- --font-size-lg: 1.125rem; /* 18px */
73
- --font-size-xl: 1.25rem; /* 20px */
74
- --font-size-2xl: 1.5rem; /* 24px */
75
- --font-size-3xl: 1.875rem; /* 30px */
76
-
77
- --line-height-tight: 1.25;
78
- --line-height-snug: 1.375;
79
- --line-height-normal: 1.5;
80
- --line-height-relaxed: 1.625;
81
-
82
- --letter-spacing-tight: -0.025em;
83
- --letter-spacing-normal: 0em;
84
- --letter-spacing-wide: 0.025em;
85
-
86
- /* Agent identity colors */
87
- --agent-career: #7c3aed;
88
- --agent-university: #2563eb;
89
- --agent-scholarship: #d97706;
90
- --agent-student-life: #059669;
91
- --agent-ai-futures: #e11d48;
92
- --agent-parent: #92400e;
93
-
94
- /* Weather (decorative/thematic) */
95
- --weather-day-start: hsl(200 95% 65%); /* sky-400 equivalent */
96
- --weather-day-mid: hsl(217 91% 60%); /* blue-500 equivalent */
97
- --weather-day-end: hsl(221 83% 53%); /* blue-600 equivalent */
98
- --weather-night-start: hsl(244 47% 20%); /* indigo-900 equivalent */
99
- --weather-night-mid: hsl(269 67% 18%); /* purple-900 equivalent */
100
- --weather-night-end: hsl(222 47% 11%); /* slate-900 equivalent */
101
- }
102
-
103
- /* ---- Dark mode overrides ---- */
104
- .dark {
105
- /* Status: success — lighter text on dark backgrounds */
106
- --status-success: hsl(142 69% 58%);
107
- --status-success-light: hsl(143 50% 15%);
108
- --status-success-dark: hsl(144 76% 80%);
109
-
110
- /* Status: error */
111
- --status-error: hsl(0 91% 71%);
112
- --status-error-light: hsl(0 50% 15%);
113
- --status-error-dark: hsl(0 84% 85%);
114
-
115
- /* Status: warning */
116
- --status-warning: hsl(38 95% 64%);
117
- --status-warning-light: hsl(38 60% 15%);
118
- --status-warning-dark: hsl(38 92% 80%);
11
+ @custom-variant dark (&:is(.dark *));
119
12
 
120
- /* Status: info */
121
- --status-info: hsl(217 91% 70%);
122
- --status-info-light: hsl(217 60% 15%);
123
- --status-info-dark: hsl(217 91% 85%);
124
-
125
- /* Brand (dark) — Monochrome */
126
- --brand-primary: #E8E8E8;
127
- --brand-primary-foreground: #121212;
128
- --brand-accent: #888888;
129
- --brand-accent-end: #555555;
130
-
131
- /* Weather — same in dark mode (self-contained card) */
132
- --weather-day-start: hsl(200 95% 65%);
133
- --weather-day-mid: hsl(217 91% 60%);
134
- --weather-day-end: hsl(221 83% 53%);
135
- --weather-night-start: hsl(244 47% 20%);
136
- --weather-night-mid: hsl(269 67% 18%);
137
- --weather-night-end: hsl(222 47% 11%);
138
- }
139
-
140
- /* ============================================================
141
- shadcn new-york theme — style: new-york, baseColor: neutral,
142
- cssVariables: true (components.json). Standard shadcn palette;
143
- registry items you install assume this default theme, so change
144
- it after things are working, not before.
145
- ============================================================ */
146
-
147
- :root {
148
- --radius: 0.625rem;
149
- --background: oklch(1 0 0);
150
- --foreground: oklch(0.145 0 0);
151
- --card: oklch(1 0 0);
152
- --card-foreground: oklch(0.145 0 0);
153
- --popover: oklch(1 0 0);
154
- --popover-foreground: oklch(0.145 0 0);
155
- --primary: oklch(0.205 0 0);
156
- --primary-foreground: oklch(0.985 0 0);
157
- --secondary: oklch(0.97 0 0);
158
- --secondary-foreground: oklch(0.205 0 0);
159
- --muted: oklch(0.97 0 0);
160
- --muted-foreground: oklch(0.556 0 0);
161
- --accent: oklch(0.97 0 0);
162
- --accent-foreground: oklch(0.205 0 0);
163
- --destructive: oklch(0.577 0.245 27.325);
164
- --destructive-foreground: oklch(0.985 0 0);
165
- --border: oklch(0.922 0 0);
166
- --input: oklch(0.922 0 0);
167
- --ring: oklch(0.708 0 0);
168
- --chart-1: oklch(0.646 0.222 41.116);
169
- --chart-2: oklch(0.6 0.118 184.704);
170
- --chart-3: oklch(0.398 0.07 227.392);
171
- --chart-4: oklch(0.828 0.189 84.429);
172
- --chart-5: oklch(0.769 0.188 70.08);
173
- --sidebar: oklch(0.985 0 0);
174
- --sidebar-foreground: oklch(0.145 0 0);
175
- --sidebar-primary: oklch(0.205 0 0);
176
- --sidebar-primary-foreground: oklch(0.985 0 0);
177
- --sidebar-accent: oklch(0.97 0 0);
178
- --sidebar-accent-foreground: oklch(0.205 0 0);
179
- --sidebar-border: oklch(0.922 0 0);
180
- --sidebar-ring: oklch(0.708 0 0);
181
- }
182
-
183
- .dark {
184
- --background: oklch(0.145 0 0);
185
- --foreground: oklch(0.985 0 0);
186
- --card: oklch(0.205 0 0);
187
- --card-foreground: oklch(0.985 0 0);
188
- --popover: oklch(0.205 0 0);
189
- --popover-foreground: oklch(0.985 0 0);
190
- --primary: oklch(0.922 0 0);
191
- --primary-foreground: oklch(0.205 0 0);
192
- --secondary: oklch(0.269 0 0);
193
- --secondary-foreground: oklch(0.985 0 0);
194
- --muted: oklch(0.269 0 0);
195
- --muted-foreground: oklch(0.708 0 0);
196
- --accent: oklch(0.269 0 0);
197
- --accent-foreground: oklch(0.985 0 0);
198
- --destructive: oklch(0.704 0.191 22.216);
199
- --destructive-foreground: oklch(0.985 0 0);
200
- --border: oklch(1 0 0 / 10%);
201
- --input: oklch(1 0 0 / 15%);
202
- --ring: oklch(0.556 0 0);
203
- --chart-1: oklch(0.488 0.243 264.376);
204
- --chart-2: oklch(0.696 0.17 162.48);
205
- --chart-3: oklch(0.769 0.188 70.08);
206
- --chart-4: oklch(0.627 0.265 303.9);
207
- --chart-5: oklch(0.645 0.246 16.439);
208
- --sidebar: oklch(0.205 0 0);
209
- --sidebar-foreground: oklch(0.985 0 0);
210
- --sidebar-primary: oklch(0.488 0.243 264.376);
211
- --sidebar-primary-foreground: oklch(0.985 0 0);
212
- --sidebar-accent: oklch(0.269 0 0);
213
- --sidebar-accent-foreground: oklch(0.985 0 0);
214
- --sidebar-border: oklch(1 0 0 / 10%);
215
- --sidebar-ring: oklch(0.556 0 0);
216
- }
217
-
218
- /* define theme — maps CSS variables to Tailwind utilities */
219
13
  @theme inline {
220
- --font-sans: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
221
-
222
- --radius-sm: calc(var(--radius) - 4px);
223
- --radius-md: calc(var(--radius) - 2px);
224
- --radius-lg: var(--radius);
225
- --radius-xl: calc(var(--radius) + 4px);
226
-
14
+ --font-sans: var(--font-sans);
15
+ --font-mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
16
+ --font-heading: var(--font-sans);
227
17
  --color-background: var(--background);
228
18
  --color-foreground: var(--foreground);
229
-
230
19
  --color-card: var(--card);
231
20
  --color-card-foreground: var(--card-foreground);
232
-
233
21
  --color-popover: var(--popover);
234
22
  --color-popover-foreground: var(--popover-foreground);
235
-
236
23
  --color-primary: var(--primary);
237
24
  --color-primary-foreground: var(--primary-foreground);
238
-
239
25
  --color-secondary: var(--secondary);
240
26
  --color-secondary-foreground: var(--secondary-foreground);
241
-
242
27
  --color-muted: var(--muted);
243
28
  --color-muted-foreground: var(--muted-foreground);
244
-
245
29
  --color-accent: var(--accent);
246
30
  --color-accent-foreground: var(--accent-foreground);
247
-
248
31
  --color-destructive: var(--destructive);
249
- --color-destructive-foreground: var(--destructive-foreground);
250
-
251
32
  --color-border: var(--border);
252
33
  --color-input: var(--input);
253
34
  --color-ring: var(--ring);
254
-
255
35
  --color-chart-1: var(--chart-1);
256
36
  --color-chart-2: var(--chart-2);
257
37
  --color-chart-3: var(--chart-3);
258
38
  --color-chart-4: var(--chart-4);
259
39
  --color-chart-5: var(--chart-5);
260
-
261
40
  --color-sidebar: var(--sidebar);
262
41
  --color-sidebar-foreground: var(--sidebar-foreground);
263
42
  --color-sidebar-primary: var(--sidebar-primary);
@@ -266,64 +45,176 @@
266
45
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
267
46
  --color-sidebar-border: var(--sidebar-border);
268
47
  --color-sidebar-ring: var(--sidebar-ring);
48
+ --color-destructive-foreground: var(--destructive-foreground);
49
+ --color-success: var(--success);
50
+ --color-success-foreground: var(--success-foreground);
51
+ --color-warning: var(--warning);
52
+ --color-warning-foreground: var(--warning-foreground);
53
+ --color-info: var(--info);
54
+ --color-info-foreground: var(--info-foreground);
55
+ --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
56
+ --ease-emphasized: cubic-bezier(0.32, 0.72, 0, 1);
57
+ --ease-exit: cubic-bezier(0.77, 0, 0.175, 1);
58
+ --radius-sm: calc(var(--radius) * 0.6);
59
+ --radius-md: calc(var(--radius) * 0.8);
60
+ --radius-lg: var(--radius);
61
+ --radius-xl: calc(var(--radius) * 1.4);
62
+ --radius-2xl: calc(var(--radius) * 1.8);
63
+ --radius-3xl: calc(var(--radius) * 2.2);
64
+ --radius-4xl: calc(var(--radius) * 2.6);
65
+ }
269
66
 
270
- /* Design token mappings — from packages/ui/src/tokens.css */
271
- --color-status-success: var(--status-success);
272
- --color-status-success-light: var(--status-success-light);
273
- --color-status-error: var(--status-error);
274
- --color-status-error-light: var(--status-error-light);
275
- --color-status-warning: var(--status-warning);
276
- --color-status-warning-light: var(--status-warning-light);
277
- --color-status-info: var(--status-info);
278
- --color-status-info-light: var(--status-info-light);
279
- --color-brand-primary: var(--brand-primary);
280
- --color-brand-accent: var(--brand-accent);
281
-
282
- /* Agent color mappings */
283
- --color-agent-career: var(--agent-career);
284
- --color-agent-university: var(--agent-university);
285
- --color-agent-scholarship: var(--agent-scholarship);
286
- --color-agent-student-life: var(--agent-student-life);
287
- --color-agent-ai-futures: var(--agent-ai-futures);
288
- --color-agent-parent: var(--agent-parent);
289
-
290
- /* Typography token mappings */
291
- --font-size-xs: var(--font-size-xs);
292
- --font-size-sm: var(--font-size-sm);
293
- --font-size-base: var(--font-size-base);
294
- --font-size-lg: var(--font-size-lg);
295
- --font-size-xl: var(--font-size-xl);
296
- --font-size-2xl: var(--font-size-2xl);
297
- --font-size-3xl: var(--font-size-3xl);
298
- --line-height-tight: var(--line-height-tight);
299
- --line-height-snug: var(--line-height-snug);
300
- --line-height-normal: var(--line-height-normal);
301
- --line-height-relaxed: var(--line-height-relaxed);
302
- --letter-spacing-tight: var(--letter-spacing-tight);
303
- --letter-spacing-normal: var(--letter-spacing-normal);
304
- --letter-spacing-wide: var(--letter-spacing-wide);
67
+ :root {
68
+ --font-sans: "Geist", "Geist Fallback", -apple-system, "Segoe UI", sans-serif;
69
+ --background: oklch(0.99 0 0);
70
+ --foreground: oklch(0.15 0 0);
71
+ --card: oklch(0.97 0 0);
72
+ --card-foreground: oklch(0.15 0 0);
73
+ --popover: oklch(0.99 0 0);
74
+ --popover-foreground: oklch(0.15 0 0);
75
+ --primary: oklch(0.15 0 0);
76
+ --primary-foreground: oklch(0.99 0 0);
77
+ --secondary: oklch(0.955 0 0);
78
+ --secondary-foreground: oklch(0.15 0 0);
79
+ --muted: oklch(0.97 0 0);
80
+ --muted-foreground: oklch(0.5 0 0);
81
+ --accent: oklch(0.95 0 0);
82
+ --accent-foreground: oklch(0.15 0 0);
83
+ --destructive: oklch(0.52 0.2 25);
84
+ --border: oklch(0.15 0 0 / 8%);
85
+ --input: oklch(0.15 0 0 / 14%);
86
+ --ring: oklch(0.55 0 0);
87
+ --chart-1: oklch(0.87 0 0);
88
+ --chart-2: oklch(0.556 0 0);
89
+ --chart-3: oklch(0.439 0 0);
90
+ --chart-4: oklch(0.371 0 0);
91
+ --chart-5: oklch(0.269 0 0);
92
+ --radius: 0.5rem;
93
+ --sidebar: oklch(0.975 0 0);
94
+ --sidebar-foreground: oklch(0.15 0 0);
95
+ --sidebar-primary: oklch(0.15 0 0);
96
+ --sidebar-primary-foreground: oklch(0.99 0 0);
97
+ --sidebar-accent: oklch(0.94 0 0);
98
+ --sidebar-accent-foreground: oklch(0.15 0 0);
99
+ --sidebar-border: oklch(0.15 0 0 / 8%);
100
+ --sidebar-ring: oklch(0.55 0 0);
101
+ --destructive-foreground: oklch(0.99 0 0);
102
+ --success: oklch(0.49 0.12 155);
103
+ --success-foreground: oklch(0.99 0 0);
104
+ --warning: oklch(0.5 0.105 75);
105
+ --warning-foreground: oklch(0.99 0 0);
106
+ --info: oklch(0.5 0.135 245);
107
+ --info-foreground: oklch(0.99 0 0);
305
108
  }
306
109
 
307
- /*
308
- The default border color has changed to `currentcolor` in Tailwind CSS v4,
309
- so we've added these compatibility styles to make sure everything still
310
- looks the same as it did with Tailwind CSS v3.
110
+ .dark {
111
+ --background: oklch(0.196 0 0);
112
+ --foreground: oklch(0.96 0 0);
113
+ --card: oklch(0.227 0 0);
114
+ --card-foreground: oklch(0.96 0 0);
115
+ --popover: oklch(0.227 0 0);
116
+ --popover-foreground: oklch(0.96 0 0);
117
+ --primary: oklch(0.96 0 0);
118
+ --primary-foreground: oklch(0.196 0 0);
119
+ --secondary: oklch(0.27 0 0);
120
+ --secondary-foreground: oklch(0.96 0 0);
121
+ --muted: oklch(0.227 0 0);
122
+ --muted-foreground: oklch(0.68 0 0);
123
+ --accent: oklch(0.28 0 0);
124
+ --accent-foreground: oklch(0.96 0 0);
125
+ --destructive: oklch(0.7 0.18 25);
126
+ --border: oklch(1 0 0 / 7%);
127
+ --input: oklch(1 0 0 / 12%);
128
+ --ring: oklch(0.58 0 0);
129
+ --chart-1: oklch(0.87 0 0);
130
+ --chart-2: oklch(0.556 0 0);
131
+ --chart-3: oklch(0.439 0 0);
132
+ --chart-4: oklch(0.371 0 0);
133
+ --chart-5: oklch(0.269 0 0);
134
+ --sidebar: oklch(0.175 0 0);
135
+ --sidebar-foreground: oklch(0.96 0 0);
136
+ --sidebar-primary: oklch(0.96 0 0);
137
+ --sidebar-primary-foreground: oklch(0.196 0 0);
138
+ --sidebar-accent: oklch(0.26 0 0);
139
+ --sidebar-accent-foreground: oklch(0.96 0 0);
140
+ --sidebar-border: oklch(1 0 0 / 7%);
141
+ --sidebar-ring: oklch(0.58 0 0);
142
+ --destructive-foreground: oklch(0.196 0 0);
143
+ --success: oklch(0.72 0.16 155);
144
+ --success-foreground: oklch(0.196 0 0);
145
+ --warning: oklch(0.78 0.15 75);
146
+ --warning-foreground: oklch(0.196 0 0);
147
+ --info: oklch(0.72 0.13 245);
148
+ --info-foreground: oklch(0.196 0 0);
149
+ }
311
150
 
312
- If we ever want to remove these styles, we need to add an explicit border
313
- color utility to any element that depends on these defaults.
314
- */
315
151
  @layer base {
316
- *,
317
- ::after,
318
- ::before,
319
- ::backdrop,
320
- ::file-selector-button {
321
- border-color: var(--color-gray-200, currentcolor);
322
- }
323
152
  * {
324
153
  @apply border-border outline-ring/50;
325
154
  }
326
155
  body {
327
156
  @apply bg-background text-foreground;
328
157
  }
158
+ html {
159
+ @apply font-sans;
160
+ }
161
+ :root {
162
+ --z-sticky: 10;
163
+ --z-dropdown: 20;
164
+ --z-overlay: 40;
165
+ --z-modal: 50;
166
+ --z-popover: 60;
167
+ --z-toast: 70;
168
+ --duration-fast: 120ms;
169
+ --duration-normal: 200ms;
170
+ --duration-slow: 320ms;
171
+ }
172
+ }
173
+
174
+ @utility z-sticky {
175
+ z-index: var(--z-sticky);
176
+ }
177
+
178
+ @utility z-dropdown {
179
+ z-index: var(--z-dropdown);
180
+ }
181
+
182
+ @utility z-overlay {
183
+ z-index: var(--z-overlay);
184
+ }
185
+
186
+ @utility z-modal {
187
+ z-index: var(--z-modal);
188
+ }
189
+
190
+ @utility z-popover {
191
+ z-index: var(--z-popover);
192
+ }
193
+
194
+ @utility z-toast {
195
+ z-index: var(--z-toast);
196
+ }
197
+
198
+ @utility duration-fast {
199
+ transition-duration: var(--duration-fast);
200
+ animation-duration: var(--duration-fast);
201
+ }
202
+
203
+ @utility duration-normal {
204
+ transition-duration: var(--duration-normal);
205
+ animation-duration: var(--duration-normal);
206
+ }
207
+
208
+ @utility duration-slow {
209
+ transition-duration: var(--duration-slow);
210
+ animation-duration: var(--duration-slow);
211
+ }
212
+
213
+ @media (prefers-reduced-motion: reduce) {
214
+ *, ::before, ::after {
215
+ animation-duration: 0.01ms !important;
216
+ animation-iteration-count: 1 !important;
217
+ transition-duration: 0.01ms !important;
218
+ scroll-behavior: auto !important;
219
+ }
329
220
  }
@@ -3,8 +3,32 @@ import path from "node:path";
3
3
 
4
4
  import { getRequestConfig } from "next-intl/server";
5
5
 
6
+ import {
7
+ getRequestHeaders,
8
+ resolveTimeZone,
9
+ } from "@intelligo-dev/core/request-context";
10
+
6
11
  import { routing } from "./routing";
7
12
 
13
+ /**
14
+ * The reader's own time zone, from the cookie the app shell writes.
15
+ *
16
+ * Every date and time on the page formats against this, so a reader in
17
+ * +08:00 sees the day they actually had rather than UTC's. Anything the
18
+ * runtime does not recognise — and a first request, which has no cookie
19
+ * yet — falls back to UTC.
20
+ */
21
+ async function requestTimeZone(): Promise<string> {
22
+ try {
23
+ const cookie = (await getRequestHeaders()).get("cookie") ?? "";
24
+ const match = cookie.match(/(?:^|;\s*)tz=([^;]*)/);
25
+ return resolveTimeZone(match?.[1] ? decodeURIComponent(match[1]) : null);
26
+ } catch {
27
+ // No request context bound (a build-time render, a script).
28
+ return "UTC";
29
+ }
30
+ }
31
+
8
32
  const MESSAGES_ROOT = path.join(process.cwd(), "messages");
9
33
 
10
34
  /**
@@ -47,5 +71,6 @@ export default getRequestConfig(async ({ requestLocale }) => {
47
71
  return {
48
72
  locale,
49
73
  messages: loadMessages(locale),
74
+ timeZone: await requestTimeZone(),
50
75
  };
51
76
  });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Next.js runs `register()` once per server process, before the first
3
+ * request. Composing here is what lets a page, a Server Action or a
4
+ * Route Handler read a registry — plans, model prices, the request
5
+ * context source — without each of them remembering to compose first.
6
+ * The registries live on `globalThis`, so a bundle that duplicates
7
+ * `lib/intelligo` still sees what this bound.
8
+ *
9
+ * Route Handlers keep their own `composeIntelligo()` call as well: it is
10
+ * idempotent, and a handler invoked from a test or a worker has no
11
+ * instrumentation hook to rely on.
12
+ */
13
+ export async function register() {
14
+ if (process.env.NEXT_RUNTIME === "nodejs") {
15
+ const { composeIntelligo, seedIntelligo } = await import("./lib/intelligo");
16
+ composeIntelligo();
17
+ // The first request finds the plan and billing-settings rows in
18
+ // place. A failure is already logged, and the next request retries.
19
+ await seedIntelligo().catch(() => undefined);
20
+ }
21
+ }