@grasplabs/grasp
Version:
TypeScript SDK for browser automation and secure command execution in highly available and scalable cloud browser environments
78 lines • 2 kB
TypeScript
/**
* Grasp Sandbox configuration interface
*/
export interface ISandboxConfig {
/** Grasp API key */
key: string;
/** Grasp workspace ID */
workspace?: string;
/** Default timeout in milliseconds */
timeout: number;
/** Enable debug mode for detailed logging */
debug?: boolean;
/** Keep alive time when sandbox is idle in milliseconds */
keepAliveMs?: number;
}
/**
* Script execution options
*/
export interface IScriptOptions {
/** Script type: 'cjs' for CommonJS, 'esm' for ES Modules, 'py' for Python */
type: 'cjs' | 'esm' | 'py';
/** Working directory */
cwd?: string;
/** Timeout in milliseconds */
timeoutMs?: number;
/** Run in background */
background?: boolean;
/** Use nohup for background execution */
nohup?: boolean;
/** The environment variables */
envs?: {
[key: string]: string;
};
/** Pre command */
preCommand?: string;
}
/**
* Logger configuration
*/
export interface ILoggerConfig {
/** Log level */
level: 'debug' | 'info' | 'warn' | 'error';
/** Enable console output */
console: boolean;
/** Log file path */
file?: string;
}
/**
* Application configuration
*/
export interface IAppConfig {
/** E2B configuration */
sandbox: ISandboxConfig;
/** Logger configuration */
logger: ILoggerConfig;
}
/**
* Sandbox status
*/
export type SandboxStatus = 'creating' | 'running' | 'stopped' | 'error';
/**
* Re-export CommandEventEmitter for type checking
*/
export { CommandEventEmitter } from '../services/sandbox.service';
/**
* Browser service configuration interface
*/
export interface IBrowserConfig {
/** Chromium launch arguments */
args: string[];
/** Headless mode (default: true) */
headless: boolean;
/** Timeout for browser launch (default: 30000ms) */
launchTimeout: number;
/** The environment variables */
envs: Record<string, string>;
}
//# sourceMappingURL=index.d.ts.map