@vorionsys/shared-constants 1.0.0
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.
- package/dist/api-versions.cjs +183 -0
- package/dist/api-versions.d.cts +91 -0
- package/dist/api-versions.js +46 -0
- package/dist/capabilities.cjs +246 -0
- package/dist/capabilities.d.cts +55 -0
- package/dist/capabilities.js +21 -0
- package/dist/chunk-F2R6HBF5.js +253 -0
- package/dist/chunk-IKLCEYZT.js +142 -0
- package/dist/chunk-JZJPDGG7.js +215 -0
- package/dist/chunk-P3VPMVF3.js +223 -0
- package/dist/chunk-PHL3CB53.js +159 -0
- package/dist/chunk-RZQZEF6Q.js +176 -0
- package/dist/chunk-TYCMBQGU.js +353 -0
- package/dist/chunk-UDCZKJSQ.js +139 -0
- package/dist/domains.cjs +175 -0
- package/dist/domains.d.cts +250 -0
- package/dist/domains.js +24 -0
- package/dist/error-codes.cjs +390 -0
- package/dist/error-codes.d.cts +633 -0
- package/dist/error-codes.js +32 -0
- package/dist/index.cjs +1762 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.js +198 -0
- package/dist/products.cjs +208 -0
- package/dist/products.d.cts +80 -0
- package/dist/products.js +22 -0
- package/dist/rate-limits.cjs +295 -0
- package/dist/rate-limits.d.cts +80 -0
- package/dist/rate-limits.js +21 -0
- package/dist/themes.cjs +251 -0
- package/dist/themes.d.cts +85 -0
- package/dist/themes.js +14 -0
- package/dist/tiers.cjs +194 -0
- package/dist/tiers.d.cts +75 -0
- package/dist/tiers.js +28 -0
- package/package.json +71 -0
- package/src/api-versions.ts +250 -0
- package/src/capabilities.ts +272 -0
- package/src/domains.ts +216 -0
- package/src/error-codes.ts +494 -0
- package/src/index.ts +206 -0
- package/src/products.ts +285 -0
- package/src/rate-limits.ts +334 -0
- package/src/themes.ts +380 -0
- package/src/tiers.ts +239 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vorionsys/shared-constants - Rate Limits
|
|
3
|
+
*
|
|
4
|
+
* Rate limits by trust tier - used across all APIs
|
|
5
|
+
* Higher trust = higher limits
|
|
6
|
+
*
|
|
7
|
+
* @see https://cognigate.dev/docs/rate-limits
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { TrustTier } from './tiers.js';
|
|
11
|
+
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// RATE LIMIT DEFINITIONS
|
|
14
|
+
// =============================================================================
|
|
15
|
+
|
|
16
|
+
export interface RateLimitConfig {
|
|
17
|
+
/** Requests per second */
|
|
18
|
+
requestsPerSecond: number;
|
|
19
|
+
|
|
20
|
+
/** Requests per minute */
|
|
21
|
+
requestsPerMinute: number;
|
|
22
|
+
|
|
23
|
+
/** Requests per hour */
|
|
24
|
+
requestsPerHour: number;
|
|
25
|
+
|
|
26
|
+
/** Requests per day */
|
|
27
|
+
requestsPerDay: number;
|
|
28
|
+
|
|
29
|
+
/** Burst limit (max concurrent) */
|
|
30
|
+
burstLimit: number;
|
|
31
|
+
|
|
32
|
+
/** Max payload size in bytes */
|
|
33
|
+
maxPayloadBytes: number;
|
|
34
|
+
|
|
35
|
+
/** Max response size in bytes */
|
|
36
|
+
maxResponseBytes: number;
|
|
37
|
+
|
|
38
|
+
/** Connection timeout in ms */
|
|
39
|
+
connectionTimeoutMs: number;
|
|
40
|
+
|
|
41
|
+
/** Request timeout in ms */
|
|
42
|
+
requestTimeoutMs: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// =============================================================================
|
|
46
|
+
// RATE LIMITS BY TIER
|
|
47
|
+
// =============================================================================
|
|
48
|
+
|
|
49
|
+
export const RATE_LIMITS: Record<TrustTier, RateLimitConfig> = {
|
|
50
|
+
[TrustTier.T0_SANDBOX]: {
|
|
51
|
+
requestsPerSecond: 1,
|
|
52
|
+
requestsPerMinute: 10,
|
|
53
|
+
requestsPerHour: 100,
|
|
54
|
+
requestsPerDay: 500,
|
|
55
|
+
burstLimit: 2,
|
|
56
|
+
maxPayloadBytes: 1024 * 10, // 10 KB
|
|
57
|
+
maxResponseBytes: 1024 * 100, // 100 KB
|
|
58
|
+
connectionTimeoutMs: 5000,
|
|
59
|
+
requestTimeoutMs: 10000,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
[TrustTier.T1_OBSERVED]: {
|
|
63
|
+
requestsPerSecond: 2,
|
|
64
|
+
requestsPerMinute: 30,
|
|
65
|
+
requestsPerHour: 500,
|
|
66
|
+
requestsPerDay: 2000,
|
|
67
|
+
burstLimit: 5,
|
|
68
|
+
maxPayloadBytes: 1024 * 50, // 50 KB
|
|
69
|
+
maxResponseBytes: 1024 * 500, // 500 KB
|
|
70
|
+
connectionTimeoutMs: 5000,
|
|
71
|
+
requestTimeoutMs: 15000,
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
[TrustTier.T2_PROVISIONAL]: {
|
|
75
|
+
requestsPerSecond: 5,
|
|
76
|
+
requestsPerMinute: 100,
|
|
77
|
+
requestsPerHour: 2000,
|
|
78
|
+
requestsPerDay: 10000,
|
|
79
|
+
burstLimit: 10,
|
|
80
|
+
maxPayloadBytes: 1024 * 100, // 100 KB
|
|
81
|
+
maxResponseBytes: 1024 * 1024, // 1 MB
|
|
82
|
+
connectionTimeoutMs: 10000,
|
|
83
|
+
requestTimeoutMs: 30000,
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
[TrustTier.T3_MONITORED]: {
|
|
87
|
+
requestsPerSecond: 10,
|
|
88
|
+
requestsPerMinute: 300,
|
|
89
|
+
requestsPerHour: 5000,
|
|
90
|
+
requestsPerDay: 50000,
|
|
91
|
+
burstLimit: 20,
|
|
92
|
+
maxPayloadBytes: 1024 * 500, // 500 KB
|
|
93
|
+
maxResponseBytes: 1024 * 1024 * 5, // 5 MB
|
|
94
|
+
connectionTimeoutMs: 10000,
|
|
95
|
+
requestTimeoutMs: 60000,
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
[TrustTier.T4_STANDARD]: {
|
|
99
|
+
requestsPerSecond: 20,
|
|
100
|
+
requestsPerMinute: 600,
|
|
101
|
+
requestsPerHour: 10000,
|
|
102
|
+
requestsPerDay: 100000,
|
|
103
|
+
burstLimit: 50,
|
|
104
|
+
maxPayloadBytes: 1024 * 1024, // 1 MB
|
|
105
|
+
maxResponseBytes: 1024 * 1024 * 10, // 10 MB
|
|
106
|
+
connectionTimeoutMs: 15000,
|
|
107
|
+
requestTimeoutMs: 120000,
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
[TrustTier.T5_TRUSTED]: {
|
|
111
|
+
requestsPerSecond: 50,
|
|
112
|
+
requestsPerMinute: 1500,
|
|
113
|
+
requestsPerHour: 30000,
|
|
114
|
+
requestsPerDay: 300000,
|
|
115
|
+
burstLimit: 100,
|
|
116
|
+
maxPayloadBytes: 1024 * 1024 * 5, // 5 MB
|
|
117
|
+
maxResponseBytes: 1024 * 1024 * 50, // 50 MB
|
|
118
|
+
connectionTimeoutMs: 30000,
|
|
119
|
+
requestTimeoutMs: 300000,
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
[TrustTier.T6_CERTIFIED]: {
|
|
123
|
+
requestsPerSecond: 100,
|
|
124
|
+
requestsPerMinute: 3000,
|
|
125
|
+
requestsPerHour: 100000,
|
|
126
|
+
requestsPerDay: 1000000,
|
|
127
|
+
burstLimit: 200,
|
|
128
|
+
maxPayloadBytes: 1024 * 1024 * 10, // 10 MB
|
|
129
|
+
maxResponseBytes: 1024 * 1024 * 100, // 100 MB
|
|
130
|
+
connectionTimeoutMs: 60000,
|
|
131
|
+
requestTimeoutMs: 600000,
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
[TrustTier.T7_AUTONOMOUS]: {
|
|
135
|
+
requestsPerSecond: 500,
|
|
136
|
+
requestsPerMinute: 10000,
|
|
137
|
+
requestsPerHour: 500000,
|
|
138
|
+
requestsPerDay: 5000000,
|
|
139
|
+
burstLimit: 500,
|
|
140
|
+
maxPayloadBytes: 1024 * 1024 * 50, // 50 MB
|
|
141
|
+
maxResponseBytes: 1024 * 1024 * 500, // 500 MB
|
|
142
|
+
connectionTimeoutMs: 120000,
|
|
143
|
+
requestTimeoutMs: 1200000,
|
|
144
|
+
},
|
|
145
|
+
} as const;
|
|
146
|
+
|
|
147
|
+
// =============================================================================
|
|
148
|
+
// HELPER FUNCTIONS
|
|
149
|
+
// =============================================================================
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Get rate limits for a trust tier
|
|
153
|
+
*/
|
|
154
|
+
export function getRateLimits(tier: TrustTier): RateLimitConfig {
|
|
155
|
+
return RATE_LIMITS[tier];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get the minimum tier required for specific rate limits
|
|
160
|
+
*/
|
|
161
|
+
export function getMinTierForLimits(config: {
|
|
162
|
+
requestsPerSecond?: number;
|
|
163
|
+
requestsPerMinute?: number;
|
|
164
|
+
requestsPerHour?: number;
|
|
165
|
+
requestsPerDay?: number;
|
|
166
|
+
}): TrustTier {
|
|
167
|
+
const tiers = Object.values(TrustTier).filter(t => typeof t === 'number') as TrustTier[];
|
|
168
|
+
|
|
169
|
+
for (const tier of tiers) {
|
|
170
|
+
const limits = RATE_LIMITS[tier];
|
|
171
|
+
if (
|
|
172
|
+
(config.requestsPerSecond === undefined || limits.requestsPerSecond >= config.requestsPerSecond) &&
|
|
173
|
+
(config.requestsPerMinute === undefined || limits.requestsPerMinute >= config.requestsPerMinute) &&
|
|
174
|
+
(config.requestsPerHour === undefined || limits.requestsPerHour >= config.requestsPerHour) &&
|
|
175
|
+
(config.requestsPerDay === undefined || limits.requestsPerDay >= config.requestsPerDay)
|
|
176
|
+
) {
|
|
177
|
+
return tier;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return TrustTier.T7_AUTONOMOUS;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Check if a rate limit would be exceeded
|
|
186
|
+
*/
|
|
187
|
+
export function wouldExceedLimit(
|
|
188
|
+
tier: TrustTier,
|
|
189
|
+
window: 'second' | 'minute' | 'hour' | 'day',
|
|
190
|
+
currentCount: number,
|
|
191
|
+
): boolean {
|
|
192
|
+
const limits = RATE_LIMITS[tier];
|
|
193
|
+
switch (window) {
|
|
194
|
+
case 'second':
|
|
195
|
+
return currentCount >= limits.requestsPerSecond;
|
|
196
|
+
case 'minute':
|
|
197
|
+
return currentCount >= limits.requestsPerMinute;
|
|
198
|
+
case 'hour':
|
|
199
|
+
return currentCount >= limits.requestsPerHour;
|
|
200
|
+
case 'day':
|
|
201
|
+
return currentCount >= limits.requestsPerDay;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Format rate limit for display
|
|
207
|
+
*/
|
|
208
|
+
export function formatRateLimit(tier: TrustTier): string {
|
|
209
|
+
const limits = RATE_LIMITS[tier];
|
|
210
|
+
return `${limits.requestsPerSecond}/s, ${limits.requestsPerMinute}/min, ${limits.requestsPerHour}/hr`;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// =============================================================================
|
|
214
|
+
// QUOTA DEFINITIONS (for billing/usage)
|
|
215
|
+
// =============================================================================
|
|
216
|
+
|
|
217
|
+
export interface QuotaConfig {
|
|
218
|
+
/** Monthly API calls included */
|
|
219
|
+
monthlyApiCalls: number;
|
|
220
|
+
|
|
221
|
+
/** Monthly compute units included */
|
|
222
|
+
monthlyComputeUnits: number;
|
|
223
|
+
|
|
224
|
+
/** Monthly storage (bytes) */
|
|
225
|
+
monthlyStorageBytes: number;
|
|
226
|
+
|
|
227
|
+
/** Monthly bandwidth (bytes) */
|
|
228
|
+
monthlyBandwidthBytes: number;
|
|
229
|
+
|
|
230
|
+
/** Max agents allowed */
|
|
231
|
+
maxAgents: number;
|
|
232
|
+
|
|
233
|
+
/** Max webhooks */
|
|
234
|
+
maxWebhooks: number;
|
|
235
|
+
|
|
236
|
+
/** Max team members */
|
|
237
|
+
maxTeamMembers: number;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const TIER_QUOTAS: Record<TrustTier, QuotaConfig> = {
|
|
241
|
+
[TrustTier.T0_SANDBOX]: {
|
|
242
|
+
monthlyApiCalls: 1000,
|
|
243
|
+
monthlyComputeUnits: 100,
|
|
244
|
+
monthlyStorageBytes: 1024 * 1024 * 10, // 10 MB
|
|
245
|
+
monthlyBandwidthBytes: 1024 * 1024 * 100, // 100 MB
|
|
246
|
+
maxAgents: 1,
|
|
247
|
+
maxWebhooks: 1,
|
|
248
|
+
maxTeamMembers: 1,
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
[TrustTier.T1_OBSERVED]: {
|
|
252
|
+
monthlyApiCalls: 10000,
|
|
253
|
+
monthlyComputeUnits: 1000,
|
|
254
|
+
monthlyStorageBytes: 1024 * 1024 * 100, // 100 MB
|
|
255
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024, // 1 GB
|
|
256
|
+
maxAgents: 5,
|
|
257
|
+
maxWebhooks: 5,
|
|
258
|
+
maxTeamMembers: 3,
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
[TrustTier.T2_PROVISIONAL]: {
|
|
262
|
+
monthlyApiCalls: 50000,
|
|
263
|
+
monthlyComputeUnits: 5000,
|
|
264
|
+
monthlyStorageBytes: 1024 * 1024 * 500, // 500 MB
|
|
265
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 5, // 5 GB
|
|
266
|
+
maxAgents: 10,
|
|
267
|
+
maxWebhooks: 10,
|
|
268
|
+
maxTeamMembers: 5,
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
[TrustTier.T3_MONITORED]: {
|
|
272
|
+
monthlyApiCalls: 250000,
|
|
273
|
+
monthlyComputeUnits: 25000,
|
|
274
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 2, // 2 GB
|
|
275
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 25, // 25 GB
|
|
276
|
+
maxAgents: 50,
|
|
277
|
+
maxWebhooks: 25,
|
|
278
|
+
maxTeamMembers: 10,
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
[TrustTier.T4_STANDARD]: {
|
|
282
|
+
monthlyApiCalls: 1000000,
|
|
283
|
+
monthlyComputeUnits: 100000,
|
|
284
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 10, // 10 GB
|
|
285
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 100, // 100 GB
|
|
286
|
+
maxAgents: 200,
|
|
287
|
+
maxWebhooks: 50,
|
|
288
|
+
maxTeamMembers: 25,
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
[TrustTier.T5_TRUSTED]: {
|
|
292
|
+
monthlyApiCalls: 5000000,
|
|
293
|
+
monthlyComputeUnits: 500000,
|
|
294
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 50, // 50 GB
|
|
295
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 500, // 500 GB
|
|
296
|
+
maxAgents: 1000,
|
|
297
|
+
maxWebhooks: 100,
|
|
298
|
+
maxTeamMembers: 50,
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
[TrustTier.T6_CERTIFIED]: {
|
|
302
|
+
monthlyApiCalls: 25000000,
|
|
303
|
+
monthlyComputeUnits: 2500000,
|
|
304
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 250, // 250 GB
|
|
305
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 2500, // 2.5 TB
|
|
306
|
+
maxAgents: 5000,
|
|
307
|
+
maxWebhooks: 250,
|
|
308
|
+
maxTeamMembers: 100,
|
|
309
|
+
},
|
|
310
|
+
|
|
311
|
+
[TrustTier.T7_AUTONOMOUS]: {
|
|
312
|
+
monthlyApiCalls: -1, // Unlimited
|
|
313
|
+
monthlyComputeUnits: -1, // Unlimited
|
|
314
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 1024, // 1 TB
|
|
315
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 10000, // 10 TB
|
|
316
|
+
maxAgents: -1, // Unlimited
|
|
317
|
+
maxWebhooks: -1, // Unlimited
|
|
318
|
+
maxTeamMembers: -1, // Unlimited
|
|
319
|
+
},
|
|
320
|
+
} as const;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Get quota for a tier
|
|
324
|
+
*/
|
|
325
|
+
export function getQuota(tier: TrustTier): QuotaConfig {
|
|
326
|
+
return TIER_QUOTAS[tier];
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Check if quota is unlimited (-1)
|
|
331
|
+
*/
|
|
332
|
+
export function isUnlimited(value: number): boolean {
|
|
333
|
+
return value === -1;
|
|
334
|
+
}
|
package/src/themes.ts
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Theme System for the Vorion Ecosystem
|
|
3
|
+
*
|
|
4
|
+
* Controls the visual identity across all three sites:
|
|
5
|
+
* - cognigate.dev (Developer Engine)
|
|
6
|
+
* - agentanchorai.com (Enterprise Platform)
|
|
7
|
+
* - vorion.org (Community / Standard)
|
|
8
|
+
*
|
|
9
|
+
* QUICK SWAP: Change ACTIVE_THEME to switch all sites at once.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// ACTIVE THEME — CHANGE THIS ONE LINE TO SWAP ALL SITES
|
|
14
|
+
// =============================================================================
|
|
15
|
+
|
|
16
|
+
export const ACTIVE_THEME: ThemeId = 'midnight_cyan';
|
|
17
|
+
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// THEME DEFINITIONS
|
|
20
|
+
// =============================================================================
|
|
21
|
+
|
|
22
|
+
export type ThemeId =
|
|
23
|
+
| 'midnight_cyan'
|
|
24
|
+
| 'indigo_authority'
|
|
25
|
+
| 'obsidian_amber'
|
|
26
|
+
| 'arctic_glass';
|
|
27
|
+
|
|
28
|
+
export interface ThemeTokens {
|
|
29
|
+
/** Theme display name */
|
|
30
|
+
name: string;
|
|
31
|
+
/** Short description for team review */
|
|
32
|
+
description: string;
|
|
33
|
+
|
|
34
|
+
// ── Backgrounds ──────────────────────────────────────────────
|
|
35
|
+
/** Page background */
|
|
36
|
+
bgPrimary: string;
|
|
37
|
+
/** Card / surface background */
|
|
38
|
+
bgSurface: string;
|
|
39
|
+
/** Input / recessed background */
|
|
40
|
+
bgInput: string;
|
|
41
|
+
/** Nav background */
|
|
42
|
+
bgNav: string;
|
|
43
|
+
/** Code block background */
|
|
44
|
+
bgCode: string;
|
|
45
|
+
|
|
46
|
+
// ── Accent Colors ────────────────────────────────────────────
|
|
47
|
+
/** Primary accent (buttons, links, active states) */
|
|
48
|
+
accent: string;
|
|
49
|
+
/** Accent hover state */
|
|
50
|
+
accentHover: string;
|
|
51
|
+
/** Accent at 10% opacity (badges, subtle fills) */
|
|
52
|
+
accentMuted: string;
|
|
53
|
+
/** Accent at 3% opacity (table row hover) */
|
|
54
|
+
accentSubtle: string;
|
|
55
|
+
|
|
56
|
+
// ── Text Colors ──────────────────────────────────────────────
|
|
57
|
+
/** Primary body text */
|
|
58
|
+
textPrimary: string;
|
|
59
|
+
/** Headings */
|
|
60
|
+
textHeading: string;
|
|
61
|
+
/** Secondary/muted text */
|
|
62
|
+
textSecondary: string;
|
|
63
|
+
/** Tertiary/subtle text */
|
|
64
|
+
textTertiary: string;
|
|
65
|
+
|
|
66
|
+
// ── Borders ──────────────────────────────────────────────────
|
|
67
|
+
/** Card/section borders */
|
|
68
|
+
border: string;
|
|
69
|
+
/** Input borders */
|
|
70
|
+
borderInput: string;
|
|
71
|
+
/** Hover border for interactive cards */
|
|
72
|
+
borderHover: string;
|
|
73
|
+
/** Nav/section divider border (Tailwind opacity format) */
|
|
74
|
+
borderDivider: string;
|
|
75
|
+
|
|
76
|
+
// ── Gradients ────────────────────────────────────────────────
|
|
77
|
+
/** Hero text gradient start */
|
|
78
|
+
gradientFrom: string;
|
|
79
|
+
/** Hero text gradient end */
|
|
80
|
+
gradientTo: string;
|
|
81
|
+
|
|
82
|
+
// ── Scrollbar ────────────────────────────────────────────────
|
|
83
|
+
scrollTrack: string;
|
|
84
|
+
scrollThumb: string;
|
|
85
|
+
scrollThumbHover: string;
|
|
86
|
+
|
|
87
|
+
// ── Selection ────────────────────────────────────────────────
|
|
88
|
+
selectionBg: string;
|
|
89
|
+
|
|
90
|
+
// ── Semantic (unchanged across themes) ───────────────────────
|
|
91
|
+
/** Kept consistent for meaning — these don't change with theme */
|
|
92
|
+
success: string;
|
|
93
|
+
error: string;
|
|
94
|
+
warning: string;
|
|
95
|
+
info: string;
|
|
96
|
+
|
|
97
|
+
// ── Layer Colors (BASIS stack identity — consistent) ─────────
|
|
98
|
+
layerBasis: string;
|
|
99
|
+
layerIntent: string;
|
|
100
|
+
layerEnforce: string;
|
|
101
|
+
layerProof: string;
|
|
102
|
+
|
|
103
|
+
// ── Font ─────────────────────────────────────────────────────
|
|
104
|
+
fontFamily: string;
|
|
105
|
+
/** Tailwind-compatible font class for Next.js sites */
|
|
106
|
+
fontImport: string;
|
|
107
|
+
|
|
108
|
+
// ── Card Effects ─────────────────────────────────────────────
|
|
109
|
+
/** Whether to apply backdrop-blur to cards */
|
|
110
|
+
cardBlur: boolean;
|
|
111
|
+
/** Button text color (on accent background) */
|
|
112
|
+
buttonText: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const THEMES: Record<ThemeId, ThemeTokens> = {
|
|
116
|
+
// ═══════════════════════════════════════════════════════════════
|
|
117
|
+
// OPTION 1: MIDNIGHT CYAN — Current look, standardized
|
|
118
|
+
// ═══════════════════════════════════════════════════════════════
|
|
119
|
+
midnight_cyan: {
|
|
120
|
+
name: 'Midnight Cyan',
|
|
121
|
+
description: 'Developer-native. Terminal-adjacent. The current look, unified.',
|
|
122
|
+
|
|
123
|
+
bgPrimary: '#0a0a0f',
|
|
124
|
+
bgSurface: '#111118',
|
|
125
|
+
bgInput: '#0d0d14',
|
|
126
|
+
bgNav: '#111118',
|
|
127
|
+
bgCode: '#0d0d14',
|
|
128
|
+
|
|
129
|
+
accent: '#06b6d4',
|
|
130
|
+
accentHover: '#22d3ee',
|
|
131
|
+
accentMuted: 'rgba(6, 182, 212, 0.1)',
|
|
132
|
+
accentSubtle: 'rgba(6, 182, 212, 0.03)',
|
|
133
|
+
|
|
134
|
+
textPrimary: '#e0e0e6',
|
|
135
|
+
textHeading: '#ffffff',
|
|
136
|
+
textSecondary: '#888888',
|
|
137
|
+
textTertiary: '#666666',
|
|
138
|
+
|
|
139
|
+
border: '#1e1e2e',
|
|
140
|
+
borderInput: '#2a2a3a',
|
|
141
|
+
borderHover: 'rgba(6, 182, 212, 0.4)',
|
|
142
|
+
borderDivider: 'rgba(255, 255, 255, 0.05)',
|
|
143
|
+
|
|
144
|
+
gradientFrom: '#06b6d4',
|
|
145
|
+
gradientTo: '#2dd4bf',
|
|
146
|
+
|
|
147
|
+
scrollTrack: '#0a0a0f',
|
|
148
|
+
scrollThumb: '#333340',
|
|
149
|
+
scrollThumbHover: '#06b6d4',
|
|
150
|
+
|
|
151
|
+
selectionBg: 'rgba(6, 182, 212, 0.3)',
|
|
152
|
+
|
|
153
|
+
success: '#22c55e',
|
|
154
|
+
error: '#ef4444',
|
|
155
|
+
warning: '#f97316',
|
|
156
|
+
info: '#3b82f6',
|
|
157
|
+
|
|
158
|
+
layerBasis: '#fbbf24',
|
|
159
|
+
layerIntent: '#60a5fa',
|
|
160
|
+
layerEnforce: '#818cf8',
|
|
161
|
+
layerProof: '#34d399',
|
|
162
|
+
|
|
163
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
164
|
+
fontImport: 'Inter',
|
|
165
|
+
cardBlur: false,
|
|
166
|
+
buttonText: '#000000',
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
// ═══════════════════════════════════════════════════════════════
|
|
170
|
+
// OPTION 2: INDIGO AUTHORITY — Governance-forward, institutional
|
|
171
|
+
// ═══════════════════════════════════════════════════════════════
|
|
172
|
+
indigo_authority: {
|
|
173
|
+
name: 'Indigo Authority',
|
|
174
|
+
description: 'Institutional. Authoritative. Governance-forward.',
|
|
175
|
+
|
|
176
|
+
bgPrimary: '#07070d',
|
|
177
|
+
bgSurface: '#12121f',
|
|
178
|
+
bgInput: '#0c0c18',
|
|
179
|
+
bgNav: '#12121f',
|
|
180
|
+
bgCode: '#0c0c18',
|
|
181
|
+
|
|
182
|
+
accent: '#818cf8',
|
|
183
|
+
accentHover: '#a5b4fc',
|
|
184
|
+
accentMuted: 'rgba(129, 140, 248, 0.1)',
|
|
185
|
+
accentSubtle: 'rgba(129, 140, 248, 0.03)',
|
|
186
|
+
|
|
187
|
+
textPrimary: '#dcdce6',
|
|
188
|
+
textHeading: '#ffffff',
|
|
189
|
+
textSecondary: '#8888a0',
|
|
190
|
+
textTertiary: '#666680',
|
|
191
|
+
|
|
192
|
+
border: '#1e1e30',
|
|
193
|
+
borderInput: '#2a2a40',
|
|
194
|
+
borderHover: 'rgba(129, 140, 248, 0.4)',
|
|
195
|
+
borderDivider: 'rgba(255, 255, 255, 0.05)',
|
|
196
|
+
|
|
197
|
+
gradientFrom: '#818cf8',
|
|
198
|
+
gradientTo: '#c084fc',
|
|
199
|
+
|
|
200
|
+
scrollTrack: '#07070d',
|
|
201
|
+
scrollThumb: '#2a2a40',
|
|
202
|
+
scrollThumbHover: '#818cf8',
|
|
203
|
+
|
|
204
|
+
selectionBg: 'rgba(129, 140, 248, 0.3)',
|
|
205
|
+
|
|
206
|
+
success: '#22c55e',
|
|
207
|
+
error: '#ef4444',
|
|
208
|
+
warning: '#f97316',
|
|
209
|
+
info: '#3b82f6',
|
|
210
|
+
|
|
211
|
+
layerBasis: '#fbbf24',
|
|
212
|
+
layerIntent: '#60a5fa',
|
|
213
|
+
layerEnforce: '#818cf8',
|
|
214
|
+
layerProof: '#34d399',
|
|
215
|
+
|
|
216
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
217
|
+
fontImport: 'Inter',
|
|
218
|
+
cardBlur: false,
|
|
219
|
+
buttonText: '#000000',
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
// ═══════════════════════════════════════════════════════════════
|
|
223
|
+
// OPTION 3: OBSIDIAN AMBER — Warm, premium, "gold standard"
|
|
224
|
+
// ═══════════════════════════════════════════════════════════════
|
|
225
|
+
obsidian_amber: {
|
|
226
|
+
name: 'Obsidian Amber',
|
|
227
|
+
description: 'Premium. Warm. The gold standard of AI governance.',
|
|
228
|
+
|
|
229
|
+
bgPrimary: '#0a0a08',
|
|
230
|
+
bgSurface: '#141410',
|
|
231
|
+
bgInput: '#0d0d0a',
|
|
232
|
+
bgNav: '#141410',
|
|
233
|
+
bgCode: '#0d0d0a',
|
|
234
|
+
|
|
235
|
+
accent: '#f59e0b',
|
|
236
|
+
accentHover: '#fbbf24',
|
|
237
|
+
accentMuted: 'rgba(245, 158, 11, 0.1)',
|
|
238
|
+
accentSubtle: 'rgba(245, 158, 11, 0.03)',
|
|
239
|
+
|
|
240
|
+
textPrimary: '#e6e0d6',
|
|
241
|
+
textHeading: '#ffffff',
|
|
242
|
+
textSecondary: '#8a8478',
|
|
243
|
+
textTertiary: '#666058',
|
|
244
|
+
|
|
245
|
+
border: '#2a2820',
|
|
246
|
+
borderInput: '#3a3830',
|
|
247
|
+
borderHover: 'rgba(245, 158, 11, 0.4)',
|
|
248
|
+
borderDivider: 'rgba(255, 255, 255, 0.05)',
|
|
249
|
+
|
|
250
|
+
gradientFrom: '#f59e0b',
|
|
251
|
+
gradientTo: '#f97316',
|
|
252
|
+
|
|
253
|
+
scrollTrack: '#0a0a08',
|
|
254
|
+
scrollThumb: '#3a3830',
|
|
255
|
+
scrollThumbHover: '#f59e0b',
|
|
256
|
+
|
|
257
|
+
selectionBg: 'rgba(245, 158, 11, 0.3)',
|
|
258
|
+
|
|
259
|
+
success: '#22c55e',
|
|
260
|
+
error: '#ef4444',
|
|
261
|
+
warning: '#f97316',
|
|
262
|
+
info: '#3b82f6',
|
|
263
|
+
|
|
264
|
+
layerBasis: '#fbbf24',
|
|
265
|
+
layerIntent: '#60a5fa',
|
|
266
|
+
layerEnforce: '#818cf8',
|
|
267
|
+
layerProof: '#34d399',
|
|
268
|
+
|
|
269
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
270
|
+
fontImport: 'Inter',
|
|
271
|
+
cardBlur: false,
|
|
272
|
+
buttonText: '#000000',
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
// ═══════════════════════════════════════════════════════════════
|
|
276
|
+
// OPTION 4: ARCTIC GLASS — Modern SaaS, frosted glass
|
|
277
|
+
// ═══════════════════════════════════════════════════════════════
|
|
278
|
+
arctic_glass: {
|
|
279
|
+
name: 'Arctic Glass',
|
|
280
|
+
description: 'Modern SaaS. Clean. Frosted glass depth.',
|
|
281
|
+
|
|
282
|
+
bgPrimary: '#0c0c14',
|
|
283
|
+
bgSurface: 'rgba(255, 255, 255, 0.04)',
|
|
284
|
+
bgInput: 'rgba(0, 0, 0, 0.3)',
|
|
285
|
+
bgNav: 'rgba(12, 12, 20, 0.8)',
|
|
286
|
+
bgCode: 'rgba(0, 0, 0, 0.3)',
|
|
287
|
+
|
|
288
|
+
accent: '#38bdf8',
|
|
289
|
+
accentHover: '#7dd3fc',
|
|
290
|
+
accentMuted: 'rgba(56, 189, 248, 0.1)',
|
|
291
|
+
accentSubtle: 'rgba(56, 189, 248, 0.03)',
|
|
292
|
+
|
|
293
|
+
textPrimary: '#e2e8f0',
|
|
294
|
+
textHeading: '#f8fafc',
|
|
295
|
+
textSecondary: '#94a3b8',
|
|
296
|
+
textTertiary: '#64748b',
|
|
297
|
+
|
|
298
|
+
border: 'rgba(255, 255, 255, 0.08)',
|
|
299
|
+
borderInput: 'rgba(255, 255, 255, 0.12)',
|
|
300
|
+
borderHover: 'rgba(56, 189, 248, 0.4)',
|
|
301
|
+
borderDivider: 'rgba(255, 255, 255, 0.05)',
|
|
302
|
+
|
|
303
|
+
gradientFrom: '#38bdf8',
|
|
304
|
+
gradientTo: '#06b6d4',
|
|
305
|
+
|
|
306
|
+
scrollTrack: '#0c0c14',
|
|
307
|
+
scrollThumb: 'rgba(255, 255, 255, 0.1)',
|
|
308
|
+
scrollThumbHover: '#38bdf8',
|
|
309
|
+
|
|
310
|
+
selectionBg: 'rgba(56, 189, 248, 0.3)',
|
|
311
|
+
|
|
312
|
+
success: '#22c55e',
|
|
313
|
+
error: '#ef4444',
|
|
314
|
+
warning: '#f97316',
|
|
315
|
+
info: '#3b82f6',
|
|
316
|
+
|
|
317
|
+
layerBasis: '#fbbf24',
|
|
318
|
+
layerIntent: '#60a5fa',
|
|
319
|
+
layerEnforce: '#818cf8',
|
|
320
|
+
layerProof: '#34d399',
|
|
321
|
+
|
|
322
|
+
fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
323
|
+
fontImport: 'Geist',
|
|
324
|
+
cardBlur: true,
|
|
325
|
+
buttonText: '#000000',
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// =============================================================================
|
|
330
|
+
// HELPERS
|
|
331
|
+
// =============================================================================
|
|
332
|
+
|
|
333
|
+
/** Get the currently active theme tokens */
|
|
334
|
+
export function getActiveTheme(): ThemeTokens {
|
|
335
|
+
return THEMES[ACTIVE_THEME];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** Get all theme IDs */
|
|
339
|
+
export function getAllThemeIds(): ThemeId[] {
|
|
340
|
+
return Object.keys(THEMES) as ThemeId[];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** Generate CSS custom properties string from a theme */
|
|
344
|
+
export function themeToCssVars(themeId: ThemeId = ACTIVE_THEME): string {
|
|
345
|
+
const t = THEMES[themeId];
|
|
346
|
+
return `
|
|
347
|
+
--bg-primary: ${t.bgPrimary};
|
|
348
|
+
--bg-surface: ${t.bgSurface};
|
|
349
|
+
--bg-input: ${t.bgInput};
|
|
350
|
+
--bg-nav: ${t.bgNav};
|
|
351
|
+
--bg-code: ${t.bgCode};
|
|
352
|
+
--accent: ${t.accent};
|
|
353
|
+
--accent-hover: ${t.accentHover};
|
|
354
|
+
--accent-muted: ${t.accentMuted};
|
|
355
|
+
--accent-subtle: ${t.accentSubtle};
|
|
356
|
+
--text-primary: ${t.textPrimary};
|
|
357
|
+
--text-heading: ${t.textHeading};
|
|
358
|
+
--text-secondary: ${t.textSecondary};
|
|
359
|
+
--text-tertiary: ${t.textTertiary};
|
|
360
|
+
--border: ${t.border};
|
|
361
|
+
--border-input: ${t.borderInput};
|
|
362
|
+
--border-hover: ${t.borderHover};
|
|
363
|
+
--border-divider: ${t.borderDivider};
|
|
364
|
+
--gradient-from: ${t.gradientFrom};
|
|
365
|
+
--gradient-to: ${t.gradientTo};
|
|
366
|
+
--scroll-track: ${t.scrollTrack};
|
|
367
|
+
--scroll-thumb: ${t.scrollThumb};
|
|
368
|
+
--scroll-thumb-hover: ${t.scrollThumbHover};
|
|
369
|
+
--selection-bg: ${t.selectionBg};
|
|
370
|
+
--success: ${t.success};
|
|
371
|
+
--error: ${t.error};
|
|
372
|
+
--warning: ${t.warning};
|
|
373
|
+
--info: ${t.info};
|
|
374
|
+
--layer-basis: ${t.layerBasis};
|
|
375
|
+
--layer-intent: ${t.layerIntent};
|
|
376
|
+
--layer-enforce: ${t.layerEnforce};
|
|
377
|
+
--layer-proof: ${t.layerProof};
|
|
378
|
+
--btn-text: ${t.buttonText};
|
|
379
|
+
`.trim();
|
|
380
|
+
}
|