import { m as CodemationConfig, o as CodemationPlugin, r as AppConfig } from "./CodemationAppContext-K51b7oXe.js";
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-Dt4jyLx6.js";
import { i as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-B7aFQcIw.js";
import { t as AppConfigFactory } from "./AppConfigFactory-DncmwCD1.js";
import { a as ProcessRunOptions, o as ProcessRunResult, s as ProcessRunner } from "./PublicFrontendBootstrapFactory-ClEjZP74.js";
import { ChildProcess } from "node:child_process";

//#region src/process/ExecaProcessRunner.d.ts
/**
 * Production {@link ProcessRunner}. Defers cross-platform executable resolution (`pnpm` ↔ `pnpm.cmd`,
 * `.cmd` / `.bat` / `.ps1` shims on Windows) and argument quoting to execa so call sites stop having
 * to hand-roll platform conditionals.
 */
declare class ExecaProcessRunner implements ProcessRunner {
  spawn(command: string, args: ReadonlyArray<string>, options?: ProcessRunOptions): ChildProcess;
  runSync(command: string, args: ReadonlyArray<string>, options?: ProcessRunOptions): ProcessRunResult;
  private toExecaOptions;
  private toExecaSyncOptions;
}
//#endregion
//#region src/presentation/http/CodemationServerGatewayFactory.d.ts
declare class CodemationServerGateway {
  private readonly config;
  private readonly consumerRoot;
  private readonly configSource?;
  private readonly workflowSources;
  private readonly env?;
  private static readonly contextsByConfig;
  constructor(config: CodemationConfig, consumerRoot: string, configSource?: string | undefined, workflowSources?: ReadonlyArray<string>, env?: Readonly<NodeJS.ProcessEnv> | undefined);
  dispatch(request: Request): Promise<Response>;
  prepare(): Promise<void>;
  close(): Promise<void>;
  loadWorkflowSummaries(): Promise<ReadonlyArray<WorkflowSummary>>;
  loadWorkflowDetail(workflowId: string): Promise<WorkflowDto>;
  private getContext;
  private createContext;
  private resolveWorkflowSources;
  private detectWorkspaceRoot;
}
//#endregion
//#region src/presentation/server/AppConfigLoader.d.ts
type AppConfigLoadResult = Readonly<{
  appConfig: AppConfig;
  bootstrapSource: string | null;
}>;
declare class AppConfigLoader {
  private readonly consumerConfigLoader;
  private readonly appConfigFactory;
  constructor(consumerConfigLoader?: CodemationConsumerConfigLoader, appConfigFactory?: AppConfigFactory);
  load(args: Readonly<{
    consumerRoot: string;
    repoRoot: string;
    env: NodeJS.ProcessEnv;
    configPathOverride?: string;
  }>): Promise<AppConfigLoadResult>;
}
//#endregion
//#region src/presentation/server/CodemationPluginDiscovery.d.ts
type CodemationDiscoveredPluginPackage = Readonly<{
  packageName: string;
  packageRoot: string;
  pluginEntry: string;
  developmentEntry?: string;
}>;
type CodemationResolvedPluginPackage = Readonly<CodemationDiscoveredPluginPackage & {
  plugin: CodemationPlugin;
}>;
declare class CodemationPluginDiscovery {
  private readonly pluginPackageMetadata;
  discover(consumerRoot: string): Promise<ReadonlyArray<CodemationDiscoveredPluginPackage>>;
  resolvePlugins(consumerRoot: string): Promise<ReadonlyArray<CodemationResolvedPluginPackage>>;
  resolveDiscoveredPackages(discoveredPackages: ReadonlyArray<CodemationDiscoveredPluginPackage>): Promise<ReadonlyArray<CodemationResolvedPluginPackage>>;
  private collectPackageRoots;
  private readPackageJson;
  private loadPlugin;
  private resolvePluginValue;
  private isPluginConfig;
  private resolvePluginEntry;
  private resolveDevelopmentPluginEntry;
  private exists;
  private resolvePluginModuleSpecifier;
}
//#endregion
//#region src/presentation/server/WorkflowModulePathFinder.d.ts
declare class WorkflowModulePathFinder {
  static readonly defaultWorkflowDirectories: readonly ["src/workflows", "workflows"];
  private readonly workflowExtensions;
  discoverModulePaths(args: Readonly<{
    consumerRoot: string;
    workflowDirectories: ReadonlyArray<string> | undefined;
    exists: (absolutePath: string) => Promise<boolean>;
  }>): Promise<ReadonlyArray<string>>;
  private collectWorkflowModulePaths;
  private isWorkflowModulePath;
}
//#endregion
//#region src/presentation/server/WorkflowDiscoveryPathSegmentsComputer.d.ts
declare class WorkflowDiscoveryPathSegmentsComputer {
  compute(args: Readonly<{
    consumerRoot: string;
    workflowDiscoveryDirectories: ReadonlyArray<string>;
    absoluteWorkflowModulePath: string;
  }>): readonly string[] | undefined;
}
//#endregion
export { CodemationResolvedPluginPackage as a, CodemationServerGateway as c, CodemationPluginDiscovery as i, ExecaProcessRunner as l, WorkflowModulePathFinder as n, AppConfigLoadResult as o, CodemationDiscoveredPluginPackage as r, AppConfigLoader as s, WorkflowDiscoveryPathSegmentsComputer as t };
//# sourceMappingURL=server-B5trn7y4.d.ts.map