mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-24 02:02:42 +00:00
* feat(workspaces): align agent and schedule automation Make workspace identity the shared placement boundary for MCP and CLI, while caller identity determines parentage. Keep heartbeats minimal and cron-based without changing legacy rolling interval semantics. * test(cli): expect canonical schedule cadence * fix(automation): preserve workspace and schedule compatibility * fix(automation): preserve compatibility edges * fix(workspaces): align MCP lifecycle resolution * fix(workspaces): preserve creation intent * fix(workspaces): preserve branch and schedule identity
26 lines
726 B
TypeScript
26 lines
726 B
TypeScript
import { expandTilde } from "../utils/path.js";
|
|
import type { ProjectRegistry } from "./workspace-registry.js";
|
|
|
|
export interface WorktreeWorkspaceSource {
|
|
cwd?: string;
|
|
projectId?: string;
|
|
}
|
|
|
|
export async function resolveWorktreeSourceCwd(
|
|
source: WorktreeWorkspaceSource,
|
|
projectRegistry: Pick<ProjectRegistry, "get">,
|
|
): Promise<string> {
|
|
if (source.cwd) {
|
|
return expandTilde(source.cwd);
|
|
}
|
|
if (!source.projectId) {
|
|
throw new Error("cwd or projectId is required for a worktree-backed workspace");
|
|
}
|
|
|
|
const project = await projectRegistry.get(source.projectId);
|
|
if (!project || project.archivedAt) {
|
|
throw new Error(`Project not found: ${source.projectId}`);
|
|
}
|
|
return project.rootPath;
|
|
}
|