@kya-os/contracts 1.5.3-canary.16 → 1.5.3-canary.18
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/.turbo/turbo-build.log +17 -0
- package/.turbo/turbo-test$colon$coverage.log +28 -0
- package/.turbo/turbo-test.log +32 -0
- package/coverage/coverage-final.json +38 -0
- package/dist/agentshield-api/admin-schemas.d.ts +2 -2
- package/dist/agentshield-api/schemas.d.ts +86 -112
- package/dist/audit/index.d.ts +24 -24
- package/dist/config/identity.d.ts +6 -6
- package/dist/consent/schemas.d.ts +87 -69
- package/dist/consent/schemas.js +10 -0
- package/dist/dashboard-config/schemas.d.ts +2553 -1349
- package/dist/handshake.d.ts +14 -14
- package/dist/tool-protection/index.d.ts +418 -8
- package/dist/tool-protection/index.js +61 -2
- package/dist/well-known/index.d.ts +2 -2
- package/package.json +37 -129
- package/schemas/cli/register-output/v1.0.0.json +69 -0
- package/schemas/identity/v1.0.0.json +46 -0
- package/schemas/proof/v1.0.0.json +80 -0
- package/schemas/registry/receipt-v1.0.0.json +60 -0
- package/schemas/verifier/verify-page/v1.0.0.json +94 -0
- package/schemas/well-known/agent/v1.0.0.json +67 -0
- package/schemas/well-known/did/v1.0.0.json +174 -0
- package/scripts/emit-schemas.js +11 -0
- package/src/agentshield-api/admin-schemas.ts +31 -0
- package/src/agentshield-api/admin-types.ts +47 -0
- package/src/agentshield-api/endpoints.ts +60 -0
- package/src/agentshield-api/index.ts +70 -0
- package/src/agentshield-api/schemas.ts +304 -0
- package/src/agentshield-api/types.ts +317 -0
- package/src/audit/index.ts +128 -0
- package/src/cli.ts +156 -0
- package/src/config/base.ts +107 -0
- package/src/config/builder.ts +97 -0
- package/src/config/delegation.ts +232 -0
- package/src/config/identity.ts +252 -0
- package/src/config/index.ts +78 -0
- package/src/config/proofing.ts +138 -0
- package/src/config/tool-context.ts +41 -0
- package/src/config/tool-protection.ts +174 -0
- package/src/consent/index.ts +32 -0
- package/src/consent/schemas.ts +334 -0
- package/src/consent/types.ts +199 -0
- package/src/dashboard-config/default-config.json +86 -0
- package/src/dashboard-config/default-config.ts +266 -0
- package/src/dashboard-config/index.ts +48 -0
- package/src/dashboard-config/schemas.ts +286 -0
- package/src/dashboard-config/types.ts +404 -0
- package/src/delegation/constraints.ts +267 -0
- package/src/delegation/index.ts +8 -0
- package/src/delegation/schemas.ts +595 -0
- package/src/did/index.ts +9 -0
- package/src/did/resolve-contract.ts +255 -0
- package/src/did/schemas.ts +190 -0
- package/src/did/types.ts +224 -0
- package/src/env/constants.ts +70 -0
- package/src/env/index.ts +5 -0
- package/src/handshake.ts +125 -0
- package/src/index.ts +45 -0
- package/src/proof/index.ts +31 -0
- package/src/proof/proof-record.ts +163 -0
- package/src/proof/signing-spec.ts +146 -0
- package/src/proof.ts +99 -0
- package/src/registry.ts +146 -0
- package/src/runtime/errors.ts +153 -0
- package/src/runtime/headers.ts +136 -0
- package/src/runtime/index.ts +6 -0
- package/src/test.ts +143 -0
- package/src/tlkrc/index.ts +5 -0
- package/src/tlkrc/rotation.ts +153 -0
- package/src/tool-protection/index.ts +343 -0
- package/src/utils/validation.ts +93 -0
- package/src/vc/index.ts +8 -0
- package/src/vc/schemas.ts +277 -0
- package/src/vc/statuslist.ts +279 -0
- package/src/verifier.ts +92 -0
- package/src/well-known/index.ts +237 -0
package/dist/audit/index.d.ts
CHANGED
|
@@ -65,38 +65,38 @@ export declare const AuditContextSchema: z.ZodObject<{
|
|
|
65
65
|
*/
|
|
66
66
|
scopeId: z.ZodOptional<z.ZodString>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
kid: string;
|
|
71
|
-
} & {
|
|
72
|
-
[k: string]: unknown;
|
|
73
|
-
};
|
|
68
|
+
requestHash: string;
|
|
69
|
+
responseHash: string;
|
|
74
70
|
session: {
|
|
75
|
-
sessionId: string;
|
|
76
71
|
audience: string;
|
|
72
|
+
sessionId: string;
|
|
77
73
|
} & {
|
|
78
74
|
[k: string]: unknown;
|
|
79
75
|
};
|
|
80
|
-
requestHash: string;
|
|
81
|
-
responseHash: string;
|
|
82
76
|
verified: "yes" | "no";
|
|
83
|
-
scopeId?: string | undefined;
|
|
84
|
-
}, {
|
|
85
77
|
identity: {
|
|
86
78
|
did: string;
|
|
87
79
|
kid: string;
|
|
88
80
|
} & {
|
|
89
81
|
[k: string]: unknown;
|
|
90
82
|
};
|
|
83
|
+
scopeId?: string | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
requestHash: string;
|
|
86
|
+
responseHash: string;
|
|
91
87
|
session: {
|
|
92
|
-
sessionId: string;
|
|
93
88
|
audience: string;
|
|
89
|
+
sessionId: string;
|
|
94
90
|
} & {
|
|
95
91
|
[k: string]: unknown;
|
|
96
92
|
};
|
|
97
|
-
requestHash: string;
|
|
98
|
-
responseHash: string;
|
|
99
93
|
verified: "yes" | "no";
|
|
94
|
+
identity: {
|
|
95
|
+
did: string;
|
|
96
|
+
kid: string;
|
|
97
|
+
} & {
|
|
98
|
+
[k: string]: unknown;
|
|
99
|
+
};
|
|
100
100
|
scopeId?: string | undefined;
|
|
101
101
|
}>;
|
|
102
102
|
export type AuditContext = {
|
|
@@ -153,33 +153,33 @@ export declare const AuditEventContextSchema: z.ZodObject<{
|
|
|
153
153
|
*/
|
|
154
154
|
eventData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
155
155
|
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
session: {
|
|
157
|
+
audience: string;
|
|
158
|
+
sessionId: string;
|
|
159
|
+
} & {
|
|
160
|
+
[k: string]: unknown;
|
|
161
|
+
};
|
|
156
162
|
identity: {
|
|
157
163
|
did: string;
|
|
158
164
|
kid: string;
|
|
159
165
|
} & {
|
|
160
166
|
[k: string]: unknown;
|
|
161
167
|
};
|
|
168
|
+
eventType: string;
|
|
169
|
+
eventData?: Record<string, unknown> | undefined;
|
|
170
|
+
}, {
|
|
162
171
|
session: {
|
|
163
|
-
sessionId: string;
|
|
164
172
|
audience: string;
|
|
173
|
+
sessionId: string;
|
|
165
174
|
} & {
|
|
166
175
|
[k: string]: unknown;
|
|
167
176
|
};
|
|
168
|
-
eventType: string;
|
|
169
|
-
eventData?: Record<string, unknown> | undefined;
|
|
170
|
-
}, {
|
|
171
177
|
identity: {
|
|
172
178
|
did: string;
|
|
173
179
|
kid: string;
|
|
174
180
|
} & {
|
|
175
181
|
[k: string]: unknown;
|
|
176
182
|
};
|
|
177
|
-
session: {
|
|
178
|
-
sessionId: string;
|
|
179
|
-
audience: string;
|
|
180
|
-
} & {
|
|
181
|
-
[k: string]: unknown;
|
|
182
|
-
};
|
|
183
183
|
eventType: string;
|
|
184
184
|
eventData?: Record<string, unknown> | undefined;
|
|
185
185
|
}>;
|
|
@@ -149,9 +149,9 @@ export declare const OAuthProviderSchema: z.ZodObject<{
|
|
|
149
149
|
requiresClientSecret: boolean;
|
|
150
150
|
responseType: string;
|
|
151
151
|
grantType: string;
|
|
152
|
+
scopes?: string[] | undefined;
|
|
152
153
|
clientSecret?: string | null | undefined;
|
|
153
154
|
userInfoUrl?: string | undefined;
|
|
154
|
-
scopes?: string[] | undefined;
|
|
155
155
|
defaultScopes?: string[] | undefined;
|
|
156
156
|
proxyMode?: boolean | undefined;
|
|
157
157
|
customParams?: Record<string, string> | undefined;
|
|
@@ -162,9 +162,9 @@ export declare const OAuthProviderSchema: z.ZodObject<{
|
|
|
162
162
|
tokenUrl: string;
|
|
163
163
|
supportsPKCE: boolean;
|
|
164
164
|
requiresClientSecret: boolean;
|
|
165
|
+
scopes?: string[] | undefined;
|
|
165
166
|
clientSecret?: string | null | undefined;
|
|
166
167
|
userInfoUrl?: string | undefined;
|
|
167
|
-
scopes?: string[] | undefined;
|
|
168
168
|
defaultScopes?: string[] | undefined;
|
|
169
169
|
proxyMode?: boolean | undefined;
|
|
170
170
|
customParams?: Record<string, string> | undefined;
|
|
@@ -199,9 +199,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
199
199
|
requiresClientSecret: boolean;
|
|
200
200
|
responseType: string;
|
|
201
201
|
grantType: string;
|
|
202
|
+
scopes?: string[] | undefined;
|
|
202
203
|
clientSecret?: string | null | undefined;
|
|
203
204
|
userInfoUrl?: string | undefined;
|
|
204
|
-
scopes?: string[] | undefined;
|
|
205
205
|
defaultScopes?: string[] | undefined;
|
|
206
206
|
proxyMode?: boolean | undefined;
|
|
207
207
|
customParams?: Record<string, string> | undefined;
|
|
@@ -212,9 +212,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
212
212
|
tokenUrl: string;
|
|
213
213
|
supportsPKCE: boolean;
|
|
214
214
|
requiresClientSecret: boolean;
|
|
215
|
+
scopes?: string[] | undefined;
|
|
215
216
|
clientSecret?: string | null | undefined;
|
|
216
217
|
userInfoUrl?: string | undefined;
|
|
217
|
-
scopes?: string[] | undefined;
|
|
218
218
|
defaultScopes?: string[] | undefined;
|
|
219
219
|
proxyMode?: boolean | undefined;
|
|
220
220
|
customParams?: Record<string, string> | undefined;
|
|
@@ -231,9 +231,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
231
231
|
requiresClientSecret: boolean;
|
|
232
232
|
responseType: string;
|
|
233
233
|
grantType: string;
|
|
234
|
+
scopes?: string[] | undefined;
|
|
234
235
|
clientSecret?: string | null | undefined;
|
|
235
236
|
userInfoUrl?: string | undefined;
|
|
236
|
-
scopes?: string[] | undefined;
|
|
237
237
|
defaultScopes?: string[] | undefined;
|
|
238
238
|
proxyMode?: boolean | undefined;
|
|
239
239
|
customParams?: Record<string, string> | undefined;
|
|
@@ -246,9 +246,9 @@ export declare const OAuthConfigSchema: z.ZodObject<{
|
|
|
246
246
|
tokenUrl: string;
|
|
247
247
|
supportsPKCE: boolean;
|
|
248
248
|
requiresClientSecret: boolean;
|
|
249
|
+
scopes?: string[] | undefined;
|
|
249
250
|
clientSecret?: string | null | undefined;
|
|
250
251
|
userInfoUrl?: string | undefined;
|
|
251
|
-
scopes?: string[] | undefined;
|
|
252
252
|
defaultScopes?: string[] | undefined;
|
|
253
253
|
proxyMode?: boolean | undefined;
|
|
254
254
|
customParams?: Record<string, string> | undefined;
|
|
@@ -38,13 +38,13 @@ export declare const consentTermsSchema: z.ZodObject<{
|
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
required: boolean;
|
|
40
40
|
version?: string | undefined;
|
|
41
|
-
text?: string | undefined;
|
|
42
41
|
url?: string | undefined;
|
|
42
|
+
text?: string | undefined;
|
|
43
43
|
}, {
|
|
44
|
-
required?: boolean | undefined;
|
|
45
44
|
version?: string | undefined;
|
|
46
|
-
text?: string | undefined;
|
|
47
45
|
url?: string | undefined;
|
|
46
|
+
required?: boolean | undefined;
|
|
47
|
+
text?: string | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type ConsentTerms = z.infer<typeof consentTermsSchema>;
|
|
50
50
|
/**
|
|
@@ -82,8 +82,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
82
82
|
pattern: z.ZodOptional<z.ZodString>;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
84
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
85
|
-
required: boolean;
|
|
86
85
|
name: string;
|
|
86
|
+
required: boolean;
|
|
87
87
|
label: string;
|
|
88
88
|
options?: {
|
|
89
89
|
value: string;
|
|
@@ -93,8 +93,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
93
93
|
pattern?: string | undefined;
|
|
94
94
|
}, {
|
|
95
95
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
96
|
-
required: boolean;
|
|
97
96
|
name: string;
|
|
97
|
+
required: boolean;
|
|
98
98
|
label: string;
|
|
99
99
|
options?: {
|
|
100
100
|
value: string;
|
|
@@ -104,8 +104,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
104
104
|
pattern?: string | undefined;
|
|
105
105
|
}>, {
|
|
106
106
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
107
|
-
required: boolean;
|
|
108
107
|
name: string;
|
|
108
|
+
required: boolean;
|
|
109
109
|
label: string;
|
|
110
110
|
options?: {
|
|
111
111
|
value: string;
|
|
@@ -115,8 +115,8 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
115
115
|
pattern?: string | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
118
|
-
required: boolean;
|
|
119
118
|
name: string;
|
|
119
|
+
required: boolean;
|
|
120
120
|
label: string;
|
|
121
121
|
options?: {
|
|
122
122
|
value: string;
|
|
@@ -151,13 +151,13 @@ export declare const oauthIdentitySchema: z.ZodObject<{
|
|
|
151
151
|
*/
|
|
152
152
|
name: z.ZodOptional<z.ZodString>;
|
|
153
153
|
}, "strip", z.ZodTypeAny, {
|
|
154
|
-
provider: string;
|
|
155
154
|
subject: string;
|
|
155
|
+
provider: string;
|
|
156
156
|
name?: string | undefined;
|
|
157
157
|
email?: string | undefined;
|
|
158
158
|
}, {
|
|
159
|
-
provider: string;
|
|
160
159
|
subject: string;
|
|
160
|
+
provider: string;
|
|
161
161
|
name?: string | undefined;
|
|
162
162
|
email?: string | undefined;
|
|
163
163
|
}>;
|
|
@@ -197,13 +197,13 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
197
197
|
}, "strip", z.ZodTypeAny, {
|
|
198
198
|
required: boolean;
|
|
199
199
|
version?: string | undefined;
|
|
200
|
-
text?: string | undefined;
|
|
201
200
|
url?: string | undefined;
|
|
201
|
+
text?: string | undefined;
|
|
202
202
|
}, {
|
|
203
|
-
required?: boolean | undefined;
|
|
204
203
|
version?: string | undefined;
|
|
205
|
-
text?: string | undefined;
|
|
206
204
|
url?: string | undefined;
|
|
205
|
+
required?: boolean | undefined;
|
|
206
|
+
text?: string | undefined;
|
|
207
207
|
}>>;
|
|
208
208
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
209
209
|
name: z.ZodString;
|
|
@@ -224,8 +224,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
224
224
|
pattern: z.ZodOptional<z.ZodString>;
|
|
225
225
|
}, "strip", z.ZodTypeAny, {
|
|
226
226
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
227
|
-
required: boolean;
|
|
228
227
|
name: string;
|
|
228
|
+
required: boolean;
|
|
229
229
|
label: string;
|
|
230
230
|
options?: {
|
|
231
231
|
value: string;
|
|
@@ -235,8 +235,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
235
235
|
pattern?: string | undefined;
|
|
236
236
|
}, {
|
|
237
237
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
238
|
-
required: boolean;
|
|
239
238
|
name: string;
|
|
239
|
+
required: boolean;
|
|
240
240
|
label: string;
|
|
241
241
|
options?: {
|
|
242
242
|
value: string;
|
|
@@ -246,8 +246,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
246
246
|
pattern?: string | undefined;
|
|
247
247
|
}>, {
|
|
248
248
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
249
|
-
required: boolean;
|
|
250
249
|
name: string;
|
|
250
|
+
required: boolean;
|
|
251
251
|
label: string;
|
|
252
252
|
options?: {
|
|
253
253
|
value: string;
|
|
@@ -257,8 +257,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
257
257
|
pattern?: string | undefined;
|
|
258
258
|
}, {
|
|
259
259
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
260
|
-
required: boolean;
|
|
261
260
|
name: string;
|
|
261
|
+
required: boolean;
|
|
262
262
|
label: string;
|
|
263
263
|
options?: {
|
|
264
264
|
value: string;
|
|
@@ -269,14 +269,24 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
269
269
|
}>, "many">>;
|
|
270
270
|
serverUrl: z.ZodString;
|
|
271
271
|
autoClose: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
/**
|
|
273
|
+
* Whether OAuth authorization is required immediately
|
|
274
|
+
* If true, the consent page will act as a landing page before redirecting
|
|
275
|
+
*/
|
|
276
|
+
oauthRequired: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
+
/**
|
|
278
|
+
* The OAuth authorization URL to redirect to
|
|
279
|
+
* Required if oauthRequired is true
|
|
280
|
+
*/
|
|
281
|
+
oauthUrl: z.ZodOptional<z.ZodString>;
|
|
272
282
|
}, "strip", z.ZodTypeAny, {
|
|
273
283
|
agentDid: string;
|
|
274
|
-
|
|
275
|
-
projectId: string;
|
|
284
|
+
sessionId: string;
|
|
276
285
|
tool: string;
|
|
277
|
-
toolDescription: string;
|
|
278
286
|
scopes: string[];
|
|
279
|
-
|
|
287
|
+
projectId: string;
|
|
288
|
+
toolDescription: string;
|
|
289
|
+
serverUrl: string;
|
|
280
290
|
provider?: string | undefined;
|
|
281
291
|
branding?: {
|
|
282
292
|
primaryColor?: string | undefined;
|
|
@@ -287,13 +297,13 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
287
297
|
terms?: {
|
|
288
298
|
required: boolean;
|
|
289
299
|
version?: string | undefined;
|
|
290
|
-
text?: string | undefined;
|
|
291
300
|
url?: string | undefined;
|
|
301
|
+
text?: string | undefined;
|
|
292
302
|
} | undefined;
|
|
293
303
|
customFields?: {
|
|
294
304
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
295
|
-
required: boolean;
|
|
296
305
|
name: string;
|
|
306
|
+
required: boolean;
|
|
297
307
|
label: string;
|
|
298
308
|
options?: {
|
|
299
309
|
value: string;
|
|
@@ -303,14 +313,16 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
303
313
|
pattern?: string | undefined;
|
|
304
314
|
}[] | undefined;
|
|
305
315
|
autoClose?: boolean | undefined;
|
|
316
|
+
oauthRequired?: boolean | undefined;
|
|
317
|
+
oauthUrl?: string | undefined;
|
|
306
318
|
}, {
|
|
307
319
|
agentDid: string;
|
|
308
|
-
|
|
309
|
-
projectId: string;
|
|
320
|
+
sessionId: string;
|
|
310
321
|
tool: string;
|
|
311
|
-
toolDescription: string;
|
|
312
322
|
scopes: string[];
|
|
313
|
-
|
|
323
|
+
projectId: string;
|
|
324
|
+
toolDescription: string;
|
|
325
|
+
serverUrl: string;
|
|
314
326
|
provider?: string | undefined;
|
|
315
327
|
branding?: {
|
|
316
328
|
primaryColor?: string | undefined;
|
|
@@ -319,15 +331,15 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
319
331
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
320
332
|
} | undefined;
|
|
321
333
|
terms?: {
|
|
322
|
-
required?: boolean | undefined;
|
|
323
334
|
version?: string | undefined;
|
|
324
|
-
text?: string | undefined;
|
|
325
335
|
url?: string | undefined;
|
|
336
|
+
required?: boolean | undefined;
|
|
337
|
+
text?: string | undefined;
|
|
326
338
|
} | undefined;
|
|
327
339
|
customFields?: {
|
|
328
340
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
329
|
-
required: boolean;
|
|
330
341
|
name: string;
|
|
342
|
+
required: boolean;
|
|
331
343
|
label: string;
|
|
332
344
|
options?: {
|
|
333
345
|
value: string;
|
|
@@ -337,6 +349,8 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
337
349
|
pattern?: string | undefined;
|
|
338
350
|
}[] | undefined;
|
|
339
351
|
autoClose?: boolean | undefined;
|
|
352
|
+
oauthRequired?: boolean | undefined;
|
|
353
|
+
oauthUrl?: string | undefined;
|
|
340
354
|
}>;
|
|
341
355
|
export type ConsentPageConfig = z.infer<typeof consentPageConfigSchema>;
|
|
342
356
|
/**
|
|
@@ -383,13 +397,13 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
383
397
|
*/
|
|
384
398
|
name: z.ZodOptional<z.ZodString>;
|
|
385
399
|
}, "strip", z.ZodTypeAny, {
|
|
386
|
-
provider: string;
|
|
387
400
|
subject: string;
|
|
401
|
+
provider: string;
|
|
388
402
|
name?: string | undefined;
|
|
389
403
|
email?: string | undefined;
|
|
390
404
|
}, {
|
|
391
|
-
provider: string;
|
|
392
405
|
subject: string;
|
|
406
|
+
provider: string;
|
|
393
407
|
name?: string | undefined;
|
|
394
408
|
email?: string | undefined;
|
|
395
409
|
}>>>;
|
|
@@ -401,32 +415,32 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
401
415
|
user_did: z.ZodOptional<z.ZodString>;
|
|
402
416
|
}, "strip", z.ZodTypeAny, {
|
|
403
417
|
tool: string;
|
|
418
|
+
session_id: string;
|
|
404
419
|
scopes: string[];
|
|
405
420
|
agent_did: string;
|
|
406
|
-
session_id: string;
|
|
407
421
|
project_id: string;
|
|
408
422
|
termsAccepted: boolean;
|
|
409
423
|
customFields?: Record<string, string | boolean> | undefined;
|
|
410
424
|
termsVersion?: string | undefined;
|
|
411
425
|
oauth_identity?: {
|
|
412
|
-
provider: string;
|
|
413
426
|
subject: string;
|
|
427
|
+
provider: string;
|
|
414
428
|
name?: string | undefined;
|
|
415
429
|
email?: string | undefined;
|
|
416
430
|
} | null | undefined;
|
|
417
431
|
user_did?: string | undefined;
|
|
418
432
|
}, {
|
|
419
433
|
tool: string;
|
|
434
|
+
session_id: string;
|
|
420
435
|
scopes: string[];
|
|
421
436
|
agent_did: string;
|
|
422
|
-
session_id: string;
|
|
423
437
|
project_id: string;
|
|
424
438
|
termsAccepted: boolean;
|
|
425
439
|
customFields?: Record<string, string | boolean> | undefined;
|
|
426
440
|
termsVersion?: string | undefined;
|
|
427
441
|
oauth_identity?: {
|
|
428
|
-
provider: string;
|
|
429
442
|
subject: string;
|
|
443
|
+
provider: string;
|
|
430
444
|
name?: string | undefined;
|
|
431
445
|
email?: string | undefined;
|
|
432
446
|
} | null | undefined;
|
|
@@ -496,13 +510,13 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
496
510
|
}, "strip", z.ZodTypeAny, {
|
|
497
511
|
required: boolean;
|
|
498
512
|
version?: string | undefined;
|
|
499
|
-
text?: string | undefined;
|
|
500
513
|
url?: string | undefined;
|
|
514
|
+
text?: string | undefined;
|
|
501
515
|
}, {
|
|
502
|
-
required?: boolean | undefined;
|
|
503
516
|
version?: string | undefined;
|
|
504
|
-
text?: string | undefined;
|
|
505
517
|
url?: string | undefined;
|
|
518
|
+
required?: boolean | undefined;
|
|
519
|
+
text?: string | undefined;
|
|
506
520
|
}>>;
|
|
507
521
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
508
522
|
name: z.ZodString;
|
|
@@ -523,8 +537,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
523
537
|
pattern: z.ZodOptional<z.ZodString>;
|
|
524
538
|
}, "strip", z.ZodTypeAny, {
|
|
525
539
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
526
|
-
required: boolean;
|
|
527
540
|
name: string;
|
|
541
|
+
required: boolean;
|
|
528
542
|
label: string;
|
|
529
543
|
options?: {
|
|
530
544
|
value: string;
|
|
@@ -534,8 +548,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
534
548
|
pattern?: string | undefined;
|
|
535
549
|
}, {
|
|
536
550
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
537
|
-
required: boolean;
|
|
538
551
|
name: string;
|
|
552
|
+
required: boolean;
|
|
539
553
|
label: string;
|
|
540
554
|
options?: {
|
|
541
555
|
value: string;
|
|
@@ -545,8 +559,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
545
559
|
pattern?: string | undefined;
|
|
546
560
|
}>, {
|
|
547
561
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
548
|
-
required: boolean;
|
|
549
562
|
name: string;
|
|
563
|
+
required: boolean;
|
|
550
564
|
label: string;
|
|
551
565
|
options?: {
|
|
552
566
|
value: string;
|
|
@@ -556,8 +570,8 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
556
570
|
pattern?: string | undefined;
|
|
557
571
|
}, {
|
|
558
572
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
559
|
-
required: boolean;
|
|
560
573
|
name: string;
|
|
574
|
+
required: boolean;
|
|
561
575
|
label: string;
|
|
562
576
|
options?: {
|
|
563
577
|
value: string;
|
|
@@ -592,13 +606,13 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
592
606
|
terms?: {
|
|
593
607
|
required: boolean;
|
|
594
608
|
version?: string | undefined;
|
|
595
|
-
text?: string | undefined;
|
|
596
609
|
url?: string | undefined;
|
|
610
|
+
text?: string | undefined;
|
|
597
611
|
} | undefined;
|
|
598
612
|
customFields?: {
|
|
599
613
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
600
|
-
required: boolean;
|
|
601
614
|
name: string;
|
|
615
|
+
required: boolean;
|
|
602
616
|
label: string;
|
|
603
617
|
options?: {
|
|
604
618
|
value: string;
|
|
@@ -621,15 +635,15 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
621
635
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
622
636
|
} | undefined;
|
|
623
637
|
terms?: {
|
|
624
|
-
required?: boolean | undefined;
|
|
625
638
|
version?: string | undefined;
|
|
626
|
-
text?: string | undefined;
|
|
627
639
|
url?: string | undefined;
|
|
640
|
+
required?: boolean | undefined;
|
|
641
|
+
text?: string | undefined;
|
|
628
642
|
} | undefined;
|
|
629
643
|
customFields?: {
|
|
630
644
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
631
|
-
required: boolean;
|
|
632
645
|
name: string;
|
|
646
|
+
required: boolean;
|
|
633
647
|
label: string;
|
|
634
648
|
options?: {
|
|
635
649
|
value: string;
|
|
@@ -657,12 +671,12 @@ export type ConsentConfig = z.infer<typeof consentConfigSchema>;
|
|
|
657
671
|
*/
|
|
658
672
|
export declare function validateConsentPageConfig(config: unknown): z.SafeParseReturnType<{
|
|
659
673
|
agentDid: string;
|
|
660
|
-
|
|
661
|
-
projectId: string;
|
|
674
|
+
sessionId: string;
|
|
662
675
|
tool: string;
|
|
663
|
-
toolDescription: string;
|
|
664
676
|
scopes: string[];
|
|
665
|
-
|
|
677
|
+
projectId: string;
|
|
678
|
+
toolDescription: string;
|
|
679
|
+
serverUrl: string;
|
|
666
680
|
provider?: string | undefined;
|
|
667
681
|
branding?: {
|
|
668
682
|
primaryColor?: string | undefined;
|
|
@@ -671,15 +685,15 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
671
685
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
672
686
|
} | undefined;
|
|
673
687
|
terms?: {
|
|
674
|
-
required?: boolean | undefined;
|
|
675
688
|
version?: string | undefined;
|
|
676
|
-
text?: string | undefined;
|
|
677
689
|
url?: string | undefined;
|
|
690
|
+
required?: boolean | undefined;
|
|
691
|
+
text?: string | undefined;
|
|
678
692
|
} | undefined;
|
|
679
693
|
customFields?: {
|
|
680
694
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
681
|
-
required: boolean;
|
|
682
695
|
name: string;
|
|
696
|
+
required: boolean;
|
|
683
697
|
label: string;
|
|
684
698
|
options?: {
|
|
685
699
|
value: string;
|
|
@@ -689,14 +703,16 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
689
703
|
pattern?: string | undefined;
|
|
690
704
|
}[] | undefined;
|
|
691
705
|
autoClose?: boolean | undefined;
|
|
706
|
+
oauthRequired?: boolean | undefined;
|
|
707
|
+
oauthUrl?: string | undefined;
|
|
692
708
|
}, {
|
|
693
709
|
agentDid: string;
|
|
694
|
-
|
|
695
|
-
projectId: string;
|
|
710
|
+
sessionId: string;
|
|
696
711
|
tool: string;
|
|
697
|
-
toolDescription: string;
|
|
698
712
|
scopes: string[];
|
|
699
|
-
|
|
713
|
+
projectId: string;
|
|
714
|
+
toolDescription: string;
|
|
715
|
+
serverUrl: string;
|
|
700
716
|
provider?: string | undefined;
|
|
701
717
|
branding?: {
|
|
702
718
|
primaryColor?: string | undefined;
|
|
@@ -707,13 +723,13 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
707
723
|
terms?: {
|
|
708
724
|
required: boolean;
|
|
709
725
|
version?: string | undefined;
|
|
710
|
-
text?: string | undefined;
|
|
711
726
|
url?: string | undefined;
|
|
727
|
+
text?: string | undefined;
|
|
712
728
|
} | undefined;
|
|
713
729
|
customFields?: {
|
|
714
730
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
715
|
-
required: boolean;
|
|
716
731
|
name: string;
|
|
732
|
+
required: boolean;
|
|
717
733
|
label: string;
|
|
718
734
|
options?: {
|
|
719
735
|
value: string;
|
|
@@ -723,6 +739,8 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
723
739
|
pattern?: string | undefined;
|
|
724
740
|
}[] | undefined;
|
|
725
741
|
autoClose?: boolean | undefined;
|
|
742
|
+
oauthRequired?: boolean | undefined;
|
|
743
|
+
oauthUrl?: string | undefined;
|
|
726
744
|
}>;
|
|
727
745
|
/**
|
|
728
746
|
* Validate a consent approval request
|
|
@@ -732,32 +750,32 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
732
750
|
*/
|
|
733
751
|
export declare function validateConsentApprovalRequest(request: unknown): z.SafeParseReturnType<{
|
|
734
752
|
tool: string;
|
|
753
|
+
session_id: string;
|
|
735
754
|
scopes: string[];
|
|
736
755
|
agent_did: string;
|
|
737
|
-
session_id: string;
|
|
738
756
|
project_id: string;
|
|
739
757
|
termsAccepted: boolean;
|
|
740
758
|
customFields?: Record<string, string | boolean> | undefined;
|
|
741
759
|
termsVersion?: string | undefined;
|
|
742
760
|
oauth_identity?: {
|
|
743
|
-
provider: string;
|
|
744
761
|
subject: string;
|
|
762
|
+
provider: string;
|
|
745
763
|
name?: string | undefined;
|
|
746
764
|
email?: string | undefined;
|
|
747
765
|
} | null | undefined;
|
|
748
766
|
user_did?: string | undefined;
|
|
749
767
|
}, {
|
|
750
768
|
tool: string;
|
|
769
|
+
session_id: string;
|
|
751
770
|
scopes: string[];
|
|
752
771
|
agent_did: string;
|
|
753
|
-
session_id: string;
|
|
754
772
|
project_id: string;
|
|
755
773
|
termsAccepted: boolean;
|
|
756
774
|
customFields?: Record<string, string | boolean> | undefined;
|
|
757
775
|
termsVersion?: string | undefined;
|
|
758
776
|
oauth_identity?: {
|
|
759
|
-
provider: string;
|
|
760
777
|
subject: string;
|
|
778
|
+
provider: string;
|
|
761
779
|
name?: string | undefined;
|
|
762
780
|
email?: string | undefined;
|
|
763
781
|
} | null | undefined;
|
|
@@ -796,15 +814,15 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
796
814
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
797
815
|
} | undefined;
|
|
798
816
|
terms?: {
|
|
799
|
-
required?: boolean | undefined;
|
|
800
817
|
version?: string | undefined;
|
|
801
|
-
text?: string | undefined;
|
|
802
818
|
url?: string | undefined;
|
|
819
|
+
required?: boolean | undefined;
|
|
820
|
+
text?: string | undefined;
|
|
803
821
|
} | undefined;
|
|
804
822
|
customFields?: {
|
|
805
823
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
806
|
-
required: boolean;
|
|
807
824
|
name: string;
|
|
825
|
+
required: boolean;
|
|
808
826
|
label: string;
|
|
809
827
|
options?: {
|
|
810
828
|
value: string;
|
|
@@ -829,13 +847,13 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
829
847
|
terms?: {
|
|
830
848
|
required: boolean;
|
|
831
849
|
version?: string | undefined;
|
|
832
|
-
text?: string | undefined;
|
|
833
850
|
url?: string | undefined;
|
|
851
|
+
text?: string | undefined;
|
|
834
852
|
} | undefined;
|
|
835
853
|
customFields?: {
|
|
836
854
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
837
|
-
required: boolean;
|
|
838
855
|
name: string;
|
|
856
|
+
required: boolean;
|
|
839
857
|
label: string;
|
|
840
858
|
options?: {
|
|
841
859
|
value: string;
|
package/dist/consent/schemas.js
CHANGED
|
@@ -150,6 +150,16 @@ exports.consentPageConfigSchema = zod_1.z.object({
|
|
|
150
150
|
.optional(),
|
|
151
151
|
serverUrl: zod_1.z.string().url("Server URL must be a valid URL"),
|
|
152
152
|
autoClose: zod_1.z.boolean().optional(),
|
|
153
|
+
/**
|
|
154
|
+
* Whether OAuth authorization is required immediately
|
|
155
|
+
* If true, the consent page will act as a landing page before redirecting
|
|
156
|
+
*/
|
|
157
|
+
oauthRequired: zod_1.z.boolean().optional(),
|
|
158
|
+
/**
|
|
159
|
+
* The OAuth authorization URL to redirect to
|
|
160
|
+
* Required if oauthRequired is true
|
|
161
|
+
*/
|
|
162
|
+
oauthUrl: zod_1.z.string().url().optional(),
|
|
153
163
|
});
|
|
154
164
|
/**
|
|
155
165
|
* Consent Approval Request Schema
|