import { TypeCheckReport } from "../compiler/compile.js";
import type { AgencyProgram, AgencyNode } from "../types.js";
import { AgencyFunction } from "../runtime/agencyFunction.js";
/**
 * Register a scoped callback for the dynamic extent of the caller's function
 * or node. Implementation backing for `callback(name, fn)` in std::agency.
 *
 * Frame targeting:
 *   - At top level (inside `__initializeGlobals`, before any node frame is
 *     pushed) — route to `ctx.topLevelCallbacks`, which lives on the
 *     execution context for the whole run.
 *   - Otherwise — push onto the caller's stack frame, which auto-cleans up
 *     when the caller's frame pops.
 *
 * NOTE on the AgencyFunction wrapping: this function needs access to the
 * runtime state (to walk the stateStack and find the caller's frame), and
 * the only way a TS-implemented stdlib export receives that state is by
 * being wrapped as an AgencyFunction. `__call`'s plain-function branch
 * silently drops the state argument; the AgencyFunction branch routes
 * through `invoke()`, which passes state as the last positional arg to the
 * underlying TS function. See `_run` in `lib/runtime/ipc.ts` for the
 * established pattern.
 */
export declare function _callbackImpl(name: string, fn: unknown): void;
export declare const _callback: AgencyFunction;
export declare function _compile(source: string): {
    moduleId: string;
    path: string;
};
export declare function _compileFile(dir: string, filename: string): {
    moduleId: string;
    path: string;
};
export declare function _typecheck(source: string): TypeCheckReport;
export declare function _typecheckFile(dir: string, filename: string): TypeCheckReport;
export declare function _parseAST(source: string): AgencyProgram;
export declare function _writeAST(ast: AgencyProgram, dir: string, filename: string, overwrite: boolean): Promise<boolean>;
export declare function _format(source: string): string;
export declare function _formatFile(dir: string, filename: string): boolean;
export type WalkASTVisit = {
    node: AgencyNode;
    ancestors: AgencyNode[];
};
export declare function _walkAST(ast: AgencyProgram): {
    clone: AgencyProgram;
    visits: WalkASTVisit[];
};
export declare function _getNodesOfType(source: string, types: string[]): AgencyNode[];
export declare function _filterImports(source: string, allowedPackages: string[], excludedPackages: string[], allowKinds: string[], excludeKinds: string[]): {
    source: string;
    filtered: boolean;
};
