@kya-os/contracts 1.3.2 → 1.3.4
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/package.json +28 -5
- package/README.md +0 -130
- package/dist/cli.d.ts +0 -378
- package/dist/cli.js +0 -116
- package/dist/delegation/constraints.d.ts +0 -992
- package/dist/delegation/constraints.js +0 -210
- package/dist/delegation/index.d.ts +0 -8
- package/dist/delegation/index.js +0 -24
- package/dist/delegation/schemas.d.ts +0 -8382
- package/dist/delegation/schemas.js +0 -476
- package/dist/did/index.d.ts +0 -9
- package/dist/did/index.js +0 -25
- package/dist/did/resolve-contract.d.ts +0 -220
- package/dist/did/resolve-contract.js +0 -32
- package/dist/did/schemas.d.ts +0 -113
- package/dist/did/schemas.js +0 -173
- package/dist/did/types.d.ts +0 -164
- package/dist/did/types.js +0 -71
- package/dist/env/constants.d.ts +0 -58
- package/dist/env/constants.js +0 -60
- package/dist/env/index.d.ts +0 -5
- package/dist/env/index.js +0 -21
- package/dist/handshake.d.ts +0 -159
- package/dist/handshake.js +0 -58
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -53
- package/dist/proof/index.d.ts +0 -9
- package/dist/proof/index.js +0 -25
- package/dist/proof/proof-record.d.ts +0 -838
- package/dist/proof/proof-record.js +0 -134
- package/dist/proof/signing-spec.d.ts +0 -147
- package/dist/proof/signing-spec.js +0 -123
- package/dist/proof.d.ts +0 -400
- package/dist/proof.js +0 -82
- package/dist/registry.d.ts +0 -343
- package/dist/registry.js +0 -119
- package/dist/runtime/errors.d.ts +0 -348
- package/dist/runtime/errors.js +0 -120
- package/dist/runtime/headers.d.ts +0 -84
- package/dist/runtime/headers.js +0 -82
- package/dist/runtime/index.d.ts +0 -6
- package/dist/runtime/index.js +0 -22
- package/dist/test.d.ts +0 -252
- package/dist/test.js +0 -120
- package/dist/tlkrc/index.d.ts +0 -5
- package/dist/tlkrc/index.js +0 -21
- package/dist/tlkrc/rotation.d.ts +0 -246
- package/dist/tlkrc/rotation.js +0 -127
- package/dist/utils/validation.d.ts +0 -31
- package/dist/utils/validation.js +0 -70
- package/dist/vc/index.d.ts +0 -8
- package/dist/vc/index.js +0 -24
- package/dist/vc/schemas.d.ts +0 -2484
- package/dist/vc/schemas.js +0 -225
- package/dist/vc/statuslist.d.ts +0 -494
- package/dist/vc/statuslist.js +0 -133
- package/dist/verifier.d.ts +0 -206
- package/dist/verifier.js +0 -84
package/dist/verifier.d.ts
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Verifier middleware schemas and headers
|
|
4
|
-
*/
|
|
5
|
-
export declare const AgentContextSchema: z.ZodObject<{
|
|
6
|
-
did: z.ZodString;
|
|
7
|
-
kid: z.ZodString;
|
|
8
|
-
subject: z.ZodOptional<z.ZodString>;
|
|
9
|
-
scopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
-
session: z.ZodString;
|
|
11
|
-
confidence: z.ZodLiteral<"verified">;
|
|
12
|
-
delegationRef: z.ZodOptional<z.ZodString>;
|
|
13
|
-
registry: z.ZodString;
|
|
14
|
-
verifiedAt: z.ZodNumber;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
did: string;
|
|
17
|
-
kid: string;
|
|
18
|
-
scopes: string[];
|
|
19
|
-
session: string;
|
|
20
|
-
confidence: "verified";
|
|
21
|
-
registry: string;
|
|
22
|
-
verifiedAt: number;
|
|
23
|
-
subject?: string | undefined;
|
|
24
|
-
delegationRef?: string | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
did: string;
|
|
27
|
-
kid: string;
|
|
28
|
-
session: string;
|
|
29
|
-
confidence: "verified";
|
|
30
|
-
registry: string;
|
|
31
|
-
verifiedAt: number;
|
|
32
|
-
subject?: string | undefined;
|
|
33
|
-
scopes?: string[] | undefined;
|
|
34
|
-
delegationRef?: string | undefined;
|
|
35
|
-
}>;
|
|
36
|
-
export declare const VerifierResultSchema: z.ZodObject<{
|
|
37
|
-
success: z.ZodBoolean;
|
|
38
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
-
agentContext: z.ZodOptional<z.ZodObject<{
|
|
40
|
-
did: z.ZodString;
|
|
41
|
-
kid: z.ZodString;
|
|
42
|
-
subject: z.ZodOptional<z.ZodString>;
|
|
43
|
-
scopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
44
|
-
session: z.ZodString;
|
|
45
|
-
confidence: z.ZodLiteral<"verified">;
|
|
46
|
-
delegationRef: z.ZodOptional<z.ZodString>;
|
|
47
|
-
registry: z.ZodString;
|
|
48
|
-
verifiedAt: z.ZodNumber;
|
|
49
|
-
}, "strip", z.ZodTypeAny, {
|
|
50
|
-
did: string;
|
|
51
|
-
kid: string;
|
|
52
|
-
scopes: string[];
|
|
53
|
-
session: string;
|
|
54
|
-
confidence: "verified";
|
|
55
|
-
registry: string;
|
|
56
|
-
verifiedAt: number;
|
|
57
|
-
subject?: string | undefined;
|
|
58
|
-
delegationRef?: string | undefined;
|
|
59
|
-
}, {
|
|
60
|
-
did: string;
|
|
61
|
-
kid: string;
|
|
62
|
-
session: string;
|
|
63
|
-
confidence: "verified";
|
|
64
|
-
registry: string;
|
|
65
|
-
verifiedAt: number;
|
|
66
|
-
subject?: string | undefined;
|
|
67
|
-
scopes?: string[] | undefined;
|
|
68
|
-
delegationRef?: string | undefined;
|
|
69
|
-
}>>;
|
|
70
|
-
error: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
code: z.ZodString;
|
|
72
|
-
message: z.ZodString;
|
|
73
|
-
details: z.ZodOptional<z.ZodAny>;
|
|
74
|
-
httpStatus: z.ZodNumber;
|
|
75
|
-
}, "strip", z.ZodTypeAny, {
|
|
76
|
-
code: string;
|
|
77
|
-
message: string;
|
|
78
|
-
httpStatus: number;
|
|
79
|
-
details?: any;
|
|
80
|
-
}, {
|
|
81
|
-
code: string;
|
|
82
|
-
message: string;
|
|
83
|
-
httpStatus: number;
|
|
84
|
-
details?: any;
|
|
85
|
-
}>>;
|
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
|
87
|
-
success: boolean;
|
|
88
|
-
error?: {
|
|
89
|
-
code: string;
|
|
90
|
-
message: string;
|
|
91
|
-
httpStatus: number;
|
|
92
|
-
details?: any;
|
|
93
|
-
} | undefined;
|
|
94
|
-
headers?: Record<string, string> | undefined;
|
|
95
|
-
agentContext?: {
|
|
96
|
-
did: string;
|
|
97
|
-
kid: string;
|
|
98
|
-
scopes: string[];
|
|
99
|
-
session: string;
|
|
100
|
-
confidence: "verified";
|
|
101
|
-
registry: string;
|
|
102
|
-
verifiedAt: number;
|
|
103
|
-
subject?: string | undefined;
|
|
104
|
-
delegationRef?: string | undefined;
|
|
105
|
-
} | undefined;
|
|
106
|
-
}, {
|
|
107
|
-
success: boolean;
|
|
108
|
-
error?: {
|
|
109
|
-
code: string;
|
|
110
|
-
message: string;
|
|
111
|
-
httpStatus: number;
|
|
112
|
-
details?: any;
|
|
113
|
-
} | undefined;
|
|
114
|
-
headers?: Record<string, string> | undefined;
|
|
115
|
-
agentContext?: {
|
|
116
|
-
did: string;
|
|
117
|
-
kid: string;
|
|
118
|
-
session: string;
|
|
119
|
-
confidence: "verified";
|
|
120
|
-
registry: string;
|
|
121
|
-
verifiedAt: number;
|
|
122
|
-
subject?: string | undefined;
|
|
123
|
-
scopes?: string[] | undefined;
|
|
124
|
-
delegationRef?: string | undefined;
|
|
125
|
-
} | undefined;
|
|
126
|
-
}>;
|
|
127
|
-
export declare const StructuredErrorSchema: z.ZodObject<{
|
|
128
|
-
code: z.ZodString;
|
|
129
|
-
message: z.ZodString;
|
|
130
|
-
httpStatus: z.ZodNumber;
|
|
131
|
-
details: z.ZodOptional<z.ZodObject<{
|
|
132
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
133
|
-
expected: z.ZodOptional<z.ZodAny>;
|
|
134
|
-
received: z.ZodOptional<z.ZodAny>;
|
|
135
|
-
remediation: z.ZodOptional<z.ZodString>;
|
|
136
|
-
}, "strip", z.ZodTypeAny, {
|
|
137
|
-
expected?: any;
|
|
138
|
-
received?: any;
|
|
139
|
-
reason?: string | undefined;
|
|
140
|
-
remediation?: string | undefined;
|
|
141
|
-
}, {
|
|
142
|
-
expected?: any;
|
|
143
|
-
received?: any;
|
|
144
|
-
reason?: string | undefined;
|
|
145
|
-
remediation?: string | undefined;
|
|
146
|
-
}>>;
|
|
147
|
-
}, "strip", z.ZodTypeAny, {
|
|
148
|
-
code: string;
|
|
149
|
-
message: string;
|
|
150
|
-
httpStatus: number;
|
|
151
|
-
details?: {
|
|
152
|
-
expected?: any;
|
|
153
|
-
received?: any;
|
|
154
|
-
reason?: string | undefined;
|
|
155
|
-
remediation?: string | undefined;
|
|
156
|
-
} | undefined;
|
|
157
|
-
}, {
|
|
158
|
-
code: string;
|
|
159
|
-
message: string;
|
|
160
|
-
httpStatus: number;
|
|
161
|
-
details?: {
|
|
162
|
-
expected?: any;
|
|
163
|
-
received?: any;
|
|
164
|
-
reason?: string | undefined;
|
|
165
|
-
remediation?: string | undefined;
|
|
166
|
-
} | undefined;
|
|
167
|
-
}>;
|
|
168
|
-
export type AgentContext = z.infer<typeof AgentContextSchema>;
|
|
169
|
-
export type VerifierResult = z.infer<typeof VerifierResultSchema>;
|
|
170
|
-
export type StructuredError = z.infer<typeof StructuredErrorSchema>;
|
|
171
|
-
export declare const AGENT_HEADERS: {
|
|
172
|
-
readonly DID: "X-Agent-DID";
|
|
173
|
-
readonly KEY_ID: "X-Agent-KeyId";
|
|
174
|
-
readonly SUBJECT: "X-Agent-Subject";
|
|
175
|
-
readonly SCOPES: "X-Agent-Scopes";
|
|
176
|
-
readonly SESSION: "X-Agent-Session";
|
|
177
|
-
readonly CONFIDENCE: "X-Agent-Confidence";
|
|
178
|
-
readonly DELEGATION_REF: "X-Agent-Delegation-Ref";
|
|
179
|
-
readonly REGISTRY: "X-Agent-Registry";
|
|
180
|
-
readonly VERIFIED_AT: "X-Agent-Verified-At";
|
|
181
|
-
};
|
|
182
|
-
export declare const VERIFIER_ERROR_CODES: {
|
|
183
|
-
readonly PROOF_INVALID_TS: "XMCP_I_PROOF_INVALID_TS";
|
|
184
|
-
readonly PROOF_FUTURE_TS: "XMCP_I_PROOF_FUTURE_TS";
|
|
185
|
-
readonly PROOF_TOO_OLD: "XMCP_I_PROOF_TOO_OLD";
|
|
186
|
-
readonly PROOF_SKEW_EXCEEDED: "XMCP_I_PROOF_SKEW_EXCEEDED";
|
|
187
|
-
readonly SESSION_IDLE_EXPIRED: "XMCP_I_SESSION_IDLE_EXPIRED";
|
|
188
|
-
readonly SERVER_TIME_INVALID: "XMCP_I_SERVER_TIME_INVALID";
|
|
189
|
-
};
|
|
190
|
-
export declare const ERROR_HTTP_STATUS: {
|
|
191
|
-
readonly XMCP_I_EBADPROOF: 403;
|
|
192
|
-
readonly XMCP_I_ENOIDENTITY: 500;
|
|
193
|
-
readonly XMCP_I_EMIRRORPENDING: 200;
|
|
194
|
-
readonly XMCP_I_EHANDSHAKE: 401;
|
|
195
|
-
readonly XMCP_I_ESESSION: 401;
|
|
196
|
-
readonly XMCP_I_ECLAIM: 400;
|
|
197
|
-
readonly XMCP_I_ECONFIG: 500;
|
|
198
|
-
readonly XMCP_I_ERUNTIME: 500;
|
|
199
|
-
readonly XMCP_I_PROOF_INVALID_TS: 403;
|
|
200
|
-
readonly XMCP_I_PROOF_FUTURE_TS: 403;
|
|
201
|
-
readonly XMCP_I_PROOF_TOO_OLD: 403;
|
|
202
|
-
readonly XMCP_I_PROOF_SKEW_EXCEEDED: 401;
|
|
203
|
-
readonly XMCP_I_SESSION_IDLE_EXPIRED: 401;
|
|
204
|
-
readonly XMCP_I_SERVER_TIME_INVALID: 500;
|
|
205
|
-
};
|
|
206
|
-
//# sourceMappingURL=verifier.d.ts.map
|
package/dist/verifier.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERROR_HTTP_STATUS = exports.VERIFIER_ERROR_CODES = exports.AGENT_HEADERS = exports.StructuredErrorSchema = exports.VerifierResultSchema = exports.AgentContextSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/**
|
|
6
|
-
* Verifier middleware schemas and headers
|
|
7
|
-
*/
|
|
8
|
-
exports.AgentContextSchema = zod_1.z.object({
|
|
9
|
-
did: zod_1.z.string().min(1),
|
|
10
|
-
kid: zod_1.z.string().min(1),
|
|
11
|
-
subject: zod_1.z.string().optional(),
|
|
12
|
-
scopes: zod_1.z.array(zod_1.z.string()).default([]),
|
|
13
|
-
session: zod_1.z.string().min(1),
|
|
14
|
-
confidence: zod_1.z.literal("verified"),
|
|
15
|
-
delegationRef: zod_1.z.string().optional(),
|
|
16
|
-
registry: zod_1.z.string().url(),
|
|
17
|
-
verifiedAt: zod_1.z.number().int().positive(),
|
|
18
|
-
});
|
|
19
|
-
exports.VerifierResultSchema = zod_1.z.object({
|
|
20
|
-
success: zod_1.z.boolean(),
|
|
21
|
-
headers: zod_1.z.record(zod_1.z.string()).optional(),
|
|
22
|
-
agentContext: exports.AgentContextSchema.optional(),
|
|
23
|
-
error: zod_1.z
|
|
24
|
-
.object({
|
|
25
|
-
code: zod_1.z.string(),
|
|
26
|
-
message: zod_1.z.string(),
|
|
27
|
-
details: zod_1.z.any().optional(),
|
|
28
|
-
httpStatus: zod_1.z.number().int().min(400).max(599),
|
|
29
|
-
})
|
|
30
|
-
.optional(),
|
|
31
|
-
});
|
|
32
|
-
exports.StructuredErrorSchema = zod_1.z.object({
|
|
33
|
-
code: zod_1.z.string(),
|
|
34
|
-
message: zod_1.z.string(),
|
|
35
|
-
httpStatus: zod_1.z.number().int().min(400).max(599),
|
|
36
|
-
details: zod_1.z
|
|
37
|
-
.object({
|
|
38
|
-
reason: zod_1.z.string().optional(),
|
|
39
|
-
expected: zod_1.z.any().optional(),
|
|
40
|
-
received: zod_1.z.any().optional(),
|
|
41
|
-
remediation: zod_1.z.string().optional(),
|
|
42
|
-
})
|
|
43
|
-
.optional(),
|
|
44
|
-
});
|
|
45
|
-
// Header constants (frozen names)
|
|
46
|
-
exports.AGENT_HEADERS = {
|
|
47
|
-
DID: "X-Agent-DID",
|
|
48
|
-
KEY_ID: "X-Agent-KeyId",
|
|
49
|
-
SUBJECT: "X-Agent-Subject",
|
|
50
|
-
SCOPES: "X-Agent-Scopes",
|
|
51
|
-
SESSION: "X-Agent-Session",
|
|
52
|
-
CONFIDENCE: "X-Agent-Confidence",
|
|
53
|
-
DELEGATION_REF: "X-Agent-Delegation-Ref",
|
|
54
|
-
REGISTRY: "X-Agent-Registry",
|
|
55
|
-
VERIFIED_AT: "X-Agent-Verified-At",
|
|
56
|
-
};
|
|
57
|
-
// Verifier-specific error codes
|
|
58
|
-
exports.VERIFIER_ERROR_CODES = {
|
|
59
|
-
PROOF_INVALID_TS: "XMCP_I_PROOF_INVALID_TS",
|
|
60
|
-
PROOF_FUTURE_TS: "XMCP_I_PROOF_FUTURE_TS",
|
|
61
|
-
PROOF_TOO_OLD: "XMCP_I_PROOF_TOO_OLD",
|
|
62
|
-
PROOF_SKEW_EXCEEDED: "XMCP_I_PROOF_SKEW_EXCEEDED",
|
|
63
|
-
SESSION_IDLE_EXPIRED: "XMCP_I_SESSION_IDLE_EXPIRED",
|
|
64
|
-
SERVER_TIME_INVALID: "XMCP_I_SERVER_TIME_INVALID",
|
|
65
|
-
};
|
|
66
|
-
// HTTP status mappings
|
|
67
|
-
exports.ERROR_HTTP_STATUS = {
|
|
68
|
-
XMCP_I_EBADPROOF: 403,
|
|
69
|
-
XMCP_I_ENOIDENTITY: 500,
|
|
70
|
-
XMCP_I_EMIRRORPENDING: 200,
|
|
71
|
-
XMCP_I_EHANDSHAKE: 401,
|
|
72
|
-
XMCP_I_ESESSION: 401,
|
|
73
|
-
XMCP_I_ECLAIM: 400,
|
|
74
|
-
XMCP_I_ECONFIG: 500,
|
|
75
|
-
XMCP_I_ERUNTIME: 500,
|
|
76
|
-
// Verifier-specific codes
|
|
77
|
-
[exports.VERIFIER_ERROR_CODES.PROOF_INVALID_TS]: 403,
|
|
78
|
-
[exports.VERIFIER_ERROR_CODES.PROOF_FUTURE_TS]: 403,
|
|
79
|
-
[exports.VERIFIER_ERROR_CODES.PROOF_TOO_OLD]: 403,
|
|
80
|
-
[exports.VERIFIER_ERROR_CODES.PROOF_SKEW_EXCEEDED]: 401,
|
|
81
|
-
[exports.VERIFIER_ERROR_CODES.SESSION_IDLE_EXPIRED]: 401,
|
|
82
|
-
[exports.VERIFIER_ERROR_CODES.SERVER_TIME_INVALID]: 500,
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=verifier.js.map
|