{"version":3,"file":"async-context.mjs","names":[],"sources":["../../src/lib/async-context.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\n\nexport interface ForgeContextData {\n  args: Record<string, unknown>;\n  commandChain: string[];\n  /**\n   * Process-unique identifiers of every CLI instance from the root down to\n   * the currently-running command. Used by `getCommandContext(cli)` to\n   * validate the CLI reference passed as a type witness is any command on\n   * the active chain — the root app, an ancestor, or the running command\n   * itself. Accepting ancestors matters because standalone-composed\n   * subcommands don't track their parent in the type system, so users\n   * reliably have a reference to the root `app` but not always to the\n   * specific running subcommand.\n   */\n  commandIdChain: string[];\n  /** Pre-resolved eager providers and cached factory results */\n  providers: Map<string, unknown>;\n  /** Factory registrations for lazy resolution */\n  providerFactories: Map<string, { factory: Function; lifetime: string }>;\n  /** Whether inject() is currently allowed (only during handler phase) */\n  handlerPhase: boolean;\n  /** Keys whose factories are currently being resolved — used for cycle detection */\n  resolving: Set<string>;\n}\n\nexport const contextStorage = new AsyncLocalStorage<ForgeContextData | undefined>();\n"],"mappings":";;AA0BA,MAAa,iBAAiB,IAAI,mBAAiD"}