import { ItemDescriptor } from "../pageModel";
import { ExecutionResult } from "./serviceHelper";
export type TemplateBuilderFieldRequest = {
    name: string;
    type: string;
    source?: string;
    shared?: boolean;
    unversioned?: boolean;
    validation?: string;
    title?: string;
    shortDescription?: string;
    sortOrder?: string;
    defaultValue?: string;
};
export type TemplateBuilderSectionRequest = {
    name: string;
    fields: TemplateBuilderFieldRequest[];
};
export type TemplateBuilderCreateRequest = {
    parent: ItemDescriptor;
    name: string;
    icon?: string;
    baseTemplateIds: string[];
    sections: TemplateBuilderSectionRequest[];
    createStandardValues: boolean;
    openStandardValues: boolean;
};
export type TemplateBuilderValidationResponse = {
    success: boolean;
    errors: string[];
};
export type TemplateBuilderCreateResponse = {
    template?: ItemDescriptor;
    standardValues?: ItemDescriptor;
    warnings?: string[];
};
export type TemplateBuilderLoadRequest = {
    template: ItemDescriptor;
};
export type TemplateBuilderLoadResponse = {
    template: ItemDescriptor;
    parent?: ItemDescriptor;
    name: string;
    icon?: string;
    baseTemplateIds: string[];
    sections: TemplateBuilderSectionRequest[];
    hasStandardValues: boolean;
};
export type TemplateBuilderUpdateRequest = {
    template: ItemDescriptor;
    /** When set, renames the template item (must be unique among siblings). */
    name?: string;
    icon?: string;
    baseTemplateIds: string[];
    sections: TemplateBuilderSectionRequest[];
    createStandardValues: boolean;
};
export type TemplateBuilderFieldTypeGroup = {
    name: string;
    types: string[];
};
export type TemplateBuilderSkill = {
    id: string;
    name: string;
};
export declare const TEMPLATE_BUILDER_AGENT_PROFILE_ID = "6f7a5e6e-0b6d-4f2d-bcc0-8b8bc3ef5374";
export declare const TEMPLATE_BUILDER_AGENT_PROFILE_NAME = "Template Builder";
export type TemplateBuilderAgentState = {
    mode: "create" | "edit";
    templateName: string;
    template?: ItemDescriptor;
    parent?: ItemDescriptor;
    baseTemplates: Array<{
        id: string;
        name: string;
        path?: string;
        icon?: string;
    }>;
    sections: Array<{
        name: string;
        fields: TemplateBuilderFieldRequest[];
    }>;
};
export type TemplateBuilderAiBaseTemplateChange = {
    action: "add" | "remove";
    templateId?: string;
    templateName: string;
    templatePath?: string;
    reason?: string;
};
export type TemplateBuilderAiSectionChange = {
    action: "add";
    section: TemplateBuilderSectionRequest;
    reason?: string;
} | {
    action: "update";
    targetSectionName: string;
    section: Partial<TemplateBuilderSectionRequest>;
    reason?: string;
} | {
    action: "remove";
    targetSectionName: string;
    reason?: string;
};
export type TemplateBuilderAiFieldPatch = Partial<TemplateBuilderFieldRequest> & {
    name?: string;
    type?: string;
};
export type TemplateBuilderAiFieldChange = {
    action: "add";
    targetSectionName: string;
    field: TemplateBuilderFieldRequest;
    reason?: string;
} | {
    action: "update";
    targetSectionName: string;
    targetFieldName: string;
    field: TemplateBuilderAiFieldPatch;
    reason?: string;
} | {
    action: "remove";
    targetSectionName: string;
    targetFieldName: string;
    reason?: string;
};
export type TemplateBuilderAiSuggestion = {
    summary?: string;
    rationale?: string;
    baseTemplates?: TemplateBuilderAiBaseTemplateChange[];
    sections?: TemplateBuilderAiSectionChange[];
    fields?: TemplateBuilderAiFieldChange[];
};
export declare const TEMPLATE_BUILDER_SUGGESTION_SCHEMA_DESCRIPTION = "When you propose pending template changes, include exactly one fenced ```json code block containing an object with this shape:\n{\n  \"summary\": \"Short summary of the suggestion set\",\n  \"rationale\": \"Optional brief rationale\",\n  \"baseTemplates\": [\n    {\n      \"action\": \"add | remove\",\n      \"templateId\": \"optional Sitecore GUID\",\n      \"templateName\": \"Template name\",\n      \"templatePath\": \"optional Sitecore path\",\n      \"reason\": \"optional\"\n    }\n  ],\n  \"sections\": [\n    {\n      \"action\": \"add\",\n      \"section\": {\n        \"name\": \"Section name\",\n        \"fields\": [{ \"name\": \"Field name\", \"type\": \"Single-Line Text\" }]\n      },\n      \"reason\": \"optional\"\n    },\n    {\n      \"action\": \"update\",\n      \"targetSectionName\": \"Existing section name\",\n      \"section\": { \"name\": \"New section name\" },\n      \"reason\": \"optional\"\n    },\n    {\n      \"action\": \"remove\",\n      \"targetSectionName\": \"Existing section name\",\n      \"reason\": \"optional\"\n    }\n  ],\n  \"fields\": [\n    {\n      \"action\": \"add\",\n      \"targetSectionName\": \"Existing section name\",\n      \"field\": { \"name\": \"Field name\", \"type\": \"Single-Line Text\" },\n      \"reason\": \"optional\"\n    },\n    {\n      \"action\": \"update\",\n      \"targetSectionName\": \"Existing section name\",\n      \"targetFieldName\": \"Existing field name\",\n      \"field\": { \"name\": \"Optional new name\", \"type\": \"Optional new type\" },\n      \"reason\": \"optional\"\n    },\n    {\n      \"action\": \"remove\",\n      \"targetSectionName\": \"Existing section name\",\n      \"targetFieldName\": \"Existing field name\",\n      \"reason\": \"optional\"\n    }\n  ]\n}\n\nYou may also include normal explanatory text outside the json block. Only the JSON block is treated as pending changes.";
export declare function parseTemplateBuilderSuggestionText(text: string): TemplateBuilderAiSuggestion | null;
export declare function templateBuilderPreflight(request: TemplateBuilderCreateRequest): Promise<ExecutionResult<TemplateBuilderValidationResponse>>;
export declare function templateBuilderCreate(request: TemplateBuilderCreateRequest): Promise<ExecutionResult<TemplateBuilderCreateResponse>>;
export declare function templateBuilderGet(request: TemplateBuilderLoadRequest): Promise<ExecutionResult<TemplateBuilderLoadResponse>>;
export declare function templateBuilderUpdate(request: TemplateBuilderUpdateRequest): Promise<ExecutionResult<TemplateBuilderCreateResponse>>;
export declare function templateBuilderFieldTypes(): Promise<TemplateBuilderFieldTypeGroup[]>;
export declare function templateBuilderSkills(): Promise<TemplateBuilderSkill[]>;
