//#region src/supply-chain/audit-emitter.d.ts /** * Typed in-process event emitter for skills supply-chain audit * events. Mirrors the secrets / OAuth emitters so the audit log * subscribes once and translates every event into a tamper-evident * chain entry. * * @packageDocumentation */ /** * Discriminator for `SupplyChainAuditEvent`. * * @stable */ type SupplyChainAuditAction = 'skill:installed' | 'skill:upgraded' | 'skill:removed' | 'skill:audit' | 'skill:install-denied'; /** * Discriminator for the outcome of a single audit event. * * @stable */ type SupplyChainAuditDecision = 'success' | 'denied' | 'error'; /** * Optional identifier of who initiated the install. * * @stable */ interface SupplyChainAuditActor { readonly kind: 'cli' | 'agent' | 'system' | 'tool' | 'subagent'; readonly id?: string; } /** * One audit event. The payload is intentionally minimal - never * carry credentials or token material; only safe metadata. * * @stable */ interface SupplyChainAuditEvent { readonly action: SupplyChainAuditAction; readonly decision: SupplyChainAuditDecision; readonly ts: number; /** Always `'skills-supply-chain'`. */ readonly source: string; /** Stable identifier of the form `skill:@`. */ readonly target: string; readonly actor?: SupplyChainAuditActor; readonly metadata?: Readonly>; } /** * Callback shape accepted by {@link onSupplyChainAudit}. * * @stable */ type SupplyChainAuditListener = (event: SupplyChainAuditEvent) => void; /** * Subscribe to supply-chain audit events. The audit-log subsystem * registers exactly one listener. * * @stable */ declare function onSupplyChainAudit(listener: SupplyChainAuditListener): () => void; /** * Emit an event to every subscriber. Listeners that throw are * isolated. * * @stable */ declare function emitSupplyChainAudit(event: SupplyChainAuditEvent): void; /** * Reset the listener set. Used by tests. * * @experimental */ declare function _resetSupplyChainAuditListenersForTesting(): void; /** * Number of currently-registered listeners. * * @experimental */ declare function _getSupplyChainAuditListenerCountForTesting(): number; //#endregion export { SupplyChainAuditAction, SupplyChainAuditActor, SupplyChainAuditDecision, SupplyChainAuditEvent, SupplyChainAuditListener, _getSupplyChainAuditListenerCountForTesting, _resetSupplyChainAuditListenersForTesting, emitSupplyChainAudit, onSupplyChainAudit }; //# sourceMappingURL=audit-emitter.d.ts.map