#!/usr/bin/env node
import {a as a$1}from'./chunk-EKZDFEJW.js';import'./chunk-XHJ27CER.js';import*as a from'fs';import*as i from'path';import*as m from'js-yaml';var h=class{name="manual";rootDir;constructor(e=process.cwd()){this.rootDir=e;}listModels(){return ["opus","sonnet","haiku"]}supportsParallel(){return  false}supportsMcp(){return  true}getTokenCost(e){return a$1[e]}async isAvailable(){return  true}async*spawn(e,n){let s=i.join(this.rootDir,".paradigm","handoffs"),t=i.join(this.rootDir,".paradigm","tasks");for(let p of [s,t])a.existsSync(p)||a.mkdirSync(p,{recursive:true});let o=`${Date.now()}-manual-${e.name}`,l=i.join(s,`${o}.yaml`),r=i.join(t,`${o}.md`),c={id:o,from:"orchestrator",to:e.name,timestamp:new Date().toISOString(),status:"pending",completed:{symbols:n.context.symbols,artifacts:[]},context:{summary:n.task,key_symbols:n.context.symbols.map(p=>({symbol:p,relevance:"task-related"})),warnings:["This is a manual handoff - execute the task file manually"],suggested_approach:`Read ${r} and follow the instructions`}};a.writeFileSync(l,m.dump(c));let d=this.buildTaskFile(e,n,o);a.writeFileSync(r,d),yield {type:"text",content:`
\u{1F4CB} **Manual Handoff Created**

`,timestamp:new Date().toISOString()},yield {type:"text",content:`Agent: **${e.name}**
`,timestamp:new Date().toISOString()},yield {type:"text",content:`Task: ${n.task}

`,timestamp:new Date().toISOString()},yield {type:"text",content:`**To execute manually:**
`,timestamp:new Date().toISOString()},yield {type:"text",content:`1. Open: ${r}
`,timestamp:new Date().toISOString()},yield {type:"text",content:`2. Follow the instructions in the file
`,timestamp:new Date().toISOString()},yield {type:"text",content:`3. Run: \`paradigm team accept ${o}\` when done

`,timestamp:new Date().toISOString()},yield {type:"text",content:`Or paste this into a new Claude session:
\`\`\`
${this.buildPrompt(e,n)}
\`\`\`
`,timestamp:new Date().toISOString()},yield {type:"done",content:"Manual handoff created",usage:{input:0,output:0,total:0},timestamp:new Date().toISOString()};}buildTaskFile(e,n,s){let t=[];return t.push(`# ${e.name.toUpperCase()} Task`),t.push(""),t.push(`> Handoff ID: ${s}`),t.push(`> Created: ${new Date().toISOString()}`),t.push(""),t.push("---"),t.push(""),t.push("## Task"),t.push(""),t.push(n.task),t.push(""),t.push("---"),t.push(""),t.push("## Agent Role"),t.push(""),t.push(e.role),t.push(""),t.push("---"),t.push(""),t.push("## Focus Areas"),t.push(""),t.push("**Read:** "+e.focus.reads.join(", ")),t.push(""),t.push("**Write:** "+e.focus.writes.join(", ")),t.push(""),n.context.symbols.length>0&&(t.push("---"),t.push(""),t.push("## Symbols in Scope"),t.push(""),t.push(n.context.symbols.map(o=>`- \`${o}\``).join(`
`)),t.push("")),n.context.handoffContext&&(t.push("---"),t.push(""),t.push("## Context from Previous Agent"),t.push(""),t.push(n.context.handoffContext),t.push("")),t.push("---"),t.push(""),t.push("## When Complete"),t.push(""),t.push("Run:"),t.push("```bash"),t.push(`paradigm team accept ${s}`),t.push("```"),t.push(""),t.join(`
`)}buildPrompt(e,n){let s=[];return s.push(`You are the ${e.name.toUpperCase()} agent.`),s.push(""),s.push("## Your Role"),s.push(e.role),s.push(""),s.push("## Task"),s.push(n.task),n.context.symbols.length>0&&(s.push(""),s.push("## Symbols"),s.push(n.context.symbols.join(", "))),s.join(`
`)}};export{h as ManualProvider};