/** * Preset loading and application logic. * * Presets are curated agent collections stored in `/presets//`. * Each preset directory contains: * - `preset.json` — manifest with metadata and agent list * - `agents//charter.md` — agent charter files * * @module presets */ import type { PresetManifest, PresetApplyResult } from './types.js'; export type { PresetManifest, PresetAgent, PresetApplyResult } from './types.js'; /** * List all available presets from the squad home presets directory. * * @returns Array of preset manifests, or empty array if no presets found. */ export declare function listPresets(): PresetManifest[]; /** * Load a specific preset by name. * * @param name - Preset name (directory name under presets/). * @returns The preset manifest, or null if not found. */ export declare function loadPreset(name: string): PresetManifest | null; /** * Apply a preset — copy its agents into a target squad directory. * * By default, existing agents are skipped (not overwritten). * Pass `force: true` to overwrite existing agents. * * @param presetName - Name of the preset to apply. * @param targetDir - Target directory to install agents into (e.g. `.squad/agents/`). * @param options - Options for applying the preset. * @returns Array of results for each agent in the preset. */ export declare function applyPreset(presetName: string, targetDir: string, options?: { force?: boolean; overwriteRouting?: boolean; }): PresetApplyResult[]; /** * Install a preset into squad home from an external source directory. * Copies the preset directory into `/presets//`. * * @param sourceDir - Source directory containing preset.json and agents/. * @param name - Preset name (used as destination directory name). * @returns Path to the installed preset. */ export declare function installPreset(sourceDir: string, name: string): string; /** * Save the current project's squad agents as a reusable preset. * * Reads agents from the given squad directory (e.g. `.squad/agents/`), * generates a `preset.json` manifest, and copies everything into * `/presets//`. * * @param name - Name for the new preset. * @param squadDir - Path to the project's .squad/ directory containing agents/. * @param options - force: overwrite existing preset; description: preset description. * @returns Path to the saved preset directory. */ export declare function savePreset(name: string, squadDir: string, options?: { force?: boolean; description?: string; }): string; /** * Source descriptor for `installPresetFromSource`. * * A source is either: * - A local filesystem path to either a single preset dir (contains `preset.json`) * OR a `presets/` collection dir (contains multiple preset subdirs). * - A GitHub URL in one of these shapes (all shallow-cloned to a temp dir): * https://github.com/owner/repo[.git] * https://github.com/owner/repo[.git]#preset-name — install only this subdir under /presets/ * https://github.com/owner/repo/tree//path/to/preset — install only this subpath * git@github.com:owner/repo.git */ export interface InstallPresetOptions { /** Optional override for the installed preset name. Defaults to the source's preset name. */ name?: string; /** Overwrite existing preset if it exists. */ force?: boolean; } export interface InstallPresetResult { /** The name the preset was installed under. */ installedName: string; /** Absolute path of the installed preset dir under SQUAD_HOME. */ installedDir: string; /** Source the preset was installed from (verbatim from caller). */ source: string; } export declare function installPresetFromSource(source: string, options?: InstallPresetOptions): InstallPresetResult; /** * Get the path to the built-in presets that ship with the SDK. * These are bundled in the package under `presets/builtin/`. */ export declare function getBuiltinPresetsDir(): string; /** * Seed squad home with built-in presets if they don't already exist. * Only copies presets that are missing — never overwrites user presets. * * @returns Names of presets that were seeded. */ export declare function seedBuiltinPresets(): string[]; //# sourceMappingURL=index.d.ts.map