/** * Constants used throughout the DagEngine * * This module contains all constant values including default configuration, * error messages, and metadata keys used for result tracking. * * @module shared/constants */ /** * Default configuration values for the DagEngine * * These values are used when not explicitly provided in EngineConfig. * * @example * ```typescript * import { DEFAULT_ENGINE_CONFIG } from '@dagengine/core'; * * console.log(DEFAULT_ENGINE_CONFIG.MAX_RETRIES); // 3 * console.log(DEFAULT_ENGINE_CONFIG.TIMEOUT); // 60000 * ``` */ export declare const DEFAULT_ENGINE_CONFIG: { /** Maximum number of retry attempts for failed operations */ readonly MAX_RETRIES: 3; /** Delay between retry attempts in milliseconds */ readonly RETRY_DELAY: 1000; /** Whether to continue execution when a dimension fails */ readonly CONTINUE_ON_ERROR: true; /** Default timeout for dimension execution in milliseconds */ readonly TIMEOUT: 60000; /** Maximum concurrent dimension executions */ readonly CONCURRENCY: 5; }; /** * Standardized error messages used throughout the engine * * Provides consistent error messaging and supports parameterized messages * through factory functions. * * @example * ```typescript * import { ERROR_MESSAGES } from '@dagengine/core'; * * throw new Error(ERROR_MESSAGES.NO_PLUGIN); * throw new Error(ERROR_MESSAGES.TIMEOUT('summary', 30000)); * ``` */ export declare const ERROR_MESSAGES: { readonly NO_PLUGIN: "DagEngine requires a plugin"; readonly INVALID_CONCURRENCY: "Concurrency must be at least 1"; readonly NO_PROVIDERS: "DagEngine requires either \"providers\" or \"registry\""; readonly NO_PROVIDERS_CONFIGURED: "DagEngine requires at least one provider to be configured"; readonly NO_SECTIONS: "DagEngine.process() requires at least one section"; readonly DEPENDENCIES_FAILED: (dimension: string) => string; readonly DEPENDENCY_NOT_FOUND: (depName: string) => string; readonly GLOBAL_DEP_NOT_FOUND: (depName: string) => string; readonly SECTION_DEP_NOT_FOUND: (depName: string) => string; readonly SECTION_DEP_NOT_PROCESSED: (depName: string) => string; readonly TIMEOUT: (dimension: string, timeout: number) => string; readonly CIRCULAR_DEPENDENCY: (cycle: string[]) => string; readonly EXECUTION_GROUPING: (remaining: string[]) => string; readonly PROVIDER_NOT_FOUND: (provider: string, available: string[]) => string; readonly ALL_PROVIDERS_FAILED: (dimension: string) => string; }; /** * Standardized reasons for skipping dimension execution * * Used in result metadata to indicate why a dimension was skipped. * * @example * ```typescript * import { SKIP_REASONS } from '@dagengine/core'; * * return { * data: { skipped: true, reason: SKIP_REASONS.PLUGIN_SKIP_GLOBAL } * }; * ``` */ export declare const SKIP_REASONS: { /** Skipped by plugin's shouldSkipGlobalDimension hook */ readonly PLUGIN_SKIP_GLOBAL: "Skipped by plugin shouldSkipGlobalDimension"; /** Skipped by plugin's shouldSkipSectionDimension hook */ readonly PLUGIN_SKIP_SECTION: "Skipped by plugin shouldSkipSectionDimension"; /** Skipped due to cached result */ readonly CACHED_RESULT: "Skipped due to cached result"; /** Skipped due to failed dependencies */ readonly FAILED_DEPENDENCIES: "Skipped due to failed dependencies"; }; /** * Metadata keys used for result tracking * * Standardized keys for accessing metadata in DimensionResult objects. * * @example * ```typescript * import { METADATA_KEYS } from '@dagengine/core'; * * if (result.metadata?.[METADATA_KEYS.CACHED]) { * console.log('Result was cached'); * } * * console.log('Provider:', result.metadata?.[METADATA_KEYS.PROVIDER]); * console.log('Tokens:', result.metadata?.[METADATA_KEYS.TOKENS]); * ``` */ export declare const METADATA_KEYS: { /** Whether the result was cached */ readonly CACHED: "cached"; /** Provider used for this dimension */ readonly PROVIDER: "provider"; /** Token usage information */ readonly TOKENS: "tokens"; /** Whether the dimension was skipped */ readonly SKIPPED: "skipped"; /** Reason for skipping (if skipped) */ readonly REASON: "reason"; /** Model used for this dimension */ readonly MODEL: "model"; /** Duration of execution in milliseconds */ readonly DURATION: "duration"; /** Timestamp of execution */ readonly TIMESTAMP: "timestamp"; }; /** * Timing-related constants */ export declare const TIMING: { /** Minimum duration for error reporting (to avoid test flakiness) */ readonly MIN_ERROR_DURATION: 1; /** Default delay between retry attempts */ readonly DEFAULT_RETRY_DELAY: 1000; /** Maximum backoff delay for retries */ readonly MAX_RETRY_DELAY: 10000; /** Default timeout for dimension execution */ readonly DEFAULT_TIMEOUT: 60000; }; /** * Validation-related constants */ export declare const VALIDATION: { /** Minimum allowed concurrency */ readonly MIN_CONCURRENCY: 1; /** Maximum allowed concurrency */ readonly MAX_CONCURRENCY: 10000; /** Minimum allowed retry attempts */ readonly MIN_RETRIES: 0; /** Maximum allowed retry attempts */ readonly MAX_RETRIES: 10; /** Minimum allowed timeout */ readonly MIN_TIMEOUT: 100; /** Maximum allowed timeout */ readonly MAX_TIMEOUT: 600000; }; /** * Type for skip reason values */ export type SkipReason = (typeof SKIP_REASONS)[keyof typeof SKIP_REASONS]; /** * Type for metadata key values */ export type MetadataKey = (typeof METADATA_KEYS)[keyof typeof METADATA_KEYS]; /** * Minimum duration for error reporting (to avoid test flakiness) * * @deprecated Use TIMING.MIN_ERROR_DURATION instead */ export declare const MIN_ERROR_DURATION: 1; //# sourceMappingURL=constants.d.ts.map