import { Effect, type Layer } from "effect-app" import { Commander, type CommanderImpl, CommanderStatic } from "./commander.js" type X = X // helps retain JSDoc export interface CommanderResolved extends X, Pick, "fn" | "wrap" | "alt" | "alt2"> { } export const makeUseCommand = Effect.fnUntraced( function*(rtHooks: Layer.Layer) { const cmndr = yield* Commander const runtime = yield* Effect.context() const comm = cmndr(runtime, rtHooks) const command: CommanderResolved = { ...comm, ...CommanderStatic } return command } )