import{AGENTS as e}from"../definitions/agents.mjs";import{MCP_SERVER_ENTRY as t,SERVER_NAME as n}from"../definitions/mcp.mjs";import{PROMPTS as r}from"../definitions/prompts.mjs";import{buildMcpConfigJson as i,buildPromptFile as a,lowerFirst as o}from"./_shared.mjs";function s(e){return e?.length?[`## Skills`,``,`| Skill | When to load |`,`|-------|--------------|`,...e.map(([e,t])=>`| ${e} | ${t} |`),``]:[]}function c(e,t,n,r,i){let a=[`# ${e} - ${t||e}`,``,`> ${n}`,``,`You are the **${e}**, ${o(n)}.`,``];return i&&a.push(i.trim(),``),a.push(...s(r)),a.join(`
`)}function l(){let o=[];o.push({path:`mcp.json`,content:`${i({serverName:n,mcpEntry:t,configKey:`mcpServers`})}\n`});for(let[e,t]of Object.entries(r))o.push({path:`.aiassistant/prompts/aikit-${e}.md`,content:a({title:`aikit ${e}`,content:[`> ${t.description}`,``,t.content.trim(),``].join(`
`)})});for(let[t,n]of Object.entries(e)){if(n.variants){for(let[e,r]of Object.entries(n.variants)){let i=`${t}-${e}`,a=r.description||n.description;o.push({path:`.aiassistant/prompts/agent-${i}.md`,content:c(i,n.title,a,n.skills,r.bodyAddendum)})}continue}o.push({path:`.aiassistant/prompts/agent-${t}.md`,content:c(t,n.title,n.description,n.skills)})}return o}export{l as generateIntelliJ};