/**
 * Role Definition Service
 *
 * This service provides methods for managing agent role definitions.
 * Role definitions store system prompts and behavioral configurations
 * for agents, enabling consistent agent behavior across the workspace.
 *
 * Key features:
 * - Create role definitions with system prompts stored as Documents
 * - Update role definitions (creates new Document versions for prompt changes)
 * - Query role definitions by various criteria
 * - Link role definitions to agents
 *
 * @module
 */
import type { DocumentId, ElementId } from '@stoneforge/core';
import type { QuarryAPI } from '@stoneforge/quarry';
import type { AgentRole, CreateRoleDefinitionInput, UpdateRoleDefinitionInput, RoleDefinitionFilter, StoredRoleDefinition } from '../types/index.js';
/**
 * Service interface for managing agent role definitions
 */
export interface RoleDefinitionService {
    /**
     * Creates a new role definition.
     *
     * This creates:
     * 1. A Document with the system prompt content
     * 2. Stores the role definition data in the Document's metadata
     *
     * @param input - The role definition to create
     * @returns The created role definition with its ID
     */
    createRoleDefinition(input: CreateRoleDefinitionInput): Promise<StoredRoleDefinition>;
    /**
     * Gets a role definition by its ID.
     *
     * @param id - The element ID of the role definition document
     * @returns The role definition, or undefined if not found
     */
    getRoleDefinition(id: ElementId): Promise<StoredRoleDefinition | undefined>;
    /**
     * Gets the system prompt content for a role definition.
     *
     * @param id - The element ID of the role definition document
     * @returns The system prompt text, or undefined if not found
     */
    getSystemPrompt(id: ElementId): Promise<string | undefined>;
    /**
     * Gets the system prompt content from a Document reference.
     *
     * @param documentId - The document ID containing the system prompt
     * @returns The system prompt text, or undefined if not found
     */
    getSystemPromptFromRef(documentId: DocumentId): Promise<string | undefined>;
    /**
     * Updates an existing role definition.
     *
     * If the system prompt is updated, a new version of the Document is created.
     *
     * @param id - The element ID of the role definition document
     * @param updates - The fields to update
     * @returns The updated role definition
     */
    updateRoleDefinition(id: ElementId, updates: UpdateRoleDefinitionInput): Promise<StoredRoleDefinition>;
    /**
     * Lists role definitions matching the filter.
     *
     * @param filter - Optional filter criteria
     * @returns Array of matching role definitions
     */
    listRoleDefinitions(filter?: RoleDefinitionFilter): Promise<StoredRoleDefinition[]>;
    /**
     * Gets all role definitions for a specific role type.
     *
     * @param role - The role type to filter by
     * @returns Array of role definitions for that role
     */
    getRoleDefinitionsByRole(role: AgentRole): Promise<StoredRoleDefinition[]>;
    /**
     * Gets the default role definition for a role type.
     *
     * This returns the first role definition found for the role, or undefined
     * if no definitions exist. For more control, use listRoleDefinitions with filters.
     *
     * @param role - The role type
     * @returns The default role definition, or undefined
     */
    getDefaultRoleDefinition(role: AgentRole): Promise<StoredRoleDefinition | undefined>;
    /**
     * Deletes a role definition.
     *
     * @param id - The element ID of the role definition document
     * @returns True if deleted, false if not found
     */
    deleteRoleDefinition(id: ElementId): Promise<boolean>;
}
/**
 * Implementation of the Role Definition Service
 */
export declare class RoleDefinitionServiceImpl implements RoleDefinitionService {
    private readonly api;
    constructor(api: QuarryAPI);
    createRoleDefinition(input: CreateRoleDefinitionInput): Promise<StoredRoleDefinition>;
    getRoleDefinition(id: ElementId): Promise<StoredRoleDefinition | undefined>;
    getSystemPrompt(id: ElementId): Promise<string | undefined>;
    getSystemPromptFromRef(documentId: DocumentId): Promise<string | undefined>;
    updateRoleDefinition(id: ElementId, updates: UpdateRoleDefinitionInput): Promise<StoredRoleDefinition>;
    listRoleDefinitions(filter?: RoleDefinitionFilter): Promise<StoredRoleDefinition[]>;
    getRoleDefinitionsByRole(role: AgentRole): Promise<StoredRoleDefinition[]>;
    getDefaultRoleDefinition(role: AgentRole): Promise<StoredRoleDefinition | undefined>;
    deleteRoleDefinition(id: ElementId): Promise<boolean>;
}
/**
 * Creates a RoleDefinitionService instance
 */
export declare function createRoleDefinitionService(api: QuarryAPI): RoleDefinitionService;
//# sourceMappingURL=role-definition-service.d.ts.map