import type { string_agent_url } from '../../types/string_agent_url'; import type { string_book } from './string_book'; import type { AgentReferenceResolver } from './AgentReferenceResolver'; /** * Shared options for resolving one agent source with inheritance and imports applied. * * @private internal utility of agent source resolution */ export type ResolveInheritedAgentSourceOptions = { /** Current recursion depth, forwarded to the source importer. */ readonly recursionLevel?: number; /** * The URL of the Adam agent to use as the default ancestor * * @default 'https://core.ptbk.io/agents/adam' */ readonly adamAgentUrl?: string_agent_url; /** * Custom resolver used to expand compact agent references. */ readonly agentReferenceResolver?: AgentReferenceResolver; /** * Canonical URL of the currently resolved agent. */ readonly currentAgentUrl?: string_agent_url; /** * Additional equivalent URLs that should be treated as the current agent while detecting cycles. */ readonly currentAgentAliases?: ReadonlyArray; /** * Already visited agent URLs in the current resolution stack. */ readonly inheritancePath?: ReadonlyArray; /** * Source importer supplied by the host application. */ readonly agentSourceImporter: AgentSourceImporter; }; /** * Context passed to a custom agent source importer. * * @private internal utility of agent source resolution */ export type AgentSourceImporterContext = { /** * Commitment that requested the imported source. */ readonly commitmentType: 'FROM' | 'IMPORT'; /** * Import options propagated from the current resolution pass. */ readonly importAgentOptions: { readonly recursionLevel?: number; readonly inheritancePath?: ReadonlyArray; }; }; /** * Loads and recursively resolves one referenced agent using the caller's transport. * * @private internal utility of agent source resolution */ export type AgentSourceImporter = (agentUrl: string_agent_url, context: AgentSourceImporterContext) => Promise; /** * Resolves agent source with inheritance (FROM commitment) * * It recursively fetches the parent agent source and merges it with the current source. * * @param agentSource The initial agent source * @returns The resolved agent source with inheritance applied * * @private internal utility of agent source resolution */ export declare function resolveInheritedAgentSource(agentSource: string_book, options: ResolveInheritedAgentSourceOptions): Promise;