/** * Per-task feature configs: `hooks`, `caching` and `knowledge`. * * These are the task-scoped counterparts of the team-level options of the same * names; `caching` resolves through the package's canonical `resolve_caching` * (Python `config/param_resolver.py`). * * - `hooks` — an `onTaskStart` / `onTaskComplete` pair fired around this task * only (Python `WorkflowHooksConfig.on_step_start` / `on_step_complete`); * snake_case and the workflow's `on_step_*` spelling are both accepted. * - `caching` — a per-task response cache keyed by agent + prompt, so a repeat * of the same prompt is answered from the cache instead of the model. * - `knowledge` — literal text, a list of documents, or any object exposing * `search(query, limit)` (a `KnowledgeBase`); the matches are rendered into * the task prompt. */ import type { Task } from '../types'; import { ResponseCache } from './types'; import type { TaskHooks } from './types'; /** * Resolve a task's `hooks` option. Returns `undefined` when it carries no * callable, so a task without hooks costs nothing at run time. */ export declare function resolveTaskHooks(input: unknown): TaskHooks | undefined; /** Resolve a task's `caching` option to a cache, or `undefined` when disabled. */ export declare function resolveTaskCache(input: unknown): ResponseCache | undefined; /** The cache key a task's prompt uses: the agent name plus the prompt text. */ export declare function cacheKey(agentName: string, prompt: string): string; /** Anything that can answer a knowledge query (`KnowledgeBase` or `Knowledge`). */ export interface KnowledgeSearcher { search(query: string, ...args: unknown[]): unknown; } /** * Render the task's `knowledge` into a prompt block. * * A string or list of strings is literal knowledge and is included verbatim; an * object with `search` is queried with `query`. Returns `''` when the task has * no knowledge or nothing matched. */ export declare function buildKnowledgeContext(task: Task, query: string, limit?: number): Promise;