@vorionsys/shared-constants 1.0.1 → 1.0.2
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/CHANGELOG.md +39 -0
- package/LICENSE +190 -0
- package/README.md +418 -44
- package/dist/api-versions.d.ts +91 -0
- package/dist/capabilities.d.ts +55 -0
- package/dist/{chunk-IKLCEYZT.js → chunk-OEEPW54O.js} +4 -6
- package/dist/domains.cjs +4 -6
- package/dist/domains.d.cts +4 -8
- package/dist/domains.d.ts +246 -0
- package/dist/domains.js +1 -1
- package/dist/error-codes.d.ts +633 -0
- package/dist/index.cjs +6 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +54 -0
- package/dist/index.js +3 -3
- package/dist/products.d.ts +80 -0
- package/dist/rate-limits.d.ts +80 -0
- package/dist/themes.d.ts +85 -0
- package/dist/tiers.d.ts +75 -0
- package/package.json +29 -7
- package/dist/chunk-F2R6HBF5.js +0 -253
- package/dist/chunk-PHL3CB53.js +0 -159
- package/src/api-versions.ts +0 -250
- package/src/capabilities.ts +0 -272
- package/src/domains.ts +0 -216
- package/src/error-codes.ts +0 -494
- package/src/index.ts +0 -206
- package/src/products.ts +0 -285
- package/src/rate-limits.ts +0 -334
- package/src/themes.ts +0 -380
- package/src/tiers.ts +0 -239
- package/tsconfig.json +0 -25
package/src/themes.ts
DELETED
|
@@ -1,380 +0,0 @@
|
|
|
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
|
-
}
|
package/src/tiers.ts
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @vorionsys/shared-constants - Trust Tiers
|
|
3
|
-
*
|
|
4
|
-
* Single source of truth for the 8-tier trust model (T0-T7)
|
|
5
|
-
* Used across all Vorion ecosystem products and sites
|
|
6
|
-
*
|
|
7
|
-
* @see https://basis.vorion.org/tiers
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// TRUST TIER ENUM
|
|
12
|
-
// =============================================================================
|
|
13
|
-
|
|
14
|
-
export enum TrustTier {
|
|
15
|
-
T0_SANDBOX = 0,
|
|
16
|
-
T1_OBSERVED = 1,
|
|
17
|
-
T2_PROVISIONAL = 2,
|
|
18
|
-
T3_MONITORED = 3,
|
|
19
|
-
T4_STANDARD = 4,
|
|
20
|
-
T5_TRUSTED = 5,
|
|
21
|
-
T6_CERTIFIED = 6,
|
|
22
|
-
T7_AUTONOMOUS = 7,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// =============================================================================
|
|
26
|
-
// TIER THRESHOLDS - SINGLE SOURCE OF TRUTH
|
|
27
|
-
// =============================================================================
|
|
28
|
-
|
|
29
|
-
export interface TierThreshold {
|
|
30
|
-
readonly min: number;
|
|
31
|
-
readonly max: number;
|
|
32
|
-
readonly name: string;
|
|
33
|
-
readonly description: string;
|
|
34
|
-
readonly color: string;
|
|
35
|
-
readonly textColor: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Official tier thresholds for the BASIS trust model
|
|
40
|
-
* All products MUST use these values for consistency
|
|
41
|
-
*/
|
|
42
|
-
export const TIER_THRESHOLDS: Readonly<Record<TrustTier, TierThreshold>> = {
|
|
43
|
-
[TrustTier.T0_SANDBOX]: {
|
|
44
|
-
min: 0,
|
|
45
|
-
max: 199,
|
|
46
|
-
name: 'Sandbox',
|
|
47
|
-
description: 'Isolated, no external access, observation only',
|
|
48
|
-
color: '#78716c',
|
|
49
|
-
textColor: '#ffffff',
|
|
50
|
-
},
|
|
51
|
-
[TrustTier.T1_OBSERVED]: {
|
|
52
|
-
min: 200,
|
|
53
|
-
max: 349,
|
|
54
|
-
name: 'Observed',
|
|
55
|
-
description: 'Read-only, sandboxed execution, monitored',
|
|
56
|
-
color: '#ef4444',
|
|
57
|
-
textColor: '#ffffff',
|
|
58
|
-
},
|
|
59
|
-
[TrustTier.T2_PROVISIONAL]: {
|
|
60
|
-
min: 350,
|
|
61
|
-
max: 499,
|
|
62
|
-
name: 'Provisional',
|
|
63
|
-
description: 'Basic operations, heavy supervision',
|
|
64
|
-
color: '#f97316',
|
|
65
|
-
textColor: '#ffffff',
|
|
66
|
-
},
|
|
67
|
-
[TrustTier.T3_MONITORED]: {
|
|
68
|
-
min: 500,
|
|
69
|
-
max: 649,
|
|
70
|
-
name: 'Monitored',
|
|
71
|
-
description: 'Standard operations with continuous monitoring',
|
|
72
|
-
color: '#eab308',
|
|
73
|
-
textColor: '#000000',
|
|
74
|
-
},
|
|
75
|
-
[TrustTier.T4_STANDARD]: {
|
|
76
|
-
min: 650,
|
|
77
|
-
max: 799,
|
|
78
|
-
name: 'Standard',
|
|
79
|
-
description: 'External API access, policy-governed',
|
|
80
|
-
color: '#22c55e',
|
|
81
|
-
textColor: '#ffffff',
|
|
82
|
-
},
|
|
83
|
-
[TrustTier.T5_TRUSTED]: {
|
|
84
|
-
min: 800,
|
|
85
|
-
max: 875,
|
|
86
|
-
name: 'Trusted',
|
|
87
|
-
description: 'Cross-agent communication, delegated tasks',
|
|
88
|
-
color: '#3b82f6',
|
|
89
|
-
textColor: '#ffffff',
|
|
90
|
-
},
|
|
91
|
-
[TrustTier.T6_CERTIFIED]: {
|
|
92
|
-
min: 876,
|
|
93
|
-
max: 950,
|
|
94
|
-
name: 'Certified',
|
|
95
|
-
description: 'Admin tasks, agent spawning, minimal oversight',
|
|
96
|
-
color: '#8b5cf6',
|
|
97
|
-
textColor: '#ffffff',
|
|
98
|
-
},
|
|
99
|
-
[TrustTier.T7_AUTONOMOUS]: {
|
|
100
|
-
min: 951,
|
|
101
|
-
max: 1000,
|
|
102
|
-
name: 'Autonomous',
|
|
103
|
-
description: 'Full autonomy, self-governance, strategic only',
|
|
104
|
-
color: '#06b6d4',
|
|
105
|
-
textColor: '#ffffff',
|
|
106
|
-
},
|
|
107
|
-
} as const;
|
|
108
|
-
|
|
109
|
-
// =============================================================================
|
|
110
|
-
// HELPER FUNCTIONS
|
|
111
|
-
// =============================================================================
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Convert a trust score (0-1000) to a trust tier
|
|
115
|
-
*/
|
|
116
|
-
export function scoreToTier(score: number): TrustTier {
|
|
117
|
-
if (score < 0 || score > 1000) {
|
|
118
|
-
throw new Error(`Trust score must be between 0 and 1000, got ${score}`);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (score >= 951) return TrustTier.T7_AUTONOMOUS;
|
|
122
|
-
if (score >= 876) return TrustTier.T6_CERTIFIED;
|
|
123
|
-
if (score >= 800) return TrustTier.T5_TRUSTED;
|
|
124
|
-
if (score >= 650) return TrustTier.T4_STANDARD;
|
|
125
|
-
if (score >= 500) return TrustTier.T3_MONITORED;
|
|
126
|
-
if (score >= 350) return TrustTier.T2_PROVISIONAL;
|
|
127
|
-
if (score >= 200) return TrustTier.T1_OBSERVED;
|
|
128
|
-
return TrustTier.T0_SANDBOX;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Get tier threshold configuration
|
|
133
|
-
*/
|
|
134
|
-
export function getTierThreshold(tier: TrustTier): TierThreshold {
|
|
135
|
-
return TIER_THRESHOLDS[tier];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Get human-readable tier name
|
|
140
|
-
*/
|
|
141
|
-
export function getTierName(tier: TrustTier): string {
|
|
142
|
-
return TIER_THRESHOLDS[tier].name;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Get tier display color
|
|
147
|
-
*/
|
|
148
|
-
export function getTierColor(tier: TrustTier): string {
|
|
149
|
-
return TIER_THRESHOLDS[tier].color;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Get minimum score required for a tier
|
|
154
|
-
*/
|
|
155
|
-
export function getTierMinScore(tier: TrustTier): number {
|
|
156
|
-
return TIER_THRESHOLDS[tier].min;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Get maximum score for a tier
|
|
161
|
-
*/
|
|
162
|
-
export function getTierMaxScore(tier: TrustTier): number {
|
|
163
|
-
return TIER_THRESHOLDS[tier].max;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Check if a score meets the minimum tier requirement
|
|
168
|
-
*/
|
|
169
|
-
export function meetsTierRequirement(score: number, minTier: TrustTier): boolean {
|
|
170
|
-
const actualTier = scoreToTier(score);
|
|
171
|
-
return actualTier >= minTier;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Get tier short code (T0, T1, etc.)
|
|
176
|
-
*/
|
|
177
|
-
export function getTierCode(tier: TrustTier): string {
|
|
178
|
-
return `T${tier}`;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Parse tier from string (e.g., "T3", "3", "MONITORED")
|
|
183
|
-
*/
|
|
184
|
-
export function parseTier(input: string): TrustTier | null {
|
|
185
|
-
const normalized = input.toUpperCase().trim();
|
|
186
|
-
|
|
187
|
-
// Try T# format
|
|
188
|
-
const tMatch = normalized.match(/^T?(\d)$/);
|
|
189
|
-
if (tMatch) {
|
|
190
|
-
const num = parseInt(tMatch[1], 10);
|
|
191
|
-
if (num >= 0 && num <= 7) {
|
|
192
|
-
return num as TrustTier;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// Try name format
|
|
197
|
-
const nameMap: Record<string, TrustTier> = {
|
|
198
|
-
SANDBOX: TrustTier.T0_SANDBOX,
|
|
199
|
-
OBSERVED: TrustTier.T1_OBSERVED,
|
|
200
|
-
PROVISIONAL: TrustTier.T2_PROVISIONAL,
|
|
201
|
-
MONITORED: TrustTier.T3_MONITORED,
|
|
202
|
-
STANDARD: TrustTier.T4_STANDARD,
|
|
203
|
-
TRUSTED: TrustTier.T5_TRUSTED,
|
|
204
|
-
CERTIFIED: TrustTier.T6_CERTIFIED,
|
|
205
|
-
AUTONOMOUS: TrustTier.T7_AUTONOMOUS,
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
return nameMap[normalized] ?? null;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Get all tiers in order
|
|
213
|
-
*/
|
|
214
|
-
export const ALL_TIERS: readonly TrustTier[] = [
|
|
215
|
-
TrustTier.T0_SANDBOX,
|
|
216
|
-
TrustTier.T1_OBSERVED,
|
|
217
|
-
TrustTier.T2_PROVISIONAL,
|
|
218
|
-
TrustTier.T3_MONITORED,
|
|
219
|
-
TrustTier.T4_STANDARD,
|
|
220
|
-
TrustTier.T5_TRUSTED,
|
|
221
|
-
TrustTier.T6_CERTIFIED,
|
|
222
|
-
TrustTier.T7_AUTONOMOUS,
|
|
223
|
-
] as const;
|
|
224
|
-
|
|
225
|
-
// =============================================================================
|
|
226
|
-
// TYPE EXPORTS
|
|
227
|
-
// =============================================================================
|
|
228
|
-
|
|
229
|
-
export type TrustTierName =
|
|
230
|
-
| 'Sandbox'
|
|
231
|
-
| 'Observed'
|
|
232
|
-
| 'Provisional'
|
|
233
|
-
| 'Monitored'
|
|
234
|
-
| 'Standard'
|
|
235
|
-
| 'Trusted'
|
|
236
|
-
| 'Certified'
|
|
237
|
-
| 'Autonomous';
|
|
238
|
-
|
|
239
|
-
export type TrustTierCode = 'T0' | 'T1' | 'T2' | 'T3' | 'T4' | 'T5' | 'T6' | 'T7';
|
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"outDir": "./dist",
|
|
15
|
-
"rootDir": "./src",
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"isolatedModules": true,
|
|
18
|
-
"noEmit": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true
|
|
22
|
-
},
|
|
23
|
-
"include": ["src/**/*.ts"],
|
|
24
|
-
"exclude": ["node_modules", "dist"]
|
|
25
|
-
}
|