MCPcopy Create free account
hub / github.com/TinyAGI/fractals / executeTask

Function executeTask

src/executor.ts:103–119  ·  view source on GitHub ↗
(
  task: Task,
  workspacePath: string,
  provider: ExecutorProvider = "claude"
)

Source from the content-addressed store, hash-verified

101
102/** Execute a single atomic task using the specified provider in a git worktree. */
103export async function executeTask(
104 task: Task,
105 workspacePath: string,
106 provider: ExecutorProvider = "claude"
107): Promise<string> {
108 console.log(`[execute] [${task.id}] "${task.description}" (${provider})`);
109
110 const worktreePath = await createWorktree(workspacePath, task.id);
111 console.log(`[execute] [${task.id}] worktree: ${worktreePath}`);
112
113 const prompt = buildPrompt(task);
114
115 const invoke = provider === "codex" ? invokeCodex : invokeClaude;
116 const result = await invoke(prompt, worktreePath);
117 console.log(`[execute] [${task.id}] done`);
118 return result;
119}

Callers 1

server.tsFile · 0.85

Calls 2

createWorktreeFunction · 0.85
buildPromptFunction · 0.85

Tested by

no test coverage detected