@peac/schema 0.12.1 → 0.12.3
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/dist/actor-binding.d.ts +10 -10
- package/dist/agent-identity.d.ts +8 -6
- package/dist/agent-identity.d.ts.map +1 -1
- package/dist/carrier.d.ts +7 -7
- package/dist/carrier.d.ts.map +1 -1
- package/dist/constraints.d.ts +4 -4
- package/dist/constraints.d.ts.map +1 -1
- package/dist/extensions/control-action.d.ts +1 -1
- package/dist/extensions/credential-event.d.ts +4 -4
- package/dist/extensions/fingerprint-ref.d.ts +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/tool-registry.d.ts +1 -1
- package/dist/extensions/treaty.d.ts +2 -2
- package/dist/index.cjs +733 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +684 -46
- package/dist/index.mjs.map +1 -1
- package/dist/issuer-config.d.ts +1 -1
- package/dist/policy-binding.d.ts +2 -2
- package/dist/receipt-parser.cjs +626 -14
- package/dist/receipt-parser.cjs.map +1 -1
- package/dist/receipt-parser.mjs +627 -15
- package/dist/receipt-parser.mjs.map +1 -1
- package/dist/subject.d.ts +33 -12
- package/dist/subject.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/wire-02-envelope.d.ts +2 -2
- package/dist/wire-02-extensions/access.d.ts +19 -0
- package/dist/wire-02-extensions/access.d.ts.map +1 -0
- package/dist/wire-02-extensions/accessors.d.ts +44 -0
- package/dist/wire-02-extensions/accessors.d.ts.map +1 -0
- package/dist/wire-02-extensions/attribution.d.ts +44 -0
- package/dist/wire-02-extensions/attribution.d.ts.map +1 -0
- package/dist/wire-02-extensions/challenge.d.ts +60 -0
- package/dist/wire-02-extensions/challenge.d.ts.map +1 -0
- package/dist/wire-02-extensions/commerce.d.ts +29 -0
- package/dist/wire-02-extensions/commerce.d.ts.map +1 -0
- package/dist/wire-02-extensions/compliance.d.ts +49 -0
- package/dist/wire-02-extensions/compliance.d.ts.map +1 -0
- package/dist/wire-02-extensions/consent.d.ts +48 -0
- package/dist/wire-02-extensions/consent.d.ts.map +1 -0
- package/dist/wire-02-extensions/correlation.d.ts +18 -0
- package/dist/wire-02-extensions/correlation.d.ts.map +1 -0
- package/dist/wire-02-extensions/grammar.d.ts +40 -0
- package/dist/wire-02-extensions/grammar.d.ts.map +1 -0
- package/dist/wire-02-extensions/identity.d.ts +13 -0
- package/dist/wire-02-extensions/identity.d.ts.map +1 -0
- package/dist/wire-02-extensions/index.d.ts +40 -0
- package/dist/wire-02-extensions/index.d.ts.map +1 -0
- package/dist/wire-02-extensions/limits.d.ts +80 -0
- package/dist/wire-02-extensions/limits.d.ts.map +1 -0
- package/dist/wire-02-extensions/privacy.d.ts +64 -0
- package/dist/wire-02-extensions/privacy.d.ts.map +1 -0
- package/dist/wire-02-extensions/provenance.d.ts +58 -0
- package/dist/wire-02-extensions/provenance.d.ts.map +1 -0
- package/dist/wire-02-extensions/purpose-extension.d.ts +26 -0
- package/dist/wire-02-extensions/purpose-extension.d.ts.map +1 -0
- package/dist/wire-02-extensions/safety.d.ts +65 -0
- package/dist/wire-02-extensions/safety.d.ts.map +1 -0
- package/dist/wire-02-extensions/schema-map.d.ts +13 -0
- package/dist/wire-02-extensions/schema-map.d.ts.map +1 -0
- package/dist/wire-02-extensions/shared-validators.d.ts +192 -0
- package/dist/wire-02-extensions/shared-validators.d.ts.map +1 -0
- package/dist/wire-02-extensions/validation.d.ts +57 -0
- package/dist/wire-02-extensions/validation.d.ts.map +1 -0
- package/dist/wire-02-extensions.d.ts +7 -211
- package/dist/wire-02-extensions.d.ts.map +1 -1
- package/dist/wire-02-registries.d.ts +5 -2
- package/dist/wire-02-registries.d.ts.map +1 -1
- package/dist/wire-02-representation.d.ts +3 -3
- package/dist/wire-02-warnings.d.ts +5 -1
- package/dist/wire-02-warnings.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -54,9 +54,9 @@ var ERROR_CODES = {
|
|
|
54
54
|
E_WORKFLOW_PARENT_NOT_FOUND: "E_WORKFLOW_PARENT_NOT_FOUND",
|
|
55
55
|
E_WORKFLOW_SUMMARY_INVALID: "E_WORKFLOW_SUMMARY_INVALID",
|
|
56
56
|
E_WORKFLOW_CYCLE_DETECTED: "E_WORKFLOW_CYCLE_DETECTED",
|
|
57
|
-
// Constraint errors (400
|
|
57
|
+
// Constraint errors (400)
|
|
58
58
|
E_CONSTRAINT_VIOLATION: "E_CONSTRAINT_VIOLATION",
|
|
59
|
-
// Wire 0.2 extension errors (400
|
|
59
|
+
// Wire 0.2 extension errors (400/)
|
|
60
60
|
E_INVALID_EXTENSION_KEY: "E_INVALID_EXTENSION_KEY"
|
|
61
61
|
};
|
|
62
62
|
function createPEACError(code, category, severity, retryable, options) {
|
|
@@ -324,7 +324,7 @@ var KERNEL_CONSTRAINTS = {
|
|
|
324
324
|
MAX_STRING_LENGTH: 65536,
|
|
325
325
|
/** Maximum total nodes to visit during traversal */
|
|
326
326
|
MAX_TOTAL_NODES: 1e5,
|
|
327
|
-
/** Temporal validity clock skew tolerance in seconds
|
|
327
|
+
/** Temporal validity clock skew tolerance in seconds */
|
|
328
328
|
CLOCK_SKEW_SECONDS: 60
|
|
329
329
|
};
|
|
330
330
|
function validateKernelConstraints(claims) {
|
|
@@ -595,7 +595,10 @@ var BindingDetailsSchema = zod.z.object({
|
|
|
595
595
|
signed_at: zod.z.string().datetime()
|
|
596
596
|
}).strict();
|
|
597
597
|
var AgentProofSchema = zod.z.object({
|
|
598
|
-
/**
|
|
598
|
+
/**
|
|
599
|
+
* Proof method used.
|
|
600
|
+
* @see ProofMethodSchema - deprecated in v0.12.2; will migrate in v0.13.0
|
|
601
|
+
*/
|
|
599
602
|
method: ProofMethodSchema,
|
|
600
603
|
/** Key ID (matches kid in JWS header or JWKS) */
|
|
601
604
|
key_id: zod.z.string().min(1).max(256),
|
|
@@ -1207,7 +1210,7 @@ var ACTOR_BINDING_EXTENSION_KEY = "org.peacprotocol/actor_binding";
|
|
|
1207
1210
|
var ActorBindingSchema = zod.z.object({
|
|
1208
1211
|
/** Stable actor identifier (opaque, no PII) */
|
|
1209
1212
|
id: zod.z.string().min(1).max(256),
|
|
1210
|
-
/** Proof type from
|
|
1213
|
+
/** Proof type from multi-root vocabulary */
|
|
1211
1214
|
proof_type: ProofTypeSchema,
|
|
1212
1215
|
/** URI or hash of external proof artifact */
|
|
1213
1216
|
proof_ref: zod.z.string().max(2048).optional(),
|
|
@@ -1215,7 +1218,7 @@ var ActorBindingSchema = zod.z.object({
|
|
|
1215
1218
|
origin: zod.z.string().max(2048).refine(isOriginOnly, {
|
|
1216
1219
|
message: "origin must be an origin-only URL (scheme + host + optional port; no path, query, or fragment)"
|
|
1217
1220
|
}),
|
|
1218
|
-
/** SHA-256 hash of the intent (hash-first per
|
|
1221
|
+
/** SHA-256 hash of the intent (hash-first per ) */
|
|
1219
1222
|
intent_hash: zod.z.string().regex(/^sha256:[a-f0-9]{64}$/, {
|
|
1220
1223
|
message: "intent_hash must match sha256:<64 hex chars>"
|
|
1221
1224
|
}).optional()
|
|
@@ -3123,6 +3126,7 @@ var EXTENSION_LIMITS = {
|
|
|
3123
3126
|
maxAmountMinorLength: 64,
|
|
3124
3127
|
maxReferenceLength: 256,
|
|
3125
3128
|
maxAssetLength: 256,
|
|
3129
|
+
maxCommerceEventLength: 64,
|
|
3126
3130
|
// Access
|
|
3127
3131
|
maxResourceLength: 2048,
|
|
3128
3132
|
maxActionLength: 256,
|
|
@@ -3138,8 +3142,61 @@ var EXTENSION_LIMITS = {
|
|
|
3138
3142
|
maxSpanIdLength: 16,
|
|
3139
3143
|
maxWorkflowIdLength: 256,
|
|
3140
3144
|
maxParentJtiLength: 256,
|
|
3141
|
-
maxDependsOnLength: 64
|
|
3145
|
+
maxDependsOnLength: 64,
|
|
3146
|
+
// Consent
|
|
3147
|
+
maxConsentBasisLength: 128,
|
|
3148
|
+
maxConsentMethodLength: 128,
|
|
3149
|
+
maxDataCategoriesCount: 64,
|
|
3150
|
+
maxDataCategoryLength: 128,
|
|
3151
|
+
maxConsentScopeLength: 256,
|
|
3152
|
+
maxJurisdictionLength: 16,
|
|
3153
|
+
// Compliance
|
|
3154
|
+
maxFrameworkLength: 256,
|
|
3155
|
+
maxAuditRefLength: 256,
|
|
3156
|
+
maxAuditorLength: 256,
|
|
3157
|
+
maxComplianceScopeLength: 512,
|
|
3158
|
+
// Privacy
|
|
3159
|
+
maxDataClassificationLength: 128,
|
|
3160
|
+
maxProcessingBasisLength: 128,
|
|
3161
|
+
maxAnonymizationMethodLength: 128,
|
|
3162
|
+
maxDataSubjectCategoryLength: 128,
|
|
3163
|
+
maxTransferMechanismLength: 128,
|
|
3164
|
+
// Safety
|
|
3165
|
+
maxAssessmentMethodLength: 256,
|
|
3166
|
+
maxSafetyMeasuresCount: 32,
|
|
3167
|
+
maxSafetyMeasureLength: 256,
|
|
3168
|
+
maxIncidentRefLength: 256,
|
|
3169
|
+
maxModelRefLength: 256,
|
|
3170
|
+
maxSafetyCategoryLength: 128,
|
|
3171
|
+
// Provenance
|
|
3172
|
+
maxSourceTypeLength: 128,
|
|
3173
|
+
maxSourceRefLength: 256,
|
|
3174
|
+
maxVerificationMethodLength: 128,
|
|
3175
|
+
maxCustodyChainCount: 16,
|
|
3176
|
+
maxCustodianLength: 256,
|
|
3177
|
+
maxCustodyActionLength: 128,
|
|
3178
|
+
maxSlsaTrackLength: 64,
|
|
3179
|
+
maxSlsaVersionLength: 16,
|
|
3180
|
+
// Attribution
|
|
3181
|
+
maxCreatorRefLength: 256,
|
|
3182
|
+
maxObligationTypeLength: 128,
|
|
3183
|
+
maxAttributionTextLength: 1024,
|
|
3184
|
+
maxContentSignalSourceLength: 128,
|
|
3185
|
+
// Purpose
|
|
3186
|
+
maxExternalPurposesCount: 32,
|
|
3187
|
+
maxExternalPurposeLength: 128,
|
|
3188
|
+
maxPurposeBasisLength: 128,
|
|
3189
|
+
maxCompatiblePurposesCount: 32,
|
|
3190
|
+
// Shared field bounds
|
|
3191
|
+
maxHttpsUriLength: 2048,
|
|
3192
|
+
maxSha256DigestLength: 71,
|
|
3193
|
+
// "sha256:" (7) + 64 hex = 71 chars
|
|
3194
|
+
maxIso8601DurationLength: 64,
|
|
3195
|
+
maxIso8601DateLength: 10,
|
|
3196
|
+
maxSpdxExpressionLength: 128
|
|
3142
3197
|
};
|
|
3198
|
+
|
|
3199
|
+
// src/wire-02-extensions/grammar.ts
|
|
3143
3200
|
var DNS_LABEL = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
3144
3201
|
var SEGMENT_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
3145
3202
|
function isValidExtensionKey(key) {
|
|
@@ -3159,11 +3216,6 @@ function isValidExtensionKey(key) {
|
|
|
3159
3216
|
}
|
|
3160
3217
|
return true;
|
|
3161
3218
|
}
|
|
3162
|
-
var COMMERCE_EXTENSION_KEY = "org.peacprotocol/commerce";
|
|
3163
|
-
var ACCESS_EXTENSION_KEY = "org.peacprotocol/access";
|
|
3164
|
-
var CHALLENGE_EXTENSION_KEY = "org.peacprotocol/challenge";
|
|
3165
|
-
var IDENTITY_EXTENSION_KEY = "org.peacprotocol/identity";
|
|
3166
|
-
var CORRELATION_EXTENSION_KEY = "org.peacprotocol/correlation";
|
|
3167
3219
|
function escapePointerSegment(s) {
|
|
3168
3220
|
return s.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3169
3221
|
}
|
|
@@ -3172,6 +3224,7 @@ function zodPathToPointer(groupKey, zodPath) {
|
|
|
3172
3224
|
const segments = zodPath.map((s) => escapePointerSegment(String(s)));
|
|
3173
3225
|
return `/extensions/${escaped}` + (segments.length > 0 ? "/" + segments.join("/") : "");
|
|
3174
3226
|
}
|
|
3227
|
+
var COMMERCE_EXTENSION_KEY = "org.peacprotocol/commerce";
|
|
3175
3228
|
var AMOUNT_MINOR_PATTERN = /^-?[0-9]+$/;
|
|
3176
3229
|
var CommerceExtensionSchema = zod.z.object({
|
|
3177
3230
|
/** Payment rail identifier (e.g., 'stripe', 'x402', 'lightning') */
|
|
@@ -3192,8 +3245,11 @@ var CommerceExtensionSchema = zod.z.object({
|
|
|
3192
3245
|
/** Asset identifier for non-fiat (e.g., token address) */
|
|
3193
3246
|
asset: zod.z.string().max(EXTENSION_LIMITS.maxAssetLength).optional(),
|
|
3194
3247
|
/** Environment discriminant */
|
|
3195
|
-
env: zod.z.enum(["live", "test"]).optional()
|
|
3248
|
+
env: zod.z.enum(["live", "test"]).optional(),
|
|
3249
|
+
/** Commerce lifecycle phase. Observational metadata only: does not encode settlement finality or protocol state transitions */
|
|
3250
|
+
event: zod.z.enum(["authorization", "capture", "settlement", "refund", "void", "chargeback"]).optional()
|
|
3196
3251
|
}).strict();
|
|
3252
|
+
var ACCESS_EXTENSION_KEY = "org.peacprotocol/access";
|
|
3197
3253
|
var AccessExtensionSchema = zod.z.object({
|
|
3198
3254
|
/** Resource being accessed (URI or identifier) */
|
|
3199
3255
|
resource: zod.z.string().min(1).max(EXTENSION_LIMITS.maxResourceLength),
|
|
@@ -3202,6 +3258,7 @@ var AccessExtensionSchema = zod.z.object({
|
|
|
3202
3258
|
/** Access decision */
|
|
3203
3259
|
decision: zod.z.enum(["allow", "deny", "review"])
|
|
3204
3260
|
}).strict();
|
|
3261
|
+
var CHALLENGE_EXTENSION_KEY = "org.peacprotocol/challenge";
|
|
3205
3262
|
var CHALLENGE_TYPES = [
|
|
3206
3263
|
"payment_required",
|
|
3207
3264
|
"identity_required",
|
|
@@ -3236,10 +3293,12 @@ var ChallengeExtensionSchema = zod.z.object({
|
|
|
3236
3293
|
/** Caller-defined requirements for resolving the challenge */
|
|
3237
3294
|
requirements: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
3238
3295
|
}).strict();
|
|
3296
|
+
var IDENTITY_EXTENSION_KEY = "org.peacprotocol/identity";
|
|
3239
3297
|
var IdentityExtensionSchema = zod.z.object({
|
|
3240
3298
|
/** Proof reference (opaque string; no actor_binding: top-level actor is sole location) */
|
|
3241
3299
|
proof_ref: zod.z.string().max(EXTENSION_LIMITS.maxProofRefLength).optional()
|
|
3242
3300
|
}).strict();
|
|
3301
|
+
var CORRELATION_EXTENSION_KEY = "org.peacprotocol/correlation";
|
|
3243
3302
|
var TRACE_ID_PATTERN = /^[0-9a-f]{32}$/;
|
|
3244
3303
|
var SPAN_ID_PATTERN = /^[0-9a-f]{16}$/;
|
|
3245
3304
|
var CorrelationExtensionSchema = zod.z.object({
|
|
@@ -3254,12 +3313,497 @@ var CorrelationExtensionSchema = zod.z.object({
|
|
|
3254
3313
|
/** JTIs this receipt depends on */
|
|
3255
3314
|
depends_on: zod.z.array(zod.z.string().min(1).max(EXTENSION_LIMITS.maxParentJtiLength)).max(EXTENSION_LIMITS.maxDependsOnLength).optional()
|
|
3256
3315
|
}).strict();
|
|
3257
|
-
var
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3316
|
+
var Sha256DigestSchema = zod.z.string().max(71).regex(kernel.HASH.pattern, "must be a valid SHA-256 digest (sha256:<64 lowercase hex>)");
|
|
3317
|
+
var CONTROL_CHAR_PATTERN = /[\x00-\x1f\x7f]/;
|
|
3318
|
+
var HttpsUriHintSchema = zod.z.string().min(1).max(2048).refine(
|
|
3319
|
+
(value) => {
|
|
3320
|
+
if (CONTROL_CHAR_PATTERN.test(value)) return false;
|
|
3321
|
+
if (value.includes("#")) return false;
|
|
3322
|
+
try {
|
|
3323
|
+
const url = new URL(value);
|
|
3324
|
+
if (url.protocol !== "https:") return false;
|
|
3325
|
+
if (url.username !== "" || url.password !== "") return false;
|
|
3326
|
+
if (!url.hostname) return false;
|
|
3327
|
+
return true;
|
|
3328
|
+
} catch {
|
|
3329
|
+
return false;
|
|
3330
|
+
}
|
|
3331
|
+
},
|
|
3332
|
+
{
|
|
3333
|
+
message: "must be a valid HTTPS URI (no credentials, no fragments, no control characters)"
|
|
3334
|
+
}
|
|
3335
|
+
);
|
|
3336
|
+
var DATE_DESIGNATOR_ORDER = ["Y", "M", "W", "D"];
|
|
3337
|
+
var TIME_DESIGNATOR_ORDER = ["H", "M", "S"];
|
|
3338
|
+
function parseIso8601Duration(value) {
|
|
3339
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 64) {
|
|
3340
|
+
return null;
|
|
3341
|
+
}
|
|
3342
|
+
if (value.charAt(0) !== "P") return null;
|
|
3343
|
+
let pos = 1;
|
|
3344
|
+
const len = value.length;
|
|
3345
|
+
if (pos >= len) return null;
|
|
3346
|
+
const result = {
|
|
3347
|
+
years: 0,
|
|
3348
|
+
months: 0,
|
|
3349
|
+
weeks: 0,
|
|
3350
|
+
days: 0,
|
|
3351
|
+
hours: 0,
|
|
3352
|
+
minutes: 0,
|
|
3353
|
+
seconds: 0
|
|
3354
|
+
};
|
|
3355
|
+
let inTimePart = false;
|
|
3356
|
+
let hasAnyComponent = false;
|
|
3357
|
+
const seenDesignators = /* @__PURE__ */ new Set();
|
|
3358
|
+
let dateOrderIdx = 0;
|
|
3359
|
+
let timeOrderIdx = 0;
|
|
3360
|
+
while (pos < len) {
|
|
3361
|
+
if (value.charAt(pos) === "T") {
|
|
3362
|
+
if (inTimePart) return null;
|
|
3363
|
+
inTimePart = true;
|
|
3364
|
+
pos++;
|
|
3365
|
+
if (pos >= len) return null;
|
|
3366
|
+
continue;
|
|
3367
|
+
}
|
|
3368
|
+
const numStart = pos;
|
|
3369
|
+
while (pos < len && value.charAt(pos) >= "0" && value.charAt(pos) <= "9") {
|
|
3370
|
+
pos++;
|
|
3371
|
+
}
|
|
3372
|
+
if (pos === numStart) return null;
|
|
3373
|
+
const digits = value.slice(numStart, pos);
|
|
3374
|
+
if (digits.length > 15) return null;
|
|
3375
|
+
const num = parseInt(digits, 10);
|
|
3376
|
+
if (!Number.isFinite(num) || num < 0) return null;
|
|
3377
|
+
if (pos >= len) return null;
|
|
3378
|
+
const designator = value.charAt(pos);
|
|
3379
|
+
pos++;
|
|
3380
|
+
const designatorKey = (inTimePart ? "T" : "") + designator;
|
|
3381
|
+
if (seenDesignators.has(designatorKey)) return null;
|
|
3382
|
+
seenDesignators.add(designatorKey);
|
|
3383
|
+
if (inTimePart) {
|
|
3384
|
+
const timeIdx = TIME_DESIGNATOR_ORDER.indexOf(designator);
|
|
3385
|
+
if (timeIdx === -1) return null;
|
|
3386
|
+
if (timeIdx < timeOrderIdx) return null;
|
|
3387
|
+
timeOrderIdx = timeIdx + 1;
|
|
3388
|
+
switch (designator) {
|
|
3389
|
+
case "H":
|
|
3390
|
+
result.hours = num;
|
|
3391
|
+
break;
|
|
3392
|
+
case "M":
|
|
3393
|
+
result.minutes = num;
|
|
3394
|
+
break;
|
|
3395
|
+
case "S":
|
|
3396
|
+
result.seconds = num;
|
|
3397
|
+
break;
|
|
3398
|
+
}
|
|
3399
|
+
} else {
|
|
3400
|
+
const dateIdx = DATE_DESIGNATOR_ORDER.indexOf(designator);
|
|
3401
|
+
if (dateIdx === -1) return null;
|
|
3402
|
+
if (dateIdx < dateOrderIdx) return null;
|
|
3403
|
+
dateOrderIdx = dateIdx + 1;
|
|
3404
|
+
switch (designator) {
|
|
3405
|
+
case "Y":
|
|
3406
|
+
result.years = num;
|
|
3407
|
+
break;
|
|
3408
|
+
case "M":
|
|
3409
|
+
result.months = num;
|
|
3410
|
+
break;
|
|
3411
|
+
case "W":
|
|
3412
|
+
result.weeks = num;
|
|
3413
|
+
break;
|
|
3414
|
+
case "D":
|
|
3415
|
+
result.days = num;
|
|
3416
|
+
break;
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
hasAnyComponent = true;
|
|
3420
|
+
}
|
|
3421
|
+
if (!hasAnyComponent) return null;
|
|
3422
|
+
if (result.weeks > 0 && (result.years > 0 || result.months > 0 || result.days > 0)) {
|
|
3423
|
+
return null;
|
|
3424
|
+
}
|
|
3425
|
+
return result;
|
|
3426
|
+
}
|
|
3427
|
+
var Iso8601DurationSchema = zod.z.string().min(2).max(64).refine((value) => parseIso8601Duration(value) !== null, {
|
|
3428
|
+
message: "must be a valid ISO 8601 duration (e.g., P30D, P1Y6M, PT1H30M)"
|
|
3429
|
+
});
|
|
3430
|
+
var Iso8601DateStringSchema = zod.z.string().length(10).regex(/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/, {
|
|
3431
|
+
message: "must be a structurally valid date string (YYYY-MM-DD)"
|
|
3432
|
+
});
|
|
3433
|
+
var Iso8601DateSchema = Iso8601DateStringSchema;
|
|
3434
|
+
var Iso8601OffsetDateTimeSchema = zod.z.iso.datetime({ offset: true });
|
|
3435
|
+
var RFC3339_SECONDS_PATTERN = /T\d{2}:\d{2}:\d{2}/;
|
|
3436
|
+
var Rfc3339DateTimeSchema = zod.z.iso.datetime({ offset: true }).refine((value) => RFC3339_SECONDS_PATTERN.test(value), {
|
|
3437
|
+
message: "RFC 3339 requires seconds precision (e.g., 2026-03-14T12:00:00Z)"
|
|
3438
|
+
});
|
|
3439
|
+
var Rfc3339TimestampSchema = Iso8601OffsetDateTimeSchema;
|
|
3440
|
+
function isValidSpdxSubsetExpression(expr) {
|
|
3441
|
+
if (typeof expr !== "string" || expr.length === 0 || expr.length > 128) {
|
|
3442
|
+
return false;
|
|
3443
|
+
}
|
|
3444
|
+
const tokens = [];
|
|
3445
|
+
let current = "";
|
|
3446
|
+
for (let i = 0; i < expr.length; i++) {
|
|
3447
|
+
const ch = expr.charAt(i);
|
|
3448
|
+
if (ch === "(" || ch === ")") {
|
|
3449
|
+
if (current.length > 0) {
|
|
3450
|
+
tokens.push(current);
|
|
3451
|
+
current = "";
|
|
3452
|
+
}
|
|
3453
|
+
tokens.push(ch);
|
|
3454
|
+
} else if (ch === " " || ch === " ") {
|
|
3455
|
+
if (current.length > 0) {
|
|
3456
|
+
tokens.push(current);
|
|
3457
|
+
current = "";
|
|
3458
|
+
}
|
|
3459
|
+
} else {
|
|
3460
|
+
current += ch;
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
if (current.length > 0) {
|
|
3464
|
+
tokens.push(current);
|
|
3465
|
+
}
|
|
3466
|
+
if (tokens.length === 0) return false;
|
|
3467
|
+
let pos = 0;
|
|
3468
|
+
function peek() {
|
|
3469
|
+
return tokens[pos];
|
|
3470
|
+
}
|
|
3471
|
+
function advance() {
|
|
3472
|
+
return tokens[pos++];
|
|
3473
|
+
}
|
|
3474
|
+
function isLicenseId(token) {
|
|
3475
|
+
const base = token.endsWith("+") ? token.slice(0, -1) : token;
|
|
3476
|
+
if (base.length === 0) return false;
|
|
3477
|
+
if (base.startsWith("LicenseRef-")) {
|
|
3478
|
+
const ref = base.slice(11);
|
|
3479
|
+
return ref.length > 0 && /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(ref);
|
|
3480
|
+
}
|
|
3481
|
+
return /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(base);
|
|
3482
|
+
}
|
|
3483
|
+
function isExceptionId(token) {
|
|
3484
|
+
return /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(token);
|
|
3485
|
+
}
|
|
3486
|
+
function parseExpr() {
|
|
3487
|
+
if (!parseTerm()) return false;
|
|
3488
|
+
while (pos < tokens.length) {
|
|
3489
|
+
const op = peek();
|
|
3490
|
+
if (op === "AND" || op === "OR") {
|
|
3491
|
+
advance();
|
|
3492
|
+
if (!parseTerm()) return false;
|
|
3493
|
+
} else {
|
|
3494
|
+
break;
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
return true;
|
|
3498
|
+
}
|
|
3499
|
+
function parseTerm() {
|
|
3500
|
+
if (!parseAtom()) return false;
|
|
3501
|
+
if (peek() === "WITH") {
|
|
3502
|
+
advance();
|
|
3503
|
+
const exception = peek();
|
|
3504
|
+
if (exception === void 0 || !isExceptionId(exception)) return false;
|
|
3505
|
+
advance();
|
|
3506
|
+
}
|
|
3507
|
+
return true;
|
|
3508
|
+
}
|
|
3509
|
+
function parseAtom() {
|
|
3510
|
+
const token = peek();
|
|
3511
|
+
if (token === void 0) return false;
|
|
3512
|
+
if (token === "(") {
|
|
3513
|
+
advance();
|
|
3514
|
+
if (!parseExpr()) return false;
|
|
3515
|
+
if (peek() !== ")") return false;
|
|
3516
|
+
advance();
|
|
3517
|
+
return true;
|
|
3518
|
+
}
|
|
3519
|
+
if (token === ")" || token === "AND" || token === "OR" || token === "WITH") {
|
|
3520
|
+
return false;
|
|
3521
|
+
}
|
|
3522
|
+
if (!isLicenseId(token)) return false;
|
|
3523
|
+
advance();
|
|
3524
|
+
return true;
|
|
3525
|
+
}
|
|
3526
|
+
const result = parseExpr();
|
|
3527
|
+
return result && pos === tokens.length;
|
|
3528
|
+
}
|
|
3529
|
+
var SpdxExpressionSchema = zod.z.string().min(1).max(128).refine(isValidSpdxSubsetExpression, {
|
|
3530
|
+
message: "must be a valid SPDX license expression (e.g., MIT, Apache-2.0, MIT AND Apache-2.0). DocumentRef-* not yet supported."
|
|
3531
|
+
});
|
|
3532
|
+
|
|
3533
|
+
// src/wire-02-extensions/consent.ts
|
|
3534
|
+
var CONSENT_EXTENSION_KEY = "org.peacprotocol/consent";
|
|
3535
|
+
var CONSENT_STATUSES = ["granted", "withdrawn", "denied", "expired"];
|
|
3536
|
+
var ConsentStatusSchema = zod.z.enum(CONSENT_STATUSES);
|
|
3537
|
+
var ConsentExtensionSchema = zod.z.object({
|
|
3538
|
+
/**
|
|
3539
|
+
* Legal basis identifier for consent.
|
|
3540
|
+
* Open string: jurisdictions define different bases
|
|
3541
|
+
* (e.g., explicit, implied, opt_out, legitimate_interest, contractual, legal_obligation).
|
|
3542
|
+
*/
|
|
3543
|
+
consent_basis: zod.z.string().min(1).max(EXTENSION_LIMITS.maxConsentBasisLength),
|
|
3544
|
+
/** Consent lifecycle state (closed vocabulary) */
|
|
3545
|
+
consent_status: ConsentStatusSchema,
|
|
3546
|
+
/**
|
|
3547
|
+
* Data categories covered by this consent.
|
|
3548
|
+
* Open vocabulary (e.g., personal, sensitive, biometric).
|
|
3549
|
+
*/
|
|
3550
|
+
data_categories: zod.z.array(zod.z.string().min(1).max(EXTENSION_LIMITS.maxDataCategoryLength)).max(EXTENSION_LIMITS.maxDataCategoriesCount).optional(),
|
|
3551
|
+
/** Data retention period as ISO 8601 duration. */
|
|
3552
|
+
retention_period: Iso8601DurationSchema.optional(),
|
|
3553
|
+
/**
|
|
3554
|
+
* How consent was collected.
|
|
3555
|
+
* Open vocabulary (e.g., click_through, double_opt_in, verbal, written).
|
|
3556
|
+
*/
|
|
3557
|
+
consent_method: zod.z.string().min(1).max(EXTENSION_LIMITS.maxConsentMethodLength).optional(),
|
|
3558
|
+
/**
|
|
3559
|
+
* HTTPS URI hint for consent withdrawal.
|
|
3560
|
+
* Locator hint only: callers MUST NOT auto-fetch.
|
|
3561
|
+
* Rejects non-HTTPS, embedded credentials, fragments, control chars.
|
|
3562
|
+
*/
|
|
3563
|
+
withdrawal_uri: HttpsUriHintSchema.optional(),
|
|
3564
|
+
/** Free-text scope description */
|
|
3565
|
+
scope: zod.z.string().min(1).max(EXTENSION_LIMITS.maxConsentScopeLength).optional(),
|
|
3566
|
+
/**
|
|
3567
|
+
* Jurisdiction code: ISO 3166-1 alpha-2 or composite.
|
|
3568
|
+
* Examples: EU, US-CA, BR, GB, DE, JP, IN.
|
|
3569
|
+
*/
|
|
3570
|
+
jurisdiction: zod.z.string().min(1).max(EXTENSION_LIMITS.maxJurisdictionLength).optional()
|
|
3571
|
+
}).strict();
|
|
3572
|
+
var PRIVACY_EXTENSION_KEY = "org.peacprotocol/privacy";
|
|
3573
|
+
var RETENTION_MODES = ["time_bound", "indefinite", "session_only"];
|
|
3574
|
+
var RetentionModeSchema = zod.z.enum(RETENTION_MODES);
|
|
3575
|
+
var RECIPIENT_SCOPES = ["internal", "processor", "third_party", "public"];
|
|
3576
|
+
var RecipientScopeSchema = zod.z.enum(RECIPIENT_SCOPES);
|
|
3577
|
+
var PrivacyExtensionSchema = zod.z.object({
|
|
3578
|
+
/**
|
|
3579
|
+
* Data classification level.
|
|
3580
|
+
* Open taxonomy (e.g., public, internal, confidential, restricted, pii, sensitive_pii).
|
|
3581
|
+
*/
|
|
3582
|
+
data_classification: zod.z.string().min(1).max(EXTENSION_LIMITS.maxDataClassificationLength),
|
|
3583
|
+
/**
|
|
3584
|
+
* Legal basis for data processing.
|
|
3585
|
+
* Open vocabulary (e.g., consent, legitimate_interest, contract, legal_obligation).
|
|
3586
|
+
*/
|
|
3587
|
+
processing_basis: zod.z.string().min(1).max(EXTENSION_LIMITS.maxProcessingBasisLength).optional(),
|
|
3588
|
+
/**
|
|
3589
|
+
* Data retention period as ISO 8601 duration.
|
|
3590
|
+
* For non-duration retention semantics, use retention_mode instead.
|
|
3591
|
+
*/
|
|
3592
|
+
retention_period: Iso8601DurationSchema.optional(),
|
|
3593
|
+
/**
|
|
3594
|
+
* Retention mode for non-duration semantics.
|
|
3595
|
+
* Closed enum: time_bound, indefinite, session_only.
|
|
3596
|
+
* When time_bound, retention_period SHOULD also be present.
|
|
3597
|
+
*/
|
|
3598
|
+
retention_mode: RetentionModeSchema.optional(),
|
|
3599
|
+
/**
|
|
3600
|
+
* Data recipient classification.
|
|
3601
|
+
* Closed enum aligned with GDPR Art 13-14 disclosure categories.
|
|
3602
|
+
*/
|
|
3603
|
+
recipient_scope: RecipientScopeSchema.optional(),
|
|
3604
|
+
/**
|
|
3605
|
+
* Anonymization or pseudonymization method applied.
|
|
3606
|
+
* Open vocabulary (e.g., k_anonymity, differential_privacy, pseudonymization,
|
|
3607
|
+
* tokenization, aggregation).
|
|
3608
|
+
*/
|
|
3609
|
+
anonymization_method: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAnonymizationMethodLength).optional(),
|
|
3610
|
+
/**
|
|
3611
|
+
* Data subject category.
|
|
3612
|
+
* Open vocabulary (e.g., customer, employee, minor, patient, student).
|
|
3613
|
+
*/
|
|
3614
|
+
data_subject_category: zod.z.string().min(1).max(EXTENSION_LIMITS.maxDataSubjectCategoryLength).optional(),
|
|
3615
|
+
/**
|
|
3616
|
+
* Cross-border data transfer mechanism.
|
|
3617
|
+
* Open vocabulary (e.g., adequacy_decision, scc, bcr, derogation, consent).
|
|
3618
|
+
*/
|
|
3619
|
+
transfer_mechanism: zod.z.string().min(1).max(EXTENSION_LIMITS.maxTransferMechanismLength).optional()
|
|
3620
|
+
}).strict();
|
|
3621
|
+
var SAFETY_EXTENSION_KEY = "org.peacprotocol/safety";
|
|
3622
|
+
var REVIEW_STATUSES = ["reviewed", "pending", "flagged", "not_applicable"];
|
|
3623
|
+
var ReviewStatusSchema = zod.z.enum(REVIEW_STATUSES);
|
|
3624
|
+
var RISK_LEVELS = ["unacceptable", "high", "limited", "minimal"];
|
|
3625
|
+
var RiskLevelSchema = zod.z.enum(RISK_LEVELS);
|
|
3626
|
+
var SafetyExtensionSchema = zod.z.object({
|
|
3627
|
+
/** Safety review status (closed vocabulary, universal lifecycle) */
|
|
3628
|
+
review_status: ReviewStatusSchema,
|
|
3629
|
+
/**
|
|
3630
|
+
* Risk classification level.
|
|
3631
|
+
* Optional at schema level; usage profiles may require it.
|
|
3632
|
+
* Converges across EU AI Act Art 6, NIST AI RMF, ISO 23894.
|
|
3633
|
+
*/
|
|
3634
|
+
risk_level: RiskLevelSchema.optional(),
|
|
3635
|
+
/**
|
|
3636
|
+
* Assessment method used.
|
|
3637
|
+
* Open vocabulary (e.g., automated_scan, human_review, red_team,
|
|
3638
|
+
* penetration_test, static_analysis, model_evaluation).
|
|
3639
|
+
*/
|
|
3640
|
+
assessment_method: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAssessmentMethodLength).optional(),
|
|
3641
|
+
/**
|
|
3642
|
+
* Safety measures applied.
|
|
3643
|
+
* Open vocabulary. Array bounded by maxSafetyMeasuresCount.
|
|
3644
|
+
*/
|
|
3645
|
+
safety_measures: zod.z.array(zod.z.string().min(1).max(EXTENSION_LIMITS.maxSafetyMeasureLength)).max(EXTENSION_LIMITS.maxSafetyMeasuresCount).optional(),
|
|
3646
|
+
/** Incident report reference. Opaque identifier (e.g., ticket ID or digest). */
|
|
3647
|
+
incident_ref: zod.z.string().min(1).max(EXTENSION_LIMITS.maxIncidentRefLength).optional(),
|
|
3648
|
+
/** AI model reference. Opaque identifier (e.g., model version string). */
|
|
3649
|
+
model_ref: zod.z.string().min(1).max(EXTENSION_LIMITS.maxModelRefLength).optional(),
|
|
3650
|
+
/**
|
|
3651
|
+
* Safety category.
|
|
3652
|
+
* Open vocabulary (e.g., content_safety, bias, hallucination,
|
|
3653
|
+
* toxicity, fairness, robustness, privacy_risk).
|
|
3654
|
+
*/
|
|
3655
|
+
category: zod.z.string().min(1).max(EXTENSION_LIMITS.maxSafetyCategoryLength).optional()
|
|
3656
|
+
}).strict();
|
|
3657
|
+
var COMPLIANCE_EXTENSION_KEY = "org.peacprotocol/compliance";
|
|
3658
|
+
var COMPLIANCE_STATUSES = [
|
|
3659
|
+
"compliant",
|
|
3660
|
+
"non_compliant",
|
|
3661
|
+
"partial",
|
|
3662
|
+
"under_review",
|
|
3663
|
+
"exempt"
|
|
3664
|
+
];
|
|
3665
|
+
var ComplianceStatusSchema = zod.z.enum(COMPLIANCE_STATUSES);
|
|
3666
|
+
var ComplianceExtensionSchema = zod.z.object({
|
|
3667
|
+
/**
|
|
3668
|
+
* Framework identifier evaluated.
|
|
3669
|
+
* Open string: preferred grammar is lowercase slugs with hyphens
|
|
3670
|
+
* (e.g., eu-ai-act, soc2-type2, iso-27001, nist-ai-rmf, gdpr, hipaa).
|
|
3671
|
+
*/
|
|
3672
|
+
framework: zod.z.string().min(1).max(EXTENSION_LIMITS.maxFrameworkLength),
|
|
3673
|
+
/** Observed compliance status (closed vocabulary) */
|
|
3674
|
+
compliance_status: ComplianceStatusSchema,
|
|
3675
|
+
/** Opaque reference to audit report or evidence (e.g., report ID, ticket number). */
|
|
3676
|
+
audit_ref: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAuditRefLength).optional(),
|
|
3677
|
+
/** Auditor identifier (organization name or DID). */
|
|
3678
|
+
auditor: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAuditorLength).optional(),
|
|
3679
|
+
/** Date the compliance check was performed (YYYY-MM-DD). */
|
|
3680
|
+
audit_date: Iso8601DateStringSchema.optional(),
|
|
3681
|
+
/** Scope of the compliance check. */
|
|
3682
|
+
scope: zod.z.string().min(1).max(EXTENSION_LIMITS.maxComplianceScopeLength).optional(),
|
|
3683
|
+
/** How long this finding remains valid as an ISO 8601 duration. */
|
|
3684
|
+
validity_period: Iso8601DurationSchema.optional(),
|
|
3685
|
+
/** SHA-256 digest of supporting evidence document. */
|
|
3686
|
+
evidence_ref: Sha256DigestSchema.optional()
|
|
3687
|
+
}).strict();
|
|
3688
|
+
var PROVENANCE_EXTENSION_KEY = "org.peacprotocol/provenance";
|
|
3689
|
+
var CustodyEntrySchema = zod.z.object({
|
|
3690
|
+
/** Custodian identifier (organization name, DID, or opaque ID). */
|
|
3691
|
+
custodian: zod.z.string().min(1).max(EXTENSION_LIMITS.maxCustodianLength),
|
|
3692
|
+
/** Action performed (e.g., received, transformed, verified, released). */
|
|
3693
|
+
action: zod.z.string().min(1).max(EXTENSION_LIMITS.maxCustodyActionLength),
|
|
3694
|
+
/** When the custody event occurred (RFC 3339 with seconds). */
|
|
3695
|
+
timestamp: Rfc3339DateTimeSchema
|
|
3696
|
+
}).strict();
|
|
3697
|
+
var SlsaLevelSchema = zod.z.object({
|
|
3698
|
+
/** SLSA track identifier (e.g., build, source). */
|
|
3699
|
+
track: zod.z.string().min(1).max(EXTENSION_LIMITS.maxSlsaTrackLength),
|
|
3700
|
+
/** SLSA level within the track (0-4). */
|
|
3701
|
+
level: zod.z.number().int().min(0).max(4),
|
|
3702
|
+
/** SLSA spec version this metadata references (e.g., 1.0, 1.2). */
|
|
3703
|
+
version: zod.z.string().min(1).max(EXTENSION_LIMITS.maxSlsaVersionLength)
|
|
3704
|
+
}).strict();
|
|
3705
|
+
var ProvenanceExtensionSchema = zod.z.object({
|
|
3706
|
+
/**
|
|
3707
|
+
* Type of source or derivation.
|
|
3708
|
+
* Open vocabulary (e.g., original, derived, curated, synthetic, aggregated, transformed).
|
|
3709
|
+
*/
|
|
3710
|
+
source_type: zod.z.string().min(1).max(EXTENSION_LIMITS.maxSourceTypeLength),
|
|
3711
|
+
/** Opaque source reference identifier (e.g., commit hash, artifact ID). */
|
|
3712
|
+
source_ref: zod.z.string().min(1).max(EXTENSION_LIMITS.maxSourceRefLength).optional(),
|
|
3713
|
+
/**
|
|
3714
|
+
* HTTPS URI hint for the source artifact.
|
|
3715
|
+
* Locator hint only: callers MUST NOT auto-fetch.
|
|
3716
|
+
*/
|
|
3717
|
+
source_uri: HttpsUriHintSchema.optional(),
|
|
3718
|
+
/**
|
|
3719
|
+
* HTTPS URI hint for build provenance metadata.
|
|
3720
|
+
* Locator hint only: callers MUST NOT auto-fetch.
|
|
3721
|
+
*/
|
|
3722
|
+
build_provenance_uri: HttpsUriHintSchema.optional(),
|
|
3723
|
+
/**
|
|
3724
|
+
* How provenance was verified.
|
|
3725
|
+
* Open vocabulary (e.g., signature_check, hash_chain,
|
|
3726
|
+
* manual_attestation, transparency_log).
|
|
3727
|
+
*/
|
|
3728
|
+
verification_method: zod.z.string().min(1).max(EXTENSION_LIMITS.maxVerificationMethodLength).optional(),
|
|
3729
|
+
/**
|
|
3730
|
+
* Ordered custody chain entries.
|
|
3731
|
+
* Each entry records a custodian, action, and timestamp.
|
|
3732
|
+
*/
|
|
3733
|
+
custody_chain: zod.z.array(CustodyEntrySchema).max(EXTENSION_LIMITS.maxCustodyChainCount).optional(),
|
|
3734
|
+
/**
|
|
3735
|
+
* Structured SLSA-aligned provenance metadata.
|
|
3736
|
+
* Records track, level, and spec version.
|
|
3737
|
+
*/
|
|
3738
|
+
slsa: SlsaLevelSchema.optional()
|
|
3739
|
+
}).strict();
|
|
3740
|
+
var ATTRIBUTION_EXTENSION_KEY = "org.peacprotocol/attribution";
|
|
3741
|
+
var CONTENT_SIGNAL_SOURCES = [
|
|
3742
|
+
"tdmrep_json",
|
|
3743
|
+
"content_signal_header",
|
|
3744
|
+
"content_usage_header",
|
|
3745
|
+
"robots_txt",
|
|
3746
|
+
"custom"
|
|
3747
|
+
];
|
|
3748
|
+
var ContentSignalSourceSchema = zod.z.enum(CONTENT_SIGNAL_SOURCES);
|
|
3749
|
+
var AttributionExtensionSchema = zod.z.object({
|
|
3750
|
+
/**
|
|
3751
|
+
* Creator identifier (DID, URI, or opaque ID).
|
|
3752
|
+
* Not an identity attestation; records observed attribution metadata.
|
|
3753
|
+
*/
|
|
3754
|
+
creator_ref: zod.z.string().min(1).max(EXTENSION_LIMITS.maxCreatorRefLength),
|
|
3755
|
+
/** SPDX license expression (parser-grade structural subset validator). */
|
|
3756
|
+
license_spdx: SpdxExpressionSchema.optional(),
|
|
3757
|
+
/**
|
|
3758
|
+
* Obligation type.
|
|
3759
|
+
* Open vocabulary (e.g., attribution_required, share_alike, non_commercial).
|
|
3760
|
+
*/
|
|
3761
|
+
obligation_type: zod.z.string().min(1).max(EXTENSION_LIMITS.maxObligationTypeLength).optional(),
|
|
3762
|
+
/** Required attribution text. */
|
|
3763
|
+
attribution_text: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAttributionTextLength).optional(),
|
|
3764
|
+
/** Content signal observation source (closed vocabulary). */
|
|
3765
|
+
content_signal_source: ContentSignalSourceSchema.optional(),
|
|
3766
|
+
/** SHA-256 digest of the attributed content. */
|
|
3767
|
+
content_digest: Sha256DigestSchema.optional()
|
|
3768
|
+
}).strict();
|
|
3769
|
+
var PURPOSE_EXTENSION_KEY = "org.peacprotocol/purpose";
|
|
3770
|
+
var MachineSafePurposeTokenSchema = zod.z.string().min(1).max(EXTENSION_LIMITS.maxExternalPurposeLength).regex(PURPOSE_TOKEN_REGEX, "must be a machine-safe lowercase token");
|
|
3771
|
+
function hasUniqueItems(items) {
|
|
3772
|
+
return new Set(items).size === items.length;
|
|
3773
|
+
}
|
|
3774
|
+
var PurposeExtensionSchema = zod.z.object({
|
|
3775
|
+
/**
|
|
3776
|
+
* External/legal/business purpose labels.
|
|
3777
|
+
* Machine-safe tokens: lowercase alphanumeric with underscores, hyphens,
|
|
3778
|
+
* and optional vendor prefix (e.g., ai_training, analytics, marketing).
|
|
3779
|
+
* Not PEAC operational tokens; use peac_purpose_mapping for bridging.
|
|
3780
|
+
* Items must be unique.
|
|
3781
|
+
*/
|
|
3782
|
+
external_purposes: zod.z.array(MachineSafePurposeTokenSchema).min(1).max(EXTENSION_LIMITS.maxExternalPurposesCount).refine(hasUniqueItems, { message: "external_purposes must contain unique items" }),
|
|
3783
|
+
/**
|
|
3784
|
+
* Legal or policy basis for the declared purposes.
|
|
3785
|
+
* Open vocabulary (e.g., consent, legitimate_interest, contract).
|
|
3786
|
+
*/
|
|
3787
|
+
purpose_basis: zod.z.string().min(1).max(EXTENSION_LIMITS.maxPurposeBasisLength).optional(),
|
|
3788
|
+
/** Whether purpose limitation applies. */
|
|
3789
|
+
purpose_limitation: zod.z.boolean().optional(),
|
|
3790
|
+
/** Whether data minimization was applied. */
|
|
3791
|
+
data_minimization: zod.z.boolean().optional(),
|
|
3792
|
+
/**
|
|
3793
|
+
* Compatible purposes for secondary use.
|
|
3794
|
+
* Same machine-safe token grammar as external_purposes.
|
|
3795
|
+
* Items must be unique.
|
|
3796
|
+
*/
|
|
3797
|
+
compatible_purposes: zod.z.array(MachineSafePurposeTokenSchema).max(EXTENSION_LIMITS.maxCompatiblePurposesCount).refine(hasUniqueItems, { message: "compatible_purposes must contain unique items" }).optional(),
|
|
3798
|
+
/**
|
|
3799
|
+
* Explicit mapping to a PEAC operational CanonicalPurpose token.
|
|
3800
|
+
* Validated against PURPOSE_TOKEN_REGEX from purpose.ts.
|
|
3801
|
+
* Bridges external purpose vocabulary to operational tokens.
|
|
3802
|
+
*/
|
|
3803
|
+
peac_purpose_mapping: zod.z.string().min(1).max(MAX_PURPOSE_TOKEN_LENGTH).regex(PURPOSE_TOKEN_REGEX, "must be a valid PEAC purpose token").optional()
|
|
3804
|
+
}).strict();
|
|
3805
|
+
|
|
3806
|
+
// src/wire-02-extensions/accessors.ts
|
|
3263
3807
|
function getExtension(extensions, key, schema) {
|
|
3264
3808
|
if (extensions === void 0) return void 0;
|
|
3265
3809
|
if (!Object.prototype.hasOwnProperty.call(extensions, key)) return void 0;
|
|
@@ -3295,9 +3839,88 @@ function getIdentityExtension(extensions) {
|
|
|
3295
3839
|
function getCorrelationExtension(extensions) {
|
|
3296
3840
|
return getExtension(extensions, CORRELATION_EXTENSION_KEY, CorrelationExtensionSchema);
|
|
3297
3841
|
}
|
|
3842
|
+
function getConsentExtension(extensions) {
|
|
3843
|
+
return getExtension(extensions, CONSENT_EXTENSION_KEY, ConsentExtensionSchema);
|
|
3844
|
+
}
|
|
3845
|
+
function getPrivacyExtension(extensions) {
|
|
3846
|
+
return getExtension(extensions, PRIVACY_EXTENSION_KEY, PrivacyExtensionSchema);
|
|
3847
|
+
}
|
|
3848
|
+
function getSafetyExtension(extensions) {
|
|
3849
|
+
return getExtension(extensions, SAFETY_EXTENSION_KEY, SafetyExtensionSchema);
|
|
3850
|
+
}
|
|
3851
|
+
function getComplianceExtension(extensions) {
|
|
3852
|
+
return getExtension(extensions, COMPLIANCE_EXTENSION_KEY, ComplianceExtensionSchema);
|
|
3853
|
+
}
|
|
3854
|
+
function getProvenanceExtension(extensions) {
|
|
3855
|
+
return getExtension(extensions, PROVENANCE_EXTENSION_KEY, ProvenanceExtensionSchema);
|
|
3856
|
+
}
|
|
3857
|
+
function getAttributionExtension(extensions) {
|
|
3858
|
+
return getExtension(extensions, ATTRIBUTION_EXTENSION_KEY, AttributionExtensionSchema);
|
|
3859
|
+
}
|
|
3860
|
+
function getPurposeExtension(extensions) {
|
|
3861
|
+
return getExtension(extensions, PURPOSE_EXTENSION_KEY, PurposeExtensionSchema);
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
// src/wire-02-extensions/schema-map.ts
|
|
3865
|
+
var EXTENSION_SCHEMA_MAP = /* @__PURE__ */ new Map();
|
|
3866
|
+
EXTENSION_SCHEMA_MAP.set(COMMERCE_EXTENSION_KEY, CommerceExtensionSchema);
|
|
3867
|
+
EXTENSION_SCHEMA_MAP.set(ACCESS_EXTENSION_KEY, AccessExtensionSchema);
|
|
3868
|
+
EXTENSION_SCHEMA_MAP.set(CHALLENGE_EXTENSION_KEY, ChallengeExtensionSchema);
|
|
3869
|
+
EXTENSION_SCHEMA_MAP.set(IDENTITY_EXTENSION_KEY, IdentityExtensionSchema);
|
|
3870
|
+
EXTENSION_SCHEMA_MAP.set(CORRELATION_EXTENSION_KEY, CorrelationExtensionSchema);
|
|
3871
|
+
EXTENSION_SCHEMA_MAP.set(CONSENT_EXTENSION_KEY, ConsentExtensionSchema);
|
|
3872
|
+
EXTENSION_SCHEMA_MAP.set(PRIVACY_EXTENSION_KEY, PrivacyExtensionSchema);
|
|
3873
|
+
EXTENSION_SCHEMA_MAP.set(SAFETY_EXTENSION_KEY, SafetyExtensionSchema);
|
|
3874
|
+
EXTENSION_SCHEMA_MAP.set(COMPLIANCE_EXTENSION_KEY, ComplianceExtensionSchema);
|
|
3875
|
+
EXTENSION_SCHEMA_MAP.set(PROVENANCE_EXTENSION_KEY, ProvenanceExtensionSchema);
|
|
3876
|
+
EXTENSION_SCHEMA_MAP.set(ATTRIBUTION_EXTENSION_KEY, AttributionExtensionSchema);
|
|
3877
|
+
EXTENSION_SCHEMA_MAP.set(PURPOSE_EXTENSION_KEY, PurposeExtensionSchema);
|
|
3878
|
+
|
|
3879
|
+
// src/wire-02-extensions/validation.ts
|
|
3880
|
+
var textEncoder = new TextEncoder();
|
|
3881
|
+
function jsonUtf8ByteLength(value) {
|
|
3882
|
+
try {
|
|
3883
|
+
return textEncoder.encode(JSON.stringify(value)).byteLength;
|
|
3884
|
+
} catch {
|
|
3885
|
+
return Infinity;
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
var MAX_JSON_GUARD_DEPTH = 64;
|
|
3889
|
+
function isPlainJsonValueRecursive(value, depth, seen) {
|
|
3890
|
+
if (depth > MAX_JSON_GUARD_DEPTH) return false;
|
|
3891
|
+
if (value === null) return true;
|
|
3892
|
+
const t = typeof value;
|
|
3893
|
+
if (t === "string" || t === "boolean") return true;
|
|
3894
|
+
if (t === "number") return Number.isFinite(value);
|
|
3895
|
+
if (t === "function" || t === "symbol" || t === "bigint" || t === "undefined") return false;
|
|
3896
|
+
if (t !== "object") return false;
|
|
3897
|
+
const obj = value;
|
|
3898
|
+
if (seen.has(obj)) return false;
|
|
3899
|
+
seen.add(obj);
|
|
3900
|
+
if (Array.isArray(obj)) {
|
|
3901
|
+
for (let i = 0; i < obj.length; i++) {
|
|
3902
|
+
if (!isPlainJsonValueRecursive(obj[i], depth + 1, seen)) return false;
|
|
3903
|
+
}
|
|
3904
|
+
return true;
|
|
3905
|
+
}
|
|
3906
|
+
const proto = Object.getPrototypeOf(obj);
|
|
3907
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
3908
|
+
if (typeof obj.toJSON === "function") return false;
|
|
3909
|
+
const keys = Object.keys(obj);
|
|
3910
|
+
for (const key of keys) {
|
|
3911
|
+
if (!isPlainJsonValueRecursive(obj[key], depth + 1, seen)) {
|
|
3912
|
+
return false;
|
|
3913
|
+
}
|
|
3914
|
+
}
|
|
3915
|
+
return true;
|
|
3916
|
+
}
|
|
3917
|
+
function isPlainJsonValue(value) {
|
|
3918
|
+
return isPlainJsonValueRecursive(value, 0, /* @__PURE__ */ new WeakSet());
|
|
3919
|
+
}
|
|
3298
3920
|
function validateKnownExtensions(extensions, ctx) {
|
|
3299
3921
|
if (extensions === void 0) return;
|
|
3300
|
-
|
|
3922
|
+
const keys = Object.keys(extensions);
|
|
3923
|
+
for (const key of keys) {
|
|
3301
3924
|
if (!isValidExtensionKey(key)) {
|
|
3302
3925
|
ctx.addIssue({
|
|
3303
3926
|
code: "custom",
|
|
@@ -3306,6 +3929,14 @@ function validateKnownExtensions(extensions, ctx) {
|
|
|
3306
3929
|
});
|
|
3307
3930
|
continue;
|
|
3308
3931
|
}
|
|
3932
|
+
if (!isPlainJsonValue(extensions[key])) {
|
|
3933
|
+
ctx.addIssue({
|
|
3934
|
+
code: "custom",
|
|
3935
|
+
message: kernel.ERROR_CODES.E_EXTENSION_NON_JSON_VALUE,
|
|
3936
|
+
path: ["extensions", key]
|
|
3937
|
+
});
|
|
3938
|
+
continue;
|
|
3939
|
+
}
|
|
3309
3940
|
const schema = EXTENSION_SCHEMA_MAP.get(key);
|
|
3310
3941
|
if (schema !== void 0) {
|
|
3311
3942
|
const result = schema.safeParse(extensions[key]);
|
|
@@ -3320,6 +3951,25 @@ function validateKnownExtensions(extensions, ctx) {
|
|
|
3320
3951
|
}
|
|
3321
3952
|
}
|
|
3322
3953
|
}
|
|
3954
|
+
const totalBytes = jsonUtf8ByteLength(extensions);
|
|
3955
|
+
if (totalBytes > kernel.EXTENSION_BUDGET.maxTotalBytes) {
|
|
3956
|
+
ctx.addIssue({
|
|
3957
|
+
code: "custom",
|
|
3958
|
+
message: kernel.ERROR_CODES.E_EXTENSION_SIZE_EXCEEDED,
|
|
3959
|
+
path: ["extensions"]
|
|
3960
|
+
});
|
|
3961
|
+
return;
|
|
3962
|
+
}
|
|
3963
|
+
for (const key of keys) {
|
|
3964
|
+
const groupBytes = jsonUtf8ByteLength(extensions[key]);
|
|
3965
|
+
if (groupBytes > kernel.EXTENSION_BUDGET.maxGroupBytes) {
|
|
3966
|
+
ctx.addIssue({
|
|
3967
|
+
code: "custom",
|
|
3968
|
+
message: kernel.ERROR_CODES.E_EXTENSION_SIZE_EXCEEDED,
|
|
3969
|
+
path: ["extensions", key]
|
|
3970
|
+
});
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3323
3973
|
}
|
|
3324
3974
|
|
|
3325
3975
|
// src/wire-02-envelope.ts
|
|
@@ -3397,7 +4047,7 @@ var PolicyBlockSchema = zod.z.object({
|
|
|
3397
4047
|
/**
|
|
3398
4048
|
* HTTPS locator hint for the policy document.
|
|
3399
4049
|
* MUST be an https:// URL (max 2048 chars).
|
|
3400
|
-
* MUST NOT trigger auto-fetch; callers use this as a hint only
|
|
4050
|
+
* MUST NOT trigger auto-fetch; callers use this as a hint only.
|
|
3401
4051
|
*/
|
|
3402
4052
|
uri: zod.z.string().max(kernel.POLICY_BLOCK.uriMaxLength).url().refine((u) => u.startsWith("https://"), "policy.uri must be an https:// URL").optional(),
|
|
3403
4053
|
/** Caller-assigned version label (max 256 chars) */
|
|
@@ -3422,9 +4072,9 @@ var Wire02ClaimsSchema = zod.z.object({
|
|
|
3422
4072
|
pillars: PillarsSchema.optional(),
|
|
3423
4073
|
/** Top-level actor binding (sole location for ActorBinding in Wire 0.2) */
|
|
3424
4074
|
actor: ActorBindingSchema.optional(),
|
|
3425
|
-
/** Policy binding block
|
|
4075
|
+
/** Policy binding block */
|
|
3426
4076
|
policy: PolicyBlockSchema.optional(),
|
|
3427
|
-
/** Representation fields
|
|
4077
|
+
/** Representation fields: FingerprintRef validation, sha256-only, strict */
|
|
3428
4078
|
representation: Wire02RepresentationFieldsSchema.optional(),
|
|
3429
4079
|
/** ISO 8601 / RFC 3339 timestamp when the interaction occurred; evidence kind only */
|
|
3430
4080
|
occurred_at: zod.z.string().datetime({ offset: true }).optional(),
|
|
@@ -3559,6 +4209,8 @@ var WARNING_TYPE_UNREGISTERED = "type_unregistered";
|
|
|
3559
4209
|
var WARNING_UNKNOWN_EXTENSION = "unknown_extension_preserved";
|
|
3560
4210
|
var WARNING_OCCURRED_AT_SKEW = "occurred_at_skew";
|
|
3561
4211
|
var WARNING_TYP_MISSING = "typ_missing";
|
|
4212
|
+
var WARNING_EXTENSION_GROUP_MISSING = "extension_group_missing";
|
|
4213
|
+
var WARNING_EXTENSION_GROUP_MISMATCH = "extension_group_mismatch";
|
|
3562
4214
|
function sortWarnings(warnings) {
|
|
3563
4215
|
return [...warnings].sort((a, b) => {
|
|
3564
4216
|
const aHasPtr = a.pointer !== void 0;
|
|
@@ -3572,27 +4224,12 @@ function sortWarnings(warnings) {
|
|
|
3572
4224
|
return a.code.localeCompare(b.code);
|
|
3573
4225
|
});
|
|
3574
4226
|
}
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
"org.peacprotocol/consent-record",
|
|
3582
|
-
"org.peacprotocol/compliance-check",
|
|
3583
|
-
"org.peacprotocol/privacy-signal",
|
|
3584
|
-
"org.peacprotocol/safety-review",
|
|
3585
|
-
"org.peacprotocol/provenance-record",
|
|
3586
|
-
"org.peacprotocol/attribution-event",
|
|
3587
|
-
"org.peacprotocol/purpose-declaration"
|
|
3588
|
-
]);
|
|
3589
|
-
var REGISTERED_EXTENSION_GROUP_KEYS = /* @__PURE__ */ new Set([
|
|
3590
|
-
"org.peacprotocol/commerce",
|
|
3591
|
-
"org.peacprotocol/access",
|
|
3592
|
-
"org.peacprotocol/challenge",
|
|
3593
|
-
"org.peacprotocol/identity",
|
|
3594
|
-
"org.peacprotocol/correlation"
|
|
3595
|
-
]);
|
|
4227
|
+
var REGISTERED_RECEIPT_TYPES = new Set(
|
|
4228
|
+
kernel.RECEIPT_TYPES.map((entry) => entry.id)
|
|
4229
|
+
);
|
|
4230
|
+
var REGISTERED_EXTENSION_GROUP_KEYS = new Set(
|
|
4231
|
+
kernel.EXTENSION_GROUPS.map((entry) => entry.id)
|
|
4232
|
+
);
|
|
3596
4233
|
|
|
3597
4234
|
// src/policy-binding.ts
|
|
3598
4235
|
function verifyPolicyBinding(receiptDigest, localDigest) {
|
|
@@ -3624,12 +4261,17 @@ function findRevokedKey(revokedKeys, kid) {
|
|
|
3624
4261
|
return revokedKeys.find((entry) => entry.kid === kid) ?? null;
|
|
3625
4262
|
}
|
|
3626
4263
|
|
|
4264
|
+
Object.defineProperty(exports, "EXTENSION_BUDGET", {
|
|
4265
|
+
enumerable: true,
|
|
4266
|
+
get: function () { return kernel.EXTENSION_BUDGET; }
|
|
4267
|
+
});
|
|
3627
4268
|
exports.ACCESS_EXTENSION_KEY = ACCESS_EXTENSION_KEY;
|
|
3628
4269
|
exports.ACTOR_BINDING_EXTENSION_KEY = ACTOR_BINDING_EXTENSION_KEY;
|
|
3629
4270
|
exports.AGENT_IDENTITY_TYPE = AGENT_IDENTITY_TYPE;
|
|
3630
4271
|
exports.AIPREFSnapshotSchema = AIPREFSnapshot;
|
|
3631
4272
|
exports.ATTESTATION_LIMITS = ATTESTATION_LIMITS;
|
|
3632
4273
|
exports.ATTESTATION_RECEIPT_TYPE = ATTESTATION_RECEIPT_TYPE;
|
|
4274
|
+
exports.ATTRIBUTION_EXTENSION_KEY = ATTRIBUTION_EXTENSION_KEY;
|
|
3633
4275
|
exports.ATTRIBUTION_LIMITS = ATTRIBUTION_LIMITS;
|
|
3634
4276
|
exports.ATTRIBUTION_TYPE = ATTRIBUTION_TYPE;
|
|
3635
4277
|
exports.ATTRIBUTION_USAGES = ATTRIBUTION_USAGES;
|
|
@@ -3644,6 +4286,7 @@ exports.AttestationReceiptClaimsSchema = AttestationReceiptClaimsSchema;
|
|
|
3644
4286
|
exports.AttestationSchema = AttestationSchema;
|
|
3645
4287
|
exports.AttributionAttestationSchema = AttributionAttestationSchema;
|
|
3646
4288
|
exports.AttributionEvidenceSchema = AttributionEvidenceSchema;
|
|
4289
|
+
exports.AttributionExtensionSchema = AttributionExtensionSchema;
|
|
3647
4290
|
exports.AttributionSourceSchema = AttributionSourceSchema;
|
|
3648
4291
|
exports.AttributionUsageSchema = AttributionUsageSchema;
|
|
3649
4292
|
exports.BindingDetailsSchema = BindingDetailsSchema;
|
|
@@ -3654,6 +4297,11 @@ exports.CHALLENGE_EXTENSION_KEY = CHALLENGE_EXTENSION_KEY;
|
|
|
3654
4297
|
exports.CHALLENGE_TYPES = CHALLENGE_TYPES;
|
|
3655
4298
|
exports.COMMERCE_EXTENSION_KEY = COMMERCE_EXTENSION_KEY;
|
|
3656
4299
|
exports.COMMITMENT_CLASSES = COMMITMENT_CLASSES;
|
|
4300
|
+
exports.COMPLIANCE_EXTENSION_KEY = COMPLIANCE_EXTENSION_KEY;
|
|
4301
|
+
exports.COMPLIANCE_STATUSES = COMPLIANCE_STATUSES;
|
|
4302
|
+
exports.CONSENT_EXTENSION_KEY = CONSENT_EXTENSION_KEY;
|
|
4303
|
+
exports.CONSENT_STATUSES = CONSENT_STATUSES;
|
|
4304
|
+
exports.CONTENT_SIGNAL_SOURCES = CONTENT_SIGNAL_SOURCES;
|
|
3657
4305
|
exports.CONTRIBUTION_TYPES = CONTRIBUTION_TYPES;
|
|
3658
4306
|
exports.CONTROL_ACTIONS = CONTROL_ACTIONS;
|
|
3659
4307
|
exports.CONTROL_ACTION_EXTENSION_KEY = CONTROL_ACTION_EXTENSION_KEY;
|
|
@@ -3672,8 +4320,13 @@ exports.ChallengeTypeSchema = ChallengeTypeSchema;
|
|
|
3672
4320
|
exports.CommerceExtensionSchema = CommerceExtensionSchema;
|
|
3673
4321
|
exports.CommitmentClassSchema = CommitmentClassSchema;
|
|
3674
4322
|
exports.CompactJwsSchema = CompactJwsSchema;
|
|
4323
|
+
exports.ComplianceExtensionSchema = ComplianceExtensionSchema;
|
|
4324
|
+
exports.ComplianceStatusSchema = ComplianceStatusSchema;
|
|
4325
|
+
exports.ConsentExtensionSchema = ConsentExtensionSchema;
|
|
4326
|
+
exports.ConsentStatusSchema = ConsentStatusSchema;
|
|
3675
4327
|
exports.ContactMethodSchema = ContactMethodSchema;
|
|
3676
4328
|
exports.ContentHashSchema = ContentHashSchema;
|
|
4329
|
+
exports.ContentSignalSourceSchema = ContentSignalSourceSchema;
|
|
3677
4330
|
exports.ContributionObligationSchema = ContributionObligationSchema;
|
|
3678
4331
|
exports.ContributionTypeSchema = ContributionTypeSchema;
|
|
3679
4332
|
exports.ControlActionSchema = ControlActionSchema;
|
|
@@ -3691,6 +4344,7 @@ exports.CredentialEventTypeSchema = CredentialEventTypeSchema;
|
|
|
3691
4344
|
exports.CredentialRefSchema = CredentialRefSchema;
|
|
3692
4345
|
exports.CreditMethodSchema = CreditMethodSchema;
|
|
3693
4346
|
exports.CreditObligationSchema = CreditObligationSchema;
|
|
4347
|
+
exports.CustodyEntrySchema = CustodyEntrySchema;
|
|
3694
4348
|
exports.DERIVATION_TYPES = DERIVATION_TYPES;
|
|
3695
4349
|
exports.DIGEST_SIZE_CONSTANTS = DIGEST_SIZE_CONSTANTS;
|
|
3696
4350
|
exports.DIGEST_VALUE_PATTERN = DIGEST_VALUE_PATTERN;
|
|
@@ -3727,6 +4381,7 @@ exports.Extensions = Extensions;
|
|
|
3727
4381
|
exports.ExtensionsSchema = ExtensionsSchema;
|
|
3728
4382
|
exports.HashAlgorithmSchema = HashAlgorithmSchema;
|
|
3729
4383
|
exports.HashEncodingSchema = HashEncodingSchema;
|
|
4384
|
+
exports.HttpsUriHintSchema = HttpsUriHintSchema;
|
|
3730
4385
|
exports.IDENTITY_EXTENSION_KEY = IDENTITY_EXTENSION_KEY;
|
|
3731
4386
|
exports.INTERACTION_EXTENSION_KEY = INTERACTION_EXTENSION_KEY;
|
|
3732
4387
|
exports.INTERACTION_LIMITS = INTERACTION_LIMITS;
|
|
@@ -3734,6 +4389,10 @@ exports.INTERNAL_PURPOSE_UNDECLARED = INTERNAL_PURPOSE_UNDECLARED;
|
|
|
3734
4389
|
exports.IdentityBindingSchema = IdentityBindingSchema;
|
|
3735
4390
|
exports.IdentityExtensionSchema = IdentityExtensionSchema;
|
|
3736
4391
|
exports.InteractionEvidenceV01Schema = InteractionEvidenceV01Schema;
|
|
4392
|
+
exports.Iso8601DateSchema = Iso8601DateSchema;
|
|
4393
|
+
exports.Iso8601DateStringSchema = Iso8601DateStringSchema;
|
|
4394
|
+
exports.Iso8601DurationSchema = Iso8601DurationSchema;
|
|
4395
|
+
exports.Iso8601OffsetDateTimeSchema = Iso8601OffsetDateTimeSchema;
|
|
3737
4396
|
exports.JSON_EVIDENCE_LIMITS = JSON_EVIDENCE_LIMITS;
|
|
3738
4397
|
exports.JWSHeader = JWSHeader;
|
|
3739
4398
|
exports.JsonArraySchema = JsonArraySchema;
|
|
@@ -3771,8 +4430,11 @@ exports.PEAC_RECEIPT_HEADER = PEAC_RECEIPT_HEADER;
|
|
|
3771
4430
|
exports.PEAC_RECEIPT_SCHEMA_URL = PEAC_RECEIPT_SCHEMA_URL;
|
|
3772
4431
|
exports.PEAC_WIRE_TYP = PEAC_WIRE_TYP;
|
|
3773
4432
|
exports.POLICY_DECISIONS = POLICY_DECISIONS;
|
|
4433
|
+
exports.PRIVACY_EXTENSION_KEY = PRIVACY_EXTENSION_KEY;
|
|
3774
4434
|
exports.PROOF_METHODS = PROOF_METHODS;
|
|
3775
4435
|
exports.PROOF_TYPES = PROOF_TYPES;
|
|
4436
|
+
exports.PROVENANCE_EXTENSION_KEY = PROVENANCE_EXTENSION_KEY;
|
|
4437
|
+
exports.PURPOSE_EXTENSION_KEY = PURPOSE_EXTENSION_KEY;
|
|
3776
4438
|
exports.PURPOSE_REASONS = PURPOSE_REASONS;
|
|
3777
4439
|
exports.PURPOSE_TOKEN_REGEX = PURPOSE_TOKEN_REGEX;
|
|
3778
4440
|
exports.PayloadRefSchema = PayloadRefSchema;
|
|
@@ -3783,11 +4445,15 @@ exports.PeacEvidenceCarrierSchema = PeacEvidenceCarrierSchema;
|
|
|
3783
4445
|
exports.PillarsSchema = PillarsSchema;
|
|
3784
4446
|
exports.PolicyBlockSchema = PolicyBlockSchema;
|
|
3785
4447
|
exports.PolicyContextSchema = PolicyContextSchema;
|
|
4448
|
+
exports.PrivacyExtensionSchema = PrivacyExtensionSchema;
|
|
3786
4449
|
exports.ProblemDetailsSchema = ProblemDetailsSchema;
|
|
3787
4450
|
exports.ProofMethodSchema = ProofMethodSchema;
|
|
3788
4451
|
exports.ProofTypeSchema = ProofTypeSchema;
|
|
4452
|
+
exports.ProvenanceExtensionSchema = ProvenanceExtensionSchema;
|
|
4453
|
+
exports.PurposeExtensionSchema = PurposeExtensionSchema;
|
|
3789
4454
|
exports.PurposeReasonSchema = PurposeReasonSchema;
|
|
3790
4455
|
exports.PurposeTokenSchema = PurposeTokenSchema;
|
|
4456
|
+
exports.RECIPIENT_SCOPES = RECIPIENT_SCOPES;
|
|
3791
4457
|
exports.REDACTION_MODES = REDACTION_MODES;
|
|
3792
4458
|
exports.REGISTERED_EXTENSION_GROUP_KEYS = REGISTERED_EXTENSION_GROUP_KEYS;
|
|
3793
4459
|
exports.REGISTERED_RECEIPT_TYPES = REGISTERED_RECEIPT_TYPES;
|
|
@@ -3795,21 +4461,35 @@ exports.REMEDIATION_TYPES = REMEDIATION_TYPES;
|
|
|
3795
4461
|
exports.REPRESENTATION_LIMITS = REPRESENTATION_LIMITS;
|
|
3796
4462
|
exports.RESERVED_KIND_PREFIXES = RESERVED_KIND_PREFIXES;
|
|
3797
4463
|
exports.RESULT_STATUSES = RESULT_STATUSES;
|
|
4464
|
+
exports.RETENTION_MODES = RETENTION_MODES;
|
|
4465
|
+
exports.REVIEW_STATUSES = REVIEW_STATUSES;
|
|
3798
4466
|
exports.REVOCATION_REASONS = REVOCATION_REASONS;
|
|
4467
|
+
exports.RISK_LEVELS = RISK_LEVELS;
|
|
3799
4468
|
exports.ReceiptClaims = ReceiptClaims;
|
|
3800
4469
|
exports.ReceiptClaimsSchema = ReceiptClaimsSchema;
|
|
3801
4470
|
exports.ReceiptRefSchema = ReceiptRefSchema2;
|
|
3802
4471
|
exports.ReceiptTypeSchema = ReceiptTypeSchema;
|
|
3803
4472
|
exports.ReceiptUrlSchema = ReceiptUrlSchema;
|
|
4473
|
+
exports.RecipientScopeSchema = RecipientScopeSchema;
|
|
3804
4474
|
exports.RefsSchema = RefsSchema;
|
|
3805
4475
|
exports.RemediationSchema = RemediationSchema;
|
|
3806
4476
|
exports.RemediationTypeSchema = RemediationTypeSchema;
|
|
3807
4477
|
exports.RepresentationFieldsSchema = Wire02RepresentationFieldsSchema;
|
|
3808
4478
|
exports.ResourceTargetSchema = ResourceTargetSchema;
|
|
3809
4479
|
exports.ResultSchema = ResultSchema;
|
|
4480
|
+
exports.RetentionModeSchema = RetentionModeSchema;
|
|
4481
|
+
exports.ReviewStatusSchema = ReviewStatusSchema;
|
|
3810
4482
|
exports.RevokedKeyEntrySchema = RevokedKeyEntrySchema;
|
|
3811
4483
|
exports.RevokedKeysArraySchema = RevokedKeysArraySchema;
|
|
4484
|
+
exports.Rfc3339DateTimeSchema = Rfc3339DateTimeSchema;
|
|
4485
|
+
exports.Rfc3339TimestampSchema = Rfc3339TimestampSchema;
|
|
4486
|
+
exports.RiskLevelSchema = RiskLevelSchema;
|
|
4487
|
+
exports.SAFETY_EXTENSION_KEY = SAFETY_EXTENSION_KEY;
|
|
3812
4488
|
exports.STEP_ID_PATTERN = STEP_ID_PATTERN;
|
|
4489
|
+
exports.SafetyExtensionSchema = SafetyExtensionSchema;
|
|
4490
|
+
exports.Sha256DigestSchema = Sha256DigestSchema;
|
|
4491
|
+
exports.SlsaLevelSchema = SlsaLevelSchema;
|
|
4492
|
+
exports.SpdxExpressionSchema = SpdxExpressionSchema;
|
|
3813
4493
|
exports.StepIdSchema = StepIdSchema;
|
|
3814
4494
|
exports.SubjectProfileSchema = SubjectProfileSchema;
|
|
3815
4495
|
exports.SubjectProfileSnapshotSchema = SubjectProfileSnapshotSchema;
|
|
@@ -3822,6 +4502,8 @@ exports.ToolRegistrySchema = ToolRegistrySchema;
|
|
|
3822
4502
|
exports.ToolTargetSchema = ToolTargetSchema;
|
|
3823
4503
|
exports.TreatySchema = TreatySchema;
|
|
3824
4504
|
exports.VerifyRequestSchema = VerifyRequest;
|
|
4505
|
+
exports.WARNING_EXTENSION_GROUP_MISMATCH = WARNING_EXTENSION_GROUP_MISMATCH;
|
|
4506
|
+
exports.WARNING_EXTENSION_GROUP_MISSING = WARNING_EXTENSION_GROUP_MISSING;
|
|
3825
4507
|
exports.WARNING_OCCURRED_AT_SKEW = WARNING_OCCURRED_AT_SKEW;
|
|
3826
4508
|
exports.WARNING_TYPE_UNREGISTERED = WARNING_TYPE_UNREGISTERED;
|
|
3827
4509
|
exports.WARNING_TYP_MISSING = WARNING_TYP_MISSING;
|
|
@@ -3873,11 +4555,18 @@ exports.extractObligationsExtension = extractObligationsExtension;
|
|
|
3873
4555
|
exports.findRevokedKey = findRevokedKey;
|
|
3874
4556
|
exports.fingerprintRefToString = fingerprintRefToString;
|
|
3875
4557
|
exports.getAccessExtension = getAccessExtension;
|
|
4558
|
+
exports.getAttributionExtension = getAttributionExtension;
|
|
3876
4559
|
exports.getChallengeExtension = getChallengeExtension;
|
|
3877
4560
|
exports.getCommerceExtension = getCommerceExtension;
|
|
4561
|
+
exports.getComplianceExtension = getComplianceExtension;
|
|
4562
|
+
exports.getConsentExtension = getConsentExtension;
|
|
3878
4563
|
exports.getCorrelationExtension = getCorrelationExtension;
|
|
3879
4564
|
exports.getIdentityExtension = getIdentityExtension;
|
|
3880
4565
|
exports.getInteraction = getInteraction;
|
|
4566
|
+
exports.getPrivacyExtension = getPrivacyExtension;
|
|
4567
|
+
exports.getProvenanceExtension = getProvenanceExtension;
|
|
4568
|
+
exports.getPurposeExtension = getPurposeExtension;
|
|
4569
|
+
exports.getSafetyExtension = getSafetyExtension;
|
|
3881
4570
|
exports.getValidTransitions = getValidTransitions;
|
|
3882
4571
|
exports.hasInteraction = hasInteraction;
|
|
3883
4572
|
exports.hasUnknownPurposeTokens = hasUnknownPurposeTokens;
|