@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.
- package/LICENSE +201 -0
- package/README.md +67 -2
- package/dist/index.js +3248 -0
- package/dist-dts/__tests__/client.test.d.ts +1 -0
- package/dist-dts/client.d.ts +80 -0
- package/dist-dts/contracts/action-parameters.d.ts +34 -0
- package/dist-dts/contracts/action-registry.d.ts +197 -0
- package/dist-dts/contracts/action.d.ts +967 -0
- package/dist-dts/contracts/api.d.ts +78 -0
- package/dist-dts/contracts/approval.d.ts +206 -0
- package/dist-dts/contracts/authority-state.d.ts +93 -0
- package/dist-dts/contracts/authority.d.ts +313 -0
- package/dist-dts/contracts/calendar.d.ts +146 -0
- package/dist-dts/contracts/canonical-json.d.ts +4 -0
- package/dist-dts/contracts/capability.d.ts +28 -0
- package/dist-dts/contracts/commerce.d.ts +133 -0
- package/dist-dts/contracts/digest.d.ts +2 -0
- package/dist-dts/contracts/email.d.ts +45 -0
- package/dist-dts/contracts/evidence.d.ts +1030 -0
- package/dist-dts/contracts/execution.d.ts +1338 -0
- package/dist-dts/contracts/files.d.ts +61 -0
- package/dist-dts/contracts/identifiers.d.ts +33 -0
- package/dist-dts/contracts/index.d.ts +19 -0
- package/dist-dts/contracts/protected-data.d.ts +93 -0
- package/dist-dts/contracts/tools.d.ts +187 -0
- package/dist-dts/index.d.ts +1 -0
- package/dist-dts/proposal.d.ts +25 -0
- package/package.json +50 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ApiRequestMethodSchema: z.ZodEnum<{
|
|
3
|
+
GET: "GET";
|
|
4
|
+
HEAD: "HEAD";
|
|
5
|
+
POST: "POST";
|
|
6
|
+
PUT: "PUT";
|
|
7
|
+
PATCH: "PATCH";
|
|
8
|
+
DELETE: "DELETE";
|
|
9
|
+
}>;
|
|
10
|
+
export type ApiRequestMethod = z.infer<typeof ApiRequestMethodSchema>;
|
|
11
|
+
export declare const API_REQUEST_BODY_MAX_LENGTH = 16384;
|
|
12
|
+
export declare const API_REQUEST_MAX_HEADERS = 32;
|
|
13
|
+
export declare const API_RESPONSE_BODY_CAPTURE_MAX_BYTES: number;
|
|
14
|
+
export declare const API_RESPONSE_BODY_PREVIEW_MAX_LENGTH = 256;
|
|
15
|
+
export declare const API_ENDPOINT_ALLOWLIST_MAX_ENTRIES = 64;
|
|
16
|
+
export declare function isSafeApiHeaderValue(value: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Canonicalizes an https request URL. Returns null when the URL is not a
|
|
19
|
+
* plain https absolute URL (userinfo, fragments, non-default ports left
|
|
20
|
+
* unnormalized are rejected or normalized here). Query parameters are
|
|
21
|
+
* sorted so two submissions of the same request canonicalize identically.
|
|
22
|
+
*/
|
|
23
|
+
export declare function canonicalizeApiRequestUrl(value: string): string | null;
|
|
24
|
+
export declare const ApiRequestUrlSchema: z.ZodString;
|
|
25
|
+
export declare const ApiRequestHeaderSchema: z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export declare const ApiRequestParametersV1Schema: z.ZodObject<{
|
|
30
|
+
schema: z.ZodLiteral<"odingard.guardian.api.request.v1">;
|
|
31
|
+
connectionId: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
32
|
+
method: z.ZodEnum<{
|
|
33
|
+
GET: "GET";
|
|
34
|
+
HEAD: "HEAD";
|
|
35
|
+
POST: "POST";
|
|
36
|
+
PUT: "PUT";
|
|
37
|
+
PATCH: "PATCH";
|
|
38
|
+
DELETE: "DELETE";
|
|
39
|
+
}>;
|
|
40
|
+
url: z.ZodString;
|
|
41
|
+
headers: z.ZodArray<z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
value: z.ZodString;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
body: z.ZodOptional<z.ZodString>;
|
|
46
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export type ApiRequestParametersV1 = z.infer<typeof ApiRequestParametersV1Schema>;
|
|
49
|
+
export declare function apiVerificationProjection(input: ApiRequestParametersV1): Readonly<{
|
|
50
|
+
domain: "odingard.guardian.api-projection.v1";
|
|
51
|
+
connectionId: string & z.core.$brand<"ConnectionId">;
|
|
52
|
+
method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
53
|
+
url: string;
|
|
54
|
+
headersDigest: string;
|
|
55
|
+
bodyDigest: string | null;
|
|
56
|
+
idempotencyKey: string | null;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* api.request has a single verification level: the envelope and the content
|
|
60
|
+
* projection are the same canonical request. The post-commit envelope digest
|
|
61
|
+
* therefore equals the projection digest.
|
|
62
|
+
*/
|
|
63
|
+
export declare function apiEnvelopeProjection(input: ApiRequestParametersV1): Readonly<{
|
|
64
|
+
domain: "odingard.guardian.api-projection.v1";
|
|
65
|
+
connectionId: string & z.core.$brand<"ConnectionId">;
|
|
66
|
+
method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
67
|
+
url: string;
|
|
68
|
+
headersDigest: string;
|
|
69
|
+
bodyDigest: string | null;
|
|
70
|
+
idempotencyKey: string | null;
|
|
71
|
+
}>;
|
|
72
|
+
export declare function isSafeAllowlistEntry(value: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Fail-closed allowlist match: the request URL must equal an allowlist entry
|
|
75
|
+
* or extend it at a path boundary. Entries are canonical https URL prefixes
|
|
76
|
+
* such as "https://api.github.com/repos/odingard/".
|
|
77
|
+
*/
|
|
78
|
+
export declare function apiEndpointWithinAllowlist(canonicalUrl: string, allowlist: readonly string[]): boolean;
|
|
@@ -0,0 +1,206 @@
|
|
|
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
|
+
internal: "internal";
|
|
50
|
+
mcp: "mcp";
|
|
51
|
+
rest: "rest";
|
|
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
|
+
actionDigest: z.ZodString;
|
|
82
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export declare const ApprovalBindingSchema: z.ZodObject<{
|
|
85
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
86
|
+
approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
|
|
87
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
88
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
89
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
90
|
+
requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
|
|
91
|
+
correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
|
|
92
|
+
actionDigest: z.ZodString;
|
|
93
|
+
actionDecisionRecordDigest: z.ZodString;
|
|
94
|
+
askDecisionDigest: z.ZodString;
|
|
95
|
+
adapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
|
|
96
|
+
policy: z.ZodObject<{
|
|
97
|
+
id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
|
|
98
|
+
version: z.ZodNumber;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
evaluatedGrants: z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
102
|
+
version: z.ZodNumber;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
presentationDigest: z.ZodString;
|
|
105
|
+
requestedAtEpochMs: z.ZodNumber;
|
|
106
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
export declare const ApprovalStateSchema: z.ZodEnum<{
|
|
109
|
+
revoked: "revoked";
|
|
110
|
+
pending: "pending";
|
|
111
|
+
approved: "approved";
|
|
112
|
+
denied: "denied";
|
|
113
|
+
expired: "expired";
|
|
114
|
+
superseded: "superseded";
|
|
115
|
+
consumed: "consumed";
|
|
116
|
+
}>;
|
|
117
|
+
export declare const ApprovalRecordSchema: z.ZodObject<{
|
|
118
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
119
|
+
binding: z.ZodObject<{
|
|
120
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
121
|
+
approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
|
|
122
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
123
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
124
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
125
|
+
requestId: z.core.$ZodBranded<z.ZodString, "RequestId", "out">;
|
|
126
|
+
correlationId: z.core.$ZodBranded<z.ZodString, "CorrelationId", "out">;
|
|
127
|
+
actionDigest: z.ZodString;
|
|
128
|
+
actionDecisionRecordDigest: z.ZodString;
|
|
129
|
+
askDecisionDigest: z.ZodString;
|
|
130
|
+
adapterId: z.core.$ZodBranded<z.ZodString, "AdapterId", "out">;
|
|
131
|
+
policy: z.ZodObject<{
|
|
132
|
+
id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
|
|
133
|
+
version: z.ZodNumber;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
evaluatedGrants: z.ZodArray<z.ZodObject<{
|
|
136
|
+
id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
137
|
+
version: z.ZodNumber;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
presentationDigest: z.ZodString;
|
|
140
|
+
requestedAtEpochMs: z.ZodNumber;
|
|
141
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
142
|
+
}, z.core.$strict>;
|
|
143
|
+
state: z.ZodEnum<{
|
|
144
|
+
revoked: "revoked";
|
|
145
|
+
pending: "pending";
|
|
146
|
+
approved: "approved";
|
|
147
|
+
denied: "denied";
|
|
148
|
+
expired: "expired";
|
|
149
|
+
superseded: "superseded";
|
|
150
|
+
consumed: "consumed";
|
|
151
|
+
}>;
|
|
152
|
+
version: z.ZodNumber;
|
|
153
|
+
updatedAtEpochMs: z.ZodNumber;
|
|
154
|
+
decidedByPrincipalId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
/** Human-facing REST body for an explicit approve or deny decision. */
|
|
157
|
+
export declare const ApprovalDecisionRequestSchema: z.ZodObject<{
|
|
158
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
159
|
+
decision: z.ZodEnum<{
|
|
160
|
+
deny: "deny";
|
|
161
|
+
approve: "approve";
|
|
162
|
+
}>;
|
|
163
|
+
expectedVersion: z.ZodNumber;
|
|
164
|
+
presentationDigest: z.ZodString;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
/** Human-facing REST body for revoking a pending or approved decision. */
|
|
167
|
+
export declare const ApprovalRevocationRequestSchema: z.ZodObject<{
|
|
168
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
169
|
+
expectedVersion: z.ZodNumber;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
/** The exact values a human must echo back to decide; protects against stale tabs. */
|
|
172
|
+
export declare const ApprovalChallengeSchema: z.ZodObject<{
|
|
173
|
+
approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
|
|
174
|
+
version: z.ZodNumber;
|
|
175
|
+
presentationDigest: z.ZodString;
|
|
176
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
177
|
+
}, z.core.$strict>;
|
|
178
|
+
export declare const ApprovalReceiptSchema: z.ZodObject<{
|
|
179
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
180
|
+
approvalId: z.core.$ZodBranded<z.ZodString, "ApprovalId", "out">;
|
|
181
|
+
state: z.ZodEnum<{
|
|
182
|
+
revoked: "revoked";
|
|
183
|
+
pending: "pending";
|
|
184
|
+
approved: "approved";
|
|
185
|
+
denied: "denied";
|
|
186
|
+
expired: "expired";
|
|
187
|
+
superseded: "superseded";
|
|
188
|
+
consumed: "consumed";
|
|
189
|
+
}>;
|
|
190
|
+
version: z.ZodNumber;
|
|
191
|
+
updatedAtEpochMs: z.ZodNumber;
|
|
192
|
+
approvalDigest: z.ZodString;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
export declare function approvalPresentationDigest(presentation: z.infer<typeof ApprovalPresentationSchema>): string;
|
|
195
|
+
export declare function approvalBindingDigest(binding: z.infer<typeof ApprovalBindingSchema>): string;
|
|
196
|
+
export declare function approvalRecordDigest(record: z.infer<typeof ApprovalRecordSchema>): string;
|
|
197
|
+
export type AgentStatement = z.infer<typeof AgentStatementSchema>;
|
|
198
|
+
export type ApprovalReason = z.infer<typeof ApprovalReasonSchema>;
|
|
199
|
+
export type ApprovalPresentation = z.infer<typeof ApprovalPresentationSchema>;
|
|
200
|
+
export type ApprovalBinding = z.infer<typeof ApprovalBindingSchema>;
|
|
201
|
+
export type ApprovalState = z.infer<typeof ApprovalStateSchema>;
|
|
202
|
+
export type ApprovalRecord = z.infer<typeof ApprovalRecordSchema>;
|
|
203
|
+
export type ApprovalDecisionRequest = z.infer<typeof ApprovalDecisionRequestSchema>;
|
|
204
|
+
export type ApprovalRevocationRequest = z.infer<typeof ApprovalRevocationRequestSchema>;
|
|
205
|
+
export type ApprovalChallenge = z.infer<typeof ApprovalChallengeSchema>;
|
|
206
|
+
export type ApprovalReceipt = z.infer<typeof ApprovalReceiptSchema>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CanonicalAction, type RecordedAuthorityEvaluationInput } from "./action.js";
|
|
3
|
+
export declare const AuthorityStateSnapshotSchema: z.ZodObject<{
|
|
4
|
+
principal: z.ZodObject<{
|
|
5
|
+
id: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
6
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
7
|
+
status: z.ZodEnum<{
|
|
8
|
+
active: "active";
|
|
9
|
+
disabled: "disabled";
|
|
10
|
+
}>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
agent: z.ZodObject<{
|
|
13
|
+
id: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
14
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
15
|
+
ownerPrincipalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
16
|
+
status: z.ZodEnum<{
|
|
17
|
+
active: "active";
|
|
18
|
+
disabled: "disabled";
|
|
19
|
+
revoked: "revoked";
|
|
20
|
+
}>;
|
|
21
|
+
allowedInterfaces: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
22
|
+
internal: "internal";
|
|
23
|
+
mcp: "mcp";
|
|
24
|
+
rest: "rest";
|
|
25
|
+
}>>, z.ZodTransform<("internal" | "mcp" | "rest")[], ("internal" | "mcp" | "rest")[]>>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
policy: z.ZodObject<{
|
|
28
|
+
id: z.core.$ZodBranded<z.ZodString, "PolicyId", "out">;
|
|
29
|
+
version: z.ZodNumber;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
authorityChain: z.ZodArray<z.ZodObject<{
|
|
32
|
+
id: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
33
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
34
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
35
|
+
agentId: z.core.$ZodBranded<z.ZodString, "AgentId", "out">;
|
|
36
|
+
parentGrantId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "GrantId", "out">>;
|
|
37
|
+
issuedBy: z.ZodObject<{
|
|
38
|
+
type: z.ZodLiteral<"principal">;
|
|
39
|
+
principalId: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
status: z.ZodEnum<{
|
|
42
|
+
active: "active";
|
|
43
|
+
disabled: "disabled";
|
|
44
|
+
revoked: "revoked";
|
|
45
|
+
}>;
|
|
46
|
+
version: z.ZodNumber;
|
|
47
|
+
delegable: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
+
constraints: z.ZodObject<{
|
|
49
|
+
actions: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ActionType", "out">>, z.ZodTransform<(string & z.core.$brand<"ActionType">)[], (string & z.core.$brand<"ActionType">)[]>>;
|
|
50
|
+
resources: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "ResourceRef", "out">>, z.ZodTransform<(string & z.core.$brand<"ResourceRef">)[], (string & z.core.$brand<"ResourceRef">)[]>>;
|
|
51
|
+
adapterIds: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>, z.ZodTransform<(string & z.core.$brand<"AdapterId">)[], (string & z.core.$brand<"AdapterId">)[]>>;
|
|
52
|
+
maxValueCents: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
maxUsesPerRequest: z.ZodNumber;
|
|
54
|
+
notBeforeEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
expiresAtEpochMs: z.ZodNumber;
|
|
56
|
+
approvalRequired: z.ZodBoolean;
|
|
57
|
+
askAboveValueCents: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
merchantAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
59
|
+
categoryAllowlist: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
60
|
+
recurrence: z.ZodOptional<z.ZodEnum<{
|
|
61
|
+
never: "never";
|
|
62
|
+
allowed: "allowed";
|
|
63
|
+
}>>;
|
|
64
|
+
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">)[]>>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
revocations: z.ZodArray<z.ZodObject<{
|
|
68
|
+
grantId: z.core.$ZodBranded<z.ZodString, "GrantId", "out">;
|
|
69
|
+
revokedAtEpochMs: z.ZodNumber;
|
|
70
|
+
reasonCode: z.ZodString;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
allowedAdapterIds: z.ZodArray<z.core.$ZodBranded<z.ZodString, "AdapterId", "out">>;
|
|
73
|
+
budgets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.core.$ZodBranded<z.ZodString, "BudgetId", "out">;
|
|
75
|
+
scope: z.ZodEnum<{
|
|
76
|
+
agent: "agent";
|
|
77
|
+
task: "task";
|
|
78
|
+
}>;
|
|
79
|
+
taskId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "TaskId", "out">>;
|
|
80
|
+
limitCents: z.ZodNumber;
|
|
81
|
+
consumedCents: z.ZodNumber;
|
|
82
|
+
transactionLimit: z.ZodNumber;
|
|
83
|
+
consumedTransactions: z.ZodNumber;
|
|
84
|
+
expiresAtEpochMs: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
status: z.ZodEnum<{
|
|
86
|
+
active: "active";
|
|
87
|
+
exhausted: "exhausted";
|
|
88
|
+
revoked: "revoked";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strict>>>;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
export type AuthorityStateSnapshot = z.infer<typeof AuthorityStateSnapshotSchema>;
|
|
93
|
+
export declare function buildRecordedEvaluationInput(actionInput: CanonicalAction, stateInput: AuthorityStateSnapshot, nowEpochMs: number): RecordedAuthorityEvaluationInput;
|