@kya-os/contracts 1.5.3-canary.16 → 1.5.3-canary.18

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 (77) hide show
  1. package/.turbo/turbo-build.log +17 -0
  2. package/.turbo/turbo-test$colon$coverage.log +28 -0
  3. package/.turbo/turbo-test.log +32 -0
  4. package/coverage/coverage-final.json +38 -0
  5. package/dist/agentshield-api/admin-schemas.d.ts +2 -2
  6. package/dist/agentshield-api/schemas.d.ts +86 -112
  7. package/dist/audit/index.d.ts +24 -24
  8. package/dist/config/identity.d.ts +6 -6
  9. package/dist/consent/schemas.d.ts +87 -69
  10. package/dist/consent/schemas.js +10 -0
  11. package/dist/dashboard-config/schemas.d.ts +2553 -1349
  12. package/dist/handshake.d.ts +14 -14
  13. package/dist/tool-protection/index.d.ts +418 -8
  14. package/dist/tool-protection/index.js +61 -2
  15. package/dist/well-known/index.d.ts +2 -2
  16. package/package.json +37 -129
  17. package/schemas/cli/register-output/v1.0.0.json +69 -0
  18. package/schemas/identity/v1.0.0.json +46 -0
  19. package/schemas/proof/v1.0.0.json +80 -0
  20. package/schemas/registry/receipt-v1.0.0.json +60 -0
  21. package/schemas/verifier/verify-page/v1.0.0.json +94 -0
  22. package/schemas/well-known/agent/v1.0.0.json +67 -0
  23. package/schemas/well-known/did/v1.0.0.json +174 -0
  24. package/scripts/emit-schemas.js +11 -0
  25. package/src/agentshield-api/admin-schemas.ts +31 -0
  26. package/src/agentshield-api/admin-types.ts +47 -0
  27. package/src/agentshield-api/endpoints.ts +60 -0
  28. package/src/agentshield-api/index.ts +70 -0
  29. package/src/agentshield-api/schemas.ts +304 -0
  30. package/src/agentshield-api/types.ts +317 -0
  31. package/src/audit/index.ts +128 -0
  32. package/src/cli.ts +156 -0
  33. package/src/config/base.ts +107 -0
  34. package/src/config/builder.ts +97 -0
  35. package/src/config/delegation.ts +232 -0
  36. package/src/config/identity.ts +252 -0
  37. package/src/config/index.ts +78 -0
  38. package/src/config/proofing.ts +138 -0
  39. package/src/config/tool-context.ts +41 -0
  40. package/src/config/tool-protection.ts +174 -0
  41. package/src/consent/index.ts +32 -0
  42. package/src/consent/schemas.ts +334 -0
  43. package/src/consent/types.ts +199 -0
  44. package/src/dashboard-config/default-config.json +86 -0
  45. package/src/dashboard-config/default-config.ts +266 -0
  46. package/src/dashboard-config/index.ts +48 -0
  47. package/src/dashboard-config/schemas.ts +286 -0
  48. package/src/dashboard-config/types.ts +404 -0
  49. package/src/delegation/constraints.ts +267 -0
  50. package/src/delegation/index.ts +8 -0
  51. package/src/delegation/schemas.ts +595 -0
  52. package/src/did/index.ts +9 -0
  53. package/src/did/resolve-contract.ts +255 -0
  54. package/src/did/schemas.ts +190 -0
  55. package/src/did/types.ts +224 -0
  56. package/src/env/constants.ts +70 -0
  57. package/src/env/index.ts +5 -0
  58. package/src/handshake.ts +125 -0
  59. package/src/index.ts +45 -0
  60. package/src/proof/index.ts +31 -0
  61. package/src/proof/proof-record.ts +163 -0
  62. package/src/proof/signing-spec.ts +146 -0
  63. package/src/proof.ts +99 -0
  64. package/src/registry.ts +146 -0
  65. package/src/runtime/errors.ts +153 -0
  66. package/src/runtime/headers.ts +136 -0
  67. package/src/runtime/index.ts +6 -0
  68. package/src/test.ts +143 -0
  69. package/src/tlkrc/index.ts +5 -0
  70. package/src/tlkrc/rotation.ts +153 -0
  71. package/src/tool-protection/index.ts +343 -0
  72. package/src/utils/validation.ts +93 -0
  73. package/src/vc/index.ts +8 -0
  74. package/src/vc/schemas.ts +277 -0
  75. package/src/vc/statuslist.ts +279 -0
  76. package/src/verifier.ts +92 -0
  77. package/src/well-known/index.ts +237 -0
@@ -9,7 +9,7 @@
9
9
  * @module @kya-os/contracts/tool-protection
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DelegationRequiredErrorDataSchema = exports.ToolProtectionResponseSchema = exports.ToolProtectionMapSchema = exports.ToolProtectionSchema = void 0;
12
+ exports.DelegationRequiredErrorDataSchema = exports.ToolProtectionResponseSchema = exports.ToolProtectionMapSchema = exports.ToolProtectionSchema = exports.AuthorizationRequirementSchema = void 0;
13
13
  exports.isToolProtection = isToolProtection;
14
14
  exports.isToolProtectionMap = isToolProtectionMap;
15
15
  exports.isToolProtectionResponse = isToolProtectionResponse;
@@ -22,15 +22,42 @@ exports.toolRequiresDelegation = toolRequiresDelegation;
22
22
  exports.getToolRequiredScopes = getToolRequiredScopes;
23
23
  exports.getToolRiskLevel = getToolRiskLevel;
24
24
  exports.createDelegationRequiredError = createDelegationRequiredError;
25
+ exports.normalizeToolProtection = normalizeToolProtection;
25
26
  const zod_1 = require("zod");
26
27
  /**
27
28
  * Zod Schemas for Validation
28
29
  */
30
+ exports.AuthorizationRequirementSchema = zod_1.z.discriminatedUnion('type', [
31
+ zod_1.z.object({
32
+ type: zod_1.z.literal('oauth'),
33
+ provider: zod_1.z.string(),
34
+ requiredScopes: zod_1.z.array(zod_1.z.string()).optional(),
35
+ }),
36
+ zod_1.z.object({
37
+ type: zod_1.z.literal('mdl'),
38
+ issuer: zod_1.z.string(),
39
+ credentialType: zod_1.z.string().optional(),
40
+ }),
41
+ zod_1.z.object({
42
+ type: zod_1.z.literal('idv'),
43
+ provider: zod_1.z.string(),
44
+ verificationLevel: zod_1.z.enum(['basic', 'enhanced', 'loa3']).optional(),
45
+ }),
46
+ zod_1.z.object({
47
+ type: zod_1.z.literal('credential'),
48
+ credentialType: zod_1.z.string(),
49
+ issuer: zod_1.z.string().optional(),
50
+ }),
51
+ zod_1.z.object({
52
+ type: zod_1.z.literal('none'),
53
+ }),
54
+ ]);
29
55
  exports.ToolProtectionSchema = zod_1.z.object({
30
56
  requiresDelegation: zod_1.z.boolean(),
31
57
  requiredScopes: zod_1.z.array(zod_1.z.string()),
32
58
  riskLevel: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional(),
33
- oauthProvider: zod_1.z.string().optional() // Phase 2: Tool-specific OAuth provider
59
+ oauthProvider: zod_1.z.string().optional(), // Phase 2: Tool-specific OAuth provider
60
+ authorization: exports.AuthorizationRequirementSchema.optional(),
34
61
  });
35
62
  exports.ToolProtectionMapSchema = zod_1.z.record(zod_1.z.string(), exports.ToolProtectionSchema);
36
63
  exports.ToolProtectionResponseSchema = zod_1.z.object({
@@ -112,3 +139,35 @@ function createDelegationRequiredError(toolName, requiredScopes, consentUrl) {
112
139
  authorizationUrl: consentUrl // Include both for compatibility
113
140
  };
114
141
  }
142
+ /**
143
+ * Normalize tool protection configuration
144
+ * Migrates legacy oauthProvider field to authorization object
145
+ *
146
+ * // TODO: Remove normalizeToolProtection() when all tools migrated (target: Phase 3)
147
+ */
148
+ function normalizeToolProtection(raw) {
149
+ // If authorization is already present, return as is
150
+ if (raw.authorization) {
151
+ return raw;
152
+ }
153
+ // Migrate oauthProvider to authorization
154
+ if (raw.oauthProvider) {
155
+ return {
156
+ ...raw,
157
+ authorization: {
158
+ type: 'oauth',
159
+ provider: raw.oauthProvider,
160
+ },
161
+ // Keep oauthProvider for backward compatibility until Phase 3
162
+ };
163
+ }
164
+ // Default for requiresDelegation=true without specific auth: type='none' (consent only)
165
+ // But ONLY if authorization is missing entirely
166
+ if (raw.requiresDelegation && !raw.authorization && !raw.oauthProvider) {
167
+ // We don't automatically set type='none' here to allow
168
+ // ProviderResolver to do its scope inference fallback logic.
169
+ // The fallback logic will eventually be moved into an AuthorizationService.
170
+ return raw;
171
+ }
172
+ return raw;
173
+ }
@@ -209,12 +209,12 @@ export declare const AgentDocumentSchema: z.ZodObject<{
209
209
  description?: string | undefined;
210
210
  }>>;
211
211
  }, "strip", z.ZodTypeAny, {
212
- id: string;
213
212
  capabilities: {
214
213
  'mcp-i': ("handshake" | "signing" | "verification" | "delegation" | "proof-generation")[];
215
214
  } & {
216
215
  [k: string]: string[];
217
216
  };
217
+ id: string;
218
218
  metadata?: {
219
219
  version?: string | undefined;
220
220
  name?: string | undefined;
@@ -222,12 +222,12 @@ export declare const AgentDocumentSchema: z.ZodObject<{
222
222
  description?: string | undefined;
223
223
  } | undefined;
224
224
  }, {
225
- id: string;
226
225
  capabilities: {
227
226
  'mcp-i': ("handshake" | "signing" | "verification" | "delegation" | "proof-generation")[];
228
227
  } & {
229
228
  [k: string]: string[];
230
229
  };
230
+ id: string;
231
231
  metadata?: {
232
232
  version?: string | undefined;
233
233
  name?: string | undefined;
package/package.json CHANGED
@@ -1,161 +1,69 @@
1
1
  {
2
2
  "name": "@kya-os/contracts",
3
- "version": "1.5.3-canary.16",
4
- "description": "Shared types and schemas for XMCP-I ecosystem",
5
- "type": "commonjs",
6
- "sideEffects": false,
7
- "main": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
3
+ "version": "1.5.3-canary.18",
4
+ "description": "Shared contracts, types, and schemas for MCP-I framework",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
9
7
  "exports": {
10
8
  ".": {
11
9
  "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.js"
10
+ "default": "./dist/index.js"
14
11
  },
15
- "./handshake": {
16
- "types": "./dist/handshake.d.ts",
17
- "import": "./dist/handshake.js",
18
- "require": "./dist/handshake.js"
19
- },
20
- "./proof": {
21
- "types": "./dist/proof/index.d.ts",
22
- "import": "./dist/proof/index.js",
23
- "require": "./dist/proof/index.js"
24
- },
25
- "./verifier": {
26
- "types": "./dist/verifier.d.ts",
27
- "import": "./dist/verifier.js",
28
- "require": "./dist/verifier.js"
29
- },
30
- "./registry": {
31
- "types": "./dist/registry.d.ts",
32
- "import": "./dist/registry.js",
33
- "require": "./dist/registry.js"
34
- },
35
- "./cli": {
36
- "types": "./dist/cli.d.ts",
37
- "import": "./dist/cli.js",
38
- "require": "./dist/cli.js"
39
- },
40
- "./test": {
41
- "types": "./dist/test.d.ts",
42
- "import": "./dist/test.js",
43
- "require": "./dist/test.js"
44
- },
45
- "./did": {
46
- "types": "./dist/did/index.d.ts",
47
- "import": "./dist/did/index.js",
48
- "require": "./dist/did/index.js"
49
- },
50
- "./vc": {
51
- "types": "./dist/vc/index.d.ts",
52
- "import": "./dist/vc/index.js",
53
- "require": "./dist/vc/index.js"
12
+ "./consent": {
13
+ "types": "./dist/consent/index.d.ts",
14
+ "default": "./dist/consent/index.js"
54
15
  },
55
16
  "./delegation": {
56
17
  "types": "./dist/delegation/index.d.ts",
57
- "import": "./dist/delegation/index.js",
58
- "require": "./dist/delegation/index.js"
59
- },
60
- "./runtime": {
61
- "types": "./dist/runtime/index.d.ts",
62
- "import": "./dist/runtime/index.js",
63
- "require": "./dist/runtime/index.js"
64
- },
65
- "./tlkrc": {
66
- "types": "./dist/tlkrc/index.d.ts",
67
- "import": "./dist/tlkrc/index.js",
68
- "require": "./dist/tlkrc/index.js"
69
- },
70
- "./env": {
71
- "types": "./dist/env/index.d.ts",
72
- "import": "./dist/env/index.js",
73
- "require": "./dist/env/index.js"
18
+ "default": "./dist/delegation/index.js"
74
19
  },
75
20
  "./agentshield-api": {
76
21
  "types": "./dist/agentshield-api/index.d.ts",
77
- "import": "./dist/agentshield-api/index.js",
78
- "require": "./dist/agentshield-api/index.js"
22
+ "default": "./dist/agentshield-api/index.js"
79
23
  },
80
- "./audit": {
81
- "types": "./dist/audit/index.d.ts",
82
- "import": "./dist/audit/index.js",
83
- "require": "./dist/audit/index.js"
24
+ "./runtime": {
25
+ "types": "./dist/runtime/index.d.ts",
26
+ "default": "./dist/runtime/index.js"
27
+ },
28
+ "./proof": {
29
+ "types": "./dist/proof/index.d.ts",
30
+ "default": "./dist/proof/index.js"
84
31
  },
85
32
  "./tool-protection": {
86
33
  "types": "./dist/tool-protection/index.d.ts",
87
- "import": "./dist/tool-protection/index.js",
88
- "require": "./dist/tool-protection/index.js"
89
- },
90
- "./well-known": {
91
- "types": "./dist/well-known/index.d.ts",
92
- "import": "./dist/well-known/index.js",
93
- "require": "./dist/well-known/index.js"
34
+ "default": "./dist/tool-protection/index.js"
94
35
  },
95
36
  "./config": {
96
37
  "types": "./dist/config/index.d.ts",
97
- "import": "./dist/config/index.js",
98
- "require": "./dist/config/index.js"
99
- },
100
- "./dashboard-config": {
101
- "types": "./dist/dashboard-config/index.d.ts",
102
- "import": "./dist/dashboard-config/index.js",
103
- "require": "./dist/dashboard-config/index.js"
38
+ "default": "./dist/config/index.js"
104
39
  },
105
- "./consent": {
106
- "types": "./dist/consent/index.d.ts",
107
- "import": "./dist/consent/index.js",
108
- "require": "./dist/consent/index.js"
40
+ "./audit": {
41
+ "types": "./dist/audit/index.d.ts",
42
+ "default": "./dist/audit/index.js"
109
43
  }
110
44
  },
111
- "files": [
112
- "dist/**/*.js",
113
- "dist/**/*.d.ts",
114
- "!dist/**/*.map",
115
- "!dist/**/__tests__/**",
116
- "!dist/**/__fixtures__/**",
117
- "!dist/**/*.spec.*",
118
- "!dist/**/*.test.*",
119
- "!README.md",
120
- "!*.md",
121
- "!CHANGELOG.md"
122
- ],
123
45
  "scripts": {
124
46
  "build": "tsc -p tsconfig.build.json && npm run emit-schemas",
125
47
  "emit-schemas": "node scripts/emit-schemas.js",
126
- "clean": "rm -rf dist && rm -f *.tsbuildinfo",
127
- "dev": "tsc -p tsconfig.build.json --watch",
128
- "type-check": "tsc --noEmit",
129
48
  "test": "vitest run",
130
- "test:watch": "vitest",
131
49
  "test:coverage": "vitest run --coverage",
132
- "prepublishOnly": "npm run build && node ../create-mcpi-app/scripts/validate-dependencies.js"
133
- },
134
- "devDependencies": {
135
- "@types/node": "^20.0.0",
136
- "@vitest/coverage-v8": "^4.0.5",
137
- "ajv": "^8.12.0",
138
- "ajv-formats": "^2.1.1",
139
- "fast-check": "^3.15.0",
140
- "typescript": "^5.0.0",
141
- "vitest": "^4.0.5",
142
- "zod-to-json-schema": "^3.22.0"
50
+ "test:watch": "vitest",
51
+ "lint": "eslint .",
52
+ "format": "prettier --write \"src/**/*.{ts,tsx}\"",
53
+ "clean": "rm -rf dist .turbo node_modules",
54
+ "prepublishOnly": "npm run build && node ../create-mcpi-app/scripts/validate-no-workspace.js"
143
55
  },
144
56
  "dependencies": {
145
- "zod": "^3.22.0"
57
+ "zod": "^3.23.8"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "^20.14.9",
61
+ "@vitest/coverage-v8": "^1.6.0",
62
+ "eslint": "^8.57.0",
63
+ "typescript": "^5.5.3",
64
+ "vitest": "^1.6.0"
146
65
  },
147
- "keywords": [
148
- "xmcp",
149
- "mcp",
150
- "identity",
151
- "types",
152
- "contracts"
153
- ],
154
- "author": "KYA OS",
155
- "license": "MIT",
156
- "repository": {
157
- "type": "git",
158
- "url": "https://github.com/kya-os/xmcp-i.git",
159
- "directory": "packages/contracts"
66
+ "publishConfig": {
67
+ "access": "public"
160
68
  }
161
69
  }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schemas.kya-os.ai/xmcp-i/cli/register-output/v1.0.0",
4
+ "title": "XMCP-I CLI Register Output",
5
+ "description": "Schema for mcpi register command JSON output",
6
+ "type": "object",
7
+ "properties": {
8
+ "agentDID": {
9
+ "type": "string",
10
+ "description": "Agent DID",
11
+ "minLength": 1
12
+ },
13
+ "agentURL": {
14
+ "type": "string",
15
+ "format": "uri",
16
+ "description": "Agent URL"
17
+ },
18
+ "agentId": {
19
+ "type": "string",
20
+ "description": "Agent identifier",
21
+ "minLength": 1
22
+ },
23
+ "agentSlug": {
24
+ "type": "string",
25
+ "description": "Agent slug",
26
+ "minLength": 1
27
+ },
28
+ "claimURL": {
29
+ "type": "string",
30
+ "format": "uri",
31
+ "description": "Claim URL (when draft)"
32
+ },
33
+ "verificationEndpoint": {
34
+ "type": "string",
35
+ "format": "uri",
36
+ "description": "Verification endpoint URL"
37
+ },
38
+ "conformanceCapabilities": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string",
42
+ "enum": ["handshake", "signing", "verification"]
43
+ },
44
+ "minItems": 3,
45
+ "maxItems": 3,
46
+ "description": "Exactly the three MCP-I capabilities"
47
+ },
48
+ "mirrorStatus": {
49
+ "type": "string",
50
+ "enum": ["pending", "success", "error"],
51
+ "description": "MCP Registry mirror status"
52
+ },
53
+ "mirrorLink": {
54
+ "type": "string",
55
+ "format": "uri",
56
+ "description": "MCP Registry mirror link"
57
+ }
58
+ },
59
+ "required": [
60
+ "agentDID",
61
+ "agentURL",
62
+ "agentId",
63
+ "agentSlug",
64
+ "verificationEndpoint",
65
+ "conformanceCapabilities",
66
+ "mirrorStatus"
67
+ ],
68
+ "additionalProperties": false
69
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schemas.kya-os.ai/xmcp-i/identity/v1.0.0",
4
+ "title": "MCP-I Identity File",
5
+ "description": "Schema for .mcpi/identity.json file structure used in development mode",
6
+ "type": "object",
7
+ "properties": {
8
+ "version": {
9
+ "type": "string",
10
+ "const": "1.0",
11
+ "description": "Identity file format version"
12
+ },
13
+ "did": {
14
+ "type": "string",
15
+ "pattern": "^did:",
16
+ "description": "Decentralized Identifier (DID) for the agent"
17
+ },
18
+ "kid": {
19
+ "type": "string",
20
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
21
+ "description": "Key identifier in multibase format (z-prefix base58btc)"
22
+ },
23
+ "privateKey": {
24
+ "type": "string",
25
+ "pattern": "^[A-Za-z0-9+/]{43}=$",
26
+ "description": "Base64-encoded Ed25519 private key (32 bytes)"
27
+ },
28
+ "publicKey": {
29
+ "type": "string",
30
+ "pattern": "^[A-Za-z0-9+/]{43}=$",
31
+ "description": "Base64-encoded Ed25519 public key (32 bytes)"
32
+ },
33
+ "createdAt": {
34
+ "type": "string",
35
+ "format": "date-time",
36
+ "description": "ISO 8601 timestamp of identity creation"
37
+ },
38
+ "lastRotated": {
39
+ "type": "string",
40
+ "format": "date-time",
41
+ "description": "ISO 8601 timestamp of last key rotation (optional)"
42
+ }
43
+ },
44
+ "required": ["version", "did", "kid", "privateKey", "publicKey", "createdAt"],
45
+ "additionalProperties": false
46
+ }
@@ -0,0 +1,80 @@
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
+ }
@@ -0,0 +1,60 @@
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
+ }
@@ -0,0 +1,94 @@
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
+ }