From 583ab1601bb2ff2642ce2187112aff3376c11cd7 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Thu, 13 Aug 2026 20:44:16 -0700 Subject: [PATCH] refactor(shared): group worktree, github, and linear modules into folders (#14437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `src/shared` is a flat directory of ~1,150 entries. The worktree, github, and linear domains accounted for 71 of them, so finding the module you wanted meant scanning a wall of same-prefixed filenames. Move each domain into its own folder and drop the now-redundant prefix: src/shared/github-pr-types.ts -> src/shared/github/pull-request-types.ts src/shared/worktree-id.ts -> src/shared/worktree/id.ts src/shared/linear-links.ts -> src/shared/linear/links.ts This follows the existing `network/` and `new-workspace/` convention in the same directory, which also drop the prefix inside the folder. Whole clusters move, including tests. Foldering only part of a domain would be worse than flat: a reader would have to check both `github/` and the flat directory, and `github-auth-types.ts` / `github-project-types.ts` are type modules that belong with the rest. No files with these prefixes remain flat. Import specifiers were rewritten by resolving each one to an absolute path and recomputing it, not by string substitution, so the `@/../../shared/...` alias forms are handled correctly. 501 specifiers across 298 files. Two things `tsc` cannot catch, handled explicitly: - `github-project-types.ts` carries its own `max-lines` bypass, so its baseline entry is REPOINTED to the new path rather than pruned. Pruning would drop the bypass and then flag the new path as a fresh violation. Ratchet stays at 345. - `mobile/` is outside `pnpm typecheck` and cannot be typechecked here (`mobile/node_modules` is empty). Instead every relative specifier in the repo was resolved against the filesystem: 174 unresolved before this change and 174 after — identical, so nothing broke in mobile either. The pinned `tests/e2e/.cross-version-checkouts` fixtures are deliberately NOT rewritten; they are a snapshot of an older release and still reference the old paths. Verified: cold `tsc --noEmit` green on node, cli, and web (buildinfo deleted first — these projects are `composite: true` and reuse stale caches). --- config/max-lines-baseline.txt | 2 +- .../worktree-refresh-churn-benchmark.mjs | 2 +- mobile/app/h/[hostId]/tasks.tsx | 6 +- .../agent-history-session-worktree.ts | 2 +- mobile/src/session/github-pr-rpc.ts | 2 +- mobile/src/session/pr-actions-engine.ts | 2 +- mobile/src/session/use-live-worktree-name.ts | 2 +- mobile/src/tasks/github-project-reference.ts | 2 +- mobile/src/tasks/github-project-repo-match.ts | 2 +- mobile/src/tasks/smart-source-paste-intent.ts | 2 +- src/cli/handlers/linear-list-issues.ts | 2 +- src/cli/handlers/linear-relation-write.ts | 2 +- src/cli/handlers/linear-save-issue.ts | 2 +- src/cli/handlers/linear.ts | 4 +- .../handlers/worktree-linear-issue-link.ts | 2 +- src/cli/linear-format.test.ts | 2 +- src/cli/linear-format.ts | 4 +- src/cli/linear-request-builders.ts | 6 +- src/cli/linear-save-issue-request.ts | 2 +- .../first-work-branch-rename-test-harness.ts | 2 +- .../first-work-branch-rename.test.ts | 2 +- .../agent-hooks/first-work-branch-rename.ts | 2 +- .../agent-hooks/first-work-folder-rename.ts | 2 +- .../restored-subagent-liveness-sweep.ts | 2 +- src/main/automations/run-target-resolution.ts | 2 +- src/main/daemon/wsl-session-context.ts | 2 +- src/main/git/status.ts | 2 +- src/main/git/worktree.ts | 6 +- src/main/github/auth-diagnose.ts | 2 +- .../client-work-items-query-paging.test.ts | 2 +- src/main/github/client-work-items.test.ts | 2 +- src/main/github/client.ts | 10 +- src/main/github/gh-utils.test.ts | 2 +- src/main/github/github-api-repository.ts | 2 +- .../github/github-owner-repo-selection.ts | 2 +- src/main/github/github-pr-stack.ts | 2 +- .../github/merged-pr-commit-membership.ts | 2 +- .../github/pr-refresh-error-classification.ts | 2 +- src/main/github/project-view.test.ts | 2 +- src/main/github/project-view.ts | 6 +- src/main/github/project-view/internals.ts | 6 +- src/main/github/project-view/mutations.ts | 4 +- .../project-error-classification.ts | 4 +- src/main/github/rate-limit.ts | 2 +- src/main/github/stacked-pr-creation.ts | 2 +- src/main/index.ts | 2 +- src/main/ipc/filesystem.ts | 2 +- src/main/ipc/github.ts | 2 +- src/main/ipc/linear.ts | 4 +- .../ipc/local-worktree-runtime-options.ts | 2 +- src/main/ipc/notifications.ts | 2 +- src/main/ipc/pty.ts | 2 +- src/main/ipc/remote-workspace.ts | 2 +- src/main/ipc/repos.ts | 2 +- .../ipc/source-control-ai-linked-issue.ts | 2 +- src/main/ipc/watcher-removal-gate.test.ts | 2 +- src/main/ipc/watcher-removal-gate.ts | 2 +- .../ipc/workspace-cleanup-disconnected-ssh.ts | 2 +- src/main/ipc/workspace-cleanup-scan.ts | 2 +- src/main/ipc/worktree-folder-rename-target.ts | 2 +- src/main/ipc/worktree-git-status-ref-watch.ts | 2 +- src/main/ipc/worktree-logic.ts | 2 +- src/main/ipc/worktree-push-target-cleanup.ts | 2 +- src/main/ipc/worktree-remote.ts | 4 +- src/main/ipc/worktrees.ts | 10 +- src/main/linear/issue-activity-raw.ts | 2 +- src/main/linear/issue-context-client.ts | 4 +- src/main/linear/issue-context-current.ts | 2 +- src/main/linear/issue-context-errors.ts | 2 +- src/main/linear/issue-context-fanout.ts | 2 +- .../linear/issue-context-includes.test.ts | 2 +- src/main/linear/issue-context-includes.ts | 6 +- .../linear/issue-context-inline-media.test.ts | 2 +- src/main/linear/issue-context-pagination.ts | 2 +- src/main/linear/issue-context-raw.ts | 2 +- src/main/linear/issue-context-relations.ts | 4 +- src/main/linear/issue-context-workspaces.ts | 2 +- src/main/linear/issue-context.ts | 6 +- src/main/linear/issue-list-filter.ts | 2 +- src/main/linear/issue-relation-write.ts | 4 +- src/main/linear/issues.ts | 4 +- src/main/linear/linear-team-pages.ts | 2 +- src/main/linear/mcp-issue-list.ts | 2 +- src/main/linear/projects.ts | 2 +- src/main/local-project-runtime-resolution.ts | 2 +- src/main/local-worktree-removal-recovery.ts | 2 +- src/main/memory/collector.ts | 2 +- src/main/memory/hydrate-local-pty-registry.ts | 2 +- .../profile-project-worktree-identity.ts | 2 +- src/main/persistence.ts | 6 +- .../ports/ssh-advertised-url-enrichment.ts | 2 +- src/main/ports/workspace-port-ownership.ts | 2 +- .../agent-foreground-context-paths.ts | 2 +- src/main/providers/local-pty-provider.ts | 2 +- .../folder-workspace-pty-identity.test.ts | 2 +- src/main/runtime/linear-save-issue.test.ts | 2 +- ...issing-worktree-terminal-reconciliation.ts | 2 +- src/main/runtime/orca-runtime.test.ts | 2 +- src/main/runtime/orca-runtime.ts | 22 +-- src/main/runtime/orchestration/cli-command.ts | 2 +- src/main/runtime/rpc/errors.ts | 2 +- .../runtime/rpc/methods/client-ui-schemas.ts | 2 +- .../runtime/rpc/methods/client-ui.test.ts | 2 +- .../rpc/methods/linear-agent-access.ts | 2 +- .../linear-issue-attribute-filter-schema.ts | 2 +- .../runtime/rpc/methods/repo-update-schema.ts | 2 +- .../runtime/runtime-folder-workspace.test.ts | 2 +- src/main/runtime/runtime-folder-workspace.ts | 2 +- .../runtime/unstopped-pty-verification.ts | 2 +- ...e-session-terminal-membership-authority.ts | 2 +- .../worktree-teardown-unstopped-pty.test.ts | 2 +- src/main/runtime/worktree-teardown.ts | 4 +- .../source-control/hosted-review-creation.ts | 2 +- .../ssh-remote-linear-activity-output.test.ts | 2 +- src/main/ssh/ssh-remote-linear-list-issues.ts | 2 +- src/main/ssh/ssh-remote-linear-output.ts | 4 +- src/main/ssh/ssh-remote-linear-read-cli.ts | 2 +- .../ssh/ssh-remote-linear-relation-write.ts | 2 +- .../ssh/ssh-remote-linear-result-guards.ts | 2 +- .../ssh/ssh-remote-linear-write-support.ts | 2 +- src/main/usage-worktree-metadata.ts | 2 +- src/main/worktree-create-base-prefetch.ts | 2 +- src/preload/api-types.ts | 6 +- src/preload/index.ts | 4 +- src/relay/git-handler-worktree-ops.ts | 2 +- src/relay/git-handler-worktree-remove.ts | 4 +- src/relay/pty-handler.ts | 2 +- .../src/components/GitHubItemDialog.tsx | 4 +- .../src/components/PullRequestPage.tsx | 4 +- src/renderer/src/components/TaskPage.tsx | 12 +- .../automations/AutomationsPage.tsx | 2 +- .../src/components/github-pr-merge-state.ts | 2 +- .../github-project/GhAuthErrorHelp.test.ts | 2 +- .../github-project/GhAuthErrorHelp.tsx | 4 +- .../components/github-project/ProjectCell.tsx | 2 +- .../github-project/ProjectGroupHeader.tsx | 2 +- .../github-project/ProjectPicker.tsx | 6 +- .../components/github-project/ProjectRow.tsx | 2 +- .../github-project/ProjectViewList.tsx | 4 +- .../github-project/ProjectViewWrapper.tsx | 4 +- .../github-project/column-widths.ts | 2 +- .../src/components/github-project/columns.ts | 2 +- .../github-project-picker-filter.test.ts | 2 +- .../github-project-picker-filter.ts | 4 +- .../github-project/group-sort.test.ts | 4 +- .../project-picker-browse-cache.test.ts | 2 +- .../project-picker-browse-cache.ts | 2 +- .../project-row-filtering.test.ts | 2 +- .../github-project/project-row-filtering.ts | 2 +- ...ew-wrapper-source-context-boundary.test.ts | 2 +- .../project-visible-table-cache.test.ts | 2 +- .../project-visible-table-cache.ts | 2 +- .../github-project/slug-dialog/Comments.tsx | 2 +- .../github/IssueSourceIndicator.tsx | 2 +- .../github/github-work-item-edit-mutations.ts | 2 +- .../github/github-work-item-identity.ts | 2 +- .../src/components/linear-api-key-dialog.tsx | 2 +- ...-issue-attribute-filter-dropdowns.test.tsx | 2 +- ...inear-issue-attribute-filter-dropdowns.tsx | 2 +- ...linear-issue-attribute-filter-sections.tsx | 2 +- .../linear-issue-view-storage.test.ts | 2 +- .../components/linear-issue-view-storage.ts | 2 +- .../new-workspace/SmartWorkspaceNameField.tsx | 2 +- .../components/right-sidebar/ChecksPanel.tsx | 4 +- .../right-sidebar/HostedReviewActions.tsx | 2 +- .../right-sidebar/ai-vault-scope-paths.ts | 2 +- .../ai-vault-session-row-display.tsx | 2 +- .../ai-vault-session-worktree.ts | 2 +- .../checks-panel-async-result-key.ts | 2 +- .../checks-panel-terminal-worktree.ts | 2 +- .../components/settings/McpConfigSection.tsx | 2 +- .../settings/manage-sessions-format.ts | 2 +- .../settings/repository-icon-github.ts | 2 +- .../repository-runtime-session-summary.ts | 2 +- .../PreservedBranchBatchReviewDialog.tsx | 2 +- .../sidebar/WorktreeCard.pr-display.test.tsx | 2 +- .../src/components/sidebar/WorktreeList.tsx | 2 +- .../sidebar/WorktreeVisibilityDialog.tsx | 2 +- .../sidebar/WorktreeVisibilitySourceList.tsx | 2 +- .../sidebar/delete-worktree-failure-toast.tsx | 2 +- .../sidebar/delete-worktree-toast.test.ts | 2 +- .../sidebar/delete-worktree-toast.ts | 2 +- .../imported-worktrees-card-candidates.ts | 2 +- .../sidebar/preserved-branch-batch-toast.tsx | 2 +- .../sidebar/use-worktree-issue-link.ts | 2 +- .../sidebar/worktree-meta-updates.ts | 2 +- .../status-bar/WorkspaceSpaceManagerPanel.tsx | 2 +- .../status-bar/mergeSnapshotAndSessions.ts | 2 +- .../tab-bar/TabBarQuickCommandsButton.tsx | 2 +- .../task-page-linear-in-orca-issues.ts | 2 +- ...task-page-linear-issue-empty-state.test.ts | 2 +- .../task-page-linear-issue-empty-state.ts | 2 +- .../task-page-linear-issue-request.test.ts | 2 +- .../task-page-linear-issue-request.ts | 2 +- .../task-page-localized-options.tsx | 4 +- .../components/terminal-pane/TerminalPane.tsx | 2 +- .../terminal-pane/pty-connection.test.ts | 2 +- .../terminal-pane/pty-connection.ts | 2 +- .../hooks/remote-workspace-session-merge.ts | 2 +- src/renderer/src/hooks/useComposerState.ts | 2 +- .../src/hooks/useGitHubSlugMetadata.ts | 6 +- .../src/lib/ai-vault-resume-target.ts | 2 +- .../src/lib/cmd-j-github-url-lookup.ts | 2 +- .../src/lib/cmd-j-linear-issue-intent.test.ts | 2 +- .../src/lib/connection-owner-resolution.ts | 2 +- .../src/lib/linear-issue-url-lookup.ts | 2 +- .../lib/linear-issue-workspace-attachment.ts | 2 +- src/renderer/src/lib/repo-slug-cache.test.ts | 2 +- src/renderer/src/lib/repo-slug-cache.ts | 2 +- src/renderer/src/lib/repo-slug-index.ts | 2 +- src/renderer/src/lib/smart-github-submit.ts | 2 +- .../lib/workspace-session-host-persistence.ts | 2 +- .../lib/workspace-session-hydration-keys.ts | 2 +- .../lib/worktree-palette-task-url-match.ts | 6 +- .../runtime/github-check-details-timeout.ts | 2 +- .../src/runtime/runtime-git-client.ts | 2 +- .../src/runtime/runtime-linear-client.ts | 4 +- .../slices/degraded-repo-worktree-validity.ts | 2 +- .../src/store/slices/github-checks.ts | 2 +- .../slices/github-work-items-query-bounds.ts | 2 +- src/renderer/src/store/slices/github.ts | 14 +- src/renderer/src/store/slices/linear.ts | 4 +- src/renderer/src/store/slices/repos.ts | 4 +- src/renderer/src/store/slices/terminals.ts | 2 +- .../src/store/slices/worktree-helpers.ts | 6 +- src/renderer/src/store/slices/worktrees.ts | 4 +- src/shared/agent-scratch-worktrees.ts | 2 +- src/shared/constants.ts | 4 +- src/shared/external-worktree-inbox.test.ts | 2 +- src/shared/folder-workspace-types.ts | 2 +- .../api-availability.test.ts} | 2 +- .../api-availability.ts} | 0 .../auth-types.ts} | 0 .../check-details-deadline.ts} | 0 .../check-types.ts} | 0 .../comment-types.ts} | 2 +- .../{github-links.ts => github/links.ts} | 0 .../project-group-sort.ts} | 2 +- .../project-identity.test.ts} | 2 +- .../project-identity.ts} | 2 +- .../project-ref-input.test.ts} | 2 +- .../project-ref-input.ts} | 2 +- .../project-types.ts} | 2 +- ...l-request-auto-merge-availability.test.ts} | 2 +- .../pull-request-auto-merge-availability.ts} | 2 +- .../pull-request-for-branch-outcome.test.ts} | 4 +- .../pull-request-for-branch-outcome.ts} | 2 +- .../pull-request-merge-methods.test.ts} | 2 +- .../pull-request-merge-methods.ts} | 2 +- .../pull-request-refresh-types.ts} | 4 +- .../pull-request-types.ts} | 0 .../rate-limit-types.ts} | 0 .../repository-identity-key.test.ts} | 2 +- .../repository-identity-key.ts} | 0 .../work-item-types.ts} | 8 +- .../work-items-query-bounds.test.ts} | 2 +- .../work-items-query-bounds.ts} | 2 +- src/shared/global-settings-types.ts | 4 +- src/shared/issue-link-input.ts | 4 +- .../agent-access.ts} | 10 +- .../agent-result-types.ts} | 6 +- .../inline-media.test.ts} | 2 +- .../inline-media.ts} | 0 .../issue-activity.ts} | 2 +- .../issue-attribute-filter.test.ts} | 2 +- .../issue-attribute-filter.ts} | 0 .../issue-read-limits.ts} | 0 .../issue-relation-write.ts} | 4 +- .../issue-types.ts} | 2 +- .../issue-view-resume-state.test.ts} | 4 +- .../issue-view-resume-state.ts} | 2 +- .../links.test.ts} | 2 +- .../{linear-links.ts => linear/links.ts} | 2 +- .../mcp-issue-list.ts} | 4 +- .../project-list-format.ts} | 2 +- .../project-types.ts} | 0 src/shared/{linear-uuid.ts => linear/uuid.ts} | 0 .../workspace-types.ts} | 0 src/shared/new-workspace/github-links.ts | 4 +- .../smart-workspace-linear-intent.ts | 2 +- src/shared/new-workspace/workspace-source.ts | 2 +- src/shared/persisted-state-types.ts | 8 +- src/shared/persisted-ui-state-types.ts | 2 +- src/shared/project-host-setup-projection.ts | 2 +- .../remote-workspace-session-projection.ts | 2 +- src/shared/repo-types.ts | 2 +- src/shared/task-provider-identity.ts | 2 +- .../terminal-github-pr-link-detector.ts | 4 +- src/shared/terminal-startup-cwd.ts | 2 +- src/shared/types.ts | 149 ++++++++++-------- src/shared/ui-chrome-types.ts | 4 +- .../workspace-session-terminal-buffers.ts | 2 +- .../base-ref-drift-types.ts} | 0 .../base-ref.test.ts} | 2 +- .../base-ref.ts} | 0 .../card-properties.test.ts} | 2 +- .../card-properties.ts} | 2 +- .../create-types.ts} | 22 ++- .../id.test.ts} | 2 +- src/shared/{worktree-id.ts => worktree/id.ts} | 4 +- .../launch-types.ts} | 12 +- .../lineage-types.ts} | 2 +- .../meta-types.ts} | 14 +- .../ownership-worktree-base-path.test.ts} | 4 +- .../ownership.test.ts} | 6 +- .../ownership.ts} | 16 +- .../removal-fence-error.test.ts} | 2 +- .../removal-fence-error.ts} | 0 .../removal-force-classification.test.ts} | 2 +- .../removal.ts} | 2 +- .../sort-order-update.test.ts} | 2 +- .../sort-order-update.ts} | 0 .../submodule-removal.test.ts} | 2 +- .../submodule-removal.ts} | 0 .../{worktree-types.ts => worktree/types.ts} | 14 +- .../visibility-sources.test.ts} | 4 +- .../visibility-sources.ts} | 4 +- ...completed-worker-retirement-resume.spec.ts | 2 +- 318 files changed, 526 insertions(+), 509 deletions(-) rename src/shared/{github-api-availability.test.ts => github/api-availability.test.ts} (98%) rename src/shared/{github-api-availability.ts => github/api-availability.ts} (100%) rename src/shared/{github-auth-types.ts => github/auth-types.ts} (100%) rename src/shared/{github-check-details-deadline.ts => github/check-details-deadline.ts} (100%) rename src/shared/{github-check-types.ts => github/check-types.ts} (100%) rename src/shared/{github-comment-types.ts => github/comment-types.ts} (97%) rename src/shared/{github-links.ts => github/links.ts} (100%) rename src/shared/{github-project-group-sort.ts => github/project-group-sort.ts} (99%) rename src/shared/{github-project-identity.test.ts => github/project-identity.test.ts} (90%) rename src/shared/{github-project-identity.ts => github/project-identity.ts} (92%) rename src/shared/{github-project-ref-input.test.ts => github/project-ref-input.test.ts} (97%) rename src/shared/{github-project-ref-input.ts => github/project-ref-input.ts} (95%) rename src/shared/{github-project-types.ts => github/project-types.ts} (99%) rename src/shared/{github-pr-auto-merge-availability.test.ts => github/pull-request-auto-merge-availability.test.ts} (98%) rename src/shared/{github-pr-auto-merge-availability.ts => github/pull-request-auto-merge-availability.ts} (99%) rename src/shared/{github-pr-for-branch-outcome.test.ts => github/pull-request-for-branch-outcome.test.ts} (88%) rename src/shared/{github-pr-for-branch-outcome.ts => github/pull-request-for-branch-outcome.ts} (89%) rename src/shared/{github-pr-merge-methods.test.ts => github/pull-request-merge-methods.test.ts} (97%) rename src/shared/{github-pr-merge-methods.ts => github/pull-request-merge-methods.ts} (99%) rename src/shared/{github-pr-refresh-types.ts => github/pull-request-refresh-types.ts} (98%) rename src/shared/{github-pr-types.ts => github/pull-request-types.ts} (100%) rename src/shared/{github-rate-limit-types.ts => github/rate-limit-types.ts} (100%) rename src/shared/{github-repository-identity-key.test.ts => github/repository-identity-key.test.ts} (84%) rename src/shared/{github-repository-identity-key.ts => github/repository-identity-key.ts} (100%) rename src/shared/{github-work-item-types.ts => github/work-item-types.ts} (96%) rename src/shared/{github-work-items-query-bounds.test.ts => github/work-items-query-bounds.test.ts} (95%) rename src/shared/{github-work-items-query-bounds.ts => github/work-items-query-bounds.ts} (87%) rename src/shared/{linear-agent-access.ts => linear/agent-access.ts} (96%) rename src/shared/{linear-agent-result-types.ts => linear/agent-result-types.ts} (97%) rename src/shared/{linear-inline-media.test.ts => linear/inline-media.test.ts} (95%) rename src/shared/{linear-inline-media.ts => linear/inline-media.ts} (100%) rename src/shared/{linear-issue-activity.ts => linear/issue-activity.ts} (89%) rename src/shared/{linear-issue-attribute-filter.test.ts => linear/issue-attribute-filter.test.ts} (99%) rename src/shared/{linear-issue-attribute-filter.ts => linear/issue-attribute-filter.ts} (100%) rename src/shared/{linear-issue-read-limits.ts => linear/issue-read-limits.ts} (100%) rename src/shared/{linear-issue-relation-write.ts => linear/issue-relation-write.ts} (86%) rename src/shared/{linear-issue-types.ts => linear/issue-types.ts} (92%) rename src/shared/{linear-issue-view-resume-state.test.ts => linear/issue-view-resume-state.test.ts} (99%) rename src/shared/{linear-issue-view-resume-state.ts => linear/issue-view-resume-state.ts} (99%) rename src/shared/{linear-links.test.ts => linear/links.test.ts} (99%) rename src/shared/{linear-links.ts => linear/links.ts} (99%) rename src/shared/{linear-mcp-issue-list.ts => linear/mcp-issue-list.ts} (90%) rename src/shared/{linear-project-list-format.ts => linear/project-list-format.ts} (94%) rename src/shared/{linear-project-types.ts => linear/project-types.ts} (100%) rename src/shared/{linear-uuid.ts => linear/uuid.ts} (100%) rename src/shared/{linear-workspace-types.ts => linear/workspace-types.ts} (100%) rename src/shared/{worktree-base-ref-drift-types.ts => worktree/base-ref-drift-types.ts} (100%) rename src/shared/{worktree-base-ref.test.ts => worktree/base-ref.test.ts} (97%) rename src/shared/{worktree-base-ref.ts => worktree/base-ref.ts} (100%) rename src/shared/{worktree-card-properties.test.ts => worktree/card-properties.test.ts} (98%) rename src/shared/{worktree-card-properties.ts => worktree/card-properties.ts} (99%) rename src/shared/{worktree-create-types.ts => worktree/create-types.ts} (92%) rename src/shared/{worktree-id.test.ts => worktree/id.test.ts} (99%) rename src/shared/{worktree-id.ts => worktree/id.ts} (93%) rename src/shared/{worktree-launch-types.ts => worktree/launch-types.ts} (74%) rename src/shared/{worktree-lineage-types.ts => worktree/lineage-types.ts} (95%) rename src/shared/{worktree-meta-types.ts => worktree/meta-types.ts} (90%) rename src/shared/{worktree-ownership-worktree-base-path.test.ts => worktree/ownership-worktree-base-path.test.ts} (96%) rename src/shared/{worktree-ownership.test.ts => worktree/ownership.test.ts} (99%) rename src/shared/{worktree-ownership.ts => worktree/ownership.ts} (96%) rename src/shared/{worktree-removal-fence-error.test.ts => worktree/removal-fence-error.test.ts} (96%) rename src/shared/{worktree-removal-fence-error.ts => worktree/removal-fence-error.ts} (100%) rename src/shared/{worktree-removal-force-classification.test.ts => worktree/removal-force-classification.test.ts} (99%) rename src/shared/{worktree-removal.ts => worktree/removal.ts} (99%) rename src/shared/{worktree-sort-order-update.test.ts => worktree/sort-order-update.test.ts} (95%) rename src/shared/{worktree-sort-order-update.ts => worktree/sort-order-update.ts} (100%) rename src/shared/{worktree-submodule-removal.test.ts => worktree/submodule-removal.test.ts} (93%) rename src/shared/{worktree-submodule-removal.ts => worktree/submodule-removal.ts} (100%) rename src/shared/{worktree-types.ts => worktree/types.ts} (94%) rename src/shared/{worktree-visibility-sources.test.ts => worktree/visibility-sources.test.ts} (98%) rename src/shared/{worktree-visibility-sources.ts => worktree/visibility-sources.ts} (99%) diff --git a/config/max-lines-baseline.txt b/config/max-lines-baseline.txt index bece70eff7e..17f573b47d1 100644 --- a/config/max-lines-baseline.txt +++ b/config/max-lines-baseline.txt @@ -318,7 +318,7 @@ inline src/shared/agent-hook-listener.ts inline src/shared/automation-schedules.ts inline src/shared/commit-message-agent-spec.ts inline src/shared/constants.ts -inline src/shared/github-project-types.ts +inline src/shared/github/project-types.ts inline src/shared/keybindings.test.ts inline src/shared/keybindings.ts inline src/shared/marine-creatures.ts diff --git a/config/scripts/worktree-refresh-churn-benchmark.mjs b/config/scripts/worktree-refresh-churn-benchmark.mjs index 67265305322..5a165801ded 100644 --- a/config/scripts/worktree-refresh-churn-benchmark.mjs +++ b/config/scripts/worktree-refresh-churn-benchmark.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env node import { performance } from 'node:perf_hooks' -import { planWorktreeSortOrderUpdates } from '../../src/shared/worktree-sort-order-update.ts' +import { planWorktreeSortOrderUpdates } from '../../src/shared/worktree/sort-order-update.ts' import { reuseEqualCatalogRows } from '../../src/renderer/src/store/slices/worktree-catalog-reconciliation.ts' const WORKTREE_COUNT = 655 diff --git a/mobile/app/h/[hostId]/tasks.tsx b/mobile/app/h/[hostId]/tasks.tsx index 553490b4748..7ef451df8aa 100644 --- a/mobile/app/h/[hostId]/tasks.tsx +++ b/mobile/app/h/[hostId]/tasks.tsx @@ -119,11 +119,11 @@ import { isIterationCurrent, sortRows, type ProjectGroup -} from '../../../../src/shared/github-project-group-sort' +} from '../../../../src/shared/github/project-group-sort' import type { GitHubProjectSortDirection, GitHubProjectTable as SharedGitHubProjectTable -} from '../../../../src/shared/github-project-types' +} from '../../../../src/shared/github/project-types' import { CROSS_REPO_DISPLAY_LIMIT, isGitHubWorkItemsSshRemoteRequiredError, @@ -161,7 +161,7 @@ import type { HostedReviewDecision } from '../../../../src/shared/hosted-review' import { githubProjectHost, githubProjectIdentityKey as githubProjectKey -} from '../../../../src/shared/github-project-identity' +} from '../../../../src/shared/github/project-identity' type RepoSummary = { id: string diff --git a/mobile/src/agent-history/agent-history-session-worktree.ts b/mobile/src/agent-history/agent-history-session-worktree.ts index 0e859bbf5ee..4e2a6c7b6a6 100644 --- a/mobile/src/agent-history/agent-history-session-worktree.ts +++ b/mobile/src/agent-history/agent-history-session-worktree.ts @@ -1,6 +1,6 @@ import { isPathInsideOrEqual, isRuntimePathAbsolute } from '../../../src/shared/cross-platform-path' import { parseWslUncPath } from '../../../src/shared/wsl-paths' -import { splitWorktreeIdForFilesystem } from '../../../src/shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../src/shared/worktree/id' import type { AiVaultSession } from '../../../src/shared/ai-vault-types' import type { Worktree } from '../worktree/workspace-list-types' diff --git a/mobile/src/session/github-pr-rpc.ts b/mobile/src/session/github-pr-rpc.ts index a2583376662..a34ed49581c 100644 --- a/mobile/src/session/github-pr-rpc.ts +++ b/mobile/src/session/github-pr-rpc.ts @@ -9,7 +9,7 @@ import type { HostedReviewInfo } from '../../../src/shared/hosted-review' import { normalizeGitHubPRForBranchOutcome, type GitHubPRForBranchResponse -} from '../../../src/shared/github-pr-for-branch-outcome' +} from '../../../src/shared/github/pull-request-for-branch-outcome' import type { RpcClient } from '../transport/rpc-client' import type { RpcSuccess } from '../transport/types' import { mobileRepoSelectorFromWorktreeId } from '../source-control/mobile-pr-create' diff --git a/mobile/src/session/pr-actions-engine.ts b/mobile/src/session/pr-actions-engine.ts index ce19c9bbbf9..cc5bfde80a3 100644 --- a/mobile/src/session/pr-actions-engine.ts +++ b/mobile/src/session/pr-actions-engine.ts @@ -1,5 +1,5 @@ import type { GitHubPRMergeMethod, PRState } from '../../../src/shared/types' -import { githubRepoIdentityKey } from '../../../src/shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../src/shared/github/repository-identity-key' import { classifyPrSidebarFailure } from './mobile-pr-sidebar-state' import { createOptimisticField, type OptimisticField } from './optimistic-write-sequence' import type { GitHubPrMutationOutcome } from './github-pr-mutations' diff --git a/mobile/src/session/use-live-worktree-name.ts b/mobile/src/session/use-live-worktree-name.ts index a2bc6d1175c..f0e9fa32138 100644 --- a/mobile/src/session/use-live-worktree-name.ts +++ b/mobile/src/session/use-live-worktree-name.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { useFocusEffect } from 'expo-router' import type { RuntimeClientEventStreamMessage } from '../../../src/shared/runtime-client-events' -import { getRepoIdFromWorktreeId } from '../../../src/shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../src/shared/worktree/id' import type { RpcClient } from '../transport/rpc-client' import type { ConnectionState, RpcSuccess } from '../transport/types' import { getLiveWorktreeDisplayName, type WorktreeDisplayNameSource } from './worktree-display-name' diff --git a/mobile/src/tasks/github-project-reference.ts b/mobile/src/tasks/github-project-reference.ts index 00047f15f53..5ed7ef22ead 100644 --- a/mobile/src/tasks/github-project-reference.ts +++ b/mobile/src/tasks/github-project-reference.ts @@ -1,4 +1,4 @@ -import type { GitHubProjectIdentity } from '../../../src/shared/github-project-identity' +import type { GitHubProjectIdentity } from '../../../src/shared/github/project-identity' export type GitHubProjectOwnerType = GitHubProjectIdentity['ownerType'] export type GitHubProjectRef = GitHubProjectIdentity diff --git a/mobile/src/tasks/github-project-repo-match.ts b/mobile/src/tasks/github-project-repo-match.ts index 06a4f94e802..7a9ba339d1a 100644 --- a/mobile/src/tasks/github-project-repo-match.ts +++ b/mobile/src/tasks/github-project-repo-match.ts @@ -1,7 +1,7 @@ import { githubRepoIdentityKey, isDefaultGitHubHost -} from '../../../src/shared/github-repository-identity-key' +} from '../../../src/shared/github/repository-identity-key' export type GitHubProjectRepoMatch = { id: string diff --git a/mobile/src/tasks/smart-source-paste-intent.ts b/mobile/src/tasks/smart-source-paste-intent.ts index 00f4c0d9ee7..534d36fd0f4 100644 --- a/mobile/src/tasks/smart-source-paste-intent.ts +++ b/mobile/src/tasks/smart-source-paste-intent.ts @@ -9,7 +9,7 @@ import { parseGitLabIssueOrMRLink } from '../../../src/shared/new-workspace/gitl import { isSmartWorkspaceSourceQueryWithinLimit } from '../../../src/shared/new-workspace/smart-workspace-source-results' import type { RpcClient } from '../transport/rpc-client' import type { RpcSuccess } from '../transport/types' -import { githubRepoIdentityKey } from '../../../src/shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../src/shared/github/repository-identity-key' // A repo the picker can switch to for a cross-repo GitHub paste. Slug is derived // best-effort from the repo's remote metadata. diff --git a/src/cli/handlers/linear-list-issues.ts b/src/cli/handlers/linear-list-issues.ts index 8e4801c1ec5..51efa1b711e 100644 --- a/src/cli/handlers/linear-list-issues.ts +++ b/src/cli/handlers/linear-list-issues.ts @@ -1,7 +1,7 @@ import type { LinearMcpIssueListRequest, LinearMcpIssueListResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import type { CommandHandler } from '../dispatch' import { getOptionalNonNegativeIntegerFlag, diff --git a/src/cli/handlers/linear-relation-write.ts b/src/cli/handlers/linear-relation-write.ts index 7257780a86f..2a718442df7 100644 --- a/src/cli/handlers/linear-relation-write.ts +++ b/src/cli/handlers/linear-relation-write.ts @@ -2,7 +2,7 @@ import type { LinearIssueRelationship, LinearIssueRelationWriteRequest, LinearIssueRelationWriteResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import type { CommandHandler } from '../dispatch' import { getRequiredStringFlag } from '../flags' import { printResult } from '../format' diff --git a/src/cli/handlers/linear-save-issue.ts b/src/cli/handlers/linear-save-issue.ts index 7c64c6523b7..c946e0d15c9 100644 --- a/src/cli/handlers/linear-save-issue.ts +++ b/src/cli/handlers/linear-save-issue.ts @@ -1,7 +1,7 @@ import type { LinearSaveIssueRequest, LinearSaveIssueResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import type { CommandHandler } from '../dispatch' import { printResult } from '../format' import { formatLinearSaveIssue } from '../linear-format' diff --git a/src/cli/handlers/linear.ts b/src/cli/handlers/linear.ts index 68204fa7a9e..8a04fa4707a 100644 --- a/src/cli/handlers/linear.ts +++ b/src/cli/handlers/linear.ts @@ -19,8 +19,8 @@ import type { LinearTeamListResult, LinearTeamMembersResult, LinearTeamStatesResult -} from '../../shared/linear-agent-access' -import { clampLinearSearchLimit } from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' +import { clampLinearSearchLimit } from '../../shared/linear/agent-access' import type { CommandHandler } from '../dispatch' import { printResult } from '../format' import { RuntimeClientError } from '../runtime-client' diff --git a/src/cli/handlers/worktree-linear-issue-link.ts b/src/cli/handlers/worktree-linear-issue-link.ts index c8e1020d847..01c90e4d1f9 100644 --- a/src/cli/handlers/worktree-linear-issue-link.ts +++ b/src/cli/handlers/worktree-linear-issue-link.ts @@ -2,7 +2,7 @@ import { buildLinearIssueLinkUpdates, LINEAR_ISSUE_LINK_CLEARED, type LinearIssueLinkUpdates -} from '../../shared/linear-links' +} from '../../shared/linear/links' import { RuntimeClientError } from '../runtime-client' export function getOptionalLinearIssueLinkFlag( diff --git a/src/cli/linear-format.test.ts b/src/cli/linear-format.test.ts index ab6a7681133..caa6b0bb7de 100644 --- a/src/cli/linear-format.test.ts +++ b/src/cli/linear-format.test.ts @@ -5,7 +5,7 @@ import type { LinearMcpIssueListResult, LinearProjectListResult, LinearSearchResult -} from '../shared/linear-agent-access' +} from '../shared/linear/agent-access' import { formatLinearCreate, formatLinearIssue, diff --git a/src/cli/linear-format.ts b/src/cli/linear-format.ts index d6aa5df0a95..969923d46ef 100644 --- a/src/cli/linear-format.ts +++ b/src/cli/linear-format.ts @@ -16,11 +16,11 @@ import type { LinearTeamMembersResult, LinearTeamStatesResult, LinearStatusSetResult -} from '../shared/linear-agent-access' +} from '../shared/linear/agent-access' import { formatLinearProjectListRows, linearProjectListWarningLines -} from '../shared/linear-project-list-format' +} from '../shared/linear/project-list-format' export function formatLinearIssue(result: LinearIssueContextResult): string { const issue = result.issue diff --git a/src/cli/linear-request-builders.ts b/src/cli/linear-request-builders.ts index 34d1ee9d473..4af1f91dd57 100644 --- a/src/cli/linear-request-builders.ts +++ b/src/cli/linear-request-builders.ts @@ -6,13 +6,13 @@ import type { LinearIssueRequest, LinearIssueTaskUpdateRequest, LinearWriteTargetRequest -} from '../shared/linear-agent-access' +} from '../shared/linear/agent-access' import { LINEAR_CHILDREN_MAX_DEPTH, LINEAR_WRITE_BODY_CAP, clampLinearIssueDepth -} from '../shared/linear-agent-access' -import { isLinearUuid } from '../shared/linear-uuid' +} from '../shared/linear/agent-access' +import { isLinearUuid } from '../shared/linear/uuid' import { getOptionalNonNegativeIntegerFlag, getOptionalStringFlag, diff --git a/src/cli/linear-save-issue-request.ts b/src/cli/linear-save-issue-request.ts index 786f2b252be..95111463cc8 100644 --- a/src/cli/linear-save-issue-request.ts +++ b/src/cli/linear-save-issue-request.ts @@ -1,4 +1,4 @@ -import type { LinearSaveIssueRequest } from '../shared/linear-agent-access' +import type { LinearSaveIssueRequest } from '../shared/linear/agent-access' import { getOptionalNullableNumberFlag, getOptionalStringFlag, diff --git a/src/main/agent-hooks/first-work-branch-rename-test-harness.ts b/src/main/agent-hooks/first-work-branch-rename-test-harness.ts index 1f30a6e6b2c..427e2539722 100644 --- a/src/main/agent-hooks/first-work-branch-rename-test-harness.ts +++ b/src/main/agent-hooks/first-work-branch-rename-test-harness.ts @@ -1,6 +1,6 @@ import type { vi } from 'vitest' import type { GlobalSettings, Repo } from '../../shared/types' -import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree-id' +import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree/id' import type { FirstWorkBranchRenameDeps, FirstWorkBranchRenameEvent diff --git a/src/main/agent-hooks/first-work-branch-rename.test.ts b/src/main/agent-hooks/first-work-branch-rename.test.ts index e8d8cd5f373..7690215eedb 100644 --- a/src/main/agent-hooks/first-work-branch-rename.test.ts +++ b/src/main/agent-hooks/first-work-branch-rename.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { GlobalSettings, Repo } from '../../shared/types' -import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree-id' +import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree/id' const { gitExecFileAsyncMock, diff --git a/src/main/agent-hooks/first-work-branch-rename.ts b/src/main/agent-hooks/first-work-branch-rename.ts index 02784cbef86..ea2614a344a 100644 --- a/src/main/agent-hooks/first-work-branch-rename.ts +++ b/src/main/agent-hooks/first-work-branch-rename.ts @@ -1,6 +1,6 @@ // On first agent work in a fresh workspace, replace the auto-generated creature branch (e.g. `you/Nautilus`) with a short work-derived name. import type { GlobalSettings, Repo } from '../../shared/types' -import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { parseWorkspaceKey } from '../../shared/workspace-scope' import { parsePaneKey } from '../../shared/stable-pane-id' import { diff --git a/src/main/agent-hooks/first-work-folder-rename.ts b/src/main/agent-hooks/first-work-folder-rename.ts index c7050310834..79b3f98493e 100644 --- a/src/main/agent-hooks/first-work-folder-rename.ts +++ b/src/main/agent-hooks/first-work-folder-rename.ts @@ -10,7 +10,7 @@ import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR, getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem -} from '../../shared/worktree-id' +} from '../../shared/worktree/id' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' import { planWorktreeFolderRename } from '../ipc/worktree-folder-rename-target' diff --git a/src/main/agent-hooks/restored-subagent-liveness-sweep.ts b/src/main/agent-hooks/restored-subagent-liveness-sweep.ts index 6fcea40a8cf..e44a47f11d0 100644 --- a/src/main/agent-hooks/restored-subagent-liveness-sweep.ts +++ b/src/main/agent-hooks/restored-subagent-liveness-sweep.ts @@ -5,7 +5,7 @@ import { type ExecutionHostId } from '../../shared/execution-host' import type { FolderWorkspace, ProjectGroup } from '../../shared/types' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { parseWorkspaceKey } from '../../shared/workspace-scope' export type RestoredSubagentLivenessSweepDeps = { diff --git a/src/main/automations/run-target-resolution.ts b/src/main/automations/run-target-resolution.ts index 5ff447d6537..1168bf8fb6a 100644 --- a/src/main/automations/run-target-resolution.ts +++ b/src/main/automations/run-target-resolution.ts @@ -3,7 +3,7 @@ import type { Automation } from '../../shared/automations-types' import { getAutomationLegacyRepoId } from '../../shared/automation-run-identity' import { getRepoExecutionHostId, parseExecutionHostId } from '../../shared/execution-host' import type { ProjectHostSetup, Repo } from '../../shared/types' -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' export type AutomationRunTargetResult = | { ok: true; cwd: string; repo: Repo; setup?: ProjectHostSetup } diff --git a/src/main/daemon/wsl-session-context.ts b/src/main/daemon/wsl-session-context.ts index fa69089f55b..0cf419872f9 100644 --- a/src/main/daemon/wsl-session-context.ts +++ b/src/main/daemon/wsl-session-context.ts @@ -1,4 +1,4 @@ -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { isWslShellName } from '../../shared/local-windows-terminal-runtime' import { getDefaultWslDistro, parseWslPath } from '../wsl' import { parsePtySessionId } from './pty-session-id' diff --git a/src/main/git/status.ts b/src/main/git/status.ts index a51d1784ddf..31f364789de 100644 --- a/src/main/git/status.ts +++ b/src/main/git/status.ts @@ -46,7 +46,7 @@ import { removeSafeUntrackedDiscardTargets } from '../../shared/git-discard-path-safety' import { readBranchCompareHead } from '../../shared/git-branch-compare-head' -import { resolveWorktreeAddBaseRef } from '../../shared/worktree-base-ref' +import { resolveWorktreeAddBaseRef } from '../../shared/worktree/base-ref' import { resolveWorktreeBaseCommitOid } from './worktree-base-ref-probe' import { getLargeDiffRenderLimit } from '../../shared/large-diff-render-limit' import { InFlightPromiseDedupe, stableInFlightKey } from '../../shared/in-flight-promise-dedupe' diff --git a/src/main/git/worktree.ts b/src/main/git/worktree.ts index 9ee8eb2e188..11439bff0ae 100644 --- a/src/main/git/worktree.ts +++ b/src/main/git/worktree.ts @@ -5,7 +5,7 @@ import { branchHasNoUnmergedChangesWithLazyTargetRefresh, getBranchCleanupTargetRefs } from '../../shared/git-branch-cleanup' -import { resolveWorktreeAddBaseRef } from '../../shared/worktree-base-ref' +import { resolveWorktreeAddBaseRef } from '../../shared/worktree/base-ref' import { withSpan } from '../observability/tracer' import { withWorktreeRemoveStageSpan } from '../observability/instrumentation' import { @@ -20,8 +20,8 @@ import type { LocalBaseRefUpdateSuggestion, RemoveWorktreeResult } from '../../shared/types' -import { assertWorktreeUnlockedForRemoval } from '../../shared/worktree-removal' -import { isSubmoduleWorktreeRemovalRefusal } from '../../shared/worktree-submodule-removal' +import { assertWorktreeUnlockedForRemoval } from '../../shared/worktree/removal' +import { isSubmoduleWorktreeRemovalRefusal } from '../../shared/worktree/submodule-removal' import { decodeGitCQuotedPath } from '../../shared/git-cquoted-path' import { parseGitRevListAheadBehindCounts } from '../../shared/git-rev-list-output' import { parseWslUncPath } from '../../shared/wsl-paths' diff --git a/src/main/github/auth-diagnose.ts b/src/main/github/auth-diagnose.ts index 8051af7f8b4..61aafdd7cf8 100644 --- a/src/main/github/auth-diagnose.ts +++ b/src/main/github/auth-diagnose.ts @@ -12,7 +12,7 @@ * uses stable field labels ("Token scopes:", "(GITHUB_TOKEN)", etc.). */ import { ghExecFileAsync } from '../git/runner' -import type { GhAuthDiagnostic, GhAuthAccount } from '../../shared/github-auth-types' +import type { GhAuthDiagnostic, GhAuthAccount } from '../../shared/github/auth-types' // Required scopes for ProjectV2 GraphQL access in Orca. `project` is the // scope that gates ProjectV2 reads/writes; the others are needed for the diff --git a/src/main/github/client-work-items-query-paging.test.ts b/src/main/github/client-work-items-query-paging.test.ts index 7af6b124c34..0e8b62bdfcf 100644 --- a/src/main/github/client-work-items-query-paging.test.ts +++ b/src/main/github/client-work-items-query-paging.test.ts @@ -118,7 +118,7 @@ import { _resetMergeQueueCacheForTests, _resetOwnerRepoCache } from './client' -import { GITHUB_WORK_ITEMS_QUERY_MAX_BYTES } from '../../shared/github-work-items-query-bounds' +import { GITHUB_WORK_ITEMS_QUERY_MAX_BYTES } from '../../shared/github/work-items-query-bounds' import { _resetOriginGitHubApiRepositoryCache } from './github-api-repository' diff --git a/src/main/github/client-work-items.test.ts b/src/main/github/client-work-items.test.ts index 84119b3b2a2..f26ccfc12d9 100644 --- a/src/main/github/client-work-items.test.ts +++ b/src/main/github/client-work-items.test.ts @@ -112,7 +112,7 @@ import { _resetMergeQueueCacheForTests, _resetOwnerRepoCache } from './client' -import { GITHUB_WORK_ITEMS_QUERY_MAX_BYTES } from '../../shared/github-work-items-query-bounds' +import { GITHUB_WORK_ITEMS_QUERY_MAX_BYTES } from '../../shared/github/work-items-query-bounds' import { _resetOriginGitHubApiRepositoryCache } from './github-api-repository' diff --git a/src/main/github/client.ts b/src/main/github/client.ts index 068d3ccc419..2457c7f21f4 100644 --- a/src/main/github/client.ts +++ b/src/main/github/client.ts @@ -28,10 +28,10 @@ import { normalizeHostedReviewBaseRef, normalizeHostedReviewHeadRef } from '../../shared/hosted-review-refs' -import { normalizeGitHubPRMergeMethodSettings } from '../../shared/github-pr-merge-methods' +import { normalizeGitHubPRMergeMethodSettings } from '../../shared/github/pull-request-merge-methods' import { summarizeProviderChecks } from '../../shared/provider-check-summary' -import { isGitHubWorkItemsQueryTooLarge } from '../../shared/github-work-items-query-bounds' -import { classifyGitHubUnavailable } from '../../shared/github-api-availability' +import { isGitHubWorkItemsQueryTooLarge } from '../../shared/github/work-items-query-bounds' +import { classifyGitHubUnavailable } from '../../shared/github/api-availability' import { parseTaskQuery, type ParsedTaskQuery } from '../../shared/task-query' import { GITHUB_WORK_ITEMS_SSH_REMOTE_REQUIRED_MESSAGE, @@ -91,7 +91,7 @@ import { type GitHubRepoExecOptions, type GitHubApiRepository } from './github-api-repository' -import { githubRepoIdentityKey } from '../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../shared/github/repository-identity-key' export { _resetOwnerRepoCache } from './gh-utils' export { getIssue, @@ -127,7 +127,7 @@ import { import { GITHUB_CHECK_DETAILS_HOST_TIMEOUT_MS, GITHUB_CHECK_DETAILS_TIMEOUT_MESSAGE -} from '../../shared/github-check-details-deadline' +} from '../../shared/github/check-details-deadline' import { hydrateGitHubPRStack, mergeGitHubPRStack } from './github-pr-stack' type GhExecOptions = GitHubRepoExecOptions & { signal?: AbortSignal } diff --git a/src/main/github/gh-utils.test.ts b/src/main/github/gh-utils.test.ts index ca9098e53bf..ba19fc13fda 100644 --- a/src/main/github/gh-utils.test.ts +++ b/src/main/github/gh-utils.test.ts @@ -38,7 +38,7 @@ import { __resetLocalGitConfigSignatureCacheForTests, readLocalGitConfigSignature } from './local-git-config-signature' -import { GITHUB_SEARCH_RESULT_WINDOW_ERROR_PATTERN } from '../../shared/github-work-items-query-bounds' +import { GITHUB_SEARCH_RESULT_WINDOW_ERROR_PATTERN } from '../../shared/github/work-items-query-bounds' describe('github owner/repo resolution', () => { beforeEach(() => { diff --git a/src/main/github/github-api-repository.ts b/src/main/github/github-api-repository.ts index 3a61b9387da..24037c4f73c 100644 --- a/src/main/github/github-api-repository.ts +++ b/src/main/github/github-api-repository.ts @@ -2,7 +2,7 @@ import type { GitHubOwnerRepo, IssueSourcePreference } from '../../shared/types' import { githubRepoIdentityKey, isDefaultGitHubHost -} from '../../shared/github-repository-identity-key' +} from '../../shared/github/repository-identity-key' import { getOwnerRepoForRemote, ghRepoExecOptions, diff --git a/src/main/github/github-owner-repo-selection.ts b/src/main/github/github-owner-repo-selection.ts index 63b6d75678e..2e7c6aa0f4c 100644 --- a/src/main/github/github-owner-repo-selection.ts +++ b/src/main/github/github-owner-repo-selection.ts @@ -1,5 +1,5 @@ import type { IssueSourcePreference } from '../../shared/types' -import { githubRepoIdentityKey } from '../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../shared/github/repository-identity-key' import { getOwnerRepoForRemote, type LocalGitExecOptions, diff --git a/src/main/github/github-pr-stack.ts b/src/main/github/github-pr-stack.ts index 24d0773a91c..a11cf597769 100644 --- a/src/main/github/github-pr-stack.ts +++ b/src/main/github/github-pr-stack.ts @@ -6,7 +6,7 @@ import type { PRReviewDecision, PRState } from '../../shared/types' -import { githubRepoIdentityKey } from '../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../shared/github/repository-identity-key' import { ghExecFileAsync } from '../git/runner' import { githubHostExecOptions, diff --git a/src/main/github/merged-pr-commit-membership.ts b/src/main/github/merged-pr-commit-membership.ts index 7350416ca6f..dd595da69f4 100644 --- a/src/main/github/merged-pr-commit-membership.ts +++ b/src/main/github/merged-pr-commit-membership.ts @@ -1,7 +1,7 @@ import { ghExecFileAsync } from './gh-utils' import { noteRepositoryRateLimitSpend, repositoryRateLimitGuard } from './rate-limit' import { githubHostExecOptions } from './github-api-repository' -import { githubRepoIdentityKey } from '../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../shared/github/repository-identity-key' import type { OwnerRepo } from './github-repository-identity' type GhExecOptions = Parameters[1] diff --git a/src/main/github/pr-refresh-error-classification.ts b/src/main/github/pr-refresh-error-classification.ts index aa9e226939d..12c42d092b2 100644 --- a/src/main/github/pr-refresh-error-classification.ts +++ b/src/main/github/pr-refresh-error-classification.ts @@ -1,5 +1,5 @@ import type { PRRefreshErrorType } from '../../shared/types' -import { classifyGitHubUnavailable } from '../../shared/github-api-availability' +import { classifyGitHubUnavailable } from '../../shared/github/api-availability' import { extractExecError } from '../git/exec-error' /** diff --git a/src/main/github/project-view.test.ts b/src/main/github/project-view.test.ts index 1339c5c0fdc..48486ae4a9e 100644 --- a/src/main/github/project-view.test.ts +++ b/src/main/github/project-view.test.ts @@ -11,7 +11,7 @@ import { beforeEach, describe, expect, it } from 'vitest' import { GITHUB_PROJECT_REF_INPUT_MAX_BYTES, GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR -} from '../../shared/github-project-ref-input' +} from '../../shared/github/project-ref-input' import { PROJECT_VIEW_OWNER_CACHE_MAX_ENTRIES, _getProjectViewCacheSizesForTests, diff --git a/src/main/github/project-view.ts b/src/main/github/project-view.ts index db344de7133..cd763b2542e 100644 --- a/src/main/github/project-view.ts +++ b/src/main/github/project-view.ts @@ -46,12 +46,12 @@ import type { ListProjectViewsResult, ResolveProjectRefArgs, ResolveProjectRefResult -} from '../../shared/github-project-types' +} from '../../shared/github/project-types' import { GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR, isGitHubProjectRefInputTooLarge -} from '../../shared/github-project-ref-input' -import { githubProjectHost } from '../../shared/github-project-identity' +} from '../../shared/github/project-ref-input' +import { githubProjectHost } from '../../shared/github/project-identity' // Re-export the public API so existing `./project-view` call sites keep working; the split is internal-only. export { isValidOwnerSlug, isValidRepoSlug } from './project-view/internals' diff --git a/src/main/github/project-view/internals.ts b/src/main/github/project-view/internals.ts index 1dd794370c7..06f0f7d69cf 100644 --- a/src/main/github/project-view/internals.ts +++ b/src/main/github/project-view/internals.ts @@ -9,9 +9,9 @@ import { noteRepositoryRateLimitSpend, type RateLimitBucketKind } from '../rate-limit' -import type { GitHubProjectViewError } from '../../../shared/github-project-types' -import { githubProjectHost } from '../../../shared/github-project-identity' -import { isDefaultGitHubHost } from '../../../shared/github-repository-identity-key' +import type { GitHubProjectViewError } from '../../../shared/github/project-types' +import { githubProjectHost } from '../../../shared/github/project-identity' +import { isDefaultGitHubHost } from '../../../shared/github/repository-identity-key' import { isGitHubHostAuthenticatedForGlobalCli } from '../github-enterprise-repository' import { classifyProjectError, diff --git a/src/main/github/project-view/mutations.ts b/src/main/github/project-view/mutations.ts index 453a695baec..5f6044debbf 100644 --- a/src/main/github/project-view/mutations.ts +++ b/src/main/github/project-view/mutations.ts @@ -17,7 +17,7 @@ import { type GraphqlVars } from './internals' import { classifyProjectError, rateLimitedError } from './project-error-classification' -import { githubProjectHost } from '../../../shared/github-project-identity' +import { githubProjectHost } from '../../../shared/github/project-identity' import type { GitHubAssignableUser, GitHubWorkItemDetails, PRComment } from '../../../shared/types' import type { AddIssueCommentBySlugArgs, @@ -39,7 +39,7 @@ import type { UpdateIssueTypeBySlugArgs, UpdatePullRequestBySlugArgs, UpdateProjectItemFieldArgs -} from '../../../shared/github-project-types' +} from '../../../shared/github/project-types' function githubHostExecOptions(args: { host?: string }): { host: string } { return { host: githubProjectHost(args.host) } diff --git a/src/main/github/project-view/project-error-classification.ts b/src/main/github/project-view/project-error-classification.ts index 1468552b345..5db90f4305d 100644 --- a/src/main/github/project-view/project-error-classification.ts +++ b/src/main/github/project-view/project-error-classification.ts @@ -1,8 +1,8 @@ // Why: turns raw gh stderr/stdout into the typed GitHubProjectViewError the // renderer can act on (auth vs scope vs rate limit vs drift), shared by the // project-view read and mutation paths. -import type { GitHubProjectViewError } from '../../../shared/github-project-types' -import { githubProjectHost } from '../../../shared/github-project-identity' +import type { GitHubProjectViewError } from '../../../shared/github/project-types' +import { githubProjectHost } from '../../../shared/github/project-identity' export type GhGraphqlErrorShape = { type?: string diff --git a/src/main/github/rate-limit.ts b/src/main/github/rate-limit.ts index 2ca3f5cad43..4a48823164d 100644 --- a/src/main/github/rate-limit.ts +++ b/src/main/github/rate-limit.ts @@ -9,7 +9,7 @@ import type { GitHubRateLimitBucket, GitHubRateLimitSnapshot } from '../../shared/types' -import { isDefaultGitHubHost } from '../../shared/github-repository-identity-key' +import { isDefaultGitHubHost } from '../../shared/github/repository-identity-key' import { isWslUncPath } from '../../shared/wsl-paths' import { acquire, release } from './gh-utils' import { ghExecFileAsync } from '../git/runner' diff --git a/src/main/github/stacked-pr-creation.ts b/src/main/github/stacked-pr-creation.ts index e34752df6d9..2d060f65a83 100644 --- a/src/main/github/stacked-pr-creation.ts +++ b/src/main/github/stacked-pr-creation.ts @@ -2,7 +2,7 @@ import type { CreateStackedHostedReviewInput, CreateStackedHostedReviewResult } from '../../shared/hosted-review' -import { isDefaultGitHubHost } from '../../shared/github-repository-identity-key' +import { isDefaultGitHubHost } from '../../shared/github/repository-identity-key' import { normalizeHostedReviewBaseRef, normalizeHostedReviewHeadRef diff --git a/src/main/index.ts b/src/main/index.ts index b4e0e1b5ae4..6b7cafa79e4 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -267,7 +267,7 @@ import { configureWindowsHostGitEnvironmentReadiness, setDefaultWslDistroOverride } from './git/runner' -import { getRepoIdFromWorktreeId } from '../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../shared/worktree/id' import { parseWorkspaceKey } from '../shared/workspace-scope' import { setMigrationUnsupportedPtyListener } from './agent-hooks/migration-unsupported-pty-state' import { AgentBrowserBridge } from './browser/agent-browser-bridge' diff --git a/src/main/ipc/filesystem.ts b/src/main/ipc/filesystem.ts index 40701203e06..44239bdac74 100644 --- a/src/main/ipc/filesystem.ts +++ b/src/main/ipc/filesystem.ts @@ -135,7 +135,7 @@ import { import { listRepoWorktrees } from '../repo-worktrees' import { recordCrashBreadcrumb } from '../crash-reporting/crash-breadcrumb-store' import { buildReadDirErrorBreadcrumb, type ReadDirThrowSite } from './readdir-error-diagnostics' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import { getRuntimePathBasename } from '../../shared/cross-platform-path' import type { LocalProjectWorktreeGitOptions } from '../project-runtime-git-options' import { registerLocalLogTailHandlers } from './local-log-tail' diff --git a/src/main/ipc/github.ts b/src/main/ipc/github.ts index 91cfc94f061..eda32115b19 100644 --- a/src/main/ipc/github.ts +++ b/src/main/ipc/github.ts @@ -107,7 +107,7 @@ import type { UpdateIssueTypeBySlugArgs, UpdateProjectItemFieldArgs, UpdatePullRequestBySlugArgs -} from '../../shared/github-project-types' +} from '../../shared/github/project-types' import { appStarSourceSchema } from '../../shared/gh-star-source' import { track } from '../telemetry/client' import { getCohortAtEmit } from '../telemetry/cohort-classifier' diff --git a/src/main/ipc/linear.ts b/src/main/ipc/linear.ts index 2e70cd0564d..0905c691f4c 100644 --- a/src/main/ipc/linear.ts +++ b/src/main/ipc/linear.ts @@ -24,8 +24,8 @@ import { } from '../linear/projects' import { listTeams, getTeamStates, getTeamLabels, getTeamMembers } from '../linear/teams' import type { LinearListFilter } from '../linear/issues' -import { clampLinearIssueListLimit } from '../../shared/linear-issue-read-limits' -import { optionalParsedLinearIssueAttributeFilter } from '../../shared/linear-issue-attribute-filter' +import { clampLinearIssueListLimit } from '../../shared/linear/issue-read-limits' +import { optionalParsedLinearIssueAttributeFilter } from '../../shared/linear/issue-attribute-filter' import type { LinearCustomViewModel, LinearIssueUpdate, diff --git a/src/main/ipc/local-worktree-runtime-options.ts b/src/main/ipc/local-worktree-runtime-options.ts index 13a13e7f536..f9850a7a399 100644 --- a/src/main/ipc/local-worktree-runtime-options.ts +++ b/src/main/ipc/local-worktree-runtime-options.ts @@ -4,7 +4,7 @@ import { getLocalProjectWorktreeGitOptions, type LocalProjectWorktreeGitOptions } from '../project-runtime-git-options' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import type { Repo } from '../../shared/types' function comparableLocalPath(value: string): string { diff --git a/src/main/ipc/notifications.ts b/src/main/ipc/notifications.ts index 7418396a199..031cdf63378 100644 --- a/src/main/ipc/notifications.ts +++ b/src/main/ipc/notifications.ts @@ -21,7 +21,7 @@ import type { NotificationSettings, NotificationSoundDataResult } from '../../shared/types' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { buildNotificationOptions } from './notification-options' import { readNotificationAuthorizationStatus } from './notification-authorization-status' diff --git a/src/main/ipc/pty.ts b/src/main/ipc/pty.ts index 6e28044a889..680bc78b4ec 100644 --- a/src/main/ipc/pty.ts +++ b/src/main/ipc/pty.ts @@ -148,7 +148,7 @@ import { type TerminalStartupCwdMissingDirFallback } from '../../shared/terminal-startup-cwd' import { isWslUncPath, toWindowsWslPath } from '../../shared/wsl-paths' -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import type { AgentSessionOwnerBinding } from '../../shared/agent-session-host-authority' import { agentSessionOwnerBindingsEqual, diff --git a/src/main/ipc/remote-workspace.ts b/src/main/ipc/remote-workspace.ts index 713fe1b8a17..361f66bb21f 100644 --- a/src/main/ipc/remote-workspace.ts +++ b/src/main/ipc/remote-workspace.ts @@ -15,7 +15,7 @@ import type { } from '../../shared/remote-workspace-types' import type { SshTarget } from '../../shared/ssh-types' import type { WorkspaceSessionState } from '../../shared/types' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { getRemoteWorkspaceNamespace } from './remote-workspace-namespace' import { registerRemoteWorkspaceNotificationHandler } from './remote-workspace-events' diff --git a/src/main/ipc/repos.ts b/src/main/ipc/repos.ts index a9ec6dbf4c5..97d31dc36bf 100644 --- a/src/main/ipc/repos.ts +++ b/src/main/ipc/repos.ts @@ -121,7 +121,7 @@ import { prepareLocalWorktreeRootForRepo } from '../worktree-root-preparation' import { normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences -} from '../../shared/worktree-visibility-sources' +} from '../../shared/worktree/visibility-sources' import { runWithGitReadCacheInvalidation } from '../git/status' import { isAdmissibleDirectSshAuthority } from '../../shared/ssh-retained-payload-admission' import { isCurrentSshProviderAuthority } from '../ssh/ssh-provider-authority' diff --git a/src/main/ipc/source-control-ai-linked-issue.ts b/src/main/ipc/source-control-ai-linked-issue.ts index fa000148fef..aa0696dd913 100644 --- a/src/main/ipc/source-control-ai-linked-issue.ts +++ b/src/main/ipc/source-control-ai-linked-issue.ts @@ -2,7 +2,7 @@ import { resolve } from 'node:path' import type { Store } from '../persistence' import { isLinkedIssueNumber } from '../../shared/source-control-ai-action-variables' import type { WorktreeMeta } from '../../shared/types' -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' export type LinkedIssueLookupArgs = { worktreeId?: string diff --git a/src/main/ipc/watcher-removal-gate.test.ts b/src/main/ipc/watcher-removal-gate.test.ts index 221f5f724c9..677cb381d1f 100644 --- a/src/main/ipc/watcher-removal-gate.test.ts +++ b/src/main/ipc/watcher-removal-gate.test.ts @@ -6,7 +6,7 @@ import { TerminalRemovalInProgressError, WatcherRemovalInProgressError } from './watcher-removal-gate' -import { isWorktreeRemovalFenceError } from '../../shared/worktree-removal-fence-error' +import { isWorktreeRemovalFenceError } from '../../shared/worktree/removal-fence-error' describe('watcher removal gate', () => { it('waits for an existing install and rejects later equivalent-path installs', async () => { diff --git a/src/main/ipc/watcher-removal-gate.ts b/src/main/ipc/watcher-removal-gate.ts index de19acfdf46..ec4bef288ca 100644 --- a/src/main/ipc/watcher-removal-gate.ts +++ b/src/main/ipc/watcher-removal-gate.ts @@ -5,7 +5,7 @@ import { import { TERMINAL_REMOVAL_IN_PROGRESS_MESSAGE, WATCHER_REMOVAL_IN_PROGRESS_MESSAGE -} from '../../shared/worktree-removal-fence-error' +} from '../../shared/worktree/removal-fence-error' // Why: fence slots are identities, not a counter, so a removal that gives up waiting can drop exactly // the installs it waited on without a late finishInstall corrupting the count for a newer install. diff --git a/src/main/ipc/workspace-cleanup-disconnected-ssh.ts b/src/main/ipc/workspace-cleanup-disconnected-ssh.ts index bd549a9b6ee..f7128d26827 100644 --- a/src/main/ipc/workspace-cleanup-disconnected-ssh.ts +++ b/src/main/ipc/workspace-cleanup-disconnected-ssh.ts @@ -6,7 +6,7 @@ import { createWorkspaceCleanupFingerprint, type WorkspaceCleanupCandidate } from '../../shared/workspace-cleanup' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import { getNewestWorkspaceCleanupDiffCommentAt, getWorkspaceCleanupInactivityReasonsForWorkspace, diff --git a/src/main/ipc/workspace-cleanup-scan.ts b/src/main/ipc/workspace-cleanup-scan.ts index 32794f61977..41f94a07814 100644 --- a/src/main/ipc/workspace-cleanup-scan.ts +++ b/src/main/ipc/workspace-cleanup-scan.ts @@ -5,7 +5,7 @@ import type { IGitProvider } from '../providers/types' import { isFolderRepo } from '../../shared/repo-kind' import type { GitWorktreeInfo, Repo, Worktree } from '../../shared/types' import { mergeWorktree } from './worktree-logic' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import type { WorkspaceCleanupCandidate, WorkspaceCleanupScanError, diff --git a/src/main/ipc/worktree-folder-rename-target.ts b/src/main/ipc/worktree-folder-rename-target.ts index 5725b4efd75..9cdbe7188c2 100644 --- a/src/main/ipc/worktree-folder-rename-target.ts +++ b/src/main/ipc/worktree-folder-rename-target.ts @@ -1,6 +1,6 @@ import { posix } from 'node:path' import type { GlobalSettings } from '../../shared/types' -import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree-id' +import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree/id' import { computeWorktreePath } from './worktree-logic' type WorktreePathSettings = Pick diff --git a/src/main/ipc/worktree-git-status-ref-watch.ts b/src/main/ipc/worktree-git-status-ref-watch.ts index f8035b0510f..db24dd6ac3c 100644 --- a/src/main/ipc/worktree-git-status-ref-watch.ts +++ b/src/main/ipc/worktree-git-status-ref-watch.ts @@ -1,6 +1,6 @@ import { resolveRuntimePath } from '../../shared/cross-platform-path' import { isSafeGitStatusUpstreamRef } from '../../shared/git-status-upstream-ref' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { pathRelativeToWorktreeWatchRoot, type WorktreeBaseWatchTarget diff --git a/src/main/ipc/worktree-logic.ts b/src/main/ipc/worktree-logic.ts index a056d657f02..45c6cbdff03 100644 --- a/src/main/ipc/worktree-logic.ts +++ b/src/main/ipc/worktree-logic.ts @@ -2,7 +2,7 @@ import { resolve, relative, isAbsolute, posix, sep, win32 } from 'node:path' import type { GlobalSettings, OrcaWorkspaceLayout, Repo } from '../../shared/types' import { isWindowsAbsolutePathLike, resolveRuntimePath } from '../../shared/cross-platform-path' import { isWslUncPath } from '../../shared/wsl-paths' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import { replaceKnownEmojiWithShortcodes } from '../../shared/emoji-shortcode-catalog' import { getWslHome, parseWslPath } from '../wsl' diff --git a/src/main/ipc/worktree-push-target-cleanup.ts b/src/main/ipc/worktree-push-target-cleanup.ts index d7fdc7a04be..0fd1faf10ad 100644 --- a/src/main/ipc/worktree-push-target-cleanup.ts +++ b/src/main/ipc/worktree-push-target-cleanup.ts @@ -6,7 +6,7 @@ import type { Store } from '../persistence' import type { GitPushTarget } from '../../shared/types' import { parseGitHubOwnerRepo } from '../github/gh-utils' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { iterateProcessOutputLines } from '../../shared/process-output-field-scanner' export type GitRemoteExec = ( diff --git a/src/main/ipc/worktree-remote.ts b/src/main/ipc/worktree-remote.ts index f83c5035976..8d9e70481cd 100644 --- a/src/main/ipc/worktree-remote.ts +++ b/src/main/ipc/worktree-remote.ts @@ -32,7 +32,7 @@ import { import { resolveLocalGitUsername, getSshGitUsername } from '../git/git-username' import { hasCommitObjectViaGitExec } from '../git/commit-object-ref' import { resolveWorktreeCreateBase } from '../worktree-create-base' -import { resolveWorktreeAddBaseRef } from '../../shared/worktree-base-ref' +import { resolveWorktreeAddBaseRef } from '../../shared/worktree/base-ref' import { getHostedReviewForBranch } from '../source-control/hosted-review' import type { ForgeProviderId } from '../source-control/forge-provider' import { validateGitPushTarget } from '../git/push-target-validation' @@ -88,7 +88,7 @@ import { } from './worktree-logic' import { findCreatedWorktree } from './created-worktree-reconciliation' import type { BranchPrefixSettings } from '../../shared/branch-prefix' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { parseWorkspaceKey, worktreeWorkspaceKey } from '../../shared/workspace-scope' import { cleanupUnusedWorktreePushTargetRemoteWithExec, diff --git a/src/main/ipc/worktrees.ts b/src/main/ipc/worktrees.ts index 3400247002a..e56dd3cc13d 100644 --- a/src/main/ipc/worktrees.ts +++ b/src/main/ipc/worktrees.ts @@ -8,7 +8,7 @@ import { isFolderRepo } from '../../shared/repo-kind' import { readBranchRenameFailureOutputForDisplay } from '../agent-hooks/branch-rename-failure-output' import { parseWorkspaceKey } from '../../shared/workspace-scope' import { inspectSetupScriptImportCandidates } from '../../shared/setup-script-imports' -import { planWorktreeSortOrderUpdates } from '../../shared/worktree-sort-order-update' +import { planWorktreeSortOrderUpdates } from '../../shared/worktree/sort-order-update' import { getProjectHostSetupWorktreeMeta } from '../../shared/project-host-setup-projection' import { TaskSourceContextSchema } from '../../shared/task-source-context-schema' import { WorkspaceLinkedItemSchema } from '../../shared/workspace-linked-item-schema' @@ -37,7 +37,7 @@ import type { WorkspaceLineage, WorktreeMeta } from '../../shared/types' -import { assertWorktreeUnlockedForRemoval } from '../../shared/worktree-removal' +import { assertWorktreeUnlockedForRemoval } from '../../shared/worktree/removal' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, @@ -66,11 +66,11 @@ import { buildKnownOrcaWorkspaceLayouts, isLegacyRepoForExternalWorktreeVisibility, toDetectedWorktree -} from '../../shared/worktree-ownership' +} from '../../shared/worktree/ownership' import { createWorktreeVisibilitySourceMatcher, normalizeCustomWorktreeVisibilitySources -} from '../../shared/worktree-visibility-sources' +} from '../../shared/worktree/visibility-sources' import { assertWorktreeCleanForRemoval, forceDeleteLocalBranch, @@ -239,7 +239,7 @@ import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR, getRepoIdFromWorktreeId, getWorktreePathBasenameFromId -} from '../../shared/worktree-id' +} from '../../shared/worktree/id' import { prefetchWorktreeCreateBase } from '../worktree-create-base-prefetch' import { getLocalProjectGitExecOptions, diff --git a/src/main/linear/issue-activity-raw.ts b/src/main/linear/issue-activity-raw.ts index 992a175b701..c53e713e738 100644 --- a/src/main/linear/issue-activity-raw.ts +++ b/src/main/linear/issue-activity-raw.ts @@ -1,7 +1,7 @@ import type { LinearIssueActivityEntry, LinearIssueActivityValue -} from '../../shared/linear-issue-activity' +} from '../../shared/linear/issue-activity' import type { RawNamedEntity, RawPageInfo, RawUser } from './issue-context-raw' type RawActivityEntity = RawNamedEntity & { diff --git a/src/main/linear/issue-context-client.ts b/src/main/linear/issue-context-client.ts index c9e5085f3bb..1e3a45bd301 100644 --- a/src/main/linear/issue-context-client.ts +++ b/src/main/linear/issue-context-client.ts @@ -1,5 +1,5 @@ -import type { LinearSearchIssueSummary, LinearSearchResult } from '../../shared/linear-agent-access' -import { clampLinearSearchLimit } from '../../shared/linear-agent-access' +import type { LinearSearchIssueSummary, LinearSearchResult } from '../../shared/linear/agent-access' +import { clampLinearSearchLimit } from '../../shared/linear/agent-access' import type { LinearWorkspace } from '../../shared/types' import { acquire, diff --git a/src/main/linear/issue-context-current.ts b/src/main/linear/issue-context-current.ts index dbde6c8176f..e433435b421 100644 --- a/src/main/linear/issue-context-current.ts +++ b/src/main/linear/issue-context-current.ts @@ -1,4 +1,4 @@ -import { parseLinearIssueInput } from '../../shared/linear-links' +import { parseLinearIssueInput } from '../../shared/linear/links' import { getConnectedWorkspaces } from './issue-context-client' import { linearError } from './issue-context-errors' diff --git a/src/main/linear/issue-context-errors.ts b/src/main/linear/issue-context-errors.ts index 4e76835eb6a..1dde1b58537 100644 --- a/src/main/linear/issue-context-errors.ts +++ b/src/main/linear/issue-context-errors.ts @@ -1,4 +1,4 @@ -import type { LinearErrorCode, LinearIncludeErrorCode } from '../../shared/linear-agent-access' +import type { LinearErrorCode, LinearIncludeErrorCode } from '../../shared/linear/agent-access' export class LinearAgentAccessError extends Error { readonly code: LinearErrorCode diff --git a/src/main/linear/issue-context-fanout.ts b/src/main/linear/issue-context-fanout.ts index 484eec818f7..c28f03a2c9c 100644 --- a/src/main/linear/issue-context-fanout.ts +++ b/src/main/linear/issue-context-fanout.ts @@ -1,4 +1,4 @@ -import type { LinearErrorCode, LinearWorkspaceCandidate } from '../../shared/linear-agent-access' +import type { LinearErrorCode, LinearWorkspaceCandidate } from '../../shared/linear/agent-access' import type { LinearWorkspace } from '../../shared/types' import { getClients, getStatus, type LinearClientForWorkspace } from './client' import { diff --git a/src/main/linear/issue-context-includes.test.ts b/src/main/linear/issue-context-includes.test.ts index 05e5f2b9892..0d8d432a1c5 100644 --- a/src/main/linear/issue-context-includes.test.ts +++ b/src/main/linear/issue-context-includes.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { LinearIssueContextResult, LinearIssueRequest } from '../../shared/linear-agent-access' +import type { LinearIssueContextResult, LinearIssueRequest } from '../../shared/linear/agent-access' import type { ResolvedIssue } from './issue-context-client' import { ACTIVITY_QUERY } from './issue-activity-raw' import { diff --git a/src/main/linear/issue-context-includes.ts b/src/main/linear/issue-context-includes.ts index 13a8f4ae234..785bdd82f4f 100644 --- a/src/main/linear/issue-context-includes.ts +++ b/src/main/linear/issue-context-includes.ts @@ -7,7 +7,7 @@ import type { LinearIssueContextResult, LinearIssueInclude, LinearIssueRequest -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import { LINEAR_ATTACHMENTS_CAP, LINEAR_ACTIVITY_CAP, @@ -15,8 +15,8 @@ import { LINEAR_COMMENTS_CAP, LINEAR_COMMENT_BODY_CAP, clampLinearIssueDepth -} from '../../shared/linear-agent-access' -import { extractLinearInlineMedia } from '../../shared/linear-inline-media' +} from '../../shared/linear/agent-access' +import { extractLinearInlineMedia } from '../../shared/linear/inline-media' import type { ResolvedIssue } from './issue-context-client' import { getRequiredEntry, withLinearRead } from './issue-context-client' import { getPublicFileUrlClient } from './client' diff --git a/src/main/linear/issue-context-inline-media.test.ts b/src/main/linear/issue-context-inline-media.test.ts index 3b3b97994de..e3e484a4593 100644 --- a/src/main/linear/issue-context-inline-media.test.ts +++ b/src/main/linear/issue-context-inline-media.test.ts @@ -4,7 +4,7 @@ import type { LinearIssueCommentNode, LinearIssueContextResult, LinearIssueSummary -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import { collectInlineMedia } from './issue-context' function summary(overrides: Partial): LinearIssueSummary { diff --git a/src/main/linear/issue-context-pagination.ts b/src/main/linear/issue-context-pagination.ts index d8c5f239ac9..83118c41b72 100644 --- a/src/main/linear/issue-context-pagination.ts +++ b/src/main/linear/issue-context-pagination.ts @@ -1,4 +1,4 @@ -import { LINEAR_ISSUE_API_PAGE_SIZE_MAX } from '../../shared/linear-issue-read-limits' +import { LINEAR_ISSUE_API_PAGE_SIZE_MAX } from '../../shared/linear/issue-read-limits' export type LinearPageVariables = { first: number; after?: string } diff --git a/src/main/linear/issue-context-raw.ts b/src/main/linear/issue-context-raw.ts index 6f29e9e6a01..d421a17e017 100644 --- a/src/main/linear/issue-context-raw.ts +++ b/src/main/linear/issue-context-raw.ts @@ -2,7 +2,7 @@ import type { LinearCollectionMeta, LinearIssueSummary, LinearSearchIssueSummary -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' export type RawIssueResponse = { issue?: RawIssue | null diff --git a/src/main/linear/issue-context-relations.ts b/src/main/linear/issue-context-relations.ts index fd39787d720..66e2fac9d3d 100644 --- a/src/main/linear/issue-context-relations.ts +++ b/src/main/linear/issue-context-relations.ts @@ -1,5 +1,5 @@ -import type { LinearCollectionMeta, LinearIssueRelation } from '../../shared/linear-agent-access' -import { LINEAR_RELATIONS_CAP } from '../../shared/linear-agent-access' +import type { LinearCollectionMeta, LinearIssueRelation } from '../../shared/linear/agent-access' +import { LINEAR_RELATIONS_CAP } from '../../shared/linear/agent-access' import type { ResolvedIssue } from './issue-context-client' import { getRequiredEntry, withLinearRead } from './issue-context-client' import { readConnectionPages } from './issue-context-pagination' diff --git a/src/main/linear/issue-context-workspaces.ts b/src/main/linear/issue-context-workspaces.ts index debdf646c4e..47ad620a0a3 100644 --- a/src/main/linear/issue-context-workspaces.ts +++ b/src/main/linear/issue-context-workspaces.ts @@ -1,4 +1,4 @@ -import type { LinearWorkspaceCandidate } from '../../shared/linear-agent-access' +import type { LinearWorkspaceCandidate } from '../../shared/linear/agent-access' import type { LinearWorkspace } from '../../shared/types' import { linearError } from './issue-context-errors' diff --git a/src/main/linear/issue-context.ts b/src/main/linear/issue-context.ts index 9116b9a591b..0cf5ea5fd0b 100644 --- a/src/main/linear/issue-context.ts +++ b/src/main/linear/issue-context.ts @@ -3,9 +3,9 @@ import type { LinearIssueChildNode, LinearIssueContextResult, LinearIssueRequest -} from '../../shared/linear-agent-access' -import { extractLinearInlineMedia } from '../../shared/linear-inline-media' -import { parseLinearIssueInput } from '../../shared/linear-links' +} from '../../shared/linear/agent-access' +import { extractLinearInlineMedia } from '../../shared/linear/inline-media' +import { parseLinearIssueInput } from '../../shared/linear/links' import { resolveIssue, searchLinearIssuesForAgents, diff --git a/src/main/linear/issue-list-filter.ts b/src/main/linear/issue-list-filter.ts index b85b7e3ba09..6190716ea0c 100644 --- a/src/main/linear/issue-list-filter.ts +++ b/src/main/linear/issue-list-filter.ts @@ -1,7 +1,7 @@ import { isEmptyLinearIssueAttributeFilter, type LinearIssueAttributeFilter -} from '../../shared/linear-issue-attribute-filter' +} from '../../shared/linear/issue-attribute-filter' import type { LinearListFilter } from './issues' // Why: attribute facets must merge into Linear's IssueFilter before the first-N diff --git a/src/main/linear/issue-relation-write.ts b/src/main/linear/issue-relation-write.ts index 6f9ce71c634..08f2a3bc91e 100644 --- a/src/main/linear/issue-relation-write.ts +++ b/src/main/linear/issue-relation-write.ts @@ -3,8 +3,8 @@ import { loadLinearSdk } from './linear-sdk' import type { LinearIssueRelationship, LinearIssueRelationWriteResult -} from '../../shared/linear-issue-relation-write' -import { LINEAR_ISSUE_API_PAGE_SIZE_MAX } from '../../shared/linear-issue-read-limits' +} from '../../shared/linear/issue-relation-write' +import { LINEAR_ISSUE_API_PAGE_SIZE_MAX } from '../../shared/linear/issue-read-limits' import { acquire, clearToken, getClients, isAuthError, release } from './client' import { linearError } from './issue-context-errors' import { diff --git a/src/main/linear/issues.ts b/src/main/linear/issues.ts index 1c8d7d8ee74..301bc66024a 100644 --- a/src/main/linear/issues.ts +++ b/src/main/linear/issues.ts @@ -14,11 +14,11 @@ import { loadLinearSdk } from './linear-sdk' import { LINEAR_ISSUE_API_PAGE_SIZE_MAX, clampLinearIssueListLimit -} from '../../shared/linear-issue-read-limits' +} from '../../shared/linear/issue-read-limits' import { isEmptyLinearIssueAttributeFilter, type LinearIssueAttributeFilter -} from '../../shared/linear-issue-attribute-filter' +} from '../../shared/linear/issue-attribute-filter' import { acquire, release, diff --git a/src/main/linear/linear-team-pages.ts b/src/main/linear/linear-team-pages.ts index 1da7fd6242f..abc1c485a8b 100644 --- a/src/main/linear/linear-team-pages.ts +++ b/src/main/linear/linear-team-pages.ts @@ -1,5 +1,5 @@ import type { LinearLabel, LinearMember, LinearTeam, LinearWorkflowState } from '../../shared/types' -import { buildLinearTeamUrl } from '../../shared/linear-links' +import { buildLinearTeamUrl } from '../../shared/linear/links' import type { LinearClientForWorkspace } from './client' const TEAM_PAGE_SIZE = 100 diff --git a/src/main/linear/mcp-issue-list.ts b/src/main/linear/mcp-issue-list.ts index 09c5fff3336..ff98278cc7d 100644 --- a/src/main/linear/mcp-issue-list.ts +++ b/src/main/linear/mcp-issue-list.ts @@ -1,7 +1,7 @@ import type { LinearMcpIssueListRequest, LinearMcpIssueListResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import { getClients, getStatus, type LinearClientForWorkspace } from './client' import { withLinearRead } from './issue-context-client' import { linearError } from './issue-context-errors' diff --git a/src/main/linear/projects.ts b/src/main/linear/projects.ts index 5945c3fc95b..d55d2f6e6a6 100644 --- a/src/main/linear/projects.ts +++ b/src/main/linear/projects.ts @@ -15,7 +15,7 @@ import type { import { LINEAR_ISSUE_API_PAGE_SIZE_MAX, clampLinearIssueListLimit -} from '../../shared/linear-issue-read-limits' +} from '../../shared/linear/issue-read-limits' import { acquire, clearToken, diff --git a/src/main/local-project-runtime-resolution.ts b/src/main/local-project-runtime-resolution.ts index d7588ae51a1..e86a2f31927 100644 --- a/src/main/local-project-runtime-resolution.ts +++ b/src/main/local-project-runtime-resolution.ts @@ -10,7 +10,7 @@ import { hasCachedWslAvailability, hasCachedWslDistros } from './wsl' -import { getRepoIdFromWorktreeId } from '../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../shared/worktree/id' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../shared/execution-host' function canResolveProjectRuntimeForRepo(store: Store): boolean { diff --git a/src/main/local-worktree-removal-recovery.ts b/src/main/local-worktree-removal-recovery.ts index 5a920a4ee6f..578743029f6 100644 --- a/src/main/local-worktree-removal-recovery.ts +++ b/src/main/local-worktree-removal-recovery.ts @@ -1,5 +1,5 @@ import type { GitWorktreeInfo, RemoveWorktreeResult } from '../shared/types' -import { assertWorktreeUnlockedForRemoval } from '../shared/worktree-removal' +import { assertWorktreeUnlockedForRemoval } from '../shared/worktree/removal' import { areWorktreePathsEqual, formatWorktreeRemovalError } from './ipc/worktree-logic' import { gitExecFileAsync } from './git/runner' import { listWorktreesStrict, type GitWorktreeExecOptions } from './git/worktree' diff --git a/src/main/memory/collector.ts b/src/main/memory/collector.ts index d2a8783a510..c1fe58989ad 100644 --- a/src/main/memory/collector.ts +++ b/src/main/memory/collector.ts @@ -21,7 +21,7 @@ import { basename } from 'node:path' import { exec } from 'node:child_process' import { promisify } from 'node:util' import os from 'node:os' -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { getProcessOutputFields, iterateProcessOutputLines diff --git a/src/main/memory/hydrate-local-pty-registry.ts b/src/main/memory/hydrate-local-pty-registry.ts index 6608fd2641c..3388eeebed9 100644 --- a/src/main/memory/hydrate-local-pty-registry.ts +++ b/src/main/memory/hydrate-local-pty-registry.ts @@ -16,7 +16,7 @@ import type { SessionInfo } from '../daemon/types' import { listRegisteredPtys, registerPty } from './pty-registry' import { listRepoWorktrees } from '../repo-worktrees' import { parsePtySessionId } from '../../shared/pty-session-id-format' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import type { Store } from '../persistence' // Why: macOS dock reactivation reruns setup; avoid repeating Git I/O and daemon RPC. diff --git a/src/main/orca-profiles/profile-project-worktree-identity.ts b/src/main/orca-profiles/profile-project-worktree-identity.ts index 9bb4fa9fc27..58aa55da8b3 100644 --- a/src/main/orca-profiles/profile-project-worktree-identity.ts +++ b/src/main/orca-profiles/profile-project-worktree-identity.ts @@ -2,7 +2,7 @@ import { normalizeRuntimePathForComparison } from '../../shared/cross-platform-p import { getRepoExecutionHostId } from '../../shared/execution-host' import type { Repo, WorkspaceKey } from '../../shared/types' import { parseWorkspaceKey, worktreeWorkspaceKey } from '../../shared/workspace-scope' -import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree-id' +import { WORKTREE_ID_SEPARATOR } from '../../shared/worktree/id' export function repoPhysicalKey( repo: Pick diff --git a/src/main/persistence.ts b/src/main/persistence.ts index d58b621c94b..d0699cea658 100644 --- a/src/main/persistence.ts +++ b/src/main/persistence.ts @@ -141,7 +141,7 @@ import { normalizeStatusBarUsageMode } from '../shared/status-bar-usage-mode' import { normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences -} from '../shared/worktree-visibility-sources' +} from '../shared/worktree/visibility-sources' import { isExistingPersistedProfile } from '../shared/project-order-manual-default-notice' import { resolveUsagePercentageDisplayChangeNoticeDismissed } from '../shared/usage-percentage-display-change-notice' import { normalizePRBotAuthorOverrides } from '../shared/pr-bot-author-overrides' @@ -173,7 +173,7 @@ import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR, getRepoIdFromWorktreeId, getWorktreePathBasenameFromId -} from '../shared/worktree-id' +} from '../shared/worktree/id' import { isPathInsideOrEqual, isWindowsAbsolutePathLike, @@ -220,7 +220,7 @@ import { } from '../shared/workspace-statuses' import { clampMarkdownTocPanelWidth } from '../shared/markdown-toc-panel-width' import { clampCombinedDiffFileTreeWidth } from '../shared/combined-diff-file-tree-width' -import { isLegacyRepoForExternalWorktreeVisibility } from '../shared/worktree-ownership' +import { isLegacyRepoForExternalWorktreeVisibility } from '../shared/worktree/ownership' import { sanitizeRepoIcon } from '../shared/repo-icon' import { normalizeRepoBadgeColor } from '../shared/repo-badge-color' import { diff --git a/src/main/ports/ssh-advertised-url-enrichment.ts b/src/main/ports/ssh-advertised-url-enrichment.ts index c7c264d3eb4..4a6b17f46d8 100644 --- a/src/main/ports/ssh-advertised-url-enrichment.ts +++ b/src/main/ports/ssh-advertised-url-enrichment.ts @@ -7,7 +7,7 @@ import type { DetectedPort, EnrichedDetectedPort, PortForwardEntry } from '../../shared/ssh-types' import type { Store } from '../persistence' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import { advertisedUrlWatcher, type AdvertisedUrl, diff --git a/src/main/ports/workspace-port-ownership.ts b/src/main/ports/workspace-port-ownership.ts index 9f7df2465cb..f9020d76682 100644 --- a/src/main/ports/workspace-port-ownership.ts +++ b/src/main/ports/workspace-port-ownership.ts @@ -1,6 +1,6 @@ import path from 'node:path' import type { Store } from '../persistence' -import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { isFolderRepo } from '../../shared/repo-kind' import type { WorkspacePortKillRequest, diff --git a/src/main/providers/agent-foreground-context-paths.ts b/src/main/providers/agent-foreground-context-paths.ts index 7ff8a6d3e62..760b2933960 100644 --- a/src/main/providers/agent-foreground-context-paths.ts +++ b/src/main/providers/agent-foreground-context-paths.ts @@ -1,4 +1,4 @@ -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' export function getAgentForegroundContextPaths(options: { cwd?: string diff --git a/src/main/providers/local-pty-provider.ts b/src/main/providers/local-pty-provider.ts index b4af3c907fb..4a852017f6a 100644 --- a/src/main/providers/local-pty-provider.ts +++ b/src/main/providers/local-pty-provider.ts @@ -12,7 +12,7 @@ import { resolveProcessCwd } from './process-cwd' import { existsSync } from 'node:fs' import * as pty from 'node-pty' import { getDefaultWslDistro, parseWslPath, isWslAvailableAsync } from '../wsl' -import { splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { isBracketedPasteSafeShell } from '../../shared/startup-command-submission' import { injectHistoryEnv, diff --git a/src/main/runtime/folder-workspace-pty-identity.test.ts b/src/main/runtime/folder-workspace-pty-identity.test.ts index d986fa54938..db6b1c1927a 100644 --- a/src/main/runtime/folder-workspace-pty-identity.test.ts +++ b/src/main/runtime/folder-workspace-pty-identity.test.ts @@ -3,7 +3,7 @@ import { getDefaultWorkspaceSession } from '../../shared/constants' import type { RuntimeClientEvent } from '../../shared/runtime-client-events' import { makePaneKey } from '../../shared/stable-pane-id' import type { WorkspaceSessionState } from '../../shared/types' -import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree-id' +import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree/id' import { OrcaRuntimeService } from './orca-runtime' // Folder projects back several workspaces with ONE directory; only the diff --git a/src/main/runtime/linear-save-issue.test.ts b/src/main/runtime/linear-save-issue.test.ts index eb8ed4093d2..02630a7452b 100644 --- a/src/main/runtime/linear-save-issue.test.ts +++ b/src/main/runtime/linear-save-issue.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { LINEAR_WRITE_BODY_CAP } from '../../shared/linear-agent-access' +import { LINEAR_WRITE_BODY_CAP } from '../../shared/linear/agent-access' import * as linearTeams from '../linear/teams' import { OrcaRuntimeService } from './orca-runtime' diff --git a/src/main/runtime/missing-worktree-terminal-reconciliation.ts b/src/main/runtime/missing-worktree-terminal-reconciliation.ts index 6c4f7f762a4..25cd1f2129d 100644 --- a/src/main/runtime/missing-worktree-terminal-reconciliation.ts +++ b/src/main/runtime/missing-worktree-terminal-reconciliation.ts @@ -1,6 +1,6 @@ import type { IPtyProvider } from '../providers/types' import type { Repo } from '../../shared/types' -import { splitWorktreeId } from '../../shared/worktree-id' +import { splitWorktreeId } from '../../shared/worktree/id' import { mapWithConcurrency } from '../../shared/map-with-concurrency' import type { OrcaRuntimeService } from './orca-runtime' import { killAllProcessesForWorktree } from './worktree-teardown' diff --git a/src/main/runtime/orca-runtime.test.ts b/src/main/runtime/orca-runtime.test.ts index 573884c48a0..9beb782cebc 100644 --- a/src/main/runtime/orca-runtime.test.ts +++ b/src/main/runtime/orca-runtime.test.ts @@ -123,7 +123,7 @@ import type { AgentSessionExecutionClaim, AgentSessionSurfaceBinding } from '../../shared/agent-session-host-authority' -import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree-id' +import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree/id' import { RpcDispatcher } from './rpc/dispatcher' import type { RpcRequest } from './rpc/core' import { TERMINAL_METHODS } from './rpc/methods/terminal' diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index 15e1c4c7f4a..807eef35c05 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -12,7 +12,7 @@ import { normalizeTerminalTitle } from '../../shared/agent-detection' import { extractOscTitleScanTail } from '../../shared/osc-title-scan-tail' -import { planWorktreeSortOrderUpdates } from '../../shared/worktree-sort-order-update' +import { planWorktreeSortOrderUpdates } from '../../shared/worktree/sort-order-update' import { isArtifactSharingEnabled } from '../../shared/artifact-sharing-gate' import { sortDirEntries } from '../../shared/file-name-sort' import { isServerDriveListRequest, listWindowsDrives } from './windows-drive-listing' @@ -117,7 +117,7 @@ import { homedir } from 'node:os' import { isAbsolute, join, resolve } from 'node:path' import { mkdir, readFile, readdir, rm, stat } from 'node:fs/promises' import { resolveWorktreeCreateBase } from '../worktree-create-base' -import { resolveWorktreeAddBaseRef } from '../../shared/worktree-base-ref' +import { resolveWorktreeAddBaseRef } from '../../shared/worktree/base-ref' import { OrchestrationDb } from './orchestration/db' import { reconcileRequestedWorkerTerminalReleases } from './orchestration/worker-terminal-release-reconciliation' import { @@ -260,7 +260,7 @@ import type { CodexRateLimitAccountsState } from '../../shared/types' import type { TaskSourceContext } from '../../shared/task-source-context' -import { assertWorktreeUnlockedForRemoval } from '../../shared/worktree-removal' +import { assertWorktreeUnlockedForRemoval } from '../../shared/worktree/removal' import { LOCAL_EXECUTION_HOST_ID, getRepoExecutionHostId, @@ -314,7 +314,7 @@ import type { LinearTeamMembersResult, LinearTeamStatesResult, LinearStatusSetResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import { HEADLESS_RUNTIME_WINDOW_ID, type RuntimeDesktopWindowStatus, @@ -382,8 +382,8 @@ import { LINEAR_SEARCH_MAX_LIMIT, LINEAR_WRITE_BODY_CAP, clampLinearSearchLimit -} from '../../shared/linear-agent-access' -import { isLinearUuid } from '../../shared/linear-uuid' +} from '../../shared/linear/agent-access' +import { isLinearUuid } from '../../shared/linear/uuid' import type { FeatureInteractionId } from '../../shared/feature-interactions' import type { TerminalPaneSplitSource } from '../../shared/feature-education-telemetry' import { @@ -392,14 +392,14 @@ import { getRepoIdFromWorktreeId, splitWorktreeId, splitWorktreeIdForFilesystem -} from '../../shared/worktree-id' +} from '../../shared/worktree/id' import { getProjectIdForProviderIdentity, getProjectHostSetupForRepo, getProjectHostSetupWorktreeMeta } from '../../shared/project-host-setup-projection' import { parsePtySessionId } from '../../shared/pty-session-id-format' -import { clampLinearIssueListLimit } from '../../shared/linear-issue-read-limits' +import { clampLinearIssueListLimit } from '../../shared/linear/issue-read-limits' import { isFolderRepo } from '../../shared/repo-kind' import { DEFAULT_WORKSPACE_STATUS_ID } from '../../shared/workspace-statuses' import { @@ -490,13 +490,13 @@ import { buildKnownOrcaWorkspaceLayouts, isLegacyRepoForExternalWorktreeVisibility, toDetectedWorktree -} from '../../shared/worktree-ownership' +} from '../../shared/worktree/ownership' import { isAgentScratchRepoRootPath } from '../../shared/agent-scratch-worktrees' import { createWorktreeVisibilitySourceMatcher, normalizeCustomWorktreeVisibilitySources, type WorktreeVisibilitySourceMatcher -} from '../../shared/worktree-visibility-sources' +} from '../../shared/worktree/visibility-sources' import { BROWSER_HEADLESS_RUNTIME_CAPABILITY, BROWSER_CERTIFICATE_TRUST_RUNTIME_CAPABILITY, @@ -854,7 +854,7 @@ import type { UpdateIssueTypeBySlugArgs, UpdateProjectItemFieldArgs, UpdatePullRequestBySlugArgs -} from '../../shared/github-project-types' +} from '../../shared/github/project-types' import { getBaseRefDefault, getDefaultRemote, diff --git a/src/main/runtime/orchestration/cli-command.ts b/src/main/runtime/orchestration/cli-command.ts index c0f4883f1e4..482b66efa95 100644 --- a/src/main/runtime/orchestration/cli-command.ts +++ b/src/main/runtime/orchestration/cli-command.ts @@ -1,6 +1,6 @@ import type { ProjectExecutionRuntimeResolution } from '../../../shared/project-execution-runtime' import { isWslUncPath } from '../../../shared/wsl-paths' -import { splitWorktreeIdForFilesystem } from '../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../shared/worktree/id' export type OrchestrationCliCommand = 'orca' | 'orca-ide' diff --git a/src/main/runtime/rpc/errors.ts b/src/main/runtime/rpc/errors.ts index db6396b8e0d..ad5e5f36695 100644 --- a/src/main/runtime/rpc/errors.ts +++ b/src/main/runtime/rpc/errors.ts @@ -5,7 +5,7 @@ import type { RpcEnvelopeMeta, RpcFailure, RpcSuccess } from './core' import { computerUseErrorRecoveryData } from '../../../shared/computer-use-error-recovery' import { COMPUTER_ERROR_CODES } from '../../../shared/runtime-types' -import { LINEAR_ERROR_CODES } from '../../../shared/linear-agent-access' +import { LINEAR_ERROR_CODES } from '../../../shared/linear/agent-access' import { AGENT_SESSION_RPC_ERROR_CODES } from '../../../shared/agent-session-host-authority' import { ARTIFACT_SHARING_DISABLED_CODE } from '../../../shared/artifact-sharing-gate' diff --git a/src/main/runtime/rpc/methods/client-ui-schemas.ts b/src/main/runtime/rpc/methods/client-ui-schemas.ts index ff125290da1..3d9e0e2e69e 100644 --- a/src/main/runtime/rpc/methods/client-ui-schemas.ts +++ b/src/main/runtime/rpc/methods/client-ui-schemas.ts @@ -16,7 +16,7 @@ import { normalizePRBotAuthorOverrides } from '../../../../shared/pr-bot-author- import { normalizeWorktreeCardProperties, WORKTREE_CARD_PROPERTIES -} from '../../../../shared/worktree-card-properties' +} from '../../../../shared/worktree/card-properties' import { isPluginPanelTabKey } from '../../../../shared/plugins/plugin-manifest' import type { TaskProvider } from '../../../../shared/types' import { ClientUiWorkspaceFilterFields } from './client-ui-workspace-filter-fields' diff --git a/src/main/runtime/rpc/methods/client-ui.test.ts b/src/main/runtime/rpc/methods/client-ui.test.ts index 18c747c242c..a8323413b23 100644 --- a/src/main/runtime/rpc/methods/client-ui.test.ts +++ b/src/main/runtime/rpc/methods/client-ui.test.ts @@ -7,7 +7,7 @@ import { MAX_QUICK_COMMAND_REPO_ID_LENGTH, MAX_QUICK_COMMAND_TERMINAL_TEXT_LENGTH } from '../../../../shared/terminal-quick-commands' -import { DEFAULT_WORKTREE_CARD_PROPERTIES } from '../../../../shared/worktree-card-properties' +import { DEFAULT_WORKTREE_CARD_PROPERTIES } from '../../../../shared/worktree/card-properties' import type { PersistedUIState } from '../../../../shared/types' import type { OrcaRuntimeService } from '../../orca-runtime' import type { RpcRequest } from '../core' diff --git a/src/main/runtime/rpc/methods/linear-agent-access.ts b/src/main/runtime/rpc/methods/linear-agent-access.ts index 13f9db57e38..50e7bfef3a2 100644 --- a/src/main/runtime/rpc/methods/linear-agent-access.ts +++ b/src/main/runtime/rpc/methods/linear-agent-access.ts @@ -2,7 +2,7 @@ import { z } from 'zod' import { defineMethod, type RpcMethod } from '../core' import { OptionalFiniteNumber, OptionalString, requiredString } from '../schemas' import { linearError } from '../../../linear/issue-context-errors' -import { isLinearUuid } from '../../../../shared/linear-uuid' +import { isLinearUuid } from '../../../../shared/linear/uuid' const LINEAR_DUE_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/ const LinearDueDate = z.string().refine((value) => LINEAR_DUE_DATE_PATTERN.test(value), { diff --git a/src/main/runtime/rpc/methods/linear-issue-attribute-filter-schema.ts b/src/main/runtime/rpc/methods/linear-issue-attribute-filter-schema.ts index 8d9dde7ddc8..7b7176f48b8 100644 --- a/src/main/runtime/rpc/methods/linear-issue-attribute-filter-schema.ts +++ b/src/main/runtime/rpc/methods/linear-issue-attribute-filter-schema.ts @@ -4,7 +4,7 @@ import { LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_LABEL_IDS, LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_PRIORITIES, LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_STATE_IDS -} from '../../../../shared/linear-issue-attribute-filter' +} from '../../../../shared/linear/issue-attribute-filter' // Why: keep ListIssues param validation co-located with shared limits without // pushing linear.ts past the max-lines ratchet. diff --git a/src/main/runtime/rpc/methods/repo-update-schema.ts b/src/main/runtime/rpc/methods/repo-update-schema.ts index f178bfa8d11..4fff864abcd 100644 --- a/src/main/runtime/rpc/methods/repo-update-schema.ts +++ b/src/main/runtime/rpc/methods/repo-update-schema.ts @@ -6,7 +6,7 @@ import { normalizeRepoSourceControlAiOverrides } from '../../../../shared/source import { normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences -} from '../../../../shared/worktree-visibility-sources' +} from '../../../../shared/worktree/visibility-sources' export const RepoSourceControlAiOverrides = z .unknown() diff --git a/src/main/runtime/runtime-folder-workspace.test.ts b/src/main/runtime/runtime-folder-workspace.test.ts index f00da160330..06d97809c90 100644 --- a/src/main/runtime/runtime-folder-workspace.test.ts +++ b/src/main/runtime/runtime-folder-workspace.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import type { Repo, WorktreeMeta } from '../../shared/types' -import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree-id' +import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree/id' import { getRuntimeFolderWorkspaceInstanceId, getRuntimeFolderWorkspaceRootId, diff --git a/src/main/runtime/runtime-folder-workspace.ts b/src/main/runtime/runtime-folder-workspace.ts index fcbbacbd51d..63f548a1037 100644 --- a/src/main/runtime/runtime-folder-workspace.ts +++ b/src/main/runtime/runtime-folder-workspace.ts @@ -1,6 +1,6 @@ import { DEFAULT_WORKSPACE_STATUS_ID } from '../../shared/workspace-statuses' import type { Repo, Worktree, WorktreeMeta } from '../../shared/types' -import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree-id' +import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../shared/worktree/id' import { normalizeWorkspaceCreatorProvenance } from '../../shared/workspace-creator-provenance' export function getRuntimeFolderWorkspaceRootId(repo: Repo): string { diff --git a/src/main/runtime/unstopped-pty-verification.ts b/src/main/runtime/unstopped-pty-verification.ts index 068334eb98d..2dc9aac5960 100644 --- a/src/main/runtime/unstopped-pty-verification.ts +++ b/src/main/runtime/unstopped-pty-verification.ts @@ -3,7 +3,7 @@ import { UNSTOPPED_PTY_DETAIL_SEPARATOR, UNSTOPPED_PTY_LIVE_DETAIL_PREFIX, UNSTOPPED_PTY_REMOVAL_PREFIX -} from '../../shared/worktree-removal' +} from '../../shared/worktree/removal' import { settleBeforeDeadline } from './settle-before-deadline' // Floor for the verification window when the sweep ran on a very short budget. diff --git a/src/main/runtime/workspace-session-terminal-membership-authority.ts b/src/main/runtime/workspace-session-terminal-membership-authority.ts index 9dace4c8cb1..556d488edc2 100644 --- a/src/main/runtime/workspace-session-terminal-membership-authority.ts +++ b/src/main/runtime/workspace-session-terminal-membership-authority.ts @@ -5,7 +5,7 @@ import type { TerminalPaneLayoutNode, WorkspaceSessionState } from '../../shared/types' -import { getRepoIdFromWorktreeId } from '../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { pruneTabGroupLayoutAfterRetirement } from './mobile-session-terminal-retirement' function collectLeafIds(node: TerminalPaneLayoutNode | null, ids: Set): void { diff --git a/src/main/runtime/worktree-teardown-unstopped-pty.test.ts b/src/main/runtime/worktree-teardown-unstopped-pty.test.ts index ca09e01b2d8..31ba390c3ec 100644 --- a/src/main/runtime/worktree-teardown-unstopped-pty.test.ts +++ b/src/main/runtime/worktree-teardown-unstopped-pty.test.ts @@ -13,7 +13,7 @@ import { ABANDONED_SWEEP_GRACE_MS } from './forced-sweep-settlement' import { classifyWorktreeForceDeleteReason, isProvenLivePtyRemovalError -} from '../../shared/worktree-removal' +} from '../../shared/worktree/removal' import type { IPtyProvider, PtyProcessInfo } from '../providers/types' // Why: these tests advance fake timers *before* awaiting the teardown, so a diff --git a/src/main/runtime/worktree-teardown.ts b/src/main/runtime/worktree-teardown.ts index 993a263d348..ed0df69e8f7 100644 --- a/src/main/runtime/worktree-teardown.ts +++ b/src/main/runtime/worktree-teardown.ts @@ -2,13 +2,13 @@ import type { IPtyProvider } from '../providers/types' import type { OrcaRuntimeService } from './orca-runtime' import { listRegisteredPtys } from '../memory/pty-registry' import { isPathInsideOrEqual } from '../../shared/cross-platform-path' -import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree-id' +import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../../shared/worktree/id' import { mapWithConcurrency } from '../../shared/map-with-concurrency' import { isUnstoppedPtyRemovalError, WORKTREE_TEARDOWN_FORCE_HINT, WORKTREE_TEARDOWN_TIMEOUT_PREFIX -} from '../../shared/worktree-removal' +} from '../../shared/worktree/removal' import { settleBeforeDeadline } from './settle-before-deadline' import { createWorktreeSweepTracker, settleSweepsForForcedRemoval } from './forced-sweep-settlement' import { diff --git a/src/main/source-control/hosted-review-creation.ts b/src/main/source-control/hosted-review-creation.ts index 0fa50ef3a32..2149c1ab000 100644 --- a/src/main/source-control/hosted-review-creation.ts +++ b/src/main/source-control/hosted-review-creation.ts @@ -21,7 +21,7 @@ import { isGiteaReviewCreationAuthenticated } from '../gitea/pull-request-creati import { isBitbucketReviewCreationAuthenticated } from '../bitbucket/pull-request-creation' import { getEnterpriseGitHubRepoSlug } from '../github/github-enterprise-repository' import { getRepoSlug } from '../github/client' -import { isDefaultGitHubHost } from '../../shared/github-repository-identity-key' +import { isDefaultGitHubHost } from '../../shared/github/repository-identity-key' import { acquire, ghExecFileAsync, gitExecFileAsync, release } from '../github/gh-utils' import { isNoUpstreamError, normalizeGitErrorMessage } from '../../shared/git-remote-error' import type { GitUpstreamStatus } from '../../shared/types' diff --git a/src/main/ssh/ssh-remote-linear-activity-output.test.ts b/src/main/ssh/ssh-remote-linear-activity-output.test.ts index ffbd63a71bc..3cfb70c4686 100644 --- a/src/main/ssh/ssh-remote-linear-activity-output.test.ts +++ b/src/main/ssh/ssh-remote-linear-activity-output.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { LinearIssueContextResult } from '../../shared/linear-agent-access' +import type { LinearIssueContextResult } from '../../shared/linear/agent-access' import { formatRemoteLinearCli } from './ssh-remote-linear-output' describe('SSH Linear activity output', () => { diff --git a/src/main/ssh/ssh-remote-linear-list-issues.ts b/src/main/ssh/ssh-remote-linear-list-issues.ts index eb9213ada7c..98f10e8f36c 100644 --- a/src/main/ssh/ssh-remote-linear-list-issues.ts +++ b/src/main/ssh/ssh-remote-linear-list-issues.ts @@ -1,4 +1,4 @@ -import type { LinearMcpIssueListRequest } from '../../shared/linear-agent-access' +import type { LinearMcpIssueListRequest } from '../../shared/linear/agent-access' import type { RpcDispatcher } from '../runtime/rpc/dispatcher' import type { RpcResponse } from '../runtime/rpc/core' import { RemoteCliArgumentError, type ParsedRemoteCli } from './ssh-remote-cli-argument-error' diff --git a/src/main/ssh/ssh-remote-linear-output.ts b/src/main/ssh/ssh-remote-linear-output.ts index 4835791733c..0025248fb37 100644 --- a/src/main/ssh/ssh-remote-linear-output.ts +++ b/src/main/ssh/ssh-remote-linear-output.ts @@ -16,11 +16,11 @@ import type { LinearAttachResult, LinearCreateResult, LinearSaveIssueResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import { formatLinearProjectListRows, linearProjectListWarningLines -} from '../../shared/linear-project-list-format' +} from '../../shared/linear/project-list-format' import { isLinearAttachResult, isLinearCommentAddResult, diff --git a/src/main/ssh/ssh-remote-linear-read-cli.ts b/src/main/ssh/ssh-remote-linear-read-cli.ts index 123a279f0b6..d9ecfb27365 100644 --- a/src/main/ssh/ssh-remote-linear-read-cli.ts +++ b/src/main/ssh/ssh-remote-linear-read-cli.ts @@ -3,7 +3,7 @@ import { clampLinearIssueDepth, clampLinearSearchLimit, type LinearIssueInclude -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' import type { RpcDispatcher } from '../runtime/rpc/dispatcher' import type { RpcResponse } from '../runtime/rpc/core' import { RemoteCliArgumentError, type ParsedRemoteCli } from './ssh-remote-cli-argument-error' diff --git a/src/main/ssh/ssh-remote-linear-relation-write.ts b/src/main/ssh/ssh-remote-linear-relation-write.ts index f89911958ff..e0ca568f8ed 100644 --- a/src/main/ssh/ssh-remote-linear-relation-write.ts +++ b/src/main/ssh/ssh-remote-linear-relation-write.ts @@ -1,4 +1,4 @@ -import type { LinearIssueRelationship } from '../../shared/linear-agent-access' +import type { LinearIssueRelationship } from '../../shared/linear/agent-access' import type { RpcResponse } from '../runtime/rpc/core' import type { RpcDispatcher } from '../runtime/rpc/dispatcher' import { diff --git a/src/main/ssh/ssh-remote-linear-result-guards.ts b/src/main/ssh/ssh-remote-linear-result-guards.ts index fd9bb2573c4..af05a6ed4da 100644 --- a/src/main/ssh/ssh-remote-linear-result-guards.ts +++ b/src/main/ssh/ssh-remote-linear-result-guards.ts @@ -15,7 +15,7 @@ import type { LinearTeamListResult, LinearTeamMembersResult, LinearTeamStatesResult -} from '../../shared/linear-agent-access' +} from '../../shared/linear/agent-access' export function isLinearIssueContextResult(result: unknown): result is LinearIssueContextResult { return ( diff --git a/src/main/ssh/ssh-remote-linear-write-support.ts b/src/main/ssh/ssh-remote-linear-write-support.ts index a341f0a93e8..b4967c90536 100644 --- a/src/main/ssh/ssh-remote-linear-write-support.ts +++ b/src/main/ssh/ssh-remote-linear-write-support.ts @@ -1,6 +1,6 @@ import type { RpcResponse } from '../runtime/rpc/core' import type { RpcDispatcher } from '../runtime/rpc/dispatcher' -import { isLinearUuid } from '../../shared/linear-uuid' +import { isLinearUuid } from '../../shared/linear/uuid' type ParsedRemoteCli = { commandPath: string[] diff --git a/src/main/usage-worktree-metadata.ts b/src/main/usage-worktree-metadata.ts index 53043124c94..8c4f3a94ba6 100644 --- a/src/main/usage-worktree-metadata.ts +++ b/src/main/usage-worktree-metadata.ts @@ -1,6 +1,6 @@ import { basename } from 'node:path' import type { Repo } from '../shared/types' -import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../shared/worktree-id' +import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../shared/worktree/id' import { isFolderRepo } from '../shared/repo-kind' import type { Store } from './persistence' diff --git a/src/main/worktree-create-base-prefetch.ts b/src/main/worktree-create-base-prefetch.ts index 8653c6866eb..fc43980202e 100644 --- a/src/main/worktree-create-base-prefetch.ts +++ b/src/main/worktree-create-base-prefetch.ts @@ -6,7 +6,7 @@ import { getBaseRefDefault } from './git/repo' import { getSshGitProvider } from './providers/ssh-git-dispatch' import { prefetchRemoteWorktreeCreateBase } from './ipc/worktree-remote' import { resolveWorktreeCreateBase } from './worktree-create-base' -import { resolveWorktreeAddBaseRef } from '../shared/worktree-base-ref' +import { resolveWorktreeAddBaseRef } from '../shared/worktree/base-ref' type RemoteTrackingBaseForPrefetch = { remote: string diff --git a/src/preload/api-types.ts b/src/preload/api-types.ts index 3b21663bccb..84ceb217cf7 100644 --- a/src/preload/api-types.ts +++ b/src/preload/api-types.ts @@ -108,7 +108,7 @@ import type { } from '../shared/orca-profiles' import type { TerminalPaneSplitSource } from '../shared/feature-education-telemetry' import type { TaskSourceContext } from '../shared/task-source-context' -import type { LinearIssueAttributeFilter } from '../shared/linear-issue-attribute-filter' +import type { LinearIssueAttributeFilter } from '../shared/linear/issue-attribute-filter' import type { ProjectExecutionRuntimeResolution } from '../shared/project-execution-runtime' import type { StartupCommandDelivery } from '../shared/codex-startup-delivery' import type { @@ -347,7 +347,7 @@ import type { UpdateIssueTypeBySlugArgs, UpdatePullRequestBySlugArgs, UpdateProjectItemFieldArgs -} from '../shared/github-project-types' +} from '../shared/github/project-types' import type { RichMarkdownContextMenuCommandPayload, RichMarkdownContextMenuTableTarget @@ -475,7 +475,7 @@ import type { WorkspacePortScanRequest, WorkspacePortScanResult } from '../shared/workspace-ports' -import type { GhAuthDiagnostic } from '../shared/github-auth-types' +import type { GhAuthDiagnostic } from '../shared/github/auth-types' import type { CodexUsageBreakdownKind, CodexUsageSnapshot } from '../shared/codex-usage-types' import type { OpenCodeUsageBreakdownKind, diff --git a/src/preload/index.ts b/src/preload/index.ts index 518feac7d82..24e692088e0 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -160,7 +160,7 @@ import type { import type { WorkspaceSpaceScanProgress } from '../shared/workspace-space-types' import type { WorkspaceCleanupScanProgress } from '../shared/workspace-cleanup' import type { WorkspacePortAdvertisedUrlChangedEvent } from '../shared/workspace-ports' -import type { GhAuthDiagnostic } from '../shared/github-auth-types' +import type { GhAuthDiagnostic } from '../shared/github/auth-types' import type { TaskSourceContext } from '../shared/task-source-context' import type { AddIssueCommentBySlugArgs, @@ -189,7 +189,7 @@ import type { UpdateIssueTypeBySlugArgs, UpdatePullRequestBySlugArgs, UpdateProjectItemFieldArgs -} from '../shared/github-project-types' +} from '../shared/github/project-types' import { richMarkdownContextMenuCommandChannel, richMarkdownContextMenuTargetChannel, diff --git a/src/relay/git-handler-worktree-ops.ts b/src/relay/git-handler-worktree-ops.ts index 487fabd7688..0cdb0761b47 100644 --- a/src/relay/git-handler-worktree-ops.ts +++ b/src/relay/git-handler-worktree-ops.ts @@ -1,5 +1,5 @@ import * as path from 'node:path' -import { resolveWorktreeAddBaseRef } from '../shared/worktree-base-ref' +import { resolveWorktreeAddBaseRef } from '../shared/worktree/base-ref' import type { GitExec } from './git-handler-ops' export { removeWorktreeOp } from './git-handler-worktree-remove' export { readRelayWorktreeList } from './git-handler-worktree-list' diff --git a/src/relay/git-handler-worktree-remove.ts b/src/relay/git-handler-worktree-remove.ts index 46ebaf8a355..80bf08c25fe 100644 --- a/src/relay/git-handler-worktree-remove.ts +++ b/src/relay/git-handler-worktree-remove.ts @@ -1,7 +1,7 @@ import * as path from 'node:path' import type { RemoveWorktreeResult } from '../shared/types' -import { assertWorktreeUnlockedForRemoval } from '../shared/worktree-removal' -import { isSubmoduleWorktreeRemovalRefusal } from '../shared/worktree-submodule-removal' +import { assertWorktreeUnlockedForRemoval } from '../shared/worktree/removal' +import { isSubmoduleWorktreeRemovalRefusal } from '../shared/worktree/submodule-removal' import { deleteAlreadyMergedRelayBranchAfterSafeDeleteFailure } from './git-handler-branch-cleanup' import type { GitExec } from './git-handler-ops' import type { GitCapabilityCache } from '../shared/git-capability-cache' diff --git a/src/relay/pty-handler.ts b/src/relay/pty-handler.ts index 3f8bd593e08..faa12d5093b 100644 --- a/src/relay/pty-handler.ts +++ b/src/relay/pty-handler.ts @@ -25,7 +25,7 @@ import { isPathInsideOrEqual, normalizeRuntimePathForComparison } from '../shared/cross-platform-path' -import { splitWorktreeId } from '../shared/worktree-id' +import { splitWorktreeId } from '../shared/worktree/id' import { PhysicalExitTracker } from '../shared/physical-exit-tracker' import { SHELL_READY_MARKER_PREFIX } from '../main/shell-ready-marker-scanner' import { diff --git a/src/renderer/src/components/GitHubItemDialog.tsx b/src/renderer/src/components/GitHubItemDialog.tsx index 5f73fb31bea..bba079e9f6d 100644 --- a/src/renderer/src/components/GitHubItemDialog.tsx +++ b/src/renderer/src/components/GitHubItemDialog.tsx @@ -177,8 +177,8 @@ import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' import { GITHUB_PR_MERGE_METHOD_LABELS, resolveGitHubPRMergeMethods -} from '../../../shared/github-pr-merge-methods' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +} from '../../../shared/github/pull-request-merge-methods' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' import { findGithubIssueWorkspaceAttachment, getGithubWorkItemWorkspaceAttachmentLabel diff --git a/src/renderer/src/components/PullRequestPage.tsx b/src/renderer/src/components/PullRequestPage.tsx index aedc7bdd5e0..f47b452b573 100644 --- a/src/renderer/src/components/PullRequestPage.tsx +++ b/src/renderer/src/components/PullRequestPage.tsx @@ -170,8 +170,8 @@ import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' import { GITHUB_PR_MERGE_METHOD_LABELS, resolveGitHubPRMergeMethods -} from '../../../shared/github-pr-merge-methods' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +} from '../../../shared/github/pull-request-merge-methods' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' import { findGithubPrWorkspaceAttachment, getGithubPrWorkspaceAttachmentLabel diff --git a/src/renderer/src/components/TaskPage.tsx b/src/renderer/src/components/TaskPage.tsx index 29bc0bc4587..d7cfc3e9e5e 100644 --- a/src/renderer/src/components/TaskPage.tsx +++ b/src/renderer/src/components/TaskPage.tsx @@ -127,11 +127,11 @@ import { getLinearStatePillStyle } from '@/components/linear-state-pill-style' import { parseTaskQuery, stripRepoQualifiers, withQualifier } from '../../../shared/task-query' -import { githubProjectHost } from '../../../shared/github-project-identity' +import { githubProjectHost } from '../../../shared/github/project-identity' import { buildLinearTeamUrl, getLinearOrganizationUrlKeyFromIssueUrl -} from '../../../shared/linear-links' +} from '../../../shared/linear/links' import PRFilterDropdowns, { type PRFilterChange } from '@/components/github/PRFilterDropdowns' import { GitHubMarkdownComposer } from '@/components/github/GitHubMarkdownComposer' import { GitHubUserAvatar } from '@/components/github/github-user-avatar' @@ -287,7 +287,7 @@ import { import { linearIssueAttributeFilterSignature, type LinearIssueAttributeFilter -} from '../../../shared/linear-issue-attribute-filter' +} from '../../../shared/linear/issue-attribute-filter' import { DEFAULT_LINEAR_GROUP_BY, DEFAULT_LINEAR_ORDER_BY, @@ -296,7 +296,7 @@ import { selectLinearWorkspaceIssueFilter, serializeLinearIssueViewResumeState, setLinearWorkspaceIssueFilter -} from '../../../shared/linear-issue-view-resume-state' +} from '../../../shared/linear/issue-view-resume-state' import { loadLinearIssueView, saveLinearIssueView } from './linear-issue-view-storage' import { isNewIssueDraftContentful, @@ -349,7 +349,7 @@ import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' import { GITHUB_PR_MERGE_METHOD_LABELS, resolveGitHubPRMergeMethods -} from '../../../shared/github-pr-merge-methods' +} from '../../../shared/github/pull-request-merge-methods' import type { GitHubOwnerRepo, GitHubAssignableUser, @@ -382,7 +382,7 @@ import type { GitLabProjectRef } from '../../../shared/gitlab-types' import { LINEAR_ISSUE_LIST_MAX, clampLinearIssueListLimit -} from '../../../shared/linear-issue-read-limits' +} from '../../../shared/linear/issue-read-limits' import { shouldSuppressEnterSubmit } from '@/lib/new-workspace-enter-guard' import { useContextualTour } from '@/components/contextual-tours/use-contextual-tour' import { getScreenSubmitShortcutLabel, isScreenSubmitShortcut } from '@/lib/screen-submit-shortcut' diff --git a/src/renderer/src/components/automations/AutomationsPage.tsx b/src/renderer/src/components/automations/AutomationsPage.tsx index b1fe9c4988b..a17d79e4197 100644 --- a/src/renderer/src/components/automations/AutomationsPage.tsx +++ b/src/renderer/src/components/automations/AutomationsPage.tsx @@ -29,7 +29,7 @@ import { getHostDisplayLabelOverrides } from '../../../../shared/host-setting-ov import type { PreflightStatus } from '../../../../preload/api-types' import type { TaskSourceContext } from '../../../../shared/task-source-context' import type { OrcaHooks, Repo } from '../../../../shared/types' -import { getWorktreePathBasenameFromId } from '../../../../shared/worktree-id' +import { getWorktreePathBasenameFromId } from '../../../../shared/worktree/id' import { buildAutomationRrule, isValidAutomationCronSchedule, diff --git a/src/renderer/src/components/github-pr-merge-state.ts b/src/renderer/src/components/github-pr-merge-state.ts index ca6c47e71b4..d67a3b8a3ef 100644 --- a/src/renderer/src/components/github-pr-merge-state.ts +++ b/src/renderer/src/components/github-pr-merge-state.ts @@ -5,7 +5,7 @@ import type { PRReviewDecision, PRState } from '../../../shared/types' -import { canEnableGitHubPRAutoMerge } from '../../../shared/github-pr-auto-merge-availability' +import { canEnableGitHubPRAutoMerge } from '../../../shared/github/pull-request-auto-merge-availability' import { translate } from '@/i18n/i18n' export type GitHubPRMergeStateInput = { diff --git a/src/renderer/src/components/github-project/GhAuthErrorHelp.test.ts b/src/renderer/src/components/github-project/GhAuthErrorHelp.test.ts index 248783de9e0..5e352e13884 100644 --- a/src/renderer/src/components/github-project/GhAuthErrorHelp.test.ts +++ b/src/renderer/src/components/github-project/GhAuthErrorHelp.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { GhAuthDiagnostic } from '../../../../shared/github-auth-types' +import type { GhAuthDiagnostic } from '../../../../shared/github/auth-types' vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback diff --git a/src/renderer/src/components/github-project/GhAuthErrorHelp.tsx b/src/renderer/src/components/github-project/GhAuthErrorHelp.tsx index 7bbeff291d7..6cec15c57b5 100644 --- a/src/renderer/src/components/github-project/GhAuthErrorHelp.tsx +++ b/src/renderer/src/components/github-project/GhAuthErrorHelp.tsx @@ -12,8 +12,8 @@ import { useEffect, useState } from 'react' import { Copy, ExternalLink, RotateCw } from 'lucide-react' import { toast } from 'sonner' import { Button } from '@/components/ui/button' -import type { GitHubProjectViewError } from '@/../../shared/github-project-types' -import type { GhAuthDiagnostic } from '@/../../shared/github-auth-types' +import type { GitHubProjectViewError } from '../../../../shared/github/project-types' +import type { GhAuthDiagnostic } from '../../../../shared/github/auth-types' import { translate } from '@/i18n/i18n' type AuthErrorKind = 'auth_required' | 'scope_missing' diff --git a/src/renderer/src/components/github-project/ProjectCell.tsx b/src/renderer/src/components/github-project/ProjectCell.tsx index 305fccc3873..877f426311a 100644 --- a/src/renderer/src/components/github-project/ProjectCell.tsx +++ b/src/renderer/src/components/github-project/ProjectCell.tsx @@ -24,7 +24,7 @@ import type { GitHubProjectRow, GitHubProjectUser, ListIssueTypesBySlugResult -} from '../../../../shared/github-project-types' +} from '../../../../shared/github/project-types' import type { GlobalSettings } from '../../../../shared/types' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/github-project/ProjectGroupHeader.tsx b/src/renderer/src/components/github-project/ProjectGroupHeader.tsx index c0856cb59a3..add12fb4e99 100644 --- a/src/renderer/src/components/github-project/ProjectGroupHeader.tsx +++ b/src/renderer/src/components/github-project/ProjectGroupHeader.tsx @@ -1,7 +1,7 @@ import React from 'react' import { ChevronDown, ChevronRight } from 'lucide-react' import { cn } from '@/lib/utils' -import { isIterationCurrent, type ProjectGroup } from '../../../../shared/github-project-group-sort' +import { isIterationCurrent, type ProjectGroup } from '../../../../shared/github/project-group-sort' import { translate } from '@/i18n/i18n' type Props = { diff --git a/src/renderer/src/components/github-project/ProjectPicker.tsx b/src/renderer/src/components/github-project/ProjectPicker.tsx index 2abf6273e59..cd142d5b04c 100644 --- a/src/renderer/src/components/github-project/ProjectPicker.tsx +++ b/src/renderer/src/components/github-project/ProjectPicker.tsx @@ -23,12 +23,12 @@ import type { ListAccessibleProjectsResult, ListProjectViewsResult, ResolveProjectRefResult -} from '../../../../shared/github-project-types' +} from '../../../../shared/github/project-types' import { GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR, hasBoundedGitHubProjectRefInputText, isGitHubProjectRefInputTooLarge -} from '../../../../shared/github-project-ref-input' +} from '../../../../shared/github/project-ref-input' import { filterGitHubProjectPickerProjects } from './github-project-picker-filter' import { getProjectPickerBrowseCacheEntry, @@ -39,7 +39,7 @@ import { translate } from '@/i18n/i18n' import { githubProjectHost, githubProjectIdentityKey -} from '../../../../shared/github-project-identity' +} from '../../../../shared/github/project-identity' export type ResolvedProjectSelection = { owner: string diff --git a/src/renderer/src/components/github-project/ProjectRow.tsx b/src/renderer/src/components/github-project/ProjectRow.tsx index e59c58903eb..d57a807702e 100644 --- a/src/renderer/src/components/github-project/ProjectRow.tsx +++ b/src/renderer/src/components/github-project/ProjectRow.tsx @@ -11,7 +11,7 @@ import type { GitHubProjectField, GitHubProjectFieldMutationValue, GitHubProjectRow as GitHubProjectRowType -} from '../../../../shared/github-project-types' +} from '../../../../shared/github/project-types' import type { GlobalSettings } from '../../../../shared/types' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/github-project/ProjectViewList.tsx b/src/renderer/src/components/github-project/ProjectViewList.tsx index fbc869b1107..8bd6963b4c7 100644 --- a/src/renderer/src/components/github-project/ProjectViewList.tsx +++ b/src/renderer/src/components/github-project/ProjectViewList.tsx @@ -5,7 +5,7 @@ import { cn } from '@/lib/utils' import ColumnResizeHandle from './ColumnResizeHandle' import ProjectGroupHeader from './ProjectGroupHeader' import ProjectRow from './ProjectRow' -import { groupRows, sortRows } from '../../../../shared/github-project-group-sort' +import { groupRows, sortRows } from '../../../../shared/github/project-group-sort' import { getAvailableColumns, loadHiddenColumns, saveHiddenColumns } from './columns' import { ACTION_COLUMN_WIDTH, @@ -21,7 +21,7 @@ import type { GitHubProjectRow, GitHubProjectSortDirection, GitHubProjectTable -} from '../../../../shared/github-project-types' +} from '../../../../shared/github/project-types' import type { GlobalSettings } from '../../../../shared/types' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/github-project/ProjectViewWrapper.tsx b/src/renderer/src/components/github-project/ProjectViewWrapper.tsx index 59d02e24f31..7cac639ba8a 100644 --- a/src/renderer/src/components/github-project/ProjectViewWrapper.tsx +++ b/src/renderer/src/components/github-project/ProjectViewWrapper.tsx @@ -40,7 +40,7 @@ import type { GitHubProjectViewError, GitHubProjectViewSummary, ListProjectViewsResult -} from '../../../../shared/github-project-types' +} from '../../../../shared/github/project-types' import type { GitHubWorkItem } from '../../../../shared/types' import ProjectPicker, { type ResolvedProjectSelection } from './ProjectPicker' import ProjectViewList from './ProjectViewList' @@ -64,7 +64,7 @@ import { buildTaskSourceContextFromRepo } from '../../../../shared/task-source-c import { githubProjectHost, githubProjectIdentityKey -} from '../../../../shared/github-project-identity' +} from '../../../../shared/github/project-identity' type Props = { selectedRepoIds: ReadonlySet diff --git a/src/renderer/src/components/github-project/column-widths.ts b/src/renderer/src/components/github-project/column-widths.ts index 68106fb451b..5967e4d2b5e 100644 --- a/src/renderer/src/components/github-project/column-widths.ts +++ b/src/renderer/src/components/github-project/column-widths.ts @@ -7,7 +7,7 @@ // the grid always fit its container exactly. Resize redistributes // weights between a column pair so the total stays constant and the // table never grows beyond its container. -import type { GitHubProjectField } from '../../../../shared/github-project-types' +import type { GitHubProjectField } from '../../../../shared/github/project-types' const STORAGE_KEY = 'orca.githubProject.columnWidths' diff --git a/src/renderer/src/components/github-project/columns.ts b/src/renderer/src/components/github-project/columns.ts index 9e3684b5bfe..b2cd21b5276 100644 --- a/src/renderer/src/components/github-project/columns.ts +++ b/src/renderer/src/components/github-project/columns.ts @@ -3,7 +3,7 @@ // local visibility filter on top. Persisted in localStorage (not settings) // because it's purely cosmetic per device and would otherwise bloat the // debounced settings write on every checkbox toggle. -import type { GitHubProjectField, GitHubProjectView } from '../../../../shared/github-project-types' +import type { GitHubProjectField, GitHubProjectView } from '../../../../shared/github/project-types' export const TYPE_FIELD_ID = '__type__' export const TYPE_FIELD_DATA_TYPE = '__TYPE__' diff --git a/src/renderer/src/components/github-project/github-project-picker-filter.test.ts b/src/renderer/src/components/github-project/github-project-picker-filter.test.ts index 2f04b73f71f..b3b3aee335c 100644 --- a/src/renderer/src/components/github-project/github-project-picker-filter.test.ts +++ b/src/renderer/src/components/github-project/github-project-picker-filter.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { GitHubProjectSummary } from '../../../../shared/github-project-types' +import type { GitHubProjectSummary } from '../../../../shared/github/project-types' import { GITHUB_PROJECT_PICKER_QUERY_MAX_BYTES, filterGitHubProjectPickerProjects, diff --git a/src/renderer/src/components/github-project/github-project-picker-filter.ts b/src/renderer/src/components/github-project/github-project-picker-filter.ts index 0f8065db291..fcee171db82 100644 --- a/src/renderer/src/components/github-project/github-project-picker-filter.ts +++ b/src/renderer/src/components/github-project/github-project-picker-filter.ts @@ -2,8 +2,8 @@ import { isClipboardTextByteLengthOverLimit } from '../../../../shared/clipboard import type { GitHubProjectSettings, GitHubProjectSummary -} from '../../../../shared/github-project-types' -import { githubProjectIdentityKey } from '../../../../shared/github-project-identity' +} from '../../../../shared/github/project-types' +import { githubProjectIdentityKey } from '../../../../shared/github/project-identity' export const GITHUB_PROJECT_PICKER_QUERY_MAX_BYTES = 2 * 1024 diff --git a/src/renderer/src/components/github-project/group-sort.test.ts b/src/renderer/src/components/github-project/group-sort.test.ts index 4d36f0125da..cd5e77738bc 100644 --- a/src/renderer/src/components/github-project/group-sort.test.ts +++ b/src/renderer/src/components/github-project/group-sort.test.ts @@ -8,8 +8,8 @@ import type { GitHubProjectSort, GitHubProjectTable, GitHubProjectView -} from '../../../../shared/github-project-types' -import { sortRows, groupRows } from '../../../../shared/github-project-group-sort' +} from '../../../../shared/github/project-types' +import { sortRows, groupRows } from '../../../../shared/github/project-group-sort' const singleSelectField: GitHubProjectField = { kind: 'single-select', diff --git a/src/renderer/src/components/github-project/project-picker-browse-cache.test.ts b/src/renderer/src/components/github-project/project-picker-browse-cache.test.ts index 8f0052c4fbe..cb0e5b2f7a6 100644 --- a/src/renderer/src/components/github-project/project-picker-browse-cache.test.ts +++ b/src/renderer/src/components/github-project/project-picker-browse-cache.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it } from 'vitest' -import type { GitHubProjectSummary } from '../../../../shared/github-project-types' +import type { GitHubProjectSummary } from '../../../../shared/github/project-types' import { PROJECT_PICKER_BROWSE_CACHE_MAX_ENTRIES, PROJECT_PICKER_BROWSE_CACHE_TTL_MS, diff --git a/src/renderer/src/components/github-project/project-picker-browse-cache.ts b/src/renderer/src/components/github-project/project-picker-browse-cache.ts index bd1726aec3a..1854d1f4ca3 100644 --- a/src/renderer/src/components/github-project/project-picker-browse-cache.ts +++ b/src/renderer/src/components/github-project/project-picker-browse-cache.ts @@ -1,4 +1,4 @@ -import type { GitHubProjectSummary } from '../../../../shared/github-project-types' +import type { GitHubProjectSummary } from '../../../../shared/github/project-types' export const PROJECT_PICKER_BROWSE_CACHE_TTL_MS = 5 * 60_000 export const PROJECT_PICKER_BROWSE_CACHE_MAX_ENTRIES = 32 diff --git a/src/renderer/src/components/github-project/project-row-filtering.test.ts b/src/renderer/src/components/github-project/project-row-filtering.test.ts index 8871c047f7a..636382aa53c 100644 --- a/src/renderer/src/components/github-project/project-row-filtering.test.ts +++ b/src/renderer/src/components/github-project/project-row-filtering.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import type { GitHubProjectRow, GitHubProjectTable } from '../../../../shared/github-project-types' +import type { GitHubProjectRow, GitHubProjectTable } from '../../../../shared/github/project-types' import type { Repo } from '../../../../shared/types' import { filterProjectTableRowsByOpenRepos, diff --git a/src/renderer/src/components/github-project/project-row-filtering.ts b/src/renderer/src/components/github-project/project-row-filtering.ts index 52dd0138274..b4c1b3738a3 100644 --- a/src/renderer/src/components/github-project/project-row-filtering.ts +++ b/src/renderer/src/components/github-project/project-row-filtering.ts @@ -1,4 +1,4 @@ -import type { GitHubProjectRow, GitHubProjectTable } from '../../../../shared/github-project-types' +import type { GitHubProjectRow, GitHubProjectTable } from '../../../../shared/github/project-types' import type { Repo } from '../../../../shared/types' export type ProjectRowSlugLookup = ( diff --git a/src/renderer/src/components/github-project/project-view-wrapper-source-context-boundary.test.ts b/src/renderer/src/components/github-project/project-view-wrapper-source-context-boundary.test.ts index 6fe48619960..b7273b5e306 100644 --- a/src/renderer/src/components/github-project/project-view-wrapper-source-context-boundary.test.ts +++ b/src/renderer/src/components/github-project/project-view-wrapper-source-context-boundary.test.ts @@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' import { describe, expect, it } from 'vitest' -import type { GitHubProjectRow } from '../../../../shared/github-project-types' +import type { GitHubProjectRow } from '../../../../shared/github/project-types' const COMPONENT_ROOT = __dirname diff --git a/src/renderer/src/components/github-project/project-visible-table-cache.test.ts b/src/renderer/src/components/github-project/project-visible-table-cache.test.ts index e5eeabc40fc..ddf089a49d0 100644 --- a/src/renderer/src/components/github-project/project-visible-table-cache.test.ts +++ b/src/renderer/src/components/github-project/project-visible-table-cache.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { GitHubProjectTable } from '../../../../shared/github-project-types' +import type { GitHubProjectTable } from '../../../../shared/github/project-types' import { getSelectedRepoFingerprint, getNextVisibleProjectTableCache, diff --git a/src/renderer/src/components/github-project/project-visible-table-cache.ts b/src/renderer/src/components/github-project/project-visible-table-cache.ts index 6390e897281..e3dc0772aa0 100644 --- a/src/renderer/src/components/github-project/project-visible-table-cache.ts +++ b/src/renderer/src/components/github-project/project-visible-table-cache.ts @@ -1,4 +1,4 @@ -import type { GitHubProjectTable } from '../../../../shared/github-project-types' +import type { GitHubProjectTable } from '../../../../shared/github/project-types' export type CachedVisibleProjectTable = { cacheKey: string diff --git a/src/renderer/src/components/github-project/slug-dialog/Comments.tsx b/src/renderer/src/components/github-project/slug-dialog/Comments.tsx index 6de67e2ca54..748edc1fe74 100644 --- a/src/renderer/src/components/github-project/slug-dialog/Comments.tsx +++ b/src/renderer/src/components/github-project/slug-dialog/Comments.tsx @@ -16,7 +16,7 @@ import type { GlobalSettings, PRComment } from '../../../../../shared/types' import type { GitHubProjectCommentMutationResult, GitHubProjectMutationResult -} from '../../../../../shared/github-project-types' +} from '../../../../../shared/github/project-types' import { translate } from '@/i18n/i18n' function getRuntimeTarget(settings: Parameters[0]) { diff --git a/src/renderer/src/components/github/IssueSourceIndicator.tsx b/src/renderer/src/components/github/IssueSourceIndicator.tsx index 57e3d0a2af7..c9615562e81 100644 --- a/src/renderer/src/components/github/IssueSourceIndicator.tsx +++ b/src/renderer/src/components/github/IssueSourceIndicator.tsx @@ -5,7 +5,7 @@ import { cn } from '@/lib/utils' import { githubRepoIdentityKey, isDefaultGitHubHost -} from '../../../../shared/github-repository-identity-key' +} from '../../../../shared/github/repository-identity-key' export type IssueSourceIndicatorProps = { /** Resolved issue-source owner/repo. `null` means the source hasn't been diff --git a/src/renderer/src/components/github/github-work-item-edit-mutations.ts b/src/renderer/src/components/github/github-work-item-edit-mutations.ts index 9385ef14ff2..e81adba1f0e 100644 --- a/src/renderer/src/components/github/github-work-item-edit-mutations.ts +++ b/src/renderer/src/components/github/github-work-item-edit-mutations.ts @@ -8,7 +8,7 @@ import { import { getSettingsForRepoRuntimeOwner } from '@/lib/repo-runtime-owner' import type { GitHubWorkItemProjectOrigin } from '@/components/github/github-work-item-identity' import { notifyWorkItemDetailsMutation } from '@/components/github/github-work-item-comment-mutations' -import { githubProjectHost } from '../../../../shared/github-project-identity' +import { githubProjectHost } from '../../../../shared/github/project-identity' import { getTaskSourceRuntimeSettings, type TaskSourceContext diff --git a/src/renderer/src/components/github/github-work-item-identity.ts b/src/renderer/src/components/github/github-work-item-identity.ts index b4feceed9fb..f4808e17f3f 100644 --- a/src/renderer/src/components/github/github-work-item-identity.ts +++ b/src/renderer/src/components/github/github-work-item-identity.ts @@ -1,4 +1,4 @@ -import { githubProjectHost } from '../../../../shared/github-project-identity' +import { githubProjectHost } from '../../../../shared/github/project-identity' import type { GitHubOwnerRepo, GitHubWorkItem } from '../../../../shared/types' // Why: the dialog lacks repository context, so recover its host-aware identity from the canonical item URL. diff --git a/src/renderer/src/components/linear-api-key-dialog.tsx b/src/renderer/src/components/linear-api-key-dialog.tsx index b9e94ba3bd0..0f00205d26e 100644 --- a/src/renderer/src/components/linear-api-key-dialog.tsx +++ b/src/renderer/src/components/linear-api-key-dialog.tsx @@ -4,7 +4,7 @@ import type { LinearWorkspace } from '../../../shared/types' import { buildLinearPersonalApiKeySettingsUrl, buildLinearWorkspaceApiSettingsUrl -} from '../../../shared/linear-links' +} from '../../../shared/linear/links' import { getActiveRuntimeTarget } from '@/runtime/runtime-rpc-client' import { useAppStore } from '@/store' import { useMountedRef } from '@/hooks/useMountedRef' diff --git a/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx b/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx index 8fa3956959d..2352f25b876 100644 --- a/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx +++ b/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx @@ -9,7 +9,7 @@ import { countLinearIssueAttributeFilters, linearIssueAttributeFilterPillLabels } from './linear-issue-attribute-filter-sections' -import type { LinearIssueAttributeFilter } from '../../../shared/linear-issue-attribute-filter' +import type { LinearIssueAttributeFilter } from '../../../shared/linear/issue-attribute-filter' import LinearIssueAttributeFilterDropdowns from './linear-issue-attribute-filter-dropdowns' const metadataMocks = vi.hoisted(() => ({ diff --git a/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx b/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx index 85e6553ba36..e914a40c064 100644 --- a/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx +++ b/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx @@ -11,7 +11,7 @@ import { canonicalizeLinearIssueAttributeFilter, emptyLinearIssueAttributeFilter, type LinearIssueAttributeFilter -} from '../../../shared/linear-issue-attribute-filter' +} from '../../../shared/linear/issue-attribute-filter' import type { LinearTeam } from '../../../shared/types' import { LinearIssueFilterSectionDetail, diff --git a/src/renderer/src/components/linear-issue-attribute-filter-sections.tsx b/src/renderer/src/components/linear-issue-attribute-filter-sections.tsx index 451a25a8ea9..dcf12b026e9 100644 --- a/src/renderer/src/components/linear-issue-attribute-filter-sections.tsx +++ b/src/renderer/src/components/linear-issue-attribute-filter-sections.tsx @@ -10,7 +10,7 @@ import { translate } from '@/i18n/i18n' import { canonicalizeLinearIssueAttributeFilter, type LinearIssueAttributeFilter -} from '../../../shared/linear-issue-attribute-filter' +} from '../../../shared/linear/issue-attribute-filter' import { getLinearPriorityLabel } from './task-page-localized-options' export type LinearIssueFilterSectionKey = 'status' | 'priority' | 'assignee' | 'labels' diff --git a/src/renderer/src/components/linear-issue-view-storage.test.ts b/src/renderer/src/components/linear-issue-view-storage.test.ts index b9654721ba8..c1c632ed116 100644 --- a/src/renderer/src/components/linear-issue-view-storage.test.ts +++ b/src/renderer/src/components/linear-issue-view-storage.test.ts @@ -1,6 +1,6 @@ // @vitest-environment happy-dom import { beforeEach, describe, expect, it } from 'vitest' -import { defaultLinearIssueViewResumeState } from '../../../shared/linear-issue-view-resume-state' +import { defaultLinearIssueViewResumeState } from '../../../shared/linear/issue-view-resume-state' import { loadLinearIssueView, saveLinearIssueView } from './linear-issue-view-storage' const STORAGE_KEY = 'orca.linear.issue-view.v1' diff --git a/src/renderer/src/components/linear-issue-view-storage.ts b/src/renderer/src/components/linear-issue-view-storage.ts index b34f0cc55fa..2a227644028 100644 --- a/src/renderer/src/components/linear-issue-view-storage.ts +++ b/src/renderer/src/components/linear-issue-view-storage.ts @@ -2,7 +2,7 @@ import { normalizeLinearIssueViewResumeState, resolveLinearIssueViewResumeState, type LinearIssueViewResumeState -} from '../../../shared/linear-issue-view-resume-state' +} from '../../../shared/linear/issue-view-resume-state' // Why: issue-list layout is a per-device view preference, not host state. Routing it // through `ui.set` put it inside a strict nested schema, where a host that predates diff --git a/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx b/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx index b87523a7d2d..66dd756e18f 100644 --- a/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx +++ b/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx @@ -96,7 +96,7 @@ import { type TaskSourceContext } from '../../../../shared/task-source-context' import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' -import { githubRepoIdentityKey } from '../../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../../shared/github/repository-identity-key' import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' import { getGitHubRuntimeRepoId, diff --git a/src/renderer/src/components/right-sidebar/ChecksPanel.tsx b/src/renderer/src/components/right-sidebar/ChecksPanel.tsx index 25489863d7f..2d63be3bacf 100644 --- a/src/renderer/src/components/right-sidebar/ChecksPanel.tsx +++ b/src/renderer/src/components/right-sidebar/ChecksPanel.tsx @@ -40,7 +40,7 @@ import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { isFolderRepo } from '../../../../shared/repo-kind' -import { githubProjectHost } from '../../../../shared/github-project-identity' +import { githubProjectHost } from '../../../../shared/github/project-identity' import HostedReviewActions from './HostedReviewActions' import { GitHubPRStackMap, type GitHubPRStackMapNavigationModifiers } from './GitHubPRStackMap' import { @@ -97,7 +97,7 @@ import type { PendingPRCommentAiAck, PendingPRCommentAiAckGithubTarget } from './pr-comments-ai-launch-ack' -import { parseGitHubIssueOrPRLink } from '../../../../shared/github-links' +import { parseGitHubIssueOrPRLink } from '../../../../shared/github/links' import { startFixChecksAgent } from '@/lib/fix-checks-agent-launch' import { hostedReviewProviderSupportsDraft, diff --git a/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx b/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx index b8adeb40c4f..cace5ee7d98 100644 --- a/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx +++ b/src/renderer/src/components/right-sidebar/HostedReviewActions.tsx @@ -13,7 +13,7 @@ import { } from '@/components/ui/dropdown-menu' import { presentGitHubPRMergeState } from '@/components/github-pr-merge-state' import type { PRInfo, Repo, Worktree } from '../../../../shared/types' -import { resolveGitHubPRMergeMethods } from '../../../../shared/github-pr-merge-methods' +import { resolveGitHubPRMergeMethods } from '../../../../shared/github/pull-request-merge-methods' import { runWorktreeDelete } from '../sidebar/delete-worktree-flow' import { presentGitLabMRMergeState } from './gitlab-mr-merge-state' import { diff --git a/src/renderer/src/components/right-sidebar/ai-vault-scope-paths.ts b/src/renderer/src/components/right-sidebar/ai-vault-scope-paths.ts index c9ad8137fc9..bcd3391a4fc 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-scope-paths.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-scope-paths.ts @@ -4,7 +4,7 @@ import { } from '../../../../shared/cross-platform-path' import type { ProjectHostSetupProjection } from '../../../../shared/project-host-setup-projection' import type { ProjectHostSetup, Worktree } from '../../../../shared/types' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' export function deriveAiVaultWorkspaceScopePaths( activeWorktree: Pick | null, diff --git a/src/renderer/src/components/right-sidebar/ai-vault-session-row-display.tsx b/src/renderer/src/components/right-sidebar/ai-vault-session-row-display.tsx index f0c9d2035d4..2ad0b1cca39 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-session-row-display.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault-session-row-display.tsx @@ -6,7 +6,7 @@ import { AgentIcon } from '@/lib/agent-catalog' import type { AgentStatusState } from '../../../../shared/agent-status-types' import { useRepoById } from '@/store/selectors' import { resolveRepoBadgeColor } from '../../../../shared/repo-badge-color' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' import { isAiVaultSessionRecoverableEmpty, type AiVaultScope, diff --git a/src/renderer/src/components/right-sidebar/ai-vault-session-worktree.ts b/src/renderer/src/components/right-sidebar/ai-vault-session-worktree.ts index d03aedb809e..a82a68c8f1e 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-session-worktree.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-session-worktree.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' import { parseWslUncPath } from '../../../../shared/wsl-paths' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, diff --git a/src/renderer/src/components/right-sidebar/checks-panel-async-result-key.ts b/src/renderer/src/components/right-sidebar/checks-panel-async-result-key.ts index e3cee92b293..fc95acb9a7c 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel-async-result-key.ts +++ b/src/renderer/src/components/right-sidebar/checks-panel-async-result-key.ts @@ -1,5 +1,5 @@ import type { GitHubOwnerRepo } from '../../../../shared/types' -import { githubRepoIdentityKey } from '../../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../../shared/github/repository-identity-key' function normalizedPRRepoIdentity(prRepo?: GitHubOwnerRepo | null): string { return prRepo ? githubRepoIdentityKey(prRepo) : 'none' diff --git a/src/renderer/src/components/right-sidebar/checks-panel-terminal-worktree.ts b/src/renderer/src/components/right-sidebar/checks-panel-terminal-worktree.ts index c8f2f3cb720..ab92bbd1469 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel-terminal-worktree.ts +++ b/src/renderer/src/components/right-sidebar/checks-panel-terminal-worktree.ts @@ -1,5 +1,5 @@ import { parseWslUncPath } from '../../../../shared/wsl-paths' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' import { isPathInsideOrEqual, isRuntimePathAbsolute, diff --git a/src/renderer/src/components/settings/McpConfigSection.tsx b/src/renderer/src/components/settings/McpConfigSection.tsx index 881cd3eb8bb..ce9b3d8db4a 100644 --- a/src/renderer/src/components/settings/McpConfigSection.tsx +++ b/src/renderer/src/components/settings/McpConfigSection.tsx @@ -3,7 +3,7 @@ import { AlertCircle, FileCode2, LoaderCircle, Plus, RefreshCw } from 'lucide-re import { toast } from 'sonner' import { useMountedRef } from '@/hooks/useMountedRef' import type { Repo, Worktree } from '../../../../shared/types' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { canInspectLocalMcpConfigRoot, inspectMcpConfigContent, diff --git a/src/renderer/src/components/settings/manage-sessions-format.ts b/src/renderer/src/components/settings/manage-sessions-format.ts index ee1c4c7a193..f7e50dbbddc 100644 --- a/src/renderer/src/components/settings/manage-sessions-format.ts +++ b/src/renderer/src/components/settings/manage-sessions-format.ts @@ -1,5 +1,5 @@ import type { PtyManagementSession } from '../../../../preload/api-types' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' export function shortCwd(cwd: string): string { if (!cwd) { diff --git a/src/renderer/src/components/settings/repository-icon-github.ts b/src/renderer/src/components/settings/repository-icon-github.ts index b5519e36f36..0a44a88f030 100644 --- a/src/renderer/src/components/settings/repository-icon-github.ts +++ b/src/renderer/src/components/settings/repository-icon-github.ts @@ -1,6 +1,6 @@ import type { GitHubRepositoryIdentity, Repo } from '../../../../shared/types' import { githubAvatarIcon, githubAvatarSlug, type RepoIcon } from '../../../../shared/repo-icon' -import { githubRepoIdentityKey } from '../../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../../shared/github/repository-identity-key' import { callRuntimeRpc, type getActiveRuntimeTarget } from '@/runtime/runtime-rpc-client' type RuntimeTarget = ReturnType diff --git a/src/renderer/src/components/settings/repository-runtime-session-summary.ts b/src/renderer/src/components/settings/repository-runtime-session-summary.ts index 0279683b22b..5dffcd3b1e2 100644 --- a/src/renderer/src/components/settings/repository-runtime-session-summary.ts +++ b/src/renderer/src/components/settings/repository-runtime-session-summary.ts @@ -1,5 +1,5 @@ import type { AppState } from '../../store/types' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' export type ProjectRuntimeSessionSummary = { liveTerminalCount: number diff --git a/src/renderer/src/components/sidebar/PreservedBranchBatchReviewDialog.tsx b/src/renderer/src/components/sidebar/PreservedBranchBatchReviewDialog.tsx index c1340b79327..21b2321c814 100644 --- a/src/renderer/src/components/sidebar/PreservedBranchBatchReviewDialog.tsx +++ b/src/renderer/src/components/sidebar/PreservedBranchBatchReviewDialog.tsx @@ -1,6 +1,6 @@ import { useMemo, useState } from 'react' import { Trash2 } from 'lucide-react' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { translate } from '@/i18n/i18n' import type { PreservedBranchCleanup } from '@/lib/preserved-branch-cleanup' import { useAppStore } from '@/store' diff --git a/src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx b/src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx index fef27ea71cc..4c31d82e153 100644 --- a/src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx +++ b/src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx @@ -9,7 +9,7 @@ import type { Worktree, WorktreeCardProperty } from '../../../../shared/types' -import { COMPACT_WORKTREE_CARD_PROPERTIES } from '../../../../shared/worktree-card-properties' +import { COMPACT_WORKTREE_CARD_PROPERTIES } from '../../../../shared/worktree/card-properties' import type { WorkspacePortScanResult } from '../../../../shared/workspace-ports' const fetchHostedReviewForBranch = vi.fn() diff --git a/src/renderer/src/components/sidebar/WorktreeList.tsx b/src/renderer/src/components/sidebar/WorktreeList.tsx index ff5d8c13923..0202dd41d70 100644 --- a/src/renderer/src/components/sidebar/WorktreeList.tsx +++ b/src/renderer/src/components/sidebar/WorktreeList.tsx @@ -257,7 +257,7 @@ import { isGitRepoKind } from '../../../../shared/repo-kind' import { effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility -} from '../../../../shared/worktree-ownership' +} from '../../../../shared/worktree/ownership' import { RepoIconGlyph } from '@/components/repo/repo-icon' import { RepoForkIndicator } from '@/components/repo/repo-fork-indicator' import ImportedWorktreesVisibilityLine from './ImportedWorktreesVisibilityLine' diff --git a/src/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsx b/src/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsx index 835f68d317e..baa73875d79 100644 --- a/src/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsx +++ b/src/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsx @@ -44,7 +44,7 @@ import { normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences, removeCustomWorktreeSourcePreference -} from '../../../../shared/worktree-visibility-sources' +} from '../../../../shared/worktree/visibility-sources' import HiddenWorktreeRecoveryList from './HiddenWorktreeRecoveryList' import { worktreeVisibilityUpdateError } from './worktree-visibility-update-error' diff --git a/src/renderer/src/components/sidebar/WorktreeVisibilitySourceList.tsx b/src/renderer/src/components/sidebar/WorktreeVisibilitySourceList.tsx index 2ff19c4ff06..f7caa8bdee6 100644 --- a/src/renderer/src/components/sidebar/WorktreeVisibilitySourceList.tsx +++ b/src/renderer/src/components/sidebar/WorktreeVisibilitySourceList.tsx @@ -18,7 +18,7 @@ import { effectiveCustomWorktreeSourceVisibility, normalizeCustomWorktreeVisibilitySources, type WorktreeVisibilitySourceMatch -} from '../../../../shared/worktree-visibility-sources' +} from '../../../../shared/worktree/visibility-sources' import { effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility diff --git a/src/renderer/src/components/sidebar/delete-worktree-failure-toast.tsx b/src/renderer/src/components/sidebar/delete-worktree-failure-toast.tsx index bb9649f28f3..549c36c97a0 100644 --- a/src/renderer/src/components/sidebar/delete-worktree-failure-toast.tsx +++ b/src/renderer/src/components/sidebar/delete-worktree-failure-toast.tsx @@ -5,7 +5,7 @@ import { translate } from '@/i18n/i18n' import { isLockedWorktreeRemovalError, type WorktreeForceDeleteReason -} from '../../../../shared/worktree-removal' +} from '../../../../shared/worktree/removal' type DeleteWorktreeFailureToastOptions = { error: string diff --git a/src/renderer/src/components/sidebar/delete-worktree-toast.test.ts b/src/renderer/src/components/sidebar/delete-worktree-toast.test.ts index acaa7d8f16f..dffedf06337 100644 --- a/src/renderer/src/components/sidebar/delete-worktree-toast.test.ts +++ b/src/renderer/src/components/sidebar/delete-worktree-toast.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { getDeleteWorktreeToastCopy } from './delete-worktree-toast' -import { classifyWorktreeForceDeleteReason } from '../../../../shared/worktree-removal' +import { classifyWorktreeForceDeleteReason } from '../../../../shared/worktree/removal' // Why: production never hands this function a literal reason — the store derives it from // classifyWorktreeForceDeleteReason (store/slices/worktrees.ts). Passing one in would let a diff --git a/src/renderer/src/components/sidebar/delete-worktree-toast.ts b/src/renderer/src/components/sidebar/delete-worktree-toast.ts index fac1c6ee06a..1c013da0da6 100644 --- a/src/renderer/src/components/sidebar/delete-worktree-toast.ts +++ b/src/renderer/src/components/sidebar/delete-worktree-toast.ts @@ -3,7 +3,7 @@ import { isLockedWorktreeRemovalError, isProvenLivePtyRemovalError, type WorktreeForceDeleteReason -} from '../../../../shared/worktree-removal' +} from '../../../../shared/worktree/removal' export type DeleteWorktreeToastCopy = { title: string description?: string diff --git a/src/renderer/src/components/sidebar/imported-worktrees-card-candidates.ts b/src/renderer/src/components/sidebar/imported-worktrees-card-candidates.ts index d701ff20a21..e827d1662ef 100644 --- a/src/renderer/src/components/sidebar/imported-worktrees-card-candidates.ts +++ b/src/renderer/src/components/sidebar/imported-worktrees-card-candidates.ts @@ -4,7 +4,7 @@ import { isGitRepoKind } from '../../../../shared/repo-kind' import { effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility -} from '../../../../shared/worktree-ownership' +} from '../../../../shared/worktree/ownership' import type { ImportedWorktreesCardCandidate } from './worktree-list-groups' export function getHiddenImportedWorktrees( diff --git a/src/renderer/src/components/sidebar/preserved-branch-batch-toast.tsx b/src/renderer/src/components/sidebar/preserved-branch-batch-toast.tsx index d98cd37a438..a5d553da042 100644 --- a/src/renderer/src/components/sidebar/preserved-branch-batch-toast.tsx +++ b/src/renderer/src/components/sidebar/preserved-branch-batch-toast.tsx @@ -3,7 +3,7 @@ import { toast } from 'sonner' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' import { mapWithConcurrency } from '../../../../shared/map-with-concurrency' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { Button } from '../ui/button' import type { PreservedBranchCleanup } from '@/lib/preserved-branch-cleanup' diff --git a/src/renderer/src/components/sidebar/use-worktree-issue-link.ts b/src/renderer/src/components/sidebar/use-worktree-issue-link.ts index 939d71bb10c..bf1e0a1bb31 100644 --- a/src/renderer/src/components/sidebar/use-worktree-issue-link.ts +++ b/src/renderer/src/components/sidebar/use-worktree-issue-link.ts @@ -4,7 +4,7 @@ import { parseGitHubIssueOrPRNumber } from '@/lib/github-links' import { issueCacheKey as getIssueCacheKey } from '@/store/slices/github' import { useMountedRef } from '@/hooks/useMountedRef' import { findIndexedWorktreeOwner } from '@/lib/worktree-runtime-owner-index' -import { buildLinearIssueUrl, parseLinearIssueInput } from '../../../../shared/linear-links' +import { buildLinearIssueUrl, parseLinearIssueInput } from '../../../../shared/linear/links' import type { IssueLinkProvider } from '../../../../shared/issue-link-input' import type { TaskSourceContext } from '../../../../shared/task-source-context' import { parseExplicitGitHubIssueUrl } from './worktree-meta-updates' diff --git a/src/renderer/src/components/sidebar/worktree-meta-updates.ts b/src/renderer/src/components/sidebar/worktree-meta-updates.ts index 944da175d77..20afdf8af26 100644 --- a/src/renderer/src/components/sidebar/worktree-meta-updates.ts +++ b/src/renderer/src/components/sidebar/worktree-meta-updates.ts @@ -2,7 +2,7 @@ import { parseGitHubIssueOrPRLink, parseGitHubIssueOrPRNumber } from '@/lib/gith import { buildLinearIssueLinkUpdates, LINEAR_ISSUE_LINK_CLEARED -} from '../../../../shared/linear-links' +} from '../../../../shared/linear/links' import { parseIssueLinkInput, type IssueLinkProvider } from '../../../../shared/issue-link-input' import type { WorkspaceSourceProvider } from '../../../../shared/new-workspace/workspace-source' import type { WorkspaceLinkedItem, WorktreeMeta } from '../../../../shared/types' diff --git a/src/renderer/src/components/status-bar/WorkspaceSpaceManagerPanel.tsx b/src/renderer/src/components/status-bar/WorkspaceSpaceManagerPanel.tsx index 4353a6fb81a..453e3553792 100644 --- a/src/renderer/src/components/status-bar/WorkspaceSpaceManagerPanel.tsx +++ b/src/renderer/src/components/status-bar/WorkspaceSpaceManagerPanel.tsx @@ -84,7 +84,7 @@ import { type WorkspaceSpaceSortKey } from './workspace-space-presentation' import { translate } from '@/i18n/i18n' -import type { WorktreeForceDeleteReason } from '../../../../shared/worktree-removal' +import type { WorktreeForceDeleteReason } from '../../../../shared/worktree/removal' const TREEMAP_FILLS = [ 'color-mix(in srgb, var(--chart-2) 34%, var(--card))', diff --git a/src/renderer/src/components/status-bar/mergeSnapshotAndSessions.ts b/src/renderer/src/components/status-bar/mergeSnapshotAndSessions.ts index baf9c189fde..672e7c622c2 100644 --- a/src/renderer/src/components/status-bar/mergeSnapshotAndSessions.ts +++ b/src/renderer/src/components/status-bar/mergeSnapshotAndSessions.ts @@ -23,7 +23,7 @@ import { parsePaneKey as parseStablePaneKey } from '../../../../shared/stable-pa import { getRepoIdFromWorktreeId, getWorktreePathBasenameFromId -} from '../../../../shared/worktree-id' +} from '../../../../shared/worktree/id' import type { DaemonSession, MergeContext, diff --git a/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx b/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx index 5e989f9e4a9..776e7939b3e 100644 --- a/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx +++ b/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx @@ -10,7 +10,7 @@ import { getTerminalQuickCommandScope, isTerminalQuickCommandComplete } from '../../../../shared/terminal-quick-commands' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' import { runQuickCommandInNewTab } from '@/lib/run-quick-command-in-new-tab' import type { TerminalQuickCommand } from '../../../../shared/types' diff --git a/src/renderer/src/components/task-page-linear-in-orca-issues.ts b/src/renderer/src/components/task-page-linear-in-orca-issues.ts index 38f1dbe4802..55ae9293b85 100644 --- a/src/renderer/src/components/task-page-linear-in-orca-issues.ts +++ b/src/renderer/src/components/task-page-linear-in-orca-issues.ts @@ -1,5 +1,5 @@ import type { LinearIssue, LinearWorkspace, Worktree } from '../../../shared/types' -import { parseLinearIssueInput } from '../../../shared/linear-links' +import { parseLinearIssueInput } from '../../../shared/linear/links' import { getTaskSourceCacheScope, type TaskSourceContext diff --git a/src/renderer/src/components/task-page-linear-issue-empty-state.test.ts b/src/renderer/src/components/task-page-linear-issue-empty-state.test.ts index 914d24db855..9c04161e722 100644 --- a/src/renderer/src/components/task-page-linear-issue-empty-state.test.ts +++ b/src/renderer/src/components/task-page-linear-issue-empty-state.test.ts @@ -3,7 +3,7 @@ import { resolveLinearIssueEmptyKind, shouldOfferLinearIssueFetchMore } from './task-page-linear-issue-empty-state' -import { emptyLinearIssueAttributeFilter } from '../../../shared/linear-issue-attribute-filter' +import { emptyLinearIssueAttributeFilter } from '../../../shared/linear/issue-attribute-filter' describe('task-page-linear-issue-empty-state', () => { it('prefers context, then search, then server filter, then client team, then unfiltered', () => { diff --git a/src/renderer/src/components/task-page-linear-issue-empty-state.ts b/src/renderer/src/components/task-page-linear-issue-empty-state.ts index a62370a1130..c4c4e4a5fb8 100644 --- a/src/renderer/src/components/task-page-linear-issue-empty-state.ts +++ b/src/renderer/src/components/task-page-linear-issue-empty-state.ts @@ -1,7 +1,7 @@ import { isEmptyLinearIssueAttributeFilter, type LinearIssueAttributeFilter -} from '../../../shared/linear-issue-attribute-filter' +} from '../../../shared/linear/issue-attribute-filter' export type LinearIssueEmptyKind = | 'context' diff --git a/src/renderer/src/components/task-page-linear-issue-request.test.ts b/src/renderer/src/components/task-page-linear-issue-request.test.ts index f2ce103f645..1df1d8bd0ff 100644 --- a/src/renderer/src/components/task-page-linear-issue-request.test.ts +++ b/src/renderer/src/components/task-page-linear-issue-request.test.ts @@ -7,7 +7,7 @@ import { shouldForceLinearIssueListRead, teamDerivedFacetsForPrimaryTeamChange } from './task-page-linear-issue-request' -import type { LinearIssueAttributeFilter } from '../../../shared/linear-issue-attribute-filter' +import type { LinearIssueAttributeFilter } from '../../../shared/linear/issue-attribute-filter' const filter: LinearIssueAttributeFilter = { stateIds: ['s1'], diff --git a/src/renderer/src/components/task-page-linear-issue-request.ts b/src/renderer/src/components/task-page-linear-issue-request.ts index 3e85be2def0..158770d26ef 100644 --- a/src/renderer/src/components/task-page-linear-issue-request.ts +++ b/src/renderer/src/components/task-page-linear-issue-request.ts @@ -2,7 +2,7 @@ import { isEmptyLinearIssueAttributeFilter, linearIssueAttributeFilterSignature, type LinearIssueAttributeFilter -} from '../../../shared/linear-issue-attribute-filter' +} from '../../../shared/linear/issue-attribute-filter' import { getTaskSourceCacheScope, type TaskSourceContext diff --git a/src/renderer/src/components/task-page-localized-options.tsx b/src/renderer/src/components/task-page-localized-options.tsx index 74ef7152e8f..506f27add17 100644 --- a/src/renderer/src/components/task-page-localized-options.tsx +++ b/src/renderer/src/components/task-page-localized-options.tsx @@ -13,7 +13,7 @@ import { type LinearGroupBy, type LinearOrderBy, type LinearViewMode -} from '../../../shared/linear-issue-view-resume-state' +} from '../../../shared/linear/issue-view-resume-state' import { getTaskPresetQuery } from '../../../shared/task-preset-query' import type { TaskProvider, TaskViewPresetId } from '../../../shared/types' @@ -46,7 +46,7 @@ export type { LinearGroupBy, LinearOrderBy, LinearViewMode -} from '../../../shared/linear-issue-view-resume-state' +} from '../../../shared/linear/issue-view-resume-state' export function LinearIcon({ className }: { className?: string }): React.JSX.Element { return ( diff --git a/src/renderer/src/components/terminal-pane/TerminalPane.tsx b/src/renderer/src/components/terminal-pane/TerminalPane.tsx index 2c2dd44cf92..5546390b6db 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPane.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPane.tsx @@ -163,7 +163,7 @@ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { useProjectHostSetupProjection, useRepoById } from '@/store/selectors' import { refitAndRefreshAllTerminalPanes } from '@/lib/pane-manager/pane-manager-registry' import { diff --git a/src/renderer/src/components/terminal-pane/pty-connection.test.ts b/src/renderer/src/components/terminal-pane/pty-connection.test.ts index 90a3341ad6c..6fbe70501f8 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.test.ts @@ -2236,7 +2236,7 @@ describe('connectPanePty', () => { it('swallows a worktree-removal fence error instead of surfacing it', async () => { const { connectPanePty } = await import('./pty-connection') const { TERMINAL_REMOVAL_IN_PROGRESS_MESSAGE } = - await import('../../../../shared/worktree-removal-fence-error') + await import('../../../../shared/worktree/removal-fence-error') const transport = createMockTransport() const capturedOnError: { current: ((message: string) => void) | null } = { current: null } transport.connect.mockImplementation(async ({ callbacks }: { callbacks: ConnectCallbacks }) => { diff --git a/src/renderer/src/components/terminal-pane/pty-connection.ts b/src/renderer/src/components/terminal-pane/pty-connection.ts index b4a683874ee..e2efbb0a9c4 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection.ts @@ -20,7 +20,7 @@ import { TerminalKittyKeyboardModeTracker } from '../../../../shared/terminal-ki import { parseTerminalKittyKeyboardFlags } from '../../../../shared/terminal-kitty-keyboard-flags' import { isRuntimeOwnedSshTargetId, parseExecutionHostId } from '../../../../shared/execution-host' import { createTerminalZeroDimensionsMessage } from '../../../../shared/terminal-zero-dimensions-diagnostic' -import { isWorktreeRemovalFenceError } from '../../../../shared/worktree-removal-fence-error' +import { isWorktreeRemovalFenceError } from '../../../../shared/worktree/removal-fence-error' import { parseTerminalOscColorQuery } from '../../../../shared/terminal-osc-color-reply' import { HIDDEN_STARTUP_RENDERER_QUERY_PENDING_CHARS, diff --git a/src/renderer/src/hooks/remote-workspace-session-merge.ts b/src/renderer/src/hooks/remote-workspace-session-merge.ts index cc9d47ab6e7..0f772ff8794 100644 --- a/src/renderer/src/hooks/remote-workspace-session-merge.ts +++ b/src/renderer/src/hooks/remote-workspace-session-merge.ts @@ -1,6 +1,6 @@ import type { TerminalTab, WorkspaceSessionState } from '../../../shared/types' import { worktreeWorkspaceKey } from '../../../shared/workspace-scope' -import { splitWorktreeId } from '../../../shared/worktree-id' +import { splitWorktreeId } from '../../../shared/worktree/id' import type { AppState } from '../store/types' function preserveNewerLocalTerminalFields(remote: TerminalTab, local: TerminalTab): TerminalTab { diff --git a/src/renderer/src/hooks/useComposerState.ts b/src/renderer/src/hooks/useComposerState.ts index 4ed46768687..aa83700baf2 100644 --- a/src/renderer/src/hooks/useComposerState.ts +++ b/src/renderer/src/hooks/useComposerState.ts @@ -59,7 +59,7 @@ import type { WorkspaceCreateTelemetrySource, ProjectGroup } from '../../../shared/types' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' import { isWorkspaceStatusId } from '../../../shared/workspace-statuses' import { CLIENT_PLATFORM, diff --git a/src/renderer/src/hooks/useGitHubSlugMetadata.ts b/src/renderer/src/hooks/useGitHubSlugMetadata.ts index 3da1c66787d..a268a7bbc93 100644 --- a/src/renderer/src/hooks/useGitHubSlugMetadata.ts +++ b/src/renderer/src/hooks/useGitHubSlugMetadata.ts @@ -3,10 +3,10 @@ import type { GitHubAssignableUser, GlobalSettings } from '../../../shared/types import type { ListAssignableUsersBySlugResult, ListLabelsBySlugResult -} from '../../../shared/github-project-types' +} from '../../../shared/github/project-types' import { clearMetadataRequestStore, createMetadataRequestStore } from './metadata-request-cache' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' -import { githubProjectHost } from '../../../shared/github-project-identity' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' +import { githubProjectHost } from '../../../shared/github/project-identity' import { useMetadataListRequest, type MetadataListState } from './useMetadataListRequest' const slugLabelStore = createMetadataRequestStore() diff --git a/src/renderer/src/lib/ai-vault-resume-target.ts b/src/renderer/src/lib/ai-vault-resume-target.ts index fca20f25cc8..2cab097ca3d 100644 --- a/src/renderer/src/lib/ai-vault-resume-target.ts +++ b/src/renderer/src/lib/ai-vault-resume-target.ts @@ -7,7 +7,7 @@ import { type ExecutionHostId } from '../../../shared/execution-host' import type { Repo } from '../../../shared/types' -import { getRepoIdFromWorktreeId } from '../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../shared/workspace-scope' import { isWslUncPath } from '../../../shared/wsl-paths' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/lib/cmd-j-github-url-lookup.ts b/src/renderer/src/lib/cmd-j-github-url-lookup.ts index bbc7b0e3f10..ba7fcc03d5a 100644 --- a/src/renderer/src/lib/cmd-j-github-url-lookup.ts +++ b/src/renderer/src/lib/cmd-j-github-url-lookup.ts @@ -1,4 +1,4 @@ -import type { GitHubIssueOrPRLink } from '../../../shared/github-links' +import type { GitHubIssueOrPRLink } from '../../../shared/github/links' import type { GitHubWorkItem, Repo } from '../../../shared/types' import type { TaskSourceContext } from '../../../shared/task-source-context' import { lookupGitHubWorkItemByOwnerRepoForSource } from './github-work-item-source-lookup' diff --git a/src/renderer/src/lib/cmd-j-linear-issue-intent.test.ts b/src/renderer/src/lib/cmd-j-linear-issue-intent.test.ts index 124294f5e4f..672f058e25a 100644 --- a/src/renderer/src/lib/cmd-j-linear-issue-intent.test.ts +++ b/src/renderer/src/lib/cmd-j-linear-issue-intent.test.ts @@ -4,7 +4,7 @@ import { findLinearIssueWorkspaceLookupIds, isLinearIssueUrlResolutionMatch, parseLinearIssueUrlIntent -} from '../../../shared/linear-links' +} from '../../../shared/linear/links' describe('Cmd+J Linear issue intent', () => { it('accepts canonical Linear issue URLs with optional slugs', () => { diff --git a/src/renderer/src/lib/connection-owner-resolution.ts b/src/renderer/src/lib/connection-owner-resolution.ts index 3d365621546..91169e939c6 100644 --- a/src/renderer/src/lib/connection-owner-resolution.ts +++ b/src/renderer/src/lib/connection-owner-resolution.ts @@ -1,7 +1,7 @@ import type { AppState } from '@/store/types' import { getIndexedRepoMap, getIndexedWorktreeMap } from '@/store/worktree-repo-index' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' -import { getRepoIdFromWorktreeId } from '../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../shared/workspace-scope' import { isPathInsideOrEqual, diff --git a/src/renderer/src/lib/linear-issue-url-lookup.ts b/src/renderer/src/lib/linear-issue-url-lookup.ts index 03e2a1d56f9..55493d628f7 100644 --- a/src/renderer/src/lib/linear-issue-url-lookup.ts +++ b/src/renderer/src/lib/linear-issue-url-lookup.ts @@ -3,7 +3,7 @@ import { findLinearIssueWorkspaceLookupIds, isLinearIssueUrlResolutionMatch, type LinearIssueUrlIntent -} from '../../../shared/linear-links' +} from '../../../shared/linear/links' import type { LinearConnectionStatus, LinearIssue } from '../../../shared/types' import type { TaskSourceContext } from '../../../shared/task-source-context' diff --git a/src/renderer/src/lib/linear-issue-workspace-attachment.ts b/src/renderer/src/lib/linear-issue-workspace-attachment.ts index afea291b21f..e1904dd02d4 100644 --- a/src/renderer/src/lib/linear-issue-workspace-attachment.ts +++ b/src/renderer/src/lib/linear-issue-workspace-attachment.ts @@ -2,7 +2,7 @@ import type { LinearIssue, Worktree } from '../../../shared/types' import { getLinearOrganizationUrlKeyFromIssueUrl, parseLinearIssueInput -} from '../../../shared/linear-links' +} from '../../../shared/linear/links' import { getWorktreeAttachmentLabel } from './worktree-attachment-label' export type LinearIssueAttachmentRef = Pick & diff --git a/src/renderer/src/lib/repo-slug-cache.test.ts b/src/renderer/src/lib/repo-slug-cache.test.ts index d9de7ae3e7b..491afbc22b9 100644 --- a/src/renderer/src/lib/repo-slug-cache.test.ts +++ b/src/renderer/src/lib/repo-slug-cache.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it } from 'vitest' import type { Repo } from '../../../shared/types' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' import { REPO_SLUG_FAILURE_TTL_MS, clearRepoSlugCacheValues, diff --git a/src/renderer/src/lib/repo-slug-cache.ts b/src/renderer/src/lib/repo-slug-cache.ts index cb6552aa572..9c2a455f574 100644 --- a/src/renderer/src/lib/repo-slug-cache.ts +++ b/src/renderer/src/lib/repo-slug-cache.ts @@ -7,7 +7,7 @@ import { getSettingsForRepoRuntimeOwner } from './repo-runtime-owner' import { githubHostFromIdentityKey, githubRepoIdentityKey -} from '../../../shared/github-repository-identity-key' +} from '../../../shared/github/repository-identity-key' /** Lowercased `owner/repo` → Repo[]. */ export type SlugIndex = Map diff --git a/src/renderer/src/lib/repo-slug-index.ts b/src/renderer/src/lib/repo-slug-index.ts index 442a29d6d62..07d6896cb08 100644 --- a/src/renderer/src/lib/repo-slug-index.ts +++ b/src/renderer/src/lib/repo-slug-index.ts @@ -29,7 +29,7 @@ import { type RepoSlugMatches, type SlugIndex } from './repo-slug-cache' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' export { lookupReposBySlugFromCache } from './repo-slug-cache' diff --git a/src/renderer/src/lib/smart-github-submit.ts b/src/renderer/src/lib/smart-github-submit.ts index 131e532f543..9d500d98eb9 100644 --- a/src/renderer/src/lib/smart-github-submit.ts +++ b/src/renderer/src/lib/smart-github-submit.ts @@ -5,7 +5,7 @@ import { getLinkedWorkItemWorkspaceName } from '../../../shared/workspace-name' import type { LinkedWorkItemSummary } from './new-workspace' import { parseGitHubIssueOrPRLink } from './github-links' import { resolveGitHubWorkItemIdentity } from '@/lib/github-work-item-identity' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' export type SmartGitHubSubmitIntent = | { diff --git a/src/renderer/src/lib/workspace-session-host-persistence.ts b/src/renderer/src/lib/workspace-session-host-persistence.ts index 445ef2917e4..47a93b4d577 100644 --- a/src/renderer/src/lib/workspace-session-host-persistence.ts +++ b/src/renderer/src/lib/workspace-session-host-persistence.ts @@ -6,7 +6,7 @@ import { type ExecutionHostId } from '../../../shared/execution-host' import { parseWorkspaceKey } from '../../../shared/workspace-scope' -import { getRepoIdFromWorktreeId } from '../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' import { mergeWorkspaceSessionsFromHosts, splitWorkspaceSessionByHost, diff --git a/src/renderer/src/lib/workspace-session-hydration-keys.ts b/src/renderer/src/lib/workspace-session-hydration-keys.ts index 1166d8702a1..d4339e30cb6 100644 --- a/src/renderer/src/lib/workspace-session-hydration-keys.ts +++ b/src/renderer/src/lib/workspace-session-hydration-keys.ts @@ -2,7 +2,7 @@ import type { ExecutionHostId } from '../../../shared/execution-host' import { parseExecutionHostId } from '../../../shared/execution-host' import type { WorkspaceKey, WorkspaceSessionState } from '../../../shared/types' import { parseWorkspaceKey } from '../../../shared/workspace-scope' -import { getRepoIdFromWorktreeId } from '../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' export type WorkspaceSessionHydrationOptions = { additionalValidWorkspaceKeys?: readonly WorkspaceKey[] diff --git a/src/renderer/src/lib/worktree-palette-task-url-match.ts b/src/renderer/src/lib/worktree-palette-task-url-match.ts index 3676b7edacb..d16d135dcb1 100644 --- a/src/renderer/src/lib/worktree-palette-task-url-match.ts +++ b/src/renderer/src/lib/worktree-palette-task-url-match.ts @@ -9,11 +9,11 @@ import { parseGitHubIssueOrPRLink, type GitHubIssueOrPRLink, type RepoSlug -} from '../../../shared/github-links' -import { githubRepoIdentityKey } from '../../../shared/github-repository-identity-key' +} from '../../../shared/github/links' +import { githubRepoIdentityKey } from '../../../shared/github/repository-identity-key' import { parseGitLabIssueOrMRLink } from '../../../shared/new-workspace/gitlab-links' import { parseJiraIssueUrl, type ParsedJiraIssueUrl } from '../../../shared/jira-issue-url' -import { parseLinearIssueUrlIntent, type LinearIssueUrlIntent } from '../../../shared/linear-links' +import { parseLinearIssueUrlIntent, type LinearIssueUrlIntent } from '../../../shared/linear/links' import type { Repo, Worktree } from '../../../shared/types' import { normalizeLinearIdentifier } from './linear-issue-workspace-attachment' import { diff --git a/src/renderer/src/runtime/github-check-details-timeout.ts b/src/renderer/src/runtime/github-check-details-timeout.ts index 1ccaca60d6f..014c0ff43fa 100644 --- a/src/renderer/src/runtime/github-check-details-timeout.ts +++ b/src/renderer/src/runtime/github-check-details-timeout.ts @@ -2,7 +2,7 @@ import { translate } from '@/i18n/i18n' import { GITHUB_CHECK_DETAILS_TIMEOUT_MESSAGE, isGitHubCheckDetailsTimeout -} from '../../../shared/github-check-details-deadline' +} from '../../../shared/github/check-details-deadline' export const GITHUB_CHECK_DETAILS_TIMEOUT_MS = 30_000 diff --git a/src/renderer/src/runtime/runtime-git-client.ts b/src/renderer/src/runtime/runtime-git-client.ts index 48e608daf4a..ae5d2d2156d 100644 --- a/src/renderer/src/runtime/runtime-git-client.ts +++ b/src/renderer/src/runtime/runtime-git-client.ts @@ -22,7 +22,7 @@ import type { HostedReviewProvider } from '../../../shared/hosted-review' import type { ResolvedSourceControlAiGenerationParams } from '../../../shared/source-control-ai' import { getCommitMessageModelDiscoveryHostKeyForScope } from '../../../shared/commit-message-host-key' import type { GitHistoryOptions, GitHistoryResult } from '../../../shared/git-history' -import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem } from '../../../shared/worktree-id' +import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem } from '../../../shared/worktree/id' import { callRuntimeRpc, getActiveRuntimeTarget } from './runtime-rpc-client' import { toRuntimeWorktreeSelector } from './runtime-worktree-selector' diff --git a/src/renderer/src/runtime/runtime-linear-client.ts b/src/renderer/src/runtime/runtime-linear-client.ts index 4bf5d5797e2..94d6be6197c 100644 --- a/src/renderer/src/runtime/runtime-linear-client.ts +++ b/src/renderer/src/runtime/runtime-linear-client.ts @@ -29,11 +29,11 @@ import { type TaskSourceContext } from '../../../shared/task-source-context' import { isRuntimeProviderSearchQueryWithinLimit } from './runtime-provider-search-bounds' -import type { LinearIssueAttributeFilter } from '../../../shared/linear-issue-attribute-filter' +import type { LinearIssueAttributeFilter } from '../../../shared/linear/issue-attribute-filter' import { canonicalizeLinearIssueAttributeFilter, isEmptyLinearIssueAttributeFilter -} from '../../../shared/linear-issue-attribute-filter' +} from '../../../shared/linear/issue-attribute-filter' import { LINEAR_ISSUE_ATTRIBUTE_FILTER_RUNTIME_CAPABILITY } from '../../../shared/protocol-version' export type RuntimeLinearSettings = diff --git a/src/renderer/src/store/slices/degraded-repo-worktree-validity.ts b/src/renderer/src/store/slices/degraded-repo-worktree-validity.ts index 1a9693bdf5f..139312608b2 100644 --- a/src/renderer/src/store/slices/degraded-repo-worktree-validity.ts +++ b/src/renderer/src/store/slices/degraded-repo-worktree-validity.ts @@ -5,7 +5,7 @@ import type { Worktree } from '../../../../shared/types' import { parseWorkspaceKey } from '../../../../shared/workspace-scope' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' type WorktreeValidityCatalog = { repos: readonly Pick[] diff --git a/src/renderer/src/store/slices/github-checks.ts b/src/renderer/src/store/slices/github-checks.ts index 46bf368d757..da36a378ddf 100644 --- a/src/renderer/src/store/slices/github-checks.ts +++ b/src/renderer/src/store/slices/github-checks.ts @@ -1,7 +1,7 @@ import type { AppState } from '../types' import type { PRCheckDetail, GitHubOwnerRepo } from '../../../../shared/types' import { getGitHubPRCacheKey } from './github-cache-key' -import { githubRepoIdentityKey } from '../../../../shared/github-repository-identity-key' +import { githubRepoIdentityKey } from '../../../../shared/github/repository-identity-key' import { derivePRCheckStatus } from '../../../../shared/pr-check-status' export function normalizeBranchName(branch: string): string { diff --git a/src/renderer/src/store/slices/github-work-items-query-bounds.ts b/src/renderer/src/store/slices/github-work-items-query-bounds.ts index 0ac2107a8a2..4cd04801973 100644 --- a/src/renderer/src/store/slices/github-work-items-query-bounds.ts +++ b/src/renderer/src/store/slices/github-work-items-query-bounds.ts @@ -2,4 +2,4 @@ export { GITHUB_SEARCH_RESULT_WINDOW_ERROR_PATTERN, GITHUB_WORK_ITEMS_QUERY_MAX_BYTES, isGitHubWorkItemsQueryTooLarge -} from '../../../../shared/github-work-items-query-bounds' +} from '../../../../shared/github/work-items-query-bounds' diff --git a/src/renderer/src/store/slices/github.ts b/src/renderer/src/store/slices/github.ts index 24501bc23e9..6134198b1c1 100644 --- a/src/renderer/src/store/slices/github.ts +++ b/src/renderer/src/store/slices/github.ts @@ -2,8 +2,8 @@ import type { StateCreator } from 'zustand' import { toast } from 'sonner' import type { AppState } from '../types' -import { githubRepoIdentityKey } from '../../../../shared/github-repository-identity-key' -import { githubProjectIdentityKey } from '../../../../shared/github-project-identity' +import { githubRepoIdentityKey } from '../../../../shared/github/repository-identity-key' +import { githubProjectIdentityKey } from '../../../../shared/github/project-identity' import type { ClassifiedError, GitHubOwnerRepo, @@ -36,7 +36,7 @@ import type { GitHubProjectRow, GitHubProjectTable, GitHubProjectViewError -} from '../../../../shared/github-project-types' +} from '../../../../shared/github/project-types' import { isGitHubWorkItemsSshRemoteRequiredError, sortWorkItemsByNumber, @@ -58,7 +58,7 @@ import { GITHUB_SEARCH_RESULT_WINDOW_ERROR_PATTERN, isGitHubWorkItemsQueryTooLarge } from './github-work-items-query-bounds' -import { classifyGitHubUnavailable } from '../../../../shared/github-api-availability' +import { classifyGitHubUnavailable } from '../../../../shared/github/api-availability' import { isMacAppDataPath } from '@/lib/passive-macos-app-data-access' import { translate } from '@/i18n/i18n' import { @@ -74,7 +74,7 @@ import { getTaskSourceRuntimeSettings, type TaskSourceContext } from '../../../../shared/task-source-context' -import { normalizeGitHubPRForBranchOutcome } from '../../../../shared/github-pr-for-branch-outcome' +import { normalizeGitHubPRForBranchOutcome } from '../../../../shared/github/pull-request-for-branch-outcome' import { restoreReactionOnSubject, setReactionOnSubject } from '@/lib/pr-comment-reactions' import { withGitHubCheckDetailsTimeout } from '@/runtime/github-check-details-timeout' import { getGitHubRepoLookupIndex } from './github-repo-lookup-index' @@ -2787,9 +2787,7 @@ export const createGitHubSlice: StateCreator = (s ...(errorForCache ? { error: - errorUnchanged && previousError !== undefined - ? previousError - : errorForCache + errorUnchanged && previousError !== undefined ? previousError : errorForCache } : {}), ...(nextFellBack ? { issueSourceFellBack: true } : {}) diff --git a/src/renderer/src/store/slices/linear.ts b/src/renderer/src/store/slices/linear.ts index 63991d49148..614020debd5 100644 --- a/src/renderer/src/store/slices/linear.ts +++ b/src/renderer/src/store/slices/linear.ts @@ -18,7 +18,7 @@ import type { LinearWorkspaceSelection } from '../../../../shared/types' import type { CacheEntry } from './github' -import { clampLinearIssueListLimit } from '../../../../shared/linear-issue-read-limits' +import { clampLinearIssueListLimit } from '../../../../shared/linear/issue-read-limits' import { isIntegrationCredentialDecryptionError } from '../../../../shared/integration-credential-errors' import { clearLinearMetadataCache } from '../../hooks/useIssueMetadata' import { @@ -53,7 +53,7 @@ import { isEmptyLinearIssueAttributeFilter, linearIssueAttributeFilterSignature, type LinearIssueAttributeFilter -} from '../../../../shared/linear-issue-attribute-filter' +} from '../../../../shared/linear/issue-attribute-filter' const CACHE_TTL = 60_000 // 60s — same as GitHub work-items revalidation TTL const TEAM_CACHE_TTL = 10 * 60_000 // Teams change rarely and block visible Linear rows. diff --git a/src/renderer/src/store/slices/repos.ts b/src/renderer/src/store/slices/repos.ts index 51df18322ba..059baa6dde5 100644 --- a/src/renderer/src/store/slices/repos.ts +++ b/src/renderer/src/store/slices/repos.ts @@ -47,7 +47,7 @@ import { normalizeRepoBadgeColor } from '../../../../shared/repo-badge-color' import { applyManualRepoOrder, getManualRepoOrder } from '../../../../shared/manual-repo-order' import { getProjectGroupSubtreeIds } from '../../../../shared/project-groups' import { isPathInsideOrEqual } from '../../../../shared/cross-platform-path' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { selectProjectGroupRemovalTargets } from './project-group-removal-targets' import { areValuesEqual, @@ -97,7 +97,7 @@ import { isRemovedRuntimeHostId } from './stale-runtime-host-rows' import { normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences -} from '../../../../shared/worktree-visibility-sources' +} from '../../../../shared/worktree/visibility-sources' import { cleanupEphemeralVmRuntimesForDeleted } from '@/lib/ephemeral-vm-runtime-cleanup' import { folderWorkspaceKey, parseWorkspaceKey } from '../../../../shared/workspace-scope' import { formatFolderWorkspaceCreateError } from '../../lib/folder-workspace-path-status' diff --git a/src/renderer/src/store/slices/terminals.ts b/src/renderer/src/store/slices/terminals.ts index c644b6db241..9b65267f895 100644 --- a/src/renderer/src/store/slices/terminals.ts +++ b/src/renderer/src/store/slices/terminals.ts @@ -42,7 +42,7 @@ import { isSameCodexRestartNoticeAccount } from './codex-restart-notice-account- import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem -} from '../../../../shared/worktree-id' +} from '../../../../shared/worktree/id' import { isWslUncPath } from '../../../../shared/wsl-paths' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/project-execution-runtime' import type { StartupCommandDelivery } from '../../../../shared/codex-startup-delivery' diff --git a/src/renderer/src/store/slices/worktree-helpers.ts b/src/renderer/src/store/slices/worktree-helpers.ts index 688561865b0..45c64ed8b4c 100644 --- a/src/renderer/src/store/slices/worktree-helpers.ts +++ b/src/renderer/src/store/slices/worktree-helpers.ts @@ -22,7 +22,7 @@ import type { WorkspaceKey } from '../../../../shared/types' import type { TaskSourceContext } from '../../../../shared/task-source-context' -import type { WorktreeForceDeleteReason } from '../../../../shared/worktree-removal' +import type { WorktreeForceDeleteReason } from '../../../../shared/worktree/removal' import type { TerminalGitHubPRLink } from '../../../../shared/terminal-github-pr-link-detector' import type { ExecutionHostId } from '../../../../shared/execution-host' import type { @@ -34,9 +34,9 @@ import type { PendingWorktreeCreation, WorktreeCreationPhase } from '@/lib/pending-worktree-creation' -import { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import type { AppState } from '../types' -export { getRepoIdFromWorktreeId } from '../../../../shared/worktree-id' +export { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' export type WorktreeDeleteState = { isDeleting: boolean diff --git a/src/renderer/src/store/slices/worktrees.ts b/src/renderer/src/store/slices/worktrees.ts index 85f85307b2b..497e8d3be6b 100644 --- a/src/renderer/src/store/slices/worktrees.ts +++ b/src/renderer/src/store/slices/worktrees.ts @@ -28,7 +28,7 @@ import { type WorktreeSlice } from './worktree-helpers' import { projectWorktreeTabModelReconciliation } from './tabs' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' import { remapClosedTerminalTabSnapshotCwds, type ClosedTerminalTabSnapshot @@ -113,7 +113,7 @@ import { classifyWorktreeForceDeleteReason, getLockedWorktreeRemovalReason, isLockedWorktreeRemovalError -} from '../../../../shared/worktree-removal' +} from '../../../../shared/worktree/removal' import { FolderWorkspaceActivityPersistence } from './folder-workspace-activity-persistence' import { createDetectedWorktreeRefreshLeaseRegistry, diff --git a/src/shared/agent-scratch-worktrees.ts b/src/shared/agent-scratch-worktrees.ts index c9add6692b9..d7dbf0dce99 100644 --- a/src/shared/agent-scratch-worktrees.ts +++ b/src/shared/agent-scratch-worktrees.ts @@ -2,7 +2,7 @@ import { normalizeRuntimePathForComparison } from './cross-platform-path' import { createWorktreeVisibilitySourceMatcher, type WorktreeVisibilitySourceMatcher -} from './worktree-visibility-sources' +} from './worktree/visibility-sources' /** Why: agent CLIs reserve these repo-root paths for scratch; broader matches * can hide legitimate user worktrees (#9388). */ diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 07f487b9f8a..b0cf4abffca 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -17,7 +17,7 @@ import { getDefaultTerminalQuickCommands } from './terminal-quick-commands' import type { VoiceSettings } from './speech-types' import { cloneDefaultWorkspaceStatuses } from './workspace-statuses' import { TASK_PROVIDERS } from './task-providers' -import { DEFAULT_WORKTREE_CARD_PROPERTIES } from './worktree-card-properties' +import { DEFAULT_WORKTREE_CARD_PROPERTIES } from './worktree/card-properties' import { getDefaultSourceControlAiSettings } from './source-control-ai' import { DEFAULT_APP_ICON_ID } from './app-icon' import { DEFAULT_OPEN_IN_APPLICATIONS } from './open-in-applications' @@ -44,7 +44,7 @@ export { getWorktreeCardModeUpdates, isDefaultedCompactWorktreeCardProperties, normalizeWorktreeCardProperties -} from './worktree-card-properties' +} from './worktree/card-properties' export const SCHEMA_VERSION = 1 export const DEFAULT_APP_FONT_FAMILY = 'Geist' diff --git a/src/shared/external-worktree-inbox.test.ts b/src/shared/external-worktree-inbox.test.ts index b9a72f62f8c..2c29fe4a117 100644 --- a/src/shared/external-worktree-inbox.test.ts +++ b/src/shared/external-worktree-inbox.test.ts @@ -20,7 +20,7 @@ import { buildKnownOrcaWorkspaceLayouts, EXTERNAL_WORKTREE_VISIBILITY_ROLLOUT_AT, toDetectedWorktree -} from './worktree-ownership' +} from './worktree/ownership' const repo: Repo = { id: 'repo-1', diff --git a/src/shared/folder-workspace-types.ts b/src/shared/folder-workspace-types.ts index 0730afa2140..81e8dcf9f98 100644 --- a/src/shared/folder-workspace-types.ts +++ b/src/shared/folder-workspace-types.ts @@ -6,7 +6,7 @@ import type { WorkspaceCreatorProvenance, WorkspaceLinkedItem, WorkspaceStatus -} from './worktree-types' +} from './worktree/types' export type WorkspaceScope = | { type: 'worktree'; worktreeId: string } diff --git a/src/shared/github-api-availability.test.ts b/src/shared/github/api-availability.test.ts similarity index 98% rename from src/shared/github-api-availability.test.ts rename to src/shared/github/api-availability.test.ts index 6e0ec633ef4..aec7abd4422 100644 --- a/src/shared/github-api-availability.test.ts +++ b/src/shared/github/api-availability.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { classifyGitHubUnavailable, isGitHubUnavailableError } from './github-api-availability' +import { classifyGitHubUnavailable, isGitHubUnavailableError } from './api-availability' describe('classifyGitHubUnavailable', () => { it('classifies HTTP 5xx outages as server_error', () => { diff --git a/src/shared/github-api-availability.ts b/src/shared/github/api-availability.ts similarity index 100% rename from src/shared/github-api-availability.ts rename to src/shared/github/api-availability.ts diff --git a/src/shared/github-auth-types.ts b/src/shared/github/auth-types.ts similarity index 100% rename from src/shared/github-auth-types.ts rename to src/shared/github/auth-types.ts diff --git a/src/shared/github-check-details-deadline.ts b/src/shared/github/check-details-deadline.ts similarity index 100% rename from src/shared/github-check-details-deadline.ts rename to src/shared/github/check-details-deadline.ts diff --git a/src/shared/github-check-types.ts b/src/shared/github/check-types.ts similarity index 100% rename from src/shared/github-check-types.ts rename to src/shared/github/check-types.ts diff --git a/src/shared/github-comment-types.ts b/src/shared/github/comment-types.ts similarity index 97% rename from src/shared/github-comment-types.ts rename to src/shared/github/comment-types.ts index 0fc48af62c2..6f529ded0ef 100644 --- a/src/shared/github-comment-types.ts +++ b/src/shared/github/comment-types.ts @@ -1,4 +1,4 @@ -import type { GitHubRepositoryIdentity } from './github-pr-types' +import type { GitHubRepositoryIdentity } from './pull-request-types' export type GitHubReactionContent = | '+1' diff --git a/src/shared/github-links.ts b/src/shared/github/links.ts similarity index 100% rename from src/shared/github-links.ts rename to src/shared/github/links.ts diff --git a/src/shared/github-project-group-sort.ts b/src/shared/github/project-group-sort.ts similarity index 99% rename from src/shared/github-project-group-sort.ts rename to src/shared/github/project-group-sort.ts index 923b8aacf49..707fbfb35e4 100644 --- a/src/shared/github-project-group-sort.ts +++ b/src/shared/github/project-group-sort.ts @@ -6,7 +6,7 @@ import type { GitHubProjectRow, GitHubProjectSort, GitHubProjectTable -} from './github-project-types' +} from './project-types' export type ProjectGroup = { /** Stable key used for React reconciliation. */ diff --git a/src/shared/github-project-identity.test.ts b/src/shared/github/project-identity.test.ts similarity index 90% rename from src/shared/github-project-identity.test.ts rename to src/shared/github/project-identity.test.ts index 40c96a316dd..cc340c2be65 100644 --- a/src/shared/github-project-identity.test.ts +++ b/src/shared/github/project-identity.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { githubProjectHost, githubProjectIdentityKey } from './github-project-identity' +import { githubProjectHost, githubProjectIdentityKey } from './project-identity' describe('GitHub project identity', () => { it('keeps legacy github.com keys while isolating Enterprise hosts and ports', () => { diff --git a/src/shared/github-project-identity.ts b/src/shared/github/project-identity.ts similarity index 92% rename from src/shared/github-project-identity.ts rename to src/shared/github/project-identity.ts index dbe7c478504..5de8dcf5517 100644 --- a/src/shared/github-project-identity.ts +++ b/src/shared/github/project-identity.ts @@ -1,4 +1,4 @@ -import { isDefaultGitHubHost } from './github-repository-identity-key' +import { isDefaultGitHubHost } from './repository-identity-key' export type GitHubProjectIdentity = { owner: string diff --git a/src/shared/github-project-ref-input.test.ts b/src/shared/github/project-ref-input.test.ts similarity index 97% rename from src/shared/github-project-ref-input.test.ts rename to src/shared/github/project-ref-input.test.ts index cd0ece5f5e8..08f71c3e44a 100644 --- a/src/shared/github-project-ref-input.test.ts +++ b/src/shared/github/project-ref-input.test.ts @@ -5,7 +5,7 @@ import { getGitHubProjectRefInputByteLength, hasBoundedGitHubProjectRefInputText, isGitHubProjectRefInputTooLarge -} from './github-project-ref-input' +} from './project-ref-input' describe('GitHub project reference input limits', () => { it('allows normal project references below the byte budget', () => { diff --git a/src/shared/github-project-ref-input.ts b/src/shared/github/project-ref-input.ts similarity index 95% rename from src/shared/github-project-ref-input.ts rename to src/shared/github/project-ref-input.ts index 5b0ee6c8d7e..8295617a0d1 100644 --- a/src/shared/github-project-ref-input.ts +++ b/src/shared/github/project-ref-input.ts @@ -1,4 +1,4 @@ -import { getClipboardTextByteLength, isClipboardTextByteLengthOverLimit } from './clipboard-text' +import { getClipboardTextByteLength, isClipboardTextByteLengthOverLimit } from '../clipboard-text' export const GITHUB_PROJECT_REF_INPUT_MAX_BYTES = 2 * 1024 export const GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR = 'Project reference is too large to resolve.' diff --git a/src/shared/github-project-types.ts b/src/shared/github/project-types.ts similarity index 99% rename from src/shared/github-project-types.ts rename to src/shared/github/project-types.ts index 9175c4b27b1..6560e410474 100644 --- a/src/shared/github-project-types.ts +++ b/src/shared/github/project-types.ts @@ -9,7 +9,7 @@ import type { GitHubIssueUpdate, GitHubWorkItemDetails, PRComment -} from './types' +} from '../types' export type GitHubProjectViewLayout = 'TABLE_LAYOUT' | 'BOARD_LAYOUT' | 'ROADMAP_LAYOUT' export type GitHubProjectOwnerType = 'organization' | 'user' diff --git a/src/shared/github-pr-auto-merge-availability.test.ts b/src/shared/github/pull-request-auto-merge-availability.test.ts similarity index 98% rename from src/shared/github-pr-auto-merge-availability.test.ts rename to src/shared/github/pull-request-auto-merge-availability.test.ts index 2e22a3bd3f2..8cfe706476e 100644 --- a/src/shared/github-pr-auto-merge-availability.test.ts +++ b/src/shared/github/pull-request-auto-merge-availability.test.ts @@ -3,7 +3,7 @@ import { canEnableGitHubPRAutoMerge, canShowGitHubPRAutoMergeControl, type GitHubPRAutoMergeAvailabilityInput -} from './github-pr-auto-merge-availability' +} from './pull-request-auto-merge-availability' function pr( overrides: Partial = {} diff --git a/src/shared/github-pr-auto-merge-availability.ts b/src/shared/github/pull-request-auto-merge-availability.ts similarity index 99% rename from src/shared/github-pr-auto-merge-availability.ts rename to src/shared/github/pull-request-auto-merge-availability.ts index 67b6e25ad72..90500d1618e 100644 --- a/src/shared/github-pr-auto-merge-availability.ts +++ b/src/shared/github/pull-request-auto-merge-availability.ts @@ -1,4 +1,4 @@ -import type { PRMergeableState, PRReviewDecision, PRState } from './types' +import type { PRMergeableState, PRReviewDecision, PRState } from '../types' export type GitHubPRAutoMergeAvailabilityInput = { state: PRState | 'open' | 'closed' | 'merged' | 'draft' diff --git a/src/shared/github-pr-for-branch-outcome.test.ts b/src/shared/github/pull-request-for-branch-outcome.test.ts similarity index 88% rename from src/shared/github-pr-for-branch-outcome.test.ts rename to src/shared/github/pull-request-for-branch-outcome.test.ts index 3eaec4a99c7..2eff1b7ae33 100644 --- a/src/shared/github-pr-for-branch-outcome.test.ts +++ b/src/shared/github/pull-request-for-branch-outcome.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import type { PRInfo, PRRefreshOutcome } from './types' -import { normalizeGitHubPRForBranchOutcome } from './github-pr-for-branch-outcome' +import type { PRInfo, PRRefreshOutcome } from '../types' +import { normalizeGitHubPRForBranchOutcome } from './pull-request-for-branch-outcome' const PR = { number: 42, diff --git a/src/shared/github-pr-for-branch-outcome.ts b/src/shared/github/pull-request-for-branch-outcome.ts similarity index 89% rename from src/shared/github-pr-for-branch-outcome.ts rename to src/shared/github/pull-request-for-branch-outcome.ts index 90b5661f884..b6cdc180609 100644 --- a/src/shared/github-pr-for-branch-outcome.ts +++ b/src/shared/github/pull-request-for-branch-outcome.ts @@ -1,4 +1,4 @@ -import type { PRInfo, PRRefreshOutcome } from './types' +import type { PRInfo, PRRefreshOutcome } from '../types' export type GitHubPRForBranchResponse = PRRefreshOutcome | PRInfo | null diff --git a/src/shared/github-pr-merge-methods.test.ts b/src/shared/github/pull-request-merge-methods.test.ts similarity index 97% rename from src/shared/github-pr-merge-methods.test.ts rename to src/shared/github/pull-request-merge-methods.test.ts index f4705d6b00f..550bb00b0a5 100644 --- a/src/shared/github-pr-merge-methods.test.ts +++ b/src/shared/github/pull-request-merge-methods.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest' import { normalizeGitHubPRMergeMethodSettings, resolveGitHubPRMergeMethods -} from './github-pr-merge-methods' +} from './pull-request-merge-methods' describe('GitHub PR merge methods', () => { it('keeps the historical squash-first fallback when repository metadata is missing', () => { diff --git a/src/shared/github-pr-merge-methods.ts b/src/shared/github/pull-request-merge-methods.ts similarity index 99% rename from src/shared/github-pr-merge-methods.ts rename to src/shared/github/pull-request-merge-methods.ts index a9372b461f6..2072706a41b 100644 --- a/src/shared/github-pr-merge-methods.ts +++ b/src/shared/github/pull-request-merge-methods.ts @@ -1,4 +1,4 @@ -import type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from './types' +import type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from '../types' export const GITHUB_PR_MERGE_METHODS = ['squash', 'merge', 'rebase'] as const diff --git a/src/shared/github-pr-refresh-types.ts b/src/shared/github/pull-request-refresh-types.ts similarity index 98% rename from src/shared/github-pr-refresh-types.ts rename to src/shared/github/pull-request-refresh-types.ts index 35fdd0f27d7..261773b327f 100644 --- a/src/shared/github-pr-refresh-types.ts +++ b/src/shared/github/pull-request-refresh-types.ts @@ -1,5 +1,5 @@ -import type { RepoKind } from './repo-types' -import type { CheckStatus, PRInfo, PRMergeableState, PRState } from './github-pr-types' +import type { RepoKind } from '../repo-types' +import type { CheckStatus, PRInfo, PRMergeableState, PRState } from './pull-request-types' /** * Discriminates a classified GitHub PR-refresh failure. The renderer maps these diff --git a/src/shared/github-pr-types.ts b/src/shared/github/pull-request-types.ts similarity index 100% rename from src/shared/github-pr-types.ts rename to src/shared/github/pull-request-types.ts diff --git a/src/shared/github-rate-limit-types.ts b/src/shared/github/rate-limit-types.ts similarity index 100% rename from src/shared/github-rate-limit-types.ts rename to src/shared/github/rate-limit-types.ts diff --git a/src/shared/github-repository-identity-key.test.ts b/src/shared/github/repository-identity-key.test.ts similarity index 84% rename from src/shared/github-repository-identity-key.test.ts rename to src/shared/github/repository-identity-key.test.ts index ef51d276889..9e2726ffb89 100644 --- a/src/shared/github-repository-identity-key.test.ts +++ b/src/shared/github/repository-identity-key.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { githubRepoIdentityKey, isDefaultGitHubHost } from './github-repository-identity-key' +import { githubRepoIdentityKey, isDefaultGitHubHost } from './repository-identity-key' describe('GitHub repository identity', () => { it('normalizes case and harmless surrounding whitespace without merging GHES hosts', () => { diff --git a/src/shared/github-repository-identity-key.ts b/src/shared/github/repository-identity-key.ts similarity index 100% rename from src/shared/github-repository-identity-key.ts rename to src/shared/github/repository-identity-key.ts diff --git a/src/shared/github-work-item-types.ts b/src/shared/github/work-item-types.ts similarity index 96% rename from src/shared/github-work-item-types.ts rename to src/shared/github/work-item-types.ts index 6b9cec763e0..437a1af20f0 100644 --- a/src/shared/github-work-item-types.ts +++ b/src/shared/github/work-item-types.ts @@ -1,6 +1,6 @@ -import type { ClassifiedError } from './classified-error' -import type { PRCheckDetail } from './github-check-types' -import type { GitHubIssueTimelineItem, PRComment } from './github-comment-types' +import type { ClassifiedError } from '../classified-error' +import type { PRCheckDetail } from './check-types' +import type { GitHubIssueTimelineItem, PRComment } from './comment-types' import type { GitHubAssignableUser, GitHubOwnerRepo, @@ -11,7 +11,7 @@ import type { PRMergeableState, PRReviewDecision, ProviderCheckSummary -} from './github-pr-types' +} from './pull-request-types' export type GitHubWorkItem = { id: string diff --git a/src/shared/github-work-items-query-bounds.test.ts b/src/shared/github/work-items-query-bounds.test.ts similarity index 95% rename from src/shared/github-work-items-query-bounds.test.ts rename to src/shared/github/work-items-query-bounds.test.ts index 54839d873c7..9b8bea74b4e 100644 --- a/src/shared/github-work-items-query-bounds.test.ts +++ b/src/shared/github/work-items-query-bounds.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest' import { GITHUB_WORK_ITEMS_QUERY_MAX_BYTES, isGitHubWorkItemsQueryTooLarge -} from './github-work-items-query-bounds' +} from './work-items-query-bounds' describe('shared GitHub work item query bounds', () => { it('allows normal GitHub search syntax', () => { diff --git a/src/shared/github-work-items-query-bounds.ts b/src/shared/github/work-items-query-bounds.ts similarity index 87% rename from src/shared/github-work-items-query-bounds.ts rename to src/shared/github/work-items-query-bounds.ts index 85616688a47..be09c66e624 100644 --- a/src/shared/github-work-items-query-bounds.ts +++ b/src/shared/github/work-items-query-bounds.ts @@ -1,4 +1,4 @@ -import { isClipboardTextByteLengthOverLimit } from './clipboard-text' +import { isClipboardTextByteLengthOverLimit } from '../clipboard-text' export const GITHUB_WORK_ITEMS_QUERY_MAX_BYTES = 8 * 1024 diff --git a/src/shared/global-settings-types.ts b/src/shared/global-settings-types.ts index 71abe86bb46..eb81db14e01 100644 --- a/src/shared/global-settings-types.ts +++ b/src/shared/global-settings-types.ts @@ -1,5 +1,5 @@ import type { ExecutionHostId } from './execution-host' -import type { GitHubProjectSettings } from './github-project-types' +import type { GitHubProjectSettings } from './github/project-types' import type { VoiceSettings } from './speech-types' import type { GitLabProjectSettings } from './gitlab-types' import type { TaskProvider } from './task-providers' @@ -35,7 +35,7 @@ import type { SourceControlViewMode, TaskViewPresetId } from './ui-chrome-types' -import type { SetupScriptLaunchMode } from './worktree-launch-types' +import type { SetupScriptLaunchMode } from './worktree/launch-types' export type GlobalSettings = { workspaceDir: string diff --git a/src/shared/issue-link-input.ts b/src/shared/issue-link-input.ts index 37d98f55072..2f2890a633f 100644 --- a/src/shared/issue-link-input.ts +++ b/src/shared/issue-link-input.ts @@ -1,5 +1,5 @@ -import { parseGitHubIssueOrPRLink } from './github-links' -import { parseLinearIssueInput } from './linear-links' +import { parseGitHubIssueOrPRLink } from './github/links' +import { parseLinearIssueInput } from './linear/links' import type { WorkspaceSourceProvider } from './new-workspace/workspace-source' // Why: narrows the canonical provider union instead of minting a parallel one, diff --git a/src/shared/linear-agent-access.ts b/src/shared/linear/agent-access.ts similarity index 96% rename from src/shared/linear-agent-access.ts rename to src/shared/linear/agent-access.ts index 69169268767..5e69edc0c55 100644 --- a/src/shared/linear-agent-access.ts +++ b/src/shared/linear/agent-access.ts @@ -92,15 +92,15 @@ export type { LinearWriteIssueRef, LinearIssueTaskUpdateResult, LinearSaveIssueResult -} from './linear-agent-result-types' -export type { LinearIssueActivityEntry, LinearIssueActivityValue } from './linear-issue-activity' -export type { LinearInlineMedia } from './linear-inline-media' -export type { LinearMcpIssueListRequest, LinearMcpIssueListResult } from './linear-mcp-issue-list' +} from './agent-result-types' +export type { LinearIssueActivityEntry, LinearIssueActivityValue } from './issue-activity' +export type { LinearInlineMedia } from './inline-media' +export type { LinearMcpIssueListRequest, LinearMcpIssueListResult } from './mcp-issue-list' export type { LinearIssueRelationship, LinearIssueRelationWriteRequest, LinearIssueRelationWriteResult -} from './linear-issue-relation-write' +} from './issue-relation-write' export type LinearWriteTargetRequest = { input?: string diff --git a/src/shared/linear-agent-result-types.ts b/src/shared/linear/agent-result-types.ts similarity index 97% rename from src/shared/linear-agent-result-types.ts rename to src/shared/linear/agent-result-types.ts index ae04c842d4d..d8b0c016f12 100644 --- a/src/shared/linear-agent-result-types.ts +++ b/src/shared/linear/agent-result-types.ts @@ -4,9 +4,9 @@ import type { LinearIssueInclude, LinearIssueListFilter, LinearIssueTaskUpdateRequest -} from './linear-agent-access' -import type { LinearInlineMedia } from './linear-inline-media' -import type { LinearIssueActivityEntry } from './linear-issue-activity' +} from './agent-access' +import type { LinearInlineMedia } from './inline-media' +import type { LinearIssueActivityEntry } from './issue-activity' export type LinearIssueSummary = { id: string diff --git a/src/shared/linear-inline-media.test.ts b/src/shared/linear/inline-media.test.ts similarity index 95% rename from src/shared/linear-inline-media.test.ts rename to src/shared/linear/inline-media.test.ts index 0e59e906f3d..6e633d1e8bf 100644 --- a/src/shared/linear-inline-media.test.ts +++ b/src/shared/linear/inline-media.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { extractLinearInlineMedia } from './linear-inline-media' +import { extractLinearInlineMedia } from './inline-media' describe('Linear inline media extraction', () => { it('extracts markdown and HTML media URLs with source metadata', () => { diff --git a/src/shared/linear-inline-media.ts b/src/shared/linear/inline-media.ts similarity index 100% rename from src/shared/linear-inline-media.ts rename to src/shared/linear/inline-media.ts diff --git a/src/shared/linear-issue-activity.ts b/src/shared/linear/issue-activity.ts similarity index 89% rename from src/shared/linear-issue-activity.ts rename to src/shared/linear/issue-activity.ts index 1a9ff4d675c..13e97e52b56 100644 --- a/src/shared/linear-issue-activity.ts +++ b/src/shared/linear/issue-activity.ts @@ -1,4 +1,4 @@ -import type { LinearNamedEntity, LinearUserSummary } from './linear-agent-result-types' +import type { LinearNamedEntity, LinearUserSummary } from './agent-result-types' export type LinearIssueActivityActor = LinearUserSummary & { kind: 'user' | 'bot' | 'system' diff --git a/src/shared/linear-issue-attribute-filter.test.ts b/src/shared/linear/issue-attribute-filter.test.ts similarity index 99% rename from src/shared/linear-issue-attribute-filter.test.ts rename to src/shared/linear/issue-attribute-filter.test.ts index 57c0ecba441..f0d5b1f952b 100644 --- a/src/shared/linear-issue-attribute-filter.test.ts +++ b/src/shared/linear/issue-attribute-filter.test.ts @@ -7,7 +7,7 @@ import { linearIssueAttributeFilterSignature, parseLinearIssueAttributeFilter, type LinearIssueAttributeFilter -} from './linear-issue-attribute-filter' +} from './issue-attribute-filter' const sample: LinearIssueAttributeFilter = { stateIds: ['b', 'a', 'a', ' c '], diff --git a/src/shared/linear-issue-attribute-filter.ts b/src/shared/linear/issue-attribute-filter.ts similarity index 100% rename from src/shared/linear-issue-attribute-filter.ts rename to src/shared/linear/issue-attribute-filter.ts diff --git a/src/shared/linear-issue-read-limits.ts b/src/shared/linear/issue-read-limits.ts similarity index 100% rename from src/shared/linear-issue-read-limits.ts rename to src/shared/linear/issue-read-limits.ts diff --git a/src/shared/linear-issue-relation-write.ts b/src/shared/linear/issue-relation-write.ts similarity index 86% rename from src/shared/linear-issue-relation-write.ts rename to src/shared/linear/issue-relation-write.ts index 9bdb9d1aece..c95b66173f4 100644 --- a/src/shared/linear-issue-relation-write.ts +++ b/src/shared/linear/issue-relation-write.ts @@ -1,9 +1,9 @@ -import type { LinearCurrentIssueContextHints } from './linear-agent-access' +import type { LinearCurrentIssueContextHints } from './agent-access' import type { LinearIssueRelation, LinearIssueSummary, LinearWriteIssueRef -} from './linear-agent-result-types' +} from './agent-result-types' export type LinearIssueRelationship = 'blocks' | 'blockedBy' | 'relatedTo' | 'duplicateOf' diff --git a/src/shared/linear-issue-types.ts b/src/shared/linear/issue-types.ts similarity index 92% rename from src/shared/linear-issue-types.ts rename to src/shared/linear/issue-types.ts index 9f82d3b88e6..db1ba1a068d 100644 --- a/src/shared/linear-issue-types.ts +++ b/src/shared/linear/issue-types.ts @@ -1,4 +1,4 @@ -import type { LinearProjectSummary } from './linear-project-types' +import type { LinearProjectSummary } from './project-types' export type LinearIssue = { id: string diff --git a/src/shared/linear-issue-view-resume-state.test.ts b/src/shared/linear/issue-view-resume-state.test.ts similarity index 99% rename from src/shared/linear-issue-view-resume-state.test.ts rename to src/shared/linear/issue-view-resume-state.test.ts index 806977e28be..645d3a6ac6a 100644 --- a/src/shared/linear-issue-view-resume-state.test.ts +++ b/src/shared/linear/issue-view-resume-state.test.ts @@ -3,7 +3,7 @@ import { emptyLinearIssueAttributeFilter, LINEAR_ISSUE_ATTRIBUTE_FILTER_ID_MAX_LENGTH, type LinearIssueAttributeFilter -} from './linear-issue-attribute-filter' +} from './issue-attribute-filter' import { defaultLinearIssueViewResumeState, LINEAR_DISPLAY_PROPERTIES, @@ -13,7 +13,7 @@ import { serializeLinearIssueViewResumeState, setLinearWorkspaceIssueFilter, type LinearIssueViewResumeState -} from './linear-issue-view-resume-state' +} from './issue-view-resume-state' function filter(overrides: Partial = {}): LinearIssueAttributeFilter { return { ...emptyLinearIssueAttributeFilter(), ...overrides } diff --git a/src/shared/linear-issue-view-resume-state.ts b/src/shared/linear/issue-view-resume-state.ts similarity index 99% rename from src/shared/linear-issue-view-resume-state.ts rename to src/shared/linear/issue-view-resume-state.ts index 82c03f87c2e..5330b5546ab 100644 --- a/src/shared/linear-issue-view-resume-state.ts +++ b/src/shared/linear/issue-view-resume-state.ts @@ -9,7 +9,7 @@ import { parseLinearIssueAttributeFilter, LINEAR_ISSUE_ATTRIBUTE_FILTER_ID_MAX_LENGTH, type LinearIssueAttributeFilter -} from './linear-issue-attribute-filter' +} from './issue-attribute-filter' export const LINEAR_VIEW_MODES = ['list', 'board'] as const export const LINEAR_GROUP_BY_OPTIONS = ['none', 'status', 'assignee', 'priority', 'team'] as const diff --git a/src/shared/linear-links.test.ts b/src/shared/linear/links.test.ts similarity index 99% rename from src/shared/linear-links.test.ts rename to src/shared/linear/links.test.ts index 24ac962df6e..48005d93d06 100644 --- a/src/shared/linear-links.test.ts +++ b/src/shared/linear/links.test.ts @@ -8,7 +8,7 @@ import { buildLinearWorkspaceApiSettingsUrl, getLinearOrganizationUrlKeyFromIssueUrl, parseLinearIssueInput -} from './linear-links' +} from './links' describe('linear links', () => { it('builds team URLs from workspace and team keys', () => { diff --git a/src/shared/linear-links.ts b/src/shared/linear/links.ts similarity index 99% rename from src/shared/linear-links.ts rename to src/shared/linear/links.ts index bcbb7180e36..ce457f0a419 100644 --- a/src/shared/linear-links.ts +++ b/src/shared/linear/links.ts @@ -1,4 +1,4 @@ -import type { LinearConnectionStatus, LinearIssue, LinearWorkspace } from './types' +import type { LinearConnectionStatus, LinearIssue, LinearWorkspace } from '../types' export function buildLinearTeamUrl(args: { organizationUrlKey?: string | null diff --git a/src/shared/linear-mcp-issue-list.ts b/src/shared/linear/mcp-issue-list.ts similarity index 90% rename from src/shared/linear-mcp-issue-list.ts rename to src/shared/linear/mcp-issue-list.ts index 6955eef16ab..29a21ddb323 100644 --- a/src/shared/linear-mcp-issue-list.ts +++ b/src/shared/linear/mcp-issue-list.ts @@ -1,5 +1,5 @@ -import type { LinearErrorCode } from './linear-agent-access' -import type { LinearIssueSummary, LinearWorkspaceCandidate } from './linear-agent-result-types' +import type { LinearErrorCode } from './agent-access' +import type { LinearIssueSummary, LinearWorkspaceCandidate } from './agent-result-types' export type LinearMcpIssueListRequest = { team?: string diff --git a/src/shared/linear-project-list-format.ts b/src/shared/linear/project-list-format.ts similarity index 94% rename from src/shared/linear-project-list-format.ts rename to src/shared/linear/project-list-format.ts index f6cd3cd0903..b739c788e5c 100644 --- a/src/shared/linear-project-list-format.ts +++ b/src/shared/linear/project-list-format.ts @@ -1,4 +1,4 @@ -import type { LinearProjectListResult } from './linear-agent-result-types' +import type { LinearProjectListResult } from './agent-result-types' // Why: non-JSON project output aligns ids with the existing compact Linear tables. const LINEAR_PROJECT_NAME_COLUMN_WIDTH = 28 diff --git a/src/shared/linear-project-types.ts b/src/shared/linear/project-types.ts similarity index 100% rename from src/shared/linear-project-types.ts rename to src/shared/linear/project-types.ts diff --git a/src/shared/linear-uuid.ts b/src/shared/linear/uuid.ts similarity index 100% rename from src/shared/linear-uuid.ts rename to src/shared/linear/uuid.ts diff --git a/src/shared/linear-workspace-types.ts b/src/shared/linear/workspace-types.ts similarity index 100% rename from src/shared/linear-workspace-types.ts rename to src/shared/linear/workspace-types.ts diff --git a/src/shared/new-workspace/github-links.ts b/src/shared/new-workspace/github-links.ts index dc6cbd050ab..a838c4ec2f7 100644 --- a/src/shared/new-workspace/github-links.ts +++ b/src/shared/new-workspace/github-links.ts @@ -2,10 +2,10 @@ import { type GitHubIssueOrPRLink, parseGitHubIssueOrPRLink, parseGitHubIssueOrPRNumber -} from '../github-links' +} from '../github/links' import { isWorkItemLinkQueryTooLarge } from './work-item-link-query-bounds' -export * from '../github-links' +export * from '../github/links' const HTTP_URL_PREFIX_RE = /^https?:\/\//i diff --git a/src/shared/new-workspace/smart-workspace-linear-intent.ts b/src/shared/new-workspace/smart-workspace-linear-intent.ts index 0995cdd9cb9..ec77fcb2fbd 100644 --- a/src/shared/new-workspace/smart-workspace-linear-intent.ts +++ b/src/shared/new-workspace/smart-workspace-linear-intent.ts @@ -4,7 +4,7 @@ import { parseLinearIssueUrlIntent, type LinearIssueUrlIntent, type ParsedLinearIssueInput -} from '../linear-links' +} from '../linear/links' import { isSmartWorkspaceSourceQueryWithinLimit } from './smart-workspace-source-query' type SmartWorkspaceLinearMode = 'smart' | 'linear' | (string & {}) diff --git a/src/shared/new-workspace/workspace-source.ts b/src/shared/new-workspace/workspace-source.ts index 69b9e23a186..db15573d9ab 100644 --- a/src/shared/new-workspace/workspace-source.ts +++ b/src/shared/new-workspace/workspace-source.ts @@ -1,4 +1,4 @@ -import { getLinearOrganizationUrlKeyFromIssueUrl } from '../linear-links' +import { getLinearOrganizationUrlKeyFromIssueUrl } from '../linear/links' import type { FolderWorkspaceLinkedTask, JiraIssue, LinearIssue } from '../types' import { getLinkedWorkItemSuggestedName, diff --git a/src/shared/persisted-state-types.ts b/src/shared/persisted-state-types.ts index 76ec8824798..da8757cae28 100644 --- a/src/shared/persisted-state-types.ts +++ b/src/shared/persisted-state-types.ts @@ -12,15 +12,15 @@ import type { CodexResetCreditAttemptLedger } from './codex-reset-credit-attempt import type { DiffComment } from './diff-comment-types' import type { FolderWorkspace, WorkspaceKey } from './folder-workspace-types' import type { GlobalSettings } from './global-settings-types' -import type { IssueInfo, PRInfo } from './github-pr-types' +import type { IssueInfo, PRInfo } from './github/pull-request-types' import type { OnboardingState } from './onboarding-state-types' import type { PersistedUIState } from './persisted-ui-state-types' import type { ProjectGroup } from './project-group-types' import type { Project, ProjectHostSetup } from './project-types' import type { Repo } from './repo-types' -import type { SparsePreset } from './worktree-create-types' -import type { WorkspaceLineage, WorktreeLineage } from './worktree-lineage-types' -import type { WorktreeMeta } from './worktree-meta-types' +import type { SparsePreset } from './worktree/create-types' +import type { WorkspaceLineage, WorktreeLineage } from './worktree/lineage-types' +import type { WorktreeMeta } from './worktree/meta-types' import type { WorkspaceSessionState } from './workspace-session-state-types' export type LegacyPaneKeyAliasEntry = { diff --git a/src/shared/persisted-ui-state-types.ts b/src/shared/persisted-ui-state-types.ts index c8650c6df83..1db7f8e5dfc 100644 --- a/src/shared/persisted-ui-state-types.ts +++ b/src/shared/persisted-ui-state-types.ts @@ -21,7 +21,7 @@ import type { WorkspaceHostScope, WorktreeCardProperty } from './ui-chrome-types' -import type { WorkspaceStatusDefinition } from './worktree-types' +import type { WorkspaceStatusDefinition } from './worktree/types' export type PersistedUIState = { lastActiveRepoId: string | null diff --git a/src/shared/project-host-setup-projection.ts b/src/shared/project-host-setup-projection.ts index 83ba100f30d..1db66b2d2c9 100644 --- a/src/shared/project-host-setup-projection.ts +++ b/src/shared/project-host-setup-projection.ts @@ -1,6 +1,6 @@ import { getRepoExecutionHostId } from './execution-host' import { normalizeGitHubRemoteHost } from './git-remote-host-alias' -import { githubRepoIdentityKey, isDefaultGitHubHost } from './github-repository-identity-key' +import { githubRepoIdentityKey, isDefaultGitHubHost } from './github/repository-identity-key' import type { Project, ProjectHostSetup, diff --git a/src/shared/remote-workspace-session-projection.ts b/src/shared/remote-workspace-session-projection.ts index 647b577dba6..dc9a4019a8b 100644 --- a/src/shared/remote-workspace-session-projection.ts +++ b/src/shared/remote-workspace-session-projection.ts @@ -1,7 +1,7 @@ import { getDefaultWorkspaceSession } from './constants' import type { RemoteWorkspaceSession, RemoteWorkspaceTerminalTab } from './remote-workspace-types' import type { TerminalTab, WorkspaceSessionState } from './types' -import { splitWorktreeId } from './worktree-id' +import { splitWorktreeId } from './worktree/id' type ExportOptions = { isTargetWorktree: (worktreeId: string) => boolean diff --git a/src/shared/repo-types.ts b/src/shared/repo-types.ts index 99cdd957ad0..a6980b45d54 100644 --- a/src/shared/repo-types.ts +++ b/src/shared/repo-types.ts @@ -1,5 +1,5 @@ import type { RepoIcon } from './repo-icon' -import type { GitHubRepositoryIdentity } from './github-pr-types' +import type { GitHubRepositoryIdentity } from './github/pull-request-types' import type { RepoHookSettings } from './orca-yaml-hook-types' import type { ForkSyncMode } from './git-fork-sync' import type { GitRemoteIdentity } from './git-remote-identity' diff --git a/src/shared/task-provider-identity.ts b/src/shared/task-provider-identity.ts index cacd28f3232..5d9dbe8c390 100644 --- a/src/shared/task-provider-identity.ts +++ b/src/shared/task-provider-identity.ts @@ -1,4 +1,4 @@ -import { githubRepoIdentityKey } from './github-repository-identity-key' +import { githubRepoIdentityKey } from './github/repository-identity-key' import type { TaskProvider } from './task-providers' import type { ProjectProviderIdentity } from './types' diff --git a/src/shared/terminal-github-pr-link-detector.ts b/src/shared/terminal-github-pr-link-detector.ts index 7d6204ce393..7cc0f3d44ab 100644 --- a/src/shared/terminal-github-pr-link-detector.ts +++ b/src/shared/terminal-github-pr-link-detector.ts @@ -8,8 +8,8 @@ * path. Both paths must share the carry/dedupe semantics or links split across * chunks would resolve differently per authority mode. */ -import type { RepoSlug } from './github-links' -import { parseGitHubIssueOrPRLink } from './github-links' +import type { RepoSlug } from './github/links' +import { parseGitHubIssueOrPRLink } from './github/links' const GITHUB_PR_PATH_MARKER = '/pull/' const TERMINAL_SGR_PATTERN = /\x1b\[[0-?]*[ -/]*m/g diff --git a/src/shared/terminal-startup-cwd.ts b/src/shared/terminal-startup-cwd.ts index a6b3f935e1d..8344abf07cc 100644 --- a/src/shared/terminal-startup-cwd.ts +++ b/src/shared/terminal-startup-cwd.ts @@ -1,7 +1,7 @@ import { FLOATING_TERMINAL_WORKTREE_ID } from './constants' import { resolveRuntimePath } from './cross-platform-path' import { parseWorkspaceKey } from './workspace-scope' -import { splitWorktreeIdForFilesystem } from './worktree-id' +import { splitWorktreeIdForFilesystem } from './worktree/id' export type TerminalStartupCwdMissingDirFallback = { // Why: only local callers can probe the filesystem — SSH/remote worktree diff --git a/src/shared/types.ts b/src/shared/types.ts index c3ef81392d2..b08e93a3be8 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -33,39 +33,39 @@ export type { FolderWorkspaceLinkedTask } from './folder-workspace-types' // Worktrees and workspace session state -export type { GitWorktreeInfo, WorktreeHeadIdentity, WorkspaceStatus } from './worktree-types' -export type { WorkspaceStatusDefinition, Worktree, WorkspaceLinkedItem } from './worktree-types' -export type { CliWorkspaceProvenance, WorkspaceCreatorProvenance } from './worktree-types' -export type { AutomationWorkspaceProvenance } from './worktree-types' -export type { AutomationWorkspaceProvenanceRequest, GitPushTarget } from './worktree-types' -export type { GitHubPrStartPoint, WorktreeOwnership } from './worktree-types' -export type { DetectedWorktreeListSource, DetectedWorktree } from './worktree-types' -export type { DetectedWorktreeListResult } from './worktree-types' +export type { GitWorktreeInfo, WorktreeHeadIdentity, WorkspaceStatus } from './worktree/types' +export type { WorkspaceStatusDefinition, Worktree, WorkspaceLinkedItem } from './worktree/types' +export type { CliWorkspaceProvenance, WorkspaceCreatorProvenance } from './worktree/types' +export type { AutomationWorkspaceProvenance } from './worktree/types' +export type { AutomationWorkspaceProvenanceRequest, GitPushTarget } from './worktree/types' +export type { GitHubPrStartPoint, WorktreeOwnership } from './worktree/types' +export type { DetectedWorktreeListSource, DetectedWorktree } from './worktree/types' +export type { DetectedWorktreeListResult } from './worktree/types' -export type { WorktreeMeta } from './worktree-meta-types' +export type { WorktreeMeta } from './worktree/meta-types' -export type { WorktreeLineageOrigin } from './worktree-lineage-types' -export type { WorktreeLineageCaptureConfidence } from './worktree-lineage-types' -export type { WorktreeLineageCaptureSource, WorktreeLineageCapture } from './worktree-lineage-types' -export type { WorktreeLineage, WorkspaceLineage } from './worktree-lineage-types' -export type { WorktreeLineageWarningCode, WorktreeLineageWarning } from './worktree-lineage-types' +export type { WorktreeLineageOrigin } from './worktree/lineage-types' +export type { WorktreeLineageCaptureConfidence } from './worktree/lineage-types' +export type { WorktreeLineageCaptureSource, WorktreeLineageCapture } from './worktree/lineage-types' +export type { WorktreeLineage, WorkspaceLineage } from './worktree/lineage-types' +export type { WorktreeLineageWarningCode, WorktreeLineageWarning } from './worktree/lineage-types' -export type { WorktreeSetupLaunch, WorktreeStartupLaunch } from './worktree-launch-types' -export type { WorktreeDefaultTabsLaunch, SetupScriptLaunchMode } from './worktree-launch-types' -export type { SetupSplitDirection } from './worktree-launch-types' +export type { WorktreeSetupLaunch, WorktreeStartupLaunch } from './worktree/launch-types' +export type { WorktreeDefaultTabsLaunch, SetupScriptLaunchMode } from './worktree/launch-types' +export type { SetupSplitDirection } from './worktree/launch-types' -export type { SetupDecision, WorktreeCreateTimingPhase } from './worktree-create-types' -export type { WorktreeCreateTiming, CreateSparseCheckoutRequest } from './worktree-create-types' -export type { SparsePreset, CreateWorktreeArgs } from './worktree-create-types' -export type { AdoptProvisionedRootArgs, CreateWorktreeResult } from './worktree-create-types' -export type { WorktreeCreateBaseFallback, PreservedWorktreeBranch } from './worktree-create-types' -export type { RemoveWorktreeResult, ForceDeleteWorktreeBranchResult } from './worktree-create-types' +export type { SetupDecision, WorktreeCreateTimingPhase } from './worktree/create-types' +export type { WorktreeCreateTiming, CreateSparseCheckoutRequest } from './worktree/create-types' +export type { SparsePreset, CreateWorktreeArgs } from './worktree/create-types' +export type { AdoptProvisionedRootArgs, CreateWorktreeResult } from './worktree/create-types' +export type { WorktreeCreateBaseFallback, PreservedWorktreeBranch } from './worktree/create-types' +export type { RemoveWorktreeResult, ForceDeleteWorktreeBranchResult } from './worktree/create-types' -export type { LocalBaseRefRefreshResult } from './worktree-base-ref-drift-types' -export type { LocalBaseRefUpdateSuggestion } from './worktree-base-ref-drift-types' -export type { WorktreeBaseStatusKind } from './worktree-base-ref-drift-types' -export type { WorktreeBaseStatusEvent } from './worktree-base-ref-drift-types' -export type { WorktreeRemoteBranchConflictEvent } from './worktree-base-ref-drift-types' +export type { LocalBaseRefRefreshResult } from './worktree/base-ref-drift-types' +export type { LocalBaseRefUpdateSuggestion } from './worktree/base-ref-drift-types' +export type { WorktreeBaseStatusKind } from './worktree/base-ref-drift-types' +export type { WorktreeBaseStatusEvent } from './worktree/base-ref-drift-types' +export type { WorktreeRemoteBranchConflictEvent } from './worktree/base-ref-drift-types' export type { PersistedOpenFile, WorkspaceSessionState } from './workspace-session-state-types' export type { WorkspaceSessionPatch } from './workspace-session-state-types' @@ -132,33 +132,56 @@ export type { DiffComment } from './diff-comment-types' // GitHub -export type { PRState, IssueState, CheckStatus, PRMergeableState } from './github-pr-types' -export type { PRReviewDecision, PRConflictSummary } from './github-pr-types' -export type { GitHubRepositoryIdentity, GitHubOwnerRepo } from './github-pr-types' -export type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from './github-pr-types' -export type { GitHubPRStackEntry, GitHubPRStack, PRInfo, IssueInfo } from './github-pr-types' -export type { GitHubViewer, GitHubAssignableUser, ProviderCheckSummary } from './github-pr-types' -export type { GitHubPRReviewSummary, GitHubPRFileViewedState } from './github-pr-types' -export type { GitHubPRFile, GitHubPRFileContents } from './github-pr-types' +export type { + PRState, + IssueState, + CheckStatus, + PRMergeableState +} from './github/pull-request-types' +export type { PRReviewDecision, PRConflictSummary } from './github/pull-request-types' +export type { GitHubRepositoryIdentity, GitHubOwnerRepo } from './github/pull-request-types' +export type { GitHubPRMergeMethod, GitHubPRMergeMethodSettings } from './github/pull-request-types' +export type { + GitHubPRStackEntry, + GitHubPRStack, + PRInfo, + IssueInfo +} from './github/pull-request-types' +export type { + GitHubViewer, + GitHubAssignableUser, + ProviderCheckSummary +} from './github/pull-request-types' +export type { GitHubPRReviewSummary, GitHubPRFileViewedState } from './github/pull-request-types' +export type { GitHubPRFile, GitHubPRFileContents } from './github/pull-request-types' -export type { PRRefreshErrorType, PRRefreshUpstreamErrorType } from './github-pr-refresh-types' -export type { PRRefreshOutcome, GitHubPRRefreshReason } from './github-pr-refresh-types' -export type { GitHubPRRefreshEnqueueResult, GitHubPRRefreshAlias } from './github-pr-refresh-types' -export type { GitHubPRRefreshCandidate } from './github-pr-refresh-types' -export type { GitHubPRRefreshSkippedReason, GitHubPRRefreshEvent } from './github-pr-refresh-types' +export type { + PRRefreshErrorType, + PRRefreshUpstreamErrorType +} from './github/pull-request-refresh-types' +export type { PRRefreshOutcome, GitHubPRRefreshReason } from './github/pull-request-refresh-types' +export type { + GitHubPRRefreshEnqueueResult, + GitHubPRRefreshAlias +} from './github/pull-request-refresh-types' +export type { GitHubPRRefreshCandidate } from './github/pull-request-refresh-types' +export type { + GitHubPRRefreshSkippedReason, + GitHubPRRefreshEvent +} from './github/pull-request-refresh-types' -export type { PRCheckDetail, PRCheckAnnotation, PRCheckStep } from './github-check-types' -export type { PRCheckJob, PRCheckRunDetails, GitHubRerunPRChecksResult } from './github-check-types' +export type { PRCheckDetail, PRCheckAnnotation, PRCheckStep } from './github/check-types' +export type { PRCheckJob, PRCheckRunDetails, GitHubRerunPRChecksResult } from './github/check-types' -export type { GitHubReactionContent, GitHubReaction, PRComment } from './github-comment-types' -export type { GitHubCommentResult, GitHubPRReviewCommentInput } from './github-comment-types' -export type { GitHubIssueTimelineTarget, GitHubIssueTimelineItem } from './github-comment-types' +export type { GitHubReactionContent, GitHubReaction, PRComment } from './github/comment-types' +export type { GitHubCommentResult, GitHubPRReviewCommentInput } from './github/comment-types' +export type { GitHubIssueTimelineTarget, GitHubIssueTimelineItem } from './github/comment-types' -export type { GitHubWorkItem, GitHubWorkItemDetails } from './github-work-item-types' -export type { ListWorkItemsResult } from './github-work-item-types' +export type { GitHubWorkItem, GitHubWorkItemDetails } from './github/work-item-types' +export type { ListWorkItemsResult } from './github/work-item-types' -export type { GitHubRateLimitBucket, GitHubRateLimitSnapshot } from './github-rate-limit-types' -export type { GetRateLimitResult } from './github-rate-limit-types' +export type { GitHubRateLimitBucket, GitHubRateLimitSnapshot } from './github/rate-limit-types' +export type { GetRateLimitResult } from './github/rate-limit-types' // GitLab @@ -229,21 +252,21 @@ export type { // Linear -export type { LinearViewer, LinearWorkspace } from './linear-workspace-types' -export type { LinearWorkspaceSelection, LinearWorkspaceSelector } from './linear-workspace-types' -export type { LinearConcreteWorkspaceId, LinearWorkspaceError } from './linear-workspace-types' -export type { LinearCollectionResult, LinearConnectionStatus } from './linear-workspace-types' -export type { LinearWorkflowState, LinearLabel, LinearMember } from './linear-workspace-types' -export type { LinearTeam } from './linear-workspace-types' +export type { LinearViewer, LinearWorkspace } from './linear/workspace-types' +export type { LinearWorkspaceSelection, LinearWorkspaceSelector } from './linear/workspace-types' +export type { LinearConcreteWorkspaceId, LinearWorkspaceError } from './linear/workspace-types' +export type { LinearCollectionResult, LinearConnectionStatus } from './linear/workspace-types' +export type { LinearWorkflowState, LinearLabel, LinearMember } from './linear/workspace-types' +export type { LinearTeam } from './linear/workspace-types' -export type { LinearIssue, LinearIssueChildSummary, LinearComment } from './linear-issue-types' +export type { LinearIssue, LinearIssueChildSummary, LinearComment } from './linear/issue-types' -export type { LinearProjectSummary, LinearProjectStatusSummary } from './linear-project-types' -export type { LinearProjectMemberSummary } from './linear-project-types' -export type { LinearProjectMilestoneSummary } from './linear-project-types' -export type { LinearProjectResourceSummary } from './linear-project-types' -export type { LinearProjectUpdateSummary, LinearProjectDetail } from './linear-project-types' -export type { LinearCustomViewModel, LinearCustomViewSummary } from './linear-project-types' +export type { LinearProjectSummary, LinearProjectStatusSummary } from './linear/project-types' +export type { LinearProjectMemberSummary } from './linear/project-types' +export type { LinearProjectMilestoneSummary } from './linear/project-types' +export type { LinearProjectResourceSummary } from './linear/project-types' +export type { LinearProjectUpdateSummary, LinearProjectDetail } from './linear/project-types' +export type { LinearCustomViewModel, LinearCustomViewSummary } from './linear/project-types' // Cross-provider issue mutations and task sources diff --git a/src/shared/ui-chrome-types.ts b/src/shared/ui-chrome-types.ts index f7a4bd1efdf..80c78d55afa 100644 --- a/src/shared/ui-chrome-types.ts +++ b/src/shared/ui-chrome-types.ts @@ -1,5 +1,5 @@ -import type { LinearConcreteWorkspaceId } from './linear-workspace-types' -import type { LinearCustomViewModel } from './linear-project-types' +import type { LinearConcreteWorkspaceId } from './linear/workspace-types' +import type { LinearCustomViewModel } from './linear/project-types' export type TaskViewPresetId = 'all' | 'issues' | 'review' | 'my-issues' | 'my-prs' | 'prs' diff --git a/src/shared/workspace-session-terminal-buffers.ts b/src/shared/workspace-session-terminal-buffers.ts index 81ab8315c72..b2ec9df45dc 100644 --- a/src/shared/workspace-session-terminal-buffers.ts +++ b/src/shared/workspace-session-terminal-buffers.ts @@ -1,6 +1,6 @@ import type { Repo, WorkspaceSessionState } from './types' import { FLOATING_TERMINAL_WORKTREE_ID } from './constants' -import { getRepoIdFromWorktreeId } from './worktree-id' +import { getRepoIdFromWorktreeId } from './worktree/id' import { TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT } from './terminal-scrollback-limits' import { clampUtf8TextTail, measureUtf8ByteLength } from './utf8-byte-limits' import { parseExecutionHostId } from './execution-host' diff --git a/src/shared/worktree-base-ref-drift-types.ts b/src/shared/worktree/base-ref-drift-types.ts similarity index 100% rename from src/shared/worktree-base-ref-drift-types.ts rename to src/shared/worktree/base-ref-drift-types.ts diff --git a/src/shared/worktree-base-ref.test.ts b/src/shared/worktree/base-ref.test.ts similarity index 97% rename from src/shared/worktree-base-ref.test.ts rename to src/shared/worktree/base-ref.test.ts index 9776be541f5..062d840b1cd 100644 --- a/src/shared/worktree-base-ref.test.ts +++ b/src/shared/worktree/base-ref.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { resolveWorktreeAddBaseRef } from './worktree-base-ref' +import { resolveWorktreeAddBaseRef } from './base-ref' describe('resolveWorktreeAddBaseRef', () => { it('leaves fully qualified refs unchanged', async () => { diff --git a/src/shared/worktree-base-ref.ts b/src/shared/worktree/base-ref.ts similarity index 100% rename from src/shared/worktree-base-ref.ts rename to src/shared/worktree/base-ref.ts diff --git a/src/shared/worktree-card-properties.test.ts b/src/shared/worktree/card-properties.test.ts similarity index 98% rename from src/shared/worktree-card-properties.test.ts rename to src/shared/worktree/card-properties.test.ts index be9973265f3..45bc50e24a9 100644 --- a/src/shared/worktree-card-properties.test.ts +++ b/src/shared/worktree/card-properties.test.ts @@ -7,7 +7,7 @@ import { getWorktreeCardModeUpdates, isDefaultedCompactWorktreeCardProperties, normalizeWorktreeCardProperties -} from './worktree-card-properties' +} from './card-properties' describe('worktree card properties', () => { it('defines Default with inline agents and without branch', () => { diff --git a/src/shared/worktree-card-properties.ts b/src/shared/worktree/card-properties.ts similarity index 99% rename from src/shared/worktree-card-properties.ts rename to src/shared/worktree/card-properties.ts index a11bbdc3c03..240b3ba341e 100644 --- a/src/shared/worktree-card-properties.ts +++ b/src/shared/worktree/card-properties.ts @@ -3,7 +3,7 @@ import type { PersistedUIState, WorktreeCardMode, WorktreeCardProperty -} from './types' +} from '../types' const FIXED_WORKTREE_CARD_PROPERTIES: WorktreeCardProperty[] = ['status', 'unread'] diff --git a/src/shared/worktree-create-types.ts b/src/shared/worktree/create-types.ts similarity index 92% rename from src/shared/worktree-create-types.ts rename to src/shared/worktree/create-types.ts index ff7929332ce..80e865d2c85 100644 --- a/src/shared/worktree-create-types.ts +++ b/src/shared/worktree/create-types.ts @@ -1,8 +1,8 @@ -import type { ExecutionHostId } from './execution-host' -import type { WorkspaceSource } from './workspace-source' -import type { TaskSourceContext } from './task-source-context' -import type { WorkspaceKey } from './folder-workspace-types' -import type { TuiAgent } from './tui-agent' +import type { ExecutionHostId } from '../execution-host' +import type { WorkspaceSource } from '../workspace-source' +import type { TaskSourceContext } from '../task-source-context' +import type { WorkspaceKey } from '../folder-workspace-types' +import type { TuiAgent } from '../tui-agent' import type { AutomationWorkspaceProvenanceRequest, GitPushTarget, @@ -10,22 +10,18 @@ import type { WorkspaceLinkedItem, WorkspaceStatus, Worktree -} from './worktree-types' -import type { - WorkspaceLineage, - WorktreeLineage, - WorktreeLineageWarning -} from './worktree-lineage-types' +} from './types' +import type { WorkspaceLineage, WorktreeLineage, WorktreeLineageWarning } from './lineage-types' import type { WorktreeDefaultTabsLaunch, WorktreeSetupLaunch, WorktreeStartupLaunch -} from './worktree-launch-types' +} from './launch-types' import type { LocalBaseRefRefreshResult, LocalBaseRefUpdateSuggestion, WorktreeBaseStatusEvent -} from './worktree-base-ref-drift-types' +} from './base-ref-drift-types' export type SetupDecision = 'inherit' | 'run' | 'skip' diff --git a/src/shared/worktree-id.test.ts b/src/shared/worktree/id.test.ts similarity index 99% rename from src/shared/worktree-id.test.ts rename to src/shared/worktree/id.test.ts index 99e6b4e49e7..e64d27784f5 100644 --- a/src/shared/worktree-id.test.ts +++ b/src/shared/worktree/id.test.ts @@ -5,7 +5,7 @@ import { getWorktreePathBasenameFromId, splitWorktreeId, splitWorktreeIdForFilesystem -} from './worktree-id' +} from './id' describe('WORKTREE_ID_SEPARATOR', () => { it('is the literal "::" separator', () => { diff --git a/src/shared/worktree-id.ts b/src/shared/worktree/id.ts similarity index 93% rename from src/shared/worktree-id.ts rename to src/shared/worktree/id.ts index 69f01f4b378..d71cbac66eb 100644 --- a/src/shared/worktree-id.ts +++ b/src/shared/worktree/id.ts @@ -1,6 +1,6 @@ -import { WORKTREE_ID_SEPARATOR } from './pty-session-id-format' +import { WORKTREE_ID_SEPARATOR } from '../pty-session-id-format' -export { WORKTREE_ID_SEPARATOR } from './pty-session-id-format' +export { WORKTREE_ID_SEPARATOR } from '../pty-session-id-format' export type ParsedWorktreeId = { repoId: string diff --git a/src/shared/worktree-launch-types.ts b/src/shared/worktree/launch-types.ts similarity index 74% rename from src/shared/worktree-launch-types.ts rename to src/shared/worktree/launch-types.ts index 3cdeeb7abbb..5fc9f18d397 100644 --- a/src/shared/worktree-launch-types.ts +++ b/src/shared/worktree/launch-types.ts @@ -1,9 +1,9 @@ -import type { StartupCommandDelivery } from './codex-startup-delivery' -import type { AgentKind, LaunchSource, RequestKind } from './telemetry-events' -import type { SleepingAgentLaunchConfig } from './agent-session-resume' -import type { SetupRunnerShell } from './setup-runner-command' -import type { OrcaDefaultTabTemplate } from './orca-yaml-hook-types' -import type { TuiAgent } from './tui-agent' +import type { StartupCommandDelivery } from '../codex-startup-delivery' +import type { AgentKind, LaunchSource, RequestKind } from '../telemetry-events' +import type { SleepingAgentLaunchConfig } from '../agent-session-resume' +import type { SetupRunnerShell } from '../setup-runner-command' +import type { OrcaDefaultTabTemplate } from '../orca-yaml-hook-types' +import type { TuiAgent } from '../tui-agent' export type WorktreeSetupLaunch = { runnerScriptPath: string diff --git a/src/shared/worktree-lineage-types.ts b/src/shared/worktree/lineage-types.ts similarity index 95% rename from src/shared/worktree-lineage-types.ts rename to src/shared/worktree/lineage-types.ts index c421b927272..c7f0e3d791e 100644 --- a/src/shared/worktree-lineage-types.ts +++ b/src/shared/worktree/lineage-types.ts @@ -1,4 +1,4 @@ -import type { WorkspaceKey } from './folder-workspace-types' +import type { WorkspaceKey } from '../folder-workspace-types' export type WorktreeLineageOrigin = 'orchestration' | 'cli' | 'manual' export type WorktreeLineageCaptureConfidence = 'explicit' | 'inferred' diff --git a/src/shared/worktree-meta-types.ts b/src/shared/worktree/meta-types.ts similarity index 90% rename from src/shared/worktree-meta-types.ts rename to src/shared/worktree/meta-types.ts index 8d7df1a53fc..54bc96c890d 100644 --- a/src/shared/worktree-meta-types.ts +++ b/src/shared/worktree/meta-types.ts @@ -1,6 +1,6 @@ -import type { ExecutionHostId } from './execution-host' -import type { TaskSourceContext } from './task-source-context' -import type { EphemeralVmCheckoutMode } from './orca-yaml-hook-types' +import type { ExecutionHostId } from '../execution-host' +import type { TaskSourceContext } from '../task-source-context' +import type { EphemeralVmCheckoutMode } from '../orca-yaml-hook-types' import type { AutomationWorkspaceProvenance, CliWorkspaceProvenance, @@ -8,10 +8,10 @@ import type { WorkspaceCreatorProvenance, WorkspaceLinkedItem, WorkspaceStatus -} from './worktree-types' -import type { TuiAgent } from './tui-agent' -import type { OrcaWorkspaceLayout } from './global-settings-types' -import type { DiffComment, MobileDiffReviewState } from './diff-comment-types' +} from './types' +import type { TuiAgent } from '../tui-agent' +import type { OrcaWorkspaceLayout } from '../global-settings-types' +import type { DiffComment, MobileDiffReviewState } from '../diff-comment-types' // ─── Worktree metadata (persisted user-authored fields only) ───────── export type WorktreeMeta = { diff --git a/src/shared/worktree-ownership-worktree-base-path.test.ts b/src/shared/worktree/ownership-worktree-base-path.test.ts similarity index 96% rename from src/shared/worktree-ownership-worktree-base-path.test.ts rename to src/shared/worktree/ownership-worktree-base-path.test.ts index d6af4dab77d..aff3c951285 100644 --- a/src/shared/worktree-ownership-worktree-base-path.test.ts +++ b/src/shared/worktree/ownership-worktree-base-path.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import type { GlobalSettings, Repo, Worktree } from './types' -import { buildKnownOrcaWorkspaceLayouts, classifyWorktreeOwnership } from './worktree-ownership' +import type { GlobalSettings, Repo, Worktree } from '../types' +import { buildKnownOrcaWorkspaceLayouts, classifyWorktreeOwnership } from './ownership' function makeRepo(overrides: Partial = {}): Repo { return { diff --git a/src/shared/worktree-ownership.test.ts b/src/shared/worktree/ownership.test.ts similarity index 99% rename from src/shared/worktree-ownership.test.ts rename to src/shared/worktree/ownership.test.ts index ce56ef2c0cd..8877a415b53 100644 --- a/src/shared/worktree-ownership.test.ts +++ b/src/shared/worktree/ownership.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import type { GlobalSettings, Repo, Worktree, WorktreeMeta } from './types' -import { createAgentScratchWorktreePathMatcher } from './agent-scratch-worktrees' +import type { GlobalSettings, Repo, Worktree, WorktreeMeta } from '../types' +import { createAgentScratchWorktreePathMatcher } from '../agent-scratch-worktrees' import { applyMetadataFallbackVisibility, buildKnownOrcaWorkspaceLayouts, @@ -10,7 +10,7 @@ import { shouldShowWorktree, toDetectedWorktree, EXTERNAL_WORKTREE_VISIBILITY_ROLLOUT_AT -} from './worktree-ownership' +} from './ownership' const LARGE_WORKSPACE_HISTORY_COUNT = 150_000 diff --git a/src/shared/worktree-ownership.ts b/src/shared/worktree/ownership.ts similarity index 96% rename from src/shared/worktree-ownership.ts rename to src/shared/worktree/ownership.ts index 22f73690bda..7e224d0689f 100644 --- a/src/shared/worktree-ownership.ts +++ b/src/shared/worktree/ownership.ts @@ -5,24 +5,24 @@ import { normalizeRuntimePathSeparators, relativePathInsideRoot, resolveRuntimePath -} from './cross-platform-path' -import { parseWslUncPath } from './wsl-paths' +} from '../cross-platform-path' +import { parseWslUncPath } from '../wsl-paths' import { isAgentScratchWorktreePath, type AgentScratchWorktreePathMatcher -} from './agent-scratch-worktrees' +} from '../agent-scratch-worktrees' import { createWorktreeVisibilitySourceMatcher, effectiveWorktreeSourceVisibility, normalizeCustomWorktreeVisibilitySources, type WorktreeVisibilitySourceMatcher -} from './worktree-visibility-sources' -import { isExplicitlyImportedExternalWorktreePath } from './external-worktree-inbox' +} from './visibility-sources' +import { isExplicitlyImportedExternalWorktreePath } from '../external-worktree-inbox' import { effectiveAgentWorktreeVisibility, effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility -} from './external-worktree-visibility' +} from '../external-worktree-visibility' import type { DetectedWorktree, GlobalSettings, @@ -31,14 +31,14 @@ import type { Worktree, WorktreeMeta, WorktreeOwnership -} from './types' +} from '../types' export { effectiveAgentWorktreeVisibility, effectiveExternalWorktreeVisibility, EXTERNAL_WORKTREE_VISIBILITY_ROLLOUT_AT, isLegacyRepoForExternalWorktreeVisibility -} from './external-worktree-visibility' +} from '../external-worktree-visibility' export function buildKnownOrcaWorkspaceLayouts( settings: Pick, diff --git a/src/shared/worktree-removal-fence-error.test.ts b/src/shared/worktree/removal-fence-error.test.ts similarity index 96% rename from src/shared/worktree-removal-fence-error.test.ts rename to src/shared/worktree/removal-fence-error.test.ts index ce9e3d76bb7..407f1baf1f5 100644 --- a/src/shared/worktree-removal-fence-error.test.ts +++ b/src/shared/worktree/removal-fence-error.test.ts @@ -3,7 +3,7 @@ import { TERMINAL_REMOVAL_IN_PROGRESS_MESSAGE, WATCHER_REMOVAL_IN_PROGRESS_MESSAGE, isWorktreeRemovalFenceError -} from './worktree-removal-fence-error' +} from './removal-fence-error' describe('isWorktreeRemovalFenceError', () => { it('recognizes the raw terminal and watcher fence messages', () => { diff --git a/src/shared/worktree-removal-fence-error.ts b/src/shared/worktree/removal-fence-error.ts similarity index 100% rename from src/shared/worktree-removal-fence-error.ts rename to src/shared/worktree/removal-fence-error.ts diff --git a/src/shared/worktree-removal-force-classification.test.ts b/src/shared/worktree/removal-force-classification.test.ts similarity index 99% rename from src/shared/worktree-removal-force-classification.test.ts rename to src/shared/worktree/removal-force-classification.test.ts index b4d95a5727d..73ac6ea77a6 100644 --- a/src/shared/worktree-removal-force-classification.test.ts +++ b/src/shared/worktree/removal-force-classification.test.ts @@ -5,7 +5,7 @@ import { UNSTOPPED_PTY_REMOVAL_PREFIX, WORKTREE_TEARDOWN_FORCE_HINT, WORKTREE_TEARDOWN_TIMEOUT_PREFIX -} from './worktree-removal' +} from './removal' const liveError = `${UNSTOPPED_PTY_REMOVAL_PREFIX} repo-1::/w — still live: term_a. ${WORKTREE_TEARDOWN_FORCE_HINT}` const unverifiableError = `${UNSTOPPED_PTY_REMOVAL_PREFIX} repo-1::/w — could not verify these exited: term_a (daemon socket closed). ${WORKTREE_TEARDOWN_FORCE_HINT}` diff --git a/src/shared/worktree-removal.ts b/src/shared/worktree/removal.ts similarity index 99% rename from src/shared/worktree-removal.ts rename to src/shared/worktree/removal.ts index 8788171ebe0..68d1072b247 100644 --- a/src/shared/worktree-removal.ts +++ b/src/shared/worktree/removal.ts @@ -1,4 +1,4 @@ -import type { GitWorktreeInfo } from './types' +import type { GitWorktreeInfo } from '../types' export const LOCKED_WORKTREE_REMOVAL_PREFIX = 'Worktree is locked by Git.' diff --git a/src/shared/worktree-sort-order-update.test.ts b/src/shared/worktree/sort-order-update.test.ts similarity index 95% rename from src/shared/worktree-sort-order-update.test.ts rename to src/shared/worktree/sort-order-update.test.ts index 4c53ddff56d..6981e851eef 100644 --- a/src/shared/worktree-sort-order-update.test.ts +++ b/src/shared/worktree/sort-order-update.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { planWorktreeSortOrderUpdates } from './worktree-sort-order-update' +import { planWorktreeSortOrderUpdates } from './sort-order-update' describe('planWorktreeSortOrderUpdates', () => { it('skips an order that is already represented by descending ranks', () => { diff --git a/src/shared/worktree-sort-order-update.ts b/src/shared/worktree/sort-order-update.ts similarity index 100% rename from src/shared/worktree-sort-order-update.ts rename to src/shared/worktree/sort-order-update.ts diff --git a/src/shared/worktree-submodule-removal.test.ts b/src/shared/worktree/submodule-removal.test.ts similarity index 93% rename from src/shared/worktree-submodule-removal.test.ts rename to src/shared/worktree/submodule-removal.test.ts index 0c8564b79d3..464fc9e7766 100644 --- a/src/shared/worktree-submodule-removal.test.ts +++ b/src/shared/worktree/submodule-removal.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { isSubmoduleWorktreeRemovalRefusal } from './worktree-submodule-removal' +import { isSubmoduleWorktreeRemovalRefusal } from './submodule-removal' describe('isSubmoduleWorktreeRemovalRefusal', () => { it('matches the English git fatal on stderr', () => { diff --git a/src/shared/worktree-submodule-removal.ts b/src/shared/worktree/submodule-removal.ts similarity index 100% rename from src/shared/worktree-submodule-removal.ts rename to src/shared/worktree/submodule-removal.ts diff --git a/src/shared/worktree-types.ts b/src/shared/worktree/types.ts similarity index 94% rename from src/shared/worktree-types.ts rename to src/shared/worktree/types.ts index 25686dbf6f3..af6252f5c3a 100644 --- a/src/shared/worktree-types.ts +++ b/src/shared/worktree/types.ts @@ -1,10 +1,10 @@ -import type { ExecutionHostId } from './execution-host' -import type { AutomationExecutionTargetType } from './automations-types' -import type { TaskSourceContext } from './task-source-context' -import type { TuiAgent } from './tui-agent' -import type { DiffComment, MobileDiffReviewState } from './diff-comment-types' -import type { EphemeralVmCheckoutMode } from './orca-yaml-hook-types' -import type { BuiltInWorktreeVisibilitySourceId } from './repo-types' +import type { ExecutionHostId } from '../execution-host' +import type { AutomationExecutionTargetType } from '../automations-types' +import type { TaskSourceContext } from '../task-source-context' +import type { TuiAgent } from '../tui-agent' +import type { DiffComment, MobileDiffReviewState } from '../diff-comment-types' +import type { EphemeralVmCheckoutMode } from '../orca-yaml-hook-types' +import type { BuiltInWorktreeVisibilitySourceId } from '../repo-types' export type WorkspaceLinkedItem = { provider: 'github' | 'gitlab' | 'linear' | 'jira' diff --git a/src/shared/worktree-visibility-sources.test.ts b/src/shared/worktree/visibility-sources.test.ts similarity index 98% rename from src/shared/worktree-visibility-sources.test.ts rename to src/shared/worktree/visibility-sources.test.ts index 875c34b4ad8..280ac0f3082 100644 --- a/src/shared/worktree-visibility-sources.test.ts +++ b/src/shared/worktree/visibility-sources.test.ts @@ -1,12 +1,12 @@ import { describe, expect, it, vi } from 'vitest' -import type { Repo } from './types' +import type { Repo } from '../types' import { buildWorktreeSourcePreferenceUpdate, createWorktreeVisibilitySourceMatcher, effectiveBuiltInWorktreeSourceVisibility, normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences -} from './worktree-visibility-sources' +} from './visibility-sources' function repo(overrides: Partial = {}): Repo { return { diff --git a/src/shared/worktree-visibility-sources.ts b/src/shared/worktree/visibility-sources.ts similarity index 99% rename from src/shared/worktree-visibility-sources.ts rename to src/shared/worktree/visibility-sources.ts index e4153daa86d..0053bedf2de 100644 --- a/src/shared/worktree-visibility-sources.ts +++ b/src/shared/worktree/visibility-sources.ts @@ -2,14 +2,14 @@ import { createNormalizedPathInsideOrEqualMatcher, isRuntimePathAbsolute, normalizeRuntimePathForComparison -} from './cross-platform-path' +} from '../cross-platform-path' import type { BuiltInWorktreeVisibilitySourceId, CustomWorktreeVisibilitySource, ExternalWorktreeVisibility, Repo, WorktreeVisibilitySourcePreferences -} from './types' +} from '../types' export const MAX_CUSTOM_WORKTREE_VISIBILITY_SOURCES = 32 const MAX_SOURCE_ID_LENGTH = 128 diff --git a/tests/e2e/completed-worker-retirement-resume.spec.ts b/tests/e2e/completed-worker-retirement-resume.spec.ts index 5540c4d6896..7d505c69587 100644 --- a/tests/e2e/completed-worker-retirement-resume.spec.ts +++ b/tests/e2e/completed-worker-retirement-resume.spec.ts @@ -19,7 +19,7 @@ import { } from './helpers/completed-worker-retirement-fixture' import { RuntimeClient } from '../../src/cli/runtime-client' import type { RuntimeTerminalRead, RuntimeTerminalSummary } from '../../src/shared/runtime-types' -import { splitWorktreeIdForFilesystem } from '../../src/shared/worktree-id' +import { splitWorktreeIdForFilesystem } from '../../src/shared/worktree/id' const PROVIDER_SESSION_ID = '019feb51-2269-71c2-89c6-faa8dc65c8dc'