/** * The Sense → Think → Strike → Drift loop. * * Port of automaton-main/src/agent/loop.ts, adapted for the lobster cosmology. * Inference provider is pluggable: pass a `think()` callable. */ export interface ClawTool { name: string; description: string; call: (args: unknown) => Promise; } export interface InferProvider { /** * Return the assistant's reply given the system prompt + history. * `tools` is the merged list of caller-supplied + auto-loaded skill tools; * providers that support function/tool calling should expose them to the model. */ think: (model: string, systemPrompt: string, history: { role: string; content: string; }[], tools?: ClawTool[]) => Promise; costFor: (tokensIn: number, tokensOut: number, model: string) => number; } export interface LoopInput { rpcUrl: string; tools: ClawTool[]; infer: InferProvider; /** Hard limit per tail-flick — abort if exceeded. */ maxClawStrikes?: number; /** External signal to stop (e.g. SIGINT). */ abort?: AbortSignal; /** * Skip auto-loading installed skills as additional tools. By default the * leviathan inherits every skill in ~/.openclawd/skills/ at every flick. */ skipSkills?: boolean; } export declare function tailFlick(input: LoopInput): Promise;