@kya-os/contracts 1.5.3-canary.22 → 1.5.3-canary.24

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 (69) hide show
  1. package/dist/consent/schemas.d.ts +149 -77
  2. package/dist/consent/schemas.js +29 -2
  3. package/package.json +23 -1
  4. package/.turbo/turbo-build.log +0 -19
  5. package/.turbo/turbo-test$colon$coverage.log +0 -117
  6. package/.turbo/turbo-test.log +0 -32
  7. package/coverage/coverage-final.json +0 -38
  8. package/schemas/cli/register-output/v1.0.0.json +0 -69
  9. package/schemas/identity/v1.0.0.json +0 -46
  10. package/schemas/proof/v1.0.0.json +0 -80
  11. package/schemas/registry/receipt-v1.0.0.json +0 -60
  12. package/schemas/verifier/verify-page/v1.0.0.json +0 -94
  13. package/schemas/well-known/agent/v1.0.0.json +0 -67
  14. package/schemas/well-known/did/v1.0.0.json +0 -174
  15. package/scripts/emit-schemas.js +0 -11
  16. package/src/agentshield-api/admin-schemas.ts +0 -31
  17. package/src/agentshield-api/admin-types.ts +0 -47
  18. package/src/agentshield-api/endpoints.ts +0 -60
  19. package/src/agentshield-api/index.ts +0 -70
  20. package/src/agentshield-api/schemas.ts +0 -304
  21. package/src/agentshield-api/types.ts +0 -317
  22. package/src/audit/index.ts +0 -128
  23. package/src/cli.ts +0 -156
  24. package/src/config/base.ts +0 -107
  25. package/src/config/builder.ts +0 -97
  26. package/src/config/delegation.ts +0 -232
  27. package/src/config/identity.ts +0 -252
  28. package/src/config/index.ts +0 -78
  29. package/src/config/proofing.ts +0 -138
  30. package/src/config/tool-context.ts +0 -41
  31. package/src/config/tool-protection.ts +0 -174
  32. package/src/consent/index.ts +0 -32
  33. package/src/consent/schemas.ts +0 -334
  34. package/src/consent/types.ts +0 -199
  35. package/src/dashboard-config/default-config.json +0 -86
  36. package/src/dashboard-config/default-config.ts +0 -266
  37. package/src/dashboard-config/index.ts +0 -48
  38. package/src/dashboard-config/schemas.ts +0 -286
  39. package/src/dashboard-config/types.ts +0 -404
  40. package/src/delegation/constraints.ts +0 -267
  41. package/src/delegation/index.ts +0 -8
  42. package/src/delegation/schemas.ts +0 -595
  43. package/src/did/index.ts +0 -9
  44. package/src/did/resolve-contract.ts +0 -255
  45. package/src/did/schemas.ts +0 -190
  46. package/src/did/types.ts +0 -224
  47. package/src/env/constants.ts +0 -70
  48. package/src/env/index.ts +0 -5
  49. package/src/handshake.ts +0 -125
  50. package/src/index.ts +0 -45
  51. package/src/proof/index.ts +0 -31
  52. package/src/proof/proof-record.ts +0 -163
  53. package/src/proof/signing-spec.ts +0 -146
  54. package/src/proof.ts +0 -99
  55. package/src/registry.ts +0 -146
  56. package/src/runtime/errors.ts +0 -153
  57. package/src/runtime/headers.ts +0 -136
  58. package/src/runtime/index.ts +0 -6
  59. package/src/test.ts +0 -143
  60. package/src/tlkrc/index.ts +0 -5
  61. package/src/tlkrc/rotation.ts +0 -153
  62. package/src/tool-protection/index.ts +0 -406
  63. package/src/utils/validation.ts +0 -93
  64. package/src/vc/index.ts +0 -8
  65. package/src/vc/schemas.ts +0 -277
  66. package/src/vc/statuslist.ts +0 -279
  67. package/src/verifier/index.ts +0 -2
  68. package/src/verifier.ts +0 -92
  69. package/src/well-known/index.ts +0 -237
@@ -1,80 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schemas.kya-os.ai/mcpi/proof/v1.0.0",
4
- "title": "XMCP-I Detached Proof",
5
- "description": "Schema for detached proofs in XMCP-I protocol",
6
- "type": "object",
7
- "properties": {
8
- "jws": {
9
- "type": "string",
10
- "description": "Compact JWS format detached signature",
11
- "minLength": 1
12
- },
13
- "meta": {
14
- "type": "object",
15
- "properties": {
16
- "did": {
17
- "type": "string",
18
- "description": "Agent DID",
19
- "minLength": 1
20
- },
21
- "kid": {
22
- "type": "string",
23
- "description": "Key identifier",
24
- "minLength": 1
25
- },
26
- "ts": {
27
- "type": "integer",
28
- "description": "Unix timestamp",
29
- "minimum": 1
30
- },
31
- "nonce": {
32
- "type": "string",
33
- "description": "Session nonce",
34
- "minLength": 1
35
- },
36
- "audience": {
37
- "type": "string",
38
- "description": "Intended audience",
39
- "minLength": 1
40
- },
41
- "sessionId": {
42
- "type": "string",
43
- "description": "Session identifier",
44
- "minLength": 1
45
- },
46
- "requestHash": {
47
- "type": "string",
48
- "pattern": "^sha256:[a-f0-9]{64}$",
49
- "description": "SHA-256 hash of canonical request"
50
- },
51
- "responseHash": {
52
- "type": "string",
53
- "pattern": "^sha256:[a-f0-9]{64}$",
54
- "description": "SHA-256 hash of canonical response"
55
- },
56
- "scopeId": {
57
- "type": "string",
58
- "description": "Optional scope identifier"
59
- },
60
- "delegationRef": {
61
- "type": "string",
62
- "description": "Optional delegation reference"
63
- }
64
- },
65
- "required": [
66
- "did",
67
- "kid",
68
- "ts",
69
- "nonce",
70
- "audience",
71
- "sessionId",
72
- "requestHash",
73
- "responseHash"
74
- ],
75
- "additionalProperties": false
76
- }
77
- },
78
- "required": ["jws", "meta"],
79
- "additionalProperties": false
80
- }
@@ -1,60 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json",
4
- "title": "XMCP-I Receipt",
5
- "description": "Receipt object returned by KTA for verifiable operations",
6
- "type": "object",
7
- "properties": {
8
- "$schema": {
9
- "type": "string",
10
- "const": "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json"
11
- },
12
- "ref": {
13
- "type": "string",
14
- "minLength": 1,
15
- "description": "Unique reference identifier for the receipt"
16
- },
17
- "contentHash": {
18
- "type": "string",
19
- "pattern": "^sha256:[a-f0-9]{64}$",
20
- "description": "SHA-256 hash of the content with sha256: prefix"
21
- },
22
- "action": {
23
- "type": "string",
24
- "enum": ["issue", "revoke"],
25
- "description": "The action performed (issue or revoke)"
26
- },
27
- "ts": {
28
- "type": "integer",
29
- "minimum": 1,
30
- "description": "Unix timestamp when the action was performed"
31
- },
32
- "logIndex": {
33
- "type": "integer",
34
- "minimum": 0,
35
- "description": "Index in the KTA log for this receipt"
36
- },
37
- "logRoot": {
38
- "type": "string",
39
- "minLength": 1,
40
- "description": "Merkle log root hash for verification"
41
- },
42
- "inclusionProof": {
43
- "type": "array",
44
- "items": {
45
- "type": "string"
46
- },
47
- "description": "Merkle inclusion proof for verifying the receipt against the log root"
48
- }
49
- },
50
- "required": [
51
- "ref",
52
- "contentHash",
53
- "action",
54
- "ts",
55
- "logIndex",
56
- "logRoot",
57
- "inclusionProof"
58
- ],
59
- "additionalProperties": false
60
- }
@@ -1,94 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schemas.kya-os.ai/xmcp-i/verifier/verify-page/v1.0.0",
4
- "title": "XMCP-I Verify Page Payload",
5
- "description": "Schema for /verify debug page payload",
6
- "type": "object",
7
- "properties": {
8
- "canonicalHashes": {
9
- "type": "object",
10
- "properties": {
11
- "requestHash": {
12
- "type": "string",
13
- "pattern": "^sha256:[a-f0-9]{64}$",
14
- "description": "SHA-256 hash of canonical request"
15
- },
16
- "responseHash": {
17
- "type": "string",
18
- "pattern": "^sha256:[a-f0-9]{64}$",
19
- "description": "SHA-256 hash of canonical response"
20
- }
21
- },
22
- "required": ["requestHash", "responseHash"],
23
- "additionalProperties": false
24
- },
25
- "proof": {
26
- "type": "object",
27
- "properties": {
28
- "jws": {
29
- "type": "string",
30
- "description": "Compact JWS format detached signature",
31
- "minLength": 1
32
- },
33
- "meta": {
34
- "$ref": "https://schemas.kya-os.ai/mcpi/proof/v1.0.0#/properties/meta"
35
- }
36
- },
37
- "required": ["jws", "meta"],
38
- "additionalProperties": false
39
- },
40
- "didDocumentLink": {
41
- "type": "string",
42
- "format": "uri",
43
- "description": "Link to DID document"
44
- },
45
- "ktaURL": {
46
- "type": "string",
47
- "format": "uri",
48
- "description": "Know-That-AI URL"
49
- },
50
- "mcpMirrorStatus": {
51
- "type": "string",
52
- "enum": ["pending", "success", "error"],
53
- "description": "MCP Registry mirror status"
54
- },
55
- "protocolCapabilities": {
56
- "type": "array",
57
- "items": {
58
- "type": "string",
59
- "enum": ["handshake", "signing", "verification"]
60
- },
61
- "minItems": 3,
62
- "maxItems": 3,
63
- "description": "Advertised protocol capabilities"
64
- },
65
- "localVerificationResult": {
66
- "type": "object",
67
- "properties": {
68
- "valid": {
69
- "type": "boolean",
70
- "description": "Local verification result"
71
- },
72
- "errors": {
73
- "type": "array",
74
- "items": {
75
- "type": "string"
76
- },
77
- "description": "Validation errors if any"
78
- }
79
- },
80
- "required": ["valid"],
81
- "additionalProperties": false
82
- }
83
- },
84
- "required": [
85
- "canonicalHashes",
86
- "proof",
87
- "didDocumentLink",
88
- "ktaURL",
89
- "mcpMirrorStatus",
90
- "protocolCapabilities",
91
- "localVerificationResult"
92
- ],
93
- "additionalProperties": false
94
- }
@@ -1,67 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schemas.kya-os.ai/xmcp-i/well-known/agent/v1.0.0",
4
- "title": "MCP-I Agent Document",
5
- "description": "Schema for /.well-known/agent.json endpoint (MCP-I capabilities). Top-level schema uses additionalProperties:false for strict validation - new top-level fields require explicit schema version bumps to ensure deliberate evolution. Vendor-specific extensions should be placed in the 'metadata' object which allows additionalProperties:true for backward-compatible extensibility.",
6
- "type": "object",
7
- "properties": {
8
- "id": {
9
- "type": "string",
10
- "description": "Agent DID identifier",
11
- "pattern": "^did:"
12
- },
13
- "capabilities": {
14
- "type": "object",
15
- "description": "Agent capabilities by protocol",
16
- "properties": {
17
- "mcp-i": {
18
- "type": "array",
19
- "description": "MCP-I protocol capabilities",
20
- "items": {
21
- "type": "string",
22
- "enum": [
23
- "handshake",
24
- "signing",
25
- "verification"
26
- ]
27
- },
28
- "minItems": 3,
29
- "maxItems": 3
30
- }
31
- },
32
- "required": ["mcp-i"],
33
- "additionalProperties": {
34
- "type": "array",
35
- "items": {
36
- "type": "string"
37
- }
38
- }
39
- },
40
- "metadata": {
41
- "type": "object",
42
- "description": "Optional agent metadata. This object is the designated extensibility point - vendors can add custom fields here without requiring schema version changes. Use this for implementation-specific data, vendor identifiers, custom features, etc.",
43
- "properties": {
44
- "name": {
45
- "type": "string",
46
- "description": "Human-readable service name"
47
- },
48
- "serviceEndpoint": {
49
- "type": "string",
50
- "description": "Service endpoint URL",
51
- "format": "uri"
52
- },
53
- "description": {
54
- "type": "string",
55
- "description": "Service description"
56
- },
57
- "version": {
58
- "type": "string",
59
- "description": "Service version"
60
- }
61
- },
62
- "additionalProperties": true
63
- }
64
- },
65
- "required": ["id", "capabilities"],
66
- "additionalProperties": false
67
- }
@@ -1,174 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://schemas.kya-os.ai/xmcp-i/well-known/did/v1.0.0",
4
- "title": "W3C DID Document",
5
- "description": "Schema for /.well-known/did.json endpoint (W3C DID Core specification)",
6
- "type": "object",
7
- "properties": {
8
- "@context": {
9
- "description": "JSON-LD context - must be W3C DID v1 string or array with W3C DID v1 as first element",
10
- "oneOf": [
11
- {
12
- "type": "string",
13
- "const": "https://www.w3.org/ns/did/v1"
14
- },
15
- {
16
- "type": "array",
17
- "minItems": 1,
18
- "maxItems": 10,
19
- "items": {
20
- "oneOf": [
21
- {
22
- "const": "https://www.w3.org/ns/did/v1"
23
- },
24
- {
25
- "type": "string"
26
- }
27
- ]
28
- },
29
- "contains": {
30
- "const": "https://www.w3.org/ns/did/v1"
31
- }
32
- }
33
- ]
34
-
35
- },
36
- "id": {
37
- "type": "string",
38
- "description": "DID identifier",
39
- "pattern": "^did:"
40
- },
41
- "verificationMethod": {
42
- "type": "array",
43
- "description": "Verification methods",
44
- "items": {
45
- "type": "object",
46
- "required": ["id", "type", "controller"],
47
- "properties": {
48
- "id": {
49
- "type": "string",
50
- "description": "Verification method ID"
51
- },
52
- "type": {
53
- "type": "string",
54
- "description": "Verification method type",
55
- "enum": [
56
- "Ed25519VerificationKey2020",
57
- "Ed25519VerificationKey2018",
58
- "JsonWebKey2020"
59
- ]
60
- },
61
- "controller": {
62
- "type": "string",
63
- "description": "Controller DID",
64
- "pattern": "^did:"
65
- },
66
- "publicKeyBase64": {
67
- "type": "string",
68
- "description": "Base64-encoded public key"
69
- },
70
- "publicKeyMultibase": {
71
- "type": "string",
72
- "description": "Multibase-encoded public key"
73
- },
74
- "publicKeyJwk": {
75
- "type": "object",
76
- "description": "JSON Web Key"
77
- }
78
- },
79
- "anyOf": [
80
- {
81
- "properties": {
82
- "publicKeyBase64": {
83
- "type": "string"
84
- }
85
- },
86
- "required": ["publicKeyBase64"]
87
- },
88
- {
89
- "properties": {
90
- "publicKeyMultibase": {
91
- "type": "string"
92
- }
93
- },
94
- "required": ["publicKeyMultibase"]
95
- },
96
- {
97
- "properties": {
98
- "publicKeyJwk": {
99
- "type": "object"
100
- }
101
- },
102
- "required": ["publicKeyJwk"]
103
- }
104
- ]
105
- },
106
- "minItems": 1
107
- },
108
- "authentication": {
109
- "type": "array",
110
- "description": "Authentication methods",
111
- "items": {
112
- "type": "string"
113
- },
114
- "minItems": 1
115
- },
116
- "assertionMethod": {
117
- "type": "array",
118
- "description": "Assertion methods",
119
- "items": {
120
- "type": "string"
121
- }
122
- },
123
- "keyAgreement": {
124
- "type": "array",
125
- "description": "Key agreement methods",
126
- "items": {
127
- "type": "string"
128
- }
129
- },
130
- "capabilityInvocation": {
131
- "type": "array",
132
- "description": "Capability invocation methods",
133
- "items": {
134
- "type": "string"
135
- }
136
- },
137
- "capabilityDelegation": {
138
- "type": "array",
139
- "description": "Capability delegation methods",
140
- "items": {
141
- "type": "string"
142
- }
143
- },
144
- "service": {
145
- "type": "array",
146
- "description": "Service endpoints",
147
- "items": {
148
- "type": "object",
149
- "properties": {
150
- "id": {
151
- "type": "string"
152
- },
153
- "type": {
154
- "type": "string"
155
- },
156
- "serviceEndpoint": {
157
- "oneOf": [
158
- {
159
- "type": "string",
160
- "format": "uri"
161
- },
162
- {
163
- "type": "object"
164
- }
165
- ]
166
- }
167
- },
168
- "required": ["id", "type", "serviceEndpoint"]
169
- }
170
- }
171
- },
172
- "required": ["@context", "id", "verificationMethod", "authentication"],
173
- "additionalProperties": true
174
- }
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Schema Emission Script
4
- *
5
- * This script generates JSON Schemas from Zod schemas for interoperability
6
- * with other languages and validation tools.
7
- */
8
-
9
- // Placeholder - will be implemented after Zod schemas are created
10
- console.log('Schema emission script - to be implemented');
11
- process.exit(0);
@@ -1,31 +0,0 @@
1
- /**
2
- * AgentShield Admin API Validation Schemas
3
- *
4
- * Zod schemas for administrative operations in AgentShield.
5
- *
6
- * @package @kya-os/contracts/agentshield-api
7
- */
8
-
9
- import { z } from 'zod';
10
-
11
- /**
12
- * Request schema for clearing agent cache
13
- */
14
- export const clearCacheRequestSchema = z.object({
15
- agent_did: z.string().min(1).describe('The DID of the agent whose cache should be cleared'),
16
- });
17
-
18
- /**
19
- * Response schema for clear cache operation
20
- */
21
- export const clearCacheResponseSchema = z.object({
22
- message: z.string().describe('Human-readable message about the operation result'),
23
- agent_did: z.string().describe('The agent DID that was cleared'),
24
- project_id: z.string().nullable().describe('The project ID if available'),
25
- cache_key: z.string().describe('The cache key that was cleared'),
26
- old_cache_key: z.string().nullable().describe('Old cache key that was also cleared (for migration)'),
27
- had_value: z.boolean().describe('Whether the cache entry existed before clearing'),
28
- had_old_value: z.boolean().describe('Whether the old cache entry existed before clearing'),
29
- cleared: z.boolean().describe('Whether the cache was successfully cleared'),
30
- });
31
-
@@ -1,47 +0,0 @@
1
- /**
2
- * AgentShield Admin API Type Definitions
3
- *
4
- * TypeScript interfaces for administrative operations in AgentShield.
5
- * These types ensure parity between xmcp-i admin endpoints and the AgentShield service.
6
- *
7
- * @package @kya-os/contracts/agentshield-api
8
- */
9
-
10
- /**
11
- * Request to clear agent cache
12
- * POST /admin/clear-cache
13
- */
14
- export interface ClearCacheRequest {
15
- /** The DID of the agent whose cache should be cleared */
16
- agent_did: string;
17
- }
18
-
19
- /**
20
- * Response from clear cache operation
21
- */
22
- export interface ClearCacheResponse {
23
- /** Human-readable message about the operation result */
24
- message: string;
25
-
26
- /** The agent DID that was cleared */
27
- agent_did: string;
28
-
29
- /** The project ID if available */
30
- project_id: string | null;
31
-
32
- /** The cache key that was cleared */
33
- cache_key: string;
34
-
35
- /** Old cache key that was also cleared (for migration) */
36
- old_cache_key: string | null;
37
-
38
- /** Whether the cache entry existed before clearing */
39
- had_value: boolean;
40
-
41
- /** Whether the old cache entry existed before clearing */
42
- had_old_value: boolean;
43
-
44
- /** Whether the cache was successfully cleared */
45
- cleared: boolean;
46
- }
47
-
@@ -1,60 +0,0 @@
1
- /**
2
- * AgentShield/Bouncer API Endpoint Constants
3
- *
4
- * Centralized endpoint definitions to prevent hardcoded URLs
5
- * and ensure consistency across all API clients.
6
- *
7
- * @package @kya-os/contracts/agentshield-api
8
- */
9
-
10
- /**
11
- * Base path for all AgentShield/Bouncer API endpoints
12
- */
13
- export const AGENTSHIELD_API_BASE = '/api/v1/bouncer' as const;
14
-
15
- /**
16
- * AgentShield API endpoint paths
17
- *
18
- * These are relative paths that should be appended to the base API URL.
19
- * Example: `${apiUrl}${AGENTSHIELD_ENDPOINTS.PROOFS}`
20
- */
21
- export const AGENTSHIELD_ENDPOINTS = {
22
- /** Submit proofs in batch */
23
- PROOFS: `${AGENTSHIELD_API_BASE}/proofs` as const,
24
-
25
- /** Verify delegation by agent DID and scopes */
26
- DELEGATIONS_VERIFY: `${AGENTSHIELD_API_BASE}/delegations/verify` as const,
27
-
28
- /** Get delegation by ID */
29
- DELEGATIONS_GET: (id: string) => `${AGENTSHIELD_API_BASE}/delegations/${id}` as const,
30
-
31
- /** Create new delegation */
32
- DELEGATIONS_CREATE: `${AGENTSHIELD_API_BASE}/delegations` as const,
33
-
34
- /** Revoke delegation */
35
- DELEGATIONS_REVOKE: (id: string) => `${AGENTSHIELD_API_BASE}/delegations/${id}/revoke` as const,
36
-
37
- /** Get server configuration */
38
- CONFIG: (projectId: string) => `${AGENTSHIELD_API_BASE}/projects/${projectId}/config` as const,
39
- } as const;
40
-
41
- /**
42
- * HTTP methods for each endpoint
43
- */
44
- export const AGENTSHIELD_METHODS = {
45
- PROOFS: 'POST' as const,
46
- DELEGATIONS_VERIFY: 'POST' as const,
47
- DELEGATIONS_GET: 'GET' as const,
48
- DELEGATIONS_CREATE: 'POST' as const,
49
- DELEGATIONS_REVOKE: 'POST' as const,
50
- CONFIG: 'GET' as const,
51
- } as const;
52
-
53
- /**
54
- * Required headers for AgentShield API requests
55
- */
56
- export interface AgentShieldAPIHeaders {
57
- 'Content-Type': 'application/json';
58
- 'Authorization': `Bearer ${string}`;
59
- }
60
-