@peac/schema 0.9.18

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 (50) hide show
  1. package/README.md +23 -0
  2. package/dist/constants.d.ts +28 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/constants.js +32 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/control.d.ts +155 -0
  7. package/dist/control.d.ts.map +1 -0
  8. package/dist/control.js +9 -0
  9. package/dist/control.js.map +1 -0
  10. package/dist/envelope.d.ts +62 -0
  11. package/dist/envelope.d.ts.map +1 -0
  12. package/dist/envelope.js +9 -0
  13. package/dist/envelope.js.map +1 -0
  14. package/dist/errors.d.ts +134 -0
  15. package/dist/errors.d.ts.map +1 -0
  16. package/dist/errors.js +51 -0
  17. package/dist/errors.js.map +1 -0
  18. package/dist/evidence.d.ts +267 -0
  19. package/dist/evidence.d.ts.map +1 -0
  20. package/dist/evidence.js +8 -0
  21. package/dist/evidence.js.map +1 -0
  22. package/dist/index.d.ts +15 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +57 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/normalize.d.ts +92 -0
  27. package/dist/normalize.d.ts.map +1 -0
  28. package/dist/normalize.js +102 -0
  29. package/dist/normalize.js.map +1 -0
  30. package/dist/schemas.d.ts +3 -0
  31. package/dist/schemas.d.ts.map +1 -0
  32. package/dist/schemas.js +7 -0
  33. package/dist/schemas.js.map +1 -0
  34. package/dist/subject.d.ts +111 -0
  35. package/dist/subject.d.ts.map +1 -0
  36. package/dist/subject.js +9 -0
  37. package/dist/subject.js.map +1 -0
  38. package/dist/types.d.ts +139 -0
  39. package/dist/types.d.ts.map +1 -0
  40. package/dist/types.js +6 -0
  41. package/dist/types.js.map +1 -0
  42. package/dist/validators.d.ts +656 -0
  43. package/dist/validators.d.ts.map +1 -0
  44. package/dist/validators.js +290 -0
  45. package/dist/validators.js.map +1 -0
  46. package/dist/version.d.ts +4 -0
  47. package/dist/version.d.ts.map +1 -0
  48. package/dist/version.js +7 -0
  49. package/dist/version.js.map +1 -0
  50. package/package.json +40 -0
@@ -0,0 +1,656 @@
1
+ /**
2
+ * Zod validators for PEAC protocol types
3
+ */
4
+ import { z } from 'zod';
5
+ export declare const NormalizedPayment: z.ZodObject<{
6
+ rail: z.ZodString;
7
+ reference: z.ZodString;
8
+ amount: z.ZodNumber;
9
+ currency: z.ZodString;
10
+ asset: z.ZodOptional<z.ZodString>;
11
+ env: z.ZodOptional<z.ZodString>;
12
+ evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
+ }, "strict", z.ZodTypeAny, {
15
+ rail: string;
16
+ reference: string;
17
+ amount: number;
18
+ currency: string;
19
+ asset?: string | undefined;
20
+ env?: string | undefined;
21
+ evidence?: Record<string, unknown> | undefined;
22
+ metadata?: Record<string, unknown> | undefined;
23
+ }, {
24
+ rail: string;
25
+ reference: string;
26
+ amount: number;
27
+ currency: string;
28
+ asset?: string | undefined;
29
+ env?: string | undefined;
30
+ evidence?: Record<string, unknown> | undefined;
31
+ metadata?: Record<string, unknown> | undefined;
32
+ }>;
33
+ export declare const Subject: z.ZodObject<{
34
+ uri: z.ZodEffects<z.ZodString, string, string>;
35
+ }, "strict", z.ZodTypeAny, {
36
+ uri: string;
37
+ }, {
38
+ uri: string;
39
+ }>;
40
+ export declare const AIPREFSnapshot: z.ZodObject<{
41
+ url: z.ZodEffects<z.ZodString, string, string>;
42
+ hash: z.ZodString;
43
+ }, "strict", z.ZodTypeAny, {
44
+ url: string;
45
+ hash: string;
46
+ }, {
47
+ url: string;
48
+ hash: string;
49
+ }>;
50
+ export declare const Extensions: z.ZodObject<{
51
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
52
+ url: z.ZodEffects<z.ZodString, string, string>;
53
+ hash: z.ZodString;
54
+ }, "strict", z.ZodTypeAny, {
55
+ url: string;
56
+ hash: string;
57
+ }, {
58
+ url: string;
59
+ hash: string;
60
+ }>>;
61
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
62
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
63
+ url: z.ZodEffects<z.ZodString, string, string>;
64
+ hash: z.ZodString;
65
+ }, "strict", z.ZodTypeAny, {
66
+ url: string;
67
+ hash: string;
68
+ }, {
69
+ url: string;
70
+ hash: string;
71
+ }>>;
72
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
73
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
74
+ url: z.ZodEffects<z.ZodString, string, string>;
75
+ hash: z.ZodString;
76
+ }, "strict", z.ZodTypeAny, {
77
+ url: string;
78
+ hash: string;
79
+ }, {
80
+ url: string;
81
+ hash: string;
82
+ }>>;
83
+ }, z.ZodUnknown, "strip">>;
84
+ export declare const JWSHeader: z.ZodObject<{
85
+ typ: z.ZodLiteral<"peac.receipt/0.9">;
86
+ alg: z.ZodLiteral<"EdDSA">;
87
+ kid: z.ZodString;
88
+ }, "strict", z.ZodTypeAny, {
89
+ typ: "peac.receipt/0.9";
90
+ alg: "EdDSA";
91
+ kid: string;
92
+ }, {
93
+ typ: "peac.receipt/0.9";
94
+ alg: "EdDSA";
95
+ kid: string;
96
+ }>;
97
+ export declare const ReceiptClaims: z.ZodObject<{
98
+ iss: z.ZodEffects<z.ZodString, string, string>;
99
+ aud: z.ZodEffects<z.ZodString, string, string>;
100
+ iat: z.ZodNumber;
101
+ exp: z.ZodOptional<z.ZodNumber>;
102
+ rid: z.ZodString;
103
+ amt: z.ZodNumber;
104
+ cur: z.ZodString;
105
+ payment: z.ZodObject<{
106
+ rail: z.ZodString;
107
+ reference: z.ZodString;
108
+ amount: z.ZodNumber;
109
+ currency: z.ZodString;
110
+ asset: z.ZodOptional<z.ZodString>;
111
+ env: z.ZodOptional<z.ZodString>;
112
+ evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
113
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
114
+ }, "strict", z.ZodTypeAny, {
115
+ rail: string;
116
+ reference: string;
117
+ amount: number;
118
+ currency: string;
119
+ asset?: string | undefined;
120
+ env?: string | undefined;
121
+ evidence?: Record<string, unknown> | undefined;
122
+ metadata?: Record<string, unknown> | undefined;
123
+ }, {
124
+ rail: string;
125
+ reference: string;
126
+ amount: number;
127
+ currency: string;
128
+ asset?: string | undefined;
129
+ env?: string | undefined;
130
+ evidence?: Record<string, unknown> | undefined;
131
+ metadata?: Record<string, unknown> | undefined;
132
+ }>;
133
+ subject: z.ZodOptional<z.ZodObject<{
134
+ uri: z.ZodEffects<z.ZodString, string, string>;
135
+ }, "strict", z.ZodTypeAny, {
136
+ uri: string;
137
+ }, {
138
+ uri: string;
139
+ }>>;
140
+ ext: z.ZodOptional<z.ZodObject<{
141
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
142
+ url: z.ZodEffects<z.ZodString, string, string>;
143
+ hash: z.ZodString;
144
+ }, "strict", z.ZodTypeAny, {
145
+ url: string;
146
+ hash: string;
147
+ }, {
148
+ url: string;
149
+ hash: string;
150
+ }>>;
151
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
152
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
153
+ url: z.ZodEffects<z.ZodString, string, string>;
154
+ hash: z.ZodString;
155
+ }, "strict", z.ZodTypeAny, {
156
+ url: string;
157
+ hash: string;
158
+ }, {
159
+ url: string;
160
+ hash: string;
161
+ }>>;
162
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
163
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
164
+ url: z.ZodEffects<z.ZodString, string, string>;
165
+ hash: z.ZodString;
166
+ }, "strict", z.ZodTypeAny, {
167
+ url: string;
168
+ hash: string;
169
+ }, {
170
+ url: string;
171
+ hash: string;
172
+ }>>;
173
+ }, z.ZodUnknown, "strip">>>;
174
+ }, "strict", z.ZodTypeAny, {
175
+ iss: string;
176
+ aud: string;
177
+ iat: number;
178
+ rid: string;
179
+ amt: number;
180
+ cur: string;
181
+ payment: {
182
+ rail: string;
183
+ reference: string;
184
+ amount: number;
185
+ currency: string;
186
+ asset?: string | undefined;
187
+ env?: string | undefined;
188
+ evidence?: Record<string, unknown> | undefined;
189
+ metadata?: Record<string, unknown> | undefined;
190
+ };
191
+ exp?: number | undefined;
192
+ subject?: {
193
+ uri: string;
194
+ } | undefined;
195
+ ext?: z.objectOutputType<{
196
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
197
+ url: z.ZodEffects<z.ZodString, string, string>;
198
+ hash: z.ZodString;
199
+ }, "strict", z.ZodTypeAny, {
200
+ url: string;
201
+ hash: string;
202
+ }, {
203
+ url: string;
204
+ hash: string;
205
+ }>>;
206
+ }, z.ZodUnknown, "strip"> | undefined;
207
+ }, {
208
+ iss: string;
209
+ aud: string;
210
+ iat: number;
211
+ rid: string;
212
+ amt: number;
213
+ cur: string;
214
+ payment: {
215
+ rail: string;
216
+ reference: string;
217
+ amount: number;
218
+ currency: string;
219
+ asset?: string | undefined;
220
+ env?: string | undefined;
221
+ evidence?: Record<string, unknown> | undefined;
222
+ metadata?: Record<string, unknown> | undefined;
223
+ };
224
+ exp?: number | undefined;
225
+ subject?: {
226
+ uri: string;
227
+ } | undefined;
228
+ ext?: z.objectInputType<{
229
+ aipref_snapshot: z.ZodOptional<z.ZodObject<{
230
+ url: z.ZodEffects<z.ZodString, string, string>;
231
+ hash: z.ZodString;
232
+ }, "strict", z.ZodTypeAny, {
233
+ url: string;
234
+ hash: string;
235
+ }, {
236
+ url: string;
237
+ hash: string;
238
+ }>>;
239
+ }, z.ZodUnknown, "strip"> | undefined;
240
+ }>;
241
+ export declare const VerifyRequest: z.ZodObject<{
242
+ receipt_jws: z.ZodString;
243
+ }, "strict", z.ZodTypeAny, {
244
+ receipt_jws: string;
245
+ }, {
246
+ receipt_jws: string;
247
+ }>;
248
+ /**
249
+ * Control purpose - what the access is for
250
+ *
251
+ * v0.9.17+: Added ai_input, search for RSL alignment
252
+ * v0.9.18+: Added ai_index (RSL 1.0 canonical token). Removed ai_search.
253
+ *
254
+ * @see https://rslstandard.org/rsl for RSL 1.0 specification
255
+ */
256
+ export declare const ControlPurposeSchema: z.ZodEnum<["crawl", "index", "train", "inference", "ai_input", "ai_index", "search"]>;
257
+ /**
258
+ * Control licensing mode - how access is licensed
259
+ */
260
+ export declare const ControlLicensingModeSchema: z.ZodEnum<["subscription", "pay_per_crawl", "pay_per_inference"]>;
261
+ /**
262
+ * Control decision type
263
+ */
264
+ export declare const ControlDecisionSchema: z.ZodEnum<["allow", "deny", "review"]>;
265
+ /**
266
+ * Single control step in governance chain
267
+ */
268
+ export declare const ControlStepSchema: z.ZodObject<{
269
+ engine: z.ZodString;
270
+ version: z.ZodOptional<z.ZodString>;
271
+ policy_id: z.ZodOptional<z.ZodString>;
272
+ result: z.ZodEnum<["allow", "deny", "review"]>;
273
+ reason: z.ZodOptional<z.ZodString>;
274
+ purpose: z.ZodOptional<z.ZodEnum<["crawl", "index", "train", "inference", "ai_input", "ai_index", "search"]>>;
275
+ licensing_mode: z.ZodOptional<z.ZodEnum<["subscription", "pay_per_crawl", "pay_per_inference"]>>;
276
+ scope: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
277
+ limits_snapshot: z.ZodOptional<z.ZodUnknown>;
278
+ evidence_ref: z.ZodOptional<z.ZodString>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ engine: string;
281
+ result: "allow" | "deny" | "review";
282
+ version?: string | undefined;
283
+ policy_id?: string | undefined;
284
+ reason?: string | undefined;
285
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
286
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
287
+ scope?: string | string[] | undefined;
288
+ limits_snapshot?: unknown;
289
+ evidence_ref?: string | undefined;
290
+ }, {
291
+ engine: string;
292
+ result: "allow" | "deny" | "review";
293
+ version?: string | undefined;
294
+ policy_id?: string | undefined;
295
+ reason?: string | undefined;
296
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
297
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
298
+ scope?: string | string[] | undefined;
299
+ limits_snapshot?: unknown;
300
+ evidence_ref?: string | undefined;
301
+ }>;
302
+ /**
303
+ * Composable control block - multi-party governance
304
+ */
305
+ export declare const ControlBlockSchema: z.ZodEffects<z.ZodObject<{
306
+ chain: z.ZodArray<z.ZodObject<{
307
+ engine: z.ZodString;
308
+ version: z.ZodOptional<z.ZodString>;
309
+ policy_id: z.ZodOptional<z.ZodString>;
310
+ result: z.ZodEnum<["allow", "deny", "review"]>;
311
+ reason: z.ZodOptional<z.ZodString>;
312
+ purpose: z.ZodOptional<z.ZodEnum<["crawl", "index", "train", "inference", "ai_input", "ai_index", "search"]>>;
313
+ licensing_mode: z.ZodOptional<z.ZodEnum<["subscription", "pay_per_crawl", "pay_per_inference"]>>;
314
+ scope: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
315
+ limits_snapshot: z.ZodOptional<z.ZodUnknown>;
316
+ evidence_ref: z.ZodOptional<z.ZodString>;
317
+ }, "strip", z.ZodTypeAny, {
318
+ engine: string;
319
+ result: "allow" | "deny" | "review";
320
+ version?: string | undefined;
321
+ policy_id?: string | undefined;
322
+ reason?: string | undefined;
323
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
324
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
325
+ scope?: string | string[] | undefined;
326
+ limits_snapshot?: unknown;
327
+ evidence_ref?: string | undefined;
328
+ }, {
329
+ engine: string;
330
+ result: "allow" | "deny" | "review";
331
+ version?: string | undefined;
332
+ policy_id?: string | undefined;
333
+ reason?: string | undefined;
334
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
335
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
336
+ scope?: string | string[] | undefined;
337
+ limits_snapshot?: unknown;
338
+ evidence_ref?: string | undefined;
339
+ }>, "many">;
340
+ decision: z.ZodEnum<["allow", "deny", "review"]>;
341
+ combinator: z.ZodOptional<z.ZodLiteral<"any_can_veto">>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ chain: {
344
+ engine: string;
345
+ result: "allow" | "deny" | "review";
346
+ version?: string | undefined;
347
+ policy_id?: string | undefined;
348
+ reason?: string | undefined;
349
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
350
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
351
+ scope?: string | string[] | undefined;
352
+ limits_snapshot?: unknown;
353
+ evidence_ref?: string | undefined;
354
+ }[];
355
+ decision: "allow" | "deny" | "review";
356
+ combinator?: "any_can_veto" | undefined;
357
+ }, {
358
+ chain: {
359
+ engine: string;
360
+ result: "allow" | "deny" | "review";
361
+ version?: string | undefined;
362
+ policy_id?: string | undefined;
363
+ reason?: string | undefined;
364
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
365
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
366
+ scope?: string | string[] | undefined;
367
+ limits_snapshot?: unknown;
368
+ evidence_ref?: string | undefined;
369
+ }[];
370
+ decision: "allow" | "deny" | "review";
371
+ combinator?: "any_can_veto" | undefined;
372
+ }>, {
373
+ chain: {
374
+ engine: string;
375
+ result: "allow" | "deny" | "review";
376
+ version?: string | undefined;
377
+ policy_id?: string | undefined;
378
+ reason?: string | undefined;
379
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
380
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
381
+ scope?: string | string[] | undefined;
382
+ limits_snapshot?: unknown;
383
+ evidence_ref?: string | undefined;
384
+ }[];
385
+ decision: "allow" | "deny" | "review";
386
+ combinator?: "any_can_veto" | undefined;
387
+ }, {
388
+ chain: {
389
+ engine: string;
390
+ result: "allow" | "deny" | "review";
391
+ version?: string | undefined;
392
+ policy_id?: string | undefined;
393
+ reason?: string | undefined;
394
+ purpose?: "crawl" | "index" | "train" | "inference" | "ai_input" | "ai_index" | "search" | undefined;
395
+ licensing_mode?: "subscription" | "pay_per_crawl" | "pay_per_inference" | undefined;
396
+ scope?: string | string[] | undefined;
397
+ limits_snapshot?: unknown;
398
+ evidence_ref?: string | undefined;
399
+ }[];
400
+ decision: "allow" | "deny" | "review";
401
+ combinator?: "any_can_veto" | undefined;
402
+ }>;
403
+ /**
404
+ * Payment split schema
405
+ *
406
+ * Invariants:
407
+ * - party is required (non-empty string)
408
+ * - amount if present must be >= 0
409
+ * - share if present must be in [0,1]
410
+ * - At least one of amount or share must be specified
411
+ */
412
+ export declare const PaymentSplitSchema: z.ZodEffects<z.ZodObject<{
413
+ party: z.ZodString;
414
+ amount: z.ZodOptional<z.ZodNumber>;
415
+ currency: z.ZodOptional<z.ZodString>;
416
+ share: z.ZodOptional<z.ZodNumber>;
417
+ rail: z.ZodOptional<z.ZodString>;
418
+ account_ref: z.ZodOptional<z.ZodString>;
419
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
420
+ }, "strict", z.ZodTypeAny, {
421
+ party: string;
422
+ rail?: string | undefined;
423
+ amount?: number | undefined;
424
+ currency?: string | undefined;
425
+ metadata?: Record<string, unknown> | undefined;
426
+ share?: number | undefined;
427
+ account_ref?: string | undefined;
428
+ }, {
429
+ party: string;
430
+ rail?: string | undefined;
431
+ amount?: number | undefined;
432
+ currency?: string | undefined;
433
+ metadata?: Record<string, unknown> | undefined;
434
+ share?: number | undefined;
435
+ account_ref?: string | undefined;
436
+ }>, {
437
+ party: string;
438
+ rail?: string | undefined;
439
+ amount?: number | undefined;
440
+ currency?: string | undefined;
441
+ metadata?: Record<string, unknown> | undefined;
442
+ share?: number | undefined;
443
+ account_ref?: string | undefined;
444
+ }, {
445
+ party: string;
446
+ rail?: string | undefined;
447
+ amount?: number | undefined;
448
+ currency?: string | undefined;
449
+ metadata?: Record<string, unknown> | undefined;
450
+ share?: number | undefined;
451
+ account_ref?: string | undefined;
452
+ }>;
453
+ /**
454
+ * Payment routing mode schema (rail-agnostic)
455
+ *
456
+ * Describes how the payment is routed between payer, aggregator, and merchant.
457
+ * This is a generic hint - specific rails populate it from their native formats.
458
+ *
459
+ * Values:
460
+ * - "direct": Direct payment to merchant (no intermediary)
461
+ * - "callback": Routed via callback URL / payment service
462
+ * - "role": Role-based routing (e.g., "publisher", "platform")
463
+ *
464
+ * Examples of producers:
465
+ * - x402 v2 `payTo.mode` -> routing
466
+ * - Stripe Connect `destination` -> routing = 'direct' or 'callback'
467
+ * - UPI `pa` (payee address) -> routing = 'direct'
468
+ */
469
+ export declare const PaymentRoutingSchema: z.ZodEnum<["direct", "callback", "role"]>;
470
+ /**
471
+ * Payment evidence schema
472
+ *
473
+ * Full schema for PaymentEvidence including aggregator/splits support.
474
+ */
475
+ export declare const PaymentEvidenceSchema: z.ZodObject<{
476
+ rail: z.ZodString;
477
+ reference: z.ZodString;
478
+ amount: z.ZodNumber;
479
+ currency: z.ZodString;
480
+ asset: z.ZodString;
481
+ env: z.ZodEnum<["live", "test"]>;
482
+ network: z.ZodOptional<z.ZodString>;
483
+ facilitator_ref: z.ZodOptional<z.ZodString>;
484
+ evidence: z.ZodUnknown;
485
+ aggregator: z.ZodOptional<z.ZodString>;
486
+ splits: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
487
+ party: z.ZodString;
488
+ amount: z.ZodOptional<z.ZodNumber>;
489
+ currency: z.ZodOptional<z.ZodString>;
490
+ share: z.ZodOptional<z.ZodNumber>;
491
+ rail: z.ZodOptional<z.ZodString>;
492
+ account_ref: z.ZodOptional<z.ZodString>;
493
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
494
+ }, "strict", z.ZodTypeAny, {
495
+ party: string;
496
+ rail?: string | undefined;
497
+ amount?: number | undefined;
498
+ currency?: string | undefined;
499
+ metadata?: Record<string, unknown> | undefined;
500
+ share?: number | undefined;
501
+ account_ref?: string | undefined;
502
+ }, {
503
+ party: string;
504
+ rail?: string | undefined;
505
+ amount?: number | undefined;
506
+ currency?: string | undefined;
507
+ metadata?: Record<string, unknown> | undefined;
508
+ share?: number | undefined;
509
+ account_ref?: string | undefined;
510
+ }>, {
511
+ party: string;
512
+ rail?: string | undefined;
513
+ amount?: number | undefined;
514
+ currency?: string | undefined;
515
+ metadata?: Record<string, unknown> | undefined;
516
+ share?: number | undefined;
517
+ account_ref?: string | undefined;
518
+ }, {
519
+ party: string;
520
+ rail?: string | undefined;
521
+ amount?: number | undefined;
522
+ currency?: string | undefined;
523
+ metadata?: Record<string, unknown> | undefined;
524
+ share?: number | undefined;
525
+ account_ref?: string | undefined;
526
+ }>, "many">>;
527
+ routing: z.ZodOptional<z.ZodEnum<["direct", "callback", "role"]>>;
528
+ }, "strict", z.ZodTypeAny, {
529
+ rail: string;
530
+ reference: string;
531
+ amount: number;
532
+ currency: string;
533
+ asset: string;
534
+ env: "live" | "test";
535
+ evidence?: unknown;
536
+ network?: string | undefined;
537
+ facilitator_ref?: string | undefined;
538
+ aggregator?: string | undefined;
539
+ splits?: {
540
+ party: string;
541
+ rail?: string | undefined;
542
+ amount?: number | undefined;
543
+ currency?: string | undefined;
544
+ metadata?: Record<string, unknown> | undefined;
545
+ share?: number | undefined;
546
+ account_ref?: string | undefined;
547
+ }[] | undefined;
548
+ routing?: "direct" | "callback" | "role" | undefined;
549
+ }, {
550
+ rail: string;
551
+ reference: string;
552
+ amount: number;
553
+ currency: string;
554
+ asset: string;
555
+ env: "live" | "test";
556
+ evidence?: unknown;
557
+ network?: string | undefined;
558
+ facilitator_ref?: string | undefined;
559
+ aggregator?: string | undefined;
560
+ splits?: {
561
+ party: string;
562
+ rail?: string | undefined;
563
+ amount?: number | undefined;
564
+ currency?: string | undefined;
565
+ metadata?: Record<string, unknown> | undefined;
566
+ share?: number | undefined;
567
+ account_ref?: string | undefined;
568
+ }[] | undefined;
569
+ routing?: "direct" | "callback" | "role" | undefined;
570
+ }>;
571
+ /**
572
+ * Subject type schema
573
+ */
574
+ export declare const SubjectTypeSchema: z.ZodEnum<["human", "org", "agent"]>;
575
+ /**
576
+ * Subject profile schema
577
+ *
578
+ * Invariants:
579
+ * - id is required (non-empty string)
580
+ * - type is required (human, org, or agent)
581
+ * - labels if present must be non-empty strings
582
+ */
583
+ export declare const SubjectProfileSchema: z.ZodObject<{
584
+ id: z.ZodString;
585
+ type: z.ZodEnum<["human", "org", "agent"]>;
586
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
587
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
588
+ }, "strict", z.ZodTypeAny, {
589
+ type: "human" | "org" | "agent";
590
+ id: string;
591
+ metadata?: Record<string, unknown> | undefined;
592
+ labels?: string[] | undefined;
593
+ }, {
594
+ type: "human" | "org" | "agent";
595
+ id: string;
596
+ metadata?: Record<string, unknown> | undefined;
597
+ labels?: string[] | undefined;
598
+ }>;
599
+ /**
600
+ * Subject profile snapshot schema
601
+ *
602
+ * Invariants:
603
+ * - subject is required (valid SubjectProfile)
604
+ * - captured_at is required (non-empty string)
605
+ * MUST be RFC 3339 / ISO 8601 UTC; format not enforced in schema for v0.9.16
606
+ */
607
+ export declare const SubjectProfileSnapshotSchema: z.ZodObject<{
608
+ subject: z.ZodObject<{
609
+ id: z.ZodString;
610
+ type: z.ZodEnum<["human", "org", "agent"]>;
611
+ labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
612
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
613
+ }, "strict", z.ZodTypeAny, {
614
+ type: "human" | "org" | "agent";
615
+ id: string;
616
+ metadata?: Record<string, unknown> | undefined;
617
+ labels?: string[] | undefined;
618
+ }, {
619
+ type: "human" | "org" | "agent";
620
+ id: string;
621
+ metadata?: Record<string, unknown> | undefined;
622
+ labels?: string[] | undefined;
623
+ }>;
624
+ captured_at: z.ZodString;
625
+ source: z.ZodOptional<z.ZodString>;
626
+ version: z.ZodOptional<z.ZodString>;
627
+ }, "strict", z.ZodTypeAny, {
628
+ subject: {
629
+ type: "human" | "org" | "agent";
630
+ id: string;
631
+ metadata?: Record<string, unknown> | undefined;
632
+ labels?: string[] | undefined;
633
+ };
634
+ captured_at: string;
635
+ version?: string | undefined;
636
+ source?: string | undefined;
637
+ }, {
638
+ subject: {
639
+ type: "human" | "org" | "agent";
640
+ id: string;
641
+ metadata?: Record<string, unknown> | undefined;
642
+ labels?: string[] | undefined;
643
+ };
644
+ captured_at: string;
645
+ version?: string | undefined;
646
+ source?: string | undefined;
647
+ }>;
648
+ /**
649
+ * Validate a subject snapshot (if present)
650
+ *
651
+ * - Returns validated snapshot or null if absent
652
+ * - Throws ZodError for malformed data
653
+ * - Logs advisory warning if id looks like PII (deduplicated)
654
+ */
655
+ export declare function validateSubjectSnapshot(snapshot: unknown): z.infer<typeof SubjectProfileSnapshotSchema> | null;
656
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWnB,CAAC;AAEZ,eAAO,MAAM,OAAO;;;;;;EAAuC,CAAC;AAE5D,eAAO,MAAM,cAAc;;;;;;;;;EAKhB,CAAC;AAIZ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAKC,CAAC;AAEzB,eAAO,MAAM,SAAS;;;;;;;;;;;;EAMX,CAAC;AAEZ,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaf,CAAC;AAEZ,eAAO,MAAM,aAAa;;;;;;EAIf,CAAC;AAMZ;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,uFAQ/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B,mEAIrC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,wCAAsC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B5B,CAAC;AAMJ;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa3B,CAAC;AAEL;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,2CAAyC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAevB,CAAC;AAMZ;;GAEG;AACH,eAAO,MAAM,iBAAiB,sCAAoC,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAOtB,CAAC;AAEZ;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO9B,CAAC;AAwBZ;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,OAAO,GAChB,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,GAAG,IAAI,CAmBrD"}