import type { ParsedNode } from './types.js'; /** * The outcome of trying to translate an n8n Code / Function node into a real * Pikku function body. Only pure, self-contained JavaScript is translated — * anything that reaches outside its own input (other nodes, the environment, * the network, `require`) stays a throwing stub for a human (or the * `pikku-n8n-code-translate` skill) to finish. */ export type CodeTranslation = { translatable: true; mode: 'all' | 'each'; source: string; /** n8n node names referenced via `$("X")` / `$node["X"]` (statically). */ refs: string[]; /** Reads the incoming item stream (`$input` / `$json` / legacy `items`). */ usesInput: boolean; } | { translatable: false; reason: string; }; /** Collect the distinct node names a body reads via `$("X")` / `$node["X"]`. */ export declare function extractNodeRefs(source: string): string[]; /** The graph-input / shim key a `$("X")` reference is wired through. */ export declare function codeRefKey(name: string): string; /** * Decide whether an n8n Code node's body can be lowered 1:1 into a Pikku * function. Pure module — no fs, no codegen — so it can drive both naming * (a translatable node is not a stub) and emission. */ /** * Why a raw JavaScript body can't be lowered 1:1 into a Pikku function, or null * when it can. Shared by Code-node translation and computed Set-node synthesis * so a Set node is only functionized when the result would actually translate. */ export declare function untranslatableReason(source: string): string | null; export declare function translateCodeNode(node: ParsedNode): CodeTranslation;