/**
 * Artifact tools let the agent hand a renderable bundle to the web canvas.
 * The active transport decides whether that bundle updates the currently
 * scoped artifact entry or creates a new persisted artifact entry.
 */
import { Type as T } from 'typebox';
import { type ArtifactBundle } from '../../core/artifact-bundle.js';
import { type ArtifactInspectOptions, type ArtifactInspectionResult } from '../../services/artifact-render-export.js';
export interface ArtifactCallbackResult {
    repo: string;
    entityType: 'artifact';
    entityId: string;
    action: 'created' | 'updated';
}
export interface ArtifactToolTarget {
    repo?: string;
    entityId?: string;
}
/** Optional concurrency/safety controls threaded from `create_artifact` to the
 *  write callback. `baseHash` is the hash the agent received from `read_artifact`;
 *  the writer rejects the update if the current artifact's hash differs (someone
 *  else changed it since the read). `replace` opts out of the destructive-shrink
 *  guard for intentional blank/rewrite. `createNew` forces a fresh artifact
 *  entry even when the chat is scoped to one — without it a scoped chat has no
 *  path to a SECOND artifact (omitting target updates the scoped canvas, and a
 *  target must already exist). */
export interface ArtifactWriteOptions {
    baseHash?: string;
    replace?: boolean;
    createNew?: boolean;
}
export type ArtifactCallback = (bundle: ArtifactBundle, target?: ArtifactToolTarget, options?: ArtifactWriteOptions) => void | ArtifactCallbackResult | Promise<void | ArtifactCallbackResult>;
/** What `read_artifact` hands back: the parsed bundle plus the hash + timestamp
 *  the agent passes to `create_artifact` as `baseHash` for stale-write detection. */
export interface ArtifactReadResult {
    bundle: ArtifactBundle;
    hash: string;
    updatedAt?: string;
}
export type ArtifactReadCallback = (target?: ArtifactToolTarget) => ArtifactReadResult | Promise<ArtifactReadResult>;
/** Stable content hash of an artifact's stored body STRING (not the parsed
 *  bundle), so `read_artifact` and the write-time guard hash the exact same
 *  serialization — no canonicalization, no false mismatches from key reordering. */
export declare function hashArtifactBody(body: string): string;
export interface ArtifactToolOptions {
    readArtifact?: ArtifactReadCallback | null;
    inspectArtifact?: (bundle: ArtifactBundle, options?: ArtifactInspectOptions) => Promise<ArtifactInspectionResult>;
}
export declare function createArtifactTools(onArtifact?: ArtifactCallback | null, options?: ArtifactToolOptions): ({
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        bundle: T.TObject<{}>;
        target: T.TOptional<T.TObject<{
            repo: T.TOptional<T.TString>;
            entityId: T.TOptional<T.TString>;
        }>>;
        baseHash: T.TOptional<T.TString>;
        replace: T.TOptional<T.TBoolean>;
        createNew: T.TOptional<T.TBoolean>;
    }>;
    execute: (_toolCallId: string, params: {
        bundle?: unknown;
        target?: ArtifactToolTarget;
        baseHash?: string;
        replace?: boolean;
        createNew?: boolean;
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
} | {
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        bundle: T.TOptional<T.TObject<{}>>;
        target: T.TOptional<T.TObject<{
            repo: T.TOptional<T.TString>;
            entityId: T.TOptional<T.TString>;
        }>>;
        context: T.TOptional<T.TUnion<[T.TLiteral<"editor">, T.TLiteral<"fullscreen">]>>;
        frameSelector: T.TOptional<T.TString>;
        frameIndexes: T.TOptional<T.TArray<T.TNumber>>;
        maxFrames: T.TOptional<T.TNumber>;
        includePageScreenshot: T.TOptional<T.TBoolean>;
        includeFrameScreenshots: T.TOptional<T.TBoolean>;
        screenshotFormat: T.TOptional<T.TUnion<[T.TLiteral<"jpeg">, T.TLiteral<"png">]>>;
    }>;
    execute: (_toolCallId: string, params: {
        bundle?: unknown;
        target?: ArtifactToolTarget;
        context?: "editor" | "fullscreen";
        frameSelector?: string;
        frameIndexes?: number[];
        maxFrames?: number;
        includePageScreenshot?: boolean;
        includeFrameScreenshots?: boolean;
        screenshotFormat?: "png" | "jpeg";
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    } | {
        content: ({
            type: "image";
            data: string;
            mimeType: "image/jpeg" | "image/png";
        } | {
            type: "text";
            text: string;
        })[];
        details: {
            success: true;
            inspection: Record<string, unknown>;
        };
    }>;
} | {
    name: string;
    label: string;
    description: string;
    parameters: T.TObject<{
        target: T.TOptional<T.TObject<{
            repo: T.TOptional<T.TString>;
            entityId: T.TOptional<T.TString>;
        }>>;
    }>;
    execute: (_toolCallId: string, params: {
        target?: ArtifactToolTarget;
    }) => Promise<{
        content: {
            type: "text";
            text: string;
        }[];
        details: any;
    }>;
})[];
