/** * GAP-PROMPT-001: Prompt Strata Model * GAP-PERF-005: Cache-Aware Prompt Assembly * * Classifies prompt parts into three strata (stable, runtime, turnLocal) * and provides strata-aware composition for cache optimization and * deterministic prompt assembly. * * @module prompts/strata */ import type { PromptContext, PromptPart, PromptStratum, StratumTaggedPart, ComposeByStrataOptions, StratumChecksums, ComposeByStrataWithMetaResult } from './types'; /** * Canonical stratum ordering: stable first (most cacheable), turnLocal last (most volatile). */ export declare const STRATUM_ORDER: readonly PromptStratum[]; /** * Factory for creating a StratumTaggedPart. */ export declare function tagPart(name: string, stratum: PromptStratum, render: PromptPart, volatilityScore?: number): StratumTaggedPart; /** * Map of all known prompt parts to their stratum classification. * * STABLE (11): System identity, core rules, tool definitions — rarely change. * RUNTIME (13): Capabilities, flags, workspace context — change per session. * TURN_LOCAL (6): Interview, user profile, task-specific — change every turn. * * Volatility scores (0=most stable, 100=most volatile) control intra-stratum * ordering for cache-prefix optimization (GAP-PERF-005). */ export declare const PART_STRATA_MAP: Record; /** * Filter PART_STRATA_MAP by stratum. */ export declare function getPartsForStratum(stratum: PromptStratum): StratumTaggedPart[]; /** * Compose prompt parts grouped by stratum in canonical order. * * Parts are grouped into stable -> runtime -> turnLocal sections. * Empty parts are skipped. Empty strata groups are omitted entirely. * When `showStrata` is true, stratum header labels are prepended to each group. * * GAP-PERF-005: Parts within each stratum are sorted by volatilityScore * ascending (most stable first) unless sortByVolatility is explicitly false. */ export declare function composeByStrata(taggedParts: StratumTaggedPart[], ctx: PromptContext, options?: ComposeByStrataOptions): string; /** * GAP-PERF-005: Compose prompt parts with strata metadata for cache optimization. * * Returns both the composed output and per-stratum SHA256 checksums. * Checksums enable cache-break detection between iterations. */ export declare function composeByStrataWithMeta(taggedParts: StratumTaggedPart[], ctx: PromptContext, options?: ComposeByStrataOptions): ComposeByStrataWithMetaResult; /** * GAP-PERF-005: Detect which strata changed between two compositions. * * Returns an array of strata whose checksums differ (including strata * that are newly added or removed between prev and next). */ export declare function detectStratumChanges(prev: StratumChecksums, next: StratumChecksums): PromptStratum[]; export type CacheControlType = 'ephemeral' | undefined; export interface CacheHintedBlock { content: string; stratum: PromptStratum; cache_control?: { type: 'ephemeral'; }; } export declare function stratumToCacheControl(stratum: PromptStratum): CacheControlType; export declare function composeWithCacheHints(taggedParts: StratumTaggedPart[], ctx: PromptContext, options?: ComposeByStrataOptions): CacheHintedBlock[]; export declare function shouldApplyCacheControl(prevChecksums: StratumChecksums | undefined, nextChecksums: StratumChecksums, stratum: PromptStratum): boolean; //# sourceMappingURL=strata.d.ts.map