import type { FileChange } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
/** Return value of {@link useFileChangeContent}. */
export interface UseFileChangeContentReturn {
    /**
     * Before-side text for diffing. `""` for an absent side (e.g. CREATE has no
     * before). `null` while an offloaded side is in-flight or failed to load.
     */
    readonly beforeText: string | null;
    /**
     * After-side text for diffing. `""` for an absent side (e.g. DELETE has no
     * after). `null` while an offloaded side is in-flight or failed to load.
     */
    readonly afterText: string | null;
    /** `true` when either side is binary — render "binary file changed", not a diff. */
    readonly isBinary: boolean;
    /** `true` while an offloaded side's content request is in flight. */
    readonly isLoading: boolean;
    /** Error from a failed offloaded-side fetch, or `null`. */
    readonly error: Error | null;
    /**
     * `true` when an offloaded side exceeded the server's content-size limit and
     * was truncated — the inline diff would be incomplete; offer {@link downloadUrl}.
     */
    readonly isTruncated: boolean;
    /**
     * Direct download URL for an offloaded side (the after side preferred), used
     * as the fallback when content is truncated. `null` when neither side is offloaded.
     */
    readonly downloadUrl: string | null;
}
/**
 * Behavior hook that resolves a {@link FileChange}'s before/after sides to the
 * text the diff renderer needs.
 *
 * Small bodies are carried inline on the proto and returned with zero cost.
 * Large bodies were offloaded to artifact storage by the runner
 * (`FileContent.ref`); this hook lazily fetches them via
 * {@link useArtifactContent} through the server proxy (CORS-safe). The fetch's
 * `executionId` is derived from the ref's own `storageKey`
 * (`artifacts/{executionId}/...`), so a net diff whose two sides originated in
 * different executions still resolves each side correctly.
 *
 * This is the single place offload refs are dereferenced — the SDK's
 * `tool-view` deliberately stays fetch-free, deferring all ref handling here.
 *
 * Rules-of-hooks safe: both sides always issue a (possibly skipped)
 * `useArtifactContent` call; inline/absent sides pass `null` and never fetch.
 *
 * @param change - The file change whose content to resolve.
 *
 * @see useSessionFileChanges — produces the changes this resolves
 * @see FileChangeDiff — renders the resolved content
 */
export declare function useFileChangeContent(change: FileChange): UseFileChangeContentReturn;
/**
 * Extracts the execution id from an artifact storage key of the form
 * `artifacts/{executionId}/...`. Returns `null` for an unexpected shape so the
 * caller skips the fetch rather than issuing a request the server would reject.
 */
export declare function execIdFromStorageKey(storageKey: string): string | null;
//# sourceMappingURL=useFileChangeContent.d.ts.map