Simplify workspace creation with inline worktree API

Replace the multi-step new-agent route flow with a single
create_paseo_worktree endpoint that registers the workspace immediately
and creates the git worktree in the background. The sidebar now calls
this endpoint directly and shows a creating spinner inline.

Also auto-resolves the base branch from origin/HEAD when not explicitly
provided, removes the unused Tauri WebSocket transport layer, and
normalizes loopback endpoints to localhost.

Closes #125
This commit is contained in:
Mohamed Boudra
2026-03-19 23:33:35 +07:00
parent 3d4ac57bd0
commit 6ab97c579e
21 changed files with 514 additions and 531 deletions
@@ -17,6 +17,7 @@ import {
MergeFromBaseConflictError,
NotGitRepoError,
pushCurrentBranch,
resolveRepositoryDefaultBranch,
} from "./checkout-git.js";
import { createWorktree } from "./worktree.js";
import { getPaseoWorktreeMetadataPath } from "./worktree-metadata.js";
@@ -707,6 +708,17 @@ describe("checkout git utilities", () => {
expect(baseDiff.diff).not.toContain("file.txt");
});
it("resolves the repository default branch from origin HEAD", async () => {
execSync("git checkout -b develop", { cwd: repoDir });
execSync("git checkout main", { cwd: repoDir });
execSync("git remote add origin https://github.com/acme/repo.git", { cwd: repoDir });
execSync("git update-ref refs/remotes/origin/main refs/heads/main", { cwd: repoDir });
execSync("git update-ref refs/remotes/origin/develop refs/heads/develop", { cwd: repoDir });
execSync("git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main", { cwd: repoDir });
await expect(resolveRepositoryDefaultBranch(repoDir)).resolves.toBe("main");
});
it("merges to stored baseRefName when baseRef is not provided", async () => {
// Create a non-default base branch with a unique commit.
execSync("git checkout -b develop", { cwd: repoDir });