import { a as WorkspaceFileManagerI18nRuntime } from './index-CDQITT_i.js'; import { WorkspaceFilePreviewTarget, WorkspaceFilePreviewKind as WorkspaceFilePreviewKind$1 } from '@tutti-os/workspace-file-preview'; interface WorkspaceFileManagerFileActivationRequest { entry: WorkspaceFileEntry; target: WorkspaceFileActivationTarget | null; } type WorkspaceFileManagerHostFallbackActionKind = "download" | "none" | "open"; type WorkspaceFileManagerHostFallbackAction = { kind: "download" | "open"; label?: string | null; onSelect: () => Promise; } | { kind: "none"; label?: string | null; }; type WorkspaceFileManagerHostFileActivationResult = { disposition: "handled"; } | { actions?: WorkspaceFileManagerHostFallbackAction[] | null; disposition: "fallback" | "unsupported"; message?: string | null; title?: string | null; }; type WorkspaceFileEntryKind = "file" | "directory" | "unknown"; type WorkspaceFileSearchMatchTarget = "basename" | "path"; type WorkspaceFilePreviewKind = WorkspaceFilePreviewKind$1; type WorkspaceFileLocationKind = "directory" | "external" | "recent"; type WorkspaceFileManagerFileDefaultOpener = "appBrowser" | "defaultBrowser" | "fileViewer" | "system"; declare const workspaceFileManagerPersistedStateSchemaVersion: 3; interface WorkspaceFileEntry { hasChildren: boolean; kind: WorkspaceFileEntryKind; createdTimeMs?: number | null; lastOpenedMs?: number | null; mtimeMs: number | null; name: string; path: string; sizeBytes: number | null; } /** * File-manager activation payload. Reuses the shared preview target shape * (`previewKind`) so hosts can decide whether to open an in-app preview, while * open / reveal / open-with stay outside `@tutti-os/workspace-file-preview`. */ interface WorkspaceFileActivationTarget extends WorkspaceFilePreviewTarget { mtimeMs: number | null; sizeBytes: number | null; } type WorkspaceFilePreviewState = { status: "empty"; } | { entry: WorkspaceFileEntry; status: "directory"; } | { entry: WorkspaceFileActivationTarget; previewKind: WorkspaceFilePreviewKind; status: "loading"; } | { content: string; entry: WorkspaceFileActivationTarget; previewKind: WorkspaceFilePreviewKind; status: "text"; } | { entry: WorkspaceFileActivationTarget; objectUrl: string; previewKind: "image"; status: "image"; } | { entry: WorkspaceFileActivationTarget; objectUrl: string; previewKind: "video"; status: "video"; } | { entry: WorkspaceFileEntry; message: string; status: "unsupported"; } | { entry: WorkspaceFileEntry; message: string; status: "readonly"; } | { entry: WorkspaceFileEntry; message: string; status: "error"; }; interface WorkspaceFileDirectoryListing { directoryPath: string; entries: WorkspaceFileEntry[]; root: string; workspaceID: string; } interface WorkspaceFileDirectoryExpansionState { entries: WorkspaceFileEntry[]; error: string | null; isLoading: boolean; loaded: boolean; } interface WorkspaceFileSearchEntry { directoryPath: string; kind: WorkspaceFileEntryKind; matchIndices: number[]; matchTarget: WorkspaceFileSearchMatchTarget; name: string; path: string; score: number; } interface WorkspaceFileSearchResult { entries: WorkspaceFileSearchEntry[]; root: string; workspaceID: string; } interface WorkspaceFileLocationSection { id: string; label: string; locations: WorkspaceFileLocation[]; } type WorkspaceFileLocation = WorkspaceFileDirectoryLocation | WorkspaceFileExternalLocation | WorkspaceFileRecentLocation; interface WorkspaceFileDirectoryLocation { contextLabel?: string | null; id: string; kind: "directory"; label: string; path: string; referenceNodeId: string; } interface WorkspaceFileExternalLocation { contextLabel?: string | null; externalType: string; iconUrl?: string | null; id: string; kind: "external"; label: string; metadata: Record; } interface WorkspaceFileRecentLocation { contextLabel?: string | null; id: string; kind: "recent"; label: string; } interface WorkspaceFileManagerPersistedState { currentDirectoryPath: string; navigationBackStack: string[]; navigationForwardStack: string[]; selectedLocationId: string | null; schemaVersion: typeof workspaceFileManagerPersistedStateSchemaVersion; } interface WorkspaceFileSearchInput { includeKinds?: Extract[]; limit?: number; query: string; within?: string; } interface WorkspaceFileOpenWithApplication { applicationPath: string; iconDataUrl?: string | null; name: string; } interface WorkspaceFileManagerCapabilities { canCopy: boolean; canCreateDirectory: boolean; canCreateFile: boolean; canDelete: boolean; canMove: boolean; canOpenInAppBrowser: boolean; canOpenInDefaultBrowser: boolean; canOpenWith: boolean; canPickOtherOpenWithApplication: boolean; canRevealInFolder: boolean; canRename: boolean; canSearch: boolean; } type WorkspaceFileManagerBusyAction = "create" | "delete" | "move" | "rename" | "view"; interface WorkspaceFileManagerCreateDialogState { errorMessage: string | null; kind: "directory" | "file"; name: string; } type WorkspaceFileManagerInlineRenameValidation = "invalid" | "required" | "tooLong"; interface WorkspaceFileManagerDeleteDialogState { entryPath: string; } interface WorkspaceFileManagerContextMenuState { entryPath: string | null; x: number; y: number; } interface WorkspaceFileManagerUnsupportedDialogState { actions?: WorkspaceFileManagerHostFallbackAction[] | null; entryPath?: string | null; kind: "view"; message?: string | null; title?: string | null; } interface WorkspaceFileManagerState { busyAction: WorkspaceFileManagerBusyAction | null; capabilities: WorkspaceFileManagerCapabilities; contextMenu: WorkspaceFileManagerContextMenuState | null; contextMenuEntryPath: string | null; createDialog: WorkspaceFileManagerCreateDialogState | null; currentDirectoryPath: string; deleteDialog: WorkspaceFileManagerDeleteDialogState | null; directoryExpansionByPath: Record; inlineRenameEntryPath: string | null; inlineRenameValidation: WorkspaceFileManagerInlineRenameValidation | null; entries: WorkspaceFileEntry[]; error: string | null; expandedDirectoryPaths: Record; isLoading: boolean; isMutating: boolean; isSearching: boolean; locationSections: WorkspaceFileLocationSection[]; navigationBackStack: string[]; navigationForwardStack: string[]; pendingDirectoryPath: string | null; previewState: WorkspaceFilePreviewState; root: string; searchEntries: WorkspaceFileSearchEntry[]; searchError: string | null; searchQuery: string; selectedLocationId: string | null; selectedPath: string | null; unsupportedDialog: WorkspaceFileManagerUnsupportedDialogState | null; workspaceID: string; } interface WorkspaceFileManagerMutationErrorMessage { actionKind: "copy" | "create" | "delete" | "move" | "rename"; error: unknown; message: string; } interface WorkspaceFileManagerHost { listDirectory(input: { includeHidden?: boolean; path: string; workspaceID: string; }): Promise; search?(input: WorkspaceFileSearchInput & { signal: AbortSignal; workspaceID: string; }): Promise; listRecentEntries?(input: { limit?: number; signal?: AbortSignal; workspaceID: string; }): Promise; createDirectory?(input: { path: string; workspaceID: string; }): Promise; createFile?(input: { path: string; workspaceID: string; }): Promise; deleteEntry?(input: { kind?: Extract | null; path: string; workspaceID: string; }): Promise; moveEntry?(input: { kind: Extract; path: string; targetDirectoryPath: string; workspaceID: string; }): Promise; renameEntry?(input: { path: string; newName: string; workspaceID: string; }): Promise; copyEntriesToClipboard?(input: { paths: string[]; workspaceID: string; }): Promise; listOpenWithApplications?(input: { path: string; workspaceID: string; }): Promise; openFileWithApplication?(input: { applicationPath: string; path: string; workspaceID: string; }): Promise; openFileWithOtherApplication?(input: { applicationPickerPrompt?: string; path: string; workspaceID: string; }): Promise; openFileInAppBrowser?(input: { path: string; workspaceID: string; }): Promise; openFileInDefaultBrowser?(input: { path: string; workspaceID: string; }): Promise; openFileInSystemDefault?(input: { path: string; workspaceID: string; }): Promise; revealEntry?(input: { path: string; workspaceID: string; }): Promise; activateFile?(request: WorkspaceFileManagerFileActivationRequest, workspaceID: string): Promise; readPreviewFile?(workspaceID: string, path: string): Promise; resolveErrorMessage?(error: unknown, overrides?: Record): string; } interface CreateWorkspaceFileManagerSessionInput { i18n: WorkspaceFileManagerI18nRuntime; host: WorkspaceFileManagerHost; initialDirectoryPath?: string; defaultLocationId?: string | null; locationSections?: WorkspaceFileLocationSection[]; onMutationErrorMessage?: (message: WorkspaceFileManagerMutationErrorMessage) => boolean | void; persistedState?: WorkspaceFileManagerPersistedState | null; persistence?: { load?(): WorkspaceFileManagerPersistedState | null | undefined; save(state: WorkspaceFileManagerPersistedState): void; }; resolveFileDefaultOpener?: (entry: WorkspaceFileEntry) => WorkspaceFileManagerFileDefaultOpener | null | undefined; workspaceID: string; } interface WorkspaceFileManagerCommands { applyRevealIntent(intent: { mode?: "select" | "open"; path: string; requestID: string; } | null): Promise; closeContextMenu(): void; closeCreateDialog(): void; closeDeleteDialog(): void; cancelInlineRename(): void; closeTransientUi(): void; closeUnsupportedDialog(): void; confirmCreateDialog(): Promise; confirmDeleteDialog(): Promise; clearInlineRenameValidation(): void; confirmInlineRename(newName: string): Promise; /** Resolves true when the entry reached the clipboard, false when it did not. */ copyToClipboard(entry: WorkspaceFileEntry): Promise; createDirectory(path: string): Promise; createFile(path: string): Promise; deleteSelected(): Promise; goBack(): Promise; goForward(): Promise; getPersistedState(): WorkspaceFileManagerPersistedState; handleActivationFallbackAction(action: WorkspaceFileManagerHostFallbackAction): Promise; initialize(): Promise; loadDirectory(path?: string): Promise; openContextMenu(input: WorkspaceFileManagerContextMenuState): void; openCreateDirectoryDialog(): void; openCreateFileDialog(): void; openDeleteDialog(entry: WorkspaceFileEntry): void; startInlineRename(entry: WorkspaceFileEntry): void; toggleDirectoryExpanded(entry: WorkspaceFileEntry): Promise; getCachedOpenWithApplications(entry: WorkspaceFileEntry): WorkspaceFileOpenWithApplication[] | null; listOpenWithApplications(entry: WorkspaceFileEntry): Promise; openEntry(entry: WorkspaceFileEntry): Promise; openFileWithApplication(entry: WorkspaceFileEntry, applicationPath: string): Promise; openFileInAppBrowser(entry: WorkspaceFileEntry): Promise; openFileInDefaultBrowser(entry: WorkspaceFileEntry): Promise; openFileInFileViewer(entry: WorkspaceFileEntry): Promise; openFileInSystemDefault(entry: WorkspaceFileEntry): Promise; openFileWithOtherApplication(entry: WorkspaceFileEntry): Promise; revealEntry(entry: WorkspaceFileEntry): Promise; moveEntry(entry: WorkspaceFileEntry, targetDirectoryPath: string): Promise; refresh(): Promise; revealPath(path: string): Promise; search(query: string): Promise; select(path: string | null): void; selectLocation(locationId: string): Promise; setActive(active: boolean): void; setI18nRuntime(copy: WorkspaceFileManagerI18nRuntime): void; setLocations(input: { defaultLocationId?: string | null; sections: WorkspaceFileLocationSection[]; }): Promise; updateCreateDialogName(name: string): void; } interface WorkspaceFileManagerSession extends WorkspaceFileManagerCommands { activateFile(request: WorkspaceFileManagerFileActivationRequest): Promise; dispose(): void; readonly store: WorkspaceFileManagerState; } interface WorkspaceFileManagerService { createSession(input: CreateWorkspaceFileManagerSessionInput): WorkspaceFileManagerSession; } declare function createWorkspaceFileManagerService(): WorkspaceFileManagerService; declare function flattenWorkspaceFileLocations(sections: readonly WorkspaceFileLocationSection[]): WorkspaceFileLocation[]; declare function findWorkspaceFileLocationById(sections: readonly WorkspaceFileLocationSection[], locationId: string | null | undefined): WorkspaceFileLocation | null; declare function resolveWorkspaceFileLocationDefaultId(input: { defaultLocationId?: string | null; persistedLocationId?: string | null; sections: readonly WorkspaceFileLocationSection[]; }): string | null; declare function isWorkspaceFileRecentLocation(location: WorkspaceFileLocation | null | undefined): boolean; declare function isWorkspaceFileExternalLocation(location: WorkspaceFileLocation | null | undefined): boolean; export { createWorkspaceFileManagerService as A, findWorkspaceFileLocationById as B, type CreateWorkspaceFileManagerSessionInput as C, flattenWorkspaceFileLocations as D, isWorkspaceFileExternalLocation as E, isWorkspaceFileRecentLocation as F, resolveWorkspaceFileLocationDefaultId as G, type WorkspaceFileActivationTarget as W, type WorkspaceFileDirectoryListing as a, type WorkspaceFileDirectoryLocation as b, type WorkspaceFileEntry as c, type WorkspaceFileEntryKind as d, type WorkspaceFileExternalLocation as e, type WorkspaceFileLocation as f, type WorkspaceFileLocationKind as g, type WorkspaceFileLocationSection as h, type WorkspaceFileManagerCapabilities as i, type WorkspaceFileManagerFileActivationRequest as j, type WorkspaceFileManagerFileDefaultOpener as k, type WorkspaceFileManagerHost as l, type WorkspaceFileManagerHostFallbackAction as m, type WorkspaceFileManagerHostFallbackActionKind as n, type WorkspaceFileManagerHostFileActivationResult as o, type WorkspaceFileManagerMutationErrorMessage as p, type WorkspaceFileManagerPersistedState as q, type WorkspaceFileManagerService as r, type WorkspaceFileManagerSession as s, type WorkspaceFileManagerState as t, type WorkspaceFileOpenWithApplication as u, type WorkspaceFilePreviewKind as v, type WorkspaceFilePreviewState as w, type WorkspaceFileRecentLocation as x, type WorkspaceFileSearchEntry as y, type WorkspaceFileSearchResult as z };