/** * Self-contained input-normalization helpers for the goals back-end. * * These mirror the small subset of `@elizaos/plugin-personal-assistant`'s * `service-normalize` / `service-helpers-misc` helpers that the goal CRUD code * actually used. They are reproduced here (rather than imported) so * `@elizaos/plugin-goals` carries no dependency on plugin-personal-assistant. * `fail` throws a {@link GoalsServiceError} carrying an HTTP status, which the * action and route layers map to client-facing responses. */ import type { IAgentRuntime } from "@elizaos/core"; /** Error carrying an HTTP status for goals back-end failures. */ export declare class GoalsServiceError extends Error { readonly status: number; readonly code?: string | undefined; constructor(status: number, message: string, code?: string | undefined); } export declare function goalsErrorMessage(error: unknown): string; export declare function fail(status: number, message: string, code?: string): never; export declare function requireAgentId(runtime: IAgentRuntime): string; export declare function requireNonEmptyString(value: unknown, field: string): string; export declare function normalizeOptionalString(value: unknown): string | undefined; export declare function normalizeEnumValue(value: unknown, field: string, allowed: readonly T[], fallback?: T): T; export declare function isRecord(value: unknown): value is Record; export declare function cloneRecord(value: unknown): Record; export declare function requireRecord(value: unknown, field: string): Record; export declare function normalizeOptionalRecord(value: unknown, field: string): Record | undefined; export declare function normalizeNullableRecord(value: unknown, field: string): Record | null | undefined; export declare function mergeMetadata(current: Record, updates?: Record): Record; //# sourceMappingURL=goal-normalize.d.ts.map