MiddlewareParams
Parameters received by a middleware function at runtime.
Middleware receives erased args, flags, and provenance (since it's defined independently of commands) plus the accumulated context from prior middleware and a next function to continue the chain.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/middleware.ts - Source link:
src/core/schema/middleware.ts:28
Signatures
interface MiddlewareParams {}Members
Properties
args
Fully resolved positional arguments (type-erased).
args: Readonly<Record<string, unknown>>;ctx
Context accumulated from previous middleware in the chain.
ctx: Readonly<Record<string, unknown>>;flags
Fully resolved flags (type-erased).
flags: Readonly<Record<string, unknown>>;meta
CLI program metadata (name, bin, version, command).
meta: CommandMeta;next
Continue to the next middleware or action handler.
Call with context additions that merge into ctx for downstream. Returns when the entire downstream chain completes — enabling wrap-around patterns (timing, try/catch, cleanup).
next: { (additions: Record<string, unknown>): Promise<void>; };out
Output channel.
out: Out;sources
Where each resolved value came from, keyed like flags and args.
Erased alongside them, so any key reads as ResolutionProvenance | undefined. A key the bound command never declared, and one an input resolved no value for, both read undefined.
sources: ErasedInputSources;