@peac/schema 0.10.14 → 0.11.1

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 (41) hide show
  1. package/dist/agent-identity.d.ts +62 -416
  2. package/dist/agent-identity.d.ts.map +1 -1
  3. package/dist/attestation-receipt.d.ts +5 -39
  4. package/dist/attestation-receipt.d.ts.map +1 -1
  5. package/dist/attribution.cjs +2 -2
  6. package/dist/attribution.cjs.map +1 -1
  7. package/dist/attribution.d.ts +69 -448
  8. package/dist/attribution.d.ts.map +1 -1
  9. package/dist/attribution.mjs +2 -2
  10. package/dist/attribution.mjs.map +1 -1
  11. package/dist/carrier.d.ts +93 -0
  12. package/dist/carrier.d.ts.map +1 -0
  13. package/dist/dispute.d.ts +262 -780
  14. package/dist/dispute.d.ts.map +1 -1
  15. package/dist/errors.d.ts +13 -0
  16. package/dist/errors.d.ts.map +1 -1
  17. package/dist/index.cjs +123 -4
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.mjs +114 -5
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/interaction.cjs +1 -1
  24. package/dist/interaction.cjs.map +1 -1
  25. package/dist/interaction.d.ts +104 -596
  26. package/dist/interaction.d.ts.map +1 -1
  27. package/dist/interaction.mjs +1 -1
  28. package/dist/interaction.mjs.map +1 -1
  29. package/dist/json.d.ts +1 -1
  30. package/dist/json.d.ts.map +1 -1
  31. package/dist/obligations.d.ts +39 -139
  32. package/dist/obligations.d.ts.map +1 -1
  33. package/dist/receipt-parser.cjs +2 -2
  34. package/dist/receipt-parser.cjs.map +1 -1
  35. package/dist/receipt-parser.mjs +2 -2
  36. package/dist/receipt-parser.mjs.map +1 -1
  37. package/dist/validators.d.ts +200 -659
  38. package/dist/validators.d.ts.map +1 -1
  39. package/dist/workflow.d.ts +32 -345
  40. package/dist/workflow.d.ts.map +1 -1
  41. package/package.json +3 -3
@@ -54,21 +54,10 @@ export type HashEncoding = z.infer<typeof HashEncodingSchema>;
54
54
  * ```
55
55
  */
56
56
  export declare const ContentHashSchema: z.ZodObject<{
57
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
58
57
  alg: z.ZodLiteral<"sha-256">;
59
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
60
58
  value: z.ZodString;
61
- /** Encoding format (REQUIRED, must be 'base64url') */
62
59
  enc: z.ZodLiteral<"base64url">;
63
- }, "strict", z.ZodTypeAny, {
64
- value: string;
65
- alg: "sha-256";
66
- enc: "base64url";
67
- }, {
68
- value: string;
69
- alg: "sha-256";
70
- enc: "base64url";
71
- }>;
60
+ }, z.core.$strict>;
72
61
  export type ContentHash = z.infer<typeof ContentHashSchema>;
73
62
  /**
74
63
  * How source content was used in derivation.
@@ -79,7 +68,13 @@ export type ContentHash = z.infer<typeof ContentHashSchema>;
79
68
  * - 'synthesis_source': Combined with other sources to create new content
80
69
  * - 'embedding_source': Used to create embeddings/vectors
81
70
  */
82
- export declare const AttributionUsageSchema: z.ZodEnum<["training_input", "rag_context", "direct_reference", "synthesis_source", "embedding_source"]>;
71
+ export declare const AttributionUsageSchema: z.ZodEnum<{
72
+ training_input: "training_input";
73
+ rag_context: "rag_context";
74
+ direct_reference: "direct_reference";
75
+ synthesis_source: "synthesis_source";
76
+ embedding_source: "embedding_source";
77
+ }>;
83
78
  export type AttributionUsage = z.infer<typeof AttributionUsageSchema>;
84
79
  /**
85
80
  * Array of valid attribution usage types for runtime checks.
@@ -94,7 +89,13 @@ export declare const ATTRIBUTION_USAGES: readonly ["training_input", "rag_contex
94
89
  * - 'synthesis': Multi-source content synthesis
95
90
  * - 'embedding': Vector embedding generation
96
91
  */
97
- export declare const DerivationTypeSchema: z.ZodEnum<["training", "inference", "rag", "synthesis", "embedding"]>;
92
+ export declare const DerivationTypeSchema: z.ZodEnum<{
93
+ training: "training";
94
+ inference: "inference";
95
+ rag: "rag";
96
+ synthesis: "synthesis";
97
+ embedding: "embedding";
98
+ }>;
98
99
  export type DerivationType = z.infer<typeof DerivationTypeSchema>;
99
100
  /**
100
101
  * Array of valid derivation types for runtime checks.
@@ -118,85 +119,27 @@ export declare const DERIVATION_TYPES: readonly ["training", "inference", "rag",
118
119
  * ```
119
120
  */
120
121
  export declare const AttributionSourceSchema: z.ZodObject<{
121
- /** Reference to source PEAC receipt (REQUIRED) */
122
- receipt_ref: z.ZodEffects<z.ZodString, string, string>;
123
- /**
124
- * Issuer of the referenced receipt (OPTIONAL but RECOMMENDED for jti: refs).
125
- *
126
- * Required for cross-issuer resolution when receipt_ref is jti:{id} format.
127
- * Not needed for URL-based references which are self-resolvable.
128
- * Used to construct resolution URL: {receipt_issuer}/.well-known/peac/receipts/{id}
129
- */
122
+ receipt_ref: z.ZodString;
130
123
  receipt_issuer: z.ZodOptional<z.ZodString>;
131
- /** Hash of source content (OPTIONAL) */
132
124
  content_hash: z.ZodOptional<z.ZodObject<{
133
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
134
125
  alg: z.ZodLiteral<"sha-256">;
135
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
136
126
  value: z.ZodString;
137
- /** Encoding format (REQUIRED, must be 'base64url') */
138
127
  enc: z.ZodLiteral<"base64url">;
139
- }, "strict", z.ZodTypeAny, {
140
- value: string;
141
- alg: "sha-256";
142
- enc: "base64url";
143
- }, {
144
- value: string;
145
- alg: "sha-256";
146
- enc: "base64url";
147
- }>>;
148
- /** Hash of used excerpt (OPTIONAL, content-minimizing, not privacy-preserving for short text) */
128
+ }, z.core.$strict>>;
149
129
  excerpt_hash: z.ZodOptional<z.ZodObject<{
150
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
151
130
  alg: z.ZodLiteral<"sha-256">;
152
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
153
131
  value: z.ZodString;
154
- /** Encoding format (REQUIRED, must be 'base64url') */
155
132
  enc: z.ZodLiteral<"base64url">;
156
- }, "strict", z.ZodTypeAny, {
157
- value: string;
158
- alg: "sha-256";
159
- enc: "base64url";
160
- }, {
161
- value: string;
162
- alg: "sha-256";
163
- enc: "base64url";
164
- }>>;
165
- /** How the source was used (REQUIRED) */
166
- usage: z.ZodEnum<["training_input", "rag_context", "direct_reference", "synthesis_source", "embedding_source"]>;
167
- /** Relative contribution weight 0.0-1.0 (OPTIONAL) */
133
+ }, z.core.$strict>>;
134
+ usage: z.ZodEnum<{
135
+ training_input: "training_input";
136
+ rag_context: "rag_context";
137
+ direct_reference: "direct_reference";
138
+ synthesis_source: "synthesis_source";
139
+ embedding_source: "embedding_source";
140
+ }>;
168
141
  weight: z.ZodOptional<z.ZodNumber>;
169
- }, "strict", z.ZodTypeAny, {
170
- receipt_ref: string;
171
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
172
- receipt_issuer?: string | undefined;
173
- content_hash?: {
174
- value: string;
175
- alg: "sha-256";
176
- enc: "base64url";
177
- } | undefined;
178
- excerpt_hash?: {
179
- value: string;
180
- alg: "sha-256";
181
- enc: "base64url";
182
- } | undefined;
183
- weight?: number | undefined;
184
- }, {
185
- receipt_ref: string;
186
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
187
- receipt_issuer?: string | undefined;
188
- content_hash?: {
189
- value: string;
190
- alg: "sha-256";
191
- enc: "base64url";
192
- } | undefined;
193
- excerpt_hash?: {
194
- value: string;
195
- alg: "sha-256";
196
- enc: "base64url";
197
- } | undefined;
198
- weight?: number | undefined;
199
- }>;
142
+ }, z.core.$strict>;
200
143
  export type AttributionSource = z.infer<typeof AttributionSourceSchema>;
201
144
  /**
202
145
  * AttributionEvidence - the payload of an AttributionAttestation.
@@ -204,169 +147,45 @@ export type AttributionSource = z.infer<typeof AttributionSourceSchema>;
204
147
  * Contains the sources, derivation type, and optional output metadata.
205
148
  */
206
149
  export declare const AttributionEvidenceSchema: z.ZodObject<{
207
- /** Array of attribution sources (REQUIRED, 1-100 sources) */
208
150
  sources: z.ZodArray<z.ZodObject<{
209
- /** Reference to source PEAC receipt (REQUIRED) */
210
- receipt_ref: z.ZodEffects<z.ZodString, string, string>;
211
- /**
212
- * Issuer of the referenced receipt (OPTIONAL but RECOMMENDED for jti: refs).
213
- *
214
- * Required for cross-issuer resolution when receipt_ref is jti:{id} format.
215
- * Not needed for URL-based references which are self-resolvable.
216
- * Used to construct resolution URL: {receipt_issuer}/.well-known/peac/receipts/{id}
217
- */
151
+ receipt_ref: z.ZodString;
218
152
  receipt_issuer: z.ZodOptional<z.ZodString>;
219
- /** Hash of source content (OPTIONAL) */
220
153
  content_hash: z.ZodOptional<z.ZodObject<{
221
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
222
154
  alg: z.ZodLiteral<"sha-256">;
223
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
224
155
  value: z.ZodString;
225
- /** Encoding format (REQUIRED, must be 'base64url') */
226
156
  enc: z.ZodLiteral<"base64url">;
227
- }, "strict", z.ZodTypeAny, {
228
- value: string;
229
- alg: "sha-256";
230
- enc: "base64url";
231
- }, {
232
- value: string;
233
- alg: "sha-256";
234
- enc: "base64url";
235
- }>>;
236
- /** Hash of used excerpt (OPTIONAL, content-minimizing, not privacy-preserving for short text) */
157
+ }, z.core.$strict>>;
237
158
  excerpt_hash: z.ZodOptional<z.ZodObject<{
238
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
239
159
  alg: z.ZodLiteral<"sha-256">;
240
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
241
160
  value: z.ZodString;
242
- /** Encoding format (REQUIRED, must be 'base64url') */
243
161
  enc: z.ZodLiteral<"base64url">;
244
- }, "strict", z.ZodTypeAny, {
245
- value: string;
246
- alg: "sha-256";
247
- enc: "base64url";
248
- }, {
249
- value: string;
250
- alg: "sha-256";
251
- enc: "base64url";
252
- }>>;
253
- /** How the source was used (REQUIRED) */
254
- usage: z.ZodEnum<["training_input", "rag_context", "direct_reference", "synthesis_source", "embedding_source"]>;
255
- /** Relative contribution weight 0.0-1.0 (OPTIONAL) */
162
+ }, z.core.$strict>>;
163
+ usage: z.ZodEnum<{
164
+ training_input: "training_input";
165
+ rag_context: "rag_context";
166
+ direct_reference: "direct_reference";
167
+ synthesis_source: "synthesis_source";
168
+ embedding_source: "embedding_source";
169
+ }>;
256
170
  weight: z.ZodOptional<z.ZodNumber>;
257
- }, "strict", z.ZodTypeAny, {
258
- receipt_ref: string;
259
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
260
- receipt_issuer?: string | undefined;
261
- content_hash?: {
262
- value: string;
263
- alg: "sha-256";
264
- enc: "base64url";
265
- } | undefined;
266
- excerpt_hash?: {
267
- value: string;
268
- alg: "sha-256";
269
- enc: "base64url";
270
- } | undefined;
271
- weight?: number | undefined;
272
- }, {
273
- receipt_ref: string;
274
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
275
- receipt_issuer?: string | undefined;
276
- content_hash?: {
277
- value: string;
278
- alg: "sha-256";
279
- enc: "base64url";
280
- } | undefined;
281
- excerpt_hash?: {
282
- value: string;
283
- alg: "sha-256";
284
- enc: "base64url";
285
- } | undefined;
286
- weight?: number | undefined;
287
- }>, "many">;
288
- /** Type of derivation (REQUIRED) */
289
- derivation_type: z.ZodEnum<["training", "inference", "rag", "synthesis", "embedding"]>;
290
- /** Hash of derived output (OPTIONAL) */
171
+ }, z.core.$strict>>;
172
+ derivation_type: z.ZodEnum<{
173
+ training: "training";
174
+ inference: "inference";
175
+ rag: "rag";
176
+ synthesis: "synthesis";
177
+ embedding: "embedding";
178
+ }>;
291
179
  output_hash: z.ZodOptional<z.ZodObject<{
292
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
293
180
  alg: z.ZodLiteral<"sha-256">;
294
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
295
181
  value: z.ZodString;
296
- /** Encoding format (REQUIRED, must be 'base64url') */
297
182
  enc: z.ZodLiteral<"base64url">;
298
- }, "strict", z.ZodTypeAny, {
299
- value: string;
300
- alg: "sha-256";
301
- enc: "base64url";
302
- }, {
303
- value: string;
304
- alg: "sha-256";
305
- enc: "base64url";
306
- }>>;
307
- /** Model identifier (OPTIONAL) */
183
+ }, z.core.$strict>>;
308
184
  model_id: z.ZodOptional<z.ZodString>;
309
- /** Inference provider URL (OPTIONAL) */
310
185
  inference_provider: z.ZodOptional<z.ZodString>;
311
- /** Session correlation ID (OPTIONAL) */
312
186
  session_id: z.ZodOptional<z.ZodString>;
313
- /** Additional type-specific metadata (OPTIONAL) */
314
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
315
- }, "strict", z.ZodTypeAny, {
316
- sources: {
317
- receipt_ref: string;
318
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
319
- receipt_issuer?: string | undefined;
320
- content_hash?: {
321
- value: string;
322
- alg: "sha-256";
323
- enc: "base64url";
324
- } | undefined;
325
- excerpt_hash?: {
326
- value: string;
327
- alg: "sha-256";
328
- enc: "base64url";
329
- } | undefined;
330
- weight?: number | undefined;
331
- }[];
332
- derivation_type: "training" | "inference" | "rag" | "synthesis" | "embedding";
333
- metadata?: Record<string, JsonValue> | undefined;
334
- output_hash?: {
335
- value: string;
336
- alg: "sha-256";
337
- enc: "base64url";
338
- } | undefined;
339
- model_id?: string | undefined;
340
- inference_provider?: string | undefined;
341
- session_id?: string | undefined;
342
- }, {
343
- sources: {
344
- receipt_ref: string;
345
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
346
- receipt_issuer?: string | undefined;
347
- content_hash?: {
348
- value: string;
349
- alg: "sha-256";
350
- enc: "base64url";
351
- } | undefined;
352
- excerpt_hash?: {
353
- value: string;
354
- alg: "sha-256";
355
- enc: "base64url";
356
- } | undefined;
357
- weight?: number | undefined;
358
- }[];
359
- derivation_type: "training" | "inference" | "rag" | "synthesis" | "embedding";
360
- metadata?: Record<string, JsonValue> | undefined;
361
- output_hash?: {
362
- value: string;
363
- alg: "sha-256";
364
- enc: "base64url";
365
- } | undefined;
366
- model_id?: string | undefined;
367
- inference_provider?: string | undefined;
368
- session_id?: string | undefined;
369
- }>;
187
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
188
+ }, z.core.$strict>;
370
189
  export type AttributionEvidence = z.infer<typeof AttributionEvidenceSchema>;
371
190
  /**
372
191
  * Attestation type literal for attribution
@@ -396,250 +215,52 @@ export declare const ATTRIBUTION_TYPE: "peac/attribution";
396
215
  * ```
397
216
  */
398
217
  export declare const AttributionAttestationSchema: z.ZodObject<{
399
- /** Attestation type (MUST be 'peac/attribution') */
400
218
  type: z.ZodLiteral<"peac/attribution">;
401
- /** Issuer of the attestation (inference provider, platform) */
402
219
  issuer: z.ZodString;
403
- /** When the attestation was issued (RFC 3339) */
404
220
  issued_at: z.ZodString;
405
- /** When the attestation expires (RFC 3339, OPTIONAL) */
406
221
  expires_at: z.ZodOptional<z.ZodString>;
407
- /** Reference to external verification endpoint (OPTIONAL) */
408
222
  ref: z.ZodOptional<z.ZodString>;
409
- /** Attribution evidence */
410
223
  evidence: z.ZodObject<{
411
- /** Array of attribution sources (REQUIRED, 1-100 sources) */
412
224
  sources: z.ZodArray<z.ZodObject<{
413
- /** Reference to source PEAC receipt (REQUIRED) */
414
- receipt_ref: z.ZodEffects<z.ZodString, string, string>;
415
- /**
416
- * Issuer of the referenced receipt (OPTIONAL but RECOMMENDED for jti: refs).
417
- *
418
- * Required for cross-issuer resolution when receipt_ref is jti:{id} format.
419
- * Not needed for URL-based references which are self-resolvable.
420
- * Used to construct resolution URL: {receipt_issuer}/.well-known/peac/receipts/{id}
421
- */
225
+ receipt_ref: z.ZodString;
422
226
  receipt_issuer: z.ZodOptional<z.ZodString>;
423
- /** Hash of source content (OPTIONAL) */
424
227
  content_hash: z.ZodOptional<z.ZodObject<{
425
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
426
228
  alg: z.ZodLiteral<"sha-256">;
427
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
428
229
  value: z.ZodString;
429
- /** Encoding format (REQUIRED, must be 'base64url') */
430
230
  enc: z.ZodLiteral<"base64url">;
431
- }, "strict", z.ZodTypeAny, {
432
- value: string;
433
- alg: "sha-256";
434
- enc: "base64url";
435
- }, {
436
- value: string;
437
- alg: "sha-256";
438
- enc: "base64url";
439
- }>>;
440
- /** Hash of used excerpt (OPTIONAL, content-minimizing, not privacy-preserving for short text) */
231
+ }, z.core.$strict>>;
441
232
  excerpt_hash: z.ZodOptional<z.ZodObject<{
442
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
443
233
  alg: z.ZodLiteral<"sha-256">;
444
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
445
234
  value: z.ZodString;
446
- /** Encoding format (REQUIRED, must be 'base64url') */
447
235
  enc: z.ZodLiteral<"base64url">;
448
- }, "strict", z.ZodTypeAny, {
449
- value: string;
450
- alg: "sha-256";
451
- enc: "base64url";
452
- }, {
453
- value: string;
454
- alg: "sha-256";
455
- enc: "base64url";
456
- }>>;
457
- /** How the source was used (REQUIRED) */
458
- usage: z.ZodEnum<["training_input", "rag_context", "direct_reference", "synthesis_source", "embedding_source"]>;
459
- /** Relative contribution weight 0.0-1.0 (OPTIONAL) */
236
+ }, z.core.$strict>>;
237
+ usage: z.ZodEnum<{
238
+ training_input: "training_input";
239
+ rag_context: "rag_context";
240
+ direct_reference: "direct_reference";
241
+ synthesis_source: "synthesis_source";
242
+ embedding_source: "embedding_source";
243
+ }>;
460
244
  weight: z.ZodOptional<z.ZodNumber>;
461
- }, "strict", z.ZodTypeAny, {
462
- receipt_ref: string;
463
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
464
- receipt_issuer?: string | undefined;
465
- content_hash?: {
466
- value: string;
467
- alg: "sha-256";
468
- enc: "base64url";
469
- } | undefined;
470
- excerpt_hash?: {
471
- value: string;
472
- alg: "sha-256";
473
- enc: "base64url";
474
- } | undefined;
475
- weight?: number | undefined;
476
- }, {
477
- receipt_ref: string;
478
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
479
- receipt_issuer?: string | undefined;
480
- content_hash?: {
481
- value: string;
482
- alg: "sha-256";
483
- enc: "base64url";
484
- } | undefined;
485
- excerpt_hash?: {
486
- value: string;
487
- alg: "sha-256";
488
- enc: "base64url";
489
- } | undefined;
490
- weight?: number | undefined;
491
- }>, "many">;
492
- /** Type of derivation (REQUIRED) */
493
- derivation_type: z.ZodEnum<["training", "inference", "rag", "synthesis", "embedding"]>;
494
- /** Hash of derived output (OPTIONAL) */
245
+ }, z.core.$strict>>;
246
+ derivation_type: z.ZodEnum<{
247
+ training: "training";
248
+ inference: "inference";
249
+ rag: "rag";
250
+ synthesis: "synthesis";
251
+ embedding: "embedding";
252
+ }>;
495
253
  output_hash: z.ZodOptional<z.ZodObject<{
496
- /** Hash algorithm (REQUIRED, must be 'sha-256') */
497
254
  alg: z.ZodLiteral<"sha-256">;
498
- /** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
499
255
  value: z.ZodString;
500
- /** Encoding format (REQUIRED, must be 'base64url') */
501
256
  enc: z.ZodLiteral<"base64url">;
502
- }, "strict", z.ZodTypeAny, {
503
- value: string;
504
- alg: "sha-256";
505
- enc: "base64url";
506
- }, {
507
- value: string;
508
- alg: "sha-256";
509
- enc: "base64url";
510
- }>>;
511
- /** Model identifier (OPTIONAL) */
257
+ }, z.core.$strict>>;
512
258
  model_id: z.ZodOptional<z.ZodString>;
513
- /** Inference provider URL (OPTIONAL) */
514
259
  inference_provider: z.ZodOptional<z.ZodString>;
515
- /** Session correlation ID (OPTIONAL) */
516
260
  session_id: z.ZodOptional<z.ZodString>;
517
- /** Additional type-specific metadata (OPTIONAL) */
518
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>>;
519
- }, "strict", z.ZodTypeAny, {
520
- sources: {
521
- receipt_ref: string;
522
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
523
- receipt_issuer?: string | undefined;
524
- content_hash?: {
525
- value: string;
526
- alg: "sha-256";
527
- enc: "base64url";
528
- } | undefined;
529
- excerpt_hash?: {
530
- value: string;
531
- alg: "sha-256";
532
- enc: "base64url";
533
- } | undefined;
534
- weight?: number | undefined;
535
- }[];
536
- derivation_type: "training" | "inference" | "rag" | "synthesis" | "embedding";
537
- metadata?: Record<string, JsonValue> | undefined;
538
- output_hash?: {
539
- value: string;
540
- alg: "sha-256";
541
- enc: "base64url";
542
- } | undefined;
543
- model_id?: string | undefined;
544
- inference_provider?: string | undefined;
545
- session_id?: string | undefined;
546
- }, {
547
- sources: {
548
- receipt_ref: string;
549
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
550
- receipt_issuer?: string | undefined;
551
- content_hash?: {
552
- value: string;
553
- alg: "sha-256";
554
- enc: "base64url";
555
- } | undefined;
556
- excerpt_hash?: {
557
- value: string;
558
- alg: "sha-256";
559
- enc: "base64url";
560
- } | undefined;
561
- weight?: number | undefined;
562
- }[];
563
- derivation_type: "training" | "inference" | "rag" | "synthesis" | "embedding";
564
- metadata?: Record<string, JsonValue> | undefined;
565
- output_hash?: {
566
- value: string;
567
- alg: "sha-256";
568
- enc: "base64url";
569
- } | undefined;
570
- model_id?: string | undefined;
571
- inference_provider?: string | undefined;
572
- session_id?: string | undefined;
573
- }>;
574
- }, "strict", z.ZodTypeAny, {
575
- type: "peac/attribution";
576
- issuer: string;
577
- issued_at: string;
578
- evidence: {
579
- sources: {
580
- receipt_ref: string;
581
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
582
- receipt_issuer?: string | undefined;
583
- content_hash?: {
584
- value: string;
585
- alg: "sha-256";
586
- enc: "base64url";
587
- } | undefined;
588
- excerpt_hash?: {
589
- value: string;
590
- alg: "sha-256";
591
- enc: "base64url";
592
- } | undefined;
593
- weight?: number | undefined;
594
- }[];
595
- derivation_type: "training" | "inference" | "rag" | "synthesis" | "embedding";
596
- metadata?: Record<string, JsonValue> | undefined;
597
- output_hash?: {
598
- value: string;
599
- alg: "sha-256";
600
- enc: "base64url";
601
- } | undefined;
602
- model_id?: string | undefined;
603
- inference_provider?: string | undefined;
604
- session_id?: string | undefined;
605
- };
606
- expires_at?: string | undefined;
607
- ref?: string | undefined;
608
- }, {
609
- type: "peac/attribution";
610
- issuer: string;
611
- issued_at: string;
612
- evidence: {
613
- sources: {
614
- receipt_ref: string;
615
- usage: "training_input" | "rag_context" | "direct_reference" | "synthesis_source" | "embedding_source";
616
- receipt_issuer?: string | undefined;
617
- content_hash?: {
618
- value: string;
619
- alg: "sha-256";
620
- enc: "base64url";
621
- } | undefined;
622
- excerpt_hash?: {
623
- value: string;
624
- alg: "sha-256";
625
- enc: "base64url";
626
- } | undefined;
627
- weight?: number | undefined;
628
- }[];
629
- derivation_type: "training" | "inference" | "rag" | "synthesis" | "embedding";
630
- metadata?: Record<string, JsonValue> | undefined;
631
- output_hash?: {
632
- value: string;
633
- alg: "sha-256";
634
- enc: "base64url";
635
- } | undefined;
636
- model_id?: string | undefined;
637
- inference_provider?: string | undefined;
638
- session_id?: string | undefined;
639
- };
640
- expires_at?: string | undefined;
641
- ref?: string | undefined;
642
- }>;
261
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
262
+ }, z.core.$strict>;
263
+ }, z.core.$strict>;
643
264
  export type AttributionAttestation = z.infer<typeof AttributionAttestationSchema>;
644
265
  /**
645
266
  * Result of chain verification including depth and resolved sources.
@@ -1 +1 @@
1
- {"version":3,"file":"attribution.d.ts","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ACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,kCAAkC,GACzC,sBAAsB,CAqCxB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,sBAAsB,EACnC,SAAS,GAAE,MAAc,GACxB,OAAO,CAOT;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,sBAAsB,EACnC,SAAS,GAAE,MAAc,GACxB,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,MAAM,GAAG,SAAS,CAMnF;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAAE,EAC5B,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,MAAM,GAAG,SAAS,CAOpB"}
@@ -21,13 +21,13 @@ var JsonValueSchema = z.lazy(
21
21
  z.array(JsonValueSchema),
22
22
  // Plain object check then record validation
23
23
  PlainObjectSchema.transform((obj) => obj).pipe(
24
- z.record(JsonValueSchema)
24
+ z.record(z.string(), JsonValueSchema)
25
25
  )
26
26
  ])
27
27
  );
28
28
  PlainObjectSchema.transform(
29
29
  (obj) => obj
30
- ).pipe(z.record(JsonValueSchema));
30
+ ).pipe(z.record(z.string(), JsonValueSchema));
31
31
  z.array(JsonValueSchema);
32
32
 
33
33
  // src/attribution.ts