@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,339 @@
1
+ import { z } from "zod";
2
+ export declare const RecurrencePolicySchema: z.ZodEnum<{
3
+ never: "never";
4
+ allowed: "allowed";
5
+ }>;
6
+ export declare const BudgetConsumptionSchema: z.ZodObject<{
7
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
8
+ amountCents: z.ZodNumber;
9
+ transactions: z.ZodNumber;
10
+ }, z.core.$strict>;
11
+ export declare const ActionTypeSchema: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
12
+ export declare const ResourceRefSchema: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
13
+ export declare const EpochMillisecondsSchema: z.ZodNumber;
14
+ export declare const AgentInterfaceSchema: z.ZodEnum<{
15
+ mcp: "mcp";
16
+ rest: "rest";
17
+ internal: "internal";
18
+ }>;
19
+ export declare const PrincipalSchema: z.ZodObject<{
20
+ id: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
21
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
22
+ status: z.ZodEnum<{
23
+ active: "active";
24
+ disabled: "disabled";
25
+ }>;
26
+ }, z.core.$strict>;
27
+ export declare const BudgetStateSchema: z.ZodObject<{
28
+ id: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
29
+ scope: z.ZodEnum<{
30
+ agent: "agent";
31
+ task: "task";
32
+ }>;
33
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
34
+ limitCents: z.ZodNumber;
35
+ consumedCents: z.ZodNumber;
36
+ transactionLimit: z.ZodNumber;
37
+ consumedTransactions: z.ZodNumber;
38
+ expiresAtEpochMs: z.ZodOptional<z.ZodNumber>;
39
+ status: z.ZodEnum<{
40
+ active: "active";
41
+ exhausted: "exhausted";
42
+ revoked: "revoked";
43
+ }>;
44
+ }, z.core.$strict>;
45
+ export declare const AgentIdentitySchema: z.ZodObject<{
46
+ id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
47
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
48
+ ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
49
+ status: z.ZodEnum<{
50
+ active: "active";
51
+ disabled: "disabled";
52
+ revoked: "revoked";
53
+ }>;
54
+ allowedInterfaces: z.ZodPipe<z.ZodArray<z.ZodEnum<{
55
+ mcp: "mcp";
56
+ rest: "rest";
57
+ internal: "internal";
58
+ }>>, z.ZodTransform<("mcp" | "rest" | "internal")[], ("mcp" | "rest" | "internal")[]>>;
59
+ boundRuntime: z.ZodOptional<z.ZodString>;
60
+ boundModel: z.ZodOptional<z.ZodString>;
61
+ parentAgentId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
62
+ }, z.core.$strict>;
63
+ export declare const AuthorityConstraintsSchema: z.ZodObject<{
64
+ actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
65
+ resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
66
+ adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
67
+ maxValueCents: z.ZodOptional<z.ZodNumber>;
68
+ maxUsesPerRequest: z.ZodNumber;
69
+ notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
70
+ expiresAtEpochMs: z.ZodNumber;
71
+ approvalRequired: z.ZodBoolean;
72
+ askAboveValueCents: z.ZodOptional<z.ZodNumber>;
73
+ merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
74
+ categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
75
+ recurrence: z.ZodOptional<z.ZodEnum<{
76
+ never: "never";
77
+ allowed: "allowed";
78
+ }>>;
79
+ 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">)[]>>>;
80
+ }, z.core.$strict>;
81
+ export declare const AuthorityGrantSchema: z.ZodObject<{
82
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
83
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
84
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
85
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
86
+ parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
87
+ issuedBy: z.ZodObject<{
88
+ type: z.ZodLiteral<"principal">;
89
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
90
+ }, z.core.$strict>;
91
+ status: z.ZodEnum<{
92
+ active: "active";
93
+ disabled: "disabled";
94
+ revoked: "revoked";
95
+ }>;
96
+ version: z.ZodNumber;
97
+ delegable: z.ZodDefault<z.ZodBoolean>;
98
+ constraints: z.ZodObject<{
99
+ actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
100
+ resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
101
+ adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
102
+ maxValueCents: z.ZodOptional<z.ZodNumber>;
103
+ maxUsesPerRequest: z.ZodNumber;
104
+ notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
105
+ expiresAtEpochMs: z.ZodNumber;
106
+ approvalRequired: z.ZodBoolean;
107
+ askAboveValueCents: z.ZodOptional<z.ZodNumber>;
108
+ merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
109
+ categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
110
+ recurrence: z.ZodOptional<z.ZodEnum<{
111
+ never: "never";
112
+ allowed: "allowed";
113
+ }>>;
114
+ 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">)[]>>>;
115
+ }, z.core.$strict>;
116
+ }, z.core.$strict>;
117
+ export declare const AuthorityRequestSchema: z.ZodObject<{
118
+ id: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
119
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
120
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
121
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
122
+ action: z.core.$ZodBranded<z.ZodString, "ActionType", "out">;
123
+ resource: z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">;
124
+ interface: z.ZodEnum<{
125
+ mcp: "mcp";
126
+ rest: "rest";
127
+ internal: "internal";
128
+ }>;
129
+ requestedAdapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
130
+ valueCents: z.ZodOptional<z.ZodNumber>;
131
+ uses: z.ZodNumber;
132
+ materialActionDigest: z.ZodOptional<z.ZodString>;
133
+ descriptiveContext: z.ZodOptional<z.ZodString>;
134
+ merchantId: z.ZodOptional<z.ZodString>;
135
+ merchantCategory: z.ZodOptional<z.ZodString>;
136
+ recurring: z.ZodOptional<z.ZodBoolean>;
137
+ taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
138
+ intentId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "IntentId", "out">>;
139
+ planId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "PlanId", "out">>;
140
+ }, z.core.$strict>;
141
+ export declare const DenyReasonCodeSchema: z.ZodEnum<{
142
+ MALFORMED_INPUT: "MALFORMED_INPUT";
143
+ TENANT_MISMATCH: "TENANT_MISMATCH";
144
+ PRINCIPAL_MISMATCH: "PRINCIPAL_MISMATCH";
145
+ PRINCIPAL_NOT_ACTIVE: "PRINCIPAL_NOT_ACTIVE";
146
+ AGENT_TENANT_MISMATCH: "AGENT_TENANT_MISMATCH";
147
+ AGENT_OWNER_MISMATCH: "AGENT_OWNER_MISMATCH";
148
+ AGENT_MISMATCH: "AGENT_MISMATCH";
149
+ AGENT_NOT_ACTIVE: "AGENT_NOT_ACTIVE";
150
+ INTERFACE_NOT_ALLOWED: "INTERFACE_NOT_ALLOWED";
151
+ AUTHORITY_PAUSED: "AUTHORITY_PAUSED";
152
+ AUTHORITY_CHAIN_MISSING: "AUTHORITY_CHAIN_MISSING";
153
+ DUPLICATE_GRANT_ID: "DUPLICATE_GRANT_ID";
154
+ GRANT_TENANT_MISMATCH: "GRANT_TENANT_MISMATCH";
155
+ GRANT_PRINCIPAL_MISMATCH: "GRANT_PRINCIPAL_MISMATCH";
156
+ GRANT_AGENT_MISMATCH: "GRANT_AGENT_MISMATCH";
157
+ GRANT_NOT_ACTIVE: "GRANT_NOT_ACTIVE";
158
+ GRANT_REVOKED: "GRANT_REVOKED";
159
+ GRANT_NOT_YET_VALID: "GRANT_NOT_YET_VALID";
160
+ GRANT_EXPIRED: "GRANT_EXPIRED";
161
+ INVALID_PARENT_LINK: "INVALID_PARENT_LINK";
162
+ DELEGATION_NOT_ALLOWED: "DELEGATION_NOT_ALLOWED";
163
+ AUTHORITY_AMPLIFICATION: "AUTHORITY_AMPLIFICATION";
164
+ ACTION_NOT_ALLOWED: "ACTION_NOT_ALLOWED";
165
+ RESOURCE_NOT_ALLOWED: "RESOURCE_NOT_ALLOWED";
166
+ ADAPTER_NOT_ALLOWED: "ADAPTER_NOT_ALLOWED";
167
+ VALUE_LIMIT_EXCEEDED: "VALUE_LIMIT_EXCEEDED";
168
+ USE_LIMIT_EXCEEDED: "USE_LIMIT_EXCEEDED";
169
+ MERCHANT_NOT_ALLOWED: "MERCHANT_NOT_ALLOWED";
170
+ CATEGORY_NOT_ALLOWED: "CATEGORY_NOT_ALLOWED";
171
+ RECURRENCE_NOT_ALLOWED: "RECURRENCE_NOT_ALLOWED";
172
+ BUDGET_NOT_FOUND: "BUDGET_NOT_FOUND";
173
+ BUDGET_SCOPE_MISMATCH: "BUDGET_SCOPE_MISMATCH";
174
+ BUDGET_NOT_ACTIVE: "BUDGET_NOT_ACTIVE";
175
+ BUDGET_EXPIRED: "BUDGET_EXPIRED";
176
+ BUDGET_EXCEEDED: "BUDGET_EXCEEDED";
177
+ TRANSACTION_LIMIT_EXCEEDED: "TRANSACTION_LIMIT_EXCEEDED";
178
+ }>;
179
+ export declare const DENY_PRECEDENCE: readonly ["MALFORMED_INPUT", "TENANT_MISMATCH", "PRINCIPAL_MISMATCH", "PRINCIPAL_NOT_ACTIVE", "AGENT_TENANT_MISMATCH", "AGENT_OWNER_MISMATCH", "AGENT_MISMATCH", "AGENT_NOT_ACTIVE", "INTERFACE_NOT_ALLOWED", "AUTHORITY_PAUSED", "AUTHORITY_CHAIN_MISSING", "DUPLICATE_GRANT_ID", "GRANT_TENANT_MISMATCH", "GRANT_PRINCIPAL_MISMATCH", "GRANT_AGENT_MISMATCH", "GRANT_REVOKED", "GRANT_NOT_ACTIVE", "GRANT_NOT_YET_VALID", "GRANT_EXPIRED", "INVALID_PARENT_LINK", "DELEGATION_NOT_ALLOWED", "AUTHORITY_AMPLIFICATION", "ACTION_NOT_ALLOWED", "RESOURCE_NOT_ALLOWED", "ADAPTER_NOT_ALLOWED", "VALUE_LIMIT_EXCEEDED", "USE_LIMIT_EXCEEDED", "MERCHANT_NOT_ALLOWED", "CATEGORY_NOT_ALLOWED", "RECURRENCE_NOT_ALLOWED", "BUDGET_NOT_FOUND", "BUDGET_SCOPE_MISMATCH", "BUDGET_NOT_ACTIVE", "BUDGET_EXPIRED", "BUDGET_EXCEEDED", "TRANSACTION_LIMIT_EXCEEDED"];
180
+ export declare const PolicyReferenceSchema: z.ZodObject<{
181
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
182
+ version: z.ZodNumber;
183
+ }, z.core.$strict>;
184
+ export declare const DecisionBindingSchema: z.ZodObject<{
185
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
186
+ policy: z.ZodNullable<z.ZodObject<{
187
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
188
+ version: z.ZodNumber;
189
+ }, z.core.$strict>>;
190
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
191
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
192
+ version: z.ZodNumber;
193
+ }, z.core.$strict>>;
194
+ inputDigest: z.ZodNullable<z.ZodString>;
195
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
197
+ amountCents: z.ZodNumber;
198
+ transactions: z.ZodNumber;
199
+ }, z.core.$strict>>>;
200
+ }, z.core.$strict>;
201
+ export declare const AuthorityDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
202
+ decision: z.ZodLiteral<"ALLOW">;
203
+ reasonCode: z.ZodLiteral<"AUTHORIZED">;
204
+ binding: z.ZodObject<{
205
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
206
+ policy: z.ZodNullable<z.ZodObject<{
207
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
208
+ version: z.ZodNumber;
209
+ }, z.core.$strict>>;
210
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
211
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
212
+ version: z.ZodNumber;
213
+ }, z.core.$strict>>;
214
+ inputDigest: z.ZodNullable<z.ZodString>;
215
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
216
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
217
+ amountCents: z.ZodNumber;
218
+ transactions: z.ZodNumber;
219
+ }, z.core.$strict>>>;
220
+ }, z.core.$strict>;
221
+ }, z.core.$strict>, z.ZodObject<{
222
+ decision: z.ZodLiteral<"ASK">;
223
+ reasonCode: z.ZodLiteral<"APPROVAL_REQUIRED">;
224
+ binding: z.ZodObject<{
225
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
226
+ policy: z.ZodNullable<z.ZodObject<{
227
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
228
+ version: z.ZodNumber;
229
+ }, z.core.$strict>>;
230
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
231
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
232
+ version: z.ZodNumber;
233
+ }, z.core.$strict>>;
234
+ inputDigest: z.ZodNullable<z.ZodString>;
235
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
237
+ amountCents: z.ZodNumber;
238
+ transactions: z.ZodNumber;
239
+ }, z.core.$strict>>>;
240
+ }, z.core.$strict>;
241
+ }, z.core.$strict>, z.ZodObject<{
242
+ decision: z.ZodLiteral<"DENY">;
243
+ reasonCode: z.ZodEnum<{
244
+ MALFORMED_INPUT: "MALFORMED_INPUT";
245
+ TENANT_MISMATCH: "TENANT_MISMATCH";
246
+ PRINCIPAL_MISMATCH: "PRINCIPAL_MISMATCH";
247
+ PRINCIPAL_NOT_ACTIVE: "PRINCIPAL_NOT_ACTIVE";
248
+ AGENT_TENANT_MISMATCH: "AGENT_TENANT_MISMATCH";
249
+ AGENT_OWNER_MISMATCH: "AGENT_OWNER_MISMATCH";
250
+ AGENT_MISMATCH: "AGENT_MISMATCH";
251
+ AGENT_NOT_ACTIVE: "AGENT_NOT_ACTIVE";
252
+ INTERFACE_NOT_ALLOWED: "INTERFACE_NOT_ALLOWED";
253
+ AUTHORITY_PAUSED: "AUTHORITY_PAUSED";
254
+ AUTHORITY_CHAIN_MISSING: "AUTHORITY_CHAIN_MISSING";
255
+ DUPLICATE_GRANT_ID: "DUPLICATE_GRANT_ID";
256
+ GRANT_TENANT_MISMATCH: "GRANT_TENANT_MISMATCH";
257
+ GRANT_PRINCIPAL_MISMATCH: "GRANT_PRINCIPAL_MISMATCH";
258
+ GRANT_AGENT_MISMATCH: "GRANT_AGENT_MISMATCH";
259
+ GRANT_NOT_ACTIVE: "GRANT_NOT_ACTIVE";
260
+ GRANT_REVOKED: "GRANT_REVOKED";
261
+ GRANT_NOT_YET_VALID: "GRANT_NOT_YET_VALID";
262
+ GRANT_EXPIRED: "GRANT_EXPIRED";
263
+ INVALID_PARENT_LINK: "INVALID_PARENT_LINK";
264
+ DELEGATION_NOT_ALLOWED: "DELEGATION_NOT_ALLOWED";
265
+ AUTHORITY_AMPLIFICATION: "AUTHORITY_AMPLIFICATION";
266
+ ACTION_NOT_ALLOWED: "ACTION_NOT_ALLOWED";
267
+ RESOURCE_NOT_ALLOWED: "RESOURCE_NOT_ALLOWED";
268
+ ADAPTER_NOT_ALLOWED: "ADAPTER_NOT_ALLOWED";
269
+ VALUE_LIMIT_EXCEEDED: "VALUE_LIMIT_EXCEEDED";
270
+ USE_LIMIT_EXCEEDED: "USE_LIMIT_EXCEEDED";
271
+ MERCHANT_NOT_ALLOWED: "MERCHANT_NOT_ALLOWED";
272
+ CATEGORY_NOT_ALLOWED: "CATEGORY_NOT_ALLOWED";
273
+ RECURRENCE_NOT_ALLOWED: "RECURRENCE_NOT_ALLOWED";
274
+ BUDGET_NOT_FOUND: "BUDGET_NOT_FOUND";
275
+ BUDGET_SCOPE_MISMATCH: "BUDGET_SCOPE_MISMATCH";
276
+ BUDGET_NOT_ACTIVE: "BUDGET_NOT_ACTIVE";
277
+ BUDGET_EXPIRED: "BUDGET_EXPIRED";
278
+ BUDGET_EXCEEDED: "BUDGET_EXCEEDED";
279
+ TRANSACTION_LIMIT_EXCEEDED: "TRANSACTION_LIMIT_EXCEEDED";
280
+ }>;
281
+ binding: z.ZodObject<{
282
+ requestId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "RequestId", "out">>;
283
+ policy: z.ZodNullable<z.ZodObject<{
284
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
285
+ version: z.ZodNumber;
286
+ }, z.core.$strict>>;
287
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
288
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
289
+ version: z.ZodNumber;
290
+ }, z.core.$strict>>;
291
+ inputDigest: z.ZodNullable<z.ZodString>;
292
+ budgetConsumption: z.ZodOptional<z.ZodArray<z.ZodObject<{
293
+ budgetId: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
294
+ amountCents: z.ZodNumber;
295
+ transactions: z.ZodNumber;
296
+ }, z.core.$strict>>>;
297
+ }, z.core.$strict>;
298
+ }, z.core.$strict>], "decision">;
299
+ export declare const RevocationSchema: z.ZodObject<{
300
+ grantId: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
301
+ revokedAtEpochMs: z.ZodNumber;
302
+ reasonCode: z.ZodString;
303
+ }, z.core.$strict>;
304
+ /**
305
+ * WO-010 — a scoped authority suspension recorded in authority state. The
306
+ * control plane resolves each pause into the identifiers the kernel checks
307
+ * (grant ids as emitted on the chain, adapter ids for connection scope), so
308
+ * the kernel needs no persistence knowledge to fail closed (K15).
309
+ */
310
+ export declare const AuthorityPauseSchema: z.ZodObject<{
311
+ id: z.core.$ZodBranded<z.ZodString, "PauseId", "out">;
312
+ scope: z.ZodEnum<{
313
+ agent: "agent";
314
+ principal: "principal";
315
+ grant: "grant";
316
+ connection: "connection";
317
+ }>;
318
+ agentId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AgentId", "out">>;
319
+ grantIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>, z.ZodTransform<(string & z.core.$brand<"GrantId">)[], (string & z.core.$brand<"GrantId">)[]>>>;
320
+ adapterIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>>;
321
+ }, z.core.$strict>;
322
+ export type ActionType = z.infer<typeof ActionTypeSchema>;
323
+ export type ResourceRef = z.infer<typeof ResourceRefSchema>;
324
+ export type Principal = z.infer<typeof PrincipalSchema>;
325
+ export type AgentIdentity = z.infer<typeof AgentIdentitySchema>;
326
+ export type AgentInterface = z.infer<typeof AgentInterfaceSchema>;
327
+ export type AuthorityConstraints = z.infer<typeof AuthorityConstraintsSchema>;
328
+ export type AuthorityGrant = z.infer<typeof AuthorityGrantSchema>;
329
+ export type AuthorityRequest = z.infer<typeof AuthorityRequestSchema>;
330
+ export type AuthorityDecision = z.infer<typeof AuthorityDecisionSchema>;
331
+ export type DenyReasonCode = z.infer<typeof DenyReasonCodeSchema>;
332
+ export type Revocation = z.infer<typeof RevocationSchema>;
333
+ export type AuthorityPause = z.infer<typeof AuthorityPauseSchema>;
334
+ export type PolicyReference = z.infer<typeof PolicyReferenceSchema>;
335
+ export type DecisionBinding = z.infer<typeof DecisionBindingSchema>;
336
+ export type RecurrencePolicy = z.infer<typeof RecurrencePolicySchema>;
337
+ export type BudgetConsumption = z.infer<typeof BudgetConsumptionSchema>;
338
+ export type BudgetState = z.infer<typeof BudgetStateSchema>;
339
+ export declare const AUTHORITY_CONSTRAINT_KEYS: readonly ["actions", "resources", "adapterIds", "maxValueCents", "maxUsesPerRequest", "notBeforeEpochMs", "expiresAtEpochMs", "approvalRequired", "askAboveValueCents", "merchantAllowlist", "categoryAllowlist", "recurrence", "budgetIds"];
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+ export declare const BillingPlanIdSchema: z.ZodEnum<{
3
+ family: "family";
4
+ free: "free";
5
+ personal: "personal";
6
+ developer: "developer";
7
+ pilot: "pilot";
8
+ }>;
9
+ export type BillingPlanId = z.infer<typeof BillingPlanIdSchema>;
10
+ export declare const CheckoutIntervalSchema: z.ZodEnum<{
11
+ month: "month";
12
+ year: "year";
13
+ }>;
14
+ export type CheckoutInterval = z.infer<typeof CheckoutIntervalSchema>;
15
+ export type PlanLimits = Readonly<{
16
+ connections: number;
17
+ agents: number;
18
+ protectedActionsPerMonth: number;
19
+ }>;
20
+ export declare const PLAN_LIMITS: Record<BillingPlanId, PlanLimits>;
21
+ export declare const PURCHASABLE_PLANS: readonly ["personal", "family", "developer"];
22
+ export type PurchasablePlan = (typeof PURCHASABLE_PLANS)[number];
23
+ export type PlanPricing = Readonly<{
24
+ displayName: string;
25
+ monthlyUsd: number | null;
26
+ annualUsd: number | null;
27
+ usageMetered: boolean;
28
+ tagline: string;
29
+ }>;
30
+ export declare const PLAN_PRICING: Record<BillingPlanId, PlanPricing>;
31
+ export declare function purchasableIntervals(plan: BillingPlanId): readonly CheckoutInterval[];
32
+ export declare function formatPlanPrice(plan: BillingPlanId, interval: CheckoutInterval): string;
@@ -0,0 +1,146 @@
1
+ import { z } from "zod";
2
+ export declare const CalendarCreateParametersV1Schema: z.ZodObject<{
3
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
4
+ calendarId: z.ZodString;
5
+ schema: z.ZodLiteral<"odingard.guardian.calendar.create.v1">;
6
+ summary: z.ZodString;
7
+ description: z.ZodOptional<z.ZodString>;
8
+ location: z.ZodOptional<z.ZodString>;
9
+ start: z.ZodObject<{
10
+ dateTime: z.ZodString;
11
+ timeZone: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strict>;
13
+ end: z.ZodObject<{
14
+ dateTime: z.ZodString;
15
+ timeZone: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strict>;
17
+ idempotencyKey: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strict>;
19
+ export declare const CalendarUpdateParametersV1Schema: z.ZodObject<{
20
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
21
+ calendarId: z.ZodString;
22
+ schema: z.ZodLiteral<"odingard.guardian.calendar.update.v1">;
23
+ eventId: z.ZodString;
24
+ summary: z.ZodOptional<z.ZodString>;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ location: z.ZodOptional<z.ZodString>;
27
+ start: z.ZodOptional<z.ZodObject<{
28
+ dateTime: z.ZodString;
29
+ timeZone: z.ZodOptional<z.ZodString>;
30
+ }, z.core.$strict>>;
31
+ end: z.ZodOptional<z.ZodObject<{
32
+ dateTime: z.ZodString;
33
+ timeZone: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strict>>;
35
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
36
+ none: "none";
37
+ all: "all";
38
+ externalOnly: "externalOnly";
39
+ }>>;
40
+ }, z.core.$strict>;
41
+ export declare const CalendarCancelParametersV1Schema: z.ZodObject<{
42
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
43
+ calendarId: z.ZodString;
44
+ schema: z.ZodLiteral<"odingard.guardian.calendar.cancel.v1">;
45
+ eventId: z.ZodString;
46
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
47
+ none: "none";
48
+ all: "all";
49
+ externalOnly: "externalOnly";
50
+ }>>;
51
+ }, z.core.$strict>;
52
+ export declare const CalendarInviteParametersV1Schema: z.ZodObject<{
53
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
54
+ calendarId: z.ZodString;
55
+ schema: z.ZodLiteral<"odingard.guardian.calendar.invite.v1">;
56
+ eventId: z.ZodString;
57
+ attendees: z.ZodArray<z.ZodObject<{
58
+ email: z.ZodString;
59
+ optional: z.ZodOptional<z.ZodBoolean>;
60
+ }, z.core.$strict>>;
61
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
62
+ none: "none";
63
+ all: "all";
64
+ externalOnly: "externalOnly";
65
+ }>>;
66
+ }, z.core.$strict>;
67
+ export declare const CalendarParametersV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
69
+ calendarId: z.ZodString;
70
+ schema: z.ZodLiteral<"odingard.guardian.calendar.create.v1">;
71
+ summary: z.ZodString;
72
+ description: z.ZodOptional<z.ZodString>;
73
+ location: z.ZodOptional<z.ZodString>;
74
+ start: z.ZodObject<{
75
+ dateTime: z.ZodString;
76
+ timeZone: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strict>;
78
+ end: z.ZodObject<{
79
+ dateTime: z.ZodString;
80
+ timeZone: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strict>;
82
+ idempotencyKey: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strict>, z.ZodObject<{
84
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
85
+ calendarId: z.ZodString;
86
+ schema: z.ZodLiteral<"odingard.guardian.calendar.update.v1">;
87
+ eventId: z.ZodString;
88
+ summary: z.ZodOptional<z.ZodString>;
89
+ description: z.ZodOptional<z.ZodString>;
90
+ location: z.ZodOptional<z.ZodString>;
91
+ start: z.ZodOptional<z.ZodObject<{
92
+ dateTime: z.ZodString;
93
+ timeZone: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strict>>;
95
+ end: z.ZodOptional<z.ZodObject<{
96
+ dateTime: z.ZodString;
97
+ timeZone: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strict>>;
99
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
100
+ none: "none";
101
+ all: "all";
102
+ externalOnly: "externalOnly";
103
+ }>>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
106
+ calendarId: z.ZodString;
107
+ schema: z.ZodLiteral<"odingard.guardian.calendar.cancel.v1">;
108
+ eventId: z.ZodString;
109
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
110
+ none: "none";
111
+ all: "all";
112
+ externalOnly: "externalOnly";
113
+ }>>;
114
+ }, z.core.$strict>, z.ZodObject<{
115
+ connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
116
+ calendarId: z.ZodString;
117
+ schema: z.ZodLiteral<"odingard.guardian.calendar.invite.v1">;
118
+ eventId: z.ZodString;
119
+ attendees: z.ZodArray<z.ZodObject<{
120
+ email: z.ZodString;
121
+ optional: z.ZodOptional<z.ZodBoolean>;
122
+ }, z.core.$strict>>;
123
+ sendUpdates: z.ZodOptional<z.ZodEnum<{
124
+ none: "none";
125
+ all: "all";
126
+ externalOnly: "externalOnly";
127
+ }>>;
128
+ }, z.core.$strict>], "schema">;
129
+ export type CalendarCreateParametersV1 = z.infer<typeof CalendarCreateParametersV1Schema>;
130
+ export type CalendarUpdateParametersV1 = z.infer<typeof CalendarUpdateParametersV1Schema>;
131
+ export type CalendarCancelParametersV1 = z.infer<typeof CalendarCancelParametersV1Schema>;
132
+ export type CalendarInviteParametersV1 = z.infer<typeof CalendarInviteParametersV1Schema>;
133
+ export type CalendarParametersV1 = z.infer<typeof CalendarParametersV1Schema>;
134
+ /**
135
+ * The verification projection is the semantic external effect the commit must
136
+ * produce — the same shape the adapter rebuilds from the provider's
137
+ * post-commit state so digests compare equal only when the observed effect
138
+ * matches what authority approved.
139
+ */
140
+ export declare function calendarVerificationProjection(params: CalendarParametersV1): Readonly<Record<string, unknown>>;
141
+ /**
142
+ * The envelope projection is the lower-fidelity view: which calendar action on
143
+ * which calendar/event, without event content (summary/description/attendee
144
+ * detail).
145
+ */
146
+ export declare function calendarEnvelopeProjection(params: CalendarParametersV1): Readonly<Record<string, unknown>>;
@@ -0,0 +1,4 @@
1
+ export type CanonicalJsonValue = null | boolean | number | string | CanonicalJsonValue[] | {
2
+ [key: string]: CanonicalJsonValue;
3
+ };
4
+ export declare function canonicalJson(value: CanonicalJsonValue | unknown): string;
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ export declare const CapabilityKeyIdSchema: z.core.$ZodBranded<z.ZodString, "CapabilityKeyId", "out">;
3
+ export declare const CapabilityClaimsSchema: z.ZodObject<{
4
+ schemaVersion: z.ZodLiteral<1>;
5
+ capabilityId: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
6
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
7
+ principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
8
+ agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
9
+ requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
10
+ actionDigest: z.ZodString;
11
+ actionNonce: z.core.$ZodBranded<z.ZodString, "Nonce", "out">;
12
+ audience: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
13
+ policy: z.ZodObject<{
14
+ id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
15
+ version: z.ZodNumber;
16
+ }, z.core.$strict>;
17
+ evaluatedGrants: z.ZodArray<z.ZodObject<{
18
+ id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
19
+ version: z.ZodNumber;
20
+ }, z.core.$strict>>;
21
+ issuedAtEpochMs: z.ZodNumber;
22
+ expiresAtEpochMs: z.ZodNumber;
23
+ maxUses: z.ZodLiteral<1>;
24
+ keyId: z.core.$ZodBranded<z.ZodString, "CapabilityKeyId", "out">;
25
+ algorithm: z.ZodLiteral<"HS256">;
26
+ }, z.core.$strict>;
27
+ export type CapabilityKeyId = z.infer<typeof CapabilityKeyIdSchema>;
28
+ export type CapabilityClaims = z.infer<typeof CapabilityClaimsSchema>;