/** * @fileoverview Shared JXA/AppleScript runner with permission detection. * Wraps osascript subprocess execution with consistent security (argv arrays, * no shell interpolation) and structured error classification. * @module services/osascript/osascript-service */ import type { Context } from '@cyanheads/mcp-ts-core'; import type { AppConfig } from '@cyanheads/mcp-ts-core/config'; import type { StorageService } from '@cyanheads/mcp-ts-core/storage'; /** Result of running an osascript script. */ export interface OsascriptResult { stderr: string; stdout: string; } /** Options for runJxa / runAppleScript. */ export interface RunOptions { /** Timeout in milliseconds. Default 10 000. */ timeoutMs?: number; } export declare class OsascriptService { /** * Run a JXA (JavaScript for Automation) script. * NEVER interpolate raw user content into script — caller must use JSON.stringify * for any dynamic values within the JXA source. */ runJxa(script: string, ctx: Context, opts?: RunOptions): Promise; /** * Run a legacy AppleScript (non-JXA) script. * Caller is responsible for escaping any dynamic values before passing in. */ runAppleScript(script: string, ctx: Context, opts?: RunOptions): Promise; } export declare function initOsascriptService(_config: AppConfig, _storage: StorageService): void; export declare function getOsascriptService(): OsascriptService; //# sourceMappingURL=osascript-service.d.ts.map