Skip to content

PolicyEvalHandlerContext

Defined in: src/policies/sdk/define-policy.ts:52

Context injected into definePolicy evaluate handlers.

Parallel to PolicyHandlerContext but protocol-agnostic - no Hono types. Extends the runtime-facing PolicyEvalContext with the fully-merged, typed config.

TConfig

optional adapter: GatewayAdapter

Defined in: src/core/protocol.ts:277

Runtime adapter (stores, waitUntil, etc.).

PolicyEvalContext.adapter


config: TConfig

Defined in: src/policies/sdk/define-policy.ts:54

Fully merged config (defaults + user overrides).


debug: DebugLogger

Defined in: src/core/protocol.ts:269

Debug logger pre-namespaced to stoma:policy:{name}. Always callable.

PolicyEvalContext.debug


requestId: string

Defined in: src/core/protocol.ts:273

Unique request ID for correlation.

PolicyEvalContext.requestId


trace: TraceReporter

Defined in: src/core/protocol.ts:271

Trace reporter - always callable, no-op when tracing is not active.

PolicyEvalContext.trace


traceId: string

Defined in: src/core/protocol.ts:275

W3C trace ID (32-hex).

PolicyEvalContext.traceId