@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.
Files changed (46) hide show
  1. package/dist/cli.d.ts +41 -3
  2. package/dist/cli.js +15 -3
  3. package/dist/delegation/constraints.d.ts +992 -0
  4. package/dist/delegation/constraints.js +210 -0
  5. package/dist/delegation/index.d.ts +8 -0
  6. package/dist/delegation/index.js +24 -0
  7. package/dist/delegation/schemas.d.ts +8382 -0
  8. package/dist/delegation/schemas.js +476 -0
  9. package/dist/did/index.d.ts +9 -0
  10. package/dist/did/index.js +25 -0
  11. package/dist/did/resolve-contract.d.ts +220 -0
  12. package/dist/did/resolve-contract.js +32 -0
  13. package/dist/did/schemas.d.ts +113 -0
  14. package/dist/did/schemas.js +173 -0
  15. package/dist/did/types.d.ts +164 -0
  16. package/dist/did/types.js +71 -0
  17. package/dist/env/constants.d.ts +58 -0
  18. package/dist/env/constants.js +60 -0
  19. package/dist/env/index.d.ts +5 -0
  20. package/dist/env/index.js +21 -0
  21. package/dist/proof/index.d.ts +9 -0
  22. package/dist/proof/index.js +25 -0
  23. package/dist/proof/proof-record.d.ts +838 -0
  24. package/dist/proof/proof-record.js +134 -0
  25. package/dist/proof/signing-spec.d.ts +147 -0
  26. package/dist/proof/signing-spec.js +123 -0
  27. package/dist/proof.d.ts +254 -16
  28. package/dist/proof.js +32 -1
  29. package/dist/runtime/errors.d.ts +348 -0
  30. package/dist/runtime/errors.js +120 -0
  31. package/dist/runtime/headers.d.ts +84 -0
  32. package/dist/runtime/headers.js +82 -0
  33. package/dist/runtime/index.d.ts +6 -0
  34. package/dist/runtime/index.js +22 -0
  35. package/dist/tlkrc/index.d.ts +5 -0
  36. package/dist/tlkrc/index.js +21 -0
  37. package/dist/tlkrc/rotation.d.ts +246 -0
  38. package/dist/tlkrc/rotation.js +127 -0
  39. package/dist/vc/index.d.ts +8 -0
  40. package/dist/vc/index.js +24 -0
  41. package/dist/vc/schemas.d.ts +2484 -0
  42. package/dist/vc/schemas.js +225 -0
  43. package/dist/vc/statuslist.d.ts +494 -0
  44. package/dist/vc/statuslist.js +133 -0
  45. package/dist/verifier.d.ts +8 -8
  46. package/package.json +1 -1
package/dist/cli.d.ts CHANGED
@@ -2,10 +2,11 @@ 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
- kid: 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;
@@ -13,18 +14,55 @@ export declare const IdentityConfigSchema: z.ZodObject<{
13
14
  }, "strip", z.ZodTypeAny, {
14
15
  version: "1.0";
15
16
  did: string;
16
- kid: string;
17
17
  privateKey: string;
18
18
  publicKey: string;
19
19
  createdAt: string;
20
+ kid?: string | undefined;
21
+ keyId?: string | undefined;
20
22
  lastRotated?: string | undefined;
21
23
  }, {
24
+ version: "1.0";
25
+ did: string;
26
+ privateKey: string;
27
+ publicKey: string;
28
+ createdAt: 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
+ }>, {
22
51
  version: "1.0";
23
52
  did: string;
24
53
  kid: string;
25
54
  privateKey: string;
26
55
  publicKey: string;
27
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;
28
66
  lastRotated?: string | undefined;
29
67
  }>;
30
68
  export declare const KeyRotationResultSchema: z.ZodObject<{
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
- kid: zod_1.z.string().min(1), // Changed from kid to kid for spec compliance
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(),
12
14
  privateKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 private key (44 characters)"),
13
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
17
  lastRotated: zod_1.z.string().datetime().optional(),
16
- });
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
- kid: zod_1.z.string().min(1), // Changed from kid to kid for spec compliance
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(),