@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.
Files changed (55) hide show
  1. package/dist/cli.d.ts +48 -10
  2. package/dist/cli.js +18 -6
  3. package/dist/delegation/schemas.d.ts +4330 -29
  4. package/dist/delegation/schemas.js +248 -2
  5. package/dist/did/index.d.ts +1 -0
  6. package/dist/did/index.js +1 -0
  7. package/dist/did/schemas.d.ts +113 -0
  8. package/dist/did/schemas.js +173 -0
  9. package/dist/did/types.d.ts +1 -1
  10. package/dist/handshake.d.ts +2 -2
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.js +3 -0
  13. package/dist/proof.d.ts +238 -0
  14. package/dist/proof.js +32 -1
  15. package/dist/registry.d.ts +15 -15
  16. package/dist/registry.js +3 -2
  17. package/dist/test.d.ts +19 -19
  18. package/dist/test.js +5 -5
  19. package/dist/utils/validation.d.ts +1 -1
  20. package/dist/utils/validation.js +1 -1
  21. package/dist/verifier.d.ts +31 -17
  22. package/dist/verifier.js +18 -2
  23. package/package.json +3 -5
  24. package/dist/cli.d.ts.map +0 -1
  25. package/dist/delegation/constraints.d.ts.map +0 -1
  26. package/dist/delegation/index.d.ts.map +0 -1
  27. package/dist/delegation/schemas.d.ts.map +0 -1
  28. package/dist/did/index.d.ts.map +0 -1
  29. package/dist/did/resolve-contract.d.ts.map +0 -1
  30. package/dist/did/types.d.ts.map +0 -1
  31. package/dist/env/constants.d.ts.map +0 -1
  32. package/dist/env/index.d.ts.map +0 -1
  33. package/dist/handshake.d.ts.map +0 -1
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/proof/index.d.ts.map +0 -1
  36. package/dist/proof/proof-record.d.ts.map +0 -1
  37. package/dist/proof/signing-spec.d.ts.map +0 -1
  38. package/dist/proof.d.ts.map +0 -1
  39. package/dist/registry.d.ts.map +0 -1
  40. package/dist/runtime/errors.d.ts.map +0 -1
  41. package/dist/runtime/headers.d.ts.map +0 -1
  42. package/dist/runtime/index.d.ts.map +0 -1
  43. package/dist/test.d.ts.map +0 -1
  44. package/dist/tlkrc/index.d.ts.map +0 -1
  45. package/dist/tlkrc/rotation.d.ts.map +0 -1
  46. package/dist/utils/validation.d.ts.map +0 -1
  47. package/dist/vc/index.d.ts.map +0 -1
  48. package/dist/vc/schemas.d.ts.map +0 -1
  49. package/dist/vc/statuslist.d.ts.map +0 -1
  50. package/dist/verifier.d.ts.map +0 -1
  51. package/schemas/cli/register-output/v1.0.0.json +0 -69
  52. package/schemas/proof/v1.0.0.json +0 -80
  53. package/schemas/registry/receipt-v1.0.0.json +0 -60
  54. package/schemas/verifier/verify-page/v1.0.0.json +0 -94
  55. package/schemas/well-known/agent/v1.0.0.json +0 -49
package/dist/cli.d.ts CHANGED
@@ -2,30 +2,68 @@ import { z } from "zod";
2
2
  /**
3
3
  * CLI command schemas and results
4
4
  */
5
- export declare const IdentityConfigSchema: z.ZodObject<{
5
+ export declare const IdentityConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
6
6
  version: z.ZodLiteral<"1.0">;
7
7
  did: z.ZodString;
8
- keyId: z.ZodString;
8
+ kid: z.ZodOptional<z.ZodString>;
9
+ keyId: z.ZodOptional<z.ZodString>;
9
10
  privateKey: z.ZodString;
10
11
  publicKey: z.ZodString;
11
12
  createdAt: z.ZodString;
12
- lastRotated: z.ZodString;
13
+ lastRotated: z.ZodOptional<z.ZodString>;
13
14
  }, "strip", z.ZodTypeAny, {
14
15
  version: "1.0";
15
16
  did: string;
16
- keyId: string;
17
17
  privateKey: string;
18
18
  publicKey: string;
19
19
  createdAt: string;
20
- lastRotated: string;
20
+ kid?: string | undefined;
21
+ keyId?: string | undefined;
22
+ lastRotated?: string | undefined;
21
23
  }, {
22
24
  version: "1.0";
23
25
  did: string;
24
- keyId: string;
25
26
  privateKey: string;
26
27
  publicKey: string;
27
28
  createdAt: string;
28
- lastRotated: string;
29
+ kid?: string | undefined;
30
+ keyId?: string | undefined;
31
+ lastRotated?: string | undefined;
32
+ }>, {
33
+ version: "1.0";
34
+ did: string;
35
+ privateKey: string;
36
+ publicKey: string;
37
+ createdAt: string;
38
+ kid?: string | undefined;
39
+ keyId?: string | undefined;
40
+ lastRotated?: string | undefined;
41
+ }, {
42
+ version: "1.0";
43
+ did: string;
44
+ privateKey: string;
45
+ publicKey: string;
46
+ createdAt: string;
47
+ kid?: string | undefined;
48
+ keyId?: string | undefined;
49
+ lastRotated?: string | undefined;
50
+ }>, {
51
+ version: "1.0";
52
+ did: string;
53
+ kid: string;
54
+ privateKey: string;
55
+ publicKey: string;
56
+ createdAt: string;
57
+ lastRotated: string | undefined;
58
+ }, {
59
+ version: "1.0";
60
+ did: string;
61
+ privateKey: string;
62
+ publicKey: string;
63
+ createdAt: string;
64
+ kid?: string | undefined;
65
+ keyId?: string | undefined;
66
+ lastRotated?: string | undefined;
29
67
  }>;
30
68
  export declare const KeyRotationResultSchema: z.ZodObject<{
31
69
  success: z.ZodBoolean;
@@ -57,21 +95,21 @@ export declare const KeyRotationResultSchema: z.ZodObject<{
57
95
  }>;
58
96
  export declare const StatusReportSchema: z.ZodObject<{
59
97
  did: z.ZodString;
60
- keyId: z.ZodString;
98
+ kid: z.ZodString;
61
99
  ktaURL: z.ZodString;
62
100
  mirrorStatus: z.ZodEnum<["pending", "success", "error"]>;
63
101
  lastHandshake: z.ZodOptional<z.ZodNumber>;
64
102
  environment: z.ZodEnum<["dev", "prod"]>;
65
103
  }, "strip", z.ZodTypeAny, {
66
104
  did: string;
67
- keyId: string;
105
+ kid: string;
68
106
  ktaURL: string;
69
107
  mirrorStatus: "success" | "pending" | "error";
70
108
  environment: "dev" | "prod";
71
109
  lastHandshake?: number | undefined;
72
110
  }, {
73
111
  did: string;
74
- keyId: string;
112
+ kid: string;
75
113
  ktaURL: string;
76
114
  mirrorStatus: "success" | "pending" | "error";
77
115
  environment: "dev" | "prod";
package/dist/cli.js CHANGED
@@ -8,12 +8,24 @@ const zod_1 = require("zod");
8
8
  exports.IdentityConfigSchema = zod_1.z.object({
9
9
  version: zod_1.z.literal("1.0"),
10
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
11
+ // Accept both kid and keyId for backward compatibility with pre-1.3 identity files
12
+ kid: zod_1.z.string().min(1).optional(),
13
+ keyId: zod_1.z.string().min(1).optional(),
14
+ privateKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 private key (44 characters)"),
15
+ publicKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 public key (44 characters)"),
14
16
  createdAt: zod_1.z.string().datetime(),
15
- lastRotated: zod_1.z.string().datetime(),
16
- });
17
+ lastRotated: zod_1.z.string().datetime().optional(),
18
+ }).refine((data) => data.kid || data.keyId, {
19
+ message: "Either kid or keyId must be provided",
20
+ }).transform((data) => ({
21
+ version: data.version,
22
+ did: data.did,
23
+ kid: data.kid || data.keyId,
24
+ privateKey: data.privateKey,
25
+ publicKey: data.publicKey,
26
+ createdAt: data.createdAt,
27
+ lastRotated: data.lastRotated,
28
+ }));
17
29
  exports.KeyRotationResultSchema = zod_1.z.object({
18
30
  success: zod_1.z.boolean(),
19
31
  oldKeyId: zod_1.z.string().min(1),
@@ -26,7 +38,7 @@ exports.KeyRotationResultSchema = zod_1.z.object({
26
38
  });
27
39
  exports.StatusReportSchema = zod_1.z.object({
28
40
  did: zod_1.z.string().min(1),
29
- keyId: zod_1.z.string().min(1),
41
+ kid: zod_1.z.string().min(1), // Changed from keyId to kid for spec compliance
30
42
  ktaURL: zod_1.z.string().url(),
31
43
  mirrorStatus: zod_1.z.enum(["pending", "success", "error"]),
32
44
  lastHandshake: zod_1.z.number().int().positive().optional(),