INNER CODE UNIT · TypeScript

AuditLog

open-gitagent/clawless · src/audit.ts:43

export class AuditLog {
  private entries: AuditEntry[] = [];
  private listeners: Array<(entry: AuditEntry) => void> = [];

  // Throttle buffers for stdout/stdin
  private stdoutBuf = '';
  private stdinBuf = '';
  private stdoutTimer: ReturnType<typeof setTimeout> | null = null;
  private stdinTimer: ReturnType<typeof setTimeout> | null = null;

  /** Return a snapshot of all entries. */
  getEntries(): AuditEntry[] {
    return this.entries;
  }

  /** Subscribe to new entries. Returns unsubscribe function. */
  onEntry(fn: (entry: AuditEntry) => void): () => void {
    this.listeners.push(fn);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…