/** * Framework fragments — conditional system prompt sections injected by the * agent renderer at install time. * * Each fragment explains a specific aspect of the agent framework to the agent. * Fragments are conditional (return null when context is empty) and overridable * per project via skaile.yaml `agent.fragments`. */ /** * A skill installed into the agent's ability directory, referenced in the system prompt. * * @docLink packages/asset-manager/api-reference#fragments */ export interface AbilityRef { /** Skill name used as the slash command (e.g. `"code-review"`). */ name: string; /** One-line description shown in the `## Installed Abilities` section. */ description: string; } /** * A contract file installed alongside skills, referenced by path in the system prompt. * * @docLink packages/asset-manager/api-reference#fragments */ export interface ContractRef { /** Contract name for display purposes. */ name: string; /** Path relative to workspace root, e.g. `".claude/skills/iron-laws/CONTRACT.md"`. */ relativePath: string; } /** * A data connector declared in `skaile.yaml` resources. * * @docLink packages/asset-manager/api-reference#fragments */ export interface ConnectorRef { /** Connector ID as declared in `skaile.yaml`. */ id: string; /** Connector driver type (e.g. `"postgres"`, `"redis"`, `"sqlite"`). */ driver: string; /** Declared access level (`"read-only"` or `"read-write"`). */ access: string; } /** * Context passed to each fragment function at render time. * * @docLink packages/asset-manager/api-reference#fragments */ export interface FragmentContext { /** Agent framework ID (e.g. `"claude-code"`, `"omp"`, `"codex"`). */ framework: string; /** Relative path to the framework's skill/ability directory, e.g. `".claude/skills"`. */ skillsDir: string; /** Relative path to the framework's agent directory, e.g. `".claude/agents"`. */ agentsDir: string; /** Sub-agent names from `manifest.requires[]`. */ subAgents: string[]; /** Connectors declared in `skaile.yaml`. */ connectors: ConnectorRef[]; /** Resolved ability refs (installed skills). */ abilityRefs: AbilityRef[]; /** Resolved contract refs (installed alongside skills). */ contractRefs: ContractRef[]; } /** * Identifier for a built-in system prompt fragment. * - `"agent-mode"` — describes whether the agent is a sole agent or an orchestrator. * - `"handoff"` — delegation guidelines injected when sub-agents are declared. * - `"skill-discovery"` — skill directory location injected when abilities are installed. * - `"connector-usage"` — connected resources list injected when connectors are declared. * * @docLink packages/asset-manager/api-reference#fragments */ export type FragmentId = "agent-mode" | "handoff" | "skill-discovery" | "connector-usage"; /** * Registry of all built-in fragment functions keyed by {@link FragmentId}. * * Each function receives a {@link FragmentContext} and returns the fragment markdown * to inject, or `null` when the fragment's condition is not met (e.g. `"handoff"` * returns `null` when there are no sub-agents). * * @docLink packages/asset-manager/api-reference#fragments */ export declare const BUILT_IN_FRAGMENTS: Record string | null>; /** * Resolve all framework fragments for the rendered system prompt. * * Applies per-project overrides from `skaile.yaml` `agent.fragments`: * - `true` / absent → include built-in fragment (default) * - `false` → omit fragment * - `string` → load markdown from path relative to `workspaceRoot` * * @param ctx - Fragment context built from the agent manifest and workspace config. * @param overrides - Per-project overrides map from `skaile.yaml` `agent.fragments`. * @param workspaceRoot - Absolute path to the workspace root (for resolving custom fragment paths). * @returns Ordered list of resolved fragment markdown strings to inject into the system prompt. * @docLink packages/asset-manager/api-reference#fragments */ export declare function resolveFragments(ctx: FragmentContext, overrides: Record | undefined, workspaceRoot: string): string[]; /** * Load prompt-extension files declared under `skaile.yaml` `agent.prompt-extensions`. * * Paths are relative to `workspaceRoot`. Missing files are silently skipped. * * @param paths - Array of relative file paths from `skaile.yaml` `agent.prompt-extensions`. * @param workspaceRoot - Absolute path to the workspace root. * @returns Non-empty content strings for each file that exists and is non-empty. * @docLink packages/asset-manager/api-reference#fragments */ export declare function loadPromptExtensions(paths: string[] | undefined, workspaceRoot: string): string[]; //# sourceMappingURL=fragments.d.ts.map