@kya-os/contracts 1.3.1-canary.0 → 1.3.1-canary.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 +48 -10
- package/dist/cli.js +18 -6
- package/dist/delegation/schemas.d.ts +4330 -29
- package/dist/delegation/schemas.js +248 -2
- package/dist/did/index.d.ts +1 -0
- package/dist/did/index.js +1 -0
- package/dist/did/schemas.d.ts +113 -0
- package/dist/did/schemas.js +173 -0
- package/dist/did/types.d.ts +1 -1
- package/dist/handshake.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/proof.d.ts +238 -0
- package/dist/proof.js +32 -1
- 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 +31 -17
- 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.map +0 -1
- package/dist/delegation/index.d.ts.map +0 -1
- package/dist/delegation/schemas.d.ts.map +0 -1
- package/dist/did/index.d.ts.map +0 -1
- package/dist/did/resolve-contract.d.ts.map +0 -1
- package/dist/did/types.d.ts.map +0 -1
- package/dist/env/constants.d.ts.map +0 -1
- package/dist/env/index.d.ts.map +0 -1
- package/dist/handshake.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/proof/index.d.ts.map +0 -1
- package/dist/proof/proof-record.d.ts.map +0 -1
- package/dist/proof/signing-spec.d.ts.map +0 -1
- package/dist/proof.d.ts.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/runtime/errors.d.ts.map +0 -1
- package/dist/runtime/headers.d.ts.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/test.d.ts.map +0 -1
- package/dist/tlkrc/index.d.ts.map +0 -1
- package/dist/tlkrc/rotation.d.ts.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/vc/index.d.ts.map +0 -1
- package/dist/vc/schemas.d.ts.map +0 -1
- package/dist/vc/statuslist.d.ts.map +0 -1
- 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/proof.d.ts
CHANGED
|
@@ -159,4 +159,242 @@ export type AuditRecord = z.infer<typeof AuditRecordSchema>;
|
|
|
159
159
|
export declare const JWS_ALGORITHM = "EdDSA";
|
|
160
160
|
export declare const HASH_ALGORITHM = "sha256";
|
|
161
161
|
export declare const AUDIT_VERSION = "audit.v1";
|
|
162
|
+
/**
|
|
163
|
+
* Tool call context for AgentShield dashboard integration
|
|
164
|
+
* Provides plaintext tool execution data alongside cryptographic proofs
|
|
165
|
+
*/
|
|
166
|
+
export declare const ToolCallContextSchema: z.ZodObject<{
|
|
167
|
+
tool: z.ZodString;
|
|
168
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
169
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
170
|
+
scopeId: z.ZodString;
|
|
171
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
scopeId: string;
|
|
174
|
+
tool: string;
|
|
175
|
+
args: Record<string, unknown>;
|
|
176
|
+
result?: unknown;
|
|
177
|
+
userId?: string | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
scopeId: string;
|
|
180
|
+
tool: string;
|
|
181
|
+
args: Record<string, unknown>;
|
|
182
|
+
result?: unknown;
|
|
183
|
+
userId?: string | undefined;
|
|
184
|
+
}>;
|
|
185
|
+
/**
|
|
186
|
+
* Proof submission context for AgentShield API
|
|
187
|
+
* Includes tool calls and optional MCP server URL for tool discovery
|
|
188
|
+
*/
|
|
189
|
+
export declare const ProofSubmissionContextSchema: z.ZodObject<{
|
|
190
|
+
toolCalls: z.ZodArray<z.ZodObject<{
|
|
191
|
+
tool: z.ZodString;
|
|
192
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
193
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
194
|
+
scopeId: z.ZodString;
|
|
195
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
scopeId: string;
|
|
198
|
+
tool: string;
|
|
199
|
+
args: Record<string, unknown>;
|
|
200
|
+
result?: unknown;
|
|
201
|
+
userId?: string | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
scopeId: string;
|
|
204
|
+
tool: string;
|
|
205
|
+
args: Record<string, unknown>;
|
|
206
|
+
result?: unknown;
|
|
207
|
+
userId?: string | undefined;
|
|
208
|
+
}>, "many">;
|
|
209
|
+
mcpServerUrl: z.ZodOptional<z.ZodString>;
|
|
210
|
+
}, "strip", z.ZodTypeAny, {
|
|
211
|
+
toolCalls: {
|
|
212
|
+
scopeId: string;
|
|
213
|
+
tool: string;
|
|
214
|
+
args: Record<string, unknown>;
|
|
215
|
+
result?: unknown;
|
|
216
|
+
userId?: string | undefined;
|
|
217
|
+
}[];
|
|
218
|
+
mcpServerUrl?: string | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
toolCalls: {
|
|
221
|
+
scopeId: string;
|
|
222
|
+
tool: string;
|
|
223
|
+
args: Record<string, unknown>;
|
|
224
|
+
result?: unknown;
|
|
225
|
+
userId?: string | undefined;
|
|
226
|
+
}[];
|
|
227
|
+
mcpServerUrl?: string | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
/**
|
|
230
|
+
* Complete proof submission request to AgentShield
|
|
231
|
+
*/
|
|
232
|
+
export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
233
|
+
session_id: z.ZodString;
|
|
234
|
+
delegation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
+
proofs: z.ZodArray<z.ZodObject<{
|
|
236
|
+
jws: z.ZodString;
|
|
237
|
+
meta: z.ZodObject<{
|
|
238
|
+
did: z.ZodString;
|
|
239
|
+
kid: z.ZodString;
|
|
240
|
+
ts: z.ZodNumber;
|
|
241
|
+
nonce: z.ZodString;
|
|
242
|
+
audience: z.ZodString;
|
|
243
|
+
sessionId: z.ZodString;
|
|
244
|
+
requestHash: z.ZodString;
|
|
245
|
+
responseHash: z.ZodString;
|
|
246
|
+
scopeId: z.ZodOptional<z.ZodString>;
|
|
247
|
+
delegationRef: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
did: string;
|
|
250
|
+
kid: string;
|
|
251
|
+
ts: number;
|
|
252
|
+
nonce: string;
|
|
253
|
+
audience: string;
|
|
254
|
+
sessionId: string;
|
|
255
|
+
requestHash: string;
|
|
256
|
+
responseHash: string;
|
|
257
|
+
scopeId?: string | undefined;
|
|
258
|
+
delegationRef?: string | undefined;
|
|
259
|
+
}, {
|
|
260
|
+
did: string;
|
|
261
|
+
kid: string;
|
|
262
|
+
ts: number;
|
|
263
|
+
nonce: string;
|
|
264
|
+
audience: string;
|
|
265
|
+
sessionId: string;
|
|
266
|
+
requestHash: string;
|
|
267
|
+
responseHash: string;
|
|
268
|
+
scopeId?: string | undefined;
|
|
269
|
+
delegationRef?: string | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
jws: string;
|
|
273
|
+
meta: {
|
|
274
|
+
did: string;
|
|
275
|
+
kid: string;
|
|
276
|
+
ts: number;
|
|
277
|
+
nonce: string;
|
|
278
|
+
audience: string;
|
|
279
|
+
sessionId: string;
|
|
280
|
+
requestHash: string;
|
|
281
|
+
responseHash: string;
|
|
282
|
+
scopeId?: string | undefined;
|
|
283
|
+
delegationRef?: string | undefined;
|
|
284
|
+
};
|
|
285
|
+
}, {
|
|
286
|
+
jws: string;
|
|
287
|
+
meta: {
|
|
288
|
+
did: string;
|
|
289
|
+
kid: string;
|
|
290
|
+
ts: number;
|
|
291
|
+
nonce: string;
|
|
292
|
+
audience: string;
|
|
293
|
+
sessionId: string;
|
|
294
|
+
requestHash: string;
|
|
295
|
+
responseHash: string;
|
|
296
|
+
scopeId?: string | undefined;
|
|
297
|
+
delegationRef?: string | undefined;
|
|
298
|
+
};
|
|
299
|
+
}>, "many">;
|
|
300
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
301
|
+
toolCalls: z.ZodArray<z.ZodObject<{
|
|
302
|
+
tool: z.ZodString;
|
|
303
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
304
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
305
|
+
scopeId: z.ZodString;
|
|
306
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
scopeId: string;
|
|
309
|
+
tool: string;
|
|
310
|
+
args: Record<string, unknown>;
|
|
311
|
+
result?: unknown;
|
|
312
|
+
userId?: string | undefined;
|
|
313
|
+
}, {
|
|
314
|
+
scopeId: string;
|
|
315
|
+
tool: string;
|
|
316
|
+
args: Record<string, unknown>;
|
|
317
|
+
result?: unknown;
|
|
318
|
+
userId?: string | undefined;
|
|
319
|
+
}>, "many">;
|
|
320
|
+
mcpServerUrl: z.ZodOptional<z.ZodString>;
|
|
321
|
+
}, "strip", z.ZodTypeAny, {
|
|
322
|
+
toolCalls: {
|
|
323
|
+
scopeId: string;
|
|
324
|
+
tool: string;
|
|
325
|
+
args: Record<string, unknown>;
|
|
326
|
+
result?: unknown;
|
|
327
|
+
userId?: string | undefined;
|
|
328
|
+
}[];
|
|
329
|
+
mcpServerUrl?: string | undefined;
|
|
330
|
+
}, {
|
|
331
|
+
toolCalls: {
|
|
332
|
+
scopeId: string;
|
|
333
|
+
tool: string;
|
|
334
|
+
args: Record<string, unknown>;
|
|
335
|
+
result?: unknown;
|
|
336
|
+
userId?: string | undefined;
|
|
337
|
+
}[];
|
|
338
|
+
mcpServerUrl?: string | undefined;
|
|
339
|
+
}>>;
|
|
340
|
+
}, "strip", z.ZodTypeAny, {
|
|
341
|
+
session_id: string;
|
|
342
|
+
proofs: {
|
|
343
|
+
jws: string;
|
|
344
|
+
meta: {
|
|
345
|
+
did: string;
|
|
346
|
+
kid: string;
|
|
347
|
+
ts: number;
|
|
348
|
+
nonce: string;
|
|
349
|
+
audience: string;
|
|
350
|
+
sessionId: string;
|
|
351
|
+
requestHash: string;
|
|
352
|
+
responseHash: string;
|
|
353
|
+
scopeId?: string | undefined;
|
|
354
|
+
delegationRef?: string | undefined;
|
|
355
|
+
};
|
|
356
|
+
}[];
|
|
357
|
+
delegation_id?: string | null | undefined;
|
|
358
|
+
context?: {
|
|
359
|
+
toolCalls: {
|
|
360
|
+
scopeId: string;
|
|
361
|
+
tool: string;
|
|
362
|
+
args: Record<string, unknown>;
|
|
363
|
+
result?: unknown;
|
|
364
|
+
userId?: string | undefined;
|
|
365
|
+
}[];
|
|
366
|
+
mcpServerUrl?: string | undefined;
|
|
367
|
+
} | undefined;
|
|
368
|
+
}, {
|
|
369
|
+
session_id: string;
|
|
370
|
+
proofs: {
|
|
371
|
+
jws: string;
|
|
372
|
+
meta: {
|
|
373
|
+
did: string;
|
|
374
|
+
kid: string;
|
|
375
|
+
ts: number;
|
|
376
|
+
nonce: string;
|
|
377
|
+
audience: string;
|
|
378
|
+
sessionId: string;
|
|
379
|
+
requestHash: string;
|
|
380
|
+
responseHash: string;
|
|
381
|
+
scopeId?: string | undefined;
|
|
382
|
+
delegationRef?: string | undefined;
|
|
383
|
+
};
|
|
384
|
+
}[];
|
|
385
|
+
delegation_id?: string | null | undefined;
|
|
386
|
+
context?: {
|
|
387
|
+
toolCalls: {
|
|
388
|
+
scopeId: string;
|
|
389
|
+
tool: string;
|
|
390
|
+
args: Record<string, unknown>;
|
|
391
|
+
result?: unknown;
|
|
392
|
+
userId?: string | undefined;
|
|
393
|
+
}[];
|
|
394
|
+
mcpServerUrl?: string | undefined;
|
|
395
|
+
} | undefined;
|
|
396
|
+
}>;
|
|
397
|
+
export type ToolCallContext = z.infer<typeof ToolCallContextSchema>;
|
|
398
|
+
export type ProofSubmissionContext = z.infer<typeof ProofSubmissionContextSchema>;
|
|
399
|
+
export type ProofSubmissionRequest = z.infer<typeof ProofSubmissionRequestSchema>;
|
|
162
400
|
//# sourceMappingURL=proof.d.ts.map
|
package/dist/proof.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AUDIT_VERSION = exports.HASH_ALGORITHM = exports.JWS_ALGORITHM = exports.AuditRecordSchema = exports.CanonicalHashesSchema = exports.DetachedProofSchema = exports.ProofMetaSchema = void 0;
|
|
3
|
+
exports.ProofSubmissionRequestSchema = exports.ProofSubmissionContextSchema = exports.ToolCallContextSchema = 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
|
|
@@ -48,4 +48,35 @@ exports.AuditRecordSchema = zod_1.z.object({
|
|
|
48
48
|
exports.JWS_ALGORITHM = "EdDSA";
|
|
49
49
|
exports.HASH_ALGORITHM = "sha256";
|
|
50
50
|
exports.AUDIT_VERSION = "audit.v1";
|
|
51
|
+
/**
|
|
52
|
+
* Tool call context for AgentShield dashboard integration
|
|
53
|
+
* Provides plaintext tool execution data alongside cryptographic proofs
|
|
54
|
+
*/
|
|
55
|
+
exports.ToolCallContextSchema = zod_1.z.object({
|
|
56
|
+
tool: zod_1.z.string().min(1),
|
|
57
|
+
args: zod_1.z.record(zod_1.z.unknown()),
|
|
58
|
+
result: zod_1.z.unknown().optional(),
|
|
59
|
+
scopeId: zod_1.z.string(),
|
|
60
|
+
userId: zod_1.z.string().optional(),
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* Proof submission context for AgentShield API
|
|
64
|
+
* Includes tool calls and optional MCP server URL for tool discovery
|
|
65
|
+
*/
|
|
66
|
+
exports.ProofSubmissionContextSchema = zod_1.z.object({
|
|
67
|
+
toolCalls: zod_1.z.array(exports.ToolCallContextSchema),
|
|
68
|
+
mcpServerUrl: zod_1.z.string().url().optional(),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Complete proof submission request to AgentShield
|
|
72
|
+
*/
|
|
73
|
+
exports.ProofSubmissionRequestSchema = zod_1.z.object({
|
|
74
|
+
session_id: zod_1.z.string().min(1),
|
|
75
|
+
delegation_id: zod_1.z.string().nullable().optional(),
|
|
76
|
+
proofs: zod_1.z.array(zod_1.z.object({
|
|
77
|
+
jws: zod_1.z.string().min(1),
|
|
78
|
+
meta: exports.ProofMetaSchema,
|
|
79
|
+
})),
|
|
80
|
+
context: exports.ProofSubmissionContextSchema.optional(),
|
|
81
|
+
});
|
|
51
82
|
//# sourceMappingURL=proof.js.map
|
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);
|