feat: update sidebar agent workflow and host filter UI

This commit is contained in:
Mohamed Boudra
2026-02-15 08:59:17 +07:00
parent 9da5b26db0
commit 41d1fa6d97
31 changed files with 2482 additions and 1133 deletions
+32 -1
View File
@@ -1,5 +1,36 @@
import type { CheckoutStatusPayload } from "@/hooks/use-checkout-status-query";
import { buildHostAgentDraftRoute } from "@/utils/host-routes";
import {
buildHostAgentDraftRoute,
parseHostAgentRouteFromPathname,
} from "@/utils/host-routes";
export function parseAgentKey(
key: string | null | undefined
): { serverId: string; agentId: string } | null {
if (!key) {
return null;
}
const sep = key.lastIndexOf(":");
if (sep <= 0 || sep >= key.length - 1) {
return null;
}
const serverId = key.slice(0, sep).trim();
const agentId = key.slice(sep + 1).trim();
if (!serverId || !agentId) {
return null;
}
return { serverId, agentId };
}
export function resolveSelectedAgentForNewAgent(input: {
pathname: string;
selectedAgentId?: string;
}): { serverId: string; agentId: string } | null {
return (
parseHostAgentRouteFromPathname(input.pathname) ??
parseAgentKey(input.selectedAgentId)
);
}
export function resolveNewAgentWorkingDir(
cwd: string,