@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
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1762 @@
|
|
|
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/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ACTIVE_THEME: () => ACTIVE_THEME,
|
|
24
|
+
AGENTANCHOR_DOMAINS: () => AGENTANCHOR_DOMAINS,
|
|
25
|
+
AGENTANCHOR_EMAILS: () => AGENTANCHOR_EMAILS,
|
|
26
|
+
AGENTANCHOR_PRODUCTS: () => AGENTANCHOR_PRODUCTS,
|
|
27
|
+
ALL_DOMAINS: () => ALL_DOMAINS,
|
|
28
|
+
ALL_PRODUCTS: () => ALL_PRODUCTS,
|
|
29
|
+
ALL_TIERS: () => ALL_TIERS,
|
|
30
|
+
API_ENDPOINTS: () => API_ENDPOINTS,
|
|
31
|
+
API_VERSIONS: () => API_VERSIONS,
|
|
32
|
+
AUTH_ERRORS: () => AUTH_ERRORS,
|
|
33
|
+
BASIS_CURRENT_VERSION: () => BASIS_CURRENT_VERSION,
|
|
34
|
+
BASIS_SPEC_VERSION: () => BASIS_SPEC_VERSION,
|
|
35
|
+
BASIS_VERSIONS: () => BASIS_VERSIONS,
|
|
36
|
+
CAPABILITIES: () => CAPABILITIES,
|
|
37
|
+
CAR_SPEC_CURRENT_VERSION: () => CAR_SPEC_CURRENT_VERSION,
|
|
38
|
+
CAR_SPEC_VERSIONS: () => CAR_SPEC_VERSIONS,
|
|
39
|
+
COGNIGATE_CURRENT_VERSION: () => COGNIGATE_CURRENT_VERSION,
|
|
40
|
+
COGNIGATE_DEFAULT_VERSION: () => COGNIGATE_DEFAULT_VERSION,
|
|
41
|
+
COGNIGATE_DOMAINS: () => COGNIGATE_DOMAINS,
|
|
42
|
+
COGNIGATE_VERSIONS: () => COGNIGATE_VERSIONS,
|
|
43
|
+
CapabilityCategory: () => CapabilityCategory,
|
|
44
|
+
DOMAIN_ALIASES: () => DOMAIN_ALIASES,
|
|
45
|
+
ERROR_CODES: () => ERROR_CODES,
|
|
46
|
+
EXTERNAL_ERRORS: () => EXTERNAL_ERRORS,
|
|
47
|
+
ErrorCategory: () => ErrorCategory,
|
|
48
|
+
GITHUB: () => GITHUB,
|
|
49
|
+
LAST_UPDATED: () => LAST_UPDATED,
|
|
50
|
+
LOGIC_API_VERSIONS: () => LOGIC_API_VERSIONS,
|
|
51
|
+
LOGIC_CURRENT_VERSION: () => LOGIC_CURRENT_VERSION,
|
|
52
|
+
NOT_FOUND_ERRORS: () => NOT_FOUND_ERRORS,
|
|
53
|
+
NPM_PACKAGES: () => NPM_PACKAGES,
|
|
54
|
+
ProductCategory: () => ProductCategory,
|
|
55
|
+
ProductStatus: () => ProductStatus,
|
|
56
|
+
RATE_LIMITS: () => RATE_LIMITS,
|
|
57
|
+
RATE_LIMIT_ERRORS: () => RATE_LIMIT_ERRORS,
|
|
58
|
+
SERVER_ERRORS: () => SERVER_ERRORS,
|
|
59
|
+
THEMES: () => THEMES,
|
|
60
|
+
TIER_QUOTAS: () => TIER_QUOTAS,
|
|
61
|
+
TIER_THRESHOLDS: () => TIER_THRESHOLDS,
|
|
62
|
+
TRUST_API_VERSIONS: () => TRUST_API_VERSIONS,
|
|
63
|
+
TRUST_CURRENT_VERSION: () => TRUST_CURRENT_VERSION,
|
|
64
|
+
TRUST_ERRORS: () => TRUST_ERRORS,
|
|
65
|
+
TrustTier: () => TrustTier,
|
|
66
|
+
VALIDATION_ERRORS: () => VALIDATION_ERRORS,
|
|
67
|
+
VERSION: () => VERSION,
|
|
68
|
+
VERSION_HEADERS: () => VERSION_HEADERS,
|
|
69
|
+
VORION_DOMAINS: () => VORION_DOMAINS,
|
|
70
|
+
VORION_EMAILS: () => VORION_EMAILS,
|
|
71
|
+
VORION_PRODUCTS: () => VORION_PRODUCTS,
|
|
72
|
+
VersionStatus: () => VersionStatus,
|
|
73
|
+
buildApiUrl: () => buildApiUrl,
|
|
74
|
+
createErrorResponse: () => createErrorResponse,
|
|
75
|
+
formatErrorMessage: () => formatErrorMessage,
|
|
76
|
+
formatRateLimit: () => formatRateLimit,
|
|
77
|
+
getActiveTheme: () => getActiveTheme,
|
|
78
|
+
getAllCapabilityCodes: () => getAllCapabilityCodes,
|
|
79
|
+
getAllThemeIds: () => getAllThemeIds,
|
|
80
|
+
getCapabilitiesByCategory: () => getCapabilitiesByCategory,
|
|
81
|
+
getCapabilitiesForTier: () => getCapabilitiesForTier,
|
|
82
|
+
getCapability: () => getCapability,
|
|
83
|
+
getCapabilityMinTier: () => getCapabilityMinTier,
|
|
84
|
+
getCurrentVersion: () => getCurrentVersion,
|
|
85
|
+
getErrorByCode: () => getErrorByCode,
|
|
86
|
+
getErrorsByCategory: () => getErrorsByCategory,
|
|
87
|
+
getMinTierForLimits: () => getMinTierForLimits,
|
|
88
|
+
getProduct: () => getProduct,
|
|
89
|
+
getProductsByCategory: () => getProductsByCategory,
|
|
90
|
+
getProductsByOrganization: () => getProductsByOrganization,
|
|
91
|
+
getProductsByStatus: () => getProductsByStatus,
|
|
92
|
+
getQuota: () => getQuota,
|
|
93
|
+
getRateLimits: () => getRateLimits,
|
|
94
|
+
getRetryableErrors: () => getRetryableErrors,
|
|
95
|
+
getStableVersions: () => getStableVersions,
|
|
96
|
+
getTierCode: () => getTierCode,
|
|
97
|
+
getTierColor: () => getTierColor,
|
|
98
|
+
getTierMaxScore: () => getTierMaxScore,
|
|
99
|
+
getTierMinScore: () => getTierMinScore,
|
|
100
|
+
getTierName: () => getTierName,
|
|
101
|
+
getTierThreshold: () => getTierThreshold,
|
|
102
|
+
getVersionDefinition: () => getVersionDefinition,
|
|
103
|
+
isCapabilityAvailable: () => isCapabilityAvailable,
|
|
104
|
+
isUnlimited: () => isUnlimited,
|
|
105
|
+
isVersionDeprecated: () => isVersionDeprecated,
|
|
106
|
+
isVersionSupported: () => isVersionSupported,
|
|
107
|
+
meetsTierRequirement: () => meetsTierRequirement,
|
|
108
|
+
parseTier: () => parseTier,
|
|
109
|
+
scoreToTier: () => scoreToTier,
|
|
110
|
+
themeToCssVars: () => themeToCssVars,
|
|
111
|
+
wouldExceedLimit: () => wouldExceedLimit
|
|
112
|
+
});
|
|
113
|
+
module.exports = __toCommonJS(index_exports);
|
|
114
|
+
|
|
115
|
+
// src/tiers.ts
|
|
116
|
+
var TrustTier = /* @__PURE__ */ ((TrustTier2) => {
|
|
117
|
+
TrustTier2[TrustTier2["T0_SANDBOX"] = 0] = "T0_SANDBOX";
|
|
118
|
+
TrustTier2[TrustTier2["T1_OBSERVED"] = 1] = "T1_OBSERVED";
|
|
119
|
+
TrustTier2[TrustTier2["T2_PROVISIONAL"] = 2] = "T2_PROVISIONAL";
|
|
120
|
+
TrustTier2[TrustTier2["T3_MONITORED"] = 3] = "T3_MONITORED";
|
|
121
|
+
TrustTier2[TrustTier2["T4_STANDARD"] = 4] = "T4_STANDARD";
|
|
122
|
+
TrustTier2[TrustTier2["T5_TRUSTED"] = 5] = "T5_TRUSTED";
|
|
123
|
+
TrustTier2[TrustTier2["T6_CERTIFIED"] = 6] = "T6_CERTIFIED";
|
|
124
|
+
TrustTier2[TrustTier2["T7_AUTONOMOUS"] = 7] = "T7_AUTONOMOUS";
|
|
125
|
+
return TrustTier2;
|
|
126
|
+
})(TrustTier || {});
|
|
127
|
+
var TIER_THRESHOLDS = {
|
|
128
|
+
[0 /* T0_SANDBOX */]: {
|
|
129
|
+
min: 0,
|
|
130
|
+
max: 199,
|
|
131
|
+
name: "Sandbox",
|
|
132
|
+
description: "Isolated, no external access, observation only",
|
|
133
|
+
color: "#78716c",
|
|
134
|
+
textColor: "#ffffff"
|
|
135
|
+
},
|
|
136
|
+
[1 /* T1_OBSERVED */]: {
|
|
137
|
+
min: 200,
|
|
138
|
+
max: 349,
|
|
139
|
+
name: "Observed",
|
|
140
|
+
description: "Read-only, sandboxed execution, monitored",
|
|
141
|
+
color: "#ef4444",
|
|
142
|
+
textColor: "#ffffff"
|
|
143
|
+
},
|
|
144
|
+
[2 /* T2_PROVISIONAL */]: {
|
|
145
|
+
min: 350,
|
|
146
|
+
max: 500,
|
|
147
|
+
name: "Provisional",
|
|
148
|
+
description: "Basic operations, heavy supervision",
|
|
149
|
+
color: "#f97316",
|
|
150
|
+
textColor: "#ffffff"
|
|
151
|
+
},
|
|
152
|
+
[3 /* T3_MONITORED */]: {
|
|
153
|
+
min: 501,
|
|
154
|
+
max: 649,
|
|
155
|
+
name: "Monitored",
|
|
156
|
+
description: "Standard operations with continuous monitoring",
|
|
157
|
+
color: "#eab308",
|
|
158
|
+
textColor: "#000000"
|
|
159
|
+
},
|
|
160
|
+
[4 /* T4_STANDARD */]: {
|
|
161
|
+
min: 650,
|
|
162
|
+
max: 799,
|
|
163
|
+
name: "Standard",
|
|
164
|
+
description: "External API access, policy-governed",
|
|
165
|
+
color: "#22c55e",
|
|
166
|
+
textColor: "#ffffff"
|
|
167
|
+
},
|
|
168
|
+
[5 /* T5_TRUSTED */]: {
|
|
169
|
+
min: 800,
|
|
170
|
+
max: 875,
|
|
171
|
+
name: "Trusted",
|
|
172
|
+
description: "Cross-agent communication, delegated tasks",
|
|
173
|
+
color: "#3b82f6",
|
|
174
|
+
textColor: "#ffffff"
|
|
175
|
+
},
|
|
176
|
+
[6 /* T6_CERTIFIED */]: {
|
|
177
|
+
min: 876,
|
|
178
|
+
max: 950,
|
|
179
|
+
name: "Certified",
|
|
180
|
+
description: "Admin tasks, agent spawning, minimal oversight",
|
|
181
|
+
color: "#8b5cf6",
|
|
182
|
+
textColor: "#ffffff"
|
|
183
|
+
},
|
|
184
|
+
[7 /* T7_AUTONOMOUS */]: {
|
|
185
|
+
min: 951,
|
|
186
|
+
max: 1e3,
|
|
187
|
+
name: "Autonomous",
|
|
188
|
+
description: "Full autonomy, self-governance, strategic only",
|
|
189
|
+
color: "#06b6d4",
|
|
190
|
+
textColor: "#ffffff"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
function scoreToTier(score) {
|
|
194
|
+
if (score < 0 || score > 1e3) {
|
|
195
|
+
throw new Error(`Trust score must be between 0 and 1000, got ${score}`);
|
|
196
|
+
}
|
|
197
|
+
if (score >= 951) return 7 /* T7_AUTONOMOUS */;
|
|
198
|
+
if (score >= 876) return 6 /* T6_CERTIFIED */;
|
|
199
|
+
if (score >= 800) return 5 /* T5_TRUSTED */;
|
|
200
|
+
if (score >= 650) return 4 /* T4_STANDARD */;
|
|
201
|
+
if (score >= 501) return 3 /* T3_MONITORED */;
|
|
202
|
+
if (score >= 350) return 2 /* T2_PROVISIONAL */;
|
|
203
|
+
if (score >= 200) return 1 /* T1_OBSERVED */;
|
|
204
|
+
return 0 /* T0_SANDBOX */;
|
|
205
|
+
}
|
|
206
|
+
function getTierThreshold(tier) {
|
|
207
|
+
return TIER_THRESHOLDS[tier];
|
|
208
|
+
}
|
|
209
|
+
function getTierName(tier) {
|
|
210
|
+
return TIER_THRESHOLDS[tier].name;
|
|
211
|
+
}
|
|
212
|
+
function getTierColor(tier) {
|
|
213
|
+
return TIER_THRESHOLDS[tier].color;
|
|
214
|
+
}
|
|
215
|
+
function getTierMinScore(tier) {
|
|
216
|
+
return TIER_THRESHOLDS[tier].min;
|
|
217
|
+
}
|
|
218
|
+
function getTierMaxScore(tier) {
|
|
219
|
+
return TIER_THRESHOLDS[tier].max;
|
|
220
|
+
}
|
|
221
|
+
function meetsTierRequirement(score, minTier) {
|
|
222
|
+
const actualTier = scoreToTier(score);
|
|
223
|
+
return actualTier >= minTier;
|
|
224
|
+
}
|
|
225
|
+
function getTierCode(tier) {
|
|
226
|
+
return `T${tier}`;
|
|
227
|
+
}
|
|
228
|
+
function parseTier(input) {
|
|
229
|
+
const normalized = input.toUpperCase().trim();
|
|
230
|
+
const tMatch = normalized.match(/^T?(\d)$/);
|
|
231
|
+
if (tMatch) {
|
|
232
|
+
const num = parseInt(tMatch[1], 10);
|
|
233
|
+
if (num >= 0 && num <= 7) {
|
|
234
|
+
return num;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const nameMap = {
|
|
238
|
+
SANDBOX: 0 /* T0_SANDBOX */,
|
|
239
|
+
OBSERVED: 1 /* T1_OBSERVED */,
|
|
240
|
+
PROVISIONAL: 2 /* T2_PROVISIONAL */,
|
|
241
|
+
MONITORED: 3 /* T3_MONITORED */,
|
|
242
|
+
STANDARD: 4 /* T4_STANDARD */,
|
|
243
|
+
TRUSTED: 5 /* T5_TRUSTED */,
|
|
244
|
+
CERTIFIED: 6 /* T6_CERTIFIED */,
|
|
245
|
+
AUTONOMOUS: 7 /* T7_AUTONOMOUS */
|
|
246
|
+
};
|
|
247
|
+
return nameMap[normalized] ?? null;
|
|
248
|
+
}
|
|
249
|
+
var ALL_TIERS = [
|
|
250
|
+
0 /* T0_SANDBOX */,
|
|
251
|
+
1 /* T1_OBSERVED */,
|
|
252
|
+
2 /* T2_PROVISIONAL */,
|
|
253
|
+
3 /* T3_MONITORED */,
|
|
254
|
+
4 /* T4_STANDARD */,
|
|
255
|
+
5 /* T5_TRUSTED */,
|
|
256
|
+
6 /* T6_CERTIFIED */,
|
|
257
|
+
7 /* T7_AUTONOMOUS */
|
|
258
|
+
];
|
|
259
|
+
|
|
260
|
+
// src/domains.ts
|
|
261
|
+
var VORION_DOMAINS = {
|
|
262
|
+
/** Main Vorion organization site */
|
|
263
|
+
main: "https://vorion.org",
|
|
264
|
+
/** BASIS specification and documentation */
|
|
265
|
+
basis: "https://basis.vorion.org",
|
|
266
|
+
/** CAR ID specification */
|
|
267
|
+
carId: "https://carid.vorion.org",
|
|
268
|
+
/** ATSF (Agent Trust & Safety Framework) */
|
|
269
|
+
atsf: "https://atsf.vorion.org",
|
|
270
|
+
/** Learning and educational resources (primary) */
|
|
271
|
+
learn: "https://learn.vorion.org",
|
|
272
|
+
/** Kaizen - Interactive AI Learning Experience (mirrors learn) */
|
|
273
|
+
kaizen: "https://kaizen.vorion.org",
|
|
274
|
+
/** Technical documentation */
|
|
275
|
+
docs: "https://docs.vorion.org",
|
|
276
|
+
/** Community forum */
|
|
277
|
+
community: "https://community.vorion.org"
|
|
278
|
+
};
|
|
279
|
+
var DOMAIN_ALIASES = {
|
|
280
|
+
"kaizen.vorion.org": "learn.vorion.org"
|
|
281
|
+
};
|
|
282
|
+
var AGENTANCHOR_DOMAINS = {
|
|
283
|
+
/** Main Agent Anchor AI site */
|
|
284
|
+
main: "https://agentanchorai.com",
|
|
285
|
+
/** Agent Anchor Trust - Trust verification and certification */
|
|
286
|
+
trust: "https://trust.agentanchorai.com",
|
|
287
|
+
/** Agent Anchor Logic - Policy engine and governance logic */
|
|
288
|
+
logic: "https://logic.agentanchorai.com",
|
|
289
|
+
/** Status page */
|
|
290
|
+
status: "https://status.agentanchorai.com"
|
|
291
|
+
};
|
|
292
|
+
var COGNIGATE_DOMAINS = {
|
|
293
|
+
/** Cognigate main site and documentation */
|
|
294
|
+
main: "https://cognigate.dev",
|
|
295
|
+
/** Cognigate API documentation */
|
|
296
|
+
docs: "https://cognigate.dev/docs"
|
|
297
|
+
};
|
|
298
|
+
var API_ENDPOINTS = {
|
|
299
|
+
/** Cognigate Production API */
|
|
300
|
+
cognigate: {
|
|
301
|
+
production: "https://cognigate.dev/v1",
|
|
302
|
+
staging: "https://staging.cognigate.dev/v1"
|
|
303
|
+
},
|
|
304
|
+
/** Agent Anchor AI Production API */
|
|
305
|
+
agentAnchor: {
|
|
306
|
+
production: "https://api.agentanchorai.com/v1",
|
|
307
|
+
staging: "https://staging-api.agentanchorai.com/v1",
|
|
308
|
+
sandbox: "https://sandbox.agentanchorai.com/v1"
|
|
309
|
+
},
|
|
310
|
+
/** Trust API */
|
|
311
|
+
trust: {
|
|
312
|
+
production: "https://trust.agentanchorai.com/v1",
|
|
313
|
+
staging: "https://staging.trust.agentanchorai.com/v1"
|
|
314
|
+
},
|
|
315
|
+
/** Logic/Policy API */
|
|
316
|
+
logic: {
|
|
317
|
+
production: "https://logic.agentanchorai.com/v1",
|
|
318
|
+
staging: "https://staging.logic.agentanchorai.com/v1"
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
var VORION_EMAILS = {
|
|
322
|
+
/** General inquiries */
|
|
323
|
+
info: "info@vorion.org",
|
|
324
|
+
/** Security reports */
|
|
325
|
+
security: "security@vorion.org",
|
|
326
|
+
/** Legal inquiries */
|
|
327
|
+
legal: "legal@vorion.org",
|
|
328
|
+
/** Community and contributions */
|
|
329
|
+
community: "community@vorion.org",
|
|
330
|
+
/** Contributing */
|
|
331
|
+
contribute: "contribute@vorion.org"
|
|
332
|
+
};
|
|
333
|
+
var AGENTANCHOR_EMAILS = {
|
|
334
|
+
/** General support */
|
|
335
|
+
support: "support@agentanchorai.com",
|
|
336
|
+
/** Sales inquiries */
|
|
337
|
+
sales: "sales@agentanchorai.com",
|
|
338
|
+
/** Partner program */
|
|
339
|
+
partners: "partners@agentanchorai.com",
|
|
340
|
+
/** API support */
|
|
341
|
+
apiSupport: "api-support@agentanchorai.com",
|
|
342
|
+
/** Enterprise inquiries */
|
|
343
|
+
enterprise: "enterprise@agentanchorai.com",
|
|
344
|
+
/** Compliance */
|
|
345
|
+
compliance: "compliance@agentanchorai.com",
|
|
346
|
+
/** Team */
|
|
347
|
+
team: "team@agentanchorai.com"
|
|
348
|
+
};
|
|
349
|
+
var GITHUB = {
|
|
350
|
+
/** Vorion organization */
|
|
351
|
+
vorion: {
|
|
352
|
+
org: "https://github.com/voriongit",
|
|
353
|
+
mainRepo: "https://github.com/voriongit/vorion"
|
|
354
|
+
},
|
|
355
|
+
/** Agent Anchor AI (if separate) */
|
|
356
|
+
agentAnchor: {
|
|
357
|
+
org: "https://github.com/agentanchorai"
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
var NPM_PACKAGES = {
|
|
361
|
+
/** Open source packages (@vorionsys) */
|
|
362
|
+
vorion: {
|
|
363
|
+
basis: "@vorionsys/basis",
|
|
364
|
+
contracts: "@vorionsys/contracts",
|
|
365
|
+
carSpec: "@vorionsys/car-spec",
|
|
366
|
+
atsfCore: "@vorionsys/atsf-core",
|
|
367
|
+
cognigate: "@vorionsys/cognigate",
|
|
368
|
+
sharedConstants: "@vorionsys/shared-constants"
|
|
369
|
+
},
|
|
370
|
+
/** Commercial packages (@agentanchor) */
|
|
371
|
+
agentAnchor: {
|
|
372
|
+
sdk: "@agentanchor/sdk",
|
|
373
|
+
trust: "@agentanchor/trust",
|
|
374
|
+
logic: "@agentanchor/logic"
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
var ALL_DOMAINS = {
|
|
378
|
+
vorion: VORION_DOMAINS,
|
|
379
|
+
agentAnchor: AGENTANCHOR_DOMAINS,
|
|
380
|
+
cognigate: COGNIGATE_DOMAINS,
|
|
381
|
+
api: API_ENDPOINTS,
|
|
382
|
+
emails: {
|
|
383
|
+
vorion: VORION_EMAILS,
|
|
384
|
+
agentAnchor: AGENTANCHOR_EMAILS
|
|
385
|
+
},
|
|
386
|
+
github: GITHUB,
|
|
387
|
+
npm: NPM_PACKAGES
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// src/capabilities.ts
|
|
391
|
+
var CapabilityCategory = /* @__PURE__ */ ((CapabilityCategory2) => {
|
|
392
|
+
CapabilityCategory2["DATA_ACCESS"] = "data_access";
|
|
393
|
+
CapabilityCategory2["API_ACCESS"] = "api_access";
|
|
394
|
+
CapabilityCategory2["CODE_EXECUTION"] = "code_execution";
|
|
395
|
+
CapabilityCategory2["AGENT_INTERACTION"] = "agent_interaction";
|
|
396
|
+
CapabilityCategory2["RESOURCE_MANAGEMENT"] = "resource_management";
|
|
397
|
+
CapabilityCategory2["GOVERNANCE"] = "governance";
|
|
398
|
+
CapabilityCategory2["ADMIN"] = "admin";
|
|
399
|
+
return CapabilityCategory2;
|
|
400
|
+
})(CapabilityCategory || {});
|
|
401
|
+
var CAPABILITIES = [
|
|
402
|
+
// T0 - Sandbox
|
|
403
|
+
{
|
|
404
|
+
code: "CAP-READ-PUBLIC",
|
|
405
|
+
name: "Read Public Data",
|
|
406
|
+
category: "data_access" /* DATA_ACCESS */,
|
|
407
|
+
description: "Access publicly available data",
|
|
408
|
+
unlockTier: 0 /* T0_SANDBOX */
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
code: "CAP-GENERATE-TEXT",
|
|
412
|
+
name: "Generate Text",
|
|
413
|
+
category: "code_execution" /* CODE_EXECUTION */,
|
|
414
|
+
description: "Generate text responses",
|
|
415
|
+
unlockTier: 0 /* T0_SANDBOX */
|
|
416
|
+
},
|
|
417
|
+
// T1 - Observed
|
|
418
|
+
{
|
|
419
|
+
code: "CAP-READ-INTERNAL",
|
|
420
|
+
name: "Read Internal Data",
|
|
421
|
+
category: "data_access" /* DATA_ACCESS */,
|
|
422
|
+
description: "Access internal data within allowed scopes",
|
|
423
|
+
unlockTier: 1 /* T1_OBSERVED */,
|
|
424
|
+
constraints: ["Read-only", "Logged"]
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
code: "CAP-INTERNAL-API",
|
|
428
|
+
name: "Internal API Access",
|
|
429
|
+
category: "api_access" /* API_ACCESS */,
|
|
430
|
+
description: "Make read-only internal API calls",
|
|
431
|
+
unlockTier: 1 /* T1_OBSERVED */,
|
|
432
|
+
constraints: ["GET only", "Rate limited"]
|
|
433
|
+
},
|
|
434
|
+
// T2 - Provisional
|
|
435
|
+
{
|
|
436
|
+
code: "CAP-FILE-WRITE",
|
|
437
|
+
name: "Write Files",
|
|
438
|
+
category: "data_access" /* DATA_ACCESS */,
|
|
439
|
+
description: "Write to approved directories",
|
|
440
|
+
unlockTier: 2 /* T2_PROVISIONAL */,
|
|
441
|
+
constraints: ["Approved dirs only", "Size limited"]
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
code: "CAP-DB-READ",
|
|
445
|
+
name: "Database Read",
|
|
446
|
+
category: "data_access" /* DATA_ACCESS */,
|
|
447
|
+
description: "Read from approved database tables",
|
|
448
|
+
unlockTier: 2 /* T2_PROVISIONAL */,
|
|
449
|
+
constraints: ["Approved tables", "Query timeout"]
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
code: "CAP-EXTERNAL-API-READ",
|
|
453
|
+
name: "External API Read",
|
|
454
|
+
category: "api_access" /* API_ACCESS */,
|
|
455
|
+
description: "Make GET requests to approved external APIs",
|
|
456
|
+
unlockTier: 2 /* T2_PROVISIONAL */,
|
|
457
|
+
constraints: ["GET only", "Approved endpoints"]
|
|
458
|
+
},
|
|
459
|
+
// T3 - Monitored
|
|
460
|
+
{
|
|
461
|
+
code: "CAP-DB-WRITE",
|
|
462
|
+
name: "Database Write",
|
|
463
|
+
category: "data_access" /* DATA_ACCESS */,
|
|
464
|
+
description: "Write to approved database tables",
|
|
465
|
+
unlockTier: 3 /* T3_MONITORED */,
|
|
466
|
+
constraints: ["Approved tables", "Transaction limits"]
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
code: "CAP-EXTERNAL-API-FULL",
|
|
470
|
+
name: "External API Full Access",
|
|
471
|
+
category: "api_access" /* API_ACCESS */,
|
|
472
|
+
description: "Full REST operations on approved external APIs",
|
|
473
|
+
unlockTier: 3 /* T3_MONITORED */,
|
|
474
|
+
constraints: ["Approved endpoints", "Rate limited"]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
code: "CAP-CODE-SANDBOX",
|
|
478
|
+
name: "Sandboxed Code Execution",
|
|
479
|
+
category: "code_execution" /* CODE_EXECUTION */,
|
|
480
|
+
description: "Execute code in isolated sandbox",
|
|
481
|
+
unlockTier: 3 /* T3_MONITORED */,
|
|
482
|
+
constraints: ["Sandboxed", "Time limited", "No network"]
|
|
483
|
+
},
|
|
484
|
+
// T4 - Standard
|
|
485
|
+
{
|
|
486
|
+
code: "CAP-AGENT-COMMUNICATE",
|
|
487
|
+
name: "Agent Communication",
|
|
488
|
+
category: "agent_interaction" /* AGENT_INTERACTION */,
|
|
489
|
+
description: "Send and receive messages to/from other agents",
|
|
490
|
+
unlockTier: 4 /* T4_STANDARD */,
|
|
491
|
+
constraints: ["Approved agents", "Message limits"]
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
code: "CAP-WORKFLOW-MULTI",
|
|
495
|
+
name: "Multi-Step Workflow",
|
|
496
|
+
category: "code_execution" /* CODE_EXECUTION */,
|
|
497
|
+
description: "Orchestrate multi-step workflows",
|
|
498
|
+
unlockTier: 4 /* T4_STANDARD */,
|
|
499
|
+
constraints: ["Approved patterns", "Checkpoints required"]
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
code: "CAP-ESCALATE-HUMAN",
|
|
503
|
+
name: "Human Escalation",
|
|
504
|
+
category: "governance" /* GOVERNANCE */,
|
|
505
|
+
description: "Initiate escalation to human reviewers",
|
|
506
|
+
unlockTier: 4 /* T4_STANDARD */
|
|
507
|
+
},
|
|
508
|
+
// T5 - Trusted
|
|
509
|
+
{
|
|
510
|
+
code: "CAP-AGENT-DELEGATE",
|
|
511
|
+
name: "Task Delegation",
|
|
512
|
+
category: "agent_interaction" /* AGENT_INTERACTION */,
|
|
513
|
+
description: "Delegate tasks to other agents",
|
|
514
|
+
unlockTier: 5 /* T5_TRUSTED */,
|
|
515
|
+
constraints: ["Trust verified agents"]
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
code: "CAP-RESOURCE-PROVISION",
|
|
519
|
+
name: "Resource Provisioning",
|
|
520
|
+
category: "resource_management" /* RESOURCE_MANAGEMENT */,
|
|
521
|
+
description: "Provision computational resources",
|
|
522
|
+
unlockTier: 5 /* T5_TRUSTED */,
|
|
523
|
+
constraints: ["Budget limits", "Approval required"]
|
|
524
|
+
},
|
|
525
|
+
// T6 - Certified
|
|
526
|
+
{
|
|
527
|
+
code: "CAP-AGENT-SPAWN",
|
|
528
|
+
name: "Spawn Agents",
|
|
529
|
+
category: "agent_interaction" /* AGENT_INTERACTION */,
|
|
530
|
+
description: "Create new agent instances",
|
|
531
|
+
unlockTier: 6 /* T6_CERTIFIED */,
|
|
532
|
+
constraints: ["Template required", "Quota limited"]
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
code: "CAP-INFRA-MANAGE",
|
|
536
|
+
name: "Infrastructure Management",
|
|
537
|
+
category: "resource_management" /* RESOURCE_MANAGEMENT */,
|
|
538
|
+
description: "Manage infrastructure resources",
|
|
539
|
+
unlockTier: 6 /* T6_CERTIFIED */,
|
|
540
|
+
constraints: ["Approved resources"]
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
code: "CAP-POLICY-CREATE",
|
|
544
|
+
name: "Policy Creation",
|
|
545
|
+
category: "governance" /* GOVERNANCE */,
|
|
546
|
+
description: "Create governance policies",
|
|
547
|
+
unlockTier: 6 /* T6_CERTIFIED */,
|
|
548
|
+
constraints: ["Review required"]
|
|
549
|
+
},
|
|
550
|
+
// T7 - Autonomous
|
|
551
|
+
{
|
|
552
|
+
code: "CAP-FULL-ADMIN",
|
|
553
|
+
name: "Full Administration",
|
|
554
|
+
category: "admin" /* ADMIN */,
|
|
555
|
+
description: "Full administrative access",
|
|
556
|
+
unlockTier: 7 /* T7_AUTONOMOUS */
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
code: "CAP-SELF-MODIFY",
|
|
560
|
+
name: "Self-Modification",
|
|
561
|
+
category: "code_execution" /* CODE_EXECUTION */,
|
|
562
|
+
description: "Modify own configuration and behavior",
|
|
563
|
+
unlockTier: 7 /* T7_AUTONOMOUS */,
|
|
564
|
+
constraints: ["Ethical bounds", "Audit logged"]
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
code: "CAP-STRATEGIC-DECISION",
|
|
568
|
+
name: "Strategic Decisions",
|
|
569
|
+
category: "governance" /* GOVERNANCE */,
|
|
570
|
+
description: "Make strategic organizational decisions",
|
|
571
|
+
unlockTier: 7 /* T7_AUTONOMOUS */,
|
|
572
|
+
constraints: ["Human oversight available"]
|
|
573
|
+
}
|
|
574
|
+
];
|
|
575
|
+
function getCapabilitiesForTier(tier) {
|
|
576
|
+
return CAPABILITIES.filter((cap) => cap.unlockTier <= tier);
|
|
577
|
+
}
|
|
578
|
+
function getCapability(code) {
|
|
579
|
+
return CAPABILITIES.find((cap) => cap.code === code);
|
|
580
|
+
}
|
|
581
|
+
function isCapabilityAvailable(code, tier) {
|
|
582
|
+
const cap = getCapability(code);
|
|
583
|
+
return cap !== void 0 && cap.unlockTier <= tier;
|
|
584
|
+
}
|
|
585
|
+
function getCapabilityMinTier(code) {
|
|
586
|
+
return getCapability(code)?.unlockTier;
|
|
587
|
+
}
|
|
588
|
+
function getCapabilitiesByCategory(category) {
|
|
589
|
+
return CAPABILITIES.filter((cap) => cap.category === category);
|
|
590
|
+
}
|
|
591
|
+
function getAllCapabilityCodes() {
|
|
592
|
+
return CAPABILITIES.map((cap) => cap.code);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// src/products.ts
|
|
596
|
+
var ProductCategory = /* @__PURE__ */ ((ProductCategory2) => {
|
|
597
|
+
ProductCategory2["OPEN_SOURCE"] = "open_source";
|
|
598
|
+
ProductCategory2["COMMERCIAL"] = "commercial";
|
|
599
|
+
ProductCategory2["DEVELOPER_TOOLS"] = "developer_tools";
|
|
600
|
+
ProductCategory2["EDUCATION"] = "education";
|
|
601
|
+
return ProductCategory2;
|
|
602
|
+
})(ProductCategory || {});
|
|
603
|
+
var ProductStatus = /* @__PURE__ */ ((ProductStatus2) => {
|
|
604
|
+
ProductStatus2["DEVELOPMENT"] = "development";
|
|
605
|
+
ProductStatus2["ALPHA"] = "alpha";
|
|
606
|
+
ProductStatus2["BETA"] = "beta";
|
|
607
|
+
ProductStatus2["GA"] = "ga";
|
|
608
|
+
ProductStatus2["DEPRECATED"] = "deprecated";
|
|
609
|
+
ProductStatus2["EOL"] = "eol";
|
|
610
|
+
return ProductStatus2;
|
|
611
|
+
})(ProductStatus || {});
|
|
612
|
+
var VORION_PRODUCTS = {
|
|
613
|
+
basis: {
|
|
614
|
+
id: "basis",
|
|
615
|
+
name: "BASIS",
|
|
616
|
+
description: "Blockchain Agent Safety & Identity Standard - Open framework for AI agent governance",
|
|
617
|
+
category: "open_source" /* OPEN_SOURCE */,
|
|
618
|
+
status: "ga" /* GA */,
|
|
619
|
+
url: "https://basis.vorion.org",
|
|
620
|
+
docsUrl: "https://basis.vorion.org/docs",
|
|
621
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/packages/basis",
|
|
622
|
+
npmPackage: "@vorionsys/basis",
|
|
623
|
+
organization: "vorion",
|
|
624
|
+
version: "1.0.0"
|
|
625
|
+
},
|
|
626
|
+
carId: {
|
|
627
|
+
id: "car-id",
|
|
628
|
+
name: "CAR ID",
|
|
629
|
+
description: "Categorical Agent Registry - Universal agent identification system",
|
|
630
|
+
category: "open_source" /* OPEN_SOURCE */,
|
|
631
|
+
status: "ga" /* GA */,
|
|
632
|
+
url: "https://carid.vorion.org",
|
|
633
|
+
docsUrl: "https://carid.vorion.org/docs",
|
|
634
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/packages/car-spec",
|
|
635
|
+
npmPackage: "@vorionsys/car-spec",
|
|
636
|
+
organization: "vorion",
|
|
637
|
+
version: "1.0.0"
|
|
638
|
+
},
|
|
639
|
+
atsf: {
|
|
640
|
+
id: "atsf",
|
|
641
|
+
name: "ATSF",
|
|
642
|
+
description: "Agent Trust & Safety Framework - Comprehensive safety evaluation system",
|
|
643
|
+
category: "open_source" /* OPEN_SOURCE */,
|
|
644
|
+
status: "beta" /* BETA */,
|
|
645
|
+
url: "https://atsf.vorion.org",
|
|
646
|
+
docsUrl: "https://atsf.vorion.org/docs",
|
|
647
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/packages/atsf-core",
|
|
648
|
+
npmPackage: "@vorionsys/atsf-core",
|
|
649
|
+
organization: "vorion",
|
|
650
|
+
version: "0.9.0"
|
|
651
|
+
},
|
|
652
|
+
kaizen: {
|
|
653
|
+
id: "kaizen",
|
|
654
|
+
name: "Kaizen",
|
|
655
|
+
description: "Interactive AI Learning Experience - Educational platform for agentic AI",
|
|
656
|
+
category: "education" /* EDUCATION */,
|
|
657
|
+
status: "beta" /* BETA */,
|
|
658
|
+
url: "https://learn.vorion.org",
|
|
659
|
+
docsUrl: "https://learn.vorion.org/docs",
|
|
660
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/kaizen",
|
|
661
|
+
organization: "vorion"
|
|
662
|
+
},
|
|
663
|
+
kaizenStudio: {
|
|
664
|
+
id: "kaizen-studio",
|
|
665
|
+
name: "Kaizen Studio",
|
|
666
|
+
description: "Interactive AI learning studio - hands-on agentic AI experiments",
|
|
667
|
+
category: "education" /* EDUCATION */,
|
|
668
|
+
status: "beta" /* BETA */,
|
|
669
|
+
url: "https://kaizen.vorion.org",
|
|
670
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/kaizen",
|
|
671
|
+
organization: "vorion"
|
|
672
|
+
},
|
|
673
|
+
proofPlane: {
|
|
674
|
+
id: "proof-plane",
|
|
675
|
+
name: "Proof Plane",
|
|
676
|
+
description: "Cryptographic proof layer for agent attestations and verifiable execution",
|
|
677
|
+
category: "open_source" /* OPEN_SOURCE */,
|
|
678
|
+
status: "beta" /* BETA */,
|
|
679
|
+
url: "https://vorion.org/proof-plane",
|
|
680
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/packages/proof-plane",
|
|
681
|
+
npmPackage: "@vorionsys/proof-plane",
|
|
682
|
+
organization: "vorion",
|
|
683
|
+
version: "0.5.0"
|
|
684
|
+
},
|
|
685
|
+
contracts: {
|
|
686
|
+
id: "contracts",
|
|
687
|
+
name: "Vorion Contracts",
|
|
688
|
+
description: "Smart contracts for on-chain agent governance and attestations",
|
|
689
|
+
category: "open_source" /* OPEN_SOURCE */,
|
|
690
|
+
status: "beta" /* BETA */,
|
|
691
|
+
url: "https://vorion.org/contracts",
|
|
692
|
+
repoUrl: "https://github.com/voriongit/vorion/tree/master/packages/contracts",
|
|
693
|
+
npmPackage: "@vorionsys/contracts",
|
|
694
|
+
organization: "vorion"
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
var AGENTANCHOR_PRODUCTS = {
|
|
698
|
+
cognigate: {
|
|
699
|
+
id: "cognigate",
|
|
700
|
+
name: "Cognigate",
|
|
701
|
+
description: "AI Governance API - Reference implementation of BASIS runtime",
|
|
702
|
+
category: "commercial" /* COMMERCIAL */,
|
|
703
|
+
status: "ga" /* GA */,
|
|
704
|
+
url: "https://cognigate.dev",
|
|
705
|
+
docsUrl: "https://cognigate.dev/docs",
|
|
706
|
+
npmPackage: "@vorionsys/cognigate",
|
|
707
|
+
organization: "agentanchor",
|
|
708
|
+
version: "1.0.0"
|
|
709
|
+
},
|
|
710
|
+
trust: {
|
|
711
|
+
id: "trust",
|
|
712
|
+
name: "Agent Anchor Trust",
|
|
713
|
+
description: "Trust verification and certification platform for AI agents",
|
|
714
|
+
category: "commercial" /* COMMERCIAL */,
|
|
715
|
+
status: "ga" /* GA */,
|
|
716
|
+
url: "https://trust.agentanchorai.com",
|
|
717
|
+
docsUrl: "https://trust.agentanchorai.com/docs",
|
|
718
|
+
organization: "agentanchor"
|
|
719
|
+
},
|
|
720
|
+
logic: {
|
|
721
|
+
id: "logic",
|
|
722
|
+
name: "Agent Anchor Logic",
|
|
723
|
+
description: "Policy engine and governance logic for enterprise AI",
|
|
724
|
+
category: "commercial" /* COMMERCIAL */,
|
|
725
|
+
status: "beta" /* BETA */,
|
|
726
|
+
url: "https://logic.agentanchorai.com",
|
|
727
|
+
docsUrl: "https://logic.agentanchorai.com/docs",
|
|
728
|
+
organization: "agentanchor"
|
|
729
|
+
},
|
|
730
|
+
platform: {
|
|
731
|
+
id: "platform",
|
|
732
|
+
name: "Agent Anchor Platform",
|
|
733
|
+
description: "Enterprise AI governance dashboard and management console",
|
|
734
|
+
category: "commercial" /* COMMERCIAL */,
|
|
735
|
+
status: "ga" /* GA */,
|
|
736
|
+
url: "https://agentanchorai.com",
|
|
737
|
+
docsUrl: "https://agentanchorai.com/docs",
|
|
738
|
+
organization: "agentanchor"
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
var ALL_PRODUCTS = {
|
|
742
|
+
vorion: VORION_PRODUCTS,
|
|
743
|
+
agentAnchor: AGENTANCHOR_PRODUCTS
|
|
744
|
+
};
|
|
745
|
+
function getProduct(productId) {
|
|
746
|
+
return VORION_PRODUCTS[productId] || AGENTANCHOR_PRODUCTS[productId];
|
|
747
|
+
}
|
|
748
|
+
function getProductsByCategory(category) {
|
|
749
|
+
const allProducts = [...Object.values(VORION_PRODUCTS), ...Object.values(AGENTANCHOR_PRODUCTS)];
|
|
750
|
+
return allProducts.filter((p) => p.category === category);
|
|
751
|
+
}
|
|
752
|
+
function getProductsByStatus(status) {
|
|
753
|
+
const allProducts = [...Object.values(VORION_PRODUCTS), ...Object.values(AGENTANCHOR_PRODUCTS)];
|
|
754
|
+
return allProducts.filter((p) => p.status === status);
|
|
755
|
+
}
|
|
756
|
+
function getProductsByOrganization(org) {
|
|
757
|
+
return org === "vorion" ? Object.values(VORION_PRODUCTS) : Object.values(AGENTANCHOR_PRODUCTS);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// src/rate-limits.ts
|
|
761
|
+
var RATE_LIMITS = {
|
|
762
|
+
[0 /* T0_SANDBOX */]: {
|
|
763
|
+
requestsPerSecond: 1,
|
|
764
|
+
requestsPerMinute: 10,
|
|
765
|
+
requestsPerHour: 100,
|
|
766
|
+
requestsPerDay: 500,
|
|
767
|
+
burstLimit: 2,
|
|
768
|
+
maxPayloadBytes: 1024 * 10,
|
|
769
|
+
// 10 KB
|
|
770
|
+
maxResponseBytes: 1024 * 100,
|
|
771
|
+
// 100 KB
|
|
772
|
+
connectionTimeoutMs: 5e3,
|
|
773
|
+
requestTimeoutMs: 1e4
|
|
774
|
+
},
|
|
775
|
+
[1 /* T1_OBSERVED */]: {
|
|
776
|
+
requestsPerSecond: 2,
|
|
777
|
+
requestsPerMinute: 30,
|
|
778
|
+
requestsPerHour: 500,
|
|
779
|
+
requestsPerDay: 2e3,
|
|
780
|
+
burstLimit: 5,
|
|
781
|
+
maxPayloadBytes: 1024 * 50,
|
|
782
|
+
// 50 KB
|
|
783
|
+
maxResponseBytes: 1024 * 500,
|
|
784
|
+
// 500 KB
|
|
785
|
+
connectionTimeoutMs: 5e3,
|
|
786
|
+
requestTimeoutMs: 15e3
|
|
787
|
+
},
|
|
788
|
+
[2 /* T2_PROVISIONAL */]: {
|
|
789
|
+
requestsPerSecond: 5,
|
|
790
|
+
requestsPerMinute: 100,
|
|
791
|
+
requestsPerHour: 2e3,
|
|
792
|
+
requestsPerDay: 1e4,
|
|
793
|
+
burstLimit: 10,
|
|
794
|
+
maxPayloadBytes: 1024 * 100,
|
|
795
|
+
// 100 KB
|
|
796
|
+
maxResponseBytes: 1024 * 1024,
|
|
797
|
+
// 1 MB
|
|
798
|
+
connectionTimeoutMs: 1e4,
|
|
799
|
+
requestTimeoutMs: 3e4
|
|
800
|
+
},
|
|
801
|
+
[3 /* T3_MONITORED */]: {
|
|
802
|
+
requestsPerSecond: 10,
|
|
803
|
+
requestsPerMinute: 300,
|
|
804
|
+
requestsPerHour: 5e3,
|
|
805
|
+
requestsPerDay: 5e4,
|
|
806
|
+
burstLimit: 20,
|
|
807
|
+
maxPayloadBytes: 1024 * 500,
|
|
808
|
+
// 500 KB
|
|
809
|
+
maxResponseBytes: 1024 * 1024 * 5,
|
|
810
|
+
// 5 MB
|
|
811
|
+
connectionTimeoutMs: 1e4,
|
|
812
|
+
requestTimeoutMs: 6e4
|
|
813
|
+
},
|
|
814
|
+
[4 /* T4_STANDARD */]: {
|
|
815
|
+
requestsPerSecond: 20,
|
|
816
|
+
requestsPerMinute: 600,
|
|
817
|
+
requestsPerHour: 1e4,
|
|
818
|
+
requestsPerDay: 1e5,
|
|
819
|
+
burstLimit: 50,
|
|
820
|
+
maxPayloadBytes: 1024 * 1024,
|
|
821
|
+
// 1 MB
|
|
822
|
+
maxResponseBytes: 1024 * 1024 * 10,
|
|
823
|
+
// 10 MB
|
|
824
|
+
connectionTimeoutMs: 15e3,
|
|
825
|
+
requestTimeoutMs: 12e4
|
|
826
|
+
},
|
|
827
|
+
[5 /* T5_TRUSTED */]: {
|
|
828
|
+
requestsPerSecond: 50,
|
|
829
|
+
requestsPerMinute: 1500,
|
|
830
|
+
requestsPerHour: 3e4,
|
|
831
|
+
requestsPerDay: 3e5,
|
|
832
|
+
burstLimit: 100,
|
|
833
|
+
maxPayloadBytes: 1024 * 1024 * 5,
|
|
834
|
+
// 5 MB
|
|
835
|
+
maxResponseBytes: 1024 * 1024 * 50,
|
|
836
|
+
// 50 MB
|
|
837
|
+
connectionTimeoutMs: 3e4,
|
|
838
|
+
requestTimeoutMs: 3e5
|
|
839
|
+
},
|
|
840
|
+
[6 /* T6_CERTIFIED */]: {
|
|
841
|
+
requestsPerSecond: 100,
|
|
842
|
+
requestsPerMinute: 3e3,
|
|
843
|
+
requestsPerHour: 1e5,
|
|
844
|
+
requestsPerDay: 1e6,
|
|
845
|
+
burstLimit: 200,
|
|
846
|
+
maxPayloadBytes: 1024 * 1024 * 10,
|
|
847
|
+
// 10 MB
|
|
848
|
+
maxResponseBytes: 1024 * 1024 * 100,
|
|
849
|
+
// 100 MB
|
|
850
|
+
connectionTimeoutMs: 6e4,
|
|
851
|
+
requestTimeoutMs: 6e5
|
|
852
|
+
},
|
|
853
|
+
[7 /* T7_AUTONOMOUS */]: {
|
|
854
|
+
requestsPerSecond: 500,
|
|
855
|
+
requestsPerMinute: 1e4,
|
|
856
|
+
requestsPerHour: 5e5,
|
|
857
|
+
requestsPerDay: 5e6,
|
|
858
|
+
burstLimit: 500,
|
|
859
|
+
maxPayloadBytes: 1024 * 1024 * 50,
|
|
860
|
+
// 50 MB
|
|
861
|
+
maxResponseBytes: 1024 * 1024 * 500,
|
|
862
|
+
// 500 MB
|
|
863
|
+
connectionTimeoutMs: 12e4,
|
|
864
|
+
requestTimeoutMs: 12e5
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
function getRateLimits(tier) {
|
|
868
|
+
return RATE_LIMITS[tier];
|
|
869
|
+
}
|
|
870
|
+
function getMinTierForLimits(config) {
|
|
871
|
+
const tiers = Object.values(TrustTier).filter((t) => typeof t === "number");
|
|
872
|
+
for (const tier of tiers) {
|
|
873
|
+
const limits = RATE_LIMITS[tier];
|
|
874
|
+
if ((config.requestsPerSecond === void 0 || limits.requestsPerSecond >= config.requestsPerSecond) && (config.requestsPerMinute === void 0 || limits.requestsPerMinute >= config.requestsPerMinute) && (config.requestsPerHour === void 0 || limits.requestsPerHour >= config.requestsPerHour) && (config.requestsPerDay === void 0 || limits.requestsPerDay >= config.requestsPerDay)) {
|
|
875
|
+
return tier;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return 7 /* T7_AUTONOMOUS */;
|
|
879
|
+
}
|
|
880
|
+
function wouldExceedLimit(tier, window, currentCount) {
|
|
881
|
+
const limits = RATE_LIMITS[tier];
|
|
882
|
+
switch (window) {
|
|
883
|
+
case "second":
|
|
884
|
+
return currentCount >= limits.requestsPerSecond;
|
|
885
|
+
case "minute":
|
|
886
|
+
return currentCount >= limits.requestsPerMinute;
|
|
887
|
+
case "hour":
|
|
888
|
+
return currentCount >= limits.requestsPerHour;
|
|
889
|
+
case "day":
|
|
890
|
+
return currentCount >= limits.requestsPerDay;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
function formatRateLimit(tier) {
|
|
894
|
+
const limits = RATE_LIMITS[tier];
|
|
895
|
+
return `${limits.requestsPerSecond}/s, ${limits.requestsPerMinute}/min, ${limits.requestsPerHour}/hr`;
|
|
896
|
+
}
|
|
897
|
+
var TIER_QUOTAS = {
|
|
898
|
+
[0 /* T0_SANDBOX */]: {
|
|
899
|
+
monthlyApiCalls: 1e3,
|
|
900
|
+
monthlyComputeUnits: 100,
|
|
901
|
+
monthlyStorageBytes: 1024 * 1024 * 10,
|
|
902
|
+
// 10 MB
|
|
903
|
+
monthlyBandwidthBytes: 1024 * 1024 * 100,
|
|
904
|
+
// 100 MB
|
|
905
|
+
maxAgents: 1,
|
|
906
|
+
maxWebhooks: 1,
|
|
907
|
+
maxTeamMembers: 1
|
|
908
|
+
},
|
|
909
|
+
[1 /* T1_OBSERVED */]: {
|
|
910
|
+
monthlyApiCalls: 1e4,
|
|
911
|
+
monthlyComputeUnits: 1e3,
|
|
912
|
+
monthlyStorageBytes: 1024 * 1024 * 100,
|
|
913
|
+
// 100 MB
|
|
914
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024,
|
|
915
|
+
// 1 GB
|
|
916
|
+
maxAgents: 5,
|
|
917
|
+
maxWebhooks: 5,
|
|
918
|
+
maxTeamMembers: 3
|
|
919
|
+
},
|
|
920
|
+
[2 /* T2_PROVISIONAL */]: {
|
|
921
|
+
monthlyApiCalls: 5e4,
|
|
922
|
+
monthlyComputeUnits: 5e3,
|
|
923
|
+
monthlyStorageBytes: 1024 * 1024 * 500,
|
|
924
|
+
// 500 MB
|
|
925
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 5,
|
|
926
|
+
// 5 GB
|
|
927
|
+
maxAgents: 10,
|
|
928
|
+
maxWebhooks: 10,
|
|
929
|
+
maxTeamMembers: 5
|
|
930
|
+
},
|
|
931
|
+
[3 /* T3_MONITORED */]: {
|
|
932
|
+
monthlyApiCalls: 25e4,
|
|
933
|
+
monthlyComputeUnits: 25e3,
|
|
934
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 2,
|
|
935
|
+
// 2 GB
|
|
936
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 25,
|
|
937
|
+
// 25 GB
|
|
938
|
+
maxAgents: 50,
|
|
939
|
+
maxWebhooks: 25,
|
|
940
|
+
maxTeamMembers: 10
|
|
941
|
+
},
|
|
942
|
+
[4 /* T4_STANDARD */]: {
|
|
943
|
+
monthlyApiCalls: 1e6,
|
|
944
|
+
monthlyComputeUnits: 1e5,
|
|
945
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 10,
|
|
946
|
+
// 10 GB
|
|
947
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 100,
|
|
948
|
+
// 100 GB
|
|
949
|
+
maxAgents: 200,
|
|
950
|
+
maxWebhooks: 50,
|
|
951
|
+
maxTeamMembers: 25
|
|
952
|
+
},
|
|
953
|
+
[5 /* T5_TRUSTED */]: {
|
|
954
|
+
monthlyApiCalls: 5e6,
|
|
955
|
+
monthlyComputeUnits: 5e5,
|
|
956
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 50,
|
|
957
|
+
// 50 GB
|
|
958
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 500,
|
|
959
|
+
// 500 GB
|
|
960
|
+
maxAgents: 1e3,
|
|
961
|
+
maxWebhooks: 100,
|
|
962
|
+
maxTeamMembers: 50
|
|
963
|
+
},
|
|
964
|
+
[6 /* T6_CERTIFIED */]: {
|
|
965
|
+
monthlyApiCalls: 25e6,
|
|
966
|
+
monthlyComputeUnits: 25e5,
|
|
967
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 250,
|
|
968
|
+
// 250 GB
|
|
969
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 2500,
|
|
970
|
+
// 2.5 TB
|
|
971
|
+
maxAgents: 5e3,
|
|
972
|
+
maxWebhooks: 250,
|
|
973
|
+
maxTeamMembers: 100
|
|
974
|
+
},
|
|
975
|
+
[7 /* T7_AUTONOMOUS */]: {
|
|
976
|
+
monthlyApiCalls: -1,
|
|
977
|
+
// Unlimited
|
|
978
|
+
monthlyComputeUnits: -1,
|
|
979
|
+
// Unlimited
|
|
980
|
+
monthlyStorageBytes: 1024 * 1024 * 1024 * 1024,
|
|
981
|
+
// 1 TB
|
|
982
|
+
monthlyBandwidthBytes: 1024 * 1024 * 1024 * 1e4,
|
|
983
|
+
// 10 TB
|
|
984
|
+
maxAgents: -1,
|
|
985
|
+
// Unlimited
|
|
986
|
+
maxWebhooks: -1,
|
|
987
|
+
// Unlimited
|
|
988
|
+
maxTeamMembers: -1
|
|
989
|
+
// Unlimited
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
function getQuota(tier) {
|
|
993
|
+
return TIER_QUOTAS[tier];
|
|
994
|
+
}
|
|
995
|
+
function isUnlimited(value) {
|
|
996
|
+
return value === -1;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// src/error-codes.ts
|
|
1000
|
+
var ErrorCategory = /* @__PURE__ */ ((ErrorCategory2) => {
|
|
1001
|
+
ErrorCategory2["AUTH"] = "auth";
|
|
1002
|
+
ErrorCategory2["VALIDATION"] = "validation";
|
|
1003
|
+
ErrorCategory2["RATE_LIMIT"] = "rate_limit";
|
|
1004
|
+
ErrorCategory2["NOT_FOUND"] = "not_found";
|
|
1005
|
+
ErrorCategory2["TRUST"] = "trust";
|
|
1006
|
+
ErrorCategory2["SERVER"] = "server";
|
|
1007
|
+
ErrorCategory2["EXTERNAL"] = "external";
|
|
1008
|
+
ErrorCategory2["CONFIG"] = "config";
|
|
1009
|
+
return ErrorCategory2;
|
|
1010
|
+
})(ErrorCategory || {});
|
|
1011
|
+
var AUTH_ERRORS = {
|
|
1012
|
+
MISSING_API_KEY: {
|
|
1013
|
+
code: "E1001",
|
|
1014
|
+
httpStatus: 401,
|
|
1015
|
+
category: "auth" /* AUTH */,
|
|
1016
|
+
message: "API key is missing. Include it in the Authorization header.",
|
|
1017
|
+
retryable: false,
|
|
1018
|
+
docsUrl: "https://cognigate.dev/docs/authentication"
|
|
1019
|
+
},
|
|
1020
|
+
INVALID_API_KEY: {
|
|
1021
|
+
code: "E1002",
|
|
1022
|
+
httpStatus: 401,
|
|
1023
|
+
category: "auth" /* AUTH */,
|
|
1024
|
+
message: "API key is invalid or has been revoked.",
|
|
1025
|
+
retryable: false,
|
|
1026
|
+
docsUrl: "https://cognigate.dev/docs/authentication"
|
|
1027
|
+
},
|
|
1028
|
+
EXPIRED_API_KEY: {
|
|
1029
|
+
code: "E1003",
|
|
1030
|
+
httpStatus: 401,
|
|
1031
|
+
category: "auth" /* AUTH */,
|
|
1032
|
+
message: "API key has expired. Generate a new key.",
|
|
1033
|
+
retryable: false,
|
|
1034
|
+
docsUrl: "https://cognigate.dev/docs/authentication"
|
|
1035
|
+
},
|
|
1036
|
+
INSUFFICIENT_PERMISSIONS: {
|
|
1037
|
+
code: "E1004",
|
|
1038
|
+
httpStatus: 403,
|
|
1039
|
+
category: "auth" /* AUTH */,
|
|
1040
|
+
message: "Insufficient permissions for this operation.",
|
|
1041
|
+
retryable: false
|
|
1042
|
+
},
|
|
1043
|
+
AGENT_NOT_AUTHORIZED: {
|
|
1044
|
+
code: "E1005",
|
|
1045
|
+
httpStatus: 403,
|
|
1046
|
+
category: "auth" /* AUTH */,
|
|
1047
|
+
message: "Agent is not authorized for this action.",
|
|
1048
|
+
retryable: false
|
|
1049
|
+
},
|
|
1050
|
+
TOKEN_EXPIRED: {
|
|
1051
|
+
code: "E1006",
|
|
1052
|
+
httpStatus: 401,
|
|
1053
|
+
category: "auth" /* AUTH */,
|
|
1054
|
+
message: "Authentication token has expired.",
|
|
1055
|
+
retryable: false
|
|
1056
|
+
},
|
|
1057
|
+
MFA_REQUIRED: {
|
|
1058
|
+
code: "E1007",
|
|
1059
|
+
httpStatus: 403,
|
|
1060
|
+
category: "auth" /* AUTH */,
|
|
1061
|
+
message: "Multi-factor authentication is required for this operation.",
|
|
1062
|
+
retryable: false
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1065
|
+
var VALIDATION_ERRORS = {
|
|
1066
|
+
INVALID_REQUEST: {
|
|
1067
|
+
code: "E2001",
|
|
1068
|
+
httpStatus: 400,
|
|
1069
|
+
category: "validation" /* VALIDATION */,
|
|
1070
|
+
message: "Request body is invalid or malformed.",
|
|
1071
|
+
retryable: false
|
|
1072
|
+
},
|
|
1073
|
+
MISSING_REQUIRED_FIELD: {
|
|
1074
|
+
code: "E2002",
|
|
1075
|
+
httpStatus: 400,
|
|
1076
|
+
category: "validation" /* VALIDATION */,
|
|
1077
|
+
message: "Required field is missing: {field}",
|
|
1078
|
+
retryable: false
|
|
1079
|
+
},
|
|
1080
|
+
INVALID_FIELD_TYPE: {
|
|
1081
|
+
code: "E2003",
|
|
1082
|
+
httpStatus: 400,
|
|
1083
|
+
category: "validation" /* VALIDATION */,
|
|
1084
|
+
message: "Field {field} has invalid type. Expected {expected}.",
|
|
1085
|
+
retryable: false
|
|
1086
|
+
},
|
|
1087
|
+
INVALID_FIELD_VALUE: {
|
|
1088
|
+
code: "E2004",
|
|
1089
|
+
httpStatus: 400,
|
|
1090
|
+
category: "validation" /* VALIDATION */,
|
|
1091
|
+
message: "Field {field} has invalid value.",
|
|
1092
|
+
retryable: false
|
|
1093
|
+
},
|
|
1094
|
+
PAYLOAD_TOO_LARGE: {
|
|
1095
|
+
code: "E2005",
|
|
1096
|
+
httpStatus: 413,
|
|
1097
|
+
category: "validation" /* VALIDATION */,
|
|
1098
|
+
message: "Request payload exceeds maximum size of {maxSize}.",
|
|
1099
|
+
retryable: false
|
|
1100
|
+
},
|
|
1101
|
+
INVALID_JSON: {
|
|
1102
|
+
code: "E2006",
|
|
1103
|
+
httpStatus: 400,
|
|
1104
|
+
category: "validation" /* VALIDATION */,
|
|
1105
|
+
message: "Request body is not valid JSON.",
|
|
1106
|
+
retryable: false
|
|
1107
|
+
},
|
|
1108
|
+
INVALID_CAR_ID: {
|
|
1109
|
+
code: "E2007",
|
|
1110
|
+
httpStatus: 400,
|
|
1111
|
+
category: "validation" /* VALIDATION */,
|
|
1112
|
+
message: "Invalid CAR ID format. Expected: car:domain/category/name:version",
|
|
1113
|
+
retryable: false,
|
|
1114
|
+
docsUrl: "https://carid.vorion.org/format"
|
|
1115
|
+
},
|
|
1116
|
+
INVALID_TRUST_SCORE: {
|
|
1117
|
+
code: "E2008",
|
|
1118
|
+
httpStatus: 400,
|
|
1119
|
+
category: "validation" /* VALIDATION */,
|
|
1120
|
+
message: "Trust score must be between 0 and 1000.",
|
|
1121
|
+
retryable: false
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
var RATE_LIMIT_ERRORS = {
|
|
1125
|
+
RATE_LIMIT_EXCEEDED: {
|
|
1126
|
+
code: "E3001",
|
|
1127
|
+
httpStatus: 429,
|
|
1128
|
+
category: "rate_limit" /* RATE_LIMIT */,
|
|
1129
|
+
message: "Rate limit exceeded. Retry after {retryAfter} seconds.",
|
|
1130
|
+
retryable: true
|
|
1131
|
+
},
|
|
1132
|
+
QUOTA_EXCEEDED: {
|
|
1133
|
+
code: "E3002",
|
|
1134
|
+
httpStatus: 429,
|
|
1135
|
+
category: "rate_limit" /* RATE_LIMIT */,
|
|
1136
|
+
message: "Monthly quota exceeded. Upgrade your tier or wait for reset.",
|
|
1137
|
+
retryable: false
|
|
1138
|
+
},
|
|
1139
|
+
CONCURRENT_LIMIT: {
|
|
1140
|
+
code: "E3003",
|
|
1141
|
+
httpStatus: 429,
|
|
1142
|
+
category: "rate_limit" /* RATE_LIMIT */,
|
|
1143
|
+
message: "Too many concurrent requests. Max burst: {burstLimit}.",
|
|
1144
|
+
retryable: true
|
|
1145
|
+
},
|
|
1146
|
+
DAILY_LIMIT_EXCEEDED: {
|
|
1147
|
+
code: "E3004",
|
|
1148
|
+
httpStatus: 429,
|
|
1149
|
+
category: "rate_limit" /* RATE_LIMIT */,
|
|
1150
|
+
message: "Daily request limit exceeded. Resets at midnight UTC.",
|
|
1151
|
+
retryable: true
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
var NOT_FOUND_ERRORS = {
|
|
1155
|
+
RESOURCE_NOT_FOUND: {
|
|
1156
|
+
code: "E4001",
|
|
1157
|
+
httpStatus: 404,
|
|
1158
|
+
category: "not_found" /* NOT_FOUND */,
|
|
1159
|
+
message: "Resource not found: {resourceType}/{resourceId}",
|
|
1160
|
+
retryable: false
|
|
1161
|
+
},
|
|
1162
|
+
AGENT_NOT_FOUND: {
|
|
1163
|
+
code: "E4002",
|
|
1164
|
+
httpStatus: 404,
|
|
1165
|
+
category: "not_found" /* NOT_FOUND */,
|
|
1166
|
+
message: "Agent not found: {agentId}",
|
|
1167
|
+
retryable: false
|
|
1168
|
+
},
|
|
1169
|
+
PROOF_NOT_FOUND: {
|
|
1170
|
+
code: "E4003",
|
|
1171
|
+
httpStatus: 404,
|
|
1172
|
+
category: "not_found" /* NOT_FOUND */,
|
|
1173
|
+
message: "Proof not found: {proofId}",
|
|
1174
|
+
retryable: false
|
|
1175
|
+
},
|
|
1176
|
+
ENDPOINT_NOT_FOUND: {
|
|
1177
|
+
code: "E4004",
|
|
1178
|
+
httpStatus: 404,
|
|
1179
|
+
category: "not_found" /* NOT_FOUND */,
|
|
1180
|
+
message: "API endpoint not found.",
|
|
1181
|
+
retryable: false
|
|
1182
|
+
},
|
|
1183
|
+
ATTESTATION_NOT_FOUND: {
|
|
1184
|
+
code: "E4005",
|
|
1185
|
+
httpStatus: 404,
|
|
1186
|
+
category: "not_found" /* NOT_FOUND */,
|
|
1187
|
+
message: "Attestation not found: {attestationId}",
|
|
1188
|
+
retryable: false
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
var TRUST_ERRORS = {
|
|
1192
|
+
TRUST_TIER_INSUFFICIENT: {
|
|
1193
|
+
code: "E5001",
|
|
1194
|
+
httpStatus: 403,
|
|
1195
|
+
category: "trust" /* TRUST */,
|
|
1196
|
+
message: "Trust tier {currentTier} insufficient. Required: {requiredTier}.",
|
|
1197
|
+
retryable: false,
|
|
1198
|
+
docsUrl: "https://basis.vorion.org/tiers"
|
|
1199
|
+
},
|
|
1200
|
+
CAPABILITY_NOT_AVAILABLE: {
|
|
1201
|
+
code: "E5002",
|
|
1202
|
+
httpStatus: 403,
|
|
1203
|
+
category: "trust" /* TRUST */,
|
|
1204
|
+
message: "Capability {capability} not available at tier {tier}.",
|
|
1205
|
+
retryable: false,
|
|
1206
|
+
docsUrl: "https://cognigate.dev/docs/capabilities"
|
|
1207
|
+
},
|
|
1208
|
+
GOVERNANCE_DENIED: {
|
|
1209
|
+
code: "E5003",
|
|
1210
|
+
httpStatus: 403,
|
|
1211
|
+
category: "trust" /* TRUST */,
|
|
1212
|
+
message: "Action denied by governance policy: {reason}.",
|
|
1213
|
+
retryable: false
|
|
1214
|
+
},
|
|
1215
|
+
AGENT_SUSPENDED: {
|
|
1216
|
+
code: "E5004",
|
|
1217
|
+
httpStatus: 403,
|
|
1218
|
+
category: "trust" /* TRUST */,
|
|
1219
|
+
message: "Agent is suspended. Contact support for reinstatement.",
|
|
1220
|
+
retryable: false
|
|
1221
|
+
},
|
|
1222
|
+
PROOF_VERIFICATION_FAILED: {
|
|
1223
|
+
code: "E5005",
|
|
1224
|
+
httpStatus: 400,
|
|
1225
|
+
category: "trust" /* TRUST */,
|
|
1226
|
+
message: "Proof verification failed: {reason}.",
|
|
1227
|
+
retryable: false
|
|
1228
|
+
},
|
|
1229
|
+
ATTESTATION_INVALID: {
|
|
1230
|
+
code: "E5006",
|
|
1231
|
+
httpStatus: 400,
|
|
1232
|
+
category: "trust" /* TRUST */,
|
|
1233
|
+
message: "Attestation is invalid or has expired.",
|
|
1234
|
+
retryable: false
|
|
1235
|
+
},
|
|
1236
|
+
ESCALATION_REQUIRED: {
|
|
1237
|
+
code: "E5007",
|
|
1238
|
+
httpStatus: 403,
|
|
1239
|
+
category: "trust" /* TRUST */,
|
|
1240
|
+
message: "Action requires human approval. Escalation ID: {escalationId}.",
|
|
1241
|
+
retryable: false
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
var SERVER_ERRORS = {
|
|
1245
|
+
INTERNAL_ERROR: {
|
|
1246
|
+
code: "E6001",
|
|
1247
|
+
httpStatus: 500,
|
|
1248
|
+
category: "server" /* SERVER */,
|
|
1249
|
+
message: "An internal error occurred. Please try again later.",
|
|
1250
|
+
retryable: true
|
|
1251
|
+
},
|
|
1252
|
+
SERVICE_UNAVAILABLE: {
|
|
1253
|
+
code: "E6002",
|
|
1254
|
+
httpStatus: 503,
|
|
1255
|
+
category: "server" /* SERVER */,
|
|
1256
|
+
message: "Service is temporarily unavailable. Please try again later.",
|
|
1257
|
+
retryable: true
|
|
1258
|
+
},
|
|
1259
|
+
DATABASE_ERROR: {
|
|
1260
|
+
code: "E6003",
|
|
1261
|
+
httpStatus: 500,
|
|
1262
|
+
category: "server" /* SERVER */,
|
|
1263
|
+
message: "Database operation failed. Please try again later.",
|
|
1264
|
+
retryable: true
|
|
1265
|
+
},
|
|
1266
|
+
MAINTENANCE_MODE: {
|
|
1267
|
+
code: "E6004",
|
|
1268
|
+
httpStatus: 503,
|
|
1269
|
+
category: "server" /* SERVER */,
|
|
1270
|
+
message: "Service is under maintenance. Expected completion: {eta}.",
|
|
1271
|
+
retryable: true
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
var EXTERNAL_ERRORS = {
|
|
1275
|
+
BLOCKCHAIN_ERROR: {
|
|
1276
|
+
code: "E7001",
|
|
1277
|
+
httpStatus: 502,
|
|
1278
|
+
category: "external" /* EXTERNAL */,
|
|
1279
|
+
message: "Blockchain network error. Please try again later.",
|
|
1280
|
+
retryable: true
|
|
1281
|
+
},
|
|
1282
|
+
UPSTREAM_TIMEOUT: {
|
|
1283
|
+
code: "E7002",
|
|
1284
|
+
httpStatus: 504,
|
|
1285
|
+
category: "external" /* EXTERNAL */,
|
|
1286
|
+
message: "Upstream service timed out.",
|
|
1287
|
+
retryable: true
|
|
1288
|
+
},
|
|
1289
|
+
EXTERNAL_SERVICE_ERROR: {
|
|
1290
|
+
code: "E7003",
|
|
1291
|
+
httpStatus: 502,
|
|
1292
|
+
category: "external" /* EXTERNAL */,
|
|
1293
|
+
message: "External service error: {service}.",
|
|
1294
|
+
retryable: true
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
var ERROR_CODES = {
|
|
1298
|
+
...AUTH_ERRORS,
|
|
1299
|
+
...VALIDATION_ERRORS,
|
|
1300
|
+
...RATE_LIMIT_ERRORS,
|
|
1301
|
+
...NOT_FOUND_ERRORS,
|
|
1302
|
+
...TRUST_ERRORS,
|
|
1303
|
+
...SERVER_ERRORS,
|
|
1304
|
+
...EXTERNAL_ERRORS
|
|
1305
|
+
};
|
|
1306
|
+
function getErrorByCode(code) {
|
|
1307
|
+
return Object.values(ERROR_CODES).find((e) => e.code === code);
|
|
1308
|
+
}
|
|
1309
|
+
function getErrorsByCategory(category) {
|
|
1310
|
+
return Object.values(ERROR_CODES).filter((e) => e.category === category);
|
|
1311
|
+
}
|
|
1312
|
+
function getRetryableErrors() {
|
|
1313
|
+
return Object.values(ERROR_CODES).filter((e) => e.retryable);
|
|
1314
|
+
}
|
|
1315
|
+
function formatErrorMessage(error, params) {
|
|
1316
|
+
let message = error.message;
|
|
1317
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1318
|
+
message = message.replace(`{${key}}`, String(value));
|
|
1319
|
+
}
|
|
1320
|
+
return message;
|
|
1321
|
+
}
|
|
1322
|
+
function createErrorResponse(error, params, requestId) {
|
|
1323
|
+
return {
|
|
1324
|
+
error: {
|
|
1325
|
+
code: error.code,
|
|
1326
|
+
message: params ? formatErrorMessage(error, params) : error.message,
|
|
1327
|
+
category: error.category,
|
|
1328
|
+
retryable: error.retryable,
|
|
1329
|
+
...error.docsUrl && { docsUrl: error.docsUrl },
|
|
1330
|
+
...requestId && { requestId }
|
|
1331
|
+
},
|
|
1332
|
+
status: error.httpStatus
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// src/api-versions.ts
|
|
1337
|
+
var VersionStatus = /* @__PURE__ */ ((VersionStatus2) => {
|
|
1338
|
+
VersionStatus2["DEVELOPMENT"] = "development";
|
|
1339
|
+
VersionStatus2["PREVIEW"] = "preview";
|
|
1340
|
+
VersionStatus2["STABLE"] = "stable";
|
|
1341
|
+
VersionStatus2["DEPRECATED"] = "deprecated";
|
|
1342
|
+
VersionStatus2["RETIRED"] = "retired";
|
|
1343
|
+
return VersionStatus2;
|
|
1344
|
+
})(VersionStatus || {});
|
|
1345
|
+
var COGNIGATE_VERSIONS = {
|
|
1346
|
+
v1: {
|
|
1347
|
+
version: "v1",
|
|
1348
|
+
fullVersion: "1.0.0",
|
|
1349
|
+
releaseDate: "2026-02-01",
|
|
1350
|
+
status: "stable" /* STABLE */,
|
|
1351
|
+
changelogUrl: "https://cognigate.dev/changelog/v1"
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
var COGNIGATE_CURRENT_VERSION = "v1";
|
|
1355
|
+
var COGNIGATE_DEFAULT_VERSION = "v1";
|
|
1356
|
+
var TRUST_API_VERSIONS = {
|
|
1357
|
+
v1: {
|
|
1358
|
+
version: "v1",
|
|
1359
|
+
fullVersion: "1.0.0",
|
|
1360
|
+
releaseDate: "2026-02-01",
|
|
1361
|
+
status: "stable" /* STABLE */,
|
|
1362
|
+
changelogUrl: "https://trust.agentanchorai.com/changelog/v1"
|
|
1363
|
+
}
|
|
1364
|
+
};
|
|
1365
|
+
var TRUST_CURRENT_VERSION = "v1";
|
|
1366
|
+
var LOGIC_API_VERSIONS = {
|
|
1367
|
+
v1: {
|
|
1368
|
+
version: "v1",
|
|
1369
|
+
fullVersion: "1.0.0",
|
|
1370
|
+
releaseDate: "2026-02-01",
|
|
1371
|
+
status: "preview" /* PREVIEW */,
|
|
1372
|
+
changelogUrl: "https://logic.agentanchorai.com/changelog/v1"
|
|
1373
|
+
}
|
|
1374
|
+
};
|
|
1375
|
+
var LOGIC_CURRENT_VERSION = "v1";
|
|
1376
|
+
var BASIS_VERSIONS = {
|
|
1377
|
+
v1: {
|
|
1378
|
+
version: "v1",
|
|
1379
|
+
fullVersion: "1.0.0",
|
|
1380
|
+
releaseDate: "2026-02-01",
|
|
1381
|
+
status: "stable" /* STABLE */,
|
|
1382
|
+
changelogUrl: "https://basis.vorion.org/changelog"
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
var BASIS_CURRENT_VERSION = "v1";
|
|
1386
|
+
var BASIS_SPEC_VERSION = "1.0.0";
|
|
1387
|
+
var CAR_SPEC_VERSIONS = {
|
|
1388
|
+
v1: {
|
|
1389
|
+
version: "v1",
|
|
1390
|
+
fullVersion: "1.0.0",
|
|
1391
|
+
releaseDate: "2026-02-01",
|
|
1392
|
+
status: "stable" /* STABLE */,
|
|
1393
|
+
changelogUrl: "https://carid.vorion.org/changelog"
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
var CAR_SPEC_CURRENT_VERSION = "v1";
|
|
1397
|
+
var API_VERSIONS = {
|
|
1398
|
+
cognigate: COGNIGATE_VERSIONS,
|
|
1399
|
+
trust: TRUST_API_VERSIONS,
|
|
1400
|
+
logic: LOGIC_API_VERSIONS,
|
|
1401
|
+
basis: BASIS_VERSIONS,
|
|
1402
|
+
carSpec: CAR_SPEC_VERSIONS
|
|
1403
|
+
};
|
|
1404
|
+
function getCurrentVersion(service) {
|
|
1405
|
+
switch (service) {
|
|
1406
|
+
case "cognigate":
|
|
1407
|
+
return COGNIGATE_CURRENT_VERSION;
|
|
1408
|
+
case "trust":
|
|
1409
|
+
return TRUST_CURRENT_VERSION;
|
|
1410
|
+
case "logic":
|
|
1411
|
+
return LOGIC_CURRENT_VERSION;
|
|
1412
|
+
case "basis":
|
|
1413
|
+
return BASIS_CURRENT_VERSION;
|
|
1414
|
+
case "carSpec":
|
|
1415
|
+
return CAR_SPEC_CURRENT_VERSION;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
function getVersionDefinition(service, version) {
|
|
1419
|
+
return API_VERSIONS[service][version];
|
|
1420
|
+
}
|
|
1421
|
+
function isVersionSupported(service, version) {
|
|
1422
|
+
const def = getVersionDefinition(service, version);
|
|
1423
|
+
if (!def) return false;
|
|
1424
|
+
return def.status !== "retired" /* RETIRED */;
|
|
1425
|
+
}
|
|
1426
|
+
function isVersionDeprecated(service, version) {
|
|
1427
|
+
const def = getVersionDefinition(service, version);
|
|
1428
|
+
if (!def) return false;
|
|
1429
|
+
return def.status === "deprecated" /* DEPRECATED */;
|
|
1430
|
+
}
|
|
1431
|
+
function getStableVersions(service) {
|
|
1432
|
+
return Object.values(API_VERSIONS[service]).filter(
|
|
1433
|
+
(v) => v.status === "stable" /* STABLE */
|
|
1434
|
+
);
|
|
1435
|
+
}
|
|
1436
|
+
function buildApiUrl(baseUrl, version, path) {
|
|
1437
|
+
const cleanBase = baseUrl.replace(/\/$/, "");
|
|
1438
|
+
const cleanPath = path.replace(/^\//, "");
|
|
1439
|
+
return `${cleanBase}/${version}/${cleanPath}`;
|
|
1440
|
+
}
|
|
1441
|
+
var VERSION_HEADERS = {
|
|
1442
|
+
/** Header to request specific API version */
|
|
1443
|
+
REQUEST_VERSION: "X-API-Version",
|
|
1444
|
+
/** Header indicating actual API version used */
|
|
1445
|
+
RESPONSE_VERSION: "X-API-Version",
|
|
1446
|
+
/** Header warning about deprecation */
|
|
1447
|
+
DEPRECATION_WARNING: "X-Deprecation-Warning",
|
|
1448
|
+
/** Header with sunset date */
|
|
1449
|
+
SUNSET: "Sunset"
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
// src/themes.ts
|
|
1453
|
+
var ACTIVE_THEME = "midnight_cyan";
|
|
1454
|
+
var THEMES = {
|
|
1455
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1456
|
+
// OPTION 1: MIDNIGHT CYAN — Current look, standardized
|
|
1457
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1458
|
+
midnight_cyan: {
|
|
1459
|
+
name: "Midnight Cyan",
|
|
1460
|
+
description: "Developer-native. Terminal-adjacent. The current look, unified.",
|
|
1461
|
+
bgPrimary: "#0a0a0f",
|
|
1462
|
+
bgSurface: "#111118",
|
|
1463
|
+
bgInput: "#0d0d14",
|
|
1464
|
+
bgNav: "#111118",
|
|
1465
|
+
bgCode: "#0d0d14",
|
|
1466
|
+
accent: "#06b6d4",
|
|
1467
|
+
accentHover: "#22d3ee",
|
|
1468
|
+
accentMuted: "rgba(6, 182, 212, 0.1)",
|
|
1469
|
+
accentSubtle: "rgba(6, 182, 212, 0.03)",
|
|
1470
|
+
textPrimary: "#e0e0e6",
|
|
1471
|
+
textHeading: "#ffffff",
|
|
1472
|
+
textSecondary: "#888888",
|
|
1473
|
+
textTertiary: "#666666",
|
|
1474
|
+
border: "#1e1e2e",
|
|
1475
|
+
borderInput: "#2a2a3a",
|
|
1476
|
+
borderHover: "rgba(6, 182, 212, 0.4)",
|
|
1477
|
+
borderDivider: "rgba(255, 255, 255, 0.05)",
|
|
1478
|
+
gradientFrom: "#06b6d4",
|
|
1479
|
+
gradientTo: "#2dd4bf",
|
|
1480
|
+
scrollTrack: "#0a0a0f",
|
|
1481
|
+
scrollThumb: "#333340",
|
|
1482
|
+
scrollThumbHover: "#06b6d4",
|
|
1483
|
+
selectionBg: "rgba(6, 182, 212, 0.3)",
|
|
1484
|
+
success: "#22c55e",
|
|
1485
|
+
error: "#ef4444",
|
|
1486
|
+
warning: "#f97316",
|
|
1487
|
+
info: "#3b82f6",
|
|
1488
|
+
layerBasis: "#fbbf24",
|
|
1489
|
+
layerIntent: "#60a5fa",
|
|
1490
|
+
layerEnforce: "#818cf8",
|
|
1491
|
+
layerProof: "#34d399",
|
|
1492
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1493
|
+
fontImport: "Inter",
|
|
1494
|
+
cardBlur: false,
|
|
1495
|
+
buttonText: "#000000"
|
|
1496
|
+
},
|
|
1497
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1498
|
+
// OPTION 2: INDIGO AUTHORITY — Governance-forward, institutional
|
|
1499
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1500
|
+
indigo_authority: {
|
|
1501
|
+
name: "Indigo Authority",
|
|
1502
|
+
description: "Institutional. Authoritative. Governance-forward.",
|
|
1503
|
+
bgPrimary: "#07070d",
|
|
1504
|
+
bgSurface: "#12121f",
|
|
1505
|
+
bgInput: "#0c0c18",
|
|
1506
|
+
bgNav: "#12121f",
|
|
1507
|
+
bgCode: "#0c0c18",
|
|
1508
|
+
accent: "#818cf8",
|
|
1509
|
+
accentHover: "#a5b4fc",
|
|
1510
|
+
accentMuted: "rgba(129, 140, 248, 0.1)",
|
|
1511
|
+
accentSubtle: "rgba(129, 140, 248, 0.03)",
|
|
1512
|
+
textPrimary: "#dcdce6",
|
|
1513
|
+
textHeading: "#ffffff",
|
|
1514
|
+
textSecondary: "#8888a0",
|
|
1515
|
+
textTertiary: "#666680",
|
|
1516
|
+
border: "#1e1e30",
|
|
1517
|
+
borderInput: "#2a2a40",
|
|
1518
|
+
borderHover: "rgba(129, 140, 248, 0.4)",
|
|
1519
|
+
borderDivider: "rgba(255, 255, 255, 0.05)",
|
|
1520
|
+
gradientFrom: "#818cf8",
|
|
1521
|
+
gradientTo: "#c084fc",
|
|
1522
|
+
scrollTrack: "#07070d",
|
|
1523
|
+
scrollThumb: "#2a2a40",
|
|
1524
|
+
scrollThumbHover: "#818cf8",
|
|
1525
|
+
selectionBg: "rgba(129, 140, 248, 0.3)",
|
|
1526
|
+
success: "#22c55e",
|
|
1527
|
+
error: "#ef4444",
|
|
1528
|
+
warning: "#f97316",
|
|
1529
|
+
info: "#3b82f6",
|
|
1530
|
+
layerBasis: "#fbbf24",
|
|
1531
|
+
layerIntent: "#60a5fa",
|
|
1532
|
+
layerEnforce: "#818cf8",
|
|
1533
|
+
layerProof: "#34d399",
|
|
1534
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1535
|
+
fontImport: "Inter",
|
|
1536
|
+
cardBlur: false,
|
|
1537
|
+
buttonText: "#000000"
|
|
1538
|
+
},
|
|
1539
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1540
|
+
// OPTION 3: OBSIDIAN AMBER — Warm, premium, "gold standard"
|
|
1541
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1542
|
+
obsidian_amber: {
|
|
1543
|
+
name: "Obsidian Amber",
|
|
1544
|
+
description: "Premium. Warm. The gold standard of AI governance.",
|
|
1545
|
+
bgPrimary: "#0a0a08",
|
|
1546
|
+
bgSurface: "#141410",
|
|
1547
|
+
bgInput: "#0d0d0a",
|
|
1548
|
+
bgNav: "#141410",
|
|
1549
|
+
bgCode: "#0d0d0a",
|
|
1550
|
+
accent: "#f59e0b",
|
|
1551
|
+
accentHover: "#fbbf24",
|
|
1552
|
+
accentMuted: "rgba(245, 158, 11, 0.1)",
|
|
1553
|
+
accentSubtle: "rgba(245, 158, 11, 0.03)",
|
|
1554
|
+
textPrimary: "#e6e0d6",
|
|
1555
|
+
textHeading: "#ffffff",
|
|
1556
|
+
textSecondary: "#8a8478",
|
|
1557
|
+
textTertiary: "#666058",
|
|
1558
|
+
border: "#2a2820",
|
|
1559
|
+
borderInput: "#3a3830",
|
|
1560
|
+
borderHover: "rgba(245, 158, 11, 0.4)",
|
|
1561
|
+
borderDivider: "rgba(255, 255, 255, 0.05)",
|
|
1562
|
+
gradientFrom: "#f59e0b",
|
|
1563
|
+
gradientTo: "#f97316",
|
|
1564
|
+
scrollTrack: "#0a0a08",
|
|
1565
|
+
scrollThumb: "#3a3830",
|
|
1566
|
+
scrollThumbHover: "#f59e0b",
|
|
1567
|
+
selectionBg: "rgba(245, 158, 11, 0.3)",
|
|
1568
|
+
success: "#22c55e",
|
|
1569
|
+
error: "#ef4444",
|
|
1570
|
+
warning: "#f97316",
|
|
1571
|
+
info: "#3b82f6",
|
|
1572
|
+
layerBasis: "#fbbf24",
|
|
1573
|
+
layerIntent: "#60a5fa",
|
|
1574
|
+
layerEnforce: "#818cf8",
|
|
1575
|
+
layerProof: "#34d399",
|
|
1576
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1577
|
+
fontImport: "Inter",
|
|
1578
|
+
cardBlur: false,
|
|
1579
|
+
buttonText: "#000000"
|
|
1580
|
+
},
|
|
1581
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1582
|
+
// OPTION 4: ARCTIC GLASS — Modern SaaS, frosted glass
|
|
1583
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1584
|
+
arctic_glass: {
|
|
1585
|
+
name: "Arctic Glass",
|
|
1586
|
+
description: "Modern SaaS. Clean. Frosted glass depth.",
|
|
1587
|
+
bgPrimary: "#0c0c14",
|
|
1588
|
+
bgSurface: "rgba(255, 255, 255, 0.04)",
|
|
1589
|
+
bgInput: "rgba(0, 0, 0, 0.3)",
|
|
1590
|
+
bgNav: "rgba(12, 12, 20, 0.8)",
|
|
1591
|
+
bgCode: "rgba(0, 0, 0, 0.3)",
|
|
1592
|
+
accent: "#38bdf8",
|
|
1593
|
+
accentHover: "#7dd3fc",
|
|
1594
|
+
accentMuted: "rgba(56, 189, 248, 0.1)",
|
|
1595
|
+
accentSubtle: "rgba(56, 189, 248, 0.03)",
|
|
1596
|
+
textPrimary: "#e2e8f0",
|
|
1597
|
+
textHeading: "#f8fafc",
|
|
1598
|
+
textSecondary: "#94a3b8",
|
|
1599
|
+
textTertiary: "#64748b",
|
|
1600
|
+
border: "rgba(255, 255, 255, 0.08)",
|
|
1601
|
+
borderInput: "rgba(255, 255, 255, 0.12)",
|
|
1602
|
+
borderHover: "rgba(56, 189, 248, 0.4)",
|
|
1603
|
+
borderDivider: "rgba(255, 255, 255, 0.05)",
|
|
1604
|
+
gradientFrom: "#38bdf8",
|
|
1605
|
+
gradientTo: "#06b6d4",
|
|
1606
|
+
scrollTrack: "#0c0c14",
|
|
1607
|
+
scrollThumb: "rgba(255, 255, 255, 0.1)",
|
|
1608
|
+
scrollThumbHover: "#38bdf8",
|
|
1609
|
+
selectionBg: "rgba(56, 189, 248, 0.3)",
|
|
1610
|
+
success: "#22c55e",
|
|
1611
|
+
error: "#ef4444",
|
|
1612
|
+
warning: "#f97316",
|
|
1613
|
+
info: "#3b82f6",
|
|
1614
|
+
layerBasis: "#fbbf24",
|
|
1615
|
+
layerIntent: "#60a5fa",
|
|
1616
|
+
layerEnforce: "#818cf8",
|
|
1617
|
+
layerProof: "#34d399",
|
|
1618
|
+
fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1619
|
+
fontImport: "Geist",
|
|
1620
|
+
cardBlur: true,
|
|
1621
|
+
buttonText: "#000000"
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
function getActiveTheme() {
|
|
1625
|
+
return THEMES[ACTIVE_THEME];
|
|
1626
|
+
}
|
|
1627
|
+
function getAllThemeIds() {
|
|
1628
|
+
return Object.keys(THEMES);
|
|
1629
|
+
}
|
|
1630
|
+
function themeToCssVars(themeId = ACTIVE_THEME) {
|
|
1631
|
+
const t = THEMES[themeId];
|
|
1632
|
+
return `
|
|
1633
|
+
--bg-primary: ${t.bgPrimary};
|
|
1634
|
+
--bg-surface: ${t.bgSurface};
|
|
1635
|
+
--bg-input: ${t.bgInput};
|
|
1636
|
+
--bg-nav: ${t.bgNav};
|
|
1637
|
+
--bg-code: ${t.bgCode};
|
|
1638
|
+
--accent: ${t.accent};
|
|
1639
|
+
--accent-hover: ${t.accentHover};
|
|
1640
|
+
--accent-muted: ${t.accentMuted};
|
|
1641
|
+
--accent-subtle: ${t.accentSubtle};
|
|
1642
|
+
--text-primary: ${t.textPrimary};
|
|
1643
|
+
--text-heading: ${t.textHeading};
|
|
1644
|
+
--text-secondary: ${t.textSecondary};
|
|
1645
|
+
--text-tertiary: ${t.textTertiary};
|
|
1646
|
+
--border: ${t.border};
|
|
1647
|
+
--border-input: ${t.borderInput};
|
|
1648
|
+
--border-hover: ${t.borderHover};
|
|
1649
|
+
--border-divider: ${t.borderDivider};
|
|
1650
|
+
--gradient-from: ${t.gradientFrom};
|
|
1651
|
+
--gradient-to: ${t.gradientTo};
|
|
1652
|
+
--scroll-track: ${t.scrollTrack};
|
|
1653
|
+
--scroll-thumb: ${t.scrollThumb};
|
|
1654
|
+
--scroll-thumb-hover: ${t.scrollThumbHover};
|
|
1655
|
+
--selection-bg: ${t.selectionBg};
|
|
1656
|
+
--success: ${t.success};
|
|
1657
|
+
--error: ${t.error};
|
|
1658
|
+
--warning: ${t.warning};
|
|
1659
|
+
--info: ${t.info};
|
|
1660
|
+
--layer-basis: ${t.layerBasis};
|
|
1661
|
+
--layer-intent: ${t.layerIntent};
|
|
1662
|
+
--layer-enforce: ${t.layerEnforce};
|
|
1663
|
+
--layer-proof: ${t.layerProof};
|
|
1664
|
+
--btn-text: ${t.buttonText};
|
|
1665
|
+
`.trim();
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
// src/index.ts
|
|
1669
|
+
var VERSION = "1.0.0";
|
|
1670
|
+
var LAST_UPDATED = "2026-02-04";
|
|
1671
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1672
|
+
0 && (module.exports = {
|
|
1673
|
+
ACTIVE_THEME,
|
|
1674
|
+
AGENTANCHOR_DOMAINS,
|
|
1675
|
+
AGENTANCHOR_EMAILS,
|
|
1676
|
+
AGENTANCHOR_PRODUCTS,
|
|
1677
|
+
ALL_DOMAINS,
|
|
1678
|
+
ALL_PRODUCTS,
|
|
1679
|
+
ALL_TIERS,
|
|
1680
|
+
API_ENDPOINTS,
|
|
1681
|
+
API_VERSIONS,
|
|
1682
|
+
AUTH_ERRORS,
|
|
1683
|
+
BASIS_CURRENT_VERSION,
|
|
1684
|
+
BASIS_SPEC_VERSION,
|
|
1685
|
+
BASIS_VERSIONS,
|
|
1686
|
+
CAPABILITIES,
|
|
1687
|
+
CAR_SPEC_CURRENT_VERSION,
|
|
1688
|
+
CAR_SPEC_VERSIONS,
|
|
1689
|
+
COGNIGATE_CURRENT_VERSION,
|
|
1690
|
+
COGNIGATE_DEFAULT_VERSION,
|
|
1691
|
+
COGNIGATE_DOMAINS,
|
|
1692
|
+
COGNIGATE_VERSIONS,
|
|
1693
|
+
CapabilityCategory,
|
|
1694
|
+
DOMAIN_ALIASES,
|
|
1695
|
+
ERROR_CODES,
|
|
1696
|
+
EXTERNAL_ERRORS,
|
|
1697
|
+
ErrorCategory,
|
|
1698
|
+
GITHUB,
|
|
1699
|
+
LAST_UPDATED,
|
|
1700
|
+
LOGIC_API_VERSIONS,
|
|
1701
|
+
LOGIC_CURRENT_VERSION,
|
|
1702
|
+
NOT_FOUND_ERRORS,
|
|
1703
|
+
NPM_PACKAGES,
|
|
1704
|
+
ProductCategory,
|
|
1705
|
+
ProductStatus,
|
|
1706
|
+
RATE_LIMITS,
|
|
1707
|
+
RATE_LIMIT_ERRORS,
|
|
1708
|
+
SERVER_ERRORS,
|
|
1709
|
+
THEMES,
|
|
1710
|
+
TIER_QUOTAS,
|
|
1711
|
+
TIER_THRESHOLDS,
|
|
1712
|
+
TRUST_API_VERSIONS,
|
|
1713
|
+
TRUST_CURRENT_VERSION,
|
|
1714
|
+
TRUST_ERRORS,
|
|
1715
|
+
TrustTier,
|
|
1716
|
+
VALIDATION_ERRORS,
|
|
1717
|
+
VERSION,
|
|
1718
|
+
VERSION_HEADERS,
|
|
1719
|
+
VORION_DOMAINS,
|
|
1720
|
+
VORION_EMAILS,
|
|
1721
|
+
VORION_PRODUCTS,
|
|
1722
|
+
VersionStatus,
|
|
1723
|
+
buildApiUrl,
|
|
1724
|
+
createErrorResponse,
|
|
1725
|
+
formatErrorMessage,
|
|
1726
|
+
formatRateLimit,
|
|
1727
|
+
getActiveTheme,
|
|
1728
|
+
getAllCapabilityCodes,
|
|
1729
|
+
getAllThemeIds,
|
|
1730
|
+
getCapabilitiesByCategory,
|
|
1731
|
+
getCapabilitiesForTier,
|
|
1732
|
+
getCapability,
|
|
1733
|
+
getCapabilityMinTier,
|
|
1734
|
+
getCurrentVersion,
|
|
1735
|
+
getErrorByCode,
|
|
1736
|
+
getErrorsByCategory,
|
|
1737
|
+
getMinTierForLimits,
|
|
1738
|
+
getProduct,
|
|
1739
|
+
getProductsByCategory,
|
|
1740
|
+
getProductsByOrganization,
|
|
1741
|
+
getProductsByStatus,
|
|
1742
|
+
getQuota,
|
|
1743
|
+
getRateLimits,
|
|
1744
|
+
getRetryableErrors,
|
|
1745
|
+
getStableVersions,
|
|
1746
|
+
getTierCode,
|
|
1747
|
+
getTierColor,
|
|
1748
|
+
getTierMaxScore,
|
|
1749
|
+
getTierMinScore,
|
|
1750
|
+
getTierName,
|
|
1751
|
+
getTierThreshold,
|
|
1752
|
+
getVersionDefinition,
|
|
1753
|
+
isCapabilityAvailable,
|
|
1754
|
+
isUnlimited,
|
|
1755
|
+
isVersionDeprecated,
|
|
1756
|
+
isVersionSupported,
|
|
1757
|
+
meetsTierRequirement,
|
|
1758
|
+
parseTier,
|
|
1759
|
+
scoreToTier,
|
|
1760
|
+
themeToCssVars,
|
|
1761
|
+
wouldExceedLimit
|
|
1762
|
+
});
|