@peac/schema 0.10.9 → 0.10.10
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/LICENSE +1 -1
- package/dist/attestation-receipt.cjs +127 -0
- package/dist/attestation-receipt.cjs.map +1 -0
- package/dist/attestation-receipt.mjs +113 -0
- package/dist/attestation-receipt.mjs.map +1 -0
- package/dist/attribution.cjs +249 -0
- package/dist/attribution.cjs.map +1 -0
- package/dist/attribution.mjs +227 -0
- package/dist/attribution.mjs.map +1 -0
- package/dist/dispute.d.ts.map +1 -1
- package/dist/index.cjs +2818 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +2577 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interaction.cjs +619 -0
- package/dist/interaction.cjs.map +1 -0
- package/dist/interaction.mjs +583 -0
- package/dist/interaction.mjs.map +1 -0
- package/dist/normalize.cjs +84 -0
- package/dist/normalize.cjs.map +1 -0
- package/dist/normalize.d.ts +15 -9
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.mjs +82 -0
- package/dist/normalize.mjs.map +1 -0
- package/dist/receipt-parser.cjs +333 -0
- package/dist/receipt-parser.cjs.map +1 -0
- package/dist/receipt-parser.mjs +331 -0
- package/dist/receipt-parser.mjs.map +1 -0
- package/dist/workflow.cjs +321 -0
- package/dist/workflow.cjs.map +1 -0
- package/dist/workflow.mjs +292 -0
- package/dist/workflow.mjs.map +1 -0
- package/package.json +50 -6
- package/dist/agent-identity.js +0 -357
- package/dist/agent-identity.js.map +0 -1
- package/dist/attestation-receipt.js +0 -249
- package/dist/attestation-receipt.js.map +0 -1
- package/dist/attribution.js +0 -444
- package/dist/attribution.js.map +0 -1
- package/dist/constants.js +0 -73
- package/dist/constants.js.map +0 -1
- package/dist/control.js +0 -9
- package/dist/control.js.map +0 -1
- package/dist/dispute.js +0 -832
- package/dist/dispute.js.map +0 -1
- package/dist/envelope.js +0 -9
- package/dist/envelope.js.map +0 -1
- package/dist/errors.js +0 -116
- package/dist/errors.js.map +0 -1
- package/dist/evidence.js +0 -8
- package/dist/evidence.js.map +0 -1
- package/dist/index.js +0 -283
- package/dist/index.js.map +0 -1
- package/dist/interaction.js +0 -918
- package/dist/interaction.js.map +0 -1
- package/dist/json.js +0 -267
- package/dist/json.js.map +0 -1
- package/dist/normalize.js +0 -103
- package/dist/normalize.js.map +0 -1
- package/dist/obligations.js +0 -337
- package/dist/obligations.js.map +0 -1
- package/dist/purpose.js +0 -296
- package/dist/purpose.js.map +0 -1
- package/dist/receipt-parser.js +0 -89
- package/dist/receipt-parser.js.map +0 -1
- package/dist/schemas.js +0 -7
- package/dist/schemas.js.map +0 -1
- package/dist/subject.js +0 -9
- package/dist/subject.js.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
- package/dist/validators.js +0 -421
- package/dist/validators.js.map +0 -1
- package/dist/version.js +0 -7
- package/dist/version.js.map +0 -1
- package/dist/workflow.js +0 -523
- package/dist/workflow.js.map +0 -1
package/dist/attribution.js
DELETED
|
@@ -1,444 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AttributionAttestationSchema = exports.ATTRIBUTION_TYPE = exports.AttributionEvidenceSchema = exports.AttributionSourceSchema = exports.DERIVATION_TYPES = exports.DerivationTypeSchema = exports.ATTRIBUTION_USAGES = exports.AttributionUsageSchema = exports.ContentHashSchema = exports.HashEncodingSchema = exports.HashAlgorithmSchema = exports.ATTRIBUTION_LIMITS = void 0;
|
|
4
|
-
exports.validateContentHash = validateContentHash;
|
|
5
|
-
exports.validateAttributionSource = validateAttributionSource;
|
|
6
|
-
exports.validateAttributionAttestation = validateAttributionAttestation;
|
|
7
|
-
exports.isAttributionAttestation = isAttributionAttestation;
|
|
8
|
-
exports.createAttributionAttestation = createAttributionAttestation;
|
|
9
|
-
exports.isAttributionExpired = isAttributionExpired;
|
|
10
|
-
exports.isAttributionNotYetValid = isAttributionNotYetValid;
|
|
11
|
-
exports.computeTotalWeight = computeTotalWeight;
|
|
12
|
-
exports.detectCycleInSources = detectCycleInSources;
|
|
13
|
-
/**
|
|
14
|
-
* Attribution Attestation Types and Validators (v0.9.26+)
|
|
15
|
-
*
|
|
16
|
-
* Provides content derivation and usage proof for PEAC receipts,
|
|
17
|
-
* enabling chain tracking and compliance artifacts.
|
|
18
|
-
*
|
|
19
|
-
* @see docs/specs/ATTRIBUTION.md for normative specification
|
|
20
|
-
*/
|
|
21
|
-
const zod_1 = require("zod");
|
|
22
|
-
const json_1 = require("./json");
|
|
23
|
-
// =============================================================================
|
|
24
|
-
// ATTRIBUTION LIMITS (v0.9.26+)
|
|
25
|
-
// =============================================================================
|
|
26
|
-
/**
|
|
27
|
-
* Attribution limits for DoS protection and verification feasibility.
|
|
28
|
-
*
|
|
29
|
-
* These are implementation safety limits, not protocol constraints.
|
|
30
|
-
*/
|
|
31
|
-
exports.ATTRIBUTION_LIMITS = {
|
|
32
|
-
/** Maximum sources per attestation */
|
|
33
|
-
maxSources: 100,
|
|
34
|
-
/** Maximum chain resolution depth */
|
|
35
|
-
maxDepth: 8,
|
|
36
|
-
/** Maximum attestation size in bytes (64KB) */
|
|
37
|
-
maxAttestationSize: 65536,
|
|
38
|
-
/** Per-hop resolution timeout in milliseconds */
|
|
39
|
-
resolutionTimeout: 5000,
|
|
40
|
-
/** Maximum receipt reference length */
|
|
41
|
-
maxReceiptRefLength: 2048,
|
|
42
|
-
/** Maximum model ID length */
|
|
43
|
-
maxModelIdLength: 256,
|
|
44
|
-
};
|
|
45
|
-
// =============================================================================
|
|
46
|
-
// CONTENT HASH (v0.9.26+)
|
|
47
|
-
// =============================================================================
|
|
48
|
-
/**
|
|
49
|
-
* Supported hash algorithms for content hashing.
|
|
50
|
-
* Only sha-256 is supported in v0.9.26.
|
|
51
|
-
*/
|
|
52
|
-
exports.HashAlgorithmSchema = zod_1.z.literal('sha-256');
|
|
53
|
-
/**
|
|
54
|
-
* Supported encoding formats for hash values.
|
|
55
|
-
*/
|
|
56
|
-
exports.HashEncodingSchema = zod_1.z.literal('base64url');
|
|
57
|
-
/**
|
|
58
|
-
* ContentHash - deterministic content identification.
|
|
59
|
-
*
|
|
60
|
-
* Provides cryptographic verification of content identity using SHA-256.
|
|
61
|
-
* The hash value is base64url-encoded without padding (RFC 4648 Section 5).
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* const hash: ContentHash = {
|
|
66
|
-
* alg: 'sha-256',
|
|
67
|
-
* value: 'n4bQgYhMfWWaL28IoEbM8Qa8jG7x0QXJZJqL-w_zZdA',
|
|
68
|
-
* enc: 'base64url',
|
|
69
|
-
* };
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
exports.ContentHashSchema = zod_1.z
|
|
73
|
-
.object({
|
|
74
|
-
/** Hash algorithm (REQUIRED, must be 'sha-256') */
|
|
75
|
-
alg: exports.HashAlgorithmSchema,
|
|
76
|
-
/** Base64url-encoded hash value without padding (REQUIRED, 43 chars for SHA-256) */
|
|
77
|
-
value: zod_1.z
|
|
78
|
-
.string()
|
|
79
|
-
.min(43)
|
|
80
|
-
.max(43)
|
|
81
|
-
.regex(/^[A-Za-z0-9_-]+$/, 'Invalid base64url characters'),
|
|
82
|
-
/** Encoding format (REQUIRED, must be 'base64url') */
|
|
83
|
-
enc: exports.HashEncodingSchema,
|
|
84
|
-
})
|
|
85
|
-
.strict();
|
|
86
|
-
// =============================================================================
|
|
87
|
-
// ATTRIBUTION USAGE (v0.9.26+)
|
|
88
|
-
// =============================================================================
|
|
89
|
-
/**
|
|
90
|
-
* How source content was used in derivation.
|
|
91
|
-
*
|
|
92
|
-
* - 'training_input': Used to train a model
|
|
93
|
-
* - 'rag_context': Retrieved for RAG context
|
|
94
|
-
* - 'direct_reference': Directly quoted or referenced
|
|
95
|
-
* - 'synthesis_source': Combined with other sources to create new content
|
|
96
|
-
* - 'embedding_source': Used to create embeddings/vectors
|
|
97
|
-
*/
|
|
98
|
-
exports.AttributionUsageSchema = zod_1.z.enum([
|
|
99
|
-
'training_input',
|
|
100
|
-
'rag_context',
|
|
101
|
-
'direct_reference',
|
|
102
|
-
'synthesis_source',
|
|
103
|
-
'embedding_source',
|
|
104
|
-
]);
|
|
105
|
-
/**
|
|
106
|
-
* Array of valid attribution usage types for runtime checks.
|
|
107
|
-
*/
|
|
108
|
-
exports.ATTRIBUTION_USAGES = [
|
|
109
|
-
'training_input',
|
|
110
|
-
'rag_context',
|
|
111
|
-
'direct_reference',
|
|
112
|
-
'synthesis_source',
|
|
113
|
-
'embedding_source',
|
|
114
|
-
];
|
|
115
|
-
// =============================================================================
|
|
116
|
-
// DERIVATION TYPE (v0.9.26+)
|
|
117
|
-
// =============================================================================
|
|
118
|
-
/**
|
|
119
|
-
* Type of content derivation.
|
|
120
|
-
*
|
|
121
|
-
* - 'training': Model training or fine-tuning
|
|
122
|
-
* - 'inference': Runtime inference with RAG/grounding
|
|
123
|
-
* - 'rag': Retrieval-augmented generation
|
|
124
|
-
* - 'synthesis': Multi-source content synthesis
|
|
125
|
-
* - 'embedding': Vector embedding generation
|
|
126
|
-
*/
|
|
127
|
-
exports.DerivationTypeSchema = zod_1.z.enum([
|
|
128
|
-
'training',
|
|
129
|
-
'inference',
|
|
130
|
-
'rag',
|
|
131
|
-
'synthesis',
|
|
132
|
-
'embedding',
|
|
133
|
-
]);
|
|
134
|
-
/**
|
|
135
|
-
* Array of valid derivation types for runtime checks.
|
|
136
|
-
*/
|
|
137
|
-
exports.DERIVATION_TYPES = ['training', 'inference', 'rag', 'synthesis', 'embedding'];
|
|
138
|
-
// =============================================================================
|
|
139
|
-
// ATTRIBUTION SOURCE (v0.9.26+)
|
|
140
|
-
// =============================================================================
|
|
141
|
-
/**
|
|
142
|
-
* Receipt reference format validation.
|
|
143
|
-
*
|
|
144
|
-
* Valid formats:
|
|
145
|
-
* - jti:{receipt_id} - Direct receipt identifier
|
|
146
|
-
* - https://... - Resolvable receipt URL
|
|
147
|
-
* - urn:peac:receipt:{id} - URN-formatted identifier
|
|
148
|
-
*/
|
|
149
|
-
const ReceiptRefSchema = zod_1.z
|
|
150
|
-
.string()
|
|
151
|
-
.min(1)
|
|
152
|
-
.max(exports.ATTRIBUTION_LIMITS.maxReceiptRefLength)
|
|
153
|
-
.refine((ref) => {
|
|
154
|
-
// jti: prefix
|
|
155
|
-
if (ref.startsWith('jti:'))
|
|
156
|
-
return true;
|
|
157
|
-
// URL
|
|
158
|
-
if (ref.startsWith('https://') || ref.startsWith('http://'))
|
|
159
|
-
return true;
|
|
160
|
-
// URN
|
|
161
|
-
if (ref.startsWith('urn:peac:receipt:'))
|
|
162
|
-
return true;
|
|
163
|
-
return false;
|
|
164
|
-
}, { message: 'Invalid receipt reference format. Must be jti:{id}, URL, or urn:peac:receipt:{id}' });
|
|
165
|
-
/**
|
|
166
|
-
* AttributionSource - links to a source receipt and describes how content was used.
|
|
167
|
-
*
|
|
168
|
-
* For cross-issuer resolution, include `receipt_issuer` when using `jti:*` references.
|
|
169
|
-
* URL-based references (`https://...`) are self-resolvable.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```typescript
|
|
173
|
-
* const source: AttributionSource = {
|
|
174
|
-
* receipt_ref: 'jti:rec_abc123def456',
|
|
175
|
-
* receipt_issuer: 'https://publisher.example.com',
|
|
176
|
-
* content_hash: { alg: 'sha-256', value: '...', enc: 'base64url' },
|
|
177
|
-
* usage: 'rag_context',
|
|
178
|
-
* weight: 0.3,
|
|
179
|
-
* };
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
exports.AttributionSourceSchema = zod_1.z
|
|
183
|
-
.object({
|
|
184
|
-
/** Reference to source PEAC receipt (REQUIRED) */
|
|
185
|
-
receipt_ref: ReceiptRefSchema,
|
|
186
|
-
/**
|
|
187
|
-
* Issuer of the referenced receipt (OPTIONAL but RECOMMENDED for jti: refs).
|
|
188
|
-
*
|
|
189
|
-
* Required for cross-issuer resolution when receipt_ref is jti:{id} format.
|
|
190
|
-
* Not needed for URL-based references which are self-resolvable.
|
|
191
|
-
* Used to construct resolution URL: {receipt_issuer}/.well-known/peac/receipts/{id}
|
|
192
|
-
*/
|
|
193
|
-
receipt_issuer: zod_1.z.string().url().max(2048).optional(),
|
|
194
|
-
/** Hash of source content (OPTIONAL) */
|
|
195
|
-
content_hash: exports.ContentHashSchema.optional(),
|
|
196
|
-
/** Hash of used excerpt (OPTIONAL, content-minimizing, not privacy-preserving for short text) */
|
|
197
|
-
excerpt_hash: exports.ContentHashSchema.optional(),
|
|
198
|
-
/** How the source was used (REQUIRED) */
|
|
199
|
-
usage: exports.AttributionUsageSchema,
|
|
200
|
-
/** Relative contribution weight 0.0-1.0 (OPTIONAL) */
|
|
201
|
-
weight: zod_1.z.number().min(0).max(1).optional(),
|
|
202
|
-
})
|
|
203
|
-
.strict();
|
|
204
|
-
// =============================================================================
|
|
205
|
-
// ATTRIBUTION EVIDENCE (v0.9.26+)
|
|
206
|
-
// =============================================================================
|
|
207
|
-
/**
|
|
208
|
-
* AttributionEvidence - the payload of an AttributionAttestation.
|
|
209
|
-
*
|
|
210
|
-
* Contains the sources, derivation type, and optional output metadata.
|
|
211
|
-
*/
|
|
212
|
-
exports.AttributionEvidenceSchema = zod_1.z
|
|
213
|
-
.object({
|
|
214
|
-
/** Array of attribution sources (REQUIRED, 1-100 sources) */
|
|
215
|
-
sources: zod_1.z.array(exports.AttributionSourceSchema).min(1).max(exports.ATTRIBUTION_LIMITS.maxSources),
|
|
216
|
-
/** Type of derivation (REQUIRED) */
|
|
217
|
-
derivation_type: exports.DerivationTypeSchema,
|
|
218
|
-
/** Hash of derived output (OPTIONAL) */
|
|
219
|
-
output_hash: exports.ContentHashSchema.optional(),
|
|
220
|
-
/** Model identifier (OPTIONAL) */
|
|
221
|
-
model_id: zod_1.z.string().max(exports.ATTRIBUTION_LIMITS.maxModelIdLength).optional(),
|
|
222
|
-
/** Inference provider URL (OPTIONAL) */
|
|
223
|
-
inference_provider: zod_1.z.string().url().max(2048).optional(),
|
|
224
|
-
/** Session correlation ID (OPTIONAL) */
|
|
225
|
-
session_id: zod_1.z.string().max(256).optional(),
|
|
226
|
-
/** Additional type-specific metadata (OPTIONAL) */
|
|
227
|
-
metadata: zod_1.z.record(zod_1.z.string(), json_1.JsonValueSchema).optional(),
|
|
228
|
-
})
|
|
229
|
-
.strict();
|
|
230
|
-
// =============================================================================
|
|
231
|
-
// ATTRIBUTION ATTESTATION (v0.9.26+)
|
|
232
|
-
// =============================================================================
|
|
233
|
-
/**
|
|
234
|
-
* Attestation type literal for attribution
|
|
235
|
-
*/
|
|
236
|
-
exports.ATTRIBUTION_TYPE = 'peac/attribution';
|
|
237
|
-
/**
|
|
238
|
-
* AttributionAttestation - proves content derivation and usage.
|
|
239
|
-
*
|
|
240
|
-
* This attestation provides cryptographic evidence that content was derived
|
|
241
|
-
* from specific sources, enabling chain tracking and compliance.
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
* ```typescript
|
|
245
|
-
* const attestation: AttributionAttestation = {
|
|
246
|
-
* type: 'peac/attribution',
|
|
247
|
-
* issuer: 'https://ai.example.com',
|
|
248
|
-
* issued_at: '2026-01-04T12:00:00Z',
|
|
249
|
-
* evidence: {
|
|
250
|
-
* sources: [
|
|
251
|
-
* { receipt_ref: 'jti:rec_abc123', usage: 'rag_context', weight: 0.5 },
|
|
252
|
-
* { receipt_ref: 'jti:rec_def456', usage: 'rag_context', weight: 0.5 },
|
|
253
|
-
* ],
|
|
254
|
-
* derivation_type: 'rag',
|
|
255
|
-
* model_id: 'gpt-4',
|
|
256
|
-
* },
|
|
257
|
-
* };
|
|
258
|
-
* ```
|
|
259
|
-
*/
|
|
260
|
-
exports.AttributionAttestationSchema = zod_1.z
|
|
261
|
-
.object({
|
|
262
|
-
/** Attestation type (MUST be 'peac/attribution') */
|
|
263
|
-
type: zod_1.z.literal(exports.ATTRIBUTION_TYPE),
|
|
264
|
-
/** Issuer of the attestation (inference provider, platform) */
|
|
265
|
-
issuer: zod_1.z.string().min(1).max(2048),
|
|
266
|
-
/** When the attestation was issued (RFC 3339) */
|
|
267
|
-
issued_at: zod_1.z.string().datetime(),
|
|
268
|
-
/** When the attestation expires (RFC 3339, OPTIONAL) */
|
|
269
|
-
expires_at: zod_1.z.string().datetime().optional(),
|
|
270
|
-
/** Reference to external verification endpoint (OPTIONAL) */
|
|
271
|
-
ref: zod_1.z.string().url().max(2048).optional(),
|
|
272
|
-
/** Attribution evidence */
|
|
273
|
-
evidence: exports.AttributionEvidenceSchema,
|
|
274
|
-
})
|
|
275
|
-
.strict();
|
|
276
|
-
// =============================================================================
|
|
277
|
-
// VALIDATION HELPERS (v0.9.26+)
|
|
278
|
-
// =============================================================================
|
|
279
|
-
/**
|
|
280
|
-
* Validate a ContentHash.
|
|
281
|
-
*
|
|
282
|
-
* @param data - Unknown data to validate
|
|
283
|
-
* @returns Result with validated hash or error message
|
|
284
|
-
*/
|
|
285
|
-
function validateContentHash(data) {
|
|
286
|
-
const result = exports.ContentHashSchema.safeParse(data);
|
|
287
|
-
if (result.success) {
|
|
288
|
-
return { ok: true, value: result.data };
|
|
289
|
-
}
|
|
290
|
-
return { ok: false, error: result.error.message };
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Validate an AttributionSource.
|
|
294
|
-
*
|
|
295
|
-
* @param data - Unknown data to validate
|
|
296
|
-
* @returns Result with validated source or error message
|
|
297
|
-
*/
|
|
298
|
-
function validateAttributionSource(data) {
|
|
299
|
-
const result = exports.AttributionSourceSchema.safeParse(data);
|
|
300
|
-
if (result.success) {
|
|
301
|
-
return { ok: true, value: result.data };
|
|
302
|
-
}
|
|
303
|
-
return { ok: false, error: result.error.message };
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Validate an AttributionAttestation.
|
|
307
|
-
*
|
|
308
|
-
* @param data - Unknown data to validate
|
|
309
|
-
* @returns Result with validated attestation or error message
|
|
310
|
-
*
|
|
311
|
-
* @example
|
|
312
|
-
* ```typescript
|
|
313
|
-
* const result = validateAttributionAttestation(data);
|
|
314
|
-
* if (result.ok) {
|
|
315
|
-
* console.log('Sources:', result.value.evidence.sources.length);
|
|
316
|
-
* } else {
|
|
317
|
-
* console.error('Validation error:', result.error);
|
|
318
|
-
* }
|
|
319
|
-
* ```
|
|
320
|
-
*/
|
|
321
|
-
function validateAttributionAttestation(data) {
|
|
322
|
-
const result = exports.AttributionAttestationSchema.safeParse(data);
|
|
323
|
-
if (result.success) {
|
|
324
|
-
return { ok: true, value: result.data };
|
|
325
|
-
}
|
|
326
|
-
return { ok: false, error: result.error.message };
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Check if an object is an AttributionAttestation.
|
|
330
|
-
*
|
|
331
|
-
* @param attestation - Object with a type field
|
|
332
|
-
* @returns True if the type is 'peac/attribution'
|
|
333
|
-
*/
|
|
334
|
-
function isAttributionAttestation(attestation) {
|
|
335
|
-
return attestation.type === exports.ATTRIBUTION_TYPE;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Create an AttributionAttestation with current timestamp.
|
|
339
|
-
*
|
|
340
|
-
* @param params - Attestation parameters
|
|
341
|
-
* @returns A valid AttributionAttestation
|
|
342
|
-
*
|
|
343
|
-
* @example
|
|
344
|
-
* ```typescript
|
|
345
|
-
* const attestation = createAttributionAttestation({
|
|
346
|
-
* issuer: 'https://ai.example.com',
|
|
347
|
-
* sources: [
|
|
348
|
-
* { receipt_ref: 'jti:rec_abc123', usage: 'rag_context' },
|
|
349
|
-
* ],
|
|
350
|
-
* derivation_type: 'rag',
|
|
351
|
-
* model_id: 'gpt-4',
|
|
352
|
-
* });
|
|
353
|
-
* ```
|
|
354
|
-
*/
|
|
355
|
-
function createAttributionAttestation(params) {
|
|
356
|
-
const evidence = {
|
|
357
|
-
sources: params.sources,
|
|
358
|
-
derivation_type: params.derivation_type,
|
|
359
|
-
};
|
|
360
|
-
if (params.output_hash) {
|
|
361
|
-
evidence.output_hash = params.output_hash;
|
|
362
|
-
}
|
|
363
|
-
if (params.model_id) {
|
|
364
|
-
evidence.model_id = params.model_id;
|
|
365
|
-
}
|
|
366
|
-
if (params.inference_provider) {
|
|
367
|
-
evidence.inference_provider = params.inference_provider;
|
|
368
|
-
}
|
|
369
|
-
if (params.session_id) {
|
|
370
|
-
evidence.session_id = params.session_id;
|
|
371
|
-
}
|
|
372
|
-
if (params.metadata) {
|
|
373
|
-
evidence.metadata = params.metadata;
|
|
374
|
-
}
|
|
375
|
-
const attestation = {
|
|
376
|
-
type: exports.ATTRIBUTION_TYPE,
|
|
377
|
-
issuer: params.issuer,
|
|
378
|
-
issued_at: new Date().toISOString(),
|
|
379
|
-
evidence,
|
|
380
|
-
};
|
|
381
|
-
if (params.expires_at) {
|
|
382
|
-
attestation.expires_at = params.expires_at;
|
|
383
|
-
}
|
|
384
|
-
if (params.ref) {
|
|
385
|
-
attestation.ref = params.ref;
|
|
386
|
-
}
|
|
387
|
-
return attestation;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Check if an attribution attestation is expired.
|
|
391
|
-
*
|
|
392
|
-
* @param attestation - The attestation to check
|
|
393
|
-
* @param clockSkew - Optional clock skew tolerance in milliseconds (default: 30000)
|
|
394
|
-
* @returns True if the attestation has expired
|
|
395
|
-
*/
|
|
396
|
-
function isAttributionExpired(attestation, clockSkew = 30000) {
|
|
397
|
-
if (!attestation.expires_at) {
|
|
398
|
-
return false; // No expiry = never expires
|
|
399
|
-
}
|
|
400
|
-
const expiresAt = new Date(attestation.expires_at).getTime();
|
|
401
|
-
const now = Date.now();
|
|
402
|
-
return expiresAt < now - clockSkew;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Check if an attribution attestation is not yet valid.
|
|
406
|
-
*
|
|
407
|
-
* @param attestation - The attestation to check
|
|
408
|
-
* @param clockSkew - Optional clock skew tolerance in milliseconds (default: 30000)
|
|
409
|
-
* @returns True if the attestation is not yet valid (issued_at in the future)
|
|
410
|
-
*/
|
|
411
|
-
function isAttributionNotYetValid(attestation, clockSkew = 30000) {
|
|
412
|
-
const issuedAt = new Date(attestation.issued_at).getTime();
|
|
413
|
-
const now = Date.now();
|
|
414
|
-
return issuedAt > now + clockSkew;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Compute total weight of sources (for validation).
|
|
418
|
-
*
|
|
419
|
-
* @param sources - Array of attribution sources
|
|
420
|
-
* @returns Total weight, or undefined if no weights specified
|
|
421
|
-
*/
|
|
422
|
-
function computeTotalWeight(sources) {
|
|
423
|
-
const weights = sources.filter((s) => s.weight !== undefined).map((s) => s.weight);
|
|
424
|
-
if (weights.length === 0) {
|
|
425
|
-
return undefined;
|
|
426
|
-
}
|
|
427
|
-
return weights.reduce((sum, w) => sum + w, 0);
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Detect cycles in attribution sources (for chain validation).
|
|
431
|
-
*
|
|
432
|
-
* @param sources - Array of attribution sources
|
|
433
|
-
* @param visited - Set of visited receipt refs (for recursion)
|
|
434
|
-
* @returns Receipt ref that caused cycle, or undefined if no cycle
|
|
435
|
-
*/
|
|
436
|
-
function detectCycleInSources(sources, visited = new Set()) {
|
|
437
|
-
for (const source of sources) {
|
|
438
|
-
if (visited.has(source.receipt_ref)) {
|
|
439
|
-
return source.receipt_ref;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
return undefined;
|
|
443
|
-
}
|
|
444
|
-
//# sourceMappingURL=attribution.js.map
|
package/dist/attribution.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attribution.js","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":";;;AAqVA,kDAQC;AAQD,8DAQC;AAkBD,wEAQC;AAQD,4DAIC;AA8CD,oEAuCC;AASD,oDAUC;AASD,4DAOC;AAQD,gDAMC;AASD,oDAUC;AA5iBD;;;;;;;GAOG;AACH,6BAAwB;A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,QAAQ,GAAG,GAAG,GAAG,SAAS,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,OAA4B;IAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAgB,CAAC,CAAC;IAC7F,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAClC,OAA4B,EAC5B,UAAuB,IAAI,GAAG,EAAE;IAEhC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,OAAO,MAAM,CAAC,WAAW,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/constants.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Wire format constants - FROZEN
|
|
4
|
-
*
|
|
5
|
-
* These constants are now sourced from @peac/kernel
|
|
6
|
-
* (normative source: specs/kernel/constants.json)
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PEAC_RECEIPT_SCHEMA_URL = exports.PEAC_DISCOVERY_MAX_BYTES = exports.PEAC_DISCOVERY_PATH = exports.PEAC_ISSUER_CONFIG_MAX_BYTES = exports.PEAC_ISSUER_CONFIG_VERSION = exports.PEAC_ISSUER_CONFIG_PATH = exports.PEAC_POLICY_MAX_BYTES = exports.PEAC_POLICY_FALLBACK_PATH = exports.PEAC_POLICY_PATH = exports.PEAC_PURPOSE_REASON_HEADER = exports.PEAC_PURPOSE_APPLIED_HEADER = exports.PEAC_PURPOSE_HEADER = exports.PEAC_RECEIPT_HEADER = exports.PEAC_ALG = exports.PEAC_WIRE_TYP = void 0;
|
|
10
|
-
const kernel_1 = require("@peac/kernel");
|
|
11
|
-
/**
|
|
12
|
-
* Wire format version - peac-receipt/0.1
|
|
13
|
-
* Normalized in v0.10.0 to peac-<artifact>/<major>.<minor> pattern
|
|
14
|
-
*/
|
|
15
|
-
exports.PEAC_WIRE_TYP = kernel_1.WIRE_TYPE;
|
|
16
|
-
/**
|
|
17
|
-
* Signature algorithm - FROZEN forever
|
|
18
|
-
*/
|
|
19
|
-
exports.PEAC_ALG = kernel_1.ALGORITHMS.default;
|
|
20
|
-
/**
|
|
21
|
-
* Canonical header name
|
|
22
|
-
*/
|
|
23
|
-
exports.PEAC_RECEIPT_HEADER = kernel_1.HEADERS.receipt;
|
|
24
|
-
/**
|
|
25
|
-
* Purpose header names (v0.9.24+)
|
|
26
|
-
*/
|
|
27
|
-
exports.PEAC_PURPOSE_HEADER = kernel_1.HEADERS.purpose;
|
|
28
|
-
exports.PEAC_PURPOSE_APPLIED_HEADER = kernel_1.HEADERS.purposeApplied;
|
|
29
|
-
exports.PEAC_PURPOSE_REASON_HEADER = kernel_1.HEADERS.purposeReason;
|
|
30
|
-
/**
|
|
31
|
-
* Policy manifest path (/.well-known/peac.txt)
|
|
32
|
-
* @see docs/specs/PEAC-TXT.md
|
|
33
|
-
*/
|
|
34
|
-
exports.PEAC_POLICY_PATH = kernel_1.POLICY.manifestPath;
|
|
35
|
-
/**
|
|
36
|
-
* Policy manifest fallback path (/peac.txt)
|
|
37
|
-
*/
|
|
38
|
-
exports.PEAC_POLICY_FALLBACK_PATH = kernel_1.POLICY.fallbackPath;
|
|
39
|
-
/**
|
|
40
|
-
* Maximum policy manifest size
|
|
41
|
-
*/
|
|
42
|
-
exports.PEAC_POLICY_MAX_BYTES = kernel_1.POLICY.maxBytes;
|
|
43
|
-
/**
|
|
44
|
-
* Issuer configuration path (/.well-known/peac-issuer.json)
|
|
45
|
-
* @see docs/specs/PEAC-ISSUER.md
|
|
46
|
-
*/
|
|
47
|
-
exports.PEAC_ISSUER_CONFIG_PATH = kernel_1.ISSUER_CONFIG.configPath;
|
|
48
|
-
/**
|
|
49
|
-
* Issuer configuration version
|
|
50
|
-
*/
|
|
51
|
-
exports.PEAC_ISSUER_CONFIG_VERSION = kernel_1.ISSUER_CONFIG.configVersion;
|
|
52
|
-
/**
|
|
53
|
-
* Maximum issuer configuration size
|
|
54
|
-
*/
|
|
55
|
-
exports.PEAC_ISSUER_CONFIG_MAX_BYTES = kernel_1.ISSUER_CONFIG.maxBytes;
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Use PEAC_POLICY_PATH instead. Will be removed in v1.0.
|
|
58
|
-
*/
|
|
59
|
-
exports.PEAC_DISCOVERY_PATH = kernel_1.DISCOVERY.manifestPath;
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Use PEAC_POLICY_MAX_BYTES instead. Will be removed in v1.0.
|
|
62
|
-
*/
|
|
63
|
-
exports.PEAC_DISCOVERY_MAX_BYTES = 2000;
|
|
64
|
-
/**
|
|
65
|
-
* JSON Schema URL for PEAC receipt wire format v0.1
|
|
66
|
-
*
|
|
67
|
-
* This is the canonical $id for the root schema.
|
|
68
|
-
* Use for schema references and cross-implementation validation.
|
|
69
|
-
*
|
|
70
|
-
* @since v0.10.0
|
|
71
|
-
*/
|
|
72
|
-
exports.PEAC_RECEIPT_SCHEMA_URL = 'https://www.peacprotocol.org/schemas/wire/0.1/peac-receipt.0.1.schema.json';
|
|
73
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yCAAgG;AAEhG;;;GAGG;AACU,QAAA,aAAa,GAAG,kBAAS,CAAC;AAEvC;;GAEG;AACU,QAAA,QAAQ,GAAG,mBAAU,CAAC,OAAO,CAAC;AAE3C;;GAEG;AACU,QAAA,mBAAmB,GAAG,gBAAO,CAAC,OAAO,CAAC;AAEnD;;GAEG;AACU,QAAA,mBAAmB,GAAG,gBAAO,CAAC,OAAO,CAAC;AACtC,QAAA,2BAA2B,GAAG,gBAAO,CAAC,cAAc,CAAC;AACrD,QAAA,0BAA0B,GAAG,gBAAO,CAAC,aAAa,CAAC;AAEhE;;;GAGG;AACU,QAAA,gBAAgB,GAAG,eAAM,CAAC,YAAY,CAAC;AAEpD;;GAEG;AACU,QAAA,yBAAyB,GAAG,eAAM,CAAC,YAAY,CAAC;AAE7D;;GAEG;AACU,QAAA,qBAAqB,GAAG,eAAM,CAAC,QAAQ,CAAC;AAErD;;;GAGG;AACU,QAAA,uBAAuB,GAAG,sBAAa,CAAC,UAAU,CAAC;AAEhE;;GAEG;AACU,QAAA,0BAA0B,GAAG,sBAAa,CAAC,aAAa,CAAC;AAEtE;;GAEG;AACU,QAAA,4BAA4B,GAAG,sBAAa,CAAC,QAAQ,CAAC;AAEnE;;GAEG;AACU,QAAA,mBAAmB,GAAG,kBAAS,CAAC,YAAY,CAAC;AAE1D;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAa,CAAC;AAEtD;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAClC,4EAAqF,CAAC"}
|
package/dist/control.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* PEAC Control Abstraction Layer (CAL) Types
|
|
4
|
-
*
|
|
5
|
-
* Composable governance for multi-party authorization.
|
|
6
|
-
* Supports TAP, AP2, and custom control engines.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
//# sourceMappingURL=control.js.map
|
package/dist/control.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control.js","sourceRoot":"","sources":["../src/control.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|