@aikdna/kdna-core 0.17.0 → 0.19.0

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 (38) hide show
  1. package/CHANGELOG.md +227 -64
  2. package/README.md +114 -77
  3. package/package.json +8 -2
  4. package/schema/agent-host-capabilities.schema.json +62 -0
  5. package/schema/agent-host-receipt.schema.json +371 -0
  6. package/schema/agent-host-request.schema.json +223 -0
  7. package/schema/{bundle-profile-v1.schema.json → bundle-profile.schema.json} +9 -5
  8. package/schema/checksums.schema.json +42 -3
  9. package/schema/consumption-plan.schema.json +428 -0
  10. package/schema/digest-evidence.schema.json +212 -0
  11. package/schema/{kdna-envelope-external-grant-v1.schema.json → external-grant-envelope.schema.json} +17 -4
  12. package/schema/{kdna-key-grant-v1.schema.json → external-key-grant.schema.json} +39 -7
  13. package/schema/judgment-trace.schema.json +1251 -0
  14. package/schema/load-plan.schema.json +7 -5
  15. package/schema/manifest.schema.json +70 -10
  16. package/schema/{payload-profile-v1.schema.json → payload-profile.schema.json} +30 -6
  17. package/schema/runtime-capsule.schema.json +116 -0
  18. package/src/asset-reader.js +106 -120
  19. package/src/{v1 → container}/index.js +566 -209
  20. package/src/container/index.mjs +20 -0
  21. package/src/container-dispatcher.js +10 -7
  22. package/src/crypto-profile.js +37 -107
  23. package/src/external-key-grant.js +41 -15
  24. package/src/index.js +11 -4
  25. package/src/index.mjs +143 -24
  26. package/src/loader-compatibility.js +59 -0
  27. package/src/loader.js +1 -1
  28. package/src/public-api.js +59 -163
  29. package/src/remote-runtime.d.ts +13 -0
  30. package/src/remote-runtime.js +27 -0
  31. package/src/remote-runtime.mjs +3 -0
  32. package/src/runtime-api.js +9 -10
  33. package/src/runtime-capsule.js +529 -0
  34. package/src/runtime-contract.js +1882 -0
  35. package/src/types.d.ts +1127 -136
  36. package/src/workpack-pure.js +1 -1
  37. package/src/lint-pure.js +0 -430
  38. package/src/v1/index.mjs +0 -20
@@ -1,12 +1,33 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://kdna.ai/specs/kdna-key-grant-v1.schema.json",
4
- "title": "KDNA account/device external key grant v1",
3
+ "$id": "https://kdna.ai/specs/external-key-grant.schema.json",
4
+ "title": "KDNA Account/Device External Key Grant",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["profile", "grant_id", "issuer", "signing_key_id", "entitlement_id", "account_id", "device_id", "device_public_key", "device_signing_public_key", "asset", "issued_at", "refresh_after", "offline_grace_until", "expires_at", "status", "status_version", "wrap", "signature"],
7
+ "required": [
8
+ "profile",
9
+ "contract_version",
10
+ "grant_id",
11
+ "issuer",
12
+ "signing_key_id",
13
+ "entitlement_id",
14
+ "account_id",
15
+ "device_id",
16
+ "device_public_key",
17
+ "device_signing_public_key",
18
+ "asset",
19
+ "issued_at",
20
+ "refresh_after",
21
+ "offline_grace_until",
22
+ "expires_at",
23
+ "status",
24
+ "status_version",
25
+ "wrap",
26
+ "signature"
27
+ ],
8
28
  "properties": {
9
- "profile": { "const": "kdna-key-grant-v1" },
29
+ "profile": { "const": "kdna.grant.external-key" },
30
+ "contract_version": { "const": "0.1.0" },
10
31
  "grant_id": { "$ref": "#/$defs/id" },
11
32
  "issuer": { "type": "string", "format": "uri", "maxLength": 256 },
12
33
  "signing_key_id": { "$ref": "#/$defs/id" },
@@ -16,8 +37,18 @@
16
37
  "device_public_key": { "type": "string", "pattern": "^x25519:[A-Za-z0-9_-]{43}$" },
17
38
  "device_signing_public_key": { "type": "string", "pattern": "^ed25519:[A-Za-z0-9_-]{43}$" },
18
39
  "asset": {
19
- "type": "object", "additionalProperties": false,
20
- "required": ["asset_id", "asset_uid", "version", "digest", "entry_path", "ciphertext_digest", "key_ref", "issuer_key_id"],
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": [
43
+ "asset_id",
44
+ "asset_uid",
45
+ "version",
46
+ "digest",
47
+ "entry_path",
48
+ "ciphertext_digest",
49
+ "key_ref",
50
+ "issuer_key_id"
51
+ ],
21
52
  "properties": {
22
53
  "asset_id": { "type": "string", "minLength": 1, "maxLength": 256 },
23
54
  "asset_uid": { "type": "string", "minLength": 1, "maxLength": 512 },
@@ -36,7 +67,8 @@
36
67
  "status": { "enum": ["active", "revoked", "expired"] },
37
68
  "status_version": { "type": "integer", "minimum": 1 },
38
69
  "wrap": {
39
- "type": "object", "additionalProperties": false,
70
+ "type": "object",
71
+ "additionalProperties": false,
40
72
  "required": ["alg", "ephemeral_public_key", "salt", "wrapped_cek"],
41
73
  "properties": {
42
74
  "alg": { "const": "X25519-HKDF-SHA256+A256KW" },