import type { PermissionScope } from './types.js'; export interface TrustedServiceConfig { name: string; key: string; taskIds?: string[] | '*'; scope: PermissionScope[]; } export interface TaskcastConfig { port?: number; logLevel?: 'debug' | 'info' | 'warn' | 'error'; adminToken?: string; /** Enable the admin API endpoint (POST /admin/token). Defaults to false. */ adminApi?: boolean; auth?: { mode: 'none' | 'jwt' | 'custom'; jwt?: { algorithm?: string; secret?: string; publicKey?: string; publicKeyFile?: string; issuer?: string; audience?: string; }; }; trustedServices?: TrustedServiceConfig[]; adapters?: { broadcast?: { provider: string; url?: string; }; shortTermStore?: { provider: string; url?: string; }; longTermStore?: { provider: string; url?: string; }; }; sentry?: { dsn?: string; captureTaskFailures?: boolean; captureTaskTimeouts?: boolean; captureUnhandledErrors?: boolean; captureDroppedEvents?: boolean; captureStorageErrors?: boolean; captureBroadcastErrors?: boolean; traceSSEConnections?: boolean; traceEventPublish?: boolean; }; webhook?: { defaultRetry?: { retries?: number; backoff?: 'fixed' | 'exponential' | 'linear'; initialDelayMs?: number; maxDelayMs?: number; timeoutMs?: number; }; }; cleanup?: { rules?: unknown[]; }; workers?: { enabled?: boolean; defaults?: { assignMode?: 'external' | 'pull' | 'ws-offer' | 'ws-race'; heartbeatIntervalMs?: number; heartbeatTimeoutMs?: number; offerTimeoutMs?: number; disconnectPolicy?: 'reassign' | 'mark' | 'fail'; disconnectGraceMs?: number; }; }; storageLifecycle?: StorageLifecycleConfig; } export interface StorageLifecycleConfig { hotRetentionEnabled?: boolean; hotRetentionTerminalSeconds?: number; hotRetentionIdleSeconds?: number; rehydrateReplayEvents?: number; storageLockTtlSeconds?: number; ttlSweepIntervalSeconds?: number; ttlSweepBatchSize?: number; } export interface ResolvedStorageLifecycleConfig { hotRetentionEnabled: boolean; hotRetentionTerminalSeconds: number; hotRetentionIdleSeconds: number; rehydrateReplayEvents: number; storageLockTtlSeconds: number; ttlSweepIntervalSeconds: number; ttlSweepBatchSize: number; } export declare function resolveStorageLifecycleConfig(config: TaskcastConfig, env?: Record): ResolvedStorageLifecycleConfig; export declare function interpolateEnvVars(value: string): string; export declare function parseConfig(content: string, format: 'json' | 'yaml'): TaskcastConfig; export interface ConfigLoadResult { config: TaskcastConfig; source: 'explicit' | 'local' | 'global' | 'none'; /** Resolved absolute path to the config file that was loaded. Undefined when source is 'none'. */ path?: string; } export declare function loadConfigFile(configPath?: string, globalConfigDir?: string): Promise; /** * Resolves the admin token based on config. * - If `adminApi` is false/unset, returns null (admin API disabled, no token needed). * - If `adminApi` is true and `adminToken` is set, returns it. * - If `adminApi` is true and `adminToken` is not set, auto-generates a ULID and logs it. * Mutates the config in place. */ export declare function resolveAdminToken(config: TaskcastConfig): string | null; //# sourceMappingURL=config.d.ts.map