@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.
Files changed (173) hide show
  1. package/dist/aci/aci-string.d.ts +539 -0
  2. package/dist/aci/aci-string.d.ts.map +1 -0
  3. package/dist/aci/aci-string.js +563 -0
  4. package/dist/aci/aci-string.js.map +1 -0
  5. package/dist/aci/attestation.d.ts +648 -0
  6. package/dist/aci/attestation.d.ts.map +1 -0
  7. package/dist/aci/attestation.js +289 -0
  8. package/dist/aci/attestation.js.map +1 -0
  9. package/dist/aci/domains.d.ts +260 -0
  10. package/dist/aci/domains.d.ts.map +1 -0
  11. package/dist/aci/domains.js +322 -0
  12. package/dist/aci/domains.js.map +1 -0
  13. package/dist/aci/effective-permission.d.ts +371 -0
  14. package/dist/aci/effective-permission.d.ts.map +1 -0
  15. package/dist/aci/effective-permission.js +351 -0
  16. package/dist/aci/effective-permission.js.map +1 -0
  17. package/dist/aci/identity.d.ts +1100 -0
  18. package/dist/aci/identity.d.ts.map +1 -0
  19. package/dist/aci/identity.js +328 -0
  20. package/dist/aci/identity.js.map +1 -0
  21. package/dist/aci/index.d.ts +67 -0
  22. package/dist/aci/index.d.ts.map +1 -0
  23. package/dist/aci/index.js +157 -0
  24. package/dist/aci/index.js.map +1 -0
  25. package/dist/aci/jwt-claims.d.ts +756 -0
  26. package/dist/aci/jwt-claims.d.ts.map +1 -0
  27. package/dist/aci/jwt-claims.js +335 -0
  28. package/dist/aci/jwt-claims.js.map +1 -0
  29. package/dist/aci/levels.d.ts +279 -0
  30. package/dist/aci/levels.d.ts.map +1 -0
  31. package/dist/aci/levels.js +467 -0
  32. package/dist/aci/levels.js.map +1 -0
  33. package/dist/aci/mapping.d.ts +291 -0
  34. package/dist/aci/mapping.d.ts.map +1 -0
  35. package/dist/aci/mapping.js +427 -0
  36. package/dist/aci/mapping.js.map +1 -0
  37. package/dist/aci/skills.d.ts +314 -0
  38. package/dist/aci/skills.d.ts.map +1 -0
  39. package/dist/aci/skills.js +404 -0
  40. package/dist/aci/skills.js.map +1 -0
  41. package/dist/aci/tiers.d.ts +403 -0
  42. package/dist/aci/tiers.d.ts.map +1 -0
  43. package/dist/aci/tiers.js +659 -0
  44. package/dist/aci/tiers.js.map +1 -0
  45. package/dist/canonical/agent.d.ts +796 -0
  46. package/dist/canonical/agent.d.ts.map +1 -0
  47. package/dist/canonical/agent.js +527 -0
  48. package/dist/canonical/agent.js.map +1 -0
  49. package/dist/canonical/governance.d.ts +905 -0
  50. package/dist/canonical/governance.d.ts.map +1 -0
  51. package/dist/canonical/governance.js +454 -0
  52. package/dist/canonical/governance.js.map +1 -0
  53. package/dist/canonical/index.d.ts +17 -0
  54. package/dist/canonical/index.d.ts.map +1 -0
  55. package/dist/canonical/index.js +21 -0
  56. package/dist/canonical/index.js.map +1 -0
  57. package/dist/canonical/intent.d.ts +727 -0
  58. package/dist/canonical/intent.d.ts.map +1 -0
  59. package/dist/canonical/intent.js +203 -0
  60. package/dist/canonical/intent.js.map +1 -0
  61. package/dist/canonical/risk-level.d.ts +344 -0
  62. package/dist/canonical/risk-level.d.ts.map +1 -0
  63. package/dist/canonical/risk-level.js +472 -0
  64. package/dist/canonical/risk-level.js.map +1 -0
  65. package/dist/canonical/trust-band.d.ts +239 -0
  66. package/dist/canonical/trust-band.d.ts.map +1 -0
  67. package/dist/canonical/trust-band.js +298 -0
  68. package/dist/canonical/trust-band.js.map +1 -0
  69. package/dist/canonical/trust-score.d.ts +301 -0
  70. package/dist/canonical/trust-score.d.ts.map +1 -0
  71. package/dist/canonical/trust-score.js +390 -0
  72. package/dist/canonical/trust-score.js.map +1 -0
  73. package/dist/canonical/trust-signal.d.ts +617 -0
  74. package/dist/canonical/trust-signal.d.ts.map +1 -0
  75. package/dist/canonical/trust-signal.js +355 -0
  76. package/dist/canonical/trust-signal.js.map +1 -0
  77. package/dist/canonical/validation.d.ts +231 -0
  78. package/dist/canonical/validation.d.ts.map +1 -0
  79. package/dist/canonical/validation.js +558 -0
  80. package/dist/canonical/validation.js.map +1 -0
  81. package/dist/common/index.d.ts +7 -0
  82. package/dist/common/index.d.ts.map +1 -0
  83. package/dist/common/index.js +7 -0
  84. package/dist/common/index.js.map +1 -0
  85. package/dist/common/primitives.d.ts +56 -0
  86. package/dist/common/primitives.d.ts.map +1 -0
  87. package/dist/common/primitives.js +70 -0
  88. package/dist/common/primitives.js.map +1 -0
  89. package/dist/index.d.ts +11 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +15 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/v2/canary-probe.d.ts +201 -0
  94. package/dist/v2/canary-probe.d.ts.map +1 -0
  95. package/dist/v2/canary-probe.js +99 -0
  96. package/dist/v2/canary-probe.js.map +1 -0
  97. package/dist/v2/component.d.ts +132 -0
  98. package/dist/v2/component.d.ts.map +1 -0
  99. package/dist/v2/component.js +5 -0
  100. package/dist/v2/component.js.map +1 -0
  101. package/dist/v2/decision.d.ts +310 -0
  102. package/dist/v2/decision.d.ts.map +1 -0
  103. package/dist/v2/decision.js +21 -0
  104. package/dist/v2/decision.js.map +1 -0
  105. package/dist/v2/enums.d.ts +185 -0
  106. package/dist/v2/enums.d.ts.map +1 -0
  107. package/dist/v2/enums.js +203 -0
  108. package/dist/v2/enums.js.map +1 -0
  109. package/dist/v2/evidence.d.ts +368 -0
  110. package/dist/v2/evidence.d.ts.map +1 -0
  111. package/dist/v2/evidence.js +152 -0
  112. package/dist/v2/evidence.js.map +1 -0
  113. package/dist/v2/execution.d.ts +190 -0
  114. package/dist/v2/execution.d.ts.map +1 -0
  115. package/dist/v2/execution.js +5 -0
  116. package/dist/v2/execution.js.map +1 -0
  117. package/dist/v2/index.d.ts +19 -0
  118. package/dist/v2/index.d.ts.map +1 -0
  119. package/dist/v2/index.js +32 -0
  120. package/dist/v2/index.js.map +1 -0
  121. package/dist/v2/intent.d.ts +89 -0
  122. package/dist/v2/intent.d.ts.map +1 -0
  123. package/dist/v2/intent.js +5 -0
  124. package/dist/v2/intent.js.map +1 -0
  125. package/dist/v2/policy-bundle.d.ts +166 -0
  126. package/dist/v2/policy-bundle.d.ts.map +1 -0
  127. package/dist/v2/policy-bundle.js +20 -0
  128. package/dist/v2/policy-bundle.js.map +1 -0
  129. package/dist/v2/pre-action-gate.d.ts +185 -0
  130. package/dist/v2/pre-action-gate.d.ts.map +1 -0
  131. package/dist/v2/pre-action-gate.js +64 -0
  132. package/dist/v2/pre-action-gate.js.map +1 -0
  133. package/dist/v2/proof-event.d.ts +201 -0
  134. package/dist/v2/proof-event.d.ts.map +1 -0
  135. package/dist/v2/proof-event.js +5 -0
  136. package/dist/v2/proof-event.js.map +1 -0
  137. package/dist/v2/retention.d.ts +329 -0
  138. package/dist/v2/retention.d.ts.map +1 -0
  139. package/dist/v2/retention.js +162 -0
  140. package/dist/v2/retention.js.map +1 -0
  141. package/dist/v2/trust-delta.d.ts +119 -0
  142. package/dist/v2/trust-delta.d.ts.map +1 -0
  143. package/dist/v2/trust-delta.js +28 -0
  144. package/dist/v2/trust-delta.js.map +1 -0
  145. package/dist/v2/trust-profile.d.ts +337 -0
  146. package/dist/v2/trust-profile.d.ts.map +1 -0
  147. package/dist/v2/trust-profile.js +96 -0
  148. package/dist/v2/trust-profile.js.map +1 -0
  149. package/dist/validators/decision.d.ts +430 -0
  150. package/dist/validators/decision.d.ts.map +1 -0
  151. package/dist/validators/decision.js +61 -0
  152. package/dist/validators/decision.js.map +1 -0
  153. package/dist/validators/enums.d.ts +24 -0
  154. package/dist/validators/enums.d.ts.map +1 -0
  155. package/dist/validators/enums.js +24 -0
  156. package/dist/validators/enums.js.map +1 -0
  157. package/dist/validators/index.d.ts +30 -0
  158. package/dist/validators/index.d.ts.map +1 -0
  159. package/dist/validators/index.js +42 -0
  160. package/dist/validators/index.js.map +1 -0
  161. package/dist/validators/intent.d.ts +229 -0
  162. package/dist/validators/intent.d.ts.map +1 -0
  163. package/dist/validators/intent.js +47 -0
  164. package/dist/validators/intent.js.map +1 -0
  165. package/dist/validators/proof-event.d.ts +981 -0
  166. package/dist/validators/proof-event.d.ts.map +1 -0
  167. package/dist/validators/proof-event.js +134 -0
  168. package/dist/validators/proof-event.js.map +1 -0
  169. package/dist/validators/trust-profile.d.ts +350 -0
  170. package/dist/validators/trust-profile.d.ts.map +1 -0
  171. package/dist/validators/trust-profile.js +65 -0
  172. package/dist/validators/trust-profile.js.map +1 -0
  173. package/package.json +65 -0
@@ -0,0 +1,905 @@
1
+ /**
2
+ * @fileoverview Canonical Governance type definitions for the Vorion Platform.
3
+ *
4
+ * This file provides the authoritative definitions for governance-related types
5
+ * including authorization results, authentication context, hierarchy levels,
6
+ * and authority scopes. These types unify various implementations across the
7
+ * codebase into a single source of truth.
8
+ *
9
+ * @module @vorion/contracts/canonical/governance
10
+ */
11
+ import { z } from 'zod';
12
+ import { DenialReason } from '../v2/decision.js';
13
+ export { DenialReason };
14
+ /**
15
+ * Extended denial reasons for governance-specific scenarios.
16
+ *
17
+ * These extend the base DenialReason enum with governance-specific codes.
18
+ * Use DenialReason for trust/policy denials, and these for RBAC/scope denials.
19
+ */
20
+ export declare enum GovernanceDenialReason {
21
+ /** User lacks required roles for the action */
22
+ MISSING_ROLES = "missing_roles",
23
+ /** User lacks required permissions for the action */
24
+ MISSING_PERMISSIONS = "missing_permissions",
25
+ /** Action is outside the authorized scope */
26
+ SCOPE_VIOLATION = "scope_violation",
27
+ /** Human oversight/approval is required but not present */
28
+ REQUIRES_HUMAN_APPROVAL = "requires_human_approval"
29
+ }
30
+ /**
31
+ * Zod schema for GovernanceDenialReason enum validation.
32
+ */
33
+ export declare const governanceDenialReasonSchema: z.ZodNativeEnum<typeof GovernanceDenialReason>;
34
+ /**
35
+ * Zod schema for base DenialReason enum validation (from v2/decision.ts).
36
+ */
37
+ export declare const denialReasonSchema: z.ZodNativeEnum<typeof DenialReason>;
38
+ /**
39
+ * Zod schema for combined denial reasons (DenialReason or GovernanceDenialReason).
40
+ */
41
+ export declare const anyDenialReasonSchema: z.ZodUnion<[z.ZodNativeEnum<typeof DenialReason>, z.ZodNativeEnum<typeof GovernanceDenialReason>]>;
42
+ /**
43
+ * Result of an authorization check.
44
+ *
45
+ * Unifies simple RBAC-style checks (roles/permissions) and more complex
46
+ * trust-based authorization decisions. Provides rich context about why
47
+ * a request was allowed or denied.
48
+ */
49
+ export interface AuthorizationResult {
50
+ /** Whether the action is authorized */
51
+ readonly allowed: boolean;
52
+ /** Human-readable explanation of the decision */
53
+ readonly reason?: string;
54
+ /** Specific denial reason code (when allowed=false) - trust/policy denial */
55
+ readonly denialReason?: DenialReason;
56
+ /** Specific denial reason code (when allowed=false) - governance/RBAC denial */
57
+ readonly governanceDenialReason?: GovernanceDenialReason;
58
+ /** Roles that matched the authorization requirement (RBAC) */
59
+ readonly matchedRoles?: readonly string[];
60
+ /** Permissions that matched the authorization requirement (RBAC) */
61
+ readonly matchedPermissions?: readonly string[];
62
+ /** Constraints that apply to the authorized action */
63
+ readonly constraints?: AuthorizationConstraints;
64
+ /** Recommended remediation steps if denied */
65
+ readonly remediations?: readonly string[];
66
+ /** When this authorization decision expires */
67
+ readonly expiresAt?: Date;
68
+ }
69
+ /**
70
+ * Constraints applied to an authorized action.
71
+ *
72
+ * Even when an action is allowed, these constraints define the
73
+ * boundaries within which it must be executed.
74
+ */
75
+ export interface AuthorizationConstraints {
76
+ /** Maximum number of operations allowed */
77
+ readonly maxOperations?: number;
78
+ /** Time window in milliseconds for the authorization */
79
+ readonly validityMs?: number;
80
+ /** Resource identifiers this authorization applies to */
81
+ readonly resources?: readonly string[];
82
+ /** Data sensitivity levels allowed */
83
+ readonly allowedSensitivity?: readonly string[];
84
+ /** Whether human oversight is required during execution */
85
+ readonly requiresOversight?: boolean;
86
+ /** Additional custom constraints */
87
+ readonly custom?: Readonly<Record<string, unknown>>;
88
+ }
89
+ /**
90
+ * Zod schema for AuthorizationConstraints.
91
+ */
92
+ export declare const authorizationConstraintsSchema: z.ZodObject<{
93
+ maxOperations: z.ZodOptional<z.ZodNumber>;
94
+ validityMs: z.ZodOptional<z.ZodNumber>;
95
+ resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
96
+ allowedSensitivity: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
+ requiresOversight: z.ZodOptional<z.ZodBoolean>;
98
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ custom?: Record<string, unknown> | undefined;
101
+ maxOperations?: number | undefined;
102
+ validityMs?: number | undefined;
103
+ resources?: string[] | undefined;
104
+ allowedSensitivity?: string[] | undefined;
105
+ requiresOversight?: boolean | undefined;
106
+ }, {
107
+ custom?: Record<string, unknown> | undefined;
108
+ maxOperations?: number | undefined;
109
+ validityMs?: number | undefined;
110
+ resources?: string[] | undefined;
111
+ allowedSensitivity?: string[] | undefined;
112
+ requiresOversight?: boolean | undefined;
113
+ }>;
114
+ /**
115
+ * Zod schema for AuthorizationResult.
116
+ */
117
+ export declare const authorizationResultSchema: z.ZodObject<{
118
+ allowed: z.ZodBoolean;
119
+ reason: z.ZodOptional<z.ZodString>;
120
+ denialReason: z.ZodOptional<z.ZodNativeEnum<typeof DenialReason>>;
121
+ governanceDenialReason: z.ZodOptional<z.ZodNativeEnum<typeof GovernanceDenialReason>>;
122
+ matchedRoles: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString, "many">>>;
123
+ matchedPermissions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString, "many">>>;
124
+ constraints: z.ZodOptional<z.ZodObject<{
125
+ maxOperations: z.ZodOptional<z.ZodNumber>;
126
+ validityMs: z.ZodOptional<z.ZodNumber>;
127
+ resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
128
+ allowedSensitivity: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
129
+ requiresOversight: z.ZodOptional<z.ZodBoolean>;
130
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ custom?: Record<string, unknown> | undefined;
133
+ maxOperations?: number | undefined;
134
+ validityMs?: number | undefined;
135
+ resources?: string[] | undefined;
136
+ allowedSensitivity?: string[] | undefined;
137
+ requiresOversight?: boolean | undefined;
138
+ }, {
139
+ custom?: Record<string, unknown> | undefined;
140
+ maxOperations?: number | undefined;
141
+ validityMs?: number | undefined;
142
+ resources?: string[] | undefined;
143
+ allowedSensitivity?: string[] | undefined;
144
+ requiresOversight?: boolean | undefined;
145
+ }>>;
146
+ remediations: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString, "many">>>;
147
+ expiresAt: z.ZodOptional<z.ZodDate>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ allowed: boolean;
150
+ constraints?: {
151
+ custom?: Record<string, unknown> | undefined;
152
+ maxOperations?: number | undefined;
153
+ validityMs?: number | undefined;
154
+ resources?: string[] | undefined;
155
+ allowedSensitivity?: string[] | undefined;
156
+ requiresOversight?: boolean | undefined;
157
+ } | undefined;
158
+ expiresAt?: Date | undefined;
159
+ denialReason?: DenialReason | undefined;
160
+ reason?: string | undefined;
161
+ governanceDenialReason?: GovernanceDenialReason | undefined;
162
+ matchedRoles?: readonly string[] | undefined;
163
+ matchedPermissions?: readonly string[] | undefined;
164
+ remediations?: readonly string[] | undefined;
165
+ }, {
166
+ allowed: boolean;
167
+ constraints?: {
168
+ custom?: Record<string, unknown> | undefined;
169
+ maxOperations?: number | undefined;
170
+ validityMs?: number | undefined;
171
+ resources?: string[] | undefined;
172
+ allowedSensitivity?: string[] | undefined;
173
+ requiresOversight?: boolean | undefined;
174
+ } | undefined;
175
+ expiresAt?: Date | undefined;
176
+ denialReason?: DenialReason | undefined;
177
+ reason?: string | undefined;
178
+ governanceDenialReason?: GovernanceDenialReason | undefined;
179
+ matchedRoles?: readonly string[] | undefined;
180
+ matchedPermissions?: readonly string[] | undefined;
181
+ remediations?: readonly string[] | undefined;
182
+ }>;
183
+ /** TypeScript type inferred from the Zod schema */
184
+ export type AuthorizationResultType = z.infer<typeof authorizationResultSchema>;
185
+ /**
186
+ * Governance roles for permission-based access control.
187
+ *
188
+ * Defines roles specific to governance operations.
189
+ * These roles determine what governance actions a user can perform.
190
+ *
191
+ * Note: For user management roles, see UserRole in agent.ts
192
+ */
193
+ export type GovernanceRole = 'admin' | 'operator' | 'trainer' | 'consumer' | 'reviewer' | 'both';
194
+ /**
195
+ * Zod schema for GovernanceRole validation.
196
+ */
197
+ export declare const governanceRoleSchema: z.ZodEnum<["admin", "operator", "trainer", "consumer", "reviewer", "both"]>;
198
+ /**
199
+ * Authentication context for an authenticated user/entity.
200
+ *
201
+ * Contains identity information extracted from JWT tokens or session data.
202
+ * Used throughout the system to make authorization decisions.
203
+ */
204
+ export interface AuthContext {
205
+ /** Unique identifier for the authenticated user */
206
+ readonly userId: string;
207
+ /** Tenant/organization the user belongs to */
208
+ readonly tenantId: string;
209
+ /** Roles assigned to the user */
210
+ readonly roles: readonly string[];
211
+ /** Fine-grained permissions assigned to the user */
212
+ readonly permissions: readonly string[];
213
+ /** User's primary governance role (for UI/simple RBAC) */
214
+ readonly governanceRole?: GovernanceRole;
215
+ /** Current session identifier */
216
+ readonly sessionId?: string;
217
+ /** Agent ID if this context represents an agent */
218
+ readonly agentId?: string;
219
+ /** Hierarchy level if this context represents a hierarchical entity */
220
+ readonly hierarchyLevel?: HierarchyLevel;
221
+ /** Additional attributes from the authentication source */
222
+ readonly attributes?: Readonly<Record<string, unknown>>;
223
+ }
224
+ /**
225
+ * Zod schema for AuthContext.
226
+ */
227
+ export declare const authContextSchema: z.ZodObject<{
228
+ userId: z.ZodString;
229
+ tenantId: z.ZodString;
230
+ roles: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
231
+ permissions: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
232
+ governanceRole: z.ZodOptional<z.ZodEnum<["admin", "operator", "trainer", "consumer", "reviewer", "both"]>>;
233
+ sessionId: z.ZodOptional<z.ZodString>;
234
+ agentId: z.ZodOptional<z.ZodString>;
235
+ hierarchyLevel: z.ZodOptional<z.ZodLazy<z.ZodEnum<["hitl", "orch", "metagoat", "agent", "bot"]>>>;
236
+ attributes: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ userId: string;
239
+ permissions: readonly string[];
240
+ tenantId: string;
241
+ roles: readonly string[];
242
+ agentId?: string | undefined;
243
+ sessionId?: string | undefined;
244
+ governanceRole?: "admin" | "operator" | "both" | "trainer" | "consumer" | "reviewer" | undefined;
245
+ hierarchyLevel?: "agent" | "hitl" | "orch" | "metagoat" | "bot" | undefined;
246
+ attributes?: Readonly<Record<string, unknown>> | undefined;
247
+ }, {
248
+ userId: string;
249
+ permissions: readonly string[];
250
+ tenantId: string;
251
+ roles: readonly string[];
252
+ agentId?: string | undefined;
253
+ sessionId?: string | undefined;
254
+ governanceRole?: "admin" | "operator" | "both" | "trainer" | "consumer" | "reviewer" | undefined;
255
+ hierarchyLevel?: "agent" | "hitl" | "orch" | "metagoat" | "bot" | undefined;
256
+ attributes?: Readonly<Record<string, unknown>> | undefined;
257
+ }>;
258
+ /** TypeScript type inferred from the Zod schema */
259
+ export type AuthContextType = z.infer<typeof authContextSchema>;
260
+ /**
261
+ * Canonical hierarchy levels for agent/entity organization.
262
+ *
263
+ * The platform supports two hierarchy models that can be unified:
264
+ *
265
+ * **Named Hierarchy** (5 tiers, semantic):
266
+ * - HITL: Human-In-The-Loop (ultimate authority)
267
+ * - ORCH: Orchestrators (workflow coordination)
268
+ * - METAGOAT: Meta-agents (optimization/training)
269
+ * - AGENT: Domain specialists (task execution)
270
+ * - BOT: User-facing interfaces
271
+ *
272
+ * **Numbered Hierarchy** (9 tiers, granular):
273
+ * - L8: Mission stewardship (equivalent to HITL)
274
+ * - L7-L5: Strategic/organizational levels
275
+ * - L4-L3: Project/coordination levels (ORCH)
276
+ * - L2: Planning level (METAGOAT)
277
+ * - L1: Execution level (AGENT)
278
+ * - L0: Interface level (BOT)
279
+ *
280
+ * The canonical definition uses the named approach with numeric tiers
281
+ * for granularity within each named level.
282
+ */
283
+ export type HierarchyLevel = 'hitl' | 'orch' | 'metagoat' | 'agent' | 'bot';
284
+ /**
285
+ * Zod schema for HierarchyLevel validation.
286
+ */
287
+ export declare const hierarchyLevelSchema: z.ZodEnum<["hitl", "orch", "metagoat", "agent", "bot"]>;
288
+ /**
289
+ * Numeric tier mapping for hierarchy levels.
290
+ * Lower numbers = higher authority.
291
+ */
292
+ export declare const HIERARCHY_TIERS: Readonly<Record<HierarchyLevel, number>>;
293
+ /**
294
+ * Array of hierarchy levels in authority order (highest first).
295
+ */
296
+ export declare const HIERARCHY_ORDER: readonly HierarchyLevel[];
297
+ /**
298
+ * Configuration for a hierarchy level.
299
+ */
300
+ export interface HierarchyLevelConfig {
301
+ /** The hierarchy level */
302
+ readonly level: HierarchyLevel;
303
+ /** Numeric tier (0 = highest authority) */
304
+ readonly tier: number;
305
+ /** Human-readable name */
306
+ readonly name: string;
307
+ /** Description of the level's responsibilities */
308
+ readonly description: string;
309
+ /** Scope of authority for this level */
310
+ readonly authorityScope: AuthorityScopeType;
311
+ /** Authority score (0-100, higher = more authority) */
312
+ readonly authority: number;
313
+ /** Levels this entity can delegate to */
314
+ readonly canDelegate: readonly HierarchyLevel[];
315
+ /** Level this entity reports to (null for HITL) */
316
+ readonly reportsTo: HierarchyLevel | null;
317
+ /** Maximum autonomy level (1-7) */
318
+ readonly maxAutonomyLevel: number;
319
+ /** Whether this level can train other entities */
320
+ readonly canTrainOthers: boolean;
321
+ /** Whether this level can approve other entities */
322
+ readonly canApproveOthers: boolean;
323
+ /** Whether human oversight is required for this level */
324
+ readonly requiresHumanOversight: boolean;
325
+ /** Minimum trust score required (0-1000) */
326
+ readonly minTrustScore: number;
327
+ }
328
+ /**
329
+ * Canonical hierarchy level configurations.
330
+ */
331
+ export declare const HIERARCHY_LEVELS: Readonly<Record<HierarchyLevel, HierarchyLevelConfig>>;
332
+ /**
333
+ * Zod schema for HierarchyLevelConfig.
334
+ */
335
+ export declare const hierarchyLevelConfigSchema: z.ZodObject<{
336
+ level: z.ZodEnum<["hitl", "orch", "metagoat", "agent", "bot"]>;
337
+ tier: z.ZodNumber;
338
+ name: z.ZodString;
339
+ description: z.ZodString;
340
+ authorityScope: z.ZodLazy<z.ZodEnum<["governance", "coordination", "management", "execution", "interaction"]>>;
341
+ authority: z.ZodNumber;
342
+ canDelegate: z.ZodReadonly<z.ZodArray<z.ZodEnum<["hitl", "orch", "metagoat", "agent", "bot"]>, "many">>;
343
+ reportsTo: z.ZodNullable<z.ZodEnum<["hitl", "orch", "metagoat", "agent", "bot"]>>;
344
+ maxAutonomyLevel: z.ZodNumber;
345
+ canTrainOthers: z.ZodBoolean;
346
+ canApproveOthers: z.ZodBoolean;
347
+ requiresHumanOversight: z.ZodBoolean;
348
+ minTrustScore: z.ZodNumber;
349
+ }, "strip", z.ZodTypeAny, {
350
+ name: string;
351
+ description: string;
352
+ minTrustScore: number;
353
+ level: "agent" | "hitl" | "orch" | "metagoat" | "bot";
354
+ tier: number;
355
+ authorityScope: "governance" | "coordination" | "management" | "execution" | "interaction";
356
+ authority: number;
357
+ canDelegate: readonly ("agent" | "hitl" | "orch" | "metagoat" | "bot")[];
358
+ reportsTo: "agent" | "hitl" | "orch" | "metagoat" | "bot" | null;
359
+ maxAutonomyLevel: number;
360
+ canTrainOthers: boolean;
361
+ canApproveOthers: boolean;
362
+ requiresHumanOversight: boolean;
363
+ }, {
364
+ name: string;
365
+ description: string;
366
+ minTrustScore: number;
367
+ level: "agent" | "hitl" | "orch" | "metagoat" | "bot";
368
+ tier: number;
369
+ authorityScope: "governance" | "coordination" | "management" | "execution" | "interaction";
370
+ authority: number;
371
+ canDelegate: readonly ("agent" | "hitl" | "orch" | "metagoat" | "bot")[];
372
+ reportsTo: "agent" | "hitl" | "orch" | "metagoat" | "bot" | null;
373
+ maxAutonomyLevel: number;
374
+ canTrainOthers: boolean;
375
+ canApproveOthers: boolean;
376
+ requiresHumanOversight: boolean;
377
+ }>;
378
+ /**
379
+ * Authority scope types defining what kind of authority an entity has.
380
+ */
381
+ export type AuthorityScopeType = 'governance' | 'coordination' | 'management' | 'execution' | 'interaction';
382
+ /**
383
+ * Zod schema for AuthorityScopeType validation.
384
+ */
385
+ export declare const authorityScopeTypeSchema: z.ZodEnum<["governance", "coordination", "management", "execution", "interaction"]>;
386
+ /**
387
+ * Control actions that can be taken by governance rules.
388
+ */
389
+ export type ControlAction = 'allow' | 'deny' | 'constrain' | 'clarify' | 'escalate' | 'log' | 'audit';
390
+ /**
391
+ * Zod schema for ControlAction validation.
392
+ */
393
+ export declare const controlActionSchema: z.ZodEnum<["allow", "deny", "constrain", "clarify", "escalate", "log", "audit"]>;
394
+ /**
395
+ * Detailed authority scope definition.
396
+ *
397
+ * Defines the specific boundaries of an authority, including what namespaces,
398
+ * actions, resources, and capabilities fall under its purview.
399
+ */
400
+ export interface AuthorityScope {
401
+ /** High-level type of authority */
402
+ readonly type: AuthorityScopeType;
403
+ /** Namespaces this authority applies to */
404
+ readonly namespaces: readonly string[];
405
+ /** Actions this authority can authorize */
406
+ readonly actions: readonly ControlAction[];
407
+ /** Resource patterns this authority applies to */
408
+ readonly resources: readonly string[];
409
+ /** Capabilities this authority can grant */
410
+ readonly capabilities: readonly string[];
411
+ /** Time-based restrictions */
412
+ readonly timeRestrictions?: AuthorityScopeTimeRestriction;
413
+ /** Geographic or context-based restrictions */
414
+ readonly contextRestrictions?: Readonly<Record<string, unknown>>;
415
+ }
416
+ /**
417
+ * Time-based restrictions for an authority scope.
418
+ */
419
+ export interface AuthorityScopeTimeRestriction {
420
+ /** Days of week when authority is valid (0=Sunday) */
421
+ readonly daysOfWeek?: readonly number[];
422
+ /** Start time (HH:MM format) */
423
+ readonly startTime?: string;
424
+ /** End time (HH:MM format) */
425
+ readonly endTime?: string;
426
+ /** Timezone for time restrictions */
427
+ readonly timezone?: string;
428
+ }
429
+ /**
430
+ * Zod schema for AuthorityScopeTimeRestriction.
431
+ */
432
+ export declare const authorityScopeTimeRestrictionSchema: z.ZodObject<{
433
+ daysOfWeek: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber, "many">>>;
434
+ startTime: z.ZodOptional<z.ZodString>;
435
+ endTime: z.ZodOptional<z.ZodString>;
436
+ timezone: z.ZodOptional<z.ZodString>;
437
+ }, "strip", z.ZodTypeAny, {
438
+ startTime?: string | undefined;
439
+ endTime?: string | undefined;
440
+ daysOfWeek?: readonly number[] | undefined;
441
+ timezone?: string | undefined;
442
+ }, {
443
+ startTime?: string | undefined;
444
+ endTime?: string | undefined;
445
+ daysOfWeek?: readonly number[] | undefined;
446
+ timezone?: string | undefined;
447
+ }>;
448
+ /**
449
+ * Zod schema for AuthorityScope.
450
+ */
451
+ export declare const authorityScopeSchema: z.ZodObject<{
452
+ type: z.ZodEnum<["governance", "coordination", "management", "execution", "interaction"]>;
453
+ namespaces: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
454
+ actions: z.ZodReadonly<z.ZodArray<z.ZodEnum<["allow", "deny", "constrain", "clarify", "escalate", "log", "audit"]>, "many">>;
455
+ resources: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
456
+ capabilities: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
457
+ timeRestrictions: z.ZodOptional<z.ZodObject<{
458
+ daysOfWeek: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber, "many">>>;
459
+ startTime: z.ZodOptional<z.ZodString>;
460
+ endTime: z.ZodOptional<z.ZodString>;
461
+ timezone: z.ZodOptional<z.ZodString>;
462
+ }, "strip", z.ZodTypeAny, {
463
+ startTime?: string | undefined;
464
+ endTime?: string | undefined;
465
+ daysOfWeek?: readonly number[] | undefined;
466
+ timezone?: string | undefined;
467
+ }, {
468
+ startTime?: string | undefined;
469
+ endTime?: string | undefined;
470
+ daysOfWeek?: readonly number[] | undefined;
471
+ timezone?: string | undefined;
472
+ }>>;
473
+ contextRestrictions: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
474
+ }, "strip", z.ZodTypeAny, {
475
+ type: "governance" | "coordination" | "management" | "execution" | "interaction";
476
+ capabilities: readonly string[];
477
+ resources: readonly string[];
478
+ namespaces: readonly string[];
479
+ actions: readonly ("audit" | "deny" | "allow" | "constrain" | "clarify" | "escalate" | "log")[];
480
+ timeRestrictions?: {
481
+ startTime?: string | undefined;
482
+ endTime?: string | undefined;
483
+ daysOfWeek?: readonly number[] | undefined;
484
+ timezone?: string | undefined;
485
+ } | undefined;
486
+ contextRestrictions?: Readonly<Record<string, unknown>> | undefined;
487
+ }, {
488
+ type: "governance" | "coordination" | "management" | "execution" | "interaction";
489
+ capabilities: readonly string[];
490
+ resources: readonly string[];
491
+ namespaces: readonly string[];
492
+ actions: readonly ("audit" | "deny" | "allow" | "constrain" | "clarify" | "escalate" | "log")[];
493
+ timeRestrictions?: {
494
+ startTime?: string | undefined;
495
+ endTime?: string | undefined;
496
+ daysOfWeek?: readonly number[] | undefined;
497
+ timezone?: string | undefined;
498
+ } | undefined;
499
+ contextRestrictions?: Readonly<Record<string, unknown>> | undefined;
500
+ }>;
501
+ /** TypeScript type inferred from the Zod schema */
502
+ export type AuthorityScopeZodType = z.infer<typeof authorityScopeSchema>;
503
+ /**
504
+ * Types of authority that can be held.
505
+ */
506
+ export type AuthorityType = 'system' | 'role' | 'delegated' | 'temporary' | 'emergency';
507
+ /**
508
+ * Zod schema for AuthorityType validation.
509
+ */
510
+ export declare const authorityTypeSchema: z.ZodEnum<["system", "role", "delegated", "temporary", "emergency"]>;
511
+ /**
512
+ * Complete authority definition.
513
+ *
514
+ * Represents a grant of authority to perform specific actions within
515
+ * defined scopes, with associated permissions and constraints.
516
+ */
517
+ export interface Authority {
518
+ /** Unique identifier for this authority */
519
+ readonly authorityId: string;
520
+ /** Human-readable name */
521
+ readonly name: string;
522
+ /** Type of authority */
523
+ readonly type: AuthorityType;
524
+ /** Scope of this authority */
525
+ readonly scope: AuthorityScope;
526
+ /** Specific permissions granted */
527
+ readonly permissions: readonly Permission[];
528
+ /** Authority this was delegated from (if delegated) */
529
+ readonly delegatedFrom?: string;
530
+ /** Minimum trust level required to use this authority */
531
+ readonly requiredTrustLevel: number;
532
+ /** When this authority expires */
533
+ readonly expiresAt?: Date;
534
+ /** Whether this authority is currently active */
535
+ readonly active: boolean;
536
+ /** Audit metadata */
537
+ readonly audit: AuthorityAudit;
538
+ }
539
+ /**
540
+ * Permission granted by an authority.
541
+ */
542
+ export interface Permission {
543
+ /** Unique identifier for this permission */
544
+ readonly permissionId: string;
545
+ /** Action this permission allows */
546
+ readonly action: string;
547
+ /** Resource this permission applies to */
548
+ readonly resource: string;
549
+ /** Conditions that must be met for the permission to apply */
550
+ readonly conditions?: Readonly<Record<string, unknown>>;
551
+ /** Whether the permission is granted (true) or denied (false) */
552
+ readonly granted: boolean;
553
+ }
554
+ /**
555
+ * Audit information for an authority.
556
+ */
557
+ export interface AuthorityAudit {
558
+ /** When the authority was created */
559
+ readonly createdAt: Date;
560
+ /** Who created the authority */
561
+ readonly createdBy: string;
562
+ /** When the authority was last updated */
563
+ readonly updatedAt: Date;
564
+ /** Who last updated the authority */
565
+ readonly updatedBy: string;
566
+ /** When the authority was approved (if required) */
567
+ readonly approvedAt?: Date;
568
+ /** Who approved the authority */
569
+ readonly approvedBy?: string;
570
+ }
571
+ /**
572
+ * Zod schema for Permission.
573
+ */
574
+ export declare const permissionSchema: z.ZodObject<{
575
+ permissionId: z.ZodString;
576
+ action: z.ZodString;
577
+ resource: z.ZodString;
578
+ conditions: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
579
+ granted: z.ZodBoolean;
580
+ }, "strip", z.ZodTypeAny, {
581
+ action: string;
582
+ permissionId: string;
583
+ resource: string;
584
+ granted: boolean;
585
+ conditions?: Readonly<Record<string, unknown>> | undefined;
586
+ }, {
587
+ action: string;
588
+ permissionId: string;
589
+ resource: string;
590
+ granted: boolean;
591
+ conditions?: Readonly<Record<string, unknown>> | undefined;
592
+ }>;
593
+ /**
594
+ * Zod schema for AuthorityAudit.
595
+ */
596
+ export declare const authorityAuditSchema: z.ZodObject<{
597
+ createdAt: z.ZodDate;
598
+ createdBy: z.ZodString;
599
+ updatedAt: z.ZodDate;
600
+ updatedBy: z.ZodString;
601
+ approvedAt: z.ZodOptional<z.ZodDate>;
602
+ approvedBy: z.ZodOptional<z.ZodString>;
603
+ }, "strip", z.ZodTypeAny, {
604
+ createdAt: Date;
605
+ updatedAt: Date;
606
+ createdBy: string;
607
+ updatedBy: string;
608
+ approvedBy?: string | undefined;
609
+ approvedAt?: Date | undefined;
610
+ }, {
611
+ createdAt: Date;
612
+ updatedAt: Date;
613
+ createdBy: string;
614
+ updatedBy: string;
615
+ approvedBy?: string | undefined;
616
+ approvedAt?: Date | undefined;
617
+ }>;
618
+ /**
619
+ * Zod schema for Authority.
620
+ */
621
+ export declare const authoritySchema: z.ZodObject<{
622
+ authorityId: z.ZodString;
623
+ name: z.ZodString;
624
+ type: z.ZodEnum<["system", "role", "delegated", "temporary", "emergency"]>;
625
+ scope: z.ZodObject<{
626
+ type: z.ZodEnum<["governance", "coordination", "management", "execution", "interaction"]>;
627
+ namespaces: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
628
+ actions: z.ZodReadonly<z.ZodArray<z.ZodEnum<["allow", "deny", "constrain", "clarify", "escalate", "log", "audit"]>, "many">>;
629
+ resources: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
630
+ capabilities: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
631
+ timeRestrictions: z.ZodOptional<z.ZodObject<{
632
+ daysOfWeek: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodNumber, "many">>>;
633
+ startTime: z.ZodOptional<z.ZodString>;
634
+ endTime: z.ZodOptional<z.ZodString>;
635
+ timezone: z.ZodOptional<z.ZodString>;
636
+ }, "strip", z.ZodTypeAny, {
637
+ startTime?: string | undefined;
638
+ endTime?: string | undefined;
639
+ daysOfWeek?: readonly number[] | undefined;
640
+ timezone?: string | undefined;
641
+ }, {
642
+ startTime?: string | undefined;
643
+ endTime?: string | undefined;
644
+ daysOfWeek?: readonly number[] | undefined;
645
+ timezone?: string | undefined;
646
+ }>>;
647
+ contextRestrictions: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
648
+ }, "strip", z.ZodTypeAny, {
649
+ type: "governance" | "coordination" | "management" | "execution" | "interaction";
650
+ capabilities: readonly string[];
651
+ resources: readonly string[];
652
+ namespaces: readonly string[];
653
+ actions: readonly ("audit" | "deny" | "allow" | "constrain" | "clarify" | "escalate" | "log")[];
654
+ timeRestrictions?: {
655
+ startTime?: string | undefined;
656
+ endTime?: string | undefined;
657
+ daysOfWeek?: readonly number[] | undefined;
658
+ timezone?: string | undefined;
659
+ } | undefined;
660
+ contextRestrictions?: Readonly<Record<string, unknown>> | undefined;
661
+ }, {
662
+ type: "governance" | "coordination" | "management" | "execution" | "interaction";
663
+ capabilities: readonly string[];
664
+ resources: readonly string[];
665
+ namespaces: readonly string[];
666
+ actions: readonly ("audit" | "deny" | "allow" | "constrain" | "clarify" | "escalate" | "log")[];
667
+ timeRestrictions?: {
668
+ startTime?: string | undefined;
669
+ endTime?: string | undefined;
670
+ daysOfWeek?: readonly number[] | undefined;
671
+ timezone?: string | undefined;
672
+ } | undefined;
673
+ contextRestrictions?: Readonly<Record<string, unknown>> | undefined;
674
+ }>;
675
+ permissions: z.ZodReadonly<z.ZodArray<z.ZodObject<{
676
+ permissionId: z.ZodString;
677
+ action: z.ZodString;
678
+ resource: z.ZodString;
679
+ conditions: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
680
+ granted: z.ZodBoolean;
681
+ }, "strip", z.ZodTypeAny, {
682
+ action: string;
683
+ permissionId: string;
684
+ resource: string;
685
+ granted: boolean;
686
+ conditions?: Readonly<Record<string, unknown>> | undefined;
687
+ }, {
688
+ action: string;
689
+ permissionId: string;
690
+ resource: string;
691
+ granted: boolean;
692
+ conditions?: Readonly<Record<string, unknown>> | undefined;
693
+ }>, "many">>;
694
+ delegatedFrom: z.ZodOptional<z.ZodString>;
695
+ requiredTrustLevel: z.ZodNumber;
696
+ expiresAt: z.ZodOptional<z.ZodDate>;
697
+ active: z.ZodBoolean;
698
+ audit: z.ZodObject<{
699
+ createdAt: z.ZodDate;
700
+ createdBy: z.ZodString;
701
+ updatedAt: z.ZodDate;
702
+ updatedBy: z.ZodString;
703
+ approvedAt: z.ZodOptional<z.ZodDate>;
704
+ approvedBy: z.ZodOptional<z.ZodString>;
705
+ }, "strip", z.ZodTypeAny, {
706
+ createdAt: Date;
707
+ updatedAt: Date;
708
+ createdBy: string;
709
+ updatedBy: string;
710
+ approvedBy?: string | undefined;
711
+ approvedAt?: Date | undefined;
712
+ }, {
713
+ createdAt: Date;
714
+ updatedAt: Date;
715
+ createdBy: string;
716
+ updatedBy: string;
717
+ approvedBy?: string | undefined;
718
+ approvedAt?: Date | undefined;
719
+ }>;
720
+ }, "strip", z.ZodTypeAny, {
721
+ active: boolean;
722
+ audit: {
723
+ createdAt: Date;
724
+ updatedAt: Date;
725
+ createdBy: string;
726
+ updatedBy: string;
727
+ approvedBy?: string | undefined;
728
+ approvedAt?: Date | undefined;
729
+ };
730
+ type: "delegated" | "system" | "role" | "temporary" | "emergency";
731
+ name: string;
732
+ scope: {
733
+ type: "governance" | "coordination" | "management" | "execution" | "interaction";
734
+ capabilities: readonly string[];
735
+ resources: readonly string[];
736
+ namespaces: readonly string[];
737
+ actions: readonly ("audit" | "deny" | "allow" | "constrain" | "clarify" | "escalate" | "log")[];
738
+ timeRestrictions?: {
739
+ startTime?: string | undefined;
740
+ endTime?: string | undefined;
741
+ daysOfWeek?: readonly number[] | undefined;
742
+ timezone?: string | undefined;
743
+ } | undefined;
744
+ contextRestrictions?: Readonly<Record<string, unknown>> | undefined;
745
+ };
746
+ permissions: readonly {
747
+ action: string;
748
+ permissionId: string;
749
+ resource: string;
750
+ granted: boolean;
751
+ conditions?: Readonly<Record<string, unknown>> | undefined;
752
+ }[];
753
+ authorityId: string;
754
+ requiredTrustLevel: number;
755
+ expiresAt?: Date | undefined;
756
+ delegatedFrom?: string | undefined;
757
+ }, {
758
+ active: boolean;
759
+ audit: {
760
+ createdAt: Date;
761
+ updatedAt: Date;
762
+ createdBy: string;
763
+ updatedBy: string;
764
+ approvedBy?: string | undefined;
765
+ approvedAt?: Date | undefined;
766
+ };
767
+ type: "delegated" | "system" | "role" | "temporary" | "emergency";
768
+ name: string;
769
+ scope: {
770
+ type: "governance" | "coordination" | "management" | "execution" | "interaction";
771
+ capabilities: readonly string[];
772
+ resources: readonly string[];
773
+ namespaces: readonly string[];
774
+ actions: readonly ("audit" | "deny" | "allow" | "constrain" | "clarify" | "escalate" | "log")[];
775
+ timeRestrictions?: {
776
+ startTime?: string | undefined;
777
+ endTime?: string | undefined;
778
+ daysOfWeek?: readonly number[] | undefined;
779
+ timezone?: string | undefined;
780
+ } | undefined;
781
+ contextRestrictions?: Readonly<Record<string, unknown>> | undefined;
782
+ };
783
+ permissions: readonly {
784
+ action: string;
785
+ permissionId: string;
786
+ resource: string;
787
+ granted: boolean;
788
+ conditions?: Readonly<Record<string, unknown>> | undefined;
789
+ }[];
790
+ authorityId: string;
791
+ requiredTrustLevel: number;
792
+ expiresAt?: Date | undefined;
793
+ delegatedFrom?: string | undefined;
794
+ }>;
795
+ /** TypeScript type inferred from the Zod schema */
796
+ export type AuthorityZodType = z.infer<typeof authoritySchema>;
797
+ /**
798
+ * Gets the numeric tier for a hierarchy level.
799
+ *
800
+ * @param level - The hierarchy level
801
+ * @returns The numeric tier (0 = highest authority)
802
+ */
803
+ export declare function getHierarchyTier(level: HierarchyLevel): number;
804
+ /**
805
+ * Gets the configuration for a hierarchy level.
806
+ *
807
+ * @param level - The hierarchy level
808
+ * @returns The level configuration
809
+ */
810
+ export declare function getHierarchyLevelConfig(level: HierarchyLevel): HierarchyLevelConfig;
811
+ /**
812
+ * Checks if one hierarchy level has higher authority than another.
813
+ *
814
+ * @param a - First hierarchy level
815
+ * @param b - Second hierarchy level
816
+ * @returns True if a has higher authority than b
817
+ */
818
+ export declare function isHigherAuthority(a: HierarchyLevel, b: HierarchyLevel): boolean;
819
+ /**
820
+ * Checks if a hierarchy level can delegate to another level.
821
+ *
822
+ * @param from - The delegating level
823
+ * @param to - The target level
824
+ * @returns True if delegation is allowed
825
+ */
826
+ export declare function canDelegate(from: HierarchyLevel, to: HierarchyLevel): boolean;
827
+ /**
828
+ * Gets the reporting chain for a hierarchy level.
829
+ *
830
+ * @param level - The starting hierarchy level
831
+ * @returns Array of levels in the reporting chain (from top to starting level)
832
+ */
833
+ export declare function getReportingChain(level: HierarchyLevel): HierarchyLevel[];
834
+ /**
835
+ * Checks if a trust score meets the minimum requirement for a hierarchy level.
836
+ *
837
+ * @param level - The hierarchy level
838
+ * @param trustScore - The trust score to check (0-1000)
839
+ * @returns True if the trust score meets the minimum
840
+ */
841
+ export declare function meetsMinimumTrust(level: HierarchyLevel, trustScore: number): boolean;
842
+ /**
843
+ * Creates an allowed authorization result.
844
+ *
845
+ * @param options - Optional parameters for the result
846
+ * @returns An allowed AuthorizationResult
847
+ */
848
+ export declare function createAllowedResult(options?: {
849
+ reason?: string;
850
+ matchedRoles?: string[];
851
+ matchedPermissions?: string[];
852
+ constraints?: AuthorizationConstraints;
853
+ expiresAt?: Date;
854
+ }): AuthorizationResult;
855
+ /**
856
+ * Creates a denied authorization result for trust/policy denials.
857
+ *
858
+ * @param denialReason - The reason for denial (from DenialReason enum)
859
+ * @param options - Optional parameters for the result
860
+ * @returns A denied AuthorizationResult
861
+ */
862
+ export declare function createDeniedResult(denialReason: DenialReason, options?: {
863
+ reason?: string;
864
+ remediations?: string[];
865
+ }): AuthorizationResult;
866
+ /**
867
+ * Creates a denied authorization result for governance/RBAC denials.
868
+ *
869
+ * @param governanceDenialReason - The reason for denial (from GovernanceDenialReason enum)
870
+ * @param options - Optional parameters for the result
871
+ * @returns A denied AuthorizationResult
872
+ */
873
+ export declare function createGovernanceDeniedResult(governanceDenialReason: GovernanceDenialReason, options?: {
874
+ reason?: string;
875
+ remediations?: string[];
876
+ }): AuthorizationResult;
877
+ /**
878
+ * Type guard to check if a value is a valid HierarchyLevel.
879
+ *
880
+ * @param value - Value to check
881
+ * @returns True if value is a valid HierarchyLevel
882
+ */
883
+ export declare function isHierarchyLevel(value: unknown): value is HierarchyLevel;
884
+ /**
885
+ * Type guard to check if a value is a valid AuthorityScopeType.
886
+ *
887
+ * @param value - Value to check
888
+ * @returns True if value is a valid AuthorityScopeType
889
+ */
890
+ export declare function isAuthorityScopeType(value: unknown): value is AuthorityScopeType;
891
+ /**
892
+ * Maps numbered hierarchy levels (L0-L8) to canonical named levels.
893
+ *
894
+ * @deprecated Use HierarchyLevel directly. This is for migration only.
895
+ */
896
+ export declare const NUMBERED_LEVEL_TO_NAMED: Readonly<Record<string, HierarchyLevel>>;
897
+ /**
898
+ * Converts a numbered level to a named hierarchy level.
899
+ *
900
+ * @deprecated Use HierarchyLevel directly. This is for migration only.
901
+ * @param numberedLevel - Numbered level string (L0-L8)
902
+ * @returns The corresponding named HierarchyLevel
903
+ */
904
+ export declare function numberedToNamedLevel(numberedLevel: string): HierarchyLevel;
905
+ //# sourceMappingURL=governance.d.ts.map