import type { InterruptKind } from "../symbolTable.js";
import type { TypeCheckerContext, ScopeInfo } from "./types.js";
/**
 * Declarative pipeline: collect per-scope profiles → propagate transitively → format.
 */
export declare function analyzeInterruptsFromScopes(scopes: ScopeInfo[], ctx: TypeCheckerContext): Record<string, InterruptKind[]>;
/**
 * Emit warnings for function calls that may throw interrupts but aren't
 * inside a handler.
 *
 * Scoped to graph-node bodies only. `def` functions are designed to
 * propagate interrupts to the nearest enclosing handler in the caller —
 * that's the whole point of the interrupt model. Warning on `def`
 * bodies floods every library function that calls `read`/`glob`/etc.
 * with noise and trains users to ignore the diagnostic, defeating its
 * purpose at the `node` boundary where the prompt actually surfaces to
 * a human operator.
 */
export declare function checkUnhandledInterruptWarnings(scopes: ScopeInfo[], interruptKindsByFunction: Record<string, InterruptKind[]>, ctx: TypeCheckerContext): void;
/**
 * A handler whose body can itself raise an interrupt creates a
 * dispatch-recursion loop: the inner interrupt re-enters the handler
 * chain, which visits every handler (including the one currently
 * running), which raises another interrupt, etc. The runtime now
 * bounds this at `MAX_HANDLER_CHAIN_DEPTH` and throws
 * `HandlerRecursionError`, but catching it at compile time is better.
 *
 * Restructure the code so the handler doesn't call interrupt-raising
 * functions — e.g. hoist a `read("policy.json") with approve` out of
 * the handler and into `node main()` (see `ensurePolicyLoaded` in
 * `lib/agents/agency-agent/agent.agency` for the canonical fix).
 *
 * If the call really is unavoidable, suppress this error with a
 * `// @tc-ignore` comment on the line above the `handle` block.
 */
export declare function checkHandlerBodyInterrupts(scopes: ScopeInfo[], interruptKindsByFunction: Record<string, InterruptKind[]>, ctx: TypeCheckerContext): void;
/**
 * `interrupt` is not allowed inside any callback body. Callbacks fire as
 * side effects; their body cannot pause execution to ask the user a
 * question. Move the `interrupt` into the calling node/function instead,
 * or use a runtime guard if you wanted budget enforcement.
 *
 * After the `liftCallbacks` preprocessor runs, every
 * `callback(...) { ... }` block becomes
 * `callback("hookName", __cb_scope_N)` — a 2-arg call whose second
 * argument is a `variableName` referencing a lifted top-level
 * function. We look that function up in `interruptKindsByFunction`
 * (transitively populated) and emit an error if it may interrupt.
 */
export declare function checkCallbackBodyInterrupts(scopes: ScopeInfo[], interruptKindsByFunction: Record<string, InterruptKind[]>, ctx: TypeCheckerContext): void;
