From 5e40d652b216098d37b4bdbd7beb50a145b37ca1 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 1 Nov 2026 09:48:22 -0800 Subject: [PATCH] refactor(persistence): import concrete owners and remove forwarding entry (#37081) --- .../__mocks__/worktree-create-preparation.ts | 2 +- .../active-view-persistence-boundary.test.ts | 2 +- src/main/agent-auth-restart-preservation.ts | 2 +- .../agent-hooks/first-work-rename-runtime.ts | 2 +- .../automation-dispatch-host-fence.test.ts | 2 +- .../automation-dispatch-request.ts | 2 +- .../automation-owner-fencing.test.ts | 3 ++- .../automations/automation-run-writer.test.ts | 2 +- src/main/automations/automation-run-writer.ts | 2 +- .../automation-skip-coalescing.test.ts | 2 +- .../automation-update-host-retarget.test.ts | 3 ++- .../automation-worker-durability.test.ts | 2 +- ...omation-workspace-host-attribution.test.ts | 3 ++- ...omation-wsl-distro-stopped-refusal.test.ts | 2 +- .../automation-wsl-move-refusal.test.ts | 2 +- src/main/automations/dispatch-refusal.ts | 2 +- .../hook-review-blocked-run-terminals.ts | 2 +- .../automations/orcad-fenced-automation.ts | 2 +- .../automations/run-target-resolution.test.ts | 2 +- src/main/automations/run-target-resolution.ts | 2 +- src/main/automations/run-usage-collection.ts | 2 +- .../runtime-automation-service.test.ts | 2 +- .../automations/runtime-automation-service.ts | 2 +- src/main/automations/service-precheck.test.ts | 3 ++- src/main/automations/service.ts | 2 +- src/main/browser-sidecar-owner.test.ts | 2 +- ...er-session-registry-persistence-fixture.ts | 3 --- .../browser-extension-discarded-tabs.ts | 2 +- .../claude-accounts/runtime-auth-service.ts | 2 +- src/main/claude-usage/store.ts | 2 +- .../codex-account-registration.ts | 2 +- .../codex-accounts/codex-account-selection.ts | 2 +- .../codex-accounts/codex-config-mirror.ts | 2 +- .../codex-reset-credit-coordinator.ts | 2 +- .../codex-reset-credit-ledger.ts | 2 +- .../codex-reset-credit-scope-validation.ts | 2 +- .../runtime-home-service-state.ts | 2 +- .../codex-accounts/runtime-home-service.ts | 2 +- src/main/codex-accounts/service.ts | 2 +- src/main/codex-usage/store.ts | 2 +- src/main/ephemeral-vm/workspace-suspend.ts | 2 +- src/main/folder-repo-git-conversion.ts | 2 +- src/main/ghostty/index.test.ts | 2 +- src/main/ghostty/index.ts | 2 +- src/main/ghostty/theme-import.test.ts | 2 +- .../pr-mutation-review-invalidation.test.ts | 2 +- src/main/ipc/app.ts | 2 +- .../ipc/automations-external-scope.test.ts | 2 +- src/main/ipc/automations.ts | 2 +- .../cli-appimage-stale-registration.test.ts | 4 +++- src/main/ipc/cli.test.ts | 4 +++- src/main/ipc/cli.ts | 2 +- .../ipc/created-worktree-root-prune.test.ts | 2 +- src/main/ipc/dashboard-popout.ts | 2 +- src/main/ipc/ephemeral-vm-recipe-context.ts | 2 +- .../filesystem/filesystem-handler-context.ts | 2 +- ...lesystem-source-control-ai-targets.test.ts | 2 +- .../filesystem-source-control-ai-targets.ts | 2 +- .../filesystem/wsl-gated-worktree-git-read.ts | 2 +- src/main/ipc/floating-workspace-directory.ts | 2 +- .../folder-repo-git-upgrade-lifetime.test.ts | 2 +- src/main/ipc/folder-repo-git-upgrade.ts | 2 +- ...-status-upstream-ref-watch-request.test.ts | 2 +- .../git-status-upstream-ref-watch-request.ts | 2 +- src/main/ipc/github-account-handlers.ts | 2 +- .../ipc/github-issue-mutation-handlers.ts | 2 +- src/main/ipc/github-pr-mutation-handlers.ts | 2 +- src/main/ipc/github-pr-read-handlers.ts | 2 +- src/main/ipc/github-pr-refresh-handlers.ts | 2 +- src/main/ipc/github-pr-review-handlers.ts | 2 +- .../ipc/github-repo-routing-twin-host.test.ts | 2 +- src/main/ipc/github-repo-routing.ts | 2 +- src/main/ipc/github-work-item-handlers.ts | 2 +- src/main/ipc/github.ts | 2 +- src/main/ipc/gitlab-ci-job-handlers.ts | 2 +- src/main/ipc/gitlab-issue-handlers.ts | 2 +- .../gitlab-merge-request-mutation-handlers.ts | 2 +- .../gitlab-merge-request-query-handlers.ts | 2 +- src/main/ipc/gitlab-repo-access.ts | 2 +- src/main/ipc/gitlab-work-item-handlers.ts | 2 +- src/main/ipc/gitlab.test.ts | 2 +- src/main/ipc/gitlab.ts | 2 +- src/main/ipc/hosted-review.ts | 2 +- ...ile-access-resolution-network-path.test.ts | 2 +- .../ipc/local-file-access-resolution.test.ts | 2 +- src/main/ipc/local-log-tail-lifetime.test.ts | 2 +- src/main/ipc/local-log-tail.test.ts | 2 +- src/main/ipc/local-log-tail.ts | 2 +- src/main/ipc/localhost-worktree-labels.ts | 2 +- src/main/ipc/memory.ts | 2 +- src/main/ipc/notebook-project-link.test.ts | 2 +- src/main/ipc/notebook.test.ts | 2 +- src/main/ipc/notebook.ts | 2 +- src/main/ipc/notification-sound-ipc.ts | 2 +- src/main/ipc/notifications.ts | 2 +- src/main/ipc/onboarding.ts | 3 ++- src/main/ipc/orca-profiles.ts | 2 +- src/main/ipc/plugin-frame-entry-ipc.ts | 2 +- .../plugins-panel-document-lifetime.test.ts | 2 +- src/main/ipc/plugins.ts | 2 +- src/main/ipc/preflight.ts | 2 +- .../spawn-cwd-wsl-stopped-folder.test.ts | 2 +- src/main/ipc/pty/host-env/spawn-cwd.ts | 2 +- .../pty/ipc/closed-pane-spawn-refusal.test.ts | 2 +- .../ipc/pty/ipc/closed-pane-spawn-refusal.ts | 2 +- src/main/ipc/pty/ipc/leaf-move.ts | 2 +- src/main/ipc/pty/ipc/renderer-kill.ts | 2 +- src/main/ipc/pty/ipc/spawn-agent-launch.ts | 2 +- ...sh-target-materialization-real-git.test.ts | 2 +- src/main/ipc/pty/ipc/spawn-types.ts | 2 +- src/main/ipc/pty/pane/absent-pane-owner.ts | 2 +- src/main/ipc/pty/pane/adopt-stable.ts | 2 +- .../pty/pane/agent-launch-pane-evidence.ts | 2 +- .../ipc/pty/pane/pane-owner-replacement.ts | 2 +- src/main/ipc/pty/pane/pane-spawn-operation.ts | 2 +- src/main/ipc/pty/pane/spawn-registration.ts | 2 +- src/main/ipc/pty/pane/stable-owner.ts | 2 +- ...ble-pane-absence-death-certificate.test.ts | 2 +- src/main/ipc/pty/provider/liveness.ts | 2 +- src/main/ipc/pty/register-handlers.ts | 2 +- src/main/ipc/pty/register-headless-runtime.ts | 2 +- src/main/ipc/pty/runtime/controller-deps.ts | 2 +- src/main/ipc/pty/runtime/spawn-state.ts | 2 +- src/main/ipc/pty/session.ts | 2 +- src/main/ipc/pty/spawn-commit-assembly.ts | 2 +- src/main/ipc/pty/spawn-commit-binding.ts | 2 +- ...registered-worktree-root-ownership.test.ts | 2 +- .../registered-worktree-root-refresh.test.ts | 2 +- ...tered-worktree-root-stopped-distro.test.ts | 2 +- ...gistered-worktree-root-wsl-runtime.test.ts | 2 +- ...worktree-roots-scoped-invalidation.test.ts | 2 +- ...ered-worktree-roots-scoped-invalidation.ts | 2 +- src/main/ipc/renderer-shutdown-checkpoint.ts | 2 +- src/main/ipc/repos.ts | 2 +- src/main/ipc/repos/base-ref-query-handlers.ts | 2 +- .../ipc/repos/folder-workspace-handlers.ts | 2 +- .../ipc/repos/local-repo-registration.test.ts | 2 +- src/main/ipc/repos/local-repo-registration.ts | 2 +- .../ipc/repos/nested-repo-import-handler.ts | 2 +- src/main/ipc/repos/project-group-handlers.ts | 2 +- .../ipc/repos/project-host-setup-handlers.ts | 2 +- .../project-host-setup-wsl-move-fence.test.ts | 2 +- src/main/ipc/repos/repo-catalog-handlers.ts | 2 +- src/main/ipc/repos/repo-clone-lifecycle.ts | 2 +- src/main/ipc/repos/repo-creation-handlers.ts | 2 +- .../ipc/repos/repo-ipc-wsl-move-fence.test.ts | 2 +- src/main/ipc/repos/repo-update-handler.ts | 2 +- src/main/ipc/repos/sparse-preset-handlers.ts | 2 +- ...ntime-environment-connectivity-handlers.ts | 2 +- .../runtime-environment-preference.test.ts | 2 +- .../runtime-environment-preference.ts | 2 +- .../runtime-environments.ts | 2 +- src/main/ipc/session.ts | 2 +- src/main/ipc/settings.ts | 2 +- src/main/ipc/shell.ts | 2 +- src/main/ipc/skill-delete/handlers.ts | 2 +- src/main/ipc/skills.ts | 2 +- .../source-control-ai-linked-issue.test.ts | 2 +- .../ipc/source-control-ai-linked-issue.ts | 2 +- .../ipc/speech-worker-exit-lifetime.test.ts | 2 +- src/main/ipc/speech.ts | 2 +- src/main/ipc/ssh/ssh-ipc-context.ts | 2 +- src/main/ipc/ssh/ssh.ts | 2 +- .../ipc/startup-notification-registration.ts | 2 +- src/main/ipc/telemetry.test.ts | 2 +- src/main/ipc/telemetry.ts | 2 +- src/main/ipc/ui.ts | 2 +- .../ipc/workspace-cleanup-broad-scan.test.ts | 2 +- .../ipc/workspace-cleanup-disconnected-ssh.ts | 2 +- ...ace-cleanup-execution-host-routing.test.ts | 2 +- .../workspace-cleanup-folder-workspaces.ts | 2 +- src/main/ipc/workspace-cleanup-scan.ts | 2 +- .../workspace-cleanup-snapshot-ipc.test.ts | 2 +- .../ipc/workspace-cleanup-worktree-listing.ts | 2 +- src/main/ipc/workspace-cleanup.test.ts | 2 +- src/main/ipc/workspace-cleanup.ts | 2 +- src/main/ipc/workspace-ports.ts | 2 +- src/main/ipc/workspace-space-window.ts | 2 +- src/main/ipc/workspace-space.test.ts | 2 +- src/main/ipc/workspace-space.ts | 2 +- .../worktree-base-directory-watch-targets.ts | 2 +- .../ipc/worktree-base-directory-watcher.ts | 2 +- src/main/ipc/worktree-push-target-cleanup.ts | 2 +- src/main/ipc/worktree-remote.ts | 2 +- .../ipc/worktrees-removal-recovery.test.ts | 2 +- src/main/ipc/wsl-drive-project-handlers.ts | 2 +- .../ipc/wsl-drive-unc-conversion-handlers.ts | 2 +- src/main/ipc/wsl-host-handlers.ts | 2 +- src/main/ipc/wsl-move-distro-in-use.ts | 2 +- src/main/ipc/wsl-move-driver-wiring.ts | 2 +- src/main/ipc/wsl-move-orchestrator-wiring.ts | 2 +- src/main/ipc/wsl-move-undo-wiring.ts | 2 +- src/main/local-project-runtime-resolution.ts | 2 +- src/main/macos-tcc-prompt-notice.test.ts | 4 +++- src/main/macos-tcc-prompt-notice.ts | 2 +- src/main/media/local-preview-grant-file.ts | 2 +- src/main/media/media-preview-protocol.test.ts | 2 +- src/main/media/media-preview-protocol.ts | 2 +- .../media/preview-grant-range-read.test.ts | 2 +- src/main/media/preview-grant-registry.ts | 2 +- ...cal-pty-registry-folder-workspaces.test.ts | 2 +- .../memory/hydrate-local-pty-registry.test.ts | 2 +- src/main/memory/hydrate-local-pty-registry.ts | 2 +- src/main/memory/memory-snapshot-buckets.ts | 2 +- src/main/muse-usage/store.ts | 2 +- src/main/opencode-usage/store.ts | 2 +- .../profile-persistence-deadline.ts | 2 +- src/main/orcad/orcad-account-services.ts | 2 +- src/main/orcad/orcad-automations.ts | 2 +- src/main/persistence.ts | 8 ------- .../orcad-source-catalog.ts | 2 +- .../wsl-move-main-rewrite-stores.test.ts | 2 +- .../wsl-move-manifest-export.ts | 2 +- .../wsl-move-registry-complete.test.ts | 2 +- .../wsl-move-retention.test.ts | 2 +- .../wsl-move-session-freeze.test.ts | 2 +- .../panels/plugin-external-open-consent.ts | 2 +- .../panels/plugin-frame-desktop-services.ts | 2 +- src/main/plugins/plugin-enablement.test.ts | 2 +- src/main/plugins/plugin-enablement.ts | 2 +- src/main/plugins/plugin-removal-settings.ts | 2 +- .../ports/ssh-advertised-url-enrichment.ts | 2 +- src/main/ports/workspace-port-ownership.ts | 2 +- src/main/project-runtime-git-options.test.ts | 2 +- ...ct-runtime-read-git-options-opt-in.test.ts | 2 +- src/main/provider-account-services.ts | 2 +- src/main/provisioned-root-checkout.ts | 2 +- src/main/provisioned-root-ssh-adoption.ts | 2 +- .../automation-change-publication.test.ts | 3 ++- .../mobile-pairing-userdata-path.test.ts | 22 +++++++++++-------- .../orca-runtime-test-fixtures.spec.ts | 2 +- .../runtime/orcad-migration-catalog-import.ts | 2 +- .../repo-worktree-row-resolution.test.ts | 2 +- ...untime-created-worktree-terminal-target.ts | 2 +- ...time-failed-local-worktree-removal.test.ts | 2 +- ...interrupted-local-worktree-removal.test.ts | 2 +- ...local-worktree-create-pr-conflicts.test.ts | 2 +- ...time-local-worktree-create-test-harness.ts | 2 +- ...managed-worktree-metadata-wsl-move.test.ts | 2 +- .../runtime-pty-controller-contract.ts | 2 +- src/main/runtime/runtime-store-contract.ts | 2 +- ...-terminal-orphan-adoption-rollback.test.ts | 2 +- .../runtime-witnessed-worktree-scan.ts | 2 +- .../wsl-moved-project-chat-runtime.test.ts | 2 +- src/main/serve-update-handoff.test.ts | 4 +++- src/main/serve-update-handoff.ts | 2 +- .../ssh/connection/ssh-connection-store.ts | 2 +- .../legacy-relay/legacy-relay-bridge-ipc.ts | 2 +- .../ssh-host-relay-terminals-on-connect.ts | 2 +- src/main/ssh/orcad-migration-delta-move.ts | 2 +- src/main/ssh/orcad-migration-delta-plan.ts | 2 +- .../ssh/orcad-migration-manifest-export.ts | 2 +- .../ssh/orcad-migration-repository-link.ts | 2 +- ...d-migration-scrollback-retention-wiring.ts | 2 +- .../orcad-migration-snapshot-coordinator.ts | 2 +- .../ssh/orcad-migration-source-retention.ts | 2 +- .../ssh/orcad-migration-ssh-relay-source.ts | 2 +- src/main/ssh/orcad-migration-terminal-gate.ts | 2 +- .../ssh/orcad-retained-source-lists.test.ts | 2 +- src/main/ssh/orcad-retained-source-session.ts | 2 +- src/main/ssh/orcad-retained-source.ts | 2 +- .../ssh/targets/ssh-target-orcad-claims.ts | 2 +- .../targets/ssh-target-orcad-dependents.ts | 2 +- .../ssh/targets/ssh-target-orcad-preflight.ts | 2 +- .../ssh/targets/ssh-target-readoption.test.ts | 2 +- src/main/ssh/targets/ssh-target-readoption.ts | 2 +- src/main/star-nag/agent-value-moment.ts | 2 +- src/main/star-nag/console-events.ts | 2 +- src/main/star-nag/onboarding-completed.ts | 2 +- src/main/star-nag/prompt-context.ts | 2 +- src/main/star-nag/service-test-harness.ts | 2 +- src/main/star-nag/service.ts | 2 +- src/main/star-nag/threshold-trigger.ts | 2 +- src/main/star-nag/web-handoff.ts | 2 +- ...rowser-process-user-agent-ordering.test.ts | 2 +- src/main/startup/dev-education-suppression.ts | 2 +- .../headless-serve-ssh-registration.ts | 2 +- src/main/startup/main-process-observers.ts | 2 +- src/main/startup/main-process-preflight.ts | 2 +- .../main-process-quit-pending-writer.test.ts | 4 +++- .../main-process-quit-update-veto.test.ts | 2 +- src/main/startup/main-process-quit.ts | 2 +- .../startup/main-process-ready-foundation.ts | 2 +- .../main-process-ready-identity-write.test.ts | 5 ++--- ...-process-runtime-launch-activation.test.ts | 2 +- .../startup/main-process-runtime-launch.ts | 2 +- src/main/startup/main-process-state.ts | 2 +- .../startup/wsl-orcad-account-env-wiring.ts | 2 +- .../chat-ui-launch-tip-cohort.test.ts | 2 +- .../telemetry/chat-ui-launch-tip-cohort.ts | 2 +- .../telemetry/client-deferred-start.test.ts | 2 +- src/main/telemetry/client-test-harness.ts | 2 +- src/main/telemetry/client.test.ts | 2 +- src/main/telemetry/client.ts | 2 +- src/main/telemetry/cohort-classifier.test.ts | 2 +- src/main/telemetry/cohort-classifier.ts | 2 +- src/main/telemetry/install-id.ts | 2 +- .../onboarding-cohort-classifier.test.ts | 2 +- .../telemetry/onboarding-cohort-classifier.ts | 2 +- src/main/telemetry/posthog-client-start.ts | 2 +- src/main/telemetry/wsl-usage-reporter.ts | 2 +- src/main/update-restart-preservation.ts | 2 +- src/main/usage-worktree-metadata.ts | 2 +- .../usage/usage-provider-store-lifecycle.ts | 2 +- src/main/warp-themes/index.test.ts | 2 +- src/main/warp-themes/index.ts | 2 +- .../attach-main-window-services.test.ts | 2 +- .../window/attach-main-window-services.ts | 2 +- src/main/window/clipboard-ipc-handlers.ts | 2 +- .../clipboard-macos-image-paste.test.ts | 4 ++-- src/main/window/createMainWindow.ts | 2 +- src/main/window/dashboard-popout-window.ts | 2 +- src/main/window/history-gc-worktree-ids.ts | 2 +- .../window/main-window-close-lifecycle.ts | 2 +- .../window/main-window-shortcut-routing.ts | 2 +- .../window/main-window-state-lifecycle.ts | 2 +- ...main-window-updater-deferred-setup.test.ts | 2 +- src/main/window/main-window-updater.ts | 2 +- .../window/native-chat-paste-files.test.ts | 2 +- .../updater-package-recovery-ipc.test.ts | 2 +- src/main/window/workspace-space-window.ts | 2 +- .../workspace-space-analysis-capacity.test.ts | 2 +- ...orkspace-space-analysis-du-timeout.test.ts | 2 +- src/main/workspace-space-analysis.test.ts | 2 +- src/main/workspace-space-analysis.ts | 2 +- src/main/workspace-space-repo-scan.ts | 2 +- ...ee-create-preparation-cancellation.test.ts | 2 +- ...tree-create-preparation-contention.test.ts | 2 +- ...rktree-create-preparation-wsl-root.test.ts | 2 +- src/main/worktree-lineage-pruning.ts | 2 +- .../worktree-removal-close-records.test.ts | 3 ++- ...-removal-session-partition-fencing.test.ts | 3 ++- src/main/wsl-move-scan-pruning.test.ts | 2 +- .../daemon-generation-legacy-close-client.ts | 2 +- .../daemon-generation-profile-store.ts | 2 +- 335 files changed, 365 insertions(+), 355 deletions(-) delete mode 100644 src/main/persistence.ts diff --git a/src/main/__mocks__/worktree-create-preparation.ts b/src/main/__mocks__/worktree-create-preparation.ts index 556ae97ed21..315bcced876 100644 --- a/src/main/__mocks__/worktree-create-preparation.ts +++ b/src/main/__mocks__/worktree-create-preparation.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, vi, type Mock } from 'vitest' import type * as WorktreeLogic from '../ipc/worktree-logic' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' import { resolveWorktreeAddBaseRef } from '../../shared/worktree/base-ref' diff --git a/src/main/active-view-persistence-boundary.test.ts b/src/main/active-view-persistence-boundary.test.ts index ed09a5458fb..c633c712ba4 100644 --- a/src/main/active-view-persistence-boundary.test.ts +++ b/src/main/active-view-persistence-boundary.test.ts @@ -41,7 +41,7 @@ describe('active-view persistence boundary', () => { it('persists a view switch without changing the global durable snapshot', async () => { vi.useFakeTimers() vi.resetModules() - const { Store } = await import('./persistence') + const { Store } = await import('./persistence/loading-store/store') const dataFile = join(testState.dir, 'orca-data.json') const store = createSqliteTestStore(Store, { dataFile }) store.flush() diff --git a/src/main/agent-auth-restart-preservation.ts b/src/main/agent-auth-restart-preservation.ts index 2d563effec3..dd22b97a7a1 100644 --- a/src/main/agent-auth-restart-preservation.ts +++ b/src/main/agent-auth-restart-preservation.ts @@ -1,5 +1,5 @@ import type { CodexRuntimeHomeService } from './codex-accounts/runtime-home-service' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' const AUTH_PRESERVATION_TIMEOUT_MS = 2_000 diff --git a/src/main/agent-hooks/first-work-rename-runtime.ts b/src/main/agent-hooks/first-work-rename-runtime.ts index af63dd94757..c77ba7da79e 100644 --- a/src/main/agent-hooks/first-work-rename-runtime.ts +++ b/src/main/agent-hooks/first-work-rename-runtime.ts @@ -6,7 +6,7 @@ import { rememberBranchRenameFailureOutput } from './branch-rename-failure-outpu import { renameWorktreeFolderOnFirstWork } from './first-work-folder-rename' import { moveWorktree } from '../git/worktree' import { isWslMoveFolderWorkspaceBlocked } from '../persistence/moving-wsl-projects/wsl-move-background-backoff' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RuntimeStore } from '../runtime/runtime-store-contract' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { resolveWorktreeMetaOwner } from '../persistence/host-qualified-worktree-meta' diff --git a/src/main/automations/automation-dispatch-host-fence.test.ts b/src/main/automations/automation-dispatch-host-fence.test.ts index 2e00330c1e4..c93562cd4fd 100644 --- a/src/main/automations/automation-dispatch-host-fence.test.ts +++ b/src/main/automations/automation-dispatch-host-fence.test.ts @@ -7,7 +7,7 @@ import type { SshTarget } from '../../shared/ssh-types' import type { Automation } from '../../shared/automations-types' import { AUTOMATION_ORPHAN_ISSUES } from '../../shared/automation-list-scope' import { removeTreeSync } from '../../shared/windows-transient-lock-removal' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveAutomationRunTarget } from './run-target-resolution' import { AutomationService } from './service' import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness' diff --git a/src/main/automations/automation-dispatch-request.ts b/src/main/automations/automation-dispatch-request.ts index bab94fe9c54..b5661b1db24 100644 --- a/src/main/automations/automation-dispatch-request.ts +++ b/src/main/automations/automation-dispatch-request.ts @@ -7,7 +7,7 @@ import type { AutomationPrecheckResult } from '../../shared/automations-types' import { getRepoExecutionHostId } from '../../shared/execution-host' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { AutomationRunWriter } from './automation-run-writer' import type { HeadlessAutomationDispatcher } from './headless-dispatch' import type { HeadlessAutomationDispatchContext } from './headless-dispatch-runner' diff --git a/src/main/automations/automation-owner-fencing.test.ts b/src/main/automations/automation-owner-fencing.test.ts index dbcfdaf6072..1145e7f18b4 100644 --- a/src/main/automations/automation-owner-fencing.test.ts +++ b/src/main/automations/automation-owner-fencing.test.ts @@ -109,7 +109,8 @@ async function createStore() { } vi.resetModules() installFakeAppEnvironment({ getPath: () => testState.dir }) - const { Store, initDataPath } = await import('../persistence') + const { Store } = await import('../persistence/loading-store/store') + const { initDataPath } = await import('../persistence/loading-store/user-data-path') initDataPath() return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') }) } diff --git a/src/main/automations/automation-run-writer.test.ts b/src/main/automations/automation-run-writer.test.ts index 92e7f0f34da..17b9c08a137 100644 --- a/src/main/automations/automation-run-writer.test.ts +++ b/src/main/automations/automation-run-writer.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import { createAutomationRunWriter } from './automation-run-writer' import { buildProfileStateCutoverFixture } from '../persistence/profile-state-cutover-fixture' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const SSH_SELECTOR = { kind: 'ssh', targetId: 'ssh-1' } as const diff --git a/src/main/automations/automation-run-writer.ts b/src/main/automations/automation-run-writer.ts index 949ec06533c..2b2bf38ba31 100644 --- a/src/main/automations/automation-run-writer.ts +++ b/src/main/automations/automation-run-writer.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { PublishAutomationsChanged } from '../../shared/runtime-client-events' import type { AutomationDispatchResult, AutomationRun } from '../../shared/automations-types' diff --git a/src/main/automations/automation-skip-coalescing.test.ts b/src/main/automations/automation-skip-coalescing.test.ts index 3b392df32c6..26a0e20c3c8 100644 --- a/src/main/automations/automation-skip-coalescing.test.ts +++ b/src/main/automations/automation-skip-coalescing.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import type { Repo } from '../../shared/repo-types' import type { Automation } from '../../shared/automations-types' import { removeTreeSync } from '../../shared/windows-transient-lock-removal' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { closeTestStores, createStore, diff --git a/src/main/automations/automation-update-host-retarget.test.ts b/src/main/automations/automation-update-host-retarget.test.ts index 916206aadc1..4e201de2b26 100644 --- a/src/main/automations/automation-update-host-retarget.test.ts +++ b/src/main/automations/automation-update-host-retarget.test.ts @@ -122,7 +122,8 @@ async function createStore() { } vi.resetModules() installFakeAppEnvironment({ getPath: () => testState.dir }) - const { Store, initDataPath } = await import('../persistence') + const { Store } = await import('../persistence/loading-store/store') + const { initDataPath } = await import('../persistence/loading-store/user-data-path') initDataPath() return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') }) } diff --git a/src/main/automations/automation-worker-durability.test.ts b/src/main/automations/automation-worker-durability.test.ts index 1bf497a71a4..a6916ed738e 100644 --- a/src/main/automations/automation-worker-durability.test.ts +++ b/src/main/automations/automation-worker-durability.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { AutomationService } from './service' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { createWorkerMaintenanceFixture, maintenanceBarrier diff --git a/src/main/automations/automation-workspace-host-attribution.test.ts b/src/main/automations/automation-workspace-host-attribution.test.ts index 0edc9543a33..6856ecb4e31 100644 --- a/src/main/automations/automation-workspace-host-attribution.test.ts +++ b/src/main/automations/automation-workspace-host-attribution.test.ts @@ -122,7 +122,8 @@ async function createStore( } vi.resetModules() installFakeAppEnvironment({ getPath: () => testState.dir }) - const { Store, initDataPath } = await import('../persistence') + const { Store } = await import('../persistence/loading-store/store') + const { initDataPath } = await import('../persistence/loading-store/user-data-path') initDataPath() return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') }) } diff --git a/src/main/automations/automation-wsl-distro-stopped-refusal.test.ts b/src/main/automations/automation-wsl-distro-stopped-refusal.test.ts index 325a2bb9820..3628b24a099 100644 --- a/src/main/automations/automation-wsl-distro-stopped-refusal.test.ts +++ b/src/main/automations/automation-wsl-distro-stopped-refusal.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import type { Repo } from '../../shared/repo-types' import type { Automation } from '../../shared/automations-types' import { removeTreeSync } from '../../shared/windows-transient-lock-removal' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness' import type * as UncGate from '../wsl/wsl-unc-access-gate' import { AutomationService } from './service' diff --git a/src/main/automations/automation-wsl-move-refusal.test.ts b/src/main/automations/automation-wsl-move-refusal.test.ts index b988cfa7b71..3eedc60d7a5 100644 --- a/src/main/automations/automation-wsl-move-refusal.test.ts +++ b/src/main/automations/automation-wsl-move-refusal.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import type { Repo } from '../../shared/repo-types' import type { Automation } from '../../shared/automations-types' import { removeTreeSync } from '../../shared/windows-transient-lock-removal' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness' import { wslMoveCutoverFixture as cutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { seedWslMoveCutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding' diff --git a/src/main/automations/dispatch-refusal.ts b/src/main/automations/dispatch-refusal.ts index 139b272a183..4ff4d8c6630 100644 --- a/src/main/automations/dispatch-refusal.ts +++ b/src/main/automations/dispatch-refusal.ts @@ -1,6 +1,6 @@ // Skip coalescing requires a fixed, byte-identical sentence for each refusal reason. import type { WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Automation, AutomationDispatchRequest, diff --git a/src/main/automations/hook-review-blocked-run-terminals.ts b/src/main/automations/hook-review-blocked-run-terminals.ts index 439128db270..fb146914616 100644 --- a/src/main/automations/hook-review-blocked-run-terminals.ts +++ b/src/main/automations/hook-review-blocked-run-terminals.ts @@ -1,6 +1,6 @@ import type { AutomationDispatchResult, AutomationRun } from '../../shared/automations-types' import { automationRunRecency } from '../../shared/automation-session-reuse' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { runOwnHandle } from './headless-automation-agent-launch' import { AGENT_HOOKS_REVIEW_BLOCKED_ERROR, diff --git a/src/main/automations/orcad-fenced-automation.ts b/src/main/automations/orcad-fenced-automation.ts index 8797f8778c2..b8c2b07bab0 100644 --- a/src/main/automations/orcad-fenced-automation.ts +++ b/src/main/automations/orcad-fenced-automation.ts @@ -1,6 +1,6 @@ import { getAppEnvironment } from '../../shared/app-environment' import type { Automation } from '../../shared/automations-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { listOrcadMigrationCutoverChainForTarget } from '../ssh/orcad-migration-cutover-journal' export const ORCAD_FENCED_AUTOMATION = "This automation now runs on its SSH host's Orca server." diff --git a/src/main/automations/run-target-resolution.test.ts b/src/main/automations/run-target-resolution.test.ts index a6de5dfb85b..9a79296f716 100644 --- a/src/main/automations/run-target-resolution.test.ts +++ b/src/main/automations/run-target-resolution.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Automation } from '../../shared/automations-types' import type { WorkspaceRunContext } from '../../shared/task-source-context' import type { ProjectHostSetup } from '../../shared/project-types' diff --git a/src/main/automations/run-target-resolution.ts b/src/main/automations/run-target-resolution.ts index 71293d51265..2030ab24064 100644 --- a/src/main/automations/run-target-resolution.ts +++ b/src/main/automations/run-target-resolution.ts @@ -1,6 +1,6 @@ import { findAutomationRepo } from '../../shared/automation-repo-target' import { findProjectHostSetup } from '../../shared/project-host-setup-target' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Automation } from '../../shared/automations-types' import { getAutomationLegacyRepoId } from '../../shared/automation-run-identity' import { diff --git a/src/main/automations/run-usage-collection.ts b/src/main/automations/run-usage-collection.ts index 19b07fae59c..1936423b33d 100644 --- a/src/main/automations/run-usage-collection.ts +++ b/src/main/automations/run-usage-collection.ts @@ -1,5 +1,5 @@ import type { Automation, AutomationRun, AutomationRunUsage } from '../../shared/automations-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { AutomationRunWriter } from './automation-run-writer' import type { ClaudeUsageStore } from '../claude-usage/store' import type { CodexUsageStore } from '../codex-usage/store' diff --git a/src/main/automations/runtime-automation-service.test.ts b/src/main/automations/runtime-automation-service.test.ts index 21ad0517c08..5c66e1a1f25 100644 --- a/src/main/automations/runtime-automation-service.test.ts +++ b/src/main/automations/runtime-automation-service.test.ts @@ -3,7 +3,7 @@ import type * as AgentLauncher from './automation-chat-agent-launch' import type { HeadlessAutomationDispatcher } from './headless-dispatch' import type { AutomationRunTerminalObserver } from './run-completion-watcher' import type { OrcaRuntimeService } from '../runtime/orca-runtime' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { buildProfileStateCutoverFixture } from '../persistence/profile-state-cutover-fixture' import { automationRunOperationId } from './automation-run-operation' diff --git a/src/main/automations/runtime-automation-service.ts b/src/main/automations/runtime-automation-service.ts index 49978be09dd..cab4bbfa5ab 100644 --- a/src/main/automations/runtime-automation-service.ts +++ b/src/main/automations/runtime-automation-service.ts @@ -5,7 +5,7 @@ import { launchAutomationChatAgent } from './automation-chat-agent-launch' import { tuiAgentDisplayName } from '../../shared/tui-agent-display-names' import type { ClaudeUsageStore } from '../claude-usage/store' import type { CodexUsageStore } from '../codex-usage/store' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { AutomationService } from './service' import { createHeadlessRunTerminalRetention } from './headless-run-terminal-retention' diff --git a/src/main/automations/service-precheck.test.ts b/src/main/automations/service-precheck.test.ts index f77d2da14fd..8ccfe9e3bd2 100644 --- a/src/main/automations/service-precheck.test.ts +++ b/src/main/automations/service-precheck.test.ts @@ -44,7 +44,8 @@ async function createStore() { } vi.resetModules() installFakeAppEnvironment({ getPath: () => testState.dir }) - const { Store, initDataPath } = await import('../persistence') + const { Store } = await import('../persistence/loading-store/store') + const { initDataPath } = await import('../persistence/loading-store/user-data-path') initDataPath() return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') }) } diff --git a/src/main/automations/service.ts b/src/main/automations/service.ts index 94ca3b5de75..b98908bc924 100644 --- a/src/main/automations/service.ts +++ b/src/main/automations/service.ts @@ -5,7 +5,7 @@ import { type AutomationRendererChannel } from './automation-dispatch-request' export type { AutomationRendererChannel } from './automation-dispatch-request' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isFinalAutomationRunStatus, type Automation, diff --git a/src/main/browser-sidecar-owner.test.ts b/src/main/browser-sidecar-owner.test.ts index 4162f60acc8..ef8f187114a 100644 --- a/src/main/browser-sidecar-owner.test.ts +++ b/src/main/browser-sidecar-owner.test.ts @@ -5,7 +5,7 @@ import { installServeSupervisorDisconnectQuit } from './serve-update-handoff' const { quit } = vi.hoisted(() => ({ quit: vi.fn() })) vi.mock('./startup/process-quit-request', () => ({ quitProcess: quit })) -vi.mock('./persistence', () => ({ +vi.mock('./persistence/loading-store/user-data-path', () => ({ getCanonicalUserDataPath: () => { throw new Error('No profile access for sidecar owner') } diff --git a/src/main/browser/__mocks__/browser-session-registry-persistence-fixture.ts b/src/main/browser/__mocks__/browser-session-registry-persistence-fixture.ts index 4d30df7c892..e44a339904c 100644 --- a/src/main/browser/__mocks__/browser-session-registry-persistence-fixture.ts +++ b/src/main/browser/__mocks__/browser-session-registry-persistence-fixture.ts @@ -152,9 +152,6 @@ export function installModuleMocks( userAgent: CLEAN_USER_AGENT }) })) - vi.doMock('../../persistence', () => ({ - getCanonicalUserDataPath: () => USER_DATA - })) vi.doMock('../../persistence/loading-store/user-data-path', () => ({ getCanonicalUserDataPath: () => USER_DATA })) diff --git a/src/main/browser/extensions/browser-extension-discarded-tabs.ts b/src/main/browser/extensions/browser-extension-discarded-tabs.ts index 76bb9581d18..903ae9781a3 100644 --- a/src/main/browser/extensions/browser-extension-discarded-tabs.ts +++ b/src/main/browser/extensions/browser-extension-discarded-tabs.ts @@ -1,5 +1,5 @@ import { webContents } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { BrowserWorkspace } from '../../../shared/browser-workspace-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' import { browserManager } from '../browser-manager' diff --git a/src/main/claude-accounts/runtime-auth-service.ts b/src/main/claude-accounts/runtime-auth-service.ts index fc51c4612cf..3c3801b9f1a 100644 --- a/src/main/claude-accounts/runtime-auth-service.ts +++ b/src/main/claude-accounts/runtime-auth-service.ts @@ -2,7 +2,7 @@ import { join } from 'node:path' import { getAppEnvironment } from '../../shared/app-environment' import { toWindowsWslPath } from '../../shared/wsl-paths' import { resolveLocalAccountRuntimeTarget } from '../../shared/local-account-runtime' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isWslDistroRunning } from '../wsl-background-distro-gate' import { getDefaultWslDistro, getWslHome } from '../wsl' import { ClaudeProfileRouter } from './claude-profile-router' diff --git a/src/main/claude-usage/store.ts b/src/main/claude-usage/store.ts index ac7335cba27..787329bf103 100644 --- a/src/main/claude-usage/store.ts +++ b/src/main/claude-usage/store.ts @@ -12,7 +12,7 @@ import type { ClaudeUsageSummary } from '../../shared/claude-usage-types' import type { AutomationRunUsage } from '../../shared/automations-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { ClaudeUsagePersistedState } from './types' import { scanClaudeUsageFilesViaWorker, diff --git a/src/main/codex-accounts/codex-account-registration.ts b/src/main/codex-accounts/codex-account-registration.ts index cb35ae8b51b..1664c4e953c 100644 --- a/src/main/codex-accounts/codex-account-registration.ts +++ b/src/main/codex-accounts/codex-account-registration.ts @@ -10,7 +10,7 @@ import type { CodexManagedAccount, CodexRateLimitAccountsState } from '../../shared/managed-account-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RateLimitService } from '../rate-limits/service' import type { CodexRuntimeHomeService } from './runtime-home-service' import type { ResolvedCodexIdentity } from './codex-account-identity' diff --git a/src/main/codex-accounts/codex-account-selection.ts b/src/main/codex-accounts/codex-account-selection.ts index 46cf7f55d58..2d3cbf44e82 100644 --- a/src/main/codex-accounts/codex-account-selection.ts +++ b/src/main/codex-accounts/codex-account-selection.ts @@ -4,7 +4,7 @@ import type { CodexSystemDefaultIdentity } from '../../shared/managed-account-types' import { parseWslUncPath } from '../../shared/wsl-paths' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RateLimitService } from '../rate-limits/service' import type { CodexRuntimeHomeService } from './runtime-home-service' import type { CodexConfigMirror } from './codex-config-mirror' diff --git a/src/main/codex-accounts/codex-config-mirror.ts b/src/main/codex-accounts/codex-config-mirror.ts index 37cdb5b652d..b156e3748cf 100644 --- a/src/main/codex-accounts/codex-config-mirror.ts +++ b/src/main/codex-accounts/codex-config-mirror.ts @@ -7,7 +7,7 @@ import { syncSystemConfigIntoManagedCodexHome } from '../codex/codex-config-mirror' import { readCodexTopLevelModelProvider } from '../codex/codex-model-provider-config' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { toWindowsWslPath } from '../wsl' import { wasWslDistroLastSeenRunningSettled } from '../wsl-background-distro-gate' import { WSL_UNC_RUNNING_LEASE_MS } from '../wsl/wsl-unc-access-gate' diff --git a/src/main/codex-accounts/codex-reset-credit-coordinator.ts b/src/main/codex-accounts/codex-reset-credit-coordinator.ts index 2526b76ad4a..0086d0a78db 100644 --- a/src/main/codex-accounts/codex-reset-credit-coordinator.ts +++ b/src/main/codex-accounts/codex-reset-credit-coordinator.ts @@ -13,7 +13,7 @@ import type { RateLimitState, RateLimitRuntimeTarget } from '../../shared/rate-limit-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RateLimitService } from '../rate-limits/service' import type { CodexRuntimeHomeService } from './runtime-home-service' import { getSelectedCodexAccountIdForTarget } from './runtime-selection' diff --git a/src/main/codex-accounts/codex-reset-credit-ledger.ts b/src/main/codex-accounts/codex-reset-credit-ledger.ts index 79aa5a58611..4b6e037602a 100644 --- a/src/main/codex-accounts/codex-reset-credit-ledger.ts +++ b/src/main/codex-accounts/codex-reset-credit-ledger.ts @@ -8,7 +8,7 @@ import type { CodexRateLimitResetOutcome, RateLimitRuntimeTarget } from '../../shared/rate-limit-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { profileStateWriterFailureOutcome } from '../persistence/profile-state/profile-state-writer-errors' export type CodexResetCreditAttempt = { diff --git a/src/main/codex-accounts/codex-reset-credit-scope-validation.ts b/src/main/codex-accounts/codex-reset-credit-scope-validation.ts index 50abc472d26..e28836166de 100644 --- a/src/main/codex-accounts/codex-reset-credit-scope-validation.ts +++ b/src/main/codex-accounts/codex-reset-credit-scope-validation.ts @@ -7,7 +7,7 @@ import { type CodexResetCreditExpectedScope } from '../../shared/codex-reset-credit-scope' import type { RateLimitState, RateLimitRuntimeTarget } from '../../shared/rate-limit-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RateLimitService } from '../rate-limits/service' import type { CodexResetCreditRejectedBeforeProviderReason } from './codex-account-service-types' import type { CodexManagedHomePath } from './codex-managed-home-path' diff --git a/src/main/codex-accounts/runtime-home-service-state.ts b/src/main/codex-accounts/runtime-home-service-state.ts index b30ea37c2a3..2c738d30bbe 100644 --- a/src/main/codex-accounts/runtime-home-service-state.ts +++ b/src/main/codex-accounts/runtime-home-service-state.ts @@ -1,5 +1,5 @@ import type { CodexManagedAccount } from '../../shared/managed-account-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { CodexCredentialAbsenceGrace } from './codex-credential-absence-grace' import type { CodexMirroredHomeStatus, diff --git a/src/main/codex-accounts/runtime-home-service.ts b/src/main/codex-accounts/runtime-home-service.ts index 4f08fb0a64c..af06a8f4fc1 100644 --- a/src/main/codex-accounts/runtime-home-service.ts +++ b/src/main/codex-accounts/runtime-home-service.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { CodexRuntimeHomeAuthSync } from './runtime-home-service-auth-sync' export type { diff --git a/src/main/codex-accounts/service.ts b/src/main/codex-accounts/service.ts index a543210d3b6..5ca08712fb1 100644 --- a/src/main/codex-accounts/service.ts +++ b/src/main/codex-accounts/service.ts @@ -10,7 +10,7 @@ import type { import type { CodexRateLimitResetResult } from '../../shared/rate-limit-types' import type { CodexResetCreditExpectedScope } from '../../shared/codex-reset-credit-scope' import type { CodexRuntimeHomeService } from './runtime-home-service' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RateLimitService } from '../rate-limits/service' import { admitSelfInitiatedTreeKill } from '../own-chromium-tree-kill-guard' import type { CodexAccountSelectionTarget } from './runtime-selection' diff --git a/src/main/codex-usage/store.ts b/src/main/codex-usage/store.ts index 33d205105b1..364898d59cb 100644 --- a/src/main/codex-usage/store.ts +++ b/src/main/codex-usage/store.ts @@ -12,7 +12,7 @@ import type { CodexUsageSummary } from '../../shared/codex-usage-types' import type { AutomationRunUsage } from '../../shared/automations-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { CodexUsagePersistedState } from './types' import type { AutomationUsageLookupInput } from './codex-automation-run-attribution' import { CODEX_USAGE_SCHEMA_VERSION, codexUsageProvider } from './codex-usage-provider' diff --git a/src/main/ephemeral-vm/workspace-suspend.ts b/src/main/ephemeral-vm/workspace-suspend.ts index 5a5eb6c34dd..995beb52b92 100644 --- a/src/main/ephemeral-vm/workspace-suspend.ts +++ b/src/main/ephemeral-vm/workspace-suspend.ts @@ -1,5 +1,5 @@ import { app } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { listEphemeralVmRuntimes } from '../../shared/ephemeral-vm-runtime-store' import { suspendEphemeralVmRuntime } from './runtime-service' import { disconnectRuntimeOwnedSshTarget } from './runtime-ssh' diff --git a/src/main/folder-repo-git-conversion.ts b/src/main/folder-repo-git-conversion.ts index 86b9c28fa73..671d980a8ec 100644 --- a/src/main/folder-repo-git-conversion.ts +++ b/src/main/folder-repo-git-conversion.ts @@ -9,7 +9,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../shared/execution-host' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { isFolderRepo } from '../shared/repo-kind' import { normalizeRuntimePathForComparison } from '../shared/cross-platform-path' import { getGitRepoRootAsync, isGitRepoAsync } from './git/repo' diff --git a/src/main/ghostty/index.test.ts b/src/main/ghostty/index.test.ts index ebc1d52e9e3..b5637884704 100644 --- a/src/main/ghostty/index.test.ts +++ b/src/main/ghostty/index.test.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GlobalSettings } from '../../shared/global-settings-types' import { afterEach, describe, expect, it, vi } from 'vitest' diff --git a/src/main/ghostty/index.ts b/src/main/ghostty/index.ts index 878267a61b8..02ba8e28496 100644 --- a/src/main/ghostty/index.ts +++ b/src/main/ghostty/index.ts @@ -1,7 +1,7 @@ import { readFile, stat } from 'node:fs/promises' import { platform } from 'node:os' import type { GhosttyImportPreview, GlobalSettings } from '../../shared/global-settings-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { findGhosttyConfigPaths } from './discovery' import { parseGhosttyConfig } from './parser' import { mapGhosttyToOrca } from './mapper' diff --git a/src/main/ghostty/theme-import.test.ts b/src/main/ghostty/theme-import.test.ts index aa1a5ccaf16..cf59b02297b 100644 --- a/src/main/ghostty/theme-import.test.ts +++ b/src/main/ghostty/theme-import.test.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GlobalSettings } from '../../shared/global-settings-types' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' diff --git a/src/main/github/pr-mutation-review-invalidation.test.ts b/src/main/github/pr-mutation-review-invalidation.test.ts index 5e3cc0a242a..b00394e5448 100644 --- a/src/main/github/pr-mutation-review-invalidation.test.ts +++ b/src/main/github/pr-mutation-review-invalidation.test.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { PRRefreshOutcome } from '../../shared/github/pull-request-refresh-types' import type { Repo } from '../../shared/repo-types' import type { GitHubRepoContext, LocalGitExecOptions } from './github-repository-identity' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { __resetHostedReviewBranchCacheForTests } from '../source-control/hosted-review-branch-cache' const mocks = vi.hoisted(() => ({ diff --git a/src/main/ipc/app.ts b/src/main/ipc/app.ts index 04f3e13c4ca..0f679e481da 100644 --- a/src/main/ipc/app.ts +++ b/src/main/ipc/app.ts @@ -13,7 +13,7 @@ import { setWindowMaterialSuppressed } from '../window/window-material-suppressi import { isTrustedUIRenderer } from './ui' import { prepareWindowsAdministratorRestart } from '../windows/windows-administrator-restart' import { quitProcess } from '../startup/process-quit-request' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { getDevInstanceIdentity } from '../startup/dev-instance-identity' import { isPwshAvailableAsync } from '../pwsh' import { isWslAvailableAsync, listWslDistrosAsync } from '../wsl' diff --git a/src/main/ipc/automations-external-scope.test.ts b/src/main/ipc/automations-external-scope.test.ts index 5914d32042e..31fe500abb0 100644 --- a/src/main/ipc/automations-external-scope.test.ts +++ b/src/main/ipc/automations-external-scope.test.ts @@ -5,7 +5,7 @@ import { AUTOMATION_OWNER_CONFLICT_CODES } from '../../shared/automation-owner-c import type { AutomationOwnerRef } from '../../shared/automation-owner-ref' import type { SshTarget } from '../../shared/ssh-types' import type { AutomationService } from '../automations/service' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as Fs from 'node:fs' import { SSH_HOST_NOT_SERVED_MESSAGE } from '../providers/ssh-host-not-served-error' import { ExternalAutomationManagerCache } from '../automations/external-automation-manager-cache' diff --git a/src/main/ipc/automations.ts b/src/main/ipc/automations.ts index 1814e7f88e1..50a39e7968d 100644 --- a/src/main/ipc/automations.ts +++ b/src/main/ipc/automations.ts @@ -1,7 +1,7 @@ import { parseExecutionHostId } from '../../shared/execution-host' import { hostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { AutomationService } from '../automations/service' import type { AutomationDispatchResult, diff --git a/src/main/ipc/cli-appimage-stale-registration.test.ts b/src/main/ipc/cli-appimage-stale-registration.test.ts index b6789a6aab4..42ae340c520 100644 --- a/src/main/ipc/cli-appimage-stale-registration.test.ts +++ b/src/main/ipc/cli-appimage-stale-registration.test.ts @@ -49,7 +49,9 @@ vi.mock('../cli/wsl-cli-registration-operation', () => ({ runSerializedWslCliRegistrationOperation: vi.fn() })) -vi.mock('../persistence', () => ({ getCanonicalUserDataPath: vi.fn() })) +vi.mock('../persistence/loading-store/user-data-path', () => ({ + getCanonicalUserDataPath: vi.fn() +})) vi.mock('../startup/hydrate-shell-path', () => ({ hydrateShellPath: mocks.hydrateShellPath, diff --git a/src/main/ipc/cli.test.ts b/src/main/ipc/cli.test.ts index 0fb5fa89c33..fb8147c3480 100644 --- a/src/main/ipc/cli.test.ts +++ b/src/main/ipc/cli.test.ts @@ -29,7 +29,9 @@ vi.mock('../cli/wsl-cli-registration-registry', () => ({ recordWslCliRegistrationRemoved: recordRemovedMock, forgetWslCliRegistration: forgetMock })) -vi.mock('../persistence', () => ({ getCanonicalUserDataPath: () => '/canonical-user-data' })) +vi.mock('../persistence/loading-store/user-data-path', () => ({ + getCanonicalUserDataPath: () => '/canonical-user-data' +})) vi.mock('../startup/hydrate-shell-path', () => ({ hydrateShellPath: vi.fn(async () => ({ ok: false })), mergePathSegments: vi.fn() diff --git a/src/main/ipc/cli.ts b/src/main/ipc/cli.ts index ccb9cdbbbb0..1272d9dc10d 100644 --- a/src/main/ipc/cli.ts +++ b/src/main/ipc/cli.ts @@ -16,7 +16,7 @@ import { WslCliUnreachableError } from '../cli/wsl-cli-status' import { runSerializedWslCliRegistrationOperation } from '../cli/wsl-cli-registration-operation' -import { getCanonicalUserDataPath } from '../persistence' +import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' import { hydrateShellPath, mergePathSegments } from '../startup/hydrate-shell-path' import { getDefaultWslDistro } from '../wsl' import { blockedWslDistroForExec, runAsWslExecUserAct } from '../wsl/wsl-background-exec-gate' diff --git a/src/main/ipc/created-worktree-root-prune.test.ts b/src/main/ipc/created-worktree-root-prune.test.ts index 7f2a971121f..75ae62da843 100644 --- a/src/main/ipc/created-worktree-root-prune.test.ts +++ b/src/main/ipc/created-worktree-root-prune.test.ts @@ -3,7 +3,7 @@ import { resolve } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as RepoWorktrees from '../repo-worktrees' import { listRepoWorktreeGraph } from '../repo-worktrees' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' import { __resetCreatedWorktreeRootsForTests, diff --git a/src/main/ipc/dashboard-popout.ts b/src/main/ipc/dashboard-popout.ts index a77cc518b44..715b6abf7fb 100644 --- a/src/main/ipc/dashboard-popout.ts +++ b/src/main/ipc/dashboard-popout.ts @@ -1,5 +1,5 @@ import { app, ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { KeybindingService } from '../keybindings/keybinding-service' import type { DashboardSnapshot } from '../../shared/dashboard-snapshot' import { diff --git a/src/main/ipc/ephemeral-vm-recipe-context.ts b/src/main/ipc/ephemeral-vm-recipe-context.ts index e797a57e2b7..240f3f630ea 100644 --- a/src/main/ipc/ephemeral-vm-recipe-context.ts +++ b/src/main/ipc/ephemeral-vm-recipe-context.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { loadHooks } from '../hooks' import type { EphemeralVmRecipeDoctorResult } from '../../shared/ephemeral-vm-recipes' import { listEphemeralVmRuntimes } from '../../shared/ephemeral-vm-runtime-store' diff --git a/src/main/ipc/filesystem/filesystem-handler-context.ts b/src/main/ipc/filesystem/filesystem-handler-context.ts index 231034d9a91..025fbc2d6ad 100644 --- a/src/main/ipc/filesystem/filesystem-handler-context.ts +++ b/src/main/ipc/filesystem/filesystem-handler-context.ts @@ -1,6 +1,6 @@ import type { ChildProcess } from 'node:child_process' import type { FileHandle } from 'node:fs/promises' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { CommitMessageAgentEnvironmentResolvers } from '../../text-generation/commit-message-agent-environment' import type { SenderScopedRequestCancellations } from '../sender-scoped-request-cancellation' import { cleanupLocalTransferPath } from './filesystem-download-promotion' diff --git a/src/main/ipc/filesystem/filesystem-source-control-ai-targets.test.ts b/src/main/ipc/filesystem/filesystem-source-control-ai-targets.test.ts index 0351d4dc7e0..415487a910d 100644 --- a/src/main/ipc/filesystem/filesystem-source-control-ai-targets.test.ts +++ b/src/main/ipc/filesystem/filesystem-source-control-ai-targets.test.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' const mocks = vi.hoisted(() => ({ graph: vi.fn(), gitOptions: vi.fn() })) diff --git a/src/main/ipc/filesystem/filesystem-source-control-ai-targets.ts b/src/main/ipc/filesystem/filesystem-source-control-ai-targets.ts index 8b65ffbd24b..45e082237b5 100644 --- a/src/main/ipc/filesystem/filesystem-source-control-ai-targets.ts +++ b/src/main/ipc/filesystem/filesystem-source-control-ai-targets.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../../shared/repo-types' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { getLocalProjectWorktreeGitOptions, type LocalProjectWorktreeGitOptions diff --git a/src/main/ipc/filesystem/wsl-gated-worktree-git-read.ts b/src/main/ipc/filesystem/wsl-gated-worktree-git-read.ts index eb490fa97a6..13faae09d9f 100644 --- a/src/main/ipc/filesystem/wsl-gated-worktree-git-read.ts +++ b/src/main/ipc/filesystem/wsl-gated-worktree-git-read.ts @@ -1,4 +1,4 @@ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { LocalProjectWorktreeGitOptions } from '../../project-runtime-git-options' import { resolveRegisteredWorktreePath } from '../registered-worktree-roots-cache' import { getLocalGitOptionsForRegisteredWorktree } from '../local-worktree-runtime-options' diff --git a/src/main/ipc/floating-workspace-directory.ts b/src/main/ipc/floating-workspace-directory.ts index 3b1c1bdc1c8..9a18398616d 100644 --- a/src/main/ipc/floating-workspace-directory.ts +++ b/src/main/ipc/floating-workspace-directory.ts @@ -4,7 +4,7 @@ import path from 'node:path' import { getAppEnvironment } from '../../shared/app-environment' import type { GlobalSettings } from '../../shared/global-settings-types' import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveFloatingWorkspacePath } from '../persistence/restoring-sessions/floating-workspace-normalization' type FloatingTerminalSettings = Pick diff --git a/src/main/ipc/folder-repo-git-upgrade-lifetime.test.ts b/src/main/ipc/folder-repo-git-upgrade-lifetime.test.ts index c0fc97c5c9b..3e2c46ea9ef 100644 --- a/src/main/ipc/folder-repo-git-upgrade-lifetime.test.ts +++ b/src/main/ipc/folder-repo-git-upgrade-lifetime.test.ts @@ -2,7 +2,7 @@ import { join } from 'node:path' import type { BrowserWindow } from 'electron' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../shared/repo-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const fake = vi.hoisted(() => ({ stat: vi.fn(), diff --git a/src/main/ipc/folder-repo-git-upgrade.ts b/src/main/ipc/folder-repo-git-upgrade.ts index ed31c23e8b2..bc715a7693b 100644 --- a/src/main/ipc/folder-repo-git-upgrade.ts +++ b/src/main/ipc/folder-repo-git-upgrade.ts @@ -2,7 +2,7 @@ import { stat } from 'node:fs/promises' import { join } from 'node:path' import type { BrowserWindow } from 'electron' import type { Repo } from '../../shared/repo-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' import { isFolderRepo } from '../../shared/repo-kind' import { findExtraFolderWorkspaceIds } from '../folder-workspace-meta-presence' diff --git a/src/main/ipc/git-status-upstream-ref-watch-request.test.ts b/src/main/ipc/git-status-upstream-ref-watch-request.test.ts index 2d8d2b1ccec..2cdb8ea5325 100644 --- a/src/main/ipc/git-status-upstream-ref-watch-request.test.ts +++ b/src/main/ipc/git-status-upstream-ref-watch-request.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const mocks = vi.hoisted(() => ({ gitExec: vi.fn(), diff --git a/src/main/ipc/git-status-upstream-ref-watch-request.ts b/src/main/ipc/git-status-upstream-ref-watch-request.ts index 43127e77a92..e947527549e 100644 --- a/src/main/ipc/git-status-upstream-ref-watch-request.ts +++ b/src/main/ipc/git-status-upstream-ref-watch-request.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveGitStatusUpstreamRef } from '../git/status-upstream-ref' import { gitExecFileAsync } from '../git/runner' import { abortSignalWithTimeout } from '../lib/abort-signal-with-timeout' diff --git a/src/main/ipc/github-account-handlers.ts b/src/main/ipc/github-account-handlers.ts index 7d3b7a40625..92439025ef0 100644 --- a/src/main/ipc/github-account-handlers.ts +++ b/src/main/ipc/github-account-handlers.ts @@ -8,7 +8,7 @@ import { validateGhAccountBinding } from '../github/gh-account-binding-inventory' import { getRateLimit } from '../github/rate-limit' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { getCohortAtEmit } from '../telemetry/cohort-classifier' import { track } from '../telemetry/client' import { assertRegisteredGitHubRepo, getGitHubLocalGitOptionArgs } from './github-repo-routing' diff --git a/src/main/ipc/github-issue-mutation-handlers.ts b/src/main/ipc/github-issue-mutation-handlers.ts index dbf441a0ef2..1614b04723b 100644 --- a/src/main/ipc/github-issue-mutation-handlers.ts +++ b/src/main/ipc/github-issue-mutation-handlers.ts @@ -3,7 +3,7 @@ import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types' import type { GitHubIssueUpdate } from '../../shared/issue-mutation-types' import type { TaskSourceContext } from '../../shared/task-source-context' import { addIssueComment, listAssignableUsers, listLabels, updateIssue } from '../github/client' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { assertRegisteredGitHubRepo, getGitHubLocalGitOptionArgs, diff --git a/src/main/ipc/github-pr-mutation-handlers.ts b/src/main/ipc/github-pr-mutation-handlers.ts index 495480cde93..5740cfaef29 100644 --- a/src/main/ipc/github-pr-mutation-handlers.ts +++ b/src/main/ipc/github-pr-mutation-handlers.ts @@ -11,7 +11,7 @@ import { updatePRState, updatePRTitle } from '../github/client' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { assertRegisteredGitHubRepo, getGitHubLocalGitOptionArgs, diff --git a/src/main/ipc/github-pr-read-handlers.ts b/src/main/ipc/github-pr-read-handlers.ts index ade31b1a1bc..e8ae1faf52c 100644 --- a/src/main/ipc/github-pr-read-handlers.ts +++ b/src/main/ipc/github-pr-read-handlers.ts @@ -11,7 +11,7 @@ import { resolveReviewThread, setPRCommentReaction } from '../github/client' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { assertRegisteredGitHubRepo, getGitHubLocalGitOptionArgs, diff --git a/src/main/ipc/github-pr-refresh-handlers.ts b/src/main/ipc/github-pr-refresh-handlers.ts index a136d6c392c..a0eb66b29e9 100644 --- a/src/main/ipc/github-pr-refresh-handlers.ts +++ b/src/main/ipc/github-pr-refresh-handlers.ts @@ -16,7 +16,7 @@ import { setPRRefreshOutcomeObserver, setPRRefreshRegistrationCheck } from '../github/pr-refresh-coordinator' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { applyRegisteredRepoToPRRefreshCandidate, diff --git a/src/main/ipc/github-pr-review-handlers.ts b/src/main/ipc/github-pr-review-handlers.ts index 637eb74c1de..caff4015f63 100644 --- a/src/main/ipc/github-pr-review-handlers.ts +++ b/src/main/ipc/github-pr-review-handlers.ts @@ -2,7 +2,7 @@ import { ipcMain } from 'electron' import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types' import type { TaskSourceContext } from '../../shared/task-source-context' import { addPRReviewComment, addPRReviewCommentReply, setPRFileViewed } from '../github/client' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { assertRegisteredGitHubRepo, getGitHubLocalGitOptionArgs, diff --git a/src/main/ipc/github-repo-routing-twin-host.test.ts b/src/main/ipc/github-repo-routing-twin-host.test.ts index a37e7ef815c..9ffc7b50caa 100644 --- a/src/main/ipc/github-repo-routing-twin-host.test.ts +++ b/src/main/ipc/github-repo-routing-twin-host.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import type { GitHubPRRefreshCandidate } from '../../shared/github/pull-request-refresh-types' import type { Repo } from '../../shared/repo-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' vi.mock('../project-runtime-git-options', () => ({ getLocalProjectGhExecOptions: () => ({}) diff --git a/src/main/ipc/github-repo-routing.ts b/src/main/ipc/github-repo-routing.ts index 3a8765a9d36..0cd8b54cf66 100644 --- a/src/main/ipc/github-repo-routing.ts +++ b/src/main/ipc/github-repo-routing.ts @@ -10,7 +10,7 @@ import { notePRRefreshValidationDenial, type PRRefreshValidationDenialReason } from '../github/pr-refresh-validation-backoff' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { getLocalProjectGhExecOptions, type LocalProjectGhExecOptions diff --git a/src/main/ipc/github-work-item-handlers.ts b/src/main/ipc/github-work-item-handlers.ts index fb9df219dff..09af2f0a6fb 100644 --- a/src/main/ipc/github-work-item-handlers.ts +++ b/src/main/ipc/github-work-item-handlers.ts @@ -12,7 +12,7 @@ import { listWorkItems } from '../github/client' import { getPRFileContents, getWorkItemDetails } from '../github/work-item-details' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { dispatchWorkItem, type WorkItemArgs } from './github-work-item-args' import { assertRegisteredGitHubRepo, diff --git a/src/main/ipc/github.ts b/src/main/ipc/github.ts index bbb1103144f..adbd5c6ee8c 100644 --- a/src/main/ipc/github.ts +++ b/src/main/ipc/github.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { registerGitHubAccountHandlers } from './github-account-handlers' import { registerGitHubIssueMutationHandlers } from './github-issue-mutation-handlers' diff --git a/src/main/ipc/gitlab-ci-job-handlers.ts b/src/main/ipc/gitlab-ci-job-handlers.ts index f80eda00c2a..1132ba08e97 100644 --- a/src/main/ipc/gitlab-ci-job-handlers.ts +++ b/src/main/ipc/gitlab-ci-job-handlers.ts @@ -1,6 +1,6 @@ import { ipcMain } from 'electron' import { toGitLabJobLogExcerptResult } from '../../shared/gitlab-job-log-excerpt' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { getJobTrace, retryJob } from '../gitlab/client' import type { ProjectRef } from '../gitlab/gl-utils' import type { GitLabRepoSelectorArgs } from './gitlab-repo-access' diff --git a/src/main/ipc/gitlab-issue-handlers.ts b/src/main/ipc/gitlab-issue-handlers.ts index 447ce5abeb6..84d28d29e9c 100644 --- a/src/main/ipc/gitlab-issue-handlers.ts +++ b/src/main/ipc/gitlab-issue-handlers.ts @@ -1,7 +1,7 @@ import { ipcMain } from 'electron' import type { GitLabIssueUpdate, GitLabWorkItem } from '../../shared/gitlab-types' import type { TaskSourceContext } from '../../shared/task-source-context' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { normalizeGitLabIssueAssignee, normalizeGitLabIssueListState, diff --git a/src/main/ipc/gitlab-merge-request-mutation-handlers.ts b/src/main/ipc/gitlab-merge-request-mutation-handlers.ts index b47b9523e46..5a3da28f42e 100644 --- a/src/main/ipc/gitlab-merge-request-mutation-handlers.ts +++ b/src/main/ipc/gitlab-merge-request-mutation-handlers.ts @@ -1,7 +1,7 @@ import { ipcMain } from 'electron' import type { GitLabMRInlineCommentInput, GitLabMRUpdate } from '../../shared/gitlab-types' import type { TaskSourceContext } from '../../shared/task-source-context' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { addMRComment, addMRInlineComment, diff --git a/src/main/ipc/gitlab-merge-request-query-handlers.ts b/src/main/ipc/gitlab-merge-request-query-handlers.ts index 2d5e3bb88c7..09fffb0dbf3 100644 --- a/src/main/ipc/gitlab-merge-request-query-handlers.ts +++ b/src/main/ipc/gitlab-merge-request-query-handlers.ts @@ -1,6 +1,6 @@ import { ipcMain } from 'electron' import type { TaskSourceContext } from '../../shared/task-source-context' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { normalizeGitLabMRListState, normalizeGitLabPositiveInteger, diff --git a/src/main/ipc/gitlab-repo-access.ts b/src/main/ipc/gitlab-repo-access.ts index f50ffd86c03..63197c81b6b 100644 --- a/src/main/ipc/gitlab-repo-access.ts +++ b/src/main/ipc/gitlab-repo-access.ts @@ -2,7 +2,7 @@ import { resolve } from 'node:path' import type { Repo } from '../../shared/repo-types' import { getRepoExecutionHostId } from '../../shared/execution-host' import type { TaskSourceContext } from '../../shared/task-source-context' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { LocalGitExecOptions } from '../gitlab/gitlab-project-ref-resolution' import { getLocalProjectWorktreeGitOptions } from '../project-runtime-git-options' import type { HostedReviewExecutionOptions } from '../source-control/hosted-review-git-options' diff --git a/src/main/ipc/gitlab-work-item-handlers.ts b/src/main/ipc/gitlab-work-item-handlers.ts index 798bab86ae7..e53cbc0b5b8 100644 --- a/src/main/ipc/gitlab-work-item-handlers.ts +++ b/src/main/ipc/gitlab-work-item-handlers.ts @@ -1,6 +1,6 @@ import { ipcMain } from 'electron' import type { TaskSourceContext } from '../../shared/task-source-context' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { normalizeGitLabMRListState, normalizeGitLabPositiveInteger, diff --git a/src/main/ipc/gitlab.test.ts b/src/main/ipc/gitlab.test.ts index 074f3de245a..937b96fc004 100644 --- a/src/main/ipc/gitlab.test.ts +++ b/src/main/ipc/gitlab.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' import { toSshExecutionHostId } from '../../shared/execution-host' diff --git a/src/main/ipc/gitlab.ts b/src/main/ipc/gitlab.ts index 42d03705bc0..5dd4608707a 100644 --- a/src/main/ipc/gitlab.ts +++ b/src/main/ipc/gitlab.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { diagnoseAuth, getAuthenticatedViewer, diff --git a/src/main/ipc/hosted-review.ts b/src/main/ipc/hosted-review.ts index 91835949086..284b3d197b4 100644 --- a/src/main/ipc/hosted-review.ts +++ b/src/main/ipc/hosted-review.ts @@ -7,7 +7,7 @@ import type { HostedReviewForBranchArgs } from '../../shared/hosted-review' import type { Repo } from '../../shared/repo-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { createHostedReview, diff --git a/src/main/ipc/local-file-access-resolution-network-path.test.ts b/src/main/ipc/local-file-access-resolution-network-path.test.ts index 0fcb9706e93..7a8d6d33e58 100644 --- a/src/main/ipc/local-file-access-resolution-network-path.test.ts +++ b/src/main/ipc/local-file-access-resolution-network-path.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as NodeFs from 'node:fs' import type * as NodePath from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' // Use Windows paths on every host to prove UNC credential-leak rejection happens before filesystem access. vi.mock('node:path', async () => { diff --git a/src/main/ipc/local-file-access-resolution.test.ts b/src/main/ipc/local-file-access-resolution.test.ts index 0209fd6b475..68ea343bc95 100644 --- a/src/main/ipc/local-file-access-resolution.test.ts +++ b/src/main/ipc/local-file-access-resolution.test.ts @@ -3,7 +3,7 @@ import { homedir, tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as RepoWorktrees from '../repo-worktrees' import { resolveAuthorizedPath } from './filesystem/filesystem-auth' import { diff --git a/src/main/ipc/local-log-tail-lifetime.test.ts b/src/main/ipc/local-log-tail-lifetime.test.ts index 95d320164a8..74167a5b212 100644 --- a/src/main/ipc/local-log-tail-lifetime.test.ts +++ b/src/main/ipc/local-log-tail-lifetime.test.ts @@ -19,7 +19,7 @@ import { getActiveLocalLogTailWatcherCount, registerLocalLogTailHandlers } from './local-log-tail' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: path resolution is mocked, so the store is never read. const NO_STORE = {} as Store diff --git a/src/main/ipc/local-log-tail.test.ts b/src/main/ipc/local-log-tail.test.ts index ce88830304e..909da8a13b9 100644 --- a/src/main/ipc/local-log-tail.test.ts +++ b/src/main/ipc/local-log-tail.test.ts @@ -31,7 +31,7 @@ import { getActiveLocalLogTailWatcherCount, registerLocalLogTailHandlers } from './local-log-tail' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: path resolution is mocked, so the store is never read. const NO_STORE = {} as Store diff --git a/src/main/ipc/local-log-tail.ts b/src/main/ipc/local-log-tail.ts index 85d402910de..a53f79646ac 100644 --- a/src/main/ipc/local-log-tail.ts +++ b/src/main/ipc/local-log-tail.ts @@ -7,7 +7,7 @@ import type { LocalLogTailWatchArgs } from '../../shared/local-log-tail-types' import { readLocalLogTailRange } from '../ai-vault/local-log-tail-reader' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveUserNamedRegularFile } from './local-file-access-resolution' import { abortWhenRendererGone } from './renderer-lifetime-abort' diff --git a/src/main/ipc/localhost-worktree-labels.ts b/src/main/ipc/localhost-worktree-labels.ts index c7cf47df4cc..78fd7727b53 100644 --- a/src/main/ipc/localhost-worktree-labels.ts +++ b/src/main/ipc/localhost-worktree-labels.ts @@ -6,7 +6,7 @@ import { type LocalhostWorktreeLabelResult, type LocalhostWorktreeLabelRoute } from '../../shared/localhost-worktree-labels' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { localhostWorktreeLabelProxy } from '../localhost-worktree-label-proxy' import { getStoreWorkspacePortProbes, diff --git a/src/main/ipc/memory.ts b/src/main/ipc/memory.ts index 0a9a5f74e8a..e9de80a1eae 100644 --- a/src/main/ipc/memory.ts +++ b/src/main/ipc/memory.ts @@ -1,6 +1,6 @@ import { BrowserWindow, ipcMain } from 'electron' import type { MemorySnapshot } from '../../shared/process-stats-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { collectMemorySnapshot } from '../memory/collector' import { diff --git a/src/main/ipc/notebook-project-link.test.ts b/src/main/ipc/notebook-project-link.test.ts index d0036d1d38f..55eb6935b5f 100644 --- a/src/main/ipc/notebook-project-link.test.ts +++ b/src/main/ipc/notebook-project-link.test.ts @@ -3,7 +3,7 @@ import { mkdir, mkdtemp, realpath, rm, symlink, writeFile } from 'node:fs/promis import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as RepoWorktrees from '../repo-worktrees' import { invalidateAuthorizedRootsCache } from './registered-worktree-roots-cache' diff --git a/src/main/ipc/notebook.test.ts b/src/main/ipc/notebook.test.ts index 0a3f711746c..3582ccd68dc 100644 --- a/src/main/ipc/notebook.test.ts +++ b/src/main/ipc/notebook.test.ts @@ -33,7 +33,7 @@ vi.mock('node:fs/promises', async (importOriginal) => { }) import { registerNotebookHandlers } from './notebook' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as FileAccessResolution from './local-file-access-resolution' function fakeKernel() { diff --git a/src/main/ipc/notebook.ts b/src/main/ipc/notebook.ts index 764c4c2f2b8..6323a92d7dd 100644 --- a/src/main/ipc/notebook.ts +++ b/src/main/ipc/notebook.ts @@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto' import { realpath } from 'node:fs/promises' import { dirname } from 'node:path' import { ipcMain, type WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveDesktopAuthorizedPath, resolveUserNamedRegularFile diff --git a/src/main/ipc/notification-sound-ipc.ts b/src/main/ipc/notification-sound-ipc.ts index 8fb327e58b9..f72e03c6efa 100644 --- a/src/main/ipc/notification-sound-ipc.ts +++ b/src/main/ipc/notification-sound-ipc.ts @@ -1,7 +1,7 @@ import { ipcMain } from 'electron' import { readFile, stat } from 'node:fs/promises' import { extname, normalize } from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { NotificationSoundDataResult } from '../../shared/notification-settings-types' import { getSelectedNotificationSoundPath, diff --git a/src/main/ipc/notifications.ts b/src/main/ipc/notifications.ts index 93c82f5bf62..af2da350413 100644 --- a/src/main/ipc/notifications.ts +++ b/src/main/ipc/notifications.ts @@ -1,6 +1,6 @@ import { BrowserWindow, Notification, ipcMain, powerMonitor } from 'electron' import { readDesktopAwayState } from '../notifications/desktop-away-state' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { NotificationDeliveryProbeResult, NotificationDismissResult, diff --git a/src/main/ipc/onboarding.ts b/src/main/ipc/onboarding.ts index 6438e56f0ca..f379805b4e0 100644 --- a/src/main/ipc/onboarding.ts +++ b/src/main/ipc/onboarding.ts @@ -1,5 +1,6 @@ import { ipcMain } from 'electron' -import { sanitizeOnboardingUpdate, type Store } from '../persistence' +import { sanitizeOnboardingUpdate } from '../persistence/applying-settings/onboarding-normalization' +import type { Store } from '../persistence/loading-store/store' import type { OnboardingState } from '../../shared/onboarding-state-types' import type { ChatUiLaunchTipVariant } from '../../shared/native-chat/chat-ui-launch-tip-audience' import { isChatUiLaunchTipDeferredForConsent } from '../telemetry/chat-ui-launch-tip-cohort' diff --git a/src/main/ipc/orca-profiles.ts b/src/main/ipc/orca-profiles.ts index a69f23470c7..da4d87fc28d 100644 --- a/src/main/ipc/orca-profiles.ts +++ b/src/main/ipc/orca-profiles.ts @@ -1,5 +1,5 @@ import { ipcMain, type WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { relaunchApp, type AppRelaunchReason } from '../app-relaunch' import { quitProcess } from '../startup/process-quit-request' import type { diff --git a/src/main/ipc/plugin-frame-entry-ipc.ts b/src/main/ipc/plugin-frame-entry-ipc.ts index d557037ff2c..79dd21ee6bb 100644 --- a/src/main/ipc/plugin-frame-entry-ipc.ts +++ b/src/main/ipc/plugin-frame-entry-ipc.ts @@ -1,7 +1,7 @@ import { ipcMain, type IpcMainInvokeEvent } from 'electron' import { z } from 'zod' import type { PluginFrameEntry } from '../../shared/plugins/frames/plugin-frame-bridge' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { PluginService } from '../plugins/plugin-service' import { bindPluginPanelOwnerLifecycle } from '../plugins/panels/plugin-panel-owner-lifecycle' import { preparePluginFrameGuest } from '../plugins/panels/plugin-frame-guest-sessions' diff --git a/src/main/ipc/plugins-panel-document-lifetime.test.ts b/src/main/ipc/plugins-panel-document-lifetime.test.ts index 1b3427b961e..d1920889ade 100644 --- a/src/main/ipc/plugins-panel-document-lifetime.test.ts +++ b/src/main/ipc/plugins-panel-document-lifetime.test.ts @@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { z } from 'zod' import { pluginManifestSchema } from '../../shared/plugins/manifest/plugin-manifest' import { panelSessionTokenSchema } from '../../shared/plugins/frames/plugin-frame-bridge' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { PluginContentVerifier } from '../plugins/plugin-content-integrity' import type { ValidDiscoveredPlugin } from '../plugins/plugin-discovery' import { PluginPanelController } from '../plugins/panels/plugin-panel-controller' diff --git a/src/main/ipc/plugins.ts b/src/main/ipc/plugins.ts index 27ff8839311..a8f3b1d2594 100644 --- a/src/main/ipc/plugins.ts +++ b/src/main/ipc/plugins.ts @@ -1,6 +1,6 @@ import { ipcMain } from 'electron' import { z } from 'zod' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { PluginHostCallOutcome } from '../../shared/plugins/frames/plugin-protocol' import { getUserPluginsDir, getPluginsDataDir } from '../plugins/plugin-discovery' import { diff --git a/src/main/ipc/preflight.ts b/src/main/ipc/preflight.ts index c4bb55c35de..c1ebf7782c0 100644 --- a/src/main/ipc/preflight.ts +++ b/src/main/ipc/preflight.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { detectRemoteWindowsTerminalCapabilities, runPreflightCheck diff --git a/src/main/ipc/pty/host-env/spawn-cwd-wsl-stopped-folder.test.ts b/src/main/ipc/pty/host-env/spawn-cwd-wsl-stopped-folder.test.ts index 26853c756f1..d794500aba2 100644 --- a/src/main/ipc/pty/host-env/spawn-cwd-wsl-stopped-folder.test.ts +++ b/src/main/ipc/pty/host-env/spawn-cwd-wsl-stopped-folder.test.ts @@ -2,7 +2,7 @@ import type * as FsPromises from 'node:fs/promises' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as BackgroundDistroGateModule from '../../../wsl-background-distro-gate' import type * as WslMoveScopeGuardModule from '../../../persistence/moving-wsl-projects/wsl-move-scope-guard' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { FolderWorkspace } from '../../../../shared/folder-workspace-types' import { folderWorkspaceKey } from '../../../../shared/workspace-scope' import { wslDistroHoldMessage } from '../../../../shared/wsl-distro-stopped-hold' diff --git a/src/main/ipc/pty/host-env/spawn-cwd.ts b/src/main/ipc/pty/host-env/spawn-cwd.ts index 5feca5cf174..764ef4abe8f 100644 --- a/src/main/ipc/pty/host-env/spawn-cwd.ts +++ b/src/main/ipc/pty/host-env/spawn-cwd.ts @@ -5,7 +5,7 @@ import { type ExecutionHostId } from '../../../../shared/execution-host' import { stat } from 'node:fs/promises' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { parseWorkspaceKey } from '../../../../shared/workspace-scope' import { isWslUncPath } from '../../../../shared/wsl-paths' import { diff --git a/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.test.ts b/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.test.ts index ce480041153..674654887d0 100644 --- a/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.test.ts +++ b/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { getDefaultWorkspaceSession } from '../../../../shared/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session-state-types' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { _resetClosedPaneFencesForTests, fencedIfLayoutOwner, diff --git a/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.ts b/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.ts index 9e87f3e9bf4..4e783168de2 100644 --- a/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.ts +++ b/src/main/ipc/pty/ipc/closed-pane-spawn-refusal.ts @@ -1,5 +1,5 @@ import { isClosedPaneFenced } from '../../../persistence/terminal-topology/closed-pane-binding-fence' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { layoutContainsLeafId } from '../../../../shared/workspace-layout/terminal-pane-tree' /** Refuse closed/reclaimed panes before spawning; a later binding refusal cannot undo a startup command. */ diff --git a/src/main/ipc/pty/ipc/leaf-move.ts b/src/main/ipc/pty/ipc/leaf-move.ts index 25677b14030..03bf63ee829 100644 --- a/src/main/ipc/pty/ipc/leaf-move.ts +++ b/src/main/ipc/pty/ipc/leaf-move.ts @@ -1,5 +1,5 @@ import { getPtyIpc } from '../pty-host-bindings' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import { rekeyMovedPaneOwners } from '../../../runtime/moved-pane-owner-rekey' import { diff --git a/src/main/ipc/pty/ipc/renderer-kill.ts b/src/main/ipc/pty/ipc/renderer-kill.ts index 95e93524432..2cccfb54e4e 100644 --- a/src/main/ipc/pty/ipc/renderer-kill.ts +++ b/src/main/ipc/pty/ipc/renderer-kill.ts @@ -5,7 +5,7 @@ import type { import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import { getPtyIpc } from '../pty-host-bindings' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { TerminalIntentionalStopKind } from '../../../runtime/terminal-intentional-stops' import type { IPtyProvider } from '../../../providers/pty-provider-contract' diff --git a/src/main/ipc/pty/ipc/spawn-agent-launch.ts b/src/main/ipc/pty/ipc/spawn-agent-launch.ts index b77fc002f47..4790d4472d4 100644 --- a/src/main/ipc/pty/ipc/spawn-agent-launch.ts +++ b/src/main/ipc/pty/ipc/spawn-agent-launch.ts @@ -8,7 +8,7 @@ import { trackRunningAgentLaunchPane } from '../../../agent-launch/agent-launch- import { agentLaunchTokenFor } from '../../../agent-launch/agent-launch-token' import { resolveUnlaunchedIntent } from '../../../runtime/rpc/methods/agent-launch-intent-resolution' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { resolveEarlyPaneKey } from './spawn-begin' import type { PtyIpcSpawnState } from './spawn-state' import type { PtySpawnIpcArgs } from './spawn-types' diff --git a/src/main/ipc/pty/ipc/spawn-push-target-materialization-real-git.test.ts b/src/main/ipc/pty/ipc/spawn-push-target-materialization-real-git.test.ts index 0ecdf1df5d9..3c4afc037f4 100644 --- a/src/main/ipc/pty/ipc/spawn-push-target-materialization-real-git.test.ts +++ b/src/main/ipc/pty/ipc/spawn-push-target-materialization-real-git.test.ts @@ -8,7 +8,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { GitPushTarget } from '../../../../shared/worktree/types' import type { Repo } from '../../../../shared/repo-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { PtySpawnIpcDeps } from './spawn-types' import { triggerPtySpawnPushTargetMaterialization } from './spawn-push-target-materialization' diff --git a/src/main/ipc/pty/ipc/spawn-types.ts b/src/main/ipc/pty/ipc/spawn-types.ts index e131eb8f9c9..48a433bf32e 100644 --- a/src/main/ipc/pty/ipc/spawn-types.ts +++ b/src/main/ipc/pty/ipc/spawn-types.ts @@ -11,7 +11,7 @@ import type { StartupCommandDelivery } from '../../../../shared/codex-startup-de import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { TerminalStartupCwdMissingDirFallback } from '../../../../shared/terminal-startup-cwd' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { PtySpawnResult } from '../../../providers/pty-provider-contract' import type { CodexHomePtySpawnedLifecycleArgs, diff --git a/src/main/ipc/pty/pane/absent-pane-owner.ts b/src/main/ipc/pty/pane/absent-pane-owner.ts index 897e336420e..2698dc6a4cc 100644 --- a/src/main/ipc/pty/pane/absent-pane-owner.ts +++ b/src/main/ipc/pty/pane/absent-pane-owner.ts @@ -1,6 +1,6 @@ import { toSshExecutionHostId } from '../../../../shared/execution-host' import { UNVERIFIED_PROCESS_EXIT_CODE } from '../../../../shared/terminal-exit-cause' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import { ptyIncarnationById, ptyOwnership } from '../provider/ownership-state' import { clearProviderPtyState } from '../provider/state-cleanup' diff --git a/src/main/ipc/pty/pane/adopt-stable.ts b/src/main/ipc/pty/pane/adopt-stable.ts index ae38099f32b..3c8f76631ff 100644 --- a/src/main/ipc/pty/pane/adopt-stable.ts +++ b/src/main/ipc/pty/pane/adopt-stable.ts @@ -8,7 +8,7 @@ import { import { ptyIncarnationById } from '../provider/ownership-state' import { reconcilePaneOwner } from './stable-pane-attach' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { makePaneKey } from '../../../../shared/stable-pane-id' import { getProvider } from '../provider/registry' import { diff --git a/src/main/ipc/pty/pane/agent-launch-pane-evidence.ts b/src/main/ipc/pty/pane/agent-launch-pane-evidence.ts index ec4d34a6932..557c2bff82f 100644 --- a/src/main/ipc/pty/pane/agent-launch-pane-evidence.ts +++ b/src/main/ipc/pty/pane/agent-launch-pane-evidence.ts @@ -1,6 +1,6 @@ import { makePaneKey } from '../../../../shared/stable-pane-id' import type { IsAgentLaunchPaneLive } from '../../../agent-launch/agent-launch-pane-attachment' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import { resolveStablePaneOwner } from './stable-owner' diff --git a/src/main/ipc/pty/pane/pane-owner-replacement.ts b/src/main/ipc/pty/pane/pane-owner-replacement.ts index dc12592242d..2c20aeac7c8 100644 --- a/src/main/ipc/pty/pane/pane-owner-replacement.ts +++ b/src/main/ipc/pty/pane/pane-owner-replacement.ts @@ -1,6 +1,6 @@ import { toSshExecutionHostId } from '../../../../shared/execution-host' import { parsePaneKey } from '../../../../shared/stable-pane-id' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { PersistPtyBindingArgs } from '../../../persistence/loading-store/pty-binding-persistence' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { ReplacedPaneOwner } from './replaced-pane-owner' diff --git a/src/main/ipc/pty/pane/pane-spawn-operation.ts b/src/main/ipc/pty/pane/pane-spawn-operation.ts index e4abca6338a..5a15a3fa848 100644 --- a/src/main/ipc/pty/pane/pane-spawn-operation.ts +++ b/src/main/ipc/pty/pane/pane-spawn-operation.ts @@ -1,6 +1,6 @@ import { makePaneKey } from '../../../../shared/stable-pane-id' import { toSshExecutionHostId } from '../../../../shared/execution-host' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { ptyBindingIsRefused } from '../../../persistence/loading-store/pty-binding-refusals' import type { PtySpawnOutcome } from '../spawn-outcome' import type { PaneSpawnReservation } from './spawn-reservation' diff --git a/src/main/ipc/pty/pane/spawn-registration.ts b/src/main/ipc/pty/pane/spawn-registration.ts index 317740535a6..e8a77437bdc 100644 --- a/src/main/ipc/pty/pane/spawn-registration.ts +++ b/src/main/ipc/pty/pane/spawn-registration.ts @@ -1,7 +1,7 @@ import { classifyTerminalCreationFailure } from '../../../../shared/terminal-start-failure' import type { PtyRegistrationClaim } from '../../../runtime/runtime-terminal-state-records' import { PaneOwnerContentionError } from './pane-spawn-operation' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { IPtyProvider, PtySpawnResult } from '../../../providers/pty-provider-contract' import { diff --git a/src/main/ipc/pty/pane/stable-owner.ts b/src/main/ipc/pty/pane/stable-owner.ts index 5bd001535f4..7e770451101 100644 --- a/src/main/ipc/pty/pane/stable-owner.ts +++ b/src/main/ipc/pty/pane/stable-owner.ts @@ -3,7 +3,7 @@ import { rollbackWorkspaceSessionAfterFailedAsyncWrite } from '../../../persiste import { cloneWorkspaceSessionState } from '../../../persistence/restoring-sessions/session-owner-fields' import { toSshExecutionHostId } from '../../../../shared/execution-host' import { makePaneKey, parsePaneKey } from '../../../../shared/stable-pane-id' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import { retireTerminalSurfaceFromPersistence } from '../../../runtime/mobile-session-terminal-persistence-retirement' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { diff --git a/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts b/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts index be7a5ec68c1..6df9128fdcb 100644 --- a/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts +++ b/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts @@ -4,7 +4,7 @@ import { withDurableRuntimeStore } from '../../../runtime/runtime-durable-store- import { getDefaultWorkspaceSession } from '../../../../shared/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session-state-types' import { SessionNotFoundError } from '../../../daemon/daemon-errors' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { IPtyProvider } from '../../../providers/pty-provider-contract' import { OrcaRuntimeService } from '../../../runtime/orca-runtime' import { adoptStablePane } from './adopt-stable' diff --git a/src/main/ipc/pty/provider/liveness.ts b/src/main/ipc/pty/provider/liveness.ts index 85daf530ce8..f11d50d85f8 100644 --- a/src/main/ipc/pty/provider/liveness.ts +++ b/src/main/ipc/pty/provider/liveness.ts @@ -1,7 +1,7 @@ import type { AgentSessionOwnerBinding } from '../../../../shared/agent-session/agent-session-host-authority' import { agentSessionOwnerBindingsEqual } from '../../../../shared/claimed-agent-pty-owner' import { addNodePtyRecoveryHint } from '../../../daemon/node-pty-error-hints' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { IPtyProvider } from '../../../providers/pty-provider-contract' import { isCurrentPtyExit, ptyIncarnationById, ptyOwnership } from './ownership-state' import { getRelayPtyId, tryGetProviderForPty } from './registry' diff --git a/src/main/ipc/pty/register-handlers.ts b/src/main/ipc/pty/register-handlers.ts index 0a7f1720d1d..81393eaef28 100644 --- a/src/main/ipc/pty/register-handlers.ts +++ b/src/main/ipc/pty/register-handlers.ts @@ -1,7 +1,7 @@ import { settledDaemonRestart } from '../../daemon/daemon-restart-state' import { getAppEnvironment } from '../../../shared/app-environment' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { GlobalSettings } from '../../../shared/global-settings-types' import { LocalPtyProvider } from '../../providers/local-pty-provider' import type { TerminalStartupCwdMissingDirFallback } from '../../../shared/terminal-startup-cwd' diff --git a/src/main/ipc/pty/register-headless-runtime.ts b/src/main/ipc/pty/register-headless-runtime.ts index 424cb40facd..ccf82872aeb 100644 --- a/src/main/ipc/pty/register-headless-runtime.ts +++ b/src/main/ipc/pty/register-headless-runtime.ts @@ -1,5 +1,5 @@ import type { OrcaRuntimeService } from '../../runtime/orca-runtime' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { CodexHomePtySpawnedLifecycleArgs, diff --git a/src/main/ipc/pty/runtime/controller-deps.ts b/src/main/ipc/pty/runtime/controller-deps.ts index d2667a3ba39..bd9d086859d 100644 --- a/src/main/ipc/pty/runtime/controller-deps.ts +++ b/src/main/ipc/pty/runtime/controller-deps.ts @@ -1,6 +1,6 @@ import type { PtyRendererDelivery } from '../session' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import type { Store } from '../../../persistence' +import type { Store } from '../../../persistence/loading-store/store' import type { IPtyProvider } from '../../../providers/pty-provider-contract' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { TerminalStartupCwdMissingDirFallback } from '../../../../shared/terminal-startup-cwd' diff --git a/src/main/ipc/pty/runtime/spawn-state.ts b/src/main/ipc/pty/runtime/spawn-state.ts index 5340f37d27b..3d15c8113e2 100644 --- a/src/main/ipc/pty/runtime/spawn-state.ts +++ b/src/main/ipc/pty/runtime/spawn-state.ts @@ -16,7 +16,7 @@ import type { ClaudeRuntimeAuthPreparation } from '../../../claude-accounts/runt import type { StablePaneOwner } from '../pane/stable-owner' import type { PaneSpawnReservation } from '../pane/spawn-reservation' import type { AdoptStablePaneResult } from '../ipc/spawn-types' -import type { PtyBindingSourceExpectation } from '../../../persistence' +import type { PtyBindingSourceExpectation } from '../../../persistence/loading-store/store' import type { TerminalPanePlacement } from '../../../../shared/terminal-pane-placement' import type { ResumeSpawnAdmission } from '../host-env/saved-resume-admission' import type { PtyRuntimeControllerDeps } from './controller-deps' diff --git a/src/main/ipc/pty/session.ts b/src/main/ipc/pty/session.ts index 81e9fc3218b..1a34ffd8c44 100644 --- a/src/main/ipc/pty/session.ts +++ b/src/main/ipc/pty/session.ts @@ -1,6 +1,6 @@ import type { BrowserWindow, WebContents } from 'electron' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { IPtyProvider } from '../../providers/pty-provider-contract' import type { PtyModelRestoreReason } from '../../../shared/pty-model-restore-marker' diff --git a/src/main/ipc/pty/spawn-commit-assembly.ts b/src/main/ipc/pty/spawn-commit-assembly.ts index 9e30eb3c833..f708ec00b70 100644 --- a/src/main/ipc/pty/spawn-commit-assembly.ts +++ b/src/main/ipc/pty/spawn-commit-assembly.ts @@ -4,7 +4,7 @@ import { isValidTerminalTabId } from '../../../shared/terminal-tab-id' import type { AgentSessionClaimedSpawnResult } from '../../../shared/agent-session/agent-session-host-authority' import type { GlobalSettings } from '../../../shared/global-settings-types' import type { TuiAgent } from '../../../shared/tui-agent' -import type { Store, PtyBindingSourceExpectation } from '../../persistence' +import type { Store, PtyBindingSourceExpectation } from '../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import type { PtyRegistrationClaim } from '../../runtime/runtime-terminal-state-records' import { markNativeWindowsConptyPty } from '../../runtime/terminal-model-query-authority' diff --git a/src/main/ipc/pty/spawn-commit-binding.ts b/src/main/ipc/pty/spawn-commit-binding.ts index a26731b2ca4..ea23d13e469 100644 --- a/src/main/ipc/pty/spawn-commit-binding.ts +++ b/src/main/ipc/pty/spawn-commit-binding.ts @@ -1,4 +1,4 @@ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { PersistPtyBindingArgs } from '../../persistence/loading-store/pty-binding-persistence' import { ptyBindingIsRefused } from '../../persistence/loading-store/pty-binding-refusals' import { makePaneKey } from '../../../shared/stable-pane-id' diff --git a/src/main/ipc/registered-worktree-root-ownership.test.ts b/src/main/ipc/registered-worktree-root-ownership.test.ts index 2643ab05f5c..c5fe0f0c715 100644 --- a/src/main/ipc/registered-worktree-root-ownership.test.ts +++ b/src/main/ipc/registered-worktree-root-ownership.test.ts @@ -1,6 +1,6 @@ import { join, resolve } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' const mocks = vi.hoisted(() => ({ graph: vi.fn(), stat: vi.fn(), realpath: vi.fn() })) diff --git a/src/main/ipc/registered-worktree-root-refresh.test.ts b/src/main/ipc/registered-worktree-root-refresh.test.ts index f5274c70643..34430a24b55 100644 --- a/src/main/ipc/registered-worktree-root-refresh.test.ts +++ b/src/main/ipc/registered-worktree-root-refresh.test.ts @@ -1,6 +1,6 @@ import { join, resolve } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' const mocks = vi.hoisted(() => ({ graph: vi.fn(), stat: vi.fn(), realpath: vi.fn() })) diff --git a/src/main/ipc/registered-worktree-root-stopped-distro.test.ts b/src/main/ipc/registered-worktree-root-stopped-distro.test.ts index 067130a5c4d..b7f8d1f48c7 100644 --- a/src/main/ipc/registered-worktree-root-stopped-distro.test.ts +++ b/src/main/ipc/registered-worktree-root-stopped-distro.test.ts @@ -1,6 +1,6 @@ import { join, resolve } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' import type { ProjectExecutionRuntimeResolution } from '../../shared/project-execution-runtime' diff --git a/src/main/ipc/registered-worktree-root-wsl-runtime.test.ts b/src/main/ipc/registered-worktree-root-wsl-runtime.test.ts index ab04f583b55..2278a419d30 100644 --- a/src/main/ipc/registered-worktree-root-wsl-runtime.test.ts +++ b/src/main/ipc/registered-worktree-root-wsl-runtime.test.ts @@ -1,6 +1,6 @@ import { join, resolve } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' import type { ProjectExecutionRuntimeResolution } from '../../shared/project-execution-runtime' diff --git a/src/main/ipc/registered-worktree-roots-scoped-invalidation.test.ts b/src/main/ipc/registered-worktree-roots-scoped-invalidation.test.ts index 9b34810c6b6..0cf2b8bde43 100644 --- a/src/main/ipc/registered-worktree-roots-scoped-invalidation.test.ts +++ b/src/main/ipc/registered-worktree-roots-scoped-invalidation.test.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' const mocks = vi.hoisted(() => ({ diff --git a/src/main/ipc/registered-worktree-roots-scoped-invalidation.ts b/src/main/ipc/registered-worktree-roots-scoped-invalidation.ts index 4606340dc5d..0f69767e8c5 100644 --- a/src/main/ipc/registered-worktree-roots-scoped-invalidation.ts +++ b/src/main/ipc/registered-worktree-roots-scoped-invalidation.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../shared/repo-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { invalidateAuthorizedRootsCache, markAuthorizedRootsOwnerDirty diff --git a/src/main/ipc/renderer-shutdown-checkpoint.ts b/src/main/ipc/renderer-shutdown-checkpoint.ts index bf7a6097828..166bf038b2b 100644 --- a/src/main/ipc/renderer-shutdown-checkpoint.ts +++ b/src/main/ipc/renderer-shutdown-checkpoint.ts @@ -8,7 +8,7 @@ import type { SleepingAgentSessionRecord } from '../../shared/agent-session/life import { applyCommandToSession } from '../persistence/terminal-topology/terminal-pane-admission' import type { PersistedUIState } from '../../shared/persisted-ui-state-types' import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isFrozenOrcadSourceSessionPartition } from '../ssh/orcad-retained-source' import { isWslMoveWindowWriteHeld } from '../persistence/moving-wsl-projects/wsl-move-window-write-hold' import { windowViewSaveForMain, type ReconnectFactsFor } from '../persistence/window-save-view' diff --git a/src/main/ipc/repos.ts b/src/main/ipc/repos.ts index 49c024b3054..c3a729a6fe9 100644 --- a/src/main/ipc/repos.ts +++ b/src/main/ipc/repos.ts @@ -1,6 +1,6 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { registerRepoCatalogHandlers } from './repos/repo-catalog-handlers' import { registerProjectHostSetupHandlers } from './repos/project-host-setup-handlers' import { registerRepoCreationHandlers } from './repos/repo-creation-handlers' diff --git a/src/main/ipc/repos/base-ref-query-handlers.ts b/src/main/ipc/repos/base-ref-query-handlers.ts index ffb73eaf427..3adf9a4ce3a 100644 --- a/src/main/ipc/repos/base-ref-query-handlers.ts +++ b/src/main/ipc/repos/base-ref-query-handlers.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { BaseRefDefaultResult, BaseRefSearchResult, Repo } from '../../../shared/repo-types' import { clampRepoSearchRefsLimit, diff --git a/src/main/ipc/repos/folder-workspace-handlers.ts b/src/main/ipc/repos/folder-workspace-handlers.ts index 2d564ca4f85..c0f0fc5ed13 100644 --- a/src/main/ipc/repos/folder-workspace-handlers.ts +++ b/src/main/ipc/repos/folder-workspace-handlers.ts @@ -1,6 +1,6 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { FolderWorkspace } from '../../../shared/folder-workspace-types' import type { FolderWorkspacePathStatusRequest } from '../../../shared/folder-workspace-path-status' import { diff --git a/src/main/ipc/repos/local-repo-registration.test.ts b/src/main/ipc/repos/local-repo-registration.test.ts index a4cc60f5a31..bfed547895b 100644 --- a/src/main/ipc/repos/local-repo-registration.test.ts +++ b/src/main/ipc/repos/local-repo-registration.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../../shared/repo-types' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { addLocalRepoFromPath } from './local-repo-registration' vi.mock('../../repo-icon-autodetect', () => ({ diff --git a/src/main/ipc/repos/local-repo-registration.ts b/src/main/ipc/repos/local-repo-registration.ts index d336890c7ef..4eb10fc8740 100644 --- a/src/main/ipc/repos/local-repo-registration.ts +++ b/src/main/ipc/repos/local-repo-registration.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import { isFolderRepo } from '../../../shared/repo-kind' import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/constants' diff --git a/src/main/ipc/repos/nested-repo-import-handler.ts b/src/main/ipc/repos/nested-repo-import-handler.ts index 7014b5499de..a52a77a166c 100644 --- a/src/main/ipc/repos/nested-repo-import-handler.ts +++ b/src/main/ipc/repos/nested-repo-import-handler.ts @@ -1,7 +1,7 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' import { randomUUID } from 'node:crypto' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import type { ProjectGroupImportResult } from '../../../shared/project-group-types' import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/constants' diff --git a/src/main/ipc/repos/project-group-handlers.ts b/src/main/ipc/repos/project-group-handlers.ts index 3ba0652557a..958a1acf148 100644 --- a/src/main/ipc/repos/project-group-handlers.ts +++ b/src/main/ipc/repos/project-group-handlers.ts @@ -1,6 +1,6 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import type { RepoHostTarget } from '../../../shared/repo-host-identity' import type { NestedRepoScanResult, ProjectGroup } from '../../../shared/project-group-types' diff --git a/src/main/ipc/repos/project-host-setup-handlers.ts b/src/main/ipc/repos/project-host-setup-handlers.ts index fc0a951e3bf..4cde9d6beb0 100644 --- a/src/main/ipc/repos/project-host-setup-handlers.ts +++ b/src/main/ipc/repos/project-host-setup-handlers.ts @@ -1,6 +1,6 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import type { ProjectHostSetupCreateArgs, diff --git a/src/main/ipc/repos/project-host-setup-wsl-move-fence.test.ts b/src/main/ipc/repos/project-host-setup-wsl-move-fence.test.ts index 311cf8fb637..c61ece74c84 100644 --- a/src/main/ipc/repos/project-host-setup-wsl-move-fence.test.ts +++ b/src/main/ipc/repos/project-host-setup-wsl-move-fence.test.ts @@ -4,7 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import { closeTestStores, createStore, testState } from '../../persistence/persistence-test-harness' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import { wslMoveCutoverFixture as cutover } from '../../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { seedWslMoveCutover } from '../../persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding' diff --git a/src/main/ipc/repos/repo-catalog-handlers.ts b/src/main/ipc/repos/repo-catalog-handlers.ts index c758b7d8a88..3121210319f 100644 --- a/src/main/ipc/repos/repo-catalog-handlers.ts +++ b/src/main/ipc/repos/repo-catalog-handlers.ts @@ -1,6 +1,6 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Project, ProjectUpdateArgs } from '../../../shared/project-types' import { getRepoExecutionHostId, diff --git a/src/main/ipc/repos/repo-clone-lifecycle.ts b/src/main/ipc/repos/repo-clone-lifecycle.ts index de20b9c0ebb..4ea936fadae 100644 --- a/src/main/ipc/repos/repo-clone-lifecycle.ts +++ b/src/main/ipc/repos/repo-clone-lifecycle.ts @@ -3,7 +3,7 @@ import { ipcMain } from 'electron' import type { ChildProcess } from 'node:child_process' import { randomUUID } from 'node:crypto' import { mkdir } from 'node:fs/promises' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import { isFolderRepo } from '../../../shared/repo-kind' import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/constants' diff --git a/src/main/ipc/repos/repo-creation-handlers.ts b/src/main/ipc/repos/repo-creation-handlers.ts index c543995a761..c06ab73649e 100644 --- a/src/main/ipc/repos/repo-creation-handlers.ts +++ b/src/main/ipc/repos/repo-creation-handlers.ts @@ -4,7 +4,7 @@ import { randomUUID } from 'node:crypto' import { access, mkdir, readdir, rm } from 'node:fs/promises' import { homedir } from 'node:os' import { isAbsolute, join } from 'node:path' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import { DEFAULT_REPO_BADGE_COLOR, getDefaultWorkspaceDir } from '../../../shared/constants' import { normalizeRuntimePathForComparison } from '../../../shared/cross-platform-path' diff --git a/src/main/ipc/repos/repo-ipc-wsl-move-fence.test.ts b/src/main/ipc/repos/repo-ipc-wsl-move-fence.test.ts index 634c38465e1..dcd98ce5ab4 100644 --- a/src/main/ipc/repos/repo-ipc-wsl-move-fence.test.ts +++ b/src/main/ipc/repos/repo-ipc-wsl-move-fence.test.ts @@ -4,7 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import { closeTestStores, createStore, testState } from '../../persistence/persistence-test-harness' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import { wslMoveCutoverFixture as cutover } from '../../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { seedWslMoveCutover } from '../../persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding' diff --git a/src/main/ipc/repos/repo-update-handler.ts b/src/main/ipc/repos/repo-update-handler.ts index 10a1e3ca20b..a08ac66b852 100644 --- a/src/main/ipc/repos/repo-update-handler.ts +++ b/src/main/ipc/repos/repo-update-handler.ts @@ -1,6 +1,6 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repo-types' import type { RepoHostTarget } from '../../../shared/repo-host-identity' import { isFolderRepo } from '../../../shared/repo-kind' diff --git a/src/main/ipc/repos/sparse-preset-handlers.ts b/src/main/ipc/repos/sparse-preset-handlers.ts index 161be939df0..2d8c714ad8a 100644 --- a/src/main/ipc/repos/sparse-preset-handlers.ts +++ b/src/main/ipc/repos/sparse-preset-handlers.ts @@ -1,7 +1,7 @@ import type { BrowserWindow } from 'electron' import { ipcMain } from 'electron' import { randomUUID } from 'node:crypto' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { SparsePreset } from '../../../shared/worktree/create-types' import { normalizeSparseDirectories } from '../sparse-checkout-directories' import { assertWslMoveProjectWritable } from '../../persistence/moving-wsl-projects/wsl-move-scope-guard' diff --git a/src/main/ipc/runtime-environments/runtime-environment-connectivity-handlers.ts b/src/main/ipc/runtime-environments/runtime-environment-connectivity-handlers.ts index 5d930d9b832..f725d15fde9 100644 --- a/src/main/ipc/runtime-environments/runtime-environment-connectivity-handlers.ts +++ b/src/main/ipc/runtime-environments/runtime-environment-connectivity-handlers.ts @@ -21,7 +21,7 @@ import { } from './runtime-environment-host-service-ops' import type { RuntimeRpcResponse } from '../../../shared/runtime-rpc-envelope' import type { RuntimeStatus } from '../../../shared/runtime-types' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { retireRemovedRuntimeEnvironment } from './runtime-environment-removal-cleanup' import { readSettingsWithRuntimeEnvironmentPreference } from './runtime-environment-preference' import { verifyAndAddRuntimeEnvironmentFromPairingCode } from './runtime-environment-pairing-verification' diff --git a/src/main/ipc/runtime-environments/runtime-environment-preference.test.ts b/src/main/ipc/runtime-environments/runtime-environment-preference.test.ts index a6f8c9962af..14086102101 100644 --- a/src/main/ipc/runtime-environments/runtime-environment-preference.test.ts +++ b/src/main/ipc/runtime-environments/runtime-environment-preference.test.ts @@ -11,7 +11,7 @@ import { removeEnvironment } from '../../../shared/runtime-environment-store' import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { readSettingsWithRuntimeEnvironmentPreference, watchRuntimeEnvironmentPreference diff --git a/src/main/ipc/runtime-environments/runtime-environment-preference.ts b/src/main/ipc/runtime-environments/runtime-environment-preference.ts index a03df597834..25d8a26bb8b 100644 --- a/src/main/ipc/runtime-environments/runtime-environment-preference.ts +++ b/src/main/ipc/runtime-environments/runtime-environment-preference.ts @@ -3,7 +3,7 @@ import { getEnvironmentStorePath, listEnvironments } from '../../../shared/runtime-environment-store' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { watchFileAcrossReplacement } from '../rebinding-file-watch' type PreferenceStore = Pick diff --git a/src/main/ipc/runtime-environments/runtime-environments.ts b/src/main/ipc/runtime-environments/runtime-environments.ts index 0b06b0119d9..d3e3e5129c0 100644 --- a/src/main/ipc/runtime-environments/runtime-environments.ts +++ b/src/main/ipc/runtime-environments/runtime-environments.ts @@ -8,7 +8,7 @@ import { import { ipcMain } from 'electron' import { getRuntimeEnvironmentRegistryRoot } from './runtime-environment-registry-root' import { listEnvironments } from '../../../shared/runtime-environment-store' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { recordRemoteLayoutFrame } from '../../remote-layout-snapshot/remote-layout-snapshot-recorder' import { isRuntimeEnvironmentManuallyDisconnected, diff --git a/src/main/ipc/session.ts b/src/main/ipc/session.ts index a0c3fddf3f7..f555c60982b 100644 --- a/src/main/ipc/session.ts +++ b/src/main/ipc/session.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { parseTerminalSurfaceCloseTarget } from '../../shared/terminal-surface-close-target' import { isFrozenOrcadSourceSessionPartition } from '../ssh/orcad-retained-source' diff --git a/src/main/ipc/settings.ts b/src/main/ipc/settings.ts index 0485dce246f..7f94044bac2 100644 --- a/src/main/ipc/settings.ts +++ b/src/main/ipc/settings.ts @@ -1,6 +1,6 @@ import { getClaudeAgentViewService } from '../claude/agent-view-service' import { app, BrowserWindow, ipcMain, nativeTheme } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GlobalSettings } from '../../shared/global-settings-types' import type { PersistedState } from '../../shared/persisted-state-types' import { listSystemFontFamilies } from '../system-fonts' diff --git a/src/main/ipc/shell.ts b/src/main/ipc/shell.ts index c60d4232d94..09252b1a63e 100644 --- a/src/main/ipc/shell.ts +++ b/src/main/ipc/shell.ts @@ -13,7 +13,7 @@ import { repoIconPickFailure, type RepoIconPickResult } from '../../shared/repo-icon-pick-failure-copy' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { EXTERNAL_EDITOR_CLI_COMMAND, launchExternalEditor, diff --git a/src/main/ipc/skill-delete/handlers.ts b/src/main/ipc/skill-delete/handlers.ts index 91cb6642548..742f53e3b06 100644 --- a/src/main/ipc/skill-delete/handlers.ts +++ b/src/main/ipc/skill-delete/handlers.ts @@ -1,5 +1,5 @@ import { app } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import { SkillDeleteRequestSchema, diff --git a/src/main/ipc/skills.ts b/src/main/ipc/skills.ts index 5f7107c70c6..2b9dc562df5 100644 --- a/src/main/ipc/skills.ts +++ b/src/main/ipc/skills.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { SkillDiscoveryTargetSchema, diff --git a/src/main/ipc/source-control-ai-linked-issue.test.ts b/src/main/ipc/source-control-ai-linked-issue.test.ts index fd46bbb293b..f9a5ea99b02 100644 --- a/src/main/ipc/source-control-ai-linked-issue.test.ts +++ b/src/main/ipc/source-control-ai-linked-issue.test.ts @@ -1,6 +1,6 @@ import path from 'node:path' import { describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveSourceControlAiLinkedIssue } from './source-control-ai-linked-issue' const LOCAL_PATH = path.resolve('/workspace/repo-feature') diff --git a/src/main/ipc/source-control-ai-linked-issue.ts b/src/main/ipc/source-control-ai-linked-issue.ts index 67110ef0c0c..71698e6a7ef 100644 --- a/src/main/ipc/source-control-ai-linked-issue.ts +++ b/src/main/ipc/source-control-ai-linked-issue.ts @@ -1,5 +1,5 @@ import { resolve } from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isLinkedIssueNumber } from '../../shared/source-control-ai-action-variables' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' diff --git a/src/main/ipc/speech-worker-exit-lifetime.test.ts b/src/main/ipc/speech-worker-exit-lifetime.test.ts index 62ccfa7d968..846e18d2c5c 100644 --- a/src/main/ipc/speech-worker-exit-lifetime.test.ts +++ b/src/main/ipc/speech-worker-exit-lifetime.test.ts @@ -1,7 +1,7 @@ import { EventEmitter } from 'node:events' import type * as FsPromises from 'node:fs/promises' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { ModelManager } from '../speech/model-manager' import type { SttService } from '../speech/stt-service' import type { RuntimeStore } from '../runtime/runtime-store-contract' diff --git a/src/main/ipc/speech.ts b/src/main/ipc/speech.ts index c20425843cb..dfb7b94a3df 100644 --- a/src/main/ipc/speech.ts +++ b/src/main/ipc/speech.ts @@ -12,7 +12,7 @@ import { hasOpenAiSpeechApiKey, saveOpenAiSpeechApiKey } from '../speech/openai-api-key-store' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' export function registerSpeechHandlers(store: Store): void { ipcMain.handle('speech:getCatalog', () => { diff --git a/src/main/ipc/ssh/ssh-ipc-context.ts b/src/main/ipc/ssh/ssh-ipc-context.ts index d702124204a..d1eefb56c6a 100644 --- a/src/main/ipc/ssh/ssh-ipc-context.ts +++ b/src/main/ipc/ssh/ssh-ipc-context.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { SshConnectionManager } from '../../ssh/connection/ssh-connection-manager' import type { SshPortForwardManager } from '../../ssh/port-forwarding/ssh-port-forward' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' diff --git a/src/main/ipc/ssh/ssh.ts b/src/main/ipc/ssh/ssh.ts index 141f455d6ba..68a0f1ee60f 100644 --- a/src/main/ipc/ssh/ssh.ts +++ b/src/main/ipc/ssh/ssh.ts @@ -1,5 +1,5 @@ import { ipcMain, type BrowserWindow } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { SshConnectionStore } from '../../ssh/connection/ssh-connection-store' import { awaitSignInForCredentialHosts } from './ssh-sign-in-requirement' import { diff --git a/src/main/ipc/startup-notification-registration.ts b/src/main/ipc/startup-notification-registration.ts index 13f665767d0..14fead68ac9 100644 --- a/src/main/ipc/startup-notification-registration.ts +++ b/src/main/ipc/startup-notification-registration.ts @@ -1,6 +1,6 @@ import { Notification } from 'electron' import { translateMain } from '../i18n/main-i18n' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { activeNotifications, logNativeNotificationFailure } from './native-notification-lifecycle' import { recordNotificationDeliveryOutcome } from './notification-permission-probe' import { openNotificationSystemSettings } from './notification-system-settings-link' diff --git a/src/main/ipc/telemetry.test.ts b/src/main/ipc/telemetry.test.ts index 2e84703b8ff..f12546785c2 100644 --- a/src/main/ipc/telemetry.test.ts +++ b/src/main/ipc/telemetry.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { GlobalSettings } from '../../shared/global-settings-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const handlers = new Map unknown>() const { diff --git a/src/main/ipc/telemetry.ts b/src/main/ipc/telemetry.ts index 863555b4c14..d687b48c313 100644 --- a/src/main/ipc/telemetry.ts +++ b/src/main/ipc/telemetry.ts @@ -11,7 +11,7 @@ import { import { getCohortAtEmit } from '../telemetry/cohort-classifier' import { getOnboardingCohortAtEmit } from '../telemetry/onboarding-cohort-classifier' import { resolveConsent, type ConsentState } from '../telemetry/consent' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isCohortExtendedEvent, isOnboardingEvent } from '../../shared/telemetry-events' import type { EventName, EventProps, OptInVia } from '../../shared/telemetry-events' diff --git a/src/main/ipc/ui.ts b/src/main/ipc/ui.ts index 0fbe7b35175..6b3acd1882e 100644 --- a/src/main/ipc/ui.ts +++ b/src/main/ipc/ui.ts @@ -6,7 +6,7 @@ import { } from '../../shared/jira/jira-saved-filters' import { JiraSavedFilterMutationParam } from '../../shared/rpc-contract/jira-saved-filter-params' import { BrowserWindow, ipcMain, webContents, type WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { PersistedUIState } from '../../shared/persisted-ui-state-types' import { isFeatureInteractionId } from '../../shared/feature-interactions' import { isWslMoveWindowWriteHeld } from '../persistence/moving-wsl-projects/wsl-move-window-write-hold' diff --git a/src/main/ipc/workspace-cleanup-broad-scan.test.ts b/src/main/ipc/workspace-cleanup-broad-scan.test.ts index 193f90cf4be..721ca593383 100644 --- a/src/main/ipc/workspace-cleanup-broad-scan.test.ts +++ b/src/main/ipc/workspace-cleanup-broad-scan.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import path from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as RepoWorktreesModule from '../repo-worktrees' import type { GitStatusResult } from '../../shared/git-status-types' import type { Repo } from '../../shared/repo-types' diff --git a/src/main/ipc/workspace-cleanup-disconnected-ssh.ts b/src/main/ipc/workspace-cleanup-disconnected-ssh.ts index 06e7a836147..c6dd14b4311 100644 --- a/src/main/ipc/workspace-cleanup-disconnected-ssh.ts +++ b/src/main/ipc/workspace-cleanup-disconnected-ssh.ts @@ -1,6 +1,6 @@ import { basename } from 'node:path' import { getRepoExecutionHostId, normalizeExecutionHostId } from '../../shared/execution-host' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Repo } from '../../shared/repo-types' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import { diff --git a/src/main/ipc/workspace-cleanup-execution-host-routing.test.ts b/src/main/ipc/workspace-cleanup-execution-host-routing.test.ts index 6b623447e3d..162d07bfc5d 100644 --- a/src/main/ipc/workspace-cleanup-execution-host-routing.test.ts +++ b/src/main/ipc/workspace-cleanup-execution-host-routing.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GitStatusResult } from '../../shared/git-status-types' import type { Repo } from '../../shared/repo-types' import type { WorktreeMeta } from '../../shared/worktree/meta-types' diff --git a/src/main/ipc/workspace-cleanup-folder-workspaces.ts b/src/main/ipc/workspace-cleanup-folder-workspaces.ts index 7b3ec47b8ed..79cff68b351 100644 --- a/src/main/ipc/workspace-cleanup-folder-workspaces.ts +++ b/src/main/ipc/workspace-cleanup-folder-workspaces.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { createFolderWorktree } from '../repo-worktrees' import type { Repo } from '../../shared/repo-types' import type { Worktree } from '../../shared/worktree/types' diff --git a/src/main/ipc/workspace-cleanup-scan.ts b/src/main/ipc/workspace-cleanup-scan.ts index 853addc6e70..f91e4aef9c1 100644 --- a/src/main/ipc/workspace-cleanup-scan.ts +++ b/src/main/ipc/workspace-cleanup-scan.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isFolderRepo } from '../../shared/repo-kind' import { readWorktreeMetaForHost } from '../persistence/host-qualified-worktree-meta' import type { Repo } from '../../shared/repo-types' diff --git a/src/main/ipc/workspace-cleanup-snapshot-ipc.test.ts b/src/main/ipc/workspace-cleanup-snapshot-ipc.test.ts index 628940b9723..3e617cb9b1d 100644 --- a/src/main/ipc/workspace-cleanup-snapshot-ipc.test.ts +++ b/src/main/ipc/workspace-cleanup-snapshot-ipc.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const { persistScanResultMock, readScanSnapshotMock, scanWorkspaceCleanupMock } = vi.hoisted( () => ({ diff --git a/src/main/ipc/workspace-cleanup-worktree-listing.ts b/src/main/ipc/workspace-cleanup-worktree-listing.ts index 3ee9fef6155..81016c69603 100644 --- a/src/main/ipc/workspace-cleanup-worktree-listing.ts +++ b/src/main/ipc/workspace-cleanup-worktree-listing.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { listRepoWorktrees, createFolderWorktree } from '../repo-worktrees' import type { Repo } from '../../shared/repo-types' import type { GitWorktreeInfo } from '../../shared/worktree/types' diff --git a/src/main/ipc/workspace-cleanup.test.ts b/src/main/ipc/workspace-cleanup.test.ts index 6277f2cbbdd..73148581cbb 100644 --- a/src/main/ipc/workspace-cleanup.test.ts +++ b/src/main/ipc/workspace-cleanup.test.ts @@ -1,7 +1,7 @@ import path from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { DiffComment } from '../../shared/diff-comment-types' import type { GitStatusResult } from '../../shared/git-status-types' import type { Repo } from '../../shared/repo-types' diff --git a/src/main/ipc/workspace-cleanup.ts b/src/main/ipc/workspace-cleanup.ts index 562aaefe849..aaadaab4f11 100644 --- a/src/main/ipc/workspace-cleanup.ts +++ b/src/main/ipc/workspace-cleanup.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { WORKSPACE_CLEANUP_CLASSIFIER_VERSION, type WorkspaceCleanupDismissArgs, diff --git a/src/main/ipc/workspace-ports.ts b/src/main/ipc/workspace-ports.ts index ac0fd463d18..2ac0c481668 100644 --- a/src/main/ipc/workspace-ports.ts +++ b/src/main/ipc/workspace-ports.ts @@ -1,5 +1,5 @@ import { BrowserWindow, ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { advertisedUrlWatcher, type AdvertisedUrlWatcher } from '../ports/advertised-url-watcher' import type { WorkspacePortAdvertisedUrlChangedEvent, diff --git a/src/main/ipc/workspace-space-window.ts b/src/main/ipc/workspace-space-window.ts index 89f6abaff5e..9b86fde7ef4 100644 --- a/src/main/ipc/workspace-space-window.ts +++ b/src/main/ipc/workspace-space-window.ts @@ -9,7 +9,7 @@ import { safelyRevealWindow } from '../window/focus-existing-window' import { isBackgroundLaunch } from '../window/foreground-activation-policy' import { normalizeExecutionHostId } from '../../shared/execution-host' import { isWorkspaceSpaceChange } from '../../shared/workspace-space-change' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' export function registerWorkspaceSpaceWindowHandlers(store: Store): void { for (const channel of [ diff --git a/src/main/ipc/workspace-space.test.ts b/src/main/ipc/workspace-space.test.ts index 4b88b35fe57..edd288d6dba 100644 --- a/src/main/ipc/workspace-space.test.ts +++ b/src/main/ipc/workspace-space.test.ts @@ -4,7 +4,7 @@ import type { WorkspaceSpaceAnalyzeResult, WorkspaceSpaceScanProgress } from '../../shared/workspace-space-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const { handlers, diff --git a/src/main/ipc/workspace-space.ts b/src/main/ipc/workspace-space.ts index 28abf650950..b5b77ae1ea0 100644 --- a/src/main/ipc/workspace-space.ts +++ b/src/main/ipc/workspace-space.ts @@ -1,5 +1,5 @@ import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { WorkspaceSpaceAnalysis, WorkspaceSpaceAnalyzeResult, diff --git a/src/main/ipc/worktree-base-directory-watch-targets.ts b/src/main/ipc/worktree-base-directory-watch-targets.ts index 2635f4b6df5..46e417ba42e 100644 --- a/src/main/ipc/worktree-base-directory-watch-targets.ts +++ b/src/main/ipc/worktree-base-directory-watch-targets.ts @@ -1,6 +1,6 @@ import { normalize } from 'node:path' import { realpath, stat } from 'node:fs/promises' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GlobalSettings } from '../../shared/global-settings-types' import type { Repo } from '../../shared/repo-types' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' diff --git a/src/main/ipc/worktree-base-directory-watcher.ts b/src/main/ipc/worktree-base-directory-watcher.ts index 909b4439d94..3200d574a29 100644 --- a/src/main/ipc/worktree-base-directory-watcher.ts +++ b/src/main/ipc/worktree-base-directory-watcher.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { createWorktreeHeadIdentityRefreshState, disposeWorktreeHeadIdentityRefreshState, diff --git a/src/main/ipc/worktree-push-target-cleanup.ts b/src/main/ipc/worktree-push-target-cleanup.ts index 09d17e01a5b..d8e4d61e226 100644 --- a/src/main/ipc/worktree-push-target-cleanup.ts +++ b/src/main/ipc/worktree-push-target-cleanup.ts @@ -1,6 +1,6 @@ // Prune unused fork remotes after removal; reconciliation reuses these ownership and usage predicates. -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import type { GitPushTarget } from '../../shared/worktree/types' import { parseGitHubOwnerRepo } from '../github/gh-utils' diff --git a/src/main/ipc/worktree-remote.ts b/src/main/ipc/worktree-remote.ts index 985b95d1af1..0b98127f487 100644 --- a/src/main/ipc/worktree-remote.ts +++ b/src/main/ipc/worktree-remote.ts @@ -7,7 +7,7 @@ import { getStoredRepoExecutionHostId } from '../repo-execution-host' import type { BrowserWindow } from 'electron' import { existsSync } from 'node:fs' import { randomUUID } from 'node:crypto' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GitAdmissionTier } from '../../shared/rpc-contract/git-admission-tier-params' import type { Repo } from '../../shared/repo-types' import type { diff --git a/src/main/ipc/worktrees-removal-recovery.test.ts b/src/main/ipc/worktrees-removal-recovery.test.ts index c04f7c1b7a8..672dc0a4724 100644 --- a/src/main/ipc/worktrees-removal-recovery.test.ts +++ b/src/main/ipc/worktrees-removal-recovery.test.ts @@ -16,7 +16,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import type { GitWorktreeInfo } from '../../shared/worktree/types' import type { RedactableSpan } from '../observability/redactor' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { _resetTracerForTests, setActiveSink } from '../observability/tracer' import { agentHookServer } from '../agent-hooks/server' import { makePaneKey } from '../../shared/stable-pane-id' diff --git a/src/main/ipc/wsl-drive-project-handlers.ts b/src/main/ipc/wsl-drive-project-handlers.ts index 0fb4655254b..daf057c2047 100644 --- a/src/main/ipc/wsl-drive-project-handlers.ts +++ b/src/main/ipc/wsl-drive-project-handlers.ts @@ -4,7 +4,7 @@ */ import { join } from 'node:path' import { ipcMain } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { registerWslDriveUncConversionHandlers } from './wsl-drive-unc-conversion-handlers' import { gitExecFileAsync } from '../git/command-runner/git-exec-file' diff --git a/src/main/ipc/wsl-drive-unc-conversion-handlers.ts b/src/main/ipc/wsl-drive-unc-conversion-handlers.ts index 62a5a2a630d..941f941c567 100644 --- a/src/main/ipc/wsl-drive-unc-conversion-handlers.ts +++ b/src/main/ipc/wsl-drive-unc-conversion-handlers.ts @@ -14,7 +14,7 @@ import { gitExecFileAsync } from '../git/command-runner/git-exec-file' import { readProfileProjectTransferState } from '../orca-profiles/profile-project-domain-state' import { getOrcaProfileListState } from '../orca-profiles/profile-index-store' import { getProfileUserDataPath } from '../orca-profiles/profile-storage-paths' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { pauseWslMoveScope } from '../persistence/moving-wsl-projects/wsl-move-driver-pause' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { quitProcess } from '../startup/process-quit-request' diff --git a/src/main/ipc/wsl-host-handlers.ts b/src/main/ipc/wsl-host-handlers.ts index 5b6464c78b5..bff9cc45ca7 100644 --- a/src/main/ipc/wsl-host-handlers.ts +++ b/src/main/ipc/wsl-host-handlers.ts @@ -2,7 +2,7 @@ import { ipcMain } from 'electron' import { abortWhenRendererGone } from './renderer-lifetime-abort' import { noteWslHostUserAction } from '../wsl/wsl-host-user-actions' import type { WslHostAddResult, WslHostCapability } from '../../shared/wsl-host-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { createWslHostConnector } from '../wsl/wsl-host-connector' import { releaseUnwantedWslHolders, wslHolderKeepPolicy } from '../wsl/wsl-orphan-holder-release' import { diff --git a/src/main/ipc/wsl-move-distro-in-use.ts b/src/main/ipc/wsl-move-distro-in-use.ts index e83d9978f55..aed4e172775 100644 --- a/src/main/ipc/wsl-move-distro-in-use.ts +++ b/src/main/ipc/wsl-move-distro-in-use.ts @@ -2,7 +2,7 @@ import { readWslHostDeployments } from '../../shared/wsl-host-deployment-store' import { wslMoveJournalKey } from '../../shared/wsl-move/wsl-move-cutover' import { parseWslUncPath } from '../../shared/wsl-paths' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isLocalWslMoveRow, wslMoveHostDistro diff --git a/src/main/ipc/wsl-move-driver-wiring.ts b/src/main/ipc/wsl-move-driver-wiring.ts index 6e3a33b5e31..1ad523e90ed 100644 --- a/src/main/ipc/wsl-move-driver-wiring.ts +++ b/src/main/ipc/wsl-move-driver-wiring.ts @@ -21,7 +21,7 @@ import { } from '../daemon/daemon-provider-state' import { HistoryReader } from '../daemon/history-reader' import { orcadMigrationDestinationFor } from '../managed-server/lifecycle/orcad-runtime-conversion-wiring' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { exportWslMoveManifest } from '../persistence/moving-wsl-projects/wsl-move-manifest-export' import { ensureWslMoveDestinationBrowserLogins } from '../persistence/moving-wsl-projects/wsl-move-browser-cookie-copy' import { activeBrowserRoutePartitionOrcaProfileId } from '../browser/browser-route-partition-binding-runtime' diff --git a/src/main/ipc/wsl-move-orchestrator-wiring.ts b/src/main/ipc/wsl-move-orchestrator-wiring.ts index 15a754d5fd4..bfd62703de7 100644 --- a/src/main/ipc/wsl-move-orchestrator-wiring.ts +++ b/src/main/ipc/wsl-move-orchestrator-wiring.ts @@ -10,7 +10,7 @@ import { type WslMoveOrchestratorRecord, type WslMoveOrchestratorUserAction } from '../../shared/wsl-move/wsl-move-orchestrator-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { listWslMoveCutoverChain } from '../persistence/moving-wsl-projects/wsl-move-cutover-journal' import { moveProjectsToWslHost, diff --git a/src/main/ipc/wsl-move-undo-wiring.ts b/src/main/ipc/wsl-move-undo-wiring.ts index 2eee8940412..66b4fb7b6cc 100644 --- a/src/main/ipc/wsl-move-undo-wiring.ts +++ b/src/main/ipc/wsl-move-undo-wiring.ts @@ -5,7 +5,7 @@ import { z } from 'zod' import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' import type { WslMoveCutover } from '../../shared/wsl-move/wsl-move-cutover' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { wslMoveDesktopRewriteContext } from '../persistence/moving-wsl-projects/wsl-move-desktop-rewrite' import { probeWslMoveHostCopies, diff --git a/src/main/local-project-runtime-resolution.ts b/src/main/local-project-runtime-resolution.ts index 74d2415d03b..41d204ad4dc 100644 --- a/src/main/local-project-runtime-resolution.ts +++ b/src/main/local-project-runtime-resolution.ts @@ -1,4 +1,4 @@ -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { GlobalSettings } from '../shared/global-settings-types' import type { Project } from '../shared/project-types' import type { Repo } from '../shared/repo-types' diff --git a/src/main/macos-tcc-prompt-notice.test.ts b/src/main/macos-tcc-prompt-notice.test.ts index 2190f13211b..2b02ff71ecf 100644 --- a/src/main/macos-tcc-prompt-notice.test.ts +++ b/src/main/macos-tcc-prompt-notice.test.ts @@ -9,7 +9,9 @@ const watchOptions: { onPrompt: () => void }[] = [] vi.mock('./codex-accounts/fs-utils', () => ({ writeFileAtomically: (...args: unknown[]) => writeFileAtomically(...args) })) -vi.mock('./persistence', () => ({ getCanonicalUserDataPath: () => '/tmp/orca-tcc-notice-test' })) +vi.mock('./persistence/loading-store/user-data-path', () => ({ + getCanonicalUserDataPath: () => '/tmp/orca-tcc-notice-test' +})) vi.mock('./macos-tcc-log-stream-orphans', () => ({ reclaimOrphanedTccLogStreams: vi.fn(async () => 0) })) diff --git a/src/main/macos-tcc-prompt-notice.ts b/src/main/macos-tcc-prompt-notice.ts index 7f282dcebda..e2961fd2add 100644 --- a/src/main/macos-tcc-prompt-notice.ts +++ b/src/main/macos-tcc-prompt-notice.ts @@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' import type { BrowserWindow } from 'electron' import { writeFileAtomically } from './codex-accounts/fs-utils' -import { getCanonicalUserDataPath } from './persistence' +import { getCanonicalUserDataPath } from './persistence/loading-store/user-data-path' import { MacosTccPromptWatch } from './macos-tcc-prompt-watch' import { reclaimOrphanedTccLogStreams } from './macos-tcc-log-stream-orphans' diff --git a/src/main/media/local-preview-grant-file.ts b/src/main/media/local-preview-grant-file.ts index 45a2f3b6544..d7e95cd5f53 100644 --- a/src/main/media/local-preview-grant-file.ts +++ b/src/main/media/local-preview-grant-file.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { filePreviewForPath, isDocumentPreview } from '../../shared/file-preview-kind' import { resolveLocalFileRequestPath } from '../ipc/local-file-access-resolution' import { openLocalRegularFile } from '../ipc/filesystem/local-regular-file-read' diff --git a/src/main/media/media-preview-protocol.test.ts b/src/main/media/media-preview-protocol.test.ts index 64367470d79..3e03ba10850 100644 --- a/src/main/media/media-preview-protocol.test.ts +++ b/src/main/media/media-preview-protocol.test.ts @@ -3,7 +3,7 @@ import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RemoteFilePreviewAddress } from '../../shared/remote-file-preview-address' const { authorize } = vi.hoisted(() => ({ diff --git a/src/main/media/media-preview-protocol.ts b/src/main/media/media-preview-protocol.ts index 4a7d859e50e..81b67d2184d 100644 --- a/src/main/media/media-preview-protocol.ts +++ b/src/main/media/media-preview-protocol.ts @@ -1,5 +1,5 @@ import { protocol } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { MEDIA_PREVIEW_SCHEME } from '../../shared/media-file-extensions' import { filePreviewForPath, diff --git a/src/main/media/preview-grant-range-read.test.ts b/src/main/media/preview-grant-range-read.test.ts index 27f001fc7e6..73889655a23 100644 --- a/src/main/media/preview-grant-range-read.test.ts +++ b/src/main/media/preview-grant-range-read.test.ts @@ -3,7 +3,7 @@ import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' vi.mock('electron', () => ({ protocol: { handle: vi.fn() } })) vi.mock('../ipc/local-file-access-resolution', () => ({ diff --git a/src/main/media/preview-grant-registry.ts b/src/main/media/preview-grant-registry.ts index c93d11108a6..2b40a15c637 100644 --- a/src/main/media/preview-grant-registry.ts +++ b/src/main/media/preview-grant-registry.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' import type { WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { LocalFileAccess } from '../../shared/local-file-access' import { MEDIA_PREVIEW_SCHEME } from '../../shared/media-file-extensions' import { isDocumentPreview, type FilePreview } from '../../shared/file-preview-kind' diff --git a/src/main/memory/hydrate-local-pty-registry-folder-workspaces.test.ts b/src/main/memory/hydrate-local-pty-registry-folder-workspaces.test.ts index 7ea813dcbd1..886dfb44d75 100644 --- a/src/main/memory/hydrate-local-pty-registry-folder-workspaces.test.ts +++ b/src/main/memory/hydrate-local-pty-registry-folder-workspaces.test.ts @@ -1,7 +1,7 @@ import { beforeEach, expect, it, vi } from 'vitest' import type { FolderWorkspace } from '../../shared/folder-workspace-types' import type { SessionInfo } from '../daemon/types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const getDaemonProviderMock = vi.fn() vi.mock('../daemon/daemon-provider-state', () => ({ diff --git a/src/main/memory/hydrate-local-pty-registry.test.ts b/src/main/memory/hydrate-local-pty-registry.test.ts index e9a561c29b1..394dc09cf94 100644 --- a/src/main/memory/hydrate-local-pty-registry.test.ts +++ b/src/main/memory/hydrate-local-pty-registry.test.ts @@ -4,7 +4,7 @@ import type { Repo } from '../../shared/repo-types' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import type { SessionInfo } from '../daemon/types' import type { DaemonPtyAdapter } from '../daemon/daemon-pty-adapter' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { hydrateLocalPtyRegistryAtBoot as HydrateFn } from './hydrate-local-pty-registry' import type { listRegisteredPtys as ListFn, diff --git a/src/main/memory/hydrate-local-pty-registry.ts b/src/main/memory/hydrate-local-pty-registry.ts index 44b4767e813..a451b059a42 100644 --- a/src/main/memory/hydrate-local-pty-registry.ts +++ b/src/main/memory/hydrate-local-pty-registry.ts @@ -9,7 +9,7 @@ import { getDaemonProvider } from '../daemon/daemon-provider-state' import { getAllDaemonAdapters, type DaemonProvider } from '../daemon/daemon-provider-routing' import type { SessionInfo } from '../daemon/types' import { isFolderWorkspaceIdForRepo } from '../ipc/worktrees/folder-workspace-model' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { readAllWorktreeMetaForHost } from '../persistence/host-qualified-worktree-meta' import { getLocalProjectWorktreeGitOptions } from '../project-runtime-git-options' import { listLocalRepoWorktreesStrict } from '../repo-worktrees' diff --git a/src/main/memory/memory-snapshot-buckets.ts b/src/main/memory/memory-snapshot-buckets.ts index 6a8f8f6218e..e04e545052a 100644 --- a/src/main/memory/memory-snapshot-buckets.ts +++ b/src/main/memory/memory-snapshot-buckets.ts @@ -1,7 +1,7 @@ import { basename } from 'node:path' import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import type { SessionMemory } from '../../shared/process-stats-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { parseWorkspaceKey } from '../../shared/workspace-scope' import { folderWorkspaceToWorktree } from '../../shared/folder-workspace-worktree' diff --git a/src/main/muse-usage/store.ts b/src/main/muse-usage/store.ts index cc8722643ab..82207b0e367 100644 --- a/src/main/muse-usage/store.ts +++ b/src/main/muse-usage/store.ts @@ -10,7 +10,7 @@ import type { MuseUsageSnapshot, MuseUsageSummary } from '../../shared/muse-usage-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { UsageProviderStoreLifecycle } from '../usage/usage-provider-store-lifecycle' import { splitUsageCacheFileViaWorker } from '../usage/usage-scan-worker-spawn' import { filterUsageDaily, filterUsageSessions } from '../usage/usage-scope-filters' diff --git a/src/main/opencode-usage/store.ts b/src/main/opencode-usage/store.ts index 7b3b656a88f..dee4c5b3eb6 100644 --- a/src/main/opencode-usage/store.ts +++ b/src/main/opencode-usage/store.ts @@ -11,7 +11,7 @@ import type { OpenCodeUsageSnapshot, OpenCodeUsageSummary } from '../../shared/opencode-usage-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OpenCodeUsageDailyAggregate, OpenCodeUsagePersistedState, diff --git a/src/main/orca-profiles/profile-persistence-deadline.ts b/src/main/orca-profiles/profile-persistence-deadline.ts index 73280914e4a..316b7871235 100644 --- a/src/main/orca-profiles/profile-persistence-deadline.ts +++ b/src/main/orca-profiles/profile-persistence-deadline.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { ProfileStateMaintenance } from '../persistence/loading-store/profile-state-authority' import type { ProfileStateMaintenanceOptions } from '../persistence/loading-store/profile-state-maintenance' diff --git a/src/main/orcad/orcad-account-services.ts b/src/main/orcad/orcad-account-services.ts index 507aefadd62..a29591c297f 100644 --- a/src/main/orcad/orcad-account-services.ts +++ b/src/main/orcad/orcad-account-services.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import type { GetSelectedCodexHomePath, diff --git a/src/main/orcad/orcad-automations.ts b/src/main/orcad/orcad-automations.ts index 5b252f5ddd2..e235234cf51 100644 --- a/src/main/orcad/orcad-automations.ts +++ b/src/main/orcad/orcad-automations.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { createRuntimeAutomationService } from '../automations/runtime-automation-service' import { isFinalAutomationRunStatus } from '../../shared/automations-types' diff --git a/src/main/persistence.ts b/src/main/persistence.ts deleted file mode 100644 index bb037900c7c..00000000000 --- a/src/main/persistence.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { Store, type PtyBindingSourceExpectation } from './persistence/loading-store/store' -export { - getCanonicalUserDataPath, - initDataPath, - migrateMobilePairingDataToCanonicalUserDataPath -} from './persistence/loading-store/user-data-path' -export { normalizeRightSidebarTab } from './persistence/applying-settings/ui-selection-normalization' -export { sanitizeOnboardingUpdate } from './persistence/applying-settings/onboarding-normalization' diff --git a/src/main/persistence/migrating-orcad-catalog/orcad-source-catalog.ts b/src/main/persistence/migrating-orcad-catalog/orcad-source-catalog.ts index e9643ff9a6b..dcf0d2fb093 100644 --- a/src/main/persistence/migrating-orcad-catalog/orcad-source-catalog.ts +++ b/src/main/persistence/migrating-orcad-catalog/orcad-source-catalog.ts @@ -2,7 +2,7 @@ import type { OrcadMigrationCatalogPayload } from '../../../shared/orcad-migrati import { withoutOrcadRetainedMarker } from '../../../shared/orcad-retained-marker' import type { ProjectGroup } from '../../../shared/project-group-types' import type { SshTarget } from '../../../shared/ssh-types' -import type { Store } from '../../persistence' +import type { Store } from '../loading-store/store' import { orcadSourceFolderWorkspaceIds, repoBelongsToOrcadSource } from './orcad-source-ownership' type OrcadSourceCatalogStore = Pick diff --git a/src/main/persistence/moving-wsl-projects/wsl-move-main-rewrite-stores.test.ts b/src/main/persistence/moving-wsl-projects/wsl-move-main-rewrite-stores.test.ts index b80787d654b..6af92769c17 100644 --- a/src/main/persistence/moving-wsl-projects/wsl-move-main-rewrite-stores.test.ts +++ b/src/main/persistence/moving-wsl-projects/wsl-move-main-rewrite-stores.test.ts @@ -8,7 +8,7 @@ import type { PersistedState } from '../../../shared/persisted-state-types' import type { Tab } from '../../../shared/tab-types' import { WSL_HOSTS_INTERNAL_GATE_ENV } from '../../../shared/wsl-host-internal-gate' import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' -import type { Store } from '../../persistence' +import type { Store } from '../loading-store/store' import { closeTestStores, createStore, diff --git a/src/main/persistence/moving-wsl-projects/wsl-move-manifest-export.ts b/src/main/persistence/moving-wsl-projects/wsl-move-manifest-export.ts index a406b279346..e22b75f0e2a 100644 --- a/src/main/persistence/moving-wsl-projects/wsl-move-manifest-export.ts +++ b/src/main/persistence/moving-wsl-projects/wsl-move-manifest-export.ts @@ -29,7 +29,7 @@ import { rewriteOrcadMigrationPayloadPaths, rewriteOrcadMigrationWorktreeId } from '../../ssh/orcad-migration-path-rewrite' -import type { Store } from '../../persistence' +import type { Store } from '../loading-store/store' import { compareKeys } from '../migrating-orcad-catalog/orcad-source-key-order' import { wslUncPathToLinux } from '../../../shared/wsl-paths' import { createUncToLinuxPathRewriter } from './wsl-move-path-rewriter' diff --git a/src/main/persistence/moving-wsl-projects/wsl-move-registry-complete.test.ts b/src/main/persistence/moving-wsl-projects/wsl-move-registry-complete.test.ts index 7ee5a506d7c..4c24b5a70b9 100644 --- a/src/main/persistence/moving-wsl-projects/wsl-move-registry-complete.test.ts +++ b/src/main/persistence/moving-wsl-projects/wsl-move-registry-complete.test.ts @@ -7,7 +7,7 @@ import { toRuntimeExecutionHostId } from '../../../shared/execution-host' import { WSL_HOSTS_INTERNAL_GATE_ENV } from '../../../shared/wsl-host-internal-gate' import { WSL_MOVE_RENDERER_REWRITE_STORE_IDS } from '../../../shared/wsl-move/wsl-move-renderer-rewrite-types' import { worktreeWorkspaceKey } from '../../../shared/workspace-scope' -import type { Store } from '../../persistence' +import type { Store } from '../loading-store/store' import { closeTestStores, createStore, testState, writeDataFile } from '../persistence-test-harness' import { wslMoveCutoverFixture } from '../__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { wslMoverProfile } from '../__fixtures__/wsl-mover/wsl-mover-profiles' diff --git a/src/main/persistence/moving-wsl-projects/wsl-move-retention.test.ts b/src/main/persistence/moving-wsl-projects/wsl-move-retention.test.ts index d6b73d205db..e19fddfedbf 100644 --- a/src/main/persistence/moving-wsl-projects/wsl-move-retention.test.ts +++ b/src/main/persistence/moving-wsl-projects/wsl-move-retention.test.ts @@ -8,7 +8,7 @@ import type { PersistedState } from '../../../shared/persisted-state-types' import type { ProjectGroup } from '../../../shared/project-group-types' import type { Repo } from '../../../shared/repo-types' import { WSL_HOSTS_INTERNAL_GATE_ENV } from '../../../shared/wsl-host-internal-gate' -import type { Store } from '../../persistence' +import type { Store } from '../loading-store/store' import { closeTestStores, createStore, diff --git a/src/main/persistence/moving-wsl-projects/wsl-move-session-freeze.test.ts b/src/main/persistence/moving-wsl-projects/wsl-move-session-freeze.test.ts index c70603b863f..dc892462672 100644 --- a/src/main/persistence/moving-wsl-projects/wsl-move-session-freeze.test.ts +++ b/src/main/persistence/moving-wsl-projects/wsl-move-session-freeze.test.ts @@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../../shared/constants' import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' import type { Tab, TabGroup } from '../../../shared/tab-types' -import type { Store } from '../../persistence' +import type { Store } from '../loading-store/store' import { closeTestStores, createStore, testState } from '../persistence-test-harness' import { makeTerminalTab } from '../persistence-session-fixtures' import { wslMoveCutoverFixture as cutover } from '../__fixtures__/wsl-mover/wsl-move-cutover-fixture' diff --git a/src/main/plugins/panels/plugin-external-open-consent.ts b/src/main/plugins/panels/plugin-external-open-consent.ts index 397cfb42775..b6c0dc2b3a1 100644 --- a/src/main/plugins/panels/plugin-external-open-consent.ts +++ b/src/main/plugins/panels/plugin-external-open-consent.ts @@ -1,5 +1,5 @@ import { dialog, type BrowserWindow } from 'electron' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { translateMain } from '../../i18n/main-i18n' type GrantStore = Pick diff --git a/src/main/plugins/panels/plugin-frame-desktop-services.ts b/src/main/plugins/panels/plugin-frame-desktop-services.ts index 10676c17f5d..98b5c736e32 100644 --- a/src/main/plugins/panels/plugin-frame-desktop-services.ts +++ b/src/main/plugins/panels/plugin-frame-desktop-services.ts @@ -9,7 +9,7 @@ import type { PluginDesktopFrameServices } from '../workers/plugin-host-method-b import { PluginHostCallError, type PluginHostCallScope } from '../workers/plugin-host-call-scope' import { markPluginSavedFileAsDownloaded } from './plugin-save-as-download-mark' import { confirmPluginExternalOpen } from './plugin-external-open-consent' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { translateMain } from '../../i18n/main-i18n' import { blockedPluginSaveAsExtension } from '../../../shared/plugins/frames/plugin-save-as-extensions' diff --git a/src/main/plugins/plugin-enablement.test.ts b/src/main/plugins/plugin-enablement.test.ts index 2ec334aa26b..0814b09fc4d 100644 --- a/src/main/plugins/plugin-enablement.test.ts +++ b/src/main/plugins/plugin-enablement.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest' import { getDefaultSettings } from '../../shared/constants' import type { GlobalSettings } from '../../shared/global-settings-types' import { pluginManifestSchema } from '../../shared/plugins/manifest/plugin-manifest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { applyPluginConsent } from './plugin-enablement' import type { ValidDiscoveredPlugin } from './plugin-discovery' import type { PluginService } from './plugin-service' diff --git a/src/main/plugins/plugin-enablement.ts b/src/main/plugins/plugin-enablement.ts index b3a0547ff74..29b22965bea 100644 --- a/src/main/plugins/plugin-enablement.ts +++ b/src/main/plugins/plugin-enablement.ts @@ -2,7 +2,7 @@ import { normalizePluginConsents, normalizePluginIdList } from '../../shared/plugins/approval/plugin-consent-state' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { PluginService } from './plugin-service' import type { PluginConsentRequest } from '../../shared/plugins/approval/plugin-consent-request' import { verifyDeclarativePluginContent } from './plugin-declarative-content-integrity' diff --git a/src/main/plugins/plugin-removal-settings.ts b/src/main/plugins/plugin-removal-settings.ts index c33e75da17b..10f22ff8996 100644 --- a/src/main/plugins/plugin-removal-settings.ts +++ b/src/main/plugins/plugin-removal-settings.ts @@ -1,6 +1,6 @@ import { pluginThemeSettingsAfterRemoval } from '../../shared/plugin-theme-settings' import { normalizePluginIdList } from '../../shared/plugins/approval/plugin-consent-state' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' /** Forgets a removed plugin's consent, disabled flag, allowed external hosts and theme choices. */ export function clearRemovedPluginSettings( diff --git a/src/main/ports/ssh-advertised-url-enrichment.ts b/src/main/ports/ssh-advertised-url-enrichment.ts index 08863a103c5..360f38a8071 100644 --- a/src/main/ports/ssh-advertised-url-enrichment.ts +++ b/src/main/ports/ssh-advertised-url-enrichment.ts @@ -1,7 +1,7 @@ // Remote PTY banners are workspace-keyed; SSH listener scans are connection-scoped. import type { DetectedPort, EnrichedDetectedPort, PortForwardEntry } from '../../shared/ssh-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { splitWorktreeId } from '../../shared/worktree/id' import { advertisedUrlWatcher, diff --git a/src/main/ports/workspace-port-ownership.ts b/src/main/ports/workspace-port-ownership.ts index 733cb6130a8..2d80f57682f 100644 --- a/src/main/ports/workspace-port-ownership.ts +++ b/src/main/ports/workspace-port-ownership.ts @@ -1,5 +1,5 @@ import path from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { isFolderRepo } from '../../shared/repo-kind' import type { diff --git a/src/main/project-runtime-git-options.test.ts b/src/main/project-runtime-git-options.test.ts index b37b16adbea..fe41ad96779 100644 --- a/src/main/project-runtime-git-options.test.ts +++ b/src/main/project-runtime-git-options.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { Project } from '../shared/project-types' import type { Repo } from '../shared/repo-types' import { diff --git a/src/main/project-runtime-read-git-options-opt-in.test.ts b/src/main/project-runtime-read-git-options-opt-in.test.ts index 960be12be24..f16a2d0a156 100644 --- a/src/main/project-runtime-read-git-options-opt-in.test.ts +++ b/src/main/project-runtime-read-git-options-opt-in.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { Project } from '../shared/project-types' import type { Repo } from '../shared/repo-types' import { WSL_HOSTS_INTERNAL_GATE_ENV } from '../shared/wsl-host-internal-gate' diff --git a/src/main/provider-account-services.ts b/src/main/provider-account-services.ts index 841362c2b27..7d810e1da6d 100644 --- a/src/main/provider-account-services.ts +++ b/src/main/provider-account-services.ts @@ -1,6 +1,6 @@ // Keep Electron imports out: both desktop and orcad bundle these account services. import { getClaudeAgentViewService } from './claude/agent-view-service' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { RateLimitService } from './rate-limits/service' import { CodexRuntimeHomeService } from './codex-accounts/runtime-home-service' import { CodexAccountService } from './codex-accounts/service' diff --git a/src/main/provisioned-root-checkout.ts b/src/main/provisioned-root-checkout.ts index 2fb2b46b73a..1941899d988 100644 --- a/src/main/provisioned-root-checkout.ts +++ b/src/main/provisioned-root-checkout.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { Repo } from '../shared/repo-types' import type { CreateWorktreeArgs } from '../shared/worktree/create-types' import type { ExecutionHostId } from '../shared/execution-host' diff --git a/src/main/provisioned-root-ssh-adoption.ts b/src/main/provisioned-root-ssh-adoption.ts index eb0d44ae591..8cdff43a503 100644 --- a/src/main/provisioned-root-ssh-adoption.ts +++ b/src/main/provisioned-root-ssh-adoption.ts @@ -1,4 +1,4 @@ -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { Repo } from '../shared/repo-types' import type { AdoptProvisionedRootArgs, diff --git a/src/main/runtime/automation-change-publication.test.ts b/src/main/runtime/automation-change-publication.test.ts index 45a5ce20005..07cde7e7829 100644 --- a/src/main/runtime/automation-change-publication.test.ts +++ b/src/main/runtime/automation-change-publication.test.ts @@ -15,7 +15,8 @@ import type { AutomationsChangedPayload } from '../../shared/runtime-client-even import { AUTOMATION_OWNER_CONFLICT_CODES } from '../../shared/automation-owner-conflict' import type { AutomationOwnerPrecondition } from '../../shared/automation-owner-precondition' import { AutomationService } from '../automations/service' -import { Store, initDataPath } from '../persistence' +import { Store } from '../persistence/loading-store/store' +import { initDataPath } from '../persistence/loading-store/user-data-path' import { OrcaRuntimeService } from './orca-runtime' import * as worktreeChangeInvalidators from '../ipc/worktree-change-invalidators' import { _resetTerminalModelQueryAuthorityForTest } from './terminal-model-query-authority' diff --git a/src/main/runtime/mobile-pairing-userdata-path.test.ts b/src/main/runtime/mobile-pairing-userdata-path.test.ts index 9599166c554..b5781ab50c3 100644 --- a/src/main/runtime/mobile-pairing-userdata-path.test.ts +++ b/src/main/runtime/mobile-pairing-userdata-path.test.ts @@ -43,7 +43,8 @@ describe('mobile pairing userData path stability', () => { it('keeps returning the path captured before app.setName changes resolution', async () => { appState.userData = canonicalDir - const { initDataPath, getCanonicalUserDataPath } = await import('../persistence') + const { initDataPath, getCanonicalUserDataPath } = + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir @@ -55,7 +56,8 @@ describe('mobile pairing userData path stability', () => { it('writes DeviceRegistry + E2EE keypair under the canonical path, not the late one', async () => { appState.userData = canonicalDir - const { initDataPath, getCanonicalUserDataPath } = await import('../persistence') + const { initDataPath, getCanonicalUserDataPath } = + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir @@ -80,7 +82,7 @@ describe('mobile pairing userData path stability', () => { initDataPath, getCanonicalUserDataPath, migrateMobilePairingDataToCanonicalUserDataPath - } = await import('../persistence') + } = await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir @@ -119,7 +121,7 @@ describe('mobile pairing userData path stability', () => { it('skips legacy migration when only part of the canonical credential pair exists', async () => { appState.userData = canonicalDir const { initDataPath, migrateMobilePairingDataToCanonicalUserDataPath } = - await import('../persistence') + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir @@ -174,7 +176,7 @@ describe('mobile pairing userData path stability', () => { try { appState.userData = canonicalDir const { initDataPath, migrateMobilePairingDataToCanonicalUserDataPath } = - await import('../persistence') + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir @@ -196,7 +198,7 @@ describe('mobile pairing userData path stability', () => { // Case-insensitive filesystems can resolve both paths identically; never copy a file onto itself. appState.userData = canonicalDir const { initDataPath, migrateMobilePairingDataToCanonicalUserDataPath } = - await import('../persistence') + await import('../persistence/loading-store/user-data-path') initDataPath() const devices = JSON.stringify([ @@ -211,7 +213,7 @@ describe('mobile pairing userData path stability', () => { it('no-ops on a fresh install with no legacy pairing files to migrate', async () => { appState.userData = canonicalDir const { initDataPath, migrateMobilePairingDataToCanonicalUserDataPath } = - await import('../persistence') + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir @@ -223,7 +225,8 @@ describe('mobile pairing userData path stability', () => { it('a previously paired device is still found after a restart on the canonical path', async () => { appState.userData = canonicalDir { - const { initDataPath, getCanonicalUserDataPath } = await import('../persistence') + const { initDataPath, getCanonicalUserDataPath } = + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir const { DeviceRegistry } = await import('./device-registry') @@ -232,7 +235,8 @@ describe('mobile pairing userData path stability', () => { vi.resetModules() appState.userData = canonicalDir - const { initDataPath, getCanonicalUserDataPath } = await import('../persistence') + const { initDataPath, getCanonicalUserDataPath } = + await import('../persistence/loading-store/user-data-path') initDataPath() appState.userData = lateDir const { DeviceRegistry } = await import('./device-registry') diff --git a/src/main/runtime/orca-runtime-test-fixtures.spec.ts b/src/main/runtime/orca-runtime-test-fixtures.spec.ts index c2538525f32..3fc9c498483 100644 --- a/src/main/runtime/orca-runtime-test-fixtures.spec.ts +++ b/src/main/runtime/orca-runtime-test-fixtures.spec.ts @@ -33,7 +33,7 @@ import type { import { InMemoryOrchestrationMessages } from './orca-runtime-test-orchestration-messages.spec' import type { OrchestrationDb } from './orchestration/db' import type { PtyProcessInspection } from '../providers/pty-process-inspection' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { HostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' type RuntimeService = InstanceType diff --git a/src/main/runtime/orcad-migration-catalog-import.ts b/src/main/runtime/orcad-migration-catalog-import.ts index f11a5b19b66..debe7ebed11 100644 --- a/src/main/runtime/orcad-migration-catalog-import.ts +++ b/src/main/runtime/orcad-migration-catalog-import.ts @@ -6,7 +6,7 @@ import type { OrcadMigrationManifest } from '../../shared/orcad-migration/orcad-migration-manifest' import type { OrcadMigrationBlobDescriptor } from '../../shared/orcad-migration/orcad-migration-blob-transfer' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' /** A moved history waits while a shell runs in its worktree: that shell would overwrite it. */ type WorktreeHasLiveShells = (worktreeId: string) => boolean diff --git a/src/main/runtime/repo-worktree-row-resolution.test.ts b/src/main/runtime/repo-worktree-row-resolution.test.ts index 76afb18f2b5..828bf0a355e 100644 --- a/src/main/runtime/repo-worktree-row-resolution.test.ts +++ b/src/main/runtime/repo-worktree-row-resolution.test.ts @@ -7,7 +7,7 @@ import type { Repo } from '../../shared/repo-types' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import type { WorktreeLineage } from '../../shared/worktree/lineage-types' import type { GitWorktreeInfo, Worktree } from '../../shared/worktree/types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { mergeWorktreeMetaForWrite } from '../persistence/loading-store/worktree-meta-write-normalization' import { buildDetectedGitWorktrees } from '../ipc/worktrees/listing/ssh-worktree-fallback' import { diff --git a/src/main/runtime/runtime-created-worktree-terminal-target.ts b/src/main/runtime/runtime-created-worktree-terminal-target.ts index 102d777cb86..2937ad9a005 100644 --- a/src/main/runtime/runtime-created-worktree-terminal-target.ts +++ b/src/main/runtime/runtime-created-worktree-terminal-target.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { Worktree } from '../../shared/worktree/types' import type { ResolvedWorktree } from './runtime-worktree-path-identity' import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' diff --git a/src/main/runtime/runtime-failed-local-worktree-removal.test.ts b/src/main/runtime/runtime-failed-local-worktree-removal.test.ts index 0d8d12fe198..d85d4b8885e 100644 --- a/src/main/runtime/runtime-failed-local-worktree-removal.test.ts +++ b/src/main/runtime/runtime-failed-local-worktree-removal.test.ts @@ -11,7 +11,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../shared/repo-types' import type { GitPushTarget } from '../../shared/worktree/types' import { removeTree } from '../../shared/windows-transient-lock-removal' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as HostTreeRemoval from '../host-tree-removal' import { removeHostTree } from '../host-tree-removal' import { listWorktreesStrict, removeWorktree } from '../git/worktree' diff --git a/src/main/runtime/runtime-interrupted-local-worktree-removal.test.ts b/src/main/runtime/runtime-interrupted-local-worktree-removal.test.ts index 2712560cee4..533cf7c6a95 100644 --- a/src/main/runtime/runtime-interrupted-local-worktree-removal.test.ts +++ b/src/main/runtime/runtime-interrupted-local-worktree-removal.test.ts @@ -14,7 +14,7 @@ import { getProjectHostSetupWorktreeMeta } from '../../shared/project-host-setup import { buildDetectedGitWorktrees } from '../ipc/worktrees/listing/ssh-worktree-fallback' import { removeTree } from '../../shared/windows-transient-lock-removal' import type { RemoveWorktreeResult } from '../../shared/worktree/create-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as HostTreeRemoval from '../host-tree-removal' import { removeHostTree } from '../host-tree-removal' import * as nativeFs from '../asar-transparent-fs' diff --git a/src/main/runtime/runtime-local-worktree-create-pr-conflicts.test.ts b/src/main/runtime/runtime-local-worktree-create-pr-conflicts.test.ts index 54ea1a1a9cb..3ee724885da 100644 --- a/src/main/runtime/runtime-local-worktree-create-pr-conflicts.test.ts +++ b/src/main/runtime/runtime-local-worktree-create-pr-conflicts.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { resolve } from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import type { HostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' import type { Repo } from '../../shared/repo-types' diff --git a/src/main/runtime/runtime-local-worktree-create-test-harness.ts b/src/main/runtime/runtime-local-worktree-create-test-harness.ts index ede95c23f89..343de2294df 100644 --- a/src/main/runtime/runtime-local-worktree-create-test-harness.ts +++ b/src/main/runtime/runtime-local-worktree-create-test-harness.ts @@ -1,6 +1,6 @@ import { expect, vi, type Mock } from 'vitest' import { resolve } from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import type { HostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' import type { Repo } from '../../shared/repo-types' diff --git a/src/main/runtime/runtime-managed-worktree-metadata-wsl-move.test.ts b/src/main/runtime/runtime-managed-worktree-metadata-wsl-move.test.ts index 10915c15d6d..059c17524e3 100644 --- a/src/main/runtime/runtime-managed-worktree-metadata-wsl-move.test.ts +++ b/src/main/runtime/runtime-managed-worktree-metadata-wsl-move.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { wslMoveCutoverFixture as cutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { seedWslMoveCutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding' import { diff --git a/src/main/runtime/runtime-pty-controller-contract.ts b/src/main/runtime/runtime-pty-controller-contract.ts index 16fd7315221..955000c6a98 100644 --- a/src/main/runtime/runtime-pty-controller-contract.ts +++ b/src/main/runtime/runtime-pty-controller-contract.ts @@ -18,7 +18,7 @@ import type { AgentProviderSessionMetadata } from '../../shared/agent-session/li import type { TuiAgent } from '../../shared/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' import type { PtyIncarnationId } from '../../shared/pty-incarnation' -import type { PtyBindingSourceExpectation } from '../persistence' +import type { PtyBindingSourceExpectation } from '../persistence/loading-store/store' import type { TerminalPanePlacement } from '../../shared/terminal-pane-placement' import type { ExecutionHostId } from '../../shared/execution-host' import type { diff --git a/src/main/runtime/runtime-store-contract.ts b/src/main/runtime/runtime-store-contract.ts index 6218aa8af6e..9ce7e4233b9 100644 --- a/src/main/runtime/runtime-store-contract.ts +++ b/src/main/runtime/runtime-store-contract.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GlobalSettings } from '../../shared/global-settings-types' import type { VoiceSettings } from '../../shared/speech-types' diff --git a/src/main/runtime/runtime-terminal-orphan-adoption-rollback.test.ts b/src/main/runtime/runtime-terminal-orphan-adoption-rollback.test.ts index 01259368030..fcf97f2c421 100644 --- a/src/main/runtime/runtime-terminal-orphan-adoption-rollback.test.ts +++ b/src/main/runtime/runtime-terminal-orphan-adoption-rollback.test.ts @@ -19,7 +19,7 @@ import { leaf } from '../../shared/workspace-layout/workspace-layout-session.test-fixture' import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { ProfileStateSqliteAuthority } from '../persistence/profile-state/profile-state-sqlite-authority' import { adoptRuntimeTerminalOrphansFromInventory } from './runtime-terminal-orphan-adoption' import type { RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' diff --git a/src/main/runtime/runtime-witnessed-worktree-scan.ts b/src/main/runtime/runtime-witnessed-worktree-scan.ts index f00045b78be..959cf9d97e5 100644 --- a/src/main/runtime/runtime-witnessed-worktree-scan.ts +++ b/src/main/runtime/runtime-witnessed-worktree-scan.ts @@ -6,7 +6,7 @@ import { isLocalWorktreeScanGenerationCurrent } from '../local-worktree-scan-generation' import { getLocalProjectWorktreeGitOptions } from '../project-runtime-git-options' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { RuntimeStore } from './runtime-store-contract' import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' diff --git a/src/main/runtime/wsl-moved-project-chat-runtime.test.ts b/src/main/runtime/wsl-moved-project-chat-runtime.test.ts index 96c0ad068d5..97d2e08bdf2 100644 --- a/src/main/runtime/wsl-moved-project-chat-runtime.test.ts +++ b/src/main/runtime/wsl-moved-project-chat-runtime.test.ts @@ -8,7 +8,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../shared/repo-types' import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' import { getDefaultWorkspaceSession } from '../../shared/constants' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness' import { makeTerminalTab } from '../persistence/persistence-session-fixtures' import { wslMoveCutoverFixture as cutover } from '../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' diff --git a/src/main/serve-update-handoff.test.ts b/src/main/serve-update-handoff.test.ts index 1f0de3338a5..40a248f66b9 100644 --- a/src/main/serve-update-handoff.test.ts +++ b/src/main/serve-update-handoff.test.ts @@ -15,7 +15,9 @@ const { appMock, getCanonicalUserDataPathMock } = vi.hoisted(() => ({ })) vi.mock('electron', () => ({ app: appMock })) -vi.mock('./persistence', () => ({ getCanonicalUserDataPath: getCanonicalUserDataPathMock })) +vi.mock('./persistence/loading-store/user-data-path', () => ({ + getCanonicalUserDataPath: getCanonicalUserDataPathMock +})) describe('serve update handoff', () => { let root: string diff --git a/src/main/serve-update-handoff.ts b/src/main/serve-update-handoff.ts index 8a8cc366cff..d81bc45a08a 100644 --- a/src/main/serve-update-handoff.ts +++ b/src/main/serve-update-handoff.ts @@ -11,7 +11,7 @@ import { type ServeUpdateHandoffState } from '../shared/serve-update-handoff' import { isSameUserDataPath } from '../shared/serve-user-data-path' -import { getCanonicalUserDataPath } from './persistence' +import { getCanonicalUserDataPath } from './persistence/loading-store/user-data-path' function getConfiguredHandoffPath(): string | null { const configuredPath = process.env[SERVE_UPDATE_HANDOFF_PATH_ENV] diff --git a/src/main/ssh/connection/ssh-connection-store.ts b/src/main/ssh/connection/ssh-connection-store.ts index c24138e515c..9ab47772a44 100644 --- a/src/main/ssh/connection/ssh-connection-store.ts +++ b/src/main/ssh/connection/ssh-connection-store.ts @@ -1,4 +1,4 @@ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { SshRepoReadoption, SshTarget } from '../../../shared/ssh-types' import { RUNTIME_OWNED_SSH_TARGET_ID_PREFIX } from '../../../shared/execution-host' import { normalizeSshConfigAlias } from '../../../shared/ssh-config-alias' diff --git a/src/main/ssh/legacy-relay/legacy-relay-bridge-ipc.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-ipc.ts index 2e9a13cd410..7f9f1c309e6 100644 --- a/src/main/ssh/legacy-relay/legacy-relay-bridge-ipc.ts +++ b/src/main/ssh/legacy-relay/legacy-relay-bridge-ipc.ts @@ -6,7 +6,7 @@ import { ipcMain, type BrowserWindow } from 'electron' import { z } from 'zod' import { LEGACY_RELAY_BRIDGE_CHANNELS as CHANNELS } from '../../../shared/legacy-relay-bridge-contract' import { isRemoteCliControlAllowed } from '../../../shared/ssh-remote-cli-control' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import { PtyRetirementWithoutProof } from '../../pty-exit-proof' import { toAppSshPtyId } from '../../../shared/ssh-pty-id' diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts index 066f4a39a7e..e85b9982f3a 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts @@ -1,5 +1,5 @@ /** Let host-owned endpoints decide conversion safety, including terminals another desktop opened. */ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { HostServerTerminalVerdict } from '../ssh-host-server-on-connect' import { censusHostRelayEndpoints, diff --git a/src/main/ssh/orcad-migration-delta-move.ts b/src/main/ssh/orcad-migration-delta-move.ts index 2b95cd3a2ab..6f4c9060d6d 100644 --- a/src/main/ssh/orcad-migration-delta-move.ts +++ b/src/main/ssh/orcad-migration-delta-move.ts @@ -7,7 +7,7 @@ import type { OrcadDeltaMoveResult } from '../../shared/orcad-managed-runtime' import { recordManagedOrcadMigration } from '../../shared/runtime-environment-managed-orcad-store' import type { KnownRuntimeEnvironment } from '../../shared/runtime-environments' import type { SshTarget } from '../../shared/ssh-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { abortOrcadMigrationCutover, commitOrcadMigrationDestination, diff --git a/src/main/ssh/orcad-migration-delta-plan.ts b/src/main/ssh/orcad-migration-delta-plan.ts index 7d126f81c9f..027c2b3f133 100644 --- a/src/main/ssh/orcad-migration-delta-plan.ts +++ b/src/main/ssh/orcad-migration-delta-plan.ts @@ -7,7 +7,7 @@ import type { import { isRetainedOrcadMigrationSourceCutover } from '../../shared/orcad-migration/orcad-migration-source-cutover' import type { OrcadMigrationSourceCutover } from '../../shared/orcad-migration/orcad-migration-source-cutover' import type { SshTarget } from '../../shared/ssh-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { collectOrcadMigrationSourceCatalog } from '../persistence/migrating-orcad-catalog/orcad-source-catalog' import { listOrcadMigrationCutoverChainForTarget } from './orcad-migration-cutover-journal' import { diff --git a/src/main/ssh/orcad-migration-manifest-export.ts b/src/main/ssh/orcad-migration-manifest-export.ts index 84cce609c58..5857c3a8de7 100644 --- a/src/main/ssh/orcad-migration-manifest-export.ts +++ b/src/main/ssh/orcad-migration-manifest-export.ts @@ -12,7 +12,7 @@ import type { } from '../../shared/orcad-migration/orcad-migration-manifest' import type { SshTarget } from '../../shared/ssh-types' import { REMOTE_RUNTIME_MAX_INBOUND_REQUEST_JSON_BYTES } from '../../shared/remote-runtime/remote-runtime-memory-limits' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { collectOrcadMigrationSourceCatalog } from '../persistence/migrating-orcad-catalog/orcad-source-catalog' import { computeOrcadMigrationManifestSha256 } from '../orcad/orcad-migration-manifest-digest' import { diff --git a/src/main/ssh/orcad-migration-repository-link.ts b/src/main/ssh/orcad-migration-repository-link.ts index 60b44f3dd8c..48c40b0c3ec 100644 --- a/src/main/ssh/orcad-migration-repository-link.ts +++ b/src/main/ssh/orcad-migration-repository-link.ts @@ -9,7 +9,7 @@ import type { Repo } from '../../shared/repo-types' import type { SshManagedServerLinkedProject } from '../../shared/ssh-types' import { parseWorkspaceKey } from '../../shared/workspace-scope' import { splitWorktreeId } from '../../shared/worktree/id' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { abortOrcadMigrationCutover, type OrcadMigrationDestinationCatalog diff --git a/src/main/ssh/orcad-migration-scrollback-retention-wiring.ts b/src/main/ssh/orcad-migration-scrollback-retention-wiring.ts index 76f64554076..28439bae62c 100644 --- a/src/main/ssh/orcad-migration-scrollback-retention-wiring.ts +++ b/src/main/ssh/orcad-migration-scrollback-retention-wiring.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { listOrcadMigrationSourceCutovers, setOrcadMigrationJournalChangeListener diff --git a/src/main/ssh/orcad-migration-snapshot-coordinator.ts b/src/main/ssh/orcad-migration-snapshot-coordinator.ts index b7f22cd3907..945ac9f233b 100644 --- a/src/main/ssh/orcad-migration-snapshot-coordinator.ts +++ b/src/main/ssh/orcad-migration-snapshot-coordinator.ts @@ -8,7 +8,7 @@ import { type OrcadMigrationSnapshotChunkRequest, type OrcadMigrationSnapshotChunkResult } from '../../shared/orcad-migration/orcad-migration-scrollback' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' export type OrcadMigrationSnapshotSource = Pick diff --git a/src/main/ssh/orcad-migration-source-retention.ts b/src/main/ssh/orcad-migration-source-retention.ts index aa465065fef..a493befa53e 100644 --- a/src/main/ssh/orcad-migration-source-retention.ts +++ b/src/main/ssh/orcad-migration-source-retention.ts @@ -2,7 +2,7 @@ import { toRuntimeExecutionHostId } from '../../shared/execution-host' import type { OrcadMigrationSourceCutover } from '../../shared/orcad-migration/orcad-migration-source-cutover' import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { withRenamedOrcadMigrationDrafts } from '../persistence/migrating-orcad-catalog/orcad-source-draft-rename' import { listOrcadMigrationSourceCutovers, diff --git a/src/main/ssh/orcad-migration-ssh-relay-source.ts b/src/main/ssh/orcad-migration-ssh-relay-source.ts index c00d0329ee3..aee34b164c2 100644 --- a/src/main/ssh/orcad-migration-ssh-relay-source.ts +++ b/src/main/ssh/orcad-migration-ssh-relay-source.ts @@ -1,7 +1,7 @@ import { ORCAD_MIGRATION_SSH_RELAY_SOURCE_KIND } from '../../shared/orcad-migration/orcad-migration-source-kind' import type { SshTarget } from '../../shared/ssh-types' import { collectOrcadMigrationSourceCatalog } from '../persistence/migrating-orcad-catalog/orcad-source-catalog' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { createOrcadMigrationManifest } from './orcad-migration-manifest-export' import { IDENTITY_ORCAD_MIGRATION_PATH_REWRITER } from './orcad-migration-path-rewrite' import type { diff --git a/src/main/ssh/orcad-migration-terminal-gate.ts b/src/main/ssh/orcad-migration-terminal-gate.ts index 6d89eab9ac9..84be4e7dedc 100644 --- a/src/main/ssh/orcad-migration-terminal-gate.ts +++ b/src/main/ssh/orcad-migration-terminal-gate.ts @@ -1,6 +1,6 @@ /** Relay PTYs cannot move to orcad: prove host-wide exit or retain possible survivors in the legacy bridge. Lost contact and unaccounted leases never prove exit. */ import { isLiveSshPtyLease, type SshRemotePtyLease } from '../../shared/ssh-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { PtyExitProof } from '../pty-exit-proof' export type OrcadMigrationTerminalVerdict = diff --git a/src/main/ssh/orcad-retained-source-lists.test.ts b/src/main/ssh/orcad-retained-source-lists.test.ts index 6d0f2821300..6374caa7553 100644 --- a/src/main/ssh/orcad-retained-source-lists.test.ts +++ b/src/main/ssh/orcad-retained-source-lists.test.ts @@ -8,7 +8,7 @@ import type { ProjectGroup } from '../../shared/project-group-types' import type { ProjectHostSetup } from '../../shared/project-types' import type { Repo } from '../../shared/repo-types' import type { SshTarget } from '../../shared/ssh-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { orcadMigrationCutoverFixture } from './orcad-migration-cutover-fixture' import { writeOrcadMigrationSourceCutover } from './orcad-migration-cutover-journal' import { wslMoveCutoverFixture } from '../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' diff --git a/src/main/ssh/orcad-retained-source-session.ts b/src/main/ssh/orcad-retained-source-session.ts index d9fdfbf33e6..9219aab48ee 100644 --- a/src/main/ssh/orcad-retained-source-session.ts +++ b/src/main/ssh/orcad-retained-source-session.ts @@ -1,5 +1,5 @@ import { parseExecutionHostId, type ExecutionHostId } from '../../shared/execution-host' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { appUserDataPath, hiddenRetainedSourceTargetIds } from './orcad-retained-source' /** A hidden source's session goes with its repos: a window adopting it at startup brings closed tabs back (#33539). */ diff --git a/src/main/ssh/orcad-retained-source.ts b/src/main/ssh/orcad-retained-source.ts index dc8c3354835..e8110c82dd3 100644 --- a/src/main/ssh/orcad-retained-source.ts +++ b/src/main/ssh/orcad-retained-source.ts @@ -18,7 +18,7 @@ import type { Repo } from '../../shared/repo-types' import { listEnvironments } from '../../shared/runtime-environment-store' import { getOrcadSshDeployment } from '../../shared/runtime-environments' import type { SshTarget } from '../../shared/ssh-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { collectOrcadMigrationSourceCatalog } from '../persistence/migrating-orcad-catalog/orcad-source-catalog' import { orcadSourceFolderWorkspaceIds, diff --git a/src/main/ssh/targets/ssh-target-orcad-claims.ts b/src/main/ssh/targets/ssh-target-orcad-claims.ts index dcc8e41e8c9..b6cd8d67467 100644 --- a/src/main/ssh/targets/ssh-target-orcad-claims.ts +++ b/src/main/ssh/targets/ssh-target-orcad-claims.ts @@ -1,5 +1,5 @@ /** orcadFence reserves a target for its managed tunnel and refuses direct relay access. Claim only empty targets; existing state requires catalog migration. */ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { getManagedOrcadFenceEnvironmentId, isEphemeralRuntimeSshOwner diff --git a/src/main/ssh/targets/ssh-target-orcad-dependents.ts b/src/main/ssh/targets/ssh-target-orcad-dependents.ts index 4b7eea478f0..3a4f728433f 100644 --- a/src/main/ssh/targets/ssh-target-orcad-dependents.ts +++ b/src/main/ssh/targets/ssh-target-orcad-dependents.ts @@ -1,5 +1,5 @@ /** Empty-host claims refuse all referencing state; migrations block only state their manifest cannot carry. */ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import { getDefaultWorkspaceSession } from '../../../shared/constants' import { toSshExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' import { getRepoRegistrationHostIds } from '../../../shared/repo-host-identity' diff --git a/src/main/ssh/targets/ssh-target-orcad-preflight.ts b/src/main/ssh/targets/ssh-target-orcad-preflight.ts index ef330beb3ea..2ac2a5b0174 100644 --- a/src/main/ssh/targets/ssh-target-orcad-preflight.ts +++ b/src/main/ssh/targets/ssh-target-orcad-preflight.ts @@ -1,6 +1,6 @@ /** Read-only export preflight: catalog rows and representable dormant state can migrate; ownership, live leases and untransferred dependencies block. */ import { isLiveSshPtyLease } from '../../../shared/ssh-types' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { OrcadMigrationBlocker, OrcadMigrationPreflight diff --git a/src/main/ssh/targets/ssh-target-readoption.test.ts b/src/main/ssh/targets/ssh-target-readoption.test.ts index 54b48d2773c..246f8bae912 100644 --- a/src/main/ssh/targets/ssh-target-readoption.test.ts +++ b/src/main/ssh/targets/ssh-target-readoption.test.ts @@ -3,7 +3,7 @@ import { buildRemovedSshTargetTombstone, readoptOrphanedWorkspacesForTarget } from './ssh-target-readoption' -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { RemovedSshTargetTombstone, SshTarget } from '../../../shared/ssh-types' function makeTarget(overrides: Partial = {}): SshTarget { diff --git a/src/main/ssh/targets/ssh-target-readoption.ts b/src/main/ssh/targets/ssh-target-readoption.ts index 42482eececa..08f1c25fa3e 100644 --- a/src/main/ssh/targets/ssh-target-readoption.ts +++ b/src/main/ssh/targets/ssh-target-readoption.ts @@ -1,4 +1,4 @@ -import type { Store } from '../../persistence' +import type { Store } from '../../persistence/loading-store/store' import type { RemovedSshTargetTombstone, SshRepoReadoption, diff --git a/src/main/star-nag/agent-value-moment.ts b/src/main/star-nag/agent-value-moment.ts index 7c721903bfd..52c4909a45a 100644 --- a/src/main/star-nag/agent-value-moment.ts +++ b/src/main/star-nag/agent-value-moment.ts @@ -1,6 +1,6 @@ import { app } from 'electron' import { checkOrcaStarred } from '../github/client' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StarNagPromptMode } from '../../shared/star-nag-telemetry' export type AgentValueMomentPreparation = diff --git a/src/main/star-nag/console-events.ts b/src/main/star-nag/console-events.ts index 0cf04b4d6a6..6278fa5eee9 100644 --- a/src/main/star-nag/console-events.ts +++ b/src/main/star-nag/console-events.ts @@ -1,7 +1,7 @@ import { app } from 'electron' import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' import type { StarNagPromptSource } from '../../shared/star-nag-telemetry' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' type StarNagConsoleEvent = 'star_nag_shown' | 'star_nag_dismissed' | 'star_nag_later' diff --git a/src/main/star-nag/onboarding-completed.ts b/src/main/star-nag/onboarding-completed.ts index 8831c3858a7..d40dd19dc64 100644 --- a/src/main/star-nag/onboarding-completed.ts +++ b/src/main/star-nag/onboarding-completed.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' type OnboardingCompletedDeps = { store: Store diff --git a/src/main/star-nag/prompt-context.ts b/src/main/star-nag/prompt-context.ts index e50b585d31e..13ac56a6cf4 100644 --- a/src/main/star-nag/prompt-context.ts +++ b/src/main/star-nag/prompt-context.ts @@ -4,7 +4,7 @@ import { type StarNagPromptMode, type StarNagPromptSource } from '../../shared/star-nag-telemetry' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { getCohortAtEmit } from '../telemetry/cohort-classifier' import type { StarNagPromptContext } from './prompt-session-telemetry' diff --git a/src/main/star-nag/service-test-harness.ts b/src/main/star-nag/service-test-harness.ts index 1d786eeb710..501adf82b20 100644 --- a/src/main/star-nag/service-test-harness.ts +++ b/src/main/star-nag/service-test-harness.ts @@ -2,7 +2,7 @@ import { vi } from 'vitest' import type { Mock } from 'vitest' import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' import type { PersistedUIState } from '../../shared/persisted-ui-state-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { StarNagService } from './service' diff --git a/src/main/star-nag/service.ts b/src/main/star-nag/service.ts index 390373d83b7..253e18e828c 100644 --- a/src/main/star-nag/service.ts +++ b/src/main/star-nag/service.ts @@ -1,7 +1,7 @@ import { BrowserWindow, ipcMain } from 'electron' import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' import { checkOrcaStarred } from '../github/client' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { track } from '../telemetry/client' import type { diff --git a/src/main/star-nag/threshold-trigger.ts b/src/main/star-nag/threshold-trigger.ts index 42f4401a103..721d0f1e2ed 100644 --- a/src/main/star-nag/threshold-trigger.ts +++ b/src/main/star-nag/threshold-trigger.ts @@ -1,5 +1,5 @@ import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' type ThresholdPromptInput = { diff --git a/src/main/star-nag/web-handoff.ts b/src/main/star-nag/web-handoff.ts index 04c06c00167..c10bd11fde7 100644 --- a/src/main/star-nag/web-handoff.ts +++ b/src/main/star-nag/web-handoff.ts @@ -1,5 +1,5 @@ import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' export function deferAfterStarNagWebHandoff( diff --git a/src/main/startup/browser-process-user-agent-ordering.test.ts b/src/main/startup/browser-process-user-agent-ordering.test.ts index 3a445dfda8e..ba0495cbfc1 100644 --- a/src/main/startup/browser-process-user-agent-ordering.test.ts +++ b/src/main/startup/browser-process-user-agent-ordering.test.ts @@ -153,7 +153,7 @@ vi.mock('../ipc/filesystem/watchers/filesystem-watcher', () => ({ } })) vi.mock('../network/proxy-settings') -vi.mock('../persistence', () => ({ +vi.mock('../persistence/loading-store/user-data-path', () => ({ initDataPath: () => mocks.events.push('init-data-path'), getCanonicalUserDataPath: () => '/canonical-user-data' })) diff --git a/src/main/startup/dev-education-suppression.ts b/src/main/startup/dev-education-suppression.ts index 46d557d23cc..6110f16c7e7 100644 --- a/src/main/startup/dev-education-suppression.ts +++ b/src/main/startup/dev-education-suppression.ts @@ -6,7 +6,7 @@ import { } from '../../shared/feature-interactions' import { FEATURE_TIP_IDS } from '../../shared/feature-tips' import type { PersistedUIState } from '../../shared/persisted-ui-state-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' export const DEV_SHOW_FIRST_RUN_EDUCATION_ENV = 'ORCA_DEV_SHOW_FIRST_RUN_EDUCATION' diff --git a/src/main/startup/headless-serve-ssh-registration.ts b/src/main/startup/headless-serve-ssh-registration.ts index 0786c052c39..41f0b4f7395 100644 --- a/src/main/startup/headless-serve-ssh-registration.ts +++ b/src/main/startup/headless-serve-ssh-registration.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { registerSshHandlers } from '../ipc/ssh/ssh' import { mainProcessState as state } from './main-process-state' diff --git a/src/main/startup/main-process-observers.ts b/src/main/startup/main-process-observers.ts index fc7ec769399..8a71d4702f3 100644 --- a/src/main/startup/main-process-observers.ts +++ b/src/main/startup/main-process-observers.ts @@ -15,7 +15,7 @@ import { setCodexTrustGrantTelemetry } from '../codex/codex-trust-grant-telemetr import { initObservability } from '../observability' import { recordDurableCrashBreadcrumb } from '../crash-reporting/durable-crash-breadcrumb' import { reportPreviousHangDetection } from '../hang-watchdog/previous-hang-detection' -import { getCanonicalUserDataPath } from '../persistence' +import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' import { recoverPendingSkillTransactions } from '../skills/skill-transaction-startup-recovery' import { initCohortClassifier } from '../telemetry/cohort-classifier' import { initOnboardingCohortClassifier } from '../telemetry/onboarding-cohort-classifier' diff --git a/src/main/startup/main-process-preflight.ts b/src/main/startup/main-process-preflight.ts index b92afd2aab8..ef9a0860f4b 100644 --- a/src/main/startup/main-process-preflight.ts +++ b/src/main/startup/main-process-preflight.ts @@ -72,7 +72,7 @@ import { setSpeechServiceFactories } from '../speech/speech-runtime-service' import { setWorktreeWatcherRemoval } from '../ipc/worktree-watcher-removal' import { desktopWorktreeWatcherRemoval } from '../ipc/filesystem/watchers/filesystem-watcher' import { setDefaultProxySessionResolver } from '../network/proxy-settings' -import { initDataPath, getCanonicalUserDataPath } from '../persistence' +import { initDataPath, getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' import { applyMacPressAndHoldDefaultAtStartup } from '../macos-press-and-hold-default' import { configureSessionParseCachePersistence } from '../ai-vault/session-parse-cache-persistence' import { initOrcaProfilePaths } from '../orca-profiles/profile-index-store' diff --git a/src/main/startup/main-process-quit-pending-writer.test.ts b/src/main/startup/main-process-quit-pending-writer.test.ts index 288a036071a..e21484d417f 100644 --- a/src/main/startup/main-process-quit-pending-writer.test.ts +++ b/src/main/startup/main-process-quit-pending-writer.test.ts @@ -55,7 +55,9 @@ const dependencies: Record> = { '../terminal-history-gc': { cancelHistoryGc: idle() }, './window-all-closed-quit-policy': { shouldQuitWhenAllWindowsClosed: vi.fn(() => false) }, './configure-process': { isDevParentShutdownRequested: vi.fn(() => false) }, - '../persistence': { getCanonicalUserDataPath: vi.fn(() => '/unused') } + '../persistence/loading-store/user-data-path': { + getCanonicalUserDataPath: vi.fn(() => '/unused') + } } afterEach(() => { diff --git a/src/main/startup/main-process-quit-update-veto.test.ts b/src/main/startup/main-process-quit-update-veto.test.ts index 00d3714ad50..fa8b8f5903a 100644 --- a/src/main/startup/main-process-quit-update-veto.test.ts +++ b/src/main/startup/main-process-quit-update-veto.test.ts @@ -45,7 +45,7 @@ const dependencyExports: [string, string[]][] = [ ['../terminal-history-gc', ['cancelHistoryGc']], ['./window-all-closed-quit-policy', ['shouldQuitWhenAllWindowsClosed']], ['./configure-process', ['isDevParentShutdownRequested']], - ['../persistence', ['getCanonicalUserDataPath']] + ['../persistence/loading-store/user-data-path', ['getCanonicalUserDataPath']] ] it('keeps startup services live when the updater has vetoed before-quit', async () => { diff --git a/src/main/startup/main-process-quit.ts b/src/main/startup/main-process-quit.ts index 4d936491811..0d54415e34a 100644 --- a/src/main/startup/main-process-quit.ts +++ b/src/main/startup/main-process-quit.ts @@ -35,7 +35,7 @@ import { shouldQuitWhenAllWindowsClosed } from './window-all-closed-quit-policy' import { desktopConnectorCloud } from './main-process-connector-startup' import { mainProcessState as state } from './main-process-state' import { isDevParentShutdownRequested } from './configure-process' -import { getCanonicalUserDataPath } from '../persistence' +import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' import { flushUnsavedCloudSessions } from '../orca-profiles/profile-cloud-session-owner' // First will-quit pass awaits teardown; the re-fired pass must exit without starting writes again. diff --git a/src/main/startup/main-process-ready-foundation.ts b/src/main/startup/main-process-ready-foundation.ts index c817b629504..769c9602d63 100644 --- a/src/main/startup/main-process-ready-foundation.ts +++ b/src/main/startup/main-process-ready-foundation.ts @@ -10,7 +10,7 @@ import { preservePreviousHangDetection } from '../hang-watchdog/previous-hang-de import { browserCertificateTrustController, browserManager } from '../browser/browser-manager' import { browserSiteDisplayController } from '../browser/browser-site-display-controller' import { ensureActiveOrcaProfile } from '../orca-profiles/profile-index-store' -import { getCanonicalUserDataPath } from '../persistence' +import { getCanonicalUserDataPath } from '../persistence/loading-store/user-data-path' import { getAppEnvironment } from '../../shared/app-environment' import { loadWslMoveFence } from '../persistence/moving-wsl-projects/wsl-move-scope-guard' import { startWslMoveStartup } from '../persistence/moving-wsl-projects/wsl-move-startup' diff --git a/src/main/startup/main-process-ready-identity-write.test.ts b/src/main/startup/main-process-ready-identity-write.test.ts index 6b2822d65a7..b3eff19b3b3 100644 --- a/src/main/startup/main-process-ready-identity-write.test.ts +++ b/src/main/startup/main-process-ready-identity-write.test.ts @@ -69,7 +69,7 @@ vi.mock('electron', () => ({ } })) vi.mock('./main-process-state', () => ({ mainProcessState: mocks.state })) -vi.mock('../persistence', () => ({ +vi.mock('../persistence/loading-store/store', () => ({ Store: class { getSettings() { return {} @@ -82,8 +82,7 @@ vi.mock('../persistence', () => ({ getSshTargets() { return [] } - }, - getCanonicalUserDataPath: () => mocks.userDataPath + } })) vi.mock('../persistence/profile-state/profile-state-startup-authority', () => ({ createProfileStateStoreForStartup: () => ({ diff --git a/src/main/startup/main-process-runtime-launch-activation.test.ts b/src/main/startup/main-process-runtime-launch-activation.test.ts index 7b86ee69a31..7234726544b 100644 --- a/src/main/startup/main-process-runtime-launch-activation.test.ts +++ b/src/main/startup/main-process-runtime-launch-activation.test.ts @@ -18,7 +18,7 @@ vi.mock('../orca-profiles/profile-cloud-auth-config', () => ({ getOrcaCloudAuthConfig: () => ({ configured: false }) })) vi.mock('../orca-profiles/profile-storage-paths', () => ({ getProfileUserDataPath: vi.fn() })) -vi.mock('../persistence', () => ({ +vi.mock('../persistence/loading-store/user-data-path', () => ({ getCanonicalUserDataPath: () => '/tmp/orca-user-data', migrateMobilePairingDataToCanonicalUserDataPath: vi.fn() })) diff --git a/src/main/startup/main-process-runtime-launch.ts b/src/main/startup/main-process-runtime-launch.ts index b38342ad8f2..7c4f58f8a6b 100644 --- a/src/main/startup/main-process-runtime-launch.ts +++ b/src/main/startup/main-process-runtime-launch.ts @@ -4,7 +4,7 @@ import { placeUnshownLiveTerminalsBestEffort } from '../runtime/terminal/adoptio import { getCanonicalUserDataPath, migrateMobilePairingDataToCanonicalUserDataPath -} from '../persistence' +} from '../persistence/loading-store/user-data-path' import { OrcaRuntimeRpcServer } from '../runtime/runtime-rpc' import { WS_BIND_HOST_LOOPBACK } from '../runtime/runtime-rpc/runtime-rpc-pairing-types' import { isOrcadSidecarLaunch } from '../window/foreground-activation-policy' diff --git a/src/main/startup/main-process-state.ts b/src/main/startup/main-process-state.ts index f575e599cb9..61e37c040cc 100644 --- a/src/main/startup/main-process-state.ts +++ b/src/main/startup/main-process-state.ts @@ -1,6 +1,6 @@ import type { BrowserWindow, Tray } from 'electron' import { app } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import type { ClaudeUsageStore } from '../claude-usage/store' import type { CodexUsageStore } from '../codex-usage/store' diff --git a/src/main/startup/wsl-orcad-account-env-wiring.ts b/src/main/startup/wsl-orcad-account-env-wiring.ts index 13d3ceabceb..510ea4e29d5 100644 --- a/src/main/startup/wsl-orcad-account-env-wiring.ts +++ b/src/main/startup/wsl-orcad-account-env-wiring.ts @@ -2,7 +2,7 @@ import { BrowserWindow } from 'electron' import { withClaudeProfileTerminalEnv } from '../claude-accounts/claude-profile-installed-router' import { getSelectedClaudeAccountIdForTarget } from '../claude-accounts/runtime-selection' import { getSelectedCodexAccountIdForTarget } from '../codex-accounts/runtime-selection' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { installWslOrcadAccountEnvDependencies } from '../wsl/wsl-orcad-account-env' import { WSL_ORCAD_ACCOUNT_NOT_APPLIED_CHANNEL, diff --git a/src/main/telemetry/chat-ui-launch-tip-cohort.test.ts b/src/main/telemetry/chat-ui-launch-tip-cohort.test.ts index ed9dcd7b836..ecde598776b 100644 --- a/src/main/telemetry/chat-ui-launch-tip-cohort.test.ts +++ b/src/main/telemetry/chat-ui-launch-tip-cohort.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { ChatUiLaunchTipVariant } from '../../shared/native-chat/chat-ui-launch-tip-audience' import type { TelemetrySettings } from '../../shared/telemetry-settings-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { ensureChatUiLaunchTipCohort, isChatUiLaunchTipDeferredForConsent diff --git a/src/main/telemetry/chat-ui-launch-tip-cohort.ts b/src/main/telemetry/chat-ui-launch-tip-cohort.ts index ac2e2dd542f..d2047e1667d 100644 --- a/src/main/telemetry/chat-ui-launch-tip-cohort.ts +++ b/src/main/telemetry/chat-ui-launch-tip-cohort.ts @@ -1,5 +1,5 @@ import { randomInt } from 'node:crypto' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveConsent } from './consent' export type ChatUiLaunchTipCohort = 'control' | 'treatment' diff --git a/src/main/telemetry/client-deferred-start.test.ts b/src/main/telemetry/client-deferred-start.test.ts index 52fe5f38743..f191ccbeee3 100644 --- a/src/main/telemetry/client-deferred-start.test.ts +++ b/src/main/telemetry/client-deferred-start.test.ts @@ -1,6 +1,6 @@ import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { GlobalSettings } from '../../shared/global-settings-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as PostHogTransport from './posthog-transport' import { BASE_COMMON, diff --git a/src/main/telemetry/client-test-harness.ts b/src/main/telemetry/client-test-harness.ts index 055d9472731..1312e7c5cd7 100644 --- a/src/main/telemetry/client-test-harness.ts +++ b/src/main/telemetry/client-test-harness.ts @@ -2,7 +2,7 @@ import type { PostHog } from 'posthog-node' import { vi } from 'vitest' import type { CommonProps } from '../../shared/telemetry-events' import type { GlobalSettings } from '../../shared/global-settings-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { _enableTransportForTests, _resetFirstAppOpenedFiredForTests, diff --git a/src/main/telemetry/client.test.ts b/src/main/telemetry/client.test.ts index e254134cf55..d5a8e23f2d4 100644 --- a/src/main/telemetry/client.test.ts +++ b/src/main/telemetry/client.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, type vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { _setShuttingDownForTests, track, trackAppOpenedOnce } from './client' import { BASE_COMMON, diff --git a/src/main/telemetry/client.ts b/src/main/telemetry/client.ts index 5f24887bdae..46961d14cb2 100644 --- a/src/main/telemetry/client.ts +++ b/src/main/telemetry/client.ts @@ -4,7 +4,7 @@ import { randomUUID } from 'node:crypto' import type { PostHog } from 'posthog-node' import type { CommonProps, EventName, EventProps, OptInVia } from '../../shared/telemetry-events' import type { AgentDashboardSurface } from '../../shared/telemetry-agent-dashboard-event-schemas' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { consumeBurstToken, resetBurstCapsForSession } from './burst-cap' import { ensureChatUiLaunchTipCohort } from './chat-ui-launch-tip-cohort' import { getCohortAtEmit } from './cohort-classifier' diff --git a/src/main/telemetry/cohort-classifier.test.ts b/src/main/telemetry/cohort-classifier.test.ts index 0169d481237..bcc5867f69b 100644 --- a/src/main/telemetry/cohort-classifier.test.ts +++ b/src/main/telemetry/cohort-classifier.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../shared/repo-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { _resetSessionWarnFlagForTests, _setStoreForTests, diff --git a/src/main/telemetry/cohort-classifier.ts b/src/main/telemetry/cohort-classifier.ts index 89fb94cd090..56cbdef0cd9 100644 --- a/src/main/telemetry/cohort-classifier.ts +++ b/src/main/telemetry/cohort-classifier.ts @@ -1,6 +1,6 @@ // Read current repo count at emit time, after repo additions land; zero identifies pre-repo sessions. Uninitialized/failed reads omit the optional cohort field so telemetry never blocks the app (onboarding-funnel-cohort-addendum.md). -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' let storeRef: Store | null = null diff --git a/src/main/telemetry/install-id.ts b/src/main/telemetry/install-id.ts index 394f485ef51..39177513ed6 100644 --- a/src/main/telemetry/install-id.ts +++ b/src/main/telemetry/install-id.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' // Generate anonymous install identity once during migration; every launch reuses the persisted value. diff --git a/src/main/telemetry/onboarding-cohort-classifier.test.ts b/src/main/telemetry/onboarding-cohort-classifier.test.ts index 8a7de1ee158..9edace84b08 100644 --- a/src/main/telemetry/onboarding-cohort-classifier.test.ts +++ b/src/main/telemetry/onboarding-cohort-classifier.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { ONBOARDING_FINAL_STEP } from '../../shared/onboarding-defaults' import type { GlobalSettings } from '../../shared/global-settings-types' import type { OnboardingState } from '../../shared/onboarding-state-types' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { _resetSessionWarnFlagForTests, _setStoreForTests, diff --git a/src/main/telemetry/onboarding-cohort-classifier.ts b/src/main/telemetry/onboarding-cohort-classifier.ts index 9b0f730597c..b649287c135 100644 --- a/src/main/telemetry/onboarding-cohort-classifier.ts +++ b/src/main/telemetry/onboarding-cohort-classifier.ts @@ -2,7 +2,7 @@ import { ONBOARDING_FINAL_STEP } from '../../shared/onboarding-defaults' import type { OnboardingCohort } from '../../shared/telemetry-events' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' let storeRef: Store | null = null diff --git a/src/main/telemetry/posthog-client-start.ts b/src/main/telemetry/posthog-client-start.ts index 1b42f8baea6..8fe275694bb 100644 --- a/src/main/telemetry/posthog-client-start.ts +++ b/src/main/telemetry/posthog-client-start.ts @@ -1,5 +1,5 @@ import type { PostHog } from 'posthog-node' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveConsent } from './consent' import { POSTHOG_FLUSH_AT, POSTHOG_FLUSH_INTERVAL_MS } from './posthog-transport' diff --git a/src/main/telemetry/wsl-usage-reporter.ts b/src/main/telemetry/wsl-usage-reporter.ts index 94d7beaf7ed..6e3f6fe00e3 100644 --- a/src/main/telemetry/wsl-usage-reporter.ts +++ b/src/main/telemetry/wsl-usage-reporter.ts @@ -1,7 +1,7 @@ // Windows-only daily usage; gather registry/WSL state only while transmission is enabled. Reuse confirmed running distros, otherwise share one probe when user distros exist. import { readFile, writeFile } from 'node:fs/promises' import { join } from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { GlobalSettings } from '../../shared/global-settings-types' import { getRepoExecutionHostId, parseExecutionHostId } from '../../shared/execution-host' import { listEnvironments } from '../../shared/runtime-environment-store' diff --git a/src/main/update-restart-preservation.ts b/src/main/update-restart-preservation.ts index bf4a2793f0a..02d5e371959 100644 --- a/src/main/update-restart-preservation.ts +++ b/src/main/update-restart-preservation.ts @@ -2,7 +2,7 @@ import { preserveAgentAuthBeforeRestart, type CodexRuntimeAuthSync } from './agent-auth-restart-preservation' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' // Save agent auth before checkpointing the store on desktop and headless restarts. export async function preserveStateBeforeUpdateRestart({ diff --git a/src/main/usage-worktree-metadata.ts b/src/main/usage-worktree-metadata.ts index 5094deadbf0..dec14dc9626 100644 --- a/src/main/usage-worktree-metadata.ts +++ b/src/main/usage-worktree-metadata.ts @@ -6,7 +6,7 @@ import { splitWorktreeIdForFilesystem } from '../shared/worktree/id' import { isFolderRepo } from '../shared/repo-kind' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { getRepoRoutingConnectionId } from '../shared/execution-host' export type UsageWorktreeRef = { diff --git a/src/main/usage/usage-provider-store-lifecycle.ts b/src/main/usage/usage-provider-store-lifecycle.ts index 6f29ab8a7f2..500f931339c 100644 --- a/src/main/usage/usage-provider-store-lifecycle.ts +++ b/src/main/usage/usage-provider-store-lifecycle.ts @@ -6,7 +6,7 @@ import type { AgentTokenUsage } from '../../shared/telemetry-agent-token-usage-s import { isTelemetryEnabled } from '../telemetry/client' import { join, parse } from 'node:path' import { AnalyticsSessionIdStore, type AnalyticsSessionId } from './analytics-session-id-store' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { UsageCacheSnapshotWriter } from '../usage-cache-snapshot-writer' import { loadKnownUsageWorktreesByRepo } from '../usage-worktree-metadata' import type { UsageScanWorktreeRef } from './usage-provider-contract' diff --git a/src/main/warp-themes/index.test.ts b/src/main/warp-themes/index.test.ts index f70154b4079..c466784177b 100644 --- a/src/main/warp-themes/index.test.ts +++ b/src/main/warp-themes/index.test.ts @@ -36,7 +36,7 @@ vi.mock('./parser-runner', () => ({ import { previewWarpThemeImport } from './index' import { parseWarpThemeYaml } from './parser' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' const VALID_THEME = ` name: Duplicate diff --git a/src/main/warp-themes/index.ts b/src/main/warp-themes/index.ts index 9f62c62d7e0..aef4b13290f 100644 --- a/src/main/warp-themes/index.ts +++ b/src/main/warp-themes/index.ts @@ -1,6 +1,6 @@ import { readFile, stat } from 'node:fs/promises' import type { WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { WarpThemeImportPreview, WarpThemeImportSource diff --git a/src/main/window/attach-main-window-services.test.ts b/src/main/window/attach-main-window-services.test.ts index 6938c464f71..5f89501fa0e 100644 --- a/src/main/window/attach-main-window-services.test.ts +++ b/src/main/window/attach-main-window-services.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { cancelHistoryGc } from '../terminal-history-gc' import type { registerSshHandlers } from '../ipc/ssh/ssh' import type { registerDaemonManagementHandlers } from '../ipc/pty/pty-management' diff --git a/src/main/window/attach-main-window-services.ts b/src/main/window/attach-main-window-services.ts index 0c037fe4348..0f4ce070394 100644 --- a/src/main/window/attach-main-window-services.ts +++ b/src/main/window/attach-main-window-services.ts @@ -1,6 +1,6 @@ import { ipcMain, nativeTheme } from 'electron' import type { BrowserWindow, IpcMainInvokeEvent } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { acknowledgePendingTccPromptNotice, consumePendingTccPromptNotice, diff --git a/src/main/window/clipboard-ipc-handlers.ts b/src/main/window/clipboard-ipc-handlers.ts index 183e1a6a77b..26448ded298 100644 --- a/src/main/window/clipboard-ipc-handlers.ts +++ b/src/main/window/clipboard-ipc-handlers.ts @@ -9,7 +9,7 @@ import { import { randomUUID } from 'node:crypto' import { open, stat } from 'node:fs/promises' import { runProcess } from '@orca/process-host' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { PATH_ACCESS_DENIED_MESSAGE } from '../ipc/filesystem/filesystem-auth' import { resolveDesktopAuthorizedPath } from '../ipc/local-file-access-resolution' import { isENOENT } from '../ipc/filesystem/filesystem-path-containment' diff --git a/src/main/window/clipboard-macos-image-paste.test.ts b/src/main/window/clipboard-macos-image-paste.test.ts index f867301a3a3..7c5bbd4d01d 100644 --- a/src/main/window/clipboard-macos-image-paste.test.ts +++ b/src/main/window/clipboard-macos-image-paste.test.ts @@ -35,7 +35,7 @@ vi.mock('node:fs/promises', async (importOriginal) => { const fs = await importOriginal() return { ...fs, default: { ...fs, writeFile: mocks.writeFile } } }) -vi.mock('../persistence', () => ({ Store: vi.fn() })) +vi.mock('../persistence/loading-store/store', () => ({ Store: vi.fn() })) vi.mock('./clipboard-remote-file-copy', () => ({ cleanupExpiredRemoteClipboardFiles: vi.fn(), scheduleLegacyRemoteClipboardFileCleanup: vi.fn() @@ -46,7 +46,7 @@ vi.mock('./native-chat-paste-files', () => ({ })) vi.mock('./dashboard-popout-window', () => ({ isDashboardPopoutRenderer: () => false })) -import { Store } from '../persistence' +import { Store } from '../persistence/loading-store/store' import { registerClipboardHandlers, setTrustedClipboardRendererWebContentsId diff --git a/src/main/window/createMainWindow.ts b/src/main/window/createMainWindow.ts index 3374bd2fcc4..d747e91a336 100644 --- a/src/main/window/createMainWindow.ts +++ b/src/main/window/createMainWindow.ts @@ -12,7 +12,7 @@ import { markSystemSessionEnding } from '../crash-reporting/expected-teardown-st import { recordDurableCrashBreadcrumb } from '../crash-reporting/durable-crash-breadcrumb' import { clearTrustedUIRendererWebContentsId, setTrustedUIRendererWebContentsId } from '../ipc/ui' import { flushUnsavedCloudSessions } from '../orca-profiles/profile-cloud-session-owner' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { closeDashboardPopout } from './dashboard-popout-window' import { closeWorkspaceSpaceWindow } from './workspace-space-window' import { diff --git a/src/main/window/dashboard-popout-window.ts b/src/main/window/dashboard-popout-window.ts index e5497c02689..591cf3c1a35 100644 --- a/src/main/window/dashboard-popout-window.ts +++ b/src/main/window/dashboard-popout-window.ts @@ -1,7 +1,7 @@ import { mainI18n, translateMain } from '../i18n/main-i18n' import { app, BrowserWindow, nativeTheme, type WebContents, type Event } from 'electron' import { join } from 'node:path' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { isBackgroundLaunch, showWindowWithoutStealingFocus } from './foreground-activation-policy' import { rectHasVisibleAreaOnAnyDisplay } from './window-bounds-validation' import { sendToTrustedUIRenderer } from '../ipc/ui' diff --git a/src/main/window/history-gc-worktree-ids.ts b/src/main/window/history-gc-worktree-ids.ts index 723f8bf6118..d3ba75e56c5 100644 --- a/src/main/window/history-gc-worktree-ids.ts +++ b/src/main/window/history-gc-worktree-ids.ts @@ -1,4 +1,4 @@ -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { folderWorkspaceKey } from '../../shared/workspace-scope' import { getOtherProfileWorktreeIdsForHistoryGc } from '../orca-profiles/other-profile-workspace-catalog' diff --git a/src/main/window/main-window-close-lifecycle.ts b/src/main/window/main-window-close-lifecycle.ts index ed93828850b..ac93ab6085e 100644 --- a/src/main/window/main-window-close-lifecycle.ts +++ b/src/main/window/main-window-close-lifecycle.ts @@ -1,7 +1,7 @@ import { ipcMain, Menu, Notification, type BrowserWindow } from 'electron' import { QUIT_RENDERER_ACK_TIMEOUT_MS } from '../../shared/quit-teardown-deadline' import { translateMain } from '../i18n/main-i18n' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveWindowCloseAction } from './window-close-decision' import type { CreateMainWindowOptions } from './main-window-contracts' import type { MainWindowFocusLifecycle } from './main-window-focus-lifecycle' diff --git a/src/main/window/main-window-shortcut-routing.ts b/src/main/window/main-window-shortcut-routing.ts index af63e7dd144..01181145ece 100644 --- a/src/main/window/main-window-shortcut-routing.ts +++ b/src/main/window/main-window-shortcut-routing.ts @@ -16,7 +16,7 @@ import { windowShortcutActionCapturesTerminal, type WindowShortcutAction } from '../../shared/window-shortcut-policy' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { CreateMainWindowOptions } from './main-window-contracts' import type { MainWindowFocusLifecycle } from './main-window-focus-lifecycle' import { sendResolvedWindowShortcutAction } from './main-window-shortcut-actions' diff --git a/src/main/window/main-window-state-lifecycle.ts b/src/main/window/main-window-state-lifecycle.ts index 953b19a8d57..8f9ffe56509 100644 --- a/src/main/window/main-window-state-lifecycle.ts +++ b/src/main/window/main-window-state-lifecycle.ts @@ -1,5 +1,5 @@ import { app, type BrowserWindow, type Event } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { uiZoomFactorFromLevel } from '../../shared/ui-zoom-level' import { isWindowlessLaunch, showWindowWithoutStealingFocus } from './foreground-activation-policy' import { MIN_HEIGHT, MIN_WIDTH, syncTrafficLightPosition } from './main-window-visual-lifecycle' diff --git a/src/main/window/main-window-updater-deferred-setup.test.ts b/src/main/window/main-window-updater-deferred-setup.test.ts index fb70c6261d5..89821d40bad 100644 --- a/src/main/window/main-window-updater-deferred-setup.test.ts +++ b/src/main/window/main-window-updater-deferred-setup.test.ts @@ -1,7 +1,7 @@ import { EventEmitter } from 'node:events' import type { BrowserWindow } from 'electron' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type { UpdaterSetupOptions } from '../updater' const { setupMock, milestoneMock, getMainWindowMock } = vi.hoisted(() => ({ diff --git a/src/main/window/main-window-updater.ts b/src/main/window/main-window-updater.ts index 63a1ff89473..19cce1421aa 100644 --- a/src/main/window/main-window-updater.ts +++ b/src/main/window/main-window-updater.ts @@ -3,7 +3,7 @@ import type { BrowserWindow, IpcMainInvokeEvent } from 'electron' import type { ReleaseBuildListResult, UpdateCheckOptions } from '../../shared/update-status-types' import { RELEASE_CHANNELS, type ReleaseChannel } from '../../shared/release-channel' import { getTrustedUIRendererWindow, isTrustedUIRenderer } from '../ipc/ui' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { logStartupMilestone } from '../startup/startup-diagnostics' import { applyProxyToElectronUpdaterSession } from '../updater/electron-updater-proxy-session' import { updaterErrorMessage } from '../updater/updater-coded-error' diff --git a/src/main/window/native-chat-paste-files.test.ts b/src/main/window/native-chat-paste-files.test.ts index 12c656fe12d..7535aecdb37 100644 --- a/src/main/window/native-chat-paste-files.test.ts +++ b/src/main/window/native-chat-paste-files.test.ts @@ -4,7 +4,7 @@ import path from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { resolveLocalFileRequestPath } from '../ipc/local-file-access-resolution' import { readLocalFileContent } from '../ipc/filesystem/filesystem-file-content-inspection' import { isInsideNativeChatPasteFolder, restoreNativeChatPastes } from './native-chat-paste-files' diff --git a/src/main/window/updater-package-recovery-ipc.test.ts b/src/main/window/updater-package-recovery-ipc.test.ts index 563f1e48e18..812dcf8ee5d 100644 --- a/src/main/window/updater-package-recovery-ipc.test.ts +++ b/src/main/window/updater-package-recovery-ipc.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' import type { IpcMainInvokeEvent, WebContents } from 'electron' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import type * as IpcUiModule from '../ipc/ui' const { diff --git a/src/main/window/workspace-space-window.ts b/src/main/window/workspace-space-window.ts index dca2e5c96b8..6d4fc165eed 100644 --- a/src/main/window/workspace-space-window.ts +++ b/src/main/window/workspace-space-window.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { isBackgroundLaunch, showWindowWithoutStealingFocus } from './foreground-activation-policy' import { installPrivilegedWindowNavigationPolicy } from './privileged-window-navigation' import { sendToTrustedUIRenderer } from '../ipc/ui' -import type { Store } from '../persistence' +import type { Store } from '../persistence/loading-store/store' import { stepUIZoomLevel, type UIZoomDirection } from '../../shared/ui-zoom-level' import { wslHostsWindowArguments } from '../wsl/wsl-host-gate' diff --git a/src/main/workspace-space-analysis-capacity.test.ts b/src/main/workspace-space-analysis-capacity.test.ts index cb4c1784620..a57b79f8e67 100644 --- a/src/main/workspace-space-analysis-capacity.test.ts +++ b/src/main/workspace-space-analysis-capacity.test.ts @@ -5,7 +5,7 @@ import type * as NodeProcess from 'node:process' import { afterEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../shared/repo-types' import type * as WorkspaceSpaceScanBudgetModule from '../shared/workspace-space-scan-budget' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' const { listRepoWorktreesMock } = vi.hoisted(() => ({ listRepoWorktreesMock: vi.fn() diff --git a/src/main/workspace-space-analysis-du-timeout.test.ts b/src/main/workspace-space-analysis-du-timeout.test.ts index 3c00993ec74..ddc60648380 100644 --- a/src/main/workspace-space-analysis-du-timeout.test.ts +++ b/src/main/workspace-space-analysis-du-timeout.test.ts @@ -5,7 +5,7 @@ import { EventEmitter } from 'node:events' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as NodeProcess from 'node:process' import type { Repo } from '../shared/repo-types' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' const { spawnProcessMock, listRepoWorktreesMock } = vi.hoisted(() => ({ spawnProcessMock: vi.fn(), diff --git a/src/main/workspace-space-analysis.test.ts b/src/main/workspace-space-analysis.test.ts index 115063a8e5c..36811558551 100644 --- a/src/main/workspace-space-analysis.test.ts +++ b/src/main/workspace-space-analysis.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../shared/repo-types' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' const { listRepoWorktreesMock, getLocalProjectWorktreeGitOptionsMock, workerState } = vi.hoisted( () => ({ diff --git a/src/main/workspace-space-analysis.ts b/src/main/workspace-space-analysis.ts index 97cc2b046c4..f9c31516177 100644 --- a/src/main/workspace-space-analysis.ts +++ b/src/main/workspace-space-analysis.ts @@ -1,4 +1,4 @@ -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { spawnProcessOnWorkerThread } from './worker-thread-child-process/worker-thread-child-process' import type { WorkspaceSpaceAnalysis, diff --git a/src/main/workspace-space-repo-scan.ts b/src/main/workspace-space-repo-scan.ts index a3477b282ba..8fd48580389 100644 --- a/src/main/workspace-space-repo-scan.ts +++ b/src/main/workspace-space-repo-scan.ts @@ -1,4 +1,4 @@ -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { platform } from 'node:process' import { isFolderRepo } from '../shared/repo-kind' import type { Repo } from '../shared/repo-types' diff --git a/src/main/worktree-create-preparation-cancellation.test.ts b/src/main/worktree-create-preparation-cancellation.test.ts index 0d388f3ab4a..ba306817dbc 100644 --- a/src/main/worktree-create-preparation-cancellation.test.ts +++ b/src/main/worktree-create-preparation-cancellation.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as WorktreeLogic from './ipc/worktree-logic' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { WORKTREE_CREATE_PREPARATION_TTL_MS } from './worktree-create-preparation-pool' import type { Repo } from '../shared/repo-types' import { resolveWorktreeAddBaseRef } from '../shared/worktree/base-ref' diff --git a/src/main/worktree-create-preparation-contention.test.ts b/src/main/worktree-create-preparation-contention.test.ts index 9535d63cdee..27cc73e28ba 100644 --- a/src/main/worktree-create-preparation-contention.test.ts +++ b/src/main/worktree-create-preparation-contention.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { Repo } from '../shared/repo-types' import type { AddWorktreeResult } from './git/worktree' diff --git a/src/main/worktree-create-preparation-wsl-root.test.ts b/src/main/worktree-create-preparation-wsl-root.test.ts index c9ca8c769f2..a0b85677eb6 100644 --- a/src/main/worktree-create-preparation-wsl-root.test.ts +++ b/src/main/worktree-create-preparation-wsl-root.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as WslModule from './wsl' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import type { Repo } from '../shared/repo-types' // Keep root resolvers real to catch preparation/consume key mismatches hidden by worktree-logic mocks. diff --git a/src/main/worktree-lineage-pruning.ts b/src/main/worktree-lineage-pruning.ts index 30bbd99cf4b..1c365f61a43 100644 --- a/src/main/worktree-lineage-pruning.ts +++ b/src/main/worktree-lineage-pruning.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId } from '../shared/execution-host' import { isWorkspaceKey, parseWorkspaceKey } from '../shared/workspace-scope' import { splitWorktreeId } from '../shared/worktree/id' import { worktreeRetentionPathComparisonKey } from './worktree-retention-path-comparison' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { isWslMoveRepoBlocked } from './persistence/moving-wsl-projects/wsl-move-background-backoff' import { hostWorktreeTarget } from '../shared/worktree/host-qualified-identity' diff --git a/src/main/worktree-removal-close-records.test.ts b/src/main/worktree-removal-close-records.test.ts index 663dbf656bd..712861af20b 100644 --- a/src/main/worktree-removal-close-records.test.ts +++ b/src/main/worktree-removal-close-records.test.ts @@ -47,7 +47,8 @@ async function createStore() { }) } vi.resetModules() - const { Store, initDataPath } = await import('./persistence') + const { Store } = await import('./persistence/loading-store/store') + const { initDataPath } = await import('./persistence/loading-store/user-data-path') initDataPath() return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') }) } diff --git a/src/main/worktree-removal-session-partition-fencing.test.ts b/src/main/worktree-removal-session-partition-fencing.test.ts index e1ba29be6f7..3eec38ffd9b 100644 --- a/src/main/worktree-removal-session-partition-fencing.test.ts +++ b/src/main/worktree-removal-session-partition-fencing.test.ts @@ -48,7 +48,8 @@ async function createStore() { }) } vi.resetModules() - const { Store, initDataPath } = await import('./persistence') + const { Store } = await import('./persistence/loading-store/store') + const { initDataPath } = await import('./persistence/loading-store/user-data-path') initDataPath() return createSqliteTestStore(Store, { dataFile: join(testState.dir, 'orca-data.json') }) } diff --git a/src/main/wsl-move-scan-pruning.test.ts b/src/main/wsl-move-scan-pruning.test.ts index 9a57a13bb92..1631b11b864 100644 --- a/src/main/wsl-move-scan-pruning.test.ts +++ b/src/main/wsl-move-scan-pruning.test.ts @@ -8,7 +8,7 @@ import type { WorktreeLineage } from '../shared/worktree/lineage-types' import type { GitWorktreeInfo } from '../shared/worktree/types' import { worktreeWorkspaceKey } from '../shared/workspace-scope' import { closeTestStores, createStore, testState } from './persistence/persistence-test-harness' -import type { Store } from './persistence' +import type { Store } from './persistence/loading-store/store' import { wslMoveCutoverFixture as cutover } from './persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { seedWslMoveCutover } from './persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding' import { diff --git a/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts b/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts index 10b5a09b688..45c4c32f8cc 100644 --- a/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts +++ b/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts @@ -1,6 +1,6 @@ import { readFileSync } from 'node:fs' import process from 'node:process' -import type { Store } from '../../../src/main/persistence' +import type { Store } from '../../../src/main/persistence/loading-store/store' import { OrcaRuntimeService } from '../../../src/main/runtime/orca-runtime' import { RpcDispatcher } from '../../../src/main/runtime/rpc/dispatcher' import { SESSION_TAB_METHODS } from '../../../src/main/runtime/rpc/methods/session-tabs' diff --git a/tests/e2e/fixtures/daemon-generation-profile-store.ts b/tests/e2e/fixtures/daemon-generation-profile-store.ts index 6d27724a1d7..c84d100d0b7 100644 --- a/tests/e2e/fixtures/daemon-generation-profile-store.ts +++ b/tests/e2e/fixtures/daemon-generation-profile-store.ts @@ -1,6 +1,6 @@ import path from 'node:path' import { installOrcadHostAdapters } from '../../../src/main/orcad/orcad-host-adapters' -import type { Store } from '../../../src/main/persistence' +import type { Store } from '../../../src/main/persistence/loading-store/store' import { createProfileStateStore } from '../../../src/main/persistence/profile-state/profile-state-store-factory' export function createDaemonGenerationProfileStore(directory: string): Store {