import { HandoffFilter, HandoffInputFilterDescriptor, Sensitivity } from "@graphorin/core"; //#region src/filters/index.d.ts /** * A `HandoffFilter` paired with the serializable descriptor that * round-trips through the JSONL session export. Authors of custom * filters return one of these via `filters.custom({...})`. * * @stable */ interface DescribedFilter extends HandoffFilter { readonly descriptor: HandoffInputFilterDescriptor; } /** * Keep the parent's system prompt and the last `n` non-system * messages. Default `n = 10` per the DEC-146 security-first * compose. * * @stable */ declare function lastN(n?: number): DescribedFilter; /** * Keep only the parent's system prompt and the most recent user * message. Useful for simple sub-agents that only need the question. * * @stable */ declare function lastUser(): DescribedFilter; /** * The full unfiltered history. Discouraged - security-conscious * callers should pick {@link lastN} or {@link bySensitivity} instead * (a sub-agent rarely needs the parent's entire conversation). * * @stable */ declare function full(): DescribedFilter; /** * Replace the parent's history with a single system message carrying * the supplied summary. Used by callers that wire in an LLM-based * summarizer outside the framework. * * @stable */ declare function summary(text: string): DescribedFilter; /** * Drop messages that carry the literal `[REDACTED:secret]` redaction * token when `maxTier` sits below `'secret'`. * * WEAK CONTRACT - read before relying on it at a trust * boundary: `MessageContent` has NO part-level sensitivity / * `secret` / `inboundTrust` annotation in the current surface, so * this filter can only key on the redaction token the framework's * redaction layer stamps into text. Content that was never * redaction-stamped - an annotated-elsewhere secret, plaintext * credentials the model echoed - passes through untouched. It is a * best-effort hygiene filter, NOT a sensitivity gate; do not treat a * sub-agent handoff filtered by it as a secrecy boundary. Operators * that need a real gate must scrub content upstream (redaction * middleware, `withRedaction`) or compose a custom predicate over * their own metadata. * * @stable */ declare function bySensitivity(args?: { readonly maxTier?: Sensitivity; }): DescribedFilter; /** * Strip every `ReasoningContent` part from each message. Always * applied at the handoff boundary (the `compose(...)` helper appends * this filter automatically). * * @stable */ declare function stripReasoning(): DescribedFilter; /** * Strip tool messages whose `content` carries a literal * `[REDACTED:` redaction token - ANY redaction tier trips it, not * only `secret`. There is no `secret` annotation on * the message surface in the current slice; the token stamped by the * redaction layer at session-write time is the only signal this * filter scans, so an output that was never redaction-stamped passes * through. Same weak-contract caveat as {@link bySensitivity}. * * @stable */ declare function stripSensitiveOutputs(): DescribedFilter; /** * Drop every assistant `toolCalls` array AND every `tool` message. * Useful when a sub-agent should only see the textual conversation. * * @stable */ declare function stripToolCalls(): DescribedFilter; /** * Compose multiple filters left-to-right. The composer **always** * appends `stripReasoning()` at the end so reasoning content never * crosses a handoff boundary regardless of caller intent. * * @stable */ declare function compose(...filters: ReadonlyArray): DescribedFilter; /** * Wrap a caller-supplied function as a {@link DescribedFilter} with * the canonical `'custom'` descriptor. * * @stable */ declare function custom(fn: HandoffFilter, meta?: Readonly>): DescribedFilter; /** * The canonical default applied by the agent runtime to every * `Agent.toTool(...)` and `handoff(...)` invocation when the caller * does not supply an explicit filter. * * @stable */ declare function defaultHandoffFilter(): DescribedFilter; /** * Pure `HandoffInputFilterDescriptor` for callers that just need the * descriptor without instantiating the runtime function (e.g. the * sessions package's lenient-forward-parse path). * * @stable */ declare const FILTER_KIND_CUSTOM: HandoffInputFilterDescriptor; /** Aggregate module export. */ declare const filters: { lastN: typeof lastN; lastUser: typeof lastUser; full: typeof full; summary: typeof summary; bySensitivity: typeof bySensitivity; stripReasoning: typeof stripReasoning; stripSensitiveOutputs: typeof stripSensitiveOutputs; stripToolCalls: typeof stripToolCalls; compose: typeof compose; custom: typeof custom; defaultHandoffFilter: typeof defaultHandoffFilter; }; //#endregion export { DescribedFilter, FILTER_KIND_CUSTOM, bySensitivity, compose, custom, defaultHandoffFilter, filters, full, lastN, lastUser, stripReasoning, stripSensitiveOutputs, stripToolCalls, summary }; //# sourceMappingURL=index.d.ts.map