/** * C — Context engineering namespace. * * Controls what history and state data an agent sees. * Two categories: * - History-filtering: suppress/filter conversation history * - Data-injection: inject state without touching history * * Compose with .add() (union). Suppression wins: if ANY child suppresses, composite does. * * Usage: * agent.context(C.none()) // suppress all history * agent.context(C.window(5)) // last 5 turn-pairs * agent.context(C.none().add(C.fromState("key"))) // no history + inject state */ import type { State } from "../core/types.js"; /** A composable context transform descriptor. */ export declare class CTransform { readonly kind: string; readonly config: Record; readonly suppressHistory: boolean; readonly children: CTransform[]; constructor(kind: string, config?: Record, suppressHistory?: boolean, children?: CTransform[]); /** Compose: merge another context transform. Suppression wins. */ add(other: CTransform): CTransform; /** Alias for add() — reads better for data-injection transforms. */ inject(other: CTransform): CTransform; /** Pipe: apply a transform to the output of this one. */ pipe(other: CTransform): CTransform; } /** * C namespace — context engineering factories. * * All 33+ methods from the Python C namespace. */ export declare class C { /** Suppress all conversation history. */ static none(): CTransform; /** Default ADK behavior (keep all history). */ static default_(): CTransform; /** Only user messages. */ static userOnly(): CTransform; /** User messages with strategy selection. */ static user(strategy?: "all" | "last" | "first"): CTransform; /** Last N turn-pairs. */ static window(n?: number): CTransform; /** Alias for window(). */ static lastNTurns(n: number): CTransform; /** Include user + outputs from named agents. */ static fromAgents(...names: string[]): CTransform; /** Per-agent selective windowing. */ static fromAgentsWindowed(agentWindows: Record): CTransform; /** Exclude messages from named agents. */ static excludeAgents(...names: string[]): CTransform; /** Hard limit by turns or tokens. */ static truncate(opts: { maxTurns?: number; maxTokens?: number; strategy?: "head" | "tail"; }): CTransform; /** Filter events by metadata (author, type, tag). */ static select(opts: { author?: string; type?: string; tag?: string; }): CTransform; /** Keep only specified fields from messages. */ static project(...fields: string[]): CTransform; /** Inject state keys as context. */ static fromState(...keys: string[]): CTransform; /** Template with {key} placeholders (resolved from state). */ static template(text: string): CTransform; /** Inject scratchpad notes. */ static notes(key?: string, format?: "plain" | "markdown"): CTransform; /** Write to scratchpad notes. */ static writeNotes(opts?: { key?: string; strategy?: "append" | "replace"; sourceKey?: string; }): CTransform; /** Token budget constraint. */ static budget(opts: { maxTokens?: number; overflow?: "truncate_oldest" | "summarize" | "drop"; }): CTransform; /** Aggressive pruning to fit within a token limit. */ static fit(opts?: { maxTokens?: number; strategy?: "strict" | "soft"; }): CTransform; /** Priority tier for context ordering. */ static priority(tier?: number): CTransform; /** Importance-weighted by recency. */ static recent(opts?: { decay?: "exponential" | "linear"; halfLife?: number; minWeight?: number; }): CTransform; /** Prune stale items by age. */ static fresh(opts?: { maxAge?: number; staleAction?: "drop" | "summarize"; }): CTransform; /** Rolling window with optional compaction. */ static rolling(opts?: { n?: number; summarize?: boolean; }): CTransform; /** Remove duplicate messages. */ static dedup(strategy?: "exact" | "semantic"): CTransform; /** Structural compaction (remove empty tool calls, etc.). */ static compact(strategy?: "tool_calls" | "all"): CTransform; /** LLM-powered summarization. */ static summarize(opts?: { scope?: "all" | "oldest" | "tools"; prompt?: string; }): CTransform; /** Semantic relevance filtering. */ static relevant(opts?: { queryKey?: string; query?: string; topK?: number; }): CTransform; /** Extract structured data from context via LLM. */ static extract(opts?: { key?: string; }): CTransform; /** Distill context to key facts via LLM. */ static distill(opts?: { key?: string; }): CTransform; /** Context quality validation via LLM. */ static validate_(...checks: string[]): CTransform; /** Redact sensitive content via regex. */ static redact(patterns: string[], replacement?: string): CTransform; /** Conditional context transform. */ static when(predicate: (state: State) => boolean, transform: CTransform): CTransform; /** Manus-style cascading context: progressive compression. */ static manusCascade(opts?: { budget?: number; }): CTransform; /** Pipeline-aware: user messages + state keys (for pipeline agents). */ static pipelineAware(...keys: string[]): CTransform; /** Full transcript for multi-agent loops. */ static sharedThread(): CTransform; /** Include A2UI surface state in context. */ static withUi(surfaceId?: string): CTransform; } //# sourceMappingURL=context.d.ts.map