@kya-os/contracts 1.3.0 → 1.3.1-canary.1
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/cli.d.ts +9 -9
- package/dist/cli.js +5 -5
- package/dist/handshake.d.ts +6 -0
- package/dist/handshake.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/proof.d.ts +8 -1
- package/dist/proof.js +10 -3
- package/dist/registry.d.ts +15 -15
- package/dist/registry.js +3 -2
- package/dist/test.d.ts +19 -19
- package/dist/test.js +5 -5
- package/dist/utils/validation.d.ts +1 -1
- package/dist/utils/validation.js +1 -1
- package/dist/verifier.d.ts +39 -25
- package/dist/verifier.js +18 -2
- package/package.json +3 -5
- package/dist/cli.d.ts.map +0 -1
- package/dist/delegation/constraints.d.ts +0 -982
- package/dist/delegation/constraints.d.ts.map +0 -1
- package/dist/delegation/constraints.js +0 -205
- package/dist/delegation/index.d.ts +0 -8
- package/dist/delegation/index.d.ts.map +0 -1
- package/dist/delegation/index.js +0 -24
- package/dist/delegation/schemas.d.ts +0 -3787
- package/dist/delegation/schemas.d.ts.map +0 -1
- package/dist/delegation/schemas.js +0 -230
- package/dist/did/index.d.ts +0 -8
- package/dist/did/index.d.ts.map +0 -1
- package/dist/did/index.js +0 -24
- package/dist/did/resolve-contract.d.ts +0 -220
- package/dist/did/resolve-contract.d.ts.map +0 -1
- package/dist/did/resolve-contract.js +0 -32
- package/dist/did/types.d.ts +0 -164
- package/dist/did/types.d.ts.map +0 -1
- package/dist/did/types.js +0 -71
- package/dist/env/constants.d.ts +0 -58
- package/dist/env/constants.d.ts.map +0 -1
- package/dist/env/constants.js +0 -60
- package/dist/env/index.d.ts +0 -5
- package/dist/env/index.d.ts.map +0 -1
- package/dist/env/index.js +0 -21
- package/dist/handshake.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/proof/index.d.ts +0 -9
- package/dist/proof/index.d.ts.map +0 -1
- package/dist/proof/index.js +0 -25
- package/dist/proof/proof-record.d.ts +0 -838
- package/dist/proof/proof-record.d.ts.map +0 -1
- package/dist/proof/proof-record.js +0 -134
- package/dist/proof/signing-spec.d.ts +0 -147
- package/dist/proof/signing-spec.d.ts.map +0 -1
- package/dist/proof/signing-spec.js +0 -123
- package/dist/proof.d.ts.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/runtime/errors.d.ts +0 -348
- package/dist/runtime/errors.d.ts.map +0 -1
- package/dist/runtime/errors.js +0 -120
- package/dist/runtime/headers.d.ts +0 -84
- package/dist/runtime/headers.d.ts.map +0 -1
- package/dist/runtime/headers.js +0 -82
- package/dist/runtime/index.d.ts +0 -6
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -22
- package/dist/test.d.ts.map +0 -1
- package/dist/tlkrc/index.d.ts +0 -5
- package/dist/tlkrc/index.d.ts.map +0 -1
- package/dist/tlkrc/index.js +0 -21
- package/dist/tlkrc/rotation.d.ts +0 -246
- package/dist/tlkrc/rotation.d.ts.map +0 -1
- package/dist/tlkrc/rotation.js +0 -127
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/vc/index.d.ts +0 -8
- package/dist/vc/index.d.ts.map +0 -1
- package/dist/vc/index.js +0 -24
- package/dist/vc/schemas.d.ts +0 -2484
- package/dist/vc/schemas.d.ts.map +0 -1
- package/dist/vc/schemas.js +0 -225
- package/dist/vc/statuslist.d.ts +0 -494
- package/dist/vc/statuslist.d.ts.map +0 -1
- package/dist/vc/statuslist.js +0 -133
- package/dist/verifier.d.ts.map +0 -1
- package/schemas/cli/register-output/v1.0.0.json +0 -69
- package/schemas/proof/v1.0.0.json +0 -80
- package/schemas/registry/receipt-v1.0.0.json +0 -60
- package/schemas/verifier/verify-page/v1.0.0.json +0 -94
- package/schemas/well-known/agent/v1.0.0.json +0 -49
package/dist/cli.d.ts
CHANGED
|
@@ -5,27 +5,27 @@ import { z } from "zod";
|
|
|
5
5
|
export declare const IdentityConfigSchema: z.ZodObject<{
|
|
6
6
|
version: z.ZodLiteral<"1.0">;
|
|
7
7
|
did: z.ZodString;
|
|
8
|
-
|
|
8
|
+
kid: z.ZodString;
|
|
9
9
|
privateKey: z.ZodString;
|
|
10
10
|
publicKey: z.ZodString;
|
|
11
11
|
createdAt: z.ZodString;
|
|
12
|
-
lastRotated: z.ZodString
|
|
12
|
+
lastRotated: z.ZodOptional<z.ZodString>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
14
|
version: "1.0";
|
|
15
15
|
did: string;
|
|
16
|
-
|
|
16
|
+
kid: string;
|
|
17
17
|
privateKey: string;
|
|
18
18
|
publicKey: string;
|
|
19
19
|
createdAt: string;
|
|
20
|
-
lastRotated
|
|
20
|
+
lastRotated?: string | undefined;
|
|
21
21
|
}, {
|
|
22
22
|
version: "1.0";
|
|
23
23
|
did: string;
|
|
24
|
-
|
|
24
|
+
kid: string;
|
|
25
25
|
privateKey: string;
|
|
26
26
|
publicKey: string;
|
|
27
27
|
createdAt: string;
|
|
28
|
-
lastRotated
|
|
28
|
+
lastRotated?: string | undefined;
|
|
29
29
|
}>;
|
|
30
30
|
export declare const KeyRotationResultSchema: z.ZodObject<{
|
|
31
31
|
success: z.ZodBoolean;
|
|
@@ -57,21 +57,21 @@ export declare const KeyRotationResultSchema: z.ZodObject<{
|
|
|
57
57
|
}>;
|
|
58
58
|
export declare const StatusReportSchema: z.ZodObject<{
|
|
59
59
|
did: z.ZodString;
|
|
60
|
-
|
|
60
|
+
kid: z.ZodString;
|
|
61
61
|
ktaURL: z.ZodString;
|
|
62
62
|
mirrorStatus: z.ZodEnum<["pending", "success", "error"]>;
|
|
63
63
|
lastHandshake: z.ZodOptional<z.ZodNumber>;
|
|
64
64
|
environment: z.ZodEnum<["dev", "prod"]>;
|
|
65
65
|
}, "strip", z.ZodTypeAny, {
|
|
66
66
|
did: string;
|
|
67
|
-
|
|
67
|
+
kid: string;
|
|
68
68
|
ktaURL: string;
|
|
69
69
|
mirrorStatus: "success" | "pending" | "error";
|
|
70
70
|
environment: "dev" | "prod";
|
|
71
71
|
lastHandshake?: number | undefined;
|
|
72
72
|
}, {
|
|
73
73
|
did: string;
|
|
74
|
-
|
|
74
|
+
kid: string;
|
|
75
75
|
ktaURL: string;
|
|
76
76
|
mirrorStatus: "success" | "pending" | "error";
|
|
77
77
|
environment: "dev" | "prod";
|
package/dist/cli.js
CHANGED
|
@@ -8,11 +8,11 @@ const zod_1 = require("zod");
|
|
|
8
8
|
exports.IdentityConfigSchema = zod_1.z.object({
|
|
9
9
|
version: zod_1.z.literal("1.0"),
|
|
10
10
|
did: zod_1.z.string().min(1),
|
|
11
|
-
|
|
12
|
-
privateKey: zod_1.z.string().
|
|
13
|
-
publicKey: zod_1.z.string().
|
|
11
|
+
kid: zod_1.z.string().min(1), // Changed from kid to kid for spec compliance
|
|
12
|
+
privateKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 private key (44 characters)"),
|
|
13
|
+
publicKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 public key (44 characters)"),
|
|
14
14
|
createdAt: zod_1.z.string().datetime(),
|
|
15
|
-
lastRotated: zod_1.z.string().datetime(),
|
|
15
|
+
lastRotated: zod_1.z.string().datetime().optional(),
|
|
16
16
|
});
|
|
17
17
|
exports.KeyRotationResultSchema = zod_1.z.object({
|
|
18
18
|
success: zod_1.z.boolean(),
|
|
@@ -26,7 +26,7 @@ exports.KeyRotationResultSchema = zod_1.z.object({
|
|
|
26
26
|
});
|
|
27
27
|
exports.StatusReportSchema = zod_1.z.object({
|
|
28
28
|
did: zod_1.z.string().min(1),
|
|
29
|
-
|
|
29
|
+
kid: zod_1.z.string().min(1), // Changed from kid to kid for spec compliance
|
|
30
30
|
ktaURL: zod_1.z.string().url(),
|
|
31
31
|
mirrorStatus: zod_1.z.enum(["pending", "success", "error"]),
|
|
32
32
|
lastHandshake: zod_1.z.number().int().positive().optional(),
|
package/dist/handshake.d.ts
CHANGED
|
@@ -6,14 +6,17 @@ export declare const HandshakeRequestSchema: z.ZodObject<{
|
|
|
6
6
|
nonce: z.ZodString;
|
|
7
7
|
audience: z.ZodString;
|
|
8
8
|
timestamp: z.ZodNumber;
|
|
9
|
+
agentDid: z.ZodOptional<z.ZodString>;
|
|
9
10
|
}, "strip", z.ZodTypeAny, {
|
|
10
11
|
nonce: string;
|
|
11
12
|
audience: string;
|
|
12
13
|
timestamp: number;
|
|
14
|
+
agentDid?: string | undefined;
|
|
13
15
|
}, {
|
|
14
16
|
nonce: string;
|
|
15
17
|
audience: string;
|
|
16
18
|
timestamp: number;
|
|
19
|
+
agentDid?: string | undefined;
|
|
17
20
|
}>;
|
|
18
21
|
export declare const SessionContextSchema: z.ZodObject<{
|
|
19
22
|
sessionId: z.ZodString;
|
|
@@ -23,6 +26,7 @@ export declare const SessionContextSchema: z.ZodObject<{
|
|
|
23
26
|
createdAt: z.ZodNumber;
|
|
24
27
|
lastActivity: z.ZodNumber;
|
|
25
28
|
ttlMinutes: z.ZodDefault<z.ZodNumber>;
|
|
29
|
+
agentDid: z.ZodOptional<z.ZodString>;
|
|
26
30
|
}, "strip", z.ZodTypeAny, {
|
|
27
31
|
createdAt: number;
|
|
28
32
|
nonce: string;
|
|
@@ -31,6 +35,7 @@ export declare const SessionContextSchema: z.ZodObject<{
|
|
|
31
35
|
sessionId: string;
|
|
32
36
|
lastActivity: number;
|
|
33
37
|
ttlMinutes: number;
|
|
38
|
+
agentDid?: string | undefined;
|
|
34
39
|
}, {
|
|
35
40
|
createdAt: number;
|
|
36
41
|
nonce: string;
|
|
@@ -38,6 +43,7 @@ export declare const SessionContextSchema: z.ZodObject<{
|
|
|
38
43
|
timestamp: number;
|
|
39
44
|
sessionId: string;
|
|
40
45
|
lastActivity: number;
|
|
46
|
+
agentDid?: string | undefined;
|
|
41
47
|
ttlMinutes?: number | undefined;
|
|
42
48
|
}>;
|
|
43
49
|
export declare const NonceCacheEntrySchema: z.ZodObject<{
|
package/dist/handshake.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.HandshakeRequestSchema = zod_1.z.object({
|
|
|
9
9
|
nonce: zod_1.z.string().min(1),
|
|
10
10
|
audience: zod_1.z.string().min(1),
|
|
11
11
|
timestamp: zod_1.z.number().int().positive(),
|
|
12
|
+
agentDid: zod_1.z.string().startsWith("did:").optional(), // Agent DID for delegation verification
|
|
12
13
|
});
|
|
13
14
|
exports.SessionContextSchema = zod_1.z.object({
|
|
14
15
|
sessionId: zod_1.z.string().min(1),
|
|
@@ -18,6 +19,7 @@ exports.SessionContextSchema = zod_1.z.object({
|
|
|
18
19
|
createdAt: zod_1.z.number().int().positive(),
|
|
19
20
|
lastActivity: zod_1.z.number().int().positive(),
|
|
20
21
|
ttlMinutes: zod_1.z.number().int().positive().default(30),
|
|
22
|
+
agentDid: zod_1.z.string().optional(), // Agent DID for delegation verification
|
|
21
23
|
});
|
|
22
24
|
exports.NonceCacheEntrySchema = zod_1.z.object({
|
|
23
25
|
sessionId: zod_1.z.string().min(1),
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from "./registry.js";
|
|
|
19
19
|
export * from "./cli.js";
|
|
20
20
|
export * from "./test.js";
|
|
21
21
|
export * from "./utils/validation.js";
|
|
22
|
+
export * from "./vc/index.js";
|
|
23
|
+
export * from "./delegation/index.js";
|
|
22
24
|
export declare const CONTRACTS_VERSION = "1.2.1";
|
|
23
25
|
export declare const SUPPORTED_XMCP_I_VERSION = "^1.0.0";
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,9 @@ __exportStar(require("./registry.js"), exports);
|
|
|
37
37
|
__exportStar(require("./cli.js"), exports);
|
|
38
38
|
__exportStar(require("./test.js"), exports);
|
|
39
39
|
__exportStar(require("./utils/validation.js"), exports);
|
|
40
|
+
// W3C VC and Delegation exports (for mcp-i-core compatibility)
|
|
41
|
+
__exportStar(require("./vc/index.js"), exports);
|
|
42
|
+
__exportStar(require("./delegation/index.js"), exports);
|
|
40
43
|
// Version information
|
|
41
44
|
exports.CONTRACTS_VERSION = "1.2.1";
|
|
42
45
|
exports.SUPPORTED_XMCP_I_VERSION = "^1.0.0";
|
package/dist/proof.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Proof and signature schemas for MCP-I
|
|
4
|
+
*
|
|
5
|
+
* Note: The type name "DetachedProof" is maintained for backward compatibility,
|
|
6
|
+
* but the JWS format is actually FULL compact JWS (header.payload.signature),
|
|
7
|
+
* not detached format (header..signature).
|
|
8
|
+
*
|
|
9
|
+
* The JWS payload contains JWT standard claims (aud, sub, iss) plus custom
|
|
10
|
+
* proof claims (requestHash, responseHash, nonce, etc.).
|
|
4
11
|
*/
|
|
5
12
|
export declare const ProofMetaSchema: z.ZodObject<{
|
|
6
13
|
did: z.ZodString;
|
package/dist/proof.js
CHANGED
|
@@ -3,7 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AUDIT_VERSION = exports.HASH_ALGORITHM = exports.JWS_ALGORITHM = exports.AuditRecordSchema = exports.CanonicalHashesSchema = exports.DetachedProofSchema = exports.ProofMetaSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Proof and signature schemas for MCP-I
|
|
7
|
+
*
|
|
8
|
+
* Note: The type name "DetachedProof" is maintained for backward compatibility,
|
|
9
|
+
* but the JWS format is actually FULL compact JWS (header.payload.signature),
|
|
10
|
+
* not detached format (header..signature).
|
|
11
|
+
*
|
|
12
|
+
* The JWS payload contains JWT standard claims (aud, sub, iss) plus custom
|
|
13
|
+
* proof claims (requestHash, responseHash, nonce, etc.).
|
|
7
14
|
*/
|
|
8
15
|
exports.ProofMetaSchema = zod_1.z.object({
|
|
9
16
|
did: zod_1.z.string().min(1),
|
|
@@ -18,8 +25,8 @@ exports.ProofMetaSchema = zod_1.z.object({
|
|
|
18
25
|
delegationRef: zod_1.z.string().optional(),
|
|
19
26
|
});
|
|
20
27
|
exports.DetachedProofSchema = zod_1.z.object({
|
|
21
|
-
jws: zod_1.z.string().min(1), //
|
|
22
|
-
meta: exports.ProofMetaSchema,
|
|
28
|
+
jws: zod_1.z.string().min(1), // Full compact JWS format (header.payload.signature)
|
|
29
|
+
meta: exports.ProofMetaSchema, // Convenience metadata (duplicates signed payload data)
|
|
23
30
|
});
|
|
24
31
|
exports.CanonicalHashesSchema = zod_1.z.object({
|
|
25
32
|
requestHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
package/dist/registry.d.ts
CHANGED
|
@@ -57,12 +57,12 @@ export declare const ClaimTokenSchema: z.ZodObject<{
|
|
|
57
57
|
expiresAt: z.ZodNumber;
|
|
58
58
|
ttlHours: z.ZodDefault<z.ZodNumber>;
|
|
59
59
|
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
expiresAt: number;
|
|
61
60
|
token: string;
|
|
61
|
+
expiresAt: number;
|
|
62
62
|
ttlHours: number;
|
|
63
63
|
}, {
|
|
64
|
-
expiresAt: number;
|
|
65
64
|
token: string;
|
|
65
|
+
expiresAt: number;
|
|
66
66
|
ttlHours?: number | undefined;
|
|
67
67
|
}>;
|
|
68
68
|
export declare const MirrorStatusSchema: z.ZodObject<{
|
|
@@ -83,7 +83,7 @@ export declare const MirrorStatusSchema: z.ZodObject<{
|
|
|
83
83
|
}>;
|
|
84
84
|
export declare const AgentStatusSchema: z.ZodObject<{
|
|
85
85
|
did: z.ZodString;
|
|
86
|
-
|
|
86
|
+
kid: z.ZodString;
|
|
87
87
|
ktaURL: z.ZodString;
|
|
88
88
|
mirrorStatus: z.ZodObject<{
|
|
89
89
|
status: z.ZodEnum<["pending", "success", "error"]>;
|
|
@@ -104,7 +104,7 @@ export declare const AgentStatusSchema: z.ZodObject<{
|
|
|
104
104
|
lastHandshake: z.ZodOptional<z.ZodNumber>;
|
|
105
105
|
}, "strip", z.ZodTypeAny, {
|
|
106
106
|
did: string;
|
|
107
|
-
|
|
107
|
+
kid: string;
|
|
108
108
|
ktaURL: string;
|
|
109
109
|
mirrorStatus: {
|
|
110
110
|
status: "success" | "pending" | "error";
|
|
@@ -115,7 +115,7 @@ export declare const AgentStatusSchema: z.ZodObject<{
|
|
|
115
115
|
lastHandshake?: number | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
did: string;
|
|
118
|
-
|
|
118
|
+
kid: string;
|
|
119
119
|
ktaURL: string;
|
|
120
120
|
mirrorStatus: {
|
|
121
121
|
status: "success" | "pending" | "error";
|
|
@@ -161,13 +161,13 @@ export declare const DelegationRequestSchema: z.ZodObject<{
|
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
162
162
|
subject: string;
|
|
163
163
|
scopes: string[];
|
|
164
|
-
audience?: string | undefined;
|
|
165
164
|
duration?: number | undefined;
|
|
165
|
+
audience?: string | undefined;
|
|
166
166
|
}, {
|
|
167
167
|
subject: string;
|
|
168
168
|
scopes: string[];
|
|
169
|
-
audience?: string | undefined;
|
|
170
169
|
duration?: number | undefined;
|
|
170
|
+
audience?: string | undefined;
|
|
171
171
|
}>;
|
|
172
172
|
/**
|
|
173
173
|
* Storage mode configuration for verifiable credentials and delegations
|
|
@@ -182,24 +182,24 @@ export declare const ReceiptSchema: z.ZodObject<{
|
|
|
182
182
|
ref: z.ZodString;
|
|
183
183
|
contentHash: z.ZodString;
|
|
184
184
|
action: z.ZodEnum<["issue", "revoke"]>;
|
|
185
|
-
ts: z.ZodNumber
|
|
185
|
+
ts: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
186
186
|
logIndex: z.ZodNumber;
|
|
187
187
|
logRoot: z.ZodString;
|
|
188
188
|
inclusionProof: z.ZodArray<z.ZodString, "many">;
|
|
189
189
|
}, "strip", z.ZodTypeAny, {
|
|
190
|
-
ts: number;
|
|
191
190
|
ref: string;
|
|
192
191
|
contentHash: string;
|
|
193
192
|
action: "issue" | "revoke";
|
|
193
|
+
ts: string | number;
|
|
194
194
|
logIndex: number;
|
|
195
195
|
logRoot: string;
|
|
196
196
|
inclusionProof: string[];
|
|
197
197
|
$schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
|
|
198
198
|
}, {
|
|
199
|
-
ts: number;
|
|
200
199
|
ref: string;
|
|
201
200
|
contentHash: string;
|
|
202
201
|
action: "issue" | "revoke";
|
|
202
|
+
ts: string | number;
|
|
203
203
|
logIndex: number;
|
|
204
204
|
logRoot: string;
|
|
205
205
|
inclusionProof: string[];
|
|
@@ -236,24 +236,24 @@ export declare const DelegationResponseSchema: z.ZodObject<{
|
|
|
236
236
|
ref: z.ZodString;
|
|
237
237
|
contentHash: z.ZodString;
|
|
238
238
|
action: z.ZodEnum<["issue", "revoke"]>;
|
|
239
|
-
ts: z.ZodNumber
|
|
239
|
+
ts: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
240
240
|
logIndex: z.ZodNumber;
|
|
241
241
|
logRoot: z.ZodString;
|
|
242
242
|
inclusionProof: z.ZodArray<z.ZodString, "many">;
|
|
243
243
|
}, "strip", z.ZodTypeAny, {
|
|
244
|
-
ts: number;
|
|
245
244
|
ref: string;
|
|
246
245
|
contentHash: string;
|
|
247
246
|
action: "issue" | "revoke";
|
|
247
|
+
ts: string | number;
|
|
248
248
|
logIndex: number;
|
|
249
249
|
logRoot: string;
|
|
250
250
|
inclusionProof: string[];
|
|
251
251
|
$schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
|
|
252
252
|
}, {
|
|
253
|
-
ts: number;
|
|
254
253
|
ref: string;
|
|
255
254
|
contentHash: string;
|
|
256
255
|
action: "issue" | "revoke";
|
|
256
|
+
ts: string | number;
|
|
257
257
|
logIndex: number;
|
|
258
258
|
logRoot: string;
|
|
259
259
|
inclusionProof: string[];
|
|
@@ -271,10 +271,10 @@ export declare const DelegationResponseSchema: z.ZodObject<{
|
|
|
271
271
|
aud?: string | undefined;
|
|
272
272
|
};
|
|
273
273
|
receipt: {
|
|
274
|
-
ts: number;
|
|
275
274
|
ref: string;
|
|
276
275
|
contentHash: string;
|
|
277
276
|
action: "issue" | "revoke";
|
|
277
|
+
ts: string | number;
|
|
278
278
|
logIndex: number;
|
|
279
279
|
logRoot: string;
|
|
280
280
|
inclusionProof: string[];
|
|
@@ -292,10 +292,10 @@ export declare const DelegationResponseSchema: z.ZodObject<{
|
|
|
292
292
|
aud?: string | undefined;
|
|
293
293
|
};
|
|
294
294
|
receipt: {
|
|
295
|
-
ts: number;
|
|
296
295
|
ref: string;
|
|
297
296
|
contentHash: string;
|
|
298
297
|
action: "issue" | "revoke";
|
|
298
|
+
ts: string | number;
|
|
299
299
|
logIndex: number;
|
|
300
300
|
logRoot: string;
|
|
301
301
|
inclusionProof: string[];
|
package/dist/registry.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.MirrorStatusSchema = zod_1.z.object({
|
|
|
40
40
|
});
|
|
41
41
|
exports.AgentStatusSchema = zod_1.z.object({
|
|
42
42
|
did: zod_1.z.string().min(1),
|
|
43
|
-
|
|
43
|
+
kid: zod_1.z.string().min(1),
|
|
44
44
|
ktaURL: zod_1.z.string().url(),
|
|
45
45
|
mirrorStatus: exports.MirrorStatusSchema,
|
|
46
46
|
lastHandshake: zod_1.z.number().int().positive().optional(),
|
|
@@ -82,7 +82,8 @@ exports.ReceiptSchema = zod_1.z.object({
|
|
|
82
82
|
ref: zod_1.z.string().min(1),
|
|
83
83
|
contentHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
84
84
|
action: zod_1.z.enum(["issue", "revoke"]),
|
|
85
|
-
|
|
85
|
+
// Back-compat: accept ISO string (preferred) or legacy epoch number
|
|
86
|
+
ts: zod_1.z.union([zod_1.z.string().datetime(), zod_1.z.number().int().positive()]),
|
|
86
87
|
logIndex: zod_1.z.number().int().nonnegative(),
|
|
87
88
|
logRoot: zod_1.z.string().min(1),
|
|
88
89
|
inclusionProof: zod_1.z.array(zod_1.z.string()),
|
package/dist/test.d.ts
CHANGED
|
@@ -30,25 +30,25 @@ export type TestEnvironment = z.infer<typeof TestEnvironmentSchema>;
|
|
|
30
30
|
*/
|
|
31
31
|
export declare const MockIdentitySchema: z.ZodObject<{
|
|
32
32
|
did: z.ZodString;
|
|
33
|
-
|
|
33
|
+
kid: z.ZodString;
|
|
34
34
|
privateKey: z.ZodString;
|
|
35
35
|
publicKey: z.ZodString;
|
|
36
36
|
createdAt: z.ZodString;
|
|
37
|
-
lastRotated: z.ZodString
|
|
37
|
+
lastRotated: z.ZodOptional<z.ZodString>;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
did: string;
|
|
40
|
-
|
|
40
|
+
kid: string;
|
|
41
41
|
privateKey: string;
|
|
42
42
|
publicKey: string;
|
|
43
43
|
createdAt: string;
|
|
44
|
-
lastRotated
|
|
44
|
+
lastRotated?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
did: string;
|
|
47
|
-
|
|
47
|
+
kid: string;
|
|
48
48
|
privateKey: string;
|
|
49
49
|
publicKey: string;
|
|
50
50
|
createdAt: string;
|
|
51
|
-
lastRotated
|
|
51
|
+
lastRotated?: string | undefined;
|
|
52
52
|
}>;
|
|
53
53
|
export type MockIdentity = z.infer<typeof MockIdentitySchema>;
|
|
54
54
|
/**
|
|
@@ -67,25 +67,25 @@ export type MockKTAFailureType = z.infer<typeof MockKTAFailureTypeSchema>;
|
|
|
67
67
|
export declare const MockIdentityProviderConfigSchema: z.ZodObject<{
|
|
68
68
|
identities: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
69
69
|
did: z.ZodString;
|
|
70
|
-
|
|
70
|
+
kid: z.ZodString;
|
|
71
71
|
privateKey: z.ZodString;
|
|
72
72
|
publicKey: z.ZodString;
|
|
73
73
|
createdAt: z.ZodString;
|
|
74
|
-
lastRotated: z.ZodString
|
|
74
|
+
lastRotated: z.ZodOptional<z.ZodString>;
|
|
75
75
|
}, "strip", z.ZodTypeAny, {
|
|
76
76
|
did: string;
|
|
77
|
-
|
|
77
|
+
kid: string;
|
|
78
78
|
privateKey: string;
|
|
79
79
|
publicKey: string;
|
|
80
80
|
createdAt: string;
|
|
81
|
-
lastRotated
|
|
81
|
+
lastRotated?: string | undefined;
|
|
82
82
|
}, {
|
|
83
83
|
did: string;
|
|
84
|
-
|
|
84
|
+
kid: string;
|
|
85
85
|
privateKey: string;
|
|
86
86
|
publicKey: string;
|
|
87
87
|
createdAt: string;
|
|
88
|
-
lastRotated
|
|
88
|
+
lastRotated?: string | undefined;
|
|
89
89
|
}>>;
|
|
90
90
|
delegations: z.ZodRecord<z.ZodString, z.ZodEnum<["active", "revoked", "pending"]>>;
|
|
91
91
|
ktaFailures: z.ZodDefault<z.ZodArray<z.ZodEnum<["network", "auth", "invalid", "timeout"]>, "many">>;
|
|
@@ -93,11 +93,11 @@ export declare const MockIdentityProviderConfigSchema: z.ZodObject<{
|
|
|
93
93
|
}, "strip", z.ZodTypeAny, {
|
|
94
94
|
identities: Record<string, {
|
|
95
95
|
did: string;
|
|
96
|
-
|
|
96
|
+
kid: string;
|
|
97
97
|
privateKey: string;
|
|
98
98
|
publicKey: string;
|
|
99
99
|
createdAt: string;
|
|
100
|
-
lastRotated
|
|
100
|
+
lastRotated?: string | undefined;
|
|
101
101
|
}>;
|
|
102
102
|
delegations: Record<string, "pending" | "active" | "revoked">;
|
|
103
103
|
ktaFailures: ("network" | "auth" | "invalid" | "timeout")[];
|
|
@@ -105,11 +105,11 @@ export declare const MockIdentityProviderConfigSchema: z.ZodObject<{
|
|
|
105
105
|
}, {
|
|
106
106
|
identities: Record<string, {
|
|
107
107
|
did: string;
|
|
108
|
-
|
|
108
|
+
kid: string;
|
|
109
109
|
privateKey: string;
|
|
110
110
|
publicKey: string;
|
|
111
111
|
createdAt: string;
|
|
112
|
-
lastRotated
|
|
112
|
+
lastRotated?: string | undefined;
|
|
113
113
|
}>;
|
|
114
114
|
delegations: Record<string, "pending" | "active" | "revoked">;
|
|
115
115
|
ktaFailures?: ("network" | "auth" | "invalid" | "timeout")[] | undefined;
|
|
@@ -122,7 +122,7 @@ export type MockIdentityProviderConfig = z.infer<typeof MockIdentityProviderConf
|
|
|
122
122
|
export declare const LocalVerificationResultSchema: z.ZodObject<{
|
|
123
123
|
valid: z.ZodBoolean;
|
|
124
124
|
did: z.ZodOptional<z.ZodString>;
|
|
125
|
-
|
|
125
|
+
kid: z.ZodOptional<z.ZodString>;
|
|
126
126
|
signature: z.ZodObject<{
|
|
127
127
|
valid: z.ZodBoolean;
|
|
128
128
|
algorithm: z.ZodString;
|
|
@@ -192,7 +192,7 @@ export declare const LocalVerificationResultSchema: z.ZodObject<{
|
|
|
192
192
|
};
|
|
193
193
|
errors: string[];
|
|
194
194
|
did?: string | undefined;
|
|
195
|
-
|
|
195
|
+
kid?: string | undefined;
|
|
196
196
|
}, {
|
|
197
197
|
valid: boolean;
|
|
198
198
|
session: {
|
|
@@ -213,7 +213,7 @@ export declare const LocalVerificationResultSchema: z.ZodObject<{
|
|
|
213
213
|
error?: string | undefined;
|
|
214
214
|
};
|
|
215
215
|
did?: string | undefined;
|
|
216
|
-
|
|
216
|
+
kid?: string | undefined;
|
|
217
217
|
warnings?: string[] | undefined;
|
|
218
218
|
errors?: string[] | undefined;
|
|
219
219
|
}>;
|
package/dist/test.js
CHANGED
|
@@ -24,11 +24,11 @@ exports.TestEnvironmentSchema = zod_1.z.object({
|
|
|
24
24
|
*/
|
|
25
25
|
exports.MockIdentitySchema = zod_1.z.object({
|
|
26
26
|
did: zod_1.z.string(),
|
|
27
|
-
|
|
28
|
-
privateKey: zod_1.z.string(),
|
|
29
|
-
publicKey: zod_1.z.string(),
|
|
27
|
+
kid: zod_1.z.string(),
|
|
28
|
+
privateKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 private key (44 characters)"),
|
|
29
|
+
publicKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 public key (44 characters)"),
|
|
30
30
|
createdAt: zod_1.z.string(),
|
|
31
|
-
lastRotated: zod_1.z.string(),
|
|
31
|
+
lastRotated: zod_1.z.string().optional(),
|
|
32
32
|
});
|
|
33
33
|
/**
|
|
34
34
|
* Mock delegation status for testing
|
|
@@ -62,7 +62,7 @@ exports.MockIdentityProviderConfigSchema = zod_1.z.object({
|
|
|
62
62
|
exports.LocalVerificationResultSchema = zod_1.z.object({
|
|
63
63
|
valid: zod_1.z.boolean(),
|
|
64
64
|
did: zod_1.z.string().optional(),
|
|
65
|
-
|
|
65
|
+
kid: zod_1.z.string().optional(),
|
|
66
66
|
signature: zod_1.z.object({
|
|
67
67
|
valid: zod_1.z.boolean(),
|
|
68
68
|
algorithm: zod_1.z.string(),
|
|
@@ -24,7 +24,7 @@ export declare function hasRequiredProperties(obj: any, properties: string[], co
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const StringValidators: {
|
|
26
26
|
did: (value: string) => boolean;
|
|
27
|
-
|
|
27
|
+
kid: (value: string) => boolean;
|
|
28
28
|
url: (value: string) => boolean;
|
|
29
29
|
projectName: (value: string) => boolean;
|
|
30
30
|
};
|
package/dist/utils/validation.js
CHANGED
|
@@ -55,7 +55,7 @@ function hasRequiredProperties(obj, properties, context) {
|
|
|
55
55
|
*/
|
|
56
56
|
exports.StringValidators = {
|
|
57
57
|
did: (value) => /^did:[a-z0-9]+:[a-zA-Z0-9._-]+$/.test(value),
|
|
58
|
-
|
|
58
|
+
kid: (value) => /^[a-zA-Z0-9._-]+$/.test(value),
|
|
59
59
|
url: (value) => {
|
|
60
60
|
try {
|
|
61
61
|
new URL(value);
|