/** * File migration utilities for OpenClaw isolation * * Copies OpenClaw installation files from the original user to the * sandboxed user. IMPORTANT: This module never modifies the original * source directory — all operations are read + copy only. */ import type { MigrationSelection } from '@agenshield/ipc'; import type { SandboxUser, DirectoryStructure } from './types'; export interface MigrationSource { /** Installation method: npm or git */ method: 'npm' | 'git'; /** Path to the package directory */ packagePath: string; /** Path to the binary */ binaryPath?: string; /** Path to the config directory */ configPath?: string; /** Path to the git repo (for git installs) */ gitRepoPath?: string; /** User's selection of items to migrate */ selection?: MigrationSelection; } export interface MigrationResult { success: boolean; error?: string; /** New paths after migration */ newPaths?: { packagePath: string; binaryPath: string; configPath: string; }; } /** * Migrate npm-based OpenClaw installation to sandbox user. * Copies the package and builds a clean config from the user's selection. * NEVER modifies the original source directory. */ export declare function migrateNpmInstall(source: MigrationSource, user: SandboxUser, dirs: DirectoryStructure): MigrationResult; /** * Migrate git-based OpenClaw installation to sandbox user. * Copies the repo and builds a clean config from the user's selection. * NEVER modifies the original source directory. */ export declare function migrateGitInstall(source: MigrationSource, user: SandboxUser, dirs: DirectoryStructure): MigrationResult; /** * Migrate OpenClaw installation to sandbox user. * Source is a MigrationSource which may include a selection of items to migrate. */ export declare function migrateOpenClaw(source: MigrationSource, user: SandboxUser, dirs: DirectoryStructure): MigrationResult; /** * Sanitize an OpenClaw config by stripping skill-related secrets. * Removes `env` and `apiKey` from each skill entry (those go to the vault). * Returns a new object — does NOT mutate the input. */ export declare function sanitizeOpenClawConfig(config: Record): Record; /** * Create a Node.js wrapper in the sandbox user's bin directory */ export declare function createNodeWrapper(user: SandboxUser, dirs: DirectoryStructure): { success: boolean; error?: string; }; //# sourceMappingURL=migration.d.ts.map