@peac/adapter-runtime-governance 0.12.9

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/index.cjs ADDED
@@ -0,0 +1,517 @@
1
+ 'use strict';
2
+
3
+ var protocol = require('@peac/protocol');
4
+ var crypto = require('@peac/crypto');
5
+
6
+ // src/constants.ts
7
+ var EXTENSION_NAMESPACE = "org.peacprotocol/runtime-governance";
8
+ var TYPE_PREFIX = "org.peacprotocol/runtime-governance-";
9
+ var EVENT_TYPES = {
10
+ POLICY_DECISION: `${TYPE_PREFIX}policy-decision`,
11
+ AUDIT_ENTRY: `${TYPE_PREFIX}audit-entry`,
12
+ AUTHORITY_SCOPE: `${TYPE_PREFIX}authority-scope`,
13
+ LIFECYCLE_EVENT: `${TYPE_PREFIX}lifecycle-event`,
14
+ TRUST_OBSERVATION: `${TYPE_PREFIX}trust-observation`,
15
+ COMPLIANCE_OBSERVATION: `${TYPE_PREFIX}compliance-observation`
16
+ };
17
+ var FIELD_LIMITS = {
18
+ /** Identifiers: provider, agent_id, session_id, entry_id, etc. */
19
+ maxIdentifier: 256,
20
+ /** General string fields: action, matched_rule, policy_name, etc. */
21
+ maxString: 1024,
22
+ /** Digest strings: previous_hash, entry_hash, etc. */
23
+ maxDigest: 512,
24
+ /** URI fields: source_artifact_ref, etc. */
25
+ maxUri: 2048,
26
+ /** Timestamp fields: source_timestamp, etc. */
27
+ maxTimestamp: 64,
28
+ /** CloudEvents type URIs. */
29
+ maxCloudEventType: 256,
30
+ /** Array fields: effective_scope, matched_invariants. */
31
+ maxArrayLength: 64,
32
+ /** Array entry string length. */
33
+ maxArrayEntry: 256,
34
+ /** Framework token length. */
35
+ maxFramework: 128
36
+ };
37
+
38
+ // src/types.ts
39
+ var RUNTIME_GOVERNANCE_FAMILIES = [
40
+ "policy_decision",
41
+ "audit_entry",
42
+ "authority_scope",
43
+ "lifecycle_event",
44
+ "trust_observation",
45
+ "compliance_observation"
46
+ ];
47
+
48
+ // src/families.ts
49
+ var FAMILY_REGISTRY = {
50
+ policy_decision: { type: EVENT_TYPES.POLICY_DECISION, kind: "evidence" },
51
+ audit_entry: { type: EVENT_TYPES.AUDIT_ENTRY, kind: "evidence" },
52
+ authority_scope: { type: EVENT_TYPES.AUTHORITY_SCOPE, kind: "evidence" },
53
+ lifecycle_event: { type: EVENT_TYPES.LIFECYCLE_EVENT, kind: "evidence" },
54
+ trust_observation: { type: EVENT_TYPES.TRUST_OBSERVATION, kind: "evidence" },
55
+ compliance_observation: { type: EVENT_TYPES.COMPLIANCE_OBSERVATION, kind: "evidence" }
56
+ };
57
+
58
+ // src/normalize.ts
59
+ var NormalizationError = class extends Error {
60
+ constructor(message, field) {
61
+ super(message);
62
+ this.field = field;
63
+ this.name = "NormalizationError";
64
+ }
65
+ };
66
+ function requireString(value, field, maxLen) {
67
+ if (typeof value !== "string") {
68
+ throw new NormalizationError(`${field} must be a string`, field);
69
+ }
70
+ if (value.length === 0) {
71
+ throw new NormalizationError(`${field} must not be empty`, field);
72
+ }
73
+ if (value.length > maxLen) {
74
+ throw new NormalizationError(`${field} exceeds max length ${maxLen}`, field);
75
+ }
76
+ return value;
77
+ }
78
+ function optionalString(value, field, maxLen) {
79
+ if (value === void 0 || value === null) return void 0;
80
+ return requireString(value, field, maxLen);
81
+ }
82
+ function optionalFiniteNumber(value, field, min, max) {
83
+ if (value === void 0 || value === null) return void 0;
84
+ if (typeof value !== "number" || !Number.isFinite(value)) {
85
+ throw new NormalizationError(`${field} must be a finite number`, field);
86
+ }
87
+ if (min !== void 0 && value < min) {
88
+ throw new NormalizationError(`${field} must be >= ${min}`, field);
89
+ }
90
+ if (max !== void 0 && value > max) {
91
+ throw new NormalizationError(`${field} must be <= ${max}`, field);
92
+ }
93
+ return value;
94
+ }
95
+ function optionalInteger(value, field, min, max) {
96
+ const n = optionalFiniteNumber(value, field, min, max);
97
+ if (n !== void 0 && !Number.isInteger(n)) {
98
+ throw new NormalizationError(`${field} must be an integer`, field);
99
+ }
100
+ return n;
101
+ }
102
+ function optionalBoolean(value, field) {
103
+ if (value === void 0 || value === null) return void 0;
104
+ if (typeof value !== "boolean") {
105
+ throw new NormalizationError(`${field} must be a boolean`, field);
106
+ }
107
+ return value;
108
+ }
109
+ var RFC3339_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
110
+ function optionalRfc3339(value, field, maxLen) {
111
+ const s = optionalString(value, field, maxLen);
112
+ if (s !== void 0 && !RFC3339_PATTERN.test(s)) {
113
+ throw new NormalizationError(`${field} must be RFC 3339 format`, field);
114
+ }
115
+ return s;
116
+ }
117
+ var DIGEST_PATTERN = /^[a-zA-Z0-9_-]+:[a-fA-F0-9]+$/;
118
+ function optionalDigest(value, field, maxLen) {
119
+ const s = optionalString(value, field, maxLen);
120
+ if (s !== void 0 && !DIGEST_PATTERN.test(s)) {
121
+ throw new NormalizationError(`${field} must match digest pattern (algorithm:hex)`, field);
122
+ }
123
+ return s;
124
+ }
125
+ var URI_PATTERN = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;
126
+ function optionalUri(value, field, maxLen) {
127
+ const s = optionalString(value, field, maxLen);
128
+ if (s !== void 0 && !URI_PATTERN.test(s)) {
129
+ throw new NormalizationError(`${field} must be a valid URI`, field);
130
+ }
131
+ return s;
132
+ }
133
+ function optionalStringArray(value, field, maxLen, maxEntryLen) {
134
+ if (value === void 0 || value === null) return void 0;
135
+ if (!Array.isArray(value)) {
136
+ throw new NormalizationError(`${field} must be an array`, field);
137
+ }
138
+ if (value.length > maxLen) {
139
+ throw new NormalizationError(`${field} exceeds max length ${maxLen}`, field);
140
+ }
141
+ return value.map((entry, i) => requireString(entry, `${field}[${i}]`, maxEntryLen));
142
+ }
143
+ function normalizePolicyDecision(input) {
144
+ return {
145
+ family: "policy_decision",
146
+ action: requireString(input.action, "action", FIELD_LIMITS.maxString),
147
+ matched_rule: optionalString(input.matched_rule, "matched_rule", FIELD_LIMITS.maxString),
148
+ policy_name: optionalString(input.policy_name, "policy_name", FIELD_LIMITS.maxString),
149
+ reason: optionalString(input.reason, "reason", FIELD_LIMITS.maxString),
150
+ evaluation_ms: optionalFiniteNumber(input.evaluation_ms, "evaluation_ms", 0)
151
+ };
152
+ }
153
+ function normalizeAuditEntry(input) {
154
+ return {
155
+ family: "audit_entry",
156
+ entry_id: optionalString(input.entry_id, "entry_id", FIELD_LIMITS.maxIdentifier),
157
+ event_type: optionalString(input.event_type, "event_type", FIELD_LIMITS.maxString),
158
+ outcome: optionalString(input.outcome, "outcome", FIELD_LIMITS.maxString),
159
+ previous_hash: optionalDigest(input.previous_hash, "previous_hash", FIELD_LIMITS.maxDigest),
160
+ entry_hash: optionalDigest(input.entry_hash, "entry_hash", FIELD_LIMITS.maxDigest),
161
+ trace_id: optionalString(input.trace_id, "trace_id", FIELD_LIMITS.maxIdentifier)
162
+ };
163
+ }
164
+ function normalizeAuthorityScope(input) {
165
+ return {
166
+ family: "authority_scope",
167
+ decision: optionalString(input.decision, "decision", FIELD_LIMITS.maxString),
168
+ effective_scope: optionalStringArray(
169
+ input.effective_scope,
170
+ "effective_scope",
171
+ FIELD_LIMITS.maxArrayLength,
172
+ FIELD_LIMITS.maxArrayEntry
173
+ ),
174
+ trust_tier: optionalString(input.trust_tier, "trust_tier", FIELD_LIMITS.maxString),
175
+ matched_invariants: optionalStringArray(
176
+ input.matched_invariants,
177
+ "matched_invariants",
178
+ FIELD_LIMITS.maxArrayLength,
179
+ FIELD_LIMITS.maxArrayEntry
180
+ )
181
+ };
182
+ }
183
+ function normalizeLifecycleEvent(input) {
184
+ return {
185
+ family: "lifecycle_event",
186
+ lifecycle_event_type: optionalString(
187
+ input.lifecycle_event_type,
188
+ "lifecycle_event_type",
189
+ FIELD_LIMITS.maxString
190
+ ),
191
+ previous_state: optionalString(input.previous_state, "previous_state", FIELD_LIMITS.maxString),
192
+ new_state: optionalString(input.new_state, "new_state", FIELD_LIMITS.maxString),
193
+ actor: optionalString(input.actor, "actor", FIELD_LIMITS.maxIdentifier)
194
+ };
195
+ }
196
+ function normalizeTrustObservation(input) {
197
+ return {
198
+ family: "trust_observation",
199
+ peer_id: optionalString(input.peer_id, "peer_id", FIELD_LIMITS.maxIdentifier),
200
+ action: optionalString(input.action, "action", FIELD_LIMITS.maxString),
201
+ success: optionalBoolean(input.success, "success"),
202
+ trust_delta: optionalInteger(input.trust_delta, "trust_delta", -1e3, 1e3),
203
+ trust_score: optionalInteger(input.trust_score, "trust_score", 0, 1e3)
204
+ };
205
+ }
206
+ function normalizeComplianceObservation(input) {
207
+ return {
208
+ family: "compliance_observation",
209
+ framework: optionalString(input.framework, "framework", FIELD_LIMITS.maxFramework),
210
+ compliance_score: optionalFiniteNumber(input.compliance_score, "compliance_score", 0, 100),
211
+ violation_count: optionalInteger(input.violation_count, "violation_count", 0),
212
+ evidence_item_count: optionalInteger(input.evidence_item_count, "evidence_item_count", 0)
213
+ };
214
+ }
215
+ var FAMILY_NORMALIZERS = {
216
+ policy_decision: normalizePolicyDecision,
217
+ audit_entry: normalizeAuditEntry,
218
+ authority_scope: normalizeAuthorityScope,
219
+ lifecycle_event: normalizeLifecycleEvent,
220
+ trust_observation: normalizeTrustObservation,
221
+ compliance_observation: normalizeComplianceObservation
222
+ };
223
+ function normalizeUpstream(input) {
224
+ if (input === void 0 || input === null) return void 0;
225
+ if (typeof input !== "object" || Array.isArray(input)) {
226
+ throw new NormalizationError("upstream must be a plain object", "upstream");
227
+ }
228
+ const obj = input;
229
+ return {
230
+ source_system: optionalString(
231
+ obj.source_system,
232
+ "upstream.source_system",
233
+ FIELD_LIMITS.maxIdentifier
234
+ ),
235
+ source_event_type: optionalString(
236
+ obj.source_event_type,
237
+ "upstream.source_event_type",
238
+ FIELD_LIMITS.maxIdentifier
239
+ ),
240
+ source_event_id: optionalString(
241
+ obj.source_event_id,
242
+ "upstream.source_event_id",
243
+ FIELD_LIMITS.maxIdentifier
244
+ ),
245
+ source_timestamp: optionalRfc3339(
246
+ obj.source_timestamp,
247
+ "upstream.source_timestamp",
248
+ FIELD_LIMITS.maxTimestamp
249
+ ),
250
+ source_artifact_hash: optionalDigest(
251
+ obj.source_artifact_hash,
252
+ "upstream.source_artifact_hash",
253
+ FIELD_LIMITS.maxDigest
254
+ ),
255
+ source_artifact_ref: optionalUri(
256
+ obj.source_artifact_ref,
257
+ "upstream.source_artifact_ref",
258
+ FIELD_LIMITS.maxUri
259
+ ),
260
+ source_cloud_event_type: optionalString(
261
+ obj.source_cloud_event_type,
262
+ "upstream.source_cloud_event_type",
263
+ FIELD_LIMITS.maxCloudEventType
264
+ )
265
+ };
266
+ }
267
+ function normalizeRuntimeGovernanceEvent(input) {
268
+ if (typeof input !== "object" || input === null || Array.isArray(input)) {
269
+ throw new NormalizationError("input must be a plain object", "input");
270
+ }
271
+ const obj = input;
272
+ const eventName = requireString(obj.event_name, "event_name", FIELD_LIMITS.maxString);
273
+ if (typeof obj.payload !== "object" || obj.payload === null || Array.isArray(obj.payload)) {
274
+ throw new NormalizationError("payload must be a plain object", "payload");
275
+ }
276
+ const payloadObj = obj.payload;
277
+ const family = payloadObj.family;
278
+ if (typeof family !== "string" || !RUNTIME_GOVERNANCE_FAMILIES.includes(family)) {
279
+ throw new NormalizationError(
280
+ `payload.family must be one of: ${RUNTIME_GOVERNANCE_FAMILIES.join(", ")}`,
281
+ "payload.family"
282
+ );
283
+ }
284
+ const normalizer = FAMILY_NORMALIZERS[family];
285
+ const payload = normalizer(payloadObj);
286
+ return {
287
+ event_name: eventName,
288
+ payload,
289
+ upstream: normalizeUpstream(obj.upstream)
290
+ };
291
+ }
292
+
293
+ // src/builders.ts
294
+ function stripUndefined(obj) {
295
+ const result = {};
296
+ for (const [key, value] of Object.entries(obj)) {
297
+ if (value !== void 0) {
298
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
299
+ const nested = stripUndefined(value);
300
+ if (Object.keys(nested).length > 0) {
301
+ result[key] = nested;
302
+ }
303
+ } else {
304
+ result[key] = value;
305
+ }
306
+ }
307
+ }
308
+ return result;
309
+ }
310
+ function buildPolicyDecisionExtension(payload, common, upstream) {
311
+ return stripUndefined({
312
+ ...common,
313
+ action: payload.action,
314
+ matched_rule: payload.matched_rule,
315
+ policy_name: payload.policy_name,
316
+ reason: payload.reason,
317
+ evaluation_ms: payload.evaluation_ms,
318
+ upstream
319
+ });
320
+ }
321
+ function buildAuditEntryExtension(payload, common, upstream) {
322
+ return stripUndefined({
323
+ ...common,
324
+ entry_id: payload.entry_id,
325
+ event_type: payload.event_type,
326
+ outcome: payload.outcome,
327
+ previous_hash: payload.previous_hash,
328
+ entry_hash: payload.entry_hash,
329
+ trace_id: payload.trace_id,
330
+ upstream
331
+ });
332
+ }
333
+ function buildAuthorityScopeExtension(payload, common, upstream) {
334
+ return stripUndefined({
335
+ ...common,
336
+ decision: payload.decision,
337
+ effective_scope: payload.effective_scope,
338
+ trust_tier: payload.trust_tier,
339
+ matched_invariants: payload.matched_invariants,
340
+ upstream
341
+ });
342
+ }
343
+ function buildLifecycleEventExtension(payload, common, upstream) {
344
+ return stripUndefined({
345
+ ...common,
346
+ lifecycle_event_type: payload.lifecycle_event_type,
347
+ previous_state: payload.previous_state,
348
+ new_state: payload.new_state,
349
+ actor: payload.actor,
350
+ upstream
351
+ });
352
+ }
353
+ function buildTrustObservationExtension(payload, common, upstream) {
354
+ return stripUndefined({
355
+ ...common,
356
+ peer_id: payload.peer_id,
357
+ action: payload.action,
358
+ success: payload.success,
359
+ trust_delta: payload.trust_delta,
360
+ trust_score: payload.trust_score,
361
+ upstream
362
+ });
363
+ }
364
+ function buildComplianceObservationExtension(payload, common, upstream) {
365
+ return stripUndefined({
366
+ ...common,
367
+ framework: payload.framework,
368
+ compliance_score: payload.compliance_score,
369
+ violation_count: payload.violation_count,
370
+ evidence_item_count: payload.evidence_item_count,
371
+ upstream
372
+ });
373
+ }
374
+ var FAMILY_BUILDERS = {
375
+ policy_decision: (p, c, u) => buildPolicyDecisionExtension(p, c, u),
376
+ audit_entry: (p, c, u) => buildAuditEntryExtension(p, c, u),
377
+ authority_scope: (p, c, u) => buildAuthorityScopeExtension(p, c, u),
378
+ lifecycle_event: (p, c, u) => buildLifecycleEventExtension(p, c, u),
379
+ trust_observation: (p, c, u) => buildTrustObservationExtension(p, c, u),
380
+ compliance_observation: (p, c, u) => buildComplianceObservationExtension(p, c, u)
381
+ };
382
+
383
+ // src/issue.ts
384
+ function validateIssueOptions(options) {
385
+ if (!(options.privateKey instanceof Uint8Array) || options.privateKey.length !== 32) {
386
+ throw new Error("privateKey must be a 32-byte Uint8Array");
387
+ }
388
+ if (typeof options.kid !== "string" || options.kid.length === 0 || options.kid.length > 256) {
389
+ throw new Error("kid must be a non-empty string (max 256 chars)");
390
+ }
391
+ if (typeof options.issuer !== "string" || options.issuer.length === 0) {
392
+ throw new Error("issuer must be a non-empty string");
393
+ }
394
+ if (typeof options.sessionId !== "string" || options.sessionId.length === 0 || options.sessionId.length > 256) {
395
+ throw new Error("sessionId must be a non-empty string (max 256 chars)");
396
+ }
397
+ if (typeof options.agentId !== "string" || options.agentId.length === 0 || options.agentId.length > 256) {
398
+ throw new Error("agentId must be a non-empty string (max 256 chars)");
399
+ }
400
+ if (typeof options.provider !== "string" || options.provider.length === 0 || options.provider.length > 256) {
401
+ throw new Error("provider must be a non-empty string (max 256 chars)");
402
+ }
403
+ }
404
+ async function issueRuntimeGovernanceRecord(event, options) {
405
+ validateIssueOptions(options);
406
+ const entry = FAMILY_REGISTRY[event.payload.family];
407
+ const { privateKey, kid, issuer, sessionId, agentId, provider } = options;
408
+ const common = {
409
+ session_id: sessionId,
410
+ event: event.event_name,
411
+ agent_id: agentId,
412
+ provider
413
+ };
414
+ const extensionData = FAMILY_BUILDERS[event.payload.family](
415
+ event.payload,
416
+ common,
417
+ event.upstream
418
+ );
419
+ const { jws } = await protocol.issue({
420
+ iss: issuer,
421
+ kind: entry.kind,
422
+ type: entry.type,
423
+ privateKey,
424
+ kid,
425
+ extensions: { [EXTENSION_NAMESPACE]: extensionData }
426
+ });
427
+ return { jws, type: entry.type, family: event.payload.family };
428
+ }
429
+ var KNOWN_SUFFIXES = new Set(RUNTIME_GOVERNANCE_FAMILIES.map((f) => f.replace(/_/g, "-")));
430
+ function buildSessionSummary(receipts) {
431
+ if (receipts.length === 0) {
432
+ return { sessionId: "", receipts: 0, families: [], unknownTypeCount: 0, issuer: "" };
433
+ }
434
+ let sessionId = "";
435
+ let issuer = "";
436
+ let unknownTypeCount = 0;
437
+ const familySet = /* @__PURE__ */ new Set();
438
+ for (const jws of receipts) {
439
+ const decoded = crypto.decode(jws);
440
+ const claims = decoded.payload;
441
+ if (!issuer && typeof claims.iss === "string") {
442
+ issuer = claims.iss;
443
+ }
444
+ const extensions = claims.extensions;
445
+ const govExt = extensions?.[EXTENSION_NAMESPACE];
446
+ if (govExt) {
447
+ if (!sessionId && typeof govExt.session_id === "string") {
448
+ sessionId = govExt.session_id;
449
+ }
450
+ }
451
+ const type = claims.type;
452
+ if (type?.startsWith(TYPE_PREFIX)) {
453
+ const suffix = type.slice(TYPE_PREFIX.length);
454
+ if (KNOWN_SUFFIXES.has(suffix)) {
455
+ familySet.add(suffix.replace(/-/g, "_"));
456
+ } else {
457
+ unknownTypeCount++;
458
+ }
459
+ } else if (type) {
460
+ unknownTypeCount++;
461
+ }
462
+ }
463
+ return {
464
+ sessionId,
465
+ receipts: receipts.length,
466
+ families: [...familySet].sort(),
467
+ unknownTypeCount,
468
+ issuer
469
+ };
470
+ }
471
+
472
+ // src/mappers/agt.ts
473
+ var AGT_FAMILY_MAP = {
474
+ policy_decision: "policy_decision",
475
+ audit_entry: "audit_entry",
476
+ authority_scope: "authority_scope",
477
+ lifecycle_event: "lifecycle_event",
478
+ trust_observation: "trust_observation",
479
+ compliance_observation: "compliance_observation"
480
+ };
481
+ function mapAgtEvent(input) {
482
+ const family = AGT_FAMILY_MAP[input.family];
483
+ if (!family) {
484
+ throw new NormalizationError(`unrecognized AGT family: ${input.family}`, "family");
485
+ }
486
+ const raw = {
487
+ event_name: input.event,
488
+ payload: {
489
+ family,
490
+ ...input.data
491
+ },
492
+ upstream: input.source ? {
493
+ source_system: input.source.system,
494
+ source_event_type: input.source.event_type,
495
+ source_event_id: input.source.event_id,
496
+ source_timestamp: input.source.timestamp,
497
+ source_artifact_hash: input.source.artifact_hash,
498
+ source_artifact_ref: input.source.artifact_ref,
499
+ source_cloud_event_type: input.source.cloud_event_type
500
+ } : void 0
501
+ };
502
+ return normalizeRuntimeGovernanceEvent(raw);
503
+ }
504
+
505
+ exports.EVENT_TYPES = EVENT_TYPES;
506
+ exports.EXTENSION_NAMESPACE = EXTENSION_NAMESPACE;
507
+ exports.FAMILY_REGISTRY = FAMILY_REGISTRY;
508
+ exports.FIELD_LIMITS = FIELD_LIMITS;
509
+ exports.NormalizationError = NormalizationError;
510
+ exports.RUNTIME_GOVERNANCE_FAMILIES = RUNTIME_GOVERNANCE_FAMILIES;
511
+ exports.TYPE_PREFIX = TYPE_PREFIX;
512
+ exports.buildSessionSummary = buildSessionSummary;
513
+ exports.issueRuntimeGovernanceRecord = issueRuntimeGovernanceRecord;
514
+ exports.mapAgtEvent = mapAgtEvent;
515
+ exports.normalizeRuntimeGovernanceEvent = normalizeRuntimeGovernanceEvent;
516
+ //# sourceMappingURL=index.cjs.map
517
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts","../src/types.ts","../src/families.ts","../src/normalize.ts","../src/builders.ts","../src/issue.ts","../src/session-summary.ts","../src/mappers/agt.ts"],"names":["issue","decode"],"mappings":";;;;;;AASO,IAAM,mBAAA,GAAsB;AAG5B,IAAM,WAAA,GAAc;AAMpB,IAAM,WAAA,GAAc;AAAA,EACzB,eAAA,EAAiB,GAAG,WAAW,CAAA,eAAA,CAAA;AAAA,EAC/B,WAAA,EAAa,GAAG,WAAW,CAAA,WAAA,CAAA;AAAA,EAC3B,eAAA,EAAi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AAmB,CAAA,yBAAA,EAA4B,KAAA,CAAM,MAAM,IAAI,QAAQ,CAAA;AAAA,EACnF;AAEA,EAAA,MAAM,GAAA,GAAM;AAAA,IACV,YAAY,KAAA,CAAM,KAAA;AAAA,IAClB,OAAA,EAAS;AAAA,MACP,MAAA;AAAA,MACA,GAAG,KAAA,CAAM;AAAA,KACX;AAAA,IACA,QAAA,EAAU,MAAM,MAAA,GACZ;AAAA,MACE,aAAA,EAAe,MAAM,MAAA,CAAO,MAAA;AAAA,MAC5B,iBAAA,EAAmB,MAAM,MAAA,CAAO,UAAA;AAAA,MAChC,eAAA,EAAiB,MAAM,MAAA,CAAO,QAAA;AAAA,MAC9B,gBAAA,EAAkB,MAAM,MAAA,CAAO,SAAA;AAAA,MAC/B,oBAAA,EAAsB,MAAM,MAAA,CAAO,aAAA;AAAA,MACnC,mBAAA,EAAqB,MAAM,MAAA,CAAO,YAAA;AAAA,MAClC,uBAAA,EAAyB,MAAM,MAAA,CAAO;AAAA,KACxC,GACA;AAAA,GACN;AAEA,EAAA,OAAO,gCAAgC,GAAG,CAAA;AAC5C","file":"index.cjs","sourcesContent":["/**\n * @peac/adapter-runtime-governance constants\n *\n * Vendor-neutral type URIs and extension namespace for runtime\n * governance record families. Observation-specific suffixes prevent\n * semantic bleed into authoritative claims.\n */\n\n/** Extension namespace for runtime governance record metadata. */\nexport const EXTENSION_NAMESPACE = 'org.peacprotocol/runtime-governance' as const;\n\n/** Reverse-DNS type prefix for all runtime governance record families. */\nexport const TYPE_PREFIX = 'org.peacprotocol/runtime-governance-' as const;\n\n/**\n * Canonical type URIs for the 6 runtime governance record families.\n * Each suffix is observation-specific (e.g., \"policy-decision\" not \"policy\").\n */\nexport const EVENT_TYPES = {\n POLICY_DECISION: `${TYPE_PREFIX}policy-decision`,\n AUDIT_ENTRY: `${TYPE_PREFIX}audit-entry`,\n AUTHORITY_SCOPE: `${TYPE_PREFIX}authority-scope`,\n LIFECYCLE_EVENT: `${TYPE_PREFIX}lifecycle-event`,\n TRUST_OBSERVATION: `${TYPE_PREFIX}trust-observation`,\n COMPLIANCE_OBSERVATION: `${TYPE_PREFIX}compliance-observation`,\n} as const;\n\nexport type EventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];\n\n/** Maximum field lengths for validation. */\nexport const FIELD_LIMITS = {\n /** Identifiers: provider, agent_id, session_id, entry_id, etc. */\n maxIdentifier: 256,\n /** General string fields: action, matched_rule, policy_name, etc. */\n maxString: 1024,\n /** Digest strings: previous_hash, entry_hash, etc. */\n maxDigest: 512,\n /** URI fields: source_artifact_ref, etc. */\n maxUri: 2048,\n /** Timestamp fields: source_timestamp, etc. */\n maxTimestamp: 64,\n /** CloudEvents type URIs. */\n maxCloudEventType: 256,\n /** Array fields: effective_scope, matched_invariants. */\n maxArrayLength: 64,\n /** Array entry string length. */\n maxArrayEntry: 256,\n /** Framework token length. */\n maxFramework: 128,\n} as const;\n","/**\n * @peac/adapter-runtime-governance types\n *\n * Discriminated union payload model with per-family typing.\n * No weak Record<string, unknown> blobs.\n */\n\n/**\n * Runtime governance record families.\n * String-literal union (not enum) for lighter output and tree-shaking.\n */\nexport const RUNTIME_GOVERNANCE_FAMILIES = [\n 'policy_decision',\n 'audit_entry',\n 'authority_scope',\n 'lifecycle_event',\n 'trust_observation',\n 'compliance_observation',\n] as const;\n\nexport type RuntimeGovernanceFamily = (typeof RUNTIME_GOVERNANCE_FAMILIES)[number];\n\n/**\n * Preserved upstream artifact context.\n * All optional, all observational. Bounded fields, no arbitrary passthrough.\n */\nexport interface PreservedUpstreamArtifact {\n /** Upstream system identifier (max 256 chars). */\n source_system?: string;\n /** Upstream event type identifier (max 256 chars). */\n source_event_type?: string;\n /** Upstream event identifier for deduplication (max 256 chars). */\n source_event_id?: string;\n /** Upstream event timestamp (RFC 3339, max 64 chars). */\n source_timestamp?: string;\n /** Hash of upstream artifact (max 512 chars). */\n source_artifact_hash?: string;\n /** URI or reference to upstream artifact (max 2048 chars). */\n source_artifact_ref?: string;\n /** CloudEvents type URI for cross-system correlation (max 256 chars). */\n source_cloud_event_type?: string;\n}\n\n/** Policy decision payload. */\nexport interface PolicyDecisionPayload {\n family: 'policy_decision';\n action: string;\n matched_rule?: string;\n policy_name?: string;\n reason?: string;\n evaluation_ms?: number;\n}\n\n/** Audit entry payload. */\nexport interface AuditEntryPayload {\n family: 'audit_entry';\n entry_id?: string;\n event_type?: string;\n outcome?: string;\n previous_hash?: string;\n entry_hash?: string;\n trace_id?: string;\n}\n\n/** Authority scope payload. */\nexport interface AuthorityScopePayload {\n family: 'authority_scope';\n decision?: string;\n effective_scope?: string[];\n trust_tier?: string;\n matched_invariants?: string[];\n}\n\n/** Lifecycle event payload. */\nexport interface LifecycleEventPayload {\n family: 'lifecycle_event';\n lifecycle_event_type?: string;\n previous_state?: string;\n new_state?: string;\n actor?: string;\n}\n\n/** Trust observation payload. */\nexport interface TrustObservationPayload {\n family: 'trust_observation';\n peer_id?: string;\n action?: string;\n success?: boolean;\n trust_delta?: number;\n trust_score?: number;\n}\n\n/** Compliance observation payload. */\nexport interface ComplianceObservationPayload {\n family: 'compliance_observation';\n framework?: string;\n compliance_score?: number;\n violation_count?: number;\n evidence_item_count?: number;\n}\n\n/** Discriminated union of all family payloads. */\nexport type RuntimeGovernancePayload =\n | PolicyDecisionPayload\n | AuditEntryPayload\n | AuthorityScopePayload\n | LifecycleEventPayload\n | TrustObservationPayload\n | ComplianceObservationPayload;\n\n/**\n * Normalized runtime governance event.\n * Generic input to issueRuntimeGovernanceRecord().\n */\nexport interface RuntimeGovernanceEvent {\n /** Specific event name (e.g., 'policy.evaluated'). */\n event_name: string;\n /** Typed, validated payload (discriminated by family). */\n payload: RuntimeGovernancePayload;\n /** Optional preserved upstream artifact context. */\n upstream?: PreservedUpstreamArtifact;\n}\n\n/** Options for issuing a runtime governance record. */\nexport interface IssueOptions {\n /** Ed25519 private key (32 bytes). Caller-provided; never stored. */\n privateKey: Uint8Array;\n /** Key ID (max 256 chars). */\n kid: string;\n /** Canonical issuer URL (HTTPS or DID). */\n issuer: string;\n /** Session identifier for event correlation. */\n sessionId: string;\n /** Agent identifier. */\n agentId: string;\n /** Provider name. Caller-supplied; never hardcoded. */\n provider: string;\n}\n\n/** Result of issuing a runtime governance record. */\nexport interface IssueResult {\n /** Compact JWS (signed Interaction Record). */\n jws: string;\n /** PEAC event type URI used. */\n type: string;\n /** Record family. */\n family: RuntimeGovernanceFamily;\n}\n\n/** Session summary aggregated from decoded receipts. */\nexport interface SessionSummary {\n /** Session identifier. */\n sessionId: string;\n /** Total receipts in the session. */\n receipts: number;\n /** Distinct families represented (sorted alphabetically). */\n families: RuntimeGovernanceFamily[];\n /** Count of receipts with unrecognized type URIs. */\n unknownTypeCount: number;\n /** Issuer (from the first receipt, or empty if no receipts). */\n issuer: string;\n}\n","/**\n * Family registry.\n *\n * Maps each RuntimeGovernanceFamily to its canonical type URI\n * and Interaction Record kind. All families produce `evidence` kind.\n */\n\nimport { EVENT_TYPES, type EventType } from './constants.js';\nimport type { RuntimeGovernanceFamily } from './types.js';\n\nexport interface FamilyEntry {\n /** Canonical type URI for this family. */\n type: EventType;\n /** Interaction Record kind. Always 'evidence' for runtime governance. */\n kind: 'evidence';\n}\n\nexport const FAMILY_REGISTRY: Record<RuntimeGovernanceFamily, FamilyEntry> = {\n policy_decision: { type: EVENT_TYPES.POLICY_DECISION, kind: 'evidence' },\n audit_entry: { type: EVENT_TYPES.AUDIT_ENTRY, kind: 'evidence' },\n authority_scope: { type: EVENT_TYPES.AUTHORITY_SCOPE, kind: 'evidence' },\n lifecycle_event: { type: EVENT_TYPES.LIFECYCLE_EVENT, kind: 'evidence' },\n trust_observation: { type: EVENT_TYPES.TRUST_OBSERVATION, kind: 'evidence' },\n compliance_observation: { type: EVENT_TYPES.COMPLIANCE_OBSERVATION, kind: 'evidence' },\n};\n","/**\n * @peac/adapter-runtime-governance normalization and validation\n *\n * Fail-closed input validation for runtime governance payloads.\n * Rejects malformed input with descriptive errors.\n *\n * These are adapter-level shape prechecks: string presence, max lengths,\n * numeric bounds, RFC 3339 format, digest grammar (algorithm:hex), and\n * URI scheme presence. Protocol-layer validation (@peac/protocol issue()\n * and @peac/schema Wire02ClaimsSchema) remains authoritative for issuer\n * canonicality, JOSE hardening, and wire-format compliance. Adapter\n * validators catch obviously malformed input before it reaches the\n * protocol layer.\n *\n * PEAC validates the structure of carried values, not upstream truth.\n * Trust scores are structurally validated (finite, 0-1000 integer)\n * but never derived, recomputed, ranked, or authoritatively assessed.\n */\n\nimport { FIELD_LIMITS } from './constants.js';\nimport { RUNTIME_GOVERNANCE_FAMILIES } from './types.js';\nimport type {\n RuntimeGovernanceFamily,\n RuntimeGovernancePayload,\n PreservedUpstreamArtifact,\n RuntimeGovernanceEvent,\n} from './types.js';\n\nexport class NormalizationError extends Error {\n constructor(\n message: string,\n public readonly field: string\n ) {\n super(message);\n this.name = 'NormalizationError';\n }\n}\n\nfunction requireString(value: unknown, field: string, maxLen: number): string {\n if (typeof value !== 'string') {\n throw new NormalizationError(`${field} must be a string`, field);\n }\n if (value.length === 0) {\n throw new NormalizationError(`${field} must not be empty`, field);\n }\n if (value.length > maxLen) {\n throw new NormalizationError(`${field} exceeds max length ${maxLen}`, field);\n }\n return value;\n}\n\nfunction optionalString(value: unknown, field: string, maxLen: number): string | undefined {\n if (value === undefined || value === null) return undefined;\n return requireString(value, field, maxLen);\n}\n\nfunction optionalFiniteNumber(\n value: unknown,\n field: string,\n min?: number,\n max?: number\n): number | undefined {\n if (value === undefined || value === null) return undefined;\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n throw new NormalizationError(`${field} must be a finite number`, field);\n }\n if (min !== undefined && value < min) {\n throw new NormalizationError(`${field} must be >= ${min}`, field);\n }\n if (max !== undefined && value > max) {\n throw new NormalizationError(`${field} must be <= ${max}`, field);\n }\n return value;\n}\n\nfunction optionalInteger(\n value: unknown,\n field: string,\n min?: number,\n max?: number\n): number | undefined {\n const n = optionalFiniteNumber(value, field, min, max);\n if (n !== undefined && !Number.isInteger(n)) {\n throw new NormalizationError(`${field} must be an integer`, field);\n }\n return n;\n}\n\nfunction optionalBoolean(value: unknown, field: string): boolean | undefined {\n if (value === undefined || value === null) return undefined;\n if (typeof value !== 'boolean') {\n throw new NormalizationError(`${field} must be a boolean`, field);\n }\n return value;\n}\n\nconst RFC3339_PATTERN = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$/;\n\nfunction optionalRfc3339(value: unknown, field: string, maxLen: number): string | undefined {\n const s = optionalString(value, field, maxLen);\n if (s !== undefined && !RFC3339_PATTERN.test(s)) {\n throw new NormalizationError(`${field} must be RFC 3339 format`, field);\n }\n return s;\n}\n\nconst DIGEST_PATTERN = /^[a-zA-Z0-9_-]+:[a-fA-F0-9]+$/;\n\nfunction optionalDigest(value: unknown, field: string, maxLen: number): string | undefined {\n const s = optionalString(value, field, maxLen);\n if (s !== undefined && !DIGEST_PATTERN.test(s)) {\n throw new NormalizationError(`${field} must match digest pattern (algorithm:hex)`, field);\n }\n return s;\n}\n\nconst URI_PATTERN = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;\n\nfunction optionalUri(value: unknown, field: string, maxLen: number): string | undefined {\n const s = optionalString(value, field, maxLen);\n if (s !== undefined && !URI_PATTERN.test(s)) {\n throw new NormalizationError(`${field} must be a valid URI`, field);\n }\n return s;\n}\n\nfunction optionalStringArray(\n value: unknown,\n field: string,\n maxLen: number,\n maxEntryLen: number\n): string[] | undefined {\n if (value === undefined || value === null) return undefined;\n if (!Array.isArray(value)) {\n throw new NormalizationError(`${field} must be an array`, field);\n }\n if (value.length > maxLen) {\n throw new NormalizationError(`${field} exceeds max length ${maxLen}`, field);\n }\n return value.map((entry, i) => requireString(entry, `${field}[${i}]`, maxEntryLen));\n}\n\nfunction normalizePolicyDecision(input: Record<string, unknown>): RuntimeGovernancePayload {\n return {\n family: 'policy_decision',\n action: requireString(input.action, 'action', FIELD_LIMITS.maxString),\n matched_rule: optionalString(input.matched_rule, 'matched_rule', FIELD_LIMITS.maxString),\n policy_name: optionalString(input.policy_name, 'policy_name', FIELD_LIMITS.maxString),\n reason: optionalString(input.reason, 'reason', FIELD_LIMITS.maxString),\n evaluation_ms: optionalFiniteNumber(input.evaluation_ms, 'evaluation_ms', 0),\n };\n}\n\nfunction normalizeAuditEntry(input: Record<string, unknown>): RuntimeGovernancePayload {\n return {\n family: 'audit_entry',\n entry_id: optionalString(input.entry_id, 'entry_id', FIELD_LIMITS.maxIdentifier),\n event_type: optionalString(input.event_type, 'event_type', FIELD_LIMITS.maxString),\n outcome: optionalString(input.outcome, 'outcome', FIELD_LIMITS.maxString),\n previous_hash: optionalDigest(input.previous_hash, 'previous_hash', FIELD_LIMITS.maxDigest),\n entry_hash: optionalDigest(input.entry_hash, 'entry_hash', FIELD_LIMITS.maxDigest),\n trace_id: optionalString(input.trace_id, 'trace_id', FIELD_LIMITS.maxIdentifier),\n };\n}\n\nfunction normalizeAuthorityScope(input: Record<string, unknown>): RuntimeGovernancePayload {\n return {\n family: 'authority_scope',\n decision: optionalString(input.decision, 'decision', FIELD_LIMITS.maxString),\n effective_scope: optionalStringArray(\n input.effective_scope,\n 'effective_scope',\n FIELD_LIMITS.maxArrayLength,\n FIELD_LIMITS.maxArrayEntry\n ),\n trust_tier: optionalString(input.trust_tier, 'trust_tier', FIELD_LIMITS.maxString),\n matched_invariants: optionalStringArray(\n input.matched_invariants,\n 'matched_invariants',\n FIELD_LIMITS.maxArrayLength,\n FIELD_LIMITS.maxArrayEntry\n ),\n };\n}\n\nfunction normalizeLifecycleEvent(input: Record<string, unknown>): RuntimeGovernancePayload {\n return {\n family: 'lifecycle_event',\n lifecycle_event_type: optionalString(\n input.lifecycle_event_type,\n 'lifecycle_event_type',\n FIELD_LIMITS.maxString\n ),\n previous_state: optionalString(input.previous_state, 'previous_state', FIELD_LIMITS.maxString),\n new_state: optionalString(input.new_state, 'new_state', FIELD_LIMITS.maxString),\n actor: optionalString(input.actor, 'actor', FIELD_LIMITS.maxIdentifier),\n };\n}\n\nfunction normalizeTrustObservation(input: Record<string, unknown>): RuntimeGovernancePayload {\n return {\n family: 'trust_observation',\n peer_id: optionalString(input.peer_id, 'peer_id', FIELD_LIMITS.maxIdentifier),\n action: optionalString(input.action, 'action', FIELD_LIMITS.maxString),\n success: optionalBoolean(input.success, 'success'),\n trust_delta: optionalInteger(input.trust_delta, 'trust_delta', -1000, 1000),\n trust_score: optionalInteger(input.trust_score, 'trust_score', 0, 1000),\n };\n}\n\nfunction normalizeComplianceObservation(input: Record<string, unknown>): RuntimeGovernancePayload {\n return {\n family: 'compliance_observation',\n framework: optionalString(input.framework, 'framework', FIELD_LIMITS.maxFramework),\n compliance_score: optionalFiniteNumber(input.compliance_score, 'compliance_score', 0, 100),\n violation_count: optionalInteger(input.violation_count, 'violation_count', 0),\n evidence_item_count: optionalInteger(input.evidence_item_count, 'evidence_item_count', 0),\n };\n}\n\nconst FAMILY_NORMALIZERS: Record<\n RuntimeGovernanceFamily,\n (input: Record<string, unknown>) => RuntimeGovernancePayload\n> = {\n policy_decision: normalizePolicyDecision,\n audit_entry: normalizeAuditEntry,\n authority_scope: normalizeAuthorityScope,\n lifecycle_event: normalizeLifecycleEvent,\n trust_observation: normalizeTrustObservation,\n compliance_observation: normalizeComplianceObservation,\n};\n\nfunction normalizeUpstream(input: unknown): PreservedUpstreamArtifact | undefined {\n if (input === undefined || input === null) return undefined;\n if (typeof input !== 'object' || Array.isArray(input)) {\n throw new NormalizationError('upstream must be a plain object', 'upstream');\n }\n const obj = input as Record<string, unknown>;\n return {\n source_system: optionalString(\n obj.source_system,\n 'upstream.source_system',\n FIELD_LIMITS.maxIdentifier\n ),\n source_event_type: optionalString(\n obj.source_event_type,\n 'upstream.source_event_type',\n FIELD_LIMITS.maxIdentifier\n ),\n source_event_id: optionalString(\n obj.source_event_id,\n 'upstream.source_event_id',\n FIELD_LIMITS.maxIdentifier\n ),\n source_timestamp: optionalRfc3339(\n obj.source_timestamp,\n 'upstream.source_timestamp',\n FIELD_LIMITS.maxTimestamp\n ),\n source_artifact_hash: optionalDigest(\n obj.source_artifact_hash,\n 'upstream.source_artifact_hash',\n FIELD_LIMITS.maxDigest\n ),\n source_artifact_ref: optionalUri(\n obj.source_artifact_ref,\n 'upstream.source_artifact_ref',\n FIELD_LIMITS.maxUri\n ),\n source_cloud_event_type: optionalString(\n obj.source_cloud_event_type,\n 'upstream.source_cloud_event_type',\n FIELD_LIMITS.maxCloudEventType\n ),\n };\n}\n\n/**\n * Normalize and validate a raw runtime governance event input.\n * Fail-closed: rejects malformed input with descriptive errors.\n */\nexport function normalizeRuntimeGovernanceEvent(input: unknown): RuntimeGovernanceEvent {\n if (typeof input !== 'object' || input === null || Array.isArray(input)) {\n throw new NormalizationError('input must be a plain object', 'input');\n }\n const obj = input as Record<string, unknown>;\n\n const eventName = requireString(obj.event_name, 'event_name', FIELD_LIMITS.maxString);\n\n if (typeof obj.payload !== 'object' || obj.payload === null || Array.isArray(obj.payload)) {\n throw new NormalizationError('payload must be a plain object', 'payload');\n }\n const payloadObj = obj.payload as Record<string, unknown>;\n\n const family = payloadObj.family;\n if (\n typeof family !== 'string' ||\n !(RUNTIME_GOVERNANCE_FAMILIES as readonly string[]).includes(family)\n ) {\n throw new NormalizationError(\n `payload.family must be one of: ${RUNTIME_GOVERNANCE_FAMILIES.join(', ')}`,\n 'payload.family'\n );\n }\n\n const normalizer = FAMILY_NORMALIZERS[family as RuntimeGovernanceFamily];\n const payload = normalizer(payloadObj);\n\n return {\n event_name: eventName,\n payload,\n upstream: normalizeUpstream(obj.upstream),\n };\n}\n","/**\n * @peac/adapter-runtime-governance extension builders\n *\n * Explicit per-family extension data builders. Each builder selects\n * exactly which fields appear in the extension output. Unknown upstream\n * fields never become top-level extension keys.\n */\n\nimport type {\n RuntimeGovernancePayload,\n PolicyDecisionPayload,\n AuditEntryPayload,\n AuthorityScopePayload,\n LifecycleEventPayload,\n TrustObservationPayload,\n ComplianceObservationPayload,\n PreservedUpstreamArtifact,\n RuntimeGovernanceFamily,\n} from './types.js';\n\ninterface CommonFields {\n session_id: string;\n event: string;\n agent_id: string;\n provider: string;\n}\n\nfunction stripUndefined(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== undefined) {\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n const nested = stripUndefined(value as Record<string, unknown>);\n if (Object.keys(nested).length > 0) {\n result[key] = nested;\n }\n } else {\n result[key] = value;\n }\n }\n }\n return result;\n}\n\nfunction buildPolicyDecisionExtension(\n payload: PolicyDecisionPayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n): Record<string, unknown> {\n return stripUndefined({\n ...common,\n action: payload.action,\n matched_rule: payload.matched_rule,\n policy_name: payload.policy_name,\n reason: payload.reason,\n evaluation_ms: payload.evaluation_ms,\n upstream,\n });\n}\n\nfunction buildAuditEntryExtension(\n payload: AuditEntryPayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n): Record<string, unknown> {\n return stripUndefined({\n ...common,\n entry_id: payload.entry_id,\n event_type: payload.event_type,\n outcome: payload.outcome,\n previous_hash: payload.previous_hash,\n entry_hash: payload.entry_hash,\n trace_id: payload.trace_id,\n upstream,\n });\n}\n\nfunction buildAuthorityScopeExtension(\n payload: AuthorityScopePayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n): Record<string, unknown> {\n return stripUndefined({\n ...common,\n decision: payload.decision,\n effective_scope: payload.effective_scope,\n trust_tier: payload.trust_tier,\n matched_invariants: payload.matched_invariants,\n upstream,\n });\n}\n\nfunction buildLifecycleEventExtension(\n payload: LifecycleEventPayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n): Record<string, unknown> {\n return stripUndefined({\n ...common,\n lifecycle_event_type: payload.lifecycle_event_type,\n previous_state: payload.previous_state,\n new_state: payload.new_state,\n actor: payload.actor,\n upstream,\n });\n}\n\nfunction buildTrustObservationExtension(\n payload: TrustObservationPayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n): Record<string, unknown> {\n return stripUndefined({\n ...common,\n peer_id: payload.peer_id,\n action: payload.action,\n success: payload.success,\n trust_delta: payload.trust_delta,\n trust_score: payload.trust_score,\n upstream,\n });\n}\n\nfunction buildComplianceObservationExtension(\n payload: ComplianceObservationPayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n): Record<string, unknown> {\n return stripUndefined({\n ...common,\n framework: payload.framework,\n compliance_score: payload.compliance_score,\n violation_count: payload.violation_count,\n evidence_item_count: payload.evidence_item_count,\n upstream,\n });\n}\n\ntype ExtensionBuilder = (\n payload: RuntimeGovernancePayload,\n common: CommonFields,\n upstream?: PreservedUpstreamArtifact\n) => Record<string, unknown>;\n\n/**\n * Per-family extension builder registry.\n * issueRuntimeGovernanceRecord() dispatches to the correct builder.\n */\nexport const FAMILY_BUILDERS: Record<RuntimeGovernanceFamily, ExtensionBuilder> = {\n policy_decision: (p, c, u) => buildPolicyDecisionExtension(p as PolicyDecisionPayload, c, u),\n audit_entry: (p, c, u) => buildAuditEntryExtension(p as AuditEntryPayload, c, u),\n authority_scope: (p, c, u) => buildAuthorityScopeExtension(p as AuthorityScopePayload, c, u),\n lifecycle_event: (p, c, u) => buildLifecycleEventExtension(p as LifecycleEventPayload, c, u),\n trust_observation: (p, c, u) =>\n buildTrustObservationExtension(p as TrustObservationPayload, c, u),\n compliance_observation: (p, c, u) =>\n buildComplianceObservationExtension(p as ComplianceObservationPayload, c, u),\n};\n","/**\n * @peac/adapter-runtime-governance record issuance\n *\n * Generic issuance function that dispatches to per-family extension\n * builders. Source-specific mappers (e.g., mapAgtEvent) produce the\n * RuntimeGovernanceEvent input; this function handles signing.\n *\n * PEAC validates the structure and signature of the PEAC record,\n * not the truth of the upstream governance decision or the operating\n * effectiveness of the upstream control plane.\n */\n\nimport { issue } from '@peac/protocol';\nimport { EXTENSION_NAMESPACE } from './constants.js';\nimport { FAMILY_REGISTRY } from './families.js';\nimport { FAMILY_BUILDERS } from './builders.js';\nimport type { RuntimeGovernanceEvent, IssueOptions, IssueResult } from './types.js';\n\n/**\n * Issue a signed Interaction Record for a normalized runtime governance event.\n *\n * Use source-specific mappers (e.g., mapAgtEvent) to produce the event input.\n * The provider field is always caller-supplied and never hardcoded.\n */\nfunction validateIssueOptions(options: IssueOptions): void {\n if (!(options.privateKey instanceof Uint8Array) || options.privateKey.length !== 32) {\n throw new Error('privateKey must be a 32-byte Uint8Array');\n }\n if (typeof options.kid !== 'string' || options.kid.length === 0 || options.kid.length > 256) {\n throw new Error('kid must be a non-empty string (max 256 chars)');\n }\n if (typeof options.issuer !== 'string' || options.issuer.length === 0) {\n throw new Error('issuer must be a non-empty string');\n }\n if (\n typeof options.sessionId !== 'string' ||\n options.sessionId.length === 0 ||\n options.sessionId.length > 256\n ) {\n throw new Error('sessionId must be a non-empty string (max 256 chars)');\n }\n if (\n typeof options.agentId !== 'string' ||\n options.agentId.length === 0 ||\n options.agentId.length > 256\n ) {\n throw new Error('agentId must be a non-empty string (max 256 chars)');\n }\n if (\n typeof options.provider !== 'string' ||\n options.provider.length === 0 ||\n options.provider.length > 256\n ) {\n throw new Error('provider must be a non-empty string (max 256 chars)');\n }\n}\n\nexport async function issueRuntimeGovernanceRecord(\n event: RuntimeGovernanceEvent,\n options: IssueOptions\n): Promise<IssueResult> {\n validateIssueOptions(options);\n const entry = FAMILY_REGISTRY[event.payload.family];\n const { privateKey, kid, issuer, sessionId, agentId, provider } = options;\n\n const common = {\n session_id: sessionId,\n event: event.event_name,\n agent_id: agentId,\n provider,\n };\n\n const extensionData = FAMILY_BUILDERS[event.payload.family](\n event.payload,\n common,\n event.upstream\n );\n\n const { jws } = await issue({\n iss: issuer,\n kind: entry.kind,\n type: entry.type,\n privateKey,\n kid,\n extensions: { [EXTENSION_NAMESPACE]: extensionData },\n });\n\n return { jws, type: entry.type, family: event.payload.family };\n}\n","/**\n * @peac/adapter-runtime-governance session summary builder\n *\n * Aggregates decoded receipts into a session summary.\n * Decode-only (does NOT verify signatures; caller should verify first).\n * Returns deterministic family order (sorted alphabetically).\n * Counts unknown/unsupported type URIs separately.\n * Never implies verification or finality.\n */\n\nimport { decode } from '@peac/crypto';\nimport { EXTENSION_NAMESPACE, TYPE_PREFIX } from './constants.js';\nimport {\n RUNTIME_GOVERNANCE_FAMILIES,\n type RuntimeGovernanceFamily,\n type SessionSummary,\n} from './types.js';\n\n/** Reverse lookup set for known family suffixes. */\nconst KNOWN_SUFFIXES = new Set(RUNTIME_GOVERNANCE_FAMILIES.map((f) => f.replace(/_/g, '-')));\n\n/**\n * Build a session summary from an array of signed JWS receipts.\n *\n * Decodes each JWS (does NOT verify signatures; caller should verify first).\n * Extracts session ID, families, and issuer from claims and extensions.\n * Unknown type URIs are counted but not included in the families list.\n *\n * @param receipts - Array of compact JWS strings (must be valid JWS format)\n * @returns Session summary with deterministic family ordering\n */\nexport function buildSessionSummary(receipts: string[]): SessionSummary {\n if (receipts.length === 0) {\n return { sessionId: '', receipts: 0, families: [], unknownTypeCount: 0, issuer: '' };\n }\n\n let sessionId = '';\n let issuer = '';\n let unknownTypeCount = 0;\n const familySet = new Set<RuntimeGovernanceFamily>();\n\n for (const jws of receipts) {\n const decoded = decode(jws);\n const claims = decoded.payload as Record<string, unknown>;\n\n if (!issuer && typeof claims.iss === 'string') {\n issuer = claims.iss;\n }\n\n const extensions = claims.extensions as Record<string, unknown> | undefined;\n const govExt = extensions?.[EXTENSION_NAMESPACE] as Record<string, unknown> | undefined;\n\n if (govExt) {\n if (!sessionId && typeof govExt.session_id === 'string') {\n sessionId = govExt.session_id;\n }\n }\n\n const type = claims.type as string | undefined;\n if (type?.startsWith(TYPE_PREFIX)) {\n const suffix = type.slice(TYPE_PREFIX.length);\n if (KNOWN_SUFFIXES.has(suffix)) {\n familySet.add(suffix.replace(/-/g, '_') as RuntimeGovernanceFamily);\n } else {\n unknownTypeCount++;\n }\n } else if (type) {\n unknownTypeCount++;\n }\n }\n\n return {\n sessionId,\n receipts: receipts.length,\n families: [...familySet].sort(),\n unknownTypeCount,\n issuer,\n };\n}\n","/**\n * AGT-specific mapper\n *\n * Normalizes AGT-shaped JSON input into the generic\n * RuntimeGovernanceEvent model. Accepts raw JSON (not AGT SDK objects).\n *\n * Pinned to AGT v3.1.0 pre-release documentation (as of 2026-04-13).\n */\n\nimport { normalizeRuntimeGovernanceEvent, NormalizationError } from '../normalize.js';\nimport type { RuntimeGovernanceEvent, RuntimeGovernanceFamily } from '../types.js';\n\n/** AGT-shaped input. Raw JSON, not SDK objects. */\nexport interface AgtEventInput {\n /** Family name matching a RuntimeGovernanceFamily. */\n family: string;\n /** Specific event name (e.g., 'policy.evaluated'). */\n event: string;\n /** Event-specific data fields. */\n data: Record<string, unknown>;\n /** Optional upstream source context. */\n source?: {\n system?: string;\n event_type?: string;\n event_id?: string;\n timestamp?: string;\n artifact_hash?: string;\n artifact_ref?: string;\n cloud_event_type?: string;\n };\n}\n\nconst AGT_FAMILY_MAP: Record<string, RuntimeGovernanceFamily> = {\n policy_decision: 'policy_decision',\n audit_entry: 'audit_entry',\n authority_scope: 'authority_scope',\n lifecycle_event: 'lifecycle_event',\n trust_observation: 'trust_observation',\n compliance_observation: 'compliance_observation',\n};\n\n/**\n * Map an AGT-shaped event input to a normalized RuntimeGovernanceEvent.\n * Throws NormalizationError on unrecognized or malformed input.\n */\nexport function mapAgtEvent(input: AgtEventInput): RuntimeGovernanceEvent {\n const family = AGT_FAMILY_MAP[input.family];\n if (!family) {\n throw new NormalizationError(`unrecognized AGT family: ${input.family}`, 'family');\n }\n\n const raw = {\n event_name: input.event,\n payload: {\n family,\n ...input.data,\n },\n upstream: input.source\n ? {\n source_system: input.source.system,\n source_event_type: input.source.event_type,\n source_event_id: input.source.event_id,\n source_timestamp: input.source.timestamp,\n source_artifact_hash: input.source.artifact_hash,\n source_artifact_ref: input.source.artifact_ref,\n source_cloud_event_type: input.source.cloud_event_type,\n }\n : undefined,\n };\n\n return normalizeRuntimeGovernanceEvent(raw);\n}\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @peac/adapter-runtime-governance
3
+ *
4
+ * Generic runtime governance adapter for PEAC interaction records.
5
+ * Maps runtime governance artifacts to signed Interaction Records
6
+ * using 6 observation-specific type URIs.
7
+ *
8
+ * PEAC validates the structure and signature of the PEAC record,
9
+ * not the truth of the upstream governance decision or the operating
10
+ * effectiveness of the upstream control plane.
11
+ *
12
+ * AGT is the first mapper. The provider field is always caller-supplied.
13
+ * No vendor SDK dependencies.
14
+ */
15
+ export { EXTENSION_NAMESPACE, TYPE_PREFIX, EVENT_TYPES, FIELD_LIMITS, type EventType, } from './constants.js';
16
+ export { RUNTIME_GOVERNANCE_FAMILIES, type RuntimeGovernanceFamily, type PreservedUpstreamArtifact, type PolicyDecisionPayload, type AuditEntryPayload, type AuthorityScopePayload, type LifecycleEventPayload, type TrustObservationPayload, type ComplianceObservationPayload, type RuntimeGovernancePayload, type RuntimeGovernanceEvent, type IssueOptions, type IssueResult, type SessionSummary, } from './types.js';
17
+ export { FAMILY_REGISTRY, type FamilyEntry } from './families.js';
18
+ export { normalizeRuntimeGovernanceEvent, NormalizationError } from './normalize.js';
19
+ export { issueRuntimeGovernanceRecord } from './issue.js';
20
+ export { buildSessionSummary } from './session-summary.js';
21
+ export { mapAgtEvent, type AgtEventInput } from './mappers/index.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAGlE,OAAO,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC"}