/** * Shared utility functions for agent-orchestrator plugins. */ import type { OrchestratorConfig } from "./types.js"; /** * POSIX-safe shell escaping: wraps value in single quotes, * escaping any embedded single quotes as '\\'' . * * Safe for use in both `sh -c` and `execFile` contexts. */ export declare function shellEscape(arg: string): string; /** * Escape a string for safe interpolation inside AppleScript double-quoted strings. * Handles backslashes and double quotes which would otherwise break or inject. */ export declare function escapeAppleScript(s: string): string; /** * Validate that a URL starts with http:// or https://. * Throws with a descriptive error including the plugin label if invalid. */ export declare function validateUrl(url: string, label: string): void; /** * Returns true if an HTTP status code should be retried. * Retry only 429 (rate-limit) and 5xx (server) failures. */ export declare function isRetryableHttpStatus(status: number): boolean; /** * Normalize retry config from plugin config with sane defaults. */ export declare function normalizeRetryConfig(config: Record | undefined, defaults?: { retries: number; retryDelayMs: number; }): { retries: number; retryDelayMs: number; }; /** * Read the last entry from a JSONL file. * Reads backwards from end of file — pure Node.js, no external binaries. * * @param filePath - Path to the JSONL file * @returns Object containing the last entry's type and file mtime, or null if empty/invalid */ export declare function readLastJsonlEntry(filePath: string): Promise<{ lastType: string | null; modifiedAt: Date; } | null>; /** * Given a session ID and the orchestrator config, find which project it belongs * to by matching session prefixes. */ export declare function resolveProjectIdForSessionId(config: OrchestratorConfig, sessionId: string): string | undefined; //# sourceMappingURL=utils.d.ts.map