/** * MCP tool: manage CrossPad app packages via the crosspad-apps registry. * - list: reads registry + manifest JSON from ALL detected repos (no Python needed) * - install/remove/update/sync: delegates to app_manager.py via Python subprocess * * Each platform repo has app_manager.py at a different path: * platform-idf → tools/app_manager.py * crosspad-pc → scripts/app_manager.py * ESP32-S3 → scripts/app_manager.py */ import { OnLine } from "../utils/exec.js"; interface AppEntry { name: string; version: string; description: string; repo: string; component_path: string; icon: string; category: string; platforms: string[]; requires: Record; } export interface AppListResult { success: boolean; apps: Array<{ id: string; name: string; version: string; description: string; category: string; platforms: string[]; installed_in: Array<{ platform: string; version: string; ref: string; }>; compatible: boolean; }>; installed_count: number; total_count: number; error?: string; } export interface AppActionResult { success: boolean; action: string; platform: string; app_name?: string; output: string; error?: string; /** What the caller must do next for the change to take effect. */ next?: string; } export interface PlatformInfo { label: string; root: string; scriptDir: string; platformId: string; } /** @internal exported for testing */ export declare function getAvailablePlatforms(): PlatformInfo[]; /** Invalidate the registry cache. Call after any mutation (install/remove/update/sync). */ export declare function invalidateRegistryCache(): void; /** @internal exported for testing */ export declare function isCompatible(app: AppEntry, platformId: string): boolean; /** * Build a Python script body invoking app_manager.py's AppManager class. * Returned as a string to be passed via `python3 -c