import { RestMediaArtifact, RestBashOutputArtifact, GitPatch, ParsedChangeSet, ParsedFile } from './types.js'; import { Platform } from './platform/types.js'; /** * Parses a unified diff string and extracts file information. * @internal */ export declare function parseUnidiff(patch?: string | null): ParsedFile[]; /** * Represents a media artifact (e.g. image) produced by an activity. * Provides helper methods for saving and viewing the media. */ export declare class MediaArtifact { readonly type = "media"; readonly data: string; readonly format: string; private platform; private activityId?; constructor(artifact: RestMediaArtifact['media'], platform: Platform, activityId?: string); /** * Saves the media artifact to a file. * * **Side Effects:** * - Node.js: Writes the file to disk (overwrites if exists). * - Browser: Saves the file to the 'artifacts' object store in IndexedDB. * * @param filepath The path where the file should be saved. */ save(filepath: string): Promise; /** * Converts the media artifact to a data URL. * Useful for displaying images in a browser. * * **Data Transformation:** * - Prefixes the base64 data with `data:;base64,`. * * @returns A valid Data URI string. */ toUrl(): string; } /** * Represents the output of a bash command executed by the agent. */ export declare class BashArtifact { readonly type = "bashOutput"; readonly command: string; readonly stdout: string; readonly stderr: string; readonly exitCode: number | null; constructor(artifact: RestBashOutputArtifact['bashOutput']); /** * Formats the bash output as a string, mimicking a terminal session. * * **Data Transformation:** * - Combines `stdout` and `stderr`. * - Formats the command with a `$` prompt. * - Appends the exit code. */ toString(): string; } /** * Represents a set of code changes (unified diff) produced by an activity. * Provides a helper method to parse the diff into structured data. */ export declare class ChangeSetArtifact { readonly type: "changeSet"; readonly source: string; readonly gitPatch: GitPatch; constructor(source: string, gitPatch: GitPatch); /** * Parses the unified diff and returns structured file change information. * * **Data Transformation:** * - Extracts file paths from diff headers. * - Determines change type (created/modified/deleted) from /dev/null markers. * - Counts additions (+) and deletions (-) in hunks. * * @returns Parsed diff with file paths, change types, and line counts. */ parsed(): ParsedChangeSet; }