@odingard/guardian-sdk 0.0.0-stage → 0.2.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 (58) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +302 -2
  3. package/dist/contracts.js +9865 -0
  4. package/dist/index.js +14437 -0
  5. package/dist/public-catalog.v1.json +6915 -0
  6. package/dist-dts/catalog.d.ts +14 -0
  7. package/dist-dts/client.d.ts +130 -0
  8. package/dist-dts/contracts/action-pack.d.ts +464 -0
  9. package/dist-dts/contracts/action-parameters.d.ts +34 -0
  10. package/dist-dts/contracts/action-registry.d.ts +287 -0
  11. package/dist-dts/contracts/action.d.ts +2358 -0
  12. package/dist-dts/contracts/agent-state.d.ts +386 -0
  13. package/dist-dts/contracts/api.d.ts +78 -0
  14. package/dist-dts/contracts/approval.d.ts +425 -0
  15. package/dist-dts/contracts/assurance.d.ts +60 -0
  16. package/dist-dts/contracts/authority-graph.d.ts +294 -0
  17. package/dist-dts/contracts/authority-state.d.ts +108 -0
  18. package/dist-dts/contracts/authority.d.ts +339 -0
  19. package/dist-dts/contracts/billing.d.ts +32 -0
  20. package/dist-dts/contracts/calendar.d.ts +146 -0
  21. package/dist-dts/contracts/canonical-json.d.ts +4 -0
  22. package/dist-dts/contracts/capability.d.ts +28 -0
  23. package/dist-dts/contracts/commerce.d.ts +133 -0
  24. package/dist-dts/contracts/denial.d.ts +648 -0
  25. package/dist-dts/contracts/digest.d.ts +2 -0
  26. package/dist-dts/contracts/email.d.ts +45 -0
  27. package/dist-dts/contracts/evidence.d.ts +1087 -0
  28. package/dist-dts/contracts/execution.d.ts +1732 -0
  29. package/dist-dts/contracts/files.d.ts +61 -0
  30. package/dist-dts/contracts/identifiers.d.ts +49 -0
  31. package/dist-dts/contracts/index.d.ts +41 -0
  32. package/dist-dts/contracts/intent.d.ts +335 -0
  33. package/dist-dts/contracts/lineage.d.ts +218 -0
  34. package/dist-dts/contracts/local.d.ts +101 -0
  35. package/dist-dts/contracts/multi-principal.d.ts +292 -0
  36. package/dist-dts/contracts/multiparty.d.ts +169 -0
  37. package/dist-dts/contracts/obligation.d.ts +196 -0
  38. package/dist-dts/contracts/plan.d.ts +67 -0
  39. package/dist-dts/contracts/policy-simulation.d.ts +681 -0
  40. package/dist-dts/contracts/prerequisite.d.ts +147 -0
  41. package/dist-dts/contracts/protected-data.d.ts +160 -0
  42. package/dist-dts/contracts/receipt.d.ts +3126 -0
  43. package/dist-dts/contracts/resource-claims.d.ts +146 -0
  44. package/dist-dts/contracts/runtime.d.ts +111 -0
  45. package/dist-dts/contracts/safety-envelope.d.ts +287 -0
  46. package/dist-dts/contracts/sequence.d.ts +132 -0
  47. package/dist-dts/contracts/sources.d.ts +191 -0
  48. package/dist-dts/contracts/tools.d.ts +232 -0
  49. package/dist-dts/contracts/transaction.d.ts +360 -0
  50. package/dist-dts/contracts-entry.d.ts +1 -0
  51. package/dist-dts/embedded.d.ts +58 -0
  52. package/dist-dts/evidence/evidence.d.ts +25 -0
  53. package/dist-dts/evidence/receipt.d.ts +61 -0
  54. package/dist-dts/index.d.ts +5 -0
  55. package/dist-dts/lifecycle.d.ts +25 -0
  56. package/dist-dts/proposal.d.ts +41 -0
  57. package/dist-dts/receipts.d.ts +37 -0
  58. package/package.json +56 -4
@@ -0,0 +1,425 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Agent-written prose is carried only as a labelled, explicitly non-authoritative
4
+ * statement. It never participates in authority evaluation or approval binding
5
+ * beyond being shown verbatim (and safely rendered) to the human.
6
+ */
7
+ export declare const AgentStatementSchema: z.ZodObject<{
8
+ source: z.ZodLiteral<"agent">;
9
+ authoritative: z.ZodLiteral<false>;
10
+ text: z.ZodString;
11
+ }, z.core.$strict>;
12
+ /**
13
+ * Guardian's own reason for asking the human. It is derived only from the
14
+ * server-held authority the deterministic kernel evaluated for the ASK decision
15
+ * and never contains agent input.
16
+ */
17
+ export declare const ApprovalReasonSchema: z.ZodObject<{
18
+ source: z.ZodLiteral<"guardian">;
19
+ code: z.ZodLiteral<"APPROVAL_REQUIRED">;
20
+ authority: z.ZodObject<{
21
+ policy: z.ZodObject<{
22
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
23
+ version: z.ZodNumber;
24
+ }, z.core.$strict>;
25
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
26
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
27
+ version: z.ZodNumber;
28
+ }, z.core.$strict>>;
29
+ }, z.core.$strict>;
30
+ }, z.core.$strict>;
31
+ /**
32
+ * Server-generated description of the exact canonical action a human is asked to
33
+ * decide. Every field is copied from server-held canonical action state; values
34
+ * the agent chose (parameters, purpose, initiating context, request identifier)
35
+ * remain agent assertions and must be presented with agent provenance.
36
+ */
37
+ export declare const ApprovalPresentationSchema: z.ZodObject<{
38
+ schemaVersion: z.ZodLiteral<1>;
39
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
40
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
41
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
42
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
43
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
44
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
45
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
46
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
47
+ adapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
48
+ interface: z.ZodEnum<{
49
+ mcp: "mcp";
50
+ rest: "rest";
51
+ internal: "internal";
52
+ }>;
53
+ initiatingContext: z.ZodEnum<{
54
+ agent: "agent";
55
+ user: "user";
56
+ scheduled: "scheduled";
57
+ "external-event": "external-event";
58
+ }>;
59
+ materialParameters: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, import("./canonical-json.js").CanonicalJsonValue>>, unknown>>;
60
+ valueCents: z.ZodOptional<z.ZodNumber>;
61
+ uses: z.ZodNumber;
62
+ agentStatement: z.ZodObject<{
63
+ source: z.ZodLiteral<"agent">;
64
+ authoritative: z.ZodLiteral<false>;
65
+ text: z.ZodString;
66
+ }, z.core.$strict>;
67
+ reason: z.ZodObject<{
68
+ source: z.ZodLiteral<"guardian">;
69
+ code: z.ZodLiteral<"APPROVAL_REQUIRED">;
70
+ authority: z.ZodObject<{
71
+ policy: z.ZodObject<{
72
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
73
+ version: z.ZodNumber;
74
+ }, z.core.$strict>;
75
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
76
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
77
+ version: z.ZodNumber;
78
+ }, z.core.$strict>>;
79
+ }, z.core.$strict>;
80
+ }, z.core.$strict>;
81
+ providedObligations: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
+ type: z.ZodEnum<{
83
+ log: "log";
84
+ retain_receipt: "retain_receipt";
85
+ notify: "notify";
86
+ delay: "delay";
87
+ cooling_period: "cooling_period";
88
+ delete_after_use: "delete_after_use";
89
+ redact: "redact";
90
+ encrypt: "encrypt";
91
+ tokenize: "tokenize";
92
+ minimize: "minimize";
93
+ verify_counterparty: "verify_counterparty";
94
+ verify_resource: "verify_resource";
95
+ verify_effect: "verify_effect";
96
+ attest_runtime: "attest_runtime";
97
+ require_consent: "require_consent";
98
+ require_location: "require_location";
99
+ require_device: "require_device";
100
+ require_network: "require_network";
101
+ require_contract: "require_contract";
102
+ step_up: "step_up";
103
+ second_approver: "second_approver";
104
+ quorum: "quorum";
105
+ authenticate: "authenticate";
106
+ }>;
107
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
108
+ }, z.core.$strict>>>;
109
+ runtimeTrustLevel: z.ZodOptional<z.ZodEnum<{
110
+ T0_UNKNOWN: "T0_UNKNOWN";
111
+ T1_IDENTIFIED: "T1_IDENTIFIED";
112
+ T2_VERIFIED: "T2_VERIFIED";
113
+ T3_ATTESTED: "T3_ATTESTED";
114
+ T4_HARDWARE_BACKED: "T4_HARDWARE_BACKED";
115
+ }>>;
116
+ enforcementAssurance: z.ZodOptional<z.ZodEnum<{
117
+ G2_CREDENTIAL_MEDIATED: "G2_CREDENTIAL_MEDIATED";
118
+ G1_POLICY_MEDIATED: "G1_POLICY_MEDIATED";
119
+ G3_RUNTIME_CONTAINED: "G3_RUNTIME_CONTAINED";
120
+ G0_OBSERVED: "G0_OBSERVED";
121
+ G4_COUNTERPARTY_INTERLOCKED: "G4_COUNTERPARTY_INTERLOCKED";
122
+ }>>;
123
+ approvalStructures: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
+ schema: z.ZodLiteral<"guardian.multiparty.v1">;
125
+ structureId: z.ZodString;
126
+ members: z.ZodArray<z.ZodObject<{
127
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
128
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
129
+ }, z.core.$strict>>;
130
+ requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
131
+ kind: z.ZodLiteral<"single">;
132
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
133
+ }, z.core.$strict>, z.ZodObject<{
134
+ kind: z.ZodLiteral<"nOfM">;
135
+ n: z.ZodNumber;
136
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
137
+ }, z.core.$strict>, z.ZodObject<{
138
+ kind: z.ZodLiteral<"unanimous">;
139
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
140
+ }, z.core.$strict>, z.ZodObject<{
141
+ kind: z.ZodLiteral<"roleQuorum">;
142
+ role: z.ZodString;
143
+ n: z.ZodNumber;
144
+ m: z.ZodNumber;
145
+ }, z.core.$strict>], "kind">;
146
+ specificRequired: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
147
+ veto: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
148
+ separationOfDuties: z.ZodOptional<z.ZodObject<{
149
+ mutuallyExclusive: z.ZodArray<z.ZodArray<z.ZodString>>;
150
+ }, z.core.$strict>>;
151
+ temporaryApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
153
+ expiresAtEpochMs: z.ZodNumber;
154
+ }, z.core.$strict>>>;
155
+ delegatedApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
156
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
157
+ delegatedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
158
+ }, z.core.$strict>>>;
159
+ emergencyApprovers: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
160
+ coolingPeriod: z.ZodOptional<z.ZodObject<{
161
+ seconds: z.ZodNumber;
162
+ }, z.core.$strict>>;
163
+ }, z.core.$strict>>>;
164
+ actionDigest: z.ZodString;
165
+ expiresAtEpochMs: z.ZodNumber;
166
+ }, z.core.$strict>;
167
+ export declare const ApprovalBindingSchema: z.ZodObject<{
168
+ schemaVersion: z.ZodLiteral<1>;
169
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
170
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
171
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
172
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
173
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
174
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
175
+ actionDigest: z.ZodString;
176
+ actionDecisionRecordDigest: z.ZodString;
177
+ askDecisionDigest: z.ZodString;
178
+ adapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
179
+ policy: z.ZodObject<{
180
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
181
+ version: z.ZodNumber;
182
+ }, z.core.$strict>;
183
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
184
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
185
+ version: z.ZodNumber;
186
+ }, z.core.$strict>>;
187
+ presentationDigest: z.ZodString;
188
+ requestedAtEpochMs: z.ZodNumber;
189
+ expiresAtEpochMs: z.ZodNumber;
190
+ eligiblePrincipalIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
191
+ requiredFactor: z.ZodOptional<z.ZodEnum<{
192
+ tap: "tap";
193
+ passkey: "passkey";
194
+ biometric: "biometric";
195
+ "second-device": "second-device";
196
+ "multi-approver": "multi-approver";
197
+ }>>;
198
+ requiredApprovals: z.ZodOptional<z.ZodNumber>;
199
+ scopeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
200
+ structures: z.ZodOptional<z.ZodArray<z.ZodObject<{
201
+ schema: z.ZodLiteral<"guardian.multiparty.v1">;
202
+ structureId: z.ZodString;
203
+ members: z.ZodArray<z.ZodObject<{
204
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
205
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
206
+ }, z.core.$strict>>;
207
+ requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
208
+ kind: z.ZodLiteral<"single">;
209
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
210
+ }, z.core.$strict>, z.ZodObject<{
211
+ kind: z.ZodLiteral<"nOfM">;
212
+ n: z.ZodNumber;
213
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
214
+ }, z.core.$strict>, z.ZodObject<{
215
+ kind: z.ZodLiteral<"unanimous">;
216
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
217
+ }, z.core.$strict>, z.ZodObject<{
218
+ kind: z.ZodLiteral<"roleQuorum">;
219
+ role: z.ZodString;
220
+ n: z.ZodNumber;
221
+ m: z.ZodNumber;
222
+ }, z.core.$strict>], "kind">;
223
+ specificRequired: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
224
+ veto: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
225
+ separationOfDuties: z.ZodOptional<z.ZodObject<{
226
+ mutuallyExclusive: z.ZodArray<z.ZodArray<z.ZodString>>;
227
+ }, z.core.$strict>>;
228
+ temporaryApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
230
+ expiresAtEpochMs: z.ZodNumber;
231
+ }, z.core.$strict>>>;
232
+ delegatedApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
233
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
234
+ delegatedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
235
+ }, z.core.$strict>>>;
236
+ emergencyApprovers: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
237
+ coolingPeriod: z.ZodOptional<z.ZodObject<{
238
+ seconds: z.ZodNumber;
239
+ }, z.core.$strict>>;
240
+ }, z.core.$strict>>>;
241
+ }, z.core.$strict>;
242
+ export declare const ApprovalStateSchema: z.ZodEnum<{
243
+ revoked: "revoked";
244
+ pending: "pending";
245
+ expired: "expired";
246
+ approved: "approved";
247
+ denied: "denied";
248
+ superseded: "superseded";
249
+ consumed: "consumed";
250
+ }>;
251
+ export declare const ApprovalRecordSchema: z.ZodObject<{
252
+ schemaVersion: z.ZodLiteral<1>;
253
+ binding: z.ZodObject<{
254
+ schemaVersion: z.ZodLiteral<1>;
255
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
256
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
257
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
258
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
259
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
260
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
261
+ actionDigest: z.ZodString;
262
+ actionDecisionRecordDigest: z.ZodString;
263
+ askDecisionDigest: z.ZodString;
264
+ adapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
265
+ policy: z.ZodObject<{
266
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
267
+ version: z.ZodNumber;
268
+ }, z.core.$strict>;
269
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
270
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
271
+ version: z.ZodNumber;
272
+ }, z.core.$strict>>;
273
+ presentationDigest: z.ZodString;
274
+ requestedAtEpochMs: z.ZodNumber;
275
+ expiresAtEpochMs: z.ZodNumber;
276
+ eligiblePrincipalIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
277
+ requiredFactor: z.ZodOptional<z.ZodEnum<{
278
+ tap: "tap";
279
+ passkey: "passkey";
280
+ biometric: "biometric";
281
+ "second-device": "second-device";
282
+ "multi-approver": "multi-approver";
283
+ }>>;
284
+ requiredApprovals: z.ZodOptional<z.ZodNumber>;
285
+ scopeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
286
+ structures: z.ZodOptional<z.ZodArray<z.ZodObject<{
287
+ schema: z.ZodLiteral<"guardian.multiparty.v1">;
288
+ structureId: z.ZodString;
289
+ members: z.ZodArray<z.ZodObject<{
290
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
291
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
292
+ }, z.core.$strict>>;
293
+ requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
294
+ kind: z.ZodLiteral<"single">;
295
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ kind: z.ZodLiteral<"nOfM">;
298
+ n: z.ZodNumber;
299
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ kind: z.ZodLiteral<"unanimous">;
302
+ members: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ kind: z.ZodLiteral<"roleQuorum">;
305
+ role: z.ZodString;
306
+ n: z.ZodNumber;
307
+ m: z.ZodNumber;
308
+ }, z.core.$strict>], "kind">;
309
+ specificRequired: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
310
+ veto: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
311
+ separationOfDuties: z.ZodOptional<z.ZodObject<{
312
+ mutuallyExclusive: z.ZodArray<z.ZodArray<z.ZodString>>;
313
+ }, z.core.$strict>>;
314
+ temporaryApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
315
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
316
+ expiresAtEpochMs: z.ZodNumber;
317
+ }, z.core.$strict>>>;
318
+ delegatedApprovers: z.ZodOptional<z.ZodArray<z.ZodObject<{
319
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
320
+ delegatedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
321
+ }, z.core.$strict>>>;
322
+ emergencyApprovers: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>>;
323
+ coolingPeriod: z.ZodOptional<z.ZodObject<{
324
+ seconds: z.ZodNumber;
325
+ }, z.core.$strict>>;
326
+ }, z.core.$strict>>>;
327
+ }, z.core.$strict>;
328
+ state: z.ZodEnum<{
329
+ revoked: "revoked";
330
+ pending: "pending";
331
+ expired: "expired";
332
+ approved: "approved";
333
+ denied: "denied";
334
+ superseded: "superseded";
335
+ consumed: "consumed";
336
+ }>;
337
+ version: z.ZodNumber;
338
+ updatedAtEpochMs: z.ZodNumber;
339
+ decidedByPrincipalId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
340
+ endorsements: z.ZodOptional<z.ZodArray<z.ZodObject<{
341
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
342
+ factor: z.ZodEnum<{
343
+ tap: "tap";
344
+ passkey: "passkey";
345
+ biometric: "biometric";
346
+ "second-device": "second-device";
347
+ }>;
348
+ atEpochMs: z.ZodNumber;
349
+ }, z.core.$strict>>>;
350
+ structureApprovals: z.ZodOptional<z.ZodArray<z.ZodObject<{
351
+ memberId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
352
+ decision: z.ZodEnum<{
353
+ veto: "veto";
354
+ approve: "approve";
355
+ deny: "deny";
356
+ }>;
357
+ atEpochMs: z.ZodNumber;
358
+ via: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
359
+ emergency: z.ZodOptional<z.ZodLiteral<true>>;
360
+ }, z.core.$strict>>>;
361
+ cooling: z.ZodOptional<z.ZodObject<{
362
+ startedAtEpochMs: z.ZodNumber;
363
+ endsAtEpochMs: z.ZodNumber;
364
+ }, z.core.$strict>>;
365
+ }, z.core.$strict>;
366
+ /** Human-facing REST body for an explicit approve or deny decision. */
367
+ export declare const ApprovalDecisionRequestSchema: z.ZodObject<{
368
+ schemaVersion: z.ZodLiteral<1>;
369
+ decision: z.ZodEnum<{
370
+ veto: "veto";
371
+ approve: "approve";
372
+ deny: "deny";
373
+ }>;
374
+ expectedVersion: z.ZodNumber;
375
+ presentationDigest: z.ZodString;
376
+ via: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
377
+ emergency: z.ZodOptional<z.ZodLiteral<true>>;
378
+ factor: z.ZodOptional<z.ZodEnum<{
379
+ tap: "tap";
380
+ passkey: "passkey";
381
+ biometric: "biometric";
382
+ "second-device": "second-device";
383
+ }>>;
384
+ }, z.core.$strict>;
385
+ /** Human-facing REST body for revoking a pending or approved decision. */
386
+ export declare const ApprovalRevocationRequestSchema: z.ZodObject<{
387
+ schemaVersion: z.ZodLiteral<1>;
388
+ expectedVersion: z.ZodNumber;
389
+ }, z.core.$strict>;
390
+ /** The exact values a human must echo back to decide; protects against stale tabs. */
391
+ export declare const ApprovalChallengeSchema: z.ZodObject<{
392
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
393
+ version: z.ZodNumber;
394
+ presentationDigest: z.ZodString;
395
+ expiresAtEpochMs: z.ZodNumber;
396
+ }, z.core.$strict>;
397
+ export declare const ApprovalReceiptSchema: z.ZodObject<{
398
+ schemaVersion: z.ZodLiteral<1>;
399
+ approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
400
+ state: z.ZodEnum<{
401
+ revoked: "revoked";
402
+ pending: "pending";
403
+ expired: "expired";
404
+ approved: "approved";
405
+ denied: "denied";
406
+ superseded: "superseded";
407
+ consumed: "consumed";
408
+ }>;
409
+ version: z.ZodNumber;
410
+ updatedAtEpochMs: z.ZodNumber;
411
+ approvalDigest: z.ZodString;
412
+ }, z.core.$strict>;
413
+ export declare function approvalPresentationDigest(presentation: z.infer<typeof ApprovalPresentationSchema>): string;
414
+ export declare function approvalBindingDigest(binding: z.infer<typeof ApprovalBindingSchema>): string;
415
+ export declare function approvalRecordDigest(record: z.infer<typeof ApprovalRecordSchema>): string;
416
+ export type AgentStatement = z.infer<typeof AgentStatementSchema>;
417
+ export type ApprovalReason = z.infer<typeof ApprovalReasonSchema>;
418
+ export type ApprovalPresentation = z.infer<typeof ApprovalPresentationSchema>;
419
+ export type ApprovalBinding = z.infer<typeof ApprovalBindingSchema>;
420
+ export type ApprovalState = z.infer<typeof ApprovalStateSchema>;
421
+ export type ApprovalRecord = z.infer<typeof ApprovalRecordSchema>;
422
+ export type ApprovalDecisionRequest = z.infer<typeof ApprovalDecisionRequestSchema>;
423
+ export type ApprovalRevocationRequest = z.infer<typeof ApprovalRevocationRequestSchema>;
424
+ export type ApprovalChallenge = z.infer<typeof ApprovalChallengeSchema>;
425
+ export type ApprovalReceipt = z.infer<typeof ApprovalReceiptSchema>;
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * WO-026: guardian.assurance.v1 — enforcement assurance level contract
4
+ * (GUA-AUTHORITY-OS-001 §26–27).
5
+ *
6
+ * The assurance level states how strongly Guardian can enforce a decision
7
+ * for one action, computed deterministically from recorded surface
8
+ * evidence. It is honest by construction: G0/G1 describe mediation that
9
+ * does not physically prevent bypass, and the level never rises on
10
+ * evidence that was not recorded.
11
+ *
12
+ * The ladder (§26), precedence strongest-evidence G4 > G3 > G2 > G1 > G0:
13
+ *
14
+ * G4 COUNTERPARTY_INTERLOCKED — the destination/provider itself
15
+ * requires valid Guardian authority proof (recorded tool-server
16
+ * catalog bound on the connection).
17
+ * G3 RUNTIME_CONTAINED — execution is constrained inside a
18
+ * Guardian-controlled or Guardian-recognized environment (recorded
19
+ * attestation marks the execution environment recognized).
20
+ * G2 CREDENTIAL_MEDIATED — the underlying reusable credential is
21
+ * Guardian-mediated (a bound connection record backed the action).
22
+ * G1 POLICY_MEDIATED — the agent voluntarily called Guardian;
23
+ * alternate execution may exist.
24
+ * G0 OBSERVED — Guardian saw the action but could not
25
+ * prevent bypass.
26
+ */
27
+ export declare const ASSURANCE_CONTRACT_SCHEMA = "guardian.assurance.v1";
28
+ /** Ordered enforcement-assurance ladder (lowest → highest). */
29
+ export declare const EnforcementAssuranceLevelSchema: z.ZodEnum<{
30
+ G2_CREDENTIAL_MEDIATED: "G2_CREDENTIAL_MEDIATED";
31
+ G1_POLICY_MEDIATED: "G1_POLICY_MEDIATED";
32
+ G3_RUNTIME_CONTAINED: "G3_RUNTIME_CONTAINED";
33
+ G0_OBSERVED: "G0_OBSERVED";
34
+ G4_COUNTERPARTY_INTERLOCKED: "G4_COUNTERPARTY_INTERLOCKED";
35
+ }>;
36
+ export type EnforcementAssuranceLevel = z.infer<typeof EnforcementAssuranceLevelSchema>;
37
+ export declare const ENFORCEMENT_ASSURANCE_RANK: Record<EnforcementAssuranceLevel, number>;
38
+ /** Human-readable level names for display surfaces (§27). */
39
+ export declare const ENFORCEMENT_ASSURANCE_LABEL: Record<EnforcementAssuranceLevel, string>;
40
+ /**
41
+ * Recorded surface evidence the gateway derived for one action. Absent or
42
+ * false entries never raise the level.
43
+ */
44
+ export declare const EnforcementAssuranceFactsSchema: z.ZodObject<{
45
+ voluntaryCall: z.ZodBoolean;
46
+ guardianMediatedCredential: z.ZodOptional<z.ZodBoolean>;
47
+ guardianContainedEnvironment: z.ZodOptional<z.ZodBoolean>;
48
+ counterpartyRequiresAuthorityProof: z.ZodOptional<z.ZodBoolean>;
49
+ }, z.core.$strict>;
50
+ export type EnforcementAssuranceFacts = z.infer<typeof EnforcementAssuranceFactsSchema>;
51
+ export interface EnforcementAssuranceComputation {
52
+ level: EnforcementAssuranceLevel;
53
+ /** The recorded evidence names the level was computed from. */
54
+ evidence: readonly string[];
55
+ }
56
+ /**
57
+ * Pure, deterministic level computation over recorded evidence. Strongest
58
+ * evidence wins; missing evidence never raises the level.
59
+ */
60
+ export declare function computeEnforcementAssurance(facts: EnforcementAssuranceFacts | null | undefined): EnforcementAssuranceComputation;