/** * Shared thinking (reasoning effort) level type and helpers. * * Fabric resolves a thinking level per run (explicit call/actor value, else the * Fabric default, "medium"). Pi receives it via "--thinking" and clamps it to * the model's supported levels using next-highest fallback (see pi-ai * clampThinkingLevel). Claude receives it via "--effort"; off/minimal map to * low. Fabric itself only selects the requested/default level. */ export type FabricThinking = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; /** Fabric-wide default thinking level, used when a call/actor omits one. */ export declare const DEFAULT_FABRIC_THINKING: FabricThinking; /** Ordered lowest -> highest; matches pi-ai's EXTENDED_THINKING_LEVELS. */ export declare const THINKING_LEVELS: readonly FabricThinking[]; /** Type guard for a Fabric thinking level value (config, CLI args, JSON). */ export declare const isFabricThinking: (value: unknown) => value is FabricThinking; /** Human-readable label for a thinking level (shown in pickers and settings). */ export declare const thinkingLabel: (level: FabricThinking) => string; /** * Inclusive thinking-level bounds. An absent end is unbounded on that side * (the active model's levels decide). Bounds only ever narrow across process * boundaries: a child intersects its own configuration with the parent's * bounds received through PI_FABRIC_THINKING_BOUNDS. */ export interface FabricThinkingBounds { min?: FabricThinking; max?: FabricThinking; } /** Environment variable carrying a parent's effective bounds into a Pi child. */ export declare const FABRIC_THINKING_BOUNDS_ENV = "PI_FABRIC_THINKING_BOUNDS"; /** Session custom entry recording the active Fabric thinking override. */ export declare const FABRIC_THINKING_ENTRY_TYPE = "pi-fabric-thinking"; export declare const thinkingRank: (level: FabricThinking) => number; /** * Validate a bounds object from configuration, arguments, or the environment. * Unknown keys, unknown level names and inverted ranges are rejected: bounds * are a ceiling policy, so a malformed value fails closed instead of widening. */ export declare const normalizeThinkingBounds: (value: unknown, where: string) => FabricThinkingBounds; /** * Narrow `outer` by `inner` without ever widening it. When the two ranges do * not overlap the outer (parent) range wins unchanged: it is the cost policy. */ export declare const intersectThinkingBounds: (outer: FabricThinkingBounds, inner: FabricThinkingBounds) => FabricThinkingBounds; /** * True when every explicit end of `inner` lies inside `outer`. An omitted end * inherits the outer end, so `{min:"low"}` fits inside `{max:"high"}`. */ export declare const thinkingBoundsWithin: (inner: FabricThinkingBounds, outer: FabricThinkingBounds) => boolean; /** * Effective bounds for a child run: requested bounds must lie inside the * parent's (fail closed), then narrow them. No request inherits the parent. */ export declare const childThinkingBounds: (parent: FabricThinkingBounds, requested: FabricThinkingBounds | undefined) => FabricThinkingBounds; /** Clamp a level into inclusive bounds (no model knowledge). */ export declare const clampThinkingToBounds: (level: FabricThinking, bounds: FabricThinkingBounds) => FabricThinking; /** Levels allowed by bounds, optionally restricted to a model's supported levels. */ export declare const thinkingLevelsWithin: (bounds: FabricThinkingBounds, supported?: readonly FabricThinking[]) => FabricThinking[]; /** * Pick the allowed level for a request: clamp into bounds, then use pi-ai's * next-highest-then-lower fallback restricted to `allowed`. Undefined when * nothing is allowed. */ export declare const selectThinkingLevel: (requested: FabricThinking, allowed: readonly FabricThinking[]) => FabricThinking | undefined; /** Structural subset of a pi-ai Model; mirrors getSupportedThinkingLevels. */ export interface FabricThinkingModel { reasoning?: boolean; thinkingLevelMap?: Partial>; } /** * Supported levels for a model, matching pi-ai getSupportedThinkingLevels * without importing it (Fabric keeps pi-ai out of its eager graph). No model * means Pi offers every level. */ export declare const modelThinkingLevels: (model: FabricThinkingModel | undefined) => FabricThinking[]; /** Bounds inherited from a parent Fabric; malformed values throw (fail closed). */ export declare const inheritedThinkingBounds: (env?: NodeJS.ProcessEnv) => FabricThinkingBounds | undefined; /** Compact JSON for PI_FABRIC_THINKING_BOUNDS; undefined when unbounded. */ export declare const serializeThinkingBounds: (bounds: FabricThinkingBounds) => string | undefined; //# sourceMappingURL=thinking.d.ts.map