Update workspace and app changes
This commit is contained in:
@@ -399,12 +399,46 @@ export function buildHostAgentsRoute(serverId: string): string {
|
||||
return `${base}/agents`;
|
||||
}
|
||||
|
||||
export function buildHostNewAgentRoute(serverId: string): string {
|
||||
export function buildHostNewAgentRoute(
|
||||
serverId: string,
|
||||
options?: {
|
||||
workingDir?: string;
|
||||
provider?: string;
|
||||
modeId?: string;
|
||||
model?: string;
|
||||
thinkingOptionId?: string;
|
||||
worktreeMode?: "create" | "attach";
|
||||
}
|
||||
): string {
|
||||
const base = buildHostRootRoute(serverId);
|
||||
if (base === "/") {
|
||||
return "/";
|
||||
}
|
||||
return `${base}/new-agent`;
|
||||
const searchParams = new URLSearchParams();
|
||||
const entries: Array<[string, string | undefined]> = [
|
||||
["workingDir", options?.workingDir],
|
||||
["provider", options?.provider],
|
||||
["modeId", options?.modeId],
|
||||
["model", options?.model],
|
||||
["thinkingOptionId", options?.thinkingOptionId],
|
||||
["worktreeMode", options?.worktreeMode],
|
||||
];
|
||||
for (const [key, value] of entries) {
|
||||
const normalized = trimNonEmpty(value);
|
||||
if (normalized) {
|
||||
searchParams.set(key, normalized);
|
||||
}
|
||||
}
|
||||
const search = searchParams.toString();
|
||||
return search ? `${base}/new-agent?${search}` : `${base}/new-agent`;
|
||||
}
|
||||
|
||||
export function buildHostOpenProjectRoute(serverId: string): string {
|
||||
const base = buildHostRootRoute(serverId);
|
||||
if (base === "/") {
|
||||
return "/";
|
||||
}
|
||||
return `${base}/open-project`;
|
||||
}
|
||||
|
||||
export function buildHostSettingsRoute(serverId: string): string {
|
||||
@@ -435,6 +469,9 @@ export function mapPathnameToServer(
|
||||
if (suffix.startsWith("new-agent")) {
|
||||
return `${base}/new-agent`;
|
||||
}
|
||||
if (suffix.startsWith("open-project")) {
|
||||
return `${base}/open-project`;
|
||||
}
|
||||
const workspaceRoute = parseHostWorkspaceRouteFromPathname(pathname);
|
||||
if (workspaceRoute) {
|
||||
const workspacePath = buildHostWorkspaceRoute(
|
||||
|
||||
Reference in New Issue
Block a user