@kya-os/contracts 1.5.2-canary.2 → 1.5.2-canary.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.
- package/package.json +5 -5
- package/dist/agentshield-api/endpoints.d.ts +0 -51
- package/dist/agentshield-api/endpoints.js +0 -47
- package/dist/agentshield-api/index.d.ts +0 -13
- package/dist/agentshield-api/index.js +0 -37
- package/dist/agentshield-api/schemas.d.ts +0 -9985
- package/dist/agentshield-api/schemas.js +0 -164
- package/dist/agentshield-api/types.d.ts +0 -169
- package/dist/agentshield-api/types.js +0 -26
- package/dist/cli.d.ts +0 -388
- package/dist/cli.js +0 -121
- package/dist/config/base.d.ts +0 -96
- package/dist/config/base.js +0 -11
- package/dist/config/builder.d.ts +0 -34
- package/dist/config/builder.js +0 -75
- package/dist/config/delegation.d.ts +0 -194
- package/dist/config/delegation.js +0 -10
- package/dist/config/identity.d.ts +0 -117
- package/dist/config/identity.js +0 -11
- package/dist/config/index.d.ts +0 -35
- package/dist/config/index.js +0 -15
- package/dist/config/proofing.d.ts +0 -120
- package/dist/config/proofing.js +0 -10
- package/dist/config/tool-protection.d.ts +0 -139
- package/dist/config/tool-protection.js +0 -10
- package/dist/consent/index.d.ts +0 -6
- package/dist/consent/index.js +0 -22
- package/dist/consent/schemas.d.ts +0 -738
- package/dist/consent/schemas.js +0 -186
- package/dist/consent/types.d.ts +0 -155
- package/dist/consent/types.js +0 -10
- package/dist/dashboard-config/default-config.d.ts +0 -50
- package/dist/dashboard-config/default-config.js +0 -241
- package/dist/dashboard-config/index.d.ts +0 -11
- package/dist/dashboard-config/index.js +0 -36
- package/dist/dashboard-config/schemas.d.ts +0 -5905
- package/dist/dashboard-config/schemas.js +0 -255
- package/dist/dashboard-config/types.d.ts +0 -338
- package/dist/dashboard-config/types.js +0 -11
- package/dist/delegation/constraints.d.ts +0 -1022
- package/dist/delegation/constraints.js +0 -219
- package/dist/delegation/index.d.ts +0 -7
- package/dist/delegation/index.js +0 -24
- package/dist/delegation/schemas.d.ts +0 -8458
- package/dist/delegation/schemas.js +0 -476
- package/dist/did/index.d.ts +0 -8
- package/dist/did/index.js +0 -24
- package/dist/did/resolve-contract.d.ts +0 -219
- package/dist/did/resolve-contract.js +0 -31
- package/dist/did/schemas.d.ts +0 -112
- package/dist/did/schemas.js +0 -172
- package/dist/did/types.d.ts +0 -163
- package/dist/did/types.js +0 -70
- package/dist/env/constants.d.ts +0 -57
- package/dist/env/constants.js +0 -59
- package/dist/env/index.d.ts +0 -4
- package/dist/env/index.js +0 -20
- package/dist/handshake.d.ts +0 -167
- package/dist/handshake.js +0 -60
- package/dist/index.d.ts +0 -25
- package/dist/index.js +0 -55
- package/dist/proof/index.d.ts +0 -8
- package/dist/proof/index.js +0 -24
- package/dist/proof/proof-record.d.ts +0 -837
- package/dist/proof/proof-record.js +0 -133
- package/dist/proof/signing-spec.d.ts +0 -146
- package/dist/proof/signing-spec.js +0 -122
- package/dist/proof.d.ts +0 -415
- package/dist/proof.js +0 -83
- package/dist/registry.d.ts +0 -342
- package/dist/registry.js +0 -118
- package/dist/runtime/errors.d.ts +0 -347
- package/dist/runtime/errors.js +0 -119
- package/dist/runtime/headers.d.ts +0 -83
- package/dist/runtime/headers.js +0 -81
- package/dist/runtime/index.d.ts +0 -5
- package/dist/runtime/index.js +0 -21
- package/dist/test.d.ts +0 -251
- package/dist/test.js +0 -119
- package/dist/tlkrc/index.d.ts +0 -4
- package/dist/tlkrc/index.js +0 -20
- package/dist/tlkrc/rotation.d.ts +0 -245
- package/dist/tlkrc/rotation.js +0 -126
- package/dist/tool-protection/index.d.ts +0 -227
- package/dist/tool-protection/index.js +0 -113
- package/dist/utils/validation.d.ts +0 -30
- package/dist/utils/validation.js +0 -69
- package/dist/vc/index.d.ts +0 -7
- package/dist/vc/index.js +0 -23
- package/dist/vc/schemas.d.ts +0 -2483
- package/dist/vc/schemas.js +0 -224
- package/dist/vc/statuslist.d.ts +0 -493
- package/dist/vc/statuslist.js +0 -132
- package/dist/verifier.d.ts +0 -205
- package/dist/verifier.js +0 -83
- package/dist/well-known/index.d.ts +0 -308
- package/dist/well-known/index.js +0 -134
package/dist/proof.d.ts
DELETED
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Proof and signature schemas for MCP-I
|
|
4
|
-
*
|
|
5
|
-
* Note: The type name "DetachedProof" is maintained for backward compatibility,
|
|
6
|
-
* but the JWS format is actually FULL compact JWS (header.payload.signature),
|
|
7
|
-
* not detached format (header..signature).
|
|
8
|
-
*
|
|
9
|
-
* The JWS payload contains JWT standard claims (aud, sub, iss) plus custom
|
|
10
|
-
* proof claims (requestHash, responseHash, nonce, etc.).
|
|
11
|
-
*/
|
|
12
|
-
export declare const ProofMetaSchema: z.ZodObject<{
|
|
13
|
-
did: z.ZodString;
|
|
14
|
-
kid: z.ZodString;
|
|
15
|
-
ts: z.ZodNumber;
|
|
16
|
-
nonce: z.ZodString;
|
|
17
|
-
audience: z.ZodString;
|
|
18
|
-
sessionId: z.ZodString;
|
|
19
|
-
requestHash: z.ZodString;
|
|
20
|
-
responseHash: z.ZodString;
|
|
21
|
-
scopeId: z.ZodOptional<z.ZodString>;
|
|
22
|
-
delegationRef: z.ZodOptional<z.ZodString>;
|
|
23
|
-
clientDid: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
did: string;
|
|
26
|
-
kid: string;
|
|
27
|
-
ts: number;
|
|
28
|
-
nonce: string;
|
|
29
|
-
audience: string;
|
|
30
|
-
sessionId: string;
|
|
31
|
-
requestHash: string;
|
|
32
|
-
responseHash: string;
|
|
33
|
-
scopeId?: string | undefined;
|
|
34
|
-
delegationRef?: string | undefined;
|
|
35
|
-
clientDid?: string | undefined;
|
|
36
|
-
}, {
|
|
37
|
-
did: string;
|
|
38
|
-
kid: string;
|
|
39
|
-
ts: number;
|
|
40
|
-
nonce: string;
|
|
41
|
-
audience: string;
|
|
42
|
-
sessionId: string;
|
|
43
|
-
requestHash: string;
|
|
44
|
-
responseHash: string;
|
|
45
|
-
scopeId?: string | undefined;
|
|
46
|
-
delegationRef?: string | undefined;
|
|
47
|
-
clientDid?: string | undefined;
|
|
48
|
-
}>;
|
|
49
|
-
export declare const DetachedProofSchema: z.ZodObject<{
|
|
50
|
-
jws: z.ZodString;
|
|
51
|
-
meta: z.ZodObject<{
|
|
52
|
-
did: z.ZodString;
|
|
53
|
-
kid: z.ZodString;
|
|
54
|
-
ts: z.ZodNumber;
|
|
55
|
-
nonce: z.ZodString;
|
|
56
|
-
audience: z.ZodString;
|
|
57
|
-
sessionId: z.ZodString;
|
|
58
|
-
requestHash: z.ZodString;
|
|
59
|
-
responseHash: z.ZodString;
|
|
60
|
-
scopeId: z.ZodOptional<z.ZodString>;
|
|
61
|
-
delegationRef: z.ZodOptional<z.ZodString>;
|
|
62
|
-
clientDid: z.ZodOptional<z.ZodString>;
|
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
did: string;
|
|
65
|
-
kid: string;
|
|
66
|
-
ts: number;
|
|
67
|
-
nonce: string;
|
|
68
|
-
audience: string;
|
|
69
|
-
sessionId: string;
|
|
70
|
-
requestHash: string;
|
|
71
|
-
responseHash: string;
|
|
72
|
-
scopeId?: string | undefined;
|
|
73
|
-
delegationRef?: string | undefined;
|
|
74
|
-
clientDid?: string | undefined;
|
|
75
|
-
}, {
|
|
76
|
-
did: string;
|
|
77
|
-
kid: string;
|
|
78
|
-
ts: number;
|
|
79
|
-
nonce: string;
|
|
80
|
-
audience: string;
|
|
81
|
-
sessionId: string;
|
|
82
|
-
requestHash: string;
|
|
83
|
-
responseHash: string;
|
|
84
|
-
scopeId?: string | undefined;
|
|
85
|
-
delegationRef?: string | undefined;
|
|
86
|
-
clientDid?: string | undefined;
|
|
87
|
-
}>;
|
|
88
|
-
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
jws: string;
|
|
90
|
-
meta: {
|
|
91
|
-
did: string;
|
|
92
|
-
kid: string;
|
|
93
|
-
ts: number;
|
|
94
|
-
nonce: string;
|
|
95
|
-
audience: string;
|
|
96
|
-
sessionId: string;
|
|
97
|
-
requestHash: string;
|
|
98
|
-
responseHash: string;
|
|
99
|
-
scopeId?: string | undefined;
|
|
100
|
-
delegationRef?: string | undefined;
|
|
101
|
-
clientDid?: string | undefined;
|
|
102
|
-
};
|
|
103
|
-
}, {
|
|
104
|
-
jws: string;
|
|
105
|
-
meta: {
|
|
106
|
-
did: string;
|
|
107
|
-
kid: string;
|
|
108
|
-
ts: number;
|
|
109
|
-
nonce: string;
|
|
110
|
-
audience: string;
|
|
111
|
-
sessionId: string;
|
|
112
|
-
requestHash: string;
|
|
113
|
-
responseHash: string;
|
|
114
|
-
scopeId?: string | undefined;
|
|
115
|
-
delegationRef?: string | undefined;
|
|
116
|
-
clientDid?: string | undefined;
|
|
117
|
-
};
|
|
118
|
-
}>;
|
|
119
|
-
export declare const CanonicalHashesSchema: z.ZodObject<{
|
|
120
|
-
requestHash: z.ZodString;
|
|
121
|
-
responseHash: z.ZodString;
|
|
122
|
-
}, "strip", z.ZodTypeAny, {
|
|
123
|
-
requestHash: string;
|
|
124
|
-
responseHash: string;
|
|
125
|
-
}, {
|
|
126
|
-
requestHash: string;
|
|
127
|
-
responseHash: string;
|
|
128
|
-
}>;
|
|
129
|
-
export declare const AuditRecordSchema: z.ZodObject<{
|
|
130
|
-
version: z.ZodLiteral<"audit.v1">;
|
|
131
|
-
ts: z.ZodNumber;
|
|
132
|
-
session: z.ZodString;
|
|
133
|
-
audience: z.ZodString;
|
|
134
|
-
did: z.ZodString;
|
|
135
|
-
kid: z.ZodString;
|
|
136
|
-
reqHash: z.ZodString;
|
|
137
|
-
resHash: z.ZodString;
|
|
138
|
-
verified: z.ZodEnum<["yes", "no"]>;
|
|
139
|
-
scope: z.ZodString;
|
|
140
|
-
}, "strip", z.ZodTypeAny, {
|
|
141
|
-
did: string;
|
|
142
|
-
kid: string;
|
|
143
|
-
ts: number;
|
|
144
|
-
audience: string;
|
|
145
|
-
version: "audit.v1";
|
|
146
|
-
session: string;
|
|
147
|
-
reqHash: string;
|
|
148
|
-
resHash: string;
|
|
149
|
-
verified: "yes" | "no";
|
|
150
|
-
scope: string;
|
|
151
|
-
}, {
|
|
152
|
-
did: string;
|
|
153
|
-
kid: string;
|
|
154
|
-
ts: number;
|
|
155
|
-
audience: string;
|
|
156
|
-
version: "audit.v1";
|
|
157
|
-
session: string;
|
|
158
|
-
reqHash: string;
|
|
159
|
-
resHash: string;
|
|
160
|
-
verified: "yes" | "no";
|
|
161
|
-
scope: string;
|
|
162
|
-
}>;
|
|
163
|
-
export type ProofMeta = z.infer<typeof ProofMetaSchema>;
|
|
164
|
-
export type DetachedProof = z.infer<typeof DetachedProofSchema>;
|
|
165
|
-
export type CanonicalHashes = z.infer<typeof CanonicalHashesSchema>;
|
|
166
|
-
export type AuditRecord = z.infer<typeof AuditRecordSchema>;
|
|
167
|
-
export declare const JWS_ALGORITHM = "EdDSA";
|
|
168
|
-
export declare const HASH_ALGORITHM = "sha256";
|
|
169
|
-
export declare const AUDIT_VERSION = "audit.v1";
|
|
170
|
-
/**
|
|
171
|
-
* Tool call context for AgentShield dashboard integration
|
|
172
|
-
* Provides plaintext tool execution data alongside cryptographic proofs
|
|
173
|
-
*/
|
|
174
|
-
export declare const ToolCallContextSchema: z.ZodObject<{
|
|
175
|
-
tool: z.ZodString;
|
|
176
|
-
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
177
|
-
result: z.ZodOptional<z.ZodUnknown>;
|
|
178
|
-
scopeId: z.ZodString;
|
|
179
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
180
|
-
}, "strip", z.ZodTypeAny, {
|
|
181
|
-
scopeId: string;
|
|
182
|
-
tool: string;
|
|
183
|
-
args: Record<string, unknown>;
|
|
184
|
-
result?: unknown;
|
|
185
|
-
userId?: string | undefined;
|
|
186
|
-
}, {
|
|
187
|
-
scopeId: string;
|
|
188
|
-
tool: string;
|
|
189
|
-
args: Record<string, unknown>;
|
|
190
|
-
result?: unknown;
|
|
191
|
-
userId?: string | undefined;
|
|
192
|
-
}>;
|
|
193
|
-
/**
|
|
194
|
-
* Proof submission context for AgentShield API
|
|
195
|
-
* Includes tool calls and optional MCP server URL for tool discovery
|
|
196
|
-
*/
|
|
197
|
-
export declare const ProofSubmissionContextSchema: z.ZodObject<{
|
|
198
|
-
toolCalls: z.ZodArray<z.ZodObject<{
|
|
199
|
-
tool: z.ZodString;
|
|
200
|
-
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
201
|
-
result: z.ZodOptional<z.ZodUnknown>;
|
|
202
|
-
scopeId: z.ZodString;
|
|
203
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
204
|
-
}, "strip", z.ZodTypeAny, {
|
|
205
|
-
scopeId: string;
|
|
206
|
-
tool: string;
|
|
207
|
-
args: Record<string, unknown>;
|
|
208
|
-
result?: unknown;
|
|
209
|
-
userId?: string | undefined;
|
|
210
|
-
}, {
|
|
211
|
-
scopeId: string;
|
|
212
|
-
tool: string;
|
|
213
|
-
args: Record<string, unknown>;
|
|
214
|
-
result?: unknown;
|
|
215
|
-
userId?: string | undefined;
|
|
216
|
-
}>, "many">;
|
|
217
|
-
mcpServerUrl: z.ZodOptional<z.ZodString>;
|
|
218
|
-
}, "strip", z.ZodTypeAny, {
|
|
219
|
-
toolCalls: {
|
|
220
|
-
scopeId: string;
|
|
221
|
-
tool: string;
|
|
222
|
-
args: Record<string, unknown>;
|
|
223
|
-
result?: unknown;
|
|
224
|
-
userId?: string | undefined;
|
|
225
|
-
}[];
|
|
226
|
-
mcpServerUrl?: string | undefined;
|
|
227
|
-
}, {
|
|
228
|
-
toolCalls: {
|
|
229
|
-
scopeId: string;
|
|
230
|
-
tool: string;
|
|
231
|
-
args: Record<string, unknown>;
|
|
232
|
-
result?: unknown;
|
|
233
|
-
userId?: string | undefined;
|
|
234
|
-
}[];
|
|
235
|
-
mcpServerUrl?: string | undefined;
|
|
236
|
-
}>;
|
|
237
|
-
/**
|
|
238
|
-
* Complete proof submission request to AgentShield
|
|
239
|
-
*/
|
|
240
|
-
export declare const ProofSubmissionRequestSchema: z.ZodObject<{
|
|
241
|
-
session_id: z.ZodString;
|
|
242
|
-
delegation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
|
-
proofs: z.ZodArray<z.ZodObject<{
|
|
244
|
-
jws: z.ZodString;
|
|
245
|
-
meta: z.ZodObject<{
|
|
246
|
-
did: z.ZodString;
|
|
247
|
-
kid: z.ZodString;
|
|
248
|
-
ts: z.ZodNumber;
|
|
249
|
-
nonce: z.ZodString;
|
|
250
|
-
audience: z.ZodString;
|
|
251
|
-
sessionId: z.ZodString;
|
|
252
|
-
requestHash: z.ZodString;
|
|
253
|
-
responseHash: z.ZodString;
|
|
254
|
-
scopeId: z.ZodOptional<z.ZodString>;
|
|
255
|
-
delegationRef: z.ZodOptional<z.ZodString>;
|
|
256
|
-
clientDid: z.ZodOptional<z.ZodString>;
|
|
257
|
-
}, "strip", z.ZodTypeAny, {
|
|
258
|
-
did: string;
|
|
259
|
-
kid: string;
|
|
260
|
-
ts: number;
|
|
261
|
-
nonce: string;
|
|
262
|
-
audience: string;
|
|
263
|
-
sessionId: string;
|
|
264
|
-
requestHash: string;
|
|
265
|
-
responseHash: string;
|
|
266
|
-
scopeId?: string | undefined;
|
|
267
|
-
delegationRef?: string | undefined;
|
|
268
|
-
clientDid?: string | undefined;
|
|
269
|
-
}, {
|
|
270
|
-
did: string;
|
|
271
|
-
kid: string;
|
|
272
|
-
ts: number;
|
|
273
|
-
nonce: string;
|
|
274
|
-
audience: string;
|
|
275
|
-
sessionId: string;
|
|
276
|
-
requestHash: string;
|
|
277
|
-
responseHash: string;
|
|
278
|
-
scopeId?: string | undefined;
|
|
279
|
-
delegationRef?: string | undefined;
|
|
280
|
-
clientDid?: string | undefined;
|
|
281
|
-
}>;
|
|
282
|
-
}, "strip", z.ZodTypeAny, {
|
|
283
|
-
jws: string;
|
|
284
|
-
meta: {
|
|
285
|
-
did: string;
|
|
286
|
-
kid: string;
|
|
287
|
-
ts: number;
|
|
288
|
-
nonce: string;
|
|
289
|
-
audience: string;
|
|
290
|
-
sessionId: string;
|
|
291
|
-
requestHash: string;
|
|
292
|
-
responseHash: string;
|
|
293
|
-
scopeId?: string | undefined;
|
|
294
|
-
delegationRef?: string | undefined;
|
|
295
|
-
clientDid?: string | undefined;
|
|
296
|
-
};
|
|
297
|
-
}, {
|
|
298
|
-
jws: string;
|
|
299
|
-
meta: {
|
|
300
|
-
did: string;
|
|
301
|
-
kid: string;
|
|
302
|
-
ts: number;
|
|
303
|
-
nonce: string;
|
|
304
|
-
audience: string;
|
|
305
|
-
sessionId: string;
|
|
306
|
-
requestHash: string;
|
|
307
|
-
responseHash: string;
|
|
308
|
-
scopeId?: string | undefined;
|
|
309
|
-
delegationRef?: string | undefined;
|
|
310
|
-
clientDid?: string | undefined;
|
|
311
|
-
};
|
|
312
|
-
}>, "many">;
|
|
313
|
-
context: z.ZodOptional<z.ZodObject<{
|
|
314
|
-
toolCalls: z.ZodArray<z.ZodObject<{
|
|
315
|
-
tool: z.ZodString;
|
|
316
|
-
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
317
|
-
result: z.ZodOptional<z.ZodUnknown>;
|
|
318
|
-
scopeId: z.ZodString;
|
|
319
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
320
|
-
}, "strip", z.ZodTypeAny, {
|
|
321
|
-
scopeId: string;
|
|
322
|
-
tool: string;
|
|
323
|
-
args: Record<string, unknown>;
|
|
324
|
-
result?: unknown;
|
|
325
|
-
userId?: string | undefined;
|
|
326
|
-
}, {
|
|
327
|
-
scopeId: string;
|
|
328
|
-
tool: string;
|
|
329
|
-
args: Record<string, unknown>;
|
|
330
|
-
result?: unknown;
|
|
331
|
-
userId?: string | undefined;
|
|
332
|
-
}>, "many">;
|
|
333
|
-
mcpServerUrl: z.ZodOptional<z.ZodString>;
|
|
334
|
-
}, "strip", z.ZodTypeAny, {
|
|
335
|
-
toolCalls: {
|
|
336
|
-
scopeId: string;
|
|
337
|
-
tool: string;
|
|
338
|
-
args: Record<string, unknown>;
|
|
339
|
-
result?: unknown;
|
|
340
|
-
userId?: string | undefined;
|
|
341
|
-
}[];
|
|
342
|
-
mcpServerUrl?: string | undefined;
|
|
343
|
-
}, {
|
|
344
|
-
toolCalls: {
|
|
345
|
-
scopeId: string;
|
|
346
|
-
tool: string;
|
|
347
|
-
args: Record<string, unknown>;
|
|
348
|
-
result?: unknown;
|
|
349
|
-
userId?: string | undefined;
|
|
350
|
-
}[];
|
|
351
|
-
mcpServerUrl?: string | undefined;
|
|
352
|
-
}>>;
|
|
353
|
-
}, "strip", z.ZodTypeAny, {
|
|
354
|
-
session_id: string;
|
|
355
|
-
proofs: {
|
|
356
|
-
jws: string;
|
|
357
|
-
meta: {
|
|
358
|
-
did: string;
|
|
359
|
-
kid: string;
|
|
360
|
-
ts: number;
|
|
361
|
-
nonce: string;
|
|
362
|
-
audience: string;
|
|
363
|
-
sessionId: string;
|
|
364
|
-
requestHash: string;
|
|
365
|
-
responseHash: string;
|
|
366
|
-
scopeId?: string | undefined;
|
|
367
|
-
delegationRef?: string | undefined;
|
|
368
|
-
clientDid?: string | undefined;
|
|
369
|
-
};
|
|
370
|
-
}[];
|
|
371
|
-
delegation_id?: string | null | undefined;
|
|
372
|
-
context?: {
|
|
373
|
-
toolCalls: {
|
|
374
|
-
scopeId: string;
|
|
375
|
-
tool: string;
|
|
376
|
-
args: Record<string, unknown>;
|
|
377
|
-
result?: unknown;
|
|
378
|
-
userId?: string | undefined;
|
|
379
|
-
}[];
|
|
380
|
-
mcpServerUrl?: string | undefined;
|
|
381
|
-
} | undefined;
|
|
382
|
-
}, {
|
|
383
|
-
session_id: string;
|
|
384
|
-
proofs: {
|
|
385
|
-
jws: string;
|
|
386
|
-
meta: {
|
|
387
|
-
did: string;
|
|
388
|
-
kid: string;
|
|
389
|
-
ts: number;
|
|
390
|
-
nonce: string;
|
|
391
|
-
audience: string;
|
|
392
|
-
sessionId: string;
|
|
393
|
-
requestHash: string;
|
|
394
|
-
responseHash: string;
|
|
395
|
-
scopeId?: string | undefined;
|
|
396
|
-
delegationRef?: string | undefined;
|
|
397
|
-
clientDid?: string | undefined;
|
|
398
|
-
};
|
|
399
|
-
}[];
|
|
400
|
-
delegation_id?: string | null | undefined;
|
|
401
|
-
context?: {
|
|
402
|
-
toolCalls: {
|
|
403
|
-
scopeId: string;
|
|
404
|
-
tool: string;
|
|
405
|
-
args: Record<string, unknown>;
|
|
406
|
-
result?: unknown;
|
|
407
|
-
userId?: string | undefined;
|
|
408
|
-
}[];
|
|
409
|
-
mcpServerUrl?: string | undefined;
|
|
410
|
-
} | undefined;
|
|
411
|
-
}>;
|
|
412
|
-
export type ToolCallContext = z.infer<typeof ToolCallContextSchema>;
|
|
413
|
-
export type ProofSubmissionContext = z.infer<typeof ProofSubmissionContextSchema>;
|
|
414
|
-
export type ProofSubmissionRequest = z.infer<typeof ProofSubmissionRequestSchema>;
|
|
415
|
-
//# sourceMappingURL=proof.d.ts.map
|
package/dist/proof.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProofSubmissionRequestSchema = exports.ProofSubmissionContextSchema = exports.ToolCallContextSchema = exports.AUDIT_VERSION = exports.HASH_ALGORITHM = exports.JWS_ALGORITHM = exports.AuditRecordSchema = exports.CanonicalHashesSchema = exports.DetachedProofSchema = exports.ProofMetaSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/**
|
|
6
|
-
* Proof and signature schemas for MCP-I
|
|
7
|
-
*
|
|
8
|
-
* Note: The type name "DetachedProof" is maintained for backward compatibility,
|
|
9
|
-
* but the JWS format is actually FULL compact JWS (header.payload.signature),
|
|
10
|
-
* not detached format (header..signature).
|
|
11
|
-
*
|
|
12
|
-
* The JWS payload contains JWT standard claims (aud, sub, iss) plus custom
|
|
13
|
-
* proof claims (requestHash, responseHash, nonce, etc.).
|
|
14
|
-
*/
|
|
15
|
-
exports.ProofMetaSchema = zod_1.z.object({
|
|
16
|
-
did: zod_1.z.string().min(1),
|
|
17
|
-
kid: zod_1.z.string().min(1),
|
|
18
|
-
ts: zod_1.z.number().int().positive(),
|
|
19
|
-
nonce: zod_1.z.string().min(1),
|
|
20
|
-
audience: zod_1.z.string().min(1),
|
|
21
|
-
sessionId: zod_1.z.string().min(1),
|
|
22
|
-
requestHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
23
|
-
responseHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
24
|
-
scopeId: zod_1.z.string().optional(),
|
|
25
|
-
delegationRef: zod_1.z.string().optional(),
|
|
26
|
-
clientDid: zod_1.z.string().optional(), // Optional for backward compatibility
|
|
27
|
-
});
|
|
28
|
-
exports.DetachedProofSchema = zod_1.z.object({
|
|
29
|
-
jws: zod_1.z.string().min(1), // Full compact JWS format (header.payload.signature)
|
|
30
|
-
meta: exports.ProofMetaSchema, // Convenience metadata (duplicates signed payload data)
|
|
31
|
-
});
|
|
32
|
-
exports.CanonicalHashesSchema = zod_1.z.object({
|
|
33
|
-
requestHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
34
|
-
responseHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
35
|
-
});
|
|
36
|
-
exports.AuditRecordSchema = zod_1.z.object({
|
|
37
|
-
version: zod_1.z.literal("audit.v1"),
|
|
38
|
-
ts: zod_1.z.number().int().positive(),
|
|
39
|
-
session: zod_1.z.string().min(1),
|
|
40
|
-
audience: zod_1.z.string().min(1),
|
|
41
|
-
did: zod_1.z.string().min(1),
|
|
42
|
-
kid: zod_1.z.string().min(1),
|
|
43
|
-
reqHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
44
|
-
resHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
45
|
-
verified: zod_1.z.enum(["yes", "no"]),
|
|
46
|
-
scope: zod_1.z.string().min(1), // "-" for no scope
|
|
47
|
-
});
|
|
48
|
-
// Constants
|
|
49
|
-
exports.JWS_ALGORITHM = "EdDSA";
|
|
50
|
-
exports.HASH_ALGORITHM = "sha256";
|
|
51
|
-
exports.AUDIT_VERSION = "audit.v1";
|
|
52
|
-
/**
|
|
53
|
-
* Tool call context for AgentShield dashboard integration
|
|
54
|
-
* Provides plaintext tool execution data alongside cryptographic proofs
|
|
55
|
-
*/
|
|
56
|
-
exports.ToolCallContextSchema = zod_1.z.object({
|
|
57
|
-
tool: zod_1.z.string().min(1),
|
|
58
|
-
args: zod_1.z.record(zod_1.z.unknown()),
|
|
59
|
-
result: zod_1.z.unknown().optional(),
|
|
60
|
-
scopeId: zod_1.z.string(),
|
|
61
|
-
userId: zod_1.z.string().optional(),
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Proof submission context for AgentShield API
|
|
65
|
-
* Includes tool calls and optional MCP server URL for tool discovery
|
|
66
|
-
*/
|
|
67
|
-
exports.ProofSubmissionContextSchema = zod_1.z.object({
|
|
68
|
-
toolCalls: zod_1.z.array(exports.ToolCallContextSchema),
|
|
69
|
-
mcpServerUrl: zod_1.z.string().url().optional(),
|
|
70
|
-
});
|
|
71
|
-
/**
|
|
72
|
-
* Complete proof submission request to AgentShield
|
|
73
|
-
*/
|
|
74
|
-
exports.ProofSubmissionRequestSchema = zod_1.z.object({
|
|
75
|
-
session_id: zod_1.z.string().min(1),
|
|
76
|
-
delegation_id: zod_1.z.string().nullable().optional(),
|
|
77
|
-
proofs: zod_1.z.array(zod_1.z.object({
|
|
78
|
-
jws: zod_1.z.string().min(1),
|
|
79
|
-
meta: exports.ProofMetaSchema,
|
|
80
|
-
})),
|
|
81
|
-
context: exports.ProofSubmissionContextSchema.optional(),
|
|
82
|
-
});
|
|
83
|
-
//# sourceMappingURL=proof.js.map
|