refactor: centralize host route builders and add dedicated new-agent route

This commit is contained in:
Mohamed Boudra
2026-03-04 15:09:06 +07:00
parent 92991ffdb8
commit f47ea7afe5
17 changed files with 231 additions and 193 deletions

View File

@@ -1,5 +1,7 @@
import { describe, expect, it } from "vitest";
import {
buildHostNewAgentRoute,
buildHostRootRoute,
buildHostWorkspaceAgentTabRoute,
buildHostWorkspaceFileTabRoute,
buildHostWorkspaceRoute,
@@ -70,6 +72,14 @@ describe("workspace route parsing", () => {
expect(buildHostWorkspaceRoute("local", "/tmp/repo")).toBe("/h/local/workspace/L3RtcC9yZXBv");
});
it("builds host root routes", () => {
expect(buildHostRootRoute("local")).toBe("/h/local");
});
it("builds host new-agent routes", () => {
expect(buildHostNewAgentRoute("local")).toBe("/h/local/new-agent");
});
it("builds workspace agent tab routes", () => {
expect(buildHostWorkspaceAgentTabRoute("local", "/tmp/repo", "agent-1")).toBe(
"/h/local/workspace/L3RtcC9yZXBv/tab/agent_agent-1"