#!/usr/bin/env node
import {a as a$1}from'./chunk-EKZDFEJW.js';import'./chunk-5TAVYPOV.js';import*as n from'fs';import*as o from'path';import*as i from'js-yaml';var a=class{name="claude-code";tasksDir;constructor(e=process.cwd()){this.tasksDir=o.join(e,".paradigm","tasks");}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return  true}supportsMcp(){return  true}getTokenCost(e){return a$1[e]}async isAvailable(){let e=o.join(process.env.HOME||"",".claude");return n.existsSync(e)||process.env.CLAUDE_CODE==="1"||process.env.TERM_PROGRAM==="claude"}async*spawn(e,s){let t=this.generateTaskId(e.name),u=o.join(this.tasksDir,`${t}.yaml`);n.existsSync(this.tasksDir)||n.mkdirSync(this.tasksDir,{recursive:true});let p={id:t,agent:e.name,model:s.model||"sonnet",status:"pending",created:new Date().toISOString(),task:s.task,context:{systemPrompt:s.context.systemPrompt,symbols:s.context.symbols,handoffContext:s.context.handoffContext},role:e.role,focus:e.focus};n.writeFileSync(u,i.dump(p)),yield {type:"text",content:`Task created: ${t}
`,timestamp:new Date().toISOString()},yield {type:"text",content:`
---
**To execute this agent, use the Task tool with:**
\`\`\`
${this.buildTaskPrompt(e,s)}
\`\`\`
---
`,timestamp:new Date().toISOString()},yield {type:"done",content:"Task file created. Execute via Claude Code Task tool.",usage:{input:0,output:0,total:0},timestamp:new Date().toISOString()};}generateTaskId(e){let s=Date.now(),t=Math.random().toString(36).substring(2,6);return `${e}-${s}-${t}`}buildTaskPrompt(e,s){let t=[];return t.push(`You are the ${e.name.toUpperCase()} agent.`),t.push(""),t.push("## Your Role"),t.push(e.role),t.push(""),t.push("## Task"),t.push(s.task),t.push(""),s.context.symbols.length>0&&(t.push("## Symbols in Scope"),t.push(s.context.symbols.join(", ")),t.push("")),s.context.handoffContext&&(t.push("## Context from Previous Agent"),t.push(s.context.handoffContext),t.push("")),t.push("## Focus Areas"),t.push(`Read: ${e.focus.reads.join(", ")}`),t.push(`Write: ${e.focus.writes.join(", ")}`),t.join(`
`)}};export{a as ClaudeCodeTaskProvider};