@odingard/guardian-sdk 0.0.0-stage → 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.
@@ -0,0 +1,967 @@
1
+ import { z } from "zod";
2
+ import type { CanonicalJsonValue } from "./canonical-json.js";
3
+ export declare const MaterialParametersSchema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, CanonicalJsonValue>>, unknown>>;
4
+ export declare const AuthorityReferenceSchema: z.ZodObject<{
5
+ policy: z.ZodObject<{
6
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
7
+ version: z.ZodNumber;
8
+ }, z.core.$strict>;
9
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
10
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
11
+ version: z.ZodNumber;
12
+ }, z.core.$strict>>;
13
+ }, z.core.$strict>;
14
+ export declare const MaterialActionSchema: z.ZodObject<{
15
+ schemaVersion: z.ZodLiteral<1>;
16
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
17
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
18
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
19
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
20
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
21
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
22
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
23
+ interface: z.ZodEnum<{
24
+ internal: "internal";
25
+ mcp: "mcp";
26
+ rest: "rest";
27
+ }>;
28
+ valueCents: z.ZodOptional<z.ZodNumber>;
29
+ merchantId: z.ZodOptional<z.ZodString>;
30
+ merchantCategory: z.ZodOptional<z.ZodString>;
31
+ recurring: z.ZodOptional<z.ZodBoolean>;
32
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
33
+ uses: z.ZodNumber;
34
+ materialParameters: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, CanonicalJsonValue>>, unknown>>;
35
+ initiatingContext: z.ZodEnum<{
36
+ agent: "agent";
37
+ user: "user";
38
+ scheduled: "scheduled";
39
+ "external-event": "external-event";
40
+ }>;
41
+ authority: z.ZodObject<{
42
+ policy: z.ZodObject<{
43
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
44
+ version: z.ZodNumber;
45
+ }, z.core.$strict>;
46
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
47
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
48
+ version: z.ZodNumber;
49
+ }, z.core.$strict>>;
50
+ }, z.core.$strict>;
51
+ issuedAtEpochMs: z.ZodNumber;
52
+ expiresAtEpochMs: z.ZodNumber;
53
+ nonce: z.core.$ZodBranded<z.ZodString, "Nonce", "out">;
54
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
55
+ }, z.core.$strict>;
56
+ export declare const CanonicalActionEnvelopeSchema: z.ZodObject<{
57
+ schemaVersion: z.ZodLiteral<1>;
58
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
59
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
60
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
61
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
62
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
63
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
64
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
65
+ interface: z.ZodEnum<{
66
+ internal: "internal";
67
+ mcp: "mcp";
68
+ rest: "rest";
69
+ }>;
70
+ valueCents: z.ZodOptional<z.ZodNumber>;
71
+ merchantId: z.ZodOptional<z.ZodString>;
72
+ merchantCategory: z.ZodOptional<z.ZodString>;
73
+ recurring: z.ZodOptional<z.ZodBoolean>;
74
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
75
+ uses: z.ZodNumber;
76
+ materialParameters: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, CanonicalJsonValue>>, unknown>>;
77
+ initiatingContext: z.ZodEnum<{
78
+ agent: "agent";
79
+ user: "user";
80
+ scheduled: "scheduled";
81
+ "external-event": "external-event";
82
+ }>;
83
+ authority: z.ZodObject<{
84
+ policy: z.ZodObject<{
85
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
86
+ version: z.ZodNumber;
87
+ }, z.core.$strict>;
88
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
89
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
90
+ version: z.ZodNumber;
91
+ }, z.core.$strict>>;
92
+ }, z.core.$strict>;
93
+ issuedAtEpochMs: z.ZodNumber;
94
+ expiresAtEpochMs: z.ZodNumber;
95
+ nonce: z.core.$ZodBranded<z.ZodString, "Nonce", "out">;
96
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
97
+ purpose: z.ZodString;
98
+ }, z.core.$strict>;
99
+ export declare const CanonicalActionSchema: z.ZodObject<{
100
+ schemaVersion: z.ZodLiteral<1>;
101
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
102
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
103
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
104
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
105
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
106
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
107
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
108
+ interface: z.ZodEnum<{
109
+ internal: "internal";
110
+ mcp: "mcp";
111
+ rest: "rest";
112
+ }>;
113
+ valueCents: z.ZodOptional<z.ZodNumber>;
114
+ merchantId: z.ZodOptional<z.ZodString>;
115
+ merchantCategory: z.ZodOptional<z.ZodString>;
116
+ recurring: z.ZodOptional<z.ZodBoolean>;
117
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
118
+ uses: z.ZodNumber;
119
+ materialParameters: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, CanonicalJsonValue>>, unknown>>;
120
+ initiatingContext: z.ZodEnum<{
121
+ agent: "agent";
122
+ user: "user";
123
+ scheduled: "scheduled";
124
+ "external-event": "external-event";
125
+ }>;
126
+ authority: z.ZodObject<{
127
+ policy: z.ZodObject<{
128
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
129
+ version: z.ZodNumber;
130
+ }, z.core.$strict>;
131
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
132
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
133
+ version: z.ZodNumber;
134
+ }, z.core.$strict>>;
135
+ }, z.core.$strict>;
136
+ issuedAtEpochMs: z.ZodNumber;
137
+ expiresAtEpochMs: z.ZodNumber;
138
+ nonce: z.core.$ZodBranded<z.ZodString, "Nonce", "out">;
139
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
140
+ purpose: z.ZodString;
141
+ materialDigest: z.ZodString;
142
+ }, z.core.$strict>;
143
+ export declare const RecordedAuthorityEvaluationInputSchema: z.ZodObject<{
144
+ nowEpochMs: z.ZodNumber;
145
+ principal: z.ZodObject<{
146
+ id: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
147
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
148
+ status: z.ZodEnum<{
149
+ active: "active";
150
+ disabled: "disabled";
151
+ }>;
152
+ }, z.core.$strict>;
153
+ agent: z.ZodObject<{
154
+ id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
155
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
156
+ ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
157
+ status: z.ZodEnum<{
158
+ active: "active";
159
+ disabled: "disabled";
160
+ revoked: "revoked";
161
+ }>;
162
+ allowedInterfaces: z.ZodPipe<z.ZodArray<z.ZodEnum<{
163
+ internal: "internal";
164
+ mcp: "mcp";
165
+ rest: "rest";
166
+ }>>, z.ZodTransform<("internal" | "mcp" | "rest")[], ("internal" | "mcp" | "rest")[]>>;
167
+ }, z.core.$strict>;
168
+ request: z.ZodObject<{
169
+ id: z.core.$ZodBranded<z.ZodString, "RequestId", "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
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
174
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
175
+ interface: z.ZodEnum<{
176
+ internal: "internal";
177
+ mcp: "mcp";
178
+ rest: "rest";
179
+ }>;
180
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
181
+ valueCents: z.ZodOptional<z.ZodNumber>;
182
+ uses: z.ZodNumber;
183
+ materialActionDigest: z.ZodOptional<z.ZodString>;
184
+ descriptiveContext: z.ZodOptional<z.ZodString>;
185
+ merchantId: z.ZodOptional<z.ZodString>;
186
+ merchantCategory: z.ZodOptional<z.ZodString>;
187
+ recurring: z.ZodOptional<z.ZodBoolean>;
188
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
189
+ }, z.core.$strict>;
190
+ policy: z.ZodObject<{
191
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
192
+ version: z.ZodNumber;
193
+ }, z.core.$strict>;
194
+ authorityChain: z.ZodArray<z.ZodObject<{
195
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
196
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
197
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
198
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
199
+ parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
200
+ issuedBy: z.ZodObject<{
201
+ type: z.ZodLiteral<"principal">;
202
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
203
+ }, z.core.$strict>;
204
+ status: z.ZodEnum<{
205
+ active: "active";
206
+ disabled: "disabled";
207
+ revoked: "revoked";
208
+ }>;
209
+ version: z.ZodNumber;
210
+ delegable: z.ZodDefault<z.ZodBoolean>;
211
+ constraints: z.ZodObject<{
212
+ actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
213
+ resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
214
+ adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
215
+ maxValueCents: z.ZodOptional<z.ZodNumber>;
216
+ maxUsesPerRequest: z.ZodNumber;
217
+ notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
218
+ expiresAtEpochMs: z.ZodNumber;
219
+ approvalRequired: z.ZodBoolean;
220
+ askAboveValueCents: z.ZodOptional<z.ZodNumber>;
221
+ merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
222
+ categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
223
+ recurrence: z.ZodOptional<z.ZodEnum<{
224
+ never: "never";
225
+ allowed: "allowed";
226
+ }>>;
227
+ budgetIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>, z.ZodTransform<(string & z.core.$brand<"BudgetId">)[], (string & z.core.$brand<"BudgetId">)[]>>>;
228
+ }, z.core.$strict>;
229
+ }, z.core.$strict>>;
230
+ revocations: z.ZodPipe<z.ZodArray<z.ZodObject<{
231
+ grantId: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
232
+ revokedAtEpochMs: z.ZodNumber;
233
+ reasonCode: z.ZodString;
234
+ }, z.core.$strict>>, z.ZodTransform<{
235
+ grantId: string & z.core.$brand<"GrantId">;
236
+ revokedAtEpochMs: number;
237
+ reasonCode: string;
238
+ }[], {
239
+ grantId: string & z.core.$brand<"GrantId">;
240
+ revokedAtEpochMs: number;
241
+ reasonCode: string;
242
+ }[]>>;
243
+ budgets: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
244
+ id: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
245
+ scope: z.ZodEnum<{
246
+ agent: "agent";
247
+ task: "task";
248
+ }>;
249
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
250
+ limitCents: z.ZodNumber;
251
+ consumedCents: z.ZodNumber;
252
+ transactionLimit: z.ZodNumber;
253
+ consumedTransactions: z.ZodNumber;
254
+ expiresAtEpochMs: z.ZodOptional<z.ZodNumber>;
255
+ status: z.ZodEnum<{
256
+ active: "active";
257
+ exhausted: "exhausted";
258
+ revoked: "revoked";
259
+ }>;
260
+ }, z.core.$strict>>>, z.ZodTransform<{
261
+ id: string & z.core.$brand<"BudgetId">;
262
+ scope: "agent" | "task";
263
+ limitCents: number;
264
+ consumedCents: number;
265
+ transactionLimit: number;
266
+ consumedTransactions: number;
267
+ status: "active" | "exhausted" | "revoked";
268
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
269
+ expiresAtEpochMs?: number | undefined;
270
+ }[], {
271
+ id: string & z.core.$brand<"BudgetId">;
272
+ scope: "agent" | "task";
273
+ limitCents: number;
274
+ consumedCents: number;
275
+ transactionLimit: number;
276
+ consumedTransactions: number;
277
+ status: "active" | "exhausted" | "revoked";
278
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
279
+ expiresAtEpochMs?: number | undefined;
280
+ }[]>>;
281
+ }, z.core.$strict>;
282
+ export declare const ActionDecisionRecordCoreSchema: z.ZodObject<{
283
+ schemaVersion: z.ZodLiteral<1>;
284
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
285
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
286
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
287
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
288
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
289
+ actionDigest: z.ZodString;
290
+ policy: z.ZodObject<{
291
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
292
+ version: z.ZodNumber;
293
+ }, z.core.$strict>;
294
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
295
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
296
+ version: z.ZodNumber;
297
+ }, z.core.$strict>>;
298
+ action: z.ZodObject<{
299
+ schemaVersion: z.ZodLiteral<1>;
300
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
301
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
302
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
303
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
304
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
305
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
306
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
307
+ interface: z.ZodEnum<{
308
+ internal: "internal";
309
+ mcp: "mcp";
310
+ rest: "rest";
311
+ }>;
312
+ valueCents: z.ZodOptional<z.ZodNumber>;
313
+ merchantId: z.ZodOptional<z.ZodString>;
314
+ merchantCategory: z.ZodOptional<z.ZodString>;
315
+ recurring: z.ZodOptional<z.ZodBoolean>;
316
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
317
+ uses: z.ZodNumber;
318
+ materialParameters: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, CanonicalJsonValue>>, unknown>>;
319
+ initiatingContext: z.ZodEnum<{
320
+ agent: "agent";
321
+ user: "user";
322
+ scheduled: "scheduled";
323
+ "external-event": "external-event";
324
+ }>;
325
+ authority: z.ZodObject<{
326
+ policy: z.ZodObject<{
327
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
328
+ version: z.ZodNumber;
329
+ }, z.core.$strict>;
330
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
331
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
332
+ version: z.ZodNumber;
333
+ }, z.core.$strict>>;
334
+ }, z.core.$strict>;
335
+ issuedAtEpochMs: z.ZodNumber;
336
+ expiresAtEpochMs: z.ZodNumber;
337
+ nonce: z.core.$ZodBranded<z.ZodString, "Nonce", "out">;
338
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
339
+ purpose: z.ZodString;
340
+ materialDigest: z.ZodString;
341
+ }, z.core.$strict>;
342
+ authorityRequest: z.ZodObject<{
343
+ id: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
344
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
345
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
346
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
347
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
348
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
349
+ interface: z.ZodEnum<{
350
+ internal: "internal";
351
+ mcp: "mcp";
352
+ rest: "rest";
353
+ }>;
354
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
355
+ valueCents: z.ZodOptional<z.ZodNumber>;
356
+ uses: z.ZodNumber;
357
+ materialActionDigest: z.ZodOptional<z.ZodString>;
358
+ descriptiveContext: z.ZodOptional<z.ZodString>;
359
+ merchantId: z.ZodOptional<z.ZodString>;
360
+ merchantCategory: z.ZodOptional<z.ZodString>;
361
+ recurring: z.ZodOptional<z.ZodBoolean>;
362
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
363
+ }, z.core.$strict>;
364
+ authorityEvaluationInput: z.ZodObject<{
365
+ nowEpochMs: z.ZodNumber;
366
+ principal: z.ZodObject<{
367
+ id: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
368
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
369
+ status: z.ZodEnum<{
370
+ active: "active";
371
+ disabled: "disabled";
372
+ }>;
373
+ }, z.core.$strict>;
374
+ agent: z.ZodObject<{
375
+ id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
376
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
377
+ ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
378
+ status: z.ZodEnum<{
379
+ active: "active";
380
+ disabled: "disabled";
381
+ revoked: "revoked";
382
+ }>;
383
+ allowedInterfaces: z.ZodPipe<z.ZodArray<z.ZodEnum<{
384
+ internal: "internal";
385
+ mcp: "mcp";
386
+ rest: "rest";
387
+ }>>, z.ZodTransform<("internal" | "mcp" | "rest")[], ("internal" | "mcp" | "rest")[]>>;
388
+ }, z.core.$strict>;
389
+ request: z.ZodObject<{
390
+ id: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
391
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
392
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
393
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
394
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
395
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
396
+ interface: z.ZodEnum<{
397
+ internal: "internal";
398
+ mcp: "mcp";
399
+ rest: "rest";
400
+ }>;
401
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
402
+ valueCents: z.ZodOptional<z.ZodNumber>;
403
+ uses: z.ZodNumber;
404
+ materialActionDigest: z.ZodOptional<z.ZodString>;
405
+ descriptiveContext: z.ZodOptional<z.ZodString>;
406
+ merchantId: z.ZodOptional<z.ZodString>;
407
+ merchantCategory: z.ZodOptional<z.ZodString>;
408
+ recurring: z.ZodOptional<z.ZodBoolean>;
409
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
410
+ }, z.core.$strict>;
411
+ policy: z.ZodObject<{
412
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
413
+ version: z.ZodNumber;
414
+ }, z.core.$strict>;
415
+ authorityChain: z.ZodArray<z.ZodObject<{
416
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
417
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
418
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
419
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
420
+ parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
421
+ issuedBy: z.ZodObject<{
422
+ type: z.ZodLiteral<"principal">;
423
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
424
+ }, z.core.$strict>;
425
+ status: z.ZodEnum<{
426
+ active: "active";
427
+ disabled: "disabled";
428
+ revoked: "revoked";
429
+ }>;
430
+ version: z.ZodNumber;
431
+ delegable: z.ZodDefault<z.ZodBoolean>;
432
+ constraints: z.ZodObject<{
433
+ actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
434
+ resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
435
+ adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
436
+ maxValueCents: z.ZodOptional<z.ZodNumber>;
437
+ maxUsesPerRequest: z.ZodNumber;
438
+ notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
439
+ expiresAtEpochMs: z.ZodNumber;
440
+ approvalRequired: z.ZodBoolean;
441
+ askAboveValueCents: z.ZodOptional<z.ZodNumber>;
442
+ merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
443
+ categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
444
+ recurrence: z.ZodOptional<z.ZodEnum<{
445
+ never: "never";
446
+ allowed: "allowed";
447
+ }>>;
448
+ budgetIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>, z.ZodTransform<(string & z.core.$brand<"BudgetId">)[], (string & z.core.$brand<"BudgetId">)[]>>>;
449
+ }, z.core.$strict>;
450
+ }, z.core.$strict>>;
451
+ revocations: z.ZodPipe<z.ZodArray<z.ZodObject<{
452
+ grantId: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
453
+ revokedAtEpochMs: z.ZodNumber;
454
+ reasonCode: z.ZodString;
455
+ }, z.core.$strict>>, z.ZodTransform<{
456
+ grantId: string & z.core.$brand<"GrantId">;
457
+ revokedAtEpochMs: number;
458
+ reasonCode: string;
459
+ }[], {
460
+ grantId: string & z.core.$brand<"GrantId">;
461
+ revokedAtEpochMs: number;
462
+ reasonCode: string;
463
+ }[]>>;
464
+ budgets: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
465
+ id: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
466
+ scope: z.ZodEnum<{
467
+ agent: "agent";
468
+ task: "task";
469
+ }>;
470
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
471
+ limitCents: z.ZodNumber;
472
+ consumedCents: z.ZodNumber;
473
+ transactionLimit: z.ZodNumber;
474
+ consumedTransactions: z.ZodNumber;
475
+ expiresAtEpochMs: z.ZodOptional<z.ZodNumber>;
476
+ status: z.ZodEnum<{
477
+ active: "active";
478
+ exhausted: "exhausted";
479
+ revoked: "revoked";
480
+ }>;
481
+ }, z.core.$strict>>>, z.ZodTransform<{
482
+ id: string & z.core.$brand<"BudgetId">;
483
+ scope: "agent" | "task";
484
+ limitCents: number;
485
+ consumedCents: number;
486
+ transactionLimit: number;
487
+ consumedTransactions: number;
488
+ status: "active" | "exhausted" | "revoked";
489
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
490
+ expiresAtEpochMs?: number | undefined;
491
+ }[], {
492
+ id: string & z.core.$brand<"BudgetId">;
493
+ scope: "agent" | "task";
494
+ limitCents: number;
495
+ consumedCents: number;
496
+ transactionLimit: number;
497
+ consumedTransactions: number;
498
+ status: "active" | "exhausted" | "revoked";
499
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
500
+ expiresAtEpochMs?: number | undefined;
501
+ }[]>>;
502
+ }, z.core.$strict>;
503
+ authorityDecision: z.ZodDiscriminatedUnion<[z.ZodObject<{
504
+ decision: z.ZodLiteral<"ALLOW">;
505
+ reasonCode: z.ZodLiteral<"AUTHORIZED">;
506
+ binding: z.ZodObject<{
507
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
508
+ policy: z.ZodNullable<z.ZodObject<{
509
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
510
+ version: z.ZodNumber;
511
+ }, z.core.$strict>>;
512
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
513
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
514
+ version: z.ZodNumber;
515
+ }, z.core.$strict>>;
516
+ inputDigest: z.ZodNullable<z.ZodString>;
517
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
518
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
519
+ amountCents: z.ZodNumber;
520
+ transactions: z.ZodNumber;
521
+ }, z.core.$strict>>>;
522
+ }, z.core.$strict>;
523
+ }, z.core.$strict>, z.ZodObject<{
524
+ decision: z.ZodLiteral<"ASK">;
525
+ reasonCode: z.ZodLiteral<"APPROVAL_REQUIRED">;
526
+ binding: z.ZodObject<{
527
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
528
+ policy: z.ZodNullable<z.ZodObject<{
529
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
530
+ version: z.ZodNumber;
531
+ }, z.core.$strict>>;
532
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
533
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
534
+ version: z.ZodNumber;
535
+ }, z.core.$strict>>;
536
+ inputDigest: z.ZodNullable<z.ZodString>;
537
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
538
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
539
+ amountCents: z.ZodNumber;
540
+ transactions: z.ZodNumber;
541
+ }, z.core.$strict>>>;
542
+ }, z.core.$strict>;
543
+ }, z.core.$strict>, z.ZodObject<{
544
+ decision: z.ZodLiteral<"DENY">;
545
+ reasonCode: z.ZodEnum<{
546
+ MALFORMED_INPUT: "MALFORMED_INPUT";
547
+ TENANT_MISMATCH: "TENANT_MISMATCH";
548
+ PRINCIPAL_MISMATCH: "PRINCIPAL_MISMATCH";
549
+ PRINCIPAL_NOT_ACTIVE: "PRINCIPAL_NOT_ACTIVE";
550
+ AGENT_TENANT_MISMATCH: "AGENT_TENANT_MISMATCH";
551
+ AGENT_OWNER_MISMATCH: "AGENT_OWNER_MISMATCH";
552
+ AGENT_MISMATCH: "AGENT_MISMATCH";
553
+ AGENT_NOT_ACTIVE: "AGENT_NOT_ACTIVE";
554
+ INTERFACE_NOT_ALLOWED: "INTERFACE_NOT_ALLOWED";
555
+ AUTHORITY_CHAIN_MISSING: "AUTHORITY_CHAIN_MISSING";
556
+ DUPLICATE_GRANT_ID: "DUPLICATE_GRANT_ID";
557
+ GRANT_TENANT_MISMATCH: "GRANT_TENANT_MISMATCH";
558
+ GRANT_PRINCIPAL_MISMATCH: "GRANT_PRINCIPAL_MISMATCH";
559
+ GRANT_AGENT_MISMATCH: "GRANT_AGENT_MISMATCH";
560
+ GRANT_NOT_ACTIVE: "GRANT_NOT_ACTIVE";
561
+ GRANT_REVOKED: "GRANT_REVOKED";
562
+ GRANT_NOT_YET_VALID: "GRANT_NOT_YET_VALID";
563
+ GRANT_EXPIRED: "GRANT_EXPIRED";
564
+ INVALID_PARENT_LINK: "INVALID_PARENT_LINK";
565
+ DELEGATION_NOT_ALLOWED: "DELEGATION_NOT_ALLOWED";
566
+ AUTHORITY_AMPLIFICATION: "AUTHORITY_AMPLIFICATION";
567
+ ACTION_NOT_ALLOWED: "ACTION_NOT_ALLOWED";
568
+ RESOURCE_NOT_ALLOWED: "RESOURCE_NOT_ALLOWED";
569
+ ADAPTER_NOT_ALLOWED: "ADAPTER_NOT_ALLOWED";
570
+ VALUE_LIMIT_EXCEEDED: "VALUE_LIMIT_EXCEEDED";
571
+ USE_LIMIT_EXCEEDED: "USE_LIMIT_EXCEEDED";
572
+ MERCHANT_NOT_ALLOWED: "MERCHANT_NOT_ALLOWED";
573
+ CATEGORY_NOT_ALLOWED: "CATEGORY_NOT_ALLOWED";
574
+ RECURRENCE_NOT_ALLOWED: "RECURRENCE_NOT_ALLOWED";
575
+ BUDGET_NOT_FOUND: "BUDGET_NOT_FOUND";
576
+ BUDGET_SCOPE_MISMATCH: "BUDGET_SCOPE_MISMATCH";
577
+ BUDGET_NOT_ACTIVE: "BUDGET_NOT_ACTIVE";
578
+ BUDGET_EXPIRED: "BUDGET_EXPIRED";
579
+ BUDGET_EXCEEDED: "BUDGET_EXCEEDED";
580
+ TRANSACTION_LIMIT_EXCEEDED: "TRANSACTION_LIMIT_EXCEEDED";
581
+ }>;
582
+ binding: z.ZodObject<{
583
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
584
+ policy: z.ZodNullable<z.ZodObject<{
585
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
586
+ version: z.ZodNumber;
587
+ }, z.core.$strict>>;
588
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
589
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
590
+ version: z.ZodNumber;
591
+ }, z.core.$strict>>;
592
+ inputDigest: z.ZodNullable<z.ZodString>;
593
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
594
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
595
+ amountCents: z.ZodNumber;
596
+ transactions: z.ZodNumber;
597
+ }, z.core.$strict>>>;
598
+ }, z.core.$strict>;
599
+ }, z.core.$strict>], "decision">;
600
+ decidedAtEpochMs: z.ZodNumber;
601
+ }, z.core.$strict>;
602
+ export declare const ActionDecisionRecordSchema: z.ZodObject<{
603
+ schemaVersion: z.ZodLiteral<1>;
604
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
605
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
606
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
607
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
608
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
609
+ actionDigest: z.ZodString;
610
+ policy: z.ZodObject<{
611
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
612
+ version: z.ZodNumber;
613
+ }, z.core.$strict>;
614
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
615
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
616
+ version: z.ZodNumber;
617
+ }, z.core.$strict>>;
618
+ action: z.ZodObject<{
619
+ schemaVersion: z.ZodLiteral<1>;
620
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
621
+ correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
622
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
623
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
624
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
625
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
626
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
627
+ interface: z.ZodEnum<{
628
+ internal: "internal";
629
+ mcp: "mcp";
630
+ rest: "rest";
631
+ }>;
632
+ valueCents: z.ZodOptional<z.ZodNumber>;
633
+ merchantId: z.ZodOptional<z.ZodString>;
634
+ merchantCategory: z.ZodOptional<z.ZodString>;
635
+ recurring: z.ZodOptional<z.ZodBoolean>;
636
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
637
+ uses: z.ZodNumber;
638
+ materialParameters: z.ZodPipe<z.ZodUnknown, z.ZodTransform<Readonly<Record<string, CanonicalJsonValue>>, unknown>>;
639
+ initiatingContext: z.ZodEnum<{
640
+ agent: "agent";
641
+ user: "user";
642
+ scheduled: "scheduled";
643
+ "external-event": "external-event";
644
+ }>;
645
+ authority: z.ZodObject<{
646
+ policy: z.ZodObject<{
647
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
648
+ version: z.ZodNumber;
649
+ }, z.core.$strict>;
650
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
651
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
652
+ version: z.ZodNumber;
653
+ }, z.core.$strict>>;
654
+ }, z.core.$strict>;
655
+ issuedAtEpochMs: z.ZodNumber;
656
+ expiresAtEpochMs: z.ZodNumber;
657
+ nonce: z.core.$ZodBranded<z.ZodString, "Nonce", "out">;
658
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
659
+ purpose: z.ZodString;
660
+ materialDigest: z.ZodString;
661
+ }, z.core.$strict>;
662
+ authorityRequest: z.ZodObject<{
663
+ id: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
664
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
665
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
666
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
667
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
668
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
669
+ interface: z.ZodEnum<{
670
+ internal: "internal";
671
+ mcp: "mcp";
672
+ rest: "rest";
673
+ }>;
674
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
675
+ valueCents: z.ZodOptional<z.ZodNumber>;
676
+ uses: z.ZodNumber;
677
+ materialActionDigest: z.ZodOptional<z.ZodString>;
678
+ descriptiveContext: z.ZodOptional<z.ZodString>;
679
+ merchantId: z.ZodOptional<z.ZodString>;
680
+ merchantCategory: z.ZodOptional<z.ZodString>;
681
+ recurring: z.ZodOptional<z.ZodBoolean>;
682
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
683
+ }, z.core.$strict>;
684
+ authorityEvaluationInput: z.ZodObject<{
685
+ nowEpochMs: z.ZodNumber;
686
+ principal: z.ZodObject<{
687
+ id: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
688
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
689
+ status: z.ZodEnum<{
690
+ active: "active";
691
+ disabled: "disabled";
692
+ }>;
693
+ }, z.core.$strict>;
694
+ agent: z.ZodObject<{
695
+ id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
696
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
697
+ ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
698
+ status: z.ZodEnum<{
699
+ active: "active";
700
+ disabled: "disabled";
701
+ revoked: "revoked";
702
+ }>;
703
+ allowedInterfaces: z.ZodPipe<z.ZodArray<z.ZodEnum<{
704
+ internal: "internal";
705
+ mcp: "mcp";
706
+ rest: "rest";
707
+ }>>, z.ZodTransform<("internal" | "mcp" | "rest")[], ("internal" | "mcp" | "rest")[]>>;
708
+ }, z.core.$strict>;
709
+ request: z.ZodObject<{
710
+ id: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
711
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
712
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
713
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
714
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
715
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
716
+ interface: z.ZodEnum<{
717
+ internal: "internal";
718
+ mcp: "mcp";
719
+ rest: "rest";
720
+ }>;
721
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
722
+ valueCents: z.ZodOptional<z.ZodNumber>;
723
+ uses: z.ZodNumber;
724
+ materialActionDigest: z.ZodOptional<z.ZodString>;
725
+ descriptiveContext: z.ZodOptional<z.ZodString>;
726
+ merchantId: z.ZodOptional<z.ZodString>;
727
+ merchantCategory: z.ZodOptional<z.ZodString>;
728
+ recurring: z.ZodOptional<z.ZodBoolean>;
729
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
730
+ }, z.core.$strict>;
731
+ policy: z.ZodObject<{
732
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
733
+ version: z.ZodNumber;
734
+ }, z.core.$strict>;
735
+ authorityChain: z.ZodArray<z.ZodObject<{
736
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
737
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
738
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
739
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
740
+ parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
741
+ issuedBy: z.ZodObject<{
742
+ type: z.ZodLiteral<"principal">;
743
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
744
+ }, z.core.$strict>;
745
+ status: z.ZodEnum<{
746
+ active: "active";
747
+ disabled: "disabled";
748
+ revoked: "revoked";
749
+ }>;
750
+ version: z.ZodNumber;
751
+ delegable: z.ZodDefault<z.ZodBoolean>;
752
+ constraints: z.ZodObject<{
753
+ actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
754
+ resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
755
+ adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
756
+ maxValueCents: z.ZodOptional<z.ZodNumber>;
757
+ maxUsesPerRequest: z.ZodNumber;
758
+ notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
759
+ expiresAtEpochMs: z.ZodNumber;
760
+ approvalRequired: z.ZodBoolean;
761
+ askAboveValueCents: z.ZodOptional<z.ZodNumber>;
762
+ merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
763
+ categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
764
+ recurrence: z.ZodOptional<z.ZodEnum<{
765
+ never: "never";
766
+ allowed: "allowed";
767
+ }>>;
768
+ budgetIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "BudgetId", "out">>, z.ZodTransform<(string & z.core.$brand<"BudgetId">)[], (string & z.core.$brand<"BudgetId">)[]>>>;
769
+ }, z.core.$strict>;
770
+ }, z.core.$strict>>;
771
+ revocations: z.ZodPipe<z.ZodArray<z.ZodObject<{
772
+ grantId: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
773
+ revokedAtEpochMs: z.ZodNumber;
774
+ reasonCode: z.ZodString;
775
+ }, z.core.$strict>>, z.ZodTransform<{
776
+ grantId: string & z.core.$brand<"GrantId">;
777
+ revokedAtEpochMs: number;
778
+ reasonCode: string;
779
+ }[], {
780
+ grantId: string & z.core.$brand<"GrantId">;
781
+ revokedAtEpochMs: number;
782
+ reasonCode: string;
783
+ }[]>>;
784
+ budgets: z.ZodPipe<z.ZodDefault<z.ZodArray<z.ZodObject<{
785
+ id: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
786
+ scope: z.ZodEnum<{
787
+ agent: "agent";
788
+ task: "task";
789
+ }>;
790
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
791
+ limitCents: z.ZodNumber;
792
+ consumedCents: z.ZodNumber;
793
+ transactionLimit: z.ZodNumber;
794
+ consumedTransactions: z.ZodNumber;
795
+ expiresAtEpochMs: z.ZodOptional<z.ZodNumber>;
796
+ status: z.ZodEnum<{
797
+ active: "active";
798
+ exhausted: "exhausted";
799
+ revoked: "revoked";
800
+ }>;
801
+ }, z.core.$strict>>>, z.ZodTransform<{
802
+ id: string & z.core.$brand<"BudgetId">;
803
+ scope: "agent" | "task";
804
+ limitCents: number;
805
+ consumedCents: number;
806
+ transactionLimit: number;
807
+ consumedTransactions: number;
808
+ status: "active" | "exhausted" | "revoked";
809
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
810
+ expiresAtEpochMs?: number | undefined;
811
+ }[], {
812
+ id: string & z.core.$brand<"BudgetId">;
813
+ scope: "agent" | "task";
814
+ limitCents: number;
815
+ consumedCents: number;
816
+ transactionLimit: number;
817
+ consumedTransactions: number;
818
+ status: "active" | "exhausted" | "revoked";
819
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
820
+ expiresAtEpochMs?: number | undefined;
821
+ }[]>>;
822
+ }, z.core.$strict>;
823
+ authorityDecision: z.ZodDiscriminatedUnion<[z.ZodObject<{
824
+ decision: z.ZodLiteral<"ALLOW">;
825
+ reasonCode: z.ZodLiteral<"AUTHORIZED">;
826
+ binding: z.ZodObject<{
827
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
828
+ policy: z.ZodNullable<z.ZodObject<{
829
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
830
+ version: z.ZodNumber;
831
+ }, z.core.$strict>>;
832
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
833
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
834
+ version: z.ZodNumber;
835
+ }, z.core.$strict>>;
836
+ inputDigest: z.ZodNullable<z.ZodString>;
837
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
838
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
839
+ amountCents: z.ZodNumber;
840
+ transactions: z.ZodNumber;
841
+ }, z.core.$strict>>>;
842
+ }, z.core.$strict>;
843
+ }, z.core.$strict>, z.ZodObject<{
844
+ decision: z.ZodLiteral<"ASK">;
845
+ reasonCode: z.ZodLiteral<"APPROVAL_REQUIRED">;
846
+ binding: z.ZodObject<{
847
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
848
+ policy: z.ZodNullable<z.ZodObject<{
849
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
850
+ version: z.ZodNumber;
851
+ }, z.core.$strict>>;
852
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
853
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
854
+ version: z.ZodNumber;
855
+ }, z.core.$strict>>;
856
+ inputDigest: z.ZodNullable<z.ZodString>;
857
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
858
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
859
+ amountCents: z.ZodNumber;
860
+ transactions: z.ZodNumber;
861
+ }, z.core.$strict>>>;
862
+ }, z.core.$strict>;
863
+ }, z.core.$strict>, z.ZodObject<{
864
+ decision: z.ZodLiteral<"DENY">;
865
+ reasonCode: z.ZodEnum<{
866
+ MALFORMED_INPUT: "MALFORMED_INPUT";
867
+ TENANT_MISMATCH: "TENANT_MISMATCH";
868
+ PRINCIPAL_MISMATCH: "PRINCIPAL_MISMATCH";
869
+ PRINCIPAL_NOT_ACTIVE: "PRINCIPAL_NOT_ACTIVE";
870
+ AGENT_TENANT_MISMATCH: "AGENT_TENANT_MISMATCH";
871
+ AGENT_OWNER_MISMATCH: "AGENT_OWNER_MISMATCH";
872
+ AGENT_MISMATCH: "AGENT_MISMATCH";
873
+ AGENT_NOT_ACTIVE: "AGENT_NOT_ACTIVE";
874
+ INTERFACE_NOT_ALLOWED: "INTERFACE_NOT_ALLOWED";
875
+ AUTHORITY_CHAIN_MISSING: "AUTHORITY_CHAIN_MISSING";
876
+ DUPLICATE_GRANT_ID: "DUPLICATE_GRANT_ID";
877
+ GRANT_TENANT_MISMATCH: "GRANT_TENANT_MISMATCH";
878
+ GRANT_PRINCIPAL_MISMATCH: "GRANT_PRINCIPAL_MISMATCH";
879
+ GRANT_AGENT_MISMATCH: "GRANT_AGENT_MISMATCH";
880
+ GRANT_NOT_ACTIVE: "GRANT_NOT_ACTIVE";
881
+ GRANT_REVOKED: "GRANT_REVOKED";
882
+ GRANT_NOT_YET_VALID: "GRANT_NOT_YET_VALID";
883
+ GRANT_EXPIRED: "GRANT_EXPIRED";
884
+ INVALID_PARENT_LINK: "INVALID_PARENT_LINK";
885
+ DELEGATION_NOT_ALLOWED: "DELEGATION_NOT_ALLOWED";
886
+ AUTHORITY_AMPLIFICATION: "AUTHORITY_AMPLIFICATION";
887
+ ACTION_NOT_ALLOWED: "ACTION_NOT_ALLOWED";
888
+ RESOURCE_NOT_ALLOWED: "RESOURCE_NOT_ALLOWED";
889
+ ADAPTER_NOT_ALLOWED: "ADAPTER_NOT_ALLOWED";
890
+ VALUE_LIMIT_EXCEEDED: "VALUE_LIMIT_EXCEEDED";
891
+ USE_LIMIT_EXCEEDED: "USE_LIMIT_EXCEEDED";
892
+ MERCHANT_NOT_ALLOWED: "MERCHANT_NOT_ALLOWED";
893
+ CATEGORY_NOT_ALLOWED: "CATEGORY_NOT_ALLOWED";
894
+ RECURRENCE_NOT_ALLOWED: "RECURRENCE_NOT_ALLOWED";
895
+ BUDGET_NOT_FOUND: "BUDGET_NOT_FOUND";
896
+ BUDGET_SCOPE_MISMATCH: "BUDGET_SCOPE_MISMATCH";
897
+ BUDGET_NOT_ACTIVE: "BUDGET_NOT_ACTIVE";
898
+ BUDGET_EXPIRED: "BUDGET_EXPIRED";
899
+ BUDGET_EXCEEDED: "BUDGET_EXCEEDED";
900
+ TRANSACTION_LIMIT_EXCEEDED: "TRANSACTION_LIMIT_EXCEEDED";
901
+ }>;
902
+ binding: z.ZodObject<{
903
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
904
+ policy: z.ZodNullable<z.ZodObject<{
905
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
906
+ version: z.ZodNumber;
907
+ }, z.core.$strict>>;
908
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
909
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
910
+ version: z.ZodNumber;
911
+ }, z.core.$strict>>;
912
+ inputDigest: z.ZodNullable<z.ZodString>;
913
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
914
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
915
+ amountCents: z.ZodNumber;
916
+ transactions: z.ZodNumber;
917
+ }, z.core.$strict>>>;
918
+ }, z.core.$strict>;
919
+ }, z.core.$strict>], "decision">;
920
+ decidedAtEpochMs: z.ZodNumber;
921
+ recordDigest: z.ZodString;
922
+ }, z.core.$strict>;
923
+ export type MaterialParameters = z.infer<typeof MaterialParametersSchema>;
924
+ export type AuthorityReference = z.infer<typeof AuthorityReferenceSchema>;
925
+ export type MaterialAction = z.infer<typeof MaterialActionSchema>;
926
+ export type CanonicalActionEnvelope = z.infer<typeof CanonicalActionEnvelopeSchema>;
927
+ export type CanonicalAction = z.infer<typeof CanonicalActionSchema>;
928
+ export type RecordedAuthorityEvaluationInput = z.infer<typeof RecordedAuthorityEvaluationInputSchema>;
929
+ export type ActionDecisionRecordCore = z.infer<typeof ActionDecisionRecordCoreSchema>;
930
+ export type ActionDecisionRecord = z.infer<typeof ActionDecisionRecordSchema>;
931
+ export declare const MATERIAL_ACTION_KEYS: (keyof MaterialAction)[];
932
+ export declare function materialActionDigest(material: MaterialAction): string;
933
+ export declare function actionDecisionRecordDigest(record: ActionDecisionRecordCore): string;
934
+ export declare function toAuthorityRequest(action: CanonicalAction): {
935
+ id: string & z.core.$brand<"RequestId">;
936
+ tenantId: string & z.core.$brand<"TenantId">;
937
+ principalId: string & z.core.$brand<"PrincipalId">;
938
+ agentId: string & z.core.$brand<"AgentId">;
939
+ action: string & z.core.$brand<"ActionType">;
940
+ resource: string & z.core.$brand<"ResourceRef">;
941
+ interface: "internal" | "mcp" | "rest";
942
+ requestedAdapterId: string & z.core.$brand<"AdapterId">;
943
+ uses: number;
944
+ valueCents?: number | undefined;
945
+ materialActionDigest?: string | undefined;
946
+ descriptiveContext?: string | undefined;
947
+ merchantId?: string | undefined;
948
+ merchantCategory?: string | undefined;
949
+ recurring?: boolean | undefined;
950
+ taskId?: (string & z.core.$brand<"TaskId">) | undefined;
951
+ };
952
+ export type CreateCanonicalActionResult = {
953
+ ok: true;
954
+ action: CanonicalAction;
955
+ } | {
956
+ ok: false;
957
+ reasonCode: "MALFORMED_ACTION";
958
+ };
959
+ export declare function createCanonicalAction(input: unknown): CreateCanonicalActionResult;
960
+ export type CreateActionDecisionResult = {
961
+ ok: true;
962
+ record: ActionDecisionRecord;
963
+ } | {
964
+ ok: false;
965
+ reasonCode: "ACTION_DECISION_BINDING_INVALID";
966
+ };
967
+ export declare function createActionDecisionRecord(actionInput: unknown, authorityEvaluationInput: unknown, decisionInput: unknown, decidedAtEpochMs: unknown): CreateActionDecisionResult;