/**
 * Transform: rewrite service access in route files.
 *
 * Replaces c.var.kv, c.var.vector, etc. with direct imports from the
 * shared services module.
 *
 * Uses string-level surgery rather than AST round-trip to preserve
 * formatting and comments.
 */
import type { ServiceUsage } from '../../detect-v3';
export interface RouteServiceTransformResult {
    /** The transformed source, or null if no changes */
    source: string | null;
    /** What was changed */
    changes: string[];
}
/**
 * Rewrite c.var.* service access patterns to direct imports.
 *
 * @param source     - File source text
 * @param usage      - Detected service usage info
 * @param servicesRelativePath - Relative import path to services module (e.g., '../services')
 */
/**
 * Remove all imports from @agentuity/runtime and re-route individual symbols
 * to their v3 replacements where applicable.
 *
 * Recognised re-routes:
 *   - `Env`                → local types file (generated elsewhere)
 *   - `validator`          → dropped (v3 has no equivalent middleware; callers
 *                           now parse input via zod inline)
 *   - everything else      → dropped silently (deprecation stubs)
 *
 * Returns the rewritten source plus flags for each recognised symbol so the
 * caller can emit the replacement imports in the right order.
 */
export interface RuntimeImportCleanup {
    source: string;
    removed: boolean;
    /** Whether `Env` was imported from @agentuity/runtime */
    needsEnvType: boolean;
    /** Whether `validator` (the Agentuity validator helper) was imported */
    hadAgentuityValidator: boolean;
}
export declare function removeRuntimeImports(source: string): RuntimeImportCleanup;
export declare function transformRouteServices(source: string, usage: ServiceUsage, servicesRelativePath: string): RouteServiceTransformResult;
/**
 * Compute the relative import path from a source file to src/services.ts.
 */
export declare function computeServicesRelativePath(projectDir: string, sourceFilePath: string): string;
/**
 * Rewrite v2-era agent method invocations to plain function calls in route
 * files.
 *
 *   translate.run(data)   → translate(data)
 *   translate.validator() → /* stripped above * /
 *
 * We also rewrite `c.req.valid('json')` → `await c.req.json()` — the former
 * was the output of the v2 validator middleware that we stripped.
 */
export declare function rewriteV2AgentMethods(source: string): {
    source: string;
    changed: boolean;
    changes: string[];
};
/**
 * Stub out v2-era Hono context variables that no longer exist in v3.
 *
 * v3's Services interface only includes storage clients (kv, vector, stream,
 * etc.). Thread state, sessionId, and app-level state were removed when v3
 * dropped the createApp() abstraction.
 */
export declare function stubV2HonoContext(source: string): {
    source: string;
    changed: boolean;
    changes: string[];
};
/**
 * Strip v2 validator middleware from a source string.
 *
 * Removes two shapes:
 *   - `validator({ input: ... })` / `validator({ output: ... })` imported
 *     from @agentuity/runtime (used as Hono middleware)
 *   - `<agent>.validator()` — the auto-generated method on v2 agents used as
 *     middleware on routes that forward to the agent
 *
 * Both become comments so the file parses but the user can see where to wire
 * up manual validation (typically via `zod.parse(await c.req.json())`).
 */
export declare function stripAgentuityValidators(source: string): {
    source: string;
    changed: boolean;
    changes: string[];
};
export declare function insertAfterImports(source: string, importLine: string): string;
//# sourceMappingURL=routes.d.ts.map