import { EntryInfo, MCPResult, InfoNotice, MCPToolResponse, MCPErrorStatus, MCPSuccess, RangeRequestStatus } from './common'; import { ErrorCode } from '../internal'; export { EntryInfo, MCPResult, InfoNotice, MCPToolResponse, MCPErrorStatus, MCPSuccess }; export declare namespace ReadTool { export type ReadOperation = 'content' | 'metadata' | 'diff'; export type ContentFormat = 'text' | 'base64' | 'markdown' | 'checksum'; export type ChecksumAlgorithm = 'md5' | 'sha1' | 'sha256' | 'sha512'; export type DiffFormat = 'unified'; export interface BaseParams { sources: string[]; operation: ReadOperation; } export interface ContentParams extends BaseParams { operation: 'content'; format?: ContentFormat; checksum_algorithm?: ChecksumAlgorithm | string; offset?: number; length?: number; } export interface MetadataParams extends BaseParams { operation: 'metadata'; } export interface DiffParams extends BaseParams { operation: 'diff'; sources: [string, string]; diff_format?: DiffFormat; } export type Parameters = ContentParams | MetadataParams | DiffParams; interface BaseResult { source: string; source_type: 'file' | 'url'; http_status_code?: number; } export interface ContentResultSuccess extends MCPSuccess, BaseResult { output_format_used: ContentFormat | 'text'; content?: string | null; mime_type?: string; detected_format?: string; user_note?: string; size_bytes?: number; original_size_bytes?: number; compression_applied?: boolean; compression_error_note?: string; checksum?: string; checksum_algorithm_used?: ChecksumAlgorithm | string; range_request_status?: RangeRequestStatus; markdown_conversion_status?: 'success' | 'skipped_unsupported_content_type'; markdown_conversion_skipped_reason?: string; } export type ContentResultItem = ContentResultSuccess | (MCPErrorStatus & BaseResult); export interface DefinedContentResponse { tool_name: 'read'; results: ContentResultItem[]; info_notices?: InfoNotice[]; } export interface Metadata { name: string; entry_type: 'file' | 'directory' | 'symlink' | 'other' | 'url' | 'special'; size_bytes?: number; mime_type?: string; created_at?: string; modified_at?: string; permissions_octal?: string; permissions_string?: string; http_headers?: Record; } export interface MetadataResultSuccess extends MCPSuccess, BaseResult { http_status_code?: number; metadata: Metadata; final_url?: string; } export type MetadataResultItem = MetadataResultSuccess | (MCPErrorStatus & BaseResult); export interface DefinedMetadataResponse { tool_name: 'read'; results: MetadataResultItem[]; info_notices?: InfoNotice[]; } export interface DiffResultSuccess extends MCPSuccess { sources_compared: [string, string]; diff_format_used: DiffFormat; diff_content: string; } export type DiffResult = DiffResultSuccess | MCPErrorStatus; export interface DefinedDiffResponse { tool_name: 'read'; results: DiffResult; info_notices?: InfoNotice[]; } export {}; } export declare namespace WriteTool { export type WriteAction = 'put' | 'mkdir' | 'copy' | 'move' | 'delete' | 'touch' | 'archive' | 'unarchive' | 'extract'; export type InputEncoding = 'text' | 'base64' | 'base64_gzipped_file_ref'; export type WriteMode = 'overwrite' | 'append' | 'error_if_exists'; export type ArchiveFormat = 'zip' | 'tar.gz' | 'tgz'; export interface BaseWriteEntry { path: string; } export interface PutEntry extends BaseWriteEntry { content: string; input_encoding?: InputEncoding; write_mode?: 'overwrite' | 'append' | 'error_if_exists'; checksum_algorithm?: string; } export interface MkdirEntry extends BaseWriteEntry { recursive?: boolean; } export interface TouchEntry extends BaseWriteEntry { } export interface CopyEntry { source_path: string; destination_path: string; overwrite?: boolean; } export interface MoveEntry { source_path: string; destination_path: string; overwrite?: boolean; } export interface DeleteEntry { path: string; recursive?: boolean; } export interface BaseBatchParams { action: 'put' | 'mkdir' | 'copy' | 'move' | 'delete' | 'touch'; entries: Array; } export interface PutParams extends BaseBatchParams { action: 'put'; entries: PutEntry[]; } export interface MkdirParams extends BaseBatchParams { action: 'mkdir'; entries: MkdirEntry[]; } export interface CopyParams extends BaseBatchParams { action: 'copy'; entries: CopyEntry[]; } export interface MoveParams extends BaseBatchParams { action: 'move'; entries: MoveEntry[]; } export interface DeleteParams extends BaseBatchParams { action: 'delete'; entries: DeleteEntry[]; } export interface TouchParams extends BaseBatchParams { action: 'touch'; entries: TouchEntry[]; } export interface ArchiveParams { action: 'archive'; source_paths: string[]; archive_path: string; format?: ArchiveFormat | string; recursive_source_listing?: boolean; options?: Record; metadata?: Record; } export interface UnarchiveParams { action: 'unarchive'; archive_path: string; destination_path: string; format?: ArchiveFormat | string; options?: Record; } export type Parameters = PutParams | MkdirParams | CopyParams | MoveParams | DeleteParams | TouchParams | ArchiveParams | UnarchiveParams; interface BaseResult { action_performed: WriteAction; path?: string; source_path?: string; destination_path?: string; } export interface WriteResultSuccess extends MCPSuccess, BaseResult { bytes_written?: number; checksum?: string; checksum_algorithm_used?: string; message?: string; skipped_sources?: string[]; extracted_files_count?: number; } export type WriteResultItem = WriteResultSuccess | (MCPErrorStatus & BaseResult); export interface DefinedBatchResponse { tool_name: 'write'; results: WriteResultItem[]; info_notices?: InfoNotice[]; } export type ArchiveActionResult = WriteResultSuccess | MCPErrorStatus; export interface DefinedArchiveResponse { tool_name: 'write'; results: ArchiveTool.ArchiveResultItem[]; info_notices?: InfoNotice[]; } export {}; } export declare namespace ListTool { type ListOperation = 'entries' | 'system_info'; type SystemInfoType = 'server_capabilities' | 'filesystem_stats'; interface BaseParams { operation: ListOperation; } interface EntriesParams extends BaseParams { operation: 'entries'; path: string; recursive_depth?: number; calculate_recursive_size?: boolean; } interface SystemInfoParams extends BaseParams { operation: 'system_info'; info_type: SystemInfoType; path?: string; } type Parameters = EntriesParams | SystemInfoParams; interface DefinedEntriesResponse { tool_name: 'list'; results: EntryInfo[]; info_notices?: InfoNotice[]; } interface ServerCapabilities { server_version: string; active_configuration: Record; supported_checksum_algorithms: string[]; supported_archive_formats: string[]; default_checksum_algorithm: string; max_recursive_depth: number; } interface DefinedServerCapabilitiesResponse { tool_name: 'list'; results: ServerCapabilities; info_notices?: InfoNotice[]; } interface FilesystemStats { path_queried: string; total_bytes: number; free_bytes: number; available_bytes: number; used_bytes: number; } interface FilesystemStatsNoPath { info_type_requested: 'filesystem_stats'; status_message: string; server_version: string; server_start_time_iso: string; configured_allowed_paths: string[]; } interface DefinedFilesystemStatsResponse { tool_name: 'list'; results: FilesystemStats | FilesystemStatsNoPath; info_notices?: InfoNotice[]; } } export declare namespace FindTool { interface NamePatternCriterion { type: 'name_pattern'; pattern: string; } interface ContentPatternCriterion { type: 'content_pattern'; pattern: string; is_regex?: boolean; case_sensitive?: boolean; file_types_to_search?: string[]; } type MetadataAttribute = 'name' | 'size_bytes' | 'created_at' | 'modified_at' | 'entry_type' | 'mime_type'; type StringOperator = 'equals' | 'not_equals' | 'contains' | 'starts_with' | 'ends_with' | 'matches_regex'; type NumericOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'; type DateOperator = 'before' | 'after' | 'on_date'; interface MetadataFilterCriterion { type: 'metadata_filter'; attribute: MetadataAttribute | string; operator: StringOperator | NumericOperator | DateOperator | string; value: string | number | Date; case_sensitive?: boolean; } type MatchCriterion = NamePatternCriterion | ContentPatternCriterion | MetadataFilterCriterion; interface Parameters { base_path: string; recursive?: boolean; match_criteria: MatchCriterion[]; entry_type_filter?: 'file' | 'directory' | 'any'; } interface DefinedFindResponse { tool_name: 'find'; results: EntryInfo[]; info_notices?: InfoNotice[]; } } export declare namespace TestTool { interface EchoParams { operation: 'echo'; params_to_echo: unknown; } interface GenerateErrorParams { operation: 'generate_error'; error_code_to_generate: ErrorCode | string; error_message_to_generate: string; } type Parameters = EchoParams | GenerateErrorParams; interface EchoResultSuccess extends MCPSuccess { echoed_params: unknown; } interface DefinedEchoResponse { tool_name: 'test'; results: EchoResultSuccess; info_notices?: InfoNotice[]; } } export declare namespace ArchiveTool { interface ArchiveOptions { overwrite?: boolean; portable?: boolean; prefix?: string; filter_paths?: string[]; strip_components?: number; keep_newer_files?: boolean; preserve_owner?: boolean; } interface CreateArchiveParams { operation: 'create'; source_paths: string[]; archive_path: string; compression?: 'gzip' | 'none'; metadata?: Record; options?: ArchiveOptions; } interface ExtractArchiveParams { operation: 'extract'; archive_path: string; target_path: string; options?: ArchiveOptions; } type Params = CreateArchiveParams | ExtractArchiveParams; interface ArchiveResultError { status: 'error'; error_code: string; error_message: string; operation: 'create' | 'extract'; } interface CreateArchiveSuccess { status: 'success'; operation: 'create'; archive_path: string; format_used: string; size_bytes: number; entries_processed: number; checksum_sha256?: string; compression_used?: 'zip' | 'gzip' | 'none'; metadata?: Record; options_applied?: ArchiveOptions; message?: string; } interface ExtractArchiveSuccess { status: 'success'; operation: 'extract'; archive_path: string; target_path: string; format_used: string; entries_extracted: number; options_applied?: ArchiveOptions; message?: string; } type ArchiveResultItem = CreateArchiveSuccess | ExtractArchiveSuccess | ArchiveResultError; interface Response { tool_name: 'ArchiveTool'; results: ArchiveResultItem[]; } } //# sourceMappingURL=tools.d.ts.map