/** * FIX: DMCP-SEC-006 - Security audit suppression * This file contains only helper utilities for element operations. * No audit logging is required - logging happens in the calling handlers. * @security-audit-suppress DMCP-SEC-006 */ import { ElementType } from '../../portfolio/PortfolioManager.js'; export declare function findElementFlexibly(name: string, elementList: T[]): T | undefined; export declare function sanitizeMetadata(metadata: Record | undefined): Record; export declare function collectGatekeeperAuthoringErrors(input: Record | undefined, metadata?: unknown): string[]; export declare function formatGatekeeperValidationMessage(errors: string[]): string; export declare function normalizeElementTypeInput(rawType: string | null | undefined): { type: ElementType | null; aliasUsed: boolean; }; export declare function formatValidElementTypesList(): string; export declare function getElementTypeLabel(type: ElementType, options?: { plural?: boolean; }): string; export declare function getElementFilename(type: ElementType, name: string): string; export interface ElementManagerOperations { list?: () => Promise; find?: (predicate: (candidate: T) => boolean) => Promise; load?: (filePath: string) => Promise; } /** * Known metadata properties for each element type. * Used by both `detectUnknownMetadataProperties()` (create/edit warnings) * and `editElement()` (field routing to metadata vs element object). * * IMPORTANT: Both camelCase and snake_case variants must be listed where * applicable, since LLMs may send either form. The lookup uses exact * string matching via `Set.has()`. * * @example * // Common properties shared across all types: * 'name', 'description', 'author', 'version', 'tags', 'gatekeeper' * * @example * // Type-specific properties (only valid for that element type): * Agent: 'goal', 'activates', 'tools', 'autonomy', 'resilience' * Skill: 'domains', 'category', 'prerequisites' * Ensemble: 'elements', 'activationStrategy', 'activation_strategy' */ export declare const KNOWN_METADATA_PROPERTIES: Record>; /** * Result of checking metadata for unknown properties. */ export interface UnknownPropertyWarning { property: string; suggestion?: string; message: string; } /** * Validate a gatekeeper policy in element metadata. * Returns warnings (not throws) for invalid policy structures, * so LLMs get immediate feedback about malformed policies. * * @param metadata - The metadata object containing the gatekeeper policy * @returns Array of warnings for invalid policy structure (empty if valid) */ export declare function validateGatekeeperPolicy(metadata: Record): UnknownPropertyWarning[]; export declare function detectUnknownMetadataProperties(elementType: ElementType, metadata: Record | undefined): UnknownPropertyWarning[]; /** * Format unknown property warnings for MCP response. * Returns a warning block that can be prepended to success messages. */ export declare function formatUnknownPropertyWarnings(warnings: UnknownPropertyWarning[]): string; /** * Format element resolution warnings for MCP response. * Surfaces disambiguation and not-found info from resolveElementTypes() * so the user can fix missing element_type fields. * * Follows the same pattern as formatUnknownPropertyWarnings(). */ export declare function formatElementResolutionWarnings(result: { ambiguous: Array<{ element_name: string; found_in: string[]; }>; notFound: string[]; }): string; export declare function resolveElementByName(manager: ElementManagerOperations | null | undefined, type: ElementType, name: string): Promise; //# sourceMappingURL=helpers.d.ts.map