/** * composition/compile.ts * * Implements `skaile rebuild ` — re-snapshots all inline-snapshot items, * bumps the prompt version, and writes `/compile_manifest.json`. * * The compile manifest records what was resolved and when, so the runner can * verify content hasn't drifted without a rebuild. */ import type { AgentComposeItem } from "@skaile/workspaces/types/manifests"; import { type CompileManifest } from "./types.js"; /** * Filename for the agent compile manifest written by `skaile rebuild`. * * @docLink packages/runner/capabilities#compile-composition */ export declare const COMPILE_MANIFEST_FILENAME = "compile_manifest.json"; /** * Options for {@link compileComposition}. * * @docLink packages/runner/capabilities#compile-composition */ export interface CompileOpts { /** Path to the agent directory (where agent.yaml and compile_manifest.json live) */ agentDir: string; /** The agent's composes: items */ items: AgentComposeItem[]; /** * Content loader — given an asset ref + kind, returns the content text. * Returns null if the content cannot be loaded. */ loadContent: (ref: string, kind: string) => Promise; /** * Version extractor — given an asset ref, returns the resolved version string. * Returns null if unknown. */ resolveVersion?: (ref: string) => Promise; } /** * Result returned by {@link compileComposition}. * * @docLink packages/runner/capabilities#compile-composition */ export interface CompileResult { /** The written compile manifest */ manifest: CompileManifest; /** Path to the written file */ manifestPath: string; /** Number of entries that were successfully resolved */ resolvedCount: number; /** Warnings for unresolvable items */ warnings: string[]; } /** * Compile (rebuild) the agent's composition. * * 1. Reads existing compile_manifest.json (if present) for version continuity * 2. Re-resolves ALL items (both snapshot and non-snapshot get recorded) * 3. Bumps prompt_version * 4. Writes compile_manifest.json * * @param opts - Compile options including agentDir, items, and content loader. * @returns A {@link CompileResult} with the written manifest and any warnings. * @docLink packages/runner/capabilities#compile-composition */ export declare function compileComposition(opts: CompileOpts): Promise; /** * Load an existing compile_manifest.json, or return undefined if not found. * * @param manifestPath - Absolute path to the manifest file. * @returns The parsed {@link CompileManifest} or `undefined` when missing or malformed. * @docLink packages/runner/capabilities#load-compile-manifest */ export declare function loadCompileManifest(manifestPath: string): Promise; /** * Load compile manifest from an agent directory, reading the file from * `/compile_manifest.json`. * * @param agentDir - Absolute path to the agent definition directory. * @returns The parsed {@link CompileManifest} or `undefined` when missing or malformed. * @docLink packages/runner/capabilities#load-compile-manifest-from-dir */ export declare function loadCompileManifestFromDir(agentDir: string): Promise; //# sourceMappingURL=compile.d.ts.map