@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.
Files changed (58) hide show
  1. package/package.json +28 -5
  2. package/README.md +0 -130
  3. package/dist/cli.d.ts +0 -378
  4. package/dist/cli.js +0 -116
  5. package/dist/delegation/constraints.d.ts +0 -992
  6. package/dist/delegation/constraints.js +0 -210
  7. package/dist/delegation/index.d.ts +0 -8
  8. package/dist/delegation/index.js +0 -24
  9. package/dist/delegation/schemas.d.ts +0 -8382
  10. package/dist/delegation/schemas.js +0 -476
  11. package/dist/did/index.d.ts +0 -9
  12. package/dist/did/index.js +0 -25
  13. package/dist/did/resolve-contract.d.ts +0 -220
  14. package/dist/did/resolve-contract.js +0 -32
  15. package/dist/did/schemas.d.ts +0 -113
  16. package/dist/did/schemas.js +0 -173
  17. package/dist/did/types.d.ts +0 -164
  18. package/dist/did/types.js +0 -71
  19. package/dist/env/constants.d.ts +0 -58
  20. package/dist/env/constants.js +0 -60
  21. package/dist/env/index.d.ts +0 -5
  22. package/dist/env/index.js +0 -21
  23. package/dist/handshake.d.ts +0 -159
  24. package/dist/handshake.js +0 -58
  25. package/dist/index.d.ts +0 -26
  26. package/dist/index.js +0 -53
  27. package/dist/proof/index.d.ts +0 -9
  28. package/dist/proof/index.js +0 -25
  29. package/dist/proof/proof-record.d.ts +0 -838
  30. package/dist/proof/proof-record.js +0 -134
  31. package/dist/proof/signing-spec.d.ts +0 -147
  32. package/dist/proof/signing-spec.js +0 -123
  33. package/dist/proof.d.ts +0 -400
  34. package/dist/proof.js +0 -82
  35. package/dist/registry.d.ts +0 -343
  36. package/dist/registry.js +0 -119
  37. package/dist/runtime/errors.d.ts +0 -348
  38. package/dist/runtime/errors.js +0 -120
  39. package/dist/runtime/headers.d.ts +0 -84
  40. package/dist/runtime/headers.js +0 -82
  41. package/dist/runtime/index.d.ts +0 -6
  42. package/dist/runtime/index.js +0 -22
  43. package/dist/test.d.ts +0 -252
  44. package/dist/test.js +0 -120
  45. package/dist/tlkrc/index.d.ts +0 -5
  46. package/dist/tlkrc/index.js +0 -21
  47. package/dist/tlkrc/rotation.d.ts +0 -246
  48. package/dist/tlkrc/rotation.js +0 -127
  49. package/dist/utils/validation.d.ts +0 -31
  50. package/dist/utils/validation.js +0 -70
  51. package/dist/vc/index.d.ts +0 -8
  52. package/dist/vc/index.js +0 -24
  53. package/dist/vc/schemas.d.ts +0 -2484
  54. package/dist/vc/schemas.js +0 -225
  55. package/dist/vc/statuslist.d.ts +0 -494
  56. package/dist/vc/statuslist.js +0 -133
  57. package/dist/verifier.d.ts +0 -206
  58. package/dist/verifier.js +0 -84
package/dist/proof.d.ts DELETED
@@ -1,400 +0,0 @@
1
- import { z } from "zod";
2
- /**
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.).
11
- */
12
- export declare const ProofMetaSchema: z.ZodObject<{
13
- did: z.ZodString;
14
- kid: z.ZodString;
15
- ts: z.ZodNumber;
16
- nonce: z.ZodString;
17
- audience: z.ZodString;
18
- sessionId: z.ZodString;
19
- requestHash: z.ZodString;
20
- responseHash: z.ZodString;
21
- scopeId: z.ZodOptional<z.ZodString>;
22
- delegationRef: z.ZodOptional<z.ZodString>;
23
- }, "strip", z.ZodTypeAny, {
24
- did: string;
25
- kid: string;
26
- ts: number;
27
- nonce: string;
28
- audience: string;
29
- sessionId: string;
30
- requestHash: string;
31
- responseHash: string;
32
- scopeId?: string | undefined;
33
- delegationRef?: string | undefined;
34
- }, {
35
- did: string;
36
- kid: string;
37
- ts: number;
38
- nonce: string;
39
- audience: string;
40
- sessionId: string;
41
- requestHash: string;
42
- responseHash: string;
43
- scopeId?: string | undefined;
44
- delegationRef?: string | undefined;
45
- }>;
46
- export declare const DetachedProofSchema: z.ZodObject<{
47
- jws: z.ZodString;
48
- meta: z.ZodObject<{
49
- did: z.ZodString;
50
- kid: z.ZodString;
51
- ts: z.ZodNumber;
52
- nonce: z.ZodString;
53
- audience: z.ZodString;
54
- sessionId: z.ZodString;
55
- requestHash: z.ZodString;
56
- responseHash: z.ZodString;
57
- scopeId: z.ZodOptional<z.ZodString>;
58
- delegationRef: z.ZodOptional<z.ZodString>;
59
- }, "strip", z.ZodTypeAny, {
60
- did: string;
61
- kid: string;
62
- ts: number;
63
- nonce: string;
64
- audience: string;
65
- sessionId: string;
66
- requestHash: string;
67
- responseHash: string;
68
- scopeId?: string | undefined;
69
- delegationRef?: string | undefined;
70
- }, {
71
- did: string;
72
- kid: string;
73
- ts: number;
74
- nonce: string;
75
- audience: string;
76
- sessionId: string;
77
- requestHash: string;
78
- responseHash: string;
79
- scopeId?: string | undefined;
80
- delegationRef?: string | undefined;
81
- }>;
82
- }, "strip", z.ZodTypeAny, {
83
- jws: string;
84
- meta: {
85
- did: string;
86
- kid: string;
87
- ts: number;
88
- nonce: string;
89
- audience: string;
90
- sessionId: string;
91
- requestHash: string;
92
- responseHash: string;
93
- scopeId?: string | undefined;
94
- delegationRef?: string | undefined;
95
- };
96
- }, {
97
- jws: string;
98
- meta: {
99
- did: string;
100
- kid: string;
101
- ts: number;
102
- nonce: string;
103
- audience: string;
104
- sessionId: string;
105
- requestHash: string;
106
- responseHash: string;
107
- scopeId?: string | undefined;
108
- delegationRef?: string | undefined;
109
- };
110
- }>;
111
- export declare const CanonicalHashesSchema: z.ZodObject<{
112
- requestHash: z.ZodString;
113
- responseHash: z.ZodString;
114
- }, "strip", z.ZodTypeAny, {
115
- requestHash: string;
116
- responseHash: string;
117
- }, {
118
- requestHash: string;
119
- responseHash: string;
120
- }>;
121
- export declare const AuditRecordSchema: z.ZodObject<{
122
- version: z.ZodLiteral<"audit.v1">;
123
- ts: z.ZodNumber;
124
- session: z.ZodString;
125
- audience: z.ZodString;
126
- did: z.ZodString;
127
- kid: z.ZodString;
128
- reqHash: z.ZodString;
129
- resHash: z.ZodString;
130
- verified: z.ZodEnum<["yes", "no"]>;
131
- scope: z.ZodString;
132
- }, "strip", z.ZodTypeAny, {
133
- did: string;
134
- kid: string;
135
- ts: number;
136
- audience: string;
137
- version: "audit.v1";
138
- session: string;
139
- reqHash: string;
140
- resHash: string;
141
- verified: "yes" | "no";
142
- scope: string;
143
- }, {
144
- did: string;
145
- kid: string;
146
- ts: number;
147
- audience: string;
148
- version: "audit.v1";
149
- session: string;
150
- reqHash: string;
151
- resHash: string;
152
- verified: "yes" | "no";
153
- scope: string;
154
- }>;
155
- export type ProofMeta = z.infer<typeof ProofMetaSchema>;
156
- export type DetachedProof = z.infer<typeof DetachedProofSchema>;
157
- export type CanonicalHashes = z.infer<typeof CanonicalHashesSchema>;
158
- export type AuditRecord = z.infer<typeof AuditRecordSchema>;
159
- export declare const JWS_ALGORITHM = "EdDSA";
160
- export declare const HASH_ALGORITHM = "sha256";
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>;
400
- //# sourceMappingURL=proof.d.ts.map
package/dist/proof.js DELETED
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- const zod_1 = require("zod");
5
- /**
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.).
14
- */
15
- exports.ProofMetaSchema = zod_1.z.object({
16
- did: zod_1.z.string().min(1),
17
- kid: zod_1.z.string().min(1),
18
- ts: zod_1.z.number().int().positive(),
19
- nonce: zod_1.z.string().min(1),
20
- audience: zod_1.z.string().min(1),
21
- sessionId: zod_1.z.string().min(1),
22
- requestHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
23
- responseHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
24
- scopeId: zod_1.z.string().optional(),
25
- delegationRef: zod_1.z.string().optional(),
26
- });
27
- exports.DetachedProofSchema = zod_1.z.object({
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)
30
- });
31
- exports.CanonicalHashesSchema = zod_1.z.object({
32
- requestHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
33
- responseHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
34
- });
35
- exports.AuditRecordSchema = zod_1.z.object({
36
- version: zod_1.z.literal("audit.v1"),
37
- ts: zod_1.z.number().int().positive(),
38
- session: zod_1.z.string().min(1),
39
- audience: zod_1.z.string().min(1),
40
- did: zod_1.z.string().min(1),
41
- kid: zod_1.z.string().min(1),
42
- reqHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
43
- resHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
44
- verified: zod_1.z.enum(["yes", "no"]),
45
- scope: zod_1.z.string().min(1), // "-" for no scope
46
- });
47
- // Constants
48
- exports.JWS_ALGORITHM = "EdDSA";
49
- exports.HASH_ALGORITHM = "sha256";
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
- });
82
- //# sourceMappingURL=proof.js.map