@kya-os/contracts 1.3.3 → 1.3.5

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 (66) hide show
  1. package/package.json +3 -2
  2. package/README.md +0 -130
  3. package/dist/agentshield-api/endpoints.d.ts +0 -21
  4. package/dist/agentshield-api/endpoints.js +0 -20
  5. package/dist/agentshield-api/index.d.ts +0 -5
  6. package/dist/agentshield-api/index.js +0 -27
  7. package/dist/agentshield-api/schemas.d.ts +0 -9846
  8. package/dist/agentshield-api/schemas.js +0 -92
  9. package/dist/agentshield-api/types.d.ts +0 -92
  10. package/dist/agentshield-api/types.js +0 -12
  11. package/dist/config/base.d.ts +0 -19
  12. package/dist/config/base.js +0 -2
  13. package/dist/config/delegation.d.ts +0 -46
  14. package/dist/config/delegation.js +0 -2
  15. package/dist/config/identity.d.ts +0 -22
  16. package/dist/config/identity.js +0 -2
  17. package/dist/config/index.d.ts +0 -17
  18. package/dist/config/index.js +0 -2
  19. package/dist/config/proofing.d.ts +0 -26
  20. package/dist/config/proofing.js +0 -2
  21. package/dist/config/tool-protection.d.ts +0 -36
  22. package/dist/config/tool-protection.js +0 -2
  23. package/dist/delegation/constraints.d.ts +0 -726
  24. package/dist/delegation/constraints.js +0 -103
  25. package/dist/delegation/index.d.ts +0 -2
  26. package/dist/delegation/index.js +0 -18
  27. package/dist/delegation/schemas.d.ts +0 -8042
  28. package/dist/delegation/schemas.js +0 -232
  29. package/dist/did/index.d.ts +0 -3
  30. package/dist/did/index.js +0 -19
  31. package/dist/did/resolve-contract.d.ts +0 -53
  32. package/dist/did/resolve-contract.js +0 -12
  33. package/dist/did/schemas.d.ts +0 -33
  34. package/dist/did/schemas.js +0 -80
  35. package/dist/did/types.d.ts +0 -38
  36. package/dist/did/types.js +0 -37
  37. package/dist/env/constants.d.ts +0 -13
  38. package/dist/env/constants.js +0 -15
  39. package/dist/env/index.d.ts +0 -1
  40. package/dist/env/index.js +0 -17
  41. package/dist/proof/index.d.ts +0 -2
  42. package/dist/proof/index.js +0 -18
  43. package/dist/proof/proof-record.d.ts +0 -728
  44. package/dist/proof/proof-record.js +0 -60
  45. package/dist/proof/signing-spec.d.ts +0 -73
  46. package/dist/proof/signing-spec.js +0 -52
  47. package/dist/runtime/errors.d.ts +0 -179
  48. package/dist/runtime/errors.js +0 -51
  49. package/dist/runtime/headers.d.ts +0 -34
  50. package/dist/runtime/headers.js +0 -52
  51. package/dist/runtime/index.d.ts +0 -2
  52. package/dist/runtime/index.js +0 -18
  53. package/dist/tlkrc/index.d.ts +0 -1
  54. package/dist/tlkrc/index.js +0 -17
  55. package/dist/tlkrc/rotation.d.ts +0 -168
  56. package/dist/tlkrc/rotation.js +0 -55
  57. package/dist/tool-protection/index.d.ts +0 -129
  58. package/dist/tool-protection/index.js +0 -80
  59. package/dist/vc/index.d.ts +0 -2
  60. package/dist/vc/index.js +0 -18
  61. package/dist/vc/schemas.d.ts +0 -1888
  62. package/dist/vc/schemas.js +0 -116
  63. package/dist/vc/statuslist.d.ts +0 -292
  64. package/dist/vc/statuslist.js +0 -61
  65. package/dist/well-known/index.d.ts +0 -248
  66. package/dist/well-known/index.js +0 -104
@@ -1,248 +0,0 @@
1
- import { z } from 'zod';
2
- export interface DIDDocument {
3
- '@context': string[];
4
- id: string;
5
- verificationMethod: Array<{
6
- id: string;
7
- type: string;
8
- controller: string;
9
- publicKeyBase64?: string;
10
- publicKeyMultibase?: string;
11
- }>;
12
- authentication?: string[];
13
- assertionMethod?: string[];
14
- capabilityInvocation?: string[];
15
- capabilityDelegation?: string[];
16
- keyAgreement?: string[];
17
- service?: Array<{
18
- id: string;
19
- type: string;
20
- serviceEndpoint: string;
21
- }>;
22
- }
23
- export interface AgentDocument {
24
- id: string;
25
- capabilities: {
26
- 'mcp-i': Array<'handshake' | 'signing' | 'verification' | 'delegation' | 'proof-generation'>;
27
- [key: string]: string[];
28
- };
29
- metadata?: {
30
- name?: string;
31
- serviceEndpoint?: string;
32
- version?: string;
33
- description?: string;
34
- };
35
- }
36
- export interface MCPIdentity {
37
- did: string;
38
- publicKey: string;
39
- serviceName: string;
40
- serviceEndpoint: string;
41
- timestamp: number;
42
- metadata?: Record<string, unknown>;
43
- }
44
- export interface WellKnownConfig {
45
- serviceName?: string;
46
- serviceEndpoint?: string;
47
- metadata?: Record<string, unknown>;
48
- }
49
- export interface WellKnownResponse {
50
- status: number;
51
- headers: Record<string, string>;
52
- body: string;
53
- }
54
- export declare enum WellKnownPath {
55
- DID_DOCUMENT = "/.well-known/did.json",
56
- AGENT_DOCUMENT = "/.well-known/agent.json",
57
- MCP_IDENTITY = "/.well-known/mcp-identity",
58
- TOOL_PROTECTIONS = "/.well-known/tool-protections.json"
59
- }
60
- export declare const DIDDocumentSchema: z.ZodObject<{
61
- '@context': z.ZodArray<z.ZodString, "many">;
62
- id: z.ZodString;
63
- verificationMethod: z.ZodArray<z.ZodObject<{
64
- id: z.ZodString;
65
- type: z.ZodString;
66
- controller: z.ZodString;
67
- publicKeyBase64: z.ZodOptional<z.ZodString>;
68
- publicKeyMultibase: z.ZodOptional<z.ZodString>;
69
- }, "strip", z.ZodTypeAny, {
70
- type: string;
71
- id: string;
72
- controller: string;
73
- publicKeyMultibase?: string | undefined;
74
- publicKeyBase64?: string | undefined;
75
- }, {
76
- type: string;
77
- id: string;
78
- controller: string;
79
- publicKeyMultibase?: string | undefined;
80
- publicKeyBase64?: string | undefined;
81
- }>, "many">;
82
- authentication: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
83
- assertionMethod: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
84
- capabilityInvocation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
85
- capabilityDelegation: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
86
- keyAgreement: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
87
- service: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
- id: z.ZodString;
89
- type: z.ZodString;
90
- serviceEndpoint: z.ZodString;
91
- }, "strip", z.ZodTypeAny, {
92
- type: string;
93
- id: string;
94
- serviceEndpoint: string;
95
- }, {
96
- type: string;
97
- id: string;
98
- serviceEndpoint: string;
99
- }>, "many">>;
100
- }, "strip", z.ZodTypeAny, {
101
- id: string;
102
- verificationMethod: {
103
- type: string;
104
- id: string;
105
- controller: string;
106
- publicKeyMultibase?: string | undefined;
107
- publicKeyBase64?: string | undefined;
108
- }[];
109
- '@context': string[];
110
- authentication?: string[] | undefined;
111
- assertionMethod?: string[] | undefined;
112
- keyAgreement?: string[] | undefined;
113
- capabilityInvocation?: string[] | undefined;
114
- capabilityDelegation?: string[] | undefined;
115
- service?: {
116
- type: string;
117
- id: string;
118
- serviceEndpoint: string;
119
- }[] | undefined;
120
- }, {
121
- id: string;
122
- verificationMethod: {
123
- type: string;
124
- id: string;
125
- controller: string;
126
- publicKeyMultibase?: string | undefined;
127
- publicKeyBase64?: string | undefined;
128
- }[];
129
- '@context': string[];
130
- authentication?: string[] | undefined;
131
- assertionMethod?: string[] | undefined;
132
- keyAgreement?: string[] | undefined;
133
- capabilityInvocation?: string[] | undefined;
134
- capabilityDelegation?: string[] | undefined;
135
- service?: {
136
- type: string;
137
- id: string;
138
- serviceEndpoint: string;
139
- }[] | undefined;
140
- }>;
141
- export declare const AgentDocumentSchema: z.ZodObject<{
142
- id: z.ZodString;
143
- capabilities: z.ZodObject<{
144
- 'mcp-i': z.ZodArray<z.ZodEnum<["handshake", "signing", "verification", "delegation", "proof-generation"]>, "many">;
145
- }, "strip", z.ZodArray<z.ZodString, "many">, z.objectOutputType<{
146
- 'mcp-i': z.ZodArray<z.ZodEnum<["handshake", "signing", "verification", "delegation", "proof-generation"]>, "many">;
147
- }, z.ZodArray<z.ZodString, "many">, "strip">, z.objectInputType<{
148
- 'mcp-i': z.ZodArray<z.ZodEnum<["handshake", "signing", "verification", "delegation", "proof-generation"]>, "many">;
149
- }, z.ZodArray<z.ZodString, "many">, "strip">>;
150
- metadata: z.ZodOptional<z.ZodObject<{
151
- name: z.ZodOptional<z.ZodString>;
152
- serviceEndpoint: z.ZodOptional<z.ZodString>;
153
- version: z.ZodOptional<z.ZodString>;
154
- description: z.ZodOptional<z.ZodString>;
155
- }, "strip", z.ZodTypeAny, {
156
- version?: string | undefined;
157
- name?: string | undefined;
158
- serviceEndpoint?: string | undefined;
159
- description?: string | undefined;
160
- }, {
161
- version?: string | undefined;
162
- name?: string | undefined;
163
- serviceEndpoint?: string | undefined;
164
- description?: string | undefined;
165
- }>>;
166
- }, "strip", z.ZodTypeAny, {
167
- id: string;
168
- capabilities: {
169
- 'mcp-i': ("handshake" | "signing" | "verification" | "delegation" | "proof-generation")[];
170
- } & {
171
- [k: string]: string[];
172
- };
173
- metadata?: {
174
- version?: string | undefined;
175
- name?: string | undefined;
176
- serviceEndpoint?: string | undefined;
177
- description?: string | undefined;
178
- } | undefined;
179
- }, {
180
- id: string;
181
- capabilities: {
182
- 'mcp-i': ("handshake" | "signing" | "verification" | "delegation" | "proof-generation")[];
183
- } & {
184
- [k: string]: string[];
185
- };
186
- metadata?: {
187
- version?: string | undefined;
188
- name?: string | undefined;
189
- serviceEndpoint?: string | undefined;
190
- description?: string | undefined;
191
- } | undefined;
192
- }>;
193
- export declare const MCPIdentitySchema: z.ZodObject<{
194
- did: z.ZodString;
195
- publicKey: z.ZodString;
196
- serviceName: z.ZodString;
197
- serviceEndpoint: z.ZodString;
198
- timestamp: z.ZodNumber;
199
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
200
- }, "strip", z.ZodTypeAny, {
201
- did: string;
202
- publicKey: string;
203
- timestamp: number;
204
- serviceEndpoint: string;
205
- serviceName: string;
206
- metadata?: Record<string, unknown> | undefined;
207
- }, {
208
- did: string;
209
- publicKey: string;
210
- timestamp: number;
211
- serviceEndpoint: string;
212
- serviceName: string;
213
- metadata?: Record<string, unknown> | undefined;
214
- }>;
215
- export declare const WellKnownConfigSchema: z.ZodObject<{
216
- serviceName: z.ZodOptional<z.ZodString>;
217
- serviceEndpoint: z.ZodOptional<z.ZodString>;
218
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
219
- }, "strip", z.ZodTypeAny, {
220
- metadata?: Record<string, unknown> | undefined;
221
- serviceEndpoint?: string | undefined;
222
- serviceName?: string | undefined;
223
- }, {
224
- metadata?: Record<string, unknown> | undefined;
225
- serviceEndpoint?: string | undefined;
226
- serviceName?: string | undefined;
227
- }>;
228
- export declare const WellKnownResponseSchema: z.ZodObject<{
229
- status: z.ZodNumber;
230
- headers: z.ZodRecord<z.ZodString, z.ZodString>;
231
- body: z.ZodString;
232
- }, "strip", z.ZodTypeAny, {
233
- status: number;
234
- headers: Record<string, string>;
235
- body: string;
236
- }, {
237
- status: number;
238
- headers: Record<string, string>;
239
- body: string;
240
- }>;
241
- export declare function isDIDDocument(obj: any): obj is DIDDocument;
242
- export declare function isAgentDocument(obj: any): obj is AgentDocument;
243
- export declare function isMCPIdentity(obj: any): obj is MCPIdentity;
244
- export declare function validateDIDDocument(obj: any): DIDDocument;
245
- export declare function validateAgentDocument(obj: any): AgentDocument;
246
- export declare function validateMCPIdentity(obj: any): MCPIdentity;
247
- export declare function isWellKnownPath(path: string): boolean;
248
- export declare function getWellKnownContentType(path: WellKnownPath | string): string;
@@ -1,104 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WellKnownResponseSchema = exports.WellKnownConfigSchema = exports.MCPIdentitySchema = exports.AgentDocumentSchema = exports.DIDDocumentSchema = exports.WellKnownPath = void 0;
4
- exports.isDIDDocument = isDIDDocument;
5
- exports.isAgentDocument = isAgentDocument;
6
- exports.isMCPIdentity = isMCPIdentity;
7
- exports.validateDIDDocument = validateDIDDocument;
8
- exports.validateAgentDocument = validateAgentDocument;
9
- exports.validateMCPIdentity = validateMCPIdentity;
10
- exports.isWellKnownPath = isWellKnownPath;
11
- exports.getWellKnownContentType = getWellKnownContentType;
12
- const zod_1 = require("zod");
13
- var WellKnownPath;
14
- (function (WellKnownPath) {
15
- WellKnownPath["DID_DOCUMENT"] = "/.well-known/did.json";
16
- WellKnownPath["AGENT_DOCUMENT"] = "/.well-known/agent.json";
17
- WellKnownPath["MCP_IDENTITY"] = "/.well-known/mcp-identity";
18
- WellKnownPath["TOOL_PROTECTIONS"] = "/.well-known/tool-protections.json";
19
- })(WellKnownPath || (exports.WellKnownPath = WellKnownPath = {}));
20
- exports.DIDDocumentSchema = zod_1.z.object({
21
- '@context': zod_1.z.array(zod_1.z.string()),
22
- id: zod_1.z.string(),
23
- verificationMethod: zod_1.z.array(zod_1.z.object({
24
- id: zod_1.z.string(),
25
- type: zod_1.z.string(),
26
- controller: zod_1.z.string(),
27
- publicKeyBase64: zod_1.z.string().optional(),
28
- publicKeyMultibase: zod_1.z.string().optional()
29
- })),
30
- authentication: zod_1.z.array(zod_1.z.string()).optional(),
31
- assertionMethod: zod_1.z.array(zod_1.z.string()).optional(),
32
- capabilityInvocation: zod_1.z.array(zod_1.z.string()).optional(),
33
- capabilityDelegation: zod_1.z.array(zod_1.z.string()).optional(),
34
- keyAgreement: zod_1.z.array(zod_1.z.string()).optional(),
35
- service: zod_1.z.array(zod_1.z.object({
36
- id: zod_1.z.string(),
37
- type: zod_1.z.string(),
38
- serviceEndpoint: zod_1.z.string()
39
- })).optional()
40
- });
41
- exports.AgentDocumentSchema = zod_1.z.object({
42
- id: zod_1.z.string(),
43
- capabilities: zod_1.z.object({
44
- 'mcp-i': zod_1.z.array(zod_1.z.enum(['handshake', 'signing', 'verification', 'delegation', 'proof-generation']))
45
- }).catchall(zod_1.z.array(zod_1.z.string())),
46
- metadata: zod_1.z.object({
47
- name: zod_1.z.string().optional(),
48
- serviceEndpoint: zod_1.z.string().optional(),
49
- version: zod_1.z.string().optional(),
50
- description: zod_1.z.string().optional()
51
- }).optional()
52
- });
53
- exports.MCPIdentitySchema = zod_1.z.object({
54
- did: zod_1.z.string(),
55
- publicKey: zod_1.z.string(),
56
- serviceName: zod_1.z.string(),
57
- serviceEndpoint: zod_1.z.string(),
58
- timestamp: zod_1.z.number(),
59
- metadata: zod_1.z.record(zod_1.z.unknown()).optional()
60
- });
61
- exports.WellKnownConfigSchema = zod_1.z.object({
62
- serviceName: zod_1.z.string().optional(),
63
- serviceEndpoint: zod_1.z.string().optional(),
64
- metadata: zod_1.z.record(zod_1.z.unknown()).optional()
65
- });
66
- exports.WellKnownResponseSchema = zod_1.z.object({
67
- status: zod_1.z.number(),
68
- headers: zod_1.z.record(zod_1.z.string()),
69
- body: zod_1.z.string()
70
- });
71
- function isDIDDocument(obj) {
72
- return exports.DIDDocumentSchema.safeParse(obj).success;
73
- }
74
- function isAgentDocument(obj) {
75
- return exports.AgentDocumentSchema.safeParse(obj).success;
76
- }
77
- function isMCPIdentity(obj) {
78
- return exports.MCPIdentitySchema.safeParse(obj).success;
79
- }
80
- function validateDIDDocument(obj) {
81
- return exports.DIDDocumentSchema.parse(obj);
82
- }
83
- function validateAgentDocument(obj) {
84
- return exports.AgentDocumentSchema.parse(obj);
85
- }
86
- function validateMCPIdentity(obj) {
87
- return exports.MCPIdentitySchema.parse(obj);
88
- }
89
- function isWellKnownPath(path) {
90
- return Object.values(WellKnownPath).includes(path);
91
- }
92
- function getWellKnownContentType(path) {
93
- switch (path) {
94
- case WellKnownPath.DID_DOCUMENT:
95
- return 'application/did+json';
96
- case WellKnownPath.AGENT_DOCUMENT:
97
- case WellKnownPath.TOOL_PROTECTIONS:
98
- return 'application/json';
99
- case WellKnownPath.MCP_IDENTITY:
100
- return 'application/json';
101
- default:
102
- return 'application/json';
103
- }
104
- }