@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,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_PROOF_RECORD_TTL_MS = exports.ProofRecordSchema = exports.VerificationInfoSchema = exports.CrispInfoSchema = exports.LinkageInfoSchema = exports.ProofDetailsSchema = exports.ResponseInfoSchema = exports.RequestInfoSchema = void 0;
4
- exports.validateProofRecord = validateProofRecord;
5
- exports.isProofRecordExpired = isProofRecordExpired;
6
- const zod_1 = require("zod");
7
- exports.RequestInfoSchema = zod_1.z.object({
8
- method: zod_1.z.string(),
9
- url: zod_1.z.string().url(),
10
- bodyHash: zod_1.z.string().optional(),
11
- headersHash: zod_1.z.string().optional(),
12
- });
13
- exports.ResponseInfoSchema = zod_1.z.object({
14
- status: zod_1.z.number().int(),
15
- bodyHash: zod_1.z.string().optional(),
16
- });
17
- exports.ProofDetailsSchema = zod_1.z.object({
18
- timestamp: zod_1.z.number().int().positive(),
19
- nonce: zod_1.z.string().min(1),
20
- did: zod_1.z.string().min(1),
21
- signature: zod_1.z.string().regex(/^[A-Za-z0-9_-]+$/),
22
- algorithm: zod_1.z.enum(['Ed25519', 'ES256']),
23
- sessionId: zod_1.z.string().min(1),
24
- audience: zod_1.z.string().min(1),
25
- request: exports.RequestInfoSchema.optional(),
26
- response: exports.ResponseInfoSchema.optional(),
27
- });
28
- exports.LinkageInfoSchema = zod_1.z.object({
29
- delegationId: zod_1.z.string().optional(),
30
- credentialId: zod_1.z.string().optional(),
31
- chainDepth: zod_1.z.number().int().nonnegative().optional(),
32
- });
33
- exports.CrispInfoSchema = zod_1.z.object({
34
- unit: zod_1.z.enum(['USD', 'ops', 'points']),
35
- delta: zod_1.z.number().optional(),
36
- remaining: zod_1.z.number().optional(),
37
- });
38
- exports.VerificationInfoSchema = zod_1.z.object({
39
- result: zod_1.z.enum(['pending', 'pass', 'fail']),
40
- reason: zod_1.z.string().optional(),
41
- checkedAt: zod_1.z.number().int().positive().optional(),
42
- });
43
- exports.ProofRecordSchema = zod_1.z.object({
44
- id: zod_1.z.string().min(1),
45
- toolName: zod_1.z.string().min(1),
46
- storedAt: zod_1.z.number().int().positive(),
47
- expiresAt: zod_1.z.number().int().positive(),
48
- proof: exports.ProofDetailsSchema,
49
- linkage: exports.LinkageInfoSchema.optional(),
50
- crisp: exports.CrispInfoSchema.optional(),
51
- verification: exports.VerificationInfoSchema.optional(),
52
- metadata: zod_1.z.record(zod_1.z.any()).optional(),
53
- }).passthrough();
54
- function validateProofRecord(record) {
55
- return exports.ProofRecordSchema.safeParse(record);
56
- }
57
- function isProofRecordExpired(record) {
58
- return Date.now() > record.expiresAt;
59
- }
60
- exports.DEFAULT_PROOF_RECORD_TTL_MS = 30 * 24 * 60 * 60 * 1000;
@@ -1,73 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const CanonicalRequestPartsSchema: z.ZodObject<{
3
- method: z.ZodString;
4
- url: z.ZodString;
5
- bodyHash: z.ZodOptional<z.ZodString>;
6
- headersHash: z.ZodOptional<z.ZodString>;
7
- nonce: z.ZodString;
8
- timestamp: z.ZodNumber;
9
- audience: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- nonce: string;
12
- audience: string;
13
- timestamp: number;
14
- url: string;
15
- method: string;
16
- bodyHash?: string | undefined;
17
- headersHash?: string | undefined;
18
- }, {
19
- nonce: string;
20
- audience: string;
21
- timestamp: number;
22
- url: string;
23
- method: string;
24
- bodyHash?: string | undefined;
25
- headersHash?: string | undefined;
26
- }>;
27
- export type CanonicalRequestParts = z.infer<typeof CanonicalRequestPartsSchema>;
28
- export declare const DetachedJwsSchema: z.ZodObject<{
29
- alg: z.ZodEnum<["Ed25519", "ES256"]>;
30
- kid: z.ZodOptional<z.ZodString>;
31
- signature: z.ZodString;
32
- }, "strip", z.ZodTypeAny, {
33
- signature: string;
34
- alg: "Ed25519" | "ES256";
35
- kid?: string | undefined;
36
- }, {
37
- signature: string;
38
- alg: "Ed25519" | "ES256";
39
- kid?: string | undefined;
40
- }>;
41
- export type DetachedJws = z.infer<typeof DetachedJwsSchema>;
42
- export declare const SIGNING_ORDER: readonly ["method", "url", "bodyHash", "headersHash", "nonce", "timestamp", "audience"];
43
- export type SigningOrderField = (typeof SIGNING_ORDER)[number];
44
- export declare function validateCanonicalRequestParts(parts: unknown): z.SafeParseReturnType<{
45
- nonce: string;
46
- audience: string;
47
- timestamp: number;
48
- url: string;
49
- method: string;
50
- bodyHash?: string | undefined;
51
- headersHash?: string | undefined;
52
- }, {
53
- nonce: string;
54
- audience: string;
55
- timestamp: number;
56
- url: string;
57
- method: string;
58
- bodyHash?: string | undefined;
59
- headersHash?: string | undefined;
60
- }>;
61
- export declare function validateDetachedJws(jws: unknown): z.SafeParseReturnType<{
62
- signature: string;
63
- alg: "Ed25519" | "ES256";
64
- kid?: string | undefined;
65
- }, {
66
- signature: string;
67
- alg: "Ed25519" | "ES256";
68
- kid?: string | undefined;
69
- }>;
70
- export declare function getCanonicalSigningString(parts: CanonicalRequestParts): string;
71
- export declare const SUPPORTED_SIGNING_ALGORITHMS: readonly ["Ed25519", "ES256"];
72
- export declare const SIGNING_HASH_ALGORITHM = "SHA-256";
73
- export declare const BASE64URL_PATTERN: RegExp;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BASE64URL_PATTERN = exports.SIGNING_HASH_ALGORITHM = exports.SUPPORTED_SIGNING_ALGORITHMS = exports.SIGNING_ORDER = exports.DetachedJwsSchema = exports.CanonicalRequestPartsSchema = void 0;
4
- exports.validateCanonicalRequestParts = validateCanonicalRequestParts;
5
- exports.validateDetachedJws = validateDetachedJws;
6
- exports.getCanonicalSigningString = getCanonicalSigningString;
7
- const zod_1 = require("zod");
8
- exports.CanonicalRequestPartsSchema = zod_1.z.object({
9
- method: zod_1.z.string().toUpperCase(),
10
- url: zod_1.z.string().url(),
11
- bodyHash: zod_1.z.string().regex(/^[A-Za-z0-9_-]+$/).optional(),
12
- headersHash: zod_1.z.string().regex(/^[A-Za-z0-9_-]+$/).optional(),
13
- nonce: zod_1.z.string().min(1),
14
- timestamp: zod_1.z.number().int().positive(),
15
- audience: zod_1.z.string().min(1),
16
- });
17
- exports.DetachedJwsSchema = zod_1.z.object({
18
- alg: zod_1.z.enum(['Ed25519', 'ES256']),
19
- kid: zod_1.z.string().optional(),
20
- signature: zod_1.z.string().regex(/^[A-Za-z0-9_-]+$/),
21
- });
22
- exports.SIGNING_ORDER = Object.freeze([
23
- 'method',
24
- 'url',
25
- 'bodyHash',
26
- 'headersHash',
27
- 'nonce',
28
- 'timestamp',
29
- 'audience',
30
- ]);
31
- function validateCanonicalRequestParts(parts) {
32
- return exports.CanonicalRequestPartsSchema.safeParse(parts);
33
- }
34
- function validateDetachedJws(jws) {
35
- return exports.DetachedJwsSchema.safeParse(jws);
36
- }
37
- function getCanonicalSigningString(parts) {
38
- const values = [];
39
- for (const field of exports.SIGNING_ORDER) {
40
- const value = parts[field];
41
- if (value !== undefined) {
42
- values.push(String(value));
43
- }
44
- else {
45
- values.push('');
46
- }
47
- }
48
- return values.join('\n');
49
- }
50
- exports.SUPPORTED_SIGNING_ALGORITHMS = ['Ed25519', 'ES256'];
51
- exports.SIGNING_HASH_ALGORITHM = 'SHA-256';
52
- exports.BASE64URL_PATTERN = /^[A-Za-z0-9_-]+$/;
package/dist/proof.d.ts DELETED
@@ -1,378 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ProofMetaSchema: z.ZodObject<{
3
- did: z.ZodString;
4
- kid: z.ZodString;
5
- ts: z.ZodNumber;
6
- nonce: z.ZodString;
7
- audience: z.ZodString;
8
- sessionId: z.ZodString;
9
- requestHash: z.ZodString;
10
- responseHash: z.ZodString;
11
- scopeId: z.ZodOptional<z.ZodString>;
12
- delegationRef: z.ZodOptional<z.ZodString>;
13
- }, "strip", z.ZodTypeAny, {
14
- did: string;
15
- kid: string;
16
- nonce: string;
17
- audience: string;
18
- sessionId: string;
19
- ts: number;
20
- requestHash: string;
21
- responseHash: string;
22
- scopeId?: string | undefined;
23
- delegationRef?: string | undefined;
24
- }, {
25
- did: string;
26
- kid: string;
27
- nonce: string;
28
- audience: string;
29
- sessionId: string;
30
- ts: number;
31
- requestHash: string;
32
- responseHash: string;
33
- scopeId?: string | undefined;
34
- delegationRef?: string | undefined;
35
- }>;
36
- export declare const DetachedProofSchema: z.ZodObject<{
37
- jws: z.ZodString;
38
- meta: z.ZodObject<{
39
- did: z.ZodString;
40
- kid: z.ZodString;
41
- ts: z.ZodNumber;
42
- nonce: z.ZodString;
43
- audience: z.ZodString;
44
- sessionId: z.ZodString;
45
- requestHash: z.ZodString;
46
- responseHash: z.ZodString;
47
- scopeId: z.ZodOptional<z.ZodString>;
48
- delegationRef: z.ZodOptional<z.ZodString>;
49
- }, "strip", z.ZodTypeAny, {
50
- did: string;
51
- kid: string;
52
- nonce: string;
53
- audience: string;
54
- sessionId: string;
55
- ts: number;
56
- requestHash: string;
57
- responseHash: string;
58
- scopeId?: string | undefined;
59
- delegationRef?: string | undefined;
60
- }, {
61
- did: string;
62
- kid: string;
63
- nonce: string;
64
- audience: string;
65
- sessionId: string;
66
- ts: number;
67
- requestHash: string;
68
- responseHash: string;
69
- scopeId?: string | undefined;
70
- delegationRef?: string | undefined;
71
- }>;
72
- }, "strip", z.ZodTypeAny, {
73
- jws: string;
74
- meta: {
75
- did: string;
76
- kid: string;
77
- nonce: string;
78
- audience: string;
79
- sessionId: string;
80
- ts: number;
81
- requestHash: string;
82
- responseHash: string;
83
- scopeId?: string | undefined;
84
- delegationRef?: string | undefined;
85
- };
86
- }, {
87
- jws: string;
88
- meta: {
89
- did: string;
90
- kid: string;
91
- nonce: string;
92
- audience: string;
93
- sessionId: string;
94
- ts: number;
95
- requestHash: string;
96
- responseHash: string;
97
- scopeId?: string | undefined;
98
- delegationRef?: string | undefined;
99
- };
100
- }>;
101
- export declare const CanonicalHashesSchema: z.ZodObject<{
102
- requestHash: z.ZodString;
103
- responseHash: z.ZodString;
104
- }, "strip", z.ZodTypeAny, {
105
- requestHash: string;
106
- responseHash: string;
107
- }, {
108
- requestHash: string;
109
- responseHash: string;
110
- }>;
111
- export declare const AuditRecordSchema: z.ZodObject<{
112
- version: z.ZodLiteral<"audit.v1">;
113
- ts: z.ZodNumber;
114
- session: z.ZodString;
115
- audience: z.ZodString;
116
- did: z.ZodString;
117
- kid: z.ZodString;
118
- reqHash: z.ZodString;
119
- resHash: z.ZodString;
120
- verified: z.ZodEnum<["yes", "no"]>;
121
- scope: z.ZodString;
122
- }, "strip", z.ZodTypeAny, {
123
- version: "audit.v1";
124
- did: string;
125
- kid: string;
126
- audience: string;
127
- ts: number;
128
- session: string;
129
- reqHash: string;
130
- resHash: string;
131
- verified: "yes" | "no";
132
- scope: string;
133
- }, {
134
- version: "audit.v1";
135
- did: string;
136
- kid: string;
137
- audience: string;
138
- ts: number;
139
- session: string;
140
- reqHash: string;
141
- resHash: string;
142
- verified: "yes" | "no";
143
- scope: string;
144
- }>;
145
- export type ProofMeta = z.infer<typeof ProofMetaSchema>;
146
- export type DetachedProof = z.infer<typeof DetachedProofSchema>;
147
- export type CanonicalHashes = z.infer<typeof CanonicalHashesSchema>;
148
- export type AuditRecord = z.infer<typeof AuditRecordSchema>;
149
- export declare const JWS_ALGORITHM = "EdDSA";
150
- export declare const HASH_ALGORITHM = "sha256";
151
- export declare const AUDIT_VERSION = "audit.v1";
152
- export declare const ToolCallContextSchema: z.ZodObject<{
153
- tool: z.ZodString;
154
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
155
- result: z.ZodOptional<z.ZodUnknown>;
156
- scopeId: z.ZodString;
157
- userId: z.ZodOptional<z.ZodString>;
158
- }, "strip", z.ZodTypeAny, {
159
- scopeId: string;
160
- tool: string;
161
- args: Record<string, unknown>;
162
- result?: unknown;
163
- userId?: string | undefined;
164
- }, {
165
- scopeId: string;
166
- tool: string;
167
- args: Record<string, unknown>;
168
- result?: unknown;
169
- userId?: string | undefined;
170
- }>;
171
- export declare const ProofSubmissionContextSchema: z.ZodObject<{
172
- toolCalls: z.ZodArray<z.ZodObject<{
173
- tool: z.ZodString;
174
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
175
- result: z.ZodOptional<z.ZodUnknown>;
176
- scopeId: z.ZodString;
177
- userId: z.ZodOptional<z.ZodString>;
178
- }, "strip", z.ZodTypeAny, {
179
- scopeId: string;
180
- tool: string;
181
- args: Record<string, unknown>;
182
- result?: unknown;
183
- userId?: string | undefined;
184
- }, {
185
- scopeId: string;
186
- tool: string;
187
- args: Record<string, unknown>;
188
- result?: unknown;
189
- userId?: string | undefined;
190
- }>, "many">;
191
- mcpServerUrl: z.ZodOptional<z.ZodString>;
192
- }, "strip", z.ZodTypeAny, {
193
- toolCalls: {
194
- scopeId: string;
195
- tool: string;
196
- args: Record<string, unknown>;
197
- result?: unknown;
198
- userId?: string | undefined;
199
- }[];
200
- mcpServerUrl?: string | undefined;
201
- }, {
202
- toolCalls: {
203
- scopeId: string;
204
- tool: string;
205
- args: Record<string, unknown>;
206
- result?: unknown;
207
- userId?: string | undefined;
208
- }[];
209
- mcpServerUrl?: string | undefined;
210
- }>;
211
- export declare const ProofSubmissionRequestSchema: z.ZodObject<{
212
- session_id: z.ZodString;
213
- delegation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
- proofs: z.ZodArray<z.ZodObject<{
215
- jws: z.ZodString;
216
- meta: z.ZodObject<{
217
- did: z.ZodString;
218
- kid: z.ZodString;
219
- ts: z.ZodNumber;
220
- nonce: z.ZodString;
221
- audience: z.ZodString;
222
- sessionId: z.ZodString;
223
- requestHash: z.ZodString;
224
- responseHash: z.ZodString;
225
- scopeId: z.ZodOptional<z.ZodString>;
226
- delegationRef: z.ZodOptional<z.ZodString>;
227
- }, "strip", z.ZodTypeAny, {
228
- did: string;
229
- kid: string;
230
- nonce: string;
231
- audience: string;
232
- sessionId: string;
233
- ts: number;
234
- requestHash: string;
235
- responseHash: string;
236
- scopeId?: string | undefined;
237
- delegationRef?: string | undefined;
238
- }, {
239
- did: string;
240
- kid: string;
241
- nonce: string;
242
- audience: string;
243
- sessionId: string;
244
- ts: number;
245
- requestHash: string;
246
- responseHash: string;
247
- scopeId?: string | undefined;
248
- delegationRef?: string | undefined;
249
- }>;
250
- }, "strip", z.ZodTypeAny, {
251
- jws: string;
252
- meta: {
253
- did: string;
254
- kid: string;
255
- nonce: string;
256
- audience: string;
257
- sessionId: string;
258
- ts: number;
259
- requestHash: string;
260
- responseHash: string;
261
- scopeId?: string | undefined;
262
- delegationRef?: string | undefined;
263
- };
264
- }, {
265
- jws: string;
266
- meta: {
267
- did: string;
268
- kid: string;
269
- nonce: string;
270
- audience: string;
271
- sessionId: string;
272
- ts: number;
273
- requestHash: string;
274
- responseHash: string;
275
- scopeId?: string | undefined;
276
- delegationRef?: string | undefined;
277
- };
278
- }>, "many">;
279
- context: z.ZodOptional<z.ZodObject<{
280
- toolCalls: z.ZodArray<z.ZodObject<{
281
- tool: z.ZodString;
282
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
283
- result: z.ZodOptional<z.ZodUnknown>;
284
- scopeId: z.ZodString;
285
- userId: z.ZodOptional<z.ZodString>;
286
- }, "strip", z.ZodTypeAny, {
287
- scopeId: string;
288
- tool: string;
289
- args: Record<string, unknown>;
290
- result?: unknown;
291
- userId?: string | undefined;
292
- }, {
293
- scopeId: string;
294
- tool: string;
295
- args: Record<string, unknown>;
296
- result?: unknown;
297
- userId?: string | undefined;
298
- }>, "many">;
299
- mcpServerUrl: z.ZodOptional<z.ZodString>;
300
- }, "strip", z.ZodTypeAny, {
301
- toolCalls: {
302
- scopeId: string;
303
- tool: string;
304
- args: Record<string, unknown>;
305
- result?: unknown;
306
- userId?: string | undefined;
307
- }[];
308
- mcpServerUrl?: string | undefined;
309
- }, {
310
- toolCalls: {
311
- scopeId: string;
312
- tool: string;
313
- args: Record<string, unknown>;
314
- result?: unknown;
315
- userId?: string | undefined;
316
- }[];
317
- mcpServerUrl?: string | undefined;
318
- }>>;
319
- }, "strip", z.ZodTypeAny, {
320
- session_id: string;
321
- proofs: {
322
- jws: string;
323
- meta: {
324
- did: string;
325
- kid: string;
326
- nonce: string;
327
- audience: string;
328
- sessionId: string;
329
- ts: number;
330
- requestHash: string;
331
- responseHash: string;
332
- scopeId?: string | undefined;
333
- delegationRef?: string | undefined;
334
- };
335
- }[];
336
- delegation_id?: string | null | undefined;
337
- context?: {
338
- toolCalls: {
339
- scopeId: string;
340
- tool: string;
341
- args: Record<string, unknown>;
342
- result?: unknown;
343
- userId?: string | undefined;
344
- }[];
345
- mcpServerUrl?: string | undefined;
346
- } | undefined;
347
- }, {
348
- session_id: string;
349
- proofs: {
350
- jws: string;
351
- meta: {
352
- did: string;
353
- kid: string;
354
- nonce: string;
355
- audience: string;
356
- sessionId: string;
357
- ts: number;
358
- requestHash: string;
359
- responseHash: string;
360
- scopeId?: string | undefined;
361
- delegationRef?: string | undefined;
362
- };
363
- }[];
364
- delegation_id?: string | null | undefined;
365
- context?: {
366
- toolCalls: {
367
- scopeId: string;
368
- tool: string;
369
- args: Record<string, unknown>;
370
- result?: unknown;
371
- userId?: string | undefined;
372
- }[];
373
- mcpServerUrl?: string | undefined;
374
- } | undefined;
375
- }>;
376
- export type ToolCallContext = z.infer<typeof ToolCallContextSchema>;
377
- export type ProofSubmissionContext = z.infer<typeof ProofSubmissionContextSchema>;
378
- export type ProofSubmissionRequest = z.infer<typeof ProofSubmissionRequestSchema>;
package/dist/proof.js DELETED
@@ -1,59 +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
- exports.ProofMetaSchema = zod_1.z.object({
6
- did: zod_1.z.string().min(1),
7
- kid: zod_1.z.string().min(1),
8
- ts: zod_1.z.number().int().positive(),
9
- nonce: zod_1.z.string().min(1),
10
- audience: zod_1.z.string().min(1),
11
- sessionId: zod_1.z.string().min(1),
12
- requestHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
13
- responseHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
14
- scopeId: zod_1.z.string().optional(),
15
- delegationRef: zod_1.z.string().optional(),
16
- });
17
- exports.DetachedProofSchema = zod_1.z.object({
18
- jws: zod_1.z.string().min(1),
19
- meta: exports.ProofMetaSchema,
20
- });
21
- exports.CanonicalHashesSchema = zod_1.z.object({
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
- });
25
- exports.AuditRecordSchema = zod_1.z.object({
26
- version: zod_1.z.literal("audit.v1"),
27
- ts: zod_1.z.number().int().positive(),
28
- session: zod_1.z.string().min(1),
29
- audience: zod_1.z.string().min(1),
30
- did: zod_1.z.string().min(1),
31
- kid: zod_1.z.string().min(1),
32
- reqHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
33
- resHash: zod_1.z.string().regex(/^sha256:[a-f0-9]{64}$/),
34
- verified: zod_1.z.enum(["yes", "no"]),
35
- scope: zod_1.z.string().min(1),
36
- });
37
- exports.JWS_ALGORITHM = "EdDSA";
38
- exports.HASH_ALGORITHM = "sha256";
39
- exports.AUDIT_VERSION = "audit.v1";
40
- exports.ToolCallContextSchema = zod_1.z.object({
41
- tool: zod_1.z.string().min(1),
42
- args: zod_1.z.record(zod_1.z.unknown()),
43
- result: zod_1.z.unknown().optional(),
44
- scopeId: zod_1.z.string(),
45
- userId: zod_1.z.string().optional(),
46
- });
47
- exports.ProofSubmissionContextSchema = zod_1.z.object({
48
- toolCalls: zod_1.z.array(exports.ToolCallContextSchema),
49
- mcpServerUrl: zod_1.z.string().url().optional(),
50
- });
51
- exports.ProofSubmissionRequestSchema = zod_1.z.object({
52
- session_id: zod_1.z.string().min(1),
53
- delegation_id: zod_1.z.string().nullable().optional(),
54
- proofs: zod_1.z.array(zod_1.z.object({
55
- jws: zod_1.z.string().min(1),
56
- meta: exports.ProofMetaSchema,
57
- })),
58
- context: exports.ProofSubmissionContextSchema.optional(),
59
- });