import type { PermissionRule } from "./types.js"; export declare function isObject(value: unknown): value is Record; export declare function getNestedValue(value: unknown, path: string[]): unknown; export declare function unwrapData(response: unknown): T; export declare function asString(value: unknown): string | undefined; /** * Extract the text content of the last assistant message from an array of * session messages. * * Searches backward from the end of the array. The first message whose role * is `"assistant"` (checked at `info.role` first, then top-level `role`) is * selected. Only parts with `type === "text"` are included; their `text` * values are concatenated with an empty separator and trimmed. * * Returns `""` when no assistant message is found or the message has no text * parts. */ export declare function extractAssistantText(messages: unknown[]): string; export declare function getPromptToolCompatibility(permissionRules: PermissionRule[]): Record | undefined; export declare function stableStringify(value: unknown): string; export declare function makeToolSignature(toolName: string, args: unknown): string; export declare function buildPromptText(args: { description: string; prompt: string; category?: string; scope?: string; constraints?: string[]; guidanceText?: string; agent?: string; requiredTools?: string[]; mustNotDo?: string[]; sessionContext?: string; }): string; /** * Extract text content from ALL assistant messages in an array, joined with newline. * * Unlike {@link extractAssistantText} which returns only the LAST assistant message, * this collects text from every assistant message — suitable for delegation result * extraction where the full assistant output is needed. */ export declare function extractAllAssistantText(messages: unknown[]): string; /** * Check whether assistant messages contain tool-use or other non-text work evidence. * * Used by delegation finalization to avoid erroring on "empty text" when the * assistant has been actively calling tools (tool_use, tool_result, or other * non-text part types indicate productive work even if no text was emitted). * * @param messages - Array of session messages (same shape as extractAllAssistantText). * @returns `true` if any assistant message contains at least one non-text part, * indicating tool-use or other work evidence. */ export declare function hasAssistantWorkEvidence(messages: unknown[]): boolean; /** * Convert an unknown error value to a human-readable string message. */ export declare function describeError(error: unknown): string; /** * Deep merge two objects recursively. * Arrays are replaced (not merged) unless specified. * Primitives are overwritten by source. * * @param target - The target object to merge into. * @param source - The source object to merge from. * @returns The merged object. */ export declare function deepMerge>(target: T, source: Partial): T; //# sourceMappingURL=helpers.d.ts.map