UNPKG

@mondaydotcomorg/atp-protocol

Version:

Core protocol types and interfaces for Agent Tool Protocol

33 lines 991 B
/** * Provider interfaces for dependency injection * These allow users to inject their own implementations for cache, auth, and audit */ /** * Multi-sink audit wrapper * Allows writing to multiple audit sinks simultaneously */ export class MultiAuditSink { name = 'multi'; sinks; constructor(sinks) { this.sinks = sinks; } async write(event) { await Promise.all(this.sinks.map((sink) => sink.write(event))); } async writeBatch(events) { await Promise.all(this.sinks.map((sink) => sink.writeBatch(events))); } async query(filter) { for (const sink of this.sinks) { if (sink.query) { return await sink.query(filter); } } throw new Error('No queryable audit sink available'); } async disconnect() { await Promise.all(this.sinks.map((sink) => (sink.disconnect ? sink.disconnect() : Promise.resolve()))); } } //# sourceMappingURL=providers.js.map