@vorionsys/contracts 0.1.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/aci/aci-string.d.ts +539 -0
- package/dist/aci/aci-string.d.ts.map +1 -0
- package/dist/aci/aci-string.js +563 -0
- package/dist/aci/aci-string.js.map +1 -0
- package/dist/aci/attestation.d.ts +648 -0
- package/dist/aci/attestation.d.ts.map +1 -0
- package/dist/aci/attestation.js +289 -0
- package/dist/aci/attestation.js.map +1 -0
- package/dist/aci/domains.d.ts +260 -0
- package/dist/aci/domains.d.ts.map +1 -0
- package/dist/aci/domains.js +322 -0
- package/dist/aci/domains.js.map +1 -0
- package/dist/aci/effective-permission.d.ts +371 -0
- package/dist/aci/effective-permission.d.ts.map +1 -0
- package/dist/aci/effective-permission.js +351 -0
- package/dist/aci/effective-permission.js.map +1 -0
- package/dist/aci/identity.d.ts +1100 -0
- package/dist/aci/identity.d.ts.map +1 -0
- package/dist/aci/identity.js +328 -0
- package/dist/aci/identity.js.map +1 -0
- package/dist/aci/index.d.ts +67 -0
- package/dist/aci/index.d.ts.map +1 -0
- package/dist/aci/index.js +157 -0
- package/dist/aci/index.js.map +1 -0
- package/dist/aci/jwt-claims.d.ts +756 -0
- package/dist/aci/jwt-claims.d.ts.map +1 -0
- package/dist/aci/jwt-claims.js +335 -0
- package/dist/aci/jwt-claims.js.map +1 -0
- package/dist/aci/levels.d.ts +279 -0
- package/dist/aci/levels.d.ts.map +1 -0
- package/dist/aci/levels.js +467 -0
- package/dist/aci/levels.js.map +1 -0
- package/dist/aci/mapping.d.ts +291 -0
- package/dist/aci/mapping.d.ts.map +1 -0
- package/dist/aci/mapping.js +427 -0
- package/dist/aci/mapping.js.map +1 -0
- package/dist/aci/skills.d.ts +314 -0
- package/dist/aci/skills.d.ts.map +1 -0
- package/dist/aci/skills.js +404 -0
- package/dist/aci/skills.js.map +1 -0
- package/dist/aci/tiers.d.ts +403 -0
- package/dist/aci/tiers.d.ts.map +1 -0
- package/dist/aci/tiers.js +659 -0
- package/dist/aci/tiers.js.map +1 -0
- package/dist/canonical/agent.d.ts +796 -0
- package/dist/canonical/agent.d.ts.map +1 -0
- package/dist/canonical/agent.js +527 -0
- package/dist/canonical/agent.js.map +1 -0
- package/dist/canonical/governance.d.ts +905 -0
- package/dist/canonical/governance.d.ts.map +1 -0
- package/dist/canonical/governance.js +454 -0
- package/dist/canonical/governance.js.map +1 -0
- package/dist/canonical/index.d.ts +17 -0
- package/dist/canonical/index.d.ts.map +1 -0
- package/dist/canonical/index.js +21 -0
- package/dist/canonical/index.js.map +1 -0
- package/dist/canonical/intent.d.ts +727 -0
- package/dist/canonical/intent.d.ts.map +1 -0
- package/dist/canonical/intent.js +203 -0
- package/dist/canonical/intent.js.map +1 -0
- package/dist/canonical/risk-level.d.ts +344 -0
- package/dist/canonical/risk-level.d.ts.map +1 -0
- package/dist/canonical/risk-level.js +472 -0
- package/dist/canonical/risk-level.js.map +1 -0
- package/dist/canonical/trust-band.d.ts +239 -0
- package/dist/canonical/trust-band.d.ts.map +1 -0
- package/dist/canonical/trust-band.js +298 -0
- package/dist/canonical/trust-band.js.map +1 -0
- package/dist/canonical/trust-score.d.ts +301 -0
- package/dist/canonical/trust-score.d.ts.map +1 -0
- package/dist/canonical/trust-score.js +390 -0
- package/dist/canonical/trust-score.js.map +1 -0
- package/dist/canonical/trust-signal.d.ts +617 -0
- package/dist/canonical/trust-signal.d.ts.map +1 -0
- package/dist/canonical/trust-signal.js +355 -0
- package/dist/canonical/trust-signal.js.map +1 -0
- package/dist/canonical/validation.d.ts +231 -0
- package/dist/canonical/validation.d.ts.map +1 -0
- package/dist/canonical/validation.js +558 -0
- package/dist/canonical/validation.js.map +1 -0
- package/dist/common/index.d.ts +7 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +7 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/primitives.d.ts +56 -0
- package/dist/common/primitives.d.ts.map +1 -0
- package/dist/common/primitives.js +70 -0
- package/dist/common/primitives.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/v2/canary-probe.d.ts +201 -0
- package/dist/v2/canary-probe.d.ts.map +1 -0
- package/dist/v2/canary-probe.js +99 -0
- package/dist/v2/canary-probe.js.map +1 -0
- package/dist/v2/component.d.ts +132 -0
- package/dist/v2/component.d.ts.map +1 -0
- package/dist/v2/component.js +5 -0
- package/dist/v2/component.js.map +1 -0
- package/dist/v2/decision.d.ts +310 -0
- package/dist/v2/decision.d.ts.map +1 -0
- package/dist/v2/decision.js +21 -0
- package/dist/v2/decision.js.map +1 -0
- package/dist/v2/enums.d.ts +185 -0
- package/dist/v2/enums.d.ts.map +1 -0
- package/dist/v2/enums.js +203 -0
- package/dist/v2/enums.js.map +1 -0
- package/dist/v2/evidence.d.ts +368 -0
- package/dist/v2/evidence.d.ts.map +1 -0
- package/dist/v2/evidence.js +152 -0
- package/dist/v2/evidence.js.map +1 -0
- package/dist/v2/execution.d.ts +190 -0
- package/dist/v2/execution.d.ts.map +1 -0
- package/dist/v2/execution.js +5 -0
- package/dist/v2/execution.js.map +1 -0
- package/dist/v2/index.d.ts +19 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.js +32 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/intent.d.ts +89 -0
- package/dist/v2/intent.d.ts.map +1 -0
- package/dist/v2/intent.js +5 -0
- package/dist/v2/intent.js.map +1 -0
- package/dist/v2/policy-bundle.d.ts +166 -0
- package/dist/v2/policy-bundle.d.ts.map +1 -0
- package/dist/v2/policy-bundle.js +20 -0
- package/dist/v2/policy-bundle.js.map +1 -0
- package/dist/v2/pre-action-gate.d.ts +185 -0
- package/dist/v2/pre-action-gate.d.ts.map +1 -0
- package/dist/v2/pre-action-gate.js +64 -0
- package/dist/v2/pre-action-gate.js.map +1 -0
- package/dist/v2/proof-event.d.ts +201 -0
- package/dist/v2/proof-event.d.ts.map +1 -0
- package/dist/v2/proof-event.js +5 -0
- package/dist/v2/proof-event.js.map +1 -0
- package/dist/v2/retention.d.ts +329 -0
- package/dist/v2/retention.d.ts.map +1 -0
- package/dist/v2/retention.js +162 -0
- package/dist/v2/retention.js.map +1 -0
- package/dist/v2/trust-delta.d.ts +119 -0
- package/dist/v2/trust-delta.d.ts.map +1 -0
- package/dist/v2/trust-delta.js +28 -0
- package/dist/v2/trust-delta.js.map +1 -0
- package/dist/v2/trust-profile.d.ts +337 -0
- package/dist/v2/trust-profile.d.ts.map +1 -0
- package/dist/v2/trust-profile.js +96 -0
- package/dist/v2/trust-profile.js.map +1 -0
- package/dist/validators/decision.d.ts +430 -0
- package/dist/validators/decision.d.ts.map +1 -0
- package/dist/validators/decision.js +61 -0
- package/dist/validators/decision.js.map +1 -0
- package/dist/validators/enums.d.ts +24 -0
- package/dist/validators/enums.d.ts.map +1 -0
- package/dist/validators/enums.js +24 -0
- package/dist/validators/enums.js.map +1 -0
- package/dist/validators/index.d.ts +30 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +42 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/intent.d.ts +229 -0
- package/dist/validators/intent.d.ts.map +1 -0
- package/dist/validators/intent.js +47 -0
- package/dist/validators/intent.js.map +1 -0
- package/dist/validators/proof-event.d.ts +981 -0
- package/dist/validators/proof-event.d.ts.map +1 -0
- package/dist/validators/proof-event.js +134 -0
- package/dist/validators/proof-event.js.map +1 -0
- package/dist/validators/trust-profile.d.ts +350 -0
- package/dist/validators/trust-profile.d.ts.map +1 -0
- package/dist/validators/trust-profile.js +65 -0
- package/dist/validators/trust-profile.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Effective Permission Calculation
|
|
3
|
+
*
|
|
4
|
+
* Provides types and functions for calculating effective permissions based on
|
|
5
|
+
* multiple inputs including certification tier, competence level, runtime tier,
|
|
6
|
+
* observability ceiling, and context policy ceiling.
|
|
7
|
+
*
|
|
8
|
+
* The effective permission is the minimum of all applicable ceilings, ensuring
|
|
9
|
+
* that agents can never exceed the most restrictive constraint in any dimension.
|
|
10
|
+
*
|
|
11
|
+
* @module @vorion/contracts/aci/effective-permission
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { CapabilityLevel } from './levels.js';
|
|
15
|
+
import { CertificationTier, RuntimeTier } from './tiers.js';
|
|
16
|
+
/**
|
|
17
|
+
* Context for calculating effective permissions.
|
|
18
|
+
*
|
|
19
|
+
* This combines all factors that influence what an agent is permitted to do:
|
|
20
|
+
* - certificationTier: External attestation status
|
|
21
|
+
* - competenceLevel: Agent's declared capability level
|
|
22
|
+
* - runtimeTier: Deployment-specific autonomy level
|
|
23
|
+
* - observabilityCeiling: Maximum level based on observability requirements
|
|
24
|
+
* - contextPolicyCeiling: Maximum level based on current context policy
|
|
25
|
+
*/
|
|
26
|
+
export interface EffectivePermissionContext {
|
|
27
|
+
/** ACI certification tier (external attestation status) */
|
|
28
|
+
certificationTier: CertificationTier;
|
|
29
|
+
/** Agent's competence/capability level */
|
|
30
|
+
competenceLevel: CapabilityLevel;
|
|
31
|
+
/** Vorion runtime tier (deployment autonomy) */
|
|
32
|
+
runtimeTier: RuntimeTier;
|
|
33
|
+
/** Maximum level based on observability requirements (0-7) */
|
|
34
|
+
observabilityCeiling: number;
|
|
35
|
+
/** Maximum level based on context policy (0-7) */
|
|
36
|
+
contextPolicyCeiling: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Zod schema for EffectivePermissionContext.
|
|
40
|
+
*/
|
|
41
|
+
export declare const effectivePermissionContextSchema: z.ZodObject<{
|
|
42
|
+
certificationTier: z.ZodNativeEnum<typeof CertificationTier>;
|
|
43
|
+
competenceLevel: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
44
|
+
runtimeTier: z.ZodNativeEnum<typeof RuntimeTier>;
|
|
45
|
+
observabilityCeiling: z.ZodNumber;
|
|
46
|
+
contextPolicyCeiling: z.ZodNumber;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
certificationTier: CertificationTier;
|
|
49
|
+
competenceLevel: CapabilityLevel;
|
|
50
|
+
runtimeTier: RuntimeTier;
|
|
51
|
+
observabilityCeiling: number;
|
|
52
|
+
contextPolicyCeiling: number;
|
|
53
|
+
}, {
|
|
54
|
+
certificationTier: CertificationTier;
|
|
55
|
+
competenceLevel: CapabilityLevel;
|
|
56
|
+
runtimeTier: RuntimeTier;
|
|
57
|
+
observabilityCeiling: number;
|
|
58
|
+
contextPolicyCeiling: number;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Result of effective permission calculation.
|
|
62
|
+
*/
|
|
63
|
+
export interface EffectivePermission {
|
|
64
|
+
/** The effective permission level (minimum of all ceilings) */
|
|
65
|
+
level: CapabilityLevel;
|
|
66
|
+
/** Whether the effective level was constrained */
|
|
67
|
+
constrained: boolean;
|
|
68
|
+
/** The factor that caused the constraint (if constrained) */
|
|
69
|
+
constrainingFactor?: ConstrainingFactor;
|
|
70
|
+
/** Details about each ceiling that was applied */
|
|
71
|
+
ceilings: PermissionCeilings;
|
|
72
|
+
/** Recommendations for increasing effective permission */
|
|
73
|
+
recommendations?: string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Factors that can constrain effective permission.
|
|
77
|
+
*/
|
|
78
|
+
export type ConstrainingFactor = 'certification_tier' | 'competence_level' | 'runtime_tier' | 'observability_ceiling' | 'context_policy_ceiling' | 'multiple';
|
|
79
|
+
/**
|
|
80
|
+
* Individual ceiling values applied to permission calculation.
|
|
81
|
+
*/
|
|
82
|
+
export interface PermissionCeilings {
|
|
83
|
+
/** Ceiling from certification tier */
|
|
84
|
+
certificationCeiling: CapabilityLevel;
|
|
85
|
+
/** Ceiling from competence level */
|
|
86
|
+
competenceCeiling: CapabilityLevel;
|
|
87
|
+
/** Ceiling from runtime tier */
|
|
88
|
+
runtimeCeiling: CapabilityLevel;
|
|
89
|
+
/** Ceiling from observability requirements */
|
|
90
|
+
observabilityCeiling: CapabilityLevel;
|
|
91
|
+
/** Ceiling from context policy */
|
|
92
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Zod schema for ConstrainingFactor.
|
|
96
|
+
*/
|
|
97
|
+
export declare const constrainingFactorSchema: z.ZodEnum<["certification_tier", "competence_level", "runtime_tier", "observability_ceiling", "context_policy_ceiling", "multiple"]>;
|
|
98
|
+
/**
|
|
99
|
+
* Zod schema for PermissionCeilings.
|
|
100
|
+
*/
|
|
101
|
+
export declare const permissionCeilingsSchema: z.ZodObject<{
|
|
102
|
+
certificationCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
103
|
+
competenceCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
104
|
+
runtimeCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
105
|
+
observabilityCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
106
|
+
contextPolicyCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
observabilityCeiling: CapabilityLevel;
|
|
109
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
110
|
+
certificationCeiling: CapabilityLevel;
|
|
111
|
+
competenceCeiling: CapabilityLevel;
|
|
112
|
+
runtimeCeiling: CapabilityLevel;
|
|
113
|
+
}, {
|
|
114
|
+
observabilityCeiling: CapabilityLevel;
|
|
115
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
116
|
+
certificationCeiling: CapabilityLevel;
|
|
117
|
+
competenceCeiling: CapabilityLevel;
|
|
118
|
+
runtimeCeiling: CapabilityLevel;
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* Zod schema for EffectivePermission.
|
|
122
|
+
*/
|
|
123
|
+
export declare const effectivePermissionSchema: z.ZodObject<{
|
|
124
|
+
level: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
125
|
+
constrained: z.ZodBoolean;
|
|
126
|
+
constrainingFactor: z.ZodOptional<z.ZodEnum<["certification_tier", "competence_level", "runtime_tier", "observability_ceiling", "context_policy_ceiling", "multiple"]>>;
|
|
127
|
+
ceilings: z.ZodObject<{
|
|
128
|
+
certificationCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
129
|
+
competenceCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
130
|
+
runtimeCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
131
|
+
observabilityCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
132
|
+
contextPolicyCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
observabilityCeiling: CapabilityLevel;
|
|
135
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
136
|
+
certificationCeiling: CapabilityLevel;
|
|
137
|
+
competenceCeiling: CapabilityLevel;
|
|
138
|
+
runtimeCeiling: CapabilityLevel;
|
|
139
|
+
}, {
|
|
140
|
+
observabilityCeiling: CapabilityLevel;
|
|
141
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
142
|
+
certificationCeiling: CapabilityLevel;
|
|
143
|
+
competenceCeiling: CapabilityLevel;
|
|
144
|
+
runtimeCeiling: CapabilityLevel;
|
|
145
|
+
}>;
|
|
146
|
+
recommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
level: CapabilityLevel;
|
|
149
|
+
constrained: boolean;
|
|
150
|
+
ceilings: {
|
|
151
|
+
observabilityCeiling: CapabilityLevel;
|
|
152
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
153
|
+
certificationCeiling: CapabilityLevel;
|
|
154
|
+
competenceCeiling: CapabilityLevel;
|
|
155
|
+
runtimeCeiling: CapabilityLevel;
|
|
156
|
+
};
|
|
157
|
+
constrainingFactor?: "certification_tier" | "competence_level" | "runtime_tier" | "observability_ceiling" | "context_policy_ceiling" | "multiple" | undefined;
|
|
158
|
+
recommendations?: string[] | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
level: CapabilityLevel;
|
|
161
|
+
constrained: boolean;
|
|
162
|
+
ceilings: {
|
|
163
|
+
observabilityCeiling: CapabilityLevel;
|
|
164
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
165
|
+
certificationCeiling: CapabilityLevel;
|
|
166
|
+
competenceCeiling: CapabilityLevel;
|
|
167
|
+
runtimeCeiling: CapabilityLevel;
|
|
168
|
+
};
|
|
169
|
+
constrainingFactor?: "certification_tier" | "competence_level" | "runtime_tier" | "observability_ceiling" | "context_policy_ceiling" | "multiple" | undefined;
|
|
170
|
+
recommendations?: string[] | undefined;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* Calculates the effective permission from the context.
|
|
174
|
+
*
|
|
175
|
+
* The effective permission is the minimum of all applicable ceilings:
|
|
176
|
+
* - Certification tier ceiling
|
|
177
|
+
* - Competence level (agent's declared capability)
|
|
178
|
+
* - Runtime tier ceiling
|
|
179
|
+
* - Observability ceiling
|
|
180
|
+
* - Context policy ceiling
|
|
181
|
+
*
|
|
182
|
+
* @param ctx - Permission context
|
|
183
|
+
* @returns Effective permission result
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* const result = calculateEffectivePermission({
|
|
188
|
+
* certificationTier: CertificationTier.T3_MONITORED,
|
|
189
|
+
* competenceLevel: CapabilityLevel.L4_STANDARD,
|
|
190
|
+
* runtimeTier: RuntimeTier.T3_MONITORED,
|
|
191
|
+
* observabilityCeiling: 4,
|
|
192
|
+
* contextPolicyCeiling: 3,
|
|
193
|
+
* });
|
|
194
|
+
* // result.level === CapabilityLevel.L3_EXECUTE
|
|
195
|
+
* // result.constrained === true
|
|
196
|
+
* // result.constrainingFactor === 'context_policy_ceiling'
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
export declare function calculateEffectivePermission(ctx: EffectivePermissionContext): EffectivePermission;
|
|
200
|
+
/**
|
|
201
|
+
* Checks if an effective permission allows a specific capability level.
|
|
202
|
+
*
|
|
203
|
+
* @param permission - Effective permission
|
|
204
|
+
* @param requiredLevel - Required capability level
|
|
205
|
+
* @returns True if the permission allows the required level
|
|
206
|
+
*/
|
|
207
|
+
export declare function permissionAllowsLevel(permission: EffectivePermission, requiredLevel: CapabilityLevel): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Checks if a context allows a specific capability level.
|
|
210
|
+
*
|
|
211
|
+
* @param ctx - Permission context
|
|
212
|
+
* @param requiredLevel - Required capability level
|
|
213
|
+
* @returns True if the context allows the required level
|
|
214
|
+
*/
|
|
215
|
+
export declare function contextAllowsLevel(ctx: EffectivePermissionContext, requiredLevel: CapabilityLevel): boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Result of a permission check with detailed information.
|
|
218
|
+
*/
|
|
219
|
+
export interface PermissionCheckResult {
|
|
220
|
+
/** Whether the requested level is allowed */
|
|
221
|
+
allowed: boolean;
|
|
222
|
+
/** The effective permission level */
|
|
223
|
+
effectiveLevel: CapabilityLevel;
|
|
224
|
+
/** The requested level */
|
|
225
|
+
requestedLevel: CapabilityLevel;
|
|
226
|
+
/** Gap between requested and effective (0 if allowed) */
|
|
227
|
+
levelGap: number;
|
|
228
|
+
/** Full effective permission details */
|
|
229
|
+
permission: EffectivePermission;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Performs a detailed permission check.
|
|
233
|
+
*
|
|
234
|
+
* @param ctx - Permission context
|
|
235
|
+
* @param requiredLevel - Required capability level
|
|
236
|
+
* @returns Detailed permission check result
|
|
237
|
+
*/
|
|
238
|
+
export declare function checkPermission(ctx: EffectivePermissionContext, requiredLevel: CapabilityLevel): PermissionCheckResult;
|
|
239
|
+
/**
|
|
240
|
+
* Zod schema for PermissionCheckResult.
|
|
241
|
+
*/
|
|
242
|
+
export declare const permissionCheckResultSchema: z.ZodObject<{
|
|
243
|
+
allowed: z.ZodBoolean;
|
|
244
|
+
effectiveLevel: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
245
|
+
requestedLevel: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
246
|
+
levelGap: z.ZodNumber;
|
|
247
|
+
permission: z.ZodObject<{
|
|
248
|
+
level: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
249
|
+
constrained: z.ZodBoolean;
|
|
250
|
+
constrainingFactor: z.ZodOptional<z.ZodEnum<["certification_tier", "competence_level", "runtime_tier", "observability_ceiling", "context_policy_ceiling", "multiple"]>>;
|
|
251
|
+
ceilings: z.ZodObject<{
|
|
252
|
+
certificationCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
253
|
+
competenceCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
254
|
+
runtimeCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
255
|
+
observabilityCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
256
|
+
contextPolicyCeiling: z.ZodNativeEnum<typeof CapabilityLevel>;
|
|
257
|
+
}, "strip", z.ZodTypeAny, {
|
|
258
|
+
observabilityCeiling: CapabilityLevel;
|
|
259
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
260
|
+
certificationCeiling: CapabilityLevel;
|
|
261
|
+
competenceCeiling: CapabilityLevel;
|
|
262
|
+
runtimeCeiling: CapabilityLevel;
|
|
263
|
+
}, {
|
|
264
|
+
observabilityCeiling: CapabilityLevel;
|
|
265
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
266
|
+
certificationCeiling: CapabilityLevel;
|
|
267
|
+
competenceCeiling: CapabilityLevel;
|
|
268
|
+
runtimeCeiling: CapabilityLevel;
|
|
269
|
+
}>;
|
|
270
|
+
recommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
level: CapabilityLevel;
|
|
273
|
+
constrained: boolean;
|
|
274
|
+
ceilings: {
|
|
275
|
+
observabilityCeiling: CapabilityLevel;
|
|
276
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
277
|
+
certificationCeiling: CapabilityLevel;
|
|
278
|
+
competenceCeiling: CapabilityLevel;
|
|
279
|
+
runtimeCeiling: CapabilityLevel;
|
|
280
|
+
};
|
|
281
|
+
constrainingFactor?: "certification_tier" | "competence_level" | "runtime_tier" | "observability_ceiling" | "context_policy_ceiling" | "multiple" | undefined;
|
|
282
|
+
recommendations?: string[] | undefined;
|
|
283
|
+
}, {
|
|
284
|
+
level: CapabilityLevel;
|
|
285
|
+
constrained: boolean;
|
|
286
|
+
ceilings: {
|
|
287
|
+
observabilityCeiling: CapabilityLevel;
|
|
288
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
289
|
+
certificationCeiling: CapabilityLevel;
|
|
290
|
+
competenceCeiling: CapabilityLevel;
|
|
291
|
+
runtimeCeiling: CapabilityLevel;
|
|
292
|
+
};
|
|
293
|
+
constrainingFactor?: "certification_tier" | "competence_level" | "runtime_tier" | "observability_ceiling" | "context_policy_ceiling" | "multiple" | undefined;
|
|
294
|
+
recommendations?: string[] | undefined;
|
|
295
|
+
}>;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
allowed: boolean;
|
|
298
|
+
effectiveLevel: CapabilityLevel;
|
|
299
|
+
requestedLevel: CapabilityLevel;
|
|
300
|
+
levelGap: number;
|
|
301
|
+
permission: {
|
|
302
|
+
level: CapabilityLevel;
|
|
303
|
+
constrained: boolean;
|
|
304
|
+
ceilings: {
|
|
305
|
+
observabilityCeiling: CapabilityLevel;
|
|
306
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
307
|
+
certificationCeiling: CapabilityLevel;
|
|
308
|
+
competenceCeiling: CapabilityLevel;
|
|
309
|
+
runtimeCeiling: CapabilityLevel;
|
|
310
|
+
};
|
|
311
|
+
constrainingFactor?: "certification_tier" | "competence_level" | "runtime_tier" | "observability_ceiling" | "context_policy_ceiling" | "multiple" | undefined;
|
|
312
|
+
recommendations?: string[] | undefined;
|
|
313
|
+
};
|
|
314
|
+
}, {
|
|
315
|
+
allowed: boolean;
|
|
316
|
+
effectiveLevel: CapabilityLevel;
|
|
317
|
+
requestedLevel: CapabilityLevel;
|
|
318
|
+
levelGap: number;
|
|
319
|
+
permission: {
|
|
320
|
+
level: CapabilityLevel;
|
|
321
|
+
constrained: boolean;
|
|
322
|
+
ceilings: {
|
|
323
|
+
observabilityCeiling: CapabilityLevel;
|
|
324
|
+
contextPolicyCeiling: CapabilityLevel;
|
|
325
|
+
certificationCeiling: CapabilityLevel;
|
|
326
|
+
competenceCeiling: CapabilityLevel;
|
|
327
|
+
runtimeCeiling: CapabilityLevel;
|
|
328
|
+
};
|
|
329
|
+
constrainingFactor?: "certification_tier" | "competence_level" | "runtime_tier" | "observability_ceiling" | "context_policy_ceiling" | "multiple" | undefined;
|
|
330
|
+
recommendations?: string[] | undefined;
|
|
331
|
+
};
|
|
332
|
+
}>;
|
|
333
|
+
/**
|
|
334
|
+
* Creates a new context with a modified ceiling.
|
|
335
|
+
*
|
|
336
|
+
* @param ctx - Original context
|
|
337
|
+
* @param factor - Factor to modify
|
|
338
|
+
* @param newValue - New value for the factor
|
|
339
|
+
* @returns New context with modified value
|
|
340
|
+
*/
|
|
341
|
+
export declare function modifyContextCeiling(ctx: EffectivePermissionContext, factor: Exclude<ConstrainingFactor, 'multiple'>, newValue: number): EffectivePermissionContext;
|
|
342
|
+
/**
|
|
343
|
+
* Calculates what context changes would be needed to achieve a target level.
|
|
344
|
+
*
|
|
345
|
+
* @param ctx - Current context
|
|
346
|
+
* @param targetLevel - Desired capability level
|
|
347
|
+
* @returns Map of factors to required values
|
|
348
|
+
*/
|
|
349
|
+
export declare function calculateRequiredChanges(ctx: EffectivePermissionContext, targetLevel: CapabilityLevel): Map<Exclude<ConstrainingFactor, 'multiple'>, number>;
|
|
350
|
+
/**
|
|
351
|
+
* Creates a default permission context.
|
|
352
|
+
*
|
|
353
|
+
* @param overrides - Optional overrides
|
|
354
|
+
* @returns Default context with any overrides applied
|
|
355
|
+
*/
|
|
356
|
+
export declare function createDefaultContext(overrides?: Partial<EffectivePermissionContext>): EffectivePermissionContext;
|
|
357
|
+
/**
|
|
358
|
+
* Creates a maximally permissive context.
|
|
359
|
+
*
|
|
360
|
+
* @returns Context with all ceilings at maximum
|
|
361
|
+
*/
|
|
362
|
+
export declare function createMaxPermissionContext(): EffectivePermissionContext;
|
|
363
|
+
/**
|
|
364
|
+
* Type guard for EffectivePermissionContext.
|
|
365
|
+
*/
|
|
366
|
+
export declare function isEffectivePermissionContext(value: unknown): value is EffectivePermissionContext;
|
|
367
|
+
/**
|
|
368
|
+
* Type guard for EffectivePermission.
|
|
369
|
+
*/
|
|
370
|
+
export declare function isEffectivePermission(value: unknown): value is EffectivePermission;
|
|
371
|
+
//# sourceMappingURL=effective-permission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effective-permission.d.ts","sourceRoot":"","sources":["../../src/aci/effective-permission.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAyB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,iBAAiB,EAEjB,WAAW,EAGZ,MAAM,YAAY,CAAC;AAMpB;;;;;;;;;GASG;AACH,MAAM,WAAW,0BAA0B;IACzC,2DAA2D;IAC3D,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,0CAA0C;IAC1C,eAAe,EAAE,eAAe,CAAC;IACjC,gDAAgD;IAChD,WAAW,EAAE,WAAW,CAAC;IACzB,8DAA8D;IAC9D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kDAA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