@kya-os/contracts 1.3.2 → 1.3.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 (82) hide show
  1. package/README.md +1 -1
  2. package/dist/agentshield-api/endpoints.d.ts +21 -0
  3. package/dist/agentshield-api/endpoints.js +20 -0
  4. package/dist/agentshield-api/index.d.ts +5 -0
  5. package/dist/agentshield-api/index.js +27 -0
  6. package/dist/agentshield-api/schemas.d.ts +9846 -0
  7. package/dist/agentshield-api/schemas.js +92 -0
  8. package/dist/agentshield-api/types.d.ts +92 -0
  9. package/dist/agentshield-api/types.js +12 -0
  10. package/dist/cli.d.ts +3 -6
  11. package/dist/cli.js +3 -10
  12. package/dist/config/base.d.ts +19 -0
  13. package/dist/config/base.js +2 -0
  14. package/dist/config/delegation.d.ts +46 -0
  15. package/dist/config/delegation.js +2 -0
  16. package/dist/config/identity.d.ts +22 -0
  17. package/dist/config/identity.js +2 -0
  18. package/dist/config/index.d.ts +17 -0
  19. package/dist/config/index.js +2 -0
  20. package/dist/config/proofing.d.ts +26 -0
  21. package/dist/config/proofing.js +2 -0
  22. package/dist/config/tool-protection.d.ts +36 -0
  23. package/dist/config/tool-protection.js +2 -0
  24. package/dist/delegation/constraints.d.ts +0 -266
  25. package/dist/delegation/constraints.js +3 -110
  26. package/dist/delegation/index.d.ts +0 -6
  27. package/dist/delegation/index.js +0 -6
  28. package/dist/delegation/schemas.d.ts +174 -514
  29. package/dist/delegation/schemas.js +3 -247
  30. package/dist/did/index.d.ts +0 -6
  31. package/dist/did/index.js +0 -6
  32. package/dist/did/resolve-contract.d.ts +0 -167
  33. package/dist/did/resolve-contract.js +0 -20
  34. package/dist/did/schemas.d.ts +0 -80
  35. package/dist/did/schemas.js +4 -97
  36. package/dist/did/types.d.ts +0 -126
  37. package/dist/did/types.js +0 -34
  38. package/dist/env/constants.d.ts +0 -45
  39. package/dist/env/constants.js +0 -45
  40. package/dist/env/index.d.ts +0 -4
  41. package/dist/env/index.js +0 -4
  42. package/dist/handshake.d.ts +0 -21
  43. package/dist/handshake.js +3 -11
  44. package/dist/index.d.ts +0 -15
  45. package/dist/index.js +0 -25
  46. package/dist/proof/index.d.ts +0 -7
  47. package/dist/proof/index.js +0 -7
  48. package/dist/proof/proof-record.d.ts +62 -172
  49. package/dist/proof/proof-record.js +0 -74
  50. package/dist/proof/signing-spec.d.ts +12 -86
  51. package/dist/proof/signing-spec.js +0 -71
  52. package/dist/proof.d.ts +16 -38
  53. package/dist/proof.js +3 -26
  54. package/dist/registry.d.ts +10 -27
  55. package/dist/registry.js +9 -30
  56. package/dist/runtime/errors.d.ts +0 -169
  57. package/dist/runtime/errors.js +0 -69
  58. package/dist/runtime/headers.d.ts +0 -50
  59. package/dist/runtime/headers.js +0 -30
  60. package/dist/runtime/index.d.ts +0 -4
  61. package/dist/runtime/index.js +0 -4
  62. package/dist/test.d.ts +0 -37
  63. package/dist/test.js +0 -37
  64. package/dist/tlkrc/index.d.ts +0 -4
  65. package/dist/tlkrc/index.js +0 -4
  66. package/dist/tlkrc/rotation.d.ts +12 -90
  67. package/dist/tlkrc/rotation.js +0 -72
  68. package/dist/tool-protection/index.d.ts +129 -0
  69. package/dist/tool-protection/index.js +80 -0
  70. package/dist/utils/validation.d.ts +0 -17
  71. package/dist/utils/validation.js +0 -14
  72. package/dist/vc/index.d.ts +0 -6
  73. package/dist/vc/index.js +0 -6
  74. package/dist/vc/schemas.d.ts +0 -596
  75. package/dist/vc/schemas.js +2 -111
  76. package/dist/vc/statuslist.d.ts +0 -202
  77. package/dist/vc/statuslist.js +1 -73
  78. package/dist/verifier.d.ts +9 -13
  79. package/dist/verifier.js +0 -8
  80. package/dist/well-known/index.d.ts +248 -0
  81. package/dist/well-known/index.js +104 -0
  82. package/package.json +27 -5
package/dist/env/index.js CHANGED
@@ -1,7 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Environment Constants Module
4
- */
5
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
3
  if (k2 === undefined) k2 = k;
7
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -18,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
15
  };
19
16
  Object.defineProperty(exports, "__esModule", { value: true });
20
17
  __exportStar(require("./constants.js"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1,7 +1,4 @@
1
1
  import { z } from "zod";
2
- /**
3
- * Handshake and session management schemas
4
- */
5
2
  export declare const HandshakeRequestSchema: z.ZodObject<{
6
3
  nonce: z.ZodString;
7
4
  audience: z.ZodString;
@@ -59,28 +56,11 @@ export declare const NonceCacheEntrySchema: z.ZodObject<{
59
56
  export type HandshakeRequest = z.infer<typeof HandshakeRequestSchema>;
60
57
  export type SessionContext = z.infer<typeof SessionContextSchema>;
61
58
  export type NonceCacheEntry = z.infer<typeof NonceCacheEntrySchema>;
62
- /**
63
- * Nonce cache interface for replay prevention
64
- */
65
59
  export interface NonceCache {
66
- /**
67
- * Check if a nonce exists in the cache
68
- */
69
60
  has(nonce: string): Promise<boolean>;
70
- /**
71
- * Add a nonce to the cache with TTL
72
- * MUST ensure atomic add-if-absent semantics for replay prevention
73
- */
74
61
  add(nonce: string, ttl: number): Promise<void>;
75
- /**
76
- * Clean up expired entries
77
- * Should be safe to call frequently and should be no-op for backends that auto-expire
78
- */
79
62
  cleanup(): Promise<void>;
80
63
  }
81
- /**
82
- * Configuration for nonce cache implementations
83
- */
84
64
  export declare const NonceCacheConfigSchema: z.ZodObject<{
85
65
  type: z.ZodOptional<z.ZodEnum<["memory", "redis", "dynamodb", "cloudflare-kv"]>>;
86
66
  redis: z.ZodOptional<z.ZodObject<{
@@ -156,4 +136,3 @@ export type NonceCacheConfig = z.infer<typeof NonceCacheConfigSchema>;
156
136
  export declare const DEFAULT_SESSION_TTL_MINUTES = 30;
157
137
  export declare const DEFAULT_TIMESTAMP_SKEW_SECONDS = 120;
158
138
  export declare const NONCE_LENGTH_BYTES = 16;
159
- //# sourceMappingURL=handshake.d.ts.map
package/dist/handshake.js CHANGED
@@ -2,14 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NONCE_LENGTH_BYTES = exports.DEFAULT_TIMESTAMP_SKEW_SECONDS = exports.DEFAULT_SESSION_TTL_MINUTES = exports.NonceCacheConfigSchema = exports.NonceCacheEntrySchema = exports.SessionContextSchema = exports.HandshakeRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- /**
6
- * Handshake and session management schemas
7
- */
8
5
  exports.HandshakeRequestSchema = zod_1.z.object({
9
6
  nonce: zod_1.z.string().min(1),
10
7
  audience: zod_1.z.string().min(1),
11
8
  timestamp: zod_1.z.number().int().positive(),
12
- agentDid: zod_1.z.string().startsWith("did:").optional(), // Agent DID for delegation verification
9
+ agentDid: zod_1.z.string().startsWith("did:").optional(),
13
10
  });
14
11
  exports.SessionContextSchema = zod_1.z.object({
15
12
  sessionId: zod_1.z.string().min(1),
@@ -19,15 +16,12 @@ exports.SessionContextSchema = zod_1.z.object({
19
16
  createdAt: zod_1.z.number().int().positive(),
20
17
  lastActivity: zod_1.z.number().int().positive(),
21
18
  ttlMinutes: zod_1.z.number().int().positive().default(30),
22
- agentDid: zod_1.z.string().optional(), // Agent DID for delegation verification
19
+ agentDid: zod_1.z.string().optional(),
23
20
  });
24
21
  exports.NonceCacheEntrySchema = zod_1.z.object({
25
22
  sessionId: zod_1.z.string().min(1),
26
23
  expiresAt: zod_1.z.number().int().positive(),
27
24
  });
28
- /**
29
- * Configuration for nonce cache implementations
30
- */
31
25
  exports.NonceCacheConfigSchema = zod_1.z.object({
32
26
  type: zod_1.z.enum(["memory", "redis", "dynamodb", "cloudflare-kv"]).optional(),
33
27
  redis: zod_1.z
@@ -51,8 +45,6 @@ exports.NonceCacheConfigSchema = zod_1.z.object({
51
45
  })
52
46
  .optional(),
53
47
  });
54
- // Constants
55
48
  exports.DEFAULT_SESSION_TTL_MINUTES = 30;
56
49
  exports.DEFAULT_TIMESTAMP_SKEW_SECONDS = 120;
57
- exports.NONCE_LENGTH_BYTES = 16; // 128-bit
58
- //# sourceMappingURL=handshake.js.map
50
+ exports.NONCE_LENGTH_BYTES = 16;
package/dist/index.d.ts CHANGED
@@ -1,17 +1,3 @@
1
- /**
2
- * @kya-os/contracts - Shared types and schemas for XMCP-I ecosystem
3
- *
4
- * This package provides a single source of truth for all types and contracts
5
- * used across the XMCP-I ecosystem, including runtime, CLI, verifier, and registry.
6
- *
7
- * NOTE: Some exports may conflict. Use subpath imports for new modules:
8
- * - import { ... } from '@kya-os/contracts/did'
9
- * - import { ... } from '@kya-os/contracts/vc'
10
- * - import { ... } from '@kya-os/contracts/delegation'
11
- * - import { ... } from '@kya-os/contracts/runtime'
12
- * - import { ... } from '@kya-os/contracts/tlkrc'
13
- * - import { ... } from '@kya-os/contracts/env'
14
- */
15
1
  export * from "./handshake.js";
16
2
  export * from "./proof.js";
17
3
  export * from "./verifier.js";
@@ -23,4 +9,3 @@ export * from "./vc/index.js";
23
9
  export * from "./delegation/index.js";
24
10
  export declare const CONTRACTS_VERSION = "1.2.1";
25
11
  export declare const SUPPORTED_XMCP_I_VERSION = "^1.0.0";
26
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,18 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * @kya-os/contracts - Shared types and schemas for XMCP-I ecosystem
4
- *
5
- * This package provides a single source of truth for all types and contracts
6
- * used across the XMCP-I ecosystem, including runtime, CLI, verifier, and registry.
7
- *
8
- * NOTE: Some exports may conflict. Use subpath imports for new modules:
9
- * - import { ... } from '@kya-os/contracts/did'
10
- * - import { ... } from '@kya-os/contracts/vc'
11
- * - import { ... } from '@kya-os/contracts/delegation'
12
- * - import { ... } from '@kya-os/contracts/runtime'
13
- * - import { ... } from '@kya-os/contracts/tlkrc'
14
- * - import { ... } from '@kya-os/contracts/env'
15
- */
16
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
3
  if (k2 === undefined) k2 = k;
18
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -29,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
15
  };
30
16
  Object.defineProperty(exports, "__esModule", { value: true });
31
17
  exports.SUPPORTED_XMCP_I_VERSION = exports.CONTRACTS_VERSION = void 0;
32
- // Legacy exports (maintain backward compatibility)
33
18
  __exportStar(require("./handshake.js"), exports);
34
19
  __exportStar(require("./proof.js"), exports);
35
20
  __exportStar(require("./verifier.js"), exports);
@@ -37,17 +22,7 @@ __exportStar(require("./registry.js"), exports);
37
22
  __exportStar(require("./cli.js"), exports);
38
23
  __exportStar(require("./test.js"), exports);
39
24
  __exportStar(require("./utils/validation.js"), exports);
40
- // W3C VC and Delegation exports (for mcp-i-core compatibility)
41
25
  __exportStar(require("./vc/index.js"), exports);
42
26
  __exportStar(require("./delegation/index.js"), exports);
43
- // Version information
44
27
  exports.CONTRACTS_VERSION = "1.2.1";
45
28
  exports.SUPPORTED_XMCP_I_VERSION = "^1.0.0";
46
- // New MCP-I contract types are available via subpath imports:
47
- // import { ... } from '@kya-os/contracts/did'
48
- // import { ... } from '@kya-os/contracts/vc'
49
- // import { ... } from '@kya-os/contracts/delegation'
50
- // import { ... } from '@kya-os/contracts/runtime'
51
- // import { ... } from '@kya-os/contracts/tlkrc'
52
- // import { ... } from '@kya-os/contracts/env'
53
- //# sourceMappingURL=index.js.map
@@ -1,9 +1,2 @@
1
- /**
2
- * Proof Module Exports
3
- *
4
- * Note: This module exports proof record and signing spec types.
5
- * The existing proof.ts file with DetachedProofSchema is separate.
6
- */
7
1
  export * from './signing-spec.js';
8
2
  export * from './proof-record.js';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Proof Module Exports
4
- *
5
- * Note: This module exports proof record and signing spec types.
6
- * The existing proof.ts file with DetachedProofSchema is separate.
7
- */
8
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -22,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
16
  Object.defineProperty(exports, "__esModule", { value: true });
23
17
  __exportStar(require("./signing-spec.js"), exports);
24
18
  __exportStar(require("./proof-record.js"), exports);
25
- //# sourceMappingURL=index.js.map