import type { AgentControllerEvent, SessionBeforeAgentEndListener } from '@mastra/core/agent-controller'; import type { WorkspaceSandbox } from '@mastra/core/workspace'; import type { FilesystemFile, FilesystemStorage } from '../storage/domains/filesystem/base.js'; import type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js'; /** * Regular files directly under the workspace root written since the session * was created ($2 is a UTC `touch -t` stamp, `YYYYMMDDhhmm.SS`), such as the * agent's notes. Files the template shipped with predate the session and stay * out; the checkouts are covered by git. Dotfiles are never listed: a listed * path becomes readable through the thread's file route, and the root is where * setup leaves `.env`, `.pgpass`, `.netrc` and other credential files. * `touch -t` plus `-newer` works on GNU and BSD find alike; `-newermt * "@epoch"` is GNU only. */ export declare const ROOT_FILES_LIST_COMMAND: string; /** `touch -t` stamp of a moment, in UTC. */ export declare function touchStamp(date: Date): string; export interface FilesystemCaptureSession { readonly identity: { getResourceId(): string; }; readonly thread: { requireId(): string; }; getWorkspace(): { sandbox?: Pick; } | undefined; onBeforeAgentEnd(listener: SessionBeforeAgentEndListener): () => void; subscribe(listener: (event: AgentControllerEvent) => void): () => void; } export interface FilesystemCaptureDependencies { filesystem: Pick; sourceControl: { sessions: Pick; }; } export declare function parseFilesystemCaptureFiles(output: string): FilesystemFile[]; export declare function captureSessionFilesystem(session: FilesystemCaptureSession, { filesystem, sourceControl }: FilesystemCaptureDependencies, ids?: { resourceId: string; threadId: string; }): Promise; /** * Resolve once the session's in-flight filesystem capture (if any) has * persisted, or after `timeoutMs` so a reader that arrives mid-capture is * never blocked by the execs' worst-case 30s timeouts. Never rejects: the * capture body is fully try/catch contained. */ export declare function waitForPendingFilesystemCapture(resourceId: string, timeoutMs?: number): Promise; export declare function observeSessionFilesystem(session: FilesystemCaptureSession, dependencies: FilesystemCaptureDependencies): () => void; //# sourceMappingURL=filesystem-capture.d.ts.map