import type { AdvisorDefinition, AdvisoryBudget } from '../types/advisory/config.js'; import type { AdvisoryRequest, AdvisoryResult } from '../types/advisory/result.js'; import type { CostInfo, TokenUsage } from '../types/common/index.js'; import { type Message } from '../types/message/index.js'; import type { LLMToolSchema } from '../types/tool/index.js'; import { type Logger } from '../utils/logger.js'; /** One successfully dispatched SDK request and the records appended after it. */ export interface AdvisoryTurnContext { readonly iteration: number; /** Isolated at dispatch, including request-only evidence; not provider wire bytes. */ readonly requestMessages: readonly Message[]; /** Starts with that request's assistant response; may include tools and newer input. */ readonly subsequentMessages: readonly Message[]; } export interface AdvisoryCallContext { readonly messages: Message[]; /** Optional exact-turn trajectory, preferred over the canonical history projection. */ readonly turn?: AdvisoryTurnContext; readonly workingStateSummary?: string; readonly toolCatalog?: LLMToolSchema[]; readonly iteration: number; } export interface AdvisoryExecutionResult { readonly result: AdvisoryResult; readonly usage: TokenUsage; readonly cost: CostInfo; readonly durationMs: number; } export declare class AdvisoryExecutor { private readonly logger; private readonly budget; private readonly signal; constructor(logger?: Logger, budget?: AdvisoryBudget, signal?: AbortSignal); /** * The response ceiling for one call: the tighter of what the advisor * asks for and what the budget allows. An advisor that names no ceiling * still gets the budget's, which is the whole point of a per-call cap. */ private responseTokenCeiling; consult(advisor: AdvisorDefinition, request: AdvisoryRequest, callCtx: AdvisoryCallContext): Promise; private buildSystemPrompt; private describeAdvisor; private buildContext; /** * Cost for one call, from the advisor's own pricing, then the catalogue. * * When neither has a rate this reports the tokens as UNPRICED rather than * as a cost of zero. The previous version returned a zero rate card and a * zero total, defended on the grounds that a cost CAP over unpriced * advisors is refused at construction so nothing enforces against it — true * of the cap, and beside the point for the reader. `AdvisoryResult.cost` is * reported to the host, and `$0.00` for a call that cost real money is the * exact defect this change exists to remove; it does not become acceptable * because the number happens to be unenforced. */ private computeCost; } //# sourceMappingURL=executor.d.ts.map