Agent Runtime
The Agent Runtime enables modules to perform asynchronous background processing.
JobProcessor
Section titled “JobProcessor”Modules define processors extending the JobProcessor class.
Definition
Section titled “Definition”Place processors in modules/{name}/src/agent/.
import { JobProcessor } from '@nexical/agent';
export class ScrapeProcessor extends JobProcessor<ScrapeInput> { jobType = 'scrape.url';
async process(job) { // Logic }}Lifecycle
Section titled “Lifecycle”- Discovery: The system auto-discovers files in
src/agent/. - Registration: Processors are registered to the worker pool.
- Execution: When a job of
jobTypeis enqueued, the processor handles it.