/**
 * Backend-specific constants
 * Re-exported from the main config constants for backend use
 */
export declare const PROCESS_EXIT_CODES: {
    readonly SUCCESS: 0;
    readonly ERROR: 1;
    readonly RESTART_REQUESTED: 120;
};
export declare const AGENT_IDENTITY_CONSTANTS: {
    readonly ORCHESTRATOR: {
        readonly ID: "orchestrator";
        readonly SESSION_NAME: "crewly-orc";
        readonly ROLE: "orchestrator";
    };
};
export declare const TIMING_CONSTANTS: {
    readonly RETRIES: {
        readonly MAX_ATTEMPTS: 3;
        readonly BASE_DELAY: 1000;
        readonly MAX_DELAY: 10000;
    };
    readonly INTERVALS: {
        readonly HEALTH_CHECK: 30000;
        readonly MEMORY_CLEANUP: number;
        readonly STATUS_UPDATE: 10000;
        readonly ACTIVITY_MONITOR: 15000;
        readonly CLEANUP: 60000;
        readonly BATCH_DELAY: 500;
        readonly RATE_LIMIT_WINDOW: 1000;
        readonly TASK_CLEANUP: 300000;
    };
    readonly TIMEOUTS: {
        readonly CLAUDE_INIT: 45000;
        readonly AGENT_SETUP: 90000;
        readonly TASK_COMPLETION: number;
        readonly WEBSOCKET: 30000;
        readonly ORCHESTRATOR_SETUP: 30000;
        readonly TASK_MONITOR_POLL: 2000;
        readonly HEALTH_CHECK_TIMEOUT: 1000;
        readonly HTTP_HEALTH_CHECK: 3000;
        readonly API_REQUEST_QUICK: 2000;
        readonly SHUTDOWN: 2000;
        readonly CONNECTION: 10000;
        readonly AGENT_DEFAULT: 300000;
        readonly CONTEXT_REFRESH: 1800000;
        readonly WS_PING: 60000;
        readonly WS_PING_INTERVAL: 25000;
        readonly BACKUP: 3600000;
        readonly RATE_LIMIT_WINDOW: 900000;
        readonly COMMAND_TIMESTAMP_OFFSET: 300000;
        readonly COMMAND_TIMESTAMP_OFFSET_LONG: 600000;
    };
};
export declare const MEMORY_CONSTANTS: {
    readonly PATHS: {
        readonly AGENTS_DIR: "agents";
        readonly KNOWLEDGE_DIR: "knowledge";
        readonly SESSIONS_DIR: "sessions";
        readonly LATEST_SUMMARY: "latest-summary.md";
        readonly DAILY_LOG_DIR: "logs/daily";
        readonly GOALS_DIR: "goals";
        readonly GOALS_FILE: "goals.md";
        readonly FOCUS_FILE: "current_focus.md";
        readonly DECISIONS_LOG: "decisions_log.md";
        readonly LEARNING_DIR: "learning";
        readonly WHAT_WORKED_FILE: "what_worked.md";
        readonly WHAT_FAILED_FILE: "what_failed.md";
        readonly GLOBAL_LEARNING_DIR: "learning";
        readonly CROSS_PROJECT_INSIGHTS: "cross_project_insights.md";
        readonly AGENTS_INDEX: "agents-index.json";
    };
    readonly AGENT_FILES: {
        readonly MEMORY: "memory.json";
        readonly ROLE_KNOWLEDGE: "role-knowledge.json";
        readonly PREFERENCES: "preferences.json";
        readonly PERFORMANCE: "performance.json";
        readonly SOP_CUSTOM_DIR: "sop-custom";
    };
    readonly PROJECT_FILES: {
        readonly INDEX: "index.json";
        readonly PATTERNS: "patterns.json";
        readonly DECISIONS: "decisions.json";
        readonly GOTCHAS: "gotchas.json";
        readonly RELATIONSHIPS: "relationships.json";
        readonly TASK_HISTORY: "task-history.json";
        readonly LEARNINGS: "learnings.md";
    };
    readonly LIMITS: {
        readonly MAX_ROLE_KNOWLEDGE_ENTRIES: 500;
        readonly MAX_PATTERN_ENTRIES: 200;
        readonly MAX_DECISION_ENTRIES: 100;
        readonly MAX_GOTCHA_ENTRIES: 200;
        readonly MAX_RELATIONSHIP_ENTRIES: 500;
        readonly MAX_FILE_SIZE_BYTES: 1048576;
        readonly MAX_QUERY_RESULTS: 50;
        readonly MIN_CONFIDENCE_THRESHOLD: 0.2;
        readonly PRUNE_AFTER_DAYS: 90;
    };
    readonly DEFAULTS: {
        readonly INITIAL_CONFIDENCE: 0.5;
        readonly CONFIDENCE_REINFORCEMENT: 0.1;
        readonly MAX_CONFIDENCE: 1;
        readonly MIN_CONFIDENCE: 0;
    };
    readonly SCHEMA: {
        readonly CURRENT_VERSION: 1;
        readonly MIN_SUPPORTED_VERSION: 1;
    };
    readonly CATEGORIES: {
        readonly ROLE_KNOWLEDGE: readonly ["best-practice", "anti-pattern", "tool-usage", "workflow"];
        readonly PATTERN: readonly ["api", "component", "service", "testing", "styling", "database", "config", "other"];
        readonly GOTCHA_SEVERITY: readonly ["low", "medium", "high", "critical"];
        readonly LEARNING: readonly ["pattern", "decision", "gotcha", "insight", "improvement"];
        readonly RELATIONSHIP: readonly ["depends-on", "uses", "extends", "implements", "calls", "imported-by"];
    };
};
export declare const CONTINUATION_CONSTANTS: {
    readonly DETECTION: {
        readonly IDLE_CYCLES_BEFORE_CHECK: 2;
        readonly STALE_THRESHOLD_MINUTES: 20;
        readonly ACTIVITY_POLL_INTERVAL_MS: 120000;
    };
    readonly EVENTS: {
        readonly DEBOUNCE_MS: 5000;
        readonly DEDUP_WINDOW_MS: 10000;
        readonly CLEANUP_INTERVAL_MS: 60000;
    };
    readonly ITERATIONS: {
        readonly DEFAULT_MAX: 10;
        readonly ABSOLUTE_MAX: 50;
        readonly WARNING_THRESHOLD: 0.8;
    };
    readonly TIMEOUTS: {
        readonly ANALYSIS_MS: 10000;
        readonly ACTION_MS: 30000;
        readonly PROMPT_INJECTION_MS: 15000;
    };
    readonly PATTERNS: {
        readonly COMPLETION: readonly ["task completed", "task done", "successfully completed", "implementation complete", "all tests pass", "ready for review"];
        readonly WAITING: readonly ["waiting for", "awaiting", "blocked by", "need input", "please provide", "let me know"];
        readonly ERROR: readonly ["error:", "failed:", "exception:", "cannot", "unable to", "permission denied"];
    };
    readonly CONFIDENCE: {
        readonly ACTION_THRESHOLD: 0.6;
        readonly HIGH: 0.8;
        readonly MEDIUM: 0.5;
        readonly LOW: 0.3;
    };
};
export declare const ORCHESTRATOR_RESTART_CONSTANTS: {
    readonly MAX_RESTARTS_PER_WINDOW: 3;
    readonly COOLDOWN_WINDOW_MS: 3600000;
    readonly RESTART_DELAY_MS: 5000;
};
export declare const AGENT_SUSPEND_CONSTANTS: {
    readonly DEFAULT_IDLE_TIMEOUT_MINUTES: 30;
    readonly IDLE_CHECK_INTERVAL_MS: 120000;
    readonly DEBUG_LOG_MAX_AGE_HOURS: 24;
    readonly REHYDRATION_TIMEOUT_MS: 45000;
    readonly EXEMPT_ROLES: readonly ["orchestrator"];
    readonly STARTED_AGENT_IDLE_TIMEOUT_MINUTES: 15;
    readonly ALWAYS_ON_ROLES: readonly ["orchestrator", "auditor"];
    readonly AGENT_IDLE_STOP_TIMEOUT_MS: 1800000;
};
export declare const VERSION_CHECK_CONSTANTS: {
    readonly NPM_REGISTRY_URL: "https://registry.npmjs.org/crewly/latest";
    readonly CHECK_CACHE_FILE: ".update-check";
    readonly CACHE_TTL_MS: number;
    readonly REQUEST_TIMEOUT_MS: 5000;
};
export declare const AGENT_HEARTBEAT_MONITOR_CONSTANTS: {
    readonly CHECK_INTERVAL_MS: 30000;
    readonly HEARTBEAT_REQUEST_THRESHOLD_MS: 300000;
    readonly STARTUP_GRACE_PERIOD_MS: 60000;
    readonly MAX_RESTARTS_PER_WINDOW: 3;
    readonly COOLDOWN_WINDOW_MS: 3600000;
};
export declare const ORCHESTRATOR_HEARTBEAT_CONSTANTS: {
    readonly CHECK_INTERVAL_MS: 30000;
    readonly HEARTBEAT_REQUEST_THRESHOLD_MS: 300000;
    readonly HEARTBEAT_REQUEST_THRESHOLD_PTY_ACTIVE_MS: 900000;
    readonly PTY_ACTIVE_WINDOW_MS: 120000;
    readonly RESTART_THRESHOLD_MS: 60000;
    readonly HEARTBEAT_REQUEST_MESSAGE: "Please run your heartbeat skill now: bash config/skills/orchestrator/heartbeat/execute.sh";
    readonly STARTUP_GRACE_PERIOD_MS: 120000;
    readonly IN_PROGRESS_TIMEOUT_MS: 1800000;
};
export declare const WEB_CONSTANTS: {
    readonly PORTS: {
        readonly BACKEND: 8787;
        readonly FRONTEND: 8788;
    };
    readonly ENDPOINTS: {
        readonly HEALTH: "/health";
        readonly API_BASE: "/api";
        readonly TEAMS: "/api/teams";
        readonly PROJECTS: "/api/projects";
        readonly ORCHESTRATOR: "/api/orchestrator";
        readonly TERMINAL: "/api/terminal";
        readonly TASKS: "/api/tasks";
        readonly FACTORY_SSE: "/api/factory/sse";
    };
    readonly SSE: {
        readonly POLL_INTERVAL: 3000;
        readonly HEARTBEAT_INTERVAL: 30000;
        readonly MAX_RECONNECT_ATTEMPTS: 5;
        readonly BASE_RECONNECT_DELAY: 1000;
        readonly MAX_RECONNECT_DELAY: 30000;
        readonly FALLBACK_POLL_INTERVAL: 5000;
    };
};
export declare const ADDON_CONSTANTS: {
    readonly PATHS: {
        readonly ADDONS_DIR: "addons";
        readonly DOWNLOADS_DIR: "downloads";
    };
    readonly MANIFEST_FILE: "manifest.json";
    readonly DEFAULT_ENTRYPOINT: "dist/index.js";
    readonly CLOUD_API: {
        readonly BASE_URL: "https://api.crewlyai.com/v1";
        readonly DOWNLOAD_ENDPOINT: "/addons";
    };
    readonly PRO_ADDON: {
        readonly NAME: "crewly-pro";
        readonly DEFAULT_TARBALL: "crewly-pro.tar.gz";
    };
    readonly TIMEOUTS: {
        readonly LOAD_TIMEOUT_MS: 10000;
    };
};
export declare const AUDITOR_CONSTANTS: {
    readonly ENABLED_BY_DEFAULT: false;
    readonly ENV_VAR: "CREWLY_ENABLE_AUDITOR";
};
export declare const ORCHESTRATOR_SESSION_NAME: "crewly-orc";
export declare const ORCHESTRATOR_ROLE = "orchestrator";
export declare const ORCHESTRATOR_WINDOW_NAME = "Crewly Orchestrator";
export declare const AGENT_INITIALIZATION_TIMEOUT = 90000;
export declare const CLAUDE_INITIALIZATION_TIMEOUT = 45000;
export declare const CREWLY_CONSTANTS: {
    readonly INIT_SCRIPTS: {
        readonly CLAUDE: "initialize_claude.sh";
    };
    readonly SESSIONS: {
        readonly ORCHESTRATOR_NAME: "crewly-orc";
        readonly DEFAULT_TIMEOUT: 120000;
        readonly REGISTRATION_CHECK_INTERVAL: 5000;
        readonly CLAUDE_DETECTION_CACHE_TIMEOUT: 30000;
        readonly DEFAULT_SHELL: "/bin/bash";
    };
    readonly PATHS: {
        readonly CREWLY_HOME: ".crewly";
        readonly TEAMS_FILE: "teams.json";
        readonly PROJECTS_FILE: "projects.json";
        readonly RUNTIME_FILE: "runtime.json";
        readonly SCHEDULED_MESSAGES_FILE: "scheduled-messages.json";
        readonly MESSAGE_DELIVERY_LOGS_FILE: "message-delivery-logs.json";
        readonly CONFIG_DIR: "config";
        readonly PROMPTS_DIR: "prompts";
        readonly TASKS_DIR: "tasks";
        readonly SPECS_DIR: "specs";
        readonly MEMORY_DIR: "memory";
        readonly DOCS_DIR: "docs";
        readonly DOCS_INDEX_FILE: "docs-index.json";
        readonly LOGS_DIR: "logs";
        readonly SESSION_LOGS_DIR: "sessions";
        readonly BUG_REPORTS_DIR: "bug-reports";
        readonly SKILLS_DIR: "skills";
        readonly SKILLS_CATALOG_FILE: "AGENT_SKILLS_CATALOG.md";
    };
    readonly AGENT_STATUSES: {
        readonly INACTIVE: "inactive";
        readonly STARTING: "starting";
        readonly STARTED: "started";
        readonly ACTIVE: "active";
        readonly SUSPENDED: "suspended";
        readonly ACTIVATING: "activating";
    };
    readonly WORKING_STATUSES: {
        readonly IDLE: "idle";
        readonly IN_PROGRESS: "in_progress";
    };
    readonly ROLES: {
        readonly ORCHESTRATOR: "orchestrator";
        readonly PROJECT_MANAGER: "pm";
        readonly TECH_LEAD: "tpm";
        readonly DEVELOPER: "developer";
        readonly QA: "qa";
        readonly DEVOPS: "devops";
    };
    readonly AGENT_IDS: {
        readonly ORCHESTRATOR_ID: "orchestrator";
    };
    readonly ROLE_DISPLAY_NAMES: {
        readonly orchestrator: "Orchestrator";
        readonly pm: "Project Manager";
        readonly tpm: "Technical Project Manager";
        readonly developer: "Developer";
        readonly qa: "Quality Assurance";
        readonly devops: "DevOps Engineer";
    };
    readonly ORCHESTRATOR: {
        readonly DISPLAY_NAME: "Orchestrator";
        readonly WINDOW_NAME: "Crewly Orchestrator";
        readonly SESSION_PREFIX: "crewly_";
    };
};
export declare const ENV_CONSTANTS: {
    /** PTY session name used for agent identity and heartbeat tracking */
    readonly CREWLY_SESSION_NAME: "CREWLY_SESSION_NAME";
    readonly CREWLY_ROLE: "CREWLY_ROLE";
    /** Base URL for the Crewly backend API (used by orchestrator bash skills) */
    readonly CREWLY_API_URL: "CREWLY_API_URL";
    /** Gemini API key for embedding-based knowledge search */
    readonly GEMINI_API_KEY: "GEMINI_API_KEY";
    /** Project path for auto-injecting into memory skill calls (#187) */
    readonly CREWLY_PROJECT_PATH: "CREWLY_PROJECT_PATH";
    /** Enable Claude Code telemetry for token tracking */
    readonly CLAUDE_CODE_ENABLE_TELEMETRY: "CLAUDE_CODE_ENABLE_TELEMETRY";
    /** #222: Absolute path to the Crewly installation directory (where config/skills/ lives) */
    readonly CREWLY_INSTALL_DIR: "CREWLY_INSTALL_DIR";
};
export declare const AGENT_TIMEOUTS: {
    readonly ORCHESTRATOR_INITIALIZATION: 120000;
    readonly REGULAR_AGENT_INITIALIZATION: 75000;
    /** #227: Extended timeout for Claude Code — PI protection evaluation takes 2-3 min */
    readonly CLAUDE_CODE_INITIALIZATION: 300000;
    /** #252: Watchdog timeout — if agent is still in 'starting' state after this period, mark as error */
    readonly STARTING_WATCHDOG: 300000;
};
export declare const BROWSER_BRIDGE_CONSTANTS: {
    /** WebSocket server path for Chrome Extension connections */
    readonly WS_PATH: "/ws/browser";
    /** Default timeout for commands sent to Chrome Extension (ms) */
    readonly COMMAND_TIMEOUT_MS: 30000;
    /**
     * Per-tab dispatch (1 agent : 1 tab) — see
     * `.crewly/specs/crewly-in-chrome-per-tab-fix-2026-04-25.md`.
     */
    /** Hard cap on concurrent agent→tab bindings. POST /api/browser/bind returns 503 above this. */
    readonly TAB_BIND_HARD_CAP: 50;
    /** Soft warning threshold — log + alert when crossed, but bind still succeeds. */
    readonly TAB_BIND_SOFT_WARN: 25;
    /** Default TTL for an idle binding in minutes (configurable via CREWLY_TAB_BIND_TTL_MINUTES). */
    readonly TAB_BIND_TTL_MINUTES: 30;
    /** Cadence of the orphan/TTL sweep timer in milliseconds. */
    readonly TAB_BIND_SWEEP_MS: number;
    /** Default tabId on a 503 retry hint (milliseconds the skill should back off). */
    readonly TAB_BIND_RETRY_AFTER_MS: 30000;
};
/**
 * Crewly Cloud Relay proxy constants for browser instance lifecycle hygiene.
 * Used by `BrowserProxyService` to keep its in-memory instances Map free of
 * stale entries when the relay drops a `disconnected` event or when the user
 * reinstalls the extension (fresh `instanceId` UUID — old one would otherwise
 * linger forever).
 *
 * See `.crewly/specs/browser-ext-stale-status-fix-2026-04-30.md`.
 */
export declare const BROWSER_PROXY_CONSTANTS: {
    /** Cadence of the wall-clock TTL sweep (ms). Every interval the service
     *  walks `this.instances` and purges entries whose `lastSeenAt` exceeds
     *  `STALE_PURGE_THRESHOLD_MS`. */
    readonly SWEEP_INTERVAL_MS: 60000;
    /** Inactivity threshold (ms) after which an instance is considered stale
     *  and purged by the sweep. 5 min is generous enough to tolerate transient
     *  relay/network blips without prematurely evicting a live ext connection
     *  (heartbeat fires every 25s, so 5 min = ~12 missed heartbeats). */
    readonly STALE_PURGE_THRESHOLD_MS: number;
    /** Re-issue `list_browsers` to the relay every Nth heartbeat tick.
     *  Defensive sync against missing `browser_event:updated` pushes from
     *  the cloud relay. With heartbeat at 25s and N=8, refresh fires every
     *  ~200s — comfortably under STALE_PURGE_THRESHOLD_MS (300s) so a live
     *  ext that is mid-refresh never crosses the purge boundary.
     *  Boundary math: register@T0 → first refresh@T0+200s → next sweep
     *  evaluates lastSeenAt at most 200s old → far below 300s threshold. */
    readonly LIST_REFRESH_EVERY_N_HEARTBEATS: 8;
    /**
     * Deadline (ms) for receiving a `heartbeat_ack` from the relay after a
     * `heartbeat` is sent. If no ack arrives within this window the relay
     * socket is treated as dead/half-open and the proxy reconnects proactively
     * rather than riding the socket until the relay's 180s `4002` eviction.
     *
     * Set to 2x the 25s heartbeat interval (50s): comfortably above one RTT on
     * slow networks (avoids false reconnects) yet well under the relay's 180s
     * timeout (so the backend never churns drop→re-register→count:0 every
     * ~3min). Liveness invariant — see the long-term browser-relay fix design.
     */
    readonly HEARTBEAT_ACK_DEADLINE_MS: 50000;
};
export declare const RUNTIME_TYPES: {
    readonly CLAUDE_CODE: "claude-code";
    readonly GEMINI_CLI: "gemini-cli";
    readonly CODEX_CLI: "codex-cli";
    readonly CREWLY_AGENT: "crewly-agent";
};
/**
 * The canonical managed binary name for the Crewly Agent runtime.
 *
 * After PR #599 (Plan A) the agent reasoning loop lives in the standalone
 * `crewly-agent` npm package; OSS spawns it as a subprocess. This is the
 * default value of `settings.general.runtimeCommands['crewly-agent']` and the
 * command `resolveRuntimeCommand()` returns (no shell) when no genuine custom
 * shell command is configured.
 */
export declare const CREWLY_AGENT_MANAGED_COMMAND: "crewly-agent";
/**
 * Legacy / sentinel values for `runtimeCommands['crewly-agent']` that must NOT
 * be treated as real shell commands.
 *
 * `'crewly-agent-in-process'` was the factory default before PR #599 switched
 * the runtime to an external binary. It is not a real executable — when shelled
 * out via `sh -lc` it fails with exit-127 (issue #693). Any value listed here is
 * recognized as "use the managed default binary" and is rewritten to
 * `CREWLY_AGENT_MANAGED_COMMAND` on settings load (migration) and at command
 * resolution time (defensive guard).
 */
export declare const LEGACY_CREWLY_AGENT_SENTINELS: readonly ["crewly-agent-in-process"];
/** Error patterns indicating non-recoverable failures (e.g. missing CLI binary) that should not be retried. */
export declare const NON_RECOVERABLE_ERROR_PATTERNS: readonly ["command not found", "not installed", "No such file"];
export declare const PTY_CONSTANTS: {
    readonly MAX_DATA_LISTENERS: 100;
    readonly MAX_EXIT_LISTENERS: 50;
    readonly DEFAULT_MAX_HISTORY_SIZE: number;
    readonly DEFAULT_SCROLLBACK: 5000;
    readonly DEFAULT_COLS: 80;
    readonly DEFAULT_ROWS: 24;
    readonly MAX_RESIZE_COLS: 1000;
    readonly MAX_RESIZE_ROWS: 1000;
    /** Delay before escalating from SIGTERM to SIGKILL in forceKill (ms) */
    readonly FORCE_KILL_ESCALATION_DELAY: 500;
    /** Delay before escalating from SIGTERM to SIGKILL in forceDestroyAll (ms) */
    readonly FORCE_DESTROY_ESCALATION_DELAY: 1000;
    /** Minimum non-whitespace characters in stripped PTY output to count as meaningful activity.
     * Set to 8 to filter out Gemini CLI TUI noise (cursor movements, spinner chars, single-char
     * redraws) that have 1-5 residual chars after ANSI stripping. Real output (tool results,
     * response text, bash output) is always longer. */
    readonly MIN_MEANINGFUL_OUTPUT_BYTES: 8;
    /** Minimum time (ms) an agent must remain in_progress before emitting busy/idle events */
    readonly MIN_BUSY_DURATION_MS: 10000;
};
export declare const SESSION_COMMAND_DELAYS: {
    /** Delay after sending a message (allows terminal to process bracketed paste) */
    readonly MESSAGE_DELAY: 1000;
    /** Delay after sending a key (allows key to be processed) */
    readonly KEY_DELAY: 200;
    /** Delay after clearing command line (allows terminal to reset) */
    readonly CLEAR_COMMAND_DELAY: 100;
    /** Delay after setting environment variable */
    readonly ENV_VAR_DELAY: 100;
    /** Delay for Claude Code to recover from state changes */
    readonly CLAUDE_RECOVERY_DELAY: 300;
    /** Delay between message delivery retry attempts */
    readonly MESSAGE_RETRY_DELAY: 1000;
    /** Additional delay for Claude Code to start processing after message sent */
    readonly MESSAGE_PROCESSING_DELAY: 500;
    /** Max idle time (ms) to consider an agent busy. If PTY output occurred within this window, skip delivery. */
    readonly AGENT_BUSY_IDLE_THRESHOLD_MS: 5000;
    /** Progressive re-check intervals for Claude Code delivery verification (ms).
     *  Total window: 500ms (processing delay) + 1000 + 2000 + 3000 = 6.5s */
    readonly CLAUDE_VERIFICATION_INTERVALS: readonly [1000, 2000, 3000];
};
export declare const TERMINAL_CONTROLLER_CONSTANTS: {
    readonly DEFAULT_CAPTURE_LINES: 50;
    readonly MAX_CAPTURE_LINES: 500;
    readonly MAX_OUTPUT_SIZE: 131072;
};
/** Constants for the TerminalGateway orchestrator output buffer management. */
export declare const TERMINAL_GATEWAY_CONSTANTS: {
    /** Maximum buffer size for orchestrator output (bytes) */
    readonly MAX_BUFFER_SIZE: number;
    /** Trim threshold for partial line buffer (characters) */
    readonly BUFFER_TRIM_THRESHOLD: 1000;
    /**
     * Backoff schedule (ms) for retrying eager orchestrator chat monitoring
     * when the PTY session is not yet registered in the SessionBackend.
     *
     * Background: startOrchestratorChatMonitoring is invoked from boot,
     * setup, and restart paths immediately after createAgentSession resolves.
     * The SessionBackend may not have fully registered the new session by
     * then — leaving the orchestrator's PTY without an onData listener for
     * the rest of its lifetime, which silently drops responses to user
     * messages until the side panel is opened (RCA 2026-04-29 / 2026-04-30).
     *
     * Total budget ≈ 8.6s with 5 attempts. Tuned to outlast typical
     * createAgentSession→backend-register lag (sub-1s on local, up to ~3s
     * under heavy load) without unbounded retries.
     */
    readonly MONITORING_RETRY_BACKOFFS_MS: readonly number[];
};
export declare const CHAT_ROUTING_CONSTANTS: {
    /** Message format prefix for chat routing */
    readonly MESSAGE_PREFIX: "CHAT";
    /** Message format prefix for Google Chat routing (distinguishes from Slack) */
    readonly GOOGLE_CHAT_PREFIX: "GCHAT";
};
/**
 * Unified notification marker constants.
 * Used by the orchestrator to send messages to chat, Slack, or both
 * via a single `[NOTIFY]...[/NOTIFY]` block with a JSON payload.
 */
export declare const NOTIFY_CONSTANTS: {
    /** Opening marker string for detection */
    readonly OPEN_TAG: "[NOTIFY]";
    /** Closing marker string */
    readonly CLOSE_TAG: "[/NOTIFY]";
};
/**
 * Slack proactive notification constants.
 * @deprecated Use NOTIFY_CONSTANTS instead. Legacy [SLACK_NOTIFY] markers are still
 * processed for backward compatibility but new orchestrator output should use [NOTIFY].
 */
export declare const SLACK_NOTIFY_CONSTANTS: {
    /** Opening marker string for detection */
    readonly OPEN_TAG: "[SLACK_NOTIFY]";
    /** Closing marker string */
    readonly CLOSE_TAG: "[/SLACK_NOTIFY]";
};
export declare const EVENT_DELIVERY_CONSTANTS: {
    /** Timeout for waiting for prompt detection (ms) */
    readonly PROMPT_DETECTION_TIMEOUT: 10000;
    /** Timeout for waiting for delivery confirmation (ms) */
    readonly DELIVERY_CONFIRMATION_TIMEOUT: 5000;
    /** Total timeout for message delivery with retries (ms) */
    readonly TOTAL_DELIVERY_TIMEOUT: 30000;
    /** Default timeout for pattern matching (ms) */
    readonly DEFAULT_PATTERN_TIMEOUT: 30000;
    /** Initial delay for terminal to echo short messages (ms) */
    readonly INITIAL_MESSAGE_DELAY: 300;
    /** Extra time for multi-line paste indicator detection (ms) */
    readonly PASTE_CHECK_DELAY: 1200;
    /** Delay between Enter key retry attempts (ms) */
    readonly ENTER_RETRY_DELAY: 800;
    /** Maximum number of Enter key retry attempts */
    readonly MAX_ENTER_RETRIES: 3;
    /** Delay after Enter retries exhausted before verifying message left input line (ms) */
    readonly POST_ENTER_VERIFICATION_DELAY: 500;
    /** Maximum buffer size for terminal output collection (bytes) */
    readonly MAX_BUFFER_SIZE: 10000;
    /** Minimum buffer length to consider processing detection valid */
    readonly MIN_BUFFER_FOR_PROCESSING_DETECTION: 50;
    /** Timeout for waiting for agent to return to prompt before delivery (ms) */
    readonly AGENT_READY_TIMEOUT: 120000;
    /** Shorter timeout for user messages (Slack/web chat) to reduce delivery delay (ms) */
    readonly USER_MESSAGE_TIMEOUT: 30000;
    /** Whether to force-deliver user messages after timeout instead of re-queuing */
    readonly USER_MESSAGE_FORCE_DELIVER: true;
    /** Shorter timeout for system events to reduce notification delay (ms).
     *  Reduced from 60s to 15s (#124) — agent completion notifications were
     *  taking 3-10 minutes because system events waited too long for prompt. */
    readonly SYSTEM_EVENT_TIMEOUT: 15000;
    /** Whether to force-deliver system events after timeout instead of re-queuing.
     *  System events are fire-and-forget (no response expected), so force-delivery
     *  is lower risk than for user messages. Prevents the 5×120s=10min retry loop. */
    readonly SYSTEM_EVENT_FORCE_DELIVER: true;
    /** Interval for polling agent prompt readiness (ms) */
    readonly AGENT_READY_POLL_INTERVAL: 2000;
    /** Interval for deep-scan polling with larger buffer when fast poll misses prompt (ms) */
    readonly DEEP_SCAN_INTERVAL: 5000;
    /** Number of lines to capture for deep-scan prompt detection */
    readonly DEEP_SCAN_LINES: 500;
    /** Number of PTY lines to scan when verifying force-delivered message acknowledgment */
    readonly PENDING_ACK_SCAN_LINES: 300;
    /** Maximum re-delivery attempts for force-delivered messages that were not acknowledged */
    readonly PENDING_ACK_MAX_RETRIES: 3;
    /** Time in milliseconds before a pending-ack entry is considered stale and discarded */
    readonly PENDING_ACK_TTL_MS: 600000;
};
/**
 * Constants for terminal content formatting.
 * Used by formatMessageContent to safely process terminal output.
 */
export declare const TERMINAL_FORMATTING_CONSTANTS: {
    /** Maximum repeat count for cursor movement sequences (prevents memory exhaustion) */
    readonly MAX_CURSOR_REPEAT: 1000;
};
/**
 * Terminal detection patterns for Claude Code interaction.
 * These patterns are used across multiple services to detect terminal state.
 */
export declare const TERMINAL_PATTERNS: {
    /**
     * Combined pattern for detecting spinner/working processing activity.
     * Simple single-char alternation — O(n), no backtracking risk.
     * Kept as RegExp for session-command-helper.ts waitForPattern() compatibility.
     */
    readonly PROCESSING: RegExp;
    /**
     * Pattern for detecting paste indicator in bracketed paste mode.
     * Appears as "[Pasted text #N +M lines]" in Claude Code.
     */
    readonly PASTE_INDICATOR: RegExp;
    /**
     * Pattern to detect if paste indicator is still visible (stuck state).
     */
    readonly PASTE_STUCK: RegExp;
    /**
     * Agent prompt indicators (characters that appear at input prompts).
     * Includes Claude Code (❯, >, ⏵), bash ($), and Gemini CLI (!).
     */
    readonly PROMPT_CHARS: readonly ["❯", ">", "›", "⏵", "$", "!"];
};
/**
 * Patterns for detecting Claude Code plan mode in terminal output.
 * When plan mode is detected, the session command helper should send
 * Escape to dismiss it before delivering messages.
 *
 * Re-exported from waiting-patterns to maintain a single source of truth.
 */
export { PLAN_MODE_PATTERNS as PLAN_MODE_DISMISS_PATTERNS } from './services/continuation/patterns/waiting-patterns.js';
/**
 * Message queue constants for sequential message processing.
 * Used by the MessageQueueService for orchestrator communication.
 */
export declare const MESSAGE_QUEUE_CONSTANTS: {
    /** Maximum number of messages allowed in the queue */
    readonly MAX_QUEUE_SIZE: 100;
    /** Default timeout for a single message response (ms) */
    readonly DEFAULT_MESSAGE_TIMEOUT: 180000;
    /** Maximum number of completed/failed messages retained in history */
    readonly MAX_HISTORY_SIZE: 50;
    /** Delay between processing consecutive messages (ms) */
    readonly INTER_MESSAGE_DELAY: 500;
    /** Maximum number of requeue retries before permanently failing a message */
    readonly MAX_REQUEUE_RETRIES: 5;
    /** Maximum number of system events to batch into a single delivery */
    readonly MAX_SYSTEM_EVENT_BATCH: 100;
    /** Max combined chars when coalescing pending system events in-queue */
    readonly MAX_SYSTEM_EVENT_COALESCE_CHARS: 12000;
    /** Maximum pending system events in queue before oldest are dropped (#218).
     *  Prevents agent status event floods from burying user messages. */
    readonly MAX_PENDING_SYSTEM_EVENTS: 10;
    /** Queue persistence file name (stored under crewly home) */
    readonly PERSISTENCE_FILE: "message-queue.json";
    /** Queue persistence directory name */
    readonly PERSISTENCE_DIR: "queue";
    /** Socket.IO event names for queue status updates */
    readonly SOCKET_EVENTS: {
        /** Emitted when a new message is enqueued */
        readonly MESSAGE_ENQUEUED: "queue:message_enqueued";
        /** Emitted when a message starts processing */
        readonly MESSAGE_PROCESSING: "queue:message_processing";
        /** Emitted when a message is completed */
        readonly MESSAGE_COMPLETED: "queue:message_completed";
        /** Emitted when a message fails */
        readonly MESSAGE_FAILED: "queue:message_failed";
        /** Emitted when a message is cancelled */
        readonly MESSAGE_CANCELLED: "queue:message_cancelled";
        /** Emitted with full queue status update */
        readonly STATUS_UPDATE: "queue:status_update";
    };
};
/**
 * Message replay constants for replaying pending messages after orchestrator restarts (#247).
 * Used by the MessageReplayService to scan chat history for unreplied user messages
 * that arrived while the orchestrator was offline, and replay them into the queue.
 */
export declare const MESSAGE_REPLAY_CONSTANTS: {
    /** Maximum age of messages to consider for replay (ms). Default: 24 hours */
    readonly MAX_REPLAY_WINDOW_MS: number;
    /** Minimum age of the persisted queue state before replaying (ms).
     *  Prevents replaying on quick restarts where no messages were likely missed. */
    readonly MIN_OFFLINE_DURATION_MS: 30000;
    /** Maximum number of messages to replay in a single startup cycle */
    readonly MAX_REPLAY_COUNT: 20;
    /** Prefix added to replayed messages for orchestrator awareness */
    readonly REPLAY_PREFIX: "[REPLAYED]";
};
/**
 * Thread Status Queue constants for tracking inbound message thread lifecycle.
 * Used by ThreadStatusQueueService for persistence, expiry, and recovery.
 */
export declare const THREAD_STATUS_CONSTANTS: {
    /** Persisted JSON filename under crewly home directory */
    readonly STORAGE_FILE: "thread-status-queue.json";
    /** Maximum number of entries to retain (oldest terminal entries pruned first) */
    readonly MAX_ENTRIES: 500;
    /** Timeout in minutes before a non-terminal thread is marked as expired */
    readonly STALE_TIMEOUT_MINUTES: 30;
    /** Retention period in hours for terminal entries before cleanup */
    readonly CLEANUP_RETENTION_HOURS: 24;
    /** Debounce interval in ms for persisting state to disk */
    readonly PERSIST_DEBOUNCE_MS: 100;
    /** Maximum number of delivery retries before marking as error */
    readonly MAX_RETRY_COUNT: 3;
    /** Maximum length of the message preview stored with each entry */
    readonly MAX_PREVIEW_LENGTH: 200;
    /** Markers in orchestrator replies that indicate delegation occurred */
    readonly DELEGATION_MARKERS: readonly ["[DELEGATED]", "[ASSIGNED]", "delegate-task", "delegated to"];
    /** Markers in orchestrator replies that indicate a follow-up question */
    readonly FOLLOW_UP_MARKERS: readonly ["?", "please clarify", "could you", "can you elaborate"];
};
/**
 * Activity monitor constants for agent idle/busy detection.
 * Used by ActivityMonitorService for terminal output polling.
 */
export declare const ACTIVITY_MONITOR_CONSTANTS: {
    /** Polling interval for checking terminal output changes (ms).
     *  Reduced from 120s to 30s (#124) to detect agent idle state faster,
     *  cutting notification delay from 2min to 30s worst-case. */
    readonly POLLING_INTERVAL_MS: 30000;
    /** Maximum time an agent can stay in_progress before auto-reset to idle (ms).
     *  Prevents workingStatus from getting stuck due to continuous terminal output
     *  (spinners, TUI re-renders). Default: 15 minutes. */
    readonly MAX_IN_PROGRESS_MS: 900000;
};
/**
 * Event bus constants for the agent event pub/sub system.
 * Used by EventBusService for subscription management and notification delivery.
 */
export declare const EVENT_BUS_CONSTANTS: {
    /** Debounce window for batching event notifications (ms).
     *  Events within this window are deduplicated per agent and delivered
     *  as a single combined message to reduce orchestrator context consumption. */
    readonly EVENT_DEBOUNCE_WINDOW_MS: 5000;
    /** Maximum wait time before forcing a flush of buffered notifications (ms).
     *  Prevents indefinite deferral when new events keep resetting the debounce timer.
     *  Set to 30 seconds — a reasonable ceiling for non-critical event delivery. */
    readonly MAX_BATCH_WAIT_MS: 30000;
    /** Default subscription time-to-live in minutes (8 hours).
     *  Increased from 2h to handle long-running tasks without subscription expiry. */
    readonly DEFAULT_SUBSCRIPTION_TTL_MINUTES: 480;
    /** Maximum allowed subscription TTL in minutes (24 hours) */
    readonly MAX_SUBSCRIPTION_TTL_MINUTES: 1440;
    /** Maximum subscriptions per subscriber session */
    readonly MAX_SUBSCRIPTIONS_PER_SESSION: 50;
    /** Maximum total subscriptions across all sessions */
    readonly MAX_TOTAL_SUBSCRIPTIONS: 200;
    /** Interval for cleaning up expired subscriptions (ms) */
    readonly CLEANUP_INTERVAL: 60000;
    /** Prefix for event notification messages delivered to orchestrator */
    readonly EVENT_MESSAGE_PREFIX: "EVENT";
    /** Threshold for cleaning stale entries from recentPublishMap */
    readonly DEDUP_MAP_CLEANUP_THRESHOLD: 100;
};
/**
 * Constants for Slack thread file storage.
 * Used by SlackThreadStoreService to persist thread conversations
 * and agent-thread associations.
 */
export declare const SLACK_THREAD_CONSTANTS: {
    /** Directory name under crewly home for thread files */
    readonly STORAGE_DIR: "slack-threads";
    /** JSON file mapping agents to their originating threads */
    readonly AGENT_INDEX_FILE: "agent-index.json";
    /** File extension for thread conversation files */
    readonly FILE_EXTENSION: ".md";
    /** Maximum age for thread files before cleanup (30 days) */
    readonly MAX_THREAD_AGE_MS: number;
};
/**
 * Constants for Google Chat thread file storage.
 * Used by GoogleChatThreadStoreService to persist thread conversations.
 */
export declare const GCHAT_THREAD_CONSTANTS: {
    /** Directory name under crewly home for thread files */
    readonly STORAGE_DIR: "gchat-threads";
    /** File extension for thread conversation files */
    readonly FILE_EXTENSION: ".md";
    /** Max recent messages to include as thread context in deliveries (#195) */
    readonly MAX_CONTEXT_MESSAGES: 10;
};
/**
 * Constants for Slack bridge fallback delivery.
 * When the reply-slack skill doesn't deliver within the wait window,
 * the bridge sends the response directly as a fallback.
 */
export declare const SLACK_BRIDGE_CONSTANTS: {
    /** Time to wait for the reply-slack skill to deliver before fallback (ms) */
    readonly SKILL_DELIVERY_WAIT_MS: 10000;
};
/**
 * Constants for cross-machine messaging via Slack.
 * Two Crewly instances communicate through a shared Slack channel.
 */
export declare const CROSS_MACHINE_CONSTANTS: {
    /** Maximum number of processed message IDs to track for deduplication */
    readonly MAX_TRACKED_MESSAGE_IDS: 500;
};
/**
 * Constants for Slack message deduplication.
 * Prevents identical messages from being sent to the same channel+thread
 * within a short time window.
 */
export declare const SLACK_DEDUP_CONSTANTS: {
    /** Time window in ms within which duplicate messages are suppressed (30 seconds) */
    readonly DEDUP_WINDOW_MS: 30000;
    /** Maximum number of message fingerprints to track in memory */
    readonly MAX_TRACKED_MESSAGES: 100;
};
/**
 * Constants for NOTIFY Slack delivery reconciliation.
 * Used by NotifyReconciliationService to retry failed Slack deliveries
 * using persisted chat messages as the source of truth.
 */
export declare const NOTIFY_RECONCILIATION_CONSTANTS: {
    /** Interval between reconciliation runs (5 minutes) */
    readonly RECONCILIATION_INTERVAL_MS: number;
    /** Maximum age of messages to consider for reconciliation (24 hours) */
    readonly MAX_MESSAGE_AGE_MS: number;
    /** Maximum number of delivery attempts before marking as failed */
    readonly MAX_DELIVERY_ATTEMPTS: 5;
    /** Delay before first reconciliation run after startup (30 seconds) */
    readonly STARTUP_DELAY_MS: number;
};
/**
 * Constants for Claude Code session resume via /resume slash command.
 * Used when restarting agents that were previously running before a backend restart.
 */
export declare const CLAUDE_RESUME_CONSTANTS: {
    /** Delay after sending /resume for the session picker to appear (ms) */
    readonly SESSION_PICKER_DELAY_MS: 3000;
    /** Timeout for Claude to resume and return to prompt (ms) */
    readonly RESUME_READY_TIMEOUT_MS: 30000;
};
/**
 * Constants for Gemini CLI shell mode detection and escape.
 * Gemini CLI enters "shell mode" when it receives a `!` prefix or via `/shell`.
 * In shell mode, input is executed as shell commands instead of being sent to the model.
 * The prompt changes from `>` to `!` (or `$` in some versions).
 */
export declare const GEMINI_SHELL_MODE_CONSTANTS: {
    /**
     * Patterns that indicate Gemini CLI is in shell mode.
     * Matches `!` prompt char (with optional box-drawing border) when NOT followed
     * by typical chat prompt indicators like "Type your message".
     */
    readonly SHELL_MODE_PROMPT_PATTERNS: readonly [RegExp, RegExp];
    /** Delay after sending Escape to wait for mode switch (ms) */
    readonly ESCAPE_DELAY_MS: 500;
    /** Maximum attempts to exit shell mode */
    readonly MAX_ESCAPE_ATTEMPTS: 3;
};
/**
 * Constants for Gemini CLI failure retry with exponential backoff.
 * When Gemini API errors (RESOURCE_EXHAUSTED, UNAVAILABLE, etc.) are detected,
 * the system waits and retries before declaring the agent dead. Gemini CLI
 * often recovers automatically from transient API errors.
 */
export declare const GEMINI_FAILURE_RETRY_CONSTANTS: {
    /** Maximum retry attempts before triggering exit/restart flow */
    readonly MAX_RETRIES: 5;
    /** Initial backoff delay (ms) — doubles each retry */
    readonly INITIAL_BACKOFF_MS: 1000;
    /** Maximum backoff delay cap (ms) */
    readonly MAX_BACKOFF_MS: 30000;
    /** Backoff multiplier per retry */
    readonly BACKOFF_MULTIPLIER: 2;
    /** Lines of terminal output to capture when checking for recovery */
    readonly RECOVERY_CHECK_LINES: 50;
};
/**
 * Named pattern for Gemini CLI stuck-connectivity detection (#128).
 * Matches "Trying to reach <model> (Attempt N/M)" output, indicating
 * the CLI is in a retry loop and won't recover without intervention.
 * Used in both GEMINI_FAILURE_PATTERNS and the sendMessageWithRetry guard.
 */
export declare const GEMINI_STUCK_CONNECTIVITY_PATTERN: RegExp;
/**
 * Gemini CLI failure patterns that indicate the CLI is stuck and needs recovery.
 * These patterns are distinct from exit patterns (which indicate the CLI has shut down
 * cleanly). Failure patterns match error states where the CLI may still be running
 * but is non-functional and requires a restart.
 *
 * Used by GeminiRuntimeService and RuntimeExitMonitorService.
 *
 * Note: Explicitly typed as `RegExp[]` instead of using `as const` because
 * `as const` produces a readonly tuple of regex literals, which complicates
 * usage with array methods like `.some()` and `.find()`.
 */
export declare const GEMINI_FAILURE_PATTERNS: RegExp[];
/**
 * Gemini CLI deliberation loop detection pattern (#188).
 * Matches repeated "Wait, I'll..." / "Actually, I'll..." planning text
 * that indicates the agent is stuck in an infinite deliberation cycle
 * without executing tool calls. A single occurrence is not a loop —
 * the RuntimeExitMonitorService counts occurrences in the output buffer
 * and only triggers recovery when the threshold is exceeded.
 */
export declare const GEMINI_DELIBERATION_PATTERN: RegExp;
/** Number of deliberation pattern matches in the terminal buffer before
 *  declaring the agent stuck in a deliberation loop (#188). */
export declare const GEMINI_DELIBERATION_THRESHOLD = 5;
/**
 * #251: Gemini tool-check loop detection pattern.
 * Matches repeated "Ready. Final response." or "Wait, I will check if I should use mcp_"
 * cycling that indicates the agent is stuck checking Chrome DevTools MCP tools
 * without making progress. Time-windowed: triggers when the pattern appears
 * GEMINI_TOOL_CHECK_LOOP_THRESHOLD times within GEMINI_TOOL_CHECK_LOOP_WINDOW_MS.
 */
export declare const GEMINI_TOOL_CHECK_LOOP_PATTERN: RegExp;
/** #251: Number of tool-check loop pattern matches within the time window
 *  before declaring the agent stuck. */
export declare const GEMINI_TOOL_CHECK_LOOP_THRESHOLD = 5;
/** #251: Time window in milliseconds for counting tool-check loop occurrences.
 *  If THRESHOLD matches occur within this window, the agent is considered stuck. */
export declare const GEMINI_TOOL_CHECK_LOOP_WINDOW_MS: number;
/**
 * Gemini update/upgrade markers that should trigger forced recovery.
 * These indicate the CLI interrupted the current request for self-update.
 */
export declare const GEMINI_FORCE_RESTART_PATTERNS: RegExp[];
/**
 * Claude Code fatal error patterns that indicate the CLI is stuck in an
 * unrecoverable state. Unlike transient API errors, these require an
 * immediate restart — no retry will resolve them.
 *
 * Example: When conversation history gets compacted and thinking blocks
 * are modified, the Claude API permanently rejects all subsequent requests
 * with a 400 error. The only recovery is to kill and restart the session.
 *
 * Used by RuntimeExitMonitorService to detect stuck Claude Code sessions.
 */
export declare const CLAUDE_FATAL_PATTERNS: RegExp[];
/**
 * Gemini CLI ready-state patterns used for recovery detection.
 * When any of these strings appear in terminal output, the CLI is
 * considered operational and ready to accept input.
 * Shared by RuntimeExitMonitorService and GeminiRuntimeService.
 */
export declare const GEMINI_READY_PATTERNS: readonly string[];
/**
 * Constants for detecting Gemini CLI error-overlay state (#130).
 * Used to identify and dismiss MCP connection error overlays
 * before message delivery.
 *
 * IMPORTANT: Detection must be narrow to avoid false positives (#130 follow-up).
 * Previous issues: STATUS_AREA_LINES=5 and generic /\d+ errors?/ matched normal
 * content (build output, test results), causing spurious F12 keypresses that
 * typed literal "F12" text into the terminal (because F12 was missing from KEY_CODES).
 *
 * Current approach: Only check the last 2 lines (actual status bar), and require
 * Gemini-specific patterns ("F12 for deta" or "✖" + "error") to avoid matching
 * generic error text from build tools, test runners, etc.
 */
export declare const GEMINI_ERROR_STATE_CONSTANTS: {
    /** Unicode marker for error state in Gemini CLI status bar */
    readonly ERROR_MARKER: "✖";
    /**
     * Regex matching Gemini CLI's specific error format in the status bar.
     * Requires "F12" nearby to distinguish from generic "N errors" text in
     * build output or test results. Matches: "3 errors (F12 for details)"
     */
    readonly ERROR_COUNT_PATTERN: RegExp;
    /**
     * Number of terminal lines from the bottom to consider as "status area".
     * Gemini CLI's status bar is 1-2 lines; using 3 for safety margin.
     * Previously 5, which caught content lines and caused false positives.
     */
    readonly STATUS_AREA_LINES: 3;
};
/**
 * Constants for runtime exit detection monitoring.
 * Used by RuntimeExitMonitorService to detect when an agent CLI exits.
 */
export declare const RUNTIME_EXIT_CONSTANTS: {
    /** Maximum rolling buffer size for terminal output (bytes) */
    readonly MAX_BUFFER_SIZE: 8192;
    /** Debounce delay after exit pattern match before confirming (ms) */
    readonly CONFIRMATION_DELAY_MS: 500;
    /**
     * Grace period after monitoring start to ignore false positives (ms).
     * Set to 0 because exit patterns (e.g. "Agent powering down",
     * "Interaction Summary") are specific enough to not appear during
     * normal runtime initialization output.
     */
    readonly STARTUP_GRACE_PERIOD_MS: 0;
    /**
     * Grace period for API activity before confirming a runtime exit (ms).
     * If the agent made an API call within this window, the exit detection
     * is treated as a false positive and skipped. This prevents false
     * restarts when agents are actively calling skills/APIs but happen to
     * produce PTY output that matches exit patterns.
     */
    readonly API_ACTIVITY_GRACE_PERIOD_MS: 120000;
    /**
     * Interval for polling child process liveness (ms).
     * Used as a fallback when pattern-based exit detection misses an exit.
     * Checks if the runtime process (e.g. claude) is still alive via pgrep.
     */
    readonly PROCESS_POLL_INTERVAL_MS: 10000;
    /**
     * Grace period after monitoring starts before process polling begins (ms).
     * Prevents false positives during startup when the CLI process hasn't
     * spawned yet.
     */
    readonly PROCESS_POLL_GRACE_PERIOD_MS: 30000;
};
/**
 * Constants for context window monitoring and auto-recovery.
 * Used by ContextWindowMonitorService to detect when an agent's Claude Code
 * session is running low on context and trigger proactive warnings or recovery.
 */
export declare const CONTEXT_WINDOW_MONITOR_CONSTANTS: {
    /** Interval for periodic stale detection and cleanup (ms) */
    readonly CHECK_INTERVAL_MS: 30000;
    /** Context usage threshold for yellow (warning) level (%) */
    readonly YELLOW_THRESHOLD_PERCENT: 70;
    /** Context usage threshold for red (danger) level (%) */
    readonly RED_THRESHOLD_PERCENT: 85;
    /** Context usage threshold for critical level (%) — triggers compact retry */
    readonly CRITICAL_THRESHOLD_PERCENT: 95;
    /**
     * Whether auto-recovery (session kill + restart) is enabled at critical threshold.
     * Disabled by default — prefer runtime-native compact/compress commands which
     * preserve session state. Auto-recovery is a last resort that loses all context.
     */
    readonly AUTO_RECOVERY_ENABLED: false;
    /** Maximum recovery attempts within the cooldown window */
    readonly MAX_RECOVERIES_PER_WINDOW: 2;
    /** Cooldown window for recovery rate limiting (30 minutes) */
    readonly COOLDOWN_WINDOW_MS: number;
    /** Grace period after monitoring start to ignore early readings (ms) */
    readonly STARTUP_GRACE_PERIOD_MS: 60000;
    /** Maximum rolling buffer size for PTY output (bytes) */
    readonly MAX_BUFFER_SIZE: 4096;
    /** Threshold for considering a context state stale (5 minutes) */
    readonly STALE_DETECTION_THRESHOLD_MS: number;
    /** Time to wait after sending compact command before checking result (ms) */
    readonly COMPACT_WAIT_MS: 120000;
    /** Maximum compact attempts per threshold episode before giving up */
    readonly MAX_COMPACT_ATTEMPTS: 3;
    /** Cooldown between compact retries during periodic checks (ms) */
    readonly COMPACT_RETRY_COOLDOWN_MS: 60000;
    /** Cumulative output bytes threshold before triggering proactive compact (~500KB) */
    readonly PROACTIVE_COMPACT_THRESHOLD_BYTES: 512000;
    /** Cooldown between proactive compact triggers per session (10 minutes) */
    readonly PROACTIVE_COMPACT_COOLDOWN_MS: 600000;
};
/**
 * Compact commands per runtime type.
 *
 * Each AI runtime has its own slash command to trigger context compression:
 * - Claude Code: `/compact`
 * - Gemini CLI: `/compress`
 * - Codex CLI: `/compact`
 */
export declare const RUNTIME_COMPACT_COMMANDS: Record<RuntimeType, string>;
/**
 * Constants for OAuth auto-relogin monitoring.
 * Used by OAuthReloginMonitorService to detect OAuth token expiry errors
 * in PTY session output and automatically send /login to re-authenticate.
 */
export declare const OAUTH_RELOGIN_CONSTANTS: {
    /** Maximum rolling buffer size for PTY output (bytes) */
    readonly MAX_BUFFER_SIZE: 4096;
    /** Cooldown between /login attempts per session (ms) — 2 minutes */
    readonly RELOGIN_COOLDOWN_MS: 120000;
    /** Grace period after session start before monitoring begins (ms) */
    readonly STARTUP_GRACE_PERIOD_MS: 30000;
    /** Delay after detecting error before sending /login (ms) — debounce */
    readonly DETECTION_DEBOUNCE_MS: 2000;
    /** Maximum /login attempts per cooldown window before giving up */
    readonly MAX_ATTEMPTS_PER_WINDOW: 3;
    /** Cooldown window for tracking max attempts (ms) — 10 minutes */
    readonly ATTEMPT_WINDOW_MS: 600000;
    /** Delay after sending Escape before writing /login command (ms) */
    readonly PRE_COMMAND_DELAY_MS: 200;
    /** Timeout for waiting for OAuth URL to appear after /login (ms) — 30 seconds */
    readonly URL_CAPTURE_TIMEOUT_MS: 30000;
    /** Max buffer size during URL capture mode (bytes) — larger to capture full URL */
    readonly URL_CAPTURE_BUFFER_SIZE: 8192;
};
/**
 * String patterns that indicate authentication failure in PTY output.
 * Covers OAuth token expiry AND invalid/revoked credentials.
 * Uses plain string matching (indexOf) instead of regex to prevent ReDoS.
 * All patterns must be present (AND logic) within the rolling buffer.
 */
export declare const OAUTH_ERROR_PATTERN_SETS: string[][];
/**
 * Constants for sub-agent message queue.
 * Used by SubAgentMessageQueue to buffer messages for agents that haven't
 * completed initialization (status !== 'active') yet.
 */
export declare const SUB_AGENT_QUEUE_CONSTANTS: {
    /** Maximum messages per agent before dropping oldest */
    readonly MAX_QUEUE_SIZE: 50;
    /** Delay between flushed messages on registration (ms) */
    readonly FLUSH_INTER_MESSAGE_DELAY: 2000;
};
/**
 * Constants for proactive system resource monitoring and alerting.
 * Used by SystemResourceAlertService to poll metrics, check thresholds,
 * and send user-facing notifications before resources are exhausted.
 */
export declare const SYSTEM_RESOURCE_ALERT_CONSTANTS: {
    /** Polling interval for resource checks (ms) */
    readonly POLL_INTERVAL: 60000;
    /** Cooldown between repeated alerts for the same metric (ms) */
    readonly ALERT_COOLDOWN: 600000;
    /** Thresholds for triggering alerts */
    readonly THRESHOLDS: {
        readonly DISK_WARNING: 85;
        readonly DISK_CRITICAL: 95;
        readonly MEMORY_WARNING: 85;
        readonly MEMORY_CRITICAL: 95;
        readonly CPU_WARNING: 80;
        readonly CPU_CRITICAL: 95;
    };
};
/**
 * Shared Slack API limits used by both image and file upload services.
 */
export declare const SLACK_API_LIMITS: {
    /** Maximum allowed file size (20 MB — Slack limit) */
    readonly MAX_FILE_SIZE: number;
    /** Maximum number of retry attempts for Slack API 429 responses */
    readonly UPLOAD_MAX_RETRIES: 3;
    /** Default backoff delay (ms) when no Retry-After header is present */
    readonly UPLOAD_DEFAULT_BACKOFF_MS: 5000;
};
/**
 * Constants for Slack image download and temporary storage.
 * Used by SlackImageService to validate, download, and manage
 * images sent by users in Slack messages.
 */
export declare const SLACK_IMAGE_CONSTANTS: {
    /** Temp directory for downloaded images (relative to ~/.crewly/) */
    readonly TEMP_DIR: "tmp/slack-images";
    /** Maximum allowed file size for image downloads (20 MB) */
    readonly MAX_FILE_SIZE: number;
    /** Supported image MIME types for download (SVG excluded — not accepted by LLM vision APIs) */
    readonly SUPPORTED_MIMES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp"];
    /**
     * Expected Content-Type prefixes for valid image responses from Slack.
     * Used to detect when Slack returns an HTML error page instead of an image.
     */
    readonly VALID_RESPONSE_CONTENT_TYPES: readonly ["image/"];
    /**
     * Magic byte signatures for supported image formats.
     * Used to verify that a downloaded file is actually an image
     * (Slack can return 200 OK with an HTML body when auth fails).
     */
    readonly IMAGE_MAGIC_BYTES: {
        readonly PNG: readonly [137, 80, 78, 71];
        readonly JPEG: readonly [255, 216, 255];
        readonly GIF87: readonly [71, 73, 70, 56, 55];
        readonly GIF89: readonly [71, 73, 70, 56, 57];
        readonly WEBP_RIFF: readonly [82, 73, 70, 70];
    };
    /** Interval for cleaning up expired temp files (1 hour) */
    readonly CLEANUP_INTERVAL: number;
    /** Maximum age for temp files before cleanup (24 hours) */
    readonly FILE_TTL: number;
    /** Maximum concurrent image downloads per message */
    readonly MAX_CONCURRENT_DOWNLOADS: 3;
    /** Warning threshold for temp directory total size (500 MB) */
    readonly MAX_TEMP_DIR_SIZE: number;
    /** Maximum redirect hops to follow during file download */
    readonly MAX_DOWNLOAD_REDIRECTS: 5;
    /** Maximum number of retry attempts for Slack API 429 responses */
    readonly UPLOAD_MAX_RETRIES: 3;
    /** Default backoff delay (ms) when no Retry-After header is present */
    readonly UPLOAD_DEFAULT_BACKOFF_MS: 5000;
};
/**
 * Constants for generic file uploads to Slack channels.
 * Used by the upload-file endpoint and send-pdf-to-slack skill
 * to validate and upload arbitrary file types (PDF, images, docs, etc.).
 */
export declare const SLACK_FILE_UPLOAD_CONSTANTS: {
    /** Temp directory for generated PDFs (relative to ~/.crewly/) */
    readonly TEMP_DIR: "tmp/slack-pdfs";
    /** Maximum allowed file size for uploads (20 MB — Slack limit) */
    readonly MAX_FILE_SIZE: number;
    /** File extensions accepted for upload */
    readonly SUPPORTED_EXTENSIONS: readonly [".pdf", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg", ".txt", ".csv", ".doc", ".docx", ".xls", ".xlsx", ".mp4", ".mov", ".avi", ".mkv", ".mp3", ".wav", ".zip"];
    /** Maximum number of retry attempts for Slack API 429 responses */
    readonly UPLOAD_MAX_RETRIES: 3;
    /** Default backoff delay (ms) when no Retry-After header is present */
    readonly UPLOAD_DEFAULT_BACKOFF_MS: 5000;
};
/**
 * Constants for downloading non-image file attachments from Slack messages.
 * Used by SlackOrchestratorBridge to download generic files (PDFs, docs, etc.)
 * sent by users so agents can access them via file-reading tools.
 */
/**
 * Slack Socket Mode reconnection constants.
 * Controls automatic reconnection when network drops cause the WebSocket
 * to die and Bolt's built-in reconnect fails to recover.
 */
export declare const SLACK_RECONNECT_CONSTANTS: {
    /** Initial delay before first reconnection attempt (ms) */
    readonly INITIAL_DELAY_MS: 2000;
    /** Maximum delay between reconnection attempts (ms) */
    readonly MAX_DELAY_MS: 60000;
    /** Backoff multiplier applied after each failed attempt */
    readonly BACKOFF_MULTIPLIER: 2;
    /** Maximum number of consecutive reconnection attempts before giving up (0 = unlimited) */
    readonly MAX_ATTEMPTS: 50;
    /** Grace period after a disconnect before starting reconnection (ms).
     *  Gives Bolt's built-in reconnect a chance to recover first. */
    readonly GRACE_PERIOD_MS: 10000;
    /** Interval for periodic connection health checks (ms) */
    readonly HEALTH_CHECK_INTERVAL_MS: 30000;
    /** Timeout for the auth.test API ping during health checks (ms) */
    readonly PING_TIMEOUT_MS: 10000;
    /** Number of consecutive ping failures before forcing a reconnect */
    readonly PING_FAILURES_BEFORE_RECONNECT: 2;
};
export declare const SLACK_FILE_DOWNLOAD_CONSTANTS: {
    /** Temp directory for downloaded files (relative to ~/.crewly/) */
    readonly TEMP_DIR: "tmp/slack-files";
    /** Maximum allowed file size for downloads (20 MB — Slack limit) */
    readonly MAX_FILE_SIZE: number;
    /** Maximum concurrent file downloads per message */
    readonly MAX_CONCURRENT_DOWNLOADS: 3;
    /** Maximum redirect hops to follow during file download */
    readonly MAX_DOWNLOAD_REDIRECTS: 5;
    /** Timeout for individual file download requests (ms) */
    readonly DOWNLOAD_TIMEOUT_MS: 60000;
    /** Maximum extracted text length included inline in messages (characters) */
    readonly MAX_EXTRACTED_TEXT_LENGTH: 8000;
    /** MIME types eligible for text extraction */
    readonly EXTRACTABLE_MIMES: readonly string[];
};
/**
 * Message source identifiers for the queue processor.
 * Determines delivery strategy (timeouts, retry behavior).
 */
export declare const MESSAGE_SOURCES: {
    readonly SLACK: "slack";
    readonly WHATSAPP: "whatsapp";
    readonly WEB_CHAT: "web_chat";
    readonly SYSTEM_EVENT: "system_event";
    readonly GOOGLE_CHAT: "google_chat";
    readonly TELEGRAM: "telegram";
    readonly CROSS_MACHINE: "cross-machine";
    readonly REMOTE: "remote";
};
/**
 * Constants for Google Chat Pub/Sub integration.
 * Used by GoogleChatMessengerAdapter for pulling messages from a Pub/Sub subscription
 * and replying via the Chat API.
 */
export declare const GOOGLE_CHAT_PUBSUB_CONSTANTS: {
    /** Interval between Pub/Sub pull requests (ms) */
    readonly PULL_INTERVAL_MS: 5000;
    /** Maximum messages to pull per request */
    readonly MAX_MESSAGES_PER_PULL: 10;
    /** OAuth2 scope for Pub/Sub API access */
    readonly PUBSUB_SCOPE: "https://www.googleapis.com/auth/pubsub";
    /** OAuth2 scope for Google Chat API access */
    readonly CHAT_SCOPE: "https://www.googleapis.com/auth/chat.bot";
    /** Pub/Sub REST API base URL */
    readonly PUBSUB_API_BASE: "https://pubsub.googleapis.com/v1";
    /** Google Chat REST API base URL */
    readonly CHAT_API_BASE: "https://chat.googleapis.com/v1";
    /** Timeout for Pub/Sub API calls (ms) */
    readonly FETCH_TIMEOUT_MS: 15000;
    /** Max consecutive pull failures before pausing */
    readonly MAX_CONSECUTIVE_FAILURES: 5;
    /** Maximum message length for the Google Chat API (characters) */
    readonly MAX_MESSAGE_LENGTH: 4096;
};
/**
 * Constants for Telegram Bot API integration.
 * Used by TelegramService for polling incoming messages and sending replies.
 */
export declare const TELEGRAM_CONSTANTS: {
    /** Interval between getUpdates polling requests (ms) */
    readonly POLL_INTERVAL_MS: 3000;
    /** Timeout for long-polling requests (seconds, sent to Telegram API) */
    readonly LONG_POLL_TIMEOUT_S: 30;
    /** Timeout for fetch requests (ms) */
    readonly FETCH_TIMEOUT_MS: 35000;
    /** Telegram Bot API base URL */
    readonly API_BASE: "https://api.telegram.org/bot";
    /** Maximum message length for Telegram API (characters) */
    readonly MAX_MESSAGE_LENGTH: 4096;
    /** Max consecutive poll failures before pausing */
    readonly MAX_CONSECUTIVE_FAILURES: 5;
    /** Credentials file name */
    readonly CREDENTIALS_FILE: "telegram-credentials.json";
    /** Chat routing prefix for incoming Telegram messages */
    readonly CHAT_PREFIX: "TELEGRAM";
};
export declare const MARKETPLACE_CONSTANTS: {
    readonly PUBLIC_REGISTRY_URL: "https://raw.githubusercontent.com/stevehuang0115/crewly/main/config/skills/registry.json";
    readonly PUBLIC_CDN_BASE: "https://raw.githubusercontent.com/stevehuang0115/crewly/main";
    readonly PREMIUM_BASE_URL: "https://crewlyai.com";
    readonly PREMIUM_REGISTRY_ENDPOINT: "/api/registry/skills";
    readonly ASSETS_ENDPOINT: "/api/assets";
    readonly CACHE_TTL: 3600000;
    readonly DIR_NAME: "marketplace";
    readonly MANIFEST_FILE: "manifest.json";
    readonly LOCAL_REGISTRY_FILE: "local-registry.json";
    readonly SUBMISSIONS_DIR: "submissions";
    readonly GITHUB_REPO: "stevehuang0115/crewly";
    readonly SCHEMA_VERSION: 2;
    readonly DOWNLOAD_TIMEOUT: 30000;
    readonly GITHUB_FILE_TIMEOUT: 15000;
    readonly REGISTRY_FETCH_TIMEOUT: 10000;
    readonly CATEGORY_MAP: Record<string, string>;
};
export declare const TEMPLATE_MARKETPLACE_CONSTANTS: {
    readonly TEMPLATES_DIR: "templates";
    readonly STORE_FILE: "templates.json";
    readonly VERSIONS_DIR: "versions";
    readonly VERSIONS_FILE: "versions.json";
    readonly SCHEMA_VERSION: 1;
    readonly MAX_NAME_LENGTH: 100;
    readonly MAX_DESCRIPTION_LENGTH: 2000;
    readonly MAX_CHANGELOG_LENGTH: 5000;
    readonly MAX_TAGS: 20;
    readonly MAX_TAG_LENGTH: 50;
};
/** Typed message source value */
export type MessageSource = (typeof MESSAGE_SOURCES)[keyof typeof MESSAGE_SOURCES];
/**
 * Constants for WhatsApp integration via Baileys.
 * Used by WhatsAppService, WhatsAppOrchestratorBridge, and WhatsApp controller
 * for connection management and message handling.
 */
export declare const WHATSAPP_CONSTANTS: {
    /** Directory name for auth state persistence (under ~/.crewly/) */
    readonly AUTH_DIR: "whatsapp-auth";
    /** Maximum text message length (WhatsApp limit) */
    readonly MAX_MESSAGE_LENGTH: 4000;
    /** Maximum file size for sending documents (5 MB) */
    readonly MAX_FILE_SIZE: number;
    /** Delay between reconnection attempts (ms) */
    readonly RECONNECT_INTERVAL_MS: 5000;
    /** Timeout for QR code scanning before expiry (ms) */
    readonly QR_TIMEOUT_MS: 60000;
    /** Maximum response length from orchestrator before truncation */
    readonly MAX_RESPONSE_LENGTH: 3000;
    /** Buffer added to message queue timeout for response timeout (ms) */
    readonly RESPONSE_TIMEOUT_BUFFER_MS: 5000;
    /** Regex pattern for WhatsApp JID suffix */
    readonly JID_SUFFIX_PATTERN: RegExp;
    /** Regex pattern for phone number + prefix */
    readonly PHONE_PREFIX_PATTERN: RegExp;
    /** Fallback timeout when MESSAGE_QUEUE_CONSTANTS is unavailable (ms) */
    readonly DEFAULT_FALLBACK_TIMEOUT_MS: 120000;
};
/** Google OAuth endpoint URLs and default scopes. */
export declare const GOOGLE_OAUTH_CONSTANTS: {
    readonly AUTH_BASE_URL: "https://accounts.google.com/o/oauth2/v2/auth";
    readonly TOKEN_ENDPOINT: "https://oauth2.googleapis.com/token";
    readonly USERINFO_ENDPOINT: "https://www.googleapis.com/oauth2/v2/userinfo";
    /**
     * Default OAuth scopes requested by the standalone /api/oauth/google flow.
     *
     * `gmail.modify` is a Google-side functional superset that covers
     * `gmail.readonly`, `gmail.send`, and label/state mutations. Declaring
     * the single most-capable Gmail scope here means new credentials issued
     * via this flow can drive all 9 actions of the agent `gmail` skill on
     * one OAuth grant — no re-auth required when an agent moves from
     * read-only to send to label management.
     */
    readonly DEFAULT_SCOPES: readonly ["openid", "email", "https://www.googleapis.com/auth/gmail.modify"];
    /** Google Workspace scopes for agent-driven operations (Phase 1). */
    readonly WORKSPACE_SCOPES: readonly ["https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.send", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/calendar.events", "https://www.googleapis.com/auth/documents"];
};
/**
 * Constants for CrewlyAI Cloud integration.
 * Used by CloudClientService and CloudAuthMiddleware to connect
 * the open-source Crewly instance to CrewlyAI Cloud for premium features.
 */
export declare const CLOUD_CONSTANTS: {
    /** Default CrewlyAI Cloud API base URL (env: CREWLY_CLOUD_URL) */
    readonly DEFAULT_CLOUD_URL: string;
    /** API version prefix for all cloud endpoints */
    readonly API_VERSION: "/v1";
    /** Cloud API endpoints */
    readonly ENDPOINTS: {
        /** Authentication and token verification (matches crewly-auth /api/cloud/validate) */
        readonly AUTH_TOKEN: "/api/cloud/validate";
        /** Sync local config with cloud subscription status */
        readonly SYNC: "/v1/cloud/sync";
        /** List premium templates */
        readonly TEMPLATES: "/v1/templates/premium";
        /** Get template detail by ID */
        readonly TEMPLATE_DETAIL: "/v1/templates/premium/:id";
    };
    /** HTTP request timeouts (ms) */
    readonly TIMEOUTS: {
        /** Timeout for connect/auth requests */
        readonly CONNECT: 10000;
        /** Timeout for fetching template lists */
        readonly FETCH_TEMPLATES: 15000;
        /** Timeout for fetching template detail */
        readonly FETCH_TEMPLATE_DETAIL: 10000;
        /** Timeout for status/sync requests */
        readonly STATUS: 5000;
    };
    /** Subscription tiers */
    readonly TIERS: {
        readonly FREE: "free";
        readonly PRO: "pro";
        readonly ENTERPRISE: "enterprise";
    };
    /** Connection statuses */
    readonly CONNECTION_STATUS: {
        readonly DISCONNECTED: "disconnected";
        readonly CONNECTED: "connected";
        readonly ERROR: "error";
        /** Token expired or revoked — cloud API returned 401/403 */
        readonly TOKEN_EXPIRED: "token_expired";
    };
    /** Cloud Relay API endpoints (relative to cloudUrl) */
    readonly RELAY_ENDPOINTS: {
        /** List all devices registered to the authenticated user */
        readonly DEVICES: "/api/v1/relay/devices";
    };
};
/**
 * Constants for the Cloud Sync system.
 * Replaces the WebSocket Relay pairing model with heartbeat-based device
 * discovery and HTTP-polled messaging.
 *
 * @see docs/cloud-sync-design.md
 */
export declare const CLOUD_SYNC_CONSTANTS: {
    /** Interval between heartbeat uploads (ms) */
    readonly HEARTBEAT_INTERVAL_MS: 30000;
    /**
     * Idle interval between message poll requests (ms). Used as the gap when
     * long-poll is disabled (`MESSAGE_LONGPOLL_WAIT_MS = 0`), after a poll
     * error, or as the auto-degrade fallback when the relay returns a held
     * long-poll near-instantly (i.e. it doesn't support `wait=`).
     */
    readonly MESSAGE_POLL_INTERVAL_MS: 5000;
    /**
     * Long-poll hold time (ms) sent to the relay as `?wait=`. The relay holds
     * `/queue/poll` open until a message arrives (or this deadline), so the OSS
     * picks up Portal `chat_request`s near-instantly instead of on the old 5s
     * tick. Set to 0 to disable and fall back to fixed-interval polling. Kept
     * under the relay's own 25s ceiling.
     */
    readonly MESSAGE_LONGPOLL_WAIT_MS: 20000;
    /**
     * HTTP request timeout (ms) for the long-poll message fetch. MUST exceed
     * {@link MESSAGE_LONGPOLL_WAIT_MS} so the client doesn't abort the held
     * connection before the relay's deadline returns it.
     */
    readonly MESSAGE_LONGPOLL_TIMEOUT_MS: 30000;
    /** Gap (ms) before re-opening the next long-poll after one returns. */
    readonly MESSAGE_LONGPOLL_GAP_MS: 100;
    /** Interval between device list poll requests (ms) */
    readonly DEVICE_POLL_INTERVAL_MS: 30000;
    /**
     * Interval between queue/register re-registrations (ms).
     *
     * The relay's auto-pair only matches devices in `pairingWait`. If a
     * Portal that was paired with this OSS closes uncleanly (closed tab,
     * hard crash), the relay leaves OSS wedged `state: paired` against
     * the dead session — and every fresh Portal that registers afterward
     * joins pairingWait alone with no peer to match. The relay's
     * register-time stale-pair eviction frees us, but only on the next
     * register. We re-register on this interval so recovery is bounded.
     */
    readonly REGISTER_INTERVAL_MS: 60000;
    /** Device considered offline after this threshold (ms) */
    readonly OFFLINE_THRESHOLD_MS: 60000;
    /** HTTP request timeout for sync API calls (ms) */
    readonly REQUEST_TIMEOUT_MS: 15000;
    /** Maximum consecutive failures before entering error state */
    readonly MAX_CONSECUTIVE_FAILURES: 10;
    /** Interval between error recovery attempts after entering error state (ms).
     *  Periodically retries a heartbeat to check if Cloud is reachable again. */
    readonly ERROR_RECOVERY_INTERVAL_MS: 60000;
    /** Maximum error recovery attempts before entering auth_expired terminal state */
    readonly MAX_ERROR_RECOVERY_ATTEMPTS: 5;
    /** Cloud Sync API endpoints (relative to cloudUrl) — must match web project routes at /api/v1/relay/* */
    readonly ENDPOINTS: {
        /** Device heartbeat/handshake — POST to Cloud Relay (registers device + updates metadata) */
        readonly HEARTBEAT: "/api/v1/relay/handshake";
        /** List all devices for account (auto-registers caller on GET) */
        readonly DEVICES: "/api/v1/relay/devices";
        /** Send a message to another device via Cloud message queue */
        readonly MESSAGES: "/api/v1/relay/queue/send";
        /** Poll for incoming messages (GET with ?queueId= or uses JWT deviceId) */
        readonly MESSAGES_POLL: "/api/v1/relay/queue/poll";
        /** Acknowledge processed messages */
        readonly MESSAGES_ACK: "/api/v1/relay/queue/ack";
    };
};
/** Subscription tier type */
export type CloudTier = (typeof CLOUD_CONSTANTS.TIERS)[keyof typeof CLOUD_CONSTANTS.TIERS];
/** Cloud connection status type */
export type CloudConnectionStatus = (typeof CLOUD_CONSTANTS.CONNECTION_STATUS)[keyof typeof CLOUD_CONSTANTS.CONNECTION_STATUS];
/**
 * Constants for CrewlyAI Cloud account authentication and licensing.
 * Used by AuthService and JwtAuthMiddleware for user registration,
 * login, JWT management, and plan-based feature gating.
 */
export declare const AUTH_CONSTANTS: {
    /** JWT configuration */
    readonly JWT: {
        /** JWT secret (env: CREWLY_JWT_SECRET, falls back to dev default) */
        readonly DEFAULT_SECRET: string;
        /** Access token expiry in seconds (1 hour) */
        readonly ACCESS_TOKEN_EXPIRY_S: 3600;
        /** Refresh token expiry in seconds (30 days) */
        readonly REFRESH_TOKEN_EXPIRY_S: 2592000;
        /** JWT algorithm identifier */
        readonly ALGORITHM: "HS256";
        /** JWT issuer claim */
        readonly ISSUER: "crewly-cloud";
    };
    /** User plans */
    readonly PLANS: {
        readonly FREE: "free";
        readonly PRO: "pro";
        readonly ENTERPRISE: "enterprise";
    };
    /** Storage paths relative to ~/.crewly/ */
    readonly STORAGE: {
        /** Directory for cloud user data */
        readonly CLOUD_DIR: "cloud";
        /** Directory for user accounts */
        readonly USERS_DIR: "cloud/users";
        /** File storing user index (email → id mapping) */
        readonly USER_INDEX_FILE: "cloud/users/index.json";
    };
    /** Pro features list */
    readonly PRO_FEATURES: readonly ["template-marketplace", "premium-templates", "priority-support"];
};
/** User plan type */
export type UserPlan = (typeof AUTH_CONSTANTS.PLANS)[keyof typeof AUTH_CONSTANTS.PLANS];
/** Device heartbeat constants for dual-machine connectivity */
export declare const DEVICE_CONSTANTS: {
    /** Time-to-live for device heartbeat (ms) */
    readonly HEARTBEAT_TTL_MS: 60000;
    /** Storage directory for device state (relative to ~/.crewly/) */
    readonly DEVICES_DIR: "cloud/devices";
    /** Maximum teams per heartbeat payload */
    readonly MAX_TEAMS_PER_HEARTBEAT: 50;
};
/**
 * Constants for Supabase-backed Cloud Auth.
 * Used by CloudAuthService for user registration, login,
 * session management, and license verification via Supabase.
 *
 * Supabase credentials are read from env vars (CREWLY_SUPABASE_URL,
 * CREWLY_SUPABASE_ANON_KEY) with dev-project defaults as fallback.
 */
export declare const CLOUD_AUTH_CONSTANTS: {
    /** Google OAuth configuration for Cloud Console login */
    readonly GOOGLE: {
        /** Google OAuth Client ID (env: GOOGLE_CLIENT_ID) */
        readonly CLIENT_ID: string;
    };
    /** MongoDB collections */
    readonly COLLECTIONS: {
        readonly USERS: "users";
        readonly SESSIONS: "sessions";
    };
    /** License statuses */
    readonly LICENSE_STATUS: {
        readonly ACTIVE: "active";
        readonly EXPIRED: "expired";
        readonly CANCELLED: "cancelled";
    };
};
/**
 * Constants for the Auditor Scheduler Service.
 * Controls periodic, event-driven, and API audit triggers.
 *
 * The auditor operates in always-active mode: initialized at server start,
 * remains alive between audits, and only shuts down when the service stops.
 */
export declare const AUDITOR_SCHEDULER_CONSTANTS: {
    /** Periodic full-sweep audit interval (15 minutes) */
    readonly AUDIT_INTERVAL_MS: number;
    /** Debounce window for event-driven triggers (30 seconds) */
    readonly EVENT_DEBOUNCE_MS: 30000;
    /** Maximum time a single audit run can take before timeout (10 minutes).
     *  Note: timeout does NOT shutdown the runtime (always-active mode). */
    readonly AUDIT_TIMEOUT_MS: number;
    /** Session name for the auditor agent */
    readonly AUDITOR_SESSION_NAME: "crewly-auditor";
    /** Event types that trigger an audit run */
    readonly TRIGGER_EVENT_TYPES: readonly string[];
    /** Command message sent to the auditor agent to start an audit cycle */
    readonly AUDIT_COMMAND: "Run a full audit cycle: check team status, review agent logs for errors, verify task alignment with goals, and write findings to the audit report.";
    /** Slack auditor prefix regex pattern (used in SlackOrchestratorBridge) */
    readonly SLACK_PREFIX_PATTERN: RegExp;
    /** Maximum session creation retries before entering cooldown */
    readonly MAX_SESSION_RETRIES: 3;
    /** Cooldown period after max retries exhausted (5 minutes) */
    readonly SESSION_RETRY_COOLDOWN_MS: number;
    /** Initial backoff between session creation retries (10 seconds) */
    readonly SESSION_RETRY_INITIAL_BACKOFF_MS: 10000;
    /** Backoff multiplier for exponential retry */
    readonly SESSION_RETRY_BACKOFF_MULTIPLIER: 2;
    /** Delay before re-triggering after auditor's own session goes inactive (30 seconds).
     *  This bridges the gap between the auditor exiting and the next L1 periodic trigger
     *  (up to 15 min away), ensuring the auditor recovers quickly after context exhaustion. */
    readonly SESSION_RECOVERY_DELAY_MS: 30000;
};
/** Log rotation service constants for managing session log file sizes */
export declare const LOG_ROTATION_CONSTANTS: {
    /** Maximum size for active session logs before truncation (20MB) */
    readonly MAX_LOG_SIZE_BYTES: number;
    /** Maximum size for orphan logs (no active session) before truncation (5MB) */
    readonly ORPHAN_LOG_MAX_SIZE_BYTES: number;
    /** Days to retain archived log files before deletion */
    readonly ARCHIVE_RETENTION_DAYS: 7;
    /** Interval between rotation checks in milliseconds (1 hour) */
    readonly LOG_ROTATION_INTERVAL_MS: number;
    /** Whether to archive old log content before truncation */
    readonly LOG_ROTATION_ARCHIVE_ENABLED: true;
    /** Directory name for session logs under ~/.crewly/logs/ */
    readonly SESSIONS_LOG_DIR: "sessions";
    /** Directory name for archived logs under ~/.crewly/logs/ */
    readonly ARCHIVE_DIR: "archive";
    /** Base log directory under ~/.crewly/ */
    readonly LOGS_DIR: "logs";
};
/** OpenTelemetry tracing configuration constants */
export declare const TRACING_CONSTANTS: {
    /** Default OTLP exporter endpoint */
    readonly DEFAULT_EXPORTER_ENDPOINT: "http://localhost:4318/v1/traces";
    /** Default service name reported in traces */
    readonly DEFAULT_SERVICE_NAME: "crewly-backend";
    /** Environment variable names */
    readonly ENV_VARS: {
        readonly ENABLED: "OTEL_ENABLED";
        readonly ENDPOINT: "OTEL_EXPORTER_ENDPOINT";
        readonly SERVICE_NAME: "OTEL_SERVICE_NAME";
    };
    /** Span names for key operations */
    readonly SPANS: {
        readonly HTTP_REQUEST: "http.request";
        readonly AGENT_CREATE_SESSION: "agent.createSession";
        readonly AGENT_SEND_MESSAGE: "agent.sendMessage";
        readonly AGENT_REGISTER: "agent.register";
        readonly TASK_CREATE: "task.create";
        readonly TASK_UPDATE: "task.update";
        readonly TASK_ASSIGN: "task.assign";
        readonly AUDIT_TRIGGER: "audit.trigger";
        readonly SCHEDULER_RUN: "scheduler.run";
        readonly MEMORY_RECALL: "memory.recall";
        readonly MEMORY_STORE: "memory.store";
        readonly TASK_COMPLETE: "task.complete";
        readonly AGENT_RUN: "agent.run";
    };
};
/** License status type */
export type CloudLicenseStatus = (typeof CLOUD_AUTH_CONSTANTS.LICENSE_STATUS)[keyof typeof CLOUD_AUTH_CONSTANTS.LICENSE_STATUS];
export type AgentStatus = (typeof CREWLY_CONSTANTS.AGENT_STATUSES)[keyof typeof CREWLY_CONSTANTS.AGENT_STATUSES];
export type WorkingStatus = (typeof CREWLY_CONSTANTS.WORKING_STATUSES)[keyof typeof CREWLY_CONSTANTS.WORKING_STATUSES];
export type RuntimeType = (typeof RUNTIME_TYPES)[keyof typeof RUNTIME_TYPES];
export type AgentId = string;
//# sourceMappingURL=constants.d.ts.map