/** * Shared `createRule` factory for the published `@nhtio/adk` ESLint rules. * * @remarks * Wraps `ESLintUtils.RuleCreator` so every rule gets a consistent `meta.docs.url` pointing at the * published rule reference. Each rule module imports this and default-exports `createRule({...})`. * * `@typescript-eslint/utils` is an OPTIONAL peer dependency of `@nhtio/adk` — it is only needed by * consumers who import `@nhtio/adk/eslint`. The main library never imports this module. */ import { ESLintUtils } from '@typescript-eslint/utils'; import type { TSESTree } from '@typescript-eslint/utils'; /** * Rule factory for `@nhtio/adk` ESLint rules. The `name` passed to each rule becomes the slug in the * generated documentation URL. */ export declare const createRule: ({ meta, name, ...rule }: Readonly>) => ESLintUtils.RuleModule & { name: string; }; /** Any function-like AST node (arrow, function expression, or declaration). */ export type FunctionNode = TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression; export declare const isFunctionNode: (node: TSESTree.Node) => node is FunctionNode; /** * Heuristic: does this call/new expression look like a primary LLM invocation? Detects known * provider SDK constructors and `…create()` calls whose receiver chain passes through * `chat`/`completions`/`messages`/`responses`, plus a small set of generate* methods. Deliberately * conservative — the goal is to catch the obvious footgun, not to be exhaustive. */ export declare const isLlmCall: (node: TSESTree.Node) => boolean; /** * Walks the descendants of a function body (NOT crossing into nested function scopes) and invokes * `visit` for every node, so a rule can scan a handler/middleware body for a pattern while ignoring * inner closures (e.g. a `new TurnRunner` sub-agent's own callbacks). */ export declare const walkBodySkippingNestedFunctions: (body: TSESTree.Node, visit: (node: TSESTree.Node) => void) => void; /** * True when the function body runs a scoped sub-agent — either `new TurnRunner(...)` or * `DispatchRunner.dispatch(...)` — the documented escape hatch that exempts a tool handler from * {@link isLlmCall} flagging. */ export declare const runsSubAgent: (body: TSESTree.Node) => boolean;