@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.
Files changed (46) hide show
  1. package/dist/api-versions.cjs +183 -0
  2. package/dist/api-versions.d.cts +91 -0
  3. package/dist/api-versions.js +46 -0
  4. package/dist/capabilities.cjs +246 -0
  5. package/dist/capabilities.d.cts +55 -0
  6. package/dist/capabilities.js +21 -0
  7. package/dist/chunk-F2R6HBF5.js +253 -0
  8. package/dist/chunk-IKLCEYZT.js +142 -0
  9. package/dist/chunk-JZJPDGG7.js +215 -0
  10. package/dist/chunk-P3VPMVF3.js +223 -0
  11. package/dist/chunk-PHL3CB53.js +159 -0
  12. package/dist/chunk-RZQZEF6Q.js +176 -0
  13. package/dist/chunk-TYCMBQGU.js +353 -0
  14. package/dist/chunk-UDCZKJSQ.js +139 -0
  15. package/dist/domains.cjs +175 -0
  16. package/dist/domains.d.cts +250 -0
  17. package/dist/domains.js +24 -0
  18. package/dist/error-codes.cjs +390 -0
  19. package/dist/error-codes.d.cts +633 -0
  20. package/dist/error-codes.js +32 -0
  21. package/dist/index.cjs +1762 -0
  22. package/dist/index.d.cts +54 -0
  23. package/dist/index.js +198 -0
  24. package/dist/products.cjs +208 -0
  25. package/dist/products.d.cts +80 -0
  26. package/dist/products.js +22 -0
  27. package/dist/rate-limits.cjs +295 -0
  28. package/dist/rate-limits.d.cts +80 -0
  29. package/dist/rate-limits.js +21 -0
  30. package/dist/themes.cjs +251 -0
  31. package/dist/themes.d.cts +85 -0
  32. package/dist/themes.js +14 -0
  33. package/dist/tiers.cjs +194 -0
  34. package/dist/tiers.d.cts +75 -0
  35. package/dist/tiers.js +28 -0
  36. package/package.json +71 -0
  37. package/src/api-versions.ts +250 -0
  38. package/src/capabilities.ts +272 -0
  39. package/src/domains.ts +216 -0
  40. package/src/error-codes.ts +494 -0
  41. package/src/index.ts +206 -0
  42. package/src/products.ts +285 -0
  43. package/src/rate-limits.ts +334 -0
  44. package/src/themes.ts +380 -0
  45. package/src/tiers.ts +239 -0
  46. package/tsconfig.json +25 -0
@@ -0,0 +1,85 @@
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
+ declare const ACTIVE_THEME: ThemeId;
12
+ type ThemeId = 'midnight_cyan' | 'indigo_authority' | 'obsidian_amber' | 'arctic_glass';
13
+ interface ThemeTokens {
14
+ /** Theme display name */
15
+ name: string;
16
+ /** Short description for team review */
17
+ description: string;
18
+ /** Page background */
19
+ bgPrimary: string;
20
+ /** Card / surface background */
21
+ bgSurface: string;
22
+ /** Input / recessed background */
23
+ bgInput: string;
24
+ /** Nav background */
25
+ bgNav: string;
26
+ /** Code block background */
27
+ bgCode: string;
28
+ /** Primary accent (buttons, links, active states) */
29
+ accent: string;
30
+ /** Accent hover state */
31
+ accentHover: string;
32
+ /** Accent at 10% opacity (badges, subtle fills) */
33
+ accentMuted: string;
34
+ /** Accent at 3% opacity (table row hover) */
35
+ accentSubtle: string;
36
+ /** Primary body text */
37
+ textPrimary: string;
38
+ /** Headings */
39
+ textHeading: string;
40
+ /** Secondary/muted text */
41
+ textSecondary: string;
42
+ /** Tertiary/subtle text */
43
+ textTertiary: string;
44
+ /** Card/section borders */
45
+ border: string;
46
+ /** Input borders */
47
+ borderInput: string;
48
+ /** Hover border for interactive cards */
49
+ borderHover: string;
50
+ /** Nav/section divider border (Tailwind opacity format) */
51
+ borderDivider: string;
52
+ /** Hero text gradient start */
53
+ gradientFrom: string;
54
+ /** Hero text gradient end */
55
+ gradientTo: string;
56
+ scrollTrack: string;
57
+ scrollThumb: string;
58
+ scrollThumbHover: string;
59
+ selectionBg: string;
60
+ /** Kept consistent for meaning — these don't change with theme */
61
+ success: string;
62
+ error: string;
63
+ warning: string;
64
+ info: string;
65
+ layerBasis: string;
66
+ layerIntent: string;
67
+ layerEnforce: string;
68
+ layerProof: string;
69
+ fontFamily: string;
70
+ /** Tailwind-compatible font class for Next.js sites */
71
+ fontImport: string;
72
+ /** Whether to apply backdrop-blur to cards */
73
+ cardBlur: boolean;
74
+ /** Button text color (on accent background) */
75
+ buttonText: string;
76
+ }
77
+ declare const THEMES: Record<ThemeId, ThemeTokens>;
78
+ /** Get the currently active theme tokens */
79
+ declare function getActiveTheme(): ThemeTokens;
80
+ /** Get all theme IDs */
81
+ declare function getAllThemeIds(): ThemeId[];
82
+ /** Generate CSS custom properties string from a theme */
83
+ declare function themeToCssVars(themeId?: ThemeId): string;
84
+
85
+ export { ACTIVE_THEME, THEMES, type ThemeId, type ThemeTokens, getActiveTheme, getAllThemeIds, themeToCssVars };
package/dist/themes.js ADDED
@@ -0,0 +1,14 @@
1
+ import {
2
+ ACTIVE_THEME,
3
+ THEMES,
4
+ getActiveTheme,
5
+ getAllThemeIds,
6
+ themeToCssVars
7
+ } from "./chunk-P3VPMVF3.js";
8
+ export {
9
+ ACTIVE_THEME,
10
+ THEMES,
11
+ getActiveTheme,
12
+ getAllThemeIds,
13
+ themeToCssVars
14
+ };
package/dist/tiers.cjs ADDED
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/tiers.ts
21
+ var tiers_exports = {};
22
+ __export(tiers_exports, {
23
+ ALL_TIERS: () => ALL_TIERS,
24
+ TIER_THRESHOLDS: () => TIER_THRESHOLDS,
25
+ TrustTier: () => TrustTier,
26
+ getTierCode: () => getTierCode,
27
+ getTierColor: () => getTierColor,
28
+ getTierMaxScore: () => getTierMaxScore,
29
+ getTierMinScore: () => getTierMinScore,
30
+ getTierName: () => getTierName,
31
+ getTierThreshold: () => getTierThreshold,
32
+ meetsTierRequirement: () => meetsTierRequirement,
33
+ parseTier: () => parseTier,
34
+ scoreToTier: () => scoreToTier
35
+ });
36
+ module.exports = __toCommonJS(tiers_exports);
37
+ var TrustTier = /* @__PURE__ */ ((TrustTier2) => {
38
+ TrustTier2[TrustTier2["T0_SANDBOX"] = 0] = "T0_SANDBOX";
39
+ TrustTier2[TrustTier2["T1_OBSERVED"] = 1] = "T1_OBSERVED";
40
+ TrustTier2[TrustTier2["T2_PROVISIONAL"] = 2] = "T2_PROVISIONAL";
41
+ TrustTier2[TrustTier2["T3_MONITORED"] = 3] = "T3_MONITORED";
42
+ TrustTier2[TrustTier2["T4_STANDARD"] = 4] = "T4_STANDARD";
43
+ TrustTier2[TrustTier2["T5_TRUSTED"] = 5] = "T5_TRUSTED";
44
+ TrustTier2[TrustTier2["T6_CERTIFIED"] = 6] = "T6_CERTIFIED";
45
+ TrustTier2[TrustTier2["T7_AUTONOMOUS"] = 7] = "T7_AUTONOMOUS";
46
+ return TrustTier2;
47
+ })(TrustTier || {});
48
+ var TIER_THRESHOLDS = {
49
+ [0 /* T0_SANDBOX */]: {
50
+ min: 0,
51
+ max: 199,
52
+ name: "Sandbox",
53
+ description: "Isolated, no external access, observation only",
54
+ color: "#78716c",
55
+ textColor: "#ffffff"
56
+ },
57
+ [1 /* T1_OBSERVED */]: {
58
+ min: 200,
59
+ max: 349,
60
+ name: "Observed",
61
+ description: "Read-only, sandboxed execution, monitored",
62
+ color: "#ef4444",
63
+ textColor: "#ffffff"
64
+ },
65
+ [2 /* T2_PROVISIONAL */]: {
66
+ min: 350,
67
+ max: 500,
68
+ name: "Provisional",
69
+ description: "Basic operations, heavy supervision",
70
+ color: "#f97316",
71
+ textColor: "#ffffff"
72
+ },
73
+ [3 /* T3_MONITORED */]: {
74
+ min: 501,
75
+ max: 649,
76
+ name: "Monitored",
77
+ description: "Standard operations with continuous monitoring",
78
+ color: "#eab308",
79
+ textColor: "#000000"
80
+ },
81
+ [4 /* T4_STANDARD */]: {
82
+ min: 650,
83
+ max: 799,
84
+ name: "Standard",
85
+ description: "External API access, policy-governed",
86
+ color: "#22c55e",
87
+ textColor: "#ffffff"
88
+ },
89
+ [5 /* T5_TRUSTED */]: {
90
+ min: 800,
91
+ max: 875,
92
+ name: "Trusted",
93
+ description: "Cross-agent communication, delegated tasks",
94
+ color: "#3b82f6",
95
+ textColor: "#ffffff"
96
+ },
97
+ [6 /* T6_CERTIFIED */]: {
98
+ min: 876,
99
+ max: 950,
100
+ name: "Certified",
101
+ description: "Admin tasks, agent spawning, minimal oversight",
102
+ color: "#8b5cf6",
103
+ textColor: "#ffffff"
104
+ },
105
+ [7 /* T7_AUTONOMOUS */]: {
106
+ min: 951,
107
+ max: 1e3,
108
+ name: "Autonomous",
109
+ description: "Full autonomy, self-governance, strategic only",
110
+ color: "#06b6d4",
111
+ textColor: "#ffffff"
112
+ }
113
+ };
114
+ function scoreToTier(score) {
115
+ if (score < 0 || score > 1e3) {
116
+ throw new Error(`Trust score must be between 0 and 1000, got ${score}`);
117
+ }
118
+ if (score >= 951) return 7 /* T7_AUTONOMOUS */;
119
+ if (score >= 876) return 6 /* T6_CERTIFIED */;
120
+ if (score >= 800) return 5 /* T5_TRUSTED */;
121
+ if (score >= 650) return 4 /* T4_STANDARD */;
122
+ if (score >= 501) return 3 /* T3_MONITORED */;
123
+ if (score >= 350) return 2 /* T2_PROVISIONAL */;
124
+ if (score >= 200) return 1 /* T1_OBSERVED */;
125
+ return 0 /* T0_SANDBOX */;
126
+ }
127
+ function getTierThreshold(tier) {
128
+ return TIER_THRESHOLDS[tier];
129
+ }
130
+ function getTierName(tier) {
131
+ return TIER_THRESHOLDS[tier].name;
132
+ }
133
+ function getTierColor(tier) {
134
+ return TIER_THRESHOLDS[tier].color;
135
+ }
136
+ function getTierMinScore(tier) {
137
+ return TIER_THRESHOLDS[tier].min;
138
+ }
139
+ function getTierMaxScore(tier) {
140
+ return TIER_THRESHOLDS[tier].max;
141
+ }
142
+ function meetsTierRequirement(score, minTier) {
143
+ const actualTier = scoreToTier(score);
144
+ return actualTier >= minTier;
145
+ }
146
+ function getTierCode(tier) {
147
+ return `T${tier}`;
148
+ }
149
+ function parseTier(input) {
150
+ const normalized = input.toUpperCase().trim();
151
+ const tMatch = normalized.match(/^T?(\d)$/);
152
+ if (tMatch) {
153
+ const num = parseInt(tMatch[1], 10);
154
+ if (num >= 0 && num <= 7) {
155
+ return num;
156
+ }
157
+ }
158
+ const nameMap = {
159
+ SANDBOX: 0 /* T0_SANDBOX */,
160
+ OBSERVED: 1 /* T1_OBSERVED */,
161
+ PROVISIONAL: 2 /* T2_PROVISIONAL */,
162
+ MONITORED: 3 /* T3_MONITORED */,
163
+ STANDARD: 4 /* T4_STANDARD */,
164
+ TRUSTED: 5 /* T5_TRUSTED */,
165
+ CERTIFIED: 6 /* T6_CERTIFIED */,
166
+ AUTONOMOUS: 7 /* T7_AUTONOMOUS */
167
+ };
168
+ return nameMap[normalized] ?? null;
169
+ }
170
+ var ALL_TIERS = [
171
+ 0 /* T0_SANDBOX */,
172
+ 1 /* T1_OBSERVED */,
173
+ 2 /* T2_PROVISIONAL */,
174
+ 3 /* T3_MONITORED */,
175
+ 4 /* T4_STANDARD */,
176
+ 5 /* T5_TRUSTED */,
177
+ 6 /* T6_CERTIFIED */,
178
+ 7 /* T7_AUTONOMOUS */
179
+ ];
180
+ // Annotate the CommonJS export names for ESM import in node:
181
+ 0 && (module.exports = {
182
+ ALL_TIERS,
183
+ TIER_THRESHOLDS,
184
+ TrustTier,
185
+ getTierCode,
186
+ getTierColor,
187
+ getTierMaxScore,
188
+ getTierMinScore,
189
+ getTierName,
190
+ getTierThreshold,
191
+ meetsTierRequirement,
192
+ parseTier,
193
+ scoreToTier
194
+ });
@@ -0,0 +1,75 @@
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
+ declare enum TrustTier {
10
+ T0_SANDBOX = 0,
11
+ T1_OBSERVED = 1,
12
+ T2_PROVISIONAL = 2,
13
+ T3_MONITORED = 3,
14
+ T4_STANDARD = 4,
15
+ T5_TRUSTED = 5,
16
+ T6_CERTIFIED = 6,
17
+ T7_AUTONOMOUS = 7
18
+ }
19
+ interface TierThreshold {
20
+ readonly min: number;
21
+ readonly max: number;
22
+ readonly name: string;
23
+ readonly description: string;
24
+ readonly color: string;
25
+ readonly textColor: string;
26
+ }
27
+ /**
28
+ * Official tier thresholds for the BASIS trust model
29
+ * All products MUST use these values for consistency
30
+ */
31
+ declare const TIER_THRESHOLDS: Readonly<Record<TrustTier, TierThreshold>>;
32
+ /**
33
+ * Convert a trust score (0-1000) to a trust tier
34
+ */
35
+ declare function scoreToTier(score: number): TrustTier;
36
+ /**
37
+ * Get tier threshold configuration
38
+ */
39
+ declare function getTierThreshold(tier: TrustTier): TierThreshold;
40
+ /**
41
+ * Get human-readable tier name
42
+ */
43
+ declare function getTierName(tier: TrustTier): string;
44
+ /**
45
+ * Get tier display color
46
+ */
47
+ declare function getTierColor(tier: TrustTier): string;
48
+ /**
49
+ * Get minimum score required for a tier
50
+ */
51
+ declare function getTierMinScore(tier: TrustTier): number;
52
+ /**
53
+ * Get maximum score for a tier
54
+ */
55
+ declare function getTierMaxScore(tier: TrustTier): number;
56
+ /**
57
+ * Check if a score meets the minimum tier requirement
58
+ */
59
+ declare function meetsTierRequirement(score: number, minTier: TrustTier): boolean;
60
+ /**
61
+ * Get tier short code (T0, T1, etc.)
62
+ */
63
+ declare function getTierCode(tier: TrustTier): string;
64
+ /**
65
+ * Parse tier from string (e.g., "T3", "3", "MONITORED")
66
+ */
67
+ declare function parseTier(input: string): TrustTier | null;
68
+ /**
69
+ * Get all tiers in order
70
+ */
71
+ declare const ALL_TIERS: readonly TrustTier[];
72
+ type TrustTierName = 'Sandbox' | 'Observed' | 'Provisional' | 'Monitored' | 'Standard' | 'Trusted' | 'Certified' | 'Autonomous';
73
+ type TrustTierCode = 'T0' | 'T1' | 'T2' | 'T3' | 'T4' | 'T5' | 'T6' | 'T7';
74
+
75
+ export { ALL_TIERS, TIER_THRESHOLDS, type TierThreshold, TrustTier, type TrustTierCode, type TrustTierName, getTierCode, getTierColor, getTierMaxScore, getTierMinScore, getTierName, getTierThreshold, meetsTierRequirement, parseTier, scoreToTier };
package/dist/tiers.js ADDED
@@ -0,0 +1,28 @@
1
+ import {
2
+ ALL_TIERS,
3
+ TIER_THRESHOLDS,
4
+ TrustTier,
5
+ getTierCode,
6
+ getTierColor,
7
+ getTierMaxScore,
8
+ getTierMinScore,
9
+ getTierName,
10
+ getTierThreshold,
11
+ meetsTierRequirement,
12
+ parseTier,
13
+ scoreToTier
14
+ } from "./chunk-PHL3CB53.js";
15
+ export {
16
+ ALL_TIERS,
17
+ TIER_THRESHOLDS,
18
+ TrustTier,
19
+ getTierCode,
20
+ getTierColor,
21
+ getTierMaxScore,
22
+ getTierMinScore,
23
+ getTierName,
24
+ getTierThreshold,
25
+ meetsTierRequirement,
26
+ parseTier,
27
+ scoreToTier
28
+ };
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@vorionsys/shared-constants",
3
+ "version": "1.0.0",
4
+ "description": "Shared constants for Vorion ecosystem - single source of truth for tiers, domains, and configuration",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ },
14
+ "./tiers": {
15
+ "types": "./dist/tiers.d.ts",
16
+ "import": "./dist/tiers.js"
17
+ },
18
+ "./domains": {
19
+ "types": "./dist/domains.d.ts",
20
+ "import": "./dist/domains.js"
21
+ },
22
+ "./capabilities": {
23
+ "types": "./dist/capabilities.d.ts",
24
+ "import": "./dist/capabilities.js"
25
+ },
26
+ "./products": {
27
+ "types": "./dist/products.d.ts",
28
+ "import": "./dist/products.js"
29
+ },
30
+ "./rate-limits": {
31
+ "types": "./dist/rate-limits.d.ts",
32
+ "import": "./dist/rate-limits.js"
33
+ },
34
+ "./error-codes": {
35
+ "types": "./dist/error-codes.d.ts",
36
+ "import": "./dist/error-codes.js"
37
+ },
38
+ "./api-versions": {
39
+ "types": "./dist/api-versions.d.ts",
40
+ "import": "./dist/api-versions.js"
41
+ }
42
+ },
43
+ "scripts": {
44
+ "build": "tsup src/*.ts --format esm,cjs --dts",
45
+ "dev": "tsup src/*.ts --format esm,cjs --dts --watch",
46
+ "typecheck": "tsc --noEmit"
47
+ },
48
+ "keywords": [
49
+ "vorion",
50
+ "basis",
51
+ "trust",
52
+ "tiers",
53
+ "constants",
54
+ "shared"
55
+ ],
56
+ "author": "Vorion <team@vorion.org>",
57
+ "license": "MIT",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/voriongit/vorion.git",
61
+ "directory": "packages/shared-constants"
62
+ },
63
+ "homepage": "https://vorion.org",
64
+ "devDependencies": {
65
+ "tsup": "^8.0.0",
66
+ "typescript": "^5.7.0"
67
+ },
68
+ "engines": {
69
+ "node": ">=18.0.0"
70
+ }
71
+ }