@kya-os/contracts 1.3.1-canary.1 → 1.3.1-canary.3
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 +41 -3
- package/dist/cli.js +15 -3
- package/dist/delegation/constraints.d.ts +992 -0
- package/dist/delegation/constraints.js +210 -0
- package/dist/delegation/index.d.ts +8 -0
- package/dist/delegation/index.js +24 -0
- package/dist/delegation/schemas.d.ts +8382 -0
- package/dist/delegation/schemas.js +476 -0
- package/dist/did/index.d.ts +9 -0
- package/dist/did/index.js +25 -0
- package/dist/did/resolve-contract.d.ts +220 -0
- package/dist/did/resolve-contract.js +32 -0
- package/dist/did/schemas.d.ts +113 -0
- package/dist/did/schemas.js +173 -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/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.d.ts +254 -16
- package/dist/proof.js +32 -1
- 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/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/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 +8 -8
- package/package.json +1 -1
package/dist/proof.d.ts
CHANGED
|
@@ -22,22 +22,22 @@ export declare const ProofMetaSchema: z.ZodObject<{
|
|
|
22
22
|
delegationRef: z.ZodOptional<z.ZodString>;
|
|
23
23
|
}, "strip", z.ZodTypeAny, {
|
|
24
24
|
did: string;
|
|
25
|
+
kid: string;
|
|
26
|
+
ts: number;
|
|
25
27
|
nonce: string;
|
|
26
28
|
audience: string;
|
|
27
29
|
sessionId: string;
|
|
28
|
-
kid: string;
|
|
29
|
-
ts: number;
|
|
30
30
|
requestHash: string;
|
|
31
31
|
responseHash: string;
|
|
32
32
|
scopeId?: string | undefined;
|
|
33
33
|
delegationRef?: string | undefined;
|
|
34
34
|
}, {
|
|
35
35
|
did: string;
|
|
36
|
+
kid: string;
|
|
37
|
+
ts: number;
|
|
36
38
|
nonce: string;
|
|
37
39
|
audience: string;
|
|
38
40
|
sessionId: string;
|
|
39
|
-
kid: string;
|
|
40
|
-
ts: number;
|
|
41
41
|
requestHash: string;
|
|
42
42
|
responseHash: string;
|
|
43
43
|
scopeId?: string | undefined;
|
|
@@ -58,22 +58,22 @@ export declare const DetachedProofSchema: z.ZodObject<{
|
|
|
58
58
|
delegationRef: z.ZodOptional<z.ZodString>;
|
|
59
59
|
}, "strip", z.ZodTypeAny, {
|
|
60
60
|
did: string;
|
|
61
|
+
kid: string;
|
|
62
|
+
ts: number;
|
|
61
63
|
nonce: string;
|
|
62
64
|
audience: string;
|
|
63
65
|
sessionId: string;
|
|
64
|
-
kid: string;
|
|
65
|
-
ts: number;
|
|
66
66
|
requestHash: string;
|
|
67
67
|
responseHash: string;
|
|
68
68
|
scopeId?: string | undefined;
|
|
69
69
|
delegationRef?: string | undefined;
|
|
70
70
|
}, {
|
|
71
71
|
did: string;
|
|
72
|
+
kid: string;
|
|
73
|
+
ts: number;
|
|
72
74
|
nonce: string;
|
|
73
75
|
audience: string;
|
|
74
76
|
sessionId: string;
|
|
75
|
-
kid: string;
|
|
76
|
-
ts: number;
|
|
77
77
|
requestHash: string;
|
|
78
78
|
responseHash: string;
|
|
79
79
|
scopeId?: string | undefined;
|
|
@@ -83,11 +83,11 @@ export declare const DetachedProofSchema: z.ZodObject<{
|
|
|
83
83
|
jws: string;
|
|
84
84
|
meta: {
|
|
85
85
|
did: string;
|
|
86
|
+
kid: string;
|
|
87
|
+
ts: number;
|
|
86
88
|
nonce: string;
|
|
87
89
|
audience: string;
|
|
88
90
|
sessionId: string;
|
|
89
|
-
kid: string;
|
|
90
|
-
ts: number;
|
|
91
91
|
requestHash: string;
|
|
92
92
|
responseHash: string;
|
|
93
93
|
scopeId?: string | undefined;
|
|
@@ -97,11 +97,11 @@ export declare const DetachedProofSchema: z.ZodObject<{
|
|
|
97
97
|
jws: string;
|
|
98
98
|
meta: {
|
|
99
99
|
did: string;
|
|
100
|
+
kid: string;
|
|
101
|
+
ts: number;
|
|
100
102
|
nonce: string;
|
|
101
103
|
audience: string;
|
|
102
104
|
sessionId: string;
|
|
103
|
-
kid: string;
|
|
104
|
-
ts: number;
|
|
105
105
|
requestHash: string;
|
|
106
106
|
responseHash: string;
|
|
107
107
|
scopeId?: string | undefined;
|
|
@@ -130,22 +130,22 @@ export declare const AuditRecordSchema: z.ZodObject<{
|
|
|
130
130
|
verified: z.ZodEnum<["yes", "no"]>;
|
|
131
131
|
scope: z.ZodString;
|
|
132
132
|
}, "strip", z.ZodTypeAny, {
|
|
133
|
-
version: "audit.v1";
|
|
134
133
|
did: string;
|
|
135
|
-
audience: string;
|
|
136
134
|
kid: string;
|
|
137
135
|
ts: number;
|
|
136
|
+
audience: string;
|
|
137
|
+
version: "audit.v1";
|
|
138
138
|
session: string;
|
|
139
139
|
reqHash: string;
|
|
140
140
|
resHash: string;
|
|
141
141
|
verified: "yes" | "no";
|
|
142
142
|
scope: string;
|
|
143
143
|
}, {
|
|
144
|
-
version: "audit.v1";
|
|
145
144
|
did: string;
|
|
146
|
-
audience: string;
|
|
147
145
|
kid: string;
|
|
148
146
|
ts: number;
|
|
147
|
+
audience: string;
|
|
148
|
+
version: "audit.v1";
|
|
149
149
|
session: string;
|
|
150
150
|
reqHash: string;
|
|
151
151
|
resHash: string;
|
|
@@ -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
|