Classes

c
AuditService(
storage: IAuditStorage,
runtime: IRuntimeServices
)

Audit service backed by an IAuditStorage port.

c
DatabaseAuditStorage(options: { client: IAuditDbClient; table?: string; })

Database-backed audit storage. Requires an injected IAuditDbClient at construction time.

c
FileAuditStorage(options: { fs: IFileSystem; path?: string; })

File-backed audit storage. Writes JSONL to path via runtime.fs.

c
LogAuditStorage(options?: { logger?: ILogger; level?: LogLevel; })

Logs audit records through an ILogger. When constructed without a logger and used as a storage backend, queries return empty arrays.

c
MemoryAuditStorage

In-memory audit storage backed by an array. Stores already-frozen records; isReady() always returns true. Non-durable across restarts.

Functions

f
AuditPlugin(options?: AuditPluginOptions): IPlugin

AuditPlugin factory — registers an IAuditLogger under CAPABILITIES.AUDIT.

Interfaces

I
AuditEntry

One immutable audit trail entry.

I
AuditPluginOptions

Options accepted by the AuditPlugin factory.

I
AuditQuery

Query criteria for IAuditStorage.query. Every field is optional and combines as AND. An omitted field does not constrain.

I
AuditStorageOptions

Options passed to individual storage backends.

I
IAuditDbClient

Structural shape of an injected database client facade. The DB backend is inject-only — it never touches the database capability token.

I
IAuditLogger

Immutable audit trail writer.

I
StoredAuditEntry

A stored audit record extends AuditEntry with an internally assigned id (UUID v4) and timestamp (wall-clock epoch ms).

Type Aliases

T
AuditStorageType = "memory" | "log" | "database" | "file"

Storage backend identifier — closed union.