@kya-os/contracts 1.3.3 → 1.3.4

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/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/cli.d.ts +0 -375
  12. package/dist/cli.js +0 -109
  13. package/dist/config/base.d.ts +0 -19
  14. package/dist/config/base.js +0 -2
  15. package/dist/config/delegation.d.ts +0 -46
  16. package/dist/config/delegation.js +0 -2
  17. package/dist/config/identity.d.ts +0 -22
  18. package/dist/config/identity.js +0 -2
  19. package/dist/config/index.d.ts +0 -17
  20. package/dist/config/index.js +0 -2
  21. package/dist/config/proofing.d.ts +0 -26
  22. package/dist/config/proofing.js +0 -2
  23. package/dist/config/tool-protection.d.ts +0 -36
  24. package/dist/config/tool-protection.js +0 -2
  25. package/dist/delegation/constraints.d.ts +0 -726
  26. package/dist/delegation/constraints.js +0 -103
  27. package/dist/delegation/index.d.ts +0 -2
  28. package/dist/delegation/index.js +0 -18
  29. package/dist/delegation/schemas.d.ts +0 -8042
  30. package/dist/delegation/schemas.js +0 -232
  31. package/dist/did/index.d.ts +0 -3
  32. package/dist/did/index.js +0 -19
  33. package/dist/did/resolve-contract.d.ts +0 -53
  34. package/dist/did/resolve-contract.js +0 -12
  35. package/dist/did/schemas.d.ts +0 -33
  36. package/dist/did/schemas.js +0 -80
  37. package/dist/did/types.d.ts +0 -38
  38. package/dist/did/types.js +0 -37
  39. package/dist/env/constants.d.ts +0 -13
  40. package/dist/env/constants.js +0 -15
  41. package/dist/env/index.d.ts +0 -1
  42. package/dist/env/index.js +0 -17
  43. package/dist/handshake.d.ts +0 -138
  44. package/dist/handshake.js +0 -50
  45. package/dist/index.d.ts +0 -11
  46. package/dist/index.js +0 -28
  47. package/dist/proof/index.d.ts +0 -2
  48. package/dist/proof/index.js +0 -18
  49. package/dist/proof/proof-record.d.ts +0 -728
  50. package/dist/proof/proof-record.js +0 -60
  51. package/dist/proof/signing-spec.d.ts +0 -73
  52. package/dist/proof/signing-spec.js +0 -52
  53. package/dist/proof.d.ts +0 -378
  54. package/dist/proof.js +0 -59
  55. package/dist/registry.d.ts +0 -326
  56. package/dist/registry.js +0 -98
  57. package/dist/runtime/errors.d.ts +0 -179
  58. package/dist/runtime/errors.js +0 -51
  59. package/dist/runtime/headers.d.ts +0 -34
  60. package/dist/runtime/headers.js +0 -52
  61. package/dist/runtime/index.d.ts +0 -2
  62. package/dist/runtime/index.js +0 -18
  63. package/dist/test.d.ts +0 -215
  64. package/dist/test.js +0 -83
  65. package/dist/tlkrc/index.d.ts +0 -1
  66. package/dist/tlkrc/index.js +0 -17
  67. package/dist/tlkrc/rotation.d.ts +0 -168
  68. package/dist/tlkrc/rotation.js +0 -55
  69. package/dist/tool-protection/index.d.ts +0 -129
  70. package/dist/tool-protection/index.js +0 -80
  71. package/dist/utils/validation.d.ts +0 -14
  72. package/dist/utils/validation.js +0 -56
  73. package/dist/vc/index.d.ts +0 -2
  74. package/dist/vc/index.js +0 -18
  75. package/dist/vc/schemas.d.ts +0 -1888
  76. package/dist/vc/schemas.js +0 -116
  77. package/dist/vc/statuslist.d.ts +0 -292
  78. package/dist/vc/statuslist.js +0 -61
  79. package/dist/verifier.d.ts +0 -202
  80. package/dist/verifier.js +0 -76
  81. package/dist/well-known/index.d.ts +0 -248
  82. package/dist/well-known/index.js +0 -104
@@ -1,92 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.revokeDelegationAPIResponseSchema = exports.revokeDelegationResponseSchema = exports.revokeDelegationRequestSchema = exports.createDelegationAPIResponseSchema = exports.createDelegationResponseSchema = exports.createDelegationRequestSchema = exports.toolProtectionConfigAPIResponseSchema = exports.toolProtectionConfigResponseSchema = exports.agentShieldToolProtectionSchema = exports.verifyDelegationAPIResponseSchema = exports.verifyDelegationResponseSchema = exports.verifyDelegationRequestSchema = exports.delegationCredentialSchema = exports.proofSubmissionResponseSchema = exports.proofSubmissionRequestSchema = exports.agentShieldAPIResponseSchema = exports.agentShieldAPIErrorSchema = void 0;
4
- const zod_1 = require("zod");
5
- const proof_js_1 = require("../proof.js");
6
- const index_js_1 = require("../delegation/index.js");
7
- exports.agentShieldAPIErrorSchema = zod_1.z.object({
8
- code: zod_1.z.string(),
9
- message: zod_1.z.string(),
10
- details: zod_1.z.record(zod_1.z.unknown()).optional(),
11
- });
12
- const agentShieldAPIResponseSchema = (dataSchema) => zod_1.z.object({
13
- success: zod_1.z.boolean(),
14
- data: dataSchema,
15
- metadata: zod_1.z.object({
16
- requestId: zod_1.z.string(),
17
- timestamp: zod_1.z.string(),
18
- }).optional(),
19
- });
20
- exports.agentShieldAPIResponseSchema = agentShieldAPIResponseSchema;
21
- exports.proofSubmissionRequestSchema = zod_1.z.object({
22
- delegation_id: zod_1.z.string().uuid().nullable(),
23
- session_id: zod_1.z.string().uuid(),
24
- proofs: zod_1.z.array(proof_js_1.DetachedProofSchema).min(1),
25
- });
26
- exports.proofSubmissionResponseSchema = zod_1.z.object({
27
- success: zod_1.z.boolean(),
28
- received: zod_1.z.number().int().min(0),
29
- processed: zod_1.z.number().int().min(0),
30
- errors: zod_1.z.array(zod_1.z.object({
31
- proofId: zod_1.z.string(),
32
- error: zod_1.z.string(),
33
- })).optional(),
34
- });
35
- exports.delegationCredentialSchema = zod_1.z.object({
36
- agent_did: zod_1.z.string(),
37
- user_id: zod_1.z.string().optional(),
38
- user_identifier: zod_1.z.string().optional(),
39
- scopes: zod_1.z.array(zod_1.z.string()),
40
- constraints: zod_1.z.record(zod_1.z.unknown()).optional(),
41
- issued_at: zod_1.z.number().int().positive(),
42
- created_at: zod_1.z.number().int().positive(),
43
- });
44
- exports.verifyDelegationRequestSchema = zod_1.z.object({
45
- agent_did: zod_1.z.string(),
46
- scopes: zod_1.z.array(zod_1.z.string()).min(1),
47
- timestamp: zod_1.z.number().int().positive().optional(),
48
- client_info: zod_1.z.object({
49
- ip_address: zod_1.z.string().ip().optional(),
50
- origin: zod_1.z.string().url().optional(),
51
- user_agent: zod_1.z.string().optional(),
52
- }).optional(),
53
- });
54
- exports.verifyDelegationResponseSchema = zod_1.z.object({
55
- valid: zod_1.z.boolean(),
56
- delegation: index_js_1.DelegationRecordSchema.optional(),
57
- delegation_id: zod_1.z.string().uuid().optional(),
58
- credential: exports.delegationCredentialSchema.optional(),
59
- error: exports.agentShieldAPIErrorSchema.optional(),
60
- reason: zod_1.z.string().optional(),
61
- });
62
- exports.verifyDelegationAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.verifyDelegationResponseSchema);
63
- exports.agentShieldToolProtectionSchema = zod_1.z.object({
64
- scopes: zod_1.z.array(zod_1.z.string()),
65
- requires_delegation: zod_1.z.boolean().optional(),
66
- requiresDelegation: zod_1.z.boolean().optional(),
67
- required_scopes: zod_1.z.array(zod_1.z.string()).optional(),
68
- }).passthrough();
69
- exports.toolProtectionConfigResponseSchema = zod_1.z.object({
70
- agent_did: zod_1.z.string(),
71
- tools: zod_1.z.record(zod_1.z.string(), exports.agentShieldToolProtectionSchema),
72
- reputation_threshold: zod_1.z.number().min(0).max(1).optional(),
73
- denied_agents: zod_1.z.array(zod_1.z.string()).optional(),
74
- });
75
- exports.toolProtectionConfigAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.toolProtectionConfigResponseSchema);
76
- exports.createDelegationRequestSchema = zod_1.z.object({
77
- delegation: index_js_1.DelegationRecordSchema,
78
- });
79
- exports.createDelegationResponseSchema = zod_1.z.object({
80
- delegation_id: zod_1.z.string().uuid(),
81
- delegation: index_js_1.DelegationRecordSchema,
82
- });
83
- exports.createDelegationAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.createDelegationResponseSchema);
84
- exports.revokeDelegationRequestSchema = zod_1.z.object({
85
- reason: zod_1.z.string().optional(),
86
- });
87
- exports.revokeDelegationResponseSchema = zod_1.z.object({
88
- delegation_id: zod_1.z.string().uuid(),
89
- revoked: zod_1.z.boolean(),
90
- revoked_at: zod_1.z.number().int().positive(),
91
- });
92
- exports.revokeDelegationAPIResponseSchema = (0, exports.agentShieldAPIResponseSchema)(exports.revokeDelegationResponseSchema);
@@ -1,92 +0,0 @@
1
- import type { DetachedProof } from '../proof.js';
2
- import type { DelegationRecord } from '../delegation/index.js';
3
- export interface AgentShieldAPIResponse<T> {
4
- success: boolean;
5
- data: T;
6
- metadata?: {
7
- requestId: string;
8
- timestamp: string;
9
- };
10
- }
11
- export interface AgentShieldAPIErrorResponse {
12
- code: string;
13
- message: string;
14
- details?: Record<string, unknown>;
15
- }
16
- export interface ProofSubmissionRequest {
17
- delegation_id: string | null;
18
- session_id: string;
19
- proofs: DetachedProof[];
20
- }
21
- export interface ProofSubmissionResponse {
22
- success: boolean;
23
- received: number;
24
- processed: number;
25
- errors?: Array<{
26
- proofId: string;
27
- error: string;
28
- }>;
29
- }
30
- export interface VerifyDelegationRequest {
31
- agent_did: string;
32
- scopes: string[];
33
- timestamp?: number;
34
- client_info?: {
35
- ip_address?: string;
36
- origin?: string;
37
- user_agent?: string;
38
- };
39
- }
40
- export interface DelegationCredential {
41
- agent_did: string;
42
- user_id?: string;
43
- user_identifier?: string;
44
- scopes: string[];
45
- constraints?: Record<string, unknown>;
46
- issued_at: number;
47
- created_at: number;
48
- }
49
- export interface VerifyDelegationResponse {
50
- valid: boolean;
51
- delegation?: DelegationRecord;
52
- delegation_id?: string;
53
- credential?: DelegationCredential;
54
- error?: AgentShieldAPIErrorResponse;
55
- reason?: string;
56
- }
57
- export type VerifyDelegationAPIResponse = AgentShieldAPIResponse<VerifyDelegationResponse>;
58
- export interface AgentShieldToolProtection {
59
- scopes: string[];
60
- requires_delegation?: boolean;
61
- requiresDelegation?: boolean;
62
- required_scopes?: string[];
63
- }
64
- export interface ToolProtectionConfigResponse {
65
- agent_did: string;
66
- tools: Record<string, AgentShieldToolProtection>;
67
- reputation_threshold?: number;
68
- denied_agents?: string[];
69
- }
70
- export type ToolProtectionConfigAPIResponse = AgentShieldAPIResponse<ToolProtectionConfigResponse>;
71
- export interface CreateDelegationRequest {
72
- delegation: DelegationRecord;
73
- }
74
- export interface CreateDelegationResponse {
75
- delegation_id: string;
76
- delegation: DelegationRecord;
77
- }
78
- export type CreateDelegationAPIResponse = AgentShieldAPIResponse<CreateDelegationResponse>;
79
- export interface RevokeDelegationRequest {
80
- reason?: string;
81
- }
82
- export interface RevokeDelegationResponse {
83
- delegation_id: string;
84
- revoked: boolean;
85
- revoked_at: number;
86
- }
87
- export type RevokeDelegationAPIResponse = AgentShieldAPIResponse<RevokeDelegationResponse>;
88
- export declare class AgentShieldAPIError extends Error {
89
- readonly code: string;
90
- readonly details?: Record<string, unknown> | undefined;
91
- constructor(code: string, message: string, details?: Record<string, unknown> | undefined);
92
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgentShieldAPIError = void 0;
4
- class AgentShieldAPIError extends Error {
5
- constructor(code, message, details) {
6
- super(message);
7
- this.code = code;
8
- this.details = details;
9
- this.name = 'AgentShieldAPIError';
10
- }
11
- }
12
- exports.AgentShieldAPIError = AgentShieldAPIError;
package/dist/cli.d.ts DELETED
@@ -1,375 +0,0 @@
1
- import { z } from "zod";
2
- export declare const CLIIdentityFileSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
3
- version: z.ZodLiteral<"1.0">;
4
- did: z.ZodString;
5
- kid: z.ZodOptional<z.ZodString>;
6
- keyId: z.ZodOptional<z.ZodString>;
7
- privateKey: z.ZodString;
8
- publicKey: z.ZodString;
9
- createdAt: z.ZodString;
10
- lastRotated: z.ZodOptional<z.ZodString>;
11
- }, "strip", z.ZodTypeAny, {
12
- version: "1.0";
13
- did: string;
14
- privateKey: string;
15
- publicKey: string;
16
- createdAt: string;
17
- kid?: string | undefined;
18
- keyId?: string | undefined;
19
- lastRotated?: string | undefined;
20
- }, {
21
- version: "1.0";
22
- did: string;
23
- privateKey: string;
24
- publicKey: string;
25
- createdAt: string;
26
- kid?: string | undefined;
27
- keyId?: string | undefined;
28
- lastRotated?: string | undefined;
29
- }>, {
30
- version: "1.0";
31
- did: string;
32
- privateKey: string;
33
- publicKey: string;
34
- createdAt: string;
35
- kid?: string | undefined;
36
- keyId?: string | undefined;
37
- lastRotated?: string | undefined;
38
- }, {
39
- version: "1.0";
40
- did: string;
41
- privateKey: string;
42
- publicKey: string;
43
- createdAt: string;
44
- kid?: string | undefined;
45
- keyId?: string | undefined;
46
- lastRotated?: string | undefined;
47
- }>, {
48
- version: "1.0";
49
- did: string;
50
- kid: string;
51
- privateKey: string;
52
- publicKey: string;
53
- createdAt: string;
54
- lastRotated: string | undefined;
55
- }, {
56
- version: "1.0";
57
- did: string;
58
- privateKey: string;
59
- publicKey: string;
60
- createdAt: string;
61
- kid?: string | undefined;
62
- keyId?: string | undefined;
63
- lastRotated?: string | undefined;
64
- }>;
65
- export declare const KeyRotationResultSchema: z.ZodObject<{
66
- success: z.ZodBoolean;
67
- oldKeyId: z.ZodString;
68
- newKeyId: z.ZodString;
69
- did: z.ZodString;
70
- mode: z.ZodEnum<["dev", "prod"]>;
71
- delegated: z.ZodBoolean;
72
- forced: z.ZodBoolean;
73
- auditLine: z.ZodString;
74
- }, "strip", z.ZodTypeAny, {
75
- did: string;
76
- success: boolean;
77
- oldKeyId: string;
78
- newKeyId: string;
79
- mode: "dev" | "prod";
80
- delegated: boolean;
81
- forced: boolean;
82
- auditLine: string;
83
- }, {
84
- did: string;
85
- success: boolean;
86
- oldKeyId: string;
87
- newKeyId: string;
88
- mode: "dev" | "prod";
89
- delegated: boolean;
90
- forced: boolean;
91
- auditLine: string;
92
- }>;
93
- export declare const StatusReportSchema: z.ZodObject<{
94
- did: z.ZodString;
95
- kid: z.ZodString;
96
- ktaURL: z.ZodString;
97
- mirrorStatus: z.ZodEnum<["pending", "success", "error"]>;
98
- lastHandshake: z.ZodOptional<z.ZodNumber>;
99
- environment: z.ZodEnum<["dev", "prod"]>;
100
- }, "strip", z.ZodTypeAny, {
101
- did: string;
102
- kid: string;
103
- ktaURL: string;
104
- mirrorStatus: "success" | "pending" | "error";
105
- environment: "dev" | "prod";
106
- lastHandshake?: number | undefined;
107
- }, {
108
- did: string;
109
- kid: string;
110
- ktaURL: string;
111
- mirrorStatus: "success" | "pending" | "error";
112
- environment: "dev" | "prod";
113
- lastHandshake?: number | undefined;
114
- }>;
115
- export declare const PackageInfoSchema: z.ZodObject<{
116
- name: z.ZodString;
117
- version: z.ZodString;
118
- compatible: z.ZodBoolean;
119
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
120
- }, "strip", z.ZodTypeAny, {
121
- version: string;
122
- name: string;
123
- compatible: boolean;
124
- issues?: string[] | undefined;
125
- }, {
126
- version: string;
127
- name: string;
128
- compatible: boolean;
129
- issues?: string[] | undefined;
130
- }>;
131
- export declare const XMCPUpstreamInfoSchema: z.ZodObject<{
132
- version: z.ZodString;
133
- compatible: z.ZodBoolean;
134
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
135
- }, "strip", z.ZodTypeAny, {
136
- version: string;
137
- compatible: boolean;
138
- issues?: string[] | undefined;
139
- }, {
140
- version: string;
141
- compatible: boolean;
142
- issues?: string[] | undefined;
143
- }>;
144
- export declare const EnvironmentInfoSchema: z.ZodObject<{
145
- valid: z.ZodBoolean;
146
- missing: z.ZodArray<z.ZodString, "many">;
147
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
148
- }, "strip", z.ZodTypeAny, {
149
- valid: boolean;
150
- missing: string[];
151
- issues?: string[] | undefined;
152
- }, {
153
- valid: boolean;
154
- missing: string[];
155
- issues?: string[] | undefined;
156
- }>;
157
- export declare const KTAInfoSchema: z.ZodObject<{
158
- reachable: z.ZodBoolean;
159
- authenticated: z.ZodBoolean;
160
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
161
- }, "strip", z.ZodTypeAny, {
162
- reachable: boolean;
163
- authenticated: boolean;
164
- issues?: string[] | undefined;
165
- }, {
166
- reachable: boolean;
167
- authenticated: boolean;
168
- issues?: string[] | undefined;
169
- }>;
170
- export declare const CacheInfoSchema: z.ZodObject<{
171
- type: z.ZodString;
172
- functional: z.ZodBoolean;
173
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
174
- }, "strip", z.ZodTypeAny, {
175
- type: string;
176
- functional: boolean;
177
- issues?: string[] | undefined;
178
- }, {
179
- type: string;
180
- functional: boolean;
181
- issues?: string[] | undefined;
182
- }>;
183
- export declare const DoctorResultSchema: z.ZodObject<{
184
- packages: z.ZodArray<z.ZodObject<{
185
- name: z.ZodString;
186
- version: z.ZodString;
187
- compatible: z.ZodBoolean;
188
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
189
- }, "strip", z.ZodTypeAny, {
190
- version: string;
191
- name: string;
192
- compatible: boolean;
193
- issues?: string[] | undefined;
194
- }, {
195
- version: string;
196
- name: string;
197
- compatible: boolean;
198
- issues?: string[] | undefined;
199
- }>, "many">;
200
- xmcpUpstream: z.ZodObject<{
201
- version: z.ZodString;
202
- compatible: z.ZodBoolean;
203
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
204
- }, "strip", z.ZodTypeAny, {
205
- version: string;
206
- compatible: boolean;
207
- issues?: string[] | undefined;
208
- }, {
209
- version: string;
210
- compatible: boolean;
211
- issues?: string[] | undefined;
212
- }>;
213
- environment: z.ZodObject<{
214
- valid: z.ZodBoolean;
215
- missing: z.ZodArray<z.ZodString, "many">;
216
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
217
- }, "strip", z.ZodTypeAny, {
218
- valid: boolean;
219
- missing: string[];
220
- issues?: string[] | undefined;
221
- }, {
222
- valid: boolean;
223
- missing: string[];
224
- issues?: string[] | undefined;
225
- }>;
226
- kta: z.ZodObject<{
227
- reachable: z.ZodBoolean;
228
- authenticated: z.ZodBoolean;
229
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
230
- }, "strip", z.ZodTypeAny, {
231
- reachable: boolean;
232
- authenticated: boolean;
233
- issues?: string[] | undefined;
234
- }, {
235
- reachable: boolean;
236
- authenticated: boolean;
237
- issues?: string[] | undefined;
238
- }>;
239
- cache: z.ZodObject<{
240
- type: z.ZodString;
241
- functional: z.ZodBoolean;
242
- issues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
243
- }, "strip", z.ZodTypeAny, {
244
- type: string;
245
- functional: boolean;
246
- issues?: string[] | undefined;
247
- }, {
248
- type: string;
249
- functional: boolean;
250
- issues?: string[] | undefined;
251
- }>;
252
- }, "strip", z.ZodTypeAny, {
253
- environment: {
254
- valid: boolean;
255
- missing: string[];
256
- issues?: string[] | undefined;
257
- };
258
- packages: {
259
- version: string;
260
- name: string;
261
- compatible: boolean;
262
- issues?: string[] | undefined;
263
- }[];
264
- xmcpUpstream: {
265
- version: string;
266
- compatible: boolean;
267
- issues?: string[] | undefined;
268
- };
269
- kta: {
270
- reachable: boolean;
271
- authenticated: boolean;
272
- issues?: string[] | undefined;
273
- };
274
- cache: {
275
- type: string;
276
- functional: boolean;
277
- issues?: string[] | undefined;
278
- };
279
- }, {
280
- environment: {
281
- valid: boolean;
282
- missing: string[];
283
- issues?: string[] | undefined;
284
- };
285
- packages: {
286
- version: string;
287
- name: string;
288
- compatible: boolean;
289
- issues?: string[] | undefined;
290
- }[];
291
- xmcpUpstream: {
292
- version: string;
293
- compatible: boolean;
294
- issues?: string[] | undefined;
295
- };
296
- kta: {
297
- reachable: boolean;
298
- authenticated: boolean;
299
- issues?: string[] | undefined;
300
- };
301
- cache: {
302
- type: string;
303
- functional: boolean;
304
- issues?: string[] | undefined;
305
- };
306
- }>;
307
- export declare const ScaffolderOptionsSchema: z.ZodObject<{
308
- projectName: z.ZodString;
309
- xmcpVersion: z.ZodOptional<z.ZodString>;
310
- xmcpChannel: z.ZodOptional<z.ZodEnum<["latest", "next"]>>;
311
- noIdentity: z.ZodDefault<z.ZodBoolean>;
312
- }, "strip", z.ZodTypeAny, {
313
- projectName: string;
314
- noIdentity: boolean;
315
- xmcpVersion?: string | undefined;
316
- xmcpChannel?: "latest" | "next" | undefined;
317
- }, {
318
- projectName: string;
319
- xmcpVersion?: string | undefined;
320
- xmcpChannel?: "latest" | "next" | undefined;
321
- noIdentity?: boolean | undefined;
322
- }>;
323
- export declare const ScaffolderResultSchema: z.ZodObject<{
324
- success: z.ZodBoolean;
325
- projectPath: z.ZodString;
326
- xmcpVersion: z.ZodString;
327
- identityEnabled: z.ZodBoolean;
328
- warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
329
- }, "strip", z.ZodTypeAny, {
330
- success: boolean;
331
- xmcpVersion: string;
332
- projectPath: string;
333
- identityEnabled: boolean;
334
- warnings?: string[] | undefined;
335
- }, {
336
- success: boolean;
337
- xmcpVersion: string;
338
- projectPath: string;
339
- identityEnabled: boolean;
340
- warnings?: string[] | undefined;
341
- }>;
342
- export type CLIIdentityFile = z.infer<typeof CLIIdentityFileSchema>;
343
- export type KeyRotationResult = z.infer<typeof KeyRotationResultSchema>;
344
- export type StatusReport = z.infer<typeof StatusReportSchema>;
345
- export type PackageInfo = z.infer<typeof PackageInfoSchema>;
346
- export type XMCPUpstreamInfo = z.infer<typeof XMCPUpstreamInfoSchema>;
347
- export type EnvironmentInfo = z.infer<typeof EnvironmentInfoSchema>;
348
- export type KTAInfo = z.infer<typeof KTAInfoSchema>;
349
- export type CacheInfo = z.infer<typeof CacheInfoSchema>;
350
- export type DoctorResult = z.infer<typeof DoctorResultSchema>;
351
- export type ScaffolderOptions = z.infer<typeof ScaffolderOptionsSchema>;
352
- export type ScaffolderResult = z.infer<typeof ScaffolderResultSchema>;
353
- export type IdentityConfig = CLIIdentityFile;
354
- export declare const ERROR_CODES: {
355
- readonly XMCP_I_EBADPROOF: "XMCP_I_EBADPROOF";
356
- readonly XMCP_I_ENOIDENTITY: "XMCP_I_ENOIDENTITY";
357
- readonly XMCP_I_EMIRRORPENDING: "XMCP_I_EMIRRORPENDING";
358
- readonly XMCP_I_EHANDSHAKE: "XMCP_I_EHANDSHAKE";
359
- readonly XMCP_I_ESESSION: "XMCP_I_ESESSION";
360
- readonly XMCP_I_ECLAIM: "XMCP_I_ECLAIM";
361
- readonly XMCP_I_ECONFIG: "XMCP_I_ECONFIG";
362
- readonly XMCP_I_ERUNTIME: "XMCP_I_ERUNTIME";
363
- };
364
- export type ErrorCode = keyof typeof ERROR_CODES;
365
- export declare const CLI_EXIT_CODES: {
366
- readonly SUCCESS: 0;
367
- readonly GENERAL_ERROR: 1;
368
- readonly BADPROOF: 20;
369
- readonly NOIDENTITY: 21;
370
- readonly HANDSHAKE: 22;
371
- readonly SESSION: 23;
372
- readonly CLAIM: 24;
373
- readonly CONFIG: 25;
374
- readonly RUNTIME: 26;
375
- };
package/dist/cli.js DELETED
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLI_EXIT_CODES = exports.ERROR_CODES = exports.ScaffolderResultSchema = exports.ScaffolderOptionsSchema = exports.DoctorResultSchema = exports.CacheInfoSchema = exports.KTAInfoSchema = exports.EnvironmentInfoSchema = exports.XMCPUpstreamInfoSchema = exports.PackageInfoSchema = exports.StatusReportSchema = exports.KeyRotationResultSchema = exports.CLIIdentityFileSchema = void 0;
4
- const zod_1 = require("zod");
5
- exports.CLIIdentityFileSchema = zod_1.z.object({
6
- version: zod_1.z.literal("1.0"),
7
- did: zod_1.z.string().min(1),
8
- kid: zod_1.z.string().min(1).optional(),
9
- keyId: zod_1.z.string().min(1).optional(),
10
- privateKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 private key (44 characters)"),
11
- publicKey: zod_1.z.string().regex(/^[A-Za-z0-9+/]{43}=$/, "Must be a valid base64-encoded Ed25519 public key (44 characters)"),
12
- createdAt: zod_1.z.string().datetime(),
13
- lastRotated: zod_1.z.string().datetime().optional(),
14
- }).refine((data) => data.kid || data.keyId, {
15
- message: "Either kid or keyId must be provided",
16
- }).transform((data) => ({
17
- version: data.version,
18
- did: data.did,
19
- kid: data.kid || data.keyId,
20
- privateKey: data.privateKey,
21
- publicKey: data.publicKey,
22
- createdAt: data.createdAt,
23
- lastRotated: data.lastRotated,
24
- }));
25
- exports.KeyRotationResultSchema = zod_1.z.object({
26
- success: zod_1.z.boolean(),
27
- oldKeyId: zod_1.z.string().min(1),
28
- newKeyId: zod_1.z.string().min(1),
29
- did: zod_1.z.string().min(1),
30
- mode: zod_1.z.enum(["dev", "prod"]),
31
- delegated: zod_1.z.boolean(),
32
- forced: zod_1.z.boolean(),
33
- auditLine: zod_1.z.string().min(1),
34
- });
35
- exports.StatusReportSchema = zod_1.z.object({
36
- did: zod_1.z.string().min(1),
37
- kid: zod_1.z.string().min(1),
38
- ktaURL: zod_1.z.string().url(),
39
- mirrorStatus: zod_1.z.enum(["pending", "success", "error"]),
40
- lastHandshake: zod_1.z.number().int().positive().optional(),
41
- environment: zod_1.z.enum(["dev", "prod"]),
42
- });
43
- exports.PackageInfoSchema = zod_1.z.object({
44
- name: zod_1.z.string(),
45
- version: zod_1.z.string(),
46
- compatible: zod_1.z.boolean(),
47
- issues: zod_1.z.array(zod_1.z.string()).optional(),
48
- });
49
- exports.XMCPUpstreamInfoSchema = zod_1.z.object({
50
- version: zod_1.z.string(),
51
- compatible: zod_1.z.boolean(),
52
- issues: zod_1.z.array(zod_1.z.string()).optional(),
53
- });
54
- exports.EnvironmentInfoSchema = zod_1.z.object({
55
- valid: zod_1.z.boolean(),
56
- missing: zod_1.z.array(zod_1.z.string()),
57
- issues: zod_1.z.array(zod_1.z.string()).optional(),
58
- });
59
- exports.KTAInfoSchema = zod_1.z.object({
60
- reachable: zod_1.z.boolean(),
61
- authenticated: zod_1.z.boolean(),
62
- issues: zod_1.z.array(zod_1.z.string()).optional(),
63
- });
64
- exports.CacheInfoSchema = zod_1.z.object({
65
- type: zod_1.z.string(),
66
- functional: zod_1.z.boolean(),
67
- issues: zod_1.z.array(zod_1.z.string()).optional(),
68
- });
69
- exports.DoctorResultSchema = zod_1.z.object({
70
- packages: zod_1.z.array(exports.PackageInfoSchema),
71
- xmcpUpstream: exports.XMCPUpstreamInfoSchema,
72
- environment: exports.EnvironmentInfoSchema,
73
- kta: exports.KTAInfoSchema,
74
- cache: exports.CacheInfoSchema,
75
- });
76
- exports.ScaffolderOptionsSchema = zod_1.z.object({
77
- projectName: zod_1.z.string().min(1),
78
- xmcpVersion: zod_1.z.string().optional(),
79
- xmcpChannel: zod_1.z.enum(["latest", "next"]).optional(),
80
- noIdentity: zod_1.z.boolean().default(false),
81
- });
82
- exports.ScaffolderResultSchema = zod_1.z.object({
83
- success: zod_1.z.boolean(),
84
- projectPath: zod_1.z.string().min(1),
85
- xmcpVersion: zod_1.z.string().min(1),
86
- identityEnabled: zod_1.z.boolean(),
87
- warnings: zod_1.z.array(zod_1.z.string()).optional(),
88
- });
89
- exports.ERROR_CODES = {
90
- XMCP_I_EBADPROOF: "XMCP_I_EBADPROOF",
91
- XMCP_I_ENOIDENTITY: "XMCP_I_ENOIDENTITY",
92
- XMCP_I_EMIRRORPENDING: "XMCP_I_EMIRRORPENDING",
93
- XMCP_I_EHANDSHAKE: "XMCP_I_EHANDSHAKE",
94
- XMCP_I_ESESSION: "XMCP_I_ESESSION",
95
- XMCP_I_ECLAIM: "XMCP_I_ECLAIM",
96
- XMCP_I_ECONFIG: "XMCP_I_ECONFIG",
97
- XMCP_I_ERUNTIME: "XMCP_I_ERUNTIME",
98
- };
99
- exports.CLI_EXIT_CODES = {
100
- SUCCESS: 0,
101
- GENERAL_ERROR: 1,
102
- BADPROOF: 20,
103
- NOIDENTITY: 21,
104
- HANDSHAKE: 22,
105
- SESSION: 23,
106
- CLAIM: 24,
107
- CONFIG: 25,
108
- RUNTIME: 26,
109
- };
@@ -1,19 +0,0 @@
1
- export interface MCPIBaseConfig {
2
- environment: 'development' | 'production';
3
- session?: {
4
- timestampSkewSeconds?: number;
5
- ttlMinutes?: number;
6
- absoluteLifetime?: number;
7
- };
8
- audit?: {
9
- enabled: boolean;
10
- includeProofHashes?: boolean;
11
- includePayloads?: boolean;
12
- logFunction?: (record: string) => void;
13
- };
14
- wellKnown?: {
15
- enabled: boolean;
16
- serviceName?: string;
17
- serviceEndpoint?: string;
18
- };
19
- }