Skip to content

feat(projects): add safe workspace import and export#896

Open
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/project-import-export
Open

feat(projects): add safe workspace import and export#896
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/project-import-export

Conversation

@luoye520ww

@luoye520ww luoye520ww commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Import project and Export project actions to the existing workspace project picker.
  • Copy project directories through the main process with an atomic staging directory and collision-safe destination names.
  • Reject destinations inside the source project, skip symlinks and managed .kun/worktrees, and enforce file-count/size limits.
  • Keep the transfer service in a lazy-loaded main-process chunk so the existing Electron main bundle remains stable.

This completes the project transfer portion of #878. Plan-mode model routing is covered separately by #895.

Safety

  • Source and destination roots are canonicalized before the containment check.
  • Transfers are staged under the selected parent and published with one rename.
  • Existing destinations are never overwritten; a deterministic -copy-N name is selected.
  • Symlinks and managed worktrees are skipped, and file count/byte limits fail closed.

Tests

npm.cmd exec vitest run src/main/services/project-transfer-service.test.ts src/main/ipc/app-ipc-schemas.test.ts src/renderer/src/components/chat/WorkspaceProjectPicker.test.ts
npm.cmd run typecheck
npm.cmd run lint -- --quiet
npm.cmd run build
git diff --check

Results: 57 targeted tests passed in CI; Typecheck, lint, build, and Linux/macOS/Windows package validation are green in CI. The old local worktree currently has no node_modules, so the commands were not rerun locally in this checkout.

Issue

Part of #878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant