UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

32 lines (31 loc) • 1.24 kB
/** * Autoresearch task executor — bridges TaskManager with the * autoresearch experiment loop. * * Each tick: * 1. Loads/creates a ResearchWorker for the task's tag * 2. Gets the phase-appropriate tool filter * 3. Calls NeuroLink.generate() with research tools + prompt * 4. Advances phase based on which tools the AI called * 5. Returns a TaskRunResult * * Workers are cached by tag to avoid re-initialization on each tick. * Forwards the NeuroLink emitter to each worker for lifecycle events. */ import type { AutoresearchEmitter, NeuroLinkExecutable, Task, TaskRunResult } from "../types/index.js"; /** * Clear all cached workers. Called by TaskManager.shutdown(). */ export declare function clearWorkerCache(): void; /** * Execute one autoresearch tick for a task. * * Returns a TaskRunResult-shaped object. * If the task is missing autoresearch config, returns an error result * instead of throwing (so the scheduler can record the failure). * * @param emitter - Optional emitter to forward autoresearch lifecycle events */ export declare function executeAutoresearchTick(task: Task & { autoresearch?: unknown; }, neurolink: NeuroLinkExecutable, emitter?: AutoresearchEmitter): Promise<TaskRunResult>;