/** * Types and utilities for v2 sandbox bash commands. * * Commands wrap the sandbox's direct methods to provide a shell interface. * This ensures consistency between `sandbox.build()` and `sandbox.exec('sandlot build')`. */ import type { Filesystem, InstallResult, UninstallResult, BuildResult, BuildFailureDetails, TypecheckResult, SandboxBuildOptions, SandboxTypecheckOptions, RunOptions, RunResult, BundleError, Diagnostic } from "../types"; /** * Reference to sandbox methods that commands can call. * * Commands receive this interface rather than raw dependencies, * ensuring they use the same logic as direct API calls. */ export interface SandboxRef { /** The virtual filesystem */ readonly fs: Filesystem; /** Install a package */ install(packageSpec: string): Promise; /** Uninstall a package */ uninstall(packageName: string): Promise; /** Build the project */ build(options?: SandboxBuildOptions): Promise; /** Type check the project */ typecheck(options?: SandboxTypecheckOptions): Promise; /** Run code (build + execute) */ run(options?: RunOptions): Promise; } /** * Format a file size in bytes to a human-readable string */ export declare function formatSize(bytes: number): string; /** * Format diagnostics for shell output */ export declare function formatDiagnostics(diagnostics: Diagnostic[]): string; /** * Format bundle errors for shell output */ export declare function formatBundleErrors(errors: BundleError[]): string; /** * Format a build failure for shell output. * Used by both build and run commands for consistent error formatting. * * @param failure - The build failure details * @param prefix - Optional prefix for the error message (default: "Build failed") */ export declare function formatBuildFailure(failure: BuildFailureDetails, prefix?: string): string; //# sourceMappingURL=types.d.ts.map