/** * composition/resolve.ts * * Resolves an agent's `composes:` items against the Library into a * ResolvedComposition — prompt blocks for inline items and discoverable * entries for tool-list items. * * Three resolution paths per binding: * - `inline-snapshot`: reads frozen content from compile_manifest.json * - `inline-live`: reads current content from Library (per invocation) * - `discoverable`: registers as a capability (name + description + content) * * This module is pure logic — no IO beyond the IAssetIndex calls. */ import type { IAssetIndex } from "@skaile/workspaces/library"; import type { AgentComposeItem } from "@skaile/workspaces/types/manifests"; import { type CompileManifest, type ResolvedComposition } from "./types.js"; /** * Options for {@link resolveComposition}. * * @docLink packages/runner/capabilities#resolve-composition */ export interface ResolveCompositionOpts { /** The agent's composes: items */ items: AgentComposeItem[]; /** Library for asset resolution */ library: IAssetIndex; /** * Pre-loaded compile manifest for inline-snapshot items. * If absent, inline-snapshot items fall back to live resolution with a warning. */ compileManifest?: CompileManifest; /** * Content loader — given an asset ref, returns the asset's prompt-injectable content. * For skill: the SKILL.md body. For persona/ruleset: the manifest body text. * Returns null if the content cannot be loaded. */ loadContent: (ref: string, kind: string) => Promise; } /** * Resolve all composition items for an agent. * * Returns: * - inlineBlocks: content to inject into the system prompt * - discoverableEntries: items to register as LLM-visible capabilities * - warnings: non-fatal issues encountered during resolution * * @param opts - Resolution options with items, library, optional compile manifest and content loader. * @returns A {@link ResolvedComposition} with inline blocks, discoverable entries, and warnings. * @docLink packages/runner/capabilities#resolve-composition */ export declare function resolveComposition(opts: ResolveCompositionOpts): Promise; //# sourceMappingURL=resolve.d.ts.map