@kya-os/contracts 1.0.0-alpha → 1.2.2
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 +98 -0
- package/dist/cli.js +73 -60
- package/dist/delegation/constraints.d.ts +982 -0
- package/dist/delegation/constraints.js +205 -0
- package/dist/delegation/index.d.ts +8 -0
- package/dist/delegation/index.js +24 -0
- package/dist/delegation/schemas.d.ts +3787 -0
- package/dist/delegation/schemas.js +230 -0
- package/dist/did/index.d.ts +8 -0
- package/dist/did/index.js +24 -0
- package/dist/did/resolve-contract.d.ts +220 -0
- package/dist/did/resolve-contract.js +32 -0
- package/dist/did/types.d.ts +164 -0
- package/dist/did/types.js +71 -0
- package/dist/env/constants.d.ts +58 -0
- package/dist/env/constants.js +60 -0
- package/dist/env/index.d.ts +5 -0
- package/dist/env/index.js +21 -0
- package/dist/handshake.js +35 -32
- package/dist/index.d.ts +10 -1
- package/dist/index.js +42 -9
- package/dist/proof/index.d.ts +9 -0
- package/dist/proof/index.js +25 -0
- package/dist/proof/proof-record.d.ts +838 -0
- package/dist/proof/proof-record.js +134 -0
- package/dist/proof/signing-spec.d.ts +147 -0
- package/dist/proof/signing-spec.js +123 -0
- package/dist/proof.js +35 -32
- package/dist/registry.d.ts +46 -46
- package/dist/registry.js +79 -76
- package/dist/runtime/errors.d.ts +348 -0
- package/dist/runtime/errors.js +120 -0
- package/dist/runtime/headers.d.ts +84 -0
- package/dist/runtime/headers.js +82 -0
- package/dist/runtime/index.d.ts +6 -0
- package/dist/runtime/index.js +22 -0
- package/dist/test.js +50 -45
- package/dist/tlkrc/index.d.ts +5 -0
- package/dist/tlkrc/index.js +21 -0
- package/dist/tlkrc/rotation.d.ts +246 -0
- package/dist/tlkrc/rotation.js +127 -0
- package/dist/utils/validation.d.ts +31 -0
- package/dist/utils/validation.js +70 -0
- package/dist/vc/index.d.ts +8 -0
- package/dist/vc/index.js +24 -0
- package/dist/vc/schemas.d.ts +2484 -0
- package/dist/vc/schemas.js +225 -0
- package/dist/vc/statuslist.d.ts +494 -0
- package/dist/vc/statuslist.js +133 -0
- package/dist/verifier.d.ts +56 -0
- package/dist/verifier.js +34 -29
- package/package.json +67 -15
- package/schemas/cli/register-output/v1.0.0.json +2 -2
- package/schemas/proof/v1.0.0.json +1 -1
- package/schemas/registry/receipt-v1.0.0.json +2 -2
- package/schemas/verifier/verify-page/v1.0.0.json +2 -2
- package/schemas/well-known/agent/v1.0.0.json +1 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/handshake.d.ts.map +0 -1
- package/dist/handshake.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/proof.d.ts.map +0 -1
- package/dist/proof.js.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js.map +0 -1
- package/dist/verifier.d.ts.map +0 -1
- package/dist/verifier.js.map +0 -1
package/dist/cli.d.ts
CHANGED
|
@@ -77,103 +77,196 @@ export declare const StatusReportSchema: z.ZodObject<{
|
|
|
77
77
|
environment: "dev" | "prod";
|
|
78
78
|
lastHandshake?: number | undefined;
|
|
79
79
|
}>;
|
|
80
|
+
export declare const PackageInfoSchema: z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
version: z.ZodString;
|
|
83
|
+
compatible: z.ZodBoolean;
|
|
84
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
version: string;
|
|
87
|
+
name: string;
|
|
88
|
+
compatible: boolean;
|
|
89
|
+
issues?: string[] | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
version: string;
|
|
92
|
+
name: string;
|
|
93
|
+
compatible: boolean;
|
|
94
|
+
issues?: string[] | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
export declare const XMCPUpstreamInfoSchema: z.ZodObject<{
|
|
97
|
+
version: z.ZodString;
|
|
98
|
+
compatible: z.ZodBoolean;
|
|
99
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
version: string;
|
|
102
|
+
compatible: boolean;
|
|
103
|
+
issues?: string[] | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
version: string;
|
|
106
|
+
compatible: boolean;
|
|
107
|
+
issues?: string[] | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
export declare const EnvironmentInfoSchema: z.ZodObject<{
|
|
110
|
+
valid: z.ZodBoolean;
|
|
111
|
+
missing: z.ZodArray<z.ZodString, "many">;
|
|
112
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
valid: boolean;
|
|
115
|
+
missing: string[];
|
|
116
|
+
issues?: string[] | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
valid: boolean;
|
|
119
|
+
missing: string[];
|
|
120
|
+
issues?: string[] | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const KTAInfoSchema: z.ZodObject<{
|
|
123
|
+
reachable: z.ZodBoolean;
|
|
124
|
+
authenticated: z.ZodBoolean;
|
|
125
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
reachable: boolean;
|
|
128
|
+
authenticated: boolean;
|
|
129
|
+
issues?: string[] | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
reachable: boolean;
|
|
132
|
+
authenticated: boolean;
|
|
133
|
+
issues?: string[] | undefined;
|
|
134
|
+
}>;
|
|
135
|
+
export declare const CacheInfoSchema: z.ZodObject<{
|
|
136
|
+
type: z.ZodString;
|
|
137
|
+
functional: z.ZodBoolean;
|
|
138
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
type: string;
|
|
141
|
+
functional: boolean;
|
|
142
|
+
issues?: string[] | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
type: string;
|
|
145
|
+
functional: boolean;
|
|
146
|
+
issues?: string[] | undefined;
|
|
147
|
+
}>;
|
|
80
148
|
export declare const DoctorResultSchema: z.ZodObject<{
|
|
81
149
|
packages: z.ZodArray<z.ZodObject<{
|
|
82
150
|
name: z.ZodString;
|
|
83
151
|
version: z.ZodString;
|
|
84
152
|
compatible: z.ZodBoolean;
|
|
153
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
154
|
}, "strip", z.ZodTypeAny, {
|
|
86
155
|
version: string;
|
|
87
156
|
name: string;
|
|
88
157
|
compatible: boolean;
|
|
158
|
+
issues?: string[] | undefined;
|
|
89
159
|
}, {
|
|
90
160
|
version: string;
|
|
91
161
|
name: string;
|
|
92
162
|
compatible: boolean;
|
|
163
|
+
issues?: string[] | undefined;
|
|
93
164
|
}>, "many">;
|
|
94
165
|
xmcpUpstream: z.ZodObject<{
|
|
95
166
|
version: z.ZodString;
|
|
96
167
|
compatible: z.ZodBoolean;
|
|
168
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
97
169
|
}, "strip", z.ZodTypeAny, {
|
|
98
170
|
version: string;
|
|
99
171
|
compatible: boolean;
|
|
172
|
+
issues?: string[] | undefined;
|
|
100
173
|
}, {
|
|
101
174
|
version: string;
|
|
102
175
|
compatible: boolean;
|
|
176
|
+
issues?: string[] | undefined;
|
|
103
177
|
}>;
|
|
104
178
|
environment: z.ZodObject<{
|
|
105
179
|
valid: z.ZodBoolean;
|
|
106
180
|
missing: z.ZodArray<z.ZodString, "many">;
|
|
181
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
107
182
|
}, "strip", z.ZodTypeAny, {
|
|
108
183
|
valid: boolean;
|
|
109
184
|
missing: string[];
|
|
185
|
+
issues?: string[] | undefined;
|
|
110
186
|
}, {
|
|
111
187
|
valid: boolean;
|
|
112
188
|
missing: string[];
|
|
189
|
+
issues?: string[] | undefined;
|
|
113
190
|
}>;
|
|
114
191
|
kta: z.ZodObject<{
|
|
115
192
|
reachable: z.ZodBoolean;
|
|
116
193
|
authenticated: z.ZodBoolean;
|
|
194
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
117
195
|
}, "strip", z.ZodTypeAny, {
|
|
118
196
|
reachable: boolean;
|
|
119
197
|
authenticated: boolean;
|
|
198
|
+
issues?: string[] | undefined;
|
|
120
199
|
}, {
|
|
121
200
|
reachable: boolean;
|
|
122
201
|
authenticated: boolean;
|
|
202
|
+
issues?: string[] | undefined;
|
|
123
203
|
}>;
|
|
124
204
|
cache: z.ZodObject<{
|
|
125
205
|
type: z.ZodString;
|
|
126
206
|
functional: z.ZodBoolean;
|
|
207
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
127
208
|
}, "strip", z.ZodTypeAny, {
|
|
128
209
|
type: string;
|
|
129
210
|
functional: boolean;
|
|
211
|
+
issues?: string[] | undefined;
|
|
130
212
|
}, {
|
|
131
213
|
type: string;
|
|
132
214
|
functional: boolean;
|
|
215
|
+
issues?: string[] | undefined;
|
|
133
216
|
}>;
|
|
134
217
|
}, "strip", z.ZodTypeAny, {
|
|
135
218
|
environment: {
|
|
136
219
|
valid: boolean;
|
|
137
220
|
missing: string[];
|
|
221
|
+
issues?: string[] | undefined;
|
|
138
222
|
};
|
|
139
223
|
packages: {
|
|
140
224
|
version: string;
|
|
141
225
|
name: string;
|
|
142
226
|
compatible: boolean;
|
|
227
|
+
issues?: string[] | undefined;
|
|
143
228
|
}[];
|
|
144
229
|
xmcpUpstream: {
|
|
145
230
|
version: string;
|
|
146
231
|
compatible: boolean;
|
|
232
|
+
issues?: string[] | undefined;
|
|
147
233
|
};
|
|
148
234
|
kta: {
|
|
149
235
|
reachable: boolean;
|
|
150
236
|
authenticated: boolean;
|
|
237
|
+
issues?: string[] | undefined;
|
|
151
238
|
};
|
|
152
239
|
cache: {
|
|
153
240
|
type: string;
|
|
154
241
|
functional: boolean;
|
|
242
|
+
issues?: string[] | undefined;
|
|
155
243
|
};
|
|
156
244
|
}, {
|
|
157
245
|
environment: {
|
|
158
246
|
valid: boolean;
|
|
159
247
|
missing: string[];
|
|
248
|
+
issues?: string[] | undefined;
|
|
160
249
|
};
|
|
161
250
|
packages: {
|
|
162
251
|
version: string;
|
|
163
252
|
name: string;
|
|
164
253
|
compatible: boolean;
|
|
254
|
+
issues?: string[] | undefined;
|
|
165
255
|
}[];
|
|
166
256
|
xmcpUpstream: {
|
|
167
257
|
version: string;
|
|
168
258
|
compatible: boolean;
|
|
259
|
+
issues?: string[] | undefined;
|
|
169
260
|
};
|
|
170
261
|
kta: {
|
|
171
262
|
reachable: boolean;
|
|
172
263
|
authenticated: boolean;
|
|
264
|
+
issues?: string[] | undefined;
|
|
173
265
|
};
|
|
174
266
|
cache: {
|
|
175
267
|
type: string;
|
|
176
268
|
functional: boolean;
|
|
269
|
+
issues?: string[] | undefined;
|
|
177
270
|
};
|
|
178
271
|
}>;
|
|
179
272
|
export declare const ScaffolderOptionsSchema: z.ZodObject<{
|
|
@@ -214,6 +307,11 @@ export declare const ScaffolderResultSchema: z.ZodObject<{
|
|
|
214
307
|
export type IdentityConfig = z.infer<typeof IdentityConfigSchema>;
|
|
215
308
|
export type KeyRotationResult = z.infer<typeof KeyRotationResultSchema>;
|
|
216
309
|
export type StatusReport = z.infer<typeof StatusReportSchema>;
|
|
310
|
+
export type PackageInfo = z.infer<typeof PackageInfoSchema>;
|
|
311
|
+
export type XMCPUpstreamInfo = z.infer<typeof XMCPUpstreamInfoSchema>;
|
|
312
|
+
export type EnvironmentInfo = z.infer<typeof EnvironmentInfoSchema>;
|
|
313
|
+
export type KTAInfo = z.infer<typeof KTAInfoSchema>;
|
|
314
|
+
export type CacheInfo = z.infer<typeof CacheInfoSchema>;
|
|
217
315
|
export type DoctorResult = z.infer<typeof DoctorResultSchema>;
|
|
218
316
|
export type ScaffolderOptions = z.infer<typeof ScaffolderOptionsSchema>;
|
|
219
317
|
export type ScaffolderResult = z.infer<typeof ScaffolderResultSchema>;
|
package/dist/cli.js
CHANGED
|
@@ -1,72 +1,85 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
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.IdentityConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
2
5
|
/**
|
|
3
6
|
* CLI command schemas and results
|
|
4
7
|
*/
|
|
5
|
-
|
|
6
|
-
version: z.literal("1.0"),
|
|
7
|
-
did: z.string().min(1),
|
|
8
|
-
keyId: z.string().min(1),
|
|
9
|
-
privateKey: z.string().min(1), // base64-encoded Ed25519 private key
|
|
10
|
-
publicKey: z.string().min(1), // base64-encoded Ed25519 public key
|
|
11
|
-
createdAt: z.string().datetime(),
|
|
12
|
-
lastRotated: z.string().datetime(),
|
|
8
|
+
exports.IdentityConfigSchema = zod_1.z.object({
|
|
9
|
+
version: zod_1.z.literal("1.0"),
|
|
10
|
+
did: zod_1.z.string().min(1),
|
|
11
|
+
keyId: zod_1.z.string().min(1),
|
|
12
|
+
privateKey: zod_1.z.string().min(1), // base64-encoded Ed25519 private key
|
|
13
|
+
publicKey: zod_1.z.string().min(1), // base64-encoded Ed25519 public key
|
|
14
|
+
createdAt: zod_1.z.string().datetime(),
|
|
15
|
+
lastRotated: zod_1.z.string().datetime(),
|
|
13
16
|
});
|
|
14
|
-
|
|
15
|
-
success: z.boolean(),
|
|
16
|
-
oldKeyId: z.string().min(1),
|
|
17
|
-
newKeyId: z.string().min(1),
|
|
18
|
-
did: z.string().min(1),
|
|
19
|
-
mode: z.enum(["dev", "prod"]),
|
|
20
|
-
delegated: z.boolean(),
|
|
21
|
-
forced: z.boolean(),
|
|
22
|
-
auditLine: z.string().min(1),
|
|
17
|
+
exports.KeyRotationResultSchema = zod_1.z.object({
|
|
18
|
+
success: zod_1.z.boolean(),
|
|
19
|
+
oldKeyId: zod_1.z.string().min(1),
|
|
20
|
+
newKeyId: zod_1.z.string().min(1),
|
|
21
|
+
did: zod_1.z.string().min(1),
|
|
22
|
+
mode: zod_1.z.enum(["dev", "prod"]),
|
|
23
|
+
delegated: zod_1.z.boolean(),
|
|
24
|
+
forced: zod_1.z.boolean(),
|
|
25
|
+
auditLine: zod_1.z.string().min(1),
|
|
23
26
|
});
|
|
24
|
-
|
|
25
|
-
did: z.string().min(1),
|
|
26
|
-
keyId: z.string().min(1),
|
|
27
|
-
ktaURL: z.string().url(),
|
|
28
|
-
mirrorStatus: z.enum(["pending", "success", "error"]),
|
|
29
|
-
lastHandshake: z.number().int().positive().optional(),
|
|
30
|
-
environment: z.enum(["dev", "prod"]),
|
|
27
|
+
exports.StatusReportSchema = zod_1.z.object({
|
|
28
|
+
did: zod_1.z.string().min(1),
|
|
29
|
+
keyId: zod_1.z.string().min(1),
|
|
30
|
+
ktaURL: zod_1.z.string().url(),
|
|
31
|
+
mirrorStatus: zod_1.z.enum(["pending", "success", "error"]),
|
|
32
|
+
lastHandshake: zod_1.z.number().int().positive().optional(),
|
|
33
|
+
environment: zod_1.z.enum(["dev", "prod"]),
|
|
31
34
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})),
|
|
38
|
-
xmcpUpstream: z.object({
|
|
39
|
-
version: z.string(),
|
|
40
|
-
compatible: z.boolean(),
|
|
41
|
-
}),
|
|
42
|
-
environment: z.object({
|
|
43
|
-
valid: z.boolean(),
|
|
44
|
-
missing: z.array(z.string()),
|
|
45
|
-
}),
|
|
46
|
-
kta: z.object({
|
|
47
|
-
reachable: z.boolean(),
|
|
48
|
-
authenticated: z.boolean(),
|
|
49
|
-
}),
|
|
50
|
-
cache: z.object({
|
|
51
|
-
type: z.string(),
|
|
52
|
-
functional: z.boolean(),
|
|
53
|
-
}),
|
|
35
|
+
exports.PackageInfoSchema = zod_1.z.object({
|
|
36
|
+
name: zod_1.z.string(),
|
|
37
|
+
version: zod_1.z.string(),
|
|
38
|
+
compatible: zod_1.z.boolean(),
|
|
39
|
+
issues: zod_1.z.array(zod_1.z.string()).optional(),
|
|
54
40
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
noIdentity: z.boolean().default(false),
|
|
41
|
+
exports.XMCPUpstreamInfoSchema = zod_1.z.object({
|
|
42
|
+
version: zod_1.z.string(),
|
|
43
|
+
compatible: zod_1.z.boolean(),
|
|
44
|
+
issues: zod_1.z.array(zod_1.z.string()).optional(),
|
|
60
45
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
46
|
+
exports.EnvironmentInfoSchema = zod_1.z.object({
|
|
47
|
+
valid: zod_1.z.boolean(),
|
|
48
|
+
missing: zod_1.z.array(zod_1.z.string()),
|
|
49
|
+
issues: zod_1.z.array(zod_1.z.string()).optional(),
|
|
50
|
+
});
|
|
51
|
+
exports.KTAInfoSchema = zod_1.z.object({
|
|
52
|
+
reachable: zod_1.z.boolean(),
|
|
53
|
+
authenticated: zod_1.z.boolean(),
|
|
54
|
+
issues: zod_1.z.array(zod_1.z.string()).optional(),
|
|
55
|
+
});
|
|
56
|
+
exports.CacheInfoSchema = zod_1.z.object({
|
|
57
|
+
type: zod_1.z.string(),
|
|
58
|
+
functional: zod_1.z.boolean(),
|
|
59
|
+
issues: zod_1.z.array(zod_1.z.string()).optional(),
|
|
60
|
+
});
|
|
61
|
+
exports.DoctorResultSchema = zod_1.z.object({
|
|
62
|
+
packages: zod_1.z.array(exports.PackageInfoSchema),
|
|
63
|
+
xmcpUpstream: exports.XMCPUpstreamInfoSchema,
|
|
64
|
+
environment: exports.EnvironmentInfoSchema,
|
|
65
|
+
kta: exports.KTAInfoSchema,
|
|
66
|
+
cache: exports.CacheInfoSchema,
|
|
67
|
+
});
|
|
68
|
+
exports.ScaffolderOptionsSchema = zod_1.z.object({
|
|
69
|
+
projectName: zod_1.z.string().min(1),
|
|
70
|
+
xmcpVersion: zod_1.z.string().optional(),
|
|
71
|
+
xmcpChannel: zod_1.z.enum(["latest", "next"]).optional(),
|
|
72
|
+
noIdentity: zod_1.z.boolean().default(false),
|
|
73
|
+
});
|
|
74
|
+
exports.ScaffolderResultSchema = zod_1.z.object({
|
|
75
|
+
success: zod_1.z.boolean(),
|
|
76
|
+
projectPath: zod_1.z.string().min(1),
|
|
77
|
+
xmcpVersion: zod_1.z.string().min(1),
|
|
78
|
+
identityEnabled: zod_1.z.boolean(),
|
|
79
|
+
warnings: zod_1.z.array(zod_1.z.string()).optional(),
|
|
67
80
|
});
|
|
68
81
|
// Error codes as string literal union
|
|
69
|
-
|
|
82
|
+
exports.ERROR_CODES = {
|
|
70
83
|
XMCP_I_EBADPROOF: "XMCP_I_EBADPROOF",
|
|
71
84
|
XMCP_I_ENOIDENTITY: "XMCP_I_ENOIDENTITY",
|
|
72
85
|
XMCP_I_EMIRRORPENDING: "XMCP_I_EMIRRORPENDING",
|
|
@@ -77,7 +90,7 @@ export const ERROR_CODES = {
|
|
|
77
90
|
XMCP_I_ERUNTIME: "XMCP_I_ERUNTIME",
|
|
78
91
|
};
|
|
79
92
|
// CLI exit codes
|
|
80
|
-
|
|
93
|
+
exports.CLI_EXIT_CODES = {
|
|
81
94
|
SUCCESS: 0,
|
|
82
95
|
GENERAL_ERROR: 1,
|
|
83
96
|
BADPROOF: 20,
|