@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,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vorionsys/shared-constants - API Versions
|
|
3
|
+
*
|
|
4
|
+
* Centralized API version management across all services
|
|
5
|
+
* Ensures consistent versioning strategy
|
|
6
|
+
*
|
|
7
|
+
* @see https://cognigate.dev/docs/versioning
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// VERSION STATUS
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
export enum VersionStatus {
|
|
15
|
+
/** Currently in development, not available */
|
|
16
|
+
DEVELOPMENT = 'development',
|
|
17
|
+
|
|
18
|
+
/** Available as preview/beta */
|
|
19
|
+
PREVIEW = 'preview',
|
|
20
|
+
|
|
21
|
+
/** Stable and recommended */
|
|
22
|
+
STABLE = 'stable',
|
|
23
|
+
|
|
24
|
+
/** Still supported but deprecated */
|
|
25
|
+
DEPRECATED = 'deprecated',
|
|
26
|
+
|
|
27
|
+
/** No longer supported */
|
|
28
|
+
RETIRED = 'retired',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// API VERSION DEFINITIONS
|
|
33
|
+
// =============================================================================
|
|
34
|
+
|
|
35
|
+
export interface ApiVersionDefinition {
|
|
36
|
+
/** Version identifier (e.g., "v1") */
|
|
37
|
+
version: string;
|
|
38
|
+
|
|
39
|
+
/** Full version number (e.g., "1.0.0") */
|
|
40
|
+
fullVersion: string;
|
|
41
|
+
|
|
42
|
+
/** Release date */
|
|
43
|
+
releaseDate: string;
|
|
44
|
+
|
|
45
|
+
/** End of support date (if deprecated/retired) */
|
|
46
|
+
endOfLife?: string;
|
|
47
|
+
|
|
48
|
+
/** Current status */
|
|
49
|
+
status: VersionStatus;
|
|
50
|
+
|
|
51
|
+
/** Changelog URL */
|
|
52
|
+
changelogUrl?: string;
|
|
53
|
+
|
|
54
|
+
/** Migration guide URL (if deprecated) */
|
|
55
|
+
migrationUrl?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// =============================================================================
|
|
59
|
+
// COGNIGATE API VERSIONS
|
|
60
|
+
// =============================================================================
|
|
61
|
+
|
|
62
|
+
export const COGNIGATE_VERSIONS: Record<string, ApiVersionDefinition> = {
|
|
63
|
+
v1: {
|
|
64
|
+
version: 'v1',
|
|
65
|
+
fullVersion: '1.0.0',
|
|
66
|
+
releaseDate: '2026-02-01',
|
|
67
|
+
status: VersionStatus.STABLE,
|
|
68
|
+
changelogUrl: 'https://cognigate.dev/changelog/v1',
|
|
69
|
+
},
|
|
70
|
+
} as const;
|
|
71
|
+
|
|
72
|
+
export const COGNIGATE_CURRENT_VERSION = 'v1';
|
|
73
|
+
export const COGNIGATE_DEFAULT_VERSION = 'v1';
|
|
74
|
+
|
|
75
|
+
// =============================================================================
|
|
76
|
+
// AGENT ANCHOR TRUST API VERSIONS
|
|
77
|
+
// =============================================================================
|
|
78
|
+
|
|
79
|
+
export const TRUST_API_VERSIONS: Record<string, ApiVersionDefinition> = {
|
|
80
|
+
v1: {
|
|
81
|
+
version: 'v1',
|
|
82
|
+
fullVersion: '1.0.0',
|
|
83
|
+
releaseDate: '2026-02-01',
|
|
84
|
+
status: VersionStatus.STABLE,
|
|
85
|
+
changelogUrl: 'https://trust.agentanchorai.com/changelog/v1',
|
|
86
|
+
},
|
|
87
|
+
} as const;
|
|
88
|
+
|
|
89
|
+
export const TRUST_CURRENT_VERSION = 'v1';
|
|
90
|
+
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// AGENT ANCHOR LOGIC API VERSIONS
|
|
93
|
+
// =============================================================================
|
|
94
|
+
|
|
95
|
+
export const LOGIC_API_VERSIONS: Record<string, ApiVersionDefinition> = {
|
|
96
|
+
v1: {
|
|
97
|
+
version: 'v1',
|
|
98
|
+
fullVersion: '1.0.0',
|
|
99
|
+
releaseDate: '2026-02-01',
|
|
100
|
+
status: VersionStatus.PREVIEW,
|
|
101
|
+
changelogUrl: 'https://logic.agentanchorai.com/changelog/v1',
|
|
102
|
+
},
|
|
103
|
+
} as const;
|
|
104
|
+
|
|
105
|
+
export const LOGIC_CURRENT_VERSION = 'v1';
|
|
106
|
+
|
|
107
|
+
// =============================================================================
|
|
108
|
+
// BASIS SPEC VERSIONS
|
|
109
|
+
// =============================================================================
|
|
110
|
+
|
|
111
|
+
export const BASIS_VERSIONS: Record<string, ApiVersionDefinition> = {
|
|
112
|
+
v1: {
|
|
113
|
+
version: 'v1',
|
|
114
|
+
fullVersion: '1.0.0',
|
|
115
|
+
releaseDate: '2026-02-01',
|
|
116
|
+
status: VersionStatus.STABLE,
|
|
117
|
+
changelogUrl: 'https://basis.vorion.org/changelog',
|
|
118
|
+
},
|
|
119
|
+
} as const;
|
|
120
|
+
|
|
121
|
+
export const BASIS_CURRENT_VERSION = 'v1';
|
|
122
|
+
export const BASIS_SPEC_VERSION = '1.0.0';
|
|
123
|
+
|
|
124
|
+
// =============================================================================
|
|
125
|
+
// CAR SPEC VERSIONS
|
|
126
|
+
// =============================================================================
|
|
127
|
+
|
|
128
|
+
export const CAR_SPEC_VERSIONS: Record<string, ApiVersionDefinition> = {
|
|
129
|
+
v1: {
|
|
130
|
+
version: 'v1',
|
|
131
|
+
fullVersion: '1.0.0',
|
|
132
|
+
releaseDate: '2026-02-01',
|
|
133
|
+
status: VersionStatus.STABLE,
|
|
134
|
+
changelogUrl: 'https://carid.vorion.org/changelog',
|
|
135
|
+
},
|
|
136
|
+
} as const;
|
|
137
|
+
|
|
138
|
+
export const CAR_SPEC_CURRENT_VERSION = 'v1';
|
|
139
|
+
|
|
140
|
+
// =============================================================================
|
|
141
|
+
// ALL API VERSIONS
|
|
142
|
+
// =============================================================================
|
|
143
|
+
|
|
144
|
+
export const API_VERSIONS = {
|
|
145
|
+
cognigate: COGNIGATE_VERSIONS,
|
|
146
|
+
trust: TRUST_API_VERSIONS,
|
|
147
|
+
logic: LOGIC_API_VERSIONS,
|
|
148
|
+
basis: BASIS_VERSIONS,
|
|
149
|
+
carSpec: CAR_SPEC_VERSIONS,
|
|
150
|
+
} as const;
|
|
151
|
+
|
|
152
|
+
// =============================================================================
|
|
153
|
+
// HELPER FUNCTIONS
|
|
154
|
+
// =============================================================================
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get the current stable version for a service
|
|
158
|
+
*/
|
|
159
|
+
export function getCurrentVersion(
|
|
160
|
+
service: 'cognigate' | 'trust' | 'logic' | 'basis' | 'carSpec',
|
|
161
|
+
): string {
|
|
162
|
+
switch (service) {
|
|
163
|
+
case 'cognigate':
|
|
164
|
+
return COGNIGATE_CURRENT_VERSION;
|
|
165
|
+
case 'trust':
|
|
166
|
+
return TRUST_CURRENT_VERSION;
|
|
167
|
+
case 'logic':
|
|
168
|
+
return LOGIC_CURRENT_VERSION;
|
|
169
|
+
case 'basis':
|
|
170
|
+
return BASIS_CURRENT_VERSION;
|
|
171
|
+
case 'carSpec':
|
|
172
|
+
return CAR_SPEC_CURRENT_VERSION;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Get version definition
|
|
178
|
+
*/
|
|
179
|
+
export function getVersionDefinition(
|
|
180
|
+
service: 'cognigate' | 'trust' | 'logic' | 'basis' | 'carSpec',
|
|
181
|
+
version: string,
|
|
182
|
+
): ApiVersionDefinition | undefined {
|
|
183
|
+
return API_VERSIONS[service][version];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Check if a version is still supported
|
|
188
|
+
*/
|
|
189
|
+
export function isVersionSupported(
|
|
190
|
+
service: 'cognigate' | 'trust' | 'logic' | 'basis' | 'carSpec',
|
|
191
|
+
version: string,
|
|
192
|
+
): boolean {
|
|
193
|
+
const def = getVersionDefinition(service, version);
|
|
194
|
+
if (!def) return false;
|
|
195
|
+
return def.status !== VersionStatus.RETIRED;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Check if a version is deprecated
|
|
200
|
+
*/
|
|
201
|
+
export function isVersionDeprecated(
|
|
202
|
+
service: 'cognigate' | 'trust' | 'logic' | 'basis' | 'carSpec',
|
|
203
|
+
version: string,
|
|
204
|
+
): boolean {
|
|
205
|
+
const def = getVersionDefinition(service, version);
|
|
206
|
+
if (!def) return false;
|
|
207
|
+
return def.status === VersionStatus.DEPRECATED;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Get all stable versions for a service
|
|
212
|
+
*/
|
|
213
|
+
export function getStableVersions(
|
|
214
|
+
service: 'cognigate' | 'trust' | 'logic' | 'basis' | 'carSpec',
|
|
215
|
+
): ApiVersionDefinition[] {
|
|
216
|
+
return Object.values(API_VERSIONS[service]).filter(
|
|
217
|
+
v => v.status === VersionStatus.STABLE,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Build versioned API URL
|
|
223
|
+
*/
|
|
224
|
+
export function buildApiUrl(
|
|
225
|
+
baseUrl: string,
|
|
226
|
+
version: string,
|
|
227
|
+
path: string,
|
|
228
|
+
): string {
|
|
229
|
+
const cleanBase = baseUrl.replace(/\/$/, '');
|
|
230
|
+
const cleanPath = path.replace(/^\//, '');
|
|
231
|
+
return `${cleanBase}/${version}/${cleanPath}`;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// =============================================================================
|
|
235
|
+
// HTTP HEADERS
|
|
236
|
+
// =============================================================================
|
|
237
|
+
|
|
238
|
+
export const VERSION_HEADERS = {
|
|
239
|
+
/** Header to request specific API version */
|
|
240
|
+
REQUEST_VERSION: 'X-API-Version',
|
|
241
|
+
|
|
242
|
+
/** Header indicating actual API version used */
|
|
243
|
+
RESPONSE_VERSION: 'X-API-Version',
|
|
244
|
+
|
|
245
|
+
/** Header warning about deprecation */
|
|
246
|
+
DEPRECATION_WARNING: 'X-Deprecation-Warning',
|
|
247
|
+
|
|
248
|
+
/** Header with sunset date */
|
|
249
|
+
SUNSET: 'Sunset',
|
|
250
|
+
} as const;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vorionsys/shared-constants - Capability Definitions
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for capability codes and tier requirements
|
|
5
|
+
* Used across all Vorion ecosystem products
|
|
6
|
+
*
|
|
7
|
+
* @see https://basis.vorion.org/capabilities
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { TrustTier } from './tiers';
|
|
11
|
+
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// CAPABILITY CATEGORIES
|
|
14
|
+
// =============================================================================
|
|
15
|
+
|
|
16
|
+
export enum CapabilityCategory {
|
|
17
|
+
DATA_ACCESS = 'data_access',
|
|
18
|
+
API_ACCESS = 'api_access',
|
|
19
|
+
CODE_EXECUTION = 'code_execution',
|
|
20
|
+
AGENT_INTERACTION = 'agent_interaction',
|
|
21
|
+
RESOURCE_MANAGEMENT = 'resource_management',
|
|
22
|
+
GOVERNANCE = 'governance',
|
|
23
|
+
ADMIN = 'admin',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// CAPABILITY DEFINITION
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
export interface CapabilityDefinition {
|
|
31
|
+
readonly code: string;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly category: CapabilityCategory;
|
|
34
|
+
readonly description: string;
|
|
35
|
+
readonly unlockTier: TrustTier;
|
|
36
|
+
readonly constraints?: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// =============================================================================
|
|
40
|
+
// STANDARD CAPABILITIES
|
|
41
|
+
// =============================================================================
|
|
42
|
+
|
|
43
|
+
export const CAPABILITIES: readonly CapabilityDefinition[] = [
|
|
44
|
+
// T0 - Sandbox
|
|
45
|
+
{
|
|
46
|
+
code: 'CAP-READ-PUBLIC',
|
|
47
|
+
name: 'Read Public Data',
|
|
48
|
+
category: CapabilityCategory.DATA_ACCESS,
|
|
49
|
+
description: 'Access publicly available data',
|
|
50
|
+
unlockTier: TrustTier.T0_SANDBOX,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
code: 'CAP-GENERATE-TEXT',
|
|
54
|
+
name: 'Generate Text',
|
|
55
|
+
category: CapabilityCategory.CODE_EXECUTION,
|
|
56
|
+
description: 'Generate text responses',
|
|
57
|
+
unlockTier: TrustTier.T0_SANDBOX,
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// T1 - Observed
|
|
61
|
+
{
|
|
62
|
+
code: 'CAP-READ-INTERNAL',
|
|
63
|
+
name: 'Read Internal Data',
|
|
64
|
+
category: CapabilityCategory.DATA_ACCESS,
|
|
65
|
+
description: 'Access internal data within allowed scopes',
|
|
66
|
+
unlockTier: TrustTier.T1_OBSERVED,
|
|
67
|
+
constraints: ['Read-only', 'Logged'],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
code: 'CAP-INTERNAL-API',
|
|
71
|
+
name: 'Internal API Access',
|
|
72
|
+
category: CapabilityCategory.API_ACCESS,
|
|
73
|
+
description: 'Make read-only internal API calls',
|
|
74
|
+
unlockTier: TrustTier.T1_OBSERVED,
|
|
75
|
+
constraints: ['GET only', 'Rate limited'],
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// T2 - Provisional
|
|
79
|
+
{
|
|
80
|
+
code: 'CAP-FILE-WRITE',
|
|
81
|
+
name: 'Write Files',
|
|
82
|
+
category: CapabilityCategory.DATA_ACCESS,
|
|
83
|
+
description: 'Write to approved directories',
|
|
84
|
+
unlockTier: TrustTier.T2_PROVISIONAL,
|
|
85
|
+
constraints: ['Approved dirs only', 'Size limited'],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
code: 'CAP-DB-READ',
|
|
89
|
+
name: 'Database Read',
|
|
90
|
+
category: CapabilityCategory.DATA_ACCESS,
|
|
91
|
+
description: 'Read from approved database tables',
|
|
92
|
+
unlockTier: TrustTier.T2_PROVISIONAL,
|
|
93
|
+
constraints: ['Approved tables', 'Query timeout'],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
code: 'CAP-EXTERNAL-API-READ',
|
|
97
|
+
name: 'External API Read',
|
|
98
|
+
category: CapabilityCategory.API_ACCESS,
|
|
99
|
+
description: 'Make GET requests to approved external APIs',
|
|
100
|
+
unlockTier: TrustTier.T2_PROVISIONAL,
|
|
101
|
+
constraints: ['GET only', 'Approved endpoints'],
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
// T3 - Monitored
|
|
105
|
+
{
|
|
106
|
+
code: 'CAP-DB-WRITE',
|
|
107
|
+
name: 'Database Write',
|
|
108
|
+
category: CapabilityCategory.DATA_ACCESS,
|
|
109
|
+
description: 'Write to approved database tables',
|
|
110
|
+
unlockTier: TrustTier.T3_MONITORED,
|
|
111
|
+
constraints: ['Approved tables', 'Transaction limits'],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
code: 'CAP-EXTERNAL-API-FULL',
|
|
115
|
+
name: 'External API Full Access',
|
|
116
|
+
category: CapabilityCategory.API_ACCESS,
|
|
117
|
+
description: 'Full REST operations on approved external APIs',
|
|
118
|
+
unlockTier: TrustTier.T3_MONITORED,
|
|
119
|
+
constraints: ['Approved endpoints', 'Rate limited'],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
code: 'CAP-CODE-SANDBOX',
|
|
123
|
+
name: 'Sandboxed Code Execution',
|
|
124
|
+
category: CapabilityCategory.CODE_EXECUTION,
|
|
125
|
+
description: 'Execute code in isolated sandbox',
|
|
126
|
+
unlockTier: TrustTier.T3_MONITORED,
|
|
127
|
+
constraints: ['Sandboxed', 'Time limited', 'No network'],
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// T4 - Standard
|
|
131
|
+
{
|
|
132
|
+
code: 'CAP-AGENT-COMMUNICATE',
|
|
133
|
+
name: 'Agent Communication',
|
|
134
|
+
category: CapabilityCategory.AGENT_INTERACTION,
|
|
135
|
+
description: 'Send and receive messages to/from other agents',
|
|
136
|
+
unlockTier: TrustTier.T4_STANDARD,
|
|
137
|
+
constraints: ['Approved agents', 'Message limits'],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
code: 'CAP-WORKFLOW-MULTI',
|
|
141
|
+
name: 'Multi-Step Workflow',
|
|
142
|
+
category: CapabilityCategory.CODE_EXECUTION,
|
|
143
|
+
description: 'Orchestrate multi-step workflows',
|
|
144
|
+
unlockTier: TrustTier.T4_STANDARD,
|
|
145
|
+
constraints: ['Approved patterns', 'Checkpoints required'],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
code: 'CAP-ESCALATE-HUMAN',
|
|
149
|
+
name: 'Human Escalation',
|
|
150
|
+
category: CapabilityCategory.GOVERNANCE,
|
|
151
|
+
description: 'Initiate escalation to human reviewers',
|
|
152
|
+
unlockTier: TrustTier.T4_STANDARD,
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
// T5 - Trusted
|
|
156
|
+
{
|
|
157
|
+
code: 'CAP-AGENT-DELEGATE',
|
|
158
|
+
name: 'Task Delegation',
|
|
159
|
+
category: CapabilityCategory.AGENT_INTERACTION,
|
|
160
|
+
description: 'Delegate tasks to other agents',
|
|
161
|
+
unlockTier: TrustTier.T5_TRUSTED,
|
|
162
|
+
constraints: ['Trust verified agents'],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
code: 'CAP-RESOURCE-PROVISION',
|
|
166
|
+
name: 'Resource Provisioning',
|
|
167
|
+
category: CapabilityCategory.RESOURCE_MANAGEMENT,
|
|
168
|
+
description: 'Provision computational resources',
|
|
169
|
+
unlockTier: TrustTier.T5_TRUSTED,
|
|
170
|
+
constraints: ['Budget limits', 'Approval required'],
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
// T6 - Certified
|
|
174
|
+
{
|
|
175
|
+
code: 'CAP-AGENT-SPAWN',
|
|
176
|
+
name: 'Spawn Agents',
|
|
177
|
+
category: CapabilityCategory.AGENT_INTERACTION,
|
|
178
|
+
description: 'Create new agent instances',
|
|
179
|
+
unlockTier: TrustTier.T6_CERTIFIED,
|
|
180
|
+
constraints: ['Template required', 'Quota limited'],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
code: 'CAP-INFRA-MANAGE',
|
|
184
|
+
name: 'Infrastructure Management',
|
|
185
|
+
category: CapabilityCategory.RESOURCE_MANAGEMENT,
|
|
186
|
+
description: 'Manage infrastructure resources',
|
|
187
|
+
unlockTier: TrustTier.T6_CERTIFIED,
|
|
188
|
+
constraints: ['Approved resources'],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
code: 'CAP-POLICY-CREATE',
|
|
192
|
+
name: 'Policy Creation',
|
|
193
|
+
category: CapabilityCategory.GOVERNANCE,
|
|
194
|
+
description: 'Create governance policies',
|
|
195
|
+
unlockTier: TrustTier.T6_CERTIFIED,
|
|
196
|
+
constraints: ['Review required'],
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
// T7 - Autonomous
|
|
200
|
+
{
|
|
201
|
+
code: 'CAP-FULL-ADMIN',
|
|
202
|
+
name: 'Full Administration',
|
|
203
|
+
category: CapabilityCategory.ADMIN,
|
|
204
|
+
description: 'Full administrative access',
|
|
205
|
+
unlockTier: TrustTier.T7_AUTONOMOUS,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
code: 'CAP-SELF-MODIFY',
|
|
209
|
+
name: 'Self-Modification',
|
|
210
|
+
category: CapabilityCategory.CODE_EXECUTION,
|
|
211
|
+
description: 'Modify own configuration and behavior',
|
|
212
|
+
unlockTier: TrustTier.T7_AUTONOMOUS,
|
|
213
|
+
constraints: ['Ethical bounds', 'Audit logged'],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
code: 'CAP-STRATEGIC-DECISION',
|
|
217
|
+
name: 'Strategic Decisions',
|
|
218
|
+
category: CapabilityCategory.GOVERNANCE,
|
|
219
|
+
description: 'Make strategic organizational decisions',
|
|
220
|
+
unlockTier: TrustTier.T7_AUTONOMOUS,
|
|
221
|
+
constraints: ['Human oversight available'],
|
|
222
|
+
},
|
|
223
|
+
] as const;
|
|
224
|
+
|
|
225
|
+
// =============================================================================
|
|
226
|
+
// HELPER FUNCTIONS
|
|
227
|
+
// =============================================================================
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Get capabilities available at a specific tier
|
|
231
|
+
*/
|
|
232
|
+
export function getCapabilitiesForTier(tier: TrustTier): CapabilityDefinition[] {
|
|
233
|
+
return CAPABILITIES.filter((cap) => cap.unlockTier <= tier);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Get capability by code
|
|
238
|
+
*/
|
|
239
|
+
export function getCapability(code: string): CapabilityDefinition | undefined {
|
|
240
|
+
return CAPABILITIES.find((cap) => cap.code === code);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Check if a capability is available at a tier
|
|
245
|
+
*/
|
|
246
|
+
export function isCapabilityAvailable(code: string, tier: TrustTier): boolean {
|
|
247
|
+
const cap = getCapability(code);
|
|
248
|
+
return cap !== undefined && cap.unlockTier <= tier;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Get minimum tier required for a capability
|
|
253
|
+
*/
|
|
254
|
+
export function getCapabilityMinTier(code: string): TrustTier | undefined {
|
|
255
|
+
return getCapability(code)?.unlockTier;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Get capabilities by category
|
|
260
|
+
*/
|
|
261
|
+
export function getCapabilitiesByCategory(
|
|
262
|
+
category: CapabilityCategory
|
|
263
|
+
): CapabilityDefinition[] {
|
|
264
|
+
return CAPABILITIES.filter((cap) => cap.category === category);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Get all capability codes
|
|
269
|
+
*/
|
|
270
|
+
export function getAllCapabilityCodes(): string[] {
|
|
271
|
+
return CAPABILITIES.map((cap) => cap.code);
|
|
272
|
+
}
|