import{d as e}from"./errors-pXKbCKbL.js";import{t}from"./xling-DyktHkvX.js";import{t as n}from"./claude-F-aLoUUK.js";import{t as r}from"./codex-BDB0z8Gw.js";import{t as i}from"./gemini-CPA89gOH.js";var a=class{#e;constructor(){this.#e=new Map,this.#e.set(`claude`,new n),this.#e.set(`codex`,new r),this.#e.set(`gemini`,new i),this.#e.set(`xling`,new t)}async execute(e){let t=this.#t(e.tool);switch(e.action){case`list`:return{success:!0,data:await t.list(e.scope)};case`switch-profile`:if(!e.profile)throw Error(`Profile is required for switch-profile action`);if(!t.switchProfile)throw Error(`Tool ${e.tool} does not support profile switching`);return await t.switchProfile(e.scope,e.profile,e.switchOptions);case`edit`:if(!t.edit)throw Error(`Tool ${e.tool} does not support editing via CLI`);return await t.edit(e.scope,{name:e.name,ide:e.ide});case`inspect`:if(!t.inspect)throw Error(`Tool ${e.tool} does not support inspect action`);return{success:!0,data:await t.inspect(e.scope)};default:throw Error(`Unsupported action: ${e.action}`)}}#t(t){let n=this.#e.get(t);if(!n)throw new e(t);return n}registerAdapter(e){this.#e.set(e.toolId,e)}getSupportedTools(){return Array.from(this.#e.keys())}};export{a as t};