export type CompileOptions = { /** Extension for .agency rewrites: ".js" or ".ts" */ targetExt: ".js" | ".ts"; }; export interface ImportStrategy { /** * Rewrite an import path for the output. * Handles .agency, .js, and .ts imports. */ rewriteImport(modulePath: string, sourceFile: string): string; /** * Ensure all non-Agency dependencies are available for execution. * Called after compilation, before the output is executed. * Errors if a dependency can't be resolved. */ prepareDependencies(imports: string[], sourceFile: string): void; } /** * Strategy for `agency compile`: produces output for a downstream build pipeline. * Leaves .js/.ts imports untouched. Only rewrites .agency imports. */ export declare class CompileStrategy implements ImportStrategy { protected options: CompileOptions; constructor(options: CompileOptions); rewriteImport(modulePath: string, _sourceFile: string): string; prepareDependencies(_imports: string[], _sourceFile: string): void; } /** * Strategy for `agency run` / `agency debug` / `agency test`: compiles and * immediately executes. All imports must resolve to .js files that exist on disk. * Compiles .ts dependencies to .js via esbuild when needed. */ export declare class RunStrategy extends CompileStrategy { constructor(); rewriteImport(modulePath: string, sourceFile: string): string; prepareDependencies(imports: string[], sourceFile: string): void; private ensureJsExists; /** Extract relative .js imports from TypeScript source code. */ private getLocalJsImports; }