@kya-os/contracts 1.6.18 → 1.7.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/dist/agentshield-api/schemas.d.ts +154 -154
- package/dist/audit/index.d.ts +24 -24
- package/dist/cli.d.ts +67 -22
- package/dist/cli.js +38 -14
- package/dist/config/identity.d.ts +117 -0
- package/dist/config/identity.js +34 -2
- package/dist/consent/index.d.ts +8 -2
- package/dist/consent/index.js +73 -17
- package/dist/consent/schemas.d.ts +123 -123
- package/dist/consent/schemas.js +1 -1
- package/dist/consent/types.d.ts +1 -1
- package/dist/dashboard-config/schemas.d.ts +2241 -2241
- package/dist/delegation/schemas.d.ts +34 -34
- package/dist/deploy/schemas.d.ts +110 -110
- package/dist/handshake.d.ts +4 -4
- package/dist/handshake.js +2 -2
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.js +7 -0
- package/dist/index.js +1 -0
- package/dist/proof.d.ts +12 -12
- package/dist/registry.d.ts +8 -8
- package/dist/reputation/api.d.ts +2883 -0
- package/dist/reputation/api.js +417 -0
- package/dist/reputation/constants.d.ts +242 -0
- package/dist/reputation/constants.js +259 -0
- package/dist/reputation/credentials.d.ts +1493 -0
- package/dist/reputation/credentials.js +302 -0
- package/dist/reputation/index.d.ts +20 -0
- package/dist/reputation/index.js +40 -0
- package/dist/reputation/schemas.d.ts +1600 -0
- package/dist/reputation/schemas.js +499 -0
- package/dist/test.d.ts +12 -12
- package/dist/tool-protection/index.d.ts +18 -18
- package/dist/verifier.d.ts +8 -8
- package/dist/well-known/index.d.ts +716 -11
- package/dist/well-known/index.js +169 -1
- package/package.json +6 -1
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
|
}>;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { KTARegistrationSchema } from "./config/identity.js";
|
|
2
3
|
/**
|
|
3
4
|
* CLI command schemas and results
|
|
4
5
|
*/
|
|
6
|
+
export { KTARegistration, KTARegistrationSchema } from "./config/identity.js";
|
|
5
7
|
/**
|
|
6
8
|
* CLI Identity File Format Schema
|
|
7
9
|
*
|
|
@@ -17,39 +19,76 @@ export declare const CLIIdentityFileSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
17
19
|
publicKey: z.ZodString;
|
|
18
20
|
createdAt: z.ZodString;
|
|
19
21
|
lastRotated: z.ZodOptional<z.ZodString>;
|
|
22
|
+
/**
|
|
23
|
+
* Know That AI registration information
|
|
24
|
+
* Present when agent is registered with KTA for reputation tracking
|
|
25
|
+
*/
|
|
26
|
+
kta: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
registered: z.ZodBoolean;
|
|
28
|
+
registeredAt: z.ZodString;
|
|
29
|
+
claimUrl: z.ZodNullable<z.ZodString>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
registered: boolean;
|
|
32
|
+
registeredAt: string;
|
|
33
|
+
claimUrl: string | null;
|
|
34
|
+
}, {
|
|
35
|
+
registered: boolean;
|
|
36
|
+
registeredAt: string;
|
|
37
|
+
claimUrl: string | null;
|
|
38
|
+
}>>;
|
|
20
39
|
}, "strip", z.ZodTypeAny, {
|
|
21
40
|
version: "1.0";
|
|
22
41
|
did: string;
|
|
23
|
-
privateKey: string;
|
|
24
42
|
publicKey: string;
|
|
43
|
+
privateKey: string;
|
|
25
44
|
createdAt: string;
|
|
45
|
+
kta?: {
|
|
46
|
+
registered: boolean;
|
|
47
|
+
registeredAt: string;
|
|
48
|
+
claimUrl: string | null;
|
|
49
|
+
} | undefined;
|
|
26
50
|
kid?: string | undefined;
|
|
27
51
|
keyId?: string | undefined;
|
|
28
52
|
lastRotated?: string | undefined;
|
|
29
53
|
}, {
|
|
30
54
|
version: "1.0";
|
|
31
55
|
did: string;
|
|
32
|
-
privateKey: string;
|
|
33
56
|
publicKey: string;
|
|
57
|
+
privateKey: string;
|
|
34
58
|
createdAt: string;
|
|
59
|
+
kta?: {
|
|
60
|
+
registered: boolean;
|
|
61
|
+
registeredAt: string;
|
|
62
|
+
claimUrl: string | null;
|
|
63
|
+
} | undefined;
|
|
35
64
|
kid?: string | undefined;
|
|
36
65
|
keyId?: string | undefined;
|
|
37
66
|
lastRotated?: string | undefined;
|
|
38
67
|
}>, {
|
|
39
68
|
version: "1.0";
|
|
40
69
|
did: string;
|
|
41
|
-
privateKey: string;
|
|
42
70
|
publicKey: string;
|
|
71
|
+
privateKey: string;
|
|
43
72
|
createdAt: string;
|
|
73
|
+
kta?: {
|
|
74
|
+
registered: boolean;
|
|
75
|
+
registeredAt: string;
|
|
76
|
+
claimUrl: string | null;
|
|
77
|
+
} | undefined;
|
|
44
78
|
kid?: string | undefined;
|
|
45
79
|
keyId?: string | undefined;
|
|
46
80
|
lastRotated?: string | undefined;
|
|
47
81
|
}, {
|
|
48
82
|
version: "1.0";
|
|
49
83
|
did: string;
|
|
50
|
-
privateKey: string;
|
|
51
84
|
publicKey: string;
|
|
85
|
+
privateKey: string;
|
|
52
86
|
createdAt: string;
|
|
87
|
+
kta?: {
|
|
88
|
+
registered: boolean;
|
|
89
|
+
registeredAt: string;
|
|
90
|
+
claimUrl: string | null;
|
|
91
|
+
} | undefined;
|
|
53
92
|
kid?: string | undefined;
|
|
54
93
|
keyId?: string | undefined;
|
|
55
94
|
lastRotated?: string | undefined;
|
|
@@ -60,13 +99,19 @@ export declare const CLIIdentityFileSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
60
99
|
privateKey: string;
|
|
61
100
|
publicKey: string;
|
|
62
101
|
createdAt: string;
|
|
63
|
-
lastRotated
|
|
102
|
+
lastRotated?: string;
|
|
103
|
+
kta?: z.infer<typeof KTARegistrationSchema>;
|
|
64
104
|
}, {
|
|
65
105
|
version: "1.0";
|
|
66
106
|
did: string;
|
|
67
|
-
privateKey: string;
|
|
68
107
|
publicKey: string;
|
|
108
|
+
privateKey: string;
|
|
69
109
|
createdAt: string;
|
|
110
|
+
kta?: {
|
|
111
|
+
registered: boolean;
|
|
112
|
+
registeredAt: string;
|
|
113
|
+
claimUrl: string | null;
|
|
114
|
+
} | undefined;
|
|
70
115
|
kid?: string | undefined;
|
|
71
116
|
keyId?: string | undefined;
|
|
72
117
|
lastRotated?: string | undefined;
|
|
@@ -127,13 +172,13 @@ export declare const PackageInfoSchema: z.ZodObject<{
|
|
|
127
172
|
compatible: z.ZodBoolean;
|
|
128
173
|
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
129
174
|
}, "strip", z.ZodTypeAny, {
|
|
130
|
-
version: string;
|
|
131
175
|
name: string;
|
|
176
|
+
version: string;
|
|
132
177
|
compatible: boolean;
|
|
133
178
|
issues?: string[] | undefined;
|
|
134
179
|
}, {
|
|
135
|
-
version: string;
|
|
136
180
|
name: string;
|
|
181
|
+
version: string;
|
|
137
182
|
compatible: boolean;
|
|
138
183
|
issues?: string[] | undefined;
|
|
139
184
|
}>;
|
|
@@ -196,13 +241,13 @@ export declare const DoctorResultSchema: z.ZodObject<{
|
|
|
196
241
|
compatible: z.ZodBoolean;
|
|
197
242
|
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
198
243
|
}, "strip", z.ZodTypeAny, {
|
|
199
|
-
version: string;
|
|
200
244
|
name: string;
|
|
245
|
+
version: string;
|
|
201
246
|
compatible: boolean;
|
|
202
247
|
issues?: string[] | undefined;
|
|
203
248
|
}, {
|
|
204
|
-
version: string;
|
|
205
249
|
name: string;
|
|
250
|
+
version: string;
|
|
206
251
|
compatible: boolean;
|
|
207
252
|
issues?: string[] | undefined;
|
|
208
253
|
}>, "many">;
|
|
@@ -259,14 +304,19 @@ export declare const DoctorResultSchema: z.ZodObject<{
|
|
|
259
304
|
issues?: string[] | undefined;
|
|
260
305
|
}>;
|
|
261
306
|
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
kta: {
|
|
308
|
+
reachable: boolean;
|
|
309
|
+
authenticated: boolean;
|
|
310
|
+
issues?: string[] | undefined;
|
|
311
|
+
};
|
|
262
312
|
environment: {
|
|
263
313
|
valid: boolean;
|
|
264
314
|
missing: string[];
|
|
265
315
|
issues?: string[] | undefined;
|
|
266
316
|
};
|
|
267
317
|
packages: {
|
|
268
|
-
version: string;
|
|
269
318
|
name: string;
|
|
319
|
+
version: string;
|
|
270
320
|
compatible: boolean;
|
|
271
321
|
issues?: string[] | undefined;
|
|
272
322
|
}[];
|
|
@@ -275,25 +325,25 @@ export declare const DoctorResultSchema: z.ZodObject<{
|
|
|
275
325
|
compatible: boolean;
|
|
276
326
|
issues?: string[] | undefined;
|
|
277
327
|
};
|
|
278
|
-
kta: {
|
|
279
|
-
reachable: boolean;
|
|
280
|
-
authenticated: boolean;
|
|
281
|
-
issues?: string[] | undefined;
|
|
282
|
-
};
|
|
283
328
|
cache: {
|
|
284
329
|
type: string;
|
|
285
330
|
functional: boolean;
|
|
286
331
|
issues?: string[] | undefined;
|
|
287
332
|
};
|
|
288
333
|
}, {
|
|
334
|
+
kta: {
|
|
335
|
+
reachable: boolean;
|
|
336
|
+
authenticated: boolean;
|
|
337
|
+
issues?: string[] | undefined;
|
|
338
|
+
};
|
|
289
339
|
environment: {
|
|
290
340
|
valid: boolean;
|
|
291
341
|
missing: string[];
|
|
292
342
|
issues?: string[] | undefined;
|
|
293
343
|
};
|
|
294
344
|
packages: {
|
|
295
|
-
version: string;
|
|
296
345
|
name: string;
|
|
346
|
+
version: string;
|
|
297
347
|
compatible: boolean;
|
|
298
348
|
issues?: string[] | undefined;
|
|
299
349
|
}[];
|
|
@@ -302,11 +352,6 @@ export declare const DoctorResultSchema: z.ZodObject<{
|
|
|
302
352
|
compatible: boolean;
|
|
303
353
|
issues?: string[] | undefined;
|
|
304
354
|
};
|
|
305
|
-
kta: {
|
|
306
|
-
reachable: boolean;
|
|
307
|
-
authenticated: boolean;
|
|
308
|
-
issues?: string[] | undefined;
|
|
309
|
-
};
|
|
310
355
|
cache: {
|
|
311
356
|
type: string;
|
|
312
357
|
functional: boolean;
|
package/dist/cli.js
CHANGED
|
@@ -1,37 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLI_EXIT_CODES = exports.ERROR_CODES = exports.ScaffolderResultSchema = exports.ScaffolderOptionsSchema = exports.DoctorResultSchema = exports.CacheInfoSchema = exports.KTAInfoSchema = exports.EnvironmentInfoSchema = exports.XMCPUpstreamInfoSchema = exports.PackageInfoSchema = exports.StatusReportSchema = exports.KeyRotationResultSchema = exports.CLIIdentityFileSchema = void 0;
|
|
3
|
+
exports.CLI_EXIT_CODES = exports.ERROR_CODES = exports.ScaffolderResultSchema = exports.ScaffolderOptionsSchema = exports.DoctorResultSchema = exports.CacheInfoSchema = exports.KTAInfoSchema = exports.EnvironmentInfoSchema = exports.XMCPUpstreamInfoSchema = exports.PackageInfoSchema = exports.StatusReportSchema = exports.KeyRotationResultSchema = exports.CLIIdentityFileSchema = exports.KTARegistrationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const identity_js_1 = require("./config/identity.js");
|
|
5
6
|
/**
|
|
6
7
|
* CLI command schemas and results
|
|
7
8
|
*/
|
|
9
|
+
// Re-export KTARegistration types for convenience
|
|
10
|
+
var identity_js_2 = require("./config/identity.js");
|
|
11
|
+
Object.defineProperty(exports, "KTARegistrationSchema", { enumerable: true, get: function () { return identity_js_2.KTARegistrationSchema; } });
|
|
8
12
|
/**
|
|
9
13
|
* CLI Identity File Format Schema
|
|
10
14
|
*
|
|
11
15
|
* Format for identity.json files stored on disk.
|
|
12
16
|
* Used by CLI tools for identity management.
|
|
13
17
|
*/
|
|
14
|
-
exports.CLIIdentityFileSchema = zod_1.z
|
|
18
|
+
exports.CLIIdentityFileSchema = zod_1.z
|
|
19
|
+
.object({
|
|
15
20
|
version: zod_1.z.literal("1.0"),
|
|
16
21
|
did: zod_1.z.string().min(1),
|
|
17
22
|
// Accept both kid and keyId for backward compatibility with pre-1.3 identity files
|
|
18
23
|
kid: zod_1.z.string().min(1).optional(),
|
|
19
24
|
keyId: zod_1.z.string().min(1).optional(),
|
|
20
|
-
privateKey: zod_1.z
|
|
21
|
-
|
|
25
|
+
privateKey: zod_1.z
|
|
26
|
+
.string()
|
|
27
|
+
.regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 private key (44 characters)"),
|
|
28
|
+
publicKey: zod_1.z
|
|
29
|
+
.string()
|
|
30
|
+
.regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 public key (44 characters)"),
|
|
22
31
|
createdAt: zod_1.z.string().datetime(),
|
|
23
32
|
lastRotated: zod_1.z.string().datetime().optional(),
|
|
24
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Know That AI registration information
|
|
35
|
+
* Present when agent is registered with KTA for reputation tracking
|
|
36
|
+
*/
|
|
37
|
+
kta: identity_js_1.KTARegistrationSchema.optional(),
|
|
38
|
+
})
|
|
39
|
+
.refine((data) => data.kid || data.keyId, {
|
|
25
40
|
message: "Either kid or keyId must be provided",
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => {
|
|
43
|
+
const result = {
|
|
44
|
+
version: data.version,
|
|
45
|
+
did: data.did,
|
|
46
|
+
kid: data.kid || data.keyId,
|
|
47
|
+
privateKey: data.privateKey,
|
|
48
|
+
publicKey: data.publicKey,
|
|
49
|
+
createdAt: data.createdAt,
|
|
50
|
+
};
|
|
51
|
+
if (data.lastRotated) {
|
|
52
|
+
result.lastRotated = data.lastRotated;
|
|
53
|
+
}
|
|
54
|
+
if (data.kta) {
|
|
55
|
+
result.kta = data.kta;
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
});
|
|
35
59
|
exports.KeyRotationResultSchema = zod_1.z.object({
|
|
36
60
|
success: zod_1.z.boolean(),
|
|
37
61
|
oldKeyId: zod_1.z.string().min(1),
|
|
@@ -772,6 +772,51 @@ export interface IdpTokens {
|
|
|
772
772
|
/** Granted scopes */
|
|
773
773
|
scope?: string;
|
|
774
774
|
}
|
|
775
|
+
/**
|
|
776
|
+
* Know That AI Registration
|
|
777
|
+
*
|
|
778
|
+
* Tracks whether and when this agent was registered with Know That AI
|
|
779
|
+
* for reputation tracking and discovery.
|
|
780
|
+
*
|
|
781
|
+
* Present when agent is registered via:
|
|
782
|
+
* - CLI: `mcpi register`
|
|
783
|
+
* - Scaffolder: `create-mcpi-app --register`
|
|
784
|
+
* - Shadow registration (automatic for did:key)
|
|
785
|
+
*/
|
|
786
|
+
export interface KTARegistration {
|
|
787
|
+
/**
|
|
788
|
+
* Whether registration was successful
|
|
789
|
+
*/
|
|
790
|
+
registered: boolean;
|
|
791
|
+
/**
|
|
792
|
+
* ISO 8601 timestamp of when the agent was registered
|
|
793
|
+
* @example '2025-01-15T10:30:00.000Z'
|
|
794
|
+
*/
|
|
795
|
+
registeredAt: string;
|
|
796
|
+
/**
|
|
797
|
+
* Claim URL for did:web identity verification
|
|
798
|
+
* - For did:web agents: URL to claim public listing
|
|
799
|
+
* - For did:key agents: null (shadow registration, no public listing)
|
|
800
|
+
* @example 'https://knowthat.ai/agents/claim/abc123'
|
|
801
|
+
*/
|
|
802
|
+
claimUrl: string | null;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Zod schema for KTARegistration
|
|
806
|
+
*/
|
|
807
|
+
export declare const KTARegistrationSchema: z.ZodObject<{
|
|
808
|
+
registered: z.ZodBoolean;
|
|
809
|
+
registeredAt: z.ZodString;
|
|
810
|
+
claimUrl: z.ZodNullable<z.ZodString>;
|
|
811
|
+
}, "strip", z.ZodTypeAny, {
|
|
812
|
+
registered: boolean;
|
|
813
|
+
registeredAt: string;
|
|
814
|
+
claimUrl: string | null;
|
|
815
|
+
}, {
|
|
816
|
+
registered: boolean;
|
|
817
|
+
registeredAt: string;
|
|
818
|
+
claimUrl: string | null;
|
|
819
|
+
}>;
|
|
775
820
|
/**
|
|
776
821
|
* Agent identity representation
|
|
777
822
|
* The actual identity data structure used at runtime
|
|
@@ -795,6 +840,18 @@ export interface AgentIdentity {
|
|
|
795
840
|
* ISO 8601 timestamp of when the identity was created
|
|
796
841
|
*/
|
|
797
842
|
createdAt: string;
|
|
843
|
+
/**
|
|
844
|
+
* Know That AI registration information
|
|
845
|
+
* Present when agent is registered with KTA for reputation tracking.
|
|
846
|
+
*
|
|
847
|
+
* @example
|
|
848
|
+
* ```typescript
|
|
849
|
+
* if (identity.kta?.registered) {
|
|
850
|
+
* // Agent is registered, reputation tracking is enabled
|
|
851
|
+
* }
|
|
852
|
+
* ```
|
|
853
|
+
*/
|
|
854
|
+
kta?: KTARegistration;
|
|
798
855
|
/**
|
|
799
856
|
* Optional metadata about the identity
|
|
800
857
|
*/
|
|
@@ -813,3 +870,63 @@ export interface AgentIdentity {
|
|
|
813
870
|
[key: string]: unknown;
|
|
814
871
|
};
|
|
815
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* Zod schema for AgentIdentity validation
|
|
875
|
+
*/
|
|
876
|
+
export declare const AgentIdentitySchema: z.ZodObject<{
|
|
877
|
+
did: z.ZodEffects<z.ZodString, string, string>;
|
|
878
|
+
publicKey: z.ZodString;
|
|
879
|
+
privateKey: z.ZodString;
|
|
880
|
+
createdAt: z.ZodString;
|
|
881
|
+
kta: z.ZodOptional<z.ZodObject<{
|
|
882
|
+
registered: z.ZodBoolean;
|
|
883
|
+
registeredAt: z.ZodString;
|
|
884
|
+
claimUrl: z.ZodNullable<z.ZodString>;
|
|
885
|
+
}, "strip", z.ZodTypeAny, {
|
|
886
|
+
registered: boolean;
|
|
887
|
+
registeredAt: string;
|
|
888
|
+
claimUrl: string | null;
|
|
889
|
+
}, {
|
|
890
|
+
registered: boolean;
|
|
891
|
+
registeredAt: string;
|
|
892
|
+
claimUrl: string | null;
|
|
893
|
+
}>>;
|
|
894
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
895
|
+
name: z.ZodOptional<z.ZodString>;
|
|
896
|
+
version: z.ZodOptional<z.ZodString>;
|
|
897
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
898
|
+
name: z.ZodOptional<z.ZodString>;
|
|
899
|
+
version: z.ZodOptional<z.ZodString>;
|
|
900
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
901
|
+
name: z.ZodOptional<z.ZodString>;
|
|
902
|
+
version: z.ZodOptional<z.ZodString>;
|
|
903
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
904
|
+
}, "strip", z.ZodTypeAny, {
|
|
905
|
+
did: string;
|
|
906
|
+
publicKey: string;
|
|
907
|
+
privateKey: string;
|
|
908
|
+
createdAt: string;
|
|
909
|
+
kta?: {
|
|
910
|
+
registered: boolean;
|
|
911
|
+
registeredAt: string;
|
|
912
|
+
claimUrl: string | null;
|
|
913
|
+
} | undefined;
|
|
914
|
+
metadata?: z.objectOutputType<{
|
|
915
|
+
name: z.ZodOptional<z.ZodString>;
|
|
916
|
+
version: z.ZodOptional<z.ZodString>;
|
|
917
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
918
|
+
}, {
|
|
919
|
+
did: string;
|
|
920
|
+
publicKey: string;
|
|
921
|
+
privateKey: string;
|
|
922
|
+
createdAt: string;
|
|
923
|
+
kta?: {
|
|
924
|
+
registered: boolean;
|
|
925
|
+
registeredAt: string;
|
|
926
|
+
claimUrl: string | null;
|
|
927
|
+
} | undefined;
|
|
928
|
+
metadata?: z.objectInputType<{
|
|
929
|
+
name: z.ZodOptional<z.ZodString>;
|
|
930
|
+
version: z.ZodOptional<z.ZodString>;
|
|
931
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
932
|
+
}>;
|
package/dist/config/identity.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module @kya-os/contracts/config
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.AuthProviderSchema = exports.OAuth2ProviderConfigSchema = exports.OAuthConfigSchema = exports.OAuthProviderSchema = exports.CredentialProviderConfigSchema = void 0;
|
|
11
|
+
exports.AgentIdentitySchema = exports.KTARegistrationSchema = exports.AuthProviderSchema = exports.OAuth2ProviderConfigSchema = exports.OAuthConfigSchema = exports.OAuthProviderSchema = exports.CredentialProviderConfigSchema = void 0;
|
|
12
12
|
const zod_1 = require("zod");
|
|
13
13
|
/**
|
|
14
14
|
* Zod schema for CredentialProviderConfig validation
|
|
@@ -64,7 +64,9 @@ exports.OAuthProviderSchema = zod_1.z.object({
|
|
|
64
64
|
proxyMode: zod_1.z.boolean().optional(),
|
|
65
65
|
// Phase 3: Custom IDP Support
|
|
66
66
|
customParams: zod_1.z.record(zod_1.z.string()).optional(),
|
|
67
|
-
tokenEndpointAuthMethod: zod_1.z
|
|
67
|
+
tokenEndpointAuthMethod: zod_1.z
|
|
68
|
+
.enum(["client_secret_post", "client_secret_basic"])
|
|
69
|
+
.optional(),
|
|
68
70
|
responseType: zod_1.z.string().optional().default("code"),
|
|
69
71
|
grantType: zod_1.z.string().optional().default("authorization_code"),
|
|
70
72
|
});
|
|
@@ -105,3 +107,33 @@ exports.AuthProviderSchema = zod_1.z.discriminatedUnion("type", [
|
|
|
105
107
|
exports.OAuth2ProviderConfigSchema,
|
|
106
108
|
exports.CredentialProviderConfigSchema,
|
|
107
109
|
]);
|
|
110
|
+
/**
|
|
111
|
+
* Zod schema for KTARegistration
|
|
112
|
+
*/
|
|
113
|
+
exports.KTARegistrationSchema = zod_1.z.object({
|
|
114
|
+
registered: zod_1.z.boolean(),
|
|
115
|
+
registeredAt: zod_1.z.string().datetime(),
|
|
116
|
+
claimUrl: zod_1.z.string().url().nullable(),
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Zod schema for AgentIdentity validation
|
|
120
|
+
*/
|
|
121
|
+
exports.AgentIdentitySchema = zod_1.z.object({
|
|
122
|
+
did: zod_1.z
|
|
123
|
+
.string()
|
|
124
|
+
.min(1)
|
|
125
|
+
.refine((val) => val.startsWith("did:"), {
|
|
126
|
+
message: 'DID must start with "did:"',
|
|
127
|
+
}),
|
|
128
|
+
publicKey: zod_1.z.string().min(1),
|
|
129
|
+
privateKey: zod_1.z.string().min(1),
|
|
130
|
+
createdAt: zod_1.z.string().datetime(),
|
|
131
|
+
kta: exports.KTARegistrationSchema.optional(),
|
|
132
|
+
metadata: zod_1.z
|
|
133
|
+
.object({
|
|
134
|
+
name: zod_1.z.string().optional(),
|
|
135
|
+
version: zod_1.z.string().optional(),
|
|
136
|
+
})
|
|
137
|
+
.passthrough()
|
|
138
|
+
.optional(),
|
|
139
|
+
});
|
package/dist/consent/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Consent Module Exports
|
|
3
3
|
*
|
|
4
|
-
* Types and schemas for consent page configuration and approval handling
|
|
4
|
+
* Types and schemas for consent page configuration and approval handling.
|
|
5
|
+
*
|
|
6
|
+
* This module re-exports from @kya-os/consent (the single source of truth)
|
|
7
|
+
* while maintaining backward compatibility with existing contracts consumers.
|
|
5
8
|
*/
|
|
6
|
-
export {
|
|
9
|
+
export type { ConsentConfig, ConsentConfigWithMeta, ConsentCustomField, ConsentCustomFieldOption, ConsentMetadata, ResolvedConsentConfig, ResolvedUI, ResolvedTerms, ResolvedSuccess, ConsentBranding, ResolvedConsentBranding, ConsentUI, ConsentTerms, ConsentSuccess, ResolvedConsentCopy, AuthMode, CredentialsConfig, OAuthConfig, MagicLinkConfig, OTPConfig, QRCodeConfig, PasskeyConfig, IDVConfig, ConsentPageConfig, ExtendedConsentPageConfig, OAuthIdentity, ConsentApprovalRequest, ConsentApprovalResponse, ConsentConfigAPIResponse, CredentialAuthRequest, CredentialAuthResponse, } from "@kya-os/consent";
|
|
10
|
+
export { ConsentConfigSchema, ConsentConfigWithMetaSchema, ConsentCustomFieldSchema, ConsentCustomFieldOptionSchema, ConsentTermsSchema, ConsentUISchema, ConsentSuccessSchema, ConsentMetadataSchema, ConsentBrandingSchema, AuthModeSchema, CredentialsConfigSchema, OAuthConfigSchema, MagicLinkConfigSchema, OTPConfigSchema, QRCodeConfigSchema, PasskeyConfigSchema, IDVConfigSchema, OAuthIdentitySchema, ConsentApprovalRequestSchema, ConsentApprovalResponseSchema, ConsentPageConfigSchema, CredentialAuthRequestSchema, CredentialAuthResponseSchema, validateConsentApprovalRequest, validateConsentApprovalResponse, validateOAuthIdentity, validateConsentPageConfig, validateConsentConfig, validateConsentBranding, validateCustomField, } from "@kya-os/consent";
|
|
11
|
+
export { DEFAULT_BRANDING, DEFAULT_UI, DEFAULT_TERMS, DEFAULT_SUCCESS, DEFAULT_METADATA, DEFAULT_EXPIRATION_DAYS, DEFAULT_COLORS, AUTH_MODES, AUTH_MODE_REGISTRY, getAuthModeMetadata, getImplementedAuthModes, isAuthModeImplemented, requiresExternalAuth, collectsCredentials, } from "@kya-os/consent";
|
|
12
|
+
export { ConsentBrandingSchema as consentBrandingSchema, ConsentTermsSchema as consentTermsSchema, ConsentConfigSchema as consentConfigSchema, ConsentCustomFieldSchema as consentCustomFieldSchema, ConsentCustomFieldOptionSchema as consentCustomFieldOptionSchema, ConsentPageConfigSchema as consentPageConfigSchema, ConsentApprovalRequestSchema as consentApprovalRequestSchema, ConsentApprovalResponseSchema as consentApprovalResponseSchema, OAuthIdentitySchema as oauthIdentitySchema, } from "@kya-os/consent";
|