MCPcopy
hub / github.com/nowork-studio/NotFair / getActiveProject

Function getActiveProject

notfair-cmo/src/server/active-project.ts:7–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const COOKIE_NAME = "notfair_active_project";
6
7export async function getActiveProject(): Promise<Project | null> {
8 const c = await cookies();
9 const slug = c.get(COOKIE_NAME)?.value;
10 if (slug) {
11 const p = getProject(slug);
12 if (p && !p.archived_at) return p;
13 }
14 // Fall back to the first non-archived project, if any.
15 const all = listProjects();
16 return all[0] ?? null;
17}
18
19export async function setActiveProject(slug: string): Promise<void> {
20 const c = await cookies();

Callers 15

AppSidebarFunction · 0.90
RootRedirectFunction · 0.90
AppLayoutFunction · 0.90
GETFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90
GETFunction · 0.90
startMcpConnectFunction · 0.90
disconnectMcpActionFunction · 0.90
listMcpToolsActionFunction · 0.90
addUserMcpServerActionFunction · 0.90

Calls 2

getProjectFunction · 0.90
listProjectsFunction · 0.90

Tested by

no test coverage detected