app: hard-cut workspace routing to workspace-only URLs

This commit is contained in:
Mohamed Boudra
2026-03-04 22:35:30 +07:00
parent ee8e2ab691
commit 73fce89edd
22 changed files with 300 additions and 608 deletions
+7 -5
View File
@@ -1,8 +1,9 @@
import type { CheckoutStatusPayload } from "@/hooks/use-checkout-status-query";
import {
parseHostWorkspaceOpenIntentFromPathname,
buildHostWorkspaceRoute,
parseHostAgentRouteFromPathname,
parseHostWorkspaceTabRouteFromPathname,
parseHostWorkspaceRouteFromPathname,
} from "@/utils/host-routes";
export function parseAgentKey(
@@ -27,11 +28,12 @@ export function resolveSelectedAgentForNewAgent(input: {
pathname: string;
selectedAgentId?: string;
}): { serverId: string; agentId: string } | null {
const workspaceTabRoute = parseHostWorkspaceTabRouteFromPathname(input.pathname);
if (workspaceTabRoute?.tabId?.startsWith("agent_")) {
const agentId = workspaceTabRoute.tabId.slice("agent_".length).trim();
const workspaceRoute = parseHostWorkspaceRouteFromPathname(input.pathname);
const openIntent = parseHostWorkspaceOpenIntentFromPathname(input.pathname);
if (workspaceRoute && openIntent?.kind === "agent") {
const agentId = openIntent.agentId.trim();
if (agentId) {
return { serverId: workspaceTabRoute.serverId, agentId };
return { serverId: workspaceRoute.serverId, agentId };
}
}
return (