@kya-os/contracts 1.3.4 → 1.4.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 (87) hide show
  1. package/dist/agentshield-api/endpoints.d.ts +50 -0
  2. package/dist/agentshield-api/endpoints.js +46 -0
  3. package/dist/agentshield-api/index.d.ts +13 -0
  4. package/dist/agentshield-api/index.js +38 -0
  5. package/dist/agentshield-api/schemas.d.ts +9914 -0
  6. package/dist/agentshield-api/schemas.js +165 -0
  7. package/dist/agentshield-api/types.d.ts +168 -0
  8. package/dist/agentshield-api/types.js +27 -0
  9. package/dist/cli.d.ts +388 -0
  10. package/dist/cli.js +121 -0
  11. package/dist/config/base.d.ts +96 -0
  12. package/dist/config/base.js +11 -0
  13. package/dist/config/delegation.d.ts +194 -0
  14. package/dist/config/delegation.js +10 -0
  15. package/dist/config/identity.d.ts +117 -0
  16. package/dist/config/identity.js +11 -0
  17. package/dist/config/index.d.ts +33 -0
  18. package/dist/config/index.js +11 -0
  19. package/dist/config/proofing.d.ts +120 -0
  20. package/dist/config/proofing.js +10 -0
  21. package/dist/config/tool-protection.d.ts +139 -0
  22. package/dist/config/tool-protection.js +10 -0
  23. package/dist/dashboard-config/index.d.ts +10 -0
  24. package/dist/dashboard-config/index.js +31 -0
  25. package/dist/dashboard-config/schemas.d.ts +5847 -0
  26. package/dist/dashboard-config/schemas.js +251 -0
  27. package/dist/dashboard-config/types.d.ts +331 -0
  28. package/dist/dashboard-config/types.js +11 -0
  29. package/dist/delegation/constraints.d.ts +991 -0
  30. package/dist/delegation/constraints.js +209 -0
  31. package/dist/delegation/index.d.ts +7 -0
  32. package/dist/delegation/index.js +23 -0
  33. package/dist/delegation/schemas.d.ts +8381 -0
  34. package/dist/delegation/schemas.js +475 -0
  35. package/dist/did/index.d.ts +8 -0
  36. package/dist/did/index.js +24 -0
  37. package/dist/did/resolve-contract.d.ts +219 -0
  38. package/dist/did/resolve-contract.js +31 -0
  39. package/dist/did/schemas.d.ts +112 -0
  40. package/dist/did/schemas.js +172 -0
  41. package/dist/did/types.d.ts +163 -0
  42. package/dist/did/types.js +70 -0
  43. package/dist/env/constants.d.ts +57 -0
  44. package/dist/env/constants.js +59 -0
  45. package/dist/env/index.d.ts +4 -0
  46. package/dist/env/index.js +20 -0
  47. package/dist/handshake.d.ts +158 -0
  48. package/dist/handshake.js +57 -0
  49. package/dist/index.d.ts +25 -0
  50. package/dist/index.js +56 -0
  51. package/dist/proof/index.d.ts +8 -0
  52. package/dist/proof/index.js +24 -0
  53. package/dist/proof/proof-record.d.ts +837 -0
  54. package/dist/proof/proof-record.js +133 -0
  55. package/dist/proof/signing-spec.d.ts +146 -0
  56. package/dist/proof/signing-spec.js +122 -0
  57. package/dist/proof.d.ts +415 -0
  58. package/dist/proof.js +83 -0
  59. package/dist/registry.d.ts +342 -0
  60. package/dist/registry.js +118 -0
  61. package/dist/runtime/errors.d.ts +347 -0
  62. package/dist/runtime/errors.js +119 -0
  63. package/dist/runtime/headers.d.ts +83 -0
  64. package/dist/runtime/headers.js +81 -0
  65. package/dist/runtime/index.d.ts +5 -0
  66. package/dist/runtime/index.js +21 -0
  67. package/dist/test.d.ts +251 -0
  68. package/dist/test.js +119 -0
  69. package/dist/tlkrc/index.d.ts +4 -0
  70. package/dist/tlkrc/index.js +20 -0
  71. package/dist/tlkrc/rotation.d.ts +245 -0
  72. package/dist/tlkrc/rotation.js +126 -0
  73. package/dist/tool-protection/index.d.ts +227 -0
  74. package/dist/tool-protection/index.js +113 -0
  75. package/dist/utils/validation.d.ts +30 -0
  76. package/dist/utils/validation.js +69 -0
  77. package/dist/vc/index.d.ts +7 -0
  78. package/dist/vc/index.js +23 -0
  79. package/dist/vc/schemas.d.ts +2483 -0
  80. package/dist/vc/schemas.js +224 -0
  81. package/dist/vc/statuslist.d.ts +493 -0
  82. package/dist/vc/statuslist.js +132 -0
  83. package/dist/verifier.d.ts +205 -0
  84. package/dist/verifier.js +83 -0
  85. package/dist/well-known/index.d.ts +308 -0
  86. package/dist/well-known/index.js +134 -0
  87. package/package.json +6 -1
@@ -0,0 +1,342 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Registry integration schemas (Know-That-AI and MCP Registry)
4
+ */
5
+ export declare const RegistrationInputSchema: z.ZodObject<{
6
+ agentDID: z.ZodString;
7
+ agentURL: z.ZodString;
8
+ verificationEndpoint: z.ZodString;
9
+ conformanceCapabilities: z.ZodArray<z.ZodEnum<["handshake", "signing", "verification"]>, "many">;
10
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ agentDID: string;
13
+ agentURL: string;
14
+ verificationEndpoint: string;
15
+ conformanceCapabilities: ("handshake" | "signing" | "verification")[];
16
+ metadata?: Record<string, any> | undefined;
17
+ }, {
18
+ agentDID: string;
19
+ agentURL: string;
20
+ verificationEndpoint: string;
21
+ conformanceCapabilities: ("handshake" | "signing" | "verification")[];
22
+ metadata?: Record<string, any> | undefined;
23
+ }>;
24
+ export declare const RegistrationResultSchema: z.ZodObject<{
25
+ agentDID: z.ZodString;
26
+ agentURL: z.ZodString;
27
+ agentId: z.ZodString;
28
+ agentSlug: z.ZodString;
29
+ claimURL: z.ZodOptional<z.ZodString>;
30
+ verificationEndpoint: z.ZodString;
31
+ conformanceCapabilities: z.ZodTuple<[z.ZodLiteral<"handshake">, z.ZodLiteral<"signing">, z.ZodLiteral<"verification">], null>;
32
+ mirrorStatus: z.ZodEnum<["pending", "success", "error"]>;
33
+ mirrorLink: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ mirrorStatus: "success" | "pending" | "error";
36
+ agentDID: string;
37
+ agentURL: string;
38
+ verificationEndpoint: string;
39
+ conformanceCapabilities: ["handshake", "signing", "verification"];
40
+ agentId: string;
41
+ agentSlug: string;
42
+ claimURL?: string | undefined;
43
+ mirrorLink?: string | undefined;
44
+ }, {
45
+ mirrorStatus: "success" | "pending" | "error";
46
+ agentDID: string;
47
+ agentURL: string;
48
+ verificationEndpoint: string;
49
+ conformanceCapabilities: ["handshake", "signing", "verification"];
50
+ agentId: string;
51
+ agentSlug: string;
52
+ claimURL?: string | undefined;
53
+ mirrorLink?: string | undefined;
54
+ }>;
55
+ export declare const ClaimTokenSchema: z.ZodObject<{
56
+ token: z.ZodString;
57
+ expiresAt: z.ZodNumber;
58
+ ttlHours: z.ZodDefault<z.ZodNumber>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ expiresAt: number;
61
+ token: string;
62
+ ttlHours: number;
63
+ }, {
64
+ expiresAt: number;
65
+ token: string;
66
+ ttlHours?: number | undefined;
67
+ }>;
68
+ export declare const MirrorStatusSchema: z.ZodObject<{
69
+ status: z.ZodEnum<["pending", "success", "error"]>;
70
+ lastUpdated: z.ZodNumber;
71
+ errorMessage: z.ZodOptional<z.ZodString>;
72
+ registryURL: z.ZodOptional<z.ZodString>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ status: "success" | "pending" | "error";
75
+ lastUpdated: number;
76
+ errorMessage?: string | undefined;
77
+ registryURL?: string | undefined;
78
+ }, {
79
+ status: "success" | "pending" | "error";
80
+ lastUpdated: number;
81
+ errorMessage?: string | undefined;
82
+ registryURL?: string | undefined;
83
+ }>;
84
+ export declare const AgentStatusSchema: z.ZodObject<{
85
+ did: z.ZodString;
86
+ kid: z.ZodString;
87
+ ktaURL: z.ZodString;
88
+ mirrorStatus: z.ZodObject<{
89
+ status: z.ZodEnum<["pending", "success", "error"]>;
90
+ lastUpdated: z.ZodNumber;
91
+ errorMessage: z.ZodOptional<z.ZodString>;
92
+ registryURL: z.ZodOptional<z.ZodString>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ status: "success" | "pending" | "error";
95
+ lastUpdated: number;
96
+ errorMessage?: string | undefined;
97
+ registryURL?: string | undefined;
98
+ }, {
99
+ status: "success" | "pending" | "error";
100
+ lastUpdated: number;
101
+ errorMessage?: string | undefined;
102
+ registryURL?: string | undefined;
103
+ }>;
104
+ lastHandshake: z.ZodOptional<z.ZodNumber>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ did: string;
107
+ kid: string;
108
+ ktaURL: string;
109
+ mirrorStatus: {
110
+ status: "success" | "pending" | "error";
111
+ lastUpdated: number;
112
+ errorMessage?: string | undefined;
113
+ registryURL?: string | undefined;
114
+ };
115
+ lastHandshake?: number | undefined;
116
+ }, {
117
+ did: string;
118
+ kid: string;
119
+ ktaURL: string;
120
+ mirrorStatus: {
121
+ status: "success" | "pending" | "error";
122
+ lastUpdated: number;
123
+ errorMessage?: string | undefined;
124
+ registryURL?: string | undefined;
125
+ };
126
+ lastHandshake?: number | undefined;
127
+ }>;
128
+ /**
129
+ * Delegation schemas for verifiable credentials
130
+ */
131
+ export declare const DelegationSchema: z.ZodObject<{
132
+ issuer: z.ZodString;
133
+ subject: z.ZodString;
134
+ scopes: z.ZodArray<z.ZodString, "many">;
135
+ nbf: z.ZodNumber;
136
+ exp: z.ZodNumber;
137
+ aud: z.ZodOptional<z.ZodString>;
138
+ delegationRef: z.ZodOptional<z.ZodString>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ subject: string;
141
+ scopes: string[];
142
+ issuer: string;
143
+ nbf: number;
144
+ exp: number;
145
+ delegationRef?: string | undefined;
146
+ aud?: string | undefined;
147
+ }, {
148
+ subject: string;
149
+ scopes: string[];
150
+ issuer: string;
151
+ nbf: number;
152
+ exp: number;
153
+ delegationRef?: string | undefined;
154
+ aud?: string | undefined;
155
+ }>;
156
+ export declare const DelegationRequestSchema: z.ZodObject<{
157
+ subject: z.ZodString;
158
+ scopes: z.ZodArray<z.ZodString, "many">;
159
+ duration: z.ZodOptional<z.ZodNumber>;
160
+ audience: z.ZodOptional<z.ZodString>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ subject: string;
163
+ scopes: string[];
164
+ audience?: string | undefined;
165
+ duration?: number | undefined;
166
+ }, {
167
+ subject: string;
168
+ scopes: string[];
169
+ audience?: string | undefined;
170
+ duration?: number | undefined;
171
+ }>;
172
+ /**
173
+ * Storage mode configuration for verifiable credentials and delegations
174
+ */
175
+ export declare const StorageModeSchema: z.ZodEnum<["ktaEncrypted", "hybridReceiptsOnly", "selfHostedAuthoritative"]>;
176
+ /**
177
+ * Receipt object returned by KTA for verifiable operations
178
+ * Schema ID: https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json
179
+ */
180
+ export declare const ReceiptSchema: z.ZodObject<{
181
+ $schema: z.ZodOptional<z.ZodLiteral<"https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json">>;
182
+ ref: z.ZodString;
183
+ contentHash: z.ZodString;
184
+ action: z.ZodEnum<["issue", "revoke"]>;
185
+ ts: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
186
+ logIndex: z.ZodNumber;
187
+ logRoot: z.ZodString;
188
+ inclusionProof: z.ZodArray<z.ZodString, "many">;
189
+ }, "strip", z.ZodTypeAny, {
190
+ ts: string | number;
191
+ ref: string;
192
+ contentHash: string;
193
+ action: "issue" | "revoke";
194
+ logIndex: number;
195
+ logRoot: string;
196
+ inclusionProof: string[];
197
+ $schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
198
+ }, {
199
+ ts: string | number;
200
+ ref: string;
201
+ contentHash: string;
202
+ action: "issue" | "revoke";
203
+ logIndex: number;
204
+ logRoot: string;
205
+ inclusionProof: string[];
206
+ $schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
207
+ }>;
208
+ export declare const DelegationResponseSchema: z.ZodObject<{
209
+ delegation: z.ZodObject<{
210
+ issuer: z.ZodString;
211
+ subject: z.ZodString;
212
+ scopes: z.ZodArray<z.ZodString, "many">;
213
+ nbf: z.ZodNumber;
214
+ exp: z.ZodNumber;
215
+ aud: z.ZodOptional<z.ZodString>;
216
+ delegationRef: z.ZodOptional<z.ZodString>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ subject: string;
219
+ scopes: string[];
220
+ issuer: string;
221
+ nbf: number;
222
+ exp: number;
223
+ delegationRef?: string | undefined;
224
+ aud?: string | undefined;
225
+ }, {
226
+ subject: string;
227
+ scopes: string[];
228
+ issuer: string;
229
+ nbf: number;
230
+ exp: number;
231
+ delegationRef?: string | undefined;
232
+ aud?: string | undefined;
233
+ }>;
234
+ receipt: z.ZodObject<{
235
+ $schema: z.ZodOptional<z.ZodLiteral<"https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json">>;
236
+ ref: z.ZodString;
237
+ contentHash: z.ZodString;
238
+ action: z.ZodEnum<["issue", "revoke"]>;
239
+ ts: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
240
+ logIndex: z.ZodNumber;
241
+ logRoot: z.ZodString;
242
+ inclusionProof: z.ZodArray<z.ZodString, "many">;
243
+ }, "strip", z.ZodTypeAny, {
244
+ ts: string | number;
245
+ ref: string;
246
+ contentHash: string;
247
+ action: "issue" | "revoke";
248
+ logIndex: number;
249
+ logRoot: string;
250
+ inclusionProof: string[];
251
+ $schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
252
+ }, {
253
+ ts: string | number;
254
+ ref: string;
255
+ contentHash: string;
256
+ action: "issue" | "revoke";
257
+ logIndex: number;
258
+ logRoot: string;
259
+ inclusionProof: string[];
260
+ $schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
261
+ }>;
262
+ encryptedPayload: z.ZodOptional<z.ZodString>;
263
+ }, "strip", z.ZodTypeAny, {
264
+ delegation: {
265
+ subject: string;
266
+ scopes: string[];
267
+ issuer: string;
268
+ nbf: number;
269
+ exp: number;
270
+ delegationRef?: string | undefined;
271
+ aud?: string | undefined;
272
+ };
273
+ receipt: {
274
+ ts: string | number;
275
+ ref: string;
276
+ contentHash: string;
277
+ action: "issue" | "revoke";
278
+ logIndex: number;
279
+ logRoot: string;
280
+ inclusionProof: string[];
281
+ $schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
282
+ };
283
+ encryptedPayload?: string | undefined;
284
+ }, {
285
+ delegation: {
286
+ subject: string;
287
+ scopes: string[];
288
+ issuer: string;
289
+ nbf: number;
290
+ exp: number;
291
+ delegationRef?: string | undefined;
292
+ aud?: string | undefined;
293
+ };
294
+ receipt: {
295
+ ts: string | number;
296
+ ref: string;
297
+ contentHash: string;
298
+ action: "issue" | "revoke";
299
+ logIndex: number;
300
+ logRoot: string;
301
+ inclusionProof: string[];
302
+ $schema?: "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json" | undefined;
303
+ };
304
+ encryptedPayload?: string | undefined;
305
+ }>;
306
+ /**
307
+ * Storage configuration for different deployment modes
308
+ */
309
+ export declare const StorageConfigSchema: z.ZodObject<{
310
+ mode: z.ZodEnum<["ktaEncrypted", "hybridReceiptsOnly", "selfHostedAuthoritative"]>;
311
+ encryptionEnabled: z.ZodDefault<z.ZodBoolean>;
312
+ receiptVerificationEnabled: z.ZodDefault<z.ZodBoolean>;
313
+ ktaBaseURL: z.ZodDefault<z.ZodString>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ mode: "ktaEncrypted" | "hybridReceiptsOnly" | "selfHostedAuthoritative";
316
+ encryptionEnabled: boolean;
317
+ receiptVerificationEnabled: boolean;
318
+ ktaBaseURL: string;
319
+ }, {
320
+ mode: "ktaEncrypted" | "hybridReceiptsOnly" | "selfHostedAuthoritative";
321
+ encryptionEnabled?: boolean | undefined;
322
+ receiptVerificationEnabled?: boolean | undefined;
323
+ ktaBaseURL?: string | undefined;
324
+ }>;
325
+ export type RegistrationInput = z.infer<typeof RegistrationInputSchema>;
326
+ export type RegistrationResult = z.infer<typeof RegistrationResultSchema>;
327
+ export type ClaimToken = z.infer<typeof ClaimTokenSchema>;
328
+ export type MirrorStatus = z.infer<typeof MirrorStatusSchema>;
329
+ export type AgentStatus = z.infer<typeof AgentStatusSchema>;
330
+ export type StorageMode = z.infer<typeof StorageModeSchema>;
331
+ export type Receipt = z.infer<typeof ReceiptSchema>;
332
+ export type StorageConfig = z.infer<typeof StorageConfigSchema>;
333
+ export type Delegation = z.infer<typeof DelegationSchema>;
334
+ export type DelegationRequest = z.infer<typeof DelegationRequestSchema>;
335
+ export type DelegationResponse = z.infer<typeof DelegationResponseSchema>;
336
+ export declare const MCP_I_CAPABILITIES: readonly ["handshake", "signing", "verification"];
337
+ export declare const CLAIM_TOKEN_TTL_HOURS = 24;
338
+ export declare const KTA_BASE_URL = "https://knowthat.ai";
339
+ export declare const DEFAULT_STORAGE_MODE: StorageMode;
340
+ export declare const STORAGE_MODE_ENV_VAR = "MCPI_STORAGE_MODE";
341
+ export declare const RECEIPT_SCHEMA_ID = "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json";
342
+ export declare const CONTENT_HASH_REGEX: RegExp;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTENT_HASH_REGEX = exports.RECEIPT_SCHEMA_ID = exports.STORAGE_MODE_ENV_VAR = exports.DEFAULT_STORAGE_MODE = exports.KTA_BASE_URL = exports.CLAIM_TOKEN_TTL_HOURS = exports.MCP_I_CAPABILITIES = exports.StorageConfigSchema = exports.DelegationResponseSchema = exports.ReceiptSchema = exports.StorageModeSchema = exports.DelegationRequestSchema = exports.DelegationSchema = exports.AgentStatusSchema = exports.MirrorStatusSchema = exports.ClaimTokenSchema = exports.RegistrationResultSchema = exports.RegistrationInputSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Registry integration schemas (Know-That-AI and MCP Registry)
7
+ */
8
+ exports.RegistrationInputSchema = zod_1.z.object({
9
+ agentDID: zod_1.z.string().min(1),
10
+ agentURL: zod_1.z.string().url(),
11
+ verificationEndpoint: zod_1.z.string().url(),
12
+ conformanceCapabilities: zod_1.z.array(zod_1.z.enum(["handshake", "signing", "verification"])),
13
+ metadata: zod_1.z.record(zod_1.z.any()).optional(),
14
+ });
15
+ exports.RegistrationResultSchema = zod_1.z.object({
16
+ agentDID: zod_1.z.string().min(1),
17
+ agentURL: zod_1.z.string().url(),
18
+ agentId: zod_1.z.string().min(1),
19
+ agentSlug: zod_1.z.string().min(1),
20
+ claimURL: zod_1.z.string().url().optional(),
21
+ verificationEndpoint: zod_1.z.string().url(),
22
+ conformanceCapabilities: zod_1.z.tuple([
23
+ zod_1.z.literal("handshake"),
24
+ zod_1.z.literal("signing"),
25
+ zod_1.z.literal("verification"),
26
+ ]),
27
+ mirrorStatus: zod_1.z.enum(["pending", "success", "error"]),
28
+ mirrorLink: zod_1.z.string().url().optional(),
29
+ });
30
+ exports.ClaimTokenSchema = zod_1.z.object({
31
+ token: zod_1.z.string().min(1),
32
+ expiresAt: zod_1.z.number().int().positive(),
33
+ ttlHours: zod_1.z.number().int().positive().default(24),
34
+ });
35
+ exports.MirrorStatusSchema = zod_1.z.object({
36
+ status: zod_1.z.enum(["pending", "success", "error"]),
37
+ lastUpdated: zod_1.z.number().int().positive(),
38
+ errorMessage: zod_1.z.string().optional(),
39
+ registryURL: zod_1.z.string().url().optional(),
40
+ });
41
+ exports.AgentStatusSchema = zod_1.z.object({
42
+ did: zod_1.z.string().min(1),
43
+ kid: zod_1.z.string().min(1),
44
+ ktaURL: zod_1.z.string().url(),
45
+ mirrorStatus: exports.MirrorStatusSchema,
46
+ lastHandshake: zod_1.z.number().int().positive().optional(),
47
+ });
48
+ /**
49
+ * Delegation schemas for verifiable credentials
50
+ */
51
+ exports.DelegationSchema = zod_1.z.object({
52
+ issuer: zod_1.z.string().min(1), // DID of the issuer
53
+ subject: zod_1.z.string().min(1), // DID of the subject
54
+ scopes: zod_1.z.array(zod_1.z.string()),
55
+ nbf: zod_1.z.number().int().positive(), // Not before (unix timestamp)
56
+ exp: zod_1.z.number().int().positive(), // Expires (unix timestamp)
57
+ aud: zod_1.z.string().optional(), // Audience (optional)
58
+ delegationRef: zod_1.z.string().optional(), // Reference to parent delegation
59
+ });
60
+ exports.DelegationRequestSchema = zod_1.z.object({
61
+ subject: zod_1.z.string().min(1),
62
+ scopes: zod_1.z.array(zod_1.z.string()),
63
+ duration: zod_1.z.number().int().positive().optional(), // Duration in seconds
64
+ audience: zod_1.z.string().optional(),
65
+ });
66
+ /**
67
+ * Storage mode configuration for verifiable credentials and delegations
68
+ */
69
+ exports.StorageModeSchema = zod_1.z.enum([
70
+ "ktaEncrypted",
71
+ "hybridReceiptsOnly",
72
+ "selfHostedAuthoritative",
73
+ ]);
74
+ /**
75
+ * Receipt object returned by KTA for verifiable operations
76
+ * Schema ID: https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json
77
+ */
78
+ exports.ReceiptSchema = zod_1.z.object({
79
+ $schema: zod_1.z
80
+ .literal("https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json")
81
+ .optional(),
82
+ ref: zod_1.z.string().min(1),
83
+ contentHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
84
+ action: zod_1.z.enum(["issue", "revoke"]),
85
+ // Back-compat: accept ISO string (preferred) or legacy epoch number
86
+ ts: zod_1.z.union([zod_1.z.string().datetime(), zod_1.z.number().int().positive()]),
87
+ logIndex: zod_1.z.number().int().nonnegative(),
88
+ logRoot: zod_1.z.string().min(1),
89
+ inclusionProof: zod_1.z.array(zod_1.z.string()),
90
+ });
91
+ exports.DelegationResponseSchema = zod_1.z.object({
92
+ delegation: exports.DelegationSchema,
93
+ receipt: exports.ReceiptSchema,
94
+ encryptedPayload: zod_1.z.string().optional(), // For ktaEncrypted mode
95
+ });
96
+ /**
97
+ * Storage configuration for different deployment modes
98
+ */
99
+ exports.StorageConfigSchema = zod_1.z.object({
100
+ mode: exports.StorageModeSchema,
101
+ encryptionEnabled: zod_1.z.boolean().default(false),
102
+ receiptVerificationEnabled: zod_1.z.boolean().default(true),
103
+ ktaBaseURL: zod_1.z.string().url().default("https://knowthat.ai"),
104
+ });
105
+ // Constants
106
+ exports.MCP_I_CAPABILITIES = [
107
+ "handshake",
108
+ "signing",
109
+ "verification",
110
+ ];
111
+ exports.CLAIM_TOKEN_TTL_HOURS = 24;
112
+ exports.KTA_BASE_URL = "https://knowthat.ai"; // Placeholder for docs/tests
113
+ // Storage mode constants
114
+ exports.DEFAULT_STORAGE_MODE = "ktaEncrypted";
115
+ exports.STORAGE_MODE_ENV_VAR = "MCPI_STORAGE_MODE";
116
+ // Receipt schema constants
117
+ exports.RECEIPT_SCHEMA_ID = "https://schemas.kya-os.ai/mcpi/receipt/v1.0.0.json";
118
+ exports.CONTENT_HASH_REGEX = /^sha256:[a-f0-9]{64}$/;