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

Function agentExistsInProject

notfair-cmo/src/server/agents/clone.ts:120–131  ·  view source on GitHub ↗
(project_slug: string, slug: string)

Source from the content-addressed store, hash-verified

118}
119
120export function agentExistsInProject(project_slug: string, slug: string): boolean {
121 const agentId = `${project_slug}-${slug}`;
122 const dir = workspaceDirFor(agentId);
123 if (!existsSync(dir)) return false;
124 try {
125 // eslint-disable-next-line @typescript-eslint/no-require-imports
126 const { readdirSync } = require("node:fs") as typeof import("node:fs");
127 return readdirSync(dir).length > 0;
128 } catch {
129 return true;
130 }
131}
132
133/** Cascade-delete an agent's workspace + sessions + scheduled jobs. */
134export async function cascadeDeleteAgent(agent_id: string, project_slug: string): Promise<void> {

Callers 2

createAgentActionFunction · 0.90
cloneAgentFunction · 0.85

Calls 1

workspaceDirForFunction · 0.90

Tested by

no test coverage detected