From 5763792718632efbb159cd5f0845d3ea2c208014 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Mon, 12 Oct 2026 06:05:04 -0700 Subject: [PATCH] refactor(renderer): remove the runtime-file-client barrel (#27975) Co-authored-by: m4air --- config/scripts/pr-e2e-source-routing.mjs | 2 +- ...ewWorkspaceComposerCard.file-drop.test.tsx | 2 +- .../navigate/navigate-browser-page-url.ts | 2 +- .../editor/ExternalFileChangeBanner.test.tsx | 2 +- .../editor/ExternalFileChangeBanner.tsx | 2 +- .../ExternalFileChangeCompareDialog.test.tsx | 2 +- .../ExternalFileChangeCompareDialog.tsx | 2 +- .../MarkdownPreview.image-access.test.tsx | 2 +- ...nPreview.link-routing.interaction.test.tsx | 4 +-- ...rkdownPreview.toc-visibility-gate.test.tsx | 2 +- .../use-combined-diff-section-actions.ts | 2 +- .../components/editor/csv/csv-file-content.ts | 2 +- .../csv/csv-preview-save-safety.test.ts | 2 +- .../editor/editor-dropped-file-open.ts | 6 ++-- .../editor-restored-tab-conflict-scan.test.ts | 2 +- .../editor-restored-tab-conflict-scan.ts | 2 +- .../components/editor/editor-save-queue.ts | 2 +- .../editor/local-image-src-reader.ts | 4 +-- .../markdown-document-list-request.test.ts | 2 +- .../editor/markdown-document-list-request.ts | 6 ++-- .../editor/markdown-preview-link-actions.ts | 2 +- .../editor/markdown-preview-local-images.ts | 2 +- ...stored-editor-owner-save-lifecycle.test.ts | 6 ++-- ...ed-editor-workspace-runtime-owner.test.tsx | 6 ++-- .../rich-markdown-async-image-paste.test.ts | 4 +-- .../rich-markdown-async-image-table.test.ts | 4 +-- .../editor/rich-markdown-extensions.ts | 2 +- .../editor/rich-markdown-image-context.ts | 2 +- ...h-markdown-image-insert-code-block.test.ts | 2 +- .../editor/rich-markdown-image-insert.test.ts | 6 ++-- .../editor/rich-markdown-image-insert.ts | 2 +- ...itor-group-file-drop-owner.remote.test.tsx | 2 +- .../useEditorPanelContentState.test.tsx | 10 +++--- .../editor/useEditorPanelFileContentLoader.ts | 2 +- ...anelFileLoadRetry.host-connection.test.tsx | 6 ++-- ...ditorPanelFloatingTabContentState.test.tsx | 10 +++--- ...orPanelHostUnresolvedContentState.test.tsx | 10 +++--- ...torPanelRemoteSiblingContentState.test.tsx | 10 +++--- ...EditorPanelVisibilityContentState.test.tsx | 8 ++--- .../editor/useLocalImagePick.test.tsx | 4 +-- .../editor/useLocalImageSrc.test.ts | 2 +- .../src/components/editor/useLocalImageSrc.ts | 2 +- .../useMarkdownDocuments.navigation.test.ts | 2 +- .../components/editor/useMarkdownDocuments.ts | 2 +- .../editor/useMarkdownDocuments.watch.test.ts | 2 +- .../editor/useUntitledFileRename.ts | 3 +- .../native-chat/NativeChatMessageList.tsx | 2 +- .../native-chat/NativeChatMessageRow.tsx | 2 +- .../NativeChatTranscriptChrome.test.tsx | 2 +- .../NativeChatTranscriptChrome.tsx | 2 +- .../native-chat/NativeChatTranscriptRow.tsx | 2 +- .../native-chat/NativeChatUserMessageRow.tsx | 2 +- .../native-chat-image-runtime-context.ts | 2 +- .../use-native-chat-mention-files.test.tsx | 2 +- ...-file-list-host-name-filter.react.test.tsx | 2 +- ...en-file-list-remote-catalog.react.test.tsx | 2 +- .../quick-open-file-list.react.test.tsx | 2 +- .../src/components/quick-open-file-list.ts | 2 +- .../quick-open-file-navigation.test.ts | 8 +++-- .../components/quick-open-file-navigation.ts | 2 +- .../quick-open-recent-lifetime.react.test.tsx | 2 +- .../quick-open-recent-validation.test.ts | 2 +- .../quick-open-recent-validation.ts | 2 +- .../FileExplorerRow.actions.test.tsx | 6 ++-- .../right-sidebar/FileExplorerRow.tsx | 2 +- .../right-sidebar/FileExplorerVirtualRows.tsx | 2 +- .../file-explorer-copy-file-owner.test.ts | 2 +- ...file-explorer-delete-editor-owner.test.tsx | 6 ++-- .../file-explorer-directory-listing.test.ts | 2 +- .../file-explorer-directory-listing.ts | 2 +- .../file-explorer-row-action-visibility.ts | 2 +- .../file-explorer-row-file-transfer.ts | 3 +- ...lorer-name-filter.runtime-listing.test.tsx | 2 +- .../use-file-explorer-tree-pane-state.ts | 2 +- .../right-sidebar/useFileDeletion.ts | 7 ++-- .../right-sidebar/useFileDuplicate.ts | 3 +- ...ileExplorerImport.committed-scope.test.tsx | 2 +- ...seFileExplorerImport.os-file-drop.test.tsx | 2 +- .../useFileExplorerImport.remote.test.tsx | 2 +- .../right-sidebar/useFileExplorerImport.ts | 2 +- .../useFileExplorerInlineInput.ts | 2 +- .../useFileExplorerWatch.broker.test.tsx | 4 ++- .../useFileExplorerWatch.host-root.test.tsx | 2 +- ...FileExplorerWatch.pending-refresh.test.tsx | 2 +- .../useFileSearchPanel.lifecycle.test.tsx | 2 +- .../useFileSearchRunner.test.tsx | 2 +- .../right-sidebar/useFileSearchRunner.ts | 2 +- .../McpConfigSection.host-owner.test.tsx | 8 ++++- .../components/settings/McpConfigSection.tsx | 3 +- .../settings/mcp-config-inspection.ts | 8 ++--- .../tab-bar/tab-create-entry-absolute-file.ts | 2 +- .../tab-bar/tab-create-entry-action.ts | 8 ++--- ...-entry-classifier.runtime-listing.test.tsx | 2 +- .../tab-bar/tab-create-entry-local-path.ts | 2 +- .../terminal-drop-handler.test.ts | 2 +- .../terminal-drop-internal-handler.test.ts | 2 +- .../terminal-drop-local-workspace.test.ts | 2 +- ...erminal-drop-runtime-catalog-owner.test.ts | 2 +- .../terminal-file-link-target.ts | 2 +- .../terminal-file-open-routing.ts | 2 +- .../terminal-file-path-mapping.ts | 2 +- .../terminal-host-workspace-file.ts | 2 +- .../terminal-native-file-drop.ts | 2 +- .../terminal-pane-element-file-drop.test.tsx | 2 +- .../terminal-remote-file-download-open.ts | 3 +- .../terminal-worktree-path-link.ts | 2 +- .../attachment-drop-failure.test.tsx | 2 +- .../attachment-drop-lifetime.test.tsx | 2 +- .../composer-state/attachment-drop-state.ts | 2 +- ...editor-external-watch-disk-verification.ts | 2 +- .../hooks/editor-runtime-file-watch.test.ts | 2 +- .../src/hooks/editor-runtime-file-watch.ts | 2 +- ...EditorExternalWatch-subscriptions.test.tsx | 2 +- .../src/lib/create-untitled-markdown.ts | 4 +-- .../lib/execute-open-editor-path-move.test.ts | 6 ++-- .../src/lib/execute-open-editor-path-move.ts | 3 +- .../src/lib/markdown-document-templates.ts | 10 +++--- .../lib/rename-user-named-tab-access.test.ts | 6 ++-- .../src/lib/user-opened-local-path.test.ts | 6 ++-- .../src/lib/user-opened-local-path.ts | 8 ++--- .../src/lib/workspace-file-host-routing.ts | 2 +- .../src/runtime/mobile-markdown-bridge.ts | 2 +- .../remote-host-file-open-repro.test.ts | 2 +- .../runtime-file-client-download.test.ts | 2 +- ...untime-file-client-external-import.test.ts | 2 +- ...ime-file-client-mutation-ownership.test.ts | 4 +-- ...runtime-file-client-search-listing.test.ts | 8 +++-- .../runtime/runtime-file-client-watch.test.ts | 2 +- .../src/runtime/runtime-file-client.test.ts | 11 +++--- .../src/runtime/runtime-file-client.ts | 35 ------------------- ...ntime-file-import-pairing-revision.test.ts | 2 +- .../runtime-legacy-recent-freshness.test.ts | 2 +- ...e-quick-open-version-compatibility.test.ts | 2 +- .../runtime-terminal-artifact-read.test.ts | 2 +- .../editor/actions/markdown-link-action.ts | 2 +- .../editor/tabs/untitled-file-cleanup.ts | 6 ++-- 136 files changed, 223 insertions(+), 248 deletions(-) delete mode 100644 src/renderer/src/runtime/runtime-file-client.ts diff --git a/config/scripts/pr-e2e-source-routing.mjs b/config/scripts/pr-e2e-source-routing.mjs index 05b76b35341..706aa041988 100644 --- a/config/scripts/pr-e2e-source-routing.mjs +++ b/config/scripts/pr-e2e-source-routing.mjs @@ -285,7 +285,7 @@ export const PR_E2E_SOURCE_ROUTES = [ specs: ['tests/e2e/paired-quick-open-large-tree.spec.ts'], matches: (file) => isProductSource(file) && - /^(?:src\/main\/ipc\/filesystem-(?:list-files|search-file-paths)\.ts|src\/main\/ripgrep\/bundled-ripgrep-path\.ts|src\/main\/providers\/(?:filesystem-provider-contract|ssh-filesystem-provider(?:-capabilities)?)\.ts|src\/main\/runtime\/(?:orca-runtime-files|rpc\/methods\/files)\.ts|src\/renderer\/src\/(?:components\/(?:QuickOpen|quick-open-file-list|quick-open-search)\.tsx?|runtime\/(?:runtime-file-client|runtime-legacy-quick-open-inventory)\.ts)|src\/shared\/(?:quick-open-(?:install-rg|path-search|transport-budget)|ripgrep-process-availability|bundled-ripgrep)\.ts)$/.test( + /^(?:src\/main\/ipc\/filesystem-(?:list-files|search-file-paths)\.ts|src\/main\/ripgrep\/bundled-ripgrep-path\.ts|src\/main\/providers\/(?:filesystem-provider-contract|ssh-filesystem-provider(?:-capabilities)?)\.ts|src\/main\/runtime\/(?:orca-runtime-files|rpc\/methods\/files)\.ts|src\/renderer\/src\/(?:components\/(?:QuickOpen|quick-open-file-list|quick-open-search)\.tsx?|runtime\/(?:runtime-file-search-client|runtime-legacy-quick-open-inventory)\.ts)|src\/shared\/(?:quick-open-(?:install-rg|path-search|transport-budget)|ripgrep-process-availability|bundled-ripgrep)\.ts)$/.test( file ) }, diff --git a/src/renderer/src/components/NewWorkspaceComposerCard.file-drop.test.tsx b/src/renderer/src/components/NewWorkspaceComposerCard.file-drop.test.tsx index 1ebc60eb014..c1092a5294b 100644 --- a/src/renderer/src/components/NewWorkspaceComposerCard.file-drop.test.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerCard.file-drop.test.tsx @@ -10,7 +10,7 @@ import { useAttachmentDropState } from '../hooks/composer-state/attachment-drop- import type { ProjectGroup } from '../../../shared/project-group-types' const uploads = vi.hoisted(() => ({ importPaths: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: uploads.importPaths })) diff --git a/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts b/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts index fdf57e706c5..0d62edddf0d 100644 --- a/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts +++ b/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts @@ -2,7 +2,7 @@ import { detectLanguage } from '@/lib/language-detect' import { getConnectionId } from '@/lib/connection-context' import { isPathInsideWorktree, toWorktreeRelativePath } from '@/lib/terminal-links' import { useAppStore } from '@/store' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { normalizeBrowserNavigationUrl, redactKagiSessionToken diff --git a/src/renderer/src/components/editor/ExternalFileChangeBanner.test.tsx b/src/renderer/src/components/editor/ExternalFileChangeBanner.test.tsx index dde8fe822a4..45e387d25a4 100644 --- a/src/renderer/src/components/editor/ExternalFileChangeBanner.test.tsx +++ b/src/renderer/src/components/editor/ExternalFileChangeBanner.test.tsx @@ -12,7 +12,7 @@ vi.mock('@/store', () => ({ getState: vi.fn() } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-read-client', () => ({ readRuntimeFileContent: readRuntimeFileContentMock })) vi.mock('@/runtime/runtime-rpc-client', () => ({})) diff --git a/src/renderer/src/components/editor/ExternalFileChangeBanner.tsx b/src/renderer/src/components/editor/ExternalFileChangeBanner.tsx index be943fb5c8e..0b1d3f817d4 100644 --- a/src/renderer/src/components/editor/ExternalFileChangeBanner.tsx +++ b/src/renderer/src/components/editor/ExternalFileChangeBanner.tsx @@ -4,7 +4,7 @@ import { toast } from 'sonner' import { Button } from '@/components/ui/button' import { getConnectionIdForFile } from '@/lib/connection-context' import { editorTabFileAccess } from '@/lib/local-file-access' -import { readRuntimeFileContent } from '@/runtime/runtime-file-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' import { getRuntimeTargetForFileOwner } from '@/lib/file-owner-runtime-target' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.test.tsx b/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.test.tsx index a379cfd1a8e..0b6e6b91a73 100644 --- a/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.test.tsx +++ b/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.test.tsx @@ -10,7 +10,7 @@ const mocks = vi.hoisted(() => ({ getState: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-read-client', () => ({ readRuntimeFileContent: mocks.readRuntimeFileContent })) vi.mock('@/runtime/runtime-rpc-client', () => ({})) diff --git a/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.tsx b/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.tsx index c3a506e351e..93113c14378 100644 --- a/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.tsx +++ b/src/renderer/src/components/editor/ExternalFileChangeCompareDialog.tsx @@ -13,7 +13,7 @@ import { lazyWithRetry as lazy } from '@/lib/lazy-with-retry' import { getConnectionIdForFile } from '@/lib/connection-context' import { editorTabFileAccess } from '@/lib/local-file-access' import { detectLanguage } from '@/lib/language-detect' -import { readRuntimeFileContent } from '@/runtime/runtime-file-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' import { FILE_OWNER_UNRESOLVED_MESSAGE, getRuntimeTargetForFileOwner diff --git a/src/renderer/src/components/editor/MarkdownPreview.image-access.test.tsx b/src/renderer/src/components/editor/MarkdownPreview.image-access.test.tsx index a8a579c29b3..9867c06acac 100644 --- a/src/renderer/src/components/editor/MarkdownPreview.image-access.test.tsx +++ b/src/renderer/src/components/editor/MarkdownPreview.image-access.test.tsx @@ -59,7 +59,7 @@ vi.mock('@/runtime/use-worktree-runtime-target', () => ({ ? { kind: 'environment', environmentId: runtimeEnvironmentId } : { kind: 'local' } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ statRuntimePath: vi.fn(async () => ({ isDirectory: false })) })) vi.mock('@/lib/connection-context', () => ({ getConnectionIdForFile: () => null })) diff --git a/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx b/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx index d22e47bcdf8..468c2fdcddc 100644 --- a/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx +++ b/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx @@ -79,9 +79,7 @@ vi.mock('@/runtime/use-worktree-runtime-target', () => ({ ? { kind: 'environment', environmentId: runtimeEnvironmentId } : { kind: 'local' } })) -vi.mock('@/runtime/runtime-file-client', () => ({ - statRuntimePath: statRuntimePathMock -})) +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ statRuntimePath: statRuntimePathMock })) vi.mock('@/lib/connection-context', () => ({ getConnectionIdForFile: (worktreeId: string) => targetConnectionOwners.get(worktreeId) })) diff --git a/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx b/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx index f6fb46d38ce..353b3c61590 100644 --- a/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx +++ b/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx @@ -65,7 +65,7 @@ vi.mock('@/runtime/use-worktree-runtime-target', () => ({ ? { kind: 'environment', environmentId: runtimeEnvironmentId } : { kind: 'local' } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ statRuntimePath: vi.fn(async () => ({ isDirectory: false })) })) vi.mock('@/lib/connection-context', () => ({ getConnectionIdForFile: () => null })) diff --git a/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-section-actions.ts b/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-section-actions.ts index 0fa71dbf136..23e52664f0a 100644 --- a/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-section-actions.ts +++ b/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-section-actions.ts @@ -6,7 +6,7 @@ import { detectLanguage } from '@/lib/language-detect' import { joinPath } from '@/lib/path' import { openFilePreviewToSide } from '@/lib/file-preview' import { getEditorFileOperationContext } from '@/lib/editor-file-operation-owner' -import { writeRuntimeFile } from '@/runtime/runtime-file-client' +import { writeRuntimeFile } from '@/runtime/runtime-file-mutation-client' import { findWorktreeById } from '@/store/slices/worktree-helpers' import type { OpenFile } from '@/store/slices/editor' import type { GitBranchChangeEntry } from '../../../../../../shared/git-diff-compare-types' diff --git a/src/renderer/src/components/editor/csv/csv-file-content.ts b/src/renderer/src/components/editor/csv/csv-file-content.ts index a5d66664dc7..dbdb180644a 100644 --- a/src/renderer/src/components/editor/csv/csv-file-content.ts +++ b/src/renderer/src/components/editor/csv/csv-file-content.ts @@ -1,5 +1,5 @@ import type { RuntimeFileReadArgs } from '@/runtime/runtime-file-client-types' -import { readRuntimeFileContent } from '@/runtime/runtime-file-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' import { statRuntimeReadTarget, type RuntimeFileSnapshot diff --git a/src/renderer/src/components/editor/csv/csv-preview-save-safety.test.ts b/src/renderer/src/components/editor/csv/csv-preview-save-safety.test.ts index fe2e247c966..a49b47b9921 100644 --- a/src/renderer/src/components/editor/csv/csv-preview-save-safety.test.ts +++ b/src/renderer/src/components/editor/csv/csv-preview-save-safety.test.ts @@ -5,7 +5,7 @@ import { createEditorSaveQueue } from '../editor-save-queue' import { canAutoSaveOpenFile } from '../editor-autosave' const { writeFile } = vi.hoisted(() => ({ writeFile: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ writeRuntimeFile: writeFile })) +vi.mock('@/runtime/runtime-file-mutation-client', () => ({ writeRuntimeFile: writeFile })) it('blocks drafts, dirty state, autosave and explicit writes for paged previews', async () => { const store = createEditorStore() diff --git a/src/renderer/src/components/editor/editor-dropped-file-open.ts b/src/renderer/src/components/editor/editor-dropped-file-open.ts index 1d253dbf0ee..4d0358e0d37 100644 --- a/src/renderer/src/components/editor/editor-dropped-file-open.ts +++ b/src/renderer/src/components/editor/editor-dropped-file-open.ts @@ -5,10 +5,8 @@ import { useAppStore } from '@/store' import { getConnectionId } from '@/lib/connection-context' import { joinPath } from '@/lib/path' import type { WorktreeRuntimeOwnerState } from '@/lib/worktree-runtime-owner' -import { - importExternalPathsToRuntime, - type RuntimeFileOperationArgs -} from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { runtimeTargetEnvironmentId, type RuntimeClientTarget diff --git a/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.test.ts b/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.test.ts index 1cda0011ebd..f2ebd52ce76 100644 --- a/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.test.ts +++ b/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.test.ts @@ -12,7 +12,7 @@ const mocks = vi.hoisted(() => ({ pathExists: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-read-client', () => ({ readRuntimeFileContent: mocks.readRuntimeFileContent })) vi.mock('@/runtime/runtime-rpc-client', () => ({})) diff --git a/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.ts b/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.ts index 2caf51e322e..d34751fd4cb 100644 --- a/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.ts +++ b/src/renderer/src/components/editor/editor-restored-tab-conflict-scan.ts @@ -4,7 +4,7 @@ import type { AppState } from '@/store' import type { OpenFile } from '@/store/slices/editor' import { getConnectionIdForFile } from '@/lib/connection-context' import { editorTabFileAccess } from '@/lib/local-file-access' -import { readRuntimeFileContent } from '@/runtime/runtime-file-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' import { getRuntimeTargetForFileOwner, requireRuntimeTargetForFileOwner diff --git a/src/renderer/src/components/editor/editor-save-queue.ts b/src/renderer/src/components/editor/editor-save-queue.ts index d3873c6b679..e7c94eead0c 100644 --- a/src/renderer/src/components/editor/editor-save-queue.ts +++ b/src/renderer/src/components/editor/editor-save-queue.ts @@ -2,7 +2,7 @@ import type { StoreApi } from 'zustand' import type { AppState } from '@/store' import type { OpenFile } from '@/store/slices/editor' import { findWorktreeById } from '@/store/slices/worktree-helpers' -import { writeRuntimeFile } from '@/runtime/runtime-file-client' +import { writeRuntimeFile } from '@/runtime/runtime-file-mutation-client' import { getEditorFileOperationContext } from '@/lib/editor-file-operation-owner' import { canAutoSaveOpenFile, diff --git a/src/renderer/src/components/editor/local-image-src-reader.ts b/src/renderer/src/components/editor/local-image-src-reader.ts index acef96fc54a..9e9cf5b3c94 100644 --- a/src/renderer/src/components/editor/local-image-src-reader.ts +++ b/src/renderer/src/components/editor/local-image-src-reader.ts @@ -1,6 +1,6 @@ import type { LocalFileAccess } from '../../../../shared/local-file-access' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' -import { readRuntimeFilePreview } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' +import { readRuntimeFilePreview } from '@/runtime/runtime-file-read-client' export function readLocalImagePreview( absolutePath: string, diff --git a/src/renderer/src/components/editor/markdown-document-list-request.test.ts b/src/renderer/src/components/editor/markdown-document-list-request.test.ts index 062aec9ed98..14f410c0e10 100644 --- a/src/renderer/src/components/editor/markdown-document-list-request.test.ts +++ b/src/renderer/src/components/editor/markdown-document-list-request.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { MarkdownDocument } from '../../../../shared/filesystem-entry-types' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { getMarkdownDocumentListRequestKey, requestSharedMarkdownDocumentList diff --git a/src/renderer/src/components/editor/markdown-document-list-request.ts b/src/renderer/src/components/editor/markdown-document-list-request.ts index dc311fc327b..f84290adfa7 100644 --- a/src/renderer/src/components/editor/markdown-document-list-request.ts +++ b/src/renderer/src/components/editor/markdown-document-list-request.ts @@ -1,8 +1,6 @@ import type { MarkdownDocument } from '../../../../shared/filesystem-entry-types' -import { - listRuntimeMarkdownDocuments, - type RuntimeFileOperationArgs -} from '@/runtime/runtime-file-client' +import { listRuntimeMarkdownDocuments } from '@/runtime/runtime-file-metadata-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' type MarkdownDocumentListLoader = ( context: RuntimeFileOperationArgs, diff --git a/src/renderer/src/components/editor/markdown-preview-link-actions.ts b/src/renderer/src/components/editor/markdown-preview-link-actions.ts index 7e1fd5a6254..4247ee20bdd 100644 --- a/src/renderer/src/components/editor/markdown-preview-link-actions.ts +++ b/src/renderer/src/components/editor/markdown-preview-link-actions.ts @@ -7,7 +7,7 @@ import { getLinkSourceLocalOpenOwner } from '@/lib/link-source-local-open-owner' import { openHttpLink } from '@/lib/http-link-routing' import { translate } from '@/i18n/i18n' import { requireRuntimeTargetForFileOwner } from '@/lib/file-owner-runtime-target' -import { statRuntimePath } from '@/runtime/runtime-file-client' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' import { useAppStore } from '@/store' import { relativePathInsideRoot } from '../../../../shared/cross-platform-path' import { resolveMarkdownLinkTarget } from './markdown-internal-links' diff --git a/src/renderer/src/components/editor/markdown-preview-local-images.ts b/src/renderer/src/components/editor/markdown-preview-local-images.ts index 51d6631dcc4..b0e009c908d 100644 --- a/src/renderer/src/components/editor/markdown-preview-local-images.ts +++ b/src/renderer/src/components/editor/markdown-preview-local-images.ts @@ -4,7 +4,7 @@ import remarkParse from 'remark-parse' import { unified } from 'unified' import { resolveImageAbsolutePath } from './markdown-preview-links' import { getLocalImageCacheKey, loadLocalImageAbsolutePath } from './useLocalImageSrc' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { documentResourceAccess } from '@/lib/local-file-access' export const MARKDOWN_PREVIEW_LOCAL_IMAGE_PREWARM_LIMIT = 64 diff --git a/src/renderer/src/components/editor/restored-editor-owner-save-lifecycle.test.ts b/src/renderer/src/components/editor/restored-editor-owner-save-lifecycle.test.ts index 1d5ccf262b3..4fcedd4eefd 100644 --- a/src/renderer/src/components/editor/restored-editor-owner-save-lifecycle.test.ts +++ b/src/renderer/src/components/editor/restored-editor-owner-save-lifecycle.test.ts @@ -1,7 +1,7 @@ // @vitest-environment happy-dom import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as RuntimeFileClient from '@/runtime/runtime-file-client' +import type * as RuntimeFileMutationClient from '@/runtime/runtime-file-mutation-client' import { useAppStore } from '@/store' import type { AppState } from '@/store/types' import { attachEditorAutosaveController } from './editor-autosave-controller' @@ -10,8 +10,8 @@ import { migrateRestoredEditorFileOwner } from './migrate-restored-editor-file-o const mocks = vi.hoisted(() => ({ writeRuntimeFile: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', async (importOriginal) => ({ - ...(await importOriginal()), +vi.mock('@/runtime/runtime-file-mutation-client', async (importOriginal) => ({ + ...(await importOriginal()), writeRuntimeFile: mocks.writeRuntimeFile })) diff --git a/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx b/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx index 661608108a6..43db39c429c 100644 --- a/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx +++ b/src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.test.tsx @@ -3,7 +3,7 @@ import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as RuntimeFileClient from '@/runtime/runtime-file-client' +import type * as RuntimeFileReadClient from '@/runtime/runtime-file-read-client' import { useAppStore } from '@/store' import { makeWorktree } from '../../store/slices/worktrees-slice-test-fixtures' import type { FileContent } from './editor-panel-content-types' @@ -13,8 +13,8 @@ import { } from './useEditorPanelFileContentLoader' const mocks = vi.hoisted(() => ({ readRuntimeFileContent: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', async (importOriginal) => ({ - ...(await importOriginal()), +vi.mock('@/runtime/runtime-file-read-client', async (importOriginal) => ({ + ...(await importOriginal()), readRuntimeFileContent: mocks.readRuntimeFileContent })) diff --git a/src/renderer/src/components/editor/rich-markdown-async-image-paste.test.ts b/src/renderer/src/components/editor/rich-markdown-async-image-paste.test.ts index bc36c25b931..ea4e9aae2f4 100644 --- a/src/renderer/src/components/editor/rich-markdown-async-image-paste.test.ts +++ b/src/renderer/src/components/editor/rich-markdown-async-image-paste.test.ts @@ -2,7 +2,7 @@ import { Editor } from '@tiptap/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { toast } from 'sonner' import { createRichMarkdownExtensions } from './rich-markdown-extensions' import { createRichMarkdownEditorCodec } from './rich-markdown-source-transport' @@ -13,7 +13,7 @@ import { type RichMarkdownImageRuntimeContext } from './rich-markdown-image-context' -vi.mock('@/runtime/runtime-file-client', () => ({ importExternalPathsToRuntime: vi.fn() })) +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: vi.fn() })) vi.mock('@/lib/connection-context', () => ({ getConnectionId: vi.fn(() => null) })) vi.mock('@/store', () => ({ useAppStore: { diff --git a/src/renderer/src/components/editor/rich-markdown-async-image-table.test.ts b/src/renderer/src/components/editor/rich-markdown-async-image-table.test.ts index 036d1567913..174519a7638 100644 --- a/src/renderer/src/components/editor/rich-markdown-async-image-table.test.ts +++ b/src/renderer/src/components/editor/rich-markdown-async-image-table.test.ts @@ -2,12 +2,12 @@ import { Editor } from '@tiptap/react' import { CellSelection } from '@tiptap/pm/tables' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { createRichMarkdownExtensions } from './rich-markdown-extensions' import { createRichMarkdownEditorCodec } from './rich-markdown-source-transport' import { handleRichMarkdownImagePaste } from './rich-markdown-paste-image' -vi.mock('@/runtime/runtime-file-client', () => ({ importExternalPathsToRuntime: vi.fn() })) +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: vi.fn() })) vi.mock('@/lib/connection-context', () => ({ getConnectionId: vi.fn(() => null) })) vi.mock('@/store', () => ({ useAppStore: { diff --git a/src/renderer/src/components/editor/rich-markdown-extensions.ts b/src/renderer/src/components/editor/rich-markdown-extensions.ts index 890017c889f..034e5ab2e64 100644 --- a/src/renderer/src/components/editor/rich-markdown-extensions.ts +++ b/src/renderer/src/components/editor/rich-markdown-extensions.ts @@ -19,7 +19,7 @@ import { loadLocalImageSrc, onImageCacheInvalidated } from './useLocalImageSrc' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { createRawMarkdownHtmlBlock, createRawMarkdownHtmlInline, diff --git a/src/renderer/src/components/editor/rich-markdown-image-context.ts b/src/renderer/src/components/editor/rich-markdown-image-context.ts index ff84266e819..f20a57fe37e 100644 --- a/src/renderer/src/components/editor/rich-markdown-image-context.ts +++ b/src/renderer/src/components/editor/rich-markdown-image-context.ts @@ -1,7 +1,7 @@ import type { Editor } from '@tiptap/core' import { getConnectionId } from '@/lib/connection-context' import type { RuntimeClientTarget } from '@/runtime/runtime-client-target' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' export type RichMarkdownImageRuntimeContext = Omit & { connectionId?: string | null diff --git a/src/renderer/src/components/editor/rich-markdown-image-insert-code-block.test.ts b/src/renderer/src/components/editor/rich-markdown-image-insert-code-block.test.ts index 73c8f934ed2..8a8198e51af 100644 --- a/src/renderer/src/components/editor/rich-markdown-image-insert-code-block.test.ts +++ b/src/renderer/src/components/editor/rich-markdown-image-insert-code-block.test.ts @@ -9,7 +9,7 @@ import { useLocalImagePick } from './useLocalImagePick' import { handleRichMarkdownImagePaste } from './rich-markdown-paste-image' import { runSlashCommand, slashCommands } from './rich-markdown-slash-commands' -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: vi.fn().mockResolvedValue({ results: [{ status: 'imported', destPath: '/repo/shot.png' }] }) diff --git a/src/renderer/src/components/editor/rich-markdown-image-insert.test.ts b/src/renderer/src/components/editor/rich-markdown-image-insert.test.ts index d3083448bcc..526da451f90 100644 --- a/src/renderer/src/components/editor/rich-markdown-image-insert.test.ts +++ b/src/renderer/src/components/editor/rich-markdown-image-insert.test.ts @@ -6,12 +6,10 @@ import { toast } from 'sonner' import { insertRichMarkdownImageFromPath } from './rich-markdown-image-insert' import { createRichMarkdownExtensions } from './rich-markdown-extensions' import { createRichMarkdownEditorCodec } from './rich-markdown-source-transport' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { getConnectionIdForFile } from '@/lib/connection-context' -vi.mock('@/runtime/runtime-file-client', () => ({ - importExternalPathsToRuntime: vi.fn() -})) +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: vi.fn() })) vi.mock('@/lib/connection-context', () => ({ getConnectionId: vi.fn(() => null), diff --git a/src/renderer/src/components/editor/rich-markdown-image-insert.ts b/src/renderer/src/components/editor/rich-markdown-image-insert.ts index a040bb9f86b..91dbd276316 100644 --- a/src/renderer/src/components/editor/rich-markdown-image-insert.ts +++ b/src/renderer/src/components/editor/rich-markdown-image-insert.ts @@ -3,7 +3,7 @@ import { toast } from 'sonner' import { dirname, basename } from '@/lib/path' import { getConnectionId } from '@/lib/connection-context' import { useAppStore } from '@/store' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { getEditorFileOperationContext } from '@/lib/editor-file-operation-owner' import { editorTabDocumentFolderAccess } from '@/lib/local-file-access' import { requireRuntimeTargetForFileOwner } from '@/lib/file-owner-runtime-target' diff --git a/src/renderer/src/components/editor/use-editor-group-file-drop-owner.remote.test.tsx b/src/renderer/src/components/editor/use-editor-group-file-drop-owner.remote.test.tsx index 92c5988e146..1dfd6526b22 100644 --- a/src/renderer/src/components/editor/use-editor-group-file-drop-owner.remote.test.tsx +++ b/src/renderer/src/components/editor/use-editor-group-file-drop-owner.remote.test.tsx @@ -20,7 +20,7 @@ const mocks = vi.hoisted(() => ({ toastError: vi.fn() })) vi.mock('sonner', () => ({ toast: { error: mocks.toastError } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) diff --git a/src/renderer/src/components/editor/useEditorPanelContentState.test.tsx b/src/renderer/src/components/editor/useEditorPanelContentState.test.tsx index 6c4b955ba13..20774783c33 100644 --- a/src/renderer/src/components/editor/useEditorPanelContentState.test.tsx +++ b/src/renderer/src/components/editor/useEditorPanelContentState.test.tsx @@ -17,16 +17,18 @@ const mocks = vi.hoisted(() => ({ getState: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-routing', () => ({ getRuntimeFileReadScope: vi.fn( ( target: { kind: 'local' } | { kind: 'environment'; environmentId: string }, connectionId?: string ) => connectionId ?? (target.kind === 'environment' ? target.environmentId : null) - ), - readRuntimeFileContent: mocks.readRuntimeFileContent, - subscribeRuntimeFileChanges: vi.fn() + ) })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: mocks.readRuntimeFileContent +})) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) vi.mock('@/runtime/runtime-git-client', () => ({ getRuntimeGitBranchDiff: mocks.getRuntimeGitBranchDiff, diff --git a/src/renderer/src/components/editor/useEditorPanelFileContentLoader.ts b/src/renderer/src/components/editor/useEditorPanelFileContentLoader.ts index 461d7e5a050..eaa3ef6248a 100644 --- a/src/renderer/src/components/editor/useEditorPanelFileContentLoader.ts +++ b/src/renderer/src/components/editor/useEditorPanelFileContentLoader.ts @@ -3,7 +3,7 @@ import type { OpenFile } from '@/store/slices/editor' import { getConnectionIdForFile, isWorktreeConnectionResolved } from '@/lib/connection-context' import { useAppStore } from '@/store' import { getDiskBaselineSignature } from './diff-content-signature' -import { getRuntimeFileReadScope } from '@/runtime/runtime-file-client' +import { getRuntimeFileReadScope } from '@/runtime/runtime-file-routing' import { readEditorCsvFileContent } from './csv/csv-file-content' import { RuntimeRpcCallError } from '@/runtime/runtime-rpc-client' import type { RuntimeClientTarget } from '@/runtime/runtime-client-target' diff --git a/src/renderer/src/components/editor/useEditorPanelFileLoadRetry.host-connection.test.tsx b/src/renderer/src/components/editor/useEditorPanelFileLoadRetry.host-connection.test.tsx index af567bd10bb..b8e43cbac1e 100644 --- a/src/renderer/src/components/editor/useEditorPanelFileLoadRetry.host-connection.test.tsx +++ b/src/renderer/src/components/editor/useEditorPanelFileLoadRetry.host-connection.test.tsx @@ -31,9 +31,11 @@ vi.mock('@/lib/connection-context', () => ({ getConnectionIdForFile: () => 'ssh-a', isWorktreeConnectionResolved: () => true })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-routing', () => ({ getRuntimeFileReadScope: (_settings: unknown, connectionId: string | undefined) => - connectionId ?? 'local', + connectionId ?? 'local' +})) +vi.mock('@/runtime/runtime-file-read-client', () => ({ readRuntimeFileContent: mocks.readRuntimeFileContent })) diff --git a/src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx b/src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx index 0636a94dbc1..e164f238c4a 100644 --- a/src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx +++ b/src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx @@ -13,16 +13,18 @@ const mocks = vi.hoisted(() => ({ getState: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-routing', () => ({ getRuntimeFileReadScope: vi.fn( ( settings: { activeRuntimeEnvironmentId?: string | null } | null | undefined, connectionId?: string ) => connectionId ?? settings?.activeRuntimeEnvironmentId ?? null - ), - readRuntimeFileContent: mocks.readRuntimeFileContent, - subscribeRuntimeFileChanges: vi.fn() + ) })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: mocks.readRuntimeFileContent +})) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) vi.mock('@/runtime/runtime-git-client', () => ({ getRuntimeGitBranchDiff: vi.fn(), diff --git a/src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx b/src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx index 600b79f8adf..f6d94f1a093 100644 --- a/src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx +++ b/src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx @@ -11,14 +11,16 @@ const mocks = vi.hoisted(() => ({ readRuntimeFileContent: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-routing', () => ({ getRuntimeFileReadScope: vi.fn( (settings: { activeRuntimeEnvironmentId?: string | null } | null | undefined) => settings?.activeRuntimeEnvironmentId ?? null - ), - readRuntimeFileContent: mocks.readRuntimeFileContent, - subscribeRuntimeFileChanges: vi.fn() + ) })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: mocks.readRuntimeFileContent +})) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) vi.mock('@/runtime/runtime-git-client', () => ({ getRuntimeGitBranchDiff: vi.fn(), diff --git a/src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsx b/src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsx index 0dad110e8ec..45407cf03d2 100644 --- a/src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsx +++ b/src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsx @@ -13,16 +13,18 @@ const mocks = vi.hoisted(() => ({ getState: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-routing', () => ({ getRuntimeFileReadScope: vi.fn( ( settings: { activeRuntimeEnvironmentId?: string | null } | null | undefined, connectionId?: string ) => connectionId ?? settings?.activeRuntimeEnvironmentId ?? null - ), - readRuntimeFileContent: mocks.readRuntimeFileContent, - subscribeRuntimeFileChanges: vi.fn() + ) })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: mocks.readRuntimeFileContent +})) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) vi.mock('@/runtime/runtime-git-client', () => ({ getRuntimeGitBranchDiff: vi.fn(), diff --git a/src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx b/src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx index 818f50107be..c8ac2c67daf 100644 --- a/src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx +++ b/src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx @@ -13,11 +13,11 @@ const mocks = vi.hoisted(() => ({ readRuntimeFileContent: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ - getRuntimeFileReadScope: vi.fn(() => null), - readRuntimeFileContent: mocks.readRuntimeFileContent, - subscribeRuntimeFileChanges: vi.fn() +vi.mock('@/runtime/runtime-file-routing', () => ({ getRuntimeFileReadScope: vi.fn(() => null) })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: mocks.readRuntimeFileContent })) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) vi.mock('@/runtime/runtime-git-client', () => ({ getRuntimeGitBranchDiff: vi.fn(), diff --git a/src/renderer/src/components/editor/useLocalImagePick.test.tsx b/src/renderer/src/components/editor/useLocalImagePick.test.tsx index 6aaf0e20795..4138b14727e 100644 --- a/src/renderer/src/components/editor/useLocalImagePick.test.tsx +++ b/src/renderer/src/components/editor/useLocalImagePick.test.tsx @@ -4,12 +4,12 @@ import { Editor } from '@tiptap/react' import { renderHook } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { toast } from 'sonner' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { createRichMarkdownExtensions } from './rich-markdown-extensions' import { createRichMarkdownEditorCodec } from './rich-markdown-source-transport' import { useLocalImagePick } from './useLocalImagePick' -vi.mock('@/runtime/runtime-file-client', () => ({ importExternalPathsToRuntime: vi.fn() })) +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: vi.fn() })) vi.mock('@/lib/connection-context', () => ({ getConnectionId: vi.fn(() => null) })) vi.mock('@/store', () => ({ useAppStore: { diff --git a/src/renderer/src/components/editor/useLocalImageSrc.test.ts b/src/renderer/src/components/editor/useLocalImageSrc.test.ts index 6dd8c92d0a5..46d8bb980ee 100644 --- a/src/renderer/src/components/editor/useLocalImageSrc.test.ts +++ b/src/renderer/src/components/editor/useLocalImageSrc.test.ts @@ -12,7 +12,7 @@ import { resetLocalImageSrcStateForTests, useLocalImageSrc } from './useLocalImageSrc' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { blobUrlCache, cacheLocalImageBlob, diff --git a/src/renderer/src/components/editor/useLocalImageSrc.ts b/src/renderer/src/components/editor/useLocalImageSrc.ts index f82ac8cfac0..362d01c82dc 100644 --- a/src/renderer/src/components/editor/useLocalImageSrc.ts +++ b/src/renderer/src/components/editor/useLocalImageSrc.ts @@ -1,6 +1,6 @@ import { useEffect, useEffectEvent, useState } from 'react' import { resolveImageAbsolutePath } from './markdown-preview-links' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { readLocalImagePreview } from './local-image-src-reader' import type { LocalFileAccess } from '../../../../shared/local-file-access' import { diff --git a/src/renderer/src/components/editor/useMarkdownDocuments.navigation.test.ts b/src/renderer/src/components/editor/useMarkdownDocuments.navigation.test.ts index e99dc37f823..9a156076e40 100644 --- a/src/renderer/src/components/editor/useMarkdownDocuments.navigation.test.ts +++ b/src/renderer/src/components/editor/useMarkdownDocuments.navigation.test.ts @@ -32,7 +32,7 @@ vi.mock('@/store', () => ({ }) })) vi.mock('@/lib/connection-context', () => ({ getConnectionIdFromState: () => runtimeConnectionId })) -vi.mock('@/runtime/runtime-file-client', () => ({ statRuntimePath: runtime.stat })) +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ statRuntimePath: runtime.stat })) vi.mock('@/lib/file-owner-runtime-target', () => { const getRuntimeTargetForFileOwner = ( _state: unknown, diff --git a/src/renderer/src/components/editor/useMarkdownDocuments.ts b/src/renderer/src/components/editor/useMarkdownDocuments.ts index 259a7166ffa..8e2183db8d4 100644 --- a/src/renderer/src/components/editor/useMarkdownDocuments.ts +++ b/src/renderer/src/components/editor/useMarkdownDocuments.ts @@ -4,7 +4,7 @@ import type { MarkdownDocument } from '../../../../shared/filesystem-entry-types import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' import { getConnectionIdFromState } from '@/lib/connection-context' -import { statRuntimePath } from '@/runtime/runtime-file-client' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' import { getRuntimeTargetForFileOwner, requireRuntimeTargetForFileOwner diff --git a/src/renderer/src/components/editor/useMarkdownDocuments.watch.test.ts b/src/renderer/src/components/editor/useMarkdownDocuments.watch.test.ts index 4058b8ea315..82f58628f4e 100644 --- a/src/renderer/src/components/editor/useMarkdownDocuments.watch.test.ts +++ b/src/renderer/src/components/editor/useMarkdownDocuments.watch.test.ts @@ -20,7 +20,7 @@ vi.mock('@/store', () => ({ }) })) vi.mock('@/lib/connection-context', () => ({ getConnectionIdFromState: () => null })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ listRuntimeMarkdownDocuments: runtime.list, statRuntimePath: runtime.stat })) diff --git a/src/renderer/src/components/editor/useUntitledFileRename.ts b/src/renderer/src/components/editor/useUntitledFileRename.ts index 9b36ff18c5d..85766f7b076 100644 --- a/src/renderer/src/components/editor/useUntitledFileRename.ts +++ b/src/renderer/src/components/editor/useUntitledFileRename.ts @@ -2,7 +2,8 @@ import { useCallback, useState } from 'react' import { dirname, joinPath } from '@/lib/path' import { useAppStore } from '@/store' import type { OpenFile } from '@/store/slices/editor' -import { createRuntimePath, runtimePathExists } from '@/runtime/runtime-file-client' +import { createRuntimePath } from '@/runtime/runtime-file-mutation-client' +import { runtimePathExists } from '@/runtime/runtime-file-metadata-client' import { executeOpenEditorPathMove } from '@/lib/execute-open-editor-path-move' import { getEditorFileOperationContext } from '@/lib/editor-file-operation-owner' import { requestEditorFileSave, requestEditorSaveQuiesce } from './editor-autosave' diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index 2bd3cc02f38..b537a0195e3 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -15,7 +15,7 @@ import { nativeChatTaskListPredecessors } from './native-chat-task-list-history' import { NativeChatTaskList } from './NativeChatTaskList' import { useNativeChatTurnStatus } from './use-native-chat-turn-status' import { NativeChatAwaitingInputRow } from './NativeChatAwaitingInputRow' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { NativeChatTurnActivity } from '../../../../shared/native-chat-turn-activity' import { NativeChatTurnActivityLine } from './NativeChatTurnActivityLine' import { diff --git a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx index a5cccb609cb..f2b1f852b93 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx @@ -17,7 +17,7 @@ import type { NativeChatSubagentDisclosure, NativeChatSubagentRosterState } from './native-chat-subagent-sections' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { useNativeChatWorkRun } from './use-native-chat-work-run' import { useNativeChatRowNavigation } from './use-native-chat-row-navigation' diff --git a/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.test.tsx b/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.test.tsx index 593ee255d89..13382faa3c7 100644 --- a/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.test.tsx @@ -4,7 +4,7 @@ import { act, createElement } from 'react' import { fireEvent, screen, within } from '@testing-library/react' import { createRoot } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { invalidateLocalImageSrcCacheForTests, loadLocalImageSrc, diff --git a/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx b/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx index 28de5d9536f..4ee3db9031b 100644 --- a/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx +++ b/src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx @@ -15,7 +15,7 @@ import { useLocalImageSrc, releaseLocalImageSrcByKey } from '@/components/editor/useLocalImageSrc' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { copyableNativeChatImageSrc, keepPreviewOpenForChatMenu } from './native-chat-image-copy' import { isNativeChatPastedImagePath } from './native-chat-image-paste' import { chatImageAccess } from '@/lib/local-file-access' diff --git a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx index a131752a2f4..56c5aab4050 100644 --- a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx @@ -1,7 +1,7 @@ import { memo, useContext } from 'react' import type { CommentMarkdownLinkClickHandler } from '@/components/sidebar/CommentMarkdown' import { cn } from '@/lib/utils' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { MessageRow, type NativeChatDeliveryNotice } from './NativeChatMessageRow' import { NativeChatResolutionReceipt } from './NativeChatResolutionReceipt' import { NativeChatWorkingStatus } from './NativeChatWorkingStatus' diff --git a/src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx b/src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx index 1cf3bbc7a1d..28460c8ff48 100644 --- a/src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx @@ -3,7 +3,7 @@ import { Button } from '@/components/ui/button' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' import type { CommentMarkdownLinkClickHandler } from '@/components/sidebar/CommentMarkdown' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { NativeChatMessage } from '../../../../shared/native-chat-types' import type { NativeChatDeliveryNotice } from './NativeChatMessageRow' import { NativeChatRewindAction } from './NativeChatRewindAction' diff --git a/src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts b/src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts index 3bca121f615..27fad000546 100644 --- a/src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts +++ b/src/renderer/src/components/native-chat/native-chat-image-runtime-context.ts @@ -1,6 +1,6 @@ import { useAppStore } from '@/store' import type { AppState } from '@/store/types' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { runtimeTargetForOwnerEnvironment, type RuntimeClientTarget diff --git a/src/renderer/src/components/native-chat/use-native-chat-mention-files.test.tsx b/src/renderer/src/components/native-chat/use-native-chat-mention-files.test.tsx index be510149cd1..73864463baf 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-mention-files.test.tsx +++ b/src/renderer/src/components/native-chat/use-native-chat-mention-files.test.tsx @@ -8,7 +8,7 @@ import { } from '../quick-open-file-list-test-harness' import { useNativeChatMentionFiles } from './use-native-chat-mention-files' -vi.mock('@/runtime/runtime-file-client', async () => { +vi.mock('@/runtime/runtime-file-search-client', async () => { const mocks = await import('../__mocks__/quick-open-runtime-file-client') return { listRuntimeFiles: mocks.listRuntimeFilesMock, diff --git a/src/renderer/src/components/quick-open-file-list-host-name-filter.react.test.tsx b/src/renderer/src/components/quick-open-file-list-host-name-filter.react.test.tsx index f683cbea97d..ac538a1f3c5 100644 --- a/src/renderer/src/components/quick-open-file-list-host-name-filter.react.test.tsx +++ b/src/renderer/src/components/quick-open-file-list-host-name-filter.react.test.tsx @@ -12,7 +12,7 @@ import { useRuntimeFileListForWorktree, type RuntimeFileListState } from './quic const listRuntimeFilesMock = vi.hoisted(() => vi.fn()) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-search-client', () => ({ listRuntimeFiles: listRuntimeFilesMock, cancelRuntimeFileList: vi.fn(), searchRuntimeFilePaths: vi.fn() diff --git a/src/renderer/src/components/quick-open-file-list-remote-catalog.react.test.tsx b/src/renderer/src/components/quick-open-file-list-remote-catalog.react.test.tsx index cd44734578b..ffc937f0b57 100644 --- a/src/renderer/src/components/quick-open-file-list-remote-catalog.react.test.tsx +++ b/src/renderer/src/components/quick-open-file-list-remote-catalog.react.test.tsx @@ -14,7 +14,7 @@ import { renderProbe } from './quick-open-file-list-test-harness' -vi.mock('@/runtime/runtime-file-client', async () => { +vi.mock('@/runtime/runtime-file-search-client', async () => { const mocks = await import('./__mocks__/quick-open-runtime-file-client') return { listRuntimeFiles: mocks.listRuntimeFilesMock, diff --git a/src/renderer/src/components/quick-open-file-list.react.test.tsx b/src/renderer/src/components/quick-open-file-list.react.test.tsx index 716b425ad93..a9f35d78ff2 100644 --- a/src/renderer/src/components/quick-open-file-list.react.test.tsx +++ b/src/renderer/src/components/quick-open-file-list.react.test.tsx @@ -21,7 +21,7 @@ import { renderProbe } from './quick-open-file-list-test-harness' -vi.mock('@/runtime/runtime-file-client', async () => { +vi.mock('@/runtime/runtime-file-search-client', async () => { const mocks = await import('./__mocks__/quick-open-runtime-file-client') return { listRuntimeFiles: mocks.listRuntimeFilesMock, diff --git a/src/renderer/src/components/quick-open-file-list.ts b/src/renderer/src/components/quick-open-file-list.ts index ffc880c1b4b..22ca5b12f36 100644 --- a/src/renderer/src/components/quick-open-file-list.ts +++ b/src/renderer/src/components/quick-open-file-list.ts @@ -23,7 +23,7 @@ import { cancelRuntimeFileList, listRuntimeFiles, searchRuntimeFilePaths -} from '@/runtime/runtime-file-client' +} from '@/runtime/runtime-file-search-client' import { debounceRuntimeFileRequest } from '@/runtime/runtime-file-request-debounce' import { splitFileNameFilterTokens } from '../../../shared/file-name-filter-tokens' import { diff --git a/src/renderer/src/components/quick-open-file-navigation.test.ts b/src/renderer/src/components/quick-open-file-navigation.test.ts index 47d7deb5514..28d423608a2 100644 --- a/src/renderer/src/components/quick-open-file-navigation.test.ts +++ b/src/renderer/src/components/quick-open-file-navigation.test.ts @@ -26,12 +26,14 @@ vi.mock('@/store', () => ({ }) } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ statRuntimePath: mocks.stat, - isRemoteRuntimeFileOperation: (context: { connectionId?: string }) => - Boolean(context.connectionId), isMissingRuntimePathError: (error: Error) => error.message.includes('ENOENT') })) +vi.mock('@/runtime/runtime-file-routing', () => ({ + isRemoteRuntimeFileOperation: (context: { connectionId?: string }) => + Boolean(context.connectionId) +})) vi.mock('./right-sidebar/file-explorer-operation-owner', () => ({ getFileExplorerOperationOwner: () => ({}), captureFileExplorerOperationGuard: () => ({ diff --git a/src/renderer/src/components/quick-open-file-navigation.ts b/src/renderer/src/components/quick-open-file-navigation.ts index 96fe801d7df..d0eb76c96b1 100644 --- a/src/renderer/src/components/quick-open-file-navigation.ts +++ b/src/renderer/src/components/quick-open-file-navigation.ts @@ -3,7 +3,7 @@ import { statUserOpenedPath } from '@/lib/user-opened-local-path' import { detectLanguage } from '@/lib/language-detect' import { joinPath, getRelativePathInsideRoot } from '@/lib/path' import { useAppStore } from '@/store' -import { isMissingRuntimePathError } from '@/runtime/runtime-file-client' +import { isMissingRuntimePathError } from '@/runtime/runtime-file-metadata-client' import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' import { toRuntimeWorktreeSelector } from '@/runtime/runtime-worktree-selector' import type { RuntimeTerminalPathResolution } from '../../../shared/runtime-file-contracts' diff --git a/src/renderer/src/components/quick-open-recent-lifetime.react.test.tsx b/src/renderer/src/components/quick-open-recent-lifetime.react.test.tsx index 338707c01a9..8a3d23cd792 100644 --- a/src/renderer/src/components/quick-open-recent-lifetime.react.test.tsx +++ b/src/renderer/src/components/quick-open-recent-lifetime.react.test.tsx @@ -12,7 +12,7 @@ import { makeRemoteWorktree } from './quick-open-file-list-test-harness' -vi.mock('@/runtime/runtime-file-client', async () => { +vi.mock('@/runtime/runtime-file-search-client', async () => { const mocks = await import('./__mocks__/quick-open-runtime-file-client') return { listRuntimeFiles: mocks.listRuntimeFilesMock, diff --git a/src/renderer/src/components/quick-open-recent-validation.test.ts b/src/renderer/src/components/quick-open-recent-validation.test.ts index 1486189efd8..3ff1af49d86 100644 --- a/src/renderer/src/components/quick-open-recent-validation.test.ts +++ b/src/renderer/src/components/quick-open-recent-validation.test.ts @@ -7,7 +7,7 @@ vi.mock('@/runtime/runtime-file-request-debounce', () => ({ request: () => Promise ) => request() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-search-client', () => ({ listRuntimeFiles: mocks.list, cancelRuntimeFileList: mocks.cancel })) diff --git a/src/renderer/src/components/quick-open-recent-validation.ts b/src/renderer/src/components/quick-open-recent-validation.ts index 0361e72567f..355ef53cc73 100644 --- a/src/renderer/src/components/quick-open-recent-validation.ts +++ b/src/renderer/src/components/quick-open-recent-validation.ts @@ -1,7 +1,7 @@ import { debounceRuntimeFileRequest } from '@/runtime/runtime-file-request-debounce' import { useEffect, useRef } from 'react' import { quickOpenRecentCandidateSet } from '../../../shared/quick-open-recent-candidates' -import { cancelRuntimeFileList, listRuntimeFiles } from '@/runtime/runtime-file-client' +import { cancelRuntimeFileList, listRuntimeFiles } from '@/runtime/runtime-file-search-client' import { createBrowserUuid } from '@/lib/browser-uuid' import { translate } from '@/i18n/i18n' import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' diff --git a/src/renderer/src/components/right-sidebar/FileExplorerRow.actions.test.tsx b/src/renderer/src/components/right-sidebar/FileExplorerRow.actions.test.tsx index 08eab39b9e6..d249cc8d1ae 100644 --- a/src/renderer/src/components/right-sidebar/FileExplorerRow.actions.test.tsx +++ b/src/renderer/src/components/right-sidebar/FileExplorerRow.actions.test.tsx @@ -9,7 +9,7 @@ import { shouldShowViewFileAction } from './file-explorer-row-action-visibility' import { directoryNode, fileNode } from './file-explorer-tree-node-test-fixtures' -import type * as RuntimeFileClient from '@/runtime/runtime-file-client' +import type * as RuntimeFileReadClient from '@/runtime/runtime-file-read-client' const { downloadRuntimeFileMock, toastErrorMock, toastSuccessMock } = vi.hoisted(() => ({ downloadRuntimeFileMock: vi.fn(), @@ -24,8 +24,8 @@ vi.mock('sonner', () => ({ } })) -vi.mock('@/runtime/runtime-file-client', async (importOriginal) => { - const actual = await importOriginal() +vi.mock('@/runtime/runtime-file-read-client', async (importOriginal) => { + const actual = await importOriginal() return { ...actual, downloadRuntimeFile: downloadRuntimeFileMock diff --git a/src/renderer/src/components/right-sidebar/FileExplorerRow.tsx b/src/renderer/src/components/right-sidebar/FileExplorerRow.tsx index 5691b21acec..f1e7606524e 100644 --- a/src/renderer/src/components/right-sidebar/FileExplorerRow.tsx +++ b/src/renderer/src/components/right-sidebar/FileExplorerRow.tsx @@ -25,7 +25,7 @@ import type { TreeNode } from './file-explorer-types' import { useFileExplorerRowDrag } from './useFileExplorerRowDrag' import { translate } from '@/i18n/i18n' import { CLOSE_ALL_CONTEXT_MENUS_EVENT } from '@/lib/close-all-context-menus' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { createMultiSelectDragGhost } from './file-explorer-multi-drag-image' import { FileExplorerRowContextMenu } from './file-explorer-row-context-menu' diff --git a/src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx b/src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx index 09e6e9b0e66..b13621e98a1 100644 --- a/src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx +++ b/src/renderer/src/components/right-sidebar/FileExplorerVirtualRows.tsx @@ -8,7 +8,7 @@ import { InlineInputRow, type InlineInput } from './file-explorer-inline-input-r import { shouldShowIgnoredDecoration, STATUS_COLORS } from './status-display' import type { DirCache, FileExplorerOperationOwner, TreeNode } from './file-explorer-types' import type { FileExplorerRowProjection } from './file-explorer-row-projection' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { getFileExplorerOperationExecutionHostId } from './file-explorer-operation-owner' import type { WorkspaceFileDragSource } from '@/lib/workspace-file-drag' diff --git a/src/renderer/src/components/right-sidebar/file-explorer-copy-file-owner.test.ts b/src/renderer/src/components/right-sidebar/file-explorer-copy-file-owner.test.ts index 5ac2985db4f..55513dedd88 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-copy-file-owner.test.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer-copy-file-owner.test.ts @@ -9,7 +9,7 @@ const { writeClipboardFile, toastError } = vi.hoisted(() => ({ })) vi.mock('sonner', () => ({ toast: { error: toastError } })) vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) -vi.mock('@/runtime/runtime-file-client', () => ({ downloadRuntimeFile: vi.fn() })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ downloadRuntimeFile: vi.fn() })) const file: TreeNode = { name: 'file.txt', diff --git a/src/renderer/src/components/right-sidebar/file-explorer-delete-editor-owner.test.tsx b/src/renderer/src/components/right-sidebar/file-explorer-delete-editor-owner.test.tsx index 4f9907dfaa3..6203dbbf40e 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-delete-editor-owner.test.tsx +++ b/src/renderer/src/components/right-sidebar/file-explorer-delete-editor-owner.test.tsx @@ -26,11 +26,13 @@ vi.mock('@/components/editor/editor-autosave', () => ({ requestEditorFileSave: save, requestEditorSaveQuiesce: quiesce })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-mutation-client', () => ({ deleteRuntimePath: remove, - readRuntimeFileContent: vi.fn().mockResolvedValue({ content: 'owner', isBinary: false }), writeRuntimeFile: vi.fn() })) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: vi.fn().mockResolvedValue({ content: 'owner', isBinary: false }) +})) vi.mock('@/components/right-sidebar/fileExplorerUndoRedo', () => ({ commitFileExplorerOp: vi.fn() })) diff --git a/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.test.ts b/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.test.ts index b30cafdc889..9495453e89a 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.test.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' const readRuntimeDirectory = vi.fn() -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-mutation-client', () => ({ readRuntimeDirectory: (...args: unknown[]) => readRuntimeDirectory(...args) })) vi.mock('./file-explorer-operation-owner', () => ({ diff --git a/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.ts b/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.ts index e8b04d367bc..553eba06a19 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer-directory-listing.ts @@ -2,7 +2,7 @@ import { useAppStore } from '@/store' import { getRelativePathInsideRoot, joinPath } from '@/lib/path' import type { DirEntry } from '../../../../shared/filesystem-entry-types' import { sortDirEntries } from '../../../../shared/file-name-sort' -import { readRuntimeDirectory } from '@/runtime/runtime-file-client' +import { readRuntimeDirectory } from '@/runtime/runtime-file-mutation-client' import type { FileExplorerOperationOwner, TreeNode } from './file-explorer-types' import { shouldIncludeFileExplorerEntry } from './file-explorer-entries' import { diff --git a/src/renderer/src/components/right-sidebar/file-explorer-row-action-visibility.ts b/src/renderer/src/components/right-sidebar/file-explorer-row-action-visibility.ts index 28ccbf56eeb..463dfa1717c 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-row-action-visibility.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer-row-action-visibility.ts @@ -1,4 +1,4 @@ -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { TreeNode } from './file-explorer-types' export function shouldShowCollapseFolderAction(node: TreeNode, isExpanded: boolean): boolean { diff --git a/src/renderer/src/components/right-sidebar/file-explorer-row-file-transfer.ts b/src/renderer/src/components/right-sidebar/file-explorer-row-file-transfer.ts index 1da2c3515c5..22fb316e36a 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-row-file-transfer.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer-row-file-transfer.ts @@ -2,7 +2,8 @@ import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { extractIpcErrorMessage } from '@/lib/ipc-error' -import { downloadRuntimeFile, type RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import { downloadRuntimeFile } from '@/runtime/runtime-file-read-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { TreeNode } from './file-explorer-types' import { shouldShowCopyFileAction } from './file-explorer-row-action-visibility' diff --git a/src/renderer/src/components/right-sidebar/use-file-explorer-name-filter.runtime-listing.test.tsx b/src/renderer/src/components/right-sidebar/use-file-explorer-name-filter.runtime-listing.test.tsx index d20c83d61b9..7a8b15f402d 100644 --- a/src/renderer/src/components/right-sidebar/use-file-explorer-name-filter.runtime-listing.test.tsx +++ b/src/renderer/src/components/right-sidebar/use-file-explorer-name-filter.runtime-listing.test.tsx @@ -19,7 +19,7 @@ const listRuntimeFilesMock = vi.hoisted(() => vi.fn()) const cancelRuntimeFileListMock = vi.hoisted(() => vi.fn()) const searchRuntimeFilePathsMock = vi.hoisted(() => vi.fn()) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-search-client', () => ({ listRuntimeFiles: listRuntimeFilesMock, cancelRuntimeFileList: cancelRuntimeFileListMock, searchRuntimeFilePaths: searchRuntimeFilePathsMock diff --git a/src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts b/src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts index ae251541dbd..780238c7c4e 100644 --- a/src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts +++ b/src/renderer/src/components/right-sidebar/use-file-explorer-tree-pane-state.ts @@ -3,7 +3,7 @@ import { useEffect, useMemo, useRef } from 'react' import { useAppStore } from '@/store' import { getRuntimeEnvironmentIdForWorktree } from '@/lib/worktree-runtime-owner' import { useWorkspaceFileBrowserActionPredicate } from '@/lib/file-preview' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { OpenFile } from '@/store/slices/editor' import type { Repo } from '../../../../shared/repo-types' import type { FileExplorerRowProjection } from './file-explorer-row-projection' diff --git a/src/renderer/src/components/right-sidebar/useFileDeletion.ts b/src/renderer/src/components/right-sidebar/useFileDeletion.ts index 05e78656192..7d6ba0628a3 100644 --- a/src/renderer/src/components/right-sidebar/useFileDeletion.ts +++ b/src/renderer/src/components/right-sidebar/useFileDeletion.ts @@ -22,11 +22,8 @@ import { requestEditorSaveQuiesce } from '@/components/editor/editor-autosave' import { commitFileExplorerOp } from './fileExplorerUndoRedo' -import { - deleteRuntimePath, - readRuntimeFileContent, - writeRuntimeFile -} from '@/runtime/runtime-file-client' +import { deleteRuntimePath, writeRuntimeFile } from '@/runtime/runtime-file-mutation-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' import { translate } from '@/i18n/i18n' type UseFileDeletionParams = { diff --git a/src/renderer/src/components/right-sidebar/useFileDuplicate.ts b/src/renderer/src/components/right-sidebar/useFileDuplicate.ts index 63d53366cb7..432dd586eb6 100644 --- a/src/renderer/src/components/right-sidebar/useFileDuplicate.ts +++ b/src/renderer/src/components/right-sidebar/useFileDuplicate.ts @@ -2,7 +2,8 @@ import { useCallback } from 'react' import { toast } from 'sonner' import { basename, dirname, joinPath } from '@/lib/path' import type { TreeNode } from './file-explorer-types' -import { copyRuntimePath, runtimePathExists } from '@/runtime/runtime-file-client' +import { copyRuntimePath } from '@/runtime/runtime-file-mutation-client' +import { runtimePathExists } from '@/runtime/runtime-file-metadata-client' import { captureFileExplorerOperationGuard } from './file-explorer-operation-owner' /** diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerImport.committed-scope.test.tsx b/src/renderer/src/components/right-sidebar/useFileExplorerImport.committed-scope.test.tsx index 946d133c66c..799716c23d9 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerImport.committed-scope.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileExplorerImport.committed-scope.test.tsx @@ -5,7 +5,7 @@ import { afterEach, expect, it, vi } from 'vitest' import { useFileExplorerImport } from './useFileExplorerImport' const mocks = vi.hoisted(() => ({ importPaths: vi.fn(), prepare: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) vi.mock('./file-explorer-operation-owner', () => ({ diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerImport.os-file-drop.test.tsx b/src/renderer/src/components/right-sidebar/useFileExplorerImport.os-file-drop.test.tsx index 746a70b2bb8..74fa172bab2 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerImport.os-file-drop.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileExplorerImport.os-file-drop.test.tsx @@ -11,7 +11,7 @@ const mocks = vi.hoisted(() => ({ captureGuard: vi.fn(), prepare: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) vi.mock('./file-explorer-operation-owner', () => ({ diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerImport.remote.test.tsx b/src/renderer/src/components/right-sidebar/useFileExplorerImport.remote.test.tsx index 11a76e8fd31..3a7f7aa8d93 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerImport.remote.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileExplorerImport.remote.test.tsx @@ -18,7 +18,7 @@ const mocks = vi.hoisted(() => ({ prepare: vi.fn(), toastError: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) vi.mock('sonner', () => ({ toast: { error: mocks.toastError } })) diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerImport.ts b/src/renderer/src/components/right-sidebar/useFileExplorerImport.ts index 165a2ecdfed..c90626806b2 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerImport.ts +++ b/src/renderer/src/components/right-sidebar/useFileExplorerImport.ts @@ -2,7 +2,7 @@ import { getRelativePathInsideRoot } from '@/lib/path' import { useLayoutEffect, useRef, useState } from 'react' import { toast } from 'sonner' import { extractIpcErrorMessage } from '@/lib/ipc-error' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { translate } from '@/i18n/i18n' import { createOsFileDropSequence, useOsFileDropOwner } from '@/hooks/use-os-file-drop-owner' import { getNativeFileDropRejectionMessage } from '@/lib/native-file-drop-rejection-message' diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerInlineInput.ts b/src/renderer/src/components/right-sidebar/useFileExplorerInlineInput.ts index 61726c47563..87704a1e363 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerInlineInput.ts +++ b/src/renderer/src/components/right-sidebar/useFileExplorerInlineInput.ts @@ -9,7 +9,7 @@ import type { InlineInput } from './file-explorer-inline-input-row' import type { TreeNode } from './file-explorer-types' import type { FileExplorerRowProjection } from './file-explorer-row-projection' import { commitFileExplorerOp } from './fileExplorerUndoRedo' -import { createRuntimePath, deleteRuntimePath } from '@/runtime/runtime-file-client' +import { createRuntimePath, deleteRuntimePath } from '@/runtime/runtime-file-mutation-client' import { captureFileExplorerOperationGuard, getFileExplorerOperationOwner diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerWatch.broker.test.tsx b/src/renderer/src/components/right-sidebar/useFileExplorerWatch.broker.test.tsx index e09739fc876..ab91a83a5ac 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerWatch.broker.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileExplorerWatch.broker.test.tsx @@ -19,7 +19,9 @@ vi.mock('./file-explorer-operation-owner', () => ({ getFileExplorerOperationOwner: () => owner.current, getFileExplorerOperationOwnerFromState: () => owner.current })) -vi.mock('@/runtime/runtime-file-client', () => ({ subscribeRuntimeFileChanges: runtime.subscribe })) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ + subscribeRuntimeFileChanges: runtime.subscribe +})) const refreshDir = vi.fn(async () => {}) const refreshTree = vi.fn(async () => 'refreshed' as const) diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerWatch.host-root.test.tsx b/src/renderer/src/components/right-sidebar/useFileExplorerWatch.host-root.test.tsx index 0e29d3e235c..b13f035ea9b 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerWatch.host-root.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileExplorerWatch.host-root.test.tsx @@ -19,7 +19,7 @@ vi.mock('./file-explorer-operation-owner', () => { getFileExplorerOperationOwnerFromState: () => owner } }) -vi.mock('@/runtime/runtime-file-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: vi.fn() })) const refreshDir = vi.fn(async () => {}) const refreshTree = vi.fn(async () => 'refreshed' as const) diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerWatch.pending-refresh.test.tsx b/src/renderer/src/components/right-sidebar/useFileExplorerWatch.pending-refresh.test.tsx index 890fbbad0a3..77b95539edb 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerWatch.pending-refresh.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileExplorerWatch.pending-refresh.test.tsx @@ -23,7 +23,7 @@ vi.mock('./file-explorer-operation-owner', () => ({ getFileExplorerOperationOwner: () => ownerRef.current, getFileExplorerOperationOwnerFromState: () => ownerRef.current })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: runtimeWatch.subscribe })) diff --git a/src/renderer/src/components/right-sidebar/useFileSearchPanel.lifecycle.test.tsx b/src/renderer/src/components/right-sidebar/useFileSearchPanel.lifecycle.test.tsx index c7d9bd65d3e..64aeac47aac 100644 --- a/src/renderer/src/components/right-sidebar/useFileSearchPanel.lifecycle.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileSearchPanel.lifecycle.test.tsx @@ -7,7 +7,7 @@ import { useFileSearchPanel } from './useFileSearchPanel' import type { SearchResult } from '../../../../shared/code-search-types' const { search } = vi.hoisted(() => ({ search: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ searchRuntimeFiles: search })) +vi.mock('@/runtime/runtime-file-search-client', () => ({ searchRuntimeFiles: search })) const initial = useAppStore.getInitialState() const initialView: { view: 'files' | 'search' } = { view: 'search' } const empty: SearchResult = { files: [], totalMatches: 0, truncated: false } diff --git a/src/renderer/src/components/right-sidebar/useFileSearchRunner.test.tsx b/src/renderer/src/components/right-sidebar/useFileSearchRunner.test.tsx index b183f717d8e..8a334d0deac 100644 --- a/src/renderer/src/components/right-sidebar/useFileSearchRunner.test.tsx +++ b/src/renderer/src/components/right-sidebar/useFileSearchRunner.test.tsx @@ -15,7 +15,7 @@ vi.mock('@/lib/connection-context', () => ({ getConnectionId: mocks.getConnectionId })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-search-client', () => ({ searchRuntimeFiles: mocks.searchRuntimeFiles })) diff --git a/src/renderer/src/components/right-sidebar/useFileSearchRunner.ts b/src/renderer/src/components/right-sidebar/useFileSearchRunner.ts index c4c6069f185..2b6b5afd558 100644 --- a/src/renderer/src/components/right-sidebar/useFileSearchRunner.ts +++ b/src/renderer/src/components/right-sidebar/useFileSearchRunner.ts @@ -10,7 +10,7 @@ import { createEmptyRuntimeFileSearchResult, getRuntimeFileSearchRejectedField } from '@/runtime/runtime-file-search-bounds' -import { searchRuntimeFiles } from '@/runtime/runtime-file-client' +import { searchRuntimeFiles } from '@/runtime/runtime-file-search-client' import { useAppStore } from '@/store' import { getExecutionHostIdForWorktree, diff --git a/src/renderer/src/components/settings/McpConfigSection.host-owner.test.tsx b/src/renderer/src/components/settings/McpConfigSection.host-owner.test.tsx index d67aeb81def..abc56f419c5 100644 --- a/src/renderer/src/components/settings/McpConfigSection.host-owner.test.tsx +++ b/src/renderer/src/components/settings/McpConfigSection.host-owner.test.tsx @@ -13,7 +13,13 @@ const runtimeFiles = vi.hoisted(() => ({ readRuntimeFileContent: vi.fn(), writeRuntimeFile: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => runtimeFiles) +vi.mock('@/runtime/runtime-file-mutation-client', () => ({ + readRuntimeDirectory: runtimeFiles.readRuntimeDirectory, + writeRuntimeFile: runtimeFiles.writeRuntimeFile +})) +vi.mock('@/runtime/runtime-file-read-client', () => ({ + readRuntimeFileContent: runtimeFiles.readRuntimeFileContent +})) vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) vi.mock('sonner', () => ({ toast: { error: vi.fn(), success: vi.fn() } })) diff --git a/src/renderer/src/components/settings/McpConfigSection.tsx b/src/renderer/src/components/settings/McpConfigSection.tsx index be54a2b6be3..9ed02a0c3a3 100644 --- a/src/renderer/src/components/settings/McpConfigSection.tsx +++ b/src/renderer/src/components/settings/McpConfigSection.tsx @@ -32,7 +32,8 @@ import { McpMissingConfigList } from './McpMissingConfigList' import { loadMcpConfigInspections } from './mcp-config-inspection' import { translate } from '@/i18n/i18n' import { captureDirectSshMutationExpectation } from '@/lib/ssh-mutation-expectation' -import { writeRuntimeFile, type RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import { writeRuntimeFile } from '@/runtime/runtime-file-mutation-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target' type McpConfigSectionProps = { diff --git a/src/renderer/src/components/settings/mcp-config-inspection.ts b/src/renderer/src/components/settings/mcp-config-inspection.ts index 3e5e1baced3..f6dd1726171 100644 --- a/src/renderer/src/components/settings/mcp-config-inspection.ts +++ b/src/renderer/src/components/settings/mcp-config-inspection.ts @@ -9,11 +9,9 @@ import { import { joinPath } from '../../lib/path' import { extractIpcErrorMessage } from '../../lib/ipc-error' import type { LoadedMcpConfigInspection } from './McpConfigFileRow' -import { - readRuntimeDirectory, - readRuntimeFileContent, - type RuntimeFileOperationArgs -} from '@/runtime/runtime-file-client' +import { readRuntimeDirectory } from '@/runtime/runtime-file-mutation-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' function isMissingFileError(error: unknown): boolean { const message = error instanceof Error ? error.message : String(error) diff --git a/src/renderer/src/components/tab-bar/tab-create-entry-absolute-file.ts b/src/renderer/src/components/tab-bar/tab-create-entry-absolute-file.ts index 7e201f7fc6c..7755c1f1303 100644 --- a/src/renderer/src/components/tab-bar/tab-create-entry-absolute-file.ts +++ b/src/renderer/src/components/tab-bar/tab-create-entry-absolute-file.ts @@ -1,6 +1,6 @@ import { detectLanguage } from '@/lib/language-detect' import { toWorktreeRelativePath } from '@/lib/terminal-links' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { OpenFile } from '@/store/slices/editor' import { validateNewTabEntryAbsolutePath, diff --git a/src/renderer/src/components/tab-bar/tab-create-entry-action.ts b/src/renderer/src/components/tab-bar/tab-create-entry-action.ts index 4fedc19935b..5cb99e5277b 100644 --- a/src/renderer/src/components/tab-bar/tab-create-entry-action.ts +++ b/src/renderer/src/components/tab-bar/tab-create-entry-action.ts @@ -1,11 +1,9 @@ import { detectLanguage } from '@/lib/language-detect' import { joinPath } from '@/lib/path' import { getRendererAppPlatform } from '@/lib/renderer-app-platform' -import { - createRuntimePath, - statRuntimePath, - type RuntimeFileOperationArgs -} from '@/runtime/runtime-file-client' +import { createRuntimePath } from '@/runtime/runtime-file-mutation-client' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { useAppStore } from '@/store' import type { OpenFile } from '@/store/slices/editor' import { diff --git a/src/renderer/src/components/tab-bar/tab-create-entry-classifier.runtime-listing.test.tsx b/src/renderer/src/components/tab-bar/tab-create-entry-classifier.runtime-listing.test.tsx index 6b2dfce0092..8a837bb41a9 100644 --- a/src/renderer/src/components/tab-bar/tab-create-entry-classifier.runtime-listing.test.tsx +++ b/src/renderer/src/components/tab-bar/tab-create-entry-classifier.runtime-listing.test.tsx @@ -20,7 +20,7 @@ const listRuntimeFilesMock = vi.hoisted(() => vi.fn()) const cancelRuntimeFileListMock = vi.hoisted(() => vi.fn()) const searchRuntimeFilePathsMock = vi.hoisted(() => vi.fn()) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-search-client', () => ({ listRuntimeFiles: listRuntimeFilesMock, cancelRuntimeFileList: cancelRuntimeFileListMock, searchRuntimeFilePaths: searchRuntimeFilePathsMock diff --git a/src/renderer/src/components/tab-bar/tab-create-entry-local-path.ts b/src/renderer/src/components/tab-bar/tab-create-entry-local-path.ts index a66d9ea1339..90cbafd7c7b 100644 --- a/src/renderer/src/components/tab-bar/tab-create-entry-local-path.ts +++ b/src/renderer/src/components/tab-bar/tab-create-entry-local-path.ts @@ -2,7 +2,7 @@ import { getEditorFileOperationContext } from '@/lib/editor-file-operation-owner import { getFolderWorkspaceConnectionId } from '@/lib/folder-workspace-connection' import { getLocalPathOpenOwnerForRoute, isLocalPathOpenBlocked } from '@/lib/local-path-open-guard' import { getResolvedExecutionHostIdForWorktree } from '@/lib/resolved-worktree-execution-host' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import type { useAppStore } from '@/store' import { parseWorkspaceKey } from '../../../../shared/workspace-scope' import { runtimeTargetEnvironmentId } from '@/runtime/runtime-client-target' diff --git a/src/renderer/src/components/terminal-pane/terminal-drop-handler.test.ts b/src/renderer/src/components/terminal-pane/terminal-drop-handler.test.ts index c415e3b7260..c72ea9af102 100644 --- a/src/renderer/src/components/terminal-pane/terminal-drop-handler.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-drop-handler.test.ts @@ -63,7 +63,7 @@ vi.mock('@/store', () => ({ } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importExternalPathsToRuntime })) diff --git a/src/renderer/src/components/terminal-pane/terminal-drop-internal-handler.test.ts b/src/renderer/src/components/terminal-pane/terminal-drop-internal-handler.test.ts index eca657054d2..929f81ad6fc 100644 --- a/src/renderer/src/components/terminal-pane/terminal-drop-internal-handler.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-drop-internal-handler.test.ts @@ -61,7 +61,7 @@ vi.mock('@/store', () => ({ } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importExternalPathsToRuntime })) diff --git a/src/renderer/src/components/terminal-pane/terminal-drop-local-workspace.test.ts b/src/renderer/src/components/terminal-pane/terminal-drop-local-workspace.test.ts index b417b59d8c7..ed237a7e9e9 100644 --- a/src/renderer/src/components/terminal-pane/terminal-drop-local-workspace.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-drop-local-workspace.test.ts @@ -21,7 +21,7 @@ const mocks = vi.hoisted(() => ({ recordInput: vi.fn() })) vi.mock('@/store', () => ({ useAppStore: { getState: () => mocks.state } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) vi.mock('./terminal-input-activity', () => ({ recordTerminalUserInputForLeaf: mocks.recordInput })) diff --git a/src/renderer/src/components/terminal-pane/terminal-drop-runtime-catalog-owner.test.ts b/src/renderer/src/components/terminal-pane/terminal-drop-runtime-catalog-owner.test.ts index d468f9c69f4..cf46c0682e9 100644 --- a/src/renderer/src/components/terminal-pane/terminal-drop-runtime-catalog-owner.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-drop-runtime-catalog-owner.test.ts @@ -44,7 +44,7 @@ const mocks = vi.hoisted(() => { } }) vi.mock('@/store', () => ({ useAppStore: { getState: () => mocks.state } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) vi.mock('./terminal-input-activity', () => ({ recordTerminalUserInputForLeaf: vi.fn() })) diff --git a/src/renderer/src/components/terminal-pane/terminal-file-link-target.ts b/src/renderer/src/components/terminal-pane/terminal-file-link-target.ts index 9820230fa8f..efab24aa1e2 100644 --- a/src/renderer/src/components/terminal-pane/terminal-file-link-target.ts +++ b/src/renderer/src/components/terminal-pane/terminal-file-link-target.ts @@ -6,7 +6,7 @@ import { } from '@/lib/terminal-links' import { normalizeAbsolutePath } from '@/lib/terminal-path-normalization' import { parseWslUncPath } from '../../../../shared/wsl-paths' -import { isRemoteRuntimeFileOperation } from '@/runtime/runtime-file-client' +import { isRemoteRuntimeFileOperation } from '@/runtime/runtime-file-routing' import { getTerminalFileContext, mapTerminalFilePath, diff --git a/src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts b/src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts index ce6508a0cef..c751cbee02a 100644 --- a/src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts +++ b/src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts @@ -5,7 +5,7 @@ import { detectLanguage } from '@/lib/language-detect' import { findWorkspaceFileRoute } from '@/lib/runtime-workspace-file-route' import { isPathInsideWorktree, toWorktreeRelativePath } from '@/lib/terminal-links' import { canClientOsOpenWorkspaceFile } from '@/lib/workspace-file-host-routing' -import { isMissingRuntimePathError } from '@/runtime/runtime-file-client' +import { isMissingRuntimePathError } from '@/runtime/runtime-file-metadata-client' import { useAppStore } from '@/store' import { activateAndRevealWorkspace, activateAndRevealWorktree } from '@/lib/worktree-activation' import { resolveKnownWorktreeRootPathLink } from './terminal-worktree-path-link' diff --git a/src/renderer/src/components/terminal-pane/terminal-file-path-mapping.ts b/src/renderer/src/components/terminal-pane/terminal-file-path-mapping.ts index 0d03dc73a0c..40c21af7fe7 100644 --- a/src/renderer/src/components/terminal-pane/terminal-file-path-mapping.ts +++ b/src/renderer/src/components/terminal-pane/terminal-file-path-mapping.ts @@ -3,7 +3,7 @@ import { getConnectionId } from '@/lib/connection-context' import { resolveWorktreeOperationRouteResult } from '@/lib/worktree-operation-route' import { buildWorkspaceFileContext } from '@/lib/workspace-file-host-routing' import { getRuntimeTargetForWorktreeOwner } from '@/lib/file-owner-runtime-target' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { parseExecutionHostId } from '../../../../shared/execution-host' import { parseWslUncPath, toWindowsWslPath } from '../../../../shared/wsl-paths' import { terminalFileSourceHost } from './terminal-worktree-path-link' diff --git a/src/renderer/src/components/terminal-pane/terminal-host-workspace-file.ts b/src/renderer/src/components/terminal-pane/terminal-host-workspace-file.ts index 4cfba0b4f40..cfccbf5b5b4 100644 --- a/src/renderer/src/components/terminal-pane/terminal-host-workspace-file.ts +++ b/src/renderer/src/components/terminal-pane/terminal-host-workspace-file.ts @@ -5,7 +5,7 @@ import { type RuntimeClientTarget } from '@/runtime/runtime-client-target' import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' -import { statRuntimePath } from '@/runtime/runtime-file-client' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' import { isRemoteRuntimeFileOperation } from '@/runtime/runtime-file-routing' import { userNamedFileAccess } from '@/lib/local-file-access' import { isPairedWebClientWindow } from '@/lib/desktop-window-chrome' diff --git a/src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts b/src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts index ec512423fd9..8892b0b36b2 100644 --- a/src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts +++ b/src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { extractIpcErrorMessage } from '@/lib/ipc-error' import type { PaneManager } from '@/lib/pane-manager/pane-manager' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { translate } from '@/i18n/i18n' import { isWslUncPath } from '../../../../shared/wsl-paths' import type { PtyTransport } from './pty-transport' diff --git a/src/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsx b/src/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsx index dc75f2320a3..b2592e6d74e 100644 --- a/src/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsx +++ b/src/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsx @@ -52,7 +52,7 @@ vi.mock('@/store', () => ({ { getState: () => mocks.state } ) })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: mocks.importPaths })) vi.mock('@/lib/new-workspace', () => ({ CLIENT_PLATFORM: 'win32' })) diff --git a/src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.ts b/src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.ts index b6ee810115e..431eb3ee0d8 100644 --- a/src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.ts +++ b/src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.ts @@ -3,7 +3,8 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { extractIpcErrorMessage } from '@/lib/ipc-error' import { basename } from '@/lib/path' -import { downloadRuntimeFile, type RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import { downloadRuntimeFile } from '@/runtime/runtime-file-read-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' /** * Remote counterpart of "Open with default app": the OS can only launch a local diff --git a/src/renderer/src/components/terminal-pane/terminal-worktree-path-link.ts b/src/renderer/src/components/terminal-pane/terminal-worktree-path-link.ts index 1c21f8a0f43..3fdfcfe80a4 100644 --- a/src/renderer/src/components/terminal-pane/terminal-worktree-path-link.ts +++ b/src/renderer/src/components/terminal-pane/terminal-worktree-path-link.ts @@ -8,7 +8,7 @@ import { type WorktreeOperationRoute, type WorktreeOperationRouteState } from '@/lib/worktree-operation-route' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { toRuntimeExecutionHostId, toSshExecutionHostId, diff --git a/src/renderer/src/hooks/composer-state/attachment-drop-failure.test.tsx b/src/renderer/src/hooks/composer-state/attachment-drop-failure.test.tsx index 8e7a2fc5381..07ad128ac63 100644 --- a/src/renderer/src/hooks/composer-state/attachment-drop-failure.test.tsx +++ b/src/renderer/src/hooks/composer-state/attachment-drop-failure.test.tsx @@ -11,7 +11,7 @@ vi.mock('sonner', () => ({ toast: { error: mocks.toastError, message: vi.fn() } vi.mock('@/store', () => ({ useAppStore: Object.assign(() => undefined, { getState: () => ({}) }) })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: (...args: unknown[]) => mocks.importExternalPaths(...args) })) diff --git a/src/renderer/src/hooks/composer-state/attachment-drop-lifetime.test.tsx b/src/renderer/src/hooks/composer-state/attachment-drop-lifetime.test.tsx index ff88e335463..161e8886d55 100644 --- a/src/renderer/src/hooks/composer-state/attachment-drop-lifetime.test.tsx +++ b/src/renderer/src/hooks/composer-state/attachment-drop-lifetime.test.tsx @@ -8,7 +8,7 @@ import { useAttachmentDropState } from './attachment-drop-state' const mocks = vi.hoisted(() => ({ toastError: vi.fn() })) vi.mock('sonner', () => ({ toast: { error: mocks.toastError } })) vi.mock('@/store', () => ({ useAppStore: { getState: () => ({}) } })) -vi.mock('@/runtime/runtime-file-client', () => ({ importExternalPathsToRuntime: vi.fn() })) +vi.mock('@/runtime/runtime-file-import-client', () => ({ importExternalPathsToRuntime: vi.fn() })) const stat = vi.fn(async (_input: { filePath: string }) => ({ isDirectory: false })) let originalApi: PropertyDescriptor | undefined diff --git a/src/renderer/src/hooks/composer-state/attachment-drop-state.ts b/src/renderer/src/hooks/composer-state/attachment-drop-state.ts index 435c5c690cb..060324df9be 100644 --- a/src/renderer/src/hooks/composer-state/attachment-drop-state.ts +++ b/src/renderer/src/hooks/composer-state/attachment-drop-state.ts @@ -22,7 +22,7 @@ import { translate } from '@/i18n/i18n' import { joinPath } from '@/lib/path' import { captureDirectSshMutationExpectation } from '@/lib/ssh-mutation-expectation' import { useAppStore } from '@/store' -import { importExternalPathsToRuntime } from '@/runtime/runtime-file-client' +import { importExternalPathsToRuntime } from '@/runtime/runtime-file-import-client' import { readIpcErrorMessage } from '@/lib/ipc-error' import { showComposerDropFailureToast } from '../composer-drop-failure-toast' import { diff --git a/src/renderer/src/hooks/editor-external-watch-disk-verification.ts b/src/renderer/src/hooks/editor-external-watch-disk-verification.ts index e45444cac48..fdfb4d6fbd9 100644 --- a/src/renderer/src/hooks/editor-external-watch-disk-verification.ts +++ b/src/renderer/src/hooks/editor-external-watch-disk-verification.ts @@ -12,7 +12,7 @@ import { getRecentSelfWrite, type RecentSelfWrite } from '@/components/editor/editor-self-write-registry' -import { readRuntimeFileContent } from '@/runtime/runtime-file-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' import type { EditorExternalWatchTarget } from './editor-external-watch-targets' import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target' diff --git a/src/renderer/src/hooks/editor-runtime-file-watch.test.ts b/src/renderer/src/hooks/editor-runtime-file-watch.test.ts index ab299d7538a..53960dafda4 100644 --- a/src/renderer/src/hooks/editor-runtime-file-watch.test.ts +++ b/src/renderer/src/hooks/editor-runtime-file-watch.test.ts @@ -12,7 +12,7 @@ const runtime = vi.hoisted(() => ({ payloads: new Array<(payload: FsChangedPayload) => void>(), errors: new Array<(error: Error) => void>() })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: runtime.subscribe })) vi.mock('@/runtime/runtime-host-contact-regained', () => ({ diff --git a/src/renderer/src/hooks/editor-runtime-file-watch.ts b/src/renderer/src/hooks/editor-runtime-file-watch.ts index 29a4012427b..02077dbd6f1 100644 --- a/src/renderer/src/hooks/editor-runtime-file-watch.ts +++ b/src/renderer/src/hooks/editor-runtime-file-watch.ts @@ -1,5 +1,5 @@ import type { FsChangedPayload } from '../../../shared/filesystem-entry-types' -import { subscribeRuntimeFileChanges } from '@/runtime/runtime-file-client' +import { subscribeRuntimeFileChanges } from '@/runtime/runtime-file-watch-client' import { subscribeRuntimeHostContactRegained } from '@/runtime/runtime-host-contact-regained' import { onRuntimeEnvironmentsRetired } from '@/runtime/runtime-environment-revision' import type { EditorExternalWatchTarget } from './editor-external-watch-targets' diff --git a/src/renderer/src/hooks/useEditorExternalWatch-subscriptions.test.tsx b/src/renderer/src/hooks/useEditorExternalWatch-subscriptions.test.tsx index d1a3134adfe..a55280182a2 100644 --- a/src/renderer/src/hooks/useEditorExternalWatch-subscriptions.test.tsx +++ b/src/renderer/src/hooks/useEditorExternalWatch-subscriptions.test.tsx @@ -30,7 +30,7 @@ vi.mock('@/runtime/runtime-host-contact-regained', () => ({ return subscriptionState.unsubscribeContact } })) -vi.mock('@/runtime/runtime-file-client', () => ({ +vi.mock('@/runtime/runtime-file-watch-client', () => ({ subscribeRuntimeFileChanges: subscriptionState.subscribeRuntimeFileChanges })) vi.mock('./editor-external-watch-targets', () => ({ diff --git a/src/renderer/src/lib/create-untitled-markdown.ts b/src/renderer/src/lib/create-untitled-markdown.ts index 571ce8d5906..8ce85b3f327 100644 --- a/src/renderer/src/lib/create-untitled-markdown.ts +++ b/src/renderer/src/lib/create-untitled-markdown.ts @@ -2,9 +2,9 @@ import type { RuntimeClientTarget } from '@/runtime/runtime-client-target' import { createRuntimePath, deleteRuntimePath, - runtimePathExists, writeRuntimeFile -} from '../runtime/runtime-file-client' +} from '../runtime/runtime-file-mutation-client' +import { runtimePathExists } from '../runtime/runtime-file-metadata-client' import { detectLanguage } from './language-detect' import { applyMarkdownTemplatePlaceholders, diff --git a/src/renderer/src/lib/execute-open-editor-path-move.test.ts b/src/renderer/src/lib/execute-open-editor-path-move.test.ts index 7c483efe32d..50a5962db01 100644 --- a/src/renderer/src/lib/execute-open-editor-path-move.test.ts +++ b/src/renderer/src/lib/execute-open-editor-path-move.test.ts @@ -1,10 +1,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as RuntimeFileClient from '@/runtime/runtime-file-client' +import type * as RuntimeFileMutationClient from '@/runtime/runtime-file-mutation-client' import type * as EditorAutosave from '@/components/editor/editor-autosave' const mocks = vi.hoisted(() => ({ renameRuntimePath: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', async (importOriginal) => { - const actual = await importOriginal() +vi.mock('@/runtime/runtime-file-mutation-client', async (importOriginal) => { + const actual = await importOriginal() return { ...actual, renameRuntimePath: mocks.renameRuntimePath } }) vi.mock('@/components/editor/editor-autosave', async (importOriginal) => { diff --git a/src/renderer/src/lib/execute-open-editor-path-move.ts b/src/renderer/src/lib/execute-open-editor-path-move.ts index ca239902770..968b44a6caf 100644 --- a/src/renderer/src/lib/execute-open-editor-path-move.ts +++ b/src/renderer/src/lib/execute-open-editor-path-move.ts @@ -1,5 +1,6 @@ import { useAppStore } from '@/store' -import { renameRuntimePath, type RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import { renameRuntimePath } from '@/runtime/runtime-file-mutation-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { requestEditorSaveQuiesce } from '@/components/editor/editor-autosave' import { beginEditorPathMove, diff --git a/src/renderer/src/lib/markdown-document-templates.ts b/src/renderer/src/lib/markdown-document-templates.ts index 166e6d3502a..9979845559c 100644 --- a/src/renderer/src/lib/markdown-document-templates.ts +++ b/src/renderer/src/lib/markdown-document-templates.ts @@ -1,11 +1,9 @@ import type { DirEntry } from '../../../shared/filesystem-entry-types' import type { RuntimeClientTarget } from '@/runtime/runtime-client-target' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' -import { - readRuntimeDirectory, - readRuntimeFileContent, - runtimePathExists -} from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' +import { readRuntimeDirectory } from '@/runtime/runtime-file-mutation-client' +import { readRuntimeFileContent } from '@/runtime/runtime-file-read-client' +import { runtimePathExists } from '@/runtime/runtime-file-metadata-client' import { basename, joinPath, normalizeRelativePath } from './path' const MARKDOWN_TEMPLATE_ROOT = '.orca/templates' diff --git a/src/renderer/src/lib/rename-user-named-tab-access.test.ts b/src/renderer/src/lib/rename-user-named-tab-access.test.ts index d7a70867173..49ec44f9724 100644 --- a/src/renderer/src/lib/rename-user-named-tab-access.test.ts +++ b/src/renderer/src/lib/rename-user-named-tab-access.test.ts @@ -1,10 +1,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as RuntimeFileClient from '@/runtime/runtime-file-client' +import type * as RuntimeFileMutationClient from '@/runtime/runtime-file-mutation-client' import type * as EditorAutosave from '@/components/editor/editor-autosave' const mocks = vi.hoisted(() => ({ renameRuntimePath: vi.fn(), writeRuntimeFile: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', async (importOriginal) => { - const actual = await importOriginal() +vi.mock('@/runtime/runtime-file-mutation-client', async (importOriginal) => { + const actual = await importOriginal() return { ...actual, renameRuntimePath: mocks.renameRuntimePath, diff --git a/src/renderer/src/lib/user-opened-local-path.test.ts b/src/renderer/src/lib/user-opened-local-path.test.ts index 8d08967e84e..1a0eca26ceb 100644 --- a/src/renderer/src/lib/user-opened-local-path.test.ts +++ b/src/renderer/src/lib/user-opened-local-path.test.ts @@ -1,11 +1,11 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' const mocks = vi.hoisted(() => ({ statRuntimePath: vi.fn() })) -vi.mock('@/runtime/runtime-file-client', () => ({ - isRemoteRuntimeFileOperation: () => false, +vi.mock('@/runtime/runtime-file-routing', () => ({ isRemoteRuntimeFileOperation: () => false })) +vi.mock('@/runtime/runtime-file-metadata-client', () => ({ statRuntimePath: mocks.statRuntimePath })) diff --git a/src/renderer/src/lib/user-opened-local-path.ts b/src/renderer/src/lib/user-opened-local-path.ts index c6ef7d5632b..47019da277a 100644 --- a/src/renderer/src/lib/user-opened-local-path.ts +++ b/src/renderer/src/lib/user-opened-local-path.ts @@ -1,10 +1,8 @@ import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' import { isPathOutsideAllowedDirectoriesError } from '../../../shared/local-file-access' -import { - isRemoteRuntimeFileOperation, - statRuntimePath, - type RuntimeFileOperationArgs -} from '@/runtime/runtime-file-client' +import { isRemoteRuntimeFileOperation } from '@/runtime/runtime-file-routing' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { userNamedFileAccess } from './local-file-access' import { isPathInsideWorktree } from './terminal-links' diff --git a/src/renderer/src/lib/workspace-file-host-routing.ts b/src/renderer/src/lib/workspace-file-host-routing.ts index 1120e2e364d..08bbef371ff 100644 --- a/src/renderer/src/lib/workspace-file-host-routing.ts +++ b/src/renderer/src/lib/workspace-file-host-routing.ts @@ -1,5 +1,5 @@ import { getConnectionId, getConnectionIdForFile } from '@/lib/connection-context' -import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' +import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client-types' import { hasRemoteRuntimeOwner } from '@/runtime/runtime-file-routing' import { requireRuntimeTargetForFileOwner } from '@/lib/file-owner-runtime-target' import { useAppStore } from '@/store' diff --git a/src/renderer/src/runtime/mobile-markdown-bridge.ts b/src/renderer/src/runtime/mobile-markdown-bridge.ts index 6d168becd5e..ccfb7029663 100644 --- a/src/renderer/src/runtime/mobile-markdown-bridge.ts +++ b/src/renderer/src/runtime/mobile-markdown-bridge.ts @@ -10,7 +10,7 @@ import { getConnectionIdForFile } from '@/lib/connection-context' import { editorTabFileAccess } from '@/lib/local-file-access' import { useAppStore } from '@/store' import type { OpenFile } from '@/store/slices/editor' -import { readRuntimeFileContent } from './runtime-file-client' +import { readRuntimeFileContent } from './runtime-file-read-client' import { requireRuntimeTargetForFileOwner } from '@/lib/file-owner-runtime-target' import { hashMarkdownContent, diff --git a/src/renderer/src/runtime/remote-host-file-open-repro.test.ts b/src/renderer/src/runtime/remote-host-file-open-repro.test.ts index 1d4b8a22819..b57372662e5 100644 --- a/src/renderer/src/runtime/remote-host-file-open-repro.test.ts +++ b/src/renderer/src/runtime/remote-host-file-open-repro.test.ts @@ -30,7 +30,7 @@ import { WORKTREE_OWNER_UNREACHABLE_ERROR } from '@/components/editor/editor-panel-content-types' import { shouldRetryFileLoadError } from '@/components/editor/useEditorPanelFileLoadRetry' -import { readRuntimeFileContent } from './runtime-file-client' +import { readRuntimeFileContent } from './runtime-file-read-client' import type { RuntimeClientTarget } from './runtime-client-target' // Mirrors src/main/ipc/filesystem-auth.ts PATH_ACCESS_DENIED_MESSAGE. diff --git a/src/renderer/src/runtime/runtime-file-client-download.test.ts b/src/renderer/src/runtime/runtime-file-client-download.test.ts index 19a80af0cfc..c6e73f582d8 100644 --- a/src/renderer/src/runtime/runtime-file-client-download.test.ts +++ b/src/renderer/src/runtime/runtime-file-client-download.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { downloadRuntimeFile } from './runtime-file-client' +import { downloadRuntimeFile } from './runtime-file-read-client' import { fsSaveDownloadedFile, fsStartDownloadedFile, diff --git a/src/renderer/src/runtime/runtime-file-client-external-import.test.ts b/src/renderer/src/runtime/runtime-file-client-external-import.test.ts index cba08809e6a..abaa4cce34a 100644 --- a/src/renderer/src/runtime/runtime-file-client-external-import.test.ts +++ b/src/renderer/src/runtime/runtime-file-client-external-import.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { importExternalPathsToRuntime } from './runtime-file-client' +import { importExternalPathsToRuntime } from './runtime-file-import-client' import { replaceRuntimeEnvironmentRevisions } from './runtime-environment-revision' import { fsImportExternalPaths, diff --git a/src/renderer/src/runtime/runtime-file-client-mutation-ownership.test.ts b/src/renderer/src/runtime/runtime-file-client-mutation-ownership.test.ts index 4634dcc220d..2496a60300a 100644 --- a/src/renderer/src/runtime/runtime-file-client-mutation-ownership.test.ts +++ b/src/renderer/src/runtime/runtime-file-client-mutation-ownership.test.ts @@ -3,11 +3,11 @@ import { copyRuntimePath, createRuntimePath, deleteRuntimePath, - importExternalPathsToRuntime, readRuntimeDirectory, renameRuntimePath, writeRuntimeFile -} from './runtime-file-client' +} from './runtime-file-mutation-client' +import { importExternalPathsToRuntime } from './runtime-file-import-client' import { markRuntimeEnvironmentCompatible } from './runtime-rpc-client' import { replaceRuntimeEnvironmentRevisions } from './runtime-environment-revision' import { diff --git a/src/renderer/src/runtime/runtime-file-client-search-listing.test.ts b/src/renderer/src/runtime/runtime-file-client-search-listing.test.ts index c179e180f59..0793581f134 100644 --- a/src/renderer/src/runtime/runtime-file-client-search-listing.test.ts +++ b/src/renderer/src/runtime/runtime-file-client-search-listing.test.ts @@ -2,12 +2,14 @@ import { describe, expect, it, vi } from 'vitest' import { cancelRuntimeFileList, listRuntimeFiles, + searchRuntimeFilePaths, + searchRuntimeFiles +} from './runtime-file-search-client' +import { listRuntimeMarkdownDocuments, runtimePathExists, - searchRuntimeFilePaths, - searchRuntimeFiles, statRuntimePath -} from './runtime-file-client' +} from './runtime-file-metadata-client' import { fsStat, fsPathExists, diff --git a/src/renderer/src/runtime/runtime-file-client-watch.test.ts b/src/renderer/src/runtime/runtime-file-client-watch.test.ts index ab855b18656..0e6e995a5da 100644 --- a/src/renderer/src/runtime/runtime-file-client-watch.test.ts +++ b/src/renderer/src/runtime/runtime-file-client-watch.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { subscribeRuntimeFileChanges } from './runtime-file-client' +import { subscribeRuntimeFileChanges } from './runtime-file-watch-client' import { fsOnChanged, runtimeEnvironmentCall, diff --git a/src/renderer/src/runtime/runtime-file-client.test.ts b/src/renderer/src/runtime/runtime-file-client.test.ts index e5bf22e8292..a720e4840dc 100644 --- a/src/renderer/src/runtime/runtime-file-client.test.ts +++ b/src/renderer/src/runtime/runtime-file-client.test.ts @@ -1,14 +1,13 @@ import { describe, expect, it } from 'vitest' import { deleteRuntimePath, - getRuntimeFileReadScope, readRuntimeDirectory, - readRuntimeFileContent, - readRuntimeFilePreview, renameRuntimePath, - writeRuntimeFile, - type RuntimeReadableFileContent -} from './runtime-file-client' + writeRuntimeFile +} from './runtime-file-mutation-client' +import { getRuntimeFileReadScope } from './runtime-file-routing' +import { readRuntimeFileContent, readRuntimeFilePreview } from './runtime-file-read-client' +import type { RuntimeReadableFileContent } from './runtime-file-client-types' import { fsReadFile, fsWriteFile, diff --git a/src/renderer/src/runtime/runtime-file-client.ts b/src/renderer/src/runtime/runtime-file-client.ts deleted file mode 100644 index 37ed975e918..00000000000 --- a/src/renderer/src/runtime/runtime-file-client.ts +++ /dev/null @@ -1,35 +0,0 @@ -export type { - RuntimeFileDownloadResult, - RuntimeFileOperationArgs, - RuntimeFileReadArgs, - RuntimeReadableFileContent -} from './runtime-file-client-types' -export { - downloadRuntimeFile, - readRuntimeFileContent, - readRuntimeFilePreview -} from './runtime-file-read-client' -export { - copyRuntimePath, - createRuntimePath, - deleteRuntimePath, - deleteRuntimeRelativePath, - readRuntimeDirectory, - renameRuntimePath, - writeRuntimeFile -} from './runtime-file-mutation-client' -export { importExternalPathsToRuntime } from './runtime-file-import-client' -export { - cancelRuntimeFileList, - listRuntimeFiles, - searchRuntimeFilePaths, - searchRuntimeFiles -} from './runtime-file-search-client' -export { - isMissingRuntimePathError, - listRuntimeMarkdownDocuments, - runtimePathExists, - statRuntimePath -} from './runtime-file-metadata-client' -export { getRuntimeFileReadScope, isRemoteRuntimeFileOperation } from './runtime-file-routing' -export { subscribeRuntimeFileChanges } from './runtime-file-watch-client' diff --git a/src/renderer/src/runtime/runtime-file-import-pairing-revision.test.ts b/src/renderer/src/runtime/runtime-file-import-pairing-revision.test.ts index 0c4a287b3d0..70f86e6246f 100644 --- a/src/renderer/src/runtime/runtime-file-import-pairing-revision.test.ts +++ b/src/renderer/src/runtime/runtime-file-import-pairing-revision.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { importExternalPathsToRuntime } from './runtime-file-client' +import { importExternalPathsToRuntime } from './runtime-file-import-client' import { clearRuntimeCompatibilityCacheForTests, markRuntimeEnvironmentCompatible diff --git a/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts b/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts index d363af19259..33728efffe1 100644 --- a/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts +++ b/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts @@ -1,5 +1,5 @@ import { expect, it } from 'vitest' -import { listRuntimeFiles } from './runtime-file-client' +import { listRuntimeFiles } from './runtime-file-search-client' import { installRuntimeFileClientEnvironment, runtimeEnvironmentCall diff --git a/src/renderer/src/runtime/runtime-quick-open-version-compatibility.test.ts b/src/renderer/src/runtime/runtime-quick-open-version-compatibility.test.ts index 99dbd09ea98..35ad9186249 100644 --- a/src/renderer/src/runtime/runtime-quick-open-version-compatibility.test.ts +++ b/src/renderer/src/runtime/runtime-quick-open-version-compatibility.test.ts @@ -1,5 +1,5 @@ import { expect, it, vi } from 'vitest' -import { searchRuntimeFilePaths, listRuntimeFiles } from './runtime-file-client' +import { searchRuntimeFilePaths, listRuntimeFiles } from './runtime-file-search-client' import { installRuntimeFileClientEnvironment, runtimeEnvironmentCall, diff --git a/src/renderer/src/runtime/runtime-terminal-artifact-read.test.ts b/src/renderer/src/runtime/runtime-terminal-artifact-read.test.ts index e35607c1385..488a5c65d81 100644 --- a/src/renderer/src/runtime/runtime-terminal-artifact-read.test.ts +++ b/src/renderer/src/runtime/runtime-terminal-artifact-read.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { readRuntimeFileContent } from './runtime-file-client' +import { readRuntimeFileContent } from './runtime-file-read-client' import { runtimeEnvironmentCall, installRuntimeFileClientEnvironment diff --git a/src/renderer/src/store/slices/editor/actions/markdown-link-action.ts b/src/renderer/src/store/slices/editor/actions/markdown-link-action.ts index dfb1e15207e..784fb0a7c57 100644 --- a/src/renderer/src/store/slices/editor/actions/markdown-link-action.ts +++ b/src/renderer/src/store/slices/editor/actions/markdown-link-action.ts @@ -9,7 +9,7 @@ import { isLocalPathOpenBlocked, showLocalPathOpenBlockedToast } from '@/lib/loc import { getLinkSourceLocalOpenOwner } from '@/lib/link-source-local-open-owner' import { resolveMarkdownLinkTarget } from '@/components/editor/markdown-internal-links' import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target' -import { statRuntimePath } from '@/runtime/runtime-file-client' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' import { getOpenedEditFileIdAfterOpen } from '../file-ids/editor-file-ids' import { scheduleEditorLineReveal } from '../focus/editor-focus-reveal' diff --git a/src/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.ts b/src/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.ts index d7cb36ed31d..4ac81fab497 100644 --- a/src/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.ts +++ b/src/renderer/src/store/slices/editor/tabs/untitled-file-cleanup.ts @@ -6,9 +6,9 @@ import { getEditorFileOperationContext } from '@/lib/editor-file-operation-owner import { getDiskBaselineSignature } from '@/components/editor/diff-content-signature' import { deleteRuntimePath, - deleteRuntimeRelativePath, - statRuntimePath -} from '@/runtime/runtime-file-client' + deleteRuntimeRelativePath +} from '@/runtime/runtime-file-mutation-client' +import { statRuntimePath } from '@/runtime/runtime-file-metadata-client' export function deleteUntouchedUntitledFile(getState: () => AppState, file: OpenFile): void { const hasRetainedView = () =>