import type { FileResource, FileSpace } from '@xopcai/gateway-contract'; import type { Config } from '../config/schema.js'; import { type ProjectService } from '../projects/index.js'; export type ResolvedFileSpace = FileSpace & { root: string; }; export declare function fileSpaceId(root: string): string; export declare function fileResourceId(spaceId: string, relativePath: string): string; export declare function parseFileResourceId(id: string): { spaceId: string; relativePath: string; }; export declare function resolveFilePath(root: string, path: string, mustExist?: boolean): Promise; export declare class FileServiceError extends Error { readonly status: 400 | 403 | 404 | 409; constructor(status: 400 | 403 | 404 | 409, message: string); } export declare function fileResourceFromPath(space: ResolvedFileSpace, absolutePath: string, displayPath?: string): Promise; export declare class FileSpaceService { private readonly getConfig; private readonly projects; private readonly resolveSessionWorkspace; private readonly listSessionWorkspaces; private readonly dynamicSpaces; private cache; constructor(getConfig: () => Config, projects: ProjectService, resolveSessionWorkspace: (sessionKey: string) => string | Promise, listSessionWorkspaces?: () => Array<{ sessionKey: string; root: string; }> | Promise>); private createSpace; list(): Promise; forContext(kind: 'agent' | 'project' | 'session', id: string): Promise; defaultSpace(): Promise; get(id: string): Promise; resource(id: string): Promise<{ space: ResolvedFileSpace; resource: FileResource; absolutePath: string; }>; rootResource(spaceId: string): Promise; children(spaceId: string, path?: string): Promise; }