/** * Pure utility functions for tool delegation. * * Extracted from tool-delegation.ts to satisfy the ≤500 LOC gate (GA-4). * These are stateless pure functions with no class dependencies. * * @module session-tracker/tool-delegation-utils */ /** * Returns safe, pruned tool input metadata for child-session JSON journeys. * * @param tool - Tool name. * @param args - Raw tool args. * @returns Pruned metadata matching the main-session markdown capture policy. */ export declare function pruneToolInput(tool: string, args: unknown): Record; /** * Returns safe, pruned output metadata for child-session JSON journeys. * * @param tool - Tool name. * @param output - Raw tool output. * @param metadata - Raw tool metadata. * @returns Pruned output metadata. */ export declare function pruneToolOutput(tool: string, output: unknown, metadata: unknown): Record; /** * Extracts a task session ID from task tool output or direct values. * * @param value - Raw output or task ID value. * @returns Extracted session ID, or undefined. */ export declare function extractTaskID(value: unknown): string | undefined; /** * Extracts completed child-session content from a task tool result. * * @param value - Raw task tool output. * @param taskID - Child task/session identifier to remove from the payload. * @returns Result content, or undefined for dispatch-only output. */ export declare function extractTaskResult(value: unknown, taskID: string): string | undefined; /** * Derives a subagent type string from session metadata with fallback chain. * * Priority: * 1. Parse from session title via naming service (most authoritative) * 2. Explicit subagentType param (if not "unknown") * 3. Agent name (if not "unknown") * 4. "unknown" (last resort) * * @param sessionTitle - Optional session title to parse. * @param explicitSubagentType - Optional explicit subagent type. * @param agent - Optional agent name. * @returns Derived subagent type string. */ export declare function deriveSubagentType(sessionTitle?: string, explicitSubagentType?: string, agent?: string): string; /** * Derives an agent name from session metadata by parsing the session title. * * @param input - Record containing title or sessionTitle. * @returns Parsed agent name, or undefined if not parseable. */ export declare function deriveAgentNameFromSession(input: Record): string | undefined; /** * Safely narrows an unknown value to a record. * * @param value - Unknown value to inspect. * @returns The value as a record, or an empty object. */ export declare function asRecord(value: unknown): Record; //# sourceMappingURL=tool-delegation-utils.d.ts.map