@vorionsys/shared-constants 1.0.1 → 1.0.3
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.cjs +4 -3
- package/dist/capabilities.d.cts +3 -2
- package/dist/capabilities.d.ts +56 -0
- package/dist/capabilities.js +1 -1
- package/dist/chunk-CJQJGJZ6.js +216 -0
- package/dist/chunk-JOS3AHBL.js +176 -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 +349 -12
- package/dist/index.d.cts +119 -4
- package/dist/index.d.ts +169 -0
- package/dist/index.js +330 -5
- package/dist/products.cjs +1 -1
- package/dist/products.d.ts +80 -0
- package/dist/products.js +1 -1
- 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 +30 -8
- 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/dist/chunk-PHL3CB53.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
// src/tiers.ts
|
|
2
|
-
var TrustTier = /* @__PURE__ */ ((TrustTier2) => {
|
|
3
|
-
TrustTier2[TrustTier2["T0_SANDBOX"] = 0] = "T0_SANDBOX";
|
|
4
|
-
TrustTier2[TrustTier2["T1_OBSERVED"] = 1] = "T1_OBSERVED";
|
|
5
|
-
TrustTier2[TrustTier2["T2_PROVISIONAL"] = 2] = "T2_PROVISIONAL";
|
|
6
|
-
TrustTier2[TrustTier2["T3_MONITORED"] = 3] = "T3_MONITORED";
|
|
7
|
-
TrustTier2[TrustTier2["T4_STANDARD"] = 4] = "T4_STANDARD";
|
|
8
|
-
TrustTier2[TrustTier2["T5_TRUSTED"] = 5] = "T5_TRUSTED";
|
|
9
|
-
TrustTier2[TrustTier2["T6_CERTIFIED"] = 6] = "T6_CERTIFIED";
|
|
10
|
-
TrustTier2[TrustTier2["T7_AUTONOMOUS"] = 7] = "T7_AUTONOMOUS";
|
|
11
|
-
return TrustTier2;
|
|
12
|
-
})(TrustTier || {});
|
|
13
|
-
var TIER_THRESHOLDS = {
|
|
14
|
-
[0 /* T0_SANDBOX */]: {
|
|
15
|
-
min: 0,
|
|
16
|
-
max: 199,
|
|
17
|
-
name: "Sandbox",
|
|
18
|
-
description: "Isolated, no external access, observation only",
|
|
19
|
-
color: "#78716c",
|
|
20
|
-
textColor: "#ffffff"
|
|
21
|
-
},
|
|
22
|
-
[1 /* T1_OBSERVED */]: {
|
|
23
|
-
min: 200,
|
|
24
|
-
max: 349,
|
|
25
|
-
name: "Observed",
|
|
26
|
-
description: "Read-only, sandboxed execution, monitored",
|
|
27
|
-
color: "#ef4444",
|
|
28
|
-
textColor: "#ffffff"
|
|
29
|
-
},
|
|
30
|
-
[2 /* T2_PROVISIONAL */]: {
|
|
31
|
-
min: 350,
|
|
32
|
-
max: 500,
|
|
33
|
-
name: "Provisional",
|
|
34
|
-
description: "Basic operations, heavy supervision",
|
|
35
|
-
color: "#f97316",
|
|
36
|
-
textColor: "#ffffff"
|
|
37
|
-
},
|
|
38
|
-
[3 /* T3_MONITORED */]: {
|
|
39
|
-
min: 501,
|
|
40
|
-
max: 649,
|
|
41
|
-
name: "Monitored",
|
|
42
|
-
description: "Standard operations with continuous monitoring",
|
|
43
|
-
color: "#eab308",
|
|
44
|
-
textColor: "#000000"
|
|
45
|
-
},
|
|
46
|
-
[4 /* T4_STANDARD */]: {
|
|
47
|
-
min: 650,
|
|
48
|
-
max: 799,
|
|
49
|
-
name: "Standard",
|
|
50
|
-
description: "External API access, policy-governed",
|
|
51
|
-
color: "#22c55e",
|
|
52
|
-
textColor: "#ffffff"
|
|
53
|
-
},
|
|
54
|
-
[5 /* T5_TRUSTED */]: {
|
|
55
|
-
min: 800,
|
|
56
|
-
max: 875,
|
|
57
|
-
name: "Trusted",
|
|
58
|
-
description: "Cross-agent communication, delegated tasks",
|
|
59
|
-
color: "#3b82f6",
|
|
60
|
-
textColor: "#ffffff"
|
|
61
|
-
},
|
|
62
|
-
[6 /* T6_CERTIFIED */]: {
|
|
63
|
-
min: 876,
|
|
64
|
-
max: 950,
|
|
65
|
-
name: "Certified",
|
|
66
|
-
description: "Admin tasks, agent spawning, minimal oversight",
|
|
67
|
-
color: "#8b5cf6",
|
|
68
|
-
textColor: "#ffffff"
|
|
69
|
-
},
|
|
70
|
-
[7 /* T7_AUTONOMOUS */]: {
|
|
71
|
-
min: 951,
|
|
72
|
-
max: 1e3,
|
|
73
|
-
name: "Autonomous",
|
|
74
|
-
description: "Full autonomy, self-governance, strategic only",
|
|
75
|
-
color: "#06b6d4",
|
|
76
|
-
textColor: "#ffffff"
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
function scoreToTier(score) {
|
|
80
|
-
if (score < 0 || score > 1e3) {
|
|
81
|
-
throw new Error(`Trust score must be between 0 and 1000, got ${score}`);
|
|
82
|
-
}
|
|
83
|
-
if (score >= 951) return 7 /* T7_AUTONOMOUS */;
|
|
84
|
-
if (score >= 876) return 6 /* T6_CERTIFIED */;
|
|
85
|
-
if (score >= 800) return 5 /* T5_TRUSTED */;
|
|
86
|
-
if (score >= 650) return 4 /* T4_STANDARD */;
|
|
87
|
-
if (score >= 501) return 3 /* T3_MONITORED */;
|
|
88
|
-
if (score >= 350) return 2 /* T2_PROVISIONAL */;
|
|
89
|
-
if (score >= 200) return 1 /* T1_OBSERVED */;
|
|
90
|
-
return 0 /* T0_SANDBOX */;
|
|
91
|
-
}
|
|
92
|
-
function getTierThreshold(tier) {
|
|
93
|
-
return TIER_THRESHOLDS[tier];
|
|
94
|
-
}
|
|
95
|
-
function getTierName(tier) {
|
|
96
|
-
return TIER_THRESHOLDS[tier].name;
|
|
97
|
-
}
|
|
98
|
-
function getTierColor(tier) {
|
|
99
|
-
return TIER_THRESHOLDS[tier].color;
|
|
100
|
-
}
|
|
101
|
-
function getTierMinScore(tier) {
|
|
102
|
-
return TIER_THRESHOLDS[tier].min;
|
|
103
|
-
}
|
|
104
|
-
function getTierMaxScore(tier) {
|
|
105
|
-
return TIER_THRESHOLDS[tier].max;
|
|
106
|
-
}
|
|
107
|
-
function meetsTierRequirement(score, minTier) {
|
|
108
|
-
const actualTier = scoreToTier(score);
|
|
109
|
-
return actualTier >= minTier;
|
|
110
|
-
}
|
|
111
|
-
function getTierCode(tier) {
|
|
112
|
-
return `T${tier}`;
|
|
113
|
-
}
|
|
114
|
-
function parseTier(input) {
|
|
115
|
-
const normalized = input.toUpperCase().trim();
|
|
116
|
-
const tMatch = normalized.match(/^T?(\d)$/);
|
|
117
|
-
if (tMatch) {
|
|
118
|
-
const num = parseInt(tMatch[1], 10);
|
|
119
|
-
if (num >= 0 && num <= 7) {
|
|
120
|
-
return num;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const nameMap = {
|
|
124
|
-
SANDBOX: 0 /* T0_SANDBOX */,
|
|
125
|
-
OBSERVED: 1 /* T1_OBSERVED */,
|
|
126
|
-
PROVISIONAL: 2 /* T2_PROVISIONAL */,
|
|
127
|
-
MONITORED: 3 /* T3_MONITORED */,
|
|
128
|
-
STANDARD: 4 /* T4_STANDARD */,
|
|
129
|
-
TRUSTED: 5 /* T5_TRUSTED */,
|
|
130
|
-
CERTIFIED: 6 /* T6_CERTIFIED */,
|
|
131
|
-
AUTONOMOUS: 7 /* T7_AUTONOMOUS */
|
|
132
|
-
};
|
|
133
|
-
return nameMap[normalized] ?? null;
|
|
134
|
-
}
|
|
135
|
-
var ALL_TIERS = [
|
|
136
|
-
0 /* T0_SANDBOX */,
|
|
137
|
-
1 /* T1_OBSERVED */,
|
|
138
|
-
2 /* T2_PROVISIONAL */,
|
|
139
|
-
3 /* T3_MONITORED */,
|
|
140
|
-
4 /* T4_STANDARD */,
|
|
141
|
-
5 /* T5_TRUSTED */,
|
|
142
|
-
6 /* T6_CERTIFIED */,
|
|
143
|
-
7 /* T7_AUTONOMOUS */
|
|
144
|
-
];
|
|
145
|
-
|
|
146
|
-
export {
|
|
147
|
-
TrustTier,
|
|
148
|
-
TIER_THRESHOLDS,
|
|
149
|
-
scoreToTier,
|
|
150
|
-
getTierThreshold,
|
|
151
|
-
getTierName,
|
|
152
|
-
getTierColor,
|
|
153
|
-
getTierMinScore,
|
|
154
|
-
getTierMaxScore,
|
|
155
|
-
meetsTierRequirement,
|
|
156
|
-
getTierCode,
|
|
157
|
-
parseTier,
|
|
158
|
-
ALL_TIERS
|
|
159
|
-
};
|
package/src/api-versions.ts
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
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;
|
package/src/capabilities.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
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
|
-
}
|