import { AgencyFunction } from "../runtime/agencyFunction.js"; import { type CreatedToolDefinition } from "../runtime/createdTool.js"; import { type ResultValue } from "../runtime/result.js"; import type { PreparedFunctions } from "./agencyFunctions.js"; /** Each record points to the prepared program shared by its learning batch. */ export type LearnedRecord = { advertisedName: string; definition: CreatedToolDefinition; programIndex: number; exportName: string; options: Record; }; /** The coordinator keeps this data together in one Agency global. */ export type LearnedState = { programs: PreparedFunctions[]; records: LearnedRecord[]; }; /** Extract only tools returned by learn. A module ID identifies one prepared * batch even after a checkpoint has copied its bound values into each tool. */ export declare function _learnedRecords(tools: AgencyFunction[]): LearnedState; export declare function _toolsFromRecords(state: LearnedState, executePrepared: AgencyFunction): AgencyFunction[]; /** Validate the complete batch before the caller replaces its global. */ export declare function _addLearnedRecords(current: LearnedState, candidates: LearnedState, offeredNames: string[], maxNameLength: number): ResultValue;