UNPKG

zephyr-agent

Version:
39 lines • 2.32 kB
import { BuildSession } from './build-session.js'; import type { ApplicationContextOptions, ApplicationContextRegistryLocator, BeginBuildOptions } from './zephyr-engine.types.js'; /** Load-once application state which owns successive logical build generations. */ export declare class ApplicationContext<TData = unknown, TResult = void> { readonly applicationUid: string; private readonly options; private latestGeneration; private activeSession; private activeDefinitionKey; constructor(options: ApplicationContextOptions<TData, TResult>); get currentBuild(): BuildSession<TData, TResult> | null; beginBuild(options: BeginBuildOptions): BuildSession<TData, TResult>; abortCurrent(reason?: unknown): void; } /** * Caller-owned rendezvous registry. Wrappers can share this object between independently * created plugins, associate an early contextKey with a later application identity, and * explicitly dispose all aliases when the compiler closes. */ export declare class ApplicationContextRegistry<TData = unknown, TResult = void> { private readonly entries; private readonly pending; private readonly disposedPending; getOrCreate(locator: ApplicationContextRegistryLocator, create: () => ApplicationContext<TData, TResult>): ApplicationContext<TData, TResult>; /** * Single-flight async variant for wrappers which must initialize ZephyrEngine before * the application UID is available. Concurrent callers using the same early key share * one factory promise (and therefore one engine/build ID allocation). */ getOrCreateAsync(locator: ApplicationContextRegistryLocator, create: () => Promise<ApplicationContext<TData, TResult>>): Promise<ApplicationContext<TData, TResult>>; get(locator: ApplicationContextRegistryLocator): ApplicationContext<TData, TResult> | null; /** Associate additional identity aliases with a context previously created by key. */ associate(existing: ApplicationContextRegistryLocator, aliases: ApplicationContextRegistryLocator): ApplicationContext<TData, TResult>; dispose(locator: ApplicationContextRegistryLocator, reason?: string): boolean; clear(reason?: string): void; private clearPendingAliases; private createAliases; } //# sourceMappingURL=application-context.d.ts.map